pax_global_header00006660000000000000000000000064126770306700014522gustar00rootroot0000000000000052 comment=758535a1df4c5e86b45dddf12db2a54dea28ca40 vim-7.4.1689/000077500000000000000000000000001267703067000125755ustar00rootroot00000000000000vim-7.4.1689/.gitignore000066400000000000000000000020461267703067000145670ustar00rootroot00000000000000# Unixen: object and executable files. *.o src/vim src/xxd/xxd src/auto/if_perl.c src/auto/gui_gtk_gresources.c src/auto/gui_gtk_gresources.h src/tags # We do need src/auto/configure. src/auto/config.aap src/auto/config.cache src/auto/config.h src/auto/config.log src/auto/config.mk src/auto/config.status src/auto/configure.aap src/auto/osdef.h src/auto/link.log src/auto/link.sed src/auto/pathdef.c # Windows *.exe *.idb *.manifest *.exp *.obj *.pdb *.ilk *.sln *.suo *.res *.RES src/if_perl.c src/pathdef.c src/Obj*/pathdef.c gvimext.dll gvimext.lib runtime/doc/uganda.nsis.txt # Borland C++ bcc.cfg *.ilc *.ild *.ilf *.ils *.map *.tds # NetBeans nbproject/* # Mac OSX src/xxd/xxd.dSYM # All platforms *.rej *.orig *.mo *.swp *~ *.pyc *.log src/po/vim.pot # Generated by "make test" src/po/*.ck src/testdir/mbyte.vim src/testdir/mzscheme.vim src/testdir/lua.vim src/testdir/small.vim src/testdir/tiny.vim src/testdir/test*.out src/testdir/test*.failed src/testdir/test.log src/testdir/dostmp/* src/testdir/messages src/testdir/viminfo src/memfile_test vim-7.4.1689/.travis.yml000066400000000000000000000025341267703067000147120ustar00rootroot00000000000000language: c compiler: - clang - gcc env: - COVERAGE=yes CFLAGS=--coverage LDFLAGS=--coverage FEATURES=huge SHADOWOPT= SRCDIR=./src "CONFOPT='--enable-perlinterp --enable-pythoninterp --enable-python3interp --enable-rubyinterp --enable-luainterp'" CHECK_AUTOCONF=yes - COVERAGE=no FEATURES=normal CONFOPT= SHADOWOPT="-C src/shadow" SRCDIR=./src/shadow CHECK_AUTOCONF=no - COVERAGE=no FEATURES=small CONFOPT= SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no - COVERAGE=no FEATURES=tiny CONFOPT= SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no sudo: false branches: except: - /^v[0-9]/ addons: apt: packages: - autoconf - lcov - libperl-dev - python-dev - python3-dev - liblua5.1-0-dev - lua5.1 before_install: - pip install --user cpp-coveralls script: - NPROC=$(getconf _NPROCESSORS_ONLN) - if [ "$CHECK_AUTOCONF" = "yes" -a "$CC" = "gcc" ]; then make -C src autoconf; fi - if [ "x$SHADOWOPT" != x ]; then make -C src shadow; fi && (cd ${SRCDIR} && ./configure --with-features=$FEATURES $CONFOPT --enable-fail-if-missing && make -j$NPROC) - ${SRCDIR}/vim --version - make $SHADOWOPT test after_success: - if [ x"$COVERAGE" = "xyes" ]; then ~/.local/bin/coveralls -b $SRCDIR -x .xs -e ${SRCDIR}/xxd -e ${SRCDIR}/if_perl.c --encodings utf-8 latin-1 EUC-KR; fi # vim:set sts=2 sw=2 tw=0 et: vim-7.4.1689/CONTRIBUTING.md000066400000000000000000000037771267703067000150440ustar00rootroot00000000000000# Contributing to Vim Patches are welcome in whatever form. Discussions about patches happen on the vim-dev maillist. If you create a pull request on GitHub it will be forwarded to the vim-dev maillist. You can also send your patch there directly. An attachment with a unified diff format is preferred. Information about the maillist can be found [on the Vim website]. [on the Vim website]: http://www.vim.org/maillist.php#vim-dev Please consider adding a test. Test coverage isn't very good yet, this needs to improve. Look through recent patches for examples. The tests are located under "src/testdir". # Reporting issues We use GitHub issues, but that is not a requirement. Writing to the Vim maillist is also fine. Please use the GitHub issues only for actual issues. If you are not 100% sure that your problem is a Vim issue, please first discuss this on the Vim user maillist. Try reproducing the problem without any plugins or settings: vim -N -u NONE If you report an issue, please describe exactly how to reproduce it. For example, don't say "insert some text" but say what you did exactly: "ahere is some text<Esc>". Ideally, the steps you list can be used to write a test to verify the problem is fixed. Feel free to report even the smallest problem, also typos in the documentation. You can find known issues in the todo file: ":help todo". Or open [the todo file] on GitHub to see the latest version. [the todo file]: https://github.com/vim/vim/blob/master/runtime/doc/todo.txt # Syntax, indent and other runtime files The latest version of these files can be obtained from the repository. They are usually not updated with numbered patches. If you find a problem with one of these files or have a suggestion for improvement, please first try to contact the maintainer directly. Look in the header of the file for the name and email address. The maintainer will take care of issues and send updates to Bram for distribution with Vim. If the maintainer does not react, contact the vim-dev maillist. vim-7.4.1689/Filelist000066400000000000000000000440661267703067000143050ustar00rootroot00000000000000# List of distributed Vim files. # Used by Makefile and upload.aap. # source files for all source archives SRC_ALL = \ .hgignore \ .travis.yml \ appveyor.yml \ src/appveyor.bat \ src/README.txt \ src/alloc.h \ src/arabic.c \ src/arabic.h \ src/ascii.h \ src/blowfish.c \ src/buffer.c \ src/channel.c \ src/charset.c \ src/crypt.c \ src/crypt_zip.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/hardcopy.c \ src/hashtab.c \ src/json.c \ src/json_test.c \ src/keymap.h \ src/macros.h \ src/main.c \ src/mark.c \ src/mbyte.c \ src/memfile.c \ src/memfile_test.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/popupmnu.c \ src/quickfix.c \ src/regexp.c \ src/regexp_nfa.c \ src/regexp.h \ src/screen.c \ src/search.c \ src/sha256.c \ src/structs.h \ src/spell.c \ 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/winclip.c \ src/window.c \ src/xxd/xxd.c \ src/main.aap \ src/testdir/main.aap \ src/testdir/README.txt \ src/testdir/Make_all.mak \ src/testdir/*.in \ src/testdir/*.py \ src/testdir/sautest/autoload/*.vim \ src/testdir/runtest.vim \ src/testdir/test[0-9]*.ok \ src/testdir/test[0-9]*a.ok \ src/testdir/test_[a-z]*.ok \ src/testdir/test49.vim \ src/testdir/test60.vim \ src/testdir/test83-tags? \ src/testdir/test77a.com \ src/testdir/test_*.vim \ src/testdir/python2/*.py \ src/testdir/python3/*.py \ src/testdir/pythonx/*.py \ src/testdir/pythonx/topmodule/__init__.py \ src/testdir/pythonx/topmodule/submodule/__init__.py \ src/testdir/pythonx/topmodule/submodule/subsubmodule/__init__.py \ src/testdir/pythonx/topmodule/submodule/subsubmodule/subsubsubmodule.py \ src/testdir/python_after/*.py \ src/testdir/python_before/*.py \ src/testdir/bench*.in \ src/testdir/bench*.vim \ src/testdir/samples/*.txt \ src/proto.h \ src/proto/blowfish.pro \ src/proto/buffer.pro \ src/proto/channel.pro \ src/proto/charset.pro \ src/proto/crypt.pro \ src/proto/crypt_zip.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/hardcopy.pro \ src/proto/hashtab.pro \ src/proto/json.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/popupmnu.pro \ src/proto/quickfix.pro \ src/proto/regexp.pro \ src/proto/screen.pro \ src/proto/search.pro \ src/proto/sha256.pro \ src/proto/spell.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/winclip.pro \ src/proto/window.pro \ # source files for Unix only SRC_UNIX = \ Makefile \ Filelist \ README_src.txt \ configure \ pixmaps/*.xpm \ pixmaps/*.png \ pixmaps/gen-inline-pixbufs.sh \ pixmaps/stock_icons.h \ src/INSTALL \ src/INSTALLx.txt \ 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_gtk_res.xml \ src/gui_motif.c \ src/gui_xmdlg.c \ src/gui_xmebw.c \ src/gui_xmebw.h \ src/gui_xmebwp.h \ src/gui_x11.c \ src/gui_x11_pm.h \ src/hangulin.c \ src/if_xcmdsrv.c \ src/integration.c \ src/integration.h \ src/link.sh \ src/installman.sh \ src/installml.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_gtk_gresources.pro \ src/proto/gui_motif.pro \ src/proto/gui_xmdlg.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/gvimtutor \ 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_lua.c \ src/if_mzsch.c \ src/if_mzsch.h \ src/if_perl.xs \ src/if_perlsfio.c \ src/if_python.c \ src/if_python3.c \ src/if_py_both.h \ src/if_ruby.c \ src/if_tcl.c \ src/proto/if_cscope.pro \ src/proto/if_lua.pro \ src/proto/if_mzsch.pro \ src/proto/if_perl.pro \ src/proto/if_perlsfio.pro \ src/proto/if_python.pro \ src/proto/if_python3.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/*.mak \ src/GvimExt/GvimExt.reg \ src/GvimExt/Makefile \ src/GvimExt/README.txt \ src/GvimExt/gvimext.cpp \ src/GvimExt/gvimext.def \ src/GvimExt/gvimext.h \ src/GvimExt/gvimext.inf \ src/GvimExt/gvimext.rc \ src/GvimExt/gvimext_ming.def \ src/GvimExt/gvimext_ming.rc \ src/GvimExt/resource.h \ src/GvimExt/uninst.bat \ README_srcdos.txt \ src/INSTALLpc.txt \ src/Make_bc5.mak \ src/Make_cyg.mak \ src/Make_cyg_ming.mak \ src/Make_ivc.mak \ src/Make_dvc.mak \ src/Make_ming.mak \ src/Make_mvc.mak \ src/bigvim.bat \ src/bigvim64.bat \ src/msvcsetup.bat \ src/msvc2008.bat \ src/msvc2010.bat \ src/dimm.idl \ src/dlldata.c \ src/dosinst.c \ src/dosinst.h \ src/glbl_ime.cpp \ src/glbl_ime.h \ src/gui_dwrite.cpp \ src/gui_dwrite.h \ src/gui_w32.c \ src/gui_w32_rc.h \ src/if_ole.cpp \ src/if_ole.h \ src/if_ole.idl \ src/if_perl_msvc/stdbool.h \ src/iid_ole.c \ src/os_dos.h \ src/os_w32dll.c \ src/os_w32exe.c \ src/os_win32.c \ src/os_mswin.c \ src/os_win32.h \ src/proto/gui_w32.pro \ src/proto/if_ole.pro \ src/proto/os_win32.pro \ src/proto/os_mswin.pro \ src/testdir/Make_dos.mak \ src/testdir/Make_ming.mak \ src/testdir/dos.vim \ src/uninstal.c \ src/vim.def \ src/vim.rc \ src/vimio.h \ src/gvim.exe.mnf \ src/vimrun.c \ src/vimtbar.h \ src/xpm_w32.c \ src/xpm_w32.h \ src/xxd/Make_bc5.mak \ src/xxd/Make_ming.mak \ src/xxd/Make_mvc.mak \ nsis/gvim.nsi \ nsis/gvim_version.nsh \ 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/*.bmp \ src/tearoff.bmp \ src/tools.bmp \ src/vim*.ico \ src/vim.tlb \ src/vimtbar.lib \ src/xpm/COPYRIGHT \ src/xpm/README.txt \ src/xpm/include/*.h \ src/xpm/x64/lib/libXpm.a \ src/xpm/x64/lib/libXpm.lib \ src/xpm/x86/lib/libXpm.a \ src/xpm/x86/lib/libXpm.lib \ src/vimtbar.dll \ nsis/icons/*.bmp \ nsis/icons/*.ico \ # 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_dice.mak \ src/Make_manx.mak \ src/Make_morph.mak \ src/Make_sas.mak \ src/os_amiga.c \ src/os_amiga.h \ 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/dehqx.py \ src/gui_mac.c \ src/os_mac_rsrc/*.icns \ src/os_mac.h \ src/os_mac.rsr.hqx \ src/os_mac_conv.c \ src/os_macosx.m \ src/proto/gui_mac.pro \ src/proto/os_mac_conv.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 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_QNX) \ $(SRC_VMS) \ README_os390.txt \ src/Make_mint.mak \ src/infplist.xml \ src/link.390 \ src/os_beos.c \ src/os_beos.h \ src/os_beos.rsrc \ src/proto/os_beos.pro \ src/os_mint.h \ src/os_vms_fix.com \ src/toolbar.phi \ # runtime files for all distributions RT_ALL = \ README.txt \ README.md \ CONTRIBUTING.md \ 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/editexisting.vim \ runtime/macros/hanoi/click.me \ runtime/macros/hanoi/hanoi.vim \ runtime/macros/hanoi/poster \ runtime/macros/justify.vim \ runtime/macros/less.bat \ runtime/macros/less.sh \ runtime/macros/less.vim \ runtime/macros/life/click.me \ runtime/macros/life/life.vim \ runtime/macros/matchit.vim \ 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/pack/dist/opt/dvorak/plugin/dvorak.vim \ runtime/pack/dist/opt/dvorak/dvorak/enable.vim \ runtime/pack/dist/opt/dvorak/dvorak/disable.vim \ runtime/pack/dist/opt/editexisting/plugin/editexisting.vim \ runtime/pack/dist/opt/justify/plugin/justify.vim \ runtime/pack/dist/opt/matchit/plugin/matchit.vim \ runtime/pack/dist/opt/matchit/doc/matchit.txt \ runtime/pack/dist/opt/matchit/doc/tags \ runtime/pack/dist/opt/shellmenu/plugin/shellmenu.vim \ runtime/pack/dist/opt/swapmouse/plugin/swapmouse.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/macmap.vim \ runtime/delmenu.vim \ runtime/synmenu.vim \ runtime/makemenu.vim \ runtime/autoload/*.vim \ runtime/autoload/README.txt \ runtime/autoload/xml/*.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/logtalk.dict \ 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/hi16-action-make.png \ runtime/hi22-action-make.png \ runtime/vim16x16.png \ runtime/vim16x16.xpm \ runtime/vim32x32.png \ runtime/vim32x32.xpm \ runtime/vim48x48.png \ runtime/vim48x48.xpm \ runtime/gvim.desktop \ runtime/vim.desktop \ # 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 \ runtime/doc.info \ runtime/doc/*.info \ runtime/icons/README.txt \ runtime/icons/*.info \ 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/README.txt \ farsi/fonts/*/far-* \ runtime/vimlogo.xpm \ src/swis.s \ src/tee/Makefile \ src/tee/Make_mvc.mak \ src/tee/tee.c \ # files in READMEdir that are included from the top dir IN_README_DIR = \ README.txt.info \ README_ami.txt \ README_ami.txt.info \ README_amibin.txt \ README_amibin.txt.info \ README_amisrc.txt \ README_amisrc.txt.info \ README_bindos.txt \ README_dos.txt \ README_extra.txt \ README_mac.txt \ README_ole.txt \ README_os2.txt \ README_os390.txt \ README_src.txt \ README_srcdos.txt \ README_unix.txt \ README_vms.txt \ README_w32s.txt \ Contents \ Contents.info \ Vim.info \ Xxd.info \ runtime.info \ src.info \ vimdir.info \ # generic language files LANG_GEN = \ runtime/doc/*-de.1 \ runtime/doc/*-de.UTF-8.1 \ runtime/doc/*-fr.1 \ runtime/doc/*-fr.UTF-8.1 \ runtime/doc/*-it.1 \ runtime/doc/*-it.UTF-8.1 \ runtime/doc/*-ja.UTF-8.1 \ runtime/doc/*-pl.1 \ runtime/doc/*-pl.UTF-8.1 \ runtime/doc/*-ru.1 \ runtime/doc/*-ru.UTF-8.1 \ 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.utf-8 \ runtime/tutor/tutor.?? \ runtime/tutor/tutor.??.utf-8 \ runtime/tutor/tutor.??.euc \ runtime/tutor/tutor.??.sjis \ runtime/tutor/tutor.??.iso9 \ runtime/tutor/tutor.??.big5 \ runtime/tutor/tutor.??.cp1250 \ runtime/tutor/tutor.??.cp1251 \ runtime/tutor/tutor.??.cp737 \ runtime/tutor/tutor.??_??.utf-8 \ runtime/tutor/tutor.bar \ runtime/tutor/tutor.bar.utf-8 \ runtime/spell/README.txt \ runtime/spell/??/*.diff \ runtime/spell/??/main.aap \ runtime/spell/tet/*.diff \ runtime/spell/tet/main.aap \ runtime/spell/check/main.aap \ runtime/spell/check/*.aff \ runtime/spell/check/*.dic \ runtime/spell/yi/README.txt \ runtime/spell/main.aap \ runtime/spell/*.vim \ # generic language files, binary LANG_GEN_BIN = \ runtime/spell/README_en.txt \ runtime/spell/en.ascii.spl \ runtime/spell/en.latin1.spl \ runtime/spell/en.utf-8.spl \ runtime/spell/en.ascii.sug \ runtime/spell/en.latin1.sug \ runtime/spell/en.utf-8.sug \ # all files for lang archive LANG_SRC = \ src/po/README.txt \ src/po/README_mingw.txt \ src/po/README_mvc.txt \ src/po/check.vim \ src/po/cleanup.vim \ src/po/Makefile \ src/po/Make_cyg.mak \ 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: vim-7.4.1689/Makefile000066400000000000000000000537531267703067000142520ustar00rootroot00000000000000# This Makefile has two purposes: # 1. Starting the compilation of Vim for Unix. # 2. Creating the various distribution files. ######################################################################### # 1. Starting the compilation of Vim for Unix. # # 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: @if test ! -f src/auto/config.mk; then \ cp src/config.mk.dist src/auto/config.mk; \ fi @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 reconfig proto depend lint tags types test testclean clean distclean: @if test ! -f src/auto/config.mk; then \ cp src/config.mk.dist src/auto/config.mk; \ fi @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. Creating the various distribution files. # # TARGET PRODUCES CONTAINS # unixall vim-#.#.tar.bz2 All runtime files and sources, for Unix # # html vim##html.zip HTML docs # # 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 # # OBSOLETE # amisrc vim##src.tgz sources for Amiga # amirt vim##rt.tgz runtime for Amiga # amibin vim##bin.tgz binary for Amiga # # 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 Unix archive and compiled binaries. # Before creating an archive first delete all backup files, *.orig, etc. MAJOR = 7 MINOR = 4 # Uncomment this line if the Win32s version is to be included. # DOSBIN_S = dosbin_s # Uncomment this line if the 16 bit DOS version is to be included. # DOSBIN_D16 = dosbin_d16 # Uncomment this line if the 32 bit DOS version is to be included. # DOSBIN_D32 = dosbin_d32 # CHECKLIST for creating a new version: # # - Update Vim version number. For a test version in: src/version.h, Contents, # MAJOR/MINOR above, VIMMAJOR and VIMMINOR in src/Makefile, README*.txt, # runtime/doc/*.txt and nsis/gvim.nsi. # For a minor/major version: src/GvimExt/GvimExt.reg, src/vim.def, # src/vim16.def, src/gvim.exe.mnf. # - Compile Vim with GTK, Perl, Python, Python3, TCL, Ruby, MZscheme, Lua (if # you can make it all work), Cscope and "huge" features. Exclude workshop # and SNiFF. # - 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). # - If you have a lint program: "make lint" and check the output (ignore GTK # warnings). # - If you have valgrind, enable it in src/testdir/Makefile and run "make # test". Enable EXITFREE, disable GUI, scheme and tcl to avoid false alarms. # Check the valgrind output. # - If you have the efence library, enable it in "src/Makefile" and run "make # test". Disable Python and Ruby to avoid trouble with threads (efence is # not threadsafe). # - Adjust the date and other info in src/version.h. # - Correct included_patches[] in src/version.c. # - 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/version7.txt. # - Check that runtime/doc/help.txt doesn't contain entries in "LOCAL # ADDITIONS". # - In runtime/doc run "make" and "make html" to check for errors. # - Check if src/Makefile, src/testdir/Makefile and src/feature.h don't contain # any personal preferences or the changes mentioned above. # - 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 html" # - Make diff files against the previous release: "makediff7 7.1 7.2" # # Amiga: (OBSOLETE, Amiga files are no longer distributed) # - "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". # # MS-Windows: # - Run make on Unix to update the ".mo" files. # - Get libintl-8.dll and libiconv-2.dll. E.g. from # https://mlocati.github.io/gettext-iconv-windows/ . # Put them in the top directory, "make dosrt" uses them. # - > make dossrc # > make dosrt # Unpack dist/vim##rt.zip and dist/vim##src.zip on an MS-Windows PC. # Win32 console version build: # - Set environment for Visual C++ 2008, e.g.: # > src/msvc2008.bat # Or: # > C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat # Or, when using the Visual C++ Toolkit 2003: "msvcsetup.bat" (adjust the # paths when necessary). # For Windows 98/ME the 2003 version is required, but then the executable # won't work on Windows 7 and 64 bit systems. # - > cd src # > nmake -f Make_mvc.mak # - Run the tests: # > rm testdir/*.out testdir/*.res # > nmake -f Make_mvc.mak test # - check the output. # - Rename vim.exe to vimw32.exe, xxd/xxd.exe to xxdw32.exe. # - Rename vim.pdb to vimw32.pdb. # - Rename install.exe to installw32.exe and uninstal.exe to uninstalw32.exe. # Win32 GUI version build: # - > cd src # > nmake -f Make_mvc.mak GUI=yes # - Run the tests: # > rm testdir/*.out testdir/*.res # > nmake -f Make_mvc.mak testgvim # - check the output. # - move "gvim.exe" to here (otherwise the OLE version will overwrite it). # - Move gvim.pdb to here. # - Copy "GvimExt/gvimext.dll" to here. # - Delete vimrun.exe, install.exe and uninstal.exe. # Win32 GUI version with OLE, PERL, TCL, PYTHON and dynamic IME: # - Install the interfaces you want, see src/INSTALLpc.txt # - Build: # > cd src # Adjust bigvim.bat to match the version of each interface you want. # > bigvim.bat # - Run the tests: # > rm testdir/*.out testdir/*.res # > nmake -f Make_mvc.mak testgvim # - check the output. # - Rename "gvim.exe" to "gvim_ole.exe". # - Rename gvim.pdb to "gvim_ole.pdb". # - Delete install.exe and uninstal.exe. # Create the archives: # - Copy all the "*.exe" files to where this Makefile is. # - Copy all the "*.pdb" files to where this Makefile is. # - in this directory: # > make dosbin # NSIS self installing exe: # - To get NSIS see http://nsis.sourceforge.net # - Make sure gvim_ole.exe, vimw32.exe, installw32.exe, # uninstalw32.exe and xxdw32.exe have been build as mentioned above. # - copy these files (get them from a binary archive or build them): # gvimext.dll in src/GvimExt # gvimext64.dll in src/GvimExt # VisVim.dll in src/VisVim # Note: VisVim needs to be build with MSVC 5, newer versions don't work. # gvimext64.dll can be obtained from http://code.google.com/p/vim-win3264/ # It is part of vim72.zip as vim72/gvimext.dll. # - Make sure there is a diff.exe two levels up (get it from a previous Vim # version). # - go to ../nsis and do: # > makensis gvim.nsi (takes a few minutes). # - Copy gvim##.exe to the dist directory. # # 64 bit builds (these are not in the normal distribution, the 32 bit build # works just fine on 64 bit systems). # Like the console and GUI version, but first run vcvars64.bat or # "..\VC\vcvarsall.bat x86_amd64". # - Build the console version: # > nmake -f Make_mvc.mak # - Build the GUI version: # > nmake -f Make_mvc.mak GUI=yes # - Build the OLE version with interfaces: # > bigvim64.bat # # # OBSOLETE systems: You can build these if you have an appropriate system. # # 16 bit DOS version: You need to get a very old version of Vim, for several # years even the tiny build is too big to fit in DOS memory. # # 32 bit DOS version: Support was removed in 7.4.1399. When syncing to before # that it probably won't build. # # Win32s GUI version: (requires a very old compiler) # - Set environment for Visual C++ 4.1 (requires a new console window): # "vcvars32.bat" (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. # # OS/2 support was removed in patch 7.4.1008. If you want to give it a try # sync to before that and check the old version of this Makefile for # instructions. 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. # Copy README files to the top directory. prepare: if test -f runtime/doc/uganda.nsis.txt; then \ rm runtime/doc/uganda.nsis.txt; fi for name in $(IN_README_DIR); do \ cp READMEdir/"$$name" .; \ done # 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_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_HTML = comment/$(VERSION)-html COMMENT_FARSI = comment/$(VERSION)-farsi dist/$(COMMENT_RT): dist/comment echo "Vim - Vi IMproved - v$(VDOT) runtime files for MS-DOS and MS-Windows" > dist/$(COMMENT_RT) 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_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) unixall: dist prepare -rm -f dist/$(VIMVER).tar.bz2 -rm -rf dist/$(VIMRTDIR) mkdir dist/$(VIMRTDIR) tar cf - \ $(RT_ALL) \ $(RT_ALL_BIN) \ $(RT_UNIX) \ $(RT_UNIX_DOS_BIN) \ $(RT_SCRIPTS) \ $(LANG_GEN) \ $(LANG_GEN_BIN) \ $(SRC_ALL) \ $(SRC_UNIX) \ $(SRC_DOS_UNIX) \ $(EXTRA) \ $(LANG_SRC) \ | (cd dist/$(VIMRTDIR); tar xf -) -rm $(IN_README_DIR) # Need to use a "distclean" config.mk file # Note: this file is not included in the repository to avoid problems, but it's # OK to put it in the archive. 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 # 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 touch dist/$(VIMRTDIR)/src/po/uk.cp1251.po # Create the archive. cd dist && tar cf $(VIMVER).tar $(VIMRTDIR) bzip2 dist/$(VIMVER).tar # Amiga runtime - OBSOLETE 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 -) -rm $(IN_README_DIR) 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 # Amiga binaries - OBSOLETE 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 -) -rm $(IN_README_DIR) 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 # Amiga sources - OBSOLETE 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_ALL) \ $(SRC_AMI) \ $(SRC_AMI_DOS) \ | (cd dist/Vim/$(VIMRTDIR); tar xf -) -rm $(IN_README_DIR) 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 # MS-DOS sources dossrc: dist no_title.vim dist/$(COMMENT_SRC) \ runtime/doc/uganda.nsis.txt \ nsis/gvim_version.nsh -rm -rf dist/vim$(VERSION)src.zip -rm -rf dist/vim mkdir dist/vim mkdir dist/vim/$(VIMRTDIR) tar cf - \ $(SRC_ALL) \ $(SRC_DOS) \ $(SRC_AMI_DOS) \ $(SRC_DOS_UNIX) \ runtime/doc/uganda.nsis.txt \ nsis/gvim_version.nsh \ | (cd dist/vim/$(VIMRTDIR); tar xf -) mv dist/vim/$(VIMRTDIR)/runtime/* dist/vim/$(VIMRTDIR) rmdir dist/vim/$(VIMRTDIR)/runtime # This file needs to be in dos fileformat for NSIS. $(VIM) -e -X -u no_title.vim -c ":set tx|wq" dist/vim/$(VIMRTDIR)/doc/uganda.nsis.txt 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 nsis/gvim_version.nsh: Makefile echo "# Generated from Makefile: define the version numbers" > $@ echo "!ifndef __GVIM_VER__NSH__" >> $@ echo "!define __GVIM_VER__NSH__" >> $@ echo "!define VER_MAJOR $(MAJOR)" >> $@ echo "!define VER_MINOR $(MINOR)" >> $@ echo "!endif" >> $@ dosrt: dist dist/$(COMMENT_RT) dosrt_files -rm -rf dist/vim$(VERSION)rt.zip cd dist && zip -9 -rD -z vim$(VERSION)rt.zip vim <$(COMMENT_RT) # Split in two parts to avoid an "argument list too long" error. # We no longer convert the files from unix to dos fileformat. dosrt_files: dist prepare no_title.vim -rm -rf dist/vim mkdir dist/vim mkdir dist/vim/$(VIMRTDIR) mkdir dist/vim/$(VIMRTDIR)/lang cd src && MAKEMO=yes $(MAKE) languages tar cf - \ $(RT_ALL) \ | (cd dist/vim/$(VIMRTDIR); tar xf -) tar cf - \ $(RT_SCRIPTS) \ $(RT_DOS) \ $(RT_NO_UNIX) \ $(RT_AMI_DOS) \ $(LANG_GEN) \ | (cd dist/vim/$(VIMRTDIR); tar xf -) tar cf - \ $(RT_UNIX_DOS_BIN) \ $(RT_ALL_BIN) \ $(RT_DOS_BIN) \ $(LANG_GEN_BIN) \ | (cd dist/vim/$(VIMRTDIR); tar xf -) -rm $(IN_README_DIR) mv dist/vim/$(VIMRTDIR)/runtime/* dist/vim/$(VIMRTDIR) rmdir dist/vim/$(VIMRTDIR)/runtime # 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, uk.mo / uk.cp1251.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" -a "$$i" != "src/po/uk.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-8.dll dist/vim/$(VIMRTDIR)/ cp libiconv-2.dll dist/vim/$(VIMRTDIR)/ # Used before uploading. Don't delete the AAPDIR/sign files! runtime_unix2dos: dosrt_files -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_ole $(DOSBIN_S) $(DOSBIN_D16) # 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 -) -rm $(IN_README_DIR) 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) cp gvim.pdb dist/gvim$(VERSION).pdb # 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 -) 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) cp vimw32.pdb dist/vim$(VERSION)w32.pdb # 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 -) 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 -) 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 -) 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) cp gvim_ole.pdb dist/gvim$(VERSION)ole.pdb # 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 -) 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) 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) vim-7.4.1689/README.md000066400000000000000000000121261267703067000140560ustar00rootroot00000000000000`README.md` for version 7.4 of Vim: Vi IMproved. [![Build Status](https://travis-ci.org/vim/vim.svg?branch=master)](https://travis-ci.org/vim/vim) [![Coverage Status](https://coveralls.io/repos/vim/vim/badge.svg?branch=master&service=github)](https://coveralls.io/github/vim/vim?branch=master) [![Appveyor Build status](https://ci.appveyor.com/api/projects/status/o2qht2kjm02sgghk?svg=true)](https://ci.appveyor.com/project/chrisbra/vim) [![Coverity Scan](https://scan.coverity.com/projects/241/badge.svg)](https://scan.coverity.com/projects/vim) ## What is Vim? ## Vim is a greatly improved version of the good old UNIX editor Vi. Many new features have been added: multi-level undo, syntax highlighting, command line history, on-line help, spell checking, filename completion, block operations, script language, etc. There is also a Graphical User Interface (GUI) available. Still, Vi compatibility is maintained, those who have Vi "in the fingers" will feel at home. See `runtime/doc/vi_diff.txt` for differences with Vi. This editor is very useful for editing programs and other plain text files. All commands are given with normal keyboard characters, so those who can type with ten fingers can work very fast. Additionally, function keys can be mapped to commands by the user, and the mouse can be used. Vim runs under MS-Windows (NT, 2000, XP, Vista, 7, 8, 10), Macintosh, VMS and almost all flavours of UNIX. Porting to other systems should not be very difficult. Older versions of Vim run on MS-DOS, MS-Windows 95/98/Me, Amiga DOS, Atari MiNT, BeOS, RISC OS and OS/2. These are no longer maintained. ## Distribution ## You can often use your favorite package manager to install Vim. On Mac and Linux a small version of Vim is pre-installed, you still need to install Vim if you want more features. There are separate distributions for Unix, PC, Amiga and some other systems. This `README.md` file comes with the runtime archive. It includes the documentation, syntax files and other files that are used at runtime. To run Vim you must get either one of the binary archives or a source archive. Which one you need depends on the system you want to run it on and whether you want or must compile it yourself. Check http://www.vim.org/download.php for an overview of currently available distributions. ## Compiling ## If you obtained a binary distribution you don't need to compile Vim. If you obtained a source distribution, all the stuff for compiling Vim is in the `src` directory. See `src/INSTALL` for instructions. ## Installation ## See one of these files for system-specific instructions. Either in the READMEdir directory (in the repository) or the top directory (if you unpack an archive): README_ami.txt Amiga README_unix.txt Unix README_dos.txt MS-DOS and MS-Windows README_mac.txt Macintosh README_vms.txt VMS There are other `README_*.txt` files, depending on the distribution you used. ## Documentation ## The Vim tutor is a one hour training course for beginners. Often it can be started as `vimtutor`. See `:help tutor` for more information. The best is to use `:help` in Vim. If you don't have an executable yet, read `runtime/doc/help.txt`. It contains pointers to the other documentation files. The User Manual reads like a book and is recommended to learn to use Vim. See `:help user-manual`. ## Copying ## Vim is Charityware. You can use and copy it as much as you like, but you are encouraged to make a donation to help orphans in Uganda. Please read the file `runtime/doc/uganda.txt` for details (do `:help uganda` inside Vim). Summary of the license: There are no restrictions on using or distributing an unmodified copy of Vim. Parts of Vim may also be distributed, but the license text must always be included. For modified versions a few restrictions apply. The license is GPL compatible, you may compile Vim with GPL libraries and distribute it. ## Sponsoring ## Fixing bugs and adding new features takes a lot of time and effort. To show your appreciation for the work and motivate Bram and others to continue working on Vim please send a donation. Since Bram is back to a paid job the money will now be used to help children in Uganda. See `runtime/doc/uganda.txt`. But at the same time donations increase Bram's motivation to keep working on Vim! For the most recent information about sponsoring look on the Vim web site: http://www.vim.org/sponsor/ ## Contributing ## If you would like to help making Vim better, see the [CONTRIBUTING.md](https://github.com/vim/vim/blob/master/CONTRIBUTING.md) file. ## Information ## The latest news about Vim can be found on the Vim home page: http://www.vim.org/ If you have problems, have a look at the Vim documentation or tips: http://www.vim.org/docs.php http://vim.wikia.com/wiki/Vim_Tips_Wiki If you still have problems or any other questions, use one of the mailing lists to discuss them with Vim users and developers: http://www.vim.org/maillist.php If nothing else works, report bugs directly: Bram Moolenaar ## Main author ## Send any other comments, patches, flowers and suggestions to: Bram Moolenaar vim-7.4.1689/README.txt000066400000000000000000000107531267703067000143010ustar00rootroot00000000000000README.txt for version 7.4 of Vim: Vi IMproved. WHAT IS VIM? Vim is a greatly improved version of the good old UNIX editor Vi. Many new features have been added: multi-level undo, syntax highlighting, command line history, on-line help, spell checking, filename completion, block operations, script language, etc. There is also a Graphical User Interface (GUI) available. Still, Vi compatibility is maintained, those who have Vi "in the fingers" will feel at home. See "runtime/doc/vi_diff.txt" for differences with Vi. This editor is very useful for editing programs and other plain text files. All commands are given with normal keyboard characters, so those who can type with ten fingers can work very fast. Additionally, function keys can be mapped to commands by the user, and the mouse can be used. Vim runs under MS-Windows (NT, 2000, XP, Vista, 7, 8, 10), Macintosh, VMS and almost all flavours of UNIX. Porting to other systems should not be very difficult. Older versions of Vim run on MS-DOS, MS-Windows 95/98/Me, Amiga DOS, Atari MiNT, BeOS, RISC OS and OS/2. These are no longer maintained. DISTRIBUTION You can often use your favorite package manager to install Vim. On Mac and Linux a small version of Vim is pre-installed, you still need to install Vim if you want more features. There are separate distributions for Unix, PC, Amiga and some other systems. This README.txt file comes with the runtime archive. It includes the documentation, syntax files and other files that are used at runtime. To run Vim you must get either one of the binary archives or a source archive. Which one you need depends on the system you want to run it on and whether you want or must compile it yourself. Check "http://www.vim.org/download.php" for an overview of currently available distributions. COMPILING If you obtained a binary distribution you don't need to compile Vim. If you obtained a source distribution, all the stuff for compiling Vim is in the "src" directory. See src/INSTALL for instructions. INSTALLATION See one of these files for system-specific instructions. Either in the READMEdir directory (in the repository) or the top directory (if you unpack an archive): README_ami.txt Amiga README_unix.txt Unix README_dos.txt MS-DOS and MS-Windows README_mac.txt Macintosh README_vms.txt VMS There are more README_*.txt files, depending on the distribution you used. DOCUMENTATION The Vim tutor is a one hour training course for beginners. Often it can be started as "vimtutor". See ":help tutor" for more information. The best is to use ":help" in Vim. If you don't have an executable yet, read "runtime/doc/help.txt". It contains pointers to the other documentation files. The User Manual reads like a book and is recommended to learn to use Vim. See ":help user-manual". COPYING Vim is Charityware. You can use and copy it as much as you like, but you are encouraged to make a donation to help orphans in Uganda. Please read the file "runtime/doc/uganda.txt" for details (do ":help uganda" inside Vim). Summary of the license: There are no restrictions on using or distributing an unmodified copy of Vim. Parts of Vim may also be distributed, but the license text must always be included. For modified versions a few restrictions apply. The license is GPL compatible, you may compile Vim with GPL libraries and distribute it. SPONSORING Fixing bugs and adding new features takes a lot of time and effort. To show your appreciation for the work and motivate Bram and others to continue working on Vim please send a donation. Since Bram is back to a paid job the money will now be used to help children in Uganda. See runtime/doc/uganda.txt. But at the same time donations increase Bram's motivation to keep working on Vim! For the most recent information about sponsoring look on the Vim web site: http://www.vim.org/sponsor/ CONTRIBUTING If you would like to help making Vim better, see the CONTRIBUTING.md file. INFORMATION The latest news about Vim can be found on the Vim home page: http://www.vim.org/ If you have problems, have a look at the Vim documentation or tips: http://www.vim.org/docs.php http://vim.wikia.com/wiki/Vim_Tips_Wiki If you still have problems or any other questions, use one of the mailing lists to discuss them with Vim users and developers: http://www.vim.org/maillist.php If nothing else works, report bugs directly: Bram Moolenaar MAIN AUTHOR Send any other comments, patches, flowers and suggestions to: Bram Moolenaar E-mail: Bram@vim.org vim-7.4.1689/READMEdir/000077500000000000000000000000001267703067000142315ustar00rootroot00000000000000vim-7.4.1689/READMEdir/Contents000066400000000000000000000017731267703067000157610ustar00rootroot00000000000000Vim 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.4. Also runs under UNIX, MS-Windows, Mac, etc. vim74rt.tgz contains the documentation and syntax files. vim74bin.tgz contains the binaries. vim74src.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.10 (1997 May 22) Author: Juergen Weigert vim-7.4.1689/READMEdir/Contents.info000066400000000000000000000011061267703067000167010ustar00rootroot00000000000000@""j"7X@~P_U@_P_T_U_U@_}WQ|9(9|8|ϑ|Ϲ|9|Ϲ|Ϲ|Ϲ;|9(ϸ|O|Ϲ@~P_x@_< UP_*T_ʩU_yU@< }WQ|9(9||U|Uk||Z||uV|?_(U||T :c/MuchMorevim-7.4.1689/READMEdir/README.txt.info000066400000000000000000000011061267703067000166570ustar00rootroot00000000000000\@&(&j"BX@~P_U@_P_T_U_U@_}WQ|9(9|8|ϑ|Ϲ|9|Ϲ|Ϲ|Ϲ;|9(ϸ|O|Ϲ@~P_x@_< UP_*T_ʩU_yU@< }WQ|9(9||U|Uk||Z||uV|?_(U||T :c/MuchMorevim-7.4.1689/READMEdir/README_ami.txt000066400000000000000000000023441267703067000165600ustar00rootroot00000000000000README_ami.txt for version 7.4 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. vim-7.4.1689/READMEdir/README_ami.txt.info000066400000000000000000000011061267703067000175050ustar00rootroot00000000000000@'R8'Sj"T@x~P_U@_P_T_U_U@_}WQ|9(9|8|ϑ|Ϲ|9|Ϲ|Ϲ|Ϲ;|9(ϸ|O|Ϲ@X~P_x@_< UP_*T_ʩU_yU@< }WQ|9(9||U|Uk||Z||uV|?_(U||T :c/MuchMorevim-7.4.1689/READMEdir/README_amibin.txt000066400000000000000000000006441267703067000172520ustar00rootroot00000000000000README_amibin.txt for version 7.4 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. vim-7.4.1689/READMEdir/README_amibin.txt.info000066400000000000000000000011061267703067000201760ustar00rootroot00000000000000N@''j"eJ@~P_U@_P_T_U_U@_}WQ|9(9|8|ϑ|Ϲ|9|Ϲ|Ϲ|Ϲ;|9(ϸ|O|Ϲ@~P_x@_< UP_*T_ʩU_yU@< }WQ|9(9||U|Uk||Z||uV|?_(U||T :c/MuchMorevim-7.4.1689/READMEdir/README_amisrc.txt000066400000000000000000000006051267703067000172660ustar00rootroot00000000000000README_amisrc.txt for version 7.4 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. vim-7.4.1689/READMEdir/README_amisrc.txt.info000066400000000000000000000011061267703067000202150ustar00rootroot000000000000005@"#pj":*@x~P_U@_P_T_U_U@_}WQ|9(9|8|ϑ|Ϲ|9|Ϲ|Ϲ|Ϲ;|9(ϸ|O|Ϲ@X~P_x@_< UP_*T_ʩU_yU@< }WQ|9(9||U|Uk||Z||uV|?_(U||T :c/MuchMorevim-7.4.1689/READMEdir/README_bindos.txt000066400000000000000000000012751267703067000172720ustar00rootroot00000000000000README_bindos.txt for version 7.4 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 (vim74rt.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): vim74w32.zip Windows 95/98/NT/etc. console version gvim74.zip Windows 95/98/NT/etc. GUI version gvim74ole.zip Windows 95/98/NT/etc. GUI version with OLE You MUST also get the runtime archive (vim74rt.zip). The sources are also available (vim74src.zip). vim-7.4.1689/READMEdir/README_dos.txt000066400000000000000000000142421267703067000165770ustar00rootroot00000000000000README_dos.txt for version 7.4 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\vim74", 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 gvim74.zip unzip vim74w32.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\vim74 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\vim74 set path=%path%;D:\editors\vim\vim74 - 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 7.4 will look for your vimrc file in $VIM, and for the runtime files in $VIM/vim74. 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\vim74\vim.exe The Vim version 7.4 executable. C:\vim\vim74\doc\*.txt The version 7.4 documentation files. C:\vim\vim74\bugreport.vim A Vim version 7.4 script. C:\vim\vim74\... Other version 7.4 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\vim74". Don't add "vim74" 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\vim74\vim.exe C:\command.com /c D:\editors\vim\vim74\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 vim-7.4.1689/READMEdir/README_extra.txt000066400000000000000000000026551267703067000171420ustar00rootroot00000000000000README_extra.txt for version 7.4 of Vim: Vi IMproved. These extra files of Vim are for special purposes. This README explains what the files are for. For general information about Vim, see the "README.txt" file. farsi/* Files for the Farsi (persian) language. If you don't know what Farsi is, this is not for you. src/if_sniff.* Interface to SNiFF. If you don't know what SNiFF is, this is not for you. src/os_amiga.* Files for the Amiga port. src/gui_beos.* src/os_beos.* Files for the BeOS port. src/os_msdos.* src/os_dos.* Files for the MS-DOS port. src/gui_mac.* src/os_mac.* Files for the Mac port. src/os_mint.8 Files for the Atari Mint port. src/os_os2* Files for the OS/2 port. src/tee/* Extra program for OS/2. src/os_vms* Files for the VMS port. src/os_w32* src/os_win32.* Files for the Win32 port. src/gui_w32.* Files for the Win32 GUI. src/gui_w48.* Files for the Win32 and Win16 GUI. src/Make_mvc.mak MS Visual C++ makefile for the Win32 GUI. runtime/rgb.txt File with color definitions for the Win32 GUI. src/if_ole.* OLE automation interface, for MS Windows 95 and NT. src/VisVim/* Integration of Win32 GUI with MS Visual Developer Studio. src/GvimExt/* DLL for the "Edit with Vim" context menu entry nsis/* NSIS script to build the self-installing MS-Windows exe runtime/doc/*.man Preprocessed manual pages. runtime/macros/file_select.vim Vim script to browse directories (Unix only). vim-7.4.1689/READMEdir/README_mac.txt000066400000000000000000000003311267703067000165440ustar00rootroot00000000000000README_mac.txt for version 7.4 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! vim-7.4.1689/READMEdir/README_ole.txt000066400000000000000000000015621267703067000165720ustar00rootroot00000000000000README_ole.txt for version 7.4 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 Furthermore, this archive contains VISVIM.DLL. It can be used to integrate the OLE gvim with Microsoft Visual Developer Studio. See VisVim/README.txt. vim-7.4.1689/READMEdir/README_os2.txt000066400000000000000000000003521267703067000165120ustar00rootroot00000000000000README_os2.txt for version 7.4 of Vim: Vi IMproved. This file used to explain the installation of Vim on OS/2 systems. However, support for OS/2 has been removed in patch 7.4.1008. See "README.txt" for general information about Vim. vim-7.4.1689/READMEdir/README_os390.txt000066400000000000000000000065021267703067000166670ustar00rootroot00000000000000README_zOS.txt for version 7.4 of Vim: Vi IMproved. This readme explains how to build Vim on z/OS. Formerly called OS/390. See "README.txt" for general information about Vim. Most likely there are not many users out there using Vim on z/OS. So chances are good, that some bugs are still undiscovered. Getting the source to z/OS: ========================== First get the source code in one big tar file and ftp it a binary to z/OS. If the tar file is initially compressed with gzip (tar.gz) or bzip2 (tar.bz2) uncompress it on your PC, as this tools are (most likely) not available on the mainframe. To reduce the size of the tar file you might compress it into a zip file. On z/OS Unix you might have the command "jar" from java to uncompress a zip. Use: jar xvf Unpack the tar file on z/OS with pax -o from=ISO8859-1,to=IBM-1047 -rf vim.tar Note: The Vim source contains a few bitmaps etc which will be destroyed by this command, but these files are not needed on zOS (at least not for the console version). Compiling: ========== Vim can be compiled with or without GUI support. For 7.4 only the compilation without GUI was tested. Below is a section about compiling with X11 but this is from an earlier version of Vim. Console only: ------------- If you build VIM without X11 support, compiling and building is nearly straightforward. Change to the vim directory and do: # Don't use c89! # Allow intermixing of compiler options and files. $ export CC=cc $ export _CC_CCMODE=1 $./configure --with-features=big --without-x --enable-gui=no $ cd src $ make There may be warnings: - include files not found (libc, sys/param.h, ...) - Redeclaration of ... differs from ... -- just ignore them. $ make test This will produce lots of garbage on your screen (including error messages). Don't worry. If the test stops at one point in vim (might happen in test 11), just press :q! Expected test failures: 11: If you don't have gzip installed 24: test of backslash sequences in regexp are ASCII dependent 42: Multibyte is not supported on z/OS 55: ASCII<->EBCDIC sorting 57: ASCII<->EBCDIC sorting 58: Spell checking is not supported with EBCDIC 71: Blowfish encryption doesn't work $ make install With X11: --------- WARNING: This instruction was not tested with Vim 7.4. 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 _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 content (see src/link.390): 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. vim-7.4.1689/READMEdir/README_src.txt000066400000000000000000000005321267703067000165760ustar00rootroot00000000000000README_src.txt for version 7.4 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). For more information, see the README.txt file that comes with the runtime archive (vim-7.4-rt.tar.gz). To be able to run Vim you MUST get the runtime archive too! vim-7.4.1689/READMEdir/README_srcdos.txt000066400000000000000000000007471267703067000173140ustar00rootroot00000000000000README_srcdos.txt for version 7.4 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 (vim74rt.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. vim-7.4.1689/READMEdir/README_unix.txt000066400000000000000000000005551267703067000167770ustar00rootroot00000000000000README_unix.txt for version 7.4 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. vim-7.4.1689/READMEdir/README_vms.txt000066400000000000000000000035021267703067000166140ustar00rootroot00000000000000README_vms.txt for version 7.4 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. Read about compiling in src/INSTALLvms.txt. To use the binary version, you need one of these archives: vim-XX-exe-ia64-gui.zip IA64 GUI/Motif executables vim-XX-exe-ia64-gtk.zip IA64 GUI/GTK executables vim-XX-exe-ia64-term.zip IA64 console executables vim-XX-exe-axp-gui.zip Alpha GUI/Motif executables vim-XX-exe-axp-gtk.zip Alpha GUI/GTK executables vim-XX-exe-axp-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 files, but there are also prepared "deploy ready" archives: vim-XX-ia64.zip GUI and console executables with runtime and help files for IA64 systems vim-XX-axp.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 GTK builds need LIBGTK library installed. 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/ vim-7.4.1689/READMEdir/README_w32s.txt000066400000000000000000000011441267703067000166050ustar00rootroot00000000000000README_w32s.txt for version 7.4 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 vim-7.4.1689/READMEdir/Vim.info000066400000000000000000000011601267703067000156370ustar00rootroot00000000000000 0@!'j! !h% @ << <  <?<??<< < ?<<<<0?<<<000?? 000000<00<0<0<0?0?0?0<0000 0000000<0ICONXvim-7.4.1689/READMEdir/Xxd.info000066400000000000000000000015031267703067000156500ustar00rootroot0000000000000034''j!!( 4p``lalsSSS  I$I$II $$@II$?I $~I$@H$rI $9@II$GI $@I! $II $$@I!I$II $t$@I#vI$CvI 4p{falsSSS I$I$$II0I$$PII$$?I0I$~$PHI$$I0I$8$PI $$GI0I$$PI!I$$II0I$$PI!I$$II0I$t$PI#vI$$CvI0JUNKvim-7.4.1689/READMEdir/runtime.info000066400000000000000000000011601267703067000165670ustar00rootroot000000000000004B ##0dj!)(hR l'fb" \?B x@?<<<<<<=?/UWB X@??Ovim-7.4.1689/READMEdir/src.info000066400000000000000000000011601267703067000156730ustar00rootroot00000000000000]4B #%dj (Y)'`mH'xZ"\?B 8@?<<<<<<=?/UWB @??Ovim-7.4.1689/READMEdir/vimdir.info000066400000000000000000000011601267703067000163760ustar00rootroot00000000000000B ""d 'P'y <en'z"\?B x@?<<<<<<=?/UWB X@??Ovim-7.4.1689/appveyor.yml000066400000000000000000000014701267703067000151670ustar00rootroot00000000000000version: "{build}" skip_tags: true environment: matrix: - FEATURE: HUGE - FEATURE: NORMAL # disabled # - FEATURE: TINY # - FEATURE: SMALL # - FEATURE: BIG matrix: fast_finish: true before_build: - '"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 /release' # Work around for Python 2.7.11's bug - reg copy HKLM\SOFTWARE\Python\PythonCore\2.7 HKLM\SOFTWARE\Python\PythonCore\2.7-32 /s /reg:32 - reg copy HKLM\SOFTWARE\Python\PythonCore\2.7 HKLM\SOFTWARE\Python\PythonCore\2.7-32 /s /reg:64 build_script: - src/appveyor.bat test_script: - cd src/testdir # Testing with MSVC gvim - nmake -f Make_dos.mak VIMPROG=..\gvim - nmake -f Make_dos.mak clean # Testing with MingW console version - nmake -f Make_dos.mak VIMPROG=..\vim # vim: sw=2 sts=2 et ts=2 sr vim-7.4.1689/configure000077500000000000000000000002511267703067000145020ustar00rootroot00000000000000#! /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 && exec ./configure "$@" vim-7.4.1689/farsi/000077500000000000000000000000001267703067000137015ustar00rootroot00000000000000vim-7.4.1689/farsi/README.txt000066400000000000000000000002141267703067000153740ustar00rootroot00000000000000For information about installation of Farsi fonts and Vim usage in Farsi mode, refer to the Farsi help file by typing ":help farsi" in Vim. vim-7.4.1689/farsi/fonts/000077500000000000000000000000001267703067000150325ustar00rootroot00000000000000vim-7.4.1689/farsi/fonts/DOS/000077500000000000000000000000001267703067000154575ustar00rootroot00000000000000vim-7.4.1689/farsi/fonts/DOS/far-a01.com000077500000000000000000000111011267703067000173030ustar00rootroot000000000000008x16 Farsi font V. A01 Free Font, Dec 1996 by Mortaza G. Shiran $Driver not loaded - strange video card $P&$u&>XÌȎA uUP$<v<t<t,<t(X..rX.ruPSQRU.r]ZY[XX.rP3 AXπue<t<t <$t-<0tD..rPSQRU$ʎ½A.r]ZY[XPQU!ɎA.r]YXϜ.ruA..r !<t I!L!5!rt%!u\&6>vȎA.>t ~v&&AB1!~~?3?0000pccccg<<666666666666666666666666666666666666666666666666666666670766666666666666666666?07666666666666670?666666>><~~<fffffffff<~~<~<~~< 0``0(ll(88||||88<<<fff$lllllll||| 0f8ll8vv000` 000000 0 0f<00006vl8ll888l~ 0`pppv8l2"?$L,D <<<8L8L<8L 8LKIKIIQIQ  0<?c`>  0< ?c`?     #31  0 '+1$$,4 l$~$<<<@@@BR$R"" 0f0 00000 0 0l88l~  0` 0` 08 B~|0Iv00!>&#AI6@|<AAc66cAA$$<< `0  0`~~ 0`0 $b0 "<@ >p~~<<~<~> >x xxx `` &)1 f` &)1  @p?  @p?~ | ~  ~| ?~`@@@@0| >  ~<0000000<< <ppp(P(( (f<@@~6  #C!A~l~vim-7.4.1689/farsi/fonts/SunOs/000077500000000000000000000000001267703067000161015ustar00rootroot00000000000000vim-7.4.1689/farsi/fonts/SunOs/far-a01.fb000066400000000000000000000352141267703067000175460ustar00rootroot00000000000000z+E\ ,T|Dl 4\$Lt<d,T|Dl 4\$Lt<d,T|Dl 4\ $ L t   !!<!d!!!"","T"|"""##D#l###$ $4$\$$$$%$%L%t%%%&&<&d&&&'','T'|'''((D(l((() )4)\))))*$*L*t***++<+d+++,,,,T,|,,,--D-l---. .4.\..../$/L/t///00<0d00011,1T1|11122D2l2223 343\33334$4L4t44455<5d55566,6T6|66677D7l7778 848\88889$9L9t999::<:dcopyright "Poblic domain font, Share and enjoy."far-a01FONTfar-a01COPYRIGHTPoblic domain font, Share and enjoy.CHARSET_ENCODING1CHARSET_REGISTRYISIRI0000AVERAGE_WIDTHSPACINGCRESOLUTION_YRESOLUTION_XPIXEL_SIZEADD_STYLE_NAMESETWIDTH_NAMENormalSLANTRWEIGHT_NAMEMediumFAMILY_NAMEFixedFOUNDRYMortaza Ghassab ShiranFONTNAME_REGISTRY<d98: ;xP d$d1<KLZagiu|  ~~ ?3?0000p ccccg <<  6666666666666666 6666666666666 6666666666666 6666666 6666667076666666 666666 6666666 ?076666666 66666670? 666666  >> <~~< fffffffff    <~~<~ <~ ~<   0``0  (ll( 88|| ||88  <<< fff$ lllllll |||  0f 8ll8vv 000`  000000 0 0 f<<f ~ 0    0` 8ll8 8x~ | 0` |<|  <l  | 8`|  0000 ||| |~ x  0  0`0  ~~ `0  0` |  || 8l fff|ffff <ff< lffffffl fbhxh`bf fbhxh``` <ff:  <<  x fflxxlff ``````bf   || fff|```` ||  fff|lfff |`8 | ~~Z< | l8 l l|88|l ffff<<  0` <00000000< p8 < < 8l  0 x |v ``xlffff| ||  <lv || 620x0000x v| x ``lvffff 8< ff< ``flxxlf 8<  ffffff || fffff|`` v|  vf``` |`8 | 00>00006 v l8 l l888l ~ 0` p  pp v 8l 2"? $L,D    < < < 8L 8L< 8L  8L KI KI IQ IQ   0 < ?c`>   0 <  ?c`?           #31   0  '+1 $$,4  l   $~$ <<< @@@BR$R""  0f  0  00000 0 0 l88l ~     0`  0`   08  B~|0 Iv0 0!> &#AI6 @|< AAc6 6cAA $$<<    `0  0` ~~  0`0  $b0 "<@   >p ~ ~< <~ <~ <G @p? <G @p? <G @p?  <G @p? !? !? > >  > x  x x x  `` &)1  f` &)1   @p?   @p? ~  |  ~   ~ |  ?~`@@@@ 0|  >    ~ <0000000< < < p pp (P( ( ( f<<f   p8  @@~ l f  8`  8`   8` 8`  8` 8` #8 "I6     >  @@~ 6   #C!A ~l ~vim-7.4.1689/farsi/fonts/UNIXs/000077500000000000000000000000001267703067000160005ustar00rootroot00000000000000vim-7.4.1689/farsi/fonts/UNIXs/far-a01.f16000066400000000000000000000100001267703067000174340ustar00rootroot00000000000000~~?3?0000pccccg<<666666666666666666666666666666666666666666666666666666670766666666666666666666?07666666666666670?666666>><~~<fffffffff<~~<~<~~< 0``0(ll(88||||88<<<fff$lllllll||| 0f8ll8vv000` 000000 0 0f<00006vl8ll888l~ 0`pppv8l2"?$L,D <<<8L8L<8L 8LKIKIIQIQ  0<?c`>  0< ?c`?     #31  0 '+1$$,4 l$~$<<<@@@BR$R"" 0f0 00000 0 0l88l~  0` 0` 08 B~|0Iv00!>&#AI6@|<AAc66cAA$$<< `0  0`~~ 0`0 $b0 "<@ >p~~<<~<~> >x xxx `` &)1 f` &)1  @p?  @p?~ | ~  ~| ?~`@@@@0| >  ~<0000000<< <ppp(P(( (f<@@~6  #C!A~l~vim-7.4.1689/farsi/fonts/UNIXs/far-a01.pcf.Z000066400000000000000000000160151267703067000200340ustar00rootroot00000000000000̌Hb!L *DLB` DA ",FQGDA LRL1'$(E X!NX!><%҃]~Y&!#xj) i-Зղ-R| -%@1E ¸ a*aR bˊB'TiR䋔"GL"%AU 9t 0sb 4r¸`dv&YȦ= 2Ir GN)L "T\T yNFlD|[L6|@E0!aZIa1LTAE}E+bMECxC8hERqDmH!ݖn閄I% L: E81D@ @>EXGEoFc@ f,Te oX|znE~dܽaB0y[.D u6jV4RgAcG6+lSK""-N[j-~-ކkn蒫뾛n;֋ޫ'0 +pK _W1 gq,%<*r, /-,:ӌķ.+OD]tNB09C8QB!DՀT LP PKK70ppNwǝ70y JLhH Hf;e8;QX;qx@;նb+0N];0S]L]Dq de(leHPqs TeXq \q `q N7N7$ CN47ND7NT7Nd7tCN7"N7&N7* N7.(N720N768N7:@N7>HN7BPN7FXN$7J`N47NhND7RxT UCxNd7Zt ]Cg 6L` _Z2L`$3I46M`L4I6M`l5I86N`6I:N`7I<6O`8I>O`9I@6P` :IBP`,;ID6Q`LzWuŕ؞6 @b"}dYNֱ,f!,^ -hG;7$ 1gW6!Ug[Z֖eV-fkؾiS[bYoK:wZ*ru]֪5r۬poxc ix |Hzkw;!oد%)0,6ȃ%aLX5p7{ ~  ? @# N1L82qcQX\/0cgn뭛S9yLv޹w/ Aҗ_FiB^,cs^[ƀp橾 s=Y/CBdtAmsc]x   uB<]خfmuw{jSK&rEk u|NuUc" {3ϼc7i|2tB&=5$ۋ޶3H℀.]|@)v-^ fsMo1;)iӿ]m~iRô܎;釯լ~v-i%Gۍ~& = mfռ7ՌMޘ Jn\=AO10}oۻVaOz AQkZw|73]a[8!7E.mms-ҽ0W8Lx~u#ŠO_BtW^vA"mq\qe1ӝ5׿ ̈́ 3?n\w|MI߁MÕd@~#/ 4ArOKY߹l7Hy}_6{ev_WXf`Zz z5z׀hzB\xvҷ||'zNdfnc&vw\~xz4QrF{vy6iWXj:rf^ 7BT`QG{K؄l6Ua(lT,S6mUXX0L/u{g\}~oxa$gw\g{th`8EFr gmO%C;8gFj`%8{ה{RNiwcSi 8l>ZgFspn׉{RXx\ z&a}ߖ!}aEd~ghvwyw\Xa4ӆpuQ|xf$W7 L}(`j%rYdhxMxchvxffǁgd6؏}6Erx36(`F(#d8(Tא;EjH a ,e3b ]A^`LE@t D`4DK99;iP;uEcuoVdIE|,+(VS A}ij$A6STQ֧Ǖt4tbvtVtvyJ{Yd'KZS\Q:ي:c{fIcFXyf; N[і"kP%46UY)Tٲ#cQ\3i\;%w Ѡd#oEI@;B[w^%RVIKAÜ5W@d esr[k۶9Sۙi^TpSx;i Q_, TK[d ! qLHD7创ڹ!=kˊv{ 9?ź+Aw dC6}A $ʗ*Vdsau3 Qǫɋ\+)&W;Y[,;,4:l>ᰳaSዽT+g9( Zil3$aNg]V7OTkj۹뿏Z АUvۉm l-q -}-Ӳײ=-{ /'=. 0/{'-=-,-/7'ӁpҌ? }҆CM@ӈ|S]1WmՊ\F-@Pw`"mՎp'VԄ`bMs BCMՂPP`Շׄ Պ No،؎ؐMփ]ה]"{0iٝM֏ ڑ ңuإڤ-ڬleڲdԋ}hvp-s}҉@mQ}Mt=֫}-=Нmݺm-ޱجu3ԁ0-q^=-H}-ӲM}A~--..R}0n =~=cMٺ-BՓ]ؖu*c|0Ԋ$1V}1 =%-tLON&-||p䱽S@C=y=>-߲ 5M-uy~r~-N!/NN'nߢs݃0-n3>M=X^X~-;~- } ^`:m|M->֎^{N-wPN<׎30ٍ~a˗B ns7#QA9C:1;,!0 A%h \P F'( N0 NA-h ܂` /( <^0 A5h \p 7( n0A=h lCr@`$ܓbAys< ZU 艡}KBL*!=@ 3 (>6_B}`~A0 !0 bZ e܊AP{e@ e0 "80("p( 1"(E"((Y"x0``r"(B ", (B%"|@ (B*" (B/€" (B4ր"l(B9"@(>Xdm!0 p! p6! pN!Ppf! p~!$p!p *p! C08iC8uC8P5@pUT P5@@0UT P5p@UT %P5@հU T 1P5@pUT =5!jH 'j -j 3Ԡjh9jȃ?(( ( 4(P`@A ,P @A 8P@ADP@APLP`@A\|P @AhP@AtP@A`^x %`^ x *%`^x B% ^x Z%`^x r%^!x %@` ^'x C`K -&$ f2lb&ÉL'f2|b&J\NT&SLl2UT'SLt2U3'䞔}RI(eRJ(er'gr P(gr,J(i}I(iJ(i'k P(k,J(m}I(mJ(m'o P(o,J(q}I(qJ(q2's2 P(s2,J<(ē}OI<(ēOJ<(ēc2͠bf 1fƀrf ؙ1gƀ)Z x2hJJY3-̙RkLO4Ae|lLTY6o&,;V͕I+1SW͚+fvgˠ, dsfBKy3%ܙؒpLn4e匙rLsY9s=]Mx9:_&3_Λ/Gse̠i0igTf:Lڙ3%&3hbL29 SxL)+\iN95gմ2kϭ?+ܟ2lNI6ϧ42mI6 |tSM=4R Z)͔vy> g }NYB 6V+~EbYP,ůȡvim-7.4.1689/farsi/fonts/UNIXs/far-a01.pcf.gz000066400000000000000000000123461267703067000202460ustar00rootroot00000000000000|5far-a01.pcf U}y1" 3{wbKv,MHHHȫ@ݹn6و)"kQZJ-Z#Z_""Z )wv23w]ӏ9;gf~sΜ?ϙ+o8 2Lwɝ+00چL_{΄`*C[5xzs/6<ZmNF߸Ns0n1􎕍wdc٘OO?HolwllCfrlH,u{P=?sxޫ1;M2mdlIdC#]({Mڗr{ּ Z-hݶcbuQ{ 7.X:kfjZsf5_6w2a͗%mt=\bkpns{`ak%m-svAsK˲続߶umKZ1^[{\кp܋:/[,3gc&/n]<'H?ҌB$ 22!O|a$ 8aPӀOi99O|H_}8'2`$ 8aӭOTb$8 (' .f$ x%O|رK$q&> t' zc$ x''Ow1L|0I@aS$!DO&> &1L|0I@dp'> 0I@p' &> 0I@p ' S&> Nc$ 8aⓀ} S&> `$ 8aⓀ,Od0I@8A$ 2D2\e$ c$ g$ 1L|40L|42L|4aⓀlOs&> 3L|aⓀ 5x\)O_P+E]~EXD:y8xf&ptS&XfnXVF7ɭyx^*IWy~_.\0qwZt+ *ݾ _RNQw08|8m\`[~ o)i%u 6|["\w$%$}4}Y0|-隻o%87c~ WFRN9pV'C≖rev\u[Aq~QIp]<404q$0e.ႥQ>`rqIPe{OKІJcē$>'w,NKl [inw*]{Wi% \fy.6srŅ]OOIտ˱ J7IV'ZR؜> 㗼s#1sswaKz&蝋Jp\-@ kiJ.⋦'ɅiqB!'&97n !8І{x0Mѻ~afԧ$mړ9{N͂^Զ.c쾕HoRq/e]-MG)/:#-m7?i퇬j%\W%o$$o64YoMz}\{]IWfi_eGΑ2ݐ1h}L+p։(Y˲o/΍pqy{ڄOTy+rm/ڃs̵}LMGő:9˘0t$}qG ]2M2'yڙhn8_#dM\9Aev.LyLe hkQjp5ǗQyY@i|CaKRiOJsƇ?:j>YVHǹhR>L Ve4}gyi8{V:bW9_^2 }귕9??L}I^΁y)cƣ]ڑC ǥMIpJ,N7Z^Dz.gvlG[UCd0"i|I\|f]-E Qy+&yN{em(goQTbgsqѲ>ϣoUW_8Wu|z'e6%[rXI]яG6}v'<k?"X%m?ޞ/H/(}ZO(miJ#.mWMJk}a*mGs5I.g68\\=U{8ޣqU+Y8MFd9Ϥ%IWNun}pJuQ_I˓߁u:Oǹ%< 3vsL{jꝫfÞ\>QZQ'%tT[SD;-W)w1v]p֫}KZ{/U(͗bx_FMcR,mR+YIߕ[qaxf{#-oKODV_OAO^o6Lۥ<۽y}[ی']MܷG|w }[r};yJ wY7Gm6^_d{۽hOٓR&}NK}1#uI[P,]E\tw+zf_OoyMDR%Hˡ l!X#SN#ޡJbvz>i漁VwdRoŢ]1ꁢN+.sE+)[(^<_{ܷ{`>wI>sڞ"QV/iƣ@WR JyOޢx<+ -uqmC`h8vKD:Avx{b n]/Ξ3N}]+QnUu˾"tn}ѝHvtZ#M"􇲷9#99ˣcp,Gqx'{wx y$x/N>L8gQP:Գo`o؄qG\*qfrtЊY͞  Ўy_(D.ŸKGXR,cۉ˰+p9GyW`VJ\^n-a={?F\kp-&xlaϼB7{"{vbz F?`/baZ7᣸[1܊6>9"s| ;i|ŝ_+܍/5/^ } x~ٛ79G|G|c<c< +~'~O ~gsK<įG#o[;{U7g׵e:AKyy;Ye]E>&k'c΢/k'0>s-Y^ ZOza֍?Ln&cʷ"_W`{+끲wHY}f2p}F$ǒ r9L%9#7[d ɥdͫd#D"EGɭvr|G oGIr||||G$ &'W%hS)ǐq2L\4#ydi'd )d H6.62S)y4%'^xuՋAF)Q(Q(Q(Q(Q(Q(Q(Q(Q(QxD' O(><~~<fffffffff<~~<~<~~< 0``0(ll(88||||88<<<fff$lllllll||| 0f8ll8vv000` 000000 0 0f<00006vl8ll888l~ 0`pppv8l2"?$L,D <<<8L8L<8L 8LKIKIIQIQ  0<?c`>  0< ?c`?     #31  0 '+1$$,4 l$~$<<<@@@BR$R"" 0f0 00000 0 0l88l~  0` 0` 08 B~|0Iv00!>&#AI6@|<AAc66cAA$$<< `0  0`~~ 0`0 $b0 "<@ >p~~<<~<~> >x xxx `` &)1 f` &)1  @p?  @p?~ | ~  ~| ?~`@@@@0| >  ~<0000000<< <ppp(P(( (f<@@~6  #C!A~l~far-a01PAA \ A *82KDYWf_utxddP) 09DIQFONTNAME_REGISTRYMortaza Ghassab ShiranFOUNDRYFixedFAMILY_NAMEMediumWEIGHT_NAMERSLANTNormalSETWIDTH_NAMEADD_STYLE_NAMEPIXEL_SIZEPOINT_SIZERESOLUTION_XRESOLUTION_YCSPACINGAVERAGE_WIDTHISIRI0000CHARSET_REGISTRY1CHARSET_ENCODINGPoblic domain font, Share and enjoy.COPYRIGHTWEIGHTX_HEIGHTQUAD_WIDTHFONTfar-a01RESOLUTION  @ `  @`   @ `    @ `     @ `      @ `    @ `       @ `       @ `       @  `        @  `        @  `        @  `         @  `         @ `        @ `       @`    @`     @ `    @`     @ `    @ `   @ `       @ `       @`    @ `    @ `      @`      @ `       @ `   @`   @ `   PADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXvim-7.4.1689/nsis/000077500000000000000000000000001267703067000135515ustar00rootroot00000000000000vim-7.4.1689/nsis/README.txt000066400000000000000000000025021267703067000152460ustar00rootroot00000000000000This 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 vim-7.4.1689/nsis/gvim.nsi000066400000000000000000000307601267703067000152340ustar00rootroot00000000000000# NSIS file to create a self-installing exe for Vim. # It requires NSIS version 2.0 or later. # Last Change: 2014 Nov 5 # 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, vimw32.exe, GvimExt/*, etc. !ifndef VIMSRC !define VIMSRC "..\src" !endif # Location of runtime files !ifndef VIMRT !define VIMRT ".." !endif # Location of extra tools: diff.exe !ifndef VIMTOOLS !define VIMTOOLS ..\.. !endif # 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 !include gvim_version.nsh # for version number # ----------- No configurable settings below this line ----------- !include UpgradeDLL.nsh # for VisVim.dll !include LogicLib.nsh !include x64.nsh Name "Vim ${VER_MAJOR}.${VER_MINOR}" OutFile gvim${VER_MAJOR}${VER_MINOR}.exe CRCCheck force SetCompressor /SOLID lzma SetDatablockOptimize on RequestExecutionLevel highest XPStyle on ComponentText "This will install Vim ${VER_MAJOR}.${VER_MINOR} on your computer." DirText "Choose a directory to install Vim (should contain 'vim')" Icon icons\vim_16c.ico # NSIS2 uses a different strategy with six different 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 vimtutor" 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 FunctionEnd Function .onInstSuccess WriteUninstaller vim${VER_MAJOR}${VER_MINOR}\uninstall-gui.exe MessageBox MB_YESNO|MB_ICONQUESTION \ "The installation process has been successful. 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\autoload File ${VIMRT}\autoload\*.* SetOutPath $0\autoload\xml File ${VIMRT}\autoload\xml\*.* SetOutPath $0\syntax File ${VIMRT}\syntax\*.* SetOutPath $0\spell File ${VIMRT}\spell\*.txt File ${VIMRT}\spell\*.vim File ${VIMRT}\spell\*.spl File ${VIMRT}\spell\*.sug 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: not supported Goto lbl_done lbl_winnt: # Windows NT/2000/XP and later 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 ${If} ${RunningX64} File /oname=gvimext.dll ${VIMSRC}\GvimExt\gvimext64.dll ${Else} File /oname=gvimext.dll ${VIMSRC}\GvimExt\gvimext.dll ${EndIf} IfErrors 0 GvimExtDone # Can't copy gvimext.dll, create it under another name and rename it on # next reboot. GetTempFileName $3 $0 ${If} ${RunningX64} File /oname=$3 ${VIMSRC}\GvimExt\gvimext64.dll ${Else} File /oname=$3 ${VIMSRC}\GvimExt\gvimext.dll ${EndIf} 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-8.dll File ${VIMRT}\libiconv-2.dll File /nonfatal ${VIMRT}\libwinpthread-1.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\autoload 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\spell 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?$\n \ $\nCAREFUL: If 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 vim-7.4.1689/nsis/gvim_version.nsh000066400000000000000000000002311267703067000167660ustar00rootroot00000000000000# Generated from Makefile: define the version numbers !ifndef __GVIM_VER__NSH__ !define __GVIM_VER__NSH__ !define VER_MAJOR 7 !define VER_MINOR 4 !endif vim-7.4.1689/nsis/icons/000077500000000000000000000000001267703067000146645ustar00rootroot00000000000000vim-7.4.1689/nsis/icons/disabled.bmp000066400000000000000000000005461267703067000171400ustar00rootroot00000000000000BMfv(4F$n<4R~DDdJDdBD4JTE ٙo홙ffYff`IGfffftYffff`͙ffffff\ffffff`2ffffffff1ffffffff[ffffffaffffffffffa8ffffYffa9ffYaٙS5vim-7.4.1689/nsis/icons/enabled.bmp000066400000000000000000000005461267703067000167630ustar00rootroot00000000000000BMfv( 6  l WKFgeg M FgF)2)2I@@wETf{]廻zTCKG6[GwnKGw6[GwsIGww,.TGsGzGs4w,%OGsGvGs;whGwh#G9ۻGwhtscwww6;:ww6wsgDD~DC;6ff6fSOvim-7.4.1689/nsis/icons/vim_16c.ico000066400000000000000000000013761267703067000166330ustar00rootroot00000000000000 ( @@pw p"wpDwp """@"""$ """"@xp""""$ "pw""""@ "pp""""@pw""$ pp""@p w$p"p@p" wp""pp"" wp"""pw"" xwp""" "* ?x 0`0 ?vim-7.4.1689/nsis/icons/vim_uninst_16c.ico000066400000000000000000000013761267703067000202330ustar00rootroot00000000000000 ( @ w p"w pI w p ""@ ""$ """"I x""""$"pw"""""pp""""yw""$ p""I w$ "p@ p" w p""pp"" w p"""w"" xwp"""  "* ?0 ` 0 < {?vim-7.4.1689/pixmaps/000077500000000000000000000000001267703067000142565ustar00rootroot00000000000000vim-7.4.1689/pixmaps/alert.xpm000066400000000000000000000030321267703067000161110ustar00rootroot00000000000000/* 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 ", " "}; vim-7.4.1689/pixmaps/error.xpm000066400000000000000000000030321267703067000161330ustar00rootroot00000000000000/* 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 ", " "}; vim-7.4.1689/pixmaps/gen-inline-pixbufs.sh000066400000000000000000000003221267703067000203120ustar00rootroot00000000000000#! /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 vim-7.4.1689/pixmaps/generic.xpm000066400000000000000000000030341267703067000164200ustar00rootroot00000000000000/* 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.. ", " ... ", " .. ", " "}; vim-7.4.1689/pixmaps/info.xpm000066400000000000000000000030311267703067000157340ustar00rootroot00000000000000/* 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.. ", " ... ", " .. ", " "}; vim-7.4.1689/pixmaps/quest.xpm000066400000000000000000000030321267703067000161430ustar00rootroot00000000000000/* 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.. ", " ... ", " .. ", " "}; vim-7.4.1689/pixmaps/stock_icons.h000066400000000000000000003315661267703067000167630ustar00rootroot00000000000000/* 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\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\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;\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\377C>\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\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"}; vim-7.4.1689/pixmaps/stock_vim_build_tags.png000066400000000000000000000006671267703067000211700ustar00rootroot00000000000000PNG  IHDRw=sBIT|dnIDATHU=@}zpMb#XZXA8! w^e2on5"BuiSEdl'c4֌3Ilb&DMNR NT,"4ĕh]}2t3sf}}ssνa< |MG^::>1l6OdfMOK>6ϼ7gM<0uKIEQyⓛ1ឝr_\Xje9qÆ0 Lcy>yG~-BO>ppLO }RL Kˀ$Rr H|rzYpqt:q\~TUCBh:Y&g<]mXZZ%v`/^j)zg_ŕST@ tHлg2zcžP $gS;r3;g._%0mq{&'ܷoAcb~tME/K04K%HF0+)vO=Qa4Dee EHNNG^/,&a{qY$*3u&qz^"˅ 塩]uulaKUwikش{4M+l6{UẀOg*wKZܟ#˲N XWKXoSKmm7?ɒ%˱Z$.Hrr&{H2O,O jE:1f.ϟ1I6LLOpΝHWκIHHlEEkijjuke`0ߧimMWao|COq눨iyyž$IB$]Ctw~%PU}(:?W\@(g¹N1pd;'fOZwiVd؈6A@=@ݻɲ}!N1>OL#/S `.gnܞ#LJG' P=Ng]#eid&[[A=Ql&^6^,>rk!ohLM0=xwD >&fO0圙#pL#E/?n酥e5o۰6 zB?6_:i\nq+=`JA~%{`8)>27!PkךBgwIo;1ܻĉqDHp\!cZ#`Ek"DHkLSnǒ.##lc8^`~yH"$} h#"1 N稃:9H7X+@oAOxH}@j8*D!G"ptG*Jo71?sIENDB`vim-7.4.1689/pixmaps/stock_vim_save_all.png000066400000000000000000000017751267703067000206420ustar00rootroot00000000000000PNG  IHDRw=sBIT|dIDATHKh\U;L2&( MIF+c! uYeqaD]t;(хEmlV%B*y`9qqƴ0`o99=kN\+>(zk(B+ E@`=a3`\'=H?pyYFT\*1IĂSI,Pޢ>RQU+&EHXg FU]cPJ!:@H("^@@~ p---aPDQ

q\֍{m7P[)'H,Z>6LQ*tC$~kf6>J)?;KcIcl/I#X,IdkG}rHM6qYWy< 1Rr509`heZH}Mk0`9$R( 1QLA,"k7hp}#Mcjj_:ޛֆG[0Cb%> pO\=IENDB`vim-7.4.1689/pixmaps/stock_vim_session_load.png000066400000000000000000000024251267703067000215270ustar00rootroot00000000000000PNG  IHDRw=sBIT|dIDATHݖilUEs}}m*ݐR% YJS(&Ÿ/~r ( i\@RBk PRiK[^ׇ}K߻d̜3O) o2s 8uWsM˽ɠt8fE41uZFqSc,=MCJ)scoi'3mh@xG;I!~"(i2$2'23,3g&M BضB4tCp '7.H81e_.`&(a8 THmۖŎ".6GMN'1Nn) eem蚎錥?B Q(lK⌍!6I C Ra6$%s2+#cZO4t~ߝz7T`pP UT9͈n۩R ˲0M ˴2#OƀM(\]I\iΚ3LH4G$DȸCUΞ=M:RJR(t)%[ܼ\Јa9a\ K ֲl*jhyR!R )% r@1PU[a (ȟGyl|y ooz%%x/qq6!Dhmƚ5Fv(J [( =y8*ؼu# Ɏ8zgΔaT˘1km[q1a,ƶN{#V…TTTxioo6lXG]]-Eٱ ?LH3 qnӴ,kj0#PlYYt47_èQ,Y֖fǏg/ɬSX)Z>+٥Y͞RS۷͍W flB̚0xJ!Okmo:?\]5yeP~(]',NLLt\933$WJP[s}4 pwzz9rD(=-->,m=R>%m&n{+q_ٻ@ki[n:Iƍ9RV3 DV"D>ljj:&Y4Q :(U.!XMgM7tg V%n$xh~IENDB`vim-7.4.1689/pixmaps/stock_vim_session_new.png000066400000000000000000000020121267703067000213710ustar00rootroot00000000000000PNG  IHDRw=sBIT|dIDATHML\Uo0RiiWڸ3J]5ՅďrCZ5Qm 6CN  IК "2y^o1n<}NsνG]+U&Qe۫8PhvEdx<D"tD<^2GAp5J)uP(DCCY]dR"(_v ioo S)@5t@8&288 *b;EΟ!LL0 uZwg PPV]/CgipH< X 7o! `w*d vvEXˣ(7z(0̰}G҃-}z5IENDB`vim-7.4.1689/pixmaps/stock_vim_session_save.png000066400000000000000000000024001267703067000215370ustar00rootroot00000000000000PNG  IHDRw=sBIT|dIDATHmLU \DCZbMK{]n9YMGA[a8_N˹s1~rY3% 0lf3^7o>Y=۳^~yswELkÂK{ [:Pwvz?衴9|  m5 PW:#ԝdb4%%RAsäu0@­1|>?P?Wݠ1*Bo= 0~ D@cY c1@ oºMUUmsG9g4"z(DAA/,,$&쪪*:n'yw rZKuu5imqQxxMӰA?iqk83;@A"ip>?̅!F  m b YҚ/H!@ ."J7m$OQh>cXFV.5&;w(\P8)#ֿ}{ p1FF0c:FL_O$/v 0fOT$M$ ۚAƂ,i7Kz)$FLG m; CH9FY)A.Zߟظ.15^Dmt]HdiĘIVv>4R`^R{m; r.F5rssy̅HIM#elt_owaIT"`A/uyV}(.8DIHTVQ r ]ꅐIENDB`vim-7.4.1689/pixmaps/stock_vim_shell.png000066400000000000000000000056111267703067000201540ustar00rootroot00000000000000PNG  IHDR00WsBIT|d @IDATheY?k9N&w&4jJ(o⋂h)U+BE#5!8j"M:$N{̽gZgMgro }us9{?yϯ?^?^okWX+fN k~Z1y(p*2Q {n}?`idQsX{wuLJ,B gBLDJ)EbLG,!x$%$ -WR?h 3dQ }/)%REbq'!IK `לi|_}7?S޸qqmlG>9Gg;:a:N-o1-VTsVn$!~s "/ W+$&RLY0@Fq3xBn0 ={GqOføٌ "HBRqVz}M1d@RHJ`mp~< ۩]V'd..u#0b9=JҠ 1 Y' )f$);wZ'-Pⵐibc ~3>81q&=oA%'II]f3s{A#N~'f=v;d2a$IԅceWKpαCD U9ebǞ9LDʹt b<"f͸֭[d)*R"@~)qRLL q[Vmblt1al&EpEb҇ 7=Źtss!$!QUp<0ǙgrSl'X %B:G,&;7!jDZF2fypY bң!g=<7 *!FK%ɏĤX pf vhi42*"J1P)Q9$Bb1zjhXj$A,R$>9g=}3 'V^CL-9if܌x6K™SĒ du5гZ}+ٸfI;Eng4N5GC۪RZ•\sJk!Lӄ,C?0'sV+At fu_f4'f7q Ds>[JI+AcM /й[V0^~豝m`4i L%я 0ksLXwkMGlE~i_aC]ÍmX -|<τY>'?1i31K&n,Q(@u{Cz<xʿ]ghspBJbUҤuN-qbcMGudr ˭3r fGT=Op%>Їyᣗ>̳z^"ĀDCC=ă>#97O~Iu-6>560)ZhoRV.n6@(.{~gk|+_M1ΰ]ߖ,<>p!bі\9:1uA-0%1捛q߯<˗Ѭ:K9|釾^y' \9a+;*hEfHΚϚҨXk%u`i9u`Cp9W6[f;cBz I}(< oҩD",.tkrU:ZGV `iALQêj!ICCg5_Ԥ%9s[a&T L|w;w'qcc1dkX˲wwzYwߎwZoRiSpnޖ?,>u=!zLIENDB`vim-7.4.1689/pixmaps/stock_vim_window_maximize.png000066400000000000000000000010341267703067000222520ustar00rootroot00000000000000PNG  IHDRw=sBIT|dIDATHՕkA?H]He# )E, v\ 4)Ӥ M%A:IF)B{\0W5*FerK{s|wޯ]P2E"rN.ҷa+u:wZ#;s(:}/ohIy."Z#qxx B#Iأk&^~^zk)'z=A};#x6;_hluS=OpzC!]膙Kp'SR%]Q3[""=CDQ-(B$-gas#tgֿC׫l7PZk'A=""bu/ c&מMe NbM\&?2C!$Bye 6xye`E}~*܇l-ЧDVf鞍1(CN_sc_v]IENDB`vim-7.4.1689/pixmaps/stock_vim_window_maximize_width.png000066400000000000000000000010021267703067000234440ustar00rootroot00000000000000PNG  IHDRw=sBIT|dIDATH͕JQw\ J Q,%!]MY3(/;X̟*H`M@mB$VV[-w5ΗbvMqh|p{;;9ߠJ!~ɗ67pTgw_,H "E0Á~y:ly=_woSc'J$ާj%TR]tvLskxZNmXG;")k-Z[3ۇ)r&/EڞǏd 0y\:Jbx>~a^}͊ H m> 98}{ufL -O PV.s\tpΥnw9ճ!1a' iCQ^Bnh4^'y 72nx04'hޮ\_EPt?8~0UW!IENDB`vim-7.4.1689/pixmaps/stock_vim_window_minimize.png000066400000000000000000000005401267703067000222510ustar00rootroot00000000000000PNG  IHDRw=sBIT|dIDATH햱JA=ODlkK)MzKF,Rlj\eeq5Z43b ;3;3|Ч}8DN4V޳m# 3Ĕ& ۰T6Bq.Bh\A cAD^Ҡ)^8\_S\ddf@ҏVmZe,A_uQQiZ0IV 5MG@:مtsd H8؂8M"'N8sq~}juuAu\ߖԃIENDB`vim-7.4.1689/pixmaps/stock_vim_window_minimize_width.png000066400000000000000000000005611267703067000234530ustar00rootroot00000000000000PNG  IHDRw=sBIT|d(IDATH핽JPFĈ> 2 XUѵND$! EV1f,bboܰso2Ab׮˔_$FgMy`d< Ccj '8zLT9[[,V83k^mk +PTrL!UxyCz,mܦnz 2[$ S|*S^Hϯ` 'yRN¿M/` b-[ȩ^T=J5tx]qLE# 0LELiu,όIENDB`vim-7.4.1689/pixmaps/stock_vim_window_split.png000066400000000000000000000003661267703067000215710ustar00rootroot00000000000000PNG  IHDRw=sBIT|dIDATHA EwpMs#F3LW A# U3CUǎ, sZMI)s!leZthB2ϳ]PJ{o ?" kGVU؆6|d8*Z~n(X ,m>9j4 QuOcEJIENDB`vim-7.4.1689/pixmaps/stock_vim_window_split_vertical.png000066400000000000000000000003041267703067000234520ustar00rootroot00000000000000PNG  IHDRw=sBIT|d{IDATHA Eҭ=…gUf@ygPkm9Ά9f]GRNkkƋhh@E1ơn?{hW$"m9QhVٖXɪ;IENDB`vim-7.4.1689/pixmaps/tb_blank.xpm000066400000000000000000000012401267703067000165550ustar00rootroot00000000000000/* 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"}; vim-7.4.1689/pixmaps/tb_close.xpm000066400000000000000000000013761267703067000166050ustar00rootroot00000000000000/* 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. ", " @@@@@@@@@ ", " "}; vim-7.4.1689/pixmaps/tb_copy.xpm000066400000000000000000000012331267703067000164420ustar00rootroot00000000000000/* 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 ", " ", " "}; vim-7.4.1689/pixmaps/tb_ctags.xpm000066400000000000000000000013751267703067000166000ustar00rootroot00000000000000/* 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 "}; vim-7.4.1689/pixmaps/tb_cut.xpm000066400000000000000000000011671267703067000162710ustar00rootroot00000000000000/* 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 ", " ", " "}; vim-7.4.1689/pixmaps/tb_exit.xpm000066400000000000000000000015111267703067000164400ustar00rootroot00000000000000/* 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 ", " "}; vim-7.4.1689/pixmaps/tb_find.xpm000066400000000000000000000012751267703067000164160ustar00rootroot00000000000000/* 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.+... ", " ............+ .. ", " ++++++++++ ", " "}; vim-7.4.1689/pixmaps/tb_find_help.xpm000066400000000000000000000013021267703067000174150ustar00rootroot00000000000000/* 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 ", " ", " "}; vim-7.4.1689/pixmaps/tb_find_next.xpm000066400000000000000000000013751267703067000174550ustar00rootroot00000000000000/* 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.+...", " ............+ ..", " ++++++++++ ", " "}; vim-7.4.1689/pixmaps/tb_find_prev.xpm000066400000000000000000000013751267703067000174530ustar00rootroot00000000000000/* 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 ", " "}; vim-7.4.1689/pixmaps/tb_help.xpm000066400000000000000000000011701267703067000164200ustar00rootroot00000000000000/* 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 ", " ", " "}; vim-7.4.1689/pixmaps/tb_jump.xpm000066400000000000000000000013311267703067000164420ustar00rootroot00000000000000/* 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", " ", " ", " ", " "}; vim-7.4.1689/pixmaps/tb_load_session.xpm000066400000000000000000000015051267703067000201540ustar00rootroot00000000000000/* 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$ ", " $$$$$$$$$$$ "}; vim-7.4.1689/pixmaps/tb_macro.xpm000066400000000000000000000012341267703067000165720ustar00rootroot00000000000000/* 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 "}; vim-7.4.1689/pixmaps/tb_make.xpm000066400000000000000000000012331267703067000164050ustar00rootroot00000000000000/* 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 ", " "}; vim-7.4.1689/pixmaps/tb_maximize.xpm000066400000000000000000000013061267703067000173140ustar00rootroot00000000000000/* 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 ", " "}; vim-7.4.1689/pixmaps/tb_maxwidth.xpm000066400000000000000000000013061267703067000173160ustar00rootroot00000000000000/* 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", " ", " ", " ", " "}; vim-7.4.1689/pixmaps/tb_minimize.xpm000066400000000000000000000013061267703067000173120ustar00rootroot00000000000000/* 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 ", " ", " . ", " ... ", " ..... ", " "}; vim-7.4.1689/pixmaps/tb_minwidth.xpm000066400000000000000000000013061267703067000173140ustar00rootroot00000000000000/* 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 ", " ", " "}; vim-7.4.1689/pixmaps/tb_new.xpm000066400000000000000000000013011267703067000162550ustar00rootroot00000000000000/* 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. ", " .......... "}; vim-7.4.1689/pixmaps/tb_new_session.xpm000066400000000000000000000014551267703067000200320ustar00rootroot00000000000000/* 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. ", " ........... "}; vim-7.4.1689/pixmaps/tb_open.xpm000066400000000000000000000014021267703067000164270ustar00rootroot00000000000000/* 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", " ", " "}; vim-7.4.1689/pixmaps/tb_paste.xpm000066400000000000000000000014031267703067000166030ustar00rootroot00000000000000/* 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 ", " "}; vim-7.4.1689/pixmaps/tb_print.xpm000066400000000000000000000013601267703067000166250ustar00rootroot00000000000000/* 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.. ", " .XXXXX.X. ", " .XXXXX.... ", " .XXXXXXXX. ", " .XXXXXXXX. ", " ..XXXXXXXX.. ", " .XXXXXXXX.O ", "................ ", ".XXXXXXXXXXXXXO. ", ".X@@ooooooooooO.O ", ".XooooooooooooO.O ", ".XooooooooooooO.O ", "................O ", " .OOOOOOOOOOOO.OO ", " ..............O ", " OOOOOOOOOOOOO ", " "}; vim-7.4.1689/pixmaps/tb_redo.xpm000066400000000000000000000012331267703067000164210ustar00rootroot00000000000000/* 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 ", " ", " "}; vim-7.4.1689/pixmaps/tb_replace.xpm000066400000000000000000000015131267703067000171040ustar00rootroot00000000000000/* 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 ", " "}; vim-7.4.1689/pixmaps/tb_save.xpm000066400000000000000000000012751267703067000164340ustar00rootroot00000000000000/* 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 ", " ", " "}; vim-7.4.1689/pixmaps/tb_save_all.xpm000066400000000000000000000013011267703067000172520ustar00rootroot00000000000000/* 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."}; vim-7.4.1689/pixmaps/tb_save_session.xpm000066400000000000000000000015051267703067000201730ustar00rootroot00000000000000/* 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$ ", " $$$$$$$$$$$ "}; vim-7.4.1689/pixmaps/tb_shell.xpm000066400000000000000000000013411267703067000165770ustar00rootroot00000000000000/* 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.+ ", " ...........+ ", " ++++++++++ ", " "}; vim-7.4.1689/pixmaps/tb_split.xpm000066400000000000000000000013031267703067000166210ustar00rootroot00000000000000/* 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 ", " "}; vim-7.4.1689/pixmaps/tb_undo.xpm000066400000000000000000000012331267703067000164350ustar00rootroot00000000000000/* 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 ", " ", " "}; vim-7.4.1689/pixmaps/tb_vsplit.xpm000066400000000000000000000013041267703067000170100ustar00rootroot00000000000000/* 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 ", " "}; vim-7.4.1689/runtime/000077500000000000000000000000001267703067000142605ustar00rootroot00000000000000vim-7.4.1689/runtime/autoload/000077500000000000000000000000001267703067000160705ustar00rootroot00000000000000vim-7.4.1689/runtime/autoload/README.txt000066400000000000000000000014051267703067000175660ustar00rootroot00000000000000The autoload directory is for standard Vim autoload scripts. These are functions used by plugins and for general use. They will be loaded automatically when the function is invoked. See ":help autoload". gzip.vim for editing compressed files netrw*.vim browsing (remote) directories and editing remote files tar.vim browsing tar files zip.vim browsing zip files paste.vim common code for mswin.vim, menu.vim and macmap.vim spellfile.vim downloading of a missing spell file Omni completion files: ccomplete.vim C csscomplete.vim HTML / CSS htmlcomplete.vim HTML javascriptcomplete.vim Javascript phpcomplete.vim PHP pythoncomplete.vim Python rubycomplete.vim Ruby syntaxcomplete.vim from syntax highlighting xmlcomplete.vim XML (uses files in the xml directory) vim-7.4.1689/runtime/autoload/ada.vim000066400000000000000000000537551267703067000173510ustar00rootroot00000000000000"------------------------------------------------------------------------------ " Description: Perform Ada specific completion & tagging. " Language: Ada (2005) " $Id: ada.vim 887 2008-07-08 14:29:01Z krischik $ " Maintainer: Martin Krischik " Taylor Venable " Neil Bird " Ned Okie " $Author: krischik $ " $Date: 2008-07-08 16:29:01 +0200 (Di, 08 Jul 2008) $ " Version: 4.6 " $Revision: 887 $ " $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/ada.vim $ " History: 24.05.2006 MK Unified Headers " 26.05.2006 MK ' should not be in iskeyword. " 16.07.2006 MK Ada-Mode as vim-ball " 02.10.2006 MK Better folding. " 15.10.2006 MK Bram's suggestion for runtime integration " 05.11.2006 MK Bram suggested not to use include protection for " autoload " 05.11.2006 MK Bram suggested to save on spaces " 08.07.2007 TV fix mapleader problems. " 09.05.2007 MK Session just won't work no matter how much " tweaking is done " 19.09.2007 NO still some mapleader problems " Help Page: ft-ada-functions "------------------------------------------------------------------------------ if version < 700 finish endif let s:keepcpo= &cpo set cpo&vim " Section: Constants {{{1 " let g:ada#DotWordRegex = '\a\w*\(\_s*\.\_s*\a\w*\)*' let g:ada#WordRegex = '\a\w*' let g:ada#Comment = "\\v^(\"[^\"]*\"|'.'|[^\"']){-}\\zs\\s*--.*" let g:ada#Keywords = [] " Section: g:ada#Keywords {{{1 " " Section: add Ada keywords {{{2 " for Item in ['abort', 'else', 'new', 'return', 'abs', 'elsif', 'not', 'reverse', 'abstract', 'end', 'null', 'accept', 'entry', 'select', 'access', 'exception', 'of', 'separate', 'aliased', 'exit', 'or', 'subtype', 'all', 'others', 'synchronized', 'and', 'for', 'out', 'array', 'function', 'overriding', 'tagged', 'at', 'task', 'generic', 'package', 'terminate', 'begin', 'goto', 'pragma', 'then', 'body', 'private', 'type', 'if', 'procedure', 'case', 'in', 'protected', 'until', 'constant', 'interface', 'use', 'is', 'raise', 'declare', 'range', 'when', 'delay', 'limited', 'record', 'while', 'delta', 'loop', 'rem', 'with', 'digits', 'renames', 'do', 'mod', 'requeue', 'xor'] let g:ada#Keywords += [{ \ 'word': Item, \ 'menu': 'keyword', \ 'info': 'Ada keyword.', \ 'kind': 'k', \ 'icase': 1}] endfor " Section: GNAT Project Files {{{3 " if exists ('g:ada_with_gnat_project_files') for Item in ['project'] let g:ada#Keywords += [{ \ 'word': Item, \ 'menu': 'keyword', \ 'info': 'GNAT projectfile keyword.', \ 'kind': 'k', \ 'icase': 1}] endfor endif " Section: add standart exception {{{2 " for Item in ['Constraint_Error', 'Program_Error', 'Storage_Error', 'Tasking_Error', 'Status_Error', 'Mode_Error', 'Name_Error', 'Use_Error', 'Device_Error', 'End_Error', 'Data_Error', 'Layout_Error', 'Length_Error', 'Pattern_Error', 'Index_Error', 'Translation_Error', 'Time_Error', 'Argument_Error', 'Tag_Error', 'Picture_Error', 'Terminator_Error', 'Conversion_Error', 'Pointer_Error', 'Dereference_Error', 'Update_Error'] let g:ada#Keywords += [{ \ 'word': Item, \ 'menu': 'exception', \ 'info': 'Ada standart exception.', \ 'kind': 'x', \ 'icase': 1}] endfor " Section: add GNAT exception {{{3 " if exists ('g:ada_gnat_extensions') for Item in ['Assert_Failure'] let g:ada#Keywords += [{ \ 'word': Item, \ 'menu': 'exception', \ 'info': 'GNAT exception.', \ 'kind': 'x', \ 'icase': 1}] endfor endif " Section: add Ada buildin types {{{2 " for Item in ['Boolean', 'Integer', 'Natural', 'Positive', 'Float', 'Character', 'Wide_Character', 'Wide_Wide_Character', 'String', 'Wide_String', 'Wide_Wide_String', 'Duration'] let g:ada#Keywords += [{ \ 'word': Item, \ 'menu': 'type', \ 'info': 'Ada buildin type.', \ 'kind': 't', \ 'icase': 1}] endfor " Section: add GNAT buildin types {{{3 " if exists ('g:ada_gnat_extensions') for Item in ['Short_Integer', 'Short_Short_Integer', 'Long_Integer', 'Long_Long_Integer', 'Short_Float', 'Short_Short_Float', 'Long_Float', 'Long_Long_Float'] let g:ada#Keywords += [{ \ 'word': Item, \ 'menu': 'type', \ 'info': 'GNAT buildin type.', \ 'kind': 't', \ 'icase': 1}] endfor endif " Section: add Ada Attributes {{{2 " for Item in ['''Access', '''Address', '''Adjacent', '''Aft', '''Alignment', '''Base', '''Bit_Order', '''Body_Version', '''Callable', '''Caller', '''Ceiling', '''Class', '''Component_Size', '''Compose', '''Constrained', '''Copy_Sign', '''Count', '''Definite', '''Delta', '''Denorm', '''Digits', '''Emax', '''Exponent', '''External_Tag', '''Epsilon', '''First', '''First_Bit', '''Floor', '''Fore', '''Fraction', '''Identity', '''Image', '''Input', '''Large', '''Last', '''Last_Bit', '''Leading_Part', '''Length', '''Machine', '''Machine_Emax', '''Machine_Emin', '''Machine_Mantissa', '''Machine_Overflows', '''Machine_Radix', '''Machine_Rounding', '''Machine_Rounds', '''Mantissa', '''Max', '''Max_Size_In_Storage_Elements', '''Min', '''Mod', '''Model', '''Model_Emin', '''Model_Epsilon', '''Model_Mantissa', '''Model_Small', '''Modulus', '''Output', '''Partition_ID', '''Pos', '''Position', '''Pred', '''Priority', '''Range', '''Read', '''Remainder', '''Round', '''Rounding', '''Safe_Emax', '''Safe_First', '''Safe_Large', '''Safe_Last', '''Safe_Small', '''Scale', '''Scaling', '''Signed_Zeros', '''Size', '''Small', '''Storage_Pool', '''Storage_Size', '''Stream_Size', '''Succ', '''Tag', '''Terminated', '''Truncation', '''Unbiased_Rounding', '''Unchecked_Access', '''Val', '''Valid', '''Value', '''Version', '''Wide_Image', '''Wide_Value', '''Wide_Wide_Image', '''Wide_Wide_Value', '''Wide_Wide_Width', '''Wide_Width', '''Width', '''Write'] let g:ada#Keywords += [{ \ 'word': Item, \ 'menu': 'attribute', \ 'info': 'Ada attribute.', \ 'kind': 'a', \ 'icase': 1}] endfor " Section: add GNAT Attributes {{{3 " if exists ('g:ada_gnat_extensions') for Item in ['''Abort_Signal', '''Address_Size', '''Asm_Input', '''Asm_Output', '''AST_Entry', '''Bit', '''Bit_Position', '''Code_Address', '''Default_Bit_Order', '''Elaborated', '''Elab_Body', '''Elab_Spec', '''Emax', '''Enum_Rep', '''Epsilon', '''Fixed_Value', '''Has_Access_Values', '''Has_Discriminants', '''Img', '''Integer_Value', '''Machine_Size', '''Max_Interrupt_Priority', '''Max_Priority', '''Maximum_Alignment', '''Mechanism_Code', '''Null_Parameter', '''Object_Size', '''Passed_By_Reference', '''Range_Length', '''Storage_Unit', '''Target_Name', '''Tick', '''To_Address', '''Type_Class', '''UET_Address', '''Unconstrained_Array', '''Universal_Literal_String', '''Unrestricted_Access', '''VADS_Size', '''Value_Size', '''Wchar_T_Size', '''Word_Size'] let g:ada#Keywords += [{ \ 'word': Item, \ 'menu': 'attribute', \ 'info': 'GNAT attribute.', \ 'kind': 'a', \ 'icase': 1}] endfor endif " Section: add Ada Pragmas {{{2 " for Item in ['All_Calls_Remote', 'Assert', 'Assertion_Policy', 'Asynchronous', 'Atomic', 'Atomic_Components', 'Attach_Handler', 'Controlled', 'Convention', 'Detect_Blocking', 'Discard_Names', 'Elaborate', 'Elaborate_All', 'Elaborate_Body', 'Export', 'Import', 'Inline', 'Inspection_Point', 'Interface (Obsolescent)', 'Interrupt_Handler', 'Interrupt_Priority', 'Linker_Options', 'List', 'Locking_Policy', 'Memory_Size (Obsolescent)', 'No_Return', 'Normalize_Scalars', 'Optimize', 'Pack', 'Page', 'Partition_Elaboration_Policy', 'Preelaborable_Initialization', 'Preelaborate', 'Priority', 'Priority_Specific_Dispatching', 'Profile', 'Pure', 'Queueing_Policy', 'Relative_Deadline', 'Remote_Call_Interface', 'Remote_Types', 'Restrictions', 'Reviewable', 'Shared (Obsolescent)', 'Shared_Passive', 'Storage_Size', 'Storage_Unit (Obsolescent)', 'Suppress', 'System_Name (Obsolescent)', 'Task_Dispatching_Policy', 'Unchecked_Union', 'Unsuppress', 'Volatile', 'Volatile_Components'] let g:ada#Keywords += [{ \ 'word': Item, \ 'menu': 'pragma', \ 'info': 'Ada pragma.', \ 'kind': 'p', \ 'icase': 1}] endfor " Section: add GNAT Pragmas {{{3 " if exists ('g:ada_gnat_extensions') for Item in ['Abort_Defer', 'Ada_83', 'Ada_95', 'Ada_05', 'Annotate', 'Ast_Entry', 'C_Pass_By_Copy', 'Comment', 'Common_Object', 'Compile_Time_Warning', 'Complex_Representation', 'Component_Alignment', 'Convention_Identifier', 'CPP_Class', 'CPP_Constructor', 'CPP_Virtual', 'CPP_Vtable', 'Debug', 'Elaboration_Checks', 'Eliminate', 'Export_Exception', 'Export_Function', 'Export_Object', 'Export_Procedure', 'Export_Value', 'Export_Valued_Procedure', 'Extend_System', 'External', 'External_Name_Casing', 'Finalize_Storage_Only', 'Float_Representation', 'Ident', 'Import_Exception', 'Import_Function', 'Import_Object', 'Import_Procedure', 'Import_Valued_Procedure', 'Initialize_Scalars', 'Inline_Always', 'Inline_Generic', 'Interface_Name', 'Interrupt_State', 'Keep_Names', 'License', 'Link_With', 'Linker_Alias', 'Linker_Section', 'Long_Float', 'Machine_Attribute', 'Main_Storage', 'Obsolescent', 'Passive', 'Polling', 'Profile_Warnings', 'Propagate_Exceptions', 'Psect_Object', 'Pure_Function', 'Restriction_Warnings', 'Source_File_Name', 'Source_File_Name_Project', 'Source_Reference', 'Stream_Convert', 'Style_Checks', 'Subtitle', 'Suppress_All', 'Suppress_Exception_Locations', 'Suppress_Initialization', 'Task_Info', 'Task_Name', 'Task_Storage', 'Thread_Body', 'Time_Slice', 'Title', 'Unimplemented_Unit', 'Universal_Data', 'Unreferenced', 'Unreserve_All_Interrupts', 'Use_VADS_Size', 'Validity_Checks', 'Warnings', 'Weak_External'] let g:ada#Keywords += [{ \ 'word': Item, \ 'menu': 'pragma', \ 'info': 'GNAT pragma.', \ 'kind': 'p', \ 'icase': 1}] endfor endif " 1}}} " Section: g:ada#Ctags_Kinds {{{1 " let g:ada#Ctags_Kinds = { \ 'P': ["packspec", "package specifications"], \ 'p': ["package", "packages"], \ 'T': ["typespec", "type specifications"], \ 't': ["type", "types"], \ 'U': ["subspec", "subtype specifications"], \ 'u': ["subtype", "subtypes"], \ 'c': ["component", "record type components"], \ 'l': ["literal", "enum type literals"], \ 'V': ["varspec", "variable specifications"], \ 'v': ["variable", "variables"], \ 'f': ["formal", "generic formal parameters"], \ 'n': ["constant", "constants"], \ 'x': ["exception", "user defined exceptions"], \ 'R': ["subprogspec", "subprogram specifications"], \ 'r': ["subprogram", "subprograms"], \ 'K': ["taskspec", "task specifications"], \ 'k': ["task", "tasks"], \ 'O': ["protectspec", "protected data specifications"], \ 'o': ["protected", "protected data"], \ 'E': ["entryspec", "task/protected data entry specifications"], \ 'e': ["entry", "task/protected data entries"], \ 'b': ["label", "labels"], \ 'i': ["identifier", "loop/declare identifiers"], \ 'a': ["autovar", "automatic variables"], \ 'y': ["annon", "loops and blocks with no identifier"]} " Section: ada#Word (...) {{{1 " " Extract current Ada word across multiple lines " AdaWord ([line, column])\ " function ada#Word (...) if a:0 > 1 let l:Line_Nr = a:1 let l:Column_Nr = a:2 - 1 else let l:Line_Nr = line('.') let l:Column_Nr = col('.') - 1 endif let l:Line = substitute (getline (l:Line_Nr), g:ada#Comment, '', '' ) " Cope with tag searching for items in comments; if we are, don't loop " backards looking for previous lines if l:Column_Nr > strlen(l:Line) " We were in a comment let l:Line = getline(l:Line_Nr) let l:Search_Prev_Lines = 0 else let l: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 'l:Column_Nr' [1..n] to string offset [0..(n-1)] " ... but start, here, one after the required char. let l:New_Column = l:Column_Nr + 1 while 1 let l:New_Column = l:New_Column - 1 if l:New_Column < 0 " Have to include previous l:Line from file let l:Line_Nr = l:Line_Nr - 1 if l:Line_Nr < 1 || !l:Search_Prev_Lines " Start of file or matching in a comment let l:Line_Nr = 1 let l:New_Column = 0 let l:Our_Match = match (l:Line, g:ada#WordRegex ) break endif " Get previous l:Line, and prepend it to our search string let l:New_Line = substitute (getline (l:Line_Nr), g:ada#Comment, '', '' ) let l:New_Column = strlen (l:New_Line) - 1 let l:Column_Nr = l:Column_Nr + l:New_Column let l:Line = l:New_Line . l:Line endif " Check to see if this is a match excluding 'us' let l:Match_End = l:New_Column + \ matchend (strpart (l:Line,l:New_Column), g:ada#WordRegex ) - 1 if l:Match_End >= l:New_Column && \ l:Match_End < l:Column_Nr " Yes let l:Our_Match = l:Match_End+1 + \ match (strpart (l:Line,l:Match_End+1), g:ada#WordRegex ) break endif endwhile " Got anything? if l:Our_Match < 0 return '' else let l:Line = strpart (l:Line, l:Our_Match) endif " Now simply add further lines until the match gets no bigger let l:Match_String = matchstr (l:Line, g:ada#WordRegex) let l:Last_Line = line ('$') let l:Line_Nr = line ('.') + 1 while l:Line_Nr <= l:Last_Line let l:Last_Match = l:Match_String let l:Line = l:Line . \ substitute (getline (l:Line_Nr), g:ada#Comment, '', '') let l:Match_String = matchstr (l:Line, g:ada#WordRegex) if l:Match_String == l:Last_Match break endif endwhile " Strip whitespace & return return substitute (l:Match_String, '\s\+', '', 'g') endfunction ada#Word " Section: ada#List_Tag (...) {{{1 " " List tags in quickfix window " function ada#List_Tag (...) if a:0 > 1 let l:Tag_Word = ada#Word (a:1, a:2) elseif a:0 > 0 let l:Tag_Word = a:1 else let l:Tag_Word = ada#Word () endif echo "Searching for" l:Tag_Word let l:Pattern = '^' . l:Tag_Word . '$' let l:Tag_List = taglist (l:Pattern) let l:Error_List = [] " " add symbols " for Tag_Item in l:Tag_List if l:Tag_Item['kind'] == '' let l:Tag_Item['kind'] = 's' endif let l:Error_List += [ \ l:Tag_Item['filename'] . '|' . \ l:Tag_Item['cmd'] . '|' . \ l:Tag_Item['kind'] . "\t" . \ l:Tag_Item['name'] ] endfor set errorformat=%f\|%l\|%m cexpr l:Error_List cwindow endfunction ada#List_Tag " Section: ada#Jump_Tag (Word, Mode) {{{1 " " Word tag - include '.' and if Ada make uppercase " function ada#Jump_Tag (Word, Mode) if a:Word == '' " Get current word let l:Word = ada#Word() if l:Word == '' throw "NOT_FOUND: no identifier found." endif else let l:Word = a:Word endif echo "Searching for " . l:Word try execute a:Mode l:Word catch /.*:E426:.*/ let ignorecase = &ignorecase set ignorecase execute a:Mode l:Word let &ignorecase = ignorecase endtry return endfunction ada#Jump_Tag " Section: ada#Insert_Backspace () {{{1 " " Backspace at end of line after auto-inserted commentstring '-- ' wipes it " function ada#Insert_Backspace () let l:Line = getline ('.') if col ('.') > strlen (l:Line) && \ match (l:Line, '-- $') != -1 && \ match (&comments,'--') != -1 return "\\\" else return "\" endif return endfunction ada#InsertBackspace " Section: Insert Completions {{{1 " " Section: ada#User_Complete(findstart, base) {{{2 " " This function is used for the 'complete' option. " function! ada#User_Complete(findstart, base) if a:findstart == 1 " " locate the start of the word " let line = getline ('.') let start = col ('.') - 1 while start > 0 && line[start - 1] =~ '\i\|''' let start -= 1 endwhile return start else " " look up matches " let l:Pattern = '^' . a:base . '.*$' " " add keywords " for Tag_Item in g:ada#Keywords if l:Tag_Item['word'] =~? l:Pattern if complete_add (l:Tag_Item) == 0 return [] endif if complete_check () return [] endif endif endfor return [] endif endfunction ada#User_Complete " Section: ada#Completion (cmd) {{{2 " " Word completion (^N/^R/^X^]) - force '.' inclusion function ada#Completion (cmd) set iskeyword+=46 return a:cmd . "\=ada#Completion_End ()\" endfunction ada#Completion " Section: ada#Completion_End () {{{2 " function ada#Completion_End () set iskeyword-=46 return '' endfunction ada#Completion_End " Section: ada#Create_Tags {{{1 " function ada#Create_Tags (option) if a:option == 'file' let l:Filename = fnamemodify (bufname ('%'), ':p') elseif a:option == 'dir' let l:Filename = \ fnamemodify (bufname ('%'), ':p:h') . "*.ada " . \ fnamemodify (bufname ('%'), ':p:h') . "*.adb " . \ fnamemodify (bufname ('%'), ':p:h') . "*.ads" else let l:Filename = a:option endif execute '!ctags --excmd=number ' . l:Filename endfunction ada#Create_Tags " Section: ada#Switch_Session {{{1 " function ada#Switch_Session (New_Session) " " you should not save to much date into the seession since they will " be sourced " let l:sessionoptions=&sessionoptions try set sessionoptions=buffers,curdir,folds,globals,resize,slash,tabpages,tabpages,unix,winpos,winsize if a:New_Session != v:this_session " " We actualy got a new session - otherwise there " is nothing to do. " if strlen (v:this_session) > 0 execute 'mksession! ' . v:this_session endif let v:this_session = a:New_Session "if filereadable (v:this_session) "execute 'source ' . v:this_session "endif augroup ada_session autocmd! autocmd VimLeavePre * execute 'mksession! ' . v:this_session augroup END "if exists ("g:Tlist_Auto_Open") && g:Tlist_Auto_Open "TlistOpen "endif endif finally let &sessionoptions=l:sessionoptions endtry return endfunction ada#Switch_Session " Section: GNAT Pretty Printer folding {{{1 " if exists('g:ada_folding') && g:ada_folding[0] == 'g' " " Lines consisting only of ')' ';' are due to a gnat pretty bug and " have the same level as the line above (can't happen in the first " line). " let s:Fold_Collate = '^\([;)]*$\|' " " some lone statements are folded with the line above " if stridx (g:ada_folding, 'i') >= 0 let s:Fold_Collate .= '\s\+\$\|' endif if stridx (g:ada_folding, 'b') >= 0 let s:Fold_Collate .= '\s\+\$\|' endif if stridx (g:ada_folding, 'p') >= 0 let s:Fold_Collate .= '\s\+\$\|' endif if stridx (g:ada_folding, 'x') >= 0 let s:Fold_Collate .= '\s\+\$\|' endif " We also handle empty lines and " comments here. let s:Fold_Collate .= '--\)' function ada#Pretty_Print_Folding (Line) " {{{2 let l:Text = getline (a:Line) if l:Text =~ s:Fold_Collate " " fold with line above " let l:Level = "=" elseif l:Text =~ '^\s\+(' " " gnat outdents a line which stards with a ( by one characters so " that parameters which follow are aligned. " let l:Level = (indent (a:Line) + 1) / &shiftwidth else let l:Level = indent (a:Line) / &shiftwidth endif return l:Level endfunction ada#Pretty_Print_Folding " }}}2 endif " Section: Options and Menus {{{1 " " Section: ada#Switch_Syntax_Options {{{2 " function ada#Switch_Syntax_Option (option) syntax off if exists ('g:ada_' . a:option) unlet g:ada_{a:option} echo a:option . 'now off' else let g:ada_{a:option}=1 echo a:option . 'now on' endif syntax on endfunction ada#Switch_Syntax_Option " Section: ada#Map_Menu {{{2 " function ada#Map_Menu (Text, Keys, Command) if a:Keys[0] == ':' execute \ "50amenu " . \ "Ada." . escape(a:Text, ' ') . \ "" . a:Keys . \ " :" . a:Command . "" execute \ "command -buffer " . \ a:Keys[1:] . \" :" . a:Command . "" elseif a:Keys[0] == '<' execute \ "50amenu " . \ "Ada." . escape(a:Text, ' ') . \ "" . a:Keys . \ " :" . a:Command . "" execute \ "nnoremap " . \ a:Keys . \" :" . a:Command . "" execute \ "inoremap " . \ a:Keys . \" :" . a:Command . "" else if exists("g:mapleader") let l:leader = g:mapleader else let l:leader = '\' endif execute \ "50amenu " . \ "Ada." . escape(a:Text, ' ') . \ "" . escape(l:leader . "a" . a:Keys , '\') . \ " :" . a:Command . "" execute \ "nnoremap " . \ escape(l:leader . "a" . a:Keys , '\') . \" :" . a:Command execute \ "inoremap " . \ escape(l:leader . "a" . a:Keys , '\') . \" :" . a:Command endif return endfunction " Section: ada#Map_Popup {{{2 " function ada#Map_Popup (Text, Keys, Command) if exists("g:mapleader") let l:leader = g:mapleader else let l:leader = '\' endif execute \ "50amenu " . \ "PopUp." . escape(a:Text, ' ') . \ "" . escape(l:leader . "a" . a:Keys , '\') . \ " :" . a:Command . "" call ada#Map_Menu (a:Text, a:Keys, a:Command) return endfunction ada#Map_Popup " }}}1 lockvar g:ada#WordRegex lockvar g:ada#DotWordRegex lockvar g:ada#Comment lockvar! g:ada#Keywords lockvar! g:ada#Ctags_Kinds let &cpo = s:keepcpo unlet s:keepcpo finish " 1}}} "------------------------------------------------------------------------------ " Copyright (C) 2006 Martin Krischik " " Vim is Charityware - see ":help license" or uganda.txt for licence details. "------------------------------------------------------------------------------ " vim: textwidth=78 wrap tabstop=8 shiftwidth=3 softtabstop=3 noexpandtab " vim: foldmethod=marker vim-7.4.1689/runtime/autoload/adacomplete.vim000066400000000000000000000071251267703067000210700ustar00rootroot00000000000000"------------------------------------------------------------------------------ " Description: Vim Ada omnicompletion file " Language: Ada (2005) " $Id: adacomplete.vim 887 2008-07-08 14:29:01Z krischik $ " Maintainer: Martin Krischik " $Author: krischik $ " $Date: 2008-07-08 16:29:01 +0200 (Di, 08 Jul 2008) $ " Version: 4.6 " $Revision: 887 $ " $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/adacomplete.vim $ " History: 24.05.2006 MK Unified Headers " 26.05.2006 MK improved search for begin of word. " 16.07.2006 MK Ada-Mode as vim-ball " 15.10.2006 MK Bram's suggestion for runtime integration " 05.11.2006 MK Bram suggested not to use include protection for " autoload " 05.11.2006 MK Bram suggested agaist using setlocal omnifunc " 05.11.2006 MK Bram suggested to save on spaces " Help Page: ft-ada-omni "------------------------------------------------------------------------------ if version < 700 finish endif " Section: adacomplete#Complete () {{{1 " " This function is used for the 'omnifunc' option. " function! adacomplete#Complete (findstart, base) if a:findstart == 1 return ada#User_Complete (a:findstart, a:base) else " " look up matches " if exists ("g:ada_omni_with_keywords") call ada#User_Complete (a:findstart, a:base) endif " " search tag file for matches " let l:Pattern = '^' . a:base . '.*$' let l:Tag_List = taglist (l:Pattern) " " add symbols " for Tag_Item in l:Tag_List if l:Tag_Item['kind'] == '' " " Tag created by gnat xref " let l:Match_Item = { \ 'word': l:Tag_Item['name'], \ 'menu': l:Tag_Item['filename'], \ 'info': "Symbol from file " . l:Tag_Item['filename'] . " line " . l:Tag_Item['cmd'], \ 'kind': 's', \ 'icase': 1} else " " Tag created by ctags " let l:Info = 'Symbol : ' . l:Tag_Item['name'] . "\n" let l:Info .= 'Of type : ' . g:ada#Ctags_Kinds[l:Tag_Item['kind']][1] . "\n" let l:Info .= 'Defined in File : ' . l:Tag_Item['filename'] . "\n" if has_key( l:Tag_Item, 'package') let l:Info .= 'Package : ' . l:Tag_Item['package'] . "\n" let l:Menu = l:Tag_Item['package'] elseif has_key( l:Tag_Item, 'separate') let l:Info .= 'Separate from Package : ' . l:Tag_Item['separate'] . "\n" let l:Menu = l:Tag_Item['separate'] elseif has_key( l:Tag_Item, 'packspec') let l:Info .= 'Package Specification : ' . l:Tag_Item['packspec'] . "\n" let l:Menu = l:Tag_Item['packspec'] elseif has_key( l:Tag_Item, 'type') let l:Info .= 'Datetype : ' . l:Tag_Item['type'] . "\n" let l:Menu = l:Tag_Item['type'] else let l:Menu = l:Tag_Item['filename'] endif let l:Match_Item = { \ 'word': l:Tag_Item['name'], \ 'menu': l:Menu, \ 'info': l:Info, \ 'kind': l:Tag_Item['kind'], \ 'icase': 1} endif if complete_add (l:Match_Item) == 0 return [] endif if complete_check () return [] endif endfor return [] endif endfunction adacomplete#Complete finish " 1}}} "------------------------------------------------------------------------------ " Copyright (C) 2006 Martin Krischik " " Vim is Charityware - see ":help license" or uganda.txt for licence details. "------------------------------------------------------------------------------ " vim: textwidth=78 wrap tabstop=8 shiftwidth=3 softtabstop=3 noexpandtab " vim: foldmethod=marker vim-7.4.1689/runtime/autoload/ccomplete.vim000066400000000000000000000412041267703067000205610ustar00rootroot00000000000000" Vim completion script " Language: C " Maintainer: Bram Moolenaar " Last Change: 2012 Jun 20 let s:cpo_save = &cpo set cpo&vim " This function is used for the 'omnifunc' option. function! ccomplete#Complete(findstart, base) if a:findstart " Locate the start of the item, including ".", "->" and "[...]". let line = getline('.') let start = col('.') - 1 let lastword = -1 while start > 0 if line[start - 1] =~ '\w' let start -= 1 elseif line[start - 1] =~ '\.' if lastword == -1 let lastword = start endif let start -= 1 elseif start > 1 && line[start - 2] == '-' && line[start - 1] == '>' if lastword == -1 let lastword = start endif let start -= 2 elseif line[start - 1] == ']' " Skip over [...]. let n = 0 let start -= 1 while start > 0 let start -= 1 if line[start] == '[' if n == 0 break endif let n -= 1 elseif line[start] == ']' " nested [] let n += 1 endif endwhile else break endif endwhile " Return the column of the last word, which is going to be changed. " Remember the text that comes before it in s:prepended. if lastword == -1 let s:prepended = '' return start endif let s:prepended = strpart(line, start, lastword - start) return lastword endif " Return list of matches. let base = s:prepended . a:base " Don't do anything for an empty base, would result in all the tags in the " tags file. if base == '' return [] endif " init cache for vimgrep to empty let s:grepCache = {} " Split item in words, keep empty word after "." or "->". " "aa" -> ['aa'], "aa." -> ['aa', ''], "aa.bb" -> ['aa', 'bb'], etc. " We can't use split, because we need to skip nested [...]. let items = [] let s = 0 while 1 let e = match(base, '\.\|->\|\[', s) if e < 0 if s == 0 || base[s - 1] != ']' call add(items, strpart(base, s)) endif break endif if s == 0 || base[s - 1] != ']' call add(items, strpart(base, s, e - s)) endif if base[e] == '.' let s = e + 1 " skip over '.' elseif base[e] == '-' let s = e + 2 " skip over '->' else " Skip over [...]. let n = 0 let s = e let e += 1 while e < len(base) if base[e] == ']' if n == 0 break endif let n -= 1 elseif base[e] == '[' " nested [...] let n += 1 endif let e += 1 endwhile let e += 1 call add(items, strpart(base, s, e - s)) let s = e endif endwhile " Find the variable items[0]. " 1. in current function (like with "gd") " 2. in tags file(s) (like with ":tag") " 3. in current file (like with "gD") let res = [] if searchdecl(items[0], 0, 1) == 0 " Found, now figure out the type. " TODO: join previous line if it makes sense let line = getline('.') let col = col('.') if stridx(strpart(line, 0, col), ';') != -1 " Handle multiple declarations on the same line. let col2 = col - 1 while line[col2] != ';' let col2 -= 1 endwhile let line = strpart(line, col2 + 1) let col -= col2 endif if stridx(strpart(line, 0, col), ',') != -1 " Handle multiple declarations on the same line in a function " declaration. let col2 = col - 1 while line[col2] != ',' let col2 -= 1 endwhile if strpart(line, col2 + 1, col - col2 - 1) =~ ' *[^ ][^ ]* *[^ ]' let line = strpart(line, col2 + 1) let col -= col2 endif endif if len(items) == 1 " Completing one word and it's a local variable: May add '[', '.' or " '->'. let match = items[0] let kind = 'v' if match(line, '\<' . match . '\s*\[') > 0 let match .= '[' else let res = s:Nextitem(strpart(line, 0, col), [''], 0, 1) if len(res) > 0 " There are members, thus add "." or "->". if match(line, '\*[ \t(]*' . match . '\>') > 0 let match .= '->' else let match .= '.' endif endif endif let res = [{'match': match, 'tagline' : '', 'kind' : kind, 'info' : line}] else " Completing "var.", "var.something", etc. let res = s:Nextitem(strpart(line, 0, col), items[1:], 0, 1) endif endif if len(items) == 1 " Only one part, no "." or "->": complete from tags file. let tags = taglist('^' . base) " Remove members, these can't appear without something in front. call filter(tags, 'has_key(v:val, "kind") ? v:val["kind"] != "m" : 1') " Remove static matches in other files. call filter(tags, '!has_key(v:val, "static") || !v:val["static"] || bufnr("%") == bufnr(v:val["filename"])') call extend(res, map(tags, 's:Tag2item(v:val)')) endif if len(res) == 0 " Find the variable in the tags file(s) let diclist = taglist('^' . items[0] . '$') " Remove members, these can't appear without something in front. call filter(diclist, 'has_key(v:val, "kind") ? v:val["kind"] != "m" : 1') let res = [] for i in range(len(diclist)) " New ctags has the "typeref" field. Patched version has "typename". if has_key(diclist[i], 'typename') call extend(res, s:StructMembers(diclist[i]['typename'], items[1:], 1)) elseif has_key(diclist[i], 'typeref') call extend(res, s:StructMembers(diclist[i]['typeref'], items[1:], 1)) endif " For a variable use the command, which must be a search pattern that " shows the declaration of the variable. if diclist[i]['kind'] == 'v' let line = diclist[i]['cmd'] if line[0] == '/' && line[1] == '^' let col = match(line, '\<' . items[0] . '\>') call extend(res, s:Nextitem(strpart(line, 2, col - 2), items[1:], 0, 1)) endif endif endfor endif if len(res) == 0 && searchdecl(items[0], 1) == 0 " Found, now figure out the type. " TODO: join previous line if it makes sense let line = getline('.') let col = col('.') let res = s:Nextitem(strpart(line, 0, col), items[1:], 0, 1) endif " If the last item(s) are [...] they need to be added to the matches. let last = len(items) - 1 let brackets = '' while last >= 0 if items[last][0] != '[' break endif let brackets = items[last] . brackets let last -= 1 endwhile return map(res, 's:Tagline2item(v:val, brackets)') endfunc function! s:GetAddition(line, match, memarg, bracket) " Guess if the item is an array. if a:bracket && match(a:line, a:match . '\s*\[') > 0 return '[' endif " Check if the item has members. if len(s:SearchMembers(a:memarg, [''], 0)) > 0 " If there is a '*' before the name use "->". if match(a:line, '\*[ \t(]*' . a:match . '\>') > 0 return '->' else return '.' endif endif return '' endfunction " Turn the tag info "val" into an item for completion. " "val" is is an item in the list returned by taglist(). " If it is a variable we may add "." or "->". Don't do it for other types, " such as a typedef, by not including the info that s:GetAddition() uses. function! s:Tag2item(val) let res = {'match': a:val['name']} let res['extra'] = s:Tagcmd2extra(a:val['cmd'], a:val['name'], a:val['filename']) let s = s:Dict2info(a:val) if s != '' let res['info'] = s endif let res['tagline'] = '' if has_key(a:val, "kind") let kind = a:val['kind'] let res['kind'] = kind if kind == 'v' let res['tagline'] = "\t" . a:val['cmd'] let res['dict'] = a:val elseif kind == 'f' let res['match'] = a:val['name'] . '(' endif endif return res endfunction " Use all the items in dictionary for the "info" entry. function! s:Dict2info(dict) let info = '' for k in sort(keys(a:dict)) let info .= k . repeat(' ', 10 - len(k)) if k == 'cmd' let info .= substitute(matchstr(a:dict['cmd'], '/^\s*\zs.*\ze$/'), '\\\(.\)', '\1', 'g') else let info .= a:dict[k] endif let info .= "\n" endfor return info endfunc " Parse a tag line and return a dictionary with items like taglist() function! s:ParseTagline(line) let l = split(a:line, "\t") let d = {} if len(l) >= 3 let d['name'] = l[0] let d['filename'] = l[1] let d['cmd'] = l[2] let n = 2 if l[2] =~ '^/' " Find end of cmd, it may contain Tabs. while n < len(l) && l[n] !~ '/;"$' let n += 1 let d['cmd'] .= " " . l[n] endwhile endif for i in range(n + 1, len(l) - 1) if l[i] == 'file:' let d['static'] = 1 elseif l[i] !~ ':' let d['kind'] = l[i] else let d[matchstr(l[i], '[^:]*')] = matchstr(l[i], ':\zs.*') endif endfor endif return d endfunction " Turn a match item "val" into an item for completion. " "val['match']" is the matching item. " "val['tagline']" is the tagline in which the last part was found. function! s:Tagline2item(val, brackets) let line = a:val['tagline'] let add = s:GetAddition(line, a:val['match'], [a:val], a:brackets == '') let res = {'word': a:val['match'] . a:brackets . add } if has_key(a:val, 'info') " Use info from Tag2item(). let res['info'] = a:val['info'] else " Parse the tag line and add each part to the "info" entry. let s = s:Dict2info(s:ParseTagline(line)) if s != '' let res['info'] = s endif endif if has_key(a:val, 'kind') let res['kind'] = a:val['kind'] elseif add == '(' let res['kind'] = 'f' else let s = matchstr(line, '\t\(kind:\)\=\zs\S\ze\(\t\|$\)') if s != '' let res['kind'] = s endif endif if has_key(a:val, 'extra') let res['menu'] = a:val['extra'] return res endif " Isolate the command after the tag and filename. let s = matchstr(line, '[^\t]*\t[^\t]*\t\zs\(/^.*$/\|[^\t]*\)\ze\(;"\t\|\t\|$\)') if s != '' let res['menu'] = s:Tagcmd2extra(s, a:val['match'], matchstr(line, '[^\t]*\t\zs[^\t]*\ze\t')) endif return res endfunction " Turn a command from a tag line to something that is useful in the menu function! s:Tagcmd2extra(cmd, name, fname) if a:cmd =~ '^/^' " The command is a search command, useful to see what it is. let x = matchstr(a:cmd, '^/^\s*\zs.*\ze$/') let x = substitute(x, '\<' . a:name . '\>', '@@', '') let x = substitute(x, '\\\(.\)', '\1', 'g') let x = x . ' - ' . a:fname elseif a:cmd =~ '^\d*$' " The command is a line number, the file name is more useful. let x = a:fname . ' - ' . a:cmd else " Not recognized, use command and file name. let x = a:cmd . ' - ' . a:fname endif return x endfunction " Find composing type in "lead" and match items[0] with it. " Repeat this recursively for items[1], if it's there. " When resolving typedefs "depth" is used to avoid infinite recursion. " Return the list of matches. function! s:Nextitem(lead, items, depth, all) " Use the text up to the variable name and split it in tokens. let tokens = split(a:lead, '\s\+\|\<') " Try to recognize the type of the variable. This is rough guessing... let res = [] for tidx in range(len(tokens)) " Skip tokens starting with a non-ID character. if tokens[tidx] !~ '^\h' continue endif " Recognize "struct foobar" and "union foobar". " Also do "class foobar" when it's C++ after all (doesn't work very well " though). if (tokens[tidx] == 'struct' || tokens[tidx] == 'union' || tokens[tidx] == 'class') && tidx + 1 < len(tokens) let res = s:StructMembers(tokens[tidx] . ':' . tokens[tidx + 1], a:items, a:all) break endif " TODO: add more reserved words if index(['int', 'short', 'char', 'float', 'double', 'static', 'unsigned', 'extern'], tokens[tidx]) >= 0 continue endif " Use the tags file to find out if this is a typedef. let diclist = taglist('^' . tokens[tidx] . '$') for tagidx in range(len(diclist)) let item = diclist[tagidx] " New ctags has the "typeref" field. Patched version has "typename". if has_key(item, 'typeref') call extend(res, s:StructMembers(item['typeref'], a:items, a:all)) continue endif if has_key(item, 'typename') call extend(res, s:StructMembers(item['typename'], a:items, a:all)) continue endif " Only handle typedefs here. if item['kind'] != 't' continue endif " Skip matches local to another file. if has_key(item, 'static') && item['static'] && bufnr('%') != bufnr(item['filename']) continue endif " For old ctags we recognize "typedef struct aaa" and " "typedef union bbb" in the tags file command. let cmd = item['cmd'] let ei = matchend(cmd, 'typedef\s\+') if ei > 1 let cmdtokens = split(strpart(cmd, ei), '\s\+\|\<') if len(cmdtokens) > 1 if cmdtokens[0] == 'struct' || cmdtokens[0] == 'union' || cmdtokens[0] == 'class' let name = '' " Use the first identifier after the "struct" or "union" for ti in range(len(cmdtokens) - 1) if cmdtokens[ti] =~ '^\w' let name = cmdtokens[ti] break endif endfor if name != '' call extend(res, s:StructMembers(cmdtokens[0] . ':' . name, a:items, a:all)) endif elseif a:depth < 10 " Could be "typedef other_T some_T". call extend(res, s:Nextitem(cmdtokens[0], a:items, a:depth + 1, a:all)) endif endif endif endfor if len(res) > 0 break endif endfor return res endfunction " Search for members of structure "typename" in tags files. " Return a list with resulting matches. " Each match is a dictionary with "match" and "tagline" entries. " When "all" is non-zero find all, otherwise just return 1 if there is any " member. function! s:StructMembers(typename, items, all) " Todo: What about local structures? let fnames = join(map(tagfiles(), 'escape(v:val, " \\#%")')) if fnames == '' return [] endif let typename = a:typename let qflist = [] let cached = 0 if a:all == 0 let n = '1' " stop at first found match if has_key(s:grepCache, a:typename) let qflist = s:grepCache[a:typename] let cached = 1 endif else let n = '' endif if !cached while 1 exe 'silent! keepj noautocmd ' . n . 'vimgrep /\t' . typename . '\(\t\|$\)/j ' . fnames let qflist = getqflist() if len(qflist) > 0 || match(typename, "::") < 0 break endif " No match for "struct:context::name", remove "context::" and try again. let typename = substitute(typename, ':[^:]*::', ':', '') endwhile if a:all == 0 " Store the result to be able to use it again later. let s:grepCache[a:typename] = qflist endif endif " Put matching members in matches[]. let matches = [] for l in qflist let memb = matchstr(l['text'], '[^\t]*') if memb =~ '^' . a:items[0] " Skip matches local to another file. if match(l['text'], "\tfile:") < 0 || bufnr('%') == bufnr(matchstr(l['text'], '\t\zs[^\t]*')) let item = {'match': memb, 'tagline': l['text']} " Add the kind of item. let s = matchstr(l['text'], '\t\(kind:\)\=\zs\S\ze\(\t\|$\)') if s != '' let item['kind'] = s if s == 'f' let item['match'] = memb . '(' endif endif call add(matches, item) endif endif endfor if len(matches) > 0 " Skip over [...] items let idx = 1 while 1 if idx >= len(a:items) return matches " No further items, return the result. endif if a:items[idx][0] != '[' break endif let idx += 1 endwhile " More items following. For each of the possible members find the " matching following members. return s:SearchMembers(matches, a:items[idx :], a:all) endif " Failed to find anything. return [] endfunction " For matching members, find matches for following items. " When "all" is non-zero find all, otherwise just return 1 if there is any " member. function! s:SearchMembers(matches, items, all) let res = [] for i in range(len(a:matches)) let typename = '' if has_key(a:matches[i], 'dict') if has_key(a:matches[i].dict, 'typename') let typename = a:matches[i].dict['typename'] elseif has_key(a:matches[i].dict, 'typeref') let typename = a:matches[i].dict['typeref'] endif let line = "\t" . a:matches[i].dict['cmd'] else let line = a:matches[i]['tagline'] let e = matchend(line, '\ttypename:') if e < 0 let e = matchend(line, '\ttyperef:') endif if e > 0 " Use typename field let typename = matchstr(line, '[^\t]*', e) endif endif if typename != '' call extend(res, s:StructMembers(typename, a:items, a:all)) else " Use the search command (the declaration itself). let s = match(line, '\t\zs/^') if s > 0 let e = match(line, '\<' . a:matches[i]['match'] . '\>', s) if e > 0 call extend(res, s:Nextitem(strpart(line, s, e - s), a:items, 0, a:all)) endif endif endif if a:all == 0 && len(res) > 0 break endif endfor return res endfunc let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/autoload/clojurecomplete.vim000066400000000000000000000170441267703067000220070ustar00rootroot00000000000000" Vim completion script " Language: Clojure " Maintainer: Sung Pae " URL: https://github.com/guns/vim-clojure-static " License: Same as Vim " Last Change: 27 March 2014 " -*- COMPLETION WORDS -*- " Generated from https://github.com/guns/vim-clojure-static/blob/vim-release-010/clj/src/vim_clojure_static/generate.clj " Clojure version 1.6.0 let s:words = ["*","*'","*1","*2","*3","*agent*","*allow-unresolved-vars*","*assert*","*clojure-version*","*command-line-args*","*compile-files*","*compile-path*","*compiler-options*","*data-readers*","*default-data-reader-fn*","*e","*err*","*file*","*flush-on-newline*","*fn-loader*","*in*","*math-context*","*ns*","*out*","*print-dup*","*print-length*","*print-level*","*print-meta*","*print-readably*","*read-eval*","*source-path*","*unchecked-math*","*use-context-classloader*","*verbose-defrecords*","*warn-on-reflection*","+","+'","-","-'","->","->>","->ArrayChunk","->Vec","->VecNode","->VecSeq","-cache-protocol-fn","-reset-methods",".","..","/","<","<=","=","==",">",">=","EMPTY-NODE","accessor","aclone","add-classpath","add-watch","agent","agent-error","agent-errors","aget","alength","alias","all-ns","alter","alter-meta!","alter-var-root","amap","ancestors","and","apply","areduce","array-map","as->","aset","aset-boolean","aset-byte","aset-char","aset-double","aset-float","aset-int","aset-long","aset-short","assert","assoc!","assoc","assoc-in","associative?","atom","await","await-for","await1","bases","bean","bigdec","bigint","biginteger","binding","bit-and","bit-and-not","bit-clear","bit-flip","bit-not","bit-or","bit-set","bit-shift-left","bit-shift-right","bit-test","bit-xor","boolean","boolean-array","booleans","bound-fn","bound-fn*","bound?","butlast","byte","byte-array","bytes","case","cast","catch","char","char-array","char-escape-string","char-name-string","char?","chars","chunk","chunk-append","chunk-buffer","chunk-cons","chunk-first","chunk-next","chunk-rest","chunked-seq?","class","class?","clear-agent-errors","clojure-version","coll?","comment","commute","comp","comparator","compare","compare-and-set!","compile","complement","concat","cond","cond->","cond->>","condp","conj!","conj","cons","constantly","construct-proxy","contains?","count","counted?","create-ns","create-struct","cycle","dec","dec'","decimal?","declare","def","default-data-readers","definline","definterface","defmacro","defmethod","defmulti","defn","defn-","defonce","defprotocol","defrecord","defstruct","deftype","delay","delay?","deliver","denominator","deref","derive","descendants","destructure","disj!","disj","dissoc!","dissoc","distinct","distinct?","do","doall","dorun","doseq","dosync","dotimes","doto","double","double-array","doubles","drop","drop-last","drop-while","empty","empty?","ensure","enumeration-seq","error-handler","error-mode","eval","even?","every-pred","every?","ex-data","ex-info","extend","extend-protocol","extend-type","extenders","extends?","false?","ffirst","file-seq","filter","filterv","finally","find","find-keyword","find-ns","find-protocol-impl","find-protocol-method","find-var","first","flatten","float","float-array","float?","floats","flush","fn","fn","fn?","fnext","fnil","for","force","format","frequencies","future","future-call","future-cancel","future-cancelled?","future-done?","future?","gen-class","gen-interface","gensym","get","get-in","get-method","get-proxy-class","get-thread-bindings","get-validator","group-by","hash","hash-combine","hash-map","hash-ordered-coll","hash-set","hash-unordered-coll","identical?","identity","if","if-let","if-not","if-some","ifn?","import","in-ns","inc","inc'","init-proxy","instance?","int","int-array","integer?","interleave","intern","interpose","into","into-array","ints","io!","isa?","iterate","iterator-seq","juxt","keep","keep-indexed","key","keys","keyword","keyword?","last","lazy-cat","lazy-seq","let","let","letfn","line-seq","list","list*","list?","load","load-file","load-reader","load-string","loaded-libs","locking","long","long-array","longs","loop","loop","macroexpand","macroexpand-1","make-array","make-hierarchy","map","map-indexed","map?","mapcat","mapv","max","max-key","memfn","memoize","merge","merge-with","meta","method-sig","methods","min","min-key","mix-collection-hash","mod","monitor-enter","monitor-exit","munge","name","namespace","namespace-munge","neg?","new","newline","next","nfirst","nil?","nnext","not","not-any?","not-empty","not-every?","not=","ns","ns-aliases","ns-imports","ns-interns","ns-map","ns-name","ns-publics","ns-refers","ns-resolve","ns-unalias","ns-unmap","nth","nthnext","nthrest","num","number?","numerator","object-array","odd?","or","parents","partial","partition","partition-all","partition-by","pcalls","peek","persistent!","pmap","pop!","pop","pop-thread-bindings","pos?","pr","pr-str","prefer-method","prefers","primitives-classnames","print","print-ctor","print-dup","print-method","print-simple","print-str","printf","println","println-str","prn","prn-str","promise","proxy","proxy-call-with-super","proxy-mappings","proxy-name","proxy-super","push-thread-bindings","pvalues","quot","quote","rand","rand-int","rand-nth","range","ratio?","rational?","rationalize","re-find","re-groups","re-matcher","re-matches","re-pattern","re-seq","read","read-line","read-string","realized?","record?","recur","reduce","reduce-kv","reduced","reduced?","reductions","ref","ref-history-count","ref-max-history","ref-min-history","ref-set","refer","refer-clojure","reify","release-pending-sends","rem","remove","remove-all-methods","remove-method","remove-ns","remove-watch","repeat","repeatedly","replace","replicate","require","reset!","reset-meta!","resolve","rest","restart-agent","resultset-seq","reverse","reversible?","rseq","rsubseq","satisfies?","second","select-keys","send","send-off","send-via","seq","seq?","seque","sequence","sequential?","set!","set","set-agent-send-executor!","set-agent-send-off-executor!","set-error-handler!","set-error-mode!","set-validator!","set?","short","short-array","shorts","shuffle","shutdown-agents","slurp","some","some->","some->>","some-fn","some?","sort","sort-by","sorted-map","sorted-map-by","sorted-set","sorted-set-by","sorted?","special-symbol?","spit","split-at","split-with","str","string?","struct","struct-map","subs","subseq","subvec","supers","swap!","symbol","symbol?","sync","take","take-last","take-nth","take-while","test","the-ns","thread-bound?","throw","time","to-array","to-array-2d","trampoline","transient","tree-seq","true?","try","type","unchecked-add","unchecked-add-int","unchecked-byte","unchecked-char","unchecked-dec","unchecked-dec-int","unchecked-divide-int","unchecked-double","unchecked-float","unchecked-inc","unchecked-inc-int","unchecked-int","unchecked-long","unchecked-multiply","unchecked-multiply-int","unchecked-negate","unchecked-negate-int","unchecked-remainder-int","unchecked-short","unchecked-subtract","unchecked-subtract-int","underive","unquote","unquote-splicing","unsigned-bit-shift-right","update-in","update-proxy","use","val","vals","var","var-get","var-set","var?","vary-meta","vec","vector","vector-of","vector?","when","when-first","when-let","when-not","when-some","while","with-bindings","with-bindings*","with-in-str","with-loading-context","with-local-vars","with-meta","with-open","with-out-str","with-precision","with-redefs","with-redefs-fn","xml-seq","zero?","zipmap"] " Simple word completion for special forms and public vars in clojure.core function! clojurecomplete#Complete(findstart, base) if a:findstart return searchpos('\<', 'bnW', line('.'))[1] - 1 else return { 'words': filter(copy(s:words), 'v:val =~# "\\V\\^' . a:base . '"') } endif endfunction " vim:sts=8:sw=8:ts=8:noet vim-7.4.1689/runtime/autoload/csscomplete.vim000066400000000000000000001242711267703067000211350ustar00rootroot00000000000000" Vim completion script " Language: CSS " Based on MDN CSS Reference at 2016 Jan " plus CSS Speech Module " Maintainer: Kao, Wei-Ko(othree) ( othree AT gmail DOT com ) " Original Author: Mikolaj Machowski ( mikmach AT wp DOT pl ) " Last Change: 2016 Jan 11 let s:values = split("all additive-symbols align-content align-items align-self animation animation-delay animation-direction animation-duration animation-fill-mode animation-iteration-count animation-name animation-play-state animation-timing-function backface-visibility background background-attachment background-blend-mode background-clip background-color background-image background-origin background-position background-repeat background-size block-size border border-block-end border-block-end-color border-block-end-style border-block-end-width border-block-start border-block-start-color border-block-start-style border-block-start-width border-bottom border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-style border-bottom-width border-collapse border-color border-image border-image-outset border-image-repeat border-image-slice border-image-source border-image-width border-inline-end border-inline-end-color border-inline-end-style border-inline-end-width border-inline-start border-inline-start-color border-inline-start-style border-inline-start-width border-left border-left-color border-left-style border-left-width border-radius border-right border-right-color border-right-style border-right-width border-spacing border-style border-top border-top-color border-top-left-radius border-top-right-radius border-top-style border-top-width border-width bottom box-decoration-break box-shadow box-sizing break-after break-before break-inside caption-side clear clip clip-path color columns column-count column-fill column-gap column-rule column-rule-color column-rule-style column-rule-width column-span column-width content counter-increment counter-reset cue cue-before cue-after cursor direction display empty-cells fallback filter flex flex-basis flex-direction flex-flow flex-grow flex-shrink flex-wrap float font font-family font-feature-settings font-kerning font-language-override font-size font-size-adjust font-stretch font-style font-synthesis font-variant font-variant-alternates font-variant-caps font-variant-east-asian font-variant-ligatures font-variant-numeric font-variant-position font-weight grid grid-area grid-auto-columns grid-auto-flow grid-auto-position grid-auto-rows grid-column grid-column-start grid-column-end grid-row grid-row-start grid-row-end grid-template grid-template-areas grid-template-rows grid-template-columns height hyphens image-rendering image-resolution image-orientation ime-mode inline-size isolation justify-content left letter-spacing line-break line-height list-style list-style-image list-style-position list-style-type margin margin-block-end margin-block-start margin-bottom margin-inline-end margin-inline-start margin-left margin-right margin-top marks mask mask-type max-block-size max-height max-inline-size max-width max-zoom min-block-size min-height min-inline-size min-width min-zoom mix-blend-mode negative object-fit object-position offset-block-end offset-block-start offset-inline-end offset-inline-start opacity order orientation orphans outline outline-color outline-offset outline-style outline-width overflow overflow-wrap overflow-x overflow-y pad padding padding-block-end padding-block-start padding-bottom padding-inline-end padding-inline-start padding-left padding-right padding-top page-break-after page-break-before page-break-inside pause-before pause-after pause perspective perspective-origin pointer-events position prefix quotes range resize rest rest-before rest-after right ruby-align ruby-merge ruby-position scroll-behavior scroll-snap-coordinate scroll-snap-destination scroll-snap-points-x scroll-snap-points-y scroll-snap-type scroll-snap-type-x scroll-snap-type-y shape-image-threshold shape-margin shape-outside speak speak-as suffix symbols system table-layout tab-size text-align text-align-last text-combine-upright text-decoration text-decoration-color text-decoration-line text-emphasis text-emphasis-color text-emphasis-position text-emphasis-style text-indent text-orientation text-overflow text-rendering text-shadow text-transform text-underline-position top touch-action transform transform-box transform-origin transform-style transition transition-delay transition-duration transition-property transition-timing-function unicode-bidi unicode-range user-zoom vertical-align visibility voice-balance voice-duration voice-family voice-pitch voice-rate voice-range voice-stress voice-volume white-space widows width will-change word-break word-spacing word-wrap writing-mode z-index zoom") function! csscomplete#CompleteCSS(findstart, base) if a:findstart " We need whole line to proper checking let line = getline('.') let start = col('.') - 1 let compl_begin = col('.') - 2 while start >= 0 && line[start - 1] =~ '\%(\k\|-\)' let start -= 1 endwhile let b:after = line[compl_begin :] let b:compl_context = line[0:compl_begin] return start endif " There are few chars important for context: " ^ ; : { } /* */ " Where ^ is start of line and /* */ are comment borders " Depending on their relative position to cursor we will know what should " be completed. " 1. if nearest are ^ or { or ; current word is property " 2. if : it is value (with exception of pseudo things) " 3. if } we are outside of css definitions " 4. for comments ignoring is be the easiest but assume they are the same " as 1. " 5. if @ complete at-rule " 6. if ! complete important if exists("b:compl_context") let line = b:compl_context let after = b:after unlet! b:compl_context else let line = a:base endif let res = [] let res2 = [] let borders = {} " Check last occurrence of sequence let openbrace = strridx(line, '{') let closebrace = strridx(line, '}') let colon = strridx(line, ':') let semicolon = strridx(line, ';') let opencomm = strridx(line, '/*') let closecomm = strridx(line, '*/') let style = strridx(line, 'style\s*=') let atrule = strridx(line, '@') let exclam = strridx(line, '!') if openbrace > -1 let borders[openbrace] = "openbrace" endif if closebrace > -1 let borders[closebrace] = "closebrace" endif if colon > -1 let borders[colon] = "colon" endif if semicolon > -1 let borders[semicolon] = "semicolon" endif if opencomm > -1 let borders[opencomm] = "opencomm" endif if closecomm > -1 let borders[closecomm] = "closecomm" endif if style > -1 let borders[style] = "style" endif if atrule > -1 let borders[atrule] = "atrule" endif if exclam > -1 let borders[exclam] = "exclam" endif if len(borders) == 0 || borders[max(keys(borders))] =~ '^\%(openbrace\|semicolon\|opencomm\|closecomm\|style\)$' " Complete properties let entered_property = matchstr(line, '.\{-}\zs[a-zA-Z-]*$') for m in s:values if m =~? '^'.entered_property call add(res, m . ':') elseif m =~? entered_property call add(res2, m . ':') endif endfor return res + res2 elseif borders[max(keys(borders))] == 'colon' " Get name of property let prop = tolower(matchstr(line, '\zs[a-zA-Z-]*\ze\s*:[^:]\{-}$')) let wide_keywords = ["initial", "inherit", "unset"] let color_values = ["transparent", "rgb(", "rgba(", "hsl(", "hsla(", "#"] let border_style_values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"] let border_width_values = ["thin", "thick", "medium"] let list_style_type_values = ["decimal", "decimal-leading-zero", "arabic-indic", "armenian", "upper-armenian", "lower-armenian", "bengali", "cambodian", "khmer", "cjk-decimal", "devanagari", "georgian", "gujarati", "gurmukhi", "hebrew", "kannada", "lao", "malayalam", "mongolian", "myanmar", "oriya", "persian", "lower-roman", "upper-roman", "tamil", "telugu", "thai", "tibetan", "lower-alpha", "lower-latin", "upper-alpha", "upper-latin", "cjk-earthly-branch", "cjk-heavenly-stem", "lower-greek", "hiragana", "hiragana-iroha", "katakana", "katakana-iroha", "disc", "circle", "square", "disclosure-open", "disclosure-closed"] let timing_functions = ["cubic-bezier(", "steps(", "linear", "ease", "ease-in", "ease-in-out", "ease-out", "step-start", "step-end"] if prop == 'all' let values = [] elseif prop == 'additive-symbols' let values = [] elseif prop == 'align-content' let values = ["flex-start", "flex-end", "center", "space-between", "space-around", "stretch"] elseif prop == 'align-items' let values = ["flex-start", "flex-end", "center", "baseline", "stretch"] elseif prop == 'align-self' let values = ["auto", "flex-start", "flex-end", "center", "baseline", "stretch"] elseif prop == 'animation' let values = timing_functions + ["normal", "reverse", "alternate", "alternate-reverse"] + ["none", "forwards", "backwards", "both"] + ["running", "paused"] elseif prop == 'animation-delay' let values = [] elseif prop == 'animation-direction' let values = ["normal", "reverse", "alternate", "alternate-reverse"] elseif prop == 'animation-duration' let values = [] elseif prop == 'animation-fill-mode' let values = ["none", "forwards", "backwards", "both"] elseif prop == 'animation-iteration-count' let values = [] elseif prop == 'animation-name' let values = [] elseif prop == 'animation-play-state' let values = ["running", "paused"] elseif prop == 'animation-timing-function' let values = timing_functions elseif prop == 'background-attachment' let values = ["scroll", "fixed"] elseif prop == 'background-color' let values = color_values elseif prop == 'background-image' let values = ["url(", "none"] elseif prop == 'background-position' let vals = matchstr(line, '.*:\s*\zs.*') if vals =~ '^\%([a-zA-Z]\+\)\?$' let values = ["top", "center", "bottom"] elseif vals =~ '^[a-zA-Z]\+\s\+\%([a-zA-Z]\+\)\?$' let values = ["left", "center", "right"] else return [] endif elseif prop == 'background-repeat' let values = ["repeat", "repeat-x", "repeat-y", "no-repeat"] elseif prop == 'background-size' let values = ["auto", "contain", "cover"] elseif prop == 'background' let values = ["scroll", "fixed"] + color_values + ["url(", "none"] + ["top", "center", "bottom", "left", "right"] + ["repeat", "repeat-x", "repeat-y", "no-repeat"] + ["auto", "contain", "cover"] elseif prop =~ 'border\%(-top\|-right\|-bottom\|-left\|-block-start\|-block-end\)\?$' let vals = matchstr(line, '.*:\s*\zs.*') if vals =~ '^\%([a-zA-Z0-9.]\+\)\?$' let values = border_width_values elseif vals =~ '^[a-zA-Z0-9.]\+\s\+\%([a-zA-Z]\+\)\?$' let values = border_style_values elseif vals =~ '^[a-zA-Z0-9.]\+\s\+[a-zA-Z]\+\s\+\%([a-zA-Z(]\+\)\?$' let values = color_values else return [] endif elseif prop =~ 'border-\%(top\|right\|bottom\|left\|block-start\|block-end\)-color' let values = color_values elseif prop =~ 'border-\%(top\|right\|bottom\|left\|block-start\|block-end\)-style' let values = border_style_values elseif prop =~ 'border-\%(top\|right\|bottom\|left\|block-start\|block-end\)-width' let values = border_width_values elseif prop == 'border-color' let values = color_values elseif prop == 'border-style' let values = border_style_values elseif prop == 'border-width' let values = border_width_values elseif prop == 'bottom' let values = ["auto"] elseif prop == 'box-decoration-break' let values = ["slice", "clone"] elseif prop == 'box-shadow' let values = ["inset"] elseif prop == 'box-sizing' let values = ["border-box", "content-box"] elseif prop =~ 'break-\%(before\|after\)' let values = ["auto", "always", "avoid", "left", "right", "page", "column", "region", "recto", "verso", "avoid-page", "avoid-column", "avoid-region"] elseif prop == 'break-inside' let values = ["auto", "avoid", "avoid-page", "avoid-column", "avoid-region"] elseif prop == 'caption-side' let values = ["top", "bottom"] elseif prop == 'clear' let values = ["none", "left", "right", "both"] elseif prop == 'clip' let values = ["auto", "rect("] elseif prop == 'clip-path' let values = ["fill-box", "stroke-box", "view-box", "none"] elseif prop == 'color' let values = color_values elseif prop == 'columns' let values = [] elseif prop == 'column-count' let values = ['auto'] elseif prop == 'column-fill' let values = ['auto', 'balance'] elseif prop == 'column-rule-color' let values = color_values elseif prop == 'column-rule-style' let values = border_style_values elseif prop == 'column-rule-width' let values = border_width_values elseif prop == 'column-rule' let vals = matchstr(line, '.*:\s*\zs.*') if vals =~ '^\%([a-zA-Z0-9.]\+\)\?$' let values = border_width_values elseif vals =~ '^[a-zA-Z0-9.]\+\s\+\%([a-zA-Z]\+\)\?$' let values = border_style_values elseif vals =~ '^[a-zA-Z0-9.]\+\s\+[a-zA-Z]\+\s\+\%([a-zA-Z(]\+\)\?$' let values = color_values else return [] endif elseif prop == 'column-span' let values = ["none", "all"] elseif prop == 'column-width' let values = ["auto"] elseif prop == 'content' let values = ["normal", "attr(", "open-quote", "close-quote", "no-open-quote", "no-close-quote"] elseif prop =~ 'counter-\%(increment\|reset\)$' let values = ["none"] elseif prop =~ 'cue\%(-after\|-before\)\=$' let values = ["url("] elseif prop == 'cursor' let values = ["url(", "auto", "crosshair", "default", "pointer", "move", "e-resize", "ne-resize", "nw-resize", "n-resize", "se-resize", "sw-resize", "s-resize", "w-resize", "text", "wait", "help", "progress"] elseif prop == 'direction' let values = ["ltr", "rtl"] elseif prop == 'display' let values = ["inline", "block", "list-item", "inline-list-item", "run-in", "inline-block", "table", "inline-table", "table-row-group", "table-header-group", "table-footer-group", "table-row", "table-column-group", "table-column", "table-cell", "table-caption", "none", "flex", "inline-flex", "grid", "inline-grid", "ruby", "ruby-base", "ruby-text", "ruby-base-container", "ruby-text-container", "contents"] elseif prop == 'elevation' let values = ["below", "level", "above", "higher", "lower"] elseif prop == 'empty-cells' let values = ["show", "hide"] elseif prop == 'fallback' let values = list_style_type_values elseif prop == 'filter' let values = ["blur(", "brightness(", "contrast(", "drop-shadow(", "grayscale(", "hue-rotate(", "invert(", "opacity(", "sepia(", "saturate("] elseif prop == 'flex-basis' let values = ["auto", "content"] elseif prop == 'flex-flow' let values = ["row", "row-reverse", "column", "column-reverse", "nowrap", "wrap", "wrap-reverse"] elseif prop == 'flex-grow' let values = [] elseif prop == 'flex-shrink' let values = [] elseif prop == 'flex-wrap' let values = ["nowrap", "wrap", "wrap-reverse"] elseif prop == 'flex' let values = ["nowrap", "wrap", "wrap-reverse"] + ["row", "row-reverse", "column", "column-reverse", "nowrap", "wrap", "wrap-reverse"] + ["auto", "content"] elseif prop == 'float' let values = ["left", "right", "none"] elseif prop == 'font-family' let values = ["sans-serif", "serif", "monospace", "cursive", "fantasy"] elseif prop == 'font-feature-settings' let values = ["normal", '"aalt"', '"abvf"', '"abvm"', '"abvs"', '"afrc"', '"akhn"', '"blwf"', '"blwm"', '"blws"', '"calt"', '"case"', '"ccmp"', '"cfar"', '"cjct"', '"clig"', '"cpct"', '"cpsp"', '"cswh"', '"curs"', '"cv', '"c2pc"', '"c2sc"', '"dist"', '"dlig"', '"dnom"', '"dtls"', '"expt"', '"falt"', '"fin2"', '"fin3"', '"fina"', '"flac"', '"frac"', '"fwid"', '"half"', '"haln"', '"halt"', '"hist"', '"hkna"', '"hlig"', '"hngl"', '"hojo"', '"hwid"', '"init"', '"isol"', '"ital"', '"jalt"', '"jp78"', '"jp83"', '"jp90"', '"jp04"', '"kern"', '"lfbd"', '"liga"', '"ljmo"', '"lnum"', '"locl"', '"ltra"', '"ltrm"', '"mark"', '"med2"', '"medi"', '"mgrk"', '"mkmk"', '"mset"', '"nalt"', '"nlck"', '"nukt"', '"numr"', '"onum"', '"opbd"', '"ordn"', '"ornm"', '"palt"', '"pcap"', '"pkna"', '"pnum"', '"pref"', '"pres"', '"pstf"', '"psts"', '"pwid"', '"qwid"', '"rand"', '"rclt"', '"rkrf"', '"rlig"', '"rphf"', '"rtbd"', '"rtla"', '"rtlm"', '"ruby"', '"salt"', '"sinf"', '"size"', '"smcp"', '"smpl"', '"ss01"', '"ss02"', '"ss03"', '"ss04"', '"ss05"', '"ss06"', '"ss07"', '"ss08"', '"ss09"', '"ss10"', '"ss11"', '"ss12"', '"ss13"', '"ss14"', '"ss15"', '"ss16"', '"ss17"', '"ss18"', '"ss19"', '"ss20"', '"ssty"', '"stch"', '"subs"', '"sups"', '"swsh"', '"titl"', '"tjmo"', '"tnam"', '"tnum"', '"trad"', '"twid"', '"unic"', '"valt"', '"vatu"', '"vert"', '"vhal"', '"vjmo"', '"vkna"', '"vkrn"', '"vpal"', '"vrt2"', '"zero"'] elseif prop == 'font-kerning' let values = ["auto", "normal", "none"] elseif prop == 'font-language-override' let values = ["normal"] elseif prop == 'font-size' let values = ["xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large", "larger", "smaller"] elseif prop == 'font-size-adjust' let values = [] elseif prop == 'font-stretch' let values = ["normal", "ultra-condensed", "extra-condensed", "condensed", "semi-condensed", "semi-expanded", "expanded", "extra-expanded", "ultra-expanded"] elseif prop == 'font-style' let values = ["normal", "italic", "oblique"] elseif prop == 'font-synthesis' let values = ["none", "weight", "style"] elseif prop == 'font-variant-alternates' let values = ["normal", "historical-forms", "stylistic(", "styleset(", "character-variant(", "swash(", "ornaments(", "annotation("] elseif prop == 'font-variant-caps' let values = ["normal", "small-caps", "all-small-caps", "petite-caps", "all-petite-caps", "unicase", "titling-caps"] elseif prop == 'font-variant-asian' let values = ["normal", "ruby", "jis78", "jis83", "jis90", "jis04", "simplified", "traditional"] elseif prop == 'font-variant-ligatures' let values = ["normal", "none", "common-ligatures", "no-common-ligatures", "discretionary-ligatures", "no-discretionary-ligatures", "historical-ligatures", "no-historical-ligatures", "contextual", "no-contextual"] elseif prop == 'font-variant-numeric' let values = ["normal", "ordinal", "slashed-zero", "lining-nums", "oldstyle-nums", "proportional-nums", "tabular-nums", "diagonal-fractions", "stacked-fractions"] elseif prop == 'font-variant-position' let values = ["normal", "sub", "super"] elseif prop == 'font-variant' let values = ["normal", "historical-forms", "stylistic(", "styleset(", "character-variant(", "swash(", "ornaments(", "annotation("] + ["small-caps", "all-small-caps", "petite-caps", "all-petite-caps", "unicase", "titling-caps"] + ["ruby", "jis78", "jis83", "jis90", "jis04", "simplified", "traditional"] + ["none", "common-ligatures", "no-common-ligatures", "discretionary-ligatures", "no-discretionary-ligatures", "historical-ligatures", "no-historical-ligatures", "contextual", "no-contextual"] + ["ordinal", "slashed-zero", "lining-nums", "oldstyle-nums", "proportional-nums", "tabular-nums", "diagonal-fractions", "stacked-fractions"] + ["sub", "super"] elseif prop == 'font-weight' let values = ["normal", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900"] elseif prop == 'font' let values = ["normal", "italic", "oblique", "small-caps", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900", "xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large", "larger", "smaller", "sans-serif", "serif", "monospace", "cursive", "fantasy", "caption", "icon", "menu", "message-box", "small-caption", "status-bar"] elseif prop =~ '^\%(height\|width\)$' let values = ["auto", "border-box", "content-box", "max-content", "min-content", "available", "fit-content"] elseif prop =~ '^\%(left\|rigth\)$' let values = ["auto"] elseif prop == 'image-rendering' let values = ["auto", "crisp-edges", "pixelated"] elseif prop == 'image-orientation' let values = ["from-image", "flip"] elseif prop == 'ime-mode' let values = ["auto", "normal", "active", "inactive", "disabled"] elseif prop == 'inline-size' let values = ["auto", "border-box", "content-box", "max-content", "min-content", "available", "fit-content"] elseif prop == 'isolation' let values = ["auto", "isolate"] elseif prop == 'justify-content' let values = ["flex-start", "flex-end", "center", "space-between", "space-around"] elseif prop == 'letter-spacing' let values = ["normal"] elseif prop == 'line-break' let values = ["auto", "loose", "normal", "strict"] elseif prop == 'line-height' let values = ["normal"] elseif prop == 'list-style-image' let values = ["url(", "none"] elseif prop == 'list-style-position' let values = ["inside", "outside"] elseif prop == 'list-style-type' let values = list_style_type_values elseif prop == 'list-style' let values = list_style_type_values + ["inside", "outside"] + ["url(", "none"] elseif prop == 'margin' let values = ["auto"] elseif prop =~ 'margin-\%(right\|left\|top\|bottom\|block-start\|block-end\|inline-start\|inline-end\)$' let values = ["auto"] elseif prop == 'marks' let values = ["crop", "cross", "none"] elseif prop == 'mask' let values = ["url("] elseif prop == 'mask-type' let values = ["luminance", "alpha"] elseif prop == '\%(max\|min\)-\%(block\|inline\)-size' let values = ["auto", "border-box", "content-box", "max-content", "min-content", "available", "fit-content"] elseif prop == '\%(max\|min\)-\%(height\|width\)' let values = ["auto", "border-box", "content-box", "max-content", "min-content", "available", "fit-content"] elseif prop == '\%(max\|min\)-zoom' let values = ["auto"] elseif prop == 'mix-blend-mode' let values = ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"] elseif prop == 'opacity' let values = [] elseif prop == 'orientation' let values = ["auto", "portrait", "landscape"] elseif prop == 'orphans' let values = [] elseif prop == 'outline-offset' let values = [] elseif prop == 'outline-color' let values = color_values elseif prop == 'outline-style' let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"] elseif prop == 'outline-width' let values = ["thin", "thick", "medium"] elseif prop == 'outline' let vals = matchstr(line, '.*:\s*\zs.*') if vals =~ '^\%([a-zA-Z0-9,()#]\+\)\?$' let values = color_values elseif vals =~ '^[a-zA-Z0-9,()#]\+\s\+\%([a-zA-Z]\+\)\?$' let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"] elseif vals =~ '^[a-zA-Z0-9,()#]\+\s\+[a-zA-Z]\+\s\+\%([a-zA-Z(]\+\)\?$' let values = ["thin", "thick", "medium"] else return [] endif elseif prop == 'overflow-wrap' let values = ["normal", "break-word"] elseif prop =~ 'overflow\%(-x\|-y\)\=' let values = ["visible", "hidden", "scroll", "auto"] elseif prop == 'pad' let values = [] elseif prop == 'padding' let values = [] elseif prop =~ 'padding-\%(top\|right\|bottom\|left\|inline-start\|inline-end\|block-start\|block-end\)$' let values = [] elseif prop =~ 'page-break-\%(after\|before\)$' let values = ["auto", "always", "avoid", "left", "right", "recto", "verso"] elseif prop == 'page-break-inside' let values = ["auto", "avoid"] elseif prop =~ 'pause\%(-after\|-before\)\=$' let values = ["none", "x-weak", "weak", "medium", "strong", "x-strong"] elseif prop == 'perspective' let values = ["none"] elseif prop == 'perspective-origin' let values = ["top", "bottom", "left", "center", " right"] elseif prop == 'pointer-events' let values = ["auto", "none", "visiblePainted", "visibleFill", "visibleStroke", "visible", "painted", "fill", "stroke", "all"] elseif prop == 'position' let values = ["static", "relative", "absolute", "fixed", "sticky"] elseif prop == 'prefix' let values = [] elseif prop == 'quotes' let values = ["none"] elseif prop == 'range' let values = ["auto", "infinite"] elseif prop == 'resize' let values = ["none", "both", "horizontal", "vertical"] elseif prop =~ 'rest\%(-after\|-before\)\=$' let values = ["none", "x-weak", "weak", "medium", "strong", "x-strong"] elseif prop == 'ruby-align' let values = ["start", "center", "space-between", "space-around"] elseif prop == 'ruby-merge' let values = ["separate", "collapse", "auto"] elseif prop == 'ruby-position' let values = ["over", "under", "inter-character"] elseif prop == 'scroll-behavior' let values = ["auto", "smooth"] elseif prop == 'scroll-snap-coordinate' let values = ["none"] elseif prop == 'scroll-snap-destination' return [] elseif prop == 'scroll-snap-points-\%(x\|y\)$' let values = ["none", "repeat("] elseif prop == 'scroll-snap-type\%(-x\|-y\)\=$' let values = ["none", "mandatory", "proximity"] elseif prop == 'shape-image-threshold' let values = [] elseif prop == 'shape-margin' let values = [] elseif prop == 'shape-outside' let values = ["margin-box", "border-box", "padding-box", "content-box", 'inset(', 'circle(', 'ellipse(', 'polygon(', 'url('] elseif prop == 'speak' let values = ["auto", "none", "normal"] elseif prop == 'speak-as' let values = ["auto", "normal", "spell-out", "digits"] elseif prop == 'src' let values = ["url("] elseif prop == 'suffix' let values = [] elseif prop == 'symbols' let values = [] elseif prop == 'system' let vals = matchstr(line, '.*:\s*\zs.*') if vals =~ '^extends' let values = list_style_type_values else let values = ["cyclic", "numeric", "alphabetic", "symbolic", "additive", "fixed", "extends"] endif elseif prop == 'table-layout' let values = ["auto", "fixed"] elseif prop == 'tab-size' let values = [] elseif prop == 'text-align' let values = ["start", "end", "left", "right", "center", "justify", "match-parent"] elseif prop == 'text-align-last' let values = ["auto", "start", "end", "left", "right", "center", "justify"] elseif prop == 'text-combine-upright' let values = ["none", "all", "digits"] elseif prop == 'text-decoration-line' let values = ["none", "underline", "overline", "line-through", "blink"] elseif prop == 'text-decoration-color' let values = color_values elseif prop == 'text-decoration-style' let values = ["solid", "double", "dotted", "dashed", "wavy"] elseif prop == 'text-decoration' let values = ["none", "underline", "overline", "line-through", "blink"] + ["solid", "double", "dotted", "dashed", "wavy"] + color_values elseif prop == 'text-emphasis-color' let values = color_values elseif prop == 'text-emphasis-position' let values = ["over", "under", "left", "right"] elseif prop == 'text-emphasis-style' let values = ["none", "filled", "open", "dot", "circle", "double-circle", "triangle", "sesame"] elseif prop == 'text-emphasis' let values = color_values + ["over", "under", "left", "right"] + ["none", "filled", "open", "dot", "circle", "double-circle", "triangle", "sesame"] elseif prop == 'text-indent' let values = ["hanging", "each-line"] elseif prop == 'text-orientation' let values = ["mixed", "upright", "sideways", "sideways-right", "use-glyph-orientation"] elseif prop == 'text-overflow' let values = ["clip", "ellipsis"] elseif prop == 'text-rendering' let values = ["auto", "optimizeSpeed", "optimizeLegibility", "geometricPrecision"] elseif prop == 'text-shadow' let values = color_values elseif prop == 'text-transform' let values = ["capitalize", "uppercase", "lowercase", "full-width", "none"] elseif prop == 'text-underline-position' let values = ["auto", "under", "left", "right"] elseif prop == 'touch-action' let values = ["auto", "none", "pan-x", "pan-y", "manipulation", "pan-left", "pan-right", "pan-top", "pan-down"] elseif prop == 'transform' let values = ["matrix(", "translate(", "translateX(", "translateY(", "scale(", "scaleX(", "scaleY(", "rotate(", "skew(", "skewX(", "skewY(", "matrix3d(", "translate3d(", "translateZ(", "scale3d(", "scaleZ(", "rotate3d(", "rotateX(", "rotateY(", "rotateZ(", "perspective("] elseif prop == 'transform-box' let values = ["border-box", "fill-box", "view-box"] elseif prop == 'transform-origin' let values = ["left", "center", "right", "top", "bottom"] elseif prop == 'transform-style' let values = ["flat", "preserve-3d"] elseif prop == 'top' let values = ["auto"] elseif prop == 'transition-property' let values = ["all", "none"] + s:values elseif prop == 'transition-duration' let values = [] elseif prop == 'transition-delay' let values = [] elseif prop == 'transition-timing-function' let values = timing_functions elseif prop == 'transition' let values = ["all", "none"] + s:values + timing_functions elseif prop == 'unicode-bidi' let values = ["normal", "embed", "isolate", "bidi-override", "isolate-override", "plaintext"] elseif prop == 'unicode-range' let values = ["U+"] elseif prop == 'user-zoom' let values = ["zoom", "fixed"] elseif prop == 'vertical-align' let values = ["baseline", "sub", "super", "top", "text-top", "middle", "bottom", "text-bottom"] elseif prop == 'visibility' let values = ["visible", "hidden", "collapse"] elseif prop == 'voice-volume' let values = ["silent", "x-soft", "soft", "medium", "loud", "x-loud"] elseif prop == 'voice-balance' let values = ["left", "center", "right", "leftwards", "rightwards"] elseif prop == 'voice-family' let values = [] elseif prop == 'voice-rate' let values = ["normal", "x-slow", "slow", "medium", "fast", "x-fast"] elseif prop == 'voice-pitch' let values = ["absolute", "x-low", "low", "medium", "high", "x-high"] elseif prop == 'voice-range' let values = ["absolute", "x-low", "low", "medium", "high", "x-high"] elseif prop == 'voice-stress' let values = ["normal", "strong", "moderate", "none", "reduced "] elseif prop == 'voice-duration' let values = ["auto"] elseif prop == 'white-space' let values = ["normal", "pre", "nowrap", "pre-wrap", "pre-line"] elseif prop == 'widows' let values = [] elseif prop == 'will-change' let values = ["auto", "scroll-position", "contents"] + s:values elseif prop == 'word-break' let values = ["normal", "break-all", "keep-all"] elseif prop == 'word-spacing' let values = ["normal"] elseif prop == 'word-wrap' let values = ["normal", "break-word"] elseif prop == 'writing-mode' let values = ["horizontal-tb", "vertical-rl", "vertical-lr", "sideways-rl", "sideways-lr"] elseif prop == 'z-index' let values = ["auto"] elseif prop == 'zoom' let values = ["auto"] else " If no property match it is possible we are outside of {} and " trying to complete pseudo-(class|element) let element = tolower(matchstr(line, '\zs[a-zA-Z1-6]*\ze:[^:[:space:]]\{-}$')) if stridx('a,abbr,address,area,article,aside,audio,b,base,bdi,bdo,bgsound,blockquote,body,br,button,canvas,caption,center,cite,code,col,colgroup,command,content,data,datalist,dd,del,details,dfn,dialog,div,dl,dt,element,em,embed,fieldset,figcaption,figure,font,footer,form,frame,frameset,head,header,hgroup,hr,html,i,iframe,image,img,input,ins,isindex,kbd,keygen,label,legend,li,link,main,map,mark,menu,menuitem,meta,meter,nav,nobr,noframes,noscript,object,ol,optgroup,option,output,p,param,picture,pre,progress,q,rp,rt,rtc,ruby,s,samp,script,section,select,shadow,small,source,span,strong,style,sub,summary,sup,table,tbody,td,template,textarea,tfoot,th,thead,time,title,tr,track,u,ul,var,video,wbr', ','.element.',') > -1 let values = ["active", "any", "checked", "default", "dir(", "disabled", "empty", "enabled", "first", "first-child", "first-of-type", "fullscreen", "focus", "hover", "indeterminate", "in-range", "invalid", "lang(", "last-child", "last-of-type", "left", "link", "not(", "nth-child(", "nth-last-child(", "nth-last-of-type(", "nth-of-type(", "only-child", "only-of-type", "optional", "out-of-range", "read-only", "read-write", "required", "right", "root", "scope", "target", "valid", "visited", "first-line", "first-letter", "before", "after", "selection", "backdrop"] else return [] endif endif let values = wide_keywords + values " Complete values let entered_value = matchstr(line, '.\{-}\zs[a-zA-Z0-9#,.(_-]*$') for m in values if m =~? '^'.entered_value call add(res, m) elseif m =~? entered_value call add(res2, m) endif endfor return res + res2 elseif borders[max(keys(borders))] == 'closebrace' return [] elseif borders[max(keys(borders))] == 'exclam' " Complete values let entered_imp = matchstr(line, '.\{-}!\s*\zs[a-zA-Z ]*$') let values = ["important"] for m in values if m =~? '^'.entered_imp call add(res, m) endif endfor return res elseif borders[max(keys(borders))] == 'atrule' let afterat = matchstr(line, '.*@\zs.*') if afterat =~ '\s' let atrulename = matchstr(line, '.*@\zs[a-zA-Z-]\+\ze') if atrulename == 'media' let entered_atruleafter = matchstr(line, '.*@media\s\+\zs.*$') if entered_atruleafter =~ "([^)]*$" let entered_atruleafter = matchstr(entered_atruleafter, '(\s*\zs[^)]*$') let values = ["max-width", "min-width", "width", "max-height", "min-height", "height", "max-aspect-ration", "min-aspect-ration", "aspect-ratio", "orientation", "max-resolution", "min-resolution", "resolution", "scan", "grid", "update-frequency", "overflow-block", "overflow-inline", "max-color", "min-color", "color", "max-color-index", "min-color-index", "color-index", "monochrome", "inverted-colors", "pointer", "hover", "any-pointer", "any-hover", "light-level", "scripting"] else let values = ["screen", "print", "speech", "all", "not", "and", "("] endif elseif atrulename == 'supports' let entered_atruleafter = matchstr(line, '.*@supports\s\+\zs.*$') if entered_atruleafter =~ "([^)]*$" let entered_atruleafter = matchstr(entered_atruleafter, '(\s*\zs.*$') let values = s:values else let values = ["("] endif elseif atrulename == 'charset' let entered_atruleafter = matchstr(line, '.*@charset\s\+\zs.*$') let values = [ \ '"UTF-8";', '"ANSI_X3.4-1968";', '"ISO_8859-1:1987";', '"ISO_8859-2:1987";', '"ISO_8859-3:1988";', '"ISO_8859-4:1988";', '"ISO_8859-5:1988";', \ '"ISO_8859-6:1987";', '"ISO_8859-7:1987";', '"ISO_8859-8:1988";', '"ISO_8859-9:1989";', '"ISO-8859-10";', '"ISO_6937-2-add";', '"JIS_X0201";', \ '"JIS_Encoding";', '"Shift_JIS";', '"Extended_UNIX_Code_Packed_Format_for_Japanese";', '"Extended_UNIX_Code_Fixed_Width_for_Japanese";', \ '"BS_4730";', '"SEN_850200_C";', '"IT";', '"ES";', '"DIN_66003";', '"NS_4551-1";', '"NF_Z_62-010";', '"ISO-10646-UTF-1";', '"ISO_646.basic:1983";', \ '"INVARIANT";', '"ISO_646.irv:1983";', '"NATS-SEFI";', '"NATS-SEFI-ADD";', '"NATS-DANO";', '"NATS-DANO-ADD";', '"SEN_850200_B";', '"KS_C_5601-1987";', \ '"ISO-2022-KR";', '"EUC-KR";', '"ISO-2022-JP";', '"ISO-2022-JP-2";', '"JIS_C6220-1969-jp";', '"JIS_C6220-1969-ro";', '"PT";', '"greek7-old";', \ '"latin-greek";', '"NF_Z_62-010_(1973)";', '"Latin-greek-1";', '"ISO_5427";', '"JIS_C6226-1978";', '"BS_viewdata";', '"INIS";', '"INIS-8";', \ '"INIS-cyrillic";', '"ISO_5427:1981";', '"ISO_5428:1980";', '"GB_1988-80";', '"GB_2312-80";', '"NS_4551-2";', '"videotex-suppl";', '"PT2";', \ '"ES2";', '"MSZ_7795.3";', '"JIS_C6226-1983";', '"greek7";', '"ASMO_449";', '"iso-ir-90";', '"JIS_C6229-1984-a";', '"JIS_C6229-1984-b";', \ '"JIS_C6229-1984-b-add";', '"JIS_C6229-1984-hand";', '"JIS_C6229-1984-hand-add";', '"JIS_C6229-1984-kana";', '"ISO_2033-1983";', \ '"ANSI_X3.110-1983";', '"T.61-7bit";', '"T.61-8bit";', '"ECMA-cyrillic";', '"CSA_Z243.4-1985-1";', '"CSA_Z243.4-1985-2";', '"CSA_Z243.4-1985-gr";', \ '"ISO_8859-6-E";', '"ISO_8859-6-I";', '"T.101-G2";', '"ISO_8859-8-E";', '"ISO_8859-8-I";', '"CSN_369103";', '"JUS_I.B1.002";', '"IEC_P27-1";', \ '"JUS_I.B1.003-serb";', '"JUS_I.B1.003-mac";', '"greek-ccitt";', '"NC_NC00-10:81";', '"ISO_6937-2-25";', '"GOST_19768-74";', '"ISO_8859-supp";', \ '"ISO_10367-box";', '"latin-lap";', '"JIS_X0212-1990";', '"DS_2089";', '"us-dk";', '"dk-us";', '"KSC5636";', '"UNICODE-1-1-UTF-7";', '"ISO-2022-CN";', \ '"ISO-2022-CN-EXT";', '"ISO-8859-13";', '"ISO-8859-14";', '"ISO-8859-15";', '"ISO-8859-16";', '"GBK";', '"GB18030";', '"OSD_EBCDIC_DF04_15";', \ '"OSD_EBCDIC_DF03_IRV";', '"OSD_EBCDIC_DF04_1";', '"ISO-11548-1";', '"KZ-1048";', '"ISO-10646-UCS-2";', '"ISO-10646-UCS-4";', '"ISO-10646-UCS-Basic";', \ '"ISO-10646-Unicode-Latin1";', '"ISO-10646-J-1";', '"ISO-Unicode-IBM-1261";', '"ISO-Unicode-IBM-1268";', '"ISO-Unicode-IBM-1276";', \ '"ISO-Unicode-IBM-1264";', '"ISO-Unicode-IBM-1265";', '"UNICODE-1-1";', '"SCSU";', '"UTF-7";', '"UTF-16BE";', '"UTF-16LE";', '"UTF-16";', '"CESU-8";', \ '"UTF-32";', '"UTF-32BE";', '"UTF-32LE";', '"BOCU-1";', '"ISO-8859-1-Windows-3.0-Latin-1";', '"ISO-8859-1-Windows-3.1-Latin-1";', \ '"ISO-8859-2-Windows-Latin-2";', '"ISO-8859-9-Windows-Latin-5";', '"hp-roman8";', '"Adobe-Standard-Encoding";', '"Ventura-US";', \ '"Ventura-International";', '"DEC-MCS";', '"IBM850";', '"PC8-Danish-Norwegian";', '"IBM862";', '"PC8-Turkish";', '"IBM-Symbols";', '"IBM-Thai";', \ '"HP-Legal";', '"HP-Pi-font";', '"HP-Math8";', '"Adobe-Symbol-Encoding";', '"HP-DeskTop";', '"Ventura-Math";', '"Microsoft-Publishing";', \ '"Windows-31J";', '"GB2312";', '"Big5";', '"macintosh";', '"IBM037";', '"IBM038";', '"IBM273";', '"IBM274";', '"IBM275";', '"IBM277";', '"IBM278";', \ '"IBM280";', '"IBM281";', '"IBM284";', '"IBM285";', '"IBM290";', '"IBM297";', '"IBM420";', '"IBM423";', '"IBM424";', '"IBM437";', '"IBM500";', '"IBM851";', \ '"IBM852";', '"IBM855";', '"IBM857";', '"IBM860";', '"IBM861";', '"IBM863";', '"IBM864";', '"IBM865";', '"IBM868";', '"IBM869";', '"IBM870";', '"IBM871";', \ '"IBM880";', '"IBM891";', '"IBM903";', '"IBM904";', '"IBM905";', '"IBM918";', '"IBM1026";', '"EBCDIC-AT-DE";', '"EBCDIC-AT-DE-A";', '"EBCDIC-CA-FR";', \ '"EBCDIC-DK-NO";', '"EBCDIC-DK-NO-A";', '"EBCDIC-FI-SE";', '"EBCDIC-FI-SE-A";', '"EBCDIC-FR";', '"EBCDIC-IT";', '"EBCDIC-PT";', '"EBCDIC-ES";', \ '"EBCDIC-ES-A";', '"EBCDIC-ES-S";', '"EBCDIC-UK";', '"EBCDIC-US";', '"UNKNOWN-8BIT";', '"MNEMONIC";', '"MNEM";', '"VISCII";', '"VIQR";', '"KOI8-R";', \ '"HZ-GB-2312";', '"IBM866";', '"IBM775";', '"KOI8-U";', '"IBM00858";', '"IBM00924";', '"IBM01140";', '"IBM01141";', '"IBM01142";', '"IBM01143";', \ '"IBM01144";', '"IBM01145";', '"IBM01146";', '"IBM01147";', '"IBM01148";', '"IBM01149";', '"Big5-HKSCS";', '"IBM1047";', '"PTCP154";', '"Amiga-1251";', \ '"KOI7-switched";', '"BRF";', '"TSCII";', '"windows-1250";', '"windows-1251";', '"windows-1252";', '"windows-1253";', '"windows-1254";', '"windows-1255";', \ '"windows-1256";', '"windows-1257";', '"windows-1258";', '"TIS-620";'] elseif atrulename == 'namespace' let entered_atruleafter = matchstr(line, '.*@namespace\s\+\zs.*$') let values = ["url("] elseif atrulename == 'document' let entered_atruleafter = matchstr(line, '.*@document\s\+\zs.*$') let values = ["url(", "url-prefix(", "domain(", "regexp("] elseif atrulename == 'import' let entered_atruleafter = matchstr(line, '.*@import\s\+\zs.*$') if entered_atruleafter =~ "^[\"']" let filestart = matchstr(entered_atruleafter, '^.\zs.*') let files = split(glob(filestart.'*'), '\n') let values = map(copy(files), '"\"".v:val') elseif entered_atruleafter =~ "^url(" let filestart = matchstr(entered_atruleafter, "^url([\"']\\?\\zs.*") let files = split(glob(filestart.'*'), '\n') let values = map(copy(files), '"url(".v:val') else let values = ['"', 'url('] endif else return [] endif for m in values if m =~? '^'.entered_atruleafter if entered_atruleafter =~? '^"' && m =~? '^"' let m = m[1:] endif if b:after =~? '"' && stridx(m, '"') > -1 let m = m[0:stridx(m, '"')-1] endif call add(res, m) elseif m =~? entered_atruleafter if m =~? '^"' let m = m[1:] endif call add(res2, m) endif endfor return res + res2 endif let values = ["charset", "page", "media", "import", "font-face", "namespace", "supports", "keyframes", "viewport", "document"] let entered_atrule = matchstr(line, '.*@\zs[a-zA-Z-]*$') for m in values if m =~? '^'.entered_atrule call add(res, m .' ') elseif m =~? entered_atrule call add(res2, m .' ') endif endfor return res + res2 endif return [] endfunction vim-7.4.1689/runtime/autoload/decada.vim000066400000000000000000000056661267703067000200230ustar00rootroot00000000000000"------------------------------------------------------------------------------ " Description: Vim Ada/Dec Ada compiler file " Language: Ada (Dec Ada) " $Id: decada.vim 887 2008-07-08 14:29:01Z krischik $ " Copyright: Copyright (C) 2006 Martin Krischik " Maintainer: Martin Krischik " $Author: krischik $ " $Date: 2008-07-08 16:29:01 +0200 (Di, 08 Jul 2008) $ " Version: 4.6 " $Revision: 887 $ " $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/decada.vim $ " History: 21.07.2006 MK New Dec Ada " 15.10.2006 MK Bram's suggestion for runtime integration " 05.11.2006 MK Bram suggested not to use include protection for " autoload " 05.11.2006 MK Bram suggested to save on spaces " Help Page: compiler-decada "------------------------------------------------------------------------------ if version < 700 finish endif function decada#Unit_Name () dict " {{{1 " Convert filename into acs unit: " 1: remove the file extenstion. " 2: replace all double '_' or '-' with an dot (which denotes a separate) " 3: remove a trailing '_' (wich denotes a specification) return substitute (substitute (expand ("%:t:r"), '__\|-', ".", "g"), '_$', "", '') endfunction decada#Unit_Name " }}}1 function decada#Make () dict " {{{1 let l:make_prg = substitute (g:self.Make_Command, '%<', self.Unit_Name(), '') let &errorformat = g:self.Error_Format let &makeprg = l:make_prg wall make copen set wrap wincmd W endfunction decada#Build " }}}1 function decada#Set_Session (...) dict " {{{1 if a:0 > 0 call ada#Switch_Session (a:1) elseif argc() == 0 && strlen (v:servername) > 0 call ada#Switch_Session ( \ expand('~')[0:-2] . ".vimfiles.session]decada_" . \ v:servername . ".vim") endif return endfunction decada#Set_Session " }}}1 function decada#New () " }}}1 let Retval = { \ 'Make' : function ('decada#Make'), \ 'Unit_Name' : function ('decada#Unit_Name'), \ 'Set_Session' : function ('decada#Set_Session'), \ 'Project_Dir' : '', \ 'Make_Command' : 'ACS COMPILE /Wait /Log /NoPreLoad /Optimize=Development /Debug %<', \ 'Error_Format' : '%+A%%ADAC-%t-%m,%C %#%m,%Zat line number %l in file %f,' . \ '%+I%%ada-I-%m,%C %#%m,%Zat line number %l in file %f'} return Retval endfunction decada#New " }}}1 finish " 1}}} "------------------------------------------------------------------------------ " Copyright (C) 2006 Martin Krischik " " Vim is Charityware - see ":help license" or uganda.txt for licence details. "------------------------------------------------------------------------------ " vim: textwidth=78 wrap tabstop=8 shiftwidth=3 softtabstop=3 noexpandtab " vim: foldmethod=marker vim-7.4.1689/runtime/autoload/getscript.vim000066400000000000000000000604401267703067000206150ustar00rootroot00000000000000" --------------------------------------------------------------------- " getscript.vim " Author: Charles E. Campbell " Date: Jan 21, 2014 " Version: 36 " Installing: :help glvs-install " Usage: :help glvs " " GetLatestVimScripts: 642 1 :AutoInstall: getscript.vim "redraw!|call inputsave()|call input("Press to continue")|call inputrestore() " --------------------------------------------------------------------- " Initialization: {{{1 " if you're sourcing this file, surely you can't be " expecting vim to be in its vi-compatible mode! if exists("g:loaded_getscript") finish endif let g:loaded_getscript= "v36" if &cp echoerr "GetLatestVimScripts is not vi-compatible; not loaded (you need to set nocp)" finish endif if v:version < 702 echohl WarningMsg echo "***warning*** this version of getscript needs vim 7.2" echohl Normal finish endif let s:keepcpo = &cpo set cpo&vim "DechoTabOn " --------------------------- " Global Variables: {{{1 " --------------------------- " Cygwin Detection ------- {{{2 if !exists("g:getscript_cygwin") if has("win32") || has("win95") || has("win64") || has("win16") if &shell =~ '\%(\\|\\)\%(\.exe\)\=$' let g:getscript_cygwin= 1 else let g:getscript_cygwin= 0 endif else let g:getscript_cygwin= 0 endif endif " wget vs curl {{{2 if !exists("g:GetLatestVimScripts_wget") if executable("wget") let g:GetLatestVimScripts_wget= "wget" elseif executable("curl") let g:GetLatestVimScripts_wget= "curl" else let g:GetLatestVimScripts_wget = 'echo "GetLatestVimScripts needs wget or curl"' let g:GetLatestVimScripts_options = "" endif endif " options that wget and curl require: if !exists("g:GetLatestVimScripts_options") if g:GetLatestVimScripts_wget == "wget" let g:GetLatestVimScripts_options= "-q -O" elseif g:GetLatestVimScripts_wget == "curl" let g:GetLatestVimScripts_options= "-s -O" else let g:GetLatestVimScripts_options= "" endif endif " by default, allow autoinstall lines to work if !exists("g:GetLatestVimScripts_allowautoinstall") let g:GetLatestVimScripts_allowautoinstall= 1 endif " set up default scriptaddr address if !exists("g:GetLatestVimScripts_scriptaddr") let g:GetLatestVimScripts_scriptaddr = 'http://vim.sourceforge.net/script.php?script_id=' endif "" For debugging: "let g:GetLatestVimScripts_wget = "echo" "let g:GetLatestVimScripts_options = "options" " --------------------------------------------------------------------- " Check If AutoInstall Capable: {{{1 let s:autoinstall= "" if g:GetLatestVimScripts_allowautoinstall if (has("win32") || has("gui_win32") || has("gui_win32s") || has("win16") || has("win64") || has("win32unix") || has("win95")) && &shell != "bash" " windows (but not cygwin/bash) let s:dotvim= "vimfiles" if !exists("g:GetLatestVimScripts_mv") let g:GetLatestVimScripts_mv= "ren" endif else " unix let s:dotvim= ".vim" if !exists("g:GetLatestVimScripts_mv") let g:GetLatestVimScripts_mv= "mv" endif endif if exists("g:GetLatestVimScripts_autoinstalldir") && isdirectory(g:GetLatestVimScripts_autoinstalldir) let s:autoinstall= g:GetLatestVimScripts_autoinstalldir" elseif exists('$HOME') && isdirectory(expand("$HOME")."/".s:dotvim) let s:autoinstall= $HOME."/".s:dotvim endif " call Decho("s:autoinstall<".s:autoinstall.">") "else "Decho " call Decho("g:GetLatestVimScripts_allowautoinstall=".g:GetLatestVimScripts_allowautoinstall.": :AutoInstall: disabled") endif " --------------------------------------------------------------------- " Public Interface: {{{1 com! -nargs=0 GetLatestVimScripts call getscript#GetLatestVimScripts() com! -nargs=0 GetScript call getscript#GetLatestVimScripts() silent! com -nargs=0 GLVS call getscript#GetLatestVimScripts() " --------------------------------------------------------------------- " GetLatestVimScripts: this function gets the latest versions of {{{1 " scripts based on the list in " (first dir in runtimepath)/GetLatest/GetLatestVimScripts.dat fun! getscript#GetLatestVimScripts() " call Dfunc("GetLatestVimScripts() autoinstall<".s:autoinstall.">") " insure that wget is executable if executable(g:GetLatestVimScripts_wget) != 1 echoerr "GetLatestVimScripts needs ".g:GetLatestVimScripts_wget." which apparently is not available on your system" " call Dret("GetLatestVimScripts : wget not executable/availble") return endif " insure that fnameescape() is available if !exists("*fnameescape") echoerr "GetLatestVimScripts needs fnameescape() (provided by 7.1.299 or later)" return endif " Find the .../GetLatest subdirectory under the runtimepath for datadir in split(&rtp,',') + [''] if isdirectory(datadir."/GetLatest") " call Decho("found directory<".datadir.">") let datadir= datadir . "/GetLatest" break endif if filereadable(datadir."GetLatestVimScripts.dat") " call Decho("found ".datadir."/GetLatestVimScripts.dat") break endif endfor " Sanity checks: readability and writability if datadir == "" echoerr 'Missing "GetLatest/" on your runtimepath - see :help glvs-dist-install' " call Dret("GetLatestVimScripts : unable to find a GetLatest subdirectory") return endif if filewritable(datadir) != 2 echoerr "(getLatestVimScripts) Your ".datadir." isn't writable" " call Dret("GetLatestVimScripts : non-writable directory<".datadir.">") return endif let datafile= datadir."/GetLatestVimScripts.dat" if !filereadable(datafile) echoerr "Your data file<".datafile."> isn't readable" " call Dret("GetLatestVimScripts : non-readable datafile<".datafile.">") return endif if !filewritable(datafile) echoerr "Your data file<".datafile."> isn't writable" " call Dret("GetLatestVimScripts : non-writable datafile<".datafile.">") return endif " -------------------- " Passed sanity checks " -------------------- " call Decho("datadir <".datadir.">") " call Decho("datafile <".datafile.">") " don't let any event handlers interfere (like winmanager's, taglist's, etc) let eikeep = &ei let hlskeep = &hls let acdkeep = &acd set ei=all hls&vim noacd " Edit the datafile (ie. GetLatestVimScripts.dat): " 1. record current directory (origdir), " 2. change directory to datadir, " 3. split window " 4. edit datafile let origdir= getcwd() " call Decho("exe cd ".fnameescape(substitute(datadir,'\','/','ge'))) exe "cd ".fnameescape(substitute(datadir,'\','/','ge')) split " call Decho("exe e ".fnameescape(substitute(datafile,'\','/','ge'))) exe "e ".fnameescape(substitute(datafile,'\','/','ge')) res 1000 let s:downloads = 0 let s:downerrors= 0 " Check on dependencies mentioned in plugins " call Decho(" ") " call Decho("searching plugins for GetLatestVimScripts dependencies") let lastline = line("$") " call Decho("lastline#".lastline) let firstdir = substitute(&rtp,',.*$','','') let plugins = split(globpath(firstdir,"plugin/**/*.vim"),'\n') let plugins = plugins + split(globpath(firstdir,"AsNeeded/**/*.vim"),'\n') let foundscript = 0 " this loop updates the GetLatestVimScripts.dat file " with dependencies explicitly mentioned in the plugins " via GetLatestVimScripts: ... lines " It reads the plugin script at the end of the GetLatestVimScripts.dat " file, examines it, and then removes it. for plugin in plugins " call Decho(" ") " call Decho("plugin<".plugin.">") " read plugin in " evidently a :r creates a new buffer (the "#" buffer) that is subsequently unused -- bwiping it $ " call Decho(".dependency checking<".plugin."> line$=".line("$")) " call Decho("..exe silent r ".fnameescape(plugin)) exe "silent r ".fnameescape(plugin) exe "silent bwipe ".bufnr("#") while search('^"\s\+GetLatestVimScripts:\s\+\d\+\s\+\d\+','W') != 0 let depscript = substitute(getline("."),'^"\s\+GetLatestVimScripts:\s\+\d\+\s\+\d\+\s\+\(.*\)$','\1','e') let depscriptid = substitute(getline("."),'^"\s\+GetLatestVimScripts:\s\+\(\d\+\)\s\+.*$','\1','') let llp1 = lastline+1 " call Decho("..depscript<".depscript.">") " found a "GetLatestVimScripts: # #" line in the script; " check if its already in the datafile by searching backwards from llp1, " the (prior to reading in the plugin script) last line plus one of the GetLatestVimScripts.dat file, " for the script-id with no wrapping allowed. let curline = line(".") let noai_script = substitute(depscript,'\s*:AutoInstall:\s*','','e') exe llp1 let srchline = search('^\s*'.depscriptid.'\s\+\d\+\s\+.*$','bW') if srchline == 0 " this second search is taken when, for example, a 0 0 scriptname is to be skipped over let srchline= search('\<'.noai_script.'\>','bW') endif " call Decho("..noai_script<".noai_script."> depscriptid#".depscriptid." srchline#".srchline." curline#".line(".")." lastline#".lastline) if srchline == 0 " found a new script to permanently include in the datafile let keep_rega = @a let @a = substitute(getline(curline),'^"\s\+GetLatestVimScripts:\s\+','','') echomsg "Appending <".@a."> to ".datafile." for ".depscript " call Decho("..Appending <".@a."> to ".datafile." for ".depscript) exe lastline."put a" let @a = keep_rega let lastline = llp1 let curline = curline + 1 let foundscript = foundscript + 1 " else " Decho " call Decho("..found <".noai_script."> (already in datafile at line#".srchline.")") endif let curline = curline + 1 exe curline endwhile " llp1: last line plus one let llp1= lastline + 1 " call Decho(".deleting lines: ".llp1.",$d") exe "silent! ".llp1.",$d" endfor " call Decho("--- end dependency checking loop --- foundscript=".foundscript) " call Decho(" ") " call Dredir("BUFFER TEST (GetLatestVimScripts 1)","ls!") if foundscript == 0 setlocal nomod endif " -------------------------------------------------------------------- " Check on out-of-date scripts using GetLatest/GetLatestVimScripts.dat " -------------------------------------------------------------------- " call Decho("begin: checking out-of-date scripts using datafile<".datafile.">") setlocal lz 1 " /^-----/,$g/^\s*\d/call Decho(getline(".")) 1 /^-----/,$g/^\s*\d/call s:GetOneScript() " call Decho("--- end out-of-date checking --- ") " Final report (an echomsg) try silent! ?^-------? catch /^Vim\%((\a\+)\)\=:E114/ " call Dret("GetLatestVimScripts : nothing done!") return endtry exe "norm! kz\" redraw! let s:msg = "" if s:downloads == 1 let s:msg = "Downloaded one updated script to <".datadir.">" elseif s:downloads == 2 let s:msg= "Downloaded two updated scripts to <".datadir.">" elseif s:downloads > 1 let s:msg= "Downloaded ".s:downloads." updated scripts to <".datadir.">" else let s:msg= "Everything was already current" endif if s:downerrors > 0 let s:msg= s:msg." (".s:downerrors." downloading errors)" endif echomsg s:msg " save the file if &mod silent! w! endif q! " restore events and current directory exe "cd ".fnameescape(substitute(origdir,'\','/','ge')) let &ei = eikeep let &hls = hlskeep let &acd = acdkeep setlocal nolz " call Dredir("BUFFER TEST (GetLatestVimScripts 2)","ls!") " call Dret("GetLatestVimScripts : did ".s:downloads." downloads") endfun " --------------------------------------------------------------------- " GetOneScript: (Get Latest Vim Script) this function operates {{{1 " on the current line, interpreting two numbers and text as " ScriptID, SourceID, and Filename. " It downloads any scripts that have newer versions from vim.sourceforge.net. fun! s:GetOneScript(...) " call Dfunc("GetOneScript()") " set options to allow progress to be shown on screen let rega= @a let t_ti= &t_ti let t_te= &t_te let rs = &rs set t_ti= t_te= nors " put current line on top-of-screen and interpret it into " a script identifer : used to obtain webpage " source identifier : used to identify current version " and an associated comment: used to report on what's being considered if a:0 >= 3 let scriptid = a:1 let srcid = a:2 let fname = a:3 let cmmnt = "" " call Decho("scriptid<".scriptid.">") " call Decho("srcid <".srcid.">") " call Decho("fname <".fname.">") else let curline = getline(".") if curline =~ '^\s*#' let @a= rega " call Dret("GetOneScript : skipping a pure comment line") return endif let parsepat = '^\s*\(\d\+\)\s\+\(\d\+\)\s\+\(.\{-}\)\(\s*#.*\)\=$' try let scriptid = substitute(curline,parsepat,'\1','e') catch /^Vim\%((\a\+)\)\=:E486/ let scriptid= 0 endtry try let srcid = substitute(curline,parsepat,'\2','e') catch /^Vim\%((\a\+)\)\=:E486/ let srcid= 0 endtry try let fname= substitute(curline,parsepat,'\3','e') catch /^Vim\%((\a\+)\)\=:E486/ let fname= "" endtry try let cmmnt= substitute(curline,parsepat,'\4','e') catch /^Vim\%((\a\+)\)\=:E486/ let cmmnt= "" endtry " call Decho("curline <".curline.">") " call Decho("parsepat<".parsepat.">") " call Decho("scriptid<".scriptid.">") " call Decho("srcid <".srcid.">") " call Decho("fname <".fname.">") endif " plugin author protection from downloading his/her own scripts atop their latest work if scriptid == 0 || srcid == 0 " When looking for :AutoInstall: lines, skip scripts that have 0 0 scriptname let @a= rega " call Dret("GetOneScript : skipping a scriptid==srcid==0 line") return endif let doautoinstall= 0 if fname =~ ":AutoInstall:" " call Decho("case AutoInstall: fname<".fname.">") let aicmmnt= substitute(fname,'\s\+:AutoInstall:\s\+',' ','') " call Decho("aicmmnt<".aicmmnt."> s:autoinstall=".s:autoinstall) if s:autoinstall != "" let doautoinstall = g:GetLatestVimScripts_allowautoinstall endif else let aicmmnt= fname endif " call Decho("aicmmnt<".aicmmnt.">: doautoinstall=".doautoinstall) exe "norm z\" redraw! " call Decho('considering <'.aicmmnt.'> scriptid='.scriptid.' srcid='.srcid) echo 'considering <'.aicmmnt.'> scriptid='.scriptid.' srcid='.srcid " grab a copy of the plugin's vim.sourceforge.net webpage let scriptaddr = g:GetLatestVimScripts_scriptaddr.scriptid let tmpfile = tempname() let v:errmsg = "" " make up to three tries at downloading the description let itry= 1 while itry <= 3 " call Decho(".try#".itry." to download description of <".aicmmnt."> with addr=".scriptaddr) if has("win32") || has("win16") || has("win95") " call Decho(".new|exe silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile).' '.shellescape(scriptaddr)."|bw!") new|exe "silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile).' '.shellescape(scriptaddr)|bw! else " call Decho(".exe silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile)." ".shellescape(scriptaddr)) exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile)." ".shellescape(scriptaddr) endif if itry == 1 exe "silent vsplit ".fnameescape(tmpfile) else silent! e % endif setlocal bh=wipe " find the latest source-id in the plugin's webpage silent! 1 let findpkg= search('Click on the package to download','W') if findpkg > 0 break endif let itry= itry + 1 endwhile " call Decho(" --- end downloading tries while loop --- itry=".itry) " testing: did finding "Click on the package..." fail? if findpkg == 0 || itry >= 4 silent q! call delete(tmpfile) " restore options let &t_ti = t_ti let &t_te = t_te let &rs = rs let s:downerrors = s:downerrors + 1 " call Decho("***warning*** couldn'".'t find "Click on the package..." in description page for <'.aicmmnt.">") echomsg "***warning*** couldn'".'t find "Click on the package..." in description page for <'.aicmmnt.">" " call Dret("GetOneScript : srch for /Click on the package/ failed") let @a= rega return endif " call Decho('found "Click on the package to download"') let findsrcid= search('src_id=','W') if findsrcid == 0 silent q! call delete(tmpfile) " restore options let &t_ti = t_ti let &t_te = t_te let &rs = rs let s:downerrors = s:downerrors + 1 " call Decho("***warning*** couldn'".'t find "src_id=" in description page for <'.aicmmnt.">") echomsg "***warning*** couldn'".'t find "src_id=" in description page for <'.aicmmnt.">" let @a= rega " call Dret("GetOneScript : srch for /src_id/ failed") return endif " call Decho('found "src_id=" in description page') let srcidpat = '^\s*\([^<]\+\)<.*$' let latestsrcid= substitute(getline("."),srcidpat,'\1','') let sname = substitute(getline("."),srcidpat,'\2','') " script name actually downloaded " call Decho("srcidpat<".srcidpat."> latestsrcid<".latestsrcid."> sname<".sname.">") silent q! call delete(tmpfile) " convert the strings-of-numbers into numbers let srcid = srcid + 0 let latestsrcid = latestsrcid + 0 " call Decho("srcid=".srcid." latestsrcid=".latestsrcid." sname<".sname.">") " has the plugin's most-recent srcid increased, which indicates that it has been updated if latestsrcid > srcid " call Decho("[latestsrcid=".latestsrcid."] <= [srcid=".srcid."]: need to update <".sname.">") let s:downloads= s:downloads + 1 if sname == bufname("%") " GetLatestVimScript has to be careful about downloading itself let sname= "NEW_".sname endif " ----------------------------------------------------------------------------- " the plugin has been updated since we last obtained it, so download a new copy " ----------------------------------------------------------------------------- " call Decho(".downloading new <".sname.">") echomsg ".downloading new <".sname.">" if has("win32") || has("win16") || has("win95") " call Decho(".new|exe silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape('http://vim.sourceforge.net/scripts/download_script.php?src_id='.latestsrcid)."|q") new|exe "silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape('http://vim.sourceforge.net/scripts/download_script.php?src_id='.latestsrcid)|q else " call Decho(".exe silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape('http://vim.sourceforge.net/scripts/download_script.php?src_id=')) exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape('http://vim.sourceforge.net/scripts/download_script.php?src_id=').latestsrcid endif " -------------------------------------------------------------------------- " AutoInstall: only if doautoinstall has been requested by the plugin itself " -------------------------------------------------------------------------- " call Decho("checking if plugin requested autoinstall: doautoinstall=".doautoinstall) if doautoinstall " call Decho(" ") " call Decho("Autoinstall: getcwd<".getcwd()."> filereadable(".sname.")=".filereadable(sname)) if filereadable(sname) " call Decho("<".sname."> is readable") " call Decho("exe silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".shellescape(s:autoinstall)) exe "silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".shellescape(s:autoinstall) let curdir = fnameescape(substitute(getcwd(),'\','/','ge')) let installdir= curdir."/Installed" if !isdirectory(installdir) call mkdir(installdir) endif " call Decho("curdir<".curdir."> installdir<".installdir.">") " call Decho("exe cd ".fnameescape(s:autoinstall)) exe "cd ".fnameescape(s:autoinstall) " determine target directory for moves let firstdir= substitute(&rtp,',.*$','','') let pname = substitute(sname,'\..*','.vim','') " call Decho("determine tgtdir: is <".firstdir.'/AsNeeded/'.pname." readable?") if filereadable(firstdir.'/AsNeeded/'.pname) let tgtdir= "AsNeeded" else let tgtdir= "plugin" endif " call Decho("tgtdir<".tgtdir."> pname<".pname.">") " decompress if sname =~ '\.bz2$' " call Decho("decompress: attempt to bunzip2 ".sname) exe "sil !bunzip2 ".shellescape(sname) let sname= substitute(sname,'\.bz2$','','') " call Decho("decompress: new sname<".sname."> after bunzip2") elseif sname =~ '\.gz$' " call Decho("decompress: attempt to gunzip ".sname) exe "sil !gunzip ".shellescape(sname) let sname= substitute(sname,'\.gz$','','') " call Decho("decompress: new sname<".sname."> after gunzip") elseif sname =~ '\.xz$' " call Decho("decompress: attempt to unxz ".sname) exe "sil !unxz ".shellescape(sname) let sname= substitute(sname,'\.xz$','','') " call Decho("decompress: new sname<".sname."> after unxz") else " call Decho("no decompression needed") endif " distribute archive(.zip, .tar, .vba, ...) contents if sname =~ '\.zip$' " call Decho("dearchive: attempt to unzip ".sname) exe "silent !unzip -o ".shellescape(sname) elseif sname =~ '\.tar$' " call Decho("dearchive: attempt to untar ".sname) exe "silent !tar -xvf ".shellescape(sname) elseif sname =~ '\.tgz$' " call Decho("dearchive: attempt to untar+gunzip ".sname) exe "silent !tar -zxvf ".shellescape(sname) elseif sname =~ '\.taz$' " call Decho("dearchive: attempt to untar+uncompress ".sname) exe "silent !tar -Zxvf ".shellescape(sname) elseif sname =~ '\.tbz$' " call Decho("dearchive: attempt to untar+bunzip2 ".sname) exe "silent !tar -jxvf ".shellescape(sname) elseif sname =~ '\.txz$' " call Decho("dearchive: attempt to untar+xz ".sname) exe "silent !tar -Jxvf ".shellescape(sname) elseif sname =~ '\.vba$' " call Decho("dearchive: attempt to handle a vimball: ".sname) silent 1split if exists("g:vimball_home") let oldvimballhome= g:vimball_home endif let g:vimball_home= s:autoinstall exe "silent e ".fnameescape(sname) silent so % silent q if exists("oldvimballhome") let g:vimball_home= oldvimballhome else unlet g:vimball_home endif else " call Decho("no dearchiving needed") endif " --------------------------------------------- " move plugin to plugin/ or AsNeeded/ directory " --------------------------------------------- if sname =~ '.vim$' " call Decho("dearchive: attempt to simply move ".sname." to ".tgtdir) exe "silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".tgtdir else " call Decho("dearchive: move <".sname."> to installdir<".installdir.">") exe "silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".installdir endif if tgtdir != "plugin" " call Decho("exe silent !".g:GetLatestVimScripts_mv." plugin/".shellescape(pname)." ".tgtdir) exe "silent !".g:GetLatestVimScripts_mv." plugin/".shellescape(pname)." ".tgtdir endif " helptags step let docdir= substitute(&rtp,',.*','','e')."/doc" " call Decho("helptags: docdir<".docdir.">") exe "helptags ".fnameescape(docdir) exe "cd ".fnameescape(curdir) endif if fname !~ ':AutoInstall:' let modline=scriptid." ".latestsrcid." :AutoInstall: ".fname.cmmnt else let modline=scriptid." ".latestsrcid." ".fname.cmmnt endif else let modline=scriptid." ".latestsrcid." ".fname.cmmnt endif " update the data in the file call setline(line("."),modline) " call Decho("update data in ".expand("%")."#".line(".").": modline<".modline.">") " else " Decho " call Decho("[latestsrcid=".latestsrcid."] <= [srcid=".srcid."], no need to update") endif " restore options let &t_ti = t_ti let &t_te = t_te let &rs = rs let @a = rega " call Dredir("BUFFER TEST (GetOneScript)","ls!") " call Dret("GetOneScript") endfun " --------------------------------------------------------------------- " Restore Options: {{{1 let &cpo= s:keepcpo unlet s:keepcpo " --------------------------------------------------------------------- " Modelines: {{{1 " vim: ts=8 sts=2 fdm=marker nowrap vim-7.4.1689/runtime/autoload/gnat.vim000066400000000000000000000123231267703067000175370ustar00rootroot00000000000000"------------------------------------------------------------------------------ " Description: Vim Ada/GNAT compiler file " Language: Ada (GNAT) " $Id: gnat.vim 887 2008-07-08 14:29:01Z krischik $ " Copyright: Copyright (C) 2006 Martin Krischik " Maintainer: Martin Krischi k " Ned Okie " $Author: krischik $ " $Date: 2008-07-08 16:29:01 +0200 (Di, 08 Jul 2008) $ " Version: 4.6 " $Revision: 887 $ " $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/gnat.vim $ " History: 24.05.2006 MK Unified Headers " 16.07.2006 MK Ada-Mode as vim-ball " 05.08.2006 MK Add session support " 15.10.2006 MK Bram's suggestion for runtime integration " 05.11.2006 MK Bram suggested not to use include protection for " autoload " 05.11.2006 MK Bram suggested to save on spaces " 19.09.2007 NO use project file only when there is a project " Help Page: compiler-gnat "------------------------------------------------------------------------------ if version < 700 finish endif function gnat#Make () dict " {{{1 let &l:makeprg = self.Get_Command('Make') let &l:errorformat = self.Error_Format wall make copen set wrap wincmd W endfunction gnat#Make " }}}1 function gnat#Pretty () dict " {{{1 execute "!" . self.Get_Command('Pretty') endfunction gnat#Make " }}}1 function gnat#Find () dict " {{{1 execute "!" . self.Get_Command('Find') endfunction gnat#Find " }}}1 function gnat#Tags () dict " {{{1 execute "!" . self.Get_Command('Tags') edit tags call gnat#Insert_Tags_Header () update quit endfunction gnat#Tags " }}}1 function gnat#Set_Project_File (...) dict " {{{1 if a:0 > 0 let self.Project_File = a:1 if ! filereadable (self.Project_File) let self.Project_File = findfile ( \ fnamemodify (self.Project_File, ':r'), \ $ADA_PROJECT_PATH, \ 1) endif elseif strlen (self.Project_File) > 0 let self.Project_File = browse (0, 'GNAT Project File?', '', self.Project_File) elseif expand ("%:e") == 'gpr' let self.Project_File = browse (0, 'GNAT Project File?', '', expand ("%:e")) else let self.Project_File = browse (0, 'GNAT Project File?', '', 'default.gpr') endif if strlen (v:this_session) > 0 execute 'mksession! ' . v:this_session endif "if strlen (self.Project_File) > 0 "if has("vms") "call ada#Switch_Session ( "\ expand('~')[0:-2] . ".vimfiles.session]gnat_" . "\ fnamemodify (self.Project_File, ":t:r") . ".vim") "else "call ada#Switch_Session ( "\ expand('~') . "/vimfiles/session/gnat_" . "\ fnamemodify (self.Project_File, ":t:r") . ".vim") "endif "else "call ada#Switch_Session ('') "endif return endfunction gnat#Set_Project_File " }}}1 function gnat#Get_Command (Command) dict " {{{1 let l:Command = eval ('self.' . a:Command . '_Command') return eval (l:Command) endfunction gnat#Get_Command " }}}1 function gnat#Set_Session (...) dict " {{{1 if argc() == 1 && fnamemodify (argv(0), ':e') == 'gpr' call self.Set_Project_File (argv(0)) elseif strlen (v:servername) > 0 call self.Set_Project_File (v:servername . '.gpr') endif endfunction gnat#Set_Session " }}}1 function gnat#New () " {{{1 let l:Retval = { \ 'Make' : function ('gnat#Make'), \ 'Pretty' : function ('gnat#Pretty'), \ 'Find' : function ('gnat#Find'), \ 'Tags' : function ('gnat#Tags'), \ 'Set_Project_File' : function ('gnat#Set_Project_File'), \ 'Set_Session' : function ('gnat#Set_Session'), \ 'Get_Command' : function ('gnat#Get_Command'), \ 'Project_File' : '', \ 'Make_Command' : '"gnat make -P " . self.Project_File . " -F -gnatef "', \ 'Pretty_Command' : '"gnat pretty -P " . self.Project_File . " "', \ 'Find_Program' : '"gnat find -P " . self.Project_File . " -F "', \ 'Tags_Command' : '"gnat xref -P " . self.Project_File . " -v *.AD*"', \ 'Error_Format' : '%f:%l:%c: %trror: %m,' . \ '%f:%l:%c: %tarning: %m,' . \ '%f:%l:%c: (%ttyle) %m'} return l:Retval endfunction gnat#New " }}}1 function gnat#Insert_Tags_Header () " {{{1 1insert !_TAG_FILE_FORMAT 1 /extended format; --format=1 will not append ;" to lines/ !_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ !_TAG_PROGRAM_AUTHOR AdaCore /info@adacore.com/ !_TAG_PROGRAM_NAME gnatxref // !_TAG_PROGRAM_URL http://www.adacore.com /official site/ !_TAG_PROGRAM_VERSION 5.05w // . return endfunction gnat#Insert_Tags_Header " }}}1 finish " 1}}} "------------------------------------------------------------------------------ " Copyright (C) 2006 Martin Krischik " " Vim is Charityware - see ":help license" or uganda.txt for licence details. "------------------------------------------------------------------------------ " vim: textwidth=0 wrap tabstop=8 shiftwidth=3 softtabstop=3 noexpandtab " vim: foldmethod=marker vim-7.4.1689/runtime/autoload/gzip.vim000066400000000000000000000142751267703067000175670ustar00rootroot00000000000000" Vim autoload file for editing compressed files. " Maintainer: Bram Moolenaar " Last Change: 2014 Nov 05 " These functions are used by the gzip plugin. " 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 " Set b:gzip_comp_arg to the gzip argument to be used for compression, based on " the flags in the compressed file. " The only compression methods that can be detected are max speed (-1) and max " compression (-9). fun s:set_compression(line) " get the Compression Method let l:cm = char2nr(a:line[2]) " if it's 8 (DEFLATE), we can check for the compression level if l:cm == 8 " get the eXtra FLags let l:xfl = char2nr(a:line[8]) " max compression if l:xfl == 2 let b:gzip_comp_arg = "-9" " min compression elseif l:xfl == 4 let b:gzip_comp_arg = "-1" endif endif endfun " After reading compressed file: Uncompress text in buffer with "cmd" fun gzip#read(cmd) " don't do anything if the cmd is not supported if !s:check(a:cmd) return endif " for gzip check current compression level and set b:gzip_comp_arg. silent! unlet b:gzip_comp_arg if a:cmd[0] == 'g' call s:set_compression(getline(1)) 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 " Reset 'foldenable', otherwise line numbers get adjusted. if has("folding") let fen_save = &fen setlocal nofen endif " when filtering the whole buffer, it will become empty let empty = line("'[") == 1 && line("']") == line("$") let tmp = tempname() let tmpe = tmp . "." . expand(":e") if exists('*fnameescape') let tmp_esc = fnameescape(tmp) let tmpe_esc = fnameescape(tmpe) else let tmp_esc = escape(tmp, ' ') let tmpe_esc = escape(tmpe, ' ') endif " write the just read lines to a temp file "'[,']w tmp.gz" execute "silent '[,']w " . tmpe_esc " uncompress the temp file: call system("gzip -dn tmp.gz") call system(a:cmd . " " . s:escape(tmpe)) if !filereadable(tmp) " uncompress didn't work! Keep the compressed file then. echoerr "Error: Could not read uncompressed file" let ok = 0 else let ok = 1 " 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" " Use ++edit if the buffer was empty, keep the 'ff' and 'fenc' options. setlocal nobin if exists(":lockmarks") if empty execute "silent lockmarks " . l . "r ++edit " . tmp_esc else execute "silent lockmarks " . l . "r " . tmp_esc endif else execute "silent " . l . "r " . tmp_esc 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_esc silent! exe "bwipe " . tmpe_esc endif " Store the OK flag, so that we can use it when writing. let b:uncompressOk = ok " Restore saved option values. let &pm = pm_save let &cpo = cpo_save let &l:ma = ma_save if has("folding") let &l:fen = fen_save endif " When uncompressed the whole buffer, do autocommands if ok && empty if exists('*fnameescape') let fname = fnameescape(expand("%:r")) else let fname = escape(expand("%:r"), " \t\n*?[{`$\\%#'\"|!<") endif if &verbose >= 8 execute "doau BufReadPost " . fname else execute "silent! doau BufReadPost " . fname endif endif endfun " After writing compressed file: Compress written file with "cmd" fun gzip#write(cmd) if exists('b:uncompressOk') && !b:uncompressOk echomsg "Not compressing file because uncompress failed; reset b:uncompressOk to compress anyway" " don't do anything if the cmd is not supported elseif s:check(a:cmd) " Rename the file before compressing it. let nm = resolve(expand("")) let nmt = s:tempname(nm) if rename(nm, nmt) == 0 if exists("b:gzip_comp_arg") call system(a:cmd . " " . b:gzip_comp_arg . " -- " . s:escape(nmt)) else call system(a:cmd . " -- " . s:escape(nmt)) endif call rename(nmt . "." . expand(":e"), nm) endif endif endfun " Before appending to compressed file: Uncompress file with "cmd" fun gzip#appre(cmd) " don't do anything if the cmd is not supported if s:check(a:cmd) let nm = expand("") " for gzip check current compression level and set b:gzip_comp_arg. silent! unlet b:gzip_comp_arg if a:cmd[0] == 'g' call s:set_compression(readfile(nm, "b", 1)[0]) endif " Rename to a weird name to avoid the risk of overwriting another file let nmt = expand(":p:h") . "/X~=@l9q5" let nmte = nmt . "." . expand(":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 -- " . s:escape(nmte) . " > " . s:escape(nmt)) call rename(nmte, nm . &patchmode) else call system(a:cmd . " -- " . s:escape(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 fun s:escape(name) " shellescape() was added by patch 7.0.111 if exists("*shellescape") return shellescape(a:name) endif return "'" . a:name . "'" endfun " vim: set sw=2 : vim-7.4.1689/runtime/autoload/htmlcomplete.vim000066400000000000000000000615521267703067000213130ustar00rootroot00000000000000" Vim completion script " Language: HTML and XHTML " Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) " Last Change: 2014 Jun 20 " Distinguish between HTML versions. " To use with other HTML versions add another "elseif" condition to match " proper DOCTYPE. function! htmlcomplete#DetectOmniFlavor() if &filetype == 'xhtml' let b:html_omni_flavor = 'xhtml10s' else let b:html_omni_flavor = 'html401t' endif let i = 1 let line = "" while i < 10 && i < line("$") let line = getline(i) if line =~ '' let b:html_omni_flavor = 'html40' endif if line =~ '\' let b:html_omni_flavor .= 't' elseif line =~ '\' let b:html_omni_flavor .= 'f' else let b:html_omni_flavor .= 's' endif endif endif endfunction function! htmlcomplete#CompleteTags(findstart, base) if a:findstart " locate the start of the word let line = getline('.') let start = col('.') - 1 let curline = line('.') let compl_begin = col('.') - 2 while start >= 0 && line[start - 1] =~ '\(\k\|[!:.-]\)' let start -= 1 endwhile " Handling of entities {{{ if start >= 0 && line[start - 1] =~ '&' let b:entitiescompl = 1 let b:compl_context = '' return start endif " }}} " Handling of ') if style_start > 0 && style_end > 0 let buf_styles = getline(style_start + 1, style_end - 1) for a_style in buf_styles if index(style, a_style) == -1 if diff_style_start == 0 if a_style =~ '\\_s\+.*id='oneCharWidth'.*\_s\+.*id='oneInputWidth'.*\_s\+.*id='oneEmWidth'\)\?\zs/d_ $ ??,$d_ let temp = getline(1,'$') " clean out id on the main content container because we already set it on " the table let temp[0] = substitute(temp[0], " id='vimCodeElement[^']*'", "", "") " undo deletion of start and end part " so we can later save the file as valid html " TODO: restore using grabbed lines if undolevel is 1? normal! 2u if s:settings.use_css call add(html, '

') elseif s:settings.use_xhtml call add(html, '
') else call add(html, '
') endif let html += temp call add(html, '
') " Close this buffer " TODO: the comment above says we're going to allow saving the file " later...but here we discard it? quit! endfor let html[body_line_num] = body_line call add(html, '') call add(html, '') call add(html, s:body_end_line) call add(html, '') " The generated HTML is admittedly ugly and takes a LONG time to fold. " Make sure the user doesn't do syntax folding when loading a generated file, " using a modeline. call add(html, '') let i = 1 let name = "Diff" . (s:settings.use_xhtml ? ".xhtml" : ".html") " Find an unused file name if current file name is already in use while filereadable(name) let name = substitute(name, '\d*\.x\?html$', '', '') . i . '.' . fnamemodify(copy(name), ":t:e") let i += 1 endwhile exe "topleft new " . name setlocal modifiable " just in case some user autocmd creates content in the new buffer, make sure " it is empty before proceeding %d " set the fileencoding to match the charset we'll be using let &l:fileencoding=s:settings.vim_encoding " According to http://www.w3.org/TR/html4/charset.html#doc-char-set, the byte " order mark is highly recommend on the web when using multibyte encodings. But, " it is not a good idea to include it on UTF-8 files. Otherwise, let Vim " determine when it is actually inserted. if s:settings.vim_encoding == 'utf-8' setlocal nobomb else setlocal bomb endif call append(0, html) if len(style) > 0 1 let style_start = search('^')-1 " add required javascript in reverse order so we can just call append again " and again without adjusting {{{ " insert script closing tag call append(style_start, [ \ '', \ s:settings.use_xhtml ? '//]]>' : '-->', \ "" \ ]) " insert script which corrects the size of small input elements in " prevent_copy mode. See 2html.vim for details on why this is needed and how " it works. if !empty(s:settings.prevent_copy) call append(style_start, [ \ '', \ '/* simulate a "ch" unit by asking the browser how big a zero character is */', \ 'function FixCharWidth() {', \ ' /* get the hidden element which gives the width of a single character */', \ ' var goodWidth = document.getElementById("oneCharWidth").clientWidth;', \ ' /* get all input elements, we''ll filter on class later */', \ ' var inputTags = document.getElementsByTagName("input");', \ ' var ratio = 5;', \ ' var inputWidth = document.getElementById("oneInputWidth").clientWidth;', \ ' var emWidth = document.getElementById("oneEmWidth").clientWidth;', \ ' if (inputWidth > goodWidth) {', \ ' while (ratio < 100*goodWidth/emWidth && ratio < 100) {', \ ' ratio += 5;', \ ' }', \ ' document.getElementById("vimCodeElement'.s:settings.id_suffix.'").className = "em"+ratio;', \ ' }', \ '}' \ ]) endif " " insert javascript to get IDs from line numbers, and to open a fold before " jumping to any lines contained therein call append(style_start, [ \ " /* Always jump to new location even if the line was hidden inside a fold, or", \ " * we corrected the raw number to a line ID.", \ " */", \ " if (lineElem) {", \ " lineElem.scrollIntoView(true);", \ " }", \ " return true;", \ "}", \ "if ('onhashchange' in window) {", \ " window.onhashchange = JumpToLine;", \ "}" \ ]) if s:settings.dynamic_folds call append(style_start, [ \ "", \ " /* navigate upwards in the DOM tree to open all folds containing the line */", \ " var node = lineElem;", \ " while (node && node.id != 'vimCodeElement".s:settings.id_suffix."')", \ " {", \ " if (node.className == 'closed-fold')", \ " {", \ " /* toggle open the fold ID (remove window ID) */", \ " toggleFold(node.id.substr(4));", \ " }", \ " node = node.parentNode;", \ " }", \ ]) endif call append(style_start, [ \ "", \ "/* function to open any folds containing a jumped-to line before jumping to it */", \ "function JumpToLine()", \ "{", \ " var lineNum;", \ " lineNum = window.location.hash;", \ " lineNum = lineNum.substr(1); /* strip off '#' */", \ "", \ " if (lineNum.indexOf('L') == -1) {", \ " lineNum = 'L'+lineNum;", \ " }", \ " if (lineNum.indexOf('W') == -1) {", \ " lineNum = 'W1'+lineNum;", \ " }", \ " lineElem = document.getElementById(lineNum);" \ ]) " Insert javascript to toggle matching folds open and closed in all windows, " if dynamic folding is active. if s:settings.dynamic_folds call append(style_start, [ \ " function toggleFold(objID)", \ " {", \ " for (win_num = 1; win_num <= ".len(a:buf_list)."; win_num++)", \ " {", \ " var fold;", \ ' fold = document.getElementById("win"+win_num+objID);', \ " if(fold.className == 'closed-fold')", \ " {", \ " fold.className = 'open-fold';", \ " }", \ " else if (fold.className == 'open-fold')", \ " {", \ " fold.className = 'closed-fold';", \ " }", \ " }", \ " }", \ ]) endif " insert script tag; javascript is always needed for the line number " normalization for URL hashes call append(style_start, [ \ " See |mysyntaxfile-add| for installing script languages permanently. APACHE *apache.vim* *ft-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 *ft-asm-syntax* *ft-asmh8300-syntax* *ft-nasm-syntax* *ft-masm-syntax* *ft-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. No non-white text must be immediately before or after this text. Note that specifying asmsyntax=foo is equivalent to setting ft=foo in a |modeline|, and that in case of a conflict between the two settings the one from the modeline will take precedence (in particular, if you have ft=asm in the modeline, you will get the GNU syntax highlighting regardless of what is specified as asmsyntax). 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 *ft-aspperl-syntax* *ft-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" BAAN *baan.vim* *baan-syntax* The baan.vim gives syntax support for BaanC of release BaanIV upto SSA ERP LN for both 3 GL and 4 GL programming. Large number of standard defines/constants are supported. Some special violation of coding standards will be signalled when one specify in ones |.vimrc|: > let baan_code_stds=1 *baan-folding* Syntax folding can be enabled at various levels through the variables mentioned below (Set those in your |.vimrc|). The more complex folding on source blocks and SQL can be CPU intensive. To allow any folding and enable folding at function level use: > let baan_fold=1 Folding can be enabled at source block level as if, while, for ,... The indentation preceding the begin/end keywords has to match (spaces are not considered equal to a tab). > let baan_fold_block=1 Folding can be enabled for embedded SQL blocks as SELECT, SELECTDO, SELECTEMPTY, ... The indentation preceding the begin/end keywords has to match (spaces are not considered equal to a tab). > let baan_fold_sql=1 Note: Block folding can result in many small folds. It is suggested to |:set| the options 'foldminlines' and 'foldnestmax' in |.vimrc| or use |:setlocal| in .../after/syntax/baan.vim (see |after-directory|). Eg: > set foldminlines=5 set foldnestmax=6 BASIC *basic.vim* *vb.vim* *ft-basic-syntax* *ft-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* *ft-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 c_no_trail_space_error ... but no trailing spaces c_no_tab_space_error ... but no spaces before a c_no_bracket_error don't highlight {}; inside [] as errors c_no_curly_error don't highlight {}; inside [] and () as errors; except { and } in first column c_curly_error highlight a missing }; this forces syncing from the start of the file, can be slow 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 for *.h files use C syntax instead of C++ and use objc syntax instead of objcpp 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 c_no_c11 don't highlight C11 standard items When 'foldmethod' is set to "syntax" then /* */ comments and { } blocks will become a fold. If you don't want comments to become a fold use: > :let c_no_comment_fold = 1 "#if 0" blocks are also folded, unless: > :let c_no_if0_fold = 1 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 in the "after" directory in 'runtimepath'. For Unix this would be ~/.vim/after/syntax/c.vim. > syn sync fromstart set foldmethod=syntax CH *ch.vim* *ft-ch-syntax* C/C++ interpreter. Ch has similar syntax highlighting to C and builds upon the C syntax file. See |c.vim| for all the settings that are available for C. By setting a variable you can tell Vim to use Ch syntax for *.h files, instead of C or C++: > :let ch_syntax_for_h = 1 CHILL *chill.vim* *ft-chill-syntax* Chill syntax highlighting is similar to C. See |c.vim| for all the settings that are available. Additionally there is: chill_space_errors like c_space_errors chill_comment_string like c_comment_strings chill_minlines like c_minlines CHANGELOG *changelog.vim* *ft-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. CLOJURE *ft-clojure-syntax* Setting *g:clojure_fold* enables folding Clojure code via the syntax engine. Any list, vector, or map that extends over more than one line can be folded using the standard Vim |fold-commands|. Please note that this option does not work with scripts that redefine the bracket syntax regions, such as rainbow-parentheses plugins. This option is off by default. > " Default let g:clojure_fold = 0 < COBOL *cobol.vim* *ft-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* *ft-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. CPP *cpp.vim* *ft-cpp-syntax* Most of things are same as |ft-c-syntax|. Variable Highlight ~ cpp_no_cpp11 don't highlight C++11 standard items cpp_no_cpp14 don't highlight C++14 standard items CSH *csh.vim* *ft-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: *g:filetype_csh* > :let g:filetype_csh = "csh" For using tcsh: > :let g: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* *ft-cynlib-syntax* Cynlib files are C++ files that use the Cynlib class library to enable hardware modelling 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* *ft-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* *ft-desktop-syntax* Primary goal of this syntax file is to highlight .desktop and .directory files according to freedesktop.org standard: http://standards.freedesktop.org/desktop-entry-spec/latest/ 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 DIFF *diff.vim* The diff highlighting normally finds translated headers. This can be slow if there are very long lines in the file. To disable translations: > :let diff_translations = 0 Also see |diff-slow|. DIRCOLORS *dircolors.vim* *ft-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* *ft-docbk-syntax* *docbook* DOCBOOK XML *docbkxml.vim* *ft-docbkxml-syntax* DOCBOOK SGML *docbksgml.vim* *ft-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 You can specify the DocBook version: > :let docbk_ver = 3 When not set 4 is used. DOSBATCH *dosbatch.vim* *ft-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. A second option covers whether *.btm files should be detected as type "dosbatch" (MS-DOS batch files) or type "btm" (4DOS batch files). The latter is used by default. You may select the former with the following line: > :let g:dosbatch_syntax_for_btm = 1 If this variable is undefined or zero, btm syntax is selected. DOXYGEN *doxygen.vim* *doxygen-syntax* Doxygen generates code documentation using a special documentation format (similar to Javadoc). This syntax script adds doxygen highlighting to c, cpp, idl and php files, and should also work with java. There are a few of ways to turn on doxygen formatting. It can be done explicitly or in a modeline by appending '.doxygen' to the syntax of the file. Example: > :set syntax=c.doxygen or > // vim:syntax=c.doxygen It can also be done automatically for C, C++, C#, IDL and PHP files by setting the global or buffer-local variable load_doxygen_syntax. This is done by adding the following to your .vimrc. > :let g:load_doxygen_syntax=1 There are a couple of variables that have an effect on syntax highlighting, and are to do with non-standard highlighting options. Variable Default Effect ~ g:doxygen_enhanced_color g:doxygen_enhanced_colour 0 Use non-standard highlighting for doxygen comments. doxygen_my_rendering 0 Disable rendering of HTML bold, italic and html_my_rendering underline. doxygen_javadoc_autobrief 1 Set to 0 to disable javadoc autobrief colour highlighting. doxygen_end_punctuation '[.]' Set to regexp match for the ending punctuation of brief There are also some hilight groups worth mentioning as they can be useful in configuration. Highlight Effect ~ doxygenErrorComment The colour of an end-comment when missing punctuation in a code, verbatim or dot section doxygenLinkError The colour of an end-comment when missing the \endlink from a \link section. DTD *dtd.vim* *ft-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* *ft-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. EUPHORIA *euphoria3.vim* *euphoria4.vim* *ft-euphoria-syntax* Two syntax highlighting files exists for Euphoria. One for Euphoria version 3.1.1, which is the default syntax highlighting file, and one for Euphoria version 4.0.5 or later. Euphoria version 3.1.1 (http://www.rapideuphoria.com/) is still necessary for developing applications for the DOS platform, which Euphoria version 4 (http://www.openeuphoria.org/) does not support. The following file extensions are auto-detected as Euphoria file type: *.e, *.eu, *.ew, *.ex, *.exu, *.exw *.E, *.EU, *.EW, *.EX, *.EXU, *.EXW To select syntax highlighting file for Euphoria, as well as for auto-detecting the *.e and *.E file extensions as Euphoria file type, add the following line to your startup file: > :let filetype_euphoria="euphoria3" or :let filetype_euphoria="euphoria4" ERLANG *erlang.vim* *ft-erlang-syntax* Erlang is a functional programming language developed by Ericsson. Files with the following extensions are recognized as Erlang files: erl, hrl, yaws. The BIFs (built-in functions) are highlighted by default. To disable this, put the following line in your vimrc: > :let g:erlang_highlight_bifs = 0 To enable highlighting some special atoms, put this in your vimrc: > :let g:erlang_highlight_special_atoms = 1 FLEXWIKI *flexwiki.vim* *ft-flexwiki-syntax* FlexWiki is an ASP.NET-based wiki package available at http://www.flexwiki.com NOTE: this site currently doesn't work, on Wikipedia is mentioned that development stopped in 2009. Syntax highlighting is available for the most common elements of FlexWiki syntax. The associated ftplugin script sets some buffer-local options to make editing FlexWiki pages more convenient. FlexWiki considers a newline as the start of a new paragraph, so the ftplugin sets 'tw'=0 (unlimited line length), 'wrap' (wrap long lines instead of using horizontal scrolling), 'linebreak' (to wrap at a character in 'breakat' instead of at the last char on screen), and so on. It also includes some keymaps that are disabled by default. If you want to enable the keymaps that make "j" and "k" and the cursor keys move up and down by display lines, add this to your .vimrc: > :let flexwiki_maps = 1 FORM *form.vim* *ft-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* *ft-fortran-syntax* Default highlighting and dialect ~ Highlighting appropriate for Fortran 2008 is used by default. This choice should be appropriate for most users most of the time because Fortran 2008 is almost a superset of previous versions (Fortran 2003, 95, 90, and 77). Fortran source code form ~ Fortran 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, in a non-standard way, 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|. 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 file extension using conventions common to the ifort, gfortran, Cray, NAG, and PathScale compilers (.f, .for, .f77 for fixed-source, .f90, .f95, .f03, .f08 for free-source). If none of this works, then the script examines the first five columns of the first 500 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 500 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 two Fortran dialects: f08 and F. You will probably find the default highlighting (f08) satisfactory. A few legacy constructs deleted or declared obsolescent in the 2008 standard are highlighted as todo items. If you use F, the advantage of setting the dialect appropriately is that other legacy features excluded from F will be highlighted as todo items and that free source form will be assumed. The dialect can be selected in various ways. If all your fortran files use the same dialect, set the global variable fortran_dialect in your .vimrc prior to your syntax on statement. The case-sensitive, permissible values of fortran_dialect are "f08" or "F". Invalid values of fortran_dialect are ignored. If the dialect depends upon the file extension, then it is most convenient to set a buffer-local variable 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 F subset, your ftplugin file should contain the code > let s:extfname = expand("%:e") if s:extfname ==? "f90" let b:fortran_dialect="F" else unlet! b: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=F or f08) in one of the first three lines in your file. For example, your older .f files may be legacy code 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 For previous versions of the syntax, you may have set fortran_dialect to the now-obsolete values "f77", "f90", "f95", or "elf". Such settings will be silently handled as "f08". Users of "elf" may wish to experiment with "F" instead. The syntax/fortran.vim script contains embedded comments that tell you how to comment and/or uncomment some lines to (a) activate recognition of some non-standard, vendor-supplied intrinsics and (b) to prevent features deleted or declared obsolescent in the 2008 standard from being highlighted as todo items. 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 |ft-fortran-indent| and |ft-fortran-plugin|. FVWM CONFIGURATION FILES *fvwm.vim* *ft-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* *ft-gsp-syntax* 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* *ft-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* *ft-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* *ft-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: ( is used as an alias for , while as an alias for ),

-

, , and <A>, but only if used as a link (that is, it must include a href as in <A href="somefile.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* *ft-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* *ft-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* *ft-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 IDL *idl.vim* *idl-syntax* IDL (Interface Definition Language) files are used to define RPC calls. In Microsoft land, this is also used for defining COM interfaces and calls. 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 repetitive but seems to work. There are some Microsoft extensions to idl files that are here. Some of them are disabled by defining idl_no_ms_extensions. The more complex of the extensions are disabled by defining idl_no_extensions. Variable Effect ~ idl_no_ms_extensions Disable some of the Microsoft specific extensions idl_no_extensions Disable complex extensions idlsyntax_showerror Show IDL errors (can be rather intrusive, but quite helpful) idlsyntax_showerror_soft Use softer colours by default for errors JAVA *java.vim* *ft-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. Therefore 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. 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* *ft-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* *ft-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). LIFELINES *lifelines.vim* *ft-lifelines-syntax* To highlight deprecated functions as errors, add in your .vimrc: > :let g:lifelines_deprecated = 1 < LISP *lisp.vim* *ft-lisp-syntax* The lisp syntax highlighting provides two options: > g:lisp_instring : if it exists, then "(...)" strings are highlighted as if the contents of the string were lisp. Useful for AutoLisp. g:lisp_rainbow : if it exists and is nonzero, then differing levels of parenthesization will receive different highlighting. < The g:lisp_rainbow option provides 10 levels of individual colorization for the parentheses and backquoted parentheses. Because of the quantity of colorization levels, unlike non-rainbow highlighting, the rainbow mode specifies its highlighting using ctermfg and guifg, thereby bypassing the usual colorscheme control using standard highlighting groups. The actual highlighting used depends on the dark/bright setting (see |'bg'|). LITE *lite.vim* *ft-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* *ft-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 assert 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* *ft-lua-syntax* The Lua syntax file can be used for versions 4.0, 5.0, 5.1 and 5.2 (5.2 is the default). You can select one of these versions using the global variables lua_version and lua_subversion. For example, to activate Lua 5.1 syntax highlighting, set the variables like this: :let lua_version = 5 :let lua_subversion = 1 MAIL *mail.vim* *ft-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* *ft-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* *ft-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 MATHEMATICA *mma.vim* *ft-mma-syntax* *ft-mathematica-syntax* Empty *.m files will automatically be presumed to be Matlab files unless you have the following in your .vimrc: > let filetype_m = "mma" MOO *moo.vim* *ft-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* *ft-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* *ft-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* *ft-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 maintain 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 extended 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* *ft-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* *ft-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* *ft-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 variables for some compilers. 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* *ft-perl-syntax* There are a number of possible options to the perl syntax highlighting. Inline POD highlighting is now turned on by default. If you don't wish to have the added complexity of highlighting POD embedded within Perl files, you may set the 'perl_include_pod' option to 0: > :let perl_include_pod = 0 To reduce the complexity of parsing (and increase performance) you can switch off two elements in the parsing of variable names and contents. > To handle package references in variable and function names not differently from the rest of the name (like 'PkgName::' in '$PkgName::VarName'): > :let perl_no_scope_in_variables = 1 (In Vim 6.x it was the other way around: "perl_want_scope_in_variables" enabled it.) If you do not want complex things like '@{${"foo"}}' to be parsed: > :let perl_no_extended_vars = 1 (In Vim 6.x it was the other way around: "perl_extended_vars" enabled it.) 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 If you want to fold blocks in if statements, etc. as well set the following: > :let perl_fold_blocks = 1 Subroutines are folded by default if 'perl_fold' is set. If you do not want this, you can set 'perl_nofold_subs': > :let perl_nofold_subs = 1 Anonymous subroutines are not folded by default; you may enable their folding via 'perl_fold_anonymous_subs': > :let perl_fold_anonymous_subs = 1 Packages are also folded by default if 'perl_fold' is set. To disable this behavior, set 'perl_nofold_packages': > :let perl_nofold_packages = 1 PHP3 and PHP4 *php.vim* *php3.vim* *ft-php-syntax* *ft-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 a 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. PLAINTEX *plaintex.vim* *ft-plaintex-syntax* TeX is a typesetting language, and plaintex is the file type for the "plain" variant of TeX. If you never want your *.tex files recognized as plain TeX, see |ft-tex-plugin|. This syntax file has the option > let g:plaintex_delimiters = 1 if you want to highlight brackets "[]" and braces "{}". PPWIZARD *ppwiz.vim* *ft-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* *ft-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* *ft-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* *ft-printcap-syntax* PRINTCAP + TERMCAP *ft-ptcap-syntax* *ft-termcap-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* *ft-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* *ft-python-syntax* There are six options to control Python syntax highlighting. For highlighted numbers: > :let python_no_number_highlight = 1 For highlighted builtin functions: > :let python_no_builtin_highlight = 1 For highlighted standard exceptions: > :let python_no_exception_highlight = 1 For highlighted doctests and code inside: > :let python_no_doctest_highlight = 1 or > :let python_no_doctest_code_highlight = 1 (first option implies second one). For highlighted trailing whitespace and mix of spaces and tabs: > :let python_space_error_highlight = 1 If you want all possible Python highlighting (the same as setting the preceding last option and unsetting all other ones): > :let python_highlight_all = 1 Note: only existence of these options matter, not their value. You can replace 1 above with anything. QUAKE *quake.vim* *ft-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* *ft-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. RESTRUCTURED TEXT *rst.vim* *ft-rst-syntax* You may set what syntax definitions should be used for code blocks via let rst_syntax_code_list = ['vim', 'lisp', ...] REXX *rexx.vim* *ft-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. Vim tries to guess what type a ".r" file is. If it can't be detected (from comment lines), the default is "r". To make the default rexx add this line to your .vimrc: *g:filetype_r* > :let g:filetype_r = "r" RUBY *ruby.vim* *ft-ruby-syntax* There are a number of 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. Highlighting of special identifiers can be disabled by removing the rubyIdentifier highlighting: > :hi link rubyIdentifier NONE < This will prevent highlighting of special identifiers like "ConstantName", "$global_var", "@@class_var", "@instance_var", "| block_param |", and ":symbol". Significant methods of Kernel, Module and Object are highlighted by default. This can be disabled by defining "ruby_no_special_methods": > :let ruby_no_special_methods = 1 < This will prevent highlighting of important methods such as "require", "attr", "private", "raise" and "proc". Ruby operators can be highlighted. This is enabled by defining "ruby_operators": > :let ruby_operators = 1 < Whitespace errors can be highlighted by defining "ruby_space_errors": > :let ruby_space_errors = 1 < This will highlight trailing whitespace and tabs preceded by a space character as errors. This can be refined by defining "ruby_no_trail_space_error" and "ruby_no_tab_space_error" which will ignore trailing whitespace and tabs after spaces respectively. Folding can be enabled by defining "ruby_fold": > :let ruby_fold = 1 < This will set the 'foldmethod' option to "syntax" and allow folding of classes, modules, methods, code blocks, heredocs and comments. Folding of multiline comments can be disabled by defining "ruby_no_comment_fold": > :let ruby_no_comment_fold = 1 < SCHEME *scheme.vim* *ft-scheme-syntax* By default only R5RS keywords are highlighted and properly indented. MzScheme-specific stuff will be used if b:is_mzscheme or g:is_mzscheme variables are defined. Also scheme.vim supports keywords of the Chicken Scheme->C compiler. Define b:is_chicken or g:is_chicken, if you need them. SDL *sdl.vim* *ft-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* *ft-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* *ft-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* *ft-sh-syntax* *ft-bash-syntax* *ft-ksh-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, Windows+cygwin) or "ksh" (Posix). One may specify a global default by instantiating one of the following three variables in your <.vimrc>: ksh: > let g:is_kornshell = 1 < posix: (using this is the same as setting is_kornshell to 1) > let g:is_posix = 1 < bash: > let g:is_bash = 1 < sh: (default) Bourne shell > let g:is_sh = 1 If there's no "#! ..." line, and the user hasn't availed himself/herself of a default sh.vim syntax setting as just shown, then syntax/sh.vim will assume the Bourne shell syntax. No need to quote RFCs or market penetration statistics in error reports, please -- just select the default version of the sh your system uses in your <.vimrc>. The syntax/sh.vim file provides several levels of syntax-based folding: > let g:sh_fold_enabled= 0 (default, no syntax folding) let g:sh_fold_enabled= 1 (enable function folding) let g:sh_fold_enabled= 2 (enable heredoc folding) let g:sh_fold_enabled= 4 (enable if/do/for folding) > then various syntax items (HereDocuments and function bodies) become syntax-foldable (see |:syn-fold|). You also may add these together to get multiple types of folding: > let g:sh_fold_enabled= 3 (enables function and heredoc folding) If you notice highlighting errors while scrolling backwards which are fixed when one redraws 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. *g:sh_isk* *g:sh_noisk* The shell languages appear to let "." be part of words, commands, etc; consequently it should be in the isk for sh.vim. As of v116 of syntax/sh.vim, syntax/sh.vim will append the "." to |'iskeyword'| by default; you may control this behavior with: > let g:sh_isk = '..whatever characters you want as part of iskeyword' let g:sh_noisk= 1 " otherwise, if this exists, the isk will NOT chg < *sh-embed* *sh-awk* Sh: EMBEDDING LANGUAGES~ You may wish to embed languages into sh. I'll give an example courtesy of Lorance Stinson on how to do this with awk as an example. Put the following file into $HOME/.vim/after/syntax/sh/awkembed.vim: > " AWK Embedding: " ============== " Shamelessly ripped from aspperl.vim by Aaron Hope. if exists("b:current_syntax") unlet b:current_syntax endif syn include @AWKScript syntax/awk.vim syn region AWKScriptCode matchgroup=AWKCommand start=+[=\\]\@<!'+ skip=+\\'+ end=+'+ contains=@AWKScript contained syn region AWKScriptEmbedded matchgroup=AWKCommand start=+\<awk\>+ skip=+\\$+ end=+[=\\]\@<!'+me=e-1 contains=@shIdList,@shExprList2 nextgroup=AWKScriptCode syn cluster shCommandSubList add=AWKScriptEmbedded hi def link AWKCommand Type < This code will then let the awk code in the single quotes: > awk '...awk code here...' be highlighted using the awk highlighting syntax. Clearly this may be extended to other languages. SPEEDUP *spup.vim* *ft-spup-syntax* (AspenTech plant simulator) 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. SQL *sql.vim* *ft-sql-syntax* *sqlinformix.vim* *ft-sqlinformix-syntax* *sqlanywhere.vim* *ft-sqlanywhere-syntax* While there is an ANSI standard for SQL, most database engines add their own custom extensions. Vim currently supports the Oracle and Informix dialects of SQL. Vim assumes "*.sql" files are Oracle SQL by default. Vim currently has SQL support for a variety of different vendors via syntax scripts. You can change Vim's default from Oracle to any of the current SQL supported types. You can also easily alter the SQL dialect being used on a buffer by buffer basis. For more detailed instructions see |ft_sql.txt|. TCSH *tcsh.vim* *ft-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 = 1000 This will make the syntax synchronization start 1000 lines before the first displayed line. If you set "tcsh_minlines" to "fromstart", then synchronization is done from the start of the file. The default value for tcsh_minlines is 100. The disadvantage of using a larger number is that redrawing can become slow. TEX *tex.vim* *ft-tex-syntax* *latex-syntax* Tex Contents~ Tex: Want Syntax Folding? |tex-folding| Tex: No Spell Checking Wanted |g:tex_nospell| Tex: Don't Want Spell Checking In Comments? |tex-nospell| Tex: Want Spell Checking in Verbatim Zones? |tex-verb| Tex: Run-on Comments or MathZones |tex-runon| Tex: Slow Syntax Highlighting? |tex-slow| Tex: Want To Highlight More Commands? |tex-morecommands| Tex: Excessive Error Highlighting? |tex-error| Tex: Need a new Math Group? |tex-math| Tex: Starting a New Style? |tex-style| Tex: Taking Advantage of Conceal Mode |tex-conceal| Tex: Selective Conceal Mode |g:tex_conceal| Tex: Controlling iskeyword |g:tex_isk| Tex: Fine Subscript and Superscript Control |tex-supersub| *tex-folding* *g:tex_fold_enabled* Tex: Want Syntax Folding? ~ As of version 28 of <syntax/tex.vim>, syntax-based folding of parts, chapters, sections, subsections, etc are supported. Put > let g:tex_fold_enabled=1 in your <.vimrc>, and :set fdm=syntax. I suggest doing the latter via a modeline at the end of your LaTeX file: > % vim: fdm=syntax If your system becomes too slow, then you might wish to look into > https://vimhelp.appspot.com/vim_faq.txt.html#faq-29.7 < *g:tex_nospell* Tex: No Spell Checking Wanted~ If you don't want spell checking anywhere in your LaTeX document, put > let g:tex_nospell=1 into your .vimrc. If you merely wish to suppress spell checking inside comments only, see |g:tex_comment_nospell|. *tex-nospell* *g:tex_comment_nospell* Tex: Don't Want Spell Checking In Comments? ~ Some folks like to include things like source code in comments and so would prefer that spell checking be disabled in comments in LaTeX files. To do this, put the following in your <.vimrc>: > let g:tex_comment_nospell= 1 If you want to suppress spell checking everywhere inside your LaTeX document, see |g:tex_nospell|. *tex-verb* *g:tex_verbspell* Tex: Want Spell Checking in Verbatim Zones?~ Often verbatim regions are used for things like source code; seldom does one want source code spell-checked. However, for those of you who do want your verbatim zones spell-checked, put the following in your <.vimrc>: > let g:tex_verbspell= 1 < *tex-runon* *tex-stopzone* Tex: Run-on Comments or MathZones ~ The <syntax/tex.vim> highlighting supports TeX, LaTeX, and some AmsTeX. The highlighting supports three primary zones/regions: normal, texZone, and texMathZone. Although 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. *tex-slow* *tex-sync* Tex: 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 (i.e. just what group, if any, is the text at the top of the screen supposed to be in?). Another cause of slow highlighting is due to syntax-driven folding; see |tex-folding| for a way around this. *g:tex_fast* Finally, if syntax highlighting is still too slow, you may set > :let g:tex_fast= "" in your .vimrc. Used this way, the g:tex_fast variable causes the syntax highlighting script to avoid defining any regions and associated synchronization. The result will be much faster syntax highlighting; the price: you will no longer have as much highlighting or any syntax-based folding, and you will be missing syntax-based error checking. You may decide that some syntax is acceptable; you may use the following table selectively to enable just some syntax highlighting: > b : allow bold and italic syntax c : allow texComment syntax m : allow texMatcher syntax (ie. {...} and [...]) M : allow texMath syntax p : allow parts, chapter, section, etc syntax r : allow texRefZone syntax (nocite, bibliography, label, pageref, eqref) s : allow superscript/subscript regions S : allow texStyle syntax v : allow verbatim syntax V : allow texNewEnv and texNewCmd syntax < As an example, let g:tex_fast= "M" will allow math-associated highlighting but suppress all the other region-based syntax highlighting. (also see: |g:tex_conceal| and |tex-supersub|) *tex-morecommands* *tex-package* Tex: Want To Highlight More Commands? ~ LaTeX is a programmable language, and so there are thousands of packages full of specialized LaTeX commands, syntax, and fonts. If you're using such a package you'll often wish that the distributed syntax/tex.vim would support it. However, clearly this is impractical. So please consider using the techniques in |mysyntaxfile-add| to extend or modify the highlighting provided by syntax/tex.vim. Please consider uploading any extensions that you write, which typically would go in $HOME/after/syntax/tex/[pkgname].vim, to http://vim.sf.net/. *tex-error* *g:tex_no_error* Tex: 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 g:tex_no_error=1 and all error checking by <syntax/tex.vim> will be suppressed. *tex-math* Tex: 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: > call TexNewMathZone(sfx,mathzone,starform) You'll want to provide the new math group with a unique suffix (currently, A-L and V-Z are taken by <syntax/tex.vim> itself). As an example, consider how eqnarray is set up by <syntax/tex.vim>: > call TexNewMathZone("D","eqnarray",1) You'll need to change "mathzone" to the name of your new math group, and then to the call to it in .vim/after/syntax/tex.vim. The "starform" variable, if true, implies that your new math group has a starred form (ie. eqnarray*). *tex-style* *b:tex_stylish* Tex: 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 @. *tex-cchar* *tex-cole* *tex-conceal* Tex: Taking Advantage of Conceal Mode~ If you have |'conceallevel'| set to 2 and if your encoding is utf-8, then a number of character sequences can be translated into appropriate utf-8 glyphs, including various accented characters, Greek characters in MathZones, and superscripts and subscripts in MathZones. Not all characters can be made into superscripts or subscripts; the constraint is due to what utf-8 supports. In fact, only a few characters are supported as subscripts. One way to use this is to have vertically split windows (see |CTRL-W_v|); one with |'conceallevel'| at 0 and the other at 2; and both using |'scrollbind'|. *g:tex_conceal* Tex: Selective Conceal Mode~ You may selectively use conceal mode by setting g:tex_conceal in your <.vimrc>. By default, g:tex_conceal is set to "admgs" to enable concealment for the following sets of characters: > a = accents/ligatures b = bold and italic d = delimiters m = math symbols g = Greek s = superscripts/subscripts < By leaving one or more of these out, the associated conceal-character substitution will not be made. *g:tex_isk* *g:tex_stylish* Tex: Controlling iskeyword~ Normally, LaTeX keywords support 0-9, a-z, A-z, and 192-255 only. Latex keywords don't support the underscore - except when in *.sty files. The syntax highlighting script handles this with the following logic: * If g:tex_stylish exists and is 1 then the file will be treated as a "sty" file, so the "_" will be allowed as part of keywords (irregardless of g:tex_isk) * Else if the file's suffix is sty, cls, clo, dtx, or ltx, then the file will be treated as a "sty" file, so the "_" will be allowed as part of keywords (irregardless of g:tex_isk) * If g:tex_isk exists, then it will be used for the local 'iskeyword' * Else the local 'iskeyword' will be set to 48-57,a-z,A-Z,192-255 *tex-supersub* *g:tex_superscripts* *g:tex_subscripts* Tex: Fine Subscript and Superscript Control~ See |tex-conceal| for how to enable concealed character replacement. See |g:tex_conceal| for selectively concealing accents, bold/italic, math, Greek, and superscripts/subscripts. One may exert fine control over which superscripts and subscripts one wants syntax-based concealment for (see |:syn-cchar|). Since not all fonts support all characters, one may override the concealed-replacement lists; by default these lists are given by: > let g:tex_superscripts= "[0-9a-zA-W.,:;+-<>/()=]" let g:tex_subscripts= "[0-9aehijklmnoprstuvx,+-/().]" < For example, I use Luxi Mono Bold; it doesn't support subscript characters for "hklmnpst", so I put > let g:tex_subscripts= "[0-9aeijoruvx,+-/().]" < in ~/.vim/ftplugin/tex/tex.vim in order to avoid having inscrutable utf-8 glyphs appear. TF *tf.vim* *ft-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* *ft-vim-syntax* *g:vimsyn_minlines* *g:vimsyn_maxlines* There is a trade-off between more accurate syntax highlighting versus screen updating speed. To improve accuracy, you may wish to increase the g:vimsyn_minlines variable. The g:vimsyn_maxlines variable may be used to improve screen updating rates (see |:syn-sync| for more on this). > g:vimsyn_minlines : used to set synchronization minlines g:vimsyn_maxlines : used to set synchronization maxlines < (g:vim_minlines and g:vim_maxlines are deprecated variants of these two options) *g:vimsyn_embed* The g:vimsyn_embed option allows users to select what, if any, types of embedded script highlighting they wish to have. > g:vimsyn_embed == 0 : don't support any embedded scripts g:vimsyn_embed =~ 'l' : support embedded lua g:vimsyn_embed =~ 'm' : support embedded mzscheme g:vimsyn_embed =~ 'p' : support embedded perl g:vimsyn_embed =~ 'P' : support embedded python g:vimsyn_embed =~ 'r' : support embedded ruby g:vimsyn_embed =~ 't' : support embedded tcl < By default, g:vimsyn_embed is a string supporting interpreters that your vim itself supports. Concatenate multiple characters to support multiple types of embedded interpreters; ie. g:vimsyn_embed= "mp" supports embedded mzscheme and embedded perl. *g:vimsyn_folding* Some folding is now supported with syntax/vim.vim: > g:vimsyn_folding == 0 or doesn't exist: no syntax-based folding g:vimsyn_folding =~ 'a' : augroups g:vimsyn_folding =~ 'f' : fold functions g:vimsyn_folding =~ 'l' : fold lua script g:vimsyn_folding =~ 'm' : fold mzscheme script g:vimsyn_folding =~ 'p' : fold perl script g:vimsyn_folding =~ 'P' : fold python script g:vimsyn_folding =~ 'r' : fold ruby script g:vimsyn_folding =~ 't' : fold tcl script < *g:vimsyn_noerror* Not all error highlighting that syntax/vim.vim does may be correct; VimL is a difficult language to highlight correctly. A way to suppress error highlighting is to put the following line in your |vimrc|: > let g:vimsyn_noerror = 1 < XF86CONFIG *xf86conf.vim* *ft-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* *ft-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* *ft-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(".")[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-* YAML *yaml.vim* *ft-yaml-syntax* *g:yaml_schema* *b:yaml_schema* A YAML schema is a combination of a set of tags and a mechanism for resolving non-specific tags. For user this means that YAML parser may, depending on plain scalar contents, treat plain scalar (which can actually be only string and nothing else) as a value of the other type: null, boolean, floating-point, integer. `g:yaml_schema` option determines according to which schema values will be highlighted specially. Supported schemas are Schema Description ~ failsafe No additional highlighting. json Supports JSON-style numbers, booleans and null. core Supports more number, boolean and null styles. pyyaml In addition to core schema supports highlighting timestamps, but there are some differences in what is recognized as numbers and many additional boolean values not present in core schema. Default schema is `core`. Note that schemas are not actually limited to plain scalars, but this is the only difference between schemas defined in YAML specification and the only difference defined in the syntax file. ZSH *zsh.vim* *ft-zsh-syntax* The syntax script for zsh allows for syntax-based folding: > :let g:zsh_fold_enable = 1 ============================================================================== 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. SPELL CHECKING *:syn-spell* :sy[ntax] spell [toplevel | notoplevel | default] This defines where spell checking is to be done for text that is not in a syntax item: toplevel: Text is spell checked. notoplevel: Text is not spell checked. default: When there is a @Spell cluster no spell checking. For text in syntax items use the @Spell and @NoSpell clusters |spell-syntax|. When there is no @Spell and no @NoSpell cluster then spell checking is done for "default" and "toplevel". To activate spell checking the 'spell' option must be set. SYNTAX ISKEYWORD SETTING *:syn-iskeyword* :sy[ntax] iskeyword [clear | {option}] This defines the keyword characters. It's like the 'iskeyword' option for but only applies to syntax highlighting. clear: Syntax specific iskeyword setting is disabled and the buffer-local 'iskeyword' setting is used. {option} Set the syntax 'iskeyword' option to a new value. Example: > :syntax iskeyword @,48-57,192-255,$,_ < This would set the syntax specific iskeyword option to include all alphabetic characters, plus the numeric characters, all accented characters and also includes the "_" and the "$". If no argument is given, the current value will be output. Setting this option influences what |/\k| matches in syntax patterns and also determines where |:syn-keyword| will be checked for a new match. It is recommended when writing syntax files, to use this command to the correct value for the specific syntax language and not change the 'iskeyword' option. 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 < *E789* *E890* 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'. See |:syn-iskeyword| for defining syntax specific iskeyword settings. 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 < *E849* The maximum number of syntax groups is 19999. ============================================================================== 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* contains oneline fold display extend concealends~ :syntax keyword - - - - - - :syntax match yes - yes yes yes - :syntax region yes yes yes yes yes yes These arguments can be used for all three commands: conceal cchar contained containedin nextgroup transparent skipwhite skipnl skipempty conceal *conceal* *:syn-conceal* When the "conceal" argument is given, the item is marked as concealable. Whether or not it is actually concealed depends on the value of the 'conceallevel' option. The 'concealcursor' option is used to decide whether concealable items in the current line are displayed unconcealed to be able to edit the line. Another way to conceal text with with |matchadd()|. concealends *:syn-concealends* When the "concealends" argument is given, the start and end matches of the region, but not the contents of the region, are marked as concealable. Whether or not they are actually concealed depends on the setting on the 'conceallevel' option. The ends of a region can only be concealed separately in this way when they have their own highlighting via "matchgroup" cchar *:syn-cchar* *E844* The "cchar" argument defines the character shown in place of the item when it is concealed (setting "cchar" only makes sense when the conceal argument is given.) If "cchar" is not set then the default conceal character defined in the 'listchars' option is used. The character cannot be a control character such as Tab. Example: > :syntax match Entity "&" conceal cchar=& See |hl-Conceal| for highlighting. 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 increase 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={group-name},.. 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={group-name}... *: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 {group-name}... 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={group-name},.. *: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). IMPLICIT CONCEAL *:syn-conceal-implicit* :sy[ntax] conceal [on|off] This defines if the following ":syntax" commands will define keywords, matches or regions with the "conceal" flag set. After ":syn conceal on", all subsequent ":syn keyword", ":syn match" or ":syn region" defined will have the "conceal" flag set implicitly. ":syn conceal off" returns to the normal state where the "conceal" flag must be given explicitly. ============================================================================== 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' option 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 right of the start 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. - Before Vim 7.2 the offsets were counted in bytes instead of characters. This didn't work well for multi-byte characters, so it was changed with the Vim 7.2 release. - 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 sssrrreee 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. Using the "\zs" item also requires that the start of the match doesn't move to another line. 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* *E879* \z(\) Marks the sub-expression as "external", meaning that it 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 \z1 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=.., containedin=.., 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 < *E848* The maximum number of clusters is 9767. ============================================================================== 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". *E847* The maximum number of includes is 999. ============================================================================== 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 maxlines=500 ccomment < *: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 text 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. *syn-sync-linecont* :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 command 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] Output the name of the currently active color scheme. This is basically the same as > :echo g:colors_name < In case g:colors_name has not been defined :colo will output "default". When compiled without the |+eval| feature it will output "unknown". :colo[rscheme] {name} Load color scheme {name}. This searches 'runtimepath' for the file "colors/{name}.vim". The first one that is found is loaded. Also searches all plugins in 'packpath', first below "start" and then under "opt". Doesn't work recursively, thus you can't use ":colorscheme" in a color scheme script. After the color scheme has been loaded the |ColorScheme| autocommand event is triggered. For info about writing a colorscheme file: > :edit $VIMRUNTIME/colors/README.txt :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-verbose* When listing a highlight group and 'verbose' is non-zero, the listing will also tell where it was last set. Example: > :verbose hi Comment < Comment xxx term=bold ctermfg=4 guifg=Blue ~ Last set from /home/mool/vim/vim7/runtime/syntax/syncolor.vim ~ When ":hi clear" is used then the script where this command is used will be mentioned for the default values. See |:verbose-cmd| for more information. *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 *bold* *underline* *undercurl* *inverse* *italic* *standout* 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 undercurl not always available 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. "undercurl" is a curly underline. When "undercurl" is not possible then "underline" is used. In general "undercurl" is only available in the GUI. The color is set with |highlight-guisp|. 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! You can also use "NONE" to remove the color. *: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 "g: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* guisp={color-name} *highlight-guisp* These give the foreground (guifg), background (guibg) and special (guisp) color to use in the GUI. "guisp" is used for undercurl. 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 "gg" is the Green value "bb" is the Blue 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-ColorColumn* ColorColumn used for the columns set with 'colorcolumn' *hl-Conceal* Conceal placeholder characters substituted for concealed text (see 'conceallevel') *hl-Cursor* Cursor the character under the cursor *hl-CursorIM* CursorIM like Cursor, but used when in IME mode |CursorIM| *hl-CursorColumn* CursorColumn the screen column that the cursor is in when 'cursorcolumn' is set *hl-CursorLine* CursorLine the screen line that the cursor is in when 'cursorline' is set *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' or 'relativenumber' option is set. *hl-CursorLineNr* CursorLineNr Like LineNr when 'cursorline' or 'relativenumber' is set for the cursor line. *hl-MatchParen* MatchParen The character under the cursor or just before it, if it is a paired bracket, and its match. |pi_paren.txt| *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-Pmenu* Pmenu Popup menu: normal item. *hl-PmenuSel* PmenuSel Popup menu: selected item. *hl-PmenuSbar* PmenuSbar Popup menu: scrollbar. *hl-PmenuThumb* PmenuThumb Popup menu: Thumb of the scrollbar. *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-SpellBad* SpellBad Word that is not recognized by the spellchecker. |spell| This will be combined with the highlighting used otherwise. *hl-SpellCap* SpellCap Word that should start with a capital. |spell| This will be combined with the highlighting used otherwise. *hl-SpellLocal* SpellLocal Word that is recognized by the spellchecker as one that is used in another region. |spell| This will be combined with the highlighting used otherwise. *hl-SpellRare* SpellRare Word that is recognized by the spellchecker as one that is hardly ever used. |spell| This will be combined with the highlighting used otherwise. *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-TabLine* TabLine tab pages line, not active tab page label *hl-TabLineFill* TabLineFill tab pages line, where there are no labels *hl-TabLineSel* TabLineSel tab pages line, active tab page label *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* *hl-User9* 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 the following 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 *E679* Do make sure this syncolor.vim script does not use a "syntax on", set the 'background' option or uses a "colorscheme" command, because it results in an endless loop. 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 --c-kinds=gstu -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. Window-local syntax *:ownsyntax* Normally all windows on a buffer share the same syntax settings. It is possible, however, to set a particular window on a file to have its own private syntax setting. A possible example would be to edit LaTeX source with conventional highlighting in one window, while seeing the same source highlighted differently (so as to hide control sequences and indicate bold, italic etc regions) in another. The 'scrollbind' option is useful here. To set the current window to have the syntax "foo", separately from all other windows on the buffer: > :ownsyntax foo < *w:current_syntax* This will set the "w:current_syntax" variable to "foo". The value of "b:current_syntax" does not change. This is implemented by saving and restoring "b:current_syntax", since the syntax files do set "b:current_syntax". The value set by the syntax file is assigned to "w:current_syntax". Note: This resets the 'spell', 'spellcapcheck' and 'spellfile' options. Once a window has its own syntax, syntax commands executed from other windows on the same buffer (including :syntax clear) have no effect. Conversely, syntax commands executed from that window do not affect other windows on the same buffer. A window with its own syntax reverts to normal behavior when another buffer is loaded into that window or the file is reloaded. When splitting the window, the new window will use the original syntax. ============================================================================== 17. 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 this command: > :runtime syntax/colortest.vim 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 using it 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 an 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>) ============================================================================== 18. When syntax is slow *:syntime* This is aimed at authors of a syntax file. If your syntax causes redrawing to be slow, here are a few hints on making it faster. To see slowness switch on some features that usually interfere, such as 'relativenumber' and |folding|. Note: this is only available when compiled with the |+profile| feature. You many need to build Vim with "huge" features. To find out what patterns are consuming most time, get an overview with this sequence: > :syntime on [ redraw the text at least once with CTRL-L ] :syntime report This will display a list of syntax patterns that were used, sorted by the time it took to match them against the text. :syntime on Start measuring syntax times. This will add some overhead to compute the time spent on syntax pattern matching. :syntime off Stop measuring syntax times. :syntime clear Set all the counters to zero, restart measuring. :syntime report Show the syntax items used since ":syntime on" in the current window. Use a wider display to see more of the output. The list is sorted by total time. The columns are: TOTAL Total time in seconds spent on matching this pattern. COUNT Number of times the pattern was used. MATCH Number of times the pattern actually matched SLOWEST The longest time for one try. AVERAGE The average time for one try. NAME Name of the syntax item. Note that this is not unique. PATTERN The pattern being used. Pattern matching gets slow when it has to try many alternatives. Try to include as much literal text as possible to reduce the number of ways a pattern does NOT match. When using the "\@<=" and "\@<!" items, add a maximum size to avoid trying at all positions in the current and previous line. For example, if the item is literal text specify the size of that text (in bytes): "<\@<=span" Matches "span" in "<span". This tries matching with "<" in many places. "<\@1<=span" Matches the same, but only tries one byte before "span". vim:tw=78:sw=4:ts=8:ft=help:norl: �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/tabpage.txt����������������������������������������������������������������0000664�0000000�0000000�00000035721�12677030670�0017201�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*tabpage.txt* For Vim version 7.4. Last change: 2015 Jan 04 VIM REFERENCE MANUAL by Bram Moolenaar Editing with windows in multiple tab pages. *tab-page* *tabpage* The commands which have been added to use multiple tab pages are explained here. Additionally, there are explanations for commands that work differently when used in combination with more than one tab page. 1. Introduction |tab-page-intro| 2. Commands |tab-page-commands| 3. Other items |tab-page-other| 4. Setting 'tabline' |setting-tabline| 5. Setting 'guitablabel' |setting-guitablabel| {Vi does not have any of these commands} {not able to use multiple tab pages when the |+windows| feature was disabled at compile time} ============================================================================== 1. Introduction *tab-page-intro* A tab page holds one or more windows. You can easily switch between tab pages, so that you have several collections of windows to work on different things. Usually you will see a list of labels at the top of the Vim window, one for each tab page. With the mouse you can click on the label to jump to that tab page. There are other ways to move between tab pages, see below. Most commands work only in the current tab page. That includes the |CTRL-W| commands, |:windo|, |:all| and |:ball| (when not using the |:tab| modifier). The commands that are aware of other tab pages than the current one are mentioned below. Tabs are also a nice way to edit a buffer temporarily without changing the current window layout. Open a new tab page, do whatever you want to do and close the tab page. ============================================================================== 2. Commands *tab-page-commands* OPENING A NEW TAB PAGE: When starting Vim "vim -p filename ..." opens each file argument in a separate tab page (up to 'tabpagemax'). See |-p| A double click with the mouse in the non-GUI tab pages line opens a new, empty tab page. It is placed left of the position of the click. The first click may select another tab page first, causing an extra screen update. This also works in a few GUI versions, esp. Win32 and Motif. But only when clicking right of the labels. In the GUI tab pages line you can use the right mouse button to open menu. |tabline-menu|. :[count]tabe[dit] *:tabe* *:tabedit* *:tabnew* :[count]tabnew Open a new tab page with an empty window, after the current tab page. If [count] is given the new tab page appears after the tab page [count] otherwise the new tab page will appear after the current one. > :tabnew " opens tabpage after the current one :.tabnew " as above :+tabnew " opens tabpage after the next tab page " note: it is one further than :tabnew :-tabnew " opens tabpage before the current one :0tabnew " opens tabpage before the first one :$tabnew " opens tabpage after the last one :[count]tabe[dit] [++opt] [+cmd] {file} :[count]tabnew [++opt] [+cmd] {file} Open a new tab page and edit {file}, like with |:edit|. For [count] see |:tabnew| above. :[count]tabf[ind] [++opt] [+cmd] {file} *:tabf* *:tabfind* Open a new tab page and edit {file} in 'path', like with |:find|. For [count] see |:tabnew| above. {not available when the |+file_in_path| feature was disabled at compile time} :[count]tab {cmd} *:tab* Execute {cmd} and when it opens a new window open a new tab page instead. Doesn't work for |:diffsplit|, |:diffpatch|, |:execute| and |:normal|. When [count] is omitted the tab page appears after the current one. When [count] is specified the new tab page comes after tab page [count]. Use ":0tab cmd" to get the new tab page as the first one. Examples: > :tab split " opens current buffer in new tab page :tab help gt " opens tab page with help for "gt" CTRL-W gf Open a new tab page and edit the file name under the cursor. See |CTRL-W_gf|. CTRL-W gF Open a new tab page and edit the file name under the cursor and jump to the line number following the file name. See |CTRL-W_gF|. CLOSING A TAB PAGE: Closing the last window of a tab page closes the tab page too, unless there is only one tab page. Using the mouse: If the tab page line is displayed you can click in the "X" at the top right to close the current tab page. A custom |'tabline'| may show something else. *:tabc* *:tabclose* :tabc[lose][!] Close current tab page. This command fails when: - There is only one tab page on the screen. *E784* - When 'hidden' is not set, [!] is not used, a 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. > :tabclose " close the current tab page :{count}tabc[lose][!] :tabc[lose][!] {count} Close tab page {count}. Fails in the same way as `:tabclose` above. > :-tabclose " close the previous tab page :+tabclose " close the next tab page :1tabclose " close the first tab page :$tabclose " close the last tab page < *:tabo* *:tabonly* :tabo[nly][!] Close all other tab pages. 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. > :tabonly " close all tab pages except the current :{count}tabo[nly][!] Close all tab pages except the {count}th one. > :.tabonly " one :-tabonly " close all tab pages except the previous " one :+tabonly " close all tab pages except the next one :1tabonly " close all tab pages except the first one :$tabonly " close all tab pages except the last one SWITCHING TO ANOTHER TAB PAGE: Using the mouse: If the tab page line is displayed you can click in a tab page label to switch to that tab page. Click where there is no label to go to the next tab page. |'tabline'| :tabn[ext] *:tabn* *:tabnext* *gt* <C-PageDown> *CTRL-<PageDown>* *<C-PageDown>* gt *i_CTRL-<PageDown>* *i_<C-PageDown>* Go to the next tab page. Wraps around from the last to the first one. :tabn[ext] {count} {count}<C-PageDown> {count}gt Go to tab page {count}. The first tab page has number one. :tabp[revious] *:tabp* *:tabprevious* *gT* *:tabN* :tabN[ext] *:tabNext* *CTRL-<PageUp>* <C-PageUp> *<C-PageUp>* *i_CTRL-<PageUp>* *i_<C-PageUp>* gT Go to the previous tab page. Wraps around from the first one to the last one. :tabp[revious] {count} :tabN[ext] {count} {count}<C-PageUp> {count}gT Go {count} tab pages back. Wraps around from the first one to the last one. :tabr[ewind] *:tabfir* *:tabfirst* *:tabr* *:tabrewind* :tabfir[st] Go to the first tab page. *:tabl* *:tablast* :tabl[ast] Go to the last tab page. Other commands: *:tabs* :tabs List the tab pages and the windows they contain. Shows a ">" for the current window. Shows a "+" for modified buffers. REORDERING TAB PAGES: :tabm[ove] [N] *:tabm* *:tabmove* :[N]tabm[ove] Move the current tab page to after tab page N. Use zero to make the current tab page the first one. Without N the tab page is made the last one. > :.tabmove " do nothing :-tabmove " move the tab page to the left :+tabmove " move the tab page to the right :0tabmove " move the tab page to the beginning of the tab " list :tabmove 0 " as above :tabmove " move the tab page to the last :$tabmove " as above :tabmove $ " as above :tabm[ove] +[N] :tabm[ove] -[N] Move the current tab page N places to the right (with +) or to the left (with -). > :tabmove - " move the tab page to the left :tabmove -1 " as above :tabmove + " move the tab page to the right :tabmove +1 " as above Note that although it is possible to move a tab behind the N-th one by using :Ntabmove. And move it by N places by using :+Ntabmove. For clarification what +N means in this context see |[range]|. LOOPING OVER TAB PAGES: *:tabd* *:tabdo* :[range]tabd[o] {cmd} Execute {cmd} in each tab page or if [range] is given only in tab pages which tab page number is in the [range]. It works like doing this: > :tabfirst :{cmd} :tabnext :{cmd} etc. < This only operates in the current window of each tab page. When an error is detected on one tab page, further tab pages will not be visited. The last tab page (or where an error occurred) becomes the current tab page. {cmd} can contain '|' to concatenate several commands. {cmd} must not open or close tab pages or reorder them. {not in Vi} {not available when compiled without the |+listcmds| feature} Also see |:windo|, |:argdo|, |:bufdo|, |:cdo|, |:ldo|, |:cfdo| and |:lfdo| ============================================================================== 3. Other items *tab-page-other* *tabline-menu* The GUI tab pages line has a popup menu. It is accessed with a right click. The entries are: Close Close the tab page under the mouse pointer. The current one if there is no label under the mouse pointer. New Tab Open a tab page, editing an empty buffer. It appears to the left of the mouse pointer. Open Tab... Like "New Tab" and additionally use a file selector to select a file to edit. Diff mode works per tab page. You can see the diffs between several files within one tab page. Other tab pages can show differences between other files. Variables local to a tab page start with "t:". |tabpage-variable| Currently there is only one option local to a tab page: 'cmdheight'. The TabLeave and TabEnter autocommand events can be used to do something when switching from one tab page to another. The exact order depends on what you are doing. When creating a new tab page this works as if you create a new window on the same buffer and then edit another buffer. Thus ":tabnew" triggers: WinLeave leave current window TabLeave leave current tab page WinEnter enter window in new tab page TabEnter enter new tab page BufLeave leave current buffer BufEnter enter new empty buffer When switching to another tab page the order is: BufLeave WinLeave TabLeave TabEnter WinEnter BufEnter ============================================================================== 4. Setting 'tabline' *setting-tabline* The 'tabline' option specifies what the line with tab pages labels looks like. It is only used when there is no GUI tab line. You can use the 'showtabline' option to specify when you want the line with tab page labels to appear: never, when there is more than one tab page or always. The highlighting of the tab pages line is set with the groups TabLine TabLineSel and TabLineFill. |hl-TabLine| |hl-TabLineSel| |hl-TabLineFill| A "+" will be shown for a tab page that has a modified window. The number of windows in a tabpage is also shown. Thus "3+" means three windows and one of them has a modified buffer. The 'tabline' option allows you to define your preferred way to tab pages labels. This isn't easy, thus an example will be given here. For basics see the 'statusline' option. The same items can be used in the 'tabline' option. Additionally, the |tabpagebuflist()|, |tabpagenr()| and |tabpagewinnr()| functions are useful. Since the number of tab labels will vary, you need to use an expression for the whole option. Something like: > :set tabline=%!MyTabLine() Then define the MyTabLine() function to list all the tab pages labels. A convenient method is to split it in two parts: First go over all the tab pages and define labels for them. Then get the label for each tab page. > function MyTabLine() let s = '' for i in range(tabpagenr('$')) " select the highlighting if i + 1 == tabpagenr() let s .= '%#TabLineSel#' else let s .= '%#TabLine#' endif " set the tab page number (for mouse clicks) let s .= '%' . (i + 1) . 'T' " the label is made by MyTabLabel() let s .= ' %{MyTabLabel(' . (i + 1) . ')} ' endfor " after the last tab fill with TabLineFill and reset tab page nr let s .= '%#TabLineFill#%T' " right-align the label to close the current tab page if tabpagenr('$') > 1 let s .= '%=%#TabLine#%999Xclose' endif return s endfunction Now the MyTabLabel() function is called for each tab page to get its label. > function MyTabLabel(n) let buflist = tabpagebuflist(a:n) let winnr = tabpagewinnr(a:n) return bufname(buflist[winnr - 1]) endfunction This is just a simplistic example that results in a tab pages line that resembles the default, but without adding a + for a modified buffer or truncating the names. You will want to reduce the width of labels in a clever way when there is not enough room. Check the 'columns' option for the space available. ============================================================================== 5. Setting 'guitablabel' *setting-guitablabel* When the GUI tab pages line is displayed, 'guitablabel' can be used to specify the label to display for each tab page. Unlike 'tabline', which specifies the whole tab pages line at once, 'guitablabel' is used for each label separately. 'guitabtooltip' is very similar and is used for the tooltip of the same label. This only appears when the mouse pointer hovers over the label, thus it usually is longer. Only supported on some systems though. See the 'statusline' option for the format of the value. The "%N" item can be used for the current tab page number. The |v:lnum| variable is also set to this number when the option is evaluated. The items that use a file name refer to the current window of the tab page. Note that syntax highlighting is not used for the option. The %T and %X items are also ignored. A simple example that puts the tab page number and the buffer name in the label: > :set guitablabel=%N\ %f An example that resembles the default 'guitablabel': Show the number of windows in the tab page and a '+' if there is a modified buffer: > function GuiTabLabel() let label = '' let bufnrlist = tabpagebuflist(v:lnum) " Add '+' if one of the buffers in the tab page is modified for bufnr in bufnrlist if getbufvar(bufnr, "&modified") let label = '+' break endif endfor " Append the number of windows in the tab page if more than one let wincount = tabpagewinnr(v:lnum, '$') if wincount > 1 let label .= wincount endif if label != '' let label .= ' ' endif " Append the buffer name return label . bufname(bufnrlist[tabpagewinnr(v:lnum) - 1]) endfunction set guitablabel=%{GuiTabLabel()} Note that the function must be defined before setting the option, otherwise you get an error message for the function not being known. If you want to fall back to the default label, return an empty string. If you want to show something specific for a tab page, you might want to use a tab page local variable. |t:var| vim:tw=78:ts=8:ft=help:norl: �����������������������������������������������vim-7.4.1689/runtime/doc/tags�����������������������������������������������������������������������0000664�0000000�0000000�00001133704�12677030670�0015717�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������! change.txt /*!* !! change.txt /*!!* # pattern.txt /*#* $ motion.txt /*$* $HOME options.txt /*$HOME* $HOME-use version5.txt /*$HOME-use* $MYGVIMRC gui.txt /*$MYGVIMRC* $MYVIMRC starting.txt /*$MYVIMRC* $VIM starting.txt /*$VIM* $VIM-use version5.txt /*$VIM-use* $VIMRUNTIME starting.txt /*$VIMRUNTIME* $VIM_POSIX vi_diff.txt /*$VIM_POSIX* % motion.txt /*%* %:. cmdline.txt /*%:.* %:8 cmdline.txt /*%:8* %:S cmdline.txt /*%:S* %: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 /*%:~* & 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'* 'balloonexpr' options.txt /*'balloonexpr'* 'bdir' options.txt /*'bdir'* 'bdlay' options.txt /*'bdlay'* 'beautify' vi_diff.txt /*'beautify'* 'belloff' options.txt /*'belloff'* 'beval' options.txt /*'beval'* 'bex' options.txt /*'bex'* 'bexpr' options.txt /*'bexpr'* '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'* 'bo' options.txt /*'bo'* 'bomb' options.txt /*'bomb'* 'breakat' options.txt /*'breakat'* 'breakindent' options.txt /*'breakindent'* 'breakindentopt' options.txt /*'breakindentopt'* 'bri' options.txt /*'bri'* 'briopt' options.txt /*'briopt'* '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'* 'cc' options.txt /*'cc'* 'ccv' options.txt /*'ccv'* 'cd' options.txt /*'cd'* 'cdpath' options.txt /*'cdpath'* 'cedit' options.txt /*'cedit'* 'cf' options.txt /*'cf'* 'cfu' options.txt /*'cfu'* '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'* 'cm' options.txt /*'cm'* 'cmdheight' options.txt /*'cmdheight'* 'cmdwinheight' options.txt /*'cmdwinheight'* 'cmp' options.txt /*'cmp'* 'cms' options.txt /*'cms'* 'co' options.txt /*'co'* 'cocu' options.txt /*'cocu'* 'cole' options.txt /*'cole'* 'colorcolumn' options.txt /*'colorcolumn'* 'columns' options.txt /*'columns'* 'com' options.txt /*'com'* 'comments' options.txt /*'comments'* 'commentstring' options.txt /*'commentstring'* 'compatible' options.txt /*'compatible'* 'complete' options.txt /*'complete'* 'completefunc' options.txt /*'completefunc'* 'completeopt' options.txt /*'completeopt'* 'concealcursor' options.txt /*'concealcursor'* 'conceallevel' options.txt /*'conceallevel'* 'confirm' options.txt /*'confirm'* 'consk' options.txt /*'consk'* 'conskey' options.txt /*'conskey'* 'copyindent' options.txt /*'copyindent'* 'cot' options.txt /*'cot'* 'cp' options.txt /*'cp'* 'cpo' options.txt /*'cpo'* 'cpoptions' options.txt /*'cpoptions'* 'cpt' options.txt /*'cpt'* 'crb' options.txt /*'crb'* 'cryptmethod' options.txt /*'cryptmethod'* 'cscopepathcomp' options.txt /*'cscopepathcomp'* 'cscopeprg' options.txt /*'cscopeprg'* 'cscopequickfix' options.txt /*'cscopequickfix'* 'cscoperelative' options.txt /*'cscoperelative'* 'cscopetag' options.txt /*'cscopetag'* 'cscopetagorder' options.txt /*'cscopetagorder'* 'cscopeverbose' options.txt /*'cscopeverbose'* 'cspc' options.txt /*'cspc'* 'csprg' options.txt /*'csprg'* 'csqf' options.txt /*'csqf'* 'csre' options.txt /*'csre'* 'cst' options.txt /*'cst'* 'csto' options.txt /*'csto'* 'csverb' options.txt /*'csverb'* 'cuc' options.txt /*'cuc'* 'cul' options.txt /*'cul'* 'cursorbind' options.txt /*'cursorbind'* 'cursorcolumn' options.txt /*'cursorcolumn'* 'cursorline' options.txt /*'cursorline'* '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'* 'emo' options.txt /*'emo'* 'emoji' options.txt /*'emoji'* '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'* 'fex' options.txt /*'fex'* 'ff' options.txt /*'ff'* 'ffs' options.txt /*'ffs'* 'fic' options.txt /*'fic'* 'fileencoding' options.txt /*'fileencoding'* 'fileencodings' options.txt /*'fileencodings'* 'fileformat' options.txt /*'fileformat'* 'fileformats' options.txt /*'fileformats'* 'fileignorecase' options.txt /*'fileignorecase'* 'filetype' options.txt /*'filetype'* 'fillchars' options.txt /*'fillchars'* 'fixendofline' options.txt /*'fixendofline'* 'fixeol' options.txt /*'fixeol'* 'fk' options.txt /*'fk'* 'fkmap' options.txt /*'fkmap'* 'fl' vi_diff.txt /*'fl'* 'flash' vi_diff.txt /*'flash'* 'flp' options.txt /*'flp'* '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'* 'formatexpr' options.txt /*'formatexpr'* 'formatlistpat' options.txt /*'formatlistpat'* 'formatoptions' options.txt /*'formatoptions'* 'formatprg' options.txt /*'formatprg'* 'fp' options.txt /*'fp'* 'fs' options.txt /*'fs'* 'fsync' options.txt /*'fsync'* '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'* 'go-A' options.txt /*'go-A'* 'go-F' options.txt /*'go-F'* 'go-L' options.txt /*'go-L'* 'go-M' options.txt /*'go-M'* 'go-P' options.txt /*'go-P'* 'go-R' options.txt /*'go-R'* 'go-T' options.txt /*'go-T'* 'go-a' options.txt /*'go-a'* 'go-b' options.txt /*'go-b'* 'go-c' options.txt /*'go-c'* 'go-e' options.txt /*'go-e'* 'go-f' options.txt /*'go-f'* 'go-g' options.txt /*'go-g'* 'go-h' options.txt /*'go-h'* 'go-i' options.txt /*'go-i'* 'go-l' options.txt /*'go-l'* 'go-m' options.txt /*'go-m'* 'go-p' options.txt /*'go-p'* 'go-r' options.txt /*'go-r'* 'go-t' options.txt /*'go-t'* 'go-v' options.txt /*'go-v'* 'gp' options.txt /*'gp'* 'gr' vi_diff.txt /*'gr'* 'graphic' vi_diff.txt /*'graphic'* 'grepformat' options.txt /*'grepformat'* 'grepprg' options.txt /*'grepprg'* 'gtl' options.txt /*'gtl'* 'gtt' options.txt /*'gtt'* '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'* 'guitablabel' options.txt /*'guitablabel'* 'guitabtooltip' options.txt /*'guitabtooltip'* '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'* 'imactivatefunc' options.txt /*'imactivatefunc'* 'imactivatekey' options.txt /*'imactivatekey'* 'imaf' options.txt /*'imaf'* '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'* 'imsf' options.txt /*'imsf'* 'imstatusfunc' options.txt /*'imstatusfunc'* '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'* 'langnoremap' options.txt /*'langnoremap'* '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'* 'lnr' options.txt /*'lnr'* 'loadplugins' options.txt /*'loadplugins'* 'lpl' options.txt /*'lpl'* 'ls' options.txt /*'ls'* 'lsp' options.txt /*'lsp'* 'luadll' options.txt /*'luadll'* 'lw' options.txt /*'lw'* 'lz' options.txt /*'lz'* 'ma' options.txt /*'ma'* 'macatsui' options.txt /*'macatsui'* 'magic' options.txt /*'magic'* 'makeef' options.txt /*'makeef'* 'makeprg' options.txt /*'makeprg'* 'mat' options.txt /*'mat'* 'matchpairs' options.txt /*'matchpairs'* 'matchtime' options.txt /*'matchtime'* 'maxcombine' options.txt /*'maxcombine'* 'maxfuncdepth' options.txt /*'maxfuncdepth'* 'maxmapdepth' options.txt /*'maxmapdepth'* 'maxmem' options.txt /*'maxmem'* 'maxmempattern' options.txt /*'maxmempattern'* 'maxmemtot' options.txt /*'maxmemtot'* 'mco' options.txt /*'mco'* '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'* 'mkspellmem' options.txt /*'mkspellmem'* 'ml' options.txt /*'ml'* 'mls' options.txt /*'mls'* 'mm' options.txt /*'mm'* 'mmd' options.txt /*'mmd'* 'mmp' options.txt /*'mmp'* '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'* 'msm' options.txt /*'msm'* 'mzq' options.txt /*'mzq'* 'mzquantum' options.txt /*'mzquantum'* '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'* 'nobreakindent' options.txt /*'nobreakindent'* 'nobri' options.txt /*'nobri'* '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'* 'nocrb' options.txt /*'nocrb'* 'nocscoperelative' options.txt /*'nocscoperelative'* 'nocscopetag' options.txt /*'nocscopetag'* 'nocscopeverbose' options.txt /*'nocscopeverbose'* 'nocsre' options.txt /*'nocsre'* 'nocst' options.txt /*'nocst'* 'nocsverb' options.txt /*'nocsverb'* 'nocuc' options.txt /*'nocuc'* 'nocul' options.txt /*'nocul'* 'nocursorbind' options.txt /*'nocursorbind'* 'nocursorcolumn' options.txt /*'nocursorcolumn'* 'nocursorline' options.txt /*'nocursorline'* 'nodeco' options.txt /*'nodeco'* 'nodelcombine' options.txt /*'nodelcombine'* 'nodg' options.txt /*'nodg'* 'nodiff' options.txt /*'nodiff'* 'nodigraph' options.txt /*'nodigraph'* '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'* 'nofic' options.txt /*'nofic'* 'nofileignorecase' options.txt /*'nofileignorecase'* 'nofixendofline' options.txt /*'nofixendofline'* 'nofixeol' options.txt /*'nofixeol'* 'nofk' options.txt /*'nofk'* 'nofkmap' options.txt /*'nofkmap'* 'nofoldenable' options.txt /*'nofoldenable'* 'nofs' options.txt /*'nofs'* 'nofsync' options.txt /*'nofsync'* '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'* 'noimdisable' options.txt /*'noimdisable'* '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'* 'nolangnoremap' options.txt /*'nolangnoremap'* 'nolazyredraw' options.txt /*'nolazyredraw'* 'nolbr' options.txt /*'nolbr'* 'nolinebreak' options.txt /*'nolinebreak'* 'nolisp' options.txt /*'nolisp'* 'nolist' options.txt /*'nolist'* 'nolnr' options.txt /*'nolnr'* 'noloadplugins' options.txt /*'noloadplugins'* 'nolpl' options.txt /*'nolpl'* 'nolz' options.txt /*'nolz'* 'noma' options.txt /*'noma'* 'nomacatsui' options.txt /*'nomacatsui'* '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'* 'noodev' options.txt /*'noodev'* 'noopendevice' options.txt /*'noopendevice'* 'nopaste' options.txt /*'nopaste'* 'nopi' options.txt /*'nopi'* 'nopreserveindent' options.txt /*'nopreserveindent'* 'nopreviewwindow' options.txt /*'nopreviewwindow'* 'noprompt' options.txt /*'noprompt'* 'nopvw' options.txt /*'nopvw'* 'noreadonly' options.txt /*'noreadonly'* 'norelativenumber' options.txt /*'norelativenumber'* 'noremap' options.txt /*'noremap'* 'norestorescreen' options.txt /*'norestorescreen'* 'norevins' options.txt /*'norevins'* 'nori' options.txt /*'nori'* 'norightleft' options.txt /*'norightleft'* 'norl' options.txt /*'norl'* 'nornu' options.txt /*'nornu'* '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'* 'noshelltemp' options.txt /*'noshelltemp'* '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'* 'nospell' options.txt /*'nospell'* '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'* 'nostmp' options.txt /*'nostmp'* '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'* 'noudf' options.txt /*'noudf'* 'noundofile' options.txt /*'noundofile'* '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'* 'nowfw' options.txt /*'nowfw'* 'nowic' options.txt /*'nowic'* 'nowildignorecase' options.txt /*'nowildignorecase'* 'nowildmenu' options.txt /*'nowildmenu'* 'nowinfixheight' options.txt /*'nowinfixheight'* 'nowinfixwidth' options.txt /*'nowinfixwidth'* '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'* 'numberwidth' options.txt /*'numberwidth'* 'nuw' options.txt /*'nuw'* 'odev' options.txt /*'odev'* 'oft' options.txt /*'oft'* 'ofu' options.txt /*'ofu'* 'omnifunc' options.txt /*'omnifunc'* 'op' vi_diff.txt /*'op'* 'open' vi_diff.txt /*'open'* 'opendevice' options.txt /*'opendevice'* 'operatorfunc' options.txt /*'operatorfunc'* 'opfunc' options.txt /*'opfunc'* 'optimize' vi_diff.txt /*'optimize'* 'option' intro.txt /*'option'* 'osfiletype' options.txt /*'osfiletype'* 'pa' options.txt /*'pa'* 'packpath' options.txt /*'packpath'* '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'* 'perldll' options.txt /*'perldll'* 'pex' options.txt /*'pex'* 'pexpr' options.txt /*'pexpr'* 'pfn' options.txt /*'pfn'* 'ph' options.txt /*'ph'* 'pheader' options.txt /*'pheader'* 'pi' options.txt /*'pi'* 'pm' options.txt /*'pm'* 'pmbcs' options.txt /*'pmbcs'* 'pmbfn' options.txt /*'pmbfn'* 'popt' options.txt /*'popt'* 'pp' options.txt /*'pp'* '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'* 'printmbcharset' options.txt /*'printmbcharset'* 'printmbfont' options.txt /*'printmbfont'* 'printoptions' options.txt /*'printoptions'* 'prompt' options.txt /*'prompt'* 'pt' options.txt /*'pt'* 'pumheight' options.txt /*'pumheight'* 'pvh' options.txt /*'pvh'* 'pvw' options.txt /*'pvw'* 'pythondll' options.txt /*'pythondll'* 'pythonthreedll' options.txt /*'pythonthreedll'* 'qe' options.txt /*'qe'* 'quote motion.txt /*'quote* 'quoteescape' options.txt /*'quoteescape'* 'rdt' options.txt /*'rdt'* 're' options.txt /*'re'* 'readonly' options.txt /*'readonly'* 'redraw' vi_diff.txt /*'redraw'* 'redrawtime' options.txt /*'redrawtime'* 'regexpengine' options.txt /*'regexpengine'* 'relativenumber' options.txt /*'relativenumber'* 'remap' options.txt /*'remap'* 'renderoptions' options.txt /*'renderoptions'* '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'* 'rnu' options.txt /*'rnu'* 'ro' options.txt /*'ro'* 'rop' options.txt /*'rop'* 'rs' options.txt /*'rs'* 'rtp' options.txt /*'rtp'* 'ru' options.txt /*'ru'* 'rubydll' options.txt /*'rubydll'* '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'* 'shelltemp' options.txt /*'shelltemp'* 'shelltype' options.txt /*'shelltype'* 'shellxescape' options.txt /*'shellxescape'* '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'* 'showtabline' options.txt /*'showtabline'* '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'* 'smc' options.txt /*'smc'* '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'* 'spc' options.txt /*'spc'* 'spell' options.txt /*'spell'* 'spellcapcheck' options.txt /*'spellcapcheck'* 'spellfile' options.txt /*'spellfile'* 'spelllang' options.txt /*'spelllang'* 'spellsuggest' options.txt /*'spellsuggest'* 'spf' options.txt /*'spf'* 'spl' options.txt /*'spl'* 'splitbelow' options.txt /*'splitbelow'* 'splitright' options.txt /*'splitright'* 'spr' options.txt /*'spr'* 'sps' options.txt /*'sps'* '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'* 'stal' options.txt /*'stal'* 'startofline' options.txt /*'startofline'* 'statusline' options.txt /*'statusline'* 'stl' options.txt /*'stl'* 'stmp' options.txt /*'stmp'* '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'* 'sxe' options.txt /*'sxe'* 'sxq' options.txt /*'sxq'* 'syn' options.txt /*'syn'* 'synmaxcol' options.txt /*'synmaxcol'* '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_Ce' term.txt /*'t_Ce'* 't_Co' term.txt /*'t_Co'* 't_Cs' term.txt /*'t_Cs'* 't_DL' term.txt /*'t_DL'* 't_EI' term.txt /*'t_EI'* '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_RB' term.txt /*'t_RB'* 't_RI' term.txt /*'t_RI'* 't_RV' term.txt /*'t_RV'* 't_SI' term.txt /*'t_SI'* 't_SR' term.txt /*'t_SR'* '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_u7' term.txt /*'t_u7'* '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_xn' term.txt /*'t_xn'* 't_xs' term.txt /*'t_xs'* 'ta' options.txt /*'ta'* 'tabline' options.txt /*'tabline'* 'tabpagemax' options.txt /*'tabpagemax'* 'tabstop' options.txt /*'tabstop'* 'tag' options.txt /*'tag'* 'tagbsearch' options.txt /*'tagbsearch'* 'tagcase' options.txt /*'tagcase'* 'taglength' options.txt /*'taglength'* 'tagrelative' options.txt /*'tagrelative'* 'tags' options.txt /*'tags'* 'tagstack' options.txt /*'tagstack'* 'tal' options.txt /*'tal'* 'tb' options.txt /*'tb'* 'tbi' options.txt /*'tbi'* 'tbidi' options.txt /*'tbidi'* 'tbis' options.txt /*'tbis'* 'tbs' options.txt /*'tbs'* 'tc' options.txt /*'tc'* 'tcldll' options.txt /*'tcldll'* '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'* 'tpm' options.txt /*'tpm'* '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'* 'udf' options.txt /*'udf'* 'udir' options.txt /*'udir'* 'ul' options.txt /*'ul'* 'undodir' options.txt /*'undodir'* 'undofile' options.txt /*'undofile'* 'undolevels' options.txt /*'undolevels'* 'undoreload' options.txt /*'undoreload'* 'updatecount' options.txt /*'updatecount'* 'updatetime' options.txt /*'updatetime'* 'ur' options.txt /*'ur'* 'ut' options.txt /*'ut'* 'vb' options.txt /*'vb'* 'vbs' options.txt /*'vbs'* 'vdir' options.txt /*'vdir'* 've' options.txt /*'ve'* 'verbose' options.txt /*'verbose'* 'verbosefile' options.txt /*'verbosefile'* 'vfile' options.txt /*'vfile'* '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'* 'wfw' options.txt /*'wfw'* 'wh' options.txt /*'wh'* 'whichwrap' options.txt /*'whichwrap'* 'wi' options.txt /*'wi'* 'wic' options.txt /*'wic'* 'wig' options.txt /*'wig'* 'wildchar' options.txt /*'wildchar'* 'wildcharm' options.txt /*'wildcharm'* 'wildignore' options.txt /*'wildignore'* 'wildignorecase' options.txt /*'wildignorecase'* 'wildmenu' options.txt /*'wildmenu'* 'wildmode' options.txt /*'wildmode'* 'wildoptions' options.txt /*'wildoptions'* 'wim' options.txt /*'wim'* 'winaltkeys' options.txt /*'winaltkeys'* 'window' options.txt /*'window'* 'winfixheight' options.txt /*'winfixheight'* 'winfixwidth' options.txt /*'winfixwidth'* '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'* 'wop' options.txt /*'wop'* '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 /*+* ++bad editing.txt /*++bad* ++bin editing.txt /*++bin* ++builtin_terms various.txt /*++builtin_terms* ++edit editing.txt /*++edit* ++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_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* +acl various.txt /*+acl* +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* +channel various.txt /*+channel* +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* +conceal various.txt /*+conceal* +cryptv various.txt /*+cryptv* +cscope various.txt /*+cscope* +cursorbind various.txt /*+cursorbind* +cursorshape various.txt /*+cursorshape* +debug various.txt /*+debug* +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* +directx various.txt /*+directx* +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* +float various.txt /*+float* +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* +iconv/dyn various.txt /*+iconv\/dyn* +insert_expand various.txt /*+insert_expand* +job various.txt /*+job* +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* +lua various.txt /*+lua* +lua/dyn various.txt /*+lua\/dyn* +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_jsbterm various.txt /*+mouse_jsbterm* +mouse_netterm various.txt /*+mouse_netterm* +mouse_pterm various.txt /*+mouse_pterm* +mouse_sgr various.txt /*+mouse_sgr* +mouse_sysmouse various.txt /*+mouse_sysmouse* +mouse_urxvt various.txt /*+mouse_urxvt* +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* +mzscheme various.txt /*+mzscheme* +mzscheme/dyn various.txt /*+mzscheme\/dyn* +netbeans_intg various.txt /*+netbeans_intg* +ole various.txt /*+ole* +path_extra various.txt /*+path_extra* +perl various.txt /*+perl* +perl/dyn various.txt /*+perl\/dyn* +persistent_undo various.txt /*+persistent_undo* +postscript various.txt /*+postscript* +printer various.txt /*+printer* +profile various.txt /*+profile* +python various.txt /*+python* +python/dyn various.txt /*+python\/dyn* +python3 various.txt /*+python3* +python3/dyn various.txt /*+python3\/dyn* +quickfix various.txt /*+quickfix* +reltime various.txt /*+reltime* +rightleft various.txt /*+rightleft* +ruby various.txt /*+ruby* +ruby/dyn various.txt /*+ruby\/dyn* +scrollbind various.txt /*+scrollbind* +signs various.txt /*+signs* +smartindent various.txt /*+smartindent* +startuptime various.txt /*+startuptime* +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* +tcl/dyn various.txt /*+tcl\/dyn* +terminfo various.txt /*+terminfo* +termresponse various.txt /*+termresponse* +textobjects various.txt /*+textobjects* +tgetent various.txt /*+tgetent* +timers various.txt /*+timers* +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* +xpm various.txt /*+xpm* +xpm_w32 various.txt /*+xpm_w32* +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* --not-a-term starting.txt /*--not-a-term* --remote remote.txt /*--remote* --remote-expr remote.txt /*--remote-expr* --remote-send remote.txt /*--remote-send* --remote-silent remote.txt /*--remote-silent* --remote-tab remote.txt /*--remote-tab* --remote-tab-silent remote.txt /*--remote-tab-silent* --remote-tab-wait remote.txt /*--remote-tab-wait* --remote-tab-wait-silent remote.txt /*--remote-tab-wait-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* --startuptime starting.txt /*--startuptime* --version starting.txt /*--version* --windowid starting.txt /*--windowid* -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* -p starting.txt /*-p* -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 /*.* ... eval.txt /*...* .Xdefaults gui_x11.txt /*.Xdefaults* .aff spell.txt /*.aff* .dic spell.txt /*.dic* .exrc starting.txt /*.exrc* .gvimrc gui.txt /*.gvimrc* .netrwbook pi_netrw.txt /*.netrwbook* .netrwhist pi_netrw.txt /*.netrwhist* .vimrc starting.txt /*.vimrc* / pattern.txt /*\/* /$ pattern.txt /*\/$* /. pattern.txt /*\/.* // version7.txt /*\/\/* //; pattern.txt /*\/\/;* /<CR> pattern.txt /*\/<CR>* /[[. pattern.txt /*\/[[.* /[[= pattern.txt /*\/[[=* /[\n] pattern.txt /*\/[\\n]* /[] pattern.txt /*\/[]* /\ pattern.txt /*\/\\* /\$ pattern.txt /*\/\\$* /\%# pattern.txt /*\/\\%#* /\%#= pattern.txt /*\/\\%#=* /\%$ pattern.txt /*\/\\%$* /\%'m pattern.txt /*\/\\%'m* /\%( pattern.txt /*\/\\%(* /\%(\) pattern.txt /*\/\\%(\\)* /\%<'m pattern.txt /*\/\\%<'m* /\%<c pattern.txt /*\/\\%<c* /\%<l pattern.txt /*\/\\%<l* /\%<v pattern.txt /*\/\\%<v* /\%>'m pattern.txt /*\/\\%>'m* /\%>c pattern.txt /*\/\\%>c* /\%>l pattern.txt /*\/\\%>l* /\%>v pattern.txt /*\/\\%>v* /\%C pattern.txt /*\/\\%C* /\%U pattern.txt /*\/\\%U* /\%V pattern.txt /*\/\\%V* /\%[] pattern.txt /*\/\\%[]* /\%^ pattern.txt /*\/\\%^* /\%c pattern.txt /*\/\\%c* /\%d pattern.txt /*\/\\%d* /\%l pattern.txt /*\/\\%l* /\%o pattern.txt /*\/\\%o* /\%u pattern.txt /*\/\\%u* /\%v pattern.txt /*\/\\%v* /\%x pattern.txt /*\/\\%x* /\& 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* /character-classes pattern.txt /*\/character-classes* /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* 05.8 usr_05.txt /*05.8* 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* 08.9 usr_08.txt /*08.9* 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* 1gD pattern.txt /*1gD* 1gd pattern.txt /*1gd* 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* 32.1 usr_32.txt /*32.1* 32.2 usr_32.txt /*32.2* 32.3 usr_32.txt /*32.3* 32.4 usr_32.txt /*32.4* 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.13 usr_41.txt /*41.13* 41.14 usr_41.txt /*41.14* 41.15 usr_41.txt /*41.15* 41.16 usr_41.txt /*41.16* 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* 8g8 various.txt /*8g8* 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 /*:#* :#! various.txt /*:#!* :$ cmdline.txt /*:$* :% cmdline.txt /*:%* :& change.txt /*:&* :' cmdline.txt /*:'* :, cmdline.txt /*:,* :. cmdline.txt /*:.* :/ cmdline.txt /*:\/* :0file editing.txt /*:0file* :2match pattern.txt /*:2match* :3match pattern.txt /*:3match* ::. cmdline.txt /*::.* ::8 cmdline.txt /*::8* ::S cmdline.txt /*::S* ::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 /*:@@* :AdaLines ft_ada.txt /*:AdaLines* :AdaRainbow ft_ada.txt /*:AdaRainbow* :AdaSpaces ft_ada.txt /*:AdaSpaces* :AdaTagDir ft_ada.txt /*:AdaTagDir* :AdaTagFile ft_ada.txt /*:AdaTagFile* :AdaTypes ft_ada.txt /*:AdaTypes* :CompilerSet usr_41.txt /*:CompilerSet* :DiffOrig diff.txt /*:DiffOrig* :DoMatchParen pi_paren.txt /*:DoMatchParen* :ELP pi_logipat.txt /*:ELP* :Explore pi_netrw.txt /*:Explore* :GLVS pi_getscript.txt /*:GLVS* :GetLatestVimScripts_dat pi_getscript.txt /*:GetLatestVimScripts_dat* :GnatFind ft_ada.txt /*:GnatFind* :GnatPretty ft_ada.txt /*:GnatPretty* :GnatTags ft_ada.txt /*:GnatTags* :Hexplore pi_netrw.txt /*:Hexplore* :LP pi_logipat.txt /*:LP* :LPF pi_logipat.txt /*:LPF* :Lexplore pi_netrw.txt /*:Lexplore* :LogiPat pi_logipat.txt /*:LogiPat* :Man filetype.txt /*:Man* :MkVimball pi_vimball.txt /*:MkVimball* :N editing.txt /*:N* :NetrwClean pi_netrw.txt /*:NetrwClean* :Nexplore pi_netrw.txt /*:Nexplore* :Next editing.txt /*:Next* :NoMatchParen pi_paren.txt /*:NoMatchParen* :Nr pi_netrw.txt /*:Nr* :Nread pi_netrw.txt /*:Nread* :Ns pi_netrw.txt /*:Ns* :Nsource pi_netrw.txt /*:Nsource* :Ntree pi_netrw.txt /*:Ntree* :Nw pi_netrw.txt /*:Nw* :Nwrite pi_netrw.txt /*:Nwrite* :P various.txt /*:P* :Pexplore pi_netrw.txt /*:Pexplore* :Print various.txt /*:Print* :Rexplore pi_netrw.txt /*:Rexplore* :RmVimball pi_vimball.txt /*:RmVimball* :Sexplore pi_netrw.txt /*:Sexplore* :TOhtml syntax.txt /*:TOhtml* :TarDiff pi_tar.txt /*:TarDiff* :Texplore pi_netrw.txt /*:Texplore* :UseVimball pi_vimball.txt /*:UseVimball* :Vexplore pi_netrw.txt /*:Vexplore* :VimballList pi_vimball.txt /*:VimballList* :Vimuntar pi_tar.txt /*:Vimuntar* :X editing.txt /*:X* :XMLent insert.txt /*:XMLent* :XMLns insert.txt /*:XMLns* :[range] motion.txt /*:[range]* :\bar cmdline.txt /*:\\bar* :_! cmdline.txt /*:_!* :_# cmdline.txt /*:_#* :_## cmdline.txt /*:_##* :_#0 cmdline.txt /*:_#0* :_#< cmdline.txt /*:_#<* :_#n cmdline.txt /*:_#n* :_% 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* :abbreviate-verbose map.txt /*:abbreviate-verbose* :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* :autocmd-verbose autocmd.txt /*:autocmd-verbose* :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* :cad quickfix.txt /*:cad* :caddbuffer quickfix.txt /*:caddbuffer* :cadde quickfix.txt /*:cadde* :caddexpr quickfix.txt /*:caddexpr* :caddf quickfix.txt /*:caddf* :caddfile quickfix.txt /*:caddfile* :cal eval.txt /*:cal* :call eval.txt /*:call* :cat eval.txt /*:cat* :catch eval.txt /*:catch* :cb quickfix.txt /*:cb* :cbuffer quickfix.txt /*:cbuffer* :cc quickfix.txt /*:cc* :ccl quickfix.txt /*:ccl* :cclose quickfix.txt /*:cclose* :cd editing.txt /*:cd* :cd- editing.txt /*:cd-* :cdo quickfix.txt /*:cdo* :ce change.txt /*:ce* :center change.txt /*:center* :cex quickfix.txt /*:cex* :cexpr quickfix.txt /*:cexpr* :cf quickfix.txt /*:cf* :cfdo quickfix.txt /*:cfdo* :cfile quickfix.txt /*:cfile* :cfir quickfix.txt /*:cfir* :cfirst quickfix.txt /*:cfirst* :cg quickfix.txt /*:cg* :cgetb quickfix.txt /*:cgetb* :cgetbuffer quickfix.txt /*:cgetbuffer* :cgete quickfix.txt /*:cgete* :cgetexpr quickfix.txt /*:cgetexpr* :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-addr map.txt /*:command-addr* :command-bang map.txt /*:command-bang* :command-bar map.txt /*:command-bar* :command-buffer map.txt /*:command-buffer* :command-complete map.txt /*:command-complete* :command-completion map.txt /*:command-completion* :command-completion-custom map.txt /*:command-completion-custom* :command-completion-customlist map.txt /*:command-completion-customlist* :command-count map.txt /*:command-count* :command-nargs map.txt /*:command-nargs* :command-range map.txt /*:command-range* :command-register map.txt /*:command-register* :command-verbose map.txt /*:command-verbose* :comment cmdline.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* :debug-name repeat.txt /*:debug-name* :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* :delm motion.txt /*:delm* :delmarks motion.txt /*:delmarks* :di change.txt /*:di* :dif diff.txt /*:dif* :diffg diff.txt /*:diffg* :diffget diff.txt /*:diffget* :diffo diff.txt /*:diffo* :diffoff diff.txt /*:diffoff* :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* :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 change.txt /*:dl* :dli tagsrch.txt /*:dli* :dlist tagsrch.txt /*:dlist* :do autocmd.txt /*:do* :doau autocmd.txt /*:doau* :doautoa autocmd.txt /*:doautoa* :doautoall autocmd.txt /*:doautoall* :doautocmd autocmd.txt /*:doautocmd* :dp change.txt /*:dp* :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* :ea undo.txt /*:ea* :earlier undo.txt /*:earlier* :ec eval.txt /*:ec* :echo eval.txt /*:echo* :echo-redraw eval.txt /*:echo-redraw* :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* :endfo eval.txt /*:endfo* :endfor eval.txt /*:endfor* :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* :exe-comment eval.txt /*:exe-comment* :execute eval.txt /*:execute* :exi editing.txt /*:exi* :exit editing.txt /*:exit* :exu helphelp.txt /*:exu* :exusage helphelp.txt /*:exusage* :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* :for eval.txt /*:for* :fu eval.txt /*:fu* :func-abort eval.txt /*:func-abort* :func-dict eval.txt /*:func-dict* :func-range eval.txt /*:func-range* :function eval.txt /*:function* :function-verbose eval.txt /*:function-verbose* :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 helphelp.txt /*:h* :ha print.txt /*:ha* :hardcopy print.txt /*:hardcopy* :help helphelp.txt /*:help* :helpc helphelp.txt /*:helpc* :helpclose helphelp.txt /*:helpclose* :helpf helphelp.txt /*:helpf* :helpfind helphelp.txt /*:helpfind* :helpg helphelp.txt /*:helpg* :helpgrep helphelp.txt /*:helpgrep* :helpt helphelp.txt /*:helpt* :helptags helphelp.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* :highlight-verbose syntax.txt /*:highlight-verbose* :his cmdline.txt /*:his* :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* :keepa editing.txt /*:keepa* :keepalt editing.txt /*:keepalt* :keepj motion.txt /*:keepj* :keepjumps motion.txt /*:keepjumps* :keepmarks motion.txt /*:keepmarks* :keepp cmdline.txt /*:keepp* :keeppatterns cmdline.txt /*:keeppatterns* :l various.txt /*:l* :lN quickfix.txt /*:lN* :lNext quickfix.txt /*:lNext* :lNf quickfix.txt /*:lNf* :lNfile quickfix.txt /*:lNfile* :la editing.txt /*:la* :lad quickfix.txt /*:lad* :laddb quickfix.txt /*:laddb* :laddbuffer quickfix.txt /*:laddbuffer* :laddexpr quickfix.txt /*:laddexpr* :laddf quickfix.txt /*:laddf* :laddfile quickfix.txt /*:laddfile* :lan mlang.txt /*:lan* :lang mlang.txt /*:lang* :language mlang.txt /*:language* :last editing.txt /*:last* :lat undo.txt /*:lat* :later undo.txt /*:later* :lb quickfix.txt /*:lb* :lbuffer quickfix.txt /*:lbuffer* :lc editing.txt /*:lc* :lcd editing.txt /*:lcd* :lch editing.txt /*:lch* :lchdir editing.txt /*:lchdir* :lcl quickfix.txt /*:lcl* :lclose quickfix.txt /*:lclose* :lcs if_cscop.txt /*:lcs* :lcscope if_cscop.txt /*:lcscope* :ldo quickfix.txt /*:ldo* :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-& 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-unpack eval.txt /*:let-unpack* :let.= eval.txt /*:let.=* :lex quickfix.txt /*:lex* :lexpr quickfix.txt /*:lexpr* :lf quickfix.txt /*:lf* :lfdo quickfix.txt /*:lfdo* :lfile quickfix.txt /*:lfile* :lfir quickfix.txt /*:lfir* :lfirst quickfix.txt /*:lfirst* :lg quickfix.txt /*:lg* :lgetb quickfix.txt /*:lgetb* :lgetbuffer quickfix.txt /*:lgetbuffer* :lgete quickfix.txt /*:lgete* :lgetexpr quickfix.txt /*:lgetexpr* :lgetfile quickfix.txt /*:lgetfile* :lgr quickfix.txt /*:lgr* :lgrep quickfix.txt /*:lgrep* :lgrepa quickfix.txt /*:lgrepa* :lgrepadd quickfix.txt /*:lgrepadd* :lh helphelp.txt /*:lh* :lhelpgrep helphelp.txt /*:lhelpgrep* :list various.txt /*:list* :ll quickfix.txt /*:ll* :lla quickfix.txt /*:lla* :llast quickfix.txt /*:llast* :lli quickfix.txt /*:lli* :llist quickfix.txt /*:llist* :lm map.txt /*:lm* :lmak quickfix.txt /*:lmak* :lmake quickfix.txt /*:lmake* :lmap map.txt /*:lmap* :lmap_l map.txt /*:lmap_l* :lmapc map.txt /*:lmapc* :lmapclear map.txt /*:lmapclear* :ln map.txt /*:ln* :lne quickfix.txt /*:lne* :lnew quickfix.txt /*:lnew* :lnewer quickfix.txt /*:lnewer* :lnext quickfix.txt /*:lnext* :lnf quickfix.txt /*:lnf* :lnfile quickfix.txt /*:lnfile* :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* :lockv eval.txt /*:lockv* :lockvar eval.txt /*:lockvar* :lol quickfix.txt /*:lol* :lolder quickfix.txt /*:lolder* :lop quickfix.txt /*:lop* :lopen quickfix.txt /*:lopen* :lp quickfix.txt /*:lp* :lpf quickfix.txt /*:lpf* :lpfile quickfix.txt /*:lpfile* :lprevious quickfix.txt /*:lprevious* :lr quickfix.txt /*:lr* :lrewind quickfix.txt /*:lrewind* :ls windows.txt /*:ls* :lt tagsrch.txt /*:lt* :ltag tagsrch.txt /*:ltag* :lu map.txt /*:lu* :lua if_lua.txt /*:lua* :luado if_lua.txt /*:luado* :luafile if_lua.txt /*:luafile* :lunmap map.txt /*:lunmap* :lv quickfix.txt /*:lv* :lvimgrep quickfix.txt /*:lvimgrep* :lvimgrepa quickfix.txt /*:lvimgrepa* :lvimgrepadd quickfix.txt /*:lvimgrepadd* :lw quickfix.txt /*:lw* :lwindow quickfix.txt /*:lwindow* :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-<expr> map.txt /*:map-<expr>* :map-<nowait> map.txt /*:map-<nowait>* :map-<script> map.txt /*:map-<script>* :map-<silent> map.txt /*:map-<silent>* :map-<special> map.txt /*:map-<special>* :map-<unique> map.txt /*:map-<unique>* :map-alt-keys map.txt /*:map-alt-keys* :map-arguments map.txt /*:map-arguments* :map-commands map.txt /*:map-commands* :map-expression map.txt /*:map-expression* :map-local map.txt /*:map-local* :map-modes map.txt /*:map-modes* :map-nowait map.txt /*:map-nowait* :map-operator map.txt /*:map-operator* :map-script map.txt /*:map-script* :map-silent map.txt /*:map-silent* :map-special map.txt /*:map-special* :map-special-chars map.txt /*:map-special-chars* :map-special-keys map.txt /*:map-special-keys* :map-undo map.txt /*:map-undo* :map-verbose map.txt /*:map-verbose* :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-<special> gui.txt /*:menu-<special>* :menu-disable gui.txt /*:menu-disable* :menu-enable gui.txt /*:menu-enable* :menu-script gui.txt /*:menu-script* :menu-silent gui.txt /*:menu-silent* :menu-special gui.txt /*:menu-special* :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* :mksp spell.txt /*:mksp* :mkspell spell.txt /*:mkspell* :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* :mz if_mzsch.txt /*:mz* :mzf if_mzsch.txt /*:mzf* :mzfile if_mzsch.txt /*:mzfile* :mzscheme if_mzsch.txt /*:mzscheme* :n editing.txt /*:n* :nbclose netbeans.txt /*:nbclose* :nbkey netbeans.txt /*:nbkey* :nbstart netbeans.txt /*:nbstart* :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!* :noa autocmd.txt /*:noa* :noautocmd autocmd.txt /*:noautocmd* :noh pattern.txt /*:noh* :nohlsearch pattern.txt /*:nohlsearch* :nor map.txt /*:nor* :nore map.txt /*:nore* :norea map.txt /*:norea* :noreabbrev map.txt /*:noreabbrev* :norem map.txt /*:norem* :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* :nos recover.txt /*:nos* :noswapfile recover.txt /*:noswapfile* :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* :ol starting.txt /*:ol* :oldfiles starting.txt /*:oldfiles* :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* :ownsyntax syntax.txt /*:ownsyntax* :p various.txt /*:p* :pa repeat.txt /*:pa* :packadd repeat.txt /*:packadd* :packl repeat.txt /*:packl* :packloadall repeat.txt /*:packloadall* :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* :prof repeat.txt /*:prof* :profd repeat.txt /*:profd* :profdel repeat.txt /*:profdel* :profile repeat.txt /*:profile* :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* :py3 if_pyth.txt /*:py3* :py3do if_pyth.txt /*:py3do* :py3file if_pyth.txt /*:py3file* :pydo if_pyth.txt /*:pydo* :pyf if_pyth.txt /*:pyf* :pyfile if_pyth.txt /*:pyfile* :python if_pyth.txt /*:python* :python3 if_pyth.txt /*:python3* :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* :recover-crypt recover.txt /*:recover-crypt* :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* :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* :rundo undo.txt /*:rundo* :runtime repeat.txt /*:runtime* :rv starting.txt /*:rv* :rviminfo starting.txt /*:rviminfo* :s change.txt /*:s* :s% change.txt /*:s%* :sI change.txt /*:sI* :sIc change.txt /*:sIc* :sIe change.txt /*:sIe* :sIg change.txt /*:sIg* :sIl change.txt /*:sIl* :sIn change.txt /*:sIn* :sIp change.txt /*:sIp* :sIr change.txt /*:sIr* :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* :san eval.txt /*:san* :sandbox eval.txt /*:sandbox* :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* :sc change.txt /*:sc* :scI change.txt /*:scI* :sce change.txt /*:sce* :scg change.txt /*:scg* :sci change.txt /*:sci* :scl change.txt /*:scl* :scp change.txt /*:scp* :scr repeat.txt /*:scr* :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-& 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-inv options.txt /*:set-inv* :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* :sg change.txt /*:sg* :sgI change.txt /*:sgI* :sgc change.txt /*:sgc* :sge change.txt /*:sge* :sgi change.txt /*:sgi* :sgl change.txt /*:sgl* :sgn change.txt /*:sgn* :sgp change.txt /*:sgp* :sgr change.txt /*:sgr* :sh various.txt /*:sh* :shell various.txt /*:shell* :si change.txt /*:si* :sic change.txt /*:sic* :sie change.txt /*:sie* :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-place-list sign.txt /*:sign-place-list* :sign-undefine sign.txt /*:sign-undefine* :sign-unplace sign.txt /*:sign-unplace* :sil various.txt /*:sil* :silent various.txt /*:silent* :silent! various.txt /*:silent!* :sim gui_w32.txt /*:sim* :simalt gui_w32.txt /*:simalt* :sin change.txt /*:sin* :sip change.txt /*:sip* :sir change.txt /*:sir* :sl various.txt /*:sl* :sla windows.txt /*:sla* :slast windows.txt /*:slast* :sleep various.txt /*:sleep* :sm change.txt /*:sm* :smagic change.txt /*:smagic* :smap map.txt /*:smap* :smap_l map.txt /*:smap_l* :smapc map.txt /*:smapc* :smapclear map.txt /*:smapclear* :sme gui.txt /*:sme* :smenu gui.txt /*:smenu* :smile index.txt /*:smile* :sn windows.txt /*:sn* :snext windows.txt /*:snext* :sno change.txt /*:sno* :snomagic change.txt /*:snomagic* :snor map.txt /*:snor* :snoremap map.txt /*:snoremap* :snoreme gui.txt /*:snoreme* :snoremenu gui.txt /*:snoremenu* :so repeat.txt /*:so* :sor change.txt /*:sor* :sort change.txt /*:sort* :source repeat.txt /*:source* :source_crnl repeat.txt /*:source_crnl* :sp windows.txt /*:sp* :spe spell.txt /*:spe* :spelld spell.txt /*:spelld* :spelldump spell.txt /*:spelldump* :spellgood spell.txt /*:spellgood* :spelli spell.txt /*:spelli* :spellinfo spell.txt /*:spellinfo* :spellr spell.txt /*:spellr* :spellrepall spell.txt /*:spellrepall* :spellu spell.txt /*:spellu* :spellundo spell.txt /*:spellundo* :spellw spell.txt /*:spellw* :spellwrong spell.txt /*:spellwrong* :split windows.txt /*:split* :split_f windows.txt /*:split_f* :spr windows.txt /*:spr* :sprevious windows.txt /*:sprevious* :sr change.txt /*:sr* :srI change.txt /*:srI* :src change.txt /*:src* :sre windows.txt /*:sre* :srewind windows.txt /*:srewind* :srg change.txt /*:srg* :sri change.txt /*:sri* :srl change.txt /*:srl* :srn change.txt /*:srn* :srp change.txt /*:srp* :st starting.txt /*:st* :sta windows.txt /*:sta* :stag windows.txt /*:stag* :star repeat.txt /*:star* :start insert.txt /*:start* :startgreplace insert.txt /*:startgreplace* :startinsert insert.txt /*:startinsert* :startreplace insert.txt /*:startreplace* :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* :sunm map.txt /*:sunm* :sunmap map.txt /*:sunmap* :sunme gui.txt /*:sunme* :sunmenu gui.txt /*:sunmenu* :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-cchar syntax.txt /*:syn-cchar* :syn-clear syntax.txt /*:syn-clear* :syn-cluster syntax.txt /*:syn-cluster* :syn-conceal syntax.txt /*:syn-conceal* :syn-conceal-implicit syntax.txt /*:syn-conceal-implicit* :syn-concealends syntax.txt /*:syn-concealends* :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-iskeyword syntax.txt /*:syn-iskeyword* :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-spell syntax.txt /*:syn-spell* :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* :sync scroll.txt /*:sync* :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* :syntime syntax.txt /*:syntime* :t change.txt /*:t* :tN tagsrch.txt /*:tN* :tNext tagsrch.txt /*:tNext* :ta tagsrch.txt /*:ta* :tab tabpage.txt /*:tab* :tabN tabpage.txt /*:tabN* :tabNext tabpage.txt /*:tabNext* :tabc tabpage.txt /*:tabc* :tabclose tabpage.txt /*:tabclose* :tabd tabpage.txt /*:tabd* :tabdo tabpage.txt /*:tabdo* :tabe tabpage.txt /*:tabe* :tabedit tabpage.txt /*:tabedit* :tabf tabpage.txt /*:tabf* :tabfind tabpage.txt /*:tabfind* :tabfir tabpage.txt /*:tabfir* :tabfirst tabpage.txt /*:tabfirst* :tabl tabpage.txt /*:tabl* :tablast tabpage.txt /*:tablast* :tabm tabpage.txt /*:tabm* :tabmove tabpage.txt /*:tabmove* :tabn tabpage.txt /*:tabn* :tabnew tabpage.txt /*:tabnew* :tabnext tabpage.txt /*:tabnext* :tabo tabpage.txt /*:tabo* :tabonly tabpage.txt /*:tabonly* :tabp tabpage.txt /*:tabp* :tabprevious tabpage.txt /*:tabprevious* :tabr tabpage.txt /*:tabr* :tabrewind tabpage.txt /*:tabrewind* :tabs tabpage.txt /*:tabs* :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* :undoj undo.txt /*:undoj* :undojoin undo.txt /*:undojoin* :undol undo.txt /*:undol* :undolist undo.txt /*:undolist* :unh windows.txt /*:unh* :unhide windows.txt /*:unhide* :unl eval.txt /*:unl* :unlet eval.txt /*:unlet* :unlo eval.txt /*:unlo* :unlockvar eval.txt /*:unlockvar* :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* :uns various.txt /*:uns* :unsilent various.txt /*:unsilent* :up editing.txt /*:up* :update editing.txt /*:update* :v repeat.txt /*:v* :ve various.txt /*:ve* :verb various.txt /*:verb* :verbose various.txt /*:verbose* :verbose-cmd various.txt /*:verbose-cmd* :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* :vim quickfix.txt /*:vim* :vimgrep quickfix.txt /*:vimgrep* :vimgrepa quickfix.txt /*:vimgrepa* :vimgrepadd quickfix.txt /*:vimgrepadd* :visual editing.txt /*:visual* :visual_example visual.txt /*:visual_example* :viu helphelp.txt /*:viu* :viusage helphelp.txt /*:viusage* :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* :wundo undo.txt /*:wundo* :wv starting.txt /*:wv* :wviminfo starting.txt /*:wviminfo* :x editing.txt /*:x* :xa editing.txt /*:xa* :xall editing.txt /*:xall* :xit editing.txt /*:xit* :xm map.txt /*:xm* :xmap map.txt /*:xmap* :xmap_l map.txt /*:xmap_l* :xmapc map.txt /*:xmapc* :xmapclear map.txt /*:xmapclear* :xme gui.txt /*:xme* :xmenu gui.txt /*:xmenu* :xn map.txt /*:xn* :xnoremap map.txt /*:xnoremap* :xnoreme gui.txt /*:xnoreme* :xnoremenu gui.txt /*:xnoremenu* :xu map.txt /*:xu* :xunmap map.txt /*:xunmap* :xunme gui.txt /*:xunme* :xunmenu gui.txt /*:xunmenu* :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-* <A-LeftMouse> term.txt /*<A-LeftMouse>* <A-RightMouse> term.txt /*<A-RightMouse>* <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-PageDown> tabpage.txt /*<C-PageDown>* <C-PageUp> tabpage.txt /*<C-PageUp>* <C-Right> motion.txt /*<C-Right>* <C-RightMouse> tagsrch.txt /*<C-RightMouse>* <C-ScrollWheelDown> scroll.txt /*<C-ScrollWheelDown>* <C-ScrollWheelLeft> scroll.txt /*<C-ScrollWheelLeft>* <C-ScrollWheelRight> scroll.txt /*<C-ScrollWheelRight>* <C-ScrollWheelUp> scroll.txt /*<C-ScrollWheelUp>* <CR> motion.txt /*<CR>* <CSI> intro.txt /*<CSI>* <Char-> map.txt /*<Char->* <Char> map.txt /*<Char>* <CursorHold> autocmd.txt /*<CursorHold>* <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> helphelp.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> helphelp.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-Right> motion.txt /*<S-Right>* <S-RightMouse> term.txt /*<S-RightMouse>* <S-ScrollWheelDown> scroll.txt /*<S-ScrollWheelDown>* <S-ScrollWheelLeft> scroll.txt /*<S-ScrollWheelLeft>* <S-ScrollWheelRight> scroll.txt /*<S-ScrollWheelRight>* <S-ScrollWheelUp> scroll.txt /*<S-ScrollWheelUp>* <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>* <ScrollWheelDown> scroll.txt /*<ScrollWheelDown>* <ScrollWheelLeft> scroll.txt /*<ScrollWheelLeft>* <ScrollWheelRight> scroll.txt /*<ScrollWheelRight>* <ScrollWheelUp> scroll.txt /*<ScrollWheelUp>* <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>* <buffer=N> autocmd.txt /*<buffer=N>* <buffer=abuf> autocmd.txt /*<buffer=abuf>* <cfile> cmdline.txt /*<cfile>* <character> intro.txt /*<character>* <count> map.txt /*<count>* <f-args> map.txt /*<f-args>* <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>* <nomodeline> autocmd.txt /*<nomodeline>* <q-args> map.txt /*<q-args>* <reg> map.txt /*<reg>* <register> map.txt /*<register>* <sfile> cmdline.txt /*<sfile>* <slnum> cmdline.txt /*<slnum>* <xCSI> intro.txt /*<xCSI>* <xDown> term.txt /*<xDown>* <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* <xLeft> term.txt /*<xLeft>* <xRight> term.txt /*<xRight>* <xUp> term.txt /*<xUp>* = change.txt /*=* == change.txt /*==* > change.txt /*>* >> change.txt /*>>* >backtrace repeat.txt /*>backtrace* >bt repeat.txt /*>bt* >cont repeat.txt /*>cont* >down repeat.txt /*>down* >finish repeat.txt /*>finish* >frame repeat.txt /*>frame* >interrupt repeat.txt /*>interrupt* >next repeat.txt /*>next* >quit repeat.txt /*>quit* >step repeat.txt /*>step* >up repeat.txt /*>up* >where repeat.txt /*>where* ? pattern.txt /*?* ?<CR> pattern.txt /*?<CR>* @ repeat.txt /*@* @/ change.txt /*@\/* @: repeat.txt /*@:* @= change.txt /*@=* @@ repeat.txt /*@@* @r eval.txt /*@r* 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* Bram intro.txt /*Bram* 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-<PageDown> tabpage.txt /*CTRL-<PageDown>* CTRL-<PageUp> tabpage.txt /*CTRL-<PageUp>* 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-Q gui_w32.txt /*CTRL-Q* 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_<CR> quickfix.txt /*CTRL-W_<CR>* CTRL-W_<Down> windows.txt /*CTRL-W_<Down>* CTRL-W_<Enter> quickfix.txt /*CTRL-W_<Enter>* 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_F windows.txt /*CTRL-W_F* 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_T windows.txt /*CTRL-W_T* 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_gF windows.txt /*CTRL-W_gF* CTRL-W_g] windows.txt /*CTRL-W_g]* CTRL-W_g_CTRL-] windows.txt /*CTRL-W_g_CTRL-]* CTRL-W_gf windows.txt /*CTRL-W_gf* 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}* Channel eval.txt /*Channel* Chinese mbyte.txt /*Chinese* Cmd-event autocmd.txt /*Cmd-event* CmdUndefined autocmd.txt /*CmdUndefined* Cmdline cmdline.txt /*Cmdline* Cmdline-mode cmdline.txt /*Cmdline-mode* CmdwinEnter autocmd.txt /*CmdwinEnter* CmdwinLeave autocmd.txt /*CmdwinLeave* ColorScheme autocmd.txt /*ColorScheme* Command-line cmdline.txt /*Command-line* Command-line-mode cmdline.txt /*Command-line-mode* CompleteDone autocmd.txt /*CompleteDone* Contents quickref.txt /*Contents* Cscope if_cscop.txt /*Cscope* CursorHold autocmd.txt /*CursorHold* CursorHold-example windows.txt /*CursorHold-example* CursorHoldI autocmd.txt /*CursorHoldI* CursorIM mbyte.txt /*CursorIM* CursorMoved autocmd.txt /*CursorMoved* CursorMovedI autocmd.txt /*CursorMovedI* D change.txt /*D* DOS os_dos.txt /*DOS* DOS-format editing.txt /*DOS-format* DOS-format-write editing.txt /*DOS-format-write* Dictionaries eval.txt /*Dictionaries* Dictionary eval.txt /*Dictionary* Dictionary-function eval.txt /*Dictionary-function* 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* 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 helphelp.txt /*E149* E15 eval.txt /*E15* E150 helphelp.txt /*E150* E151 helphelp.txt /*E151* E152 helphelp.txt /*E152* E153 helphelp.txt /*E153* E154 helphelp.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 options.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 print.txt /*E237* E238 print.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* 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* E277 remote.txt /*E277* 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* 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 print.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* E362 term.txt /*E362* E363 options.txt /*E363* E364 eval.txt /*E364* E365 print.txt /*E365* 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* 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* E455 print.txt /*E455* E456 print.txt /*E456* E457 print.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* 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* E511 netbeans.txt /*E511* 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* E532 netbeans.txt /*E532* 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* 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* E599 options.txt /*E599* 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* E612 sign.txt /*E612* E613 print.txt /*E613* E614 editing.txt /*E614* E615 editing.txt /*E615* E616 editing.txt /*E616* E617 options.txt /*E617* E618 print.txt /*E618* E619 print.txt /*E619* E62 pattern.txt /*E62* E620 print.txt /*E620* E621 print.txt /*E621* E622 if_cscop.txt /*E622* E623 if_cscop.txt /*E623* E624 print.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 channel.txt /*E630* E631 channel.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 helphelp.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 helphelp.txt /*E670* E671 starting.txt /*E671* E672 starting.txt /*E672* E673 print.txt /*E673* E674 print.txt /*E674* E675 print.txt /*E675* E676 options.txt /*E676* E677 eval.txt /*E677* E678 pattern.txt /*E678* E679 syntax.txt /*E679* E68 pattern.txt /*E68* E680 autocmd.txt /*E680* E681 quickfix.txt /*E681* E682 quickfix.txt /*E682* E683 quickfix.txt /*E683* E684 eval.txt /*E684* E685 message.txt /*E685* E686 eval.txt /*E686* E687 eval.txt /*E687* E688 eval.txt /*E688* E689 eval.txt /*E689* E69 pattern.txt /*E69* E690 eval.txt /*E690* E691 eval.txt /*E691* E692 eval.txt /*E692* E693 eval.txt /*E693* E694 eval.txt /*E694* E695 eval.txt /*E695* E696 eval.txt /*E696* E697 eval.txt /*E697* E698 eval.txt /*E698* E699 eval.txt /*E699* E70 pattern.txt /*E70* E700 eval.txt /*E700* E701 eval.txt /*E701* E702 eval.txt /*E702* E703 eval.txt /*E703* E704 eval.txt /*E704* E705 eval.txt /*E705* E707 eval.txt /*E707* E708 eval.txt /*E708* E709 eval.txt /*E709* E71 pattern.txt /*E71* E710 eval.txt /*E710* E711 eval.txt /*E711* E712 eval.txt /*E712* E713 eval.txt /*E713* E714 eval.txt /*E714* E715 eval.txt /*E715* E716 eval.txt /*E716* E717 eval.txt /*E717* E718 eval.txt /*E718* E719 eval.txt /*E719* E72 message.txt /*E72* E720 eval.txt /*E720* E721 eval.txt /*E721* E722 eval.txt /*E722* E723 eval.txt /*E723* E724 eval.txt /*E724* E725 eval.txt /*E725* E726 eval.txt /*E726* E727 eval.txt /*E727* E728 eval.txt /*E728* E729 eval.txt /*E729* E73 tagsrch.txt /*E73* E730 eval.txt /*E730* E731 eval.txt /*E731* E732 eval.txt /*E732* E733 eval.txt /*E733* E734 eval.txt /*E734* E735 eval.txt /*E735* E736 eval.txt /*E736* E737 eval.txt /*E737* E738 eval.txt /*E738* E739 eval.txt /*E739* E74 message.txt /*E74* E740 eval.txt /*E740* E741 eval.txt /*E741* E742 eval.txt /*E742* E743 eval.txt /*E743* E744 netbeans.txt /*E744* E745 eval.txt /*E745* E746 eval.txt /*E746* E747 editing.txt /*E747* E748 repeat.txt /*E748* E749 various.txt /*E749* E75 vi_diff.txt /*E75* E750 repeat.txt /*E750* E751 spell.txt /*E751* E752 spell.txt /*E752* E753 spell.txt /*E753* E754 spell.txt /*E754* E755 spell.txt /*E755* E756 spell.txt /*E756* E757 options.txt /*E757* E758 spell.txt /*E758* E759 spell.txt /*E759* E76 pattern.txt /*E76* E760 spell.txt /*E760* E761 spell.txt /*E761* E762 spell.txt /*E762* E763 spell.txt /*E763* E764 options.txt /*E764* E765 options.txt /*E765* E766 eval.txt /*E766* E767 eval.txt /*E767* E768 message.txt /*E768* E769 pattern.txt /*E769* E77 message.txt /*E77* E770 spell.txt /*E770* E771 spell.txt /*E771* E772 spell.txt /*E772* E773 recover.txt /*E773* E774 map.txt /*E774* E775 map.txt /*E775* E776 quickfix.txt /*E776* E777 quickfix.txt /*E777* E778 spell.txt /*E778* E779 spell.txt /*E779* E78 motion.txt /*E78* E780 spell.txt /*E780* E781 spell.txt /*E781* E782 spell.txt /*E782* E783 spell.txt /*E783* E784 tabpage.txt /*E784* E785 eval.txt /*E785* E786 eval.txt /*E786* E787 diff.txt /*E787* E788 autocmd.txt /*E788* E789 syntax.txt /*E789* E79 message.txt /*E79* E790 undo.txt /*E790* E791 mbyte.txt /*E791* E792 gui.txt /*E792* E793 diff.txt /*E793* E794 eval.txt /*E794* E795 eval.txt /*E795* E796 editing.txt /*E796* E797 spell.txt /*E797* E798 eval.txt /*E798* E799 eval.txt /*E799* E80 message.txt /*E80* E800 arabic.txt /*E800* E801 eval.txt /*E801* E802 eval.txt /*E802* E803 eval.txt /*E803* E804 eval.txt /*E804* E805 eval.txt /*E805* E806 eval.txt /*E806* E807 eval.txt /*E807* E808 eval.txt /*E808* E809 cmdline.txt /*E809* E81 map.txt /*E81* E810 diff.txt /*E810* E811 autocmd.txt /*E811* E812 autocmd.txt /*E812* E813 editing.txt /*E813* E814 editing.txt /*E814* E815 if_mzsch.txt /*E815* E816 diff.txt /*E816* E817 editing.txt /*E817* E818 editing.txt /*E818* E819 editing.txt /*E819* E82 message.txt /*E82* E820 editing.txt /*E820* E821 options.txt /*E821* E822 undo.txt /*E822* E823 undo.txt /*E823* E824 undo.txt /*E824* E825 undo.txt /*E825* E826 undo.txt /*E826* E827 undo.txt /*E827* E828 undo.txt /*E828* E829 undo.txt /*E829* E83 message.txt /*E83* E830 undo.txt /*E830* E831 editing.txt /*E831* E832 undo.txt /*E832* E833 editing.txt /*E833* E834 options.txt /*E834* E835 options.txt /*E835* E836 if_pyth.txt /*E836* E837 if_pyth.txt /*E837* E838 netbeans.txt /*E838* E839 insert.txt /*E839* E84 windows.txt /*E84* E840 insert.txt /*E840* E841 map.txt /*E841* E842 cmdline.txt /*E842* E843 editing.txt /*E843* E844 syntax.txt /*E844* E845 spell.txt /*E845* E846 options.txt /*E846* E847 syntax.txt /*E847* E848 syntax.txt /*E848* E849 syntax.txt /*E849* E85 options.txt /*E85* E850 change.txt /*E850* E851 gui_x11.txt /*E851* E852 gui_x11.txt /*E852* E853 eval.txt /*E853* E854 options.txt /*E854* E855 autocmd.txt /*E855* E858 eval.txt /*E858* E859 eval.txt /*E859* E86 windows.txt /*E86* E860 eval.txt /*E860* E862 eval.txt /*E862* E863 if_pyth.txt /*E863* E864 pattern.txt /*E864* E865 pattern.txt /*E865* E866 pattern.txt /*E866* E867 pattern.txt /*E867* E868 pattern.txt /*E868* E869 pattern.txt /*E869* E87 windows.txt /*E87* E870 pattern.txt /*E870* E871 pattern.txt /*E871* E872 pattern.txt /*E872* E873 pattern.txt /*E873* E874 pattern.txt /*E874* E875 pattern.txt /*E875* E876 pattern.txt /*E876* E877 pattern.txt /*E877* E878 pattern.txt /*E878* E879 syntax.txt /*E879* E88 windows.txt /*E88* E880 if_pyth.txt /*E880* E881 autocmd.txt /*E881* E882 eval.txt /*E882* E883 eval.txt /*E883* E884 eval.txt /*E884* E885 sign.txt /*E885* E886 starting.txt /*E886* E887 if_pyth.txt /*E887* E888 pattern.txt /*E888* E889 map.txt /*E889* E89 message.txt /*E89* E890 syntax.txt /*E890* E891 eval.txt /*E891* E892 eval.txt /*E892* E893 eval.txt /*E893* E894 eval.txt /*E894* E895 if_mzsch.txt /*E895* E896 channel.txt /*E896* E898 channel.txt /*E898* E899 channel.txt /*E899* E90 message.txt /*E90* E900 channel.txt /*E900* E901 channel.txt /*E901* E902 channel.txt /*E902* E903 channel.txt /*E903* E904 channel.txt /*E904* E905 channel.txt /*E905* E906 channel.txt /*E906* E907 eval.txt /*E907* E908 eval.txt /*E908* E909 eval.txt /*E909* E91 options.txt /*E91* E910 eval.txt /*E910* E911 eval.txt /*E911* E912 eval.txt /*E912* E913 eval.txt /*E913* E914 eval.txt /*E914* E915 channel.txt /*E915* E916 eval.txt /*E916* E917 eval.txt /*E917* E918 channel.txt /*E918* E919 repeat.txt /*E919* E92 message.txt /*E92* E920 channel.txt /*E920* E921 channel.txt /*E921* E922 eval.txt /*E922* E923 eval.txt /*E923* E924 quickfix.txt /*E924* E925 quickfix.txt /*E925* E926 quickfix.txt /*E926* 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* Exuberant_ctags tagsrch.txt /*Exuberant_ctags* 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* FileChangedShellPost autocmd.txt /*FileChangedShellPost* 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* Float eval.txt /*Float* FocusGained autocmd.txt /*FocusGained* FocusLost autocmd.txt /*FocusLost* Folding fold.txt /*Folding* FuncUndefined autocmd.txt /*FuncUndefined* Funcref eval.txt /*Funcref* 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* GUIFailed autocmd.txt /*GUIFailed* GetLatestVimScripts pi_getscript.txt /*GetLatestVimScripts* GetLatestVimScripts-copyright pi_getscript.txt /*GetLatestVimScripts-copyright* GetLatestVimScripts_dat pi_getscript.txt /*GetLatestVimScripts_dat* 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* InsertChange autocmd.txt /*InsertChange* InsertCharPre autocmd.txt /*InsertCharPre* InsertEnter autocmd.txt /*InsertEnter* InsertLeave autocmd.txt /*InsertLeave* J change.txt /*J* Japanese mbyte.txt /*Japanese* Job eval.txt /*Job* K various.txt /*K* KDE gui_x11.txt /*KDE* KVim gui_x11.txt /*KVim* Kibaale uganda.txt /*Kibaale* Korean mbyte.txt /*Korean* L motion.txt /*L* Linux-backspace options.txt /*Linux-backspace* List eval.txt /*List* Lists eval.txt /*Lists* LogiPat() pi_logipat.txt /*LogiPat()* LogiPat-flags pi_logipat.txt /*LogiPat-flags* Lua if_lua.txt /*Lua* 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* MenuPopup autocmd.txt /*MenuPopup* MiNT os_mint.txt /*MiNT* Moolenaar intro.txt /*Moolenaar* MorphOS os_amiga.txt /*MorphOS* Motif gui_x11.txt /*Motif* Myspell spell.txt /*Myspell* MzScheme if_mzsch.txt /*MzScheme* N pattern.txt /*N* N% motion.txt /*N%* N: cmdline.txt /*N:* N<Del> various.txt /*N<Del>* NFA pattern.txt /*NFA* NL-used-for-Nul pattern.txt /*NL-used-for-Nul* NetBSD-backspace options.txt /*NetBSD-backspace* NetUserPass() pi_netrw.txt /*NetUserPass()* Normal intro.txt /*Normal* Normal-mode intro.txt /*Normal-mode* Number eval.txt /*Number* Nvi intro.txt /*Nvi* 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-PuTTY os_390.txt /*OS390-PuTTY* OS390-bugs os_390.txt /*OS390-bugs* OS390-has-ebcdic os_390.txt /*OS390-has-ebcdic* OS390-limitations os_390.txt /*OS390-limitations* OS390-open-source os_390.txt /*OS390-open-source* OffTheSpot mbyte.txt /*OffTheSpot* OnTheSpot mbyte.txt /*OnTheSpot* Operator-pending intro.txt /*Operator-pending* Operator-pending-mode intro.txt /*Operator-pending-mode* OptionSet autocmd.txt /*OptionSet* OverTheSpot mbyte.txt /*OverTheSpot* P change.txt /*P* PATHEXT eval.txt /*PATHEXT* PHP_BracesAtCodeLevel indent.txt /*PHP_BracesAtCodeLevel* PHP_autoformatcomment indent.txt /*PHP_autoformatcomment* PHP_default_indenting indent.txt /*PHP_default_indenting* PHP_outdentSLComments indent.txt /*PHP_outdentSLComments* PHP_outdentphpescape indent.txt /*PHP_outdentphpescape* PHP_removeCRwhenUnix indent.txt /*PHP_removeCRwhenUnix* PHP_vintage_case_default_indent indent.txt /*PHP_vintage_case_default_indent* 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* QuickFixCmdPost autocmd.txt /*QuickFixCmdPost* QuickFixCmdPost-example quickfix.txt /*QuickFixCmdPost-example* QuickFixCmdPre autocmd.txt /*QuickFixCmdPre* Quickfix quickfix.txt /*Quickfix* QuitPre autocmd.txt /*QuitPre* 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* SQLGetType ft_sql.txt /*SQLGetType* SQLSetType ft_sql.txt /*SQLSetType* Select visual.txt /*Select* Select-mode visual.txt /*Select-mode* Select-mode-mapping visual.txt /*Select-mode-mapping* Session starting.txt /*Session* SessionLoad-variable starting.txt /*SessionLoad-variable* SessionLoadPost autocmd.txt /*SessionLoadPost* ShellCmdPost autocmd.txt /*ShellCmdPost* ShellFilterPost autocmd.txt /*ShellFilterPost* SourceCmd autocmd.txt /*SourceCmd* SourcePre autocmd.txt /*SourcePre* Special eval.txt /*Special* SpellFileMissing autocmd.txt /*SpellFileMissing* StdinReadPost autocmd.txt /*StdinReadPost* StdinReadPre autocmd.txt /*StdinReadPre* String eval.txt /*String* SwapExists autocmd.txt /*SwapExists* Syntax autocmd.txt /*Syntax* T motion.txt /*T* TCL if_tcl.txt /*TCL* TERM starting.txt /*TERM* TOhtml-encoding syntax.txt /*TOhtml-encoding* TOhtml-encoding-detect syntax.txt /*TOhtml-encoding-detect* TOhtml-performance syntax.txt /*TOhtml-performance* TOhtml-uncopyable-text syntax.txt /*TOhtml-uncopyable-text* TOhtml-wrap-text syntax.txt /*TOhtml-wrap-text* TSQL ft_sql.txt /*TSQL* TTpro-telnet syntax.txt /*TTpro-telnet* Tab intro.txt /*Tab* TabEnter autocmd.txt /*TabEnter* TabLeave autocmd.txt /*TabLeave* Tcl if_tcl.txt /*Tcl* TermChanged autocmd.txt /*TermChanged* TermResponse autocmd.txt /*TermResponse* TextChanged autocmd.txt /*TextChanged* TextChangedI autocmd.txt /*TextChangedI* Transact-SQL ft_sql.txt /*Transact-SQL* 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* VimResized autocmd.txt /*VimResized* Vimball-copyright pi_vimball.txt /*Vimball-copyright* 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* WWW intro.txt /*WWW* 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]* [..] pattern.txt /*[..]* [/ 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>* [==] pattern.txt /*[==]* [D tagsrch.txt /*[D* [I tagsrch.txt /*[I* [M motion.txt /*[M* [P change.txt /*[P* [S spell.txt /*[S* [[ 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]* [s spell.txt /*[s* [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* ]S spell.txt /*]S* ][ 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* ]s spell.txt /*]s* ]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 /*`<* `= editing.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(* a) motion.txt /*a)* a4 print.txt /*a4* a:0 eval.txt /*a:0* a:000 eval.txt /*a:000* a:1 eval.txt /*a:1* 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]* a` motion.txt /*a`* ab motion.txt /*ab* abandon editing.txt /*abandon* abbreviations map.txt /*abbreviations* abel.vim syntax.txt /*abel.vim* abs() eval.txt /*abs()* acos() eval.txt /*acos()* active-buffer windows.txt /*active-buffer* ada#Create_Tags() ft_ada.txt /*ada#Create_Tags()* ada#Jump_Tag() ft_ada.txt /*ada#Jump_Tag()* ada#Listtags() ft_ada.txt /*ada#Listtags()* ada#Switch_Syntax_Option() ft_ada.txt /*ada#Switch_Syntax_Option()* ada#Word() ft_ada.txt /*ada#Word()* ada-compiler ft_ada.txt /*ada-compiler* ada-ctags ft_ada.txt /*ada-ctags* ada-extra-plugins ft_ada.txt /*ada-extra-plugins* ada-reference ft_ada.txt /*ada-reference* ada.vim ft_ada.txt /*ada.vim* add() eval.txt /*add()* 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-package usr_05.txt /*add-package* 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-6.4 version6.txt /*added-6.4* added-7.1 version7.txt /*added-7.1* added-7.2 version7.txt /*added-7.2* added-7.3 version7.txt /*added-7.3* added-7.4 version7.txt /*added-7.4* 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* aff-dic-format spell.txt /*aff-dic-format* after-directory options.txt /*after-directory* aleph options.txt /*aleph* alloc_fail() eval.txt /*alloc_fail()* alt intro.txt /*alt* alt-input debugger.txt /*alt-input* alternate-file editing.txt /*alternate-file* amiga-window starting.txt /*amiga-window* and() eval.txt /*and()* anonymous-function eval.txt /*anonymous-function* ant.vim syntax.txt /*ant.vim* ap motion.txt /*ap* apache.vim syntax.txt /*apache.vim* append() eval.txt /*append()* aquote motion.txt /*aquote* arabic.txt arabic.txt /*arabic.txt* arabicfonts arabic.txt /*arabicfonts* arabickeymap arabic.txt /*arabickeymap* arg-functions usr_41.txt /*arg-functions* 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* arglistid() eval.txt /*arglistid()* argument-list editing.txt /*argument-list* argv() eval.txt /*argv()* as motion.txt /*as* asin() eval.txt /*asin()* asm.vim syntax.txt /*asm.vim* asm68k syntax.txt /*asm68k* asmh8300.vim syntax.txt /*asmh8300.vim* assert_equal() eval.txt /*assert_equal()* assert_exception() eval.txt /*assert_exception()* assert_fails() eval.txt /*assert_fails()* assert_false() eval.txt /*assert_false()* assert_match() eval.txt /*assert_match()* assert_true() eval.txt /*assert_true()* at motion.txt /*at* atan() eval.txt /*atan()* atan2() eval.txt /*atan2()* 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-buffer-local autocmd.txt /*autocmd-buffer-local* autocmd-buflocal autocmd.txt /*autocmd-buflocal* autocmd-changes autocmd.txt /*autocmd-changes* autocmd-define autocmd.txt /*autocmd-define* autocmd-disable autocmd.txt /*autocmd-disable* autocmd-events autocmd.txt /*autocmd-events* autocmd-events-abc autocmd.txt /*autocmd-events-abc* 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* autoformat change.txt /*autoformat* autoload eval.txt /*autoload* 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: eval.txt /*b:* b:changedtick eval.txt /*b:changedtick* b:changelog_name filetype.txt /*b:changelog_name* b:current_syntax-variable syntax.txt /*b:current_syntax-variable* b:netrw_lastfile pi_netrw.txt /*b:netrw_lastfile* b:tex_stylish syntax.txt /*b:tex_stylish* b:var eval.txt /*b:var* b:yaml_schema syntax.txt /*b:yaml_schema* baan-folding syntax.txt /*baan-folding* baan-syntax syntax.txt /*baan-syntax* baan.vim syntax.txt /*baan.vim* 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.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* better-python-interface version7.txt /*better-python-interface* beval_bufnr-variable eval.txt /*beval_bufnr-variable* beval_col-variable eval.txt /*beval_col-variable* beval_lnum-variable eval.txt /*beval_lnum-variable* beval_text-variable eval.txt /*beval_text-variable* beval_winnr-variable eval.txt /*beval_winnr-variable* bitwise-function usr_41.txt /*bitwise-function* blockwise-examples visual.txt /*blockwise-examples* blockwise-operators visual.txt /*blockwise-operators* blockwise-register change.txt /*blockwise-register* blockwise-visual visual.txt /*blockwise-visual* blowfish options.txt /*blowfish* blowfish2 options.txt /*blowfish2* bold syntax.txt /*bold* bom-bytes mbyte.txt /*bom-bytes* book intro.txt /*book* bookmark usr_03.txt /*bookmark* boolean options.txt /*boolean* break-finally eval.txt /*break-finally* browse() eval.txt /*browse()* browsedir() eval.txt /*browsedir()* browsefilter editing.txt /*browsefilter* bufexists() eval.txt /*bufexists()* buffer-functions usr_41.txt /*buffer-functions* 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-fixes-7 version7.txt /*bug-fixes-7* 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()* byteidx() eval.txt /*byteidx()* byteidxcomp() eval.txt /*byteidxcomp()* bzip2 pi_gzip.txt /*bzip2* c change.txt /*c* c.vim syntax.txt /*c.vim* cW change.txt /*cW* c_# cmdline.txt /*c_#* c_## cmdline.txt /*c_##* c_#< cmdline.txt /*c_#<* c_#n cmdline.txt /*c_#n* c_% cmdline.txt /*c_%* 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_<MiddleMouse> cmdline.txt /*c_<MiddleMouse>* 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_BS cmdline.txt /*c_BS* c_CR cmdline.txt /*c_CR* 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-F cmdline.txt /*c_CTRL-F* 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_CTRL-_ cmdline.txt /*c_CTRL-_* 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_Right cmdline.txt /*c_Right* c_Up cmdline.txt /*c_Up* c_digraph cmdline.txt /*c_digraph* c_wildchar cmdline.txt /*c_wildchar* call() eval.txt /*call()* 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* ceil() eval.txt /*ceil()* ch.vim syntax.txt /*ch.vim* ch_close() eval.txt /*ch_close()* ch_evalexpr() eval.txt /*ch_evalexpr()* ch_evalraw() eval.txt /*ch_evalraw()* ch_getbufnr() eval.txt /*ch_getbufnr()* ch_getjob() eval.txt /*ch_getjob()* ch_info() eval.txt /*ch_info()* ch_log() eval.txt /*ch_log()* ch_logfile() eval.txt /*ch_logfile()* ch_open() eval.txt /*ch_open()* ch_read() eval.txt /*ch_read()* ch_readraw() eval.txt /*ch_readraw()* ch_sendexpr() eval.txt /*ch_sendexpr()* ch_sendraw() eval.txt /*ch_sendraw()* ch_setoptions() eval.txt /*ch_setoptions()* ch_status() eval.txt /*ch_status()* change-list-jumps motion.txt /*change-list-jumps* change-name tips.txt /*change-name* change-tabs change.txt /*change-tabs* 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* changed-6.4 version6.txt /*changed-6.4* changed-7.1 version7.txt /*changed-7.1* changed-7.2 version7.txt /*changed-7.2* changed-7.3 version7.txt /*changed-7.3* changed-7.4 version7.txt /*changed-7.4* changelist motion.txt /*changelist* changelog.vim syntax.txt /*changelog.vim* changenr() eval.txt /*changenr()* changetick eval.txt /*changetick* changing change.txt /*changing* channel channel.txt /*channel* channel-callback channel.txt /*channel-callback* channel-close channel.txt /*channel-close* channel-commands channel.txt /*channel-commands* channel-demo channel.txt /*channel-demo* channel-mode channel.txt /*channel-mode* channel-more channel.txt /*channel-more* channel-open channel.txt /*channel-open* channel-open-options channel.txt /*channel-open-options* channel-raw channel.txt /*channel-raw* channel-timeout channel.txt /*channel-timeout* channel-use channel.txt /*channel-use* channel.txt channel.txt /*channel.txt* char-variable eval.txt /*char-variable* 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* charity uganda.txt /*charity* charset mbyte.txt /*charset* charset-conversion mbyte.txt /*charset-conversion* chill.vim syntax.txt /*chill.vim* chmod eval.txt /*chmod* cindent() eval.txt /*cindent()* cinkeys-format indent.txt /*cinkeys-format* cino-# indent.txt /*cino-#* cino-( indent.txt /*cino-(* cino-) indent.txt /*cino-)* cino-+ indent.txt /*cino-+* cino-/ indent.txt /*cino-\/* cino-: indent.txt /*cino-:* cino-= indent.txt /*cino-=* cino-> indent.txt /*cino->* cino-C indent.txt /*cino-C* cino-J indent.txt /*cino-J* cino-L indent.txt /*cino-L* cino-M indent.txt /*cino-M* cino-N indent.txt /*cino-N* cino-U indent.txt /*cino-U* cino-W indent.txt /*cino-W* cino-^ indent.txt /*cino-^* cino-b indent.txt /*cino-b* cino-c indent.txt /*cino-c* cino-e indent.txt /*cino-e* cino-f indent.txt /*cino-f* cino-g indent.txt /*cino-g* cino-h indent.txt /*cino-h* cino-i indent.txt /*cino-i* cino-j indent.txt /*cino-j* cino-k indent.txt /*cino-k* cino-l indent.txt /*cino-l* cino-m indent.txt /*cino-m* cino-n indent.txt /*cino-n* cino-p indent.txt /*cino-p* cino-star indent.txt /*cino-star* cino-t indent.txt /*cino-t* cino-u indent.txt /*cino-u* cino-w indent.txt /*cino-w* cino-{ indent.txt /*cino-{* cino-} indent.txt /*cino-}* cinoptions-values indent.txt /*cinoptions-values* clear-undo undo.txt /*clear-undo* clearmatches() eval.txt /*clearmatches()* client-server remote.txt /*client-server* clientserver remote.txt /*clientserver* clipboard gui.txt /*clipboard* clipboard-autoselect options.txt /*clipboard-autoselect* clipboard-autoselectml options.txt /*clipboard-autoselectml* clipboard-autoselectplus options.txt /*clipboard-autoselectplus* clipboard-exclude options.txt /*clipboard-exclude* clipboard-html options.txt /*clipboard-html* clipboard-unnamed options.txt /*clipboard-unnamed* clipboard-unnamedplus options.txt /*clipboard-unnamedplus* clojure-indent indent.txt /*clojure-indent* close_cb channel.txt /*close_cb* 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.vim syntax.txt /*cobol.vim* codeset mbyte.txt /*codeset* coding-style develop.txt /*coding-style* col() eval.txt /*col()* 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-line-functions usr_41.txt /*command-line-functions* command-line-window cmdline.txt /*command-line-window* 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* compile-changes-7 version7.txt /*compile-changes-7* compiler-compaqada ft_ada.txt /*compiler-compaqada* compiler-decada ft_ada.txt /*compiler-decada* compiler-gcc quickfix.txt /*compiler-gcc* compiler-gnat ft_ada.txt /*compiler-gnat* compiler-hpada ft_ada.txt /*compiler-hpada* compiler-manx quickfix.txt /*compiler-manx* compiler-perl quickfix.txt /*compiler-perl* compiler-pyunit quickfix.txt /*compiler-pyunit* compiler-select quickfix.txt /*compiler-select* compiler-tex quickfix.txt /*compiler-tex* compiler-vaxada ft_ada.txt /*compiler-vaxada* 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-function insert.txt /*compl-function* compl-generic insert.txt /*compl-generic* compl-keyword insert.txt /*compl-keyword* compl-omni insert.txt /*compl-omni* compl-omni-filetypes insert.txt /*compl-omni-filetypes* compl-spelling insert.txt /*compl-spelling* compl-tag insert.txt /*compl-tag* compl-vim insert.txt /*compl-vim* compl-whole-line insert.txt /*compl-whole-line* complete() eval.txt /*complete()* complete-functions insert.txt /*complete-functions* complete-items insert.txt /*complete-items* complete_CTRL-E insert.txt /*complete_CTRL-E* complete_CTRL-Y insert.txt /*complete_CTRL-Y* complete_add() eval.txt /*complete_add()* complete_check() eval.txt /*complete_check()* completed_item-variable eval.txt /*completed_item-variable* completion-functions usr_41.txt /*completion-functions* complex-change change.txt /*complex-change* complex-repeat repeat.txt /*complex-repeat* compress pi_gzip.txt /*compress* conceal syntax.txt /*conceal* 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() eval.txt /*copy()* copy-diffs diff.txt /*copy-diffs* copy-move change.txt /*copy-move* copying uganda.txt /*copying* copyright uganda.txt /*copyright* cos() eval.txt /*cos()* cosh() eval.txt /*cosh()* count intro.txt /*count* count() eval.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-% options.txt /*cpo-%* cpo-& options.txt /*cpo-&* cpo-+ options.txt /*cpo-+* cpo-- options.txt /*cpo--* cpo-. options.txt /*cpo-.* 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-H options.txt /*cpo-H* 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-O options.txt /*cpo-O* cpo-P options.txt /*cpo-P* cpo-R options.txt /*cpo-R* cpo-S options.txt /*cpo-S* cpo-W options.txt /*cpo-W* cpo-X options.txt /*cpo-X* cpo-Z options.txt /*cpo-Z* cpo-\ options.txt /*cpo-\\* cpo-a options.txt /*cpo-a* cpo-b options.txt /*cpo-b* cpo-bar options.txt /*cpo-bar* 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-q options.txt /*cpo-q* 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* cpo-{ options.txt /*cpo-{* cpp.vim syntax.txt /*cpp.vim* 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* cscoperelative if_cscop.txt /*cscoperelative* cscopetag if_cscop.txt /*cscopetag* cscopetagorder if_cscop.txt /*cscopetagorder* cscopeverbose if_cscop.txt /*cscopeverbose* csh.vim syntax.txt /*csh.vim* cspc if_cscop.txt /*cspc* csprg if_cscop.txt /*csprg* csqf if_cscop.txt /*csqf* csre if_cscop.txt /*csre* 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-functions usr_41.txt /*cursor-functions* 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.vim syntax.txt /*cweb.vim* 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* date-functions usr_41.txt /*date-functions* dav pi_netrw.txt /*dav* davs pi_netrw.txt /*davs* daw motion.txt /*daw* dd change.txt /*dd* debug-gcc debug.txt /*debug-gcc* debug-highlight debugger.txt /*debug-highlight* debug-leaks debug.txt /*debug-leaks* debug-minidump debug.txt /*debug-minidump* debug-mode repeat.txt /*debug-mode* debug-scripts repeat.txt /*debug-scripts* debug-signs debugger.txt /*debug-signs* debug-vim debug.txt /*debug-vim* debug-vs2005 debug.txt /*debug-vs2005* debug-win32 debug.txt /*debug-win32* debug-windbg debug.txt /*debug-windbg* debug.txt debug.txt /*debug.txt* 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* decada_members ft_ada.txt /*decada_members* deepcopy() eval.txt /*deepcopy()* 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.vim syntax.txt /*desktop.vim* develop-spell develop.txt /*develop-spell* develop-spell-suggestions develop.txt /*develop-spell-suggestions* develop.txt develop.txt /*develop.txt* development develop.txt /*development* dgn motion.txt /*dgn* 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* dict eval.txt /*dict* dict-functions usr_41.txt /*dict-functions* dict-identity eval.txt /*dict-identity* dict-modification eval.txt /*dict-modification* 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-original-file diff.txt /*diff-original-file* diff-patchexpr diff.txt /*diff-patchexpr* diff-slow diff.txt /*diff-slow* diff.txt diff.txt /*diff.txt* diff.vim syntax.txt /*diff.vim* diff_filler() eval.txt /*diff_filler()* diff_hlID() eval.txt /*diff_hlID()* diff_translations diff.txt /*diff_translations* digraph digraph.txt /*digraph* digraph-arg change.txt /*digraph-arg* digraph-encoding digraph.txt /*digraph-encoding* digraph-table digraph.txt /*digraph-table* digraph-table-mbyte digraph.txt /*digraph-table-mbyte* 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.vim syntax.txt /*dircolors.vim* dis motion.txt /*dis* disable-menus gui.txt /*disable-menus* disable_char_avail_for_testing() eval.txt /*disable_char_avail_for_testing()* discard editing.txt /*discard* distribute-script usr_41.txt /*distribute-script* 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.vim syntax.txt /*docbk.vim* docbksgml.vim syntax.txt /*docbksgml.vim* docbkxml.vim syntax.txt /*docbkxml.vim* docbook syntax.txt /*docbook* documentation-6 version6.txt /*documentation-6* donate uganda.txt /*donate* 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* dosbatch.vim syntax.txt /*dosbatch.vim* double-click term.txt /*double-click* download intro.txt /*download* doxygen-syntax syntax.txt /*doxygen-syntax* doxygen.vim syntax.txt /*doxygen.vim* 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.vim syntax.txt /*dtd.vim* dtd2vim insert.txt /*dtd2vim* 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* edit-paragraph-join usr_25.txt /*edit-paragraph-join* editing.txt editing.txt /*editing.txt* efm-%> quickfix.txt /*efm-%>* efm-entries quickfix.txt /*efm-entries* efm-ignore quickfix.txt /*efm-ignore* eiffel.vim syntax.txt /*eiffel.vim* emacs-keys tips.txt /*emacs-keys* emacs-tags tagsrch.txt /*emacs-tags* emacs_tags tagsrch.txt /*emacs_tags* empty() eval.txt /*empty()* 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.vim syntax.txt /*erlang.vim* err_buf channel.txt /*err_buf* err_cb channel.txt /*err_cb* err_mode channel.txt /*err_mode* err_name channel.txt /*err_name* err_timeout channel.txt /*err_timeout* 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* errors message.txt /*errors* errors-variable eval.txt /*errors-variable* escape intro.txt /*escape* escape() eval.txt /*escape()* escape-bar version4.txt /*escape-bar* euphoria3.vim syntax.txt /*euphoria3.vim* euphoria4.vim syntax.txt /*euphoria4.vim* eval eval.txt /*eval* 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-flags cmdline.txt /*ex-flags* 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* exclusive-linewise motion.txt /*exclusive-linewise* executable() eval.txt /*executable()* execute-menus gui.txt /*execute-menus* exepath() eval.txt /*exepath()* exim starting.txt /*exim* exists() eval.txt /*exists()* exiting starting.txt /*exiting* exp() eval.txt /*exp()* expand() eval.txt /*expand()* expand-env options.txt /*expand-env* expand-environment-var options.txt /*expand-environment-var* 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-[] eval.txt /*expr-[]* expr-barbar eval.txt /*expr-barbar* expr-entry eval.txt /*expr-entry* expr-env eval.txt /*expr-env* expr-env-expand eval.txt /*expr-env-expand* expr-function eval.txt /*expr-function* expr-is eval.txt /*expr-is* expr-is# eval.txt /*expr-is#* expr-is? eval.txt /*expr-is?* expr-isnot eval.txt /*expr-isnot* expr-isnot# eval.txt /*expr-isnot#* expr-isnot? eval.txt /*expr-isnot?* 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* extend() eval.txt /*extend()* extension-removal cmdline.txt /*extension-removal* extensions-improvements todo.txt /*extensions-improvements* f motion.txt /*f* false-variable eval.txt /*false-variable* faq intro.txt /*faq* farsi farsi.txt /*farsi* farsi-fonts farsi.txt /*farsi-fonts* farsi.txt farsi.txt /*farsi.txt* fasm.vim syntax.txt /*fasm.vim* fcs_choice-variable eval.txt /*fcs_choice-variable* fcs_reason-variable eval.txt /*fcs_reason-variable* feature-list eval.txt /*feature-list* feedkeys() eval.txt /*feedkeys()* fetch pi_netrw.txt /*fetch* file-browser-5.2 version5.txt /*file-browser-5.2* file-formats editing.txt /*file-formats* file-functions usr_41.txt /*file-functions* 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* filter() eval.txt /*filter()* find-manpage usr_12.txt /*find-manpage* find-replace usr_10.txt /*find-replace* finddir() eval.txt /*finddir()* findfile() eval.txt /*findfile()* 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* fixed-6.4 version6.txt /*fixed-6.4* fixed-7.1 version7.txt /*fixed-7.1* fixed-7.2 version7.txt /*fixed-7.2* fixed-7.3 version7.txt /*fixed-7.3* fixed-7.4 version7.txt /*fixed-7.4* flexwiki.vim syntax.txt /*flexwiki.vim* float-e eval.txt /*float-e* float-functions usr_41.txt /*float-functions* float-pi eval.txt /*float-pi* float2nr() eval.txt /*float2nr()* floating-point-format eval.txt /*floating-point-format* floating-point-precision eval.txt /*floating-point-precision* floor() eval.txt /*floor()* fmod() eval.txt /*fmod()* 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* fnameescape() eval.txt /*fnameescape()* 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* folding-functions usr_41.txt /*folding-functions* foldlevel() eval.txt /*foldlevel()* foldlevel-variable eval.txt /*foldlevel-variable* folds fold.txt /*folds* foldstart-variable eval.txt /*foldstart-variable* foldtext() eval.txt /*foldtext()* foldtextresult() eval.txt /*foldtextresult()* font-sizes gui_x11.txt /*font-sizes* fontset mbyte.txt /*fontset* foreground() eval.txt /*foreground()* fork os_unix.txt /*fork* 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.vim syntax.txt /*fortran.vim* friendship intro.txt /*friendship* frombook usr_01.txt /*frombook* ft-abel-syntax syntax.txt /*ft-abel-syntax* ft-ada-commands ft_ada.txt /*ft-ada-commands* ft-ada-constants ft_ada.txt /*ft-ada-constants* ft-ada-functions ft_ada.txt /*ft-ada-functions* ft-ada-indent ft_ada.txt /*ft-ada-indent* ft-ada-omni ft_ada.txt /*ft-ada-omni* ft-ada-options ft_ada.txt /*ft-ada-options* ft-ada-plugin ft_ada.txt /*ft-ada-plugin* ft-ada-syntax ft_ada.txt /*ft-ada-syntax* ft-ada-variables ft_ada.txt /*ft-ada-variables* ft-ant-syntax syntax.txt /*ft-ant-syntax* ft-apache-syntax syntax.txt /*ft-apache-syntax* ft-asm-syntax syntax.txt /*ft-asm-syntax* ft-asm68k-syntax syntax.txt /*ft-asm68k-syntax* ft-asmh8300-syntax syntax.txt /*ft-asmh8300-syntax* ft-aspperl-syntax syntax.txt /*ft-aspperl-syntax* ft-aspvbs-syntax syntax.txt /*ft-aspvbs-syntax* ft-bash-syntax syntax.txt /*ft-bash-syntax* ft-basic-syntax syntax.txt /*ft-basic-syntax* ft-c-omni insert.txt /*ft-c-omni* ft-c-syntax syntax.txt /*ft-c-syntax* ft-ch-syntax syntax.txt /*ft-ch-syntax* ft-changelog-plugin filetype.txt /*ft-changelog-plugin* ft-changelog-syntax syntax.txt /*ft-changelog-syntax* ft-chill-syntax syntax.txt /*ft-chill-syntax* ft-clojure-indent indent.txt /*ft-clojure-indent* ft-clojure-syntax syntax.txt /*ft-clojure-syntax* ft-cobol-syntax syntax.txt /*ft-cobol-syntax* ft-coldfusion-syntax syntax.txt /*ft-coldfusion-syntax* ft-cpp-syntax syntax.txt /*ft-cpp-syntax* ft-csh-syntax syntax.txt /*ft-csh-syntax* ft-css-omni insert.txt /*ft-css-omni* ft-cweb-syntax syntax.txt /*ft-cweb-syntax* ft-cynlib-syntax syntax.txt /*ft-cynlib-syntax* ft-desktop-syntax syntax.txt /*ft-desktop-syntax* ft-dircolors-syntax syntax.txt /*ft-dircolors-syntax* ft-docbk-syntax syntax.txt /*ft-docbk-syntax* ft-docbksgml-syntax syntax.txt /*ft-docbksgml-syntax* ft-docbkxml-syntax syntax.txt /*ft-docbkxml-syntax* ft-dosbatch-syntax syntax.txt /*ft-dosbatch-syntax* ft-dtd-syntax syntax.txt /*ft-dtd-syntax* ft-eiffel-syntax syntax.txt /*ft-eiffel-syntax* ft-erlang-syntax syntax.txt /*ft-erlang-syntax* ft-euphoria-syntax syntax.txt /*ft-euphoria-syntax* ft-flexwiki-syntax syntax.txt /*ft-flexwiki-syntax* ft-form-syntax syntax.txt /*ft-form-syntax* ft-fortran-indent indent.txt /*ft-fortran-indent* ft-fortran-plugin filetype.txt /*ft-fortran-plugin* ft-fortran-syntax syntax.txt /*ft-fortran-syntax* ft-fvwm-syntax syntax.txt /*ft-fvwm-syntax* ft-gitcommit-plugin filetype.txt /*ft-gitcommit-plugin* ft-groff-syntax syntax.txt /*ft-groff-syntax* ft-gsp-syntax syntax.txt /*ft-gsp-syntax* ft-haskell-syntax syntax.txt /*ft-haskell-syntax* ft-html-indent indent.txt /*ft-html-indent* ft-html-omni insert.txt /*ft-html-omni* ft-html-syntax syntax.txt /*ft-html-syntax* ft-htmlos-syntax syntax.txt /*ft-htmlos-syntax* ft-ia64-syntax syntax.txt /*ft-ia64-syntax* ft-inform-syntax syntax.txt /*ft-inform-syntax* ft-java-syntax syntax.txt /*ft-java-syntax* ft-javascript-omni insert.txt /*ft-javascript-omni* ft-ksh-syntax syntax.txt /*ft-ksh-syntax* ft-lace-syntax syntax.txt /*ft-lace-syntax* ft-lex-syntax syntax.txt /*ft-lex-syntax* ft-lifelines-syntax syntax.txt /*ft-lifelines-syntax* ft-lisp-syntax syntax.txt /*ft-lisp-syntax* ft-lite-syntax syntax.txt /*ft-lite-syntax* ft-lpc-syntax syntax.txt /*ft-lpc-syntax* ft-lua-syntax syntax.txt /*ft-lua-syntax* ft-mail-plugin filetype.txt /*ft-mail-plugin* ft-mail.vim syntax.txt /*ft-mail.vim* ft-make-syntax syntax.txt /*ft-make-syntax* ft-man-plugin filetype.txt /*ft-man-plugin* ft-maple-syntax syntax.txt /*ft-maple-syntax* ft-masm-syntax syntax.txt /*ft-masm-syntax* ft-mathematica-syntax syntax.txt /*ft-mathematica-syntax* ft-mma-syntax syntax.txt /*ft-mma-syntax* ft-moo-syntax syntax.txt /*ft-moo-syntax* ft-msql-syntax syntax.txt /*ft-msql-syntax* ft-nasm-syntax syntax.txt /*ft-nasm-syntax* ft-ncf-syntax syntax.txt /*ft-ncf-syntax* ft-nroff-syntax syntax.txt /*ft-nroff-syntax* ft-ocaml-syntax syntax.txt /*ft-ocaml-syntax* ft-papp-syntax syntax.txt /*ft-papp-syntax* ft-pascal-syntax syntax.txt /*ft-pascal-syntax* ft-pdf-plugin filetype.txt /*ft-pdf-plugin* ft-perl-syntax syntax.txt /*ft-perl-syntax* ft-php-indent indent.txt /*ft-php-indent* ft-php-omni insert.txt /*ft-php-omni* ft-php-syntax syntax.txt /*ft-php-syntax* ft-php3-syntax syntax.txt /*ft-php3-syntax* ft-phtml-syntax syntax.txt /*ft-phtml-syntax* ft-plaintex-syntax syntax.txt /*ft-plaintex-syntax* ft-postscr-syntax syntax.txt /*ft-postscr-syntax* ft-ppwiz-syntax syntax.txt /*ft-ppwiz-syntax* ft-printcap-syntax syntax.txt /*ft-printcap-syntax* ft-progress-syntax syntax.txt /*ft-progress-syntax* ft-ptcap-syntax syntax.txt /*ft-ptcap-syntax* ft-python-indent indent.txt /*ft-python-indent* ft-python-syntax syntax.txt /*ft-python-syntax* ft-quake-syntax syntax.txt /*ft-quake-syntax* ft-r-indent indent.txt /*ft-r-indent* ft-readline-syntax syntax.txt /*ft-readline-syntax* ft-rexx-syntax syntax.txt /*ft-rexx-syntax* ft-rst-syntax syntax.txt /*ft-rst-syntax* ft-ruby-omni insert.txt /*ft-ruby-omni* ft-ruby-syntax syntax.txt /*ft-ruby-syntax* ft-scheme-syntax syntax.txt /*ft-scheme-syntax* ft-sdl-syntax syntax.txt /*ft-sdl-syntax* ft-sed-syntax syntax.txt /*ft-sed-syntax* ft-sgml-syntax syntax.txt /*ft-sgml-syntax* ft-sh-indent indent.txt /*ft-sh-indent* ft-sh-syntax syntax.txt /*ft-sh-syntax* ft-spec-plugin filetype.txt /*ft-spec-plugin* ft-spup-syntax syntax.txt /*ft-spup-syntax* ft-sql filetype.txt /*ft-sql* ft-sql-omni insert.txt /*ft-sql-omni* ft-sql-syntax syntax.txt /*ft-sql-syntax* ft-sqlanywhere-syntax syntax.txt /*ft-sqlanywhere-syntax* ft-sqlinformix-syntax syntax.txt /*ft-sqlinformix-syntax* ft-syntax-omni insert.txt /*ft-syntax-omni* ft-tcsh-syntax syntax.txt /*ft-tcsh-syntax* ft-termcap-syntax syntax.txt /*ft-termcap-syntax* ft-tex-plugin filetype.txt /*ft-tex-plugin* ft-tex-syntax syntax.txt /*ft-tex-syntax* ft-tf-syntax syntax.txt /*ft-tf-syntax* ft-vb-syntax syntax.txt /*ft-vb-syntax* ft-verilog-indent indent.txt /*ft-verilog-indent* ft-vhdl-indent indent.txt /*ft-vhdl-indent* ft-vim-indent indent.txt /*ft-vim-indent* ft-vim-syntax syntax.txt /*ft-vim-syntax* ft-xf86conf-syntax syntax.txt /*ft-xf86conf-syntax* ft-xhtml-omni insert.txt /*ft-xhtml-omni* ft-xml-omni insert.txt /*ft-xml-omni* ft-xml-syntax syntax.txt /*ft-xml-syntax* ft-xpm-syntax syntax.txt /*ft-xpm-syntax* ft-yaml-syntax syntax.txt /*ft-yaml-syntax* ft-zsh-syntax syntax.txt /*ft-zsh-syntax* ft_ada.txt ft_ada.txt /*ft_ada.txt* ft_sql.txt ft_sql.txt /*ft_sql.txt* ftdetect filetype.txt /*ftdetect* 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() eval.txt /*function()* 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-search-undo eval.txt /*function-search-undo* function_key intro.txt /*function_key* functions eval.txt /*functions* 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+ undo.txt /*g+* g, motion.txt /*g,* g- undo.txt /*g-* g0 motion.txt /*g0* g8 various.txt /*g8* g: eval.txt /*g:* g:NetrwTopLvlMenu pi_netrw.txt /*g:NetrwTopLvlMenu* g:Netrw_UserMaps pi_netrw.txt /*g:Netrw_UserMaps* g:Netrw_corehandler pi_netrw.txt /*g:Netrw_corehandler* g:Netrw_funcref pi_netrw.txt /*g:Netrw_funcref* g:actual_curbuf options.txt /*g:actual_curbuf* g:ada#Comment ft_ada.txt /*g:ada#Comment* g:ada#Ctags_Kinds ft_ada.txt /*g:ada#Ctags_Kinds* g:ada#DotWordRegex ft_ada.txt /*g:ada#DotWordRegex* g:ada#Keywords ft_ada.txt /*g:ada#Keywords* g:ada#WordRegex ft_ada.txt /*g:ada#WordRegex* g:ada_abbrev ft_ada.txt /*g:ada_abbrev* g:ada_all_tab_usage ft_ada.txt /*g:ada_all_tab_usage* g:ada_begin_preproc ft_ada.txt /*g:ada_begin_preproc* g:ada_default_compiler ft_ada.txt /*g:ada_default_compiler* g:ada_extended_completion ft_ada.txt /*g:ada_extended_completion* g:ada_extended_tagging ft_ada.txt /*g:ada_extended_tagging* g:ada_folding ft_ada.txt /*g:ada_folding* g:ada_gnat_extensions ft_ada.txt /*g:ada_gnat_extensions* g:ada_line_errors ft_ada.txt /*g:ada_line_errors* g:ada_no_tab_space_error ft_ada.txt /*g:ada_no_tab_space_error* g:ada_no_trail_space_error ft_ada.txt /*g:ada_no_trail_space_error* g:ada_omni_with_keywords ft_ada.txt /*g:ada_omni_with_keywords* g:ada_rainbow_color ft_ada.txt /*g:ada_rainbow_color* g:ada_space_errors ft_ada.txt /*g:ada_space_errors* g:ada_standard_types ft_ada.txt /*g:ada_standard_types* g:ada_with_gnat_project_files ft_ada.txt /*g:ada_with_gnat_project_files* g:ada_withuse_ordinary ft_ada.txt /*g:ada_withuse_ordinary* g:clojure_align_multiline_strings indent.txt /*g:clojure_align_multiline_strings* g:clojure_align_subforms indent.txt /*g:clojure_align_subforms* g:clojure_fold syntax.txt /*g:clojure_fold* g:clojure_fuzzy_indent indent.txt /*g:clojure_fuzzy_indent* g:clojure_fuzzy_indent_blacklist indent.txt /*g:clojure_fuzzy_indent_blacklist* g:clojure_fuzzy_indent_patterns indent.txt /*g:clojure_fuzzy_indent_patterns* g:clojure_maxlines indent.txt /*g:clojure_maxlines* g:clojure_special_indent_words indent.txt /*g:clojure_special_indent_words* g:colors_name options.txt /*g:colors_name* g:decada ft_ada.txt /*g:decada* g:decada.Error_Format ft_ada.txt /*g:decada.Error_Format* g:decada.Make() ft_ada.txt /*g:decada.Make()* g:decada.Make_Command ft_ada.txt /*g:decada.Make_Command* g:decada.Unit_Name() ft_ada.txt /*g:decada.Unit_Name()* g:filetype_csh syntax.txt /*g:filetype_csh* g:filetype_r syntax.txt /*g:filetype_r* g:gnat ft_ada.txt /*g:gnat* g:gnat.Error_Format ft_ada.txt /*g:gnat.Error_Format* g:gnat.Find() ft_ada.txt /*g:gnat.Find()* g:gnat.Find_Program ft_ada.txt /*g:gnat.Find_Program* g:gnat.Make() ft_ada.txt /*g:gnat.Make()* g:gnat.Make_Command ft_ada.txt /*g:gnat.Make_Command* g:gnat.Pretty() ft_ada.txt /*g:gnat.Pretty()* g:gnat.Pretty_Program ft_ada.txt /*g:gnat.Pretty_Program* g:gnat.Project_File ft_ada.txt /*g:gnat.Project_File* g:gnat.Set_Project_File() ft_ada.txt /*g:gnat.Set_Project_File()* g:gnat.Tags() ft_ada.txt /*g:gnat.Tags()* g:gnat.Tags_Command ft_ada.txt /*g:gnat.Tags_Command* g:html_charset_override syntax.txt /*g:html_charset_override* g:html_diff_one_file syntax.txt /*g:html_diff_one_file* g:html_dynamic_folds syntax.txt /*g:html_dynamic_folds* g:html_encoding_override syntax.txt /*g:html_encoding_override* g:html_end_line syntax.txt /*g:html_end_line* g:html_expand_tabs syntax.txt /*g:html_expand_tabs* g:html_font syntax.txt /*g:html_font* g:html_hover_unfold syntax.txt /*g:html_hover_unfold* g:html_id_expr syntax.txt /*g:html_id_expr* g:html_ignore_conceal syntax.txt /*g:html_ignore_conceal* g:html_ignore_folding syntax.txt /*g:html_ignore_folding* g:html_line_ids syntax.txt /*g:html_line_ids* g:html_no_foldcolumn syntax.txt /*g:html_no_foldcolumn* g:html_no_invalid syntax.txt /*g:html_no_invalid* g:html_no_pre syntax.txt /*g:html_no_pre* g:html_no_progress syntax.txt /*g:html_no_progress* g:html_number_lines syntax.txt /*g:html_number_lines* g:html_pre_wrap syntax.txt /*g:html_pre_wrap* g:html_prevent_copy syntax.txt /*g:html_prevent_copy* g:html_start_line syntax.txt /*g:html_start_line* g:html_use_css syntax.txt /*g:html_use_css* g:html_use_encoding syntax.txt /*g:html_use_encoding* g:html_use_xhtml syntax.txt /*g:html_use_xhtml* g:html_whole_filler syntax.txt /*g:html_whole_filler* g:netrw_altfile pi_netrw.txt /*g:netrw_altfile* g:netrw_alto pi_netrw.txt /*g:netrw_alto* g:netrw_altv pi_netrw.txt /*g:netrw_altv* g:netrw_banner pi_netrw.txt /*g:netrw_banner* g:netrw_bannerbackslash pi_netrw.txt /*g:netrw_bannerbackslash* g:netrw_browse_split pi_netrw.txt /*g:netrw_browse_split* g:netrw_browsex_viewer pi_netrw.txt /*g:netrw_browsex_viewer* g:netrw_bufsettings pi_netrw.txt /*g:netrw_bufsettings* g:netrw_chgperm pi_netrw.txt /*g:netrw_chgperm* g:netrw_chgwin pi_netrw.txt /*g:netrw_chgwin* g:netrw_compress pi_netrw.txt /*g:netrw_compress* g:netrw_ctags pi_netrw.txt /*g:netrw_ctags* g:netrw_cursor pi_netrw.txt /*g:netrw_cursor* g:netrw_cygwin pi_netrw.txt /*g:netrw_cygwin* g:netrw_dav_cmd pi_netrw.txt /*g:netrw_dav_cmd* g:netrw_decompress pi_netrw.txt /*g:netrw_decompress* g:netrw_dirhistmax pi_netrw.txt /*g:netrw_dirhistmax* g:netrw_dynamic_maxfilenamelen pi_netrw.txt /*g:netrw_dynamic_maxfilenamelen* g:netrw_errorlvl pi_netrw.txt /*g:netrw_errorlvl* g:netrw_fastbrowse pi_netrw.txt /*g:netrw_fastbrowse* g:netrw_fetch_cmd pi_netrw.txt /*g:netrw_fetch_cmd* g:netrw_ffkeep pi_netrw.txt /*g:netrw_ffkeep* g:netrw_file_cmd pi_netrw.txt /*g:netrw_file_cmd* g:netrw_fname_escape pi_netrw.txt /*g:netrw_fname_escape* g:netrw_ftp pi_netrw.txt /*g:netrw_ftp* g:netrw_ftp_browse_reject pi_netrw.txt /*g:netrw_ftp_browse_reject* g:netrw_ftp_cmd pi_netrw.txt /*g:netrw_ftp_cmd* g:netrw_ftp_list_cmd pi_netrw.txt /*g:netrw_ftp_list_cmd* g:netrw_ftp_options pi_netrw.txt /*g:netrw_ftp_options* g:netrw_ftp_sizelist_cmd pi_netrw.txt /*g:netrw_ftp_sizelist_cmd* g:netrw_ftp_timelist_cmd pi_netrw.txt /*g:netrw_ftp_timelist_cmd* g:netrw_ftpextracmd pi_netrw.txt /*g:netrw_ftpextracmd* g:netrw_ftpmode pi_netrw.txt /*g:netrw_ftpmode* g:netrw_glob_escape pi_netrw.txt /*g:netrw_glob_escape* g:netrw_gx pi_netrw.txt /*g:netrw_gx* g:netrw_hide pi_netrw.txt /*g:netrw_hide* g:netrw_home pi_netrw.txt /*g:netrw_home* g:netrw_http_cmd pi_netrw.txt /*g:netrw_http_cmd* g:netrw_http_put_cmd pi_netrw.txt /*g:netrw_http_put_cmd* g:netrw_http_xcmd pi_netrw.txt /*g:netrw_http_xcmd* g:netrw_ignorenetrc pi_netrw.txt /*g:netrw_ignorenetrc* g:netrw_keepdir pi_netrw.txt /*g:netrw_keepdir* g:netrw_keepj pi_netrw.txt /*g:netrw_keepj* g:netrw_list_cmd pi_netrw.txt /*g:netrw_list_cmd* g:netrw_list_cmd_options pi_netrw.txt /*g:netrw_list_cmd_options* g:netrw_list_hide pi_netrw.txt /*g:netrw_list_hide* g:netrw_liststyle pi_netrw.txt /*g:netrw_liststyle* g:netrw_localcopycmd pi_netrw.txt /*g:netrw_localcopycmd* g:netrw_localcopydircmd pi_netrw.txt /*g:netrw_localcopydircmd* g:netrw_localmkdir pi_netrw.txt /*g:netrw_localmkdir* g:netrw_localmovecmd pi_netrw.txt /*g:netrw_localmovecmd* g:netrw_localrmdir pi_netrw.txt /*g:netrw_localrmdir* g:netrw_maxfilenamelen pi_netrw.txt /*g:netrw_maxfilenamelen* g:netrw_menu pi_netrw.txt /*g:netrw_menu* g:netrw_mkdir_cmd pi_netrw.txt /*g:netrw_mkdir_cmd* g:netrw_mousemaps pi_netrw.txt /*g:netrw_mousemaps* g:netrw_nobeval pi_netrw.txt /*g:netrw_nobeval* g:netrw_nogx pi_netrw.txt /*g:netrw_nogx* g:netrw_preview pi_netrw.txt /*g:netrw_preview* g:netrw_rcp_cmd pi_netrw.txt /*g:netrw_rcp_cmd* g:netrw_remote_mkdir pi_netrw.txt /*g:netrw_remote_mkdir* g:netrw_retmap pi_netrw.txt /*g:netrw_retmap* g:netrw_rm_cmd pi_netrw.txt /*g:netrw_rm_cmd* g:netrw_rmdir_cmd pi_netrw.txt /*g:netrw_rmdir_cmd* g:netrw_rmf_cmd pi_netrw.txt /*g:netrw_rmf_cmd* g:netrw_rsync_cmd pi_netrw.txt /*g:netrw_rsync_cmd* g:netrw_scp_cmd pi_netrw.txt /*g:netrw_scp_cmd* g:netrw_scpport pi_netrw.txt /*g:netrw_scpport* g:netrw_sepchr pi_netrw.txt /*g:netrw_sepchr* g:netrw_servername pi_netrw.txt /*g:netrw_servername* g:netrw_sftp_cmd pi_netrw.txt /*g:netrw_sftp_cmd* g:netrw_silent pi_netrw.txt /*g:netrw_silent* g:netrw_sizestyle pi_netrw.txt /*g:netrw_sizestyle* g:netrw_sort_by pi_netrw.txt /*g:netrw_sort_by* g:netrw_sort_direction pi_netrw.txt /*g:netrw_sort_direction* g:netrw_sort_options pi_netrw.txt /*g:netrw_sort_options* g:netrw_sort_sequence pi_netrw.txt /*g:netrw_sort_sequence* g:netrw_special_syntax pi_netrw.txt /*g:netrw_special_syntax* g:netrw_ssh_browse_reject pi_netrw.txt /*g:netrw_ssh_browse_reject* g:netrw_ssh_cmd pi_netrw.txt /*g:netrw_ssh_cmd* g:netrw_sshport pi_netrw.txt /*g:netrw_sshport* g:netrw_timefmt pi_netrw.txt /*g:netrw_timefmt* g:netrw_tmpfile_escape pi_netrw.txt /*g:netrw_tmpfile_escape* g:netrw_uid pi_netrw.txt /*g:netrw_uid* g:netrw_use_errorwindow pi_netrw.txt /*g:netrw_use_errorwindow* g:netrw_use_noswf pi_netrw.txt /*g:netrw_use_noswf* g:netrw_use_nt_rcp pi_netrw.txt /*g:netrw_use_nt_rcp* g:netrw_usetab pi_netrw.txt /*g:netrw_usetab* g:netrw_win95ftp pi_netrw.txt /*g:netrw_win95ftp* g:netrw_winsize pi_netrw.txt /*g:netrw_winsize* g:netrw_wiw pi_netrw.txt /*g:netrw_wiw* g:netrw_xstrlen pi_netrw.txt /*g:netrw_xstrlen* g:sh_isk syntax.txt /*g:sh_isk* g:sh_noisk syntax.txt /*g:sh_noisk* g:syntax_on syntax.txt /*g:syntax_on* g:tar_browseoptions pi_tar.txt /*g:tar_browseoptions* g:tar_cmd pi_tar.txt /*g:tar_cmd* g:tar_copycmd pi_tar.txt /*g:tar_copycmd* g:tar_extractcmd pi_tar.txt /*g:tar_extractcmd* g:tar_nomax pi_tar.txt /*g:tar_nomax* g:tar_readoptions pi_tar.txt /*g:tar_readoptions* g:tar_secure pi_tar.txt /*g:tar_secure* g:tar_writeoptions pi_tar.txt /*g:tar_writeoptions* g:tex_comment_nospell syntax.txt /*g:tex_comment_nospell* g:tex_conceal syntax.txt /*g:tex_conceal* g:tex_fast syntax.txt /*g:tex_fast* g:tex_flavor filetype.txt /*g:tex_flavor* g:tex_fold_enabled syntax.txt /*g:tex_fold_enabled* g:tex_isk syntax.txt /*g:tex_isk* g:tex_no_error syntax.txt /*g:tex_no_error* g:tex_nospell syntax.txt /*g:tex_nospell* g:tex_stylish syntax.txt /*g:tex_stylish* g:tex_subscripts syntax.txt /*g:tex_subscripts* g:tex_superscripts syntax.txt /*g:tex_superscripts* g:tex_verbspell syntax.txt /*g:tex_verbspell* g:var eval.txt /*g:var* g:vimball_home pi_vimball.txt /*g:vimball_home* g:vimball_mkdir pi_vimball.txt /*g:vimball_mkdir* g:vimsyn_embed syntax.txt /*g:vimsyn_embed* g:vimsyn_folding syntax.txt /*g:vimsyn_folding* g:vimsyn_maxlines syntax.txt /*g:vimsyn_maxlines* g:vimsyn_minlines syntax.txt /*g:vimsyn_minlines* g:vimsyn_noerror syntax.txt /*g:vimsyn_noerror* g:yaml_schema syntax.txt /*g:yaml_schema* g:zip_nomax pi_zip.txt /*g:zip_nomax* g:zip_shq pi_zip.txt /*g:zip_shq* g:zip_unzipcmd pi_zip.txt /*g:zip_unzipcmd* g:zip_zipcmd pi_zip.txt /*g:zip_zipcmd* g; motion.txt /*g;* g< message.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?* g@ map.txt /*g@* gD pattern.txt /*gD* gE motion.txt /*gE* gF editing.txt /*gF* gH visual.txt /*gH* gI insert.txt /*gI* gJ change.txt /*gJ* gN visual.txt /*gN* gP change.txt /*gP* gQ intro.txt /*gQ* gR change.txt /*gR* gT tabpage.txt /*gT* 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* garbagecollect() eval.txt /*garbagecollect()* gd pattern.txt /*gd* gdb debug.txt /*gdb* ge motion.txt /*ge* get() eval.txt /*get()* get-ms-debuggers debug.txt /*get-ms-debuggers* getbufline() eval.txt /*getbufline()* getbufvar() eval.txt /*getbufvar()* getchar() eval.txt /*getchar()* getcharmod() eval.txt /*getcharmod()* getcharsearch() eval.txt /*getcharsearch()* getcmdline() eval.txt /*getcmdline()* getcmdpos() eval.txt /*getcmdpos()* getcmdtype() eval.txt /*getcmdtype()* getcmdwintype() eval.txt /*getcmdwintype()* getcurpos() eval.txt /*getcurpos()* getcwd() eval.txt /*getcwd()* getfontname() eval.txt /*getfontname()* getfperm() eval.txt /*getfperm()* getfsize() eval.txt /*getfsize()* getftime() eval.txt /*getftime()* getftype() eval.txt /*getftype()* getlatestvimscripts-install pi_getscript.txt /*getlatestvimscripts-install* getline() eval.txt /*getline()* getloclist() eval.txt /*getloclist()* getmatches() eval.txt /*getmatches()* getpid() eval.txt /*getpid()* getpos() eval.txt /*getpos()* getqflist() eval.txt /*getqflist()* getreg() eval.txt /*getreg()* getregtype() eval.txt /*getregtype()* getscript pi_getscript.txt /*getscript* getscript-autoinstall pi_getscript.txt /*getscript-autoinstall* getscript-data pi_getscript.txt /*getscript-data* getscript-history pi_getscript.txt /*getscript-history* getscript-plugins pi_getscript.txt /*getscript-plugins* getscript-start pi_getscript.txt /*getscript-start* gettabvar() eval.txt /*gettabvar()* gettabwinvar() eval.txt /*gettabwinvar()* 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()* glob2regpat() eval.txt /*glob2regpat()* global-ime mbyte.txt /*global-ime* global-local options.txt /*global-local* global-variable eval.txt /*global-variable* global_markfilelist pi_netrw.txt /*global_markfilelist* globpath() eval.txt /*globpath()* glvs pi_getscript.txt /*glvs* glvs-alg pi_getscript.txt /*glvs-alg* glvs-algorithm pi_getscript.txt /*glvs-algorithm* glvs-autoinstall pi_getscript.txt /*glvs-autoinstall* glvs-contents pi_getscript.txt /*glvs-contents* glvs-copyright pi_getscript.txt /*glvs-copyright* glvs-data pi_getscript.txt /*glvs-data* glvs-dist-install pi_getscript.txt /*glvs-dist-install* glvs-hist pi_getscript.txt /*glvs-hist* glvs-install pi_getscript.txt /*glvs-install* glvs-options pi_getscript.txt /*glvs-options* glvs-plugins pi_getscript.txt /*glvs-plugins* glvs-usage pi_getscript.txt /*glvs-usage* gm motion.txt /*gm* gn visual.txt /*gn* gnat#Insert_Tags_Header() ft_ada.txt /*gnat#Insert_Tags_Header()* gnat#New() ft_ada.txt /*gnat#New()* gnat-xref ft_ada.txt /*gnat-xref* gnat_members ft_ada.txt /*gnat_members* 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.vim syntax.txt /*groff.vim* gross-national-happiness intro.txt /*gross-national-happiness* group-name syntax.txt /*group-name* gs various.txt /*gs* gsp.vim syntax.txt /*gsp.vim* gstar pattern.txt /*gstar* gt tabpage.txt /*gt* gtk-tooltip-colors gui_x11.txt /*gtk-tooltip-colors* gu change.txt /*gu* gugu change.txt /*gugu* gui gui.txt /*gui* gui-IME gui.txt /*gui-IME* 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-functions usr_41.txt /*gui-functions* 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-kde gui_x11.txt /*gui-kde* 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-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-w32-windowid gui_w32.txt /*gui-w32-windowid* 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-kde gui_x11.txt /*gui-x11-kde* 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_w32.txt gui_w32.txt /*gui_w32.txt* gui_x11.txt gui_x11.txt /*gui_x11.txt* guifontwide_gtk2 options.txt /*guifontwide_gtk2* guifontwide_win_mbyte options.txt /*guifontwide_win_mbyte* 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* gwgw change.txt /*gwgw* gww change.txt /*gww* 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* has-python if_pyth.txt /*has-python* has_key() eval.txt /*has_key()* haskell.vim syntax.txt /*haskell.vim* haslocaldir() eval.txt /*haslocaldir()* hasmapto() eval.txt /*hasmapto()* hebrew hebrew.txt /*hebrew* hebrew.txt hebrew.txt /*hebrew.txt* help helphelp.txt /*help* help-context help.txt /*help-context* help-summary usr_02.txt /*help-summary* help-tags tags 1 help-translated helphelp.txt /*help-translated* help-writing helphelp.txt /*help-writing* help-xterm-window helphelp.txt /*help-xterm-window* help.txt help.txt /*help.txt* helpfile_name.txt helphelp.txt /*helpfile_name.txt* helphelp helphelp.txt /*helphelp* helphelp.txt helphelp.txt /*helphelp.txt* hex-editing tips.txt /*hex-editing* hex-number eval.txt /*hex-number* hidden-buffer windows.txt /*hidden-buffer* hidden-changed version5.txt /*hidden-changed* hidden-menus gui.txt /*hidden-menus* hidden-options options.txt /*hidden-options* 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-guisp syntax.txt /*highlight-guisp* 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()* highlighting-functions usr_41.txt /*highlighting-functions* 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* history-functions usr_41.txt /*history-functions* hit-enter message.txt /*hit-enter* hit-enter-prompt message.txt /*hit-enter-prompt* hit-return message.txt /*hit-return* hitest.vim syntax.txt /*hitest.vim* hjkl usr_02.txt /*hjkl* hl-ColorColumn syntax.txt /*hl-ColorColumn* hl-Conceal syntax.txt /*hl-Conceal* hl-Cursor syntax.txt /*hl-Cursor* hl-CursorColumn syntax.txt /*hl-CursorColumn* hl-CursorIM syntax.txt /*hl-CursorIM* hl-CursorLine syntax.txt /*hl-CursorLine* hl-CursorLineNr syntax.txt /*hl-CursorLineNr* 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-Ignore syntax.txt /*hl-Ignore* hl-IncSearch syntax.txt /*hl-IncSearch* hl-LineNr syntax.txt /*hl-LineNr* hl-MatchParen syntax.txt /*hl-MatchParen* 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-Pmenu syntax.txt /*hl-Pmenu* hl-PmenuSbar syntax.txt /*hl-PmenuSbar* hl-PmenuSel syntax.txt /*hl-PmenuSel* hl-PmenuThumb syntax.txt /*hl-PmenuThumb* 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-SpellBad syntax.txt /*hl-SpellBad* hl-SpellCap syntax.txt /*hl-SpellCap* hl-SpellLocal syntax.txt /*hl-SpellLocal* hl-SpellRare syntax.txt /*hl-SpellRare* hl-StatusLine syntax.txt /*hl-StatusLine* hl-StatusLineNC syntax.txt /*hl-StatusLineNC* hl-TabLine syntax.txt /*hl-TabLine* hl-TabLineFill syntax.txt /*hl-TabLineFill* hl-TabLineSel syntax.txt /*hl-TabLineSel* 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-User9 syntax.txt /*hl-User9* 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()* hlsearch-variable eval.txt /*hlsearch-variable* 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-flavor insert.txt /*html-flavor* html-indent indent.txt /*html-indent* html-indenting indent.txt /*html-indenting* html.vim syntax.txt /*html.vim* 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<* i> motion.txt /*i>* iB motion.txt /*iB* iBus gui.txt /*iBus* 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-PageDown> tabpage.txt /*i_<C-PageDown>* i_<C-PageUp> tabpage.txt /*i_<C-PageUp>* 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> helphelp.txt /*i_<F1>* i_<Help> helphelp.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_<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-Right> insert.txt /*i_<S-Right>* i_<S-ScrollWheelDown> insert.txt /*i_<S-ScrollWheelDown>* i_<S-ScrollWheelLeft> insert.txt /*i_<S-ScrollWheelLeft>* i_<S-ScrollWheelRight> insert.txt /*i_<S-ScrollWheelRight>* i_<S-ScrollWheelUp> insert.txt /*i_<S-ScrollWheelUp>* i_<S-Up> insert.txt /*i_<S-Up>* i_<ScrollWheelDown> insert.txt /*i_<ScrollWheelDown>* i_<ScrollWheelLeft> insert.txt /*i_<ScrollWheelLeft>* i_<ScrollWheelRight> insert.txt /*i_<ScrollWheelRight>* i_<ScrollWheelUp> insert.txt /*i_<ScrollWheelUp>* i_<Tab> insert.txt /*i_<Tab>* i_<Up> insert.txt /*i_<Up>* i_BS insert.txt /*i_BS* i_CTRL-<PageDown> tabpage.txt /*i_CTRL-<PageDown>* i_CTRL-<PageUp> tabpage.txt /*i_CTRL-<PageUp>* 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-F indent.txt /*i_CTRL-F* 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_U insert.txt /*i_CTRL-G_U* 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 insert.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_= 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-O insert.txt /*i_CTRL-X_CTRL-O* i_CTRL-X_CTRL-P insert.txt /*i_CTRL-X_CTRL-P* i_CTRL-X_CTRL-S insert.txt /*i_CTRL-X_CTRL-S* i_CTRL-X_CTRL-T insert.txt /*i_CTRL-X_CTRL-T* i_CTRL-X_CTRL-U insert.txt /*i_CTRL-X_CTRL-U* 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-X_index index.txt /*i_CTRL-X_index* i_CTRL-X_s insert.txt /*i_CTRL-X_s* 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-\_CTRL-O insert.txt /*i_CTRL-\\_CTRL-O* 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* i` motion.txt /*i`* ia64.vim syntax.txt /*ia64.vim* ib motion.txt /*ib* iccf uganda.txt /*iccf* iccf-donations uganda.txt /*iccf-donations* icon-changed version4.txt /*icon-changed* iconise starting.txt /*iconise* iconize starting.txt /*iconize* iconv() eval.txt /*iconv()* iconv-dynamic mbyte.txt /*iconv-dynamic* ident-search tips.txt /*ident-search* idl-syntax syntax.txt /*idl-syntax* idl.vim syntax.txt /*idl.vim* if_cscop.txt if_cscop.txt /*if_cscop.txt* if_lua.txt if_lua.txt /*if_lua.txt* if_mzsch.txt if_mzsch.txt /*if_mzsch.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* improvements-7 version7.txt /*improvements-7* in_bot channel.txt /*in_bot* in_buf channel.txt /*in_buf* in_mode channel.txt /*in_mode* in_name channel.txt /*in_name* in_top channel.txt /*in_top* 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* incompatible-7 version7.txt /*incompatible-7* 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() eval.txt /*index()* index.txt index.txt /*index.txt* info-message starting.txt /*info-message* inform.vim syntax.txt /*inform.vim* informix ft_sql.txt /*informix* initialization starting.txt /*initialization* input() eval.txt /*input()* inputdialog() eval.txt /*inputdialog()* inputlist() eval.txt /*inputlist()* inputrestore() eval.txt /*inputrestore()* inputsave() eval.txt /*inputsave()* inputsecret() eval.txt /*inputsecret()* ins-completion insert.txt /*ins-completion* ins-completion-menu insert.txt /*ins-completion-menu* 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() eval.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* insertmode-variable eval.txt /*insertmode-variable* 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* interactive-functions usr_41.txt /*interactive-functions* interfaces-5.2 version5.txt /*interfaces-5.2* internal-variables eval.txt /*internal-variables* internal-wordlist spell.txt /*internal-wordlist* internet intro.txt /*internet* intro intro.txt /*intro* intro.txt intro.txt /*intro.txt* inverse syntax.txt /*inverse* invert() eval.txt /*invert()* ip motion.txt /*ip* iquote motion.txt /*iquote* is motion.txt /*is* isdirectory() eval.txt /*isdirectory()* islocked() eval.txt /*islocked()* isnan() eval.txt /*isnan()* it motion.txt /*it* italic syntax.txt /*italic* items() eval.txt /*items()* 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.vim syntax.txt /*java.vim* javascript-cinoptions indent.txt /*javascript-cinoptions* javascript-indenting indent.txt /*javascript-indenting* job channel.txt /*job* job-callback channel.txt /*job-callback* job-channel-overview channel.txt /*job-channel-overview* job-close_cb channel.txt /*job-close_cb* job-control channel.txt /*job-control* job-err_cb channel.txt /*job-err_cb* job-err_io channel.txt /*job-err_io* job-exit_cb channel.txt /*job-exit_cb* job-in_io channel.txt /*job-in_io* job-options channel.txt /*job-options* job-out_cb channel.txt /*job-out_cb* job-out_io channel.txt /*job-out_io* job-start channel.txt /*job-start* job-start-if-needed channel.txt /*job-start-if-needed* job-start-nochannel channel.txt /*job-start-nochannel* job-stoponexit channel.txt /*job-stoponexit* job-term channel.txt /*job-term* job-timeout channel.txt /*job-timeout* job_getchannel() eval.txt /*job_getchannel()* job_info() eval.txt /*job_info()* job_setoptions() eval.txt /*job_setoptions()* job_start() eval.txt /*job_start()* job_status() eval.txt /*job_status()* job_stop() eval.txt /*job_stop()* join() eval.txt /*join()* js_decode() eval.txt /*js_decode()* js_encode() eval.txt /*js_encode()* jsbterm-mouse options.txt /*jsbterm-mouse* json_decode() eval.txt /*json_decode()* json_encode() eval.txt /*json_encode()* 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* kde gui_x11.txt /*kde* 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* key-variable eval.txt /*key-variable* keycodes intro.txt /*keycodes* keymap-accents mbyte.txt /*keymap-accents* 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-comma term.txt /*keypad-comma* 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* keys() eval.txt /*keys()* known-bugs todo.txt /*known-bugs* l motion.txt /*l* l: eval.txt /*l:* l:var eval.txt /*l:var* lCursor mbyte.txt /*lCursor* 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()* latex-syntax syntax.txt /*latex-syntax* lc_time-variable eval.txt /*lc_time-variable* lcs-conceal options.txt /*lcs-conceal* lcs-eol options.txt /*lcs-eol* lcs-extends options.txt /*lcs-extends* lcs-nbsp options.txt /*lcs-nbsp* lcs-precedes options.txt /*lcs-precedes* lcs-space options.txt /*lcs-space* lcs-tab options.txt /*lcs-tab* lcs-trail options.txt /*lcs-trail* left-right-motions motion.txt /*left-right-motions* len() eval.txt /*len()* less various.txt /*less* letter print.txt /*letter* 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* lifelines.vim syntax.txt /*lifelines.vim* 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* lisp.vim syntax.txt /*lisp.vim* lispindent() eval.txt /*lispindent()* list eval.txt /*list* list-functions usr_41.txt /*list-functions* list-identity eval.txt /*list-identity* list-index eval.txt /*list-index* list-modification eval.txt /*list-modification* list-repeat windows.txt /*list-repeat* 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* local-variables eval.txt /*local-variables* local_markfilelist pi_netrw.txt /*local_markfilelist* locale mbyte.txt /*locale* locale-name mbyte.txt /*locale-name* localtime() eval.txt /*localtime()* location-list quickfix.txt /*location-list* location-list-window quickfix.txt /*location-list-window* log() eval.txt /*log()* log10() eval.txt /*log10()* logipat pi_logipat.txt /*logipat* logipat-arg pi_logipat.txt /*logipat-arg* logipat-caveat pi_logipat.txt /*logipat-caveat* logipat-contents pi_logipat.txt /*logipat-contents* logipat-copyright pi_logipat.txt /*logipat-copyright* logipat-examples pi_logipat.txt /*logipat-examples* logipat-history pi_logipat.txt /*logipat-history* logipat-input pi_logipat.txt /*logipat-input* logipat-man pi_logipat.txt /*logipat-man* logipat-manual pi_logipat.txt /*logipat-manual* logipat-operators pi_logipat.txt /*logipat-operators* logipat-pattern pi_logipat.txt /*logipat-pattern* long-lines version5.txt /*long-lines* love intro.txt /*love* lowercase change.txt /*lowercase* lpc.vim syntax.txt /*lpc.vim* lua if_lua.txt /*lua* lua-buffer if_lua.txt /*lua-buffer* lua-commands if_lua.txt /*lua-commands* lua-dict if_lua.txt /*lua-dict* lua-dynamic if_lua.txt /*lua-dynamic* lua-eval if_lua.txt /*lua-eval* lua-funcref if_lua.txt /*lua-funcref* lua-list if_lua.txt /*lua-list* lua-luaeval if_lua.txt /*lua-luaeval* lua-vim if_lua.txt /*lua-vim* lua-window if_lua.txt /*lua-window* lua.vim syntax.txt /*lua.vim* luaeval() eval.txt /*luaeval()* m motion.txt /*m* m' motion.txt /*m'* 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.vim syntax.txt /*mail.vim* maillist intro.txt /*maillist* maillist-archive intro.txt /*maillist-archive* make.vim syntax.txt /*make.vim* man.vim filetype.txt /*man.vim* manual-copyright usr_01.txt /*manual-copyright* map() eval.txt /*map()* map-<SID> map.txt /*map-<SID>* map-CTRL-C map.txt /*map-CTRL-C* map-ambiguous map.txt /*map-ambiguous* map-backslash map.txt /*map-backslash* map-backtick tips.txt /*map-backtick* map-bar map.txt /*map-bar* map-comments map.txt /*map-comments* map-empty-rhs map.txt /*map-empty-rhs* map-error map.txt /*map-error* 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-precedence map.txt /*map-precedence* map-return map.txt /*map-return* map-self-destroy tips.txt /*map-self-destroy* map-space_in_lhs map.txt /*map-space_in_lhs* map-space_in_rhs map.txt /*map-space_in_rhs* 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.vim syntax.txt /*maple.vim* mapleader map.txt /*mapleader* maplocalleader map.txt /*maplocalleader* mapmode-c map.txt /*mapmode-c* mapmode-i map.txt /*mapmode-i* mapmode-ic map.txt /*mapmode-ic* mapmode-l map.txt /*mapmode-l* mapmode-n map.txt /*mapmode-n* mapmode-nvo map.txt /*mapmode-nvo* mapmode-o map.txt /*mapmode-o* mapmode-s map.txt /*mapmode-s* mapmode-v map.txt /*mapmode-v* mapmode-x map.txt /*mapmode-x* mapping map.txt /*mapping* mapping-functions usr_41.txt /*mapping-functions* mark motion.txt /*mark* mark-functions usr_41.txt /*mark-functions* mark-motions motion.txt /*mark-motions* markfilelist pi_netrw.txt /*markfilelist* masm.vim syntax.txt /*masm.vim* match() eval.txt /*match()* match-highlight pattern.txt /*match-highlight* match-parens tips.txt /*match-parens* matchadd() eval.txt /*matchadd()* matchaddpos() eval.txt /*matchaddpos()* matcharg() eval.txt /*matcharg()* matchdelete() eval.txt /*matchdelete()* matchend() eval.txt /*matchend()* matchit-install usr_05.txt /*matchit-install* matchlist() eval.txt /*matchlist()* matchparen pi_paren.txt /*matchparen* matchstr() eval.txt /*matchstr()* matchstrpos() eval.txt /*matchstrpos()* max() eval.txt /*max()* mbyte-IME mbyte.txt /*mbyte-IME* mbyte-XIM mbyte.txt /*mbyte-XIM* mbyte-combining mbyte.txt /*mbyte-combining* mbyte-composing mbyte.txt /*mbyte-composing* 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* merge diff.txt /*merge* message-history message.txt /*message-history* message.txt message.txt /*message.txt* messages message.txt /*messages* meta intro.txt /*meta* min() eval.txt /*min()* missing-options vi_diff.txt /*missing-options* mkdir() eval.txt /*mkdir()* mlang.txt mlang.txt /*mlang.txt* mma.vim syntax.txt /*mma.vim* 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.vim syntax.txt /*moo.vim* more-compatible version5.txt /*more-compatible* more-prompt message.txt /*more-prompt* more-variables eval.txt /*more-variables* 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* mouse_col-variable eval.txt /*mouse_col-variable* mouse_lnum-variable eval.txt /*mouse_lnum-variable* mouse_win-variable eval.txt /*mouse_win-variable* movement intro.txt /*movement* ms-dos os_msdos.txt /*ms-dos* msdos os_msdos.txt /*msdos* msdos-mode gui_w32.txt /*msdos-mode* 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* mysql ft_sql.txt /*mysql* mysyntaxfile syntax.txt /*mysyntaxfile* mysyntaxfile-add syntax.txt /*mysyntaxfile-add* mysyntaxfile-replace syntax.txt /*mysyntaxfile-replace* mzeval() eval.txt /*mzeval()* mzscheme if_mzsch.txt /*mzscheme* mzscheme-buffer if_mzsch.txt /*mzscheme-buffer* mzscheme-commands if_mzsch.txt /*mzscheme-commands* mzscheme-dynamic if_mzsch.txt /*mzscheme-dynamic* mzscheme-examples if_mzsch.txt /*mzscheme-examples* mzscheme-funcref if_mzsch.txt /*mzscheme-funcref* mzscheme-mzeval if_mzsch.txt /*mzscheme-mzeval* mzscheme-sandbox if_mzsch.txt /*mzscheme-sandbox* mzscheme-setup if_mzsch.txt /*mzscheme-setup* mzscheme-threads if_mzsch.txt /*mzscheme-threads* mzscheme-vim if_mzsch.txt /*mzscheme-vim* mzscheme-vimext if_mzsch.txt /*mzscheme-vimext* mzscheme-window if_mzsch.txt /*mzscheme-window* n pattern.txt /*n* 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-protocol_errors netbeans.txt /*nb-protocol_errors* nb-special netbeans.txt /*nb-special* nb-terms netbeans.txt /*nb-terms* ncf.vim syntax.txt /*ncf.vim* netbeans netbeans.txt /*netbeans* netbeans-commands netbeans.txt /*netbeans-commands* netbeans-configure netbeans.txt /*netbeans-configure* netbeans-debugging netbeans.txt /*netbeans-debugging* netbeans-download netbeans.txt /*netbeans-download* netbeans-integration netbeans.txt /*netbeans-integration* netbeans-intro netbeans.txt /*netbeans-intro* netbeans-keybindings netbeans.txt /*netbeans-keybindings* netbeans-messages netbeans.txt /*netbeans-messages* netbeans-parameters netbeans.txt /*netbeans-parameters* 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* netreadfixup pi_netrw.txt /*netreadfixup* netrw pi_netrw.txt /*netrw* netrw-% pi_netrw.txt /*netrw-%* netrw-- pi_netrw.txt /*netrw--* netrw-:Explore pi_netrw.txt /*netrw-:Explore* netrw-:Hexplore pi_netrw.txt /*netrw-:Hexplore* netrw-:Lexplore pi_netrw.txt /*netrw-:Lexplore* netrw-:MF pi_netrw.txt /*netrw-:MF* netrw-:MT pi_netrw.txt /*netrw-:MT* netrw-:NetrwC pi_netrw.txt /*netrw-:NetrwC* netrw-:NetrwMB pi_netrw.txt /*netrw-:NetrwMB* netrw-:Rexplore pi_netrw.txt /*netrw-:Rexplore* netrw-:Sexplore pi_netrw.txt /*netrw-:Sexplore* netrw-:Texplore pi_netrw.txt /*netrw-:Texplore* netrw-:Vexplore pi_netrw.txt /*netrw-:Vexplore* netrw-C pi_netrw.txt /*netrw-C* netrw-D pi_netrw.txt /*netrw-D* netrw-I pi_netrw.txt /*netrw-I* netrw-O pi_netrw.txt /*netrw-O* netrw-P pi_netrw.txt /*netrw-P* netrw-P18 pi_netrw.txt /*netrw-P18* netrw-P19 pi_netrw.txt /*netrw-P19* netrw-P20 pi_netrw.txt /*netrw-P20* netrw-P21 pi_netrw.txt /*netrw-P21* netrw-P22 pi_netrw.txt /*netrw-P22* netrw-R pi_netrw.txt /*netrw-R* netrw-S pi_netrw.txt /*netrw-S* netrw-Tb pi_netrw.txt /*netrw-Tb* netrw-Th pi_netrw.txt /*netrw-Th* netrw-U pi_netrw.txt /*netrw-U* netrw-X pi_netrw.txt /*netrw-X* netrw-a pi_netrw.txt /*netrw-a* netrw-activate pi_netrw.txt /*netrw-activate* netrw-bookmark pi_netrw.txt /*netrw-bookmark* netrw-bookmarks pi_netrw.txt /*netrw-bookmarks* netrw-browse pi_netrw.txt /*netrw-browse* netrw-browse-cmds pi_netrw.txt /*netrw-browse-cmds* netrw-browse-maps pi_netrw.txt /*netrw-browse-maps* netrw-browser pi_netrw.txt /*netrw-browser* netrw-browser-options pi_netrw.txt /*netrw-browser-options* netrw-browser-settings pi_netrw.txt /*netrw-browser-settings* netrw-browser-var pi_netrw.txt /*netrw-browser-var* netrw-browsing pi_netrw.txt /*netrw-browsing* netrw-c pi_netrw.txt /*netrw-c* netrw-c-tab pi_netrw.txt /*netrw-c-tab* netrw-cadaver pi_netrw.txt /*netrw-cadaver* netrw-chgup pi_netrw.txt /*netrw-chgup* netrw-clean pi_netrw.txt /*netrw-clean* netrw-contents pi_netrw.txt /*netrw-contents* netrw-copyright pi_netrw.txt /*netrw-copyright* netrw-cr pi_netrw.txt /*netrw-cr* netrw-createfile pi_netrw.txt /*netrw-createfile* netrw-credits pi_netrw.txt /*netrw-credits* netrw-ctrl-h pi_netrw.txt /*netrw-ctrl-h* netrw-ctrl-l pi_netrw.txt /*netrw-ctrl-l* netrw-ctrl-r pi_netrw.txt /*netrw-ctrl-r* netrw-ctrl_l pi_netrw.txt /*netrw-ctrl_l* netrw-curdir pi_netrw.txt /*netrw-curdir* netrw-d pi_netrw.txt /*netrw-d* netrw-debug pi_netrw.txt /*netrw-debug* netrw-del pi_netrw.txt /*netrw-del* netrw-delete pi_netrw.txt /*netrw-delete* netrw-dir pi_netrw.txt /*netrw-dir* netrw-dirlist pi_netrw.txt /*netrw-dirlist* netrw-downdir pi_netrw.txt /*netrw-downdir* netrw-edithide pi_netrw.txt /*netrw-edithide* netrw-editwindow pi_netrw.txt /*netrw-editwindow* netrw-enter pi_netrw.txt /*netrw-enter* netrw-ex pi_netrw.txt /*netrw-ex* netrw-explore pi_netrw.txt /*netrw-explore* netrw-explore-cmds pi_netrw.txt /*netrw-explore-cmds* netrw-externapp pi_netrw.txt /*netrw-externapp* netrw-file pi_netrw.txt /*netrw-file* netrw-filigree pi_netrw.txt /*netrw-filigree* netrw-fixup pi_netrw.txt /*netrw-fixup* netrw-ftp pi_netrw.txt /*netrw-ftp* netrw-ftype pi_netrw.txt /*netrw-ftype* netrw-gb pi_netrw.txt /*netrw-gb* netrw-gd pi_netrw.txt /*netrw-gd* netrw-getftype pi_netrw.txt /*netrw-getftype* netrw-gf pi_netrw.txt /*netrw-gf* netrw-gh pi_netrw.txt /*netrw-gh* netrw-gitignore pi_netrw.txt /*netrw-gitignore* netrw-gn pi_netrw.txt /*netrw-gn* netrw-gp pi_netrw.txt /*netrw-gp* netrw-grep pi_netrw.txt /*netrw-grep* netrw-gx pi_netrw.txt /*netrw-gx* netrw-handler pi_netrw.txt /*netrw-handler* netrw-help pi_netrw.txt /*netrw-help* netrw-hexplore pi_netrw.txt /*netrw-hexplore* netrw-hide pi_netrw.txt /*netrw-hide* netrw-hiding pi_netrw.txt /*netrw-hiding* netrw-history pi_netrw.txt /*netrw-history* netrw-horiz pi_netrw.txt /*netrw-horiz* netrw-i pi_netrw.txt /*netrw-i* netrw-incompatible pi_netrw.txt /*netrw-incompatible* netrw-internal-variables pi_netrw.txt /*netrw-internal-variables* netrw-intro-browse pi_netrw.txt /*netrw-intro-browse* netrw-leftmouse pi_netrw.txt /*netrw-leftmouse* netrw-lexplore pi_netrw.txt /*netrw-lexplore* netrw-list pi_netrw.txt /*netrw-list* netrw-listbookmark pi_netrw.txt /*netrw-listbookmark* netrw-listhack pi_netrw.txt /*netrw-listhack* netrw-login pi_netrw.txt /*netrw-login* netrw-mA pi_netrw.txt /*netrw-mA* netrw-mB pi_netrw.txt /*netrw-mB* netrw-mF pi_netrw.txt /*netrw-mF* netrw-mT pi_netrw.txt /*netrw-mT* netrw-mX pi_netrw.txt /*netrw-mX* netrw-ma pi_netrw.txt /*netrw-ma* netrw-mb pi_netrw.txt /*netrw-mb* netrw-mc pi_netrw.txt /*netrw-mc* netrw-md pi_netrw.txt /*netrw-md* netrw-me pi_netrw.txt /*netrw-me* netrw-mf pi_netrw.txt /*netrw-mf* netrw-mg pi_netrw.txt /*netrw-mg* netrw-mh pi_netrw.txt /*netrw-mh* netrw-middlemouse pi_netrw.txt /*netrw-middlemouse* netrw-ml_get pi_netrw.txt /*netrw-ml_get* netrw-mm pi_netrw.txt /*netrw-mm* netrw-mouse pi_netrw.txt /*netrw-mouse* netrw-move pi_netrw.txt /*netrw-move* netrw-mp pi_netrw.txt /*netrw-mp* netrw-mr pi_netrw.txt /*netrw-mr* netrw-ms pi_netrw.txt /*netrw-ms* netrw-mt pi_netrw.txt /*netrw-mt* netrw-mu pi_netrw.txt /*netrw-mu* netrw-mv pi_netrw.txt /*netrw-mv* netrw-mx pi_netrw.txt /*netrw-mx* netrw-mz pi_netrw.txt /*netrw-mz* netrw-netrc pi_netrw.txt /*netrw-netrc* netrw-newfile pi_netrw.txt /*netrw-newfile* netrw-nexplore pi_netrw.txt /*netrw-nexplore* netrw-noload pi_netrw.txt /*netrw-noload* netrw-nread pi_netrw.txt /*netrw-nread* netrw-ntree pi_netrw.txt /*netrw-ntree* netrw-nwrite pi_netrw.txt /*netrw-nwrite* netrw-o pi_netrw.txt /*netrw-o* netrw-obtain pi_netrw.txt /*netrw-obtain* netrw-options pi_netrw.txt /*netrw-options* netrw-p pi_netrw.txt /*netrw-p* netrw-p1 pi_netrw.txt /*netrw-p1* netrw-p10 pi_netrw.txt /*netrw-p10* netrw-p11 pi_netrw.txt /*netrw-p11* netrw-p12 pi_netrw.txt /*netrw-p12* netrw-p13 pi_netrw.txt /*netrw-p13* netrw-p14 pi_netrw.txt /*netrw-p14* netrw-p15 pi_netrw.txt /*netrw-p15* netrw-p16 pi_netrw.txt /*netrw-p16* netrw-p17 pi_netrw.txt /*netrw-p17* netrw-p2 pi_netrw.txt /*netrw-p2* netrw-p3 pi_netrw.txt /*netrw-p3* netrw-p4 pi_netrw.txt /*netrw-p4* netrw-p5 pi_netrw.txt /*netrw-p5* netrw-p6 pi_netrw.txt /*netrw-p6* netrw-p7 pi_netrw.txt /*netrw-p7* netrw-p8 pi_netrw.txt /*netrw-p8* netrw-p9 pi_netrw.txt /*netrw-p9* netrw-passwd pi_netrw.txt /*netrw-passwd* netrw-password pi_netrw.txt /*netrw-password* netrw-path pi_netrw.txt /*netrw-path* netrw-pexplore pi_netrw.txt /*netrw-pexplore* netrw-preview pi_netrw.txt /*netrw-preview* netrw-problems pi_netrw.txt /*netrw-problems* netrw-protocol pi_netrw.txt /*netrw-protocol* netrw-prvwin pi_netrw.txt /*netrw-prvwin* netrw-pscp pi_netrw.txt /*netrw-pscp* netrw-psftp pi_netrw.txt /*netrw-psftp* netrw-putty pi_netrw.txt /*netrw-putty* netrw-qF pi_netrw.txt /*netrw-qF* netrw-qL pi_netrw.txt /*netrw-qL* netrw-qb pi_netrw.txt /*netrw-qb* netrw-qf pi_netrw.txt /*netrw-qf* netrw-quickcom pi_netrw.txt /*netrw-quickcom* netrw-quickcoms pi_netrw.txt /*netrw-quickcoms* netrw-quickhelp pi_netrw.txt /*netrw-quickhelp* netrw-quickmap pi_netrw.txt /*netrw-quickmap* netrw-quickmaps pi_netrw.txt /*netrw-quickmaps* netrw-r pi_netrw.txt /*netrw-r* netrw-read pi_netrw.txt /*netrw-read* netrw-ref pi_netrw.txt /*netrw-ref* netrw-refresh pi_netrw.txt /*netrw-refresh* netrw-rename pi_netrw.txt /*netrw-rename* netrw-reverse pi_netrw.txt /*netrw-reverse* netrw-rexplore pi_netrw.txt /*netrw-rexplore* netrw-rightmouse pi_netrw.txt /*netrw-rightmouse* netrw-s pi_netrw.txt /*netrw-s* netrw-s-cr pi_netrw.txt /*netrw-s-cr* netrw-settings pi_netrw.txt /*netrw-settings* netrw-settings-window pi_netrw.txt /*netrw-settings-window* netrw-sexplore pi_netrw.txt /*netrw-sexplore* netrw-sort pi_netrw.txt /*netrw-sort* netrw-sort-sequence pi_netrw.txt /*netrw-sort-sequence* netrw-sortsequence pi_netrw.txt /*netrw-sortsequence* netrw-source pi_netrw.txt /*netrw-source* netrw-ssh-hack pi_netrw.txt /*netrw-ssh-hack* netrw-star pi_netrw.txt /*netrw-star* netrw-starpat pi_netrw.txt /*netrw-starpat* netrw-starstar pi_netrw.txt /*netrw-starstar* netrw-starstarpat pi_netrw.txt /*netrw-starstarpat* netrw-start pi_netrw.txt /*netrw-start* netrw-t pi_netrw.txt /*netrw-t* netrw-texplore pi_netrw.txt /*netrw-texplore* netrw-todo pi_netrw.txt /*netrw-todo* netrw-trailingslash pi_netrw.txt /*netrw-trailingslash* netrw-transparent pi_netrw.txt /*netrw-transparent* netrw-u pi_netrw.txt /*netrw-u* netrw-updir pi_netrw.txt /*netrw-updir* netrw-urls pi_netrw.txt /*netrw-urls* netrw-usermaps pi_netrw.txt /*netrw-usermaps* netrw-userpass pi_netrw.txt /*netrw-userpass* netrw-v pi_netrw.txt /*netrw-v* netrw-var pi_netrw.txt /*netrw-var* netrw-variables pi_netrw.txt /*netrw-variables* netrw-vexplore pi_netrw.txt /*netrw-vexplore* netrw-windows-netrc pi_netrw.txt /*netrw-windows-netrc* netrw-windows-s pi_netrw.txt /*netrw-windows-s* netrw-write pi_netrw.txt /*netrw-write* netrw-x pi_netrw.txt /*netrw-x* netrw-xfer pi_netrw.txt /*netrw-xfer* netrw.vim pi_netrw.txt /*netrw.vim* netrw_filehandler pi_netrw.txt /*netrw_filehandler* netterm-mouse options.txt /*netterm-mouse* network pi_netrw.txt /*network* new-5 version5.txt /*new-5* new-6 version6.txt /*new-6* new-7 version7.txt /*new-7* new-GTK-GUI version5.txt /*new-GTK-GUI* new-MzScheme version7.txt /*new-MzScheme* 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-conceal version7.txt /*new-conceal* new-debug-itf version6.txt /*new-debug-itf* new-debug-mode version6.txt /*new-debug-mode* new-debug-support version7.txt /*new-debug-support* new-define-operator version7.txt /*new-define-operator* 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-items-7 version7.txt /*new-items-7* new-line-continuation version5.txt /*new-line-continuation* new-location-list version7.txt /*new-location-list* new-lua version7.txt /*new-lua* new-manpage-trans version7.txt /*new-manpage-trans* new-map-expression version7.txt /*new-map-expression* new-map-select version7.txt /*new-map-select* new-more-encryption version7.txt /*new-more-encryption* new-more-highlighting version7.txt /*new-more-highlighting* new-more-unicode version7.txt /*new-more-unicode* new-multi-byte version5.txt /*new-multi-byte* new-multi-lang version6.txt /*new-multi-lang* new-netrw-explore version7.txt /*new-netrw-explore* new-network-files version6.txt /*new-network-files* new-omni-completion version7.txt /*new-omni-completion* new-onemore version7.txt /*new-onemore* 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-persistent-undo version7.txt /*new-persistent-undo* new-plugins version6.txt /*new-plugins* new-posix version7.txt /*new-posix* new-print-multi-byte version7.txt /*new-print-multi-byte* new-printing version6.txt /*new-printing* new-python3 version7.txt /*new-python3* new-regexp-engine version7.txt /*new-regexp-engine* 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-scroll-back version7.txt /*new-scroll-back* new-search-path version6.txt /*new-search-path* new-searchpat version6.txt /*new-searchpat* new-session-files version5.txt /*new-session-files* new-spell version7.txt /*new-spell* new-tab-pages version7.txt /*new-tab-pages* new-undo-branches version7.txt /*new-undo-branches* 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-script version7.txt /*new-vim-script* new-vim-server version6.txt /*new-vim-server* new-vimgrep version7.txt /*new-vimgrep* new-virtedit version6.txt /*new-virtedit* news intro.txt /*news* nextnonblank() eval.txt /*nextnonblank()* nice todo.txt /*nice* no-eval-feature eval.txt /*no-eval-feature* no-type-checking eval.txt /*no-type-checking* no_buffers_menu gui.txt /*no_buffers_menu* non-greedy pattern.txt /*non-greedy* non-zero-arg eval.txt /*non-zero-arg* none-variable eval.txt /*none-variable* 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.vim syntax.txt /*nroff.vim* null-variable eval.txt /*null-variable* number_relativenumber options.txt /*number_relativenumber* numbered-function eval.txt /*numbered-function* 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.vim syntax.txt /*ocaml.vim* octal eval.txt /*octal* octal-nrformats options.txt /*octal-nrformats* octal-number eval.txt /*octal-number* oldfiles-variable eval.txt /*oldfiles-variable* 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* omap-info map.txt /*omap-info* omni-sql-completion ft_sql.txt /*omni-sql-completion* online-help helphelp.txt /*online-help* opening-window windows.txt /*opening-window* operator motion.txt /*operator* operator-variable eval.txt /*operator-variable* option-backslash options.txt /*option-backslash* option-list quickref.txt /*option-list* option-summary options.txt /*option-summary* option-window options.txt /*option-window* options options.txt /*options* options-changed version5.txt /*options-changed* options.txt options.txt /*options.txt* optwin options.txt /*optwin* or() eval.txt /*or()* oracle ft_sql.txt /*oracle* os2 os_os2.txt /*os2* 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* out_buf channel.txt /*out_buf* out_cb channel.txt /*out_cb* out_mode channel.txt /*out_mode* out_name channel.txt /*out_name* out_timeout channel.txt /*out_timeout* p change.txt /*p* pack-add repeat.txt /*pack-add* package-create repeat.txt /*package-create* packages repeat.txt /*packages* 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.vim syntax.txt /*papp.vim* paragraph motion.txt /*paragraph* pascal.vim syntax.txt /*pascal.vim* pathshorten() eval.txt /*pathshorten()* 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* patterns-composing pattern.txt /*patterns-composing* pdev-option print.txt /*pdev-option* peace intro.txt /*peace* penc-option print.txt /*penc-option* 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-dynamic if_perl.txt /*perl-dynamic* perl-editing if_perl.txt /*perl-editing* perl-overview if_perl.txt /*perl-overview* perl-patterns pattern.txt /*perl-patterns* perl-using if_perl.txt /*perl-using* perl.vim syntax.txt /*perl.vim* perleval() eval.txt /*perleval()* persistent-undo undo.txt /*persistent-undo* pexpr-option print.txt /*pexpr-option* pfn-option print.txt /*pfn-option* pheader-option print.txt /*pheader-option* photon-fonts os_qnx.txt /*photon-fonts* photon-gui os_qnx.txt /*photon-gui* php-comment indent.txt /*php-comment* php-indent indent.txt /*php-indent* php-indenting indent.txt /*php-indenting* php.vim syntax.txt /*php.vim* php3.vim syntax.txt /*php3.vim* phtml.vim syntax.txt /*phtml.vim* pi_getscript.txt pi_getscript.txt /*pi_getscript.txt* pi_gzip.txt pi_gzip.txt /*pi_gzip.txt* pi_logipat.txt pi_logipat.txt /*pi_logipat.txt* pi_netrw.txt pi_netrw.txt /*pi_netrw.txt* pi_paren.txt pi_paren.txt /*pi_paren.txt* pi_spec.txt pi_spec.txt /*pi_spec.txt* pi_tar.txt pi_tar.txt /*pi_tar.txt* pi_vimball.txt pi_vimball.txt /*pi_vimball.txt* pi_zip.txt pi_zip.txt /*pi_zip.txt* pkzip options.txt /*pkzip* plaintex.vim syntax.txt /*plaintex.vim* plsql ft_sql.txt /*plsql* 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* pmbcs-option print.txt /*pmbcs-option* pmbfn-option print.txt /*pmbfn-option* popt-option print.txt /*popt-option* popup-menu gui.txt /*popup-menu* popup-menu-added version5.txt /*popup-menu-added* popupmenu-completion insert.txt /*popupmenu-completion* popupmenu-keys insert.txt /*popupmenu-keys* ports-5.2 version5.txt /*ports-5.2* ports-6 version6.txt /*ports-6* posix vi_diff.txt /*posix* posix-compliance vi_diff.txt /*posix-compliance* posix-screen-size vi_diff.txt /*posix-screen-size* postgresql ft_sql.txt /*postgresql* postscr.vim syntax.txt /*postscr.vim* postscript-cjk-printing print.txt /*postscript-cjk-printing* postscript-print-encoding print.txt /*postscript-print-encoding* postscript-print-trouble print.txt /*postscript-print-trouble* postscript-print-util print.txt /*postscript-print-util* postscript-printing print.txt /*postscript-printing* pow() eval.txt /*pow()* 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()* print-intro print.txt /*print-intro* print-options print.txt /*print-options* print.txt print.txt /*print.txt* printf() eval.txt /*printf()* printf-% eval.txt /*printf-%* printf-E eval.txt /*printf-E* printf-G eval.txt /*printf-G* printf-S eval.txt /*printf-S* printf-X eval.txt /*printf-X* printf-c eval.txt /*printf-c* printf-d eval.txt /*printf-d* printf-e eval.txt /*printf-e* printf-f eval.txt /*printf-f* printf-g eval.txt /*printf-g* printf-o eval.txt /*printf-o* printf-s eval.txt /*printf-s* printf-x eval.txt /*printf-x* printing print.txt /*printing* printing-formfeed print.txt /*printing-formfeed* profile repeat.txt /*profile* profiling repeat.txt /*profiling* profiling-variable eval.txt /*profiling-variable* progname-variable eval.txt /*progname-variable* progpath-variable eval.txt /*progpath-variable* progress.vim syntax.txt /*progress.vim* pronounce intro.txt /*pronounce* psql ft_sql.txt /*psql* ptcap.vim syntax.txt /*ptcap.vim* pterm-mouse options.txt /*pterm-mouse* pumvisible() eval.txt /*pumvisible()* put change.txt /*put* put-Visual-mode change.txt /*put-Visual-mode* py3eval() eval.txt /*py3eval()* pyeval() eval.txt /*pyeval()* python if_pyth.txt /*python* python-.locked if_pyth.txt /*python-.locked* python-2-and-3 if_pyth.txt /*python-2-and-3* python-Dictionary if_pyth.txt /*python-Dictionary* python-Function if_pyth.txt /*python-Function* python-List if_pyth.txt /*python-List* python-VIM_SPECIAL_PATH if_pyth.txt /*python-VIM_SPECIAL_PATH* python-_get_paths if_pyth.txt /*python-_get_paths* python-bindeval if_pyth.txt /*python-bindeval* python-bindeval-objects if_pyth.txt /*python-bindeval-objects* python-buffer if_pyth.txt /*python-buffer* python-buffers if_pyth.txt /*python-buffers* python-chdir if_pyth.txt /*python-chdir* python-command if_pyth.txt /*python-command* python-commands if_pyth.txt /*python-commands* python-current if_pyth.txt /*python-current* python-dynamic if_pyth.txt /*python-dynamic* python-error if_pyth.txt /*python-error* python-eval if_pyth.txt /*python-eval* python-examples if_pyth.txt /*python-examples* python-fchdir if_pyth.txt /*python-fchdir* python-find_module if_pyth.txt /*python-find_module* python-foreach_rtp if_pyth.txt /*python-foreach_rtp* python-input if_pyth.txt /*python-input* python-options if_pyth.txt /*python-options* python-output if_pyth.txt /*python-output* python-path_hook if_pyth.txt /*python-path_hook* python-pyeval if_pyth.txt /*python-pyeval* python-range if_pyth.txt /*python-range* python-special-path if_pyth.txt /*python-special-path* python-strwidth if_pyth.txt /*python-strwidth* python-tabpage if_pyth.txt /*python-tabpage* python-tabpages if_pyth.txt /*python-tabpages* python-vars if_pyth.txt /*python-vars* python-vim if_pyth.txt /*python-vim* python-vvars if_pyth.txt /*python-vvars* python-window if_pyth.txt /*python-window* python-windows if_pyth.txt /*python-windows* python.vim syntax.txt /*python.vim* python2-directory if_pyth.txt /*python2-directory* python3 if_pyth.txt /*python3* python3-directory if_pyth.txt /*python3-directory* pythonx-directory if_pyth.txt /*pythonx-directory* 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.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-functions usr_41.txt /*quickfix-functions* quickfix-gcc quickfix.txt /*quickfix-gcc* quickfix-manx quickfix.txt /*quickfix-manx* quickfix-perl quickfix.txt /*quickfix-perl* 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* range() eval.txt /*range()* 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* readfile() eval.txt /*readfile()* 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* reference_toc help.txt /*reference_toc* 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* reload editing.txt /*reload* reltime() eval.txt /*reltime()* reltimestr() eval.txt /*reltimestr()* 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() eval.txt /*remove()* 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() eval.txt /*repeat()* repeat.txt repeat.txt /*repeat.txt* repeating repeat.txt /*repeating* replacing change.txt /*replacing* replacing-ex insert.txt /*replacing-ex* reselect-Visual visual.txt /*reselect-Visual* resolve() eval.txt /*resolve()* restore-cursor usr_05.txt /*restore-cursor* restore-position tips.txt /*restore-position* restricted-mode starting.txt /*restricted-mode* retab-example change.txt /*retab-example* rethrow eval.txt /*rethrow* reverse() eval.txt /*reverse()* 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* rot13 change.txt /*rot13* round() eval.txt /*round()* rst.vim syntax.txt /*rst.vim* 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-dynamic if_ruby.txt /*ruby-dynamic* 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-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/\= change.txt /*s\/\\=* 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:netrw_passwd pi_netrw.txt /*s:netrw_passwd* s:var eval.txt /*s:var* s<CR> change.txt /*s<CR>* sandbox eval.txt /*sandbox* sandbox-option eval.txt /*sandbox-option* save-file editing.txt /*save-file* save-settings starting.txt /*save-settings* scheme.vim syntax.txt /*scheme.vim* scp pi_netrw.txt /*scp* screenattr() eval.txt /*screenattr()* screenchar() eval.txt /*screenchar()* screencol() eval.txt /*screencol()* screenrow() eval.txt /*screenrow()* script usr_41.txt /*script* script-here if_perl.txt /*script-here* script-local map.txt /*script-local* script-variable eval.txt /*script-variable* scriptnames-dictionary eval.txt /*scriptnames-dictionary* 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* scrollstart-variable eval.txt /*scrollstart-variable* sdl.vim syntax.txt /*sdl.vim* search() eval.txt /*search()* search()-sub-match eval.txt /*search()-sub-match* search-commands pattern.txt /*search-commands* search-offset pattern.txt /*search-offset* search-pattern pattern.txt /*search-pattern* search-range pattern.txt /*search-range* search-replace change.txt /*search-replace* searchdecl() eval.txt /*searchdecl()* searchforward-variable eval.txt /*searchforward-variable* searchpair() eval.txt /*searchpair()* searchpairpos() eval.txt /*searchpairpos()* searchpos() eval.txt /*searchpos()* section motion.txt /*section* sed.vim syntax.txt /*sed.vim* self eval.txt /*self* send-money sponsor.txt /*send-money* send-to-menu gui_w32.txt /*send-to-menu* sendto gui_w32.txt /*sendto* sentence motion.txt /*sentence* server-functions usr_41.txt /*server-functions* 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* set-spc-auto spell.txt /*set-spc-auto* setbufvar() eval.txt /*setbufvar()* setcharsearch() eval.txt /*setcharsearch()* setcmdpos() eval.txt /*setcmdpos()* setfperm() eval.txt /*setfperm()* setline() eval.txt /*setline()* setloclist() eval.txt /*setloclist()* setmatches() eval.txt /*setmatches()* setpos() eval.txt /*setpos()* setqflist() eval.txt /*setqflist()* setreg() eval.txt /*setreg()* settabvar() eval.txt /*settabvar()* settabwinvar() eval.txt /*settabwinvar()* setting-guifont gui.txt /*setting-guifont* setting-guitablabel tabpage.txt /*setting-guitablabel* setting-tabline tabpage.txt /*setting-tabline* setuid change.txt /*setuid* setwinvar() eval.txt /*setwinvar()* sftp pi_netrw.txt /*sftp* sgml.vim syntax.txt /*sgml.vim* sgr-mouse options.txt /*sgr-mouse* sh-awk syntax.txt /*sh-awk* sh-embed syntax.txt /*sh-embed* sh.vim syntax.txt /*sh.vim* sha256() eval.txt /*sha256()* shell-window tips.txt /*shell-window* shell_error-variable eval.txt /*shell_error-variable* shellescape() eval.txt /*shellescape()* shift intro.txt /*shift* shift-left-right change.txt /*shift-left-right* shiftwidth() eval.txt /*shiftwidth()* 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()* simulated-command vi_diff.txt /*simulated-command* sin() eval.txt /*sin()* single-repeat repeat.txt /*single-repeat* sinh() eval.txt /*sinh()* skeleton autocmd.txt /*skeleton* slice eval.txt /*slice* slow-fast-terminal term.txt /*slow-fast-terminal* slow-start starting.txt /*slow-start* slow-terminal term.txt /*slow-terminal* socket-interface channel.txt /*socket-interface* sort() eval.txt /*sort()* sorting change.txt /*sorting* soundfold() eval.txt /*soundfold()* 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-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* spell spell.txt /*spell* spell-ACCENT spell.txt /*spell-ACCENT* spell-AUTHOR spell.txt /*spell-AUTHOR* spell-BAD spell.txt /*spell-BAD* spell-BREAK spell.txt /*spell-BREAK* spell-CHECKCOMPOUNDCASE spell.txt /*spell-CHECKCOMPOUNDCASE* spell-CHECKCOMPOUNDDUP spell.txt /*spell-CHECKCOMPOUNDDUP* spell-CHECKCOMPOUNDPATTERN spell.txt /*spell-CHECKCOMPOUNDPATTERN* spell-CHECKCOMPOUNDREP spell.txt /*spell-CHECKCOMPOUNDREP* spell-CHECKCOMPOUNDTRIPLE spell.txt /*spell-CHECKCOMPOUNDTRIPLE* spell-CIRCUMFIX spell.txt /*spell-CIRCUMFIX* spell-COMMON spell.txt /*spell-COMMON* spell-COMPLEXPREFIXES spell.txt /*spell-COMPLEXPREFIXES* spell-COMPOUND spell.txt /*spell-COMPOUND* spell-COMPOUNDBEGIN spell.txt /*spell-COMPOUNDBEGIN* spell-COMPOUNDEND spell.txt /*spell-COMPOUNDEND* spell-COMPOUNDFIRST spell.txt /*spell-COMPOUNDFIRST* spell-COMPOUNDFLAG spell.txt /*spell-COMPOUNDFLAG* spell-COMPOUNDFORBIDFLAG spell.txt /*spell-COMPOUNDFORBIDFLAG* spell-COMPOUNDMIDDLE spell.txt /*spell-COMPOUNDMIDDLE* spell-COMPOUNDMIN spell.txt /*spell-COMPOUNDMIN* spell-COMPOUNDPERMITFLAG spell.txt /*spell-COMPOUNDPERMITFLAG* spell-COMPOUNDROOT spell.txt /*spell-COMPOUNDROOT* spell-COMPOUNDRULE spell.txt /*spell-COMPOUNDRULE* spell-COMPOUNDRULES spell.txt /*spell-COMPOUNDRULES* spell-COMPOUNDSYLLABLE spell.txt /*spell-COMPOUNDSYLLABLE* spell-COMPOUNDSYLMAX spell.txt /*spell-COMPOUNDSYLMAX* spell-COMPOUNDWORDMAX spell.txt /*spell-COMPOUNDWORDMAX* spell-COPYRIGHT spell.txt /*spell-COPYRIGHT* spell-EMAIL spell.txt /*spell-EMAIL* spell-FLAG spell.txt /*spell-FLAG* spell-FOL spell.txt /*spell-FOL* spell-FORBIDDENWORD spell.txt /*spell-FORBIDDENWORD* spell-HOME spell.txt /*spell-HOME* spell-IGNOREEXTRA spell.txt /*spell-IGNOREEXTRA* spell-KEEPCASE spell.txt /*spell-KEEPCASE* spell-KEY spell.txt /*spell-KEY* spell-LANG spell.txt /*spell-LANG* spell-LEMMA_PRESENT spell.txt /*spell-LEMMA_PRESENT* spell-LOW spell.txt /*spell-LOW* spell-MAP spell.txt /*spell-MAP* spell-MAXNGRAMSUGS spell.txt /*spell-MAXNGRAMSUGS* spell-NAME spell.txt /*spell-NAME* spell-NEEDAFFIX spell.txt /*spell-NEEDAFFIX* spell-NEEDCOMPOUND spell.txt /*spell-NEEDCOMPOUND* spell-NOBREAK spell.txt /*spell-NOBREAK* spell-NOCOMPOUNDSUGS spell.txt /*spell-NOCOMPOUNDSUGS* spell-NOSPLITSUGS spell.txt /*spell-NOSPLITSUGS* spell-NOSUGFILE spell.txt /*spell-NOSUGFILE* spell-NOSUGGEST spell.txt /*spell-NOSUGGEST* spell-ONLYINCOMPOUND spell.txt /*spell-ONLYINCOMPOUND* spell-PFX spell.txt /*spell-PFX* spell-PFXPOSTPONE spell.txt /*spell-PFXPOSTPONE* spell-PSEUDOROOT spell.txt /*spell-PSEUDOROOT* spell-RARE spell.txt /*spell-RARE* spell-REP spell.txt /*spell-REP* spell-SAL spell.txt /*spell-SAL* spell-SET spell.txt /*spell-SET* spell-SFX spell.txt /*spell-SFX* spell-SLASH spell.txt /*spell-SLASH* spell-SOFOFROM spell.txt /*spell-SOFOFROM* spell-SOFOTO spell.txt /*spell-SOFOTO* spell-SUGSWITHDOTS spell.txt /*spell-SUGSWITHDOTS* spell-SYLLABLE spell.txt /*spell-SYLLABLE* spell-SYLLABLENUM spell.txt /*spell-SYLLABLENUM* spell-SpellFileMissing spell.txt /*spell-SpellFileMissing* spell-TRY spell.txt /*spell-TRY* spell-UPP spell.txt /*spell-UPP* spell-VERSION spell.txt /*spell-VERSION* spell-WORDCHARS spell.txt /*spell-WORDCHARS* spell-aff-format spell.txt /*spell-aff-format* spell-affix-chars spell.txt /*spell-affix-chars* spell-affix-comment spell.txt /*spell-affix-comment* spell-affix-flags spell.txt /*spell-affix-flags* spell-affix-mbyte spell.txt /*spell-affix-mbyte* spell-affix-not-supported spell.txt /*spell-affix-not-supported* spell-affix-vim spell.txt /*spell-affix-vim* spell-cjk spell.txt /*spell-cjk* spell-compound spell.txt /*spell-compound* spell-dic-format spell.txt /*spell-dic-format* spell-double-scoring spell.txt /*spell-double-scoring* spell-file-format spell.txt /*spell-file-format* spell-functions usr_41.txt /*spell-functions* spell-german spell.txt /*spell-german* spell-load spell.txt /*spell-load* spell-midword spell.txt /*spell-midword* spell-mkspell spell.txt /*spell-mkspell* spell-quickstart spell.txt /*spell-quickstart* spell-remarks spell.txt /*spell-remarks* spell-russian spell.txt /*spell-russian* spell-sug-file spell.txt /*spell-sug-file* spell-syntax spell.txt /*spell-syntax* spell-wordlist-format spell.txt /*spell-wordlist-format* spell-yiddish spell.txt /*spell-yiddish* spell.txt spell.txt /*spell.txt* spellbadword() eval.txt /*spellbadword()* spellfile-cleanup spell.txt /*spellfile-cleanup* spellfile.vim spell.txt /*spellfile.vim* spellsuggest() eval.txt /*spellsuggest()* split() eval.txt /*split()* 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.vim syntax.txt /*spup.vim* sql-adding-dialects ft_sql.txt /*sql-adding-dialects* sql-completion ft_sql.txt /*sql-completion* sql-completion-columns ft_sql.txt /*sql-completion-columns* sql-completion-customization ft_sql.txt /*sql-completion-customization* sql-completion-dynamic ft_sql.txt /*sql-completion-dynamic* sql-completion-filetypes ft_sql.txt /*sql-completion-filetypes* sql-completion-maps ft_sql.txt /*sql-completion-maps* sql-completion-procedures ft_sql.txt /*sql-completion-procedures* sql-completion-static ft_sql.txt /*sql-completion-static* sql-completion-tables ft_sql.txt /*sql-completion-tables* sql-completion-tutorial ft_sql.txt /*sql-completion-tutorial* sql-completion-views ft_sql.txt /*sql-completion-views* sql-dialects ft_sql.txt /*sql-dialects* sql-macros ft_sql.txt /*sql-macros* sql-matchit ft_sql.txt /*sql-matchit* sql-navigation ft_sql.txt /*sql-navigation* sql-object-motions ft_sql.txt /*sql-object-motions* sql-predefined-objects ft_sql.txt /*sql-predefined-objects* sql-type-default ft_sql.txt /*sql-type-default* sql-types ft_sql.txt /*sql-types* sql.vim syntax.txt /*sql.vim* sqlanywhere ft_sql.txt /*sqlanywhere* sqlanywhere.vim syntax.txt /*sqlanywhere.vim* sqlgettype ft_sql.txt /*sqlgettype* sqlinformix.vim syntax.txt /*sqlinformix.vim* sqlj ft_sql.txt /*sqlj* sqlserver ft_sql.txt /*sqlserver* sqlsettype ft_sql.txt /*sqlsettype* sqrt() eval.txt /*sqrt()* sscanf eval.txt /*sscanf* standard-plugin usr_05.txt /*standard-plugin* standard-plugin-list help.txt /*standard-plugin-list* standout syntax.txt /*standout* star pattern.txt /*star* starstar editing.txt /*starstar* starstar-wildcard editing.txt /*starstar-wildcard* 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* str2float() eval.txt /*str2float()* str2nr() eval.txt /*str2nr()* strcasestr() eval.txt /*strcasestr()* strchars() eval.txt /*strchars()* strchr() eval.txt /*strchr()* strcspn() eval.txt /*strcspn()* strdisplaywidth() eval.txt /*strdisplaywidth()* strftime() eval.txt /*strftime()* stridx() eval.txt /*stridx()* string eval.txt /*string* string() eval.txt /*string()* string-functions usr_41.txt /*string-functions* string-match eval.txt /*string-match* strlen() eval.txt /*strlen()* strpart() eval.txt /*strpart()* strpbrk() eval.txt /*strpbrk()* strrchr() eval.txt /*strrchr()* strridx() eval.txt /*strridx()* strspn() eval.txt /*strspn()* strstr() eval.txt /*strstr()* strtrans() eval.txt /*strtrans()* strwidth() eval.txt /*strwidth()* style-changes develop.txt /*style-changes* style-compiler develop.txt /*style-compiler* 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-\= change.txt /*sub-replace-\\=* sub-replace-expression change.txt /*sub-replace-expression* sub-replace-special change.txt /*sub-replace-special* sublist eval.txt /*sublist* 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-exists-choices usr_11.txt /*swap-exists-choices* swap-file recover.txt /*swap-file* swapchoice-variable eval.txt /*swapchoice-variable* swapcommand-variable eval.txt /*swapcommand-variable* swapfile-changed version4.txt /*swapfile-changed* swapname-variable eval.txt /*swapname-variable* sybase ft_sql.txt /*sybase* syn-sync-grouphere syntax.txt /*syn-sync-grouphere* syn-sync-groupthere syntax.txt /*syn-sync-groupthere* syn-sync-linecont syntax.txt /*syn-sync-linecont* synID() eval.txt /*synID()* synIDattr() eval.txt /*synIDattr()* synIDtrans() eval.txt /*synIDtrans()* syncbind scroll.txt /*syncbind* syncolor syntax.txt /*syncolor* synconcealed() eval.txt /*synconcealed()* 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* synstack() eval.txt /*synstack()* syntax syntax.txt /*syntax* syntax-functions usr_41.txt /*syntax-functions* 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* sysmouse term.txt /*sysmouse* system() eval.txt /*system()* system-functions usr_41.txt /*system-functions* system-vimrc starting.txt /*system-vimrc* systemlist() eval.txt /*systemlist()* s~ change.txt /*s~* t motion.txt /*t* t: eval.txt /*t:* t:var eval.txt /*t:var* 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_Ce term.txt /*t_Ce* t_Co term.txt /*t_Co* t_Cs term.txt /*t_Cs* t_DL term.txt /*t_DL* t_EI term.txt /*t_EI* 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_RB term.txt /*t_RB* t_RI term.txt /*t_RI* t_RV term.txt /*t_RV* t_SI term.txt /*t_SI* t_SR term.txt /*t_SR* 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_u7 term.txt /*t_u7* 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_xn term.txt /*t_xn* t_xs term.txt /*t_xs* tab intro.txt /*tab* tab-page tabpage.txt /*tab-page* tab-page-commands tabpage.txt /*tab-page-commands* tab-page-intro tabpage.txt /*tab-page-intro* tab-page-other tabpage.txt /*tab-page-other* tabline-menu tabpage.txt /*tabline-menu* tabpage tabpage.txt /*tabpage* tabpage-variable eval.txt /*tabpage-variable* tabpage.txt tabpage.txt /*tabpage.txt* tabpagebuflist() eval.txt /*tabpagebuflist()* tabpagenr() eval.txt /*tabpagenr()* tabpagewinnr() eval.txt /*tabpagewinnr()* 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-blocks motion.txt /*tag-blocks* 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-preview tagsrch.txt /*tag-preview* 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* tagfiles() eval.txt /*tagfiles()* taglist() eval.txt /*taglist()* 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* tan() eval.txt /*tan()* tanh() eval.txt /*tanh()* tar pi_tar.txt /*tar* tar-contents pi_tar.txt /*tar-contents* tar-copyright pi_tar.txt /*tar-copyright* tar-history pi_tar.txt /*tar-history* tar-manual pi_tar.txt /*tar-manual* tar-options pi_tar.txt /*tar-options* tar-usage pi_tar.txt /*tar-usage* 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-dynamic if_tcl.txt /*tcl-dynamic* 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.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* tempfile change.txt /*tempfile* 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-cursor-color term.txt /*termcap-cursor-color* termcap-cursor-shape term.txt /*termcap-cursor-shape* termcap-options term.txt /*termcap-options* 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* test-functions usr_41.txt /*test-functions* tex-cchar syntax.txt /*tex-cchar* tex-cole syntax.txt /*tex-cole* tex-conceal syntax.txt /*tex-conceal* tex-error syntax.txt /*tex-error* tex-folding syntax.txt /*tex-folding* tex-math syntax.txt /*tex-math* tex-morecommands syntax.txt /*tex-morecommands* tex-nospell syntax.txt /*tex-nospell* tex-package syntax.txt /*tex-package* tex-runon syntax.txt /*tex-runon* tex-slow syntax.txt /*tex-slow* tex-stopzone syntax.txt /*tex-stopzone* tex-style syntax.txt /*tex-style* tex-supersub syntax.txt /*tex-supersub* tex-sync syntax.txt /*tex-sync* tex-verb syntax.txt /*tex-verb* tex.vim syntax.txt /*tex.vim* text-functions usr_41.txt /*text-functions* text-objects motion.txt /*text-objects* text-objects-changed version5.txt /*text-objects-changed* textlock eval.txt /*textlock* 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* time-functions usr_41.txt /*time-functions* timer_start() eval.txt /*timer_start()* timer_stop() eval.txt /*timer_stop()* 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()* tr() eval.txt /*tr()* trojan-horse starting.txt /*trojan-horse* true-variable eval.txt /*true-variable* trunc() eval.txt /*trunc()* 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* two-engines pattern.txt /*two-engines* 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* undercurl syntax.txt /*undercurl* underline syntax.txt /*underline* undo undo.txt /*undo* undo-blocks undo.txt /*undo-blocks* undo-branches undo.txt /*undo-branches* undo-commands undo.txt /*undo-commands* undo-persistence undo.txt /*undo-persistence* undo-redo undo.txt /*undo-redo* undo-remarks undo.txt /*undo-remarks* undo-tree undo.txt /*undo-tree* undo-two-ways undo.txt /*undo-two-ways* undo.txt undo.txt /*undo.txt* undo_ftplugin usr_41.txt /*undo_ftplugin* undo_indent usr_41.txt /*undo_indent* undofile() eval.txt /*undofile()* undotree() eval.txt /*undotree()* unicode mbyte.txt /*unicode* uniq() eval.txt /*uniq()* unix os_unix.txt /*unix* unlisted-buffer windows.txt /*unlisted-buffer* up-down-motions motion.txt /*up-down-motions* uppercase change.txt /*uppercase* urxvt-mouse options.txt /*urxvt-mouse* 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_32.txt usr_32.txt /*usr_32.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: eval.txt /*v:* v:beval_bufnr eval.txt /*v:beval_bufnr* v:beval_col eval.txt /*v:beval_col* v:beval_lnum eval.txt /*v:beval_lnum* v:beval_text eval.txt /*v:beval_text* v:beval_winnr eval.txt /*v:beval_winnr* v:char eval.txt /*v:char* 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:completed_item eval.txt /*v:completed_item* 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:errors eval.txt /*v:errors* v:exception eval.txt /*v:exception* v:false eval.txt /*v:false* v:fcs_choice eval.txt /*v:fcs_choice* v:fcs_reason eval.txt /*v:fcs_reason* 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:hlsearch eval.txt /*v:hlsearch* v:insertmode eval.txt /*v:insertmode* v:key eval.txt /*v:key* v:lang eval.txt /*v:lang* v:lc_time eval.txt /*v:lc_time* v:lnum eval.txt /*v:lnum* v:mouse_col eval.txt /*v:mouse_col* v:mouse_lnum eval.txt /*v:mouse_lnum* v:mouse_win eval.txt /*v:mouse_win* v:none eval.txt /*v:none* v:null eval.txt /*v:null* v:oldfiles eval.txt /*v:oldfiles* v:operator eval.txt /*v:operator* v:option_new eval.txt /*v:option_new* v:option_old eval.txt /*v:option_old* v:option_type eval.txt /*v:option_type* v:prevcount eval.txt /*v:prevcount* v:profiling eval.txt /*v:profiling* v:progname eval.txt /*v:progname* v:progpath eval.txt /*v:progpath* v:register eval.txt /*v:register* v:scrollstart eval.txt /*v:scrollstart* v:searchforward eval.txt /*v:searchforward* v:servername eval.txt /*v:servername* v:shell_error eval.txt /*v:shell_error* v:statusmsg eval.txt /*v:statusmsg* v:swapchoice eval.txt /*v:swapchoice* v:swapcommand eval.txt /*v:swapcommand* v:swapname eval.txt /*v:swapname* v:termresponse eval.txt /*v:termresponse* v:this_session eval.txt /*v:this_session* v:throwpoint eval.txt /*v:throwpoint* v:true eval.txt /*v:true* v:val eval.txt /*v:val* v:var eval.txt /*v:var* v:version eval.txt /*v:version* v:vim_did_enter eval.txt /*v:vim_did_enter* v:warningmsg eval.txt /*v:warningmsg* v:windowid eval.txt /*v:windowid* 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_<Esc> visual.txt /*v_<Esc>* v_= change.txt /*v_=* v_> change.txt /*v_>* v_C change.txt /*v_C* v_CTRL-A change.txt /*v_CTRL-A* 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-X change.txt /*v_CTRL-X* 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_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_a` motion.txt /*v_a`* v_ab motion.txt /*v_ab* v_ap motion.txt /*v_ap* v_aquote motion.txt /*v_aquote* v_as motion.txt /*v_as* v_at motion.txt /*v_at* 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_gF editing.txt /*v_gF* v_gJ change.txt /*v_gJ* v_gN visual.txt /*v_gN* v_gV visual.txt /*v_gV* v_g] tagsrch.txt /*v_g]* v_g_CTRL-A change.txt /*v_g_CTRL-A* v_g_CTRL-G editing.txt /*v_g_CTRL-G* v_g_CTRL-X change.txt /*v_g_CTRL-X* v_g_CTRL-] tagsrch.txt /*v_g_CTRL-]* v_gf editing.txt /*v_gf* v_gn visual.txt /*v_gn* v_gq change.txt /*v_gq* v_gv visual.txt /*v_gv* v_gw change.txt /*v_gw* 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_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_i` motion.txt /*v_i`* v_ib motion.txt /*v_ib* v_ip motion.txt /*v_ip* v_iquote motion.txt /*v_iquote* v_is motion.txt /*v_is* v_it motion.txt /*v_it* 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_~* val-variable eval.txt /*val-variable* valgrind debug.txt /*valgrind* values() eval.txt /*values()* var-functions usr_41.txt /*var-functions* variables eval.txt /*variables* various various.txt /*various* various-cmds various.txt /*various-cmds* various-functions usr_41.txt /*various-functions* various-motions motion.txt /*various-motions* various.txt various.txt /*various.txt* vb.vim syntax.txt /*vb.vim* vba pi_vimball.txt /*vba* verbose starting.txt /*verbose* 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-6.4 version6.txt /*version-6.4* version-7.0 version7.txt /*version-7.0* version-7.1 version7.txt /*version-7.1* version-7.2 version7.txt /*version-7.2* version-7.3 version7.txt /*version-7.3* version-7.4 version7.txt /*version-7.4* version-variable eval.txt /*version-variable* version4.txt version4.txt /*version4.txt* version5.txt version5.txt /*version5.txt* version6.txt version6.txt /*version6.txt* version7.0 version7.txt /*version7.0* version7.1 version7.txt /*version7.1* version7.2 version7.txt /*version7.2* version7.3 version7.txt /*version7.3* version7.4 version7.txt /*version7.4* version7.txt version7.txt /*version7.txt* vi intro.txt /*vi* 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-variable eval.txt /*vim-variable* vim.vim syntax.txt /*vim.vim* vim7 version7.txt /*vim7* vim: options.txt /*vim:* vim_did_enter-variable eval.txt /*vim_did_enter-variable* vim_starting eval.txt /*vim_starting* vimball pi_vimball.txt /*vimball* vimball-contents pi_vimball.txt /*vimball-contents* vimball-extract pi_vimball.txt /*vimball-extract* vimball-history pi_vimball.txt /*vimball-history* vimball-intro pi_vimball.txt /*vimball-intro* vimball-manual pi_vimball.txt /*vimball-manual* vimball-windows pi_vimball.txt /*vimball-windows* vimdev intro.txt /*vimdev* vimdiff diff.txt /*vimdiff* vimfiles options.txt /*vimfiles* viminfo starting.txt /*viminfo* viminfo-! options.txt /*viminfo-!* viminfo-% options.txt /*viminfo-%* viminfo-' options.txt /*viminfo-'* viminfo-/ options.txt /*viminfo-\/* viminfo-: options.txt /*viminfo-:* viminfo-< options.txt /*viminfo-<* viminfo-@ options.txt /*viminfo-@* viminfo-c options.txt /*viminfo-c* viminfo-encoding starting.txt /*viminfo-encoding* viminfo-errors starting.txt /*viminfo-errors* viminfo-f options.txt /*viminfo-f* viminfo-file starting.txt /*viminfo-file* viminfo-file-marks starting.txt /*viminfo-file-marks* viminfo-file-name starting.txt /*viminfo-file-name* viminfo-h options.txt /*viminfo-h* viminfo-n options.txt /*viminfo-n* viminfo-quote options.txt /*viminfo-quote* viminfo-r options.txt /*viminfo-r* viminfo-read starting.txt /*viminfo-read* viminfo-read-write starting.txt /*viminfo-read-write* viminfo-s options.txt /*viminfo-s* 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-option-example starting.txt /*vimrc-option-example* 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* w32-xpm-support gui_w32.txt /*w32-xpm-support* w: eval.txt /*w:* w:current_syntax syntax.txt /*w:current_syntax* w:quickfix_title quickfix.txt /*w:quickfix_title* w:var eval.txt /*w:var* waittime channel.txt /*waittime* warningmsg-variable eval.txt /*warningmsg-variable* white-space pattern.txt /*white-space* whitespace pattern.txt /*whitespace* wildcard editing.txt /*wildcard* wildcards editing.txt /*wildcards* wildmenumode() eval.txt /*wildmenumode()* win32 os_win32.txt /*win32* win32-!start gui_w32.txt /*win32-!start* win32-PATH os_win32.txt /*win32-PATH* 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-quotes os_win32.txt /*win32-quotes* 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* win_findbuf() eval.txt /*win_findbuf()* win_getid() eval.txt /*win_getid()* win_gotoid() eval.txt /*win_gotoid()* win_id2tabwin() eval.txt /*win_id2tabwin()* win_id2win() eval.txt /*win_id2win()* winbufnr() eval.txt /*winbufnr()* wincol() eval.txt /*wincol()* window windows.txt /*window* window-contents intro.txt /*window-contents* window-exit editing.txt /*window-exit* window-functions usr_41.txt /*window-functions* 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-size-functions usr_41.txt /*window-size-functions* window-tag windows.txt /*window-tag* window-variable eval.txt /*window-variable* windowid-variable eval.txt /*windowid-variable* windows windows.txt /*windows* windows-3.1 os_win32.txt /*windows-3.1* windows-icon os_win32.txt /*windows-icon* 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()* winrestview() eval.txt /*winrestview()* winsaveview() eval.txt /*winsaveview()* winwidth() eval.txt /*winwidth()* word motion.txt /*word* word-count editing.txt /*word-count* word-motions motion.txt /*word-motions* wordcount() eval.txt /*wordcount()* 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-library-script usr_41.txt /*write-library-script* write-local-help usr_41.txt /*write-local-help* write-permissions editing.txt /*write-permissions* write-plugin usr_41.txt /*write-plugin* write-plugin-quickload usr_41.txt /*write-plugin-quickload* write-quit editing.txt /*write-quit* write-readonly editing.txt /*write-readonly* writefile() eval.txt /*writefile()* 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.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-omni-datafile insert.txt /*xml-omni-datafile* xml.vim syntax.txt /*xml.vim* xor() eval.txt /*xor()* 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-modifier-keys term.txt /*xterm-modifier-keys* xterm-mouse options.txt /*xterm-mouse* xterm-mouse-wheel scroll.txt /*xterm-mouse-wheel* xterm-resize term.txt /*xterm-resize* 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* yaml.vim syntax.txt /*yaml.vim* 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>* z= spell.txt /*z=* zA fold.txt /*zA* zC fold.txt /*zC* zD fold.txt /*zD* zE fold.txt /*zE* zF fold.txt /*zF* zG spell.txt /*zG* 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-PuTTY os_390.txt /*zOS-PuTTY* zOS-has-ebcdic os_390.txt /*zOS-has-ebcdic* zOS-limitations os_390.txt /*zOS-limitations* zOS-open-source os_390.txt /*zOS-open-source* zR fold.txt /*zR* zW spell.txt /*zW* 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* zg spell.txt /*zg* zh scroll.txt /*zh* zi fold.txt /*zi* zip pi_zip.txt /*zip* zip-contents pi_zip.txt /*zip-contents* zip-copyright pi_zip.txt /*zip-copyright* zip-extension pi_zip.txt /*zip-extension* zip-history pi_zip.txt /*zip-history* zip-manual pi_zip.txt /*zip-manual* zip-usage pi_zip.txt /*zip-usage* 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* zsh.vim syntax.txt /*zsh.vim* zt scroll.txt /*zt* zuG spell.txt /*zuG* zuW spell.txt /*zuW* zug spell.txt /*zug* zuw spell.txt /*zuw* zv fold.txt /*zv* zw spell.txt /*zw* zx fold.txt /*zx* zz scroll.txt /*zz* { motion.txt /*{* {Visual} intro.txt /*{Visual}* {address} cmdline.txt /*{address}* {arglist} editing.txt /*{arglist}* {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} helphelp.txt /*{subject}* {} intro.txt /*{}* } motion.txt /*}* ~ change.txt /*~* ������������������������������������������������������������vim-7.4.1689/runtime/doc/tagsrch.txt����������������������������������������������������������������0000664�0000000�0000000�00000106633�12677030670�0017232�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*tagsrch.txt* For Vim version 7.4. Last change: 2013 Oct 01 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* :[count]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}, jump to the [count] one. When [count] is omitted the first one is jumped to. See |tag-matchlist| for jumping to other matching tags. 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. When there are several matching tags for {ident}, jump to the [count] one. When no [count] is given the first one is jumped to. See |tag-matchlist| for jumping to other matching tags. {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 "ssh" 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 and 'tagcase' is "followic" or when 'tagcase' is "match". They are found when a pattern is used (starting with a "/") and for ":tselect", also when 'ignorecase' is off and 'tagcase' is "followic" or when 'tagcase' is "match". 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/text 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/text" 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/text 1 1 main 1 harddisk2:text/vim/test 2 1 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 commands 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} *:lt* *:ltag* :lt[ag][!] [ident] Jump to tag [ident] and add the matching tags to a new location list for the current window. [ident] can be a regexp pattern, see |tag-regexp|. When [ident] is not given, the last tag name from the tag stack is used. The search pattern to locate the tag line is prefixed with "\V" to escape all the special characters (very nomagic). The location list showing the matching tags is independent of the tag stack. 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. *tag-preview* 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". When using a pattern case is ignored. If you want to match case use "\C" in the pattern. *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 :-). Lines in Emacs tags files can be very long. Vim only deals with lines of up to about 510 bytes. To see whether lines are ignored set 'verbose' to 5 or higher. *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 whether case is ignored. Case is ignored when 'ignorecase' is set and 'tagcase' is "followic", or when 'tagcase' is "ignore". If case is not ignored, 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 case is ignored, 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 then 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* 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 case is ignored. (Case is ignored when 'ignorecase' is set and 'tagcase' is "followic", or when 'tagcase' is "ignore".) 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} *:dli* *:dlist* :[range]dli[st][!] [/]string[/] Like `[D` and `]D`, but search in [range] lines (default: whole file). See |:search-args| for [/] and [!]. {not in Vi} Note that `:dl` works like `:delete` with the "l" flag, not `:dlist`. *[_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: �����������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/term.txt�������������������������������������������������������������������0000664�0000000�0000000�00000121120�12677030670�0016532�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*term.txt* For Vim version 7.4. Last change: 2015 Nov 24 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 100 msec 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 may not 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-modifier-keys* Newer versions of xterm support Alt and Ctrl for most function keys. To avoid having to add all combinations of Alt, Ctrl and Shift for every key a special sequence is recognized at the end of a termcap entry: ";*X". The "X" can be any character, often '~' is used. The ";*" stands for an optional modifier argument. ";2" is Shift, ";3" is Alt, ";5" is Ctrl and ";9" is Meta (when it's different from Alt). They can be combined. Examples: > :set <F8>=^[[19;*~ :set <Home>=^[[1;*H Another speciality about these codes is that they are not overwritten by another code. That is to avoid that the codes obtained from xterm directly |t_RV| overwrite them. *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* *termcap-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', 't_xn' 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_Ce undercurl end *t_Ce* *'t_Ce'* t_Cs undercurl mode *t_Cs* *'t_Cs'* 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_xn* *'t_xn'* t_xn if non-empty, writing a character at the last screen cell does not cause scrolling 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_SI start insert mode (bar cursor shape) *t_SI* *'t_SI'* t_SR start replace mode (underline cursor shape) *t_SR* *'t_SR'* t_EI end insert or replace mode (block cursor shape) *t_EI* *'t_EI'* |termcap-cursor-shape| t_RV request terminal version string (for xterm) *t_RV* *'t_RV'* |xterm-8bit| |v:termresponse| |'ttymouse'| |xterm-codes| t_u7 request cursor position (for xterm) *t_u7* *'t_u7'* see |'ambiwidth'| t_RB request terminal background color *t_RB* *'t_RB'* see |'ambiwidth'| 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'* <xUp> alternate arrow up *<xUp>* <xDown> alternate arrow down *<xDown>* <xRight> alternate arrow right *<xRight>* <xLeft> alternate arrow left *<xLeft>* <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. *keypad-comma* The keypad keys, when they are not mapped, behave like the equivalent normal key. There is one exception: if you have a comma on the keypad instead of a decimal point, Vim will use a dot anyway. Use these mappings to fix that: > :noremap <kPoint> , :noremap! <kPoint> , < *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 anymore. *xterm-resize* Window resizing with xterm only works if the allowWindowOps resource is enabled. On some systems and versions of xterm it's disabled by default because someone thought it would be a security issue. It's not clear if this is actually the case. To overrule the default, put this line in your ~/.Xdefaults or ~/.Xresources: > XTerm*allowWindowOps: true And run "xrdb -merge .Xresources" to make it effective. You can check the value with the context menu (right mouse button while CTRL key is pressed), there should be a tick at allow-window-ops. *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-cursor-shape* *termcap-cursor-color* When Vim enters Insert mode the 't_SI' escape sequence is sent. When Vim enters Replace mode the 't_SR' escape sequence is sent if it is set, otherwise 't_SI' is sent. When leaving Insert mode or Replace mode 't_EI' is used. This can be used to change the shape or color of the cursor in Insert or Replace mode. These are not standard termcap/terminfo entries, you need to set them yourself. Example for an xterm, this changes the color of the cursor: > if &term =~ "xterm" let &t_SI = "\<Esc>]12;purple\x7" let &t_SR = "\<Esc>]12;red\x7" let &t_EI = "\<Esc>]12;blue\x7" endif NOTE: When Vim exits the shape for Normal mode will remain. The shape from before Vim started will not be restored. {not available when compiled without the |+cursorshape| feature} *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 command: > :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 *BSD console with |sysmouse|, 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 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 or 223. This is an xterm problem, not Vim's. Get a newer xterm |color-xterm|. Also see |'ttymouse'|. 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 <A-RightMouse> yes start or extend blockw. yes *<A-RightMouse>* <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 <A-RightMouse> yes start or extend blockw. yes <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 <A-LeftMouse> yes start or extend blockw. no *<A-LeftMouse>* <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) <A-LeftMouse> yes start or extend blockw. no <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. In Normal, Visual and Select mode clicking the right mouse button with the alt key pressed causes the Visual area to become blockwise. When 'mousemodel' is "popup" the left button has to be used with the alt key. Note that this won't work on systems where the window manager consumes the mouse events when the alt key is pressed (it may move the window). *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". *sysmouse* The sysmouse is only supported when the |+mouse_sysmouse| feature was enabled at compile time. The sysmouse driver (*BSD console) does not support keyboard modifiers. *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 and X11 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: ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/tips.txt�������������������������������������������������������������������0000664�0000000�0000000�00000050114�12677030670�0016546�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*tips.txt* For Vim version 7.4. Last change: 2009 Nov 07 VIM REFERENCE MANUAL by Bram Moolenaar Tips and ideas for using Vim *tips* These are just a few that we thought would be helpful for many users. You can find many more tips on the wiki. The URL can be found on http://www.vim.org 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| Change a name in multiple files |change-name| Speeding up external commands |speed-up| Useful mappings |useful-mappings| Compressing the help files |gzip-helpfile| Executing shell commands in a window |shell-window| Hex editing |hex-editing| Using <> notation in autocommands |autocmd-<>| Highlighting matching parens |match-parens| ============================================================================== 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 "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 the current buffer use the substitute command and add the 'n' flag to avoid the substitution. The reported number of substitutions is the number of items. Examples: > :%s/./&/gn characters :%s/\i\+/&/gn words :%s/^//n lines :%s/the/&/gn "the" anywhere :%s/\<the\>/&/gn "the" as a word You might want to reset 'hlsearch' or do ":nohlsearch". Add the 'e' flag if you don't want an error when there are no matches. An alternative is using |v_g_CTRL-G| in Visual mode. If you want to find matches in multiple files use |:vimgrep|. *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 For something more advanced see |winsaveview()| and |winrestview()|. ============================================================================== 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! ============================================================================== Change a name in multiple files *change-name* Example for using a script file to change a name in several files: Create a file "subs.vim" containing substitute commands and a :update command: > :%s/Jones/Smith/g :%s/Allen/Peter/g :update < Execute Vim on all files you want to change, and source the script for each argument: > vim *.let argdo source subs.vim See |:argdo|. ============================================================================== 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. ============================================================================== Highlighting matching parens *match-parens* This example shows the use of a few advanced tricks: - using the |CursorMoved| autocommand event - using |searchpairpos()| to find a matching paren - using |synID()| to detect whether the cursor is in a string or comment - using |:match| to highlight something - using a |pattern| to match a specific position in the file. This should be put in a Vim script file, since it uses script-local variables. It skips matches in strings or comments, unless the cursor started in string or comment. This requires syntax highlighting. A slightly more advanced version is used in the |matchparen| plugin. > let s:paren_hl_on = 0 function s:Highlight_Matching_Paren() if s:paren_hl_on match none let s:paren_hl_on = 0 endif let c_lnum = line('.') let c_col = col('.') let c = getline(c_lnum)[c_col - 1] let plist = split(&matchpairs, ':\|,') let i = index(plist, c) if i < 0 return endif if i % 2 == 0 let s_flags = 'nW' let c2 = plist[i + 1] else let s_flags = 'nbW' let c2 = c let c = plist[i - 1] endif if c == '[' let c = '\[' let c2 = '\]' endif let s_skip ='synIDattr(synID(line("."), col("."), 0), "name") ' . \ '=~? "string\\|comment"' execute 'if' s_skip '| let s_skip = 0 | endif' let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip) if m_lnum > 0 && m_lnum >= line('w0') && m_lnum <= line('w$') exe 'match Search /\(\%' . c_lnum . 'l\%' . c_col . \ 'c\)\|\(\%' . m_lnum . 'l\%' . m_col . 'c\)/' let s:paren_hl_on = 1 endif endfunction autocmd CursorMoved,CursorMovedI * call s:Highlight_Matching_Paren() autocmd InsertEnter * match none < vim:tw=78:ts=8:ft=help:norl: ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/todo.txt�������������������������������������������������������������������0000664�0000000�0000000�00001060275�12677030670�0016546�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*todo.txt* For Vim version 7.4. Last change: 2016 Mar 29 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|. Issues can also be entered online: http://code.google.com/p/vim/issues/list Updates will be forwarded to the vim_dev maillist. Issues entered there will not be repeated below, unless there is extra information. *known-bugs* -------------------- Known bugs and current work ----------------------- Using free memory. (Dominique, 2016 Mar 27) +channel: - When a message in the queue but there is no callback, drop it after a while? Add timestamp to queued messages and callbacks with ID, remove after a minute. Option to set the droptime. - Add remark about undo sync, is there a way to force it? - When starting a job, have an option to open the server socket, so we know the port, and pass it to the command with --socket-fd {nr}. (Olaf Dabrunz, Feb 9) How to do this on MS-Windows? - For connection to server, a "keep open" flag would be useful. Retry connecting in the main loop with zero timeout. Later - job_start(): run job in a newly opened terminal. With xterm could use -S{pty}. Partial: - Maybe we also need VAR_PARTIAL support in if_mzsch. Make it so that the window ID can be used where currently a window nr is used Patch to add "q" item to guifont. #720, Kim Brouer, 2016 Mar 29 Better patch from Yasuhiro Matsumoto, 2016 Jan 4. Patch to make tag jump work on function({expr}). (Hirohito Higashi, 2016 Mar 25) Allow for an empty dictionary key? Patch to improve I/O for Perl. (Damien, 2016 Jan 9, update Jan 22 2nd one) Patch to fix ml_get error. (Alexander Freiherr von Buddenbrock, 2016 Mar 4, #676) Regexp problems: - The regexp engines are not reentrant, causing havoc when interrupted by a remote expression or something else. Move global variables onto the stack or into an allocated struct. - The old engine does not find a match for "/\%#=1\(\)\{80}", the new engine matches everywhere. - Using win_linetabsize() can still be slow. Cache the result, store col and vcol. Reset them when moving to another line. - Very slow with a long line and Ruby highlighting. (John Whitley, 2014 Dec 4) - Bug with pattern: '\vblock (\d+)\.\n.*\d+%(\1)@<!\.$' (Lech Lorens, 2014 Feb 3) - Issue 164: freeze on regexp search. - Ignorecase not handled properly for multi-byte characters. (Axel Bender, 2013 Dec 11) - Using \@> and \?. (Brett Stahlman, 2013 Dec 21) Remark from Marcin Szamotulski Remark from Brett 2014 Jan 6 and 7. - Difference in NFA and old engine. (Brett Stahlman, 2014 Nov 5) - Bug when using \>. (Ramel, 2014 Feb 2) (Aaron Bohannon, 2014 Feb 13) - NFA regexp doesn't handle \%<v correctly. (Ingo Karkat, 2014 May 12) - Does not work with NFA regexp engine: \%u, \%x, \%o, \%d followed by a composing character - Bug relating to back references. (Ingo Karkat, 2014 Jul 24) - New RE does not give an error for empty group: "\(\)\{2}" (Dominique Pelle, 2015 Feb 7) - Using back reference before the capturing group sometimes works with the old engine, can we do this with the new engine? E.g. with "/\%(<\1>\)\@<=.*\%(<\/\(\w\+\)>\)\@=" matching text inside HTML tags. This problem is probably the same: "\%(^\1.*$\n\)\@<=\(\d\+\).*$". (guotuofeng, 2015 Jun 22) - Strange matching with "\(Hello\n\)\@<=A". (Anas Syed, 2015 Feb 12) - Problem with \v(A)@<=b+\1c. (Issue 334) - Diff highlighting can be very slow. (Issue 309) - Using %> for a virtual column has a check based on 'tabsize'. Better would be to cache the result of win_linetabsize(col), storing both col and vcol, and use them to decide whether win_linetabsize() needs to be called. Reset col and vcol when moving to another line. - this doesn't work: "syntax match ErrorMsg /.\%9l\%>20c\&\%<28c/". Leaving out the \& works. Seems any column check after \& fails. - The pattern "\1" with the old engine gives E65, with the new engine it matches the empty string. (Dominique Pelle, 2015 Oct 2, Nov 24) - Search for \\~ causes error E874. Using freed memory in quickfix code. (Dominique, 2016 Mar 21) Patch 7.4.1401 caused autochdir not to work on startup. (Rob Hoelz, #704) Patch to fix that folds close with autocomplete. #643 Christian Brabandt, 2016 Feb 18. Also include update_curswant() fix for getcurpos(). (Christian Brabandt, 2016 Feb 9) Patch to list some messages and clear messages. (Yasuhiro Matsumoto, 2016 Mar 12) Patch to fix escaping special characters for delete(). (tc-0, 2016 Mar 20, #700) Test fails on MS-Windows. Patch to put undo options together in undo window. (Gary Johnson, 2016 Jan 28) Patch to have better check for {action} argument of setqflist(). Nikolai Pavlov, Feb 25, #661. Can be even more strict. Also see patch from Hirohito Higash, Feb 25. Updated patch, 2016 Mar 25. Patch to update the GTK icon cache when installing. (Kazunobu Kuriyama, 2016 Feb 3) Patch for test86 and test87. (Roland Puntaier, #622) Cannot delete a file with square brackets with delete(). (#696) Patch to add 'topbot' to 'belloff' option. (Coot, 2016 Mar 18, #695) Patch to make matchit work better, respect 'matchpairs'. (Ken Takata, 2016 Mar 25) We can use '. to go to the last change in the current buffer, but how about the last change in any buffer? Can we use ', (, is next to .)? Patch for Python: #622. (Roland Puntaier, 2016 Feb 2) What does it change? It's possible to add ",," to 'wildignore', an empty entry. Causes problems. Reject the value? #710. Win32: patch to use 64 bit stat() if possible. (Ken Takata, 2014 May 12) More tests May 14. Update May 29. Update Aug 10. Now part of large file patches. (Ken Takata, 2016 Feb 1) Win64: Seek error in swap file for a very big file (3 Gbyte). Check storing pointer in long and seek offset in 64 bit var. Patches from Ken Takata might help (2014 Apr 17) Update 2016 Mar 28. Can include all parts into one dist patch. Patch to support 64 bit ints for Number. (Ken Takata, 2016 Jan 21) Update 2016 Mar 28. After 7.5 is released: - Drop support for older MS-Windows systems, before XP. Patch from Ken Takata, 2016 Mar 8. Add stronger encryption. Could use libsodium (NaCl). https://github.com/jedisct1/libsodium/ Possibly include the needed code so that it can be build everywhere. Patch to add setbufline(). (email from Yasuhiro Matsumoto, patch by Ozaki Kiichi, 2016 Feb 28) Update Mar 8: https://gist.github.com/mattn/23c1f50999084992ca98 Update Mar 13: https://gist.github.com/mattn/23c1f50999084992ca98 Need to try out instructions in INSSTALLpc.txt about how to install all interfaces and how to build Vim with them. Appveyor build with self-installing executable, includes getting most interfaces: https://github.com/k-takata/vim/tree/chrisbra-appveyor-build result: https://ci.appveyor.com/project/k-takata/vim/history Duplication of completion suggestions for ":!hom". Issue 539. Patch by Christian, 2016 Jan 29 > Problem that a previous silent ":throw" causes a following try/catch not to work. (ZyX, 2013 Sep 28) With examples: (Malcolm Rowe, 2015 Dec 24) Problem using ":try" inside ":execute". (ZyX, 2013 Sep 15) jsonencode(): should convert to utf-8. (Nikolai Pavlov, 2016 Jan 23) What if there is an invalid character? Should jsonencode()/jsondecode() restrict recursiveness? Or avoid recursiveness. Use vim.vim syntax highlighting for help file examples, but without ":" in 'iskeyword' for syntax. Patch to make "%:h:h" return "." instead of the full path. (Coot, 2016 Jan 24, #592) Remove SPACE_IN_FILENAME ? What could possibly go wrong? Patch to change GUI behavior: instead of changing the window size change the lines/columns when menu/toolbar/etc. is added/removed. (Ychin, 2016 Mar 20, #703) Installation of .desktop files does not work everywhere. It's now fixed, but the target directory probably isn't right. Add configure check? Should use /usr/local/share/applications or /usr/share/applications. Or use $XDG_DATA_DIRS. Also need to run update-desktop-database (Kuriyama Kazunobu, 2015 Nov 4) Access to uninitialized memory in match_backref() regexp_nda.c:4882 (Dominique Pelle, 2015 Nov 6) ":cd C:\Windows\System32\drivers\etc*" does not work, even though the directory exists. (Sergio Gallelli, 2013 Dec 29) Patch to avoid redrawing tabline when the popup menu is visible. (Christian Brabandt, 2016 Jan 28) Patch to add {skip} argument to search(). (Christian Brabandt, 2016 Feb 24) Add value "smart" to 'tagcase': ignore case when tag is all lower case. 7 Add a watchpoint in the debug mode: An expression that breaks execution when evaluating to non-zero. Add the "watchadd expr" command, stop when the value of the expression changes. ":watchdel" deletes an item, ":watchlist" lists the items. (Charles Campbell) Patch by Christian Brabandt, 2016 Feb 1. Patch to be able to use hex numbers with :digraph. (Lcd, 2015 Sep 6) Update Sep 7. Update by Christian Brabandt, 2015 Sep 8, 2016 Feb 1. Using ":windo" to set options in all windows has the side effect that it changes the window layout and the current window. Make a variant that saves and restores. Use in the matchparen plugin. Perhaps we can use ":windo <restore> {cmd}"? Patch to add <restore> to :windo, :bufdo, etc. (Christian Brabandt, 2015 Jan 6, 2nd message) Alternative: ":keeppos" command modifier: ":keeppos windo {cmd}". Patch to fix that executable() may fail on very long filename in MS-Windows. (Ken Takata, 2016 Feb 1) Patch to fix display of listchars on the cursorline. (Nayuri Aohime, 2013) Update suggested by Yasuhiro Matsumoto, 2014 Nov 25: https://gist.github.com/presuku/d3d6b230b9b6dcfc0477 Patch to make the behavior of "w" more straightforward, but not Vi compatible. With a 'cpo' flag. (Christian Brabandt, 2016 Feb 8) Patch to add optionproperties(). (Anton Lindqvist, 2016 Mar 27) Patch to add TagNotFound autocommand. (Anton Lindqvist, 2016 Feb 3) Patch to add Error autocommand. (Anton Lindqvist, 2016 Feb 17) Only remembers one error. Illegal memory access, requires ASAN to see. (Dominique Pelle, 2015 Jul 28) Gvim: when both Tab and CTRL-I are mapped, use CTRL-I not for Tab. Unexpected delay when using CTRL-O u. It's not timeoutlen. (Gary Johnson, 2015 Aug 28) Instead of separately uploading patches to the ftp site, we can get them from github with a URL like this: https://github.com/vim/vim/compare/v7.4.920%5E...v7.4.920.diff Diff for version.c contains more context, can't skip a patch. When t_Co is changed from termresponse, the OptionSet autocmmand event isn't triggered. Use the code from the end of set_num_option() in set_color_count(). Python: ":py raw_input('prompt')" doesn't work. (Manu Hack) Comparing nested structures with "==" uses a different comparator than when comparing individual items. Also, "'' == 0" evaluates to true, which isn't nice. Add "===" to have a strict comparison (type and value match). Add "==*" (?) to have a value match, but no automatic conversion, and v:true equals 1 and 1.0, v:false equals 0 and 0.0.? Plugin to use Vim in MANPAGER. Konfekt, PR #491 Using uninitialized memory. (Dominique Pelle, 2015 Nov 4) MS-Windows: When editing a file with a leading space, writing it uses the wrong name. (Aram, 2014 Nov 7) Vim 7.4. Can't recognize the $ProgramFiles(x86) environment variable. Recognize it specifically? First try with the parens, then without. Half-finished patch to fix the Problem using cgn to change a search hit when replacement includes hit. Reported by John Beckett, fix by Christian Brabandt, 2016 Jan 11. Patch to add :mapgroup, put mappings in a group like augroup. (Yasuhiro Matsumoto, 2016 Feb 19) Value returned by virtcol() changes depending on how lines wrap. This is inconsistent with the documentation. Patch to add filtering of the quickfix list. (Yegappan Lakshmanan, 2016 Mar 13, last version) Update Mar 21. Can we cache the syntax attributes, so that updates for 'relativenumber' and 'cursorline'/'cursorcolumn' are a lot faster? Build with Python on Mac does not always use the right library. (Kazunobu Kuriyama, 2015 Mar 28) Need a Vim equivalent of Python's None and a way to test for it. Use v:none. var == v:none Patch to add arguments to argc() and argv(). (Yegappan Lakshmanan, 2016 Jan 24) Also need a way to get the global arg list? Update later on Jan 24 Update Mar 5. To support Thai (and other languages) word boundaries, include the ICU library: http://userguide.icu-project.org/boundaryanalysis When complete() first argument is before where insert started and 'backspace' is Vi compatible, the completion fails. (Hirohito Higashi, 2015 Feb 19) Test 44 fails when [[=A=]] is changed to [[=À=]]. Caused by getcmdline() not handling the 0x80 as a second byte correctly? (Dominique Pelle, 2015 Jun 10) Patch to use two highlight groups for relative numbers. (Shaun Brady, 2016 Jan 30) Weird encryption problems on Windows. (Ben Fritz, 2015 Feb 13) Goes away when disabling the swap file. (might1, Feb 16) MS-Windows: Crash opening very long file name starting with "\\". (Christian Brock, 2012 Jun 29) Using an external diff is inefficient. Not all systems have a good diff program available (esp. MS-Windows). Would be nice to have in internal diff implementation. Can then also use this for displaying changes within a line. Olaf Dabrunz is working on this. The OptionSet autocommand event is not always triggered. (Rick Howe, 2015 Sep 24): :diffthis, :diffoff. ":set all&" still does not handle all side effects. Centralize handling side effects for when set by the user, on init and when reset to default. ":tag" does not jump to the right entry of a :tselect. (James Speros, 2015 Oct 9) The argument for "-S" is not taken literally, the ":so" command expands wildcards. Add a ":nowild" command modifier? (ZyX, 2015 March 4) Proposal to make options.txt easier to read. (Arnaud Decara, 2015 Aug 5) Update Aug 14. Crash in :cnext on MS-Windows. (Ben Fritz, 2015 Oct 27) When using --remote-tab on MS-Windows 'encoding' hasn't been initialized yet, the file name ends up encoded wrong. (Raul Coronado, 2015 Dec 21) Patch to add GUI colors to the terminal, when it supports it. (ZyX, 2013 Jan 26, update 2013 Dec 14, another 2014 Nov 22) Patch for problem with restoring screen on Windows. (Nobuhiro Takasaki, 2015 Sep 10) Patch to set antialiasing style on Windows. (Ondrej Balaz, 2013 Mar 14) Needs a different check for CLEARTYPE_QUALITY. Problem mentioned by Christian Brabandt, 2016 Jan 4. Example in editing.txt uses $HOME with the expectating that it ends in a slash. For me it does, but perhaps not for everybody. Add a function that inserts a slash when needed? pathconcat(dir, path) (Thilo Six, 2015 Aug 12) ml_updatechunk() is slow when retrying for another encoding. (John Little, 2014 Sep 11) Patch to fix checking global option value when not using it. (Arnaud Decara, 2015 Jul 23) When 'showbreak' is set repeating a Visual operation counts the size of the 'showbreak' text as part of the operation. (Axel Bender, 2015 Jul 20) Patch for matchit plugin related to multibyte chars. (Ken Takata, 2015 Jul 22) Patch for multi-byte characters in langmap and applying a mapping on them. (Christian Brabandt, 2015 Jun 12, update July 25) Is this the right solution? Need to cleanup langmap behavior: - in vgetorpeek() apply langmap to the typeahead buffer and put the result in a copy-buffer, only when langmap is appropriate for the current mode. Then check for mapping and let gotchars() work on the copy-buffer. - Remove LANGMAP_ADJUST() in other parts of the code. Make sure the mode is covered by the above change. So that replaying the register doesn't use keymap/langmap and still does the same thing. Remarks on issue 543 (Roland Puntaier). Patch to add grepfile(). (Scott Prager, 2015 May 26) Work in progress. Would be useful to have a treemap() or deepmap() function. Like map() but when an item is a list or dict would recurse into it. Patch for global-local options consistency. (Arnaud Decara, 2015 Jul 22) Is this right? Patch to make getregtype() return the right size for non-linux systems. (Yasuhiro Matsumoto, 2014 Jul 8) Breaks test_eval. Inefficient, can we only compute y_width when needed? Patch to use different terminal mode settings for system(). (Hayaki Saito) Does this work for everybody? Patch to fix that wide characters do not work properly after exiting. (Yasuhiro Matsumoto, 2015 May 24) Better patch to come. Patch to add wordcount(). Same info as g CTRL-G. (Christian Brabandt, 2015 Nov 17) Patch for man.vim. (SungHyun Nam, 2015 May 20) Doesn't work completely (Dominique Orban) Patch to add a "literal" argument to bufnr(). (Olaf Dabrunz, 2015 Aug 4) Cannot execute the shell when it's in a directory with a space. Issue #459. When a session file is created and there are "nofile" buffers, these are not filled. Need to trigger BufReadCmd autocommands. Also handle deleting the initial empty buffer better. (ZyX, 2015 March 8) Extended file attributes lost on write (backupcopy=no). Issue 306. Patch to add :lockjumps. (Carlo Baldassi, 2015 May 25) OK to not block marks? Mixup of highlighting when there is a match and SpellBad. (ZyX, 2015 Jan 1) Patch for drag&drop reordering of GUI tab pages reordering. (Ken Takata, 2013 Nov 22, second one, also by Masamichi Abe) Now on Git: https://gist.github.com/nocd5/165286495c782b815b94 Update 2016 Mar 15. Patch on Issue 72: 'autochdir' causes problems for :vimgrep. When 'balloonexpr' returns a list the result has a trailing newline. Just remove one trailing newline. (lcd, 2014 Oct 17) When two SIGWINCH arrive very quickly, the second one may be lost. (Josh Triplett, 2015 Sep 17) Make comments in the test Makefile silent. (Kartik Agaram, 2014 Sep 24) Result of systemlist() does not show whether text ended in line break. (Bjorn Linse, 2014 Nov 27) When in 'comments' "n:x" follows after three-part comment directly it repeats any one-character from the previous line. (Kartik Agaram, 2014 Sep 19) Syntax highlighting slow (hangs) in SASS file. (Niek Bosch, 2013 Aug 21) Patch to add the EndOfBuffer highlight group, used instead of NonText for "~" lines. (Marco Hinz, 2014 Nov 2) Adding "~" to 'cdpath' doesn't work for completion? (Davido, 2013 Aug 19) Should be easy to highlight all matches with 'incsearch'. Idea by Itchyny, 2015 Feb 6. Wrong scrolling when using incsearch. Patch by Christian Brabandt, 2014 Dec 4. Is this a good solution? Patch to add /pattern/ to :oldfiles. Pull #575. Patch to allow setting w:quickfix_title via setqflist() and setloclist() functions. (Christian Brabandt, 2013 May 8, update May 21) Patch to add getlocstack() / setlocstack(). (Christian Brabandt, 2013 May 14) Second one. Update May 22. Update by Daniel Hahler, 2014 Jul 4, Aug 14, Oct 14, Oct 15. Patch: Let rare word highlighting overrule good word highlighting. (Jakson A. Aquino, 2010 Jul 30, again 2011 Jul 2) Patch to add digits argument to round(). (Yasuhiro Matsumoto, 2015 Apr 26) Can assign to s:type when a function s:type has been defined. Also the other way around: define a function while a variable with that name was already defined. (Yasuhiro Matsumoto, 2014 Nov 3) Patch for ordered dict. (Ozaki Kiichi, 2015 May 7) Patch to make closed folds line up. (Charles Campbell, 2014 Sep 12) Remark from Roland Eggner: does it cause crashes? (2014 Dec 12) Updated patch by Roland Eggner, Dec 16 Updated patch from Charles, 2016 Jan 4. Patch to open folds for 'incsearch'. (Christian Brabandt, 2015 Jan 6) Patch for building a 32bit Vim with 64bit MingW compiler. (Michael Soyka, 2014 Oct 15) Delete old code in os_msdos.c, mch_FullName(). Patch: On MS-Windows shellescape() may have to triple double quotes. (Ingo Karkat, 2015 Jan 16) Patch for variable tabstops. On github (Christian Brabandt, 2014 May 15) Update 2016 Jan 31 (email). Redo only remembers the last change. Could use "{count}g." to redo an older change. How does the user know which change? At least have a way to list them: ":repeats". Patch for glob(), adding slash to normal files. (Ingo Karkat, 2014 Dec 22) When entering and leaving the preview window autocommands are triggered, but these may not work well. Perhaps set a flag to indicate that the preview window is involved? (John Otter, 2015 Oct 27) Using "." to repeat an Ex command puts that command in history. Probably should not happen. If the command is the result of a mapping it's not put in history either. (Jacob Niehus, 2014 Nov 2) Patch from Jacob, Nov 2. "hi link" does not respect groups with GUI settings only. (Mark Lodato, 2014 Jun 8) Bug: Autocompleting ":tag/pat" replaces "/pat" with a match but does not insert a space. (Micha Mos, 2014 Nov 7) Patch to add the :bvimgrep command. (Christian Brabandt, 2014 Nov 12) Updated 2016 Feb 10 Patch to add argument to :cquit. (Thinca, 2014 Oct 12) No error for missing endwhile. (ZyX, 2014 Mar 20) Patch to make extend() fail early when it might fail at some point. (Olaf Dabrunz, 2015 May 2) Makes extend() slower, do we still want it? Perhaps only the checks that can be done without looping over the dict or arguments. Problem with transparent and matchgroup. Issue #475 Patch to add :arglocal and :arglists. (Marcin Szamotulski, 2014 Aug 6) Spell files use a latin single quote. Unicode also has another single quote: 0x2019. (Ron Aaron, 2014 Apr 4) New OpenOffice spell files support this with ICONV. But they are not compatible with Vim spell files. The old files can no longer be downloaded. Patch to make FocusGained and FocusLost work in modern terminals. (Hayaki Saito, 2013 Apr 24) Has a problem (email 2015 Jan 7). Update 2015 Jan 10. Also see issue #609. We could add the enable/disable sequences to t_ti/t_te or t_ks/t_ke. Idea: For a window in the middle (has window above and below it), use right-mouse-drag on the status line to move a window up/down without changing its height? It's like dragging the status bar above it at the same time. Can we make ":unlet $VAR" use unsetenv() to delete the env var? What for systems that don't have unsetenv()? Patch to add a :domodeline command. (Christian Brabandt, 2014 Oct 21) Patch to add TabNew, TabNewEntered and TabClosed autocommand events. (Felipe Morales, 2015 Feb 1) This does not give an error: (Andre Sihera, 2014 Mar 21) vim -u NONE 1 2 3 -c 'bufdo if 1 | echo 1' This neither: (ZyX) vim -u NONE 1 2 3 -c 'bufdo while 1 | echo 1' 'viewdir' default on MS-Windows is not a good choice, it's a system directory. Change 'viewdir' to "$HOME/vimfiles/view" and use 'viewdiralt' to also read from? Problem with upwards search on Windows (works OK on Linux). (Brett Stahlman, 2014 Jun 8) Include a plugin manager with Vim? Neobundle seems to be the best currently. Also Vundle: https://github.com/gmarik/vundle Long message about this from ZyX, 2014 Mar 23. And following replies. Also see http://vim-wiki.mawercer.de/wiki/topic/vim%20plugin%20managment.html User view: - Support multiple sources, basically any http:// URL. Or a central place that will work for everybody (github? redirects from vim.org?). Be able to look into the files before deciding to install. - Be able to try out a plugin and remove it again with (almost) no traces. - Each plugin needs a "manifest" file that has the version, dependencies (including Vim version and features), conflicts, list of files, etc. Updater uses that to decide what/how to update. Dependencies can use a URL for specific versions, or short name for scripts on vim.org. - Once a plugin is installed it remembers where it came from, updater checks there. Can manually update when really needed. - Must be possible to install for one user. Also system wide? - Can edit plugin config with Vim. Can temporarily disable a plugin. - Run the update manually, find latest version and install. - Be able to download without special tools, must work for 95% of users. Implementation: - Avoid the 'runtimepath' getting long. Need some other way to keep each plugin separate. - When installing or updating, first figure out what needs to be done. This may involve recursively fetching manifest files for dependencies. Then show the user what's going to change and ask for OK. - Scripts on Vim.org must be able to consist of several files. Is zip format sufficient? Upload the manifest? Or refer to a site that has the manifest? - Best is to fetch individual files or use a Vimball. Reduces dependency on tools that might be missing and allows inspection of the files before installing. Out of scope: - Overview of plugins, ratings, comments, etc. That's another world. - Development work on plugins (although diff with distributed version would be useful). Setting the spell file in a session only reads the local additions, not the normal spell file. (Enno Nagel, 2014 Mar 29) CTRL-] in Visual mode uses the selected text as a tag. This does not work when preceded with CTRL-W. (Patrick Hemmer, 2014 Jun 28) When typing the first character of a command, e.g. "f", then using a menu, the menu item doesn't work. Clear typeahead when using a menu? Editing an ascii file as ucs-2 or ucs-4 causes display errors. (ZyX, 2014 Mar 30) ":Next 1 some-arg" does not complain about trailing argument. Also for various other commands. (ZyX, 2014 Mar 30) Patch to skip sort if no line matches the expression. (Christian Brabandt, 2014 Jun 25) Patch to add sortuniq(). (Cade Forester, 2014 Mar 19) Or add uniq() instead? Patch by lcd47, but it has problems. Patch to support expression argument to sort() instead of a function name. Yasuhiro Matsumoto, 2013 May 31. Or should we add a more general mechanism, like a lambda() function? Patch by Yasuhiro Matsumoto, 2014 Sep 16. VMS: Select() doesn't work properly, typing ESC may hang Vim. Use sys$qiow instead. (Samuel Ferencik, 2013 Sep 28) Patch for XDG base directory support. (Jean François Bignolles, 2014 Mar 4) Remark on the docs. Should not be a compile time feature. But then what? Completion of ":e" is ":earlier", should be ":edit". Complete to the matching command instead of doing this alphabetically. (Mikel Jorgensen) Patch to define macros for hardcoded values. (Elias Diem, 2013 Dec 14) Several syntax file match "^\s*" which may get underlined if that's in the highlight group. Add a "\zs" after it? The undo file name can get too long. (Issue 346) For the path use a hash instead of dir%dir%dir%name hash%name. Patch to add ":undorecover", get as much text out of the undo file as possible. (Christian Brabandt, 2014 Mar 12, update Aug 22) Include Haiku port? (Adrien Destugues, Siarzhuk Zharski, 2013 Oct 24) It can replace the BeOS code, which is likely not used anymore. Updated spec ftplugin. (Matěj Cepl, 2013 Oct 16) Patch to right-align signs. (James Kolb (email james), 2013 Sep 23) Patch to handle integer overflow. (Aaron Burrow, 2013 Dec 12) With "$" in 'cpoptions' the popup menu isn't fully drawn. (Matti Niemenmaa, 2013 Sep 5) Patch to add "ntab" item in 'listchars' to repeat first character. (Nathaniel Braun, pragm, 2013 Oct 13) A better solution 2014 Mar 5. Undo message is not always properly displayed. Patch by Ken Takata, 2013 oct 3. Doesn't work properly according to Yukihiro Nakadaira. /[b-a] gives error E16, should probably be E769. 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"). Patch by Thomas Tuegel, also for GTK, 2013 Nov 24 :help gives example for z?, but it does not work. m? and t? do work. Python: Extended funcrefs: use func_T* structure in place of char_u* function names. (ZyX, 2013 Jul 15, update Sep 22, 24, 28; Update 2013 Dec 15, 2014 Jan 6) Also fixes Bug: E685 error for func_unref(). (ZyX, 2010 Aug 5) Patch to add funcref to Lua. (Luis Carvalho, 2013 Sep 4) With tests: Sep 5. Patch to fix that on suckless Terminal mousewheel up does not work. (Ralph Eastwood, 2013 Nov 25) Discussion about canonicalization of Hebrew. (Ron Aaron, 2011 April 10) Checking runtime scripts: Thilo Six, 2012 Jun 6. When evaluating expression in backticks, autoload doesn't work. (Andy Wokula, 2013 Dec 14) Using <nr>ifoobar<esc> can slow down Vim. Patch by Christian Brabandt, 2013 Dec 13. Patch from Christian Brabandt to preserve upper case marks when wiping out a buffer. (2013 Dec 9) GTK: problem with 'L' in 'guioptions' changing the window width. (Aaron Cornelius, 2012 Feb 6) Patch to add option that tells whether small deletes go into the numbered registers. (Aryeh Leib Taurog, 2013 Nov 18) Javascript file where indent gets stuck on: GalaxyMaster, 2012 May 3. The BufUnload event is triggered when re-using the empty buffer. (Pokey Rule, 2013 Jul 22) Patch by Marcin Szamotulski, 2013 Jul 22. The CompleteDone autocommand needs some info passed to it: - The word that was selected (empty if abandoned complete) - Type of completion: tag, omnifunc, user func. Patch to allow more types in remote_expr(). (Lech Lorens, 2014 Jan 5) Doesn't work for string in list. Other way to pass all types of variables reliably? Using ":call foo#d.f()" doesn't autoload the "foo.vim" file. That is, calling a dictionary function on an autoloaded dict. Works OK for echo, just not for ":call" and ":call call()". (Ted, 2011 Mar 17) Patch by Christian Brabandt, 2013 Mar 23. Not 100% sure this is the right solution. Patch to add {lhs} to :mapclear: clear all maps starting with {lhs}. (Christian Brabandt, 2013 Dec 9) Exception caused by argument of return is not caught by try/catch. (David Barnett, 2013 Nov 19) 8 'backupdir' and 'directory' should use $TMPDIR, $TMP and/or $TEMP when defined. Issue 28. Patch to fix that 'cedit' is recognized after :normal. (Christian Brabandt, 2013 Mar 19, later message) Patch to view coverage of the tests. (Nazri Ramliy, 2013 Feb 15) Patch to invert characters differently in GTK. (Yukihiro Nakadaira, 2013 May 5) Patch to add "Q" and "A" responses to interactive :substitute. They are carried over when using :global. (Christian Brabandt, 2013 Jun 19) Bug with 'cursorline' in diff mode. Line being scrolled into view gets highlighted as the cursor line. (Alessandro Ivaldi, 2013 Jun 4) Two highlighting bugs. (ZyX, 2013 Aug 18) Patch to add the bufferlist() function. (Yegappan Lakshmanan, 2013 May 5) May 17: with winlist() and tabpagelist(). May 19: with local variables. May 28: with options Patch to support 'u' in interactive substitute. (Christian Brabandt, 2012 Sep 28) With tests: Oct 9. Patch from Christian Brabandt to make the "buffer" argument for ":sign place" optional. (2013 Jul 12) Dialog is too big on Linux too. (David Fishburn, 2013 Sep 2) Improve the installer for MS-Windows. There are a few alternatives: - Installer from Cream (Steve Hall). - Modern UI 2.0 for the Nsis installer. (Guopeng Wen) https://github.com/gpwen/vim-installer-mui2 - make it possible to do a silent install, see http://nsis.sourceforge.net/Docs/Chapter4.html#4.12 Version from Guopeng Wen does this. - MSI installer: https://github.com/petrkle/vim-msi/ - The one on Issue 279. Problem: they all work slightly different (e.g. don't install vimrun.exe). How to test that it works well for all Vim users? Patch to check whether a buffer is quickfix or a location list. (Yasuhiro Matsumoto, 2014 Dec 9) Patch to make fold updates much faster. (Christian Brabandt, 2012 Dec) Issue 54: document behavior of -complete, also expands arg. - Add regex for 'paragraphs' and 'sections': 'parare' and 'sectre'. Combine the two into a regex for searching. (Ned Konz) Patch by Christian Brabandt, 2013 Apr 20, unfinished. Bug: findfile("any", "file:///tmp;") does not work. In the ATTENTION message about an existing swap file, mention the name of the process that is running. It might actually be some other program, e.g. after a reboot. Patch to have text objects defined by arbitrary single characters. (Daniel Thau, 2013 Nov 20, 2014 Jan 29, 2014 Jan 31) Ben Fritz: problem with 'selection' set to "exclusive". Updated to current Vim, not quite right yet. (Ben Fritz, 2014 Mar 27) Patch to select the next or previous text object if there isn't one under the cursor. (Daniel Thau, 2013 Nov 20) patch to add "combine" flag to syntax commands. (so8res, 2012 Dec 6) Bug caused by patch 7.3.1288? Issue 183. I can't reproduce it. Syntax update problem in one buffer opened in two windows, bottom window is not correctly updated. (Paul Harris, 2012 Feb 27) Patch to add assignments in cscope. (Uli Meis, Estabrooks, 2012 Sep 1) Alternate patch by Gary Johnson, Sep 4. Patch to add getsid(). (Tyru, 2011 Oct 2) Do we want this? Update Oct 4. Or use expand('<sid>')? Patch to make confirm() display colors. (Christian Brabandt, 2012 Nov 9) Patch to add functions for signs. (Christian Brabandt, 2013 Jan 27) Do we need some way (option) to show the sign column even when there are no signs? Patch by Christian Brabandt, 2013 Aug 22. Patch to remove flicker from popup menu. (Yasuhiro Matsumoto, 2013 Aug 15) Problem with refresh:always in completion. (Tyler Wade, 2013 Mar 17) b:undo_ftplugin cannot call a script-local function. (Boris Danilov, 2013 Jan 7) Win32: 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? Python: Be able to define a Python function that can be called directly from Vim script. Requires converting the arguments and return value, like with vim.bindeval(). Patch for :tabcloseleft, after closing a tab go to left tab. (William Bowers, 2012 Aug 4) Patch to improve equivalence classes in regexp patterns. (Christian Brabandt, 2013 Jan 16, update Jan 17) Patch with suggestions for starting.txt. (Tony Mechelynck, 2012 Oct 24) But use Gnome instead of GTK? Should be possible to enable/disable matchparen per window or buffer. Add a check for b:no_match_paren in Highlight_matching_Pair() (Marcin Szamotulski, 2012 Nov 8) Session file creation: 'autochdir' causes trouble. Keep it off until after loading all files. Win32: When 'autochdir' is on and 'encoding' is changed, files on the command line are opened again, but from the wrong directory. Apply 'autochdir' only after starting up? 8 "stl" and "stlnc" in 'fillchars' don't work for multi-byte characters. Patch by Christian Wellenbrock, 2013 Jul 5. MS-Windows resizing problems: - Windows window on screen positioning: Patch by Yukihiro Nakadaira, 2012 Jun 20. Uses getWindowRect() instead of GetWindowPlacement() - Win32: When the taskbar is at the top of the screen creating the tabbar causes the window to move unnecessarily. (William E. Skeith III, 2012 Jan 12) Patch: 2012 Jan 13 Needs more work (2012 Feb 2) 'iminsert' global value set when using ":setlocal iminsert"? (Wu, 2012 Jun 23) Patch to append regexp to tag commands to make it possible to select one out of many matches. (Cody Cutler, 2013 Mar 28) Patch to add tagfunc(). Cleaned up by Christian Brabandt, 2013 Jun 22. Help for 'b:undo_indent'. (Thilo Six, 2012 May 28) Also question if examples are correct. The input map for CTRL-O in mswin.vim causes problems after CTRL-X CTRL-O. Suggestion for another map. (Philip Mat, 2012 Jun 18) But use "gi" instead of "a". Or use CTRL-\ CTRL-O. Patch to support user name completion on MS-Windows. (Yasuhiro Matsumoto, 2012 Aug 16) When there are no command line arguments ":next" and ":argu" give E163, which is confusing. Should say "the argument list is empty". xterm supports escape sequences to mark a paste operation. Need to be enabled. (Bruno Sutic, 2014 Jul 11) How to know the terminal supports this? URXVT: - will get stuck if byte sequence does not contain the expected semicolon. - Use urxvt mouse support also in xterm. Explanations: http://www.midnight-commander.org/ticket/2662 Patch to have the fold and sign column and at the last line of the buffer. (Marco Hinz, 2014 Sep 25) Alternate suggestion: let all columns continue, also the number column. Patch to add tests for if_xcmdsrv.c., Jul 8, need some more work. (Brian Burns) New tests Jul 13. Update Jul 17. Discussion Jul 18. When running Vim in silent ex mode, an existing swapfile causes Vim to wait for a user action without a prompt. (Maarten Billemont, 2012 Feb 3) Do give the prompt? Quit with an error? Patch to list user digraphs. (Christian Brabandt, 2012 Apr 14) Patch to add digraph() function. (Christian Brabandt, 2013 Aug 22, update Aug 24) Patch for input method status. (Hirohito Higashi, 2012 Apr 18) Update Vim app icon (for Gnome). (Jakub Steiner, 2013 Dec 6) Patch to use .png icons for the toolbar on MS-Windows. (Martin Gieseking, 2013 Apr 18) Patch for has('unnamedplus') docs. (Tony Mechelynck, 2011 Sep 27) And one for gui_x11.txt. ":cd" doesn't work when current directory path contains "**". finddir() has the same problem. (Yukihiro Nakadaira, 2012 Jan 10) Requires a rewrite of the file_file_in_path code. Should use has("browsefilter") in ftplugins. Requires patch 7.3.593. Update for vim2html.pl. (Tyru, 2013 Feb 22) Patch to sort functions starting with '<' after others. Omit dict functions, they can't be called. (Yasuhiro Matsumoto, 2011 Oct 11) Patch to pass list to or(), and() and xor(). (Yasuhiro Matsumoto, 2012 Feb 8) Patch to improve "it" and "at" text object matching. (Christian Brabandt, 2011 Nov 20) Patch to improve GUI find/replace dialog. (Christian Brabandt, 2012 May 26) Update Jun 2. `] moves to character after insert, instead of the last inserted character. (Yukihiro Nakadaira, 2011 Dec 9) Plugin for Modeleasy. (Massimiliano Tripoli, 2011 Nov 29) BufWinLeave triggers too late when quitting last window in a tab page. (Lech Lorens, 2012 Feb 21) Patch for 'transparency' option. (Sergiu Dotenco, 2011 Sep 17) Only for MS-Windows. No documentation. Do we want this? Patch to support cursor shape in Cygwin console. (Ben bgold, 2011 Dec 27) Issue 64: when 'incsearch' is on can't paste LF on command line. On MS-Windows a temp dir with a & init causes system() to fail. (Ben Fritz, 2012 Jun 19) 'cursorline' is displayed too short when there are concealed characters and 'list' is set. (Dennis Preiser) Patch 7.3.116 was the wrong solution. Christian Brabandt has another incomplete patch. (2011 Jul 13) With concealed text mouse click doesn't put the cursor in the right position. (Herb Sitz) Fix by Christian Brabandt, 2011 Jun 16. Doesn't work properly, need to make the change in where RET_WIN_BUF_CHARTABSIZE() is called. Syntax region with 'concealends' and a 'cchar' value, 'conceallevel' set to 2, only one of the two ends gets the cchar displayed. (Brett Stahlman, 2010 Aug 21, Ben Fritz, 2010 Sep 14) The :syntax cchar value can only be a single character. It would be useful to support combining characters. (Charles Campbell) 'cursorline' works on a text line only. Add 'cursorscreenline' for highlighting the screen line. (Christian Brabandt, 2012 Mar 31) Win32: Patch to use task dialogs when available. (Sergiu Dotenco, 2011 Sep 17) New feature, requires testing. Made some remarks. Win32: Patch for alpha-blended icons and toolbar height. (Sergiu Dotenco, 2011 Sep 17) Asked for feedback from others. Win32: Cannot cd into a directory that starts with a space. (Andy Wokula, 2012 Jan 19) Need to escape $HOME on Windows for fnameescape()? (ZyX, 2011 Jul 21, discussion 2013 Jul 4) Can't simply use a backslash, \$HOME has a different meaning already. Would be possible to use $$HOME where $HOME is to be used. "2" in 'formatoptions' not working in comments. (Christian Corneliussen, 2011 Oct 26) Bug in repeating Visual "u". (Lawrence Kesteloot, 2010 Dec 20) With "unamedplus" in 'clipboard' pasting in Visual mode causes error for empty register. (Michael Seiwald, 2011 Jun 28) I can't reproduce it. Windows keys not set properly on Windows 7? (cncyber, 2010 Aug 26) When using a Vim server, a # in the path causes an error message. (Jeff Lanzarotta, 2011 Feb 17) Setting $HOME on MS-Windows is not very well documented. Suggestion by Ben Fritz (2011 Oct 27). Bug: Windows 7 64 bit system freezes when 'clipboard' set to "unnamed" and doing ":g/test/d". Putting every delete on the clipboard? (Robert Chan, 2011 Jun 17) When there is a ">" in a line that "gq" wraps to the start of the next line, then the following line will pick it up as a leader. Should get the leader from the first line, not a wrapped line. (Matt Ackeret, 2012 Feb 27) Using ":break" or something else that stops executing commands inside a ":finally" does not rethrow a previously uncaught exception. (ZyX, 2010 Oct 15) Vim using lots of memory when joining lines. (John Little, 2010 Dec 3) BT regexp engine: After trying a \@> match and failing, submatches are not cleared. See test64. Changes to manpage plugin. (Elias Toivanen, 2011 Jul 25) Patch to make "z=" work when 'spell' is off. Does this have nasty side effects? (Christian Brabandt, 2012 Aug 5, Update 2013 Aug 12) Would also need to do this for spellbadword() and spellsuggest(). On 64 bit MS-Windows "long" is only 32 bits, but we sometimes need to store a 64 bits value. Change all number options to use nropt_T and define it to the right type. string() can't parse back "inf" and "nan". Fix documentation or fix code? (ZyX, 2010 Aug 23) Make 'formatprg' global-local. (Sung Pae) When doing "redir => s:foo" in a script and then "redir END" somewhere else (e.g. in a function) it can't find s:foo. When a script contains "redir => s:foo" but doesn't end redirection, a following "redir" command gives an error for not being able to access s:foo. (ZyX, 2011 Mar 27) When setqflist() uses a filename that triggers a BufReadCmd autocommand Vim doesn't jump to the correct line with :cfirst. (ZyX, 2011 Sep 18) Behavior of i" and a" text objects isn't logical. (Ben Fritz, 2013 Nov 19) 7 Make "ga" show the digraph for a character, if it exists. Patch from Christian Brabandt, 2011 Aug 19. maparg() does not show the <script> flag. When temporarily changing a mapping, how to restore the script ID? Bug in try/catch: return with invalid compare throws error that isn't caught. (ZyX, 2011 Jan 26) When setting a local option value from the global value, add a script ID that indicates this, so that ":verbose set" can give a hint. Check with options in the help file. After patch 7.3.097 still get E15. (Yukihiro Nakadaira, 2011 Jan 18) Also for another example (ZyX, 2011 Jan 24) Build problem with small features on Mac OS X 10.6. (Rainer, 2011 Jan 24) "0g@$" puts '] on last byte of multi-byte. (ZyX, 2011 Jan 22) Patch to addd TextDeletePost and TextYankPost events. (Philippe Vaucher, 2011 May 24) Update May 26. Patch for :tabrecently. (Hirokazu Yoshida, 2012 Jan 30) Problem with "syn sync grouphere". (Gustavo Niemeyer, 2011 Jan 27) Loading autoload script even when usage is inside "if 0". (Christian Brabandt, 2010 Dec 18) With a filler line in diff mode, it isn't displayed in the column with line number, but it is in the sign column. Doesn't look right. (ZyX 2011 Jun 5) Patch by Christian Brabandt, 2011 Jun 5. Introduces new problems. Add jump() function. (Marcin Szamotulski, 2013 Aug 29) Is this needed? CTRL-O and CTRL-I do the same, just more difficult to use. 8 Add a command to jump to the next character highlighted with "Error". Patch by Christian Brabandt, uses ]e [e ]t and [t. 2011 Aug 9. 8 Add an event like CursorHold that is triggered repeatedly, not just once after typing something. Need for CursorHold that retriggers. Use a key that doesn't do anything, or a function that resets did_cursorhold. Patch by Christian Brabandt, 2011 May 6. Add event for when the text scrolls. A bit like CursorMoved. Also a similar one for insert mode. Use the event in matchparen to update the highlight if the match scrolls into view. 7 Use "++--", "+++--" for different levels instead of "+---" "+----". Patch by Christian Brabandt, 2011 Jul 27. Update by Ben Fritz, with fix for TOhtml. (2011 Jul 30) 9 Add %F to 'errorformat': file name without spaces. Useful on Unix to avoid matching something up to a time 11:22:33. Patch by Christian Brabandt, 2011 Jul 27. Patch to add up to 99 match groups. (Christian Brabandt, 2010 Dec 22) Also add named groups: \%{name}(re) and \%{name}g In the sandbox it's not allowed to do many things, but it's possible to change or set variables. Add a way to prevent variables from being changed in the sandbox? E.g.: ":protect g:restore_settings". GTK: drawing a double-width combining character over single-width characters doesn't look right. (Dominique Pelle, 2010 Aug 8) GTK: tear-off menu does not work. (Kurt Sonnenmoser, 2010 Oct 25) Win32: tear-off menu does not work when menu language is German. (Markus Bossler, 2011 Mar 2) Fixed by 7.3.095? Version of netbeans.c for use with MacVim. (Kazuki Sakamoto, 2010 Nov 18) 7.3.014 changed how backslash at end of line works, but still get a NUL when there is one backslash. (Ray Frush, 2010 Nov 18) What does the original ex do? Searching mixed with Visual mode doesn't redraw properly. (James Vega, 2010 Nov 22) New esperanto spell file can't be processed. (Dominique Pelle, 2011 Jan 30) - move compflags to separate growarray? - instead of a regexp use a hashtable. Expand '?', '*', '+'. What would be the maximum repeat for * and +? "L'Italie" noted as a spell error at start of the sentence. (Dominique Pelle, 2011 Feb 27) Editing a file with a ^M with 'ff' set to "mac", opening a help file, then the ^M is displayed as ^J sometimes. Getting 'ff' value from wrong window/buffer? 'colorcolumn' has higher priority than hlsearch. Should probably be the other way around. (Nazri Ramliy, 2013 Feb 19) When Vim is put in the background (SIGTSTP) and then gets a SIGHUP it doesn't exit. It exists as soon as back in the foreground. (Stephen Liang, 2011 Jan 9) Caused by vim_handle_signal(SIGNAL_BLOCK); in ui.c. g` not working correctly when using :edit. It works OK when editing a file on the command line. (Ingo Karkat, 2011 Jan 25) Since patch 7.2.46 Yankring plugin has become very slow, eventually make Vim crash? (Raiwil, 2010 Nov 17) Patch to add FoldedLineNr highlighting: different highlighting for the line number of a closed fold. (eXerigumo Clanjor, 2013 Jul 15) Regexp engine performance: - Profiling: ./vim -u NONE -s ~/vim/test/ruby.vim ./vim -u NONE -s ~/vim/test/loop.vim ./vim -u NONE -s ~/vim/test/alsa.vim ./vim -s ~/vim/test/todo.vim ./vim -s ~/vim/test/xml.vim Dominique Pelle: xmlSyncDT is particularly slow (Jun 7) - More test files from the src/pkg/regexp/testdata directory in the Go repo. - Performance tests: - Using asciidoc syntax. (Marek Schimara, 2013 Jun 6) - ~/vim/text/FeiqCfg.xml (file from Netjune) - ~/vim/text/edl.svg (also XML) - glts has five tests. (May 25) - ~/vim/test/slowsearch - ~/vim/test/rgb.vim - search for a.*e*exn in the vim executable. Go to last line to use 'hlsearch'. - Slow combination of folding and PHP syntax highlighting. Script to reproduce it. Caused by "syntax sync fromstart" in combination with patch 7.2.274. (Christian Brabandt, 2010 May 27) Generally, folding with 'foldmethod' set to "syntax" is slow. Do profiling to find out why. Patch to add 'systemencoding', convert between 'encoding' and this for file names, shell commands and the like. (Kikuchan, 2010 Oct 14) Assume the system converts between the actual encoding of the filesystem to the system encoding (usually utf-8). Problem producing tags file when hebrew.frx is present. It has a BOM. Results in E670. (Tony Mechelynck, 2010 May 2) 'beval' option should be global-local. Ruby: ":ruby print $buffer.number" returns zero. setpos() does not restore cursor position after :normal. (Tyru, 2010 Aug 11) 7 The 'directory' option supports changing path separators to "%" to make file names unique, also support this for 'backupdir'. (Mikolaj Machowski) Patch by Christian Brabandt, 2010 Oct 21. With "tw=55 fo+=a" typing space before ) doesn't work well. (Scott Mcdermott, 2010 Oct 24) Patch to add random number generator. (Hong Xu, 2010 Nov 8, update Nov 10) Alternative from Christian Brabandt. (2010 Sep 19) Messages in message.txt are highlighted as examples. When using cp850 the NBSP (0xff) is not drawn correctly. (Brett Stahlman, 2010 Oct 22) 'isprint' is set to "@,161-255". ":echo "\x85" =~# '[\u0085]'" returns 1 instead of 0. (ZyX, 2010 Oct 3) 'cindent' not correct when 'list' is set. (Zdravi Korusef, 2010 Apr 15) C-indenting: A matching { in a comment is ignored, but intermediate { are not checked to be in a comment. Implement FM_SKIPCOMM flag of findmatchlimit(). Issue 46. Mac with X11: clipboard doesn't work properly. (Raf, 2010 Aug 16) Using CompilerSet doesn't record where an option was set from. E.g., in the gcc compiler plugin. (Gary Johnson, 2010 Dec 13) ":helpgrep" does not put the cursor in the correct column when preceded by accented character. (Tony Mechelynck, 2010 Apr 15) Don't call check_restricted() for histadd(), setbufvar(), settabvar(), setwinvar(). Patch for GVimExt to show an icon. (Dominik Riebeling, 2010 Nov 7) When writing a file > 2Gbyte, the reported number of bytes is negative. (Antonio Colombo, 2010 Dec 18) When 'lines' is 25 and 'scrolloff' is 12, "j" scrolls zero or two lines instead of one. (Constantin Pan, 2010 Sep 10) Gui menu edit/paste in block mode insert only inserts in one line (Bjorn Winckler, 2011 May 11) Requires a map mode for Insert mode started from blockwise Visual mode. Use json format for new items in .viminfo: |["info","any info"] |["text","text text text" |"continuation line"] |["hist",242342342,{"arg":"value"}] Writing nested List and Dict in viminfo gives error message and can't be read back. (Yukihiro Nakadaira, 2010 Nov 13) Problem with cursor in the wrong column. (SungHyun Nam, 2010 Mar 11) Additional info by Dominique Pelle. (also on 2010 Apr 10) CreateFile and CreateFileW are used without sharing, filewritable() fails when the file was already open (e.g. script is being sourced). Add FILE_SHARE_READ| FILE_SHARE_WRITE in mch_access()? (Phillippe Vaucher, 2010 Nov 2) Is ~/bin (literally) in $PATH supposed to work? (Paul, 2010 March 29) Looks like only bash can do it. (Yakov Lerner) Cscope "cs add" stopped working somewhat before 7.2.438. (Gary Johnson, 2010 Jun 29) Caused by 7.2.433? I often see pasted text (from Firefox, to Vim in xterm) appear twice. Also, Vim in xterm sometimes loses copy/paste ability (probably after running an external command). Jumplist doesn't work properly in Insert mode? (Jean Johner, 2010 Mar 20) Problem with transparent cmdline. Also: Terminal title is wrong with non-ASCII character. (Lily White, 2010 Mar 7) iconv() doesn't fail on an illegal character, as documented. (Yongwei Wu, 2009 Nov 15, example Nov 26) Add argument to specify whether iconv() should fail or replace with a character and continue? Add local time at start of --startuptime output. Requires configure check for localtime(). Use format year-month-day hr:min:sec. Patch to add "combine" to :syntax, combines highlight attributes. (Nate Soares, 2012 Dec 3) Patch to make ":hi link" also take arguments. (Nate Soares, 2012 Dec 4) Shell not recognized properly if it ends in "csh -f". (James Vega, 2009 Nov 3) Find tail? Might have a / in argument. Find space? Might have space in path. Test 51 fails when language set to German. (Marco, 2011 Jan 9) Dominique can't reproduce it. 'ambiwidth' should be global-local. ":function f(x) keepjumps" creates a function where every command is executed like it has ":keepjumps" before it. Coverity: Check if there are new reported defects: https://scan.coverity.com/projects/241 Patch to support :undo absolute jump to file save number. (Christian Brabandt, 2010 Nov 5) Patch to use 'foldnextmax' also for "marker" foldmethod. (Arnaud Lacombe, 2011 Jan 7) Bug with 'incsearch' going to wrong line. (Wolfram Kresse, 2009 Aug 17) Only with "vim -u NONE". Problem with editing file in binary mode. (Ingo Krabbe, 2009 Oct 8) With 'wildmode' set to "longest:full,full" and pressing Tab once the first entry in wildmenu is highlighted, that shouldn't happen. (Yuki Watanabe, 2011 Feb 12) Display error when 'tabline' that includes a file name with double-width characters. (2010 Aug 14, bootleq) Problem with stop directory in findfile(). (Adam Simpkins, 2009 Aug 26) Using ']' as the end of a range in a pattern requires double escaping: /[@-\\]] (Andy Wokula, 2011 Jun 28) Syntax priority problem. (Charles Campbell, 2011 Sep 15) When completion inserts the first match, it may trigger the line to be folded. Disable updating folds while completion is active? (Peter Odding, 2010 Jun 9) When a:base in 'completefunc' starts with a number it's passed as a number, not a string. (Sean Ma) Need to add flag to call_func_retlist() to force a string value. Invalid read error in Farsi mode. (Dominique Pelle, 2009 Aug 2) For running gvim on a USB stick: avoid the OLE registration. Use a command line argument -noregister. When using an expression in 'statusline' leading white space sometimes goes missing (but not always). (ZyX, 2010 Nov 1) When a mapping exists both for insert mode and lang-insert mode, the last one doesn't work. (Tyru, 2010 May 6) Or is this intended? Still a problem with ":make" in the wrong directory. Caused by ":bufdo". (Ajit Thakkar, 2009 Jul 1) More information Jul 9, Jul 15. Caused by "doautoall syntaxset BufEnter *" in syntax/nosyntax.vim ? There also is a BufLeave/BufEnter aucmd to save/restore view. Does the patch to save/restore globaldir work? ":bufdo normal gg" while 'hidden' is set leaves buffers without syntax highlighting. Don't disable Syntax autocommands then? Or add a flag/modifier to avoid changing 'eventignore'? Patch for displaying 0x200c and 0x200d. (Ali Gholami Rudi, 2009 May 6) Probably needs a bit of work. Patch to add farsi handling to arabic.c (Ali Gholami Rudi, 2009 May 2) Added test, updates, June 23. Updated for 7.4: http://litcave.rudi.ir/farsi_vim.diff With modification for Tatweel character: https://dpaste.de/VmFw Remark from Ameretat Reith (2014 Oct 13) List of encoding aliases. (Takao Fujiwara, 2009 Jul 18) Are they all OK? Update Jul 22. Win32: Improved Makefile for MSVC. (Leonardo Valeri Manera, 2010 Aug 18) Win32: Expanding 'path' runs into a maximum size limit. (bgold12, 2009 Nov 15) Win32: Patch for enabling quick edit mode in console. (Craig Barkhouse, 2010 Sep 1) Win32: Patch for using .png files for icons. (Charles Peacech, 2012 Feb 5) Putting a Visual block while 'visualedit' is "all" does not leave the cursor on the first character. (John Beckett, 2010 Aug 7) Setting 'tags' to "tagsdir/*" does not find "tagsdir/tags". (Steven K. Wong, 2009 Jul 18) Patch to add "focusonly" to 'scrollopt', so that scrollbind also applies in window that doesn't have focus. (Jonathon Mah, 2009 Jan 12) Needs more work. Problem with <script> mappings (Andy Wokula, 2009 Mar 8) When starting Vim with "gvim -f -u non_existent_file > foo.txt" there are a few control characters in the output. (Dale Wiles, 2009 May 28) 'cmdwinheight' is only used in last window when 'winheight' is a large value. (Tony Mechelynck, 2009 Apr 15) Status line containing winnr() isn't updated when splitting the window (Clark J. Wang, 2009 Mar 31) When $VIMRUNTIME is set in .vimrc, need to reload lang files. Already done for GTK, how about others? (Ron Aaron, 2010 Apr 10) Patch for GTK buttons X1Mouse and X2Mouse. (Christian J. Robinson, 2010 Aug 9) Motif: Build on Ubuntu can't enter any text in dialog text fields. When 'ft' changes redraw custom status line. ":tab split fname" doesn't set the alternate file in the original window, because win_valid() always returns FALSE. Below win_new_tabpage() in ex_docmd.c. Space before comma in function definition not allowed: "function x(a , b)" Give a more appropriate error message. Add a remark to the docs. string_convert() should be able to convert between utf-8 and utf-16le. Used for GTK clipboard. Avoid requirement for iconv. Now that colnr_T is int instead of unsigned, more type casts can be removed. 'delcombine' does not work for the command line. (Tony Mechelynck, 2009 Jul 20) Don't load macmap.vim on startup, turn it into a plugin. (Ron Aaron, 2009 Apr 7) Reminder Apr 14. Add "no_hlsearch" to winsaveview(). Cursorline highlighting combines with Search ('hlsearch') but not with SpellBad. (Jim Karsten, 2009 Mar 18) When 'foldmethod' is "indent", adding an empty line below a fold and then indented text, creates a new fold instead of joining it with the previous one. (Evan Laforge, 2009 Oct 17) Bug: When reloading a buffer changed outside of Vim, BufRead autocommands are applied to the wrong buffer/window. (Ben Fritz, 2009 Apr 2, May 11) Ignore window options when not in the right window? Perhaps we need to use a hidden window for applying autocommands to a buffer that doesn't have a window. When using "ab foo bar" and mapping <Tab> to <Esc>, pressing <Tab> after foo doesn't trigger the abbreviation like <Esc> would. (Ramana Kumar, 2009 Sep 6) getbufvar() to get a window-local option value for a buffer that's not displayed in a window should return the value that's stored for that buffer. ":he ctrl_u" can be auto-corrected to ":he ctrl-u". There should be a way after an abbreviation has expanded to go back to what was typed. CTRL-G h ? Would also undo last word or line break inserted perhaps. And undo CTRL-W. CTRL-G l would redo. Diff mode out of sync. (Gary Johnson, 2010 Aug 4) Support a 'systemencoding' option (for Unix). It specifies the encoding of file names. (Kikuchan, 2010 Oct 5). Useful on a latin1 or double-byte Asian system when 'encoding' is "utf-8". Win32 GUI: last message from startup doesn't show up when there is an echoerr command. (Cyril Slobin, 2009 Mar 13) Win32: completion of file name ":e c:\!test" results in ":e c:\\!test", which does not work. (Nieko Maatjes, 2009 Jan 8, Ingo Karkat, 2009 Jan 22) opening/closing window causes other window with 'winfixheight' to change height. Also happens when there is another window in the frame, if it's not very high. (Yegappan Lakshmanan, 2010 Jul 22, Michael Peeters, 2010 Jul 22) Directory wrong in session file, caused by ":lcd" in BufEnter autocommand. (Felix Kater, 2009 Mar 3) Session file generates error upon loading, cause by --remote-silent-tab. (7tommm (ytommm) 2010 Nov 24) Using ~ works OK on 'a' with composing char, but not on 0x0418 with composing char 0x0301. (Tony Mechelynck, 2009 Mar 4) Searching for composing char works, but not when inside []. (ZyX, Benjamin R. Haskell, 2010 Aug 24) This does not work yet: "a\(%C\)" (get composing characters into a submatch). A function on a dictionary is not profiled. (ZyX, 2010 Dec 25) Inconsistent: starting with $LANG set to es_ES.utf-8 gives Spanish messages, even though locale is not supported. But ":lang messages es_ES.utf-8" gives an error and doesn't switch messages. (Dominique Pelle, 2009 Jan 26) When $HOME contains special characters, such as a comma, escape them when used in an option. (Michael Hordijk, 2009 May 5) Turn "esc" argument of expand_env_esc() into string of chars to be escaped. Should make 'ignorecase' global-local, so that it makes sense setting it from a modeline. Add cscope target to Makefile. (Tony Mechelynck, 2009 Jun 18, replies by Sergey Khorev) Consider making YankRing or something else that keeps a list of yanked text part of standard Vim. The "1 to "9 registers are not sufficient. netrw: dragging status line causes selection of entry. Should check row number to be below last visible line. After doing "su" $HOME can be the old user's home, thus ~root/file is not correct. Don't use it in the swap file. Completion for ":buf" doesn't work properly on Win32 when 'shellslash' is off. (Henrik Ohman, 2009, Jan 29) shellescape() depends on 'shellslash' for quoting. That doesn't work when 'shellslash' is set but using cmd.exe. (Ben Fritz) Use a different option or let it depend on whether 'shell' looks like a unix-like shell? Bug: in Ex mode (after "Q") backslash before line break, when yanked into a register and executed, results in <Nul>: instead of line break. (Konrad Schwarz, 2010 Apr 16) Have a look at patch for utf-8 line breaking. (Yongwei Wu, 2008 Mar 1, Mar 23) Now at: http://vimgadgets.sourceforge.net/liblinebreak/ Greek sigma character should be lower cased depending on the context. Can we make this work? (Dominique Pelle, 2009 Sep 24) When changing 'encoding' convert all the swap file names, so that we can still delete them. Also convert all buffer file names? "gqip" in Insert mode has an off-by-one error, causing it to reflow text. (Raul Coronado, 2009 Nov 2) Update src/testdir/main.aap. Something wrong with session that has "cd" commands and "badd", in such a way that Vim doesn't find the edited file in the buffer list, causing the ATTENTION message? (Tony Mechelynck, 2008 Dec 1) Also: swap files are in ~/tmp/ One has relative file name ".mozilla/...". Add v:motion_force. (Kana Natsuno, 2008 Dec 6) Maybe call it v:motiontype. MS-Windows: editing the first, empty buffer, 'ffs' set to "unix,dos", ":enew" doesn't set 'ff' to "unix". (Ben Fritz, 2008 Dec 5) Reusing the old buffer probably causes this. 'scrollbind' is not respected when deleting lines or undo. (Milan Vancura, 2009 Jan 16) Patch to support strikethrough next to bold and italic. (Christian Brabandt, 2013 Jul 30) Update from Ken Takata, 2013 Oct 12. Document that default font in Athena can be set with resources: XtDefaultFont: "9x15" XtDefaultFontSet: "9x15" (Richard Sherman, 2009 Apr 12) Having "Syntax" in 'eventignore' for :bufdo may cause problems, e.g. for ":bufdo e" when buffers are open in windows. ex_listdo(eap) could set the option only for when jumping to another buffer, not when the command argument is executed. ":pedit %" with a BufReadPre autocommand causes the cursor to move to the first line. (Ingo Karkat, 2008 Jul 1) Ian Kelling is working on this. Similar problem with ":e". (Marc Montu, 2014 Apr 22) Wildmenu not deleted: "gvim -u NONE", ":set nocp wildmenu cmdheight=3 laststatus=2", CTRL-D CTRL-H CTRL-H CTRL-H. (A.Politz, 2008 April 1) Works OK with Vim in an xterm. Cursor line moves in other window when using CTRL-W J that doesn't change anything. (Dasn, 2009 Apr 7) On Unix "glob('does not exist~')" returns the string. Without the "~" it doesn't. (John Little, 2008 Nov 9) Shell expansion returns unexpanded string? Don't use shell when "~" is not at the start? ":unlet $VAR" doesn't work. 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. Unfinished patch by Ian Kelling, 2008 Jul 11. Followup Jul 14, need to have another look at it. c.vim: XXX in a comment is colored yellow, but not when it's after "#if 0". (Ilya Dogolazky, 2009 Aug 7) You can type ":w ++bad=x fname", but the ++bad argument is ignored. Give an error message? Or is this easy to implement? (Nathan Stratton Treadway, 2008 Aug 20) This is in ucs2bytes(), search for 0xBF. Using the ++bad argument is at the other match for 0xBF. When adding "-complete=file" to a user command this also changes how the argument is processed for <f-args>. (Ivan Tishchenko, 2008 Aug 19) Win32: associating a type with Vim doesn't take care of space after a backslash? (Robert Vibrant, 2008 Jun 5) When 'rightleft' is set, cursorcolumn isn't highlighted after the end of a line. It's also wrong in folds. (Dominique Pelle, 2010 Aug 21) Using an insert mode expression mapping, cursor is not in the expected position. (ZyX, 2010 Aug 29) After using <Tab> for command line completion after ":ta blah" and getting E33 (no tags file), further editing the command to e.g., ":echo 'blah'", the command is not executed. Fix by Ian Kelling? ":help s/~" jumps to *s/\~*, while ":help s/\~" doesn't find anything. (Tim Chase) Fix by Ian Kelling, 2008 Jul 14. Use "\U12345678" for 32 bit Unicode characters? (Tony Mechelynck, 2009 Apr 6) Or use "\u(123456)", similar to Perl. When mapping : to ; and ; to :, @; doesn't work like @: and @: doesn't work either. Matt Wozniski: nv_at() calls do_execreg() which uses put_in_typebuf(). Char mapped twice? Despite adding save_subexpr() this still doesn't work properly: Regexp: matchlist('12a4aaa', '^\(.\{-}\)\(\%5c\@<=a\+\)\(.\+\)\?') Returns ['12a4', 'aaa', '4aaa'], should be ['12a4', 'aaa', ''] Backreference not cleared when retrying after \@<= fails? (Brett Stahlman, 2008 March 8) Problem with remote_send(). (Charles Campbell, 2008 Aug 12) ftplugin for help file should set 'isk' to help file value. Win32: remote editing fails when the current directory name contains "[". (Ivan Tishchenko, Liu Yubao) Suggested patch by Chris Lubinski: Avoid escaping characters where the backslash is not removed later. Asked Chris for an alternate solution, also for src/ex_getln.c. This also fails when the file or directory name contains "%". (Thoml, 2008 July 7) Using --remote-silent while the current directory has a # in the name does not work, the # needs to be escaped. (Tramblay Bruno, 2012 Sep 15) When using remote-silent the -R flag is not passed on. (Axel Bender, 2012 May 31) Win32: A --remote command that has a directory name starting with a ( doesn't work, the backslash is removed, assuming that it escapes the (. (Valery Kondakoff, 2009 May 13) Win32: Using "gvim --remote-tab-silent elŝuti.txt" doesn't work, the multi-byte character isn't passed and edits elsuti.txt. (Raúl Núñez de Arenas Coronado, 2015 Dec 18) Problem with 'langmap' being used on the rhs of a mapping. (Nikolai Weibull, 2008 May 14) Possibly related problem: Alexey Muranov, 2015 Apr 2 Problem with CTRL-F. (Charles Campbell, 2008 March 21) Only happens with "gvim -geometry "160x26+4+27" -u NONE -U NONE prop.c". 'lines' is 54. (2008 March 27) Problem with pointer wrapping around in getvcol(). (Wolfgang Kroworsch, 2008 Oct 19) Check for "col" being "MAXCOL" separately? Unexpectedly inserting a double quote. (Anton Woellert, 2008 Mar 23) Works OK when 'cmdheight' is 2. 8 Use a mechanism similar to omni completion to figure out the kind of tab for CTRL-] and jump to the appropriate matching tag (if there are several). Alternative: be able to define a function that takes the tag name and uses taglist() to find the right location. With indication of using CTRL-] so that the context can be taken into account. (Robert Webb) Patch by Christian Brabandt, 2013 May 31. Test54 should not use shell commands. Make it portable. The utf class table is missing some entries: 0x2212, minus sign 0x2217, star 0x2500, bar 0x26ab, circle Visual line mode doesn't highlight properly when 'showbreak' is used and the line doesn't fit. (Dasn, 2008 May 1) GUI: In Normal mode can't yank the modeless selection. Make "gy" do this? Works like CTRL-Y in Command line mode. Mac: Move Carbon todo items to os_mac.txt. Note that this version is frozen, try the Cocoa version. Mac: After a ":vsplit" the left scrollbar doesn't appear until 'columns' is changed or the window is resized. GTK: when setting 'columns' in a startup script and doing ":vertical diffsplit" the window isn't redrawn properly, see two vertical bars. Mac: Patch for configure: remove arch from ruby link args. (Knezevic, 2008 Mar 5) Alternative: Kazuki Sakamoto, Mar 7. Mac: trouble compiling with Motif, requires --disable-darwin. (Raf, 2008 Aug 1) Reply by Ben Schmidt. C't: On utf-8 system, editing file with umlaut through Gnome results in URL with %nn%nn, which is taken as two characters instead of one. Try to reproduce at work. Patch for default choice in file changed dialog. (Bjorn Winckler, 2008 Oct 19) Is there a way to list all the files first? When 'smartcase' is set and using CTRL-L to add to the search pattern it may result in no matches. Convert chars to lower case? (Erik Wognsen, 2009 Apr 16) Fail to edit file after failed register access. Error flag remains set? (Lech Lorens, 2010 Aug 30) Patch for redo register. (Ben Schmidt, 2007 Oct 19) Await response to question to make the register writable. Problem with 'ts' set to 9 and 'showbreak' to ">>>". (Matthew Winn, 2007 Oct 1) In the swapfile dialog, add a H(elp) option that gives more info about what each choice does. Similar to ":help swap-exists-choices" try/catch not working for argument of return. (Matt Wozniski, 2008 Sep 15) try/catch not working when inside a for loop. (ZyX, 2011 Jan 25) ":tab help" always opens a new tab, while ":help" re-uses an existing window. Would be more consistent when an existing tab is re-used. (Tony Mechelynck) Add ":nofold". Range will apply without expanding to closed fold. Using Aap to build Vim: add remarks about how to set personal preferences. Example on http://www.calmar.ws/tmp/aap.html Syntax highlighting wrong for transparent region. (Doug Kearns, 2007 Feb 26) Bug in using a transparent syntax region. (Hanlen in vim-dev maillist, 2007 Jul 31) C syntax: {} inside () causes following {} to be highlighted as error. (Michalis Giannakidis, 2006 Jun 1) When 'diffopt' has "context:0" a single deleted line causes two folds to merge and mess up syncing. (Austin Jennings, 2008 Jan 31) Gnome improvements: Edward Catmur, 2007 Jan 7 Also use Save/Discard for other GUIs New PHP syntax file, use it? (Peter Hodge) ":echoe" in catch block stops processing, while this doesn't happen outside of a catch block. (ZyX, 2011 Jun 2) 'foldcolumn' in modeline applied to wrong window when using a session. (Teemu Likonen, March 19) Test 54 uses shell commands, that doesn't work on non-Unix systems. Use some other way to test buffer-local autocommands. The documentation mentions the priority for ":2match" and ":3match", but it appears the last one wins. (John Beckett, 2008 Jul 22) Caused by adding matchadd()? Suggested patch by John, 2008 Jul 24. When 'encoding' is utf-8 the command line is redrawn as a whole on every character typed. (Tyler Spivey, 2008 Sep 3) Only redraw cmdline for 'arabicshape' when there is a character on the command line for which (ARABIC_CHAR(u8c)) is TRUE. Cheng Fang made javacomplete. (2007 Aug 11) Asked about latest version: 0.77.1 is on www.vim.org. More AmigaOS4 patches. (Peter Bengtsson, Nov 9) Amiga patches with vbcc. (Adrien Destugues, 2010 Aug 30) http://pulkomandy.ath.cx/drop/vim73_vbcc_amiga.diff Insert mode completion: When editing the text and pressing CTRL-N again goes back to originally completed text, edited text is gone. (Peng Yu, 2008 Jul 24) Suggestion by Ben Schmidt, 2008 Aug 6. Problem with compound words? (Bert, 2008 May 6) No warning for when flags are defined after they are used in an affix. Screen redrawing when continuously updating the buffer and resizing the terminal. (Yakov Lerner, 2006 Sept 7) Add option settings to help ftplugin. (David Eggum, 2006 Dec 18) Autoconf problem: when checking for iconv library we may add -L/usr/local/lib, but when compiling further tests -liconv is added without the -L argument, that may fail (e.g., sizeof(int)). (Blaine, 2007 Aug 21) When opening quickfix window, disable spell checking? Problem with ".add" files when using two languages and restarting Vim. (Raul Coronado, 2008 Oct 30) Popup menu redraw: Instead of first redrawing the text and then drawing the popup menu over it, first draw the new popup menu, remember its position and size and then redraw the text, skipping the characters under the popup menu. This should avoid flicker. Other solution by A.Politz, 2007 Aug 22. Windows 98: pasting from the clipboard with text from another application has a trailing NUL. (Joachim Hofmann) Perhaps the length specified for CF_TEXT isn't right? When a register contains illegal bytes, writing viminfo in utf-8 and reading it back doesn't result in utf-8. (Devin Bayer) Command line completion: Scanning for tags doesn't check for typed key now and then? Hangs for about 5 seconds. Appears to be caused by finding include files with "foo/**" in 'path'. (Kalisiak, 2006 July 15) Additional info: When using the |wildcards| ** globing, vim hangs indefinitely on lots of directories. The |file-searching| globing, like in ":set path=/**" does not hang as often as with globing with |wildcards|, like in ":1find /**/file". This is for files that unix "find" can find very quickly. Merging the 2 kinds of globing might make this an easier fix. (Ian Kelling, 2008 July 4) When the file name has parenthesis, e.g., "foo (bar).txt", ":!ls '%'" has the parenthesis escaped but not the space. That's inconsistent. Either escape neither or both. No escaping might be best, because it doesn't depend on particularities of the shell. (Zvi Har'El, 2007 Nov 10) (Teemu Likonen, 2008 Jun 3) However, for backwards compatibility escaping might be necessary. Check if the user put quotes around the expanded item? A throw in a function causes missing an endif below the call. (Spiros Bousbouras, 2011 May 16) Error E324 can be given when a cron script has wiped out our temp directory. Give a clear error message about this (and tell them not to wipe out /tmp). Color for cUserLabel should differ from case label, so that a mistake in a switch list is noticed: switch (i) { case 1: foobar: } Look at http://www.gtk-server.org/ . It has a Vim script implementation. Netbeans problem. Use "nc -l 127.0.0.1 55555" for the server, then run gvim with "gvim -nb:localhost:55555:foo". From nc do: '1:editFile!0 "foo"'. Then go to Insert mode and add a few lines. Then backspacing every other time moves the cursor instead of deleting. (Chris Kaiser, 2007 Sep 25) Windows installer should install 32-bit version of right-click handler also on 64-bit systems. (Brian Cunningham, 2011 Dec 28) Windows installer could add a "open in new tab of existing Vim" menu entry. Gvimext: patch to add "Edit with single Vim &tabbed" menu entry. Just have two choices, always using one Vim and selecting between using an argument list or opening each file in a separate tab. (Erik Falor, 2008 May 21, 2008 Jun 26) Windows installer: licence text should not use indent, causes bad word wrap. (Benjamin Fritz, 2010 Aug 16) Dos uninstal may delete vim.bat from the wrong directory (e.g., when someone makes his own wrapper). Add a magic string with the version number to the .bat file and check for it in the uninstaller. E.g. # uninstall key: vim7.3* Changes for Win32 makefile. (Mike Williams, 2007 Jan 22, Alexei Alexandrov, 2007 Feb 8) Win32: Can't complete shell command names. Why is setting xp_context in set_one_cmd_context() inside #ifndef BACKSLASH_IN_FILENAME? Win32: Patch for cscope external command. (Mike Williams, 2007 Aug 7) Win32: XPM support only works with path without spaces. Patch by Mathias Michaelis, 2006 Jun 9. Another patch for more path names, 2006 May 31. New version: http://members.tcnet.ch/michaelis/vim/patches.zip (also for other patches by Mathias, see mail Feb 22) Win32: compiling with normal features and OLE fails. Patch by Mathias Michaelis, 2006 Jun 4. Win16: include patches to make Win16 version work. (Vince Negri, 2006 May 22) Win32: after "[I" showing matches, scroll wheel messes up screen. (Tsakiridis, 2007 Feb 18) Patch by Alex Dobrynin, 2007 Jun 3. Also fixes other scroll wheel problems. Win32: using CTRL-S in Insert mode doesn't remove the "+" from the tab pages label. (Tsakiridis, 2007 Feb 18) Patch from Ian Kelling, 2008 Aug 6. Win32: using "gvim --remote-tab-silent fname" sometimes gives an empty screen with the more prompt. Caused by setting the guitablabel? (Thomas Michael Engelke, 2007 Dec 20 - 2008 Jan 17) Win32: patch for fullscreen mode. (Liushaolin, 2008 April 17) Win32: When 'shell' is bash shellescape() doesn't always do the right thing. Depends on 'shellslash', 'shellquote' and 'shellxquote', but shellescape() only takes 'shellslash' into account. Menu item that does "xxd -r" doesn't work when 'fileencoding' is utf-16. Check for this and use iconv? (Edward L. Fox, 2007 Sep 12) Does the conversion in the other direction work when 'fileencodings' is set properly? Cursor displayed in the wrong position when using 'numberwidth'. (James Vega, 2007 Jun 21) When $VAR contains a backslash expand('$VAR') removes it. (Teemu Likonen, 2008 Jun 18) If the variable "g:x#y#z" exists completion after ":echo g:x#" doesn't work. Feature request: Command to go to previous tab, like what CTRL-W p does for windows. (Adam George) F1 - F4 in an xterm produce a different escape sequence when used with a modifier key. Need to catch three different sequences. Use K_ZF1, like K_ZHOME? (Dickey, 2007 Dec 2) UTF-8: mapping a multi-byte key where the second byte is 0x80 doesn't appear to work. (Tony Mechelynck, 2007 March 2) In debug mode, using CTRL-R = to evaluate a function causes stepping through the function. (Hari Krishna Dara, 2006 Jun 28) C++ indenting wrong with "=". (James Kanze, 2007 Jan 26) ":lockvar" should use copyID to avoid endless loop. When using --remote-silent and the file name matches 'wildignore' get an E479 error. without --remote-silent it works fine. (Ben Fritz, 2008 Jun 20) Gvim: dialog for closing Vim should check if Vim is busy writing a file. Then use a different dialog: "busy saving, really quit? yes / no". Check other interfaces for changing curbuf in a wrong way. Patch like for if_ruby.c. ":helpgrep" should use the directory from 'helpfile'. The need_fileinfo flag is messy. Instead make the message right away and put it in keep_msg? Editing a file remotely that matches 'wildignore' results in a "no match" error. Should only happen when there are wildcards, not when giving the file name literally, and esp. if there is only one name. Test 61 fails sometimes. This is a timing problem: "sleep 2" sometimes takes longer than 2 seconds. Using ":au CursorMoved * cmd" invokes mch_FullName(), which can be slow. Can this be avoided? (Thomas Waba, 2008 Aug 24) Also for ":w" without a file name. The buffer has the full path in ffname, should pass this to the autocommand. "vim -C" often has 'nocompatible', because it's set in some startup script. Set 'compatible' after startup is done? Patch by James Vega, 2008 Feb 7. VMS: while editing a file found in complex, Vim will save file into the first directory of the path and not to the original location of the file. (Zoltan Arpadffy) VMS: VFC files are in some cases truncated during reading (Zoltan Arpadffy) input() completion should not insert a backslash to escape a space in a file name? Ruby completion is insecure. Can this be fixed? When 'backupskip' is set from $TEMP special characters need to be escaped. (patch by Grembowietz, 2007 Feb 26, not quite right) Another problem is that file_pat_to_reg_pat() doesn't recognize "\\", so "\\(" will be seen as a path separator plus "\(". gvim d:\path\path\(FILE).xml should not remove the \ before the (. This also fails with --remote. When doing ":quit" the Netbeans "killed" event isn't sent. (Xavier de Gaye, 2008 Nov 10) call netbeans_file_closed() at the end of buf_freeall(), or in all places where buf_freeall() is called? aucmd_prepbuf() should also use a window in another tab page. When unloading a buffer in a BufHidden autocommand the hidden flag is reset? (Bob Hiestand, 2008 Aug 26, Aug 27) Substituting an area with a line break with almost the same area does change the Visual area. Can this be fixed? (James Vega, 2006 Sept 15) GUI: When combining fg en bg make sure they are not equal. Spell checking: Add a way to specify punctuation characters. Add the superscript numbers by default: 0x2070, 0xb9, 0xb2, 0xb3, 0x2074 - 0x2079. Spell checking in popup menu: If the only problem is the case of the first character, don't offer "ignore" and "add to word list". Use different pt_br dictionary for spell checking. (Jackson A. Aquino, 2006 Jun 5) Use different romanian dictionary for spell checking. (Andrei Popescu, Nov 2008) Use http://downloads.sourceforge.net/rospell/ro_RO.3.2.zip Or the hunspell-ro.3.2.tar.gz file, it also has a iso-8859-2 list. In a C file with spell checking, in "% integer" "nteger" is seen as an error, but "]s" doesn't find it. "nteger" by itself is found. (Ralf Wildenhues, 2008 Jul 22) There should be something about spell checking in the user manual. Spell menu: When using the Popup menu to select a replacement word, ":spellrepeat" doesn't work. SpellReplace() uses setline(). Can it use "z=" somehow? Or use a new function. Mac: Using gvim: netrw window disappears. (Nick Lo, 2006 Jun 21) Add an option to specify the character to use when a double-width character is moved to the next line. Default '>', set to a space to blank it out. Check that char is single width when it's set (compare with 'listchars'). The generated vim.bat can avoid the loop for NT. (Carl Zmola, 2006 Sep 3) When showing a diff between a non-existent file and an existing one, with the cursor in the empty buffer, the other buffer only shows the last line. Change the "insert" into a change from one line to many? (Yakov Lerner, 2008 May 27) Add autocommand for when a tabpage is being closed. Also for when a tab page has been created. Using ":make" blocks Vim. Allow running one make in the background (if the shell supports it), catch errors in a file and update the error list on the fly. A bit like "!make > file&" and repeating ":cf file". ":bgmake", background make. ":bgcancel" interrupts it. A.Politz may work on this. These two abbreviations don't give the same result: let asdfasdf = "xyz\<Left>" cabbr XXX <C-R>=asdfasdf<CR> cabbr YYY xyz<Left> Michael Dietrich: maximized gvim sometimes displays output of external command partly. (2006 Dec 7) In FileChangedShell command it's no longer allowed to switch to another buffer. But the changed buffer may differ from the current buffer, how to reload it then? New syntax files for fstab and resolv from Radu Dineiu, David Necas did previous version. For Aap: include a config.arg.example file with hints how to use config.arg. Command line completion when 'cmdheight' is maximum and 'wildmenu' is set, only one buffer line displayed, causes display errors. Completing with 'wildmenu' and using <Up> and <Down> to move through directory tree stops unexpectedly when using ":cd " and entering a directory that doesn't contain other directories. Default for 'background' is wrong when using xterm with 256 colors. Table with estimates from Matteo Cavalleri, 2014 Jan 10. Setting 'background' resets the Normal background color: highlight Normal ctermbg=DarkGray set background=dark This is undesired, 'background' is supposed to tell Vim what the background color is, not reset it. Linux distributions: - Suggest compiling xterm with --enable-tcap-query, so that nr of colors is known to Vim. 88 colors instead of 16 works better. See ":help xfree-xterm". - Suggest including bare "vi" and "vim" with X11, syntax, etc. Completion menu: For a wrapping line, completing a long file name, only the start of the path is shown in the menu. Should move the menu to the right to show more text of the completions. Shorten the items that don't fit in the middle? When running inside screen it's possible to kill the X server and restart it (using pty's the program can keep on running). Vim dies because it loses the connection to the X server. Can Vim simply quit using the X server instead of dying? Also relevant when running in a console. Accessing file#var in a function should not need the g: prepended. When exiting detects a modified buffer, instead of opening the buffer in the current tab, use an existing tab, if possible. Like finding a window where the buffer is displayed. (Antonios Tsakiridis) When ":cn" moves to an error in the same line the message isn't shortened. Only skip shortening for ":cc"? Write "making vim work better" for the docs (mostly pointers): *nice* - sourcing $VIMRUNTIME/vimrc_example.vim - setting 'mouse' to "a" - getting colors in xterm - compiling Vim with X11, GUI, etc. Problem with ":call" and dictionary function. Hari Krishna Dara, Charles Campbell 2006 Jul 06. Syntax HL error caused by "containedin". (Peter Hodge, 2006 Oct 6) A custom completion function in a ":command" cannot be a Funcref. (Andy Wokula, 2007 Aug 25) Problem with using :redir in user command completion function? (Hari Krishna Dara, 2006 June 21) Another resizing problem when setting 'columns' and 'lines' to a very large number. (Tony Mechelynck, 2007 Feb 6) After starting Vim, using '0 to jump somewhere in a file, ":sp" doesn't center the cursor line. It works OK after some other commands. Win32: Is it possible to have both postscript and Win32 printing? Check: Running Vim in a console and still having connect to the X server for copy/paste: is stopping the X server handled gracefully? Should catch the X error and stop using the connection to the server. Problem with 'cdpath' on MS-Windows when a directory is equal to $HOME. (2006 Jul 26, Gary Johnson) Using UTF-8 character with ":command" does not work properly. (Matt Wozniski, 2008 Sep 29) In the Netbeans interface add a "vimeval" function, so that the other side can check the result of has("patch13"). Cursor line at bottom of window instead of halfway after saving view and restoring. Only with 'nowrap'. (Robert Webb, 2008 Aug 25) Netrw has trouble executing autocommands only for a directory. Add <isdir> and <notisdir> to autocommand patterns? Also <isfile>? Add command modifier that skips wildcard expansion, so that you don't need to put backslashes before special chars, only for white space. Syntax HL: open two windows on the same C code, delete a ")" in one window, resulting in highlighted "{" in that window, not in the other. In mswin.vim: Instead of mapping <C-V> for Insert mode in a complicated way, can it be done like ":imap <C-V> <MiddleMouse>" without negative side effects? GTK: when the Tab pages bar appears or disappears while the window is maximized the window is no longer maximized. Patch that has some idea but doesn't work from Geoffrey Antos, 2008 May 5. Also: the window may no longer fit on the screen, thus the command line is not visible. When right after "vim file", "M" then CTRL-W v the windows are scrolled differently and unexpectedly. Caused by patch 7.2.398? The magic clipboard format "VimClipboard2" appears in several places. Should be only one. "vim -C" often has 'nocompatible', because it's set somewhere in a startup script. Do "set compatible" after startup? It's difficult to debug numbered functions (function in a Dictionary). Print the function name before resolving it to a number? let d = {} fun! d.foo() echo "here" endfun call d.foo(9) Add a mark for the other end of the Visual area (VIsual pos). '< and '> are only set after Visual moded is ended. Also add a variable for the Visual mode. So that this mode and '< '> can be used to set what "gv" selects. (Ben Schmidt) Win32: When running ":make" and 'encoding' differs from the system locale, the output should be converted. Esp. when 'encoding' is "utf-8". (Yongwei Wu) Should we use 'termencoding' for this? Win32, NTFS: When editing a specific infostream directly and 'backupcopy' is "auto" should detect this situation and work like 'backupcopy' is "yes". File name is something like "c:\path\foo.txt:bar", includes a colon. (Alex Jakushev, 2008 Feb 1) printf() uses the field width in bytes. Can it be made character width, perhaps with a modifier? What does Posix say? Small problem displaying diff filler line when opening windows with a script. (David Luyer, 2007 Mar 1 ~/Mail/oldmail/mool/in.15872 ) Is it allowed that 'backupext' is empty? Problems when backup is in same dir as original file? If it's OK don't compare with 'patchmode'. (Thierry Closen) Patch for supporting count before CR in quickfix window. (AOYAMA Shotaro, 2007 Jan 1) Patch for adding ":lscscope". (Navdeep Parhar, 2007 Apr 26; update 2008 Apr 23) ":mkview" isn't called with the right buffer argument. Happens when using tabs and the autocommand "autocmd BufWinLeave * mkview". (James Vega, 2007 Jun 18) xterm should be able to pass focus changes to Vim, so that Vim can check for buffers that changed. Perhaps in misc.c, function selectwindow(). Xterm 224 supports it! When completing from another file that uses a different encoding completion text has the wrong encoding. E.g., when 'encoding' is utf-8 and file is latin1. Example from Gombault Damien, 2007 Mar 24. Is it possible to use "foo#var" instead of "g:foo#var" inside a function? Syntax HL: When using "nextgroup" and the group has an empty match, there is no search at that position for another match. (Lukas Mai, 2008 April 11) In gvim the backspace key produces a backspace character, but on Linux the VERASE key is Delete. Set VERASE to Backspace? (patch by Stephane Chazelas, 2007 Oct 16) TermResponse autocommand isn't always triggered when using vimdiff. (Aron Griffis, 2007 Sep 19) Create a gvimtutor.1 file and change Makefiles to install it. When 'encoding' is utf-8 typing text at the end of the line causes previously typed characters to be redrawn. Caused by patch 7.1.329. (Tyler Spivey, 2008 Sep 3, 11) When Vim in an xterm owns the selection and the user does ":shell" Vim doesn't respond to selection requests. Invoking XtDisownSelection() before executing the shell doesn't help. Would require forking and doing a message loop, like what happens for the GUI. X11: Putting more than about 262040 characters of text on the clipboard and pasting it in another Vim doesn't work. (Dominique Pelle, 2008 Aug 21-23) clip_x11_request_selection_cb() is called with zero value and length. Also: Get an error message from free() in the process that owns the selection. Seems to happen when the selection is requested the second time, but before clip_x11_convert_selection_cb() is invoked, thus in X library code. ":vimgrep" does not recognize a recursive symlink. Is it possible to detect this, at least for Unix (using device/inode)? When switching between windows the cursor is often put in the middle. Remember the relative position and restore that, just like lnum and col are restored. (Luc St-Louis) Patch to support horizontal scroll wheel in GTK. Untested. (Bjorn Winckler, 2010 Jun 30) Add an option for a minimal text length before inserting a line break for 'textwidth'. Avoids very short lines when a very long word follows. (Kartik Agaram) Better plugin support (not plugin manager, see elsewhere for that): - Avoid use of feedkeys, add eval functions where needed: - manipulating the Visual selection? - Add createmark(): add a mark like mM, but return a unique ID. Need some way to clean them up again... Use a name + the script ID. Add createmark( , 'c') to track inserts/deletes before the column. - Plugins need to make a lot of effort, lots of mappings, to know what happened before pressing the key that triggers a plugin action. How about keeping the last N pressed keys, so that they do not need to be mapped? - equivalent of netbeans_beval_cb(). With an autocommand? - Add something to enable debugging when a remote message is received. More patches: - Another patch for Javascript indenting. (Hari Kumar, 2010 Jul 11) Needs a few tests. - Add 'cscopeignorecase' option. (Liang Wenzhi, 2006 Sept 3) - Argument for feedkeys() to prepend to typeahead (Yakov Lerner, 2006 Oct 21) - Load intl.dll too, not only libintl.dll. (Mike Williams, 2006 May 9, docs patch May 10) - Extra argument to strtrans() to translate special keys to their name (Eric Arnold, 2006 May 22) - 'threglookexp' option: only match with first word in thesaurus file. (Jakson A. Aquino, 2006 Jun 14) - Mac: indicate whether a buffer was modified. (Nicolas Weber, 2006 Jun 30) - Allow negative 'nrwidth' for left aligning. (Nathan Laredo, 2006 Aug 16) - ml_append_string(): efficiently append to an existing line. (Brad Beveridge, 2006 Aug 26) Use in some situations, e.g., when pasting a character at a time? - recognize hex numbers better. (Mark Manning, 2006 Sep 13) - Add <AbbrExpand> key, to expand an abbreviation in a mapping. (Kana Natsuno, 2008 Jul 17) - Add 'wspara' option, also accept blank lines like empty lines for "{" and "}". (Mark Lundquist, 2008 Jul 18) - Patch to add CTRL-T to delete part of a path on cmdline. (Adek, 2008 Jul 21) - Instead of creating a copy of the tutor in all the shell scripts, do it in vimtutor.vim. (Jan Minar, 2008 Jul 20) - When fsync() fails there is no hint about what went wrong. Patch by Ben Schmidt, 2008 Jul 22. - testdir/Make_dos_sh.mak for running tests with MingW. (Bill Mccarthy, 2008 Sep 13) - Patch for adding "space" item in 'listchars'. (Jérémie Roquet, 2009 Oct 29, Docs patch Oct 30, update David Burgin (glts) 2013 Aug 24, 2014 Oct 10) - Replace ccomplete.vim by cppcomplete.vim from www.vim.org? script 1520 by Vissale Neang. (Martin Stubenschrott) Asked Vissale to make the scripts more friendly for the Vim distribution. New version received 2008 Jan 6. No maintenance in two years... - Patch to open dropped files in new tabs. (Michael Trim, 2010 Aug 3) Awaiting updated patches: 9 Mac unicode patch (Da Woon Jung, Eckehard Berns): 8 Add patch from Muraoka Taro (Mar 16) to support input method on Mac? New patch 2004 Jun 16 - selecting proportional font breaks display - UTF-8 text causes display problems. Font replacement causes this. - Command-key mappings do not work. (Alan Schmitt) - With 'nopaste' pasting is wrong, with 'paste' Command-V doesn't work. (Alan Schmitt) - remove 'macatsui' option when this has been fixed. - when 'macatsui' is off should we always convert to "macroman" and ignore 'termencoding'? 9 HTML indenting can be slow. Caused by using searchpair(). Can search() be used instead? A.Politz is looking into a solution. 8 Win32: Add minidump generation. (George Reilly, 2006 Apr 24) 8 Add ":n" to fnamemodify(): normalize path, remove "../" when possible. Aric Blumer has a patch for this. He will update the patch for 6.3. 7 Completion of network shares, patch by Yasuhiro Matsumoto. Update 2004 Sep 6. How does this work? Missing comments. 8 Add a few more command names to the menus. Patch from Jiri Brezina (28 feb 2002). Will mess the translations... 7 ATTENTION dialog choices are more logical when "Delete it" appears before "Quit". Patch by Robert Webb, 2004 May 3. - Include flipcase patch: ~/vim/patches/wall.flipcase2 ? Make it work for multi-byte characters. - Win32: add options to print dialog. Patch from Vipin Aravind. - 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 "fg" and "bg" don't work in an xterm. Get default colors from xterm with an ESC sequence. xterm can send colors for many things. E.g. for the cursor: <Esc>]12;?<Bel> Can use this to get the background color and restore the colors on exit. 7 Add "DefaultFG" and "DefaultBG" for the colors of the menu. (Marcin Dalecki has a patch for Motif and Carbon) - 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. 8 Add functions: gettext() Translate a message. (Patch from Yasuhiro Matsumoto) Update 2004 Sep 10 Another patch from Edward L. Fox (2005 Nov 24) Search in 'runtimepath'? More docs needed about how to use this. How to get the messages into the .po files? 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) raisewin() raise gvim window (see HierAssist patch for Tcl implementation ~/vim/HierAssist/ ) taglist() add argument to specify maximum number of matches. useful for interactive things or completion. col('^') column of first non-white character. Can use "len(substitute(getline('.'), '\S.*', '', '')) + 1", but that's ugly. 7 Add patch from Benoit Cerrina to integrate Vim and Perl functions better. Now also works for Ruby (2001 Nov 10) - Patch from Herculano de Lima Einloft Neto for better formatting of the quickfix window (2004 dec 2) 7 When 'rightleft' is set, the search pattern should be displayed right to left as well? See patch of Dec 26. (Nadim Shaikli) 8 Option to lock all used memory so that it doesn't get swapped to disk (uncrypted). Patch by Jason Holt, 2003 May 23. Uses mlock. 7 Add ! register, for shell commands. (patch from Grenie) 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. 7 Add a "-@ filelist" argument: read file names from a file. (David Kotchan has a patch for it) 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? 7 Add ":justify" command. Patch from Vit Stradal 2002 Nov 25. - findmatch() should be adjusted for Lisp. See remark at get_lisp_indent(). Esp. \( and \) should be skipped. (Dorai Sitaram, incomplete patch Mar 18) - For GUI Find/Replace dialog support using a regexp. Patch for Motif and GTK by degreneir (nov 10 and nov 18). - Patch for "paranoid mode" by Kevin Collins, March 7. Needs much more work. Vi incompatibility: - Try new POSIX tests, made after my comments. (Geoff Clare, 2005 April 7) Version 1.5 is in ~/src/posix/1.5. (Lynne Canal) 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 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. On the other hand, an ":undo" command in an Ex script only undoes the last change (e.g., use two :append commands, then :undo). 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 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+ GUI known bugs: 9 Crash with X command server over ssh. (Ciaran McCreesh, 2006 Feb 6) 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? 8 GTK 2: Combining UTF-8 characters are sometimes not drawn properly. Depends on the font size, "monospace 13" has the problem. Vim seems to do everything right, must be a GTK bug. Is there a way to work around it? 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. - Gnome2: When moving the toolbar out of the dock, so that it becomes floating, it can no longer be moved. Therefore making it float has been blocked for now. Win32 GUI known bugs: - Win32: tearoff menu window should have a scrollbar when it's taller than the screen. 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) 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) 8 When 'encoding' is "utf-8", should use 'guifont' for both normal and wide characters to make Asian languages work. Win32 fonts contain both type of characters. 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. 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 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. 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? 7 Scrollbar width doesn't change when selecting other windows appearance. Also background color of Toolbar and rectangle below vert. scrollbar. 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: 6 New Motif toolbar button from Marcin Dalecki: - When the mouse pointer is over an Agide button the red becomes black. Something with the way colors are specified in the .xpm file. - The pixmap is two pixels smaller than it should be. The gap is filled with grey instead of the current toolbar background color. 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 The first event for any button in the menu or toolbar appears to get lost. The second click on a menu does work. 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: - gui_mch_browsedir() is missing, browsedir() doesn't work nicely. 7 Use XmStringCreateLocalized() instead of XmStringCreateSimple()? David Harrison says it's OK (it exists in Motif 1.2). 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. 8 When translating menus ignore the part after the Tab, the shortcut. So that the same menu item with a different shortcut (e.g., for the Mac) are still translated. 8 Add menu separators for Amiga. 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. 7 More features in the find/replace dialog: - regexp on/off - search in selection/buffer/all buffers/directory when all buffers/directory is used: - filter for file name when directory is used: - subdirectory on/off - top directory browser 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. Win32 console: 8 Should $USERPROFILE be preferred above $HOMEDRIVE/$HOMEPATH? No, but it's a good fallback, thus use: $HOME $HOMEDRIVE$HOMEPATH SHGetSpecialFolderPath(NULL, lpzsPath, CSIDL_APPDATA, FALSE); $USERPROFILE SHGetSpecialFolderPath(NULL, lpzsPath, CSIDL_COMMON_APPDATA, FALSE); $ALLUSERSPROFILE $SYSTEMDRIVE\ C:\ 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 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 its 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? 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: - GUI: gui_mch_browsedir() is missing. 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 inputdialog() doesn't resize when giving more text lines. (David Fishburn, 2006 Sept 28) 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 In mac_expandpath() check that handling of backslashes is done properly. "Small" problems: - Can't disable terminal flow control, to enable the use of CTRL-S and CTRL-Q. Add an option for it? - When using e_secure in do_one_cmd() mention the command being executed, otherwise it's not clear where it comes from. - When the quickfix window is open and executing ":echo 'hello'" using the Command-line window, the text is immediately removed by the redrawing. (Michael Henry, 2008 Nov 1) Generic solution: When redrawing while there is a message on the cmdline, don't erase the display but draw over the existing text. Other solution, redraw after closing the cmdline window, before executing the command. 9 For Turkish vim_tolower() and vim_toupper() also need to use utf_ functions for characters below 0x80. (Sertacyildiz) 9 When the last edited file is a help file, using '0 in a new Vim doesn't edit the file as a help file. 'filetype' is OK, but 'iskeyword' isn't, file isn't readonly, etc. 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. Servatius Brandt works on this. 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 The messages for "vim --help" and "vim --version" don't use 'termencoding'. - Could the hit-enter prompt be avoided when a message only overlaps the 'showcmd' area? Clear that area when the next cmd is typed. 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. Is it better than what we have in src/tee? 8 When doing Insert mode completion a mapping cannot recursively call edit(), because the completion information is global. Put everything in an allocated structure? 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 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). 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 The Cygwin and MingW makefiles define "PC", but it's not used anywhere. Remove? (Dan Sharp) 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. 8 A very long message in confirm() can't be quit. Make this possible with CTRL-C. 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 Using ":s" in a function changes the previous replacement string. Save "old_sub" in save_search_patterns()? 8 Should allow multi-byte characters for the delimiter: ":s+a+b+" where "+" is a multi-byte character. 8 When appending to a file and 'patchmode' isn't empty, a backup file is always written, even when the original file already exists. 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. 7 The message in bt_dontwrite_msg() could be clearer. 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 Also store the line number with the script ID and use it for ":verbose", so that "set nocompatible" is found when it changes other option values. When an option is set indirectly mention the command? E.g. when ":diffsplit" sets 'foldmethod'. 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. Unfinished patch by Ian Kelling, 2008 July 14. 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 '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 ":hardcopy": - 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? - Add a flag in 'printoptions' to add an empty page to make the total number even. "addempty"? (Mike Williams) - Respect 'linebreak'. Perhaps also 'showbreak'? - Should interpret 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 '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) 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. Overwriting a file for which a swap file exists is similar issue. 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>\". 6 When the xterm reports the number of colors, a redraw occurs. This is annoying on a slow connection. Wait for the xterm to report the number of colors before drawing the screen. With a timeout. 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 For xterm also recognize keypad up/down/left/right and insert. 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. Patch to dynamically allocate the buffer for % items. (Eric Arnold, 2006 May 14) 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. 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. 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) Problems that will (probably) not be solved: - GTK: when using the popup menu with spelling suggestions and releasing the right mouse button before the menu appears selecting an item with the right mouse button has no effect. GTK does not produce an event for this. - GTK 2: Cannot use the file selector. When using it many things become slow. This is caused by some code in GTK that writes ~/.recently-used.xbel every time an event is handled. It assumes the main loop is never quit, which is a wrong assumption. Also, it overwrites the file with different file permissions, which is a privacy issue. This needs to be fixed in GTK. A solution in Vim would be really complicated. (2008 Jul 31) This appears to be fixed in Vim 7.3. - xterm title: The following scenario may occur (esp. when running the Vim test script): Vim 1 sets the title to "file1", then restores the title to "xterm" with an ESC sequence when exiting. Vim 2 obtains the old title with an X library call, this may result in "file1", because the window manager hasn't processed the "xterm" title yet. Can apparently only be worked around with a delay. - 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. - Win32 tcl: has("tcl") hangs when the tcl84.dll is from cygwin. - 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. - Win32, MS-Windows: expanding plugin/**/*.vim also picks up dir/ctags.vim,v. This is because the short file name is something like "ctags~1.vim" and that matches the pattern. - 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. - 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) - GTK 2: gives an assertion error for every non-builtin icon in the toolbar. This is a GTK 2.4.x bug, fixed in GTK 2.4.2. (Thomas de Grenier de Latour) - 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* Most interesting new features to be added when all bugs have been fixed: - Using ":exe edit fname" has escaping problems. Use ":edit ++(fname)". Thus use "++=" to give arguments as expressions, comma separated as if calling a function. With options: ":edit ++(['!', '++enc=abc'], ['+/pat'], fname)". Alternative: Make a function for Ex commands: cmd_edit(). - 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. Should work like an IDE. Try to keep it generic. Now found here: http://clewn.sf.net. And the idevim plugin/script. 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. - ECLIPSE plugin. Problem is: the interface is very complicated. Need to implement part in Java and then connect to Vim. Some hints from Alexandru Roman, 2004 Dec 15. Should then also work with Oracle Jdeveloper, see JSR 198 standard http://www.jcp.org/en/jsr/detail?id=198. Eclim does it: http://eclim.sourceforge.net/ (Eric Van Dewoestine) Plugin that uses a terminal emulator: http://vimplugin.sf.net And another one: http://www.satokar.com/viplugin/index.php - 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. - Scroll commands by screen line. g CTRL-E and g CTRL-Y ? Requires the first line to be able to start halfway. - Running a shell command from the GUI still has limitations. Look into how the terminal emulator of the Vim shell project can help: http://vimshell.wana.at 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". Also allow specifying the file and command, so that the result of taglist() can be used. - X11: Make it possible to run Vim inside a window of another program. This can be done with XReparentWindow(). But how exactly? Documentation: 8 List of Vim runtime directories. dotvim.txt from Charles Campbell, 2007 Feb 20. 8 The GUI help should explain the Find and Find/Replace dialogs. Add a link to it from ":promptrepl" and ":promptfind". 8 List of options should mention whether environment variables are expanded or not. 8 Extend usr_27.txt a bit. (Adam Seyfarth) 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. Patch by Balazs Kezes, 2007 Dec 30. Remark from A. Politz. - 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 make a vimtutor script for Amiga and other systems. 7 Add the arguments for configure to the ":version" output? 7 When Vim detects a file is being edited elsewhere and it's a gvim session of the same user it should offer a "Raise" button, so that the other gvim window can be displayed. (Eduard) 8 Support saving and restoring session for X windows? It should work to do ":mksession" and use "-S fname" for the restart command. The gui_x11_wm_protocol_handler() already takes care of the rest. global_event_filter() for GTK. Tab pages: 9 GUI implementation for the tab pages line for other systems. 7 GUI: Control over the appearance of the text in the labels (bold, color, font, etc.) 8 Make GUI menu in tab pages line configurable. Like the popup menu. 8 balloons for the tab page labels that are shortened to show the full path. 7 :tabdup duplicate the tab with all its windows. 7 Option to put tab line at the left or right? Need an option to specify its width. It's like a separate window with ":tabs" output. 7 Add local variables for each tab page? 8 Add local options for each tab page? E.g., 'diffopt' could differ between tab pages. 7 Add local highlighting for each tab page? 7 Add local directory for tab pages? How would this interfere with window-local directories? Spell checking: - Support more regions? Caolan McNamara argues it's needed for es_XX. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=219777 - Unicode defines another quote character: 0x2019. Use it as an equivalent of a single quote, thus use it as a word character like a quote and match with words, replacing the curly quote with a single quote. - Could filter é things for HTML before doing spell checking. Similarly for TeX. - The Hungarian spell file uses four extra characters in the FOL/UPP/LOW items than other spell files with the ISO-8859-2 encoding, that causes problem when changing 'spelllang'. There is no obvious way to fix this. - Considering Hunspell 1.1.4: What does MAXNGRAMSUGS do? Is COMPLEXPREFIXES necessary when we have flags for affixes? - Support spelling words in CamelCase as if they were two separate words. Requires some option to enable it. (Timothy Knox) - There is no Finnish spell checking file. For openoffice Voikko is now used, which is based on Malaga: http://home.arcor.de/bjoern-beutel/malaga/ (Teemu Likonen) 8 ":mkspell" still takes much too long in Hungarian dictionary from hunspell. Only solution appears to be to postpone secondary suffixes. 8 Handle postponed prefix with COMPOUNDPERMITFLAG or COMPOUNDFORBIDFLAG. WFP_COMPPERMIT and WFP_COMPFORBID 8 implement use of <compoptions> in .spl file: implement CHECKCOMPOUNDREP: when a compound word seems to be OK apply REP items and check if the result is a valid word. implement CHECKCOMPOUNDDUP implement CHECKCOMPOUNDTRIPLE Add CHECKCOMPOUNDCASE: when compounding make leading capital lower case. How is it supposed to work? - Add a command the repeats ]s and z=, showing the misspelled word in its context. Thus to spell-check a whole file. - suggestion for "KG" to "kg" when it's keepcase. - For flags on affixes: Use a "AFFCOMPSET" flag; means the compound flags of the word are not used. - Support breakpoint character ? 0xb7 and ignore it? Makes it possible to use same wordlist for hyphenation. - Compound word is accepted if nr of words is <= COMPOUNDWORDMAX OR nr of syllables <= COMPOUNDSYLMAX. Specify using AND in the affix file? - NEEDCOMPOUND also used for affix? Or is this called ONLYINCOMPOUND now? Or is ONLYINCOMPOUND only for inside a compound, not at start or end? - Do we need a flag for the rule that when compounding is done the following word doesn't have a capital after a word character, even for Onecap words? - New hunspell home page: http://hunspell.sourceforge.net/ - Version 1.1.0 is out now, look into that. - Lots of code depends on LANG, that isn't right. Enable each mechanism in the affix file separately. - Example with compounding dash is bad, gets in the way of setting COMPOUNDMIN and COMPOUNDWORDMAX to a reasonable value. - PSEUDOROOT == NEEDAFFIX - COMPOUNDROOT -> COMPOUNDED? For a word that already is a compound word Or use COMPOUNDED2, COMPOUNDED3, etc. - CIRCUMFIX: when a word uses a prefix marked with the CIRCUMFIX flag, then the word must also have a suffix marked with the CIRCUMFIX flag. It's a bit primitive, since only one flag is used, which doesn't allow matching specific prefixes with suffixes. Alternative: PSFX {flag} {pchop} {padd} {pcond} {schop} {sadd}[/flags] {scond} We might not need this at all, you can use the NEEDAFFIX flag and the affix which is required. - When a suffix has more than one syllable, it may count as a word for COMPOUNDWORDMAX. - Add flags to count extra syllables in a word. SYLLABLEADD1 SYLLABLEADD2, etc.? Or make it possible to specify the syllable count of a word directly, e.g., after another slash: /abc/3 - MORPHO item in affix file: ignore TAB and morphological field after word/flags and affix. - Implement multiple flags for compound words and CMP item? Await comments from other spell checking authors. - Also see tklspell: http://tkltrans.sourceforge.net/ 8 Charles Campbell asks for method to add "contained" groups to existing syntax items (to add @Spell). Add ":syntax contains {pattern} add=@Spell" command? A bit like ":syn cluster" but change the contains list directly for matching syntax items. - References: MySpell library (in OpenOffice.org). http://spellchecker.mozdev.org/source.html http://whiteboard.openoffice.org/source/browse/whiteboard/lingucomponent/source/spellcheck/myspell/ author: Kevin Hendricks <kevin.hendricks@sympatico.ca> 8 It is currently not possible to mark "can not" as rare, because "can" and "not" are good words. Find a way to let "rare" overrule "good"? 8 Make "en-rare" spell file? Ask Charles Campbell. 8 The English dictionaries for different regions are not consistent in their use of words with a dash. 7 Insert mode completion mechanism that uses the spell word lists. 8 Add hl groups to 'spelllang'? :set spelllang=en_us,en-rare/SpellRare,en-math/SpellMath More complicated: Regions with different languages? E.g., comments in English, strings in German (po file). Diff mode: 9 When making small changes, e.g. deleting a character, update the diff. Possibly without running diff. 9 Instead invoking an external diff program, use builtin code. One can be found here: http://www.ioplex.com/~miallen/libmba/dl/src/diff.c It's quite big and badly documented though. 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 Also show difference with the file when editing started? Should show what can be undone. (Tom Popovich) 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: zI zJ zK zp zP zq zQ zV zy zY; secondary: zB zS zT zZ, z=) 8 Vertical folds: looks like vertically split windows, but the cursor moves through the vertical separator, separator moves when scrolling. 8 Add "z/" and "z?" for searching in not folded text only. 9 Add search pattern item to only match in closed or open fold and/or fold with certain level. Allows doing ":g/pat/cmd" to work on closed folds. 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 manual folding, the undo command should also restore folds. - Allow completely hiding a closed fold. E.g., by setting 'foldtext' to an empty string. Require showing a character in 'foldcolumn' to avoid the missing line goes unnoticed. How to implement this? - 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. - When currently editing the first file in the argument list the session file can contain: args version.c main.c edit version.c Can editing version.c twice be avoided? - 'foldmethod' "textobject": fold on sections and paragraph text objects. - "zuf": undo change in manual fold. "zUf" 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" argument: set fold level for a region or match. - Apply a new foldlevel to a range of lines. (Steve Litt) 8 Have some way to restrict commands to not folded text. Also commands like searches. Multi-byte characters: - When editing a file with both utf-8 and latin1 text Vim always falls back to latin1. Add a command to convert the latin1 characters to utf-8? :unmix utf-8,latin1 filename Would only work when 'encoding' is utf-8. 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). 9 'fenc' in modeline problem: add option to reload the file when 'fenc' is set to a different value in a modeline? Option can be default on. Could it be done with an autocommand? 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"? For HTML look for "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" and ":helpgrep". More generic solution: support a filter (e.g., by calling a function). 8 When a file was converted from 'fileencoding' to 'encoding', a tag search should also do this on the search pattern. (Andrzej M. Ostruszka) 8 When filtering changes the encoding 'fileencoding' may not work. E.g., when using xxd and 'fileencoding' is "utf-16". Add an option to set a different fileencoding for filter output? 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) 9 'aleph' should be set to 1488 for Unicode. (Zvi Har'El) 8 Should add test for using various commands with multi-byte characters. 8 'infercase' doesn't work with multi-byte characters. 8 toupper() function doesn't handle byte count changes. 7 Searching and composing characters: When searching, should order of composing characters be ignored? Add a special item to match with a composing character, so that composing characters can be manipulated. 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. - 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 'breakat' accept multi-byte characters. Problem: can't use a lookup table anymore (breakat_flags[]). Simplistic solution: when 'formatoptions' contains "m" also break a line at a multi-byte character >= 0x100. - 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: 7 Implement "undercurl" for 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. - Add the file timestamp to the page header (with an option). (George Reilly) - Win32: when 'printfont' is empty use 'guifont'. - Unix: Use some dialog box to do the obvious settings (paper size, printer name, portrait/landscape, etc). - PostScript: Only works for text that can be converted to an 8-bit character set. How to support Unicode fully? - 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: 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. 7 Add a "startgroup" to a region. Used like "nextgroup" inside the region, preferred item at the start of the region. (Charles Campbell) 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". 7 For "nextgroup" we have skipwhite, skipnl and skipempty. It would be really nice to be able to skip with a pattern. Or skip with a syntax group. (Nikolai Weibull, 2007 Feb 27) 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 Be able to change only the background highlighting. Useful for Diff* and Search highlighting. 7 When 'number' is set highlight the number of the current line. Must be enabled with an option, because it slows down display updating. 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 cpp.vim: In C++ it's allowed to use {} inside (). 8 Some syntax files set 'iskeyword', they should use "syn iskeyword". Also need a separate 'iskeyword' for the command line, e.g., in a help window ":e /asdf/asdf/" CTRL-W works different. 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. Option for the matchparen plugin? 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 It would be useful to make the highlight group name an expression. Then when there is a match, the expression would be evaluated to find out what highlight group to use. Could be used to check if the shell used in a password file appears in /etc/shells. (Nikolai Weibull) syn match =s:checkShell(v:match) contained 'pattern' 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. 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. 8 Some terminals can display colors like the GUI. Add some setting to use GUI colors for the terminal? With something to define the escape sequence. 7 It's possible for an item to be transparent, so that the colors of an item lower on the stack is used. Also do this with highlighting, so that the user can set transparent highlighting? E.g. a number in a C comment would get the color of a comment, a number in an assignment Normal. (Nikolai Weibull) 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 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 more command line completion for :syntax. 8 Add more command line completion for :highlight. 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 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. Vim script language: 8 Make the filename and line number available to script functions, so that they can give useful debugging info. The whole call stack would be ideal. At least use this for error messages. 7 Execute a function with standard option values. No need to save and restore option values. Especially useful for new options. Problem: how to avoid a performance penalty (esp. for string options)? 8 Add referring to key options with "&t_xx". Both for "echo &t_xx" and ":let &t_xx =". Useful for making portable mappings. - Add ":let var ?= value", conditional assignment. Patch by Dave Eggum, 2006 Dec 11. - range for ":exec", pass it on to the executed command. (Webb) 8 ":{range}source": source the lines from the current file. You can already yank lines and use :@" to execute them. Most of do_source() would not be used, need a new function. It's easy when not doing breakpoints or profiling. Requires copying the lines into a list and then creating a function to execute lines from the list. Similar to getnextac(). 7 ":include" command: just like ":source" but doesn't start a new scriptID? Will be tricky for the list of script names. 8 Have a look at VSEL. Would it be useful to include? (Bigham) 8 Have a prefix for a function to make it unique. When using packages it can be the plugin name. Perhaps also have a way to remove everything that the package added? including autocommands. 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 argument to winwidth() to subtract the space taken by 'foldcolumn', signs and/or 'number'. 6 Add ++ and -- operators? They only work on variables (lvals), how to implement this? 8 Add functions: has(":command") Check if ":command" works. compare function with "ex_ni". E.g. for ":simalt". escape() Add argument to specify what to escape with. modestack() Instead of just the current mode return the stack of Insert / CTRL-O / :normal things. realname() Get user name (first, last, full) user_fullname() patch by Nikolai Weibull, Nov 3 2002 Only add this when also implemented for non-Unix systems, otherwise a shell cmd could be used. get_user_name() gets login name. 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 Return a list of menus and/or a dictionary with properties instead. mapname({idx}, mode) return the name of the idx'th mapping. Patch by Ilya Sher, 2004 Mar 4. Return a list instead. char2hex() convert char string to hex string. crypt() encrypt string decrypt() decrypt string base64enc() base 64 encoding base64dec() base 64 decoding attributes() return file protection flags "drwxrwxrwx" filecopy(from, to) Copy a file shorten(fname) shorten a file name, like home_replace() perl(cmd) call Perl and return string inputrl() like input() but right-to-left typed() return the characters typed and consumed (to find out what happened) virtualmode() add argument to obtain whether "$" was used in Visual block mode. getacp() Win32: get codepage (Glenn Maynard) deletebufline() delete line in any buffer appendbufline() append line in any buffer 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. 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 command line arguments to Vim scripts in some way. As v:args List? Or extra parameter to argv()? 8 Add command arguments with three dashes, passed on to Vim scripts. 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 For Strings 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. 8 ":let Func().foo = value" should work, also when "foo" doesn't exist. Also: ":let Func()[foo] = value" should work. Same for a List. 7 Add synIDlist(), making the whole list of syntax items on the syntax stack available as a List. 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). Robustness: 6 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 for Vim 5.4: ~/vim/patches/kahn_file_locking . The patch is incomplete (needs support for more systems, autoconf). Andy doesn't have time to work on it. Disadvantage: Need to find ways to gracefully handle failure to obtain a lock. When to release a lock: When buffer is unloaded? Performance: 7 For string variables up to 3 bytes don't allocate memory, use v_list itself as a character array. Use VAR_SSTRING (short string). 7 Add 'lazysize' option: Above this size Vim doesn't load everything before starting to edit a file. Things like 'fileencodings' only work up to this size, modelines only work at the top. Useful for large log files where you only want to look at the first few pages. Use zero to disable it. 8 move_lines() copies every line into allocated memory, making reloading a buffer a lot slower than re-editing the file. Can the memline be locked so that we don't need to make a copy? Or avoid invoking ml_updatechunk(), that is taking a lot of time. (Ralf Wildenhues, 2008 Jul 7) With a patch, but does it work? 8 Instead of loading rgb.txt every time a color wasn't recognized load it once and keep it in memory. Move the code to a common place to avoid repeating it in various system files. 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. 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 after ":set foldmethod=syntax". (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 MS-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 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. - 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. 8 When reading from stdin allow suppressing the "reading from stdin" message. 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. 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. Scrolling: 8 Add "zy" 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 screenful. (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 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: 9 With ":set tags=./tags,../tags" and a tag appears in both tags files it is added twice. Requires figuring out the actual file name for each found match. Remove tag_fname from the match and combine it with the fname in the match (without expanding or other things that take time). When 'tagrelative' is off tag_fname isn't needed at all. 8 For 'tags' wildcard in the file name is not supported, only in the path. This is due to it using |file-searching|. Suboptimal solution would be to make the filename or the whole option use |wildcards| globing, better would be to merge the 2 kinds of globing. originally (Erik Falor, 2008 April 18), updated (Ian Kelling, 2008 July 4) 7 Can CTRL-] (jump to tag) include a following "." and "->" to restrict the number of possible matches? Check tags file for an item that has members. (Flemming Madsen) 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 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) - When doing "[^I" or "[^D" add position to tag stack. - Add command to put current position to tag stack: ":tpush". - Add functions to save and restore the tag stack? Or a command to switch to another tag stack? So that you can do something else and come back to what you were working on. 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". Win32 GUI: 8 Make debug mode work while starting up (vim -D). Open console window for the message and input? 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 run 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 Make inputdialog() work for Photon, Amiga. - <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. 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 on more systems? 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. 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. 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. Autocommands: 9 Rework the code from FEAT_OSFILETYPE for autocmd-osfiletypes to use 'filetype'. Only for when the current buffer is known. - Put autocommand event names in a hashtable for faster lookup? 8 When the SwapExists event is triggered, provide information about the swap file, e.g., whether the process is running, file was modified, etc. Must be possible to check the situation that it's probably OK to delete the swap file. (Marc Merlin) 8 When all the patterns for an event are "*" there is no need to expand buffer names to a full path. This can be slow for NFS. 7 For autocommand events that trigger multiple times per buffer (e.g., CursorHold), go through the list once and cache the result for a specific buffer. Invalidate the cache when adding/deleting autocommands or changing the buffer name. 7 Add TagJump event: do something after jumping to a tag. 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. 8 Use another option than 'updatetime' for the CursorHold event. The two things are unrelated for the user (but the implementation is more difficult). 7 Add autocommand event for when a buffer cannot be abandoned. So that the user can define the action taking (autowrite, dialog, fail) based on the kind of file. (Yakov Lerner) Or is BufLeave sufficient? 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 Autocommands should not change registers. And marks? And the jumplist? And anything else? Add a command to save and restore these things. 8 Add autocommands, user functions and user commands to ":mkvimrc". 6 Add KeymapChanged event, so that the effects of a different keymap can be handled (e.g., other font) (Ron Aaron) 7 When trying to open a directory, trigger an OpenDirectory event. 7 Add file type in front of file pattern: <d> for directory, <l> for link, <x> for executable, etc. 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'. - Add events to autocommands: Error - When an error happens NormalEnter - Entering Normal mode ReplaceEnter - Entering Replace mode CmdEnter - Entering Cmdline mode (with type of cmdline to allow different mapping) VisualEnter - Entering Visual mode *Leave - Leaving a mode (in pair with the above *Enter) VimLeaveCheck - Before Vim decides to exit, so that it can be cancelled when exiting isn't a good idea. CursorHoldC - CursorHold while command-line editing WinMoved - when windows have been moved around, e.g, ":wincmd J" SearchPost - After doing a search command (e.g. to do "M") PreDirChanged/PostDirChanged - Before/after ":cd" has been used (for changing the window title) ShutDown - when the system is about to shut down 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) ViewChanged - triggered when the text scrolls and when the window size changes. WinResized - After a window has been resized WinClose - Just before closing a window - Write the file now and then ('autosave'): *'autosave'* *'as'* *'noautosave'* *'noas'* 'autosave' 'as' 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. Omni completion: - Add a flag to 'complete' to be able to do omni completion with CTRL-N (and mix it with other kinds of completion). - Ideas from the Vim 7 BOF at SANE: - For interpreted languages, use the interpreter to obtain information. Should work for Java (Eclipse does this), Python, Tcl, etc. Richard Emberson mentioned working on an interface to Java. - Check Readline for its completion interface. - Ideas from others: http://www.wholetomato.com/ http://www.vim.org/scripts/script.php?script_id=747 http://sourceforge.net/projects/insenvim or http://insenvim.sourceforge.net Java, XML, HTML, C++, JSP, SQL, C# MS-Windows only, lots of dependencies (e.g. Perl, Internet explorer), uses .dll shared libraries. For C++ uses $INCLUDE environment var. Uses Perl for C++. Uses ctags to find the info: ctags -f $allTagsFile --fields=+aiKmnsSz --language-force=C++ --C++-kinds=+cefgmnpsut-dlux -u $files www.vim.org script 1213 (Java Development Environment) (Fuchuan Wang) IComplete: http://www.vim.org/scripts/script.php?script_id=1265 and http://stud4.tuwien.ac.at/~e0125672/icomplete/ http://cedet.sourceforge.net/intellisense.shtml (for Emacs) Ivan Villanueva has something for Java. Emacs: http://www.xref-tech.com/xrefactory/more_c_completion.html Completion in .NET framework SharpDevelop: http://www.icsharpcode.net - Pre-expand abbreviations, show which abbrevs would match? Insert mode completion/expansion: - GUI implementation of the popup menu. 7 When searching in other files the name flash by, too fast to read. Only display a name every second or so, like with ":vimgrep". 7 When expanding file names with an environment variable, add the match with the unexpanded var. So $HOME/tm expands to "/home/guy/tmp" and "$HOME/tmp" 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 Add option to set different behavior for Insert mode completion: - ignore/match case - different characters than 'iskeyword' 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'. Alternative: Use a pattern so that start and end of a keyword can be defined, only allow dash in the middle, etc. 8 Add a command to undo the completion, go back to the original text. 7 Completion of an abbreviation: Can leave letters out, like what Instant text does: www.textware.com 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. - Add a flag to 'complete' to only scan local header files, not system header files. (Andri Moell) - 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) - 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 []. 8 Add an option to ignore case when doing interactive completion. So that ":e file<Tab>" also lists "Filelist" (sorted after matching case matches). 7 Completion of ":map x ": fill in the current mapping, so that it can be edited. (Sven Guckes) - 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 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. 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. 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. 8 When using CTRL-G CTRL-O do like CTRL-\ CTRL-O, but when returning with the cursor in the same position and the text didn't change continue the same change, so that "." repeats the whole insert. 7 Use CTRL-G <count> to repeat what follows. Useful for inserting a character multiple times or repeating CTRL-Y. - Make 'revins' work in Replace mode. 9 Can't use multi-byte characters for 'matchpairs'. 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': 9 Wrapping a variable initialization should have extra indent: char * veryLongName = "very long string" Also check if "cino=+10" is used correctly. 8 Lisp indenting: "\\" confuses the indenter. (Dorai Sitaram, 2006 May 17) 8 Why are continuation lines outside of a {} block not indented? E.g.: long_type foo = value; 8 Java: Inside an anonymous class, after an "else" or "try" the indent is too small. (Vincent Bergbauer) Problem of using {} inside (), 'cindent' doesn't work then. 8 In C++ it's possible to have {} inside (): (Kirshna) func( new String[] { "asdf", "asdf" } ); 8 In C++ a function isn't recognized inside a namespace: (Chow Loong Jin) namespace { int func(int arg) { } } 6 Add 'cino' flag for this function argument layout: (Spencer Collyer) func( arg1 , arg2 , arg3 ); 7 Add separate "(0" option into inside/outside a function (Zellner): func( int x) // indent like "(4" { if (a && b) // indent like "(0" 9 Using "{" in a comment: (Helmut Stiegler) if (a) { if (b) { // { } } <-- this is indented incorrect Problem is that find_start_brace() checks for the matching brace to be in a comment, but not braces in between. Requires adding a comment check to findmatchlimit(). - 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? - 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. Patch by Lech Lorens, 2010 Mar. Update by James McCoy, 2014 Mar 15. 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 "//". Other way around: when a C command starts with "* 4" the "*" is repeated while it should not. Use syntax HL comment recognition? 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 Allow specifying it separately for Tabs and beyond end-of-line? Text objects: 8 Add text object for fold, so that it can be yanked when it's open. 8 Add test script for text object commands "aw", "iW", etc. 8 Add text object for part of a CamelHumpedWord and under_scored_word. (Scott Graham) "ac" and "au"? 8 Add a text object for any kind of quoting, also with multi-byte characters. Option to specify what quotes are recognized (default: all) use "aq" and "iq". Use 'quotepairs' to define pairs of quotes, like 'matchpairs'? 8 Add text object for any kind of parens, also multi-byte ones. 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 a way to make an ":omap" for a user-defined text object. Requires changing the starting position in oap->start. 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 "}"). 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://vim.wikia.com/wiki/Use_Alt-Mouse_to_select_blockwise. 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: 8 Support using "." in Visual mode. Use the operator applied to the Visual selection, if possible. - 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. - Displaying size of Visual area: use 24-33 column display. When selecting multiple lines, up to about a screenful, also count the characters. 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, pad 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 CTRL-I and CTRL-O should work in Visual mode, but only jump to marks in the current buffer. 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 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 to repeat last movement. Including count. - 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 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 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". 7 Add a mapping that works always, for remapping the keyboard. 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 Give a warning when using CTRL-C in the lhs of a mapping. It will never (?) work. 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 When someone tries to unmap with a trailing space, and it fails, try unmapping without the trailing space. Helps for ":unmap xx | unmap yy". 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 - 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 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? - 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 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? - 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: 9 Should have an option for :vimgrep to find lines without a match. 8 Add "g/" and "gb" to search for a pattern in the Visually selected text? "g?" is already used for rot13. The vis.vim script has a ":S" command that does something like this. Can use "g/" in Normal mode, uses the '< to '> area. Use "&/" for searching the text in the Visual area? 9 Add "v" offset: "/pat/v": search for pattern and start Visual mode on the matching text. 8 Add a modifier to interpret a space like "\_s\+" to make it much easier to search for a phrase. 8 Add a mechanism for recursiveness: "\@(([^()]*\@g[^()]*)\)". \@g stands for "go recursive here" and \@( \) marks the recursive part. Perl does it this way: $paren = qr/ \(( [^()] | (??{ $paren }) )* \) /x; Here $paren is evaluated when it's encountered. This is like a regexp inside a regexp. In the above terms it would be: \@((\([^()]\|\@g\)*)\) 8 Show the progress every second. Could use the code that checks for CTRL-C to find out how much time has passed. Or use SIGALRM. Where to show the number? 8 When using an expression for ":s", set the match position in a v: variable. So that you can do ":%s/^/\=v:lnum/" to put a line number before each line. 7 Support for approximate-regexps to find similar words (agrep http://www.tgries.de/agrep/ tre: http://laurikari.net/tre/index.html). 8 Add an item for a big character range, so that one can search for a chinese character: \z[234-1234] or \z[XX-YY] or \z[0x23-0x234]. 7 Add an 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 a flag to "/pat/" to discard an error. Useful to continue a mapping when a search fails. Could be "/pat/E" (e is already used for end offset). 7 Add pattern item to use properties of Unicode characters. In Perl it's "\p{L}" for a letter. See Regular Expression Pocket Reference. 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 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 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 in <C-M> or <Key> form. Could be \%<C-M>. 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 When 'iskeyword' is changed the matches from 'hlsearch' may change. (Benji Fisher) redraw if some options are set while 'hlsearch' is set? 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. - Make 'hlsearch' a local/global option, so that it can be disabled in some of the windows. - 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. 8 Add a way to access the last substitute text, what is used for ":s//~/". Can't use the ~ register, it's already used for drag & drop. - Remember flags for backreferenced items, so that "*" can be used after it. Check with "\(\S\)\1\{3}". (Hemmerling) 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? - 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) 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) (Zellner) Also ":dselect". Undo: 9 ":gundo" command: global undo. Undoes changes spread over multiple files in the order they were made. Also ":gredo". Both with a count. Useful when tests fail after making changes and you forgot in which files. 9 After undo/redo, in the message show whether the buffer is modified or not. 8 Use timestamps for undo, so that a version a certain time ago can be found and info before some time/date can be flushed. 'undopersist' gives maximum time to keep undo: "3h", "1d", "2w", "1y", etc. 8 Search for pattern in undo tree, showing when it happened and the text state, so that you can jump to it. 8 Undo tree: visually show the tree somehow (Damian Conway) Show only the leaves, indicating how many changed from the branch and the timestamp? Put branch with most recent change on the left, older changes get more indent? 8 See ":e" as a change operation, find the changes and add them to the undo info. Also be able to undo the "Reload file" choice for when a file was changed outside of Vim. Would require doing a diff between the buffer text and the file and storing the differences. Alternative: before reloading a buffer, store it somewhere. Keep a list of about 10 last reloaded buffers. - Make it possible to undo all the commands from a mapping, including a trailing unfinished command, e.g. for ":map K iX^[r". - 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. - 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. - 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: 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? 8 Some file systems are case-sensitive, some are not. Besides 'wildignorecase' there might be more parts inside CASE_INSENSITIVE_FILENAME that are useful on Unix. 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 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 When there is no .viminfo file and someone does "su", runs Vim, a root-owned .viminfo file is created. Is there a good way to avoid this? Perhaps check the owner of the directory. Only when root? 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 the redo buffer, so that "." works after restarting. 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: ". - Add an option to whitelist options that are allowed in a modeline. This would allow careful users to use modelines, e.g., only allowing 'shiftwidth'. - Add an option to let modelines only set local options, not global ones such as 'encoding'. - 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. Sessions: 8 DOS/Windows: ":mksession" generates a "cd" command where "aa\#bb" means directory "#bb" in "aa", but it's used as "aa#bb". (Ronald Hoellwarth) 7 When there is a "help.txt" window in a session file, restoring that session will not get the "LOCAL ADDITIONS" back. 8 With ":mksession" always store the 'sessionoptions' option, even when "options" isn't in it. (St-Amant) 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. 7 With ":mksession" also store the tag stack and jump history. (Michal Malecki) 7 Persistent variables: "p:var"; stored in viminfo file and sessions files. Options: 7 ":with option=value | command": temporarily set an option value and restore it after the command has executed. 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) Also do 'sidescrolloff'. 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 Make it possible to edit a new buffer in the preview window. A script can then fill it with something. ":popen"? 7 Add a 'tool' window: behaves like a preview window but there can be several. Don't count it in only_one_window(). (Alexei Alexandrov) 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 Add ten marks for last changed files: ':0, ':1, etc. One mark per file. 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) 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 keymap for a character, if it exists. Also show the code of the character after conversion to 'fileencoding'. - Use digraph table to tell Vim about the collating sequence of special characters? 8 Add command to remove one or more (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'? 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 Substitute with hex/unicode number "\%xff" and "\%uabcd". Just like "\%uabcd" in search pattern. 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: 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) - 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. 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 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)? Debug mode: 8 Add breakpoints for setting an option 8 Add breakpoints for assigning to a variable. 7 Store the history from debug mode in viminfo. 7 Make the debug mode history available with histget() et al. Various improvements: 7 Add plugins for formatting? Should be able to make a choice depending on the language of a file (English/Korean/Japanese/etc.). Setting the 'langformat' option to "chinese" would load the "format/chinese.vim" plugin. The plugin would set 'formatexpr' and define the function being called. Edward L. Fox explains how it should be done for most Asian languages. (2005 Nov 24) Alternative: patch for utf-8 line breaking. (Yongwei Wu, 2008 Feb 23) 7 [t to move to previous xml/html tag (like "vatov"), ]t to move to next ("vatv"). 7 [< to move to previous xml/html tag, e.g., previous <li>. ]< to move to next <li>, ]< to next </li>, [< to previous </li>. 8 Add ":rename" command: rename the file of the current buffer and rename the buffer. Buffer may be modified. 7 Instead of filtering errors with a shell script it should be possible to do this with Vim script. A function that filters the raw text that comes from the 'makeprg'? - Add %b to 'errorformat': buffer number. (Yegappan Lakshmanan / Suresh Govindachar) 7 Add a command that goes back to the position from before jumping to the first quickfix location. ":cbefore"? 7 Allow a window not to have a statusline. Makes it possible to use a window as a buffer-tab selection. 8 Allow non-active windows to have a different statusline. (Yakov Lerner) 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. More general: need a way to access command modifiers in a user command. Assign them to a v: variable? 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. 6 "vim -q -" should read the list of errors from stdin. (Gautam Mudunuri) 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 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. 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). 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. 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 termresponse 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 Support setting 'equalprg' to a user function name. 7 Highlight the characters after the end-of-line differently. 7 When 'whichwrap' contains "l", "$dl" should join lines? 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) Perhaps an autocommand event like CursorHold is better? Patch to add async functionality. (Geoff Greer, 2013 Sep 1 and later) 8 Add ":confirm" handling in open_exfile(), for when file already exists. 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%"? 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? 7 Make it possible to set the size of the jumplist (also to a smaller number than the default). (Nikolai Weibull) - 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 using 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. - Make 'smartcase' work even though 'ic' isn't set (Webb). 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 The 'a' flag in 'formatoptions' is too dangerous. In some way only do auto-formatting in specific regions, e.g. defined by syntax highlighting. 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? - Support multi-byte characters for sentences. Example from Ben Peterson. 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? - Add more redirecting of Ex commands: :redir #> bufname :redir #>> bufname (append) - Give error message when starting :redir: twice or using END when no redirection was active. - 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. - ":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. - 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'. Make 'showbreak' local to a window. - 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) 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? - 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. - 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. - 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). 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. Perhaps writing to stdout will work, since stderr is used for the terminal I/O. 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 exist, 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 ". - 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"? - 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. - 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 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: - Instead of using a Makefile and autoconf, use a simple shell script to find the C compiler and do everything with C code. Translate something like an Aap recipe and configure.in to C. Avoids depending on Python, thus will work everywhere. With batch file to find the C compiler it would also work on MS-Windows. - 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/. When using "do" or ":diffget" in a buffer with changes in every line an extra empty line would appear. vim:tw=78:sw=4:sts=4:ts=8:ft=help:norl: vim: set fo+=n : �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/uganda.txt�����������������������������������������������������������������0000664�0000000�0000000�00000033310�12677030670�0017025�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*uganda.txt* For Vim version 7.4. Last change: 2013 Jul 06 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/ http://www.iccf.nl/ You can also sponsor the development of Vim. Vim sponsors can vote for features. See |sponsor|. The money goes to Uganda anyway. 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|. The money goes to Uganda anyway. - 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* *charity* 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). *donate* 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. When I came back to Holland, I wanted 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. Furthermore, the centre has been co-sponsored and inspected by World Vision, Save the Children Fund and is now under the supervision of Pacific Academy Outreach Society. The centre is visited about once a year to check the progress (at our own cost). I have visited the centre myself many times, starting in 1993. 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: *iccf-donations* Check the ICCF web site for the latest information! See |iccf| for the URL. USA: The methods mentioned below can be used. Sending a check to the Nehemiah Group Outreach Society (NGOS) is no longer possible, unfortunately. We are looking for another way to get you an IRS tax receipt. For sponsoring a child contact KCF in Canada (see below). US checks can be sent to them to lower banking costs. Canada: Contact Kibaale Children's Fund (KCF) in Surrey, Canada. They take care of the Canadian sponsors for the children in Kibaale. KCF forwards 100% of the money to the project in Uganda. You can send them a one time donation directly. Please send me a note so that I 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. Holland: Transfer to the account of "Stichting ICCF Holland" in Lisse. This will allow for tax deduction if you live in Holland. Postbank, nr. 4548774 IBAN: NL95 INGB 0004 5487 74 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/en_US/mrb/pal=XAC62PML3GF8Q The e-mail address for sending the money to is: Bram@iccf-holland.org For amounts above 400 Euro ($500) sending a check is preferred. Others: Transfer to one of these accounts if possible: Postbank, account 4548774 Swift code: INGB NL 2A IBAN: NL95 INGB 0004 5487 74 under the name "stichting ICCF Holland", Lisse If that doesn't work: Rabobank Lisse, account 3765.05.117 Swift code: RABO NL 2U under the name "Bram Moolenaar", Lisse Otherwise, send a check in euro or US dollars to the address below. Minimal amount: $70 (my bank does not accept smaller amounts for foreign check, sorry) Address to send checks to: Bram Moolenaar Finsterruetihof 1 8134 Adliswil Switzerland This address is expected to be valid for a long time. vim:tw=78:ts=8:ft=help:norl: ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/undo.txt�������������������������������������������������������������������0000664�0000000�0000000�00000040233�12677030670�0016535�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*undo.txt* For Vim version 7.4. Last change: 2014 May 24 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. Undo blocks |undo-blocks| 4. Undo branches |undo-branches| 5. Undo persistence |undo-persistence| 6. 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} *E830* :u[ndo] {N} Jump to after change number {N}. See |undo-branches| for the meaning of {N}. {not in Vi} *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, the line where the latest change was made. |U| itself also counts as a change, and thus |U| undoes a previous |U|. {Vi: while not moved off of the last modified line} 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. Undo blocks *undo-blocks* One undo command normally undoes a typed command, no matter how many changes that command makes. This sequence of undo-able changes forms an undo block. Thus if the typed key(s) call a function, all the commands in the function are undone together. If you want to write a function or script that doesn't create a new undoable change but joins in with the previous change use this command: *:undoj* *:undojoin* *E790* :undoj[oin] Join further changes with the previous undo block. Warning: Use with care, it may prevent the user from properly undoing changes. Don't use this after undo or redo. {not in Vi} This is most useful when you need to prompt the user halfway through a change. For example in a function that calls |getchar()|. Do make sure that there was a related change before this that you must join with. This doesn't work by itself, because the next key press will start a new change again. But you can do something like this: > :undojoin | delete After this an "u" command will undo the delete command and the previous change. To do the opposite, break a change into two undo blocks, in Insert mode use CTRL-G u. This is useful if you want an insert command to be undoable in parts. E.g., for each sentence. |i_CTRL-G_u| Setting the value of 'undolevels' also breaks undo. Even when the new value is equal to the old value. ============================================================================== 4. Undo branches *undo-branches* *undo-tree* Above we only discussed one line of undo/redo. But it is also possible to branch off. This happens when you undo a few changes and then make a new change. The undone changes become a branch. You can go to that branch with the following commands. This is explained in the user manual: |usr_32.txt|. *:undol* *:undolist* :undol[ist] List the leafs in the tree of changes. Example: number changes when saved ~ 88 88 2010/01/04 14:25:53 108 107 08/07 12:47:51 136 46 13:33:01 7 166 164 3 seconds ago The "number" column is the change number. This number continuously increases and can be used to identify a specific undo-able change, see |:undo|. The "changes" column is the number of changes to this leaf from the root of the tree. The "when" column is the date and time when this change was made. The four possible formats are: N seconds ago HH:MM:SS hour, minute, seconds MM/DD HH:MM:SS idem, with month and day YYYY/MM/DD HH:MM:SS idem, with year The "saved" column specifies, if this change was written to disk and which file write it was. This can be used with the |:later| and |:earlier| commands. For more details use the |undotree()| function. *g-* g- Go to older text state. With a count repeat that many times. {not in Vi} *:ea* *:earlier* :earlier {count} Go to older text state {count} times. :earlier {N}s Go to older text state about {N} seconds before. :earlier {N}m Go to older text state about {N} minutes before. :earlier {N}h Go to older text state about {N} hours before. :earlier {N}d Go to older text state about {N} days before. :earlier {N}f Go to older text state {N} file writes before. When changes were made since the last write ":earlier 1f" will revert the text to the state when it was written. Otherwise it will go to the write before that. When at the state of the first file write, or when the file was not written, ":earlier 1f" will go to before the first change. *g+* g+ Go to newer text state. With a count repeat that many times. {not in Vi} *:lat* *:later* :later {count} Go to newer text state {count} times. :later {N}s Go to newer text state about {N} seconds later. :later {N}m Go to newer text state about {N} minutes later. :later {N}h Go to newer text state about {N} hours later. :later {N}d Go to newer text state about {N} days later. :later {N}f Go to newer text state {N} file writes later. When at the state of the last file write, ":later 1f" will go to the newest text state. Note that text states will become unreachable when undo information is cleared for 'undolevels'. Don't be surprised when moving through time shows multiple changes to take place at a time. This happens when moving through the undo tree and then making a new change. EXAMPLE Start with this text: one two three ~ Delete the first word by pressing "x" three times: ne two three ~ e two three ~ two three ~ Now undo that by pressing "u" three times: e two three ~ ne two three ~ one two three ~ Delete the second word by pressing "x" three times: one wo three ~ one o three ~ one three ~ Now undo that by using "g-" three times: one o three ~ one wo three ~ two three ~ You are now back in the first undo branch, after deleting "one". Repeating "g-" will now bring you back to the original text: e two three ~ ne two three ~ one two three ~ Jump to the last change with ":later 1h": one three ~ And back to the start again with ":earlier 1h": one two three ~ Note that using "u" and CTRL-R will not get you to all possible text states while repeating "g-" and "g+" does. ============================================================================== 5. Undo persistence *undo-persistence* *persistent-undo* When unloading a buffer Vim normally destroys the tree of undos created for that buffer. By setting the 'undofile' option, Vim will automatically save your undo history when you write a file and restore undo history when you edit the file again. The 'undofile' option is checked after writing a file, before the BufWritePost autocommands. If you want to control what files to write undo information for, you can use a BufWritePre autocommand: > au BufWritePre /tmp/* setlocal noundofile Vim saves undo trees in a separate undo file, one for each edited file, using a simple scheme that maps filesystem paths directly to undo files. Vim will detect if an undo file is no longer synchronized with the file it was written for (with a hash of the file contents) and ignore it when the file was changed after the undo file was written, to prevent corruption. An undo file is also ignored if its owner differs from the owner of the edited file, except when the owner of the undo file is the current user. Set 'verbose' to get a message about that when opening a file. Undo files are normally saved in the same directory as the file. This can be changed with the 'undodir' option. When the file is encrypted, the text in the undo file is also crypted. The same key and method is used. |encryption| You can also save and restore undo histories by using ":wundo" and ":rundo" respectively: *:wundo* *:rundo* :wundo[!] {file} Write undo history to {file}. When {file} exists and it does not look like an undo file (the magic number at the start of the file is wrong), then this fails, unless the ! was added. If it exists and does look like an undo file it is overwritten. If there is no undo-history, nothing will be written. Implementation detail: Overwriting happens by first deleting the existing file and then creating a new file with the same name. So it is not possible to overwrite an existing undofile in a write-protected directory. {not in Vi} :rundo {file} Read undo history from {file}. {not in Vi} You can use these in autocommands to explicitly specify the name of the history file. E.g.: > au BufReadPost * call ReadUndo() au BufWritePost * call WriteUndo() func ReadUndo() if filereadable(expand('%:h'). '/UNDO/' . expand('%:t')) rundo %:h/UNDO/%:t endif endfunc func WriteUndo() let dirname = expand('%:h') . '/UNDO' if !isdirectory(dirname) call mkdir(dirname) endif wundo %:h/UNDO/%:t endfunc You should keep 'undofile' off, otherwise you end up with two undo files for every write. You can use the |undofile()| function to find out the file name that Vim would use. Note that while reading/writing files and 'undofile' is set most errors will be silent, unless 'verbose' is set. With :wundo and :rundo you will get more error messages, e.g., when the file cannot be read or written. NOTE: undo files are never deleted by Vim. You need to delete them yourself. Reading an existing undo file may fail for several reasons: *E822* It cannot be opened, because the file permissions don't allow it. *E823* The magic number at the start of the file doesn't match. This usually means it is not an undo file. *E824* The version number of the undo file indicates that it's written by a newer version of Vim. You need that newer version to open it. Don't write the buffer if you want to keep the undo info in the file. "File contents changed, cannot use undo info" The file text differs from when the undo file was written. This means the undo file cannot be used, it would corrupt the text. This also happens when 'encoding' differs from when the undo file was written. *E825* The undo file does not contain valid contents and cannot be used. *E826* The undo file is encrypted but decryption failed. *E827* The undo file is encrypted but this version of Vim does not support encryption. Open the file with another Vim. *E832* The undo file is encrypted but 'key' is not set, the text file is not encrypted. This would happen if the text file was written by Vim encrypted at first, and later overwritten by not encrypted text. You probably want to delete this undo file. "Not reading undo file, owner differs" The undo file is owned by someone else than the owner of the text file. For safety the undo file is not used. Writing an undo file may fail for these reasons: *E828* The file to be written cannot be created. Perhaps you do not have write permissions in the directory. "Cannot write undo file in any directory in 'undodir'" None of the directories in 'undodir' can be used. "Will not overwrite with undo file, cannot read" A file exists with the name of the undo file to be written, but it cannot be read. You may want to delete this file or rename it. "Will not overwrite, this is not an undo file" A file exists with the name of the undo file to be written, but it does not start with the right magic number. You may want to delete this file or rename it. "Skipping undo file write, nothing to undo" There is no undo information to be written, nothing has been changed or 'undolevels' is negative. *E829* An error occurred while writing the undo file. You may want to try again. ============================================================================== 6. 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. *clear-undo* When you set 'undolevels' to -1 the undo information is not immediately cleared, this happens at the next change. To force clearing the undo information you can use these commands: > :let old_undolevels = &undolevels :set undolevels=-1 :exe "normal a \<BS>\<Esc>" :let &undolevels = old_undolevels :unlet old_undolevels 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: ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/usr_01.txt�����������������������������������������������������������������0000664�0000000�0000000�00000015672�12677030670�0016712�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*usr_01.txt* For Vim version 7.4. Last change: 2010 Nov 03 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|. The bars themselves may be hidden or invisible, see below. 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|. The bars and stars are usually hidden with the |conceal| feature. They also use |hl-Ignore|, using the same color for the text as the background. You can make them visible with: > :set conceallevel=0 :hi link HelpBar Normal :hi link HelpStar Normal ============================================================================== *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 a nice setup is to 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, if Vim has been properly installed, you can start it from the shell: > vimtutor On MS-Windows you can find it in the Program/Vim menu. Or execute vimtutor.bat in the $VIMRUNTIME directory. 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 On Unix, if you prefer using the GUI version of Vim, use "gvimtutor" or "vimtutor -g" instead of "vimtutor". 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/openpub/ 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 later, 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: ����������������������������������������������������������������������vim-7.4.1689/runtime/doc/usr_02.txt�����������������������������������������������������������������0000664�0000000�0000000�00000057422�12677030670�0016712�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*usr_02.txt* For Vim version 7.4. Last change: 2016 Jan 16 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. More about that in section |32.2|. ============================================================================== *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! If you know what you are looking for, it is usually easier to search for it using the help system, instead of using Google. Because the subjects follow a certain style guide. Also the help has the advantage of belonging to your particular Vim version. You won't see help for commands added later. These would not work for you. 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 below: |help-summary|. 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 Summary: *help-summary* > 1) Use Ctrl-D after typing a topic and let Vim show all available topics. Or press Tab to complete: > :help some<Tab> < More information on how to use the help: > :help helphelp 2) Follow the links in bars to related help. You can go from the detailed help to the user documentation, which describes certain commands more from a user perspective and less detailed. E.g. after: > :help pattern.txt < You can see the user guide topics |03.9| and |usr_27.txt| in the introduction. 3) Options are enclosed in single apostrophes. To go to the help topic for the list option: > :help 'list' < If you only know you are looking for a certain option, you can also do: > :help options.txt < to open the help page which describes all option handling and then search using regular expressions, e.g. textwidth. Certain options have their own namespace, e.g.: > :help cpo-<letter> < for the corresponding flag of the 'cpoptions' settings, substitute <letter> by a specific flag, e.g.: > :help cpo-; < And for the guioption flags: > :help go-<letter> 4) Normal mode commands do not have a prefix. To go to the help page for the "gt" command: > :help gt 5) Insert mode commands start with i_. Help for deleting a word: > :help i_CTRL-W 6) Visual mode commands start with v_. Help for jumping to the other side of the Visual area: > :help v_o 7) Command line editing and arguments start with c_. Help for using the command argument %: > :help c_% 8) Ex-commands always start with ":", so to go to the :s command help: > :help :s 9) Commands specifically for debugging start with ">". To go to to the help for the "cont" debug command: > :help >cont 10) Key combinations. They usually start with a single letter indicating the mode for which they can be used. E.g.: > :help i_CTRL-X < takes you to the family of Ctrl-X commands for insert mode which can be used to auto complete different things. Note, that certain keys will always be written the same, e.g. Control will always be CTRL. For normal mode commands there is no prefix and the topic is available at :h CTRL-<Letter>. E.g. > :help CTRL-W < In contrast > :help c_CTRL-R < will describe what the Ctrl-R does when entering commands in the Command line and > :help v_Ctrl-A < talks about incrementing numbers in visual mode and > :help g_CTRL-A < talks about the g<C-A> command (e.g. you have to press "g" then <Ctrl-A>). Here the "g" stand for the normal command "g" which always expects a second key before doing something similar to the commands starting with "z" 11) Regexp items always start with /. So to get help for the "\+" quantifier in Vim regexes: > :help /\+ < If you need to know everything about regular expressions, start reading at: > :help pattern.txt 12) Registers always start with "quote". To find out about the special ":" register: > :help quote: 13) Vim Script (VimL) is available at > :help eval.txt < Certain aspects of the language are available at :h expr-X where "X" is a single letter. E.g. > :help expr-! < will take you to the topic describing the "!" (Not) operator for VimScript. Also important is > :help function-list < to find a short description of all functions available. Help topics for VimL functions always include the "()", so: > :help append() < talks about the append VimL function rather than how to append text in the current buffer. 14) Mappings are talked about in the help page :h |map.txt|. Use > :help mapmode-i < to find out about the |:imap| command. Also use :map-topic to find out about certain subtopics particular for mappings. e.g: > :help :map-local < for buffer-local mappings or > :help map-bar < for how the '|' is handled in mappings. 15) Command definitions are talked about :h command-topic, so use > :help command-bar < to find out about the '!' argument for custom commands. 16) Window management commands always start with CTRL-W, so you find the corresponding help at :h CTRL-W_letter. E.g. > :help CTRL-W_p < for moving the previous accessed window. You can also access > :help windows.txt < and read your way through if you are looking for window handling commands. 17) Use |:helpgrep| to search in all help pages (and also of any installed plugins). See |:helpgrep| for how to use it. To search for a topic: > :helpgrep topic < This takes you to the first match. To go to the next one: > :cnext < All matches are available in the quickfix window which can be opened with: > :copen < Move around to the match you like and press Enter to jump to that help. 18) The user manual. This describes help topics for beginners in a rather friendly way. Start at |usr_toc.txt| to find the table of content (as you might have guessed): > :help usr_toc.txt < Skim over the contents to find interesting topics. The "Digraphs" and "Entering special characters" items are in chapter 24, so to go to that particular help page: > :help usr_24.txt < Also if you want to access a certain chapter in the help, the chapter number can be accessed directly like this: > :help 10.1 < goes to chapter 10.1 in |usr_10.txt| and talks about recording macros. 19) Highlighting groups. Always start with hl-groupname. E.g. > :help hl-WarningMsg < talks about the WarningMsg highlighting group. 20) Syntax highlighting is namespaced to :syn-topic e.g. > :help :syn-conceal < talks about the conceal argument for the :syn command. 21) Quickfix commands usually start with :c while location list commands usually start with :l 22) Autocommand events can be found by their name: > :help BufWinLeave < To see all possible events: > :help autocommands-events 23) Command-line switches always start with "-". So for the help of the -f command switch of Vim use: > :help -f 24) Optional features always start with "+". To find out about the conceal feature use: > :help +conceal 25) Documentation for included filetype specific functionality is usually available in the form ft-<filetype>-<functionality>. So > :help ft-c-syntax < talks about the C syntax file and the option it provides. Sometimes, additional sections for omni completion > :help ft-php-omni < or filetype plugins > :help ft-tex-plugin < are available. 26) Error and Warning codes can be looked up directly in the help. So > :help E297 < takes you exactly to the description of the swap error message and > :help W10 < talks about the warning "Changing a readonly file". Sometimes however, those error codes are not described, but rather are listed at the Vim command that usually causes this. So: > :help E128 < takes you to the |:function| command ============================================================================== Next chapter: |usr_03.txt| Moving around Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/usr_03.txt�����������������������������������������������������������������0000664�0000000�0000000�00000056062�12677030670�0016712�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*usr_03.txt* For Vim version 7.4. Last change: 2016 Jan 05 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 parenthesis |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. If you try this out in the help directly, 'iskeyword' needs to be reset for the examples to work: > :set iskeyword& 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 parenthesis 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 meanings. 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 beginning 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 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 *bookmark* 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 Then 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: ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/usr_04.txt�����������������������������������������������������������������0000664�0000000�0000000�00000045212�12677030670�0016706�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*usr_04.txt* For Vim version 7.4. Last change: 2014 Aug 29 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 differently 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 you 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 work 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: ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/usr_05.txt�����������������������������������������������������������������0000664�0000000�0000000�00000056027�12677030670�0016715�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*usr_05.txt* For Vim version 7.4. Last change: 2016 Mar 28 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 Vim's 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 package |05.5| Adding a plugin |05.6| Adding a help file |05.7| The option window |05.8| 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 Vim with all your favorite option settings and mappings, you write them in what is called the vimrc file. Vim executes the commands in this file when it starts up. If you already have a vimrc file (e.g., when your sysadmin has one setup for you), you can edit it this way: > :edit $MYVIMRC 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 and Macintosh this file is always used and is recommended: ~/.vimrc ~ For MS-DOS and MS-Windows you can use 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 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 _g y:exe "grep /" . escape(@", '\\/') . "/ *.c *.h"<CR> This mapping yanks the visually selected text and searches for it in C files. This is a complicated mapping. 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. *restore-cursor* > autocmd BufReadPost * \ if line("'\"") > 1 && 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 parentheses 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 package *add-package* *matchit-install* A package is a set of files that you can add to Vim. There are two kinds of packages: optional and automatically loaded on startup. The Vim distribution comes with a few packages that you can optionally use. For example, the matchit plugin. 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). To start using the matchit plugin, add one line to your vimrc file: > packadd! matchit That's all! After restarting Vim you can find help about this plugin: > :help matchit This works, because when `:packadd` loaded the plugin it also added the package directory in 'runtimepath', so that the help file can be found. You can find packages on the Internet in various places. It usually comes as an archive or as a repository. For an archive you can follow these steps: 1. create the package directory: > mkdir -p ~/.vim/pack/fancy < "fancy" can be any name of your liking. Use one that describes the package. 2. unpack the archive in that directory. This assumes the top directory in the archive is "start": > cd ~/.vim/pack/fancy unzip /tmp/fancy.zip < If the archive layout is different make sure that you end up with a path like this: ~/.vim/pack/fancy/start/fancytext/plugin/fancy.vim ~ Here "fancytext" is the name of the package, it can be anything else. More information about packages can be found here: |packages|. ============================================================================== *05.5* 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. There is a large collection on http://www.vim.org. - They are sometimes posted in a Vim |maillist|. - You could write one yourself, see |write-plugin|. Some plugins come as a vimball archive, see |vimball|. Some plugins can be updated automatically, see |getscript|. 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 /tmp/yourplugin.vim ~/.vim/plugin That's all! Now you can use the commands defined in this plugin. Instead of putting plugins directly into the plugin/ directory, you may better organize them by putting them into subdirectories under plugin/. As an example, consider using "~/.vim/plugin/perl/*.vim" for all your Perl plugins. 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 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.6* Adding a help file *add-local-help* 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 "doit.vim" plugin as an example. This plugin comes with documentation: "doit.txt". Let's first copy the plugin to the right directory. This time we will do it from inside Vim. (You may skip some of the "mkdir" commands if you already have the directory.) > :!mkdir ~/.vim :!mkdir ~/.vim/plugin :!cp /tmp/doit.vim ~/.vim/plugin The "cp" command is for Unix, on MS-DOS you can use "copy". Now create a "doc" directory in one of the directories in 'runtimepath'. > :!mkdir ~/.vim/doc Copy the help file to the "doc" directory. > :!cp /tmp/doit.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 doit command to find help for "doit" 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.7* 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.8* 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 an 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 off 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: ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/usr_06.txt�����������������������������������������������������������������0000664�0000000�0000000�00000022563�12677030670�0016714�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*usr_06.txt* For Vim version 7.4. Last change: 2009 Oct 28 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 this command: > :runtime syntax/colortest.vim 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. Convert the current file to HTML with this command: > :TOhtml In case that doesn't work: > :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: ���������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/usr_07.txt�����������������������������������������������������������������0000664�0000000�0000000�00000037142�12677030670�0016714�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*usr_07.txt* For Vim version 7.4. Last change: 2006 Apr 24 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: ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/usr_08.txt�����������������������������������������������������������������0000664�0000000�0000000�00000045657�12677030670�0016727�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*usr_08.txt* For Vim version 7.4. Last change: 2014 Jul 06 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 |08.9| Tab pages 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 almost 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 width 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 ============================================================================== *08.9* Tab pages You will have noticed that windows never overlap. That means you quickly run out of screen space. The solution for this is called Tab pages. Assume you are editing "thisfile". To create a new tab page use this command: > :tabedit thatfile This will edit the file "thatfile" in a window that occupies the whole Vim window. And you will notice a bar at the top with the two file names: +----------------------------------+ | thisfile | /thatfile/ __________X| (thatfile is bold) |/* thatfile */ | |that | |that | |~ | |~ | |~ | | | +----------------------------------+ You now have two tab pages. The first one has a window for "thisfile" and the second one a window for "thatfile". It's like two pages that are on top of each other, with a tab sticking out of each page showing the file name. Now use the mouse to click on "thisfile" in the top line. The result is +----------------------------------+ | /thisfile/ | thatfile __________X| (thisfile is bold) |/* thisfile */ | |this | |this | |~ | |~ | |~ | | | +----------------------------------+ Thus you can switch between tab pages by clicking on the label in the top line. If you don't have a mouse or don't want to use it, you can use the "gt" command. Mnemonic: Goto Tab. Now let's create another tab page with the command: > :tab split This makes a new tab page with one window that is editing the same buffer as the window we were in: +-------------------------------------+ | thisfile | /thisfile/ | thatfile __X| (thisfile is bold) |/* thisfile */ | |this | |this | |~ | |~ | |~ | | | +-------------------------------------+ You can put ":tab" before any Ex command that opens a window. The window will be opened in a new tab page. Another example: > :tab help gt Will show the help text for "gt" in a new tab page. A few more things you can do with tab pages: - click with the mouse in the space after the last label The next tab page will be selected, like with "gt". - click with the mouse on the "X" in the top right corner The current tab page will be closed. Unless there are unsaved changes in the current tab page. - double click with the mouse in the top line A new tab page will be created. - the "tabonly" command Closes all tab pages except the current one. Unless there are unsaved changes in other tab pages. For more information about tab pages see |tab-page|. ============================================================================== Next chapter: |usr_09.txt| Using the GUI Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: ���������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/usr_09.txt�����������������������������������������������������������������0000664�0000000�0000000�00000026271�12677030670�0016717�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*usr_09.txt* For Vim version 7.4. Last change: 2006 Apr 24 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: ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/usr_10.txt�����������������������������������������������������������������0000664�0000000�0000000�00000070774�12677030670�0016716�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*usr_10.txt* For Vim version 7.4. Last change: 2006 Nov 05 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 the last 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. And it does insert text in a short line. Thus you can make a choice whether you do or don't want to append text to a short line. 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: ����vim-7.4.1689/runtime/doc/usr_11.txt�����������������������������������������������������������������0000664�0000000�0000000�00000030504�12677030670�0016702�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*usr_11.txt* For Vim version 7.4. Last change: 2010 Jul 20 VIM USER MANUAL - by Bram Moolenaar Recovering from a crash Did your computer crash? And you just spent hours editing? Don't panic! Vim stores enough information 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 Vim recovered your changes 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) ~ You may want to delete the .swp file now. ~ 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|. For example: > :write help.txt.recovered :edit # :diffsp help.txt 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. If the recovery resulted in text that is exactly the same as the file contents, you will get this message: Using swap file ".help.txt.swp" ~ Original file "~/vim/runtime/doc/help.txt" ~ Recovery completed. Buffer contents equals file contents. ~ You may want to delete the .swp file now. ~ This usually happens if you already recovered your changes, or you wrote the file after making changes. It is safe to delete the swap file now. It is 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. Vim recognizes files with the pattern *.s[uvw][a-z] as swap files. 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? *swap-exists-choices* 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. For remarks about encryption and the swap file, see |:recover-crypt|. ============================================================================== *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: ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/usr_12.txt�����������������������������������������������������������������0000664�0000000�0000000�00000032153�12677030670�0016705�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*usr_12.txt* For Vim version 7.4. Last change: 2007 May 11 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 "fourteen". 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 file it is), 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: ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/usr_20.txt�����������������������������������������������������������������0000664�0000000�0000000�00000032607�12677030670�0016710�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*usr_20.txt* For Vim version 7.4. Last change: 2006 Apr 24 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: �������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/usr_21.txt�����������������������������������������������������������������0000664�0000000�0000000�00000043705�12677030670�0016712�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*usr_21.txt* For Vim version 7.4. Last change: 2012 Nov 02 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 presence 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 STOPPED VIM 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. GETTING BACK TO SOME FILE If you want to go back to a file that you edited recently, but not when exiting Vim, there is a slightly more complicated way. You can see a list of files by typing the command: > :oldfiles < 1: ~/.viminfo ~ 2: ~/text/resume.txt ~ 3: /tmp/draft ~ Now you would like to edit the second file, which is in the list preceded by "2:". You type: > :e #<2 Instead of ":e" you can use any command that has a file name argument, the "#<2" item works in the same place as "%" (current file name) and "#" (alternate file name). So you can also split the window to edit the third file: > :split #<3 That #<123 thing is a bit complicated when you just want to edit a file. Fortunately there is a simpler way: > :browse oldfiles < 1: ~/.viminfo ~ 2: ~/text/resume.txt ~ 3: /tmp/draft ~ -- More -- You get the same list of files as with |:oldfiles|. If you want to edit "resume.txt" first press "q" to stop the listing. You will get a prompt: Type number and <Enter> (empty cancels): ~ Type "2" and press <Enter> to edit the second file. More info at |:oldfiles|, |v:oldfiles| and |c_#<|. 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 your 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 windows, 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 choose. 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 on Unix or Administrator on MS-Windows, or when you 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. There 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: �����������������������������������������������������������vim-7.4.1689/runtime/doc/usr_22.txt�����������������������������������������������������������������0000664�0000000�0000000�00000033730�12677030670�0016710�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*usr_22.txt* For Vim version 7.4. Last change: 2012 Nov 15 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 browser |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 browser 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: " ============================================================================ ~ " Netrw Directory Listing (netrw v109) ~ " Sorted by name ~ " Sort sequence: [\/]$,\.h$,\.c$,\.cpp$,*,\.info$,\.swp$,\.o$\.obj$,\.bak$ ~ " Quick Help: <F1>:help -:go up dir D:delete R:rename s:sort-by x:exec ~ " ============================================================================ ~ ../ ~ ./ ~ check/ ~ Makefile ~ autocmd.txt ~ change.txt ~ eval.txt~ ~ filetype.txt~ ~ help.txt.info ~ You can see these items: 1. The name of the browsing tool and its version number 2. The name of the browsing directory 3. The method of sorting (may be by name, time, or size) 4. How names are to be sorted (directories first, then *.h files, *.c files, etc) 5. How to get help (use the <F1> key), and an abbreviated listing of available commands 6. A listing of files, including "../", which allows one to list the parent directory. If you have syntax highlighting enabled, the different parts are highlighted so as to make it easier to spot them. You can use Normal mode Vim commands to move around in the text. For example, move the cursor atop a file and press <Enter>; you will then be editing that file. To go back to the browser use ":edit ." again, or use ":Explore". CTRL-O also works. Try using <Enter> while the cursor is atop a directory name. The result is that the file browser 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 <F1> to get help on the things you can do in the netrw file browser. This is what you get: > 9. Directory Browsing netrw-browse netrw-dir netrw-list netrw-help MAPS netrw-maps <F1>.............Help.......................................|netrw-help| <cr>.............Browsing...................................|netrw-cr| <del>............Deleting Files or Directories..............|netrw-delete| -................Going Up...................................|netrw--| a................Hiding Files or Directories................|netrw-a| mb...............Bookmarking a Directory....................|netrw-mb| gb...............Changing to a Bookmarked Directory.........|netrw-gb| c................Make Browsing Directory The Current Dir....|netrw-c| d................Make A New Directory.......................|netrw-d| D................Deleting Files or Directories..............|netrw-D| <c-h>............Edit File/Directory Hiding List............|netrw-ctrl-h| i................Change Listing Style.......................|netrw-i| <c-l>............Refreshing the Listing.....................|netrw-ctrl-l| o................Browsing with a Horizontal Split...........|netrw-o| p................Use Preview Window.........................|netrw-p| P................Edit in Previous Window....................|netrw-p| q................Listing Bookmarks and History..............|netrw-q| r................Reversing Sorting Order....................|netrw-r| < (etc) The <F1> key thus brings you to a netrw directory browsing contents help page. It's a regular help page; use the usual |CTRL-]| to jump to tagged help items and |CTRL-O| to jump back. To select files for display and editing: (with the cursor is atop a filename) <enter> Open the file in the current window. |netrw-cr| o Horizontally split window and display file |netrw-o| v Vertically split window and display file |netrw-v| p Use the |preview-window| |netrw-p| P Edit in the previous window |netrw-P| t Open file in a new tab |netrw-t| The following normal-mode commands may be used to control the browser display: i Controls listing style (thin, long, wide, and tree). The long listing includes size and date information. s Repeatedly pressing s will change the way the files are sorted; one may sort on name, modification time, or size. r Reverse the sorting order. As a sampling of extra normal-mode commands: c Change Vim's notion of the current directory to be the same as the browser directory. (see |g:netrw_keepdir| to control this, too) R Rename the file or directory under the cursor; a prompt will be issued for the new name. D Delete the file or directory under the cursor; a confirmation request will be issued. mb gb Make bookmark/goto bookmark One may also use command mode; again, just a sampling: :Explore [directory] Browse specified/current directory :NetrwSettings A comprehensive list of your current netrw settings with help linkage. The netrw browser is not limited to just your local machine; one may use urls such as: (that trailing / is important) :Explore ftp://somehost/path/to/dir/ :e scp://somehost/path/to/dir/ See |netrw-browse| for more. ============================================================================== *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 argument of ":hide" is another command. ":hide" makes that command behave as if 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 %a + "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. a 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 the 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: ����������������������������������������vim-7.4.1689/runtime/doc/usr_23.txt�����������������������������������������������������������������0000664�0000000�0000000�00000030454�12677030670�0016711�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*usr_23.txt* For Vim version 7.4. Last change: 2006 Apr 24 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: ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/usr_24.txt�����������������������������������������������������������������0000664�0000000�0000000�00000050555�12677030670�0016716�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*usr_24.txt* For Vim version 7.4. Last change: 2006 Jul 23 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 no 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. COMPLETING IN SOURCE CODE Source code files are well structured. That makes it possible to do completion in an intelligent way. In Vim this is called Omni completion. In some other editors it's called intellisense, but that is a trademark. The key to Omni completion is CTRL-X CTRL-O. Obviously the O stands for Omni here, so that you can remember it easier. Let's use an example for editing C source: { ~ struct foo *p; ~ p-> ~ The cursor is after "p->". Now type CTRL-X CTRL-O. Vim will offer you a list of alternatives, which are the items that "struct foo" contains. That is quite different from using CTRL-P, which would complete any word, while only members of "struct foo" are valid here. For Omni completion to work you may need to do some setup. At least make sure filetype plugins are enabled. Your vimrc file should contain a line like this: > filetype plugin on Or: > filetype plugin indent on For C code you need to create a tags file and set the 'tags' option. That is explained |ft-c-omni|. For other filetypes you may need to do something similar, look below |compl-omni-filetypes|. It only works for specific filetypes. Check the value of the 'omnifunc' option to find out if it would work. ============================================================================== *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: ���������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/usr_25.txt�����������������������������������������������������������������0000664�0000000�0000000�00000045252�12677030670�0016715�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*usr_25.txt* For Vim version 7.4. Last change: 2016 Mar 28 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 to 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: > :packadd justify Or put this line in your |vimrc|: > packadd! justify 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/pack/dist/opt/justify/plugin/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 moved 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 *edit-paragraph-join* 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 its 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: ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/usr_26.txt�����������������������������������������������������������������0000664�0000000�0000000�00000020076�12677030670�0016713�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*usr_26.txt* For Vim version 7.4. Last change: 2006 Apr 24 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: ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/usr_27.txt�����������������������������������������������������������������0000664�0000000�0000000�00000042472�12677030670�0016720�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*usr_27.txt* For Vim version 7.4. Last change: 2010 Mar 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 let's 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 chapter 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 numbers, resulting in "\{-}". This matches the item before it zero or more times, as few as possible. The item by itself always matches 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 plate 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: ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/usr_28.txt�����������������������������������������������������������������0000664�0000000�0000000�00000037217�12677030670�0016722�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*usr_28.txt* For Vim version 7.4. Last change: 2008 Jun 14 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 make you wonder which method you should choose. 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: ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/usr_29.txt�����������������������������������������������������������������0000664�0000000�0000000�00000047224�12677030670�0016722�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*usr_29.txt* For Vim version 7.4. Last change: 2016 Feb 27 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 To make case in tag names be ignored, you can set 'ignorecase' while leaving 'tagcase' as "followic", or set 'tagcase' to "ignore". 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. 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 start 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 can 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 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: ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/usr_30.txt�����������������������������������������������������������������0000664�0000000�0000000�00000054200�12677030670�0016702�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*usr_30.txt* For Vim version 7.4. Last change: 2007 Nov 10 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' ~ Press 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\ %:S 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:S.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 a 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 style text 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 or C style programs like Java or C++, 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 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 ~ Thus 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 options: > :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 <Tab>s 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: ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/usr_31.txt�����������������������������������������������������������������0000664�0000000�0000000�00000024232�12677030670�0016705�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*usr_31.txt* For Vim version 7.4. Last change: 2007 May 08 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_32.txt| The undo tree 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 |netrw-browse|. ============================================================================== *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 its 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 its name is "~/.gvimrc" for Unix and "$VIM/_gvimrc" for MS-Windows. The $MYGVIMRC environment variable is set to it, thus you can use this command to edit the file, if you have one: > :edit $MYGVIMRC < 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_32.txt| The undo tree Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/usr_32.txt�����������������������������������������������������������������0000664�0000000�0000000�00000012375�12677030670�0016713�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*usr_32.txt* For Vim version 7.4. Last change: 2010 Jul 20 VIM USER MANUAL - by Bram Moolenaar The undo tree Vim provides multi-level undo. If you undo a few changes and then make a new change you create a branch in the undo tree. This text is about moving through the branches. |32.1| Undo up to a file write |32.2| Numbering changes |32.3| Jumping around the tree |32.4| Time travelling Next chapter: |usr_40.txt| Make new commands Previous chapter: |usr_31.txt| Exploiting the GUI Table of contents: |usr_toc.txt| ============================================================================== *32.1* Undo up to a file write Sometimes you make several changes, and then discover you want to go back to when you have last written the file. You can do that with this command: > :earlier 1f The "f" stands for "file" here. You can repeat this command to go further back in the past. Or use a count different from 1 to go back faster. If you go back too far, go forward again with: > :later 1f Note that these commands really work in time sequence. This matters if you made changes after undoing some changes. It's explained in the next section. Also note that we are talking about text writes here. For writing the undo information in a file see |undo-persistence|. ============================================================================== *32.2* Numbering changes In section |02.5| we only discussed one line of undo/redo. But it is also possible to branch off. This happens when you undo a few changes and then make a new change. The new changes become a branch in the undo tree. Let's start with the text "one". The first change to make is to append " too". And then move to the first 'o' and change it into 'w'. We then have two changes, numbered 1 and 2, and three states of the text: one ~ | change 1 | one too ~ | change 2 | one two ~ If we now undo one change, back to "one too", and change "one" to "me" we create a branch in the undo tree: one ~ | change 1 | one too ~ / \ change 2 change 3 | | one two me too ~ You can now use the |u| command to undo. If you do this twice you get to "one". Use |CTRL-R| to redo, and you will go to "one too". One more |CTRL-R| takes you to "me too". Thus undo and redo go up and down in the tree, using the branch that was last used. What matters here is the order in which the changes are made. Undo and redo are not considered changes in this context. After each change you have a new state of the text. Note that only the changes are numbered, the text shown in the tree above has no identifier. They are mostly referred to by the number of the change above it. But sometimes by the number of one of the changes below it, especially when moving up in the tree, so that you know which change was just undone. ============================================================================== *32.3* Jumping around the tree So how do you get to "one two" now? You can use this command: > :undo 2 The text is now "one two", you are below change 2. You can use the |:undo| command to jump to below any change in the tree. Now make another change: change "one" to "not": one ~ | change 1 | one too ~ / \ change 2 change 3 | | one two me too ~ | change 4 | not two ~ Now you change your mind and want to go back to "me too". Use the |g-| command. This moves back in time. Thus it doesn't walk the tree upwards or downwards, but goes to the change made before. You can repeat |g-| and you will see the text change: me too ~ one two ~ one too ~ one ~ Use |g+| to move forward in time: one ~ one too ~ one two ~ me too ~ not two ~ Using |:undo| is useful if you know what change you want to jump to. |g-| and |g+| are useful if you don't know exactly what the change number is. You can type a count before |g-| and |g+| to repeat them. ============================================================================== *32.4* Time travelling When you have been working on text for a while the tree grows to become big. Then you may want to go to the text of some minutes ago. To see what branches there are in the undo tree use this command: > :undolist < number changes time ~ 3 2 16 seconds ago 4 3 5 seconds ago Here you can see the number of the leaves in each branch and when the change was made. Assuming we are below change 4, at "not two", you can go back ten seconds with this command: > :earlier 10s Depending on how much time you took for the changes you end up at a certain position in the tree. The |:earlier| command argument can be "m" for minutes, "h" for hours and "d" for days. To go all the way back use a big number: > :earlier 100d To travel forward in time again use the |:later| command: > :later 1m The arguments are "s", "m" and "h", just like with |:earlier|. If you want even more details, or want to manipulate the information, you can use the |undotree()| function. To see what it returns: > :echo undotree() ============================================================================== Next chapter: |usr_40.txt| Make new commands Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/usr_40.txt�����������������������������������������������������������������0000664�0000000�0000000�00000055220�12677030670�0016706�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*usr_40.txt* For Vim version 7.4. Last change: 2013 Aug 05 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_32.txt| The undo tree 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 good choices 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 an "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 %:S<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 datestamp 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 buffer is written to a file. This will make that happen: > :autocmd BufWritePre * call DateInsert() "BufWritePre" is the event for which this autocommand is triggered: Just before (pre) writing a buffer to 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 BufWritePre 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 commands. 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: ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/usr_41.txt�����������������������������������������������������������������0000664�0000000�0000000�00000246016�12677030670�0016714�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*usr_41.txt* For Vim version 7.4. Last change: 2016 Mar 27 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| Lists and Dictionaries |41.9| Exceptions |41.10| Various remarks |41.11| Writing a plugin |41.12| Writing a filetype plugin |41.13| Writing a compiler plugin |41.14| Writing a plugin that loads quickly |41.15| Writing library scripts |41.16| Distributing Vim scripts 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* *script* 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 += 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. Note: You can try out the examples by yanking the lines from the text here and executing them with :@" The output of the example code is: count is 1 ~ count is 2 ~ count is 3 ~ count is 4 ~ In the first line 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. 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). 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 the ":let i += 1" command. This does the same thing as ":let i = i + 1". This adds one to the variable i and assigns the new value to the same variable. The example was given to explain the commands, but would you really want to make such a loop it can be written much more compact: > :for i in range(1, 4) : echo "count is" i :endfor We won't explain how |:for| and |range()| work until later. Follow the links if you are impatient. THREE KINDS OF NUMBERS Numbers can be decimal, hexadecimal or octal. A hexadecimal number starts with "0x" or "0X". For example "0x1f" is decimal 31. An octal number starts with a zero. "017" is decimal 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 used 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 above, 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 += 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. Zero is false. Note: Vim automatically converts a string to a number when it is looking for a number. When using a string that doesn't start with a digit the resulting number is zero. Thus look out for this: > :if "true" < The "true" will be interpreted as a zero, thus as 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 basic types of variables that Vim supports. The type is dynamic, it is set each time when assigning a value to the variable with ":let". More about types in |41.8|. 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 as they are. Only the single quote itself is special: you need to use two to get one. A backslash is taken literally, 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. (Another way to do this would be to add "\C" to the pattern, see |/\C|.) 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 parentheses. 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 >= 700 : 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 would 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. Even more looping can be done with the ":for" command, see below in |41.8|. ============================================================================== *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. If you don't want to execute a string but evaluate it to get its expression value, you can use the eval() function: > :let optname = "path" :let optval = eval('&' . optname) A "&" character is prepended to "path", thus the argument to eval() is "&path". The result will then be the value of the 'path' option. The same thing can be done with: > :exe 'let optval = &' . optname ============================================================================== *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 parentheses 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 buffer. 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: *string-functions* nr2char() get a character by its ASCII value char2nr() get ASCII value of a character str2nr() convert a string to a Number str2float() convert a string to a Float printf() format a string according to % items escape() escape characters in a string with a '\' shellescape() escape a string for use with a shell command fnameescape() escape a file name for use with a Vim command tr() translate characters from one set to another 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 matchstrpos() match and postions of a pattern in a string matchlist() like matchstr() and also return submatches 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 in bytes strchars() length of a string in characters strwidth() size of string when displayed strdisplaywidth() size of string when displayed, deals with tabs substitute() substitute a pattern match with a string submatch() get a specific match in ":s" and substitute() strpart() get part of a string expand() expand special keywords iconv() convert text from one encoding to another byteidx() byte index of a character in a string byteidxcomp() like byteidx() but count composing characters repeat() repeat a string multiple times eval() evaluate a string expression List manipulation: *list-functions* get() get an item without error for wrong index len() number of items in a List empty() check if List is empty insert() insert an item somewhere in a List add() append an item to a List extend() append a List to a List remove() remove one or more items from a List copy() make a shallow copy of a List deepcopy() make a full copy of a List filter() remove selected items from a List map() change each List item sort() sort a List reverse() reverse the order of a List uniq() remove copies of repeated adjacent items split() split a String into a List join() join List items into a String range() return a List with a sequence of numbers string() String representation of a List call() call a function with List as arguments index() index of a value in a List max() maximum value in a List min() minimum value in a List count() count number of times a value appears in a List repeat() repeat a List multiple times Dictionary manipulation: *dict-functions* get() get an entry without an error for a wrong key len() number of entries in a Dictionary has_key() check whether a key appears in a Dictionary empty() check if Dictionary is empty remove() remove an entry from a Dictionary extend() add entries from one Dictionary to another filter() remove selected entries from a Dictionary map() change each Dictionary entry keys() get List of Dictionary keys values() get List of Dictionary values items() get List of Dictionary key-value pairs copy() make a shallow copy of a Dictionary deepcopy() make a full copy of a Dictionary string() String representation of a Dictionary max() maximum value in a Dictionary min() minimum value in a Dictionary count() count number of times a value appears Floating point computation: *float-functions* float2nr() convert Float to Number abs() absolute value (also works for Number) round() round off ceil() round up floor() round down trunc() remove value after decimal point fmod() remainder of division exp() exponential log() natural logarithm (logarithm to base e) log10() logarithm to base 10 pow() value of x to the exponent y sqrt() square root sin() sine cos() cosine tan() tangent asin() arc sine acos() arc cosine atan() arc tangent atan2() arc tangent sinh() hyperbolic sine cosh() hyperbolic cosine tanh() hyperbolic tangent Other computation: *bitwise-function* and() bitwise AND invert() bitwise invert or() bitwise OR xor() bitwise XOR sha256() SHA-256 hash Variables: *var-functions* type() type of a variable islocked() check if a variable is locked function() get a Funcref for a function name getbufvar() get a variable value from a specific buffer setbufvar() set a variable in a specific buffer getwinvar() get a variable from specific window gettabvar() get a variable from specific tab page gettabwinvar() get a variable from specific window & tab page setwinvar() set a variable in a specific window settabvar() set a variable in a specific tab page settabwinvar() set a variable in a specific window & tab page garbagecollect() possibly free memory Cursor and mark position: *cursor-functions* *mark-functions* 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 screencol() get screen column of the cursor screenrow() get screen row of the cursor getcurpos() get position of the cursor getpos() get position of cursor, mark, etc. setpos() set position of cursor, mark, etc. byte2line() get line number at a specific byte count line2byte() byte count at a specific line diff_filler() get the number of filler lines above a line screenattr() get attribute at a screen line/row screenchar() get character code at a screen line/row Working with text in the current buffer: *text-functions* getline() get a line or list of lines from the buffer setline() replace a line in the buffer append() append line or list of lines in the buffer 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 searchpos() find a match for a pattern searchpair() find the other end of a start/skip/end searchpairpos() find the other end of a start/skip/end searchdecl() search for the declaration of a name *system-functions* *file-functions* System functions and manipulation of files: glob() expand wildcards globpath() expand wildcards in a number of directories findfile() find a file in a list of directories finddir() find a directory in a list of directories resolve() find out where a shortcut points to fnamemodify() modify a file name pathshorten() shorten directory names in a path simplify() simplify a path without changing its meaning executable() check if an executable program exists exepath() full path of an executable program filereadable() check if a file can be read filewritable() check if a file can be written to getfperm() get the permissions of a file getftype() get the kind of a file isdirectory() check if a directory exists getfsize() get the size of a file getcwd() get the current working directory haslocaldir() check if current window used |:lcd| tempname() get the name of a temporary file mkdir() create a new directory delete() delete a file rename() rename a file system() get the result of a shell command as a string systemlist() get the result of a shell command as a list hostname() name of the system readfile() read a file into a List of lines writefile() write a List of lines into a file Date and Time: *date-functions* *time-functions* getftime() get last modification time of a file localtime() get current time in seconds strftime() convert time to a string reltime() get the current or elapsed time accurately reltimestr() convert reltime() result to a string *buffer-functions* *window-functions* *arg-functions* Buffers, windows and the argument list: argc() number of entries in the argument list argidx() current position in the argument list arglistid() get id of 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 tabpagebuflist() return List of buffers in a tab page tabpagenr() get the number of a tab page tabpagewinnr() like winnr() for a specified tab page 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 getbufline() get a list of lines from the specified buffer Command line: *command-line-functions* getcmdline() get the current command line getcmdpos() get position of the cursor in the command line setcmdpos() set position of the cursor in the command line getcmdtype() return the current command-line type getcmdwintype() return the current command-line window type Quickfix and location lists: *quickfix-functions* getqflist() list of quickfix errors setqflist() modify a quickfix list getloclist() list of location list items setloclist() modify a location list Insert mode completion: *completion-functions* complete() set found matches complete_add() add to found matches complete_check() check if completion should be aborted pumvisible() check if the popup menu is displayed Folding: *folding-functions* 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 foldtextresult() get the text displayed for a closed fold Syntax and highlighting: *syntax-functions* *highlighting-functions* clearmatches() clear all matches defined by |matchadd()| and the |:match| commands getmatches() get all matches defined by |matchadd()| and the |:match| commands 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 synstack() get list of syntax IDs at a specific position synconcealed() get info about concealing diff_hlID() get highlight ID for diff mode at a position matchadd() define a pattern to highlight (a "match") matchaddpos() define a list of positions to highlight matcharg() get info about |:match| arguments matchdelete() delete a match defined by |matchadd()| or a |:match| command setmatches() restore a list of matches saved by |getmatches()| Spelling: *spell-functions* spellbadword() locate badly spelled word at or after cursor spellsuggest() return suggested spelling corrections soundfold() return the sound-a-like equivalent of a word History: *history-functions* 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: *interactive-functions* browse() put up a file requester browsedir() put up a directory requester confirm() let the user make a choice getchar() get a character from the user getcharmod() get modifiers for the last typed character feedkeys() put characters in the typeahead queue input() get a line from the user inputlist() let the user pick an entry from a list inputsecret() get a line from the user without showing it inputdialog() get a line from the user in a dialog inputsave() save and clear typeahead inputrestore() restore typeahead GUI: *gui-functions* getfontname() get name of current font being used getwinposx() X position of the GUI Vim window getwinposy() Y position of the GUI Vim window Vim server: *server-functions* 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 Window size and position: *window-size-functions* winheight() get height of a specific window winwidth() get width of a specific window winrestcmd() return command to restore window sizes winsaveview() get view of current window winrestview() restore saved view of current window Mappings: *mapping-functions* hasmapto() check if a mapping exists mapcheck() check if a matching mapping exists maparg() get rhs of a mapping wildmenumode() check if the wildmode is active Testing: *test-functions* assert_equal() assert that two expressions values are equal assert_match() assert that a pattern matches the value assert_false() assert that an expression is false assert_true() assert that an expression is true assert_exception() assert that a command throws an exception assert_fails() assert that a function call fails Inter-process communication: ch_open() open a channel ch_close() close a channel ch_sendexpr() send a JSON message over a channel ch_sendraw() send a raw message over a channel jsonencode() encode an expression to a JSON string jsondecode() decode a JSON string to Vim types Various: *various-functions* mode() get current editing mode visualmode() last visual mode used exists() check if a variable, function, etc. exists has() check if a feature is supported in Vim changenr() return number of most recent change 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 getpid() get process ID of Vim libcall() call a function in an external library libcallnr() idem, returning a number undofile() get the name of the undo file undotree() return the state of the undo tree getreg() get contents of a register getregtype() get type of a register setreg() set contents and type of a register shiftwidth() effective value of 'shiftwidth' taglist() get list of matching tags tagfiles() get a list of tags files luaeval() evaluate Lua expression mzeval() evaluate |MzScheme| expression perleval() evaluate Perl expression (|+perl|) py3eval() evaluate Python expression (|+python3|) pyeval() evaluate Python expression (|+python|) wordcount() get byte/word/char count of buffer ============================================================================== *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:today" inside a function is used for the global variable "today", and "today" 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 For people who like short functions, this does the same thing: > :function Min(num1, num2) : if a:num1 < a:num2 : return a:num1 : endif : return a:num2 :endfunction A user defined function is called in exactly the same way as a built-in 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 lnum = a:firstline : let n = 0 : while lnum <= a:lastline : let n = n + len(split(getline(lnum))) : let lnum = lnum + 1 : endwhile : echo "found " . n . " 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 "start 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. You can also use the a:000 variable, it is a List of all the "..." arguments. See |a:000|. 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. FUNCTION REFERENCES Sometimes it can be useful to have a variable point to one function or another. You can do it with the function() function. It turns the name of a function into a reference: > :let result = 0 " or 1 :function! Right() : return 'Right!' :endfunc :function! Wrong() : return 'Wrong!' :endfunc : :if result == 1 : let Afunc = function('Right') :else : let Afunc = function('Wrong') :endif :echo call(Afunc, []) < Wrong! ~ Note that the name of a variable that holds a function reference must start with a capital. Otherwise it could be confused with the name of a builtin function. The way to invoke a function that a variable refers to is with the call() function. Its first argument is the function reference, the second argument is a List with arguments. Function references are most useful in combination with a Dictionary, as is explained in the next section. ============================================================================== *41.8* Lists and Dictionaries So far we have used the basic types String and Number. Vim also supports two composite types: List and Dictionary. A List is an ordered sequence of things. The things can be any kind of value, thus you can make a List of numbers, a List of Lists and even a List of mixed items. To create a List with three strings: > :let alist = ['aap', 'mies', 'noot'] The List items are enclosed in square brackets and separated by commas. To create an empty List: > :let alist = [] You can add items to a List with the add() function: > :let alist = [] :call add(alist, 'foo') :call add(alist, 'bar') :echo alist < ['foo', 'bar'] ~ List concatenation is done with +: > :echo alist + ['foo', 'bar'] < ['foo', 'bar', 'foo', 'bar'] ~ Or, if you want to extend a List directly: > :let alist = ['one'] :call extend(alist, ['two', 'three']) :echo alist < ['one', 'two', 'three'] ~ Notice that using add() will have a different effect: > :let alist = ['one'] :call add(alist, ['two', 'three']) :echo alist < ['one', ['two', 'three']] ~ The second argument of add() is added as a single item. FOR LOOP One of the nice things you can do with a List is iterate over it: > :let alist = ['one', 'two', 'three'] :for n in alist : echo n :endfor < one ~ two ~ three ~ This will loop over each element in List "alist", assigning the value to variable "n". The generic form of a for loop is: > :for {varname} in {listexpression} : {commands} :endfor To loop a certain number of times you need a List of a specific length. The range() function creates one for you: > :for a in range(3) : echo a :endfor < 0 ~ 1 ~ 2 ~ Notice that the first item of the List that range() produces is zero, thus the last item is one less than the length of the list. You can also specify the maximum value, the stride and even go backwards: > :for a in range(8, 4, -2) : echo a :endfor < 8 ~ 6 ~ 4 ~ A more useful example, looping over lines in the buffer: > :for line in getline(1, 20) : if line =~ "Date: " : echo matchstr(line, 'Date: \zs.*') : endif :endfor This looks into lines 1 to 20 (inclusive) and echoes any date found in there. DICTIONARIES A Dictionary stores key-value pairs. You can quickly lookup a value if you know the key. A Dictionary is created with curly braces: > :let uk2nl = {'one': 'een', 'two': 'twee', 'three': 'drie'} Now you can lookup words by putting the key in square brackets: > :echo uk2nl['two'] < twee ~ The generic form for defining a Dictionary is: > {<key> : <value>, ...} An empty Dictionary is one without any keys: > {} The possibilities with Dictionaries are numerous. There are various functions for them as well. For example, you can obtain a list of the keys and loop over them: > :for key in keys(uk2nl) : echo key :endfor < three ~ one ~ two ~ You will notice the keys are not ordered. You can sort the list to get a specific order: > :for key in sort(keys(uk2nl)) : echo key :endfor < one ~ three ~ two ~ But you can never get back the order in which items are defined. For that you need to use a List, it stores items in an ordered sequence. DICTIONARY FUNCTIONS The items in a Dictionary can normally be obtained with an index in square brackets: > :echo uk2nl['one'] < een ~ A method that does the same, but without so many punctuation characters: > :echo uk2nl.one < een ~ This only works for a key that is made of ASCII letters, digits and the underscore. You can also assign a new value this way: > :let uk2nl.four = 'vier' :echo uk2nl < {'three': 'drie', 'four': 'vier', 'one': 'een', 'two': 'twee'} ~ And now for something special: you can directly define a function and store a reference to it in the dictionary: > :function uk2nl.translate(line) dict : return join(map(split(a:line), 'get(self, v:val, "???")')) :endfunction Let's first try it out: > :echo uk2nl.translate('three two five one') < drie twee ??? een ~ The first special thing you notice is the "dict" at the end of the ":function" line. This marks the function as being used from a Dictionary. The "self" local variable will then refer to that Dictionary. Now let's break up the complicated return command: > split(a:line) The split() function takes a string, chops it into whitespace separated words and returns a list with these words. Thus in the example it returns: > :echo split('three two five one') < ['three', 'two', 'five', 'one'] ~ This list is the first argument to the map() function. This will go through the list, evaluating its second argument with "v:val" set to the value of each item. This is a shortcut to using a for loop. This command: > :let alist = map(split(a:line), 'get(self, v:val, "???")') Is equivalent to: > :let alist = split(a:line) :for idx in range(len(alist)) : let alist[idx] = get(self, alist[idx], "???") :endfor The get() function checks if a key is present in a Dictionary. If it is, then the value is retrieved. If it isn't, then the default value is returned, in the example it's '???'. This is a convenient way to handle situations where a key may not be present and you don't want an error message. The join() function does the opposite of split(): it joins together a list of words, putting a space in between. This combination of split(), map() and join() is a nice way to filter a line of words in a very compact way. OBJECT ORIENTED PROGRAMMING Now that you can put both values and functions in a Dictionary, you can actually use a Dictionary like an object. Above we used a Dictionary for translating Dutch to English. We might want to do the same for other languages. Let's first make an object (aka Dictionary) that has the translate function, but no words to translate: > :let transdict = {} :function transdict.translate(line) dict : return join(map(split(a:line), 'get(self.words, v:val, "???")')) :endfunction It's slightly different from the function above, using 'self.words' to lookup word translations. But we don't have a self.words. Thus you could call this an abstract class. Now we can instantiate a Dutch translation object: > :let uk2nl = copy(transdict) :let uk2nl.words = {'one': 'een', 'two': 'twee', 'three': 'drie'} :echo uk2nl.translate('three one') < drie een ~ And a German translator: > :let uk2de = copy(transdict) :let uk2de.words = {'one': 'ein', 'two': 'zwei', 'three': 'drei'} :echo uk2de.translate('three one') < drei ein ~ You see that the copy() function is used to make a copy of the "transdict" Dictionary and then the copy is changed to add the words. The original remains the same, of course. Now you can go one step further, and use your preferred translator: > :if $LANG =~ "de" : let trans = uk2de :else : let trans = uk2nl :endif :echo trans.translate('one two three') < een twee drie ~ Here "trans" refers to one of the two objects (Dictionaries). No copy is made. More about List and Dictionary identity can be found at |list-identity| and |dict-identity|. Now you might use a language that isn't supported. You can overrule the translate() function to do nothing: > :let uk2uk = copy(transdict) :function! uk2uk.translate(line) : return a:line :endfunction :echo uk2uk.translate('three one wladiwostok') < three one wladiwostok ~ Notice that a ! was used to overwrite the existing function reference. Now use "uk2uk" when no recognized language is found: > :if $LANG =~ "de" : let trans = uk2de :elseif $LANG =~ "nl" : let trans = uk2nl :else : let trans = uk2uk :endif :echo trans.translate('one two three') < one two three ~ For further reading see |Lists| and |Dictionaries|. ============================================================================== *41.9* 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. 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.10* 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. For the last command you need to do two things: |:execute| and use '|': > :exe '!ls *.c' |" list C files 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 spot these problems, you can set the 'list' option when editing vimrc files. For Unix there is one special way to comment a line, that allows making a Vim script executable: > #!/usr/bin/env vim -S echo "this is a Vim script" quit The "#" command by itself lists a line with the line number. Adding an exclamation mark changes it into doing nothing, so that you can add the shell command to execute the rest of the file. |:#!| |-S| 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 the 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.11* 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 lying 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 43 unlet 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("g:loaded_typecorr") 7 finish 8 endif 9 let g: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. The name is recommended to start with "loaded_" and then the file name of the plugin, literally. The "g:" is prepended just to avoid mistakes when using the variable in a function (without "g:" it would be a variable local to the function). Using "finish" stops Vim from reading the rest of the file, it's much quicker than using if-endif around the whole file. 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("g:loaded_typecorr") 7 finish 8 endif 9 let g: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 43 unlet 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.12* 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.11|. 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 is 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 makes sure the function is only defined once: > :if !exists("*s:Func") : function s:Func(arg) : ... : endfunction :endif < UNDO *undo_indent* *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|. For undoing the effect of an indent script, the b:undo_indent variable should be set accordingly. 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.13* 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. *:CompilerSet* 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. ============================================================================== *41.14* Writing a plugin that loads quickly *write-plugin-quickload* A plugin may grow and become quite long. The startup delay may become noticeable, while you hardly ever use the plugin. Then it's time for a quickload plugin. The basic idea is that the plugin is loaded twice. The first time user commands and mappings are defined that offer the functionality. The second time the functions that implement the functionality are defined. It may sound surprising that quickload means loading a script twice. What we mean is that it loads quickly the first time, postponing the bulk of the script to the second time, which only happens when you actually use it. When you always use the functionality it actually gets slower! Note that since Vim 7 there is an alternative: use the |autoload| functionality |41.15|. The following example shows how it's done: > " Vim global plugin for demonstrating quick loading " Last Change: 2005 Feb 25 " Maintainer: Bram Moolenaar <Bram@vim.org> " License: This file is placed in the public domain. if !exists("s:did_load") command -nargs=* BNRead call BufNetRead(<f-args>) map <F19> :call BufNetWrite('something')<CR> let s:did_load = 1 exe 'au FuncUndefined BufNet* source ' . expand('<sfile>') finish endif function BufNetRead(...) echo 'BufNetRead(' . string(a:000) . ')' " read functionality here endfunction function BufNetWrite(...) echo 'BufNetWrite(' . string(a:000) . ')' " write functionality here endfunction When the script is first loaded "s:did_load" is not set. The commands between the "if" and "endif" will be executed. This ends in a |:finish| command, thus the rest of the script is not executed. The second time the script is loaded "s:did_load" exists and the commands after the "endif" are executed. This defines the (possible long) BufNetRead() and BufNetWrite() functions. If you drop this script in your plugin directory Vim will execute it on startup. This is the sequence of events that happens: 1. The "BNRead" command is defined and the <F19> key is mapped when the script is sourced at startup. A |FuncUndefined| autocommand is defined. The ":finish" command causes the script to terminate early. 2. The user types the BNRead command or presses the <F19> key. The BufNetRead() or BufNetWrite() function will be called. 3. Vim can't find the function and triggers the |FuncUndefined| autocommand event. Since the pattern "BufNet*" matches the invoked function, the command "source fname" will be executed. "fname" will be equal to the name of the script, no matter where it is located, because it comes from expanding "<sfile>" (see |expand()|). 4. The script is sourced again, the "s:did_load" variable exists and the functions are defined. Notice that the functions that are loaded afterwards match the pattern in the |FuncUndefined| autocommand. You must make sure that no other plugin defines functions that match this pattern. ============================================================================== *41.15* Writing library scripts *write-library-script* Some functionality will be required in several places. When this becomes more than a few lines you will want to put it in one script and use it from many scripts. We will call that one script a library script. Manually loading a library script is possible, so long as you avoid loading it when it's already done. You can do this with the |exists()| function. Example: > if !exists('*MyLibFunction') runtime library/mylibscript.vim endif call MyLibFunction(arg) Here you need to know that MyLibFunction() is defined in a script "library/mylibscript.vim" in one of the directories in 'runtimepath'. To make this a bit simpler Vim offers the autoload mechanism. Then the example looks like this: > call mylib#myfunction(arg) That's a lot simpler, isn't it? Vim will recognize the function name and when it's not defined search for the script "autoload/mylib.vim" in 'runtimepath'. That script must define the "mylib#myfunction()" function. You can put many other functions in the mylib.vim script, you are free to organize your functions in library scripts. But you must use function names where the part before the '#' matches the script name. Otherwise Vim would not know what script to load. If you get really enthusiastic and write lots of library scripts, you may want to use subdirectories. Example: > call netlib#ftp#read('somefile') For Unix the library script used for this could be: ~/.vim/autoload/netlib/ftp.vim Where the function is defined like this: > function netlib#ftp#read(fname) " Read the file fname through ftp endfunction Notice that the name the function is defined with is exactly the same as the name used for calling the function. And the part before the last '#' exactly matches the subdirectory and script name. You can use the same mechanism for variables: > let weekdays = dutch#weekdays This will load the script "autoload/dutch.vim", which should contain something like: > let dutch#weekdays = ['zondag', 'maandag', 'dinsdag', 'woensdag', \ 'donderdag', 'vrijdag', 'zaterdag'] Further reading: |autoload|. ============================================================================== *41.16* Distributing Vim scripts *distribute-script* Vim users will look for scripts on the Vim website: http://www.vim.org. If you made something that is useful for others, share it! Vim scripts can be used on any system. There might not be a tar or gzip command. If you want to pack files together and/or compress them the "zip" utility is recommended. For utmost portability use Vim itself to pack scripts together. This can be done with the Vimball utility. See |vimball|. It's good if you add a line to allow automatic updating. See |glvs-plugins|. ============================================================================== Next chapter: |usr_42.txt| Add new menus Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/usr_42.txt�����������������������������������������������������������������0000664�0000000�0000000�00000032746�12677030670�0016720�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*usr_42.txt* For Vim version 7.4. Last change: 2008 May 05 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, except "M". You can remove a flag with a command like: > :set guioptions-=m < m When removed the menubar is not displayed. M When added 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 %:S -o %:r:S<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: ��������������������������vim-7.4.1689/runtime/doc/usr_43.txt�����������������������������������������������������������������0000664�0000000�0000000�00000016354�12677030670�0016716�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*usr_43.txt* For Vim version 7.4. Last change: 2015 Oct 23 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> let b:undo_ftplugin = "setl softtabstop< | unmap <buffer> <LocalLeader>c" 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 the "maplocalleader" variable. The line to set b:undo_ftplugin is for when the filetype is set to another value. In that case you will want to undo your preferences. The b:undo_ftplugin variable is executed as a command. Watch out for characters with a special meaning inside a string, such as a backslash. 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: ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/usr_44.txt�����������������������������������������������������������������0000664�0000000�0000000�00000070770�12677030670�0016721�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*usr_44.txt* For Vim version 7.4. Last change: 2008 Dec 28 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 parts of 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. A Perl script 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 and 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: > if exists("b:current_syntax") finish endif 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. To allow users select their own preferred colors, make a different group name for every kind of highlighted item. Then link each of them to one of the standard highlight groups. That will make it work with every color scheme. If you select specific colors it will look bad with some color schemes. And don't forget that some people use a different background color, or have only eight colors available. For the linking use "hi def link", so that the user can select different highlighting before your syntax file is loaded. Example: > hi def link nameString String hi def link nameNumber Number hi def link nameCommand Statement ... etc ... 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: ��������vim-7.4.1689/runtime/doc/usr_45.txt�����������������������������������������������������������������0000664�0000000�0000000�00000042770�12677030670�0016721�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*usr_45.txt* For Vim version 7.4. Last change: 2008 Nov 15 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/fonts/default.aspx ~ 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, since 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 "utf-16le". That means it's Unicode, 16-bit 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 over hundred thousand. 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: ��������vim-7.4.1689/runtime/doc/usr_90.txt�����������������������������������������������������������������0000664�0000000�0000000�00000042375�12677030670�0016722�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*usr_90.txt* For Vim version 7.4. Last change: 2008 Sep 10 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 you get "TEST FAILURE" some test failed. 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: �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/usr_toc.txt����������������������������������������������������������������0000664�0000000�0000000�00000022002�12677030670�0017240�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*usr_toc.txt* For Vim version 7.4. Last change: 2016 Mar 25 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 |usr_32.txt| The undo tree 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 |reference_toc| More detailed information for all commands 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 package |05.5| Adding a plugin |05.6| Adding a help file |05.7| The option window |05.8| 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 |usr_32.txt| The undo tree |32.1| Undo up to a file write |32.2| Numbering changes |32.3| Jumping around the tree |32.4| Time travelling ============================================================================== 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| Lists and Dictionaries |41.9| Exceptions |41.10| Various remarks |41.11| Writing a plugin |41.12| Writing a filetype plugin |41.13| Writing a compiler plugin |41.14| Writing a plugin that loads quickly |41.15| Writing library scripts |41.16| Distributing Vim scripts |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: ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/various.txt����������������������������������������������������������������0000664�0000000�0000000�00000064443�12677030670�0017271�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*various.txt* For Vim version 7.4. Last change: 2016 Mar 20 VIM REFERENCE MANUAL by Bram Moolenaar Various commands *various* 1. Various commands |various-cmds| 2. Using Vim like less or more |less| ============================================================================== 1. Various commands *various-cmds* *CTRL-L* CTRL-L Clear and redraw the screen. The redraw may happen later, after processing typeahead. *: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 ~ If the character has composing characters these are also shown. The value of 'maxcombine' doesn't matter. 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. The value of 'maxcombine' doesn't matter. Example of a character with two composing characters: e0 b8 81 + e0 b8 b9 + e0 b9 89 ~ {not in Vi} {only when compiled with the |+multi_byte| feature} *8g8* 8g8 Find an illegal UTF-8 byte sequence at or after the cursor. This works in two situations: 1. when 'encoding' is any 8-bit encoding 2. when 'encoding' is "utf-8" and 'fileencoding' is any 8-bit encoding Thus it can be used when editing a file that was supposed to be UTF-8 but was read as if it is an 8-bit encoding because it contains illegal bytes. Does not wrap around the end of the file. Note that when the cursor is on an illegal byte or the cursor is halfway a multi-byte character the command won't move the cursor. {not in Vi} {only when compiled with the |+multi_byte| feature} *:p* *:pr* *:print* *E749* :[range]p[rint] [flags] Print [range] lines (default current line). Note: If you are looking for a way to print your text on paper see |:hardcopy|. In the GUI you can use the File.Print menu entry. See |ex-flags| for [flags]. :[range]p[rint] {count} [flags] Print {count} lines, starting with [range] (default current line |cmdline-ranges|). See |ex-flags| for [flags]. *:P* *:Print* :[range]P[rint] [count] [flags] Just as ":print". Was apparently added to Vi for people that keep the shift key pressed too long... Note: A user command can overrule this command. See |ex-flags| for [flags]. *:l* *:list* :[range]l[ist] [count] [flags] Same as :print, but display unprintable characters with '^' and put $ after the line. This can be further changed with the 'listchars' option. See |ex-flags| for [flags]. *:nu* *:number* :[range]nu[mber] [count] [flags] Same as :print, but precede each line with its line number. (See also 'highlight' and 'numberwidth' option). See |ex-flags| for [flags]. *:#* :[range]# [count] [flags] synonym for :number. *:#!* :#!{anything} Ignored, so that you can start a Vim script with: > #!vim -S echo "this is a Vim script" quit < *: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; if there is only one window then twice the value of the 'scroll' option is used, otherwise the current window height minus 3 is used. If there is a {count} the 'window' option is set to its value. :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 cursor line ~ ---- ---------- --------- ------------ + 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 scr fwd = 1/2 scr 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} *:=* := [flags] Print the last line number. See |ex-flags| for [flags]. :{range}= [flags] Prints the last line number in {range}. For example, this prints the current line number: > :.= < See |ex-flags| for [flags]. :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} are executed like they are typed. For undo all commands are undone together. Execution stops when an error is encountered. If the [!] is given, mappings will not be used. Without it, when this command is called from a non-remappable mapping (|:noremap|), the argument can be mapped anyway. {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. This implies that an insert command must be completed (to start Insert mode, see |:startinsert|). A ":" command must be completed as well. And you can't use "Q" or "gQ" to start Ex mode. The display is not updated while ":normal" is busy. {commands} cannot start with a space. Put a count of 1 (one) before it, "1 " 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'. An alternative is to use |:execute|, which uses an expression as argument. This allows the use of printable characters to represent special characters. Example: > :exe "normal \<c-w>\<c-w>" < {not in Vi, of course} :{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} *: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 ! \!". A '|' in {cmd} is passed to the shell, you cannot use it to append a Vim command. See |:bar|. If {cmd} contains "%" it is expanded to the current file name. Special characters are not escaped, use quotes to avoid their special meaning: > :!ls "%" < If the file name contains a "$" single quotes might work better (but a single quote causes trouble): > :!ls '%' < This should always work, but it's more typing: > :exe "!ls " . shellescape(expand("%")) < 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|. After the command has been executed, the timestamp and size of the current file is checked |timestamp|. 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* *+acl* |ACL| support included *+ARP* Amiga only: ARP support included B *+arabic* |Arabic| language support N *+autocmd* |:autocmd|, automatic commands m *+balloon_eval* |balloon-eval| support. Included when compiling with supported GUI (Motif, GTK, GUI) and either Netbeans/Sun Workshop integration or |+eval| feature. 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. m *+channel* inter process communication |channel| 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 B *+conceal* "conceal" support, see |conceal| |:syn-conceal| etc. N *+cryptv* encryption support |encryption| B *+cscope* |cscope| support m *+cursorbind* |'cursorbind'| support m *+cursorshape* |termcap-cursor-shape| support m *+debug* Compiled for debugging. 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* m *+directx* Win32 GUI only: DirectX and |'renderoptions'| *+dnd* Support for DnD into the "~ register |quote_~|. B *+emacs_tags* |emacs-tags| files N *+eval* expression evaluation |eval.txt| N *+ex_extra* always on now, used to be for Vim's extra Ex commands 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 *+float* Floating point support N *+gettext* message translations |multi-lang| *+GUI_Athena* Unix only: Athena |GUI| *+GUI_neXtaw* Unix only: neXtaw |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 *+iconv/dyn* Likewise |iconv-dynamic| |/dyn| N *+insert_expand* |insert_expand| Insert mode completion m *+job* starting and stopping jobs |job| 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| m *+lua* |Lua| interface m *+lua/dyn* |Lua| interface |/dyn| 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| N *+mouse_jsbterm* JSB mouse handling |jsbterm-mouse| B *+mouse_netterm* Unix only: netterm mouse handling |netterm-mouse| N *+mouse_pterm* QNX only: pterm mouse handling |qnx-terminal| N *+mouse_sysmouse* Unix only: *BSD console mouse handling |sysmouse| B *+mouse_sgr* Unix only: sgr mouse handling |sgr-mouse| B *+mouse_urxvt* Unix only: urxvt mouse handling |urxvt-mouse| N *+mouse_xterm* Unix only: xterm mouse handling |xterm-mouse| N *+multi_byte* 16 and 32 bit characters |multibyte| *+multi_byte_ime* Win32 input method for multibyte chars |multibyte-ime| N *+multi_lang* non-English language support |multi-lang| m *+mzscheme* Mzscheme interface |mzscheme| m *+mzscheme/dyn* Mzscheme interface |mzscheme-dynamic| |/dyn| m *+netbeans_intg* |netbeans| m *+ole* Win32 GUI only: |ole-interface| N *+path_extra* Up/downwards search in 'path' and 'tags' m *+perl* Perl interface |perl| m *+perl/dyn* Perl interface |perl-dynamic| |/dyn| N *+persistent_undo* Persistent undo |undo-persistence| *+postscript* |:hardcopy| writes a PostScript file N *+printer* |:hardcopy| command H *+profile* |:profile| command m *+python* Python 2 interface |python| m *+python/dyn* Python 2 interface |python-dynamic| |/dyn| m *+python3* Python 3 interface |python| m *+python3/dyn* Python 3 interface |python-dynamic| |/dyn| N *+quickfix* |:make| and |quickfix| commands N *+reltime* |reltime()| function, 'hlsearch'/'incsearch' timeout, 'redrawtime' option B *+rightleft* Right to left typing |'rightleft'| m *+ruby* Ruby interface |ruby| m *+ruby/dyn* Ruby interface |ruby-dynamic| |/dyn| N *+scrollbind* |'scrollbind'| B *+signs* |:sign| N *+smartindent* |'smartindent'| N *+startuptime* |--startuptime| argument 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| m *+tcl/dyn* Tcl interface |tcl-dynamic| |/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 *+timers* the |timer_start()| function N *+title* Setting the window 'title' and 'icon' 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| Always enabled since 7.4.200. 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| *+xpm* pixmap support m *+xpm_w32* Win32 GUI only: pixmap support |w32-xpm-support| *+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()". An alternative is to use the 'verbosefile' option, this can be used in combination with ":redir". {not in Vi} :redi[r] >> {file} Redirect messages to file {file}. Append if {file} already exists. {not in Vi} :redi[r] @{a-zA-Z} :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}. The ">" after the register name is optional. {not in Vi} :redi[r] @{a-z}>> Append messages to register {a-z}. {not in Vi} :redi[r] @*> :redi[r] @+> Redirect messages to the selection or clipboard. For backward compatibility, the ">" after the register name can be omitted. See |quotestar| and |quoteplus|. {not in Vi} :redi[r] @*>> :redi[r] @+>> Append messages to the selection or clipboard. {not in Vi} :redi[r] @"> Redirect messages to the unnamed register. For backward compatibility, the ">" after the register name can be omitted. {not in Vi} :redi[r] @">> Append messages to the unnamed register. {not in Vi} :redi[r] => {var} Redirect messages to a variable. If the variable doesn't exist, then it is created. If the variable exists, then it is initialized to an empty string. The variable will remain empty until redirection ends. Only string variables can be used. After the redirection starts, if the variable is removed or locked or the variable type is changed, then further command output messages will cause errors. {not in Vi} :redi[r] =>> {var} Append messages to an existing variable. Only string variables can be used. {not in Vi} :redi[r] END End redirecting messages. {not in Vi} *:sil* *:silent* *: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". *:uns* *:unsilent* :uns[ilent] {command} Execute {command} not silently. Only makes a difference when |:silent| was used to get to this command. Use this for giving a message even when |:silent| was used. In this example |:silent| is used to avoid the message about reading the file and |:unsilent| to be able to list the first line of each file. > :silent argdo unsilent echo expand('%') . ": " . getline(1) < *:verb* *:verbose* :[count]verb[ose] {command} Execute {command} with 'verbose' set to [count]. If [count] is omitted one is used. ":0verbose" can be used to set 'verbose' to zero. 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 ~ For logging verbose messages in a file use the 'verbosefile' option. *:verbose-cmd* When 'verbose' is non-zero, listing the value of a Vim option or a key map or an abbreviation or a user-defined function or a command or a highlight group or an autocommand will also display where it was last defined. If it was defined manually then there will be no "Last set" message. When it was defined while executing a function, user command or autocommand, the script in which it was defined is reported. {not available when compiled without the |+eval| feature} *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 at a visible position. {not in Vi} Also process the received netbeans messages. {only available when compiled with the |+netbeans_intg| feature} *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. For incrementing in Visual mode see |v_g_CTRL-A|. ============================================================================== 2. 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. If you want to set options differently when using less, define the LessInitFunc in your vimrc, for example: > func LessInitFunc() set nocursorcolumn nocursorline endfunc < vim:tw=78:ts=8:ft=help:norl: �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/version4.txt���������������������������������������������������������������0000664�0000000�0000000�00000033122�12677030670�0017340�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*version4.txt* For Vim version 7.4. Last change: 2006 Apr 24 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: ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/version5.txt���������������������������������������������������������������0000664�0000000�0000000�00001132477�12677030670�0017357�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*version5.txt* For Vim version 7.4. Last change: 2016 Feb 27 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 an 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) 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. 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 with ":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 interruptible. "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 at 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 whether 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 interruptible. 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 derivatives "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 screenful), "u" (half a screenful) 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 character 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 presence 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: �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/version6.txt���������������������������������������������������������������0000664�0000000�0000000�00002147027�12677030670�0017356�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*version6.txt* For Vim version 7.4. Last change: 2014 Aug 29 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| VERSION 6.4 |version-6.4| Changed |changed-6.4| Added |added-6.4| Fixed |fixed-6.4| ============================================================================== 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. 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". (Marcin 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: (Marcin 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-LessTif. - 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 its 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. (Marcin 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. (Marcin 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. (Marcin 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. It'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 loses 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 instead 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 it's 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 with 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 last 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 instead 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 a 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 cp1250 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" instead 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 Griffis) 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 clipboard 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 encodings. (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. (Dominique 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. (Jonathan 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 still 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 typeahead 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 typeahead 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(). (Benot 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 initialized 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 reloaded 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 journaling 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 ============================================================================== VERSION 6.4 *version-6.4* This section is about improvements made between version 6.3 and 6.4. This is a bug-fix release. There are also a few new features. The major number of new items is in the runtime files and translations. The big MS-Windows version now uses: Ruby version 1.8.3 Perl version 5.8.7 Python version 2.4.2 Changed *changed-6.4* ------- Removed runtime/tools/tcltags, Exuberant ctags does it better. Added *added-6.4* ----- Alsaconf syntax file (Nikolai Weibull) Eruby syntax, indent, compiler and ftplugin file (Doug Kearns) Esterel syntax file (Maurizio Tranchero) Mathematica indent file (Steve Layland) Netrc syntax file (Nikolai Weibull) PHP compiler file (Doug Kearns) Pascal indent file (Neil Carter) Prescribe syntax file (Klaus Muth) Rubyunit compiler file (Doug Kearns) SMTPrc syntax file (Kornel Kielczewski) Sudoers syntax file (Nikolai Weibull) TPP syntax file (Gerfried Fuchs) VHDL ftplugin file (R. Shankar) Verilog-AMS syntax file (S. Myles Prather) Bulgarian keymap (Alberto Mardegan) Canadian keymap (Eric Joanis) Hungarian menu translations in UTF-8 (Kantra Gergely) Ukrainian menu translations (Bohdan Vlasyuk) Irish message translations (Kevin Patrick Scannell) Configure also checks for tclsh8.4. Fixed *fixed-6.4* ----- "dFxd;" deleted the character under the cursor, "d;" didn't remember the exclusiveness of the motion. When using "set laststatus=2 cmdheight=2" in the .gvimrc you may only get one line for the cmdline. (Christian Robinson) Invoke command_height() after the GUI has started up. Gcc would warn "dereferencing type-punned pointer will break strict -aliasing rules". Avoid using typecasts for variable pointers. Gcc 3.x interprets the -MM argument differently. Change "-I /path" to "-isystem /path" for "make depend". Patch 6.3.001 Problem: ":browse split" gives the file selection dialog twice. (Gordon Bazeley) Same problem for ":browse diffpatch". Solution: Reset cmdmod.browse before calling do_ecmd(). Files: src/diff.c, src/ex_docmd.c Patch 6.3.002 Problem: When using translated help files with non-ASCII latin1 characters in the first line the utf-8 detection is wrong. Solution: Properly detect utf-8 characters. When a mix of encodings is detected continue with the next language and avoid a "no matches" error because of "got_int" being set. Add the directory name to the error message for a duplicate tag. Files: src/ex_cmds.c Patch 6.3.003 Problem: Crash when using a console dialog and the first choice does not have a default button. (Darin Ohashi) Solution: Allocate two more characters for the [] around the character for the default choice. Files: src/message.c Patch 6.3.004 Problem: When searching for a long string (140 chars in a 80 column terminal) get three hit-enter prompts. (Robert Webb) Solution: Avoid the hit-enter prompt when giving the message for wrapping around the end of the buffer. Don't give that message again when the string was not found. Files: src/message.c, src/search.c Patch 6.3.005 Problem: Crash when searching for a pattern with a character offset and starting in a closed fold. (Frank Butler) Solution: Check for the column to be past the end of the line. Also fix that a pattern with a character offset relative to the end isn't read back from the viminfo properly. Files: src/search.c Patch 6.3.006 Problem: ":breakadd file *foo" prepends the current directory to the file pattern. (Hari Krishna Dara) Solution: Keep the pattern as-is. Files: src/ex_cmds2.c Patch 6.3.007 Problem: When there is a buffer with 'buftype' set to "nofile" and using a ":cd" command, the swap file is not deleted when exiting. Solution: Use the full path of the swap file also for "nofile" buffers. Files: src/fileio.c Patch 6.3.008 Problem: Compiling fails under OS/2. Solution: Include "e_screenmode" also for OS/2. (David Sanders) Files: src/globals.h Patch 6.3.009 (after 6.3.006) Problem: ":breakadd file /path/foo.vim" does not match when a symbolic link is involved. (Servatius Brandt) Solution: Do expand the pattern when it does not start with "*". Files: runtime/doc/repeat.txt, src/ex_cmds2.c Patch 6.3.010 Problem: When writing to a named pipe there is an error for fsync() failing. Solution: Ignore the fsync() error for devices. Files: src/fileio.c Patch 6.3.011 Problem: Crash when the completion function of a user-command uses a "normal :cmd" command. (Hari Krishna Dara) Solution: Save the command line when invoking the completion function. Files: src/ex_getln.c Patch 6.3.012 Problem: Internal lalloc(0) error when using a complicated multi-line pattern in a substitute command. (Luc Hermitte) Solution: Avoid going past the end of a line. Files: src/ex_cmds.c Patch 6.3.013 Problem: Crash when editing a command line and typing CTRL-R = to evaluate a function that uses "normal :cmd". (Hari Krishna Dara) Solution: Save and restore the command line when evaluating an expression for CTRL-R =. Files: src/ex_getln.c, src/ops.c, src/proto/ex_getln.pro, src/proto/ops.pro Patch 6.3.014 Problem: When using Chinese or Taiwanese the default for 'helplang' is wrong. (Simon Liang) Solution: Use the part of the locale name after "zh_". Files: src/option.c Patch 6.3.015 Problem: The string that winrestcmd() returns may end in garbage. Solution: NUL-terminate the string. (Walter Briscoe) Files: src/eval.c Patch 6.3.016 Problem: The default value for 'define' has "\s" before '#'. Solution: Add a star after "\s". (Herculano de Lima Einloft Neto) Files: src/option.c Patch 6.3.017 Problem: "8zz" may leave the cursor beyond the end of the line. (Niko Maatjes) Solution: Correct the cursor column after moving to another line. Files: src/normal.c Patch 6.3.018 Problem: ":0argadd zero" added the argument after the first one, instead of before it. (Adri Verhoef) Solution: Accept a zero range for ":argadd". Files: src/ex_cmds.h Patch 6.3.019 Problem: Crash in startup for debug version. (David Rennals) Solution: Move the call to nbdebug_wait() to after allocating NameBuff. Files: src/main.c Patch 6.3.020 Problem: When 'encoding' is "utf-8" and 'delcombine' is set, "dw" does not delete a word but only a combining character of the first character, if there is one. (Raphael Finkel) Solution: Correctly check that one character is being deleted. Files: src/misc1.c Patch 6.3.021 Problem: When the last character of a file name is a multi-byte character and the last byte is a path separator, the file cannot be edited. Solution: Check for the last byte to be part of a multi-byte character. (Taro Muraoka) Files: src/fileio.c Patch 6.3.022 (extra) Problem: Win32: When the last character of a file name is a multi-byte character and the last byte is a path separator, the file cannot be written. A trail byte that is a space makes that a file cannot be opened from the command line. Solution: Recognize double-byte characters when parsing the command line. In mch_stat() check for the last byte to be part of a multi-byte character. (Taro Muraoka) Files: src/gui_w48.c, src/os_mswin.c Patch 6.3.023 Problem: When the "to" part of a mapping starts with its "from" part, abbreviations for the same characters is not possible. For example, when <Space> is mapped to something that starts with a space, typing <Space> does not expand abbreviations. Solution: Only disable expanding abbreviations when a mapping is not remapped, don't disable it when the RHS of a mapping starts with the LHS. Files: src/getchar.c, src/vim.h Patch 6.3.024 Problem: In a few places a string in allocated memory is not terminated with a NUL. Solution: Add ga_append(NUL) in script_get(), gui_do_findrepl() and serverGetVimNames(). Files: src/ex_getln.c, src/gui.c, src/if_xcmdsrv.c, src/os_mswin.c Patch 6.3.025 (extra) Problem: Missing NUL for list of server names. Solution: Add ga_append(NUL) in serverGetVimNames(). Files: src/os_mswin.c Patch 6.3.026 Problem: When ~/.vim/after/syntax/syncolor.vim contains a command that reloads the colors an endless loop and/or a crash may occur. Solution: Only free the old value of an option when it was originally allocated. Limit recursiveness of init_highlight() to 5 levels. Files: src/option.c, src/syntax.c Patch 6.3.027 Problem: VMS: Writing a file may insert extra CR characters. Not all terminals are recognized correctly. Vt320 doesn't support colors. Environment variables are not expanded correctly. Solution: Use another method to write files. Add vt320 termcap codes for colors. (Zoltan Arpadffy) Files: src/fileio.c, src/misc1.c, src/os_unix.c, src/structs.h, src/term.c Patch 6.3.028 Problem: When appending to a file the BOM marker may be written. (Alex Jakushev) Solution: Do not write the BOM marker when appending. Files: src/fileio.c Patch 6.3.029 Problem: Crash when inserting a line break. (Walter Briscoe) Solution: In the syntax highlighting code, don't use an old state after a change was made, current_col may be past the end of the line. Files: src/syntax.c Patch 6.3.030 Problem: GTK 2: Crash when sourcing a script that deletes the menus, sets 'encoding' to "utf-8" and loads the menus again. GTK error message when tooltip text is in a wrong encoding. Solution: Don't copy characters from the old screen to the new screen when switching 'encoding' to utf-8, they may be invalid. Only set the tooltip when it is valid utf-8. Files: src/gui_gtk.c, src/mbyte.c, src/proto/mbyte.pro, src/screen.c Patch 6.3.031 Problem: When entering a mapping and pressing Tab halfway the command line isn't redrawn properly. (Adri Verhoef) Solution: Reposition the cursor after drawing over the "..." of the completion attempt. Files: src/ex_getln.c Patch 6.3.032 Problem: Using Python 2.3 with threads doesn't work properly. Solution: Release the lock after initialization. Files: src/if_python.c Patch 6.3.033 Problem: When a mapping ends in a Normal mode command of more than one character Vim doesn't return to Insert mode. Solution: Check that the mapping has ended after obtaining all characters of the Normal mode command. Files: src/normal.c Patch 6.3.034 Problem: VMS: crash when using ":help". Solution: Avoid using "tags-??", some Open VMS systems can't handle the "?" wildcard. (Zoltan Arpadffy) Files: src/tag.c Patch 6.3.035 (extra) Problem: RISC OS: Compile errors. Solution: Change e_screnmode to e_screenmode. Change the way __riscosify_control is set. Improve the makefile. (Andy Wingate) Files: src/os_riscos.c, src/search.c, src/Make_ro.mak Patch 6.3.036 Problem: ml_get errors when the whole file is a fold, switching 'foldmethod' and doing "zj". (Christian J. Robinson) Was not deleting the fold but creating a fold with zero lines. Solution: Delete the fold properly. Files: src/fold.c Patch 6.3.037 (after 6.3.032) Problem: Warning for unused variable. Solution: Change the #ifdefs for the saved thread stuff. Files: src/if_python.c Patch 6.3.038 (extra) Problem: Win32: When the "file changed" dialog pops up after a click that gives gvim focus and not moving the mouse after that, the effect of the click may occur when moving the mouse later. (Ken Clark) Happened because the release event was missed. Solution: Clear the s_button_pending variable when any input is received. Files: src/gui_w48.c Patch 6.3.039 Problem: When 'number' is set and inserting lines just above the first displayed line (in another window on the same buffer), the line numbers are not updated. (Hitier Sylvain) Solution: When 'number' is set and lines are inserted/deleted redraw all lines below the change. Files: src/screen.c Patch 6.3.040 Problem: Error handling does not always work properly and may cause a buffer to be marked as if it's viewed in a window while it isn't. Also when selecting "Abort" at the attention prompt. Solution: Add enter_cleanup() and leave_cleanup() functions to move saving/restoring things for error handling to one place. Clear a buffer read error when it's unloaded. Files: src/buffer.c, src/ex_docmd.c, src/ex_eval.c, src/proto/ex_eval.pro, src/structs.h, src/vim.h Patch 6.3.041 (extra) Problem: Win32: When the path to a file has Russian characters, ":cd %:p:h" doesn't work. (Valery Kondakoff) Solution: Use a wide function to change directory. Files: src/os_mswin.c Patch 6.3.042 Problem: When there is a closed fold at the top of the window, CTRL-X CTRL-E in Insert mode reduces the size of the fold instead of scrolling the text up. (Gautam) Solution: Scroll over the closed fold. Files: src/move.c Patch 6.3.043 Problem: 'hlsearch' highlighting sometimes disappears when inserting text in PHP code with syntax highlighting. (Marcel Svitalsky) Solution: Don't use pointers to remember where a match was found, use an index. The pointers may become invalid when searching in other lines. Files: src/screen.c Patch 6.3.044 (extra) Problem: Mac: When 'linespace' is non-zero the Insert mode cursor leaves pixels behind. (Richard Sandilands) Solution: Erase the character cell before drawing the text when needed. Files: src/gui_mac.c Patch 6.3.045 Problem: Unusual characters in an option value may cause unexpected behavior, especially for a modeline. (Ciaran McCreesh) Solution: Don't allow setting termcap options or 'printdevice' in a modeline. Don't list options for "termcap" and "all" in a modeline. Don't allow unusual characters in 'filetype', 'syntax', 'backupext', 'keymap', 'patchmode' and 'langmenu'. Files: src/option.c, runtime/doc/options.txt Patch 6.3.046 Problem: ":registers" doesn't show multi-byte characters properly. (Valery Kondakoff) Solution: Get the length of each character before displaying it. Files: src/ops.c Patch 6.3.047 (extra) Problem: Win32 with Borland C 5.5 on Windows XP: A new file is created with read-only attributes. (Tony Mechelynck) Solution: Don't use the _wopen() function for Borland. Files: src/os_win32.c Patch 6.3.048 (extra) Problem: Build problems with VMS on IA64. Solution: Add dependencies to the build file. (Zoltan Arpadffy) Files: src/Make_vms.mms Patch 6.3.049 (after 6.3.045) Problem: Compiler warning for "char" vs "char_u" mixup. (Zoltan Arpadffy) Solution: Add a typecast. Files: src/option.c Patch 6.3.050 Problem: When SIGHUP is received while busy exiting, non-reentrant functions such as free() may cause a crash. Solution: Ignore SIGHUP when exiting because of an error. (Scott Anderson) Files: src/misc1.c, src/main.c Patch 6.3.051 Problem: When 'wildmenu' is set and completed file names contain multi-byte characters Vim may crash. Solution: Reserve room for multi-byte characters. (Yasuhiro Matsumoto) Files: src/screen.c Patch 6.3.052 (extra) Problem: Windows 98: typed keys that are not ASCII may not work properly. For example with a Russian input method. (Jiri Jezdinsky) Solution: Assume that the characters arrive in the current codepage instead of UCS-2. Perform conversion based on that. Files: src/gui_w48.c Patch 6.3.053 Problem: Win32: ":loadview" cannot find a file with non-ASCII characters. (Valerie Kondakoff) Solution: Use mch_open() instead of open() to open the file. Files: src/ex_cmds2.c Patch 6.3.054 Problem: When 'insertmode' is set <C-L>4ixxx<C-L> hangs Vim. (Jens Paulus) Vim is actually still working but redraw is disabled. Solution: When stopping Insert mode with CTRL-L don't put an Esc in the redo buffer but a CTRL-L. Files: src/edit.c Patch 6.3.055 (after 6.3.013) Problem: Can't use getcmdline(), getcmdpos() or setcmdpos() with <C-R>= when editing a command line. Using <C-\>e may crash Vim. (Peter Winters) Solution: When moving ccline out of the way for recursive use, make it available to the functions that need it. Also save and restore ccline when calling get_expr_line(). Make ccline.cmdbuf NULL at the end of getcmdline(). Files: src/ex_getln.c Patch 6.3.056 Problem: The last characters of a multi-byte file name may not be displayed in the window title. Solution: Avoid to remove a multi-byte character where the last byte looks like a path separator character. (Yasuhiro Matsumoto) Files: src/buffer.c, src/ex_getln.c Patch 6.3.057 Problem: When filtering lines folds are not updated. (Carl Osterwisch) Solution: Update folds for filtered lines. Files: src/ex_cmds.c Patch 6.3.058 Problem: When 'foldcolumn' is equal to the window width and 'wrap' is on Vim may crash. Disabling the vertical split feature breaks compiling. (Peter Winters) Solution: Check for zero room for wrapped text. Make compiling without vertical splits possible. Files: src/move.c, src/quickfix.c, src/screen.c, src/netbeans.c Patch 6.3.059 Problem: Crash when expanding an ":edit" command containing several spaces with the shell. (Brian Hirt) Solution: Allocate enough space for the quotes. Files: src/os_unix.c Patch 6.3.060 Problem: Using CTRL-R CTRL-O in Insert mode with an invalid register name still causes something to be inserted. Solution: Check the register name for being valid. Files: src/edit.c Patch 6.3.061 Problem: When editing a utf-8 file in an utf-8 xterm and there is a multi-byte character in the last column, displaying is messed up. (Jol Rio) Solution: Check for a multi-byte character, not a multi-column character. Files: src/screen.c Patch 6.3.062 Problem: ":normal! gQ" hangs. Solution: Quit getcmdline() and do_exmode() when out of typeahead. Files: src/ex_getln.c, src/ex_docmd.c Patch 6.3.063 Problem: When a CursorHold autocommand changes to another window (temporarily) 'mousefocus' stops working. Solution: Call gui_mouse_correct() after triggering CursorHold. Files: src/gui.c Patch 6.3.064 Problem: line2byte(line("$") + 1) sometimes returns the wrong number. (Charles Campbell) Solution: Flush the cached line before counting the bytes. Files: src/memline.c Patch 6.3.065 Problem: The euro digraph doesn't always work. Solution: Add an "e=" digraph for Unicode euro character and adjust the help files. Files: src/digraph.c, runtime/doc/digraph.txt Patch 6.3.066 Problem: Backup file may get wrong permissions. Solution: Use permissions of original file for backup file in more places. Files: src/fileio.c Patch 6.3.067 (after 6.3.066) Problem: Newly created file gets execute permission. Solution: Check for "perm" to be negative before using it. Files: src/fileio.c Patch 6.3.068 Problem: When editing a compressed file xxx.gz which is a symbolic link to the actual file a ":write" renames the link. Solution: Resolve the link, so that the actual file is renamed and compressed. Files: runtime/plugin/gzip.vim Patch 6.3.069 Problem: When converting text with illegal characters Vim may crash. Solution: Avoid that too much is subtracted from the length. (Da Woon Jung) Files: src/mbyte.c Patch 6.3.070 Problem: After ":set number linebreak wrap" and a vertical split, moving the vertical separator far left will crash Vim. (Georg Dahn) Solution: Avoid dividing by zero. Files: src/charset.c Patch 6.3.071 Problem: The message for CTRL-X mode is still displayed after an error for 'thesaurus' or 'dictionary' being empty. Solution: Clear "edit_submode". Files: src/edit.c Patch 6.3.072 Problem: Crash in giving substitute message when language is Chinese and encoding is utf-8. (Yongwei) Solution: Make the msg_buf size larger when using multi-byte. Files: src/vim.h Patch 6.3.073 Problem: Win32 GUI: When the Vim window is partly above or below the screen, scrolling causes display errors when the taskbar is not on that side. Solution: Use the SW_INVALIDATE flag when the Vim window is partly below or above the screen. Files: src/gui_w48.c Patch 6.3.074 Problem: When mswin.vim is used and 'insertmode' is set, typing text in Select mode and then using CTRL-V results in <SNR>99_Pastegi. (Georg Dahn) Solution: When restart_edit is set use "d" instead of "c" to remove the selected text to avoid calling edit() twice. Files: src/normal.c Patch 6.3.075 Problem: After unloading another buffer, syntax highlighting in the current buffer may be wrong when it uses "containedin". (Eric Arnold) Solution: Use "buf" instead of "curbuf" in syntax_clear(). Files: src/syntax.c Patch 6.3.076 Problem: Crash when using cscope and there is a parse error (e.g., line too long). (Alexey I. Froloff) Solution: Pass the actual number of matches to cs_manage_matches() and correctly handle the error situation. Files: src/if_cscope.c Patch 6.3.077 (extra) Problem: VMS: First character input after ESC was not recognized. Solution: Added TRM$M_TM_TIMED in vms_read(). (Zoltan Arpadffy) Files: src/os_vms.c Patch 6.3.078 (extra, after 6.3.077) Problem: VMS: Performance issue after patch 6.3.077 Solution: Add a timeout in the itemlist. (Zoltan Arpadffy) Files: src/os_vms.c Patch 6.3.079 Problem: Crash when executing a command in the command line window while syntax highlighting is enabled. (Pero Brbora) Solution: Don't use a pointer to a buffer that has been deleted. Files: src/syntax.c Patch 6.3.080 (extra) Problem: Win32: With 'encoding' set to utf-8 while the current codepage is Chinese editing a file with some specific characters in the name fails. Solution: Use _wfullpath() instead of _fullpath() when necessary. Files: src/os_mswin.c Patch 6.3.081 Problem: Unix: glob() may execute a shell command when it's not wanted. (Georgi Guninski) Solution: Verify the sandbox flag is not set. Files: src/os_unix.c Patch 6.3.082 (after 6.3.081) Problem: Unix: expand() may execute a shell command when it's not wanted. (Georgi Guninski) Solution: A more generic solution than 6.3.081. Files: src/os_unix.c Patch 6.3.083 Problem: VMS: The vt320 termcap entry is incomplete. Solution: Add missing function keys. (Zoltan Arpadffy) Files: src/term.c Patch 6.3.084 (extra) Problem: Cygwin: compiling with DEBUG doesn't work. Perl path was ignored. Failure when $(OUTDIR) already exists. "po" makefile is missing. Solution: Use changes tested in Vim 7. (Tony Mechelynck) Files: src/Make_cyg.mak, src/po/Make_cyg.mak Patch 6.3.085 Problem: Crash in syntax highlighting code. (Marc Espie) Solution: Prevent current_col going past the end of the line. Files: src/syntax.c Patch 6.3.086 (extra) Problem: Can't produce message translation file with msgfmt that checks printf strings. Solution: Fix the Russian translation. Files: src/po/ru.po, src/po/ru.cp1251.po Patch 6.3.087 Problem: MS-DOS: Crash. (Jason Hood) Solution: Don't call fname_case() with a NULL pointer. Files: src/ex_cmds.c Patch 6.3.088 Problem: Editing ".in" causes error E218. (Stefan Karlsson) Solution: Require some characters before ".in". Same for ".orig" and others. Files: runtime/filetype.vim Patch 6.3.089 Problem: A session file doesn't work when created while the current directory contains a space or the directory of the session files contains a space. (Paolo Giarrusso) Solution: Escape spaces with a backslash. Files: src/ex_docmd.c Patch 6.3.090 Problem: A very big value for 'columns' or 'lines' may cause a crash. Solution: Limit the values to 10000 and 1000. Files: src/option.c Patch 6.4a.001 Problem: The Unix Makefile contained too many dependencies and a few uncommented lines. Solution: Run "make depend" with manual changes to avoid a gcc incompatibility. Comment a few lines. Files: src/Makefile Patch 6.4b.001 Problem: Vim reports "Vim 6.4a" in the ":version" output. Solution: Change "a" to "b". (Tony Mechelynck) Files: src/version.h Patch 6.4b.002 Problem: In Insert mode, pasting a multi-byte character after the end of the line leaves the cursor just before that character. Solution: Make sure "gP" leaves the cursor in the right place when 'virtualedit' is set. Files: src/ops.c Patch 6.4b.003 (after 6.4b.002) Problem: The problem still exists when 'encoding' is set to "cp936". Solution: Fix the problem in getvvcol(), compute the coladd field correctly. Files: src/charset.c, src/ops.c Patch 6.4b.004 Problem: Selecting a {} block with "viB" includes the '}' when there is an empty line before it. Solution: Don't advance the cursor to include a line break when it's already at the line break. Files: src/search.c vim:tw=78:ts=8:ft=help:norl: ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/version7.txt���������������������������������������������������������������0000664�0000000�0000000�00002445770�12677030670�0017365�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*version7.txt* For Vim version 7.4. Last change: 2014 Aug 29 VIM REFERENCE MANUAL by Bram Moolenaar *vim7* *version-7.0* *version7.0* 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 since Vim 6.x. Use this command to see the version you are using: > :version 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| Vim script enhancements |new-vim-script| Spell checking |new-spell| Omni completion |new-omni-completion| MzScheme interface |new-MzScheme| Printing multi-byte text |new-print-multi-byte| Tab pages |new-tab-pages| Undo branches |new-undo-branches| Extended Unicode support |new-more-unicode| More highlighting |new-more-highlighting| Translated manual pages |new-manpage-trans| Internal grep |new-vimgrep| Scroll back in messages |new-scroll-back| Cursor past end of the line |new-onemore| POSIX compatibility |new-posix| Debugger support |new-debug-support| Remote file explorer |new-netrw-explore| Define an operator |new-define-operator| Mapping to an expression |new-map-expression| Visual and Select mode mappings |new-map-select| Location list |new-location-list| Various new items |new-items-7| IMPROVEMENTS |improvements-7| COMPILE TIME CHANGES |compile-changes-7| BUG FIXES |bug-fixes-7| VERSION 7.1 |version-7.1| Changed |changed-7.1| Added |added-7.1| Fixed |fixed-7.1| VERSION 7.2 |version-7.2| Changed |changed-7.2| Added |added-7.2| Fixed |fixed-7.2| VERSION 7.3 |version-7.3| Persistent undo |new-persistent-undo| More encryption |new-more-encryption| Conceal text |new-conceal| Lua interface |new-lua| Python3 interface |new-python3| Changed |changed-7.3| Added |added-7.3| Fixed |fixed-7.3| VERSION 7.4 |version-7.4| New regexp engine |new-regexp-engine| Better Python interface |better-python-interface| Changed |changed-7.4| Added |added-7.4| Fixed |fixed-7.4| ============================================================================== 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. A ":write file" command no longer resets the 'modified' flag of the buffer, unless the '+' flag is in 'cpoptions' |cpo-+|. This was illogical, since the buffer is still modified compared to the original file. And when undoing all changes the file would actually be marked modified. It does mean that ":quit" fails now. ":helpgrep" now uses a help window to display a match. In an argument list double quotes could be used to include spaces in a file name. This caused a difference between ":edit" and ":next" for escaping double quotes and it is incompatible with some versions of Vi. Command Vim 6.x file name Vim 7.x file name ~ :edit foo\"888 foo"888 foo"888 :next foo\"888 foo888 foo"888 :next a\"b c\"d ab cd a"b and c"d In a |literal-string| a single quote can be doubled to get one. ":echo 'a''b'" would result in "a b", but now that two quotes stand for one it results in "a'b". When overwriting a file with ":w! fname" there was no warning for when "fname" was being edited by another Vim. Vim now gives an error message |E768|. The support for Mac OS 9 has been removed. Files ending in .tex now have 'filetype' set to "context", "plaintex", or "tex". |ft-tex-plugin| Minor incompatibilities: For filetype detection: For many types, use */.dir/filename instead of ~/.dir/filename, so that it also works for other user's files. For quite a few filetypes the indent settings have been moved from the filetype plugin to the indent plugin. If you used: > :filetype plugin on Then some indent settings may be missing. You need to use: > :filetype plugin indent on ":0verbose" now sets 'verbose' to zero instead of one. Removed the old and incomplete "VimBuddy" code. Buffers without a name report "No Name" instead of "No File". It was confusing for buffers with a name and 'buftype' set to "nofile". When ":file xxx" is used in a buffer without a name, the alternate file name isn't set. This avoids creating buffers without a name, they are not useful. The "2html.vim" script now converts closed folds to HTML. This means the HTML looks like it's displayed, with the same folds open and closed. Use "zR", or "let html_ignore_folding=1", if no folds should appear in the HTML. (partly by Carl Osterwisch) Diff mode is now also converted to HTML as it is displayed. Win32: The effect of the <F10> key depended on 'winaltkeys'. Now it depends on whether <F10> has been mapped or not. This allows mapping <F10> without changing 'winaltkeys'. When 'octal' is in 'nrformats' and using CTRL-A on "08" it became "018", which is illogical. Now it becomes "9". The leading zero(s) is(are) removed to avoid the number becoming octal after incrementing "009" to "010". When 'encoding' is set to a Unicode encoding, the value for 'fileencodings' now includes "default" before "latin1". This means that for files with 8-bit encodings the default is to use the encoding specified by the environment, if possible. Previously latin1 would always be used, which is wrong in a non-latin1 environment, such as Russian. Previously Vim would exit when there are two windows, both of them displaying a help file, and using ":quit". Now only the window is closed. "-w {scriptout}" only works when {scriptout} doesn't start with a digit. Otherwise it's used to set the 'window' option. Previously <Home> and <xHome> could be mapped separately. This had the disadvantage that all mappings (with modifiers) had to be duplicated, since you can't be sure what the keyboard generates. Now all <xHome> are internally translated to <Home>, both for the keys and for mappings. Also for <xEnd>, <xF1>, etc. ":put" now leaves the cursor on the last inserted line. When a .gvimrc file exists then 'compatible' is off, just like when a ".vimrc" file exists. When making a string upper-case with "vlllU" or similar then the German sharp s is replaced with "SS". This does not happen with "~" to avoid backwards compatibility problems and because "SS" can't be changed back to a sharp s. "gd" previously found the very first occurrence of a variable in a function, that could be the function argument without type. Now it finds the position where the type is given. The line continuation in functions was not taken into account, line numbers in errors were logical lines, not lines in the sourced file. That made it difficult to locate errors. Now the line number in the sourced file is reported, relative to the function start. This also means that line numbers for ":breakadd func" are different. When defining a user command with |:command| the special items could be abbreviated. This caused unexpected behavior, such as <li> being recognized as <line1>. The items can no longer be abbreviated. When executing a FileChangedRO autocommand it is no longer allowed to switch to another buffer or edit another file. This is to prevent crashes (the event is triggered deep down in the code where changing buffers is not anticipated). It is still possible to reload the buffer. At the |more-prompt| and the |hit-enter-prompt|, when the 'more' option is set, the 'k', 'u', 'g' and 'b' keys are now used to scroll back to previous messages. Thus they are no longer used as typeahead. ============================================================================== NEW FEATURES *new-7* Vim script enhancements *new-vim-script* ----------------------- In Vim scripts the following types have been added: |List| ordered list of items |Dictionary| associative array of items |Funcref| reference to a function Many functions and commands have been added to support the new types. The |string()| function can be used to get a string representation of a variable. Works for Numbers, Strings and composites of them. Then |eval()| can be used to turn the string back into the variable value. The |:let| command can now use "+=", "-=" and ".=": > :let var += expr " works like :let var = var + expr :let var -= expr " works like :let var = var - expr :let var .= string " works like :let var = var . string With the |:profile| command you can find out where your function or script is wasting time. In the Python interface vim.eval() also handles Dictionaries and Lists. |python-eval| (G. Sumner Hayes) The |getscript| plugin was added as a convenient way to update scripts from www.vim.org automatically. (Charles Campbell) The |vimball| plugin was added as a convenient way to distribute a set of files for a plugin (plugin file, autoload script, documentation). (Charles Campbell) Spell checking *new-spell* -------------- Spell checking has been integrated in Vim. There were a few implementations with scripts, but they were slow and/or required an external program. The 'spell' option is used to switch spell checking on or off The 'spelllang' option is used to specify the accepted language(s) The 'spellfile' option specifies where new words are added The 'spellsuggest' option specifies the methods used for making suggestions The |]s| and |[s| commands can be used to move to the next or previous error The |zg| and |zw| commands can be used to add good and wrong words The |z=| command can be used to list suggestions and correct the word The |:mkspell| command is used to generate a Vim spell file from word lists The "undercurl" highlighting attribute was added to nicely point out spelling mistakes in the GUI (based on patch from Marcin Dalecki). The "guisp" color can be used to give it a color different from foreground and background. The number of possible different highlight attributes was raised from about 220 to over 30000. This allows for the attributes of spelling to be combined with syntax highlighting attributes. This is also used for syntax highlighting and marking the Visual area. Much more info here: |spell|. Omni completion *new-omni-completion* --------------- This could also be called "intellisense", but that is a trademark. It is a smart kind of completion. The text in front of the cursor is inspected to figure out what could be following. This may suggest struct and class members, system functions, etc. Use CTRL-X CTRL-O in Insert mode to start the completion. |i_CTRL-X_CTRL-O| The 'omnifunc' option is set by filetype plugins to define the function that figures out the completion. Currently supported languages: C |ft-c-omni| (X)HTML with CSS |ft-html-omni| JavaScript |ft-javascript-omni| PHP |ft-php-omni| Python Ruby |ft-ruby-omni| SQL |ft-sql-omni| XML |ft-xml-omni| any language with syntax highlighting |ft-syntax-omni| You can add your own omni completion scripts. When the 'completeopt' option contains "menu" then matches for Insert mode completion are displayed in a (rather primitive) popup menu. MzScheme interface *new-MzScheme* ------------------ The MzScheme interpreter is supported. |MzScheme| The |:mzscheme| command can be used to execute MzScheme commands The |:mzfile| command can be used to execute an MzScheme script file This depends on Vim being compiled with the |+mzscheme| feature. Printing multi-byte text *new-print-multi-byte* ------------------------ The |:hardcopy| command now supports printing multi-byte characters when using PostScript. The 'printmbcharset' and 'printmbfont' options are used for this. Also see |postscript-cjk-printing|. (Mike Williams) Tab pages *new-tab-pages* --------- A tab page is a page with one or more windows with a label (aka tab) at the top. By clicking on the label you can quickly switch between the tab pages. And with the keyboard, using the |gt| (Goto Tab) command. This is a convenient way to work with many windows. To start Vim with each file argument in a separate tab page use the |-p| argument. The maximum number of pages can be set with 'tabpagemax'. The line with tab labels is either made with plain text and highlighting or with a GUI mechanism. The GUI labels look better but are only available on a few systems. The line can be customized with 'tabline', 'guitablabel' and 'guitabtooltip'. Whether it is displayed is set with 'showtabline'. Whether to use the GUI labels is set with the "e" flag in 'guioptions'. The |:tab| command modifier can be used to have most commands that open a new window open a new tab page instead. The |--remote-tab| argument can be used to edit a file in a new tab page in an already running Vim server. Variables starting with "t:" are local to a tab page. More info here: |tabpage| Most of the GUI stuff was implemented by Yegappan Lakshmanan. Undo branches *new-undo-branches* ------------- Previously there was only one line of undo-redo. If, after undoing a number of changes, a new change was made all the undone changes were lost. This could lead to accidentally losing work. Vim now makes an undo branch in this situation. Thus you can go back to the text after any change, even if they were undone. So long as you do not run into 'undolevels', when undo information is freed up to limit the memory used. To be able to navigate the undo branches each change is numbered sequentially. The commands |g-| and |:earlier| go back in time, to older changes. The commands |g+| and |:later| go forward in time, to newer changes. The changes are also timestamped. Use ":earlier 10m" to go to the text as it was about ten minutes earlier. The |:undolist| command can be used to get an idea of which undo branches exist. The |:undo| command now takes an argument to directly jump to a specific position in this list. The |changenr()| function can be used to obtain the change number. There is no graphical display of the tree with changes, navigation can be quite confusing. Extended Unicode support *new-more-unicode* ------------------------ Previously only two combining characters were displayed. The limit is now raised to 6. This can be set with the 'maxcombine' option. The default is still 2. |ga| now shows all combining characters, not just the first two. Previously only 16 bit Unicode characters were supported for displaying. Now the full 32 bit character set can be used. Unless manually disabled at compile time to save a bit of memory. For pattern matching it is now possible to search for individual composing characters. |patterns-composing| The |8g8| command searches for an illegal UTF-8 byte sequence. More highlighting *new-more-highlighting* ----------------- Highlighting matching parens: When moving the cursor through the text and it is on a paren, then the matching paren can be highlighted. This uses the new |CursorMoved| autocommand event. This means some commands are executed every time you move the cursor. If this slows you down too much switch it off with: > :NoMatchParen See |matchparen| for more information. The plugin uses the |:match| command. It now supports three match patterns. The plugin uses the third one. The first one is for the user and the second one can be used by another plugin. Highlighting the cursor line and column: The 'cursorline' and 'cursorcolumn' options have been added. These highlight the screen line and screen column of the cursor. This makes the cursor position easier to spot. 'cursorcolumn' is also useful to align text. This may make screen updating quite slow. The CursorColumn and CursorLine highlight groups allow changing the colors used. |hl-CursorColumn| |hl-CursorLine| The number of possible different highlight attributes was raised from about 220 to over 30000. This allows for the attributes of spelling to be combined with syntax highlighting attributes. This is also used for syntax highlighting, marking the Visual area, CursorColumn, etc. Translated manual pages *new-manpage-trans* ----------------------- The manual page of Vim and associated programs is now also available in several other languages. French - translated by David Blanchet Italian - translated by Antonio Colombo Russian - translated by Vassily Ragosin Polish - translated by Mikolaj Machowski The Unix Makefile installs the Italian manual pages in .../man/it/man1/, .../man/it.ISO8859-1/man1/ and .../man/it.UTF-8/man1/. There appears to be no standard for what encoding goes in the "it" directory, the 8-bit encoded file is used there as a best guess. Other languages are installed in similar places. The translated pages are not automatically installed when Vim was configured with "--disable-nls", but "make install-languages install-tool-languages" will do it anyway. Internal grep *new-vimgrep* ------------- The ":vimgrep" command can be used to search for a pattern in a list of files. This is like the ":grep" command, but no external program is used. Besides better portability, handling of different file encodings and using multi-line patterns, this also allows grepping in compressed and remote files. |:vimgrep|. If you want to use the search results in a script you can use the |getqflist()| function. To grep files in various directories the "**" pattern can be used. It expands into an arbitrary depth of directories. "**" can be used in all places where file names are expanded, thus also with |:next| and |:args|. Scroll back in messages *new-scroll-back* ----------------------- When displaying messages, at the |more-prompt| and the |hit-enter-prompt|, The 'k', 'u', 'g' and 'b' keys can be used to scroll back to previous messages. This is especially useful for commands such as ":syntax", ":autocommand" and ":highlight". This is implemented in a generic way thus it works for all commands and highlighting is kept. Only works when the 'more' option is set. Previously it only partly worked for ":clist". The |g<| command can be used to see the last page of messages after you have hit <Enter> at the |hit-enter-prompt|. Then you can scroll further back. Cursor past end of the line *new-onemore* --------------------------- When the 'virtualedit' option contains "onemore" the cursor can move just past the end of the line. As if it's on top of the line break. This makes some commands more consistent. Previously the cursor was always past the end of the line if the line was empty. But it is far from Vi compatible. It may also break some plugins or Vim scripts. Use with care! The patch was provided by Mattias Flodin. POSIX compatibility *new-posix* ------------------- The POSIX test suite was used to verify POSIX compatibility. A number of problems have been fixed to make Vim more POSIX compatible. Some of them conflict with traditional Vi or expected behavior. The $VIM_POSIX environment variable can be set to get POSIX compatibility. See |posix|. Items that were fixed for both Vi and POSIX compatibility: - repeating "R" with a count only overwrites text once; added the 'X' flag to 'cpoptions' |cpo-X| - a vertical movement command that moves to a non-existing line fails; added the '-' flag to 'cpoptions' |cpo--| - when preserving a file and doing ":q!" the file can be recovered; added the '&' flag to 'cpoptions' |cpo-&| - The 'window' option is partly implemented. It specifies how much CTRL-F and CTRL-B scroll when there is one window. The "-w {number}" argument is now accepted. "-w {scriptout}" only works when {scriptout} doesn't start with a digit. - Allow "-c{command}" argument, no space between "-c" and {command}. - When writing a file with ":w!" don't reset 'readonly' when 'Z' is present in 'cpoptions'. - Allow 'l' and '#' flags for ":list", ":print" and ":number". - Added the '.' flag to 'cpoptions': ":cd" fails when the buffer is modified. - In Ex mode with an empty buffer ":read file" doesn't keep an empty line above or below the new lines. - Remove a backslash before a NL for the ":global" command. - When ":append", ":insert" or ":change" is used with ":global", get the inserted lines from the command. Can use backslash-NL to separate lines. - Can use ":global /pat/ visual" to execute Normal mode commands at each matched line. Use "Q" to continue and go to the next line. - The |:open| command has been partially implemented. It stops Ex mode, but redraws the whole screen, not just one line as open mode is supposed to do. - Support using a pipe to read the output from and write input to an external command. Added the 'shelltemp' option and has("filterpipe"). - In ex silent mode the ":set" command output is displayed. - The ":@@" and ":**" give an error message when no register was used before. - The search pattern "[]-`]" matches ']', '^', '_' and '`'. - Autoindent for ":insert" is using the line below the insert. - Autoindent for ":change" is using the first changed line. - Editing Ex command lines is not done in cooked mode, because CTRL-D and CTRL-T cannot be handled then. - In Ex mode, "1,3" prints three lines. "%" prints all lines. - In Ex mode "undo" would undo all changes since Ex mode was started. - Implemented the 'prompt' option. Debugger support *new-debug-support* ---------------- The 'balloonexpr' option has been added. This is a generic way to implement balloon functionality. You can use it to show info for the word under the mouse pointer. Remote file explorer *new-netrw-explore* -------------------- The netrw plugin now also supports viewing a directory, when "scp://" is used. Deleting and renaming files is possible. To avoid duplicating a lot of code, the previous file explorer plugin has been integrated in the netrw plugin. This means browsing local and remote files works the same way. ":browse edit" and ":browse split" use the netrw plugin when it's available and a GUI dialog is not possible. The netrw plugin is maintained by Charles Campbell. Define an operator *new-define-operator* ------------------ Previously it was not possible to define your own operator; a command that is followed by a {motion}. Vim 7 introduces the 'operatorfunc' option and the |g@| operator. This makes it possible to define a mapping that works like an operator. The actual work is then done by a function, which is invoked through the |g@| operator. See |:map-operator| for the explanation and an example. Mapping to an expression *new-map-expression* ------------------------ The {rhs} argument of a mapping can be an expression. That means the resulting characters can depend on the context. Example: > :inoremap <expr> . InsertDot() Here the dot will be mapped to whatever InsertDot() returns. This also works for abbreviations. See |:map-<expr>| for the details. Visual and Select mode mappings *new-map-select* ------------------------------- Previously Visual mode mappings applied both to Visual and Select mode. With a trick to have the mappings work in Select mode like they would in Visual mode. Commands have been added to define mappings for Visual and Select mode separately: |:xmap| and |:smap|. With the associated "noremap" and "unmap" commands. The same is done for menus: |:xmenu|, |:smenu|, etc. Location list *new-location-list* ------------- The support for a per-window quickfix list (location list) is added. The location list can be displayed in a location window (similar to the quickfix window). You can open more than one location list window. A set of commands similar to the quickfix commands are added to browse the location list. (Yegappan Lakshmanan) Various new items *new-items-7* ----------------- Normal mode commands: ~ a", a' and a` New text objects to select quoted strings. |a'| i", i' and i` (Taro Muraoka) CTRL-W <Enter> In the quickfix window: opens a new window to show the location of the error under the cursor. |at| and |it| text objects select a block of text between HTML or XML tags. <A-LeftMouse> ('mousemodel' "popup" or "popup-setpos") <A-RightMouse> ('mousemodel' "extend") Make a blockwise selection. |<A-LeftMouse>| gF Start editing the filename under the cursor and jump to the line number following the file name. (Yegappan Lakshmanan) CTRL-W F Start editing the filename under the cursor in a new window and jump to the line number following the file name. (Yegappan Lakshmanan) Insert mode commands: ~ CTRL-\ CTRL-O Execute a Normal mode command. Like CTRL-O but without moving the cursor. |i_CTRL-\_CTRL-O| Options: ~ 'balloonexpr' expression for text to show in evaluation balloon 'completefunc' The name of the function used for user-specified Insert mode completion. CTRL-X CTRL-U can be used in Insert mode to do any kind of completion. (Taro Muraoka) 'completeopt' Enable popup menu and other settings for Insert mode completion. 'cursorcolumn' highlight column of the cursor 'cursorline' highlight line of the cursor 'formatexpr' expression for formatting text with |gq| and when text goes over 'textwidth' in Insert mode. 'formatlistpat' pattern to recognize a numbered list for formatting. (idea by Hugo Haas) 'fsync' Whether fsync() is called after writing a file. (Ciaran McCreesh) 'guitablabel' expression for text to display in GUI tab page label 'guitabtooltip' expression for text to display in GUI tab page tooltip 'macatsui' Mac: use ATSUI text display functions 'maxcombine' maximum number of combining characters displayed 'maxmempattern' maximum amount of memory to use for pattern matching 'mkspellmem' parameters for |:mkspell| memory use 'mzquantum' Time in msec to schedule MzScheme threads. 'numberwidth' Minimal width of the space used for the 'number' and 'relativenumber' option. (Emmanuel Renieris) 'omnifunc' The name of the function used for omni completion. 'operatorfunc' function to be called for |g@| operator 'printmbcharset' CJK character set to be used for :hardcopy 'printmbfont' font names to be used for CJK output of :hardcopy 'pumheight' maximum number of items to show in the popup menu 'quoteescape' Characters used to escape quotes inside a string. Used for the a", a' and a` text objects. |a'| 'shelltemp' whether to use a temp file or pipes for shell commands 'showtabline' whether to show the tab pages line 'spell' switch spell checking on/off 'spellcapcheck' pattern to locate the end of a sentence 'spellfile' file where good and wrong words are added 'spelllang' languages to check spelling for 'spellsuggest' methods for spell suggestions 'synmaxcol' maximum column to look for syntax items; avoids very slow redrawing when there are very long lines 'tabline' expression for text to display in the tab pages line 'tabpagemax' maximum number of tab pages to open for |-p| 'verbosefile' Log messages in a file. 'wildoptions' "tagfile" value enables listing the file name of matching tags for CTRL-D command line completion. (based on an idea from Yegappan Lakshmanan) 'winfixwidth' window with fixed width, similar to 'winfixheight' Ex commands: ~ Win32: The ":winpos" command now also works in the console. (Vipin Aravind) |:startreplace| Start Replace mode. (Charles Campbell) |:startgreplace| Start Virtual Replace mode. |:0file| Removes the name of the buffer. (Charles Campbell) |:diffoff| Switch off diff mode in the current window or in all windows. |:delmarks| Delete marks. |:exusage| Help for Ex commands (Nvi command). |:viusage| Help for Vi commands (Nvi command). |:sort| Sort lines in the buffer without depending on an external command. (partly by Bryce Wagner) |:vimgrep| Internal grep command, search for a pattern in files. |:vimgrepadd| Like |:vimgrep| but don't make a new list. |:caddfile| Add error messages to an existing quickfix list (Yegappan Lakshmanan). |:cbuffer| Read error lines from a buffer. (partly by Yegappan Lakshmanan) |:cgetbuffer| Create a quickfix list from a buffer but don't jump to the first error. |:caddbuffer| Add errors from the current buffer to the quickfix list. |:cexpr| Read error messages from a Vim expression (Yegappan Lakshmanan). |:caddexpr| Add error messages from a Vim expression to an existing quickfix list. (Yegappan Lakshmanan). |:cgetexpr| Create a quickfix list from a Vim expression, but don't jump to the first error. (Yegappan Lakshmanan). |:lfile| Like |:cfile| but use the location list. |:lgetfile| Like |:cgetfile| but use the location list. |:laddfile| Like |:caddfile| but use the location list. |:lbuffer| Like |:cbuffer| but use the location list. |:lgetbuffer| Like |:cgetbuffer| but use the location list. |:laddbuffer| Like |:caddbuffer| but use the location list. |:lexpr| Like |:cexpr| but use the location list. |:lgetexpr| Like |:cgetexpr| but use the location list. |:laddexpr| Like |:caddexpr| but use the location list. |:ll| Like |:cc| but use the location list. |:llist| Like |:clist| but use the location list. |:lnext| Like |:cnext| but use the location list. |:lprevious| Like |:cprevious| but use the location list. |:lNext| Like |:cNext| but use the location list. |:lfirst| Like |:cfirst| but use the location list. |:lrewind| Like |:crewind| but use the location list. |:llast| Like |:clast| but use the location list. |:lnfile| Like |:cnfile| but use the location list. |:lpfile| Like |:cpfile| but use the location list. |:lNfile| Like |:cNfile| but use the location list. |:lolder| Like |:colder| but use the location list. |:lnewer| Like |:cnewer| but use the location list. |:lwindow| Like |:cwindow| but use the location list. |:lopen| Like |:copen| but use the location list. |:lclose| Like |:cclose| but use the location list. |:lmake| Like |:make| but use the location list. |:lgrep| Like |:grep| but use the location list. |:lgrepadd| Like |:grepadd| but use the location list. |:lvimgrep| Like |:vimgrep| but use the location list. |:lvimgrepadd| Like |:vimgrepadd| but use the location list. |:lhelpgrep| Like |:helpgrep| but use the location list. |:lcscope| Like |:cscope| but use the location list. |:ltag| Jump to a tag and add matching tags to a location list. |:undojoin| Join a change with the previous undo block. |:undolist| List the leafs of the undo tree. |:earlier| Go back in time for changes in the text. |:later| Go forward in time for changes in the text. |:for| Loop over a |List|. |:endfor| |:lockvar| Lock a variable, prevents it from being changed. |:unlockvar| Unlock a locked variable. |:mkspell| Create a Vim spell file. |:spellgood| Add a word to the list of good words. |:spellwrong| Add a word to the list of bad words |:spelldump| Dump list of good words. |:spellinfo| Show information about the spell files used. |:spellrepall| Repeat a spelling correction for the whole buffer. |:spellundo| Remove a word from list of good and bad words. |:mzscheme| Execute MzScheme commands. |:mzfile| Execute an MzScheme script file. |:nbkey| Pass a key to NetBeans for processing. |:profile| Commands for Vim script profiling. |:profdel| Stop profiling for specified items. |:smap| Select mode mapping. |:smapclear| |:snoremap| |:sunmap| |:xmap| Visual mode mapping, not used for Select mode. |:xmapclear| |:xnoremap| |:xunmap| |:smenu| Select mode menu. |:snoremenu| |:sunmenu| |:xmenu| Visual mode menu, not used for Select mode. |:xnoremenu| |:xunmenu| |:tabclose| Close the current tab page. |:tabdo| Perform a command in every tab page. |:tabedit| Edit a file in a new tab page. |:tabnew| Open a new tab page. |:tabfind| Search for a file and open it in a new tab page. |:tabnext| Go to the next tab page. |:tabprevious| Go to the previous tab page. |:tabNext| Go to the previous tab page. |:tabfirst| Go to the first tab page. |:tabrewind| Go to the first tab page. |:tablast| Go to the last tab page. |:tabmove| Move the current tab page elsewhere. |:tabonly| Close all other tab pages. |:tabs| List the tab pages and the windows they contain. Ex command modifiers: ~ |:keepalt| Do not change the alternate file. |:noautocmd| Do not trigger autocommand events. |:sandbox| Execute a command in the sandbox. |:tab| When opening a new window create a new tab page. Ex command arguments: ~ |++bad| Specify what happens with characters that can't be converted and illegal bytes. (code example by Yasuhiro Matsumoto) Also, when a conversion error occurs or illegal bytes are found include the line number in the error message. New and extended functions: ~ |add()| append an item to a List |append()| append List of lines to the buffer |argv()| without an argument return the whole argument list |browsedir()| dialog to select a directory |bufnr()| takes an extra argument: create buffer |byteidx()| index of a character (Ilya Sher) |call()| call a function with List as arguments |changenr()| number of current change |complete()| set matches for Insert mode completion |complete_add()| add match for 'completefunc' |complete_check()| check for key pressed, for 'completefunc' |copy()| make a shallow copy of a List or Dictionary |count()| count nr of times a value is in a List or Dictionary |cursor()| also accepts an offset for 'virtualedit', and the first argument can be a list: [lnum, col, off] |deepcopy()| make a full copy of a List or Dictionary |diff_filler()| returns number of filler lines above line {lnum}. |diff_hlID()| returns the highlight ID for diff mode |empty()| check if List or Dictionary is empty |eval()| evaluate {string} and return the result |extend()| append one List to another or add items from one Dictionary to another |feedkeys()| put characters in the typeahead buffer |filter()| remove selected items from a List or Dictionary |finddir()| find a directory in 'path' |findfile()| find a file in 'path' (Johannes Zellner) |foldtextresult()| the text displayed for a closed fold at line "lnum" |function()| make a Funcref out of a function name |garbagecollect()| cleanup unused |Lists| and |Dictionaries| with circular references |get()| get an item from a List or Dictionary |getbufline()| get a list of lines from a specified buffer (Yegappan Lakshmanan) |getcmdtype()| return the current command-line type (Yegappan Lakshmanan) |getfontname()| get actual font name being used |getfperm()| get file permission string (Nikolai Weibull) |getftype()| get type of file (Nikolai Weibull) |getline()| with second argument: get List with buffer lines |getloclist()| list of location list items (Yegappan Lakshmanan) |getpos()| return a list with the position of cursor, mark, etc. |getqflist()| list of quickfix errors (Yegappan Lakshmanan) |getreg()| get contents of a register |gettabwinvar()| get variable from window in specified tab page. |has_key()| check whether a key appears in a Dictionary |haslocaldir()| check if current window used |:lcd| |hasmapto()| check for a mapping to a string |index()| index of item in List |inputlist()| prompt the user to make a selection from a list |insert()| insert an item somewhere in a List |islocked()| check if a variable is locked |items()| get List of Dictionary key-value pairs |join()| join List items into a String |keys()| get List of Dictionary keys |len()| number of items in a List or Dictionary |map()| change each List or Dictionary item |maparg()| extra argument: use abbreviation |mapcheck()| extra argument: use abbreviation |match()| extra argument: count |matcharg()| return arguments of |:match| command |matchend()| extra argument: count |matchlist()| list with match and submatches of a pattern in a string |matchstr()| extra argument: count |max()| maximum value in a List or Dictionary |min()| minimum value in a List or Dictionary |mkdir()| create a directory |pathshorten()| reduce directory names to a single character |printf()| format text |pumvisible()| check whether the popup menu is displayed |range()| generate a List with numbers |readfile()| read a file into a list of lines |reltime()| get time value, possibly relative |reltimestr()| turn a time value into a string |remove()| remove one or more items from a List or Dictionary |repeat()| repeat "expr" "count" times (Christophe Poucet) |reverse()| reverse the order of a List |search()| extra argument: |searchdecl()| search for declaration of variable |searchpair()| extra argument: line to stop searching |searchpairpos()| return a List with the position of the match |searchpos()| return a List with the position of the match |setloclist()| modify a location list (Yegappan Lakshmanan) |setpos()| set cursor or mark to a position |setqflist()| modify a quickfix list (Yegappan Lakshmanan) |settabwinvar()| set variable in window of specified tab page |sort()| sort a List |soundfold()| get the sound-a-like equivalent of a word |spellbadword()| get a badly spelled word |spellsuggest()| get suggestions for correct spelling |split()| split a String into a List |str2nr()| convert a string to a number, base 2, 8, 10 or 16 |stridx()| extra argument: start position |strridx()| extra argument: start position |string()| string representation of a List or Dictionary |system()| extra argument: filters {input} through a shell command |tabpagebuflist()| List of buffers in a tab page |tabpagenr()| number of current or last tab page |tabpagewinnr()| window number in a tab page |tagfiles()| List with tags file names |taglist()| get list of matching tags (Yegappan Lakshmanan) |tr()| translate characters (Ron Aaron) |uniq()| remove copies of repeated adjacent list items |values()| get List of Dictionary values |winnr()| takes an argument: what window to use |winrestview()| restore the view of the current window |winsaveview()| save the view of the current window |writefile()| write a list of lines into a file User defined functions can now be loaded automatically from the "autoload" directory in 'runtimepath'. See |autoload-functions|. New Vim variables: ~ |v:insertmode| used for |InsertEnter| and |InsertChange| autocommands |v:val| item value in a |map()| or |filter()| function |v:key| item key in a |map()| or |filter()| function |v:profiling| non-zero after a ":profile start" command |v:fcs_reason| the reason why |FileChangedShell| was triggered |v:fcs_choice| what should happen after |FileChangedShell| |v:beval_bufnr| buffer number for 'balloonexpr' |v:beval_winnr| window number for 'balloonexpr' |v:beval_lnum| line number for 'balloonexpr' |v:beval_col| column number for 'balloonexpr' |v:beval_text| text under the mouse pointer for 'balloonexpr' |v:scrollstart| what caused the screen to be scrolled up |v:swapname| name of the swap file for the |SwapExists| event |v:swapchoice| what to do for an existing swap file |v:swapcommand| command to be executed after handling |SwapExists| |v:char| argument for evaluating 'formatexpr' New autocommand events: ~ |ColorScheme| after loading a color scheme |CursorHoldI| the user doesn't press a key for a while in Insert mode |CursorMoved| the cursor was moved in Normal mode |CursorMovedI| the cursor was moved in Insert mode |FileChangedShellPost| after handling a file changed outside of Vim |InsertEnter| starting Insert or Replace mode |InsertChange| going from Insert to Replace mode or back |InsertLeave| leaving Insert or Replace mode |MenuPopup| just before showing popup menu |QuickFixCmdPre| before :make, :grep et al. (Ciaran McCreesh) |QuickFixCmdPost| after :make, :grep et al. (Ciaran McCreesh) |SessionLoadPost| after loading a session file. (Yegappan Lakshmanan) |ShellCmdPost| after executing a shell command |ShellFilterPost| after filtering with a shell command |SourcePre| before sourcing a Vim script |SpellFileMissing| when a spell file can't be found |SwapExists| found existing swap file when editing a file |TabEnter| just after entering a tab page |TabLeave| just before leaving a tab page |VimResized| after the Vim window size changed (Yakov Lerner) New highlight groups: ~ Pmenu Popup menu: normal item |hl-Pmenu| PmenuSel Popup menu: selected item |hl-PmenuSel| PmenuThumb Popup menu: scrollbar |hl-PmenuThumb| PmenuSbar Popup menu: Thumb of the scrollbar |hl-PmenuSbar| TabLine tab pages line, inactive label |hl-TabLine| TabLineSel tab pages line, selected label |hl-TabLineSel| TabLineFill tab pages line, filler |hl-TabLineFill| SpellBad badly spelled word |hl-SpellBad| SpellCap word with wrong caps |hl-SpellCap| SpellRare rare word |hl-SpellRare| SpellLocal word only exists in other region |hl-SpellLocal| CursorColumn 'cursorcolumn' |hl-CursorColumn| CursorLine 'cursorline' |hl-CursorLine| MatchParen matching parens |pi_paren.txt| |hl-MatchParen| New items in search patterns: ~ |/\%d| \%d123 search for character with decimal number |/\]| [\d123] idem, in a collection |/\%o| \%o103 search for character with octal number |/\]| [\o1o3] idem, in a collection |/\%x| \%x1a search for character with 2 pos. hex number |/\]| [\x1a] idem, in a collection |/\%u| \%u12ab search for character with 4 pos. hex number |/\]| [\u12ab] idem, in a collection |/\%U| \%U1234abcd search for character with 8 pos. hex number |/\]| [\U1234abcd] idem, in a collection (The above partly by Ciaran McCreesh) |/[[=| [[=a=]] an equivalence class (only for latin1 characters) |/[[.| [[.a.]] a collation element (only works with single char) |/\%'m| \%'m match at mark m |/\%<'m| \%<'m match before mark m |/\%>'m| \%>'m match after mark m |/\%V| \%V match in Visual area Nesting |/multi| items no longer is an error when an empty match is possible. It is now possible to use \{0}, it matches the preceding atom zero times. Not useful, just for compatibility. New Syntax/Indent/FTplugin files: ~ Moved all the indent settings from the filetype plugin to the indent file. Implemented b:undo_indent to undo indent settings when setting 'filetype' to a different value. a2ps syntax and ftplugin file. (Nikolai Weibull) ABAB/4 syntax file. (Marius van Wyk) alsaconf ftplugin file. (Nikolai Weibull) AppendMatchGroup ftplugin file. (Dave Silvia) arch ftplugin file. (Nikolai Weibull) asterisk and asteriskvm syntax file. (Tilghman Lesher) BDF ftplugin file. (Nikolai Weibull) BibTeX indent file. (Dorai Sitaram) BibTeX Bibliography Style syntax file. (Tim Pope) BTM ftplugin file. (Bram Moolenaar) calendar ftplugin file. (Nikolai Weibull) Changelog indent file. (Nikolai Weibull) ChordPro syntax file. (Niels Bo Andersen) Cmake indent and syntax file. (Andy Cedilnik) conf ftplugin file. (Nikolai Weibull) context syntax and ftplugin file. (Nikolai Weibull) CRM114 ftplugin file. (Nikolai Weibull) cvs RC ftplugin file. (Nikolai Weibull) D indent file. (Jason Mills) Debian Sources.list syntax file. (Matthijs Mohlmann) dictconf and dictdconf syntax, indent and ftplugin files. (Nikolai Weibull) diff ftplugin file. (Bram Moolenaar) dircolors ftplugin file. (Nikolai Weibull) django and htmldjango syntax file. (Dave Hodder) doxygen syntax file. (Michael Geddes) elinks ftplugin file. (Nikolai Weibull) eterm ftplugin file. (Nikolai Weibull) eviews syntax file. (Vaidotas Zemlys) fetchmail RC ftplugin file. (Nikolai Weibull) FlexWiki syntax and ftplugin file. (George Reilly) Generic indent file. (Dave Silvia) gpg ftplugin file. (Nikolai Weibull) gretl syntax file. (Vaidotas Zemlys) groovy syntax file. (Alessio Pace) group syntax and ftplugin file. (Nikolai Weibull) grub ftplugin file. (Nikolai Weibull) Haskell ftplugin file. (Nikolai Weibull) help ftplugin file. (Nikolai Weibull) indent ftplugin file. (Nikolai Weibull) Javascript ftplugin file. (Bram Moolenaar) Kconfig ftplugin and syntax file. (Nikolai Weibull) ld syntax, indent and ftplugin file. (Nikolai Weibull) lftp ftplugin file. (Nikolai Weibull) libao config ftplugin file. (Nikolai Weibull) limits syntax and ftplugin file. (Nikolai Weibull) Lisp indent file. (Sergey Khorev) loginaccess and logindefs syntax and ftplugin file. (Nikolai Weibull) m4 ftplugin file. (Nikolai Weibull) mailaliases syntax file. (Nikolai Weibull) mailcap ftplugin file. (Nikolai Weibull) manconf syntax and ftplugin file. (Nikolai Weibull) matlab ftplugin file. (Jake Wasserman) Maxima syntax file. (Robert Dodier) MGL syntax file. (Gero Kuhlmann) modconf ftplugin file. (Nikolai Weibull) mplayer config ftplugin file. (Nikolai Weibull) Mrxvtrc syntax and ftplugin file. (Gautam Iyer) MuPAD source syntax, indent and ftplugin. (Dave Silvia) mutt RC ftplugin file. (Nikolai Weibull) nanorc syntax and ftplugin file. (Nikolai Weibull) netrc ftplugin file. (Nikolai Weibull) pamconf syntax and ftplugin file. (Nikolai Weibull) Pascal indent file. (Neil Carter) passwd syntax and ftplugin file. (Nikolai Weibull) PHP compiler plugin. (Doug Kearns) pinfo ftplugin file. (Nikolai Weibull) plaintex syntax and ftplugin files. (Nikolai Weibull, Benji Fisher) procmail ftplugin file. (Nikolai Weibull) prolog ftplugin file. (Nikolai Weibull) protocols syntax and ftplugin file. (Nikolai Weibull) quake ftplugin file. (Nikolai Weibull) racc syntax and ftplugin file. (Nikolai Weibull) readline ftplugin file. (Nikolai Weibull) rhelp syntax file. (Johannes Ranke) rnoweb syntax file. (Johannes Ranke) Relax NG compact ftplugin file. (Nikolai Weibull) Scheme indent file. (Sergey Khorev) screen ftplugin file. (Nikolai Weibull) sensors syntax and ftplugin file. (Nikolai Weibull) services syntax and ftplugin file. (Nikolai Weibull) setserial syntax and ftplugin file. (Nikolai Weibull) sieve syntax and ftplugin file. (Nikolai Weibull) SiSU syntax file (Ralph Amissah) Sive syntax file. (Nikolai Weibull) slp config, reg and spi syntax and ftplugin files. (Nikolai Weibull) SML indent file. (Saikat Guha) SQL anywhere syntax and indent file. (David Fishburn) SQL indent file. SQL-Informix syntax file. (Dean L Hill) SQL: Handling of various variants. (David Fishburn) sshconfig ftplugin file. (Nikolai Weibull) Stata and SMCL syntax files. (Jeff Pitblado) sudoers ftplugin file. (Nikolai Weibull) sysctl syntax and ftplugin file. (Nikolai Weibull) terminfo ftplugin file. (Nikolai Weibull) trustees syntax file. (Nima Talebi) Vera syntax file. (David Eggum) udev config, permissions and rules syntax and ftplugin files. (Nikolai Weibull) updatedb syntax and ftplugin file. (Nikolai Weibull) VHDL indent file (Gerald Lai) WSML syntax file. (Thomas Haselwanter) Xdefaults ftplugin file. (Nikolai Weibull) XFree86 config ftplugin file. (Nikolai Weibull) xinetd syntax, indent and ftplugin file. (Nikolai Weibull) xmodmap ftplugin file. (Nikolai Weibull) Xquery syntax file. (Jean-Marc Vanel) xsd (XML schema) indent file. YAML ftplugin file. (Nikolai Weibull) Zsh ftplugin file. (Nikolai Weibull) New Keymaps: ~ Sinhala (Sri Lanka) (Harshula Jayasuriya) Tamil in TSCII encoding (Yegappan Lakshmanan) Greek in cp737 (Panagiotis Louridas) Polish-slash (HS6_06) Ukrainian-jcuken (Anatoli Sakhnik) Kana (Edward L. Fox) New message translations: ~ The Ukrainian messages are now also available in cp1251. Vietnamese message translations and menu. (Phan Vinh Thinh) Others: ~ The |:read| command has the |++edit| argument. This means it will use the detected 'fileformat', 'fileencoding' and other options for the buffer. This also fixes the problem that editing a compressed file didn't set these options. The Netbeans interface was updated for Sun Studio 10. The protocol number goes from 2.2 to 2.3. (Gordon Prieur) Mac: When starting up Vim will load the $VIMRUNTIME/macmap.vim script to define default command-key mappings. (mostly by Benji Fisher) Mac: Add the selection type to the clipboard, so that Block, line and character selections can be used between two Vims. (Eckehard Berns) Also fixes the problem that setting 'clipboard' to "unnamed" breaks using "yyp". Mac: GUI font selector. (Peter Cucka) Mac: support for multi-byte characters. (Da Woon Jung) This doesn't always work properly. If you see text drawing problems try switching the 'macatsui' option off. Mac: Support the xterm mouse in the non-GUI version. Mac: better integration with Xcode. Post a fake mouse-up event after the odoc event and the drag receive handler to work around a stall after Vim loads a file. Fixed an off-by-one line number error. (Da Woon Jung) Mac: When started from Finder change directory to the file being edited or the user home directory. Added the t_SI and t_EI escape sequences for starting and ending Insert mode. To be used to set the cursor shape to a bar or a block. No default values, they are not supported by termcap/terminfo. GUI font selector for Motif. (Marcin Dalecki) Nicer toolbar buttons for Motif. (Marcin Dalecki) Mnemonics for the Motif find/replace dialog. (Marcin Dalecki) Included a few improvements for Motif from Marcin Dalecki. Draw label contents ourselves to make them handle fonts in a way configurable by Vim and a bit less dependent on the X11 font management. Autocommands can be defined local to a buffer. This means they will also work when the buffer does not have a name or no specific name. See |autocmd-buflocal|. (Yakov Lerner) For xterm most combinations of modifiers with function keys are recognized. |xterm-modifier-keys| When 'verbose' is set the output of ":highlight" will show where a highlight item was last set. When 'verbose' is set the output of the ":map", ":abbreviate", ":command", ":function" and ":autocmd" commands will show where it was last defined. (Yegappan Lakshmanan) ":function /pattern" lists functions matching the pattern. "1gd" can be used like "gd" but ignores matches in a {} block that ends before the cursor position. Likewise for "1gD" and "gD". 'scrolljump' can be set to a negative number to scroll a percentage of the window height. The |v:scrollstart| variable has been added to help find the location in your script that causes the hit-enter prompt. To make it possible to handle the situation that a file is being edited that is already being edited by another Vim instance, the |SwapExists| event has been added. The |v:swapname|, |v:swapchoice| and |v:swapcommand| variables can be used, for example to use the |client-server| functionality to bring the other Vim to the foreground. When starting Vim with a "-t tag" argument, there is an existing swapfile and the user selects "quit" or "abort" then exit Vim. Undo now also restores the '< and '> marks. "gv" selects the same area as before the change and undo. When editing a search pattern for a "/" or "?" command and 'incsearch' is set CTRL-L can be used to add a character from the current match. CTRL-R CTRL-W will add a word, but exclude the part of the word that was already typed. Ruby interface: add line number methods. (Ryan Paul) The $MYVIMRC environment variable is set to the first found vimrc file. The $MYGVIMRC environment variable is set to the first found gvimrc file. ============================================================================== IMPROVEMENTS *improvements-7* ":helpgrep" accepts a language specifier after the pattern: "pat@it". Moved the help for printing to a separate help file. It's quite a lot now. When doing completion for ":!cmd", ":r !cmd" or ":w !cmd" executable files are found in $PATH instead of looking for ordinary files in the current directory. When ":silent" is used and a backwards range is given for an Ex command the range is swapped automatically instead of asking if that is OK. The pattern matching code was changed from a recursive function to an iterative mechanism. This avoids out-of-stack errors. State is stored in allocated memory, running out of memory can always be detected. Allows matching more complex things, but Vim may seem to hang while doing that. Previously some options were always evaluated in the |sandbox|. Now that only happens when the option was set from a modeline or in secure mode. Applies to 'balloonexpr', 'foldexpr', 'foldtext' and 'includeexpr'. (Sumner Hayes) Some commands and expressions could have nasty side effects, such as using CTRL-R = while editing a search pattern and the expression invokes a function that jumps to another window. The |textlock| has been added to prevent this from happening. ":breakadd here" and ":breakdel here" can be used to set or delete a breakpoint at the cursor. It is now possible to define a function with: > :exe "func Test()\n ...\n endfunc" The tutor was updated to make it simpler to use and text was added to explain a few more important commands. Used ideas from Gabriel Zachmann. Unix: When libcall() fails obtain an error message with dlerror() and display it. (Johannes Zellner) Mac and Cygwin: When editing an existing file make the file name the same case of the edited file. Thus when typing ":e os_UNIX.c" the file name becomes "os_unix.c". Added "nbsp" in 'listchars'. (David Blanchet) Added the "acwrite" value for the 'buftype' option. This is for a buffer that does not have a name that refers to a file and is written with BufWriteCmd autocommands. For lisp indenting and matching parenthesis: (Sergey Khorev) - square brackets are recognized properly - #\(, #\), #\[ and #\] are recognized as character literals - Lisp line comments (delimited by semicolon) are recognized Added the "count" argument to match(), matchend() and matchstr(). (Ilya Sher) winnr() takes an optional "$" or "#" argument. (Nikolai Weibull, Yegappan Lakshmanan) Added 's' flag to search(): set ' mark if cursor moved. (Yegappan Lakshmanan) Added 'n' flag to search(): don't move the cursor. (Nikolai Weibull) Added 'c' flag to search(): accept match at the cursor. Added 'e' flag to search(): move to end of the match. (Benji Fisher) Added 'p' flag to search(): return number of sub-pattern. (Benji Fisher) These also apply to searchpos(), searchpair() and searchpairpos(). The search() and searchpair() functions have an extra argument to specify where to stop searching. Speeds up searches that should not continue too far. When uncompressing fails in the gzip plugin, give an error message but don't delete the raw text. Helps if the file has a .gz extension but is not actually compressed. (Andrew Pimlott) When C, C++ or IDL syntax is used, may additionally load doxygen syntax. (Michael Geddes) Support setting 'filetype' and 'syntax' to "aaa.bbb" for "aaa" plus "bbb" filetype or syntax. The ":registers" command now displays multi-byte characters properly. VMS: In the usage message mention that a slash can be used to make a flag upper case. Add color support to the builtin vt320 terminal codes. (Zoltan Arpadffy) For the '%' item in 'viminfo', allow a number to set a maximum for the number of buffers. For recognizing the file type: When a file looks like a shell script, check for an "exec" command that starts the tcl interpreter. (suggested by Alexios Zavras) Support conversion between utf-8 and latin9 (iso-8859-15) internally, so that digraphs still work when iconv is not available. When a session file is loaded while editing an unnamed, empty buffer that buffer is wiped out. Avoids that there is an unused buffer in the buffer list. Win32: When libintl.dll supports bind_textdomain_codeset(), use it. (NAKADAIRA Yukihiro) Win32: Vim was not aware of hard links on NTFS file systems. These are detected now for when 'backupcopy' is "auto". Also fixed a bogus "file has been changed since reading it" error for links. When foldtext() finds no text after removing the comment leader, use the second line of the fold. Helps for C-style /* */ comments where the first line is just "/*". When editing the same file from two systems (e.g., Unix and MS-Windows) there mostly was no warning for an existing swap file, because the name of the edited file differs (e.g., y:\dir\file vs /home/me/dir/file). Added a flag to the swap file to indicate it is in the same directory as the edited file. The used path then doesn't matter and the check for editing the same file is much more reliable. Unix: When editing a file through a symlink the swap file would use the name of the symlink. Now use the name of the actual file, so that editing the same file twice is detected. (suggestions by Stefano Zacchiroli and James Vega) Client-server communication now supports 'encoding'. When setting 'encoding' in a Vim server to "utf-8", and using "vim --remote fname" in a console, "fname" is converted from the console encoding to utf-8. Also allows Vims with different 'encoding' settings to exchange messages. Internal: Changed ga_room into ga_maxlen, so that it doesn't need to be incremented/decremented each time. When a register is empty it is not stored in the viminfo file. Removed the tcltags script, it's obsolete. ":redir @*>>" and ":redir @+>>" append to the clipboard. Better check for invalid characters after the register name. |:redir| ":redir => variable" and ":redir =>> variable" write or append to a variable. (Yegappan Lakshmanan) |:redir| ":redir @{a-z}>>" appends to register a to z. (Yegappan Lakshmanan) The 'verbosefile' option can be used to log messages in a file. Verbose messages are not displayed then. The "-V{filename}" argument can be used to log startup messages. ":let g:" lists global variables. ":let b:" lists buffer-local variables. ":let w:" lists window-local variables. ":let v:" lists Vim variables. The stridx() and strridx() functions take a third argument, where to start searching. (Yegappan Lakshmanan) The getreg() function takes an extra argument to be able to get the expression for the '=' register instead of the result of evaluating it. The setline() function can take a List argument to set multiple lines. When the line number is just below the last line the line is appended. g CTRL-G also shows the number of characters if it differs from the number of bytes. Completion for ":debug" and entering an expression for the '=' register. Skip ":" between range and command name. (Peter winters) CTRL-Q in Insert mode now works like CTRL-V by default. Previously it was ignored. When "beep" is included in 'debug' a function or script that causes a beep will result in a message with the source of the error. When completing buffer names, match with "\(^\|[\/]\)" instead of "^", so that ":buf stor<Tab>" finds both "include/storage.h" and "storage/main.c". To count items (pattern matches) without changing the buffer the 'n' flag has been added to |:substitute|. See |count-items|. In a |:substitute| command the \u, \U, \l and \L items now also work for multi-byte characters. The "screen.linux" $TERM name is recognized to set the default for 'background' to "dark". (Ciaran McCreesh) Also for "cygwin" and "putty". The |FileChangedShell| autocommand event can now use the |v:fcs_reason| variable that specifies what triggered the event. |v:fcs_choice| can be used to reload the buffer or ask the user what to do. Not all modifiers were recognized for xterm function keys. Added the possibility in term codes to end in ";*X" or "O*X", where X is any character and the * stands for the modifier code. Added the <xUp>, <xDown>, <xLeft> and <xRight> keys, to be able to recognize the two forms that xterm can send their codes in and still handle all possible modifiers. getwinvar() now also works to obtain a buffer-local option from the specified window. Added the "%s" item to 'errorformat'. (Yegappan Lakshmanan) Added the "%>" item to 'errorformat'. For 'errorformat' it was not possible to have a file name that contains the character that follows after "%f". For example, in "%f:%l:%m" the file name could not contain ":". Now include the first ":" where the rest of the pattern matches. In the example a ":" not followed by a line number is included in the file name. (suggested by Emanuele Giaquinta) GTK GUI: use the GTK file dialog when it's available. Mix from patches by Grahame Bowland and Evan Webb. Added ":scriptnames" to bugreport.vim, so that we can see what plugins were used. Win32: If the user changes the setting for the number of lines a scroll wheel click scrolls it is now used immediately. Previously Vim would need to be restarted. When using @= in an expression the value is expression @= contains. ":let @= = value" can be used to set the register contents. A ! can be added to ":popup" to have the popup menu appear at the mouse pointer position instead of the text cursor. The table with encodings has been expanded with many MS-Windows codepages, such as cp1250 and cp737, so that these can also be used on Unix without prepending "8bit-". When an encoding name starts with "microsoft-cp" ignore the "microsoft-" part. Added the "customlist" completion argument to a user-defined command. The user-defined completion function should return the completion candidates as a Vim List and the returned results are not filtered by Vim. (Yegappan Lakshmanan) Win32: Balloons can have multiple lines if common controls supports it. (Sergey Khorev) For command-line completion the matches for various types of arguments are now sorted: user commands, variables, syntax names, etc. When no locale is set, thus using the "C" locale, Vim will work with latin1 characters, using its own isupper()/toupper()/etc. functions. When using an rxvt terminal emulator guess the value of 'background' using the COLORFGBG environment variable. (Ciaran McCreesh) Also support t_SI and t_EI on Unix with normal features. (Ciaran McCreesh) When 'foldcolumn' is one then put as much info in it as possible. This allows closing a fold with the mouse by clicking on the '-'. input() takes an optional completion argument to specify the type of completion supported for the input. (Yegappan Lakshmanan) "dp" works with more than two buffers in diff mode if there is only one where 'modifiable' is set. The 'diffopt' option has three new values: "horizontal", "vertical" and "foldcolumn". When the 'include' option contains \zs the file name found is what is being matched from \zs to the end or \ze. Useful to pass more to 'includeexpr'. Loading plugins on startup now supports subdirectories in the plugin directory. |load-plugins| In the foldcolumn always show the '+' for a closed fold, so that it can be opened easily. It may overwrite another character, esp. if 'foldcolumn' is 1. It is now possible to get the W10 message again by setting 'readonly'. Useful in the FileChangedRO autocommand when checking out the file fails. Unix: When open() returns EFBIG give an appropriate message. ":mksession" sets the SessionLoad variable to notify plugins. A modeline is added to the session file to set 'filetype' to "vim". In the ATTENTION prompt put the "Delete it" choice before "Quit" to make it more logical. (Robert Webb) When appending to a file while the buffer has no name the name of the appended file would be used for the current buffer. But the buffer contents is actually different from the file content. Don't set the file name, unless the 'P' flag is present in 'cpoptions'. When starting to edit a new file and the directory for the file doesn't exist then Vim will report "[New DIRECTORY]" instead of "[New File] to give the user a hint that something might be wrong. Win32: Preserve the hidden attribute of the viminfo file. In Insert mode CTRL-A didn't keep the last inserted text when using CTRL-O and then a cursor key. Now keep the previously inserted text if nothing is inserted after the CTRL-O. Allows using CTRL-O commands to move the cursor without losing the last inserted text. The exists() function now supports checking for autocmd group definition and for supported autocommand events. (Yegappan Lakshmanan) Allow using ":global" in the sandbox, it doesn't do anything harmful by itself. ":saveas asdf.c" will set 'filetype' to c when it's empty. Also for ":w asdf.c" when it sets the filename for the buffer. Insert mode completion for whole lines now also searches unloaded buffers. The colortest.vim script can now be invoked directly with ":source" or ":runtime syntax/colortest.vim". The 'statusline' option can be local to the window, so that each window can have a different value. (partly by Yegappan Lakshmanan) The 'statusline' option and other options that support the same format can now use these new features: - When it starts with "%!" the value is first evaluated as an expression before parsing the value. - "%#HLname#" can be used to start highlighting with HLname. When 'statusline' is set to something that causes an error message then it is made empty to avoid an endless redraw loop. Also for other options, such at 'tabline' and 'titlestring'. ":verbose set statusline" will mention that it was set in an error handler. When there are several matching tags, the ":tag <name>" and CTRL-] commands jump to the [count] matching tag. (Yegappan Lakshmanan) Win32: In the batch files generated by the install program, use $VIMRUNTIME or $VIM if it's set. Example provided by Mathias Michaelis. Also create a vimtutor.bat batch file. The 'balloonexpr' option is now |global-local|. The system() function now runs in cooked mode, thus can be interrupted by CTRL-C. ============================================================================== COMPILE TIME CHANGES *compile-changes-7* Dropped the support for the BeOS and Amiga GUI. They were not maintained and probably didn't work. If you want to work on this: get the Vim 6.x version and merge it back in. When running the tests and one of them fails to produce "test.out" the following tests are still executed. This helps when running out of memory. When compiling with EXITFREE defined and the ccmalloc library, it is possible to detect memory leaks. Some memory will always be reported as leaked, such as allocated by X11 library functions and the memory allocated in alloc_cmdbuff() to store the ":quit" command. Moved the code for printing to src/hardcopy.c. Moved some code from main() to separate functions to make it easier to see what is being done. Using a structure to avoid a lot of arguments to the functions. Moved unix_expandpath() to misc1.c, so that it can also be used by os_mac.c without copying the code. --- Mac --- "make" now creates the Vim.app directory and "make install" copies it to its final destination. (Raf) Put the runtime directory not directly in Vim.app but in Vim.app/Contents/Resources/vim, so that it's according to Mac specs. Made it possible to compile with Motif, Athena or GTK without tricks and still being able to use the MacRoman conversion. Added the os_mac_conv.c file. When running "make install" the runtime files are installed as for Unix. Avoids that too many files are copied. When running "make" a link to the runtime files is created to avoid a recursive copy that takes much time. Configure will attempt to build Vim for both Intel and PowerPC. The --with-mac-arch configure argument can change it. --- Win32 --- The Make_mvc.mak file was adjusted to work with the latest MS compilers, including the free version of Visual Studio 2005. (George Reilly) INSTALLpc.txt was updated for the recent changes. (George Reilly) The distributed executable is now produced with the free Visual C++ Toolkit 2003 and other free SDK chunks. msvcsetup.bat was added to support this. Also generate the .pdb file that can be used to generate a useful crash report on MS-Windows. (George Reilly) ============================================================================== BUG FIXES *bug-fixes-7* When using PostScript printing on MS-DOS the default 'printexpr' used "lpr" instead of "copy". When 'printdevice' was empty the copy command did not work. Use "LPT1" then. The GTK font dialog uses a font size zero when the font name doesn't include a size. Use a default size of 10. This example in the documentation didn't work: :e `=foo . ".c"` Skip over the expression in `=expr` when looking for comments, |, % and #. When ":helpgrep" doesn't find anything there is no error message. "L" and "H" did not take closed folds into account. Win32: The "-P title" argument stopped at the first title that matched, even when it doesn't support MDI. Mac GUI: CTRL-^ and CTRL-@ did not work. "2daw" on "word." at the end of a line didn't include the preceding white space. Win32: Using FindExecutable() doesn't work to find a program. Use SearchPath() instead. For executable() use $PATHEXT when the program searched for doesn't have an extension. When 'virtualedit' is set, moving the cursor up after appending a character may move it to a different column. Was caused by auto-formatting moving the cursor and not putting it back where it was. When indent was added automatically and then moving the cursor, the indent was not deleted (like when pressing ESC). The "I" flag in 'cpoptions' can be used to make it work the old way. When opening a command-line window, 'textwidth' gets set to 78 by the Vim filetype plugin. Reset 'textwidth' to 0 to avoid lines are broken. After using cursor(line, col) moving up/down doesn't keep the same column. Win32: Borland C before 5.5 requires using ".u." for LowPart and HighPart fields. (Walter Briscoe) On Sinix SYS_NMLN isn't always defined. Define it ourselves. (Cristiano De Michele) Printing with PostScript may keep the printer waiting for more. Append a CTRL-D to the printer output. (Mike Williams) When converting a string with a hex or octal number the leading '-' was ignored. ":echo '-05' + 0" resulted in 5 instead of -5. Using "@:" to repeat a command line didn't work when it contains control characters. Also remove "'<,'>" when in Visual mode to avoid that it appears twice. When using file completion for a user command, it would not expand environment variables like for a regular command with a file argument. 'cindent': When the argument of a #define looks like a C++ class the next line is indented too much. When 'comments' includes multi-byte characters inserting the middle part and alignment may go wrong. 'cindent' also suffers from this for right-aligned items. Win32: when 'encoding' is set to "utf-8" getenv() still returns strings in the active codepage. Convert to utf-8. Also for $HOME. The default for 'helplang' was "zh" for both "zh_cn" and "zh_tw". Now use "cn" or "tw" as intended. When 'bin' is set and 'eol' is not set then line2byte() added the line break after the last line while it's not there. Using foldlevel() in a WinEnter autocommand may not work. Noticed when resizing the GUI shell upon startup. Python: Using buffer.append(f.readlines()) didn't work. Allow appending a string with a trailing newline. The newline is ignored. When using the ":saveas f2" command for buffer "f1", the Buffers menu would contain "f2" twice, one of them leading to "f1". Also trigger the BufFilePre and BufFilePost events for the alternate buffer that gets the old name. strridx() did not work well when the needle is empty. (Ciaran McCreesh) GTK: Avoid a potential hang in gui_mch_wait_for_chars() when input arrives just before it is invoked VMS: Occasionally CR characters were inserted in the file. Expansion of environment variables was not correct. (Zoltan Arpadffy) UTF-8: When 'delcombine' is set "dw" only deleted the last combining character from the first character of the word. When using ":sball" in an autocommand only the filetype in one buffer was detected. Reset did_filetype in enter_buffer(). When using ":argdo" and the window already was at the first argument index, but not actually editing it, the current buffer would be used instead. When ":next dir/*" includes many matches, adding the names to the argument list may take an awful lot of time and can't be interrupted. Allow interrupting this. When editing a file that was already loaded in a buffer, modelines were not used. Now window-local options in the modeline are set. Buffer-local options and global options remain unmodified. Win32: When 'encoding' is set to "utf-8" in the vimrc file, files from the command line with non-ASCII characters are not used correctly. Recode the file names when 'encoding' is set, using the Unicode command line. Win32 console: When the default for 'encoding' ends up to be "latin1", the default value of 'isprint' was wrong. When an error message is given while waiting for a character (e.g., when an xterm reports the number of colors), the hit-enter prompt overwrote the last line. Don't reset msg_didout in normal_cmd() for K_IGNORE. Mac GUI: Shift-Tab didn't work. When defining tooltip text, don't translate terminal codes, since it's not going to be used like a command. GTK 2: Check the tooltip text for valid utf-8 characters to avoid getting a GTK error. Invalid characters may appear when 'encoding' is changed. GTK 2: Add a safety check for invalid utf-8 sequences, they can crash pango. Win32: When 'encoding' is changed while starting up, use the Unicode command line to convert the file arguments to 'encoding'. Both for the GUI and the console version. Win32 GUI: latin9 text (iso-8859-15) was not displayed correctly, because there is no codepage for latin9. Do our own conversion from latin9 to UCS2. When two versions of GTK+ 2 are installed it was possible to use the header files from one and the library from the other. Use GTK_LIBDIR to put the directory for the library early in the link flags. With the GUI find/replace dialog a replace only worked if the pattern was literal text. Now it works for any pattern. When 'equalalways' is set and 'eadirection' is "hor", ":quit" would still cause equalizing window heights in the vertical direction. When ":emenu" is used in a startup script the command was put in the typeahead buffer, causing a prompt for the crypt key to be messed up. Mac OS/X: The default for 'isprint' included characters 128-160, causes problems for Terminal.app. When a syntax item with "containedin" is used, it may match in the start or end of a region with a matchgroup, while this doesn't happen for a "contains" argument. When a transparent syntax items matches in another item where the highlighting has already stopped (because of a he= argument), the highlighting would come back. When cscope is used to set the quickfix error list, it didn't get set if there was only one match. (Sergey Khorev) When 'confirm' is set and using ":bdel" in a modified buffer, then selecting "cancel", would still give an error message. The PopUp menu items that started Visual mode didn't work when not in Normal mode. Switching between selecting a word and a line was not possible. Win32: The keypad decimal point always resulted in a '.', while on some keyboards it's a ','. Use MapVirtualKey(VK_DECIMAL, 2). Removed unused function DisplayCompStringOpaque() from gui_w32.c In Visual mode there is not always an indication whether the line break is selected or not. Highlight the character after the line when the line break is included, e.g., after "v$o". GTK: The <F10> key can't be mapped, it selects the menu. Disable that with a GTK setting and do select the menu when <F10> isn't mapped. (David Necas) After "Y" '[ and '] were not at start/end of the yanked text. When a telnet connection is dropped Vim preserves files and exits. While doing that a SIGHUP may arrive and disturb us, thus ignore it. (Scott Anderson) Also postpone SIGHUP, SIGQUIT and SIGTERM until it's safe to handle. Added handle_signal(). When completing a file name on the command line backslashes are required for white space. Was only done for a space, not for a Tab. When configure could not find a terminal library, compiling continued for a long time before reporting the problem. Added a configure check for tgetent() being found in a library. When the cursor is on the first char of the last line a ":g/pat/s///" command may cause the cursor to be displayed below the text. Win32: Editing a file with non-ASCII characters doesn't work when 'encoding' is "utf-8". use _wfullpath() instead of _fullpath(). (Yu-sung Moon) When recovering the 'fileformat' and 'fileencoding' were taken from the original file instead of from the swapfile. When the file didn't exist, was empty or the option was changed (e.g., with ":e ++fenc=cp123 file") it could be wrong. Now store 'fileformat' and 'fileencoding' in the swapfile and use the values when recovering. ":bufdo g/something/p" overwrites each last printed text line with the file message for the next buffer. Temporarily clear 'shortmess' to avoid that. Win32: Cannot edit a file starting with # with --remote. Do escape % and # when building the ":drop" command. A comment or | just after an expression-backtick argument was not recognized. E.g. in :e `="foo"`"comment. "(" does not stop at an empty sentence (single dot and white space) while ")" does. Also breaks "das" on that dot. When doing "yy" with the cursor on a TAB the ruler could be wrong and "k" moved the cursor to another column. When 'commentstring' is '"%s' and there is a double quote in the line a double quote before the fold marker isn't removed in the text displayed for a closed fold. In Visual mode, when 'bin' and 'eol' set, g CTRL-G counted the last line break, resulting in "selected 202 of 201 bytes". Motif: fonts were not used for dialog components. (Marcin Dalecki) Motif: After using a toolbar button the keyboard focus would be on the toolbar (Lesstif problem). (Marcin Dalecki) When using "y<C-V>`x" where mark x is in the first column, the last line was not included. Not all test scripts work properly on MS-Windows when checked out from CVS. Use a Vim command to fix all fileformats to dos before executing the tests. When using ":new" and the file fits in the window, lines could still be above the window. Now remove empty lines instead of keeping the relative position. Cmdline completion didn't work after ":let var1 var<Tab>". When using ":startinsert" or ":startreplace" when already in Insert mode (possible when using CTRL-R =), pressing Esc would directly restart Insert mode. (Peter Winters) "2daw" didn't work at end of file if the last word is a single character. Completion for ":next a'<Tab>" put a backslash before single quote, but it was not removed when editing a file. Now halve backslashes in save_patterns(). Also fix expanding a file name with the shell that contains "\'". When doing "1,6d|put" only "fewer lines" was reported. Now a following "more lines" overwrites the message. Configure could not handle "-Dfoo=long\ long" in the TCL config output. When searching backwards, using a pattern that matches a newline and uses \zs after that, didn't find a match. Could also get a hang or end up in the right column in the wrong line. When $LANG is "sl" for slovenian, the slovak menu was used, since "slovak" starts with "sl". When 'paste' is set in the GUI the Paste toolbar button doesn't work. Clear 'paste' when starting the GUI. A message about a wrong viminfo line included the trailing NL. When 'paste' is set in the GUI the toolbar button doesn't work in Insert mode. Use ":exe" in menu.vim to avoid duplicating the commands, instead of using a mapping. Treat "mlterm" as an xterm-like terminal. (Seiichi Sato) ":z.4" and ":z=4" didn't work Vi compatible. When sourcing a file, editing it and sourcing it again, it could appear twice in ":scriptnames" and get a new <SID>, because the inode has changed. When $SHELL is set but empty the 'shell' option would be empty. Don't use an empty $SHELL value. A command "w! file" in .vimrc or $EXINIT didn't work. Now it writes an empty file. When a CTRL-F command at the end of the file failed, the cursor was still moved to the start of the line. Now it remains where it is. When using ":s" or "&" to repeat the last substitute and "$" was used to put the cursor in the last column, put the cursor in the last column again. This is Vi compatible. Vim is not fully POSIX compliant but sticks with traditional Vi behavior. Added a few flags in 'cpoptions' to behave the POSIX way when wanted. The $VIM_POSIX environment variable is checked to set the default. Appending to a register didn't insert a line break like Vi. Added the '>' flag to 'cpoptions' for this. Using "I" in a line with only blanks appended to the line. This is not Vi compatible. Added the 'H' flag in 'coptions' for this. When joining multiple lines the cursor would be at the last joint, but Vi leaves it at the position where "J" would put it. Added the 'q' flag in 'cpoptions' for this. Autoindent didn't work for ":insert" and ":append". Using ":append" in an empty buffer kept the dummy line. Now it's deleted to be Vi compatible. When reading commands from a file and stdout goes to a terminal, would still request the xterm version. Vim can't read it, thus the output went to the shell and caused trouble there. When redirecting to a register with an invalid name the redirection would still be done (after an error message). Now reset "redir_reg". (Yegappan Lakshmanan) It was not possible to use a NL after a backslash in Ex mode. This is sometimes used to feed multiple lines to a shell command. When 'cmdheight' is set to 2 in .vimrc and the GUI uses the number of lines from the terminal we actually get 3 lines for the cmdline in gvim. When setting $HOME allocated memory would leak. Win32: bold characters may sometimes write in another character cell. Use unicodepdy[] as for UTF-8. (Taro Muraoka) ":w fname" didn't work for files with 'buftype' set to "nofile". The method used to locate user commands for completion differed from when they are executed. Ambiguous command names were not completed properly. Incremental search may cause a crash when there is a custom statusline that indirectly invokes ":normal". Diff mode failed when $DIFF_OPTIONS was set in the environment. Unset it before invoking "diff". Completion didn't work after ":argdo", ":windo" and ":bufdo". Also for ":set &l:opt" and ":set &g:opt". (Peter Winters) When setting 'ttymouse' to "dec" in an xterm that supports the DEC mouse locator it doesn't work. Now switch off the mouse before selecting another mouse model. When the CursorHold event is triggered and the commands peek for typed characters the typeahead buffer may be messed up, e.g., when a mouse-up event is received. Avoid invoking the autocommands from the function waiting for a character, let it put K_CURSORHOLD in the input buffer. Removed the "COUNT" flag from ":argadd", to avoid ":argadd 1*" to be used like ":1argadd *". Same for ":argdelete" and ":argedit". Avoid that $LANG is used for the menus when LC_MESSAGES is "en_US". Added backslashes before dashes in the vim.1 manual page to make them appear as real dashes. (Pierre Habouzit) Where "gq" left the cursor depended on the value of 'formatprg'. Now "gq" always leaves the cursor at the last line of the formatted text. When editing a compressed file, such as "changelog.Debian.gz" file, filetype detection may try to check the contents of the file while it's still compressed. Skip setting 'filetype' for compressed files until they have been decompressed. Required for patterns that end in a "*". Starting with an argument "+cmd" or "-S script" causes the cursor to be moved to the first line. That breaks a BufReadPost autocommand that uses g`". Don't move the cursor if it's somewhere past the first line. "gg=G" while 'modifiable' is off was uninterruptible. When 'encoding' is "sjis" inserting CTRL-V u d800 a few times causes a crash. Don't insert a DBCS character with a NUL second byte. In Insert mode CTRL-O <Home> didn't move the cursor. Made "ins_at_eol" global and reset it in nv_home(). Wildcard expansion failed: ":w /tmp/$$.`echo test`". Don't put quotes around spaces inside backticks. After this sequence of commands: Y V p gv: the wrong line is selected. Now let "gv" select the text that was put, since the original text is deleted. This should be the most useful thing to do. ":sleep 100u" sleeps for 100 seconds, not 100 usec as one might expect. Give an error message when the argument isn't recognized. In gui_mch_draw_string() in gui_w32.c "unibuflen" wasn't static, resulting in reallocating the buffer every time. (Alexei Alexandrov) When using a Python "atexit" function it was not invoked when Vim exits. Now call Py_Finalize() for that. (Ugo Di Girolamo) This breaks the thread stuff though, fixed by Ugo. GTK GUI: using a .vimrc with "set cmdheight=2 lines=43" and ":split" right after startup, the window layout is messed up. (Michael Schaap) Added win_new_shellsize() call in gui_init() to fix the topframe size. Trick to get ...MOUSE_NM not used when there are vertical splits. Now pass column -1 for the left most window and add MOUSE_COLOFF for others. Limits mouse column to 10000. searchpair() may hang when the end pattern has "\zs" at the end. Check that we find the same position again and advance one character. When in diff mode and making a change that causes the "changed" highlighting to disappear or reappear, it was still highlighted in another window. When a ":next" command fails because the user selects "Abort" at the ATTENTION prompt the argument index was advanced anyway. When "~" is in 'iskeyword' the "gd" doesn't work, it's used for the previous substitute pattern. Put "\V" in the pattern to avoid that. Use of sprintf() sometimes didn't check properly for buffer overflow. Also when using smsg(). Included code for snprintf() to avoid having to do size checks where invoking them ":help \=<Tab>" didn't find "sub-replace-\=". Wild menu for help tags didn't show backslashes. ":he :s\=" didn't work. When reading an errorfile "~/" in a file name was not expanded. GTK GUI: When adding a scrollbar (e.g. when using ":vsplit") in a script or removing it the window size may change. GTK sends us resize events when we change the window size ourselves, but they may come at an unexpected moment. Peek for a character to get any window resize events and fix 'columns' and 'lines' to undo this. When using the GTK plug mechanism, resizing and focus was not working properly. (Neil Bird) After deleting files from the argument list a session file generated with ":mksession" may contain invalid ":next" commands. When 'shortmess' is empty and 'keymap' set to accents, in Insert mode CTRL-N may cause the hit-enter prompt. Typing 'a then didn't result in the accented character. Put the character typed at the prompt back in the typeahead buffer so that mapping is done in the right mode. setbufvar() and setwinvar() did not give error messages. It was possible to set a variable with an illegal name, e.g. with setbufvar(). It was possible to define a function with illegal name, e.t. ":func F{-1}()" CTRL-W F and "gf" didn't use the same method to get the file name. When reporting a conversion error the line number of the last error could be given. Now report the first encountered error. When using ":e ++enc=name file" and iconv() was used for conversion an error caused a fall-back to no conversion. Now replace a character with '?' and continue. When opening a new buffer the local value of 'bomb' was not initialized from the global value. Win32: When using the "Edit with Vim" entry the file name was limited to about 200 characters. When using command line completion for ":e *foo" and the file "+foo" exists the resulting command ":e +foo" doesn't work. Now insert a backslash: ":e \+foo". When the translation of "-- More --" was not 10 characters long the following message would be in the wrong position. At the more-prompt the last character in the last line wasn't drawn. When deleting non-existing text while 'virtualedit' is set the '[ and '] marks were not set. Win32: Could not use "**/" in 'path', it had to be "**\". The search pattern "\n" did not match at the end of the last line. Searching for a pattern backwards, starting on the NUL at the end of the line and 'encoding' is "utf-8" would match the pattern just before it incorrectly. Affected searchpair('/\*', '', '\*/'). For the Find/Replace dialog it was possible that not finding the text resulted in an error message while redrawing, which cleared the syntax highlighting while it was being used, resulting in a crash. Now don't clear syntax highlighting, disable it with b_syn_error. Win32: Combining UTF-8 characters were drawn on the previous character. Could be noticed with a Thai font. Output of ":function" could leave some of the typed text behind. (Yegappan Lakshmanan) When the command line history has only a few lines the command line window would be opened with these lines above the first window line. When using a command line window for search strings ":qa" would result in searching for "qa" instead of quitting all windows. GUI: When scrolling with the scrollbar and there is a line that doesn't fit redrawing may fail. Make sure w_skipcol is valid before redrawing. Limit the values of 'columns' and 'lines' to avoid an overflow in Rows * Columns. Fixed bad effects when running out of memory (command line would be reversed, ":qa!" resulted in ":!aq"). Motif: "gvim -iconic" opened the window anyway. (David Harrison) There is a tiny chance that a symlink gets created between checking for an existing file and creating a file. Use the O_NOFOLLOW for open() if it's available. In an empty line "ix<CTRL-O>0" moved the cursor to after the line instead of sticking to the first column. When using ":wq" and a BufWriteCmd autocmd uses inputsecret() the text was echoed anyway. Set terminal to raw mode in getcmdline(). Unix: ":w a;b~c" caused an error in expanding wildcards. When appending to a file with ":w >>fname" in a buffer without a name, causing the buffer to use "fname", the modified flag was reset. When appending to the current file the "not edited" flag would be reset. ":w" would overwrite the file accidentally. Unix: When filtering text with an external command Vim would still read input, causing text typed for the command (e.g., a password) to be eaten and echoed. Don't read input when the terminal is in cooked mode. The Cygwin version of xxd used CR/LF line separators. (Corinna Vinschen) Unix: When filtering text through a shell command some resulting text may be dropped. Now after detecting that the child has exited try reading some more of its output. When inside input(), using "CTRL-R =" and the expression throws an exception the command line was not abandoned but it wasn't used either. Now abandon typing the command line. 'delcombine' was also used in Visual and Select mode and for commands like "cl". That was illogical and has been disabled. When recording while a CursorHold autocommand was defined special keys would appear in the register. Now the CursorHold event is not triggered while recording. Unix: the src/configure script used ${srcdir-.}, not all shells understand that. Use ${srcdir:-.} instead. When editing file "a" which is a symlink to file "b" that doesn't exist, writing file "a" to create "b" and then ":split b" resulted in two buffers on the same file with two different swapfile names. Now set the inode in the buffer when creating a new file. When 'esckeys' is not set don't send the xterm code to request the version string, because it may cause trouble in Insert mode. When evaluating an expression for CTRL-R = on the command line it was possible to call a function that opens a new window, resulting in errors for incremental search, and many other nasty things were possible. Now use the |textlock| to disallow changing the buffer or jumping to another window to protect from unexpected behavior. Same for CTRL-\ e. "d(" deleted the character under the cursor, while the documentation specified an exclusive motion. Vi also doesn't delete the character under the cursor. Shift-Insert in Insert mode could put the cursor before the last character when it just fits in the window. In coladvance() don't stop at the window edge when filling with spaces and when in Insert mode. In mswin.vim avoid getting a beep from the "l" command. Win32 GUI: When Alt-F4 is used to close the window and Cancel is selected in the dialog then Vim would insert <M-F4> in the text. Now it's ignored. When ":silent! {cmd}" caused the swap file dialog, which isn't displayed, there would still be a hit-enter prompt. Requesting the termresponse (|t_RV|) early may cause problems with "-c" arguments that invoke an external command or even "-c quit". Postpone it until after executing "-c" arguments. When typing in Insert mode so that a new line is started, using CTRL-G u to break undo and start a new change, then joining the lines with <BS> caused undo info to be missing. Now reset the insertion start point. Syntax HL: When a region start match has a matchgroup and an offset that happens to be after the end of the line then it continued in the next line and stopped at the region end match, making the region continue after that. Now check for the column being past the end of the line in syn_add_end_off(). When changing a file, setting 'swapfile' off and then on again, making another change and killing Vim, then some blocks may be missing from the swapfile. When 'swapfile' is switched back on mark all blocks in the swapfile as dirty. Added mf_set_dirty(). Expanding wildcards in a command like ":e aap;<>!" didn't work. Put backslashes before characters that are special to the shell. (Adri Verhoef) A CursorHold autocommand would cause a message to be cleared. Don't show the special key for the event for 'showcmd'. When expanding a file name for a shell command, as in "!cmd foo<Tab>" or ":r !cmd foo<Tab>" also escape characters that are special for the shell: "!;&()<>". When the name of the buffer was set by a ":r fname" command |cpo-f| no autocommands were triggered to notify about the change in the buffer list. In the quickfix buffer 'bufhidden' was set to "delete", which caused closing the quickfix window to leave an unlisted "No Name" buffer behind every time. Win32: when using two screens of different size, setting 'lines' to a large value didn't fill the whole screen. (SungHyun Nam) Win32 installer: The generated _vimrc contained an absolute path to diff.exe. After upgrading it becomes invalid. Now use $VIMRUNTIME instead. The command line was cleared to often when 'showmode' was set and ":silent normal vy" was used. Don't clear the command line unless the mode was actually displayed. Added the "mode_displayed" variable. The "load session" toolbar item could not handle a space or other special characters in v:this_session. ":set sta ts=8 sw=4 sts=2" deleted 4 spaces halfway a line instead of 2. In a multi-byte file the foldmarker could be recognized in the trail byte. (Taro Muraoka) Pasting with CTRL-V and menu didn't work properly when some commands are mapped. Use ":normal!" instead of ":normal". (Tony Apuzzo) Crashed when expanding a file name argument in backticks. In some situations the menu and scrollbar didn't work, when the value contains a CSI byte. (Yukihiro Nakadaira) GTK GUI: When drawing the balloon focus changes and we might get a key release event that removed the balloon again. Ignore the key release event. 'titleold' was included in ":mkexrc" and ":mksession" files. ":set background&" didn't use the same logic as was used when starting up. When "umask" is set such that nothing is writable then the viminfo file would be written without write permission. (Julian Bridle) Motif: In diff mode dragging one scrollbar didn't update the scrollbar of the other diff'ed window. When editing in an xterm with a different number of colors than expected the screen would be cleared and redrawn, causing the message about the edited file to be cleared. Now set "keep_msg" to redraw the last message. For a color terminal: When the Normal HL uses bold, possibly to make the color lighter, and another HL group specifies a color it might become light as well. Now reset bold if a HL group doesn't specify bold itself. When using 256 color xterm the color 255 would show up as color 0. Use a short instead of a char to store the color number. ml_get errors when searching for "\n\zs" in an empty file. When selecting a block and using "$" to select until the end of every line and not highlighting the character under the cursor the first character of the block could be unhighlighted. When counting words for the Visual block area and using "$" to select until the end of every line only up to the length of the last line was counted. "dip" in trailing empty lines left one empty line behind. The script ID was only remembered globally for each option. When a buffer- or window-local option was set the same "last set" location was changed for all buffers and windows. Now remember the script ID for each local option separately. GUI: The "Replace All" button didn't handle backslashes in the replacement in the same way as "Replace". Escape backslashes so that they are taken literally. When using Select mode from Insert mode and typing a key, causing lines to be deleted and a message displayed, delayed the effect of inserting the key. Now overwrite the message without delay. When 'whichwrap' includes "l" then "dl" and "yl" on a single letter line worked differently. Now recognize all operators when using "l" at the end of a line. GTK GUI: when the font selector returned a font name with a comma in it then it would be handled like two font names. Now put a backslash before the comma. MS-DOS, Win32: When 'encoding' defaults to "latin1" then the value for 'iskeyword' was still for CPxxx. And when 'nocompatible' was set 'isprint' would also be the wrong value. When a command was defined not to take arguments and no '|' no warning message would be given for using a '|'. Also with ":loadkeymap". Motif: When using a fontset and 'encoding' is "utf-8" and sizeof(wchar_t) != sizeof(XChar2b) then display was wrong. (Yukihiro Nakadaira) ":all" always set the current window to the first window, even when it contains a buffer that is not in the argument list (can't be closed because it is modified). Now go to the window that has the first item of the argument list. GUI: To avoid left-over pixels from bold text all characters after a character with special attributes were redrawn. Now only do this for characters that actually are bold. Speeds up displaying considerably. When only highlighting changes and the text is scrolled at the same time everything is redrawn instead of using a scroll and updating the changed text. E.g., when using ":match" to highlight a paren that the cursor landed on. Added SOME_VALID: Redraw the whole window but also try to scroll to minimize redrawing. Win32: When using Korean IME making it active didn't work properly. (Moon, Yu-sung, 2005 March 21) Ruby interface: when inserting/deleting lines display wasn't updated. (Ryan Paul) --- fixes since Vim 7.0b --- Getting the GCC version in configure didn't work with Solaris sed. First strip any "darwin." and then get the version number. The "autoload" directory was missing from the self-installing executable for MS-Windows. The MS-Windows install program would find "vimtutor.bat" in the install directory. After changing to "c:" also change to "\" to avoid looking in the install directory. To make the 16 bit DOS version compile exclude not used highlight initializations and build a tiny instead of small version. finddir() and findfile() accept a negative count and return a List then. The Python indent file contained a few debugging statements, removed. Expanding {} for a function name, resulting in a name starting with "s:" was not handled correctly. Spelling: renamed COMPOUNDMAX to COMPOUNDWORDMAX. Added several items to be able to handle the new Hungarian dictionary. Mac: Default to building for the current platform only, that is much faster than building a universal binary. Also, using Perl/Python/etc. only works for the current platform. The time on undo messages disappeared for someone. Using %T for strftime() apparently doesn't work everywhere. Use %H:%M:%S instead. Typing BS at the "z=" prompt removed the prompt. --- fixes and changes since Vim 7.0c --- When jumping to another tab page the Vim window size was always set, even when nothing in the layout changed. Win32 GUI tab pages line wasn't always enabled. Do a proper check for the compiler version. Win32: When switching between tab pages the Vim window was moved when part of it was outside of the screen. Now only do that in the direction of a size change. Win32: added menu to GUI tab pages line. (Yegappan Lakshmanan) Mac: Added document icons. (Benji Fisher) Insert mode completion: Using Enter to accept the current match causes confusion. Use CTRL-Y instead. Also, use CTRL-E to go back to the typed text. GUI: When there are left and right scrollbars, ":tabedit" kept them instead of using the one that isn't needed. Using "gP" to replace al the text could leave the cursor below the last line, causing ml_get errors. When 'cursorline' is set don't use the highlighting when Visual mode is active, otherwise it's difficult to see the selected area. The matchparen plugin restricts the search to 100 lines, to avoid a long delay when there are closed folds. Sometimes using CTRL-X s to list spelling suggestions used text from another line. Win32: Set the default for 'isprint' back to the wrong default "@,~-255", because many people use Windows-1252 while 'encoding' is "latin1". GTK: Added a workaround for gvim crashing when used over an untrusted ssh link, caused by GTK doing something nasty. (Ed Catmur) Win32: The font used for the tab page labels is too big. Use the system menu font. (George Reilly) Win32: Adjusting the window position and size to keep it on the screen didn't work properly when the taskbar is on the left or top of the screen. The installman.sh and installml.sh scripts use ${10}, that didn't work with old shells. And use "test -f" instead of "test -e". Win32: When 'encoding' was set in the vimrc then a directory argument for diff mode didn't work. GUI: at the inputlist() prompt the cursorshape was adjusted as if the windows were still at their old position. The parenmatch plugin didn't remember the highlighting per window. Using ":bd" for a buffer that's the current window in another tab page caused a crash. For a new tab page the 'scroll' option wasn't set to a good default. Using an end offset for a search "/pat/e" didn't work properly for multi-byte text. (Yukihiro Nakadaira) ":s/\n/,/" doubled the text when used on the last line. When "search" is in 'foldopen' "[s" and "]s" now open folds. When using a numbered function "dict" can be omitted, but "self" didn't work then. Always add FC_DICT to the function flags when it's part of a dictionary. When "--remote-tab" executes locally it left an empty tab page. "gvim -u NONE", ":set cursorcolumn", "C" in the second line didn't update text. Do update further lines even though the "$" is displayed. VMS: Support GTK better, also enable +clientserver. (Zoltan Arpadffy) When highlighting of statusline or tabline is changed there was no redraw to show the effect. Mac: Added "CFBundleIdentifier" to infplist.xml. Added tabpage-local variables t:var. Win32: Added double-click in tab pages line creates new tab. (Yegappan Lakshmanan) Motif: Added GUI tab pages line. (Yegappan Lakshmanan) Fixed crash when 'lines' was set to 1000 in a modeline. When init_spellfile() finds a writable directory in 'runtimepath' but it doesn't contain a "spell" directory, create one. Win32: executable() also finds "xxd" in the directory where Vim was started, but "!xxd" doesn't work. Append the Vim starting directory to $PATH. The tab page labels are shortened, directory names are reduced to a single letter by default. Added the pathshorten() function to allow a user to do the same. ":saveas" now resets 'readonly' if the file was successfully written. Set $MYVIMRC file to the first found .vimrc file. Set $MYGVIMRC file to the first found .gvimrc file. Added menu item "Startup Settings" that edits the $MYVIMRC file Added matcharg(). Error message E745 appeared twice. Renamed one to E786. Fixed crash when using "au BufRead * Sexplore" and doing ":help". Was wiping out a buffer that's still in a window. ":hardcopy" resulted in an error message when 'encoding' is "utf-8" and 'printencoding' is empty. Now it assumes latin1. (Mike Williams) The check for the toolbar feature for Motif, depending on certain included files, wasn't detailed enough, causing building to fail in gui_xmebw.c. Using CTRL-E in Insert mode completion after CTRL-P inserted the first match instead of the original text. When displaying a UTF-8 character with a zero lower byte Vim might think the previous character is double-wide. The "nbsp" item of 'listchars' didn't work when 'encoding' was utf-8. Motif: when Xm/xpm.h is missing gui_xmebw.c would not compile. HAVE_XM_UNHIGHLIGHTT_H was missing a T. Mac: Moved the .icns files into src/os_mac_rsrc, so that they can all be copied at once. Adjusted the Info.plist file for three icons. When Visual mode is active while switching to another tabpage could get ml_get errors. When 'list' is set, 'nowrap' the $ in the first column caused 'cursorcolumn' to move to the right. When a line wraps, 'cursorcolumn' was never displayed past the end of the line. 'autochdir' was only available when compiled with NetBeans and GUI. Now it's a separate feature, also available in the "big" version. Added CTRL-W gf: open file under cursor in new tab page. When using the menu in the tab pages line, "New Tab" opens the new tab before where the click was. Beyond the labels the new tab appears at the end instead of after the current tab page. Inside a mapping with an expression getchar() could not be used. When vgetc is used recursively vgetc_busy protects it from being used recursively. But after a ":normal" command the protection was reset. ":s/a/b/n" didn't work when 'modifiable' was off. When $VIMRUNTIME includes a multi-byte character then rgb.txt could not be found. (Yukihiro Nakadaira) ":mkspell" didn't work correctly for non-ASCII affix flags when conversion is needed on the spell file. glob('/dir/\$ABC/*') didn't work. When using several tab pages and changing 'cmdheight' the display could become messed up. Now store the value of 'cmdheight' separately for each tab page. The user of the Enter key while the popup menu is visible was still confusing. Now use Enter to select the match after using a cursor key. Added "usetab" to 'switchbuf'. --- fixes and changes since Vim 7.0d --- Added CTRL-W T: move a window to a new tab page. Using CTRL-X s in Insert mode to complete spelling suggestions and using BS deleted characters before the bad word. A few small fixes for the VMS makefile. (Zoltan Arpadffy) With a window of 91 lines 45 cols, ":vsp" scrolled the window. Copy w_wrow when splitting a window and skip setting the height when it's already at the right value. Using <silent> in a mapping with a shell command and the GUI caused redraw to use wrong attributes. Win32: Using MSVC 4.1 for install.exe resulted in the start menu items to be created in the administrator directory instead of "All Users". Define the CSIDL_ items if they are missing. Motif: The GUI tabline did not use the space above the right scrollbar. Work around a bug in the Motif library. (Yegappan Lakshmanan) The extra files for XML Omni completion are now also installed. |xml-omni-datafile| GTK GUI: when 'm' is missing from 'guioptions' during startup and pressing <F10> GTK produced error messages. Now do create the menu but disable it just after the first gui_mch_update(). ":mkspell" doesn't work well with the Hungarian dictionary from the Hunspell project. Back to the Myspell dictionary. In help files hide the | used around tags. Renamed pycomplete to pythoncomplete. Added "tabpages" to 'sessionoptions'. When 'guitablabel' is set the effect wasn't visible right away. Fixed a few 'cindent' errors. When completing menu names, e.g., after ":emenu", don't sort the entries but keep them in the original order. Fixed a crash when editing a directory in diff mode. Don't trigger autocommands when executing the diff command. Getting a keystroke could get stuck if 'encoding' is a multi-byte encoding and typing a special key. When 'foldignore' is set the folds were not updated right away. When a list is indexed with [a : b] and b was greater than the length an error message was given. Now silently truncate the result. When using BS during Insert mode completion go back to the original text, so that CTRL-N selects the first matching entry. Added the 'M' flag to 'cinoptions'. Win32: Make the "gvim --help" window appear in the middle of the screen instead of at an arbitrary position. (Randall W. Morris) Added gettabwinvar() and settabwinvar(). Command line completion: pressing <Tab> after ":e /usr/*" expands the whole tree, because it becomes ":e /usr/**". Don't add a star if there already is one. Added grey10 to grey90 to all GUIs, so that they can all be used for initializing highlighting. Use grey40 for CursorColumn and CursorLine when 'background' is "dark". When reading a file and using iconv for conversion, an incomplete byte sequence at the end caused problems. (Yukihiro Nakadaira) --- fixes and changes since Vim 7.0e --- Default color for MatchParen when 'background' is "dark" is now DarkCyan. ":syn off" had to be used twice in a file that sets 'syntax' in a modeline. (Michael Geddes) When using ":vsp" or ":sp" the available space wasn't used equally between windows. (Servatius Brandt) Expanding <cWORD> on a trailing blank resulted in the first word in the line if 'encoding' is a multi-byte encoding. Spell checking: spellbadword() didn't see a missing capital in the first word of a line. Popup menu now only suggest the capitalized word when appropriate. When using whole line completion CTRL-L moves through the matches but it didn't work when at the original text. When completion finds the longest match, don't go to the first match but stick at the original text, so that CTRL-N selects the first one. Recognize "zsh-beta" like "zsh" for setting the 'shellpipe' default. (James Vega) When using ":map <expr>" and the expression results in something with a special byte (NUL or CSI) then it didn't work properly. Now escape special bytes. The default Visual highlighting for a color xterm with 8 colors was a magenta background, which made magenta text disappear. Now use reverse in this specific situation. After completing the longest match "." didn't insert the same text. Repeating also didn't work correctly for multi-byte text. When using Insert mode completion and BS the whole word that was completed would result in all possible matches. Now stop completion. Also fixes that for spell completion the previous word was deleted. GTK: When 'encoding' is "latin1" and using non-ASCII characters in a file name the tab page label was wrong and an error message would be given. The taglist() function could hang on a tags line with a non-ASCII character. Win32: When 'encoding' differs from the system encoding tab page labels with non-ASCII characters looked wrong. (Yegappan Lakshmanan) Motif: building failed when Xm/Notebook.h doesn't exist. Added a configure check, disable GUI tabline when it's missing. Mac: When compiled without multi-byte feature the clipboard didn't work. It was possible to switch to another tab page when the cmdline window is open. Completion could hang when 'lines' is 6 and a preview window was opened. Added CTRL-W gF: open file under cursor in new tab page and jump to the line number following the file name. Added 'guitabtooltip'. Implemented for Win32 (Yegappan Lakshmanan). Added "throw" to 'debug' option: throw an exception for error messages even whey they would otherwise be ignored. When 'keymap' is set and a line contains an invalid entry could get a "No mapping found" warning instead of a proper error message. Motif: default to using XpmAttributes instead of XpmAttributes_21. A few more changes for 64 bit MS-Windows. (George Reilly) Got ml_get errors when doing "o" and selecting in other window where there are less lines shorter than the cursor position in the other window. ins_mouse() was using position in wrong window. Win32 GUI: Crash when giving a lot of messages during startup. Allocate twice as much memory for the dialog template. Fixed a few leaks and wrong pointer use reported by coverity. When showing menus the mode character was sometimes wrong. Added feedkeys(). (Yakov Lerner) Made matchlist() always return all submatches. Moved triggering QuickFixCmdPost to before jumping to the first location. Mac: Added the 'macatsui' option as a temporary work around for text drawing problems. Line completion on "/**" gave error messages when scanning an unloaded buffer. --- fixes and changes since Vim 7.0f --- Win32: The height of the tab page labels is now adjusted to the font height. (Yegappan Lakshmanan) Win32: selecting the tab label was off by one. (Yegappan Lakshmanan) Added tooltips for Motif and GTK tab page labels. (Yegappan Lakshmanan) When 'encoding' is "utf-8" then ":help spell" would report an illegal byte and the file was not converted from latin1 to utf-8. Now retry with latin1 if reading the file as utf-8 results in illegal bytes. Escape the argument of feedkeys() before putting it in the typeahead buffer. (Yukihiro Nakadaira) Added the v:char variable for evaluating 'formatexpr'. (Yukihiro Nakadaira) With 8 colors Search highlighting combined with Statement highlighted text made the text disappear. VMS: avoid warnings for redefining MAX and MIN. (Zoltan Arpadffy) When 'virtualedit' includes "onemore", stopping Visual selection would still move the cursor left. Prevent that using CTRL-R = in Insert mode can start Visual mode. Fixed a crash that occurred when in Insert mode with completion active and a mapping caused edit() to be called recursively. When using CTRL-O in Insert mode just after the last character while 'virtualedit' is "all", then typing CR moved the last character to the next line. Call coladvance() before starting the new line. When using |:shell| ignore clicks on the tab page labels. Also when using the command line window. When 'eventignore' is "all" then adding more to ignoring some events, e.g., for ":vimgrep", would actually trigger more events. Win32: When a running Vim uses server name GVIM1 then "gvim --remote fname" didn't find it. When looking for a server name that doesn't end in a digit and it is not found then use another server with that name and a number (just like on Unix). When using "double" in 'spellsuggest' when the language doesn't support sound folding resulted in too many suggestions. Win32: Dropping a shortcut on the Vim icon didn't edit the referred file like editing it in another way would. Use fname_expand() in buf_set_name() instead of simply make the file name a full path. Using feedkeys() could cause Vim to hang. When closing another tab page from the tabline menu in Insert mode the tabline was not updated right away. The syntax menu didn't work in compatible mode. After using ":tag id" twice with the same "id", ":ts" and then ":pop" a ":ts" reported no matching tag. Clear the cached tag name. In Insert mode the matchparen plugin highlighted the wrong paren when there is a string just next to a paren. GTK: After opening a new tab page the text was sometimes not drawn correctly. Flush output and catch up with events when updating the tab page labels. In the GUI, using CTRL-W q to close the last window of a tab page could cause a crash. GTK: The tab pages line menu was not converted from 'encoding' to utf-8. Typing a multi-byte character or a special key at the hit-enter prompt did not work. When 'virtualedit' contains "onemore" CTRL-O in Insert mode still moved the cursor left when it was after the end of the line, even though it's allowed to be there. Added test for using tab pages. towupper() and towlower() were not used, because of checking for __STDC__ISO_10646__ instead of __STDC_ISO_10646__. (sertacyildiz) For ":map <expr>" forbid changing the text, jumping to another buffer and using ":normal" to avoid nasty side effects. --- fixes and changes since Vim 7.0g --- Compilation error on HP-UX, use of "dlerr" must be inside a #ifdef. (Gary Johnson) Report +reltime feature in ":version" output. The tar and zip plugins detect failure to get the contents of the archive and edit the file as-is. When the result of 'guitablabel' is empty fall back to the default label. Fixed crash when using ":insert" in a while loop and missing "endwhile". "gt" and other commands could move to another window when |textlock| active and when the command line window was open. Spell checking a file with syntax highlighting and a bad word at the end of the line is ignored could make "]s" hang. Mac: inputdialog() didn't work when compiled with big features. Interrupting ":vimgrep" while it is busy loading a file left a modified and hidden buffer behind. Use enter_cleanup() and leave_cleanup() around wipe_buffer(). When making 'keymap' empty the b:keymap_name variable wasn't deleted. Using CTRL-N that searches a long time, pressing space to interrupt the searching and accept the first match, the popup menu was still displayed briefly. When setting the Vim window height with -geometry the 'window' option could be at a value that makes CTRL-F behave differently. When opening a quickfix window in two tabs they used different buffers, causing redrawing problems later. Now use the same buffer for all quickfix windows. (Yegappan Lakshmanan) When 'mousefocus' is set moving the mouse to the text tab pages line would move focus to the first window. Also, the mouse pointer would jump to the active window. In a session file, when an empty buffer is wiped out, do this silently. When one window has the cursor on the last line and another window is resized to make that window smaller, the cursor line could go below the displayed lines. In win_new_height() subtract one from the available space. Also avoid that using "~" lines makes the window scroll down. Mac: When sourcing the "macmap.vim" script and then finding a .vimrc file the 'cpo' option isn't set properly, because it was already set and restored. Added the <special> argument to ":map", so that 'cpo' doesn't need to be changed to be able to use <> notation. Also do this for ":menu" for consistency. When using "/encoding=abc" in a spell word list, only "bc" was used. When 'encoding' and 'printencoding' were both "utf-8" then ":hardcopy" didn't work. (Mike Williams) Mac: When building with "--disable-gui" the install directory would still be "/Applications" and Vim.app would be installed. Now install in /usr/local as usual for a console application. GUI: when doing completion and there is one match and still searching for another, the cursor was displayed at the end of the line instead of after the match. Now show the cursor after the match while still searching for matches. GUI: The mouse shape changed on the statusline even when 'mouse' was empty and they can't be dragged. GTK2: Selecting a button in the confirm() dialog with Tab or cursor keys and hitting Enter didn't select that button. Removed GTK 1 specific code. (Neil Bird) When evaluating 'balloonexpr' takes a long time it could be called recursively, which could cause a crash. exists() could not be used to detect whether ":2match" is supported. Added a check for it specifically. GTK1: Tab page labels didn't work. (Yegappan Lakshmanan) Insert mode completion: When finding matches use 'ignorecase', but when adding matches to the list don't use it, so that all words with different case are added, "word", "Word" and "WORD". When 'cursorline' and 'hlsearch' are set and the search pattern is "x\n" the rest of the line was highlighted as a match. Cursor moved while evaluating 'balloonexpr' that invokes ":isearch" and redirects the output. Don't move the cursor to the command line if msg_silent is set. exists() ignored text after a function name and option name, which could result in false positives. exists() ignored characters after the recognized word, which can be wrong when using a name with non-keyword characters. Specifically, these calls no longer allow characters after the name: exists('*funcname') exists('*funcname(...') exists('&option') exists(':cmd') exists('g:name') exists('g:name[n]') exists('g:name.n') Trigger the TabEnter autocommand only after entering the current window of the tab page, otherwise the commands are executed with an invalid current window. Win32: When using two monitors and Vim is on the second monitor, changing the width of the Vim window could make it jump to the first monitor. When scrolling back at the more prompt and the quitting a line of text would be left behind when 'cmdheight' is 2 or more. Fixed a few things for Insert mode completion, especially when typing BS, CTRL-N or a printable character while still searching for matches. ============================================================================== VERSION 7.1 *version-7.1* *version7.1* This section is about improvements made between version 7.0 and 7.1. This is a bug-fix release, there are no fancy new features. Changed *changed-7.1* ------- Added setting 'mouse' in vimrc_example.vim. When building with MZscheme also look for include files in the "plt" subdirectory. That's where they are for FreeBSD. The Ruby interface module is now called "Vim" instead of "VIM". But "VIM" is an alias, so it's backwards compatible. (Tim Pope) Added *added-7.1* ----- New syntax files: /var/log/messages (Yakov Lerner) Autohotkey (Nikolai Weibull) AutoIt v3 (Jared Breland) Bazaar commit file "bzr". (Dmitry Vasiliev) Cdrdao TOC (Nikolai Weibull) Cmusrc (Nikolai Weibull) Conary recipe (rPath Inc) Framescript (Nikolai Weibull) FreeBasic (Mark Manning) Hamster (David Fishburn) IBasic (Mark Manning) Initng (Elan Ruusamae) Ldapconf (Nikolai Weibull) Litestep (Nikolai Weibull) Privoxy actions file (Doug Kearns) Streaming Descriptors "sd" (Puria Nafisi Azizi) New tutor files: Czech (Lubos Turek) Hungarian (Arpad Horvath) Turkish (Serkan kkk) utf-8 version of Greek tutor. utf-8 version of Russian tutor. utf-8 version of Slowak tutor. New filetype plugins: Bst (Tim Pope) Cobol (Tim Pope) Fvwm (Gautam Iyer) Hamster (David Fishburn) Django HTML template (Dave Hodder) New indent files: Bst (Tim Pope) Cobol (Tim Pope) Hamster (David Fishburn) Django HTML template (Dave Hodder) Javascript JSP (David Fishburn) New keymap files: Bulgarian (Boyko Bantchev) Mongolian (Natsagdorj Shagdar) Thaana (Ibrahim Fayaz) Vietnamese (Samuel Thibault) Other new runtime files: Ada support files. (Neil Bird, Martin Krischik) Slovenian menu translations (Mojca Miklavec) Mono C# compiler plugin (Jarek Sobiecki) Fixed *fixed-7.1* ----- Could not build the Win32s version. Added a few structure definitions in src/gui_w32.c Patch 7.0.001 Problem: ":set spellsuggest+=10" does not work. (Suresh Govindachar) Solution: Add P_COMMA to the 'spellsuggest' flags. Files: src/option.c Patch 7.0.002 Problem: C omni completion has a problem with tags files with a path containing "#" or "%". Solution: Escape these characters. (Sebastian Baberowski) Files: runtime/autoload/ccomplete.vim Patch 7.0.003 Problem: GUI: clicking in the lower part of a label in the tab pages line while 'mousefocus' is set may warp the mouse pointer. (Robert Webb) Solution: Check for a negative mouse position. Files: src/gui.c Patch 7.0.004 Problem: Compiler warning for debug_saved used before set. (Todd Blumer) Solution: Remove the "else" for calling save_dbg_stuff(). Files: src/ex_docmd.c Patch 7.0.005 (extra) Problem: Win32: The installer doesn't remove the "autoload" and "spell" directories. (David Fishburn) Solution: Add the directories to the list to be removed. Files: nsis/gvim.nsi Patch 7.0.006 Problem: Mac: "make shadow" doesn't make a link for infplist.xml. (Axel Kielhorn) Solution: Make the link. Files: src/Makefile Patch 7.0.007 Problem: AIX: compiling fails for message.c. (Ruediger Hornig) Solution: Move the #if outside of memchr(). Files: src/message.c Patch 7.0.008 Problem: Can't call a function that uses both <SID> and {expr}. (Thomas) Solution: Check both the expanded and unexpanded name for <SID>. Files: src/eval.c Patch 7.0.009 Problem: ml_get errors with both 'sidescroll' and 'spell' set. Solution: Use ml_get_buf() instead of ml_get(), get the line from the right buffer, not the current one. Files: src/spell.c Patch 7.0.010 Problem: The spellfile plugin required typing login name and password. Solution: Use "anonymous" and "vim7user" by default. No need to setup a .netrc file. Files: runtime/autoload/spellfile.vim Patch 7.0.011 Problem: Can't compile without the folding and with the eval feature. Solution: Add an #ifdef. (Vallimar) Files: src/option.c Patch 7.0.012 Problem: Using the matchparen plugin, moving the cursor in Insert mode to a shorter line that ends in a brace, changes the preferred column Solution: Use winsaveview()/winrestview() instead of getpos()/setpos(). Files: runtime/plugin/matchparen.vim Patch 7.0.013 Problem: Insert mode completion: using CTRL-L to add an extra character also deselects the current match, making it impossible to use CTRL-L a second time. Solution: Keep the current match. Also make CTRL-L work at the original text, using the first displayed match. Files: src/edit.c Patch 7.0.014 Problem: Compiling gui_xmebw.c fails on Dec Alpha Tru64. (Rolfe) Solution: Disable some code for Motif 1.2 and older. Files: src/gui_xmebw.c Patch 7.0.015 Problem: Athena: compilation problems with modern compiler. Solution: Avoid type casts for lvalue. (Alexey Froloff) Files: src/gui_at_fs.c Patch 7.0.016 Problem: Printing doesn't work for "dec-mcs" encoding. Solution: Add "dec-mcs", "mac-roman" and "hp-roman8" to the list of recognized 8-bit encodings. (Mike Williams) Files: src/mbyte.c Patch 7.0.017 (after 7.0.014) Problem: Linking gui_xmebw.c fails on Dec Alpha Tru64. (Rolfe) Solution: Adjust defines for Motif 1.2 and older. Files: src/gui_xmebw.c Patch 7.0.018 Problem: VMS: plugins are not loaded on startup. Solution: Remove "**" from the path. (Zoltan Arpadffy) Files: src/main.c Patch 7.0.019 Problem: Repeating "VjA789" may cause a crash. (James Vega) Solution: Check the cursor column after moving it to another line. Files: src/ops.c Patch 7.0.020 Problem: Crash when using 'mousefocus'. (William Fulton) Solution: Make buffer for mouse coordinates 2 bytes longer. (Juergen Weigert) Files: src/gui.c Patch 7.0.021 Problem: Crash when using "\\[" and "\\]" in 'errorformat'. (Marc Weber) Solution: Check for valid submatches after matching the pattern. Files: src/quickfix.c Patch 7.0.022 Problem: Using buffer.append() in Ruby may append the line to the wrong buffer. (Alex Norman) Solution: Properly switch to the buffer to do the appending. Also for buffer.delete() and setting a buffer line. Files: src/if_ruby.c Patch 7.0.023 Problem: Crash when doing spell completion in an empty line and pressing CTRL-E. Solution: Check for a zero pointer. (James Vega) Also handle a situation without a matching pattern better, report "No matches" instead of remaining in undefined CTRL-X mode. And get out of CTRL-X mode when typing a letter. Files: src/edit.c Patch 7.0.024 Problem: It is possible to set arbitrary "v:" variables. Solution: Disallow setting "v:" variables that are not predefined. Files: src/eval.c Patch 7.0.025 Problem: Crash when removing an element of a:000. (Nikolai Weibull) Solution: Mark the a:000 list with VAR_FIXED. Files: src/eval.c Patch 7.0.026 Problem: Using libcall() may show an old error. Solution: Invoke dlerror() to clear a previous error. (Yukihiro Nakadaira) Files: src/os_unix.c Patch 7.0.027 (extra) Problem: Win32: When compiled with SNIFF gvim may hang on exit. Solution: Translate and dispatch the WM_USER message. (Mathias Michaelis) Files: src/gui_w48.c Patch 7.0.028 (extra) Problem: OS/2: Vim doesn't compile with gcc 3.2.1. Solution: Add argument to after_pathsep(), don't define vim_handle_signal(), define HAVE_STDARG_H. (David Sanders) Files: src/os_unix.c, src/vim.h, src/os_os2_cfg.h Patch 7.0.029 Problem: getchar() may not position the cursor after a space. Solution: Position the cursor explicitly. Files: src/eval.c Patch 7.0.030 Problem: The ":compiler" command can't be used in a FileChangedRO event. (Hari Krishna Dara) Solution: Add the CMDWIN flag to the ":compiler" command. Files: src/ex_cmds.h Patch 7.0.031 Problem: When deleting a buffer the buffer-local mappings for Select mode remain. Solution: Add the Select mode bit to MAP_ALL_MODES. (Edwin Steiner) Files: src/vim.h Patch 7.0.032 (extra, after 7.0.027) Problem: Missing semicolon. Solution: Add the semicolon. Files: src/gui_w48.c Patch 7.0.033 Problem: When pasting text, with the menu or CTRL-V, autoindent is removed. Solution: Use "x<BS>" to avoid indent to be removed. (Benji Fisher) Files: runtime/autoload/paste.vim Patch 7.0.034 Problem: After doing completion and typing more characters or using BS repeating with "." didn't work properly. (Martin Stubenschrott) Solution: Don't put BS and other characters in the redo buffer right away, do this when finishing completion. Files: src/edit.c Patch 7.0.035 Problem: Insert mode completion works when typed but not when replayed from a register. (Hari Krishna Dara) Also: Mappings for Insert mode completion don't always work. Solution: When finding a non-completion key in the input don't interrupt completion when it wasn't typed. Do use mappings when checking for typeahead while still finding completions. Avoids that completion is interrupted too soon. Use "compl_pending" in a different way. Files: src/edit.c Patch 7.0.036 Problem: Can't compile with small features and syntax highlighting or the diff feature. Solution: Define LINE_ATTR whenever syntax highlighting or the diff feature is enabled. Files: src/screen.c Patch 7.0.037 Problem: Crash when resizing the GUI window vertically when there is a line that doesn't fit. Solution: Don't redraw while the screen data is invalid. Files: src/screen.c Patch 7.0.038 Problem: When calling complete() from an Insert mode expression mapping text could be inserted in an improper way. Solution: Make undo_allowed() global and use it in complete(). Files: src/undo.c, src/proto/undo.pro, src/eval.c Patch 7.0.039 Problem: Calling inputdialog() with a third argument in the console doesn't work. Solution: Make a separate function for input() and inputdialog(). (Yegappan Lakshmanan) Files: src/eval.c Patch 7.0.040 Problem: When 'cmdheight' is larger than 1 using inputlist() or selecting a spell suggestion with the mouse gets the wrong entry. Solution: Start listing the first alternative on the last line of the screen. Files: src/eval.c, src/spell.c Patch 7.0.041 Problem: cursor([1, 1]) doesn't work. (Peter Hodge) Solution: Allow leaving out the third item of the list and use zero for the virtual column offset. Files: src/eval.c Patch 7.0.042 Problem: When pasting a block of text in Insert mode Vim hangs or crashes. (Noam Halevy) Solution: Avoid that the cursor is positioned past the NUL of a line. Files: src/ops.c Patch 7.0.043 Problem: Using "%!" at the start of 'statusline' doesn't work. Solution: Recognize the special item when the option is being set. Files: src/option.c Patch 7.0.044 Problem: Perl: setting a buffer line in another buffer may result in changing the current buffer. Solution: Properly change to the buffer to be changed. Files: src/if_perl.xs Patch 7.0.045 (extra) Problem: Win32: Warnings when compiling OLE version with MSVC 2005. Solution: Move including vim.h to before windows.h. (Ilya Bobir) Files: src/if_ole.cpp Patch 7.0.046 Problem: The matchparen plugin ignores parens in strings, but not in single quotes, often marked with "character". Solution: Also ignore parens in syntax items matching "character". Files: runtime/plugin/matchparen.vim Patch 7.0.047 Problem: When running configure the exit status is wrong. Solution: Handle the exit status properly. (Matthew Woehlke) Files: configure, src/configure Patch 7.0.048 Problem: Writing a compressed file fails when there are parens in the name. (Wang Jian) Solution: Put quotes around the temp file name. Files: runtime/autoload/gzip.vim Patch 7.0.049 Problem: Some TCL scripts are not recognized. (Steven Atkinson) Solution: Check for "exec wish" in the file. Files: runtime/scripts.vim Patch 7.0.050 Problem: After using the netbeans interface close command a stale pointer may be used. Solution: Clear the pointer to the closed buffer. (Xaview de Gaye) Files: src/netbeans.c Patch 7.0.051 (after 7.0.44) Problem: The Perl interface doesn't compile or doesn't work properly. Solution: Remove the spaces before #ifdef and avoid an empty line above it. Files: src/if_perl.xs Patch 7.0.052 Problem: The user may not be aware that the Vim server allows others more functionality than desired. Solution: When running Vim as root don't become a Vim server without an explicit --servername argument. Files: src/main.c Patch 7.0.053 Problem: Shortening a directory name may fail when there are multi-byte characters. Solution: Copy the correct bytes. (Titov Anatoly) Files: src/misc1.c Patch 7.0.054 Problem: Mac: Using a menu name that only has a mnemonic or accelerator causes a crash. (Elliot Shank) Solution: Check for an empty menu name. Also delete empty submenus that were created before detecting the error. Files: src/menu.c Patch 7.0.055 Problem: ":startinsert" in a CmdwinEnter autocommand doesn't take immediate effect. (Bradley White) Solution: Put a NOP key in the typeahead buffer. Also avoid that using CTRL-C to go back to the command line moves the cursor left. Files: src/edit.c, src/ex_getln.c Patch 7.0.056 Problem: "#!something" gives an error message. Solution: Ignore this line, so that it can be used in an executable Vim script. Files: src/ex_docmd.c Patch 7.0.057 (extra, after 7.0.45) Problem: Win32: Compilation problem with Borland C 5.5. Solution: Include vim.h as before. (Mark S. Williams) Files: src/if_ole.cpp Patch 7.0.058 Problem: The gbk and gb18030 encodings are not recognized. Solution: Add aliases to cp936. (Edward L. Fox) Files: src/mbyte.c Patch 7.0.059 Problem: The Perl interface doesn't compile with ActiveState Perl 5.8.8. Solution: Remove the __attribute__() items. (Liu Yubao) Files: src/if_perl.xs Patch 7.0.060 (after 7.0.51) Problem: Code for temporarily switching to another buffer is duplicated in quite a few places. Solution: Use aucmd_prepbuf() and aucmd_restbuf() also when FEAT_AUTOCMD is not defined. Files: src/buffer.c, src/eval.c, src/fileio.c, src/if_ruby.c, src/if_perl.xs, src/quickfix.c, src/structs.h Patch 7.0.061 Problem: Insert mode completion for Vim commands may crash if there is nothing to complete. Solution: Instead of freeing the pattern make it empty, so that a "not found" error is given. (Yukihiro Nakadaira) Files: src/edit.c Patch 7.0.062 Problem: Mac: Crash when using the popup menu for spell correction. The popup menu appears twice when letting go of the right mouse button early. Solution: Don't show the popup menu on the release of the right mouse button. Also check that a menu pointer is actually valid. Files: src/proto/menu.pro, src/menu.c, src/normal.c, src/term.c Patch 7.0.063 Problem: Tiny chance for a memory leak. (coverity) Solution: Free pointer when next memory allocation fails. Files: src/eval.c Patch 7.0.064 Problem: Using uninitialized variable. (Tony Mechelynck) Solution: When not used set "temp" to zero. Also avoid a warning for "files" in ins_compl_dictionaries(). Files: src/edit.c Patch 7.0.065 (extra) Problem: Mac: left-right movement of the scrollwheel causes up-down scrolling. Solution: Ignore mouse wheel events that are not up-down. (Nicolas Weber) Files: src/gui_mac.c Patch 7.0.066 Problem: After the popup menu for Insert mode completion overlaps the tab pages line it is not completely removed. Solution: Redraw the tab pages line after removing the popup menu. (Ori Avtalion) Files: src/popupmnu.c Patch 7.0.067 Problem: Undo doesn't always work properly when using "scim" input method. Undo is split up when using preediting. Solution: Reset xim_has_preediting also when preedit_start_col is not MAXCOL. Don't split undo when <Left> is used while preediting. (Yukihiro Nakadaira) Files: src/edit.c, src/mbyte.c Patch 7.0.068 Problem: When 'ignorecase' is set and using Insert mode completion, typing characters to change the list of matches, case is not ignored. (Hugo Ahlenius) Solution: Store the 'ignorecase' flag with the matches where needed. Files: src/edit.c, src/search.c, src/spell.c Patch 7.0.069 Problem: Setting 'guitablabel' to %!expand(\%) causes Vim to free an invalid pointer. (Kim Schulz) Solution: Don't try freeing a constant string pointer. Files: src/buffer.c Patch 7.0.070 Problem: Compiler warnings for shadowed variables and uninitialized variables. Solution: Rename variables such as "index", "msg" and "dup". Initialize variables. Files: src/edit.c, src/eval.c, src/ex_cmds.c, src/ex_cmds2.c, src/ex_docmd.c, src/gui_beval.c, src/gui_gtk.c, src/gui_gtk_x11.c, src/hardcopy.c, src/if_cscope.c, src/main.c, src/mbyte.c, src/memline.c, src/netbeans.c, src/normal.c, src/option.c, src/os_unix.c, src/quickfix.c, src/regexp.c, src/screen.c, src/search.c, src/spell.c, src/ui.c, src/undo.c, src/window.c, src/version.c Patch 7.0.071 Problem: Using an empty search pattern may cause a crash. Solution: Avoid using a NULL pointer. Files: src/search.c Patch 7.0.072 Problem: When starting the GUI fails there is no way to adjust settings or do something else. Solution: Add the GUIFailed autocommand event. Files: src/fileio.c, src/gui.c, src/vim.h Patch 7.0.073 Problem: Insert mode completion: Typing <CR> sometimes selects the original text instead of keeping what was typed. (Justin Constantino) Solution: Don't let <CR> select the original text if there is no popup menu. Files: src/edit.c Patch 7.0.074 (extra) Problem: Win32: tooltips were not converted from 'encoding' to Unicode. Solution: Set the tooltip to use Unicode and do the conversion. Also cleanup the code for the tab pages tooltips. (Yukihiro Nakadaira) Files: src/gui_w32.c, src/gui_w48.c Patch 7.0.075 Problem: winsaveview() did not store the actual value of the desired cursor column. This could move the cursor in the matchparen plugin. Solution: Call update_curswant() before using the value w_curswant. Files: src/eval.c Patch 7.0.076 (after 7.0.010) Problem: Automatic downloading of spell files only works for ftp. Solution: Don't add login and password for non-ftp URLs. (Alexander Patrakov) Files: runtime/autoload/spellfile.vim Patch 7.0.077 Problem: ":unlet v:this_session" causes a crash. (Marius Roets) Solution: When trying to unlet a fixed variable give an error message. Files: src/eval.c Patch 7.0.078 Problem: There are two error messages E46. Solution: Change the number for the sandbox message to E794. Files: src/globals.h Patch 7.0.079 Problem: Russian tutor doesn't work when 'encoding' is "utf-8". Solution: Use tutor.ru.utf-8 as the master, and generate the other encodings from it. Select the right tutor depending on 'encoding'. (Alexey Froloff) Files: runtime/tutor/Makefile, runtime/tutor/tutor.vim, runtime/tutor/tutor.ru.utf-8 Patch 7.0.080 Problem: Generating auto/pathdef.c fails for CFLAGS with a backslash. Solution: Double backslashes in the string. (Alexey Froloff) Files: src/Makefile Patch 7.0.081 Problem: Command line completion doesn't work for a shell command with an absolute path. Solution: Don't use $PATH when there is an absolute path. Files: src/ex_getln.c Patch 7.0.082 Problem: Calling a function that waits for input may cause List and Dictionary arguments to be freed by the garbage collector. Solution: Keep a list of all arguments to internal functions. Files: src/eval.c Patch 7.0.083 Problem: Clicking with the mouse on an item for inputlist() doesn't work when 'compatible' is set and/or when 'cmdheight' is more than one. (Christian J. Robinson) Solution: Also decrement "lines_left" when 'more' isn't set. Set "cmdline_row" to zero to get all mouse events. Files: src/message.c, src/misc1.c Patch 7.0.084 Problem: The garbage collector may do its work while some Lists or Dictionaries are used internally, e.g., by ":echo" that runs into the more-prompt or ":echo [garbagecollect()]". Solution: Only do garbage collection when waiting for a character at the toplevel. Let garbagecollect() set a flag that is handled at the toplevel before waiting for a character. Files: src/eval.c, src/getchar.c, src/globals.h, src/main.c Patch 7.0.085 Problem: When doing "make test" the viminfo file is modified. Solution: Use another viminfo file after setting 'compatible'. Files: src/testdir/test56.in Patch 7.0.086 Problem: getqflist() returns entries for pattern and text with the number zero. Passing these to setqflist() results in the string "0". Solution: Use an empty string instead of the number zero. Files: src/quickfix.c Patch 7.0.087 Problem: After ":file fname" and ":saveas fname" the 'autochdir' option does not take effect. (Yakov Lerner) Commands for handling 'autochdir' are repeated many times. Solution: Add the DO_AUTOCHDIR macro and do_autochdir(). Use it for ":file fname" and ":saveas fname". Files: src/proto/buffer.pro, src/buffer.c, src/ex_cmds.c, src/macros.h, src/netbeans.c, src/option.c, src/window.c Patch 7.0.088 Problem: When compiled with Perl the generated prototypes have "extern" unnecessarily added. Solution: Remove the "-pipe" argument from PERL_CFLAGS. Files: src/auto/configure, src/configure.in Patch 7.0.089 Problem: "ga" does not work properly for a non-Unicode multi-byte encoding. Solution: Only check for composing chars for utf-8. (Taro Muraoka) Files: src/ex_cmds.c Patch 7.0.090 Problem: Cancelling the conform() dialog on the console with Esc requires typing it twice. (Benji Fisher) Solution: When the start of an escape sequence is found use 'timeoutlen' or 'ttimeoutlen'. Files: src/misc1.c Patch 7.0.091 Problem: Using winrestview() while 'showcmd' is set causes the cursor to be displayed in the wrong position. (Yakov Lerner) Solution: Set the window topline properly. Files: src/eval.c Patch 7.0.092 (after 7.0.082 and 7.0.084) Problem: The list of internal function arguments is obsolete now that garbage collection is only done at the toplevel. Solution: Remove the list of all arguments to internal functions. Files: src/eval.c Patch 7.0.093 Problem: The matchparen plugin can't handle a 'matchpairs' value where a colon is matched. Solution: Change the split() that is used to change 'matchpairs' into a List. Files: runtime/plugin/matchparen.vim Patch 7.0.094 Problem: When a hidden buffer is made the current buffer and another file edited later, the file message will still be given. Using ":silent" also doesn't prevent the file message. (Marvin Renich) Solution: Reset the need_fileinfo flag when reading a file. Don't set need_fileinfo when msg_silent is set. Files: src/buffer.c, src/fileio.c Patch 7.0.095 Problem: The Greek tutor is not available in utf-8. "el" is used for the language, only "gr" for the country is recognized. Solution: Add the utf-8 Greek tutor. Use it for conversion to iso-8859-7 and cp737. (Lefteris Dimitroulakis) Files: runtime/tutor/Makefile, runtime/tutor/tutor.gr.utf-8, runtime/tutor/tutor.vim Patch 7.0.096 Problem: taglist() returns the filename relative to the tags file, while the directory of the tags file is unknown. (Hari Krishna Dara) Solution: Expand the file name. (Yegappan Lakshmanan) Files: src/tag.c Patch 7.0.097 Problem: ":tabclose N" that closes another tab page does not remove the tab pages line. Same problem when using the mouse. Solution: Adjust the tab pages line when needed in tabpage_close_other(). Files: src/ex_docmd.c Patch 7.0.098 Problem: Redirecting command output in a cmdline completion function doesn't work. (Hari Krishna Dara) Solution: Enable redirection when redirection is started. Files: src/ex_docmd.c, src/ex_getln.c Patch 7.0.099 Problem: GUI: When the popup menu is visible using the scrollbar messes up the display. Solution: Disallow scrolling the current window. Redraw the popup menu after scrolling another window. Files: src/gui.c Patch 7.0.100 Problem: "zug" may report the wrong filename. (Lawrence Kesteloot) Solution: Call home_replace() to fill NameBuff[]. Files: src/spell.c Patch 7.0.101 Problem: When the "~/.vim/spell" directory does not exist "zg" may create a wrong directory. "zw" doesn't work. Solution: Use the directory of the file name instead of NameBuff. For "zw" not only remove a good word but also add the word with "!". Files: src/spell.c Patch 7.0.102 Problem: Redrawing cmdline is not correct when using SCIM. Solution: Don't call im_get_status(). (Yukihiro Nakadaira) Files: src/ex_getln.c Patch 7.0.103 (after 7.0.101) Problem: Compiler warning for uninitialized variable. (Tony Mechelynck) Solution: Init variable. Files: src/spell.c Patch 7.0.104 Problem: The CursorHoldI event only triggers once in Insert mode. It also triggers after CTRL-V and other two-key commands. Solution: Set "did_cursorhold" before getting a second key. Reset "did_cursorhold" after handling a command. Files: src/edit.c, src/fileio.c Patch 7.0.105 Problem: When using incremental search the statusline ruler isn't updated. (Christoph Koegl) Solution: Update the statusline when it contains the ruler. Files: src/ex_getln.c Patch 7.0.106 Problem: The spell popup menu uses ":amenu", triggering mappings. Other PopupMenu autocommands are removed. (John Little) Solution: Use ":anoremenu" and use an autocmd group. Files: runtime/menu.vim Patch 7.0.107 Problem: Incremental search doesn't redraw the text tabline. (Ilya Bobir) Also happens in other situations with one window in a tab page. Solution: Redraw the tabline after clearing the screen. Files: src/screen.c Patch 7.0.108 (extra) Problem: Amiga: Compilation problem. Solution: Have mch_mkdir() return a failure flag. (Willy Catteau) Files: src/os_amiga.c, src/proto/os_amiga.pro Patch 7.0.109 Problem: Lisp indenting is confused by escaped quotes in strings. (Dorai Sitaram) Solution: Check for backslash inside strings. (Sergey Khorev) Files: src/misc1.c Patch 7.0.110 Problem: Amiga: Compilation problems when not using libnix. Solution: Change a few #ifdefs. (Willy Catteau) Files: src/memfile.c Patch 7.0.111 Problem: The gzip plugin can't handle filenames with single quotes. Solution: Add and use the shellescape() function. (partly by Alexey Froloff) Files: runtime/autoload/gzip.vim, runtime/doc/eval.txt, src/eval.c, src/mbyte.c, src/misc2.c, src/proto/misc2.pro Patch 7.0.112 Problem: Python interface does not work with Python 2.5. Solution: Change PyMem_DEL() to Py_DECREF(). (Sumner Hayes) Files: src/if_python.c Patch 7.0.113 Problem: Using CTRL-L in Insert completion when there is no current match may cause a crash. (Yukihiro Nakadaira) Solution: Check for compl_leader to be NULL Files: src/edit.c Patch 7.0.114 Problem: When aborting an insert with CTRL-C an extra undo point is created in the GUI. (Yukihiro Nakadaira) Solution: Call gotchars() only when advancing. Files: src/getchar.c Patch 7.0.115 Problem: When 'ignorecase' is set, Insert mode completion only adds "foo" and not "Foo" when both are found. A found match isn't displayed right away when 'completeopt' does not have "menu" or "menuone". Solution: Do not ignore case when checking if a completion match already exists. call ins_compl_check_keys() also when not using a popup menu. (Yukihiro Nakadaira) Files: src/edit.c Patch 7.0.116 Problem: 64 bit Windows version reports "32 bit" in the ":version" output. (M. Veerman) Solution: Change the text for Win64. Files: src/version.c Patch 7.0.117 Problem: Using "extend" on a syntax item inside a region with "keepend", an intermediate item may be truncated. When applying the "keepend" and there is an offset to the end pattern the highlighting of a contained item isn't adjusted. Solution: Use the seen_keepend flag to remember when to apply the "keepend" flag. Adjust the keepend highlighting properly. (Ilya Bobir) Files: src/syntax.c Patch 7.0.118 Problem: printf() does not do zero padding for strings. Solution: Do allow zero padding for strings. Files: src/message.c Patch 7.0.119 Problem: When going back from Insert to Normal mode the CursorHold event doesn't trigger. (Yakov Lerner) Solution: Reset "did_cursorhold" when leaving Insert mode. Files: src/edit.c Patch 7.0.120 Problem: Crash when using CTRL-R = at the command line and entering "getreg('=')". (James Vega) Solution: Avoid recursiveness of evaluating the = register. Files: src/ops.c Patch 7.0.121 Problem: GUI: Dragging the last status line doesn't work when there is a text tabline. (Markus Wolf) Solution: Take the text tabline into account when deciding to start modeless selection. Files: src/gui.c Patch 7.0.122 Problem: GUI: When clearing after a bold, double-wide character half a character may be drawn. Solution: Check for double-wide character and redraw it. (Yukihiro Nakadaira) Files: src/screen.c Patch 7.0.123 Problem: On SCO Openserver configure selects the wrong terminal library. Solution: Put terminfo before the other libraries. (Roger Cornelius) Also fix a small problem compiling on Mac without Darwin. Files: src/configure.in, src/auto/configure Patch 7.0.124 Problem: getwinvar() obtains a dictionary with window-local variables, but it's always for the current window. Solution: Get the variables of the specified window. (Geoff Reedy) Files: src/eval.c Patch 7.0.125 Problem: When "autoselect" is in the 'clipboard' option then the '< and '> marks are set while Visual mode is still active. Solution: Don't set the '< and '> marks when yanking the selected area for the clipboard. Files: src/normal.c Patch 7.0.126 Problem: When 'formatexpr' uses setline() and later internal formatting is used undo information is not correct. (Jiri Cerny, Benji Fisher) Solution: Set ins_need_undo after using 'formatexpr'. Files: src/edit.c Patch 7.0.127 Problem: Crash when swap files has invalid timestamp. Solution: Check return value of ctime() for being NULL. Files: src/memline.c Patch 7.0.128 Problem: GUI: when closing gvim is cancelled because there is a changed buffer the screen isn't updated to show the changed buffer in the current window. (Krzysztof Kacprzak) Solution: Redraw when closing gvim is cancelled. Files: src/gui.c Patch 7.0.129 Problem: GTK GUI: the GTK file dialog can't handle a relative path. Solution: Make the initial directory a full path before passing it to GTK. (James Vega) Also postpone adding the default file name until after setting the directory. Files: src/gui_gtk.c Patch 7.0.130 (extra) Problem: Win32: Trying to edit or write devices may cause Vim to get stuck. Solution: Add the 'opendevice' option, default off. Disallow reading/writing from/to devices when it's off. Also detect more devices by the full name starting with "\\.\". Files: runtime/doc/options.txt, src/fileio.c, src/option.c, src/option.h, src/os_win32.c Patch 7.0.131 Problem: Win32: "vim -r" does not list all the swap files. Solution: Also check for swap files starting with a dot. Files: src/memline.c Patch 7.0.132 (after 7.0.130) Problem: Win32: Crash when Vim reads from stdin. Solution: Only use mch_nodetype() when there is a file name. Files: src/fileio.c Patch 7.0.133 Problem: When searching included files messages are added to the history. Solution: Set msg_hist_off for messages about scanning included files. Set msg_silent to avoid message about wrapping around. Files: src/edit.c, src/globals.h, src/message.c, src/search.c Patch 7.0.134 Problem: Crash when comparing a recursively looped List or Dictionary. Solution: Limit recursiveness for comparing to 1000. Files: src/eval.c Patch 7.0.135 Problem: Crash when garbage collecting list or dict with loop. Solution: Don't use DEL_REFCOUNT but don't recurse into Lists and Dictionaries when freeing them in the garbage collector. Also add allocated Dictionaries to the list of Dictionaries to avoid leaking memory. Files: src/eval.c, src/proto/eval.pro, src/tag.c Patch 7.0.136 Problem: Using "O" while matching parens are highlighted may not remove the highlighting. (Ilya Bobir) Solution: Also trigger CursorMoved when a line is inserted under the cursor. Files: src/misc1.c Patch 7.0.137 Problem: Configure check for big features is wrong. Solution: Change "==" to "=". (Martti Kuparinen) Files: src/auto/configure, src/configure.in Patch 7.0.138 (extra) Problem: Mac: modifiers don't work with function keys. Solution: Use GetEventParameter() to obtain modifiers. (Nicolas Weber) Files: src/gui_mac.c Patch 7.0.139 Problem: Using CTRL-PageUp or CTRL-PageDown in Insert mode to go to another tab page does not prepare for undo properly. (Stefano Zacchiroli) Solution: Call start_arrow() before switching tab page. Files: src/edit.c Patch 7.0.140 (after 7.0.134) Problem: Comparing recursively looped List or Dictionary doesn't work well. Solution: Detect comparing a List or Dictionary with itself. Files: src/eval.c Patch 7.0.141 Problem: When pasting a while line on the command line an extra CR is added literally. Solution: Don't add the trailing CR when pasting with the mouse. Files: src/ex_getln.c, src/proto/ops.pro, src/ops.c Patch 7.0.142 Problem: Using the middle mouse button in Select mode to paste text results in an extra "y". (Kriton Kyrimis) Solution: Let the middle mouse button replace the selected text with the contents of the clipboard. Files: src/normal.c Patch 7.0.143 Problem: Setting 'scroll' to its default value was not handled correctly. Solution: Compare the right field to PV_SCROLL. Files: src/option.c Patch 7.0.144 Problem: May compare two unrelated pointers when matching a pattern against a string. (Dominique Pelle) Solution: Avoid calling reg_getline() when REG_MULTI is false. Files: src/regexp.c Patch 7.0.145 (after 7.0.142) Problem: Compiler warning. Solution: Add type cast. Files: src/normal.c Patch 7.0.146 Problem: When 'switchbuf' is set to "usetab" and the current tab has only a quickfix window, jumping to an error always opens a new window. Also, when the buffer is open in another tab page it's not found. Solution: Check for the "split" value of 'switchbuf' properly. Search in other tab pages for the desired buffer. (Yegappan Lakshmanan) Files: src/buffer.c, src/quickfix.c Patch 7.0.147 Problem: When creating a session file and there are several tab pages and some windows have a local directory a short file name may be used when it's not valid. (Marius Roets) A session with multiple tab pages may result in "No Name" buffers. (Bill McCarthy) Solution: Don't enter tab pages when going through the list, only use a pointer to the first window in each tab page. Use "tabedit" instead of "tabnew | edit" when possible. Files: src/ex_docmd.c Patch 7.0.148 Problem: When doing "call a.xyz()" and "xyz" does not exist in dictionary "a" there is no error message. (Yegappan Lakshmanan) Solution: Add the error message. Files: src/eval.c Patch 7.0.149 Problem: When resizing a window that shows "~" lines the text sometimes jumps down. Solution: Remove code that uses "~" lines in some situations. Fix the computation of the screen line of the cursor. Also set w_skipcol to handle very long lines. Files: src/misc1.c, src/window.c Patch 7.0.150 Problem: When resizing the Vim window scrollbinding doesn't work. (Yakov Lerner) Solution: Do scrollbinding in set_shellsize(). Files: src/term.c Patch 7.0.151 Problem: Buttons in file dialog are not according to Gnome guidelines. Solution: Swap Cancel and Open buttons. (Stefano Zacchiroli) Files: src/gui_gtk.c Patch 7.0.152 Problem: Crash when using lesstif 2. Solution: Fill in the extension field. (Ben Hutchings) Files: src/gui_xmebw.c Patch 7.0.153 Problem: When using cscope and opening the temp file fails Vim crashes. (Kaya Bekiroglu) Solution: Check for NULL pointer returned from mch_open(). Files: src/if_cscope.c Patch 7.0.154 Problem: When 'foldnextmax' is negative Vim can hang. (James Vega) Solution: Avoid the fold level becoming negative. Files: src/fold.c, src/syntax.c Patch 7.0.155 Problem: When getchar() returns a mouse button click there is no way to get the mouse coordinates. Solution: Add v:mouse_win, v:mouse_lnum and v:mouse_col. Files: runtime/doc/eval.txt, src/eval.c, src/vim.h Patch 7.0.156 (extra) Problem: Vim doesn't compile for Amiga OS 4. Solution: Various changes for Amiga OS4. (Peter Bengtsson) Files: src/feature.h, src/mbyte.c, src/memfile.c, src/memline.c, src/os_amiga.c, src/os_amiga.h, src/pty.c Patch 7.0.157 Problem: When a function is used recursively the profiling information is invalid. (Mikolaj Machowski) Solution: Put the start time on the stack instead of in the function. Files: src/eval.c Patch 7.0.158 Problem: In a C file with ":set foldmethod=syntax", typing {<CR> on the last line results in the cursor being in a closed fold. (Gautam Iyer) Solution: Open fold after inserting a new line. Files: src/edit.c Patch 7.0.159 Problem: When there is an I/O error in the swap file the cause of the error cannot be seen. Solution: Use PERROR() instead of EMSG() where possible. Files: src/memfile.c Patch 7.0.160 Problem: ":@a" echoes the command, Vi doesn't do that. Solution: Set the silent flag in the typeahead buffer to avoid echoing the command. Files: src/ex_docmd.c, src/normal.c, src/ops.c, src/proto/ops.pro Patch 7.0.161 Problem: Win32: Tab pages line popup menu isn't using the right encoding. (Yongwei Wu) Solution: Convert the text when necessary. Also fixes the Find/Replace dialog title. (Yegappan Lakshmanan) Files: src/gui_w48.c Patch 7.0.162 Problem: "vim -o a b" when file "a" triggers the ATTENTION dialog, selecting "Quit" exits Vim instead of editing "b" only. When file "b" triggers the ATTENTION dialog selecting "Quit" or "Abort" results in editing file "a" in that window. Solution: When selecting "Abort" exit Vim. When selecting "Quit" close the window. Also avoid hit-enter prompt when selecting Abort. Files: src/buffer.c, src/main.c Patch 7.0.163 Problem: Can't retrieve the position of a sign after it was set. Solution: Add the netbeans interface getAnno command. (Xavier de Gaye) Files: runtime/doc/netbeans.txt, src/netbeans.c Patch 7.0.164 Problem: ":redir @+" doesn't work. Solution: Accept "@+" just like "@*". (Yegappan Lakshmanan) Files: src/ex_docmd.c Patch 7.0.165 Problem: Using CTRL-L at the search prompt adds a "/" and other characters without escaping, causing the pattern not to match. Solution: Escape special characters with a backslash. Files: src/ex_getln.c Patch 7.0.166 Problem: Crash in cscope code when connection could not be opened. (Kaya Bekiroglu) Solution: Check for the file descriptor to be NULL. Files: src/if_cscope.c Patch 7.0.167 Problem: ":function" redefining a dict function doesn't work properly. (Richard Emberson) Solution: Allow a function name to be a number when it's a function reference. Files: src/eval.c Patch 7.0.168 Problem: Using uninitialized memory and memory leak. (Dominique Pelle) Solution: Use alloc_clear() instead of alloc() for w_lines. Free b_ml.ml_stack after recovery. Files: src/memline.c, src/window.c Patch 7.0.169 Problem: With a Visual block selection, with the cursor in the left upper corner, pressing "I" doesn't remove the highlighting. (Guopeng Wen) Solution: When checking if redrawing is needed also check if Visual selection is still active. Files: src/screen.c Patch 7.0.170 (extra) Problem: Win32: Using "gvim --remote-tab foo" when gvim is minimized while it previously was maximized, un-maximizing doesn't work properly. And the labels are not displayed properly when 'encoding' is utf-8. Solution: When minimized check for SW_SHOWMINIMIZED. When updating the tab pages line use TCM_SETITEMW instead of TCM_INSERTITEMW. (Liu Yubao) Files: src/gui_w48.c Patch 7.0.171 (extra) Problem: VMS: A file name with multiple paths is written in the wrong file. Solution: Get the actually used file name. (Zoltan Arpadffy) Also add info to the :version command about compilation. Files: src/Make_vms.mms, src/buffer.c, src/os_unix.c, src/version.c Patch 7.0.172 Problem: Crash when recovering and quitting at the "press-enter" prompt. Solution: Check for "msg_list" to be NULL. (Liu Yubao) Files: src/ex_eval.c Patch 7.0.173 Problem: ":call f().TT()" doesn't work. (Richard Emberson) Solution: When a function returns a Dictionary or another composite continue evaluating what follows. Files: src/eval.c Patch 7.0.174 Problem: ":mksession" doesn't restore window layout correctly in tab pages other than the current one. (Zhibin He) Solution: Use the correct topframe for producing the window layout commands. Files: src/ex_docmd.c Patch 7.0.175 Problem: The result of tr() is missing the terminating NUL. (Ingo Karkat) Solution: Add the NUL. Files: src/eval.c Patch 7.0.176 Problem: ":emenu" isn't executed directly, causing the encryption key prompt to fail. (Life Jazzer) Solution: Fix wrong #ifdef. Files: src/menu.c Patch 7.0.177 Problem: When the press-enter prompt gets a character from a non-remappable mapping, it's put back in the typeahead buffer as remappable, which may cause an endless loop. Solution: Restore the non-remappable flag and the silent flag when putting a char back in the typeahead buffer. Files: src/getchar.c, src/message.c, src/normal.c Patch 7.0.178 Problem: When 'enc' is "utf-8" and 'ignorecase' is set the result of ":echo ("\xe4" == "\xe4")" varies. Solution: In mb_strnicmp() avoid looking past NUL bytes. Files: src/mbyte.c Patch 7.0.179 Problem: Using ":recover" or "vim -r" without a swapfile crashes Vim. Solution: Check for "buf" to be unequal NULL. (Yukihiro Nakadaira) Files: src/memline.c Patch 7.0.180 (extra, after 7.0.171) Problem: VMS: build failed. Problem with swapfiles. Solution: Add "compiled_arch". Always expand path and pass it to buf_modname(). (Zoltan Arpadffy) Files: src/globals.h, src/memline.c, src/os_unix.c, runtime/menu.vim Patch 7.0.181 Problem: When reloading a file that starts with an empty line, the reloaded buffer has an extra empty line at the end. (Motty Lentzitzky) Solution: Delete all lines, don't use bufempty(). Files: src/fileio.c Patch 7.0.182 Problem: When using a mix of undo and "g-" it may no longer be possible to go to every point in the undo tree. (Andy Wokula) Solution: Correctly update pointers in the undo tree. Files: src/undo.c Patch 7.0.183 Problem: Crash in ":let" when redirecting to a variable that's being displayed. (Thomas Link) Solution: When redirecting to a variable only do the assignment when stopping redirection to avoid that setting the variable causes a freed string to be accessed. Files: src/eval.c Patch 7.0.184 Problem: When the cscope program is called "mlcscope" the Cscope interface doesn't work. Solution: Accept "\S*cscope:" instead of "cscope:". (Frodak D. Baksik) Files: src/if_cscope.c Patch 7.0.185 Problem: Multi-byte characters in a message are displayed with attributes from what comes before it. Solution: Don't use the attributes for a multi-byte character. Do use attributes for special characters. (Yukihiro Nakadaira) Files: src/message.c Patch 7.0.186 Problem: Get an ml_get error when 'encoding' is "utf-8" and searching for "/\_s*/e" in an empty buffer. (Andrew Maykov) Solution: Don't try getting the line just below the last line. Files: src/search.c Patch 7.0.187 Problem: Can't source a remote script properly. Solution: Add the SourceCmd event. (Charles Campbell) Files: runtime/doc/autocmd.txt, src/ex_cmds2.c, src/fileio.c, src/vim.h Patch 7.0.188 (after 7.0.186) Problem: Warning for wrong pointer type. Solution: Add a type cast. Files: src/search.c Patch 7.0.189 Problem: Translated message about finding matches is truncated. (Yukihiro Nakadaira) Solution: Enlarge the buffer. Also use vim_snprintf(). Files: src/edit.c Patch 7.0.190 Problem: "syntax spell default" results in an error message. Solution: Change 4 to 7 for STRNICMP(). (Raul Nunez de Arenas Coronado) Files: src/syntax.c Patch 7.0.191 Problem: The items used by getqflist() and setqflist() don't match. Solution: Support the "bufnum" item for setqflist(). (Yegappan Lakshmanan) Files: runtime/doc/eval.txt, src/quickfix.c Patch 7.0.192 Problem: When 'swapfile' is switched off in an empty file it is possible that not all blocks are loaded into memory, causing ml_get errors later. Solution: Rename "dont_release" to "mf_dont_release" and also use it to avoid using the cached line and locked block. Files: src/globals.h, src/memfile.c, src/memline.c Patch 7.0.193 Problem: Using --remote or --remote-tab with an argument that matches 'wildignore' causes a crash. Solution: Check the argument count before using ARGLIST[0]. Files: src/ex_cmds.c Patch 7.0.194 Problem: Once an ml_get error is given redrawing part of the screen may cause it again, resulting in an endless loop. Solution: Don't give the error message for a recursive call. Files: src/memline.c Patch 7.0.195 Problem: When a buffer is modified and 'autowriteall' is set, ":quit" results in an endless loop when there is a conversion error while writing. (Nikolai Weibull) Solution: Make autowrite() return FAIL if the buffer is still changed after writing it. /* put the cursor on the last char, for 'tw' formatting */ Files: src/ex_cmds2.c Patch 7.0.196 Problem: When using ":vert ball" the computation of the mouse pointer position may be off by one column. (Stefan Karlsson) Solution: Recompute the frame width when moving the vertical separator from one window to another. Files: src/window.c Patch 7.0.197 (extra) Problem: Win32: Compiling with EXITFREE doesn't work. Solution: Adjust a few #ifdefs. (Alexei Alexandrof) Files: src/misc2.c, src/os_mswin.c Patch 7.0.198 (extra) Problem: Win32: Compiler warnings. No need to generate gvim.exe.mnf. Solution: Add type casts. Use "*" for processorArchitecture. (George Reilly) Files: src/Make_mvc.mak, src/eval.c, src/gvim.exe.mnf, src/misc2.c Patch 7.0.199 Problem: When using multi-byte characters the combination of completion and formatting may result in a wrong cursor position. Solution: Don't decrement the cursor column, use dec_cursor(). (Yukihiro Nakadaira) Also check for the column to be zero. Files: src/edit.c Patch 7.0.200 Problem: Memory leaks when out of memory. Solution: Free the memory. Files: src/edit.c, src/diff.c Patch 7.0.201 Problem: Message for ":diffput" about buffer not being in diff mode may be wrong. Solution: Check for buffer in diff mode but not modifiable. Files: src/diff.c Patch 7.0.202 Problem: Problems on Tandem systems while compiling and at runtime. Solution: Recognize root uid is 65535. Check select() return value for it not being supported. Avoid wrong function prototypes. Mention use of -lfloss. (Matthew Woehlke) Files: src/Makefile, src/ex_cmds.c, src/fileio.c, src/main.c, src/osdef1.h.in, src/osdef2.h.in, src/os_unix.c, src/pty.c, src/vim.h Patch 7.0.203 Problem: 0x80 characters in a register are not handled correctly for the "@" command. Solution: Escape CSI and 0x80 characters. (Yukihiro Nakadaira) Files: src/ops.c Patch 7.0.204 Problem: Cscope: Parsing matches for listing isn't done properly. Solution: Check for line number being found. (Yu Zhao) Files: src/if_cscope.c Patch 7.0.205 (after 7.0.203) Problem: Can't compile. Solution: Always include the vim_strsave_escape_csi function. Files: src/getchar.c Patch 7.0.206 (after 7.0.058) Problem: Some characters of the "gb18030" encoding are not handled properly. Solution: Do not use "cp936" as an alias for "gb18030" encoding. Instead initialize 'encoding' to "cp936". Files: src/mbyte.c, src/option.c Patch 7.0.207 Problem: After patch 2.0.203 CSI and K_SPECIAL characters are escaped when recorded and then again when the register is executed. Solution: Remove escaping before putting the recorded characters in a register. (Yukihiro Nakadaira) Files: src/getchar.c, src/ops.c, src/proto/getchar.pro Patch 7.0.208 (after 7.0.171 and 7.0.180) Problem: VMS: changes to path handling cause more trouble than they solve. Solution: Revert changes. Files: src/buffer.c, src/memline.c, src/os_unix.c Patch 7.0.209 Problem: When replacing a line through Python the cursor may end up beyond the end of the line. Solution: Check the cursor column after replacing the line. Files: src/if_python.c Patch 7.0.210 Problem: ":cbuffer" and ":lbuffer" always fail when the buffer is modified. (Gary Johnson) Solution: Support adding a !. (Yegappan Lakshmanan) Files: runtime/doc/quickfix.txt, src/ex_cmds.h Patch 7.0.211 Problem: With ":set cindent noai bs=0" using CTRL-U in Insert mode will delete auto-indent. After ":set ai" it doesn't. Solution: Also check 'cindent' being set. (Ryan Lortie) Files: src/edit.c Patch 7.0.212 Problem: The GUI can't be terminated with SIGTERM. (Mark Logan) Solution: Use the signal protection in the GUI as in the console, allow signals when waiting for 100 msec or longer. Files: src/ui.c Patch 7.0.213 Problem: When 'spellfile' has two regions that use the same sound folding using "z=" will cause memory to be freed twice. (Mark Woodward) Solution: Clear the hashtable properly so that the items are only freed once. Files: src/spell.c Patch 7.0.214 Problem: When using <f-args> in a user command it's not possible to have an argument end in '\ '. Solution: Change the handling of backslashes. (Yakov Lerner) Files: runtime/doc/map.txt, src/ex_docmd.c Patch 7.0.215 (extra) Problem: Mac: Scrollbar size isn't set. Context menu has disabled useless Help entry. Call to MoreMasterPointers() is ignored. Solution: Call SetControlViewSize() in gui_mch_set_scrollbar_thumb(). Use kCMHelpItemRemoveHelp for ContextualMenuSelect(). Remove call to MoreMasterPointers(). (Nicolas Weber) Files: src/gui_mac.c Patch 7.0.216 Problem: ":tab wincmd ]" does not open a tab page. (Tony Mechelynck) Solution: Copy the cmdmod.tab value to postponed_split_tab and use it. Files: src/globals.h, src/ex_docmd.c, src/if_cscope.c, src/window.c Patch 7.0.217 Problem: This hangs when pressing "n": ":%s/\n/,\r/gc". (Ori Avtalion) Solution: Set "skip_match" to advance to the next line. Files: src/ex_cmds.c Patch 7.0.218 Problem: "%B" in 'statusline' always shows zero in Insert mode. (DervishD) Solution: Remove the exception for Insert mode, check the column for being valid instead. Files: src/buffer.c Patch 7.0.219 Problem: When using the 'editexisting.vim' script and a file is being edited in another tab page the window is split. The "+123" argument is not used. Solution: Make the tab page with the file the current tab page. Set v:swapcommand when starting up to the first "+123" or "-c" command line argument. Files: runtime/macros/editexisting.vim, src/main.c Patch 7.0.220 Problem: Crash when using winnr('#') in a new tab page. (Andy Wokula) Solution: Check for not finding the window. Files: src/eval.c Patch 7.0.221 Problem: finddir() uses 'path' by default, where "." means relative to the current file. But it works relative to the current directory. (Tye Zdrojewski) Solution: Add the current buffer name to find_file_in_path_option() for the relative file name. Files: runtime/doc/eval.txt, src/eval.c Patch 7.0.222 Problem: Perl indenting using 'cindent' works almost right. Solution: Recognize '#' to start a comment. (Alex Manoussakis) Added '#' flag in 'cinoptions'. Files: runtime/doc/indent.txt, src/misc1.c Patch 7.0.223 Problem: Unprintable characters in completion text mess up the popup menu. (Gombault Damien) Solution: Use strtrans() to make the text printable. Files: src/charset.c, src/popupmnu.c Patch 7.0.224 Problem: When expanding "##" spaces are escaped twice. (Pavol Juhas) Solution: Don't escape the spaces that separate arguments. Files: src/eval.c, src/ex_docmd.c, src/proto/ex_docmd.pro Patch 7.0.225 Problem: When using setline() in an InsertEnter autocommand and doing "A" the cursor ends up on the last byte in the line. (Yukihiro Nakadaira) Solution: Only adjust the column when using setline() for the cursor line. Move it back to the head byte if necessary. Files: src/eval.c, src/misc2.c Patch 7.0.226 Problem: Display flickering when updating signs through the netbeans interface. (Xavier de Gaye) Solution: Remove the redraw_later(CLEAR) call. Files: src/netbeans.c Patch 7.0.227 Problem: Crash when closing a window in the GUI. (Charles Campbell) Solution: Don't call out_flush() from win_free(). Files: src/window.c Patch 7.0.228 Problem: Cygwin: problem with symlink to DOS style path. Solution: Invoke cygwin_conv_to_posix_path(). (Luca Masini) Files: src/os_unix.c Patch 7.0.229 Problem: When 'pastetoggle' starts with Esc then pressing Esc in Insert mode will not time out. (Jeffery Small) Solution: Use KL_PART_KEY instead of KL_PART_MAP, so that 'ttimeout' applies to the 'pastetoggle' key. Files: src/getchar.c Patch 7.0.230 Problem: After using ":lcd" a script doesn't know how to restore the current directory. Solution: Add the haslocaldir() function. (Bob Hiestand) Files: runtime/doc/usr_41.txt, runtime/doc/eval.txt, src/eval.c Patch 7.0.231 Problem: When recovering from a swap file the page size is likely to be different from the minimum. The block used for the first page then has a buffer of the wrong size, causing a crash when it's reused later. (Zephaniah Hull) Solution: Reallocate the buffer when the page size changes. Also check that the page size is at least the minimum value. Files: src/memline.c Patch 7.0.232 (extra) Problem: Mac: doesn't support GUI tab page labels. Solution: Add GUI tab page labels. (Nicolas Weber) Files: src/feature.h, src/gui.c, src/gui.h, src/gui_mac.c, src/proto/gui_mac.pro Patch 7.0.233 (extra) Problem: Mac: code formatted badly. Solution: Fix code formatting Files: src/gui_mac.c Patch 7.0.234 Problem: It's possible to use feedkeys() from a modeline. That is a security issue, can be used for a trojan horse. Solution: Disallow using feedkeys() in the sandbox. Files: src/eval.c Patch 7.0.235 Problem: It is possible to use writefile() in the sandbox. Solution: Add a few more checks for the sandbox. Files: src/eval.c Patch 7.0.236 Problem: Linux 2.4 uses sysinfo() with a mem_unit field, which is not backwards compatible. Solution: Add an autoconf check for sysinfo.mem_unit. Let mch_total_mem() return Kbyte to avoid overflow. Files: src/auto/configure, src/configure.in, src/config.h.in, src/option.c, src/os_unix.c Patch 7.0.237 Problem: For root it is recommended to not use 'modeline', but in not-compatible mode the default is on. Solution: Let 'modeline' default to off for root. Files: runtime/doc/options.txt, src/option.c Patch 7.0.238 Problem: Crash when ":match" pattern runs into 'maxmempattern'. (Yakov Lerner) Solution: Don't free the regexp program of match_hl. Files: src/screen.c Patch 7.0.239 Problem: When using local directories and tab pages ":mksession" uses a short file name when it shouldn't. Window-local options from a modeline may be applied to the wrong window. (Teemu Likonen) Solution: Add the did_lcd flag, use the full path when it's set. Don't use window-local options from the modeline when using the current window for another buffer in ":doautoall". Files: src/fileio.c, src/ex_docmd.c Patch 7.0.240 Problem: Crash when splitting a window in the GUI. (opposite of 7.0.227) Solution: Don't call out_flush() from win_alloc(). Also avoid this for win_delete(). Also block autocommands while the window structure is invalid. Files: src/window.c Patch 7.0.241 Problem: ":windo throw 'foo'" loops forever. (Andy Wokula) Solution: Detect that win_goto() doesn't work. Files: src/ex_cmds2.c Patch 7.0.242 (extra) Problem: Win32: Using "-register" in a Vim that does not support OLE causes a crash. Solution: Don't use EMSG() but mch_errmsg(). Check p_go for being NULL. (partly by Michael Wookey) Files: src/gui_w32.c Patch 7.0.243 (extra) Problem: Win32: When GvimExt is built with MSVC 2005 or later, the "Edit with vim" context menu doesn't appear in the Windows Explorer. Solution: Embed the linker manifest file into the resources of GvimExt.dll. (Mathias Michaelis) Files: src/GvimExt/Makefile Fixes after Vim 7.1a BETA: The extra archive had CVS directories included below "farsi" and "runtime/icons". CVS was missing the farsi icon files. Fix compiling with Gnome 2.18, undefine bind_textdomain_codeset. (Daniel Drake) Mac: "make install" didn't copy rgb.txt. When editing a compressed file while there are folds caused "ml_get" errors and some lines could be missing. When decompressing failed option values were not restored. Patch 7.1a.001 Problem: Crash when downloading a spell file. (Szabolcs Horvat) Solution: Avoid that did_set_spelllang() is used recursively when a new window is opened for the download. Also avoid wiping out the wrong buffer. Files: runtime/autoload/spellfile.vim, src/buffer.c, src/ex_cmds.c, src/spell.c Patch 7.1a.002 (extra) Problem: Compilation error with MingW. Solution: Check for LPTOOLTIPTEXT to be defined. Files: src/gui_w32.c Fixes after Vim 7.1b BETA: Made the Mzscheme interface build both with old and new versions of Mzscheme, using an #ifdef. (Sergey Khorev) Mzscheme interface didn't link, missing function. Changed order of libraries in the configure script. Ruby interface didn't compile on Mac. Changed #ifdef. (Kevin Ballard) Patch 7.1b.001 (extra) Problem: Random text in a source file. No idea how it got there. Solution: Delete the text. Files: src/gui_w32.c Patch 7.1b.002 Problem: When 'maxmem' is large there can be an overflow in computations. (Thomas Wiegner) Solution: Use the same mechanism as in mch_total_mem(): first reduce the multiplier as much as possible. Files: src/memfile.c ============================================================================== VERSION 7.2 *version-7.2* *version7.2* This section is about improvements made between version 7.1 and 7.2. This is mostly a bug-fix release. The main new feature is floating point support. |Float| Changed *changed-7.2* ------- Changed the command line buffer name from "command-line" to "[Command Line]". Removed optional ! for ":caddexpr", ":cgetexpr", ":cgetfile", ":laddexpr", ":lgetexpr" and ":lgetfile". They are not needed. (Yegappan Lakshmanan) An offset for syntax matches worked on bytes instead of characters. That is inconsistent and can easily be done wrong. Use character offsets now. (Yukihiro Nakadaira) The FileChangedShellPost event was also given when a file didn't change. (John Little) When the current line is long (doesn't fit) the popup menu can't be seen. Display it below the screen line instead of below the text line. (Francois Ingelrest) Switched to autoconf version 2.62. Moved including fcntl.h to vim.h and removed it from all .c files. Introduce macro STRMOVE(d, s), like STRCPY() for overlapping strings. Use it instead of mch_memmove(p, p + x, STRLEN(p + x) + 1). Removed the bulgarian.vim keymap file, two more standard ones replace it. (Boyko Bantchev) Increased the maximum number of tag matches for command line completion from 200 to 300. Renamed help file sql.txt to ft_sql.txt and ada.txt to ft_ada.txt. Added *added-7.2* ----- New syntax files: CUDA (Timothy B. Terriberry) Cdrdao config (Nikolai Weibull) Coco/R (Ashish Shukla) Denyhosts config (Nikolai Weibull) Dtrace script (Nicolas Weber) Git output, commit, config, rebase, send-email (Tim Pope) HASTE and HastePreProc (M. Tranchero) Haml (Tim Pope) Host conf (Nikolai Weibull) Linden script (Timo Frenay) MS messages (Kevin Locke) PDF (Tim Pope) ProMeLa (Maurizio Tranchero) Reva Foth (Ron Aaron) Sass (Tim Pope) Symbian meta-makefile, MMP (Ron Aaron) VOS CM macro (Andrew McGill) XBL (Doug Kearns) New tutor files: Made UTF-8 versions of all the tutor files. Greek renamed from ".gr" to ".el" (Greek vs Greece). Esperanto (Dominique Pelle) Croatian (Paul B. Mahol) New filetype plugins: Cdrdao config (Nikolai Weibull) Debian control files (Debian Vim maintainers) Denyhosts (Nikolai Weibull) Dos .ini file (Nikolai Weibull) Dtrace script (Nicolas Weber) FnameScript (Nikolai Weibull) Git, Git config, Git commit, Git rebase, Git send-email (Tim Pope) Haml (Tim Pope) Host conf (Nikolai Weibull) Host access (Nikolai Weibull) Logtalk (Paulo Moura) MS messages (Kevin Locke) NSIS script (Nikolai Weibull) PDF (Tim Pope) Reva Forth (Ron Aaron) Sass (Tim Pope) New indent files: DTD (Nikolai Weibull) Dtrace script (Nicolas Weber) Erlang (Csaba Hoch) FrameScript (Nikolai Weibull) Git config (Tim Pope) Haml (Tim Pope) Logtalk (Paulo Moura) Sass (Tim Pope) Tiny Fugue (Christian J. Robinson) New compiler plugins: RSpec (Tim Pope) New keymap files: Croatian (Paul B. Mahol) Russian Dvorak (Serhiy Boiko) Ukrainian Dvorak (Serhiy Boiko) Removed plain Bulgarian, "bds" and phonetic are sufficient. Other new runtime files: Esperanto menu and message translations. (Dominique Pelle) Finnish menu and message translations. (Flammie Pirinen) Brazilian Portuguese message translations. (Eduardo Dobay) Added floating point support. |Float| Added argument to mode() to return a bit more detail about the current mode. (Ben Schmidt) Added support for BSD console mouse: |sysmouse|. (Paul B. Mahol) Added the "newtab" value for the 'switchbuf' option. (partly by Yegappan Lakshmanan) Improved error messages for the netbeans interface. (Philippe Fremy) Added support for using xterm mouse codes for screen. (Micah Cowan) Added support for cross compiling: Adjusted configure.in and added INSTALLcross.txt. (Marc Haisenko) Fixed mistakes in configure.in after that. Don't use /usr/local/include and /usr/local/lib in configure. (Philip Prindeville) For cross compiling the Cygwin version on Unix, change VIM.TLB to vim.tlb in src/vim.rc. (Tsuneo Nakagawa) Added v:searchforward variable: What direction we're searching in. (Yakov Lerner) Fixed *fixed-7.2* ----- Patch 7.1.001 Problem: Still can't build with Gnome libraries. Solution: Fix typo in bind_textdomain_codeset. (Mike Kelly) Files: src/gui_gtk.c, src/gui_gtk_x11.c Patch 7.1.002 Problem: Oracle Pro*C/C++ files are not detected. Solution: Add the missing star. (Micah J. Cowan) Files: runtime/filetype.vim Patch 7.1.003 (extra) Problem: The "Tear off this menu" message appears in the message history when using a menu. (Yongwei Wu) Solution: Disable message history when displaying the menu tip. Files: src/gui_w32.c Patch 7.1.004 Problem: Crash when doing ":next directory". (Raphael Finkel) Solution: Do not use "buf", it may be invalid after autocommands. Files: src/ex_cmds.c Patch 7.1.005 Problem: "cit" used on <foo></foo> deletes <foo>. Should not delete anything and start insertion, like "ci'" does on "". (Michal Bozon) Solution: Handle an empty object specifically. Made it work consistent for various text objects. Files: src/search.c Patch 7.1.006 Problem: Resetting 'modified' in a StdinReadPost autocommand doesn't work. Solution: Set 'modified' before the autocommands instead of after it. Files: src/buffer.c Patch 7.1.007 (extra) Problem: Mac: Context menu doesn't work on Intel Macs. Scrollbars are not dimmed when Vim is not the active application. Solution: Remove the test whether context menus are supported. They are always there in OS/X. Handle the dimming. (Nicolas Weber) Files: src/gui_mac.c, src/gui.h Patch 7.1.008 Problem: getfsize() returns a negative number for very big files. Solution: Check for overflow and return -2. Files: runtime/doc/eval.txt, src/eval.c Patch 7.1.009 Problem: In diff mode, displaying the difference between a tab and spaces is not highlighted correctly. Solution: Only change highlighting at the end of displaying a tab. Files: src/screen.c Patch 7.1.010 Problem: The Gnome session file doesn't restore tab pages. Solution: Add SSOP_TABPAGES to the session flags. (Matias D'Ambrosio) Files: src/gui_gtk_x11.c Patch 7.1.011 Problem: Possible buffer overflow when $VIMRUNTIME is very long. (Victor Stinner) Solution: Use vim_snprintf(). Files: src/main.c Patch 7.1.012 Problem: ":let &shiftwidth = 'asdf'" doesn't produce an error message. Solution: Check for a string argument. (Chris Lubinski) Files: src/option.c Patch 7.1.013 Problem: ":syn include" only loads the first file, while it is documented as doing the equivalent of ":runtime!". Solution: Change the argument to source_runtime(). (James Vega) Files: src/syntax.c Patch 7.1.014 Problem: Crash when doing C indenting. (Chris Monson) Solution: Obtain the current line again after invoking cin_islabel(). Files: src/edit.c Patch 7.1.015 Problem: MzScheme interface: current-library-collection-paths produces no list. Interface doesn't build on a Mac. Solution: Use a list instead of a pair. (Bernhard Fisseni) Use "-framework" argument for MZSCHEME_LIBS in configure. Files: src/configure.in, src/if_mzsch.c, src/auto/configure Patch 7.1.016 (after patch 7.1.012) Problem: Error message about setting 'diff' to a string. Solution: Don't pass an empty string to set_option_value() when setting 'diff'. Files: src/quickfix.c, src/popupmnu.c Patch 7.1.017 Problem: ":confirm w" does give a prompt when 'readonly' is set, but not when the file permissions are read-only. (Michael Schaap) Solution: Provide a dialog in both situations. (Chris Lubinski) Files: src/ex_cmds.c, src/fileio.c, src/proto/fileio.pro Patch 7.1.018 Problem: When 'virtualedit' is set a "p" of a block just past the end of the line inserts before the cursor. (Engelke) Solution: Check for the cursor being just after the line (Chris Lubinski) Files: src/ops.c Patch 7.1.019 Problem: ":py" asks for an argument, ":py asd" then gives the error that ":py" isn't implemented. Should already happen for ":py". Solution: Compare with ex_script_ni. (Chris Lubinski) Files: src/ex_docmd.c Patch 7.1.020 Problem: Reading from uninitialized memory when using a dialog. (Dominique Pelle) Solution: In msg_show_console_dialog() append a NUL after every appended character. Files: src/message.c Patch 7.1.021 (after 7.1.015) Problem: Mzscheme interface doesn't compile on Win32. Solution: Fix the problem that 7.1.015 fixed in a better way. (Sergey Khorev) Files: src/if_mzsch.c Patch 7.1.022 Problem: When setting 'keymap' twice the b:keymap_name variable isn't set. (Milan Berta) Solution: Don't unlet b:keymap_name for ":loadkeymap". (Martin Toft) Files: src/digraph.c Patch 7.1.023 Problem: "dw" in a line with one character deletes the line. Vi and nvi don't do this. (Kjell Arne Rekaa) Solution: Check for one-character words especially. Files: src/search.c Patch 7.1.024 Problem: Using a pointer that has become invalid. (Chris Monson) Solution: Obtain the line pointer again after we looked at another line. Files: src/search.c Patch 7.1.025 Problem: search() and searchpos() don't use match under cursor at start of line when using 'bc' flags. (Viktor Kojouharov) Solution: Don't go to the previous line when the 'c' flag is present. Also fix that "j" doesn't move the cursor to the right column. Files: src/eval.c, src/search.c Patch 7.1.026 Problem: "[p" doesn't work in Visual mode. (David Brown) Solution: Use checkclearop() instead of checkclearopq(). Files: src/normal.c Patch 7.1.027 Problem: On Sun systems opening /dev/fd/N doesn't work, and they are used by process substitutions. Solution: Allow opening specific character special files for Sun systems. (Gary Johnson) Files: src/fileio.c, src/os_unix.h Patch 7.1.028 Problem: Can't use last search pattern for ":sort". (Brian McKee) Solution: When the pattern is empty use the last search pattern. (Martin Toft) Files: runtime/doc/change.txt, src/ex_cmds.c Patch 7.1.029 (after 7.1.019) Problem: Can't compile when all interfaces are used. (Taylor Venable) Solution: Only check for ex_script_ni when it's defined. Files: src/ex_docmd.c Patch 7.1.030 Problem: The "vimtutor" shell script checks for "vim6" but not for "vim7". (Christian Robinson) Solution: Check for more versions, but prefer using "vim". Files: src/vimtutor Patch 7.1.031 Problem: virtcol([123, '$']) doesn't work. (Michael Schaap) Solution: When '$' is used for the column number get the last column. Files: runtime/doc/eval.txt, src/eval.c Patch 7.1.032 Problem: Potential crash when editing a command line. (Chris Monson) Solution: Check the position to avoid access before the start of an array. Files: src/ex_getln.c Patch 7.1.033 Problem: A buffer is marked modified when it was first deleted and then added again using a ":next" command. (John Mullin) Solution: When checking if a buffer is modified use the BF_NEVERLOADED flag. Files: src/option.c Patch 7.1.034 Problem: Win64: A few compiler warnings. Problems with optimizer. Solution: Use int instead of size_t. Disable the optimizer in one function. (George V. Reilly) Files: src/eval.c, src/spell.c Patch 7.1.035 Problem: After ":s/./&/#" all listed lines have a line number. (Yakov Lerner) Solution: Reset the line number flag when not using the "&" flag. Files: src/ex_cmds.c Patch 7.1.036 Problem: Completing ":echohl" argument should include "None". (Ori Avtalion) ":match" should have "none" too. Solution: Add flags to use expand_highlight(). Also fix that when disabling FEAT_CMDL_COMPL compilation fails. (Chris Lubinski) Files: src/eval.c, src/ex_docmd.c, src/ex_getln.c, src/proto/syntax.pro src/syntax.c Patch 7.1.037 Problem: strcpy() used for overlapping strings. (Chris Monson) Solution: Use mch_memmove() instead. Files: src/option.c Patch 7.1.038 Problem: When 'expandtab' is set then a Tab copied for 'copyindent' is expanded to spaces, even when 'preserveindent' is set. (Alexei Alexandrov) Solution: Remove the check for 'expandtab'. Also fix that ">>" doesn't obey 'preserveindent'. (Chris Lubinski) Files: src/misc1.c Patch 7.1.039 Problem: A tag in a help file that starts with "help-tags" and contains a percent sign may make Vim crash. (Ulf Harnhammar) Solution: Use puts() instead of fprintf(). Files: src/ex_cmds.c Patch 7.1.040 Problem: ":match" only supports three matches. Solution: Add functions clearmatches(), getmatches(), matchadd(), matchdelete() and setmatches(). Changed the data structures for this. A small bug in syntax.c is fixed, so newly created highlight groups can have their name resolved correctly from their ID. (Martin Toft) Files: runtime/doc/eval.txt, runtime/doc/pattern.txt, runtime/doc/usr_41.txt, src/eval.c, src/ex_docmd.c, src/proto/window.pro, src/screen.c, src/structs.h, src/syntax.c, src/testdir/Makefile, src/testdir/test63.in, src/testdir/test63.ok, src/window.c Patch 7.1.041 (extra, after 7.1.040) Problem: Some changes for patch 7.1.040 are in extra files. Solution: Update the extra files. Files: src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak, src/testdir/Make_os2.mak, src/testdir/Make_vms.mms Patch 7.1.042 (after 7.1.040) Problem: Internal error when using matchadd(). (David Larson) Solution: Check the third argument to be present before using the fourth argument. (Martin Toft) Files: src/eval.c Patch 7.1.043 Problem: In Ex mode using CTRL-D twice may cause a crash. Cursor isn't positioned properly after CTRL-D. Solution: Set prev_char properly. Position the cursor correctly. (Antony Scriven) Files: src/ex_getln.c Patch 7.1.044 Problem: In Insert mode 0 CTRL-T deletes all indent, it should add indent. (Gautam Iyer) Solution: Check for CTRL-D typed. Files: src/edit.c Patch 7.1.045 Problem: Unnecessary screen redrawing. (Jjgod Jiang) Solution: Reset "must_redraw" after clearing the screen. Files: src/screen.c Patch 7.1.046 Problem: ":s" command removes combining characters. (Ron Aaron) Solution: Copy composing characters individually. (Chris Lubinski) Files: src/regexp.c Patch 7.1.047 Problem: vim_regcomp() called with invalid argument. (Xiaozhou Liu) Solution: Change TRUE to RE_MAGIC + RE_STRING. Files: src/ex_eval.c Patch 7.1.048 Problem: The matchparen plugin doesn't update the match when scrolling with the mouse wheel. (Ilya Bobir) Solution: Set the match highlighting for text that can be scrolled into the viewable area without moving the cursor. (Chris Lubinski) Files: runtime/plugin/matchparen.vim Patch 7.1.049 Problem: Cannot compile GTK2 version with Hangul input feature. Solution: Don't define FEAT_XFONTSET when using GTK2. Files: src/feature.h Patch 7.1.050 Problem: Possible crash when using C++ indenting. (Chris Monson) Solution: Keep the line pointer to the line to compare with. Avoid going past the end of line. Files: src/misc1.c Patch 7.1.051 Problem: Accessing uninitialized memory when finding spell suggestions. Solution: Don't try swapping characters at the end of a word. Files: src/spell.c Patch 7.1.052 Problem: When creating a new match not all fields are initialized, which may lead to unpredictable results. Solution: Initialise rmm_ic and rmm_maxcol. Files: src/window.c Patch 7.1.053 Problem: Accessing uninitialized memory when giving a message. Solution: Check going the length before checking for a NUL byte. Files: src/message.c Patch 7.1.054 Problem: Accessing uninitialized memory when displaying the fold column. Solution: Add a NUL to the extra array. (Dominique Pelle). Also do this in a couple of other situations. Files: src/screen.c Patch 7.1.055 Problem: Using strcpy() with arguments that overlap. Solution: Use mch_memmove() instead. Files: src/buffer.c, src/charset.c, src/eval.c, src/ex_getln.c, src/misc1.c, src/regexp.c, src/termlib.c Patch 7.1.056 Problem: More prompt does not behave correctly after scrolling back. (Randall W. Morris) Solution: Avoid lines_left becomes negative. (Chris Lubinski) Don't check mp_last when deciding to show the more prompt. (Martin Toft) Files: src/message.c Patch 7.1.057 Problem: Problem with CursorHoldI when using "r" in Visual mode (Max Dyckhoff) Solution: Ignore CursorHold(I) when getting a second character for a Normal mode command. Also abort the "r" command in Visual when a special key is typed. Files: src/normal.c Patch 7.1.058 Problem: When 'rightleft' is set the completion menu is positioned wrong. (Baha-Eddine MOKADEM) Solution: Fix the completion menu. (Martin Toft) Files: src/popupmnu.c, src/proto/search.pro, src/search.c Patch 7.1.059 Problem: When in Ex mode and doing "g/^/vi" and then pressing CTRL-C Vim hangs and beeps. (Antony Scriven) Solution: Clear "got_int" in the main loop to avoid the hang. When typing CTRL-C twice in a row abort the ":g" command. This is Vi compatible. Files: src/main.c Patch 7.1.060 Problem: Splitting quickfix window messes up window layout. (Marius Gedminas) Solution: Compute the window size in a smarter way. (Martin Toft) Files: src/window.c Patch 7.1.061 Problem: Win32: When 'encoding' is "latin1" 'ignorecase' doesn't work for characters with umlaut. (Joachim Hofmann) Solution: Do not use islower()/isupper()/tolower()/toupper() but our own functions. (Chris Lubinski) Files: src/mbyte.c, src/regexp.c, src/vim.h Patch 7.1.062 (after 7.1.038) Problem: Indents of C comments can be wrong. (John Mullin) Solution: Adjust ind_len. (Chris Lubinski) Files: src/misc1.c Patch 7.1.063 (after 7.1.040) Problem: Warning for uninitialized variable. Solution: Initialise it to NULL. Files: src/ex_docmd.c Patch 7.1.064 Problem: On Interix some files appear not to exist. Solution: Remove the top bit from st_mode. (Ligesh) Files: src/os_unix.c Patch 7.1.065 (extra) Problem: Win32: Compilation problem for newer version of w32api. Solution: Only define __IID_DEFINED__ when needed. (Chris Sutcliffe) Files: src/Make_ming.mak, src/iid_ole.c Patch 7.1.066 Problem: When 'bomb' is set or reset the file should be considered modified. (Tony Mechelynck) Solution: Handle like 'endofline'. (Martin Toft) Files: src/buffer.c, src/fileio.c, src/option.c, src/structs.h Patch 7.1.067 Problem: 'thesaurus' doesn't work when 'infercase' is set. (Mohsin) Solution: Don't copy the characters being completed but check the case and apply it to the suggested word. Also fix that the first word in the thesaurus line is not used. (Martin Toft) Files: src/edit.c Patch 7.1.068 Problem: When 'equalalways' is set and splitting a window, it's possible that another small window gets bigger. Solution: Only equalize window sizes when after a split the windows are smaller than another window. (Martin Toft) Files: runtime/doc/options.txt, runtime/doc/windows.txt, src/window.c Patch 7.1.069 Problem: GTK GUI: When using confirm() without a default button there still is a default choice. Solution: Ignore Enter and Space when there is no default button. (Chris Lubinski) Files: src/gui_gtk.c Patch 7.1.070 (extra) Problem: Win32 GUI: When using confirm() without a default button there still is a default choice. Solution: Set focus on something else than a button. (Chris Lubinski) Files: src/gui_w32.c Patch 7.1.071 (after 7.1.040) Problem: Regexp patterns are not tested. Solution: Add a basic test, to be expanded later. Also add (commented-out) support for valgrind. Files: src/testdir/Makefile, src/testdir/test64.in, src/testdir/test64.ok Patch 7.1.072 (extra, after 7.1.041 and 7.1.071) Problem: Some changes for patch 7.1.071 are in extra files. Solution: Update the extra files. Also fix a few warnings from the DOS test makefile. Files: src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak, src/testdir/Make_os2.mak, src/testdir/Make_vms.mms Patch 7.1.073 (after 7.1.062) Problem: Wrong cursor position and crash when 'preserveindent' is set. (Charles Campbell) Solution: Handle the situation that we start without indent. (Chris Lubinski) Files: src/misc1.c Patch 7.1.074 Problem: Crash when calling string() on a recursively nested List. Solution: Check result value for being NULL. (Yukihiro Nakadaira) Files: src/eval.c Patch 7.1.075 Problem: ":let v:statusmsg" reads memory already freed. Solution: Don't set v:statusmsg when listing it. Files: src/eval.c Patch 7.1.076 Problem: Another strcpy() with overlapping arguments. Solution: Use mch_memmove(). (Dominique Pelle) And another one. Files: src/ex_docmd.c, src/normal.c Patch 7.1.077 Problem: Using "can_spell" without initializing it. (Dominique Pelle) Solution: Set a default for get_syntax_attr(). Files: src/syntax.c Patch 7.1.078 Problem: Dropping a file name on gvim that contains a CSI byte doesn't work when editing the command line. Solution: Escape the CSI byte when inserting in the input buffer. (Yukihiro Nakadaira) Files: src/gui.c, src/ui.c Patch 7.1.079 Problem: When the locale is "C" and 'encoding' is "latin1" then the "@" character in 'isfname', 'isprint', etc. doesn't pick up accented characters. Solution: Instead of isalpha() use MB_ISLOWER() and MB_ISUPPER(). Files: src/charset.c, src/macros.h Patch 7.1.080 (extra) Problem: Compiler warnings for using "const char *" for "char *". Solution: Add type casts. (Chris Sutcliffe) Files: src/GvimExt/gvimext.cpp Patch 7.1.081 Problem: Command line completion for a shell command: "cat </tmp/file<Tab>" doesn't work. Solution: Start the file name at any character that can't be in a file name. (Martin Toft) Files: src/ex_docmd.c Patch 7.1.082 Problem: After a ":split" the matchparen highlighting isn't there. Solution: Install a WinEnter autocommand. Also fixes that after ":NoMatchParen" only the current window is updated. (Martin Toft) Files: runtime/doc/pi_paren.txt, runtime/plugin/matchparen.vim Patch 7.1.083 (after 7.1.081) Problem: Command line completion doesn't work with wildcards. Solution: Add vim_isfilec_or_wc() and use it. (Martin Toft) Files: src/charset.c, src/proto/charset.pro, src/ex_docmd.c Patch 7.1.084 Problem: Using the "-nb" argument twice causes netbeans not to get fileOpened events. Solution: Change "&" to "&&". (Xavier de Gaye) Files: src/ex_cmds.c Patch 7.1.085 Problem: ":e fold.c" then ":sp fold.c" results in folds of original window to disappear. (Akita Noek) Solution: Invoke foldUpdateAll() for all windows of the changed buffer. (Martin Toft) Files: src/ex_cmds.c Patch 7.1.086 Problem: Crash when using specific Python syntax highlighting. (Quirk) Solution: Check for a negative index, coming from a keyword match at the start of a line from a saved state. Files: src/syntax.c Patch 7.1.087 Problem: Reading past ":cscope find" command. Writing past end of a buffer. Solution: Check length of the argument before using the pattern. Use vim_strncpy(). (Dominique Pelle) Files: if_cscope.c Patch 7.1.088 (extra) Problem: The coordinates used by ":winpos" differ from what getwinposx() and getwinposy() return. Solution: Use MoveWindowStructure() instead of MoveWindow(). (Michael Henry) Files: src/gui_mac.c Patch 7.1.089 Problem: ":let loaded_getscriptPlugin" doesn't clear to eol, result is "#1in". Solution: Clear to the end of the screen after displaying the first variable value. Files: src/eval.c Patch 7.1.090 Problem: Compiler warning on Mac OS X 10.5. Solution: Don't redeclare sigaltstack(). (Hisashi T Fujinaka) Files: src/os_unix.c Patch 7.1.091 (extra) Problem: Win32: Can't embed Vim inside another application. Solution: Add the --windowid argument. (Nageshwar) Files: runtime/doc/gui_w32.txt, runtime/doc/starting.txt, runtime/doc/vi_diff.txt, src/globals.h, src/gui_w32.c, src/main.c Patch 7.1.092 (extra, after 7.1.088) Problem: Wrong arguments for MoveWindowStructure(). Solution: Remove "TRUE". (Michael Henry) Files: src/gui_mac.c Patch 7.1.093 Problem: Reading past end of a screen line when determining cell width. (Dominique Pelle) Solution: Add an argument to mb_off2cells() for the maximum offset. Files: src/globals.h, src/gui.c, src/mbyte.c, src/proto/mbyte.pro, src/screen.c Patch 7.1.094 Problem: When checking if syntax highlighting is present, looking in the current buffer instead of the specified one. Solution: Use "buf" instead of "curbuf". Files: src/syntax.c Patch 7.1.095 Problem: The FocusLost and FocusGained autocommands are triggered asynchronously in the GUI. This may cause arbitrary problems. Solution: Put the focus event in the input buffer and handle it when ready for it. Files: src/eval.c, src/getchar.c, src/gui.c, src/gui_gtk_x11.c, src/keymap.h Patch 7.1.096 Problem: Reading past end of a string when resizing Vim. (Dominique Pelle) Solution: Check the string pointer before getting the char it points to. Files: src/message.c Patch 7.1.097 Problem: ":setlocal stl=%!1+1" does not work. Solution: Adjust check for pointer. (Politz) Files: src/option.c Patch 7.1.098 Problem: ":call s:var()" doesn't work if "s:var" is a Funcref. (Andy Wokula) Solution: Before converting "s:" into a script ID, check if it is a Funcref. Files: src/eval.c Patch 7.1.099 Problem: When the 'keymap' and 'paste' options have a non-default value, ":mkexrc" and ":mksession" do not correctly set the options. Solution: Set the options with side effects before other options. Files: src/option.c Patch 7.1.100 Problem: Win32: Executing cscope doesn't always work properly. Solution: Use another way to invoke cscope. (Mike Williams) Files: src/if_cscope.c, src/if_cscope.h, src/main.c, src/proto/if_cscope.pro Patch 7.1.101 Problem: Ruby: The Buffer.line= method does not work. Solution: Add the "self" argument to set_current_line(). (Jonathan Hankins) Files: src/if_ruby.c Patch 7.1.102 Problem: Perl interface doesn't compile with new version of Perl. Solution: Add two variables to the dynamic library loading. (Suresh Govindachar) Files: src/if_perl.xs Patch 7.1.103 Problem: Using "dw" with the cursor past the end of the last line (using CTRL-\ CTRL-O from Insert mode) deletes a character. (Tim Chase) Solution: Don't move the cursor back when the movement failed. Files: src/normal.c Patch 7.1.104 (after 7.1.095) Problem: When 'lazyredraw' is set a focus event causes redraw to be postponed until a key is pressed. Solution: Instead of not returning from vgetc() when a focus event is encountered return K_IGNORE. Add plain_vgetc() for when the caller doesn't want to get K_IGNORE. Files: src/digraph.c, src/edit.c, src/ex_cmds.c, src/ex_getln.c, src/getchar.c, src/normal.c, src/proto/getchar.pro, src/window.c Patch 7.1.105 Problem: Internal error when using "0 ? {'a': 1} : {}". (A.Politz) Solution: When parsing a dictionary value without using the value, don't try obtaining the key name. Files: src/eval.c Patch 7.1.106 Problem: ":messages" doesn't quit listing on ":". Solution: Break the loop when "got_int" is set. Files: src/message.c Patch 7.1.107 Problem: When doing a block selection and using "s" to change the text, while triggering auto-indenting, causes the wrong text to be repeated in other lines. (Adri Verhoef) Solution: Compute the change of indent and compensate for that. Files: src/ops.c Patch 7.1.108 (after 7.1.100) Problem: Win32: Compilation problems in Cscope code. (Jeff Lanzarotta) Solution: Use (long) instead of (intptr_t) when it's not defined. Files: src/if_cscope.c Patch 7.1.109 Problem: GTK: when there are many tab pages, clicking on the arrow left of the labels moves to the next tab page on the right. (Simeon Bird) Solution: Check the X coordinate of the click and pass -1 as value for the left arrow. Files: src/gui_gtk_x11.c, src/term.c Patch 7.1.110 (after 7.1.102) Problem: Win32: Still compilation problems with Perl. Solution: Change the #ifdefs. (Suresh Govindachar) Files: src/if_perl.xs Patch 7.1.111 Problem: When using ":vimgrep" with the "j" flag folds from another buffer may be displayed. (A.Politz) Solution: When not jumping to another buffer update the folds. Files: src/quickfix.c Patch 7.1.112 Problem: Using input() with a wrong argument may crash Vim. (A.Politz) Solution: Init the input() return value to NULL. Files: src/eval.c Patch 7.1.113 Problem: Using map() to go over an empty list causes memory to be freed twice. (A.Politz) Solution: Don't clear the typeval in restore_vimvar(). Files: src/eval.c Patch 7.1.114 Problem: Memory leak in getmatches(). Solution: Don't increment the refcount twice. Files: src/eval.c Patch 7.1.115 (after 7.1.105) Problem: Compiler warning for uninitialized variable. (Tony Mechelynck) Solution: Init variable to NULL. Files: src/eval.c Patch 7.1.116 Problem: Cannot display Unicode characters above 0x10000. Solution: Remove the replacement with a question mark when UNICODE16 is not defined. (partly by Nicolas Weber) Files: src/screen.c Patch 7.1.117 Problem: Can't check whether Vim was compiled with Gnome. (Tony Mechelynck) Solution: Add gui_gnome to the has() list. Files: src/eval.c Patch 7.1.118 (after 7.1.107) Problem: Compiler warning for Visual C compiler. Solution: Add typecast. (Mike Williams) Files: src/ops.c Patch 7.1.119 Problem: Crash when 'cmdheight' set to very large value. (A.Politz) Solution: Limit 'cmdheight' to 'lines' minus one. Store right value of 'cmdheight' when running out of room. Files: src/option.c, src/window.c Patch 7.1.120 Problem: Can't properly check memory leaks while running tests. Solution: Add an argument to garbagecollect(). Delete functions and variables in the test scripts. Files: runtime/doc/eval.txt src/eval.c, src/globals.h, src/main.c, src/testdir/Makefile, src/testdir/test14.in, src/testdir/test26.in, src/testdir/test34.in, src/testdir/test45.in, src/testdir/test47.in, src/testdir/test49.in, src/testdir/test55.in, src/testdir/test56.in, src/testdir/test58.in, src/testdir/test59.in, src/testdir/test60.in, src/testdir/test60.vim, src/testdir/test62.in, src/testdir/test63.in, src/testdir/test64.in, Patch 7.1.121 Problem: Using ":cd %:h" when editing a file in the current directory results in an error message for using an empty string. Solution: When "%:h" results in an empty string use ".". Files: src/eval.c Patch 7.1.122 Problem: Mac: building Vim.app fails. Using wrong architecture. Solution: Use line continuation for the gui_bundle dependency. Detect the system architecture with "uname -a". Files: src/main.aap Patch 7.1.123 Problem: Win32: ":edit foo ~ foo" expands "~". Solution: Change the call to expand_env(). Files: src/ex_docmd.c, src/misc1.c, src/proto/misc1.pro, src/option.c Patch 7.1.124 (extra) Problem: Mac: When dropping a file on Vim.app that is already in the buffer list (from .viminfo) results in editing an empty, unnamed buffer. (Axel Kielhorn) Also: warning for unused variable. Solution: Move to the buffer of the first argument. Delete unused variable. Files: src/gui_mac.c Patch 7.1.125 Problem: The TermResponse autocommand event is not always triggered. (Aron Griffis) Solution: When unblocking autocommands check if v:termresponse changed and trigger the event then. Files: src/buffer.c, src/diff.c, src/ex_getln.c, src/fileio.c, src/globals.h, src/misc2.c, src/proto/fileio.pro, src/window.c Patch 7.1.126 (extra) Problem: ":vimgrep */*" fails when a BufRead autocommand changes directory. (Bernhard Kuhn) Solution: Change back to the original directory after loading a file. Also: use shorten_fname1() to avoid duplicating code. Files: src/buffer.c, src/ex_docmd.c, src/fileio.c, src/gui_gtk.c, src/gui_w48.c, src/proto/ex_docmd.pro, src/proto/fileio.pro, src/quickfix.c Patch 7.1.127 Problem: Memory leak when doing cmdline completion. (Dominique Pelle) Solution: Free "orig" argument of ExpandOne() when it's not used. Files: src/ex_getln.c Patch 7.1.128 (extra) Problem: Build problems with new version of Cygwin. Solution: Remove -D__IID_DEFINED__, like with MingW. (Guopeng Wen) Files: src/Make_cyg.mak Patch 7.1.129 (extra) Problem: Win32: Can't get the user name when it is longer than 15 characters. Solution: Use UNLEN instead of MAX_COMPUTERNAME_LENGTH. (Alexei Alexandrov) Files: src/os_win32.c Patch 7.1.130 Problem: Crash with specific order of undo and redo. (A.Politz) Solution: Clear and adjust pointers properly. Add u_check() for debugging. Files: src/undo.c, src/structs.h Patch 7.1.131 Problem: ":mksession" always adds ":setlocal autoread". (Christian J. Robinson) Solution: Skip boolean global/local option using global value. Files: src/option.c Patch 7.1.132 Problem: getpos("'>") may return a negative column number for a Linewise selection. (A.Politz) Solution: Don't add one to MAXCOL. Files: src/eval.c Patch 7.1.133 (after 7.1.126) Problem: shorten_fname1() linked when it's not needed. Solution: Add #ifdef. Files: src/fileio.c Patch 7.1.134 (extra) Problem: Win32: Can't build with VC8 Solution: Detect the MSVC version instead of using NMAKE_VER. (Mike Williams) Files: src/Make_mvc.mak Patch 7.1.135 Problem: Win32: When editing a file c:\tmp\foo and c:\tmp\\foo we have two buffers for the same file. (Suresh Govindachar) Solution: Invoke FullName_save() when a path contains "//" or "\\". Files: src/buffer.c Patch 7.1.136 Problem: Memory leak when using Ruby syntax highlighting. (Dominique Pelle) Solution: Free the contained-in list. Files: src/syntax.c Patch 7.1.137 Problem: Build failure when using EXITFREE. (Dominique Pelle) Solution: Add an #ifdef around using clip_exclude_prog. Files: src/misc2.c Patch 7.1.138 Problem: The Perl Msg() function doesn't stop when "q" is typed at the more prompt. (Hari Krishna Dara) Solution: Check got_int. Files: src/if_perl.xs Patch 7.1.139 Problem: When using marker folding and ending Insert mode with CTRL-C the current fold is truncated. (Fred Kater) Solution: Ignore got_int while updating folds. Files: src/fold.c Patch 7.1.140 Problem: v:count is set only after typing a non-digit, that makes it difficult to make a nice mapping. Solution: Set v:count while still typing the count. Files: src/normal.c Patch 7.1.141 Problem: GTK: -geom argument doesn't support a negative offset. Solution: Compute position from the right/lower corner. Files: src/gui_gtk_x11.c Patch 7.1.142 Problem: ":redir @A>" doesn't work. Solution: Ignore the extra ">" also when appending. (James Vega) Files: src/ex_docmd.c Patch 7.1.143 Problem: Uninitialized memory read when diffing three files. (Dominique Pelle) Solution: Remove "+ !notset" so that we don't use fields that were not computed. Files: src/diff.c Patch 7.1.144 Problem: After ":diffup" cursor can be in the wrong position. Solution: Force recomputing the cursor position. Files: src/diff.c Patch 7.1.145 Problem: Insert mode completion: When using the popup menu, after completing a word and typing a non-word character Vim is still completing the same word, following CTRL-N doesn't work. Insert mode Completion: When using CTRL-X O and there is only "struct." before the cursor, typing one char to reduce the matches, then BS completion stops. Solution: When typing a character that is not part of the item being completed, stop complete mode. For whole line completion also accept a space. For file name completion stop at a path separator. For omni completion stay in completion mode even if completing with empty string. Files: src/edit.c Patch 7.1.146 (extra) Problem: VMS: Files with a very rare record organization (VFC) cannot be properly written by Vim. On older VAX systems mms runs into a syntax error. Solution: Check for this special situation. Do not wrap a comment, make it one long line. (Zoltan Arpadffy) Files: src/fileio.c, src/Make_vms.mms Patch 7.1.147 (after 7.1.127) Problem: Freeing memory already freed when completing user name. (Meino Cramer) Solution: Use a flag to remember if "orig" needs to be freed. Files: src/ex_getln.c Patch 7.1.148 Problem: Some types are not found by configure. Solution: Test for the sys/types.h header file. (Sean Boudreau) Files: src/configure.in, src/auto/configure Patch 7.1.149 Problem: GTK GUI: When the completion popup menu is used scrolling another window by the scrollbar is OK, but using the scroll wheel it behaves line <Enter>. Solution: Ignore K_MOUSEDOWN and K_MOUSEUP. Fix redrawing the popup menu. Files: src/edit.c, src/gui.c Patch 7.1.150 Problem: When 'clipboard' has "unnamed" using "p" in Visual mode doesn't work correctly. (Jianrong Yu) Solution: When 'clipboard' has "unnamed" also obtain the selection when getting the default register. Files: src/ops.c Patch 7.1.151 Problem: Using whole line completion with 'ignorecase' and 'infercase' set and the line is empty get an lalloc(0) error. Solution: Don't try changing case for an empty match. (Matthew Wozniski) Files: src/edit.c Patch 7.1.152 Problem: Display problem when 'hls' and 'cursorcolumn' are set and searching for "$". (John Mullin) Also when scrolling horizontally when 'wrap' is off. Solution: Keep track of the column where highlighting was set. Check the column offset when skipping characters. Files: src/screen.c Patch 7.1.153 Problem: Compiler warnings on SGI. Undefined XpmAllocColor (Charles Campbell) Solution: Add type casts. Init st_dev and st_ino separately. Don't use type casts for vim_snprintf() when HAVE_STDARG_H is defined. Define XpmAllocColor when needed. Files: src/eval.c, src/ex_cmds.c, src/fileio.c, src/misc2.c, src/gui_xmebw.c Patch 7.1.154 Problem: Compiler warning for signed/unsigned compare. Solution: Add type cast. Files: src/screen.c Patch 7.1.155 Problem: Crash when 'undolevels' is 0 and repeating "udd". (James Vega) Solution: When there is only one branch use u_freeheader() to delete it. Files: src/undo.c Patch 7.1.156 Problem: Overlapping arguments for strcpy() when expanding command line variables. Solution: Use mch_memmove() instead of STRCPY(). Also fix a few typos. (Dominique Pelle) Files: src/ex_docmd.c Patch 7.1.157 Problem: In Ex mode, :" gives an error at end-of-file. (Michael Hordijk) Solution: Only give an error for an empty line, not for a comment. Files: src/ex_docmd.c Patch 7.1.158 (extra) Problem: Win32 console: When 'encoding' is "utf-8" and typing Alt-y the result is wrong. Win32 GUI: Alt-y results in "u" when 'encoding' is "cp1250" (Lukas Cerman) Solution: For utf-8 don't set the 7th bit in a byte, convert to the correct byte sequence. For cp1250, when conversion to 'encoding' results in the 7th bit not set, set the 7th bit after conversion. Files: src/os_win32.c, src/gui_w48.c Patch 7.1.159 Problem: strcpy() has overlapping arguments. Solution: Use mch_memmove() instead. (Dominique Pelle) Files: src/ex_cmds.c Patch 7.1.160 Problem: When a focus autocommand is defined, getting or losing focus causes the hit-enter prompt to be redrawn. (Bjorn Winckler) Solution: Overwrite the last line. Files: src/message.c Patch 7.1.161 Problem: Compilation errors with tiny features and EXITFREE. Solution: Add #ifdefs. (Dominique Pelle) Files: src/edit.c, src/misc2.c Patch 7.1.162 Problem: Crash when using a modifier before "while" or "for". (A.Politz) Solution: Skip modifiers when checking for a loop command. Files: src/proto/ex_docmd.pro, src/ex_docmd.c, src/ex_eval.c Patch 7.1.163 Problem: Warning for the unknown option 'bufsecret'. Solution: Remove the lines .vim that use this option. (Andy Wokula) Files: runtime/menu.vim Patch 7.1.164 Problem: Reading past end of regexp pattern. (Dominique Pelle) Solution: Use utf_ptr2len(). Files: src/regexp.c Patch 7.1.165 Problem: Crash related to getting X window ID. (Dominique Pelle) Solution: Don't trust the window ID that we got in the past, check it every time. Files: src/os_unix.c Patch 7.1.166 Problem: Memory leak for using "gp" in Visual mode. Solution: Free memory in put_register(). (Dominique Pelle) Files: src/ops.c Patch 7.1.167 Problem: Xxd crashes when using "xxd -b -c 110". (Debian bug 452789) Solution: Allocate more memory. Fix check for maximum number of columns. Files: src/xxd/xxd.c Patch 7.1.168 (extra) Problem: Win32 GUI: Since patch 7.1.095, when the Vim window does not have focus, clicking in it doesn't position the cursor. (Juergen Kraemer) Solution: Don't reset s_button_pending just after receiving focus. Files: src/gui_w48.c Patch 7.1.169 Problem: Using uninitialized variable when system() fails. (Dominique Pelle) Solution: Let system() return an empty string when it fails. Files: src/eval.c Patch 7.1.170 Problem: Valgrind warning for overlapping arguments for strcpy(). Solution: Use mch_memmove() instead. (Dominique Pelle) Files: src/getchar.c Patch 7.1.171 Problem: Reading one byte before allocated memory. Solution: Check index not to become negative. (Dominique Pelle) Files: src/ex_getln.c Patch 7.1.172 Problem: When 'buftype' is "acwrite" Vim still checks if the file or directory exists before overwriting. Solution: Don't check for overwriting when the buffer name is not a file name. Files: src/ex_cmds.c Patch 7.1.173 Problem: Accessing freed memory. (Dominique Pelle) Solution: Don't call reg_getline() to check if a line is the first in the file. Files: src/regexp.c Patch 7.1.174 Problem: Writing NUL past end of a buffer. Solution: Copy one byte less when using strncat(). (Dominique Pelle) Files: src/ex_cmds.c, src/ex_docmd.c, Patch 7.1.175 Problem: <BS> doesn't work with some combination of 'sts', 'linebreak' and 'backspace'. (Francois Ingelrest) Solution: When adding white space results in not moving back delete one character. Files: src/edit.c Patch 7.1.176 Problem: Building with Aap fails when the "compiledby" argument contains '<' or '>' characters. (Alex Yeh) Solution: Change how quoting is done in the Aap recipe. Files: src/main.aap Patch 7.1.177 Problem: Freeing memory twice when in debug mode while reading a script. Solution: Ignore script input while in debug mode. Files: src/ex_cmds2.c, src/getchar.c, src/globals.h Patch 7.1.178 Problem: "%" doesn't work on "/* comment *//* comment */". Solution: Don't handle the "//" in "*//*" as a C++ comment. (Markus Heidelberg) Files: src/search.c Patch 7.1.179 Problem: Need to check for TCL 8.5. Solution: Adjust configure script. (Alexey Froloff) Files: src/configure.in, src/auto/configure Patch 7.1.180 Problem: Regexp patterns not tested sufficiently. Solution: Add more checks to the regexp test. Files: src/testdir/test64.in, src/testdir/test64.ok Patch 7.1.181 Problem: Accessing uninitialized memory in Farsi mode. (Dominique Pelle) Solution: Only invoke lrF_sub() when there is something to do. Files: src/ex_cmds.c Patch 7.1.182 Problem: When using tab pages and an argument list the session file may contain wrong "next" commands. (Alexander Bluem) Solution: Use "argu" commands and only when needed. Files: src/ex_docmd.c Patch 7.1.183 Problem: "Internal error" for ":echo matchstr('a', 'a\%[\&]')" (Mitanu Paul) Solution: Inside "\%[]" detect \&, \| and \) as an error. Files: src/regexp.c Patch 7.1.184 Problem: Crash when deleting backwards over a line break in Insert mode. Solution: Don't advance the cursor when it's already on the NUL after a line. (Matthew Wozniski) Files: src/normal.c Patch 7.1.185 Problem: Using "gR" with a multi-byte encoding and typing a CR pushes characters onto the replace stack incorrectly, resulting in BS putting back the wrong characters. (Paul B. Mahol) Solution: Push multi-byte characters onto the replace stack in reverse byte order. Add replace_push_mb(). Files: src/edit.c, src/misc1.c, src/proto/edit.pro Patch 7.1.186 Problem: "expand('<afile>')" returns a bogus value after changing directory. (Dave Fishburn) Solution: Copy "autocmd_fname" to allocated memory and expand to full filename. Shorten the path when expanding <afile>. Files: src/ex_docmd.c, src/fileio.c Patch 7.1.187 Problem: Win32 GUI: Custom completion using system() no longer works after patch 7.1.104. (Erik Falor) Solution: Loop when safe_vgetc() returns K_IGNORE. Files: src/ex_getln.c Patch 7.1.188 Problem: When 'showmode' is off the message for changing a readonly file is given in the second column instead of the first. (Payl B. Mahol) Solution: Put the W10 message in the first column. Files: src/edit.c Patch 7.1.189 (after 7.1.104) Problem: Patch 7.1.104 was incomplete. Solution: Also call plain_vgetc() in ask_yesno(). Files: src/misc1.c Patch 7.1.190 Problem: Cursor after end-of-line: "iA sentence.<Esc>)" Solution: Move cursor back and make motion inclusive. Files: src/normal.c Patch 7.1.191 Problem: Win32 GUI: after patch 7.1.168 there is still a problem when clicking in a scrollbar. (Juergen Jottkaerr) Solution: Don't check the input buffer when dragging the scrollbar. Files: src/gui.c Patch 7.1.192 Problem: With Visual block selection, "s" and typing something, CTRL-C doesn't stop Vim from repeating the replacement in other lines, like happens for "I". Solution: Check for "got_int" to be set. Files: src/ops.c Patch 7.1.193 Problem: Some Vim 5.x digraphs are missing in Vim 7, even though the character pairs are not used. (Philippe de Muyter) Solution: Add those Vim 5.x digraphs that don't conflict with others. Files: src/digraph.c Patch 7.1.194 Problem: ":echo glob('~/{}')" results in /home/user//. Solution: Don't add a slash if there already is one. Files: src/os_unix.c Patch 7.1.195 Problem: '0 mark doesn't work for "~/foo ~ foo". Solution: Don't expand the whole file name, only "~/". Files: src/mark.c Patch 7.1.196 (extra) Problem: Win32 GUI: "\n" in a tooltip doesn't cause a line break. (Erik Falor) Solution: Use the TTM_SETMAXTIPWIDTH message. Files: src/gui_w32.c Patch 7.1.197 Problem: Mac: "make install" doesn't work when prefix defined. Solution: Pass different arguments to "make installruntime". (Jjgod Jiang) Files: src/Makefile Patch 7.1.198 Problem: Hang when using ":s/\n//gn". (Burak Gorkemli) Solution: Set "skip_match". Files: src/ex_cmds.c Patch 7.1.199 Problem: Can't do command line completion for a specific file name extension. Solution: When the pattern ends in "$" don't add a star for completion and remove the "$" before matching with file names. Files: runtime/doc/cmdline.txt, src/ex_getln.c Patch 7.1.200 (after 7.1.177 and 7.1.182) Problem: Compiler warnings for uninitialized variables. Solution: Init variables. Files: src/ex_cmds2.c, src/ex_docmd.c Patch 7.1.201 Problem: When reading stdin 'fenc' and 'ff' are not set. Solution: Set the options after reading stdin. (Ben Schmidt) Files: src/fileio.c Patch 7.1.202 Problem: Incomplete utf-8 byte sequence is not checked for validity. Solution: Check the bytes that are present for being valid. (Ben Schmidt) Files: src/mbyte.c Patch 7.1.203 Problem: When 'virtualedit' is "onemore" then "99|" works but ":normal 99|" doesn't. (Andy Wokula) Solution: Check for "onemore" flag in check_cursor_col(). Files: src/misc2.c Patch 7.1.204 (extra) Problem: Win32: Using the example at 'balloonexpr' the balloon disappears after four seconds and then comes back again. Also moves the mouse pointer a little bit. (Yongwei Wu) Solution: Set the autopop time to 30 seconds (the max value). (Sergey Khorev) Move the mouse two pixels forward and one back to end up in the same position (really!). Files: src/gui_w32.c Patch 7.1.205 Problem: Can't get the operator in an ":omap". Solution: Add the "v:operator" variable. (Ben Schmidt) Files: runtime/doc/eval.txt, src/eval.c, src/normal.c, src/vim.h Patch 7.1.206 Problem: Compiler warnings when using MODIFIED_BY. Solution: Add type casts. (Ben Schmidt) Files: src/version.c Patch 7.1.207 Problem: Netbeans: "remove" cannot delete one line. Solution: Remove partial lines and whole lines properly. Avoid a memory leak. (Xavier de Gaye) Files: src/netbeans.c Patch 7.1.208 Problem: On Alpha get an unaligned access error. Solution: Store the dictitem pointer before using it. (Matthew Luckie) Files: src/eval.c Patch 7.1.209 Problem: GTK: When using the netrw plugin and doing ":gui" Vim hangs. Solution: Stop getting a selection after three seconds. This is a hack. Files: src/gui_gtk_x11.c Patch 7.1.210 Problem: Listing mapping for 0xdb fails when 'encoding' is utf-8. (Tony Mechelynck) Solution: Recognize K_SPECIAL KS_EXTRA KE_CSI as a CSI byte. Files: src/mbyte.c Patch 7.1.211 Problem: The matchparen plugin may take an unexpected amount of time, so that it looks like Vim hangs. Solution: Add a timeout to searchpair(), searchpairpos(), search() and searchpos(). Use half a second timeout in the plugin. Files: runtime/doc/eval.txt, runtime/plugin/matchparen.vim, src/edit.c, src/eval.c, src/ex_cmds2.c, src/ex_docmd.c, src/normal.c, src/proto/eval.pro, src/proto/ex_cmds2.pro, src/proto/search.pro, src/search.c Patch 7.1.212 Problem: Accessing a byte before a line. Solution: Check that the column is 1 or more. (Dominique Pelle) Files: src/edit.c Patch 7.1.213 Problem: A ":tabedit" command that results in the "swap file exists" dialog and selecting "abort" doesn't close the new tab. (Al Budden) Solution: Pass "old_curwin" to do_exedit(). Files: src/ex_docmd.c Patch 7.1.214 Problem: ":1s/g\n\zs1//" deletes characters from the first line. (A Politz) Solution: Start replacing in the line where the match starts. Files: src/ex_cmds.c Patch 7.1.215 Problem: It is difficult to figure out what syntax items are nested at a certain position. Solution: Add the synstack() function. Files: runtime/doc/eval.txt, src/eval.c, src/proto/syntax.pro, src/syntax.c Patch 7.1.216 Problem: Variants of --remote-tab are not mentioned for "vim --help". Solution: Display optional -wait and -silent. Files: src/main.c Patch 7.1.217 Problem: The "help-tags" tag may be missing from runtime/doc/tags when it was generated during "make install". Solution: Add the "++t" argument to ":helptags" to force adding the tag. Files: runtime/doc/Makefile, runtime/doc/various.txt, src/ex_cmds.c, src/ex_cmds.h Patch 7.1.218 Problem: A syntax region without a "keepend", containing a region with "extend" could be truncated at the end of the containing region. Solution: Do not call syn_update_ends() when there are no keepend items. Files: src/syntax.c Patch 7.1.219 (after 7.1.215) Problem: synstack() returns situation after the current character, can't see the state for a one-character region. Solution: Don't update ending states in the requested column. Files: runtime/doc/eval.txt, src/eval.c, src/hardcopy.c, src/proto/syntax.pro, src/screen.c, src/spell.c, src/syntax.c Patch 7.1.220 Problem: When a ")" or word movement command moves the cursor back from the end of the line it may end up on the trail byte of a multi-byte character. It's also moved back when it isn't needed. Solution: Add the adjust_cursor() function. Files: src/normal.c Patch 7.1.221 Problem: When inserting a "(", triggering the matchparen plugin, the following highlighting may be messed up. Solution: Before triggering the CursorMovedI autocommands update the display to update the stored syntax stacks for the change. Files: src/edit.c Patch 7.1.222 (after 7.1.217) Problem: Wildcards in argument of ":helptags" are not expanded. (Marcel Svitalsky) Solution: Expand wildcards in the directory name. Files: src/ex_cmds.c Patch 7.1.223 Problem: glob() doesn't work properly when 'shell' is "sh" or "bash" and the expanded name contains spaces, '~', single quotes and other special characters. (Adri Verhoef, Charles Campbell) Solution: For Posix shells define a vimglob() function to list the matches instead of using "echo" directly. Files: src/os_unix.c Patch 7.1.224 Problem: When using "vim -F -o file1 file2" only one window is right-to-left. Same for "-H". (Ben Schmidt) Solution: use set_option_value() to set 'rightleft'. Files: src/main.c Patch 7.1.225 Problem: Using uninitialized value when XGetWMNormalHints() fails. Solution: Check the return value. (Dominique Pelle) Files: src/os_unix.c Patch 7.1.226 Problem: Command line completion doesn't work when a file name contains a '&' character. Solution: Accept all characters in a file name, except ones that end a command or white space. Files: src/ex_docmd.c Patch 7.1.227 Problem: Hang in syntax HL when moving over a ")". (Dominique Pelle) Solution: Avoid storing a syntax state in the wrong position in the list of remembered states. Files: src/syntax.c Patch 7.1.228 Problem: When 'foldmethod' is "indent" and a fold is created with ">>" it can't be closed with "zc". (Daniel Shahaf) Solution: Reset the "small" flag of a fold when adding a line to it. Files: src/fold.c Patch 7.1.229 Problem: A fold is closed when it shouldn't when 'foldmethod' is "indent" and backspacing a non-white character so that the indent increases. Solution: Keep the fold open after backspacing a character. Files: src/edit.c Patch 7.1.230 Problem: Memory leak when executing SourceCmd autocommands. Solution: Free the memory. (Dominique Pelle) Files: src/ex_cmds2.c Patch 7.1.231 Problem: When shifting lines the change is acted upon multiple times. Solution: Don't have shift_line() call changed_bytes. Files: src/edit.c, src/ops.c, src/proto/edit.pro, src/proto/ops.pro Patch 7.1.232 (after 7.1.207 and 7.1.211) Problem: Compiler warnings with MSVC. Solution: Add type casts. (Mike Williams) Files: src/ex_cmds2.c, src/netbeans.c Patch 7.1.233 Problem: Crash when doing Insert mode completion for a user defined command. (Yegappan Lakshmanan) Solution: Don't use the non-existing command line. Files: src/ex_getln.c Patch 7.1.234 Problem: When diff'ing three files the third one isn't displayed correctly. (Gary Johnson) Solution: Compute the size of diff blocks correctly when merging blocks. Compute filler lines correctly when scrolling. Files: src/diff.c Patch 7.1.235 Problem: Pattern matching is slow when using a lot of simple patterns. Solution: Avoid allocating memory by not freeing it when it's not so much. (Alexei Alexandrov) Files: src/regexp.c Patch 7.1.236 Problem: When using 'incsearch' and 'hlsearch' a complicated pattern may make Vim hang until CTRL-C is pressed. Solution: Add the 'redrawtime' option. Files: runtime/doc/options.txt, src/ex_cmds.c, src/ex_docmd.c, src/ex_getln.c, src/gui.c, src/misc1.c, src/normal.c, src/option.c, src/quickfix.c, src/regexp.c, src/proto/regexp.pro, src/proto/search.pro, src/search.c, src/screen.c, src/option.h, src/spell.c, src/structs.h, src/syntax.c, src/tag.c, src/vim.h Patch 7.1.237 Problem: Compiler warning on an Alpha processor in Motif code. Solution: Change a typecast. (Adri Verhoef) Files: src/gui_motif.c Patch 7.1.238 Problem: Using the 'c' flag with searchpair() may cause it to fail. Using the 'r' flag doesn't work when 'wrapscan' is set. (A.Politz) Solution: Only use the 'c' flag for the first search, not for repeating. When using 'r' imply 'W'. (Antony Scriven) Files: src/eval.c Patch 7.1.239 (after 7.1.233) Problem: Compiler warning for sprintf() argument. Solution: Add a typecast. (Nico Weber) Files: src/ex_getln.c Patch 7.1.240 Problem: When "gUe" turns a German sharp s into SS the operation stops before the end of the word. Latin2 has the same sharp s but it's not changed to SS there. Solution: Make sure all the characters are operated upon. Detect the sharp s in latin2. Also fixes that changing case of a multi-byte character that changes the byte count doesn't always work. Files: src/ops.c Patch 7.1.241 Problem: Focus change events not always ignored. (Erik Falor) Solution: Ignore K_IGNORE in Insert mode in a few more places. Files: src/edit.c Patch 7.1.242 (after 7.1.005) Problem: "cib" doesn't work properly on "(x)". (Tim Pope) Solution: Use ltoreq() instead of lt(). Also fix "ciT" on "<a>x</a>". Files: src/search.c Patch 7.1.243 (after 7.1.240) Problem: "U" doesn't work on all text in Visual mode. (Adri Verhoef) Solution: Loop over all the lines to be changed. Add tests for this. Files: src/ops.c, src/testdir/test39.in, src/testdir/test39.ok Patch 7.1.244 Problem: GUI may have part of the command line cut off. Solution: Don't round the number of lines up, always round down. (Tony Houghton, Scott Dillard) Files: src/gui.c Patch 7.1.245 Problem: Pressing CTRL-\ three times causes Vim to quit. (Ranganath Rao). Also for f CTRL-\ CTRL-\. Solution: When going to cooked mode in mch_delay() set a flag to ignore SIGQUIT. Files: src/os_unix.c Patch 7.1.246 Problem: Configure hangs when the man pager is something strange. (lorien) Solution: Set MANPAGER and PAGER to "cat". (Micah Cowan) Files: src/auto/configure, src/configure.in Patch 7.1.247 Problem: When using Netbeans backspacing in Insert mode skips a character now and then. (Ankit Jain) Solution: Avoid calling netbeans_removed(), it frees the line pointer. (partly by Dominique Pelle). Files: src/misc1.c Patch 7.1.248 Problem: Can't set the '" mark. Can't know if setpos() was successful. Solution: Allow setting the '" mark with setpos(). Have setpos() return a value indicating success/failure. Files: runtime/doc/eval.txt, src/eval.c, src/mark.c Patch 7.1.249 Problem: After "U" the cursor can be past end of line. (Adri Verhoef) Solution: Adjust the cursor position in u_undoline(). Files: src/undo.c Patch 7.1.250 Problem: ":setglobal fenc=anything" gives an error message in a buffer where 'modifiable' is off. (Ben Schmidt) Solution: Don't give an error if 'modifiable' doesn't matter. Files: src/option.c Patch 7.1.251 Problem: Using freed memory when spell checking enabled. Solution: Obtain the current line again after calling spell_move_to(). (Dominique Pelle) Files: src/screen.c Patch 7.1.252 (after 7.1.243) Problem: Test 39 fails when the environment has a utf-8 locale. (Dominique Pelle) Solution: Force 'encoding' to be latin1. Files: src/testdir/test39.in Patch 7.1.253 Problem: ":sort" doesn't work in a one line file. (Patrick Texier) Solution: Don't sort if there is only one line. (Dominique Pelle) Files: src/ex_cmds.c Patch 7.1.254 Problem: Tests 49 and 55 fail when the locale is French. Solution: Using C messages for test 49. Filter the error message in test 55 such that it works when the number is halfway the message. Files: src/testdir/test49.in, src/testdir/test55.in Patch 7.1.255 Problem: Vim doesn't support utf-32. (Yongwei Wu) Solution: Add aliases for utf-32, it's the same as ucs-4. Files: src/mbyte.c Patch 7.1.256 Problem: findfile() also returns directories. Solution: Cleanup the code for finding files and directories in a list of directories. Remove the ugly global ff_search_ctx. Files: src/eval.c, src/misc2.c, src/vim.h, src/tag.c Patch 7.1.257 Problem: Configure can't always find the Tcl header files. Solution: Also look in /usr/local/include/tcl$tclver and /usr/include/tcl$tclver (James Vega) Files: src/auto/configure, src/configure.in Patch 7.1.258 Problem: Crash when doing "d/\n/e" and 'virtualedit' is "all". (Andy Wokula) Solution: Avoid that the column becomes negative. Also fixes other problems with the end of a pattern match is in column zero. (A.Politz) Files: src/search.c Patch 7.1.259 Problem: Cursor is in the wrong position when 'rightleft' is set, 'encoding' is "utf-8" and on an illegal byte. (Dominique Pelle) Solution: Only put the cursor in the first column when actually on a double-wide character. (Yukihiro Nakadaira) Files: src/screen.c Patch 7.1.260 Problem: Cursor positioning problem after ^@ wrapping halfway when 'encoding' is utf-8. Solution: Only count a position for printable characters. (partly by Yukihiro Nakadaira) Files: src/charset.c Patch 7.1.261 Problem: When a 2 byte BOM is detected Vim uses UCS-2, which doesn't work for UTF-16 text. (Tony Mechelynck) Solution: Default to UTF-16. Files: src/fileio.c, src/testdir/test42.ok Patch 7.1.262 Problem: Can't get the process ID of Vim. Solution: Implement getpid(). Files: src/eval.c, runtime/doc/eval.txt Patch 7.1.263 Problem: The filetype can consist of two dot separated names. This works for syntax and ftplugin, but not for indent. (Brett Stahlman) Solution: Use split() and loop over each dot separated name. Files: runtime/indent.vim Patch 7.1.264 Problem: Crash when indenting lines. (Dominique Pelle) Solution: Set the cursor column when changing the cursor line. Files: src/ops.c, src/misc1.c Patch 7.1.265 Problem: When 'isfname' contains a space, cmdline completion can hang. (James Vega) Solution: Reset the "len" variable. Files: src/ex_docmd.c Patch 7.1.266 Problem: When the version string returned by the terminal contains unexpected characters, it is used as typed input. (James Vega) Solution: Assume the escape sequence ends in a letter. Files: src/term.c Patch 7.1.267 Problem: When changing folds cursor may be positioned in the wrong place. Solution: Call changed_window_setting_win() instead of changed_window_setting(). Files: src/fold.c Patch 7.1.268 Problem: Always shows "+" at end of screen line with: ":set listchars=eol:$,extends:+ nowrap list cursorline" (Gary Johnson) Solution: Check for lcs_eol_one instead of lcs_eol. Files: src/screen.c Patch 7.1.269 Problem: The matchparen plugin has an arbitrary limit for the number of lines to look for a match. Solution: Rely on the searchpair() timeout. Files: runtime/plugin/matchparen.vim Patch 7.1.270 Problem: ":?foo?" matches in current line since patch 7.1.025. (A.Politz) Solution: Remove the SEARCH_START flag. Files: src/ex_docmd.c, src/search.c Patch 7.1.271 Problem: In a Vim build without autocommands, checking a file that was changed externally causes the current buffer to be changed unexpectedly. (Karsten Hopp) Solution: Store "curbuf" instead of "buf". Files: src/fileio.c Patch 7.1.272 Problem: The special buffer name [Location List] is not used for a buffer displayed in another tab page. Solution: Use FOR_ALL_TAB_WINDOWS instead of FOR_ALL_WINDOWS. (Hiroaki Nishihara) Files: src/buffer.c Patch 7.1.273 Problem: When profiling on Linux Vim exits early. (Liu Yubao) Solution: When profiling don't exit on SIGPROF. Files: src/Makefile, src/os_unix.c Patch 7.1.274 (after 7.1.272) Problem: Compiler warning for optimized build. Solution: Init win to NULL. Files: src/buffer.c Patch 7.1.275 (extra) Problem: Mac: ATSUI and 'antialias' don't work properly together. Solution: Fix this and the input method. (Jjgod Jiang) Files: src/vim.h, src/gui_mac.c Patch 7.1.276 Problem: "gw" uses 'formatexpr', even though the docs say it doesn't. Solution: Don't use 'formatexpr' for "gw". Files: src/vim.h, src/edit.c, src/ops.c, src/proto/ops.pro Patch 7.1.277 Problem: Default for 'paragraphs' misses some items (Colin Watson) Solution: Add TP, HP, Pp, Lp and It to 'paragraphs'. (James Vega) Files: runtime/doc/options.txt, src/option.c Patch 7.1.278 (extra, after 7.1.275) Problem: Build failure when USE_CARBONKEYHANDLER is not defined. Solution: Remove #ifdef. Files: src/gui_mac.c Patch 7.1.279 Problem: When using cscope temporary files are left behind. Solution: Send the quit command to cscope and give it two seconds to exit nicely before killing it. (partly by Dominique Pelle) Files: src/if_cscope.c Patch 7.1.280 (after 7.1.275) Problem: Mac: build problems when not using multibyte feature. (Nicholas Stallard) Solution: Don't define USE_IM_CONTROL when not using multibyte. Files: src/vim.h Patch 7.1.281 (after 7.1.279) Problem: sa.sa_mask is not initialized. Cscope may not exit. Solution: Use sigemptyset(). Use SIGKILL instead of SIGTERM. (Dominique Pelle) Files: src/if_cscope.c Patch 7.1.282 (extra) Problem: Win64: Edit with Vim context menu isn't installed correctly. Compiler warnings and a few other things. Solution: Add [ and ] to entry of class name. Use UINT_PTR instead of UINT. And fixes for other things. (George V. Reilly) Files: src/GvimExt/Makefile, src/dosinst.c, src/if_ole.cpp, src/if_ole.h, src/if_ole.idl, src/INSTALLpc.txt, src/Make_mvc.mak, src/os_win32.c, Patch 7.1.283 Problem: Non-extra part for 7.1.282. Solution: Various changes. Files: src/ex_docmd.c, src/globals.h, src/if_cscope.c, src/main.c, src/mark.c, src/netbeans.c, src/popupmnu.c, src/vim.h, src/window.c Patch 7.1.284 Problem: Compiler warnings for functions without prototype. Solution: Add the function prototypes. (Patrick Texier) Files: src/eval.c, src/quickfix.c Patch 7.1.285 (extra) Problem: Mac: dialog hotkeys don't work. Solution: Add hotkey support. (Dan Sandler) Files: src/gui_mac.c Patch 7.1.286 (after 7.1.103) Problem: "w" at the end of the buffer moves the cursor past the end of the line. (Markus Heidelberg) Solution: Move the cursor back from the NUL when it was moved forward. Files: src/normal.c Patch 7.1.287 Problem: Crash when reversing a list after using it. (Andy Wokula) Solution: Update the pointer to the last used element. (Dominique Pelle) Files: src/eval.c Patch 7.1.288 (after 7.1.281) Problem: Cscope still leaves behind temp files when using gvim. Solution: When getting the ECHILD error loop for a while until cscope exits. (Dominique Pelle) Files: if_cscope.c Patch 7.1.289 Problem: When EXITFREE is defined and 'acd' is set freed memory is used. (Dominique Pelle) Solution: Reset p_acd before freeing all buffers. Files: src/misc2.c Patch 7.1.290 Problem: Reading bytes that were not written when spell checking and a line has a very large indent. Solution: Don't copy the start of the next line when it only contains spaces. (Dominique Pelle) Files: src/spell.c Patch 7.1.291 (after 7.1.288) Problem: Compiler warning. Solution: Change 50 to 50L. Files: src/if_cscope.c Patch 7.1.292 Problem: When using a pattern with "\@<=" the submatches can be wrong. (Brett Stahlman) Solution: Save the submatches when attempting a look-behind match. Files: src/regexp.c Patch 7.1.293 Problem: Spell checking considers super- and subscript characters as word characters. Solution: Recognize the Unicode super and subscript characters. Files: src/spell.c Patch 7.1.294 Problem: Leaking memory when executing a shell command. Solution: Free memory when not able to save for undo. (Dominique Pelle) Files: src/ex_cmds.c Patch 7.1.295 Problem: Vimtutor only works with vim, not gvim. Solution: Add the -g flag to vimtutor. (Dominique Pelle) Add gvimtutor. Files: src/Makefile, src/gvimtutor, src/vimtutor, runtime/doc/vimtutor.1 Patch 7.1.296 Problem: SELinux is not supported. Solution: Detect the selinux library and use mch_copy_sec(). (James Vega) Files: src/auto/configure, src/config.h.in, src/configure.in, src/fileio.c, src/memfile.c, src/os_unix.c, src/proto/os_unix.pro Patch 7.1.297 Problem: When using the search/replace dialog the parenmatch highlighting can be wrong. (Tim Duncan) Solution: In the GUI redraw function invoke the CursorMoved autocmd. Files: src/gui.c Patch 7.1.298 (after 7.1.295) Problem: src/gvimtutor is not distributed. Solution: Add it to the list of distributed files. Files: Filelist Patch 7.1.299 Problem: Filetype detection doesn't work properly for file names ending in a part that is ignored and contain a space or other special characters. Solution: Escape the special characters using the new fnameescape function. Files: runtime/doc/eval.txt, runtime/filetype.vim, src/eval.c, src/ex_getln.c, src/proto/ex_getln.pro, src/vim.h Patch 7.1.300 Problem: Value of asmsyntax argument isn't checked for valid characters. Solution: Only accepts letters and digits. Files: runtime/filetype.vim Patch 7.1.301 Problem: When the "File/Save" menu is used in Insert mode, a tab page label is not updated to remove the "+". Solution: Call draw_tabline() from showruler(). (Bjorn Winckler) Files: src/screen.c Patch 7.1.302 (after 7.1.299) Problem: Compilation error on MS-Windows. Solution: Don't use xp_shell when it's not defined. Files: src/ex_getln.c Patch 7.1.303 (after 7.1.302) Problem: Compilation error on MS-Windows, again. Solution: Declare p. Files: src/ex_getln.c Patch 7.1.304 Problem: Shortpath_for_invalid_fname() does not work correctly and is unnecessary complex. Solution: Clean up shortpath_for_invalid_fname(). (mostly by Yegappan Lakshmanan) Files: src/eval.c Patch 7.1.305 Problem: Editing a compressed file with special characters in the name doesn't work properly. Solution: Escape special characters. Files: runtime/autoload/gzip.vim Patch 7.1.306 Problem: Some Unicode characters are handled like word characters while they are symbols. Solution: Adjust the table for Unicode classification. Files: src/mbyte.c Patch 7.1.307 Problem: Many warnings when compiling with Python 2.5. Solution: Use ssize_t instead of int for some types. (James Vega) Files: src/if_python.c Patch 7.1.308 Problem: When in readonly mode ":options" produces an error. Solution: Reset 'readonly'. (Gary Johnson) Files: runtime/optwin.vim Patch 7.1.309 Problem: Installing and testing with a shadow directory doesn't work. (James Vega) Solution: Add "po" to the list of directories to link. Also link the Vim scripts in testdir. And a few more small fixes. Files: src/Makefile Patch 7.1.310 Problem: Incomplete utf-8 byte sequence at end of the file is not detected. Accessing memory that wasn't written. Solution: Check the last bytes in the buffer for being a valid utf-8 character. (mostly by Ben Schmidt) Also fix that the reported line number of the error was wrong. Files: src/fileio.c Patch 7.1.311 Problem: Compiler warning for missing sentinel in X code. Solution: Change 0 to NULL. (Markus Heidelberg) Files: src/mbyte.c Patch 7.1.312 Problem: The .po files have mistakes in error numbers. Solution: Search for these mistakes in the check script. (Dominique Pelle) Files: src/po/check.vim Patch 7.1.313 Problem: When the netbeans interface setModified call is used the status lines and window title are not updated. Solution: Redraw the status lines and title. (Philippe Fremy) Files: src/netbeans.c Patch 7.1.314 Problem: The value of 'pastetoggle' is written to the session file without any escaping. (Randall Hansen) Solution: Use put_escstr(). (Ben Schmidt) Files: src/option.c Patch 7.1.315 Problem: Crash with specific search pattern using look-behind match. (Andreas Politz) Solution: Also save the value of "need_clear_subexpr". Files: src/regexp.c Patch 7.1.316 Problem: When 'cscopetag' is set ":tag" gives an error message instead of going to the next tag in the tag stack. Solution: Don't call do_cstag() when there is no argument. (Mark Goldman) Files: src/ex_docmd.c Patch 7.1.317 Problem: Compiler warnings in Motif calls. Solution: Change zero to NULL. (Dominique Pelle) Files: src/gui_motif.c Patch 7.1.318 Problem: Memory leak when closing xsmp connection. Crash on exit when using Lesstif. Solution: Don't close the X display to work around a Lesstif bug. Free clientid. Also fix a leak for Motif and Athena. (Dominique Pelle) Files: src/gui_x11.c, src/os_unix.c Patch 7.1.319 Problem: When a register has an illegal utf-8 sequence, pasting it on the command line causes an illegal memory access. Solution: Use mb_cptr2char_adv(). (Dominique Pelle) Files: src/ex_getln.c Patch 7.1.320 (extra) Problem: Win64: Warnings while compiling Python interface. Solution: Use PyInt in more places. Also update version message for the console. (George Reilly) Files: src/if_python.c, src/version.c Patch 7.1.321 (extra) Problem: Win32 / Win64: Install file is outdated. Solution: Update the text for recent compiler. (George Reilly) Files: src/INSTALLpc.txt Patch 7.1.322 Problem: Can't get start of Visual area in an <expr> mapping. Solution: Add the 'v' argument to getpos(). Files: runtime/doc/eval.txt, src/eval.c Patch 7.1.323 Problem: Test 19 fails with some termcaps. (Dominique Pelle) Solution: Set the t_kb and t_kD termcap values. Files: src/testdir/test19.in, src/testdir/test38.in Patch 7.1.324 Problem: File name path length on Unix is limited to 1024. Solution: Use PATH_MAX when it's more than 1000. Files: src/os_unix.h Patch 7.1.325 Problem: When editing a command line that's longer than available space in the window, the characters at the end are in reverse order. Solution: Increment the insert position even when the command line doesn't fit. (Ingo Karkat) Files: src/ex_getln.c Patch 7.1.326 Problem: ":s!from!to!" works, but ":smagic!from!to!" doesn't. It sees the "!" as a flag to the command. Same for ":snomagic". (Johan Spetz) Solution: When checking for a forced command also ignore ":smagic" and ":snomagic". (Ian Kelling) Files: src/ex_docmd.c Patch 7.1.327 Problem: The GUI tutor is installed when there is no GUI version. Solution: Only install gvimtutor when building a GUI version. Files: src/Makefile Patch 7.1.328 Problem: Crash when using Cygwin and non-posix path name in tags file. Solution: Use separate buffer for posix path. (Ben Schmidt) Files: src/os_unix.c Patch 7.1.329 Problem: When the popup menu is removed a column of cells, the right halve of double-wide characters, may not be redrawn. Solution: Check if the right halve of a character needs to be redrawn. (Yukihiro Nakadaira) Files: src/screen.c Patch 7.1.330 Problem: Reading uninitialized memory when using Del in replace mode. Solution: Use utfc_ptr2len_len() instead of mb_ptr2len(). (Dominique Pelle) Files: src/misc1.c Warning for missing sentinel in gui_xmldlg.c. (Dominique Pelle) A search offset from the end of a match didn't work properly for multi-byte characters. (Yukihiro Nakadaira) When displaying the value of 'key' don't show "*****" when the value is empty. (Ben Schmidt) Internal error when compiled with EXITFREE and using the nerd_tree plugin. Set last_msg_hist to NULL when history becomes empty. Call free_all_functions() after garbage collection. (Dominique Pelle) GTK with XIM: <S-Space> does not work. (Yukihiro Nakadaira) Some shells do not support "echo -n", which breaks glob(). Use "echo" instead of "echo -n $1; echo". (Gary Johnson) "echo 22,44" printed "22" on top of the command, the error messages caused the rest not to be cleared. Added the need_clr_eos flag. Netbeans events are handled while updating the screen, causing a crash. Change the moment when events are handled. Rename nb_parse_messages() to netbeans_parse_messages(). (Xavier de Gaye) Test 11 was broken after patch 7.1.186 on Win32 console. (Daniel Shahaf) Use shellescape() on the file name. IM was turned off in im_preedit_end_cb() for no good reason. (Takuhiro Nishioka) A corrupted spell file could cause Vim to use lots of memory. Better detection for running into the end of the file. (idea from James Vega) Mac: Included a patch to make it build with GTK. Moved language init to mac_lang_init() function. (Ben Schmidt) Problem with 'wildmenu' after ":lcd", up/down arrows don't work. (Erik Falor) Fix configure.in to avoid "implicitly declared" warnings when running configure. Fixed a memory leak when redefining a keymap. (Dominique Pelle) Setting 'pastetoggle' to "jj" didn't work. 'ic' and 'smartcase' don't work properly when using \%V in a search pattern. (Kana Natsuno) Patch 7.2a.001 Problem: On some systems X11/Xlib.h exists (from X11-dev package) but X11/Intrinsic.h does not (in Xt-dev package). This breaks the build. Also, on Solaris 9 sys/ptem.h isn't found. Solution: Have configure only accept X11 when X11/Intrinsic.h exists. Check for sys/ptem.h while including sys/stream.h. (Vladimir Marek) Files: src/auto/configure, src/configure.in Patch 7.2a.002 Problem: getbufvar(N, "") gets the dictionary of the current buffer instead of buffer N. Solution: Set curbuf before calling find_var_in_ht(). (Kana Natsuno) Files: src/eval.c Patch 7.2a.003 Problem: Leaking memory when using ":file name" and using access control lists. Solution: Invoke mch_free_acl() in vim_rename(). (Dominique Pelle) Files: src/fileio.c Patch 7.2a.004 Problem: Some systems can't get spell files by ftp. Solution: Use http when it looks like it's possible. (James Vega) Files: runtime/autoload/spellfile.vim Patch 7.2a.005 Problem: A few error messages use confusing names. Misspelling. Solution: Change "dissallows" to "disallows". (Dominique Pelle) Change "number" to "Number". Files: src/eval.c, src/fileio.c Patch 7.2a.006 Problem: Reading past NUL in a string. Solution: Check for invalid utf-8 byte sequence. (Dominique Pelle) Files: src/charset.c Patch 7.2a.007 Problem: ":let v = 1.2.3" was OK in Vim 7.1, now it gives an error. Solution: Don't look for a floating point number after the "." operator. Files: src/eval.c Patch 7.2a.008 Problem: printf("%g", 1) doesn't work. Solution: Convert Number to Float when needed. Files: src/message.c Patch 7.2a.009 Problem: cygwin_conv_to_posix_path() does not specify buffer size. Solution: Use new Cygwin function: cygwin_conv_path(). (Corinna Vinschen) Files: src/main.c, src/os_unix.c Patch 7.2a.010 Problem: When a file name has an illegal byte sequence Vim may read uninitialised memory. Solution: Don't use UTF_COMPOSINGLIKE() on an illegal byte. In msg_outtrans_len_attr() use char2cells() instead of ptr2cells(). In utf_ptr2char() don't check second byte when first byte is illegal. (Dominique Pelle) Files: src/mbyte.c, src/message.c Patch 7.2a.011 Problem: The Edit/Startup Settings menu doesn't work. Solution: Expand environment variables. (Ben Schmidt) Files: runtime/menu.vim Patch 7.2a.012 Problem: Compiler warnings for casting int to pointer. Solution: Add cast to long in between. (Martin Toft) Files: src/gui_gtk_x11.c Patch 7.2a.013 Problem: shellescape() does not escape "%" and "#" characters. Solution: Add find_cmdline_var() and use it when the second argument to shellescape() is non-zero. Files: runtime/doc/eval.txt, src/eval.c, src/ex_docmd.c, src/proto/ex_docmd.pro, src/proto/misc2.pro, src/misc2.c Patch 7.2a.014 Problem: Problem with % in message. Solution: Put % in single quotes. Files: src/eval.c Patch 7.2a.015 (after 7.2a.010) Problem: Misaligned messages. Solution: Compute length of unprintable chars correctly. Files: src/message.c Patch 7.2a.016 Problem: Using CTRL-W v in the quickfix window results in two quickfix windows, which is not allowed. ":tab split" should be allowed to open a new quickfix window in another tab. Solution: For CTRL-W v instead of splitting the window open a new one. When using ":tab" do allow splitting the quickfix window (was already included in patch 7.2a.013). Files: src/window.c Patch 7.2a.017 Problem: ":doautoall" executes autocommands for all buffers instead of just for loaded buffers. Solution: Change "curbuf" to "buf". Files: src/fileio.c Patch 7.2a.018 Problem: Compiler warnings when compiling with Gnome. (Tony Mechelynck) Solution: Add type casts. Files: src/gui_gtk_x11.c Patch 7.2a.019 Problem: ":let &g:tw = 44" sets the local option value. (Cyril Slobin) Solution: Use get_varp_scope() instead of get_varp(). (Ian Kelling) Files: src/option.c There is no way to avoid adding /usr/local/{include|lib} to the build commands. Add the --with-local-dir argument to configure. (Michael Haubenwallner) When using CTRL-D after ":help", the number of matches could be thousands. Restrict to TAG_MANY to avoid this taking too long. (Ian Kelling) The popup menu could be placed at a weird location. Caused by w_wcol computed by curs_columns(). (Dominique Pelle) Overlapping STRCPY() arguments when using %r item in 'errorformat'. Use STRMOVE() instead. (Ralf Wildenhues) Mac: On Leopard gvim, when using the mouse wheel nothing would happen until another event occurs, such as moving the mouse. Then the recorded scrolling would take place all at once. (Eckehard Berns) Solution for cursor color not reflecting IM status for GTK 2. Add preedit_is_active flag. (SungHyun Nam) filereadable() can hang on a FIFO on Linux. Use open() instead of fopen(), with O_NONBLOCK. (suggested by Lars Kotthoff) Included patch to support Perl 5.10. (Yasuhiro Matsumoto) When files are dropped on gvim while the screen is being updated, ignore the drop command to avoid freeing memory that is being used. In a terminal, when drawing the popup menu over double-wide characters, half characters may not be cleared properly. (Yukihiro Nakadaira) The #ifdef for including "vimio.h" was inconsistent. In a few files it depended on MSWIN, which isn't defined until later. Patch 7.2b.001 Problem: Compilation problem: mb_fix_col() missing with multi-byte feature but without GUI or clipboard. Solution: Remove #ifdef. Files: src/mbyte.c Patch 7.2b.002 Problem: Compiler warnings for signed/unsigned mismatch. Solution: Add type casts. Files: src/screen.c Patch 7.2b.003 Problem: Still a compilation problem, check_col() and check_row() missing. Solution: Add FEAT_MBYTE to the #if. Files: src/ui.c Patch 7.2b.004 Problem: Trying to free memory for a static string when using ":helpgrep". (George Reilly) Solution: Set 'cpo' to empty_option instead of an empty string. Also for searchpair() and substitute(). Files: src/quickfix.c, src/eval.c Patch 7.2b.005 Problem: The special character "!" isn't handled properly in shellescape(). (Jan Minar) Solution: Escape "!" when using a "csh" like shell and with shellescape(s, 1). Twice for both. Also escape <NL>. Files: src/misc2.c Patch 7.2b.006 Problem: Reading past end of string when reading info from tags line. Solution: Break the loop when encountering a NUL. (Dominique Pelle) Files: src/tag.c Patch 7.2b.007 Problem: Part of a message cannot be translated. Solution: Put _() around the message. Files: src/search.c Patch 7.2b.008 Problem: A few filetypes are not detected or not detected properly. Solution: Add filetype detection patterns. (Nikolai Weibull) Files: runtime/filetype.vim Patch 7.2b.009 Problem: Reading past end of screen line. (Epicurus) Solution: Avoid going past the value of Columns. Files: src/screen.c Patch 7.2b.010 Problem: ":mksession" doesn't work for ":map , foo", ":sunmap ,". (Ethan Mallove) Solution: Check for "nxo", "nso" and other strange mapping combinations. Files: src/getchar.c Patch 7.2b.011 Problem: Configure for TCL ends up with include file in compiler command. (Richard Hogg) Solution: Delete items from $TCL_DEFS that do not start with a dash. Files: src/auto/configure, src/configure.in Patch 7.2b.012 Problem: Build failure with +multi_byte but without +diff. Solution: Add #ifdef. (Patrick Texier) Files: src/main.c Patch 7.2b.013 Problem: Build fails with tiny features and Perl. (Dominique Pelle) Solution: Define missing functions. Also when compiling Python. Files: src/if_perl.xs, src/if_python.c Patch 7.2b.014 Problem: Configure uses an unsafe temp file to store commands. Solution: Create the temp file in local directory. Files: src/auto/configure, src/configure.in Patch 7.2b.015 Problem: Build fails on Mac when using Aap. Solution: Fix typo in configure script. Files: src/auto/configure, src/configure.in Patch 7.2b.016 Problem: Build fails with normal features but without +autocmd. Solution: Fix #ifdefs. (Ian Kelling) Files: src/eval.c, src/ex_cmds.c, src/quickfix.c, src/option.c, src/ex_docmd.c Patch 7.2b.017 Problem: "vim -O foo foo" results in only one window. (Zdenek Sekera) Solution: Handle result of ATTENTION prompt properly. (Ian Kelling) Files: src/main.c Patch 7.2b.018 Problem: When doing command line completion on a file name for a csh-like shell argument a '!' character isn't escaped properly. Solution: Add another backslash. Files: src/ex_getln.c, src/misc2.c, src/proto/misc2.pro, src/screen.c Patch 7.2b.019 (extra) Problem: Win32: Various compiler warnings. Solution: Use __w64 attribute. Comment-out unused parameters. Adjust a few #ifdefs. (George Reilly) Files: src/gui_w48.c, src/GvimExt/gvimext.cpp, src/Make_mvc.mak, src/os_mswin.c, src/os_win32.c, src/vim.h Patch 7.2b.020 Problem: ":sort n" doesn't handle negative numbers. (James Vega) Solution: Include '-' in the number. Files: src/charset.c, src/ex_cmds.c Patch 7.2b.021 Problem: Reloading doesn't read the BOM correctly. (Steve Gardner) Solution: Accept utf-8 BOM when specified file encoding is utf-8. Files: src/fileio.c Patch 7.2b.022 Problem: When using ":normal" while updating the status line the count of an operator is lost. (Dominique Pelle) Solution: Save and restore "opcount". Files: src/ex_docmd.c, src/globals.h, src/normal.c Patch 7.2b.023 Problem: Crash when using the result of synstack(0,0). (Matt Wozniski) Solution: Check for v_list to be NULL in a few more places. Files: src/eval.c Patch 7.2b.024 Problem: Using ":gui" while the netrw plugin is active causes a delay in updating the display. Solution: Don't check for terminal codes when starting the GUI. Files: src/term.c Patch 7.2b.025 Problem: When the CursorHold event triggers a pending count is lost. (Juergen Kraemer) Solution: Save the counts and restore them. Files: src/normal.c, src/structs.h Patch 7.2b.026 Problem: The GTK 2 file chooser causes the ~/.recently-used.xbel file to be written over and over again. This may cause a significant slowdown. (Guido Berhoerster) Solution: Don't use the GTK 2 file chooser. Files: src/gui_gtk.c Patch 7.2b.027 Problem: Memory leak for Python, Perl, etc. script command with end marker. Solution: Free the memory of the end marker. (Andy Kittner) Files: src/ex_getln.c Patch 7.2b.028 Problem: Reading uninitialized memory when doing ":gui -f". (Dominique Pelle) Solution: Don't position the cursor when the screen size is invalid. Files: src/gui.c Patch 7.2b.029 Problem: ":help a" doesn't jump to "a" tag in docs. (Tony Mechelynck) Solution: Get all tags and throw away more than TAG_MANY after sorting. When there is no argument find matches for "help" to avoid a long delay. Files: src/ex_cmds.c, src/ex_getln.c Patch 7.2b.030 Problem: When changing the value of t_Co from 8 to 16 the Visual highlighting keeps both reverse and a background color. Solution: Remove the attribute when setting the default highlight color. (Markus Heidelberg) Files: src/syntax.c Error when cancelling completion menu and auto-formatting. (fixed by Ian Kelling) Patch 7.2c.001 Problem: ":let x=[''] | let x += x" causes hang. (Matt Wozniski) Solution: Only insert elements up to the original length of the List. Files: runtime/doc/eval.txt, src/eval.c Patch 7.2c.002 Problem: fnameescape() doesn't handle a leading '+' or '>'. (Jan Minar) Solution: Escape a leading '+' and '>'. And a single '-'. Files: runtime/doc/eval.txt, src/ex_getln.c Patch 7.2c.003 Problem: Searching for "foo\%[bar]\+" gives a "Corrupted regexp program" error. (Joachim Hofmann) Solution: Mark the \%[] item as not being simple. Files: src/regexp.c On Vista access to system directories is virtualized. (Michael Mutschler) Adjusted the manifest file to avoid this. (George Reilly) Memory leak when using CTRL-C to cancel listing the jump list. (Dominique Pelle) Mac: Could not build with Perl interface. ============================================================================== VERSION 7.3 *version-7.3* *version7.3* This section is about improvements made between version 7.2 and 7.3. This release has hundreds of bug fixes and there are a few new features. The most notable new features are: Persistent undo *new-persistent-undo* --------------- Store undo information in a file. Can undo to before when the file was read, also for unloaded buffers. See |undo-persistence| (partly by Jordan Lewis) Added the ":earlier 1f" and ":later 1f" commands. Added file save counter to undo information. Added the |undotree()| and |undofile()| functions. Also added the 'undoreload' option. This makes it possible to save the current text when reloading the buffer, so that the reload can be undone. More encryption *new-more-encryption* --------------- Support for Blowfish encryption. Added the 'cryptmethod' option. Mostly by Mohsin Ahmed. Also encrypt the text in the swap file and the undo file. Conceal text *new-conceal* ------------ Added the |+conceal| feature. (Vince Negri) This allows hiding stretches of text, based on syntax highlighting. It also allows replacing a stretch of text by a character |:syn-cchar|. The 'conceallevel' option specifies what happens with text matching a syntax item that has the conceal attribute. The 'concealcursor' option specifies what happens in the cursor line. The help files conceal characters used to mark tags and examples. Added the |synconcealed()| function and use it for :TOhtml. (Benjamin Fritz) Added the 'cursorbind' option, keeps the cursor in two windows with the same text in sync. Lua interface *new-lua* ------------- Added the |Lua| interface. (Luis Carvalho) Python3 interface *new-python3* ----------------- Added the Python3 interface. It exists next to Python 2.x, both can be used at the same time. See |python3| (Roland Puntaier) Changed *changed-7.3* ------- The MS-Windows installer no longer requires the user to type anything in the console windows. The installer now also works on 64 bit systems, including the "Edit with Vim" context menu. The gvim executable is 32 bits, the installed gvimext.dll is either a 32 or 64 bit version. (mostly by George Reilly) Made the DOS installer work with more compilers. The MS-Windows big gvim is now built with Python 2.7 and 3.1.2, Perl 5.12 and Ruby 1.9.1. You need the matching .dll files to use them. The extra and language files are no longer distributed separately. The source files for all systems are included in one distribution. After using ":recover" or recovering a file in another way, ":x" and "ZZ" didn't save what you see. This could result in work being lost. Now the text after recovery is compared to the original file contents. When they differ the buffer is marked as modified. When Vim is exiting because of a deadly signal, when v:dying is 2 or more, VimLeavePre, VimLeave, BufWinLeave and BufUnload autocommands are not executed. Removed support for GTK 1. It was no longer maintained and required a lot of #ifdefs in the source code. GTK 2 should be available for every system. (James Vega) It is no longer allowed to set the 'encoding' option from a modeline. It would corrupt the text. (Patrick Texier) Renamed runtime/spell/fixdup to runtime/spell/fixdup.vim. Removed obsolete Mac code. Updated spell files for Ubuntu locale names. Switched from autoconf 2.63 to 2.65. Removed Mupad indent and ftplugin files, they are not useful. The maximum number of messages remembered in the history is now 200 (was 100). Added *added-7.3* ----- Added the 'relativenumber' option. (Markus Heidelberg) Added the 'colorcolumn' option: highlight one or more columns in a window. E.g. to highlight the column after 'textwidth'. (partly by Gregor Uhlenheuer) Added support for NetBeans in a terminal. Added |:nbstart| and |:nbclose|. (Xavier de Gaye) More floating point functions: |acos()|, |asin()|, |atan2()|, |cosh()|, |exp()|, |fmod()|, |log()|, |sinh()|, |tan()|, |tanh()|. (Bill McCarthy) Added the |gettabvar()| and |settabvar()| functions. (Yegappan Lakshmanan) Added the |strchars()|, |strwidth()| and |strdisplaywidth()| functions. Support GDK_SUPER_MASK for GTK on Mac. (Stephan Schulz) Made CTRL and ALT modifier work for mouse wheel. (Benjamin Haskell) Added support for horizontal scroll wheel. (Bjorn Winckler) When the buffer is in diff mode, have :TOhtml create HTML to show the diff side-by-side. (Christian Brabandt) Various improvements to ":TOhtml" and the 2html.vim script. (Benjamin Fritz) Add the 'L' item to 'cinoptions'. (Manuel Konig) Improve Javascript indenting. Add "J" flag to 'cinoptions'. (Hari Kumar G) Mac: Support disabling antialias. (LC Mi) Mac: Add clipboard support in the Mac console. (Bjorn Winckler) Make it possible to drag a tab page label to another position. (Paul B. Mahol) Better implementation of creating the Color Scheme menu. (Juergen Kraemer) In Visual mode with 'showcmd' display the number of bytes and characters. Allow synIDattr() getting GUI attributes when built without GUI. (Matt Wozniski) Support completion for ":find". Added test 73. (Nazri Ramliy) Command line completion for :ownsyntax and :setfiletype. (Dominique Pelle) Command line completion for :lmap and :lunmap. Support syntax and filetype completion for user commands. (Christian Brabandt) Avoid use of the GTK main_loop() so that the GtkFileChooser can be used. (James Vega) When 'formatexpr' evaluates to non-zero fall back to internal formatting, also for "gq". (James Vega) Support :browse for commands that use an error file argument. (Lech Lorens) Support wide file names in gvimext. (Szabolcs Horvat) Improve test for joining lines. (Milan Vancura) Make joining a range of lines much faster. (Milan Vancura) Add patch to improve support of z/OS (OS/390). (Ralf Schandl) Added the helphelp.txt file. Moved text from various.txt to it. Added "q" item for 'statusline'. Added |w:quickfix_title|. (Lech Lorens) Various improvements for VMS. (Zoltan Arpadffy) New syntax files: ~ Haskell Cabal build file (Vincent Berthoux) ChaiScript (Jason Turner) Cucumber (Tim Pope) Datascript (Dominique Pelle) Fantom (Kamil Toman) Liquid (Tim Pope) Markdown (Tim Pope) wavefront's obj file (Vincent Berthoux) Perl 6 (Andy Lester) SDC - Synopsys Design Constraints (Maurizio Tranchero) SVG - Scalable Vector Graphics (Vincent Berthoux) task data (John Florian) task 42 edit (John Florian) New filetype plugins: ~ Cucumber (Tim Pope) Liquid (Tim Pope) Logcheck (Debian) Markdown (Tim Pope) Perl 6 (Andy Lester) Quickfix window (Lech Lorens) Tcl (Robert L Hicks) New indent plugins: ~ CUDA (Bram Moolenaar) ChaiScript (Jason Turner) Cucumber (Tim Pope) LifeLines (Patrick Texier) Liquid (Tim Pope) Mail (Bram Moolenaar) Perl 6 (Andy Lester) Other new runtime files: ~ Breton spell file (Dominique Pelle) Dvorak keymap (Ashish Shukla) Korean translations. (SungHyun Nam) Python 3 completion (Aaron Griffin) Serbian menu translations (Aleksandar Jelenak) Tetum spell files Tutor Bairish (Sepp Hell) Tutor in Esperanto. (Dominique Pellé) Tutor in Portuguese. Norwegian Tutor now also available as tutor.nb Removed the Mupad runtime files, they were not maintained. Fixed *fixed-7.3* ----- Patch 7.2.001 Problem: Mac: pseudo-ttys don't work properly on Leopard, resulting in the shell not to have a prompt, CTRL-C not working, etc. Solution: Don't use SVR4 compatible ptys, even though they are detected. (Ben Schmidt) Files: src/pty.c Patch 7.2.002 Problem: Leaking memory when displaying menus. Solution: Free allocated memory. (Dominique Pelle) Files: src/menu.c Patch 7.2.003 Problem: Typo in translated message. Message not translated. Solution: Correct spelling. Add _(). (Dominique Pelle) Files: src/spell.c, src/version.c Patch 7.2.004 Problem: Cscope help message is not translated. Solution: Put it in _(). (Dominique Pelle) Files: src/if_cscope.c, src/if_cscope.h Patch 7.2.005 Problem: A few problems when profiling. Using flag pointer instead of flag value. Allocating zero bytes. Not freeing used memory. Solution: Remove wrong '&' characters. Skip dumping when there is nothing to dump. Free used memory. (Dominique Pelle) Files: src/eval.c Patch 7.2.006 Problem: HTML files are not recognized by contents. Solution: Add a rule to the scripts file. (Nico Weber) Files: runtime/scripts.vim Patch 7.2.007 (extra) Problem: Minor issues for VMS. Solution: Minor fixes for VMS. Add float support. (Zoltan Arpadffy) Files: runtime/doc/os_vms.txt, src/os_vms_conf.h, src/Make_vms.mms, src/testdir/Make_vms.mms, src/testdir/test30.in, src/testdir/test54.in Patch 7.2.008 Problem: With a BufHidden autocommand that invokes ":bunload" the window count for a buffer can be wrong. (Bob Hiestand) Solution: Don't call enter_buffer() when already in that buffer. Files: src/buffer.c Patch 7.2.009 Problem: Can't compile with Perl 5.10 on MS-Windows. (Cesar Romani) Solution: Add the Perl_sv_free2 function for dynamic loading. (Dan Sharp) Files: src/if_perl.xs Patch 7.2.010 Problem: When using "K" in Visual mode not all characters are properly escaped. (Ben Schmidt) Solution: Use a function with the functionality of shellescape(). (Jan Minar) Files: src/mbyte.c, src/misc2.c, src/normal.c Patch 7.2.011 Problem: Get an error when inserting a float value from the expression register. Solution: Convert the Float to a String automatically in the same place where a List would be converted to a String. Files: src/eval.c Patch 7.2.012 Problem: Compiler warnings when building with startup timing. Solution: Add type casts. Files: src/ex_cmds2.c Patch 7.2.013 Problem: While waiting for the X selection Vim consumes a lot of CPU time and hangs until a response is received. Solution: Sleep a bit when the selection event hasn't been received yet. Time out after a couple of seconds to avoid a hang when the selection owner isn't responding. Files: src/ui.c Patch 7.2.014 Problem: synstack() doesn't work in an empty line. Solution: Accept column zero as a valid position. Files: src/eval.c Patch 7.2.015 Problem: "make all test install" doesn't stop when the test fails. (Daniel Shahaf) Solution: When test.log contains failures exit with non-zero status. Files: src/testdir/Makefile Patch 7.2.016 Problem: The pattern being completed may be in freed memory when the command line is being reallocated. (Dominique Pelle) Solution: Keep a pointer to the expand_T in the command line structure. Don't use <S-Tab> as CTRL-P when there are no results. Clear the completion when using a command line from the history. Files: src/ex_getln.c Patch 7.2.017 Problem: strlen() used on text that may not end in a NUL. (Dominique Pelle) Pasting a very big selection doesn't work. Solution: Use the length passed to the XtSelectionCallbackProc() function. After getting the SelectionNotify event continue dispatching events until the callback is actually called. Also dispatch the PropertyNotify event. Files: src/ui.c Patch 7.2.018 Problem: Memory leak when substitute is aborted. Solution: Free the buffer allocated for the new text. (Dominique Pelle) Files: src/ex_cmds.c Patch 7.2.019 Problem: Completion of ":noautocmd" doesn't work and exists(":noautocmd") returns zero. (Ben Fritz) Solution: Add "noautocmd" to the list of modifiers and commands. Files: src/ex_cmds.h, src/ex_docmd.c Patch 7.2.020 Problem: Starting the GUI when the executable starts with 'k', but the KDE version no longer exists. Solution: Don't have "kvim" start the GUI. Files: src/main.c Patch 7.2.021 Problem: When executing autocommands getting the full file name may be slow. (David Kotchan) Solution: Postpone calling FullName_save() until autocmd_fname is used. Files: src/ex_docmd.c, src/fileio.c, src/globals.h Patch 7.2.022 (extra) Problem: Testing is not possible when compiling with MingW. Solution: Add a MingW specific test Makefile. (Bill McCarthy) Files: Filelist, src/testdir/Make_ming.mak Patch 7.2.023 Problem: 'cursorcolumn' is in the wrong place in a closed fold when the display is shifted left. (Gary Johnson) Solution: Subtract w_skipcol or w_leftcol when needed. Files: src/screen.c Patch 7.2.024 Problem: It's possible to set 'history' to a negative value and that causes an out-of-memory error. Solution: Check that 'history' has a positive value. (Doug Kearns) Files: src/option.c Patch 7.2.025 Problem: When a CursorHold event invokes system() it is retriggered over and over again. Solution: Don't reset did_cursorhold when getting K_IGNORE. Files: src/normal.c Patch 7.2.026 (after 7.2.010) Problem: "K" doesn't use the length of the identifier but uses the rest of the line. Solution: Copy the desired number of characters first. Files: src/normal.c Patch 7.2.027 Problem: Can use cscope commands in the sandbox. Solution: Disallow them, they might not be safe. Files: src/ex_cmds.h Patch 7.2.028 Problem: Confusing error message for missing (). Solution: Change "braces" to "parentheses". (Gary Johnson) Files: src/eval.c Patch 7.2.029 Problem: No completion for ":doautoall". Solution: Complete ":doautoall" like ":doautocmd". (Doug Kearns) Files: src/ex_docmd.c Patch 7.2.030 (after 7.2.027) Problem: Can't compile. Solution: Remove prematurely added ex_oldfiles. Files: src/ex_cmds.h Patch 7.2.031 Problem: Information in the viminfo file about previously edited files is not available to the user. There is no way to get a complete list of files edited in previous Vim sessions. Solution: Add v:oldfiles and fill it with the list of old file names when first reading the viminfo file. Add the ":oldfiles" command, ":browse oldfiles" and the "#<123" special file name. Increase the default value for 'viminfo' from '20 to '100. Files: runtime/doc/cmdline.txt, runtime/doc/eval.txt, runtime/doc/starting.txt, runtime/doc/usr_21.txt, src/eval.c, src/ex_cmds.c, src/ex_cmds.h, src/ex_docmd.c, src/feature.h, src/fileio.c, src/main.c, src/mark.c, src/misc1.c, src/proto/eval.pro, src/proto/ex_cmds.pro, src/proto/mark.pro, src/option.c, src/structs.h, src/vim.h Patch 7.2.032 (after 7.2.031) Problem: Can't build with EXITFREE defined. (Dominique Pelle) Solution: Change vv_string to vv_str. Files: src/eval.c Patch 7.2.033 Problem: When detecting a little endian BOM "ucs-2le" is used, but the text might be "utf-16le". Solution: Default to "utf-16le", it also works for "ucs-2le". (Jia Yanwei) Files: src/fileio.c, src/testdir/test42.ok Patch 7.2.034 Problem: Memory leak in spell info when deleting buffer. Solution: Free the memory. (Dominique Pelle) Files: src/buffer.c Patch 7.2.035 Problem: Mismatches between alloc/malloc, free/vim_free, realloc/vim_realloc. Solution: Use the right function. (Dominique Pelle) Files: src/gui_x11.c, src/mbyte.c, src/misc2.c, src/os_unix.c Patch 7.2.036 (extra) Problem: Mismatches between alloc/malloc, free/vim_free, realloc/vim_realloc. Solution: Use the right function. (Dominique Pelle) Files: src/gui_riscos.c, src/gui_w48.c, src/mbyte.c, src/os_vms.c, src/os_w32exe.c, src/os_win16.c Patch 7.2.037 Problem: Double free with GTK 1 and compiled with EXITFREE. Solution: Don't close display. (Dominique Pelle) Files: src/os_unix.c Patch 7.2.038 Problem: Overlapping arguments to memcpy(). Solution: Use mch_memmove(). (Dominique Pelle) Files: src/if_xcmdsrv.c Patch 7.2.039 Problem: Accessing freed memory on exit when EXITFREE is defined. Solution: Call hash_init() on the v: hash table. Files: src/eval.c Patch 7.2.040 Problem: When using ":e ++ff=dos fname" and the file contains a NL without a CR before it and 'ffs' contains "unix" then the fileformat becomes unix. Solution: Ignore 'ffs' when using the ++ff argument. (Ben Schmidt) Also remove unreachable code. Files: src/fileio.c Patch 7.2.041 Problem: In diff mode, when using two tabs, each with two diffed buffers, editing a buffer of the other tab messes up the diff. (Matt Mzyzik) Solution: Only copy options from a window where the buffer was edited that doesn't have 'diff' set or is for the current tab page. Also fix that window options for a buffer are stored with the wrong window. Files: src/buffer.c, src/ex_cmds.c, src/ex_cmds2.c, src/ex_docmd.c, src/ex_getln.c, src/if_sniff.c, src/main.c, src/netbeans.c, src/normal.c, src/popupmnu.c, src/proto/buffer.pro, src/proto/ex_cmds.pro src/quickfix.c, src/window.c Patch 7.2.042 Problem: When using winrestview() in a BufWinEnter autocommand the window is scrolled anyway. (Matt Zyzik) Solution: Don't recompute topline when above 'scrolloff' from the bottom. Don't always put the cursor halfway when entering a buffer. Add "w_topline_was_set". Files: src/buffer.c, src/move.c, src/structs.h Patch 7.2.043 Problem: VMS: Too many characters are escaped in filename and shell commands. Solution: Escape fewer characters. (Zoltan Arpadffy) Files: src/vim.h Patch 7.2.044 Problem: Crash because of STRCPY() being over protective of the destination size. (Dominique Pelle) Solution: Add -D_FORTIFY_SOURCE=1 to CFLAGS. Use an intermediate variable for the pointer to avoid a warning. Files: src/auto/configure, src/configure.in, src/eval.c Patch 7.2.045 Problem: The Python interface has an empty entry in sys.path. Solution: Filter out the empty entry. (idea from James Vega) Files: src/if_python.c Patch 7.2.046 Problem: Wrong check for filling buffer with encoding. (Danek Duvall) Solution: Remove pointers. (Dominique Pelle) Files: src/mbyte.c Patch 7.2.047 Problem: Starting Vim with the -nb argument while it's not supported causes the other side to hang. Solution: When -nb is used while it's not supported exit Vim. (Xavier de Gaye) Files: src/main.c, src/vim.h Patch 7.2.048 Problem: v:prevcount is changed too often. Counts are not multiplied when setting v:count. Solution: Set v:prevcount properly. Multiply counts. (idea by Ben Schmidt) Files: src/eval.c, src/normal.c, src/proto/eval.pro Patch 7.2.049 (extra) Problem: Win32: the clipboard doesn't support UTF-16. Solution: Change UCS-2 support to UTF-16 support. (Jia Yanwei) Files: src/gui_w32.c, src/gui_w48.c, src/mbyte.c, src/misc1.c, src/os_mswin.c, src/os_win32.c, src/proto/os_mswin.pro Patch 7.2.050 Problem: Warnings for not checking return value of fwrite(). (Chip Campbell) Solution: Use the return value. Files: src/spell.c Patch 7.2.051 Problem: Can't avoid 'wildignore' and 'suffixes' for glob() and globpath(). Solution: Add an extra argument to these functions. (Ingo Karkat) Files: src/eval.c, src/ex_getln.c, src/proto/ex_getln.pro, runtime/doc/eval.txt, runtime/doc/options.txt Patch 7.2.052 Problem: synIDattr() doesn't support "sp" for special color. Solution: Recognize "sp" and "sp#". (Matt Wozniski) Files: runtime/doc/eval.txt, src/eval.c Patch 7.2.053 Problem: Crash when using WorkShop command ":ws foo". (Dominique Pelle) Solution: Avoid using a NULL pointer. Files: src/workshop.c Patch 7.2.054 Problem: Compilation warnings for format in getchar.c. Solution: Use fputs() instead of fprintf(). (Dominique Pelle) Files: src/getchar.c Patch 7.2.055 Problem: Various compiler warnings with strict checking. Solution: Avoid the warnings by using return values and renaming. Files: src/diff.c, src/eval.c, src/ex_cmds.c, src/ex_docmd.c, src/fileio.c, src/fold.c, src/globals.h, src/gui.c, src/gui_at_sb.c, src/gui_gtk_x11.c, src/gui_xmdlg.c, src/gui_xmebw.c, src/main.c, src/mbyte.c, src/message.c, src/netbeans.c, src/option.c, src/os_unix.c, src/spell.c, src/ui.c, src/window.c Patch 7.2.056 (after 7.2.050) Problem: Tests 58 and 59 fail. Solution: Don't invoke fwrite() with a zero length. (Dominique Pelle) Files: src/spell.c Patch 7.2.057 (after 7.2.056) Problem: Combination of int and size_t may not work. Solution: Use size_t for variable. Files: src/spell.c Patch 7.2.058 Problem: Can't add a patch name to the ":version" output. Solution: Add the extra_patches array. Files: src/version.c Patch 7.2.059 Problem: Diff display is not always updated. Solution: Update the display more often. Files: src/diff.c Patch 7.2.060 Problem: When a spell files has many compound rules it may take a very long time making the list of suggestions. Displaying also can be slow when there are misspelled words. Can't parse some Hunspell .aff files. Solution: Check if a compounding can possibly work before trying a combination, if the compound rules don't contain wildcards. Implement using CHECKCOMPOUNDPATTERN. Ignore COMPOUNDRULES. Ignore a comment after most items. Accept ONLYINCOMPOUND as an alias for NEEDCOMPOUND. Accept FORBIDDENWORD as an alias for BAD. Files: runtime/doc/spell.txt, src/spell.c Patch 7.2.061 Problem: Can't create a funcref for an autoload function without loading the script first. (Marc Weber) Solution: Accept autoload functions that don't exist yet in function(). Files: src/eval.c Patch 7.2.062 Problem: "[Scratch]" is not translated. Solution: Mark the string for translation. (Dominique Pelle) Files: src/buffer.c Patch 7.2.063 Problem: Warning for NULL argument of Perl_sys_init3(). Solution: Use Perl_sys_init() instead. (partly by Dominique Pelle) Files: src/if_perl.xs Patch 7.2.064 Problem: Screen update bug when repeating "~" on a Visual block and the last line doesn't change. Solution: Keep track of changes for all lines. (Moritz Orbach) Files: src/ops.c Patch 7.2.065 Problem: GTK GUI: the cursor disappears when doing ":vsp" and the Vim window is maximized. (Dominique Pelle, Denis Smolyar) Solution: Don't change "Columns" back to an old value at a wrong moment. Do change "Rows" when it should not be a problem. Files: src/gui.c Patch 7.2.066 Problem: It's not easy to see whether 'encoding' is a multi-byte encoding. Solution: Add has('multi_byte_encoding'). Files: runtime/doc/eval.txt, src/eval.c Patch 7.2.067 Problem: Session file can't load extra file when the path contains special characters. Solution: Escape the file name. (Lech Lorens) Files: src/ex_docmd.c Patch 7.2.068 Problem: Emacs tags file lines can be too long, resulting in an error message. (James Vega) Solution: Ignore lines with errors if they are too long. Files: src/tag.c Patch 7.2.069 (after 7.2.060) Problem: Compiler warning for storing size_t in int. Solution: Add type cast. Files: src/spell.c Patch 7.2.070 Problem: Crash when a function returns a:000. (Matt Wozniski) Solution: Don't put the function struct on the stack, allocate it. Free it only when nothing in it is used. Files: src/eval.c Patch 7.2.071 (extra) Problem: Win32: Handling netbeans events while Vim is busy updating the screen may cause a crash. Solution: Like with GTK, only handle netbeans messages in the main loop. (Xavier de Gaye) Files: src/gui_w48.c, src/netbeans.c Patch 7.2.072 (extra) Problem: Compiler warning in Sniff code. Solution: Use return value of pipe(). (Dominique Pelle) Files: src/if_sniff.c Patch 7.2.073 Problem: ":set <xHome>" has the same output as ":set <Home>". (Matt Wozniski) Solution: Don't translate "x" keys to its alternative for ":set". Files: src/gui_mac.c, src/misc2.c, src/option.c, src/proto/misc2.pro Patch 7.2.074 (extra, after 7.2.073) Problem: ":set <xHome>" has the same output as ":set <Home>". (Matt Wozniski) Solution: Don't translate "x" keys to its alternative for ":set". Files: src/gui_mac.c Patch 7.2.075 (after 7.2.058) Problem: Explanation about making a diff for extra_patches is unclear. Solution: Adjust comment. Files: src/version.c Patch 7.2.076 Problem: rename(from, to) deletes the file if "from" and "to" are not equal but still refer to the same file. E.g., on a FAT32 filesystem under Unix. Solution: Go through another file name. Files: src/fileio.c Patch 7.2.077 (after 7.2.076) Problem: rename(from, to) doesn't work if "from" and "to" differ only in case on a system that ignores case in file names. Solution: Go through another file name. Files: src/fileio.c Patch 7.2.078 Problem: When deleting a fold that is specified with markers the cursor position may be wrong. Folds may not be displayed properly after a delete. Wrong fold may be deleted. Solution: Fix the problems. (mostly by Lech Lorens) Files: src/fold.c Patch 7.2.079 Problem: "killed" netbeans events are not handled correctly. Solution: A "killed" netbeans event is sent when the buffer is deleted or wiped out (in this case, the netbeans annotations in this buffer have been removed). A user can still remove a sign with the command ":sign unplace" and this does not trigger a "killed" event. (Xavier de Gaye) Files: runtime/doc/netbeans.txt, src/buffer.c, src/globals.h, src/netbeans.c, src/proto/netbeans.pro Patch 7.2.080 Problem: When typing a composing character just after starting completion may access memory before its allocation point. (Dominique Pelle) Solution: Don't delete before the completion start column. Add extra checks for the offset not being negative. Files: src/edit.c Patch 7.2.081 Problem: Compiler warning for floating point overflow on VAX. Solution: For VAX use a smaller number. (Zoltan Arpadffy) Files: src/message.c Patch 7.2.082 Problem: When 'ff' is "mac" then "ga" on a ^J shows 0x0d instead of 0x0a. (Andy Wokula) Solution: Use NL for this situation. (Lech Lorens) Files: src/ex_cmds.c Patch 7.2.083 Problem: ":tag" does not return to the right tag entry from the tag stack. Solution: Don't change the current match when there is no argument. (Erik Falor) Files: src/tag.c Patch 7.2.084 Problem: Recursive structures are not handled properly in Python vim.eval(). Solution: Keep track of references in a better way. (Yukihiro Nakadaira) Files: src/if_python.c Patch 7.2.085 Problem: ":set <M-b>=<Esc>b" does not work when 'encoding' is utf-8. Solution: Put the <M-b> character in the input buffer as valid utf-8. (partly by Matt Wozniski) Files: src/term.c Patch 7.2.086 Problem: Using ":diffget 1" in buffer 1 corrupts the text. Solution: Don't do anything when source and destination of ":diffget" or ":diffput" is the same buffer. (Dominique Pelle) Files: src/diff.c Patch 7.2.087 Problem: Adding URL to 'path' doesn't work to edit a file. Solution: Skip simplify_filename() for URLs. (Matt Wozniski) Files: src/misc2.c Patch 7.2.088 (extra) Problem: OpenClipboard() may fail when another application is using the clipboard. Solution: Retry OpenClipboard() a few times. (Jianrong Yu) Files: src/os_mswin.c Patch 7.2.089 (extra) Problem: Win32: crash when using Ultramon buttons. Solution: Don't use a WM_OLE message of zero size. (Ray Megal) Files: src/if_ole.cpp, src/gui_w48.c Patch 7.2.090 Problem: User command containing 0x80 in multi-byte character does not work properly. (Yasuhiro Matsumoto) Solution: Undo replacement of K_SPECIAL and CSI characters when executing the command. Files: src/ex_docmd.c Patch 7.2.091 Problem: ":cs help" output is not aligned for some languages. Solution: Compute character size instead of byte size. (Dominique Pelle) Files: src/if_cscope.c Patch 7.2.092 Problem: Some error messages are not translated. Solution: Add _() around the messages. (Dominique Pelle) Files: src/eval.c Patch 7.2.093 (extra) Problem: Win32: inputdialog() and find/replace dialogs can't handle multi-byte text. Solution: Use the wide version of dialog functions when available. (Yanwei Jia) Files: src/gui_w32.c, src/gui_w48.c Patch 7.2.094 Problem: Compiler warning for signed/unsigned compare. Solution: Add type cast. Also fix a few typos. Files: src/edit.c Patch 7.2.095 Problem: With Visual selection, "r" and then CTRL-C Visual mode is stopped but the highlighting is not removed. Solution: Call reset_VIsual(). Files: src/normal.c Patch 7.2.096 Problem: After ":number" the "Press Enter" message may be on the wrong screen, if switching screens for shell commands. Solution: Reset info_message. (James Vega) Files: src/ex_cmds.c Patch 7.2.097 Problem: "!xterm&" doesn't work when 'shell' is "bash". Solution: Ignore SIGHUP after calling setsid(). (Simon Schubert) Files: src/os_unix.c Patch 7.2.098 Problem: Warning for signed/unsigned pointer. Solution: Add type cast. Files: src/eval.c Patch 7.2.099 Problem: Changing GUI options causes an unnecessary redraw when the GUI isn't active. Solution: Avoid the redraw. (Lech Lorens) Files: src/option.c Patch 7.2.100 Problem: When using ":source" on a FIFO or something else that can't rewind the first three bytes are skipped. Solution: Instead of rewinding read the first line and detect a BOM in that. (mostly by James Vega) Files: src/ex_cmds2.c Patch 7.2.101 (extra) Problem: MSVC version not recognized. Solution: Add the version number to the list. (Zhong Zhang) Files: src/Make_mvc.mak Patch 7.2.102 (after 7.2.100) Problem: When 'encoding' is "utf-8" a BOM at the start of a Vim script is not removed. (Tony Mechelynck) Solution: When no conversion is taking place make a copy of the line without the BOM. Files: src/ex_cmds2.c Patch 7.2.103 Problem: When 'bomb' is changed the window title is updated to show/hide a "+", but the tab page label isn't. (Patrick Texier) Solution: Set "redraw_tabline" in most places where "need_maketitle" is set. (partly by Lech Lorens) Files: src/option.c Patch 7.2.104 Problem: When using ":saveas bar.c" the tab label isn't updated right away. Solution: Set redraw_tabline. (Francois Ingelrest) Files: src/ex_cmds.c Patch 7.2.105 Problem: Modeline setting for 'foldmethod' overrules diff options. (Ingo Karkat) Solution: Don't set 'foldmethod' and 'wrap' from a modeline when 'diff' is on. Files: src/option.c Patch 7.2.106 Problem: Endless loop when using "]s" in HTML when there are no misspellings. (Ingo Karkat) Solution: Break the search loop. Also fix pointer alignment for systems with pointers larger than int. Files: src/spell.c Patch 7.2.107 Problem: When using a GUI dialog and ":echo" commands the messages are deleted after the dialog. (Vincent Birebent) Solution: Don't call msg_end_prompt() since there was no prompt. Files: src/message.c Patch 7.2.108 (after 7.2.105) Problem: Can't build without the diff feature. Solution: Add #ifdef. Files: src/option.c Patch 7.2.109 Problem: 'langmap' does not work for multi-byte characters. Solution: Add a list of mapped multi-byte characters. (based on work by Konstantin Korikov, Agathoklis Hatzimanikas) Files: runtime/doc/options.txt, src/edit.c, src/getchar.c, src/macros.h, src/normal.c, src/option.c, src/proto/option.pro, src/window.c Patch 7.2.110 Problem: Compiler warning for unused variable. Solution: Init the variable. Files: src/ex_docmd.c Patch 7.2.111 Problem: When using Visual block mode with 'cursorcolumn' it's unclear what is selected. Solution: Don't use 'cursorcolumn' highlighting inside the Visual selection. (idea by Dominique Pelle) Files: src/screen.c Patch 7.2.112 Problem: Cursor invisible in Visual mode when 'number' is set and cursor in first column. (Matti Niemenmaa, Renato Alves) Solution: Check that vcol_prev is smaller than vcol. Files: src/screen.c Patch 7.2.113 Problem: Crash for substitute() call using submatch(1) while there is no such submatch. (Yukihiro Nakadaira) Solution: Also check the start of the submatch is set, it can be NULL when an attempted match didn't work out. Files: src/regexp.c Patch 7.2.114 Problem: Using wrong printf format. Solution: Use "%ld" instead of "%d". (Dominique Pelle) Files: src/netbeans.c Patch 7.2.115 Problem: Some debugging code is never used. Solution: Remove nbtrace() and nbprt(). (Dominique Pelle) Files: src/nbdebug.c, src/nbdebug.h Patch 7.2.116 Problem: Not all memory is freed when EXITFREE is defined. Solution: Free allocated memory on exit. (Dominique Pelle) Files: src/ex_docmd.c, src/gui_gtk_x11.c, src/misc2.c, src/search.c, src/tag.c Patch 7.2.117 Problem: Location list incorrectly labelled "Quickfix List". Solution: Break out of both loops for finding window for location list buffer. (Lech Lorens) Files: src/buffer.c, src/quickfix.c, src/screen.c Patch 7.2.118 Problem: <PageUp> at the more prompt only does half a page. Solution: Make <PageUp> go up a whole page. Also make 'f' go a page forward, but not quit the more prompt. (Markus Heidelberg) Files: src/message.c Patch 7.2.119 Problem: Status line is redrawn too often. Solution: Check ScreeenLinesUC[] properly. (Yukihiro Nakadaira) Files: src/screen.c Patch 7.2.120 Problem: When opening the quickfix window or splitting the window and setting the location list, the location list is copied and then deleted, which is inefficient. Solution: Don't copy the location list when not needed. (Lech Lorens) Files: src/quickfix.c, src/vim.h, src/window.c Patch 7.2.121 Problem: In gvim "!grep a *.c" spews out a lot of text that can't be stopped with CTRL-C. Solution: When looping to read and show text, do check for typed characters every two seconds. Files: src/os_unix.c Patch 7.2.122 Problem: Invalid memory access when the VimResized autocommand changes 'columns' and/or 'lines'. Solution: After VimResized check for changed values. (Dominique Pelle) Files: src/screen.c Patch 7.2.123 Problem: Typing 'q' at more prompt for ":map" output still displays another line, causing another more prompt. (Markus Heidelberg) Solution: Quit listing maps when 'q' typed. Files: src/getchar.c Patch 7.2.124 Problem: Typing 'q' at more prompt for ":tselect" output still displays more lines, causing another more prompt. (Markus Heidelberg) Solution: Quit listing tags when 'q' typed. Files: src/tag.c Patch 7.2.125 Problem: Leaking memory when reading XPM bitmap for a sign. Solution: Don't allocate the memory twice. (Dominique Pelle) Files: src/gui_x11.c Patch 7.2.126 Problem: When EXITFREE is defined signs are not freed. Solution: Free all signs on exit. Also free keymaps. (Dominique Pelle) Files: src/misc2.c, src/ex_cmds.c, src/proto/ex_cmds.pro Patch 7.2.127 Problem: When listing mappings and a wrapping line causes the more prompt, after typing 'q' there can be another more prompt. (Markus Heidelberg) Solution: Set "lines_left" to allow more lines to be displayed. Files: src/message.c Patch 7.2.128 (after 7.2.055) Problem: Using ":lcd" makes session files not work. Solution: Compare return value of mch_chdir() properly. (Andreas Bernauer) Files: src/ex_docmd.c Patch 7.2.129 Problem: When opening a command window from input() it uses the search history. Solution: Use get_cmdline_type(). (James Vega) Files: src/ex_getln.c Patch 7.2.130 Problem: Vim may hang until CTRL-C is typed when using CTRL-Z. Solution: Avoid using pause(). Also use "volatile" for variables used in signal functions. (Dominique Pelle) Files: src/auto/configure, src/configure.in, src/config.h.in, src/globals.h, src/os_unix.c Patch 7.2.131 Problem: When 'keymap' is cleared may still use the cursor highlighting for when it's enabled. Solution: Reset 'iminsert' and 'imsearch'. (partly by Dominique Pelle) Also avoid ":setlocal" for these options have a global effect. Files: src/option.c Patch 7.2.132 Problem: When changing directory during a SwapExists autocmd freed memory may be accessed. (Dominique Pelle) Solution: Add the allbuf_lock flag. Files: src/ex_getln.c, src/globals.h, src/fileio.c, src/proto/ex_getln.pro Patch 7.2.133 Problem: ":diffoff!" changes settings in windows not in diff mode. Solution: Only change settings in other windows when 'diff' is set, always do it for the current window. (Lech Lorens) Files: src/diff.c Patch 7.2.134 Problem: Warning for discarding "const" from pointer. Solution: Don't pass const pointer to mch_memmove(). Files: src/fileio.c Patch 7.2.135 Problem: Memory leak when redefining user command with complete argument. Solution: Free the old complete argument. (Dominique Pelle) Files: src/ex_docmd.c Patch 7.2.136 (after 7.2.132) Problem: ":cd" is still possible in a SwapExists autocmd. Solution: Check the allbuf_lock flag in ex_cd(). Files: src/ex_docmd.c Patch 7.2.137 Problem: When 'virtualedit' is set, a left shift of a blockwise selection that starts and ends inside a tab shifts too much. (Helmut Stiegler) Solution: Redo the block left shift code. (Lech Lorens) Files: src/ops.c, src/testdir/Makefile, src/testdir/test66.in, src/testdir/test66.ok Patch 7.2.138 (extra part of 7.2.137) Problem: See 7.2.137. Solution: See 7.2.137. Files: src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak, src/testdir/Make_ming.mak, src/testdir/Make_os2.mak, src/testdir/Make_vms.mms Patch 7.2.139 Problem: Crash when 'virtualedit' is "all". (James Vega) Solution: Avoid overflow when column is MAXCOL. (Dominique Pelle) Files: src/misc2.c Patch 7.2.140 Problem: Diff highlighting isn't displayed before the Visual area if it starts at the cursor position. (Markus Heidelberg) Solution: Also check fromcol_prev. Files: src/screen.c Patch 7.2.141 Problem: When redrawing a character for bold spill this causes the next character to be redrawn as well. Solution: Only redraw one extra character. (Yukihiro Nakadaira) Files: src/screen.c Patch 7.2.142 Problem: Motif and Athena balloons don't use tooltip colors. Solution: Set the colors. (Matt Wozniski) Files: src/gui_beval.c Patch 7.2.143 Problem: No command line completion for ":cscope" command. Solution: Add the completion for ":cscope". (Dominique Pelle) Files: src/ex_docmd.c, src/ex_getln.c, src/if_cscope.c, src/proto/if_cscope.pro, src/vim.h Patch 7.2.144 Problem: When 't_Co' is set to the value it already had the color scheme is reloaded anyway. Solution: Only load the colorscheme when the t_Co value changes. (Dominique Pelle) Files: src/option.c Patch 7.2.145 Problem: White space in ":cscope find" is not ignored. Solution: Ignore the white space, but not when the leading white space is useful for the argument. Files: runtime/doc/if_scop.txt, src/if_cscope.c Patch 7.2.146 Problem: v:warningmsg isn't used for all warnings. Solution: Set v:warningmsg for relevant warnings. (Ingo Karkat) Files: src/fileio.c, src/misc1.c, src/option.c Patch 7.2.147 Problem: When compiled as small version and 'number' is on the cursor is displayed in the wrong position after a tab. (James Vega) Solution: Don't increment vcol when still displaying the line number. Files: src/screen.c Patch 7.2.148 Problem: When searching for "$" while 'hlsearch' is set, highlighting the character after the line does not work in the cursor column. Also highlighting for Visual mode after the line end when this isn't needed. (Markus Heidelberg) Solution: Only compare the cursor column in the cursor line. Only highlight for Visual selection after the last character when it's needed to see where the Visual selection ends. Files: src/screen.c Patch 7.2.149 Problem: Using return value of function that doesn't return a value results in reading uninitialized memory. Solution: Set the default to return zero. Make cursor() return -1 on failure. Let complete() return an empty string in case of an error. (partly by Dominique Pelle) Files: runtime/doc/eval.txt, src/eval.c Patch 7.2.150 (extra) Problem: Can't use tab pages from VisVim. Solution: Add tab page support to VisVim. (Adam Slater) Files: src/VisVim/Commands.cpp, src/VisVim/Resource.h, src/VisVim/VisVim.rc Patch 7.2.151 Problem: ":hist a" doesn't work like ":hist all" as the docs suggest. Solution: Make ":hist a" and ":hist al" work. (Dominique Pelle) Files: src/ex_getln.c Patch 7.2.152 Problem: When using "silent echo x" inside ":redir" a next echo may start halfway the line. (Tony Mechelynck, Dennis Benzinger) Solution: Reset msg_col after redirecting silently. Files: src/ex_docmd.c, src/message.c, src/proto/message.pro Patch 7.2.153 Problem: Memory leak for ":recover empty_dir/". Solution: Free files[] when it becomes empty. (Dominique Pelle) Files: src/memline.c Patch 7.2.154 (after 7.2.132) Problem: ":cd" is still possible in a SwapExists autocmd. Solution: Set allbuf_lock in do_swapexists(). Files: src/memline.c Patch 7.2.155 Problem: Memory leak in ":function /pat". Solution: Free the memory. (Dominique Pelle) Files: src/eval.c Patch 7.2.156 (after 7.2.143) Problem: No completion for :scscope and :lcscope commands. Solution: Implement the completion. (Dominique Pelle) Files: src/if_cscope.c, src/ex_docmd.c, src/proto/if_cscope.pro Patch 7.2.157 Problem: Illegal memory access when searching in path. Solution: Avoid looking at a byte after end of a string. (Dominique Pelle) Files: src/search.c Patch 7.2.158 Problem: Warnings from VisualC compiler. Solution: Add type casts. (George Reilly) Files: src/ops.c Patch 7.2.159 Problem: When $x_includes ends up being "NONE" configure fails. Solution: Check for $x_includes not to be "NONE" (Rainer) Files: src/auto/configure, src/configure.in Patch 7.2.160 Problem: Search pattern not freed on exit when 'rightleft' set. Solution: Free mr_pattern_alloced. Files: src/search.c Patch 7.2.161 Problem: Folds messed up in other tab page. (Vlad Irnov) Solution: Instead of going over all windows in current tab page go over all windows in all tab pages. Also free memory for location lists in other tab pages when exiting. (Lech Lorens) Files: src/fileio.c, src/mark.c, src/misc1.c, src/misc2.c Patch 7.2.162 Problem: The quickfix window may get wrong filetype. Solution: Do not detect the filetype for the quickfix window. (Lech Lorens) Files: src/quickfix.c Patch 7.2.163 Problem: The command line window may get folding. Solution: Default to no/manual folding. (Lech Lorens) Files: src/ex_getln.c Patch 7.2.164 Problem: When 'showbreak' is set the size of the Visual block may be reported wrong. (Eduardo Daudt Flach) Solution: Temporarily make 'sbr' empty. Files: src/normal.c, src/ops.c Patch 7.2.165 Problem: The argument for the FuncUndefined autocmd event is expanded like a file name. Solution: Don't try expanding it. (Wang Xu) Files: src/fileio.c Patch 7.2.166 Problem: No completion for ":sign" command. Solution: Add ":sign" completion. (Dominique Pelle) Files: src/ex_cmds.c, src/ex_docmd.c, src/ex_getln.c, src/vim.h, src/proto/ex_cmds.pro Patch 7.2.167 Problem: Splint doesn't work well for checking the code. Solution: Add splint arguments in the Makefile. Exclude some code from splint that it can't handle. Tune splint arguments to give reasonable errors. Add a filter for removing false warnings from splint output. Many small changes to avoid warnings. More to follow... Files: Filelist, src/Makefile, src/buffer.c, src/charset.c, src/cleanlint.vim, src/digraph.c, src/edit.c, src/ex_cmds.c, src/globals.h, src/ops.c, src/os_unix.c, src/os_unix.h, src/proto/buffer.pro, src/proto/edit.pro, src/screen.c, src/structs.h Patch 7.2.168 Problem: When no ctags program can be found, "make tags" attempts to execute the first C file. Solution: Default to "ctags" when no ctags program can be found. Files: src/configure.in, src/auto/configure Patch 7.2.169 Problem: Splint complains about a lot of things. Solution: Add type casts, #ifdefs and other changes to avoid warnings. Change colnr_T from unsigned to int. Avoids mistakes with subtracting columns. Files: src/cleanlint.vim, src/diff.c, src/edit.c, src/ex_cmds.c, src/ex_cmds2.c, src/ex_docmd.c, src/proto/ex_cmds.pro, src/proto/spell.pro, src/quickfix.c, src/spell.c, src/structs.h, src/term.h, src/vim.h Patch 7.2.170 Problem: Using b_dev while it was not set. (Dominique Pelle) Solution: Add the b_dev_valid flag. Files: src/buffer.c, src/fileio.c, src/structs.h Patch 7.2.171 (after 7.2.169) Problem: Compiler warnings. (Tony Mechelynck) Solution: Add function prototype. (Patrick Texier) Init variable. Files: src/ex_cmds.c Patch 7.2.172 (extra) Problem: Compiler warning. Solution: Adjust function prototype. (Patrick Texier) Files: src/os_mswin.c Patch 7.2.173 Problem: Without lint there is no check for unused function arguments. Solution: Use gcc -Wunused-parameter instead of lint. For a few files add attributes to arguments that are known not to be used. Files: src/auto/configure, src/buffer.c, src/charset.c, src/diff.c, src/configure.in, src/config.h.in, src/edit.c, src/ex_cmds.c, src/ex_cmds2.c, src/version.c, src/vim.h Patch 7.2.174 Problem: Too many warnings from gcc -Wextra. Solution: Change initializer. Add UNUSED. Add type casts. Files: src/edit.c, src/eval.c, src/ex_cmds.c, src/ex_docmd.c, src/ex_getln.c, src/fileio.c, getchar.c, globals.h, main.c, memline.c, message.c, src/misc1.c, src/move.c, src/normal.c, src/option.c, src/os_unix.c, src/os_unix.h, src/regexp.c, src/search.c, src/tag.c Patch 7.2.175 Problem: Compiler warning in OpenBSD. Solution: Add type cast for NULL. (Dasn) Files: src/if_cscope.c Patch 7.2.176 Problem: Exceptions for splint are not useful. Solution: Remove the S_SPLINT_S ifdefs. Files: src/edit.c, src/ex_cmds.c, src/ex_docmd.c, src/os_unix.c, src/os_unix.h, src/os_unixx.h, src/structs.h, src/term.h Patch 7.2.177 Problem: Compiler warnings when using -Wextra Solution: Add UNUSED and type casts. Files: src/eval.c, src/ex_docmd.c, src/ex_eval.c, src/ex_getln.c, src/fileio.c, src/hardcopy.c, src/if_cscope.c, src/if_xcmdsrv.c, src/farsi.c, src/mark.c, src/menu.c Patch 7.2.178 Problem: Using negative value for device number might not work. Solution: Use a separate flag for whether ffv_dev was set. Files: src/misc2.c Patch 7.2.179 Problem: Using negative value for device number might not work. Solution: Use a separate flag for whether sn_dev was set. Files: src/ex_cmds2.c Patch 7.2.180 Problem: Some more compiler warnings when using gcc -Wextra. Solution: Add UNUSED and type casts. Files: src/buffer.c, src/ex_cmds.c, src/macros.h, src/main.c, src/menu.c, src/message.c, src/misc1.c, src/mbyte.c, src/normal.c, src/option.c, src/os_unix.c, src/quickfix.c, src/screen.c, src/search.c, src/spell.c, src/syntax.c, src/tag.c, src/term.c, src/ui.c Patch 7.2.181 Problem: Some more compiler warnings when using gcc -Wextra. Solution: Add UNUSED and type casts. Files: src/if_mzsch.c, src/gui.c, src/gui_gtk.c, src/gui_gtk_x11.c, src/gui_gtk_f.c, src/gui_beval.c, src/netbeans.c Patch 7.2.182 (after 7.2.181) Problem: Compilation problems after previous patch for Motif. Gvim with GTK crashes on startup. Solution: Add comma. Init form structure to zeroes. Files: src/netbeans.c, src/gui_gtk_f.c Patch 7.2.183 Problem: Configure problem for sys/sysctl.h on OpenBSD. (Dasn) Solution: Add separate check for this header file. Also switch to newer version of autoconf. Files: src/auto/configure, src/configure.in Patch 7.2.184 Problem: Some more compiler warnings when using gcc -Wextra. Solution: Add UNUSED and type casts. Autoconf check for wchar_t. Files: src/auto/configure, src/config.h.in, src/configure.in, src/gui_athena.c, src/gui_x11.c, src/gui.c, src/gui_beval.c, src/gui_at_sb.c, src/gui_at_fs.c, src/gui_motif.c, src/gui_xmdlg.c, src/gui_xmebw.c, src/if_python.c, src/window.c, src/workshop.c Patch 7.2.185 Problem: Some more compiler warnings when using gcc -Wextra. Solution: Add UNUSED and type casts. Files: src/Makefile, src/if_tlc.c, src/if_ruby.c Patch 7.2.186 Problem: Some more compiler warnings when using gcc -Wextra. Solution: Now with the intended if_tcl.c changes. Files: src/if_tcl.c Patch 7.2.187 (after 7.2.186) Problem: Doesn't build with older versions of TCL. (Yongwei Wu) Solution: Add #ifdefs. (Dominique Pelle) Files: src/if_tcl.c Patch 7.2.188 Problem: Crash with specific use of function calls. (Meikel Brandmeyer) Solution: Make sure the items referenced by a function call are not freed twice. (based on patch from Nico Weber) Files: src/eval.c Patch 7.2.189 Problem: Possible hang for deleting auto-indent. (Dominique Pelle) Solution: Make sure the position is not beyond the end of the line. Files: src/edit.c Patch 7.2.190 Problem: The register executed by @@ isn't restored. Solution: Mark the executable register in the viminfo file. Files: src/ops.c Patch 7.2.191 Problem: Mzscheme interface doesn't work on Ubuntu. Solution: Change autoconf rules. Define missing macro. Some changes to avoid gcc warnings. Remove per-buffer namespace. (Sergey Khorev) Files: runtime/doc/if_mzsch.txt, src/Makefile, src/Make_ming.mak, src/Make_mvc.mak, src/auto/configure, src/configure.in, src/config.mk.in, src/eval.c, src/if_mzsch.c, src/if_mzsch.h, src/main.c, src/proto/if_mzsch.pro Patch 7.2.192 (after 7.2.188) Problem: Still a crash in the garbage collector for a very rare situation. Solution: Make sure current_copyID is always incremented correctly. (Kent Sibilev) Files: src/eval.c Patch 7.2.193 Problem: Warning for uninitialized values. Solution: Initialize all the struct items. Files: src/eval.c Patch 7.2.194 (extra) Problem: MSVC: rem commands are echoed. Solution: Add commands to switch off echo. (Wang Xu) Files: src/msvc2008.bat Patch 7.2.195 Problem: Leaking memory for the command Vim was started with. Solution: Remember the pointer and free it. Files: src/gui_gtk_x11.c Patch 7.2.196 (after 7.2.167) Problem: Turns out splint doesn't work well enough to be usable. Solution: Remove splint support. Files: Filelist, src/cleanlint.vim Patch 7.2.197 Problem: Warning for uninitialized values. Solution: Initialize all the struct items of typebuf. Files: src/globals.h Patch 7.2.198 Problem: Size of buffer used for tgetent() may be too small. Solution: Use the largest known size everywhere. Files: src/vim.h Patch 7.2.199 Problem: Strange character in comment. Solution: Change to "message". (Yongwei Wu) Files: src/term.c Patch 7.2.200 Problem: Reading past end of string when navigating the menu bar or resizing the window. Solution: Add and use mb_ptr2len_len(). (partly by Dominique Pelle) Also add mb_ptr2cells_len() to prevent more trouble. Files: src/gui_gtk_x11.c, src/os_unix.c, src/globals.h, src/mbyte.c, src/proto/mbyte.pro Patch 7.2.201 Problem: Cannot copy/paste HTML to/from Firefox via the clipboard. Solution: Implement this for GTK. Add the "html" value to 'clipboard'. Files: runtime/doc/options.txt, src/globals.h, src/gui_gtk_x11.c, src/mbyte.c, src/proto/mbyte.pro, src/option.c Patch 7.2.202 Problem: BufWipeout autocommand that edits another buffer causes problems. Solution: Check for the situation, give an error and quit the operation. Files: src/fileio.c Patch 7.2.203 Problem: When reloading a buffer or doing anything else with a buffer that is not displayed in a visible window, autocommands may be applied to the current window, folds messed up, etc. Solution: Instead of using the current window for the hidden buffer use a special window, splitting the current one temporarily. Files: src/fileio.c, src/globals.h, src/gui.c, src/if_perl.xs, src/progo/gui.pro, src/proto/window.pro, src/screen.c, src/structs.h, src/window.c Patch 7.2.204 (extra) Problem: Win32: Can't build with Visual Studio 2010 beta 1. Solution: Fix the makefile. (George Reilly) Files: src/Make_mvc.mak Patch 7.2.205 (extra) Problem: Win32: No support for High DPI awareness. Solution: Fix the manifest file. (George Reilly) Files: src/Make_mvc.mak, src/gvim.exe.mnf Patch 7.2.206 Problem: Win32: Can't build netbeans interface with Visual Studio 2010. Solution: Undefine ECONNREFUSED. (George Reilly) Files: src/netbeans.c Patch 7.2.207 Problem: Using freed memory with ":redrawstatus" when it works recursively. Solution: Prevent recursively updating the status line. (partly by Dominique Pelle) Files: src/screen.c Patch 7.2.208 Problem: "set novice" gives an error message, it should be ignored. Solution: Don't see "no" in "novice" as unsetting an option. (Patrick Texier) Files: src/option.c Patch 7.2.209 Problem: For xxd setmode() is undefined on Cygwin. Solution: Include io.h. (Dominique Pelle) Files: src/xxd/xxd.c Patch 7.2.210 Problem: When a file that is being edited has its timestamp updated outside of Vim and ":checktime" is used still get a warning when writing the file. (Matt Mueller) Solution: Store the timestamp in b_mtime_read when the timestamp is the only thing that changed. Files: src/fileio.c Patch 7.2.211 Problem: Memory leak when expanding a series of file names. Solution: Use ga_clear_strings() instead of ga_clear(). Files: src/misc1.c Patch 7.2.212 (extra) Problem: Warnings for redefining SIG macros. Solution: Don't define them if already defined. (Bjorn Winckler) Files: src/os_mac.h Patch 7.2.213 Problem: Warning for using vsprintf(). Solution: Use vim_vsnprintf(). Files: src/netbeans.c Patch 7.2.214 Problem: Crash with complete function for user command. (Andy Wokula) Solution: Avoid using a NULL pointer (Dominique Pelle) Files: src/ex_getln.c Patch 7.2.215 Problem: ml_get error when using ":vimgrep". Solution: Load the memfile for the hidden buffer before putting it in a window. Correct the order of splitting the window and filling the window and buffer with data. Files: src/fileio.c, src/proto/window.pro, src/quickfix.c, src/window.c Patch 7.2.216 Problem: Two error messages have the same number E812. Solution: Give one message a different number. Files: runtime/doc/autocmd.txt, runtime/doc/if_mzsch.txt, src/if_mzsch.c Patch 7.2.217 Problem: Running tests with valgrind doesn't work as advertised. Solution: Fix the line in the Makefile. Files: src/testdir/Makefile Patch 7.2.218 Problem: Cannot build GTK with hangul_input feature. (Dominique Pelle) Solution: Adjust #ifdef. (SungHyun Nam) Files: src/gui.c Patch 7.2.219 (extra) Problem: Photon GUI is outdated. Solution: Updates for QNX 6.4.0. (Sean Boudreau) Files: src/gui_photon.c Patch 7.2.220 (after 7.2.215) Problem: a BufEnter autocommand that changes directory causes problems. (Ajit Thakkar) Solution: Disable autocommands when opening a hidden buffer in a window. Files: src/fileio.c Patch 7.2.221 Problem: X cut_buffer0 text is used as-is, it may be in the wrong encoding. Solution: Convert between 'enc' and latin1. (James Vega) Files: src/gui_gtk_x11.c, src/message.c, src/ops.c, src/proto/ui.pro, src/ui.c Patch 7.2.222 Problem: ":mksession" doesn't work properly with 'acd' set. Solution: Make it work. (Yakov Lerner) Files: src/ex_docmd.c Patch 7.2.223 Problem: When a script is run with ":silent" it is not able to give warning messages. Solution: Add the ":unsilent" command. Files: runtime/doc/various.txt, src/ex_cmds.h, src/ex_docmd.c Patch 7.2.224 Problem: Crash when using 'completefunc'. (Ingo Karkat) Solution: Disallow entering edit() recursively when doing completion. Files: src/edit.c Patch 7.2.225 Problem: When using ":normal" a saved character may be executed. Solution: Also store old_char when saving typeahead. Files: src/getchar.c, src/structs.h Patch 7.2.226 Problem: ml_get error after deleting the last line. (Xavier de Gaye) Solution: When adjusting marks a callback may be invoked. Adjust the cursor position before invoking deleted_lines_mark(). Files: src/ex_cmds.c, src/ex_docmd.c, src/if_mzsch.c, src/if_python.c, src/if_perl.xs, src/misc1.c Patch 7.2.227 Problem: When using ":cd" in a script there is no way to track this. Solution: Display the directory when 'verbose' is 5 or higher. Files: src/ex_docmd.c Patch 7.2.228 Problem: Cscope is limited to 8 connections. Solution: Allocated the connection array to handle any number of connections. (Dominique Pelle) Files: runtime/doc/if_cscop.txt, src/if_cscope.h, src/if_cscope.c Patch 7.2.229 Problem: Warning for shadowed variable. Solution: Rename "wait" to "wait_time". Files: src/os_unix.c Patch 7.2.230 Problem: A few old lint-style ARGUSED comments. Solution: Change to the new UNUSED style. Files: src/getchar.c Patch 7.2.231 Problem: Warning for unreachable code. Solution: Add #ifdef. Files: src/if_perl.xs Patch 7.2.232 Problem: Cannot debug problems with being in a wrong directory. Solution: When 'verbose' is 5 or higher report directory changes. Files: src/os_unix.c, src/os_unix.h, src/proto/os_unix.pro Patch 7.2.233 (extra part of 7.2.232) Problem: Cannot debug problems with being in a wrong directory. Solution: When 'verbose' is 5 or higher report directory changes. Files: src/os_msdos.c, src/os_mswin.c, src/os_riscos.c, src/os_mac.h Patch 7.2.234 Problem: It is not possible to ignore file names without a suffix. Solution: Use an empty entry in 'suffixes' for file names without a dot. Files: runtime/doc/cmdline.txt, src/misc1.c Patch 7.2.235 Problem: Using CTRL-O z= in Insert mode has a delay before redrawing. Solution: Reset msg_didout and msg_scroll. Files: src/misc1.c, src/spell.c Patch 7.2.236 Problem: Mac: Compiling with Ruby doesn't always work. Solution: In configure filter out the --arch argument (Bjorn Winckler) Files: src/configure.in, src/auto/configure Patch 7.2.237 Problem: Crash on exit when window icon not set. Solution: Copy terminal name when using it for the icon name. Files: src/os_unix.c Patch 7.2.238 Problem: Leaking memory when setting term to "builtin_dumb". Solution: Free memory when resetting term option t_Co. Files: src/option.c, src/proto/option.pro, src/term.c Patch 7.2.239 Problem: Using :diffpatch twice or when patching fails causes memory corruption and/or a crash. (Bryan Venteicher) Solution: Detect missing output file. Avoid using non-existing buffer. Files: src/diff.c Patch 7.2.240 Problem: Crash when using find/replace dialog repeatedly. (Michiel Hartsuiker) Solution: Avoid doing the operation while busy or recursively. Also refuse replace when text is locked. Files: src/gui.c Patch 7.2.241 Problem: When using a combination of ":bufdo" and "doautoall" we may end up in the wrong directory. (Ajit Thakkar) Crash when triggering an autocommand in ":vimgrep". (Yukihiro Nakadaira) Solution: Clear w_localdir and globaldir when using the aucmd_win. Use a separate flag to decide aucmd_win needs to be restored. Files: src/fileio.c, src/globals.h, src/structs.h Patch 7.2.242 Problem: Setting 'lazyredraw' causes the cursor column to be recomputed. (Tom Link) Solution: Only recompute the cursor column for a boolean option if changes the cursor position. Files: src/option.c Patch 7.2.243 Problem: Memory leak when using :vimgrep and resizing. (Dominique Pelle) Solution: Free memory for aucmd_win when resizing and don't allocate it twice. Files: src/screen.c Patch 7.2.244 Problem: When 'enc' is utf-8 and 'fenc' is latin1, writing a non-latin1 character gives a conversion error without any hint what is wrong. Solution: When known add the line number to the error message. Files: src/fileio.c Patch 7.2.245 Problem: When 'enc' is "utf-16" and 'fenc' is "utf-8" writing a file does conversion while none should be done. (Yukihiro Nakadaira) When 'fenc' is empty the file is written as utf-8 instead of utf-16. Solution: Do proper comparison of encodings, taking into account that all Unicode values for 'enc' use utf-8 internally. Files: src/fileio.c Patch 7.2.246 Problem: Cscope home page link is wrong. Solution: Update the URL. (Sergey Khorev) Files: runtime/doc/if_cscop.txt Patch 7.2.247 Problem: Mzscheme interface minor problem. Solution: Better error message when build fails. (Sergey Khorev) Files: src/if_mzsch.c Patch 7.2.248 (extra) Problem: Mzscheme interface building minor problems. Solution: Update Win32 makefiles. (Sergey Khorev) Files: src/Make_cyg.mak, src/Make_ming.mak, src/Make_mvc.mak Patch 7.2.249 Problem: The script to check .po files can't handle '%' in plural forms. Solution: Remove "Plural-Forms:" from the checked string. Files: src/po/check.vim Patch 7.2.250 (extra) Problem: Possible buffer overflow. Solution: Compute the remaining space. (Dominique Pelle) Files: src/GvimExt/gvimext.cpp Patch 7.2.251 (after 7.2.044) Problem: Compiler adds invalid memory bounds check. Solution: Remove _FORTIFY_SOURCE=2 from CFLAGS. (Dominique Pelle) Files: src/auto/configure, src/configure.in Patch 7.2.252 Problem: When using a multi-byte 'enc' the 'iskeyword' option cannot contain characters above 128. Solution: Use mb_ptr2char_adv(). Files: src/charset.c Patch 7.2.253 Problem: Netbeans interface: getLength always uses current buffer. Solution: Use ml_get_buf() instead of ml_get(). (Xavier de Gaye) Files: src/netbeans.c Patch 7.2.254 Problem: Compiler warning for assigning size_t to int. Solution: Use size_t for the variable. (George Reilly) Files: src/fileio.c Patch 7.2.255 (after 7.2.242) Problem: Setting 'rightleft', 'linebreak' and 'wrap' may cause cursor to be in wrong place. Solution: Recompute the cursor column for these options. Files: src/option.c Patch 7.2.256 Problem: When 'guifont' was not set GTK font dialog doesn't have a default. (Andreas Metzler) Solution: Set default to DEFAULT_FONT. (James Vega) Files: src/gui_gtk_x11.c Patch 7.2.257 Problem: With GTK 2.17 lots of assertion error messages. Solution: Remove check for static gravity. (Sebastian Droege) Files: src/gui_gtk_f.c Patch 7.2.258 Problem: v:beval_col and b:beval_text are wrong in UTF-8 text. (Tony Mechelynck) Solution: Use byte number instead of character number for the column. Files: src/ui.c Patch 7.2.259 Problem: exists() doesn't work properly for an empty aucmd group. Solution: Change how au_exists() handles a missing pattern. Also add a test for this. (Bob Hiestand) Files: src/fileio.c, src/testdir/Makefile, src/testdir/test67.in, src/testdir/test67.ok Patch 7.2.260 (extra part of 7.2.259) Problem: exists() doesn't work properly for empty aucmd group. Solution: Change how au_exists() handles a missing pattern. Also add a test for this. (Bob Hiestand) Files: src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak, src/testdir/Make_ming.mak, src/testdir/Make_os2.mak, src/testdir/Make_vms.mms Patch 7.2.261 Problem: When deleting lines with a specific folding configuration E38 may appear. (Shahaf) Solution: When adjusting nested folds for deleted lines take into account that they don't start at the top of the enclosing fold. Files: src/fold.c Patch 7.2.262 Problem: When using custom completion for a user command the pattern string goes beyond the cursor position. (Hari Krishna Dara) Solution: Truncate the string at the cursor position. Files: src/ex_getln.c, src/structs.h Patch 7.2.263 Problem: GTK2: when using the -geom argument with an offset from the right edge and the size is smaller than the default, the Vim window is not positioned properly. Solution: Use another function to set the size. (Vitaly Minko) Files: src/gui_gtk_x11.c Patch 7.2.264 Problem: GTK2: When the Vim window is maximized setting 'columns' or 'lines' doesn't work. Solution: Unmaximize the window before setting the size. (Vitaly Minko) Files: src/gui.c, src/gui_gtk_x11.c, src/proto/gui_gtk_x11.pro Patch 7.2.265 Problem: When using ":silent broken" inside try/catch silency may persist. (dr-dr xp) Solution: Set msg_silent when there is an error and it's bigger than the saved value. Files: src/ex_docmd.c Patch 7.2.266 Problem: When an expression abbreviation is triggered, the typed character is unknown. Solution: Make the typed character available in v:char. Files: runtime/doc/map.txt, src/eval.c, src/getchar.c, src/ops.c, src/proto/eval.pro Patch 7.2.267 Problem: Crash for narrow window and double-width character. Solution: Check for zero width. (Taro Muraoka) Files: src/charset.c Patch 7.2.268 Problem: Crash when using Python to set cursor beyond end of line. (winterTTr) Solution: Check the column to be valid. Files: src/if_python.c Patch 7.2.269 Problem: Many people struggle to find out why Vim startup is slow. Solution: Add the --startuptime command line flag. Files: runtime/doc/starting.txt, src/globals.h, src/feature.h, src/main.c, src/macros.h Patch 7.2.270 Problem: Using ":@c" when the c register contains a CR causes the rest to be executed later. (Dexter Douglas) Solution: Don't check for typeahead to start with ':', keep executing commands until all added typeahead has been used. Files: src/ex_docmd.c Patch 7.2.271 Problem: Using freed memory in Motif GUI version when making a choice. Solution: Free memory only after using it. (Dominique Pelle) Files: src/gui_xmdlg.c Patch 7.2.272 Problem: "_.svz" is not recognized as a swap file. (David M. Besonen) Solution: Accept .s[uvw][a-z] as a swap file name extension. Files: src/memline.c Patch 7.2.273 Problem: Crash with redir to unknown array. (Christian Brabandt) Solution: Don't assign the redir result when there was an error. Files: src/eval.c Patch 7.2.274 Problem: Syntax folding doesn't work properly when adding a comment. Solution: Fix it and add a test. (Lech Lorens) Files: src/fold.c, src/testdir/test45.in, src/testdir/test45.ok Patch 7.2.275 Problem: Warning for unused argument and comparing signed and unsigned. Solution: Add type cast. Files: src/memline.c Patch 7.2.276 Problem: Crash when setting 'isprint' to a small bullet. (Raul Coronado) Solution: Check for the character to be < 256. Also make it possible to specify a range of multi-byte characters. (Lech Lorens) Files: src/charset.c Patch 7.2.277 Problem: CTRL-Y in a diff'ed window may move the cursor outside of the window. (Lech Lorens) Solution: Limit the number of filler lines to the height of the window. Don't reset filler lines to zero for an empty buffer. Files: src/move.c Patch 7.2.278 Problem: Using magic number in the folding code. Solution: Use the defined MAX_LEVEL. Files: src/fold.c Patch 7.2.279 Problem: Invalid memory read with visual mode "r". (Dominique Pelle) Solution: Make sure the cursor position is valid. Don't check the cursor position but the position being used. And make sure we get the right line. Files: src/misc2.c, src/ops.c Patch 7.2.280 Problem: A redraw in a custom statusline with %! may cause a crash. (Yukihiro Nakadaira) Solution: Make a copy of 'statusline'. Also fix typo in function name redraw_custom_statusline. (partly by Dominique Pelle) Files: src/screen.c Patch 7.2.281 Problem: 'cursorcolumn' highlighting is wrong in diff mode. Solution: Adjust the column computation. (Lech Lorens) Files: src/screen.c Patch 7.2.282 Problem: A fold can't be closed. Solution: Initialize fd_small to MAYBE. (Lech Lorens) Files: src/fold.c Patch 7.2.283 Problem: Changing font while the window is maximized doesn't keep the window maximized. Solution: Recompute number of lines and columns after changing font. (James Vega) Files: src/gui_gtk_x11.c Patch 7.2.284 Problem: When editing the same buffer in two windows, one with folding, display may be wrong after changes. Solution: Call set_topline() to take care of side effects. (Lech Lorens) Files: src/misc1.c Patch 7.2.285 (after 7.2.169) Problem: CTRL-U in Insert mode also deletes indent. (Andrey Voropaev) Solution: Fix mistake made in patch 7.2.169. Files: src/edit.c Patch 7.2.286 (after 7.2.269) Problem: The "--startuptime=<file>" argument is not consistent with other arguments. Solution: Use "--startuptime <file>". Added the +startuptime feature. Files: runtime/doc/eval.txt, runtime/doc/starting.txt, runtime/doc/various.txt, src/eval.c, src/main.c, src/version.c Patch 7.2.287 Problem: Warning from gcc 3.4 about uninitialized variable. Solution: Move assignment outside of #ifdef. Files: src/if_perl.xs Patch 7.2.288 Problem: Python 2.6 pyconfig.h redefines macros. Solution: Undefine the macros before including pyconfig.h. Files: src/if_python.c Patch 7.2.289 Problem: Checking wrong struct member. Solution: Change tb_buf to tb_noremap. (Dominique Pelle) Files: src/getchar.c Patch 7.2.290 Problem: Not freeing memory from ":lmap", ":xmap" and ":menutranslate". Solution: Free the memory when exiting. (Dominique Pelle) Files: src/misc2.c Patch 7.2.291 Problem: Reading uninitialised memory in arabic mode. Solution: Use utfc_ptr2char_len() rather than utfc_ptr2char(). (Dominique Pelle) Files: src/screen.c Patch 7.2.292 Problem: Block right-shift doesn't work properly with multi-byte encoding and 'list' set. Solution: Add the missing "else". (Lech Lorens) Files: src/ops.c Patch 7.2.293 Problem: When setting 'comments' option it may be used in a wrong way. Solution: Don't increment after skipping over digits. (Yukihiro Nakadaira) Files: src/misc1.c Patch 7.2.294 Problem: When using TEMPDIRS dir name could get too long. Solution: Overwrite tail instead of appending each time. Use mkdtemp() when available. (James Vega) Files: src/auto/configure, src/config.h.in, src/configure.in, src/fileio.c Patch 7.2.295 Problem: When using map() on a List the index is not known. Solution: Set v:key to the index. (Hari Krishna Dara) Files: runtime/doc/eval.txt, src/eval.c Patch 7.2.296 Problem: Help message about startuptime is wrong. (Dominique Pelle) Solution: Remove the equal sign. Files: src/main.c Patch 7.2.297 Problem: Reading freed memory when writing ":reg" output to a register. (Dominique Pelle) Solution: Skip the register being written to. Files: src/ops.c Patch 7.2.298 Problem: ":vimgrep" crashes when there is an autocommand that sets a window-local variable. Solution: Initialize the w: hashtab for re-use. (Yukihiro Nakadaira) Files: src/fileio.c Patch 7.2.299 Problem: Crash when comment middle is longer than start. Solution: Fix size computation. (Lech Lorens) Files: src/misc1.c Patch 7.2.300 Problem: Vim doesn't close file descriptors when forking and executing another command, e.g., ":shell". Solution: Use FD_CLOEXEC when available. (James Vega) Files: auto/configure, src/config.h.in, src/configure.in, src/ex_cmdds2.c, src/fileio.c, src/memfile.c, src/memline.c Patch 7.2.301 Problem: Formatting is wrong when 'tw' is set to a small value. Solution: Fix it and add tests. Also fix behavior of "1" in 'fo'. (Yukihiro Nakadaira) Files: src/edit.c, src/testdir/Makefile, src/testdir/test68.in, src/testdir/test68.ok, src/testdir/test69.in, src/testdir/test69,ok Patch 7.2.302 (extra part of 7.2.301) Problem: Formatting wrong with small 'tw' value. Solution: Add build rules for tests. Files: src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak, src/testdir/Make_ming.mak, src/testdir/Make_os2.mak, src/testdir/Make_vms.mms Patch 7.2.303 (after 7.2.294) Problem: Can't build on MS-Windows. Solution: Add #ifdef around vim_settempdir(). (James Vega) Files: src/fileio.c Patch 7.2.304 Problem: Compiler warning for bad pointer cast. Solution: Use another variable for int pointer. Files: src/ops.c Patch 7.2.305 Problem: Recursively redrawing causes a memory leak. (Dominique Pelle) Solution: Disallow recursive screen updating. Files: src/screen.c Patch 7.2.306 Problem: shellescape("10%%", 1) only escapes first %. (Christian Brabandt) Solution: Don't copy the character after the escaped one. Files: src/misc2.c Patch 7.2.307 Problem: Crash with a very long syntax match statement. (Guy Gur Ari) Solution: When the offset does not fit in the two bytes available give an error instead of continuing with invalid pointers. Files: src/regexp.c Patch 7.2.308 Problem: When using a regexp in the "\=" expression of a substitute command, submatch() returns empty strings for further lines. (Clockwork Jam) Solution: Save and restore the line number and line count when calling reg_getline(). Files: src/regexp.c Patch 7.2.309 (after 7.2.308) Problem: Warning for missing function prototype. (Patrick Texier) Solution: Add the prototype. Files: src/regexp.c Patch 7.2.310 Problem: When a filetype plugin in ~/.vim/ftdetect uses ":setfiletype" and the file starts with a "# comment" it gets "conf" filetype. Solution: Check for "conf" filetype after using ftdetect plugins. Files: runtime/filetype.vim Patch 7.2.311 Problem: Can't compile with FreeMiNT. Solution: Change #ifdef for limits.h. (Alan Hourihane) Files: src/fileio.c Patch 7.2.312 Problem: iconv() returns an invalid character sequence when conversion fails. It should return an empty string. (Yongwei Wu) Solution: Be more strict about invalid characters in the input. Files: src/mbyte.c Patch 7.2.313 Problem: Command line completion doesn't work after "%:h" and similar. Solution: Expand these items before doing the completion. Files: src/ex_getln.c, src/misc1.c, src/proto/misc1.pro Patch 7.2.314 Problem: Missing function in small build. Solution: Always include concat_str. Files: src/misc1.c Patch 7.2.315 Problem: Python libs can't be found on 64 bit system. Solution: Add lib64 to the list of directories. (Michael Henry) Files: src/auto/configure, src/configure.in Patch 7.2.316 Problem: May get multiple _FORTIFY_SOURCE arguments. (Tony Mechelynck) Solution: First remove all these arguments and then add the one we want. (Dominique Pelle) Files: src/auto/configure, src/configure.in Patch 7.2.317 Problem: Memory leak when adding a highlight group with unprintable characters, resulting in E669. Solution: Free the memory. And fix a few typos. (Dominique Pelle) Files: src/syntax.c Patch 7.2.318 Problem: Wrong locale value breaks floating point numbers for gvim. Solution: Set the locale again after doing GUI inits. (Dominique Pelle) Files: src/main.c Patch 7.2.319 Problem: Motif: accessing freed memory when cancelling font dialog. Solution: Destroy the widget only after accessing it. (Dominique Pelle) Files: src/gui_xmdlg.c Patch 7.2.320 Problem: Unused function in Mzscheme interface. Solution: Remove the function and what depends on it. (Dominique Pelle) Files: src/if_mzsch.c, src/proto/if_mzsch.pro Patch 7.2.321 Problem: histadd() and searching with "*" fails to add entry to history when it is empty. Solution: Initialize the history. (Lech Lorens) Files: src/eval.c, src/normal.c Patch 7.2.322 Problem: Wrong indenting in virtual replace mode with CTRL-Y below a short line. Solution: Check for character to be NUL. (suggested by Lech Lorens) Files: src/edit.c Patch 7.2.323 (extra) Problem: Balloon evaluation crashes on Win64. Solution: Change pointer types. (Sergey Khorev) Files: src/gui_w32.c Patch 7.2.324 Problem: A negative column argument in setpos() may cause a crash. Solution: Check for invalid column number. (James Vega) Files: src/eval.c, src/misc2.c Patch 7.2.325 Problem: A stray "w" in the startup vimrc file causes the edited file to be replaced with an empty file. (Stone Kang). Solution: Do not write a buffer when it has never been loaded. Files: src/fileio.c Patch 7.2.326 Problem: Win32: $HOME doesn't work when %HOMEPATH% is not defined. Solution: Use "\" for %HOMEPATH% when it is not defined. Files: src/misc1.c Patch 7.2.327 Problem: Unused functions in Workshop. Solution: Add "#if 0" and minor cleanup. (Dominique Pelle) Files: src/workshop.c, src/integration.c, src/integration.h Patch 7.2.328 Problem: has("win64") does not return 1 on 64 bit MS-Windows version. Solution: Also check for _WIN64 besides WIN64. Files: src/eval.c Patch 7.2.329 Problem: "g_" doesn't position cursor correctly when in Visual mode and 'selection' is "exclusive". (Ben Fritz) Solution: Call adjust_for_sel(). Files: src/normal.c Patch 7.2.330 Problem: Tables for Unicode case operators are outdated. Solution: Add a Vim script for generating the tables. Include tables for Unicode 5.2. Files: runtime/tools/README.txt, runtime/tools/unicode.vim, src/mbyte.c Patch 7.2.331 Problem: Can't interrupt "echo list" for a very long list. Solution: Call line_breakcheck() in list_join(). Files: src/eval.c Patch 7.2.332 Problem: Crash when spell correcting triggers an autocommand that reloads the buffer. Solution: Make a copy of the line to be modified. (Dominique Pelle) Files: src/spell.c Patch 7.2.333 Problem: Warnings from static code analysis. Solution: Small changes to various lines. (Dominique Pelle) Files: src/buffer.c, src/edit.c, src/ex_getln.c, src/fileio.c, src/if_cscope.c, src/netbeans.c, src/ops.c, src/quickfix.c, src/syntax.c, src/ui.c Patch 7.2.334 Problem: Postponing keys in Netbeans interface does not work properly. Solution: Store the key string instead of the number. Avoid an infinite loop. (Mostly by Xavier de Gaye) Files: src/netbeans.c, src/proto/netbeans.pro Patch 7.2.335 Problem: The CTRL-] command escapes too many characters. Solution: Use a different list of characters to be escaped. (Sergey Khorev) Files: src/normal.c Patch 7.2.336 Problem: MzScheme interface can't evaluate an expression. Solution: Add mzeval(). (Sergey Khorev) Files: runtime/doc/eval.txt, runtime/doc/if_mzsch.txt, runtime/doc/usr_41.txt, src/eval.c, src/if_mzsch.c, src/proto/eval.pro, src/proto/if_mzsch.pro, src/testdir/Make_dos.mak, src/testdir/Make_ming.mak, src/testdir/Makefile, src/testdir/main.aap, src/testdir/test1.in, src/testdir/test70.in, src/testdir/test70.ok Patch 7.2.337 Problem: The :compiler command doesn't function properly when invoked in a function. Solution: Add "g:" before "current_compiler". (Yukihiro Nakadaira) Files: src/ex_cmds2.c Patch 7.2.338 (after 7.2.300) Problem: Part of FD_CLOEXEC change is missing. Solution: Include source file skipped because of typo. Files: src/ex_cmds2.c Patch 7.2.339 (after 7.2.269) Problem: Part of --startuptime patch is missing. Solution: Add check for time_fd. Files: src/ex_cmds2.c Patch 7.2.340 Problem: Gcc warning for condition that can never be true. (James Vega) Solution: Use start_lvl instead flp->lvl. Files: src/fold.c Patch 7.2.341 Problem: Popup menu wraps to next line when double-wide character doesn't fit. (Jiang Ma) Solution: Display a ">" instead. (Dominique Pelle) Files: src/screen.c Patch 7.2.342 Problem: Popup menu displayed wrong in 'rightleft' mode when there are multi-byte characters. Solution: Adjust the column computations. (Dominique Pelle) Files: src/popupmnu.c Patch 7.2.343 (after 7.2.338) Problem: Can't compile on Win32. Solution: Insert the missing '|'. Files: src/ex_cmds2.c Patch 7.2.344 (after 7.2.343) Problem: Can't compile on some systems Solution: Move the #ifdef outside of the mch_open macro. (Patrick Texier) Files: src/ex_cmds2.c Patch 7.2.345 Problem: Tab line is not updated when the value of 'bt' is changed. Solution: Call redraw_titles(). (Lech Lorens) Files: src/option.c Patch 7.2.346 Problem: Repeating a command with @: causes a mapping to be applied twice. Solution: Do not remap characters inserted in the typeahead buffer. (Kana Natsuno) Files: src/ops.c Patch 7.2.347 Problem: Crash when executing <expr> mapping redefines that same mapping. Solution: Save the values used before evaluating the expression. Files: src/getchar.c Patch 7.2.348 (after 7.2.330) Problem: Unicode double-width characters are not up-to date. Solution: Produce the double-width table like the others. Files: runtime/tools/unicode.vim, src/mbyte.c Patch 7.2.349 Problem: CTRL-W gf doesn't put the new tab in the same place as "tab split" and "gf". (Tony Mechelynck) Solution: Store the tab number in cmdmod.tab. Files: src/window.c Patch 7.2.350 Problem: Win32: When changing font the window may jump from the secondary to the primary screen. (Michael Wookey) Solution: When the screen position was negative don't correct it to zero. Files: src/gui.c Patch 7.2.351 (after 7.2.347) Problem: Can't build with some compilers. Solution: Move the #ifdef outside of a macro. Cleanup the code. Files: src/getchar.c Patch 7.2.352 (extra) Problem: Win64: Vim doesn't work when cross-compiled with MingW libraries. Solution: Always return TRUE for the WM_NCCREATE message. (Andy Kittner) Files: src/gui_w48.c Patch 7.2.353 Problem: No command line completion for ":profile". Solution: Complete the subcommand and file name. Files: src/ex_docmd.c, src/ex_cmds2.c, src/ex_getln.c, src/proto/ex_cmds2.pro, src/vim.h Patch 7.2.354 Problem: Japanese single-width double-byte characters not handled correctly. Solution: Put 0x8e in ScreenLines[] and the second byte in ScreenLines2[]. (partly by Kikuchan) Files: src/screen.c Patch 7.2.355 Problem: Computing the cursor column in validate_cursor_col() is wrong when line numbers are used and 'n' is not in 'cpoptions', causing the popup menu to be positioned wrong. Solution: Correctly use the offset. (partly by Dominique Pelle) Files: src/move.c Patch 7.2.356 Problem: When 'foldmethod' is changed not all folds are closed as expected. Solution: In foldUpdate() correct the start position and reset fd_flags when w_foldinvalid is set. (Lech Lorens) Files: src/fold.c Patch 7.2.357 Problem: When changing 'fileformat' from/to "mac" and there is a CR in the text the display is wrong. Solution: Redraw the text when 'fileformat' is changed. (Ben Schmidt) Files: src/option.c Patch 7.2.358 Problem: Compiler warnings on VMS. (Zoltan Arpadffy) Solution: Pass array itself instead its address. Return a value. Files: src/gui_gtk_x11.c, src/os_unix.c Patch 7.2.359 Problem: Crash when using the Netbeans join command. Solution: Make sure the ml_flush_line() function is not used recursively. (Xavier de Gaye) Files: src/memline.c Patch 7.2.360 Problem: Ruby on MS-Windows: can't use sockets. Solution: Call NtInitialize() during initialization. (Ariya Mizutani) Files: src/if_ruby.c Patch 7.2.361 Problem: Ruby 1.9 is not supported. Solution: Add Ruby 1.9 support. (Masaki Suketa) Files: src/Makefile, src/auto/configure, src/configure.in, src/if_ruby.c Patch 7.2.362 (extra, after 7.2.352) Problem: Win64: Vim doesn't work when cross-compiled with MingW libraries. Solution: Instead of handling WM_NCCREATE, create wide text area window class if the parent window iw side. (Sergey Khorev) Files: src/gui_w32.c, src/gui_w48.c Patch 7.2.363 Problem: Can't dynamically load Perl 5.10. Solution: Add the function Perl_croak_xs_usage. (Sergey Khorev) Files: src/if_perl.xs Patch 7.2.364 (extra) Problem: Can't build gvimext.dll on Win 7 x64 using MinGW (John Marriott) Solution: Check if _MSC_VER is defined. (Andy Kittner) Files: src/GvimExt/gvimext.h Patch 7.2.365 (extra) Problem: MS-Windows with MingW: "File->Save As" does not work. (John Marriott) Solution: Correctly fill in structure size. (Andy Kittner) Files: src/gui_w48.c Patch 7.2.366 Problem: CTRL-B doesn't go back to the first line of the buffer. Solution: Avoid an overflow when adding MAXCOL. Files: src/move.c Patch 7.2.367 Problem: "xxd -r -p" doesn't work as documented. Solution: Skip white space. (James Vega) Files: src/xxd/xxd.c Patch 7.2.368 (after 7.2.361) Problem: Ruby interface: Appending line doesn't work. (Michael Henry) Solution: Reverse check for NULL line. (James Vega) Files: src/if_ruby.c Patch 7.2.369 Problem: Error message is not easy to understand. Solution: Add quotes. (SungHyun Nam) Files: src/ex_cmds2.c Patch 7.2.370 (after 7.2.356) Problem: A redraw may cause folds to be closed. Solution: Revert part of the previous patch. Add a test. (Lech Lorens) Files: src/diff.c, src/fold.c, src/option.c, src/testdir/test45.in, src/testdir/test45.ok Patch 7.2.371 Problem: Build problems on Tandem NonStop. Solution: A few changes to #ifdefs (Joachim Schmitz) Files: src/auto/configure, src/configure.in, src/config.h.in, src/vim.h, src/if_cscope.c, src/osdef1.h.in, src/tag.c Patch 7.2.372 (extra) Problem: Cross-compiling GvimExt and xxd doesn't work. Solution: Change the build files. (Markus Heidelberg) Files: src/INSTALLpc.txt, src/GvimExt/Make_ming.mak, src/Make_cyg.mak, src/Make_ming.mak, src/xxd/Make_cyg.mak Patch 7.2.373 Problem: Gcc 4.5 adds more error messages. (Chris Indy) Solution: Update default 'errorformat'. Files: src/option.h Patch 7.2.374 Problem: Ruby eval() doesn't understand Vim types. Solution: Add the vim_to_ruby() function. (George Gensure) Files: src/eval.c, src/if_ruby.c Patch 7.2.375 Problem: ml_get errors when using ":bprevious" in a BufEnter autocmd. (Dominique Pelle) Solution: Clear w_valid when entering another buffer. Files: src/buffer.c Patch 7.2.376 Problem: ml_get error when using SiSU syntax. (Nathan Thomas) Solution: If the match ends below the last line move it to the end of the last line. Files: src/syntax.c Patch 7.2.377 (extra, after 7.2.372) Problem: Misplaced assignment. Duplicate build line for gvimext.dll. Solution: Move setting CROSS_COMPILE to before ifneq. Remove the wrong build line. (Markus Heidelberg) Files: src/Make_ming.mak Patch 7.2.378 Problem: C function declaration indented too much. (Rui) Solution: Don't see a line containing { or } as a type. (Matt Wozniski) Files: src/misc1.c Patch 7.2.379 Problem: 'eventignore' is set to an invalid value inside ":doau". (Antony Scriven) Solution: Don't include the leading comma when the option was empty. Files: src/fileio.c Patch 7.2.380 (after 7.2.363) Problem: Perl interface builds with 5.10.1 but not with 5.10.0. Solution: Change the #ifdefs. (Sergey Khorev) Files: src/if_perl.xs Patch 7.2.381 Problem: No completion for :behave. Solution: Add :behave completion. Minor related fixes. (Dominique Pelle) Files: src/ex_docmd.c, src/ex_getln.c, src/proto/ex_docmd.pro, src/vim.h Patch 7.2.382 Problem: Accessing freed memory when closing the cmdline window when 'bufhide' is set to "wipe". Solution: Check if the buffer still exists before invoking close_buffer() (Dominique Pelle) Files: src/ex_getln.c Patch 7.2.383 Problem: Vim doesn't build cleanly with MSVC 2010. Solution: Change a few types. (George Reilly) Files: src/ex_cmds2.c, src/if_python.c, src/syntax.c Patch 7.2.384 (extra) Problem: Vim doesn't build properly with MSVC 2010. Solution: Add the nmake version to the build file. (George Reilly) Files: src/Make_mvc.mak, src/testdir/Make_dos.mak Patch 7.2.385 Problem: When in the command line window dragging status line only works for last-but-one window. (Jean Johner) Solution: Remove the code that disallows this. Files: src/ui.c Patch 7.2.386 Problem: Focus hack for KDE 3.1 causes problems for other window managers. Solution: Remove the hack. (forwarded by Joel Bradshaw) Files: src/gui_gtk.c Patch 7.2.387 Problem: Ruby with MingW still doesn't build all versions. Solution: More #ifdefs for the Ruby code. (Sergey Khorev) Files: src/if_ruby.c Patch 7.2.388 (extra part of 7.2.387) Problem: Ruby with MingW still doesn't build all versions. Solution: Different approach to build file. (Sergey Khorev) Files: src/Make_ming.mak Patch 7.2.389 Problem: synIDattr() cannot return the font. Solution: Support the "font" argument. (Christian Brabandt) Files: runtime/doc/eval.txt, src/eval.c, src/syntax.c Patch 7.2.390 Problem: In some situations the popup menu can be displayed wrong. Solution: Remove the popup menu if the cursor moved. (Lech Lorens) Files: src/edit.c Patch 7.2.391 Problem: Internal alloc(0) error when doing "CTRL-V $ c". (Martti Kuparinen) Solution: Fix computations in getvcol(). (partly by Lech Lorens) Files: src/charset.c, src/memline.c Patch 7.2.392 Problem: Netbeans hangs reading from a socket at the maximum block size. Solution: Use select() or poll(). (Xavier de Gaye) Files: src/vim.h, src/os_unixx.h, src/if_xcmdsrv.c, src/netbeans.c Patch 7.2.393 Problem: Mac: Can't build with different Xcode developer tools directory. Solution: make "Developer" directory name configurable. (Rainer Muller) Files: src/configure.in, src/auto/configure Patch 7.2.394 Problem: .lzma and .xz files are not supported. Solution: Recognize .lzma and .xz files so that they can be edited. Files: runtime/plugin/gzip.vim Patch 7.2.395 Problem: In help CTRL=] on g?g? escapes the ?, causing it to fail. (Tony Mechelynck) Solution: Don't escape ? for a help command. (Sergey Khorev) Files: src/normal.c Patch 7.2.396 Problem: Get E38 errors. (Dasn) Solution: Set cursor to line 1 instead of 0. (Dominique Pelle) Files: src/popupmnu.c Patch 7.2.397 Problem: Redundant check for w_lines_valid. Solution: Remove the if. (Lech Lorens) Files: src/fold.c Patch 7.2.398 Problem: When moving windows the cursor ends up in the wrong line. Solution: Set the window width and height properly. (Lech Lorens) Files: src/window.c Patch 7.2.399 (extra, after 7.2.388) Problem: Cannot compile on MingW. Solution: Move ifneq to separate line. (Vlad Sandrini, Dominique Pelle) Files: src/Make_ming.mak Patch 7.2.400 (after 7.2.387) Problem: Dynamic Ruby is not initialised properly for version 1.9.1. Ruby cannot create strings from NULL. Solution: Cleanup #ifdefs. Handle NULL like an empty string. Add ruby_init_stack. (Sergey Khorev) Files: src/if_ruby.c Patch 7.2.401 Problem: ":e dir<Tab>" with 'wildmode' set to "list" doesn't highlight directory names with a space. (Alexandre Provencio) Solution: Remove the backslash before checking if the name is a directory. (Dominique Pelle) Files: src/ex_getln.c Patch 7.2.402 Problem: This gives a #705 error: let X = function('haslocaldir') let X = function('getcwd') Solution: Don't give E705 when the name is found in the hashtab. (Sergey Khorev) Files: src/eval.c Patch 7.2.403 (after 7.2.400) Problem: Compiler warning for pointer type. (Tony Mechelynck) Solution: Move type cast to the right place. Files: src/if_ruby.c Patch 7.2.404 Problem: Pointers for composing characters are not properly initialized. Solution: Compute the size of the pointer, not what it points to. (Yukihiro Nakadaira) Files: src/screen.c Patch 7.2.405 Problem: When built with small features the matching text is not highlighted for ":s/pat/repl/c". Solution: Remove the #ifdef for IncSearch. (James Vega) Files: src/syntax.c Patch 7.2.406 Problem: Patch 7.2.119 introduces uninit mem read. (Dominique Pelle) Solution: Only used ScreeenLinesC when ScreeenLinesUC is not zero. (Yukihiro Nakadaira) Also clear ScreeenLinesC when allocating. Files: src/screen.c Patch 7.2.407 Problem: When using an expression in ":s" backslashes in the result are dropped. (Sergey Goldgaber, Christian Brabandt) Solution: Double backslashes. Files: src/regexp.c Patch 7.2.408 Problem: With ":g/the/s/foo/bar/" the '[ and '] marks can be set to a line that was not changed. Solution: Only set '[ and '] marks when a substitution was done. Files: src/ex_cmds.c Patch 7.2.409 Problem: Summary of number of substitutes is incorrect for ":folddo". (Jean Johner) Solution: Reset sub_nsubs and sub_nlines in global_exe(). Files: src/ex_cmds.c Patch 7.2.410 Problem: Highlighting directories for completion doesn't work properly. Solution: Don't halve backslashes when not needed, expanded "~/". (Dominique Pelle) Files: src/ex_getln.c Patch 7.2.411 Problem: When parsing 'cino' a comma isn't skipped properly. Solution: Skip the comma. (Lech Lorens) Files: src/misc1.c Patch 7.2.412 Problem: [ or ] followed by mouse click doesn't work. Solution: Reverse check for key being a mouse event. (Dominique Pelle) Files: src/normal.c Patch 7.2.413 Problem: Large file support is incorrect. Solution: Add AC_SYS_LARGEFILE to configure. (James Vega) Files: src/configure.in, src/config.h.in, src/auto/configure Patch 7.2.414 Problem: CTRK-K <space> <space> does not produce 0xa0 as expected. (Tony Mechelynck) Solution: Remove the Unicode range 0xe000 - 0xefff from digraphs, these are not valid characters. Files: src/digraph.c Patch 7.2.415 Problem: Win32: Can't open a remote file when starting Vim. Solution: Don't invoke cygwin_conv_path() for URLs. (Tomoya Adachi) Files: src/main.c Patch 7.2.416 Problem: Logtalk.dict is not installed. Solution: Add it to the install target. (Markus Heidelberg) Files: src/Makefile Patch 7.2.417 Problem: When 'shell' has an argument with a slash then 'shellpipe' is not set properly. (Britton Kerin) Solution: Assume there are no spaces in the path, arguments follow. Files: src/option.c Patch 7.2.418 Problem: Vim tries to set the background or foreground color in a terminal to -1. (Graywh) Happens with ":hi Normal ctermbg=NONE". Solution: When resetting the foreground or background color don't set the color, let the clear screen code do that. Files: src/syntax.c Patch 7.2.419 Problem: Memory leak in Motif when clicking on "Search Vim Help". Solution: Free string returned by XmTextGetString(). (Dominique Pelle) Files: src/gui_motif.c Patch 7.2.420 Problem: ":argedit" does not accept "++enc=utf8" as documented. (Dominique Pelle) Solution: Add the ARGOPT flag to ":argedit". Files: src/ex_cmds.h Patch 7.2.421 Problem: Folds are sometimes not updated properly and there is no way to force an update. Solution: Make "zx" and "zX" recompute folds (suggested by Christian Brabandt) Files: src/normal.c Patch 7.2.422 Problem: May get E763 when using spell dictionaries. Solution: Avoid utf-8 case folded character to be truncated to 8 bits and differ from latin1. (Dominique Pelle) Files: src/spell.c Patch 7.2.423 Problem: Crash when assigning s: to variable. (Yukihiro Nakadaira) Solution: Make ga_scripts contain pointer to scriptvar_T instead of scriptvar_T itself. (Dominique Pelle) Files: src/eval.c Patch 7.2.424 Problem: ":colorscheme" without an argument doesn't do anything. Solution: Make it echo the current color scheme name. (partly by Christian Brabandt) Files: runtime/doc/syntax.txt, src/ex_cmds.h, src/ex_docmd.c Patch 7.2.425 Problem: Some compilers complain about fourth EX() argument. Solution: Add cast to long_u. Files: src/ex_cmds.h Patch 7.2.426 Problem: Commas in 'langmap' are not always handled correctly. Solution: Require commas to be backslash escaped. (James Vega) Files: src/option.c Patch 7.2.427 Problem: The swapfile is created using the destination of a symlink, but recovery doesn't follow symlinks. Solution: When recovering, resolve symlinks. (James Vega) Files: src/memline.c Patch 7.2.428 Problem: Using setqflist([]) to clear the error list doesn't work properly. Solution: Set qf_nonevalid to TRUE when appropriate. (Christian Brabandt) Files: src/quickfix.c Patch 7.2.429 Problem: A file that exists but access is denied may result in a "new file" message. E.g. when its directory is unreadable. Solution: Specifically check for ENOENT to decide a file doesn't exist. (partly by James Vega) Files: src/fileio.c Patch 7.2.430 Problem: The ++bad argument is handled wrong, resulting in an invalid memory access. Solution: Use the bad_char field only for the replacement character, add bad_char_idx to store the position. (Dominique Pelle) Files: src/eval.c, src/ex_cmds.h, src/ex_docmd.c Patch 7.2.431 Problem: ":amenu" moves the cursor when in Insert mode. Solution: Use CTRL-\ CTRL-O instead of CTRL-O. (Christian Brabandt) Files: src/menu.c Patch 7.2.432 Problem: When menus are translated they can only be found by the translated name. That makes ":emenu" difficult to use. Solution: Store the untranslated name and use it for completion and :emenu. (Liang Peng (Bezetek James), Edward L. Fox) Files: src/menu.c, src/structs.h Patch 7.2.433 Problem: Can't use cscope with QuickFixCmdPre and QuickFixCmdPost. Solution: Add cscope support for these autocmd events. (Bryan Venteicher) Files: runtime/doc/autocmd.txt, src/if_cscope.c Patch 7.2.434 (after 7.2.432) Problem: Compilation fails without the multi-lang feature. Solution: Add #ifdefs. (John Marriott) Files: src/menu.c Patch 7.2.435 (after 7.2.430) Problem: Crash when using bad_char_idx uninitialized. (Patrick Texier) Solution: Don't use bad_char_idx, reproduce the ++bad argument from bad_char. Files: src/eval.c, src/ex_cmds.h, src/ex_docmd.c Patch 7.2.436 Problem: Reproducible crash in syntax HL. (George Reilly, Dominique Pelle) Solution: Make sst_stacksize an int instead of short. (Dominique Pelle) Files: src/structs.h Patch 7.2.437 (after 7.2.407) Problem: When "\\\n" appears in the expression result the \n doesn't result in a line break. (Andy Wokula) Solution: Also replace a \n after a backslash into \r. Files: src/regexp.c Patch 7.2.438 (after 7.2.427) Problem: "vim -r" crashes. Solution: Don't use NULL pointer argument. Files: src/memline.c Patch 7.2.439 Problem: Invalid memory access when doing thesaurus completion and 'infercase' is set. Solution: Use the minimal length of completed word and replacement. (Dominique Pelle) Files: src/edit.c Patch 7.2.440 Problem: Calling a function through a funcref, where the function deletes the funcref, leads to an invalid memory access. Solution: Make a copy of the function name. (Lech Lorens) Files: src/eval.c, src/testdir/test34.in, src/testdir/test34.ok Patch 7.2.441 Problem: When using ":earlier" undo information may be wrong. Solution: When changing alternate branches also adjust b_u_oldhead. Files: src/undo.c Patch 7.2.442 (after 7.2.201) Problem: Copy/paste with OpenOffice doesn't work. Solution: Do not offer the HTML target when it is not supported. (James Vega) Files: src/gui_gtk_x11.c, src/option.c, src/proto/gui_gtk_x11.pro Patch 7.2.443 Problem: Using taglist() on a tag file with duplicate fields generates an internal error. (Peter Odding) Solution: Check for duplicate field names. Files: src/eval.c, src/proto/eval.pro, src/tag.c Patch 7.2.444 (after 7.2.442) Problem: Can't build with GTK 1, gtk_selection_clear_targets() is not available. (Patrick Texier) Solution: Don't change the targets for GTK 1, set them once. Files: src/gui_gtk_x11.c, src/option.c Patch 7.2.445 Problem: Crash when using undo/redo and a FileChangedRO autocmd event that reloads the buffer. (Dominique Pelle) Solution: Do not allow autocommands while performing and undo or redo. Files: src/misc1.c, src/undo.c Patch 7.2.446 Problem: Crash in GUI when closing the last window in a tabpage. (ryo7000) Solution: Remove the tabpage from the list before freeing the window. Files: src/window.c When writing a file, switching tab pages and selecting a word the file write message would be displayed again. This happened in Insert mode and with 'cmdheight' set to 2. When using ":lang" to set a locale that uses a comma for decimal separator and using GTK floating point numbers stop working. Use gtk_disable_setlocale(). (James Vega) "g8" didn't produce the right value on a NUL. (Dominique Pelle) Use BASEMODLIBS instead of MODLIBS for Python configuration to pick up the right compiler flags. (Michael Bienia) Window title was not updated after dropping a file on Vim. (Hari G) synstack() did not return anything when just past the end of the line. Useful when using the cursor position in Insert mode. When entering a digraph or special character after a line that fits the window the '?' or '^' on the next line is not redrawn. (Ian Kelling) Composing characters in |:s| substitute text were dropped. |exists()| was causing an autoload script to be loaded. Filter out -pthread for cproto. Make CTRL-L in command line mode respect 'ignorecase' and 'smartcase'. (Martin Toft) Spell menu moved the cursor, causing Copy not to work. Spell replacement didn't work in 'compatible' mode. Various small fixes from Dominique Pelle. Fix that :mksession may generate "2argu" even though there is no such argument. (Peter Odding) Fixes for time in clipboard request. Also fix ownership. (David Fries) Fixed completion of file names with '%' and '*'. Fixed MSVC makefile use of /Wp64 flag. Correct use of long instead of off_t for file size. (James Vega) Add a few #ifdefs to exclude functions that are not used. (Dominique Pelle) Remove old and unused method to allocate memory for undo. Fix definition of UINT_PTR for 64 bit systems. Some versions of Ruby redefine rb_str_new2 to rb_str_new_cstr. Window title not updated after file dropped. Fixed crash for ":find" completion, might also happen in other path expansion usage. When 'searchhl' causes a hang make CTRL-C disable 'searchhl'. When resetting both 'title' and 'icon' the title would be set after a shell command. Reset 'title' and 'icon' in test47 to avoid the xterm title getting messed up. Fix for compiler warning about function prototype in pty.c. Added 'window' to the options window. Fixed: errors for allocating zero bytes when profiling an empty function. Remove -arch flag from build flags for Perl. (Bjorn Wickler) Fix 'autochdir' not showing up in :options window. (Dominique Pelle) Fix: test 69 didn't work on MS-Windows. Test 72 beeped too often. Avoid illegal memory access in spell suggestion. (Dominique Pelle) Fix: crash in spell checking with a 0x300 character. Avoid that running tests changes viminfo. Fix: changing case of a character removed combining characters. Fixed: CTRL-R in Insert mode doesn't insert composing characters. Added the WOW64 flag to OLE registration, for 64 bit Windows systems. Various fixes for coverity warnings. Fix compile warnings, esp. for 64-bit systems. (Mike Williams) Fix: :redir to a dictionary that is changed before ":redir END" causes a memory access error. Fix: terminal title not properly restored when there are multi-byte characters. (partly by James Vega) Set 'wrapscan' when checking the .po files. (Mike Williams) Win32: Put quotes around the gvim.exe path for the "Open with" menu entry. On MS-Windows sometimes files with number 4913 or higher are left behind. 'suffixesadd' was used for finding tags file. Removed unused code. Improved positioning of combining characters in GTK. Made test 11 pass when there is no gzip program. (John Beckett) Changed readfile() to ignore byte order marks, unless in binary mode. On MS-Windows completion of shell commands didn't work. An unprintable multi-byte character at the start of the screen line caused the following text to be drawn at the wrong position. Got ml_get errors when using undo with 'virtualedit'. Call gui_mch_update() before triggering GuiEnter autocmd. (Ron Aaron) Unix "make install" installed a few Amiga .info files. Disallow setting 'ambiwidth' to "double" when 'listchars' or 'fillchars' contains a character that would become double width. Set 'wrapscan' when checking the .po files. (Mike Williams) Fixed: using expression in command line may cause a crash. Avoid warnings from the clang compiler. (Dominique Pelle) Fix: Include wchar.h in charset.c for towupper(). Fixed: Using ":read file" in an empty buffer when 'compatible' is set caused an error. Was caused by patch 7.2.132. Make the references to features in the help more consistent. (Sylvain Hitier) ============================================================================== VERSION 7.4 *version-7.4* *version7.4* This section is about improvements made between version 7.3 and 7.4. This release has hundreds of bug fixes and there are a few new features. The most notable new features are: - New regexp engine |new-regexp-engine| - A more pythonic Python interface |better-python-interface| New regexp engine *new-regexp-engine* ----------------- What is now called the "old" regexp engine uses a backtracking algorithm. It tries to match the pattern with the text in one way, and when that fails it goes back and tries another way. This works fine for simple patterns, but complex patterns can be very slow on longer text. The new engine uses a state machine. It tries all possible alternatives at the current character and stores the possible states of the pattern. This is a bit slower for simple patterns, but much faster for complex patterns and long text. Most notably, syntax highlighting for Javascript and XML files with long lines is now working fine. Previously Vim could get stuck. More information here: |two-engines| Better Python interface *better-python-interface* ----------------------- Added |python-bindeval| function. Unlike |python-eval| this one returns |python-Dictionary|, |python-List| and |python-Function| objects for dictionaries lists and functions respectively in place of their Python built-in equivalents (or None if we are talking about function references). For simple types this function returns Python built-in types and not only Python `str()` like |python-eval| does. On Python 3 it will return `bytes()` objects in place of `str()` ones avoiding possibility of UnicodeDecodeError. Interface of new objects mimics standard Python `dict()` and `list()` interfaces to some extent. Extent will be improved in the future. Added special |python-vars| objects also available for |python-buffer| and |python-window|. They ease access to VimL variables from Python. Now you no longer need to alter `sys.path` to import your module: special hooks are responsible for importing from {rtp}/python2, {rtp}/python3 and {rtp}/pythonx directories (for Python 2, Python 3 and both respectively). See |python-special-path|. Added possibility to work with |tabpage|s through |python-tabpage| object. Added automatic conversion of Vim errors and exceptions to Python exceptions. Changed the behavior of the |python-buffers| object: it now uses buffer numbers as keys in place of the index of the buffer in the internal buffer list. This should not break anything as the only way to get this index was iterating over |python-buffers|. Added |:pydo| and |:py3do| commands. Added the |pyeval()| and |py3eval()| functions. Now in all places which previously accepted `str()` objects, `str()` and `unicode()` (Python 2) or `bytes()` and `str()` (Python 3) are accepted. |python-window| has gained `.col` and `.row` attributes that are currently the only way to get internal window positions. Added or fixed support for `dir()` in Vim Python objects. Changed *changed-7.4* ------- Old Python versions (≤2.2) are no longer supported. Building with them did not work anyway. Options: Added ability to automatically save the selection into the system clipboard when using non-GUI version of Vim (autoselectplus in 'clipboard'). Also added ability to use the system clipboard as default register (previously only primary selection could be used). (Ivan Krasilnikov, Christian Brabandt, Bram Moolenaar) Added a special 'shiftwidth' value that makes 'sw' follow 'tabstop'. As indenting via 'indentexpr' became tricky |shiftwidth()| function was added. Also added equivalent special value to 'softtabstop' option. (Christian Brabandt, so8res) Show absolute number in number column when 'relativenumber' option is on. Now there are four combinations with 'number' and 'relativenumber'. (Christian Brabandt) Commands: |:diffoff| now saves the local values of some settings and restores them in place of blindly resetting them to the defaults. (Christian Brabandt) Other: Lua interface now also uses userdata binded to Vim structures. (Taro Muraoka, Luis Carvalho) glob() and autocommand patterns used to work with the undocumented "\{n,m\}" item from a regexp. "\{" is now used for a literal "{", as this is normal in shell file patterns. Now used "\\\{n,m\}" to get "\{n,m}" in the regexp pattern. Added *added-7.4* ----- Various syntax, indent and other plugins were added. Added support for |Lists| and |Dictionaries| in |viminfo|. (Christian Brabandt) Functions: Bitwise functions: |and()|, |or()|, |invert()|, |xor()|. Added |luaeval()| function. (Taro Muraoka, Luis Carvalho) Added |sha256()| function. (Tyru, Hirohito Higashi) Added |wildmenumode()| function. (Christian Brabandt) Debugging functions: |screenattr()|, |screenchar()|, |screencol()|, |screenrow()|. (Simon Ruderich, Bram Moolenaar) Added ability to use |Dictionary-function|s for |sort()|ing, via optional third argument. (Nikolay Pavlov) Added special |expand()| argument that expands to the current line number. Made it possible to force |char2nr()| to always give unicode codepoints regardless of current encoding. (Yasuhiro Matsumoto) Made it possible for functions generating file list generate |List| and not NL-separated string. (e.g. |glob()|, |expand()|) (Christian Brabandt) Functions that obtain variables from the specific window, tabpage or buffer scope dictionary can now return specified default value in place of empty string in case variable is not found. (|gettabvar()|, |getwinvar()|, |getbufvar()|) (Shougo Matsushita, Hirohito Higashi) Autocommands: Added |InsertCharPre| event launched before inserting character. (Jakson A. Aquino) Added |CompleteDone| event launched after finishing completion in insert mode. (idea by Florian Klein) Added |QuitPre| event launched when commands that can either close Vim or only some window(s) are launched. Added |TextChanged| and |TextChangedI| events launched when text is changed. Commands: |:syntime| command useful for debugging. Made it possible to remove all signs from the current buffer using |:sign-unplace|. (Christian Brabandt) Added |:language| autocompletion. (Dominique Pelle) Added more |:command-complete| completion types: |:behave| suboptions, color schemes, compilers, |:cscope| suboptions, files from 'path', |:history| suboptions, locale names, |:syntime| suboptions, user names. (Dominique Pelle) Added |:map-nowait| creating mapping which when having lhs that is the prefix of another mapping’s lhs will not allow Vim to wait for user to type more characters to resolve ambiguity, forcing Vim to take the shorter alternative: one with <nowait>. Options: Made it possible to ignore case when completing: 'wildignorecase'. Added ability to delete comment leader when using |J| by `j` flag in 'formatoptions' (|fo-table|). (Lech Lorens) Added ability to control indentation inside namespaces: |cino-N|. (Konstantin Lepa) Added ability to control alignment inside `if` condition separately from alignment inside function arguments: |cino-k|. (Lech Lorens) Other: Improved support for cmd.exe. (Ben Fritz, Bram Moolenaar) Added |v:windowid| variable containing current window number in GUI Vim. (Christian J. Robinson, Lech Lorens) Added rxvt-unicode and SGR mouse support. (Yiding Jia, Hayaki Saito) All changes in 7.4 *fixed-7.4* ------------------ Patch 7.3.001 Problem: When editing "src/main.c" and 'path' set to "./proto", ":find e<C-D" shows ./proto/eval.pro instead of eval.pro. Solution: Check for path separator when comparing names. (Nazri Ramliy) Files: src/misc1.c Patch 7.3.002 Problem: ":find" completion doesn't work when halfway an environment variable. (Dominique Pelle) Solution: Only use in-path completion when expanding file names. (Nazri Ramliy) Files: src/ex_docmd.c Patch 7.3.003 Problem: Crash with specific BufWritePost autocmd. (Peter Odding) Solution: Don't free the quickfix title twice. (Lech Lorens) Files: src/quickfix.c Patch 7.3.004 Problem: Crash when using very long regexp. (Peter Odding) Solution: Reset reg_toolong. (Carlo Teubner) Files: src/regexp.c Patch 7.3.005 Problem: Crash when using undotree(). (Christian Brabandt) Solution: Increase the list reference count. Add a test for undotree() (Lech Lorens) Files: src/eval.c, src/testdir/Makefile, src/testdir/test61.in Patch 7.3.006 Problem: Can't build some multi-byte code with C89. Solution: Move code to after declarations. (Joachim Schmitz) Files: src/mbyte.c, src/spell.c Patch 7.3.007 Problem: Python code defines global "buffer". Re-implements a grow-array. Solution: Use a grow-array instead of coding the same functionality. Handle out-of-memory situation properly. Files: src/if_py_both.h Patch 7.3.008 Problem: 'cursorbind' is kept in places where 'scrollbind' is reset. Solution: Reset 'cursorbind'. Files: src/buffer.c, src/diff.c, src/ex_cmds.c, src/ex_cmds2.c, src/ex_docmd.c, src/ex_getln.c, src/if_cscope.c, src/macros.h, src/quickfix.c, src/search.c, src/tag.c, src/window.c Patch 7.3.009 Problem: Win32: Crash on Windows when using a bad argument for strftime(). (Christian Brabandt) Solution: Use the bad_param_handler(). (Mike Williams) Files: src/os_win32.c Patch 7.3.010 Problem: Mac GUI: Missing break statements. Solution: Add the break statements. (Dominique Pelle) Files: src/gui_mac.c Patch 7.3.011 Problem: X11 clipboard doesn't work in Athena/Motif GUI. First selection after a shell command doesn't work. Solution: When using the GUI use XtLastTimestampProcessed() instead of changing a property. (partly by Toni Ronkko) When executing a shell command disown the selection. Files: src/ui.c, src/os_unix.c Patch 7.3.012 Problem: Problems building with MingW. Solution: Adjust the MingW makefiles. (Jon Maken) Files: src/Make_ming.mak, src/GvimExt/Make_ming.mak Patch 7.3.013 Problem: Dynamic loading with Ruby doesn't work for 1.9.2. Solution: Handle rb_str2cstr differently. Also support dynamic loading on Unix. (Jon Maken) Files: src/if_ruby.c Patch 7.3.014 Problem: Ending a line in a backslash inside an ":append" or ":insert" command in Ex mode doesn't work properly. (Ray Frush) Solution: Halve the number of backslashes, only insert a NUL after an odd number of backslashes. Files: src/ex_getln.c Patch 7.3.015 Problem: Test is using error message that no longer exists. Solution: Change E106 to E121. (Dominique Pelle) Files: src/testdir/test49.vim Patch 7.3.016 Problem: Netbeans doesn't work under Athena. Solution: Support Athena, just like Motif. (Xavier de Gaye) Files: runtime/doc/netbeans.txt, src/gui.c, src/main.c, src/netbeans.c Patch 7.3.017 Problem: smatch reports errors. Solution: Fix the reported errors. (Dominique Pelle) Files: src/spell.c, src/syntax.c Patch 7.3.018 (after 7.3.012) Problem: Missing argument to windres in MingW makefiles. Solution: Add the argument that was wrapped in the patch. (Jon Maken) Files: src/Make_ming.mak, src/GvimExt/Make_ming.mak Patch 7.3.019 Problem: ":nbstart" can fail silently. Solution: Give an error when netbeans is not supported by the GUI. (Xavier de Gaye) Files: src/netbeans.c Patch 7.3.020 Problem: Cursor position wrong when joining multiple lines and 'formatoptions' contains "a". (Moshe Kamensky) Solution: Adjust cursor position for skipped indent. (Carlo Teubner) Files: src/ops.c, src/testdir/test68.in, src/testdir/test68.ok Patch 7.3.021 Problem: Conflict for defining Boolean in Mac header files. Solution: Define NO_X11_INCLUDES. (Rainer Muller) Files: src/os_macosx.m, src/vim.h Patch 7.3.022 Problem: When opening a new window the 'spellcapcheck' option is cleared. Solution: Copy the correct option value. (Christian Brabandt) Files: src/option.c Patch 7.3.023 Problem: External program may hang when it tries to write to the tty. Solution: Don't close the slave tty until after the child exits. (Nikola Knezevic) Files: src/os_unix.c Patch 7.3.024 Problem: Named signs do not use a negative number as intended. Solution: Fix the numbering of named signs. (Xavier de Gaye) Files: src/ex_cmds.c Patch 7.3.025 Problem: ":mksession" does not square brackets escape file name properly. Solution: Improve escaping of file names. (partly by Peter Odding) Files: src/ex_docmd.c Patch 7.3.026 Problem: CTRL-] in a help file doesn't always work. (Tony Mechelynck) Solution: Don't escape special characters. (Carlo Teubner) Files: src/normal.c Patch 7.3.027 Problem: Opening a file on a network share is very slow. Solution: When fixing file name case append "\*" to directory, server and network share names. (David Anderson, John Beckett) Files: src/os_win32.c Patch 7.3.028 (after 7.3.024) Problem: Signs don't show up. (Charles Campbell) Solution: Don't use negative numbers. Also assign a number to signs that have a name of all digits to avoid using a sign number twice. Files: src/ex_cmds.c Patch 7.3.029 Problem: ":sort n" sorts lines without a number as number zero. (Beeyawned) Solution: Make lines without a number sort before lines with a number. Also fix sorting negative numbers. Files: src/ex_cmds.c, src/testdir/test57.in, src/testdir/test57.ok Patch 7.3.030 Problem: Cannot store Dict and List in viminfo file. Solution: Add support for this. (Christian Brabandt) Files: runtime/doc/options.txt, src/eval.c, src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak, src/testdir/Make_ming.mak, src/testdir/Make_os2.mak, src/testdir/Make_vms.mms, src/testdir/Makefile, src/testdir/main.aap, src/testdir/test74.in, src/testdir/test74.ok Patch 7.3.031 Problem: Can't pass the X window ID to another application. Solution: Add v:windowid. (Christian J. Robinson, Lech Lorens) Files: runtime/doc/eval.txt, src/eval.c, src/gui.c, src/vim.h, src/os_unix.c Patch 7.3.032 Problem: maparg() doesn't return the flags, such as <buffer>, <script>, <silent>. These are needed to save and restore a mapping. Solution: Improve maparg(). (also by Christian Brabandt) Files: runtime/doc/eval.txt, src/eval.c, src/getchar.c, src/gui_w48.c, src/message.c, src/proto/getchar.pro, src/proto/message.pro, src/structs.h src/testdir/test75.in, src/testdir/test75.ok Patch 7.3.033 (after 7.3.032) Problem: Can't build without FEAT_LOCALMAP. Solution: Add an #ifdef. (John Marriott) Files: src/getchar.c Patch 7.3.034 Problem: Win32: may be loading .dll from the wrong directory. Solution: Go to the Vim executable directory when opening a library. Files: src/gui_w32.c, src/if_lua.c, src/if_mzsch.c, src/if_perl.xs, src/if_python.c, src/if_python3.c, src/if_ruby.c, src/mbyte.c, src/os_mswin.c, src/os_win32.c, src/proto/os_win32.pro Patch 7.3.035 (after 7.3.034) Problem: Stray semicolon after if statement. (Hari G) Solution: Remove the semicolon. Files: src/os_win32.c Patch 7.3.036 Problem: Win32 GUI: When building without menus, the font for dialogs and tab page headers also changes. Solution: Define USE_SYSMENU_FONT always. (Harig G.) Files: src/gui_w32.c Patch 7.3.037 Problem: Compiler warnings for loss of data. (Mike Williams) Solution: Add type casts. Files: src/if_py_both.h, src/getchar.c, src/os_win32.c Patch 7.3.038 Problem: v:windowid isn't set on MS-Windows. Solution: Set it to the window handle. (Chris Sutcliffe) Files: runtime/doc/eval.txt, src/gui_w32.c Patch 7.3.039 Problem: Crash when using skk.vim plugin. Solution: Get length of expression evaluation result only after checking for NULL. (Noriaki Yagi, Dominique Pelle) Files: src/ex_getln.c Patch 7.3.040 Problem: Comparing strings while ignoring case goes beyond end of the string when there are illegal bytes. (Dominique Pelle) Solution: Explicitly check for illegal bytes. Files: src/mbyte.c Patch 7.3.041 Problem: Compiler warning for accessing mediumVersion. (Tony Mechelynck) Solution: Use the pointer instead of the array itself. (Dominique Pelle) Files: src/version.c Patch 7.3.042 Problem: No spell highlighting when re-using an empty buffer. Solution: Clear the spell checking info only when clearing the options for a buffer. (James Vega) Files: src/buffer.c Patch 7.3.043 Problem: Can't load Ruby dynamically on Unix. Solution: Adjust the configure script. (James Vega) Files: src/Makefile, src/config.h.in, src/configure.in, src/auto/configure, src/if_ruby.c Patch 7.3.044 Problem: The preview window opened by the popup menu is larger than specified with 'previewheight'. (Benjamin Haskell) Solution: Use 'previewheight' if it's set and smaller. Files: src/popupmnu.c Patch 7.3.045 Problem: Compiler warning for uninitialized variable. Solution: Initialize the variable always. Files: src/getchar.c Patch 7.3.046 (after 7.3.043) Problem: Can't build Ruby on MS-Windows. Solution: Add #ifdef, don't use WIN3264 before including vim.h. Files: src/if_ruby.c Patch 7.3.047 (after 7.3.032) Problem: Missing makefile updates for test 75. Solution: Update the makefiles. Files: src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak, src/testdir/Makefile, src/testdir/Make_ming.mak, src/testdir/Make_os2.mak, src/testdir/Make_vms.mms Patch 7.3.048 Problem: ":earlier 1f" doesn't work after loading undo file. Solution: Set b_u_save_nr_cur when loading an undo file. (Christian Brabandt) Fix only showing time in ":undolist" Files: src/undo.c Patch 7.3.049 Problem: PLT has rebranded their Scheme to Racket. Solution: Add support for Racket 5.x. (Sergey Khorev) Files: src/Make_cyg.mak, src/Make_ming.mak, src/Make_mvc.mak, src/auto/configure, src/configure.in, src/if_mzsch.c Patch 7.3.050 Problem: The link script is clumsy. Solution: Use the --as-needed linker option if available. (Kirill A. Shutemov) Files: src/Makefile, src/auto/configure, src/config.mk.in, src/configure.in, src/link.sh Patch 7.3.051 Problem: Crash when $PATH is empty. Solution: Check for vim_getenv() returning NULL. (Yasuhiro Matsumoto) Files: src/ex_getln.c, src/os_win32.c Patch 7.3.052 Problem: When 'completefunc' opens a new window all kinds of errors follow. (Xavier Deguillard) Solution: When 'completefunc' goes to another window or buffer and when it deletes text abort completion. Add a test for 'completefunc'. Files: src/edit.c, src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak, src/testdir/Make_ming.mak, src/testdir/Make_os2.mak, src/testdir/Make_vms.mms, src/testdir/Makefile, src/testdir/test76.in, src/testdir/test76.ok Patch 7.3.053 Problem: complete() function doesn't reset complete direction. Can't use an empty string in the list of matches. Solution: Set compl_direction to FORWARD. Add "empty" key to allow empty words. (Kikuchan) Files: src/edit.c Patch 7.3.054 Problem: Can define a user command for :Print, but it doesn't work. (Aaron Thoma) Solution: Let user command :Print overrule the builtin command (Christian Brabandt) Disallow :X and :Next as a user defined command. Files: src/ex_docmd.c Patch 7.3.055 Problem: Recursively nested lists and dictionaries cause a near-endless loop when comparing them with a copy. (ZyX) Solution: Limit recursiveness in a way that non-recursive structures can still be nested very deep. Files: src/eval.c, src/testdir/test55.in, src/testdir/test55.ok Patch 7.3.056 Problem: "getline" argument in do_cmdline() shadows global. Solution: Rename the argument. Files: src/ex_docmd.c Patch 7.3.057 Problem: Segfault with command line abbreviation. (Randy Morris) Solution: Don't retrigger the abbreviation when abandoning the command line. Continue editing the command line after the error. Files: src/ex_getln.c Patch 7.3.058 Problem: Error "code converter not found" when loading Ruby script. Solution: Load Gem module. (Yasuhiro Matsumoto) Files: src/if_ruby.c Patch 7.3.059 Problem: Netbeans: Problem with recursively handling messages for Athena and Motif. Solution: Call netbeans_parse_messages() in the main loop, like it's done for GTK. (Xavier de Gaye) Files: src/gui_x11.c, src/netbeans.c Patch 7.3.060 Problem: Netbeans: crash when socket is disconnected unexpectedly. Solution: Don't cleanup when a read fails, put a message in the queue and disconnect later. (Xavier de Gaye) Files: src/netbeans.c Patch 7.3.061 Problem: Remote ":drop" does not respect 'autochdir'. (Peter Odding) Solution: Don't restore the directory when 'autochdir' is set. (Benjamin Fritz) Files: src/main.c Patch 7.3.062 Problem: Python doesn't work properly when installed in another directory than expected. Solution: Figure out home directory in configure and use Py_SetPythonHome() at runtime. (Roland Puntaier) Files: src/configure.in, src/auto/configure, src/if_python.c, src/if_python3.c Patch 7.3.063 Problem: Win32: Running a filter command makes Vim lose focus. Solution: Use SW_SHOWMINNOACTIVE instead of SW_SHOWMINIMIZED. (Hong Xu) Files: src/os_win32.c Patch 7.3.064 Problem: Win32: ":dis +" shows nothing, but "+p does insert text. Solution: Display the * register, since that's what will be inserted. (Christian Brabandt) Files: src/globals.h, src/ops.c Patch 7.3.065 Problem: Can't get current line number in a source file. Solution: Add the <slnum> item, similar to <sfile>. Files: src/ex_docmd.c Patch 7.3.066 Problem: Crash when changing to another window while in a :vimgrep command. (Christian Brabandt) Solution: When wiping out the dummy before, remove it from aucmd_win. Files: src/quickfix.c Patch 7.3.067 (after 7.3.058) Problem: Ruby: Init_prelude is not always available. Solution: Remove use of Init_prelude. (Yasuhiro Matsumoto) Files: src/if_ruby.c Patch 7.3.068 Problem: Using freed memory when doing ":saveas" and an autocommand sets 'autochdir'. (Kevin Klement) Solution: Get the value of fname again after executing autocommands. Files: src/ex_cmds.c Patch 7.3.069 Problem: GTK: pressing Enter in inputdialog() doesn't work like clicking OK as documented. Solution: call gtk_entry_set_activates_default(). (Britton Kerin) Files: src/gui_gtk.c Patch 7.3.070 Problem: Can set environment variables in the sandbox, could be abused. Solution: Disallow it. Files: src/eval.c Patch 7.3.071 Problem: Editing a file in a window that's in diff mode resets 'diff' but not cursor binding. Solution: Reset cursor binding in two more places. Files: src/quickfix.c, src/option.c Patch 7.3.072 Problem: Can't complete file names while ignoring case. Solution: Add 'wildignorecase'. Files: src/ex_docmd.c, src/ex_getln.c, src/misc1.c, src/option.c, src/option.h, src/vim.h, src/runtime/options.txt Patch 7.3.073 Problem: Double free memory when netbeans command follows DETACH. Solution: Only free the node when owned. (Xavier de Gaye) Files: src/netbeans.c Patch 7.3.074 Problem: Can't use the "+ register like "* for yank and put. Solution: Add "unnamedplus" to the 'clipboard' option. (Ivan Krasilnikov) Files: runtime/doc/options.txt, src/eval.c, src/globals.h, src/ops.c, src/option.c Patch 7.3.075 (after 7.3.072) Problem: Missing part of 'wildignorecase' Solution: Also adjust expand() Files: src/eval.c Patch 7.3.076 Problem: Clang warnings for dead code. Solution: Remove it. (Carlo Teubner) Files: src/gui_gtk.c, src/if_ruby.c, src/misc2.c, src/netbeans.c, src/spell.c Patch 7.3.077 Problem: When updating crypt of swapfile fails there is no error message. (Carlo Teubner) Solution: Add the error message. Files: src/memline.c Patch 7.3.078 Problem: Warning for unused variable. Solution: Adjust #ifdefs. Files: src/ops.c Patch 7.3.079 Problem: Duplicate lines in makefile. Solution: Remove the lines. (Hong Xu) Files: src/Make_mvc.mak Patch 7.3.080 Problem: Spell doesn't work on VMS. Solution: Use different file names. (Zoltan Bartos, Zoltan Arpadffy) Files: src/spell.c Patch 7.3.081 Problem: Non-printable characters in 'statusline' cause trouble. (ZyX) Solution: Use transstr(). (partly by Caio Ariede) Files: src/screen.c Patch 7.3.082 Problem: Leaking file descriptor when hostname doesn't exist. Solution: Remove old debugging lines. Files: src/netbeans.c Patch 7.3.083 Problem: When a read() or write() is interrupted by a signal it fails. Solution: Add read_eintr() and write_eintr(). Files: src/fileio.c, src/proto/fileio.pro, src/memfile.c, src/memline.c, src/os_unix.c, src/undo.c, src/vim.h Patch 7.3.084 Problem: When splitting the window, the new one scrolls with the cursor at the top. Solution: Compute w_fraction before setting the new height. Files: src/window.c Patch 7.3.085 (after 7.3.083) Problem: Inconsistency with preproc symbols. void * computation. Solution: Include vimio.h from vim.h. Add type cast. Files: src/eval.c, src/ex_cmds.c, src/ex_cmds2.c, src/fileio.c, src/if_cscope.c, src/if_sniff.c, src/main.c, src/memfile.c, src/memline.c, src/netbeans.c, src/os_msdos.c, src/os_mswin.c, src/os_win16.c, src/os_win32.c, src/spell.c, src/tag.c, src/undo.c, src/vim.h Patch 7.3.086 Problem: When using a mapping with an expression and there was no count, v:count has the value of the previous command. (ZyX) Solution: Also set v:count and v:count1 before getting the character that could be a command or a count. Files: src/normal.c Patch 7.3.087 Problem: EINTR is not always defined. Solution: Include errno.h in vim.h. Files: src/if_cscope.c, src/if_tcl.c, src/integration.c, src/memline.c, src/os_mswin.c, src/os_win16.c, src/os_win32.c, src/vim.h, src/workshop.c Patch 7.3.088 Problem: Ruby can't load Gems sometimes, may cause a crash. Solution: Undefine off_t. Use ruby_process_options(). (Yasuhiro Matsumoto) Files: src/if_ruby.c Patch 7.3.089 Problem: Compiler warning on 64 bit MS-Windows. Solution: Add type cast. (Mike Williams) Files: src/netbeans.c Patch 7.3.090 Problem: Wrong help text for Cscope. Solution: Adjust the help text for "t". (Dominique Pelle) Files: src/if_cscope.c Patch 7.3.091 Problem: "vim -w foo" writes special key codes for removed escape sequences. (Josh Triplett) Solution: Don't write K_IGNORE codes. Files: src/getchar.c, src/misc1.c, src/term.c, src/vim.h Patch 7.3.092 Problem: Resizing the window when exiting. Solution: Don't resize when exiting. Files: src/term.c Patch 7.3.093 Problem: New DLL dependencies in MingW with gcc 4.5.0. Solution: Add STATIC_STDCPLUS, LDFLAGS and split up WINDRES. (Guopeng Wen) Files: src/GvimExt/Make_ming.mak, src/Make_ming.mak Patch 7.3.094 Problem: Using abs() requires type cast to int. Solution: Use labs() so that the value remains long. (Hong Xu) Files: src/screen.c Patch 7.3.095 Problem: Win32: In Chinese tear-off menu doesn't work. (Weasley) Solution: Use menu_name_equal(). (Alex Jakushev) Files: src/menu.c Patch 7.3.096 Problem: "gvim -nb" is not interruptible. Leaking file descriptor on netbeans connection error. Solution: Check for CTRL-C typed. Free file descriptor. (Xavier de Gaye) Files: src/netbeans.c Patch 7.3.097 Problem: Using ":call" inside "if 0" does not see that a function returns a Dict and gives error for "." as string concatenation. Solution: Use eval0() to skip over the expression. (Yasuhiro Matsumoto) Files: src/eval.c Patch 7.3.098 Problem: Function that ignores error still causes called_emsg to be set. E.g. when expand() fails the status line is disabled. Solution: Move check for emsg_not_now() up. (James Vega) Files: src/message.c Patch 7.3.099 Problem: Crash when splitting a window with zero height. (Yukihiro Nakadaira) Solution: Don't set the fraction in a window with zero height. Files: src/window.c Patch 7.3.100 Problem: When using :normal v:count isn't set. Solution: Call normal_cmd() with toplevel set to TRUE. Files: src/ex_docmd.c Patch 7.3.101 Problem: ino_t defined with wrong size. Solution: Move including auto/config.h before other includes. (Marius Geminas) Files: src/if_ruby.c, src/if_lua.c Patch 7.3.102 Problem: When using ":make", typing the next command and then getting the "reload" prompt the next command is (partly) eaten by the reload prompt. Solution: Accept ':' as a special character at the reload prompt to accept the default choice and execute the command. Files: src/eval.c, src/fileio.c, src/gui.c, src/gui_xmdlg.c, src/memline.c, src/message.c, src/proto/message.pro, src/gui_athena.c, src/gui_gtk.c, src/gui_mac.c, src/gui_motif.c, src/gui_photon.c, src/gui_w16.c, src/gui_w32.c, src/os_mswin.c src/proto/gui_athena.pro, src/proto/gui_gtk.pro, src/proto/gui_mac.pro, src/proto/gui_motif.pro, src/proto/gui_photon.pro, src/proto/gui_w16.pro, src/proto/gui_w32.pro Patch 7.3.103 Problem: Changing 'fileformat' and then using ":w" in an empty file sets the 'modified' option. Solution: In unchanged() don't ignore 'ff' for an empty file. Files: src/misc1.c, src/option.c, src/proto/option.pro, src/undo.c Patch 7.3.104 Problem: Conceal: using Tab for cchar causes problems. (ZyX) Solution: Do not accept a control character for cchar. Files: src/syntax.c Patch 7.3.105 Problem: Can't get the value of "b:changedtick" with getbufvar(). Solution: Make it work. (Christian Brabandt) Files: src/eval.c Patch 7.3.106 Problem: When 'cursorbind' is set another window may scroll unexpectedly when 'scrollbind' is also set. (Xavier Wang) Solution: Don't call update_topline() if 'scrollbind' is set. Files: src/move.c Patch 7.3.107 Problem: Year number for :undolist can be confused with month or day. Solution: Change "%y" to "%Y". Files: src/undo.c Patch 7.3.108 Problem: Useless check for NULL when calling vim_free(). Solution: Remove the check. (Dominique Pelle) Files: src/eval.c, src/ex_cmds.c, src/os_win32.c Patch 7.3.109 Problem: Processing new Esperanto spell file fails and crashes Vim. (Dominique Pelle) Solution: When running out of memory give an error. Handle '?' in COMPOUNDRULE properly. Files: src/spell.c Patch 7.3.110 Problem: The "nbsp" item in 'listchars' isn't used for ":list". Solution: Make it work. (Christian Brabandt) Files: src/message.c Patch 7.3.111 (after 7.3.100) Problem: Executing a :normal command in 'statusline' evaluation causes the cursor to move. (Dominique Pelle) Solution: When updating the cursor for 'cursorbind' allow the cursor beyond the end of the line. When evaluating 'statusline' temporarily reset 'cursorbind'. Files: src/move.c, src/screen.c Patch 7.3.112 Problem: Setting 'statusline' to "%!'asdf%' reads uninitialized memory. Solution: Check for NUL after %. Files: src/buffer.c Patch 7.3.113 Problem: Windows: Fall back directory for creating temp file is wrong. Solution: Use "." instead of empty string. (Hong Xu) Files: src/fileio.c Patch 7.3.114 Problem: Potential problem in initialization when giving an error message early. Solution: Initialize 'verbosefile' empty. (Ben Schmidt) Files: src/option.h Patch 7.3.115 Problem: Vim can crash when tmpnam() returns NULL. Solution: Check for NULL. (Hong Xu) Files: src/fileio.c Patch 7.3.116 Problem: 'cursorline' is displayed too short when there are concealed characters and 'list' is set. (Dennis Preiser) Solution: Check for 'cursorline' when 'list' is set. (Christian Brabandt) Files: src/screen.c Patch 7.3.117 Problem: On some systems --as-needed does not work, because the "tinfo" library is included indirectly from "ncurses". (Charles Campbell) Solution: In configure prefer using "tinfo" instead of "ncurses". Files: src/configure.in, src/auto/configure Patch 7.3.118 Problem: Ruby uses SIGVTALARM which makes Vim exit. (Alec Tica) Solution: Ignore SIGVTALARM. (Dominique Pelle) Files: src/os_unix.c Patch 7.3.119 Problem: Build problem on Mac. (Nicholas Stallard) Solution: Use "extern" instead of "EXTERN" for p_vfile. Files: src/option.h Patch 7.3.120 Problem: The message for an existing swap file is too long to fit in a 25 line terminal. Solution: Make the message shorter. (Chad Miller) Files: src/memline.c Patch 7.3.121 Problem: Complicated 'statusline' causes a crash. (Christian Brabandt) Solution: Check that the number of items is not too big. Files: src/buffer.c Patch 7.3.122 Problem: Having auto/config.mk in the repository causes problems. Solution: Remove auto/config.mk from the distribution. In the toplevel Makefile copy it from the "dist" file. Files: Makefile, src/Makefile, src/auto/config.mk Patch 7.3.123 Problem: ml_get error when executing register being recorded into, deleting lines and 'conceallevel' is set. (ZyX) Solution: Don't redraw a line for concealing when it doesn't exist. Files: src/main.c Patch 7.3.124 Problem: When writing a file in binary mode it may be missing the final EOL if a file previously read was missing the EOL. (Kevin Goodsell) Solution: Move the write_no_eol_lnum into the buffer struct. Files: src/structs.h, src/fileio.c, src/globals.h, src/os_unix.c Patch 7.3.125 Problem: MSVC: Problem with quotes in link argument. Solution: Escape backslashes and quotes. (Weasley) Files: src/Make_mvc.mak Patch 7.3.126 Problem: Compiler warning for signed pointer. Solution: Use unsigned int argument for sscanf(). Files: src/blowfish.c Patch 7.3.127 Problem: Compiler complains about comma. Solution: Remove comma after last enum element. Files: src/ex_cmds2.c Patch 7.3.128 Problem: Another compiler warning for signed pointer. Solution: Use unsigned int argument for sscanf(). Files: src/mark.c Patch 7.3.129 Problem: Using integer like a boolean. Solution: Nicer check for integer being non-zero. Files: src/tag.c Patch 7.3.130 Problem: Variable misplaced in #ifdef. Solution: Move clipboard_event_time outside of #ifdef. Files: src/gui_gtk_x11.c Patch 7.3.131 Problem: Including errno.h too often. Solution: Don't include errno.h in Unix header file. Files: src/os_unix.h Patch 7.3.132 Problem: C++ style comments. Solution: Change to C comments. Files: src/if_python3.c Patch 7.3.133 Problem: When using encryption it's not clear what method was used. Solution: In the file message show "blowfish" when using blowfish. Files: src/fileio.c Patch 7.3.134 Problem: Drag-n-drop doesn't work in KDE Dolphin. Solution: Add GDK_ACTION_MOVE flag. (Florian Degner) Files: src/gui_gtk_x11.c Patch 7.3.135 Problem: When there is no previous substitute pattern, the previous search pattern is used. The other way around doesn't work. Solution: When there is no previous search pattern, use the previous substitute pattern if possible. (Christian Brabandt) Files: src/search.c Patch 7.3.136 Problem: Duplicate include of assert.h. Solution: Remove it. Files: src/if_cscope.c Patch 7.3.137 (after 7.3.091) Problem: When 'lazyredraw' is set the screen may not be updated. (Ivan Krasilnikov) Solution: Call update_screen() before waiting for input. Files: src/misc1.c, src/getchar.c Patch 7.3.138 Problem: ":com" changes the multi-byte text of :echo. (Dimitar Dimitrov) Solution: Search for K_SPECIAL as a byte, not a character. (Ben Schmidt) Files: src/ex_docmd.c Patch 7.3.139 (after 7.3.137) Problem: When 'lazyredraw' is set ":ver" output can't be read. Solution: Don't redraw the screen when at a prompt or command line. Files: src/getchar.c, src/message.c, src/misc1.c Patch 7.3.140 Problem: Crash when drawing the "$" at end-of-line for list mode just after the window border and 'cursorline' is set. Solution: Don't check for 'cursorline'. (Quentin Carbonneaux) Files: src/screen.c Patch 7.3.141 Problem: When a key code is not set get a confusing error message. Solution: Change the error message to say the key code is not set. Files: src/option.c, runtime/doc/options.txt Patch 7.3.142 Problem: Python stdout doesn't have a flush() method, causing an import to fail. Solution: Add a dummy flush() method. (Tobias Columbus) Files: src/if_py_both.h Patch 7.3.143 Problem: Memfile is not tested sufficiently. Looking up blocks in a memfile is slow when there are many blocks. Solution: Add high level test and unittest. Adjust the number of hash buckets to the number of blocks. (Ivan Krasilnikov) Files: Filelist, src/Makefile, src/main.c, src/memfile.c, src/memfile_test.c src/structs.h src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak, src/testdir/Make_ming.mak, src/testdir/Make_os2.mak, src/testdir/Make_vms.mak, src/testdir/Makefile, src/testdir/test77.in, src/testdir/test77.ok Patch 7.3.144 Problem: Crash with ":python help(dir)". (Kearn Holliday) Solution: Fix the way the type is set on objects. (Tobias Columbus) Files: src/if_python.c Patch 7.3.145 (after 7.3.144) Problem: Can't build with Python dynamically loading. Solution: Add dll_PyType_Ready. Files: src/if_python.c Patch 7.3.146 Problem: It's possible to assign to a read-only member of a dict. It's possible to create a global variable "0". (ZyX) It's possible to add a v: variable with ":let v:.name = 1". Solution: Add check for dict item being read-only. Check the name of g: variables. Disallow adding v: variables. Files: src/eval.c Patch 7.3.147 (after 7.3.143) Problem: Can't build on HP-UX. Solution: Remove an unnecessary backslash. (John Marriott) Files: src/Makefile Patch 7.3.148 Problem: A syntax file with a huge number of items or clusters causes weird behavior, a hang or a crash. (Yukihiro Nakadaira) Solution: Check running out of IDs. (partly by Ben Schmidt) Files: src/syntax.c Patch 7.3.149 Problem: The cursor disappears after the processing of the 'setDot' netbeans command when vim runs in a terminal. Solution: Show the cursor after a screen update. (Xavier de Gaye) Files: src/netbeans.c Patch 7.3.150 Problem: readline() does not return the last line when the NL is missing. (Hong Xu) Solution: When at the end of the file Also check for a previous line. Files: src/eval.c Patch 7.3.151 (after 7.3.074) Problem: When "unnamedplus" is in 'clipboard' the selection is sometimes also copied to the star register. Solution: Avoid copy to the star register when undesired. (James Vega) Files: src/ops.c Patch 7.3.152 Problem: Xxd does not check for errors from library functions. Solution: Add error checks. (Florian Zumbiehl) Files: src/xxd/xxd.c Patch 7.3.153 (after 7.3.152) Problem: Compiler warning for ambiguous else, missing prototype. Solution: Add braces. (Dominique Pelle) Add prototype for die(). Files: src/xxd/xxd.c Patch 7.3.154 (after 7.3.148) Problem: Can't compile with tiny features. (Tony Mechelynck) Solution: Move #define outside of #ifdef. Files: src/syntax.c Patch 7.3.155 Problem: Crash when using map(), filter() and remove() on v:. (ZyX) Also for extend(). (Yukihiro Nakadaira) Solution: Mark v: as locked. Also correct locking error messages. Files: src/eval.c Patch 7.3.156 Problem: Tty names possibly left unterminated. Solution: Use vim_strncpy() instead of strncpy(). Files: src/pty.c Patch 7.3.157 Problem: Superfluous assignment. Solution: Remove assignment. Files: src/misc1.c Patch 7.3.158 Problem: Might use uninitialized memory in C indenting. Solution: Init arrays to empty. Files: src/misc1.c Patch 7.3.159 Problem: Using uninitialized pointer when out of memory. Solution: Check for NULL return value. Files: src/mbyte.c Patch 7.3.160 Problem: Unsafe string copying. Solution: Use vim_strncpy() instead of strcpy(). Use vim_strcat() instead of strcat(). Files: src/buffer.c, src/ex_docmd.c, src/hardcopy.c, src/menu.c, src/misc1.c, src/misc2.c, src/proto/misc2.pro, src/netbeans.c, src/os_unix.c, src/spell.c, src/syntax.c, src/tag.c Patch 7.3.161 Problem: Items on the stack may be too big. Solution: Make items static or allocate them. Files: src/eval.c, src/ex_cmds.c, src/ex_cmds2.c, src/ex_docmd.c, src/fileio.c, src/hardcopy.c, src/quickfix.c, src/main.c, src/netbeans.c, src/spell.c, src/tag.c, src/vim.h, src/xxd/xxd.c Patch 7.3.162 Problem: No error message when assigning to a list with an index out of range. (Yukihiro Nakadaira) Solution: Add the error message. Files: src/eval.c Patch 7.3.163 Problem: For the default of 'shellpipe' "mksh" and "pdksh" are not recognized. Solution: Recognize these shell names. Files: src/option.c Patch 7.3.164 Problem: C-indenting: a preprocessor statement confuses detection of a function declaration. Solution: Ignore preprocessor lines. (Lech Lorens) Also recognize the style to put a comma before the argument name. Files: src/misc1.c, testdir/test3.in, testdir/test3.ok Patch 7.3.165 Problem: ":find" completion does not escape spaces in a directory name. (Isz) Solution: Add backslashes for EXPAND_FILES_IN_PATH. (Carlo Teubner) Files: src/ex_getln.c Patch 7.3.166 Problem: Buffer on the stack may be too big Solution: Allocate the space. Files: src/option.c Patch 7.3.167 Problem: When using the internal grep QuickFixCmdPost is not triggered. (Yukihiro Nakadaira) Solution: Change the place where autocommands are triggered. Files: src/quickfix.c Patch 7.3.168 Problem: When the second argument of input() contains a CR the text up to that is used without asking the user. (Yasuhiro Matsumoto) Solution: Change CR, NL and ESC in the text to a space. Files: src/getchar.c Patch 7.3.169 Problem: Freeing memory already freed, warning from static code analyzer. Solution: Initialize pointers to NULL, correct use of "mustfree". (partly by Dominique Pelle) Files: src/mis1.c Patch 7.3.170 Problem: VMS Makefile for testing was not updated for test77. Solution: Add test77 to the Makefile. Files: src/testdir/Make_vms.mms Patch 7.3.171 Problem: When the clipboard isn't supported: ":yank*" gives a confusing error message. Solution: Specifically mention that the register name is invalid. (Jean-Rene David) Files: runtime/doc/change.txt, src/ex_docmd.c, src/globals.h Patch 7.3.172 Problem: MS-Windows: rename() might delete the file if the name differs but it's actually the same file. Solution: Use the file handle to check if it's the same file. (Yukihiro Nakadaira) Files: src/if_cscope.c, src/fileio.c, src/os_win32.c, src/proto/os_win32.pro, src/vim.h Patch 7.3.173 Problem: After using setqflist() to make the quickfix list empty ":cwindow" may open the window anyway. Also after ":vimgrep". Solution: Correctly check whether the list is empty. (Ingo Karkat) Files: src/quickfix.c Patch 7.3.174 Problem: When Exuberant ctags binary is exctags it's not found. Solution: Add configure check for exctags. (Hong Xu) Files: src/configure.in, src/auto/configure Patch 7.3.175 Problem: When 'colorcolumn' is set locally to a window, ":new" opens a window with the same highlighting but 'colorcolumn' is empty. (Tyru) Solution: Call check_colorcolumn() after clearing and copying options. (Christian Brabandt) Files: src/buffer.c Patch 7.3.176 Problem: Ruby linking doesn't work properly on Mac OS X. Solution: Fix the configure check for Ruby. (Bjorn Winckler) Files: src/configure.in, src/auto/configure Patch 7.3.177 Problem: MS-Windows: mkdir() doesn't work properly when 'encoding' is "utf-8". Solution: Convert to utf-16. (Yukihiro Nakadaira) Files: src/os_win32.c, src/os_win32.h, src/proto/os_win32.pro Patch 7.3.178 Problem: C-indent doesn't handle code right after { correctly. Solution: Fix detecting unterminated line. (Lech Lorens) Files: src/misc1.c, src/testdir/test3.in, src/testdir/test3.ok Patch 7.3.179 Problem: C-indent doesn't handle colon in string correctly. Solution: Skip the string. (Lech Lorens) Files: src/misc1.c, src/testdir/test3.in, src/testdir/test3.ok Patch 7.3.180 Problem: When both a middle part of 'comments' matches and an end part, the middle part was used erroneously. Solution: After finding the middle part match continue looking for a better end part match. (partly by Lech Lorens) Files: src/misc1.c, src/testdir/test3.in, src/testdir/test3.ok Patch 7.3.181 Problem: When repeating the insert of CTRL-V or a digraph the display may not be updated correctly. Solution: Only call edit_unputchar() after edit_putchar(). (Lech Lorens) Files: src/edit.c Patch 7.3.182 (after 7.3.180) Problem: Compiler warning for uninitialized variable. Solution: Add dummy initializer. Files: src/misc1.c Patch 7.3.183 (after 7.3.174) Problem: When Exuberant ctags binary is exuberant-ctags it's not found. Solution: Add configure check for exuberant-ctags. Files: src/configure.in, src/auto/configure Patch 7.3.184 Problem: Static code analysis errors in riscOS. Solution: Make buffer size bigger. (Dominique Pelle) Files: src/gui_riscos.c Patch 7.3.185 Problem: ":windo g/pattern/q" closes windows and reports "N more lines". (Tim Chase) Solution: Remember what buffer ":global" started in. (Jean-Rene David) Files: src/ex_cmds.c Patch 7.3.186 Problem: When 'clipboard' contains "unnamed" or "unnamedplus" the value of v:register is wrong for operators without a specific register. Solution: Adjust the register according to 'clipboard'. (Ingo Karkat) Files: src/normal.c Patch 7.3.187 Problem: The RISC OS port has obvious errors and is not being maintained. Solution: Remove the RISC OS files and code. Files: src/ascii.h, src/eval.c, src/ex_cmds.c, src/ex_cmds2.c, src/ex_docmd.c, src/fileio.c, src/globals.h, src/gui.c, src/gui.h, src/main.c, src/memfile.c, src/memline.c, src/misc1.c, src/proto.h, src/quickfix.c, src/search.c, src/structs.h, src/term.c, src/termlib.c, src/version.c, src/vim.h, src/gui_riscos.h, src/os_riscos.h, src/gui_riscos.c, src/os_riscos.c, runtime/doc/os_risc.txt Patch 7.3.188 Problem: More RISC OS files to remove. Solution: Remove them. Update the file list. Files: src/proto/gui_riscos.pro, src/proto/os_riscos.pro, Filelist Patch 7.3.189 (after 7.3.186) Problem: Can't build without +clipboard feature. (Christian Ebert) Solution: Add the missing #ifdef. Files: src/normal.c Patch 7.3.190 Problem: When there is a "containedin" syntax argument highlighting may be wrong. (Radek) Solution: Reset current_next_list. (Ben Schmidt) Files: src/syntax.c Patch 7.3.191 Problem: Still some RISC OS stuff to remove. Solution: Remove files and lines. (Hong Xu) Remove the 'osfiletype' option code. Files: README_extra.txt, src/Make_ro.mak, src/INSTALL, src/Makefile, src/buffer.c, src/eval.c, src/feature.h, src/option.c, src/option.h, src/structs.h, src/version.c, src/pty.c, Filelist Patch 7.3.192 Problem: Ex command ":s/ \?/ /g" splits multi-byte characters into bytes. (Dominique Pelle) Solution: Advance over whole character instead of one byte. Files: src/ex_cmds.c Patch 7.3.193 Problem: In the command line window ":close" doesn't work properly. (Tony Mechelynck) Solution: Use Ctrl_C instead of K_IGNORE for cmdwin_result. (Jean-Rene David) Files: src/ex_docmd.c, src/ex_getln.c Patch 7.3.194 Problem: When "b" is a symlink to directory "a", resolve("b/") doesn't result in "a/". (ZyX) Solution: Remove the trailing slash. (Jean-Rene David) Files: src/eval.c Patch 7.3.195 Problem: "} else" causes following lines to be indented too much. (Rouben Rostamian) Solution: Better detection for the "else". (Lech Lorens) Files: src/misc1.c, src/testdir/test3.in, src/testdir/test3.ok Patch 7.3.196 Problem: Can't intercept a character that is going to be inserted. Solution: Add the InsertCharPre autocommand event. (Jakson A. Aquino) Files: runtime/doc/autocmd.txt, runtime/doc/eval.txt, runtime/doc/map.txt, src/edit.c, src/eval.c, src/fileio.c, src/vim.h Patch 7.3.197 Problem: When a QuickfixCmdPost event removes all errors, Vim still tries to jump to the first error, resulting in E42. Solution: Get the number of error after the autocmd event. (Mike Lundy) Files: src/quickfix.c Patch 7.3.198 Problem: No completion for ":lang". Solution: Get locales to complete from. (Dominique Pelle) Files: src/eval.c, src/ex_cmds2.c, src/ex_getln.c, src/proto/ex_cmds2.pro, src/proto/ex_getln.pro, src/vim.h Patch 7.3.199 Problem: MS-Windows: Compilation problem of OLE with MingW compiler. Solution: Put #ifdef around declarations. (Guopeng Wen) Files: src/if_ole.h Patch 7.3.200 (after 7.3.198) Problem: CTRL-D doesn't complete :lang. Solution: Add the missing part of the change. (Dominique Pelle) Files: src/ex_docmd.c Patch 7.3.201 (after 7.3.195) Problem: "} else" still causes following lines to be indented too much. Solution: Better detection for the "else" block. (Lech Lorens) Files: src/misc1.c, src/testdir/test3.in, src/testdir/test3.ok Patch 7.3.202 Problem: Cannot influence the indent inside a namespace. Solution: Add the "N" 'cino' parameter. (Konstantin Lepa) Files: runtime/doc/indent.txt, src/misc1.c, src/testdir/test3.in, src/testdir/test3.ok Patch 7.3.203 Problem: MS-Windows: Can't run an external command without a console window. Solution: Support ":!start /b cmd". (Xaizek) Files: runtime/doc/os_win32.txt, src/os_win32.c Patch 7.3.204 (after 7.3.201) Problem: Compiler warning. Solution: Add type cast. (Mike Williams) Files: src/misc1.c Patch 7.3.205 Problem: Syntax "extend" doesn't work correctly. Solution: Avoid calling check_state_ends() recursively (Ben Schmidt) Files: src/syntax.c Patch 7.3.206 Problem: 64bit MS-Windows compiler warning. Solution: Use HandleToLong() instead of type cast. (Mike Williams) Files: src/gui_w32.c Patch 7.3.207 Problem: Can't compile with MSVC with pentium4 and 64 bit. Solution: Only use SSE2 for 32 bit. (Mike Williams) Files: src/Make_mvc.mak Patch 7.3.208 Problem: Early terminated if statement. Solution: Remove the semicolon. (Lech Lorens) Files: src/gui_mac.c Patch 7.3.209 Problem: MSVC Install instructions point to wrong batch file. Solution: Add a batch file for use with MSVC 10. Files: src/msvc2010.bat, src/INSTALLpc.txt, Filelist Patch 7.3.210 Problem: Can't always find the file when using cscope. Solution: Add the 'cscoperelative' option. (Raghavendra D Prabhu) Files: runtime/doc/if_cscop.txt, runtime/doc/options.txt, src/if_cscope.c Patch 7.3.211 (after 7.3.210) Problem: Compiler warning. Solution: Add type cast. Files: src/if_cscope.c Patch 7.3.212 Problem: With Python 3.2 ":py3" fails. Solution: Move PyEval_InitThreads() to after Py_Initialize(). (Roland Puntaier) Check abiflags in configure. (Andreas Behr) Files: src/if_python3.c, src/auto/configure, src/configure.in Patch 7.3.213 Problem: Javascript object literal is not indented correctly. Solution: Make a special case for when "J1" is in 'cino'. (Luc Deschenaux) Files: src/misc1.c, src/testdir/test3.in, src/testdir/test3.ok Patch 7.3.214 Problem: The text displayed by ":z-" isn't exactly like old Vi. Solution: Add one to the start line number. (ChangZhuo Chen) Files: src/ex_cmds.c Patch 7.3.215 (after 7.3.210) Problem: Wrong file names in previous patch. (Toothpik) Solution: Include the option changes. Files: src/option.c, src/option.h Patch 7.3.216 Problem: When recovering a file a range of lines is missing. (Charles Jie) Solution: Reset the index when advancing to the next pointer block. Add a test to verify recovery works. Files: src/memline.c, src/testdir/test78.in, src/testdir/test78.ok, src/testdir/Makefile, src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak, src/testdir/Make_ming.mak, src/testdir/Make_os2.mak, src/testdir/Make_vms.mms Patch 7.3.217 Problem: Inside an "if" a ":wincmd" causes problems. Solution: When skipping commands let ":wincmd" skip over its argument. Files: src/ex_docmd.c Patch 7.3.218 (after 7.3.212) Problem: Tiny configuration problem with Python 3. Solution: Add abiflags in one more place. (Andreas Behr) Files: src/auto/configure, src/configure.in Patch 7.3.219 Problem: Can't compile with GTK on Mac. Solution: Add some #ifdef trickery. (Ben Schmidt) Files: src/os_mac_conv.c, src/os_macosx.m, src/vim.h Patch 7.3.220 Problem: Python 3: vim.error is a 'str' instead of an 'Exception' object, so 'except' or 'raise' it causes a 'SystemError' exception. Buffer objects do not support slice assignment. When exchanging text between Vim and Python, multibyte texts become garbage or cause Unicode Exceptions, etc. 'py3file' tries to read in the file as Unicode, sometimes causes UnicodeDecodeException Solution: Fix the problems. (lilydjwg) Files: src/if_py_both.h, src/if_python.c, src/if_python3.c Patch 7.3.221 Problem: Text from the clipboard is sometimes handled as linewise, but not consistently. Solution: Assume the text is linewise when it ends in a CR or NL. Files: src/gui_gtk_x11.c, src/gui_mac.c, src/ops.c, src/os_msdos.c, src/os_mswin.c, src/os_qnx.c, src/ui.c Patch 7.3.222 Problem: Warning for building GvimExt. Solution: Comment-out the DESCRIPTION line. (Mike Williams) Files: src/GvimExt/gvimext.def, src/GvimExt/gvimext_ming.def Patch 7.3.223 Problem: MingW cross compilation doesn't work with tiny features. Solution: Move acp_to_enc(), enc_to_utf16() and utf16_to_enc() outside of "#ifdef CLIPBOARD". Fix typo in makefile. Files: src/Make_ming.mak, src/os_mswin.c Patch 7.3.224 Problem: Can't pass dict to sort function. Solution: Add the optional {dict} argument to sort(). (ZyX) Files: runtime/doc/eval.txt, src/eval.c Patch 7.3.225 Problem: Using "\n" in a substitute inside ":s" does not result in a line break. Solution: Change behavior inside vim_regexec_nl(). Add tests. (Motoya Kurotsu) Files: src/regexp.c, src/testdir/test79.in, src/testdir/test79.ok, src/testdir/test80.in, src/testdir/test80.ok, src/testdir/Makefile, src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak, src/testdir/Make_ming.mak, src/testdir/Make_os2.mak, src/testdir/Make_vms.mms Patch 7.3.226 Problem: On a 64 bit system "syn sync fromstart" is very slow. (Bjorn Steinbrink) Solution: Store the state when starting to parse from the first line. Files: src/syntax.c Patch 7.3.227 (after 7.3.221) Problem: Mac OS doesn't have the linewise clipboard fix. Solution: Also change the Mac OS file. (Bjorn Winckler) Files: src/os_macosx.m Patch 7.3.228 Problem: "2gj" does not always move to the correct position. Solution: Get length of line after moving to a next line. (James Vega) Files: src/normal.c Patch 7.3.229 Problem: Using fork() makes gvim crash on Mac when build with CoreFoundation. Solution: Disallow fork() when __APPLE__ is defined. (Hisashi T Fujinaka) Files: src/gui.c Patch 7.3.230 Problem: ":wundo" and ":rundo" don't unescape their argument. (Aaron Thoma) Solution: Use FILE1 instead of XFILE. Files: src/ex_cmds.h Patch 7.3.231 Problem: Runtime file patches failed. Solution: Redo the patches made against the patched files instead of the files in the mercurial repository. Files: runtime/doc/indent.txt, runtime/doc/os_win32.txt Patch 7.3.232 Problem: Python doesn't compile without +multi_byte Solution: Use "latin1" when MULTI_BYTE is not defined. Files: src/if_py_both.h Patch 7.3.233 Problem: ":scriptnames" and ":breaklist" show long file names. Solution: Shorten to use "~/" when possible. (Jean-Rene David) Files: src/ex_cmds2.c Patch 7.3.234 Problem: With GTK menu may be popping down. Solution: Use event time instead of GDK_CURRENT_TIME. (Hong Xu) Files: src/gui.c, src/gui.h, src/gui_gtk.c, src/gui_gtk_x11.c Patch 7.3.235 Problem: ";" gets stuck on a "t" command, it's not useful. Solution: Add the ';' flag in 'cpo'. (Christian Brabandt) Files: runtime/doc/motion.txt, runtime/doc/options.txt, src/option.h, src/search.c src/testdir/test81.in, src/testdir/test81.ok, src/testdir/Makefile, src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak, src/testdir/Make_ming.mak, src/testdir/Make_os2.mak, src/testdir/Make_vms.mms Patch 7.3.236 (after 7.3.232) Problem: Python 3 doesn't compile without +multi_byte Solution: Use "latin1" when MULTI_BYTE is not defined. (lilydjwg) Files: src/if_python3.c Patch 7.3.237 Problem: "filetype" completion doesn't work on Windows. (Yue Wu) Solution: Don't use a glob pattern for the directories, use a list of directories. (Dominique Pelle) Files: src/ex_getln.c Patch 7.3.238 Problem: Compiler warning for conversion. Solution: Add type cast. (Mike Williams) Files: src/ex_getln.c Patch 7.3.239 Problem: Python corrects the cursor column without taking 'virtualedit' into account. (lilydjwg) Solution: Call check_cursor_col_win(). Files: src/if_py_both.h, src/mbyte.c, src/misc2.c, src/normal.c, src/proto/mbyte.pro, src/proto/misc2.pro Patch 7.3.240 Problem: External commands can't use pipes on MS-Windows. Solution: Implement pipes and use them when 'shelltemp' isn't set. (Vincent Berthoux) Files: src/eval.c, src/ex_cmds.c, src/misc2.c, src/os_unix.c, src/os_win32.c, src/proto/misc2.pro, src/ui.c Patch 7.3.241 Problem: Using CTRL-R CTRL-W on the command line may insert only part of the word. Solution: Use the cursor position instead of assuming it is at the end of the command. (Tyru) Files: src/ex_getln.c Patch 7.3.242 Problem: Illegal memory access in after_pathsep(). Solution: Check that the pointer is not at the start of the file name. (Dominique Pelle) Files: src/misc2.c Patch 7.3.243 Problem: Illegal memory access in readline(). Solution: Swap the conditions. (Dominique Pelle) Files: src/eval.c Patch 7.3.244 Problem: MS-Windows: Build problem with old compiler. (John Beckett) Solution: Only use HandleToLong() when available. (Mike Williams) Files: src/gui_w32.c Patch 7.3.245 Problem: Python 3.2 libraries not correctly detected. Solution: Add the suffix to the library name. (Niclas Zeising) Files: src/auto/configure, src/configure.in Patch 7.3.246 (after 7.3.235) Problem: Repeating "f4" in "4444" skips one 4. Solution: Check the t_cmd flag. (Christian Brabandt) Files: src/search.c Patch 7.3.247 Problem: Running tests changes the users viminfo file. Test for patch 7.3.246 missing. Solution: Add "nviminfo" to the 'viminfo' option. Include the test. Files: src/testdir/test78.in, src/testdir/test81.in Patch 7.3.248 Problem: PC Install instructions missing install instructions. Solution: Step-by-step explanation. (Michael Soyka) Files: src/INSTALLpc.txt Patch 7.3.249 Problem: Wrong indenting for array initializer. Solution: Detect '}' in a better way. (Lech Lorens) Files: src/misc1.c, src/testdir/test3.in, src/testdir/test3.ok Patch 7.3.250 Problem: Python: Errors in Unicode characters not handled nicely. Solution: Add the surrogateescape error handler. (lilydjwg) Files: src/if_python3.c Patch 7.3.251 Problem: "gH<Del>" deletes the current line, except when it's the last line. Solution: Set the "include" flag to indicate the last line is to be deleted. Files: src/normal.c, src/ops.c Patch 7.3.252 (after 7.3.247) Problem: Tests fail. (David Northfield) Solution: Add missing update for .ok file. Files: src/testdir/test81.ok Patch 7.3.253 Problem: "echo 'abc' > ''" returns 0 or 1, depending on 'ignorecase'. Checks in mb_strnicmp() for illegal and truncated bytes are wrong. Should not assume that byte length is equal before case folding. Solution: Add utf_safe_read_char_adv() and utf_strnicmp(). Add a test for this. (Ivan Krasilnikov) Files: src/mbyte.c src/testdir/test82.in, src/testdir/test82.ok, src/testdir/Makefile, src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak, src/testdir/Make_ming.mak, src/testdir/Make_os2.mak, src/testdir/Make_vms.mms Patch 7.3.254 Problem: The coladd field is not reset when setting the line number for a ":call" command. Solution: Reset it. Files: src/eval.c Patch 7.3.255 Problem: When editing a file such as "File[2010-08-15].vim" an E16 error is given. (Manuel Stol) Solution: Don't give an error for failing to compile the regexp. Files: src/ex_docmd.c, src/misc1.c, src/vim.h Patch 7.3.256 Problem: Javascript indenting not sufficiently tested. Solution: Add more tests. (Luc Deschenaux) Mark the lines that are indented wrong. Files: src/testdir/test3.in, src/testdir/test3.ok Patch 7.3.257 Problem: Not all completions are available to user commands. Solution: Add "color", "compiler", "file_in_path" and "locale". (Dominique Pelle) Files: src/ex_docmd.c, runtime/doc/map.txt Patch 7.3.258 Problem: MS-Windows: The edit with existing vim context menu entries can be unwanted. Solution: Let a registry entry disable them. (Jerome Vuarand) Files: src/GvimExt/gvimext.cpp Patch 7.3.259 Problem: Equivalence classes only work for latin characters. Solution: Add the Unicode equivalence characters. (Dominique Pelle) Files: runtime/doc/pattern.txt, src/regexp.c, src/testdir/test44.in, src/testdir/test44.ok Patch 7.3.260 Problem: CursorHold triggers on an incomplete mapping. (Will Gray) Solution: Don't trigger CursorHold when there is typeahead. Files: src/fileio.c Patch 7.3.261 Problem: G++ error message erroneously recognized as error. Solution: Ignore "In file included from" line also when it ends in a colon. (Fernando Castillo) Files: src/option.h Patch 7.3.262 Problem: Photon code style doesn't match Vim style. Solution: Clean up some of it. (Elias Diem) Files: src/gui_photon.c Patch 7.3.263 Problem: Perl and Tcl have a few code style problems. Solution: Clean it up. (Elias Diem) Files: src/if_perl.xs, src/if_tcl.c Patch 7.3.264 Problem: When the current directory name contains wildcard characters, such as "foo[with]bar", the tags file can't be found. (Jeremy Erickson) Solution: When searching for matching files also match without expanding wildcards. This is a bit of a hack. Files: src/vim.h, src/misc1.c, src/misc2.c Patch 7.3.265 Problem: When storing a pattern in search history there is no proper check for the separator character. Solution: Pass the separator character to in_history(). (Taro Muraoka) Files: src/ex_getln.c Patch 7.3.266 Problem: In Gvim with iBus typing space in Insert mode doesn't work. Solution: Clear xim_expected_char after checking it. Files: src/mbyte.c Patch 7.3.267 Problem: Ruby on Mac OS X 10.7 may crash. Solution: Avoid alloc(0). (Bjorn Winckler) Files: src/if_ruby.c Patch 7.3.268 Problem: Vim freezes when executing an external command with zsh. Solution: Use O_NOCTTY both in the master and slave. (Bjorn Winckler) Files: src/os_unix.c Patch 7.3.269 Problem: 'shellcmdflag' only works with one flag. Solution: Split into multiple arguments. (Gary Johnson) Files: src/os_unix.c Patch 7.3.270 Problem: Illegal memory access. Solution: Swap conditions. (Dominique Pelle) Files: src/ops.c Patch 7.3.271 Problem: Code not following Vim coding style. Solution: Fix the style. (Elias Diem) Files: src/gui_photon.c Patch 7.3.272 Problem: ":put =list" does not add an empty line for a trailing empty item. Solution: Add a trailing NL when turning a list into a string. Files: src/eval.c Patch 7.3.273 Problem: A BOM in an error file is seen as text. (Aleksey Baibarin) Solution: Remove the BOM from the text before evaluating. (idea by Christian Brabandt) Files: src/quickfix.c, src/mbyte.c, src/proto/mbyte.pro, src/testdir/test10.in Patch 7.3.274 Problem: With concealed characters tabs do not have the right size. Solution: Use VCOL_HLC instead of vcol. (Eiichi Sato) Files: src/screen.c Patch 7.3.275 Problem: MS-Windows: When using a black background some screen updates cause the window to flicker. Solution: Add WS_CLIPCHILDREN to CreateWindow(). (René Aguirre) Files: src/gui_w32.c Patch 7.3.276 Problem: GvimExt sets $LANG in the wrong way. Solution: Save the environment and use it for gvim. (Yasuhiro Matsumoto) Files: src/GvimExt/gvimext.cpp Patch 7.3.277 Problem: MS-Windows: some characters do not show in dialogs. Solution: Use the wide methods when available. (Yanwei Jia) Files: src/gui_w32.c, src/gui_w48.c, src/os_mswin.c, src/os_win32.c, src/os_win32.h Patch 7.3.278 Problem: Passing the file name to open in VisVim doesn't work. Solution: Adjust the index and check for end of buffer. (Jiri Sedlak) Files: src/VisVim/Commands.cpp Patch 7.3.279 Problem: With GTK, when gvim is full-screen and a tab is opened and using a specific monitor configuration the window is too big. Solution: Adjust the window size like on MS-Windows. (Yukihiro Nakadaira) Files: src/gui.c, src/gui_gtk_x11.c, src/proto/gui_gtk_x11.pro Patch 7.3.280 Problem: ":lmake" does not update the quickfix window title. Solution: Update the title. (Lech Lorens) Files: src/quickfix.c, src/testdir/test10.in, src/testdir/test10.ok Patch 7.3.281 Problem: After using "expand('%:8')" the buffer name is changed. Solution: Make a copy of the file name before shortening it. Files: src/eval.c Patch 7.3.282 Problem: When using input() and :echo in a loop the displayed text is incorrect. (Benjamin Fritz) Solution: Only restore the cursor position when there is a command line. (Ben Schmidt) Files: src/ex_getln.c Patch 7.3.283 Problem: An expression mapping with a multi-byte character containing a 0x80 byte gets messed up. (ZyX) Solution: Unescape the expression before evaluating it (Yukihiro Nakadaira) Files: src/getchar.c Patch 7.3.284 Problem: The str2special() function doesn't handle multi-byte characters properly. Solution: Recognize multi-byte characters. (partly by Vladimir Vichniakov) Files: src/getchar.c, src/message.c, src/misc2.c Patch 7.3.285 (after 7.3.284) Problem: Mapping <Char-123> no longer works. Solution: Properly check for "char-". Add a test for it. Files: src/misc2.c, src/testdir/test75.in, src/testdir/test75.ok Patch 7.3.286 Problem: Crash when using "zd" on a large number of folds. (Sam King) Solution: Recompute pointer after reallocating array. Move fewer entries when making room. Files: src/fold.c Patch 7.3.287 Problem: Can't compile with MSVC and tiny options. Solution: Move variables and #ifdefs. (Sergey Khorev) Files: src/os_win32.c Patch 7.3.288 Problem: has('python') may give an error message for not being able to load the library after using python3. Solution: Only give the error when the verbose argument is true. Files: src/if_python.c, src/if_python3.c Patch 7.3.289 Problem: Complete function isn't called when the leader changed. Solution: Call ins_compl_restart() when the leader changed. (Taro Muraoka) Files: src/edit.c Patch 7.3.290 Problem: When a BufWriteCmd autocommand resets 'modified' this doesn't change older buffer states to be marked as 'modified' like ":write" does. (Yukihiro Nakadaira) Solution: When the BufWriteCmd resets 'modified' then adjust the undo information like ":write" does. Files: src/fileio.c Patch 7.3.291 Problem: Configure doesn't work properly with Python3. Solution: Put -ldl before $LDFLAGS. Add PY3_NO_RTLD_GLOBAL. (Roland Puntaier) Files: src/config.h.in, src/auto/configure, src/configure.in Patch 7.3.292 Problem: Crash when using fold markers and selecting a visual block that includes a folded line and goes to end of line. (Sam Lidder) Solution: Check for the column to be MAXCOL. (James Vega) Files: src/screen.c Patch 7.3.293 Problem: MSVC compiler has a problem with non-ASCII characters. Solution: Avoid non-ASCII characters. (Hong Xu) Files: src/ascii.h, src/spell.c Patch 7.3.294 (after 7.3.289) Problem: Patch 289 causes more problems than it solves. Solution: Revert the patch until a better solution is found. Files: src/edit.c Patch 7.3.295 Problem: When filtering text with an external command Vim may not read all the output. Solution: When select() is interrupted loop and try again. (James Vega) Files: src/os_unix.c Patch 7.3.296 Problem: When writing to an external command a zombie process may be left behind. Solution: Wait on the process. (James Vega) Files: src/os_unix.c Patch 7.3.297 Problem: Can't load Perl 5.14 dynamically. Solution: Add code in #ifdefs. (Charles Cooper) Files: if_perl.xs Patch 7.3.298 Problem: Built-in colors are different from rgb.txt. Solution: Adjust the color values. (Benjamin Haskell) Files: src/gui_photon.c, src/gui_w48.c Patch 7.3.299 Problem: Source code not in Vim style. Solution: Adjust the style. (Elias Diem) Files: src/gui_photon.c Patch 7.3.300 Problem: Python doesn't parse multi-byte argument correctly. Solution: Use "t" instead of "s". (lilydjwg) Files: src/if_py_both.h Patch 7.3.301 Problem: When 'smartindent' and 'copyindent' are set a Tab is used even though 'expandtab' is set. Solution: Do not insert Tabs. Add a test. (Christian Brabandt) Files: src/misc1.c, src/testdir/test19.in, src/testdir/test19.ok Patch 7.3.302 (after 7.3.301) Problem: Test 19 fails without 'smartindent' and +eval. Solution: Don't use ":exe". Source small.vim. Files: src/testdir/test19.in Patch 7.3.303 (after 7.3.296) Problem: Compilation error. Solution: Correct return type from int to pid_t. (Danek Duvall) Files: src/os_unix.c Patch 7.3.304 Problem: Strawberry Perl doesn't work on MS-Windows. Solution: Use xsubpp if needed. (Yasuhiro Matsumoto) Files: src/Make_ming.mak, src/Make_mvc.mak Patch 7.3.305 Problem: Auto-loading a function while editing the command line causes scrolling up the display. Solution: Don't set msg_scroll when defining a function and the user is not typing. (Yasuhiro Matsumoto) Files: src/eval.c Patch 7.3.306 Problem: When closing a window there is a chance that deleting a scrollbar triggers a GUI resize, which uses the window while it is not in a valid state. Solution: Set the buffer pointer to NULL to be able to detect the invalid situation. Fix a few places that used the buffer pointer incorrectly. Files: src/buffer.c, src/ex_cmds.c, src/term.c, src/window.c Patch 7.3.307 Problem: Python 3 doesn't support slice assignment. Solution: Implement slices. (Brett Overesch, Roland Puntaier) Files: src/if_python3.c Patch 7.3.308 Problem: Writing to 'verbosefile' has problems, e.g. for :highlight. Solution: Do not use a separate verbose_write() function but write with the same code that does redirecting. (Yasuhiro Matsumoto) Files: src/message.c Patch 7.3.309 (after 7.3.307) Problem: Warnings for pointer types. Solution: Change PySliceObject to PyObject. Files: src/if_python3.c Patch 7.3.310 Problem: Code not following Vim style. Solution: Fix the style. (Elias Diem) Files: src/gui_photon.c Patch 7.3.311 (replaces 7.3.289) Problem: Complete function isn't called when the leader changed. Solution: Allow the complete function to return a dictionary with a flag that indicates ins_compl_restart() is to be called when the leader changes. (Taro Muraoka) Files: runtime/insert.txt, src/edit.c, src/eval.c, src/proto/eval.pro Patch 7.3.312 (after 7.3.306) Problem: Can't compile with tiny features. Solution: Add #ifdef around win_valid(). Files: src/buffer.c Patch 7.3.313 (after 7.3.307) Problem: One more warning when compiling with dynamic Python 3. Solution: Change PySliceObject to PyObject. Files: src/if_python3.c Patch 7.3.314 (after 7.3.304) Problem: Missing parenthesis. Solution: Add it. (Benjamin R. Haskell) Files: src/Make_mvc.mak Patch 7.3.315 Problem: Opening a window before forking causes problems for GTK. Solution: Fork first, create the window in the child and report back to the parent process whether it worked. If successful the parent exits, if unsuccessful the child exits and the parent continues in the terminal. (Tim Starling) Files: src/gui.c Patch 7.3.316 (after 7.3.306) Problem: Crash when 'colorcolumn' is set and closing buffer. Solution: Check for w_buffer to be NULL. (Yasuhiro Matsumoto) Files: src/option.c Patch 7.3.317 Problem: Calling debug.debug() in Lua may cause Vim to hang. Solution: Add a better debug method. (Rob Hoelz, Luis Carvalho) Files: src/if_lua.c Patch 7.3.318 Problem: "C" on the last line deletes that line if it's blank. Solution: Only delete the last line for a delete operation. (James Vega) Files: src/ops.c Patch 7.3.319 (after 7.3.311) Problem: Redobuff doesn't always include changes of the completion leader. Solution: Insert backspaces as needed. (idea by Taro Muraoka) Files: src/edit.c Patch 7.3.320 Problem: When a 0xa0 character is in a sourced file the error message for unrecognized command does not show the problem. Solution: Display 0xa0 as <a0>. Files: src/ex_docmd.c Patch 7.3.321 Problem: Code not following Vim style. Solution: Fix the style. (Elias Diem) Files: src/os_qnx.c Patch 7.3.322 Problem: #ifdef for PDP_RETVAL doesn't work, INT_PTR can be a typedef. Solution: Check the MSC version and 64 bit flags. (Sergiu Dotenco) Files: src/os_mswin.c Patch 7.3.323 Problem: The default 'errorformat' does not ignore some "included from" lines. Solution: Add a few more patterns. (Ben Boeckel) Files: src/option.h Patch 7.3.324 (after 7.3.237) Problem: Completion for ":compiler" shows color scheme names. Solution: Fix the directory name. (James Vega) Files: src/ex_getln.c Patch 7.3.325 Problem: A duplicated function argument gives an internal error. Solution: Give a proper error message. (based on patch by Tyru) Files: src/eval.c Patch 7.3.326 Problem: MingW 4.6 no longer supports the -mno-cygwin option. Solution: Split the Cygwin and MingW makefiles. (Matsushita Shougo) Files: src/GvimExt/Make_cyg.mak, src/GvimExt/Make_ming.mak, src/Make_cyg.mak, src/Make_ming.mak, src/xxd/Make_ming.mak, Filelist Patch 7.3.327 Problem: When jumping to a help tag a closed fold doesn't open. Solution: Save and restore KeyTyped. (Yasuhiro Matsumoto) Files: src/ex_cmds.c Patch 7.3.328 Problem: When command line wraps the cursor may be displayed wrong when there are multi-byte characters. Solution: Position the cursor before drawing the text. (Yasuhiro Matsumoto) Files: src/ex_getln.c Patch 7.3.329 Problem: When skipping over code from ":for" to ":endfor" get an error for calling a dict function. (Yasuhiro Matsumoto) Solution: Ignore errors when skipping over :call command. Files: src/ex_docmd.c, src/eval.c Patch 7.3.330 Problem: When longjmp() is invoked if the X server gives an error the state is not properly restored. Solution: Reset vgetc_busy. (Yukihiro Nakadaira) Files: src/main.c Patch 7.3.331 Problem: "vit" selects wrong text when a tag name starts with the same text as an outer tag name. (Ben Fritz) Solution: Add "\>" to the pattern to check for word boundary. Files: src/search.c Patch 7.3.332 (after 7.3.202) Problem: Indent after "public:" is not increased in C++ code. (Lech Lorens) Solution: Check for namespace after the regular checks. (partly by Martin Gieseking) Files: src/misc1.c, src/testdir/test3.in, src/testdir/test3.ok Patch 7.3.333 Problem: Using "." to repeat a Visual delete counts the size in bytes, not characters. (Connor Lane Smith) Solution: Store the virtual column numbers instead of byte positions. Files: src/normal.c Patch 7.3.334 Problem: Latest MingW about XSUBPP referencing itself. (Gongqian Li) Solution: Rename the first use to XSUBPPTRY. Files: src/Make_ming.mak Patch 7.3.335 Problem: When 'imdisable' is reset from an autocommand in Insert mode it doesn't take effect. Solution: Call im_set_active() in Insert mode. (Taro Muraoka) Files: src/option.c Patch 7.3.336 Problem: When a tags file specifies an encoding different from 'enc' it may hang and using a pattern doesn't work. Solution: Convert the whole line. Continue reading the header after the SORT tag. Add test83. (Yukihiro Nakadaira) Files: src/tag.c, src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak, src/testdir/Make_ming.mak, src/testdir/Make_os2.mak, src/testdir/Make_vms.mms, src/testdir/Makefile, src/testdir/test83-tags2, src/testdir/test83-tags3, src/testdir/test83.in, src/testdir/test83.ok Patch 7.3.337 (after 7.3.295) Problem: Screen doesn't update after resizing the xterm until a character is typed. Solution: When the select call is interrupted check do_resize. (Taylor Hedberg) Files: src/os_unix.c Patch 7.3.338 Problem: Using getchar() in an expression mapping doesn't work well. Solution: Don't save and restore the typeahead. (James Vega) Files: src/getchar.c, src/testdir/test34.ok Patch 7.3.339 Problem: "make shadow" doesn't link all test files. Solution: Add a line in Makefile and Filelist. Files: src/Makefile, Filelist Patch 7.3.340 Problem: When 'verbosefile' is set ftplugof.vim can give an error. Solution: Only remove filetypeplugin autocommands when they exist. (Yasuhiro Matsumoto) Files: runtime/ftplugof.vim Patch 7.3.341 Problem: Local help files are only listed in help.txt, not in translated help files. Solution: Also find translated help files. (Yasuhiro Matsumoto) Files: src/ex_cmds.c Patch 7.3.342 Problem: Code not in Vim style. Solution: Fix the style. (Elias Diem) Files: src/os_amiga.c, src/os_mac_conv.c, src/os_win16.c Patch 7.3.343 Problem: No mouse support for urxvt. Solution: Implement urxvt mouse support, also for > 252 columns. (Yiding Jia) Files: src/feature.h, src/keymap.h, src/option.h, src/os_unix.c, src/term.c, src/version.c Patch 7.3.344 Problem: Problem with GUI startup related to XInitThreads. Solution: Use read() and write() instead of fputs() and fread(). (James Vega) Files: src/gui.c Patch 7.3.345 Problem: When switching language with ":lang" the window title doesn't change until later. Solution: Update the window title right away. (Dominique Pelle) Files: src/ex_cmds2.c Patch 7.3.346 Problem: It's hard to test netbeans commands. Solution: Process netbeans commands after :sleep. (Xavier de Gaye) Files: runtime/doc/netbeans.txt, src/ex_docmd.c, src/netbeans.c Patch 7.3.347 Problem: When dropping text from a browser on Vim it receives HTML even though "html" is excluded from 'clipboard'. (Andrei Avk) Solution: Fix the condition for TARGET_HTML. Files: src/gui_gtk_x11.c Patch 7.3.348 Problem: "call range(1, 947948399)" causes a crash. (ZyX) Solution: Avoid a loop in the out of memory message. Files: src/misc2.c Patch 7.3.349 Problem: When running out of memory during startup trying to open a swapfile will loop forever. Solution: Let findswapname() set dirp to NULL if out of memory. Files: src/memline.c Patch 7.3.350 Problem: Block of code after ":lua << EOF" may not work. (Paul Isambert) Solution: Recognize the ":lua" command, skip to EOF. Files: src/eval.c Patch 7.3.351 Problem: Text formatting uses start of insert position when it should not. (Peter Wagenaar) Solution: Do not use Insstart when intentionally formatting. Files: src/edit.c Patch 7.3.352 Problem: When completing methods dict functions and script-local functions get in the way. Solution: Sort function names starting with "<" to the end. (Yasuhiro Matsumoto) Files: src/ex_getln.c Patch 7.3.353 (after 7.3.343) Problem: Missing part of the urxvt patch. Solution: Add the change in term.c Files: src/term.c Patch 7.3.354 Problem: ":set backspace+=eol" doesn't work when 'backspace' has a backwards compatible value of 2. Solution: Convert the number to a string. (Hirohito Higashi) Files: src/option.c Patch 7.3.355 Problem: GTK warnings when using netrw.vim. (Ivan Krasilnikov) Solution: Do not remove the beval event handler twice. Files: src/option.c Patch 7.3.356 Problem: Using "o" with 'cindent' set may freeze Vim. (lolilolicon) Solution: Skip over {} correctly. (Hari G) Files: src/misc1.c Patch 7.3.357 Problem: Compiler warning in MS-Windows console build. Solution: Adjust return type of PrintHookProc(). (Mike Williams) Files: src/os_mswin.c Patch 7.3.358 (after 7.3.353) Problem: Mouse support doesn't work properly. Solution: Add HMT_URXVT. (lilydjwg, James McCoy) Files: src/term.c Patch 7.3.359 Problem: Command line completion shows dict functions. Solution: Skip dict functions for completion. (Yasuhiro Matsumoto) Files: src/eval.c Patch 7.3.360 Problem: Interrupting the load of an autoload function may cause a crash. Solution: Do not use the hashitem when not valid. (Yukihiro Nakadaira) Files: src/eval.c Patch 7.3.361 Problem: Accessing memory after it is freed when EXITFREE is defined. Solution: Don't access curwin when firstwin is NULL. (Dominique Pelle) Files: src/buffer.c Patch 7.3.362 Problem: ml_get error when using ":g" with folded lines. Solution: Adjust the line number for changed_lines(). (Christian Brabandt) Files: src/ex_cmds.c Patch 7.3.363 Problem: C indenting is wrong after #endif followed by a semicolon. Solution: Add special handling for a semicolon in a line by itself. (Lech Lorens) Files: src/misc1.c, src/testdir/test3.in, src/testdir/test3.ok Patch 7.3.364 (after 7.3.353) Problem: Can't compile on HP-UX. (John Marriott) Solution: Only use TTYM_URXVT when it is defined. Files: src/term.c Patch 7.3.365 Problem: Crash when using a large Unicode character in a file that has syntax highlighting. (ngollan) Solution: Check for going past the end of the utf tables. (Dominique Pelle) Files: src/mbyte.c Patch 7.3.366 Problem: A tags file with an extremely long name causes errors. Solution: Ignore tags that are too long. (Arno Renevier) Files: src/tag.c Patch 7.3.367 Problem: :wundo and :rundo use a wrong checksum. Solution: Include the last line when computing the hash. (Christian Brabandt) Files: src/undo.c Patch 7.3.368 Problem: Gcc complains about redefining _FORTIFY_SOURCE. Solution: Undefine it before redefining it. Files: src/Makefile, src/configure.in, src/auto/configure Patch 7.3.369 Problem: When compiled with Gnome get an error message when using --help. Solution: Don't fork. (Ivan Krasilnikov) Files: src/main.c Patch 7.3.370 Problem: Compiler warns for unused variable in Lua interface. Solution: Remove the variable. Files: src/if_lua.c Patch 7.3.371 Problem: Crash in autocomplete. (Greg Weber) Solution: Check not going over allocated buffer size. Files: src/misc2.c Patch 7.3.372 Problem: When using a command line mapping to <Up> with file name completion to go one directory up, 'wildchar' is inserted. (Yasuhiro Matsumoto) Solution: Set the KeyTyped flag. Files: src/ex_getln.c Patch 7.3.373 (after 7.3.366) Problem: A tags file with an extremely long name may cause an infinite loop. Solution: When encountering a long name switch to linear search. Files: src/tag.c Patch 7.3.374 Problem: ++encoding does not work properly. Solution: Recognize ++encoding before ++enc. (Charles Cooper) Files: src/ex_docmd.c Patch 7.3.375 Problem: Duplicate return statement. Solution: Remove the superfluous one. (Dominique Pelle) Files: src/gui_mac.c Patch 7.3.376 Problem: Win32: Toolbar repainting does not work when the mouse pointer hovers over a button. Solution: Call DefWindowProc() when not handling an event. (Sergiu Dotenco) Files: src/gui_w32.c Patch 7.3.377 Problem: No support for bitwise AND, OR, XOR and invert. Solution: Add and(), or(), invert() and xor() functions. Files: src/eval.c, src/testdir/test49.in, src/testdir/test65.in, src/testdir/test65.ok, runtime/doc/eval.txt Patch 7.3.378 Problem: When cross-compiling the check for uint32_t fails. Solution: Only give a warning message. (Maksim Melnikau) Files: src/configure.in, src/auto/configure Patch 7.3.379 Problem: C-indenting wrong for static enum. Solution: Skip over "static". (Lech Lorens) Files: src/misc1.c, src/testdir/test3.in, src/testdir/test3.ok Patch 7.3.380 Problem: C-indenting wrong for a function header. Solution: Skip to the start paren. (Lech Lorens) Files: src/misc1.c, src/testdir/test3.in, src/testdir/test3.ok Patch 7.3.381 Problem: Configure silently skips interfaces that won't work. Solution: Add the --enable-fail_if_missing argument. (Shlomi Fish) Files: src/Makefile, src/configure.in, src/auto/configure Patch 7.3.382 (after 7.3.376) Problem: IME characters are inserted twice. Solution: Do not call DefWindowProc() if the event was handled. (Yasuhiro Matsumoto) Files: src/gui_w32.c Patch 7.3.383 Problem: For EBCDIC pound sign is defined as 't'. Solution: Correctly define POUND. Files: src/ascii.h Patch 7.3.384 Problem: Mapping CTRL-K in Insert mode breaks CTRL-X CTRL-K for dictionary completion. Solution: Add CTRL-K to the list of recognized keys. (James McCoy) Files: src/edit.c Patch 7.3.385 Problem: When using an expression mapping on the command line the cursor ends up in the wrong place. (Yasuhiro Matsumoto) Solution: Save and restore msg_col and msg_row when evaluating the expression. Files: src/getchar. Patch 7.3.386 Problem: Test 83 fails when iconv does not support cp932. (raf) Solution: Test if conversion works. (Yukihiro Nakadaira) Files: src/testdir/test83.in Patch 7.3.387 (after 7.3.386) Problem: Test 83 may fail for some encodings. Solution: Set 'encoding' to utf-8 earlier. Files: src/testdir/test83.in Patch 7.3.388 Problem: Crash on exit when EXITFREE is defined and using tiny features. Solution: Check for NULL window pointer. (Dominique Pelle) Files: src/buffer.c Patch 7.3.389 Problem: After typing at a prompt the "MORE" message appears too soon. Solution: reset lines_left in msg_end_prompt(). (Eswald) Files: src/message.c Patch 7.3.390 Problem: Using NULL buffer pointer in a window. Solution: Check for w_buffer being NULL in more places. (Bjorn Winckler) Files: src/ex_cmds.c, src/quickfix.c, src/window.c Patch 7.3.391 Problem: Can't check if the XPM_W32 feature is enabled. Solution: Add xpm_w32 to the list of features. (kat) Files: src/eval.c Patch 7.3.392 Problem: When setting 'undofile' while the file is already loaded but unchanged, try reading the undo file. (Andy Wokula) Solution: Compute a checksum of the text when 'undofile' is set. (Christian Brabandt) Files: src/option.c, src/testdir/test72.in, src/testdir/test72.ok Patch 7.3.393 Problem: Win32: When resizing Vim it is always moved to the primary monitor if the secondary monitor is on the left. Solution: Use the nearest monitor. (Yukihiro Nakadaira) Files: src/gui_w32.c Patch 7.3.394 Problem: When placing a mark while starting up a screen redraw messes up the screen. (lith) Solution: Don't redraw while still starting up. (Christian Brabandt) Files: src/screen.c Patch 7.3.395 (after 7.3.251) Problem: "dv?bar" in the last line deletes too much and breaks undo. Solution: Only adjust the cursor position when it's after the last line of the buffer. Add a test. (Christian Brabandt) Files: src/ops.c, src/testdir/test43.in, src/testdir/test43.ok Patch 7.3.396 Problem: After forcing an operator to be characterwise it can still become linewise when spanning whole lines. Solution: Don't make the operator linewise when motion_force was set. (Christian Brabandt) Files: src/ops.c Patch 7.3.397 Problem: ":helpgrep" does not work properly when 'encoding' is not utf-8 or latin1. Solution: Convert non-ascii lines to 'encoding'. (Yasuhiro Matsumoto) Files: src/quickfix.c, src/spell.c, src/misc2.c, src/proto/misc2.pro Patch 7.3.398 Problem: When creating more than 10 location lists and adding items one by one a previous location may be used. (Audrius Kažukauskas) Solution: Clear the location list completely when adding the tenth one. Files: src/quickfix.c Patch 7.3.399 Problem: ":cd" doesn't work when the path contains wildcards. (Yukihiro Nakadaira) Solution: Ignore wildcard errors when the EW_NOTWILD flag is used. Files: src/misc1.c Patch 7.3.400 Problem: Compiler warnings for shadowed variables. Solution: Remove or rename the variables. Files: src/charset.c, src/digraph.c, src/edit.c, src/eval.c, src/fold.c, src/getchar.c, src/message.c, src/misc2.c, src/move.c, src/netbeans.c, src/option.c, src/os_unix.c, src/screen.c, src/search.c, src/spell.c, src/syntax.c, src/tag.c, src/window.c Patch 7.3.401 Problem: A couple more shadowed variables. Solution: Rename the variables. Files: src/netbeans.c Patch 7.3.402 Problem: When jumping to the first error a line of the buffer is sometimes redrawn on top of the list of errors. Solution: Do not call update_topline_redraw() if the display was scrolled up. Files: src/quickfix.c Patch 7.3.403 Problem: ":helpgrep" does not trigger QuickFixCmd* autocommands. Solution: Trigger the autocommands. (Christian Brabandt) Files: src/quickfix.c Patch 7.3.404 Problem: When a complete function uses refresh "always" redo will not work properly. Solution: Do not reset compl_leader when compl_opt_refresh_always is set. (Yasuhiro Matsumoto) Files: src/edit.c Patch 7.3.405 Problem: When xterm gets back the function keys it may delete the urxvt mouse termcap code. Solution: Check for the whole code, not just the start. (Egmont Koblinger) Files: src/keymap.h, src/misc2.c, src/term.c Patch 7.3.406 Problem: Multi-byte characters in b:browsefilter are not handled correctly. Solution: First use convert_filter() normally and then convert to wide characters. (Taro Muraoka) Files: src/gui_w48.c Patch 7.3.407 Problem: ":12verbose call F()" may duplicate text while trying to truncate. (Thinca) Solution: Only truncate when there is not enough room. Also check the byte length of the buffer. Files: src/buffer.c, src/eval.c, src/ex_getln.c, src/message.c, src/proto/message.pro Patch 7.3.408 (after 7.3.406) Problem: Missing declaration. Solution: Add the declaration. (John Marriott) Files: src/gui_w48.c Patch 7.3.409 Problem: The license in pty.c is unclear. Solution: Add a comment about the license. Files: src/pty.c Patch 7.3.410 Problem: Compiler error for // comment. (Joachim Schmitz) Solution: Turn into /* comment */. Files: src/message.c Patch 7.3.411 Problem: Pasting in Visual mode using the "" register does not work. (John Beckett) Solution: Detect that the write is overwriting the pasted register. (Christian Brabandt) Files: src/normal.c Patch 7.3.412 Problem: Storing a float in a session file has an additional '&'. Solution: Remove the '&'. (Yasuhiro Matsumoto) Files: src/eval.c Patch 7.3.413 Problem: Build warnings on MS-Windows. Solution: Add type casts. (Mike Williams) Files: src/ex_getln.c, src/message.c, src/term.c Patch 7.3.414 Problem: Using CTRL-A on "000" drops the leading zero, while on "001" it doesn't. Solution: Detect "000" as an octal number. (James McCoy) Files: src/charset.c Patch 7.3.415 (after 7.3.359) Problem: Completion of functions stops once a dictionary is encountered. (James McCoy) Solution: Return an empty string instead of NULL. Files: src/eval.c Patch 7.3.416 (after 7.3.415) Problem: Compiler warning for wrong pointer. Solution: Add type cast. Files: src/eval.c Patch 7.3.417 (after 7.3.395) Problem: Test 43 fails with a tiny build. Solution: Only run test 43 with at least a small build. Files: src/testdir/test43.in Patch 7.3.418 Problem: When a user complete function returns -1 an error message is given. Solution: When -2 is returned stop completion silently. (Yasuhiro Matsumoto) Files: src/edit. Patch 7.3.419 Problem: DBCS encoding in a user command does not always work. Solution: Skip over DBCS characters. (Yasuhiro Matsumoto) Files: src/ex_docmd.c Patch 7.3.420 Problem: "it" and "at" don't work properly with a dash in the tag name. Solution: Require a space to match the tag name. (Christian Brabandt) Files: src/search.c Patch 7.3.421 Problem: Get E832 when setting 'undofile' in vimrc and there is a file to be edited on the command line. (Toothpik) Solution: Do not try reading the undo file for a file that wasn't loaded. Files: src/option.c Patch 7.3.422 Problem: Python 3 does not have __members__. Solution: Add "name" and "number" in another way. (lilydjwg) Files: src/if_py_both.h, src/if_python3.c Patch 7.3.423 Problem: Small mistakes in comments, proto and indent. Solution: Fix the mistakes. Files: src/ex_cmds2.c, src/structs.h, src/ui.c, src/proto/ex_docmd.pro Patch 7.3.424 Problem: Win16 version missing some functions. Solution: Add #defines for the functions. Files: src/gui_w16.c Patch 7.3.425 (after 7.3.265) Problem: Search history lines are duplicated. (Edwin Steiner) Solution: Convert separator character from space to NUL. Files: src/ex_getln.c Patch 7.3.426 Problem: With '$' in 'cpoptions' the $ is not displayed in the first column. Solution: Use -1 instead of 0 as a special value. (Hideki Eiraku and Hirohito Higashi) Files: src/edit.c, src/globals.h, src/move.c, src/screen.c, src/search.c Patch 7.3.427 Problem: readfile() can be slow with long lines. Solution: Use realloc() instead of alloc(). (John Little) Files: src/eval.c Patch 7.3.428 Problem: Win32: an xpm file without a mask crashes Vim. Solution: Fail when the mask is missing. (Dave Bodenstab) Files: src/xpm_w32.c Patch 7.3.429 Problem: When 'cpoptions' includes "E" "c0" in the first column is an error. The redo register is then set to the erroneous command. Solution: Do not set the redo register if the command fails because of an empty region. (Hideki Eiraku) Files: src/getchar.c, src/normal.c, src/proto/getchar.pro Patch 7.3.430 Problem: When a custom filetype detection uses "augroup END" the conf fileytpe detection does not have the filetypedetect group. Solution: Always end the group and include filetypedetect in the conf autocommand. (Lech Lorens) Files: runtime/filetype.vim Patch 7.3.431 Problem: Fetching a key at a prompt may be confused by escape sequences. Especially when getting a prompt at a VimEnter autocommand. (Alex Efros) Solution: Properly handle escape sequences deleted by check_termcode(). Files: src/getchar.c, src/misc1.c, src/term.c, src/proto/term.pro Patch 7.3.432 Problem: ACLs are not supported for ZFS or NFSv4 on Solaris. Solution: Add configure check and code. (Danek Duvall) Files: src/configure.in, src/auto/configure, src/config.h.in, src/os_unix.c Patch 7.3.433 Problem: Using continued lines in a Vim script can be slow. Solution: Instead of reallocating for every line use a growarray. (Yasuhiro Matsumoto) Files: src/ex_cmds2.c Patch 7.3.434 Problem: Using join() can be slow. Solution: Compute the size of the result before allocation to avoid a lot of allocations and copies. (Taro Muraoka) Files: src/eval.c Patch 7.3.435 Problem: Compiler warning for unused variable. Solution: Move the variable inside #ifdef. Files: src/ex_cmds2.c Patch 7.3.436 Problem: Compiler warnings for types on Windows. Solution: Add type casts. (Mike Williams) Files: src/eval.c Patch 7.3.437 Problem: Continue looping inside FOR_ALL_TAB_WINDOWS even when already done. Solution: Use goto instead of break. (Hirohito Higashi) Files: src/fileio.c, src/globals.h Patch 7.3.438 Problem: There is no way to avoid ":doautoall" reading modelines. Solution: Add the <nomodeline> argument. Adjust documentation. Files: src/fileio.c, runtime/doc/autocmd.txt Patch 7.3.439 Problem: Compiler warnings to size casts in Perl interface. Solution: Use XS macros. (James McCoy) Files: src/if_perl.xs, src/typemap Patch 7.3.440 Problem: Vim does not support UTF8_STRING for the X selection. Solution: Add UTF8_STRING atom support. (Alex Efros) Use it only when 'encoding' is set to Unicode. Files: src/ui.c Patch 7.3.441 Problem: Newer versions of MzScheme (Racket) require earlier (trampolined) initialisation. Solution: Call mzscheme_main() early in main(). (Sergey Khorev) Files: src/Make_mvc.mak, src/if_mzsch.c, src/main.c, src/proto/if_mzsch.pro Patch 7.3.442 (after 7.3.438) Problem: Still read modelines for ":doautocmd". Solution: Move check for <nomodeline> to separate function. Files: src/fileio.c, src/ex_docmd.c, src/proto/fileio.pro, runtime/doc/autocmd.txt Patch 7.3.443 Problem: MS-Windows: 'shcf' and 'shellxquote' defaults are not very good. Solution: Make a better guess when 'shell' is set to "cmd.exe". (Ben Fritz) Files: src/option.c, runtime/doc/options.txt Patch 7.3.444 Problem: ":all!" and ":sall!" give error E477, even though the documentation says these are valid commands. Solution: Support the exclamation mark. (Hirohito Higashi) Files: src/ex_cmds.h, src/testdir/test31.in, src/testdir/test31.ok Patch 7.3.445 (after 7.3.443) Problem: Can't properly escape commands for cmd.exe. Solution: Default 'shellxquote' to '('. Append ')' to make '(command)'. No need to use "/s" for 'shellcmdflag'. Files: src/misc2.c, src/option.c, src/os_win32.c Patch 7.3.446 (after 7.3.445) Problem: Win32: External commands with special characters don't work. Solution: Add the 'shellxescape' option. Files: src/misc2.c, src/option.c, src/option.h, runtime/doc/options.txt Patch 7.3.447 (after 7.3.446) Problem: Win32: External commands with "start" do not work. Solution: Unescape part of the command. (Yasuhiro Matsumoto) Files: src/os_win32.c Patch 7.3.448 (after 7.3.447) Problem: Win32: Still a problem with "!start /b". Solution: Escape only '|'. (Yasuhiro Matsumoto) Files: src/os_win32.c Patch 7.3.449 Problem: Crash when a BufWinLeave autocommand closes the only other window. (Daniel Hunt) Solution: Abort closing a buffer when it becomes the only one. Files: src/buffer.c, src/proto/buffer.pro, src/ex_cmds.c, src/ex_getln.c, src/misc2.c, src/quickfix.c, src/window.c, src/proto/window.pro Patch 7.3.450 (after 7.3.448) Problem: Win32: Still a problem with "!start /b". Solution: Fix pointer use. (Yasuhiro Matsumoto) Files: src/os_win32.c Patch 7.3.451 Problem: Tcl doesn't work on 64 MS-Windows. Solution: Make it work. (Dave Bodenstab) Files: src/Make_mvc.mak, src/if_tcl.c Patch 7.3.452 Problem: Undo broken when pasting close to the last line. (Andrey Radev) Solution: Use a flag to remember if the deleted included the last line. (Christian Brabandt) Files: src/ops.c Patch 7.3.453 Problem: Pasting in the command line is slow. Solution: Don't redraw if there is another character to read. (Dominique Pelle) Files: src/ex_getln.c Patch 7.3.454 Problem: Re-allocating memory slows Vim down. Solution: Use realloc() in ga_grow(). (Dominique Pelle) Files: src/misc2.c Patch 7.3.455 Problem: Using many continuation lines can be slow. Solution: Adjust the reallocation size to the current length. Files: src/ex_cmds2.c Patch 7.3.456 Problem: ":tab drop file" has several problems, including moving the current window and opening a new tab for a file that already has a window. Solution: Refactor ":tab drop" handling. (Hirohito Higashi) Files: src/buffer.c, src/testdir/test62.in, src/testdir/test62.ok Patch 7.3.457 Problem: When setting $VIMRUNTIME later the directory for fetching translated messages is not adjusted. Solution: Put bindtextdomain() in vim_setenv(). Files: src/misc1.c Patch 7.3.458 Problem: Crash when calling smsg() during startup. Solution: Don't use 'shortmess' when it is not set yet. Files: src/option.c Patch 7.3.459 Problem: Win32: Warnings for type conversion. Solution: Add type casts. (Mike Williams) Files: src/misc2.c, src/os_win32.c Patch 7.3.460 Problem: Win32: UPX does not compress 64 bit binaries. Solution: Mention and add the alternative: mpress. (Dave Bodenstab) Files: src/INSTALLpc.txt, src/Make_ming.mak Patch 7.3.461 Problem: The InsertCharPre autocommand event is not triggered during completion and when typing several characters quickly. Solution: Also trigger InsertCharPre during completion. Do not read ahead when an InsertCharPre autocommand is defined. (Yasuhiro Matsumoto) Files: src/edit.c, src/fileio.c, src/proto/fileio.pro Patch 7.3.462 Problem: When using ":loadview" folds may be closed unexpectedly. Solution: Take into account foldlevel. (Xavier de Gaye) Files: src/fold.c Patch 7.3.463 Problem: When using ":s///c" the cursor is moved away from the match. (Lawman) Solution: Don't move the cursor when do_ask is set. (Christian Brabandt) Files: src/ex_cmds.c Patch 7.3.464 Problem: Compiler warning for sprintf. Solution: Put the length in a variable. (Dominique Pelle) Files: src/version.c Patch 7.3.465 Problem: Cannot get file name with newline from glob(). Solution: Add argument to glob() and expand() to indicate they must return a list. (Christian Brabandt) Files: runtime/doc/eval.txt, src/eval.c, src/ex_getln.c, src/vim.h Patch 7.3.466 Problem: Get ml_get error hen ":behave mswin" was used and selecting several lines. (A. Sinan Unur) Solution: Adjust the end of the operation. (Christian Brabandt) Files: src/ops.c Patch 7.3.467 Problem: Cursor positioned wrong at the command line when regaining focus and using some input method. Solution: Do not position the cursor in command line mode. Files: src/mbyte.c Patch 7.3.468 Problem: For some compilers the error file is not easily readable. Solution: Use QuickFixCmdPre for more commands. (Marcin Szamotulski) Files: runtime/doc/autocmd.txt, src/quickfix.c Patch 7.3.469 Problem: Compiler warning for unused argument without some features. Solution: Add UNUSED. Files: src/buffer.c Patch 7.3.470 Problem: Test 62 fails when compiled without GUI and X11. Solution: Don't test :drop when it is not supported. Files: src/testdir/test62.in Patch 7.3.471 Problem: Can't abort listing placed signs. Solution: Check "got_int". (Christian Brabandt) Files: src/buffer.c, src/ex_cmds.c Patch 7.3.472 Problem: Crash when using ":redraw" in a BufEnter autocommand and switching to another tab. (驼峰) Solution: Move triggering the autocommands to after correcting the option values. Also check the row value to be out of bounds. (Christian Brabandt, Sergey Khorev) Files: src/screen.c, src/window.c Patch 7.3.473 Problem: 'cursorbind' does not work correctly in combination with 'virtualedit' set to "all". Solution: Copy coladd. (Gary Johnson) Files: src/move.c Patch 7.3.474 Problem: Perl build with gcc 4 fails. Solution: Remove XS() statements. (Yasuhiro Matsumoto) Files: src/if_perl.xs Patch 7.3.475 Problem: In a terminal with few colors the omnicomplete menu may be hard to see when using the default colors. Solution: Use more explicit colors. (suggested by Alex Henrie) Files: src/syntax.c Patch 7.3.476 Problem: When selecting a block, using "$" to include the end of each line and using "A" and typing a backspace strange things happen. (Yuangchen Xie) Solution: Avoid using a negative length. (Christian Brabandt) Files: src/ops.c Patch 7.3.477 Problem: Using ":echo" to output enough lines to scroll, then using "j" and "k" at the more prompt, displays the command on top of the output. (Marcin Szamotulski) Solution: Put the output below the command. (Christian Brabandt) Files: src/eval.c Patch 7.3.478 Problem: Memory leak using the ':rv!' command when reading dictionary or list global variables i.e. with 'viminfo' containing !. Solution: Free the typeval. (Dominique Pelle) Files: src/eval.c Patch 7.3.479 Problem: When 'cursorline' is set the line number highlighting can't be set separately. Solution: Add "CursorLineNr". (Howard Buchholz) Files: src/option.c, src/screen.c, src/syntax.c, src/vim.h Patch 7.3.480 Problem: When using ":qa" and there is a changed buffer picking the buffer to jump to is not very good. Solution: Consider current and other tab pages. (Hirohito Higashi) Files: src/ex_cmds2.c Patch 7.3.481 Problem: Changing 'virtualedit' in an operator function to "all" does not have the desired effect. (Aaron Bohannon) Solution: Save, reset and restore virtual_op when executing an operator function. Files: src/normal.c Patch 7.3.482 Problem: With 'cursorbind' set moving up/down does not always keep the same column. Solution: Set curswant appropriately. (Gary Johnson) Files: src/move.c Patch 7.3.483 (after 7.3.477) Problem: More prompt shows up too often. Solution: Instead of adding a line break, only start a new line in the message history. (Christian Brabandt) Files: src/eval.c, src/message.c, src/proto/message.pro Patch 7.3.484 Problem: The -E and --echo-wid command line arguments are not mentioned in "vim --help". Solution: Add the help lines. (Dominique Pelle) Files: src/main.c Patch 7.3.485 Problem: When building Vim LDFLAGS isn't passed on to building xxd. Solution: Pass the LDFLAGS value. (James McCoy) Files: src/Makefile Patch 7.3.486 Problem: Build error with mingw64 on Windows 7. Solution: Avoid the step of going through vimres.res. (Guopeng Wen) Files: src/Make_ming.mak Patch 7.3.487 Problem: When setting 'timeoutlen' or 'ttimeoutlen' the column for vertical movement is reset unnecessarily. Solution: Do not set w_set_curswant for every option. Add a test for this. (Kana Natsuno) Add the P_CURSWANT flag for options. Files: src/option.c, src/testdir/test84.in, src/testdir/test84.ok, src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak, src/testdir/Make_ming.mak, src/testdir/Make_os2.mak, src/testdir/Make_vms.mms, src/testdir/Makefile Patch 7.3.488 Problem: ":help!" in a help file does not work as documented. Solution: When in a help file don't give an error message. (thinca) Files: src/ex_cmds.c Patch 7.3.489 Problem: CTRL-] in Insert mode does not expand abbreviation when used in a mapping. (Yichao Zhou) Solution: Special case using CTRL-]. (Christian Brabandt) Files: src/getchar.c, src/edit.c Patch 7.3.490 Problem: Member confusion in Lua interface. Solution: Fix it. Add luaeval(). (Taro Muraoka, Luis Carvalho) Files: runtime/doc/if_lua.txt, src/eval.c, src/if_lua.c, src/proto/if_lua.pro Patch 7.3.491 Problem: No tests for Lua. Solution: Add some simple tests for Lua. (Luis Carvalho) Files: src/testdir/test1.in, src/testdir/test85.in, src/testdir/test85.ok src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak, src/testdir/Make_ming.mak, src/testdir/Make_os2.mak, src/testdir/Make_vms.mms, src/testdir/Makefile Patch 7.3.492 Problem: Can't indent conditions separately from function arguments. Solution: Add the 'k' flag in 'cino'. (Lech Lorens) Files: runtime/doc/indent.txt, src/misc1.c, src/testdir/test3.in, src/testdir/test3.ok Patch 7.3.493 (after 7.3.492) Problem: Two unused variables. Solution: Remove them. (Hong Xu) Files: src/misc1.c Patch 7.3.494 (after 7.3.491) Problem: Can't compile with Lua 5.1 or dynamic Lua. Solution: Fix dll_ methods. Fix luado(). (Muraoka Taro, Luis Carvalho) Files: src/if_lua.c Patch 7.3.495 (after 7.3.492) Problem: Compiler warnings. Solution: Add function declaration. Remove "offset" argument. Files: src/misc1.c Patch 7.3.496 Problem: MS-DOS: When "diff" trips over difference in line separators some tests fail. Solution: Make some .ok files use unix line separators. (David Pope) Files: src/testdir/Make_dos.mak, src/testdir/Make_ming.mak Patch 7.3.497 Problem: Crash when doing ":python print" and compiled with gcc and the optimizer enabled. Solution: Avoid the crash, doesn't really fix the problem. (Christian Brabandt) Files: src/if_py_both.h Patch 7.3.498 Problem: The behavior of the "- register changes depending on value of the 'clipboard' option. (Szamotulski) Solution: Also set the "- register when the register is "*" or "+". (Christian Brabandt) Files: src/ops.c Patch 7.3.499 Problem: When using any interface language when Vim is waiting for a child process it gets confused by a child process started through the interface. Solution: Always used waitpid() instead of wait(). (Yasuhiro Matsumoto) Files: src/os_unix.c Patch 7.3.500 Problem: Ming makefile unconditionally sets WINVER. Solution: Only defined when not already defined. (Yasuhiro Matsumoto) Files: src/Make_ming.mak Patch 7.3.501 Problem: Error for "flush" not being defined when using Ruby command. Solution: Defined "flush" as a no-op method. (Kent Sibilev) Files: src/if_ruby.c Patch 7.3.502 Problem: Netbeans insert halfway a line actually appends to the line. Solution: Insert halfway the line. (Brian Victor) Files: src/netbeans.c Patch 7.3.503 (after 7.3.501) Problem: Warning for unused argument. Solution: Add UNUSED. Files: src/if_ruby.c Patch 7.3.504 Problem: Commands in help files are not highlighted. Solution: Allow for commands in backticks. Adjust CTRL-] to remove the backticks. Files: src/ex_cmds.c Patch 7.3.505 Problem: Test 11 fails on MS-Windows in some versions. Solution: Fix #ifdefs for whether filtering through a pipe is possible. Move setting b_no_eol_lnum back to where it was before patch 7.3.124. (David Pope) Files: src/feature.h, src/eval.c, src/ex_cmds.c, src/fileio.c Patch 7.3.506 Problem: GTK gives an error when selecting a non-existent file. Solution: Add a handler to avoid the error. (Christian Brabandt) Files: src/gui_gtk.c Patch 7.3.507 Problem: When exiting with unsaved changes, selecting an existing file in the file dialog, there is no dialog to ask whether the existing file should be overwritten. (Felipe G. Nievinski) Solution: Call check_overwrite() before writing. (Christian Brabandt) Files: src/ex_cmds.c, src/ex_cmds2.c, src/proto/ex_cmds.pro Patch 7.3.508 Problem: Default for v:register is not set. Solution: Init v:register in eval_init(). Correct for 'clipboard' before the main loop. (Ingo Karkat) Files: src/eval.c, src/main.c Patch 7.3.509 Problem: ":vimgrep" fails when 'autochdir' is set. Solution: A more generic solution for changing directory. (Ben Fritz) Files: src/quickfix.c Patch 7.3.510 Problem: Test 77 fails on Solaris 7. (Michael Soyka) Solution: Replace any tabs with spaces. Files: src/testdir/test77.in Patch 7.3.511 Problem: Using a FileReadCmd autocommand that does ":e! {file}" may cause a crash. (Christian Brabandt) Solution: Properly restore curwin->w_s. Files: src/fileio.c Patch 7.3.512 Problem: undofile() returns a useless name when passed an empty string. Solution: Return an empty string. (Christian Brabandt) Files: src/eval.c Patch 7.3.513 Problem: Cannot use CTRL-E and CTRL-Y with "r". Solution: Make CTRL-E and CTRL-Y work like in Insert mode. (Christian Brabandt) Files: src/edit.c, src/normal.c, src/proto/edit.pro Patch 7.3.514 Problem: No completion for :history command. Solution: Add the completion and update the docs. Also fix ":behave" completion. (Dominique Pelle) Files: runtime/doc/cmdline.txt, runtime/doc/map.txt, src/ex_docmd.c, src/ex_getln.c, src/vim.h Patch 7.3.515 Problem: 'wildignorecase' only applies to the last part of the path. Solution: Also ignore case for letters earlier in the path. Files: src/misc1.c Patch 7.3.516 Problem: extend(o, o) may crash Vim. Solution: Fix crash and add test. (Thinca and Hirohito Higashi) Files: src/eval.c, src/testdir/test55.in, src/testdir/test55.ok Patch 7.3.517 Problem: Crash when using "vipvv". (Alexandre Provencio) Solution: Don't let the text length become negative. Files: src/ops.c Patch 7.3.518 Problem: When 'encoding' is a double-byte encoding ":helptags" may not find tags correctly. Solution: Use vim_strbyte() instead of vim_strchr(). (Yasuhiro Matsumoto) Files: src/ex_cmds.c Patch 7.3.519 Problem: When completefunction returns it cannot indicate end of completion mode. Solution: Recognize completefunction returning -3. (Matsushita Shougo) Files: src/edit.c Patch 7.3.520 Problem: Gvim starts up slow on Ubuntu 12.04. Solution: Move the call to gui_mch_init_check() to after fork(). (Yasuhiro Matsumoto) Do check $DISPLAY being set. Files: src/gui.c, src/gui_gtk_x11.c, src/proto/gui_gtk_x11.pro Patch 7.3.521 Problem: Using "z=" on a multi-byte character may cause a crash. Solution: Don't use strlen() on an int pointer. Files: src/spell.c Patch 7.3.522 Problem: Crash in vim_realloc() when using MEM_PROFILE. Solution: Avoid using a NULL argument. (Dominique Pelle) Files: src/eval.c Patch 7.3.523 Problem: ":diffupdate" doesn't check for files changed elsewhere. Solution: Add the ! flag. (Christian Brabandt) Files: runtime/doc/diff.txt, src/diff.c, src/ex_cmds.h Patch 7.3.524 (after 7.3.523) Problem: Missing comma. Solution: Add the comma. Files: src/version.c Patch 7.3.525 Problem: Compiler warning on 64 bit MS-Windows. Solution: Add type cast. (Mike Williams) Files: src/ex_getln.c Patch 7.3.526 Problem: Confusing indenting for #ifdef. Solution: Remove and add indent. (Elias Diem) Files: src/normal.c Patch 7.3.527 Problem: Clang complains about non-ASCII characters in a string. Solution: Change to \x88 form. (Dominique Pelle) Files: src/charset.c Patch 7.3.528 Problem: Crash when closing last window in a tab. (Alex Efros) Solution: Use common code in close_last_window_tabpage(). (Christian Brabandt) Files: src/window.c Patch 7.3.529 Problem: Using a count before "v" and "V" does not work (Kikyous) Solution: Make the count select that many characters or lines. (Christian Brabandt) Files: src/normal.c Patch 7.3.530 (after 7.3.520) Problem: Gvim does not work when 'guioptions' includes "f". (Davido) Solution: Call gui_mch_init_check() when running GUI in the foreground. (Yasuhiro Matsumoto) Files: src/gui.c Patch 7.3.531 (after 7.3.530) Problem: GUI does not work on MS-Windows. Solution: Add the missing #ifdef. (Patrick Avery) Files: src/gui.c Patch 7.3.532 Problem: Compiler warning from Clang. Solution: Use a different way to point inside a string. (Dominique Pelle) Files: src/syntax.c Patch 7.3.533 Problem: Memory leak when writing undo file. Solution: Free the ACL. (Dominique Pelle) Files: src/undo.c Patch 7.3.534 (after 7.3.461) Problem: When using an InsertCharPre autocommand autoindent fails. Solution: Proper handling of v:char. (Alexey Radkov) Files: src/edit.c Patch 7.3.535 Problem: Many #ifdefs for MB_MAXBYTES. Solution: Also define MB_MAXBYTES without the +multi_byte feature. Fix places where the buffer didn't include space for a NUL byte. Files: src/arabic.c, src/edit.c, src/eval.c, src/getchar.c, src/mbyte.c, src/misc1.c, src/screen.c, src/spell.c, src/vim.h Patch 7.3.536 Problem: When spell checking the German sharp s is not seen as a word character. (Aexl Bender) Solution: In utf_islower() return true for the sharp s. Note: also need updated spell file for this to take effect. Files: src/mbyte.c Patch 7.3.537 Problem: Unnecessary call to init_spell_chartab(). Solution: Delete the call. Files: src/spell.c Patch 7.3.538 Problem: 'efm' does not handle Tabs in pointer lines. Solution: Add Tab support. Improve tests. (Lech Lorens) Files: src/quickfix.c, src/testdir/test10.in, src/testdir/test10.ok Patch 7.3.539 Problem: Redrawing a character on the command line does not work properly for multi-byte characters. Solution: Count the number of bytes in a character. (Yukihiro Nakadaira) Files: src/ex_getln.c Patch 7.3.540 Problem: Cursor is left on the text instead of the command line. Solution: Don't call setcursor() in command line mode. Files: src/getchar.c Patch 7.3.541 Problem: When joining lines comment leaders need to be removed manually. Solution: Add the 'j' flag to 'formatoptions'. (Lech Lorens) Files: runtime/doc/change.txt, src/edit.c, src/ex_docmd.c, src/misc1.c, src/normal.c, src/ops.c, src/option.h, src/proto/misc1.pro, src/proto/ops.pro, src/search.c, src/testdir/test29.in, src/testdir/test29.ok Patch 7.3.542 (after 7.3.506) Problem: Function is sometimes unused. Solution: Add #ifdef. Files: src/gui_gtk.c Patch 7.3.543 Problem: The cursor is in the wrong line after using ":copen". (John Beckett) Solution: Invoke more drastic redraw method. Files: src/eval.c Patch 7.3.544 Problem: There is no good way to close a quickfix window when closing the last ordinary window. Solution: Add the QuitPre autocommand. Files: src/ex_docmd.c, src/fileio.c, src/vim.h Patch 7.3.545 Problem: When closing a window or buffer autocommands may close it too, causing problems for where the autocommand was invoked from. Solution: Add the w_closing and b_closing flags. When set disallow ":q" and ":close" to prevent recursive closing. Files: src/structs.h, src/buffer.c, src/ex_docmd.c, src/window.c Patch 7.3.546 Problem: Bogus line break. Solution: Remove the line break. Files: src/screen.c Patch 7.3.547 (after 7.3.541) Problem: Compiler warning for uninitialized variable. Solution: Initialize it. Files: src/ops.c Patch 7.3.548 Problem: Compiler warning on 64 bit Windows. Solution: Add type cast. (Mike Williams) Files: src/ops.c Patch 7.3.549 Problem: In 'cinoptions' "0s" is interpreted as one shiftwidth. (David Pineau) Solution: Use the zero as zero. (Lech Lorens) Files: src/misc1.c, src/testdir/test3.in, src/testdir/test3.ok Patch 7.3.550 (after 7.3.541) Problem: With "j" in 'formatoptions' a list leader is not removed. (Gary Johnson) Solution: Don't ignore the start of a three part comment. (Lech Lorens) Files: src/ops.c, src/testdir/test29.in, src/testdir/test29.ok Patch 7.3.551 Problem: When using :tablose a TabEnter autocommand is triggered too early. (Karthick) Solution: Don't trigger *Enter autocommands before closing the tab. (Christian Brabandt) Files: src/buffer.c, src/eval.c, src/ex_cmds2.c, src/fileio.c, src/proto/window.pro, src/window.c Patch 7.3.552 Problem: Formatting inside comments does not use the "2" flag in 'formatoptions'. Solution: Support the "2" flag. (Tor Perkins) Files: src/vim.h, src/ops.c, src/edit.c, src/misc1.c, src/testdir/test68.in, src/testdir/test68.ok Patch 7.3.553 Problem: With double-width characters and 'listchars' containing "precedes" the text is displayed one cell off. Solution: Check for double-width character being overwritten by the "precedes" character. (Yasuhiro Matsumoto) Files: src/screen.c Patch 7.3.554 (after 7.3.551) Problem: Compiler warning for unused argument. Solution: Add UNUSED. Files: src/window.c Patch 7.3.555 Problem: Building on IBM z/OS fails. Solution: Adjust configure. Use the QUOTESED value from config.mk instead of the hard coded one in Makefile. (Stephen Bovy) Files: src/configure.in, src/auto/configure, src/Makefile Patch 7.3.556 Problem: Compiler warnings on 64 bit Windows. Solution: Add type casts. (Mike Williams) Files: src/misc1.c Patch 7.3.557 Problem: Crash when an autocommand wipes out a buffer when it is hidden. Solution: Restore the current window when needed. (Christian Brabandt) Files: src/buffer.c Patch 7.3.558 Problem: Memory access error. (Gary Johnson) Solution: Allocate one more byte. (Dominique Pelle) Files: src/misc1.c Patch 7.3.559 Problem: home_replace() does not work with 8.3 filename. Solution: Make ":p" expand 8.3 name to full path. (Yasuhiro Matsumoto) Files: src/eval.c, src/misc1.c Patch 7.3.560 Problem: Get an error for a locked argument in extend(). Solution: Initialize the lock flag for a dictionary. (Yukihiro Nakadaira) Files: src/eval.c Patch 7.3.561 Problem: Using refresh: always in a complete function breaks the "." command. (Val Markovic) Solution: Add match leader to the redo buffer. (Yasuhiro Matsumoto) Files: src/edit.c Patch 7.3.562 Problem: ":profdel" should not work when the +profile feature is disabled. Solution: Call ex_ni(). (Yasuhiro Matsumoto) Files: src/ex_cmds2.c Patch 7.3.563 (after 7.3.557) Problem: Can't build with tiny features. Solution: Add #ifdef. Files: src/buffer.c Patch 7.3.564 (after 7.3.559) Problem: Warning for pointer conversion. Solution: Add type cast. Files: src/misc1.c Patch 7.3.565 Problem: Can't generate proto file for Python 3. Solution: Add PYTHON3_CFLAGS to LINT_CFLAGS. Files: src/Makefile Patch 7.3.566 (after 7.3.561) Problem: Redo after completion does not work correctly when refresh: always is not used. (Raymond Ko) Solution: Check the compl_opt_refresh_always flag. (Christian Brabandt) Files: src/edit.c Patch 7.3.567 Problem: Missing copyright notice. Solution: Add Vim copyright notice. (Taro Muraoka) Files: src/dehqx.py Patch 7.3.568 Problem: Bad indents for #ifdefs. Solution: Add and remove spaces. (Elias Diem) Files: src/globals.h Patch 7.3.569 Problem: Evaluating Vim expression in Python is insufficient. Solution: Add vim.bindeval(). Also add pyeval() and py3eval(). (ZyX) Files: runtime/doc/eval.txt, runtime/doc/if_pyth.txt, src/eval.c, src/if_lua.c, src/if_py_both.h, src/if_python.c, src/if_python3.c, src/proto/eval.pro, src/proto/if_python.pro, src/proto/if_python3.pro, src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak, src/testdir/Make_ming.mak, src/testdir/Make_os2.mak, src/testdir/Makefile, src/testdir/test86.in, src/testdir/test86.ok, src/testdir/test87.in, src/testdir/test87.ok Patch 7.3.570 Problem: ":vimgrep" does not obey 'wildignore'. Solution: Apply 'wildignore' and 'suffixes' to ":vimgrep". (Ingo Karkat) Files: src/ex_cmds2.c, src/proto/ex_cmds2.pro, src/quickfix.c, src/spell.c Patch 7.3.571 Problem: Duplicated condition. Solution: Remove one. (Dominique Pelle) Files: src/os_win32.c Patch 7.3.572 Problem: Duplicate statement in if and else. (Dominique Pelle) Solution: Remove the condition and add a TODO. Files: src/gui_xmebw.c Patch 7.3.573 Problem: Using array index before bounds checking. Solution: Swap the parts of the condition. (Dominique Pelle) Files: src/ops.c Patch 7.3.574 Problem: When pasting a register in the search command line a CTRL-L character is not pasted. (Dominique Pelle) Solution: Escape the CTRL-L. (Christian Brabandt) Files: src/ex_getln.c Patch 7.3.575 Problem: "ygt" tries to yank instead of giving an error. (Daniel Mueller) Solution: Check for a pending operator. Files: src/normal.c Patch 7.3.576 Problem: Formatting of lists inside comments is not right yet. Solution: Use another solution and add a test. (Tor Perkins) Files: src/edit.c, src/misc1.c, src/testdir/test68.in, src/testdir/test69.ok Patch 7.3.577 Problem: Size of memory does not fit in 32 bit unsigned. Solution: Use Kbyte instead of byte. Call GlobalMemoryStatusEx() instead of GlobalMemoryStatus() when available. Files: src/misc2.c, src/option.c, src/os_amiga.c, src/os_msdos.c, src/os_win16.c, src/os_win32.c Patch 7.3.578 Problem: Misplaced declaration. Solution: Move declaration to start of block. Files: src/if_py_both.h Patch 7.3.579 (after 7.3.569) Problem: Can't compile with Python 2.5. Solution: Use PyCObject when Capsules are not available. Files: src/if_py_both.h, src/if_python.c, src/if_python3.c Patch 7.3.580 Problem: Warning on 64 bit MS-Windows. Solution: Add type cast. (Mike Williams) Files: src/if_py_both.h Patch 7.3.581 Problem: Problems compiling with Python. Solution: Pick UCS2 or UCS4 function at runtime. (lilydjwg) Files: src/if_python.c Patch 7.3.582 (after 7.3.576) Problem: Missing parts of the test OK file. Solution: Add the missing parts. Files: src/testdir/test68.ok Patch 7.3.583 Problem: PyObject_NextNotImplemented is not defined before Python 2.7. (Danek Duvall) Solution: Add #ifdefs. Files: src/if_python.c Patch 7.3.584 Problem: PyCObject is not always defined. Solution: Use PyObject instead. Files: src/if_py_both.h, src/if_python.c Patch 7.3.585 Problem: Calling changed_bytes() too often. Solution: Move changed_bytes() out of a loop. (Tor Perkins) Files: src/edit.c Patch 7.3.586 Problem: When compiling with Cygwin or MingW MEMORYSTATUSEX is not defined. Solution: Set the default for WINVER to 0x0500. Files: src/Make_ming.mak, src/Make_cyg.mak Patch 7.3.587 Problem: Compiler warning for local var shadowing global var. Solution: Rename the var and move it to an inner block. (Christian Brabandt) Files: src/buffer.c Patch 7.3.588 Problem: Crash on NULL pointer. Solution: Fix the immediate problem by checking for NULL. (Lech Lorens) Files: src/window.c Patch 7.3.589 Problem: Crash when $HOME is not set. Solution: Check for a NULL pointer. (Chris Webb) Files: src/misc1.c Patch 7.3.590 Problem: The '< and '> marks cannot be set directly. Solution: Allow setting '< and '>. (Christian Brabandt) Files: src/mark.c Patch 7.3.591 Problem: Can only move to a tab by absolute number. Solution: Move a number of tabs to the left or the right. (Lech Lorens) Files: runtime/doc/tabpage.txt, src/ex_cmds.h, src/ex_docmd.c, src/testdir/test62.in, src/testdir/test62.ok, src/window.c Patch 7.3.592 Problem: Vim on GTK does not support g:browsefilter. Solution: Add a GtkFileFilter to the file chooser. (Christian Brabandt) Files: src/gui_gtk.c Patch 7.3.593 Problem: No easy way to decide if b:browsefilter will work. Solution: Add the browsefilter feature. Files: src/gui_gtk.c, src/eval.c, src/vim.h Patch 7.3.594 Problem: The X command server doesn't work perfectly. It sends an empty reply for as-keys requests. Solution: Remove duplicate ga_init2(). Do not send a reply for as-keys requests. (Brian Burns) Files: src/if_xcmdsrv.c Patch 7.3.595 Problem: The X command server responds slowly Solution: Change the loop that waits for replies. (Brian Burns) Files: src/if_xcmdsrv.c Patch 7.3.596 Problem: Can't remove all signs for a file or buffer. Solution: Support "*" for the sign id. (Christian Brabandt) Files: runtime/doc/sign.txt, src/buffer.c, src/ex_cmds.c, src/proto/buffer.pro Patch 7.3.597 Problem: 'clipboard' "autoselect" only applies to the * register. (Sergey Vakulenko) Solution: Make 'autoselect' work for the + register. (Christian Brabandt) Add the "autoselectplus" option in 'clipboard' and the "P" flag in 'guioptions'. Files: runtime/doc/options.txt, src/normal.c, src/ops.c, src/screen.c, src/ui.c, src/globals.h, src/proto/ui.pro, src/option.h, src/gui.c Patch 7.3.598 Problem: Cannot act upon end of completion. (Taro Muraoka) Solution: Add an autocommand event that is triggered when completion has finished. (Idea by Florian Klein) Files: src/edit.c, src/fileio.c, src/vim.h Patch 7.3.599 (after 7.3.597) Problem: Missing change in one file. Solution: Patch for changed clip_autoselect(). Files: src/option.c Patch 7.3.600 Problem: <f-args> is not expanded properly with DBCS encoding. Solution: Skip over character instead of byte. (Yukihiro Nakadaira) Files: src/ex_docmd.c Patch 7.3.601 Problem: Bad code style. Solution: Insert space, remove parens. Files: src/farsi.c Patch 7.3.602 Problem: Missing files in distribution. Solution: Update the list of files. Files: Filelist Patch 7.3.603 Problem: It is possible to add replace builtin functions by calling extend() on g:. Solution: Add a flag to a dict to indicate it is a scope. Check for existing functions. (ZyX) Files: src/buffer.c, src/eval.c, src/proto/eval.pro, src/structs.h, src/testdir/test34.in, src/testdir/test34.ok, src/window.c Patch 7.3.604 Problem: inputdialog() doesn't use the cancel argument in the console. (David Fishburn) Solution: Use the third argument. (Christian Brabandt) Files: src/eval.c Patch 7.3.605 (after 7.3.577) Problem: MS-Windows: Can't compile with older compilers. (Titov Anatoly) Solution: Add #ifdef for MEMORYSTATUSEX. Files: src/os_win32.c Patch 7.3.606 Problem: CTRL-P completion has a problem with multi-byte characters. Solution: Check for next character being NUL properly. (Yasuhiro Matsumoto) Files: src/search.c, src/macros.h Patch 7.3.607 Problem: With an 8 color terminal the selected menu item is black on black, because darkGrey as bg is the same as black. Solution: Swap fg and bg colors. (James McCoy) Files: src/syntax.c Patch 7.3.608 Problem: winrestview() does not always restore the view correctly. Solution: Call win_new_height() and win_new_width(). (Lech Lorens) Files: src/eval.c, src/proto/window.pro, src/window.c Patch 7.3.609 Problem: File names in :checkpath! output are garbled. Solution: Check for \zs in the pattern. (Lech Lorens) Files: src/search.c, src/testdir/test17.in, src/testdir/test17.ok Patch 7.3.610 Problem: Cannot operate on the text that a search pattern matches. Solution: Add the "gn" and "gN" commands. (Christian Brabandt) Files: runtime/doc/index.txt, runtime/doc/visual.txt, src/normal.c, src/proto/search.pro, src/search.c, src/testdir/test53.in, src/testdir/test53.ok Patch 7.3.611 Problem: Can't use Vim dictionary as self argument in Python. Solution: Fix the check for the "self" argument. (ZyX) Files: src/if_py_both.h Patch 7.3.612 Problem: Auto formatting messes up text when 'fo' contains "2". (ZyX) Solution: Decrement "less_cols". (Tor Perkins) Files: src/misc1.c, src/testdir/test68.in, src/testdir/test68.ok Patch 7.3.613 Problem: Including Python's config.c in the build causes trouble. It is not clear why it was there. Solution: Omit the config file. (James McCoy) Files: src/Makefile, src/auto/configure, src/configure.in Patch 7.3.614 Problem: Number argument gets turned into a number while it should be a string. Solution: Add flag to the call_vim_function() call. (Yasuhiro Matsumoto) Files: src/edit.c, src/eval.c, src/proto/eval.pro Patch 7.3.615 Problem: Completion for a user command does not recognize backslash before a space. Solution: Recognize escaped characters. (Yasuhiro Matsumoto) Files: src/ex_docmd.c Patch 7.3.616 (after 7.3.610) Problem: Can't compile without +visual. Solution: Add #ifdef. Files: src/normal.c Patch 7.3.617 (after 7.3.615) Problem: Hang on completion. Solution: Skip over the space. (Yasuhiro Matsumoto) Files: src/ex_docmd.c Patch 7.3.618 (after 7.3.616) Problem: Still doesn't compile with small features. Solution: Move current_search() out of #ifdef. (Dominique Pelle) Files: src/normal.c, src/search.c Patch 7.3.619 Problem: When executing a shell command Vim may become slow to respond. Solution: Don't wait after every processed message. (idea by Yasuhiro Matsumoto) Files: src/os_win32.c Patch 7.3.620 Problem: Building with recent Ruby on Win32 doesn't work. Solution: Add a separate argument for the API version. (Yasuhiro Matsumoto) Files: src/Make_ming.mak, src/Make_mvc.mak Patch 7.3.621 Problem: Compiler warnings on 64 bit windows. Solution: Add type casts. (Mike Williams) Files: src/ex_docmd.c, src/search.c Patch 7.3.622 Problem: XPM library for Win32 can't be found. Solution: Suggest using the one from the Vim ftp site. Files: src/Make_mvc.mak Patch 7.3.623 Problem: Perl 5.14 commands crash Vim on MS-Windows. Solution: Use perl_get_sv() instead of GvSV(). (Raymond Ko) Files: src/if_perl.xs Patch 7.3.624 Problem: When cancelling input() it returns the third argument. That should only happen for inputdialog(). Solution: Check if inputdialog() was used. (Hirohito Higashi) Files: src/eval.c Patch 7.3.625 Problem: "gn" does not handle zero-width matches correctly. Solution: Handle zero-width patterns specially. (Christian Brabandt) Files: src/search.c Patch 7.3.626 Problem: Python interface doesn't build with Python 2.4 or older. Solution: Define Py_ssize_t. (Benjamin Bannier) Files: src/if_py_both.h Patch 7.3.627 Problem: When using the "n" flag with the ":s" command a \= substitution will not be evaluated. Solution: Do perform the evaluation, so that a function can be invoked at every matching position without changing the text. (Christian Brabandt) Files: src/ex_cmds.c Patch 7.3.628 Problem: ":open" does not allow for a !, which results in a confusing error message. (Shawn Wilson) Solution: Allow ! on ":open". (Christian Brabandt) Files: src/ex_cmds.h Patch 7.3.629 Problem: There is no way to make 'shiftwidth' follow 'tabstop'. Solution: When 'shiftwidth' is zero use the value of 'tabstop'. (Christian Brabandt) Files: src/edit.c, src/ex_getln.c, src/fold.c, src/misc1.c, src/ops.c, src/option.c, src/proto/option.pro Patch 7.3.630 Problem: "|" does not behave correctly when 'virtualedit' is set. Solution: Call validate_virtcol(). (David Bürgin) Files: src/normal.c Patch 7.3.631 Problem: Cannot complete user names. Solution: Add user name completion. (Dominique Pelle) Files: runtime/doc/map.txt, src/auto/configure, src/config.h.in, src/configure.in, src/ex_docmd.c, src/ex_getln.c, src/misc1.c, src/misc2.c, src/proto/misc1.pro, src/vim.h Patch 7.3.632 Problem: Cannot select beyond 222 columns with the mouse in xterm. Solution: Add support for SGR mouse tracking. (Hayaki Saito) Files: runtime/doc/options.txt, src/feature.h, src/keymap.h, src/misc2.c, src/option.h, src/os_unix.c, src/term.c, src/version.c Patch 7.3.633 Problem: Selection remains displayed as selected after selecting another text. Solution: Call xterm_update() before select(). (Andrew Pimlott) Files: src/os_unix.c Patch 7.3.634 Problem: Month/Day format for undo is confusing. (Marcin Szamotulski) Solution: Always use Year/Month/Day, should work for everybody. Files: src/undo.c Patch 7.3.635 Problem: Issue 21: System call during startup sets 'lines' to a wrong value. (Karl Yngve) Solution: Don't set the shell size while the GUI is still starting up. (Christian Brabandt) Files: src/ui.c Patch 7.3.636 (after 7.3.625) Problem: Not all zero-width matches handled correctly for "gn". Solution: Move zero-width detection to a separate function. (Christian Brabandt) Files: src/search.c Patch 7.3.637 Problem: Cannot catch the error caused by a foldopen when there is no fold. (ZyX, Issue 48) Solution: Do not break out of the loop early when inside try/catch. (Christian Brabandt) Except when there is a syntax error. Files: src/ex_docmd.c, src/globals.h Patch 7.3.638 Problem: Unnecessary redraw of the previous character. Solution: Check if the character is double-width. (Jon Long) Files: src/screen.c Patch 7.3.639 Problem: It's not easy to build Vim on Windows with XPM support. Solution: Include the required files, they are quite small. Update the MSVC makefile to use them. Binary files are in the next patch. (Sergey Khorev) Files: src/xpm/COPYRIGHT, src/xpm/README.txt, src/xpm/include/simx.h, src/xpm/include/xpm.h, src/Make_mvc.mak, src/bigvim.bat, src/bigvim64.bat, Filelist Patch 7.3.640 Problem: It's not easy to build Vim on Windows with XPM support. Solution: Binary files for 7.3.639. (Sergey Khorev) Files: src/xpm/x64/lib/libXpm.lib, src/xpm/x86/lib/libXpm.a, src/xpm/x86/lib/libXpm.lib Patch 7.3.641 Problem: ":mkview" uses ":normal" instead of ":normal!" for folds. (Dan) Solution: Add the bang. (Christian Brabandt) Files: src/fold.c Patch 7.3.642 Problem: Segfault with specific autocommands. Was OK after 7.3.449 and before 7.3.545. (Richard Brown) Solution: Pass TRUE for abort_if_last in the call to close_buffer(). (Christian Brabandt) Files: src/window.c Patch 7.3.643 (after 7.3.635) Problem: MS-Windows: When starting gvim maximized 'lines' and 'columns' are wrong. (Christian Robinson) Solution: Move the check for gui.starting from ui_get_shellsize() to check_shellsize(). Files: src/ui.c, src/term.c Patch 7.3.644 Problem: Dead code for BeOS GUI. Solution: Remove unused __BEOS__ stuff. Files: src/gui.c Patch 7.3.645 Problem: No tests for patch 7.3.625 and 7.3.637. Solution: Add more tests for the "gn" command and try/catch. (Christian Brabandt) Files: src/testdir/test53.in, src/testdir/test53.ok, src/testdir/test55.in, src/testdir/test55.ok Patch 7.3.646 Problem: When reloading a buffer the undo file becomes unusable unless ":w" is executed. (Dmitri Frank) Solution: After reloading the buffer write the undo file. (Christian Brabandt) Files: src/fileio.c Patch 7.3.647 Problem: "gnd" doesn't work correctly in Visual mode. Solution: Handle Visual mode differently in "gn". (Christian Brabandt) Files: src/search.c, src/testdir/test53.in, src/testdir/test53.ok Patch 7.3.648 Problem: Crash when using a very long file name. (ZyX) Solution: Properly check length of buffer space. Files: src/buffer.c Patch 7.3.649 Problem: When 'clipboard' is set to "unnamed" small deletes end up in the numbered registers. (Ingo Karkat) Solution: Use the original register name to decide whether to put a delete in a numbered register. (Christian Brabandt) Files: src/ops.c Patch 7.3.650 Problem: Completion after ":help \{-" gives an error message and messes up the command line. Solution: Cancel the tag search if the pattern can't be compiled. (Yasuhiro Matsumoto) Files: src/tag.c Patch 7.3.651 Problem: Completion after ":help \{-" gives an error message. Solution: Prepend a backslash. Files: src/ex_cmds.c Patch 7.3.652 Problem: Workaround for Python crash isn't perfect. Solution: Change the type of the length argument. (Sean Estabrooks) Files: src/if_py_both.h Patch 7.3.653 Problem: MingW needs build rule for included XPM files. Object directory for 32 and 64 builds is the same, also for MSVC. Solution: Add MingW build rule to use included XPM files. Add the CPU or architecture to the object directory name. (Sergey Khorev) Files: src/Make_ming.mak, src/Make_mvc.mak, src/xpm/README.txt Patch 7.3.654 Problem: When creating a Vim dictionary from Python objects an empty key might be used. Solution: Do not use empty keys, throw an IndexError. (ZyX) Files: src/if_py_both.h Patch 7.3.655 Problem: 64 bit MingW xpm .a file is missing. Solution: Add the file. (Sergey Khorev) Files: src/xpm/x64/lib/libXpm.a Patch 7.3.656 Problem: Internal error in :pyeval. Solution: Handle failed object conversion. (ZyX) Files: src/if_python.c, src/if_python3.c Patch 7.3.657 Problem: Python bindings silently truncate string values containing NUL. Solution: Fail when a string contains NUL. (ZyX) Files: src/if_python.c, src/if_python3.c Patch 7.3.658 Problem: NUL bytes truncate strings when converted from Python. Solution: Handle truncation as an error. (ZyX) Files: src/if_py_both.h, src/if_python3.c Patch 7.3.659 Problem: Recent Python changes are not tested. Solution: Add tests for Python bindings. (ZyX) Files: src/testdir/test86.in, src/testdir/test86.ok, src/testdir/test87.in, src/testdir/test87.ok Patch 7.3.660 Problem: ":help !" jumps to help for ":!". Solution: Adjust check for tag header line. (Andy Wokula) Files: src/tag.c Patch 7.3.661 (after 7.3.652) Problem: SEGV in Python code. Solution: Initialize len to zero. Use the right function depending on version. (Maxim Philippov) Files: src/if_py_both.h, src/if_python.c, src/if_python3.c Patch 7.3.662 Problem: Can't build Ruby interface with Ruby 1.9.3. Solution: Add missing functions. (V. Ondruch) Files: src/if_ruby.c Patch 7.3.663 Problem: End of color scheme name not clear in E185. (Aaron Lewis) Solution: Put the name in single quotes. Files: src/ex_docmd.c Patch 7.3.664 Problem: Buffer overflow in unescaping text. (Raymond Ko) Solution: Limit check for multi-byte character to 4 bytes. Files: src/mbyte.c Patch 7.3.665 Problem: MSVC 11 is not supported. (Raymond Ko) Solution: Recognize MSVC 11. (Gary Willoughby) Files: src/Make_mvc.mak Patch 7.3.666 Problem: With MSVC 11 Win32.mak is not found. Solution: Add the SDK_INCLUDE_DIR variable. (Raymond Ko) Files: src/Make_mvc.mak Patch 7.3.667 Problem: Unused variables in Perl interface. Solution: Adjust #ifdefs. Files: src/if_perl.xs Patch 7.3.668 Problem: Building with Perl loaded dynamically still uses static library. Solution: Adjust use of PL_thr_key. (Ken Takata) Files: src/if_perl.xs Patch 7.3.669 Problem: When building with Cygwin loading Python dynamically fails. Solution: Use DLLLIBRARY instead of INSTSONAME. (Ken Takata) Files: src/configure.in, src/auto/configure Patch 7.3.670 Problem: Python: memory leaks when there are exceptions. Solution: Add DICTKEY_UNREF in the right places. (ZyX) Files: src/if_py_both.h Patch 7.3.671 Problem: More Python code can be shared between Python 2 and 3. Solution: Move code to if_py_both.h. (ZyX) Files: src/if_py_both.h, src/if_python.c, src/if_python3.c Patch 7.3.672 Problem: Not possible to lock/unlock lists in Python interface. Solution: Add .locked and .scope attributes. (ZyX) Files: runtime/doc/if_pyth.txt, src/if_py_both.h, src/if_python.c, src/if_python3.c, src/testdir/test86.in, src/testdir/test86.ok, src/testdir/test87.in, src/testdir/test87.ok Patch 7.3.673 Problem: Using "gN" while 'selection' is "exclusive" misses one character. (Ben Fritz) Solution: Check the direction when compensating for exclusive selection. (Christian Brabandt) Files: src/search.c Patch 7.3.674 Problem: Can't compile with Lua/dyn on Cygwin. Solution: Adjust configure to use the right library name. (Ken Takata) Files: src/configure.in, src/auto/configure Patch 7.3.675 Problem: Using uninitialized memory with very long file name. Solution: Put NUL after text when it is truncated. (ZyX) Files: src/buffer.c Patch 7.3.676 Problem: Ruby compilation on Windows 32 bit doesn't work. Solution: Only use some functions for 64 bit. (Ken Takata) Files: src/if_ruby.c Patch 7.3.677 Problem: buf_spname() is used inconsistently. Solution: Make the return type a char_u pointer. Check the size of the returned string. Files: src/buffer.c, src/proto/buffer.pro, src/ex_cmds2.c, src/ex_docmd.c, src/memline.c, src/screen.c Patch 7.3.678 Problem: Ruby .so name may not be correct. Solution: Use the LIBRUBY_SO entry from the config. (Vit Ondruch) Files: src/configure.in, src/auto/configure Patch 7.3.679 Problem: Ruby detection uses Config, newer Ruby versions use RbConfig. Solution: Detect the need to use RbConfig. (Vit Ondruch) Files: src/configure.in, src/auto/configure Patch 7.3.680 Problem: Some files missing in the list of distributed files. Solution: Add lines for new files. Files: Filelist Patch 7.3.681 (after 7.3.680) Problem: List of distributed files picks up backup files. Solution: Make tutor patterns more specific. Files: Filelist Patch 7.3.682 (after 7.3.677) Problem: Compiler complains about incompatible types. Solution: Remove type casts. (hint by Danek Duvall) Files: src/edit.c Patch 7.3.683 Problem: ":python" may crash when vimbindeval() returns None. Solution: Check for v_string to be NULL. (Yukihiro Nakadaira) Files: src/if_py_both.h Patch 7.3.684 Problem: "make test" does not delete lua.vim. Solution: Add lua.vim to the clean target. (Simon Ruderich) Files: src/testdir/Makefile, src/testdir/Make_dos.mak, src/testdir/Make_ming.mak, src/testdir/Make_vms.mms Patch 7.3.685 Problem: No test for what patch 7.3.673 fixes. Solution: Add a test. (Christian Brabandt) Files: src/testdir/test53.in, src/testdir/test53.ok Patch 7.3.686 Problem: Using CTRL-\ e mappings is useful also when entering an expression, but it doesn't work. (Marcin Szamotulski) Solution: Allow using CTRL-\ e when entering an expression if it was not typed. Files: src/ex_getln.c Patch 7.3.687 Problem: Test 16 fails when $DISPLAY is not set. Solution: Skip the test when $DISPLAY is not set. Files: src/testdir/test16.in Patch 7.3.688 Problem: Python 3.3 is not supported. Solution: Add Python 3.3 support (Ken Takata) Files: src/if_python3.c Patch 7.3.689 Problem: MzScheme and Lua may use a NULL string. Solution: Use an empty string instead of NULL. (Yukihiro Nakadaira) Files: src/if_lua.c, src/if_mzsch.c Patch 7.3.690 Problem: When the current directory name is exactly the maximum path length Vim may crash. Solution: Only add "/" when there is room. (Danek Duvall) Files: src/os_unix.c Patch 7.3.691 Problem: State specific to the Python thread is discarded. Solution: Keep state between threads. (Paul) Files: src/if_python.c Patch 7.3.692 Problem: Can't build GTK version with GTK 2.0. Solution: Put GtkFileFilter declaration in the right place. (Yegappan Lakshmanan) Files: src/gui_gtk.c Patch 7.3.693 Problem: Can't make 'softtabstop' follow 'shiftwidth'. Solution: When 'softtabstop' is negative use the value of 'shiftwidth'. (so8res) Files: src/edit.c, src/option.c, src/proto/option.pro Patch 7.3.694 Problem: Now that 'shiftwidth' may use the value of 'tabstop' it is not so easy to use in indent files. Solution: Add the shiftwidth() function. (so8res) Files: runtime/doc/eval.txt, src/eval.c Patch 7.3.695 Problem: Balloon cannot show multi-byte text. Solution: Properly deal with multi-byte characters. (Dominique Pelle) Files: src/gui_beval.c, src/ui.c Patch 7.3.696 Problem: Message about added spell language can be wrong. Solution: Give correct message. Add g:menutrans_set_lang_to to allow for translation. (Jiri Sedlak) Files: runtime/menu.vim Patch 7.3.697 Problem: Leaking resources when setting GUI font. Solution: Free the font. (Ken Takata) Files: src/syntax.c Patch 7.3.698 Problem: Python 3 does not preserve state between commands. Solution: Preserve the state. (Paul Ollis) Files: src/if_python.c, src/if_python3.c Patch 7.3.699 Problem: When 'ttymouse' is set to "sgr" manually, it is overruled by automatic detection. Solution: Do not use automatic detection when 'ttymouse' was set manually. (Hayaki Saito) Files: src/term.c Patch 7.3.700 Problem: Cannot detect URXVT and SGR mouse support. Solution: add +mouse_urxvt and +mouse_sgr. (Hayaki Saito) Files: src/feature.h, src/eval.c Patch 7.3.701 Problem: MS-Windows: Crash with stack overflow when setting 'encoding'. Solution: Handle that loading the iconv library may be called recursively. (Jiri Sedlak) Files: src/os_win32.c Patch 7.3.702 Problem: Nmake from VS6 service pack 6 is not recognized. Solution: Detect the version number. (Jiri Sedlak) Files: src/Make_mvc.mak Patch 7.3.703 Problem: When 'undofile' is reset the hash is computed unnecessarily. Solution: Only compute the hash when the option was set. (Christian Brabandt) Files: src/option.c Patch 7.3.704 Problem: Repeating "cgn" does not always work correctly. Solution: Also fetch the operator character. (Christian Brabandt) Files: src/normal.c Patch 7.3.705 Problem: Mouse features are not sorted properly. (Tony Mechelynck) Solution: Put the mouse features in alphabetical order. Files: src/version.c Patch 7.3.706 (after 7.3.697) Problem: Can't build Motif version. Solution: Fix wrongly named variable. (Ike Devolder) Files: src/syntax.c Patch 7.3.707 (after 7.3.701) Problem: Problems loading a library for a file name with non-latin characters. Solution: Use wide system functions when possible. (Ken Takata) Files: src/os_win32.c, src/os_win32.h Patch 7.3.708 Problem: Filler lines above the first line may be hidden when opening Vim. Solution: Change how topfill is computed. (Christian Brabandt) Files: src/diff.c, src/testdir/test47.in, src/testdir/test47.ok Patch 7.3.709 Problem: Compiler warning for unused argument. Solution: Add UNUSED. Files: src/eval.c Patch 7.3.710 (after 7.3.704) Problem: Patch 7.3.704 breaks "fn". Solution: Add check for ca.cmdchar. (Christian Brabandt) Files: src/normal.c Patch 7.3.711 (after 7.3.688) Problem: vim.current.buffer is not available. (lilydjwg) Solution: Use py3_PyUnicode_AsUTF8 instead of py3_PyUnicode_AsUTF8String. (Ken Takata) Files: src/if_python3.c Patch 7.3.712 Problem: Nmake from VS2010 SP1 is not recognized. Solution: Add the version number. (Ken Takata) Files: src/Make_mvc.mak Patch 7.3.713 Problem: printf() can only align to bytes, not characters. Solution: Add the "S" item. (Christian Brabandt) Files: runtime/doc/eval.txt, src/message.c Patch 7.3.714 Problem: Inconsistency: :set can be used in the sandbox, but :setlocal and :setglobal cannot. (Michael Henry) Solution: Fix the flags for :setlocal and :setglobal. (Christian Brabandt) Files: src/ex_cmds.h Patch 7.3.715 Problem: Crash when calling setloclist() in BufUnload autocmd. (Marcin Szamotulski) Solution: Set w_llist to NULL when it was freed. Also add a test. (Christian Brabandt) Files: src/quickfix.c, src/testdir/test49.ok, src/testdir/test49.vim Patch 7.3.716 Problem: Error on exit when using Python 3. Solution: Remove PythonIO_Fini(). (Roland Puntaier) Files: src/if_python3.c Patch 7.3.717 Problem: When changing the font size, only MS-Windows limits the window size. Solution: Also limit the window size on other systems. (Roland Puntaier) Files: src/gui.c Patch 7.3.718 Problem: When re-using the current buffer the buffer-local options stay. Solution: Re-initialize the buffer-local options. (Christian Brabandt) Files: src/buffer.c Patch 7.3.719 Problem: Cannot run new version of cproto, it fails on missing include files. Solution: Add lots of #ifndef PROTO Files: src/os_amiga.c, src/os_amiga.h, src/gui_w16.c, src/gui_w48.c, src/gui_w32.c, src/vimio.h, src/os_msdos.c, src/os_msdos.h, src/os_win16.h, src/os_win16.c, src/os_win32.h, src/os_win32.c, src/os_mswin.c, src/gui_photon.c, src/os_unix.h, src/os_beos.c, src/os_beos.h Patch 7.3.720 Problem: Proto files are outdated. Solution: Update the newly generated proto files. Files: src/proto/digraph.pro, src/proto/fold.pro, src/proto/misc1.pro, src/proto/move.pro, src/proto/screen.pro, src/proto/search.pro, src/proto/os_win32.pro, src/proto/os_mswin.pro, src/proto/os_beos.pro Patch 7.3.721 Problem: Ruby interface defines local functions globally. Solution: Make the functions static. Files: src/if_ruby.c Patch 7.3.722 Problem: Perl flags may contain "-g", which breaks "make proto". Solution: Filter out the "-g" flag for cproto. (Ken Takata) Files: src/Makefile Patch 7.3.723 Problem: Various tiny problems. Solution: Various tiny fixes. Files: src/gui_mac.c, src/xpm_w32.c, src/netbeans.c, src/sha256.c, src/if_sniff.c, README.txt Patch 7.3.724 Problem: Building with Ruby and Tcl on MS-Windows 64 bit does not work. Solution: Remove Ruby and Tcl from the big MS-Windows build. Files: src/bigvim64.bat Patch 7.3.725 Problem: :aboveleft and :belowright have no effect on :copen. Solution: Check for cmdmod.split. (Christian Brabandt) Files: src/quickfix.c Patch 7.3.726 Problem: Typos and duplicate info in README. Solution: Fix the text. Files: README.txt Patch 7.3.727 Problem: Can't always find Win32.mak when building GvimExt. Solution: Use same mechanism as in Make_mvc.mak. (Cade Foster) Files: src/GvimExt/Makefile Patch 7.3.728 Problem: Cannot compile with MzScheme interface on Ubuntu 12.10. Solution: Find the collects directory under /usr/share. Files: src/configure.in, src/auto/configure Patch 7.3.729 Problem: Building with Ruby fails on some systems. Solution: Remove "static" and add #ifndef PROTO. (Ken Takata) Files: src/if_ruby.c Patch 7.3.730 Problem: Crash in PHP file when using syntastic. (Ike Devolder) Solution: Avoid using NULL pointer. (Christian Brabandt) Files: src/quickfix.c Patch 7.3.731 Problem: Py3Init_vim() is exported unnecessarily. Solution: Make it static. (Ken Takata) Files: src/if_python3.c Patch 7.3.732 Problem: Compiler warnings for function arguments. Solution: Use inteptr_t instead of long. Files: src/if_mzsch.c, src/main.c Patch 7.3.733 Problem: Tests fail when including MzScheme. Solution: Change #ifdefs for vim_main2(). Files: src/main.c Patch 7.3.734 Problem: Cannot put help files in a sub-directory. Solution: Make :helptags work for sub-directories. (Charles Campbell) Files: src/ex_cmds.c Patch 7.3.735 Problem: Cannot build Ruby 1.9 with MingW or Cygwin. Solution: Add another include directory. (Ken Takata) Files: src/Make_cyg.mak, src/Make_ming.mak Patch 7.3.736 Problem: File name completion in input() escapes white space. (Frederic Hardy) Solution: Do not escape white space. (Christian Brabandt) Files: src/ex_getln.c Patch 7.3.737 Problem: When using do_cmdline() recursively did_endif is not reset, causing messages to be overwritten. Solution: Reset did_endif. (Christian Brabandt) Files: src/ex_docmd.c Patch 7.3.738 (after 7.3.730) Problem: Unused function argument. Solution: Remove it. (Christian Brabandt) Files: src/quickfix.c Patch 7.3.739 Problem: Computing number of lines may have an integer overflow. Solution: Check for MAXCOL explicitly. (Dominique Pelle) Files: src/move.c Patch 7.3.740 Problem: IOC tool complains about undefined behavior for int. Solution: Change to unsigned int. (Dominique Pelle) Files: src/hashtab.c, src/misc2.c Patch 7.3.741 (after 7.3.737) Problem: Tiny build fails. Solution: Move #ifdef. (Ike Devolder) Files: src/ex_docmd.c Patch 7.3.742 Problem: Leaking memory when :vimgrep restores the directory. Solution: Free the allocated memory. (Christian Brabandt) Files: src/quickfix.c Patch 7.3.743 (after 7.3.741) Problem: Tiny build still fails. Solution: Add #else in the right place. Files: src/ex_docmd.c Patch 7.3.744 Problem: 64 bit compiler warning. Solution: Add type cast. (Mike Williams) Files: src/ex_cmds.c Patch 7.3.745 Problem: Automatically setting 'ttymouse' doesn't work. Solution: Reset the "option was set" flag when using the default. Files: src/option.c, src/proto/option.pro, src/term.c Patch 7.3.746 Problem: Memory leaks when using location lists. Solution: Set qf_title to something. (Christian Brabandt) Files: src/eval.c, src/quickfix.c Patch 7.3.747 Problem: When characters are concealed text aligned with tabs are no longer aligned, e.g. at ":help :index". Solution: Compensate space for tabs for concealed characters. (Dominique Pelle) Files: src/screen.c Patch 7.3.748 Problem: Cannot properly test conceal mode. Solution: Add the screencol() and screenrow() functions. Use them in test88. (Simon Ruderich) Files: runtime/doc/eval.txt, src/eval.c, src/proto/screen.pro, src/screen.c, src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak, src/testdir/Make_ming.mak, src/testdir/Make_os2.mak, src/testdir/Make_vms.mms src/testdir/Makefile, src/testdir/test88.in, src/testdir/test88.ok, Patch 7.3.749 Problem: Python interface doesn't build without the multi-byte feature. Solution: Add #ifdef. (Ken Takata) Files: src/if_py_both.h Patch 7.3.750 Problem: The justify macro does not always work correctly. Solution: Fix off-by-one error (James McCoy) Files: runtime/macros/justify.vim Patch 7.3.751 Problem: Test 61 is flaky, it fails once in a while. Solution: When it fails retry once. Files: src/testdir/Makefile Patch 7.3.752 Problem: Test 49 script file doesn't fold properly. Solution: Add a colon. Files: src/testdir/test49.vim Patch 7.3.753 Problem: When there is a QuitPre autocommand using ":q" twice does not work for exiting when there are more files to edit. Solution: Do not decrement quitmore in an autocommand. (Techlive Zheng) Files: src/ex_docmd.c, src/fileio.c, src/proto/fileio.pro Patch 7.3.754 Problem: Latest nmake is not recognized. Solution: Add nmake version 11.00.51106.1. (Raymond Ko) Files: src/Make_mvc.mak Patch 7.3.755 Problem: Autoconf doesn't find Python 3 if it's called "python". Solution: Search for "python2" and "python3" first, then "python". Files: src/configure.in, src/auto/configure Patch 7.3.756 Problem: A location list can get a wrong count in :lvimgrep. Solution: Check if the list was changed by autocommands. (mostly by Christian Brabandt) Files: src/quickfix.c Patch 7.3.757 Problem: Issue 96: May access freed memory when a put command triggers autocommands. (Dominique Pelle) Solution: Call u_save() before getting y_array. Files: src/ops.c Patch 7.3.758 Problem: Matchit plugin does not handle space in #ifdef. Solution: Change matching pattern to allow spaces. (Mike Morearty) Files: runtime/macros/matchit.vim Patch 7.3.759 Problem: MS-Windows: Updating the tabline is slow when there are many tabs. Solution: Disable redrawing while performing the update. (Arseny Kapoulkine) Files: src/gui_w48.c Patch 7.3.760 Problem: dv_ deletes the white space before the line. Solution: Move the cursor to the first non-white. (Christian Brabandt) Files: src/normal.c, src/testdir/test19.in, src/testdir/test19.ok Patch 7.3.761 Problem: In Visual mode a "-p does not work. (Marcin Szamotulski) Solution: Avoid writing to "- before putting it. (Christian Brabandt) Files: src/normal.c, src/testdir/test48.in, src/testdir/test48.ok Patch 7.3.762 (after 7.3.759) Problem: On some systems the tabline is not redrawn. Solution: Call RedrawWindow(). (Charles Peacech) Files: src/gui_w48.c Patch 7.3.763 Problem: Jumping to a mark does not open a fold if it is in the same line. (Wiktor Ruben) Solution: Also compare the column after the jump. (Christian Brabandt) Files: src/normal.c Patch 7.3.764 Problem: Not all message translation files are installed. Solution: Also install the converted files. Files: src/po/Makefile Patch 7.3.765 Problem: Segfault when doing "cclose" on BufUnload in a python function. (Sean Reifschneider) Solution: Skip window with NULL buffer. (Christian Brabandt) Files: src/main.c, src/window.c Patch 7.3.766 Problem: ":help cpo-*" jumps to the wrong place. Solution: Make it equivalent to ":help cpo-star". Files: src/ex_cmds.c Patch 7.3.767 Problem: (Win32) The _errno used for iconv may be the wrong one. Solution: Use the _errno from iconv.dll. (Ken Takata) Files: src/mbyte.c Patch 7.3.768 Problem: settabvar() and setwinvar() may move the cursor. Solution: Save and restore the cursor position when appropriate. (idea by Yasuhiro Matsumoto) Files: src/edit.c Patch 7.3.769 Problem: 'matchpairs' does not work with multi-byte characters. Solution: Make it work. (Christian Brabandt) Files: src/misc1.c, src/option.c, src/proto/option.pro, src/search.c, src/testdir/test69.in, src/testdir/test69.ok Patch 7.3.770 Problem: Vim.h indentation is inconsistent. Solution: Adjust the indentation. (Elias Diem) Files: src/vim.h Patch 7.3.771 (after 7.3.769) Problem: Uninitialized variable. (Yasuhiro Matsumoto) Solution: Set x2 to -1. Files: src/option.c Patch 7.3.772 Problem: Cursor is at the wrong location and below the end of the file after doing substitutions with confirm flag: %s/x/y/c (Dominique Pelle) Solution: Update the cursor position. (Christian Brabandt & Dominique) Files: src/ex_cmds.c Patch 7.3.773 (after 7.3.767) Problem: Crash when OriginalFirstThunk is zero. Solution: Skip items with OriginalFirstThunk not set. (Ken Takata) Files: src/mbyte.c Patch 7.3.774 Problem: Tiny GUI version misses console dialog feature. Solution: Define FEAT_CON_DIALOG when appropriate. (Christian Brabandt) Files: src/feature.h, src/gui.h Patch 7.3.775 Problem: Cygwin and Mingw builds miss dependency on gui_w48.c. Solution: Add a build rule. (Ken Takata) Files: src/Make_cyg.mak, src/Make_ming.mak Patch 7.3.776 Problem: ml_get error when searching, caused by curwin not matching curbuf. Solution: Avoid changing curbuf. (Lech Lorens) Files: src/charset.c, src/eval.c, src/mark.c, src/proto/charset.pro, src/proto/mark.pro, src/regexp.c, src/syntax.c, Patch 7.3.777 Problem: When building with Gnome locale gets reset. Solution: Set locale after gnome_program_init(). (Christian Brabandt) Files: src/gui_gtk_x11.c Patch 7.3.778 Problem: Compiler error for adding up two pointers. (Titov Anatoly) Solution: Add a type cast. (Ken Takata) Files: src/mbyte.c Patch 7.3.779 Problem: Backwards search lands in wrong place when started on a multibyte character. Solution: Do not set extra_col for a backwards search. (Sung Pae) Files: src/search.c, src/testdir/test44.in, src/testdir/test44.ok Patch 7.3.780 Problem: char2nr() and nr2char() always use 'encoding'. Solution: Add argument to use utf-8 characters. (Yasuhiro Matsumoto) Files: runtime/doc/eval.txt, src/eval.c Patch 7.3.781 Problem: Drawing with 'guifontwide' can be slow. Solution: Draw multiple characters at a time. (Taro Muraoka) Files: src/gui.c Patch 7.3.782 Problem: Windows: IME composition may use a wrong font. Solution: Use 'guifontwide' for IME when it is set. (Taro Muraoka) Files: runtime/doc/options.txt, src/gui.c, src/gui_w48.c, src/proto/gui_w16.pro, src/proto/gui_w32.pro Patch 7.3.783 Problem: Crash when mark is not set. (Dominique Pelle) Solution: Check for NULL. Files: src/normal.c Patch 7.3.784 (after 7.3.781) Problem: Error when 'guifontwide' has a comma. Solution: Use gui.wide_font. (Taro Muraoka) Files: src/gui_w48.c Patch 7.3.785 (after 7.3.776) Problem: Crash with specific use of search pattern. Solution: Initialize reg_buf to curbuf. Files: src/regexp.c Patch 7.3.786 Problem: Python threads don't run in the background (issue 103). Solution: Move the statements to manipulate thread state. Files: src/if_python.c Patch 7.3.787 Problem: With 'relativenumber' set it is not possible to see the absolute line number. Solution: For the cursor line show the absolute line number instead of a zero. (Nazri Ramliy) Files: src/screen.c Patch 7.3.788 Problem: When only using patches build fails on missing nl.po. Solution: Create an empty nl.po file. Files: src/po/Makefile Patch 7.3.789 (after 7.3.776) Problem: "\k" in regexp does not work in other window. Solution: Use the right buffer. (Yukihiro Nakadaira) Files: src/mbyte.c, src/proto/mbyte.pro, src/regexp.c Patch 7.3.790 Problem: After reloading a buffer the modelines are not processed. Solution: call do_modelines(). (Ken Takata) Files: src/fileio.c Patch 7.3.791 Problem: MzScheme interface doesn't work properly. Solution: Make it work better. (Sergey Khorev) Files: runtime/doc/if_mzsch.txt, src/configure.in, src/auto/configure, src/eval.c, src/if_mzsch.c, src/if_mzsch.h, src/Make_ming.mak, src/Make_mvc.mak, src/os_unix.c, src/proto/eval.pro, src/testdir/test70.in, src/testdir/test70.ok Patch 7.3.792 Problem: ":substitute" works differently without confirmation. Solution: Do not change the text when asking for confirmation, only display it. Files: src/ex_cmds.c Patch 7.3.793 (after 7.3.792) Problem: New interactive :substitute behavior is not tested. Solution: Add tests. (Christian Brabandt) Files: src/testdir/test80.in, src/testdir/test80.ok Patch 7.3.794 Problem: Tiny build fails. (Tony Mechelynck) Solution: Adjust #ifdefs. Files: src/charset.c Patch 7.3.795 Problem: MzScheme does not build with tiny features. Solution: Add #ifdefs. Also add UNUSED to avoid warnings. And change library ordering. Files: src/if_mzsch.c, src/Makefile Patch 7.3.796 Problem: "/[^\n]" does match at a line break. Solution: Make it do the same as "/.". (Christian Brabandt) Files: src/regexp.c, src/testdir/test79.in, src/testdir/test79.ok Patch 7.3.797 (after 7.3.792) Problem: Compiler warning for size_t to int conversion. (Skeept) Solution: Add type casts. Files: src/ex_cmds.c Patch 7.3.798 (after 7.3.791) Problem: MzScheme: circular list does not work correctly. Solution: Separate Mac-specific code from generic code. (Sergey Khorev) Files: src/if_mzsch.c, src/testdir/test70.in Patch 7.3.799 Problem: The color column is not correct when entering a buffer. (Ben Fritz) Solution: Call check_colorcolumn() if 'textwidth' changed. (Christian Brabandt) Files: src/buffer.c Patch 7.3.800 Problem: The " mark is not adjusted when inserting lines. (Roland Eggner) Solution: Adjust the line number. (Christian Brabandt) Files: src/mark.c Patch 7.3.801 Problem: ":window set nu?" displays the cursor line. (Nazri Ramliy) Solution: Do not update the cursor line when conceallevel is zero or the screen has scrolled. (partly by Christian Brabandt) Files: src/window.c Patch 7.3.802 Problem: After setting 'isk' to a value ending in a comma appending to the option fails. Solution: Disallow a trailing comma for 'isk' and similar options. Files: src/charset.c Patch 7.3.803 (after 7.3.792) Problem: Substitute with confirmation and then "q" does not replace anything. (John McGowan) Solution: Do not break the loop, skip to the end. Files: src/ex_cmds.c, src/testdir/test80.in, src/testdir/test80.ok Patch 7.3.804 (after 7.3.799) Problem: Compiler warning for tiny build. (Tony Mechelynck) Solution: Add #ifdefs around variable. Files: src/buffer.c Patch 7.3.805 Problem: Lua version 5.2 is not detected properly on Arch Linux. Solution: Adjust autoconf. (lilydjwg) Files: src/configure.in, src/auto/configure Patch 7.3.806 Problem: Compiler warnings in Perl code when building with Visual studio 2012. (skeept) Solution: Add type casts. (Christian Brabandt, 2013 Jan 30) Files: src/if_perl.xs Patch 7.3.807 Problem: Popup menu does not work properly with the preview window, folds and 'cursorcolumn'. Solution: Redraw the popup menu after redrawing windows. (Christian Brabandt) Files: src/screen.c Patch 7.3.808 Problem: Python threads still do not work properly. Solution: Fix both Python 2 and 3. Add tests. (Ken Takata) Files: src/if_python.c, src/if_python3.c, src/testdir/test86.in, src/testdir/test86.ok, src/testdir/test87.in, src/testdir/test87.ok Patch 7.3.809 Problem: The dosinst.c program has a buffer overflow. (Thomas Gwae) Solution: Ignore $VIMRUNTIME if it is too long. Files: src/dosinst.c Patch 7.3.810 Problem: 'relativenumber' is reset unexpectedly. (François Ingelrest) Solution: After an option was reset also reset the global value. Add a test. (Christian Brabandt) Files: src/option.c, src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak, src/testdir/Make_ming.mak, src/testdir/Make_os2.mak, src/testdir/Make_vms.mms, src/testdir/Makefile, src/testdir/test89.in, src/testdir/test89.ok Patch 7.3.811 Problem: Useless termresponse parsing for SGR mouse. Solution: Skip the parsing. (Hayaki Saito) Files: src/term.c Patch 7.3.812 Problem: When 'indentexpr' moves the cursor "curswant" not restored. Solution: Restore "curswant". (Sung Pae) Files: src/misc1.c Patch 7.3.813 Problem: The CompleteDone event is not triggered when there are no pattern matches. (Jianjun Mao) Solution: Trigger the event. (Christian Brabandt) Files: src/edit.c Patch 7.3.814 Problem: Can't input multibyte characters on Win32 console if 'encoding' is different from current codepage. Solution: Use convert_input_safe() instead of convert_input(). Make string_convert_ext() return an error for incomplete input. (Ken Takata) Files: src/mbyte.c, src/os_win32.c Patch 7.3.815 Problem: Building with Cygwin and Ruby doesn't work. Solution: Copy some things from the MingW build file. (Ken Takata) Files: src/Make_cyg.mak Patch 7.3.816 Problem: Can't compute a hash. Solution: Add the sha256() function. (Tyru, Hirohito Higashi) Files: runtime/doc/eval.txt, src/eval.c, src/proto/sha256.pro, src/sha256.c, src/testdir/test90.in, src/testdir/test90.ok, src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak, src/testdir/Make_ming.mak, src/testdir/Make_os2.mak, src/testdir/Make_vms.mms, src/testdir/Makefile Patch 7.3.817 Problem: Test 89 fails with tiny and small features. Solution: Add sourcing small.vim. Files: src/testdir/test89.in Patch 7.3.818 Problem: When test 40 fails because of a bad build it may leave files behind that cause it to fail later. Solution: Let the file names start with "X". Files: src/testdir/test40.in Patch 7.3.819 Problem: Compiling without +eval and with Python isn't working. Solution: Add the eval feature when building with Python. Files: src/if_py_both.h, src/feature.h, src/eval.c, src/ex_docmd.c, src/normal.c, src/ex_docmd.c, src/gui_gtk_x11.c Patch 7.3.820 Problem: Build errors and warnings when building with small features and Lua, Perl or Ruby. Solution: Add #ifdefs and UNUSED. Files: src/if_perl.xs, src/if_lua.c, src/if_ruby.c Patch 7.3.821 Problem: Build with OLE and Cygwin is broken. (Steve Hall) Solution: Select static or shared stdc library. (Ken Takata) Files: src/Make_cyg.mak Patch 7.3.822 (after 7.3.799) Problem: Crash when accessing freed buffer. Solution: Get 'textwidth' in caller of enter_buffer(). (Christian Brabandt) Files: src/buffer.c Patch 7.3.823 (after 7.3.821) Problem: Building with Cygwin: '-lsupc++' is not needed. Solution: Remove it. (Ken Takata) Files: src/Make_cyg.mak Patch 7.3.824 Problem: Can redefine builtin functions. (ZyX) Solution: Disallow adding a function to g:. Files: src/eval.c Patch 7.3.825 Problem: With Python errors are not always clear. Solution: Print the stack trace, unless :silent is used. (ZyX) Files: src/if_python3.c, src/if_python.c Patch 7.3.826 Problem: List of features in :version output is hard to read. Solution: Make columns. (Nazri Ramliy) Files: src/version.c Patch 7.3.827 (after 7.3.825) Problem: Python tests fail. Solution: Adjust the output for the stack trace. Files: src/testdir/test86.in, src/testdir/test86.ok, src/testdir/test87.ok Patch 7.3.828 Problem: Mappings are not aware of wildmenu mode. Solution: Add wildmenumode(). (Christian Brabandt) Files: src/eval.c, runtime/doc/eval.txt Patch 7.3.829 Problem: When compiled with the +rightleft feature 'showmatch' also shows a match for the opening paren. When 'revins' is set the screen may scroll. Solution: Only check the opening paren when the +rightleft feature was enabled. Do not show a match that is not visible. (partly by Christian Brabandt) Files: src/search.c Patch 7.3.830 Problem: :mksession confuses bytes, columns and characters when positioning the cursor. Solution: Use w_virtcol with "|" instead of w_cursor.col with "l". Files: src/ex_docmd.c Patch 7.3.831 Problem: Clumsy to handle the situation that a variable does not exist. Solution: Add default value to getbufvar() et al. (Shougo Matsushita, Hirohito Higashi) Files: runtime/doc/eval.txt, src/eval.c src/testdir/test91.in, src/testdir/test91.ok, src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak, src/testdir/Make_ming.mak, src/testdir/Make_os2.mak, src/testdir/Make_vms.mms, src/testdir/Makefile Patch 7.3.832 Problem: Compiler warning. Solution: Add type cast. (Mike Williams) Files: src/version.c Patch 7.3.833 Problem: In the terminal the scroll wheel always scrolls the active window. Solution: Scroll the window under the mouse pointer, like in the GUI. (Bradie Rao) Files: src/edit.c, src/normal.c Patch 7.3.834 Problem: Ruby 2.0 has a few API changes. Solution: Add handling of Ruby 2.0. (Yasuhiro Matsumoto) Files: src/if_ruby.c Patch 7.3.835 Problem: "xxd -i" fails on an empty file. Solution: Do output the closing } for an empty file. (partly by Lawrence Woodman) Files: src/xxd/xxd.c Patch 7.3.836 Problem: Clipboard does not work on Win32 when compiled with Cygwin. Solution: Move the Win32 clipboard code to a separate file and use it when building with os_unix.c. (Frodak Baksik, Ken Takata) Files: src/Make_bc5.mak, src/Make_cyg.mak, src/Make_ivc.mak, src/Make_ming.mak, src/Make_mvc.mak, src/Make_w16.mak, src/Makefile, src/config.h.in, src/configure.in, src/auto/configure, src/feature.h, src/globals.h, src/mbyte.c, src/os_mswin.c, src/os_unix.c, src/os_win32.c, src/proto.h, src/proto/os_mswin.pro, src/proto/winclip.pro, src/term.c, src/vim.h, src/winclip.c Patch 7.3.837 (after 7.3.826) Problem: Empty lines in :version output when 'columns' is 320. Solution: Simplify the logic of making columns. (Nazri Ramliy, Roland Eggner) Files: src/version.c Patch 7.3.838 (after 7.3.830) Problem: Insufficient testing for mksession. Solution: Add tests. (mostly by Roland Eggner) Files: src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak, src/testdir/Make_ming.mak, src/testdir/Make_os2.mak, src/testdir/Make_vms.mms, src/testdir/Makefile, src/testdir/test92.in, src/testdir/test92.ok, src/testdir/test93.in, src/testdir/test93.ok, src/ex_docmd.c Patch 7.3.839 Problem: Some files missing in the list of distributed files. Solution: Add lines for new files. Files: Filelist Patch 7.3.840 Problem: "\@<!" in regexp does not work correctly with multi-byte characters, especially cp932. Solution: Move column to start of multi-byte character. (Yasuhiro Matsumoto) Files: src/regexp.c Patch 7.3.841 Problem: When a "cond ? one : two" expression has a subscript it is not parsed correctly. (Andy Wokula) Solution: Handle a subscript also when the type is unknown. (Christian Brabandt) Files: src/eval.c Patch 7.3.842 Problem: Compiler warning for signed/unsigned pointer. Solution: Add type cast. (Christian Brabandt) Files: src/eval.c Patch 7.3.843 (after 7.3.841) Problem: Missing test file changes. Solution: Change the tests. Files: src/testdir/test49.vim, src/testdir/test49.ok Patch 7.3.844 Problem: Enum is not indented correctly with "public" etc. Solution: Skip "public", "private" and "protected". (Hong Xu) Files: src/misc1.c Patch 7.3.845 (after 7.3.844) Problem: Enum indenting is not tested. Solution: Add tests. (Hong Xu) Files: src/testdir/test3.in, src/testdir/test3.ok Patch 7.3.846 Problem: Missing proto files. Solution: Add the files. Files: Filelist, src/proto/os_beos.pro Patch 7.3.847 Problem: Test 55 fails when messages are translated. Solution: Set language to C. (Ken Takata) Files: src/testdir/test55.in Patch 7.3.848 Problem: Can't build with Ruby 2.0 when using MinGW x64 or MSVC10. Solution: Fix it. Also detect RUBY_PLATFORM and RUBY_INSTALL_NAME for x64. (Ken Takata) Files: src/Make_cyg.mak, src/Make_ming.mak, src/if_ruby.c Patch 7.3.849 Problem: ":g//" gives "Pattern not found error" with E486. Should not use the error number, it's not a regular error message. Solution: Use a normal message. (David Bürgin) Files: src/ex_cmds.c Patch 7.3.850 Problem: ":vimgrep //" matches everywhere. Solution: Make it use the previous search pattern. (David Bürgin) Files: runtime/doc/quickfix.txt, src/quickfix.c Patch 7.3.851 Problem: Using an empty pattern with :sort silently continues when there is no previous search pattern. Solution: Give an error message. (David Bürgin) Files: src/ex_cmds.c Patch 7.3.852 Problem: system() breaks clipboard text. (Yukihiro Nakadaira) Solution: Use Xutf8TextPropertyToTextList(). (Christian Brabandt) Also do not put the text in the clip buffer if conversion fails. Files: src/ui.c, src/ops.c Patch 7.3.853 Problem: Using "ra" in multiple lines on multi-byte characters leaves a few characters not replaced. Solution: Adjust the end column only in the last line. (Yasuhiro Matsumoto) Files: src/testdir/test69.in, src/testdir/test69.ok, src/ops.c Patch 7.3.854 Problem: After using backspace in insert mode completion, CTRL-N and CTRL-P do not highlight the right entry. (Olivier Teuliere) Solution: Set the current item to the shown item after using backspace. Files: src/edit.c Patch 7.3.855 Problem: Compiler warnings. Solution: Add type casts. (Mike Williams) Files: src/misc1.c Patch 7.3.856 Problem: When calling system() multi-byte clipboard contents is garbled. Solution: Save and restore the clipboard contents. (Yukihiro Nakadaira) Files: src/gui_gtk_x11.c, src/proto/gui_gtk_x11.pro, src/ops.c, src/proto/ops.pro, src/os_unix.c, src/proto/ui.pro, src/ui.c Patch 7.3.857 Problem: The QuitPre autocommand event does not trigger for :qa and :wq. Solution: Trigger the event. (Tatsuro Fujii) Files: src/ex_docmd.c Patch 7.3.858 Problem: "gv" selects the wrong area after some operators. Solution: Save and restore the type of selection. (Christian Brabandt) Files: src/testdir/test66.in, src/testdir/test66.ok, src/normal.c Patch 7.3.859 Problem: 'ambiwidth' must be set by the user. Solution: Detects East Asian ambiguous width (UAX #11) state of the terminal at the start-up time and 'ambiwidth' accordingly. (Hayaki Saito) Files: src/main.c, src/option.c, src/term.c, src/term.h, src/proto/term.pro Patch 7.3.860 Problem: When using --remote-expr try/catch does not work. (Andrey Radev) Solution: Set emsg_silent instead of emsg_skip. Files: src/main.c Patch 7.3.861 Problem: ":setlocal number" clears global value of 'relativenumber'. Solution: Do it properly. (Markus Heidelberg) Files: src/testdir/test89.in, src/testdir/test89.ok, src/option.c Patch 7.3.862 Problem: Dragging the status line can be slow. Solution: Look ahead and drop the drag event if there is a next one. Files: src/eval.c, src/misc1.c, src/proto/misc1.pro, src/normal.c Patch 7.3.863 (after 7.3.859) Problem: Problem with 'ambiwidth' detection for ANSI terminal. Solution: Work around not recognizing a term response. (Hayaki Saito) Files: src/term.c Patch 7.3.864 (after 7.3.862) Problem: Can't build without the mouse feature. Solution: Add an #ifdef. (Ike Devolder) Files: src/misc1.c Patch 7.3.865 (after 7.3.862) Problem: Mouse position may be wrong. Solution: Let vungetc() restore the mouse position. Files: src/getchar.c Patch 7.3.866 Problem: Not serving the X selection during system() isn't nice. Solution: When using fork() do not loose the selection, keep serving it. Add a loop similar to handling I/O. (Yukihiro Nakadaira) Files: src/os_unix.c Patch 7.3.867 Problem: Matchparen does not update match when using auto-indenting. (Marc Aldorasi) Solution: Add the TextChanged and TextChangedI autocommand events. Files: runtime/plugin/matchparen.vim, src/main.c, src/edit.c, src/globals.h, src/vim.h, src/fileio.c, src/proto/fileio.pro, runtime/doc/autocmd.txt Patch 7.3.868 Problem: When at the hit-return prompt and using "k" while no text has scrolled off screen, then using "j", an empty line is displayed. Solution: Only act on "k" when text scrolled off screen. Also accept page-up and page-down. (cptstubing) Files: src/message.c Patch 7.3.869 Problem: bufwinnr() matches buffers in other tabs. Solution: For bufwinnr() and ? only match buffers in the current tab. (Alexey Radkov) Files: src/buffer.c, src/diff.c, src/eval.c, src/ex_docmd.c, src/if_perl.xs, src/proto/buffer.pro Patch 7.3.870 Problem: Compiler warnings when using MingW 4.5.3. Solution: Do not use MAKEINTRESOURCE. Adjust #if. (Ken Takata) Files: src/gui_w32.c, src/gui_w48.c, src/os_mswin.c, src/os_win32.c, src/os_win32.h Patch 7.3.871 Problem: search('^$', 'c') does not use the empty match under the cursor. Solution: Special handling of the 'c' flag. (Christian Brabandt) Add tests. Files: src/search.c, src/testdir/test14.in, src/testdir/test14.ok Patch 7.3.872 Problem: On some systems case of file names is always ignored, on others never. Solution: Add the 'fileignorecase' option to control this at runtime. Implies 'wildignorecase'. Files: src/buffer.c, src/edit.c, src/ex_cmds2.c, src/ex_getln.c, src/fileio.c, src/misc1.c, src/misc2.c, src/option.c, src/option.h, src/vim.h, runtime/doc/options.txt Patch 7.3.873 Problem: Cannot easily use :s to make title case. Solution: Have "\L\u" result in title case. (James McCoy) Files: src/regexp.c, src/testdir/test79.in, src/testdir/test79.ok, src/testdir/test80.in, src/testdir/test80.ok Patch 7.3.874 Problem: Comparing file names does not handle multi-byte characters properly. Solution: Implement multi-byte handling. Files: src/misc1.c, src/misc2.c Patch 7.3.875 (after 7.3.866) Problem: Build problem with some combination of features. Solution: Use FEAT_XCLIPBOARD instead of FEAT_CLIPBOARD. Files: src/os_unix.c Patch 7.3.876 Problem: #if indents are off. Solution: Insert a space where appropriate. (Taro Muraoka) Files: src/gui.c Patch 7.3.877 (after 7.3.871) Problem: Forward searching with search() is broken. Solution: Fix it and add tests. (Sung Pae) Files: src/search.c, src/testdir/test14.in, src/testdir/test14.ok Patch 7.3.878 Problem: 'fileignorecase' is missing in options window and quickref. Solution: Add the option. Files: runtime/optwin.vim, runtime/doc/quickref.txt Patch 7.3.879 Problem: When using an ex command in operator pending mode, using Esc to abort the command still executes the operator. (David Bürgin) Solution: Clear the operator when the ex command fails. (Christian Brabandt) Files: src/normal.c Patch 7.3.880 Problem: When writing viminfo, old history lines may replace lines written more recently by another Vim instance. Solution: Mark history entries that were read from viminfo and overwrite them when merging with the current viminfo. Files: src/ex_getln.c Patch 7.3.881 Problem: Python list does not work correctly. Solution: Fix it and add a test. (Yukihiro Nakadaira) Files: src/testdir/test86.in, src/testdir/test86.ok, src/if_py_both.h Patch 7.3.882 Problem: CursorHold may trigger after receiving the termresponse. Solution: Set the did_cursorhold flag. (Hayaki Saito) Files: src/term.c Patch 7.3.883 (after 7.3.880) Problem: Can't build with some combination of features. Solution: Adjust #ifdefs. Files: src/ex_getln.c Patch 7.3.884 Problem: Compiler warning for variable shadowing another. (John Little) Solution: Rename the variable. (Christian Brabandt) Files: src/term.c Patch 7.3.885 Problem: Double free for list and dict in Lua. (Shougo Matsu) Solution: Do not unref list and dict. (Yasuhiro Matsumoto) Files: src/if_lua.c Patch 7.3.886 Problem: Can't build with multi-byte on Solaris 10. Solution: Add #ifdef X_HAVE_UTF8_STRING. (Laurent Blume) Files: src/ui.c Patch 7.3.887 Problem: No tests for Visual mode operators, what 7.3.879 fixes. Solution: Add a new test file. (David Bürgin) Files: src/testdir/test94.in, src/testdir/test94.ok, src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak, src/testdir/Make_ming.mak, src/testdir/Make_os2.mak, src/testdir/Make_vms.mms, src/testdir/Makefile Patch 7.3.888 Problem: Filename completion with 'fileignorecase' does not work for multi-byte characters. Solution: Make 'fileignorecase' work properly. (Hirohito Higashi) Files: src/misc2.c Patch 7.3.889 Problem: Can't build with Ruby 2.0 on a 64 bit system. Solution: Define rb_fix2int and rb_num2int. (Kohei Suzuki) Files: src/if_ruby.c Patch 7.3.890 Problem: Test 79 fails on Windows. (Michael Soyka) Solution: Add comment below line causing an error. Files: src/testdir/test79.in Patch 7.3.891 Problem: Merging viminfo history doesn't work well. Solution: Don't stop when one type of history is empty. Don't merge history when writing viminfo. Files: src/ex_getln.c Patch 7.3.892 (after 7.3.891) Problem: Still merging problems for viminfo history. Solution: Do not merge lines when writing, don't write old viminfo lines. Files: src/ex_getln.c, src/ex_cmds.c, src/proto/ex_getln.pro Patch 7.3.893 Problem: Crash when using b:, w: or t: after closing the buffer, window or tabpage. Solution: Allocate the dictionary instead of having it part of the buffer/window/tabpage struct. (Yukihiro Nakadaira) Files: src/buffer.c, src/eval.c, src/fileio.c, src/structs.h, src/window.c, src/proto/eval.pro Patch 7.3.894 Problem: Using wrong RUBY_VER causing Ruby build to break. Solution: Correct the RUBY_VER value. (Yongwei Wu) Files: src/bigvim.bat Patch 7.3.895 Problem: Valgrind error in test 91. (Issue 128) Solution: Pass scope name to find_var_in_ht(). Files: src/eval.c Patch 7.3.896 Problem: Memory leaks in Lua interface. Solution: Fix the leaks, add tests. (Yukihiro Nakadaira) Files: src/testdir/test85.in, src/testdir/test85.ok, src/if_lua.c Patch 7.3.897 Problem: Configure doesn't always find the shared library. Solution: Change the configure script. (Ken Takata) Files: src/configure.in, src/auto/configure Patch 7.3.898 Problem: Memory leak reported by valgrind in test 91. Solution: Only use default argument when needed. Files: src/eval.c, src/testdir/test91.in, src/testdir/test91.ok Patch 7.3.899 Problem: #if indents are off. Solution: Fix the indents. Files: src/os_unix.c Patch 7.3.900 Problem: Not obvious that some mouse features are mutual-exclusive. Solution: Add a comment. Files: src/feature.h Patch 7.3.901 Problem: Outdated comment, ugly condition. Solution: Update a few comments, break line. Files: src/getchar.c, src/misc1.c, src/undo.c Patch 7.3.902 Problem: When deleting last buffer in other tab the tabline is not updated. Solution: Set the redraw_tabline flag. (Yukihiro Nakadaira) Files: src/window.c Patch 7.3.903 (after 7.3.892) Problem: Crash on exit writing viminfo. (Ron Aaron) Solution: Check for the history to be empty. Files: src/ex_getln.c Patch 7.3.904 (after 7.3.893) Problem: Using memory freed by the garbage collector. Solution: Mark items in aucmd_win as used. Files: src/eval.c Patch 7.3.905 (after 7.3.903) Problem: Crash when writing viminfo. (Ron Aaron) Solution: Prevent freed history info to be used. Files: src/ex_getln.c Patch 7.3.906 Problem: The "sleep .2" for running tests does not work on Solaris. Solution: Fall back to using "sleep 1". (Laurent Blume) Files: src/testdir/Makefile Patch 7.3.907 Problem: Python uses IndexError when a dict key is not found. Solution: Use KeyError instead. (ZyX) Files: src/if_py_both.h, src/if_python3.c, src/if_python.c, src/testdir/test86.ok, src/testdir/test87.ok Patch 7.3.908 Problem: Possible crash when using a list in Python. Solution: Return early if the list is NULL. (ZyX) Files: src/if_py_both.h Patch 7.3.909 Problem: Duplicate Python code. Solution: Move more items to if_py_both.h. (ZyX) Also avoid compiler warnings for missing initializers. Files: src/if_py_both.h, src/if_python3.c, src/if_python.c Patch 7.3.910 Problem: Python code in #ifdef branches with only minor differences. Solution: Merge the #ifdef branches. (ZyX) Files: src/if_py_both.h, src/if_python.c Patch 7.3.911 Problem: Python: Access to Vim variables is not so easy. Solution: Define vim.vars and vim.vvars. (ZyX) Files: runtime/doc/if_pyth.txt, src/eval.c, src/globals.h, src/if_py_both.h, src/if_python3.c, src/if_python.c, src/testdir/test86.in, src/testdir/test86.ok, src/testdir/test87.in, src/testdir/test87.ok Patch 7.3.912 Problem: Typing a ":" command at the hit-enter dialog does not work if the "file changed" dialog happens next. Solution: Check for changed files before giving the hit-enter dialog. Files: src/message.c Patch 7.3.913 (after 7.3.905) Problem: Still a crash when writing viminfo. Solution: Add checks for NULL pointers. (Ron Aaron) Files: src/ex_getln.c Patch 7.3.914 Problem: ~/.viminfo is messed up when running tests. Solution: Set the viminfo filename. Files: src/testdir/test89.in, src/testdir/test94.in Patch 7.3.915 Problem: When reading a file with encoding conversion fails at the end the next encoding in 'fencs' is not used. Solution: Retry with another encoding when possible. (Taro Muraoka) Files: src/fileio.c Patch 7.3.916 Problem: Using freed memory when pasting with the mouse (Issue 130). Solution: Get the byte value early. (hint by Dominique Pelle) Files: src/buffer.c Patch 7.3.917 Problem: When a path ends in a backslash appending a comma has the wrong effect. Solution: Replace a trailing backslash with a slash. (Nazri Ramliy) Files: src/misc1.c, src/testdir/test73.in, src/testdir/test73.ok Patch 7.3.918 Problem: Repeating an Ex command after using a Visual motion does not work. Solution: Check for an Ex command being used. (David Bürgin) Files: src/normal.c Patch 7.3.919 (after 7.3.788) Problem: An empty nl.po file does not work with an old msgfmt. Solution: Put a single # in the file. (Laurent Blume) Files: src/po/Makefile Patch 7.3.920 Problem: Compiler warning for size_t to int. Solution: Add a type cast. (Mike Williams) Files: src/misc1.c Patch 7.3.921 (after 7.3.697) Problem: Trying to create a fontset handle when 'guifontset' is not set. Solution: Add curly braces around the code block. (Max Kirillov) Files: src/syntax.c Patch 7.3.922 Problem: No test for what 7.3.918 fixes. Solution: Add a test. (David Bürgin) Files: src/testdir/test94.in, src/testdir/test94.ok Patch 7.3.923 Problem: Check for X11 header files fails on Solaris. Solution: Only use -Werror for gcc. (Laurent Blume) Files: src/configure.in, src/auto/configure Patch 7.3.924 Problem: Python interface can't easily access options. Solution: Add vim.options, vim.window.options and vim.buffer.options. (ZyX) Files: runtime/doc/if_pyth.txt, src/eval.c, src/if_py_both.h, src/if_python.c, src/if_python3.c, src/option.c, src/proto/eval.pro, src/proto/option.pro, src/testdir/test86.in, src/testdir/test86.ok, src/testdir/test87.in, src/testdir/test87.ok, src/vim.h Patch 7.3.925 Problem: Typos in source files. Solution: Fix the typos. (Ken Takata) Files: runtime/plugin/matchparen.vim, runtime/tools/vim_vs_net.cmd, src/GvimExt/gvimext.cpp, src/INSTALLvms.txt, src/Make_cyg.mak, src/Make_mvc.mak, src/Make_sas.mak, src/Make_vms.mms, src/Make_w16.mak, src/Makefile, src/VisVim/OleAut.cpp, src/VisVim/README_VisVim.txt, src/auto/configure, src/buffer.c, src/configure.in, src/diff.c, src/dosinst.c, src/edit.c, src/eval.c, src/ex_cmds2.c, src/ex_docmd.c, src/ex_eval.c, src/farsi.c, src/feature.h, src/fileio.c, src/glbl_ime.cpp, src/gui.c, src/gui_athena.c, src/gui_beval.c, src/gui_gtk_x11.c, src/gui_mac.c, src/gui_motif.c, src/gui_photon.c, src/gui_w16.c, src/gui_w32.c, src/gui_w48.c, src/gui_xmebw.c, src/gui_xmebwp.h, src/hardcopy.c, src/if_cscope.c, src/if_mzsch.c, src/if_ole.cpp, src/if_perl.xs, src/if_py_both.h, src/if_python.c, src/if_python3.c, src/if_ruby.c, src/main.aap, src/mbyte.c, src/memfile.c, src/memline.c, src/misc1.c, src/misc2.c, src/nbdebug.c, src/normal.c, src/ops.c, src/os_amiga.c, src/os_mac.h, src/os_msdos.c, src/os_mswin.c, src/os_win16.h, src/os_win32.c, src/os_win32.h, src/quickfix.c, src/screen.c, src/search.c, src/spell.c, src/structs.h, src/syntax.c, src/window.c, vimtutor.com Patch 7.3.926 Problem: Autocommands are triggered by setwinvar() et al. Missing BufEnter on :tabclose. Duplicate WinEnter on :tabclose. Wrong order of events for :tablose and :tabnew. Solution: Fix these autocommand events. (ZyX) Files: runtime/doc/eval.txt, src/buffer.c, src/eval.c, src/ex_cmds2.c, src/fileio.c, src/proto/window.pro, src/testdir/test62.in, src/testdir/test62.ok, src/window.c Patch 7.3.927 Problem: Missing combining characters when putting text in a register. Solution: Include combining characters. (David Bürgin) Files: src/getchar.c, src/testdir/test44.in, src/testdir/test44.ok Patch 7.3.928 (after 7.3.924) Problem: Can't build with strict C compiler. Solution: Move declaration to start of block. (Taro Muraoka) Files: src/if_py_both.h Patch 7.3.929 (after 7.3.924) Problem: Compiler warning for unused variable. Not freeing unused string. Solution: Remove the variable. Clear the options. Files: src/option.c Patch 7.3.930 Problem: MSVC 2012 update is not recognized. Solution: Update the version in the makefile. (Raymond Ko) Files: src/Make_mvc.mak Patch 7.3.931 Problem: No completion for :xmap and :smap. (Yukihiro Nakadaira) Solution: Add the case statements. (Christian Brabandt) Files: src/ex_docmd.c Patch 7.3.932 Problem: Compiler warning for uninitialized variable. (Tony Mechelynck) Solution: Initialize the variable. Files: src/option.c Patch 7.3.933 Problem: Ruby on Mac crashes due to GC failure. Solution: Init the stack from main(). (Hiroshi Shirosaki) Files: src/main.c, src/if_ruby.c, src/proto/if_ruby.pro Patch 7.3.934 Problem: E381 and E380 make the user think nothing happened. Solution: Display the message indicating what error list is now active. (Christian Brabandt) Files: src/quickfix.c Patch 7.3.935 (after 7.3.933) Problem: Ruby: Init stack works differently on 64 bit systems. Solution: Handle 64 bit systems and also static library. (Yukihiro Nakadaira) Files: src/if_ruby.c Patch 7.3.936 (after 7.3.935) Problem: Ruby 1.8: Missing piece for static linking on 64 bit systems. Solution: Define ruby_init_stack() (Hiroshi Shirosaki) Also fix preprocessor indents. Files: src/if_ruby.c Patch 7.3.937 Problem: More can be shared between Python 2 and 3. Solution: Move code to if_py_both.h. (ZyX) Files: src/if_python.c, src/if_python3.c, src/if_py_both.h Patch 7.3.938 Problem: Python: not easy to get to window number. Solution: Add vim.window.number. (ZyX) Files: runtime/doc/if_pyth.txt, src/if_py_both.h, src/proto/window.pro, src/window.c Patch 7.3.939 Problem: Using Py_BuildValue is inefficient sometimes. Solution: Use PyLong_FromLong(). (ZyX) Files: src/if_py_both.h Patch 7.3.940 Problem: Python: Can't get position of window. Solution: Add window.row and window.col. (ZyX) Files: runtime/doc/if_pyth.txt, src/if_py_both.h Patch 7.3.941 Problem: Stuff in if_py_both.h is ordered badly. Solution: Reorder by type. (ZyX) Files: src/if_py_both.h, src/if_python.c Patch 7.3.942 Problem: Python: SEGV in Buffer functions. Solution: Call CheckBuffer() at the right time. (ZyX) Files: src/if_py_both.h, src/if_python.c, src/if_python3.c Patch 7.3.943 Problem: Python: Negative indices were failing. Solution: Fix negative indices. Add tests. (ZyX) Files: src/if_py_both.h, src/if_python3.c, src/testdir/test86.in, src/testdir/test86.ok, src/testdir/test87.in, src/testdir/test87.ok Patch 7.3.944 Problem: External program receives the termresponse. Solution: Insert a delay and discard input. (Hayaki Saito) Files: src/term.c Patch 7.3.945 Problem: Python: List of buffers is not very useful. Solution: Make vim.buffers a map. No iterator yet. (ZyX) Files: runtime/doc/if_pyth.txt, src/if_py_both.h, src/if_python3.c, src/if_python.c, src/testdir/test86.ok, src/testdir/test87.ok Patch 7.3.946 Problem: Sometimes get stuck in waiting for cursor position report, resulting in keys starting with <Esc>[ not working. Solution: Only wait for more characters after <Esc>[ if followed by '?', '>' or a digit. Files: src/term.c Patch 7.3.947 Problem: Python: No iterator for vim.list and vim.bufferlist. Solution: Add the iterators. Also fix name of FunctionType. Add tests for vim.buffers. (ZyX) Files: runtime/doc/if_pyth.txt, src/eval.c, src/if_py_both.h, src/if_python3.c, src/if_python.c, src/proto/eval.pro, src/testdir/test86.in, src/testdir/test86.ok, src/testdir/test87.in, src/testdir/test87.ok Patch 7.3.948 Problem: Cannot build with Python 2.2 Solution: Make Python interface work with Python 2.2 Make 2.2 the first supported version. (ZyX) Files: src/if_py_both.h, src/if_python3.c, src/if_python.c, src/testdir/test86.in, src/testdir/test86.ok, src/testdir/test87.ok, src/configure.in, src/auto/configure Patch 7.3.949 Problem: Python: no easy access to tabpages. Solution: Add vim.tabpages and vim.current.tabpage. (ZyX) Files: runtime/doc/if_pyth.txt, src/if_py_both.h, src/if_python3.c, src/if_python.c, src/proto/if_python3.pro, src/proto/if_python.pro, src/proto/window.pro, src/structs.h, src/window.c Patch 7.3.950 Problem: Python: Stack trace printer can't handle messages. Solution: Make KeyErrors use PyErr_SetObject. (ZyX) Files: src/if_py_both.h, src/if_python3.c, src/if_python.c Patch 7.3.951 Problem: Python exceptions have problems. Solution: Change some IndexErrors to TypeErrors. Make “line number out of range” an IndexError. Make “unable to get option value” a RuntimeError. Make all PyErr_SetString messages start with lowercase letter and use _(). (ZyX) Files: src/if_py_both.h, src/if_python3.c, src/if_python.c, src/testdir/test86.ok, src/testdir/test87.ok Patch 7.3.952 Problem: Python: It's not easy to change window/buffer/tabpage. Solution: Add ability to assign to vim.current.{tabpage,buffer,window}. (ZyX) Files: runtime/doc/if_pyth.txt, src/if_py_both.h Patch 7.3.953 Problem: Python: string exceptions are deprecated. Solution: Make vim.error an Exception subclass. (ZyX) Files: src/if_python.c, src/if_python3.c Patch 7.3.954 Problem: No check if PyObject_IsTrue fails. Solution: Add a check for -1 value. (ZyX) Files: src/if_py_both.h Patch 7.3.955 Problem: Python: Not enough tests. Solution: Add tests for vim.{current,window*,tabpage*}. (ZyX) Files: src/testdir/test86.in, src/testdir/test86.ok, src/testdir/test87.in, src/testdir/test87.ok Patch 7.3.956 Problem: Python vim.bindeval() causes SIGABRT. Solution: Make pygilstate a local variable. (Yukihiro Nakadaira) Files: src/if_py_both.h, src/if_python.c, src/if_python3.c Patch 7.3.957 Problem: Python does not have a "do" command like Perl or Lua. Solution: Add the ":py3do" command. (Lilydjwg) Files: runtime/doc/if_pyth.txt, src/ex_cmds.h, src/ex_docmd.c, src/if_python3.c, src/proto/if_python3.pro Patch 7.3.958 Problem: Python: Iteration destructor not set. Solution: Put IterDestructor to use. (ZyX) Files: src/if_py_both.c Patch 7.3.959 (after 7.3.957) Problem: Missing error number. Solution: Assign an error number. Files: src/if_python3.c Patch 7.3.960 Problem: Compiler warning for unused variable. Solution: Put declaration in #ifdef. Files: src/window.c Patch 7.3.961 Problem: Tests 86 and 87 fail when using another language than English. Solution: Set the language to C in the test. (Dominique Pelle) Files: src/testdir/test86.in, src/testdir/test87.in, src/testdir/test87.ok Patch 7.3.962 Problem: Python tests are not portable. Solution: Use shiftwidth instead of iminsert. (ZyX) Files: src/testdir/test86.in, src/testdir/test86.ok, src/testdir/test87.in, src/testdir/test87.ok Patch 7.3.963 Problem: Setting curbuf without curwin causes trouble. Solution: Add switch_buffer() and restore_buffer(). Block autocommands to avoid trouble. Files: src/eval.c, src/proto/eval.pro, src/proto/window.pro, src/if_py_both.h, src/window.c, src/testdir/test86.ok Patch 7.3.964 Problem: Python: not so easy to access tab pages. Solution: Add window.tabpage, make window.number work with non-current tab pages. (ZyX) Files: runtime/doc/if_pyth.txt, src/if_py_both.h, src/if_python3.c, src/if_python.c, src/testdir/test86.ok, src/testdir/test87.ok Patch 7.3.965 Problem: Python garbage collection not working properly. Solution: Add support for garbage collection. (ZyX) Files: src/if_py_both.h Patch 7.3.966 Problem: There is ":py3do" but no ":pydo". Solution: Add the ":pydo" command. (Lilydjwg) Files: runtime/doc/if_pyth.txt, src/ex_cmds.h, src/ex_docmd.c, src/if_py_both.h, src/if_python.c, src/if_python3.c, src/proto/if_python.pro Patch 7.3.967 (after 7.3.965) Problem: Build fails on Mac OSX. (Greg Novack) Solution: Undefine clear(). Files: src/if_py_both.h Patch 7.3.968 Problem: Multi-byte support is only available when compiled with "big" features. Solution: Include multi-byte by default, with "normal" features. Files: src/feature.h Patch 7.3.969 Problem: Can't build with Python 3 and without Python 2. Solution: Adjust #ifdef. (Xavier de Gaye) Files: src/window.c Patch 7.3.970 Problem: Syntax highlighting can be slow. Solution: Include the NFA regexp engine. Add the 'regexpengine' option to select which one is used. (various authors, including Ken Takata, Andrei Aiordachioaie, Russ Cox, Xiaozhou Liua, Ian Young) Files: src/Make_cyg.mak, src/Make_ming.mak, src/Make_mvc.mak, src/Makefile, src/regexp.c, src/regexp.h, src/regexp_nfa.c, src/structs.h, src/testdir/Makefile, src/testdir/test64.in, src/testdir/test64.ok, Filelist, runtime/doc/pattern.txt, runtime/doc/option.txt, src/option.c, src/option.h, src/testdir/test95.in, src/testdir/test95.ok, src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak, src/testdir/Make_ming.mak, src/testdir/Make_os2.mak, src/testdir/Make_vms.mms, src/testdir/Makefile Patch 7.3.971 Problem: No support for VS2012 static code analysis. Solution: Add the ANALYZE option. (Mike Williams) Files: src/Make_mvc.mak Patch 7.3.972 Problem: Cursor not restored after InsertEnter autocommand if it moved to another line. Solution: Also restore if the saved line number is still valid. Allow setting v:char to skip restoring. Files: src/edit.c, runtime/doc/autocmd.txt Patch 7.3.973 Problem: Compiler warnings. Crash on startup. (Tony Mechelynck) Solution: Change EMSG2 to EMSGN. Make array one character longer. Files: src/regexp_nfa.c Patch 7.3.974 Problem: Can't build with ruby 1.8.5. Solution: Only use ruby_init_stack() when RUBY_INIT_STACK is defined. (Yukihiro Nakadaira) Files: src/if_ruby.c Patch 7.3.975 Problem: Crash in regexp parsing. Solution: Correctly compute the end of allocated memory. Files: src/regexp_nfa.c Patch 7.3.976 Problem: Can't build on HP-UX. Solution: Remove modern initialization. (John Marriott) Files: src/regexp_nfa.c Patch 7.3.977 Problem: Compiler warnings on 64 bit Windows. Solution: Add type casts. (Mike Williams) Also fix some white space and uncomment what was commented-out for testing. Files: src/regexp_nfa.c Patch 7.3.978 Problem: Regexp debug logs don't have a good name. Solution: Use clear names and make it possible to write logs for the old and new engines separately. (Taro Muraoka) Files: src/regexp.c, src/regexp_nfa.c Patch 7.3.979 Problem: Complex NFA regexp doesn't work. Solution: Set actual state stack end instead of using an arbitrary number. (Yasuhiro Matsumoto) Files: src/regexp_nfa.c Patch 7.3.980 Problem: Regexp logs may contain garbage. Character classes don't work correctly for multi-byte characters. Solution: Check for end of post list. Only use "is" functions for characters up to 255. (Ken Takata) Files: src/regexp_nfa.c Patch 7.3.981 Problem: In the old regexp engine \i, \I, \f and \F don't work on multi-byte characters. Solution: Dereference pointer properly. Files: src/regexp.c, src/testdir/test64.in, src/testdir/test64.ok Patch 7.3.982 Problem: In the new regexp engine \p does not work on multi-byte characters. Solution: Don't point to an integer but the characters. Files: src/regexp_nfa.c, src/testdir/test95.in, src/testdir/test95.ok Patch 7.3.983 Problem: Unnecessary temp variable. Solution: Remove the variable. Files: src/regexp_nfa.c Patch 7.3.984 Problem: A Visual mapping that uses CTRL-G works differently when started from Insert mode. (Ein Brown) Solution: Reset old_mapped_len when handling typed text in Select mode. Files: src/normal.c Patch 7.3.985 Problem: GTK vim not started as gvim doesn't set WM_CLASS property to a useful value. Solution: Call g_set_prgname() on startup. (James McCoy) Files: src/gui_gtk_x11.c Patch 7.3.986 Problem: Test 95 doesn't pass when 'encoding' isn't utf-8. (Yasuhiro Matsumoto) Solution: Force 'encoding' to be utf-8. Files: src/testdir/test95.in Patch 7.3.987 Problem: No easy to run an individual test. Tests 64 fails when 'encoding' is not utf-8. Solution: Add individual test targets to the Makefile. Move some lines from test 64 to 95. Files: src/Makefile, src/testdir/test64.in, src/testdir/test64.ok, src/testdir/test95.in, src/testdir/test95.ok Patch 7.3.988 Problem: New regexp engine is slow. Solution: Break out of the loop when the state list is empty. Files: src/regexp_nfa.c Patch 7.3.989 Problem: New regexp engine compares negative numbers to character. Solution: Add missing case statements. Files: src/regexp_nfa.c Patch 7.3.990 Problem: Memory leak in new regexp engine. Solution: Jump to end of function to free memory. (Dominique Pelle) Files: src/regexp_nfa.c Patch 7.3.991 Problem: More can be shared by Python 2 and 3. Solution: Move more stuff to if_py_both. (ZyX) Files: src/if_py_both.h, src/if_python3.c, src/if_python.c, src/testdir/test87.ok Patch 7.3.992 Problem: Python: Too many type casts. Solution: Change argument types. (ZyX) Files: src/if_py_both.h, src/if_python3.c, src/if_python.c Patch 7.3.993 Problem: Python: Later patch does things slightly differently. Solution: Adjusted argument type changes. (ZyX) Files: src/if_py_both.h, src/if_python3.c, src/if_python.c Patch 7.3.994 Problem: Python: using magic constants. Solution: Use descriptive values for ml_flags. (ZyX) Files: src/if_py_both.h, src/if_python3.c Patch 7.3.995 Problem: Python: Module initialization is duplicated. Solution: Move to shared file. (ZyX) Files: src/if_py_both.h, src/if_python3.c, src/if_python.c Patch 7.3.996 Problem: Python: Can't check types of what is returned by bindeval(). Solution: Add vim.List, vim.Dictionary and vim.Function types. (ZyX) Files: runtime/doc/if_pyth.txt, src/if_py_both.h, src/testdir/test86.in, src/testdir/test86.ok, src/testdir/test87.in, src/testdir/test87.ok Patch 7.3.997 Problem: Vim and Python exceptions are different. Solution: Make Vim exceptions be Python exceptions. (ZyX) Files: src/if_py_both.h, src/testdir/test86.in, src/testdir/test86.ok, src/testdir/test87.in, src/testdir/test87.ok Patch 7.3.998 Problem: Python: garbage collection issues. Solution: Fix the GC issues: Use proper DESTRUCTOR_FINISH: avoids negative refcounts, use PyObject_GC_* for objects with tp_traverse and tp_clear, add RangeTraverse and RangeClear, use Py_XDECREF in some places. (ZyX) Files: src/if_py_both.h, src/if_python3.c, src/if_python.c Patch 7.3.999 Problem: New regexp engine sets curbuf temporarily. Solution: Use reg_buf instead, like the old engine. Files: src/regexp_nfa.c Patch 7.3.1000 (whoa!) Problem: Typo in char value causes out of bounds access. Solution: Fix character value. (Klemens Baum) Files: src/regexp.c Patch 7.3.1001 Problem: Duplicate condition in if. Solution: Remove one condition. Files: src/regexp_nfa.c Patch 7.3.1002 Problem: Valgrind errors for Python interface. Solution: Fix memory leaks when running tests. (ZyX) Files: src/if_py_both.h Patch 7.3.1003 Problem: Python interface does not compile with Python 2.2 Solution: Fix thread issues and True/False. (ZyX) Files: src/if_py_both.h, src/if_python3.c, src/if_python.c, src/testdir/test86.in, src/testdir/test86.ok, src/testdir/test87.in, src/testdir/test87.ok Patch 7.3.1004 Problem: No error when option could not be set. Solution: Report an error. (ZyX) Files: src/if_py_both.h, src/option.c, src/proto/option.pro, src/testdir/test86.ok, src/testdir/test87.ok Patch 7.3.1005 Problem: Get stuck on regexp "\n*" and on "%s/^\n\+/\r". Solution: Fix handling of matching a line break. (idea by Hirohito Higashi) Files: src/regexp_nfa.c Patch 7.3.1006 Problem: NFA engine not used for "\_[0-9]". Solution: Enable this, fixed in patch 1005. Files: src/regexp_nfa.c Patch 7.3.1007 Problem: Can't build on Minix 3.2.1. Solution: Add a condition to an #ifdef. (Gautam Tirumala) Files: src/memfile.c Patch 7.3.1008 Problem: Test 95 fails on MS-Windows. Solution: Set 'nomore'. Change \i to \f. Change multi-byte character to something that is not matching \i. (Ken Takata) Files: src/testdir/test95.in, src/testdir/test95.ok Patch 7.3.1009 Problem: Compiler warning for ambiguous else. Solution: Add curly braces. Files: src/if_py_both.h Patch 7.3.1010 Problem: New regexp: adding \Z makes every character match. Solution: Only apply ireg_icombine for composing characters. Also add missing change from patch 1008. (Ken Takata) Files: src/regexp_nfa.c, src/testdir/test95.in, src/testdir/test95.ok Patch 7.3.1011 Problem: New regexp engine is inefficient with multi-byte characters. Solution: Handle a character at a time instead of a byte at a time. Also make \Z partly work. Files: src/regexp_nfa.c, src/testdir/test95.in, src/testdir/test95.ok Patch 7.3.1012 Problem: \Z does not work properly with the new regexp engine. Solution: Make \Z work. Add tests. Files: src/regexp_nfa.c, src/testdir/test95.in, src/testdir/test95.ok Patch 7.3.1013 Problem: New regexp logging is a bit messy. Solution: Consistently use #defines, add explanatory comment. (Taro Muraoka) Files: src/regexp_nfa.c Patch 7.3.1014 Problem: New regexp state dump is hard to read. Solution: Make the state dump more pretty. (Taro Muraoka) Files: src/regexp_nfa.c Patch 7.3.1015 Problem: New regexp engine: Matching composing characters is wrong. Solution: Fix matching composing characters. Files: src/regexp_nfa.c, src/testdir/test95.in, src/testdir/test95.ok Patch 7.3.1016 Problem: Unused field in nfa_state. Solution: Remove lastthread. Files: src/regexp.h, src/regexp_nfa.c Patch 7.3.1017 Problem: Zero width match changes length of match. Solution: For a zero width match put new states in the current position in the state list. Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok, src/regexp.h Patch 7.3.1018 Problem: New regexp engine wastes memory. Solution: Allocate prog with actual number of states, not estimated maximum number of sates. Files: src/regexp_nfa.c Patch 7.3.1019 Problem: These do not work with the new regexp engine: \%o123, \%x123, \%d123, \%u123 and \%U123. Solution: Implement these items. Files: src/regexp_nfa.c Patch 7.3.1020 Problem: Not all patterns are tested with auto / old / new engine. Solution: Test patterns with three values of 'regexpengine'. Files: src/testdir/test64.in, src/testdir/test64.ok, src/testdir/test95.in, src/testdir/test95.ok Patch 7.3.1021 Problem: New regexp engine does not ignore order of composing chars. Solution: Ignore composing chars order. Files: src/regexp_nfa.c, src/testdir/test95.in, src/testdir/test95.ok Patch 7.3.1022 Problem: Compiler warning for shadowed variable. (John Little) Solution: Move declaration, rename variables. Files: src/regexp_nfa.c Patch 7.3.1023 Problem: Searching for composing char only and using \Z has different results. Solution: Make it match the composing char, matching everything is not useful. Files: src/regexp_nfa.c, src/testdir/test95.in, src/testdir/test95.ok Patch 7.3.1024 Problem: New regexp: End of matching pattern not set correctly. (Cesar Romani) Solution: Quit the loop after finding the match. Store nfa_has_zend in the program. Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok, src/regexp.h Patch 7.3.1025 Problem: New regexp: not matching newline in string. (Marc Weber) Solution: Check for "\n" character. Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok Patch 7.3.1026 Problem: New regexp: pattern that includes a new-line matches too early. (john McGowan) Solution: Do not start searching in the second line. Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok Patch 7.3.1027 Problem: New regexp performance: Calling no_Magic() very often. Solution: Remove magicness inline. Files: src/regexp_nfa.c Patch 7.3.1028 Problem: New regexp performance: Copying a lot of position state. Solution: Only copy the sub-expressions that are being used. Files: src/regexp_nfa.c, src/regexp.h Patch 7.3.1029 Problem: New regexp performance: Unused position state being copied. Solution: Keep track of which positions are actually valid. Files: src/regexp_nfa.c Patch 7.3.1030 (after 7.3.1028) Problem: Can't build for debugging. Solution: Fix struct member names. Files: src/regexp_nfa.c Patch 7.3.1031 Problem: Compiler warnings for shadowed variable. (John Little) Solution: Move the variable declarations to the scope where they are used. Files: src/regexp_nfa.c Patch 7.3.1032 Problem: "\ze" is not supported by the new regexp engine. Solution: Make "\ze" work. Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok Patch 7.3.1033 Problem: "\1" .. "\9" are not supported in the new regexp engine. Solution: Implement them. Add a few more tests. Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok, src/regexp.h Patch 7.3.1034 Problem: New regexp code using strange multi-byte code. Solution: Use the normal code to advance and backup pointers. Files: src/regexp_nfa.c Patch 7.3.1035 Problem: Compiler warning on 64 bit windows. Solution: Add type cast. (Mike Williams) Files: src/if_py_both.h Patch 7.3.1036 Problem: Can't build on HP-UX. Solution: Give the union a name. (John Marriott) Files: src/regexp_nfa.c Patch 7.3.1037 Problem: Look-behind matching is very slow on long lines. Solution: Add a byte limit to how far back an attempt is made. Files: src/regexp.c, src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok Patch 7.3.1038 Problem: Crash when using Cscope. Solution: Avoid negative argument to vim_strncpy(). (Narendran Gopalakrishnan) Files: src/if_cscope.c Patch 7.3.1039 Problem: New regexp engine does not support \%23c, \%<23c and the like. Solution: Implement them. (partly by Yasuhiro Matsumoto) Files: src/regexp.h, src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok Patch 7.3.1040 Problem: Python: Problems with debugging dynamic build. Solution: Python patch 1. (ZyX) Files: src/if_python.c, src/if_python3.c Patch 7.3.1041 Problem: Python: Invalid read valgrind errors. Solution: Python patch 2: defer DICTKEY_UNREF until key is no longer needed. (ZyX) Files: src/if_py_both.h Patch 7.3.1042 Problem: Python: can't assign to vim.Buffer.name. Solution: Python patch 3. (ZyX) Files: runtime/doc/if_pyth.txt, src/ex_cmds.c, src/if_py_both.h, src/if_python3.c, src/if_python.c, src/proto/ex_cmds.pro, src/testdir/test86.in, src/testdir/test86.ok, src/testdir/test87.in, src/testdir/test87.ok Patch 7.3.1043 Problem: Python: Dynamic compilation with 2.3 fails. Solution: Python patch 4. (ZyX) Files: src/if_python.c Patch 7.3.1044 Problem: Python: No {Buffer,TabPage,Window}.valid attributes. Solution: Python patch 5: add .valid (ZyX) Files: src/if_py_both.h, src/if_python3.c, src/if_python.c, src/testdir/test86.in, src/testdir/test86.ok, src/testdir/test87.in, src/testdir/test87.ok Patch 7.3.1045 Problem: Python: No error handling for VimToPython function. Solution: Python patch 6. (ZyX) Files: src/if_py_both.h Patch 7.3.1046 Problem: Python: Using Py_BuildValue for building strings. Solution: Python patch 7 and 7.5: Replace Py_BuildValue with PyString_FromString. (ZyX) Files: src/if_py_both.h Patch 7.3.1047 Problem: Python: dir() does not work properly. Solution: Python patch 8. Add __dir__ method to all objects with custom tp_getattr supplemented by __members__ attribute for at least python-2* versions. __members__ is not mentioned in python-3* dir() output even if it is accessible. (ZyX) Files: src/if_py_both.h, src/if_python3.c, src/if_python.c, src/testdir/test86.in, src/testdir/test86.ok, src/testdir/test87.in, src/testdir/test87.ok Patch 7.3.1048 Problem: Python: no consistent naming. Solution: Python patch 9: Rename d to dict and lookupDict to lookup_dict. (ZyX) Files: src/if_py_both.h Patch 7.3.1049 Problem: Python: no consistent naming Solution: Python patch 10: Rename DICTKEY_GET_NOTEMPTY to DICTKEY_GET. (ZyX) Files: src/if_py_both.h Patch 7.3.1050 Problem: Python: Typo in pyiter_to_tv. Solution: Python patch 11. (ZyX) Files: src/if_py_both.h Patch 7.3.1051 Problem: Python: possible memory leaks. Solution: Python patch 12: fix the leaks (ZyX) Files: src/if_py_both.h Patch 7.3.1052 Problem: Python: possible SEGV and negative refcount. Solution: Python patch 13: Fix IterIter function. (ZyX) Files: src/if_py_both.h Patch 7.3.1053 Problem: Python: no flag for types with tp_traverse+tp_clear. Solution: Python patch 14: Add Py_TPFLAGS_HAVE_GC. (ZyX) Files: src/if_py_both.h Patch 7.3.1054 (after 7.3.1042) Problem: Can't build without the +autocmd feature. (Elimar Riesebieter) Solution: Fix use of buf and curbuf. Files: src/ex_cmds.c, src/testdir/test86.ok, src/testdir/test87.ok Patch 7.3.1055 Problem: Negated collection does not match newline. Solution: Handle newline differently. (Hiroshi Shirosaki) Files: src/regexp_nfa.c, src/testdir/test64.ok, src/testdir/test64.in Patch 7.3.1056 Problem: Python: possible memory leaks. Solution: Python patch 15. (ZyX) Fix will follow later. Files: src/eval.c, src/if_py_both.h, src/proto/eval.pro Patch 7.3.1057 Problem: Python: not enough compatibility. Solution: Python patch 16: Make OutputWritelines support any sequence object (ZyX) Note: tests fail Files: src/if_py_both.h, src/testdir/test86.in, src/testdir/test86.ok, src/testdir/test87.in, src/testdir/test87.ok Patch 7.3.1058 Problem: Call of funcref does not succeed in other script. Solution: Python patch 17: add get_expanded_name(). (ZyX) Files: src/eval.c, src/proto/eval.pro Patch 7.3.1059 Problem: Python: Using fixed size buffers. Solution: Python patch 18: Use python's own formatter. (ZyX) Files: src/if_py_both.h, src/if_python3.c, src/if_python.c Patch 7.3.1060 Problem: Python: can't repr() a function. Solution: Python patch 19: add FunctionRepr(). (ZyX) Files: src/if_py_both.h Patch 7.3.1061 Problem: Python: Dictionary is not standard. Solution: Python patch 20: Add standard methods and fields. (ZyX) Files: runtime/doc/if_pyth.txt, src/eval.c, src/if_py_both.h, src/if_python3.c, src/if_python.c, src/proto/eval.pro, src/testdir/test86.in, src/testdir/test86.ok, src/testdir/test87.in, src/testdir/test87.ok Patch 7.3.1062 Problem: Python: List is not standard. Solution: Python patch 21: Add standard methods and fields. (ZyX) Files: src/if_py_both.h, src/testdir/test86.in, src/testdir/test86.ok, src/testdir/test87.in, src/testdir/test87.ok Patch 7.3.1063 Problem: Python: Function is not standard. Solution: Python patch 22: make Function subclassable. (ZyX) Files: src/eval.c, src/if_py_both.h, src/proto/eval.pro, src/testdir/test86.in, src/testdir/test86.ok, src/testdir/test87.in, src/testdir/test87.ok Patch 7.3.1064 Problem: Python: insufficient error checking. Solution: Python patch 23. (ZyX) Files: src/if_py_both.h Patch 7.3.1065 Problem: Python: key mapping is not standard. Solution: Python patch 24: use PyMapping_Keys. (ZyX) Files: src/if_py_both.h, src/if_python3.c, src/if_python.c Patch 7.3.1066 Problem: Python: Insufficient exception and error testing. Solution: Python patch 25. (ZyX) Files: src/testdir/test86.in, src/testdir/test86.ok, src/testdir/test87.in, src/testdir/test87.ok Patch 7.3.1067 Problem: Python: documentation lags behind. Solution: Python patch 26. (ZyX) Files: runtime/doc/if_pyth.txt Patch 7.3.1068 Problem: Python: Script is auto-loaded on function creation. Solution: Python patch 27. (ZyX) Files: src/eval.c, src/if_py_both.h, src/proto/eval.pro, src/testdir/test86.ok, src/testdir/test87.ok, src/vim.h Patch 7.3.1069 Problem: Python: memory leaks. Solution: Python patch 28: Purge out DICTKEY_CHECK_EMPTY macros. (ZyX) Files: src/if_py_both.h Patch 7.3.1070 Problem: Vim crashes in Python tests. Compiler warning for unused function. Solution: Disable the tests for now. Move the function. Files: src/if_py_both.h, src/if_python.c, src/testdir/test86.in, src/testdir/test87.in Patch 7.3.1071 Problem: New regexp engine: backreferences don't work correctly. Solution: Add every possible start/end position on the state stack. Files: src/regexp_nfa.c, src/regexp.h, src/testdir/test64.in, src/testdir/test64.ok Patch 7.3.1072 Problem: Compiler warning for uninitialized variable. Solution: Initialize it. Files: src/regexp_nfa.c Patch 7.3.1073 Problem: New regexp engine may run out of states. Solution: Allocate states dynamically. Also make the test report errors. Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok, src/testdir/test95.in Patch 7.3.1074 Problem: Compiler warning for printf format. (Manuel Ortega) Solution: Add type casts. Files: src/if_py_both.h Patch 7.3.1075 Problem: Compiler warning for storing a long_u in an int. Solution: Declare the number as an int. (Mike Williams) Files: src/regexp_nfa.c Patch 7.3.1076 Problem: New regexp engine: \@= and \& don't work. Solution: Make these items work. Add column info to logging. Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok Patch 7.3.1077 Problem: Python: Allocating dict the wrong way, causing a crash. Solution: Use py_dict_alloc(). Fix some exception problems. (ZyX) Files: src/if_py_both.h Patch 7.3.1078 Problem: New regexp engine: \@! doesn't work. Solution: Implement the negated version of \@=. Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok Patch 7.3.1079 Problem: Test 87 fails. Solution: Fix the test for Python 3.3. (ZyX) Make it pass on 32 bit systems. Files: src/testdir/test87.in, src/testdir/test87.ok Patch 7.3.1080 Problem: Test 86 fails. Solution: Comment out the parts that don't work. Make it pass on 32 bit systems. Files: src/testdir/test86.in, src/testdir/test86.ok Patch 7.3.1081 Problem: Compiler warnings on 64-bit Windows. Solution: Change variable types. (Mike Williams) Files: src/if_py_both.h, src/regexp_nfa.c Patch 7.3.1082 Problem: New regexp engine: Problem with \@= matching. Solution: Save and restore nfa_match. Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok Patch 7.3.1083 Problem: New regexp engine: Does not support \%^ and \%$. Solution: Support matching start and end of file. Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok Patch 7.3.1084 Problem: New regexp engine: only accepts up to \{,10}. Solution: Remove upper limit. Remove dead code with NFA_PLUS. Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok Patch 7.3.1085 Problem: New regexp engine: Non-greedy multi doesn't work. Solution: Implement \{-}. Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok Patch 7.3.1086 Problem: Old regexp engine accepts illegal range, new one doesn't. Solution: Also accept the illegal range with the new engine. Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok Patch 7.3.1087 Problem: A leading star is not seen as a normal char when \{} follows. Solution: Save and restore the parse state properly. Files: src/regexp.c, src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok Patch 7.3.1088 Problem: New regexp engine: \@<= and \@<! are not implemented. Solution: Implement look-behind matching. Fix off-by-one error in old regexp engine. Files: src/regexp.c, src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok Patch 7.3.1089 Problem: Tests 86 and 87 fail on MS-Windows. (Ken Takata) Solution: Fix platform-specific stuff. (ZyX) Files: src/testdir/test86.in, src/testdir/test86.ok, src/testdir/test87.in, src/testdir/test87.ok Patch 7.3.1090 Problem: New regexp engine does not support \z1 .. \z9 and \z(. Solution: Implement the syntax submatches. Files: src/regexp.h, src/regexp_nfa.c Patch 7.3.1091 Problem: New regexp engine: no error when using \z1 or \z( where it does not work. Solution: Give an error message. Files: src/regexp.c, src/regexp_nfa.c Patch 7.3.1092 Problem: Can't build with regexp debugging. NFA debug output shows wrong pattern. Solution: Fix debugging code for recent changes. Add the pattern to the program. Files: src/regexp_nfa.c, src/regexp.h Patch 7.3.1093 Problem: New regexp engine: When a sub expression is empty \1 skips a character. Solution: Make \1 try the current position when the match is empty. Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok Patch 7.3.1094 Problem: New regexp engine: Attempts to match "^" at every character. Solution: Only try "^" at the start of a line. Files: src/regexp_nfa.c Patch 7.3.1095 Problem: Compiler warnings for shadowed variables. (Christian Brabandt) Solution: Rename new_state() to alloc_state(). Remove unnecessary declaration. Files: src/regexp_nfa.c Patch 7.3.1096 Problem: Python: popitem() was not defined in a standard way. Solution: Remove the argument from popitem(). (ZyX) Files: runtime/doc/if_pyth.txt, src/if_py_both.h, src/testdir/test86.in, src/testdir/test86.ok, src/testdir/test87.in, src/testdir/test87.ok Patch 7.3.1097 Problem: Python: a few recently added items are not documented. Solution: Update the documentation. (ZyX) Files: runtime/doc/if_pyth.txt Patch 7.3.1098 Problem: Python: Possible memory leaks Solution: Add Py_XDECREF() calls. (ZyX) Files: src/if_py_both.h Patch 7.3.1099 Problem: Python: Changing directory with os.chdir() causes problems for Vim's notion of directories. Solution: Add vim.chdir() and vim.fchdir(). (ZyX) Files: runtime/doc/if_pyth.txt, src/ex_docmd.c, src/if_py_both.h, src/if_python3.c, src/if_python.c, src/proto/ex_docmd.pro, src/testdir/test86.in, src/testdir/test86.ok, src/testdir/test87.in, src/testdir/test87.ok Patch 7.3.1100 Problem: Python: a few more memory problems. Solution: Add and remove Py_XDECREF(). (ZyX) Files: src/if_py_both.h, src/testdir/test86.in, src/testdir/test86.ok, src/testdir/test87.in, src/testdir/test87.ok Patch 7.3.1101 Problem: Configure doesn't find Python 3 on Ubuntu 13.04. Solution: First try distutils.sysconfig. Also fix some indents. (Ken Takata) Files: src/configure.in, src/auto/configure Patch 7.3.1102 Problem: Completion of ":py3do" and ":py3file" does not work after ":py3". Solution: Make completion work. (Taro Muraoka) Files: src/ex_docmd.c Patch 7.3.1103 Problem: New regexp engine: overhead in saving and restoring. Solution: Make saving and restoring list IDs faster. Don't copy or check \z subexpressions when they are not used. Files: src/regexp_nfa.c Patch 7.3.1104 Problem: New regexp engine does not handle "~". Solution: Add support for "~". Files: src/regexp_nfa.c, src/testdir/test24.in, src/testdir/test24.ok Patch 7.3.1105 Problem: New regexp engine: too much code in one function. Dead code. Solution: Move the recursive nfa_regmatch call to a separate function. Remove the dead code. Files: src/regexp_nfa.c Patch 7.3.1106 Problem: New regexp engine: saving and restoring lastlist in the states takes a lot of time. Solution: Use a second lastlist value for the first recursive call. Files: src/regexp.h, src/regexp_nfa.c Patch 7.3.1107 Problem: Compiler warnings for unused variables. Solution: Put the variables inside #ifdef. Files: src/regexp.c, src/regexp_nfa.c Patch 7.3.1108 Problem: Error message for os.fchdir() (Charles Peacech) Solution: Clear the error. (ZyX) Files: src/if_py_both.h Patch 7.3.1109 Problem: Building on MS-Windows doesn't see changes in if_py_both.h. Solution: Add a dependency. (Ken Takata) Files: src/Make_bc5.mak, src/Make_cyg.mak, src/Make_ming.mak, src/Make_mvc.mak Patch 7.3.1110 Problem: New regexp matching: Using \@= and the like can be slow. Solution: Decide whether to first try matching the zero-width part or what follows, whatever is more likely to fail. Files: src/regexp_nfa.c Patch 7.3.1111 Problem: nfa_recognize_char_class() implementation is inefficient. Solution: Use bits in an int instead of chars in a string. (Dominique Pelle) Files: src/regexp_nfa.c, src/testdir/test36.in, src/testdir/test36.ok Patch 7.3.1112 Problem: New regexp engine: \%V not supported. Solution: Implement \%V. Add tests. Files: src/regexp.c, src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok Patch 7.3.1113 Problem: New regexp engine: \%'m not supported. Solution: Implement \%'m. Add tests. Files: src/regexp.c, src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok Patch 7.3.1114 (after 7.3.1110) Problem: Can't build without the syntax feature. Solution: Add #ifdefs. (Erik Falor) Files: src/regexp_nfa.c Patch 7.3.1115 Problem: Many users don't like the cursor line number when 'relativenumber' is set. Solution: Have four combinations with 'number' and 'relativenumber'. (Christian Brabandt) Files: runtime/doc/options.txt, src/option.c, src/screen.c, src/testdir/test89.in, src/testdir/test89.ok Patch 7.3.1116 Problem: Can't build without Visual mode. Solution: Add #ifdefs. Files: src/regexp_nfa.c Patch 7.3.1117 Problem: New regexp engine: \%[abc] not supported. Solution: Implement \%[abc]. Add tests. Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok Patch 7.3.1118 Problem: Match failure rate is not very specific. Solution: Tune the failure rate for match items. Files: src/regexp_nfa.c Patch 7.3.1119 Problem: Flags in 'cpo' are search for several times. Solution: Store the result and re-use the flags. Files: src/regexp.c, src/regexp_nfa.c Patch 7.3.1120 Problem: Crash when regexp logging is enabled. Solution: Avoid using NULL pointers. Advance over count argument. Files: src/regexp.c, src/regexp_nfa.c Patch 7.3.1121 Problem: New regexp engine: adding states that are not used. Solution: Don't add the states. Files: src/regexp_nfa.c Patch 7.3.1122 Problem: New regexp engine: \@> not supported. Solution: Implement \%>. Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok Patch 7.3.1123 Problem: Can't build tiny Vim on MS-Windows. Solution: Adjust #ifdef around using modif_fname(). (Mike Williams) Files: src/misc1.c Patch 7.3.1124 Problem: Python: Crash on MS-Windows when os.fchdir() is not available. Solution: Check for _chdir to be NULL. (Ken Takata) Files: src/if_py_both.h Patch 7.3.1125 Problem: Error for using \%V in a pattern in tiny Vim. Solution: Allow using \%V but never match. (Dominique Pelle) Files: src/regexp_nfa.c Patch 7.3.1126 Problem: Compiler warning for uninitialized variable. (Tony Mechelynck) Solution: Assign something to the variable. Files: src/regexp_nfa.c Patch 7.3.1127 Problem: No error for using empty \%[]. Solution: Give error message. Files: src/regexp.c, src/regexp_nfa.c Patch 7.3.1128 Problem: Now that the NFA engine handles everything every failure is a syntax error. Solution: Remove the syntax_error flag. Files: src/regexp.c, src/regexp_nfa.c Patch 7.3.1129 Problem: Can't see what pattern in syntax highlighting is slow. Solution: Add the ":syntime" command. Files: src/structs.h, src/syntax.c, src/ex_cmds.h, src/ex_docmd.c, src/proto/syntax.pro, src/ex_cmds2.c, src/proto/ex_cmds2.pro, runtime/doc/syntax.txt Patch 7.3.1130 (after 7.3.1129) Problem: Can't build with anything but huge features. Solution: Check for FEAT_PROFILE. (Yasuhiro Matsumoto) Files: src/ex_docmd.c, src/structs.h, src/syntax.c Patch 7.3.1131 Problem: New regexp engine is a bit slow. Solution: Do not clear the state list. Don't copy syntax submatches when not used. Files: src/regexp_nfa.c Patch 7.3.1132 Problem: Crash when debugging regexp. Solution: Do not try to dump subexpr that were not set. Skip over count of \% items. Files: src/regexp.c, src/regexp_nfa.c Patch 7.3.1133 Problem: New regexp engine is a bit slow. Solution: Skip ahead to a character that must match. Don't try matching a "^" patter past the start of line. Files: src/regexp_nfa.c, src/regexp.h Patch 7.3.1134 Problem: Running test 49 takes a long time. Solution: Don't have it grep all files. Files: src/testdir/test49.vim Patch 7.3.1135 Problem: Compiler warning for unused argument. Solution: Add UNUSED. Files: src/syntax.c Patch 7.3.1136 Problem: ":func Foo" does not show attributes. Solution: Add "abort", "dict" and "range". (Yasuhiro Matsumoto) Files: src/eval.c Patch 7.3.1137 Problem: New regexp engine: collections are slow. Solution: Handle all characters in one go. Files: src/regexp_nfa.c Patch 7.3.1138 Problem: New regexp engine: neglist no longer used. Solution: Remove the now unused neglist. Files: src/regexp_nfa.c Patch 7.3.1139 Problem: New regexp engine: negated flag is hardly used. Solution: Add separate _NEG states, remove negated flag. Files: src/regexp_nfa.c, src/regexp.h Patch 7.3.1140 Problem: New regexp engine: trying expensive match while the result is not going to be used. Solution: Check for output state already being in the state list. Files: src/regexp_nfa.c Patch 7.3.1141 Problem: Win32: Check for available memory is not reliable and adds overhead. Solution: Remove mch_avail_mem(). (Mike Williams) Files: src/os_win32.c, src/os_win32.h Patch 7.3.1142 Problem: Memory leak in ":syntime report". Solution: Clear the grow array. (Dominique Pelle) Files: src/syntax.c Patch 7.3.1143 Problem: When mapping NUL it is displayed as an X. Solution: Check for KS_ZERO instead of K_ZERO. (Yasuhiro Matsumoto) Files: src/message.c Patch 7.3.1144 Problem: "RO" is not translated everywhere. Solution: Put inside _(). (Sergey Alyoshin) Files: src/buffer.c, src/screen.c Patch 7.3.1145 Problem: New regexp engine: addstate() is called very often. Solution: Optimize adding the start state. Files: src/regexp_nfa.c Patch 7.3.1146 Problem: New regexp engine: look-behind match not checked when followed by zero-width match. Solution: Do the look-behind match before adding the zero-width state. Files: src/regexp_nfa.c Patch 7.3.1147 Problem: New regexp engine: regstart is only used to find the first match. Solution: Use regstart whenever adding the start state. Files: src/regexp_nfa.c Patch 7.3.1148 Problem: No command line completion for ":syntime". Solution: Implement the completion. (Dominique Pelle) Files: runtime/doc/map.txt, src/ex_cmds.h, src/ex_docmd.c, src/ex_getln.c, src/proto/syntax.pro, src/syntax.c, src/vim.h Patch 7.3.1149 Problem: New regexp engine: Matching plain text could be faster. Solution: Detect a plain text match and handle it specifically. Add vim_regfree(). Files: src/regexp.c, src/regexp.h, src/regexp_nfa.c, src/proto/regexp.pro, src/buffer.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/gui.c, src/misc1.c, src/misc2.c, src/option.c, src/syntax.c, src/quickfix.c, src/search.c, src/spell.c, src/tag.c, src/window.c, src/screen.c, src/macros.h, src/testdir/test64.in, src/testdir/test64.ok Patch 7.3.1150 Problem: New regexp engine: Slow when a look-behind match does not have a width specified. Solution: Try to compute the maximum width. Files: src/regexp_nfa.c Patch 7.3.1151 Problem: New regexp engine: Slow when a look-behind match is followed by a zero-width match. Solution: Postpone the look-behind match more often. Files: src/regexp_nfa.c Patch 7.3.1152 Problem: In tiny build ireg_icombine is undefined. (Tony Mechelynck) Solution: Add #ifdef. Files: src/regexp_nfa.c Patch 7.3.1153 Problem: New regexp engine: Some look-behind matches are very expensive. Solution: Postpone invisible matches further, until a match is almost found. Files: src/regexp_nfa.c Patch 7.3.1154 Problem: New regexp_nfa engine: Unnecessary code. Solution: Remove unnecessary code. Files: src/regexp_nfa.c Patch 7.3.1155 Problem: MS-DOS: "make test" uses external rmdir command. Solution: Rename "rmdir" to "rd". (Taro Muraoka) Files: src/testdir/Make_dos.mak Patch 7.3.1156 Problem: Compiler warnings. (dv1445) Solution: Initialize variables, even when the value isn't really used. Files: src/regexp_nfa.c, src/eval.c Patch 7.3.1157 Problem: New regexp engine fails on "\(\<command\)\@<=.*" Solution: Fix rule for postponing match. Further tune estimating whether postponing works better. Add test. Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok Patch 7.3.1158 Problem: Crash when running test 86. (Jun Takimoto) Solution: Define PY_SSIZE_T_CLEAN early. (Elimar Riesebieter) Files: src/if_python.c, src/if_python3.c Patch 7.3.1159 Problem: The round() function is not always available. (Christ van Willegen) Solution: Use the solution from f_round(). Files: src/ex_cmds2.c, src/eval.c, src/proto/eval.pro Patch 7.3.1160 Problem: Mixing long and pointer doesn't always work. Solution: Avoid cast to pointer. Files: src/undo.c Patch 7.3.1161 Problem: Python: PyList_SetItem() is inefficient. Solution: Use PyList_SET_ITEM() (ZyX) Files: src/if_py_both.h Patch 7.3.1162 Problem: Python: Memory leaks Solution: Add more Py_DECREF(). (ZyX) Files: src/if_py_both.h, src/if_python.c Patch 7.3.1163 Problem: Not easy to load Python modules. Solution: Search "python2", "python3" and "pythonx" directories in 'runtimepath' for Python modules. (ZyX) Files: runtime/doc/if_pyth.txt, src/configure.in, src/ex_cmds2.c, src/if_py_both.h, src/if_python.c, src/if_python3.c, src/testdir/test86.in, src/testdir/test87.in, src/auto/configure Patch 7.3.1164 Problem: Can't test what is actually displayed on screen. Solution: Add the screenchar() and screenattr() functions. Files: src/eval.c, runtime/doc/eval.txt Patch 7.3.1165 Problem: HP-UX compiler can't handle zero size array. (Charles Cooper) Solution: Make the array one item big. Files: src/regexp.h, src/regexp_nfa.c Patch 7.3.1166 Problem: Loading Python modules is not tested. Solution: Enable commented-out tests, add missing files. (ZyX) Files: src/testdir/test86.in, src/testdir/test86.ok, src/testdir/test87.in, src/testdir/test87.ok, src/testdir/python2/module.py, src/testdir/python3/module.py, src/testdir/pythonx/module.py, src/testdir/pythonx/modulex.py, Filelist Patch 7.3.1167 Problem: Python configure check doesn't reject Python 2 when requesting Python 3. Some systems need -pthreads instead of -pthread. Solution: Adjust configure accordingly. (Andrei Olsen) Files: src/configure.in, src/auto/configure Patch 7.3.1168 Problem: Python "sane" configure checks give a warning message. Solution: Use single quotes instead of escaped double quotes. (Ben Fritz) Files: src/configure.in, src/auto/configure Patch 7.3.1169 Problem: New regexp engine: some work is done while executing a pattern, even though the result is predictable. Solution: Do the work while compiling the pattern. Files: src/regexp_nfa.c Patch 7.3.1170 Problem: Patch 7.3.1058 breaks backwards compatibility, not possible to use a function reference as a string. (lilydjwg) Solution: Instead of translating the function name only translate "s:". Files: src/eval.c Patch 7.3.1171 Problem: Check for digits and ascii letters can be faster. Solution: Use a trick with one comparison. (Dominique Pelle) Files: src/macros.h Patch 7.3.1172 Problem: Python 2: loading modules doesn't work well. Solution: Fix the code. Add more tests. (ZyX) Files: runtime/doc/if_pyth.txt, src/if_py_both.h, src/if_python.c, src/testdir/python2/module.py, src/testdir/python3/module.py, src/testdir/python_after/after.py, src/testdir/python_before/before.py, src/testdir/test86.in, src/testdir/test86.ok, src/testdir/test87.in, src/testdir/test87.ok, Filelist Patch 7.3.1173 Problem: Python 2 tests don't have the same output everywhere. Solution: Make the Python 2 tests more portable. (ZyX) Files: src/testdir/test86.in, src/testdir/test86.ok Patch 7.3.1174 Problem: Python 2 and 3 use different ways to load modules. Solution: Use the same method. (ZyX) Files: runtime/doc/if_pyth.txt, src/if_py_both.h, src/if_python3.c, src/if_python.c Patch 7.3.1175 Problem: Using isalpha() and isalnum() can be slow. Solution: Use range checks. (Mike Williams) Files: src/ex_docmd.c, src/macros.h Patch 7.3.1176 Problem: Compiler warnings on 64 bit system. Solution: Add type casts. (Mike Williams) Files: src/eval.c, src/if_py_both.h Patch 7.3.1177 Problem: Wasting memory on padding. Solution: Reorder struct fields. (Dominique Pelle) Files: src/structs.h, src/fileio.c Patch 7.3.1178 Problem: Can't put all Vim config files together in one directory. Solution: Load ~/.vim/vimrc if ~/.vimrc does not exist. (Lech Lorens) Files: runtime/doc/gui.txt, runtime/doc/starting.txt, src/gui.c, src/main.c, src/os_amiga.h, src/os_dos.h, src/os_unix.h Patch 7.3.1179 Problem: When a global mapping starts with the same characters as a buffer-local mapping Vim waits for a character to be typed to find out whether the global mapping is to be used. (Andy Wokula) Solution: Use the local mapping without waiting. (Michael Henry) Files: runtime/doc/map.txt, src/getchar.c Patch 7.3.1180 Problem: When current directory changes, path from cscope may no longer be valid. (AS Budden) Solution: Always store the absolute path. (Christian Brabandt) Files: src/if_cscope.c Patch 7.3.1181 Problem: Wrong error message for 1.0[0]. Solution: Check for funcref and float separately. (Yasuhiro Matsumoto) Files: src/eval.c Patch 7.3.1182 Problem: 'backupcopy' default on MS-Windows does not work for hard and soft links. Solution: Check for links. (David Pope, Ken Takata) Files: src/fileio.c, src/os_win32.c, src/proto/os_win32.pro Patch 7.3.1183 Problem: Python tests 86 and 87 fail. Solution: Add "empty" files. (ZyX) Files: src/testdir/python_before/before_1.py, src/testdir/python_before/before_2.py Patch 7.3.1184 Problem: Highlighting is sometimes wrong. (Axel Bender) Solution: Fetch regline again when returning from recursive regmatch. Files: src/regexp_nfa.c Patch 7.3.1185 Problem: New regexp engine: no match with ^ after \n. (SungHyun Nam) Solution: Fix it, add a test. Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok Patch 7.3.1186 Problem: Python 3: test 87 may crash. Solution: Use _PyArg_Parse_SizeT instead of PyArg_Parse. (Jun Takimoto) Files: src/if_python3.c Patch 7.3.1187 (after 7.3.1170) Problem: "s:" is recognized but "<SID>" is not. (ZyX) Solution: Translate "<SID>" like "s:". Files: src/eval.c Patch 7.3.1188 Problem: Newline characters messing up error message. Solution: Remove the newlines. (Kazunobu Kuriyama) Files: src/gui_x11.c Patch 7.3.1189 (after 7.3.1185) Problem: Highlighting is still wrong sometimes. (Dominique Pelle) Solution: Also restore reginput properly. Files: src/regexp_nfa.c Patch 7.3.1190 Problem: Compiler warning for parentheses. (Christian Wellenbrock) Solution: Change #ifdef. Files: src/ex_docmd.c Patch 7.3.1191 Problem: Backreference to previous line doesn't work. (Lech Lorens) Solution: Implement looking in another line. Files: src/regexp.c, src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok Patch 7.3.1192 Problem: Valgrind reports errors when using backreferences. (Dominique Pelle) Solution: Do not check the end of submatches. Files: src/regexp_nfa.c Patch 7.3.1193 Problem: fail_if_missing not used for Python 3. Solution: Give an error when Python 3 can't be configured. (Andrei Olsen) Files: src/configure.in, src/auto/configure Patch 7.3.1194 Problem: Yaml highlighting is slow. Solution: Tune the estimation of pattern failure chance. Files: src/regexp_nfa.c Patch 7.3.1195 Problem: Compiler warning for uninitialized variable. (Tony Mechelynck) Solution: Set the length to the matching backref. Files: src/regexp.c Patch 7.3.1196 Problem: Old regexp engine does not match pattern with backref correctly. (Dominique Pelle) Solution: Fix setting status. Test multi-line patterns better. Files: src/regexp.c, src/testdir/test64.in, src/testdir/test64.ok Patch 7.3.1197 Problem: ":wviminfo!" does not write history previously read from a viminfo file. (Roland Eggner) Solution: When not merging history write all entries. Files: src/ex_cmds.c, src/ex_getln.c, src/proto/ex_getln.pro Patch 7.3.1198 Problem: Build error when using Perl 5.18.0 and dynamic loading. Solution: Change #ifdefs for Perl_croak_xs_usage. (Ike Devolder) Files: src/if_perl.xs Patch 7.3.1199 Problem: When evaluating 'foldexpr' causes an error this is silently ignored and evaluation is retried every time. Solution: Set emsg_silent instead of emsg_off. Stop evaluating 'foldexpr' is it is causing errors. (Christian Brabandt) Files: src/fold.c Patch 7.3.1200 Problem: When calling setline() from Insert mode, using CTRL-R =, undo does not work properly. (Israel Chauca) Solution: Sync undo after evaluating the expression. (Christian Brabandt) Files: src/edit.c, src/testdir/test61.in, src/testdir/test61.ok Patch 7.3.1201 Problem: When a startup script creates a preview window, it probably becomes the current window. Solution: Make another window the current one. (Christian Brabandt) Files: src/main.c Patch 7.3.1202 (after 7.3.660) Problem: Tags are not found in case-folded tags file. (Darren cole, Issue 90) Solution: Take into account that when case folding was used for the tags file "!rm" sorts before the "!_TAG" header lines. Files: src/tag.c Patch 7.3.1203 Problem: Matches from matchadd() might be highlighted incorrectly when they are at a fixed position and inserting lines. (John Szakmeister) Solution: Redraw all lines below a change if there are highlighted matches. (idea by Christian Brabandt) Files: src/screen.c Patch 7.3.1204 Problem: Calling gettabwinvar() in 'tabline' cancels Visual mode. (Hirohito Higashi) Solution: Don't always use goto_tabpage_tp(). Files: src/window.c, src/proto/window.pro, src/eval.c, src/if_py_both.h Patch 7.3.1205 Problem: logtalk.dict is not removed on uninstall. Solution: Remove the file. (Kazunobu Kuriyama) Files: src/Makefile Patch 7.3.1206 Problem: Inconsistent function argument declarations. Solution: Use ANSI style. Files: src/if_py_both.h Patch 7.3.1207 Problem: New regexp engine: no match found on "#if FOO". (Lech Lorens) Solution: When adding a state gets skipped don't adjust the index. Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok Patch 7.3.1208 Problem: Compiler warnings on MS-Windows. Solution: Add type cast. Move variable declaration. (Mike Williams) Files: src/option.c, src/os_mswin.c Patch 7.3.1209 Problem: No completion for ":tabdo". Solution: Add tabdo to the list of modifiers. (Dominique Pelle) Files: src/ex_docmd.c Patch 7.3.1210 (after 7.3.1182) Problem: 'backupcopy' default on MS-Windows is wrong when 'encoding' equals the current codepage. Solution: Change the #else block. (Ken Takata) Files: src/os_win32.c Patch 7.3.1211 Problem: MS-Windows: When 'encoding' differs from the current codepage ":hardcopy" does not work properly. Solution: Use TextOutW() and SetDlgItemTextW(). (Ken Takata) Files: src/os_mswin.c, src/vim.rc Patch 7.3.1212 Problem: "make test" on MS-Windows does not report failure like Unix does. Solution: Make it work like on Unix. (Taro Muraoka) Files: src/testdir/Make_dos.mak Patch 7.3.1213 Problem: Can't build with small features and Python. Solution: Adjust #ifdefs. Files: src/eval.c, src/buffer.c, src/eval.c, src/window.c Patch 7.3.1214 Problem: Missing declaration for init_users() and realloc_post_list(). (Salman Halim) Solution: Add the declarations. Files: src/misc1.c, src/regexp_nfa.c Patch 7.3.1215 Problem: Compiler warning for function not defined. Solution: Add #ifdef. Files: src/misc1.c Patch 7.3.1216 Problem: Configure can't find Motif on Ubuntu. Solution: Search for libXm in /usr/lib/*-linux-gnu. Files: src/configure.in, src/auto/configure Patch 7.3.1217 Problem: New regexp engine: Can't handle \%[[ao]]. (Yukihiro Nakadaira) Solution: Support nested atoms inside \%[]. Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok Patch 7.3.1218 Problem: "make test" on MS-Windows does not clean all temporary files and gives some unnecessary message. Solution: Clean the right files. Create .failed files. (Ken Takata) Files: src/testdir/Make_dos.mak Patch 7.3.1219 Problem: No test for using []] inside \%[]. Solution: Add a test. Files: src/testdir/test64.in, src/testdir/test64.ok Patch 7.3.1220 Problem: MS-Windows: When using wide font italic and bold are not included. Solution: Support wide-bold, wide-italic and wide-bold-italic. (Ken Takata, Taro Muraoka) Files: src/gui.c, src/gui.h, src/gui_w48.c Patch 7.3.1221 Problem: When build flags change "make distclean" run into a configure error. Solution: When CFLAGS changes delete auto/config.cache. Also avoid adding duplicate text to flags. (Ken Takata) Files: src/Makefile, src/configure.in, src/auto/configure Patch 7.3.1222 Problem: Cannot execute some tests from the src directly. Solution: Add missing targets. Files: src/Makefile Patch 7.3.1223 Problem: Tests fail on MS-Windows. Solution: Avoid depending on OS version. Use DOS commands instead of Unix commands. (Taro Muraoka, Ken Takata) Files: src/testdir/test17.in, src/testdir/test50.in, src/testdir/test71.in, src/testdir/test77.in Patch 7.3.1224 Problem: Clang gives warnings on xxd. Solution: Change how to use part of a string. (Dominique Pelle) Also avoid warning for return not reached. Files: src/xxd/xxd.c, src/regexp_nfa.c Patch 7.3.1225 Problem: Compiler warnings when building with Motif. Solution: Change set_label() argument. (Kazunobu Kuriyama) Files: src/gui_motif.c Patch 7.3.1226 Problem: Python: duplicate code. Solution: Share code between OutputWrite() and OutputWritelines(). (ZyX) Files: src/if_py_both.h, src/testdir/test86.ok, src/testdir/test87.ok Patch 7.3.1227 Problem: Inconsistent string conversion. Solution: Use 'encoding' instead of utf-8. Use METH_O in place of METH_VARARGS where appropriate. (ZyX) Files: src/if_py_both.h, src/testdir/test86.ok, src/testdir/test87.ok Patch 7.3.1228 Problem: Python: various inconsistencies and problems. Solution: StringToLine now supports both bytes() and unicode() objects. Make function names consistent. Fix memory leak fixed in StringToLine. (ZyX) Files: src/if_py_both.h, src/if_python3.c, src/if_python.c Patch 7.3.1229 Problem: Python: not so easy to delete/restore translating. Solution: Make macros do translation of exception messages. (ZyX) Note: this breaks translations! Files: src/if_py_both.h, src/if_python3.c Patch 7.3.1230 Problem: Python: Exception messages are not clear. Solution: Make exception messages more verbose. (ZyX) Files: src/if_py_both.h, src/if_python3.c, src/if_python.c, src/testdir/test86.ok, src/testdir/test87.ok Patch 7.3.1231 Problem: Python: use of numbers not consistent. Solution: Add support for Number protocol. (ZyX) Files: src/if_py_both.h, src/if_python3.c, src/if_python.c, src/testdir/test86.ok, src/testdir/test87.ok Patch 7.3.1232 Problem: Python: inconsistencies in variable names. Solution: Rename variables. (ZyX) Files: src/eval.c, src/if_py_both.h Patch 7.3.1233 Problem: Various Python problems. Solution: Fix VimTryEnd. Crash with debug build and PYTHONDUMPREFS=1. Memory leaks in StringToLine(), BufferMark() and convert_dl. (ZyX) Files: src/if_py_both.h, src/testdir/test86.in, src/testdir/test86.ok, src/testdir/test87.in, src/testdir/test87.ok Patch 7.3.1234 (after 7.3.1229) Problem: Python: Strings are not marked for translation. Solution: Add N_() where appropriate. (ZyX) Files: src/if_py_both.h Patch 7.3.1235 Problem: In insert mode CTRL-] is not inserted, on the command-line it is. Solution: Don't insert CTRL-] on the command line. (Yukihiro Nakadaira) Files: src/ex_getln.c Patch 7.3.1236 Problem: Python: WindowSetattr() missing support for NUMBER_UNSIGNED. Solution: Add NUMBER_UNSIGNED, add more tests. Various fixes. (ZyX) Files: src/if_py_both.h, src/if_python3.c, src/if_python.c, src/testdir/pythonx/failing.py, src/testdir/pythonx/failing_import.py, src/testdir/test86.in, src/testdir/test86.ok, src/testdir/test87.in, src/testdir/test87.ok, src/testdir/pythonx/topmodule/__init__.py, src/testdir/pythonx/topmodule/submodule/__init__.py, src/testdir/pythonx/topmodule/submodule/subsubmodule/__init__.py, src/testdir/pythonx/topmodule/submodule/subsubmodule/subsubsubmodule.py Patch 7.3.1237 Problem: Python: non-import errors not handled correctly. Solution: Let non-ImportError exceptions pass the finder. (ZyX) Files: src/if_py_both.h, src/testdir/test86.ok, src/testdir/test87.ok Patch 7.3.1238 Problem: Crash in Python interface on 64 bit machines. Solution: Change argument type of PyString_AsStringAndSize. (Taro Muraoka, Jun Takimoto) Files: src/if_python.c Patch 7.3.1239 Problem: Can't build with Python and MSVC10. Solution: Move #if outside of macro. (Taro Muraoka) Files: src/if_py_both.h Patch 7.3.1240 Problem: Memory leak in findfile(). Solution: Free the memory. (Christian Brabandt) Files: src/eval.c Patch 7.3.1241 (after 7.3.1236) Problem: Some test files missing from the distribution. Solution: Update the list of files. Files: Filelist Patch 7.3.1242 Problem: No failure when trying to use a number as a string. Solution: Give an error when StringToLine() is called with an instance of the wrong type. (Jun Takimoto) Files: src/if_py_both.h Patch 7.3.1243 Problem: New regexp engine: back references in look-behind match don't work. (Lech Lorens) Solution: Copy the submatches before a recursive match. Also fix function prototypes. Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok Patch 7.3.1244 Problem: MS-Windows: confirm() dialog text may not fit. Solution: Use GetTextWidthEnc() instead of GetTextWidth(). (Yasuhiro Matsumoto) Files: src/gui_w32.c Patch 7.3.1245 Problem: MS-Windows: confirm() dialog text may still not fit. Solution: Use GetTextWidthEnc() instead of GetTextWidth() in two more places. (Yasuhiro Matsumoto) Files: src/gui_w32.c Patch 7.3.1246 Problem: When setting 'winfixheight' and resizing the window causes the window layout to be wrong. Solution: Add frame_check_height() and frame_check_width() (Yukihiro Nakadaira) Files: src/window.c Patch 7.3.1247 Problem: New regexp engine: '[ ]\@!\p\%([ ]\@!\p\)*:' does not always match. Solution: When there is a PIM add a duplicate state that starts at another position. Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok Patch 7.3.1248 Problem: Still have old hacking code for Input Method. Solution: Add 'imactivatefunc' and 'imstatusfunc' as a generic solution to Input Method activation. (Yukihiro Nakadaira) Files: runtime/doc/options.txt, src/fileio.c, src/mbyte.c, src/option.c, src/option.h, src/proto/fileio.pro Patch 7.3.1249 Problem: Modeline not recognized when using "Vim" instead of "vim". Solution: Also accept "Vim". Files: src/buffer.c Patch 7.3.1250 Problem: Python tests fail on MS-Windows. Solution: Change backslashes to slashes. (Taro Muraoka) Files: src/testdir/test86.in, src/testdir/test87.in Patch 7.3.1251 Problem: Test 61 messes up viminfo. Solution: Specify a separate viminfo file. Files: src/testdir/test61.in Patch 7.3.1252 Problem: Gvim does not find the toolbar bitmap files in ~/vimfiles/bitmaps if the corresponding menu command contains additional characters like the shortcut marker '&' or if you use a non-english locale. Solution: Use menu->en_dname or menu->dname. (Martin Gieseking) Files: src/gui_w32.c Patch 7.3.1253 (after 7.3.1200) Problem: Still undo problem after using CTRL-R = setline(). (Hirohito Higashi) Solution: Set the ins_need_undo flag. Files: src/edit.c Patch 7.3.1254 (after 7.3.1252) Problem: Can't build without the multi-lang feature. (John Marriott) Solution: Add #ifdef. Files: src/gui_w32.c Patch 7.3.1255 Problem: Clang warnings when building with Athena. Solution: Add type casts. (Dominique Pelle) Files: src/gui_at_fs.c Patch 7.3.1256 Problem: Can't build without eval or autocmd feature. Solution: Add #ifdefs. Files: src/mbyte.c, src/window.c Patch 7.3.1257 Problem: With GNU gettext() ":lang de_DE.utf8" does not always result in German messages. Solution: Clear the $LANGUAGE environment variable. Files: src/ex_cmds2.c Patch 7.3.1258 Problem: Using submatch() may crash Vim. (Ingo Karkat) Solution: Restore the number of subexpressions used. Files: src/regexp_nfa.c Patch 7.3.1259 Problem: No test for patch 7.3.1258 Solution: Add a test entry. Files: src/testdir/test64.in, src/testdir/test64.ok Patch 7.3.1260 Problem: User completion does not get the whole command line in the command line window. Solution: Pass on the whole command line. (Daniel Thau) Files: src/ex_getln.c, src/structs.h Patch 7.3.1261 (after patch 7.3.1179) Problem: A buffer-local language mapping from a keymap stops a global insert mode mapping from working. (Ron Aaron) Solution: Do not wait for more characters to be typed only when the mapping was defined with <nowait>. Files: runtime/doc/map.txt, src/eval.c, src/getchar.c, src/testdir/test75.in, src/testdir/test75.ok Patch 7.3.1262 Problem: Crash and compilation warnings with Cygwin. Solution: Check return value of XmbTextListToTextProperty(). Add type casts. Adjust #ifdefs. (Lech Lorens) Files: src/main.c, src/os_unix.c, src/ui.c Patch 7.3.1263 Problem: Typo in short option name. Solution: Change "imse" to "imsf". Files: src/option.c Patch 7.3.1264 (after 7.3.1261) Problem: Missing m_nowait. Solution: Include missing part of the patch. Files: src/structs.h Patch 7.3.1265 (after 7.3.1249) Problem: Accepting "Vim:" for a modeline causes errors too often. Solution: Require "Vim:" to be followed by "set". Files: src/buffer.c Patch 7.3.1266 Problem: QNX: GUI fails to start. Solution: Remove the QNX-specific #ifdef. (Sean Boudreau) Files: src/gui.c Patch 7.3.1267 Problem: MS-Windows ACL support doesn't work well. Solution: Implement more ACL support. (Ken Takata) Files: src/os_win32.c Patch 7.3.1268 Problem: ACL support doesn't work when compiled with MingW. Solution: Support ACL on MingW. (Ken Takata) Files: src/os_win32.c, src/os_win32.h Patch 7.3.1269 Problem: Insert completion keeps entry selected even though the list has changed. (Olivier Teuliere) Solution: Reset compl_shown_match and compl_curr_match. (Christian Brabandt) Files: src/edit.c Patch 7.3.1270 Problem: Using "Vp" in an empty buffer can't be undone. (Hauke Petersen) Solution: Save one line in an empty buffer. (Christian Brabandt) Files: src/ops.c Patch 7.3.1271 (after 7.3.1260) Problem: Command line completion does not work. Solution: Move setting xp_line down. (Daniel Thau) Files: src/ex_getln.c Patch 7.3.1272 Problem: Crash when editing Ruby file. (Aliaksandr Rahalevich) Solution: Reallocate the state list when necessary. Files: src/regexp_nfa.c Patch 7.3.1273 Problem: When copying a location list the index might be wrong. Solution: Set the index to one when using the first entry. (Lech Lorens) Files: src/quickfix.c Patch 7.3.1274 Problem: When selecting an entry from a location list it may pick an arbitrary window or open a new one. Solution: Prefer using a window related to the location list. (Lech Lorens) Files: src/quickfix.c Patch 7.3.1275 Problem: "gn" does not work when the match is a single character. Solution: Fix it, add a test. (Christian Brabandt) Files: src/search.c, src/testdir/test53.in, src/testdir/test53.ok Patch 7.3.1276 Problem: When using a cscope connection resizing the window may send SIGWINCH to cscope and it quits. Solution: Call setpgid(0, 0) in the child process. (Narendran Gopalakrishnan) Files: src/if_cscope.c Patch 7.3.1277 Problem: In diff mode 'cursorline' also draws in the non-active window. When 'nu' and 'sbr' are set the 'sbr' string is not underlined. Solution: Only draw the cursor line in the current window. Combine the 'cursorline' and other highlighting attributes. (Christian Brabandt) Files: src/screen.c Patch 7.3.1278 Problem: When someone sets the screen size to a huge value with "stty" Vim runs out of memory before reducing the size. Solution: Limit Rows and Columns in more places. Files: src/gui.c, src/gui_gtk_x11.c, src/option.c, src/os_unix.c, src/proto/term.pro, src/term.c Patch 7.3.1279 Problem: Compiler warning for variable uninitialized. (Tony Mechelynck) Solution: Add an init. Files: src/ex_getln.c Patch 7.3.1280 Problem: Reading memory already freed since patch 7.3.1247. (Simon Ruderich, Dominique Pelle) Solution: Copy submatches before reallocating the state list. Files: src/regexp_nfa.c Patch 7.3.1281 Problem: When 'ttymouse' is set to "xterm2" clicking in column 123 moves the cursor to column 96. (Kevin Goodsell) Solution: Decode KE_CSI. Files: src/term.c Patch 7.3.1282 (after 7.3.1277) Problem: 'cursorline' not drawn in any other window. (Charles Campbell) Solution: Do draw the cursor line in other windows. Files: src/screen.c Patch 7.3.1283 Problem: Test 71 fails on MS-Windows. Solution: Put the binary data in a separate file. (Ken Takata) Files: src/testdir/test71.in, src/testdir/test71a.in Patch 7.3.1284 Problem: Compiler warnings in MS-Windows clipboard handling. Solution: Add type casts. (Ken Takata) Files: src/winclip.c Patch 7.3.1285 Problem: No tests for picking a window when selecting an entry in a location list. Not picking the right window sometimes. Solution: Add test 96. Set usable_win appropriately. (Lech Lorens) Files: src/quickfix.c, src/testdir/Makefile, src/testdir/test96.in, src/testdir/test96.ok, src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak, src/testdir/Make_ming.mak, src/testdir/Make_os2.mak, src/testdir/Make_vms.mms Patch 7.3.1286 Problem: Check for screen size missing for Athena and Motif. Solution: Add call to limit_screen_size(). Files: src/gui_x11.c Patch 7.3.1287 Problem: Python SystemExit exception is not handled properly. Solution: Catch the exception and give an error. (Yasuhiro Matsumoto, Ken Takata) Files: runtime/doc/if_pyth.txt, src/if_py_both.h, src/if_python.c, src/if_python3.c Patch 7.3.1288 Problem: The first ":echo 'hello'" command output doesn't show. Mapping for <S-F3> gets triggered during startup. Solution: Add debugging code for the termresponse. When receiving the "Co" entry and when setting 'ambiwidth' redraw right away if possible. Add redraw_asap(). Don't set 'ambiwidth' if it already had the right value. Do the 'ambiwidth' check in the second row to avoid confusion with <S-F3>. Files: src/term.c, src/screen.c, src/proto/screen.pro Patch 7.3.1289 Problem: Get GLIB warning when removing a menu item. Solution: Reference menu-id and also call gtk_container_remove(). (Ivan Krasilnikov) Files: src/gui_gtk.c Patch 7.3.1290 (after 7.3.1253) Problem: CTRL-R = in Insert mode changes the start of the insert position. (Ingo Karkat) Solution: Only break undo, don't start a new insert. Files: src/edit.c Patch 7.3.1291 (after 7.3.1288) Problem: Compiler warnings for uninitialized variables. (Tony Mechelynck) Solution: Initialize the variables. Files: src/screen.c Patch 7.3.1292 Problem: Possibly using invalid pointer when searching for window. (Raichoo) Solution: Use "firstwin" instead of "tp_firstwin" for current tab. Files: src/window.c Patch 7.3.1293 Problem: Put in empty buffer cannot be undone. Solution: Save one more line for undo. (Ozaki) Files: src/ops.c Patch 7.3.1294 Problem: ":diffoff" resets options. Solution: Save and restore option values. (Christian Brabandt) Files: src/diff.c, src/structs.h, src/option.c Patch 7.3.1295 Problem: glob() and globpath() do not handle escaped special characters properly. Solution: Handle escaped characters differently. (Adnan Zafar) Files: src/testdir/Makefile, src/testdir/test97.in, src/testdir/test97.ok, src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak, src/testdir/Make_ming.mak, src/testdir/Make_os2.mak, src/testdir/Make_vms.mms, src/fileio.c, src/misc1.c Patch 7.3.1296 Problem: Only MS-Windows limits the GUI window size to what fits on the monitor. Solution: Limit the size for all systems. (Daniel Harding) Files: src/ui.c Patch 7.3.1297 Problem: findfile() directory matching does not work when a star follows text. (Markus Braun) Solution: Make a wildcard work properly. (Christian Brabandt) Files: src/misc2.c, src/testdir/test89.in, src/testdir/test89.ok Patch 7.3.1298 (after 7.3.1297) Problem: Crash. Solution: Use STRCPY() instead of STRCAT() and allocate one more byte. Files: src/misc2.c Patch 7.3.1299 Problem: Errors when doing "make proto". Didn't do "make depend" for a while. Solution: Add #ifdefs. Update dependencies. Update proto files. Files: src/if_python3.c, src/os_win32.c, src/Makefile, src/proto/ex_docmd.pro, src/proto/if_python.pro, src/proto/if_python3.pro, src/proto/gui_w16.pro, src/proto/gui_w32.pro, src/proto/os_win32.pro Patch 7.3.1300 Problem: Mac: tiny and small build fails. Solution: Don't include os_macosx.m in tiny build. Include mouse support in small build. (Kazunobu Kuriyama) Files: src/configure.in, src/auto/configure, src/vim.h Patch 7.3.1301 Problem: Some tests fail on MS-Windows. Solution: Fix path separators in test 89 and 96. Omit test 97, escaping works differently. Make findfile() work on MS-Windows. Files: src/testdir/Make_dos.mak, src/testdir/Make_ming.mak, src/testdir/Make_os2.mak, src/testdir/test89.in, src/testdir/test96.in, src/misc2.c Patch 7.3.1302 Problem: Test 17 fails on MS-Windows. Includes line break in file name everywhere. Solution: Fix 'fileformat'. Omit CR-LF from a line read from an included file. Files: src/search.c, src/testdir/test17.in, src/testdir/test17.ok Patch 7.3.1303 (after 7.3.1290) Problem: Undo is synced whenever CTRL-R = is called, breaking some plugins. Solution: Only break undo when calling setline() or append(). Files: src/globals.h, src/eval.c, src/edit.c, src/testdir/test61.in, src/testdir/test61.ok Patch 7.3.1304 Problem: Test 89 still fails on MS-Windows. Solution: Set 'shellslash'. (Taro Muraoka) Files: src/testdir/test89.in Patch 7.3.1305 Problem: Warnings from 64 bit compiler. Solution: Add type casts. Files: src/misc2.c Patch 7.3.1306 Problem: When redrawing the screen during startup the intro message may be cleared. Solution: Redisplay the intro message when appropriate. Files: src/screen.c, src/version.c, src/proto/version.pro Patch 7.3.1307 Problem: MS-Windows build instructions are outdated. Solution: Adjust for building on Windows 7. Drop Windows 95/98/ME support. Files: Makefile, nsis/gvim.nsi Patch 7.3.1308 Problem: Typos in MS-Windows build settings and README. Solution: Minor changes to MS-Windows files. Files: src/msvc2008.bat, src/msvc2010.bat, src/VisVim/README_VisVim.txt Patch 7.3.1309 Problem: When a script defines a function the flag to wait for the user to hit enter is reset. Solution: Restore the flag. (Yasuhiro Matsumoto) Except when the user was typing the function. Files: src/eval.c Patch 7.3.1310 Problem: Typos in nsis script. Can use better compression. Solution: Fix typos. Use lzma compression. (Ken Takata) Files: nsis/gvim.nsi Patch 7.3.1311 Problem: Compiler warnings on Cygwin. Solution: Add type casts. Add windows include files. (Ken Takata) Files: src/mbyte.c, src/ui.c Patch 7.3.1312 (after 7.3.1287) Problem: Not giving correct error messages for SystemExit(). Solution: Move E858 into an else. (Ken Takata) Files: src/if_py_both.h Patch 7.3.1313 Problem: :py and :py3 don't work when compiled with Cygwin or MingW with 64 bit. Solution: Add -DMS_WIN64 to the build command. (Ken Takata) Files: src/Make_cyg.mak, src/Make_ming.mak Patch 7.3.1314 Problem: Test 87 fails with Python 3.3. Solution: Filter the error messages. (Taro Muraoka) Files: src/testdir/test87.in Patch 7.4a.001 Problem: Script to update syntax menu is outdated. Solution: Add the missing items. Files: runtime/makemenu.vim Patch 7.4a.002 Problem: Valgrind errors in test 89. (Simon Ruderich) Solution: Allocate one more byte. (Dominique Pelle) Files: src/misc2.c Patch 7.4a.003 Problem: Copyright year is outdated. Solution: Only use the first year. Files: src/vim.rc, src/vim16.rc Patch 7.4a.004 Problem: MSVC 2012 Update 3 is not recognized. Solution: Add the version number. (Raymond Ko) Files: src/Make_mvc.mak Patch 7.4a.005 Problem: Scroll binding causes unexpected scroll. Solution: Store the topline after updating scroll binding. Add a test. (Lech Lorens) Files: src/testdir/test98.in, src/testdir/test98a.in, src/testdir/test98.ok, src/option.c, src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak, src/testdir/Make_ming.mak, src/testdir/Make_os2.mak, src/testdir/Make_vms.mms, src/testdir/Makefile Patch 7.4a.006 Problem: Failure in po file check goes unnoticed. Solution: Fail "make test" if the po file check fails. Files: src/Makefile Patch 7.4a.007 Problem: After "g$" with 'virtualedit' set, "k" moves to a different column. (Dimitar Dimitrov) Solution: Set w_curswant. (Christian Brabandt) Files: src/normal.c Patch 7.4a.008 Problem: Python 3 doesn't handle multibyte characters properly when 'encoding' is not utf-8. Solution: Use PyUnicode_Decode() instead of PyUnicode_FromString(). (Ken Takata) Files: src/if_python3.c Patch 7.4a.009 Problem: Compiler warnings for function prototypes. Solution: Add "void". Move list_features() prototype. (Ken Takata) Files: src/gui_w48.c, src/if_py_both.h, src/version.c Patch 7.4a.010 Problem: Test 86 and 87 fail when building with Python or Python 3 and using a static library. Solution: Add configure check to add -fPIE compiler flag. Files: src/configure.in, src/auto/configure Patch 7.4a.011 Problem: Configure check for Python 3 config name isn't right. Solution: Always include vi_cv_var_python3_version. (Tim Harder) Files: src/configure.in, src/auto/configure Patch 7.4a.012 Problem: "make test" fails when using a shadow directory. Solution: Create links for files in src/po. (James McCoy) Files: src/Makefile Patch 7.4a.013 Problem: Setting/resetting 'lbr' in the main help file changes alignment after a Tab. (Dimitar Dimitrov) Solution: Also use the code for conceal mode where n_extra is computed for 'lbr'. Files: src/screen.c, src/testdir/test88.in, src/testdir/test88.ok Patch 7.4a.014 Problem: Test 86 and 89 have a problem with using a shadow dir. Solution: Adjust for the different directory structure. (James McCoy) Files: src/testdir/test89.in, src/testdir/test86.in, src/Makefile Patch 7.4a.015 Problem: No Japanese man pages. Solution: Add Japanese translations of man pages. (Ken Takata, Yukihiro Nakadaira, et al.) Files: Filelist, src/Makefile, runtime/doc/evim-ja.UTF-8.1, runtime/doc/vim-ja.UTF-8.1, runtime/doc/vimdiff-ja.UTF-8.1, runtime/doc/vimtutor-ja.UTF-8.1, runtime/doc/xxd-ja.UTF-8.1 Patch 7.4a.016 (after 7.4a.014) Problem: Features enabled in Makefile. Solution: Undo accidental changes. Files: src/Makefile Patch 7.4a.017 Problem: When 'foldmethod' is "indent", using ">>" on a line just above a fold makes the cursor line folded. (Evan Laforge) Solution: Call foldOpenCursor(). (Christian Brabandt) Files: src/ops.c Patch 7.4a.018 Problem: Compiler warning for code unreachable. (Charles Campbell) Solution: Use "while" instead of endless loop. Change break to continue. Files: src/regexp_nfa.c, src/ui.c Patch 7.4a.019 Problem: Invalid closing parenthesis in test 62. Command truncated at double quote. Solution: Remove the parenthesis. Change double quote to ''. (ZyX) Files: src/testdir/test62.in, src/testdir/test62.ok Patch 7.4a.020 Problem: Superfluous mb_ptr_adv(). Solution: Remove the call. (Dominique Pelle) Files: src/regexp_nfa.c Patch 7.4a.021 Problem: Using feedkeys() doesn't always work. Solution: Omit feedkeys(). (Ken Takata) Files: src/testdir/test98a.in Patch 7.4a.022 Problem: Using "d2g$" does not delete the last character. (ZyX) Solution: Set the "inclusive" flag properly. Files: src/normal.c Patch 7.4a.023 (after 7.4a.019) Problem: Still another superfluous parenthesis. (ZyX) Solution: Remove it. Files: src/testdir/test62.in Patch 7.4a.024 Problem: X11 GUI: Checking icon height twice. Solution: Check height and width. (Dominique Pelle) Files: src/gui_x11.c Patch 7.4a.025 Problem: Get the press-Enter prompt even after using :redraw. Solution: Clear need_wait_return when executing :redraw. Files: src/ex_docmd.c Patch 7.4a.026 Problem: ":diffoff" does not remove folds. (Ramel) Solution: Do not restore 'foldenable' when 'foldmethod' is "manual". Files: src/diff.c Patch 7.4a.027 Problem: When Python adds lines to another buffer the cursor position is wrong, it might be below the last line causing ml_get errors. (Vlad Irnov) Solution: Temporarily change the current window, so that marks are corrected properly. Files: src/if_py_both.h, src/window.c, src/proto/buffer.pro Patch 7.4a.028 Problem: Crash when spell checking in new buffer. Solution: Set the b_p_key field. (Mike Williams) Files: src/spell.c, src/testdir/test58.in Patch 7.4a.029 Problem: Can't build with MzScheme on Ubuntu 13.04. Solution: Add configure check for the "ffi" library. Files: src/configure.in, src/auto/configure Patch 7.4a.030 (after 7.4.027) Problem: Missing find_win_for_buf(). (toothpik) Solution: Add missing changes. Files: src/buffer.c Patch 7.4a.031 Problem: Compiler warnings. (Charles Campbell) Solution: Initialize variables even when not needed. Files: src/regexp_nfa.c, src/search.c Patch 7.4a.032 Problem: New regexp engine: Does not match shorter alternative. (Ingo Karkat) Solution: Do not drop a new state when the PIM info is different. Files: src/regexp_nfa.c Patch 7.4a.033 Problem: Test 98 always passes. Solution: Include test98a.in in test98.in, execute the crucial command in one line. (Yukihiro Nakadaira) Files: src/testdir/test98.in, src/testdir/test98a.in Patch 7.4a.034 Problem: The tabline may flicker when opening a new tab after 7.3.759 on Win32. Solution: Move call to TabCtrl_SetCurSel(). (Ken Takata) Files: src/gui_w48.c Patch 7.4a.035 Problem: Fix in patch 7.4a.032 is not tested. Solution: Add test. Files: src/testdir/test64.in, src/testdir/test64.ok Patch 7.4a.036 Problem: "\p" in a regexp does not match double-width characters. (Yukihiro Nakadaira) Solution: Don't count display cells, use vim_isprintc(). Files: src/regexp.c, src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok, src/testdir/test95.in, src/testdir/test95.ok Patch 7.4a.037 Problem: Win32: When mouse is hidden and in the toolbar, moving it won't make it appear. (Sami Salonen) Solution: Add tabline_wndproc() and toolbar_wndproc(). (Ken Takata) Files: src/gui_w32.c, src/gui_w48.c Patch 7.4a.038 Problem: When using MSVC 2012 there are various issues, including GUI size computations. Solution: Use SM_CXPADDEDBORDER. (Mike Williams) Files: src/gui_w32.c, src/gui_w48.c, src/os_win32.h Patch 7.4a.039 Problem: New regexp engine doesn't match pattern. (Ingo Karkat) Solution: When adding a state also check for different PIM if the list of states has any state with a PIM. Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok Patch 7.4a.040 Problem: Win32: using uninitialized variable. Solution: (Yukihiro Nakadaira) Files: src/os_win32.c Patch 7.4a.041 Problem: When using ":new ++ff=unix" and "dos" is first in 'fileformats' then 'ff' is set to "dos" instead of "unix". (Ingo Karkat) Solution: Create set_file_options() and invoke it from do_ecmd(). Files: src/fileio.c, src/proto/fileio.pro, src/ex_cmds.c, src/testdir/test91.in, src/testdir/test91.ok Patch 7.4a.042 Problem: Crash when BufUnload autocommands close all buffers. (Andrew Pimlott) Solution: Set curwin->w_buffer to curbuf to avoid NULL. Files: src/window.c, src/testdir/test8.in, src/testdir/test8.ok Patch 7.4a.043 Problem: More ml_get errors when adding or deleting lines from Python. (Vlad Irnov) Solution: Switch to a window with the buffer when possible. Files: src/if_py_both.h Patch 7.4a.044 Problem: Test 96 sometimes fails. Solution: Clear window from b_wininfo in win_free(). (Suggestion by Yukihiro Nakadaira) Files: src/window.c Patch 7.4a.045 Problem: Configure does not always find the right library for Lua. Missing support for LuaJit. Solution: Improve the configure detection of Lua. (Hiroshi Shirosaki) Files: src/Makefile, src/configure.in, src/auto/configure Patch 7.4a.046 Problem: Can't build without mbyte feature. Solution: Add #ifdefs. Files: src/ex_cmds.c Patch 7.4a.047 Problem: Some comments are not so nice. Solution: Change the comments. Files: src/ex_docmd.c, src/message.c, src/ops.c, src/option.c Patch 7.4b.001 Problem: Win32: dialog may extend off-screen. Solution: Reduce the size, use correct borders. (Andrei Olsen) Files: src/gui_w32.c Patch 7.4b.002 Problem: Crash searching for \%(\%(\|\d\|-\|\.\)*\|\*\). (Marcin Szamotulski) Also for \(\)*. Solution: Do add a state for opening parenthesis, so that we can check if it was added before at the same position. Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok Patch 7.4b.003 Problem: Regexp code is not nicely aligned. Solution: Adjust white space. (Ken Takata) Files: src/regexp_nfa.c Patch 7.4b.004 Problem: Regexp crash on pattern "@\%[\w\-]*". (Axel Kielhorn) Solution: Add \%(\) around \%[] internally. Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok Patch 7.4b.005 Problem: Finding %s in shellpipe and shellredir does not ignore %%s. Solution: Skip over %%. (lcd 47) Files: src/ex_cmds.c Patch 7.4b.006 (after 7.3.1295) Problem: Using \{n,m} in an autocommand pattern no longer works. Specifically, mutt temp files are not recognized. (Gary Johnson) Solution: Make \\\{n,m\} work. Files: runtime/doc/autocmd.txt, src/fileio.c Patch 7.4b.007 Problem: On 32 bit MS-Windows :perldo does not work. Solution: Make sure time_t uses 32 bits. (Ken Takata) Files: src/if_perl.xs, src/vim.h Patch 7.4b.008 Problem: 'autochdir' causes setbufvar() to change the current directory. (Ben Fritz) Solution: When disabling autocommands also reset 'acd' temporarily. (Christian Brabandt) Files: src/fileio.c Patch 7.4b.009 Problem: When setting the Visual area manually and 'selection' is exclusive, a yank includes one character too much. (Ingo Karkat) Solution: Default the Visual operation to "v". (Christian Brabandt) Files: src/mark.c Patch 7.4b.010 Problem: Win32: Tcl library load does not use standard mechanism. Solution: Call vimLoadLib() instead of LoadLibraryEx(). (Ken Takata) Files: src/if_perl.xs, src/if_tcl.c Patch 7.4b.011 Problem: ":he \%(\)" does not work. (ZyX) Solution: Add an exception to the list. Files: src/ex_cmds.c Patch 7.4b.012 Problem: Output from a shell command is truncated at a NUL. (lcd 47) Solution: Change every NUL into an SOH. Files: src/misc1.c Patch 7.4b.013 Problem: Install dir for JP man pages is wrong. Solution: Remove ".UTF-8" from the directory name. (Ken Takata) Files: src/Makefile Patch 7.4b.014 (after 7.4b.012) Problem: Stupid mistake. Solution: Changle "len" to "i". Files: src/misc1.c Patch 7.4b.015 (after 7.4b.008) Problem: Can't compile without the 'acd' feature. Solution: Add #ifdefs. (Kazunobu Kuriyama) Files: src/fileio.c Patch 7.4b.016 Problem: Ruby detection fails on Fedora 19. Solution: Use one way to get the Ruby version. (Michael Henry) Files: src/configure.in, src/auto/configure Patch 7.4b.017 Problem: ":he \^x" gives a strange error message. (glts) Solution: Do not translate \^x to \_CTRL-x. Files: src/ex_cmds.c Patch 7.4b.018 (after 7.4b.001) Problem: Win32: Dialog can still be too big. Solution: Move the check for height further down. (Andrei Olsen) Files: src/gui_w32.c Patch 7.4b.019 (after 7.4a.034) Problem: Tabline is not updated properly when closing a tab on Win32. Solution: Only reduce flickering when adding a tab. (Ken Takata) Files: src/gui_w48.c Patch 7.4b.020 Problem: "g~ap" changes first character of next paragraph. (Manuel Ortega) Solution: Avoid subtracting (0 - 1) from todo. (Mike Williams) Files: src/ops.c, src/testdir/test82.in, src/testdir/test82.ok Patch 7.4b.021 Problem: Pressing "u" after an external command results in multiple press-enter messages. (glts) Solution: Don't call hit_return_msg() when we have K_IGNORE. (Christian Brabandt) Files: src/message.c Patch 7.4b.022 Problem: Not waiting for a character when the tick count overflows. Solution: Subtract the unsigned numbers and cast to int. (Ken Takata) Files: src/os_win32.c vim:tw=78:ts=8:ft=help:norl: ��������vim-7.4.1689/runtime/doc/vi_diff.txt����������������������������������������������������������������0000664�0000000�0000000�00000122314�12677030670�0017177�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*vi_diff.txt* For Vim version 7.4. Last change: 2016 Feb 12 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. Simulated command |simulated-command| 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| 7. POSIX compliance |posix-compliance| ============================================================================== 1. Simulated command *simulated-command* This command is in Vi, but Vim only simulates it: *:o* *:op* *:open* :[range]o[pen] Works like |:visual|: end Ex mode. {Vi: start editing in open mode} :[range]o[pen] /pattern/ As above, additionally move the cursor to the column where "pattern" matches in the cursor line. Vim does not support open mode, since it's not really useful. For those situations where ":open" would start open mode Vim will leave Ex mode, which allows executing the same commands, but updates the whole screen instead of only one line. ============================================================================== 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'* redraw boolean (default off) *'redraw'* slowopen (slow) boolean (default off) *'slowopen'* *'slow'* sourceany boolean (default off) *'sourceany'* 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 different highlighting types: over 30000 Range of a Number variable: -2147483648 to 2147483647 (might be more on 64 bit systems) Maximum length of a line in a tags file: 512 bytes. 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. These are not hard limits, but tell Vim when to move text into a swap file. 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. ============================================================================== 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 Vim starts with 'nocompatible' 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 Note that on some systems features need to be disabled to reduce resource usage, esp. on MS-DOS. For some outdated systems you need to use an older Vim version. 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 <!>. When undoing a few changes and then making a new change Vim will create a branch in the undo tree. This means you can go back to any state of the text, there is no risk of a change causing text to be lost forever. |undo-tree| 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. Vim can also use multiple tab pages, each with one or more windows. A line with tab labels can be used to quickly switch between these pages. |tab-page| 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. A convenient way to do this is using a |:colorscheme| command. The highlighted text can be exported as HTML. |convert-to-HTML| Other items that can be highlighted are matches with the search string |'hlsearch'|, matching parens |matchparen| and the cursor line and column |'cursorline'| |'cursorcolumn'|. Spell checking. |spell| When the 'spell' option is set Vim will highlight spelling mistakes. About 50 languages are currently supported, selected with the 'spelllang' option. In source code only comments and strings are checked for spelling. 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. Diff mode. |diff| Vim can show two versions of a file with the differences highlighted. Parts of the text that are equal are folded away. Commands can be used to move text from one version to the other. 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}. 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 Normal mode command. This is almost the same as hitting <Esc>, typing the command and doing |a|. Visual mode. |Visual-mode| Visual mode 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 area. It is shown highlighted on the screen. By typing "o" the other end of the Visual area can be moved. The Visual area 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 mode a rectangular block of text can be selected. Start Visual mode 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. 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 appears elsewhere. |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 |i_CTRL-X_CTRL-O| Omni completion: clever completion specifically for a file type etc. 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. Directory, remote and archive browsing. |netrw| Vim can browse the file system. Simply edit a directory. Move around in the list with the usual commands and press <Enter> to go to the directory or file under the cursor. This also works for remote files over ftp, http, ssh, etc. Zip and tar archives can also be browsed. |tar| |zip| Edit-compile-edit speedup. |quickfix| The |:make| command can be used to run the compilation and jump to the first error. A file with compiler error messages is interpreted. Vim jumps to 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. 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. Finding matches in files. |:vimgrep| Vim can search for a pattern in multiple files. This uses the advanced Vim regexp pattern, works on all systems and also works to search in compressed files. Improved indenting for 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. For many other languages an indent plugin is present to support automatic indenting. |30.3| Searching for words in included 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 to 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 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. |:for| Loop over a list. |:echo| Print the result of an expression. |:let| Assign a value to an internal variable, option, etc. Variable types are Number, String, List and Dictionary. |:execute| Execute a command formed by an expression. |:try| Catch exceptions. etc., etc. See |eval|. Debugging and profiling are supported. |debug-scripts| |profile| If this is not enough, an interface is provided to |Python|, |Ruby|, |Tcl|, |Lua|, |Perl| and |MzScheme|. 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. Printing. |printing| The |:hardcopy| command sends text to the printer. This can include syntax highlighting. Mouse support. |mouse-using| The mouse is supported in the GUI version, in an xterm for Unix, for BSDs with sysmouse, 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. Move cursor beyond lines. When the 'virtualedit' option is set the cursor can move all over the screen, also where there is no text. This is useful to edit tables and figures easily. ============================================================================== 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 %:S" 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 options 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 --windowid {id} Vim: Win32 window ID 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[N] Vim: Open [N] tab pages, 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. ============================================================================== 7. POSIX compliance *posix* *posix-compliance* In 2005 the POSIX test suite was run to check the compatibility of Vim. Most of the test was executed properly. There are the few things where Vim is not POSIX compliant, even when run in Vi compatibility mode. *$VIM_POSIX* Set the $VIM_POSIX environment variable to have 'cpoptions' include the POSIX flags when Vim starts up. This makes Vim run as POSIX as it can. That's a bit different from being Vi compatible. This is where Vim does not behave as POSIX specifies and why: *posix-screen-size* The $COLUMNS and $LINES environment variables are ignored by Vim if the size can be obtained from the terminal in a more reliable way. Add the '|' flag to 'cpoptions' to have $COLUMNS and $LINES overrule sizes obtained in another way. The "{" and "}" commands don't stop at a "{" in the original Vi, but POSIX specifies it does. Add the '{' flag to 'cpoptions' if you want it the POSIX way. The "D", "o" and "O" commands accept a count. Also when repeated. Add the '#' flag to 'cpoptions' if you want to ignore the count. The ":cd" command fails if the current buffer is modified when the '.' flag is present in 'cpoptions'. There is no ATTENTION message, the "A" flag is added to 'shortmess'. These are remarks about running the POSIX test suite: - vi test 33 sometimes fails for unknown reasons - vi test 250 fails; behavior will be changed in a new revision http://www.opengroup.org/austin/mailarchives/ag-review/msg01710.html (link no longer works, perhaps it's now: https://www.opengroup.org/sophocles/show_mail.tpl?CALLER=show_archive.tpl&source=L&listname=austin-review-l&id=1711) - vi test 310 fails; exit code non-zero when any error occurred? - ex test 24 fails because test is wrong. Changed between SUSv2 and SUSv3. - ex tests 47, 48, 49, 72, 73 fail because .exrc file isn't read in silent mode and $EXINIT isn't used. - ex tests 76, 78 fail because echo is used instead of printf. (fixed) Also: problem with \s not changed to space. - ex test 355 fails because 'window' isn't used for "30z". - ex test 368 fails because shell command isn't echoed in silent mode. - ex test 394 fails because "=" command output isn't visible in silent mode. - ex test 411 fails because test file is wrong, contains stray ':'. - ex test 475 and 476 fail because reprint output isn't visible in silent mode. - ex test 480 and 481 fail because the tags file has spaces instead of a tab. - ex test 502 fails because .exrc isn't read in silent mode. - ex test 509 fails because .exrc isn't read in silent mode. and exit code is 1 instead of 2. - ex test 534 fails because .exrc isn't read in silent mode. vim:tw=78:ts=8:ft=help:norl: ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/vim-de.1�������������������������������������������������������������������0000664�0000000�0000000�00000043013�12677030670�0016271�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" Translated by bw1 (2008) and Florian Rehnisch <fm-r@gmx.de> (2012) .\" Kudos to the folks on vim-dev and debian-l10n-german .TH VIM 1 "2006 Apr 11" .SH BEZEICHNUNG vim \- Vi IMproved, ein Text\-Editor fr Programmierer .SH BERSICHT .br \fBvim\fP [Optionen] [Datei ...] .br \fBvim\fP [Optionen] \- .br \fBvim\fP [Optionen] \-t Tag .br \fBvim\fP [Optionen] \-q [Fehlerdatei] .PP .br \fBex\fP .br \fBview\fP .br \fBgvim\fP \fBgview\fP \fBevim\fP \fBeview\fP .br \fBrvim\fP \fBrview\fP \fBrgvim\fP \fBrgview\fP .SH BESCHREIBUNG \fBVim\fP ist ein Text\-Editor, der aufwrtskompatibel zu Vi ist. Er kann verwendet werden, um alle Arten von Klartext zu bearbeiten. Er ist besonders ntzlich, um Programme zu bearbeiten. .PP Vim hat einige Erweiterungen gegenber Vi, z.B.: Rckgngigmachen in mehreren Schritten, mehrere Fenster und Puffer, Syntax\-Hervorhebung, Bearbeiten der Befehlszeile, Dateinamenergnzung, eingebaute Hilfe, visuelle Auswahl, usw. ... Siehe :help vi_diff.txt fr eine bersicht der Unterschiede zwischen \fBVim\fP und Vi. .PP Im laufenden \fBVim\fP kann mit dem Befehl :help viel Hilfe durch das eingebaute Hilfesystem erlangt werden. Siehe den Abschnitt EINGEBAUTE HILFE weiter unten. .PP Meistens wird \fBVim\fP zum Editieren einer einzigen Datei mit dem folgende Befehl gestartet: .PP vim Datei .PP Allgemeiner betrachtet, wird \fBVim\fP folgendermaen gestartet: .PP vim [Optionen] [Dateiliste] .PP Bei einer fehlenden Dateiliste startet der Editor mit einem leeren Puffer. Andernfalls werden nach den folgenden vier Mglichkeiten eine oder mehrere Dateien bearbeitet: .TP 12 Datei ... Eine Liste von Dateinamen. Die erste Datei wird in den Puffer geladen und zur aktuellen. Der Cursor wird auf der ersten Zeile des Puffers platziert. Zu den anderen Dateien kann mit dem Befehl :next gelangt werden. Falls einer der Dateinamen mit einem Bindestrich beginnt, stellen Sie der Dateiliste \-\- voran. .TP \- Die zu bearbeitende Datei wird von der Standardeingabe gelesen. Befehle werden von der Standardfehlerausgabe gelesen, die ein Text\-Terminal sein sollte. .TP \-t {Tag} Die zu editierende Datei und die anfngliche Cursor\-Position hngen von einem Tag ab, einer Art Sprungmarke. {Tag} wird in der Tag\-Datei nachgeschlagen, die zugehrige Datei wird zur aktuellen und der zugehrige Befehl wird ausgefhrt. Dies wird meistens fr Programme in der Sprache C benutzt, wobei {Tag} ein Funktionsname sein knnte. Die Wirkung dieses Befehls ist, dass die Datei, die die Funktion enthlt, als aktuelle im Editor geffnet und angezeigt wird und der Cursor auf dem Beginn der Funktion positioniert wird. Siehe :help tag\-commands. .TP \-q [Fehlerdatei] Startet im QuickFix\-Modus. Die Datei [Fehlerdatei] wird gelesen und der erste Fehler wird angezeigt. Falls [Fehlerdatei] ausgelassen wird, wird der Dateiname aus der Option 'errorfile' verwendet (bei AmigaOS ist dies vorgabemig AztecC.Err, sowie "errors.err bei anderen). Weitere Fehler knnen mit dem :cn\-Befehl angesprungen werden. Siehe ":help quickfix. .PP \fBVim\fP reagiert unterschiedlich auf den Namen, der verwendet wird, um Vim zu starten (die ausfhrbare Datei kann dieselbe sein). .TP 10 vim der normale Weg, alles ist standardmig .TP ex Startet im Ex\-Modus. Mit dem Befehl :vi gelangt man in den normalen Modus. Funktioniert auch mit dem Argument \-e. .TP view Startet im Nur\-Lesen\-Modus. Die Datei wird vor dem berschreiben geschtzt. Dasselbe wird mit dem Parameter \-R erreicht. .TP gvim gview Die grafische Version: ffnet ein neues Fenster. Dasselbe wird mit dem Parameter \-g erreicht. .TP evim eview Die grafische Version im einfachen Modus: ffnet ein neues Fenster. Dasselbe wird mit dem Parameter \-y erreicht. .TP rvim rview rgvim rgview Wie die obigen, aber mit Beschrnkungen: Es ist nicht mglich, Shell\-Befehle aufzurufen oder mit Unterbrechung in eine Shell zurckzuspringen. Dasselbe wird mit dem Parameter \-Z erreicht. .SH OPTIONEN Die Optionen knnen in beliebiger Reihenfolge vor oder nach den Dateinamen angegeben werden. Optionen ohne Parameter knnen hinter einem einzigen Bindestrich gruppiert werden. .TP 12 +[Nummer] In der ersten Datei wird der Cursor auf die Zeile [Nummer] gesetzt. Falls [Nummer] nicht angegeben wird, wird der Cursor in die letzte Zeile der Datei gesetzt. .TP +/{Suchmuster} In der ersten Datei wird der Cursor auf das erste Auftreten von {Suchmuster} gesetzt. Siehe :help search\-pattern. .TP +{Befehl} .TP \-c {Befehl} {Befehl} wird nach dem Lesen der ersten Datei ausgefhrt. Als {Befehl} wird ein Ex\-Befehl erwartet. Sind in {Befehl} Leerzeichen vorhanden, muss alles in Anfhrungszeichen gesetzt werden (hngt von der verwendeten Shell ab). Beispiel: vim "+set si" main.c .br Anmerkung: Sie knnen bis zu 10 +\- oder "\-c\-Befehle verwenden. .TP \-S {Datei} {Datei} wird nach dem Lesen der ersten Datei ausgefhrt. Dies entspricht \-c "source {Datei}". {Datei} darf nicht mit einem Bindestrich (\-) anfangen. Wenn kein Dateiname angegeben wird, wird Session.vim verwendet (Funktioniert nur, wenn \-S als letzter Parameter steht). .TP \-\-cmd {Befehl} Wie \-c, aber dieser Befehl wird vor allen VimRC\-Dateien ausgefhrt. Sie knnen unabhngig von den \-c\-Befehlen bis zu 10 dieser Befehle verwenden. .TP \-A Falls \fBVim\fP mit Untersttzung fr das Schreiben von rechts nach links und arabischer Tastaturbelegung compiliert wurde (ARABIC), startet dieser Parameter den Modus frs Arabische (:set arabic). Anderenfalls beendet sich \fBVim\fP mit einer Fehlermeldung. .TP b Binrer Modus: Es werden einige Variablen gesetzt, sodass es mglich ist, eine binre oder ausfhrbare Datei zu bearbeiten. .TP \-C Kompatibel: Setzt die Option 'compatible'. Das macht \fBVim\fP im Verhalten sehr hnlich zu Vi, selbst wenn eine VimRC\-Datei existiert. .TP \-d Startet im diff\-Modus. Es sollten zwei, drei oder vier Dateinamen als Parameter bergeben werden. \fBVim\fP ffnet sie alle und zeigt die Unterschiede an. Arbeitet wie vimdiff(1). .TP \-d {Gert} ffnet das {Gert}, um es als Terminal zu nutzen. Nur fr AmigaOS. Beispiel: "\-d con:20/30/600/150". .TP D Debug\-Modus: \fBVim\fP geht in den Debug\-Modus, wenn der erste Befehl in einem Skript ausgefhrt wird. .TP \-e Startet \fBVim\fP im Ex\-Modus, als wrde als ausfhrbare Datei ex aufgerufen. .TP \-E Startet \fBVim\fP im erweiterten Ex\-Modus, als wrde die ausfhrbare Datei als exim aufgerufen. .TP \-f Vordergrund: Bei der GUI\-Version erzeugt \fBVim\fP keinen neuen Prozess und lst sich nicht von der Shell, in der er aufgerufen wurde. Bei AmigaOS wird kein neues Fenster geffnet. Dieser Parameter wird benutzt, damit das aufrufende Programm auf das Beenden des Bearbeitungssitzung wartet (z.B.: mail). Bei AmigaOS funktionieren die Befehle :sh und ":! nicht. .TP \-\-nofork Vordergrund: Bei der GUI\-Version erzeugt \fBVim\fP keinen neuen Prozess und lst sich nicht von der Shell, in der er aufgerufen wurde. .TP \-F Wenn \fBVim\fP mit FKMAP\-Untersttzung fr das Schreiben von rechts nach links und Farsi\-Tastatur\-Belegung kompiliert wurde, startet Vim im Farsi\-Modus, d.h. die Optionen 'fkmap' und 'rightleft' werden gesetzt. Andernfalls bricht \fBVim\fP mit einer Fehlermeldung ab. .TP \-g Falls \fBVim\fP mit GUI\-Untersttzung kompiliert wurde, wird die GUI aktiviert. Falls keine GUI\-Untersttzung einkompiliert wurde, wird mit einer Fehlermeldung abgebrochen. .TP \-h Gibt eine kleine Hilfe fr die Befehlszeilenparameter aus. Danach beendet sich \fBVim.\fP .TP \-H Hebrisch\-Modus, falls \fBVim\fP mit RIGHTLEFT\-Untersttzung fr das Schreiben von rechts nach links und hebrischer Tastaturbelegung kompiliert wurde, werden die Optionen 'hkmap' und 'rightleft' gesetzt. Andernfalls beendet sich \fBVim\fP mit einer Fehlermeldung. .TP \-i {VimInfo} Wenn eine VimInfo\-Datei verwendet wird: Verwendet statt ~/.viminfo die angegebene Datei. Es ist auch mglich die Verwendung einer VimInfo\-Datei durch Angabe des Dateinamen NONE zu verhindern, .TP \-L dasselbe wie \-r .TP \-l Lisp\-Modus. Aktiviert die Optionen 'lisp' und 'showmatch'. .TP \-m Deaktiviert das Verndern von Dateien, indem die Option 'write' gelscht wird. Der Puffer kann verndert werden, nur das Schreiben einer Datei ist nicht mglich. .TP \-M Keine Vernderungen erlaubt: Die Optionen 'modifiable' und 'write' werden gelscht, so dass nderungen nicht erlaubt sind und Dateien nicht geschrieben werden knnen. Man beachte, dass diese Optionen ('modifiable', \&'write') dennnoch nachtrglich zum Erlauben von nderungen gesetzt werden knnen. .TP \-N Nicht\-kompatibler Modus: Lscht die Option 'compatible'. Dies veranlasst \fBVim\fP, sich ein wenig besser, aber weniger Vi\-kompatibel zu verhalten, selbst wenn es keine VimRC\-Datei gibt. .TP \-n Verwendet keine Auslagerungsdatei: Eine Wiederherstellung nach einem Absturz ist nicht mglich. Auf einem langsamen Medium (Diskette) kann diese Einstellung ntzlich sein. Kann auch mit set uc=0 erreicht werden; kann mit set uc=200 aufgehoben werden. .TP \-nb \fBVim\fP fungiert als Server fr NetBeans. Details siehe Dokumentation. .TP \-o[N] ffnet [N] Fenster bereinander. Wenn keine Zahl angegeben wird, ffne ein Fenster pro Datei. .TP \-O[N] ffnet [N] Fenster nebeneinander. Wenn keine Zahl angegeben wird, ffne ein Fenster pro Datei. .TP \-p[N] ffnet [N] Reiterseiten. Wenn keine Zahl angegeben wird, ffne eine Reiterseite pro Datei. .TP \-R Nur\-Lesen\-Modus: Die Option 'readonly' wird gesetzt. Der Puffer kann noch bearbeitet werden, aber es wird verhindert, eine Datei aus Versehen zu berschreiben. Wenn Sie wirklich eine Datei berschreiben wollen, fgen Sie dem Ex\-Befehl ein Ausrufezeichen hinzu (wie in :w!). Die Option "\-R bedingt die Option \-n (siehe oben). Die Option 'readonly' kann durch ":set noro gelscht werden. Siehe :help 'readonly'. .TP \-r Listet die Auslagerungsdateien und gibt Informationen zu ihrer Verwendbarkeit zur Wiederherstellung. .TP \-r {Datei} Wiederherstellungsmodus: Die Auslagerungsdatei wird zur Wiederherstellung verwendet und hat denselben Dateinamen wie die Text\-Datei + .swp. Siehe ":help recovery. .TP \-s Der stille Modus: Nur wenn die ausfhrbare Datei als ex aufgerufen wird oder vor \-s die Option "\-e gegeben wird. .TP \-s {Eingabeskript} Die Datei {Eingabeskript} wird gelesen und ausgefhrt, als wrden Sie die Zeichen in ihr tippen. Dasselbe kann mit dem Befehl :source! {Eingabeskript} erreicht werden. Wird das Ende der Datei vor dem Beenden des Editors erreicht, werden weitere Zeichen von der Tastatur gelesen. .TP \-T {Terminal} Setzt den Namen des benutzten Terminals. Nur erforderlich, wenn die Automatik nicht funktioniert. Sollte ein \fBVim\fP bekanntes Terminal sein: (builtin) oder in einer termcap\- oder terminfo\-Datei definiert. .TP \-u {VimRC} Verwendet zur Initialisierung die Befehle in der Datei {VimRC}. Alle anderen Initialisierungen werden bersprungen. Benutzen Sie dies, um eine besondere Art von Dateien zu bearbeiten. Dies kann auch benutzt werden, um alle Initialisierungen zu berspringen, indem der Name NONE angegeben wird. Fr weitere Einzelheiten siehe :help initialisation innerhalb von Vim. .TP \-U {GvimRC} Benutzt die Befehle in der Datei {GvimRC} fr die Initialisierung der grafischen Oberflche. Alle anderen Initialisierungen werden bersprungen. Dies kann ebenfalls benutzt werden, um alle GUI\-Initialisierungen zu berspringen, indem der Name NONE angegeben wird. Siehe :help gui\-init innerhalb von Vim fr weitere Einzelheiten. .TP \-V[N] Ausfhrlich (verbose): Gibt Meldungen darber, welche Befehlsdateien eingelesen werden, und ber das Lesen und Schreiben einer VimInfo\-Datei. Die optionale Zahl N ist der Wert fr 'verbose'. Vorgabe ist 10. .TP \-v Startet \fBVim\fP im Vi\-Modus, so als wrde die ausfhrbare Datei mit vi aufgerufen. Dies wirkt sich nur aus, wenn die ausfhrbare Datei als ex aufgerufen wird. .TP \-w {Ausgabeskript} Alle Zeichen, die eingetippt werden, werden in der Datei {Ausgabeskript} aufgezeichnet, solange bis Sie \fBVim\fP beenden. Dies ist ntzlich, falls Sie eine Skript\-Datei zum Benutzen mit vim \-s oder ":source! erzeugen wollen. Falls die Datei {Ausgabeskript} vorhanden ist, werden die Zeichen angehngt. .TP \-W {Ausgabeskript} Wie \-w, aber eine bereits vorhandene Datei wird berschrieben. .TP \-x Benutzt beim Schreiben von Dateien eine Verschlsselung. Fragt nach dem Schlssel. .TP \-X Fhrt keine Verbindung zum X\-Server durch. Dadurch verkrzt sich die Startzeit, aber der Fenstertitel und die Zwischenablage werden nicht verwendet. .TP \-y Startet \fBVim\fP im einfachen Modus, als wrde die ausfhrbare Datei mit evim oder eview aufgerufen. \fBVim\fP verhlt sich dann wie ein Editor zum Klicken und Tippen. .TP \-Z Eingeschrnkter Modus: Funktioniert, als wrde der Name der ausfhrbaren Datei mit r beginnen. .TP \-\- Markiert das Ende der Optionen. Argumente, die folgen, werden als Dateinamen behandelt. Dies kann benutzt werden, um einen Dateinamen mit \- am Anfang zu verwenden. .TP \-\-echo\-wid Nur GTK\-GUI: Schreibe die Fenster\-ID auf die Standardausgabe. .TP \-\-help Gibt eine Hilfe\-Nachricht aus und beendet, wie \-h. .TP \-\-literal Nimmt die Dateinamen so wie sie sind und vervollstndigt sie nicht nach Metazeichen (*,?). Dies wirkt sich nicht unter Unix aus, wo die Shell die Metazeichen expandiert. .TP \-\-noplugin Lade keine Plugins. Impliziert durch \-u NONE. .TP \-\-remote Verbindet mit einem Vim\-Server und lsst ihn die in den restlichen Argumenten angegeben Dateien editieren. Wenn kein Server gefunden wird, fhrt dies zu einer Warnmeldung und die Dateien werden im gegenwrtigen Vim zum Bearbeiten geffnet. .TP \-\-remote\-expr {Ausdruck} Verbindet mit einem Vim\-Server, fhrt {Ausdruck} aus und zeigt das Ergebnis auf der Standardausgabe an. .TP \-\-remote\-send {Zeichen} Verbindet mit einem Vim\-Server und sendet ihm {Zeichen}. .TP \-\-remote\-silent Wie \-\-remote, aber ohne Warnung, wenn kein Server gefunden wird. .TP \-\-remote\-wait Wie \-\-remote, aber Vim beendet sich nicht, bis die Dateien bearbeitet wurden. .TP \-\-remote\-wait\-silent Wie \-\-remote\-wait, aber ohne Warnung, wenn kein Server gefunden wird. .TP \-\-serverlist Listet die Namen aller gefundenen Vim\-Server auf. .TP \-\-servername {Name} Benutzt {Name} als Server\-Namen. Wird fr den gegenwrtigen Vim benutzt, auer es wird mit dem Argument \-\-remote benutzt, dann ist es der Name des zu kontaktierenden Servers. .TP \-\-socketid {id} Nur GTK\-GUI: Benutzt den GtkPlug\-Mechanismus, um GVim in einem anderen Fenster laufen zu lassen. .TP \-\-version Versionsinformation anzeigen und beenden .SH "EINGEBAUTE HILFE" Tippen Sie in \fBVim\fP :help, um zu beginnen. Geben Sie ":help begriff ein, um Hilfe ber ein bestimmtes Thema zu bekommen. Zum Beispiel :help ZZ fr Hilfe ber den Befehl ZZ. Benutzen Sie <Tab> und CTRL\-D, um Begriffe zu vervollstndigen (:help cmdline\-completion). Tags sind vorhanden, um von einem Ort zum anderen zu springen (eine Art Hypertext\-Verknpfungen, siehe :help). Auf diese Weise knnen alle Dokumentations\-Dateien aufgerufen werden, zum Beispiel :help syntax.txt. .SH DATEIEN .TP 15 /usr/local/lib/vim/doc/*.txt Dokumentations\-Dateien fr \fBVim\fP. Verwenden Sie :help doc\-file\-list, um die gesamte Liste zu bekommen. .TP /usr/local/lib/vim/doc/tags Die Tag\-Datei, die verwendet wird, um Informationen in der Dokumentation zu finden. .TP /usr/local/lib/vim/syntax/syntax.vim Die systemweite Einrichtung der Syntaxhervorhebung. .TP /usr/local/lib/vim/syntax/*.vim Syntaxdateien fr die verschiedenen Sprachen. .TP /usr/local/lib/vim/vimrc Systemweite Einstellungsdatei fr \fBVim\fP .TP ~/.vimrc Persnliche Einstellungsdatei fr \fBVim\fP .TP /usr/local/lib/vim/gvimrc Systemweite Einstellungsdatei fr GVim .TP ~/.gvimrc Persnliche Einstellungsdatei fr GVim .TP /usr/local/lib/vim/optwin.vim Das Script, das von dem Befehl :options verwendet wird, eine schne Mglichkeit, um Optionen zu betrachten und zu setzen. .TP /usr/local/lib/vim/menu.vim Systemweite Einstellungsdatei fr das Men von GVim .TP /usr/local/lib/vim/bugreport.vim Das Script zum Generieren eines Fehlerberichts. Siehe :help bugs. .TP /usr/local/lib/vim/filetype.vim Mit diesem Script erkennt Vim den Typ einer Datei anhand ihres Dateinamens. Siehe :help 'filetype'. .TP /usr/local/lib/vim/scripts.vim Mit diesem Script erkennt Vim den Typ einer Datei anhand ihres Inhaltes. Siehe :help 'filetype'. .TP /usr/local/lib/vim/print/*.ps Diese Dateien werden zum Drucken von PostScript verwendet. .PP Fr die neuesten Informationen lesen Sie die Vim\-Homepage: .br <URL:http://www.vim.org/> .SH "SIEHE AUCH" vimtutor(1) .SH AUTOR \fBVim\fP wurde grtenteils von Bram Moolenaar erstellt, mit viel Hilfe von anderen Leuten. Siehe :help credits in \fBVim.\fP .br \fBVim\fP basiert auf Stevie, der von Tim Thompson, Tony Andrews und G.R. (Fred) Walter geschrieben wurde. Es ist jedoch kaum etwas vom ursprnglichen Code brig geblieben. .SH FEHLER Die sind mglich. Siehe :help todo fr eine Liste bekannter Probleme. .PP Beachten Sie, dass gewisse Dinge, die manche Leute als Fehler betrachten mgen, in Wirklichkeit durch zu getreue Nachbildung des Vi\-Verhaltens verursacht werden. Und falls Sie denken, dass andere Dinge Fehler sind, weil Vi es anders tut, sollten Sie einen genaueren Blick auf die Datei vi_diff.txt werfen (oder in Vim :help vi_diff.txt tippen). Sehen Sie sich auch die Optionen 'compatible' und 'cpoptions' an. ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/vim-de.UTF-8.1�������������������������������������������������������������0000664�0000000�0000000�00000043537�12677030670�0017106�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" Translated by bw1 (2008) and Florian Rehnisch <fm-r@gmx.de> (2012) .\" Kudos to the folks on vim-dev and debian-l10n-german .TH VIM 1 "2006 Apr 11" .SH BEZEICHNUNG vim \- Vi IMproved, ein Text\-Editor für Programmierer .SH ÜBERSICHT .br \fBvim\fP [Optionen] [Datei …] .br \fBvim\fP [Optionen] \- .br \fBvim\fP [Optionen] \-t Tag .br \fBvim\fP [Optionen] \-q [Fehlerdatei] .PP .br \fBex\fP .br \fBview\fP .br \fBgvim\fP \fBgview\fP \fBevim\fP \fBeview\fP .br \fBrvim\fP \fBrview\fP \fBrgvim\fP \fBrgview\fP .SH BESCHREIBUNG \fBVim\fP ist ein Text\-Editor, der aufwärtskompatibel zu Vi ist. Er kann verwendet werden, um alle Arten von Klartext zu bearbeiten. Er ist besonders nützlich, um Programme zu bearbeiten. .PP Vim hat einige Erweiterungen gegenüber Vi, z.B.: Rückgängigmachen in mehreren Schritten, mehrere Fenster und Puffer, Syntax\-Hervorhebung, Bearbeiten der Befehlszeile, Dateinamenergänzung, eingebaute Hilfe, visuelle Auswahl, usw. … Siehe »:help vi_diff.txt« für eine Übersicht der Unterschiede zwischen \fBVim\fP und Vi. .PP Im laufenden \fBVim\fP kann mit dem Befehl »:help« viel Hilfe durch das eingebaute Hilfesystem erlangt werden. Siehe den Abschnitt EINGEBAUTE HILFE weiter unten. .PP Meistens wird \fBVim\fP zum Editieren einer einzigen Datei mit dem folgende Befehl gestartet: .PP vim Datei .PP Allgemeiner betrachtet, wird \fBVim\fP folgendermaßen gestartet: .PP vim [Optionen] [Dateiliste] .PP Bei einer fehlenden Dateiliste startet der Editor mit einem leeren Puffer. Andernfalls werden nach den folgenden vier Möglichkeiten eine oder mehrere Dateien bearbeitet: .TP 12 Datei … Eine Liste von Dateinamen. Die erste Datei wird in den Puffer geladen und zur aktuellen. Der Cursor wird auf der ersten Zeile des Puffers platziert. Zu den anderen Dateien kann mit dem Befehl »:next« gelangt werden. Falls einer der Dateinamen mit einem Bindestrich beginnt, stellen Sie der Dateiliste »\-\-« voran. .TP \- Die zu bearbeitende Datei wird von der Standardeingabe gelesen. Befehle werden von der Standardfehlerausgabe gelesen, die ein Text\-Terminal sein sollte. .TP \-t {Tag} Die zu editierende Datei und die anfängliche Cursor\-Position hängen von einem »Tag« ab, einer Art Sprungmarke. {Tag} wird in der Tag\-Datei nachgeschlagen, die zugehörige Datei wird zur aktuellen und der zugehörige Befehl wird ausgeführt. Dies wird meistens für Programme in der Sprache »C« benutzt, wobei {Tag} ein Funktionsname sein könnte. Die Wirkung dieses Befehls ist, dass die Datei, die die Funktion enthält, als aktuelle im Editor geöffnet und angezeigt wird und der Cursor auf dem Beginn der Funktion positioniert wird. Siehe »:help tag\-commands«. .TP \-q [Fehlerdatei] Startet im QuickFix\-Modus. Die Datei [Fehlerdatei] wird gelesen und der erste Fehler wird angezeigt. Falls [Fehlerdatei] ausgelassen wird, wird der Dateiname aus der Option 'errorfile' verwendet (bei AmigaOS ist dies vorgabemäßig »AztecC.Err«, sowie „errors.err« bei anderen). Weitere Fehler können mit dem »:cn«\-Befehl angesprungen werden. Siehe „:help quickfix«. .PP \fBVim\fP reagiert unterschiedlich auf den Namen, der verwendet wird, um Vim zu starten (die ausführbare Datei kann dieselbe sein). .TP 10 vim der »normale« Weg, alles ist standardmäßig .TP ex Startet im Ex\-Modus. Mit dem Befehl »:vi« gelangt man in den normalen Modus. Funktioniert auch mit dem Argument »\-e«. .TP view Startet im Nur\-Lesen\-Modus. Die Datei wird vor dem Überschreiben geschützt. Dasselbe wird mit dem Parameter »\-R« erreicht. .TP gvim gview Die grafische Version: Öffnet ein neues Fenster. Dasselbe wird mit dem Parameter »\-g« erreicht. .TP evim eview Die grafische Version im einfachen Modus: Öffnet ein neues Fenster. Dasselbe wird mit dem Parameter »\-y« erreicht. .TP rvim rview rgvim rgview Wie die obigen, aber mit Beschränkungen: Es ist nicht möglich, Shell\-Befehle aufzurufen oder mit Unterbrechung in eine Shell zurückzuspringen. Dasselbe wird mit dem Parameter »\-Z« erreicht. .SH OPTIONEN Die Optionen können in beliebiger Reihenfolge vor oder nach den Dateinamen angegeben werden. Optionen ohne Parameter können hinter einem einzigen Bindestrich gruppiert werden. .TP 12 +[Nummer] In der ersten Datei wird der Cursor auf die Zeile [Nummer] gesetzt. Falls [Nummer] nicht angegeben wird, wird der Cursor in die letzte Zeile der Datei gesetzt. .TP +/{Suchmuster} In der ersten Datei wird der Cursor auf das erste Auftreten von {Suchmuster} gesetzt. Siehe »:help search\-pattern«. .TP +{Befehl} .TP \-c {Befehl} {Befehl} wird nach dem Lesen der ersten Datei ausgeführt. Als {Befehl} wird ein Ex\-Befehl erwartet. Sind in {Befehl} Leerzeichen vorhanden, muss alles in Anführungszeichen gesetzt werden (hängt von der verwendeten Shell ab). Beispiel: vim "+set si" main.c .br Anmerkung: Sie können bis zu 10 »+«\- oder „\-c«\-Befehle verwenden. .TP \-S {Datei} {Datei} wird nach dem Lesen der ersten Datei ausgeführt. Dies entspricht »\-c "source {Datei}"«. {Datei} darf nicht mit einem Bindestrich (\-) anfangen. Wenn kein Dateiname angegeben wird, wird »Session.vim« verwendet (Funktioniert nur, wenn »\-S« als letzter Parameter steht). .TP \-\-cmd {Befehl} Wie »\-c«, aber dieser Befehl wird vor allen VimRC\-Dateien ausgeführt. Sie können unabhängig von den »\-c«\-Befehlen bis zu 10 dieser Befehle verwenden. .TP \-A Falls \fBVim\fP mit Unterstützung für das Schreiben von rechts nach links und arabischer Tastaturbelegung compiliert wurde (ARABIC), startet dieser Parameter den Modus fürs Arabische (:set arabic). Anderenfalls beendet sich \fBVim\fP mit einer Fehlermeldung. .TP b Binärer Modus: Es werden einige Variablen gesetzt, sodass es möglich ist, eine binäre oder ausführbare Datei zu bearbeiten. .TP \-C Kompatibel: Setzt die Option 'compatible'. Das macht \fBVim\fP im Verhalten sehr ähnlich zu Vi, selbst wenn eine VimRC\-Datei existiert. .TP \-d Startet im diff\-Modus. Es sollten zwei, drei oder vier Dateinamen als Parameter übergeben werden. \fBVim\fP öffnet sie alle und zeigt die Unterschiede an. Arbeitet wie vimdiff(1). .TP \-d {Gerät} Öffnet das {Gerät}, um es als Terminal zu nutzen. Nur für AmigaOS. Beispiel: "\-d con:20/30/600/150". .TP D Debug\-Modus: \fBVim\fP geht in den Debug\-Modus, wenn der erste Befehl in einem Skript ausgeführt wird. .TP \-e Startet \fBVim\fP im Ex\-Modus, als würde als ausführbare Datei »ex« aufgerufen. .TP \-E Startet \fBVim\fP im erweiterten Ex\-Modus, als würde die ausführbare Datei als »exim« aufgerufen. .TP \-f Vordergrund: Bei der GUI\-Version erzeugt \fBVim\fP keinen neuen Prozess und löst sich nicht von der Shell, in der er aufgerufen wurde. Bei AmigaOS wird kein neues Fenster geöffnet. Dieser Parameter wird benutzt, damit das aufrufende Programm auf das Beenden des Bearbeitungssitzung wartet (z.B.: mail). Bei AmigaOS funktionieren die Befehle »:sh« und „:!« nicht. .TP \-\-nofork Vordergrund: Bei der GUI\-Version erzeugt \fBVim\fP keinen neuen Prozess und löst sich nicht von der Shell, in der er aufgerufen wurde. .TP \-F Wenn \fBVim\fP mit FKMAP\-Unterstützung für das Schreiben von rechts nach links und Farsi\-Tastatur\-Belegung kompiliert wurde, startet Vim im Farsi\-Modus, d.h. die Optionen 'fkmap' und 'rightleft' werden gesetzt. Andernfalls bricht \fBVim\fP mit einer Fehlermeldung ab. .TP \-g Falls \fBVim\fP mit GUI\-Unterstützung kompiliert wurde, wird die GUI aktiviert. Falls keine GUI\-Unterstützung einkompiliert wurde, wird mit einer Fehlermeldung abgebrochen. .TP \-h Gibt eine kleine Hilfe für die Befehlszeilenparameter aus. Danach beendet sich \fBVim.\fP .TP \-H Hebräisch\-Modus, falls \fBVim\fP mit RIGHTLEFT\-Unterstützung für das Schreiben von rechts nach links und hebräischer Tastaturbelegung kompiliert wurde, werden die Optionen 'hkmap' und 'rightleft' gesetzt. Andernfalls beendet sich \fBVim\fP mit einer Fehlermeldung. .TP \-i {VimInfo} Wenn eine VimInfo\-Datei verwendet wird: Verwendet statt »~/.viminfo« die angegebene Datei. Es ist auch möglich die Verwendung einer VimInfo\-Datei durch Angabe des Dateinamen »NONE« zu verhindern, .TP \-L dasselbe wie »\-r« .TP \-l Lisp\-Modus. Aktiviert die Optionen 'lisp' und 'showmatch'. .TP \-m Deaktiviert das Verändern von Dateien, indem die Option 'write' gelöscht wird. Der Puffer kann verändert werden, nur das Schreiben einer Datei ist nicht möglich. .TP \-M Keine Veränderungen erlaubt: Die Optionen 'modifiable' und 'write' werden gelöscht, so dass Änderungen nicht erlaubt sind und Dateien nicht geschrieben werden können. Man beachte, dass diese Optionen ('modifiable', \&'write') dennnoch nachträglich zum Erlauben von Änderungen gesetzt werden können. .TP \-N Nicht\-kompatibler Modus: Löscht die Option 'compatible'. Dies veranlasst \fBVim\fP, sich ein wenig besser, aber weniger Vi\-kompatibel zu verhalten, selbst wenn es keine VimRC\-Datei gibt. .TP \-n Verwendet keine Auslagerungsdatei: Eine Wiederherstellung nach einem Absturz ist nicht möglich. Auf einem langsamen Medium (Diskette) kann diese Einstellung nützlich sein. Kann auch mit »set uc=0« erreicht werden; kann mit »set uc=200« aufgehoben werden. .TP \-nb \fBVim\fP fungiert als Server für NetBeans. Details siehe Dokumentation. .TP \-o[N] Öffnet [N] Fenster übereinander. Wenn keine Zahl angegeben wird, öffne ein Fenster pro Datei. .TP \-O[N] Öffnet [N] Fenster nebeneinander. Wenn keine Zahl angegeben wird, öffne ein Fenster pro Datei. .TP \-p[N] Öffnet [N] Reiterseiten. Wenn keine Zahl angegeben wird, öffne eine Reiterseite pro Datei. .TP \-R Nur\-Lesen\-Modus: Die Option 'readonly' wird gesetzt. Der Puffer kann noch bearbeitet werden, aber es wird verhindert, eine Datei aus Versehen zu überschreiben. Wenn Sie wirklich eine Datei überschreiben wollen, fügen Sie dem Ex\-Befehl ein Ausrufezeichen hinzu (wie in »:w!«). Die Option „\-R« bedingt die Option »\-n« (siehe oben). Die Option 'readonly' kann durch „:set noro« gelöscht werden. Siehe »:help 'readonly'«. .TP \-r Listet die Auslagerungsdateien und gibt Informationen zu ihrer Verwendbarkeit zur Wiederherstellung. .TP \-r {Datei} Wiederherstellungsmodus: Die Auslagerungsdatei wird zur Wiederherstellung verwendet und hat denselben Dateinamen wie die Text\-Datei + ».swp«. Siehe „:help recovery«. .TP \-s Der stille Modus: Nur wenn die ausführbare Datei als »ex« aufgerufen wird oder vor »\-s« die Option „\-e« gegeben wird. .TP \-s {Eingabeskript} Die Datei {Eingabeskript} wird gelesen und ausgeführt, als würden Sie die Zeichen in ihr tippen. Dasselbe kann mit dem Befehl »:source! {Eingabeskript}« erreicht werden. Wird das Ende der Datei vor dem Beenden des Editors erreicht, werden weitere Zeichen von der Tastatur gelesen. .TP \-T {Terminal} Setzt den Namen des benutzten Terminals. Nur erforderlich, wenn die Automatik nicht funktioniert. Sollte ein \fBVim\fP bekanntes Terminal sein: (builtin) oder in einer termcap\- oder terminfo\-Datei definiert. .TP \-u {VimRC} Verwendet zur Initialisierung die Befehle in der Datei {VimRC}. Alle anderen Initialisierungen werden übersprungen. Benutzen Sie dies, um eine besondere Art von Dateien zu bearbeiten. Dies kann auch benutzt werden, um alle Initialisierungen zu überspringen, indem der Name »NONE« angegeben wird. Für weitere Einzelheiten siehe »:help initialisation« innerhalb von Vim. .TP \-U {GvimRC} Benutzt die Befehle in der Datei {GvimRC} für die Initialisierung der grafischen Oberfläche. Alle anderen Initialisierungen werden übersprungen. Dies kann ebenfalls benutzt werden, um alle GUI\-Initialisierungen zu überspringen, indem der Name »NONE« angegeben wird. Siehe »:help gui\-init« innerhalb von Vim für weitere Einzelheiten. .TP \-V[N] Ausführlich (verbose): Gibt Meldungen darüber, welche Befehlsdateien eingelesen werden, und über das Lesen und Schreiben einer VimInfo\-Datei. Die optionale Zahl N ist der Wert für 'verbose'. Vorgabe ist 10. .TP \-v Startet \fBVim\fP im Vi\-Modus, so als würde die ausführbare Datei mit »vi« aufgerufen. Dies wirkt sich nur aus, wenn die ausführbare Datei als »ex« aufgerufen wird. .TP \-w {Ausgabeskript} Alle Zeichen, die eingetippt werden, werden in der Datei {Ausgabeskript} aufgezeichnet, solange bis Sie \fBVim\fP beenden. Dies ist nützlich, falls Sie eine Skript\-Datei zum Benutzen mit »vim \-s« oder „:source!« erzeugen wollen. Falls die Datei {Ausgabeskript} vorhanden ist, werden die Zeichen angehängt. .TP \-W {Ausgabeskript} Wie \-w, aber eine bereits vorhandene Datei wird überschrieben. .TP \-x Benutzt beim Schreiben von Dateien eine Verschlüsselung. Fragt nach dem Schlüssel. .TP \-X Führt keine Verbindung zum X\-Server durch. Dadurch verkürzt sich die Startzeit, aber der Fenstertitel und die Zwischenablage werden nicht verwendet. .TP \-y Startet \fBVim\fP im einfachen Modus, als würde die ausführbare Datei mit »evim« oder »eview« aufgerufen. \fBVim\fP verhält sich dann wie ein Editor zum Klicken und Tippen. .TP \-Z Eingeschränkter Modus: Funktioniert, als würde der Name der ausführbaren Datei mit »r« beginnen. .TP \-\- Markiert das Ende der Optionen. Argumente, die folgen, werden als Dateinamen behandelt. Dies kann benutzt werden, um einen Dateinamen mit »\-« am Anfang zu verwenden. .TP \-\-echo\-wid Nur GTK\-GUI: Schreibe die Fenster\-ID auf die Standardausgabe. .TP \-\-help Gibt eine Hilfe\-Nachricht aus und beendet, wie »\-h«. .TP \-\-literal Nimmt die Dateinamen so wie sie sind und vervollständigt sie nicht nach Metazeichen (*,?). Dies wirkt sich nicht unter Unix aus, wo die Shell die Metazeichen expandiert. .TP \-\-noplugin Lade keine Plugins. Impliziert durch »\-u NONE«. .TP \-\-remote Verbindet mit einem Vim\-Server und lässt ihn die in den restlichen Argumenten angegeben Dateien editieren. Wenn kein Server gefunden wird, führt dies zu einer Warnmeldung und die Dateien werden im gegenwärtigen Vim zum Bearbeiten geöffnet. .TP \-\-remote\-expr {Ausdruck} Verbindet mit einem Vim\-Server, führt {Ausdruck} aus und zeigt das Ergebnis auf der Standardausgabe an. .TP \-\-remote\-send {Zeichen} Verbindet mit einem Vim\-Server und sendet ihm {Zeichen}. .TP \-\-remote\-silent Wie »\-\-remote«, aber ohne Warnung, wenn kein Server gefunden wird. .TP \-\-remote\-wait Wie »\-\-remote«, aber Vim beendet sich nicht, bis die Dateien bearbeitet wurden. .TP \-\-remote\-wait\-silent Wie »\-\-remote\-wait«, aber ohne Warnung, wenn kein Server gefunden wird. .TP \-\-serverlist Listet die Namen aller gefundenen Vim\-Server auf. .TP \-\-servername {Name} Benutzt {Name} als Server\-Namen. Wird für den gegenwärtigen Vim benutzt, außer es wird mit dem Argument »\-\-remote« benutzt, dann ist es der Name des zu kontaktierenden Servers. .TP \-\-socketid {id} Nur GTK\-GUI: Benutzt den GtkPlug\-Mechanismus, um GVim in einem anderen Fenster laufen zu lassen. .TP \-\-version Versionsinformation anzeigen und beenden .SH "EINGEBAUTE HILFE" Tippen Sie in \fBVim\fP »:help«, um zu beginnen. Geben Sie „:help begriff« ein, um Hilfe über ein bestimmtes Thema zu bekommen. Zum Beispiel »:help ZZ« für Hilfe über den Befehl »ZZ«. Benutzen Sie <Tab> und CTRL\-D, um Begriffe zu vervollständigen (»:help cmdline\-completion«). Tags sind vorhanden, um von einem Ort zum anderen zu springen (eine Art Hypertext\-Verknüpfungen, siehe »:help«). Auf diese Weise können alle Dokumentations\-Dateien aufgerufen werden, zum Beispiel »:help syntax.txt«. .SH DATEIEN .TP 15 /usr/local/lib/vim/doc/*.txt Dokumentations\-Dateien für \fBVim\fP. Verwenden Sie »:help doc\-file\-list«, um die gesamte Liste zu bekommen. .TP /usr/local/lib/vim/doc/tags Die »Tag«\-Datei, die verwendet wird, um Informationen in der Dokumentation zu finden. .TP /usr/local/lib/vim/syntax/syntax.vim Die systemweite Einrichtung der Syntaxhervorhebung. .TP /usr/local/lib/vim/syntax/*.vim Syntaxdateien für die verschiedenen Sprachen. .TP /usr/local/lib/vim/vimrc Systemweite Einstellungsdatei für \fBVim\fP .TP ~/.vimrc Persönliche Einstellungsdatei für \fBVim\fP .TP /usr/local/lib/vim/gvimrc Systemweite Einstellungsdatei für GVim .TP ~/.gvimrc Persönliche Einstellungsdatei für GVim .TP /usr/local/lib/vim/optwin.vim Das Script, das von dem Befehl »:options« verwendet wird, eine schöne Möglichkeit, um Optionen zu betrachten und zu setzen. .TP /usr/local/lib/vim/menu.vim Systemweite Einstellungsdatei für das Menü von GVim .TP /usr/local/lib/vim/bugreport.vim Das Script zum Generieren eines Fehlerberichts. Siehe »:help bugs«. .TP /usr/local/lib/vim/filetype.vim Mit diesem Script erkennt Vim den Typ einer Datei anhand ihres Dateinamens. Siehe »:help 'filetype'«. .TP /usr/local/lib/vim/scripts.vim Mit diesem Script erkennt Vim den Typ einer Datei anhand ihres Inhaltes. Siehe »:help 'filetype'«. .TP /usr/local/lib/vim/print/*.ps Diese Dateien werden zum Drucken von PostScript verwendet. .PP Für die neuesten Informationen lesen Sie die Vim\-Homepage: .br <URL:http://www.vim.org/> .SH "SIEHE AUCH" vimtutor(1) .SH AUTOR \fBVim\fP wurde größtenteils von Bram Moolenaar erstellt, mit viel Hilfe von anderen Leuten. Siehe »:help credits« in \fBVim.\fP .br \fBVim\fP basiert auf Stevie, der von Tim Thompson, Tony Andrews und G.R. (Fred) Walter geschrieben wurde. Es ist jedoch kaum etwas vom ursprünglichen Code übrig geblieben. .SH FEHLER Die sind möglich. Siehe »:help todo« für eine Liste bekannter Probleme. .PP Beachten Sie, dass gewisse Dinge, die manche Leute als Fehler betrachten mögen, in Wirklichkeit durch zu getreue Nachbildung des Vi\-Verhaltens verursacht werden. Und falls Sie denken, dass andere Dinge Fehler sind, »weil Vi es anders tut«, sollten Sie einen genaueren Blick auf die Datei vi_diff.txt werfen (oder in Vim »:help vi_diff.txt« tippen). Sehen Sie sich auch die Optionen 'compatible' und 'cpoptions' an. �����������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/vim-fr.1�������������������������������������������������������������������0000664�0000000�0000000�00000042705�12677030670�0016317�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" Traduction lundi 7 aot 2000 par Richard Hitier .\" (richard.hitier@dial.oleane.com) .\" Mise jour de la traduction par David Blanchet .\" (david.blanchet@free.fr) 2006-06-10 .\" Mise jour de la traduction par Dominique Pell .\" (dominique.pelle@gmail.com) 2013-05-10 .\" .TH VIM 1 "22 fvrier 2002" .SH NOM vim \- Vi IMproved, diteur de texte pour programmeurs .SH SYNOPSIS .br .B vim [options] [fichier ...] .br .B vim [options] \- .br .B vim [options] \-t marqueur .br .B vim [options] \-q [fichiererreurs] .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 est un diteur de texte proposant une compatibilit ascendante avec Vi. Il permet d'diter n'importe quel type de texte brut. Il est particulirement adapt pour l'dition des programmes. .PP Il comporte de nombreuses amliorations par rapport Vi : annulation sur plusieurs niveaux, fentres et tampons multiples, coloration syntaxique, dition en ligne de commande, compltement des noms de fichiers, aide en ligne, slection visuelle, etc. Voir ":help vi_diff.txt" pour un rsum des diffrences entre .B Vim et Vi. .PP Pendant l'excution de .B Vim \, une aide abondante est accessible au travers du systme d'aide en ligne, grce la commande ":help". Voir la section AIDE EN LIGNE plus bas. .PP Le plus souvent .B Vim est dmarr pour diter un unique fichier avec la commande .PP vim fichier .PP Plus gnralement, .B Vim est lanc avec : .PP vim [options] [listefichiers] .PP Si la listefichiers est omise, l'diteur dmarre avec un tampon vide. Autrement, l'une des quatre mthodes suivantes vous permettra de choisir un ou plusieurs fichiers diter. .TP 12 fichier ... Une liste de noms de fichiers. Le premier sera le fichier courant et sera lu dans le tampon. Le curseur sera plac sur la premire ligne du tampon. Vous pouvez passer aux autres fichiers avec la commande ":next". Pour diter un fichier dbutant par un tiret, faites prcder la liste de fichiers par "\-\-". .TP \- Le fichier diter est lu sur l'entre standard (stdin). Les commandes sont lues depuis stderr, qui devrait tre un terminal. .TP \-t {marqueur} Le fichier diter et la position initiale du curseur dpendent d'un "marqueur", qui est une sorte d'tiquette. {marqueur} est recherch dans le fichier des marqueurs, le fichier correspondant devient le fichier courant et la commande associe est excute. Principalement utile pour les programmes en C ; dans ce cas, {marqueur} peut tre le nom d'une fonction. Au final, le fichier contenant cette fonction devient le fichier courant et le curseur est plac au dbut de la fonction. Voir ":help tag\-commands". .TP \-q [fichiererreurs] Dmarre en mode Mise-au-point (QuickFix). Le fichier [fichiererreurs] est lu et la premire erreur est affiche. Si [fichiererreurs] est omis, le nom du fichier est lu dans l'option 'errorfile' ("AztecC.Err" par dfaut sur Amiga, "errors.err" sur les autres systmes). La commande ":cn" permet de sauter aux erreurs suivantes. Voir ":help quickfix". .PP .B Vim se comporte diffremment selon le nom de la commande (l'excutable peut cependant tre le mme fichier). .TP 10 vim La faon "normale", le comportement par dfaut. .TP ex Dmarre en mode Ex. La commande ":vi" permet de passer en mode Normal. Ce mode est galement accessible avec l'argument "\-e". .TP view Dmarre en mode Lecture-Seule. Vous tes protg de l'criture accidentelle des fichiers. Ce mode est galement accessible avec l'argument "\-R". .TP gvim gview La version graphique. Ouvre une nouvelle fentre. galement accessible avec l'argument "\-g". .TP evim eview La version graphique en mode Dbutant (easy). Ouvre une nouvelle fentre. galement accessible avec l'argument "\-y". .TP rvim rview rgvim rgview Comme ci-dessus, mais avec des restrictions. Il vous sera impossible de lancer des commandes du shell, ou de suspendre .B Vim. galement accessible avec l'argument "\-Z". .SH OPTIONS Les options peuvent tre spcifies dans n'importe quel ordre, avant ou aprs les noms de fichiers. Les options sans arguments peuvent tre combines aprs un unique tiret. .TP 12 +[num] Place le curseur sur la ligne "num" dans le premier fichier. Si "num" est omis, le curseur sera plac sur la dernire ligne. .TP +/{motif} Place le curseur sur la premire occurrence de {motif} dans le premier fichier. Voir ":help search\-pattern" pour connatre les motifs de recherches disponibles. .TP +{commande} .TP \-c {commande} Excute {commande} aprs la lecture du premier fichier. {commande} est interprte comme une commande Ex. Si la {commande} contient des espaces, elle doit tre entoure de doubles-apostrophes (cela dpend du shell utilis). Exemple : Vim "+set si" main.c .br Note : vous pouvez utiliser jusqu' 10 commandes "+" ou "\-c". .TP \-S {fichier} Source {fichier} aprs la lecture du premier fichier. C'est quivalent \-c "source {fichier}". {fichier} ne peut pas dbuter par un '\-'. Si {fichier} est omis, "Session.vim" est utilis (cela ne fonctionne que si \-S est le dernier argument). .TP \-\-cmd {commande} Comme "\-c", mais la commande est excute juste avant de traiter les fichiers vimrc. Vous pouvez utiliser jusqu' 10 de ces commandes, indpendamment des commandes "\-c". .TP \-A Si .B Vim a t compil avec le support de la fonctionnalit ARABIC pour l'dition de fichiers de droite gauche et les claviers arabes, cette option lance .B Vim en mode Arabe, c.--d. que l'option 'arabic' est active. Sinon, un message d'erreur est mis et .B Vim quitte. .TP \-b Mode Binaire. Active plusieurs options pour permettre l'dition d'un fichier binaire ou excutable. .TP \-C Compatible. Active l'option 'compatible'. .B Vim se comportera alors quasiment comme Vi, mme s'il existe un fichier .vimrc. .TP \-d Dmarre en mode Diff. Deux, trois ou quatre noms de fichiers doivent tre spcifis. .B Vim ouvrira alors tous les fichiers et affichera leurs diffrences. Fonctionne comme vimdiff(1). .TP \-d {priph} Ouvre {priph} pour l'utiliser comme terminal. Uniquement sur Amiga. Exemple : "\-d con:20/30/600/150". .TP \-D Debogage. Passe en mode Dbogage lors de l'excution de la premire commande d'un script. .TP \-e Dmarre .B Vim en mode Ex, comme si l'excutable s'appelait "ex". .TP \-E Dmarre .B Vim en mode Ex amlior, comme si l'excutable "exim" avait t invoqu. .TP \-f Premier-plan (Foreground). Pour la version graphique, .B Vim ne forke pas et ne se dtache pas du shell dans lequel il a t invoqu. Sur Amiga, .B Vim n'est pas relanc pour ouvrir une nouvelle fentre. Cette option est utile quand .B Vim est excut par un programme qui attend la fin de la session d'dition (par exemple mail). Sur Amiga, les commandes ":sh" et ":!" ne fonctionneront pas. .TP \-\-nofork Premier-plan (Foreground). Pour la version graphique, .B Vim ne forkera pas et ne se dtachera pas du shell dans lequel il a t lanc. .TP \-F Si .B Vim a t compil avec le support de la fonctionnalit FKMAP pour l'dition de fichiers de droite gauche et les claviers farsi, cette option lance .B Vim en mode Farsi, c.--d. avec les options 'fkmap' et 'rightleft' actives. Sinon, un message d'erreur est mis et .B Vim quitte. .TP \-g Si .B Vim a t compil avec le support de l'IHM graphique, cette option active l'IHM graphique. Si le support n'a pas t compil, un message d'erreur est mis et .B Vim quitte. .TP \-h Donne une aide succincte sur les arguments et les options de la ligne de commande. Aprs cela, .B Vim quitte. .TP \-H Si .B Vim a t compil avec le support de la fonctionnalit RIGHTLEFT pour l'dition de fichiers de droite gauche et les claviers hbreux, cette option lance .B Vim en mode Hbreu, c.--d. avec les options 'hkmap' et 'rightleft' actives. Sinon, un message d'erreur est mis et .B Vim quitte. .TP \-i {viminfo} Lorsque l'utilisation d'un fichier viminfo est active, cette option indique le nom de fichier utiliser la place de "~/.viminfo" par dfaut. Il est possible d'empcher l'utilisation d'un fichier ".viminfo", en spcifiant le nom de fichier "NONE". .TP \-L Comme \-r. .TP \-l Mode Lisp. Active les options 'lisp' et 'showmatch'. .TP \-m Empche la modification des fichiers. Dsactive l'option 'write'. Vous pouvez toujours modifier le tampon, mais il vous sera impossible d'crire le fichier. .TP \-M N'autorise aucune modification. les options 'modifiable' et 'write' sont dsactives, de sorte que les changements ne sont pas autoriss et que les fichiers ne peuvent pas tre crits. Note : ces options peuvent tre actives pour autoriser les modifications. .TP \-N Mode Non-compatible. Dsactive l'option 'compatible'. Cela amliorera le comportement de .B Vim \, mais il sera moins conforme celui de Vi, mme s'il n'existe aucun fichier ".vimrc". .TP \-n N'utilise pas de fichier d'change (swapfile). Le recouvrement aprs un plantage sera impossible. Utile pour diter un fichier sur un support trs lent (disquette par ex.). galement activable avec ":set uc=0". Il est possible de l'annuler avec ":set uc=200". .TP \-nb Devient un serveur d'dition pour NetBeans. Consulter la documentation ce sujet pour davantage de dtails. .TP \-o[N] Ouvre N fentres les unes au-dessus des autres. Quand N est omis, ouvre une fentre pour chaque fichier. .TP \-O[N] Ouvre N fentres cte cte. Quand N est omis, ouvre une fentre pour chaque fichier fichier. .TP \-p[N] Ouvre N onglets. Quand N est omis, ouvre un onglet pour chaque fichier fichier. .TP \-R Mode Lecture-Seule. Active l'option 'readonly'. Vous pouvez toujours diter le tampon, mais il vous sera impossible de d'craser accidentellement un fichier. Si vous voulez craser un fichier, ajoutez un point d'exclamation la commande Ex, comme dans ":w!". L'option \-R impose l'option \-n (voir ci-dessus). L'option 'readonly' peut tre dsactive avec ":set noro". Voir ":help 'readonly'". .TP \-r Donne la liste des fichiers d'change, avec des informations pour les utiliser des fins de recouvrement. .TP \-r {file} Mode Recouvrement. Utilise le fichier d'change pour rcouvrer d'une session d'dition plante. Le fichier d'change est un fichier avec le mme nom que le fichier texte, suivi du suffixe ".swp". Voir ":help recovery". .TP \-s Mode Silencieux. Disponible uniquement quand .B Vim est lanc en tant que "ex" ou quand l'option "\-e" a t spcifie avant l'option "\-s". .TP \-s {scriptEntre} Lit le fichier de script {scriptEntre}. Les caractres du fichier sont interprts comme si vous les tapiez. La commande ":source! {scriptEntre}" donne le mme rsultat. Si la fin du fichier est atteinte avant que l'diteur quitte, les caractres suivants sont lus depuis le clavier. .TP \-T {terminal} Indique .B Vim le nom du terminal utilis. Cela n'est requis que lorsque la dtection automatique choue. Le {terminal} devrait tre connu de .B Vim (intgr) ou dfini dans le fichier termcap ou terminfo. .TP \-u {vimrc} Utilise les commandes du fichier {vimrc} pour les initialisations. Toutes les autres initialisations sont omises. utiliser pour diter un type de fichiers particulier. Cela permet aussi d'omettre toute initialisation en spcifiant le nom de fichier "NONE". Voir ":help initialization" dans Vim pour davantage de dtails. .TP \-U {gvimrc} Utilise les commandes du fichier {gvimrc} pour l'initialisation de l'IHM graphique. Toutes les autres initialisations graphiques sont omises. Cela permet aussi d'omettre toute initialisation graphique en spcifiant le nom de fichier "NONE". Voir ":help gui\-init" dans Vim pour davantage de dtails. .TP \-V[N] Mode Verbeux. Donne des messages propos des fichiers sourcs, ainsi que sur la lecture et les critures dans le fichier viminfo. le nombre optionnel N prcise la valeur de l'option 'verbose' (10 par dfaut). .TP \-v Dmarre .B Vim en mode Vi, comme si l'excutable s'appelait "vi". Cela n'a d'effet que si l'excutable invoqu est "ex". .TP \-w {scriptSortie} Tous les caractres que vous tapez sont enregistrs dans le fichier {scriptSortie}, jusqu' ce que vous quittiez .B Vim. C'est utile quand vous voulez crer un fichier de script utiliser avec "vim \-s" ou ":source!". Si le fichier {scriptSortie} existe, les caractres sont ajouts la fin. .TP \-W {scriptSortie} Comme \-w, mais un fichier existant sera cras. .TP \-x Chiffre les fichiers lors de l'criture. Une cl de chiffrement sera demande. .TP \-X Ne se connecte pas au serveur X. Acclre le temps de dmarrage dans un terminal, mais le titre de la fentre et le presse-papier seront inaccessibles. .TP \-y Dmarre .B Vim en mode Dbutant (easy), comme si l'excutable s'appelait "evim" ou "eview". Donne .B Vim un comportement plus proche des diteurs cliquez-tapez . .TP \-Z Mode restreint. Fonctionne comme si l'excutable commenait par la lettre 'r'. .TP \-\- Dlimite la fin des options. Les arguments qui suivent seront considrs comme des noms de fichiers. Cela permet d'diter des fichiers dbutant par un '\-'. .TP \-\-echo\-wid IHM graphique GTK uniquement : retourne la Window ID sur stdout. .TP \-\-help Donne un message d'aide et quitte, comme "\-h". .TP \-\-literal Prend les arguments de noms de fichiers littralement, sans tendre les jokers. N'a aucun effet sur Unix, o le shell tend les jokers. .TP \-\-noplugin Ne charge pas les greffons. Implicite avec \-u NONE. .TP \-\-remote Se connecte un serveur Vim et lui fait diter les fichiers spcifis dans le reste des arguments. Si aucun serveur n'est trouv, un avertissement est mis et les fichiers sont dits dans le Vim courant. .TP \-\-remote\-expr {expr} Se connecte un serveur Vim, y value {expr} et affiche le rsultat sur la sortie standard (stdout). .TP \-\-remote\-send {touches} Se connecte un serveur Vim et y envoie {touches}. .TP \-\-remote\-silent Comme \-\-remote, mais sans mettre d'avertissement si aucun serveur n'est trouv. .TP \-\-remote\-wait Comme \-\-remote, mais Vim ne quitte pas tant que le fichier est en cours d'dition. .TP \-\-remote\-wait\-silent Comme \-\-remote\-wait, mais sans mettre d'avertissement si aucun serveur n'est trouv. .TP \-\-serverlist Donne la liste des noms de tous les serveurs Vim disponibles. .TP \-\-servername {nom} Utilise {nom} pour le nom de serveur. Ce nom est donn au Vim courant, moins qu'il ne soit utilis avec un argument \-\-remote. Dans ce cas, il s'agit du nom du serveur auquel se connecter. .TP \-\-socketid {id} IHM graphique GTK+ uniquement : utilise le mcanisme GtkPlug pour faire fonctionner gvim dans une autre fentre. .TP \-\-version Affiche les informations sur la version puis quitte. .SH AIDE EN LIGNE Taper ":help" dans .B Vim pour commencer. Taper ":help sujet" pour obtenir de l'aide sur un sujet prcis. Par exemple : ":help ZZ" pour consulter l'aide sur la commande "ZZ". Utiliser <Tab> et CTRL\-D pour complter les sujets (":help cmdline\-completion"). Des marqueurs sont inclus dans l'aide et vous permettent de sauter d'un endroit un autre (comme des liens hypertextes, voir ":help"). L'ensemble des fichiers de la documentation peut tre consult de cette faon, par exemple ":help syntax.txt". .SH FICHIERS .TP 15 /usr/local/lib/vim/doc/*.txt Les fichiers de la documentation de .B Vim. Utiliser ":help doc\-file\-list" pour obtenir la liste complte. .TP /usr/local/lib/vim/doc/tags Le fichier des marqueurs utilis pour trouver les informations dans les fichiers de la documentation. .TP /usr/local/lib/vim/syntax/syntax.vim Initialisation de la syntaxe pour l'ensemble du systme. .TP /usr/local/lib/vim/syntax/*.vim Fichiers de syntaxe pour diffrents langages. .TP /usr/local/lib/vim/vimrc Initialisation de .B Vim pour l'ensemble du systme. .TP ~/.vimrc Initialisation de .B Vim de votre compte utilisateur. .TP /usr/local/lib/vim/gvimrc Initialisation de gvim pour l'ensemble du systme. .TP ~/.gvimrc Initialisation de gvim pour votre compte utilisateur. .TP /usr/local/lib/vim/optwin.vim Script utilis pour la commande ":options", une manire pratique de consulter et de modifier les options. .TP /usr/local/lib/vim/menu.vim Initialisation des menus de gvim pour l'ensemble du systme. .TP /usr/local/lib/vim/bugreport.vim Script pour gnrer un rapport de bogue. Voir ":help bugs". .TP /usr/local/lib/vim/filetype.vim Script pour dtecter le type d'un fichier d'aprs son nom. Voir ":help 'filetype'". .TP /usr/local/lib/vim/scripts.vim Script pour dtecter le type d'un fichier d'aprs son contenu. Voir ":help 'filetype'". .TP /usr/local/lib/vim/print/*.ps Fichiers utiliss pour l'impression PostScript. .PP Pour disposer d'informations rcentes, consulter le site Internet de VIM : .br <URL:http://www.vim.org/> .SH VOIR AUSSI vimtutor(1) .SH AUTEUR La majeure partie de .B Vim a t crite par Bram Moolenaar, avec l'aide de nombreux autres contributeurs. Voir ":help credits" dans .B Vim. .br .B Vim est bas sur Stevie, ralis par Tim Thompson, Tony Andrews et G.R. (Fred) Walter. Toutefois, pratiquement rien du code original ne subsiste. .SH BOGUES Probablement. Voir ":help todo" pour consulter la liste des problmes connus. .PP NOTE : Remarquez que bon nombre de points, qui pourraient tre considrs comme des bugs par certains, sont en fait dus une reproduction trop fidle du comportement de Vi. Et si vous pensez que d'autres points sont des bugs "parce que Vi le fait diffremment", vous devriez jeter un oeil attentif au fichier vi_diff.txt (ou taper ":help vi_diff.txt" dans Vim). Regardez aussi les options 'compatible' et 'coptions'. .SH TRADUCTION Cette page de manuel a t traduite par Richard Hitier. <richard.hitier@dial.oleane.com> 2000-08-07. .br Cette page de manuel a t mise jour par David Blanchet. <david.blanchet@free.fr> 2006-04-10. Mise jour 2013-05-10, Dominique Pell <dominique.pelle@gmail.com> �����������������������������������������������������������vim-7.4.1689/runtime/doc/vim-fr.UTF-8.1�������������������������������������������������������������0000664�0000000�0000000�00000043470�12677030670�0017121�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" Traduction lundi 7 août 2000 par Richard Hitier .\" (richard.hitier@dial.oleane.com) .\" Mise à jour de la traduction par David Blanchet .\" (david.blanchet@free.fr) 2006-06-10 .\" Mise à jour de la traduction par Dominique Pellé .\" (dominique.pelle@gmail.com) 2013-05-10 .\" .TH VIM 1 "22 février 2002" .SH NOM vim \- Vi IMproved, éditeur de texte pour programmeurs .SH SYNOPSIS .br .B vim [options] [fichier ...] .br .B vim [options] \- .br .B vim [options] \-t marqueur .br .B vim [options] \-q [fichiererreurs] .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 est un éditeur de texte proposant une compatibilité ascendante avec Vi. Il permet d'éditer n'importe quel type de texte brut. Il est particulièrement adapté pour l'édition des programmes. .PP Il comporte de nombreuses améliorations par rapport à Vi : annulation sur plusieurs niveaux, fenêtres et tampons multiples, coloration syntaxique, édition en ligne de commande, complètement des noms de fichiers, aide en ligne, sélection visuelle, etc. Voir ":help vi_diff.txt" pour un résumé des différences entre .B Vim et Vi. .PP Pendant l'exécution de .B Vim \, une aide abondante est accessible au travers du système d'aide en ligne, grâce à la commande ":help". Voir la section AIDE EN LIGNE plus bas. .PP Le plus souvent .B Vim est démarré pour éditer un unique fichier avec la commande .PP vim fichier .PP Plus généralement, .B Vim est lancé avec : .PP vim [options] [listefichiers] .PP Si la listefichiers est omise, l'éditeur démarre avec un tampon vide. Autrement, l'une des quatre méthodes suivantes vous permettra de choisir un ou plusieurs fichiers à éditer. .TP 12 fichier ... Une liste de noms de fichiers. Le premier sera le fichier courant et sera lu dans le tampon. Le curseur sera placé sur la première ligne du tampon. Vous pouvez passer aux autres fichiers avec la commande ":next". Pour éditer un fichier débutant par un tiret, faites précéder la liste de fichiers par "\-\-". .TP \- Le fichier à éditer est lu sur l'entrée standard (stdin). Les commandes sont lues depuis stderr, qui devrait être un terminal. .TP \-t {marqueur} Le fichier à éditer et la position initiale du curseur dépendent d'un "marqueur", qui est une sorte d'étiquette. {marqueur} est recherché dans le fichier des marqueurs, le fichier correspondant devient le fichier courant et la commande associée est exécutée. Principalement utile pour les programmes en C ; dans ce cas, {marqueur} peut être le nom d'une fonction. Au final, le fichier contenant cette fonction devient le fichier courant et le curseur est placé au début de la fonction. Voir ":help tag\-commands". .TP \-q [fichiererreurs] Démarre en mode Mise-au-point (QuickFix). Le fichier [fichiererreurs] est lu et la première erreur est affichée. Si [fichiererreurs] est omis, le nom du fichier est lu dans l'option 'errorfile' ("AztecC.Err" par défaut sur Amiga, "errors.err" sur les autres systèmes). La commande ":cn" permet de sauter aux erreurs suivantes. Voir ":help quickfix". .PP .B Vim se comporte différemment selon le nom de la commande (l'exécutable peut cependant être le même fichier). .TP 10 vim La façon "normale", le comportement par défaut. .TP ex Démarre en mode Ex. La commande ":vi" permet de passer en mode Normal. Ce mode est également accessible avec l'argument "\-e". .TP view Démarre en mode Lecture-Seule. Vous êtes protégé de l'écriture accidentelle des fichiers. Ce mode est également accessible avec l'argument "\-R". .TP gvim gview La version graphique. Ouvre une nouvelle fenêtre. Également accessible avec l'argument "\-g". .TP evim eview La version graphique en mode Débutant (easy). Ouvre une nouvelle fenêtre. Également accessible avec l'argument "\-y". .TP rvim rview rgvim rgview Comme ci-dessus, mais avec des restrictions. Il vous sera impossible de lancer des commandes du shell, ou de suspendre .B Vim. Également accessible avec l'argument "\-Z". .SH OPTIONS Les options peuvent être spécifiées dans n'importe quel ordre, avant ou après les noms de fichiers. Les options sans arguments peuvent être combinées après un unique tiret. .TP 12 +[num] Place le curseur sur la ligne "num" dans le premier fichier. Si "num" est omis, le curseur sera placé sur la dernière ligne. .TP +/{motif} Place le curseur sur la première occurrence de {motif} dans le premier fichier. Voir ":help search\-pattern" pour connaître les motifs de recherches disponibles. .TP +{commande} .TP \-c {commande} Exécute {commande} après la lecture du premier fichier. {commande} est interprétée comme une commande Ex. Si la {commande} contient des espaces, elle doit être entourée de doubles-apostrophes (cela dépend du shell utilisé). Exemple : Vim "+set si" main.c .br Note : vous pouvez utiliser jusqu'à 10 commandes "+" ou "\-c". .TP \-S {fichier} Source {fichier} après la lecture du premier fichier. C'est équivalent à \-c "source {fichier}". {fichier} ne peut pas débuter par un '\-'. Si {fichier} est omis, "Session.vim" est utilisé (cela ne fonctionne que si \-S est le dernier argument). .TP \-\-cmd {commande} Comme "\-c", mais la commande est exécutée juste avant de traiter les fichiers vimrc. Vous pouvez utiliser jusqu'à 10 de ces commandes, indépendamment des commandes "\-c". .TP \-A Si .B Vim a été compilé avec le support de la fonctionnalité ARABIC pour l'édition de fichiers de droite à gauche et les claviers arabes, cette option lance .B Vim en mode Arabe, c.-à-d. que l'option 'arabic' est activée. Sinon, un message d'erreur est émis et .B Vim quitte. .TP \-b Mode Binaire. Active plusieurs options pour permettre l'édition d'un fichier binaire ou exécutable. .TP \-C Compatible. Active l'option 'compatible'. .B Vim se comportera alors quasiment comme Vi, même s'il existe un fichier .vimrc. .TP \-d Démarre en mode Diff. Deux, trois ou quatre noms de fichiers doivent être spécifiés. .B Vim ouvrira alors tous les fichiers et affichera leurs différences. Fonctionne comme vimdiff(1). .TP \-d {périph} Ouvre {périph} pour l'utiliser comme terminal. Uniquement sur Amiga. Exemple : "\-d con:20/30/600/150". .TP \-D Debogage. Passe en mode Débogage lors de l'exécution de la première commande d'un script. .TP \-e Démarre .B Vim en mode Ex, comme si l'exécutable s'appelait "ex". .TP \-E Démarre .B Vim en mode Ex amélioré, comme si l'exécutable "exim" avait été invoqué. .TP \-f Premier-plan (Foreground). Pour la version graphique, .B Vim ne forke pas et ne se détache pas du shell dans lequel il a été invoqué. Sur Amiga, .B Vim n'est pas relancé pour ouvrir une nouvelle fenêtre. Cette option est utile quand .B Vim est exécuté par un programme qui attend la fin de la session d'édition (par exemple mail). Sur Amiga, les commandes ":sh" et ":!" ne fonctionneront pas. .TP \-\-nofork Premier-plan (Foreground). Pour la version graphique, .B Vim ne forkera pas et ne se détachera pas du shell dans lequel il a été lancé. .TP \-F Si .B Vim a été compilé avec le support de la fonctionnalité FKMAP pour l'édition de fichiers de droite à gauche et les claviers farsi, cette option lance .B Vim en mode Farsi, c.-à-d. avec les options 'fkmap' et 'rightleft' activées. Sinon, un message d'erreur est émis et .B Vim quitte. .TP \-g Si .B Vim a été compilé avec le support de l'IHM graphique, cette option active l'IHM graphique. Si le support n'a pas été compilé, un message d'erreur est émis et .B Vim quitte. .TP \-h Donne une aide succincte sur les arguments et les options de la ligne de commande. Après cela, .B Vim quitte. .TP \-H Si .B Vim a été compilé avec le support de la fonctionnalité RIGHTLEFT pour l'édition de fichiers de droite à gauche et les claviers hébreux, cette option lance .B Vim en mode Hébreu, c.-à-d. avec les options 'hkmap' et 'rightleft' activées. Sinon, un message d'erreur est émis et .B Vim quitte. .TP \-i {viminfo} Lorsque l'utilisation d'un fichier viminfo est activée, cette option indique le nom de fichier à utiliser à la place de "~/.viminfo" par défaut. Il est possible d'empêcher l'utilisation d'un fichier ".viminfo", en spécifiant le nom de fichier "NONE". .TP \-L Comme \-r. .TP \-l Mode Lisp. Active les options 'lisp' et 'showmatch'. .TP \-m Empêche la modification des fichiers. Désactive l'option 'write'. Vous pouvez toujours modifier le tampon, mais il vous sera impossible d'écrire le fichier. .TP \-M N'autorise aucune modification. les options 'modifiable' et 'write' sont désactivées, de sorte que les changements ne sont pas autorisés et que les fichiers ne peuvent pas être écrits. Note : ces options peuvent être activées pour autoriser les modifications. .TP \-N Mode Non-compatible. Désactive l'option 'compatible'. Cela améliorera le comportement de .B Vim \, mais il sera moins conforme à celui de Vi, même s'il n'existe aucun fichier ".vimrc". .TP \-n N'utilise pas de fichier d'échange (swapfile). Le recouvrement après un plantage sera impossible. Utile pour éditer un fichier sur un support très lent (disquette par ex.). Également activable avec ":set uc=0". Il est possible de l'annuler avec ":set uc=200". .TP \-nb Devient un serveur d'édition pour NetBeans. Consulter la documentation à ce sujet pour davantage de détails. .TP \-o[N] Ouvre N fenêtres les unes au-dessus des autres. Quand N est omis, ouvre une fenêtre pour chaque fichier. .TP \-O[N] Ouvre N fenêtres côte à côte. Quand N est omis, ouvre une fenêtre pour chaque fichier fichier. .TP \-p[N] Ouvre N onglets. Quand N est omis, ouvre un onglet pour chaque fichier fichier. .TP \-R Mode Lecture-Seule. Active l'option 'readonly'. Vous pouvez toujours éditer le tampon, mais il vous sera impossible de d'écraser accidentellement un fichier. Si vous voulez écraser un fichier, ajoutez un point d'exclamation à la commande Ex, comme dans ":w!". L'option \-R impose l'option \-n (voir ci-dessus). L'option 'readonly' peut être désactivée avec ":set noro". Voir ":help 'readonly'". .TP \-r Donne la liste des fichiers d'échange, avec des informations pour les utiliser à des fins de recouvrement. .TP \-r {file} Mode Recouvrement. Utilise le fichier d'échange pour récouvrer d'une session d'édition plantée. Le fichier d'échange est un fichier avec le même nom que le fichier texte, suivi du suffixe ".swp". Voir ":help recovery". .TP \-s Mode Silencieux. Disponible uniquement quand .B Vim est lancé en tant que "ex" ou quand l'option "\-e" a été spécifiée avant l'option "\-s". .TP \-s {scriptEntrée} Lit le fichier de script {scriptEntrée}. Les caractères du fichier sont interprétés comme si vous les tapiez. La commande ":source! {scriptEntrée}" donne le même résultat. Si la fin du fichier est atteinte avant que l'éditeur quitte, les caractères suivants sont lus depuis le clavier. .TP \-T {terminal} Indique à .B Vim le nom du terminal utilisé. Cela n'est requis que lorsque la détection automatique échoue. Le {terminal} devrait être connu de .B Vim (intégré) ou défini dans le fichier termcap ou terminfo. .TP \-u {vimrc} Utilise les commandes du fichier {vimrc} pour les initialisations. Toutes les autres initialisations sont omises. À utiliser pour éditer un type de fichiers particulier. Cela permet aussi d'omettre toute initialisation en spécifiant le nom de fichier "NONE". Voir ":help initialization" dans Vim pour davantage de détails. .TP \-U {gvimrc} Utilise les commandes du fichier {gvimrc} pour l'initialisation de l'IHM graphique. Toutes les autres initialisations graphiques sont omises. Cela permet aussi d'omettre toute initialisation graphique en spécifiant le nom de fichier "NONE". Voir ":help gui\-init" dans Vim pour davantage de détails. .TP \-V[N] Mode Verbeux. Donne des messages à propos des fichiers sourcés, ainsi que sur la lecture et les écritures dans le fichier viminfo. le nombre optionnel N précise la valeur de l'option 'verbose' (10 par défaut). .TP \-v Démarre .B Vim en mode Vi, comme si l'exécutable s'appelait "vi". Cela n'a d'effet que si l'exécutable invoqué est "ex". .TP \-w {scriptSortie} Tous les caractères que vous tapez sont enregistrés dans le fichier {scriptSortie}, jusqu'à ce que vous quittiez .B Vim. C'est utile quand vous voulez créer un fichier de script à utiliser avec "vim \-s" ou ":source!". Si le fichier {scriptSortie} existe, les caractères sont ajoutés à la fin. .TP \-W {scriptSortie} Comme \-w, mais un fichier existant sera écrasé. .TP \-x Chiffre les fichiers lors de l'écriture. Une clé de chiffrement sera demandée. .TP \-X Ne se connecte pas au serveur X. Accélère le temps de démarrage dans un terminal, mais le titre de la fenêtre et le presse-papier seront inaccessibles. .TP \-y Démarre .B Vim en mode Débutant (easy), comme si l'exécutable s'appelait "evim" ou "eview". Donne à .B Vim un comportement plus proche des éditeurs « cliquez-tapez ». .TP \-Z Mode restreint. Fonctionne comme si l'exécutable commençait par la lettre 'r'. .TP \-\- Délimite la fin des options. Les arguments qui suivent seront considérés comme des noms de fichiers. Cela permet d'éditer des fichiers débutant par un '\-'. .TP \-\-echo\-wid IHM graphique GTK uniquement : retourne la Window ID sur stdout. .TP \-\-help Donne un message d'aide et quitte, comme "\-h". .TP \-\-literal Prend les arguments de noms de fichiers littéralement, sans étendre les jokers. N'a aucun effet sur Unix, où le shell étend les jokers. .TP \-\-noplugin Ne charge pas les greffons. Implicite avec \-u NONE. .TP \-\-remote Se connecte à un serveur Vim et lui fait éditer les fichiers spécifiés dans le reste des arguments. Si aucun serveur n'est trouvé, un avertissement est émis et les fichiers sont édités dans le Vim courant. .TP \-\-remote\-expr {expr} Se connecte à un serveur Vim, y évalue {expr} et affiche le résultat sur la sortie standard (stdout). .TP \-\-remote\-send {touches} Se connecte à un serveur Vim et y envoie {touches}. .TP \-\-remote\-silent Comme \-\-remote, mais sans émettre d'avertissement si aucun serveur n'est trouvé. .TP \-\-remote\-wait Comme \-\-remote, mais Vim ne quitte pas tant que le fichier est en cours d'édition. .TP \-\-remote\-wait\-silent Comme \-\-remote\-wait, mais sans émettre d'avertissement si aucun serveur n'est trouvé. .TP \-\-serverlist Donne la liste des noms de tous les serveurs Vim disponibles. .TP \-\-servername {nom} Utilise {nom} pour le nom de serveur. Ce nom est donné au Vim courant, à moins qu'il ne soit utilisé avec un argument \-\-remote. Dans ce cas, il s'agit du nom du serveur auquel se connecter. .TP \-\-socketid {id} IHM graphique GTK+ uniquement : utilise le mécanisme GtkPlug pour faire fonctionner gvim dans une autre fenêtre. .TP \-\-version Affiche les informations sur la version puis quitte. .SH AIDE EN LIGNE Taper ":help" dans .B Vim pour commencer. Taper ":help sujet" pour obtenir de l'aide sur un sujet précis. Par exemple : ":help ZZ" pour consulter l'aide sur la commande "ZZ". Utiliser <Tab> et CTRL\-D pour compléter les sujets (":help cmdline\-completion"). Des marqueurs sont inclus dans l'aide et vous permettent de sauter d'un endroit à un autre (comme des liens hypertextes, voir ":help"). L'ensemble des fichiers de la documentation peut être consulté de cette façon, par exemple ":help syntax.txt". .SH FICHIERS .TP 15 /usr/local/lib/vim/doc/*.txt Les fichiers de la documentation de .B Vim. Utiliser ":help doc\-file\-list" pour obtenir la liste complète. .TP /usr/local/lib/vim/doc/tags Le fichier des marqueurs utilisé pour trouver les informations dans les fichiers de la documentation. .TP /usr/local/lib/vim/syntax/syntax.vim Initialisation de la syntaxe pour l'ensemble du système. .TP /usr/local/lib/vim/syntax/*.vim Fichiers de syntaxe pour différents langages. .TP /usr/local/lib/vim/vimrc Initialisation de .B Vim pour l'ensemble du système. .TP ~/.vimrc Initialisation de .B Vim de votre compte utilisateur. .TP /usr/local/lib/vim/gvimrc Initialisation de gvim pour l'ensemble du système. .TP ~/.gvimrc Initialisation de gvim pour votre compte utilisateur. .TP /usr/local/lib/vim/optwin.vim Script utilisé pour la commande ":options", une manière pratique de consulter et de modifier les options. .TP /usr/local/lib/vim/menu.vim Initialisation des menus de gvim pour l'ensemble du système. .TP /usr/local/lib/vim/bugreport.vim Script pour générer un rapport de bogue. Voir ":help bugs". .TP /usr/local/lib/vim/filetype.vim Script pour détecter le type d'un fichier d'après son nom. Voir ":help 'filetype'". .TP /usr/local/lib/vim/scripts.vim Script pour détecter le type d'un fichier d'après son contenu. Voir ":help 'filetype'". .TP /usr/local/lib/vim/print/*.ps Fichiers utilisés pour l'impression PostScript. .PP Pour disposer d'informations récentes, consulter le site Internet de VIM : .br <URL:http://www.vim.org/> .SH VOIR AUSSI vimtutor(1) .SH AUTEUR La majeure partie de .B Vim a été écrite par Bram Moolenaar, avec l'aide de nombreux autres contributeurs. Voir ":help credits" dans .B Vim. .br .B Vim est basé sur Stevie, réalisé par Tim Thompson, Tony Andrews et G.R. (Fred) Walter. Toutefois, pratiquement rien du code original ne subsiste. .SH BOGUES Probablement. Voir ":help todo" pour consulter la liste des problèmes connus. .PP NOTE : Remarquez que bon nombre de points, qui pourraient être considérés comme des bugs par certains, sont en fait dus à une reproduction trop fidèle du comportement de Vi. Et si vous pensez que d'autres points sont des bugs "parce que Vi le fait différemment", vous devriez jeter un oeil attentif au fichier vi_diff.txt (ou taper ":help vi_diff.txt" dans Vim). Regardez aussi les options 'compatible' et 'coptions'. .SH TRADUCTION Cette page de manuel a été traduite par Richard Hitier. <richard.hitier@dial.oleane.com> 2000-08-07. .br Cette page de manuel a été mise à jour par David Blanchet. <david.blanchet@free.fr> 2006-04-10. Mise à jour 2013-05-10, Dominique Pellé <dominique.pelle@gmail.com> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/vim-it.1�������������������������������������������������������������������0000775�0000000�0000000�00000040345�12677030670�0016325�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.TH VIM 1 "22 febbraio 2002" .SH NOME vim \- VI Migliorato, un editor di testi per programmatori .SH SINTASSI .br .B vim [opzioni] [file ..] .br .B vim [opzioni] \- .br .B vim [opzioni] \-t tag .br .B vim [opzioni] \-q [file_errori] .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 DESCRIZIONE .B Vim Un editore di testi, compatibile con, e migliore di, Vi. Pu essere usato per editare qualsiasi file di testo. Particolarmente utile per editare programmi. .PP Ci sono parecchi miglioramenti rispetto a Vi: undo multipli, finestre e buffer multipli, evidenziazione sintattica, possibilit di modificare la linea di comando, completamento nomi file, help in linea, selezione testi in Modo Visual, etc.. Vedere ":help vi_diff.txt" per un sommario delle differenze fra .B Vim e Vi. .PP Mentre usate .B Vim potete ricevere molto aiuto dal sistema di help online, col comando ":help". Vedere qui sotto la sezione AIUTO ONLINE. .PP Quasi sempre .B Vim viene invocato, per modificare un file, col comando .PP vim nome_file .PP Pi in generale .B Vim viene invocato con: .PP vim [opzioni] [lista_file] .PP Se lista_file non presente, l'editor inizia aprendo un buffer vuoto. Altrimenti, una e una sola delle quattro maniere indicate qui sotto pu essere usata per scegliere uno o pi file da modificare. .TP 12 nome_file .. Una lista di nomi di file. Il primo di questi sar il file corrente, e verr letto nel buffer. Il cursore sar posizionato sulla prima linea del buffer. Potete arrivare agli altri file col comando ":next". Per editare un file il cui nome inizia per "\-" premettete "\-\-" alla lista_file. .TP \- Il file da editare letto dallo "stdin" [di solito, ma non necessariamente, il terminale \- NdT]. I comandi sono letti da "stderr", che dovrebbe essere un terminale [tty]. .TP \-t {tag} Il file da editare e la posizione iniziale del cursore dipendono da "tag", una specie di "etichetta" a cui saltare. {tag} viene cercata nel file "tags", ed il file ad essa associato diventa quello corrente, ed il comando ad essa associato viene eseguito. Di solito si usa per programmi C, nel qual caso {tag} potrebbe essere un nome di funzione. L'effetto che il file contenente quella funzione diventa il file corrente e il cursore posizionato all'inizio della funzione. Vedere ":help tag\-commands". .TP \-q [file_errori] Inizia in Modo QuickFix [correzione veloce]. Il file [file_errori] letto e il primo errore visualizzato. Se [file_errori] non indicato, il suo nome ottenuto dal valore dell'opzione 'errorfile' (che, se non specificata, vale "AztecC.Err" per l'Amiga, "errors.err" su altri sistemi). Si pu saltare all'errore successivo col comando ":cn". Vedere ":help quickfix". .PP .B Vim si comporta in modo diverso se invocato con nomi differenti (il programma eseguibile "sottostante" pu essere sempre lo stesso). .TP 10 vim Modo Normal, comportamento normale. .TP ex Inizia in Modo "Ex". Si pu passare in Modo Normal col comando ":vi". Si pu invocare il Modo "Ex" anche con l'argomento "\-e". .TP view Inizia in Modo Read-only (Sola Lettura). Non potete modificare i file. Si pu invocare il Modo Read-only anche con l'argomento "\-R". .TP gvim gview La versione GUI [Graphical User Interface]. Apre una nuova finestra. Si pu invocare il Modo GUI anche con l'argomento "\-g". .TP evim eview La versione GUI in Modo Easy (semplificata). Apre una nuova finestra. Si pu invocare il Modo Easy anche con l'argomento "\-y". .TP rvim rview rgvim rgview Come sopra, ma con restrizioni ai comandi. Non si potranno eseguire comandi della shell o sospendere .B Vim. Si pu chiedere la stessa cosa anche con l'argomento "\-Z". .SH OPZIONI Le opzioni possono essere in un ordine qualsiasi, prima o dopo i nomi di file. Opzioni che non necessitano un argomento possono essere specificate dietro a un solo "\-". .TP 12 +[numero] Per il primo file il cursore sar posizionato sulla linea "numero". Se "numero" manca, il cursore sar posizionato sull'ultima linea del file. .TP +/{espressione} Per il primo file il cursore sar posizionato alla prima occorrenza di {espressione}. Vedere ":help search\-pattern" per come specificare l'espressione. .TP +{comando} .TP \-c {comando} {comando} sar eseguito dopo che il primo file stato letto. {comando} interpretato come un comando Ex. Se il {comando} contiene spazi deve essere incluso fra doppi apici (o altro delimitatore, a seconda della shell che si sta usando). Esempio: Vim "+set si" main.c .br Note: Si possono avere fino a 10 comandi "+" o "\-c". .TP \-S {file} I comandi contenuti in {file} sono eseguiti dopo la lettura del primo file. Equivalente a \-c "source {file}". {file} non pu avere un nome che inizia per '\-'. Se {file} omesso si usa "Session.vim" (funziona solo se \-S l'ultimo argomento specificato). .TP \-\-cmd {comando} Come "\-c", ma il comando eseguito PRIMA di eseguire qualsiasi file vimrc. Si possono usare fino a 10 di questi comandi, indipendentemente dai comandi "\-c". .TP \-A Se .B Vim stato compilato con supporto Arabic per editare file con orientamento destra-sinistra e tastiera con mappatura Araba, questa opzione inizia .B Vim in Modo Arabic, cio impostando 'arabic'. Altrimenti viene dato un messaggio di errore e .B Vim termina in modo anormale. .TP \-b Modo Binary (binario). Vengono impostate alcune opzioni che permettono di modificare un file binario o un programma eseguibile. .TP \-C Compatibile. Imposta l'opzione 'compatible'. In questo modo .B Vim ha quasi lo stesso comportamento di Vi, anche in presenza di un file di configurazione .vimrc [proprio di Vim, vi usa .exrc \- Ndt]. .TP \-d Inizia in Modo Diff [differenze]. Dovrebbero esserci come argomenti due o tre o quattro nomi di file. .B Vim aprir tutti i file evidenziando le differenze fra gli stessi. Funziona come vimdiff(1). .TP \-d {dispositivo} Apre {dispositivo} per usarlo come terminale. Solo per l'Amiga. Esempio: "\-d con:20/30/600/150". .TP \-D Debugging. Vim si mette in Modo "debugging" a partire dall'esecuzione del primo comando da uno script. .TP \-e Eseguire .B Vim in Modo Ex, come se il programma eseguito sia "ex". .TP \-E Eseguire .B Vim in Modo Ex migliorato, come se il programma eseguito sia "exim". .TP \-f Direttamente [Foreground]. Per la versione GUI, .B Vim non crea [fork] una nuova finestra, indipendente dalla shell di invocazione. Per l'Amiga, .B Vim non fatto ripartire per aprire una nuova finestra. Opzione da usare quando .B Vim eseguito da un programma che attende la fine della sessione di edit (ad es. mail). Sull'Amiga i comandi ":sh" e ":!" non sono disponibili. .TP \-\-nofork Direttamente [Foreground]. Per la versione GUI, .B Vim non crea [fork] una nuova finestra, indipendente dalla shell di invocazione. .TP \-F Se .B Vim stato compilato con supporto FKMAP per editare file con orientamento destra-sinistra e tastiera con mappatura Farsi, questa opzione inizia .B Vim in Modo Farsi, cio impostando 'fkmap' e 'rightleft'. Altrimenti viene dato un messaggio di errore e .B Vim termina in modo anormale. .TP \-g Se .B Vim stato compilato con supporto GUI, questa opzione chiede di usarla. Se Vim stato compilato senza supporto GUI viene dato un messaggio di errore e .B Vim termina in modo anormale. .TP \-h Un po' di aiuto su opzioni e argomenti che si possono dare invocando Vim. Subito dopo .B Vim esce. .TP \-H Se .B Vim stato compilato col supporto RIGHTLEFT per editare file con orientamento destra-sinistra e tastiera con mappatura Ebraica, questa opzione inizia .B Vim in Modo Ebraico, cio impostando 'hkmap' e 'rightleft'. Altrimenti viene dato un messaggio di errore e .B Vim termina in modo anormale. .TP \-i {viminfo} Se abilitato l'uso di un file viminfo, questa opzione indica il nome del file da usare invece di quello predefinito "~/.viminfo". Si pu anche evitare l'uso di un file .viminfo, dando come nome "NONE". .TP \-L Equivalente a \-r. .TP \-l Modo Lisp. Imposta le opzioni 'lisp' e 'showmatch'. .TP \-m Inibisce modifica file. Annulla l'opzione 'write'. ancora possibile modificare un buffer [in memoria \- Ndt], ma non scriverlo. .TP \-M Modifiche non permesse. Le opzioni 'modifiable' e 'write' sono annullate, in modo da impedire sia modifiche che riscritture. Da notare che queste opzioni possono essere abilitate in seguito, permettendo cos modifiche. .TP \-N Modo "Non-compatibile". Annulla l'opzione 'compatible'. Cos .B Vim va un po' meglio, ma meno compatibile con Vi, anche in assenza di un file .vimrc. .TP \-n Inibisce l'uso di un file di swap. Il recupero dopo una caduta di macchina diventa impossibile. Utile per editare un file su un supporto molto lento (ad es. floppy). Il comando ":set uc=0" ha lo stesso effetto. Per abilitare il recupero usare ":set uc=200". .TP \-nb Diviene un Editor server per NetBeans. Vedere la documentazione per dettagli. .TP \-o[N] Apri N finestre in orizzontale. Se N manca, apri una finestra per ciascun file. .TP \-O[N] Apri N finestre, in verticale. Se N manca, apri una finestra per ciascun file. .TP \-R Modo Read-only (Sola Lettura). Imposta l'opzione 'readonly'. Si pu ancora modificare il buffer, ma siete protetti da una riscrittura involontaria. Se volete davvero riscrivere il file, aggiungete un punto esclamativo al comando Ex, come in ":w!". L'opzione \-R implica anche l'opzione \-n (vedere sotto). L'opzione 'readonly' pu essere annullata con ":set noro". Vedere ":help 'readonly'". .TP \-r Lista file di swap, assieme a dati utili per un recupero. .TP \-r {file} Modo Recovery (ripristino). Il file di swap usato per recuperare una sessione di edit finita male. Il file di swap un file con lo stesso nome file del file di testo editato, col suffisso ".swp". Vedere ":help recovery". .TP \-s Modo silenzioso. Solo quando invocato come "Ex" o quando l'opzione "\-e" stata data prima dell'opzione "\-s". .TP \-s {scriptin} Lo script file {scriptin} letto. I caratteri nel file sono interpretati come se immessi da voi. Lo stesso si pu ottenere col comando ":source! {scriptin}". Se la fine del file di input viene raggiunta prima che Vim termini, l'ulteriore input viene preso dalla tastiera. .TP \-T {terminale} Dice a .B Vim quale tipo di terminale state usando. Utile solo se il terminale non viene riconosciuto correttamente da Vim. Dovrebbe essere un terminale noto a .B Vim (internamente) o definito nel file termcap o terminfo. .TP \-u {vimrc} Usa i comandi nel file {vimrc} per inizializzazioni. Tutte le altre inizializzazioni non sono eseguite. Usate questa opzione per editare qualche file di tipo speciale. Pu anche essere usato per non fare alcuna inizializzazione dando come nome "NONE". Vedere ":help initialization" da vim per ulteriori dettagli. .TP \-U {gvimrc} Usa i comandi nel file {gvimrc} per inizializzazioni GUI. Tutte le altre inizializzazioni GUI non sono eseguite. Pu anche essere usata per non fare alcuna inizializzazione GUI dando come nome "NONE". Vedere ":help gui-init" da vim per ulteriori dettagli. .TP \-V[N] Verboso. Vim manda messaggi relativi agli script file che esegue e quando legge o scrive un file viminfo. Il numero opzionale N il valore dell'opzione 'verbose'. Il valore predefinito 10. .TP \-v Inizia .B Vim in Modo Vi, come se il programma eseguibile fosse "vi". Questo ha effetto solo quando Vim viene invocato con il nome "ex". .TP \-w {scriptout} Ogni carattere immesso viene registrato nel file {scriptout}, finch non uscite da .B Vim. Utile se si vuole creare uno script file da usare con "vim \-s" o ":source!". Se il file {scriptout} esiste, quel che immettete viene aggiunto in fondo. .TP \-W {scriptout} Come \-w, ma uno script file esistente viene sovrascritto. .TP \-x Uso di cifratura nella scrittura dei file. E' necessario immettere una chiave di cifratura. .TP \-X Non connetterti al server X. Vim parte pi rapidamente, ma il titolo della finestra e la clipboard non sono disponibili. .TP \-y Eseguire .B Vim in Modo Easy (semplificata), come se l'eseguibile invocato sia "evim" o "eview". Fa s che .B Vim si comporti come un editor che usa solo il mouse e i caratteri. .TP \-Z Modo ristretto. Vim si comporta come se invocato con un nome che inizia per "r". .TP \-\- Specifica la fine delle opzioni. Argomenti specificati dopo questo sono considerati nomi file. Si pu usare per editare un file il cui nome inizi per '-'. .TP \-\-echo\-wid Solo con GUI GTK: Visualizza Window ID su "stdout". .TP \-\-help Vim d un messaggio ed esce, come con l'argomento "\-h". .TP \-\-literal Considera i nomi passati come argomenti letterali, senza espandere metacaratteri. Non necessario in Unix, la shell espande i metacaratteri. .TP \-\-noplugin Non caricare plugin. Implicito se si specifica \-u NONE. .TP \-\-remote Connettersi a un server Vim e chiedere di editare i file elencati come altri argomenti. Se non si trova un server viene dato un messaggio e i file sono editati nel Vim corrente. .TP \-\-remote\-expr {expr} Connettersi a un server Vim, valutare ivi {expr} e stampare il risultato su "stdout". .TP \-\-remote\-send {chiavi} Connettersi a un server Vim e spedirgli {chiavi}. .TP \-\-remote\-silent Come \-\-remote, ma senza avvisare se non si trova un server. .TP \-\-remote-wait Come \-\-remote, ma Vim non termina finch i file non sono stati editati. .TP \-\-remote\-wait\-silent Come \-\-remote\-wait, ma senza avvisare se non si trova un server. .TP \-\-serverlist Lista i nomi di tutti i server Vim disponibili. .TP \-\-servername {nome} Usa {nome} come nome server. Usato per il Vim corrente, a meno che sia usato con l'argomento \-\-remote, nel qual caso indica il server a cui connettersi. .TP \-\-socketid {id} Solo con GUI GTK: Usa il meccanismo GtkPlug per eseguire gvim in un'altra finestra. .TP \-\-version Stampa la versione di Vim ed esci. .SH AIUTO ONLINE Battere ":help" in .B Vim per iniziare. Battere ":help argomento" per ricevere aiuto su uno specifico argomento. Per esempio: ":help ZZ" per ricevere aiuto sul comando "ZZ". Usare <Tab> e CTRL\-D per completare gli argomenti (":help cmdline\-completion"). Ci sono "tag" nei file di help per saltare da un argomento a un altro (simili a legami ipertestuali, vedere ":help"). Tutti i file di documentazione possono essere navigati cos. Ad es.: ":help syntax.txt". .SH FILE .TP 15 /usr/local/lib/vim/doc/*.txt I file di documentazione di .B Vim . Usate ":help doc\-file\-list" per avere la lista completa. .TP /usr/local/lib/vim/doc/tags Il file di tags usato per trovare informazioni nei file di documentazione. .TP /usr/local/lib/vim/syntax/syntax.vim Inizializzazioni sintattiche a livello di sistema. .TP /usr/local/lib/vim/syntax/*.vim File di colorazione sintattica per vari linguaggi. .TP /usr/local/lib/vim/vimrc Inizializzazioni .B Vim a livello di sistema. .TP ~/.vimrc Le vostre personali inizializzazioni di .B Vim . .TP /usr/local/lib/vim/gvimrc Inizializzazioni gvim a livello di sistema. .TP ~/.gvimrc Le vostre personali inizializzazioni di gvim. .TP /usr/local/lib/vim/optwin.vim Script Vim usato dal comando ":options", un modo semplice per visualizzare e impostare opzioni. .TP /usr/local/lib/vim/menu.vim Inizializzazioni del men gvim a livello di sistema. .TP /usr/local/lib/vim/bugreport.vim Script Vim per generare una segnalazione di errore. Vedere ":help bugs". .TP /usr/local/lib/vim/filetype.vim Script Vim per determinare il tipo di un file a partire dal suo nome. Vedere ":help 'filetype'". .TP /usr/local/lib/vim/scripts.vim Script Vim per determinare il tipo di un file a partire dal suo contenuto. Vedere ":help 'filetype'". .TP /usr/local/lib/vim/print/*.ps File usati per stampa PostScript. .PP Per informazioni aggiornate [in inglese \- NdT] vedere la home page di Vim: .br <URL:http://www.vim.org/> .SH VEDERE ANCHE vimtutor(1) .SH AUTORE Buona parte di .B Vim stato scritto da Bram Moolenaar, con molto aiuto da altri. Vedere ":help credits" in .B Vim. .br .B Vim basato su Stevie, scritto da: Tim Thompson, Tony Andrews e G.R. (Fred) Walter. In verit, poco o nulla rimasto del loro codice originale. .SH BACHI Probabili. Vedere ":help todo" per una lista di problemi noti. .PP Si noti che un certo numero di comportamenti che possono essere considerati errori da qualcuno, sono in effetti causati da una riproduzione fin troppo fedele del comportamento di Vi. Se ritenete che altre cose siano errori "perch Vi si comporta diversamente", date prima un'occhiata al file vi_diff.txt (o battere :help vi_diff.txt da Vim). Date anche un'occhiata alle opzioni 'compatible' e 'cpoptions. �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/vim-it.UTF-8.1�������������������������������������������������������������0000664�0000000�0000000�00000040460�12677030670�0017122�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.TH VIM 1 "22 febbraio 2002" .SH NOME vim \- VI Migliorato, un editor di testi per programmatori .SH SINTASSI .br .B vim [opzioni] [file ..] .br .B vim [opzioni] \- .br .B vim [opzioni] \-t tag .br .B vim [opzioni] \-q [file_errori] .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 DESCRIZIONE .B Vim Un editore di testi, compatibile con, e migliore di, Vi. Può essere usato per editare qualsiasi file di testo. Particolarmente utile per editare programmi. .PP Ci sono parecchi miglioramenti rispetto a Vi: undo multipli, finestre e buffer multipli, evidenziazione sintattica, possibilità di modificare la linea di comando, completamento nomi file, help in linea, selezione testi in Modo Visual, etc.. Vedere ":help vi_diff.txt" per un sommario delle differenze fra .B Vim e Vi. .PP Mentre usate .B Vim potete ricevere molto aiuto dal sistema di help online, col comando ":help". Vedere qui sotto la sezione AIUTO ONLINE. .PP Quasi sempre .B Vim viene invocato, per modificare un file, col comando .PP vim nome_file .PP Più in generale .B Vim viene invocato con: .PP vim [opzioni] [lista_file] .PP Se lista_file non è presente, l'editor inizia aprendo un buffer vuoto. Altrimenti, una e una sola delle quattro maniere indicate qui sotto può essere usata per scegliere uno o più file da modificare. .TP 12 nome_file .. Una lista di nomi di file. Il primo di questi sarà il file corrente, e verrà letto nel buffer. Il cursore sarà posizionato sulla prima linea del buffer. Potete arrivare agli altri file col comando ":next". Per editare un file il cui nome inizia per "\-" premettete "\-\-" alla lista_file. .TP \- Il file da editare è letto dallo "stdin" [di solito, ma non necessariamente, il terminale \- NdT]. I comandi sono letti da "stderr", che dovrebbe essere un terminale [tty]. .TP \-t {tag} Il file da editare e la posizione iniziale del cursore dipendono da "tag", una specie di "etichetta" a cui saltare. {tag} viene cercata nel file "tags", ed il file ad essa associato diventa quello corrente, ed il comando ad essa associato viene eseguito. Di solito si usa per programmi C, nel qual caso {tag} potrebbe essere un nome di funzione. L'effetto è che il file contenente quella funzione diventa il file corrente e il cursore è posizionato all'inizio della funzione. Vedere ":help tag\-commands". .TP \-q [file_errori] Inizia in Modo QuickFix [correzione veloce]. Il file [file_errori] è letto e il primo errore è visualizzato. Se [file_errori] non è indicato, il suo nome è ottenuto dal valore dell'opzione 'errorfile' (che, se non specificata, vale "AztecC.Err" per l'Amiga, "errors.err" su altri sistemi). Si può saltare all'errore successivo col comando ":cn". Vedere ":help quickfix". .PP .B Vim si comporta in modo diverso se invocato con nomi differenti (il programma eseguibile "sottostante" può essere sempre lo stesso). .TP 10 vim Modo Normal, comportamento normale. .TP ex Inizia in Modo "Ex". Si può passare in Modo Normal col comando ":vi". Si può invocare il Modo "Ex" anche con l'argomento "\-e". .TP view Inizia in Modo Read-only (Sola Lettura). Non potete modificare i file. Si può invocare il Modo Read-only anche con l'argomento "\-R". .TP gvim gview La versione GUI [Graphical User Interface]. Apre una nuova finestra. Si può invocare il Modo GUI anche con l'argomento "\-g". .TP evim eview La versione GUI in Modo Easy (semplificata). Apre una nuova finestra. Si può invocare il Modo Easy anche con l'argomento "\-y". .TP rvim rview rgvim rgview Come sopra, ma con restrizioni ai comandi. Non si potranno eseguire comandi della shell o sospendere .B Vim. Si può chiedere la stessa cosa anche con l'argomento "\-Z". .SH OPZIONI Le opzioni possono essere in un ordine qualsiasi, prima o dopo i nomi di file. Opzioni che non necessitano un argomento possono essere specificate dietro a un solo "\-". .TP 12 +[numero] Per il primo file il cursore sarà posizionato sulla linea "numero". Se "numero" manca, il cursore sarà posizionato sull'ultima linea del file. .TP +/{espressione} Per il primo file il cursore sarà posizionato alla prima occorrenza di {espressione}. Vedere ":help search\-pattern" per come specificare l'espressione. .TP +{comando} .TP \-c {comando} {comando} sarà eseguito dopo che il primo file è stato letto. {comando} è interpretato come un comando Ex. Se il {comando} contiene spazi deve essere incluso fra doppi apici (o altro delimitatore, a seconda della shell che si sta usando). Esempio: Vim "+set si" main.c .br Note: Si possono avere fino a 10 comandi "+" o "\-c". .TP \-S {file} I comandi contenuti in {file} sono eseguiti dopo la lettura del primo file. Equivalente a \-c "source {file}". {file} non può avere un nome che inizia per '\-'. Se {file} è omesso si usa "Session.vim" (funziona solo se \-S è l'ultimo argomento specificato). .TP \-\-cmd {comando} Come "\-c", ma il comando è eseguito PRIMA di eseguire qualsiasi file vimrc. Si possono usare fino a 10 di questi comandi, indipendentemente dai comandi "\-c". .TP \-A Se .B Vim è stato compilato con supporto Arabic per editare file con orientamento destra-sinistra e tastiera con mappatura Araba, questa opzione inizia .B Vim in Modo Arabic, cioè impostando 'arabic'. Altrimenti viene dato un messaggio di errore e .B Vim termina in modo anormale. .TP \-b Modo Binary (binario). Vengono impostate alcune opzioni che permettono di modificare un file binario o un programma eseguibile. .TP \-C Compatibile. Imposta l'opzione 'compatible'. In questo modo .B Vim ha quasi lo stesso comportamento di Vi, anche in presenza di un file di configurazione .vimrc [proprio di Vim, vi usa .exrc \- Ndt]. .TP \-d Inizia in Modo Diff [differenze]. Dovrebbero esserci come argomenti due o tre o quattro nomi di file. .B Vim aprirà tutti i file evidenziando le differenze fra gli stessi. Funziona come vimdiff(1). .TP \-d {dispositivo} Apre {dispositivo} per usarlo come terminale. Solo per l'Amiga. Esempio: "\-d con:20/30/600/150". .TP \-D Debugging. Vim si mette in Modo "debugging" a partire dall'esecuzione del primo comando da uno script. .TP \-e Eseguire .B Vim in Modo Ex, come se il programma eseguito sia "ex". .TP \-E Eseguire .B Vim in Modo Ex migliorato, come se il programma eseguito sia "exim". .TP \-f Direttamente [Foreground]. Per la versione GUI, .B Vim non crea [fork] una nuova finestra, indipendente dalla shell di invocazione. Per l'Amiga, .B Vim non è fatto ripartire per aprire una nuova finestra. Opzione da usare quando .B Vim è eseguito da un programma che attende la fine della sessione di edit (ad es. mail). Sull'Amiga i comandi ":sh" e ":!" non sono disponibili. .TP \-\-nofork Direttamente [Foreground]. Per la versione GUI, .B Vim non crea [fork] una nuova finestra, indipendente dalla shell di invocazione. .TP \-F Se .B Vim è stato compilato con supporto FKMAP per editare file con orientamento destra-sinistra e tastiera con mappatura Farsi, questa opzione inizia .B Vim in Modo Farsi, cioè impostando 'fkmap' e 'rightleft'. Altrimenti viene dato un messaggio di errore e .B Vim termina in modo anormale. .TP \-g Se .B Vim è stato compilato con supporto GUI, questa opzione chiede di usarla. Se Vim è stato compilato senza supporto GUI viene dato un messaggio di errore e .B Vim termina in modo anormale. .TP \-h Un po' di aiuto su opzioni e argomenti che si possono dare invocando Vim. Subito dopo .B Vim esce. .TP \-H Se .B Vim è stato compilato col supporto RIGHTLEFT per editare file con orientamento destra-sinistra e tastiera con mappatura Ebraica, questa opzione inizia .B Vim in Modo Ebraico, cioè impostando 'hkmap' e 'rightleft'. Altrimenti viene dato un messaggio di errore e .B Vim termina in modo anormale. .TP \-i {viminfo} Se è abilitato l'uso di un file viminfo, questa opzione indica il nome del file da usare invece di quello predefinito "~/.viminfo". Si può anche evitare l'uso di un file .viminfo, dando come nome "NONE". .TP \-L Equivalente a \-r. .TP \-l Modo Lisp. Imposta le opzioni 'lisp' e 'showmatch'. .TP \-m Inibisce modifica file. Annulla l'opzione 'write'. È ancora possibile modificare un buffer [in memoria \- Ndt], ma non scriverlo. .TP \-M Modifiche non permesse. Le opzioni 'modifiable' e 'write' sono annullate, in modo da impedire sia modifiche che riscritture. Da notare che queste opzioni possono essere abilitate in seguito, permettendo così modifiche. .TP \-N Modo "Non-compatibile". Annulla l'opzione 'compatible'. Così .B Vim va un po' meglio, ma è meno compatibile con Vi, anche in assenza di un file .vimrc. .TP \-n Inibisce l'uso di un file di swap. Il recupero dopo una caduta di macchina diventa impossibile. Utile per editare un file su un supporto molto lento (ad es. floppy). Il comando ":set uc=0" ha lo stesso effetto. Per abilitare il recupero usare ":set uc=200". .TP \-nb Diviene un Editor server per NetBeans. Vedere la documentazione per dettagli. .TP \-o[N] Apri N finestre in orizzontale. Se N manca, apri una finestra per ciascun file. .TP \-O[N] Apri N finestre, in verticale. Se N manca, apri una finestra per ciascun file. .TP \-R Modo Read-only (Sola Lettura). Imposta l'opzione 'readonly'. Si può ancora modificare il buffer, ma siete protetti da una riscrittura involontaria. Se volete davvero riscrivere il file, aggiungete un punto esclamativo al comando Ex, come in ":w!". L'opzione \-R implica anche l'opzione \-n (vedere sotto). L'opzione 'readonly' può essere annullata con ":set noro". Vedere ":help 'readonly'". .TP \-r Lista file di swap, assieme a dati utili per un recupero. .TP \-r {file} Modo Recovery (ripristino). Il file di swap è usato per recuperare una sessione di edit finita male. Il file di swap è un file con lo stesso nome file del file di testo editato, col suffisso ".swp". Vedere ":help recovery". .TP \-s Modo silenzioso. Solo quando invocato come "Ex" o quando l'opzione "\-e" è stata data prima dell'opzione "\-s". .TP \-s {scriptin} Lo script file {scriptin} è letto. I caratteri nel file sono interpretati come se immessi da voi. Lo stesso si può ottenere col comando ":source! {scriptin}". Se la fine del file di input viene raggiunta prima che Vim termini, l'ulteriore input viene preso dalla tastiera. .TP \-T {terminale} Dice a .B Vim quale tipo di terminale state usando. Utile solo se il terminale non viene riconosciuto correttamente da Vim. Dovrebbe essere un terminale noto a .B Vim (internamente) o definito nel file termcap o terminfo. .TP \-u {vimrc} Usa i comandi nel file {vimrc} per inizializzazioni. Tutte le altre inizializzazioni non sono eseguite. Usate questa opzione per editare qualche file di tipo speciale. Può anche essere usato per non fare alcuna inizializzazione dando come nome "NONE". Vedere ":help initialization" da vim per ulteriori dettagli. .TP \-U {gvimrc} Usa i comandi nel file {gvimrc} per inizializzazioni GUI. Tutte le altre inizializzazioni GUI non sono eseguite. Può anche essere usata per non fare alcuna inizializzazione GUI dando come nome "NONE". Vedere ":help gui-init" da vim per ulteriori dettagli. .TP \-V[N] Verboso. Vim manda messaggi relativi agli script file che esegue e quando legge o scrive un file viminfo. Il numero opzionale N è il valore dell'opzione 'verbose'. Il valore predefinito è 10. .TP \-v Inizia .B Vim in Modo Vi, come se il programma eseguibile fosse "vi". Questo ha effetto solo quando Vim viene invocato con il nome "ex". .TP \-w {scriptout} Ogni carattere immesso viene registrato nel file {scriptout}, finché non uscite da .B Vim. Utile se si vuole creare uno script file da usare con "vim \-s" o ":source!". Se il file {scriptout} esiste, quel che immettete viene aggiunto in fondo. .TP \-W {scriptout} Come \-w, ma uno script file esistente viene sovrascritto. .TP \-x Uso di cifratura nella scrittura dei file. E' necessario immettere una chiave di cifratura. .TP \-X Non connetterti al server X. Vim parte più rapidamente, ma il titolo della finestra e la clipboard non sono disponibili. .TP \-y Eseguire .B Vim in Modo Easy (semplificata), come se l'eseguibile invocato sia "evim" o "eview". Fa sì che .B Vim si comporti come un editor che usa solo il mouse e i caratteri. .TP \-Z Modo ristretto. Vim si comporta come se invocato con un nome che inizia per "r". .TP \-\- Specifica la fine delle opzioni. Argomenti specificati dopo questo sono considerati nomi file. Si può usare per editare un file il cui nome inizi per '-'. .TP \-\-echo\-wid Solo con GUI GTK: Visualizza Window ID su "stdout". .TP \-\-help Vim dà un messaggio ed esce, come con l'argomento "\-h". .TP \-\-literal Considera i nomi passati come argomenti letterali, senza espandere metacaratteri. Non necessario in Unix, la shell espande i metacaratteri. .TP \-\-noplugin Non caricare plugin. Implicito se si specifica \-u NONE. .TP \-\-remote Connettersi a un server Vim e chiedere di editare i file elencati come altri argomenti. Se non si trova un server viene dato un messaggio e i file sono editati nel Vim corrente. .TP \-\-remote\-expr {expr} Connettersi a un server Vim, valutare ivi {expr} e stampare il risultato su "stdout". .TP \-\-remote\-send {chiavi} Connettersi a un server Vim e spedirgli {chiavi}. .TP \-\-remote\-silent Come \-\-remote, ma senza avvisare se non si trova un server. .TP \-\-remote-wait Come \-\-remote, ma Vim non termina finché i file non sono stati editati. .TP \-\-remote\-wait\-silent Come \-\-remote\-wait, ma senza avvisare se non si trova un server. .TP \-\-serverlist Lista i nomi di tutti i server Vim disponibili. .TP \-\-servername {nome} Usa {nome} come nome server. Usato per il Vim corrente, a meno che sia usato con l'argomento \-\-remote, nel qual caso indica il server a cui connettersi. .TP \-\-socketid {id} Solo con GUI GTK: Usa il meccanismo GtkPlug per eseguire gvim in un'altra finestra. .TP \-\-version Stampa la versione di Vim ed esci. .SH AIUTO ONLINE Battere ":help" in .B Vim per iniziare. Battere ":help argomento" per ricevere aiuto su uno specifico argomento. Per esempio: ":help ZZ" per ricevere aiuto sul comando "ZZ". Usare <Tab> e CTRL\-D per completare gli argomenti (":help cmdline\-completion"). Ci sono "tag" nei file di help per saltare da un argomento a un altro (simili a legami ipertestuali, vedere ":help"). Tutti i file di documentazione possono essere navigati così. Ad es.: ":help syntax.txt". .SH FILE .TP 15 /usr/local/lib/vim/doc/*.txt I file di documentazione di .B Vim . Usate ":help doc\-file\-list" per avere la lista completa. .TP /usr/local/lib/vim/doc/tags Il file di tags usato per trovare informazioni nei file di documentazione. .TP /usr/local/lib/vim/syntax/syntax.vim Inizializzazioni sintattiche a livello di sistema. .TP /usr/local/lib/vim/syntax/*.vim File di colorazione sintattica per vari linguaggi. .TP /usr/local/lib/vim/vimrc Inizializzazioni .B Vim a livello di sistema. .TP ~/.vimrc Le vostre personali inizializzazioni di .B Vim . .TP /usr/local/lib/vim/gvimrc Inizializzazioni gvim a livello di sistema. .TP ~/.gvimrc Le vostre personali inizializzazioni di gvim. .TP /usr/local/lib/vim/optwin.vim Script Vim usato dal comando ":options", un modo semplice per visualizzare e impostare opzioni. .TP /usr/local/lib/vim/menu.vim Inizializzazioni del menù gvim a livello di sistema. .TP /usr/local/lib/vim/bugreport.vim Script Vim per generare una segnalazione di errore. Vedere ":help bugs". .TP /usr/local/lib/vim/filetype.vim Script Vim per determinare il tipo di un file a partire dal suo nome. Vedere ":help 'filetype'". .TP /usr/local/lib/vim/scripts.vim Script Vim per determinare il tipo di un file a partire dal suo contenuto. Vedere ":help 'filetype'". .TP /usr/local/lib/vim/print/*.ps File usati per stampa PostScript. .PP Per informazioni aggiornate [in inglese \- NdT] vedere la home page di Vim: .br <URL:http://www.vim.org/> .SH VEDERE ANCHE vimtutor(1) .SH AUTORE Buona parte di .B Vim è stato scritto da Bram Moolenaar, con molto aiuto da altri. Vedere ":help credits" in .B Vim. .br .B Vim è basato su Stevie, scritto da: Tim Thompson, Tony Andrews e G.R. (Fred) Walter. In verità, poco o nulla è rimasto del loro codice originale. .SH BACHI Probabili. Vedere ":help todo" per una lista di problemi noti. .PP Si noti che un certo numero di comportamenti che possono essere considerati errori da qualcuno, sono in effetti causati da una riproduzione fin troppo fedele del comportamento di Vi. Se ritenete che altre cose siano errori "perché Vi si comporta diversamente", date prima un'occhiata al file vi_diff.txt (o battere :help vi_diff.txt da Vim). Date anche un'occhiata alle opzioni 'compatible' e 'cpoptions. ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/vim-ja.UTF-8.1�������������������������������������������������������������0000664�0000000�0000000�00000047337�12677030670�0017112�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.TH VIM 1 "2006 Apr 11" .SH 名前 vim \- Vi IMproved, プログラマのテキストエディタ .SH 書式 .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 説明 .B Vim は Vi 互換のテキストエディタです。 どのような種類のプレインテキストでも編集できます。 特に、プログラムの編集に力を発揮します。 .PP Vi に多くの改良が加えられています: 多段アンドゥ、マルチウィンドウ、マルチバッファ、構文強調表示、 コマンドライン編集、ファイル名補完、ヘルプ、ビジュアル選択、などなど。 .B Vim と Vi の違いについての要約は ":help vi_diff.txt" を参照してください。 .PP .B Vim の実行中は ":help" コマンドでヘルプを引くことができます。 下記、オンラインヘルプの項を参照してください。 .PP .B Vim は次のようなコマンドで起動できます。 .PP vim file .PP 正確な書式は次の通りです: .PP vim [options] [filelist] .PP filelist を省略した場合は、空のバッファが開かれます。 指定した場合は、以下の四つのうちどれか一つの方法でファイルが開かれます。 .TP 12 file .. ファイルのリスト。 一番目のファイルがカレントファイルになり、バッファに読み込まれます。 カーソルは、バッファの一行目に置かれます。 他のファイルを表示するには ":next" コマンドを使ってください。 ファイル名がダッシュで始まるファイルを開く場合は、 filelist の前に "\-\-" を指定してください。 .TP \- ファイルは標準入力から読み込まれます。コマンドは標準エラー (ttyからの入 力になっているはず) から読み込まれます。 .TP \-t {tag} 開くファイルとカーソルの初期位置は "tag" に依存します。goto label の一種です。 tags ファイルから {tag} が検索され、関連したファイルがカレントファイルになり ます。そして、関連したコマンドが実行されます。 これは主に C 言語のファイルを開くときに使われます。その場合 {tag} に関数など を指定して使います。 関数を含んでいるファイルが開かれ、その関数の先頭にカーソルが移動する、 という動作になります。 詳しくは ":help tag\-commands" を参照してください。 .TP \-q [errorfile] クイックフィックスモードで起動します。 [errorfile] に指定したファイルが読み込まれ、最初のエラーが表示されます。 [errorfile] を省略した場合は、オプション 'errorfile' が使われます (初期設定 は、Amiga では "AztecC.Err"、その他のシステムでは "errors.err" です)。 ":cn" コマンドで次のエラーにジャンプできます。 詳しくは ":help quickfix" を参照してください。 .PP .B Vim は、起動されたときの実行ファイルの名前によって動作を変えます (実行ファイルの実体が同じであっても)。 .TP 10 vim "普通" に起動します。標準の状態です。 .TP ex Ex モードで起動します。 ノーマルモードに切り替えるには ":vi" コマンドを使ってください。 引数に "\-e" を指定した場合と同じです。 .TP view 読み込み専用モードで起動します。ファイルの保存が制限されます。 引数に "\-R" を指定した場合と同じです。 .TP gvim gview GUI バージョン。 新しいウィンドウを開いて起動します。 引数に "\-g" を指定した場合と同じです。 .TP evim eview 簡易モードの GUI バージョン。 新しいウィンドウを開いて起動します。 引数に "\-y" を指定した場合と同じです。 .TP rvim rview rgvim rgview 上記と同じですが、制限モードで起動します。シェルコマンドを実行したり、 .B Vim をサスペンドしたりできなくなります。 引数に "\-Z" を指定した場合と同じです。 .SH オプション ファイル名の前でも後ろでも、好きな順番でオプションを指定できます。 パラメータを必要としない引数は、一つのダッシュにまとめて指定できます。 .TP 12 +[num] 一番目のファイルの "num" 行目にカーソルを移動します。 "num" を省略した場合は、一行目にカーソルが移動します。 .TP +/{pat} 一番目のファイルの、最初に {pat} が見つかった行にカーソルが移動します。 検索パターンについては ":help search\-pattern" を参照してください。 .TP +{command} .TP \-c {command} 一番目のファイルが読み込まれた後に {command} が実行されます。 {command} は Ex コマンドとして解釈されます。 {command} に空白を含める場合は、ダブルクォートで囲んでください (シェルに依存)。 例: vim "+set si" main.c .br Note: "+" と "\-c" は合わせて 10 個まで指定できます。 .TP \-S {file} 一番目のファイルが読み込まれた後に {file} が実行されます。 これは \-c "source {file}" と同じ動作です。 {file} の先頭が '\-' の場合は使えません。 {file} が省略された場合は、"Session.vim" が使われます (ただし \-S が最後の引 数だった場合のみ)。 .TP \-\-cmd {command} "\-c" と同じですが、vimrc を処理する前にコマンドが実行されます。 これらのコマンドは "\-c" コマンドとは別に、10 個まで指定できます。 .TP \-A アラビア語がサポートされていて、アラビア語キーマップがある場合は、 アラビア語モードで起動します ('arabic' がオンになります)。 右横書きのファイルを編集できます。 サポートされていない場合はエラーメッセージを表示して終了します。 .TP \-b バイナリモード。 バイナリファイルを編集するためのオプションがいくつか設定されます。 .TP \-C 互換モード。'compatible' オプションがオンになります。 .vimrc ファイルの有無に関わらず、 .B Vim の動作が Vi 互換になります。 .TP \-d 差分モードで起動します。 二つか三つの四つのファイルを引数に指定してください。 指定されたファイルが開かれ、それらのファイルの差分が表示されます。 vimdiff(1) と同様の動作です。 .TP \-d {device} {device} を端末として開きます。 Amiga でのみ使います。 例: "\-d con:20/30/600/150". .TP \-D デバッグ。スクリプトの最初のコマンドが実行されるところからデバッグモードを開 始します。 .TP \-e Ex モードで起動します。 実行ファイルの名前が "ex" の場合と同じです。 .TP \-E 改良版 Ex モードで起動します。 実行ファイルの名前が "exim" の場合と同じです。 .TP \-f フォアグラウンド。GUI バージョンで、プロセスをフォークしなくなります。 Amiga の場合は、新しいウィンドウで再起動しなくなります。 メールソフトなどから .B Vim を起動して、編集が終わるまで待機したいような場合に使ってください。 Amiga では、":sh" と "!" コマンドは機能しなくなります。 .TP \-\-nofork フォアグラウンド。GUI バージョンで、プロセスをフォークしなくなります。 .TP \-F ペルシア語がサポートされていて、ペルシア語キーマップがある場合は、 ペルシア語モードで起動します ('fkmap' と 'rightleft' がオンになります)。 右横書きのファイルを編集できます。 サポートされていない場合はエラーメッセージを表示して終了します。 .TP \-g GUI がサポートされている場合は、GUI で起動します。 サポートされていない場合はエラーメッセージを表示して終了します。 .TP \-h コマンドライン引数やオプションのヘルプを表示して終了します。 .TP \-H ヘブライ語がサポートされていて、ヘブライ語キーマップがある場合は、 ヘブライ語モードで起動します ('hkmap' と 'rightleft' がオンになります)。 右横書きのファイルを編集できます。 サポートされていない場合はエラーメッセージを表示して終了します。 .TP \-i {viminfo} viminfo ファイルを使う設定になっている場合は、初期設定の "~/.viminfo" の代わ りに、指定されたファイルを設定します。 "NONE" を指定すると、.viminfo ファイルを使わないように設定できます。 .TP \-L \-r と同じです。 .TP \-l lisp モード。 オプションの 'lisp' と 'showmatch' がオンになります。 .TP \-m ファイルの変更を不可能にします。 オプション 'write' がオフになります。 バッファを変更することはできますが、ファイルを保存することはできません。 .TP \-M 変更を不可能にします。オプションの 'modifiable' と 'write' がオフになり、 ファイルの変更と保存ができなくなります。 Note: それらのオプションを設定すれば変更できるようになります。 .TP \-N 非互換モード。'compatible' オプションがオフになります。 .vimrc ファイルの有無に関わらず、 .B Vim の改良された機能が有効になります。Vi との互換性が少し失われます。 .TP \-n スワップファイルを使用しません。 クラッシュしてもリカバリできなくなります。 フロッピーディスクのような非常に低速なメディアのファイルを読み書きするときに 便利です。 ":set uc=0" と設定しても同じです。 戻すには ":set uc=200" と設定してください。 .TP \-nb NetBeans と接続し、エディタサーバーになります。 詳しくはヘルプを参照してください。 .TP \-o[N] N 個のウィンドウを水平分割で開きます。 N を省略した場合は、引数のファイルを個別のウィンドウで開きます。 .TP \-O[N] N 個のウィンドウを垂直分割で開きます。 N を省略した場合は、引数のファイルを個別のウィンドウで開きます。 .TP \-p[N] N 個のタブページを開きます。 N を省略した場合は、引数のファイルを個別のタブページで開きます。 .TP \-R 読み込み専用モード。 オプション 'readonly' がオンになります。 バッファを変更することはできますが、間違ってファイルを上書きしてしまうのを防 ぐことができます。 ファイルを保存したい場合は、":w!" のように、Ex コマンドに感嘆符を付けてくだ さい。 \-R オプションは \-n オプションの効果も含んでいます (下記参照)。 オプション 'readonly' は ":set noro" でオフにできます。 詳しくは ":help 'readonly'" を参照してください。 .TP \-r スワップファイルの一覧を表示します。リカバリに関する情報も表示されます。 .TP \-r {file} リカバリモード。 スワップファイルを使って、クラッシュした編集セッションを復活させます。 スワップファイルは、ファイル名に ".swp" を加えた名前のファイルです。 詳しくは ":help recovery" を参照してください。 .TP \-s サイレントモード。"ex" という名前で起動するか、"\-e" オプションの後で "\-s" オプションが指定された場合のみ。 .TP \-s {scriptin} {scriptin} をスクリプトファイルとして読み込まれます。 ファイル中の文字列は、手で入力したときと同じように処理されます。 これは ":source! {scriptin}" と同じ動作です。 エディタが終了する前にファイルの終わりまで読み込んだ場合、 それ以降はキーボードから入力を読み込みます。 .TP \-T {terminal} 端末の名前を指定します。 端末が自動的に認識されない場合に使ってください。 Vim が組み込みでサポートしている名前か、 termcap または terminfo ファイルで定義されている名前を指定してください。 .TP \-u {vimrc} {vimrc} ファイルを使って初期化します。 他の初期化処理はスキップされます。 特殊なファイルを編集する場合などに使ってください。 すべての初期化をスキップするには "NONE" を指定してください。 詳しくは ":help initialization" を参照してください。 .TP \-U {gvimrc} {gvimrc} ファイルを使って GUI を初期化します。 他の GUI の初期化はスキップされます。 すべての GUI の初期化をスキップするには "NONE" を指定してください。 詳しくは ":help gui\-init" を参照してください。 .TP \-V[N] 冗長モード。スクリプトファイルを実行したり viminfo ファイルを読み書きするた びにメッセージを表示します。N に指定した数値が 'verbose' に設定されます。 省略した場合は 10 になります。 .TP \-v Vi モードで起動します。 実行ファイルの名前が "vi" の場合と同じです。 実行ファイルの名前が "ex" の場合だけ効果があります。 .TP \-w {scriptout} 入力した文字を {scriptout} に記録します。 "vim \-s" や "source!" で実行するためのスクリプトファイルを作成するのに便利 です。 {scriptout} ファイルがすでに存在した場合は追加保存されます。 .TP \-W {scriptout} \-w と同じですが、ファイルがすでに存在した場合は上書きされます。 .TP \-x ファイルを暗号化して書き込みます。暗号化キーの入力プロンプトが表示されます。 .TP \-X X サーバーと通信しません。端末での起動時間を短くできます。 しかし、ウィンドウタイトルの変更やクリップボードは使えなくなります。 .TP \-y 簡易モードで起動します。 実行ファイルの名前が "evim" や "eview" の場合と同じです。 .B Vim の動作がモードレスエディタ (click-and-type editor) のようになります。 .TP \-Z 制限モード。 実行ファイルの名前が "r" で始まっている場合と同じです。 .TP \-\- オプション指定の末尾を示す記号です。 これ以降の引数はすべてファイル名として扱われます。 ファイル名が '\-' で始まっているファイルを開くときに使ってください。 .TP \-\-echo\-wid GTK GUI のみ: Window ID を標準出力に出力します。 .TP \-\-help ヘルプを表示して終了します。"\-h" と同じです。 .TP \-\-literal 引数のファイル名をリテラル文字列として扱います。ワイルドカードを展開しませ ん。Unix のように、シェルがワイルドカードを展開する場合は機能しません。 .TP \-\-noplugin プラグインをロードしません。\-u NONE はこの動作を含んでいます。 .TP \-\-remote Vim サーバーと通信し、引数に指定されたファイルを Vim サーバーで開きます。 サーバーが存在しない場合は、エラーメッセージを表示され、起動中の Vim でファ イルが開かれます。 .TP \-\-remote\-expr {expr} Vim サーバーと通信し、{expr} に与えられた式を Vim サーバーで実行し、結果を標 準出力に出力します。 .TP \-\-remote\-send {keys} Vim サーバーと通信し、{keys} に与えられたキーを Vim サーバーに送信します。 .TP \-\-remote\-silent \-\-remote と同じですが、サーバーが存在しなくてもエラーメッセージを表示しま せん。 .TP \-\-remote\-wait \-\-remote と同じですが、ファイルが開かれるのを確認できるまで待機します。 .TP \-\-remote\-wait\-silent \-\-remote\-wait と同じですが、サーバーが存在しなくてもエラーメッセージを表 示しません。 .TP \-\-serverlist Vim サーバーの一覧を表示します。 .TP \-\-servername {name} サーバーの名前を {name} に設定します。\-\-remote 引数を指定しなかった場合 は、起動中の Vim の名前として使われるので、後からその名前を使ってサーバー通 信できます。 .TP \-\-socketid {id} GTK GUI のみ: GtkPlug メカニズムを使って gvim を別のウィンドウの中で実行しま す。 .TP \-\-version バージョン情報を表示して終了します。 .SH オンラインヘルプ ヘルプを開くには、 .B Vim の中で ":help" と入力してください。 ":help 調べたい項目" と入力すれば、指定した項目のヘルプが表示されます。 例: "ZZ" コマンドのヘルプを表示するには ":help ZZ" と入力します。 <Tab> や CTRL\-D を使って補完することもできます (":help cmdline\-completion" 参照)。 ヘルプには、項目から項目へジャンプできるようにタグが埋め込まれています (ハイパーリンクのようなものです。":help" 参照)。 すべてのヘルプファイルはこの方法で開くことができます。 例: ":help syntax.txt"。 .SH ファイル .TP 15 /usr/local/lib/vim/doc/*.txt .B Vim のヘルプファイル。 ファイルの一覧は ":help doc\-file\-list" に記載されています。 .TP /usr/local/lib/vim/doc/tags ヘルプを検索するための tags ファイル。 .TP /usr/local/lib/vim/syntax/syntax.vim システムの構文定義初期化ファイル。 .TP /usr/local/lib/vim/syntax/*.vim いろいろな言語用の構文定義ファイル。 .TP /usr/local/lib/vim/vimrc システムの .B Vim 初期化ファイル。 .TP ~/.vimrc ユーザーの .B Vim 初期化ファイル。 .TP /usr/local/lib/vim/gvimrc システムの gvim 初期化ファイル。 .TP ~/.gvimrc ユーザーの gvim 初期化ファイル。 .TP /usr/local/lib/vim/optwin.vim ":options" コマンドで使われるファイル。オプションを表示したり設定したりでき ます。 .TP /usr/local/lib/vim/menu.vim システムのメニュー初期化ファイル。gvim で使います。 .TP /usr/local/lib/vim/bugreport.vim バグレポートを生成するスクリプト。":help bugs" 参照。 .TP /usr/local/lib/vim/filetype.vim ファイル名からファイルタイプを判定するスクリプト。":help 'filetype'" 参照。 .TP /usr/local/lib/vim/scripts.vim ファイルの内容からファイルタイプを判定するスクリプト。":help 'filetype'" 参照。 .TP /usr/local/lib/vim/print/*.ps PostScript 印刷に使われるファイル。 .PP 最新の情報は VIM のホームページを参照してください: .br <URL:http://www.vim.org/> .SH 関連項目 vimtutor(1) .SH 著者 .B Vim のほとんどの機能は Bram Moolenaar が開発し、多くの人が協力しました。 ":help credits" を参照してください。 .br .B Vim は Stevie を基にしています。Stevie は Tim Thompson、Tony Andrews、 G.R. (Fred) Walter によって開発されました。 ただし、オリジナルのコードはもうほとんど残っていません。 .SH バグ 既知のバグは ":help todo" に記載されています。 .PP Vi の動作を忠実に再現した結果、多くの人がバグだと思うような機能もいくつかあ ります。 "この動作は Vi と違う" からバグだと思った場合は、vi_diff.txtを確認してみてく ださい (ファイルを開くか、Vim から ":help vi_diff.txt" と入力)。 オプションの 'compatible' と 'cpoptions' も確認してください。 �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/vim-pl.1�������������������������������������������������������������������0000664�0000000�0000000�00000036242�12677030670�0016322�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.TH VIM 1 "2006 kwi 11" .SH NAME vim \- Vi rozbudowany, edytor tekstu dla programisty .SH SYNOPSIS .br .B vim [opcje] [plik ..] .br .B vim [opcje] \- .br .B vim [opcje] \-t znacznik .br .B vim [opcje] \-q [plik_bdu] .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 OPIS .B Vim jest edytorem tekstu kompatybilnym z Vi. Moe by uywany do edycji wszelkiego rodzaju plikw tekstowych. Uyteczny zwaszcza przy edycji programw. .PP Posiada wiele usprawnie w porwnaniu z Vi: wielopoziomowe cofanie zmian, wiele okien i buforw, podwietlanie skadni, edycja linii polece, uzupenianie nazw plikw, pomoc on-line, wizualna selekcja, itd. Zobacz ":help vi_diff.txt" dla podsumowania rnic pomidzy .B Vimem i Vi. .PP W czasie korzystania z .B Vima mona uzyska obszern pomoc z systemu pomocy on-line dziki poleceniu ":help". Zobacz rozdzia POMOC ON-LINE poniej. .PP Najczciej .B Vim jest uruchamiany do edycji pojedynczego pliku poleceniem .PP vim plik .PP Bardziej oglnie .B Vim jest uruchamiany poprzez: .PP vim [opcje] [lista plikw] .PP Jeli brak listy plikw edytor rozpocznie z pustym buforem. W innym wypadku istnieje dokadnie jedna z czterech moliwoci by wybra jeden lub wicej plikw do edycji. .TP 12 plik .. Lista nazw plikw. Pierwsza nazwa bdzie nazw biecego pliku, ktry zostanie wczytany do bufora. Kursor zostanie umieszczony w pierwszym wierszu. Do kolejnych plikw mona przej dziki poleceniu ":next". By otworzy plik, ktrego nazwa zaczyna si od mylnika naley list plikw poprzedzi "\-\-". .TP \- Plik do edycji jest wczytany ze standardowego wejcia. Polecenia s odczytywane ze standardowego wyjcia bdw, ktrym powinien by terminal (tty). .TP \-t {znacznik} Plik do edycji i pocztkowa pozycja kursora zaley od "znacznika", rodzaju etykiety goto. {znacznika} szuka si w pliku tags, zwizany z nim plik staje si plikiem biecym i wykonuje si powizane polecenie. Zazwyczaj uywa si tego sposobu dla programw w C, w ktrych wypadku {znacznik} moe by nazw funkcji. W efekcie plik zawierajcy okrelon funkcj staje si plikiem biecym a kursor jest umieszczony na pocztku funkcji. Zobacz ":help tag-commands". .TP \-q [plik_bdw] Zacznij w trybie quickFix. Plik [plik_bdw] zostaje zinterpretowany i pokae si pierwszy bd. Jeli brak opcji [plik_bdw] nazwa pliku zostanie pobrana z opcji \&'errorfile' (domylnie "AztecC.Err" dla Amigi, "errros.err" dla innych systemw. Do kolejnych bdw mona przeskoczy dziki poleceniu ":cn". Zobacz ":help quickfix". .PP W zalenoci od wywoania .B Vim zachowuje si inaczej (program moe by cay czas tym samym plikiem). .TP 10 vim "Normalny" sposb, wszystko jest domylne. .TP ex Zacznij w trybie Ex. Przejd do trybu Normalnego poleceniem ":vi". Mona take uruchomi poprzez argument "\-e". .TP view Zacznij w trybie tylko do odczytu. W ten sposb bdziesz chroniony przed zapisywaniem pliku. Mona take uruchomi poprzez argument "\-R". .TP gvim gview Wersja GUI. Uruchamia nowe okno. Mona take uruchomi poprzez argument "\-g". .TP evim eview Wersja GUI w atwym trybie. Uruchamia nowe okno. Mona take uruchomi poprzez argument "\-y". .TP rvim rview rgvim rgview Podobnie jak powyej, ale z ograniczeniami. Nie bdzie mona uruchomi polece powoki lub zawiesi .B Vima. Mona take uruchomi poprzez argument "\-Z". .SH OPCJE Opcje mona poda w dowolnej kolejnoci, przed lub po nazwach plikw. Opcje bez argumentw mona czy po pojedynczym mylniku. .TP 12 +[num] W pierwszym pliku kursor zostanie umieszczony w wierszu "num". Jeli brak "num" kursor zostanie umieszczony w ostatnim wierszu. .TP +/{wzr} W pierwszym pliku kursor zostanie umieszczony na pierwszym wystpieniu {wzr}. Zobacz ":help search-pattern" by dowiedzie si jakie s moliwe wzorce wyszukiwania. .TP +{polecenie} .TP \-c {polecenie} {polecenie} zostanie wykonane po tym jak wczyta si pierwszy plik. {polecenie} jest interpretowane jako polecenie Ex. Jeli {poleceni} zawiera biae znaki musi by umieszczone w podwjnych cudzysowach (zaley to od uywanej powoki). Przykad: Vim "+set si" main.c .br Uwaga: Mona uy do 10 polece "+" lub "\-c". .TP \-S {plik} {plik} zostanie zinterpretowany po wczytaniu pierwszego pliku. Jest rwnowane \-c "source {plik}". {plik} nie moe zaczyna si '\-'. Jeli nie podano {plik} zostanie uyty "Session.vim" (dziaa tylko wtedy jeli \-S jest ostatnim argumentem). .TP \-\-cmd {polecenie} Podobne do "\-c", ale polecenie jest wykonywane tu przed interpretacj jakiegokolwiek pliku vimrc. Mona uy do 10 takich polece, niezalenie od polece od "\-c" .TP \-A Jeli .B Vim zosta skompilowany ze wsparciem dla jzykw arabskich (edycja od prawej do lewej i arabska mapa klawiatury) ta opcja uruchamia .B Vima w trybie arabskim, np. ustawia si opcja 'arabic'. W innym wypadku pojawi si komunikat bdu i .B Vim zakoczy dziaanie. .TP \-b Tryb binarny. Ustawi si kilka opcji, ktre umoliwi edycj plikw binarnych lub wykonywalnych. .TP \-C Kompatybilny. Ustawia opcj 'compatible'. W ten sposb .B Vim bdzie zachowywa si jak Vi, nawet jeli istnieje plik .vimrc. .TP \-d Uruchom w trybie diff. Powinno si uy dwch, trzech lub czterech nazwy plikw jako argumentw. .B Vim otworzy wszystkie te pliki i pokae rnice midzy nimi. Dziaa jak vimdiff(1). .TP \-d {urzdzenie} Otwrz {urzdzenie} by uywa jako terminal. Tylko na Amidze. Przykad: "\-d con:20/30/600/150". .TP \-D Debugowanie. Przejd do trybu debugowanie wykonujc pierwsze polecenie ze skryptu. .TP \-e Uruchom .B Vima w trybie Ex, dziaa tak samo jakby wywoano program jako "ex". .TP \-E Uruchom .B Vima w ulepszonym trybie Ex, dziaa tak samo jakby wywoano program jako "exim". .TP \-f Pierszy plan. Dla wersji GUI. .B Vim nie nie oddzieli si od powoki w jakiej zosta uruchomiony. Na Amidze .B Vim nie jest uruchomiony ponownie by otworzy nowe okno. Opcja powinna by uyta kiedy .B Vim jest wywoywany przez program, ktry ma zaczeka na koniec sesji (np. mail). Na Amidze polecenia ":sh" i ":!" nie bd dziaa. .TP \-\-nofork Pierwszy plan. Dla wersji GUI. .B Vim nie oddzieli si od powoki w jakiej zosta uruchomiony. .TP \-F Jeli Vim zosta skompilowany ze wsparciem FKMAP dla edycji tekstw od prawej do lewej i mapowania klawiatury Farsi, ta opcja uruchomi .B Vima w trybie Farsi, np. zostawi ustawione opcje 'fkmap' i 'rightleft'. W innym wypadku pojawi si komunikat bdu i .B Vim zakoczy dziaanie. .TP \-g Jeli .B Vim zosta skompilowany ze wsparciem dla GUI ta opcja uruchomi GUI. W innym wypadku pojawi si komunikat bdu i .B Vim zakoczy dziaanie. .TP \-h Wywietli krtk pomoc o argumentach linii polece i opcjach. Potem .B Vim zakoczy dziaanie. .TP \-H Jeli .B Vim zosta skompilowany ze wsparciem RIGHTLEFT dla edycji od prawej do lewej oraz ma mapowanie klawiatury dla hebrajskiego, ta opcja uruchomi .B Vima w trybie hebrajskim, np. ustawi opcje 'hkmap' i 'rightleft'. W innym wypadku pojawi si komunikat bdu i .B Vim zakoczy dziaanie. .TP \-i {viminfo} Kiedy .B Vim uywa pliku viminfo ta opcja wskae jakiego pliku uy zamiast domylnego "~/.viminfo". Mona te omin uycie pliku .viminfo przez podanie nazwy "NONE". .TP \-L To samo co \-r. .TP \-l Tryb Lisp. Ustawia opcje 'lisp' i 'showmatch'. .TP \-m Zmiana pliku jest niemoliwa. Przestawia opcj 'write'. Mona zmienia zawarto bufora, ale zapisanie pliku nie jest moliwe. .TP \-M Opcje 'modifiable' i 'write' zostan wyczone, tak wic zmiany w pliku oraz ich zapisanie nie s moliwe. Warto tych opcji mona zmieni. .TP \-N Tryb niekompatybilny. Przestawia opcj 'compatible'. Dziki temu .B Vim bdzie zachowywa si odrobin lepiej, ale mniej zgodnie z Vi nawet jeli nie istnieje plik .vimrc. .TP \-n Nie powstanie plik wymiany. Odzyskanie pliku po wypadku nie bdzie moliwe. Wygodne jeli instnieje potrzeba edycji na bardzo wolnym medium (np. dyskietce). Ten cel mona osign take przez ":set uc=0". Mona odwrci przez ":set uc=200". .TP \-nb Uruchom jako serwer edytora dla NetBeans. Zobacz dokumentacj by dowiedzie si wicej. .TP \-o[N] Otwrz N okien w stosie. Kiedy brak N, otwrz jedno okno dla kadego pliku. .TP \-O[N] Otwrz N okien obok siebie. Kiedy brak N, otwrz jedno okno dla kadego pliku. .TP \-p[N] Otwrz N kart. Kiedy brak N, otwrz jedn kart dla kadego pliku. .TP \-R Tryb tylko do odczytu. Zostanie ustawiona opcja 'readonly'. Cay czas mona zmienia bufor, ale bdzie istniaa blokada by chroni przed przypadkowym zapisaniem pliku. Jeli chcesz zapisa plik dodaj wykrzyknik do polecenia Ex, np. ":w!". Opcja \-R implikuje opcj \-n (zobacz poniej). Opcja 'readonly' moe zosta przestawiona poprzez ":set noro". Zobacz ":help 'readonly'". .TP \-r Wypisz list plikw wymiany razem z informacjami o nich. .TP \-r {plik} Tryb odzyskiwania danych. Plik wymiany zostanie wykorzystany do odzyskania gwatownie przerwanej sesji. Plik wymiany to plik z tak sam nazw co plik oryginalny z dodanym ".swp". Zobacz ":help recovery". .TP \-s Tryb cichy. Rozpoczty tylko kiedy uruchomiony jako "Ex" lub opcja "\-e" zostaa podana przed opcj "\-s". .TP \-s {skrypt} Zostanie wczytany plik {skrypt}. Znaki w pliku zostan zinterpretowane jakby byy wpisywane. To samo mona osign poprzez polecenie ":source! {skrypt}". Jeli osignito koniec pliku zanim edytor zakoczy dziaanie, dalsze znaki odczytywane s z klawiatury. .TP \-T {terminal} Przekazuje .B Vimowi nazw terminalu jakiego uywasz. Wymagane tylko wtedy jeli nie dziaa automatycznie. Powinien by to terminal znany .B Vimowi (builtin) lub zdefiniowany w plikach termcap lub terminfo. .TP \-u {vimrc} Uyj polece z pliku {vimrc} w czasie uruchamiania. Wszystkie inne moliwe pliki uruchamiania zostan pominite. Uywaj do edytowania plikw specjalnych. Mona pomin take wszystkie moliwe pliki uruchamiania poprzez podanie nazwy "NONE". Zobacz ":help initialization" by pozna wicej szczegw. .TP \-U {gvimrc} Uyj polece z pliku {gvimrc} w czasie uruchamiania GUI. Wszystkie inne moliwe pliki uruchamiania GUI zostan pominite. Mona pomin take wszystkie moliwe pliki uruchamiania GUI poprzez podanie nazwy "NONE". Zobacz ":help gui-init" by pozna wicej szczegw. .TP \-V[N] Tryb gadatliwy. Wypisz wiadomoci o tym jaki pliki s wczytywane i o informacjach pobieranych i dodawanych do pliku viminfo. Opcjonalny argument N jest wartoci 'verbose'. Domylnie 10. .TP \-v Uruchom .B Vima w trybie Vi, tak jakby program by nazwany "vi". Ma znaczenie tylko wtedy jeli program nazwany jest "ex". .TP \-w {plik} Wszystkie wcinicia klawiszy, a do zakoczenia dziaania programu, s zapisywane w {plik} . Uyteczne jeli chce si stworzy skrypt do uycia z "vim \-s" lub ":source!". Jeli {plik} istnieje, znaki s dopisywane. .TP \-W {plik} Podobnie do \-w, ale istniejcy plik jest nadpisywany. .TP \-x Uyj szyfrowania podczas zapisywania plikw. Zostaniesz poproszony o podanie klucza. .TP \-X Nie cz z serwerem X. Skraca czas uruchamiania w terminalu, ale tytu okna i schowek nie bd wykorzystywane. .TP \-y Uruchom .B Vima w atwym trybie, tak jakby program zosta wywoany "evim" lub "eview". .B Vim bdzie zachowywa si bardziej jak edytor kliknij-i-wpisz. .TP \-Z Tryb ograniczony. Zachowuje si jakby nazwa programu zaczynaa si od "r". .TP \-\- Oznacza koniec opcji. Argumenty po tej opcji bd traktowane jak nazwy plikw. Uywa si do otwierania plikw, ktrych nazwy zaczynaj si od '\-'. .TP \-\-echo\-wid Wycznie GTK GUI: wypisz ID okna na standardowe wyjcie. .TP \-\-help Wywietl informacj o pomocy i zakoczy, to samo co"\-h". .TP \-\-literal Potraktuj nazwy plikw dosownie i nie rozwizuj kwantyfikatorw. Nie ma znaczenia na Uniksach gdzie powoka rozwizuje kwantyfikatory. .TP \-\-noplugin Pomi adowanie wtyczek. Implikowane przy \-u NONE. .TP \-\-remote Pocz si z serwerem Vima i edytuj w nim reszt plikw podanych jako argumenty. Jeli nie znaleziono serwera zostanie zgoszony bd a pliki zostan otwarte w biecym Vimie. .TP \-\-remote\-expr {wyraenie} Pocz z serwerem Vima, rozwi w nim {wyraenie} i wypisz rozwizanie na standardowe wyjcie. .TP \-\-remote\-send {klawisze} Pocz z serwerem Vima i wylij do niego {klawisze}. .TP \-\-remote\-silent Tak samo jak \-remote, ale bez ostrzeenia kiedy nie znaleziono serwera. .TP \-\-remote\-wait Tak samo jak \-remote, ale Vim nie zakoczy dopki pliki pozostan otwarte. .TP \-\-remote\-wait\-silent Tak samo jak \-\-remote\-wait, ale bez ostrzeenie kiedy nie znaleziono serwera. .TP \-\-serverlist Wypisz nazwy wszystkich serwerw Vima jakie mona znale. .TP \-\-servername {nazwa} Uyj {nazwa} jako nazwy serwera. Wykorzystane dla biecego Vima o ile nie poczone z argumentem \-\-remote, wtedy jest to nazwa serwera do poczenia. .TP \-\-socketid {id} Wycznie GTK GUI: Uyj mechanizmu GtkPlug by uruchomi gvima w innym oknie. .TP \-\-version Wypisz informacj o wersji i zakocz. .SH POMOC ON-LINE By rozpocz wpisz ":help" w .B Vimie Wpisz ":help temat" by uzyska pomoc na okrelony temat. Przykad: ":help ZZ" by uzyska pomoc na temat polecenia "ZZ". Uyj <Tab> i CTRL\-D aby uzupeni tematy (":help cmdline\-completion"). W plikach pomocy istniej znaczniki by uatwi skakanie z jednego miejsca do innego (rodzaj linkw hipertekstowych, zobacz ":help"). Mona w ten sposb zobaczy ca dokumentacj, np. ":help syntax.txt". .SH PLIKI .TP 15 /usr/local/lib/vim/doc/*.txt Dokumentacja .B Vima Uyj ":help doc\-file\-list" aby uzyska pen list. .TP /usr/local/lib/vim/doc/tags Plik znacznikw suy do znajdowania informacji w plikach dokumentacji. .TP /usr/local/lib/vim/syntax/syntax.vim Globalne uruchamianie podwietlania skadni. .TP /usr/local/lib/vim/syntax/*.vim Pliki skadni dla rnych jzykw. .TP /usr/local/lib/vim/vimrc Globalny plik uruchamiania .B Vima .TP ~/.vimrc Osobiste parametry uruchamiania .B Vima .TP /usr/local/lib/vim/gvimrc Globalne uruchamianie gvima. .TP ~/.gvimrc Osobiste parametry uruchamiania gvima. .TP /usr/local/lib/vim/optwin.vim Skrypt uywany w poleceniu ":options", dobry sposb do przegldania i ustawiania opcji. .TP /usr/local/lib/vim/menu.vim Globalne uruchamianie menu gvima. .TP /usr/local/lib/vim/bugreport.vim Skrypt sucy do tworzenia raportw o bdach. Zobacz ":help bugs". .TP /usr/local/lib/vim/filetype.vim Skrypt do wykrywania typu pliku wedug jego nazwy. Zobacz ":help 'filetype'". .TP /usr/local/lib/vim/scripts.vim Skrypt do wykrywania typu pliku wedug jego zawartoci. Zobacz ":help 'filetype'". .TP /usr/local/lib/vim/print/*.ps Pliku uywane do drukowania PostScriptu. .PP Najwiesze wiadomoci na stronie .B Vima: .br <URL:http://www.vim.org/> .SH ZOBACZ TAKE vimtutor(1) .SH AUTOR .B Vim zosta napisany przez Brama Moolenaara z du pomoc innych osb. Zobacz ":help credits" w .B Vimie. .br .B Vim bazuje na Steviem, nad ktrym pracowali: Tim Thompson, Tony Andrews i G.R. (Fred) Walter. Mao ju zostao z oryginalnego kodu. .SH BDY Prawdopodobne. Zobacz ":help todo" by pozna list znanych problemw. .PP Pamitaj e pewna ilo problemw, ktre mog by uznawane przez niektrych ludzi za bdy s w rzeczywistoci spowodowane wiernoci w odtwarzaniu zachowania Vi. Jeli sdzisz, e inne rzeczy s bdami "poniewa Vi robi to inaczej", powiniene przyjrze si bliej plikowi vi_diff.txt (lub wpisa ":help vi_diff.txt" w Vimie). Sprawd take opis opcji 'compatible' i 'cpoptions'. ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/vim-pl.UTF-8.1�������������������������������������������������������������0000664�0000000�0000000�00000037411�12677030670�0017123�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.TH VIM 1 "2006 kwi 11" .SH NAME vim \- Vi rozbudowany, edytor tekstu dla programisty .SH SYNOPSIS .br .B vim [opcje] [plik ..] .br .B vim [opcje] \- .br .B vim [opcje] \-t znacznik .br .B vim [opcje] \-q [plik_błędu] .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 OPIS .B Vim jest edytorem tekstu kompatybilnym z Vi. Może być używany do edycji wszelkiego rodzaju plików tekstowych. Użyteczny zwłaszcza przy edycji programów. .PP Posiada wiele usprawnień w porównaniu z Vi: wielopoziomowe cofanie zmian, wiele okien i buforów, podświetlanie składni, edycja linii poleceń, uzupełnianie nazw plików, pomoc on-line, wizualna selekcja, itd. Zobacz ":help vi_diff.txt" dla podsumowania różnic pomiędzy .B Vimem i Vi. .PP W czasie korzystania z .B Vima można uzyskać obszerną pomoc z systemu pomocy on-line dzięki poleceniu ":help". Zobacz rozdział POMOC ON-LINE poniżej. .PP Najczęściej .B Vim jest uruchamiany do edycji pojedynczego pliku poleceniem .PP vim plik .PP Bardziej ogólnie .B Vim jest uruchamiany poprzez: .PP vim [opcje] [lista plików] .PP Jeśli brak listy plików edytor rozpocznie z pustym buforem. W innym wypadku istnieje dokładnie jedna z czterech możliwości by wybrać jeden lub więcej plików do edycji. .TP 12 plik .. Lista nazw plików. Pierwsza nazwa będzie nazwą bieżącego pliku, który zostanie wczytany do bufora. Kursor zostanie umieszczony w pierwszym wierszu. Do kolejnych plików można przejść dzięki poleceniu ":next". By otworzyć plik, którego nazwa zaczyna się od myślnika należy listę plików poprzedzić "\-\-". .TP \- Plik do edycji jest wczytany ze standardowego wejścia. Polecenia są odczytywane ze standardowego wyjścia błędów, którym powinien być terminal (tty). .TP \-t {znacznik} Plik do edycji i początkowa pozycja kursora zależy od "znacznika", rodzaju etykiety goto. {znacznika} szuka się w pliku tags, związany z nim plik staje się plikiem bieżącym i wykonuje się powiązane polecenie. Zazwyczaj używa się tego sposobu dla programów w C, w których wypadku {znacznik} może być nazwą funkcji. W efekcie plik zawierający określoną funkcję staje się plikiem bieżącym a kursor jest umieszczony na początku funkcji. Zobacz ":help tag-commands". .TP \-q [plik_błędów] Zacznij w trybie quickFix. Plik [plik_błędów] zostaje zinterpretowany i pokaże się pierwszy błąd. Jeśli brak opcji [plik_błędów] nazwa pliku zostanie pobrana z opcji \&'errorfile' (domyślnie "AztecC.Err" dla Amigi, "errros.err" dla innych systemów. Do kolejnych błędów można przeskoczyć dzięki poleceniu ":cn". Zobacz ":help quickfix". .PP W zależności od wywołania .B Vim zachowuje się inaczej (program może być cały czas tym samym plikiem). .TP 10 vim "Normalny" sposób, wszystko jest domyślne. .TP ex Zacznij w trybie Ex. Przejdź do trybu Normalnego poleceniem ":vi". Można także uruchomić poprzez argument "\-e". .TP view Zacznij w trybie tylko do odczytu. W ten sposób będziesz chroniony przed zapisywaniem pliku. Można także uruchomić poprzez argument "\-R". .TP gvim gview Wersja GUI. Uruchamia nowe okno. Można także uruchomić poprzez argument "\-g". .TP evim eview Wersja GUI w łatwym trybie. Uruchamia nowe okno. Można także uruchomić poprzez argument "\-y". .TP rvim rview rgvim rgview Podobnie jak powyżej, ale z ograniczeniami. Nie będzie można uruchomić poleceń powłoki lub zawiesić .B Vima. Można także uruchomić poprzez argument "\-Z". .SH OPCJE Opcje można podać w dowolnej kolejności, przed lub po nazwach plików. Opcje bez argumentów można łączyć po pojedynczym myślniku. .TP 12 +[num] W pierwszym pliku kursor zostanie umieszczony w wierszu "num". Jeśli brak "num" kursor zostanie umieszczony w ostatnim wierszu. .TP +/{wzór} W pierwszym pliku kursor zostanie umieszczony na pierwszym wystąpieniu {wzór}. Zobacz ":help search-pattern" by dowiedzieć się jakie są możliwe wzorce wyszukiwania. .TP +{polecenie} .TP \-c {polecenie} {polecenie} zostanie wykonane po tym jak wczyta się pierwszy plik. {polecenie} jest interpretowane jako polecenie Ex. Jeśli {poleceni} zawiera białe znaki musi być umieszczone w podwójnych cudzysłowach (zależy to od używanej powłoki). Przykład: Vim "+set si" main.c .br Uwaga: Można użyć do 10 poleceń "+" lub "\-c". .TP \-S {plik} {plik} zostanie zinterpretowany po wczytaniu pierwszego pliku. Jest równoważne \-c "source {plik}". {plik} nie może zaczynać się '\-'. Jeśli nie podano {plik} zostanie użyty "Session.vim" (działa tylko wtedy jeśli \-S jest ostatnim argumentem). .TP \-\-cmd {polecenie} Podobne do "\-c", ale polecenie jest wykonywane tuż przed interpretacją jakiegokolwiek pliku vimrc. Można użyć do 10 takich poleceń, niezależnie od poleceń od "\-c" .TP \-A Jeśli .B Vim został skompilowany ze wsparciem dla języków arabskich (edycja od prawej do lewej i arabska mapa klawiatury) ta opcja uruchamia .B Vima w trybie arabskim, np. ustawia się opcja 'arabic'. W innym wypadku pojawi się komunikat błędu i .B Vim zakończy działanie. .TP \-b Tryb binarny. Ustawi się kilka opcji, które umożliwią edycję plików binarnych lub wykonywalnych. .TP \-C Kompatybilny. Ustawia opcję 'compatible'. W ten sposób .B Vim będzie zachowywał się jak Vi, nawet jeśli istnieje plik .vimrc. .TP \-d Uruchom w trybie diff. Powinno się użyć dwóch, trzech lub czterech nazwy plików jako argumentów. .B Vim otworzy wszystkie te pliki i pokaże różnice między nimi. Działa jak vimdiff(1). .TP \-d {urządzenie} Otwórz {urządzenie} by używać jako terminal. Tylko na Amidze. Przykład: "\-d con:20/30/600/150". .TP \-D Debugowanie. Przejdź do trybu debugowanie wykonując pierwsze polecenie ze skryptu. .TP \-e Uruchom .B Vima w trybie Ex, działa tak samo jakby wywołano program jako "ex". .TP \-E Uruchom .B Vima w ulepszonym trybie Ex, działa tak samo jakby wywołano program jako "exim". .TP \-f Pierszy plan. Dla wersji GUI. .B Vim nie nie oddzieli się od powłoki w jakiej został uruchomiony. Na Amidze .B Vim nie jest uruchomiony ponownie by otworzyć nowe okno. Opcja powinna być użyta kiedy .B Vim jest wywoływany przez program, który ma zaczekać na koniec sesji (np. mail). Na Amidze polecenia ":sh" i ":!" nie będą działać. .TP \-\-nofork Pierwszy plan. Dla wersji GUI. .B Vim nie oddzieli się od powłoki w jakiej został uruchomiony. .TP \-F Jeśli Vim został skompilowany ze wsparciem FKMAP dla edycji tekstów od prawej do lewej i mapowania klawiatury Farsi, ta opcja uruchomi .B Vima w trybie Farsi, np. zostawią ustawione opcje 'fkmap' i 'rightleft'. W innym wypadku pojawi się komunikat błędu i .B Vim zakończy działanie. .TP \-g Jeśli .B Vim został skompilowany ze wsparciem dla GUI ta opcja uruchomi GUI. W innym wypadku pojawi się komunikat błędu i .B Vim zakończy działanie. .TP \-h Wyświetli krótką pomoc o argumentach linii poleceń i opcjach. Potem .B Vim zakończy działanie. .TP \-H Jeśli .B Vim został skompilowany ze wsparciem RIGHTLEFT dla edycji od prawej do lewej oraz ma mapowanie klawiatury dla hebrajskiego, ta opcja uruchomi .B Vima w trybie hebrajskim, np. ustawi opcje 'hkmap' i 'rightleft'. W innym wypadku pojawi się komunikat błędu i .B Vim zakończy działanie. .TP \-i {viminfo} Kiedy .B Vim używa pliku viminfo ta opcja wskaże jakiego pliku użyć zamiast domyślnego "~/.viminfo". Można też ominąć użycie pliku .viminfo przez podanie nazwy "NONE". .TP \-L To samo co \-r. .TP \-l Tryb Lisp. Ustawia opcje 'lisp' i 'showmatch'. .TP \-m Zmiana pliku jest niemożliwa. Przestawia opcję 'write'. Można zmieniać zawartość bufora, ale zapisanie pliku nie jest możliwe. .TP \-M Opcje 'modifiable' i 'write' zostaną wyłączone, tak więc zmiany w pliku oraz ich zapisanie nie są możliwe. Wartość tych opcji można zmienić. .TP \-N Tryb niekompatybilny. Przestawia opcję 'compatible'. Dzięki temu .B Vim będzie zachowywał się odrobinę lepiej, ale mniej zgodnie z Vi nawet jeśli nie istnieje plik .vimrc. .TP \-n Nie powstanie plik wymiany. Odzyskanie pliku po wypadku nie będzie możliwe. Wygodne jeśli instnieje potrzeba edycji na bardzo wolnym medium (np. dyskietce). Ten cel można osiągnąć także przez ":set uc=0". Można odwrócić przez ":set uc=200". .TP \-nb Uruchom jako serwer edytora dla NetBeans. Zobacz dokumentację by dowiedzieć się więcej. .TP \-o[N] Otwórz N okien w stosie. Kiedy brak N, otwórz jedno okno dla każdego pliku. .TP \-O[N] Otwórz N okien obok siebie. Kiedy brak N, otwórz jedno okno dla każdego pliku. .TP \-p[N] Otwórz N kart. Kiedy brak N, otwórz jedną kartę dla każdego pliku. .TP \-R Tryb tylko do odczytu. Zostanie ustawiona opcja 'readonly'. Cały czas można zmieniać bufor, ale będzie istniała blokada by chronić przed przypadkowym zapisaniem pliku. Jeśli chcesz zapisać plik dodaj wykrzyknik do polecenia Ex, np. ":w!". Opcja \-R implikuje opcję \-n (zobacz poniżej). Opcja 'readonly' może zostać przestawiona poprzez ":set noro". Zobacz ":help 'readonly'". .TP \-r Wypisz listę plików wymiany razem z informacjami o nich. .TP \-r {plik} Tryb odzyskiwania danych. Plik wymiany zostanie wykorzystany do odzyskania gwałtownie przerwanej sesji. Plik wymiany to plik z taką samą nazwą co plik oryginalny z dodanym ".swp". Zobacz ":help recovery". .TP \-s Tryb cichy. Rozpoczęty tylko kiedy uruchomiony jako "Ex" lub opcja "\-e" została podana przed opcją "\-s". .TP \-s {skrypt} Zostanie wczytany plik {skrypt}. Znaki w pliku zostaną zinterpretowane jakby były wpisywane. To samo można osiągnąć poprzez polecenie ":source! {skrypt}". Jeśli osiągnięto koniec pliku zanim edytor zakończył działanie, dalsze znaki odczytywane są z klawiatury. .TP \-T {terminal} Przekazuje .B Vimowi nazwę terminalu jakiego używasz. Wymagane tylko wtedy jeśli nie działa automatycznie. Powinien być to terminal znany .B Vimowi (builtin) lub zdefiniowany w plikach termcap lub terminfo. .TP \-u {vimrc} Użyj poleceń z pliku {vimrc} w czasie uruchamiania. Wszystkie inne możliwe pliki uruchamiania zostaną pominięte. Używaj do edytowania plików specjalnych. Można pominąć także wszystkie możliwe pliki uruchamiania poprzez podanie nazwy "NONE". Zobacz ":help initialization" by poznać więcej szczegółów. .TP \-U {gvimrc} Użyj poleceń z pliku {gvimrc} w czasie uruchamiania GUI. Wszystkie inne możliwe pliki uruchamiania GUI zostaną pominięte. Można pominąć także wszystkie możliwe pliki uruchamiania GUI poprzez podanie nazwy "NONE". Zobacz ":help gui-init" by poznać więcej szczegółów. .TP \-V[N] Tryb gadatliwy. Wypisz wiadomości o tym jaki pliki są wczytywane i o informacjach pobieranych i dodawanych do pliku viminfo. Opcjonalny argument N jest wartością 'verbose'. Domyślnie 10. .TP \-v Uruchom .B Vima w trybie Vi, tak jakby program był nazwany "vi". Ma znaczenie tylko wtedy jeśli program nazwany jest "ex". .TP \-w {plik} Wszystkie wciśnięcia klawiszy, aż do zakończenia działania programu, są zapisywane w {plik} . Użyteczne jeśli chce się stworzyć skrypt do użycia z "vim \-s" lub ":source!". Jeśli {plik} istnieje, znaki są dopisywane. .TP \-W {plik} Podobnie do \-w, ale istniejący plik jest nadpisywany. .TP \-x Użyj szyfrowania podczas zapisywania plików. Zostaniesz poproszony o podanie klucza. .TP \-X Nie łącz z serwerem X. Skraca czas uruchamiania w terminalu, ale tytuł okna i schowek nie będą wykorzystywane. .TP \-y Uruchom .B Vima w łatwym trybie, tak jakby program został wywołany "evim" lub "eview". .B Vim będzie zachowywał się bardziej jak edytor kliknij-i-wpisz. .TP \-Z Tryb ograniczony. Zachowuje się jakby nazwa programu zaczynała się od "r". .TP \-\- Oznacza koniec opcji. Argumenty po tej opcji będą traktowane jak nazwy plików. Używa się do otwierania plików, których nazwy zaczynają się od '\-'. .TP \-\-echo\-wid Wyłącznie GTK GUI: wypisz ID okna na standardowe wyjście. .TP \-\-help Wyświetl informację o pomocy i zakończy, to samo co"\-h". .TP \-\-literal Potraktuj nazwy plików dosłownie i nie rozwiązuj kwantyfikatorów. Nie ma znaczenia na Uniksach gdzie powłoka rozwiązuje kwantyfikatory. .TP \-\-noplugin Pomiń ładowanie wtyczek. Implikowane przy \-u NONE. .TP \-\-remote Połącz się z serwerem Vima i edytuj w nim resztę plików podanych jako argumenty. Jeśli nie znaleziono serwera zostanie zgłoszony błąd a pliki zostaną otwarte w bieżącym Vimie. .TP \-\-remote\-expr {wyrażenie} Połącz z serwerem Vima, rozwiąż w nim {wyrażenie} i wypisz rozwiązanie na standardowe wyjście. .TP \-\-remote\-send {klawisze} Połącz z serwerem Vima i wyślij do niego {klawisze}. .TP \-\-remote\-silent Tak samo jak \-remote, ale bez ostrzeżenia kiedy nie znaleziono serwera. .TP \-\-remote\-wait Tak samo jak \-remote, ale Vim nie zakończy dopóki pliki pozostaną otwarte. .TP \-\-remote\-wait\-silent Tak samo jak \-\-remote\-wait, ale bez ostrzeżenie kiedy nie znaleziono serwera. .TP \-\-serverlist Wypisz nazwy wszystkich serwerów Vima jakie można znaleźć. .TP \-\-servername {nazwa} Użyj {nazwa} jako nazwy serwera. Wykorzystane dla bieżącego Vima o ile nie połączone z argumentem \-\-remote, wtedy jest to nazwa serwera do połączenia. .TP \-\-socketid {id} Wyłącznie GTK GUI: Użyj mechanizmu GtkPlug by uruchomić gvima w innym oknie. .TP \-\-version Wypisz informację o wersji i zakończ. .SH POMOC ON-LINE By rozpocząć wpisz ":help" w .B Vimie Wpisz ":help temat" by uzyskać pomoc na określony temat. Przykład: ":help ZZ" by uzyskać pomoc na temat polecenia "ZZ". Użyj <Tab> i CTRL\-D aby uzupełnić tematy (":help cmdline\-completion"). W plikach pomocy istnieją znaczniki by ułatwić skakanie z jednego miejsca do innego (rodzaj linków hipertekstowych, zobacz ":help"). Można w ten sposób zobaczyć całą dokumentację, np. ":help syntax.txt". .SH PLIKI .TP 15 /usr/local/lib/vim/doc/*.txt Dokumentacja .B Vima Użyj ":help doc\-file\-list" aby uzyskać pełną listę. .TP /usr/local/lib/vim/doc/tags Plik znaczników służy do znajdowania informacji w plikach dokumentacji. .TP /usr/local/lib/vim/syntax/syntax.vim Globalne uruchamianie podświetlania składni. .TP /usr/local/lib/vim/syntax/*.vim Pliki składni dla różnych języków. .TP /usr/local/lib/vim/vimrc Globalny plik uruchamiania .B Vima .TP ~/.vimrc Osobiste parametry uruchamiania .B Vima .TP /usr/local/lib/vim/gvimrc Globalne uruchamianie gvima. .TP ~/.gvimrc Osobiste parametry uruchamiania gvima. .TP /usr/local/lib/vim/optwin.vim Skrypt używany w poleceniu ":options", dobry sposób do przeglądania i ustawiania opcji. .TP /usr/local/lib/vim/menu.vim Globalne uruchamianie menu gvima. .TP /usr/local/lib/vim/bugreport.vim Skrypt służący do tworzenia raportów o błędach. Zobacz ":help bugs". .TP /usr/local/lib/vim/filetype.vim Skrypt do wykrywania typu pliku według jego nazwy. Zobacz ":help 'filetype'". .TP /usr/local/lib/vim/scripts.vim Skrypt do wykrywania typu pliku według jego zawartości. Zobacz ":help 'filetype'". .TP /usr/local/lib/vim/print/*.ps Pliku używane do drukowania PostScriptu. .PP Najświeższe wiadomości na stronie .B Vima: .br <URL:http://www.vim.org/> .SH ZOBACZ TAKŻE vimtutor(1) .SH AUTOR .B Vim został napisany przez Brama Moolenaara z dużą pomocą innych osób. Zobacz ":help credits" w .B Vimie. .br .B Vim bazuje na Steviem, nad którym pracowali: Tim Thompson, Tony Andrews i G.R. (Fred) Walter. Mało już zostało z oryginalnego kodu. .SH BŁĘDY Prawdopodobne. Zobacz ":help todo" by poznać listę znanych problemów. .PP Pamiętaj że pewna ilość problemów, które mogą być uznawane przez niektórych ludzi za błędy są w rzeczywistości spowodowane wiernością w odtwarzaniu zachowania Vi. Jeśli sądzisz, że inne rzeczy są błędami "ponieważ Vi robi to inaczej", powinieneś przyjrzeć się bliżej plikowi vi_diff.txt (lub wpisać ":help vi_diff.txt" w Vimie). Sprawdź także opis opcji 'compatible' i 'cpoptions'. �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/vim-ru.1�������������������������������������������������������������������0000664�0000000�0000000�00000035177�12677030670�0016343�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.TH VIM 1 "2002 Feb 22" .SH vim \- Vi IMproved ( Vi), .SH .br .B vim [] [ ..] .br .B vim [] \- .br .B vim [] \-t .br .B vim [] \-q [ ] .PP .br .B ex .br .B view .br .B gvim .B gview .br .B rvim .B rview .B rgvim .B rgview .SH .B Vim -- , - Vi. . . .PP Vi, .B Vim : , , , , ͣ , , .. . ":help vi_diff.txt" .B Vim Vi. .PP .B Vim ( ":help"). . " " . .PP .B Vim .PP vim .PP .B Vim : .PP vim [] [ ] .PP , Σ . ң : .TP 12 .. ͣ . . ݣ . ̣ ":next". , "" (-), "--". .TP \- . (stderr), . .TP \-t {} "", goto. {} , , . , {} . , , , . . ":help tag-commands". .TP \-q [ ] . [ ] . [ ] , ң 'errorfile' ( : "AztecC.Err" Amiga, "errors.err" ). ":cn". . ":help quickfix". .PP .B Vim ģ - ( ). .TP 10 vim "" , ӣ . .TP ex Ex. ":vi". Ex "\-e". .TP view " ". . "\-R". .TP gvim gview . . "\-g". .TP rvim rview rgvim rgview , . .B Vim. "r" "\-Z". .SH , ͣ . . .TP 12 +[] ݣ . "" , ݣ . .TP +/{} ݣ . . ":help search-pattern" . .TP +{} .TP \-c {} {} Ex. {} , ( ). : vim "+set si" main.c .br : "+" "\-c". .TP \-\-cmd {} "\-c", (vimrc). , "\-c". .TP \-A .B Vim , , , .B Vim , 'arabic'. .B Vim . .TP \-b . , . .TP \-C . 'compatible'. .B Vim Vi, .vimrc. .TP \-d . . .B Vim ( vimdiff(1)). .TP \-d {} {} ( Amiga). : "\-d con:20/30/600/150". .TP \-e .B Vim Ex, "ex". .TP \-f . .B Vim ţ . Amiga .B Vim . , .B Vim , (, ). Amiga ":sh" ":!" . .TP \-\-nofork . .B Vim ţ . .TP \-F .B Vim FKMAP , .B Vim , , ޣ \&'fkmap' 'rightleft'. .B Vim . .TP \-g .B Vim , . .B Vim . .TP \-h . .B Vim . .TP \-H .B Vim , .B Vim , , ޣ 'hkmap' 'rightleft'. .B Vim . .TP \-i {viminfo} viminfo, ( "~/.viminfo" ). viminfo ԣ "NONE". .TP \-L , \-r. .TP \-l Lisp. 'lisp' 'showmatch'. .TP \-m . 'write', . .TP \-N . 'compatible'. .B Vim , Vi, (.vimrc). .TP \-n -. . (, ). ":set uc=0". -- ":set uc=200". .TP \-o[N] N , ̣ . N , . .TP \-O[N] N , ̣ . N , . .TP \-R " ". 'readonly'. , . Ex (, ":w!"). "\-R" , "\-n" (. ). 'readonly' ":set noro". . ":help 'readonly'". .TP \-r - . .TP \-r {} . -. - , , ".swp". . ":help recovery". .TP \-s . "Ex" "\-s" "\-e". .TP \-s {scriptin} {scriptin}. , , . ":source! {scriptin}". , . .TP \-T {terminal} .B Vim . , . .B Vim ( ) termcap terminfo. .TP \-u {vimrc} {vimrc} . . . , "NONE". . ":help initialization". .TP \-U {gvimrc} {gvimrc} . . , "NONE". . ":help gui-init". .TP \-V "" . , , - viminfo. .TP \-v .B Vim Vi, "vi". "ex". .TP \-w {scriptout} , ģ , {scriptout}. , "vim \-s" ":source!". {scriptout} , . .TP \-W {scriptout} "\-w", . .TP \-x . . .TP \-X X-. , . .TP \-Z . , , "r". .TP \-\- . . , . .TP \-\-help . , "\-h". .TP \-\-version . .TP \-\-remote Vim , . , , Vim. .TP \-\-remote\-expr {} Vim Σ {}. (stdout). .TP \-\-remote\-send {} Vim {}. .TP \-\-remote\-silent "\-\-remote", , . .TP \-\-remote\-wait "\-\-remote", Vim , . .TP \-\-remote\-wait\-silent "\-\-remote\-wait", , . .TP \-\-serverlist Vim. .TP \-\-servername {} {} . "\-\-remote" , {} Vim, , . .TP \-\-socketid {id} GTK: GtkPlug gvim . .TP \-\-echo\-wid GTK: (Window ID) (stdout). .SH , ":help". ":help ", . , ":help ZZ" "ZZ". <Tab> CTRL-D (":help cmdline-completion"). (- , . ":help"). , ":help syntax.txt". .SH .TP 15 /usr/local/lib/vim/doc/*.txt .B Vim. . ":help doc-file-list" . .TP /usr/local/lib/vim/doc/tags , . .TP /usr/local/lib/vim/syntax/syntax.vim . .TP /usr/local/lib/vim/syntax/*.vim . .TP /usr/local/lib/vim/vimrc .B Vim. .TP /usr/local/lib/vim/gvimrc . .TP /usr/local/lib/vim/optwin.vim , ":options". . .TP /usr/local/lib/vim/menu.vim gvim. .TP /usr/local/lib/vim/bugreport.vim ޣ . . ":help bugs". .TP /usr/local/lib/vim/filetype.vim . . ":help 'filetype'". .TP /usr/local/lib/vim/scripts.vim . . ":help 'filetype'". .TP /usr/local/lib/vim/print/*.ps PostScript. .PP -- VIM: .br <URL:http://www.vim.org/> .SH vimtutor(1) .SH .B Vim (Bram Moolenaar), . . ":help credits" .B Vim. .br .B Vim Stevie, (Tim Thompson), (Tony Andrews) . . () (G.R. (Fred) Walter). , Vim . .br .B Vim "", . <URL:http://sourceforge.net/projects/ruvim/>. .SH . . ":help todo" -- . .PP , , , Vi. , - , "Vi -", vi_diff.txt ( ":help vi_diff.txt" Vim) 'compatible' 'cpoptions'. �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/vim-ru.UTF-8.1�������������������������������������������������������������0000664�0000000�0000000�00000060062�12677030670�0017134�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.TH VIM 1 "2002 Feb 22" .SH ИМЯ vim \- Vi IMproved (Улучшенный Vi), текстовый редактор для программистов .SH КОМАНДНАЯ СТРОКА .br .B vim [ключи] [файл ..] .br .B vim [ключи] \- .br .B vim [ключи] \-t метка .br .B vim [ключи] \-q [файл ошибок] .PP .br .B ex .br .B view .br .B gvim .B gview .br .B rvim .B rview .B rgvim .B rgview .SH ОПИСАНИЕ .B Vim -- текстовый редактор, обратно-совместимый с Vi. Он может быть использован для правки всех видов простого текста. Особенно он хорош для правки исходных текстов программ. .PP По сравнению с Vi, .B Vim имеет много усовершенствований: многократная отмена операций, множественность окон и буферов, подсветка синтаксиса, правка командной строки, автодополнение имён файлов, встроенная справка, визуальное выделение и т.п. См. ":help vi_diff.txt" для получения полного списка различий между .B Vim и Vi. .PP Во время работы в .B Vim можно получить справку с помощью системы встроенной справки (команда ":help"). См. раздел "ВСТРОЕННАЯ СПРАВКА" ниже по тексту. .PP Чаще всего .B Vim запускают для правки одного файла при помощи команды .PP vim файл .PP В общем виде команда запуска .B Vim выглядит так: .PP vim [ключи] [список файлов] .PP Если список файлов отсутствует, редактор начнёт работу с пустым буфером. В противном случае имя файла должно быть указано одним из следующих четырёх способов: .TP 12 файл .. Список имён файлов. Первый файл будет объявлен активным и загружен в буфер. Курсор будет помещён в первой строке буфера. Доступ к другим файлам может быть осуществлён при помощи команды ":next". Чтобы править файл, имя которого начинается с символа "дефис" (-), перед списком файлов необходимо поставить "--". .TP \- Файл будет прочитан из потока стандартного ввода. Команды будут считываться из стандартного потока диагностики (stderr), который должен быть терминалом. .TP \-t {метка} Имя файла и начальная позиция курсора зависят от "метки", похожей на метку goto. {метка} ищется в файле меток, соответствующий файл становится активным, а соответствующая команда исполняется. Чаще всего используется в программах на языке Си, где {метка} может быть именем функции. Файл, содержащий функцию, становится активным, а курсор помещается в начало функции. См. ":help tag-commands". .TP \-q [файл ошибок] Начать работу в режиме быстрого исправления. При этом считывается [файл ошибок] и первая ошибка выводится на экран. Если [файл ошибок] не указан, имя файла берётся из значения опции 'errorfile' (по умолчанию: "AztecC.Err" для Amiga, "errors.err" для других систем). К следующим ошибкам можно перейти по команде ":cn". См. ":help quickfix". .PP .B Vim ведёт себя по-разному в зависимости от имени команды (исполняемый файл может быть одним и тем же). .TP 10 vim "Нормальный" запуск, всё по умолчанию. .TP ex Запуск в режиме Ex. Для перехода в нормальный режим необходимо выполнить команду ":vi". Режим Ex включает также ключ "\-e". .TP view Запуск в режиме "только для чтения". Вы будете защищены от случайной записи файла. То же самое можно сделать ключом "\-R". .TP gvim gview Версия с графическим интерфейсом. Запускается в новом окне. То же самое можно сделать при запуске с ключом "\-g". .TP rvim rview rgvim rgview Как и предыдущие команды, но с ограничениями. Нельзя запускать команды оболочки или приостанавливать работу .B Vim. Вместо приставки "r" можно использовать ключ "\-Z". .SH КЛЮЧИ Ключи могут быть указаны в любом порядке, до или после имён файлов. Ключи без аргументов могут быть объединены под одним дефисом. .TP 12 +[номер] В первом файле курсор будет помещён на строку с указанным номером. Если "номер" не указан, курсор будет помещён на последнюю строку. .TP +/{шаблон} В первом файле курсор будет помещён на место первого совпадения с указанным шаблоном. См. ":help search-pattern" для получения списка допустимых шаблонов. .TP +{команда} .TP \-c {команда} {команда} исполняется после загрузки первого файла как команда Ex. Если {команда} содержит пробелы, то она должна быть заключена в двойные кавычки (в зависимости от используемой оболочки). Пример: vim "+set si" main.c .br Примечание: Можно указывать до десяти команд "+" или "\-c". .TP \-\-cmd {команда} Как "\-c", но команда исполняется перед обработкой любого файла настроек (vimrc). Можно указывать до десяти таких команд, независимо от количества команд "\-c". .TP \-A Если .B Vim был собран с поддержкой арабского языка для правки файлов, набранных справа налево, и с поддержкой арабской клавиатуры, этот ключ запускает .B Vim в арабском режиме, с включенной опцией 'arabic'. В противном случае .B Vim завершает работу с ошибкой. .TP \-b Двоичный режим. Производится настройка некоторых опций, делающих возможной правку двоичного или исполняемого файла. .TP \-C Режим совместимости. Включает опцию 'compatible'. .B Vim будет работать почти как Vi, даже если существует файл .vimrc. .TP \-d Режим поиска различий. Должно быть указано два или три имени файла. .B Vim откроет все файлы и покажет различия между ними (как vimdiff(1)). .TP \-d {устройство} Открыть {устройство} для использования в качестве терминала (только на Amiga). Пример: "\-d con:20/30/600/150". .TP \-e Запустить .B Vim в режиме Ex, как будто исполняемый файл имеет имя "ex". .TP \-f Режим активного приложения. Версия .B Vim с графическим интерфейсом не будет ветвиться и отключаться от запустившей её оболочки. На платформе Amiga .B Vim не будет создавать новое окно. Этот ключ нужно использовать, когда .B Vim запускается программой, которая должна ждать завершения сеанса правки (например, программа для работы с электронной почтой). На платформе Amiga команды ":sh" и ":!" не будут работать. .TP \-\-nofork Режим активного приложения. Версия .B Vim с графическим интерфейсом не будет ветвиться и отключаться от запустившей её оболочки. .TP \-F Если .B Vim был собран с поддержкой FKMAP для правки текста справа налево и настроек клавиатуры для языка фарси, этот ключ запускает .B Vim в режиме фарси, иначе говоря, с включёнными опциями \&'fkmap' и 'rightleft'. В противном случае .B Vim завершает работу с сообщением об ошибке. .TP \-g Если .B Vim был собран с поддержкой графического интерфейса, этот ключ включает графический интерфейс. В противном случае .B Vim завершает работу с сообщением об ошибке. .TP \-h Выводит краткую информацию об аргументах и ключах командной строки. После этого .B Vim завершает работу. .TP \-H Если .B Vim был собран с поддержкой правки текста справа налево и настроек клавиатуры для иврита, этот ключ запускает .B Vim в режиме иврита, иначе говоря, с включёнными опциями 'hkmap' и 'rightleft'. В противном случае .B Vim завершает работу с сообщением об ошибке. .TP \-i {viminfo} Если используется файл viminfo, то этот ключ задаёт имя такого файла (вместо "~/.viminfo" по умолчанию). Можно также избежать использования файла viminfo путём указания имени "NONE". .TP \-L То же, что и \-r. .TP \-l Режим Lisp. Включаются опции 'lisp' и 'showmatch'. .TP \-m Изменение файлов запрещено. При этом отключается опция 'write', поэтому запись файлов становится невозможной. .TP \-N Режим неполной совместимости. Отключается 'compatible'. .B Vim будет работать лучше, но не будет полностью совместим с Vi, даже если отсутствует файл сценария настроек (.vimrc). .TP \-n Не использовать своп-файл. Восстановление при сбое в работе будет невозможно. Удобно для правки файла на очень медленном носителе (например, гибком диске). То же самое можно сделать командой ":set uc=0". Отмена -- ":set uc=200". .TP \-o[N] Открыть N окон, разделённых по горизонтали. Если N не указано, то открывается по одному окну на каждый файл. .TP \-O[N] Открыть N окон, разделённых по вертикали. Если N не указано, то открывается по одному окну на каждый файл. .TP \-R Режим "только для чтения". Включается опция 'readonly'. Файл в буфере доступен для редактирования, но его копию на диске нельзя случайно перезаписать. Для сохранения файла необходимо добавить восклицательный знак к соответствующей команде Ex (например, ":w!"). Ключ "\-R" подразумевает также, что используется и ключ "\-n" (см. выше). Опция 'readonly' может быть выключена по команде ":set noro". См. ":help 'readonly'". .TP \-r Вывести список своп-файлов и информацию об их использовании для восстановления после сбоя. .TP \-r {файл} Режим восстановления. Для восстановления после сбоя будет использован своп-файл. Своп-файл имеет то же имя, что и текстовый файл, но с добавлением расширения ".swp". См. ":help recovery". .TP \-s Тихий режим. Только при запуске как "Ex" или если перед "\-s" указан ключ "\-e". .TP \-s {scriptin} Считывается файл сценария {scriptin}. При этом, содержимое файла воспринимается в виде команд, как если бы они были набраны на консоли. То же самое достигается командой ":source! {scriptin}". Если конец файла считывается до завершения работы редактора, то в дальнейшем ввод осуществляется с клавиатуры. .TP \-T {terminal} Сообщает .B Vim тип используемого терминала. Необходимо только в тех ситуациях, когда автоматическое определение терминала не работает. Имя терминала должно быть известно .B Vim (встроено в него) или определено в файлах termcap или terminfo. .TP \-u {vimrc} Использовать команды из файла сценария {vimrc} для настройки. Все остальные файлы настроек пропускаются. Удобно для редактирования специальных типов файлов. Чтобы избежать использования сценариев настроек вообще, можно использовать имя "NONE". См. ":help initialization". .TP \-U {gvimrc} Использовать команды из файла сценария {gvimrc} для настройки графического интерфейса. Все остальные файлы настроек для графического интерфейса пропускаются. Чтобы избежать использования сценариев настроек графического интерфейса вообще, можно использовать имя "NONE". См. ":help gui-init". .TP \-V "Болтливый" режим. Выводить сообщения о том, какие файлы читаются, и о чтении-записи файла viminfo. .TP \-v Запустить .B Vim в режиме Vi, как будто исполняемый файл имеет имя "vi". Имеет смысл только если исполняемый файл имеет имя "ex". .TP \-w {scriptout} Все символы, введённые с клавиатуры вплоть до момента завершения работы, записываются в файл {scriptout}. Удобно в том случае, когда вы хотите создать файл сценария для последующего использования с "vim \-s" или ":source!". Если файл {scriptout} уже существует, то новые символы будут добавляются в конец файла. .TP \-W {scriptout} Как "\-w", но уже существующий файл будет перезаписан. .TP \-x Шифровать записываемые файлы. Будет выдано приглашение ввести пароль. .TP \-X Не подключаться к X-серверу. Ускоряет загрузку на консоли, но делает невозможным использование заголовка окна и буфера обмена. .TP \-Z Ограниченный режим. Работает так же, как и программы, начинающиеся с "r". .TP \-\- Конец ключей. Все остальные аргументы рассматриваются как имена файлов. Может быть использовано для правки файлов, имена которых начинаются с дефиса. .TP \-\-help Вывести краткую справку и завершить работу. То же, что и "\-h". .TP \-\-version Вывести информацию о версии программы и завершить работу. .TP \-\-remote Подключиться к серверу Vim и заставить его править файлы, указанные в последующих аргументах. Если сервер не найден, выводится предупреждение, а файлы правятся в местной копии Vim. .TP \-\-remote\-expr {выражение} Подключиться к серверу Vim и вычислить на нём указанное {выражение}. Результат вычисления будет выведен в поток стандартного вывода (stdout). .TP \-\-remote\-send {ключи} Подключиться к серверу Vim и передать ему указанные {ключи}. .TP \-\-remote\-silent Как "\-\-remote", но без вывода предупреждения, если сервер не найден. .TP \-\-remote\-wait Как "\-\-remote", но Vim не будет завершать работу до тех пор, пока не будет выполнена правка всех файлов. .TP \-\-remote\-wait\-silent Как "\-\-remote\-wait", но без вывода предупреждения, если сервер не найден. .TP \-\-serverlist Вывести список всех доступных серверов Vim. .TP \-\-servername {имя} Использовать указанное {имя} в качестве имени сервера. Если ключ "\-\-remote" не указан, то {имя} присваивается данной копии Vim, в противном случае указывает на имя сервера, к которому следует подключиться. .TP \-\-socketid {id} Только для графического интерфейса GTK: использовать механизм GtkPlug для запуска gvim в отдельном окне. .TP \-\-echo\-wid Только для графического интерфейса GTK: вывести идентификатор окна (Window ID) в поток стандартного вывода (stdout). .SH ВСТРОЕННАЯ СПРАВКА Для начала, наберите команду ":help". Введите ":help тема", чтобы получить справку по конкретной теме. Например, команда ":help ZZ" выведет информацию о команде "ZZ". Используйте <Tab> и CTRL-D для автоматического дополнения названий тем (":help cmdline-completion"). Для быстрого перемещения по справочнику используются метки (что-то вроде гипертекстовых ссылок, см. ":help"). Таким образом можно просматривать все файлы справки, например ":help syntax.txt". .SH ФАЙЛЫ .TP 15 /usr/local/lib/vim/doc/*.txt Файлы справочника .B Vim. См. ":help doc-file-list" для получения полного списка. .TP /usr/local/lib/vim/doc/tags Файл меток, используемый для поиска информации в файлах справки. .TP /usr/local/lib/vim/syntax/syntax.vim Системные настройки синтаксиса. .TP /usr/local/lib/vim/syntax/*.vim Файлы синтаксиса для разных языков. .TP /usr/local/lib/vim/vimrc Системные настройки .B Vim. .TP /usr/local/lib/vim/gvimrc Системный настройки графического интерфейса. .TP /usr/local/lib/vim/optwin.vim Сценарий, используемый при выполнении команды ":options". Хороший способ просматривать и изменять настройки. .TP /usr/local/lib/vim/menu.vim Системные настройки меню для gvim. .TP /usr/local/lib/vim/bugreport.vim Сценарий для создания отчёта об обнаруженных глюках. См. ":help bugs". .TP /usr/local/lib/vim/filetype.vim Сценарий для определения типа файла по имени. См. ":help 'filetype'". .TP /usr/local/lib/vim/scripts.vim Сценарий для определения типа файла по содержимому. См. ":help 'filetype'". .TP /usr/local/lib/vim/print/*.ps Файлы для печати PostScript. .PP Более свежая информация -- на сайте VIM: .br <URL:http://www.vim.org/> .SH СМОТРИ ТАКЖЕ vimtutor(1) .SH АВТОРЫ Большая часть .B Vim создана Брамом Мооленааром (Bram Moolenaar), которому помогает огромное количество людей. См. ":help credits" в .B Vim. .br .B Vim базируется на коде редактора Stevie, написанного Тимом Томпсоном (Tim Thompson), Тони Эндрюсом (Tony Andrews) и Г. Р. (Фредом) Уолтером (G.R. (Fred) Walter). Однако, в настоящее время в Vim почти не осталось ничего от исторического кода его предшественника. .br Русская локализация .B Vim выполняется в рамках проекта "РуВим", см. <URL:http://sourceforge.net/projects/ruvim/>. .SH ГЛЮКИ Скорее всего есть. См. ":help todo" -- список известных проблем. .PP Заметим, что многие вещи, которые считаются глюками, на самом деле являются результатом слишком полного воспроизведения поведения Vi. Если вы думаете, что что-то является ошибкой только потому, что "Vi делает это по-другому", внимательно прочитайте файл vi_diff.txt (или наберите ":help vi_diff.txt" в Vim) и используйте опции 'compatible' и 'cpoptions'. ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/vim.1����������������������������������������������������������������������0000664�0000000�0000000�00000034763�12677030670�0015717�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.TH VIM 1 "2006 Apr 11" .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 in the line with 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, three or four 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 \-p[N] Open N tab pages. When N is omitted, open one tab page 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. This has no effect on Unix where the shell expands 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 ~/.vimrc Your personal .B Vim initializations. .TP /usr/local/lib/vim/gvimrc System wide gvim initializations. .TP ~/.gvimrc Your personal 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/print/*.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. �������������vim-7.4.1689/runtime/doc/vim.man��������������������������������������������������������������������0000664�0000000�0000000�00000045724�12677030670�0016331�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������VIM(1) General Commands Manual 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 in the line with 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, three or four file name arguments. Vim will open all the files and show differences 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. -p[N] Open N tab pages. When N is omitted, open one tab page 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. This has no effect on Unix where the shell expands 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. ~/.vimrc Your personal Vim initializations. /usr/local/lib/vim/gvimrc System wide gvim initializations. ~/.gvimrc Your personal 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/print/*.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. 2006 Apr 11 VIM(1) ��������������������������������������������vim-7.4.1689/runtime/doc/vim.man.info���������������������������������������������������������������0000775�0000000�0000000�00000001106�12677030670�0017250�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������������g��@�����% �&\H�����������������j�"u�������k��������������������@���|�����~��P��_�U@�_�P�_�T�_�U�_U@_}WQ��|9��(9�|8�|ϑ�|Ϲ�|9�|Ϲ�|Ϲ�|Ϲ;�|9(ϸ|O��|Ϲ�������@���}�����~��P��_���x�@�_<� �UP�_���*T�_�ʩU�_��yU@�<� }WQ��|9��(9��|�|U�|Uk�|�|Z�|��|�uV�|�?_(�U|�|����T����� :c/MuchMore�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������vim-7.4.1689/runtime/doc/vim2html.pl����������������������������������������������������������������0000664�0000000�0000000�00000010645�12677030670�0017132�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/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/</</g; $tag =~ s/>/>/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/&/&/g; $text =~ s/</</g; $text =~ s/>/>/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

$head

EOF

	my $inexample = 0;
	while(  ) {
		chop;
		if ( /^\s*[-=]+\s*$/ ) {
			print OUT "

";
			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,
					"\*".esctext($1)."<\/a>\*<\/b>");
				next LOOP;
			}

			$_ = esctext($token);
			s/CTRL-(\w+)/CTRL-$1<\/code>/g;
			# parameter <...>
			s/<(.*?)>/<$1><\/code>/g;

			# parameter {...}
			s/\{([^}]*)\}/{$1}<\/code>/g;

			# parameter [...]
			s/\[(range|line|count|offset|cmd|[-+]?num)\]/\[$1\]<\/code>/g;
			# note
			s/(Note:?)/$1<\/code>/gi;

			# local heading
			s/^(.*)\~$/$1<\/code>/g;
			push( @out, $_ );
		}

		$_ = join( "", @out );

		if( $inexample == 2 ) {
			print OUT "$_\n";
		} else {
			print OUT $_,"\n";
		}

		$inexample = 2 if $inexample == 1;
	}
	print OUT<

Generated by vim2html on $date

EOF } sub usage { die< EOF } sub writeCSS { open( CSS, ">vim-stylesheet.css" ) || die "Couldn't write stylesheet: $!\n"; print CSS< 2005-03-12. Mise jour 2012-05-06, Dominique Pell vim-7.4.1689/runtime/doc/vimdiff-fr.UTF-8.1000066400000000000000000000034151267703067000177450ustar00rootroot00000000000000.TH VIMDIFF 1 "30 mars 2001" .SH NOM vimdiff \- ouvre deux, trois ou quatre versions d'un fichier dans Vim et affiche leurs différences .SH SYNOPSIS .br .B vimdiff [options] fichier1 fichier2 [fichier3 [fichier4]] .PP .B gvimdiff .SH DESCRIPTION .B Vimdiff démarre .B Vim avec deux (ou trois ou quatre) fichiers. Chaque fichier est ouvert dans sa propre fenêtre. Les différences entre ces fichiers sont mises en surbrillance. C'est un outil très pratique pour visualiser et reporter les changements entre deux versions d'un même fichier. .PP Consulter vim(1) pour des informations sur l'éditeur Vim lui-même. .PP Si .B gvimdiff est invoqué, l'IHM graphique est démarrée quand elle est disponible. .PP L'option 'diff' est activée dans chacune des fenêtres, ce qui provoque la mise en surbrillance des différences. .br Les options 'wrap' et 'scrollbind' sont activées pour donner un aspect agréable au texte. .br L'option 'foldmethod' est fixée à "diff", ce qui replie les lignes consécutives identiques. 'foldcolumn' est fixé à 2 pour trouver les replis rapidement et les ouvrir ou les fermer facilement. .SH ARGUMENTS La fenêtre de Vim est partagée verticalement afin d'afficher les lignes correspondantes les unes en face des autres, comme si l'argument "\-O" était spécifié. Utilisez l'argument "\-o" pour obtenir un partage horizontal à la place. .PP Pour connaître les autres arguments disponibles, consultez vim(1). .SH VOIR AUSSI vim(1) .SH AUTEUR La majeure partie de .B Vim a été écrite par Bram Moolenaar, avec l'aide de nombreux autres contributeurs. Voir ":help credits" dans .B Vim. .SH TRADUCTION Cette page de manuel a été traduite par David Blanchet 2005-03-12. Mise à jour 2012-05-06, Dominique Pellé vim-7.4.1689/runtime/doc/vimdiff-it.1000077500000000000000000000024721267703067000171550ustar00rootroot00000000000000.TH VIMDIFF 1 "30 marzo 2001" .SH NOME vimdiff \- modifica due, tre o quattro versioni di un file con Vim, visualizzando le differenze .SH SINTASSI .br .B vimdiff [opzioni] file1 file2 [file3 [file4]] .PP .B gvimdiff .SH DESCRIZIONE .B Vimdiff inizia .B Vim per due (o tre o quattro) file. Ogni file ha una sua finestra. Le differenze fra file sono evidenziate. una maniera elegante per controllare modifiche e portare modifiche verso un'altra versione dello stesso file. .PP Vedere vim(1) per dettagli su Vim in generale. .PP Se iniziato con .B gvimdiff la GUI sar utilizzata, se disponibile. .PP In ogni finestra l'opzione 'diff' impostata, evidenziando cos le differenze. .br Le opzioni 'wrap' e 'scrollbind' sono impostate per migliorare la visibilit del testo. .br L'opzione 'foldmethod' impostata al valore "diff", che mette gruppi di linee uguali fra i diversi file in una piegatura. 'foldcolumn' impostato a due per poter facilmente visualizzare le piegature, aprirle e chiuderle. .SH OPZIONI Lo schermo diviso verticalmente, come se aveste usato l'opzione "\-O". Per dividerlo orizzontalmente, usare l'opzione "\-o". .PP Per tutte le altre opzioni, vedere vim(1). .SH VEDERE ANCHE vim(1) .SH AUTORE Buona parte di .B Vim stato scritto da Bram Moolenaar, con molto aiuto da altri. Vedere ":help credits" in .B Vim. vim-7.4.1689/runtime/doc/vimdiff-it.UTF-8.1000066400000000000000000000025031267703067000177470ustar00rootroot00000000000000.TH VIMDIFF 1 "30 marzo 2001" .SH NOME vimdiff \- modifica due, tre o quattro versioni di un file con Vim, visualizzando le differenze .SH SINTASSI .br .B vimdiff [opzioni] file1 file2 [file3 [file4]] .PP .B gvimdiff .SH DESCRIZIONE .B Vimdiff inizia .B Vim per due (o tre o quattro) file. Ogni file ha una sua finestra. Le differenze fra file sono evidenziate. È una maniera elegante per controllare modifiche e portare modifiche verso un'altra versione dello stesso file. .PP Vedere vim(1) per dettagli su Vim in generale. .PP Se iniziato con .B gvimdiff la GUI sarà utilizzata, se disponibile. .PP In ogni finestra l'opzione 'diff' è impostata, evidenziando così le differenze. .br Le opzioni 'wrap' e 'scrollbind' sono impostate per migliorare la visibilità del testo. .br L'opzione 'foldmethod' è impostata al valore "diff", che mette gruppi di linee uguali fra i diversi file in una piegatura. 'foldcolumn' è impostato a due per poter facilmente visualizzare le piegature, aprirle e chiuderle. .SH OPZIONI Lo schermo è diviso verticalmente, come se aveste usato l'opzione "\-O". Per dividerlo orizzontalmente, usare l'opzione "\-o". .PP Per tutte le altre opzioni, vedere vim(1). .SH VEDERE ANCHE vim(1) .SH AUTORE Buona parte di .B Vim è stato scritto da Bram Moolenaar, con molto aiuto da altri. Vedere ":help credits" in .B Vim. vim-7.4.1689/runtime/doc/vimdiff-ja.UTF-8.1000066400000000000000000000032401267703067000177240ustar00rootroot00000000000000.TH VIMDIFF 1 "2001 March 30" .SH 名前 vimdiff \- 二つか三つか四つのファイルを Vim で開いて、その差分を表示する .SH 書式 .br .B vimdiff [options] file1 file2 [file3 [file4]] .PP .B gvimdiff .SH 説明 .B Vimdiff は、二つ (か三つか四つ) のファイルを .B Vim で開きます。 ファイルは個別のウィンドウで開かれ、差分が強調表示されます。 同じファイルの別のバージョン間で、変更を確認したり、変更を移動したりするのが 簡単になります。 .PP Vim についての詳細は vim(1) を参照してください。 .PP .B gvimdiff という名前で起動された場合は GUI で起動します。 .PP 差分を強調表示するために、 それぞれのウィンドウの 'diff' オプションがオンに設定されます。 .br テキストを見やすくするために、オプションの 'wrap' と 'scrollbind' もオンに設 定されます。 .br 'foldmethod' オプションは "diff" に設定され、変更されていない行は折り畳まれ ます。 折り畳みの確認と開閉が簡単にできるように、'foldcolumn' は 2 に設定されます。 .SH オプション 行を並べて表示するために、"\-O" 引数を使ったときのように、ウィンドウは垂直分 割されます。 ウィンドウを水平分割したい場合は "\-o" 引数を使ってください。 .PP その他の引数については vim(1) を参照してください。 .SH 関連項目 vim(1) .SH 著者 .B Vim のほとんどの機能は Bram Moolenaar が開発し、多くの人が協力しました。 ":help credits" を参照してください。 vim-7.4.1689/runtime/doc/vimdiff-pl.1000066400000000000000000000024021267703067000171420ustar00rootroot00000000000000.TH VIMDIFF 1 "2001 Mar 30" .SH NAZWA vimdiff \- edytuj dwie, trzy lub cztery wersje pliku w Vimie i zobacz rnice .SH SYNOPSIS .br .B vimdiff [opcje] plik1 plik2 [plik3 [plik4]] .PP .B gvimdiff .SH OPIS .B Vimdiff uruchomi .B Vima z dwoma (trzema lub czterema plikami), kady z nich we wasnym oknie. Rnice midzy plikami zostan podwietlone. Jest to dobry sposb by przeanalizowa rnice i przenie zmiany z jednej wersji pliku do innej. .PP Zobacz vim(1) by pozna wicej szczegw o samym Vimie. .PP Kiedy uruchomiony jako .B gvimdiff zostanie uruchomione GUI (jeli dostpne). .PP W kadym oknie zostanie ustawiona opcja 'diff', ktra spowoduje podwietlenie rnic. .br Opcje 'wrap' i 'scrollbind' zostan ustawione by tekst si wygodnie przegldao. .br Opcja 'foldmethod' zostanie ustawiona na "diff", dziki czemu niezmienione linie zostan zwinite. 'foldcolumn' bdzie rwne 2 aby atwo wyszukiwa, otwiera i zamyka zwinicia. .SH OPCJE Pionowy podzia zostanie uyty do wyrwnania linii, tak jakby uyto opcji "\-O". Aby uzyska poziomy podzia uyj opcji "\-o". .PP Aby pozna inne opcje zobacz vim(1). .SH ZOBACZ TAKE vim(1) .SH AUTOR Wikszo .B Vima zostaa napisana przez Brama Moolenaara przy pomocy wielu innych osb. Zobacz ":help credits w .B Vimie. vim-7.4.1689/runtime/doc/vimdiff-pl.UTF-8.1000066400000000000000000000024711267703067000177520ustar00rootroot00000000000000.TH VIMDIFF 1 "2001 Mar 30" .SH NAZWA vimdiff \- edytuj dwie, trzy lub cztery wersje pliku w Vimie i zobacz różnice .SH SYNOPSIS .br .B vimdiff [opcje] plik1 plik2 [plik3 [plik4]] .PP .B gvimdiff .SH OPIS .B Vimdiff uruchomi .B Vima z dwoma (trzema lub czterema plikami), każdy z nich we własnym oknie. Różnice między plikami zostaną podświetlone. Jest to dobry sposób by przeanalizować różnice i przenieść zmiany z jednej wersji pliku do innej. .PP Zobacz vim(1) by poznać więcej szczegółów o samym Vimie. .PP Kiedy uruchomiony jako .B gvimdiff zostanie uruchomione GUI (jeśli dostępne). .PP W każdym oknie zostanie ustawiona opcja 'diff', która spowoduje podświetlenie różnic. .br Opcje 'wrap' i 'scrollbind' zostaną ustawione by tekst się wygodnie przeglądało. .br Opcja 'foldmethod' zostanie ustawiona na "diff", dzięki czemu niezmienione linie zostaną zwinięte. 'foldcolumn' będzie równe 2 aby łatwo wyszukiwać, otwierać i zamykać zwinięcia. .SH OPCJE Pionowy podział zostanie użyty do wyrównania linii, tak jakby użyto opcji "\-O". Aby uzyskać poziomy podział użyj opcji "\-o". .PP Aby poznać inne opcje zobacz vim(1). .SH ZOBACZ TAKŻE vim(1) .SH AUTOR Większość .B Vima została napisana przez Brama Moolenaara przy pomocy wielu innych osób. Zobacz ":help credits w .B Vimie. vim-7.4.1689/runtime/doc/vimdiff-ru.1000066400000000000000000000033101267703067000171540ustar00rootroot00000000000000.TH VIMDIFF 1 "2001 March 30" .SH vimdiff \- Vim . .SH .br .B vimdiff [] 1 2 [3] .PP .B gvimdiff .SH .B vimdiff .B Vim ( ) . . . ӣ . .PP Vim . vim(1). .PP .B gvimdiff , . .PP 'diff', . .br 'wrap' 'scrollbind'. .br 'foldmethod' "diff", , . 'foldcolumn' 2, , . .SH , "\-O". , , "\-o". .PP vim(1). .SH vim(1) .SH .B Vim (Bram Moolenaar), . . ":help credits" .B Vim. vim-7.4.1689/runtime/doc/vimdiff-ru.UTF-8.1000066400000000000000000000055741267703067000177740ustar00rootroot00000000000000.TH VIMDIFF 1 "2001 March 30" .SH ИМЯ vimdiff \- позволяет редактировать две или три версии файла с помощью Vim с отображением различий. .SH КОМАНДНАЯ СТРОКА .br .B vimdiff [ключи] файл1 файл2 [файл3] .PP .B gvimdiff .SH ОПИСАНИЕ Команда .B vimdiff загружает в .B Vim два (или три) файла. Каждый файл открывается в собственном окне. Различия между файлами отображаются с помощью подсветки синтаксиса. Эта команда позволяет наглядно отображать внесённые изменения и переносить различающиеся фрагменты из одной версии файла в другую. .PP Подробнее о Vim см. на странице справочника vim(1). .PP При запуске с помощью команды .B gvimdiff редактор запускается в режиме графического интерфейса, если это возможно. .PP В каждом окне включается опция 'diff', что позволяет использовать подсветку синтаксиса для отображения различий между файлами. .br Для улучшения работы с файлами в режиме отображения отличий также включаются опции 'wrap' и 'scrollbind'. .br Значение опции 'foldmethod' устанавливается равным "diff", что позволяет прятать в складку области текста, которые не отличаются в различных версиях файла. Значение опции 'foldcolumn' устанавливается равным 2, чтобы было проще находить, открывать и закрывать такие складки. .SH КЛЮЧИ ЗАПУСКА Для выравнивания строк между окнами используется вертикальное разделение окон, как если бы использовался ключ "\-O". Для того, чтобы использовать разделение окон по горизонтали, следует указать в командной строке ключ "\-o". .PP Остальные ключи командной строки рассматриваются на странице справочника vim(1). .SH СМОТРИ ТАКЖЕ vim(1) .SH АВТОРЫ Большая часть .B Vim создана Брамом Мооленааром (Bram Moolenaar), которому помогает огромное количество людей. См. ":help credits" в .B Vim. vim-7.4.1689/runtime/doc/vimdiff.1000066400000000000000000000023741267703067000165410ustar00rootroot00000000000000.TH VIMDIFF 1 "2001 March 30" .SH NAME vimdiff \- edit two, three or four versions of a file with Vim and show differences .SH SYNOPSIS .br .B vimdiff [options] file1 file2 [file3 [file4]] .PP .B gvimdiff .SH DESCRIPTION .B Vimdiff starts .B Vim on two (or three or four) 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 instead, 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. vim-7.4.1689/runtime/doc/vimdiff.man000066400000000000000000000027511267703067000171530ustar00rootroot00000000000000VIMDIFF(1) VIMDIFF(1) NAME vimdiff - edit two, three or four versions of a file with Vim and show differences SYNOPSIS vimdiff [options] file1 file2 [file3 [file4]] gvimdiff DESCRIPTION Vimdiff starts Vim on two (or three or four) 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 differ- ences 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 instead, 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 VIMDIFF(1) vim-7.4.1689/runtime/doc/vimtutor-fr.1000066400000000000000000000032641267703067000174120ustar00rootroot00000000000000.TH VIMTUTOR 1 "2 avril 2001" .SH NAME vimtutor \- tutoriel Vim .SH SYNOPSIS .br .B vimtutor [\-g] [langue] .SH DESCRIPTION .B Vimtutor lance le tutoriel .B Vim \. Il copie d'abord le fichier du tutoriel, afin que vous puissiez le modifier sans altrer le fichier original. .PP .B Vimtutor est utile pour les personnes souhaitant apprendre leurs premires commandes .B Vim \. .PP L'argument optionnel \-g lance vimtutor avec gvim plutt qu'avec vim, si l'IHM graphique de vim est disponible, ou le lance avec vim si gvim n'est pas disponible. .PP L'argument optionnel [langue] est le nom d'une langue, spcifie par son symbole deux lettres, tels que "it" ou "es". Si l'argument [langue] est omis, la langue de la rgion linguistique actuelle sera retenue. Si le tutoriel est disponible dans cette langue, il est propos. Sinon, c'est la version anglaise qui est propose. .PP .B Vim est toujours lanc en mode Compatible Vi. .SH FICHIERS .TP 15 /usr/local/lib/vim/tutor/tutor[.langue] Les fichiers textes de .B Vimtutor \. .TP 15 /usr/local/lib/vim/tutor/tutor.vim Le script Vim utilis pour copier les fichiers texte de .B Vimtutor \. .SH AUTEUR .B Vimtutor a t crit l'origine pour Vi par Michael C. Pierce et Robert K. Ware, de la Colorado School of Mines, en reprenant des ides mises par Charles Smith, de la Colorado State University. E-mail : bware@mines.colorado.edu. .br Il a t modifi pour .B Vim par Bram Moolenaar. Pour connatre le nom des traducteurs, consultez les fichiers textes du tutoriel. .SH VOIR AUSSI vim(1) .SH TRADUCTION Cette page de manuel a t traduite par David Blanchet 2004-12-27. Mise jour 2012-05-06, Dominique Pell vim-7.4.1689/runtime/doc/vimtutor-fr.UTF-8.1000066400000000000000000000033151267703067000202110ustar00rootroot00000000000000.TH VIMTUTOR 1 "2 avril 2001" .SH NAME vimtutor \- tutoriel Vim .SH SYNOPSIS .br .B vimtutor [\-g] [langue] .SH DESCRIPTION .B Vimtutor lance le tutoriel .B Vim \. Il copie d'abord le fichier du tutoriel, afin que vous puissiez le modifier sans altérer le fichier original. .PP .B Vimtutor est utile pour les personnes souhaitant apprendre leurs premières commandes .B Vim \. .PP L'argument optionnel \-g lance vimtutor avec gvim plutôt qu'avec vim, si l'IHM graphique de vim est disponible, ou le lance avec vim si gvim n'est pas disponible. .PP L'argument optionnel [langue] est le nom d'une langue, spécifiée par son symbole à deux lettres, tels que "it" ou "es". Si l'argument [langue] est omis, la langue de la région linguistique actuelle sera retenue. Si le tutoriel est disponible dans cette langue, il est proposé. Sinon, c'est la version anglaise qui est proposée. .PP .B Vim est toujours lancé en mode Compatible Vi. .SH FICHIERS .TP 15 /usr/local/lib/vim/tutor/tutor[.langue] Les fichiers textes de .B Vimtutor \. .TP 15 /usr/local/lib/vim/tutor/tutor.vim Le script Vim utilisé pour copier les fichiers texte de .B Vimtutor \. .SH AUTEUR .B Vimtutor a été écrit à l'origine pour Vi par Michael C. Pierce et Robert K. Ware, de la Colorado School of Mines, en reprenant des idées émises par Charles Smith, de la Colorado State University. E-mail : bware@mines.colorado.edu. .br Il a été modifié pour .B Vim par Bram Moolenaar. Pour connaître le nom des traducteurs, consultez les fichiers textes du tutoriel. .SH VOIR AUSSI vim(1) .SH TRADUCTION Cette page de manuel a été traduite par David Blanchet 2004-12-27. Mise à jour 2012-05-06, Dominique Pellé vim-7.4.1689/runtime/doc/vimtutor-it.1000077500000000000000000000030221267703067000174120ustar00rootroot00000000000000.TH VIMTUTOR 1 "2 aprile 2001" .SH NOME vimtutor \- Un breve corso per imparare Vim .SH SINTASSI .br .B vimtutor [\-g] [lingua] .SH DESCRIZIONE .B Vimtutor inizia il .B Vim tutor (una breve corso per imparare Vim). Per prima cosa viene creata una copia del file di lavoro, che pu cos essere modificato senza alterare il file usato come modello. .PP Il comando .B Vimtutor utile a chi voglia imparare i primi comandi .B Vim . .PP L'argomento opzionale \-g inizia vimtutor usando gvim invece che vim, se la versione GUI di vim disponibile. oppure utilizza vim, se gvim non disponibile. .PP L'arogmento opzionale [lingua] l'abbreviazione di due lettere del nome di una lingua, per esempio "it" oppure "es". se L'argomento [lingua] non viene specificato, si utilizza la lingua "locale" del computer. Se la versione in quella lingua del "tutor" disponibile, sar usata. Altrimenti sar usata la versione inglese. .PP .B Vim sempre iniziato in Modo compatibile con vi. .SH FILE .TP 15 /usr/local/lib/vim/tutor/tutor[.language] Il/I file di testo per .B Vimtutor .TP 15 /usr/local/lib/vim/tutor/tutor.vim Lo script di Vim usato per copiare il file di testo .B Vimtutor . .SH AUTORE The .B Vimtutor stato scritto in origine per Vi 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. .br stato modificato per .B Vim da Bram Moolenaar. Per i nomi dei traduttori, vedere i file usati nelle rispettive lingue. .SH VEDERE ANCHE vim(1) vim-7.4.1689/runtime/doc/vimtutor-it.UTF-8.1000066400000000000000000000030361267703067000202160ustar00rootroot00000000000000.TH VIMTUTOR 1 "2 aprile 2001" .SH NOME vimtutor \- Un breve corso per imparare Vim .SH SINTASSI .br .B vimtutor [\-g] [lingua] .SH DESCRIZIONE .B Vimtutor inizia il .B Vim tutor (una breve corso per imparare Vim). Per prima cosa viene creata una copia del file di lavoro, che può così essere modificato senza alterare il file usato come modello. .PP Il comando .B Vimtutor è utile a chi voglia imparare i primi comandi .B Vim . .PP L'argomento opzionale \-g inizia vimtutor usando gvim invece che vim, se la versione GUI di vim è disponibile. oppure utilizza vim, se gvim non è disponibile. .PP L'arogmento opzionale [lingua] è l'abbreviazione di due lettere del nome di una lingua, per esempio "it" oppure "es". se L'argomento [lingua] non viene specificato, si utilizza la lingua "locale" del computer. Se la versione in quella lingua del "tutor" è disponibile, sarà usata. Altrimenti sarà usata la versione inglese. .PP .B Vim è sempre iniziato in Modo compatibile con vi. .SH FILE .TP 15 /usr/local/lib/vim/tutor/tutor[.language] Il/I file di testo per .B Vimtutor .TP 15 /usr/local/lib/vim/tutor/tutor.vim Lo script di Vim usato per copiare il file di testo .B Vimtutor . .SH AUTORE The .B Vimtutor è stato scritto in origine per Vi 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. .br È stato modificato per .B Vim da Bram Moolenaar. Per i nomi dei traduttori, vedere i file usati nelle rispettive lingue. .SH VEDERE ANCHE vim(1) vim-7.4.1689/runtime/doc/vimtutor-ja.UTF-8.1000066400000000000000000000031731267703067000201760ustar00rootroot00000000000000.TH VIMTUTOR 1 "2001 April 2" .SH 名前 vimtutor \- Vim チュートリアル .SH 書式 .br .B vimtutor [\-g] [language] .SH 説明 .B Vim のチュートリアルを起動します。 演習ファイルのコピーを使って実施するので、オリジナルの演習ファイルを壊してし まう心配はありません。 .PP .B Vim を初めて学ぶ人向けのチュートリアルです。 .PP 引数に \-g を指定すると GUI 版の vim が利用可能であれば vim ではなく gvim を 使って vimtutor が開始します。gvim が見つからないときは Vim が使用されます。 .PP [language] 引数は "ja" や "es" などの二文字の言語名です。 [language] 引数を省略した場合はロケールの言語が使われます。 翻訳された演習ファイルがある場合は、そのファイルが使われます。 ない場合は英語のファイルが使われます。 .PP .B Vim は Vi 互換モードで起動されます。 .SH ファイル .TP 15 /usr/local/lib/vim/tutor/tutor[.language] .B Vimtutor の演習ファイル。 .TP 15 /usr/local/lib/vim/tutor/tutor.vim 演習ファイルをコピーするための Vim スクリプト。 .SH 著者 .B Vimtutor は、Colorado State University の Charles Smith のアイデアを基に、 Colorado School of Mines の Michael C. Pierce と Robert K. Ware の両名 によって Vi 向けに作成されたものを基にしています。 E-mail: bware@mines.colorado.edu. .br .B Vim に合わせて Bram Moolenaar が変更を加えました。 翻訳者の名前は演習ファイルを参照してください。 .SH 関連項目 vim(1) vim-7.4.1689/runtime/doc/vimtutor-pl.1000066400000000000000000000025041267703067000174120ustar00rootroot00000000000000.TH VIMTUTOR 1 "2001 Kwi 2" .SH NAZWA vimtutor \- nauczyciel Vima .SH SYNOPSIS .br .B vimtutor -g [jzyk] .SH OPIS .B Vimtutor uruchamia nauczyciela .B Vima. Najpierw kopiuje waciwy plik, dziki temu mona go zmienia bez obaw utraty treci. .PP .B Vimtutor przyda si ludziom, ktrzy chc si nauczy pierwszych polece .B Vima .PP Opcjonalny argument \-g uruchamia vimtutor w gvimie a nie w Vimie jeli graficzna wersja Vima jest dostpna, jeli nie zostanie uruchomiony Vim. .PP Opcjonalny argument [jzyk] jest dwu literowym kodem jzyka, tak jak "it" lub "es". Jeli brak argumentu [jzyk] zostanie uyty jzyk biecej lokalizacji. Jeli nauczyciel w tym jzyku jest dostpny, zostanie uyty \- w innym wypadku zostanie wykorzystana wersja angielska. .PP .B Vim jest uruchamiany zawsze w trybie kompatybilnoci z Vi .SH PLIKI .TP 15 /usr/local/lib/vim/tutor/tutor[.jzyk] Tekstowe pliki .B Vimtutora. .TP 15 /usr/local/lib/vim/tutor/tutor.vim Skrypt Vima uywany do kopiowania pliku .B Vimtutora. .SH AUTOR .B Vimtutor zosta pocztkowo napisany dla Vi przez Michaela C. Pierce'a i Roberta K. Ware'a z Colorado School of Mines zainspirowani przez Charlesa Smitha z Colorado State University. E-mail: bware@mines.colorado.edu .br Zmodyfikowany na potrzeby .B Vima przez Brama Moolenaara. Nazwiska tumaczy w plikach. .SH ZOBACZ TAKE vim(1) vim-7.4.1689/runtime/doc/vimtutor-pl.UTF-8.1000066400000000000000000000025471267703067000202230ustar00rootroot00000000000000.TH VIMTUTOR 1 "2001 Kwi 2" .SH NAZWA vimtutor \- nauczyciel Vima .SH SYNOPSIS .br .B vimtutor -g [język] .SH OPIS .B Vimtutor uruchamia nauczyciela .B Vima. Najpierw kopiuje właściwy plik, dzięki temu można go zmieniać bez obaw utraty treści. .PP .B Vimtutor przyda się ludziom, którzy chcą się nauczyć pierwszych poleceń .B Vima .PP Opcjonalny argument \-g uruchamia vimtutor w gvimie a nie w Vimie jeśli graficzna wersja Vima jest dostępna, jeśli nie zostanie uruchomiony Vim. .PP Opcjonalny argument [język] jest dwu literowym kodem języka, tak jak "it" lub "es". Jeśli brak argumentu [język] zostanie użyty język bieżącej lokalizacji. Jeśli nauczyciel w tym języku jest dostępny, zostanie użyty \- w innym wypadku zostanie wykorzystana wersja angielska. .PP .B Vim jest uruchamiany zawsze w trybie kompatybilności z Vi .SH PLIKI .TP 15 /usr/local/lib/vim/tutor/tutor[.język] Tekstowe pliki .B Vimtutora. .TP 15 /usr/local/lib/vim/tutor/tutor.vim Skrypt Vima używany do kopiowania pliku .B Vimtutora. .SH AUTOR .B Vimtutor został początkowo napisany dla Vi przez Michaela C. Pierce'a i Roberta K. Ware'a z Colorado School of Mines zainspirowani przez Charlesa Smitha z Colorado State University. E-mail: bware@mines.colorado.edu .br Zmodyfikowany na potrzeby .B Vima przez Brama Moolenaara. Nazwiska tłumaczy w plikach. .SH ZOBACZ TAKŻE vim(1) vim-7.4.1689/runtime/doc/vimtutor-ru.1000066400000000000000000000026421267703067000174300ustar00rootroot00000000000000.TH VIMTUTOR 1 "2001 April 2" .SH vimtutor \- Vim .SH .br .B vimtutor [] .SH .B vimtutor .B Vim. , . .PP .B vimtutor , .B Vim. .PP [] , "ru" "it". [] , . , . .PP .B Vim Vi. .SH .TP 15 /usr/local/lib/vim/tutor/tutor[.] .B vimtutor. .TP 15 /usr/local/lib/vim/tutor/tutor.vim Vim, .B vimtutor. .SH .B Vimtutor Vi . (Michael C. Pierce) . (Robert K. Ware) Colorado School of Mines (Charles Smith) Colorado State University. E-mail: bware@mines.colorado.edu. .br .B Vim (Bram Moolenaar). . .SH vim(1) vim-7.4.1689/runtime/doc/vimtutor-ru.UTF-8.1000066400000000000000000000043311267703067000202270ustar00rootroot00000000000000.TH VIMTUTOR 1 "2001 April 2" .SH ИМЯ vimtutor \- учебник по Vim .SH КОМАНДНАЯ СТРОКА .br .B vimtutor [язык] .SH ОПИСАНИЕ Команда .B vimtutor запускает учебник по .B Vim. При этом сначала происходит создание копии файла учебника, чтобы его можно было редактировать без опасения потерять исходный файл. .PP Программа .B vimtutor полезна для новичков, желающих научиться самым основным командам .B Vim. .PP Необязательный параметр [язык] представляет собой двухсимвольный код языка, например "ru" или "it". Если параметр [язык] не указан, то используется язык активной в настоящий момент локали. Если учебник на этом языке не существует, то по умолчанию используется учебник на английском языке. .PP При работе с учебником .B Vim всегда запускается в режиме совместимости с Vi. .SH ФАЙЛЫ .TP 15 /usr/local/lib/vim/tutor/tutor[.язык] Текст учебника .B vimtutor. .TP 15 /usr/local/lib/vim/tutor/tutor.vim Сценарий Vim, который используется для создания рабочей копии текста учебника .B vimtutor. .SH АВТОРЫ .B Vimtutor был впервые написан для Vi Майклом К. Пирсом (Michael C. Pierce) и Робертом К. Уэа (Robert K. Ware) из Colorado School of Mines по идее Чарльза Смита (Charles Smith) из Colorado State University. E-mail: bware@mines.colorado.edu. .br Впоследствии учебник был доработан для использования в .B Vim Брамом Мооленааром (Bram Moolenaar). Имена переводчиков учебника упоминаются в соответствующих файлах. .SH СМОТРИ ТАКЖЕ vim(1) vim-7.4.1689/runtime/doc/vimtutor.1000066400000000000000000000025361267703067000170060ustar00rootroot00000000000000.TH VIMTUTOR 1 "2001 April 2" .SH NAME vimtutor \- the Vim tutor .SH SYNOPSIS .br .B vimtutor [\-g] [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 argument \-g starts vimtutor with gvim rather than vim, if the GUI version of vim is available, or falls back to Vim if gvim is not found. .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) vim-7.4.1689/runtime/doc/vimtutor.man000066400000000000000000000032211267703067000174110ustar00rootroot00000000000000VIMTUTOR(1) VIMTUTOR(1) NAME vimtutor - the Vim tutor SYNOPSIS vimtutor [-g] [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 argument -g starts vimtutor with gvim rather than vim, if the GUI version of vim is available, or falls back to Vim if gvim is not found. 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 University. E-mail: bware@mines.col‐ orado.edu. It was modified for Vim by Bram Moolenaar. For the names of the trans‐ lators see the tutor files. SEE ALSO vim(1) 2001 April 2 VIMTUTOR(1) vim-7.4.1689/runtime/doc/visual.txt000066400000000000000000000523371267703067000171030ustar00rootroot00000000000000*visual.txt* For Vim version 7.4. Last change: 2014 Mar 23 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} {Since Vim 7.4.200 the |+visual| feature is always included} ============================================================================== 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* [count]v Start Visual mode per character. With [count] select the same number of characters or lines as used for the last Visual operation, but at the current cursor position, multiplied by [count]. When the previous Visual operation was on a block both the width and height of the block are multiplied by [count]. When there was no previous Visual operation [count] characters are selected. This is like moving the cursor right N * [count] characters. One less when 'selection' is not "exclusive". *V* *linewise-visual* [count]V Start Visual mode linewise. With [count] select the same number of lines as used for the last Visual operation, but at the current cursor position, multiplied by [count]. When there was no previous Visual operation [count] lines are selected. *CTRL-V* *blockwise-visual* [count]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|. [count] is used as with `v` above. If you use , 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* *reselect-Visual* 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. After using "p" or "P" in Visual mode the text that was put will be selected. *gn* *v_gn* gn Search forward for the last used search pattern, like with `n`, and start Visual mode to select the match. If the cursor is on the match, visually selects it. If an operator is pending, operates on the match. E.g., "dgn" deletes the text of the next match. If Visual mode is active, extends the selection until the end of the next match. *gN* *v_gN* gN Like |gn| but searches backward, like with `N`. ** 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. ** 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", has to be used instead of . ** This works like a , if it is not at the same position as . 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_* In Visual mode: Stop Visual mode. *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 ), 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) ".", "&", 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 (or when 'mousemodel' is "popup") to drag 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| at a block (with tags) |v_at| it inner block |v_it| a< a <> block (with <>) |v_a<| i< inner <> block |v_i<| a[ a [] block (with []) |v_a[| i[ inner [] block |v_i[| a" a double quoted string (with quotes) |v_aquote| i" inner double quoted string |v_iquote| a' a single quoted string (with quotes) |v_a'| i' inner simple quoted string |v_i'| a` a string in backticks (with backticks) |v_a`| i` inner string in backticks |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/" (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. Another way to operate on the Visual area is using the |/\%V| item in a pattern. For example, to replace all '(' in the Visual area with '#': > :'<,'>s/\%V(/#/g Note that the "'<,'>" will appear automatically when you press ":" in Visual mode. ============================================================================== 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} 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} 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 $ In this case the string is appended to the end of each line. 2. Block was created with {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 , 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. 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 `>a`!!datekJJ (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: stop Visual mode `> go to the end of the Visual area a break the line after the Visual area `< jump to the start of the Visual area i break the line before the Visual area !!date 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/" (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 of the test text. The following modeline settings are assumed ":ts=8:sw=4:". It will be helpful to :set hls / where is a real TAB. This helps visualise the operations. The test text is: abcdefghijklmnopqrstuvwxyz abc defghijklmnopqrstuvwxyz abcdef ghi jklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz 1. fo3jISTRING *v_b_I_example* abcdefghijklmnSTRINGopqrstuvwxyz abc STRING defghijklmnopqrstuvwxyz abcdef ghi STRING jklmnopqrstuvwxyz abcdefghijklmnSTRINGopqrstuvwxyz 2. fo3j$ASTRING *v_b_A_example* abcdefghijklmnopqrstuvwxyzSTRING abc defghijklmnopqrstuvwxyzSTRING abcdef ghi jklmnopqrstuvwxyzSTRING abcdefghijklmnopqrstuvwxyzSTRING 3. fo3j3l<.. *v_b_<_example* abcdefghijklmnopqrstuvwxyz abc defghijklmnopqrstuvwxyz abcdef ghi jklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz 4. fo3j>.. *v_b_>_example* abcdefghijklmn opqrstuvwxyz abc defghijklmnopqrstuvwxyz abcdef ghi jklmnopqrstuvwxyz abcdefghijklmn opqrstuvwxyz 5. fo5l3jrX *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: and . '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, and 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* When mappings and menus are defined with the |:vmap| or |:vmenu| command they work both in Visual mode and in Select mode. When these are used in Select mode Vim automatically switches to Visual mode, so that the same behavior as in Visual mode is effective. If you don't want this use |:xmap| or |:smap|. Users will expect printable characters to replace the selected area. Therefore avoid mapping printable characters in Select mode. Or use |:sunmap| after |:map| and |:vmap| to remove it for Select mode. 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: vim-7.4.1689/runtime/doc/windows.txt000066400000000000000000001451521267703067000172700ustar00rootroot00000000000000*windows.txt* For Vim version 7.4. Last change: 2016 Feb 01 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* *window* Summary: A buffer is the in-memory text of a file. A window is a viewport on a buffer. A tab page is a collection of windows. 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. The main Vim window can hold several split windows. There are also tab pages |tab-page|, each of which can hold multiple windows. ============================================================================== 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. This option can be local to the window, so that you can have a different status line in each window. 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] [file] *:sp* *:split* Split current window in two. The result is two viewports on the same file. Make the 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, 'eadirection' isn't "hor", and one of them is higher than the current or the new window). If [file] is given it will be edited in the new window. If it is not loaded in any buffer, it will be read. Else the new window will use the already loaded buffer. 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. The windows will be spread out horizontally if 1. a width was not specified, 2. 'equalalways' is set, 3. 'eadirection' isn't "ver", and 4. one of the other windows is wider than the current or new window. 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 an ":enew" 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. This behaves like a ":split" first, and then an ":e" command. 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' like in |:find|. 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. Doesn't work for |:execute| and |:normal|. :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'. Doesn't work for |:execute| and |:normal|. :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'. Doesn't work for |:execute| and |:normal|. *: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. Doesn't work for |:execute| and |:normal|. *: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. Doesn't work for |:execute| and |:normal|. These command modifiers can be combined to make a vertically split window occupy the full height. Example: > :vertical topleft split tags Opens a vertically split, full-height window on the "tags" file at the far left of the Vim window. Closing a window ---------------- :q[uit] :{count}q[uit] CTRL-W q *CTRL-W_q* CTRL-W CTRL-Q *CTRL-W_CTRL-Q* Without {count}: Quit the current window. If {count} is given quit the {count} 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). If [count] is greater than the last window number the last window will be closed: > :1quit " quit the first window :$quit " quit the last window :9quit " quit the last window " if there are less than 9 windows opened :-quit " quit the previews window :+quit " quit the next window :+2quit " quit the second next window < :q[uit]! :{count}q[uit]! Without {count}: Quit the current window. If {count} is given quit the {count} 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. :clo[se][!] :{count}clo[se][!] CTRL-W c *CTRL-W_c* *:clo* *:close* Without {count}: Close the current window. If {count} is given close the {count} 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). When there is only one window in the current tab page and there is another tab page, this closes the current tab page. |tab-page|. 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] :{count}hid[e] Quit the current window, unless it is the last window on the screen. For {count} see |:quit| command. The buffer becomes hidden (unless there is another window editing it or 'bufhidden' is "unload", "delete" or "wipe"). If the window is the last one in the current tab page the tab page is closed. |tab-page| 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. :on[ly][!] :{count}on[ly][!] CTRL-W o *CTRL-W_o* *E445* CTRL-W CTRL-O *CTRL-W_CTRL-O* *:on* *:only* Make the current window the only one on the screen. All other windows are closed. For {count} see |:quit| command. 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 *CTRL-W_* 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 *CTRL-W_* 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 *CTRL-W_* CTRL-W CTRL-H *CTRL-W_CTRL-H* CTRL-W *CTRL-W_* *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 *CTRL-W_* 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()|. When N is larger than the number of windows go to the last window. *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, like with CTRL-W w. 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} *CTRL-W_T* CTRL-W T Move the current window to a new tab page. This fails if there is only one window in the current tab page. When a count is specified the new tab page will be opened before the tab page with this index. Otherwise it comes after the current tab page. ============================================================================== 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. Windows with 'winfixheight' set keep their height and windows with 'winfixwidth' set keep their width. :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} 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. With the |:tab| modifier open a tab page for each argument. When there are more arguments than 'tabpagemax' further ones become split windows in the last tab page. 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] [++opt] [+cmd] {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. When using the |:tab| modifier each argument is opened in a tab page. The last window is used if it's empty. Also see |++opt| and |+cmd|. {only available when compiled with a GUI} ============================================================================== 8. Do a command in all buffers or windows *list-repeat* *:windo* :[range]windo {cmd} Execute {cmd} in each window or if [range] is given only in windows for which the window number lies in the [range]. It works like doing this: > CTRL-W t :{cmd} CTRL-W w :{cmd} etc. < This only operates in the current tab page. 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 |:tabdo|, |:argdo|, |:bufdo|, |:cdo|, |:ldo|, |:cfdo| and |:lfdo| *:bufdo* :[range]bufdo[!] {cmd} Execute {cmd} in each buffer in the buffer list or if [range] is given only for buffers for which their buffer number is in the [range]. 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 |:tabdo|, |:argdo|, |:windo|, |:cdo|, |:ldo|, |:cfdo| and |:lfdo| 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. In Visual mode uses the Visually selected text as a tag. 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. In Visual mode uses the Visually selected text as a tag. 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. In Visual mode uses the Visually selected text as a tag. 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 gf", 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} CTRL-W F *CTRL-W_F* Split current window in two. Edit file name under cursor and jump to the line number following the file name. See |gF| for details on how the line number is obtained. {not available when the |+file_in_path| feature was disabled at compile time} CTRL-W gf *CTRL-W_gf* Open a new tab page and edit the file name under the cursor. Like "tab split" and "gf", but the new tab page isn't created if the file does not exist. {not available when the |+file_in_path| feature was disabled at compile time} CTRL-W gF *CTRL-W_gF* Open a new tab page and edit the file name under the cursor and jump to the line number following the file name. Like "tab split" and "gF", but the new tab page isn't created if the file does not exist. {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 (per tab page). 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("") < Warning: This can be slow. Example *CursorHold-example* > :au! CursorHold *.[ch] nested exe "silent! ptag " . expand("") 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("") " 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: 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[!] [flags] *:files* :buffers[!] [flags] *:buffers* *:ls* :ls[!] [flags] Show all buffers. Example: 1 #h "/test/text" line 1 ~ 2u "asdf" line 0 ~ 3 %a + "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, thus 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 [flags] can be a combination of the following characters, which restrict the buffers to be listed: + modified buffers - buffers with 'modifiable' off = readonly buffers a active buffers u unlisted buffers (overrides the "!") h hidden buffers x buffers with a read error % current buffer # alternate buffer Combining flags means they are "and"ed together, e.g.: h+ hidden buffers which are modified a+ active buffers which are modified *: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. Examples: > :.,$-bdelete " delete buffers from the current one to " last but one :%bdelete " delete all buffers < :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. Everything related to the buffer is lost. All marks in this buffer become invalid, option settings are lost, etc. Don't use this unless you know what you are doing. Examples: > :.+,$bwipeout " wipe out all buffers after the current " one :%bwipeout " wipe out all buffers < :[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][!] [+cmd] [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. Also see |+cmd|. :[N]b[uffer][!] [+cmd] {bufname} Edit buffer for {bufname} 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. Also see |+cmd|. :[N]sb[uffer] [+cmd] [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. Also see |+cmd|. :[N]sb[uffer] [+cmd] {bufname} Split window and edit buffer for {bufname} from the buffer list. This will also edit a buffer that is not in the buffer list, without setting the 'buflisted' flag. Note: If what you want to do is split the buffer, make a copy under another name, you can do it this way: > :w foobar | sp # < Also see |+cmd|. :[N]bn[ext][!] [+cmd] [N] *:bn* *:bnext* *E87* Go to [N]th next buffer in buffer list. [N] defaults to one. Wraps around the end of the buffer list. See |:buffer-!| for [!]. Also see |+cmd|. 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] [+cmd] [N] Split window and go to [N]th next buffer in buffer list. Wraps around the end of the buffer list. Uses 'switchbuf' Also see |+cmd|. :[N]bN[ext][!] [+cmd] [N] *:bN* *:bNext* *:bp* *:bprevious* *E88* :[N]bp[revious][!] [+cmd] [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'. Also see |+cmd|. :[N]sbN[ext] [+cmd] [N] *:sbN* *:sbNext* *:sbp* *:sbprevious* :[N]sbp[revious] [+cmd] [N] Split window and go to [N]th previous buffer in buffer list. Wraps around the start of the buffer list. Uses 'switchbuf'. Also see |+cmd|. :br[ewind][!] [+cmd] *:br* *:brewind* Go to first buffer in buffer list. If the buffer list is empty, go to the first unlisted buffer. See |:buffer-!| for [!]. :bf[irst] [+cmd] *:bf* *:bfirst* Same as |:brewind|. Also see |+cmd|. :sbr[ewind] [+cmd] *:sbr* *:sbrewind* 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. Also see |+cmd|. :sbf[irst] [+cmd] *:sbf* *:sbfirst* Same as ":sbrewind". :bl[ast][!] [+cmd] *:bl* *:blast* Go to last buffer in buffer list. If the buffer list is empty, go to the last unlisted buffer. See |:buffer-!| for [!]. :sbl[ast] [+cmd] *:sbl* *:sblast* 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][!] [+cmd] [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] [+cmd] [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. When the |:tab| modifier is used new windows are opened in a new tab, up to 'tabpagemax'. 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 or the location list. See |:cwindow| and |:lwindow|. 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. Can be used by a file explorer plugin. The buffer is created with these settings: > :setlocal buftype=nowrite :setlocal bufhidden=delete :setlocal 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: > :setlocal buftype=nofile :setlocal bufhidden=hide :setlocal noswapfile < The buffer name can be used to identify the buffer, if you give it a meaningful name. *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: > :setlocal nobuflisted < vim:tw=78:ts=8:ft=help:norl: vim-7.4.1689/runtime/doc/workshop.txt000066400000000000000000000110271267703067000174430ustar00rootroot00000000000000*workshop.txt* For Vim version 7.4. Last change: 2013 Jul 06 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=/contrib/contrib6/ 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 /bin/gvim to point to the vim in your newly installed directory. The 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 provided by Arnaud Le Hors of the French National Institute for Research in Computer Science and Control. It can be downloaded from http://cgit.freedesktop.org/xorg/lib/libXpm. 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: vim-7.4.1689/runtime/doc/xxd-fr.1000066400000000000000000000275671267703067000163400ustar00rootroot00000000000000.TH XXD 1 "aot 1996" "Page de manuel pour xxd" .\" .\" 21st May 1996 .\" Man page author: .\" Tony Nugent .\" Changes by Bram Moolenaar .\" French translation by David Blanchet 2005-03 .SH NOM .I xxd \- convertit en reprsentation hexadcimale et inversement. .SH SYNOPSIS .B xxd \-h[elp] .br .B xxd [options] [fichier_entree [fichier_sortie]] .br .B xxd \-r[evert] [options] [fichier_entree [fichier_sortie]] .SH DESCRIPTION .I xxd cre un fichier contenant la reprsentation hexadcimale d'un fichier binaire ou de l'entre standard. Il peut galement convertir un fichier de codes hexadcimaux en un fichier binaire. Comme .BR uuencode (1) et .BR uudecode (1) il permet la transmission de donnes binaires dans une reprsentation ASCII compatible avec le courrier lectronique, mais a l'avantage de dcoder la sortie standard. De plus, il peut tre utilis pour appliquer des rustines des fichiers binaires. .SH OPTIONS Si aucun .I fichier_entree n'est spcifi, l'entre standard est utilise. Si .I fichier_entree correspond au caractre .RB '\-' \, l'entre standard est employe comme source des donnes en entre. Si aucun .I fichier_sortie n'est spcifi (ou qu'un caractre .RB '\-' est donn sa place), le rsultat est envoy sur la sortie standard. .PP NOTE : un analyseur paresseux est utilis. Il ne vrifie pas au-del de la premire lettre de l'option, moins que cette dernire ne requiert un paramtre. L'espace entre l'option et son paramtre est optionnel. Les paramtres des options peuvent tre spcifis en notation dcimale, hexadcimale ou octale. Ainsi .BR \-c8 , .BR "\-c 8" , .B \-c 010 et .B \-cols 8 sont tous quivalents. .TP .IR \-a " | " \-autoskip active la fonctionnalit "autoskip" : le caractre '*' remplace les lignes d'octets nuls. Dsactive par dfaut. .TP .IR \-b " | " \-bits Convertit en binaires plutt qu'en hexadcimal. Cette option crit les octets comme une squence de "1" et de "0" au lieu d'une conversion en hexadcimal traditionnel. Chaque ligne est prcde par un numro de ligne en hexadcimal et suivie de la reprsentation ASCII (ou EBCDIC) correspondante. Les options \-r, \-p, \-i ne fonctionnent pas dans ce mode. .TP .IR "\-c cols " | " \-cols cols" place .RI < cols > octets par ligne. 16 par dfaut (\-i : 12, \-ps : 30, \-b : 6). Maximum 256. .TP .IR \-E " | " \-EBCDIC Passe le codage des caractres de la colonne de droite de ASCII EBCDIC. Cela ne change pas la reprsentation hexadcimale. Cette option est sans effet quand elle est utilise avec \-r, \-p or \-i. .TP .IR "\-g octets " | " \-groupsize octets" Regroupe les octets (deux chiffres hexadcimaux ou huit chiffres binaires) par groupe de .RI < octets > \, spars par des espaces blancs. Spcifiez .I \-g 0 pour supprimer le regroupement. .RI < octets > vaut 2 par dfaut dans le mode normal et \fI1\fP en reprsentation binaire. Le regroupement ne s'applique pas aux styles Postscript et Include. .TP .IR \-h " | " \-help Affiche un rsum des commandes disponibles et quitte. Aucune conversion n'est effectue. .TP .IR \-i " | " \-include produit une sortie dans le style #include (fichier C inclure). La dfinition complte d'un tableau statique est crite et est nomme d'aprs le fichier d'origine, moins que xxd lise depuis l'entre standard. .TP .IR "\-l long " | " \-len long" Arrte aprs l'criture de .RI < long > octets. .TP .IR \-p " | " \-ps " | " \-postscript " | " \-plain Produit une conversion continue dans le style Postscript (postscript continuous hexdumd style). galement connu sous le nom de conversion brute (plain hexdump style). .TP .IR \-r " | " \-revert Opration inverse : convertit un fichier hexadcimal en un fichier binaire (ou applique une rustine un fichier binaire). Si l'criture n'a pas lieu sur la sortie standard, xxd crit dans le fichier qu'il produit sans le tronquer. Utilisez la combinaison .I \-r \-p pour lire de l'hexadcimal brut sans information sur le numro des lignes et sans format de colonnes particulier. Des espaces blancs et coupures de lignes supplmentaires sont autoriss n'importe quel endroit. .TP .I \-seek dcalage Utilis aprs l'option .IR \-r : inverse la conversion en ajoutant .RI < dcalage > aux positions dans le fichier donnes dans le code hexadcimal. .TP .I \-s [+][\-]dcalage Dbute au .RI < dcalage > absolu ou relatif dans fichier_entree. \fI+ \fRindique que le dcalage est relatif la position courante dans l'entre standard (sans effet si la lecture n'a pas lieu sur l'entre standard). \fI\- \fRindique un dcalage en caractres depuis la fin de l'entre (utilis avec \fI+\fR, dsigne la position avant la position actuelle de l'entre standard). Sans l'option \-s, xxd dmarre la position courante du fichier. .TP .I \-u Utilise des chiffres hexadcimaux majuscules. La casse par dfaut est minuscule. .TP .IR \-v " | " \-version Affiche la version de xxd. .SH MISE EN GARDE .I xxd \-r effectue des oprations internes un peu obscures lors de l'valuation des informations sur les numros de lignes. Si le fichier de sortie est adressable, alors les numros de lignes au dbut de chaque ligne d'hexadcimal peuvent tre dsordonnes, des lignes peuvent manquer ou se chevaucher. Dans ces cas, xxd utilisera lseek(2) pour dterminer la prochaine position. Si le fichier n'est pas adressable, seuls les vides sont autoriss, et ils seront combls par des octets nuls. .PP .I xxd \-r ne gnre aucune erreur lors de l'analyse. Les problmes sont passs silencieusement. .PP Lors de l'dition de la reprsentation hexadcimale, veuillez noter que .I xxd \-r ignore tout ce qui se trouve sur la ligne aprs avoir lu suffisamment de donnes hexadcimales (voir l'option \-c). Cela signifie galement que les modifications dans la colonne ASCII (ou EBCDIC) sont toujours ignores. La conversion inverse de donnes hexadcimales brutes (postscript) avec xxd \-r \-p ne dpend pas d'un nombre correct de colonnes. Dans ce cas, tout ce qui ressemble une paire de chiffres hexadcimaux est interprt. .PP Remarquez la diffrence entre .br \fI% xxd \-i fichier\fR .br et .br \fI% xxd \-i < fichier\fR .PP .I xxd \-s \+seek peut diffrer de .IR "xxd \-s seek" , car lseek(2) est utilis pour revenir en arrire . Le '+' fait une diffrence quand la source des donnes est l'entre standard et si la position dans le fichier de l'entre standard n'est pas au dbut du fichier lorsque xxd est dmarr et qu'il reoit ses donnes. L'exemple suivant peut vous aider comprendre (ou bien vous perdre davantage encore !)... .PP Remettre l'entre standard au dpart avant de lire ; ncessaire car 'cat' a dj lu jusqu' la fin de l'entre standard. .br \fI% sh \-c 'cat > donnees_binaires; xxd \-s 0 > donnees_hexa' < fichier\fR .PP Convertir partir de la position 0x480 (= 1024 + 128) du fichier. Le symbole '+' signifie "relativement la position actuelle', ainsi 128 est ajout aux 1024 octets comptabiliss pour dd. .br \fI% sh \-c 'dd of=donnees_binaires bs=1k count=1; xxd \-s +128 > donnees_hexa' < fichier\fR .PP Convertir de fichier depuis la position 0x100 (= 1024 \- 768) du fichier. .br \fI% sh \-c 'dd of=donnees_binaires bs=1k count=1; xxd \-s +\-768 > donnees_hexa' < fichier\fR .PP Toutefois, cette situation est peu frquente et l'utilisation de '+' est rarement requise. L'auteur prfre surveiller les effets de xxd avec strace(1) ou truss(1) quand \-s est employ. .SH EXEMPLES Afficher la totalit du .B fichier sauf les trois premires lignes (0x30 octets en hexadcimal). .br \fI% xxd \-s 0x30 fichier\fR .PP afficher les trois dernires lignes (0x30 octets en hexadcimal) du .B fichier \. .br \fI% xxd \-s \-0x30 fichier\fR .PP .br Afficher 120 octets convertis en continu, avec 20 octets par ligne. .br \fI% xxd \-l 120 \-ps \-c 20 xxd\-fr.1\fR .br 2e54482058584420312022616ffb742031393936 .br 22202250616765206465206d616e75656c20706f .br 757220787864220a2e5c220a2e5c222032317374 .br 204d617920313939360a2e5c22204d616e207061 .br 676520617574686f723a0a2e5c2220202020546f .br 6e79204e7567656e74203c746f6e79407363746e .br 204e7567656e74203c746f6e79407363746e7567 .br 2e54482058584420312022417567757374203139 .PP Convertir les 120 premiers octets de cette page de manuel avec 12 octets par ligne. .br \fI% xxd \-l 120 \-c 12 xxd\-fr.1\fR .br 0000000: 2e54 4820 5858 4420 3120 2261 .TH XXD 1 "a .br 000000c: 6ffb 7420 3139 3936 2220 2250 o.t 1996" "P .br 0000018: 6167 6520 6465 206d 616e 7565 age de manue .br 0000024: 6c20 706f 7572 2078 7864 220a l pour xxd". .br 0000030: 2e5c 220a 2e5c 2220 3231 7374 .\"..\" 21st .br 000003c: 204d 6179 2031 3939 360a 2e5c May 1996..\ .br 0000048: 2220 4d61 6e20 7061 6765 2061 " Man page a .br 0000054: 7574 686f 723a 0a2e 5c22 2020 uthor:..\" .br 0000060: 2020 546f 6e79 204e 7567 656e Tony Nugen .br 000006c: 7420 3c74 6f6e 7940 7363 746e t fichier_sortie\fR .PP Patcher la date dans le fichier xxd.1 .br \fI% echo '0000037: 3574 68' | xxd \-r \- xxd\-fr.1\fR .br \fI% xxd \-s 0x38 \-l 13 \-c 13 xxd\-fr.1\fR .br 0000036: 3235 7468 204d 6179 2031 3939 36 25th May 1996 .PP Crer un fichier de 65537 octets tous nuls (0x00), sauf le dernier qui vaut 'A' (0x41 en hexadcimal). .br \fI% echo '010000: 41' | xxd \-r \> fichier\fR .PP .br Convertir le fichier de l'exemple prcdent avec la fonctionnalit "autoskip". .br \fI% xxd \-a \-c 12 fichier\fR .br 0000000: 0000 0000 0000 0000 0000 0000 ............ .br * .br 000fffc: 0000 0000 40 ....A .PP Crer un fichier d'un octet, contenant seulement le caractre 'A'. Le nombre aprs '\-r \-s' s'ajoute aux numros de lignes trouves dans le fichier ; les octets initiaux sont supprims. .br \fI% echo '010000: 41' | xxd \-r \-s \-0x10000 \> fichier\fR .PP Utiliser xxd comme filtre dans un diteur tel que .B vim(1) pour convertir une zone comprise entre les marques 'a' et 'z'. .br \fI:'a,'z!xxd\fR .PP Utiliser xxd comme filtre dans un diteur tel que .B vim(1) pour rcuprer une conversion binaire comprise entre les marques 'a' et 'z'. .br \fI:'a,'z!xxd \-r\fR .PP Utiliser xxd comme filtre dans un diteur tel que .B vim(1) pour rcuprer une ligne convertie. Placez le curseur sur la ligne et tapez : .br \fI!!xxd \-r\fR .PP Lire des caractres depuis une connexion srie : .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 .SH VALEURS DE RETOUR Les erreurs suivantes sont rapportes : .TP 0 aucune erreur ne s'est produit. .TP \-1 opration non supporte ( .I xxd \-r \-i reste impossible). .TP 1 erreur lors de l'analyse des options. .TP 2 problme avec le fichier d'entre. .TP 3 problme avec le fichier de sortie. .TP 4, 5 la position spcifie n'est pas atteignable. .SH VOIR AUSSI uuencode(1), uudecode(1), patch(1) .SH AVERTISSEMENTS L'tranget de cet outil reflte celle du cerveau de ses crateurs. Utilisez cet outil vos risques et prils. Dupliquez vos fichiers. Surveillez l'outil. Devenez un gourou. .SH VERSION Cette page de manuel documente la version 1.7 de xxd. .SH AUTEUR (c) 1990-1997 par Juergen Weigert .br .LP "Distribute freely and credit me, .br make money and share with me, .br lose money and don't ask me." .PP Distribution libre en citant l'auteur, .br gagnez de l'argent, pensez moi, .br perdez de l'argent, oubliez-moi. .PP Page de manuel dbute par Tony Nugent .br .br Modifications mineures par Bram Moolenaar. dit par Juergen Weigert. .SH TRADUCTION Cette page de manuel a t traduite par David Blanchet 2004-12-24. Mise jour 2013-05-10, Dominique Pell vim-7.4.1689/runtime/doc/xxd-fr.UTF-8.1000066400000000000000000000301441267703067000171230ustar00rootroot00000000000000.TH XXD 1 "août 1996" "Page de manuel pour xxd" .\" .\" 21st May 1996 .\" Man page author: .\" Tony Nugent .\" Changes by Bram Moolenaar .\" French translation by David Blanchet 2005-03 .SH NOM .I xxd \- convertit en représentation hexadécimale et inversement. .SH SYNOPSIS .B xxd \-h[elp] .br .B xxd [options] [fichier_entree [fichier_sortie]] .br .B xxd \-r[evert] [options] [fichier_entree [fichier_sortie]] .SH DESCRIPTION .I xxd crée un fichier contenant la représentation hexadécimale d'un fichier binaire ou de l'entrée standard. Il peut également convertir un fichier de codes hexadécimaux en un fichier binaire. Comme .BR uuencode (1) et .BR uudecode (1) il permet la transmission de données binaires dans une représentation ASCII compatible avec le courrier électronique, mais a l'avantage de décoder la sortie standard. De plus, il peut être utilisé pour appliquer des rustines à des fichiers binaires. .SH OPTIONS Si aucun .I fichier_entree n'est spécifié, l'entrée standard est utilisée. Si .I fichier_entree correspond au caractère .RB '\-' \, l'entrée standard est employée comme source des données en entrée. Si aucun .I fichier_sortie n'est spécifié (ou qu'un caractère .RB '\-' est donné à sa place), le résultat est envoyé sur la sortie standard. .PP NOTE : un analyseur paresseux est utilisé. Il ne vérifie pas au-delà de la première lettre de l'option, à moins que cette dernière ne requiert un paramètre. L'espace entre l'option et son paramètre est optionnel. Les paramètres des options peuvent être spécifiés en notation décimale, hexadécimale ou octale. Ainsi .BR \-c8 , .BR "\-c 8" , .B \-c 010 et .B \-cols 8 sont tous équivalents. .TP .IR \-a " | " \-autoskip active la fonctionnalité "autoskip" : le caractère '*' remplace les lignes d'octets nuls. Désactivée par défaut. .TP .IR \-b " | " \-bits Convertit en binaires plutôt qu'en hexadécimal. Cette option écrit les octets comme une séquence de "1" et de "0" au lieu d'une conversion en hexadécimal traditionnel. Chaque ligne est précédée par un numéro de ligne en hexadécimal et suivie de la représentation ASCII (ou EBCDIC) correspondante. Les options \-r, \-p, \-i ne fonctionnent pas dans ce mode. .TP .IR "\-c cols " | " \-cols cols" place .RI < cols > octets par ligne. 16 par défaut (\-i : 12, \-ps : 30, \-b : 6). Maximum 256. .TP .IR \-E " | " \-EBCDIC Passe le codage des caractères de la colonne de droite de ASCII à EBCDIC. Cela ne change pas la représentation hexadécimale. Cette option est sans effet quand elle est utilisée avec \-r, \-p or \-i. .TP .IR "\-g octets " | " \-groupsize octets" Regroupe les octets (deux chiffres hexadécimaux ou huit chiffres binaires) par groupe de .RI < octets > \, séparés par des espaces blancs. Spécifiez .I \-g 0 pour supprimer le regroupement. .RI < octets > vaut 2 par défaut dans le mode normal et \fI1\fP en représentation binaire. Le regroupement ne s'applique pas aux styles Postscript et Include. .TP .IR \-h " | " \-help Affiche un résumé des commandes disponibles et quitte. Aucune conversion n'est effectuée. .TP .IR \-i " | " \-include produit une sortie dans le style #include (fichier C à inclure). La définition complète d'un tableau statique est écrite et est nommée d'après le fichier d'origine, à moins que xxd lise depuis l'entrée standard. .TP .IR "\-l long " | " \-len long" Arrête après l'écriture de .RI < long > octets. .TP .IR \-p " | " \-ps " | " \-postscript " | " \-plain Produit une conversion continue dans le style Postscript (postscript continuous hexdumd style). Également connu sous le nom de « conversion brute » (plain hexdump style). .TP .IR \-r " | " \-revert Opération inverse : convertit un fichier hexadécimal en un fichier binaire (ou applique une rustine à un fichier binaire). Si l'écriture n'a pas lieu sur la sortie standard, xxd écrit dans le fichier qu'il produit sans le tronquer. Utilisez la combinaison .I \-r \-p pour lire de l'hexadécimal brut sans information sur le numéro des lignes et sans format de colonnes particulier. Des espaces blancs et coupures de lignes supplémentaires sont autorisés à n'importe quel endroit. .TP .I \-seek décalage Utilisé après l'option .IR \-r : inverse la conversion en ajoutant .RI < décalage > aux positions dans le fichier données dans le code hexadécimal. .TP .I \-s [+][\-]décalage Débute au .RI < décalage > absolu ou relatif dans fichier_entree. \fI+ \fRindique que le décalage est relatif à la position courante dans l'entrée standard (sans effet si la lecture n'a pas lieu sur l'entrée standard). \fI\- \fRindique un décalage en caractères depuis la fin de l'entrée (utilisé avec \fI+\fR, désigne la position avant la position actuelle de l'entrée standard). Sans l'option \-s, xxd démarre à la position courante du fichier. .TP .I \-u Utilise des chiffres hexadécimaux majuscules. La casse par défaut est minuscule. .TP .IR \-v " | " \-version Affiche la version de xxd. .SH MISE EN GARDE .I xxd \-r effectue des opérations internes un peu obscures lors de l'évaluation des informations sur les numéros de lignes. Si le fichier de sortie est adressable, alors les numéros de lignes au début de chaque ligne d'hexadécimal peuvent être désordonnées, des lignes peuvent manquer ou se chevaucher. Dans ces cas, xxd utilisera lseek(2) pour déterminer la prochaine position. Si le fichier n'est pas adressable, seuls les vides sont autorisés, et ils seront comblés par des octets nuls. .PP .I xxd \-r ne génère aucune erreur lors de l'analyse. Les problèmes sont passés silencieusement. .PP Lors de l'édition de la représentation hexadécimale, veuillez noter que .I xxd \-r ignore tout ce qui se trouve sur la ligne après avoir lu suffisamment de données hexadécimales (voir l'option \-c). Cela signifie également que les modifications dans la colonne ASCII (ou EBCDIC) sont toujours ignorées. La conversion inverse de données hexadécimales brutes (postscript) avec xxd \-r \-p ne dépend pas d'un nombre correct de colonnes. Dans ce cas, tout ce qui ressemble à une paire de chiffres hexadécimaux est interprété. .PP Remarquez la différence entre .br \fI% xxd \-i fichier\fR .br et .br \fI% xxd \-i < fichier\fR .PP .I xxd \-s \+seek peut différer de .IR "xxd \-s seek" , car lseek(2) est utilisé pour « revenir en arrière ». Le '+' fait une différence quand la source des données est l'entrée standard et si la position dans le fichier de l'entrée standard n'est pas au début du fichier lorsque xxd est démarré et qu'il reçoit ses données. L'exemple suivant peut vous aider à comprendre (ou bien vous perdre davantage encore !)... .PP Remettre l'entrée standard au départ avant de lire ; nécessaire car 'cat' a déjà lu jusqu'à la fin de l'entrée standard. .br \fI% sh \-c 'cat > donnees_binaires; xxd \-s 0 > donnees_hexa' < fichier\fR .PP Convertir à partir de la position 0x480 (= 1024 + 128) du fichier. Le symbole '+' signifie "relativement à la position actuelle', ainsi 128 est ajouté aux 1024 octets comptabilisés pour dd. .br \fI% sh \-c 'dd of=donnees_binaires bs=1k count=1; xxd \-s +128 > donnees_hexa' < fichier\fR .PP Convertir de fichier depuis la position 0x100 (= 1024 \- 768) du fichier. .br \fI% sh \-c 'dd of=donnees_binaires bs=1k count=1; xxd \-s +\-768 > donnees_hexa' < fichier\fR .PP Toutefois, cette situation est peu fréquente et l'utilisation de '+' est rarement requise. L'auteur préfère surveiller les effets de xxd avec strace(1) ou truss(1) quand \-s est employé. .SH EXEMPLES Afficher la totalité du .B fichier sauf les trois premières lignes (0x30 octets en hexadécimal). .br \fI% xxd \-s 0x30 fichier\fR .PP afficher les trois dernières lignes (0x30 octets en hexadécimal) du .B fichier \. .br \fI% xxd \-s \-0x30 fichier\fR .PP .br Afficher 120 octets convertis en continu, avec 20 octets par ligne. .br \fI% xxd \-l 120 \-ps \-c 20 xxd\-fr.1\fR .br 2e54482058584420312022616ffb742031393936 .br 22202250616765206465206d616e75656c20706f .br 757220787864220a2e5c220a2e5c222032317374 .br 204d617920313939360a2e5c22204d616e207061 .br 676520617574686f723a0a2e5c2220202020546f .br 6e79204e7567656e74203c746f6e79407363746e .br 204e7567656e74203c746f6e79407363746e7567 .br 2e54482058584420312022417567757374203139 .PP Convertir les 120 premiers octets de cette page de manuel avec 12 octets par ligne. .br \fI% xxd \-l 120 \-c 12 xxd\-fr.1\fR .br 0000000: 2e54 4820 5858 4420 3120 2261 .TH XXD 1 "a .br 000000c: 6ffb 7420 3139 3936 2220 2250 o.t 1996" "P .br 0000018: 6167 6520 6465 206d 616e 7565 age de manue .br 0000024: 6c20 706f 7572 2078 7864 220a l pour xxd". .br 0000030: 2e5c 220a 2e5c 2220 3231 7374 .\"..\" 21st .br 000003c: 204d 6179 2031 3939 360a 2e5c May 1996..\ .br 0000048: 2220 4d61 6e20 7061 6765 2061 " Man page a .br 0000054: 7574 686f 723a 0a2e 5c22 2020 uthor:..\" .br 0000060: 2020 546f 6e79 204e 7567 656e Tony Nugen .br 000006c: 7420 3c74 6f6e 7940 7363 746e t fichier_sortie\fR .PP Patcher la date dans le fichier xxd.1 .br \fI% echo '0000037: 3574 68' | xxd \-r \- xxd\-fr.1\fR .br \fI% xxd \-s 0x38 \-l 13 \-c 13 xxd\-fr.1\fR .br 0000036: 3235 7468 204d 6179 2031 3939 36 25th May 1996 .PP Créer un fichier de 65537 octets tous nuls (0x00), sauf le dernier qui vaut 'A' (0x41 en hexadécimal). .br \fI% echo '010000: 41' | xxd \-r \> fichier\fR .PP .br Convertir le fichier de l'exemple précédent avec la fonctionnalité "autoskip". .br \fI% xxd \-a \-c 12 fichier\fR .br 0000000: 0000 0000 0000 0000 0000 0000 ............ .br * .br 000fffc: 0000 0000 40 ....A .PP Créer un fichier d'un octet, contenant seulement le caractère 'A'. Le nombre après '\-r \-s' s'ajoute aux numéros de lignes trouvées dans le fichier ; les octets initiaux sont supprimés. .br \fI% echo '010000: 41' | xxd \-r \-s \-0x10000 \> fichier\fR .PP Utiliser xxd comme filtre dans un éditeur tel que .B vim(1) pour convertir une zone comprise entre les marques 'a' et 'z'. .br \fI:'a,'z!xxd\fR .PP Utiliser xxd comme filtre dans un éditeur tel que .B vim(1) pour récupérer une conversion binaire comprise entre les marques 'a' et 'z'. .br \fI:'a,'z!xxd \-r\fR .PP Utiliser xxd comme filtre dans un éditeur tel que .B vim(1) pour récupérer une ligne convertie. Placez le curseur sur la ligne et tapez : .br \fI!!xxd \-r\fR .PP Lire des caractères depuis une connexion série : .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 .SH VALEURS DE RETOUR Les erreurs suivantes sont rapportées : .TP 0 aucune erreur ne s'est produit. .TP \-1 opération non supportée ( .I xxd \-r \-i reste impossible). .TP 1 erreur lors de l'analyse des options. .TP 2 problème avec le fichier d'entrée. .TP 3 problème avec le fichier de sortie. .TP 4, 5 la position spécifiée n'est pas atteignable. .SH VOIR AUSSI uuencode(1), uudecode(1), patch(1) .SH AVERTISSEMENTS L'étrangeté de cet outil reflète celle du cerveau de ses créateurs. Utilisez cet outil à vos risques et périls. Dupliquez vos fichiers. Surveillez l'outil. Devenez un gourou. .SH VERSION Cette page de manuel documente la version 1.7 de xxd. .SH AUTEUR (c) 1990-1997 par Juergen Weigert .br .LP "Distribute freely and credit me, .br make money and share with me, .br lose money and don't ask me." .PP Distribution libre en citant l'auteur, .br gagnez de l'argent, pensez à moi, .br perdez de l'argent, oubliez-moi. .PP Page de manuel débutée par Tony Nugent .br .br Modifications mineures par Bram Moolenaar. Édité par Juergen Weigert. .SH TRADUCTION Cette page de manuel a été traduite par David Blanchet 2004-12-24. Mise à jour 2013-05-10, Dominique Pellé vim-7.4.1689/runtime/doc/xxd-it.1000077500000000000000000000273251267703067000163400ustar00rootroot00000000000000.TH XXD 1 "Agosto 1996" "Pagina di manuale per xxd" .\" .\" 21 Maggio 1996 .\" Autore della pagina di manuale: .\" Tony Nugent .\" Modificato da Bram Moolenaar .SH NOME .I xxd \- Produce esadecimale da un file binario o viceversa. .SH SINTASSI .B xxd \-h[elp] .br .B xxd [opzioni] [input_file [output_file]] .br .B xxd \-r[evert] [opzioni] [input_file [output_file]] .SH DESCRIZIONE .I xxd crea un'immagine esadecimale di un dato file o dello "standard input". Pu anche ottenere da un'immagine esadecimale il file binario originale. Come .BR uuencode (1) e .BR uudecode (1) permette di trasmettere dati binari in una rappresentazione ASCII "a prova di email", ma ha anche il vantaggio di poter decodificare sullo "standard output". Inoltre, pu essere usato per effettuare delle modifiche (patch) a file binari. .SH OPZIONI Se non si specifica un .I input_file il programma legge dallo "standard input". Se .I input_file specificato come il carattere .RB \` \- ' , l'input letto dallo "standard input". Se non si specifica un .I output_file (o si mette al suo posto il carattere .RB \` \- ' ), i risultati sono inviati allo "standard output". .PP Si noti che la scansione dei caratteri "pigra", e non controlla oltre la prima lettera dell'opzione, a meno che l'opzione sia seguita da un parametro. Gli spazi fra una singola lettera di opzione e il corrispondente parametro dopo di essa sono facoltativi. I parametri delle opzioni possono essere specificati usando la notazione decimale, esadecimale oppure ottale. Pertanto .BR \-c8 , .BR "\-c 8" , .B \-c 010 e .B \-cols 8 sono notazioni equivalenti fra loro. .PP .TP .IR \-a " | " \-autoskip Richiesta di autoskip: Un singolo '*' rimpiazza linee di zeri binari. Valore di default: off. .TP .IR \-b " | " \-bits Richiesta di una immagine binaria (cifre binarie), invece che esadecimale. Questa opzione scrive un byte come otto cifre "1" e "0" invece di usare i numeri esadecimali. Ogni linea preceduta da un indirizzo in esadecimale e seguita da una decodifica ascii (o ebcdic). Le opzioni specificabili dalla linea comando \-r, \-p, \-i non funzionano in questo modo. .TP .IR "\-c colonne " | " \-cols colonne" .IR "\-c colonne " | " \-cols colonne" In ogni linea sono formattate .RI < colonne > colonne. Valore di default 16 (\-i: 12, \-ps: 30, \-b: 6). Valore massimo 256. .TP .IR \-E " | " \-EBCDIC Cambia la codifica della colonna di destra da ASCII a EBCDIC. Questo non modifica la rappresentazione esadecimale. Non ha senso specificare questa opzione in combinazione con \-r, \-p o \-i. .TP .IR "\-g numero_byte " | " \-groupsize numero_byte" Inserisci ogni .RI < numero_byte > byte di output (di due caratteri esadecimali o otto numeri binari ognuno) uno spazio bianco. Specificando .I \-g 0 i byte di output non sono separati da alcuno spazio. .RI < numero_byte > ha come valore di default " 2 in modalit normale [esadecimale] e \fI1\fP in modalit binaria. Il raggruppamento non si applica agli stili "PostScript" e "include". .TP .IR \-h " | " \-help stampa un sommario dei comandi disponibili ed esce. Non viene fatto null'altro. .TP .IR \-i " | " \-include L'output nello stile dei file "include" in C. Viene preparata la definizione completa di un "array" [vettore], dandogli il nome del file di input), tranne che nel caso in cui xxd legga dallo "standard input". .TP .IR "\-l numero " | " \-len numero" Il programma esce dopo aver scritto .RI < numero > byte. .TP .IR \-p " | " \-ps " | " \-postscript " | " \-plain L'output nello stile di un dump continuo sotto postscript. Noto anche come stile esadecimale semplice [plain]. .TP .IR \-r " | " \-revert ricostruzione: converte (o mette una patch) a partire dall'immagine esadecimale, creando [o modificando] il file binario. Se non diretto allo "standard output", xxd scrive nel suo file di output in maniera continua, senza interruzioni. Usare la combinazione .I \-r \-p per leggere dump in stile esadecimale semplice [plain], senza l'informazione di numero di linea e senza un particolare tracciato di colonna. Degli spazi o delle linee vuote possono essere inserite a piacere [e vengono ignorate]. .TP .I \-seek distanza Usato con l'opzione .IR \-r : (ricostruzione), .RI < distanza > viene aggiunta alla posizione nel file trovata nella immagine esadecimale. .TP .I \-s [+][\-]seek Inizia a .RI < seek > byte assoluti (o relativi) di distanza all'interno di input_file. \fI+ \fRindica che il "seek" relativo alla posizione corrente nel file "standard input" (non significativa quando non si legge da "standard input"). \fI\- \fRindica che il "seek" dovrebbe posizionarsi ad quel numero di caratteri dalla fine dell'input (o se in combinazione con \fI+ \fR: prime della posizione corrente nel file "standard input"). Se non si specifica una opzione \-s, xxd inizia alla posizione corrente all'interno del file. .TP .I \-u usa lettere esadecimali maiuscole. Il valore di default di usare lettere minuscole. .TP .IR \-v " | " \-version visualizza la stringa contenente la versione del programma. .SH ATTENZIONE .PP .I xxd \-r capace di operare "magie" nell'utilizzare l'informazione "numero di linea". Se sul file di output ci si pu posizionare usando la "seek", il numero di linea all'inizio di ogni riga esadecimale pu essere non ordinato, delle linee possono mancare delle linee, oppure esserci delle sovrapposizioni. In simili casi xxd user lseek(2) per raggiungere la posizione d'inizio. Se il file di output non consente di usare "seek", sono permessi solo dei "buchi", che saranno riempiti con zeri binari. .PP .I xxd \-r non genera mai errori di specifica parametri. I parametri non riconosciuti sono silenziosamente ignorati. .PP Nel modificare immagini esadecimali, tenete conto che .I xxd \-r salta il resto della linea, dopo aver letto abbastanza caratteri contenenti dati esadecimali (vedere opzione \-c). Ci implica pure che le modifiche alle colonne di caratteri stampabili ascii (o ebcdic) sono sempre ignorate. La ricostruzione da un file immagine esadecimale in stile semplice (postscript) con xxd \-r \-p non dipende dal numero corretto di colonne. IN questo caso, qualsiasi cosa assomigli a una coppia di cifre esadecimali interpretata [e utilizzata]. .PP Notare la differenza fra .br \fI% xxd \-i file\fR .br e .br \fI% xxd \-i \< file\fR .PP .I xxd \-s \+seek pu comportarsi in modo diverso da .IR "xxd \-s seek" , perch lseek(2) usata per tornare indietro nel file di input. Il '+' fa differenza se il file di input lo "standard input", e se la posizione nel file di "standard input" non all'inizio del file quando xxd eseguito, con questo input. I seguenti esempi possono contribuire a chiarire il concetto (o ad oscurarlo!)... .PP Riavvolge lo "standard input" prima di leggere; necessario perch `cat' ha gi letto lo stesso file ["file"] fino alla fine dello "standard input". .br \fI% sh \-c 'cat > copia_normale; xxd \-s 0 > copia_esadecimale' < file .PP Stampa immagine esadecimale dalla posizione file 0x480 (=1024+128) in poi. Il segno `+' vuol dire "rispetto alla posizione corrente", quindi il `128' si aggiunge a 1k (1024) dove `dd' si era fermato. .br \fI% sh \-c 'dd of=normale bs=1k count=1; xxd \-s +128 > esadecimale' < file .PP Immagine esadecimale dalla posizione 0x100 ( = 1024\-768 ) del file in avanti. .br \fI% sh \-c 'dd of=normale bs=1k count=1; xxd \-s +\-768 > esadecimale' < file .PP Comunque, questo capita raramente, e l'uso del `+' non serve quasi mai. L'autore preferisce monitorare il comportamento di xxd con strace(1) o truss(1), quando si usa l'opzione \-s. .SH ESEMPI .PP .br Stampa tutto tranne le prime tre linee (0x30 byte esadecimali) di .B file \. .br \fI% xxd \-s 0x30 file .PP .br Stampa 3 linee (0x30 byte esadecimali) alla fine di .B file \. .br \fI% xxd \-s \-0x30 file .PP .br Stampa 120 byte come immagine esadecimale continua con 20 byte per linea. .br \fI% xxd \-l 120 \-ps \-c 20 xxd.1\fR .br 2e54482058584420312022417567757374203139 .br 39362220224d616e75616c207061676520666f72 .br 20787864220a2e5c220a2e5c222032317374204d .br 617920313939360a2e5c22204d616e2070616765 .br 20617574686f723a0a2e5c2220202020546f6e79 .br 204e7567656e74203c746f6e79407363746e7567 .br .br Stampa i primi 120 byte della pagina di manuale vim.1 a 12 byte per linea. .br \fI% xxd \-l 120 \-c 12 xxd.1\fR .br 0000000: 2e54 4820 5858 4420 3120 2241 .TH XXD 1 "A .br 000000c: 7567 7573 7420 3139 3936 2220 ugust 1996" .br 0000018: 224d 616e 7561 6c20 7061 6765 "Manual page .br 0000024: 2066 6f72 2078 7864 220a 2e5c for xxd"..\ .br 0000030: 220a 2e5c 2220 3231 7374 204d "..\" 21st M .br 000003c: 6179 2031 3939 360a 2e5c 2220 ay 1996..\" .br 0000048: 4d61 6e20 7061 6765 2061 7574 Man page aut .br 0000054: 686f 723a 0a2e 5c22 2020 2020 hor:..\" .br 0000060: 546f 6e79 204e 7567 656e 7420 Tony Nugent .br 000006c: 3c74 6f6e 7940 7363 746e 7567 output_file\fR .br .br Modificare (patch) la data nel file xxd.1 .br \fI% echo '0000037: 3574 68' | xxd \-r \- xxd.1\fR .br \fI% xxd \-s 0x36 \-l 13 \-c 13 xxd.1\fR .br 0000036: 3235 7468 204d 6179 2031 3939 36 25th May 1996 .PP .br Creare un file di 65537 byte tutto a 0x00, tranne che l'ultimo carattere che una 'A' (esadecimale 0x41). .br \fI% echo '010000: 41' | xxd \-r \> file\fR .PP .br Stampa una immagine esadecimale del file di cui sopra con opzione 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 Crea un file di 1 byte che contiene il solo carattere 'A'. Il numero dopo '\-r \-s' viene aggiunto a quello trovato nel file; in pratica, i byte precedenti non sono stampati. .br \fI% echo '010000: 41' | xxd \-r \-s \-0x10000 \> file\fR .PP Usa xxd come filtro all'interno di un editor come .B vim(1) per ottenere una immagine esadecimale di una parte di file delimitata dai marcatori `a' e `z'. .br \fI:'a,'z!xxd\fR .PP Usare xxd come filtro all'interno di un editor come .B vim(1) per ricostruire un pezzo di file binario da una immagine esadecimale delimitata dai marcatori `a' e `z'. .br \fI:'a,'z!xxd \-r\fR .PP Usare xxd come filtro all'interno di un editor come .B vim(1) per ricostruire una sola linea di file binario da una immagine esadecimale, Portare il cursore sopra la linea e battere: .br \fI!!xxd \-r\fR .PP Per leggere singoli caratteri da una linea seriale .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 CODICI DI RITORNO Il programma pu restituire questi codici di errore: .TP 0 nessun errore rilevato. .TP \-1 operazione non supportata ( .I xxd \-r \-i non ancora possible). .TP 1 errore durante la scansione parametri. .TP 2 problemi con il file di input. .TP 3 problemi con il file di output. .TP 4,5 posizione "seek" specificata non raggiungibile all'interno del file. .SH VEDERE ANCHE uuencode(1), uudecode(1), patch(1) .br .SH AVVERTIMENTI La stranezza dello strumento rispecchia la mente del suo creatore. Usate a vostro rischio e pericolo. Copiate i file. Tracciate l'esecuzione. Diventate un mago. .br .SH VERSIONE Questa pagina di manuale documenta la versione 1.7 di xxd. .SH AUTORE .br (c) 1990-1997 Juergen Weigert .br .LP Distribuite liberamente ed attribuitemi il credito, .br fate soldi e condivideteli con me .br perdete soldi e non venite a chiederli a me. .PP Pagina di manuale messa in piedi da Tony Nugent .br .br Piccole modifiche di Bram Moolenaar. Modificato da Juergen Weigert. .PP vim-7.4.1689/runtime/doc/xxd-it.UTF-8.1000066400000000000000000000273611267703067000171370ustar00rootroot00000000000000.TH XXD 1 "Agosto 1996" "Pagina di manuale per xxd" .\" .\" 21 Maggio 1996 .\" Autore della pagina di manuale: .\" Tony Nugent .\" Modificato da Bram Moolenaar .SH NOME .I xxd \- Produce esadecimale da un file binario o viceversa. .SH SINTASSI .B xxd \-h[elp] .br .B xxd [opzioni] [input_file [output_file]] .br .B xxd \-r[evert] [opzioni] [input_file [output_file]] .SH DESCRIZIONE .I xxd crea un'immagine esadecimale di un dato file o dello "standard input". Può anche ottenere da un'immagine esadecimale il file binario originale. Come .BR uuencode (1) e .BR uudecode (1) permette di trasmettere dati binari in una rappresentazione ASCII "a prova di email", ma ha anche il vantaggio di poter decodificare sullo "standard output". Inoltre, può essere usato per effettuare delle modifiche (patch) a file binari. .SH OPZIONI Se non si specifica un .I input_file il programma legge dallo "standard input". Se .I input_file è specificato come il carattere .RB \` \- ' , l'input è letto dallo "standard input". Se non si specifica un .I output_file (o si mette al suo posto il carattere .RB \` \- ' ), i risultati sono inviati allo "standard output". .PP Si noti che la scansione dei caratteri è "pigra", e non controlla oltre la prima lettera dell'opzione, a meno che l'opzione sia seguita da un parametro. Gli spazi fra una singola lettera di opzione e il corrispondente parametro dopo di essa sono facoltativi. I parametri delle opzioni possono essere specificati usando la notazione decimale, esadecimale oppure ottale. Pertanto .BR \-c8 , .BR "\-c 8" , .B \-c 010 e .B \-cols 8 sono notazioni equivalenti fra loro. .PP .TP .IR \-a " | " \-autoskip Richiesta di autoskip: Un singolo '*' rimpiazza linee di zeri binari. Valore di default: off. .TP .IR \-b " | " \-bits Richiesta di una immagine binaria (cifre binarie), invece che esadecimale. Questa opzione scrive un byte come otto cifre "1" e "0" invece di usare i numeri esadecimali. Ogni linea è preceduta da un indirizzo in esadecimale e seguita da una decodifica ascii (o ebcdic). Le opzioni specificabili dalla linea comando \-r, \-p, \-i non funzionano in questo modo. .TP .IR "\-c colonne " | " \-cols colonne" .IR "\-c colonne " | " \-cols colonne" In ogni linea sono formattate .RI < colonne > colonne. Valore di default 16 (\-i: 12, \-ps: 30, \-b: 6). Valore massimo 256. .TP .IR \-E " | " \-EBCDIC Cambia la codifica della colonna di destra da ASCII a EBCDIC. Questo non modifica la rappresentazione esadecimale. Non ha senso specificare questa opzione in combinazione con \-r, \-p o \-i. .TP .IR "\-g numero_byte " | " \-groupsize numero_byte" Inserisci ogni .RI < numero_byte > byte di output (di due caratteri esadecimali o otto numeri binari ognuno) uno spazio bianco. Specificando .I \-g 0 i byte di output non sono separati da alcuno spazio. .RI < numero_byte > ha come valore di default " 2 in modalità normale [esadecimale] e \fI1\fP in modalità binaria. Il raggruppamento non si applica agli stili "PostScript" e "include". .TP .IR \-h " | " \-help stampa un sommario dei comandi disponibili ed esce. Non viene fatto null'altro. .TP .IR \-i " | " \-include L'output è nello stile dei file "include" in C. Viene preparata la definizione completa di un "array" [vettore], dandogli il nome del file di input), tranne che nel caso in cui xxd legga dallo "standard input". .TP .IR "\-l numero " | " \-len numero" Il programma esce dopo aver scritto .RI < numero > byte. .TP .IR \-p " | " \-ps " | " \-postscript " | " \-plain L'output è nello stile di un dump continuo sotto postscript. Noto anche come stile esadecimale semplice [plain]. .TP .IR \-r " | " \-revert ricostruzione: converte (o mette una patch) a partire dall'immagine esadecimale, creando [o modificando] il file binario. Se non diretto allo "standard output", xxd scrive nel suo file di output in maniera continua, senza interruzioni. Usare la combinazione .I \-r \-p per leggere dump in stile esadecimale semplice [plain], senza l'informazione di numero di linea e senza un particolare tracciato di colonna. Degli spazi o delle linee vuote possono essere inserite a piacere [e vengono ignorate]. .TP .I \-seek distanza Usato con l'opzione .IR \-r : (ricostruzione), .RI < distanza > viene aggiunta alla posizione nel file trovata nella immagine esadecimale. .TP .I \-s [+][\-]seek Inizia a .RI < seek > byte assoluti (o relativi) di distanza all'interno di input_file. \fI+ \fRindica che il "seek" è relativo alla posizione corrente nel file "standard input" (non significativa quando non si legge da "standard input"). \fI\- \fRindica che il "seek" dovrebbe posizionarsi ad quel numero di caratteri dalla fine dell'input (o se in combinazione con \fI+ \fR: prime della posizione corrente nel file "standard input"). Se non si specifica una opzione \-s, xxd inizia alla posizione corrente all'interno del file. .TP .I \-u usa lettere esadecimali maiuscole. Il valore di default è di usare lettere minuscole. .TP .IR \-v " | " \-version visualizza la stringa contenente la versione del programma. .SH ATTENZIONE .PP .I xxd \-r è capace di operare "magie" nell'utilizzare l'informazione "numero di linea". Se sul file di output ci si può posizionare usando la "seek", il numero di linea all'inizio di ogni riga esadecimale può essere non ordinato, delle linee possono mancare delle linee, oppure esserci delle sovrapposizioni. In simili casi xxd userà lseek(2) per raggiungere la posizione d'inizio. Se il file di output non consente di usare "seek", sono permessi solo dei "buchi", che saranno riempiti con zeri binari. .PP .I xxd \-r non genera mai errori di specifica parametri. I parametri non riconosciuti sono silenziosamente ignorati. .PP Nel modificare immagini esadecimali, tenete conto che .I xxd \-r salta il resto della linea, dopo aver letto abbastanza caratteri contenenti dati esadecimali (vedere opzione \-c). Ciò implica pure che le modifiche alle colonne di caratteri stampabili ascii (o ebcdic) sono sempre ignorate. La ricostruzione da un file immagine esadecimale in stile semplice (postscript) con xxd \-r \-p non dipende dal numero corretto di colonne. IN questo caso, qualsiasi cosa assomigli a una coppia di cifre esadecimali è interpretata [e utilizzata]. .PP Notare la differenza fra .br \fI% xxd \-i file\fR .br e .br \fI% xxd \-i \< file\fR .PP .I xxd \-s \+seek può comportarsi in modo diverso da .IR "xxd \-s seek" , perché lseek(2) è usata per tornare indietro nel file di input. Il '+' fa differenza se il file di input è lo "standard input", e se la posizione nel file di "standard input" non è all'inizio del file quando xxd è eseguito, con questo input. I seguenti esempi possono contribuire a chiarire il concetto (o ad oscurarlo!)... .PP Riavvolge lo "standard input" prima di leggere; necessario perché `cat' ha già letto lo stesso file ["file"] fino alla fine dello "standard input". .br \fI% sh \-c 'cat > copia_normale; xxd \-s 0 > copia_esadecimale' < file .PP Stampa immagine esadecimale dalla posizione file 0x480 (=1024+128) in poi. Il segno `+' vuol dire "rispetto alla posizione corrente", quindi il `128' si aggiunge a 1k (1024) dove `dd' si era fermato. .br \fI% sh \-c 'dd of=normale bs=1k count=1; xxd \-s +128 > esadecimale' < file .PP Immagine esadecimale dalla posizione 0x100 ( = 1024\-768 ) del file in avanti. .br \fI% sh \-c 'dd of=normale bs=1k count=1; xxd \-s +\-768 > esadecimale' < file .PP Comunque, questo capita raramente, e l'uso del `+' non serve quasi mai. L'autore preferisce monitorare il comportamento di xxd con strace(1) o truss(1), quando si usa l'opzione \-s. .SH ESEMPI .PP .br Stampa tutto tranne le prime tre linee (0x30 byte esadecimali) di .B file \. .br \fI% xxd \-s 0x30 file .PP .br Stampa 3 linee (0x30 byte esadecimali) alla fine di .B file \. .br \fI% xxd \-s \-0x30 file .PP .br Stampa 120 byte come immagine esadecimale continua con 20 byte per linea. .br \fI% xxd \-l 120 \-ps \-c 20 xxd.1\fR .br 2e54482058584420312022417567757374203139 .br 39362220224d616e75616c207061676520666f72 .br 20787864220a2e5c220a2e5c222032317374204d .br 617920313939360a2e5c22204d616e2070616765 .br 20617574686f723a0a2e5c2220202020546f6e79 .br 204e7567656e74203c746f6e79407363746e7567 .br .br Stampa i primi 120 byte della pagina di manuale vim.1 a 12 byte per linea. .br \fI% xxd \-l 120 \-c 12 xxd.1\fR .br 0000000: 2e54 4820 5858 4420 3120 2241 .TH XXD 1 "A .br 000000c: 7567 7573 7420 3139 3936 2220 ugust 1996" .br 0000018: 224d 616e 7561 6c20 7061 6765 "Manual page .br 0000024: 2066 6f72 2078 7864 220a 2e5c for xxd"..\ .br 0000030: 220a 2e5c 2220 3231 7374 204d "..\" 21st M .br 000003c: 6179 2031 3939 360a 2e5c 2220 ay 1996..\" .br 0000048: 4d61 6e20 7061 6765 2061 7574 Man page aut .br 0000054: 686f 723a 0a2e 5c22 2020 2020 hor:..\" .br 0000060: 546f 6e79 204e 7567 656e 7420 Tony Nugent .br 000006c: 3c74 6f6e 7940 7363 746e 7567 output_file\fR .br .br Modificare (patch) la data nel file xxd.1 .br \fI% echo '0000037: 3574 68' | xxd \-r \- xxd.1\fR .br \fI% xxd \-s 0x36 \-l 13 \-c 13 xxd.1\fR .br 0000036: 3235 7468 204d 6179 2031 3939 36 25th May 1996 .PP .br Creare un file di 65537 byte tutto a 0x00, tranne che l'ultimo carattere che è una 'A' (esadecimale 0x41). .br \fI% echo '010000: 41' | xxd \-r \> file\fR .PP .br Stampa una immagine esadecimale del file di cui sopra con opzione 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 Crea un file di 1 byte che contiene il solo carattere 'A'. Il numero dopo '\-r \-s' viene aggiunto a quello trovato nel file; in pratica, i byte precedenti non sono stampati. .br \fI% echo '010000: 41' | xxd \-r \-s \-0x10000 \> file\fR .PP Usa xxd come filtro all'interno di un editor come .B vim(1) per ottenere una immagine esadecimale di una parte di file delimitata dai marcatori `a' e `z'. .br \fI:'a,'z!xxd\fR .PP Usare xxd come filtro all'interno di un editor come .B vim(1) per ricostruire un pezzo di file binario da una immagine esadecimale delimitata dai marcatori `a' e `z'. .br \fI:'a,'z!xxd \-r\fR .PP Usare xxd come filtro all'interno di un editor come .B vim(1) per ricostruire una sola linea di file binario da una immagine esadecimale, Portare il cursore sopra la linea e battere: .br \fI!!xxd \-r\fR .PP Per leggere singoli caratteri da una linea seriale .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 CODICI DI RITORNO Il programma può restituire questi codici di errore: .TP 0 nessun errore rilevato. .TP \-1 operazione non supportata ( .I xxd \-r \-i non ancora possible). .TP 1 errore durante la scansione parametri. .TP 2 problemi con il file di input. .TP 3 problemi con il file di output. .TP 4,5 posizione "seek" specificata non raggiungibile all'interno del file. .SH VEDERE ANCHE uuencode(1), uudecode(1), patch(1) .br .SH AVVERTIMENTI La stranezza dello strumento rispecchia la mente del suo creatore. Usate a vostro rischio e pericolo. Copiate i file. Tracciate l'esecuzione. Diventate un mago. .br .SH VERSIONE Questa pagina di manuale documenta la versione 1.7 di xxd. .SH AUTORE .br (c) 1990-1997 Juergen Weigert .br .LP Distribuite liberamente ed attribuitemi il credito, .br fate soldi e condivideteli con me .br perdete soldi e non venite a chiederli a me. .PP Pagina di manuale messa in piedi da Tony Nugent .br .br Piccole modifiche di Bram Moolenaar. Modificato da Juergen Weigert. .PP vim-7.4.1689/runtime/doc/xxd-ja.UTF-8.1000066400000000000000000000305371267703067000171140ustar00rootroot00000000000000.TH XXD 1 "August 1996" "Manual page for xxd" .\" .\" 21st May 1996 .\" Man page author: .\" Tony Nugent .\" Changes by Bram Moolenaar .SH 名前 .I xxd \- 16 進ダンプを作成したり、元に戻したり。 .SH 書式 .B xxd \-h[elp] .br .B xxd [options] [infile [outfile]] .br .B xxd \-r[evert] [options] [infile [outfile]] .SH 説明 ファイルや標準入力から 16 進ダンプを作成します。 16 進ダンプから元のバイナリに戻すこともできます。 .BR uuencode (1) や .BR uudecode (1) のように、バイナリデータを、メールに貼り付け可能な ASCII 形式に変換できた り、標準出力に出力することもできます。 さらに、バイナリファイルにパッチを当てるという使い方もできます。 .SH オプション .I infile を指定しなかった場合は、標準入力が読み込まれます。 .I infile に .RB \` \- ' を指定した場合も、標準入力から読み込まれます。 .I outfile を指定しなかった (または .RB \` \- ' を指定した) 場合は、標準出力に出力されます。 .PP 引数の解釈処理は適当なので注意してください。パラメータを取らない引数は 最初の一文字だけチェックされます。 引数の文字とパラメータの間のスペースは省略可能です。 パラメータは 10 進数、16 進数、8 進数で指定できます。 .BR \-c8 、 .BR "\-c 8" 、 .B \-c 010 、 .B \-cols 8 はすべて同じ意味です。 .PP .TP .IR \-a " | " \-autoskip オートスキップ: 連続した nul 行を一つの '*' で置き換える。 .TP .IR \-b " | " \-bits ビット (2進数) ダンプ。 1 オクテットが "1" と "0" の 8 文字で出力されます。 各行の行頭には 16 進数の行番号が表示されます。 行末には ascii (または ebcdic) で表した場合の文字が表示されます。 このモードでは \-r、\-p、\-i は機能しません。 .TP .IR \-e リトルエンディアンの 16 進ダンプに切り替える。 このオプションは、バイトのグループをリトルエンディアンのバイト順のワードとして 扱います。標準のグルーピングは 4 バイトですが、 .RI "" \-g を使うことで変更可能です。 このオプションは 16 進ダンプのみに適用され、ASCII (あるいは EBCDIC) 表示は 変更されません。 このモードでは \-r、\-p、\-i は機能しません。 .TP .IR "\-c cols " | " \-cols cols" 一行 .RI < cols > オクテットで出力する。標準設定は 16 (\-i: 12, \-ps: 30, \-b: 6)。最大 256。 .TP .IR \-E " | " \-EBCDIC 右端に出力される文字のエンコーディングを ASCII から EBCDIC に変更する。 16 進ダンプの出力形式は変更されません。 \-r、\-p、\-i が同時に指定された場合は何の効果もありません。 .TP .IR "\-g bytes " | " \-groupsize bytes" 出力を .RI < bytes > バイト (2 文字の 16 進数、または 8 文字の 2 進数) ごとにスペースで区切りま す。 区切らずに出力するには .I \-g 0 を指定してください。 .RI < Bytes > の標準設定は \fI2\fP で、リトルエンディアンモードの場合は \fI4\fP 、 2 進ダンプの場合は \fI1\fP です。 ポストスクリプト形式やインクルード形式で出力するときは、このオプションは使わ れません。 .TP .IR \-h " | " \-help コマンドの説明を出力して終了する。変換は実行されません。 .TP .IR \-i " | " \-include C インクルードファイル形式で出力します。入力ファイルの名前が付けられた静的配 列の定義が出力されます。標準入力の場合は定義の中身だけ出力されます。 .TP .IR "\-l len " | " \-len len" .RI < len > オクテットだけ出力する。 .TP .I \-o offset 表示されるファイル位置に .RI < offset > を加算する。 .TP .IR \-p " | " \-ps " | " \-postscript " | " \-plain ポストスクリプト形式の 16 進ダンプを出力する。別名 プレーン 16 進ダンプ。 .TP .IR \-r " | " \-revert 元に戻す: 16 進ダンプからバイナリ形式に変換 (またはパッチ) します。 ファイルへ出力する場合、出力先のファイルは切り詰めされません。 行番号や特定の書式がないプレーン 16 進ダンプを読み込む場合は、 .I \-r \-p を指定してください。空白と改行は無視されます。 .TP .I \-seek offset .IR \-r の後で使われた場合: 16 進ダンプを出力するファイルの位置に .RI < offset > を加える。 .TP .I \-s [+][\-]seek infile の .RI < seek > バイト目 (絶対位置、または相対位置) から開始する。 \fI+ \fRは、現在の標準入力の位置から相対的な位置を示します (標準入力から読み込むときのみ意味があります)。\fI\- \fRは、入力の終わりから の文字数を示します (\fI+\fR と同時に指定した場合は、現在の標準入力の位置から 手前の位置を示します)。 \-s 引数を指定しなかった場合は、現在のファイル位置から開始されます。 .TP .I \-u 16 進数の表記に大文字を使います。指定がない場合は小文字で出力されます。 .TP .IR \-v " | " \-version バージョンを表示します。 .SH 警告 .PP .I xxd \-r では行番号の評価に関しての暗黙のルールがいくつかあります。 出力ファイルがシーク可能なら、各行の行番号が順番通りに並んでなくても構いませ ん。位置が飛んでいても重なっていても大丈夫です。その場合、次の位置に移動する ために lseek(2) が使われます。 出力ファイルがシーク不可なら、「隙間」だけが処理可能です。隙間は null バイト で埋められます。 .PP .I xxd \-r は不正な入力をエラーにしません。ゴミは静かに読み飛ばされます。 .PP 16 進ダンプを編集するときは注意が必要です。 .I xxd \-r は必要な桁 (\-c 引数参照) だけ 16 進データを読み込んで、行の残りを無視しま す。つまり、ascii (または ebcdic) を示している列への変更は無視されます。 xxd \-r \-p でプレーン形式 (ポストスクリプト形式) の 16 進ダンプを元に戻す場 合は、列の数は影響しません。 2 桁の 16 進数と認識できるものはすべて変換されます。 .PP \fI% xxd \-i file\fR .br と .br \fI% xxd \-i < file\fR .br の結果は違います。注意してください。 .PP .I xxd \-s +seek と .IR "xxd \-s seek" , の違いは、lseek(2) を使って入力を "巻き戻す" かどうかです。'+' が意味を持つ のは、入力が標準入力で、xxd が起動されたときに標準入力のファイル位置がファイ ルの先頭ではなかった場合です。 以下の例が分かりやすいかもしれません (もっと混乱するかも!)... .PP `cat' が既に標準入力を終わりまで読んでいるので、読む前に標準入力を巻き戻す必 要がある。 .br \fI% sh \-c "cat > plain_copy; xxd \-s 0 > hex_copy" < file\fR .PP ファイル位置 0x480 (=1024+128) 前方から 16 進ダンプする。 `+' は 「現在地からの相対位置」を意味するので、dd が 1k 処理した後から、さら に `128' 進めます。 .br \fI% sh \-c "dd of=plain_snippet bs=1k count=1; xxd \-s +128 > hex_snippet" < file\fR .PP ファイル位置 0x100 ( = 1024\-768) から 16 進ダンプする。 .br \fI% sh \-c "dd of=plain_snippet bs=1k count=1; xxd \-s +\-768 > hex_snippet" < file\fR .PP このような使い方はあまりしませんし、`+' を使うこともほとんどないでしょう。 \-s を使うときはいつでも、strace(1) や truss(1) を使って、xxd の働きをチェッ クすることをお勧めします。 .SH 例 .PP .br .BR ファイル の最初の三行 (16 進数で 0x30 バイト) 以降を出力する。 .br \fI% xxd \-s 0x30 file\fR .PP .br .BR ファイル の最後から三行 (16 進数で 0x30 バイト) を出力する。 .br \fI% xxd \-s \-0x30 file\fR .PP .br 120 バイトを、平文 16 進ダンプ形式で一行に 20 オクテットずつ出力する。 .br \fI% xxd \-l 120 \-ps \-c 20 xxd.1\fR .br 2e54482058584420312022417567757374203139 .br 39362220224d616e75616c207061676520666f72 .br 20787864220a2e5c220a2e5c222032317374204d .br 617920313939360a2e5c22204d616e2070616765 .br 20617574686f723a0a2e5c2220202020546f6e79 .br 204e7567656e74203c746f6e79407363746e7567 .br .br この man ページの先頭から 120 バイトを一行に 12 オクテットずつ 16 進ダンプす る。 .br \fI% xxd \-l 120 \-c 12 xxd.1\fR .br 0000000: 2e54 4820 5858 4420 3120 2241 .TH XXD 1 "A .br 000000c: 7567 7573 7420 3139 3936 2220 ugust 1996" .br 0000018: 224d 616e 7561 6c20 7061 6765 "Manual page .br 0000024: 2066 6f72 2078 7864 220a 2e5c for xxd"..\\ .br 0000030: 220a 2e5c 2220 3231 7374 204d "..\\" 21st M .br 000003c: 6179 2031 3939 360a 2e5c 2220 ay 1996..\\" .br 0000048: 4d61 6e20 7061 6765 2061 7574 Man page aut .br 0000054: 686f 723a 0a2e 5c22 2020 2020 hor:..\\" .br 0000060: 546f 6e79 204e 7567 656e 7420 Tony Nugent .br 000006c: 3c74 6f6e 7940 7363 746e 7567 output_file\fR .br .br xxd.1 の日付を修正する。 .br \fI% echo "0000037: 3574 68" | xxd \-r \- xxd.1\fR .br \fI% xxd \-s 0x36 \-l 13 \-c 13 xxd.1\fR .br 0000036: 3235 7468 204d 6179 2031 3939 36 25th May 1996 .PP .br 中身がすべて 0x00 の 65537 バイトのファイルを作成する。 ただし、最後のバイトだけは 'A' (hex 0x41)。 .br \fI% echo "010000: 41" | xxd \-r > file\fR .PP .br 作成したファイルをオートスキップを使って 16 進ダンプする。 .br \fI% xxd \-a \-c 12 file\fR .br 0000000: 0000 0000 0000 0000 0000 0000 ............ .br * .br 000fffc: 0000 0000 40 ....A .PP 一文字の 'A' からなる 1 バイトのファイルを作成する。 '\-r \-s' の後に指定した数値がファイル中の行番号に加算され、結果、余計なバ イトが飛ばされる。 .br \fI% echo "010000: 41" | xxd \-r \-s \-0x10000 > file\fR .PP .B vim(1) の中から xxd をフィルタとして実行し、 マークされた `a' から `z' までの領域を 16 進ダンプする。 .br \fI:'a,'z!xxd\fR .PP .B vim(1) の中から xxd をフィルタとして実行し、 マークされた `a' から `z' までの領域をバイナリに戻す。 .br \fI:'a,'z!xxd \-r\fR .PP .B vim(1) の中から xxd をフィルタとして実行し、 16 進ダンプされた行を元に戻す。戻したい行にカーソルを移動して: .br \fI!!xxd \-r\fR .PP シリアル行から一文字読み込む .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 返り値 以下のエラー値が返ります: .TP 0 エラーなし。 .TP \-1 操作がサポートされていない ( .I xxd \-r \-i はまだ不可です)。 .TP 1 引数の解釈に関するエラー。 .TP 2 入力ファイルに関する問題。 .TP 3 出力ファイルに関する問題。 .TP 4,5 指定された位置へシークできなかった。 .SH 関連項目 uuencode(1), uudecode(1), patch(1) .br .SH 警告 この奇妙なツールは作者が使いやすいように作られています。 自己責任で使ってください。ファイルをコピーし、それを調べ、ウィザードたれ。 .br .SH バージョン このマニュアルは xxd バージョン 1.7 について説明しています。 .SH 著者 .br (c) 1990-1997 by Juergen Weigert .br .LP 私の功績として自由に配布してください。 .br 儲かったら教えてください。 .br 損しても知りません。 .PP マニュアルは Tony Nugent .br .br によって書かれ、 Bram Moolenaar が少し変更を加え、 Juergen Weigert が編集しました。 .PP vim-7.4.1689/runtime/doc/xxd-pl.1000066400000000000000000000242541267703067000163320ustar00rootroot00000000000000.TH XXD 1 "Sierpie 1996" "Strona podrcznika dla xxd" .\" .\" 21st May 1996 .\" Man page author: .\" Tony Nugent .\" Changes by Bram Moolenaar .SH NAZWA .I xxd \- zrzut pliku do hex lub odwrotnie .SH SYNOPSIS .B xxd \-h[elp] .br .B xxd [opcje] [plik_we [plik_wy]] .br .B xxd \-r[evert] [opcje] [plik_we [plik_wy]] .SH OPIS .I xxd tworzy zrzut heksowy podanego pliku lub standardowego wejcia. Moe take przetworzy zrzut heksowy z powrotem do oryginalnej, binarnej formy. Podobnie jak .BR uuencode (1) i .BR uudecode (1) pozwala na przekazanie danych binarnych w bezpiecznej w poczcie formie ASCII, ale ma zalety dekodowania na standardowe wyjcie. Ponadto mona go uy do binarnego atania plikw. .SH OPCJE Jeli nie podano .I plik_we xxd czyta ze standardowego wejcia. Jeli okrelono .I plik_we jako znak .RB \` \- ' wtedy dane wejciowe czytane s ze standardowego wejcia. Jeli nie podano .I plik_wy (lub podano jako .RB \` \- ' ), wyniki s wysyane na standardowe wyjcie. .PP Pamitaj, e uyty zosta "leniwy" parser, ktry nie sprawdza wicej ni pierwszej litery opcji (o ile ta nie zostaa obdarzona parametrem). Spacje midzy jedno literowymi opcjami i ich parametrami s opcjonalne. Parametry opcji mog by okrelone w notacji dziesitnej, heksadecymalej lub oktalnej. Std .BR \-c8 , .BR "\-c 8" , .B \-c 010 i .B \-cols 8 s sobie rwnowane. .PP .TP .IR \-a " | " \-autoskip przecza autoskip: pojedyncza '*' zastpuje linie nul. Domylnie wyczone. .TP .IR \-b " | " \-bits Przecza do zrzutu bitowego (cyfr binarnych) zamiast heksowego. Opcja ta zapisuje oktety jako osiem cyfr 1 lub 0 zamiast normalnego zrzutu heksowego. Kada linia jest poprzedzona przez heksadecymalny numer linii a po nim jego reprezentacj w ascii (lub ebcdic). Opcje linii polece \-r, \-p, \-i nie dziaaj w tym trybie. .TP .IR "\-c cols " | " \-cols cols" formatuje liczb .RI < cols > oktetw na wiersz. Domylnie 16 (\-i: 12, \-ps: 30, \-b: 6). Maks. 256. .TP .IR \-E " | "\-EBCDIC zmienia kodowanie znakw w prawej kolumnie z ASCII na EBCDIC. Nie zmienia prezentacji heksadecymalej. Opcja nie dziaa w poczeniu z \-r, \-p lub \-i. .TP .IR "\-g bajtw " | " \-groupsize bajtw" oddziela wyjcie kadych .RI < bajtw > bajtw (dwa heksowe znaki lub osiem cyfr binarnych kade) przez biay znak. Okrel .I \-g 0 by wyczy grupowanie. .RI < Bajtw "> domylnie jest " 2 w trybie normalnym i \fI1\fP w trybie bitw. Grupowanie nie dziaa w trybie postscriptu lub wczania. .TP .IR \-h " | " \-help wypisuje podsumowanie dostpnych polece i koczy dziaanie. Nie zostaje przeprowadzony aden zrzut. .TP .IR \-i " | " \-include wyjcie w stylu wczania pliku w C. Zostaje zapisana kompletna statyczna tablica definicji (nazwana wedug pliku wejcia), o ile xxd nie czyta ze standardowego wejcia. .TP .IR "\-l len " | "\-len len" zakocz po wypisaniu .RI < len > oktetw. .TP .IR \-p " | " \-ps " | " \-postscript " | " \-plain wyjcie w postcriptowym cigym stylu zrzutu heksowego. Znany take jako zwyky zrzut heksowy. .TP .IR \-r " | " \-revert odwr operacj: przekonwertuj (lub zaataj) zrzut heksowy w binark. Jeli nie zapisuje na standardowe wyjcie, xxd zapisze plik wyjciowy bez obcinania go. Uyj kombinacji .I \-r \-p by odczyta zwyky zrzut heksadecymalny bez numerw linii i okrelonego ukadu kolumn. Dodatkowe biae znaki i amanie wierszy s wszdzie dozwolone. .TP .I \-seek offset Kiedy uyty po .IR \-r : odwraca z .RI < offset > dodanym do pozycji w pliku odnalezionym w zrzucie heksowym. .TP .I \-s [+][\-]seek zaczyna na .RI < seek > bajtw bezwgldnego (lub wzgldnego) offsetu pliku wejciowego. \fI+ \fRwskazuje, e seek jest wzgldne do biecej pozycji pliku (bez znaczenia jeli nie wczytuje ze standardowego wejcia). \fI\- \fRwskazuje e seek powinno by o tyle znakw od koca wejcia (lub jeli poczone z \fI+\fR: przed biec pozycj pliku na standardowym wejciu). Bez opcji \-s xxd zaczyna od biecej pozycji w pliku. .TP .I \-u uyj wielkich liter w znakach heksowych. Domylnie s mae znaki. .TP .IR \-v " | " \-version pokazuje wersj programu. .SH OSTRZEENIA .PP .I xxd \-r potrafi okreli numery linii. Jeli plik wyjcia jest moliwy do przeszukania wtedy numery linii na pocztku wiersza zrzutu heksowego mog by nie po kolei, moe brakowa wierszy lub nakada si na siebie. W takich wypadkach xxd uyje lseek(2) by znale nastpn pozycj. Jeli plik wyjciowy nie jest moliwy do przeszukania moliwe s tylko przerwy, ktre zostan wypenione bajtami null. .PP .I xxd \-r nigdy nie podaje bdw analizy. mieci s po cichu ignorowane. .PP W czasie edycji zrzutw heksowych, prosz zauway e .I xxd \-r pomija wszystko w linii wejcia po odczytaniu wystarczajcej iloci kolumn danych heksadecymalnych (zobacz opcj \-c). Oznacza to take, e zmiany w drukowanych kolumnach ascii (lub ebcdic) s zawsze ignorowane. Odwrcenie zwykego (lub postscriptowego) stylu zrzutu poprzez xxd \-r \-p nie zaley od kolejnoci kolumn. Tutaj cokolwiek co wyglda jak para znakw heks jest interpretowane. .PP Zauwa rnic midzy .br \fI% xxd \-i plik\fR .br i .br \fI% xxd \-i < plik\fR .PP .I xxd \-s \+seek moe by rne od .IR "xxd \-s seek" , poniewa lseek(2) jest uyty do "przewinicie" wejcia. '+' stanowi rnic jeli rdem wejcia jest standardowe wejcie i jeli pozycja w pliku ze standardowego wejcia nie jest pocztkiem pliku w chwili uruchomienia xxd. Nastpujce przykady mog wyjani (lub bardziej zmyli!)... .PP Przewi standardowe wejcie przed przeczytaniem; potrzebne poniewa `cat' ju odczyta do koca standardowego wejcia. .br \fI% sh \-c 'cat > zwyka_kopia; xxd \-s 0 > hex_kopia' < plik\fR .PP Zrzut heksowy od pozycji pliku 0x480 (=1024+128) w przd. Znak `+' oznacza "wzgldny wobec biecej pozycji", std `128' dodaje do 1k gdzie zakoczy dd. .br \fI% sh \-c 'dd of=plain_snippet bs=1k count=1; xxd \-s +128 > hex_snippet' < file\fR .PP Zrzut heksowy od pozycji pliku 0x100 ( = 1024\-768) dalej. .br \fI% sh \-c 'dd of=plain_snippet bs=1k count=1; xxd \-s +-768 > hex_snippet' < file\fR .PP Jakkolwiek, jest to rzadka sytuacja i uycie `+' jest rzadko potrzebne. Autor woli monitorowa dziaanie xxd przy pomocy strace(1) lub truss(1) kiedy \-s jest uyte. .SH PRZYKADY .PP .br Wypisz wszystko z wyjtkiem pierwszych trzech linii (heksowe 0x30 bajtw) .B pliku \. .br \fI% xxd \-s 0x30 plik\fR .PP .br Wypisz trzy linie (heksowe 0x30 bajtw) z koca .B pliku \. .br \fI% xxd \-s \-0x30 plik\fR .PP .br Wypisz 120 bajtw jako cigy zrzut heksowy z 20 oktetami na lini. .br \fI% xxd \-l 120 \-ps \-c 20 xxd.1\fR .br 2e54482058584420312022417567757374203139 .br 39362220224d616e75616c207061676520666f72 .br 20787864220a2e5c220a2e5c222032317374204d .br 617920313939360a2e5c22204d616e2070616765 .br 20617574686f723a0a2e5c2220202020546f6e79 .br 204e7567656e74203c746f6e79407363746e7567 .br .br Zrzut heksowy z pierwszymi 120 bajtami tej strony podrcznika z 12 oktetami na lini. .br \fI% xxd \-l 120 \-c 12 xxd.1\fR .br 0000000: 2e54 4820 5858 4420 3120 2241 .TH XXD 1 "A .br 000000c: 7567 7573 7420 3139 3936 2220 ugust 1996" .br 0000018: 224d 616e 7561 6c20 7061 6765 "Manual page .br 0000024: 2066 6f72 2078 7864 220a 2e5c for xxd"..\\ .br 0000030: 220a 2e5c 2220 3231 7374 204d "..\\" 21st M .br 000003c: 6179 2031 3939 360a 2e5c 2220 ay 1996..\\" .br 0000048: 4d61 6e20 7061 6765 2061 7574 Man page aut .br 0000054: 686f 723a 0a2e 5c22 2020 2020 hor:..\\" .br 0000060: 546f 6e79 204e 7567 656e 7420 Tony Nugent .br 000006c: 3c74 6f6e 7940 7363 746e 7567 plik_wy\fR .br .br Podmie dat w pliku xxd.1 .br \fI% echo '0000037: 3574 68' | xxd \-r \- xxd.1\fR .br \fI% xxd \-s 0x36 \-l 13 \-c 13 xxd.1\fR .br 0000036: 3235 7468 204d 6179 2031 3939 36 25th May 1996 .PP .br Utwrz plik o 65537 bajtach, wszystkich rwnych 0x00, z wyjtkiem ostatniego, ktry ma by 'A' (hex 0x41). .br \fI% echo '010000: 41' | xxd \-r \> plik\fR .PP .br Zrzut heksowy tego pliku z autoskipem. .br \fI% xxd \-a \-c 12 plik\fR .br 0000000: 0000 0000 0000 0000 0000 0000 ............ .br * .br 000fffc: 0000 0000 40 ....A .PP Utwrz jedno bajtowy plik zawierajcy pojedncz liter 'A'. Liczba po '\-r \-s' dodaje numery linii znalezione w pliku; w efekcie poprzedzajce bajty s ukryte. .br \fI% echo '010000: 41' | xxd \-r \-s \-0x10000 \> plik\fR .PP Uyj xxd jako filtra wewntrz edytora takiego jak .B vim(1) aby uzyska zrzut heksowy zakresu midzy markerami `a' i `z'. .br \fI:'a,'z!xxd\fR .PP Uyj xxd jako filtra wewntrz edytora takiego jak .B vim(1) by odzyska binarny zrzut heksowy zakresu pomidzy markerami `a' i `z'. .br \fI:'a,'z!xxd \-r\fR .PP Uyj xxd jako filtra wewntrz edytora takiego jak .B vim(1) by odzyska jedn lini zrzutu heksowego. Przejd z kursorem na lini i wpisz: .br \fI!!xxd \-r\fR .PP Odczytaj pojednycze znaki z portu szeregowego .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 "ZWRACANE WARTOCI" Zwracane s nastpujce wartoci bdw: .TP 0 nie znaleziono bdw. .TP \-1 operacja nie jest wspierana ( .I xxd \-r \-i cay czas niemoliwa). .TP 1 bd w czasie analizowania opcji. .TP 2 problemy z plikiem wejciowym. .TP 3 problemy z plikiem wyjciowym. .TP 4,5 dana pozycja jest nieosigalna. .SH "ZOBACZ TAKE" uuencode(1), uudecode(1), patch(1) .br .SH OSTRZEENIA Dziwaczno narzdzi dorwnuje dziwacznoci mzgu twrcy. Uywaj wycznie na wasn odpowiedzialno. Kopiuj pliki. Analizuj je. Sta si czarodziejem. .br .SH WERSJA Strona podrcznika opisuje xxd w wersji 1.7 .SH AUTOR .br (c) 1990-1997 by Juergen Weigert .br .LP Kopiuj do woli i podaj moje dane, .br zarabiaj pienidze i dziel si ze mn, .br tra pienidze i nie miej do mnie pretensji. .PP Strona podrcznika zapocztkowana przez Tony'ego Nugenta .br .br Mae zmiany: Bram Moolenaar. Redakcja: Juergen Weigert. .PP vim-7.4.1689/runtime/doc/xxd-pl.UTF-8.1000066400000000000000000000247761267703067000171450ustar00rootroot00000000000000.TH XXD 1 "Sierpień 1996" "Strona podręcznika dla xxd" .\" .\" 21st May 1996 .\" Man page author: .\" Tony Nugent .\" Changes by Bram Moolenaar .SH NAZWA .I xxd \- zrzut pliku do hex lub odwrotnie .SH SYNOPSIS .B xxd \-h[elp] .br .B xxd [opcje] [plik_we [plik_wy]] .br .B xxd \-r[evert] [opcje] [plik_we [plik_wy]] .SH OPIS .I xxd tworzy zrzut heksowy podanego pliku lub standardowego wejścia. Może także przetworzyć zrzut heksowy z powrotem do oryginalnej, binarnej formy. Podobnie jak .BR uuencode (1) i .BR uudecode (1) pozwala na przekazanie danych binarnych w bezpiecznej w poczcie formie ASCII, ale ma zalety dekodowania na standardowe wyjście. Ponadto można go użyć do binarnego łatania plików. .SH OPCJE Jeśli nie podano .I plik_we xxd czyta ze standardowego wejścia. Jeśli określono .I plik_we jako znak .RB \` \- ' wtedy dane wejściowe czytane są ze standardowego wejścia. Jeśli nie podano .I plik_wy (lub podano jako .RB \` \- ' ), wyniki są wysyłane na standardowe wyjście. .PP Pamiętaj, że użyty został "leniwy" parser, który nie sprawdza więcej niż pierwszej litery opcji (o ile ta nie została obdarzona parametrem). Spacje między jedno literowymi opcjami i ich parametrami są opcjonalne. Parametry opcji mogą być określone w notacji dziesiętnej, heksadecymalej lub oktalnej. Stąd .BR \-c8 , .BR "\-c 8" , .B \-c 010 i .B \-cols 8 są sobie równoważne. .PP .TP .IR \-a " | " \-autoskip przełącza autoskip: pojedyncza '*' zastępuje linie nul. Domyślnie wyłączone. .TP .IR \-b " | " \-bits Przełącza do zrzutu bitowego (cyfr binarnych) zamiast heksowego. Opcja ta zapisuje oktety jako osiem cyfr 1 lub 0 zamiast normalnego zrzutu heksowego. Każda linia jest poprzedzona przez heksadecymalny numer linii a po nim jego reprezentacją w ascii (lub ebcdic). Opcje linii poleceń \-r, \-p, \-i nie działają w tym trybie. .TP .IR "\-c cols " | " \-cols cols" formatuje liczbę .RI < cols > oktetów na wiersz. Domyślnie 16 (\-i: 12, \-ps: 30, \-b: 6). Maks. 256. .TP .IR \-E " | "\-EBCDIC zmienia kodowanie znaków w prawej kolumnie z ASCII na EBCDIC. Nie zmienia prezentacji heksadecymalej. Opcja nie działa w połączeniu z \-r, \-p lub \-i. .TP .IR "\-g bajtów " | " \-groupsize bajtów" oddziela wyjście każdych .RI < bajtów > bajtów (dwa heksowe znaki lub osiem cyfr binarnych każde) przez biały znak. Określ .I \-g 0 by wyłączyć grupowanie. .RI < Bajtów "> domyślnie jest " 2 w trybie normalnym i \fI1\fP w trybie bitów. Grupowanie nie działa w trybie postscriptu lub włączania. .TP .IR \-h " | " \-help wypisuje podsumowanie dostępnych poleceń i kończy działanie. Nie zostaje przeprowadzony żaden zrzut. .TP .IR \-i " | " \-include wyjście w stylu włączania pliku w C. Zostaje zapisana kompletna statyczna tablica definicji (nazwana według pliku wejścia), o ile xxd nie czyta ze standardowego wejścia. .TP .IR "\-l len " | "\-len len" zakończ po wypisaniu .RI < len > oktetów. .TP .IR \-p " | " \-ps " | " \-postscript " | " \-plain wyjście w postcriptowym ciągłym stylu zrzutu heksowego. Znany także jako zwykły zrzut heksowy. .TP .IR \-r " | " \-revert odwróć operację: przekonwertuj (lub załataj) zrzut heksowy w binarkę. Jeśli nie zapisuje na standardowe wyjście, xxd zapisze plik wyjściowy bez obcinania go. Użyj kombinacji .I \-r \-p by odczytać zwykły zrzut heksadecymalny bez numerów linii i określonego układu kolumn. Dodatkowe białe znaki i łamanie wierszy są wszędzie dozwolone. .TP .I \-seek offset Kiedy użyty po .IR \-r : odwraca z .RI < offset > dodanym do pozycji w pliku odnalezionym w zrzucie heksowym. .TP .I \-s [+][\-]seek zaczyna na .RI < seek > bajtów bezwględnego (lub względnego) offsetu pliku wejściowego. \fI+ \fRwskazuje, że seek jest względne do bieżącej pozycji pliku (bez znaczenia jeśli nie wczytuje ze standardowego wejścia). \fI\- \fRwskazuje że seek powinno być o tyle znaków od końca wejścia (lub jeśli połączone z \fI+\fR: przed bieżącą pozycją pliku na standardowym wejściu). Bez opcji \-s xxd zaczyna od bieżącej pozycji w pliku. .TP .I \-u użyj wielkich liter w znakach heksowych. Domyślnie są małe znaki. .TP .IR \-v " | " \-version pokazuje wersję programu. .SH OSTRZEŻENIA .PP .I xxd \-r potrafi określić numery linii. Jeśli plik wyjścia jest możliwy do przeszukania wtedy numery linii na początku wiersza zrzutu heksowego mogą być nie po kolei, może brakować wierszy lub nakładać się na siebie. W takich wypadkach xxd użyje lseek(2) by znaleźć następną pozycję. Jeśli plik wyjściowy nie jest możliwy do przeszukania możliwe są tylko przerwy, które zostaną wypełnione bajtami null. .PP .I xxd \-r nigdy nie podaje błędów analizy. Śmieci są po cichu ignorowane. .PP W czasie edycji zrzutów heksowych, proszę zauważyć że .I xxd \-r pomija wszystko w linii wejścia po odczytaniu wystarczającej ilości kolumn danych heksadecymalnych (zobacz opcję \-c). Oznacza to także, że zmiany w drukowanych kolumnach ascii (lub ebcdic) są zawsze ignorowane. Odwrócenie zwykłego (lub postscriptowego) stylu zrzutu poprzez xxd \-r \-p nie zależy od kolejności kolumn. Tutaj cokolwiek co wygląda jak para znaków heks jest interpretowane. .PP Zauważ różnicę między .br \fI% xxd \-i plik\fR .br i .br \fI% xxd \-i < plik\fR .PP .I xxd \-s \+seek może być różne od .IR "xxd \-s seek" , ponieważ lseek(2) jest użyty do "przewinięcie" wejścia. '+' stanowi różnicę jeśli źródłem wejścia jest standardowe wejście i jeśli pozycja w pliku ze standardowego wejścia nie jest początkiem pliku w chwili uruchomienia xxd. Następujące przykłady mogą wyjaśnić (lub bardziej zmylić!)... .PP Przewiń standardowe wejście przed przeczytaniem; potrzebne ponieważ `cat' już odczytał do końca standardowego wejścia. .br \fI% sh \-c 'cat > zwykła_kopia; xxd \-s 0 > hex_kopia' < plik\fR .PP Zrzut heksowy od pozycji pliku 0x480 (=1024+128) w przód. Znak `+' oznacza "względny wobec bieżącej pozycji", stąd `128' dodaje do 1k gdzie zakończył dd. .br \fI% sh \-c 'dd of=plain_snippet bs=1k count=1; xxd \-s +128 > hex_snippet' < file\fR .PP Zrzut heksowy od pozycji pliku 0x100 ( = 1024\-768) dalej. .br \fI% sh \-c 'dd of=plain_snippet bs=1k count=1; xxd \-s +-768 > hex_snippet' < file\fR .PP Jakkolwiek, jest to rzadka sytuacja i użycie `+' jest rzadko potrzebne. Autor woli monitorować działanie xxd przy pomocy strace(1) lub truss(1) kiedy \-s jest użyte. .SH PRZYKŁADY .PP .br Wypisz wszystko z wyjątkiem pierwszych trzech linii (heksowe 0x30 bajtów) .B pliku \. .br \fI% xxd \-s 0x30 plik\fR .PP .br Wypisz trzy linie (heksowe 0x30 bajtów) z końca .B pliku \. .br \fI% xxd \-s \-0x30 plik\fR .PP .br Wypisz 120 bajtów jako ciągły zrzut heksowy z 20 oktetami na linię. .br \fI% xxd \-l 120 \-ps \-c 20 xxd.1\fR .br 2e54482058584420312022417567757374203139 .br 39362220224d616e75616c207061676520666f72 .br 20787864220a2e5c220a2e5c222032317374204d .br 617920313939360a2e5c22204d616e2070616765 .br 20617574686f723a0a2e5c2220202020546f6e79 .br 204e7567656e74203c746f6e79407363746e7567 .br .br Zrzut heksowy z pierwszymi 120 bajtami tej strony podręcznika z 12 oktetami na linię. .br \fI% xxd \-l 120 \-c 12 xxd.1\fR .br 0000000: 2e54 4820 5858 4420 3120 2241 .TH XXD 1 "A .br 000000c: 7567 7573 7420 3139 3936 2220 ugust 1996" .br 0000018: 224d 616e 7561 6c20 7061 6765 "Manual page .br 0000024: 2066 6f72 2078 7864 220a 2e5c for xxd"..\\ .br 0000030: 220a 2e5c 2220 3231 7374 204d "..\\" 21st M .br 000003c: 6179 2031 3939 360a 2e5c 2220 ay 1996..\\" .br 0000048: 4d61 6e20 7061 6765 2061 7574 Man page aut .br 0000054: 686f 723a 0a2e 5c22 2020 2020 hor:..\\" .br 0000060: 546f 6e79 204e 7567 656e 7420 Tony Nugent .br 000006c: 3c74 6f6e 7940 7363 746e 7567 plik_wy\fR .br .br Podmień datę w pliku xxd.1 .br \fI% echo '0000037: 3574 68' | xxd \-r \- xxd.1\fR .br \fI% xxd \-s 0x36 \-l 13 \-c 13 xxd.1\fR .br 0000036: 3235 7468 204d 6179 2031 3939 36 25th May 1996 .PP .br Utwórz plik o 65537 bajtach, wszystkich równych 0x00, z wyjątkiem ostatniego, który ma być 'A' (hex 0x41). .br \fI% echo '010000: 41' | xxd \-r \> plik\fR .PP .br Zrzut heksowy tego pliku z autoskipem. .br \fI% xxd \-a \-c 12 plik\fR .br 0000000: 0000 0000 0000 0000 0000 0000 ............ .br * .br 000fffc: 0000 0000 40 ....A .PP Utwórz jedno bajtowy plik zawierający pojednczą literę 'A'. Liczba po '\-r \-s' dodaje numery linii znalezione w pliku; w efekcie poprzedzające bajty są ukryte. .br \fI% echo '010000: 41' | xxd \-r \-s \-0x10000 \> plik\fR .PP Użyj xxd jako filtra wewnątrz edytora takiego jak .B vim(1) aby uzyskać zrzut heksowy zakresu między markerami `a' i `z'. .br \fI:'a,'z!xxd\fR .PP Użyj xxd jako filtra wewnątrz edytora takiego jak .B vim(1) by odzyskać binarny zrzut heksowy zakresu pomiędzy markerami `a' i `z'. .br \fI:'a,'z!xxd \-r\fR .PP Użyj xxd jako filtra wewnątrz edytora takiego jak .B vim(1) by odzyskać jedną linię zrzutu heksowego. Przejdź z kursorem na linię i wpisz: .br \fI!!xxd \-r\fR .PP Odczytaj pojednycze znaki z portu szeregowego .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 "ZWRACANE WARTOŚCI" Zwracane są następujące wartości błędów: .TP 0 nie znaleziono błędów. .TP \-1 operacja nie jest wspierana ( .I xxd \-r \-i cały czas niemożliwa). .TP 1 błąd w czasie analizowania opcji. .TP 2 problemy z plikiem wejściowym. .TP 3 problemy z plikiem wyjściowym. .TP 4,5 żądana pozycja jest nieosiągalna. .SH "ZOBACZ TAKŻE" uuencode(1), uudecode(1), patch(1) .br .SH OSTRZEŻENIA Dziwaczność narzędzi dorównuje dziwaczności mózgu twórcy. Używaj wyłącznie na własną odpowiedzialność. Kopiuj pliki. Analizuj je. Stań się czarodziejem. .br .SH WERSJA Strona podręcznika opisuje xxd w wersji 1.7 .SH AUTOR .br (c) 1990-1997 by Juergen Weigert .br .LP Kopiuj do woli i podaj moje dane, .br zarabiaj pieniądze i dziel się ze mną, .br trać pieniądze i nie miej do mnie pretensji. .PP Strona podręcznika zapoczątkowana przez Tony'ego Nugenta .br .br Małe zmiany: Bram Moolenaar. Redakcja: Juergen Weigert. .PP vim-7.4.1689/runtime/doc/xxd-ru.1000066400000000000000000000312731267703067000163440ustar00rootroot00000000000000.TH XXD 1 "August 1996" " man xxd" .\" .\" 21st May 1996 .\" Man page author: .\" Tony Nugent .\" Changes by Bram Moolenaar .SH .I xxd \- . .SH .B xxd \-h[elp] .br .B xxd [] [_ [_]] .br .B xxd \-r[evert] [] [_ [_]] .SH .I xxd , , . . .BR uuencode(1) .BR uudecode(1), ASCII-, , , , xxd , . .SH .I _ , . , .I _ .RB \` \- ', . , .I _ ( .RB \` \- ' ), . .PP , "" , , . . , . , .BR \-c8 , .BR "\-c 8" , .B \-c 010 .B \-cols 8 . .PP .TP .IR \-a " | " \-autoskip : '*'. . .TP .IR \-b " | " \-bits ( ). "1" "0". , ( ascii ebcdic). \-r, \-p, \-i . .TP .IR "\-c " | " \-cols " .RI < >, . 16 (\-i: 12, \-ps: 30, \-b: 6). : 256. .TP .IR \-E " | " \-EBCDIC ASCII EBCDIC. . , \-r, \-p \-i. .TP .IR "\-g " | " \-groupsize " .RI < > ( ), . .I \-g 0 . .RI < "> " 2 \fI1\fP . postscript include. .TP .IR \-h " | " \-help . . .TP .IR \-i " | " \-include C. , , xxd . .TP .IR "\-l " | " \-len " .RI < > . .TP .IR \-p " | " \-ps " | " \-postscript " | " \-plain , "" "postscript". .TP .IR \-r " | " \-revert : ( ). , xxd . .I \-r \-p "" - . . .TP .I \-seek .I \-r : .RI < > , . .TP .I \-s [\+][\-]seek ( ) .RI < > _. \fI\+ \fR, (, ). \fI\- \fR, (, \fI \+ \fR: ). \-s , xxd . .TP .I \-u . . .TP .IR \-v " | " \-version . .SH .PP .I xxd \-r . , , . xxd lseek(2) . , , . .PP .I xxd \-r . . .PP , .I xxd \-r (. \-c). , , ascii ( ebcdic), . postscript xxd \-r \-p . , . .PP .PP \fI% xxd \-i \fR .PP .PP \fI% xxd \-i \< \fR .PP .I xxd \-s \+seek .I xxd \-s seek, , "" , lseek(2). `+' , , , xxd . ( ݣ !) ... .PP ; , 'cat' : .PP \fI% sh \-c 'cat > plain_copy; xxd \-s 0 > hex_copy' < file .PP 0x480 (= 1024+128). `+' " ", `128' , dd: .PP \fI% sh \-c 'dd of=plain_snippet bs=1k count=1; xxd \-s +128 > hex_snippet' < file .PP 0x100 (= 1024-768): .PP \fI% sh \-c 'dd of=plain_snippet bs=1k count=1; xxd \-s +-768 > hex_snippet' < file .PP , , , `+' . xxd strace(1) truss(1) , \-s. .SH .PP .br ӣ, ң (0x30 ) .B file : .PP \fI% xxd \-s 0x30 file .PP .br (0x30 ) .B file : .PP \fI% xxd \-s \-0x30 file .PP .br 120 20 : .PP \fI% xxd \-l 120 \-ps \-c 20 xxd.1\fR .br 2e544820585844203120224d616e75616c207061 .br 676520666f7220787864220a2e5c220a2e5c2220 .br 32317374204d617920313939360a2e5c22204d61 .br 6e207061676520617574686f723a0a2e5c222020 .br 2020546f6e79204e7567656e74203c746f6e7940 .br 7363746e7567656e2e7070702e67752e6564752e .br .PP .br 120 12 : .PP \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 _\fR .br .PP .br xxd.1: .PP \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 65537- , 0x00, , 'A' (0x41): .PP \fI% echo '010000: 41' | xxd \-r \> file\fR .PP .br : .PP \fI% xxd \-a \-c 12 file\fR .br 0000000: 0000 0000 0000 0000 0000 0000 ............ .br * .br 000fffc: 0000 0000 40 ....A .PP 1- , 'A'. '\-r \-s' , ; , : .PP \fI% echo '010000: 41' | xxd \-r \-s \-0x10000 \> file\fR .PP xxd , .B vim(1), `a' `z': .PP \fI:'a,'z!xxd\fR .PP xxd , .B vim(1), `a' `z': .PP \fI:'a,'z!xxd \-r\fR .PP xxd , .B vim(1), . .PP \fI!!xxd \-r\fR .PP : .PP \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 xxd : .TP 0 . .TP \-1 ( .I xxd \-r \-i ). .TP 1 . .TP 2 . .TP 3 . .TP 4,5 . .SH uuencode(1), uudecode(1), patch(1) .br .SH ţ . ţ . , , . .br .SH xxd 1.7. .SH .br (c) 1990-1997 (Juergen Weigert) .br .LP . .br - , . .br , ޣ. .PP (Tony Nugent) .br .br (Bram Moolenaar). (Juergen Weigert). .PP vim-7.4.1689/runtime/doc/xxd-ru.UTF-8.1000066400000000000000000000502011267703067000171360ustar00rootroot00000000000000.TH XXD 1 "August 1996" "Страница man для xxd" .\" .\" 21st May 1996 .\" Man page author: .\" Tony Nugent .\" Changes by Bram Moolenaar .SH ИМЯ .I xxd \- создаёт представление файла в виде шестнадцатеричных кодов или выполняет обратное преобразование. .SH КОМАНДНАЯ СТРОКА .B xxd \-h[elp] .br .B xxd [ключи] [входной_файл [выходной_файл]] .br .B xxd \-r[evert] [ключи] [входной_файл [выходной_файл]] .SH ОПИСАНИЕ .I xxd создаёт представление указанного файла или данных, прочитанных из потока стандартного ввода, в виде шестнадцатеричных кодов. Эта команда также может выполнить обратное преобразование заданных шестнадцатеричными кодами данных в исходный бинарный формат. Подобно командам .BR uuencode(1) и .BR uudecode(1), она позволяет выполнять преобразование бинарных данных в ASCII-код, который можно передавать по электронной почте, однако, помимо этого, программа xxd позволяет выполнять декодирование в поток стандартного вывода, а также может применяться для создания заплаток для бинарных файлов. .SH КЛЮЧИ ЗАПУСКА Если .I входной_файл не задан, то соответствующие данные читаются из потока стандартного ввода. В случае, если в качестве .I входного_файла используется символ .RB \` \- ', источником данных также выступает поток стандартного ввода. В том случае, если не указан .I выходной_файл (или вместо него используется символ .RB \` \- ' ), результат преобразования направляется в поток стандартного вывода. .PP Обратите внимание, что используется "ленивый" алгоритм разбора ключей, который не проверяет более одной буквы ключа, если в этом ключе не используется параметр. Пробелы между единственным символом ключа и соответствующим параметром не являются обязательными. Параметры ключей могут быть заданы с использованием десятичного, шестнадцатеричного или восьмеричного формата. Таким образом, ключи .BR \-c8 , .BR "\-c 8" , .B \-c 010 и .B \-cols 8 являются равнозначными. .PP .TP .IR \-a " | " \-autoskip Включает автоматический пропуск: вместо последовательности нулевых строк используется одиночный символ '*'. По умолчанию не применяется. .TP .IR \-b " | " \-bits Вместо шестнадцатеричного кода используются биты (двоичные цифры). При использовании этого ключа вместо обычного шестнадцатеричного представления октетов используются наборы из восьми символов "1" и "0". Каждая строка предваряется номером строки в шестнадцатеричном виде, а завершается символьным представлением (в виде ascii или ebcdic). Ключи \-r, \-p, \-i в этом режиме не работают. .TP .IR "\-c кол " | " \-cols кол" Задаёт количество октетов .RI < кол >, которое выводится на каждой строке. По умолчанию используется значение 16 (\-i: 12, \-ps: 30, \-b: 6). Максимально допустимое значение: 256. .TP .IR \-E " | " \-EBCDIC Изменяет способ кодирования символов в правой колонке с ASCII на EBCDIC. Этот ключ не изменяет шестнадцатеричное представление. Данный ключ не имеет смысла, если используются ключи \-r, \-p или \-i. .TP .IR "\-g байт " | " \-groupsize байт" Позволяет выполнять группировку указанного количества .RI < байтов > (две шестнадцатеричные цифры или восемь битов), отделяя группы друг от друга пробелами. Значение .I \-g 0 применяется для отказа от использования группировки. По умолчанию используется значение .RI < байт "> равное " 2 в обычном режиме и \fI1\fP в битовом режиме. Группировка не применяется в режимах postscript и include. .TP .IR \-h " | " \-help Выводит справку по доступным ключам командной строки и завершает работу программы. Создание шестнадцатеричного представления не выполняется. .TP .IR \-i " | " \-include Позволяет создавать вывод в стиле подключаемых заголовочных файлов языка C. Вывод содержит полноценное определение статического массива данных, имя которого соответствует имени входного файла, если xxd не считывает данные из потока стандартного ввода. .TP .IR "\-l длина " | " \-len длина" Завершает работу после записи заданного в параметре .RI < длина > количества октетов. .TP .IR \-p " | " \-ps " | " \-postscript " | " \-plain Использует непрерывный формат вывода шестнадцатеричного кода, известный как "простой" стиль или стиль "postscript". .TP .IR \-r " | " \-revert Изменяет смысл операции на противоположный: позволяет выполнять преобразование шестнадцатеричного представления в бинарный код (или применять результат в качестве заплаты). Если вывод происходит не в поток стандартного вывода, то xxd выполняет добавление кода к соответствующему файлу. При использовании комбинации ключей .I \-r \-p происходит чтение "простого" шестнадцатеричного представления без использования информации о номерах строк и какого-либо специального раскроя колонок. Пробелы и символы новой строки могут встречаться в любом месте исходных данных. .TP .I \-seek смещение При использовании после ключа .I \-r : добавлять указанное .RI < смещение > к файловым позициям, обнаруженным в исходных данных. .TP .I \-s [\+][\-]seek Начинает работу с указанного абсолютного (или относительного) .RI < смещения > в байтах во входном_файле. \fI\+ \fRуказывает, что смещение является относительным по отношению к текущей файловой позиции в потоке стандартного ввода (бессмысленно, если чтение происходит не из потока стандартного ввода). \fI\- \fRуказывает, что должно быть прочитано указанное количество символов от конца ввода (либо, если сочетается с \fI \+ \fR: перед текущей позиции файла в потоке стандартного ввода). Если ключ \-s не используется, то xxd начинает работу от текущей позиции в файле. .TP .I \-u Использует шестнадцатеричные цифры в верхнем регистре. По умолчанию используются цифры в нижнем регистре символов. .TP .IR \-v " | " \-version Отображает информацию о версии программы. .SH ПОДВОДНЫЕ КАМНИ .PP .I xxd \-r обладает встроенным интеллектом для распознавания информации о номерах строк. Если возможен поиск по входному файлу, то номера строк в начале каждой строки шестнадцатеричного представления могут быть неупорядоченными, некоторые строки могут быть пропущены или пересекаться друг с другом. В этих случаях xxd использует lseek(2) для перехода к следующей позиции. Если поиск по входному файлу невозможен, то допустимы только пропуски строк, которые заполняются нулевыми байтами. .PP .I xxd \-r никогда не выводит сообщений об ошибках. Мусор пропускается молча. .PP При редактировании шестнадцатеричных представлений бинарных файлов обращайте внимание, что .I xxd \-r пропускает в строке ввода любые данные после прочтения достаточного количества колонок шестнадцатеричных данных (см. ключ \-c). Это означает, что изменения, внесенные в колонки с печатными символами ascii (или ebcdic), всегда игнорируются. При обратном преобразовании шестнадцатеричного представления в стиле postscript с помощью команды xxd \-r \-p количество колонок не учитывается. В этом случае распознаются все символы, которые похожи на пары шестнадцатеричных цифр. .PP Обратите внимание на различие между командами .PP \fI% xxd \-i файл\fR .PP и .PP \fI% xxd \-i \< файл\fR .PP Команда .I xxd \-s \+seek может отличаться от .I xxd \-s seek, поскольку для того, чтобы "отмотать" данные на входе назад, используется вызов lseek(2). При использовании `+' поведение будет отличаться, если входные данные поступают с потока стандартного ввода, а позиция в файле стандартного ввода не находится в начале файла к тому моменту, когда программа xxd запущена и приступает к чтению ввода. Нижеследующие примеры помогут прояснить (или ещё больше запутать!) ситуацию... .PP Отмотка назад потока стандартного ввода; необходимо, поскольку 'cat' уже выполнила чтение до конца потока стандартного ввода: .PP \fI% sh \-c 'cat > plain_copy; xxd \-s 0 > hex_copy' < file .PP Вывод шестнадцатеричного представления от позиции в файле 0x480 (= 1024+128). Символ `+' означает "относительно текущей позиции", таким образом `128' добавляется к первому килобайту, где завершает работу dd: .PP \fI% sh \-c 'dd of=plain_snippet bs=1k count=1; xxd \-s +128 > hex_snippet' < file .PP Вывод шестнадцатеричного представления от позиции в файле 0x100 (= 1024-768): .PP \fI% sh \-c 'dd of=plain_snippet bs=1k count=1; xxd \-s +-768 > hex_snippet' < file .PP В то же время, следует заметить, что подобные ситуации встречаются довольно редко, так что символ `+' обычно не используется. Автор предпочитает наблюдать за работой xxd с помощью strace(1) или truss(1) в тех случаях, когда применяется ключ \-s. .SH ПРИМЕРЫ .PP .br Вывести всё, кроме первых трёх строк (0x30 байтов) файла .B file : .PP \fI% xxd \-s 0x30 file .PP .br Вывести три строки (0x30 байтов) от конца файла .B file : .PP \fI% xxd \-s \-0x30 file .PP .br Вывести 120 байтов в виде непрерывного шестнадцатеричного представления по 20 октетов в строке: .PP \fI% xxd \-l 120 \-ps \-c 20 xxd.1\fR .br 2e544820585844203120224d616e75616c207061 .br 676520666f7220787864220a2e5c220a2e5c2220 .br 32317374204d617920313939360a2e5c22204d61 .br 6e207061676520617574686f723a0a2e5c222020 .br 2020546f6e79204e7567656e74203c746f6e7940 .br 7363746e7567656e2e7070702e67752e6564752e .br .PP .br Вывести первые 120 байтов этой страницы справочника по 12 октетов в строке: .PP \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 выходной_файл\fR .br .PP .br Заменить дату в файле xxd.1: .PP \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 Создать 65537-байтный файл, все байты которого имеют значение 0x00, кроме последнего байта, который должен иметь значение 'A' (0x41): .PP \fI% echo '010000: 41' | xxd \-r \> file\fR .PP .br Создать шестнадцатеричное представление этого файла с использованием автоматического пропуска: .PP \fI% xxd \-a \-c 12 file\fR .br 0000000: 0000 0000 0000 0000 0000 0000 ............ .br * .br 000fffc: 0000 0000 40 ....A .PP Создать 1-байтный файл, содержащий символ 'A'. Число после '\-r \-s' добавляется к номерам строк, найденным в файле; иначе говоря, предшествующие байты пропускаются: .PP \fI% echo '010000: 41' | xxd \-r \-s \-0x10000 \> file\fR .PP xxd можно использовать в качестве фильтра в редакторе, например в .B vim(1), чтобы создать шестнадцатеричное представление области между отметками `a' и `z': .PP \fI:'a,'z!xxd\fR .PP Вы можете использовать xxd в качестве фильтра в редакторе, например в .B vim(1), для восстановления данных из шестнадцатеричного представления между отметками `a' и `z': .PP \fI:'a,'z!xxd \-r\fR .PP Вы можете использовать xxd в качестве фильтра в редакторе, например в .B vim(1), для восстановления данных из единственной строки шестнадцатеричного представления. Поместите курсор в соответствующую строку и наберите .PP \fI!!xxd \-r\fR .PP Чтобы прочитать единственный символ из канала связи: .PP \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 ВОЗВРАЩАЕМЫЕ ЗНАЧЕНИЯ Программа xxd завершает работу со следующими значениями: .TP 0 Ошибки не обнаружены. .TP \-1 Операция не поддерживается (выполнение .I xxd \-r \-i пока невозможно). .TP 1 Ошибка при разборе ключей командной строки. .TP 2 Проблемы во входном файле. .TP 3 Проблемы в выходном файле. .TP 4,5 Желательная позиция поиска недостижима. .SH СМОТРИ ТАКЖЕ uuencode(1), uudecode(1), patch(1) .br .SH ПРЕДУПРЕЖДЕНИЕ Странность этой программы соответствует особенностям мозга её создателя. Используйте её на свой страх и риск. Копируйте файлы, отслеживайте вызовы, становитесь волшебником. .br .SH ВЕРСИЯ Эта страница справочника документирует xxd версии 1.7. .SH АВТОР .br (c) 1990-1997 Юрген Вайгерт (Juergen Weigert) .br .LP Вы можете свободно распространять программу со ссылкой на меня. .br Если использование этой программы принесло вам какой-то доход, поделитесь со мной. .br Если вы потеряли деньги, то я тут не причём. .PP Первый вариант страницы справочника написан Тони Наджентом (Tony Nugent) .br .br Небольшие изменения внесены Брамом Мооленааром (Bram Moolenaar). Страница отредактирована Юргеном Вайгертом (Juergen Weigert). .PP vim-7.4.1689/runtime/doc/xxd.1000066400000000000000000000242431267703067000157170ustar00rootroot00000000000000.TH XXD 1 "August 1996" "Manual page for xxd" .\" .\" 21st May 1996 .\" Man page author: .\" Tony Nugent .\" Changes by Bram Moolenaar .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 hexadecimal 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" 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 \-e Switch to little-endian hexdump. This option treats byte groups as words in little-endian byte order. The default grouping of 4 bytes may be changed using .RI "" \-g . This option only applies to hexdump, leaving the ASCII (or EBCDIC) representation unchanged. The command line switches \-r, \-p, \-i do not work with this mode. .TP .IR "\-g bytes " | " \-groupsize bytes" separate 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, \fI4\fP in little-endian 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 .I \-o offset add .RI < offset > to the displayed file position. .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 .IR \-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 output 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 anything 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 .IR "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\fR .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\fR .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\fR .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 .BR file . .br \fI% xxd \-s 0x30 file\fR .PP .br Print 3 lines (hex 0x30 bytes) from the end of .BR file . .br \fI% xxd \-s \-0x30 file\fR .PP .br Print 120 bytes as continuous hexdump with 20 octets per line. .br \fI% xxd \-l 120 \-ps \-c 20 xxd.1\fR .br 2e54482058584420312022417567757374203139 .br 39362220224d616e75616c207061676520666f72 .br 20787864220a2e5c220a2e5c222032317374204d .br 617920313939360a2e5c22204d616e2070616765 .br 20617574686f723a0a2e5c2220202020546f6e79 .br 204e7567656e74203c746f6e79407363746e7567 .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 2241 .TH XXD 1 "A .br 000000c: 7567 7573 7420 3139 3936 2220 ugust 1996" .br 0000018: 224d 616e 7561 6c20 7061 6765 "Manual page .br 0000024: 2066 6f72 2078 7864 220a 2e5c for xxd"..\\ .br 0000030: 220a 2e5c 2220 3231 7374 204d "..\\" 21st M .br 000003c: 6179 2031 3939 360a 2e5c 2220 ay 1996..\\" .br 0000048: 4d61 6e20 7061 6765 2061 7574 Man page aut .br 0000054: 686f 723a 0a2e 5c22 2020 2020 hor:..\\" .br 0000060: 546f 6e79 204e 7567 656e 7420 Tony Nugent .br 000006c: 3c74 6f6e 7940 7363 746e 7567 output_file\fR .br .br Patch the date in the file xxd.1 .br \fI% echo "0000037: 3574 68" | xxd \-r \- xxd.1\fR .br \fI% xxd \-s 0x36 \-l 13 \-c 13 xxd.1\fR .br 0000036: 3235 7468 204d 6179 2031 3939 36 25th May 1996 .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 .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 .br Small changes by Bram Moolenaar. Edited by Juergen Weigert. .PP vim-7.4.1689/runtime/doc/xxd.man000066400000000000000000000256711267703067000163400ustar00rootroot00000000000000XXD(1) General Commands Manual 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 representation, but has the advantage of decoding to stan‐ dard 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 `-' character 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 hexadecimal dump. Each line is preceded by a line number in hexadecimal and followed by an ascii (or ebcdic) representa‐ tion. The command line switches -r, -p, -i do not work with this mode. -c cols | -cols cols format octets per line. Default 16 (-i: 12, -ps: 30, -b: 6). Max 256. -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. -e Switch to little-endian hexdump. This option treats byte groups as words in little-endian byte order. The default grouping of 4 bytes may be changed using -g. This option only applies to hex‐ dump, leaving the ASCII (or EBCDIC) representation unchanged. The command line switches -r, -p, -i do not work with this mode. -g bytes | -groupsize bytes separate the output of every bytes (two hex characters or eight bit-digits each) by a whitespace. Specify -g 0 to sup‐ press grouping. defaults to 2 in normal mode, 4 in lit‐ tle-endian 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 defini‐ tion is written (named after the input file), unless xxd reads from stdin. -l len | -len len stop after writing octets. -o offset add to the displayed file position. -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 combination -r -p to read plain hexadeci‐ mal dumps without line number information and without a particu‐ lar column layout. Additional Whitespace and line-breaks are allowed anywhere. -seek offset When used after -r: revert with added to file positions found in hexdump. -s [+][-]seek start at bytes abs. (or rel.) infile offset. + indicates that the seek is relative to the current 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. CAVEATS xxd -r has some builtin magic while evaluating line number information. If the output file is seekable, then the linenumbers at the start of each hexdump line may be out of order, lines may be missing, or over‐ lapping. 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. 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 number of col‐ umns. Here anything that looks like a pair of hex-digits is inter‐ preted. 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 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!)... 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. % 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 20 octets per line. % xxd -l 120 -ps -c 20 xxd.1 2e54482058584420312022417567757374203139 39362220224d616e75616c207061676520666f72 20787864220a2e5c220a2e5c222032317374204d 617920313939360a2e5c22204d616e2070616765 20617574686f723a0a2e5c2220202020546f6e79 204e7567656e74203c746f6e79407363746e7567 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 2241 .TH XXD 1 "A 000000c: 7567 7573 7420 3139 3936 2220 ugust 1996" 0000018: 224d 616e 7561 6c20 7061 6765 "Manual page 0000024: 2066 6f72 2078 7864 220a 2e5c for xxd"..\ 0000030: 220a 2e5c 2220 3231 7374 204d "..\" 21st M 000003c: 6179 2031 3939 360a 2e5c 2220 ay 1996..\" 0000048: 4d61 6e20 7061 6765 2061 7574 Man page aut 0000054: 686f 723a 0a2e 5c22 2020 2020 hor:..\" 0000060: 546f 6e79 204e 7567 656e 7420 Tony Nugent 000006c: 3c74 6f6e 7940 7363 746e 7567 output_file Patch the date in the file xxd.1 % echo "0000037: 3574 68" | xxd -r - xxd.1 % xxd -s 0x36 -l 13 -c 13 xxd.1 0000036: 3235 7468 204d 6179 2031 3939 36 25th May 1996 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 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 impossible). 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 Distribute freely and credit me, make money and share with me, lose money and don't ask me. Manual page started by Tony Nugent Small changes by Bram Moolenaar. Edited by Juergen Weigert. Manual page for xxd August 1996 XXD(1) vim-7.4.1689/runtime/evim.vim000066400000000000000000000036551267703067000157460ustar00rootroot00000000000000" Vim script for Evim key bindings " Maintainer: Bram Moolenaar " Last Change: 2006 Mar 29 " Don't use Vi-compatible mode. set nocompatible " Use the mswin.vim script for most mappings source :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 =pumvisible() ? "\Down>" : "\C-O>gj" inoremap =pumvisible() ? "\Up>" : "\C-O>gk" " CTRL-F does Find dialog instead of page forward noremap :promptfind vnoremap y:promptfind " onoremap :promptfind inoremap :promptfind cnoremap :promptfind 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 : vim-7.4.1689/runtime/filetype.vim000066400000000000000000002115301267703067000166200ustar00rootroot00000000000000" Vim support file to detect file types " " Maintainer: Bram Moolenaar " Last Change: 2015 Dec 03 " 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 if exists("*fnameescape") au BufNewFile,BufRead ?\+.orig,?\+.bak,?\+.old,?\+.new,?\+.dpkg-dist,?\+.dpkg-old,?\+.dpkg-new,?\+.dpkg-bak,?\+.rpmsave,?\+.rpmnew \ exe "doau filetypedetect BufRead " . fnameescape(expand(":r")) au BufNewFile,BufRead *~ \ let s:name = expand("") | \ let s:short = substitute(s:name, '\~$', '', '') | \ if s:name != s:short && s:short != "" | \ exe "doau filetypedetect BufRead " . fnameescape(s:short) | \ endif | \ unlet! s:name s:short au BufNewFile,BufRead ?\+.in \ if expand(":t") != "configure.in" | \ exe "doau filetypedetect BufRead " . fnameescape(expand(":r")) | \ endif elseif &verbose > 0 echomsg "Warning: some filetypes will not be recognized because this version of Vim does not have fnameescape()" 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 " Function used for patterns that end in a star: don't set the filetype if the " file name matches ft_ignore_pat. func! s:StarSetf(ft) if expand("") !~ g:ft_ignore_pat exe 'setf ' . a:ft endif endfunc " Abaqus or Trasys au BufNewFile,BufRead *.inp call s:Check_inp() func! s:Check_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 endfunc " A-A-P recipe au BufNewFile,BufRead *.aap setf aap " A2ps printing utility au BufNewFile,BufRead */etc/a2ps.cfg,*/etc/a2ps/*.cfg,a2psrc,.a2psrc setf a2ps " ABAB/4 au BufNewFile,BufRead *.abap setf abap " 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 if has("vms") au BufNewFile,BufRead *.gpr,*.ada_m,*.adc setf ada else au BufNewFile,BufRead *.gpr setf ada endif " AHDL au BufNewFile,BufRead *.tdf setf ahdl " AMPL au BufNewFile,BufRead *.run setf ampl " Ant au BufNewFile,BufRead build.xml setf ant " Arduino au BufNewFile,BufRead *.ino,*.pde setf arduino " Apache style config file au BufNewFile,BufRead proftpd.conf* call s:StarSetf('apachestyle') " Apache config file au BufNewFile,BufRead .htaccess,*/etc/httpd/*.conf setf apache " XA65 MOS6510 cross assembler au BufNewFile,BufRead *.a65 setf a65 " Applescript au BufNewFile,BufRead *.scpt setf applescript " Applix ELF au BufNewFile,BufRead *.am \ if expand("") !~? 'Makefile.am\>' | setf elf | endif " ALSA configuration au BufNewFile,BufRead .asoundrc,*/usr/share/alsa/alsa.conf,*/etc/asound.conf setf alsaconf " Arc Macro Language au BufNewFile,BufRead *.aml setf aml " APT config file au BufNewFile,BufRead apt.conf setf aptconf au BufNewFile,BufRead */.aptitude/config setf aptconf au BufNewFile,BufRead */etc/apt/apt.conf.d/{[-_[:alnum:]]\+,[-_.[:alnum:]]\+.conf} setf aptconf " Arch Inventory file au BufNewFile,BufRead .arch-inventory,=tagging-method setf arch " ART*Enterprise (formerly ART-IM) au BufNewFile,BufRead *.art setf art " AsciiDoc au BufNewFile,BufRead *.asciidoc,*.adoc setf asciidoc " 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,*/etc/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 s: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. func! s:FTasm() " make sure b:asmsyntax exists if !exists("b:asmsyntax") let b:asmsyntax = "" endif if b:asmsyntax == "" call s:FTasmsyntax() 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 " . fnameescape(b:asmsyntax) endfunc func! s:FTasmsyntax() " 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)." " let match = matchstr(head, '\sasmsyntax=\zs[a-zA-Z0-9]\+\ze\s') if match != '' let b:asmsyntax = match elseif ((head =~? '\.title') || (head =~? '\.ident') || (head =~? '\.macro') || (head =~? '\.subtitle') || (head =~? '\.library')) let b:asmsyntax = "vmasm" endif endfunc " Macro (VAX) au BufNewFile,BufRead *.mar setf vmasm " Atlas au BufNewFile,BufRead *.atl,*.as setf atlas " Autoit v3 au BufNewFile,BufRead *.au3 setf autoit " Autohotkey au BufNewFile,BufRead *.ahk setf autohotkey " Automake au BufNewFile,BufRead [mM]akefile.am,GNUmakefile.am setf automake " Autotest .at files are actually m4 au BufNewFile,BufRead *.at setf m4 " 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 s: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. func! s: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 endfunc " Visual Basic Script (close to Visual Basic) or Visual Basic .NET au BufNewFile,BufRead *.vb,*.vbs,*.dsm,*.ctl setf vb " IBasic file (similar to QBasic) au BufNewFile,BufRead *.iba,*.ibi setf ibasic " FreeBasic file (similar to QBasic) au BufNewFile,BufRead *.fb,*.bi setf freebasic " Batch file for MSDOS. au BufNewFile,BufRead *.bat,*.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 call s:FTbtm() func! s:FTbtm() if exists("g:dosbatch_syntax_for_btm") && g:dosbatch_syntax_for_btm setf dosbatch else setf btm endif endfunc " 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 " BibTeX Bibliography Style au BufNewFile,BufRead *.bst setf bst " BIND configuration au BufNewFile,BufRead named.conf,rndc.conf setf named " BIND zone au BufNewFile,BufRead named.root setf bindzone au BufNewFile,BufRead *.db call s:BindzoneCheck('') func! s:BindzoneCheck(default) if getline(1).getline(2).getline(3).getline(4) =~ '^; <<>> DiG [0-9.]\+ <<>>\|BIND.*named\|$ORIGIN\|$TTL\|IN\s\+SOA' setf bindzone elseif a:default != '' exe 'setf ' . a:default endif endfunc " Blank au BufNewFile,BufRead *.bl setf blank " Blkid cache file au BufNewFile,BufRead */etc/blkid.tab,*/etc/blkid.tab.old setf xml " Bazel (http://bazel.io) autocmd BufRead,BufNewFile *.bzl,BUILD,WORKSPACE setfiletype bzl " C or lpc au BufNewFile,BufRead *.c call s:FTlpc() func! s: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 endfunc " Calendar au BufNewFile,BufRead calendar setf calendar " C# au BufNewFile,BufRead *.cs setf cs " CSDL au BufNewFile,BufRead *.csdl setf csdl " Cabal au BufNewFile,BufRead *.cabal setf cabal " Cdrdao TOC au BufNewFile,BufRead *.toc setf cdrtoc " Cdrdao config au BufNewFile,BufRead */etc/cdrdao.conf,*/etc/defaults/cdrdao,*/etc/default/cdrdao,.cdrdao setf cdrdaoconf " Cfengine au BufNewFile,BufRead cfengine.conf setf cfengine " ChaiScript au BufRead,BufNewFile *.chai setf chaiscript " Comshare Dimension Definition Language au BufNewFile,BufRead *.cdl setf cdl " Conary Recipe au BufNewFile,BufRead *.recipe setf conaryrecipe " 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++ au BufNewFile,BufRead *.cxx,*.c++,*.hh,*.hxx,*.hpp,*.ipp,*.moc,*.tcc,*.inl setf cpp if has("fname_case") au BufNewFile,BufRead *.C,*.H setf cpp endif " .h files can be C, Ch C++, ObjC or ObjC++. " Set c_syntax_for_h if you want C, ch_syntax_for_h if you want Ch. ObjC is " detected automatically. au BufNewFile,BufRead *.h call s:FTheader() func! s:FTheader() if match(getline(1, min([line("$"), 200])), '^@\(interface\|end\|class\)') > -1 if exists("g:c_syntax_for_h") setf objc else setf objcpp endif elseif exists("g:c_syntax_for_h") setf c elseif exists("g:ch_syntax_for_h") setf ch else setf cpp endif endfunc " 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,NEWS.Debian,NEWS.dch \ setf debchangelog au BufNewFile,BufRead [cC]hange[lL]og \ if getline(1) =~ '; urgency=' \| setf debchangelog \| else \| setf changelog \| endif au BufNewFile,BufRead NEWS \ if getline(1) =~ '; urgency=' \| setf debchangelog \| endif " CHILL au BufNewFile,BufRead *..ch setf chill " Changes for WEB and CWEB or CHILL au BufNewFile,BufRead *.ch call s: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. func! s: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 endfunc " ChordPro au BufNewFile,BufRead *.chopro,*.crd,*.cho,*.crdpro,*.chordpro setf chordpro " Clean au BufNewFile,BufRead *.dcl,*.icl setf clean " Clever au BufNewFile,BufRead *.eni setf cl " Clever or dtd au BufNewFile,BufRead *.ent call s:FTent() func! s: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 endfunc " Clipper (or FoxPro; could also be eviews) au BufNewFile,BufRead *.prg \ if exists("g:filetype_prg") | \ exe "setf " . g:filetype_prg | \ else | \ setf clipper | \ endif " Clojure au BufNewFile,BufRead *.clj,*.cljs,*.cljx,*.cljc setf clojure " Cmake au BufNewFile,BufRead CMakeLists.txt,*.cmake,*.cmake.in setf cmake " Cmusrc au BufNewFile,BufRead */.cmus/{autosave,rc,command-history,*.theme} setf cmusrc au BufNewFile,BufRead */cmus/{rc,*.theme} setf cmusrc " Cobol au BufNewFile,BufRead *.cbl,*.cob,*.lib setf cobol " cobol or zope form controller python script? (heuristic) au BufNewFile,BufRead *.cpy \ if getline(1) =~ '^##' | \ setf python | \ else | \ setf cobol | \ endif " Coco/R au BufNewFile,BufRead *.atg setf coco " Cold Fusion au BufNewFile,BufRead *.cfm,*.cfi,*.cfc setf cf " Configure scripts au BufNewFile,BufRead configure.in,configure.ac setf config " CUDA Cumpute Unified Device Architecture au BufNewFile,BufRead *.cu setf cuda " Dockerfile au BufNewFile,BufRead Dockerfile setf dockerfile " 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 " Euphoria 3 or 4 au BufNewFile,BufRead *.eu,*.ew,*.ex,*.exu,*.exw call s:EuphoriaCheck() if has("fname_case") au BufNewFile,BufRead *.EU,*.EW,*.EX,*.EXU,*.EXW call s:EuphoriaCheck() endif func! s:EuphoriaCheck() if exists('g:filetype_euphoria') exe 'setf ' . g:filetype_euphoria else setf euphoria3 endif endfunc " 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 " Cucumber au BufNewFile,BufRead *.feature setf cucumber " 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 au BufNewFile,BufRead control \ if getline(1) =~ '^Source:' \| setf debcontrol \| endif " Debian Sources.list au BufNewFile,BufRead */etc/apt/sources.list setf debsources au BufNewFile,BufRead */etc/apt/sources.list.d/*.list setf debsources " Deny hosts au BufNewFile,BufRead denyhosts.conf setf denyhosts " dnsmasq(8) configuration files au BufNewFile,BufRead */etc/dnsmasq.conf setf dnsmasq " ROCKLinux package description au BufNewFile,BufRead *.desc setf desc " the D language or dtrace au BufNewFile,BufRead *.d call s:DtraceCheck() func! s:DtraceCheck() let lines = getline(1, min([line("$"), 100])) if match(lines, '^module\>\|^import\>') > -1 " D files often start with a module and/or import statement. setf d elseif match(lines, '^#!\S\+dtrace\|#pragma\s\+D\s\+option\|:\S\{-}:\S\{-}:') > -1 setf dtrace else setf d endif endfunc " Desktop files au BufNewFile,BufRead *.desktop,.directory setf desktop " Dict config au BufNewFile,BufRead dict.conf,.dictrc setf dictconf " Dictd config au BufNewFile,BufRead dictd.conf setf dictdconf " Diff files au BufNewFile,BufRead *.diff,*.rej,*.patch setf diff " Dircolors au BufNewFile,BufRead .dir_colors,.dircolors,*/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 call s:BindzoneCheck('dcl') " 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 " Datascript au BufNewFile,BufRead *.ds setf datascript " dsl au BufNewFile,BufRead *.dsl setf dsl " DTD (Document Type Definition for XML) au BufNewFile,BufRead *.dtd setf dtd " DTS/DSTI (device tree files) au BufNewFile,BufRead *.dts,*.dtsi setf dts " 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 or Euphoria au BufNewFile,BufRead *.e,*.E call s:FTe() " Elinks configuration au BufNewFile,BufRead */etc/elinks.conf,*/.elinks/elinks.conf setf elinks func! s:FTe() if exists('g:filetype_euphoria') exe 'setf ' . g:filetype_euphoria else let n = 1 while n < 100 && n < line("$") if getline(n) =~ "^\\s*\\(<'\\|'>\\)\\s*$" setf specman return endif let n = n + 1 endwhile setf eiffel endif endfunc " ERicsson LANGuage; Yaws is erlang too au BufNewFile,BufRead *.erl,*.hrl,*.yaws setf erlang " Elm Filter Rules file au BufNewFile,BufRead filter-rules setf elmfilt " ESMTP rc file au BufNewFile,BufRead *esmtprc setf esmtprc " ESQL-C au BufNewFile,BufRead *.ec,*.EC setf esqlc " Esterel au BufNewFile,BufRead *.strl setf esterel " 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 " Falcon au BufNewFile,BufRead *.fal setf falcon " Fantom au BufNewFile,BufRead *.fan,*.fwt setf fan " Factor au BufNewFile,BufRead *.factor setf factor " Fetchmail RC file au BufNewFile,BufRead .fetchmailrc setf fetchmail " FlexWiki - disabled, because it has side effects when a .wiki file " is not actually FlexWiki "au BufNewFile,BufRead *.wiki setf flexwiki " 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 " Reva Forth au BufNewFile,BufRead *.frt setf reva " Fortran if has("fname_case") au BufNewFile,BufRead *.F,*.FOR,*.FPP,*.FTN,*.F77,*.F90,*.F95,*.F03,*.F08 setf fortran endif au BufNewFile,BufRead *.f,*.for,*.fortran,*.fpp,*.ftn,*.f77,*.f90,*.f95,*.f03,*.f08 setf fortran " Framescript au BufNewFile,BufRead *.fsl setf framescript " FStab au BufNewFile,BufRead fstab,mtab setf fstab " GDB command files au BufNewFile,BufRead .gdbinit setf gdb " GDMO au BufNewFile,BufRead *.mo,*.gdmo setf gdmo " Gedcom au BufNewFile,BufRead *.ged,lltxxxxx.txt setf gedcom " Git au BufNewFile,BufRead COMMIT_EDITMSG setf gitcommit au BufNewFile,BufRead MERGE_MSG setf gitcommit au BufNewFile,BufRead *.git/config,.gitconfig,.gitmodules setf gitconfig au BufNewFile,BufRead *.git/modules/*/config setf gitconfig au BufNewFile,BufRead */.config/git/config setf gitconfig if !empty($XDG_CONFIG_HOME) au BufNewFile,BufRead $XDG_CONFIG_HOME/git/config setf gitconfig endif au BufNewFile,BufRead git-rebase-todo setf gitrebase au BufNewFile,BufRead .msg.[0-9]* \ if getline(1) =~ '^From.*# This line is ignored.$' | \ setf gitsendemail | \ endif au BufNewFile,BufRead *.git/* \ if getline(1) =~ '^\x\{40\}\>\|^ref: ' | \ setf git | \ endif " Gkrellmrc au BufNewFile,BufRead gkrellmrc,gkrellmrc_? setf gkrellmrc " GP scripts (2.0 and onward) au BufNewFile,BufRead *.gp,.gprc 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 " gnash(1) configuration files au BufNewFile,BufRead gnashrc,.gnashrc,gnashpluginrc,.gnashpluginrc setf gnash " Gitolite au BufNewFile,BufRead gitolite.conf setf gitolite au BufNewFile,BufRead */gitolite-admin/conf/* call s:StarSetf('gitolite') au BufNewFile,BufRead {,.}gitolite.rc,example.gitolite.rc setf perl " Gnuplot scripts au BufNewFile,BufRead *.gpi setf gnuplot " Go (Google) au BufNewFile,BufRead *.go setf go " GrADS scripts au BufNewFile,BufRead *.gs setf grads " Gretl au BufNewFile,BufRead *.gretl setf gretl " Groovy au BufNewFile,BufRead *.gradle,*.groovy setf groovy " GNU Server Pages au BufNewFile,BufRead *.gsp setf gsp " Group file au BufNewFile,BufRead */etc/group,*/etc/group-,*/etc/group.edit,*/etc/gshadow,*/etc/gshadow-,*/etc/gshadow.edit,*/var/backups/group.bak,*/var/backups/gshadow.bak setf group " GTK RC au BufNewFile,BufRead .gtkrc,gtkrc setf gtkrc " Haml au BufNewFile,BufRead *.haml setf haml " Hamster Classic | Playground files au BufNewFile,BufRead *.hsc,*.hsm setf hamster " Haskell au BufNewFile,BufRead *.hs,*.hs-boot setf haskell au BufNewFile,BufRead *.lhs setf lhaskell au BufNewFile,BufRead *.chs setf chaskell " Haste au BufNewFile,BufRead *.ht setf haste au BufNewFile,BufRead *.htpp setf hastepreproc " 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 s:FThtml() " Distinguish between HTML, XHTML and Django func! s:FThtml() let n = 1 while n < 10 && n < line("$") if getline(n) =~ '\\|{#\s\+' setf htmldjango return endif let n = n + 1 endwhile setf html endfunc " HTML with Ruby - eRuby au BufNewFile,BufRead *.erb,*.rhtml setf eruby " HTML with M4 au BufNewFile,BufRead *.html.m4 setf htmlm4 " HTML Cheetah template au BufNewFile,BufRead *.tmpl setf htmlcheetah " Host config au BufNewFile,BufRead */etc/host.conf setf hostconf " Hosts access au BufNewFile,BufRead */etc/hosts.allow,*/etc/hosts.deny setf hostsaccess " Hyper Builder au BufNewFile,BufRead *.hb setf hb " Httest au BufNewFile,BufRead *.htt,*.htb setf httest " Icon au BufNewFile,BufRead *.icn setf icon " IDL (Interface Description Language) au BufNewFile,BufRead *.idl call s:FTidl() " Distinguish between standard IDL and MS-IDL func! s:FTidl() 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 endfunc " 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 " Indent profile (must come before IDL *.pro!) au BufNewFile,BufRead .indent.pro setf indent au BufNewFile,BufRead indent.pro call s:ProtoCheck('indent') " IDL (Interactive Data Language) au BufNewFile,BufRead *.pro call s:ProtoCheck('idlang') " Distinguish between "default" and Cproto prototype file. */ func! s:ProtoCheck(default) " Cproto files have a comment in the first line and a function prototype in " the second line, it always ends in ";". Indent files may also have " comments, thus we can't match comments to see the difference. " IDL files can have a single ';' in the second line, require at least one " chacter before the ';'. if getline(2) =~ '.;$' setf cpp else exe 'setf ' . a:default endif endfunc " Indent RC au BufNewFile,BufRead indentrc setf indent " Inform au BufNewFile,BufRead *.inf,*.INF setf inform " Initng au BufNewFile,BufRead */etc/initng/*/*.i,*.ii setf initng " Innovation Data Processing au BufRead,BufNewFile upstream.dat\c,upstream.*.dat\c,*.upstream.dat\c setf upstreamdat au BufRead,BufNewFile upstream.log\c,upstream.*.log\c,*.upstream.log\c setf upstreamlog au BufRead,BufNewFile upstreaminstall.log\c,upstreaminstall.*.log\c,*.upstreaminstall.log\c setf upstreaminstalllog au BufRead,BufNewFile usserver.log\c,usserver.*.log\c,*.usserver.log\c setf usserverlog au BufRead,BufNewFile usw2kagt.log\c,usw2kagt.*.log\c,*.usw2kagt.log\c setf usw2kagtlog " Ipfilter au BufNewFile,BufRead ipf.conf,ipf6.conf,ipf.rules setf ipfilter " 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 " J au BufNewFile,BufRead *.ijs setf j " 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, ECMAScript au BufNewFile,BufRead *.js,*.javascript,*.es,*.jsx 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_??_?? setf jproperties au BufNewFile,BufRead *.properties_??_??_* call s:StarSetf('jproperties') " Jess au BufNewFile,BufRead *.clp setf jess " Jgraph au BufNewFile,BufRead *.jgr setf jgraph " Jovial au BufNewFile,BufRead *.jov,*.j73,*.jovial setf jovial " JSON au BufNewFile,BufRead *.json,*.jsonp setf json " Kixtart au BufNewFile,BufRead *.kix setf kix " Kimwitu[++] au BufNewFile,BufRead *.k setf kwt " Kivy au BufNewFile,BufRead *.kv setf kivy " KDE script au BufNewFile,BufRead *.ks setf kscript " Kconfig au BufNewFile,BufRead Kconfig,Kconfig.debug setf kconfig " Lace (ISE) au BufNewFile,BufRead *.ace,*.ACE setf lace " Latte au BufNewFile,BufRead *.latte,*.lte setf latte " Limits au BufNewFile,BufRead */etc/limits,*/etc/*limits.conf,*/etc/*limits.d/*.conf setf limits " LambdaProlog (*.mod too, see Modsim) au BufNewFile,BufRead *.sig setf lprolog " LDAP LDIF au BufNewFile,BufRead *.ldif setf ldif " Ld loader au BufNewFile,BufRead *.ld setf ld " Less au BufNewFile,BufRead *.less setf less " Lex au BufNewFile,BufRead *.lex,*.l,*.lxx,*.l++ setf lex " Libao au BufNewFile,BufRead */etc/libao.conf,*/.libao setf libao " Libsensors au BufNewFile,BufRead */etc/sensors.conf,*/etc/sensors3.conf setf sensors " 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 " SBCL implementation of Common Lisp au BufNewFile,BufRead sbclrc,.sbclrc setf lisp " Liquid au BufNewFile,BufRead *.liquid setf liquid " Lite au BufNewFile,BufRead *.lite,*.lt setf lite " LiteStep RC files au BufNewFile,BufRead */LiteStep/*/*.rc setf litestep " Login access au BufNewFile,BufRead */etc/login.access setf loginaccess " Login defs au BufNewFile,BufRead */etc/login.defs setf logindefs " 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 " Luarocks au BufNewFile,BufRead *.rockspec setf lua " Linden Scripting Language (Second Life) au BufNewFile,BufRead *.lsl setf lsl " Lynx style file (or LotusScript!) au BufNewFile,BufRead *.lss setf lss " M4 au BufNewFile,BufRead *.m4 \ if expand("") !~? 'html.m4$\|fvwm2rc' | setf m4 | endif " MaGic Point au BufNewFile,BufRead *.mgp setf mgp " Mail (for Elm, trn, mutt, muttng, rn, slrn) au BufNewFile,BufRead snd.\d\+,.letter,.letter.\d\+,.followup,.article,.article.\d\+,pico.\d\+,mutt{ng,}-*-\w\+,mutt[[:alnum:]_-]\\\{6\},ae\d\+.txt,/tmp/SLRN[0-9A-Z.]\+,*.eml setf mail " Mail aliases au BufNewFile,BufRead */etc/mail/aliases,*/etc/aliases setf mailaliases " 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 " Mallard au BufNewFile,BufRead *.page setf mallard " Manpage au BufNewFile,BufRead *.man setf man " Man config au BufNewFile,BufRead */etc/man.conf,man.config setf manconf " Maple V au BufNewFile,BufRead *.mv,*.mpl,*.mws setf maple " Map (UMN mapserver config file) au BufNewFile,BufRead *.map setf map " Markdown au BufNewFile,BufRead *.markdown,*.mdown,*.mkd,*.mkdn,*.mdwn,*.md setf markdown " Mason au BufNewFile,BufRead *.mason,*.mhtml,*.comp setf mason " Matlab or Objective C au BufNewFile,BufRead *.m call s:FTm() func! s:FTm() let n = 1 while n < 10 let line = getline(n) if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|/\*\|//\)' setf objc return endif if line =~ '^\s*%' setf matlab return endif if line =~ '^\s*(\*' setf mma return endif let n = n + 1 endwhile if exists("g:filetype_m") exe "setf " . g:filetype_m else setf matlab endif endfunc " Mathematica notebook au BufNewFile,BufRead *.nb setf mma " Maya Extension Language au BufNewFile,BufRead *.mel setf mel " Mercurial (hg) commit file au BufNewFile,BufRead hg-editor-*.txt setf hgcommit " Mercurial config (looks like generic config file) au BufNewFile,BufRead *.hgrc,*hgrc setf cfg " Messages (logs mostly) au BufNewFile,BufRead */log/{auth,cron,daemon,debug,kern,lpr,mail,messages,news/news,syslog,user}{,.log,.err,.info,.warn,.crit,.notice}{,.[0-9]*,-[0-9]*} setf messages " Metafont au BufNewFile,BufRead *.mf setf mf " MetaPost au BufNewFile,BufRead *.mp setf mp " MGL au BufNewFile,BufRead *.mgl setf mgl " MIX - Knuth assembly au BufNewFile,BufRead *.mix,*.mixal setf mix " MMIX or VMS makefile au BufNewFile,BufRead *.mms call s:FTmms() " Symbian meta-makefile definition (MMP) au BufNewFile,BufRead *.mmp setf mmp func! s:FTmms() 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 endfunc " Modsim III (or LambdaProlog) au BufNewFile,BufRead *.mod \ if getline(1) =~ '\' | \ setf lprolog | \ else | \ setf modsim3 | \ endif " Modula 2 (.md removed in favor of Markdown) au BufNewFile,BufRead *.m2,*.DEF,*.MOD,*.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/modules,*/etc/conf.modules setf modconf " Mplayer config au BufNewFile,BufRead mplayer.conf,*/.mplayer/config setf mplayerconf " Motorola S record au BufNewFile,BufRead *.s19,*.s28,*.s37,*.mot,*.srec setf srec " Mrxvtrc au BufNewFile,BufRead mrxvtrc,.mrxvtrc setf mrxvtrc " Msql au BufNewFile,BufRead *.msql setf msql " Mysql au BufNewFile,BufRead *.mysql setf mysql " Mutt setup files (must be before catch *.rc) au BufNewFile,BufRead */etc/Muttrc.d/* call s:StarSetf('muttrc') " M$ Resource files au BufNewFile,BufRead *.rc,*.rch setf rc " MuPAD source au BufRead,BufNewFile *.mu setf mupad " Mush au BufNewFile,BufRead *.mush setf mush " Mutt setup file (also for Muttng) au BufNewFile,BufRead Mutt{ng,}rc setf muttrc " Nano au BufNewFile,BufRead */etc/nanorc,*.nanorc setf nanorc " Nastran input/DMAP "au BufNewFile,BufRead *.dat setf nastran " Natural au BufNewFile,BufRead *.NS[ACGLMNPS] setf natural " Netrc au BufNewFile,BufRead .netrc setf netrc " Ninja file au BufNewFile,BufRead *.ninja setf ninja " Novell netware batch files au BufNewFile,BufRead *.ncf setf ncf " Nroff/Troff (*.ms and *.t are checked below) au BufNewFile,BufRead *.me \ if expand("") != "read.me" && expand("") != "click.me" | \ setf nroff | \ endif au BufNewFile,BufRead *.tr,*.nr,*.roff,*.tmac,*.mom setf nroff au BufNewFile,BufRead *.[1-9] call s: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. func! s:FTnroff() if getline(1)[0] . getline(2)[0] . getline(3)[0] . getline(4)[0] . getline(5)[0] =~ '\.' setf nroff return 1 endif return 0 endfunc " Nroff or Objective C++ au BufNewFile,BufRead *.mm call s:FTmm() func! s:FTmm() let n = 1 while n < 10 let line = getline(n) if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|/\*\)' setf objcpp return endif let n = n + 1 endwhile setf nroff endfunc " Not Quite C au BufNewFile,BufRead *.nqc setf nqc " NSIS au BufNewFile,BufRead *.nsi,*.nsh setf nsis " OCAML au BufNewFile,BufRead *.ml,*.mli,*.mll,*.mly,.ocamlinit 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 " Pam conf au BufNewFile,BufRead */etc/pam.conf setf pamconf " PApp au BufNewFile,BufRead *.papp,*.pxml,*.pxsl setf papp " Password file au BufNewFile,BufRead */etc/passwd,*/etc/passwd-,*/etc/passwd.edit,*/etc/shadow,*/etc/shadow-,*/etc/shadow.edit,*/var/backups/passwd.bak,*/var/backups/shadow.bak setf passwd " Pascal (also *.p) au BufNewFile,BufRead *.pas setf pascal " Delphi project file au BufNewFile,BufRead *.dpr setf pascal " PDF au BufNewFile,BufRead *.pdf setf pdf " Perl if has("fname_case") au BufNewFile,BufRead *.pl,*.PL call s:FTpl() else au BufNewFile,BufRead *.pl call s:FTpl() endif au BufNewFile,BufRead *.plx,*.al setf perl au BufNewFile,BufRead *.p6,*.pm6,*.pl6 setf perl6 func! s:FTpl() 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 =~ '\' || l =~ '^\s*\(%\+\(\s\|$\)\|/\*\)' || l =~ ':-' setf prolog else setf perl endif endif endfunc " 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 au BufNewFile,BufRead *.pod6 setf pod6 " Php, php3, php4, etc. " Also Phtml (was used for PHP 2 in the past) " Also .ctp for Cake template file au BufNewFile,BufRead *.php,*.php\d,*.phtml,*.ctp setf php " 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/1, PL/I au BufNewFile,BufRead *.pli,*.pl1 setf pli " 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 s:FTinc() func! s:FTinc() 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 =~ "' \ || 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 endfunc " 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 " Promela au BufNewFile,BufRead *.pml setf promela " Google protocol buffers au BufNewFile,BufRead *.proto setf proto " Protocols au BufNewFile,BufRead */etc/protocols setf protocols " Pyrex au BufNewFile,BufRead *.pyx,*.pxd setf pyrex " Python au BufNewFile,BufRead *.py,*.pyw setf python " Quixote (Python-based web framework) au BufNewFile,BufRead *.ptl 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,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 *.rex,*.orx,*.rxo,*.rxj,*.jrexx,*.rexxj,*.rexx,*.testGroup,*.testUnit setf rexx " R (Splus) if has("fname_case") au BufNewFile,BufRead *.s,*.S setf r else au BufNewFile,BufRead *.s setf r endif " R Help file if has("fname_case") au BufNewFile,BufRead *.rd,*.Rd setf rhelp else au BufNewFile,BufRead *.rd setf rhelp endif " R noweb file if has("fname_case") au BufNewFile,BufRead *.Rnw,*.rnw,*.Snw,*.snw setf rnoweb else au BufNewFile,BufRead *.rnw,*.snw setf rnoweb endif " R Markdown file if has("fname_case") au BufNewFile,BufRead *.Rmd,*.rmd,*.Smd,*.smd setf rmd else au BufNewFile,BufRead *.rmd,*.smd setf rmd endif " R reStructuredText file if has("fname_case") au BufNewFile,BufRead *.Rrst,*.rrst,*.Srst,*.srst setf rrst else au BufNewFile,BufRead *.rrst,*.srst setf rrst endif " Rexx, Rebol or R au BufNewFile,BufRead *.r,*.R call s:FTr() func! s:FTr() let max = line("$") > 50 ? 50 : line("$") for n in range(1, max) " Rebol is easy to recognize, check for that first if getline(n) =~? '\' setf rebol return endif endfor for n in range(1, max) " R has # comments if getline(n) =~ '^\s*#' setf r return endif " Rexx has /* comments */ if getline(n) =~ '^\s*/\*' setf rexx return endif endfor " Nothing recognized, use user default or assume Rexx if exists("g:filetype_r") exe "setf " . g:filetype_r else " Rexx used to be the default, but R appears to be much more popular. setf r endif endfunc " Remind au BufNewFile,BufRead .reminders,*.remind,*.rem setf remind " Resolv.conf au BufNewFile,BufRead resolv.conf setf resolv " Relax NG Compact au BufNewFile,BufRead *.rnc setf rnc " Relax NG XML au BufNewFile,BufRead *.rng setf rng " 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 " Interactive Ruby shell au BufNewFile,BufRead .irbrc,irbrc setf ruby " Ruby au BufNewFile,BufRead *.rb,*.rbw setf ruby " RubyGems au BufNewFile,BufRead *.gemspec setf ruby " Rackup au BufNewFile,BufRead *.ru setf ruby " Bundler au BufNewFile,BufRead Gemfile setf ruby " Ruby on Rails au BufNewFile,BufRead *.builder,*.rxml,*.rjs setf ruby " Rantfile and Rakefile is like Ruby au BufNewFile,BufRead [rR]antfile,*.rant,[rR]akefile,*.rake setf ruby " S-lang (or shader language, or SmallLisp) au BufNewFile,BufRead *.sl setf slang " Samba config au BufNewFile,BufRead smb.conf setf samba " SAS script au BufNewFile,BufRead *.sas setf sas " Sass au BufNewFile,BufRead *.sass setf sass " Sather au BufNewFile,BufRead *.sa setf sather " Scilab au BufNewFile,BufRead *.sci,*.sce setf scilab " SCSS au BufNewFile,BufRead *.scss setf scss " SD: Streaming Descriptors au BufNewFile,BufRead *.sd setf sd " SDL au BufNewFile,BufRead *.sdl,*.pr setf sdl " sed au BufNewFile,BufRead *.sed setf sed " Sieve (RFC 3028) au BufNewFile,BufRead *.siv setf sieve " Sendmail au BufNewFile,BufRead sendmail.cf setf sm " Sendmail .mc files are actually m4. Could also be MS Message text file. au BufNewFile,BufRead *.mc call s:McSetf() func! s:McSetf() " Rely on the file to start with a comment. " MS message text files use ';', Sendmail files use '#' or 'dnl' for lnum in range(1, min([line("$"), 20])) let line = getline(lnum) if line =~ '^\s*\(#\|dnl\)' setf m4 " Sendmail .mc file return elseif line =~ '^\s*;' setf msmessages " MS Message text file return endif endfor setf m4 " Default: Sendmail .mc file endfunc " Services au BufNewFile,BufRead */etc/services setf services " Service Location config au BufNewFile,BufRead */etc/slp.conf setf slpconf " Service Location registration au BufNewFile,BufRead */etc/slp.reg setf slpreg " Service Location SPI au BufNewFile,BufRead */etc/slp.spi setf slpspi " Setserial config au BufNewFile,BufRead */etc/serial.conf setf setserial " SGML au BufNewFile,BufRead *.sgm,*.sgml \ if getline(1).getline(2).getline(3).getline(4).getline(5) =~? 'linuxdoc' | \ setf sgmllnx | \ elseif getline(1) =~ '") =~ g:ft_ignore_pat return endif if a:name =~ '\' " Some .sh scripts contain #!/bin/csh. call SetFileTypeShell("csh") return elseif a:name =~ '\' " Some .sh scripts contain #!/bin/tcsh. call SetFileTypeShell("tcsh") return elseif a:name =~ '\' " Some .sh scripts contain #!/bin/zsh. call SetFileTypeShell("zsh") return elseif a:name =~ '\' 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 =~ '\' || a:name =~ '\' 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 =~ '\' 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 call SetFileTypeShell("sh") endfunc " For shell-like file types, check for an "exec" command hidden in a comment, " as used for Tcl. " Also called from scripts.vim, thus can't be local to this script. func! SetFileTypeShell(name) if expand("") =~ g:ft_ignore_pat return endif let l = 2 while l < 20 && l < line("$") && getline(l) =~ '^\s*\(#\|$\)' " Skip empty and comment lines. let l = l + 1 endwhile if l < line("$") && getline(l) =~ '\s*exec\s' && getline(l - 1) =~ '^\s*#.*\\$' " Found an "exec" line after a comment with continuation let n = substitute(getline(l),'\s*exec\s\+\([^ ]*/\)\=', '', '') if n =~ '\' | \ setf xml | \ else | \ setf smil | \ endif " SMIL or SNMP MIB file au BufNewFile,BufRead *.smi \ if getline(1) =~ '\' | \ setf smil | \ else | \ setf mib | \ endif " SMITH au BufNewFile,BufRead *.smt,*.smith setf smith " Snobol4 and spitbol au BufNewFile,BufRead *.sno,*.spt setf snobol4 " SNMP MIB files au BufNewFile,BufRead *.mib,*.my setf mib " Snort Configuration au BufNewFile,BufRead *.hog,snort.conf,vision.conf setf hog au BufNewFile,BufRead *.rules call s:FTRules() let s:ft_rules_udev_rules_pattern = '^\s*\cudev_rules\s*=\s*"\([^"]\{-1,}\)/*".*' func! s:FTRules() let path = expand(':p') if path =~ '^/\(etc/udev/\%(rules\.d/\)\=.*\.rules\|lib/udev/\%(rules\.d/\)\=.*\.rules\)$' setf udevrules return endif if path =~ '^/etc/ufw/' setf conf " Better than hog return endif if path =~ '^/\(etc\|usr/share\)/polkit-1/rules\.d' setf javascript return endif try let config_lines = readfile('/etc/udev/udev.conf') catch /^Vim\%((\a\+)\)\=:E484/ setf hog return endtry let dir = expand(':p:h') for line in config_lines if line =~ s:ft_rules_udev_rules_pattern let udev_rules = substitute(line, s:ft_rules_udev_rules_pattern, '\1', "") if dir == udev_rules setf udevrules endif break endif endfor setf hog endfunc " 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 for Oracle Designer au BufNewFile,BufRead *.tyb,*.typ,*.tyc,*.pkb,*.pks setf sql " SQL au BufNewFile,BufRead *.sql call s:SQL() func! s:SQL() if exists("g:filetype_sql") exe "setf " . g:filetype_sql else setf sql endif endfunc " 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 " Stata au BufNewFile,BufRead *.ado,*.class,*.do,*.imata,*.mata setf stata " SMCL au BufNewFile,BufRead *.hlp,*.ihlp,*.smcl setf smcl " Stored Procedures au BufNewFile,BufRead *.stp setf stp " Standard ML au BufNewFile,BufRead *.sml setf sml " Sratus VOS command macro au BufNewFile,BufRead *.cm setf voscm " Sysctl au BufNewFile,BufRead */etc/sysctl.conf,*/etc/sysctl.d/*.conf setf sysctl " Systemd unit files au BufNewFile,BufRead */systemd/*.{automount,mount,path,service,socket,swap,target,timer} setf systemd " Synopsys Design Constraints au BufNewFile,BufRead *.sdc setf sdc " Sudoers au BufNewFile,BufRead */etc/sudoers,sudoers.tmp setf sudoers " SVG (Scalable Vector Graphics) au BufNewFile,BufRead *.svg setf svg " If the file has an extension of 't' and is in a directory 't' or 'xt' then " it is almost certainly a Perl test file. " If the first line starts with '#' and contains 'perl' it's probably a Perl " file. " (Slow test) If a file contains a 'use' statement then it is almost certainly " a Perl file. func! s:FTperl() let dirname = expand("%:p:h:t") if expand("%:e") == 't' && (dirname == 't' || dirname == 'xt') setf perl return 1 endif if getline(1)[0] == '#' && getline(1) =~ 'perl' setf perl return 1 endif if search('^use\s\s*\k', 'nc', 30) setf perl return 1 endif return 0 endfunc " Tads (or Nroff or Perl test file) au BufNewFile,BufRead *.t \ if !s:FTnroff() && !s:FTperl() | setf tads | endif " Tags au BufNewFile,BufRead tags setf tags " TAK au BufNewFile,BufRead *.tak setf tak " Task au BufRead,BufNewFile {pending,completed,undo}.data setf taskdata au BufRead,BufNewFile *.task setf taskedit " Tcl (JACL too) au BufNewFile,BufRead *.tcl,*.tk,*.itcl,*.itk,*.jacl setf tcl " TealInfo au BufNewFile,BufRead *.tli setf tli " Telix Salt au BufNewFile,BufRead *.slt setf tsalt " Tera Term Language au BufRead,BufNewFile *.ttl setf teraterm " Terminfo au BufNewFile,BufRead *.ti setf terminfo " TeX au BufNewFile,BufRead *.latex,*.sty,*.dtx,*.ltx,*.bbl setf tex au BufNewFile,BufRead *.tex call s:FTtex() " Choose context, plaintex, or tex (LaTeX) based on these rules: " 1. Check the first line of the file for "%&". " 2. Check the first 1000 non-comment lines for LaTeX or ConTeXt keywords. " 3. Default to "latex" or to g:tex_flavor, can be set in user's vimrc. func! s:FTtex() let firstline = getline(1) if firstline =~ '^%&\s*\a\+' let format = tolower(matchstr(firstline, '\a\+')) let format = substitute(format, 'pdf', '', '') if format == 'tex' let format = 'plain' endif else " Default value, may be changed later: let format = exists("g:tex_flavor") ? g:tex_flavor : 'plain' " Save position, go to the top of the file, find first non-comment line. let save_cursor = getpos('.') call cursor(1,1) let firstNC = search('^\s*[^[:space:]%]', 'c', 1000) if firstNC " Check the next thousand lines for a LaTeX or ConTeXt keyword. let lpat = 'documentclass\>\|usepackage\>\|begin{\|newcommand\>\|renewcommand\>' let cpat = 'start\a\+\|setup\a\+\|usemodule\|enablemode\|enableregime\|setvariables\|useencoding\|usesymbols\|stelle\a\+\|verwende\a\+\|stel\a\+\|gebruik\a\+\|usa\a\+\|imposta\a\+\|regle\a\+\|utilisemodule\>' let kwline = search('^\s*\\\%(' . lpat . '\)\|^\s*\\\(' . cpat . '\)', \ 'cnp', firstNC + 1000) if kwline == 1 " lpat matched let format = 'latex' elseif kwline == 2 " cpat matched let format = 'context' endif " If neither matched, keep default set above. " let lline = search('^\s*\\\%(' . lpat . '\)', 'cn', firstNC + 1000) " let cline = search('^\s*\\\%(' . cpat . '\)', 'cn', firstNC + 1000) " if cline > 0 " let format = 'context' " endif " if lline > 0 && (cline == 0 || cline > lline) " let format = 'tex' " endif endif " firstNC call setpos('.', save_cursor) endif " firstline =~ '^%&\s*\a\+' " Translation from formats to file types. TODO: add AMSTeX, RevTex, others? if format == 'plain' setf plaintex elseif format == 'context' setf context else " probably LaTeX setf tex endif return endfunc " ConTeXt au BufNewFile,BufRead tex/context/*/*.tex,*.mkii,*.mkiv setf context " 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 " TPP - Text Presentation Program au BufNewFile,BufReadPost *.tpp setf tpp " Treetop au BufRead,BufNewFile *.treetop setf treetop " Trustees au BufNewFile,BufRead trustees.conf setf trustees " 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 " TWIG files au BufNewFile,BufReadPost *.twig setf twig " Motif UIT/UIL files au BufNewFile,BufRead *.uit,*.uil setf uil " Udev conf au BufNewFile,BufRead */etc/udev/udev.conf setf udevconf " Udev permissions au BufNewFile,BufRead */etc/udev/permissions.d/*.permissions setf udevperm " " Udev symlinks config au BufNewFile,BufRead */etc/udev/cdsymlinks.conf setf sh " UnrealScript au BufNewFile,BufRead *.uc setf uc " Updatedb au BufNewFile,BufRead */etc/updatedb.conf setf updatedb " Upstart (init(8)) config files au BufNewFile,BufRead */usr/share/upstart/*.conf setf upstart au BufNewFile,BufRead */usr/share/upstart/*.override setf upstart au BufNewFile,BufRead */etc/init/*.conf,*/etc/init/*.override setf upstart au BufNewFile,BufRead */.init/*.conf,*/.init/*.override setf upstart au BufNewFile,BufRead */.config/upstart/*.conf setf upstart au BufNewFile,BufRead */.config/upstart/*.override setf upstart " Vera au BufNewFile,BufRead *.vr,*.vri,*.vrh setf vera " Verilog HDL au BufNewFile,BufRead *.v setf verilog " Verilog-AMS HDL au BufNewFile,BufRead *.va,*.vams setf verilogams " SystemVerilog au BufNewFile,BufRead *.sv,*.svh setf systemverilog " VHDL au BufNewFile,BufRead *.hdl,*.vhd,*.vhdl,*.vbe,*.vst setf vhdl au BufNewFile,BufRead *.vhdl_[0-9]* call s:StarSetf('vhdl') " Vim script au BufNewFile,BufRead *.vim,*.vba,.exrc,_exrc setf vim " Viminfo file au BufNewFile,BufRead .viminfo,_viminfo setf viminfo " Virata Config Script File or Drupal module au BufRead,BufNewFile *.hw,*.module,*.pkg \ if getline(1) =~ '' | \ let b:xf86conf_xfree86_version = 3 | \ endif | \ setf xf86conf au BufNewFile,BufRead */xorg.conf.d/*.conf \ let b:xf86conf_xfree86_version = 4 | \ setf xf86conf " Xorg config au BufNewFile,BufRead xorg.conf,xorg.conf-4 let b:xf86conf_xfree86_version = 4 | setf xf86conf " Xinetd conf au BufNewFile,BufRead */etc/xinetd.conf setf xinetd " 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 !s:FTnroff() | setf xmath | endif " XML specific variants: docbk and xbl au BufNewFile,BufRead *.xml call s:FTxml() func! s:FTxml() let n = 1 while n < 100 && n < line("$") let line = getline(n) " DocBook 4 or DocBook 5. let is_docbook4 = line =~ '\)' && getline(n) !~ '^\s*#\s*include' setf racc return endif let n = n + 1 endwhile setf yacc endfunc " Yaml au BufNewFile,BufRead *.yaml,*.yml setf yaml " yum conf (close enough to dosini) au BufNewFile,BufRead */etc/yum.conf setf dosini " Zimbu au BufNewFile,BufRead *.zu setf zimbu " Zimbu Templates au BufNewFile,BufRead *.zut setf zimbutempl " Zope " dtml (zope dynamic template markup language), pt (zope page template), " cpt (zope form controller page template) au BufNewFile,BufRead *.dtml,*.pt,*.cpt call s:FThtml() " zsql (zope sql method) au BufNewFile,BufRead *.zsql call s:SQL() " 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") && filereadable(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("") !~ 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. " Most of these should call s:StarSetf() to avoid names ending in .gz and the " like are used. " More Apache config files au BufNewFile,BufRead access.conf*,apache.conf*,apache2.conf*,httpd.conf*,srm.conf* call s:StarSetf('apache') au BufNewFile,BufRead */etc/apache2/*.conf*,*/etc/apache2/conf.*/*,*/etc/apache2/mods-*/*,*/etc/apache2/sites-*/*,*/etc/httpd/conf.d/*.conf* call s:StarSetf('apache') " Asterisk config file au BufNewFile,BufRead *asterisk/*.conf* call s:StarSetf('asterisk') au BufNewFile,BufRead *asterisk*/*voicemail.conf* call s:StarSetf('asteriskvm') " Bazaar version control au BufNewFile,BufRead bzr_log.* setf bzr " BIND zone au BufNewFile,BufRead */named/db.*,*/bind/db.* call s:StarSetf('bindzone') " Calendar au BufNewFile,BufRead */.calendar/*, \*/share/calendar/*/calendar.*,*/share/calendar/calendar.* \ call s:StarSetf('calendar') " Changelog au BufNewFile,BufRead [cC]hange[lL]og* \ if getline(1) =~ '; urgency=' \| call s:StarSetf('debchangelog') \|else \| call s:StarSetf('changelog') \|endif " Crontab au BufNewFile,BufRead crontab,crontab.*,*/etc/cron.d/* call s:StarSetf('crontab') " dnsmasq(8) configuration au BufNewFile,BufRead */etc/dnsmasq.d/* call s:StarSetf('dnsmasq') " Dracula au BufNewFile,BufRead drac.* call s:StarSetf('dracula') " Fvwm au BufNewFile,BufRead */.fvwm/* call s:StarSetf('fvwm') au BufNewFile,BufRead *fvwmrc*,*fvwm95*.hook \ let b:fvwm_version = 1 | call s:StarSetf('fvwm') au BufNewFile,BufRead *fvwm2rc* \ if expand(":e") == "m4" \| call s:StarSetf('fvwm2m4') \|else \| let b:fvwm_version = 2 | call s:StarSetf('fvwm') \|endif " Gedcom au BufNewFile,BufRead */tmp/lltmp* call s:StarSetf('gedcom') " GTK RC au BufNewFile,BufRead .gtkrc*,gtkrc* call s:StarSetf('gtkrc') " Jam au BufNewFile,BufRead Prl*.*,JAM*.* call s:StarSetf('jam') " Jargon au! BufNewFile,BufRead *jarg* \ if getline(1).getline(2).getline(3).getline(4).getline(5) =~? 'THIS IS THE JARGON FILE' \| call s:StarSetf('jargon') \|endif " Kconfig au BufNewFile,BufRead Kconfig.* call s:StarSetf('kconfig') " Lilo: Linux loader au BufNewFile,BufRead lilo.conf* call s:StarSetf('lilo') " Logcheck au BufNewFile,BufRead */etc/logcheck/*.d*/* call s:StarSetf('logcheck') " Makefile au BufNewFile,BufRead [mM]akefile* call s:StarSetf('make') " Ruby Makefile au BufNewFile,BufRead [rR]akefile* call s:StarSetf('ruby') " Mail (also matches muttrc.vim, so this is below the other checks) au BufNewFile,BufRead mutt[[:alnum:]._-]\\\{6\} setf mail " Modconf au BufNewFile,BufRead */etc/modutils/* \ if executable(expand("")) != 1 \| call s:StarSetf('modconf') \|endif au BufNewFile,BufRead */etc/modprobe.* call s:StarSetf('modconf') " Mutt setup file au BufNewFile,BufRead .mutt{ng,}rc*,*/.mutt{ng,}/mutt{ng,}rc* call s:StarSetf('muttrc') au BufNewFile,BufRead mutt{ng,}rc*,Mutt{ng,}rc* call s:StarSetf('muttrc') " Nroff macros au BufNewFile,BufRead tmac.* call s:StarSetf('nroff') " Pam conf au BufNewFile,BufRead */etc/pam.d/* call s:StarSetf('pamconf') " Printcap and Termcap au BufNewFile,BufRead *printcap* \ if !did_filetype() \| let b:ptcap_type = "print" | call s:StarSetf('ptcap') \|endif au BufNewFile,BufRead *termcap* \ if !did_filetype() \| let b:ptcap_type = "term" | call s:StarSetf('ptcap') \|endif " ReDIF " Only used when the .rdf file was not detected to be XML. au BufRead,BufNewFile *.rdf call s:Redif() func! s:Redif() let lnum = 1 while lnum <= 5 && lnum < line('$') if getline(lnum) =~ "^\ctemplate-type:" setf redif return endif let lnum = lnum + 1 endwhile endfunc " Remind au BufNewFile,BufRead .reminders* call s:StarSetf('remind') " Vim script au BufNewFile,BufRead *vimrc* call s:StarSetf('vim') " Subversion commit file au BufNewFile,BufRead svn-commit*.tmp setf svn " X resources file au BufNewFile,BufRead Xresources*,*/app-defaults/*,*/Xresources/* call s:StarSetf('xdefaults') " XFree86 config au BufNewFile,BufRead XF86Config-4* \ let b:xf86conf_xfree86_version = 4 | call s:StarSetf('xf86conf') au BufNewFile,BufRead XF86Config* \ if getline(1) =~ '\' \| let b:xf86conf_xfree86_version = 3 \|endif \|call s:StarSetf('xf86conf') " X11 xmodmap au BufNewFile,BufRead *xmodmap* call s:StarSetf('xmodmap') " Xinetd conf au BufNewFile,BufRead */etc/xinetd.d/* call s:StarSetf('xinetd') " yum conf (close enough to dosini) au BufNewFile,BufRead */etc/yum.repos.d/* call s:StarSetf('dosini') " Z-Shell script au BufNewFile,BufRead zsh*,zlog* call s:StarSetf('zsh') " Plain text files, needs to be far down to not override others. This avoids " the "conf" type being used if there is a line starting with '#'. au BufNewFile,BufRead *.txt,*.text,README setf text " Use the filetype detect plugins. They may overrule any of the previously " detected filetypes. runtime! ftdetect/*.vim " NOTE: The above command could have ended the filetypedetect autocmd group " and started another one. Let's make sure it has ended to get to a consistent " state. augroup END " Generic configuration file (check this last, it's just guessing!) au filetypedetect BufNewFile,BufRead,StdinReadPost * \ if !did_filetype() && expand("") !~ g:ft_ignore_pat \ && (getline(1) =~ '^#' || getline(2) =~ '^#' || getline(3) =~ '^#' \ || getline(4) =~ '^#' || getline(5) =~ '^#') | \ setf conf | \ endif " 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 :p:h/menu.vim endif " Function called for testing all functions defined here. These are " script-local, thus need to be executed here. " Returns a string with error messages (hopefully empty). func! TestFiletypeFuncs(testlist) let output = '' for f in a:testlist try exe f catch let output = output . "\n" . f . ": " . v:exception endtry endfor return output endfunc " Restore 'cpoptions' let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftoff.vim000066400000000000000000000004301267703067000160760ustar00rootroot00000000000000" Vim support file to switch off detection of file types " " Maintainer: Bram Moolenaar " 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 * vim-7.4.1689/runtime/ftplugin.vim000066400000000000000000000017131267703067000166270ustar00rootroot00000000000000" Vim support file to switch on loading plugins for file types " " Maintainer: Bram Moolenaar " Last change: 2006 Apr 30 if exists("did_load_ftplugin") finish endif let did_load_ftplugin = 1 augroup filetypeplugin au FileType * call s:LoadFTPlugin() func! s:LoadFTPlugin() if exists("b:undo_ftplugin") exe b:undo_ftplugin unlet! b:undo_ftplugin b:did_ftplugin endif let s = expand("") if s != "" 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 " When there is a dot it is used to separate filetype names. Thus for " "aaa.bbb" load "aaa" and then "bbb". for name in split(s, '\.') exe 'runtime! ftplugin/' . name . '.vim ftplugin/' . name . '_*.vim ftplugin/' . name . '/*.vim' endfor endif endfunc augroup END vim-7.4.1689/runtime/ftplugin/000077500000000000000000000000001267703067000161105ustar00rootroot00000000000000vim-7.4.1689/runtime/ftplugin/README.txt000066400000000000000000000015451267703067000176130ustar00rootroot00000000000000The 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. vim-7.4.1689/runtime/ftplugin/a2ps.vim000066400000000000000000000007121267703067000174720ustar00rootroot00000000000000" Vim filetype plugin file " Language: a2ps(1) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< inc< fo<" setlocal comments=:# commentstring=#\ %s include=^\\s*Include: setlocal formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/aap.vim000066400000000000000000000013141267703067000173650ustar00rootroot00000000000000" Vim filetype plugin file " Language: Aap recipe " Maintainer: Bram Moolenaar " Last Change: 2013 Apr 05 " 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 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 vim-7.4.1689/runtime/ftplugin/abap.vim000066400000000000000000000014401267703067000175270ustar00rootroot00000000000000" Vim filetype plugin file " Language: ABAP " Author: Steven Oliver " Copyright: Copyright (c) 2013 Steven Oliver " License: You may redistribute this under the same terms as Vim itself " -------------------------------------------------------------------------- " Only do this when not done yet for this buffer if (exists("b:did_ftplugin")) finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim setlocal softtabstop=2 shiftwidth=2 setlocal suffixesadd=.abap " Windows allows you to filter the open file dialog if has("gui_win32") && !exists("b:browsefilter") let b:browsefilter = "ABAP Source Files (*.abap)\t*.abap\n" . \ "All Files (*.*)\t*.*\n" endif let &cpo = s:cpo_save unlet s:cpo_save " vim: set sw=4 sts=4 et tw=80 : vim-7.4.1689/runtime/ftplugin/abaqus.vim000066400000000000000000000064771267703067000201170ustar00rootroot00000000000000" Vim filetype plugin file " Language: Abaqus finite element input file (www.abaqus.com) " Maintainer: Carl Osterwisch " Last Change: 2012 Apr 30 " 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 " 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,'.\\{-}=','','') " Remove comma from valid filename characters since it is used to " separate keyword parameters setlocal isfname-=, " 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+=- let b:undo_ftplugin = "setlocal include< includeexpr< isfname<" \ . " comments< commentstring< define< iskeyword<" if has("folding") " Fold all lines that do not begin with * setlocal foldexpr=getline(v:lnum)[0]!=\"\*\" setlocal foldmethod=expr let b:undo_ftplugin .= " foldexpr< foldmethod<" endif " 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" let b:undo_ftplugin .= "|unlet! b:browsefilter" endif " Define patterns for the matchit plugin if exists("loaded_matchit") && !exists("b:match_words") let b:match_ignorecase = 1 let b:match_words = \ '\*part:\*end\s*part,' . \ '\*assembly:\*end\s*assembly,' . \ '\*instance:\*end\s*instance,' . \ '\*step:\*end\s*step' let b:undo_ftplugin .= "|unlet! b:match_ignorecase b:match_words" endif " Define keys used to move [count] keywords backward or forward. noremap [[ ?^\*\a:nohlsearch noremap ]] /^\*\a:nohlsearch " Define key to toggle commenting of the current line or range noremap \ :call Abaqus_ToggleComment()j function! 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 let b:undo_ftplugin .= "|unmap [[|unmap ]]" \ . "|unmap " " Undo must be done in nocompatible mode for . let b:undo_ftplugin = "let s:cpo_save = &cpoptions|" \ . "set cpoptions&vim|" \ . b:undo_ftplugin \ . "|let &cpoptions = s:cpo_save" \ . "|unlet s:cpo_save" " Restore saved compatibility options let &cpoptions = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/ada.vim000066400000000000000000000144101267703067000173520ustar00rootroot00000000000000"------------------------------------------------------------------------------ " Description: Perform Ada specific completion & tagging. " Language: Ada (2005) " $Id: ada.vim 887 2008-07-08 14:29:01Z krischik $ " Maintainer: Martin Krischik " Taylor Venable " Neil Bird " $Author: krischik $ " $Date: 2008-07-08 16:29:01 +0200 (Di, 08 Jul 2008) $ " Version: 4.6 with patch from David Bürgin " $Revision: 887 $ " $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/ftplugin/ada.vim $ " History: 24.05.2006 MK Unified Headers " 26.05.2006 MK ' should not be in iskeyword. " 16.07.2006 MK Ada-Mode as vim-ball " 02.10.2006 MK Better folding. " 15.10.2006 MK Bram's suggestion for runtime integration " 05.11.2006 MK Bram suggested not to use include protection for " autoload " 05.11.2006 MK Bram suggested to save on spaces " 08.07.2007 TV fix default compiler problems. " Help Page: ft-ada-plugin "------------------------------------------------------------------------------ " 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 matching of full-length ada entities from tags. "------------------------------------------------------------------------------ " Only do this when not done yet for this buffer if exists ("b:did_ftplugin") || version < 700 finish endif " Don't load another plugin for this buffer let b:did_ftplugin = 45 " " Temporarily set cpoptions to ensure the script loads OK " let s:cpoptions = &cpoptions set cpoptions-=C " Section: Comments {{{1 " setlocal comments=O:--,:--\ \ setlocal commentstring=--\ \ %s setlocal complete=.,w,b,u,t,i " Section: case {{{1 " setlocal nosmartcase setlocal ignorecase " Section: formatoptions {{{1 " setlocal formatoptions+=ron " Section: Tagging {{{1 " if exists ("g:ada_extended_tagging") " Make local tag mappings for this buffer (if not already set) if g:ada_extended_tagging == 'jump' if mapcheck('','n') == '' nnoremap :call ada#Jump_Tag ('', 'tjump') endif if mapcheck('g','n') == '' nnoremap g :call ada#Jump_Tag ('','stjump') endif elseif g:ada_extended_tagging == 'list' if mapcheck('','n') == '' nnoremap :call ada#List_Tag () endif if mapcheck('g','n') == '' nnoremap g :call ada#List_Tag () endif endif endif " Section: Completion {{{1 " setlocal completefunc=ada#User_Complete setlocal omnifunc=adacomplete#Complete if exists ("g:ada_extended_completion") if mapcheck ('','i') == '' inoremap =ada#Completion("\C-N>") endif if mapcheck ('','i') == '' inoremap =ada#Completion("\C-P>") endif if mapcheck ('','i') == '' inoremap =ada#Completion("\C-X>\C-]>") endif if mapcheck ('','i') == '' inoremap =ada#Insert_Backspace () endif endif " Section: Matchit {{{1 " " 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 = '\%(\:\:\:\\s\+\,' . \ s:notend . '\:\:\\s\+\,' . \ '\%(\.*\|\.*\|'.s:notend.'\)\:\\s\+\,' . \ '\%(\\|\\):\:\\s*\%($\|[;A-Z]\),' . \ s:notend . '\:\\s\+\' endif " Section: Compiler {{{1 " if ! exists("g:ada_default_compiler") if has("vms") let g:ada_default_compiler = 'decada' else let g:ada_default_compiler = 'gnat' endif endif if ! exists("current_compiler") || \ current_compiler != g:ada_default_compiler execute "compiler " . g:ada_default_compiler endif " Section: Folding {{{1 " if exists("g:ada_folding") if g:ada_folding[0] == 'i' setlocal foldmethod=indent setlocal foldignore=-- setlocal foldnestmax=5 elseif g:ada_folding[0] == 'g' setlocal foldmethod=expr setlocal foldexpr=ada#Pretty_Print_Folding(v:lnum) elseif g:ada_folding[0] == 's' setlocal foldmethod=syntax endif setlocal tabstop=8 setlocal softtabstop=3 setlocal shiftwidth=3 endif " Section: Abbrev {{{1 " if exists("g:ada_abbrev") iabbrev ret return iabbrev proc procedure iabbrev pack package iabbrev func function endif " Section: Commands, Mapping, Menus {{{1 " call ada#Map_Popup ( \ 'Tag.List', \ 'l', \ 'call ada#List_Tag ()') call ada#Map_Popup ( \'Tag.Jump', \'j', \'call ada#Jump_Tag ()') call ada#Map_Menu ( \'Tag.Create File', \':AdaTagFile', \'call ada#Create_Tags (''file'')') call ada#Map_Menu ( \'Tag.Create Dir', \':AdaTagDir', \'call ada#Create_Tags (''dir'')') call ada#Map_Menu ( \'Highlight.Toggle Space Errors', \ ':AdaSpaces', \'call ada#Switch_Syntax_Option (''space_errors'')') call ada#Map_Menu ( \'Highlight.Toggle Lines Errors', \ ':AdaLines', \'call ada#Switch_Syntax_Option (''line_errors'')') call ada#Map_Menu ( \'Highlight.Toggle Rainbow Color', \ ':AdaRainbow', \'call ada#Switch_Syntax_Option (''rainbow_color'')') call ada#Map_Menu ( \'Highlight.Toggle Standard Types', \ ':AdaTypes', \'call ada#Switch_Syntax_Option (''standard_types'')') " 1}}} " Reset cpoptions let &cpoptions = s:cpoptions unlet s:cpoptions finish " 1}}} "------------------------------------------------------------------------------ " Copyright (C) 2006 Martin Krischik " " Vim is Charityware - see ":help license" or uganda.txt for licence details. "------------------------------------------------------------------------------ " vim: textwidth=78 nowrap tabstop=8 shiftwidth=3 softtabstop=3 noexpandtab " vim: foldmethod=marker vim-7.4.1689/runtime/ftplugin/alsaconf.vim000066400000000000000000000006521267703067000204160ustar00rootroot00000000000000" Vim filetype plugin file " Language: alsaconf(8) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/ant.vim000066400000000000000000000024751267703067000174170ustar00rootroot00000000000000" Vim filetype plugin file " Language: ant " Maintainer: Dan Sharp " Last Changed: 20 Jan 2009 " URL: http://dwsharp.users.sourceforge.net/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 unlet s:save_cpo vim-7.4.1689/runtime/ftplugin/arch.vim000066400000000000000000000006431267703067000175450ustar00rootroot00000000000000" Vim filetype plugin file " Language: GNU Arch inventory file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/art.vim000066400000000000000000000006321267703067000174140ustar00rootroot00000000000000" Vim filetype plugin " Language: ART-IM and ART*Enterprise " Maintainer: Dorai Sitaram " 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 vim-7.4.1689/runtime/ftplugin/aspvbs.vim000066400000000000000000000035741267703067000201340ustar00rootroot00000000000000" Vim filetype plugin file " Language: aspvbs " Maintainer: Dan Sharp " Last Changed: 20 Jan 2009 " URL: http://dwsharp.users.sourceforge.net/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 = '\%(\\%(.\{-}then\s\+\w\)\@!:\:^\s*\:\,' . \ s:notend . '\:\:\:\,' . \ '^\s*\:\,' . \ '^\s*\:\,' . \ '\:\,' . \ '^\s*\:\,' . \ '^\s*\:\,' . \ '\:\,' . \ 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:match_ignorecase b:browsefilter | " . s:undo_ftplugin " Restore the saved compatibility options. let &cpo = s:save_cpo unlet s:save_cpo vim-7.4.1689/runtime/ftplugin/automake.vim000066400000000000000000000005051267703067000204330ustar00rootroot00000000000000" Vim filetype plugin file " Language: Automake " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let s:cpo_save = &cpo set cpo&vim runtime! ftplugin/make.vim ftplugin/make_*.vim ftplugin/make/*.vim let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/bdf.vim000066400000000000000000000006651267703067000173670ustar00rootroot00000000000000" Vim filetype plugin file " Language: BDF font definition " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=b:COMMENT commentstring=COMMENT\ %s setlocal formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/bst.vim000066400000000000000000000005151267703067000174160ustar00rootroot00000000000000" Vim filetype plugin file " Language: bst " Author: Tim Pope " $Id: bst.vim,v 1.1 2007/05/05 17:37:57 vimboss Exp $ if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 setlocal commentstring=%\ %s setlocal comments=:% setlocal fo-=t fo+=croql let b:undo_ftplugin = "setlocal com< cms< fo<" vim-7.4.1689/runtime/ftplugin/btm.vim000066400000000000000000000004741267703067000174140ustar00rootroot00000000000000" Vim filetype plugin file " Language: BTM " Maintainer: Bram Moolenaar " Last Change: 2004 Jul 06 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") finish endif " Behaves just like dosbatch runtime! ftplugin/dosbatch.vim ftplugin/dosbatch_*.vim ftplugin/dosbatch/*.vim vim-7.4.1689/runtime/ftplugin/bzl.vim000066400000000000000000000057671267703067000174330ustar00rootroot00000000000000" Vim filetype plugin file " Language: Bazel (http://bazel.io) " Maintainer: David Barnett (https://github.com/google/vim-ft-bzl) " Last Change: 2015 Aug 11 "" " @section Introduction, intro " Core settings for the bzl filetype, used for BUILD and *.bzl files for the " Bazel build system (http://bazel.io/). if exists('b:did_ftplugin') finish endif " Vim 7.4.051 has opinionated settings in ftplugin/python.vim that try to force " PEP8 conventions on every python file, but these conflict with Google's " indentation guidelines. As a workaround, we explicitly source the system " ftplugin, but save indentation settings beforehand and restore them after. let s:save_expandtab = &l:expandtab let s:save_shiftwidth = &l:shiftwidth let s:save_softtabstop = &l:softtabstop let s:save_tabstop = &l:tabstop " NOTE: Vim versions before 7.3.511 had a ftplugin/python.vim that was broken " for compatible mode. let s:save_cpo = &cpo set cpo&vim " Load base python ftplugin (also defines b:did_ftplugin). source $VIMRUNTIME/ftplugin/python.vim " NOTE: Vim versions before 7.4.104 and later set this in ftplugin/python.vim. setlocal comments=b:#,fb:- " Restore pre-existing indentation settings. let &l:expandtab = s:save_expandtab let &l:shiftwidth = s:save_shiftwidth let &l:softtabstop = s:save_softtabstop let &l:tabstop = s:save_tabstop setlocal formatoptions-=t " Make gf work with imports in BUILD files. setlocal includeexpr=substitute(v:fname,'//','','') " Enable syntax-based folding, if specified. if get(g:, 'ft_bzl_fold', 0) setlocal foldmethod=syntax setlocal foldtext=BzlFoldText() endif if exists('*BzlFoldText') finish endif function BzlFoldText() abort let l:start_num = nextnonblank(v:foldstart) let l:end_num = prevnonblank(v:foldend) if l:end_num <= l:start_num + 1 " If the fold is empty, don't print anything for the contents. let l:content = '' else " Otherwise look for something matching the content regex. " And if nothing matches, print an ellipsis. let l:content = '...' for l:line in getline(l:start_num + 1, l:end_num - 1) let l:content_match = matchstr(l:line, '\m\C^\s*name = \zs.*\ze,$') if !empty(l:content_match) let l:content = l:content_match break endif endfor endif " Enclose content with start and end let l:start_text = getline(l:start_num) let l:end_text = substitute(getline(l:end_num), '^\s*', '', '') let l:text = l:start_text . ' ' . l:content . ' ' . l:end_text " Compute the available width for the displayed text. let l:width = winwidth(0) - &foldcolumn - (&number ? &numberwidth : 0) let l:lines_folded = ' ' . string(1 + v:foldend - v:foldstart) . ' lines' " Expand tabs, truncate, pad, and concatenate let l:text = substitute(l:text, '\t', repeat(' ', &tabstop), 'g') let l:text = strpart(l:text, 0, l:width - len(l:lines_folded)) let l:padding = repeat(' ', l:width - len(l:lines_folded) - len(l:text)) return l:text . l:padding . l:lines_folded endfunction let &cpo = s:save_cpo unlet s:save_cpo vim-7.4.1689/runtime/ftplugin/c.vim000066400000000000000000000036541267703067000170570ustar00rootroot00000000000000" Vim filetype plugin file " Language: C " Maintainer: Bram Moolenaar " Last Change: 2012 Jul 10 " 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 " Using line continuation here. let s:cpo_save = &cpo set cpo-=C let b:undo_ftplugin = "setl fo< com< ofu< | if has('vms') | setl isk< | endif" " Set 'formatoptions' to break comment lines but not other lines, " and insert the comment leader when hitting or using "o". setlocal fo-=t fo+=croql " Set completion with CTRL-X CTRL-O to autoloaded function. if exists('&ofu') setlocal ofu=ccomplete#Complete endif " 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 " When the matchit plugin is loaded, this makes the % command skip parens and " braces in comments. let b:match_words = &matchpairs . ',^\s*#\s*if\(\|def\|ndef\)\>:^\s*#\s*elif\>:^\s*#\s*else\>:^\s*#\s*endif\>' let b:match_skip = 's:comment\|string\|character' " Win32 can filter files in the browse dialog if (has("gui_win32") || has("gui_gtk")) && !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 == "ch" 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 let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/calendar.vim000066400000000000000000000007021267703067000203750ustar00rootroot00000000000000" Vim filetype plugin file " Language: calendar(1) input file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< inc< fo<" setlocal comments=s1:/*,mb:*,ex:*/ commentstring& include& setlocal formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/cdrdaoconf.vim000066400000000000000000000005671267703067000207370ustar00rootroot00000000000000" Vim filetype plugin file " Maintainer: Nikolai Weibull " Latest Revision: 2007-12-04 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/ch.vim000066400000000000000000000007301267703067000172170ustar00rootroot00000000000000" Vim filetype plugin file " Language: Ch " Maintainer: SoftIntegration, Inc. " 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 vim-7.4.1689/runtime/ftplugin/changelog.vim000066400000000000000000000212731267703067000205610ustar00rootroot00000000000000" Vim filetype plugin file " Language: generic Changelog file " Maintainer: Martin Florian " Previous Maintainer: Nikolai Weibull " Latest Revision: 2015-10-25 " Variables: " g:changelog_timeformat (deprecated: use g:changelog_dateformat instead) - " description: the timeformat used in ChangeLog entries. " default: "%Y-%m-%d". " g:changelog_dateformat - " description: the format sent to strftime() to generate a date string. " 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: " o - " adds a new changelog entry for the current user for the current date. " Global Mappings: " 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 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' if exists('b:did_ftplugin') finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim " Set up the format used for dates. if !exists('g:changelog_dateformat') if exists('g:changelog_timeformat') let g:changelog_dateformat = g:changelog_timeformat else let g:changelog_dateformat = "%Y-%m-%d" endif endif function! s:username() if exists('g:changelog_username') return g:changelog_username elseif $EMAIL != "" return $EMAIL elseif $EMAIL_ADDRESS != "" return $EMAIL_ADDRESS endif let login = s:login() return printf('%s <%s@%s>', s:name(login), login, s:hostname()) endfunction function! s:login() return s:trimmed_system_with_default('whoami', 'unknown') endfunction function! s:trimmed_system_with_default(command, default) return s:first_line(s:system_with_default(a:command, a:default)) endfunction function! s:system_with_default(command, default) let output = system(a:command) if v:shell_error return default endif return output endfunction function! s:first_line(string) return substitute(a:string, '\n.*$', "", "") endfunction function! s:name(login) for name in [s:gecos_name(a:login), $NAME, s:capitalize(a:login)] if name != "" return name endif endfor endfunction function! s:gecos_name(login) for line in s:try_reading_file('/etc/passwd') if line =~ '^' . a:login . ':' return substitute(s:passwd_field(line, 5), '&', s:capitalize(a:login), "") endif endfor return "" endfunction function! s:try_reading_file(path) try return readfile(a:path) catch return [] endtry endfunction function! s:passwd_field(line, field) let fields = split(a:line, ':', 1) if len(fields) < a:field return "" endif return fields[a:field - 1] endfunction function! s:capitalize(word) return toupper(a:word[0]) . strpart(a:word, 1) endfunction function! s:hostname() return s:trimmed_system_with_default('hostname', 'localhost') endfunction " Format used for new date entries. if !exists('g:changelog_new_date_format') let g:changelog_new_date_format = "%d %u\n\n\t* %p%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* %p%c" endif " Regular expression used to find a given date entry. if !exists('g:changelog_date_entry_search') let g:changelog_date_entry_search = '^\s*%d\_s*%u' endif " Regular expression used to find the end of a date entry if !exists('g:changelog_date_end_entry_search') let g:changelog_date_end_entry_search = '^\s*$' 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, prefix) let str = a:str let middles = {'%': '%', 'd': a:date, 'u': a:user, 'p': a:prefix, 'c': '{cursor}'} let i = stridx(str, '%') while i != -1 let inc = 0 if has_key(middles, str[i + 1]) let mid = middles[str[i + 1]] let str = strpart(str, 0, i) . mid . strpart(str, i + 2) let inc = strlen(mid) - 1 endif let i = stridx(str, '%', i + 1 + inc) endwhile return str endfunction " Position the cursor once we've done all the funky substitution. function! s:position_cursor() if search('{cursor}') > 0 let lnum = line('.') let line = getline(lnum) let cursor = stridx(line, '{cursor}') call setline(lnum, substitute(line, '{cursor}', '', '')) endif startinsert endfunction " Internal function to create a new entry in the ChangeLog. function! s:new_changelog_entry(prefix) " Deal with 'paste' option. let save_paste = &paste let &paste = 1 call cursor(1, 1) " Look for an entry for today by our user. let date = strftime(g:changelog_dateformat) let search = s:substitute_items(g:changelog_date_entry_search, date, \ s:username(), a:prefix) if search(search) > 0 " Ok, now we look for the end of the date entry, and add an entry. call cursor(nextnonblank(line('.') + 1), 1) if search(g:changelog_date_end_entry_search, 'W') > 0 let p = (line('.') == line('$')) ? line('.') : line('.') - 1 else let p = line('.') endif let ls = split(s:substitute_items(g:changelog_new_entry_format, '', '', a:prefix), \ '\n') call append(p, ls) call cursor(p + 1, 1) 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, s:username(), a:prefix) " Make sure we have a cursor positioning. if stridx(todays_entry, '{cursor}') == -1 let todays_entry = todays_entry . '{cursor}' endif " Now do the work. call append(0, split(todays_entry, '\n')) " Remove empty lines at end of file. if remove_empty $-/^\s*$/-1,$delete endif " Reposition cursor once we're done. call cursor(1, 1) endif call s:position_cursor() " And reset 'paste' option let &paste = save_paste endfunction if exists(":NewChangelogEntry") != 2 nnoremap o :call new_changelog_entry('') xnoremap o :call new_changelog_entry('') command! -nargs=0 NewChangelogEntry call s:new_changelog_entry('') endif let b:undo_ftplugin = "setl com< fo< et< ai<" setlocal comments= setlocal formatoptions+=t setlocal noexpandtab setlocal autoindent if &textwidth == 0 setlocal textwidth=78 let b:undo_ftplugin .= " tw<" endif let &cpo = s:cpo_save unlet s:cpo_save else let s:cpo_save = &cpo set cpo&vim " Add the Changelog opening mapping nnoremap o :call open_changelog() function! s:open_changelog() let path = expand('%:p:h') if exists('b:changelog_path') let changelog = b:changelog_path else if exists('b:changelog_name') let name = b:changelog_name else let name = 'ChangeLog' endif while isdirectory(path) let changelog = path . '/' . name if filereadable(changelog) break endif let parent = substitute(path, '/\+[^/]*$', "", "") if path == parent break endif let path = parent endwhile endif if !filereadable(changelog) return endif if exists('b:changelog_entry_prefix') let prefix = call(b:changelog_entry_prefix, []) else let prefix = substitute(strpart(expand('%:p'), strlen(path)), '^/\+', "", "") endif let buf = bufnr(changelog) if buf != -1 if bufwinnr(buf) != -1 execute bufwinnr(buf) . 'wincmd w' else execute 'sbuffer' buf endif else execute 'split' fnameescape(changelog) endif call s:new_changelog_entry(prefix) endfunction let &cpo = s:cpo_save unlet s:cpo_save endif vim-7.4.1689/runtime/ftplugin/clojure.vim000066400000000000000000000072661267703067000203030ustar00rootroot00000000000000" Vim filetype plugin file " Language: Clojure " Author: Meikel Brandmeyer " " Maintainer: Sung Pae " URL: https://github.com/guns/vim-clojure-static " License: Same as Vim " Last Change: 27 March 2014 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = 'setlocal iskeyword< define< formatoptions< comments< commentstring< lispwords<' setlocal iskeyword+=?,-,*,!,+,/,=,<,>,.,:,$ " There will be false positives, but this is better than missing the whole set " of user-defined def* definitions. setlocal define=\\v[(/]def(ault)@!\\S* " Remove 't' from 'formatoptions' to avoid auto-wrapping code. setlocal formatoptions-=t " Lisp comments are routinely nested (e.g. ;;; SECTION HEADING) setlocal comments=n:; setlocal commentstring=;\ %s " Specially indented symbols from clojure.core and clojure.test. " " Clojure symbols are indented in the defn style when they: " " * Define vars and anonymous functions " * Create new lexical scopes or scopes with altered environments " * Create conditional branches from a predicate function or value " " The arglists for these functions are generally in the form of [x & body]; " Functions that accept a flat list of forms do not treat the first argument " specially and hence are not indented specially. " " -*- LISPWORDS -*- " Generated from https://github.com/guns/vim-clojure-static/blob/vim-release-010/clj/src/vim_clojure_static/generate.clj setlocal lispwords=as->,binding,bound-fn,case,catch,cond->,cond->>,condp,def,definline,definterface,defmacro,defmethod,defmulti,defn,defn-,defonce,defprotocol,defrecord,defstruct,deftest,deftest-,deftype,doseq,dotimes,doto,extend,extend-protocol,extend-type,fn,for,if,if-let,if-not,if-some,let,letfn,locking,loop,ns,proxy,reify,set-test,testing,when,when-first,when-let,when-not,when-some,while,with-bindings,with-in-str,with-local-vars,with-open,with-precision,with-redefs,with-redefs-fn,with-test " Provide insert mode completions for special forms and clojure.core. As " 'omnifunc' is set by popular Clojure REPL client plugins, we also set " 'completefunc' so that the user has some form of completion available when " 'omnifunc' is set and no REPL connection exists. for s:setting in ['omnifunc', 'completefunc'] if exists('&' . s:setting) && empty(eval('&' . s:setting)) execute 'setlocal ' . s:setting . '=clojurecomplete#Complete' let b:undo_ftplugin .= ' | setlocal ' . s:setting . '<' endif endfor " Take all directories of the CLOJURE_SOURCE_DIRS environment variable " and add them to the path option. " " This is a legacy option for VimClojure users. if exists('$CLOJURE_SOURCE_DIRS') for s:dir in split($CLOJURE_SOURCE_DIRS, (has("win32") || has("win64")) ? ';' : ':') let s:dir = fnameescape(s:dir) " Whitespace escaping for Windows let s:dir = substitute(s:dir, '\', '\\\\', 'g') let s:dir = substitute(s:dir, '\ ', '\\ ', 'g') execute "setlocal path+=" . s:dir . "/**" endfor let b:undo_ftplugin .= ' | setlocal path<' endif " Skip brackets in ignored syntax regions when using the % command if exists('loaded_matchit') let b:match_words = &matchpairs let b:match_skip = 's:comment\|string\|regex\|character' let b:undo_ftplugin .= ' | unlet! b:match_words b:match_skip' endif " Win32 can filter files in the browse dialog if has("gui_win32") && !exists("b:browsefilter") let b:browsefilter = "Clojure Source Files (*.clj)\t*.clj\n" . \ "ClojureScript Source Files (*.cljs)\t*.cljs\n" . \ "Java Source Files (*.java)\t*.java\n" . \ "All Files (*.*)\t*.*\n" let b:undo_ftplugin .= ' | unlet! b:browsefilter' endif let &cpo = s:cpo_save unlet! s:cpo_save s:setting s:dir " vim:sts=8:sw=8:ts=8:noet vim-7.4.1689/runtime/ftplugin/cobol.vim000066400000000000000000000223621267703067000177300ustar00rootroot00000000000000" Vim filetype plugin file " Language: cobol " Author: Tim Pope " Last Update: By ZyX: use shiftwidth() " Insert mode mappings: " Normal mode mappings: < > << >> [[ ]] [] ][ " Visual mode mappings: < > if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim setlocal commentstring=\ \ \ \ \ \ *%s setlocal comments=:* setlocal fo+=croqlt setlocal expandtab setlocal textwidth=72 " matchit support if exists("loaded_matchit") let s:ordot = '\|\ze\.\%( \@=\|$\)' let b:match_ignorecase=1 "let b:match_skip = 'getline(".") =~ "^.\\{6\\}[*/C]"' let b:match_words= \ '\$if\>:$else\>:\$endif\>,' . \ '[$-]\@:\<\%(then\|else\)\>:\'.s:ordot.',' . \ '-\@:\'.s:ordot . ',' . \ '-\@:\<\%(when\)\>:\' .s:ordot . ',' . \ '-\@\%(.*\(\%$\|\%(\n\%(\%(\s*\|.\{6\}\)[*/].*\n\)*\)\=\s*\%(not\s\+\)\=on\s\+size\s\+error\>\)\)\@=:\%(\:\' .s:ordot . ',' . \ '-\@\%(.*\(\%$\|\%(\n\%(\%(\s*\|.\{6\}\)[*/].*\n\)*\)\=\s*\%(not\s\+\)\=on\s\+\%(overflow\|exception\)\>\)\)\@=:\%(\:\' .s:ordot . ',' . \ '-\@\%(.*\(\%$\|\%(\n\%(\%(\s*\|.\{6\}\)[*/].*\n\)*\)\=\s*\%(invalid\s\+key\|at\s\+end\|no\s\+data\|at\s\+end-of-page\)\>\)\)\@=:\%(\:\' .s:ordot endif if has("gui_win32") && !exists("b:browsefilter") let b:browsefilter = "COBOL Source Files (*.cbl, *.cob)\t*.cbl;*.cob;*.lib\n". \ "All Files (*.*)\t*.*\n" endif let b:undo_ftplugin = "setlocal com< cms< fo< et< tw<" . \ " | unlet! b:browsefilter b:match_words b:match_ignorecase b:match_skip" if !exists("g:no_plugin_maps") && !exists("g:no_cobol_maps") let b:undo_ftplugin = b:undo_ftplugin . \ " | sil! exe 'nunmap <'" . \ " | sil! exe 'nunmap >'" . \ " | sil! exe 'nunmap <<'" . \ " | sil! exe 'nunmap >>'" . \ " | sil! exe 'vunmap <'" . \ " | sil! exe 'vunmap >'" . \ " | sil! exe 'iunmap '" . \ " | sil! exe 'iunmap '" . \ " | sil! exe 'iunmap '" . \ " | sil! exe 'nunmap Traditional'" . \ " | sil! exe 'nunmap Comment'" . \ " | sil! exe 'nunmap DeComment'" . \ " | sil! exe 'vunmap VisualTraditional'" . \ " | sil! exe 'vunmap VisualComment'" . \ " | sil! exe 'iunmap VisualDeComment'" . \ " | sil! exe 'unmap [['" . \ " | sil! exe 'unmap ]]'" . \ " | sil! exe 'unmap []'" . \ " | sil! exe 'unmap ]['" endif if !exists("g:no_plugin_maps") && !exists("g:no_cobol_maps") if version >= 700 nnoremap > :set opfunc=IncreaseFuncg@ nnoremap < :set opfunc=DecreaseFuncg@ endif nnoremap >> :call CobolIndentBlock(1) nnoremap << :call CobolIndentBlock(-1) vnoremap > :call CobolIndentBlock(v:count1) vnoremap < :call CobolIndentBlock(-v:count1) inoremap =IncreaseIndent()=RestoreShiftwidth() inoremap =DecreaseIndent()=RestoreShiftwidth() if !maparg("","i") inoremap =Tab()=RestoreShiftwidth() endif noremap [[ m':call search('\c^\%(\s*\.\{6\}\s\+\)\zs[A-Za-z0-9-]\+\s\+\%(division\section\)\s*\.','bW') noremap ]] m':call search('\c^\%(\s*\.\{6\}\s\+\)\zs[A-Za-z0-9-]\+\s\+\%(division\section\)\.','W') noremap [] m':call toend('b') noremap ][ m':call toend('') " For EnhancedCommentify noremap Traditional :call Comment('t') noremap Comment :call Comment('c') noremap DeComment :call Comment('u') noremap VisualTraditional :'<,'>call Comment('t') noremap VisualComment :'<,'>call Comment('c') noremap VisualDeComment :'<,'>call Comment('u') endif let &cpo = s:cpo_save unlet s:cpo_save if exists("g:did_cobol_ftplugin_functions") finish endif let g:did_cobol_ftplugin_functions = 1 function! s:repeat(str,count) let i = 0 let ret = "" while i < a:count let ret = ret . a:str let i = i + 1 endwhile return ret endfunction function! s:increase(...) let lnum = '.' let sw = shiftwidth() let i = a:0 ? a:1 : indent(lnum) if i >= 11 return sw - (i - 11) % sw elseif i >= 7 return 11-i elseif i == 6 return 1 else return 6-i endif endfunction function! s:decrease(...) let lnum = '.' let sw = shiftwidth() let i = indent(a:0 ? a:1 : lnum) if i >= 11 + sw return 1 + (i + 12) % sw elseif i > 11 return i-11 elseif i > 7 return i-7 elseif i == 7 return 1 else return i endif endfunction function! CobolIndentBlock(shift) let head = strpart(getline('.'),0,7) let tail = strpart(getline('.'),7) let indent = match(tail,'[^ ]') let sw = shiftwidth() let shift = a:shift if shift > 0 if indent < 4 let tail = s:repeat(" ",4-indent).tail let shift = shift - 1 endif let tail = s:repeat(" ",shift*sw).tail let shift = 0 elseif shift < 0 if (indent-4) > -shift * sw let tail = strpart(tail,-shift * sw) elseif (indent-4) > (-shift-1) * sw let tail = strpart(tail,indent - 4) else let tail = strpart(tail,indent) endif endif call setline('.',head.tail) endfunction function! s:IncreaseFunc(type) '[,']call CobolIndentBlock(1) endfunction function! s:DecreaseFunc(type) '[,']call CobolIndentBlock(-1) endfunction function! s:IncreaseIndent() let c = "\" if exists("*InsertCtrlTWrapper") let key = InsertCtrlTWrapper() if key != c return key endif endif let interval = s:increase() let b:cobol_shiftwidth = &shiftwidth let &shiftwidth = 1 let lastchar = strpart(getline('.'),col('.')-2,1) if lastchar == '0' || lastchar == '^' return "\".lastchar.c else return s:repeat(c,interval) endif endfunction function! s:DecreaseIndent() let c = "\" if exists("*InsertCtrlDWrapper") " I hack Ctrl-D to delete when not at the end of the line. let key = InsertCtrlDWrapper() if key != c return key endif endif let interval = s:decrease() let b:cobol_shiftwidth = &shiftwidth let &shiftwidth = 1 return s:repeat(c,interval) endfunction function! s:RestoreShiftwidth() if exists("b:cobol_shiftwidth") let &shiftwidth=b:cobol_shiftwidth unlet b:cobol_shiftwidth endif return "" endfunction function! s:Tab() if (strpart(getline('.'),0,col('.')-1) =~ '^\s*$' && &sta) return s:IncreaseIndent() " &softtabstop < 0: &softtabstop follows &shiftwidth elseif (&sts < 0 || &sts == shiftwidth()) && &sts != 8 && &et return s:repeat(" ",s:increase(col('.')-1)) else return "\" endif endfunction function! s:Comment(arg) " For EnhancedCommentify let line = getline('.') if (line =~ '^.\{6\}[*/C]' || a:arg == 'c') && a:arg != 'u' let line = substitute(line,'^.\{6\}\zs.',' ','') else let line = substitute(line,'^.\{6\}\zs.','*','') endif call setline('.',line) endfunction function! s:toend(direction) let ignore = '^\(\s*\|.\{6\}\)\%([*/]\|\s*$\)' let keep = line('.') keepjumps + while line('.') < line('$') && getline('.') =~ ignore keepjumps + endwhile let res = search('\c^\%(\s*\|.\{6\}\s\+\)\zs[A-Za-z0-9-]\+\s\+\%(division\|section\)\s*\.',a:direction.'W') if a:direction != 'b' && !res let res = line('$') keepjumps $ elseif res keepjumps - endif if res while line('.') > 1 && getline('.') =~ ignore keepjumps - endwhile if line('.') == 1 && getline('.') =~ ignore exe "keepjumps ".keep endif else exe "keepjumps ".keep endif endfunction vim-7.4.1689/runtime/ftplugin/conf.vim000066400000000000000000000006461267703067000175600ustar00rootroot00000000000000" Vim filetype plugin file " Language: generic configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/config.vim000066400000000000000000000023721267703067000200760ustar00rootroot00000000000000" Vim filetype plugin file " Language: config " Maintainer: Dan Sharp " Last Changed: 20 Jan 2009 " URL: http://dwsharp.users.sourceforge.net/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.*, config.*)\tconfigure*;config.*\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 unlet s:save_cpo vim-7.4.1689/runtime/ftplugin/context.vim000066400000000000000000000016731267703067000203200ustar00rootroot00000000000000" Vim filetype plugin file " Language: ConTeXt typesetting engine " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< def< inc< sua< fo<" setlocal comments=b:%D,b:%C,b:%M,:% commentstring=%\ %s formatoptions+=tcroql 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\|if\)' let &l:include = '^\s*\%(input\|component\)' setlocal suffixesadd=.tex if exists("loaded_matchit") let b:match_ignorecase = 0 let b:match_skip = 'r:\\\@ " 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 vim-7.4.1689/runtime/ftplugin/crm.vim000066400000000000000000000006221267703067000174060ustar00rootroot00000000000000" Vim filetype plugin file " Language: CRM114 " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/cs.vim000066400000000000000000000014421267703067000172330ustar00rootroot00000000000000" Vim filetype plugin file " Language: C# " Maintainer: Johannes Zellner " 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 let s:keepcpo= &cpo set cpo&vim " Set 'formatoptions' to break comment lines but not other lines, " and insert the comment leader when hitting 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 let &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/ftplugin/csc.vim000066400000000000000000000013361267703067000174000ustar00rootroot00000000000000" Vim filetype plugin file " Language: csc " Maintainer: Dan Sharp " Last Changed: 20 Jan 2009 " URL: http://dwsharp.users.sourceforge.net/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= \ '\:\,' . \ '\:\:\,' . \ '\\|\:\' endif " Undo the stuff we changed. let b:undo_ftplugin = "unlet! b:match_words" " Restore the saved compatibility options. let &cpo = s:save_cpo unlet s:save_cpo vim-7.4.1689/runtime/ftplugin/csh.vim000066400000000000000000000031411267703067000174010ustar00rootroot00000000000000" Vim filetype plugin file " Language: csh " Maintainer: Dan Sharp " Last Changed: 20 Jan 2009 " URL: http://dwsharp.users.sourceforge.net/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*\.*(.*).*\:'. \ '^\s*\\s\+\.*(.*).*\:^\s*\:'. \ '^\s*\,'. \ '\%(^\s*\\s\+\S\+\|^s*\\).*(.*):'. \ '\:\:^\s*\,'. \ '^\s*\.*(.*):^\s*\\s\+:^\s*\:^\s*\' 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 unlet s:save_cpo vim-7.4.1689/runtime/ftplugin/css.vim000066400000000000000000000010041267703067000174100ustar00rootroot00000000000000" Vim filetype plugin file " Language: CSS " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< inc< fo< ofu<" setlocal comments=s1:/*,mb:*,ex:*/ commentstring& setlocal formatoptions-=t formatoptions+=croql setlocal omnifunc=csscomplete#CompleteCSS let &l:include = '^\s*@import\s\+\%(url(\)\=' let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/cucumber.vim000066400000000000000000000123151267703067000204340ustar00rootroot00000000000000" Vim filetype plugin " Language: Cucumber " Maintainer: Tim Pope " Last Change: 2013 Jun 01 " Only do this when not done yet for this buffer if (exists("b:did_ftplugin")) finish endif let b:did_ftplugin = 1 let s:keepcpo= &cpo set cpo&vim setlocal formatoptions-=t formatoptions+=croql setlocal comments=:# commentstring=#\ %s setlocal omnifunc=CucumberComplete let b:undo_ftplugin = "setl fo< com< cms< ofu<" let b:cucumber_root = expand('%:p:h:s?.*[\/]\%(features\|stories\)\zs[\/].*??') if !exists("g:no_plugin_maps") && !exists("g:no_cucumber_maps") nnoremap :exe jump('edit',v:count) nnoremap [ :exe jump('edit',v:count) nnoremap ] :exe jump('edit',v:count) nnoremap ] :exe jump('split',v:count) nnoremap :exe jump('split',v:count) nnoremap d :exe jump('split',v:count) nnoremap :exe jump('split',v:count) nnoremap } :exe jump('pedit',v:count) nnoremap [d :exe jump('pedit',v:count) nnoremap ]d :exe jump('pedit',v:count) let b:undo_ftplugin .= \ "|sil! nunmap " . \ "|sil! nunmap [" . \ "|sil! nunmap ]" . \ "|sil! nunmap ]" . \ "|sil! nunmap " . \ "|sil! nunmap d" . \ "|sil! nunmap " . \ "|sil! nunmap }" . \ "|sil! nunmap [d" . \ "|sil! nunmap ]d" endif function! s:jump(command,count) let steps = s:steps('.') if len(steps) == 0 || len(steps) < a:count return 'echoerr "No matching step found"' elseif len(steps) > 1 && !a:count return 'echoerr "Multiple matching steps found"' else let c = a:count ? a:count-1 : 0 return a:command.' +'.steps[c][1].' '.escape(steps[c][0],' %#') endif endfunction function! s:allsteps() let step_pattern = '\C^\s*\K\k*\>\s*(\=\s*\zs\S.\{-\}\ze\s*)\=\s*\%(do\|{\)\s*\%(|[^|]*|\s*\)\=\%($\|#\)' let steps = [] for file in split(glob(b:cucumber_root.'/**/*.rb'),"\n") let lines = readfile(file) let num = 0 for line in lines let num += 1 if line =~ step_pattern let type = matchstr(line,'\w\+') let steps += [[file,num,type,matchstr(line,step_pattern)]] endif endfor endfor return steps endfunction function! s:steps(lnum) let c = match(getline(a:lnum), '\S') + 1 while synIDattr(synID(a:lnum,c,1),'name') !~# '^$\|Region$' let c = c + 1 endwhile let step = matchstr(getline(a:lnum)[c-1 : -1],'^\s*\zs.\{-\}\ze\s*$') return filter(s:allsteps(),'s:stepmatch(v:val[3],step)') endfunction function! s:stepmatch(receiver,target) if a:receiver =~ '^[''"].*[''"]$' let pattern = '^'.escape(substitute(a:receiver[1:-2],'$\w\+','(.*)','g'),'/').'$' elseif a:receiver =~ '^/.*/$' let pattern = a:receiver[1:-2] elseif a:receiver =~ '^%r..*.$' let pattern = escape(a:receiver[3:-2],'/') else return 0 endif try let vimpattern = substitute(substitute(pattern,'\\\@ " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments= commentstring= formatoptions-=tcroql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/debchangelog.vim000066400000000000000000000264261267703067000212410ustar00rootroot00000000000000" Vim filetype plugin file (GUI menu, folding and completion) " Language: Debian Changelog " Maintainer: Debian Vim Maintainers " Former Maintainers: Michael Piefel " Stefano Zacchiroli " Last Change: 2014-01-31 " License: Vim License " URL: http://hg.debian.org/hg/pkg-vim/vim/file/unstable/runtime/ftplugin/debchangelog.vim " Bug completion requires apt-listbugs installed for Debian packages or " python-launchpadlib installed for Ubuntu packages if exists("b:did_ftplugin") finish endif let b:did_ftplugin=1 " {{{1 Local settings (do on every load) if exists("g:debchangelog_fold_enable") setlocal foldmethod=expr setlocal foldexpr=DebGetChangelogFold(v:lnum) setlocal foldtext=DebChangelogFoldText() endif " Debian changelogs are not supposed to have any other text width, " so the user cannot override this setting setlocal tw=78 setlocal comments=f:* " Clean unloading let b:undo_ftplugin = "setlocal tw< comments< foldmethod< foldexpr< foldtext<" " }}}1 if exists("g:did_changelog_ftplugin") finish endif " Don't load another plugin (this is global) let g:did_changelog_ftplugin = 1 " {{{1 GUI menu " 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 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 Email() if exists("$DEBEMAIL") return $DEBEMAIL elseif exists("$EMAIL") return $EMAIL elseif exists("g:debianemail") return g:debianemail else return "your@email.address" endif endfunction " Returns date in RFC822 format. function 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 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 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 Urgency("low") normal 1G0 call search(")") normal h normal  call setline(1, substitute(getline(1), '-\$\$', '-', '')) if exists("g:debchangelog_fold_enable") foldopen endif call AddEntry() endfunction function AddEntry() normal 1G call search("^ -- ") normal kk call append(".", " * ") normal jjj let warn=WarnIfNotUnfinalised() normal kk if warn echohl MoreMsg call input("Hit ENTER") echohl None endif startinsert! endfunction function CloseBug() normal 1G call search("^ -- ") let warn=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), ') *\%(UNRELEASED\|\l\+\);', ") " . a:dist . ";", "")) endfunction function Urgency(urg) call setline(1, substitute(getline(1), "urgency=.*$", "urgency=" . a:urg, "")) endfunction function 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 UnfinaliseMenu() normal 1G call search("^ -- ") call setline(".", " -- ") endfunction function 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 FinaliseMenu() normal 1G call search("^ -- ") call setline(".", " -- " . FullName() . " <" . Email() . "> " . Date()) endfunction function MakeMenu() amenu &Changelog.&New\ Version :call NewVersion() amenu Changelog.&Add\ Entry :call AddEntry() amenu Changelog.&Close\ Bug :call CloseBug() menu Changelog.-sep- amenu Changelog.Set\ &Distribution.&unstable :call Distribution("unstable") amenu Changelog.Set\ Distribution.&frozen :call Distribution("frozen") amenu Changelog.Set\ Distribution.&stable :call Distribution("stable") menu Changelog.Set\ Distribution.-sep- amenu Changelog.Set\ Distribution.frozen\ unstable :call Distribution("frozen unstable") amenu Changelog.Set\ Distribution.stable\ unstable :call Distribution("stable unstable") amenu Changelog.Set\ Distribution.stable\ frozen :call Distribution("stable frozen") amenu Changelog.Set\ Distribution.stable\ frozen\ unstable :call Distribution("stable frozen unstable") amenu Changelog.Set\ &Urgency.&low :call Urgency("low") amenu Changelog.Set\ Urgency.&medium :call Urgency("medium") amenu Changelog.Set\ Urgency.&high :call Urgency("high") menu Changelog.-sep- amenu Changelog.U&nfinalise :call Unfinalise() amenu Changelog.&Finalise :call Finalise() if Finalised() call FinaliseMenu() else call UnfinaliseMenu() endif endfunction augroup changelogMenu au BufEnter * if &filetype == "debchangelog" | call MakeMenu() | endif au BufLeave * if &filetype == "debchangelog" | silent! aunmenu Changelog | endif augroup END " }}} " {{{1 folding " look for an author name in the [zonestart zoneend] lines searching backward function! s:getAuthor(zonestart, zoneend) let linepos = a:zoneend while linepos >= a:zonestart let line = getline(linepos) if line =~ '^ --' return substitute(line, '^ --\s*\([^<]\+\)\s*.*', '\1', '') endif let linepos -= 1 endwhile return '[unknown]' endfunction " Look for a package source name searching backward from the givenline and " returns it. Return the empty string if the package name can't be found function! DebGetPkgSrcName(lineno) let lineidx = a:lineno let pkgname = '' while lineidx > 0 let curline = getline(lineidx) if curline =~ '^\S' let pkgname = matchlist(curline, '^\(\S\+\).*$')[1] break endif let lineidx = lineidx - 1 endwhile return pkgname endfunction function! DebChangelogFoldText() if v:folddashes == '-' " changelog entry fold return foldtext() . ' -- ' . s:getAuthor(v:foldstart, v:foldend) . ' ' endif return foldtext() endfunction function! DebGetChangelogFold(lnum) let line = getline(a:lnum) if line =~ '^\w\+' return '>1' " beginning of a changelog entry endif if line =~ '^\s\+\[.*\]' return '>2' " beginning of an author-specific chunk endif if line =~ '^ --' return '1' endif return '=' endfunction if exists("g:debchangelog_fold_enable") silent! foldopen! " unfold the entry the cursor is on (usually the first one) endif " }}} " {{{1 omnicompletion for Closes: # if !exists('g:debchangelog_listbugs_severities') let g:debchangelog_listbugs_severities = 'critical,grave,serious,important,normal,minor,wishlist' endif fun! DebCompleteBugs(findstart, base) if a:findstart let line = getline('.') " try to detect whether this is closes: or lp: let g:debchangelog_complete_mode = 'debbugs' let try_colidx = col('.') - 1 let colidx = -1 " default to no-completion-possible while try_colidx > 0 && line[try_colidx - 1] =~ '\s\|\d\|#\|,\|:' let try_colidx = try_colidx - 1 if line[try_colidx] == '#' && colidx == -1 " found hash, where we complete from: let colidx = try_colidx elseif line[try_colidx] == ':' if try_colidx > 1 && strpart(line, try_colidx - 2, 3) =~ '\clp:' let g:debchangelog_complete_mode = 'lp' endif break endif endwhile return colidx else " return matches: let bug_lines = [] if g:debchangelog_complete_mode == 'lp' if ! has('python') echoerr 'vim must be built with Python support to use LP bug completion' return endif let pkgsrc = DebGetPkgSrcName(line('.')) python << EOF import vim try: from launchpadlib.launchpad import Launchpad from lazr.restfulclient.errors import HTTPError # login anonymously lp = Launchpad.login_anonymously('debchangelog.vim', 'production') ubuntu = lp.distributions['ubuntu'] try: sp = ubuntu.getSourcePackage(name=vim.eval('pkgsrc')) status = ('New', 'Incomplete', 'Confirmed', 'Triaged', 'In Progress', 'Fix Committed') tasklist = sp.searchTasks(status=status, order_by='id') liststr = '[' for task in tasklist: bug = task.bug liststr += "'#%d - %s'," % (bug.id, bug.title.replace('\'', '\'\'')) liststr += ']' vim.command('silent let bug_lines = %s' % liststr.encode('utf-8')) except HTTPError: pass except ImportError: vim.command('echoerr \'python-launchpadlib >= 1.5.4 needs to be installed to use Launchpad bug completion\'') EOF else if ! filereadable('/usr/sbin/apt-listbugs') echoerr 'apt-listbugs not found, you should install it to use Closes bug completion' return endif let pkgsrc = DebGetPkgSrcName(line('.')) let listbugs_output = system('/usr/sbin/apt-listbugs -s ' . g:debchangelog_listbugs_severities . ' list ' . pkgsrc . ' | grep "^ #" 2> /dev/null') let bug_lines = split(listbugs_output, '\n') endif let completions = [] for line in bug_lines let parts = matchlist(line, '^\s*\(#\S\+\)\s*-\s*\(.*\)$') " filter only those which match a:base: if parts[1] !~ "^" . a:base continue endif let completion = {} let completion['word'] = parts[1] let completion['menu'] = parts[2] let completion['info'] = parts[0] let completions += [completion] endfor return completions endif endfun setlocal omnifunc=DebCompleteBugs " }}} " vim: set foldmethod=marker: vim-7.4.1689/runtime/ftplugin/debcontrol.vim000066400000000000000000000035361267703067000207670ustar00rootroot00000000000000" Vim filetype plugin file (GUI menu and folding) " Language: Debian control files " Maintainer: Debian Vim Maintainers " Former Maintainer: Pierre Habouzit " Last Change: 2008-03-08 " URL: http://hg.debian.org/hg/pkg-vim/vim/raw-file/tip/runtime/ftplugin/debcontrol.vim " Do these settings once per buffer if exists("b:did_ftplugin") finish endif let b:did_ftplugin=1 " {{{1 Local settings (do on every load) if exists("g:debcontrol_fold_enable") setlocal foldmethod=expr setlocal foldexpr=DebControlFold(v:lnum) setlocal foldtext=DebControlFoldText() endif setlocal textwidth=0 " Clean unloading let b:undo_ftplugin = "setlocal tw< foldmethod< foldexpr< foldtext<" " }}}1 " {{{1 folding function! s:getField(f, lnum) let line = getline(a:lnum) let fwdsteps = 0 while line !~ '^'.a:f.':' let fwdsteps += 1 let line = getline(a:lnum + fwdsteps) if line == '' return 'unknown' endif endwhile return substitute(line, '^'.a:f.': *', '', '') endfunction function! DebControlFoldText() if v:folddashes == '-' " debcontrol entry fold let type = substitute(getline(v:foldstart), ':.*', '', '') if type == 'Source' let ftext = substitute(foldtext(), ' *Source: *', ' ', '') return ftext . ' -- ' . s:getField('Maintainer', v:foldstart) . ' ' endif let arch = s:getField('Architecture', v:foldstart) let ftext = substitute(foldtext(), ' *Package: *', ' [' . arch . '] ', '') return ftext . ': ' . s:getField('Description', v:foldstart) . ' ' endif return foldtext() endfunction function! DebControlFold(l) " This is for not merging blank lines around folds to them if getline(a:l) =~ '^Source:' return '>1' endif if getline(a:l) =~ '^Package:' return '>1' endif return '=' endfunction " }}}1 vim-7.4.1689/runtime/ftplugin/denyhosts.vim000066400000000000000000000005671267703067000206550ustar00rootroot00000000000000" Vim filetype plugin file " Maintainer: Nikolai Weibull " Latest Revision: 2007-12-04 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/dictconf.vim000066400000000000000000000006461267703067000204240ustar00rootroot00000000000000" Vim filetype plugin file " Language: dict(1) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/dictdconf.vim000066400000000000000000000006471267703067000205710ustar00rootroot00000000000000" Vim filetype plugin file " Language: dictd(8) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/diff.vim000066400000000000000000000005431267703067000175370ustar00rootroot00000000000000" Vim filetype plugin file " Language: Diff " Maintainer: Bram Moolenaar " Last Change: 2005 Jul 27 " 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<" " Don't use modelines in a diff, they apply to the diffed file setlocal nomodeline vim-7.4.1689/runtime/ftplugin/dircolors.vim000066400000000000000000000006431267703067000206300ustar00rootroot00000000000000" Vim filetype plugin file " Language: dircolors(1) input file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/docbk.vim000066400000000000000000000010221267703067000177020ustar00rootroot00000000000000" Vim filetype plugin file " Language: DocBook " Maintainer: Nikolai Weibull " Latest Revision: 2012-04-25 if exists('b:did_ftplugin') finish endif if !exists('b:docbk_type') if expand('%:e') == 'sgml' let b:docbk_type = 'sgml' else let b:docbk_type = 'xml' endif endif if b:docbk_type == 'sgml' runtime! ftplugin/sgml.vim ftplugin/sgml_*.vim ftplugin/sgml/*.vim else runtime! ftplugin/xml.vim ftplugin/xml_*.vim ftplugin/xml/*.vim endif let b:undo_ftplugin = "unlet! b:docbk_type" vim-7.4.1689/runtime/ftplugin/dockerfile.vim000066400000000000000000000005441267703067000207370ustar00rootroot00000000000000" Vim filetype plugin " Language: Dockerfile " Maintainer: Honza Pokorny " Last Change: 2014 Aug 29 " 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 commentstring<" setlocal commentstring=#\ %s vim-7.4.1689/runtime/ftplugin/dosbatch.vim000066400000000000000000000014111267703067000204110ustar00rootroot00000000000000" Vim filetype plugin file " Language: MS-DOS .bat files " Maintainer: Mike Williams " Last Change: 8th May 2012 " 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:cpo_save = &cpo set cpo&vim " BAT comment formatting setlocal comments=b:rem,b:@rem,b:REM,b:@REM,::: 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 let b:undo_ftplugin = "setlocal comments< formatoptions<" \ . "| unlet! b:browsefiler" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/dosini.vim000066400000000000000000000006761267703067000201230ustar00rootroot00000000000000" Vim filetype plugin file " Language: Configuration File (ini file) for MSDOS/MS Windows " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:; commentstring=;\ %s formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/dtd.vim000066400000000000000000000021431267703067000174000ustar00rootroot00000000000000" Vim filetype plugin file " Language: dtd " Maintainer: Dan Sharp " Last Changed: 20 Jan 2009 " URL: http://dwsharp.users.sourceforge.net/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= setlocal comments=s: setlocal formatoptions-=t if !exists("g:ft_dtd_autocomment") || (g:ft_dtd_autocomment == 1) setlocal formatoptions+=croql endif 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< comments< formatoptions<" . \ " | unlet! b:matchwords b:browsefilter" " Restore the saved compatibility options. let &cpo = s:save_cpo unlet s:save_cpo vim-7.4.1689/runtime/ftplugin/dtrace.vim000066400000000000000000000021771267703067000200760ustar00rootroot00000000000000" Language: D script as described in "Solaris Dynamic Tracing Guide", " http://docs.sun.com/app/docs/doc/817-6223 " Last Change: 2008/03/20 " Version: 1.2 " Maintainer: Nicolas Weber " 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 " Using line continuation here. let s:cpo_save = &cpo set cpo-=C let b:undo_ftplugin = "setl fo< com< cms< isk<" " Set 'formatoptions' to break comment lines but not other lines, " and insert the comment leader when hitting or using "o". setlocal fo-=t fo+=croql " Set 'comments' to format dashed lists in comments. setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/ " dtrace uses /* */ comments. Set this explicitly, just in case the user " changed this (/*%s*/ is the default) setlocal commentstring=/*%s*/ setlocal iskeyword+=@,$ " When the matchit plugin is loaded, this makes the % command skip parens and " braces in comments. let b:match_words = &matchpairs let b:match_skip = 's:comment\|string\|character' let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/eiffel.vim000066400000000000000000000077701267703067000200720ustar00rootroot00000000000000" Vim filetype plugin " Language: Eiffel " Maintainer: Doug Kearns " Last Change: 2010 Aug 29 if (exists("b:did_ftplugin")) finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim setlocal comments=:-- setlocal commentstring=--\ %s setlocal formatoptions-=t formatoptions+=croql if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") let b:browsefilter = "Eiffel Source Files (*.e)\t*.e\n" . \ "Eiffel Control Files (*.ecf, *.ace, *.xace)\t*.ecf;*.ace;*.xace\n" . \ "All Files (*.*)\t*.*\n" endif if exists("loaded_matchit") && !exists("b:match_words") let b:match_ignorecase = 0 " Silly \%^ trick to match note at head of pair and in middle prevents " 'g%' wrapping from 'note' to 'end' let b:match_words = '\%^:' . \ '\<\%(^note\|indexing\|class\|^obsolete\|inherit\|insert\|^create\|convert\|feature\|^invariant\)\>:' . \ '^end\>,' . \ '\<\%(do\|deferred\|external\|once\%(\s\+"\)\@!\|check\|debug\|if\|inspect\|from\|across\)\>:' . \ '\%(\%(^\s\+\)\@<=\%(then\|until\|loop\)\|\%(then\|until\|loop\)\s\+[^ -]\|' . \ '\<\%(ensure\%(\s\+then\)\=\|rescue\|_then\|elseif\|else\|when\|\s\@<=invariant\|_until\|_loop\|variant\|_as\|alias\)\>\):' . \ '\s\@<=end\>' let b:match_skip = 's:\' noremap [% noremap ]% vnoremap a% endif let b:undo_ftplugin = "setl fo< com< cms<" . \ "| unlet! b:browsefilter b:match_ignorecase b:match_words b:match_skip" if !exists("g:no_plugin_maps") && !exists("g:no_eiffel_maps") function! s:DoMotion(pattern, count, flags) abort normal! m' for i in range(a:count) call search(a:pattern, a:flags) endfor endfunction let sections = '^\%(note\|indexing\|' . \ '\%(\%(deferred\|expanded\|external\|frozen\)\s\+\)*class\|' . \ 'obsolete\|inherit\|insert\|create\|convert\|feature\|' . \ 'invariant\|end\)\>' nnoremap ]] :call DoMotion(sections, v:count1, 'W') xnoremap ]] :exe "normal! gv"call DoMotion(sections, v:count1, 'W') nnoremap [[ :call DoMotion(sections, v:count1, 'Wb') xnoremap [[ :exe "normal! gv"call DoMotion(sections, v:count1, 'Wb') function! s:DoFeatureMotion(count, flags) let view = winsaveview() call cursor(1, 1) let [features_start, _] = searchpos('^feature\>') call search('^\s\+\a') " find the first feature let spaces = indent(line('.')) let [features_end, _] = searchpos('^\%(invariant\|note\|end\)\>') call winrestview(view) call s:DoMotion('\%>' . features_start . 'l\%<' . features_end . 'l^\s*\%' . (spaces + 1) . 'v\zs\a', a:count, a:flags) endfunction nnoremap ]m :call DoFeatureMotion(v:count1, 'W') xnoremap ]m :exe "normal! gv"call DoFeatureMotion(v:count1, 'W') nnoremap [m :call DoFeatureMotion(v:count1, 'Wb') xnoremap [m :exe "normal! gv"call DoFeatureMotion(v:count1, 'Wb') let comment_block_start = '^\%(\s\+--.*\n\)\@ ]- :call DoMotion(comment_block_start, 1, 'W') xnoremap ]- :exe "normal! gv"call DoMotion(comment_block_start, 1, 'W') nnoremap [- :call DoMotion(comment_block_end, 1, 'Wb') xnoremap [- :exe "normal! gv"call DoMotion(comment_block_end, 1, 'Wb') let b:undo_ftplugin = b:undo_ftplugin . \ "| silent! execute 'unmap [[' | silent! execute 'unmap ]]'" . \ "| silent! execute 'unmap [m' | silent! execute 'unmap ]m'" . \ "| silent! execute 'unmap [-' | silent! execute 'unmap ]-'" endif let &cpo = s:cpo_save unlet s:cpo_save " vim: nowrap sw=2 sts=2 ts=8 vim-7.4.1689/runtime/ftplugin/elinks.vim000066400000000000000000000006501267703067000201130ustar00rootroot00000000000000" Vim filetype plugin file " Language: elinks(1) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/erlang.vim000066400000000000000000000034231267703067000200770ustar00rootroot00000000000000" Vim ftplugin file " Language: Erlang " Author: Oscar Hellstrm " Contributors: Ricardo Catalinas Jimnez " Eduardo Lopez (http://github.com/tapichu) " License: Vim license " Version: 2012/01/25 if exists('b:did_ftplugin') finish else let b:did_ftplugin = 1 endif if exists('s:did_function_definitions') call s:SetErlangOptions() finish else let s:did_function_definitions = 1 endif let s:cpo_save = &cpo set cpo&vim if !exists('g:erlang_keywordprg') let g:erlang_keywordprg = 'erl -man' endif if !exists('g:erlang_folding') let g:erlang_folding = 0 endif let s:erlang_fun_begin = '^\a\w*(.*$' let s:erlang_fun_end = '^[^%]*\.\s*\(%.*\)\?$' function s:SetErlangOptions() if g:erlang_folding setlocal foldmethod=expr setlocal foldexpr=GetErlangFold(v:lnum) setlocal foldtext=ErlangFoldText() endif setlocal comments=:%%%,:%%,:% setlocal commentstring=%%s setlocal formatoptions+=ro let &l:keywordprg = g:erlang_keywordprg endfunction function GetErlangFold(lnum) let lnum = a:lnum let line = getline(lnum) if line =~ s:erlang_fun_end return '<1' endif if line =~ s:erlang_fun_begin && foldlevel(lnum - 1) == 1 return '1' endif if line =~ s:erlang_fun_begin return '>1' endif return '=' endfunction function ErlangFoldText() let line = getline(v:foldstart) let foldlen = v:foldend - v:foldstart + 1 let lines = ' ' . foldlen . ' lines: ' . substitute(line, "[\ \t]*", '', '') if foldlen < 10 let lines = ' ' . lines endif let retval = '+' . v:folddashes . lines return retval endfunction call s:SetErlangOptions() let b:undo_ftplugin = "setlocal foldmethod< foldexpr< foldtext<" \ . " comments< commentstring< formatoptions<" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/eruby.vim000066400000000000000000000061161267703067000177570ustar00rootroot00000000000000" Vim filetype plugin " Language: eRuby " Maintainer: Tim Pope " URL: https://github.com/vim-ruby/vim-ruby " Release Coordinator: Doug Kearns " Only do this when not done yet for this buffer if exists("b:did_ftplugin") finish endif 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 = "All Files (*.*)\t*.*\n" let s:match_words = "" if !exists("g:eruby_default_subtype") let g:eruby_default_subtype = "html" endif if &filetype =~ '^eruby\.' let b:eruby_subtype = matchstr(&filetype,'^eruby\.\zs\w\+') elseif !exists("b:eruby_subtype") let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$") let b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+') if b:eruby_subtype == '' let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\|\.erubis\)\+$','',''),'\.\zs\w\+$') endif if b:eruby_subtype == 'rhtml' let b:eruby_subtype = 'html' elseif b:eruby_subtype == 'rb' let b:eruby_subtype = 'ruby' elseif b:eruby_subtype == 'yml' let b:eruby_subtype = 'yaml' elseif b:eruby_subtype == 'js' let b:eruby_subtype = 'javascript' elseif b:eruby_subtype == 'txt' " Conventional; not a real file type let b:eruby_subtype = 'text' elseif b:eruby_subtype == '' let b:eruby_subtype = g:eruby_default_subtype endif endif if exists("b:eruby_subtype") && b:eruby_subtype != '' exe "runtime! ftplugin/".b:eruby_subtype.".vim ftplugin/".b:eruby_subtype."_*.vim ftplugin/".b:eruby_subtype."/*.vim" else runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim endif 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/ruby.vim ftplugin/ruby_*.vim ftplugin/ruby/*.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 = substitute(b:browsefilter,'\cAll Files (\*\.\*)\t\*\.\*\n','','') . s:browsefilter endif if exists("b:match_words") let s:match_words = b:match_words . ',' . s:match_words endif " Change the browse dialog on Win32 to show mainly eRuby-related files if has("gui_win32") let b:browsefilter="eRuby Files (*.erb, *.rhtml)\t*.erb;*.rhtml\n" . s:browsefilter endif " Load the combined list of match_words for matchit.vim if exists("loaded_matchit") let b:match_words = s:match_words endif " TODO: comments= setlocal commentstring=<%#%s%> let b:undo_ftplugin = "setl cms< " \ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin let &cpo = s:save_cpo unlet s:save_cpo " vim: nowrap sw=2 sts=2 ts=8: vim-7.4.1689/runtime/ftplugin/eterm.vim000066400000000000000000000007121267703067000177410ustar00rootroot00000000000000" Vim filetype plugin file " Language: eterm(1) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< inc< fo<" setlocal comments=:# commentstring=#\ %s include=^\\s*include setlocal formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/falcon.vim000066400000000000000000000025001267703067000200640ustar00rootroot00000000000000" Vim filetype plugin file " Language: Falcon " Author: Steven Oliver " Copyright: Copyright (c) 2009-2013 Steven Oliver " License: You may redistribute this under the same terms as Vim itself " -------------------------------------------------------------------------- " Only do this when not done yet for this buffer if (exists("b:did_ftplugin")) finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim setlocal softtabstop=4 shiftwidth=4 fileencoding=utf-8 setlocal suffixesadd=.fal,.ftd " Matchit support if exists("loaded_matchit") && !exists("b:match_words") let b:match_ignorecase = 0 let b:match_words = \ '\<\%(if\|case\|while\|until\|for\|do\|class\)\>=\@!' . \ ':' . \ '\<\%(else\|elsif\|when\)\>' . \ ':' . \ '\' . \ ',{:},\[:\],(:)' endif setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:// " Windows allows you to filter the open file dialog if has("gui_win32") && !exists("b:browsefilter") let b:browsefilter = "Falcon Source Files (*.fal *.ftd)\t*.fal;*.ftd\n" . \ "All Files (*.*)\t*.*\n" endif let b:undo_ftplugin = "setlocal tabstop< shiftwidth< expandtab< fileencoding<" \ . " suffixesadd< comments<" \ . "| unlet! b:browsefiler" let &cpo = s:cpo_save unlet s:cpo_save " vim: set sw=4 sts=4 et tw=80 : vim-7.4.1689/runtime/ftplugin/fetchmail.vim000066400000000000000000000006401267703067000205610ustar00rootroot00000000000000" Vim filetype plugin file " Language: fetchmail(1) RC File " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/flexwiki.vim000066400000000000000000000035241267703067000204530ustar00rootroot00000000000000" Vim filetype plugin file " Language: FlexWiki, http://www.flexwiki.com/ " Maintainer: George V. Reilly " Home: http://www.georgevreilly.com/vim/flexwiki/ " Other Home: http://www.vim.org/scripts/script.php?script_id=1529 " Author: George V. Reilly " Filenames: *.wiki " Last Change: Wed Apr 26 11:00 PM 2006 P " Version: 0.3 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 " Don't load another plugin for this buffer " Reset the following options to undo this plugin. let b:undo_ftplugin = "setl tw< wrap< lbr< et< ts< fenc< bomb< ff<" " Allow lines of unlimited length. Do NOT want automatic linebreaks, " as a newline starts a new paragraph in FlexWiki. setlocal textwidth=0 " Wrap long lines, rather than using horizontal scrolling. setlocal wrap " Wrap at a character in 'breakat' rather than at last char on screen setlocal linebreak " Don't transform characters into spaces, as they are significant " at the beginning of the line for numbered and bulleted lists. setlocal noexpandtab " 4-char tabstops, per flexwiki.el setlocal tabstop=4 " Save *.wiki files in UTF-8 setlocal fileencoding=utf-8 " Add the UTF-8 Byte Order Mark to the beginning of the file setlocal bomb " Save s as \n, not \r\n setlocal fileformat=unix if exists("g:flexwiki_maps") " Move up and down by display lines, to account for screen wrapping " of very long lines nmap gk nmap k gk vmap gk vmap k gk nmap gj nmap j gj vmap gj vmap j gj " for earlier versions - for when 'wrap' is set imap gj imap gk if v:version >= 700 imap gj imap gk endif endif vim-7.4.1689/runtime/ftplugin/fortran.vim000066400000000000000000000111241267703067000202770ustar00rootroot00000000000000" Vim settings file " Language: Fortran 2008 (and older: Fortran 2003, 95, 90, 77, 66) " Version: 0.50 " Last Change: 2015 Nov. 30 " Maintainer: Ajit J. Thakkar ; " Usage: For instructions, do :help fortran-plugin from Vim " Credits: " Useful suggestions were made by Stefano Zacchiroli, Hendrik Merx, Ben " Fritz, and David Barnett. " Only do these settings when not done yet for this buffer if exists("b:did_ftplugin") finish endif let s:cposet=&cpoptions set cpoptions&vim " 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 using the priority: " buffer-local value " > global value " > file extension as in Intel ifort, gcc (gfortran), NAG, Pathscale, and Cray compilers 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 elseif expand("%:e") ==? "f\<90\|95\|03\|08\>" " Free-form file extension defaults as in Intel ifort, gcc(gfortran), NAG, Pathscale, and Cray compilers let b:fortran_fixed_source = 0 elseif expand("%:e") ==? "f\|f77\|for" " Fixed-form file extension defaults let b:fortran_fixed_source = 1 else " Modern fortran still allows 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 s: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 s:lmax = 500 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 !~ '^[Cc*]' && s:test !~ '^ *[!#]' && s:test =~ '[^ 0-9\t]' && s:test !~ '^[ 0-9]*\t' let b:fortran_fixed_source = 0 break endif let s:ln = s:ln + 1 endwhile unlet! s:lmax s:ln s:test 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 setlocal tw=132 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 text lines setlocal fo+=t setlocal include=^\\c#\\=\\s*include\\s\\+ setlocal suffixesadd+=.f08,.f03,.f95,.f90,.for,.f,.F,.f77,.ftn,.fpp " Define patterns for the matchit plugin if !exists("b:match_words") let s:notend = '\%(\:' . s:notselect. '\:\,' . \ s:notelse . '\:' . \ '\:\,'. \ 'do\s\+\(\d\+\):\%(^\s*\)\@<=\1\s,'. \ s:notend . '\:\,'. \ s:notelse . '\:\:\,'. \ s:notend . '\,'. \ s:notend . '\:\,'. \ s:notend . '\:\,'. \ s:notend . '\:\,'. \ s:notend . '\:\,'. \ s:notend . '\:\,'. \ s:notend . '\:\,'. \ s:notend . '\' . s:notprocedure . ':\,'. \ s:notend . '\:\' endif " File filters for :browse e if has("gui_win32") && !exists("b:browsefilter") let b:browsefilter = "Fortran Files (*.f;*.for;*.f77;*.f90;*.f95;*.f03;*.f08;*.fpp;*.ftn)\t*.f;*.for;*.f77;*.f90;*.f95;*.f03;*.f08;*.fpp;*.ftn\n" . \ "All Files (*.*)\t*.*\n" endif let b:undo_ftplugin = "setl fo< com< tw< cms< et< inc< sua<" \ . "| unlet! b:match_ignorecase b:match_words b:browsefilter" let &cpoptions=s:cposet unlet s:cposet " vim:sw=2 vim-7.4.1689/runtime/ftplugin/framescript.vim000066400000000000000000000014001267703067000211370ustar00rootroot00000000000000" Vim ftplugin file " Language: FrameScript " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-19 let s:cpo_save = &cpo set cpo&vim if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let b:undo_ftplugin = "setl com< cms< fo< inc< | unlet! b:matchwords" setlocal comments=s1:/*,mb:*,ex:*/,:// commentstring=/*\ %s\ */ setlocal formatoptions-=t formatoptions+=croql setlocal include=^\\s*<#Include if exists("loaded_matchit") let s:not_end = '\c\%(\:\c\:\c\:\c\,' . \ s:not_end . '\:\c\' . \ s:not_end . '\:\c\' unlet s:not_end endif let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/fvwm.vim000066400000000000000000000006061267703067000176060ustar00rootroot00000000000000" Created : Tue 09 May 2006 02:07:31 PM CDT " Modified : Tue 09 May 2006 02:07:31 PM CDT " Author : Gautam Iyer " Description : ftplugin for fvwm config files if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s setlocal formatoptions-=t formatoptions+=croql vim-7.4.1689/runtime/ftplugin/git.vim000066400000000000000000000023021267703067000174050ustar00rootroot00000000000000" Vim filetype plugin " Language: generic git output " Maintainer: Tim Pope " Last Change: 2013 May 30 " Only do this when not done yet for this buffer if (exists("b:did_ftplugin")) finish endif let b:did_ftplugin = 1 if !exists('b:git_dir') if expand('%:p') =~# '[\/]\.git[\/]modules[\/]' " Stay out of the way elseif expand('%:p') =~# '\.git\>' let b:git_dir = matchstr(expand('%:p'),'.*\.git\>') elseif $GIT_DIR != '' let b:git_dir = $GIT_DIR endif if (has('win32') || has('win64')) && exists('b:git_dir') let b:git_dir = substitute(b:git_dir,'\\','/','g') endif endif if exists('*shellescape') && exists('b:git_dir') && b:git_dir != '' if b:git_dir =~# '/\.git$' " Not a bare repository let &l:path = escape(fnamemodify(b:git_dir,':h'),'\, ').','.&l:path endif let &l:path = escape(b:git_dir,'\, ').','.&l:path let &l:keywordprg = 'git --git-dir='.shellescape(b:git_dir).' show' else setlocal keywordprg=git\ show endif if has('gui_running') let &l:keywordprg = substitute(&l:keywordprg,'^git\>','git --no-pager','') endif setlocal includeexpr=substitute(v:fname,'^[^/]\\+/','','') let b:undo_ftplugin = "setl keywordprg< path< includeexpr<" vim-7.4.1689/runtime/ftplugin/gitcommit.vim000066400000000000000000000042451267703067000206260ustar00rootroot00000000000000" Vim filetype plugin " Language: git commit file " Maintainer: Tim Pope " Last Change: 2013 May 30 " Only do this when not done yet for this buffer if (exists("b:did_ftplugin")) finish endif runtime! ftplugin/git.vim let b:did_ftplugin = 1 setlocal nomodeline tabstop=8 formatoptions-=croq formatoptions+=tl let b:undo_ftplugin = 'setl modeline< tabstop< formatoptions<' if &textwidth == 0 " make sure that log messages play nice with git-log on standard terminals setlocal textwidth=72 let b:undo_ftplugin .= "|setl tw<" endif if exists("g:no_gitcommit_commands") || v:version < 700 finish endif if !exists("b:git_dir") let b:git_dir = expand("%:p:h") endif command! -bang -bar -buffer -complete=custom,s:diffcomplete -nargs=* DiffGitCached :call s:gitdiffcached(0,b:git_dir,) function! s:diffcomplete(A,L,P) let args = "" if a:P <= match(a:L." -- "," -- ")+3 let args = args . "-p\n--stat\n--shortstat\n--summary\n--patch-with-stat\n--no-renames\n-B\n-M\n-C\n" end if exists("b:git_dir") && a:A !~ '^-' let tree = fnamemodify(b:git_dir,':h') if strpart(getcwd(),0,strlen(tree)) == tree let args = args."\n".system("git diff --cached --name-only") endif endif return args endfunction function! s:gitdiffcached(bang,gitdir,...) let tree = fnamemodify(a:gitdir,':h') let name = tempname() let git = "git" if strpart(getcwd(),0,strlen(tree)) != tree let git .= " --git-dir=".(exists("*shellescape") ? shellescape(a:gitdir) : '"'.a:gitdir.'"') endif if a:0 let extra = join(map(copy(a:000),exists("*shellescape") ? 'shellescape(v:val)' : "'\"'.v:val.'\"'")) else let extra = "-p --stat=".&columns endif call system(git." diff --cached --no-color --no-ext-diff ".extra." > ".(exists("*shellescape") ? shellescape(name) : name)) exe "pedit ".(exists("*fnameescape") ? fnameescape(name) : name) wincmd P let b:git_dir = a:gitdir command! -bang -bar -buffer -complete=custom,s:diffcomplete -nargs=* DiffGitCached :call s:gitdiffcached(0,b:git_dir,) nnoremap q :q setlocal buftype=nowrite nobuflisted noswapfile nomodifiable filetype=git endfunction vim-7.4.1689/runtime/ftplugin/gitconfig.vim000066400000000000000000000005701267703067000206000ustar00rootroot00000000000000" Vim filetype plugin " Language: git config file " Maintainer: Tim Pope " Last Change: 2009 Dec 24 " Only do this when not done yet for this buffer if (exists("b:did_ftplugin")) finish endif let b:did_ftplugin = 1 setlocal formatoptions-=t formatoptions+=croql setlocal comments=:#,:; commentstring=;\ %s let b:undo_ftplugin = "setl fo< com< cms<" vim-7.4.1689/runtime/ftplugin/gitrebase.vim000066400000000000000000000026321267703067000205750ustar00rootroot00000000000000" Vim filetype plugin " Language: git rebase --interactive " Maintainer: Tim Pope " Last Change: 2010 May 21 " Only do this when not done yet for this buffer if (exists("b:did_ftplugin")) finish endif runtime! ftplugin/git.vim let b:did_ftplugin = 1 setlocal comments=:# commentstring=#\ %s formatoptions-=t if !exists("b:undo_ftplugin") let b:undo_ftplugin = "" endif let b:undo_ftplugin = b:undo_ftplugin."|setl com< cms< fo<" function! s:choose(word) s/^\(\w\+\>\)\=\(\s*\)\ze\x\{4,40\}\>/\=(strlen(submatch(1)) == 1 ? a:word[0] : a:word) . substitute(submatch(2),'^$',' ','')/e endfunction function! s:cycle() call s:choose(get({'s':'edit','p':'squash','e':'reword','r':'fixup'},getline('.')[0],'pick')) endfunction command! -buffer -bar Pick :call s:choose('pick') command! -buffer -bar Squash :call s:choose('squash') command! -buffer -bar Edit :call s:choose('edit') command! -buffer -bar Reword :call s:choose('reword') command! -buffer -bar Fixup :call s:choose('fixup') command! -buffer -bar Cycle :call s:cycle() " The above are more useful when they are mapped; for example: "nnoremap S :Cycle if exists("g:no_plugin_maps") || exists("g:no_gitrebase_maps") finish endif nnoremap K col('.') < 7 && expand('cword>') =~ '\X' && getline('.') =~ '^\w\+\s\+\x\+\>' ? 'wK' : 'K' let b:undo_ftplugin = b:undo_ftplugin . "|nunmap K" vim-7.4.1689/runtime/ftplugin/gitsendemail.vim000066400000000000000000000002351267703067000212720ustar00rootroot00000000000000" Vim filetype plugin " Language: git send-email message " Maintainer: Tim Pope " Last Change: 2009 Dec 24 runtime! ftplugin/mail.vim vim-7.4.1689/runtime/ftplugin/go.vim000066400000000000000000000005551267703067000172370ustar00rootroot00000000000000" Vim filetype plugin file " Language: Go " Maintainer: David Barnett (https://github.com/google/vim-ft-go) " Last Change: 2014 Aug 16 if exists('b:did_ftplugin') finish endif let b:did_ftplugin = 1 setlocal formatoptions-=t setlocal comments=s1:/*,mb:*,ex:*/,:// setlocal commentstring=//\ %s let b:undo_ftplugin = 'setl fo< com< cms<' " vim: sw=2 sts=2 et vim-7.4.1689/runtime/ftplugin/gpg.vim000066400000000000000000000006451267703067000174070ustar00rootroot00000000000000" Vim filetype plugin file " Language: gpg(1) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/gprof.vim000066400000000000000000000016531267703067000177470ustar00rootroot00000000000000" Language: gprof " Maintainer: Dominique Pelle " Last Change: 2013 Jun 09 " When cursor is on one line of the gprof call graph, " calling this function jumps to this function in the call graph. if exists("b:did_ftplugin") finish endif let b:did_ftplugin=1 fun! GprofJumpToFunctionIndex() let l:line = getline('.') if l:line =~ '[\d\+\]$' " We're in a line in the call graph. norm! $y% call search('^' . escape(@", '[]'), 'sw') norm! zz elseif l:line =~ '^\(\s\+[0-9\.]\+\)\{3}\s\+' " We're in line in the flat profile. norm! 55|eby$ call search('^\[\d\+\].*\d\s\+' . escape(@", '[]*.') . '\>', 'sW') norm! zz endif endfun " Pressing on a line in the gprof flat profile or in " the call graph, jumps to the corresponding function inside " the flat profile. map :call GprofJumpToFunctionIndex() " vim:sw=2 fdm=indent vim-7.4.1689/runtime/ftplugin/group.vim000066400000000000000000000006351267703067000177650ustar00rootroot00000000000000" Vim filetype plugin file " Language: group(5) user group file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments= commentstring= formatoptions-=tcroq formatoptions+=l let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/grub.vim000066400000000000000000000006461267703067000175720ustar00rootroot00000000000000" Vim filetype plugin file " Language: grub(8) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/haml.vim000066400000000000000000000035371267703067000175560ustar00rootroot00000000000000" Vim filetype plugin " Language: Haml " Maintainer: Tim Pope " Last Change: 2013 Jun 01 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") finish endif 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 = "All Files (*.*)\t*.*\n" let s:match_words = "" runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim unlet! b:did_ftplugin set matchpairs-=<:> " 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/ruby.vim ftplugin/ruby_*.vim ftplugin/ruby/*.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 = substitute(b:browsefilter,'\cAll Files (\*\.\*)\t\*\.\*\n','','') . s:browsefilter endif if exists("b:match_words") let s:match_words = b:match_words . ',' . s:match_words endif " Change the browse dialog on Win32 to show mainly Haml-related files if has("gui_win32") let b:browsefilter="Haml Files (*.haml)\t*.haml\nSass Files (*.sass)\t*.sass\n" . s:browsefilter endif " Load the combined list of match_words for matchit.vim if exists("loaded_matchit") let b:match_words = s:match_words endif setlocal comments= commentstring=-#\ %s let b:undo_ftplugin = "setl cms< com< " \ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin let &cpo = s:save_cpo unlet s:save_cpo " vim:set sw=2: vim-7.4.1689/runtime/ftplugin/hamster.vim000066400000000000000000000036031267703067000202720ustar00rootroot00000000000000" Vim filetype plugin " Language: Hamster Script " Version: 2.0.6.0 " Maintainer: David Fishburn " Last Change: Wed Nov 08 2006 12:03:09 PM " 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: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 or using "o". setlocal fo-=t fo+=croql " Use the # sign for comments setlocal comments=:# " 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 [[ :call search('^\s*sub\>', "bW") noremap ]] :call search('^\s*sub\>', "W") noremap [] :call search('^\s*endsub\>', "bW") noremap ][ :call search('^\s*endsub\>', "W") " Move around comments noremap ]# :call search('^\s*#\@!', "W") noremap [# :call search('^\s*#\@!', "bW") " Let the matchit plugin know what items can be matched. if exists("loaded_matchit") let b:match_ignorecase = 0 let b:match_words = \ '\:\:\,' . \ '\:\:\:\,' . \ '\:\:\' " 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 setlocal ignorecase let &cpo = s:cpo_save unlet s:cpo_save setlocal cpo+=M " makes \%( match \) vim-7.4.1689/runtime/ftplugin/haskell.vim000066400000000000000000000006611267703067000202530ustar00rootroot00000000000000" Vim filetype plugin file " Language: Haskell " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=s1fl:{-,mb:-,ex:-},:-- commentstring=--\ %s setlocal formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/help.vim000066400000000000000000000006561267703067000175640ustar00rootroot00000000000000" Vim filetype plugin file " Language: Vim help file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl fo< tw< cole< cocu<" setlocal formatoptions+=tcroql textwidth=78 if has("conceal") setlocal cole=2 cocu=nc endif let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/hgcommit.vim000066400000000000000000000005531267703067000204370ustar00rootroot00000000000000" Vim filetype plugin file " Language: hg (Mercurial) commit file " Maintainer: Ken Takata " Last Change: 2016 Jan 6 " Filenames: hg-editor-*.txt " License: VIM License " URL: https://github.com/k-takata/hg-vim if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 setlocal nomodeline let b:undo_ftplugin = 'setl modeline<' vim-7.4.1689/runtime/ftplugin/hog.vim000066400000000000000000000025621267703067000174070ustar00rootroot00000000000000" Vim filetype plugin " Language: hog (snort.conf) " Maintainer: . Victor Roemer, . " Last Change: Mar 1, 2013 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:undo_ftplugin = "setl fo< com< cms< def< inc<" let s:cpo_save = &cpo set cpo&vim setlocal formatoptions=croq setlocal comments=:# setlocal commentstring=\c#\ %s setlocal define=\c^\s\{-}var setlocal include=\c^\s\{-}include " Move around configurations let s:hog_keyword_match = '\c^\s*\<\(preprocessor\\|config\\|output\\|include\\|ipvar\\|portvar\\|var\\|dynamicpreprocessor\\|' . \ 'dynamicengine\\|dynamicdetection\\|activate\\|alert\\|drop\\|block\\|dynamic\\|log\\|pass\\|reject\\|sdrop\\|sblock\)\>' exec "nnoremap ]] :call search('" . s:hog_keyword_match . "', 'W' )" exec "nnoremap [[ :call search('" . s:hog_keyword_match . "', 'bW' )" if exists("loaded_matchit") let b:match_words = \ '^\s*\<\%(preprocessor\|config\|output\|include\|ipvar\|portvar' . \ '\|var\|dynamicpreprocessor\|dynamicengine\|dynamicdetection' . \ '\|activate\|alert\|drop\|block\|dynamic\|log\|pass\|reject' . \ '\|sdrop\|sblock\>\):$,\::\,:;' let b:match_skip = 'r:\\.\{-}$\|^\s*#.\{-}$\|^\s*$' endif let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/hostconf.vim000066400000000000000000000005671267703067000204600ustar00rootroot00000000000000" Vim filetype plugin file " Maintainer: Nikolai Weibull " Latest Revision: 2007-12-04 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/hostsaccess.vim000066400000000000000000000006501267703067000211500ustar00rootroot00000000000000" Vim filetype plugin file " Language: hosts_access(5) control file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/html.vim000066400000000000000000000031311267703067000175670ustar00rootroot00000000000000" Vim filetype plugin file " Language: html " Maintainer: Dan Sharp " Last Changed: 20 Jan 2009 " URL: http://dwsharp.users.sourceforge.net/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 matchpairs+=<:> setlocal commentstring= setlocal comments=s: if exists("g:ft_html_autocomment") && (g:ft_html_autocomment == 1) setlocal formatoptions-=t formatoptions+=croql endif if exists('&omnifunc') setlocal omnifunc=htmlcomplete#CompleteTags call htmlcomplete#DetectOmniFlavor() endif " HTML: thanks to Johannes Zellner and Benji Fisher. if exists("loaded_matchit") let b:match_ignorecase = 1 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;*.html\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< matchpairs< omnifunc< comments< formatoptions<" . \ " | unlet! b:match_ignorecase b:match_skip b:match_words b:browsefilter" " Restore the saved compatibility options. let &cpo = s:save_cpo unlet s:save_cpo vim-7.4.1689/runtime/ftplugin/htmldjango.vim000066400000000000000000000005131267703067000207530ustar00rootroot00000000000000" Vim filetype plugin file " Language: Django HTML template " Maintainer: Dave Hodder " Last Change: 2007 Jan 25 " Only use this filetype plugin when no other was loaded. if exists("b:did_ftplugin") finish endif " Use HTML and Django template ftplugins. runtime! ftplugin/html.vim runtime! ftplugin/django.vim vim-7.4.1689/runtime/ftplugin/indent.vim000066400000000000000000000006721267703067000201130ustar00rootroot00000000000000" Vim filetype plugin file " Language: indent(1) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=s1:/*,mb:*,ex:*/ commentstring& setlocal formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/initex.vim000066400000000000000000000017551267703067000201350ustar00rootroot00000000000000" filetype plugin for TeX and variants " Language: TeX (ft=initex) " Maintainer: Benji Fisher, Ph.D. " Version: 1.0 " Last Change: Wed 19 Apr 2006 " 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 " Avoid problems if running in 'compatible' mode. let s:save_cpo = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< define< include< sua<" " 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: let &l:define='\\\([egx]\|char\|mathchar\|count\|dimen\|muskip\|skip\|toks\)\=' \ . 'def\|\\font\|\\\(future\)\=let' " Tell Vim to recognize \input bar : let &l:include = '\\input' setlocal suffixesadd=.tex let &cpo = s:save_cpo unlet s:save_cpo " vim:sts=2:sw=2: vim-7.4.1689/runtime/ftplugin/ishd.vim000066400000000000000000000023601267703067000175550ustar00rootroot00000000000000" Vim filetype plugin file " Language: InstallShield (ft=ishd) " Maintainer: Johannes Zellner " Last Change: Sat, 24 May 2003 11:55:36 CEST if exists("b:did_ftplugin") | finish | endif let b:did_ftplugin = 1 setlocal foldmethod=syntax " Using line continuation here. let s:cpo_save = &cpo set cpo-=C " matchit support if exists("loaded_matchit") let b:match_ignorecase=0 let b:match_words= \ '\%(^\s*\)\@<=\\s\+[^()]\+\s*(:\%(^\s*\)\@<=\\s*$:\%(^\s*\)\@<=\:\%(^\s*\)\@<=\\s*;\s*$,' . \ '\%(^\s*\)\@<=\\s*$:\%(^\s*\)\@<=\\s\+.\{-}\s*;\s*$,' . \ '\%(^\s*\)\@<=\\s*(.\{-}):\%(^\s*\)\@<=\<\%(case\|default\)\>:\%(^\s*\)\@<=\\s*;\s*$,' . \ '\%(^\s*\)\@<=\\s*(.\{-}):\%(^\s*\)\@<=\\s*;\s*$,' . \ '\%(^\s*\)\@<=\.\{-}\<\%(to\|downto\)\>:\%(^\s*\)\@<=\\s*;\s*$,' . \ '\%(^\s*\)\@<=\\s*(.\{-})\s*then:\%(^\s*\)\@<=\\s*([^)]*)\s*then:\%(^\s*\)\@<=\:\%(^\s*\)\@<=\\s*;\s*$' endif if has("gui_win32") && !exists("b:browsefilter") let b:browsefilter = "InstallShield Files (*.rul)\t*.rul\n" . \ "All Files (*.*)\t*.*\n" endif let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/j.vim000066400000000000000000000065021267703067000170610ustar00rootroot00000000000000" Vim filetype plugin " Language: J " Maintainer: David Bürgin <676c7473@gmail.com> " URL: https://github.com/glts/vim-j " Last Change: 2015-09-27 if exists('b:did_ftplugin') finish endif let b:did_ftplugin = 1 let s:save_cpo = &cpo set cpo&vim setlocal iskeyword=48-57,A-Z,a-z,_ setlocal comments=:NB. setlocal commentstring=NB.\ %s setlocal formatoptions-=t setlocal matchpairs=(:) setlocal path-=/usr/include " Includes. To make the shorthand form "require 'web/cgi'" work, double the " last path component. Also strip off leading folder names like "~addons/". setlocal include=\\v^\\s*(load\|require)\\s*'\\zs\\f+\\ze' setlocal includeexpr=substitute(substitute(tr(v:fname,'\\','/'),'\\v^[^~][^/.]*(/[^/.]+)$','&\\1',''),'\\v^\\~[^/]+/','','') setlocal suffixesadd=.ijs let b:undo_ftplugin = 'setlocal matchpairs< formatoptions< commentstring< comments< iskeyword< path< include< includeexpr< suffixesadd<' " Section movement with ]] ][ [[ []. The start/end patterns below are amended " inside the function in order to avoid matching on the current cursor line. let s:sectionstart = '\%(\s*Note\|.\{-}\<\%([0-4]\|13\|noun\|adverb\|conjunction\|verb\|monad\|dyad\)\s\+\%(:\s*0\|def\s\+0\|define\)\)\>.*' let s:sectionend = '\s*)\s*' function! s:SearchSection(end, backwards, visualmode) abort if a:visualmode !=# '' normal! gv endif let l:flags = a:backwards ? 'bsW' : 'sW' if a:end call search('^' . s:sectionend . (a:backwards ? '\n\_.\{-}\%#' : '$'), l:flags) else call search('^' . s:sectionstart . (a:backwards ? '\n\_.\{-}\%#' : '$'), l:flags) endif endfunction noremap ]] :call SearchSection(0, 0, '') xnoremap ]] :call SearchSection(0, 0, visualmode()) sunmap ]] noremap ][ :call SearchSection(1, 0, '') xnoremap ][ :call SearchSection(1, 0, visualmode()) sunmap ][ noremap [[ :call SearchSection(0, 1, '') xnoremap [[ :call SearchSection(0, 1, visualmode()) sunmap [[ noremap [] :call SearchSection(1, 1, '') xnoremap [] :call SearchSection(1, 1, visualmode()) sunmap [] let b:undo_ftplugin .= ' | silent! execute "unmap ]]"' \ . ' | silent! execute "unmap ]["' \ . ' | silent! execute "unmap [["' \ . ' | silent! execute "unmap []"' " Browse dialog filter on Windows (see ":help browsefilter") if has('gui_win32') && !exists('b:browsefilter') let b:browsefilter = "J Script Files (*.ijs)\t*.ijs\n" \ . "All Files (*.*)\t*.*\n" let b:undo_ftplugin .= ' | unlet! b:browsefilter' endif " Enhanced "%" matching (see ":help matchit") if exists('loaded_matchit') && !exists('b:match_words') let b:match_ignorecase = 0 let b:match_words = '^\%(\s*Note\|.\{-}\<\%([0-4]\|13\|noun\|adverb\|conjunction\|verb\|monad\|dyad\)\s\+\%(\:\s*0\|def\s\+0\|define\)\)\>:^\s*\:\s*$:^\s*)\s*$' \ . ',\<\%(for\%(_\a\k*\)\=\|if\|select\|try\|whil\%(e\|st\)\)\.:\<\%(case\|catch[dt]\=\|else\%(if\)\=\|fcase\)\.:\ " Last Change: 2012 Mar 11 " URL: http://dwsharp.users.sourceforge.net/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 " 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 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 suffixes< suffixesadd<" . \ " formatoptions< comments< commentstring< path< includeexpr<" . \ " | unlet! b:browsefilter" " Restore the saved compatibility options. let &cpo = s:save_cpo unlet s:save_cpo vim-7.4.1689/runtime/ftplugin/javascript.vim000066400000000000000000000020271267703067000207740ustar00rootroot00000000000000" Vim filetype plugin file " Language: Javascript " Maintainer: Doug Kearns " Last Change: 2008 Jun 15 " URL: http://gus.gscit.monash.edu.au/~djkea2/vim/ftplugin/javascript.vim if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo-=C " Set 'formatoptions' to break comment lines but not other lines, " " and insert the comment leader when hitting or using "o". setlocal formatoptions-=t formatoptions+=croql " Set completion with CTRL-X CTRL-O to autoloaded function. if exists('&ofu') setlocal omnifunc=javascriptcomplete#CompleteJS endif " Set 'comments' to format dashed lists in comments. setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:// setlocal commentstring=//%s " Change the :browse e filter to primarily show Java-related files. if has("gui_win32") let b:browsefilter="Javascript Files (*.js)\t*.js\n" . \ "All Files (*.*)\t*.*\n" endif let b:undo_ftplugin = "setl fo< ofu< com< cms<" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/jproperties.vim000066400000000000000000000005011267703067000211670ustar00rootroot00000000000000" Vim filetype plugin " Language: Java properties file " Maintainer: David Bürgin <676c7473@gmail.com> " Last Change: 2013-11-19 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 setlocal formatoptions-=t setlocal comments=:#,:! setlocal commentstring=#\ %s let b:undo_ftplugin = "setl cms< com< fo<" vim-7.4.1689/runtime/ftplugin/json.vim000066400000000000000000000005501267703067000175760ustar00rootroot00000000000000" Vim filetype plugin " Language: JSON " Maintainer: David Barnett " Last Change: 2014 Jul 16 if exists('b:did_ftplugin') finish endif let b:did_ftplugin = 1 let b:undo_ftplugin = 'setlocal formatoptions< comments< commentstring<' setlocal formatoptions-=t " JSON has no comments. setlocal comments= setlocal commentstring= vim-7.4.1689/runtime/ftplugin/jsp.vim000066400000000000000000000037331267703067000174270ustar00rootroot00000000000000" Vim filetype plugin file " Language: jsp " Maintainer: Dan Sharp " Last Changed: 20 Jan 2009 " URL: http://dwsharp.users.sourceforge.net/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*.html;*.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: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 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 unlet s:save_cpo vim-7.4.1689/runtime/ftplugin/kconfig.vim000066400000000000000000000012771267703067000202540ustar00rootroot00000000000000" Vim filetype plugin file " Vim syntax file " Maintainer: Christian Brabandt " Previous Maintainer: Nikolai Weibull " Latest Revision: 2015-05-29 " License: Vim (see :h license) " Repository: https://github.com/chrisbra/vim-kconfig if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql " For matchit.vim if exists("loaded_matchit") let b:match_words = '^\:\,^\:\,^\:\' endif let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/kwt.vim000066400000000000000000000015231267703067000174330ustar00rootroot00000000000000" Vim filetype plugin file " Language: Kimwitu++ " Maintainer: Michael Piefel " Last Change: 10 March 2012 " Behaves almost like C++ runtime! ftplugin/cpp.vim ftplugin/cpp_*.vim ftplugin/cpp/*.vim let s:cpo_save = &cpo set cpo&vim " 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 if exists("b:undo_ftplugin") let b:undo_ftplugin = b:undo_ftplugin . " | setlocal efm<" \ . "| unlet! b:browsefiler" else let b:undo_ftplugin = "setlocal efm<" \ . "| unlet! b:browsefiler" endif let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/ld.vim000066400000000000000000000007121267703067000172240ustar00rootroot00000000000000" Vim filetype plugin file " Language: ld(1) script " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< inc< fo<" setlocal comments=s1:/*,mb:*,ex:*/ commentstring=/*%s*/ include=^\\s*INCLUDE setlocal formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/less.vim000066400000000000000000000007661267703067000176040ustar00rootroot00000000000000" Vim filetype plugin " Language: less " Maintainer: Alessandro Vioni " URL: https://github.com/genoma/vim-less " Last Change: 2014 November 24 " 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 cms< def< inc< inex< ofu< sua<" setlocal formatoptions-=t formatoptions+=croql setlocal comments=:// commentstring=//\ %s setlocal omnifunc=csscomplete#CompleteCSS setlocal suffixesadd=.less vim-7.4.1689/runtime/ftplugin/lftp.vim000066400000000000000000000006461267703067000176000ustar00rootroot00000000000000" Vim filetype plugin file " Language: lftp(1) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/libao.vim000066400000000000000000000006541267703067000177200ustar00rootroot00000000000000" Vim filetype plugin file " Language: libao.conf(5) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/limits.vim000066400000000000000000000006501267703067000201270ustar00rootroot00000000000000" Vim filetype plugin file " Language: limits(5) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/liquid.vim000066400000000000000000000035511267703067000201200ustar00rootroot00000000000000" Vim filetype plugin " Language: Liquid " Maintainer: Tim Pope " Last Change: 2010 May 21 if exists('b:did_ftplugin') finish endif if !exists('g:liquid_default_subtype') let g:liquid_default_subtype = 'html' endif if !exists('b:liquid_subtype') let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$") let b:liquid_subtype = matchstr(s:lines,'liquid_subtype=\zs\w\+') if b:liquid_subtype == '' let b:liquid_subtype = matchstr(&filetype,'^liquid\.\zs\w\+') endif if b:liquid_subtype == '' let b:liquid_subtype = matchstr(substitute(expand('%:t'),'\c\%(\.liquid\)\+$','',''),'\.\zs\w\+$') endif if b:liquid_subtype == '' let b:liquid_subtype = g:liquid_default_subtype endif endif if exists('b:liquid_subtype') && b:liquid_subtype != '' exe 'runtime! ftplugin/'.b:liquid_subtype.'.vim ftplugin/'.b:liquid_subtype.'_*.vim ftplugin/'.b:liquid_subtype.'/*.vim' else runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim endif let b:did_ftplugin = 1 if exists('b:undo_ftplugin') let b:undo_ftplugin .= '|' else let b:undo_ftplugin = '' endif if exists('b:browsefilter') let b:browsefilter = "\n".b:browsefilter else let b:browsefilter = '' endif if exists('b:match_words') let b:match_words .= ',' elseif exists('loaded_matchit') let b:match_words = '' endif if has('gui_win32') let b:browsefilter="Liquid Files (*.liquid)\t*.liquid" . b:browsefilter endif if exists('loaded_matchit') let b:match_words .= '\<\%(if\w*\|unless\|case\)\>:\<\%(elsif\|else\|when\)\>:\,\<\%(for\|tablerow\)\>:\%({%\s*\)\@<=empty\>:\,<\(capture\|comment\|highlight\)\>:\' endif setlocal commentstring={%\ comment\ %}%s{%\ endcomment\ %} let b:undo_ftplugin .= 'setl cms< | unlet! b:browsefilter b:match_words' vim-7.4.1689/runtime/ftplugin/lisp.vim000066400000000000000000000014011267703067000175700ustar00rootroot00000000000000" Vim filetype plugin " Language: Lisp " Maintainer: Sergey Khorev " URL: http://sites.google.com/site/khorser/opensource/vim " Original author: Dorai Sitaram " Original URL: http://www.ccs.neu.edu/~dorai/vimplugins/vimplugins.html " Last Change: Oct 23, 2013 " 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 comments=:; setl define=^\\s*(def\\k* setl formatoptions-=t setl iskeyword+=+,-,*,/,%,<,=,>,:,$,?,!,@-@,94 setl lisp setl commentstring=;%s setl comments^=:;;;,:;;,sr:#\|,mb:\|,ex:\|# let b:undo_ftplugin = "setlocal comments< define< formatoptions< iskeyword< lisp< commentstring<" vim-7.4.1689/runtime/ftplugin/logcheck.vim000066400000000000000000000007641267703067000204130ustar00rootroot00000000000000" Vim filetype plugin file " Language: Logcheck " Maintainer: Debian Vim Maintainers " Last Change: 2012 Jan 15 " License: Vim License " URL: http://hg.debian.org/hg/pkg-vim/vim/file/unstable/runtime/ftplugin/logcheck.vim if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let b:undo_ftplugin = "setl fo<" " Do not hard-wrap non-comment lines since each line is a self-contained " regular expression setlocal formatoptions-=t vim-7.4.1689/runtime/ftplugin/loginaccess.vim000066400000000000000000000006561267703067000211260ustar00rootroot00000000000000" Vim filetype plugin file " Language: login.access(5) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/logindefs.vim000066400000000000000000000006541267703067000206040ustar00rootroot00000000000000" Vim filetype plugin file " Language: login.defs(5) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/logtalk.dict000066400000000000000000000033761267703067000204230ustar00rootroot00000000000000encoding calls category dynamic end_category end_object end_protocol info initialization object protocol synchronized threaded uses alias discontiguous meta_predicate mode op private protected public current_object current_protocol current_category object_property protocol_property category_property create_object create_protocol create_category abolish_object abolish_protocol abolish_category complements complements_object extends extends_object extends_protocol extends_category implements implements_protocol imports imports_category instantiates instantiates_class specializes specializes_class abolish_events current_event define_events logtalk_load logtalk_compile logtalk_library_path current_logtalk_flag set_logtalk_flag threaded_call threaded_once threaded_ignore threaded_exit threaded_peek threaded_wait threaded_notify self this sender parameter before after phrase expand_term goal_expansion term_expansion true fail call catch throw unify_with_occurs_check var atom integer float atomic compound nonvar number arg copy_term functor current_predicate predicate_property abolish assertz asserta clause retract retractall bagof findall forall setof current_input current_output set_input set_output open close flush_output stream_property at_end_of_stream set_stream_position get_char get_code peek_char peek_code put_char put_code nl get_byte peek_byte put_byte read read_term write writeq write_canonical atom_chars atom_codes atom_concat number_chars number_codes current_op char_conversion current_char_conversion once repeat atom_length atom_concat sub_atom atom_chars atom_codes char_code number_chars number_codes set_prolog_flag current_prolog_flag halt abs atan ceiling cos exp float_fractional_part float_integer_part floor log mod rem round sign sin sqrt truncate vim-7.4.1689/runtime/ftplugin/logtalk.vim000066400000000000000000000006211267703067000202610ustar00rootroot00000000000000" Logtalk filetype plugin file " Language: Logtalk " Maintainer: Paulo Moura " Latest Revision: 2007-07-06 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let b:undo_ftplugin = "setl ts< sw< fdm< fdc< ai< dict<" "setlocal ts=4 setlocal sw=4 setlocal fdm=syntax setlocal fdc=2 setlocal autoindent setlocal dict=$VIMRUNTIME/ftplugin/logtalk.dict vim-7.4.1689/runtime/ftplugin/lprolog.vim000066400000000000000000000023771267703067000203140ustar00rootroot00000000000000" Vim settings file " Language: LambdaProlog (Teyjus) " Maintainer: Markus Mottl " URL: http://www.ocaml.info/vim/ftplugin/lprolog.vim " Last Change: 2006 Feb 05 " 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('Comment') nmap c LUncomOn vmap c BUncomOn nmap C LUncomOff vmap C BUncomOff endif nnoremap LUncomOn mz0i/* $A */`z nnoremap LUncomOff :s/^\/\* \(.*\) \*\//\1/ vnoremap BUncomOn :'<,'>`0i/*`>o0i*/`< vnoremap BUncomOff :'<,'>`dd`< endif vim-7.4.1689/runtime/ftplugin/lua.vim000066400000000000000000000017151267703067000174120ustar00rootroot00000000000000" Vim filetype plugin file. " Language: Lua 4.0+ " Maintainer: Max Ischenko " Last Change: 2012 Mar 07 " 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:cpo_save = &cpo set cpo&vim " Set 'formatoptions' to break comment lines but not other lines, and insert " the comment leader when hitting 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. if exists("loaded_matchit") let b:match_ignorecase = 0 let b:match_words = \ '\<\%(do\|function\|if\)\>:' . \ '\<\%(return\|else\|elseif\)\>:' . \ '\,' . \ '\:\' endif " exists("loaded_matchit") let &cpo = s:cpo_save unlet s:cpo_save let b:undo_ftplugin = "setlocal fo< com< cms< suffixesadd<" vim-7.4.1689/runtime/ftplugin/m4.vim000066400000000000000000000006361267703067000171520ustar00rootroot00000000000000" Vim filetype plugin file " Language: m4 " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:#,:dnl commentstring=dnl\ %s setlocal formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/mail.vim000066400000000000000000000021231267703067000175450ustar00rootroot00000000000000" Vim filetype plugin file " Language: Mail " Maintainer: Bram Moolenaar " Last Change: 2012 Nov 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< comments<" " Don't use modelines in e-mail messages, avoid trojan horses and nasty " "jokes" (e.g., setting 'textwidth' to 5). 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 n:> to 'comments, in case it was removed elsewhere setlocal comments+=n:> " Add mappings, unless the user doesn't want this. if !exists("no_plugin_maps") && !exists("no_mail_maps") " Quote text by inserting "> " if !hasmapto('MailQuote') vmap q MailQuote nmap q MailQuote endif vnoremap MailQuote :s/^/> /:noh`` nnoremap MailQuote :.,$s/^/> /:noh`` endif vim-7.4.1689/runtime/ftplugin/mailaliases.vim000066400000000000000000000005671267703067000211210ustar00rootroot00000000000000" Vim filetype plugin file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/mailcap.vim000066400000000000000000000006461267703067000202410ustar00rootroot00000000000000" Vim filetype plugin file " Language: Mailcap configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/make.vim000066400000000000000000000016471267703067000175520ustar00rootroot00000000000000" Vim filetype plugin file " Language: Make " Maintainer: Bram Moolenaar " Last Change: 2013 Apr 22 " 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< sts< fo< com< cms< inc<" " 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 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 " Including files. let &l:include = '^\s*include' " For matchit.vim, suggested by Albert Netymk. if exists("loaded_matchit") let b:match_words = '\:\:\,\:\' endif vim-7.4.1689/runtime/ftplugin/man.vim000066400000000000000000000115421267703067000174030ustar00rootroot00000000000000" Vim filetype plugin file " Language: man " Maintainer: SungHyun Nam " Last Change: 2016 Feb 04 " 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 " Ensure Vim is not recursively invoked (man-db does this) " when doing ctrl-[ on a man page reference. if exists("$MANPAGER") let $MANPAGER = "" endif " 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('ManBS') nmap h ManBS endif nnoremap ManBS :%s/.\b//g:setl nomod'' nnoremap :call PreGetPage(v:count) nnoremap :call PopPage() nnoremap q :q endif if exists('g:ft_man_folding_enable') && (g:ft_man_folding_enable == 1) setlocal foldmethod=indent foldnestmax=1 foldenable endif let b:undo_ftplugin = "setlocal iskeyword<" endif if exists(":Man") != 2 com -nargs=+ Man call s:GetPage() nmap K :call PreGetPage(0) endif " Define functions only once. if !exists("s:man_tag_depth") let s:man_tag_depth = 0 let s:man_sect_arg = "" let s:man_find_arg = "-w" try 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" endif catch /E145:/ " Ignore the error in restricted mode endtry func PreGetPage(cnt) if a:cnt == 0 let old_isk = &iskeyword if &ft == 'man' setl iskeyword+=(,) endif let str = expand("") 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("") endif call s:GetPage(sect, page) endfunc func GetCmdArg(sect, page) if a:sect == '' return a:page endif return s:man_sect_arg.' '.a:sect.' '.a:page endfunc func 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 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 if page == '' let page = expand('') 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! \b" if winnr() > 1 exe "norm! " . thiswin . "\w" while 1 if &filetype == "man" break endif exe "norm! \w" if thiswin == winnr() break endif endwhile endif if &filetype != "man" new setl nonu fdc=0 endif endif silent exec "edit $HOME/".page.".".sect."~" " Avoid warning for editing the dummy file twice setl buftype=nofile noswapfile setl ma nonu nornu nofen silent exec "norm 1GdG" if empty($MANWIDTH) let $MANWIDTH = winwidth(0) endif silent exec "r!/usr/bin/man ".s:GetCmdArg(sect, page)." | col -b" " Remove blank lines from top and bottom. while getline(1) =~ '^\s*$' silent keepj norm ggdd endwhile while getline('$') =~ '^\s*$' silent keepj norm Gdd endwhile 1 setl ft=man nomod setl bufhidden=hide setl nobuflisted endfunc func 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: vim-7.4.1689/runtime/ftplugin/manconf.vim000066400000000000000000000006601267703067000202500ustar00rootroot00000000000000" Vim filetype plugin file " Language: man.conf(5) - man configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/markdown.vim000066400000000000000000000010741267703067000204510ustar00rootroot00000000000000" Vim filetype plugin " Language: Markdown " Maintainer: Tim Pope " Last Change: 2013 May 30 if exists("b:did_ftplugin") finish endif runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim setlocal comments=fb:*,fb:-,fb:+,n:> commentstring=>\ %s setlocal formatoptions+=tcqln formatoptions-=r formatoptions-=o setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^[-*+]\\s\\+ if exists('b:undo_ftplugin') let b:undo_ftplugin .= "|setl cms< com< fo< flp<" else let b:undo_ftplugin = "setl cms< com< fo< flp<" endif " vim:set sw=2: vim-7.4.1689/runtime/ftplugin/matlab.vim000066400000000000000000000013621267703067000200670ustar00rootroot00000000000000" Vim filetype plugin file " Language: matlab " Maintainer: Jake Wasserman " Last Changed: 2014 Dec 30 " Contributors: " Charles Campbell if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:save_cpo = &cpo set cpo-=C if exists("loaded_matchit") let s:conditionalEnd = '\%(([^()]*\)\@!\\%([^()]*)\)\@!' let b:match_words= \ '\<\%(if\|switch\|for\|while\)\>:\<\%(elseif\|case\|break\|continue\|else\|otherwise\)\>:'.s:conditionalEnd.','. \ '\:\:\' unlet s:conditionalEnd endif setlocal suffixesadd=.m setlocal suffixes+=.asv let b:undo_ftplugin = "setlocal suffixesadd< suffixes< " \ . "| unlet! b:match_words" let &cpo = s:save_cpo unlet s:save_cpo vim-7.4.1689/runtime/ftplugin/mf.vim000066400000000000000000000006241267703067000172310ustar00rootroot00000000000000" Vim filetype plugin file " Language: MetaFont " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:% commentstring=%\ %s formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/modconf.vim000066400000000000000000000007211267703067000202520ustar00rootroot00000000000000" Vim filetype plugin file " Language: modules.conf(5) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< inc< fo<" setlocal comments=:# commentstring=#\ %s include=^\\s*include setlocal formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/mp.vim000066400000000000000000000011551267703067000172430ustar00rootroot00000000000000" Vim filetype plugin file " Language: MetaPost " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:% commentstring=%\ %s formatoptions-=t formatoptions+=croql if exists(":FixBeginfigs") != 2 command -nargs=0 FixBeginfigs call s:fix_beginfigs() function! s:fix_beginfigs() let i = 1 g/^beginfig(\d*);$/s//\='beginfig('.i.');'/ | let i = i + 1 endfunction endif let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/mplayerconf.vim000066400000000000000000000007141267703067000211460ustar00rootroot00000000000000" Vim filetype plugin file " Language: mplayer(1) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< inc< fo<" setlocal comments=:# commentstring=#\ %s include=^\\s*include setlocal formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/mrxvtrc.vim000066400000000000000000000014361267703067000203360ustar00rootroot00000000000000" Created : Wed 26 Apr 2006 01:20:53 AM CDT " Modified : Fri 28 Apr 2006 03:24:01 AM CDT " Author : Gautam Iyer " Description : ftplugin for mrxvtrc if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let b:undo_ftplugin = "setl com< cms< fo<" " Really any line that does not match an option is a comment. But use '!' for " compatibility with x-defaults files, and "#" (preferred) for compatibility " with all other config files. " " Comments beginning with "#" are preferred because Vim will not flag the " first word as a spelling error if it is not capitalised. The '!' used as " comment leaders makes Vim think that every comment line is a new sentence. setlocal comments=:!,:# commentstring=#\ %s setlocal formatoptions-=t formatoptions+=croql vim-7.4.1689/runtime/ftplugin/msmessages.vim000066400000000000000000000021651267703067000210000ustar00rootroot00000000000000" Vim filetype plugin file " Language: MS Message files (*.mc) " Maintainer: Kevin Locke " Last Change: 2008 April 09 " Location: http://kevinlocke.name/programs/vim/syntax/msmessages.vim " Based on c.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 " Using line continuation here. let s:cpo_save = &cpo set cpo-=C let b:undo_ftplugin = "setl fo< com< cms< | unlet! b:browsefilter" " Set 'formatoptions' to format all lines, including comments setlocal fo-=ct fo+=roql " Comments includes both ";" which describes a "comment" which will be " converted to C code and variants on "; //" which will remain comments " in the generated C code setlocal comments=:;,:;//,:;\ //,s:;\ /*\ ,m:;\ \ *\ ,e:;\ \ */ setlocal commentstring=;\ //\ %s " Win32 can filter files in the browse dialog if has("gui_win32") && !exists("b:browsefilter") let b:browsefilter = "MS Message Files (*.mc)\t*.mc\n" . \ "Resource Files (*.rc)\t*.rc\n" . \ "All Files (*.*)\t*.*\n" endif let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/muttrc.vim000066400000000000000000000007071267703067000201470ustar00rootroot00000000000000" Vim filetype plugin file " Language: mutt RC File " Maintainer: Nikolai Weibull " Latest Revision: 2006-04-19 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< inc< fo<" setlocal comments=:# commentstring=#\ %s setlocal formatoptions-=t formatoptions+=croql let &l:include = '^\s*source\>' let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/nanorc.vim000066400000000000000000000006631267703067000201120ustar00rootroot00000000000000" Vim filetype plugin file " Language: nanorc(5) - GNU nano configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/netrc.vim000066400000000000000000000006401267703067000177400ustar00rootroot00000000000000" Vim filetype plugin file " Language: netrc(5) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments= commentstring= formatoptions-=tcroq formatoptions+=l let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/nsis.vim000066400000000000000000000010511267703067000175760ustar00rootroot00000000000000" Vim ftplugin file " Language: NSIS script " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 let s:cpo_save = &cpo set cpo&vim if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let b:undo_ftplugin = "setl com< cms< fo< def< inc<" setlocal comments=s1:/*,mb:*,ex:*/,b:#,:; commentstring=;\ %s setlocal formatoptions-=t formatoptions+=croql setlocal define=^\\s*!define\\%(\\%(utc\\)\\=date\\|math\\)\\= setlocal include=^\\s*!include\\%(/NONFATAL\\)\\= let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/objc.vim000066400000000000000000000004501267703067000175410ustar00rootroot00000000000000" Vim filetype plugin file " Language: Objective C " Maintainer: Bram Moolenaar " 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 vim-7.4.1689/runtime/ftplugin/ocaml.vim000066400000000000000000000550011267703067000177210ustar00rootroot00000000000000" Language: OCaml " Maintainer: David Baelde " Mike Leary " Markus Mottl " Pierre Vittet " Stefano Zacchiroli " Vincent Aravantinos " URL: http://www.ocaml.info/vim/ftplugin/ocaml.vim " Last Change: " 2013 Jul 26 - load default compiler settings (MM) " 2013 Jul 24 - removed superfluous efm-setting (MM) " 2013 Jul 22 - applied fixes supplied by Hirotaka Hamada (MM) " 2013 Mar 15 - Improved error format (MM) if exists("b:did_ftplugin") finish endif let b:did_ftplugin=1 " Use standard compiler settings unless user wants otherwise if !exists("current_compiler") :compiler ocaml endif " some macro if exists('*fnameescape') function! s:Fnameescape(s) return fnameescape(a:s) endfun else function! s:Fnameescape(s) return escape(a:s," \t\n*?[{`$\\%#'\"|!<") endfun endif " Error handling -- helps moving where the compiler wants you to go let s:cposet=&cpoptions set cpo&vim " Add mappings, unless the user didn't want this. if !exists("no_plugin_maps") && !exists("no_ocaml_maps") " (un)commenting if !hasmapto('Comment') nmap c LUncomOn xmap c BUncomOn nmap C LUncomOff xmap C BUncomOff endif nnoremap LUncomOn gI(* *) nnoremap LUncomOff :s/^(\* \(.*\) \*)/\1/:noh xnoremap BUncomOn :'<,'>`0i(*`>o0i*)`< xnoremap BUncomOff :'<,'>`dd`< nmap s OCamlSwitchEdit nmap S OCamlSwitchNewWin nmap t OCamlPrintType xmap t OCamlPrintType endif " Let % jump between structure elements (due to Issac Trotts) let b:mw = '' let b:mw = b:mw . ',\:\:\(\\|;;\)' let b:mw = b:mw . ',\:\:\' let b:mw = b:mw . ',\<\(for\|while\)\>:\:\,' let b:mw = b:mw . ',\<\(object\|sig\|struct\|begin\)\>:\' let b:mw = b:mw . ',\<\(match\|try\)\>:\' let b:match_words = b:mw let b:match_ignorecase=0 " switching between interfaces (.mli) and implementations (.ml) if !exists("g:did_ocaml_switch") let g:did_ocaml_switch = 1 nnoremap OCamlSwitchEdit :call OCaml_switch(0) nnoremap OCamlSwitchNewWin :call OCaml_switch(1) fun OCaml_switch(newwin) if (match(bufname(""), "\\.mli$") >= 0) let fname = s:Fnameescape(substitute(bufname(""), "\\.mli$", ".ml", "")) if (a:newwin == 1) exec "new " . fname else exec "arge " . fname endif elseif (match(bufname(""), "\\.ml$") >= 0) let fname = s:Fnameescape(bufname("")) . "i" if (a:newwin == 1) exec "new " . fname else exec "arge " . fname endif endif endfun endif " Folding support " Get the modeline because folding depends on indentation let s:s = line2byte(line('.'))+col('.')-1 if search('^\s*(\*:o\?caml:') let s:modeline = getline(".") else let s:modeline = "" endif if s:s > 0 exe 'goto' s:s endif " Get the indentation params let s:m = matchstr(s:modeline,'default\s*=\s*\d\+') if s:m != "" let s:idef = matchstr(s:m,'\d\+') elseif exists("g:omlet_indent") let s:idef = g:omlet_indent else let s:idef = 2 endif let s:m = matchstr(s:modeline,'struct\s*=\s*\d\+') if s:m != "" let s:i = matchstr(s:m,'\d\+') elseif exists("g:omlet_indent_struct") let s:i = g:omlet_indent_struct else let s:i = s:idef endif " Set the folding method if exists("g:ocaml_folding") setlocal foldmethod=expr setlocal foldexpr=OMLetFoldLevel(v:lnum) endif let b:undo_ftplugin = "setlocal efm< foldmethod< foldexpr<" \ . "| unlet! b:mw b:match_words b:match_ignorecase" " - Only definitions below, executed once ------------------------------------- if exists("*OMLetFoldLevel") finish endif function s:topindent(lnum) let l = a:lnum while l > 0 if getline(l) =~ '\s*\%(\\|\\|\\)' return indent(l) endif let l = l-1 endwhile return -s:i endfunction function OMLetFoldLevel(l) " This is for not merging blank lines around folds to them if getline(a:l) !~ '\S' return -1 endif " We start folds for modules, classes, and every toplevel definition if getline(a:l) =~ '^\s*\%(\\|\\|\\|\\|\\|\\|\\|\\|\\)' exe 'return ">' (indent(a:l)/s:i)+1 '"' endif " Toplevel let are detected thanks to the indentation if getline(a:l) =~ '^\s*let\>' && indent(a:l) == s:i+s:topindent(a:l) exe 'return ">' (indent(a:l)/s:i)+1 '"' endif " We close fold on end which are associated to struct, sig or object. " We use syntax information to do that. if getline(a:l) =~ '^\s*end\>' && synIDattr(synID(a:l, indent(a:l)+1, 0), "name") != "ocamlKeyword" return (indent(a:l)/s:i)+1 endif " Folds end on ;; if getline(a:l) =~ '^\s*;;' exe 'return "<' (indent(a:l)/s:i)+1 '"' endif " Comments around folds aren't merged to them. if synIDattr(synID(a:l, indent(a:l)+1, 0), "name") == "ocamlComment" return -1 endif return '=' endfunction " Vim support for OCaml .annot files " " Last Change: 2007 Jul 17 " Maintainer: Vincent Aravantinos " License: public domain " " Originally inspired by 'ocaml-dtypes.vim' by Stefano Zacchiroli. " The source code is quite radically different for we not use python anymore. " However this plugin should have the exact same behaviour, that's why the " following lines are the quite exact copy of Stefano's original plugin : " " << " Executing Ocaml_print_type() function will display in the Vim bottom " line(s) the type of an ocaml value getting it from the corresponding .annot " file (if any). If Vim is in visual mode, should be "visual" and the " selected ocaml value correspond to the highlighted text, otherwise ( " can be anything else) it corresponds to the literal found at the current " cursor position. " " Typing 't' (LocalLeader defaults to '\', see :h LocalLeader) " will cause " Ocaml_print_type function to be invoked with the right " argument depending on the current mode (visual or not). " >> " " If you find something not matching this behaviour, please signal it. " " Differences are: " - no need for python support " + plus : more portable " + minus: no more lazy parsing, it looks very fast however " " - ocamlbuild support, ie. " + the plugin finds the _build directory and looks for the " corresponding file inside; " + if the user decides to change the name of the _build directory thanks " to the '-build-dir' option of ocamlbuild, the plugin will manage in " most cases to find it out (most cases = if the source file has a unique " name among your whole project); " + if ocamlbuild is not used, the usual behaviour holds; ie. the .annot " file should be in the same directory as the source file; " + for vim plugin programmers: " the variable 'b:_build_dir' contains the inferred path to the build " directory, even if this one is not named '_build'. " " Bonus : " - latin1 accents are handled " - lists are handled, even on multiple lines, you don't need the visual mode " (the cursor must be on the first bracket) " - parenthesized expressions, arrays, and structures (ie. '(...)', '[|...|]', " and '{...}') are handled the same way " Copied from Stefano's original plugin : " << " .annot ocaml file representation " " File format (copied verbatim from caml-types.el) " " file ::= block * " block ::= position position annotation * " position ::= filename num num num " annotation ::= keyword open-paren data close-paren " " is a space character (ASCII 0x20) " is a line-feed character (ASCII 0x0A) " num is a sequence of decimal digits " filename is a string with the lexical conventions of O'Caml " open-paren is an open parenthesis (ASCII 0x28) " close-paren is a closed parenthesis (ASCII 0x29) " data is any sequence of characters where is always followed by " at least two space characters. " " - in each block, the two positions are respectively the start and the " end of the range described by the block. " - in a position, the filename is the name of the file, the first num " is the line number, the second num is the offset of the beginning " of the line, the third num is the offset of the position itself. " - the char number within the line is the difference between the third " and second nums. " " For the moment, the only possible keyword is \"type\"." " >> " 1. Finding the annotation file even if we use ocamlbuild " In: two strings representing paths " Out: one string representing the common prefix between the two paths function! s:Find_common_path (p1,p2) let temp = a:p2 while matchstr(a:p1,temp) == '' let temp = substitute(temp,'/[^/]*$','','') endwhile return temp endfun " After call: " " Following information have been put in s:annot_file_list, using " annot_file_name name as key: " - annot_file_path : " path to the .annot file corresponding to the " source file (dealing with ocamlbuild stuff) " - _build_path: " path to the build directory even if this one is " not named '_build' " - date_of_last annot: " Set to 0 until we load the file. It contains the " date at which the file has been loaded. function! s:Locate_annotation() let annot_file_name = s:Fnameescape(expand('%:t:r')).'.annot' if !exists ("s:annot_file_list[annot_file_name]") silent exe 'cd' s:Fnameescape(expand('%:p:h')) " 1st case : the annot file is in the same directory as the buffer (no ocamlbuild) let annot_file_path = findfile(annot_file_name,'.') if annot_file_path != '' let annot_file_path = getcwd().'/'.annot_file_path let _build_path = '' else " 2nd case : the buffer and the _build directory are in the same directory " .. " / \ " / \ " _build .ml " let _build_path = finddir('_build','.') if _build_path != '' let _build_path = getcwd().'/'._build_path let annot_file_path = findfile(annot_file_name,'_build') if annot_file_path != '' let annot_file_path = getcwd().'/'.annot_file_path endif else " 3rd case : the _build directory is in a directory higher in the file hierarchy " (it can't be deeper by ocamlbuild requirements) " .. " / \ " / \ " _build ... " \ " \ " .ml " let _build_path = finddir('_build',';') if _build_path != '' let project_path = substitute(_build_path,'/_build$','','') let path_relative_to_project = s:Fnameescape(substitute(expand('%:p:h'),project_path.'/','','')) let annot_file_path = findfile(annot_file_name,project_path.'/_build/'.path_relative_to_project) else let annot_file_path = findfile(annot_file_name,'**') "4th case : what if the user decided to change the name of the _build directory ? " -> we relax the constraints, it should work in most cases if annot_file_path != '' " 4a. we suppose the renamed _build directory is in the current directory let _build_path = matchstr(annot_file_path,'^[^/]*') if annot_file_path != '' let annot_file_path = getcwd().'/'.annot_file_path let _build_path = getcwd().'/'._build_path endif else let annot_file_name = '' "(Pierre Vittet: I have commented 4b because this was chrashing "my vim (it produced infinite loop)) " " 4b. anarchy : the renamed _build directory may be higher in the hierarchy " this will work if the file for which we are looking annotations has a unique name in the whole project " if this is not the case, it may still work, but no warranty here "let annot_file_path = findfile(annot_file_name,'**;') "let project_path = s:Find_common_path(annot_file_path,expand('%:p:h')) "let _build_path = matchstr(annot_file_path,project_path.'/[^/]*') endif endif endif endif if annot_file_path == '' throw 'E484: no annotation file found' endif silent exe 'cd' '-' let s:annot_file_list[annot_file_name]= [annot_file_path, _build_path, 0] endif endfun " This variable contain a dictionnary of list. Each element of the dictionnary " represent an annotation system. An annotation system is a list with : " - annotation file name as it's key " - annotation file path as first element of the contained list " - build path as second element of the contained list " - annot_file_last_mod (contain the date of .annot file) as third element let s:annot_file_list = {} " 2. Finding the type information in the annotation file " a. The annotation file is opened in vim as a buffer that " should be (almost) invisible to the user. " After call: " The current buffer is now the one containing the .annot file. " We manage to keep all this hidden to the user's eye. function! s:Enter_annotation_buffer(annot_file_path) let s:current_pos = getpos('.') let s:current_hidden = &l:hidden set hidden let s:current_buf = bufname('%') if bufloaded(a:annot_file_path) silent exe 'keepj keepalt' 'buffer' s:Fnameescape(a:annot_file_path) else silent exe 'keepj keepalt' 'view' s:Fnameescape(a:annot_file_path) endif call setpos(".", [0, 0 , 0 , 0]) endfun " After call: " The original buffer has been restored in the exact same state as before. function! s:Exit_annotation_buffer() silent exe 'keepj keepalt' 'buffer' s:Fnameescape(s:current_buf) let &l:hidden = s:current_hidden call setpos('.',s:current_pos) endfun " After call: " The annot file is loaded and assigned to a buffer. " This also handles the modification date of the .annot file, eg. after a " compilation (return an updated annot_file_list). function! s:Load_annotation(annot_file_name) let annot = s:annot_file_list[a:annot_file_name] let annot_file_path = annot[0] let annot_file_last_mod = 0 if exists("annot[2]") let annot_file_last_mod = annot[2] endif if bufloaded(annot_file_path) && annot_file_last_mod < getftime(annot_file_path) " if there is a more recent file let nr = bufnr(annot_file_path) silent exe 'keepj keepalt' 'bunload' nr endif if !bufloaded(annot_file_path) call s:Enter_annotation_buffer(annot_file_path) setlocal nobuflisted setlocal bufhidden=hide setlocal noswapfile setlocal buftype=nowrite call s:Exit_annotation_buffer() let annot[2] = getftime(annot_file_path) " List updated with the new date let s:annot_file_list[a:annot_file_name] = annot endif endfun "b. 'search' and 'match' work to find the type information "In: - lin1,col1: postion of expression first char " - lin2,col2: postion of expression last char "Out: - the pattern to be looked for to find the block " Must be called in the source buffer (use of line2byte) function! s:Block_pattern(lin1,lin2,col1,col2) let start_num1 = a:lin1 let start_num2 = line2byte(a:lin1) - 1 let start_num3 = start_num2 + a:col1 let path = '"\(\\"\|[^"]\)\+"' let start_pos = path.' '.start_num1.' '.start_num2.' '.start_num3 let end_num1 = a:lin2 let end_num2 = line2byte(a:lin2) - 1 let end_num3 = end_num2 + a:col2 let end_pos = path.' '.end_num1.' '.end_num2.' '.end_num3 return '^'.start_pos.' '.end_pos."$" " rq: the '^' here is not totally correct regarding the annot file "grammar" " but currently the annotation file respects this, and it's a little bit faster with the '^'; " can be removed safely. endfun "In: (the cursor position should be at the start of an annotation) "Out: the type information " Must be called in the annotation buffer (use of search) function! s:Match_data() " rq: idem as previously, in the following, the '^' at start of patterns is not necessary keepj while search('^type($','ce',line(".")) == 0 keepj if search('^.\{-}($','e') == 0 throw "no_annotation" endif keepj if searchpair('(','',')') == 0 throw "malformed_annot_file" endif endwhile let begin = line(".") + 1 keepj if searchpair('(','',')') == 0 throw "malformed_annot_file" endif let end = line(".") - 1 return join(getline(begin,end),"\n") endfun "In: the pattern to look for in order to match the block "Out: the type information (calls s:Match_data) " Should be called in the annotation buffer function! s:Extract_type_data(block_pattern, annot_file_name) let annot_file_path = s:annot_file_list[a:annot_file_name][0] call s:Enter_annotation_buffer(annot_file_path) try if search(a:block_pattern,'e') == 0 throw "no_annotation" endif call cursor(line(".") + 1,1) let annotation = s:Match_data() finally call s:Exit_annotation_buffer() endtry return annotation endfun "c. link this stuff with what the user wants " ie. get the expression selected/under the cursor let s:ocaml_word_char = '\w|[-]|''' "In: the current mode (eg. "visual", "normal", etc.) "Out: the borders of the expression we are looking for the type function! s:Match_borders(mode) if a:mode == "visual" let cur = getpos(".") normal `< let col1 = col(".") let lin1 = line(".") normal `> let col2 = col(".") let lin2 = line(".") call cursor(cur[1],cur[2]) return [lin1,lin2,col1-1,col2] else let cursor_line = line(".") let cursor_col = col(".") let line = getline('.') if line[cursor_col-1:cursor_col] == '[|' let [lin2,col2] = searchpairpos('\[|','','|\]','n') return [cursor_line,lin2,cursor_col-1,col2+1] elseif line[cursor_col-1] == '[' let [lin2,col2] = searchpairpos('\[','','\]','n') return [cursor_line,lin2,cursor_col-1,col2] elseif line[cursor_col-1] == '(' let [lin2,col2] = searchpairpos('(','',')','n') return [cursor_line,lin2,cursor_col-1,col2] elseif line[cursor_col-1] == '{' let [lin2,col2] = searchpairpos('{','','}','n') return [cursor_line,lin2,cursor_col-1,col2] else let [lin1,col1] = searchpos('\v%('.s:ocaml_word_char.'|\.)*','ncb') let [lin2,col2] = searchpos('\v%('.s:ocaml_word_char.'|\.)*','nce') if col1 == 0 || col2 == 0 throw "no_expression" endif return [cursor_line,cursor_line,col1-1,col2] endif endif endfun "In: the current mode (eg. "visual", "normal", etc.) "Out: the type information (calls s:Extract_type_data) function! s:Get_type(mode, annot_file_name) let [lin1,lin2,col1,col2] = s:Match_borders(a:mode) return s:Extract_type_data(s:Block_pattern(lin1,lin2,col1,col2), a:annot_file_name) endfun "In: A string destined to be printed in the 'echo buffer'. It has line "break and 2 space at each line beginning. "Out: A string destined to be yanked, without space and double space. function s:unformat_ocaml_type(res) "Remove end of line. let res = substitute (a:res, "\n", "", "g" ) "remove double space let res =substitute(res , " ", " ", "g") "remove space at begining of string. let res = substitute(res, "^ *", "", "g") return res endfunction "d. main "In: the current mode (eg. "visual", "normal", etc.) "After call: the type information is displayed if !exists("*Ocaml_get_type") function Ocaml_get_type(mode) let annot_file_name = s:Fnameescape(expand('%:t:r')).'.annot' call s:Locate_annotation() call s:Load_annotation(annot_file_name) let res = s:Get_type(a:mode, annot_file_name) " Copy result in the unnamed buffer let @" = s:unformat_ocaml_type(res) return res endfun endif if !exists("*Ocaml_get_type_or_not") function Ocaml_get_type_or_not(mode) let t=reltime() try let res = Ocaml_get_type(a:mode) return res catch return "" endtry endfun endif if !exists("*Ocaml_print_type") function Ocaml_print_type(mode) if expand("%:e") == "mli" echohl ErrorMsg | echo "No annotations for interface (.mli) files" | echohl None return endif try echo Ocaml_get_type(a:mode) catch /E484:/ echohl ErrorMsg | echo "No type annotations (.annot) file found" | echohl None catch /no_expression/ echohl ErrorMsg | echo "No expression found under the cursor" | echohl None catch /no_annotation/ echohl ErrorMsg | echo "No type annotation found for the given text" | echohl None catch /malformed_annot_file/ echohl ErrorMsg | echo "Malformed .annot file" | echohl None endtry endfun endif " Maps nnoremap OCamlPrintType :call Ocaml_print_type("normal") xnoremap OCamlPrintType :call Ocaml_print_type("visual")`< let &cpoptions=s:cposet unlet s:cposet " vim:sw=2 fdm=indent vim-7.4.1689/runtime/ftplugin/occam.vim000066400000000000000000000024211267703067000177060ustar00rootroot00000000000000" Vim filetype plugin file " Language: occam " Copyright: Christian Jacobsen , Mario Schweigler " Maintainer: Mario Schweigler " 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 let s:keepcpo= &cpo set cpo&vim "{{{ 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 "}}} "{{{ Undo settings let b:undo_ftplugin = "setlocal shiftwidth< softtabstop< expandtab<" \ . " formatoptions< comments< textwidth<" \ . "| unlet! b:browsefiler" "}}} let &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/ftplugin/pamconf.vim000066400000000000000000000006451267703067000202550ustar00rootroot00000000000000" Vim filetype plugin file " Language: pam(8) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/pascal.vim000066400000000000000000000012331267703067000200670ustar00rootroot00000000000000" Vim filetype plugin file " Language: pascal " Maintainer: Dan Sharp " Last Changed: 11 Apr 2011 " URL: http://dwsharp.users.sourceforge.net/vim/ftplugin if exists("b:did_ftplugin") | finish | endif let b:did_ftplugin = 1 if exists("loaded_matchit") let b:match_ignorecase = 1 " (pascal is case-insensitive) let b:match_words = '\<\%(begin\|case\|record\|object\|try\)\>' let b:match_words .= ':\<^\s*\%(except\|finally\)\>:\' let b:match_words .= ',\:\' let b:match_words .= ',\:\' endif " Undo the stuff we changed. let b:undo_ftplugin = "unlet! b:match_words" vim-7.4.1689/runtime/ftplugin/passwd.vim000066400000000000000000000006341267703067000201310ustar00rootroot00000000000000" Vim filetype plugin file " Language: passwd(5) password file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments= commentstring= formatoptions-=tcroq formatoptions+=l let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/pdf.vim000066400000000000000000000050651267703067000174040ustar00rootroot00000000000000" Vim filetype plugin file " Language: PDF " Maintainer: Tim Pope " Last Change: 2007 Dec 16 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 setlocal commentstring=%%s setlocal comments=:% let b:undo_ftplugin = "setlocal cms< com< | unlet! b:match_words" if exists("g:loaded_matchit") let b:match_words = '\<\%(\d\+\s\+\d\+\s\+\)obj\>:\,\,\:\,<<:>>' endif if exists("g:no_plugin_maps") || exists("g:no_pdf_maps") || v:version < 700 finish endif if !exists("b:pdf_tagstack") let b:pdf_tagstack = [] endif let b:undo_ftplugin .= " | silent! nunmap | silent! nunmap " nnoremap :call Tag() " Inline, so the error from an empty tag stack will be simple. nnoremap :if len(b:pdf_tagstack) > 0 call setpos('.',remove(b:pdf_tagstack, -1)) else exe "norm! \C-T>" endif function! s:Tag() call add(b:pdf_tagstack,getpos('.')) if getline('.') =~ '^\d\+$' && getline(line('.')-1) == 'startxref' return s:dodigits(getline('.')) elseif getline('.') =~ '/Prev\s\+\d\+\>\%(\s\+\d\)\@!' && expand("") =~ '^\d\+$' return s:dodigits(expand("")) elseif getline('.') =~ '^\d\{10\} \d\{5\} ' return s:dodigits(matchstr(getline('.'),'^\d\+')) else let line = getline(".") let lastend = 0 let pat = '\<\d\+\s\+\d\+\s\+R\>' while lastend >= 0 let beg = match(line,'\C'.pat,lastend) let end = matchend(line,'\C'.pat,lastend) if beg < col(".") && end >= col(".") return s:doobject(matchstr(line,'\C'.pat,lastend)) endif let lastend = end endwhile return s:notag() endif endfunction function! s:doobject(string) let first = matchstr(a:string,'^\s*\zs\d\+') let second = matchstr(a:string,'^\s*\d\+\s\+\zs\d\+') norm! m' if first != '' && second != '' let oldline = line('.') let oldcol = col('.') 1 if !search('^\s*'.first.'\s\+'.second.'\s\+obj\>') exe oldline exe 'norm! '.oldcol.'|' return s:notag() endif endif endfunction function! s:dodigits(digits) let digits = 0 + substitute(a:digits,'^0*','','') norm! m' if digits <= 0 norm! 1go else " Go one character before the destination and advance. This method " lands us after a newline rather than before, if that is our target. exe "goto ".(digits)."|norm! 1 " endif endfunction function! s:notag() silent! call remove(b:pdf_tagstack,-1) echohl ErrorMsg echo "E426: tag not found" echohl NONE endfunction vim-7.4.1689/runtime/ftplugin/perl.vim000066400000000000000000000054201267703067000175700ustar00rootroot00000000000000" Vim filetype plugin file " Language: Perl " Maintainer: vim-perl " Homepage: http://github.com/vim-perl/vim-perl " Bugs/requests: http://github.com/vim-perl/vim-perl/issues " Last Change: 2013-07-21 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-=t setlocal formatoptions+=crqol setlocal keywordprg=perldoc\ -f 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 "--------------------------------------------- setlocal include=\\<\\(use\\\|require\\)\\> setlocal includeexpr=substitute(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+=: set iskeyword+=: " Set this once, globally. if !exists("perlpath") if executable("perl") try 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,',.$',',,','') catch /E145:/ let perlpath = ".,," endtry 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 " Append perlpath to the existing path value, if it is set. Since we don't " use += to do it because of the commas in perlpath, we have to handle the " global / local settings, too. if &l:path == "" if &g:path == "" let &l:path=perlpath else let &l:path=&g:path.",".perlpath endif else let &l:path=&l:path.",".perlpath endif "--------------------------------------------- " Undo the stuff we changed. let b:undo_ftplugin = "setlocal fo< com< cms< inc< inex< def< isf< kp< path<" . \ " | unlet! b:browsefilter" " proper matching for matchit plugin let b:match_skip = 's:comment\|string\|perlQQ\|perlShellCommand\|perlHereDoc\|perlSubstitution\|perlTranslation\|perlMatch\|perlFormatField' " Restore the saved compatibility options. let &cpo = s:save_cpo unlet s:save_cpo vim-7.4.1689/runtime/ftplugin/perl6.vim000066400000000000000000000047411267703067000176630ustar00rootroot00000000000000" Vim filetype plugin file " Language: Perl 6 " Maintainer: vim-perl " Homepage: http://github.com/vim-perl/vim-perl " Bugs/requests: http://github.com/vim-perl/vim-perl/issues " Last Change: 2013-07-21 " Contributors: Hinrik Örn Sigurðsson " " Based on ftplugin/perl.vim by Dan Sharp 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-=t setlocal formatoptions+=crqol setlocal keywordprg=p6doc 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 "--------------------------------------------- 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. Thanks to Andrew Pimlott for pointing out " the problem. If this causes a " problem for you, add an " after/ftplugin/perl6.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("perl6") try if &shellxquote != '"' let perlpath = system('perl6 -e "@*INC.join(q/,/).say"') else let perlpath = system("perl6 -e '@*INC.join(q/,/).say'") endif let perlpath = substitute(perlpath,',.$',',,','') catch /E145:/ let perlpath = ".,," endtry 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< isk<" . \ " | unlet! b:browsefilter" " Restore the saved compatibility options. let &cpo = s:save_cpo unlet s:save_cpo vim-7.4.1689/runtime/ftplugin/php.vim000066400000000000000000000053751267703067000174260ustar00rootroot00000000000000" Vim filetype plugin file " Language: php " Maintainer: Dan Sharp " Last Changed: 20 Jan 2009 " URL: http://dwsharp.users.sourceforge.net/vim/ftplugin if exists("b:did_ftplugin") | finish | endif " Make sure the continuation lines below do not cause problems in " compatibility mode. let s:keepcpo= &cpo set cpo&vim " Define some defaults in case the included ftplugins don't set them. let s:undo_ftplugin = "" let s:browsefilter = "HTML Files (*.html, *.htm)\t*.html;*.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 if exists("b:match_skip") unlet b:match_skip 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 setlocal include=\\\(require\\\|include\\\)\\\(_once\\\)\\\? " Disabled changing 'iskeyword', it breaks a command such as "*" " setlocal iskeyword+=$ if exists("loaded_matchit") let b:match_words = ',\:\,' . \ '\:\:\:\,' . \ '\:\,' . \ '\:\,' . \ '\:\,' . \ '\:\,' . \ '(:),[:],{:},' . \ s:match_words endif " ### if exists('&omnifunc') setlocal omnifunc=phpcomplete#CompletePHP endif " Section jumping: [[ and ]] provided by Antony Scriven let s:function = '\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function' let s:class = '\(abstract\s\+\|final\s\+\)*class' let s:interface = 'interface' let s:section = '\(.*\%#\)\@!\_^\s*\zs\('.s:function.'\|'.s:class.'\|'.s:interface.'\)' exe 'nno [[ ?' . escape(s:section, '|') . '?:nohls' exe 'nno ]] /' . escape(s:section, '|') . '/:nohls' exe 'ono [[ ?' . escape(s:section, '|') . '?:nohls' exe 'ono ]] /' . escape(s:section, '|') . '/:nohls' setlocal commentstring=/*%s*/ " Undo the stuff we changed. let b:undo_ftplugin = "setlocal commentstring< include< omnifunc<" . \ " | unlet! b:browsefilter b:match_words | " . \ s:undo_ftplugin " Restore the saved compatibility options. let &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/ftplugin/pinfo.vim000066400000000000000000000006471267703067000177470ustar00rootroot00000000000000" Vim filetype plugin file " Language: pinfo(1) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/plaintex.vim000066400000000000000000000021761267703067000204570ustar00rootroot00000000000000" plain TeX filetype plugin " Language: plain TeX (ft=plaintex) " Maintainer: Benji Fisher, Ph.D. " Version: 1.1 " Last Change: Wed 19 Apr 2006 " Only do this when not done yet for this buffer. if exists("b:did_ftplugin") finish endif " Start with initex. This will also define b:did_ftplugin and b:undo_ftplugin . source $VIMRUNTIME/ftplugin/initex.vim " Avoid problems if running in 'compatible' mode. let s:save_cpo = &cpo set cpo&vim let b:undo_ftplugin .= "| unlet! b:match_ignorecase b:match_skip b:match_words" " Allow "[d" to be used to find a macro definition: let &l:define .= '\|\\new\(count\|dimen\|skip\|muskip\|box\|toks\|read\|write' \ . '\|fam\|insert\)' " The following lines enable the macros/matchit.vim plugin for " extended matching with the % key. " There is no default meaning for \(...\) etc., but many users define one. if exists("loaded_matchit") let b:match_ignorecase = 0 \ | let b:match_skip = 'r:\\\@ " Last Change: 24th April 2012 " 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:cpo_save = &cpo set cpo&vim " 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 = '<<:>>,\:\,\:\,\:\' endif " 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 let b:undo_ftplugin = "setlocal comments< formatoptions<" \ . "| unlet! b:browsefiler b:match_ignorecase b:match_words" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/procmail.vim000066400000000000000000000007231267703067000204350ustar00rootroot00000000000000" Vim filetype plugin file " Language: procmail(1) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< inc< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql let &l:include = '^\s*INCLUDERC\>' let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/prolog.vim000066400000000000000000000006541267703067000201340ustar00rootroot00000000000000" Vim filetype plugin file " Language: Prolog " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=s1:/*,mb:*,ex:*/,:% commentstring=%\ %s setlocal formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/protocols.vim000066400000000000000000000006751267703067000206610ustar00rootroot00000000000000" Vim filetype plugin file " Language: protocols(5) - Internet protocols definition file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/pyrex.vim000066400000000000000000000013761267703067000200030ustar00rootroot00000000000000" Vim filetype plugin file " Language: Pyrex " Maintainer: Marco Barisione " URL: http://marcobari.altervista.org/pyrex_vim.html " Last Change: 2012 May 18 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") finish endif let s:keepcpo= &cpo set cpo&vim " 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 let &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/ftplugin/python.vim000066400000000000000000000034051267703067000201500ustar00rootroot00000000000000" Vim filetype plugin file " Language: python " Maintainer: Johannes Zellner " Last Change: 2014 Feb 09 " Last Change By Johannes: Wed, 21 Apr 2004 13:13:08 CEST if exists("b:did_ftplugin") | finish | endif let b:did_ftplugin = 1 let s:keepcpo= &cpo set cpo&vim setlocal cinkeys-=0# setlocal indentkeys-=0# setlocal include=^\\s*\\(from\\\|import\\) setlocal includeexpr=substitute(v:fname,'\\.','/','g') setlocal suffixesadd=.py setlocal comments=b:#,fb:- setlocal commentstring=#\ %s setlocal omnifunc=pythoncomplete#Complete set wildignore+=*.pyc nnoremap ]] :call Python_jump('/^\(class\\|def\)') nnoremap [[ :call Python_jump('?^\(class\\|def\)') nnoremap ]m :call Python_jump('/^\s*\(class\\|def\)') nnoremap [m :call Python_jump('?^\s*\(class\\|def\)') if !exists('*Python_jump') fun! 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 endif if has("browsefilter") && !exists("b:browsefilter") let b:browsefilter = "Python Files (*.py)\t*.py\n" . \ "All Files (*.*)\t*.*\n" endif " As suggested by PEP8. setlocal expandtab shiftwidth=4 softtabstop=4 tabstop=8 " First time: try finding "pydoc". if !exists('g:pydoc_executable') if executable('pydoc') let g:pydoc_executable = 1 else let g:pydoc_executable = 0 endif endif " If "pydoc" was found use it for keywordprg. if g:pydoc_executable setlocal keywordprg=pydoc endif let &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/ftplugin/qf.vim000066400000000000000000000007131267703067000172340ustar00rootroot00000000000000" Vim filetype plugin file " Language: Vim's quickfix window " Maintainer: Lech Lorens " Last Changed: 30 Apr 2012 if exists("b:did_ftplugin") finish endif " Don't load another plugin for this buffer let b:did_ftplugin = 1 let b:undo_ftplugin = "set stl<" " Display the command that produced the list in the quickfix window: setlocal stl=%t%{exists('w:quickfix_title')?\ '\ '.w:quickfix_title\ :\ ''}\ %=%-15(%l,%c%V%)\ %P vim-7.4.1689/runtime/ftplugin/quake.vim000066400000000000000000000006531267703067000177370ustar00rootroot00000000000000" Vim filetype plugin file " Language: Quake[1-3] configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:// commentstring=//\ %s formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/r.vim000066400000000000000000000015321267703067000170670ustar00rootroot00000000000000" Vim filetype plugin file " Language: R " Maintainer: Jakson Alves de Aquino " Homepage: https://github.com/jalvesaq/R-Vim-runtime " Last Change: Tue Apr 07, 2015 04:38PM " Only do this when not yet done 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:cpo_save = &cpo set cpo&vim setlocal iskeyword=@,48-57,_,. setlocal formatoptions-=t setlocal commentstring=#\ %s setlocal comments=:#',:###,:##,:# if has("gui_win32") && !exists("b:browsefilter") let b:browsefilter = "R Source Files (*.R)\t*.R\n" . \ "Files that include R (*.Rnw *.Rd *.Rmd *.Rrst)\t*.Rnw;*.Rd;*.Rmd;*.Rrst\n" . \ "All Files (*.*)\t*.*\n" endif let b:undo_ftplugin = "setl cms< com< fo< isk< | unlet! b:browsefilter" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/racc.vim000066400000000000000000000006651267703067000175440ustar00rootroot00000000000000" Vim filetype plugin file " Language: Racc input file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=s1:/*,mb:*,ex:*/,:# commentstring=#\ %s setlocal formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/readline.vim000066400000000000000000000006521267703067000204130ustar00rootroot00000000000000" Vim filetype plugin file " Language: readline(3) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/registry.vim000066400000000000000000000013441267703067000204770ustar00rootroot00000000000000" Vim filetype plugin file " Language: Windows Registry export with regedit (*.reg) " Maintainer: Cade Forester " Latest Revision: 2014-01-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = \ 'let b:browsefilter = "" | ' . \ 'setlocal ' . \ 'comments< '. \ 'commentstring< ' . \ 'formatoptions< ' if has( 'gui_win32' ) \ && !exists( 'b:browsefilter' ) let b:browsefilter = \ 'registry files (*.reg)\t*.reg\n' . \ 'All files (*.*)\t*.*\n' endif setlocal comments=:; setlocal commentstring=;\ %s setlocal formatoptions-=t setlocal formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/reva.vim000066400000000000000000000013051267703067000175610ustar00rootroot00000000000000" Vim ftplugin file " Language: Reva Forth " Version: 7.1 " Last Change: 2008/01/11 " Maintainer: Ron Aaron " URL: http://ronware.org/reva/ " Filetypes: *.rf *.frt " NOTE: Forth allows any non-whitespace in a name, so you need to do: " setlocal iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255 " " This goes with the syntax/reva.vim file. " 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 sts=4 sw=4 setlocal com=s1:/*,mb:*,ex:*/,:\|,:\\ setlocal fo=tcrqol setlocal matchpairs+=\::; setlocal iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255 vim-7.4.1689/runtime/ftplugin/rhelp.vim000066400000000000000000000013421267703067000177370ustar00rootroot00000000000000" Vim filetype plugin file " Language: R help file " Maintainer: Jakson Alves de Aquino " Homepage: https://github.com/jalvesaq/R-Vim-runtime " Last Change: Tue Apr 07, 2015 04:37PM " Only do this when not yet done 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:cpo_save = &cpo set cpo&vim setlocal iskeyword=@,48-57,_,. if has("gui_win32") && !exists("b:browsefilter") let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst\n" . \ "All Files (*.*)\t*.*\n" endif let b:undo_ftplugin = "setl isk< | unlet! b:browsefilter" let &cpo = s:cpo_save unlet s:cpo_save " vim: sw=2 vim-7.4.1689/runtime/ftplugin/rmd.vim000066400000000000000000000023521267703067000174110ustar00rootroot00000000000000" Vim filetype plugin file " Language: R help file " Maintainer: Jakson Alves de Aquino " Homepage: https://github.com/jalvesaq/R-Vim-runtime " Last Change: Tue Apr 07, 2015 04:37PM " Original work by Alex Zvoleff (adjusted for rmd by Michel Kuhlmann) " Only do this when not yet done for this buffer if exists("b:did_ftplugin") finish endif runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim setlocal comments=fb:*,fb:-,fb:+,n:> commentstring=>\ %s setlocal formatoptions+=tcqln setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^\\s*[-*+]\\s\\+ setlocal iskeyword=@,48-57,_,. let s:cpo_save = &cpo set cpo&vim " Enables pandoc if it is installed unlet! b:did_ftplugin runtime ftplugin/pandoc.vim " Don't load another plugin for this buffer let b:did_ftplugin = 1 if has("gui_win32") && !exists("b:browsefilter") let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst\n" . \ "All Files (*.*)\t*.*\n" endif if exists('b:undo_ftplugin') let b:undo_ftplugin .= " | setl cms< com< fo< flp< isk< | unlet! b:browsefilter" else let b:undo_ftplugin = "setl cms< com< fo< flp< isk< | unlet! b:browsefilter" endif let &cpo = s:cpo_save unlet s:cpo_save " vim: sw=2 vim-7.4.1689/runtime/ftplugin/rnc.vim000066400000000000000000000006431267703067000174120ustar00rootroot00000000000000" Vim filetype plugin file " Language: Relax NG compact syntax " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/rnoweb.vim000066400000000000000000000020151267703067000201170ustar00rootroot00000000000000" Vim filetype plugin file " Language: Rnoweb " Maintainer: Jakson Alves de Aquino " Homepage: https://github.com/jalvesaq/R-Vim-runtime " Last Change: Tue Apr 07, 2015 04:37PM " Only do this when not yet done for this buffer if exists("b:did_ftplugin") finish endif let s:cpo_save = &cpo set cpo&vim runtime! ftplugin/tex.vim " Don't load another plugin for this buffer let b:did_ftplugin = 1 " Enables Vim-Latex-Suite, LaTeX-Box if installed runtime ftplugin/tex_*.vim setlocal iskeyword=@,48-57,_,. setlocal suffixesadd=.bib,.tex setlocal comments=b:%,b:#,b:##,b:###,b:#' if has("gui_win32") && !exists("b:browsefilter") let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst\n" . \ "All Files (*.*)\t*.*\n" endif if exists('b:undo_ftplugin') let b:undo_ftplugin .= " | setl isk< sua< com< | unlet! b:browsefilter" else let b:undo_ftplugin = "setl isk< sua< com< | unlet! b:browsefilter" endif let &cpo = s:cpo_save unlet s:cpo_save " vim: sw=2 vim-7.4.1689/runtime/ftplugin/rpl.vim000066400000000000000000000011541267703067000174230ustar00rootroot00000000000000" Vim filetype plugin file " Language: RPL/2 " Maintainer: Jol BERTRAND " Last Change: 2012 Mar 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 " Set 'formatoptions' to break comment lines but not other lines, " and insert the comment leader when hitting or using "o". setlocal fo-=t fo+=croql " Set 'comments' to format dashed lists in comments. setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:// let b:undo_ftplugin = "setlocal fo< comments<" vim-7.4.1689/runtime/ftplugin/rrst.vim000066400000000000000000000021171267703067000176200ustar00rootroot00000000000000" Vim filetype plugin file " Language: reStructuredText documentation format with R code " Maintainer: Jakson Alves de Aquino " Homepage: https://github.com/jalvesaq/R-Vim-runtime " Last Change: Tue Apr 07, 2015 04:38PM " Original work by Alex Zvoleff " Only do this when not yet done 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:cpo_save = &cpo set cpo&vim setlocal comments=fb:*,fb:-,fb:+,n:> commentstring=>\ %s setlocal formatoptions+=tcqln setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^\\s*[-*+]\\s\\+ setlocal iskeyword=@,48-57,_,. if has("gui_win32") && !exists("b:browsefilter") let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst\n" . \ "All Files (*.*)\t*.*\n" endif if exists('b:undo_ftplugin') let b:undo_ftplugin .= " | setl cms< com< fo< flp< isk< | unlet! b:browsefilter" else let b:undo_ftplugin = "setl cms< com< fo< flp< isk< | unlet! b:browsefilter" endif let &cpo = s:cpo_save unlet s:cpo_save " vim: sw=2 vim-7.4.1689/runtime/ftplugin/rst.vim000066400000000000000000000006741267703067000174440ustar00rootroot00000000000000" Vim filetype plugin file " Language: reStructuredText documentation format " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< et< fo<" setlocal comments=fb:.. commentstring=..\ %s expandtab setlocal formatoptions+=tcroql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/ruby.vim000066400000000000000000000367541267703067000176250ustar00rootroot00000000000000" Vim filetype plugin " Language: Ruby " Maintainer: Tim Pope " URL: https://github.com/vim-ruby/vim-ruby " Release Coordinator: Doug Kearns " ---------------------------------------------------------------------------- if (exists("b:did_ftplugin")) finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim if has("gui_running") && !has("gui_win32") setlocal keywordprg=ri\ -T\ -f\ bs else setlocal keywordprg=ri endif " Matchit support if exists("loaded_matchit") && !exists("b:match_words") let b:match_ignorecase = 0 let b:match_words = \ '\<\%(if\|unless\|case\|while\|until\|for\|do\|class\|module\|def\|begin\)\>=\@!' . \ ':' . \ '\<\%(else\|elsif\|ensure\|when\|rescue\|break\|redo\|next\|retry\)\>' . \ ':' . \ '\' . \ ',{:},\[:\],(:)' let b:match_skip = \ "synIDattr(synID(line('.'),col('.'),0),'name') =~ '" . \ "\\'" endif setlocal formatoptions-=t formatoptions+=croql setlocal include=^\\s*\\<\\(load\\>\\\|require\\>\\\|autoload\\s*:\\=[\"']\\=\\h\\w*[\"']\\=,\\) setlocal includeexpr=substitute(substitute(v:fname,'::','/','g'),'$','.rb','') setlocal suffixesadd=.rb if exists("&ofu") && has("ruby") setlocal omnifunc=rubycomplete#Complete endif " To activate, :set ballooneval if has('balloon_eval') && exists('+balloonexpr') setlocal balloonexpr=RubyBalloonexpr() endif " TODO: "setlocal define=^\\s*def setlocal comments=:# setlocal commentstring=#\ %s if !exists('g:ruby_version_paths') let g:ruby_version_paths = {} endif function! s:query_path(root) let code = "print $:.join %q{,}" if &shell =~# 'sh' && $PATH !~# '\s' let prefix = 'env PATH='.$PATH.' ' else let prefix = '' endif if &shellxquote == "'" let path_check = prefix.'ruby -e "' . code . '"' else let path_check = prefix."ruby -e '" . code . "'" endif let cd = haslocaldir() ? 'lcd' : 'cd' let cwd = getcwd() try exe cd fnameescape(a:root) let path = split(system(path_check),',') exe cd fnameescape(cwd) return path finally exe cd fnameescape(cwd) endtry endfunction function! s:build_path(path) let path = join(map(copy(a:path), 'v:val ==# "." ? "" : v:val'), ',') if &g:path !~# '\v^\.%(,/%(usr|emx)/include)=,,$' let path = substitute(&g:path,',,$',',','') . ',' . path endif return path endfunction if !exists('b:ruby_version') && !exists('g:ruby_path') && isdirectory(expand('%:p:h')) let s:version_file = findfile('.ruby-version', '.;') if !empty(s:version_file) let b:ruby_version = get(readfile(s:version_file, '', 1), '') if !has_key(g:ruby_version_paths, b:ruby_version) let g:ruby_version_paths[b:ruby_version] = s:query_path(fnamemodify(s:version_file, ':p:h')) endif endif endif if exists("g:ruby_path") let s:ruby_path = type(g:ruby_path) == type([]) ? join(g:ruby_path, ',') : g:ruby_path elseif has_key(g:ruby_version_paths, get(b:, 'ruby_version', '')) let s:ruby_paths = g:ruby_version_paths[b:ruby_version] let s:ruby_path = s:build_path(s:ruby_paths) else if !exists('g:ruby_default_path') if has("ruby") && has("win32") ruby ::VIM::command( 'let g:ruby_default_path = split("%s",",")' % $:.join(%q{,}) ) elseif executable('ruby') let g:ruby_default_path = s:query_path($HOME) else let g:ruby_default_path = map(split($RUBYLIB,':'), 'v:val ==# "." ? "" : v:val') endif endif let s:ruby_paths = g:ruby_default_path let s:ruby_path = s:build_path(s:ruby_paths) endif if stridx(&l:path, s:ruby_path) == -1 let &l:path = s:ruby_path endif if exists('s:ruby_paths') && stridx(&l:tags, join(map(copy(s:ruby_paths),'v:val."/tags"'),',')) == -1 let &l:tags = &tags . ',' . join(map(copy(s:ruby_paths),'v:val."/tags"'),',') endif if has("gui_win32") && !exists("b:browsefilter") let b:browsefilter = "Ruby Source Files (*.rb)\t*.rb\n" . \ "All Files (*.*)\t*.*\n" endif let b:undo_ftplugin = "setl fo< inc< inex< sua< def< com< cms< path< tags< kp<" \."| unlet! b:browsefilter b:match_ignorecase b:match_words b:match_skip" \."| if exists('&ofu') && has('ruby') | setl ofu< | endif" \."| if has('balloon_eval') && exists('+bexpr') | setl bexpr< | endif" if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps") nnoremap [m :call searchsyn('\','rubyDefine','b','n') nnoremap ]m :call searchsyn('\','rubyDefine','','n') nnoremap [M :call searchsyn('\','rubyDefine','b','n') nnoremap ]M :call searchsyn('\','rubyDefine','','n') xnoremap [m :call searchsyn('\','rubyDefine','b','v') xnoremap ]m :call searchsyn('\','rubyDefine','','v') xnoremap [M :call searchsyn('\','rubyDefine','b','v') xnoremap ]M :call searchsyn('\','rubyDefine','','v') nnoremap [[ :call searchsyn('\<\%(class\module\)\>','rubyModule\rubyClass','b','n') nnoremap ]] :call searchsyn('\<\%(class\module\)\>','rubyModule\rubyClass','','n') nnoremap [] :call searchsyn('\','rubyModule\rubyClass','b','n') nnoremap ][ :call searchsyn('\','rubyModule\rubyClass','','n') xnoremap [[ :call searchsyn('\<\%(class\module\)\>','rubyModule\rubyClass','b','v') xnoremap ]] :call searchsyn('\<\%(class\module\)\>','rubyModule\rubyClass','','v') xnoremap [] :call searchsyn('\','rubyModule\rubyClass','b','v') xnoremap ][ :call searchsyn('\','rubyModule\rubyClass','','v') let b:undo_ftplugin = b:undo_ftplugin \."| sil! exe 'unmap [[' | sil! exe 'unmap ]]' | sil! exe 'unmap []' | sil! exe 'unmap ]['" \."| sil! exe 'unmap [m' | sil! exe 'unmap ]m' | sil! exe 'unmap [M' | sil! exe 'unmap ]M'" if maparg('im','n') == '' onoremap im :call wrap_i('[m',']M') onoremap am :call wrap_a('[m',']M') xnoremap im :call wrap_i('[m',']M') xnoremap am :call wrap_a('[m',']M') let b:undo_ftplugin = b:undo_ftplugin \."| sil! exe 'ounmap im' | sil! exe 'ounmap am'" \."| sil! exe 'xunmap im' | sil! exe 'xunmap am'" endif if maparg('iM','n') == '' onoremap iM :call wrap_i('[[','][') onoremap aM :call wrap_a('[[','][') xnoremap iM :call wrap_i('[[','][') xnoremap aM :call wrap_a('[[','][') let b:undo_ftplugin = b:undo_ftplugin \."| sil! exe 'ounmap iM' | sil! exe 'ounmap aM'" \."| sil! exe 'xunmap iM' | sil! exe 'xunmap aM'" endif if maparg("\",'n') == '' nnoremap :exe v:count1."tag =RubyCursorIdentifier()" nnoremap g :exe "tjump =RubyCursorIdentifier()" nnoremap g] :exe "tselect =RubyCursorIdentifier()" nnoremap ] :exe v:count1."stag =RubyCursorIdentifier()" nnoremap :exe v:count1."stag =RubyCursorIdentifier()" nnoremap g :exe "stjump =RubyCursorIdentifier()" nnoremap g] :exe "stselect =RubyCursorIdentifier()" nnoremap } :exe "ptag =RubyCursorIdentifier()" nnoremap g} :exe "ptjump =RubyCursorIdentifier()" let b:undo_ftplugin = b:undo_ftplugin \."| sil! exe 'nunmap '| sil! exe 'nunmap g'| sil! exe 'nunmap g]'" \."| sil! exe 'nunmap ]'| sil! exe 'nunmap '" \."| sil! exe 'nunmap g'| sil! exe 'nunmap g]'" \."| sil! exe 'nunmap }'| sil! exe 'nunmap g}'" endif if maparg("gf",'n') == '' " By using findfile() rather than gf's normal behavior, we prevent " erroneously editing a directory. nnoremap gf :exe gf(v:count1,"gf",'edit') nnoremap f :exe gf(v:count1,"\C-W>f",'split') nnoremap :exe gf(v:count1,"\C-W>\C-F>",'split') nnoremap gf :exe gf(v:count1,"\C-W>gf",'tabedit') let b:undo_ftplugin = b:undo_ftplugin \."| sil! exe 'nunmap gf' | sil! exe 'nunmap f' | sil! exe 'nunmap ' | sil! exe 'nunmap gf'" endif endif let &cpo = s:cpo_save unlet s:cpo_save if exists("g:did_ruby_ftplugin_functions") finish endif let g:did_ruby_ftplugin_functions = 1 function! RubyBalloonexpr() if !exists('s:ri_found') let s:ri_found = executable('ri') endif if s:ri_found let line = getline(v:beval_lnum) let b = matchstr(strpart(line,0,v:beval_col),'\%(\w\|[:.]\)*$') let a = substitute(matchstr(strpart(line,v:beval_col),'^\w*\%([?!]\|\s*=\)\?'),'\s\+','','g') let str = b.a let before = strpart(line,0,v:beval_col-strlen(b)) let after = strpart(line,v:beval_col+strlen(a)) if str =~ '^\.' let str = substitute(str,'^\.','#','g') if before =~ '\]\s*$' let str = 'Array'.str elseif before =~ '}\s*$' " False positives from blocks here let str = 'Hash'.str elseif before =~ "[\"'`]\\s*$" || before =~ '\$\d\+\s*$' let str = 'String'.str elseif before =~ '\$\d\+\.\d\+\s*$' let str = 'Float'.str elseif before =~ '\$\d\+\s*$' let str = 'Integer'.str elseif before =~ '/\s*$' let str = 'Regexp'.str else let str = substitute(str,'^#','.','') endif endif let str = substitute(str,'.*\.\s*to_f\s*\.\s*','Float#','') let str = substitute(str,'.*\.\s*to_i\%(nt\)\=\s*\.\s*','Integer#','') let str = substitute(str,'.*\.\s*to_s\%(tr\)\=\s*\.\s*','String#','') let str = substitute(str,'.*\.\s*to_sym\s*\.\s*','Symbol#','') let str = substitute(str,'.*\.\s*to_a\%(ry\)\=\s*\.\s*','Array#','') let str = substitute(str,'.*\.\s*to_proc\s*\.\s*','Proc#','') if str !~ '^\w' return '' endif silent! let res = substitute(system("ri -f rdoc -T \"".str.'"'),'\n$','','') if res =~ '^Nothing known about' || res =~ '^Bad argument:' || res =~ '^More than one method' return '' endif return res else return "" endif endfunction function! s:searchsyn(pattern,syn,flags,mode) norm! m' if a:mode ==# 'v' norm! gv endif let i = 0 let cnt = v:count ? v:count : 1 while i < cnt let i = i + 1 let line = line('.') let col = col('.') let pos = search(a:pattern,'W'.a:flags) while pos != 0 && s:synname() !~# a:syn let pos = search(a:pattern,'W'.a:flags) endwhile if pos == 0 call cursor(line,col) return endif endwhile endfunction function! s:synname() return synIDattr(synID(line('.'),col('.'),0),'name') endfunction function! s:wrap_i(back,forward) execute 'norm k'.a:forward let line = line('.') execute 'norm '.a:back if line('.') == line - 1 return s:wrap_a(a:back,a:forward) endif execute 'norm jV'.a:forward.'k' endfunction function! s:wrap_a(back,forward) execute 'norm '.a:forward if line('.') < line('$') && getline(line('.')+1) ==# '' let after = 1 endif execute 'norm '.a:back while getline(line('.')-1) =~# '^\s*#' && line('.') - endwhile if exists('after') execute 'norm V'.a:forward.'j' elseif line('.') > 1 && getline(line('.')-1) =~# '^\s*$' execute 'norm kV'.a:forward else execute 'norm V'.a:forward endif endfunction function! RubyCursorIdentifier() let asciicode = '\%(\w\|[]})\"'."'".']\)\@\|\<0[xXbBoOdD][[:xdigit:]_]\+\>\)\|'.asciicode let operator = '\%(\[\]\|<<\|<=>\|[!<>]=\=\|===\=\|[!=]\~\|>>\|\*\*\|\.\.\.\=\|=>\|[~^&|*/%+-]\)' let method = '\%(\<[_a-zA-Z]\w*\>\%([?!]\|\s*=>\@!\)\=\)' let global = '$\%([!$&"'."'".'*+,./:;<=>?@\`~]\|-\=\w\+\>\)' let symbolizable = '\%(\%(@@\=\)\w\+\>\|'.global.'\|'.method.'\|'.operator.'\)' let pattern = '\C\s*\%('.number.'\|\%(:\@") : stripped endfunction function! s:gf(count,map,edit) abort if getline('.') =~# '^\s*require_relative\s*\(["'']\).*\1\s*$' let target = matchstr(getline('.'),'\(["'']\)\zs.\{-\}\ze\1') return a:edit.' %:h/'.target.'.rb' elseif getline('.') =~# '^\s*\%(require[( ]\|load[( ]\|autoload[( ]:\w\+,\)\s*\s*\%(::\)\=File\.expand_path(\(["'']\)\.\./.*\1,\s*__FILE__)\s*$' let target = matchstr(getline('.'),'\(["'']\)\.\./\zs.\{-\}\ze\1') return a:edit.' %:h/'.target.'.rb' elseif getline('.') =~# '^\s*\%(require \|load \|autoload :\w\+,\)\s*\(["'']\).*\1\s*$' let target = matchstr(getline('.'),'\(["'']\)\zs.\{-\}\ze\1') else let target = expand('') endif let found = findfile(target, &path, a:count) if found ==# '' return 'norm! '.a:count.a:map else return a:edit.' '.fnameescape(found) endif endfunction " " Instructions for enabling "matchit" support: " " 1. Look for the latest "matchit" plugin at " " http://www.vim.org/scripts/script.php?script_id=39 " " It is also packaged with Vim, in the $VIMRUNTIME/macros directory. " " 2. Copy "matchit.txt" into a "doc" directory (e.g. $HOME/.vim/doc). " " 3. Copy "matchit.vim" into a "plugin" directory (e.g. $HOME/.vim/plugin). " " 4. Ensure this file (ftplugin/ruby.vim) is installed. " " 5. Ensure you have this line in your $HOME/.vimrc: " filetype plugin on " " 6. Restart Vim and create the matchit documentation: " " :helptags ~/.vim/doc " " Now you can do ":help matchit", and you should be able to use "%" on Ruby " keywords. Try ":echo b:match_words" to be sure. " " Thanks to Mark J. Reed for the instructions. See ":help vimrc" for the " locations of plugin directories, etc., as there are several options, and it " differs on Windows. Email gsinclair@soyabean.com.au if you need help. " " vim: nowrap sw=2 sts=2 ts=8: vim-7.4.1689/runtime/ftplugin/sass.vim000066400000000000000000000011041267703067000175720ustar00rootroot00000000000000" Vim filetype plugin " Language: Sass " Maintainer: Tim Pope " Last Change: 2010 Jul 26 " 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 cms< def< inc< inex< ofu< sua<" setlocal commentstring=//\ %s setlocal define=^\\s*\\%(@mixin\\\|=\\) setlocal includeexpr=substitute(v:fname,'\\%(.*/\\\|^\\)\\zs','_','') setlocal omnifunc=csscomplete#CompleteCSS setlocal suffixesadd=.sass,.scss,.css let &l:include = '^\s*@import\s\+\%(url(\)\=["'']\=' " vim:set sw=2: vim-7.4.1689/runtime/ftplugin/scheme.vim000066400000000000000000000031121267703067000200660ustar00rootroot00000000000000" Vim filetype plugin " Language: Scheme " Maintainer: Sergey Khorev " URL: http://sites.google.com/site/khorser/opensource/vim " Original author: Dorai Sitaram " Original URL: http://www.ccs.neu.edu/~dorai/vimplugins/vimplugins.html " Last Change: Oct 23, 2013 " 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 " Copy-paste from ftplugin/lisp.vim setl comments=:; setl define=^\\s*(def\\k* setl formatoptions-=t setl iskeyword+=+,-,*,/,%,<,=,>,:,$,?,!,@-@,94 setl lisp setl commentstring=;%s setl comments^=:;;;,:;;,sr:#\|,mb:\|,ex:\|# " Scheme-specific settings if exists("b:is_mzscheme") || exists("is_mzscheme") " improve indenting setl iskeyword+=#,%,^ setl lispwords+=module,parameterize,let-values,let*-values,letrec-values setl lispwords+=define-values,opt-lambda,case-lambda,syntax-rules,with-syntax,syntax-case setl lispwords+=define-signature,unit,unit/sig,compund-unit/sig,define-values/invoke-unit/sig endif if exists("b:is_chicken") || exists("is_chicken") " improve indenting setl iskeyword+=#,%,^ setl lispwords+=let-optionals,let-optionals*,declare setl lispwords+=let-values,let*-values,letrec-values setl lispwords+=define-values,opt-lambda,case-lambda,syntax-rules,with-syntax,syntax-case setl lispwords+=cond-expand,and-let*,foreign-lambda,foreign-lambda* endif let b:undo_ftplugin = "setlocal comments< define< formatoptions< iskeyword< lispwords< lisp< commentstring<" vim-7.4.1689/runtime/ftplugin/screen.vim000066400000000000000000000006501267703067000201050ustar00rootroot00000000000000" Vim filetype plugin file " Language: screen(1) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/scss.vim000066400000000000000000000003101267703067000175720ustar00rootroot00000000000000" Vim filetype plugin " Language: SCSS " Maintainer: Tim Pope " Last Change: 2010 Jul 26 if exists("b:did_ftplugin") finish endif runtime! ftplugin/sass.vim " vim:set sw=2: vim-7.4.1689/runtime/ftplugin/sensors.vim000066400000000000000000000006731267703067000203270ustar00rootroot00000000000000" Vim filetype plugin file " Language: sensors.conf(5) - libsensors configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/services.vim000066400000000000000000000006701267703067000204530ustar00rootroot00000000000000" Vim filetype plugin file " Language: services(5) - Internet network services list " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/setserial.vim000066400000000000000000000006531267703067000206240ustar00rootroot00000000000000" Vim filetype plugin file " Language: setserial(8) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/sgml.vim000066400000000000000000000022721267703067000175720ustar00rootroot00000000000000" Vim filetype plugin file " Language: sgml " Maintainer: Dan Sharp " Last Changed: 20 Jan 2009 " URL: http://dwsharp.users.sourceforge.net/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 unlet s:save_cpo vim-7.4.1689/runtime/ftplugin/sh.vim000066400000000000000000000022621267703067000172410ustar00rootroot00000000000000" Vim filetype plugin file " Language: sh " Maintainer: Dan Sharp " Last Changed: 20 Jan 2009 " URL: http://dwsharp.users.sourceforge.net/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 unlet s:save_cpo vim-7.4.1689/runtime/ftplugin/sieve.vim000066400000000000000000000007111267703067000177370ustar00rootroot00000000000000" Vim filetype plugin file " Language: Sieve filtering language input file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=s1:/*,mb:*,ex:*/,:# commentstring=#\ %s setlocal formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/slpconf.vim000066400000000000000000000007211267703067000202710ustar00rootroot00000000000000" Vim filetype plugin file " Language: RFC 2614 - An API for Service Location configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:#,:; commentstring=#\ %s setlocal formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/slpreg.vim000066400000000000000000000007201267703067000201200ustar00rootroot00000000000000" Vim filetype plugin file " Language: RFC 2614 - An API for Service Location registration file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:#,:; commentstring=#\ %s setlocal formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/slpspi.vim000066400000000000000000000007071267703067000201430ustar00rootroot00000000000000" Vim filetype plugin file " Language: RFC 2614 - An API for Service Location SPI file " Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:#,:; commentstring=#\ %s setlocal formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/ftplugin/spec.vim000066400000000000000000000134001267703067000175550ustar00rootroot00000000000000" Plugin to update the %changelog section of RPM spec files " Filename: spec.vim " Maintainer: Igor Gnatenko i.gnatenko.brain@gmail.com " Former Maintainer: Gustavo Niemeyer (until March 2014) " Last Change: Mon Jun 01 21:15 MSK 2015 Igor Gnatenko if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim if !exists("no_plugin_maps") && !exists("no_spec_maps") if !hasmapto("SpecChangelog") map c SpecChangelog endif endif if !hasmapto("call SpecChangelog(\"\")") noremap ' let b:InPHPcode = 0 let b:InPHPcode_tofind = s:PHP_startindenttag endif endif " }}} if 1 > b:InPHPcode && !b:InPHPcode_and_script return -1 endif " Indent successive // or # comment the same way the first is {{{ let addSpecial = 0 if cline =~ '^\s*\%(//\|#\|/\*.*\*/\s*$\)' let addSpecial = b:PHP_outdentSLComments if b:PHP_LastIndentedWasComment == 1 return indent(real_PHP_lastindented) endif let b:PHP_LastIndentedWasComment = 1 else let b:PHP_LastIndentedWasComment = 0 endif " }}} " Indent multiline /* comments correctly {{{ if b:PHP_InsideMultilineComment || b:UserIsTypingComment if cline =~ '^\s*\*\%(\/\)\@!' if last_line =~ '^\s*/\*' return indent(lnum) + 1 else return indent(lnum) endif else let b:PHP_InsideMultilineComment = 0 endif endif if !b:PHP_InsideMultilineComment && cline =~ '^\s*/\*\%(.*\*/\)\@!' if getline(v:lnum + 1) !~ '^\s*\*' return -1 endif let b:PHP_InsideMultilineComment = 1 endif " }}} " Things always indented at col 1 (PHP delimiter: , Heredoc end) {{{ if cline =~# '^\s*' && b:PHP_outdentphpescape return 0 endif if cline =~ '^\s*?>' && cline !~# '\)'.endline if ind != b:PHP_default_indenting && cline =~# '^\s*else\%(if\)\=\>' let b:PHP_CurrentIndentLevel = b:PHP_default_indenting return indent(FindTheIfOfAnElse(v:lnum, 1)) elseif cline =~# s:defaultORcase return FindTheSwitchIndent(v:lnum) + s:sw() * b:PHP_vintage_case_default_indent elseif cline =~ '^\s*)\=\s*{' let previous_line = last_line let last_line_num = lnum while last_line_num > 1 if previous_line =~ terminated || previous_line =~ '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . endline let ind = indent(last_line_num) if b:PHP_BracesAtCodeLevel let ind = ind + s:sw() endif return ind endif let last_line_num = GetLastRealCodeLNum(last_line_num - 1) let previous_line = getline(last_line_num) endwhile elseif last_line =~# unstated && cline !~ '^\s*);\='.endline let ind = ind + s:sw() return ind + addSpecial elseif (ind != b:PHP_default_indenting || last_line =~ '^[)\]]' ) && last_line =~ terminated let previous_line = last_line let last_line_num = lnum let LastLineClosed = 1 let isSingleLineBlock = 0 while 1 if ! isSingleLineBlock && previous_line =~ '^\s*}\|;\s*}'.endline call cursor(last_line_num, 1) if previous_line !~ '^}' call search('}\|;\s*}'.endline, 'W') end let oldLastLine = last_line_num let last_line_num = searchpair('{', '', '}', 'bW', 'Skippmatch()') if getline(last_line_num) =~ '^\s*{' let last_line_num = GetLastRealCodeLNum(last_line_num - 1) elseif oldLastLine == last_line_num let isSingleLineBlock = 1 continue endif let previous_line = getline(last_line_num) continue else let isSingleLineBlock = 0 if getline(last_line_num) =~# '^\s*else\%(if\)\=\>' let last_line_num = FindTheIfOfAnElse(last_line_num, 0) continue endif let last_match = last_line_num let one_ahead_indent = indent(last_line_num) let last_line_num = GetLastRealCodeLNum(last_line_num - 1) let two_ahead_indent = indent(last_line_num) let after_previous_line = previous_line let previous_line = getline(last_line_num) if previous_line =~# s:defaultORcase.'\|{'.endline break endif if after_previous_line=~# '^\s*'.s:blockstart.'.*)'.endline && previous_line =~# '[;}]'.endline break endif if one_ahead_indent == two_ahead_indent || last_line_num < 1 if previous_line =~# '\%(;\|^\s*}\)'.endline || last_line_num < 1 break endif endif endif endwhile if indent(last_match) != ind let ind = indent(last_match) let b:PHP_CurrentIndentLevel = b:PHP_default_indenting return ind + addSpecial endif endif if (last_line !~ '^\s*}\%(}}\)\@!') let plinnum = GetLastRealCodeLNum(lnum - 1) else let plinnum = GetLastRealCodeLNum(FindOpenBracket(lnum, 1) - 1) endif let AntepenultimateLine = getline(plinnum) let last_line = substitute(last_line,"\\(//\\|#\\)\\(\\(\\([^\"']*\\([\"']\\)[^\"']*\\5\\)\\+[^\"']*$\\)\\|\\([^\"']*$\\)\\)",'','') if ind == b:PHP_default_indenting if last_line =~ terminated && last_line !~# s:defaultORcase let LastLineClosed = 1 endif endif if !LastLineClosed if last_line =~# '[{(\[]'.endline || last_line =~? '\h\w*\s*(.*,$' && AntepenultimateLine !~ '[,(\[]'.endline let dontIndent = 0 if last_line =~ '\S\+\s*{'.endline && last_line !~ '^\s*)\s*{'.endline && last_line !~ '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . s:endline let dontIndent = 1 endif if !dontIndent && (!b:PHP_BracesAtCodeLevel || last_line !~# '^\s*{') let ind = ind + s:sw() endif if b:PHP_BracesAtCodeLevel || b:PHP_vintage_case_default_indent == 1 let b:PHP_CurrentIndentLevel = ind return ind + addSpecial endif elseif last_line =~ '\S\+\s*),'.endline call cursor(lnum, 1) call search('),'.endline, 'W') let openedparent = searchpair('(', '', ')', 'bW', 'Skippmatch()') if openedparent != lnum let ind = indent(openedparent) endif elseif last_line =~ '^\s*'.s:blockstart let ind = ind + s:sw() elseif AntepenultimateLine =~ '{'.endline || AntepenultimateLine =~ terminated || AntepenultimateLine =~# s:defaultORcase let ind = ind + s:sw() endif endif if cline =~ '^\s*[)\]];\=' let ind = ind - s:sw() endif let b:PHP_CurrentIndentLevel = ind return ind + addSpecial endfunction vim-7.4.1689/runtime/indent/postscr.vim000066400000000000000000000031261267703067000177550ustar00rootroot00000000000000" PostScript indent file " Language: PostScript " Maintainer: Mike Williams " 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 vim-7.4.1689/runtime/indent/pov.vim000066400000000000000000000051231267703067000170630ustar00rootroot00000000000000" Vim indent file " Language: PoV-Ray Scene Description Language " Maintainer: David Necas (Yeti) " 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 in line number . " 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 vim-7.4.1689/runtime/indent/prolog.vim000066400000000000000000000026561267703067000175710ustar00rootroot00000000000000" vim: set sw=4 sts=4: " Maintainer : Gergely Kontra " 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 vim-7.4.1689/runtime/indent/pyrex.vim000066400000000000000000000005061267703067000174260ustar00rootroot00000000000000" Vim indent file " Language: Pyrex " Maintainer: Marco Barisione " URL: http://marcobari.altervista.org/pyrex_vim.html " Last Change: 2005 Jun 24 " Only load this indent file when no other was loaded. if exists("b:did_indent") finish endif " Use Python formatting rules runtime! indent/python.vim vim-7.4.1689/runtime/indent/python.vim000066400000000000000000000131601267703067000176000ustar00rootroot00000000000000" Vim indent file " Language: Python " Maintainer: Bram Moolenaar " Original Author: David Bustos " Last Change: 2013 Jul 9 " 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:keepcpo= &cpo set cpo&vim " Come here when loading the script the first time. 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) + (exists("g:pyindent_continue") ? eval(g:pyindent_continue) : (shiftwidth() * 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") =~ "String$" 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')" \ . " =~ '\\(Comment\\|Todo\\|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')" \ . " =~ '\\(Comment\\|Todo\\|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')" \ . " =~ '\\(Comment\\|Todo\\|String\\)$'") if pp > 0 return indent(plnum) + (exists("g:pyindent_nested_paren") ? eval(g:pyindent_nested_paren) : shiftwidth()) endif return indent(plnum) + (exists("g:pyindent_open_paren") ? eval(g:pyindent_open_paren) : (shiftwidth() * 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) if has('syntax_items') " If the last character in the line is a comment, do a binary search for " the start of the comment. synID() is slow, a linear search would take " too long on a long line. if synIDattr(synID(plnum, pline_len, 1), "name") =~ "\\(Comment\\|Todo\\)$" let min = 1 let max = pline_len while min < max let col = (min + max) / 2 if synIDattr(synID(plnum, col, 1), "name") =~ "\\(Comment\\|Todo\\)$" let max = col else let min = col + 1 endif endwhile let pline = strpart(pline, 0, min - 1) endif else let col = 0 while col < pline_len if pline[col] == '#' let pline = strpart(pline, 0, col) break endif let col = col + 1 endwhile endif " If the previous line ended with a colon, indent this line if pline =~ ':\s*$' return plindent + shiftwidth() endif " If the previous line was a stop-execution statement... if getline(plnum) =~ '^\s*\(break\|continue\|raise\|return\|pass\)\>' " See if the user has already dedented if indent(a:lnum) > indent(plnum) - shiftwidth() " If not, recommend one dedent return indent(plnum) - shiftwidth() 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 if getline(lnum) =~ '^\s*\(try\|except\)\>' let ind = indent(lnum) 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 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 - shiftwidth() return -1 endif return plindent - shiftwidth() 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 let &cpo = s:keepcpo unlet s:keepcpo " vim:sw=2 vim-7.4.1689/runtime/indent/r.vim000066400000000000000000000327231267703067000165260ustar00rootroot00000000000000" Vim indent file " Language: R " Author: Jakson Alves de Aquino " Homepage: https://github.com/jalvesaq/R-Vim-runtime " Last Change: Thu Feb 18, 2016 06:32AM " Only load this indent file when no other was loaded. if exists("b:did_indent") finish endif let b:did_indent = 1 setlocal indentkeys=0{,0},:,!^F,o,O,e setlocal indentexpr=GetRIndent() " Only define the function once. if exists("*GetRIndent") finish endif " Options to make the indentation more similar to Emacs/ESS: if !exists("g:r_indent_align_args") let g:r_indent_align_args = 1 endif if !exists("g:r_indent_ess_comments") let g:r_indent_ess_comments = 0 endif if !exists("g:r_indent_comment_column") let g:r_indent_comment_column = 40 endif if ! exists("g:r_indent_ess_compatible") let g:r_indent_ess_compatible = 0 endif if ! exists("g:r_indent_op_pattern") let g:r_indent_op_pattern = '\(&\||\|+\|-\|\*\|/\|=\|\~\|%\|->\)\s*$' endif function s:RDelete_quotes(line) let i = 0 let j = 0 let line1 = "" let llen = strlen(a:line) while i < llen if a:line[i] == '"' let i += 1 let line1 = line1 . 's' while !(a:line[i] == '"' && ((i > 1 && a:line[i-1] == '\' && a:line[i-2] == '\') || a:line[i-1] != '\')) && i < llen let i += 1 endwhile if a:line[i] == '"' let i += 1 endif else if a:line[i] == "'" let i += 1 let line1 = line1 . 's' while !(a:line[i] == "'" && ((i > 1 && a:line[i-1] == '\' && a:line[i-2] == '\') || a:line[i-1] != '\')) && i < llen let i += 1 endwhile if a:line[i] == "'" let i += 1 endif else if a:line[i] == "`" let i += 1 let line1 = line1 . 's' while a:line[i] != "`" && i < llen let i += 1 endwhile if a:line[i] == "`" let i += 1 endif endif endif endif if i == llen break endif let line1 = line1 . a:line[i] let j += 1 let i += 1 endwhile return line1 endfunction " Convert foo(bar()) int foo() function s:RDelete_parens(line) if s:Get_paren_balance(a:line, "(", ")") != 0 return a:line endif let i = 0 let j = 0 let line1 = "" let llen = strlen(a:line) while i < llen let line1 = line1 . a:line[i] if a:line[i] == '(' let nop = 1 while nop > 0 && i < llen let i += 1 if a:line[i] == ')' let nop -= 1 else if a:line[i] == '(' let nop += 1 endif endif endwhile let line1 = line1 . a:line[i] endif let i += 1 endwhile return line1 endfunction function! s:Get_paren_balance(line, o, c) let line2 = substitute(a:line, a:o, "", "g") let openp = strlen(a:line) - strlen(line2) let line3 = substitute(line2, a:c, "", "g") let closep = strlen(line2) - strlen(line3) return openp - closep endfunction function! s:Get_matching_brace(linenr, o, c, delbrace) let line = SanitizeRLine(getline(a:linenr)) if a:delbrace == 1 let line = substitute(line, '{$', "", "") endif let pb = s:Get_paren_balance(line, a:o, a:c) let i = a:linenr while pb != 0 && i > 1 let i -= 1 let pb += s:Get_paren_balance(SanitizeRLine(getline(i)), a:o, a:c) endwhile return i endfunction " This function is buggy because there 'if's without 'else' " It must be rewritten relying more on indentation function! s:Get_matching_if(linenr, delif) let line = SanitizeRLine(getline(a:linenr)) if a:delif let line = substitute(line, "if", "", "g") endif let elsenr = 0 let i = a:linenr let ifhere = 0 while i > 0 let line2 = substitute(line, '\', "xxx", "g") let elsenr += strlen(line) - strlen(line2) if line =~ '.*\s*if\s*()' || line =~ '.*\s*if\s*()' let elsenr -= 1 if elsenr == 0 let ifhere = i break endif endif let i -= 1 let line = SanitizeRLine(getline(i)) endwhile if ifhere return ifhere else return a:linenr endif endfunction function! s:Get_last_paren_idx(line, o, c, pb) let blc = a:pb let line = substitute(a:line, '\t', s:curtabstop, "g") let theidx = -1 let llen = strlen(line) let idx = 0 while idx < llen if line[idx] == a:o let blc -= 1 if blc == 0 let theidx = idx endif else if line[idx] == a:c let blc += 1 endif endif let idx += 1 endwhile return theidx + 1 endfunction " Get previous relevant line. Search back until getting a line that isn't " comment or blank 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 is also used by r-plugin/common_global.vim " Delete from '#' to the end of the line, unless the '#' is inside a string. function SanitizeRLine(line) let newline = s:RDelete_quotes(a:line) let newline = s:RDelete_parens(newline) let newline = substitute(newline, '#.*', "", "") let newline = substitute(newline, '\s*$', "", "") if &filetype == "rhelp" && newline =~ '^\\method{.*}{.*}(.*' let newline = substitute(newline, '^\\method{\(.*\)}{.*}', '\1', "") endif return newline endfunction function GetRIndent() let clnum = line(".") " current line let cline = getline(clnum) if cline =~ '^\s*#' if g:r_indent_ess_comments == 1 if cline =~ '^\s*###' return 0 endif if cline !~ '^\s*##' return g:r_indent_comment_column endif endif endif let cline = SanitizeRLine(cline) if cline =~ '^\s*}' || cline =~ '^\s*}\s*)$' let indline = s:Get_matching_brace(clnum, '{', '}', 1) if indline > 0 && indline != clnum let iline = SanitizeRLine(getline(indline)) if s:Get_paren_balance(iline, "(", ")") == 0 || iline =~ '(\s*{$' return indent(indline) else let indline = s:Get_matching_brace(indline, '(', ')', 1) return indent(indline) endif endif endif " Find the first non blank line above the current line let lnum = s:Get_prev_line(clnum) " Hit the start of the file, use zero indent. if lnum == 0 return 0 endif let line = SanitizeRLine(getline(lnum)) if &filetype == "rhelp" if cline =~ '^\\dontshow{' || cline =~ '^\\dontrun{' || cline =~ '^\\donttest{' || cline =~ '^\\testonly{' return 0 endif if line =~ '^\\examples{' || line =~ '^\\usage{' || line =~ '^\\dontshow{' || line =~ '^\\dontrun{' || line =~ '^\\donttest{' || line =~ '^\\testonly{' return 0 endif endif if &filetype == "rnoweb" && line =~ "^<<.*>>=" return 0 endif if cline =~ '^\s*{' && s:Get_paren_balance(cline, '{', '}') > 0 if g:r_indent_ess_compatible && line =~ ')$' let nlnum = lnum let nline = line while s:Get_paren_balance(nline, '(', ')') < 0 let nlnum = s:Get_prev_line(nlnum) let nline = SanitizeRLine(getline(nlnum)) . nline endwhile if nline =~ '^\s*function\s*(' && indent(nlnum) == &sw return 0 endif endif if s:Get_paren_balance(line, "(", ")") == 0 return indent(lnum) endif endif " line is an incomplete command: if line =~ '\<\(if\|while\|for\|function\)\s*()$' || line =~ '\$' return indent(lnum) + &sw endif " Deal with () and [] let pb = s:Get_paren_balance(line, '(', ')') if line =~ '^\s*{$' || line =~ '(\s*{' || (pb == 0 && (line =~ '{$' || line =~ '(\s*{$')) return indent(lnum) + &sw endif let s:curtabstop = repeat(' ', &tabstop) if g:r_indent_align_args == 1 if pb > 0 && line =~ '{$' return s:Get_last_paren_idx(line, '(', ')', pb) + &sw endif let bb = s:Get_paren_balance(line, '[', ']') if pb > 0 if &filetype == "rhelp" let ind = s:Get_last_paren_idx(line, '(', ')', pb) else let ind = s:Get_last_paren_idx(getline(lnum), '(', ')', pb) endif return ind endif if pb < 0 && line =~ '.*[,&|\-\*+<>]$' let lnum = s:Get_prev_line(lnum) while pb < 1 && lnum > 0 let line = SanitizeRLine(getline(lnum)) let line = substitute(line, '\t', s:curtabstop, "g") let ind = strlen(line) while ind > 0 if line[ind] == ')' let pb -= 1 else if line[ind] == '(' let pb += 1 endif endif if pb == 1 return ind + 1 endif let ind -= 1 endwhile let lnum -= 1 endwhile return 0 endif if bb > 0 let ind = s:Get_last_paren_idx(getline(lnum), '[', ']', bb) return ind endif endif let post_block = 0 if line =~ '}$' && s:Get_paren_balance(line, '{', '}') < 0 let lnum = s:Get_matching_brace(lnum, '{', '}', 0) let line = SanitizeRLine(getline(lnum)) if lnum > 0 && line =~ '^\s*{' let lnum = s:Get_prev_line(lnum) let line = SanitizeRLine(getline(lnum)) endif let pb = s:Get_paren_balance(line, '(', ')') let post_block = 1 endif " Indent after operator pattern let olnum = s:Get_prev_line(lnum) let oline = getline(olnum) if olnum > 0 if line =~ g:r_indent_op_pattern && s:Get_paren_balance(line, "(", ")") == 0 if oline =~ g:r_indent_op_pattern && s:Get_paren_balance(line, "(", ")") == 0 return indent(lnum) else return indent(lnum) + &sw endif else if oline =~ g:r_indent_op_pattern && s:Get_paren_balance(line, "(", ")") == 0 return indent(lnum) - &sw endif endif endif let post_fun = 0 if pb < 0 && line !~ ')\s*[,&|\-\*+<>]$' let post_fun = 1 while pb < 0 && lnum > 0 let lnum -= 1 let linepiece = SanitizeRLine(getline(lnum)) let pb += s:Get_paren_balance(linepiece, "(", ")") let line = linepiece . line endwhile if line =~ '{$' && post_block == 0 return indent(lnum) + &sw endif " Now we can do some tests again if cline =~ '^\s*{' return indent(lnum) endif if post_block == 0 let newl = SanitizeRLine(line) if newl =~ '\<\(if\|while\|for\|function\)\s*()$' || newl =~ '\ 0 let lnum -= 1 let linepiece = SanitizeRLine(getline(lnum)) let bb += s:Get_paren_balance(linepiece, "[", "]") let line = linepiece . line endwhile let line = s:RDelete_parens(line) endif let plnum = s:Get_prev_line(lnum) let ppost_else = 0 if plnum > 0 let pline = SanitizeRLine(getline(plnum)) let ppost_block = 0 if pline =~ '}$' let ppost_block = 1 let plnum = s:Get_matching_brace(plnum, '{', '}', 0) let pline = SanitizeRLine(getline(plnum)) if pline =~ '^\s*{$' && plnum > 0 let plnum = s:Get_prev_line(plnum) let pline = SanitizeRLine(getline(plnum)) endif endif if pline =~ 'else$' let ppost_else = 1 let plnum = s:Get_matching_if(plnum, 0) let pline = SanitizeRLine(getline(plnum)) endif if pline =~ '^\s*else\s*if\s*(' let pplnum = s:Get_prev_line(plnum) let ppline = SanitizeRLine(getline(pplnum)) while ppline =~ '^\s*else\s*if\s*(' || ppline =~ '^\s*if\s*()\s*\S$' let plnum = pplnum let pline = ppline let pplnum = s:Get_prev_line(plnum) let ppline = SanitizeRLine(getline(pplnum)) endwhile while ppline =~ '\<\(if\|while\|for\|function\)\s*()$' || ppline =~ '\ 0 let plnum -= 1 let linepiece = SanitizeRLine(getline(plnum)) let ppb += s:Get_paren_balance(linepiece, "(", ")") let pline = linepiece . pline endwhile let pline = s:RDelete_parens(pline) endif endif let ind = indent(lnum) if g:r_indent_align_args == 0 && pb != 0 let ind += pb * &sw return ind endif if g:r_indent_align_args == 0 && bb != 0 let ind += bb * &sw return ind endif if plnum > 0 let pind = indent(plnum) else let pind = 0 endif if ind == pind || (ind == (pind + &sw) && pline =~ '{$' && ppost_else == 0) return ind endif let pline = getline(plnum) let pbb = s:Get_paren_balance(pline, '[', ']') while pind < ind && plnum > 0 && ppb == 0 && pbb == 0 let ind = pind let plnum = s:Get_prev_line(plnum) let pline = getline(plnum) let ppb = s:Get_paren_balance(pline, '(', ')') let pbb = s:Get_paren_balance(pline, '[', ']') while pline =~ '^\s*else' let plnum = s:Get_matching_if(plnum, 1) let pline = getline(plnum) let ppb = s:Get_paren_balance(pline, '(', ')') let pbb = s:Get_paren_balance(pline, '[', ']') endwhile let pind = indent(plnum) if ind == (pind + &sw) && pline =~ '{$' return ind endif endwhile return ind endfunction " vim: sw=2 vim-7.4.1689/runtime/indent/readline.vim000066400000000000000000000012511267703067000200400ustar00rootroot00000000000000" Vim indent file " Language: readline configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2006-12-20 if exists("b:did_indent") finish endif let b:did_indent = 1 setlocal indentexpr=GetReadlineIndent() setlocal indentkeys=!^F,o,O,=$else,=$endif setlocal nosmartindent if exists("*GetReadlineIndent") finish endif function GetReadlineIndent() let lnum = prevnonblank(v:lnum - 1) if lnum == 0 return 0 endif let ind = indent(lnum) if getline(lnum) =~ '^\s*$\(if\|else\)\>' let ind = ind + &sw endif if getline(v:lnum) =~ '^\s*$\(else\|endif\)\>' let ind = ind - &sw endif return ind endfunction vim-7.4.1689/runtime/indent/rhelp.vim000066400000000000000000000054171267703067000173770ustar00rootroot00000000000000" Vim indent file " Language: R Documentation (Help), *.Rd " Author: Jakson Alves de Aquino " Homepage: https://github.com/jalvesaq/R-Vim-runtime " Last Change: Tue Apr 07, 2015 04:38PM " Only load this indent file when no other was loaded. if exists("b:did_indent") finish endif runtime indent/r.vim let s:RIndent = function(substitute(&indentexpr, "()", "", "")) let b:did_indent = 1 setlocal noautoindent setlocal nocindent setlocal nosmartindent setlocal nolisp setlocal indentkeys=0{,0},:,!^F,o,O,e setlocal indentexpr=GetCorrectRHelpIndent() " Only define the functions once. if exists("*GetRHelpIndent") finish endif function s:SanitizeRHelpLine(line) let newline = substitute(a:line, '\\\\', "x", "g") let newline = substitute(newline, '\\{', "x", "g") let newline = substitute(newline, '\\}', "x", "g") let newline = substitute(newline, '\\%', "x", "g") let newline = substitute(newline, '%.*', "", "") let newline = substitute(newline, '\s*$', "", "") return newline endfunction function GetRHelpIndent() let clnum = line(".") " current line if clnum == 1 return 0 endif let cline = getline(clnum) if cline =~ '^\s*}\s*$' let i = clnum let bb = -1 while bb != 0 && i > 1 let i -= 1 let line = s:SanitizeRHelpLine(getline(i)) let line2 = substitute(line, "{", "", "g") let openb = strlen(line) - strlen(line2) let line3 = substitute(line2, "}", "", "g") let closeb = strlen(line2) - strlen(line3) let bb += openb - closeb endwhile return indent(i) endif if cline =~ '^\s*#ifdef\>' || cline =~ '^\s*#endif\>' return 0 endif let lnum = clnum - 1 let line = getline(lnum) if line =~ '^\s*#ifdef\>' || line =~ '^\s*#endif\>' let lnum -= 1 let line = getline(lnum) endif while lnum > 1 && (line =~ '^\s*$' || line =~ '^#ifdef' || line =~ '^#endif') let lnum -= 1 let line = getline(lnum) endwhile if lnum == 1 return 0 endif let line = s:SanitizeRHelpLine(line) let line2 = substitute(line, "{", "", "g") let openb = strlen(line) - strlen(line2) let line3 = substitute(line2, "}", "", "g") let closeb = strlen(line2) - strlen(line3) let bb = openb - closeb let ind = indent(lnum) + (bb * &sw) if line =~ '^\s*}\s*$' let ind = indent(lnum) endif if ind < 0 return 0 endif return ind endfunction function GetCorrectRHelpIndent() let lastsection = search('^\\[a-z]*{', "bncW") let secname = getline(lastsection) if secname =~ '^\\usage{' || secname =~ '^\\examples{' || secname =~ '^\\dontshow{' || secname =~ '^\\dontrun{' || secname =~ '^\\donttest{' || secname =~ '^\\testonly{' || secname =~ '^\\method{.*}{.*}(' return s:RIndent() else return GetRHelpIndent() endif endfunction " vim: sw=2 vim-7.4.1689/runtime/indent/rmd.vim000066400000000000000000000022551267703067000170440ustar00rootroot00000000000000" Vim indent file " Language: Rmd " Author: Jakson Alves de Aquino " Homepage: https://github.com/jalvesaq/R-Vim-runtime " Last Change: Tue Apr 07, 2015 04:38PM " Only load this indent file when no other was loaded. if exists("b:did_indent") finish endif runtime indent/r.vim let s:RIndent = function(substitute(&indentexpr, "()", "", "")) let b:did_indent = 1 setlocal indentkeys=0{,0},:,!^F,o,O,e setlocal indentexpr=GetRmdIndent() if exists("*GetRmdIndent") finish endif function GetMdIndent() let pline = getline(v:lnum - 1) let cline = getline(v:lnum) if prevnonblank(v:lnum - 1) < v:lnum - 1 || cline =~ '^\s*[-\+\*]\s' || cline =~ '^\s*\d\+\.\s\+' return indent(v:lnum) elseif pline =~ '^\s*[-\+\*]\s' return indent(v:lnum - 1) + 2 elseif pline =~ '^\s*\d\+\.\s\+' return indent(v:lnum - 1) + 3 endif return indent(prevnonblank(v:lnum - 1)) endfunction function GetRmdIndent() if getline(".") =~ '^[ \t]*```{r .*}$' || getline(".") =~ '^[ \t]*```$' return 0 endif if search('^[ \t]*```{r', "bncW") > search('^[ \t]*```$', "bncW") return s:RIndent() else return GetMdIndent() endif endfunction " vim: sw=2 vim-7.4.1689/runtime/indent/rnoweb.vim000066400000000000000000000016041267703067000175530ustar00rootroot00000000000000" Vim indent file " Language: Rnoweb " Author: Jakson Alves de Aquino " Homepage: https://github.com/jalvesaq/R-Vim-runtime " Last Change: Tue Apr 07, 2015 04:38PM " Only load this indent file when no other was loaded. if exists("b:did_indent") finish endif runtime indent/tex.vim let s:TeXIndent = function(substitute(&indentexpr, "()", "", "")) unlet b:did_indent runtime indent/r.vim let s:RIndent = function(substitute(&indentexpr, "()", "", "")) let b:did_indent = 1 setlocal indentkeys=0{,0},!^F,o,O,e,},=\bibitem,=\item setlocal indentexpr=GetRnowebIndent() if exists("*GetRnowebIndent") finish endif function GetRnowebIndent() let curline = getline(".") if curline =~ '^<<.*>>=$' || curline =~ '^\s*@$' return 0 endif if search("^<<", "bncW") > search("^@", "bncW") return s:RIndent() endif return s:TeXIndent() endfunction " vim: sw=2 vim-7.4.1689/runtime/indent/rpl.vim000066400000000000000000000034531267703067000170600ustar00rootroot00000000000000" Vim indent file " Language: RPL/2 " Version: 0.2 " Last Change: 2005 Mar 28 " Maintainer: BERTRAND Jol " Only load this indent file when no other was loaded. if exists("b:did_indent") finish endif let b:did_indent = 1 setlocal autoindent 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 let b:undo_indent = "set ai< indentkeys< indentexpr<" 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 =~? '\' 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 vim-7.4.1689/runtime/indent/rrst.vim000066400000000000000000000022531267703067000172520ustar00rootroot00000000000000" Vim indent file " Language: Rrst " Author: Jakson Alves de Aquino " Homepage: https://github.com/jalvesaq/R-Vim-runtime " Last Change: Tue Apr 07, 2015 04:38PM " Only load this indent file when no other was loaded. if exists("b:did_indent") finish endif runtime indent/r.vim let s:RIndent = function(substitute(&indentexpr, "()", "", "")) let b:did_indent = 1 setlocal indentkeys=0{,0},:,!^F,o,O,e setlocal indentexpr=GetRrstIndent() if exists("*GetRrstIndent") finish endif function GetRstIndent() let pline = getline(v:lnum - 1) let cline = getline(v:lnum) if prevnonblank(v:lnum - 1) < v:lnum - 1 || cline =~ '^\s*[-\+\*]\s' || cline =~ '^\s*\d\+\.\s\+' return indent(v:lnum) elseif pline =~ '^\s*[-\+\*]\s' return indent(v:lnum - 1) + 2 elseif pline =~ '^\s*\d\+\.\s\+' return indent(v:lnum - 1) + 3 endif return indent(prevnonblank(v:lnum - 1)) endfunction function GetRrstIndent() if getline(".") =~ '^\.\. {r .*}$' || getline(".") =~ '^\.\. \.\.$' return 0 endif if search('^\.\. {r', "bncW") > search('^\.\. \.\.$', "bncW") return s:RIndent() else return GetRstIndent() endif endfunction " vim: sw=2 vim-7.4.1689/runtime/indent/rst.vim000066400000000000000000000025531267703067000170730ustar00rootroot00000000000000" Vim indent file " Language: reStructuredText Documentation Format " Maintainer: Nikolai Weibull " Latest Revision: 2011-08-03 if exists("b:did_indent") finish endif let b:did_indent = 1 setlocal indentexpr=GetRSTIndent() setlocal indentkeys=!^F,o,O setlocal nosmartindent if exists("*GetRSTIndent") finish endif let s:itemization_pattern = '^\s*[-*+]\s' let s:enumeration_pattern = '^\s*\%(\d\+\|#\)\.\s\+' 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:itemization_pattern let ind += 2 elseif line =~ s:enumeration_pattern let ind += matchend(line, s:enumeration_pattern) endif let line = getline(v:lnum - 1) " Indent :FIELD: lines. Don’t match if there is no text after the field or " if the text ends with a sent-ender. if line =~ '^:.\+:\s\{-1,\}\S.\+[^.!?:]$' return matchend(line, '^:.\{-1,}:\s\+') endif if line =~ '^\s*$' execute lnum call search('^\s*\%([-*+]\s\|\%(\d\+\|#\)\.\s\|\.\.\|$\)', 'bW') let line = getline('.') if line =~ s:itemization_pattern let ind -= 2 elseif line =~ s:enumeration_pattern let ind -= matchend(line, s:enumeration_pattern) elseif line =~ '^\s*\.\.' let ind -= 3 endif endif return ind endfunction vim-7.4.1689/runtime/indent/ruby.vim000066400000000000000000000422121267703067000172400ustar00rootroot00000000000000" Vim indent file " Language: Ruby " Maintainer: Nikolai Weibull " URL: https://github.com/vim-ruby/vim-ruby " Release Coordinator: Doug Kearns " 0. Initialization {{{1 " ================= " Only load this indent file when no other was loaded. if exists("b:did_indent") finish endif let b:did_indent = 1 setlocal nosmartindent " Now, set up our indentation expression and keys that trigger it. setlocal indentexpr=GetRubyIndent(v:lnum) setlocal indentkeys=0{,0},0),0],!^F,o,O,e setlocal indentkeys+==end,=else,=elsif,=when,=ensure,=rescue,==begin,==end " Only define the function once. if exists("*GetRubyIndent") finish endif let s:cpo_save = &cpo set cpo&vim " 1. Variables {{{1 " ============ " Regex of syntax group names that are or delimit strings/symbols or are comments. let s:syng_strcom = '\' " Regex of syntax group names that are strings. let s:syng_string = \ '\' " Regex of syntax group names that are strings or documentation. let s:syng_stringdoc = \'\' " Expression used to check whether we should skip a match with searchpair(). let s:skip_expr = \ "synIDattr(synID(line('.'),col('.'),1),'name') =~ '".s:syng_strcom."'" " Regex used for words that, at the start of a line, add a level of indent. let s:ruby_indent_keywords = '^\s*\zs\<\%(module\|class\|def\|if\|for' . \ '\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure' . \ '\|rescue\):\@!\>' . \ '\|\%([=,*/%+-]\|<<\|>>\|:\s\)\s*\zs' . \ '\<\%(if\|for\|while\|until\|case\|unless\|begin\):\@!\>' " Regex used for words that, at the start of a line, remove a level of indent. let s:ruby_deindent_keywords = \ '^\s*\zs\<\%(ensure\|else\|rescue\|elsif\|when\|end\):\@!\>' " Regex that defines the start-match for the 'end' keyword. "let s:end_start_regex = '\%(^\|[^.]\)\<\%(module\|class\|def\|if\|for\|while\|until\|case\|unless\|begin\|do\)\>' " TODO: the do here should be restricted somewhat (only at end of line)? let s:end_start_regex = \ '\C\%(^\s*\|[=,*/%+\-|;{]\|<<\|>>\|:\s\)\s*\zs' . \ '\<\%(module\|class\|def\|if\|for\|while\|until\|case\|unless\|begin\):\@!\>' . \ '\|\%(^\|[^.:@$]\)\@<=\' " Regex that defines the middle-match for the 'end' keyword. let s:end_middle_regex = '\<\%(ensure\|else\|\%(\%(^\|;\)\s*\)\@<=\\|when\|elsif\):\@!\>' " Regex that defines the end-match for the 'end' keyword. let s:end_end_regex = '\%(^\|[^.:@$]\)\@<=\' " Expression used for searchpair() call for finding match for 'end' keyword. let s:end_skip_expr = s:skip_expr . \ ' || (expand("") == "do"' . \ ' && getline(".") =~ "^\\s*\\<\\(while\\|until\\|for\\):\\@!\\>")' " Regex that defines continuation lines, not including (, {, or [. let s:non_bracket_continuation_regex = '\%([\\.,:*/%+]\|\\|%\@ 0 " Go in and out of blocks comments as necessary. " If the line isn't empty (with opt. comment) or in a string, end search. let line = getline(lnum) if line =~ '^=begin' if in_block let in_block = 0 else break endif elseif !in_block && line =~ '^=end' let in_block = 1 elseif !in_block && line !~ '^\s*#.*$' && !(s:IsInStringOrComment(lnum, 1) \ && s:IsInStringOrComment(lnum, strlen(line))) break endif let lnum = prevnonblank(lnum - 1) endwhile return lnum endfunction " Find line above 'lnum' that started the continuation 'lnum' may be part of. function s:GetMSL(lnum) " Start on the line we're at and use its indent. let msl = a:lnum let msl_body = getline(msl) let lnum = s:PrevNonBlankNonString(a:lnum - 1) while lnum > 0 " If we have a continuation line, or we're in a string, use line as MSL. " Otherwise, terminate search as we have found our MSL already. let line = getline(lnum) if s:Match(lnum, s:splat_regex) " If the above line looks like the "*" of a splat, use the current one's " indentation. " " Example: " Hash[* " method_call do " something " return msl elseif s:Match(line, s:non_bracket_continuation_regex) && \ s:Match(msl, s:non_bracket_continuation_regex) " If the current line is a non-bracket continuation and so is the " previous one, keep its indent and continue looking for an MSL. " " Example: " method_call one, " two, " three " let msl = lnum elseif s:Match(lnum, s:non_bracket_continuation_regex) && \ (s:Match(msl, s:bracket_continuation_regex) || s:Match(msl, s:block_continuation_regex)) " If the current line is a bracket continuation or a block-starter, but " the previous is a non-bracket one, respect the previous' indentation, " and stop here. " " Example: " method_call one, " two { " three " return lnum elseif s:Match(lnum, s:bracket_continuation_regex) && \ (s:Match(msl, s:bracket_continuation_regex) || s:Match(msl, s:block_continuation_regex)) " If both lines are bracket continuations (the current may also be a " block-starter), use the current one's and stop here " " Example: " method_call( " other_method_call( " foo return msl elseif s:Match(lnum, s:block_regex) && \ !s:Match(msl, s:continuation_regex) && \ !s:Match(msl, s:block_continuation_regex) " If the previous line is a block-starter and the current one is " mostly ordinary, use the current one as the MSL. " " Example: " method_call do " something " something_else return msl else let col = match(line, s:continuation_regex) + 1 if (col > 0 && !s:IsInStringOrComment(lnum, col)) \ || s:IsInString(lnum, strlen(line)) let msl = lnum else break endif endif let msl_body = getline(msl) let lnum = s:PrevNonBlankNonString(lnum - 1) endwhile return msl endfunction " Check if line 'lnum' has more opening brackets than closing ones. function s:ExtraBrackets(lnum) let opening = {'parentheses': [], 'braces': [], 'brackets': []} let closing = {'parentheses': [], 'braces': [], 'brackets': []} let line = getline(a:lnum) let pos = match(line, '[][(){}]', 0) " Save any encountered opening brackets, and remove them once a matching " closing one has been found. If a closing bracket shows up that doesn't " close anything, save it for later. while pos != -1 if !s:IsInStringOrComment(a:lnum, pos + 1) if line[pos] == '(' call add(opening.parentheses, {'type': '(', 'pos': pos}) elseif line[pos] == ')' if empty(opening.parentheses) call add(closing.parentheses, {'type': ')', 'pos': pos}) else let opening.parentheses = opening.parentheses[0:-2] endif elseif line[pos] == '{' call add(opening.braces, {'type': '{', 'pos': pos}) elseif line[pos] == '}' if empty(opening.braces) call add(closing.braces, {'type': '}', 'pos': pos}) else let opening.braces = opening.braces[0:-2] endif elseif line[pos] == '[' call add(opening.brackets, {'type': '[', 'pos': pos}) elseif line[pos] == ']' if empty(opening.brackets) call add(closing.brackets, {'type': ']', 'pos': pos}) else let opening.brackets = opening.brackets[0:-2] endif endif endif let pos = match(line, '[][(){}]', pos + 1) endwhile " Find the rightmost brackets, since they're the ones that are important in " both opening and closing cases let rightmost_opening = {'type': '(', 'pos': -1} let rightmost_closing = {'type': ')', 'pos': -1} for opening in opening.parentheses + opening.braces + opening.brackets if opening.pos > rightmost_opening.pos let rightmost_opening = opening endif endfor for closing in closing.parentheses + closing.braces + closing.brackets if closing.pos > rightmost_closing.pos let rightmost_closing = closing endif endfor return [rightmost_opening, rightmost_closing] endfunction function s:Match(lnum, regex) let col = match(getline(a:lnum), '\C'.a:regex) + 1 return col > 0 && !s:IsInStringOrComment(a:lnum, col) ? col : 0 endfunction function s:MatchLast(lnum, regex) let line = getline(a:lnum) let col = match(line, '.*\zs' . a:regex) while col != -1 && s:IsInStringOrComment(a:lnum, col) let line = strpart(line, 0, col) let col = match(line, '.*' . a:regex) endwhile return col + 1 endfunction " 3. GetRubyIndent Function {{{1 " ========================= function GetRubyIndent(...) " 3.1. Setup {{{2 " ---------- " For the current line, use the first argument if given, else v:lnum let clnum = a:0 ? a:1 : v:lnum " Set up variables for restoring position in file. Could use clnum here. let vcol = col('.') " 3.2. Work on the current line {{{2 " ----------------------------- " Get the current line. let line = getline(clnum) let ind = -1 " If we got a closing bracket on an empty line, find its match and indent " according to it. For parentheses we indent to its column - 1, for the " others we indent to the containing line's MSL's level. Return -1 if fail. let col = matchend(line, '^\s*[]})]') if col > 0 && !s:IsInStringOrComment(clnum, col) call cursor(clnum, col) let bs = strpart('(){}[]', stridx(')}]', line[col - 1]) * 2, 2) if searchpair(escape(bs[0], '\['), '', bs[1], 'bW', s:skip_expr) > 0 if line[col-1]==')' && col('.') != col('$') - 1 let ind = virtcol('.') - 1 else let ind = indent(s:GetMSL(line('.'))) endif endif return ind endif " If we have a =begin or =end set indent to first column. if match(line, '^\s*\%(=begin\|=end\)$') != -1 return 0 endif " If we have a deindenting keyword, find its match and indent to its level. " TODO: this is messy if s:Match(clnum, s:ruby_deindent_keywords) call cursor(clnum, 1) if searchpair(s:end_start_regex, s:end_middle_regex, s:end_end_regex, 'bW', \ s:end_skip_expr) > 0 let msl = s:GetMSL(line('.')) let line = getline(line('.')) if strpart(line, 0, col('.') - 1) =~ '=\s*$' && \ strpart(line, col('.') - 1, 2) !~ 'do' let ind = virtcol('.') - 1 elseif getline(msl) =~ '=\s*\(#.*\)\=$' let ind = indent(line('.')) else let ind = indent(msl) endif endif return ind endif " If we are in a multi-line string or line-comment, don't do anything to it. if s:IsInStringOrDocumentation(clnum, matchend(line, '^\s*') + 1) return indent('.') endif " If we are at the closing delimiter of a "<<" heredoc-style string, set the " indent to 0. if line =~ '^\k\+\s*$' \ && s:IsInStringDelimiter(clnum, 1) \ && search('\V<<'.line, 'nbW') > 0 return 0 endif " 3.3. Work on the previous line. {{{2 " ------------------------------- " Find a non-blank, non-multi-line string line above the current line. let lnum = s:PrevNonBlankNonString(clnum - 1) " If the line is empty and inside a string, use the previous line. if line =~ '^\s*$' && lnum != prevnonblank(clnum - 1) return indent(prevnonblank(clnum)) endif " At the start of the file use zero indent. if lnum == 0 return 0 endif " Set up variables for the previous line. let line = getline(lnum) let ind = indent(lnum) " If the previous line ended with a block opening, add a level of indent. if s:Match(lnum, s:block_regex) return indent(s:GetMSL(lnum)) + &sw endif " If the previous line ended with the "*" of a splat, add a level of indent if line =~ s:splat_regex return indent(lnum) + &sw endif " If the previous line contained unclosed opening brackets and we are still " in them, find the rightmost one and add indent depending on the bracket " type. " " If it contained hanging closing brackets, find the rightmost one, find its " match and indent according to that. if line =~ '[[({]' || line =~ '[])}]\s*\%(#.*\)\=$' let [opening, closing] = s:ExtraBrackets(lnum) if opening.pos != -1 if opening.type == '(' && searchpair('(', '', ')', 'bW', s:skip_expr) > 0 if col('.') + 1 == col('$') return ind + &sw else return virtcol('.') endif else let nonspace = matchend(line, '\S', opening.pos + 1) - 1 return nonspace > 0 ? nonspace : ind + &sw endif elseif closing.pos != -1 call cursor(lnum, closing.pos + 1) normal! % if s:Match(line('.'), s:ruby_indent_keywords) return indent('.') + &sw else return indent('.') endif else call cursor(clnum, vcol) end endif " If the previous line ended with an "end", match that "end"s beginning's " indent. let col = s:Match(lnum, '\%(^\|[^.:@$]\)\\s*\%(#.*\)\=$') if col > 0 call cursor(lnum, col) if searchpair(s:end_start_regex, '', s:end_end_regex, 'bW', \ s:end_skip_expr) > 0 let n = line('.') let ind = indent('.') let msl = s:GetMSL(n) if msl != n let ind = indent(msl) end return ind endif end let col = s:Match(lnum, s:ruby_indent_keywords) if col > 0 call cursor(lnum, col) let ind = virtcol('.') - 1 + &sw " TODO: make this better (we need to count them) (or, if a searchpair " fails, we know that something is lacking an end and thus we indent a " level if s:Match(lnum, s:end_end_regex) let ind = indent('.') endif return ind endif " 3.4. Work on the MSL line. {{{2 " -------------------------- " Set up variables to use and search for MSL to the previous line. let p_lnum = lnum let lnum = s:GetMSL(lnum) " If the previous line wasn't a MSL and is continuation return its indent. " TODO: the || s:IsInString() thing worries me a bit. if p_lnum != lnum if s:Match(p_lnum, s:non_bracket_continuation_regex) || s:IsInString(p_lnum,strlen(line)) return ind endif endif " Set up more variables, now that we know we wasn't continuation bound. let line = getline(lnum) let msl_ind = indent(lnum) " If the MSL line had an indenting keyword in it, add a level of indent. " TODO: this does not take into account contrived things such as " module Foo; class Bar; end if s:Match(lnum, s:ruby_indent_keywords) let ind = msl_ind + &sw if s:Match(lnum, s:end_end_regex) let ind = ind - &sw endif return ind endif " If the previous line ended with [*+/.,-=], but wasn't a block ending or a " closing bracket, indent one extra level. if s:Match(lnum, s:non_bracket_continuation_regex) && !s:Match(lnum, '^\s*\([\])}]\|end\)') if lnum == p_lnum let ind = msl_ind + &sw else let ind = msl_ind endif return ind endif " }}}2 return ind endfunction " }}}1 let &cpo = s:cpo_save unlet s:cpo_save " vim:set sw=2 sts=2 ts=8 et: vim-7.4.1689/runtime/indent/sass.vim000066400000000000000000000017721267703067000172360ustar00rootroot00000000000000" Vim indent file " Language: Sass " Maintainer: Tim Pope " Last Change: 2013 May 30 if exists("b:did_indent") finish endif let b:did_indent = 1 setlocal autoindent sw=2 et setlocal indentexpr=GetSassIndent() setlocal indentkeys=o,O,*,<:>,!^F " Only define the function once. if exists("*GetSassIndent") finish endif let s:property = '^\s*:\|^\s*[[:alnum:]#{}-]\+\%(:\|\s*=\)' let s:extend = '^\s*\%(@extend\|@include\|+\)' function! GetSassIndent() let lnum = prevnonblank(v:lnum-1) let line = substitute(getline(lnum),'\s\+$','','') let cline = substitute(substitute(getline(v:lnum),'\s\+$','',''),'^\s\+','','') let lastcol = strlen(line) let line = substitute(line,'^\s\+','','') let indent = indent(lnum) let cindent = indent(v:lnum) if line !~ s:property && line !~ s:extend && cline =~ s:property return indent + &sw "elseif line =~ s:property && cline !~ s:property "return indent - &sw else return -1 endif endfunction " vim:set sw=2: vim-7.4.1689/runtime/indent/scheme.vim000066400000000000000000000003611267703067000175220ustar00rootroot00000000000000" Vim indent file " Language: Scheme " Maintainer: Sergey Khorev " Last Change: 2005 Jun 24 " Only load this indent file when no other was loaded. if exists("b:did_indent") finish endif runtime! indent/lisp.vim vim-7.4.1689/runtime/indent/scss.vim000066400000000000000000000002771267703067000172370ustar00rootroot00000000000000" Vim indent file " Language: SCSS " Maintainer: Tim Pope " Last Change: 2010 Jul 26 if exists("b:did_indent") finish endif runtime! indent/css.vim " vim:set sw=2: vim-7.4.1689/runtime/indent/sdl.vim000066400000000000000000000053171267703067000170460ustar00rootroot00000000000000" Vim indent file " Language: SDL " Maintainer: Michael Piefel " Last Change: 10 December 2011 " 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,* " Only define the function once. if exists("*GetSDLIndent") " finish endif let s:cpo_save = &cpo set cpo&vim 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 let &cpo = s:cpo_save unlet s:cpo_save " vim:sw=2 vim-7.4.1689/runtime/indent/sh.vim000066400000000000000000000113261267703067000166730ustar00rootroot00000000000000" Vim indent file " Language: Shell Script " Maintainer: Christian Brabandt " Previous Maintainer: Peter Aronoff " Original Author: Nikolai Weibull " Latest Revision: 2016-02-15 " License: Vim (see :h license) " Repository: https://github.com/chrisbra/vim-sh-indent if exists("b:did_indent") finish endif let b:did_indent = 1 setlocal indentexpr=GetShIndent() setlocal indentkeys+=0=then,0=do,0=else,0=elif,0=fi,0=esac,0=done,0=end,),0=;;,0=;& setlocal indentkeys+=0=fin,0=fil,0=fip,0=fir,0=fix setlocal indentkeys-=:,0# setlocal nosmartindent let b:undo_indent = 'setlocal indentexpr< indentkeys< smartindent<' if exists("*GetShIndent") finish endif let s:cpo_save = &cpo set cpo&vim function s:buffer_shiftwidth() return shiftwidth() endfunction let s:sh_indent_defaults = { \ 'default': function('s:buffer_shiftwidth'), \ 'continuation-line': function('s:buffer_shiftwidth'), \ 'case-labels': function('s:buffer_shiftwidth'), \ 'case-statements': function('s:buffer_shiftwidth'), \ 'case-breaks': 0 } function! s:indent_value(option) let Value = exists('b:sh_indent_options') \ && has_key(b:sh_indent_options, a:option) ? \ b:sh_indent_options[a:option] : \ s:sh_indent_defaults[a:option] if type(Value) == type(function('type')) return Value() endif return Value endfunction function! GetShIndent() let lnum = prevnonblank(v:lnum - 1) if lnum == 0 return 0 endif let pnum = prevnonblank(lnum - 1) let ind = indent(lnum) let line = getline(lnum) if line =~ '^\s*\%(if\|then\|do\|else\|elif\|case\|while\|until\|for\|select\|foreach\)\>' if line !~ '\<\%(fi\|esac\|done\|end\)\>\s*\%(#.*\)\=$' let ind += s:indent_value('default') endif elseif s:is_case_label(line, pnum) if !s:is_case_ended(line) let ind += s:indent_value('case-statements') endif elseif line =~ '^\s*\<\k\+\>\s*()\s*{' || line =~ '^\s*{' || line =~ '^\s*function\s*\w\S\+\s*\%(()\)\?\s*{' if line !~ '}\s*\%(#.*\)\=$' let ind += s:indent_value('default') endif elseif s:is_continuation_line(line) if pnum == 0 || !s:is_continuation_line(getline(pnum)) let ind += s:indent_value('continuation-line') endif elseif pnum != 0 && s:is_continuation_line(getline(pnum)) let ind = indent(s:find_continued_lnum(pnum)) endif let pine = line let line = getline(v:lnum) if line =~ '^\s*\%(then\|do\|else\|elif\|fi\|done\|end\)\>' || line =~ '^\s*}' let ind -= s:indent_value('default') elseif line =~ '^\s*esac\>' && s:is_case_empty(getline(v:lnum - 1)) let ind -= s:indent_value('default') elseif line =~ '^\s*esac\>' let ind -= (s:is_case_label(pine, lnum) && s:is_case_ended(pine) ? \ 0 : s:indent_value('case-statements')) + \ s:indent_value('case-labels') if s:is_case_break(pine) let ind += s:indent_value('case-breaks') endif elseif s:is_case_label(line, lnum) if s:is_case(pine) let ind = indent(lnum) + s:indent_value('case-labels') else let ind -= (s:is_case_label(pine, lnum) && s:is_case_ended(pine) ? \ 0 : s:indent_value('case-statements')) - \ s:indent_value('case-breaks') endif elseif s:is_case_break(line) let ind -= s:indent_value('case-breaks') endif return ind endfunction function! s:is_continuation_line(line) return a:line =~ '\%(\%(^\|[^\\]\)\\\|&&\|||\)$' endfunction function! s:find_continued_lnum(lnum) let i = a:lnum while i > 1 && s:is_continuation_line(getline(i - 1)) let i -= 1 endwhile return i endfunction function! s:is_case_label(line, pnum) if a:line !~ '^\s*(\=.*)' return 0 endif if a:pnum > 0 let pine = getline(a:pnum) if !(s:is_case(pine) || s:is_case_ended(pine)) return 0 endif endif let suffix = substitute(a:line, '^\s*(\=', "", "") let nesting = 0 let i = 0 let n = strlen(suffix) while i < n let c = suffix[i] let i += 1 if c == '\\' let i += 1 elseif c == '(' let nesting += 1 elseif c == ')' if nesting == 0 return 1 endif let nesting -= 1 endif endwhile return 0 endfunction function! s:is_case(line) return a:line =~ '^\s*case\>' endfunction function! s:is_case_break(line) return a:line =~ '^\s*;[;&]' endfunction function! s:is_case_ended(line) return s:is_case_break(a:line) || a:line =~ ';[;&]\s*\%(#.*\)\=$' endfunction function! s:is_case_empty(line) if a:line =~ '^\s*$' || a:line =~ '^\s*#' return s:is_case_empty(getline(v:lnum - 1)) else return a:line =~ '^\s*case\>' endif endfunction let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/indent/sml.vim000066400000000000000000000144221267703067000170540ustar00rootroot00000000000000" Vim indent file " Language: SML " Maintainer: Saikat Guha " Hubert Chao " Original OCaml Version: " Jean-Francois Yuen " Mike Leary " Markus Mottl " OCaml URL: http://www.oefai.at/~markus/vim/indent/ocaml.vim " Last Change: 2003 Jan 04 - Adapted to SML " 2002 Nov 06 - Some fixes (JY) " 2002 Oct 28 - Fixed bug with indentation of ']' (MM) " 2002 Oct 22 - Major rewrite (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=GetSMLIndent() setlocal indentkeys+=0=and,0=else,0=end,0=handle,0=if,0=in,0=let,0=then,0=val,0=fun,0=\|,0=*),0) setlocal nolisp setlocal nosmartindent setlocal textwidth=80 setlocal shiftwidth=2 " Comment formatting if (has("comments")) set comments=sr:(*,mb:*,ex:*) set fo=cqort endif " Only define the function once. "if exists("*GetSMLIndent") "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 = '\<\%(let\|sig\|struct\)\>' 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"')) let lno = searchpair(a:pstart, a:pmid, a:pend, 'bW', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"') if lno == -1 return indent(lno) else return col(".") - 1 endif endfunction 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"')) let lno = searchpair(a:pstart, a:pmid, a:pend, 'bW', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"') let moduleLine = getline(lno) if lno == -1 || moduleLine =~ '^\s*\(fun\|structure\|signature\)\>' return indent(lno) else return col(".") - 1 endif 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\\>.*=.*\\.*=\\s*$\\|" . s:beflet')) "endfunction function! GetSMLIndent() " 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 elseif lline =~ '^\s*val\>.*=\s*$' return ind + &sw endif let line = getline(v:lnum) " Indent lines starting with 'end' to matching module if line =~ '^\s*end\>' return s:FindLet(s:module, '', '\') " Match 'else' with 'if' elseif line =~ '^\s*else\>' if lline !~ '^\s*\(if\|else\|then\)\>' return s:FindPair('\', '', '\') else return ind endif " Match 'then' with 'if' elseif line =~ '^\s*then\>' if lline !~ '^\s*\(if\|else\|then\)\>' return s:FindPair('\', '', '\') else return ind endif " Indent if current line begins with ']' elseif line =~ '^\s*\]' return s:FindPair('\[','','\]') " Indent current line starting with 'in' to last matching 'let' elseif line =~ '^\s*in\>' let ind = s:FindLet('\','','\') " Indent from last matching module if line matches: elseif line =~ '^\s*\(fun\|val\|open\|structure\|and\|datatype\|type\|exception\)\>' cursor(lnum,1) let lastModule = indent(searchpair(s:module, '', '\', 'bWn', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"')) if lastModule == -1 return 0 else return lastModule + &sw endif " Indent lines starting with '|' from matching 'case', 'handle' elseif line =~ '^\s*|' " cursor(lnum,1) let lastSwitch = search('\<\(case\|handle\|fun\|datatype\)\>','bW') let switchLine = getline(lastSwitch) let switchLineIndent = indent(lastSwitch) if lline =~ '^\s*|' return ind endif if switchLine =~ '\' return col(".") + 2 elseif switchLine =~ '\' return switchLineIndent + &sw elseif switchLine =~ '\' call search('=') return col(".") - 1 else return switchLineIndent + 2 endif " Indent if last line ends with 'sig', 'struct', 'let', 'then', 'else', " 'in' elseif lline =~ '\<\(sig\|struct\|let\|in\|then\|else\)\s*$' let ind = ind + &sw " Indent if last line ends with 'of', align from 'case' elseif lline =~ '\<\(of\)\s*$' call search('\',"bW") let ind = col(".")+4 " Indent if current line starts with 'of' elseif line =~ '^\s*of\>' call search('\',"bW") let ind = col(".")+1 " Indent if last line starts with 'fun', 'case', 'fn' elseif lline =~ '^\s*\(fun\|fn\|case\)\>' let ind = ind + &sw endif " Don't indent 'let' if last line started with 'fun', 'fn' if line =~ '^\s*let\>' if lline =~ '^\s*\(fun\|fn\)' let ind = ind - &sw endif endif return ind endfunction " vim:sw=2 vim-7.4.1689/runtime/indent/sql.vim000066400000000000000000000022641267703067000170610ustar00rootroot00000000000000" Vim indent file loader " Language: SQL " Maintainer: David Fishburn " Last Change: Thu Sep 15 2005 10:27:51 AM " Version: 1.0 " Download: http://vim.sourceforge.net/script.php?script_id=495 " Description: Checks for a: " buffer local variable, " global variable, " If the above exist, it will source the type specified. " If none exist, it will source the default sqlanywhere.vim file. " Only load this indent file when no other was loaded. if exists("b:did_indent") finish endif " Default to the standard Vim distribution file let filename = 'sqlanywhere' " Check for overrides. Buffer variables have the highest priority. if exists("b:sql_type_override") " Check the runtimepath to see if the file exists if globpath(&runtimepath, 'indent/'.b:sql_type_override.'.vim') != '' let filename = b:sql_type_override endif elseif exists("g:sql_type_default") if globpath(&runtimepath, 'indent/'.g:sql_type_default.'.vim') != '' let filename = g:sql_type_default endif endif " Source the appropriate file exec 'runtime indent/'.filename.'.vim' " vim:sw=4: vim-7.4.1689/runtime/indent/sqlanywhere.vim000066400000000000000000000314231267703067000206230ustar00rootroot00000000000000" Vim indent file " Language: SQL " Maintainer: David Fishburn " Last Change: 2012 Dec 06 " Version: 3.0 " Download: http://vim.sourceforge.net/script.php?script_id=495 " Notes: " Indenting keywords are based on Oracle and Sybase Adaptive Server " Anywhere (ASA). Test indenting was done with ASA stored procedures and " fuctions and Oracle packages which contain stored procedures and " functions. " This has not been tested against Microsoft SQL Server or " Sybase Adaptive Server Enterprise (ASE) which use the Transact-SQL " syntax. That syntax does not have end tags for IF's, which makes " indenting more difficult. " " Known Issues: " The Oracle MERGE statement does not have an end tag associated with " it, this can leave the indent hanging to the right one too many. " " History: " 3.0 (Dec 2012) " Added cpo check " " 2.0 " Added the FOR keyword to SQLBlockStart to handle (Alec Tica): " for i in 1..100 loop " |<-- I expect to have indentation here " end loop; " " Only load this indent file when no other was loaded. if exists("b:did_indent") finish endif let b:did_indent = 1 let b:current_indent = "sqlanywhere" setlocal indentkeys-=0{ setlocal indentkeys-=0} setlocal indentkeys-=: setlocal indentkeys-=0# setlocal indentkeys-=e " This indicates formatting should take place when one of these " expressions is used. These expressions would normally be something " you would type at the BEGINNING of a line " SQL is generally case insensitive, so this files assumes that " These keywords are something that would trigger an indent LEFT, not " an indent right, since the SQLBlockStart is used for those keywords setlocal indentkeys+==~end,=~else,=~elseif,=~elsif,0=~when,0=) " GetSQLIndent is executed whenever one of the expressions " in the indentkeys is typed setlocal indentexpr=GetSQLIndent() " Only define the functions once. if exists("*GetSQLIndent") finish endif let s:keepcpo= &cpo set cpo&vim " List of all the statements that start a new block. " These are typically words that start a line. " IS is excluded, since it is difficult to determine when the " ending block is (especially for procedures/functions). let s:SQLBlockStart = '^\s*\%('. \ 'if\|else\|elseif\|elsif\|'. \ 'while\|loop\|do\|for\|'. \ 'begin\|'. \ 'case\|when\|merge\|exception'. \ '\)\>' let s:SQLBlockEnd = '^\s*\(end\)\>' " The indent level is also based on unmatched paranethesis " If a line has an extra "(" increase the indent " If a line has an extra ")" decrease the indent function! s:CountUnbalancedParan( line, paran_to_check ) let l = a:line let lp = substitute(l, '[^(]', '', 'g') let l = a:line let rp = substitute(l, '[^)]', '', 'g') if a:paran_to_check =~ ')' " echom 'CountUnbalancedParan ) returning: ' . " \ (strlen(rp) - strlen(lp)) return (strlen(rp) - strlen(lp)) elseif a:paran_to_check =~ '(' " echom 'CountUnbalancedParan ( returning: ' . " \ (strlen(lp) - strlen(rp)) return (strlen(lp) - strlen(rp)) else " echom 'CountUnbalancedParan unknown paran to check: ' . " \ a:paran_to_check return 0 endif endfunction " Unindent commands based on previous indent level function! s:CheckToIgnoreRightParan( prev_lnum, num_levels ) let lnum = a:prev_lnum let line = getline(lnum) let ends = 0 let num_right_paran = a:num_levels let ignore_paran = 0 let vircol = 1 while num_right_paran > 0 silent! exec 'norm! '.lnum."G\".vircol."\" let right_paran = search( ')', 'W' ) if right_paran != lnum " This should not happen since there should be at least " num_right_paran matches for this line break endif let vircol = virtcol(".") " if getline(".") =~ '^)' let matching_paran = searchpair('(', '', ')', 'bW', \ 's:IsColComment(line("."), col("."))') if matching_paran < 1 " No match found " echom 'CTIRP - no match found, ignoring' break endif if matching_paran == lnum " This was not an unmatched parantenses, start the search again " again after this column " echom 'CTIRP - same line match, ignoring' continue endif " echom 'CTIRP - match: ' . line(".") . ' ' . getline(".") if getline(matching_paran) =~? '\(if\|while\)\>' " echom 'CTIRP - if/while ignored: ' . line(".") . ' ' . getline(".") let ignore_paran = ignore_paran + 1 endif " One match found, decrease and check for further matches let num_right_paran = num_right_paran - 1 endwhile " Fallback - just move back one " return a:prev_indent - &sw return ignore_paran endfunction " Based on the keyword provided, loop through previous non empty " non comment lines to find the statement that initated the keyword. " Return its indent level " CASE .. " WHEN ... " Should return indent level of CASE " EXCEPTION .. " WHEN ... " something; " WHEN ... " Should return indent level of exception. function! s:GetStmtStarterIndent( keyword, curr_lnum ) let lnum = a:curr_lnum " Default - reduce indent by 1 let ind = indent(a:curr_lnum) - &sw if a:keyword =~? 'end' exec 'normal! ^' let stmts = '^\s*\%('. \ '\\|' . \ '\%(\%(\\)\|' . \ '\%(\%(\\)\|' . \ '\%(\%(\\)\|' . \ '\%(\%(\\)'. \ '\)' let matching_lnum = searchpair(stmts, '', '\\zs', 'bW', \ 's:IsColComment(line("."), col(".")) == 1') exec 'normal! $' if matching_lnum > 0 && matching_lnum < a:curr_lnum let ind = indent(matching_lnum) endif elseif a:keyword =~? 'when' exec 'normal! ^' let matching_lnum = searchpair( \ '\%(\\|\\|\', \ '', \ '\%(\%(\\)\|\%(\\)\)', \ 'bW', \ 's:IsColComment(line("."), col(".")) == 1') exec 'normal! $' if matching_lnum > 0 && matching_lnum < a:curr_lnum let ind = indent(matching_lnum) else let ind = indent(a:curr_lnum) endif endif return ind endfunction " Check if the line is a comment function! s:IsLineComment(lnum) let rc = synIDattr( \ synID(a:lnum, \ match(getline(a:lnum), '\S')+1, 0) \ , "name") \ =~? "comment" return rc endfunction " Check if the column is a comment function! s:IsColComment(lnum, cnum) let rc = synIDattr(synID(a:lnum, a:cnum, 0), "name") \ =~? "comment" return rc endfunction " Instead of returning a column position, return " an appropriate value as a factor of shiftwidth. function! s:ModuloIndent(ind) let ind = a:ind if ind > 0 let modulo = ind % &shiftwidth if modulo > 0 let ind = ind - modulo endif endif return ind endfunction " Find correct indent of a new line based upon the previous line function! GetSQLIndent() let lnum = v:lnum let ind = indent(lnum) " If the current line is a comment, leave the indent as is " Comment out this additional check since it affects the " indenting of =, and will not reindent comments as it should " if s:IsLineComment(lnum) == 1 " return ind " endif " Get previous non-blank line let prevlnum = prevnonblank(lnum - 1) if prevlnum <= 0 return ind endif if s:IsLineComment(prevlnum) == 1 if getline(v:lnum) =~ '^\s*\*' let ind = s:ModuloIndent(indent(prevlnum)) return ind + 1 endif " If the previous line is a comment, then return -1 " to tell Vim to use the formatoptions setting to determine " the indent to use " But only if the next line is blank. This would be true if " the user is typing, but it would not be true if the user " is reindenting the file if getline(v:lnum) =~ '^\s*$' return -1 endif endif " echom 'PREVIOUS INDENT: ' . indent(prevlnum) . ' LINE: ' . getline(prevlnum) " This is the line you just hit return on, it is not the current line " which is new and empty " Based on this line, we can determine how much to indent the new " line " Get default indent (from prev. line) let ind = indent(prevlnum) let prevline = getline(prevlnum) " Now check what's on the previous line to determine if the indent " should be changed, for example IF, BEGIN, should increase the indent " where END IF, END, should decrease the indent. if prevline =~? s:SQLBlockStart " Move indent in let ind = ind + &sw " echom 'prevl - SQLBlockStart - indent ' . ind . ' line: ' . prevline elseif prevline =~ '[()]' if prevline =~ '(' let num_unmatched_left = s:CountUnbalancedParan( prevline, '(' ) else let num_unmatched_left = 0 endif if prevline =~ ')' let num_unmatched_right = s:CountUnbalancedParan( prevline, ')' ) else let num_unmatched_right = 0 " let num_unmatched_right = s:CountUnbalancedParan( prevline, ')' ) endif if num_unmatched_left > 0 " There is a open left paranethesis " increase indent let ind = ind + ( &sw * num_unmatched_left ) elseif num_unmatched_right > 0 " if it is an unbalanced paranethesis only unindent if " it was part of a command (ie create table(..) ) " instead of part of an if (ie if (....) then) which should " maintain the indent level let ignore = s:CheckToIgnoreRightParan( prevlnum, num_unmatched_right ) " echom 'prevl - ) unbalanced - CTIRP - ignore: ' . ignore if prevline =~ '^\s*)' let ignore = ignore + 1 " echom 'prevl - begins ) unbalanced ignore: ' . ignore endif if (num_unmatched_right - ignore) > 0 let ind = ind - ( &sw * (num_unmatched_right - ignore) ) endif endif endif " echom 'CURRENT INDENT: ' . ind . ' LINE: ' . getline(v:lnum) " This is a new blank line since we just typed a carriage return " Check current line; search for simplistic matching start-of-block let line = getline(v:lnum) if line =~? '^\s*els' " Any line when you type else will automatically back up one " ident level (ie else, elseif, elsif) let ind = ind - &sw " echom 'curr - else - indent ' . ind elseif line =~? '^\s*end\>' let ind = s:GetStmtStarterIndent('end', v:lnum) " General case for end " let ind = ind - &sw " echom 'curr - end - indent ' . ind elseif line =~? '^\s*when\>' let ind = s:GetStmtStarterIndent('when', v:lnum) " If the WHEN clause is used with a MERGE or EXCEPTION " clause, do not change the indent level, since these " statements do not have a corresponding END statement. " if stmt_starter =~? 'case' " let ind = ind - &sw " endif " elseif line =~ '^\s*)\s*;\?\s*$' " elseif line =~ '^\s*)' elseif line =~ '^\s*)' let num_unmatched_right = s:CountUnbalancedParan( line, ')' ) let ignore = s:CheckToIgnoreRightParan( v:lnum, num_unmatched_right ) " If the line ends in a ), then reduce the indent " This catches items like: " CREATE TABLE T1( " c1 int, " c2 int " ); " But we do not want to unindent a line like: " IF ( c1 = 1 " AND c2 = 3 ) THEN " let num_unmatched_right = s:CountUnbalancedParan( line, ')' ) " if num_unmatched_right > 0 " elseif strpart( line, strlen(line)-1, 1 ) =~ ')' " let ind = ind - &sw if line =~ '^\s*)' " let ignore = ignore + 1 " echom 'curr - begins ) unbalanced ignore: ' . ignore endif if (num_unmatched_right - ignore) > 0 let ind = ind - ( &sw * (num_unmatched_right - ignore) ) endif " endif endif " echom 'final - indent ' . ind return s:ModuloIndent(ind) endfunction " Restore: let &cpo= s:keepcpo unlet s:keepcpo " vim: ts=4 fdm=marker sw=4 vim-7.4.1689/runtime/indent/systemd.vim000066400000000000000000000003151267703067000177450ustar00rootroot00000000000000" Vim indent file " Language: systemd.unit(5) " Only load this indent file when no other was loaded. if exists("b:did_indent") finish endif " Looks a lot like dosini files. runtime! indent/dosini.vim vim-7.4.1689/runtime/indent/systemverilog.vim000066400000000000000000000205701267703067000211760ustar00rootroot00000000000000" Vim indent file " Language: SystemVerilog " Maintainer: kocha " Last Change: 12-Aug-2013. " Only load this indent file when no other was loaded. if exists("b:did_indent") finish endif let b:did_indent = 1 setlocal indentexpr=SystemVerilogIndent() setlocal indentkeys=!^F,o,O,0),0},=begin,=end,=join,=endcase,=join_any,=join_none setlocal indentkeys+==endmodule,=endfunction,=endtask,=endspecify setlocal indentkeys+==endclass,=endpackage,=endsequence,=endclocking setlocal indentkeys+==endinterface,=endgroup,=endprogram,=endproperty,=endchecker setlocal indentkeys+==`else,=`endif " Only define the function once. if exists("*SystemVerilogIndent") finish endif let s:cpo_save = &cpo set cpo&vim function SystemVerilogIndent() if exists('b:systemverilog_indent_width') let offset = b:systemverilog_indent_width else let offset = &sw endif if exists('b:systemverilog_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 sv_openstat = '\(\\|\([*/]\)\@<+-/%^&|!=?:]\([*/]\)\@!\)' " Define the condition when the statement ends with a one-line comment let sv_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 =~ '`\@' || \ last_line =~ '^\s*\<\(for\|case\%[[zx]]\|do\|foreach\|randcase\)\>' || \ last_line =~ '^\s*\<\(always\|always_comb\|always_ff\|always_latch\)\>' || \ last_line =~ '^\s*\<\(initial\|specify\|fork\|final\)\>' if last_line !~ '\(;\|\\)\s*' . sv_comment . '*$' || \ last_line =~ '\(//\|/\*\).*\(;\|\\)\s*' . sv_comment . '*$' let ind = ind + offset if vverb | echo vverb_str "Indent after a block statement." | endif endif " Indent after function/task/class/package/sequence/clocking/ " interface/covergroup/property/checkerprogram blocks elseif last_line =~ '^\s*\<\(function\|task\|class\|package\)\>' || \ last_line =~ '^\s*\<\(sequence\|clocking\|interface\)\>' || \ last_line =~ '^\s*\(\w\+\s*:\)\=\s*\' || \ last_line =~ '^\s*\<\(property\|checker\|program\)\>' if last_line !~ '\\s*' . sv_comment . '*$' || \ last_line =~ '\(//\|/\*\).*\(;\|\\)\s*' . sv_comment . '*$' let ind = ind + offset if vverb echo vverb_str "Indent after function/task/class block statement." endif endif " Indent after module/function/task/specify/fork blocks elseif last_line =~ '^\s*\(\\s*\)\=\' let ind = ind + indent_modules if vverb && indent_modules echo vverb_str "Indent after module statement." endif if last_line =~ '[(,]\s*' . sv_comment . '*$' && \ last_line !~ '\(//\|/\*\).*[(,]\s*' . sv_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 =~ '\(\\)\(\s*:\s*\w\+\)*' . sv_comment . '*$' && \ last_line !~ '\(//\|/\*\).*\(\\)' && \ ( last_line2 !~ sv_openstat . '\s*' . sv_comment . '*$' || \ last_line2 =~ '^\s*[^=!]\+\s*:\s*' . sv_comment . '*$' ) let ind = ind + offset if vverb | echo vverb_str "Indent after begin statement." | endif " Indent after a '{' or a '(' elseif last_line =~ '[{(]' . sv_comment . '*$' && \ last_line !~ '\(//\|/\*\).*[{(]' && \ ( last_line2 !~ sv_openstat . '\s*' . sv_comment . '*$' || \ last_line2 =~ '^\s*[^=!]\+\s*:\s*' . sv_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 !~ '\' || \ last_line =~ '\(//\|/\*\).*\' ) && \ last_line2 =~ '\<\(`\@.*' . \ sv_comment . '*$' && \ last_line2 !~ '\(//\|/\*\).*\<\(`\@' && \ last_line2 !~ sv_openstat . '\s*' . sv_comment . '*$' && \ ( last_line2 !~ '\' || \ last_line2 =~ '\(//\|/\*\).*\' ) 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 =~ sv_openstat . '\s*' . sv_comment . '*$' && \ last_line !~ '\(//\|/\*\).*' . sv_openstat . '\s*$' && \ last_line2 !~ sv_openstat . '\s*' . sv_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*' . sv_comment . '*$' && \ last_line !~ '^\s*)*\s*;\s*' . sv_comment . '*$' && \ last_line !~ '\(//\|/\*\).*\S)*\s*;\s*' . sv_comment . '*$' && \ ( last_line2 =~ sv_openstat . '\s*' . sv_comment . '*$' && \ last_line2 !~ ';\s*//.*$') && \ last_line2 !~ '^\s*' . sv_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\|join_any\|join_none\|\|end\|endcase\|while\)\>' || \ curr_line =~ '^\s*\<\(endfunction\|endtask\|endspecify\|endclass\)\>' || \ curr_line =~ '^\s*\<\(endpackage\|endsequence\|endclocking\|endinterface\)\>' || \ curr_line =~ '^\s*\<\(endgroup\|endproperty\|endchecker\|endprogram\)\>' || \ curr_line =~ '^\s*}' let ind = ind - offset if vverb | echo vverb_str "De-indent the end of a block." | endif elseif curr_line =~ '^\s*\' 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*\' if last_line !~ '^\s*\<\(function\|task\|specify\|module\|class\|package\)\>' || \ last_line !~ '^\s*\<\(sequence\|clocking\|interface\|covergroup\)\>' || \ last_line !~ '^\s*\<\(property\|checker\|program\)\>' && \ last_line !~ '^\s*\()*\s*;\|)\+\)\s*' . sv_comment . '*$' && \ ( last_line =~ \ '\<\(`\@' || \ last_line =~ ')\s*' . sv_comment . '*$' || \ last_line =~ sv_openstat . '\s*' . sv_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 =~ sv_openstat . '\s*' . sv_comment . '*$' || \ last_line !~ sv_openstat . '\s*' . sv_comment . '*$' && \ last_line2 =~ sv_openstat . '\s*' . sv_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 let &cpo = s:cpo_save unlet s:cpo_save " vim:sw=2 vim-7.4.1689/runtime/indent/tcl.vim000066400000000000000000000031021267703067000170340ustar00rootroot00000000000000" Vim indent file " Language: Tcl " Maintainer: Nikolai Weibull " Latest Revision: 2006-12-20 if exists("b:did_indent") finish endif let b:did_indent = 1 setlocal indentexpr=GetTclIndent() setlocal indentkeys=0{,0},!^F,o,O,0] setlocal nosmartindent 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 s:count_braces(lnum, count_open) let n_open = 0 let n_close = 0 let line = getline(a:lnum) let pattern = '[{}]' let i = match(line, pattern) while i != -1 if synIDattr(synID(a:lnum, i + 1, 0), 'name') !~ 'tcl\%(Comment\|String\)' if line[i] == '{' let n_open += 1 elseif line[i] == '}' if n_open > 0 let n_open -= 1 else let n_close += 1 endif endif endif let i = match(line, pattern, i + 1) endwhile return a:count_open ? n_open : n_close endfunction function GetTclIndent() let line = getline(v:lnum) if line =~ '^\s*\*' return cindent(v:lnum) elseif line =~ '^\s*}' return indent(v:lnum) - &sw endif let pnum = s:prevnonblanknoncomment(v:lnum - 1) if pnum == 0 return 0 endif let ind = indent(pnum) + s:count_braces(pnum, 1) * &sw let pline = getline(pnum) if pline =~ '}\s*$' let ind -= (s:count_braces(pnum, 0) - (pline =~ '^\s*}' ? 1 : 0)) * &sw endif return ind endfunction vim-7.4.1689/runtime/indent/tcsh.vim000066400000000000000000000023331267703067000172200ustar00rootroot00000000000000" Vim indent file " Language: C-shell (tcsh) " Maintainer: GI , where a='gi1242+vim', b='gmail', c='com' " Last Modified: Sat 10 Dec 2011 09:23:00 AM EST " 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 indentkeys-=0{,0},0),:,0# " Only define the function once. if exists("*TcshGetIndent") finish endif 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 :, default:, else, then or \ let ind = indent(lnum) let line = getline(lnum) if line =~ '\v^\s*%(while|foreach)>|^\s*%(case\s.*:|default:|else)\s*$|%(' 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 vim-7.4.1689/runtime/indent/teraterm.vim000066400000000000000000000030601267703067000201000ustar00rootroot00000000000000" Vim indent file " Language: Tera Term Language (TTL) " Based on Tera Term Version 4.86 " Maintainer: Ken Takata " URL: https://github.com/k-takata/vim-teraterm " Last Change: 2015 Jun 4 " Filenames: *.ttl " License: VIM License if exists("b:did_indent") finish endif let b:did_indent = 1 setlocal nosmartindent setlocal noautoindent setlocal indentexpr=GetTeraTermIndent(v:lnum) setlocal indentkeys=!^F,o,O,e setlocal indentkeys+==elseif,=endif,=loop,=next,=enduntil,=endwhile if exists("*GetTeraTermIndent") finish endif " The shiftwidth() function is relatively new. " Don't require it to exist. if exists('*shiftwidth') function s:sw() abort return shiftwidth() endfunction else function s:sw() abort return &shiftwidth endfunction endif function! GetTeraTermIndent(lnum) let l:prevlnum = prevnonblank(a:lnum-1) if l:prevlnum == 0 " top of file return 0 endif " grab the previous and current line, stripping comments. let l:prevl = substitute(getline(l:prevlnum), ';.*$', '', '') let l:thisl = substitute(getline(a:lnum), ';.*$', '', '') let l:previ = indent(l:prevlnum) let l:ind = l:previ if l:prevl =~ '^\s*if\>.*\' " previous line opened a block let l:ind += s:sw() endif if l:thisl =~ '^\s*\%(elseif\|else\|endif\|enduntil\|endwhile\|loop\|next\)\>' " this line closed a block let l:ind -= s:sw() endif return l:ind endfunction " vim: ts=8 sw=2 sts=2 vim-7.4.1689/runtime/indent/tex.vim000066400000000000000000000315231267703067000170620ustar00rootroot00000000000000" Vim indent file " Language: LaTeX " Maintainer: YiChao Zhou " Created: Sat, 16 Feb 2002 16:50:19 +0100 " Version: 0.9.2 " Please email me if you found something I can do. Comments, bug report and " feature request are welcome. " Last Update: {{{ " 25th Sep 2002, by LH : " (*) better support for the option " (*) use some regex instead of several '||'. " Oct 9th, 2003, by JT: " (*) don't change indentation of lines starting with '%' " 2005/06/15, Moshe Kaminsky " (*) New variables: " g:tex_items, g:tex_itemize_env, g:tex_noindent_env " 2011/3/6, by Zhou YiChao " (*) Don't change indentation of lines starting with '%' " I don't see any code with '%' and it doesn't work properly " so I add some code. " (*) New features: Add smartindent-like indent for "{}" and "[]". " (*) New variables: g:tex_indent_brace " 2011/9/25, by Zhou Yichao " (*) Bug fix: smartindent-like indent for "[]" " (*) New features: Align with "&". " (*) New variable: g:tex_indent_and. " 2011/10/23 by Zhou Yichao " (*) Bug fix: improve the smartindent-like indent for "{}" and " "[]". " 2012/02/27 by Zhou Yichao " (*) Bug fix: support default folding marker. " (*) Indent with "&" is not very handy. Make it not enable by " default. " 2012/03/06 by Zhou Yichao " (*) Modify "&" behavior and make it default again. Now "&" " won't align when there are more then one "&" in the previous " line. " (*) Add indent "\left(" and "\right)" " (*) Trust user when in "verbatim" and "lstlisting" " 2012/03/11 by Zhou Yichao " (*) Modify "&" so that only indent when current line start with " "&". " 2012/03/12 by Zhou Yichao " (*) Modify indentkeys. " 2012/03/18 by Zhou Yichao " (*) Add &cpo " 2013/05/02 by Zhou Yichao " (*) Fix problem about GetTeXIndent checker. Thank Albert Netymk " for reporting this. " 2014/06/23 by Zhou Yichao " (*) Remove the feature g:tex_indent_and because it is buggy. " (*) If there is not any obvious indentation hints, we do not " alert our user's current indentation. " (*) g:tex_indent_brace now only works if the open brace is the " last character of that line. " 2014/08/03 by Zhou Yichao " (*) Indent current line if last line has larger indentation " 2014/08/09 by Zhou Yichao " (*) Add missing return value for s:GetEndIndentation(...) " " }}} " Document: {{{ " " To set the following options (ok, currently it's just one), add a line like " let g:tex_indent_items = 1 " to your ~/.vimrc. " " * g:tex_indent_brace " " If this variable is unset or non-zero, it will use smartindent-like style " for "{}" and "[]". Now this only works if the open brace is the last " character of that line. " " % Example 1 " \usetikzlibrary{ " external " } " " % Example 2 " \tikzexternalize[ " prefix=tikz] " " * g:tex_indent_items " " If this variable is set, item-environments are indented like Emacs does " it, i.e., continuation lines are indented with a shiftwidth. " " NOTE: I've already set the variable below; delete the corresponding line " if you don't like this behaviour. " " Per default, it is unset. " " set unset " ---------------------------------------------------------------- " \begin{itemize} \begin{itemize} " \item blablabla \item blablabla " bla bla bla bla bla bla " \item blablabla \item blablabla " bla bla bla bla bla bla " \end{itemize} \end{itemize} " " " * g:tex_items " " A list of tokens to be considered as commands for the beginning of an item " command. The tokens should be separated with '\|'. The initial '\' should " be escaped. The default is '\\bibitem\|\\item'. " " * g:tex_itemize_env " " A list of environment names, separated with '\|', where the items (item " commands matching g:tex_items) may appear. The default is " 'itemize\|description\|enumerate\|thebibliography'. " " * g:tex_noindent_env " " A list of environment names. separated with '\|', where no indentation is " required. The default is 'document\|verbatim'. " }}} " Only define the function once if exists("b:did_indent") finish endif let s:cpo_save = &cpo set cpo&vim " Define global variable {{{ let b:did_indent = 1 if !exists("g:tex_indent_items") let g:tex_indent_items = 1 endif if !exists("g:tex_indent_brace") let g:tex_indent_brace = 1 endif if !exists("g:tex_max_scan_line") let g:tex_max_scan_line = 60 endif if g:tex_indent_items if !exists("g:tex_itemize_env") let g:tex_itemize_env = 'itemize\|description\|enumerate\|thebibliography' endif if !exists('g:tex_items') let g:tex_items = '\\bibitem\|\\item' endif else let g:tex_items = '' endif if !exists("g:tex_noindent_env") let g:tex_noindent_env = 'document\|verbatim\|lstlisting' endif "}}} " VIM Setting " {{{ setlocal autoindent setlocal nosmartindent setlocal indentexpr=GetTeXIndent() setlocal indentkeys& exec 'setlocal indentkeys+=[,(,{,),},],\&' . substitute(g:tex_items, '^\|\(\\|\)', ',=', 'g') let g:tex_items = '^\s*' . substitute(g:tex_items, '^\(\^\\s\*\)*', '', '') " }}} function! GetTeXIndent() " {{{ " Find a non-blank line above the current line. let lnum = prevnonblank(v:lnum - 1) let cnum = v:lnum " Comment line is not what we need. while lnum != 0 && getline(lnum) =~ '^\s*%' let lnum = prevnonblank(lnum - 1) endwhile " At the start of the file use zero indent. if lnum == 0 return 0 endif let line = substitute(getline(lnum), '\s*%.*', '','g') " last line let cline = substitute(getline(v:lnum), '\s*%.*', '', 'g') " current line " We are in verbatim, so do what our user what. if synIDattr(synID(v:lnum, indent(v:lnum), 1), "name") == "texZone" if empty(cline) return indent(lnum) else return indent(v:lnum) end endif if lnum == 0 return 0 endif let ind = indent(lnum) let stay = 1 " New code for comment: retain the indent of current line if cline =~ '^\s*%' return indent(v:lnum) endif " Add a 'shiftwidth' after beginning of environments. " Don't add it for \begin{document} and \begin{verbatim} ""if line =~ '^\s*\\begin{\(.*\)}' && line !~ 'verbatim' " LH modification : \begin does not always start a line " ZYC modification : \end after \begin won't cause wrong indent anymore if line =~ '\\begin{.*}' && line !~ g:tex_noindent_env let ind = ind + &sw let stay = 0 if g:tex_indent_items " Add another sw for item-environments if line =~ g:tex_itemize_env let ind = ind + &sw let stay = 0 endif endif endif if cline =~ '\\end{.*}' let retn = s:GetEndIndentation(v:lnum) if retn != -1 return retn endif end " Subtract a 'shiftwidth' when an environment ends if cline =~ '\\end{.*}' \ && cline !~ g:tex_noindent_env \ && cline !~ '\\begin{.*}.*\\end{.*}' if g:tex_indent_items " Remove another sw for item-environments if cline =~ g:tex_itemize_env let ind = ind - &sw let stay = 0 endif endif let ind = ind - &sw let stay = 0 endif if g:tex_indent_brace let char = line[strlen(line)-1] if char == '[' || char == '{' let ind += &sw let stay = 0 endif let cind = indent(v:lnum) let char = cline[cind] if (char == ']' || char == '}') && \ s:CheckPairedIsLastCharacter(v:lnum, cind) let ind -= &sw let stay = 0 endif for i in range(indent(lnum)+1, strlen(line)-1) let char = line[i] if char == ']' || char == '}' if s:CheckPairedIsLastCharacter(lnum, i) let ind -= &sw let stay = 0 endif endif endfor endif " Special treatment for 'item' " ---------------------------- if g:tex_indent_items " '\item' or '\bibitem' itself: if cline =~ g:tex_items let ind = ind - &sw let stay = 0 endif " lines following to '\item' are intented once again: if line =~ g:tex_items let ind = ind + &sw let stay = 0 endif endif if stay " If there is no obvious indentation hint, we trust our user. if empty(cline) return ind else return max([indent(v:lnum), s:GetLastBeginIndentation(v:lnum)]) endif else return ind endif endfunction "}}} function! s:GetLastBeginIndentation(lnum) " {{{ let matchend = 1 for lnum in range(a:lnum-1, max([a:lnum - g:tex_max_scan_line, 1]), -1) let line = getline(lnum) if line =~ '\\end{.*}' let matchend += 1 endif if line =~ '\\begin{.*}' let matchend -= 1 endif if matchend == 0 if line =~ g:tex_itemize_env return indent(lnum) + 2 * &sw endif if line =~ g:tex_noindent_env return indent(lnum) endif return indent(lnum) + &sw endif endfor return -1 endfunction function! s:GetEndIndentation(lnum) " {{{ if getline(a:lnum) =~ '\\begin{.*}.*\\end{.*}' return -1 endif let min_indent = 100 let matchend = 1 for lnum in range(a:lnum-1, max([a:lnum-g:tex_max_scan_line, 1]), -1) let line = getline(lnum) if line =~ '\\end{.*}' let matchend += 1 endif if line =~ '\\begin{.*}' let matchend -= 1 endif if matchend == 0 return indent(lnum) endif if !empty(line) let min_indent = min([min_indent, indent(lnum)]) endif endfor return min_indent - &sw endfunction " Most of the code is from matchparen.vim function! s:CheckPairedIsLastCharacter(lnum, col) "{{{ " Get the character under the cursor and check if it's in 'matchpairs'. let c_lnum = a:lnum let c_col = a:col+1 let c = getline(c_lnum)[c_col-1] let plist = split(&matchpairs, '.\zs[:,]') let i = index(plist, c) if i < 0 return 0 endif " Figure out the arguments for searchpairpos(). if i % 2 == 0 let s_flags = 'nW' let c2 = plist[i + 1] else let s_flags = 'nbW' let c2 = c let c = plist[i - 1] endif if c == '[' let c = '\[' let c2 = '\]' endif " Find the match. When it was just before the cursor move it there for a " moment. let save_cursor = winsaveview() call cursor(c_lnum, c_col) " When not in a string or comment ignore matches inside them. " We match "escape" for special items, such as lispEscapeSpecial. let s_skip ='synIDattr(synID(line("."), col("."), 0), "name") ' . \ '=~? "string\\|character\\|singlequote\\|escape\\|comment"' execute 'if' s_skip '| let s_skip = 0 | endif' let stopline = max([0, c_lnum - g:tex_max_scan_line]) " Limit the search time to 300 msec to avoid a hang on very long lines. " This fails when a timeout is not supported. try let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline, 100) catch /E118/ endtry call winrestview(save_cursor) if m_lnum > 0 let line = getline(m_lnum) return strlen(line) == m_col endif return 0 endfunction "}}} let &cpo = s:cpo_save unlet s:cpo_save " vim: set sw=4 textwidth=80: vim-7.4.1689/runtime/indent/tf.vim000066400000000000000000000027331267703067000166740ustar00rootroot00000000000000" Vim indent file " Language: tf (TinyFugue) " Maintainer: Christian J. Robinson " URL: http://christianrobinson.name/vim/indent/tf.vim " Last Change: 2002 May 29 " Only load this indent file when no other was loaded. if exists("b:did_indent") finish endif let b:did_indent = 1 setlocal indentexpr=GetTFIndent() setlocal indentkeys-=0{,0} indentkeys-=0# indentkeys-=: setlocal indentkeys+==/endif,=/then,=/else,=/done,0; " Only define the function once: if exists("*GetTFIndent") finish endif function GetTFIndent() " Find a non-blank line above the current line: let lnum = prevnonblank(v:lnum - 1) " No indent for the start of the file: if lnum == 0 return 0 endif let ind = indent(lnum) let line = getline(lnum) " No indentation if the previous line didn't end with "\": " (Could be annoying, but it lets you know if you made a mistake.) if line !~ '\\$' return 0 endif if line =~ '\(/def.*\\\|/for.*\(%;\s*\)\@\ "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 vim-7.4.1689/runtime/indent/treetop.vim000066400000000000000000000012451267703067000177420ustar00rootroot00000000000000" Vim indent file " Language: Treetop " Maintainer: Nikolai Weibull " Latest Revision: 2011-03-14 if exists("b:did_indent") finish endif let b:did_indent = 1 setlocal indentexpr=GetTreetopIndent() setlocal indentkeys=0{,0},!^F,o,O,=end setlocal nosmartindent if exists("*GetTreetopIndent") finish endif function GetTreetopIndent() let pnum = prevnonblank(v:lnum - 1) if pnum == 0 return 0 endif let ind = indent(pnum) let line = getline(pnum) if line =~ '^\s*\%(grammar\|module\|rule\)\>' let ind += &sw endif let line = getline(v:lnum) if line =~ '^\s*end\>' let ind -= &sw end retur ind endfunction vim-7.4.1689/runtime/indent/vb.vim000066400000000000000000000037741267703067000167000ustar00rootroot00000000000000" Vim indent file " Language: VisualBasic (ft=vb) / Basic (ft=basic) / SaxBasic (ft=vb) " Author: Johannes Zellner " Last Change: Fri, 18 Jun 2004 07:22:42 CEST " Small update 2010 Jul 28 by Maxim Kim if exists("b:did_indent") finish endif let b:did_indent = 1 setlocal autoindent setlocal indentexpr=VbGetIndent(v:lnum) setlocal indentkeys& setlocal indentkeys+==~else,=~elseif,=~end,=~wend,=~case,=~next,=~select,=~loop,<:> let b:undo_indent = "set ai< indentexpr< indentkeys<" " 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\|else\|elseif\|do\|for\|while\|enum\|with\)\>' let ind = ind + &sw endif " Subtract if this_line =~? '^\s*\\s\+\' if previous_line !~? '^\s*\' 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\|elseif\|until\|loop\|next\|wend\)\>' let ind = ind - &sw elseif this_line =~? '^\s*\<\(case\|default\)\>' if previous_line !~? '^\s*\' let ind = ind - &sw endif endif return ind endfun " vim:sw=4 vim-7.4.1689/runtime/indent/verilog.vim000066400000000000000000000167041267703067000177350ustar00rootroot00000000000000" Language: Verilog HDL " Maintainer: Chih-Tsun Huang " Last Change: 2011 Dec 10 by Thilo Six " URL: http://larc.ee.nthu.edu.tw/~cthuang/vim/indent/verilog.vim " " Credits: " Suggestions for improvement, bug reports by " Leo Butlero " " 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 let s:cpo_save = &cpo set cpo&vim 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 = '\(\\|\([*/]\)\@<+-/%^&|!=?:]\([*/]\)\@!\)' " 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 =~ '`\@' || \ last_line =~ '^\s*\<\(for\|case\%[[zx]]\)\>' || \ last_line =~ '^\s*\<\(always\|initial\)\>' || \ last_line =~ '^\s*\<\(specify\|fork\)\>' if last_line !~ '\(;\|\\)\s*' . vlog_comment . '*$' || \ last_line =~ '\(//\|/\*\).*\(;\|\\)\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 !~ '\\s*' . vlog_comment . '*$' || \ last_line =~ '\(//\|/\*\).*\(;\|\\)\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*\' 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 =~ '\(\\)\(\s*:\s*\w\+\)*' . vlog_comment . '*$' && \ last_line !~ '\(//\|/\*\).*\(\\)' && \ ( 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 !~ '\' || \ last_line =~ '\(//\|/\*\).*\' ) && \ last_line2 =~ '\<\(`\@.*' . \ vlog_comment . '*$' && \ last_line2 !~ \ '\(//\|/\*\).*\<\(`\@' && \ last_line2 !~ vlog_openstat . '\s*' . vlog_comment . '*$' && \ ( last_line2 !~ '\' || \ last_line2 =~ '\(//\|/\*\).*\' ) 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*\' 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*\' if last_line !~ '^\s*\<\(function\|task\|specify\|module\)\>' && \ last_line !~ '^\s*\()*\s*;\|)\+\)\s*' . vlog_comment . '*$' && \ ( last_line =~ \ '\<\(`\@' || \ 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 let &cpo = s:cpo_save unlet s:cpo_save " vim:sw=2 vim-7.4.1689/runtime/indent/vhdl.vim000066400000000000000000000327511267703067000172230ustar00rootroot00000000000000" VHDL indent ('93 syntax) " Language: VHDL " Maintainer: Gerald Lai " Version: 1.58 " Last Change: 2011 Sep 27 " URL: http://www.vim.org/scripts/script.php?script_id=1450 " only load this indent file when no other was loaded if exists("b:did_indent") finish endif let b:did_indent = 1 " setup indent options for local VHDL buffer setlocal indentexpr=GetVHDLindent() setlocal indentkeys=!^F,o,O,0(,0) setlocal indentkeys+==~begin,=~end\ ,=~end\ ,=~is,=~select,=~when setlocal indentkeys+==~if,=~then,=~elsif,=~else setlocal indentkeys+==~case,=~loop,=~for,=~generate,=~record,=~units,=~process,=~block,=~function,=~component,=~procedure setlocal indentkeys+==~architecture,=~configuration,=~entity,=~package " constants " not a comment let s:NC = '\%(--.*\)\@ 0 && prevs =~ '^\s*--' let prevn = prevnonblank(prevn - 1) let prevs = getline(prevn) endwhile let prevs_noi = substitute(prevs, '^\s*', '', '') " default indent starts as previous non-comment line's indent let ind = prevn > 0 ? indent(prevn) : 0 " backup default let ind2 = ind " indent: special; kill string so it would not affect other filters " keywords: "report" + string " where: anywhere in current or previous line let s0 = s:NC.'\\s*".*"' if curs =~? s0 let curs = "" endif if prevs =~? s0 let prevs = "" endif " indent: previous line's comment position, otherwise follow next non-comment line if possible " keyword: "--" " where: start of current line if curs =~ '^\s*--' let pn = curn - 1 let ps = getline(pn) if curs =~ '^\s*--\s' && ps =~ '--' return indent(pn) + stridx(substitute(ps, '^\s*', '', ''), '--') else " find nextnonblank line that is not a comment let nn = nextnonblank(curn + 1) let ns = getline(nn) while nn > 0 && ns =~ '^\s*--' let nn = nextnonblank(nn + 1) let ns = getline(nn) endwhile let n = indent(nn) return n != -1 ? n : ind endif endif " **************************************************************************************** " indent: align generic variables & port names " keywords: "procedure" + name, "generic", "map", "port" + "(", provided current line is part of mapping " where: anywhere in previous 2 lines " find following previous non-comment line let pn = prevnonblank(prevn - 1) let ps = getline(pn) while pn > 0 && ps =~ '^\s*--' let pn = prevnonblank(pn - 1) let ps = getline(pn) endwhile if (curs =~ '^\s*)' || curs =~? '^\s*\%(\<\%(procedure\|generic\|map\|port\)\>.*\)\@\s*\S\+\|:[^=]\@=\s*\%(\%(in\|out\|inout\|buffer\|linkage\)\>\|\w\+\s\+:=\)\)') && (prevs =~? s:NC.'\<\%(procedure\s\+\S\+\|generic\|map\|port\)\s*(\%(\s*\w\)\=' || (ps =~? s:NC.'\<\%(procedure\|generic\|map\|port\)'.s:ES && prevs =~ '^\s*(')) " align closing ")" with opening "(" if curs =~ '^\s*)' return ind2 + stridx(prevs_noi, '(') endif let m = matchend(prevs_noi, '(\s*\ze\w') if m != -1 return ind2 + m else if g:vhdl_indent_genportmap return ind2 + stridx(prevs_noi, '(') + &sw else return ind2 + &sw endif endif endif " indent: align conditional/select statement " keywords: variable + "<=" without ";" ending " where: start of previous line if prevs =~? '^\s*\S\+\s*<=[^;]*'.s:ES if g:vhdl_indent_rhsassign return ind2 + matchend(prevs_noi, '<=\s*\ze.') else return ind2 + &sw endif endif " indent: backtrace previous non-comment lines for next smaller or equal size indent " keywords: "end" + "record", "units" " where: start of previous line " keyword: ")" " where: start of previous line " keyword: without "<=" + ";" ending " where: anywhere in previous line " keyword: "=>" + ")" ending, provided current line does not begin with ")" " where: anywhere in previous line " _note_: indent allowed to leave this filter let m = 0 if prevs =~? '^\s*end\s\+\%(record\|units\)\>' let m = 3 elseif prevs =~ '^\s*)' let m = 1 elseif prevs =~ s:NC.'\%(<=.*\)\@.*'.s:NC.')'.s:ES) let m = 2 endif if m > 0 let pn = prevnonblank(prevn - 1) let ps = getline(pn) while pn > 0 let t = indent(pn) if ps !~ '^\s*--' && (t < ind || (t == ind && m == 3)) " make sure one of these is true " keywords: variable + "<=" without ";" ending " where: start of previous non-comment line " keywords: "procedure", "generic", "map", "port" " where: anywhere in previous non-comment line " keyword: "(" " where: start of previous non-comment line if m < 3 && ps !~? '^\s*\S\+\s*<=[^;]*'.s:ES if ps =~? s:NC.'\<\%(procedure\|generic\|map\|port\)\>' || ps =~ '^\s*(' let ind = t endif break endif let ind = t if m > 1 " find following previous non-comment line let ppn = prevnonblank(pn - 1) let pps = getline(ppn) while ppn > 0 && pps =~ '^\s*--' let ppn = prevnonblank(ppn - 1) let pps = getline(ppn) endwhile " indent: follow " keyword: "select" " where: end of following previous non-comment line " keyword: "type" " where: start of following previous non-comment line if m == 2 let s1 = s:NC.'\' " find previous opening statement of " keywords: "architecture", "block", "entity", "function", "generate", "procedure", "process" let s2 = s:NC.s:NE.'\<\%(architecture\|block\|entity\|function\|generate\|procedure\|process\)\>' let pn = prevnonblank(curn - 1) let ps = getline(pn) while pn > 0 && (ps =~ '^\s*--' || ps !~? s2) let pn = prevnonblank(pn - 1) let ps = getline(pn) if (ps =~? s:NC.'\') return indent(pn) - &sw endif endwhile if (pn == 0) return ind - &sw else return indent(pn) endif endif " indent: +sw if previous line is previous opening statement " keywords: "record", "units" " where: anywhere in current line if curs =~? s:NC.s:NE.'\<\%(record\|units\)\>' " find previous opening statement of " keyword: "type" let s3 = s:NC.s:NE.'\' if curs !~? s3.'.*'.s:NC.'\<\%(record\|units\)\>.*'.s:ES && prevs =~? s3 let ind = ind + &sw endif return ind endif " **************************************************************************************** " indent: 0 " keywords: "architecture", "configuration", "entity", "library", "package" " where: start of current line if curs =~? '^\s*\%(architecture\|configuration\|entity\|library\|package\)\>' return 0 endif " indent: maintain indent of previous opening statement " keyword: "is" " where: start of current line " find previous opening statement of " keywords: "architecture", "block", "configuration", "entity", "function", "package", "procedure", "process", "type" if curs =~? '^\s*\' && prevs =~? s:NC.s:NE.'\<\%(architecture\|block\|configuration\|entity\|function\|package\|procedure\|process\|type\)\>' return ind2 endif " indent: maintain indent of previous opening statement " keyword: "then" " where: start of current line " find previous opening statement of " keywords: "elsif", "if" if curs =~? '^\s*\' && prevs =~? s:NC.'\%(\\|'.s:NE.'\\)' return ind2 endif " indent: maintain indent of previous opening statement " keyword: "generate" " where: start of current line " find previous opening statement of " keywords: "for", "if" if curs =~? '^\s*\' && prevs =~? s:NC.s:NE.'\%(\%(\' return ind2 endif " indent: +sw " keywords: "block", "process" " removed: "begin", "case", "elsif", "if", "loop", "record", "units", "while" " where: anywhere in previous line if prevs =~? s:NC.s:NE.'\<\%(block\|process\)\>' return ind + &sw endif " indent: +sw " keywords: "architecture", "configuration", "entity", "package" " removed: "component", "for", "when", "with" " where: start of previous line if prevs =~? '^\s*\%(architecture\|configuration\|entity\|package\)\>' return ind + &sw endif " indent: +sw " keyword: "select" " removed: "generate", "is", "=>" " where: end of previous line if prevs =~? s:NC.'\" " where: end of previous line " _note_: indent allowed to leave this filter if prevs =~? s:NC.'\%(\\|'.s:NE.'\<\%(loop\|record\|units\)\>\)' || prevs =~? '^\s*\%(component\|else\|for\)\>' || prevs =~? s:NC.'\%('.s:NE.'\\)'.s:ES let ind = ind + &sw endif " **************************************************************************************** " indent: -sw " keywords: "when", provided previous line does not begin with "when", does not end with "is" " where: start of current line let s4 = '^\s*when\>' if curs =~? s4 if prevs =~? s:NC.'\' if prevs =~? '^\s*\%(elsif\|'.s5.'\)' return ind else return ind - &sw endif endif " indent: backtrace previous non-comment lines " keyword: "end" + "case", "component" " where: start of current line let m = 0 if curs =~? '^\s*end\s\+case\>' let m = 1 elseif curs =~? '^\s*end\s\+component\>' let m = 2 endif if m > 0 " find following previous non-comment line let pn = prevn let ps = getline(pn) while pn > 0 if ps !~ '^\s*--' "indent: -2sw "keywords: "end" + "case" "where: start of previous non-comment line "indent: -sw "keywords: "when" "where: start of previous non-comment line "indent: follow "keywords: "case" "where: start of previous non-comment line if m == 1 if ps =~? '^\s*end\s\+case\>' return indent(pn) - 2 * &sw elseif ps =~? '^\s*when\>' return indent(pn) - &sw elseif ps =~? '^\s*case\>' return indent(pn) endif "indent: follow "keyword: "component" "where: start of previous non-comment line elseif m == 2 if ps =~? '^\s*component\>' return indent(pn) endif endif endif let pn = prevnonblank(pn - 1) let ps = getline(pn) endwhile return ind - &sw endif " indent: -sw " keyword: ")" " where: start of current line if curs =~ '^\s*)' return ind - &sw endif " indent: 0 " keywords: "end" + "architecture", "configuration", "entity", "package" " where: start of current line if curs =~? '^\s*end\s\+\%(architecture\|configuration\|entity\|package\)\>' return 0 endif " indent: -sw " keywords: "end" + identifier, ";" " where: start of current line "if curs =~? '^\s*end\s\+\w\+\>' if curs =~? '^\s*end\%(\s\|;'.s:ES.'\)' return ind - &sw endif " **************************************************************************************** " indent: maintain indent of previous opening statement " keywords: without "procedure", "generic", "map", "port" + ":" but not ":=" + "in", "out", "inout", "buffer", "linkage", variable & ":=" " where: start of current line if curs =~? '^\s*\%(\<\%(procedure\|generic\|map\|port\)\>.*\)\@\|\w\+\s\+:=\)' return ind2 endif " return leftover filtered indent return ind endfunction vim-7.4.1689/runtime/indent/vim.vim000066400000000000000000000056521267703067000170610ustar00rootroot00000000000000" Vim indent file " Language: Vim script " Maintainer: Bram Moolenaar " Last Change: 2016 Jan 24 " 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\\ let b:undo_indent = "setl indentkeys< indentexpr<" " Only define the function once. if exists("*GetVimIndent") finish endif let s:keepcpo= &cpo set cpo&vim function GetVimIndent() let ignorecase_save = &ignorecase try let &ignorecase = 0 return GetVimIndentIntern() finally let &ignorecase = ignorecase_save endtry endfunc function GetVimIndentIntern() " 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. let cur_text = getline(v:lnum) if cur_text !~ '^\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 let prev_text = getline(lnum) " 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 (or g:vim_indent_cont if it exists). let ind = indent(lnum) if cur_text =~ '^\s*\\' && v:lnum > 1 && prev_text !~ '^\s*\\' if exists("g:vim_indent_cont") let ind = ind + g:vim_indent_cont else let ind = ind + shiftwidth() * 3 endif elseif prev_text =~ '^\s*aug\%[roup]' && prev_text !~ '^\s*aug\%[roup]\s*!\=\s\+END' let ind = ind + shiftwidth() else " A line starting with :au does not increment/decrement indent. if prev_text !~ '^\s*au\%[tocmd]' let i = match(prev_text, '\(^\||\)\s*\(if\|wh\%[ile]\|for\|try\|cat\%[ch]\|fina\%[lly]\|fu\%[nction]\|el\%[seif]\)\>') if i >= 0 let ind += shiftwidth() if strpart(prev_text, i, 1) == '|' && has('syntax_items') \ && synIDattr(synID(lnum, i, 1), "name") =~ '\(Comment\|String\)$' let ind -= shiftwidth() endif endif endif endif " If the previous line contains an "end" after a pipe, but not in an ":au" " command. And not when there is a backslash before the pipe. " And when syntax HL is enabled avoid a match inside a string. let i = match(prev_text, '[^\\]|\s*\(ene\@!\)') if i > 0 && prev_text !~ '^\s*au\%[tocmd]' if !has('syntax_items') || synIDattr(synID(lnum, i + 2, 1), "name") !~ '\(Comment\|String\)$' let ind = ind - shiftwidth() endif endif " Subtract a 'shiftwidth' on a :endif, :endwhile, :catch, :finally, :endtry, " :endfun, :else and :augroup END. if cur_text =~ '^\s*\(ene\@!\|cat\|fina\|el\|aug\%[roup]\s*!\=\s\+[eE][nN][dD]\)' let ind = ind - shiftwidth() endif return ind endfunction let &cpo = s:keepcpo unlet s:keepcpo " vim:sw=2 vim-7.4.1689/runtime/indent/vroom.vim000066400000000000000000000005731267703067000174250ustar00rootroot00000000000000" Vim indent file " Language: Vroom (vim testing and executable documentation) " Maintainer: David Barnett (https://github.com/google/vim-ft-vroom) " Last Change: 2014 Jul 23 if exists('b:did_indent') finish endif let b:did_indent = 1 let s:cpo_save = &cpo set cpo-=C let b:undo_indent = 'setlocal autoindent<' setlocal autoindent let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/indent/xf86conf.vim000066400000000000000000000012471267703067000177230ustar00rootroot00000000000000" Vim indent file " Language: XFree86 Configuration File " Maintainer: Nikolai Weibull " Latest Revision: 2006-12-20 if exists("b:did_indent") finish endif let b:did_indent = 1 setlocal indentexpr=GetXF86ConfIndent() setlocal indentkeys=!^F,o,O,=End setlocal nosmartindent if exists("*GetXF86ConfIndent") finish endif function GetXF86ConfIndent() let lnum = prevnonblank(v:lnum - 1) if lnum == 0 return 0 endif let ind = indent(lnum) if getline(lnum) =~? '^\s*\(Sub\)\=Section\>' let ind = ind + &sw endif if getline(v:lnum) =~? '^\s*End\(Sub\)\=Section\>' let ind = ind - &sw endif return ind endfunction vim-7.4.1689/runtime/indent/xhtml.vim000066400000000000000000000004151267703067000174120ustar00rootroot00000000000000" Vim indent file " Language: XHTML " Maintainer: Bram Moolenaar (for now) " Last Change: 2005 Jun 24 " Only load this indent file when no other was loaded. if exists("b:did_indent") finish endif " Handled like HTML for now. runtime! indent/html.vim vim-7.4.1689/runtime/indent/xinetd.vim000066400000000000000000000022611267703067000175520ustar00rootroot00000000000000" Vim indent file " Language: xinetd.conf(5) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2006-12-20 if exists("b:did_indent") finish endif let b:did_indent = 1 setlocal indentexpr=GetXinetdIndent() setlocal indentkeys=0{,0},!^F,o,O setlocal nosmartindent if exists("*GetXinetdIndent") finish endif let s:keepcpo= &cpo set cpo&vim function s:count_braces(lnum, count_open) let n_open = 0 let n_close = 0 let line = getline(a:lnum) let pattern = '[{}]' let i = match(line, pattern) while i != -1 if synIDattr(synID(a:lnum, i + 1, 0), 'name') !~ 'ld\%(Comment\|String\)' if line[i] == '{' let n_open += 1 elseif line[i] == '}' if n_open > 0 let n_open -= 1 else let n_close += 1 endif endif endif let i = match(line, pattern, i + 1) endwhile return a:count_open ? n_open : n_close endfunction function GetXinetdIndent() let pnum = prevnonblank(v:lnum - 1) if pnum == 0 return 0 endif return indent(pnum) + s:count_braces(pnum, 1) * &sw \ - s:count_braces(v:lnum, 0) * &sw endfunction let &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/indent/xml.vim000066400000000000000000000054301267703067000170600ustar00rootroot00000000000000" Language: xml " Maintainer: Johannes Zellner " Last Change: 2012 Jul 25 " 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. " 2009-05-26 patch by Nikolai Weibull " 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 let s:keepcpo= &cpo set cpo&vim " [-- local settings (must come before aborting the script) --] setlocal indentexpr=XmlIndentGet(v:lnum,1) setlocal indentkeys=o,O,*,<>>,<<>,/,{,} if !exists('b:xml_indent_open') let b:xml_indent_open = '.\{-}<\a' " pre tag, e.g.
" let b:xml_indent_open = '.\{-}<[/]\@!\(address\)\@!' endif if !exists('b:xml_indent_close') let b:xml_indent_close = '.\{-} " let b:xml_indent_close = '.\{-}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! 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 elseif syn1 =~ '^xmlComment' && syn2 =~ '^xmlComment' " indent comments specially return -1 endif endif return 1 endfun " [-- return the sum of indents of a:lnum --] fun! XmlIndentSum(lnum, style, add) let line = getline(a:lnum) if a:style == match(line, '^\s*XmlIndentWithPattern(line, b:xml_indent_open) \ - XmlIndentWithPattern(line, b:xml_indent_close) \ - 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 let check_lnum = XmlIndentSynCheck(lnum) let check_alnum = XmlIndentSynCheck(a:lnum) if 0 == check_lnum || 0 == check_alnum return indent(a:lnum) elseif -1 == check_lnum || -1 == check_alnum return -1 endif endif let ind = XmlIndentSum(lnum, -1, indent(lnum)) let ind = XmlIndentSum(a:lnum, 0, ind) return ind endfun let &cpo = s:keepcpo unlet s:keepcpo " vim:ts=8 vim-7.4.1689/runtime/indent/xsd.vim000066400000000000000000000003751267703067000170610ustar00rootroot00000000000000" Vim indent file " Language: .xsd files (XML Schema) " Maintainer: Nobody " Last Change: 2005 Jun 09 " 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 vim-7.4.1689/runtime/indent/xslt.vim000066400000000000000000000004511267703067000172500ustar00rootroot00000000000000" Vim indent file " Language: XSLT .xslt files " Maintainer: David Fishburn " 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 vim-7.4.1689/runtime/indent/yacc.vim000066400000000000000000000014011267703067000171710ustar00rootroot00000000000000" Vim indent file " Language: YACC input file " Maintainer: Nikolai Weibull " Latest Revision: 2006-12-20 " 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 setlocal nosmartindent " 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-7.4.1689/runtime/indent/yaml.vim000066400000000000000000000103261267703067000172220ustar00rootroot00000000000000" Vim indent file " Language: YAML " Maintainer: Nikolai Pavlov " Last Change: 2015 Nov 01 " Only load this indent file when no other was loaded. if exists('b:did_indent') finish endif let s:save_cpo = &cpo set cpo&vim let b:did_indent = 1 setlocal indentexpr=GetYAMLIndent(v:lnum) setlocal indentkeys=!^F,o,O,0#,0},0],<:>,0- setlocal nosmartindent let b:undo_indent = 'setlocal indentexpr< indentkeys< smartindent<' " Only define the function once. if exists('*GetYAMLIndent') finish endif if exists('*shiftwidth') let s:shiftwidth = function('shiftwidth') else function s:shiftwidth() return &shiftwidth endfunction endif function s:FindPrevLessIndentedLine(lnum, ...) let prevlnum = prevnonblank(a:lnum-1) let curindent = a:0 ? a:1 : indent(a:lnum) while prevlnum \&& indent(prevlnum) >= curindent \&& getline(prevlnum) !~# '^\s*#' let prevlnum = prevnonblank(prevlnum-1) endwhile return prevlnum endfunction function s:FindPrevLEIndentedLineMatchingRegex(lnum, regex) let plilnum = s:FindPrevLessIndentedLine(a:lnum, indent(a:lnum)+1) while plilnum && getline(plilnum) !~# a:regex let plilnum = s:FindPrevLessIndentedLine(plilnum) endwhile return plilnum endfunction let s:mapkeyregex='\v^\s*%(\''%([^'']|'''')*\'''. \ '|\"%([^"\\]|\\.)*\"'. \ '|%(%(\:\ )@!.)*)\:%(\ |$)' let s:liststartregex='\v^\s*%(\-%(\ |$))' function GetYAMLIndent(lnum) if a:lnum == 1 || !prevnonblank(a:lnum-1) return 0 endif let prevlnum = prevnonblank(a:lnum-1) let previndent = indent(prevlnum) let line = getline(a:lnum) if line =~# '^\s*#' && getline(a:lnum-1) =~# '^\s*#' " Comment blocks should have identical indent return previndent elseif line =~# '^\s*[\]}]' " Lines containing only closing braces should have previous indent return indent(s:FindPrevLessIndentedLine(a:lnum)) endif " Ignore comment lines when calculating indent while getline(prevlnum) =~# '^\s*#' let prevlnum = prevnonblank(prevlnum-1) if !prevlnum return previndent endif endwhile let prevline = getline(prevlnum) let previndent = indent(prevlnum) " Any examples below assume that shiftwidth=2 if prevline =~# '\v[{[:]$|[:-]\ [|>][+\-]?%(\s+\#.*|\s*)$' " Mapping key: " nested mapping: ... " " - { " key: [ " list value " ] " } " " - |- " Block scalar without indentation indicator return previndent+s:shiftwidth() elseif prevline =~# '\v[:-]\ [|>]%(\d+[+\-]?|[+\-]?\d+)%(\#.*|\s*)$' " - |+2 " block scalar with indentation indicator "#^^ indent+2, not indent+shiftwidth return previndent + str2nr(matchstr(prevline, \'\v([:-]\ [|>])@<=[+\-]?\d+%([+\-]?%(\s+\#.*|\s*)$)@=')) elseif prevline =~# '\v\"%([^"\\]|\\.)*\\$' " "Multiline string \ " with escaped end" let qidx = match(prevline, '\v\"%([^"\\]|\\.)*\\') return virtcol([prevlnum, qidx+1]) elseif line =~# s:liststartregex " List line should have indent equal to previous list line unless it was " caught by one of the previous rules return indent(s:FindPrevLEIndentedLineMatchingRegex(a:lnum, \ s:liststartregex)) elseif line =~# s:mapkeyregex " Same for line containing mapping key let prevmapline = s:FindPrevLEIndentedLineMatchingRegex(a:lnum, \ s:mapkeyregex) if getline(prevmapline) =~# '^\s*- ' return indent(prevmapline) + 2 else return indent(prevmapline) endif elseif prevline =~# '^\s*- ' " - List with " multiline scalar return previndent+2 elseif prevline =~# s:mapkeyregex " Mapping with: value " that is multiline scalar return previndent+s:shiftwidth() endif return previndent endfunction let &cpo = s:save_cpo vim-7.4.1689/runtime/indent/zimbu.vim000066400000000000000000000075401267703067000174120ustar00rootroot00000000000000" Vim indent file " Language: Zimbu " Maintainer: Bram Moolenaar " Last Change: 2016 Jan 25 " Only load this indent file when no other was loaded. if exists("b:did_indent") finish endif let b:did_indent = 1 setlocal ai nolisp nocin setlocal indentexpr=GetZimbuIndent(v:lnum) setlocal indentkeys=0{,0},!^F,o,O,0=ELSE,0=ELSEIF,0=CASE,0=DEFAULT,0=FINALLY " We impose recommended defaults: no Tabs, 'shiftwidth' = 2 setlocal sw=2 et let b:undo_indent = "setl et< sw< ai< indentkeys< indentexpr=" " Only define the function once. if exists("*GetZimbuIndent") finish endif let s:cpo_save = &cpo set cpo&vim " Come here when loading the script the first time. let s:maxoff = 50 " maximum number of lines to look backwards for () func GetZimbuIndent(lnum) let prevLnum = prevnonblank(a:lnum - 1) if prevLnum == 0 " This is the first non-empty line, use zero indent. return 0 endif " Taken from Python indenting: " 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(prevLnum, 1) let parlnum = searchpair('(\|{\|\[', '', ')\|}\|\]', 'nbW', \ "line('.') < " . (prevLnum - s:maxoff) . " ? dummy :" \ . " synIDattr(synID(line('.'), col('.'), 1), 'name')" \ . " =~ '\\(Comment\\|String\\|Char\\)$'") if parlnum > 0 let plindent = indent(parlnum) let plnumstart = parlnum else let plindent = indent(prevLnum) let plnumstart = prevLnum 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')" \ . " =~ '\\(Comment\\|String\\|Char\\)$'") if p > 0 if p == prevLnum " 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')" \ . " =~ '\\(Comment\\|String\\|Char\\)$'") if pp > 0 return indent(prevLnum) + shiftwidth() endif return indent(prevLnum) + shiftwidth() * 2 endif if plnumstart == p return indent(prevLnum) endif return plindent endif let prevline = getline(prevLnum) let thisline = getline(a:lnum) " If this line is not a comment and the previous one is then move the " previous line further back. if thisline !~ '^\s*#' while prevline =~ '^\s*#' let prevLnum = prevnonblank(prevLnum - 1) if prevLnum == 0 " Only comment lines before this, no indent return 0 endif let prevline = getline(prevLnum) let plindent = indent(prevLnum) endwhile endif if prevline =~ '^\s*\(IF\|\|ELSEIF\|ELSE\|GENERATE_IF\|\|GENERATE_ELSEIF\|GENERATE_ELSE\|WHILE\|REPEAT\|TRY\|CATCH\|FINALLY\|FOR\|DO\|SWITCH\|CASE\|DEFAULT\|FUNC\|VIRTUAL\|ABSTRACT\|DEFINE\|REPLACE\|FINAL\|PROC\|MAIN\|NEW\|ENUM\|CLASS\|INTERFACE\|BITS\|MODULE\|SHARED\)\>' let plindent += shiftwidth() endif if thisline =~ '^\s*\(}\|ELSEIF\>\|ELSE\>\|CATCH\|FINALLY\|GENERATE_ELSEIF\>\|GENERATE_ELSE\>\|UNTIL\>\)' let plindent -= shiftwidth() endif if thisline =~ '^\s*\(CASE\>\|DEFAULT\>\)' && prevline !~ '^\s*SWITCH\>' let plindent -= shiftwidth() endif " line up continued comment that started after some code " String something # comment comment " # comment if a:lnum == prevLnum + 1 && thisline =~ '^\s*#' && prevline !~ '^\s*#' let n = match(prevline, '#') if n > 1 let plindent = n endif endif return plindent endfunc let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/indent/zsh.vim000066400000000000000000000006331267703067000170640ustar00rootroot00000000000000" Vim indent file " Language: Zsh shell script " Maintainer: Christian Brabandt " Previous Maintainer: Nikolai Weibull " Latest Revision: 2015-05-29 " License: Vim (see :h license) " Repository: https://github.com/chrisbra/vim-zsh if exists("b:did_indent") finish endif " Same as sh indenting for now. runtime! indent/sh.vim vim-7.4.1689/runtime/indoff.vim000066400000000000000000000004321267703067000162410ustar00rootroot00000000000000" Vim support file to switch off loading indent files for file types " " Maintainer: Bram Moolenaar " 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 * vim-7.4.1689/runtime/keymap/000077500000000000000000000000001267703067000155465ustar00rootroot00000000000000vim-7.4.1689/runtime/keymap/README.txt000066400000000000000000000016731267703067000172530ustar00rootroot00000000000000keymap 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". vim-7.4.1689/runtime/keymap/accents.vim000066400000000000000000000012111267703067000176760ustar00rootroot00000000000000" Vim Keymap file for latin1 accents through dead characters " Maintainer: Bram Moolenaar " Last Change: 2006 Mar 29 " 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 :A 'C C `E 'E E ^E `I 'I I ^I ~N `O 'O O ^O ~O :O `U 'U U ^U :U 'Y Y `a 'a a ^a ~a :a 'c c `e 'e e ^e `i 'i i ^i ~n `o 'o o ^o ~o :o `u 'u u ^u :u 'y y '' ' `` ` ^^ ^ ~~ ~ :: : vim-7.4.1689/runtime/keymap/arabic.vim000066400000000000000000000001551267703067000175050ustar00rootroot00000000000000" Assume 'encoding' is set to "latin1" while actually iso-8859-6 is used source :p:h/arabic_utf-8.vim vim-7.4.1689/runtime/keymap/arabic_utf-8.vim000066400000000000000000000064731267703067000205410ustar00rootroot00000000000000" Vim Keymap file for Arabic " Maintainer : Arabic Support group " Created by : Nadim Shaikli " 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 " (1590) - DAD w " (1589) - SAD e " (1579) - THEH r " (1602) - QAF t " (1601) - FEH y " (1594) - GHAIN u " (1593) - AIN i " (1607) - HEH o " (1582) - KHAH p " (1581) - HAH [ " (1580) - JEEM ] " (1583) - DAL a " (1588) - SHEEN s " (1587) - SEEN d " (1610) - YEH f " (1576) - BEH g " (1604) - LAM h " (1575) - ALEF j " (1578) - TEH k " (1606) - NOON l " (1605) - MEEM ; " (1603) - KAF ' " (1591) - TAH z " (1574) - YEH with HAMZA ABOVE x " (1569) - HAMZA c " (1572) - WAW with HAMZA ABOVE v " (1585) - REH b " (1604/1575) - LAA (lam alef) n " (1609) - ALEF MAKSURA m " (1577) - TEH MARBUTA , " (1608) - WAW . " (1586) - ZAIN / " (1592) - ZAH 0 " (1632) - Arabic 0 1 " (1633) - Arabic 1 2 " (1634) - Arabic 2 3 " (1635) - Arabic 3 4 " (1636) - Arabic 4 5 " (1637) - Arabic 5 6 " (1638) - Arabic 6 7 " (1639) - Arabic 7 8 " (1640) - Arabic 8 9 " (1641) - Arabic 9 ` " (1584) - THAL ~ " (1617) - Tanween -- SHADDA Q " (1614) - Tanween -- FATHA W " (1611) - Tanween -- FATHATAN E " (1615) - Tanween -- DAMMA R " (1612) - Tanween -- DAMMATAN T " (1604/1573) - LAA with HAMZA BELOW Y " (1573) - ALEF with HAMZA BELOW U " (96) - ASCII -- ` I " (247) - ASCII suppl -- div O " (215) - ASCII suppl -- mul P " (1563) - Arabic Semicolon { " (60) - ASCII -- < } " (62) - ASCII -- > A " (1616) - Tanween -- KASRA S " (1613) - Tanween -- KASRATAN D " (91) - ASCII -- [ F " (93) - ASCII -- ] G " (1604/1571) - LAA with HAMZA ABOVE H " (1571) - ALEF with HAMZA ABOVE J " (1600) - TATWEEL K " (1548) - Arabic Comma L " (47) - ASCII -- / Z " (126) - ASCII -- ~ X " (1618) - Tanween -- SUKUN C " (123) - ASCII -- { V " (125) - ASCII -- } B " (1604/1570) - LAA with MADDA ABOVE N " (1570) - ALEF with MADDA ABOVE M " (39) - ASCII -- ' < " (44) - ASCII -- , > " (46) - ASCII -- . ? " (1567) - Arabic Question Mark vim-7.4.1689/runtime/keymap/belarusian-jcuken.vim000066400000000000000000000047261267703067000216760ustar00rootroot00000000000000" Vim Keymap file for Belarusian characters, layout 'jcuken', classical variant " Useful mainly with UTF-8, but may work with other encodings. " Derived From: russian-jcuken.vim " Maintainer: Aliaksei Nestserau " Last Changed: 2012 Jul 23 " All characters are given literally, conversion to another encoding (e.g., " UTF-8) should work. scriptencoding utf-8 let b:keymap_name = "by" 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 ASYLLABIC U } ' APOSTROPHE 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 ASYLLABIC U ] ' APOSTROPHE s ы CYRILLIC SMALL LETTER YERU m ь CYRILLIC SMALL LETTER SOFT SIGN ' э CYRILLIC SMALL LETTER E . ю CYRILLIC SMALL LETTER YU z я CYRILLIC SMALL LETTER YA @ " # ' $ * % : ^ , & . * ; vim-7.4.1689/runtime/keymap/bulgarian-bds.vim000066400000000000000000000145451267703067000210060ustar00rootroot00000000000000" Vim keymap file for Bulgarian and Russian characters, "bds" layout. " Most of it can be used with both utf-8 and cp1251 file encodings, except " the accented characters which can only be stored in utf-8. " This file itself is in utf-8. " Maintainer: Boyko Bantchev " URI: http://www.math.bas.bg/bantchev/vim/bulgarian-bds.vim " Last Changed: 2010 May 4 " This keymap corresponds to what is called Bulgarian standard typewriter " keyboard layout, or "БДС". " " Note that, in addition to the Bulgarian alphabet, the BDS layout prescribes " the presence of the following characters: " — The Russian letters ы (small), and Э and э (capital and small). " — The latin capital letters I and V – used to type Roman numerals " without having to leave Cyrillic mode. " " Some punctuation characters present in ascii are mapped in BDS to keys " different from the ones they occupy in the QWERTY layout, because the latter " keys are used to type other characters. " " In this keymap, also defined (besides BDS) are: " — The Russian letters Ё and ё (capital and small), as well as the " Russian capital letter Ы (see above for the small counterpart). " This way, using the bulgarian-bds keymap, one can access both " the Bulgarian and the Russian alphabets. " — The quotation marks „ “ ” ‘ ’ (used in the Bulgarian and English " quotation styles), as well as « » (Russian quotation style). " — The characters §, №, – (en-dash), — (em-dash), …, •, ·, ±, °, ¬, " ¤, €, ‰, †, ‡, and ¶. " " The keymap also defines key combinations for grave and acute accents. " (Grave accent is used in Bulgarian, acute in Russian, but both accents " apply to other languages as well.) " " For details of what key or key combination maps to what character, please " see below the map itself. " " See also http://www.math.bas.bg/bantchev/vim/kbdbul.html (in Bulgarian). scriptencoding utf-8 let b:keymap_name = "bds" loadkeymap D А CYRILLIC CAPITAL LETTER A ? Б CYRILLIC CAPITAL LETTER BE L В CYRILLIC CAPITAL LETTER VE H Г CYRILLIC CAPITAL LETTER GHE O Д CYRILLIC CAPITAL LETTER DE E Е CYRILLIC CAPITAL LETTER IE E:: Ё CYRILLIC CAPITAL LETTER IO G Ж CYRILLIC CAPITAL LETTER ZHE P З CYRILLIC CAPITAL LETTER ZE R И CYRILLIC CAPITAL LETTER I X Й CYRILLIC CAPITAL LETTER SHORT I U К CYRILLIC CAPITAL LETTER KA > Л CYRILLIC CAPITAL LETTER EL : М CYRILLIC CAPITAL LETTER EM K Н CYRILLIC CAPITAL LETTER EN F О CYRILLIC CAPITAL LETTER O M П CYRILLIC CAPITAL LETTER PE < Р CYRILLIC CAPITAL LETTER ER I С CYRILLIC CAPITAL LETTER ES J Т CYRILLIC CAPITAL LETTER TE W У CYRILLIC CAPITAL LETTER U B Ф CYRILLIC CAPITAL LETTER EF N Х CYRILLIC CAPITAL LETTER HA { Ц CYRILLIC CAPITAL LETTER TSE \" Ч CYRILLIC CAPITAL LETTER CHE T Ш CYRILLIC CAPITAL LETTER SHA Y Щ CYRILLIC CAPITAL LETTER SHCHA C Ъ CYRILLIC CAPITAL LETTER HARD SIGN CX Ы CYRILLIC CAPITAL LETTER YERU A Ь CYRILLIC CAPITAL LETTER SOFT SIGN V Э CYRILLIC CAPITAL LETTER REVERSED E Z Ю CYRILLIC CAPITAL LETTER YU S Я CYRILLIC CAPITAL LETTER YA d а CYRILLIC SMALL LETTER A \/ б CYRILLIC SMALL LETTER BE l в CYRILLIC SMALL LETTER VE h г CYRILLIC SMALL LETTER GHE o д CYRILLIC SMALL LETTER DE e е CYRILLIC SMALL LETTER IE e:: ё CYRILLIC SMALL LETTER IO g ж CYRILLIC SMALL LETTER ZHE p з CYRILLIC SMALL LETTER ZE r и CYRILLIC SMALL LETTER I x й CYRILLIC SMALL LETTER SHORT I u к CYRILLIC SMALL LETTER KA \. л CYRILLIC SMALL LETTER EL ; м CYRILLIC SMALL LETTER EM k н CYRILLIC SMALL LETTER EN f о CYRILLIC SMALL LETTER O m п CYRILLIC SMALL LETTER PE , р CYRILLIC SMALL LETTER ER i с CYRILLIC SMALL LETTER ES j т CYRILLIC SMALL LETTER TE w у CYRILLIC SMALL LETTER U b ф CYRILLIC SMALL LETTER EF n х CYRILLIC SMALL LETTER HA [ ц CYRILLIC SMALL LETTER TSE ' ч CYRILLIC SMALL LETTER CHE t ш CYRILLIC SMALL LETTER SHA y щ CYRILLIC SMALL LETTER SHCHA c ъ CYRILLIC SMALL LETTER HARD SIGN Q ы CYRILLIC SMALL LETTER YERU a ь CYRILLIC SMALL LETTER SOFT SIGN v э CYRILLIC SMALL LETTER REVERSED E z ю CYRILLIC SMALL LETTER YU s я CYRILLIC SMALL LETTER YA _ I LATIN CAPITAL LETTER I + V LATIN CAPITAL LETTER V $ " QUOTATION MARK \\ ( LEFT PARENTHESIS | ) RIGHT PARENTHESIS # + PLUS SIGN q , COMMA ( - HYPHEN-MINUS = . FULL STOP (PERIOD) * / SOLIDUS (SLASH) & : COLON ] ; SEMICOLON ^ = EQUALS SIGN @ ? QUESTION MARK } § SECTION SIGN (PARAGRAPH SIGN) ) № NUMERO SIGN -- – EN DASH --- — EM DASH .. … HORIZONTAL ELLIPSIS `` “ LEFT DOUBLE QUOTATION MARK '' ” RIGHT DOUBLE QUOTATION MARK ,, „ DOUBLE LOW-9 QUOTATION MARK `. ‘ LEFT SINGLE QUOTATION MARK '. ’ RIGHT SINGLE QUOTATION MARK << « LEFT-POINTING DOUBLE ANGLE QUOTATION MARK >> » RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK ** • BULLET ,. · MIDDLE DOT +- ± PLUS-MINUS SIGN ^o ° DEGREE SIGN ~~ ¬ NOT SIGN @@ ¤ CURRENCY SIGN $$ € EURO SIGN %% ‰ PER MILLE SIGN +| † DAGGER ++ ‡ DOUBLE DAGGER || ¶ PILCROW SIGN " Accented characters cannot map onto cp1251 – use utf-8 file encoding. " To apply an accent to a letter, type the corresponding key combination " to the immediate right of that letter. ^` COMBINING GRAVE ACCENT ^' COMBINING ACUTE ACCENT vim-7.4.1689/runtime/keymap/bulgarian-phonetic.vim000066400000000000000000000132561267703067000220450ustar00rootroot00000000000000" Vim keymap file for Bulgarian and Russian characters, "phonetic" layout. " Most of it can be used with both utf-8 and cp1251 file encodings, except " the accented vowels which can only be stored in utf-8. " This file itself is in utf-8. " Maintainer: Boyko Bantchev " URI: http://www.math.bas.bg/bantchev/vim/bulgarian-phonetic.vim " Last Changed: 2010 May 4 " This keymap corresponds to what is called "phonetic layout" in Bulgaria: " Cyrillic letters tend to be mapped to their Latin homophones wherever " there are ones. Most keys corresponding to punctuation characters are " left unmapped, so they retain their usual (QWERTY) meanings when typing " Cyrillic. " " In addition to the Bulgarian alphabet, the keymap makes accessible the " following characters: " — The letters Ё and ё, Э and э, and Ы and ы (in pairs of capital and " small). These are the letters in the Russian alphabet that are not " present in Bulgarian, so using the bulgarian-phonetic keymap one can " type in Russian, too. " — The quotation marks „ “ ” ‘ ’ (used in the Bulgarian and English " quotation styles), as well as « » (Russian quotation style). " — The characters §, №, – (en-dash), — (em-dash), …, •, ·, ±, °, ¬, " ¤, €, ‰, †, ‡, and ¶. " " The keymap also defines key combinations for grave and acute accents. " (Grave accent is used in Bulgarian, acute in Russian, but both accents " apply to other languages as well.) " " For details of what key or key combination maps to what character, please " see below the map itself. " " See also http://www.math.bas.bg/bantchev/vim/kbdbul.html (in Bulgarian). scriptencoding utf-8 let b:keymap_name = "pho" 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 E:: Ё 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 Y Ъ CYRILLIC CAPITAL LETTER HARD SIGN YI Ы CYRILLIC CAPITAL LETTER YERU X Ь CYRILLIC CAPITAL LETTER SOFT SIGN YE Э CYRILLIC CAPITAL LETTER REVERSED 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 e:: ё 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 y ъ CYRILLIC SMALL LETTER HARD SIGN yi ы CYRILLIC SMALL LETTER YERU x ь CYRILLIC SMALL LETTER SOFT SIGN ye э CYRILLIC SMALL LETTER REVERSED E \\ ю CYRILLIC SMALL LETTER YU q я CYRILLIC SMALL LETTER YA !! § SECTION SIGN (PARAGRAPH SIGN) ## № NUMERO SIGN -- – EN DASH --- — EM DASH .. … HORIZONTAL ELLIPSIS `` “ LEFT DOUBLE QUOTATION MARK '' ” RIGHT DOUBLE QUOTATION MARK ,, „ DOUBLE LOW-9 QUOTATION MARK `. ‘ LEFT SINGLE QUOTATION MARK '. ’ RIGHT SINGLE QUOTATION MARK << « LEFT-POINTING DOUBLE ANGLE QUOTATION MARK >> » RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK ** • BULLET ,. · MIDDLE DOT +- ± PLUS-MINUS SIGN ^o ° DEGREE SIGN ~~ ¬ NOT SIGN @@ ¤ CURRENCY SIGN $$ € EURO SIGN %% ‰ PER MILLE SIGN +| † DAGGER ++ ‡ DOUBLE DAGGER || ¶ PILCROW SIGN " Accented characters cannot map onto cp1251 – use utf-8 file encoding. " To apply an accent to a letter, type the corresponding key combination " to the immediate right of that letter. ^` COMBINING GRAVE ACCENT ^' COMBINING ACUTE ACCENT vim-7.4.1689/runtime/keymap/canfr-win.vim000066400000000000000000000022161267703067000201500ustar00rootroot00000000000000" Vim Keymap file for the normalized Canadian multilingual keyboard " CAN/CSA Z243.200-92 using the latin1 encoding. " This mapping is limited in scope, as it assumes that the AltGr " key works as it typically does in a Windows system with a multilingual " English keyboard. It probably won't work with the US keyboard on US " English versions of Windows, because those don't provide the AltGr keys. " The mapping was tested with Win2k and WinXP. " Maintainer: Eric Joanis " Last Change: 2004 Jan 13 " 2003 Dec 04 " Initial Revision " 2004 Jan 13 " Added the upper case accented characters, forgotten in the initial version. " 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 = "canfr" loadkeymap < ' > " / ? ' \" \\ | [a [e [i [o [u [A [E [I [O [U [[ ^ {a {e {i {o {u {y {A {E {I {O {U ] } ` / ~ \\ ^ ? < > a e i o u A E I O U ` a o n s A O N S ~ | { } [ ] vim-7.4.1689/runtime/keymap/croatian.vim000066400000000000000000000005241267703067000200640ustar00rootroot00000000000000let s:encoding = &enc if s:encoding == 'latin1' if has("unix") let s:encoding = 'iso-8859-2' else let s:encoding = 'cp1250' endif endif if s:encoding == 'utf-8' source :p:h/croatian_utf-8.vim elseif s:encoding == 'cp1250' source :p:h/croatian_cp1250.vim else source :p:h/croatian_iso-8859-2.vim endif vim-7.4.1689/runtime/keymap/croatian_cp1250.vim000066400000000000000000000010501267703067000210510ustar00rootroot00000000000000" Vim Keymap file for Croatian characters, classical variant, cp1250 encoding " " Maintainer: Paul B. Mahol " Last Changed: 2007 Oct 15 scriptencoding cp1250 let b:keymap_name = "croatian-cp1250" " Uncomment line below if you prefer short name "let b:keymap_name = "hr-cp1250" loadkeymap z y Z Y y z Y Z [ { ] } ; : ' " \ | / - ? _ > : < ; < > { } [ ] \ | = + + * - ' _ ? @ " ^ & & / * ( ( ) ) = ~ @ ^ ` vim-7.4.1689/runtime/keymap/croatian_iso-8859-2.vim000066400000000000000000000013011267703067000215020ustar00rootroot00000000000000" Vim Keymap file for Croatian characters, classical variant, iso-8859-2 encoding " " Maintainer: Paul B. Mahol " Last Changed: 2007 Oct 14 scriptencoding iso-8859-2 let b:keymap_name = "croatian-iso-8859-2" " Uncomment line below if you prefer short name "let b:keymap_name = "hr-iso-8859-2" loadkeymap " swap y and z, not important z y Z Y y z Y Z " s< [ " S< { " D/ } " d/ ] " c< ; " c' ' " C< : " C' " " z< \ " Z< | | @ \ { } [ ] @ " ^ & & / * ( ( ) ) = _ ? - ' = + + * / - < ; > : ? _ ~ ^ ` " you still want to be able to type <, > < > ` vim-7.4.1689/runtime/keymap/croatian_utf-8.vim000066400000000000000000000011421267703067000211040ustar00rootroot00000000000000" Vim Keymap file for Croatian characters, classical variant, UTF-8 encoding " " Maintainer: Paul B. Mahol " Last Changed: 2007 Oct 14 scriptencoding UTF-8 let b:keymap_name = "croatian-UTF-8" " Uncomment line below if you prefer short name "let b:keymap_name = "hr-UTF-8" loadkeymap z y Z Y y z Y Z [ š { Š ] đ } Đ ; č : Č ' ć " Ć \ ž | Ž @ " ^ & & / * ( ( ) ) = _ ? + * = + - ' æ [ ç ] â { î } < ; > : / - ? _ ö @ ñ \ ÷ | å € ¬ < ® > ± ~ ² ˇ ³ ^ ´ ˘ µ ° · ` ¹ ´ í § Û ÷ Ü ¤ Ý × § ß ì ł Ì Ł ° ˝ ` ¸ ½ ¸ ­ ¨ vim-7.4.1689/runtime/keymap/czech.vim000066400000000000000000000000431267703067000173540ustar00rootroot00000000000000source :p:h/czech_utf-8.vim vim-7.4.1689/runtime/keymap/czech_utf-8.vim000066400000000000000000000010641267703067000204030ustar00rootroot00000000000000" Maintainer: Štěpán Němec " Last Changed: Fri 25 Jun 2010 22:08:43 CEST let b:keymap_name = "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 ü \\z ÿ \\A Ä \\E Ë \\I Ï \\O Ö \\U Ü \\Z Ÿ =a á =e é =i í =o ó =u ú =z ý =A Á =E É =I Í =O Ó =U Ú =Z Ý +c č +d ď +e ě +n ň +r ř +s š +t ť +y ž +C Č +D Ď +E Ě +N Ň +R Ř +S Š +T Ť +Y Ž y z Y Z z y Z Y vim-7.4.1689/runtime/keymap/dvorak.vim000066400000000000000000000007731267703067000175600ustar00rootroot00000000000000" Maintainer: Ashish SHUKLA " Last Changed: 2009 Jul 04 " " All characters are ASCII, conversion to another encoding (e.g., UTF-8) " should work. let b:keymap_name = "en-dv" loadkeymap q ' w , e . r p t y y f u g i c o r p l [ / ] = \\ \\ a a s o d e f u g i h d j h k t l n ; s ' - z ; x q c j v k b x n b m m , w . v / z Z : X Q C J V K B X N B M M < W > V ? Z A A S O D E F U G I H D J H K T L N : S \" _ Q " W < E > R P T Y Y F U G I C O R P L { ? } + | | - [ _ { = ] + } vim-7.4.1689/runtime/keymap/esperanto.vim000066400000000000000000000000471267703067000202640ustar00rootroot00000000000000source :p:h/esperanto_utf-8.vim vim-7.4.1689/runtime/keymap/esperanto_utf-8.vim000066400000000000000000000045371267703067000213170ustar00rootroot00000000000000" Esperanto keymap for utf-8 " Maintainer: A.J.Mechelynck " 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 " (264) UPPERCASE C WITH CIRCUMFLEX ^c " (265) LOWERCASE c WITH CIRCUMFLEX ^G " (284) UPPERCASE G WITH CIRCUMFLEX ^g " (285) LOWERCASE g WITH CIRCUMFLEX ^H " (292) UPPERCASE H WITH CIRCUMFLEX ^h " (293) LOWERCASE h WITH CIRCUMFLEX ^J " (308) UPPERCASE J WITH CIRCUMFLEX ^j " (309) LOWERCASE j WITH CIRCUMFLEX ^S " (348) UPPERCASE S WITH CIRCUMFLEX ^s " (349) LOWERCASE s WITH CIRCUMFLEX " (364) UPPERCASE U WITH BREVE " (365) LOWERCASE u WITH BREVE CX " (264) UPPERCASE C WITH CIRCUMFLEX Cx " (264) UPPERCASE C WITH CIRCUMFLEX cx " (265) LOWERCASE c WITH CIRCUMFLEX GX " (284) UPPERCASE G WITH CIRCUMFLEX Gx " (284) UPPERCASE G WITH CIRCUMFLEX gx " (285) LOWERCASE g WITH CIRCUMFLEX HX " (292) UPPERCASE H WITH CIRCUMFLEX Hx " (292) UPPERCASE H WITH CIRCUMFLEX hx " (293) LOWERCASE h WITH CIRCUMFLEX JX " (308) UPPERCASE J WITH CIRCUMFLEX Jx " (308) UPPERCASE J WITH CIRCUMFLEX jx " (309) LOWERCASE j WITH CIRCUMFLEX SX " (348) UPPERCASE S WITH CIRCUMFLEX Sx " (348) UPPERCASE S WITH CIRCUMFLEX sx " (349) LOWERCASE s WITH CIRCUMFLEX UX " (364) UPPERCASE U WITH BREVE Ux " (364) UPPERCASE U WITH BREVE ux " (365) LOWERCASE u WITH BREVE vim-7.4.1689/runtime/keymap/greek.vim000066400000000000000000000003521267703067000173600ustar00rootroot00000000000000" Assume 'encoding' is set to "latin1" while actually cp1253 or iso-8859-7 is " being used if has("win16") || has("win32") || has("win32unix") source :p:h/greek_cp1253.vim else source :p:h/greek_iso-8859-7.vim endif vim-7.4.1689/runtime/keymap/greek_cp1253.vim000066400000000000000000000042341267703067000203600ustar00rootroot00000000000000" Vim Keymap file for greek " Maintainer: Grigorios Magklis " Patched for MS-Windows CP1253: Panagiotis Louridas " 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 " B " G " D " E " Z " H " U " I " K " L " M " N " J " O " P " R " S " T " Y " F " X " C " V " " small a " b " g " d " e " z " h " u " i " k " l " m " n " j " o " p " r " w " s " t " y " f " x " c " v " " accented capital ;A " ;E " ;H " ;I " ;Y " ;O " ;V " " :I " :Y " " accented small ;a " ;e " ;h " ;i " ;y " ;o " ;v " " :i " :y " " ;:i " :;i " ;:y " :;y " " symbols q ; " ; Q : " : W " ; " : " ;: " :; " " quotes << " >> " " " " " vim-7.4.1689/runtime/keymap/greek_cp737.vim000066400000000000000000000036431267703067000203110ustar00rootroot00000000000000" Vim Keymap file for greek DOS cp737 " Maintainer: Panagiotis Louridas " Last Updated: Thu Mar 23 14:05:45 EET 2006 " This keyboard layout allows all Greek symbols to be typed, " including accented capitals and diaeresis. It does not " include diaeresis and accent on the same vowel, nor " the greek quotes, as these were not included in the codepage. " It includes 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" " Use this short name in the status line. let b:keymap_name = "greek" loadkeymap " capital A " B " G " D " E " Z " H " U " I " K " L " M " N " J " O " P " R " S " T " Y " F " X " C " V " " small a " b " g " d " e " z " h " u " i " k " l " m " n " j " o " p " r " s " w " t " y " f " x " c " v " " accented capital ;A " ;E " ;H " ;I " ;O " ;Y " ;V " " :I " :Y " " accented small ;a " ;e " ;h " ;i " ;o " ;y " ;v " " :i " :y " " " symbols q ; " ; Q : " : W " vim-7.4.1689/runtime/keymap/greek_iso-8859-7.vim000066400000000000000000000041241267703067000210120ustar00rootroot00000000000000" Vim Keymap file for greek " Maintainer: Grigorios Magklis " 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 " B " G " D " E " Z " H " U " I " K " L " M " N " J " O " P " R " S " T " Y " F " X " C " V " " small a " b " g " d " e " z " h " u " i " k " l " m " n " j " o " p " r " w " s " t " y " f " x " c " v " " accented capital ;A " ;E " ;H " ;I " ;Y " ;O " ;V " " :I " :Y " " accented small ;a " ;e " ;h " ;i " ;y " ;o " ;v " " :i " :y " " ;:i " :;i " ;:y " :;y " " symbols q ; " ; Q : " : W " ; " : " ;: " :; " " quotes << " >> " " " " " vim-7.4.1689/runtime/keymap/greek_utf-8.vim000066400000000000000000000632711267703067000204140ustar00rootroot00000000000000" Vim Keymap file for greek " Maintainer: Panagiotis Louridas " Last Updated: Thu Mar 23 23:45:02 EET 2006 " This file was corrected for Vim after the version adapted for Vim 6 from " the yudit distribution by Robert Goulding " " The monotonic part of this kmap was made by Constantine Stathopoulos " . " The polytonic part was made by 04/11-1999, " Aarhus, Denmark. " It was modified and completed by A. Tsolomitis " The licence allows modifications but redistribution of modifications " should be with another name. " The keymap now conforms with the " LaTeX's-Babel Standard by A. Syropoulos " 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 " ; tonos " / 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$ " EURO SIGN >> " RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK [GREEK " EISAGOGIKA/OMOIOMATIKA - DEFINITION " MISSING FROM UNICODE] ;> " << " LEFT-POINTING DOUBLE ANGLE QUOTATION MARK [GREEK " EISAGOGIKA - DEFINITION MISSING FROM UNICODE] ;< " Q " COLON [GREEK EPEXIGIMATIKA OR ANO & KATO TELEIA - " DEFINITION MISSING FROM UNICODE] q " GREEK QUESTION MARK (EROTIMATIKO) ;. " GREEK ANO TELEIA (KDE/kikbd/Xinput standard) W " GREEK ANO TELEIA (Emacs standard) ' " GREEK APOSTROFOS -- " endash --- " emdash " " GREEK DIACRITICS " : " DIAERESIS [GREEK DIALYTIKA - DEFINITION MISSING FROM " UNICODE] ; " GREEK TONOS :; " GREEK DIALYTIKA Oxia ;: " GREEK DIALYTIKA Oxia :` " GREEK DIALYTIKA VARIA `: " GREEK DIALYTIKA VARIA / " GREEK OXIA ` " GREEK VARIA ~ " PERISPOMENI >` " PSILI VARIA <` " DASIA VARIA >; " PSILI OXIA <; " DASIA OXIA <~ " DASIA PERISPOMENI >~ " PSILI PERISPOMENI "For plain psili use apostrophe ;' " (Plain) dasia " " " " GREEK LETTERS " A " GREEK CAPITAL LETTER ALPHA B " GREEK CAPITAL LETTER BETA G " GREEK CAPITAL LETTER GAMMA D " GREEK CAPITAL LETTER DELTA E " GREEK CAPITAL LETTER EPSILON Z " GREEK CAPITAL LETTER ZETA H " GREEK CAPITAL LETTER ETA U " GREEK CAPITAL LETTER THETA I " GREEK CAPITAL LETTER IOTA K " GREEK CAPITAL LETTER KAPPA L " GREEK CAPITAL LETTER LAMDA M " GREEK CAPITAL LETTER MU N " GREEK CAPITAL LETTER NU J " GREEK CAPITAL LETTER XI O " GREEK CAPITAL LETTER OMIKRON P " GREEK CAPITAL LETTER PI R " GREEK CAPITAL LETTER RHO S " GREEK CAPITAL LETTER SIGMA T " GREEK CAPITAL LETTER TAU Y " GREEK CAPITAL LETTER UPSILON F " GREEK CAPITAL LETTER PHI X " GREEK CAPITAL LETTER CHI C " GREEK CAPITAL LETTER PSI V " GREEK CAPITAL LETTER OMEGA a " GREEK SMALL LETTER ALPHA b " GREEK SMALL LETTER BETA g " GREEK SMALL LETTER GAMMA d " GREEK SMALL LETTER DELTA e " GREEK SMALL LETTER EPSILON z " GREEK SMALL LETTER ZETA h " GREEK SMALL LETTER ETA u " GREEK SMALL LETTER THETA i " GREEK SMALL LETTER IOTA k " GREEK SMALL LETTER KAPPA l " GREEK SMALL LETTER LAMDA m " GREEK SMALL LETTER MU n " GREEK SMALL LETTER NU j " GREEK SMALL LETTER XI o " GREEK SMALL LETTER OMICRON p " GREEK SMALL LETTER PI r " GREEK SMALL LETTER RHO w " GREEK SMALL LETTER FINAL SIGMA s " GREEK SMALL LETTER SIGMA t " GREEK SMALL LETTER TAU y " GREEK SMALL LETTER UPSILON f " GREEK SMALL LETTER PHI x " GREEK SMALL LETTER CHI c " GREEK SMALL LETTER PSI v " GREEK SMALL LETTER OMEGA " "COMBINED GREEK LETTERS WITH DIACRITICS " ;A " GREEK CAPITAL LETTER ALPHA WITH TONOS ;E " GREEK CAPITAL LETTER EPSILON WITH TONOS ;H " GREEK CAPITAL LETTER ETA WITH TONOS ;I " GREEK CAPITAL LETTER IOTA WITH TONOS ;O " GREEK CAPITAL LETTER OMICRON WITH TONOS ;Y " GREEK CAPITAL LETTER UPSILON WITH TONOS ;V " GREEK CAPITAL LETTER OMEGA WITH TONOS :;i " GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS ;:i " GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS :`i " GREEK SMALL LETTER IOTA WITH DIALYTIKA AND baria `:i " GREEK SMALL LETTER IOTA WITH DIALYTIKA AND baria :I " GREEK CAPITAL LETTER IOTA WITH DIALYTIKA :Y " GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA ;a " GREEK SMALL LETTER ALPHA WITH TONOS ;e " GREEK SMALL LETTER EPSILON WITH TONOS ;h " GREEK SMALL LETTER ETA WITH TONOS ;i " GREEK SMALL LETTER IOTA WITH TONOS :;y " GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS ;:y " GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS :`y " GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND baria `:y " GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND baria :i " GREEK SMALL LETTER IOTA WITH DIALYTIKA :y " GREEK SMALL LETTER UPSILON WITH DIALYTIKA ;o " GREEK SMALL LETTER OMICRON WITH TONOS ;y " GREEK SMALL LETTER UPSILON WITH TONOS ;v " GREEK SMALL LETTER OMEGA WITH TONOS " " This area covers 0x1F00-0x1FFF " " " letters with Varia: " `A " GREEK CAPITAL LETTER ALPHA WITH VARIA `E " GREEK CAPITAL LETTER ALPHA WITH VARIA `H " GREEK CAPITAL LETTER ETA WITH VARIA `I " GREEK CAPITAL LETTER IOTA WITH VARIA `O " GREEK CAPITAL LETTER ALPHA WITH VARIA `Y " GREEK CAPITAL LETTER ALPHA WITH VARIA `V " GREEK CAPITAL LETTER OMEGA WITH VARIA `a " GREEK SMALL LETTER ALPHA WITH VARIA `e " GREEK SMALL LETTER ALPHA WITH VARIA `h " GREEK SMALL LETTER ETA WITH VARIA `i " GREEK SMALL LETTER IOTA WITH VARIA `o " GREEK SMALL LETTER ALPHA WITH VARIA `y " GREEK SMALL LETTER ALPHA WITH VARIA `v " GREEK SMALL LETTER OMEGA WITH VARIA " " letters with Oxia: " /A " GREEK CAPITAL LETTER ALPHA WITH OXIA /E " GREEK CAPITAL LETTER EPSILON WITH OXIA /H " GREEK CAPITAL LETTER ETA WITH OXIA /I " GREEK CAPITAL LETTER IOTA WITH OXIA /O " GREEK CAPITAL LETTER OMICRON WITH OXIA /Y " GREEK CAPITAL LETTER UPSILON WITH OXIA /V " GREEK CAPITAL LETTER OMEGA WITH OXIA /a " GREEK SMALL LETTER ALPHA WITH OXIA /e " GREEK SMALL LETTER EPSILON WITH OXIA /h " GREEK SMALL LETTER ETA WITH OXIA /i " GREEK SMALL LETTER IOTA WITH OXIA /o " GREEK SMALL LETTER OMICRON WITH OXIA /y " GREEK SMALL LETTER UPSILON WITH OXIA /v " GREEK SMALL LETTER OMEGA WITH OXIA " " letters with Psili: " >A " GREEK CAPITAL LETTER ALPHA WITH PSILI >E " GREEK CAPITAL LETTER EPSILON WITH PSILI >H " GREEK CAPITAL LETTER ETA WITH PSILI >I " GREEK CAPITAL LETTER IOTA WITH PSILI >O " GREEK CAPITAL LETTER OMICRON WITH PSILI >Y " GREEK CAPITAL LETTER UPSILON WITH PSILI >V " GREEK CAPITAL LETTER OMEGA WITH PSILI >a " GREEK SMALL LETTER ALPHA WITH PSILI >e " GREEK SMALL LETTER EPSILON WITH PSILI >h " GREEK SMALL LETTER ETA WITH PSILI >i " GREEK SMALL LETTER IOTA WITH PSILI >o " GREEK SMALL LETTER OMICRON WITH PSILI >y " GREEK SMALL LETTER UPSILON WITH PSILI >v " GREEK SMALL LETTER OMEGA WITH PSILI " " Letters with Dasia: " " GREEK CAPITAL LETTER ALPHA WITH DASIA " GREEK CAPITAL LETTER EPSILON WITH DASIA " GREEK CAPITAL LETTER ETA WITH DASIA " GREEK CAPITAL LETTER IOTA WITH DASIA " GREEK CAPITAL LETTER OMICRON WITH DASIA " GREEK CAPITAL LETTER UPSILON WITH DASIA " GREEK CAPITAL LETTER OMEGA WITH DASIA " GREEK SMALL LETTER ALPHA WITH DASIA " GREEK SMALL LETTER EPSILON WITH DASIA " GREEK SMALL LETTER ETA WITH DASIA " GREEK SMALL LETTER IOTA WITH DASIA " GREEK SMALL LETTER OMICRON WITH DASIA " GREEK SMALL LETTER UPSILON WITH DASIA " GREEK SMALL LETTER OMEGA WITH DASIA " " letters with Psili and Varia: " >`A " GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA >`E " GREEK CAPITAL LETTER EPSILON WITH PSILI AND VARIA >`H " GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA >`I " GREEK CAPITAL LETTER IOTA WITH PSILI AND VARIA >`O " GREEK CAPITAL LETTER OMICRON WITH PSILI AND VARIA >`Y " GREEK CAPITAL LETTER UPSILON WITH PSILI AND VARIA >`V " GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA >`a " GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA >`e " GREEK SMALL LETTER EPSILON WITH PSILI AND VARIA >`h " GREEK SMALL LETTER ETA WITH PSILI AND VARIA >`i " GREEK SMALL LETTER IOTA WITH PSILI AND VARIA >`o " GREEK SMALL LETTER OMICRON WITH PSILI AND VARIA >`y " GREEK SMALL LETTER UPSILON WITH PSILI AND VARIA >`v " GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA " " Letters with Dasia and Varia: " <`A " GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA <`E " GREEK CAPITAL LETTER EPSILON WITH DASIA AND VARIA <`H " GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA <`I " GREEK CAPITAL LETTER IOTA WITH DASIA AND VARIA <`O " GREEK CAPITAL LETTER OMICRON WITH DASIA AND VARIA <`Y " GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA <`V " GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA <`a " GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA <`e " GREEK SMALL LETTER EPSILON WITH DASIA AND VARIA <`h " GREEK SMALL LETTER ETA WITH DASIA AND VARIA <`i " GREEK SMALL LETTER IOTA WITH DASIA AND VARIA <`o " GREEK SMALL LETTER OMICRON WITH DASIA AND VARIA <`y " GREEK SMALL LETTER UPSILON WITH DASIA AND VARIA <`v " GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA " " letters with Psili and Oxia: " >;A " GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA >;E " GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA >;H " GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA >;I " GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA >;O " GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA >;Y " GREEK CAPITAL LETTER UPSILON WITH PSILI AND OXIA >;V " GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA >;a " GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA >;e " GREEK SMALL LETTER EPSILON WITH PSILI AND OXIA >;h " GREEK SMALL LETTER ETA WITH PSILI AND OXIA >;i " GREEK SMALL LETTER IOTA WITH PSILI AND OXIA >;o " GREEK SMALL LETTER OMICRON WITH PSILI AND OXIA >;y " GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA >;v " GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA " " Letters with Dasia and Oxia: " <;A " GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA <;E " GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA <;H " GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA <;I " GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA <;O " GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA <;Y " GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA <;V " GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA <;a " GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA <;e " GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA <;h " GREEK SMALL LETTER ETA WITH DASIA AND OXIA <;i " GREEK SMALL LETTER IOTA WITH DASIA AND OXIA <;o " GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA <;y " GREEK SMALL LETTER UPSILON WITH DASIA AND OXIA <;v " GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA " " letters with Psili and Perispomeni: " >~A " GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI >~E " GREEK CAPITAL LETTER EPSILON WITH PSILI AND PERISPOMENI >~H " GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI >~I " GREEK CAPITAL LETTER IOTA WITH PSILI AND PERISPOMENI >~O " GREEK CAPITAL LETTER OMICRON WITH PSILI AND PERISPOMENI >~Y " GREEK CAPITAL LETTER UPSILON WITH PSILI AND PERISPOMENI >~V " GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI >~a " GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI >~e " GREEK SMALL LETTER EPSILON WITH PSILI AND PERISPOMENI >~h " GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI >~i " GREEK SMALL LETTER IOTA WITH PSILI AND PERISPOMENI >~o " GREEK SMALL LETTER OMICRON WITH PSILI AND PERISPOMENI >~y " GREEK SMALL LETTER UPSILON WITH PSILI AND PERISPOMENI >~v " GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI " " Letters with Dasia and Perispomeni: " <~A " GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI <~E " GREEK CAPITAL LETTER EPSILON WITH DASIA AND PERISPOMENI <~H " GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI <~I " GREEK CAPITAL LETTER IOTA WITH DASIA AND PERISPOMENI <~O " GREEK CAPITAL LETTER OMICRON WITH DASIA AND PERISPOMENI <~Y " GREEK CAPITAL LETTER UPSILON WITH DASIA AND PERISPOMENI <~V " GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI <~a " GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI <~e " GREEK SMALL LETTER EPSILON WITH DASIA AND PERISPOMENI <~h " GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI <~i " GREEK SMALL LETTER IOTA WITH DASIA AND PERISPOMENI <~o " GREEK SMALL LETTER OMICRON WITH DASIA AND PERISPOMENI <~y " GREEK SMALL LETTER UPSILON WITH DASIA AND PERISPOMENI <~v " GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI " " " " letters with Ypogegrammeni/Prosgegrammeni: " A| " GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI H| " GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI V| " GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI a| " GREEK SMALL LETTER ALPHA WITH YPOGEGRAMMENI h| " GREEK SMALL LETTER ETA WITH YPOGEGRAMMENI v| " GREEK SMALL LETTER OMEGA WITH YPOGEGRAMMENI " " " " letters with Psili and Ypogegrammeni/Prosgegrammeni: " >A| " GREEK CAPITAL LETTER ALPHA WITH PSILI AND " PROSGEGRAMMENI >H| " GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI >V| " GREEK CAPITAL LETTER OMEGA WITH PSILI AND " PROSGEGRAMMENI >a| " GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI >h| " GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI >v| " GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI " " " " letters with Dasia and Ypogegrammeni/Prosgegrammeni: " " GREEK CAPITAL LETTER ALPHA WITH DASIA AND " PROSGEGRAMMENI " GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI " GREEK CAPITAL LETTER OMEGA WITH DASIA AND " PROSGEGRAMMENI " GREEK SMALL LETTER ALPHA WITH DASIA AND YPOGEGRAMMENI " GREEK SMALL LETTER ETA WITH DASIA AND YPOGEGRAMMENI " GREEK SMALL LETTER OMEGA WITH DASIA AND YPOGEGRAMMENI " " " " letters with Psili and Varia and Ypogegrammeni/Prosgegrammeni: " >`A| " GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND " PROSGEGRAMMENI >`H| " GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND " PROSGEGRAMMENI >`V| " GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND " PROSGEGRAMMENI >`a| " GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND " YPOGEGRAMMENI >`h| " GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND " YPOGEGRAMMENI >`v| " GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND " YPOGEGRAMMENI " " " " letters with Dasia and Varia and Ypogegrammeni/Prosgegrammeni: " <`A| " GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND " PROSGEGRAMMENI <`H| " GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND " PROSGEGRAMMENI <`V| " GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND " PROSGEGRAMMENI <`a| " GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND " YPOGEGRAMMENI <`h| " GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND " YPOGEGRAMMENI <`v| " GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND " YPOGEGRAMMENI " " letters with Psili and Oxia and Ypogegrammeni/Prosgegrammeni: " " " >;A| " GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND " PROSGEGRAMMENI >;H| " GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND " PROSGEGRAMMENI >;V| " GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND " PROSGEGRAMMENI >;a| " GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND " YPOGEGRAMMENI >;h| " GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND " YPOGEGRAMMENI >;v| " GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND " YPOGEGRAMMENI " " letters with Dasia and Oxia and Ypogegrammeni/Prosgegrammeni: " " " <;A| " GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND " PROSGEGRAMMENI <;H| " GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND " PROSGEGRAMMENI <;V| " GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND " PROSGEGRAMMENI <;a| " GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND " YPOGEGRAMMENI <;h| " GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND " YPOGEGRAMMENI <;v| " GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND " YPOGEGRAMMENI " " letters with Psili and Perispomeni and Ypogegrammeni/Prosgegrammeni: " " " >~A| " GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI " AND PROSGEGRAMMENI >~H| " GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA " PERISPOMENI PROSGEGRAMMENI >~V| " GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI " AND PROSGEGRAMMENI >~a| " GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI " AND YPOGEGRAMMENI >~h| " GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND " YPOGEGRAMMENI >~v| " GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI " AND YPOGEGRAMMENI " " letters with Dasia and Perispomeni and Ypogegrammeni/Prosgegrammeni: " " " <~A| " GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI " AND PROSGEGRAMMENI <~H| " GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI " AND PROSGEGRAMMENI <~V| " GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI " AND PROSGEGRAMMENI <~a| " GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI " AND YPOGEGRAMMENI <~h| " GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND " YPOGEGRAMMENI <~v| " GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI " AND YPOGEGRAMMENI " " letters with Perispomeni: " " " ~a " GREEK SMALL LETTER ALPHA WITH PERISPOMENI ~h " GREEK SMALL LETTER ETA WITH PERISPOMENI ~i " GREEK SMALL LETTER IOTA WITH PERISPOMENI ~y " GREEK SMALL LETTER UPSILON WITH PERISPOMENI ~v " GREEK SMALL LETTER OMEGA WITH PERISPOMENI " " letters with Perispomeni and Ypogegrammeni: " " " ~a| " GREEK SMALL LETTER ALPHA WITH PERISPOMENI AND " YPOGEGRAMMENI ~h| " GREEK SMALL LETTER ETA WITH PERISPOMENI AND " YPOGEGRAMMENI ~v| " GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND " YPOGEGRAMMENI " " " letters with Varia and Ypogegrammeni: " " " `a| " GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI `h| " GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI `v| " GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI " " letters with Oxia and Ypogegrammeni: " " " ;a| " GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI ;h| " GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI ;v| " GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI " " " Combining/Nonspacing comma above (0x0313) instead of Psili: " >, " COMBINING COMMA ABOVE " " Combining/Nonspacing reversed comma above (0x0314) instead of Dasia: " <, " COMBINING REVERSED COMMA ABOVE " " " Greek Quotes if your keyboard supports them " QUOTEDBLLEFT " QUOTEDBLRIGHT " " " " APPENDIX A - Additional characters " " ;# " GREEK NUMERAL SIGN ;## " GREEK LOWER NUMERAL SIGN || " GREEK YPOGEGRAMMENI ;b " GREEK BETA SYMBOL ;u " GREEK THETA SYMBOL " " GREEK UPSILON WITH HOOK SYMBOL " " GREEK UPSILON WITH ACUTE AND HOOK SYMBOL " " GREEK UPSILON WITH DIAERESIS AND HOOK SYMBOL ;f " GREEK PHI SYMBOL ;p " GREEK PI SYMBOL #ST " GREEK LETTER STIGMA #G " GREEK LETTER DIGAMMA #Q " GREEK LETTER KOPPA #SP " GREEK LETTER SAMPI ;k " GREEK KAPPA SYMBOL ;r " GREEK RHO SYMBOL " " GREEK LUNATE SIGMA SYMBOL " " GREEK LETTER YOT :~ "dialytika peripswmevn ~: "dialytika peripswmevn :~i "iota dialytika perispomeni ~:i "iota dialytika perispomeni :~y "upsilon dialytika perispomeni ~:y "upsilon dialytika perispomeni -a "alpha macron -i "iota macron -y "upsilon macron -A "Alpha macron -I "Iota macron -Y "Upsilon macron ^a "alpha braxy ^i "iota braxy ^y "upsilon braxy ^A "alpha braxy ^I "iota braxy ^Y "upsilon braxy >r "rho psili "rho dasia "Rho dasia " More Symbols && "Greek kai D$ "Drachma symbol #Q "Archaic Qoppa #q "Archaic qoppa ;U "Capital Theta symbol "!e "Lunate epsilon "!E "Lunate Epsilon vim-7.4.1689/runtime/keymap/hebrew.vim000066400000000000000000000005021267703067000175340ustar00rootroot00000000000000let encoding = &enc if encoding == 'latin1' if has("unix") let encoding = 'iso-8859-8' else let encoding = 'cp1255' endif endif if encoding == 'utf-8' source :p:h/hebrew_utf-8.vim elseif encoding == 'cp1255' source :p:h/hebrew_cp1255.vim else source :p:h/hebrew_iso-8859-8.vim endif vim-7.4.1689/runtime/keymap/hebrew_cp1255.vim000066400000000000000000000033151267703067000205400ustar00rootroot00000000000000" 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 " ש - shin b " נ - nun c " ב - bet d " ג - gimel e " ק - qof f " כ - kaf g " ע - ayin h " י - yod i " ן - final nun j " ח - het k " ל - lamed l " ך - final kaf m " צ - tsadi n " מ - mem o " ם - final mem p " פ - pe q / " / - slash r " ר - resh s " ד - dalet t " א - alef u " ו - vav v " ה - he w ' " ' - single-quote x " ס - samekh y " ט - tet z " ז - zayin , " ת - tav . " ץ - final tsadi ; " ף - final pe ' , " , - comma / . " . - period ` ; " ; - semicolon " vowels: A: " sheva HE " hataf segol HA " hataf patah HO " hataf qamats I " hiriq AY " tsere E " segol AA " patah AO " qamats O " holam U " qubuts D " dagesh ]T " meteg ]Q " maqaf ]R <ּChar-207> " rafe ]p " paseq SR " shin-dot SL " sin-dot ]P " sof-pasuq VV " double-vav VY " vav-yod YY " yod-yod vim-7.4.1689/runtime/keymap/hebrew_iso-8859-8.vim000066400000000000000000000017561267703067000212020ustar00rootroot00000000000000" Vim Keymap file for hebrew " Maintainer : Ron Aaron " 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 " - shin b " - nun c " - bet d " - gimel e " - qof f " - kaf g " - ayin h " - yod i " - final nun j " - het k " - lamed l " - final kaf m " - tsadi n " - mem o " - final mem p " - pe q / " / - slash r " - resh s " - dalet t " - alef u " - vav v " - he w ' " ' - single-quote x " - samekh y " - tet z " - zayin , " - tav . " - final tsadi ; " - final pe ' , " , - comma / . " . - period ` ; " ; - semicolon vim-7.4.1689/runtime/keymap/hebrew_utf-8.vim000066400000000000000000000073501267703067000205670ustar00rootroot00000000000000" Vim Keymap file for hebrew " Maintainer : Ron Aaron " 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 " ש - shin b " נ - nun c " ב - bet d " ג - gimel e " ק - qof f " כ - kaf g " ע - ayin h " י - yod i " ן - final nun j " ח - het k " ל - lamed l " ך - final kaf m " צ - tsadi n " מ - mem o " ם - final mem p " פ - pe q / " / - slash r " ר - resh s " ד - dalet t " א - alef u " ו - vav v " ה - he w ' " ' - single-quote x " ס - samekh y " ט - tet z " ז - zayin , " ת - tav . " ץ - final tsadi ; " ף - final pe ' , " , - comma / . " . - period ` ; " ; - semicolon A: " sheva HE " hataf segol HA " hataf patah HO " hataf qamats I " hiriq AY " tsere E " segol AA " patah AO " qamats O " holam U " qubuts D " dagesh ]T " meteg ]Q " maqaf ]R " rafe ]p " paseq SR " shin-dot SL " sin-dot ]P " sof-pasuq VV " double-vav VY " vav-yod YY " yod-yod " cantillation: C: " etnahta Cs " segol CS " shalshelet Cz " zaqef qatan CZ " zaqef gadol Ct " tipeha Cr " revia Cq " zarqa Cp " pashta C! " yetiv Cv " tevir Cg " geresh C* " geresh qadim CG " gershayim CP " qarnei-parah Cy " yerach-ben-yomo Co " ole Ci " iluy Cd " dehi Cn " zinor CC " masora circle X` " Alternative `ayin X' " Alternative 'alef X-d " Alternative dalet X-h " Alternative he X-k " Alternative kaf X-l " Alternative lamed X-m " Alternative mem-sofit X-r " Alternative resh X-t " Alternative tav X-+ " Alternative plus XW " shin+shin-dot Xw " shin+sin-dot X..W " shin+shin-dot+dagesh X..w " shin+sin-dot+dagesh XA " alef+patah XO " alef+qamats XI " alef+hiriq (mapiq) X.b " bet+dagesh X.g " gimel+dagesh X.d " dalet+dagesh X.h " he+dagesh Xu " vav+dagesh X.z " zayin+dagesh X.T " tet+dagesh X.y " yud+dagesh X.K " kaf sofit+dagesh X.k " kaf+dagesh X.l " lamed+dagesh X.m " mem+dagesh X.n " nun+dagesh X.s " samech+dagesh X.P " pe sofit+dagesh X.p " pe+dagesh X.x " tsadi+dagesh X.q " qof+dagesh X.r " resh+dagesh X.w " shin+dagesh X.t " tav+dagesh Xo " vav+holam XRb " bet+rafe XRk " kaf+rafe XRp " pe+rafe Xal " alef-lamed vim-7.4.1689/runtime/keymap/hebrewp.vim000066400000000000000000000005051267703067000177170ustar00rootroot00000000000000let encoding = &enc if encoding == 'latin1' if has("unix") let encoding = 'iso-8859-8' else let encoding = 'cp1255' endif endif if encoding == 'utf-8' source :p:h/hebrewp_utf-8.vim elseif encoding == 'cp1255' source :p:h/hebrewp_cp1255.vim else source :p:h/hebrewp_iso-8859-8.vim endif vim-7.4.1689/runtime/keymap/hebrewp_cp1255.vim000066400000000000000000000030431267703067000207160ustar00rootroot00000000000000" 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 " final kaf M " final mem N " final nun P " final pe T " tet X " final tsadi a " alef b " bet d " dalet g " gimel h " he j " het k " kaf l " lamed m " mem n " nun s " samekh p " pe q " qof r " resh t " tav u " ayin v " vav w " shin x " tsadi y " yod z " zayin " vowels: A: " sheva HE " hataf segol HA " hataf patah HO " hataf qamats I " hiriq AY " tsere E " segol AA " patah AO " qamats O " holam U " qubuts D " dagesh ]T " meteg ]Q " maqaf ]R " rafe ]p " paseq SR " shin-dot SL " sin-dot ]P " sof-pasuq VV " double-vav VY " vav-yod YY " yod-yod vim-7.4.1689/runtime/keymap/hebrewp_iso-8859-8.vim000066400000000000000000000014351267703067000213540ustar00rootroot00000000000000" Vim Keymap file for hebrew " Maintainer : Ron Aaron " 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 " final kaf M " final mem N " final nun P " final pe T " tet X " final tsadi a " alef b " bet d " dalet g " gimel h " he j " het k " kaf l " lamed m " mem n " nun s " samekh p " pe q " qof r " resh t " tav u " ayin v " vav w " shin x " tsadi y " yod z " zayin vim-7.4.1689/runtime/keymap/hebrewp_utf-8.vim000066400000000000000000000070631267703067000207500ustar00rootroot00000000000000" Vim Keymap file for hebrew " Maintainer : Ron Aaron " 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 " - shin n " - nun b " - bet g " - gimel q " - qof k " - kaf g " - ayin y " - yod N " - final nun j " - het l " - lamed K " - final kaf x " - tsadi m " - mem M " - final mem p " - pe r " - resh d " - dalet a " - alef v " - vav h " - he s " - samekh T " - tet z " - zayin t " - tav X " - final tsadi P " - final pe A: " sheva HE " hataf segol HA " hataf patah HO " hataf qamats I " hiriq AY " tsere E " segol AA " patah AO " qamats O " holam U " qubuts D " dagesh ]T " meteg ]Q " maqaf ]R " rafe ]p " paseq SR " shin-dot SL " sin-dot ]P " sof-pasuq VV " double-vav VY " vav-yod YY " yod-yod " cantillation: C: " etnahta Cs " segol CS " shalshelet Cz " zaqef qatan CZ " zaqef gadol Ct " tipeha Cr " revia Cq " zarqa Cp " pashta C! " yetiv Cv " tevir Cg " geresh C* " geresh qadim CG " gershayim CP " qarnei-parah Cy " yerach-ben-yomo Co " ole Ci " iluy Cd " dehi Cn " zinor CC " masora circle X` " Alternative `ayin X' " Alternative 'alef X-d " Alternative dalet X-h " Alternative he X-k " Alternative kaf X-l " Alternative lamed X-m " Alternative mem-sofit X-r " Alternative resh X-t " Alternative tav X-+ " Alternative plus XW " shin+shin-dot Xw " shin+sin-dot X..W " shin+shin-dot+dagesh X..w " shin+sin-dot+dagesh XA " alef+patah XO " alef+qamats XI " alef+hiriq (mapiq) X.b " bet+dagesh X.g " gimel+dagesh X.d " dalet+dagesh X.h " he+dagesh Xu " vav+dagesh X.z " zayin+dagesh X.T " tet+dagesh X.y " yud+dagesh X.K " kaf sofit+dagesh X.k " kaf+dagesh X.l " lamed+dagesh X.m " mem+dagesh X.n " nun+dagesh X.s " samech+dagesh X.P " pe sofit+dagesh X.p " pe+dagesh X.x " tsadi+dagesh X.q " qof+dagesh X.r " resh+dagesh X.w " shin+dagesh X.t " tav+dagesh Xo " vav+holam XRb " bet+rafe XRk " kaf+rafe XRp " pe+rafe Xal " alef-lamed vim-7.4.1689/runtime/keymap/kana.vim000066400000000000000000000214671267703067000172070ustar00rootroot00000000000000" This script was originally created by Rory McCann . " Dan Kenigsberg noticed some deficiencies and suggested this one instead. " " Maintainer: Rory McCann " Modified by: Edward L. Fox " Last Change: 2006 Apr 30 " " " " Kana.kmap (Japanese Phonograms) " " Converted from Gaspar Sinai's yudit 2.7.6 " GNU (C) Gaspar Sinai " " WARNING " ------- " This version of Kana.kmap is different from the one that has been used " with yudit-2.7.2 or earlier. The main difference is that this kmap is " arranged in such a way that it complies with an authorized Japanese " transliteration. As a result, backward compatibility is not guaranteed. " " NOTE " ---- " 1. In general, the transliteration is based on Japanese Government's " Cabinet Notification 1 (Dec. 9, 1954). " " Summary: " " (1) To transliterate Japanese language, Table 1 should be used " primarily. " (2) Table 2 may be used only when existing conventions such as " international relationship should be respected. " (3) Other transliteration is acceptable only when neither Table 1 " nor Table 2 gives any specification of the sound in question " " For details, refer to " " http://xembho.tripod.com/siryo/naikaku_kokuzi.html " " 2. The specification instructed by the Cabinet Notification is rather " inadequate even for daily use. At the present time there are thus " many unauthorized but widely accepted conventions used together with " the authorized transliteration. This kmap contains some of them for " user's convenience (cf. Hiragana 3 and Katakana 3). " " 3. For the unicode mapping relevant to this kmap, refer to 3075--30F5 of " " http://www.macchiato.com/unicode/charts.html " " HISTORY " ------- " 2005-01-11 " * Converted to Vim format. " 2003-01-22 " " * Submitted to gsinai@yudit.org " " ============================================================================ scriptencoding utf-8 " ---------------------------------------------------------------------------- " Kigou (Punctuation etc.) " ---------------------------------------------------------------------------- let b:keymap_name = "kana" loadkeymap "0x20 0x3000 , 、 . 。 ,, 〃 xx 〆 @ 〇 < 〈 > 〉 << 《 >> 》 { 「 } 」 {{ 『 }} 』 [.( 【 ).] 】 [ 〔 ] 〕 [( 〖 )] 〗 [[ 〚 ]] 〛 .. ・ - ー " ---------------------------------------------------------------------------- " Hiragana 1 --- Table 1, Cabinet Notification No. 1 (Dec. 9, 1954) " ---------------------------------------------------------------------------- a あ i い u う e え o お ka か ki き ku く ke け ko こ sa さ si し su す se せ so そ ta た ti ち tu つ te て to と na な ni に nu ぬ ne ね no の ha は hi ひ hu ふ he へ ho ほ ma ま mi み mu む me め mo も ya や yu ゆ yo よ ra ら ri り ru る re れ ro ろ wa わ ga が gi ぎ gu ぐ ge げ go ご za ざ zi じ zu ず ze ぜ zo ぞ da だ de で do ど ba ば bi び bu ぶ be べ bo ぼ pa ぱ pi ぴ pu ぷ pe ぺ po ぽ kya きゃ kyu きゅ kyo きょ sya しゃ syu しゅ syo しょ tya ちゃ tyu ちゅ tyo ちょ nya にゃ nyu にゅ nyo にょ hya ひゃ hyu ひゅ hyo ひょ mya みゃ myu みゅ myo みょ rya りゃ ryu りゅ ryo りょ gya ぎゃ gyu ぎゅ gyo ぎょ zya じゃ zyu じゅ zyo じょ bya びゃ byu びゅ byo びょ pya ぴゃ pyu ぴゅ pyo ぴょ n ん n' ん " ---------------------------------------------------------------------------- " Hiragana 2 --- Table 2, Cabinet Notification No. 1 (Dec. 9, 1954) " ---------------------------------------------------------------------------- sha しゃ shi し shu しゅ sho しょ tsu つ cha ちゃ chi ち chu ちゅ cho ちょ fu ふ ja じゃ ji じ ju じゅ jo じょ di ぢ du づ dya ぢゃ dyu ぢゅ dyo ぢょ kwa くゎ gwa ぐゎ wo を " ---------------------------------------------------------------------------- " Hiragana 3 --- Conventional transliterations " ---------------------------------------------------------------------------- " Small Hiragana: The prefix X is never pronounced. It is used as something " like an escape character. xa ぁ xi ぃ xu ぅ xe ぇ xo ぉ xtu っ xya ゃ xyu ゅ xyo ょ xwa ゎ " Historic `wi' and `we' wi ゐ we ゑ " Preceded by a small `tu' kka っか kki っき kku っく kke っけ kko っこ ssa っさ ssi っし ssu っす sse っせ sso っそ tta った tti っち ttu っつ tte って tto っと hha っは hhi っひ hhu っふ hhe っへ hho っほ mma っま mmi っみ mmu っむ mme っめ mmo っも yya っや yyu っゆ yyo っよ rra っら rri っり rru っる rre っれ rro っろ wwa っわ gga っが ggi っぎ ggu っぐ gge っげ ggo っご zza っざ zzi っじ zzu っず zze っぜ zzo っぞ dda っだ ddi っぢ ddu っづ dde っで ddo っど bba っば bbi っび bbu っぶ bbe っべ bbo っぼ ppa っぱ ppi っぴ ppu っぷ ppe っぺ ppo っぽ " Proceded by a small `tu' and followed by a small 'ya', 'yu' or 'yo' kkya っきゃ kkyu っきゅ kkyo っきょ ssya っしゃ ssyu っしゅ ssyo っしょ ttya っちゃ ttyu っちゅ ttyo っちょ hhya っひゃ hhyu っひゅ hhyo っひょ mmya っみゃ mmyu っみゅ mmyo っみょ rrya っりゃ rryu っりゅ rryo っりょ ggya っぎゃ ggyu っぎゅ ggyo っぎょ zzya っじゃ zzyu っじゅ zzyo っじょ bbya っびゃ bbyu っびゅ bbyo っびょ ppya っぴゃ ppyu っぴゅ ppyo っぴょ " ---------------------------------------------------------------------------- " Katakana 1 --- Table 1, Cabinet Notification No. 1 (Dec. 9, 1954) " ---------------------------------------------------------------------------- A ア I イ U ウ E エ O オ KA カ KI キ KU ク KE ケ KO コ SA サ SI シ SU ス SE セ SO ソ TA タ TI チ TU ツ TE テ TO ト NA ナ NI ニ NU ヌ NE ネ NO ノ HA ハ HI ヒ HU フ HE ヘ HO ホ MA マ MI ミ MU ム ME メ MO モ YA ヤ YU ユ YO ヨ RA ラ RI リ RU ル RE レ RO ロ WA ワ GA ガ GI ギ GU グ GE ゲ GO ゴ ZA ザ ZI ジ ZU ズ ZE ゼ ZO ゾ DA ダ DE デ DO ド BA バ BI ビ BU ブ BE ベ BO ボ PA パ PI ピ PU プ PE ペ PO ポ KYA キャ KYU キュ KYO キョ SYA シャ SYU シュ SYO ショ TYA チャ TYU チュ TYO チョ NYA ニャ NYU ニュ NYO ニョ HYA ヒャ HYU ヒュ HYO ヒョ MYA ミャ MYU ミュ MYO ミョ RYA リャ RYU リュ RYO リョ GYA ギャ GYU ギュ GYO ギョ ZYA ジャ ZYU ジュ ZYO ジョ BYA ビャ BYU ビュ BYO ビョ PYA ピャ PYU ピュ PYO ピョ N ン N' ン " ---------------------------------------------------------------------------- " Katakana 2 --- Table 2, Cabinet Notification No. 1 (Dec. 9, 1954) " ---------------------------------------------------------------------------- SHA シャ SHI シ SHU シュ SHO ショ TSU ツ CHA チャ CHI チ CHU チュ CHO チョ FU フ JA ジャ JI ジ JU ジュ JO ジョ DI ヂ DU ヅ DYA ヂャ DYU ヂュ DYO ヂョ KWA クヮ GWA グヮ WO ヲ " ---------------------------------------------------------------------------- " Katakana 3 --- Conventional transliterations " ---------------------------------------------------------------------------- " Small Katakana: The prefix X is never pronounced. It is used as something " like an escape character. XA ァ XI ィ XU ゥ XE ェ XO ォ XTU ッ XYA ャ XYU ュ XYO ョ XWA ヮ " Used only for counting someone or something XKA ヵ XKE ヶ " Historic `wi' and `we' WI ヰ WE ヱ " Used for the sound `v' of European languages VA ヴァ VI ヴィ VU ヴ VE ヴェ VO ヴォ VYU ヴュ " Preceded by a small `tu' KKA ッカ KKI ッキ KKU ック KKE ッケ KKO ッコ SSA ッサ SSI ッシ SSU ッス SSE ッセ SSO ッソ TTA ッタ TTI ッチ TTU ッツ TTE ッテ TTO ット HHA ッハ HHI ッヒ HHU ッフ HHE ッヘ HHO ッホ MMA ッマ MMI ッミ MMU ッム MME ッメ MMO ッモ YYA ッヤ YYU ッユ YYO ッヨ RRA ッラ RRI ッリ RRU ッル RRE ッレ RRO ッロ WWA ッワ GGA ッガ GGI ッギ GGU ッグ GGE ッゲ GGO ッゴ ZZA ッザ ZZI ッジ ZZU ッズ ZZE ッゼ ZZO ッゾ DDA ッダ DDI ッヂ DDU ッヅ DDE ッデ DDO ッド BBA ッバ BBI ッビ BBU ッブ BBE ッベ BBO ッボ PPA ッパ PPI ッピ PPU ップ PPE ッペ PPO ッポ " Proceded by a small `tu' and followed by a small 'ya', 'yu' or 'yo' KKYA ッキャ KKYU ッキュ KKYO ッキョ SSYA ッシャ SSYU ッシュ SSYO ッショ TTYA ッチャ TTYU ッチュ TTYO ッチョ HHYA ッヒャ HHYU ッヒュ HHYO ッヒョ MMYA ッミャ MMYU ッミュ MMYO ッミョ RRYA ッリャ RRYU ッリュ RRYO ッリョ GGYA ッギャ GGYU ッギュ GGYO ッギョ ZZYA ッジャ ZZYU ッジュ ZZYO ッジョ BBYA ッビャ BBYU ッビュ BBYO ッビョ PPYA ッピャ PPYU ッピュ PPYO ッピョ vim-7.4.1689/runtime/keymap/lithuanian-baltic.vim000066400000000000000000000017031267703067000216540ustar00rootroot00000000000000" Vim Keymap file for lithuanian characters, phonetic layout 'Baltic' " Useful mainly with utf-8 but may work with other encodings " Maintainer: Alex Jakushev " 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 vim-7.4.1689/runtime/keymap/magyar_utf-8.vim000066400000000000000000000005061267703067000205670ustar00rootroot00000000000000" Maintainer: Laszlo Zavaleta " Last Changed: 2003 Aug 08 " it has all the accents and a few of the character alterations let b:keymap = "magyar" loadkey ` í ~ Í ! ' @ " # + $ ! ^ / & = * ( ( ) 0 ö ) Ö - ü _ Ü = ó + Ó \\ ű | Ű [ ő { Ő ] ú } Ú ; é : É ' á \" Á / - < ? > : ? _ vim-7.4.1689/runtime/keymap/mongolian_utf-8.vim000066400000000000000000000050021267703067000212660ustar00rootroot00000000000000" Maintainer: Natsagdorj Shagdar " Last Changed: 2007 Jun 26 " All characters are given literally, conversion to another encoding (e.g., " UTF-8) should work. scriptencoding utf-8 let b:keymap_name = "mn" loadkeymap C Ё CYRILLIC CAPITAL LETTER IO c ё CYRILLIC SMALL LETTER IO G А CYRILLIC CAPITAL LETTER A D Б CYRILLIC CAPITAL LETTER BE > В CYRILLIC CAPITAL LETTER VE U Г CYRILLIC CAPITAL LETTER GHE : Д CYRILLIC CAPITAL LETTER DE _ Е CYRILLIC CAPITAL LETTER IE R Ж CYRILLIC CAPITAL LETTER ZHE P З CYRILLIC CAPITAL LETTER ZE N И CYRILLIC CAPITAL LETTER I A Й CYRILLIC CAPITAL LETTER SHORT I { К CYRILLIC CAPITAL LETTER KA L Л CYRILLIC CAPITAL LETTER EL B М CYRILLIC CAPITAL LETTER EM Y Н CYRILLIC CAPITAL LETTER EN K О CYRILLIC CAPITAL LETTER O \" П CYRILLIC CAPITAL LETTER PE J Р CYRILLIC CAPITAL LETTER ER V С CYRILLIC CAPITAL LETTER ES M Т CYRILLIC CAPITAL LETTER TE E У CYRILLIC CAPITAL LETTER U Q Ф CYRILLIC CAPITAL LETTER EF H Х CYRILLIC CAPITAL LETTER HA W Ц CYRILLIC CAPITAL LETTER TSE X Ч CYRILLIC CAPITAL LETTER CHE I Ш CYRILLIC CAPITAL LETTER SHA + Щ CYRILLIC CAPITAL LETTER SHCHA } Ъ CYRILLIC CAPITAL LETTER HARD SIGN S Ы CYRILLIC CAPITAL LETTER YERU < Ь CYRILLIC CAPITAL LETTER SOFT SIGN T Э CYRILLIC CAPITAL LETTER E ? Ю CYRILLIC CAPITAL LETTER YU Z Я CYRILLIC CAPITAL LETTER YA g а CYRILLIC SMALL LETTER A d б CYRILLIC SMALL LETTER BE . в CYRILLIC SMALL LETTER VE u г CYRILLIC SMALL LETTER GHE ; д CYRILLIC SMALL LETTER DE - е CYRILLIC SMALL LETTER IE r ж CYRILLIC SMALL LETTER ZHE p з CYRILLIC SMALL LETTER ZE n и CYRILLIC SMALL LETTER I a й CYRILLIC SMALL LETTER SHORT I [ к CYRILLIC SMALL LETTER KA l л CYRILLIC SMALL LETTER EL b м CYRILLIC SMALL LETTER EM y н CYRILLIC SMALL LETTER EN k о CYRILLIC SMALL LETTER O ' п CYRILLIC SMALL LETTER PE j р CYRILLIC SMALL LETTER ER v с CYRILLIC SMALL LETTER ES m т CYRILLIC SMALL LETTER TE e у CYRILLIC SMALL LETTER U q ф CYRILLIC SMALL LETTER EF h х CYRILLIC SMALL LETTER HA w ц CYRILLIC SMALL LETTER TSE x ч CYRILLIC SMALL LETTER CHE i ш CYRILLIC SMALL LETTER SHA = щ CYRILLIC SMALL LETTER SHCHA ] ъ CYRILLIC SMALL LETTER HARD SIGN s ы CYRILLIC SMALL LETTER YERU , ь CYRILLIC SMALL LETTER SOFT SIGN t э CYRILLIC SMALL LETTER E / ю CYRILLIC SMALL LETTER YU z я CYRILLIC SMALL LETTER YA f ө CYRILLIC SMALL LETTER Oе F Ө CYRILLIC SMALL LETTER Oе o ү CYRILLIC SMALL LETTER Ге O Ү CYRILLIC SMALL LETTER Oе ` = 1 № NUMERO SIGN 2 - 3 " 4 T 5 : 7 ? 6 . 8 , 9 ( 0 ) ! 1 @ 2 # 3 $ 4 % 5 ^ 6 & 7 * 8 ( 9 ) 0 vim-7.4.1689/runtime/keymap/persian-iranian_utf-8.vim000066400000000000000000000013601267703067000223660ustar00rootroot00000000000000" Vim Keymap file for Persian Standard Keyboard Layout " Maintainers: Behnam 'ZWNJ' Esfahbod , " Amir Hedayaty " Last Change: 2006 Apr 21 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 ء < > > < ? ؟ | | vim-7.4.1689/runtime/keymap/persian.vim000066400000000000000000000002201267703067000177160ustar00rootroot00000000000000let encoding = &enc if encoding == '' let encoding = 'utf-8' endif if encoding == 'utf-8' source :p:h/persian-iranian_utf-8.vim endif vim-7.4.1689/runtime/keymap/pinyin.vim000066400000000000000000000010301267703067000175630ustar00rootroot00000000000000" Vim Keymap file for Hanyu Pinyin tone marks through numbers. " Maintainer: Fredrik Roubert " 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 ü vim-7.4.1689/runtime/keymap/polish-slash.vim000066400000000000000000000013051267703067000206700ustar00rootroot00000000000000" Polish letters under VIM >= 6 " Maintainer: HS6_06 " Last changed: 2005 Jan 12 " Current version: 1.0.2 " History: " 2005.01.12 1.0.2 keymap_name shortened, added Current version, History " 2005.01.10 1.0.1 un*x line ends for all files " 2005.01.09 1.0.0 Initial release 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 :p:h/polish-slash_utf-8.vim elseif encoding == 'cp1250' source :p:h/polish-slash_cp1250.vim elseif encoding == 'iso-8859-2' source :p:h/polish-slash_iso-8859-2.vim else source :p:h/polish-slash_cp852.vim endif vim-7.4.1689/runtime/keymap/polish-slash_cp1250.vim000066400000000000000000000025341267703067000216670ustar00rootroot00000000000000" Polish letters keymap for cp1250 " Maintainer: HS6_06 " Last Changed: 2005 Jan 12 " Current version: 1.0.2 " History: see polish-slash.vim " This keymap adds the special Polish letters " to an existing Latin keyboard. " All chars as usual except: " Polish: " instead of AltGr+{acelnosxz} you ve to use "/" followed by {acelnosxz} " short keymap name for statusline let b:keymap_name = "PL-slash-WIN" scriptencoding latin1 loadkeymap " Polish letters /a " LATIN SMALL LETTER A WITH OGONEK /c " LATIN SMALL LETTER C WITH ACUTE /e " LATIN SMALL LETTER E WITH OGONEK /l " LATIN SMALL LETTER L WITH STROKE /n " LATIN SMALL LETTER N WITH ACUTE /o " LATIN SMALL LETTER O WITH ACUTE /s " LATIN SMALL LETTER S WITH ACUTE /x " LATIN SMALL LETTER Z WITH ACUTE /z " LATIN SMALL LETTER Z WITH DOT ABOVE /A " LATIN CAPITAL LETTER A WITH OGONEK /C " LATIN CAPITAL LETTER C WITH ACUTE /E " LATIN CAPITAL LETTER E WITH OGONEK /L " LATIN CAPITAL LETTER L WITH STROKE /N " LATIN CAPITAL LETTER N WITH ACUTE /O " LATIN CAPITAL LETTER O WITH ACUTE /S " LATIN CAPITAL LETTER S WITH ACUTE /X " LATIN CAPITAL LETTER Z WITH ACUTE /Z " LATIN CAPITAL LETTER Z WITH DOT ABOVE vim-7.4.1689/runtime/keymap/polish-slash_cp852.vim000066400000000000000000000025331267703067000216150ustar00rootroot00000000000000" Polish letters keymap for cp852 " Maintainer: HS6_06 " Last Changed: 2005 Jan 12 " Current version: 1.0.2 " History: see polish-slash.vim " This keymap adds the special Polish letters " to an existing Latin keyboard. " All chars as usual except: " Polish: " instead of AltGr+{acelnosxz} you ve to use "/" followed by {acelnosxz} " short keymap name for statusline let b:keymap_name = "PL-slash-DOS" scriptencoding latin1 loadkeymap " Polish letters /a " LATIN SMALL LETTER A WITH OGONEK /c " LATIN SMALL LETTER C WITH ACUTE /e " LATIN SMALL LETTER E WITH OGONEK /l " LATIN SMALL LETTER L WITH STROKE /n " LATIN SMALL LETTER N WITH ACUTE /o " LATIN SMALL LETTER O WITH ACUTE /s " LATIN SMALL LETTER S WITH ACUTE /x " LATIN SMALL LETTER Z WITH ACUTE /z " LATIN SMALL LETTER Z WITH DOT ABOVE /A " LATIN CAPITAL LETTER A WITH OGONEK /C " LATIN CAPITAL LETTER C WITH ACUTE /E " LATIN CAPITAL LETTER E WITH OGONEK /L " LATIN CAPITAL LETTER L WITH STROKE /N " LATIN CAPITAL LETTER N WITH ACUTE /O " LATIN CAPITAL LETTER O WITH ACUTE /S " LATIN CAPITAL LETTER S WITH ACUTE /X " LATIN CAPITAL LETTER Z WITH ACUTE /Z " LATIN CAPITAL LETTER Z WITH DOT ABOVE vim-7.4.1689/runtime/keymap/polish-slash_iso-8859-2.vim000066400000000000000000000025341267703067000223210ustar00rootroot00000000000000" Polish letters keymap for iso-8859-2 " Maintainer: HS6_06 " Last Changed: 2005 Jan 12 " Current version: 1.0.2 " History: polish-slash.vim " This keymap adds the special Polish letters " to an existing Latin keyboard. " All chars as usual except: " Polish: " instead of AltGr+{acelnosxz} you ve to use "/" followed by {acelnosxz} " short keymap name for statusline let b:keymap_name = "PL-slash-ISO" scriptencoding latin1 loadkeymap " Polish letters /a " LATIN SMALL LETTER A WITH OGONEK /c " LATIN SMALL LETTER C WITH ACUTE /e " LATIN SMALL LETTER E WITH OGONEK /l " LATIN SMALL LETTER L WITH STROKE /n " LATIN SMALL LETTER N WITH ACUTE /o " LATIN SMALL LETTER O WITH ACUTE /s " LATIN SMALL LETTER S WITH ACUTE /x " LATIN SMALL LETTER Z WITH ACUTE /z " LATIN SMALL LETTER Z WITH DOT ABOVE /A " LATIN CAPITAL LETTER A WITH OGONEK /C " LATIN CAPITAL LETTER C WITH ACUTE /E " LATIN CAPITAL LETTER E WITH OGONEK /L " LATIN CAPITAL LETTER L WITH STROKE /N " LATIN CAPITAL LETTER N WITH ACUTE /O " LATIN CAPITAL LETTER O WITH ACUTE /S " LATIN CAPITAL LETTER S WITH ACUTE /X " LATIN CAPITAL LETTER Z WITH ACUTE /Z " LATIN CAPITAL LETTER Z WITH DOT ABOVE vim-7.4.1689/runtime/keymap/polish-slash_utf-8.vim000066400000000000000000000026211267703067000217150ustar00rootroot00000000000000" Polish letters keymap for utf-8 " Maintainer: HS6_06 " Last Changed: 2005 Jan 12 " Current version: 1.0.2 " History: see polish-slash.vim " This keymap adds the special Polish letters " to an existing Latin keyboard. " All chars as usual except: " Polish: " instead of AltGr+{acelnosxz} you ve to use "/" followed by {acelnosxz} " short keymap name for statusline let b:keymap_name = "PL-slash-UTF" scriptencoding latin1 loadkeymap " Polish letters /a " LATIN SMALL LETTER A WITH OGONEK /c " LATIN SMALL LETTER C WITH ACUTE /e " LATIN SMALL LETTER E WITH OGONEK /l " LATIN SMALL LETTER L WITH STROKE /n " LATIN SMALL LETTER N WITH ACUTE /o " LATIN SMALL LETTER O WITH ACUTE /s " LATIN SMALL LETTER S WITH ACUTE /x " LATIN SMALL LETTER Z WITH ACUTE /z " LATIN SMALL LETTER Z WITH DOT ABOVE /A " LATIN CAPITAL LETTER A WITH OGONEK /C " LATIN CAPITAL LETTER C WITH ACUTE /E " LATIN CAPITAL LETTER E WITH OGONEK /L " LATIN CAPITAL LETTER L WITH STROKE /N " LATIN CAPITAL LETTER N WITH ACUTE /O " LATIN CAPITAL LETTER O WITH ACUTE /S " LATIN CAPITAL LETTER S WITH ACUTE /X " LATIN CAPITAL LETTER Z WITH ACUTE /Z " LATIN CAPITAL LETTER Z WITH DOT ABOVE vim-7.4.1689/runtime/keymap/russian-dvorak.vim000066400000000000000000000050421267703067000212340ustar00rootroot00000000000000" Vim Keymap file for russian characters, layout 'dvorak', MS Windows variant " Derived from russian-jcuken.vim by Artem Chuprina " Useful mainly with utf-8 but may work with other encodings " Maintainer: Serhiy Boiko " Last Changed: 2007 Jun 29 " 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 U А CYRILLIC CAPITAL LETTER A W Б CYRILLIC CAPITAL LETTER BE E В CYRILLIC CAPITAL LETTER VE G Г CYRILLIC CAPITAL LETTER GHE N Д CYRILLIC CAPITAL LETTER DE Y Е CYRILLIC CAPITAL LETTER IE S Ж CYRILLIC CAPITAL LETTER ZHE L З CYRILLIC CAPITAL LETTER ZE X И CYRILLIC CAPITAL LETTER I \" Й CYRILLIC CAPITAL LETTER SHORT I P К CYRILLIC CAPITAL LETTER KA T Л CYRILLIC CAPITAL LETTER EL K М CYRILLIC CAPITAL LETTER EM F Н CYRILLIC CAPITAL LETTER EN H О CYRILLIC CAPITAL LETTER O I П CYRILLIC CAPITAL LETTER PE D Р CYRILLIC CAPITAL LETTER ER J С CYRILLIC CAPITAL LETTER ES B Т CYRILLIC CAPITAL LETTER TE > У CYRILLIC CAPITAL LETTER U A Ф CYRILLIC CAPITAL LETTER EF ? Х CYRILLIC CAPITAL LETTER HA < Ц CYRILLIC CAPITAL LETTER TSE Q Ч CYRILLIC CAPITAL LETTER CHE C Ш CYRILLIC CAPITAL LETTER SHA R Щ CYRILLIC CAPITAL LETTER SHCHA + Ъ CYRILLIC CAPITAL LETTER HARD SIGN O Ы CYRILLIC CAPITAL LETTER YERU M Ь CYRILLIC CAPITAL LETTER SOFT SIGN _ Э CYRILLIC CAPITAL LETTER E V Ю CYRILLIC CAPITAL LETTER YU : Я CYRILLIC CAPITAL LETTER YA u а CYRILLIC SMALL LETTER A w б CYRILLIC SMALL LETTER BE e в CYRILLIC SMALL LETTER VE g г CYRILLIC SMALL LETTER GHE n д CYRILLIC SMALL LETTER DE y е CYRILLIC SMALL LETTER IE s ж CYRILLIC SMALL LETTER ZHE l з CYRILLIC SMALL LETTER ZE x и CYRILLIC SMALL LETTER I ' й CYRILLIC SMALL LETTER SHORT I p к CYRILLIC SMALL LETTER KA t л CYRILLIC SMALL LETTER EL k м CYRILLIC SMALL LETTER EM f н CYRILLIC SMALL LETTER EN h о CYRILLIC SMALL LETTER O i п CYRILLIC SMALL LETTER PE d р CYRILLIC SMALL LETTER ER j с CYRILLIC SMALL LETTER ES b т CYRILLIC SMALL LETTER TE . у CYRILLIC SMALL LETTER U a ф CYRILLIC SMALL LETTER EF / х CYRILLIC SMALL LETTER HA , ц CYRILLIC SMALL LETTER TSE q ч CYRILLIC SMALL LETTER CHE c ш CYRILLIC SMALL LETTER SHA r щ CYRILLIC SMALL LETTER SHCHA = ъ CYRILLIC SMALL LETTER HARD SIGN o ы CYRILLIC SMALL LETTER YERU m ь CYRILLIC SMALL LETTER SOFT SIGN - э CYRILLIC SMALL LETTER E v ю CYRILLIC SMALL LETTER YU ; я CYRILLIC SMALL LETTER YA @ " # № NUMERO SIGN $ ; ^ : & ? z . Z , [ - ] = vim-7.4.1689/runtime/keymap/russian-jcuken.vim000066400000000000000000000047471267703067000212400ustar00rootroot00000000000000" 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 " 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 @ " # ' $ * % : ^ , & . * ; vim-7.4.1689/runtime/keymap/russian-jcukenwin.vim000066400000000000000000000050341267703067000217440ustar00rootroot00000000000000" 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 " 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 $ ; ^ : & ? / . ? , vim-7.4.1689/runtime/keymap/russian-jcukenwintype.vim000066400000000000000000000053251267703067000226510ustar00rootroot00000000000000" 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 " Derived from russian-jcuken.vim by Artem Chuprina " Typewriter variant of standart russian layout " Maintainer: Denis Proskurin " Last Changed: 2015 May 15 " 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 $ ; ^ : & ? / ё ? Ё 1 № 2 - 3 / 4 " 5 : 6 , 7 . 8 _ 9 ? 0 % - ! = ; \\ ) \| ( vim-7.4.1689/runtime/keymap/russian-yawerty.vim000066400000000000000000000046371267703067000214630ustar00rootroot00000000000000" Vim Keymap file for russian characters, phonetic layout 'yawerty' " Useful mainly with utf-8 but may work with other encodings " Maintainer: Igor Goldenberg " Last Changed: 2007 Aug 15 " 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 vim-7.4.1689/runtime/keymap/serbian-latin.vim000066400000000000000000000000531267703067000210110ustar00rootroot00000000000000source :p:h/serbian-latin_utf-8.vim vim-7.4.1689/runtime/keymap/serbian-latin_utf-8.vim000066400000000000000000000010541267703067000220360ustar00rootroot00000000000000" Vim Keymap file for Serbian characters, classical variant, UTF-8 encoding " " Maintainer: Aleksandar Veselinovic " 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$ " EURO SIGN -- " endash --- " emdash " @ " " # ' " $ * " % : " ^ , " & . " * ; vim-7.4.1689/runtime/keymap/serbian.vim000066400000000000000000000007231267703067000177100ustar00rootroot00000000000000let encoding = &enc if encoding == 'latin1' if has("unix") let encoding = 'iso-8859-2' else let encoding = 'cp1250' endif endif if encoding == 'utf-8' source :p:h/serbian_utf-8.vim elseif encoding == 'cp1250' source :p:h/serbian_cp1250.vim elseif encoding == 'cp1251' source :p:h/serbian_cp1251.vim elseif encoding == 'iso-8859-2' source :p:h/serbian_iso-8859-2.vim else source :p:h/serbian_iso-8859-5.vim endif vim-7.4.1689/runtime/keymap/serbian_cp1250.vim000066400000000000000000000007031267703067000207000ustar00rootroot00000000000000" Vim Keymap file for Serbian characters, classical variant, cp1250 encoding " " Maintainer: Aleksandar Veselinovic " 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 < ; > : / - _ ? ,, '' " @ " " # ' " $ * " % : " ^ , " & . " * ; vim-7.4.1689/runtime/keymap/serbian_cp1251.vim000066400000000000000000000012161267703067000207010ustar00rootroot00000000000000" Vim Keymap file for Serbian characters, classical variant, win cp1251 " encoding " " Maintainer: Aleksandar Veselinovic " 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 < ; > : / - _ ? ,, '' " @ " " # ' " $ * " % : " ^ , " & . " * ; vim-7.4.1689/runtime/keymap/serbian_iso-8859-2.vim000066400000000000000000000007311267703067000213330ustar00rootroot00000000000000" Vim Keymap file for Serbian characters, classical variant, iso-8859-2 encoding " " Maintainer: Aleksandar Veselinovic " 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 < ; > : / - _ ? ,, ? '' ? " @ " " # ' " $ * " % : " ^ , " & . " * ; vim-7.4.1689/runtime/keymap/serbian_iso-8859-5.vim000066400000000000000000000012241267703067000213340ustar00rootroot00000000000000" Vim Keymap file for Serbian characters, classical variant, iso-8859-5 encoding " " Maintainer: Aleksandar Veselinovic " 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 < ; > : / - _ ? ,, ? '' ? " @ " " # ' " $ * " % : " ^ , " & . " * ; vim-7.4.1689/runtime/keymap/serbian_utf-8.vim000066400000000000000000000014311267703067000207300ustar00rootroot00000000000000" Vim Keymap file for Serbian characters, classical variant, UTF-8 encoding " " Maintainer: Aleksandar Veselinovic " 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$ " EURO SIGN -- " endash --- " emdash " @ " " # ' " $ * " % : " ^ , " & . " * ; vim-7.4.1689/runtime/keymap/sinhala-phonetic_utf-8.vim000066400000000000000000000111011267703067000225260ustar00rootroot00000000000000" Vim Keymap file for Sinhala (Sri Lanka) (2003-11-02) " Maintainer : Harshula Jayasuriya " Last Updated: 2007-06-30 " This is a phonetic static mapping for a standard US-English keyboard " (qwerty) " http://www.nongnu.org/sinhala/doc/keymaps/sinhala-keyboard_3.html " Copy the keymap to ~/.vim/keymap/ " Start gvim " Need to disable the menu so that you can use the 'alt' key. " set guioptions-=m " Select the new keymap " set keymap=sinhala-phonetic_utf-8 let b:keymap_name = "sinhala" loadkeymap " ං - anusvaraya (anusvara) H " ඃ - visargaya (visarga) a " අ - ayanna (a) A " ආ - aayanna (aa) w " ඇ - aeyanna (ae) W " ඈ - aeeyanna (aee) i " ඉ - iyanna (i) I " ඊ - iiyanna (ii) u " උ - uyanna (u) U " ඌ - uuyanna (uu) q " ඍ - iruyanna (iru) Q " ඎ - iruuyanna (iruu) " ඏ - iluyanna (ilu) " ඐ - iluuyanna (iluu) e " එ - eyanna (e) E " ඒ - eeyanna (ee) " ඓ - aiyanna (ai) o " ඔ - oyanna (o) O " ඕ - ooyanna (oo) " ඖ - auyanna (au) k " ක - alpapraana kayanna (ka) K " ඛ - mahaapraana kayanna (kha) g " ග - alpapraana gayanna (ga) G " ඝ - mahaapraana gayanna (gha) " ඞ - kantaja naasikyaya (nga) " ඟ - sanyaka gayanna (nnga) c " ච - alpapraana cayanna (ca) C " ඡ - mahaapraana cayanna (cha) j " ජ - alpapraana jayanna (ja) J " ඣ - mahaapraana jayanna (jha) z " ඤ - taaluja naasikyaya (nya) Z " ඥ - taaluja sanyooga naasikyaya (jnya) " ඦ - sanyaka jayanna (nyja) " ට - alpapraana ttayanna (tta) " ඨ - mahaapraana ttayanna (ttha) " ඩ - alpapraana ddayanna (dda) " ඪ - mahaapraana ddayanna (ddha) N " ණ - muurdhaja nayanna (nna) X " ඬ - sanyaka ddayanna (nndda) t " ත - alpapraana tayanna (ta) T " ථ - mahaapraana tayanna (tha) d " ද - alpapraana dayanna (da) D " ධ - mahaapraana dayanna (dha) n " න - dantaja nayanna (na) x " ඳ - sanyaka dayanna (nda) p " ප - alpapraana payanna (pa) P " ඵ - mahaapraana payanna (pha) b " බ - alpapraana bayanna (ba) B " භ - mahaapraana bayanna (bha) m " ම - mayanna (ma) M " ඹ - amba bayanna (mba) y " ය - yayanna (ya) r " ර - rayanna (ra) l " ල - dantaja layanna (la) v " ව - vayanna (va) S " ශ - taaluja sayanna (sha) " ෂ - muurdhaja sayanna (ssa) s " ස - dantaja sayanna (sa) h " හ - hayanna (ha) L " ළ - muurdhaja layanna (lla) f " ෆ - fayanna (fa) " ් - al-lakuna " ා - aela-pilla (aa) " ැ - ketti aeda-pilla (ae) " ෑ - diga aeda-pilla (aae) " ි - ketti is-pilla (i) " ී - diga is-pilla (ii) " ු - ketti paa-pilla (u) " ූ - diga paa-pilla (uu) " ෘ - gaetta-pilla (r) " ෙ - kombuva (e) " ේ - diga kombuva (ee) " ෛ - kombu deka (ai) " ො - kombuva haa aela-pilla (o) " ෝ - kombuva haa diga aela-pilla (oo) " ෞ - kombuva haa gayanukitta (au) " ෟ - gayanukitta (l) " ෲ - diga gaetta-pilla (rr) " ෳ - diga gayanukitta (ll) " ෴ - kunddaliya (punctuation) R " ්‍ර - rakaaranshaya Y " ්‍ය - yansaya " ර්‍ - repaya " join - conjunct letters cons 0DCA ZWJ cons " touch - cons ZWJ 0DCA cons " - no-break space. didn't work. " - ZWNJ. doesn't work! vim-7.4.1689/runtime/keymap/sinhala.vim000066400000000000000000000001321267703067000176760ustar00rootroot00000000000000" Vim Keymap file for Sinhala (Sri Lanka) " source :p:h/sinhala-phonetic_utf-8.vim vim-7.4.1689/runtime/keymap/slovak.vim000066400000000000000000000005021267703067000175570ustar00rootroot00000000000000let encoding = &enc if encoding == 'latin1' if has("unix") let encoding = 'iso-8859-2' else let encoding = 'cp1250' endif endif if encoding == 'utf-8' source :p:h/slovak_utf-8.vim elseif encoding == 'cp1250' source :p:h/slovak_cp1250.vim else source :p:h/slovak_iso-8859-2.vim endif vim-7.4.1689/runtime/keymap/slovak_cp1250.vim000066400000000000000000000013701267703067000205550ustar00rootroot00000000000000" Maintainer: Peter Valach " 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 :) [ { / ] } ( \\ ) ; : " ' \" ! ", , ;-) < ? ". . ;-) > : / - ? _ " 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 vim-7.4.1689/runtime/keymap/slovak_iso-8859-2.vim000066400000000000000000000013701267703067000212070ustar00rootroot00000000000000" Maintainer: Peter Valach " 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 :) [ { / ] } ( \\ ) ; : " ' \" ! ", , ;-) < ? ". . ;-) > : / - ? _ " 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 vim-7.4.1689/runtime/keymap/slovak_utf-8.vim000066400000000000000000000014541267703067000206110ustar00rootroot00000000000000" Maintainer: Peter Valach " 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 :) [ ú { / ] ä } ( \\ ň ) ; ô : " ' § \" ! ", , ;-) < ? ". . ;-) > : / - ? _ " 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 Ž vim-7.4.1689/runtime/keymap/tamil_tscii.vim000066400000000000000000000347331267703067000205760ustar00rootroot00000000000000" Keymap file for the editing Tamil language files in TSCII encoding. " " Maintainer: Yegappan Lakshmanan (yegappan AT yahoo DOT com) " Last updated: 2006 June 17 " " You will need a fixed width TSCII font to use this encoding. The " Avarangal TSCII fixed width font (TSC_AvarangalFxd) is used to test " this keymap. " " Visit http://www.tscii.org for more information about the TSCII " encoding. " let b:keymap_name = "tamil_tscii" loadkeymap " Uyir (Vowels) letters a aa A i ii I u uu U e ee E ai o oo O au q " mey (Consonants) letters k ka kaa kA ki kii kI ku kuu kU ke kee kE kai ko koo kO kau g ga gaa gA gi gii gI gu guu gU ge gee gE gai go goo gO gau ng nga ngaa ngA ngi ngii ngI ngu nguu ngU nge ngee ngE ngai ngo ngoo ngO ngau ch cha chaa chA chi chii chI chu chuu chU che chee chE chai cho choo chO chau s sa saa sA si sii sI su suu sU se see sE sai so soo sO sau nj nja njaa njA nji njii njI nju njuu njU nje njee njE njai njo njoo njO njau t ta taa tA ti tii tI tu tuu tU te tee tE tai to too tO tau d da daa dA di dii dI du duu dU de dee dE dai do doo dO dau N Na Naa NA Ni Nii NI Nu Nuu NU Ne Nee NE Nai No Noo NO Nau th tha thaa thA thi thii thI thu thuu thU the thee thE thai tho thoo thO thau w wa waa wA wi wii wI wu wuu wU we wee wE wai wo woo wO wau n- n-a n-aa n-A n-i n-ii n-I n-u n-uu n-U n-e n-ee n-E n-ai n-o n-oo n-O n-au p pa paa pA pi pii pI pu puu pU pe pee pE pai po poo pO pau b ba baa bA bi bii bI bu buu bU be bee bE bai bo boo bO bau m ma maa mA mi mii mI mu muu mU me mee mE mai mo moo mO mau y ya yaa yA yi yii yI yu yuu yU ye yee yE yai yo yoo yO yau r ra raa rA ri rii rI ru ruu rU re ree rE rai ro roo rO rau l la laa lA li lii lI lu luu lU le lee lE lai lo loo lO lau v va vaa vA vi vii vI vu vuu vU ve vee vE vai vo voo vO vau z za zaa zA zi zii zI zu zuu zU ze zee zE zai zo zoo zO zau L La Laa LA Li Lii LI Lu Luu LU Le Lee LE Lai Lo Loo LO Lau R Ra Raa RA Ri Rii RI Ru Ruu RU Re Ree RE Rai Ro Roo RO Rau n na naa nA ni nii nI nu nuu nU ne nee nE nai no noo nO nau " Grantha letters j ja jaa jA ji jii jI ju juu jU je jee jE jai jo joo jO jau sh sha shaa shA shi shii shI shu shuu shU she shee shE shai sho shoo shO shau S Sa Saa SA Si Sii SI Su Suu SU Se See SE Sai So Soo SO Sau h ha haa hA hi hii hI hu huu hU he hee hE hai ho hoo hO hau x xa xaa xA xi xii xI xu xuu xU xe xee xE xai xo xoo xO xau sri vim-7.4.1689/runtime/keymap/thaana-phonetic_utf-8.vim000066400000000000000000000054061267703067000223560ustar00rootroot00000000000000" thaana keymap " Maintainer: Ibrahim fayaz

" please set enc to utf-8 " thaana phonetic keyboard is used as a reference " http://www.mcst.gov.mv/News_and_Events/xpfonts.htm " changelog: 18th Feb 2006 - came up the initial idea of writing the keymap.. " 13th May 2006 - made some few corrections regarding < and >.. let b:keymap_name= "thaana" " THAANA NORMAL LETTERS loadkeymap h "letter haa S "shaviani n "noonu r "raa b "baa L "lhaviani k "kaafu w "alifu v "vaavu m "meemu f "faafu d "dhaalu t "thaa l "laamu g "gaafu N "gnaviani s "seenu D "daviani z "zaviani T "taviani y "yaa p "paviani j "javiani c "chaviani "THAANA DOTTED LETTERS X "TTAA (thaa mathee thin thiki) H "HHAA (haa thiree ehthiki) K "KHAA (haa mathee ehthiki) J "THAALU (dhaa mathee ehthiki) R "ZAA (raa mathee ehthiki) C "SHEENU (seenu mathee thinthiki) M "SAADHU (seenu thiree ehthiki) B "DHAADHU(seenu mathee ehthiki) Y "TO (thaa thiree ehthiki) Z "ZO (thaa mathee ehthiki) W "AINU (alifu thiree ehthiki) G "GHAINU (alifu mathee ehthiki) Q "QAAFU (gaafu mathee dhethkiki) V "VAAVU (vaavu mathee ehthiki) "THAANA FILI (combining characters) a "abafili A "aabaafili i "ibifili I "eebeefili u "ubufili U "ooboofili e "ebefili E "ebeyfili o "obofili O "oaboafili q "sukun "OTHER THAANA RELATED F "arabic ligature allah isolated form ? "arabic question mark "~ "arabic -bismillah ahrahman araheem- not in phonetic keyboard, thats why commented [ "english open bracket is thaana closing bracket ] "english close bracket = thaana open bracket { "braces reversed } x " x for multiplication sign.. P " division symbol mapped to 'p' > < "zwj - ZERO WIDTH JOINER i dont know how to use these yet.. "zwnj - ZERO WIDTH NON JOINER "lrm - LEFT TO RIGHT MARK "rlm - RIGHT TO LEFT MARK ; "arabic semicolon , "arabic coma ; , vim-7.4.1689/runtime/keymap/thaana.vim000066400000000000000000000001071267703067000175150ustar00rootroot00000000000000if &enc == 'utf-8' source :p:h/thaana-phonetic_utf-8.vim endif vim-7.4.1689/runtime/keymap/ukrainian-dvorak.vim000066400000000000000000000052641267703067000215370ustar00rootroot00000000000000" Vim Keymap file for ukrainian characters, layout 'dvorak', " MS Windows variant " Derived from ukrainian-jcuken.vim by Anatoli Sakhnik " Useful mainly with utf-8 but may work with other encodings " Maintainer: Serhiy Boiko " Last Changed: 2007 Jun 29 " All characters are given literally, conversion to another encoding (e.g., " UTF-8) should work. scriptencoding utf-8 let b:keymap_name = "uk" loadkeymap ~ ~ CYRILLIC CAPITAL LETTER IO ` ' CYRILLIC SMALL LETTER IO U А CYRILLIC CAPITAL LETTER A W Б CYRILLIC CAPITAL LETTER BE E В CYRILLIC CAPITAL LETTER VE G Г CYRILLIC CAPITAL LETTER GHE N Д CYRILLIC CAPITAL LETTER DE Y Е CYRILLIC CAPITAL LETTER IE S Ж CYRILLIC CAPITAL LETTER ZHE L З CYRILLIC CAPITAL LETTER ZE X И CYRILLIC CAPITAL LETTER I \" Й CYRILLIC CAPITAL LETTER SHORT I P К CYRILLIC CAPITAL LETTER KA T Л CYRILLIC CAPITAL LETTER EL K М CYRILLIC CAPITAL LETTER EM F Н CYRILLIC CAPITAL LETTER EN H О CYRILLIC CAPITAL LETTER O I П CYRILLIC CAPITAL LETTER PE D Р CYRILLIC CAPITAL LETTER ER J С CYRILLIC CAPITAL LETTER ES B Т CYRILLIC CAPITAL LETTER TE > У CYRILLIC CAPITAL LETTER U A Ф CYRILLIC CAPITAL LETTER EF ? Х CYRILLIC CAPITAL LETTER HA < Ц CYRILLIC CAPITAL LETTER TSE Q Ч CYRILLIC CAPITAL LETTER CHE C Ш CYRILLIC CAPITAL LETTER SHA R Щ CYRILLIC CAPITAL LETTER SHCHA + Ї CYRILLIC CAPITAL LETTER YI O І CYRILLIC CAPITAL LETTER BYELORUSSION-UKRAINIAN I M Ь CYRILLIC CAPITAL LETTER SOFT SIGN _ Є CYRILLIC CAPITAL LETTER UKRAINIAN IE V Ю CYRILLIC CAPITAL LETTER YU : Я CYRILLIC CAPITAL LETTER YA | Ґ CYRILLIC CAPITAL LETTER GHE WITH UPTURN u а CYRILLIC SMALL LETTER A w б CYRILLIC SMALL LETTER BE e в CYRILLIC SMALL LETTER VE g г CYRILLIC SMALL LETTER GHE n д CYRILLIC SMALL LETTER DE y е CYRILLIC SMALL LETTER IE s ж CYRILLIC SMALL LETTER ZHE l з CYRILLIC SMALL LETTER ZE x и CYRILLIC SMALL LETTER I ' й CYRILLIC SMALL LETTER SHORT I p к CYRILLIC SMALL LETTER KA t л CYRILLIC SMALL LETTER EL k м CYRILLIC SMALL LETTER EM f н CYRILLIC SMALL LETTER EN h о CYRILLIC SMALL LETTER O i п CYRILLIC SMALL LETTER PE d р CYRILLIC SMALL LETTER ER j с CYRILLIC SMALL LETTER ES b т CYRILLIC SMALL LETTER TE . у CYRILLIC SMALL LETTER U a ф CYRILLIC SMALL LETTER EF / х CYRILLIC SMALL LETTER HA , ц CYRILLIC SMALL LETTER TSE q ч CYRILLIC SMALL LETTER CHE c ш CYRILLIC SMALL LETTER SHA r щ CYRILLIC SMALL LETTER SHCHA = ї CYRILLIC SMALL LETTER YI o і CYRILLIC SMALL LETTER BYELORUSSION-UKRAINIAN I m ь CYRILLIC SMALL LETTER SOFT SIGN - є CYRILLIC SMALL LETTER UKRAINIAN IE v ю CYRILLIC SMALL LETTER YU ; я CYRILLIC SMALL LETTER YA \\ ґ CYRILLIC SMALL LETTER GHE WITH UPTURN @ " # № NUMERO SIGN $ ; ^ : & ? z . Z , [ - ] = vim-7.4.1689/runtime/keymap/ukrainian-jcuken.vim000066400000000000000000000052621267703067000215260ustar00rootroot00000000000000" Vim Keymap file for ukrainian characters, layout 'jcuken', classical variant " (compatible with XFree86 'uk' keymap) " Derived from russian-jcuken.vim by Artem Chuprina " Useful mainly with utf-8 but may work with other encodings " Maintainer: Anatoli Sakhnik " Last Changed: 2007 Nov 11 " All characters are given literally, conversion to another encoding (e.g., " UTF-8) should work. scriptencoding utf-8 let b:keymap_name = "uk" loadkeymap ~ ~ ` ' 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 YI S І CYRILLIC CAPITAL LETTER BYELORUSSION-UKRAINIAN I M Ь CYRILLIC CAPITAL LETTER SOFT SIGN \" Є CYRILLIC CAPITAL LETTER UKRAINIAN IE > Ю CYRILLIC CAPITAL LETTER YU Z Я CYRILLIC CAPITAL LETTER YA | Ґ CYRILLIC CAPITAL LETTER GHE WITH UPTURN 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 YI s і CYRILLIC SMALL LETTER BYELORUSSION-UKRAINIAN I m ь CYRILLIC SMALL LETTER SOFT SIGN ' є CYRILLIC SMALL LETTER UKRAINIAN IE . ю CYRILLIC SMALL LETTER YU z я CYRILLIC SMALL LETTER YA \\ ґ CYRILLIC SMALL LETTER GHE WITH UPTURN @ " # ' $ * % : ^ , & . * ; ~ ~ ~~ Stress vim-7.4.1689/runtime/keymap/vietnamese-viqr_utf-8.vim000066400000000000000000000023371267703067000224320ustar00rootroot00000000000000" Vim Keymap file for vietnamese through the usual viqr method " Maintainer: Samuel Thibault " Last Change: 2006 Jun 17 scriptencoding utf-8 let b:keymap_name = "vietnamese" loadkeymap a a A A a` à A` À a? ả A? Ả a~ ã A~ à a' á A' Á a. ạ A. Ạ a( ă A( Ă a(` ằ A(` Ằ a(? ẳ A(? Ẳ a(~ ẵ A(~ Ẵ a(' ắ A(' Ắ a(. ặ A(. Ặ a^ â A^  a^` ầ A^` Ầ a^? ẩ A^? Ẩ a^~ ẫ A^~ Ẫ a^' ấ A^' Ấ a^. ậ A^. Ậ d d D D dd đ Dd Đ DD Đ e e E E e` è E` È e? ẻ E? Ẻ e~ ẽ E~ Ẽ e' é E' É e. ẹ E. Ẹ e^ ê E^ Ê e^` ề E^` Ề e^? ể E^? Ể e^~ ễ E^~ Ễ e^' ế E^' Ế e^. ệ E^. Ệ i i I I i` ì I` Ì i? ỉ I? Ỉ i~ ĩ I~ Ĩ i' í I' Í i. ị I. Ị o o O O o` ò O` Ò o? ỏ O? Ỏ o~ õ O~ Õ o' ó O' Ó o. ọ O. Ọ o^ ô O^ Ô o^` ồ O^` Ồ o^? ổ O^? Ổ o^~ ỗ O^~ Ỗ o^' ố O^' Ố o^. ộ O^. Ộ o+ ơ O+ Ơ o+` ờ O+` Ờ o+? ở O+? Ở o+~ ỡ O+~ Ỡ o+' ớ O+' Ớ o+. ợ O+. Ợ u u U U u` ù U` Ù u? ủ U? Ủ u~ ũ U~ Ũ u' ú U' Ú u. ụ U. Ụ u+ ư U+ Ư u+` ừ U+` Ừ u+? ử U+? Ử u+~ ữ U+~ Ữ u+' ứ U+' Ứ u+. ự U+. Ự y y Y Y y` ỳ Y` Ỳ y? ỷ Y? Ỷ y~ ỹ Y~ Ỹ y' ý Y' Ý y. ỵ Y. Ỵ \\d d \\D D vim-7.4.1689/runtime/lang/000077500000000000000000000000001267703067000152015ustar00rootroot00000000000000vim-7.4.1689/runtime/lang/README.txt000066400000000000000000000036401267703067000167020ustar00rootroot00000000000000Language 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. vim-7.4.1689/runtime/lang/menu_af.latin1.vim000066400000000000000000000001111267703067000205100ustar00rootroot00000000000000" Menu Translations: Afrikaans source :p:h/menu_af_af.latin1.vim vim-7.4.1689/runtime/lang/menu_af.utf-8.vim000066400000000000000000000001341267703067000202700ustar00rootroot00000000000000" Menu Translations: Afrikaans for UTF-8 encoding source :p:h/menu_af_af.latin1.vim vim-7.4.1689/runtime/lang/menu_af_af.latin1.vim000066400000000000000000000126211267703067000211670ustar00rootroot00000000000000" Menu Translations: Afrikaas " Maintainer: Danie Roux " Last Change: 2012 May 01 " Quit when menu translations have already been done. if exists("did_menu_trans") finish endif let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim " 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 &Oorsig 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 &Ler menutrans &Open\.\.\.:e &Open\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp Maak\ oop\ in\ nuwe\ &venster\.\.\.:sp menutrans &New:enew &Nuut:enew menutrans &Close:close Maak\ &Toe:close menutrans &Save:w &Skryf:w menutrans Save\ &As\.\.\.:w Skryf\ &as\.\.\.:w menutrans &Print &Druk menutrans Sa&ve-Exit:wqa Skryf\ en\ verlaat:wqa menutrans E&xit:qa &Verlaat:qa " Edit menu menutrans &Edit &Wysig menutrans &Undou Terugu menutrans &Redo^R Voo&ruit^R menutrans Rep&eat\. &Herhaal\. menutrans Cu&t"+x &Knip"+x menutrans &Copy"+y &Kopier"+y menutrans &Paste"+gP Plak"+gP menutrans Put\ &Before[p Voeg\ &Voor\ in[p menutrans Put\ &After]p Voeg\ A>er\ in]p menutrans &Select\ allggVG Kies\ &AllesggVG menutrans &Find\.\.\. &Soek\.\.\. menutrans Find\ and\ Rep&lace\.\.\. Soek\ en\ Vervang\.\.\. menutrans Options\.\.\. Opsies\.\.\. " Programming menu menutrans &Tools &Gereedskap menutrans &Jump\ to\ this\ tagg^] &Spring\ na\ Etiketg^] menutrans Jump\ &back^T Spring\ &Terug^T menutrans Build\ &Tags\ File Genereer\ &Etiket\ Ler menutrans &Make:make Voer\ &Make\ uit:make menutrans &List\ Errors:cl &Foutlys:cl menutrans L&ist\ Messages:cl! &Boodskaplys:cl! menutrans &Next\ Error:cn Volgende\ Fout:cn menutrans &Previous\ Error:cp Vorige\ Fout:cp menutrans &Older\ List:cold &Ouer\ Lys:cold menutrans N&ewer\ List:cnew &Nuwer\ Lys:cnew menutrans Error\ &Window:cwin Foute\ Venster:cwin menutrans Convert\ to\ HEX:%!xxd Verwissel\ na\ HEX:%!xxd menutrans Convert\ back:%!xxd\ -r Verwissel\ terug:%!xxd\ -r " Names for buffer menu. menutrans &Buffers &Buffers menutrans Refresh Verfris menutrans Delete Verwyder menutrans Alternate Vorige menutrans [No\ File] [Geen\ Ler] " Window menu menutrans &Window &Venster menutrans &New^Wn &Nuut^Wn menutrans S&plit^Ws Ver&deel^Ws menutrans Sp&lit\ To\ #^W^^ Verdeel\ N&a\ #^W^^ menutrans Split\ &Vertically^Wv Verdeel\ Vertikaal^Wv menutrans &Close^Wc &Maak\ toe^Wc menutrans Close\ &Other(s)^Wo Maak\ &Ander\ Toe^Wo menutrans Ne&xt^Ww Volgende^Ww menutrans P&revious^WW &Vorige^WW menutrans &Equal\ Size^W= &Gelyke\ hoogte^W= menutrans &Max\ Height^W_ &Maksimale\ hoogte^W_ menutrans M&in\ Height^W1_ Mi&nimale\ hoogte^W1_ menutrans Max\ Width^W\| Maksimale\ breedte^W\| menutrans Min\ Width^W1\| Minimale\ breedte^W1\| menutrans Rotate\ &Up^WR Roteer\ na\ &bo^WR menutrans Rotate\ &Down^Wr Roteer\ na\ &onder^Wr menutrans Select\ Fo&nt\.\.\. Kies\ font\.\.\. " The popup menu menutrans &Undo &Terug menutrans Cu&t Knip menutrans &Copy &Kopier menutrans &Paste &Plak menutrans &Delete &Verwyder menutrans Select\ Blockwise Kies\ per\ Blok menutrans Select\ &Word Kies\ een\ &Woord menutrans Select\ &Line Kies\ een\ &Rel 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 ler oop tmenu ToolBar.Save Skryf ler tmenu ToolBar.SaveAll Skryf alle lers tmenu ToolBar.Print Druk tmenu ToolBar.Undo Terug tmenu ToolBar.Redo Vooruit tmenu ToolBar.Cut Knip tmenu ToolBar.Copy Kopier 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\ ler) menutrans o&ff\ (this\ file) &Af\ (die\ ler) menutrans Co&lor\ test Toets\ die\ &kleure menutrans &Highlight\ test Toets\ die\ verligting menutrans &Convert\ to\ HTML Verwissel\ na\ HTML let &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/lang/menu_af_af.utf-8.vim000066400000000000000000000001341267703067000207360ustar00rootroot00000000000000" Menu Translations: Afrikaans for UTF-8 encoding source :p:h/menu_af_af.latin1.vim vim-7.4.1689/runtime/lang/menu_ca.latin1.vim000066400000000000000000000001131267703067000205070ustar00rootroot00000000000000" Menu translations for Catalan " source :p:h/menu_ca_es.latin1.vim vim-7.4.1689/runtime/lang/menu_ca.utf-8.vim000066400000000000000000000002311267703067000202630ustar00rootroot00000000000000" Menu translations for Catalan " " Maintainer: Ernest Adrogu " Last Change: 29 Dec 2003 " source :p:h/menu_ca_es.latin1.vim vim-7.4.1689/runtime/lang/menu_ca_es.latin1.vim000066400000000000000000000334651267703067000212160ustar00rootroot00000000000000" Menu translations for Catalan " " Maintainer: Ernest Adrogu " Last Change: 6 Jun 2008 " " Quit when menu translations have already been done. if exists("did_menu_trans") finish endif let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim " 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 &Introducci 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 &Sponsor/Register &Patrocini/Registre menutrans O&rphans &Orfes menutrans &Version &Versi menutrans &About &Quant\ a\.\.\. " text del dileg Ajuda/Cerca... let g:menutrans_help_dialog = "Introduu 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 lnia d'ordres (p.ex.: c_)\nUseu el prefix ' per noms d'opcions (p.ex.: 'shiftwidth')" " men Fitxer menutrans &File &Fitxer menutrans &Open\.\.\.:e &Obre\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp Obre\ en\ una\ &finestra\ nova\.\.\.:sp menutrans Open\ Tab\.\.\.:tabnew Obre\ pestanya\.\.\.:tabnew menutrans &New:enew &Nou:enew menutrans &Close:close &Tanca:close menutrans &Save:w &Desa:w menutrans Save\ &As\.\.\.:sav &Anomena\ i\ desa\.\.\.:sav menutrans Split\ &Diff\ with\.\.\. &Mostra\ les\ diferncies\ respecte\.\.\. menutrans Split\ Patched\ &By\.\.\. Aplica\ les\ modificacions\ de\.\.\. menutrans &Print &Imprimeix menutrans Sa&ve-Exit:wqa Desa\ i\ s&urt:wqa menutrans E&xit:qa &Surt:qa " men Edita menutrans &Edit &Edita menutrans &Undou &Desfsu menutrans &Redo^R &Refs^R menutrans Rep&eat\. Re&peteix\. menutrans Cu&t"+x Re&talla"+x menutrans &Copy"+y &Copia"+y menutrans &Paste"+gP Engan&xa"+gP menutrans Put\ &Before[p Posa\ &abans[p menutrans Put\ &After]p P&osa\ desprs]p menutrans &Deletex Suprimeixx menutrans &Select\ AllggVG &Selecciona-ho\ totggVG menutrans &Find\.\.\. &Cerca\.\.\. menutrans &Find/ &Cerca/ menutrans Find\ and\ Rep&lace Cerca\ i\ s&ubstitueix menutrans Find\ and\ Rep&lace\.\.\. Cerca\ i\ s&ubstitueix\.\.\. menutrans Find\ and\ Rep&lace:%s Cerca\ i\ s&ubstitueix:%s menutrans Find\ and\ Rep&lace:s Cerca\ i\ s&ubstitueix:s menutrans Settings\ &Window Fin&estra\ d'opcions menutrans Startup\ &Settings Opcions\ i&nicials menutrans &Global\ Settings Opcions\ &globals " submen Edita/Opcions Globals menutrans Toggle\ Pattern\ &Highlight:set\ hls! Ressalt\ de\ &patrons:set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! Sensibilitat\ a\ les\ ma&jscules:set\ ic! menutrans Toggle\ &Showmatch:set\ sm! &Ressalt\ de\ coincidncies:set\ sm! menutrans &Context\ lines Lnies\ 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:set\ im! Mode\ d'&inserci:set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! Co&mpatible\ amb\ Vi: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\ &desplaament\ inferior menutrans Toggle\ &Left\ Scrollbar Barra\ de\ desplaament\ e&squerra menutrans Toggle\ &Right\ Scrollbar Barra\ de\ desplaament\ dre&ta menutrans F&ile\ Settings Opcions\ del\ f&itxer " submen Edita/Opcions del fitxer menutrans Toggle\ Line\ &Numbering:set\ nu! &Ennumera\ les\ lnies:set\ nu! menutrans Toggle\ &List\ Mode:set\ list! Mode\ &llista:set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! A&justa\ les\ lnies\ llargues:set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! Ajusta\ sense\ partir\ ¶ules:set\ lbr! menutrans Toggle\ &expand-tab:set\ et! Estn\ les\ ta&bulacions:set\ et! menutrans Toggle\ &auto-indent:set\ ai! &Sagnia\ automtica:set\ ai! menutrans Toggle\ &C-indenting:set\ cin! Sagnia\ estil\ &C: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\.\.\. &Fosa\.\.\. 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 prssec 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\ (fontic) menutrans lithuanian-baltic Litu\ (bltic) menutrans pinyin Mandar\ (fontic) 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 dileg Edita/Opcions globals/Ubicacions... let g:menutrans_path_dialog = "Introduu les ubicacions on cercar fitxers.\nSepareu els noms dels directoris amb una coma." " text del dileg Edita/Opcions globals/Fitxers d'etiquetes... let g:menutrans_tags_dialog = "Introduu els noms dels fitxers d'etiquetes.\nSepareu els noms amb una coma." " text del dileg Edita/Opcions del fitxer/Amplada del text... let g:menutrans_textwidth_dialog = "Introduu la nova amplada del text (0 per infinit): " " text del dileg 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\ tagg^] &Salta\ a\ aquesta\ etiquetag^] menutrans Jump\ &back^T Salta\ en&rere^T menutrans Build\ &Tags\ File Crea\ un\ fitxer\ d'eti&quetes menutrans &Spelling &Ortografia " submen Eines/Ortografia menutrans &Spell\ Check\ On Activa\ la\ &revisi\ ortogrfica menutrans Spell\ Check\ &Off &Desactiva\ la\ revisi\ ortogrfica menutrans To\ &Next\ error]s Error\ &segent]s menutrans To\ &Previous\ error[s Error\ &anterior[s menutrans Suggest\ &Correctionsz= Su&ggerimentsz= menutrans &Repeat\ correction:spellrepall Re&peteix\ la\ correcci:spellrepall menutrans Set\ language\ to\ "en" Selecciona\ l'idioma\ "en" menutrans Set\ language\ to\ "en_au" Selecciona\ l'idioma\ "en_au" menutrans Set\ language\ to\ "en_ca" Selecciona\ l'idioma\ "en_ca" menutrans Set\ language\ to\ "en_gb" Selecciona\ l'idioma\ "en_gb" menutrans Set\ language\ to\ "en_nz" Selecciona\ l'idioma\ "en_nz" menutrans Set\ language\ to\ "en_us" Selecciona\ l'idioma\ "en_us" menutrans Set\ language\ to\ "ca" Selecciona\ l'idioma\ "ca" menutrans Set\ language\ to\ "es" Selecciona\ l'idioma\ "es" menutrans Set\ language\ to\ "fr" Selecciona\ l'idioma\ "fr" menutrans Set\ language\ to\ "it" Selecciona\ l'idioma\ "it" menutrans &Find\ More\ Languages &Cerca\ altres\ idiomes menutrans &Folding &Plecs " submen Eines/Plecs menutrans &Enable/Disable\ foldszi &Habilita/Deshabilita\ els\ plecszi menutrans &View\ Cursor\ Linezv &Lnia\ del\ cursor\ visiblezv menutrans Vie&w\ Cursor\ Line\ onlyzMzx &Noms\ visible\ la\ lnia\ del\ cursorzMzx menutrans C&lose\ more\ foldszm &Tanca\ ms\ plecszm menutrans &Close\ all\ foldszM Tanca\ t&ots\ els\ plecszM menutrans O&pen\ more\ foldszr Obre\ &ms\ plecszr menutrans &Open\ all\ foldszR O&bre\ tots\ els\ plecszR menutrans Fold\ Met&hod Mto&de " submen Eines/Plcs/Mtode menutrans M&anual M&anual menutrans I&ndent &Sagnia menutrans E&xpression E&xpressi menutrans S&yntax S&intaxi menutrans &Diff &Diferncies menutrans Ma&rker &Marques menutrans Create\ &Foldzf &Crea\ un\ pleczf menutrans &Delete\ Foldzd &Elimina\ un\ pleczd menutrans Delete\ &All\ FoldszD Elimina\ tot&s\ els\ plecszD menutrans Fold\ col&umn\ width &Amplada\ de\ la\ columna\ de\ plecs menutrans &Diff &Diferncies " submen Eines/Diferncies menutrans &Update &Actualitza menutrans &Get\ Block &Obtingues\ un\ bloc menutrans &Put\ Block &Posa\ un\ bloc menutrans &Make:make Crida\ a\ &make:make menutrans &List\ Errors:cl Llista\ d'&errors:cl menutrans L&ist\ Messages:cl! &Llista\ de\ missatges:cl! menutrans &Next\ Error:cn Error\ se&gent:cn menutrans &Previous\ Error:cp Error\ an&terior:cp menutrans &Older\ List:cold Llista\ &antiga:cold menutrans N&ewer\ List:cnew Llista\ no&va:cnew menutrans Error\ &Window F&inestra\ d'errors " submen Eines/Finestra d'errors menutrans &Update:cwin &Actualitza:cwin menutrans &Open:copen &Obre:copen menutrans &Close:cclose &Tanca:cclose menutrans &Set\ Compiler &Compilador menutrans &SeT\ Compiler &Compilador menutrans &Convert\ to\ HEX:%!xxd Converteix\ a\ &HEX:%!xxd menutrans Conve&rt\ back:%!xxd\ -r Torna\ al\ format\ &original:%!xxd\ -r " men Buffers menutrans &Buffers &Buffers menutrans &Refresh\ menu &Refresca\ el\ men menutrans &Delete &Elimina menutrans &Alternate &Alterna menutrans &Next &Segent menutrans &Previous A&nterior let g:menutrans_no_file = "[Cap fitxer]" " men Finestra menutrans &Window F&inestra menutrans &New^Wn &Nova^Wn menutrans S&plit^Ws &Divideix^Ws menutrans Sp&lit\ To\ #^W^^ Divideix\ &en\ #^W^^ menutrans Split\ &Vertically^Wv Divideix\ &verticalment^Wv menutrans Split\ File\ E&xplorer E&xplorador\ de\ fitxers menutrans &Close^Wc &Tanca^Wc menutrans Close\ &Other(s)^Wo Tanca\ les\ altre&s^Wo menutrans Move\ &To M&ou\ a " submen Finestra/Mou menutrans &Top^WK &Dalt\ de\ tot^WK menutrans &Bottom^WJ &Baix\ de\ tot^WJ menutrans &Left\ side^WH Costat\ &esquerra^WH menutrans &Right\ side^WL Costat\ d&ret^WL menutrans Rotate\ &Up^WR Alterna\ cap\ am&unt^WR menutrans Rotate\ &Down^Wr Alte&rna\ cap\ avall^Wr menutrans &Equal\ Size^W= &Iguala^W= menutrans &Max\ Height^W_ Mxima\ &alada^W_ menutrans M&in\ Height^W1_ Mnima\ a&lada^W1_ menutrans Max\ &Width^W\| Mxima\ a&mplada^W\| menutrans Min\ Widt&h^W1\| Mnima\ am&plada^W1\| " men emergent menutrans &Undo &Desfs menutrans Cu&t &Retalla menutrans &Copy &Copia menutrans &Paste &Enganxa menutrans &Delete &Suprimeix menutrans Select\ Blockwise Se&lecci menutrans Select\ &Word Selecci\ de\ ¶ules menutrans Select\ &Line Selecci\ de\ &lnies 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 Desfs tmenu ToolBar.Redo Refs tmenu ToolBar.Cut Retalla tmenu ToolBar.Copy Copia tmenu ToolBar.Paste Enganxa tmenu ToolBar.Find Cerca tmenu ToolBar.FindNext Cerca el segent 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 Alada mxima tmenu ToolBar.WinMin Alada mnima tmenu ToolBar.WinVSplit Divideix la finestra verticalment tmenu ToolBar.WinMaxWidth Amplada mxima tmenu ToolBar.WinMinWidth Amplada mnima 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'intrpret 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&utomtica 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 Noms\ el\ ressalt\ de\ sintaxi menutrans Set\ '&filetype'\ too Carrega\ tamb\ els\ plugins let &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/lang/menu_ca_es.utf-8.vim000066400000000000000000000002311267703067000207520ustar00rootroot00000000000000" Menu translations for Catalan " " Maintainer: Ernest Adrogu " Last Change: 29 Dec 2003 " source :p:h/menu_ca_es.latin1.vim vim-7.4.1689/runtime/lang/menu_chinese(gb)_gb.936.vim000066400000000000000000000004161267703067000220030ustar00rootroot00000000000000" Menu Translations: Simplified Chinese (Windows) " Last Change: Tue Sep 4 11:26:52 CST 2001 " $LANG on Windows 95/98/NT is Chinese(GB)_GB.936 " $LANG on Windows 2000/ME is Chinese_GB.936 " Source the other one from here. source :p:h/menu_chinese_gb.936.vim vim-7.4.1689/runtime/lang/menu_chinese(taiwan)_taiwan.950.vim000066400000000000000000000004341267703067000235650ustar00rootroot00000000000000" Menu Translations: Traditional Chinese (for UNIX/Big5 Windows) " Last Change: 2000 Nov 11 " $LANG on Windows 95/98/NT is Chinese(Taiwan)_Taiwan.950 " $LANG on Windows 2000/ME is Chinese_Taiwan.950 " Source the other one from here. source :p:h/menu_chinese_taiwan.950.vim vim-7.4.1689/runtime/lang/menu_chinese_gb.936.vim000066400000000000000000000243311267703067000213530ustar00rootroot00000000000000" Menu Translations: Simplified Chinese " Maintainer: Shun Bai " Previous Maintainer: Yuheng Xie " Last Change: 2014 Oct 15 " vim: ts=8 sw=8 noet " Quit when menu translations have already been done. if exists("did_menu_trans") finish endif let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim scriptencoding cp936 " Help menu menutrans &Help (&H) menutrans &Overview (&O) menutrans &User\ Manual ûֲ(&U) menutrans &How-to\ links How-to\ ָ(&H) menutrans &Find\.\.\. (&F)\.\.\. menutrans &Credits л(&C) menutrans Co&pying Ȩ(&P) menutrans &Sponsor/Register /ע(&S) menutrans O&rphans ¶(&R) menutrans &Version 汾(&V) menutrans &About (&A) " File menu menutrans &File ļ(&F) menutrans &Open\.\.\.:e (&O)\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp ָ(&L)\.\.\.:sp menutrans Open\ Tab\.\.\.:tabnew 򿪱ǩ\.\.\.:tabnew menutrans &New:enew ½(&N):enew menutrans &Close:close ر(&C):close menutrans &Save:w (&S):w menutrans Save\ &As\.\.\.:sav Ϊ(&A)\.\.\.:sav menutrans Split\ &Diff\ with\.\.\. ָȽ(Diff)(&D)\.\.\. menutrans Split\ Patched\ &By\.\.\. ָ򲹶(Patch)(&B)\.\.\. menutrans &Print ӡ(&P) menutrans Sa&ve-Exit:wqa 沢˳(&V):wqa menutrans E&xit:qa ˳(&X):qa " Edit menu menutrans &Edit ༭(&E) menutrans &Undou (&U)u menutrans &Redo^R (&R)^R menutrans Rep&eat\. ظϴβ(&E)\. menutrans Cu&t"+x (&T)"+x menutrans &Copy"+y (&C)"+y menutrans &Paste"+gP ճ(&P)"+gP menutrans Put\ &Before[p ճǰ(&B)[p menutrans Put\ &After]p ճ(&A)]p menutrans &Deletex ɾ(&D)x menutrans &Select\ AllggVG ȫѡ(&S)ggVG menutrans &Find\.\.\. (&F)\.\.\. menutrans Find\ and\ Rep&lace\.\.\. Һ滻(&L)\.\.\. menutrans &Find/ (&F)/ menutrans Find\ and\ Rep&lace:%s Һ滻(&L):%s menutrans Settings\ &Window 趨(&W) menutrans Startup\ &Settings 趨(&S) menutrans &Global\ Settings ȫ趨(&G) " Edit/Global Settings menutrans Toggle\ Pattern\ &Highlight:set\ hls! /ģʽ(&H):set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! /غԴСд(&I):set\ ic! menutrans Toggle\ &Showmatch:set\ sm! /ʾ(&S):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:set\ im! /زģʽ(&M):set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! /\ Vi\ :set\ cp! menutrans Search\ &Path\.\.\. ·(&P)\.\.\. menutrans Ta&g\ Files\.\.\. Tag\ ļ(&T)\.\.\. " 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:set\ nu! /ʾк(&N):set\ nu! menutrans Toggle\ relati&ve\ Line\ Numbering:set\ rnu! /к(&V):set\ rnu! menutrans Toggle\ &List\ Mode:set\ list! /\ list\ ģʽ(&L):set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! /(&W):set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! /(&R):set\ lbr! menutrans Toggle\ &expand-tab:set\ et! /չ\ tab(&E):set\ et! menutrans Toggle\ &auto-indent:set\ ai! /Զ(&A):set\ ai! menutrans Toggle\ &C-indenting:set\ cin! /\ C\ (&C):set\ cin! " other options menutrans &Shiftwidth (&S) menutrans Soft\ &Tabstop Soft\ Tab\ (&T) menutrans Te&xt\ Width\.\.\. ı(&X)\.\.\. menutrans &File\ Format\.\.\. ļʽ(&F)\.\.\. menutrans C&olor\ Scheme ɫ(&O) menutrans Select\ Fo&nt\.\.\. ѡ(&N)\.\.\. menutrans &Keymap ӳ(&K) " Programming menu menutrans &Tools (&T) menutrans &Jump\ to\ this\ tagg^] ת\ tag(&J)g^] menutrans Jump\ &back^T ת(&B)^T menutrans Build\ &Tags\ File \ Tags\ ļ(&T) " Tools.Spelling Menu menutrans &Spelling ƴд(&S) menutrans &Spell\ Check\ On ƴд(&S) menutrans Spell\ Check\ &Off رƴд(&O) menutrans To\ &Next\ error]s һ(&N)]s menutrans To\ &Previous\ error[s һ(&P)[s menutrans Suggest\ &Correctionsz= (&C)z= menutrans &Repeat\ correction:spellrepall ظ(&R):spellrepall menutrans Set\ language\ to\ "en" 趨Ϊ\ "en" menutrans Set\ language\ to\ "en_au" 趨Ϊ\ "en_au" menutrans Set\ language\ to\ "en_ca" 趨Ϊ\ "en_ca" menutrans Set\ language\ to\ "en_gb" 趨Ϊ\ "en_gb" menutrans Set\ language\ to\ "en_nz" 趨Ϊ\ "en_nz" menutrans Set\ language\ to\ "en_us" 趨Ϊ\ "en_us" menutrans &Find\ More\ Languages Ҹ(&F) " Tools.Fold Menu " open close folds menutrans &Folding ۵(&F) menutrans &Enable/Disable\ foldszi /۵(&E)zi menutrans &View\ Cursor\ Linezv 鿴(&V)zv menutrans Vie&w\ Cursor\ Line\ onlyzMzx 鿴(&W)zMzx menutrans C&lose\ more\ foldszm رո۵(&L)zm menutrans &Close\ all\ foldszM ر۵(&C)zM menutrans O&pen\ more\ foldszr 򿪸۵(&P)zr menutrans &Open\ all\ foldszR ۵(&O)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)(&D) menutrans Ma&rker (&R) " create and delete folds menutrans Create\ &Foldzf ۵(&F)zf menutrans &Delete\ Foldzd ɾ۵(&D)zd menutrans Delete\ &All\ FoldszD ɾ۵(&A)zD " moving around in folds menutrans Fold\ column\ &width ۵(&W) " Tools.Diff Menu menutrans &Diff Ƚ(Diff)(&D) menutrans &Update (&U) menutrans &Get\ Block õ(&G) menutrans &Put\ Block ÿ(&P) menutrans &Make:make Make(&M):make menutrans &List\ Errors:cl г(&L):cl menutrans L&ist\ Messages:cl! гϢ(&I):cl! menutrans &Next\ Error:cn һ(&N):cn menutrans &Previous\ Error:cp һ(&P):cp menutrans &Older\ List:cold ɵĴб(&O):cold menutrans N&ewer\ List:cnew µĴб(&E):cnew menutrans Error\ &Window 󴰿(&W) menutrans &Update:cwin (&U):cwin menutrans &Open:copen (&O):copen menutrans &Close:cclose ر(&C):cclose menutrans &Convert\ to\ HEX:%!xxd תʮ:%!xxd menutrans Conve&rt\ back:%!xxd\ -r ת:%!xxd\ -r menutrans Se&T\ Compiler 趨(&T) " 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^Wn ½(&N)^Wn menutrans S&plit^Ws ָ(&P)^Ws menutrans Sp&lit\ To\ #^W^^ ָ\ #(&L)^W^^ menutrans Split\ &Vertically^Wv ֱָ(&V)^Wv menutrans Split\ File\ E&xplorer ָļ(&X) menutrans &Close^Wc ر(&C)^Wc menutrans Close\ &Other(s)^Wo ر(&O)^Wo menutrans Move\ &To ƶ(&T) menutrans &Top^WK (&T)^WK menutrans &Bottom^WJ ׶(&B)^WJ menutrans &Left\ side^WH (&L)^WH menutrans &Right\ side^WL ұ(&R)^WL " menutrans Ne&xt^Ww һ(&X)^Ww " menutrans P&revious^WW һ(&R)^WW menutrans Rotate\ &Up^WR ֻ(&U)^WR menutrans Rotate\ &Down^Wr ֻ(&D)^Wr menutrans &Equal\ Size^W= ȴ(&E)^W= menutrans &Max\ Height^W_ ߶(&M)^W menutrans M&in\ Height^W1_ С߶(&I)^W1_ menutrans Max\ &Width^W\| (&W)^W\| menutrans Min\ Widt&h^W1\| С(&H)^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\ &Sentence ѡ(&S) menutrans Select\ Pa&ragraph ѡ(&R) 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 (:make) tmenu ToolBar.RunCtags ڵǰĿ¼ tags (!ctags -R .) tmenu ToolBar.TagJump תλõ tag tmenu ToolBar.Help Vim tmenu ToolBar.FindHelp Vim endfun endif " Syntax menu menutrans &Syntax ﷨(&S) menutrans &Show\ filetypes\ in\ menu ڲ˵ʾļ(&S) 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) menutrans Set\ '&syntax'\ only 趨\ 'syntax'(&S) menutrans Set\ '&filetype'\ too Ҳ趨\ 'filetype'(&F) let &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/lang/menu_chinese_taiwan.950.vim000066400000000000000000000307331267703067000222450ustar00rootroot00000000000000" Menu Translations: Traditional Chinese " Translated By: Hung-Te Lin " Last Change: 2012 May 01 " {{{ Quit when menu translations have already been done. if exists("did_menu_trans") finish endif let did_menu_trans = 1 " }}} let s:keepcpo= &cpo set cpo&vim scriptencoding cp950 " {{{ Help menu: complete menutrans &Help U(&H) " ------------------------------------------------------------------------ menutrans &Overview `(&O) menutrans &User\ Manual ϥΪ̤U(&U) menutrans &How-to\ links p@\.\.\.(&H) menutrans &GUI ϫɭ(&G) menutrans &Credits P(&C) menutrans Co&pying v(&P) menutrans &Sponsor/Register ٧U/U(&S) menutrans O&rphans @ϩt(&R) " ------------------------------------------------------------------------ menutrans &Version {T(&V) menutrans &About \ Vim(&A) " }}} " {{{ File menu: complete menutrans &File ɮ(&F) " ------------------------------------------------------------------------ menutrans &Open\.\.\.:e }(&O)\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp εö}(&L):sp menutrans &New:enew ssɮ(&N):enew menutrans &Close:close ɮ(&C):close " ------------------------------------------------------------------------ menutrans &Save:w xs(&S):w menutrans Save\ &As\.\.\.:sav tss(&A)\.\.\.:sav " ------------------------------------------------------------------------ menutrans Split\ &Diff\ with\.\.\. (&Diff)\.\.\. menutrans Split\ Patched\ &By\.\.\. Patch(&B)\.\.\. " ------------------------------------------------------------------------ menutrans &Print CL(&P) " ------------------------------------------------------------------------ menutrans Sa&ve-Exit:wqa xs}(&V):wqa menutrans E&xit:qa }(&X):qa " }}} " {{{ Edit menu menutrans &Edit s(&E) " ------------------------------------------------------------------------ menutrans &Undou _(&U)u menutrans &Redo^R W_(&R)^R menutrans Rep&eat\. ƤWʧ@(&E)\. " ------------------------------------------------------------------------ menutrans Cu&t"+x ŤU(&T)"+x menutrans &Copy"+y ƻs(&C)"+y menutrans &Paste"+gP KW(&P)"+gP menutrans Put\ &Before[p KЫe(&B)[p menutrans Put\ &After]p KЫ(&A)]p menutrans &Deletex R(&D)x menutrans &Select\ AllggVG (&S)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\.\.\. ]wr(&N)\.\.\. " }}} " {{{ Edit.FileSettings menutrans Toggle\ Line\ &Numbering:set\ nu! ܦ渹(&N):set\ nu! menutrans Toggle\ &List\ Mode:set\ list! ܦTAB(&L):set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! ۰ʧ(&W):set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! ܥiN_y(&R):set\ lbr! menutrans Toggle\ &expand-tab:set\ et! i}TAB(&E):set\ et! menutrans Toggle\ &auto-indent:set\ ai! ۰Y(&A):set\ ai! menutrans Toggle\ &C-indenting:set\ cin! ѻyY(&C):set\ cin! " ------------------------------------------------------------------------ menutrans &Shiftwidth YƼe(shiftwidth)(&S) menutrans Soft\ &Tabstop nTAB(softtabstop)(&T) menutrans Te&xt\ Width\.\.\. re(textwidth)(&X)\.\.\. menutrans &File\ Format\.\.\. ]wɮ׮榡(@~t)(&F)\.\.\. " }}} " {{{ Edit.GlobalSettings menutrans Toggle\ Pattern\ &Highlight:set\ hls! G׷jMr(&H):set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! jpg(&I):set\ ic! menutrans Toggle\ &Showmatch:set\ sm! ܹA(&S):set\ sm! menutrans Toggle\ Vi\ C&ompatible:set\ cp! DzViۮeҦ(&O):set\ cp! menutrans &Context\ lines eOd(scrolloff)(&C) menutrans &Virtual\ Edit ХN(virtualedit)(&V) " {{{ Edit.GlobalSettings.VirtualEdit menutrans Never ϥ menutrans Block\ Selection ϶ܮ menutrans Insert\ mode JҦ menutrans Block\ and\ Insert ϶PJҦ menutrans Always @} " }}} menutrans Toggle\ Insert\ &Mode:set\ im! JҦ(&M):set\ im! menutrans Search\ &Path\.\.\. jM|(&P)\.\.\. menutrans Ta&g\ Files\.\.\. Tag\ үɮ(&G)\.\.\. " ------------------------------------------------------------------------ menutrans Toggle\ &Toolbar ϥΤuC(&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\ tagg^] ˯гBr(tag)(&J)g^] menutrans Jump\ &back^T ^˯em(&B)^T menutrans Build\ &Tags\ File إ߼ү\ Tags(&T) " ------------------------------------------------------------------------ menutrans &Folding |(Fold)]w(&F) " {{{ Tools.Fold menutrans &Enable/Disable\ foldszi ϥ\ Folding(&E)zi menutrans &View\ Cursor\ Linezv ˵h\ Fold(&V)zv menutrans Vie&w\ Cursor\ Line\ onlyzMzx u˵\ Fold(&W)zMzx menutrans C&lose\ more\ foldszm _@h\ Folds(&L)zm menutrans &Close\ all\ foldszM _Ҧ\ Folds(&C)zM menutrans O&pen\ more\ foldszr }@h\ Folds(&P)zr menutrans &Open\ all\ foldszR }Ҧ\ Folds(&O)zR menutrans Fold\ Met&hod Folding\ 覡(&H) " {{{ Tools.Fold.Method menutrans M&anual ʫإ(&A) menutrans I&ndent ̷Y(&N) menutrans E&xpression ۭqB⦡(&X) menutrans S&yntax ̷ӻyk]w(&Y) menutrans &Diff Diff(&D) menutrans Ma&rker аO(Marker)(&R) " }}} " ------------------------------------------------------------------------ menutrans Create\ &Foldzf إ\ Fold(&F)zf menutrans &Delete\ Foldzd R\ Fold(&D)zd menutrans Delete\ &All\ FoldszD RҦ\ Fold(&A)zD " ------------------------------------------------------------------------ menutrans Fold\ column\ &width ]w\ Folde(&W) " }}} menutrans &Diff Diff(&D) " {{{ Tools.Diff menutrans &Update s(&U) menutrans &Get\ Block o϶(&G) menutrans &Put\ Block KW϶(&P) " }}} " ------------------------------------------------------------------------ menutrans &Make:make \ Make(&M):make menutrans &List\ Errors:cl CXsĶ~(&E):cl menutrans L&ist\ Messages:cl! CXҦT(&I):cl! menutrans &Next\ Error:cn U@ӽsĶ~B(&N):cn menutrans &Previous\ Error:cp W@ӽsĶ~B(&P):cp menutrans &Older\ List:cold ˵¿~C(&O):cold menutrans N&ewer\ List:cnew ˵s~C(&E):cnew menutrans Error\ &Window ~T(&W) " {{{ Tools.ErrorWindow menutrans &Update:cwin s(&U):cwin menutrans &Open:copen }(&O):copen menutrans &Close:cclose (&C):cclose " }}} menutrans &Set\ Compiler ]wsĶCompiler(&S) " ------------------------------------------------------------------------ menutrans &Convert\ to\ HEX:%!xxd ഫ16iX(&C):%!xxd menutrans Conve&rt\ back:%!xxd\ -r q16iXഫ^r(&R):%!xxd\ -r " }}} " {{{ Syntax menu: compete menutrans &Syntax ykĪ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 ykĪ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 Wswİ(&A) menutrans &Next U@(&N) menutrans &Previous e@(&P) " ------------------------------------------------------------------------ " menutrans [No\ file] [Lɮ] " }}} " {{{ Window menu: complete menutrans &Window (&W) " ------------------------------------------------------------------------ menutrans &New^Wn }s(&N)^Wn menutrans S&plit^Ws ε(&P)^Ws menutrans Sp&lit\ To\ #^W^^ Ψ#(&L)^W^^ menutrans Split\ &Vertically^Wv (&V)^Wv menutrans Split\ File\ E&xplorer ɮ`ަ(&X) " ------------------------------------------------------------------------ menutrans &Close^Wc (&C)^Wc menutrans Close\ &Other(s)^Wo 䥦(&O)^Wo " ------------------------------------------------------------------------ menutrans Move\ &To (&T) " {{{ Window.MoveTo menutrans &Top^WK (&T)^WK menutrans &Bottom^WJ (&B)^WJ menutrans &Left\ side^WH (&L)^WH menutrans &Right\ side^WL k(&R)^WL " }}} menutrans Rotate\ &Up^WR W(&U)^WR menutrans Rotate\ &Down^Wr U(&D)^Wr " ------------------------------------------------------------------------ menutrans &Equal\ Size^W= Ҧ(&E)^W= menutrans &Max\ Height^W_ ̤j(&M)^W menutrans M&in\ Height^W1_ ̤p(&I)^W1_ menutrans Max\ &Width^W\| ̤je(&W)^W\| menutrans Min\ Widt&h^W1\| ̤pe(&H)^W1\| " }}} " {{{ The popup menu: complete menutrans &Undo _(&U) " ------------------------------------------------------------------------ menutrans Cu&t ŤU(&T) menutrans &Copy ƻs(&C) menutrans &Paste KW(&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 xsثes褤ɮ tmenu ToolBar.SaveAll xsɮ tmenu ToolBar.Print CL " ------------------------------------------------------------------------ tmenu ToolBar.Undo _Wܰ tmenu ToolBar.Redo W_ʧ@ " ------------------------------------------------------------------------ tmenu ToolBar.Cut ŤUܰŶKï tmenu ToolBar.Copy ƻsŶKï tmenu ToolBar.Paste ѰŶKïKW " ------------------------------------------------------------------------ tmenu ToolBar.Find M... tmenu ToolBar.FindNext U@ tmenu ToolBar.FindPrev W@ tmenu ToolBar.Replace N... " ------------------------------------------------------------------------ tmenu ToolBar.LoadSesn J Session tmenu ToolBar.SaveSesn xsثe Session tmenu ToolBar.RunScript Vim { " ------------------------------------------------------------------------ tmenu ToolBar.Make Make tmenu ToolBar.Shell }Ҥ@өROC DosBox tmenu ToolBar.RunCtags ctags tmenu ToolBar.TagJump ثeЦm tag tmenu ToolBar.Help Vim U tmenu ToolBar.FindHelp jM Vim endfun endif " }}} let &cpo = s:keepcpo unlet s:keepcpo " vim:foldmethod=marker:nowrap:foldcolumn=2:foldlevel=1 vim-7.4.1689/runtime/lang/menu_cs.cp1250.vim000066400000000000000000000001221267703067000202530ustar00rootroot00000000000000" Menu Translations: Czech source :p:h/menu_czech_czech_republic.1250.vim vim-7.4.1689/runtime/lang/menu_cs.latin1.vim000066400000000000000000000001221267703067000205310ustar00rootroot00000000000000" Menu Translations: Czech source :p:h/menu_czech_czech_republic.1252.vim vim-7.4.1689/runtime/lang/menu_cs_cz.cp1250.vim000066400000000000000000000001221267703067000207470ustar00rootroot00000000000000" Menu Translations: Czech source :p:h/menu_czech_czech_republic.1250.vim vim-7.4.1689/runtime/lang/menu_cs_cz.iso_8859-2.vim000066400000000000000000000311521267703067000214720ustar00rootroot00000000000000" Menu Translations: Czech (ISO-8859-2) " Maintainer: Jiri Sedlak " Previous maintainer: Jiri Brezina " Based on: menu.vim (2012-10-21) " Quit when menu translations have already been done. if exists("did_menu_trans") finish endif let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim scriptencoding iso-8859-2 " {{{ File menu menutrans &File &Soubor menutrans &Open\.\.\.:e &Otevt\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp Otevt\ v\ no&vm\ okn\.\.\.:sp menutrans Open\ Tab\.\.\.:tabnew Otevt\ tab\.\.\.:tabnew menutrans &New:enew &Nov:enew menutrans &Close:close &Zavt:close menutrans &Save:w &Uloit:w menutrans Save\ &As\.\.\.:sav Uloit\ &jako\.\.\.:sav if has("printer") || has("unix") menutrans &Print &Tisk endif menutrans Sa&ve-Exit:wqa U&loit\ a\ ukonit:wqa menutrans E&xit:qa &Ukonit:qa if has("diff") menutrans Split\ &Diff\ with\.\.\. Rozdlit\ okno\ -\ &Diff\.\.\. menutrans Split\ Patched\ &By\.\.\. Rozdlit\ okno\ -\ &Patch\.\.\. endif " }}} " {{{ Edit menu menutrans &Edit pr&avy menutrans &Undou &Zptu menutrans &Redo^R Z&ruit\ vrcen^R menutrans Rep&eat\. &Opakovat\. menutrans Cu&t"+x &Vyznout"+x menutrans &Copy"+y &Koprovat"+y menutrans &Paste"+gP V&loit"+gP menutrans Put\ &Before[p Vloit\ &ped[p menutrans Put\ &After]p Vloi&t\ za]p if has("win32") || has("win16") menutrans &Deletex &Smazatx endif menutrans &Select\ AllggVG Vy&brat\ veggVG if has("win32") || has("win16") || has("gui_gtk") || has("gui_kde") || has("gui_motif") menutrans &Find\.\.\. &Hledat\.\.\. menutrans Find\ and\ Rep&lace\.\.\. &Nahradit\.\.\. else menutrans Find/ &Hledat/ menutrans Find\ and\ Rep&lace:%s &Nahradit:%s menutrans Find\ and\ Rep&lace:s &Nahradit:s endif menutrans Settings\ &Window Nastav&en\ okna " {{{2 Edit -1 menutrans Startup\ &Settings Poten\ &nastaven menutrans &Global\ Settings &Globln\ nastaven menutrans Toggle\ Pattern\ &Highlight:set\ hls! &Pepnout\ zvraznn\ vzoru:set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! Pepnout\ ignorovn\ &VERZLEK:set\ ic! menutrans Toggle\ &Showmatch:set\ sm! Pepnout\ &Showmatch\ \{\(\[\])\}:set\ sm! menutrans &Context\ lines Zobrazit\ konte&xt\ kurzoru menutrans &Virtual\ Edit Virtuln\ p&ozice\ kurzoru menutrans Never Nikdy menutrans Block\ Selection Vbr\ Bloku menutrans Insert\ mode Insert\ md menutrans Block\ and\ Insert Blok\ a\ Insert menutrans Always Vdycky menutrans Toggle\ Insert\ &Mode:set\ im! Pepnout\ Insert\ m&d:set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! Pepnout\ kompatibiln\ reim\ s\ 'vi':set\ cp! menutrans Search\ &Path\.\.\. Nastavit\ &cestu\ k\ prohledvn\.\.\. menutrans Ta&g\ Files\.\.\. Ta&g\ soubory\.\.\. menutrans Toggle\ &Toolbar Pepnout\ &Toolbar menutrans Toggle\ &Bottom\ Scrollbar P&epnout\ doln\ rolovac\ litu menutrans Toggle\ &Left\ Scrollbar Pepnout\ &levou\ rolovac\ litu menutrans Toggle\ &Right\ Scrollbar Pepnout\ p&ravou\ rolovac\ litu " {{{2 Edit -2 menutrans F&ile\ Settings Nastaven\ so&uboru menutrans Toggle\ Line\ &Numbering:set\ nu! Pepnout\ slovn\ &dk:set\ nu! menutrans Toggle\ relati&ve\ Line\ Numbering:set\ rnu! Pepnout\ relativn\ slovn\ &dk:set\ rnu! menutrans Toggle\ &List\ Mode:set\ list! Pepnout\ &List\ md:set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! Pepnout\ zala&movn\ dk:set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! Pepnout\ zl&om\ ve\ slov:set\ lbr! menutrans Toggle\ &expand-tab:set\ et! Pepnout\ &expand-tab:set\ et! menutrans Toggle\ &auto-indent:set\ ai! Pepnout\ &auto-indent:set\ ai! menutrans Toggle\ &C-indenting:set\ cin! Pepnout\ &C-indenting: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\.\.\. &Formt\ souboru\.\.\. " {{{2 Edit -3 menutrans C&olor\ Scheme Barevn\ s&chma menutrans &Keymap Klvesov\ m&apa if has("win32") || has("win16") || has("gui_motif") || has("gui_gtk") || has("gui_kde") || has("gui_photon") || has("gui_mac") menutrans Select\ Fo&nt\.\.\. Vybrat\ ps&mo\.\.\. endif " }}}1 " {{{ Programming menu menutrans &Tools Nst&roje menutrans &Jump\ to\ this\ tagg^] &Skoit\ na\ tagg^] menutrans Jump\ &back^T Skoit\ &zpt^T menutrans Build\ &Tags\ File &Vytvoit\ soubor\ tag if has("spell") menutrans &Spelling &Kontrola\ pravopisu menutrans &Spell\ Check\ On &Zapnout\ kontrolu\ pravopisu menutrans Spell\ Check\ &Off &Vypnout \kontrolu\ pravopisu menutrans To\ &Next\ error]s &Dal\ chyba]s menutrans To\ &Previous\ error[s &Pedchoz\ chyba[s menutrans Suggest\ &Correctionsz= &Navrhnout\ opravyz= menutrans &Repeat\ correction:spellrepall Zopakovat\ &opravu:spellrepall menutrans Set\ language\ to\ "en" Nastavit\ jazyk\ na\ "en" menutrans Set\ language\ to\ "en_au" Nastavit\ jazyk\ na\ "en_au" menutrans Set\ language\ to\ "en_ca" Nastavit\ jazyk\ na\ "en_ca" menutrans Set\ language\ to\ "en_gb" Nastavit\ jazyk\ na\ "en_gb" menutrans Set\ language\ to\ "en_nz" Nastavit\ jazyk\ na\ "en_nz" menutrans Set\ language\ to\ "en_us" Nastavit\ jazyk\ na\ "en_us" menutrans &Find\ More\ Languages Nalzt\ dal\ &jazyky let g:menutrans_set_lang_to = "Nastavit jazyk na" endif if has("Folding") menutrans &Folding &Skldn menutrans &Enable/Disable\ foldszi &Ano/Nezi menutrans &View\ Cursor\ Linezv Zobrazit\ dek\ &kurzoruzv menutrans Vie&w\ Cursor\ Line\ onlyzMzx Zobrazit\ &pouze\ dek\ kurzoru\ zMzx menutrans C&lose\ more\ foldszm Sloit\ &jednu\ rove\ skladzm menutrans &Close\ all\ foldszM Sloit\ vechny\ skladyzM menutrans O&pen\ more\ foldszr Pidat\ jednu\ rove\ skladzr menutrans &Open\ all\ foldszR &Otevt\ vechny\ skladyzR menutrans Fold\ Met&hod &Metoda\ skldn menutrans M&anual &Run menutrans I&ndent &Odsazen menutrans E&xpression &Vraz menutrans S&yntax &Syntaxe menutrans &Diff &Rozdly menutrans Ma&rker &Znaky menutrans Create\ &Foldzf Vytvoit\ &skladzf menutrans &Delete\ Foldzd Vymazat\ skla&dzd menutrans Delete\ &All\ FoldszD Vymazat\ vechny\ skladyzD menutrans Fold\ col&umn\ width Sloupec\ zob&razen\ sklad endif if has("diff") menutrans &Update &Obnovit menutrans &Get\ Block &Sejmout\ Blok menutrans &Put\ Block &Vloit\ Blok endif menutrans &Make:make &Make:make menutrans &List\ Errors:cl Vpis\ &chyb:cl menutrans L&ist\ Messages:cl! Vp&is\ zprv:cl! menutrans &Next\ Error:cn Dal\ ch&yba:cn menutrans &Previous\ Error:cp &Pedchoz\ chyba:cp menutrans &Older\ List:cold Sta&r\ seznam:cold menutrans N&ewer\ List:cnew N&ovj\ seznam:cnew menutrans Error\ &Window Chybov\ o&kno menutrans SeT\ Compiler Nas&taven\ kompiltoru menutrans &Update:cwin O&bnovit:cwin menutrans &Open:copen &Otevt:copen menutrans &Close:cclose &Zavt:cclose menutrans Se&T\ Compiler N&astavit\ kompiltor menutrans &Convert\ to\ HEX:%!xxd Pevst\ do\ estnctkovho\ formt&u:%!xxd menutrans Conve&rt\ back:%!xxd\ -r P&evst\ zpt:%!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 &Run menutrans A&utomatic A&utomaticky menutrans on/off\ for\ &This\ file &Pepnout\ (pro\ tento\ soubor) menutrans o&ff\ (this\ file) vyp&nout\ (pro\ tento\ soubor) menutrans Co&lor\ test Test\ &barev menutrans &Highlight\ test &Test\ zvrazovn menutrans &Convert\ to\ HTML Pevst\ &do\ HTML menutrans &Show\ filetypes\ in\ menu &Zobrazit\ vbr\ monost " }}} " {{{ Menu Buffers menutrans &Buffers &Buffery menutrans &Refresh\ menu &Obnovit\ menu menutrans &Delete Z&ruit menutrans &Alternate &Zmnit menutrans &Next &Dal menutrans &Previous &Pedchoz " }}} " {{{ Menu Window menutrans &Window &Okna menutrans &New^Wn &Nov^Wn menutrans S&plit^Ws &Rozdlit^Ws menutrans Sp&lit\ To\ #^W^^ Ro&zdlit\ na\ #^W^^ menutrans Split\ &Vertically^Wv Rozdlit\ &vertikln^Wv menutrans Split\ File\ E&xplorer Rozdlit\ -\ File\ E&xplorer menutrans Move\ &To &Pesun menutrans &Top^WK &Nahoru^WK menutrans &Bottom^WJ &Dolu^WJ menutrans &Left\ side^WH &Vlevo^WH menutrans &Right\ side^WL Vp&ravo^WL menutrans &Close^Wc Zav&t^Wc menutrans Close\ &Other(s)^Wo Zavt\ &ostatn^Wo menutrans Ne&xt^Ww &Dal^Ww menutrans P&revious^WW &Pedchoz^WW menutrans &Equal\ Size^W= &Stejn\ vka^W= menutrans &Max\ Height^W_ Maximln\ v&ka^W_ menutrans M&in\ Height^W1_ M&inimln\ vka^W1_ menutrans Max\ &Width^W\| &Maximln\ ka^W\| menutrans Min\ Widt&h^W1\| Minimln\ k&a^W1\| menutrans Rotate\ &Up^WR Rotovat\ na&horu^WR menutrans Rotate\ &Down^Wr Rotovat\ &dol^Wr " {{{ Help menu menutrans &Help &Npovda menutrans &Overview &Pehled menutrans &User\ Manual &Uivatelsk\ Manul menutrans &How-to\ links Ho&wto menutrans &GUI &Grafick\ rozhran menutrans &Credits &Autoi menutrans Co&pying &Licenn\ politika menutrans &Sponsor/Register Sponzorovn/&Registrace menutrans &Find\.\.\. &Hledat\.\.\. menutrans O&rphans O&siel\ dti menutrans &Version &Verze menutrans &About &O\ aplikaci " }}} " {{{ The popup menu menutrans &Undo &Zpt menutrans Cu&t &Vyznout menutrans &Copy &Koprovat menutrans &Paste &Vloit menutrans &Delete &Smazat menutrans Select\ Blockwise Vybrat\ blokov menutrans Select\ &Word Vybrat\ &slovo menutrans Select\ Pa&ragraph Vybrat\ &odstavec menutrans Select\ &Sentence Vybrat\ v&tu menutrans Select\ &Line Vybrat\ &dek menutrans Select\ &Block Vybrat\ &blok menutrans Select\ &All Vybrat\ &ve " }}} " {{{ The GUI toolbar if has("toolbar") if exists("*Do_toolbar_tmenu") delfun Do_toolbar_tmenu endif fun Do_toolbar_tmenu() tmenu ToolBar.Open Otevt soubor tmenu ToolBar.Save Uloit soubor tmenu ToolBar.SaveAll Uloit vechny soubory if has("printer") || has("unix") tmenu ToolBar.Print Tisk endif tmenu ToolBar.Undo Zpt tmenu ToolBar.Redo Zruit vrcen tmenu ToolBar.Cut Vyznout tmenu ToolBar.Copy Koprovat tmenu ToolBar.Paste Vloit tmenu ToolBar.Find Hledat... tmenu ToolBar.FindNext Hledat dal tmenu ToolBar.FindPrev Hledat pedchoz tmenu ToolBar.Replace Nahradit... if 0 " disabled; These are in the Windows menu tmenu ToolBar.New Nov okno tmenu ToolBar.WinSplit Rozdlit okno tmenu ToolBar.WinMax Maximalizovat okno tmenu ToolBar.WinMin Minimalizovat okno tmenu ToolBar.WinClose Zavt okno endif tmenu ToolBar.LoadSesn Nast sezen tmenu ToolBar.SaveSesn Uloit sezen tmenu ToolBar.RunScript Spustit skript tmenu ToolBar.Make Spustit make tmenu ToolBar.Shell Spustit shell tmenu ToolBar.RunCtags Spustit ctags tmenu ToolBar.TagJump Skoit na tag pod kurzorem tmenu ToolBar.Help Npovda tmenu ToolBar.FindHelp Hledat npovdu k... endfun endif " }}} " {{{ DIALOG TEXTS let g:menutrans_no_file = "[dn soubor]" let g:menutrans_help_dialog = "Zadejte hledan pkaz nebo slovo:\n\n\tPidejte i_ pro pkazy vkldacho reimu (nap. i_CTRL-X)\n\tPidejte c_ pro pkazy pkazov dky (nap. c_)\n\tPidejte ' pro jmno volby (nap. 'shiftwidth')" let g:menutrans_path_dialog = "Zadejte cesty pro vyhledvn soubor. Jednotliv cesty oddlte rkou" let g:menutrans_tags_dialog = "Zadejte jmna soubor s tagy. Jmna oddlte rkami." let g:menutrans_textwidth_dialog = "Zadejte dlku dku (0 pro zakzn formtovn):" let g:menutrans_fileformat_dialog = "Vyberte typ konce dk" " }}}" let &cpo = s:keepcpo unlet s:keepcpo " vim:set foldmethod=marker expandtab tabstop=3 shiftwidth=3: vim-7.4.1689/runtime/lang/menu_cs_cz.latin1.vim000066400000000000000000000001231267703067000212260ustar00rootroot00000000000000" Menu Translations: Czech source :p:h/menu_czech_czech_republic.ascii.vim vim-7.4.1689/runtime/lang/menu_cs_cz.utf-8.vim000066400000000000000000000317111267703067000210100ustar00rootroot00000000000000" Menu Translations: Czech (UTF-8) " Maintainer: Jiri Sedlak " Previous maintainer: Jiri Brezina " Based on: menu.vim (2012-10-21) " Quit when menu translations have already been done. if exists("did_menu_trans") finish endif let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim scriptencoding utf-8 " {{{ File menu menutrans &File &Soubor menutrans &Open\.\.\.:e &Otevřít\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp Otevřít\ v\ no&vém\ okně\.\.\.:sp menutrans Open\ Tab\.\.\.:tabnew Otevřít\ tab\.\.\.:tabnew menutrans &New:enew &Nový:enew menutrans &Close:close &Zavřít:close menutrans &Save:w &Uložit:w menutrans Save\ &As\.\.\.:sav Uložit\ &jako\.\.\.:sav if has("printer") || has("unix") menutrans &Print &Tisk endif menutrans Sa&ve-Exit:wqa U&ložit\ a\ ukončit:wqa menutrans E&xit:qa &Ukončit:qa if has("diff") menutrans Split\ &Diff\ with\.\.\. Rozdělit\ okno\ -\ &Diff\.\.\. menutrans Split\ Patched\ &By\.\.\. Rozdělit\ okno\ -\ &Patch\.\.\. endif " }}} " {{{ Edit menu menutrans &Edit Úpr&avy menutrans &Undou &Zpětu menutrans &Redo^R Z&rušit\ vrácení^R menutrans Rep&eat\. &Opakovat\. menutrans Cu&t"+x &Vyříznout"+x menutrans &Copy"+y &Kopírovat"+y menutrans &Paste"+gP V&ložit"+gP menutrans Put\ &Before[p Vložit\ &před[p menutrans Put\ &After]p Vloži&t\ za]p if has("win32") || has("win16") menutrans &Deletex &Smazatx endif menutrans &Select\ AllggVG Vy&brat\ všeggVG if has("win32") || has("win16") || has("gui_gtk") || has("gui_kde") || has("gui_motif") menutrans &Find\.\.\. &Hledat\.\.\. menutrans Find\ and\ Rep&lace\.\.\. &Nahradit\.\.\. else menutrans Find/ &Hledat/ menutrans Find\ and\ Rep&lace:%s &Nahradit:%s menutrans Find\ and\ Rep&lace:s &Nahradit:s endif menutrans Settings\ &Window Nastav&ení\ okna " {{{2 Edit -1 menutrans Startup\ &Settings Počáteční\ &nastavení menutrans &Global\ Settings &Globální\ nastavení menutrans Toggle\ Pattern\ &Highlight:set\ hls! &Přepnout\ zvýraznění\ vzoru:set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! Přepnout\ ignorování\ &VERZÁLEK:set\ ic! menutrans Toggle\ &Showmatch:set\ sm! Přepnout\ &Showmatch\ \{\(\[\])\}: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:set\ im! Přepnout\ Insert\ mó&d:set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! Přepnout\ kompatibilní\ režim\ s\ 'vi':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:set\ nu! Přepnout\ číslování\ řá&dků:set\ nu! menutrans Toggle\ relati&ve\ Line\ Numbering:set\ rnu! Přepnout\ relativní\ číslování\ řá&dků:set\ rnu! menutrans Toggle\ &List\ Mode:set\ list! Přepnout\ &List\ mód:set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! Přepnout\ zala&mování\ řádků:set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! Přepnout\ zl&om\ ve\ slově:set\ lbr! menutrans Toggle\ &expand-tab:set\ et! Přepnout\ &expand-tab:set\ et! menutrans Toggle\ &auto-indent:set\ ai! Přepnout\ &auto-indent:set\ ai! menutrans Toggle\ &C-indenting:set\ cin! Přepnout\ &C-indenting: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 if has("win32") || has("win16") || has("gui_motif") || has("gui_gtk") || has("gui_kde") || has("gui_photon") || has("gui_mac") menutrans Select\ Fo&nt\.\.\. Vybrat\ pís&mo\.\.\. endif " }}}1 " {{{ Programming menu menutrans &Tools Nást&roje menutrans &Jump\ to\ this\ tagg^] &Skočit\ na\ tagg^] menutrans Jump\ &back^T Skočit\ &zpět^T menutrans Build\ &Tags\ File &Vytvořit\ soubor\ tagů if has("spell") menutrans &Spelling &Kontrola\ pravopisu menutrans &Spell\ Check\ On &Zapnout\ kontrolu\ pravopisu menutrans Spell\ Check\ &Off &Vypnout \kontrolu\ pravopisu menutrans To\ &Next\ error]s &Další\ chyba]s menutrans To\ &Previous\ error[s &Předchozí\ chyba[s menutrans Suggest\ &Correctionsz= &Navrhnout\ opravyz= menutrans &Repeat\ correction:spellrepall Zopakovat\ &opravu:spellrepall menutrans Set\ language\ to\ "en" Nastavit\ jazyk\ na\ "en" menutrans Set\ language\ to\ "en_au" Nastavit\ jazyk\ na\ "en_au" menutrans Set\ language\ to\ "en_ca" Nastavit\ jazyk\ na\ "en_ca" menutrans Set\ language\ to\ "en_gb" Nastavit\ jazyk\ na\ "en_gb" menutrans Set\ language\ to\ "en_nz" Nastavit\ jazyk\ na\ "en_nz" menutrans Set\ language\ to\ "en_us" Nastavit\ jazyk\ na\ "en_us" menutrans &Find\ More\ Languages Nalézt\ další\ &jazyky let g:menutrans_set_lang_to = "Nastavit jazyk na" endif if has("Folding") menutrans &Folding &Skládání menutrans &Enable/Disable\ foldszi &Ano/Nezi menutrans &View\ Cursor\ Linezv Zobrazit\ řádek\ &kurzoruzv menutrans Vie&w\ Cursor\ Line\ onlyzMzx Zobrazit\ &pouze\ řádek\ kurzoru\ zMzx menutrans C&lose\ more\ foldszm Složit\ &jednu\ úroveň\ skladůzm menutrans &Close\ all\ foldszM Složit\ všechny\ skladyzM menutrans O&pen\ more\ foldszr Přidat\ jednu\ úroveň\ skladůzr menutrans &Open\ all\ foldszR &Otevřít\ všechny\ skladyzR 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 &Syntaxe menutrans &Diff &Rozdíly menutrans Ma&rker &Značky menutrans Create\ &Foldzf Vytvořit\ &skladzf menutrans &Delete\ Foldzd Vymazat\ skla&dzd menutrans Delete\ &All\ FoldszD Vymazat\ všechny\ skladyzD menutrans Fold\ col&umn\ width Sloupec\ zob&razení\ skladů endif if has("diff") menutrans &Update &Obnovit menutrans &Get\ Block &Sejmout\ Blok menutrans &Put\ Block &Vložit\ Blok endif menutrans &Make:make &Make:make menutrans &List\ Errors:cl Výpis\ &chyb:cl menutrans L&ist\ Messages:cl! Výp&is\ zpráv:cl! menutrans &Next\ Error:cn Další\ ch&yba:cn menutrans &Previous\ Error:cp &Předchozí\ chyba:cp menutrans &Older\ List:cold Sta&rší\ seznam:cold menutrans N&ewer\ List:cnew N&ovější\ seznam:cnew menutrans Error\ &Window Chybové\ o&kno menutrans SeT\ Compiler Nas&tavení\ kompilátoru menutrans &Update:cwin O&bnovit:cwin menutrans &Open:copen &Otevřít:copen menutrans &Close:cclose &Zavřít:cclose menutrans Se&T\ Compiler N&astavit\ kompilátor menutrans &Convert\ to\ HEX:%!xxd Převést\ do\ šestnáctkového\ formát&u:%!xxd menutrans Conve&rt\ back:%!xxd\ -r Př&evést\ zpět:%!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í " }}} " {{{ Menu Window menutrans &Window &Okna menutrans &New^Wn &Nové^Wn menutrans S&plit^Ws &Rozdělit^Ws menutrans Sp&lit\ To\ #^W^^ Ro&zdělit\ na\ #^W^^ menutrans Split\ &Vertically^Wv Rozdělit\ &vertikálně^Wv menutrans Split\ File\ E&xplorer Rozdělit\ -\ File\ E&xplorer menutrans Move\ &To &Přesun menutrans &Top^WK &Nahoru^WK menutrans &Bottom^WJ &Dolu^WJ menutrans &Left\ side^WH &Vlevo^WH menutrans &Right\ side^WL Vp&ravo^WL menutrans &Close^Wc Zavří&t^Wc menutrans Close\ &Other(s)^Wo Zavřít\ &ostatní^Wo menutrans Ne&xt^Ww &Další^Ww menutrans P&revious^WW &Předchozí^WW menutrans &Equal\ Size^W= &Stejná\ výška^W= menutrans &Max\ Height^W_ Maximální\ výš&ka^W_ menutrans M&in\ Height^W1_ M&inimální\ výška^W1_ menutrans Max\ &Width^W\| &Maximální\ šířka^W\| menutrans Min\ Widt&h^W1\| Minimální\ šířk&a^W1\| menutrans Rotate\ &Up^WR Rotovat\ na&horu^WR menutrans Rotate\ &Down^Wr Rotovat\ &dolů^Wr " {{{ Help menu menutrans &Help &Nápověda menutrans &Overview &Přehled 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 &Sponsor/Register Sponzorování/&Registrace 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\ Pa&ragraph Vybrat\ &odstavec menutrans Select\ &Sentence Vybrat\ vě&tu 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 if has("printer") || has("unix") tmenu ToolBar.Print Tisk endif 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 " }}} " {{{ DIALOG TEXTS let g:menutrans_no_file = "[Žádný soubor]" let g:menutrans_help_dialog = "Zadejte hledaný příkaz nebo slovo:\n\n\tPřidejte i_ pro příkazy vkládacího režimu (např. i_CTRL-X)\n\tPřidejte c_ pro příkazy příkazové řádky (např. c_)\n\tPřidejte ' pro jméno volby (např. 'shiftwidth')" let g:menutrans_path_dialog = "Zadejte cesty pro vyhledávání souborů. Jednotlivé cesty oddělte čárkou" let g:menutrans_tags_dialog = "Zadejte jména souborů s tagy. Jména oddělte čárkami." let g:menutrans_textwidth_dialog = "Zadejte délku řádku (0 pro zakázání formátování):" let g:menutrans_fileformat_dialog = "Vyberte typ konce řádků" " }}}" let &cpo = s:keepcpo unlet s:keepcpo " vim:set foldmethod=marker expandtab tabstop=3 shiftwidth=3: vim-7.4.1689/runtime/lang/menu_czech_czech_republic.1250.vim000066400000000000000000000311421267703067000234660ustar00rootroot00000000000000" Menu Translations: Czech (CP1250) " Maintainer: Jiri Sedlak " Previous maintainer: Jiri Brezina " Based on: menu.vim (2012-10-21) " Quit when menu translations have already been done. if exists("did_menu_trans") finish endif let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim scriptencoding cp1250 " {{{ File menu menutrans &File &Soubor menutrans &Open\.\.\.:e &Otevt\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp Otevt\ v\ no&vm\ okn\.\.\.:sp menutrans Open\ Tab\.\.\.:tabnew Otevt\ tab\.\.\.:tabnew menutrans &New:enew &Nov:enew menutrans &Close:close &Zavt:close menutrans &Save:w &Uloit:w menutrans Save\ &As\.\.\.:sav Uloit\ &jako\.\.\.:sav if has("printer") || has("unix") menutrans &Print &Tisk endif menutrans Sa&ve-Exit:wqa U&loit\ a\ ukonit:wqa menutrans E&xit:qa &Ukonit:qa if has("diff") menutrans Split\ &Diff\ with\.\.\. Rozdlit\ okno\ -\ &Diff\.\.\. menutrans Split\ Patched\ &By\.\.\. Rozdlit\ okno\ -\ &Patch\.\.\. endif " }}} " {{{ Edit menu menutrans &Edit pr&avy menutrans &Undou &Zptu menutrans &Redo^R Z&ruit\ vrcen^R menutrans Rep&eat\. &Opakovat\. menutrans Cu&t"+x &Vyznout"+x menutrans &Copy"+y &Koprovat"+y menutrans &Paste"+gP V&loit"+gP menutrans Put\ &Before[p Vloit\ &ped[p menutrans Put\ &After]p Vloi&t\ za]p if has("win32") || has("win16") menutrans &Deletex &Smazatx endif menutrans &Select\ AllggVG Vy&brat\ veggVG if has("win32") || has("win16") || has("gui_gtk") || has("gui_kde") || has("gui_motif") menutrans &Find\.\.\. &Hledat\.\.\. menutrans Find\ and\ Rep&lace\.\.\. &Nahradit\.\.\. else menutrans Find/ &Hledat/ menutrans Find\ and\ Rep&lace:%s &Nahradit:%s menutrans Find\ and\ Rep&lace:s &Nahradit:s endif menutrans Settings\ &Window Nastav&en\ okna " {{{2 Edit -1 menutrans Startup\ &Settings Poten\ &nastaven menutrans &Global\ Settings &Globln\ nastaven menutrans Toggle\ Pattern\ &Highlight:set\ hls! &Pepnout\ zvraznn\ vzoru:set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! Pepnout\ ignorovn\ &VERZLEK:set\ ic! menutrans Toggle\ &Showmatch:set\ sm! Pepnout\ &Showmatch\ \{\(\[\])\}:set\ sm! menutrans &Context\ lines Zobrazit\ konte&xt\ kurzoru menutrans &Virtual\ Edit Virtuln\ p&ozice\ kurzoru menutrans Never Nikdy menutrans Block\ Selection Vbr\ Bloku menutrans Insert\ mode Insert\ md menutrans Block\ and\ Insert Blok\ a\ Insert menutrans Always Vdycky menutrans Toggle\ Insert\ &Mode:set\ im! Pepnout\ Insert\ m&d:set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! Pepnout\ kompatibiln\ reim\ s\ 'vi':set\ cp! menutrans Search\ &Path\.\.\. Nastavit\ &cestu\ k\ prohledvn\.\.\. menutrans Ta&g\ Files\.\.\. Ta&g\ soubory\.\.\. menutrans Toggle\ &Toolbar Pepnout\ &Toolbar menutrans Toggle\ &Bottom\ Scrollbar P&epnout\ doln\ rolovac\ litu menutrans Toggle\ &Left\ Scrollbar Pepnout\ &levou\ rolovac\ litu menutrans Toggle\ &Right\ Scrollbar Pepnout\ p&ravou\ rolovac\ litu " {{{2 Edit -2 menutrans F&ile\ Settings Nastaven\ so&uboru menutrans Toggle\ Line\ &Numbering:set\ nu! Pepnout\ slovn\ &dk:set\ nu! menutrans Toggle\ relati&ve\ Line\ Numbering:set\ rnu! Pepnout\ relativn\ slovn\ &dk:set\ rnu! menutrans Toggle\ &List\ Mode:set\ list! Pepnout\ &List\ md:set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! Pepnout\ zala&movn\ dk:set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! Pepnout\ zl&om\ ve\ slov:set\ lbr! menutrans Toggle\ &expand-tab:set\ et! Pepnout\ &expand-tab:set\ et! menutrans Toggle\ &auto-indent:set\ ai! Pepnout\ &auto-indent:set\ ai! menutrans Toggle\ &C-indenting:set\ cin! Pepnout\ &C-indenting: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\.\.\. &Formt\ souboru\.\.\. " {{{2 Edit -3 menutrans C&olor\ Scheme Barevn\ s&chma menutrans &Keymap Klvesov\ m&apa if has("win32") || has("win16") || has("gui_motif") || has("gui_gtk") || has("gui_kde") || has("gui_photon") || has("gui_mac") menutrans Select\ Fo&nt\.\.\. Vybrat\ ps&mo\.\.\. endif " }}}1 " {{{ Programming menu menutrans &Tools Nst&roje menutrans &Jump\ to\ this\ tagg^] &Skoit\ na\ tagg^] menutrans Jump\ &back^T Skoit\ &zpt^T menutrans Build\ &Tags\ File &Vytvoit\ soubor\ tag if has("spell") menutrans &Spelling &Kontrola\ pravopisu menutrans &Spell\ Check\ On &Zapnout\ kontrolu\ pravopisu menutrans Spell\ Check\ &Off &Vypnout \kontrolu\ pravopisu menutrans To\ &Next\ error]s &Dal\ chyba]s menutrans To\ &Previous\ error[s &Pedchoz\ chyba[s menutrans Suggest\ &Correctionsz= &Navrhnout\ opravyz= menutrans &Repeat\ correction:spellrepall Zopakovat\ &opravu:spellrepall menutrans Set\ language\ to\ "en" Nastavit\ jazyk\ na\ "en" menutrans Set\ language\ to\ "en_au" Nastavit\ jazyk\ na\ "en_au" menutrans Set\ language\ to\ "en_ca" Nastavit\ jazyk\ na\ "en_ca" menutrans Set\ language\ to\ "en_gb" Nastavit\ jazyk\ na\ "en_gb" menutrans Set\ language\ to\ "en_nz" Nastavit\ jazyk\ na\ "en_nz" menutrans Set\ language\ to\ "en_us" Nastavit\ jazyk\ na\ "en_us" menutrans &Find\ More\ Languages Nalzt\ dal\ &jazyky let g:menutrans_set_lang_to = "Nastavit jazyk na" endif if has("Folding") menutrans &Folding &Skldn menutrans &Enable/Disable\ foldszi &Ano/Nezi menutrans &View\ Cursor\ Linezv Zobrazit\ dek\ &kurzoruzv menutrans Vie&w\ Cursor\ Line\ onlyzMzx Zobrazit\ &pouze\ dek\ kurzoru\ zMzx menutrans C&lose\ more\ foldszm Sloit\ &jednu\ rove\ skladzm menutrans &Close\ all\ foldszM Sloit\ vechny\ skladyzM menutrans O&pen\ more\ foldszr Pidat\ jednu\ rove\ skladzr menutrans &Open\ all\ foldszR &Otevt\ vechny\ skladyzR menutrans Fold\ Met&hod &Metoda\ skldn menutrans M&anual &Run menutrans I&ndent &Odsazen menutrans E&xpression &Vraz menutrans S&yntax &Syntaxe menutrans &Diff &Rozdly menutrans Ma&rker &Znaky menutrans Create\ &Foldzf Vytvoit\ &skladzf menutrans &Delete\ Foldzd Vymazat\ skla&dzd menutrans Delete\ &All\ FoldszD Vymazat\ vechny\ skladyzD menutrans Fold\ col&umn\ width Sloupec\ zob&razen\ sklad endif if has("diff") menutrans &Update &Obnovit menutrans &Get\ Block &Sejmout\ Blok menutrans &Put\ Block &Vloit\ Blok endif menutrans &Make:make &Make:make menutrans &List\ Errors:cl Vpis\ &chyb:cl menutrans L&ist\ Messages:cl! Vp&is\ zprv:cl! menutrans &Next\ Error:cn Dal\ ch&yba:cn menutrans &Previous\ Error:cp &Pedchoz\ chyba:cp menutrans &Older\ List:cold Sta&r\ seznam:cold menutrans N&ewer\ List:cnew N&ovj\ seznam:cnew menutrans Error\ &Window Chybov\ o&kno menutrans SeT\ Compiler Nas&taven\ kompiltoru menutrans &Update:cwin O&bnovit:cwin menutrans &Open:copen &Otevt:copen menutrans &Close:cclose &Zavt:cclose menutrans Se&T\ Compiler N&astavit\ kompiltor menutrans &Convert\ to\ HEX:%!xxd Pevst\ do\ estnctkovho\ formt&u:%!xxd menutrans Conve&rt\ back:%!xxd\ -r P&evst\ zpt:%!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 &Run menutrans A&utomatic A&utomaticky menutrans on/off\ for\ &This\ file &Pepnout\ (pro\ tento\ soubor) menutrans o&ff\ (this\ file) vyp&nout\ (pro\ tento\ soubor) menutrans Co&lor\ test Test\ &barev menutrans &Highlight\ test &Test\ zvrazovn menutrans &Convert\ to\ HTML Pevst\ &do\ HTML menutrans &Show\ filetypes\ in\ menu &Zobrazit\ vbr\ monost " }}} " {{{ Menu Buffers menutrans &Buffers &Buffery menutrans &Refresh\ menu &Obnovit\ menu menutrans &Delete Z&ruit menutrans &Alternate &Zmnit menutrans &Next &Dal menutrans &Previous &Pedchoz " }}} " {{{ Menu Window menutrans &Window &Okna menutrans &New^Wn &Nov^Wn menutrans S&plit^Ws &Rozdlit^Ws menutrans Sp&lit\ To\ #^W^^ Ro&zdlit\ na\ #^W^^ menutrans Split\ &Vertically^Wv Rozdlit\ &vertikln^Wv menutrans Split\ File\ E&xplorer Rozdlit\ -\ File\ E&xplorer menutrans Move\ &To &Pesun menutrans &Top^WK &Nahoru^WK menutrans &Bottom^WJ &Dolu^WJ menutrans &Left\ side^WH &Vlevo^WH menutrans &Right\ side^WL Vp&ravo^WL menutrans &Close^Wc Zav&t^Wc menutrans Close\ &Other(s)^Wo Zavt\ &ostatn^Wo menutrans Ne&xt^Ww &Dal^Ww menutrans P&revious^WW &Pedchoz^WW menutrans &Equal\ Size^W= &Stejn\ vka^W= menutrans &Max\ Height^W_ Maximln\ v&ka^W_ menutrans M&in\ Height^W1_ M&inimln\ vka^W1_ menutrans Max\ &Width^W\| &Maximln\ ka^W\| menutrans Min\ Widt&h^W1\| Minimln\ k&a^W1\| menutrans Rotate\ &Up^WR Rotovat\ na&horu^WR menutrans Rotate\ &Down^Wr Rotovat\ &dol^Wr " {{{ Help menu menutrans &Help &Npovda menutrans &Overview &Pehled menutrans &User\ Manual &Uivatelsk\ Manul menutrans &How-to\ links Ho&wto menutrans &GUI &Grafick\ rozhran menutrans &Credits &Autoi menutrans Co&pying &Licenn\ politika menutrans &Sponsor/Register Sponzorovn/&Registrace menutrans &Find\.\.\. &Hledat\.\.\. menutrans O&rphans O&siel\ dti menutrans &Version &Verze menutrans &About &O\ aplikaci " }}} " {{{ The popup menu menutrans &Undo &Zpt menutrans Cu&t &Vyznout menutrans &Copy &Koprovat menutrans &Paste &Vloit menutrans &Delete &Smazat menutrans Select\ Blockwise Vybrat\ blokov menutrans Select\ &Word Vybrat\ &slovo menutrans Select\ Pa&ragraph Vybrat\ &odstavec menutrans Select\ &Sentence Vybrat\ v&tu menutrans Select\ &Line Vybrat\ &dek menutrans Select\ &Block Vybrat\ &blok menutrans Select\ &All Vybrat\ &ve " }}} " {{{ The GUI toolbar if has("toolbar") if exists("*Do_toolbar_tmenu") delfun Do_toolbar_tmenu endif fun Do_toolbar_tmenu() tmenu ToolBar.Open Otevt soubor tmenu ToolBar.Save Uloit soubor tmenu ToolBar.SaveAll Uloit vechny soubory if has("printer") || has("unix") tmenu ToolBar.Print Tisk endif tmenu ToolBar.Undo Zpt tmenu ToolBar.Redo Zruit vrcen tmenu ToolBar.Cut Vyznout tmenu ToolBar.Copy Koprovat tmenu ToolBar.Paste Vloit tmenu ToolBar.Find Hledat... tmenu ToolBar.FindNext Hledat dal tmenu ToolBar.FindPrev Hledat pedchoz tmenu ToolBar.Replace Nahradit... if 0 " disabled; These are in the Windows menu tmenu ToolBar.New Nov okno tmenu ToolBar.WinSplit Rozdlit okno tmenu ToolBar.WinMax Maximalizovat okno tmenu ToolBar.WinMin Minimalizovat okno tmenu ToolBar.WinClose Zavt okno endif tmenu ToolBar.LoadSesn Nast sezen tmenu ToolBar.SaveSesn Uloit sezen tmenu ToolBar.RunScript Spustit skript tmenu ToolBar.Make Spustit make tmenu ToolBar.Shell Spustit shell tmenu ToolBar.RunCtags Spustit ctags tmenu ToolBar.TagJump Skoit na tag pod kurzorem tmenu ToolBar.Help Npovda tmenu ToolBar.FindHelp Hledat npovdu k... endfun endif " }}} " {{{ DIALOG TEXTS let g:menutrans_no_file = "[dn soubor]" let g:menutrans_help_dialog = "Zadejte hledan pkaz nebo slovo:\n\n\tPidejte i_ pro pkazy vkldacho reimu (nap. i_CTRL-X)\n\tPidejte c_ pro pkazy pkazov dky (nap. c_)\n\tPidejte ' pro jmno volby (nap. 'shiftwidth')" let g:menutrans_path_dialog = "Zadejte cesty pro vyhledvn soubor. Jednotliv cesty oddlte rkou" let g:menutrans_tags_dialog = "Zadejte jmna soubor s tagy. Jmna oddlte rkami." let g:menutrans_textwidth_dialog = "Zadejte dlku dku (0 pro zakzn formtovn):" let g:menutrans_fileformat_dialog = "Vyberte typ konce dk" " }}}" let &cpo = s:keepcpo unlet s:keepcpo " vim:set foldmethod=marker expandtab tabstop=3 shiftwidth=3: vim-7.4.1689/runtime/lang/menu_czech_czech_republic.1252.vim000066400000000000000000000001611267703067000234650ustar00rootroot00000000000000" Menu Translations: Czech for Windows in ASCII encoding source :p:h/menu_czech_czech_republic.ascii.vim vim-7.4.1689/runtime/lang/menu_czech_czech_republic.ascii.vim000066400000000000000000000311631267703067000241720ustar00rootroot00000000000000" Menu Translations: Czech (latin1 - w/o diacritics) " Maintainer: Jiri Sedlak " Previous maintainer: Jiri Brezina " Based on: menu.vim (2012-10-21) " Quit when menu translations have already been done. if exists("did_menu_trans") finish endif let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim scriptencoding latin1 " {{{ File menu menutrans &File &Soubor menutrans &Open\.\.\.:e &Otevrit\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp Otevrit\ v\ no&vem\ okne\.\.\.:sp menutrans Open\ Tab\.\.\.:tabnew Otevrit\ tab\.\.\.:tabnew menutrans &New:enew &Novy:enew menutrans &Close:close &Zavrit:close menutrans &Save:w &Ulozit:w menutrans Save\ &As\.\.\.:sav Ulozit\ &jako\.\.\.:sav if has("printer") || has("unix") menutrans &Print &Tisk endif menutrans Sa&ve-Exit:wqa U&lozit\ a\ ukoncit:wqa menutrans E&xit:qa &Ukoncit:qa if has("diff") menutrans Split\ &Diff\ with\.\.\. Rozdelit\ okno\ -\ &Diff\.\.\. menutrans Split\ Patched\ &By\.\.\. Rozdelit\ okno\ -\ &Patch\.\.\. endif " }}} " {{{ Edit menu menutrans &Edit Upr&avy menutrans &Undou &Zpetu menutrans &Redo^R Z&rusit\ vraceni^R menutrans Rep&eat\. &Opakovat\. menutrans Cu&t"+x &Vyriznout"+x menutrans &Copy"+y &Kopirovat"+y menutrans &Paste"+gP V&lozit"+gP menutrans Put\ &Before[p Vlozit\ &pred[p menutrans Put\ &After]p Vlozi&t\ za]p if has("win32") || has("win16") menutrans &Deletex &Smazatx endif menutrans &Select\ AllggVG Vy&brat\ vseggVG if has("win32") || has("win16") || has("gui_gtk") || has("gui_kde") || has("gui_motif") menutrans &Find\.\.\. &Hledat\.\.\. menutrans Find\ and\ Rep&lace\.\.\. &Nahradit\.\.\. else menutrans Find/ &Hledat/ menutrans Find\ and\ Rep&lace:%s &Nahradit:%s menutrans Find\ and\ Rep&lace:s &Nahradit:s endif menutrans Settings\ &Window Nastav&eni\ okna " {{{2 Edit -1 menutrans Startup\ &Settings Pocatecni\ &nastaveni menutrans &Global\ Settings &Globalni\ nastaveni menutrans Toggle\ Pattern\ &Highlight:set\ hls! &Prepnout\ zvyrazneni\ vzoru:set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! Prepnout\ ignorovani\ &VERZALEK:set\ ic! menutrans Toggle\ &Showmatch:set\ sm! Prepnout\ &Showmatch\ \{\(\[\])\}: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:set\ im! Prepnout\ Insert\ mo&d:set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! Prepnout\ kompatibilni\ rezim\ s\ 'vi':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:set\ nu! Prepnout\ cislovani\ ra&dku:set\ nu! menutrans Toggle\ relati&ve\ Line\ Numbering:set\ rnu! Prepnout\ relativni\ cislovani\ ra&dku:set\ rnu! menutrans Toggle\ &List\ Mode:set\ list! Prepnout\ &List\ mod:set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! Prepnout\ zala&movani\ radku:set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! Prepnout\ zl&om\ ve\ slove:set\ lbr! menutrans Toggle\ &expand-tab:set\ et! Prepnout\ &expand-tab:set\ et! menutrans Toggle\ &auto-indent:set\ ai! Prepnout\ &auto-indent:set\ ai! menutrans Toggle\ &C-indenting:set\ cin! Prepnout\ &C-indenting: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 if has("win32") || has("win16") || has("gui_motif") || has("gui_gtk") || has("gui_kde") || has("gui_photon") || has("gui_mac") menutrans Select\ Fo&nt\.\.\. Vybrat\ pis&mo\.\.\. endif " }}}1 " {{{ Programming menu menutrans &Tools Nast&roje menutrans &Jump\ to\ this\ tagg^] &Skocit\ na\ tagg^] menutrans Jump\ &back^T Skocit\ &zpet^T menutrans Build\ &Tags\ File &Vytvorit\ soubor\ tagu if has("spell") menutrans &Spelling &Kontrola\ pravopisu menutrans &Spell\ Check\ On &Zapnout\ kontrolu\ pravopisu menutrans Spell\ Check\ &Off &Vypnout \kontrolu\ pravopisu menutrans To\ &Next\ error]s &Dalsi\ chyba]s menutrans To\ &Previous\ error[s &Predchozi\ chyba[s menutrans Suggest\ &Correctionsz= &Navrhnout\ opravyz= menutrans &Repeat\ correction:spellrepall Zopakovat\ &opravu:spellrepall menutrans Set\ language\ to\ "en" Nastavit\ jazyk\ na\ "en" menutrans Set\ language\ to\ "en_au" Nastavit\ jazyk\ na\ "en_au" menutrans Set\ language\ to\ "en_ca" Nastavit\ jazyk\ na\ "en_ca" menutrans Set\ language\ to\ "en_gb" Nastavit\ jazyk\ na\ "en_gb" menutrans Set\ language\ to\ "en_nz" Nastavit\ jazyk\ na\ "en_nz" menutrans Set\ language\ to\ "en_us" Nastavit\ jazyk\ na\ "en_us" menutrans &Find\ More\ Languages Nalezt\ dalsi\ &jazyky let g:menutrans_set_lang_to = "Nastavit jazyk na" endif if has("Folding") menutrans &Folding &Skladani menutrans &Enable/Disable\ foldszi &Ano/Nezi menutrans &View\ Cursor\ Linezv Zobrazit\ radek\ &kurzoruzv menutrans Vie&w\ Cursor\ Line\ onlyzMzx Zobrazit\ &pouze\ radek\ kurzoru\ zMzx menutrans C&lose\ more\ foldszm Slozit\ &jednu\ uroven\ skladuzm menutrans &Close\ all\ foldszM Slozit\ vsechny\ skladyzM menutrans O&pen\ more\ foldszr Pridat\ jednu\ uroven\ skladuzr menutrans &Open\ all\ foldszR &Otevrit\ vsechny\ skladyzR menutrans Fold\ Met&hod &Metoda\ skladani menutrans M&anual &Rucne menutrans I&ndent &Odsazeni menutrans E&xpression &Vyraz menutrans S&yntax &Syntaxe menutrans &Diff &Rozdily menutrans Ma&rker &Znacky menutrans Create\ &Foldzf Vytvorit\ &skladzf menutrans &Delete\ Foldzd Vymazat\ skla&dzd menutrans Delete\ &All\ FoldszD Vymazat\ vsechny\ skladyzD menutrans Fold\ col&umn\ width Sloupec\ zob&razeni\ skladu endif if has("diff") menutrans &Update &Obnovit menutrans &Get\ Block &Sejmout\ Blok menutrans &Put\ Block &Vlozit\ Blok endif menutrans &Make:make &Make:make menutrans &List\ Errors:cl Vypis\ &chyb:cl menutrans L&ist\ Messages:cl! Vyp&is\ zprav:cl! menutrans &Next\ Error:cn Dalsi\ ch&yba:cn menutrans &Previous\ Error:cp &Predchozi\ chyba:cp menutrans &Older\ List:cold Sta&rsi\ seznam:cold menutrans N&ewer\ List:cnew N&ovejsi\ seznam:cnew menutrans Error\ &Window Chybove\ o&kno menutrans SeT\ Compiler Nas&taveni\ kompilatoru menutrans &Update:cwin O&bnovit:cwin menutrans &Open:copen &Otevrit:copen menutrans &Close:cclose &Zavrit:cclose menutrans Se&T\ Compiler N&astavit\ kompilator menutrans &Convert\ to\ HEX:%!xxd Prevest\ do\ sestnactkoveho\ format&u:%!xxd menutrans Conve&rt\ back:%!xxd\ -r Pr&evest\ zpet:%!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 " }}} " {{{ Menu Window menutrans &Window &Okna menutrans &New^Wn &Nove^Wn menutrans S&plit^Ws &Rozdelit^Ws menutrans Sp&lit\ To\ #^W^^ Ro&zdelit\ na\ #^W^^ menutrans Split\ &Vertically^Wv Rozdelit\ &vertikalne^Wv menutrans Split\ File\ E&xplorer Rozdelit\ -\ File\ E&xplorer menutrans Move\ &To &Presun menutrans &Top^WK &Nahoru^WK menutrans &Bottom^WJ &Dolu^WJ menutrans &Left\ side^WH &Vlevo^WH menutrans &Right\ side^WL Vp&ravo^WL menutrans &Close^Wc Zavri&t^Wc menutrans Close\ &Other(s)^Wo Zavrit\ &ostatni^Wo menutrans Ne&xt^Ww &Dalsi^Ww menutrans P&revious^WW &Predchozi^WW menutrans &Equal\ Size^W= &Stejna\ vyska^W= menutrans &Max\ Height^W_ Maximalni\ vys&ka^W_ menutrans M&in\ Height^W1_ M&inimalni\ vyska^W1_ menutrans Max\ &Width^W\| &Maximalni\ sirka^W\| menutrans Min\ Widt&h^W1\| Minimalni\ sirk&a^W1\| menutrans Rotate\ &Up^WR Rotovat\ na&horu^WR menutrans Rotate\ &Down^Wr Rotovat\ &dolu^Wr " {{{ Help menu menutrans &Help &Napoveda menutrans &Overview &Prehled menutrans &User\ Manual &Uzivatelsky\ Manual menutrans &How-to\ links Ho&wto menutrans &GUI &Graficke\ rozhrani menutrans &Credits &Autori menutrans Co&pying &Licencni\ politika menutrans &Sponsor/Register Sponzorovani/&Registrace 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\ Pa&ragraph Vybrat\ &odstavec menutrans Select\ &Sentence Vybrat\ ve&tu 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 if has("printer") || has("unix") tmenu ToolBar.Print Tisk endif 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 " }}} " {{{ DIALOG TEXTS let g:menutrans_no_file = "[Zadny soubor]" let g:menutrans_help_dialog = "Zadejte hledany prikaz nebo slovo:\n\n\tPridejte i_ pro prikazy vkladaciho rezimu (napr. i_CTRL-X)\n\tPridejte c_ pro prikazy prikazove radky (napr. c_)\n\tPridejte ' pro jmeno volby (napr. 'shiftwidth')" let g:menutrans_path_dialog = "Zadejte cesty pro vyhledavani souboru. Jednotlive cesty oddelte carkou" let g:menutrans_tags_dialog = "Zadejte jmena souboru s tagy. Jmena oddelte carkami." let g:menutrans_textwidth_dialog = "Zadejte delku radku (0 pro zakazani formatovani):" let g:menutrans_fileformat_dialog = "Vyberte typ konce radku" " }}}" let &cpo = s:keepcpo unlet s:keepcpo " vim:set foldmethod=marker expandtab tabstop=3 shiftwidth=3: vim-7.4.1689/runtime/lang/menu_de.latin1.vim000066400000000000000000000001361267703067000205210ustar00rootroot00000000000000" Menu Translations: German for iso-8859-1 encoding source :p:h/menu_de_de.latin1.vim vim-7.4.1689/runtime/lang/menu_de.utf-8.vim000066400000000000000000000001311267703067000202670ustar00rootroot00000000000000" Menu Translations: German for UTF-8 encoding source :p:h/menu_de_de.latin1.vim vim-7.4.1689/runtime/lang/menu_de_de.latin1.vim000066400000000000000000000324271267703067000212010ustar00rootroot00000000000000" Menu Translations: German / Deutsch " Maintainer: Georg Dahn " Originally By: Marcin Dalecki " Johannes Zellner " Last Change: Sat, 11 Mar 2006 22:40:00 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 let s:keepcpo= &cpo set cpo&vim " 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\.\.\.:e &ffnen\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp In\ geteiltem\ &Fenster\ ffnen\.\.\.:sp menutrans Open\ Tab\.\.\.:tabnew In\ neuem\ &Tab\ ffnen\.\.\.:tabnew menutrans &New:enew &Neue\ Datei:enew menutrans &Close:close S&chlieen:close menutrans &Save:w &Speichern:w menutrans Save\ &As\.\.\.:sav Speichern\ &als\.\.\.:sav menutrans &Print &Drucken menutrans Sa&ve-Exit:wqa Speichern\ und\ Be&enden:wqa menutrans E&xit:qa &Beenden: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 &Undou Z&urcku menutrans &Redo^R Vo&r^R menutrans Rep&eat\. &Wiederholen\. menutrans Cu&t"+x &Ausschneiden"+x menutrans &Copy"+y &Kopieren"+y menutrans &Paste"+gP Ein&fgen"+gP menutrans Put\ &Before[p Da&vor\ einfgen[p menutrans Put\ &After]p Da&nach\ einfgen]p menutrans &Deletex &Lschenx menutrans &Select\ AllggVG Alles\ &markierenggVG 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 Startup\ &Settings &Starteinstellungen menutrans Toggle\ Pattern\ &Highlight:set\ hls! &Hervorhebungen\ ein-\ und\ ausschalten:set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! Groschreibung\ &ignorieren\ oder\ benutzen:set\ ic! menutrans Toggle\ &Showmatch:set\ sm! Anzeige\ des\ passenden\ &Symbols\ ein-\ und\ ausschalten:set\ sm! menutrans &Context\ lines &Zusammenhang menutrans &Virtual\ Edit &Virtueller\ Editier-Modus menutrans Never Nie menutrans Block\ Selection Block-Auswahl menutrans Insert\ mode Einfge-Modus menutrans Block\ and\ Insert Block-Auswahl\ und\ Einfge-Modus menutrans Always Immer menutrans Toggle\ Insert\ &Mode:set\ im! Einfge-&Modus\ ein-\ und\ ausschalten:set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! Vi-Kompatibilitt\ ein-\ und\ ausschalten: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:set\ nu! Anzeige\ der\ Zeilen&nummer\ ein-\ und\ ausschalten:set\ nu! menutrans Toggle\ relati&ve\ Line\ Numbering:set\ rnu! Anzeige\ der\ relati&ven\ Zeilennummer\ ein-\ und\ ausschalten:set\ rnu! menutrans Toggle\ &List\ Mode:set\ list! &List-Modus\ ein-\ und\ ausschalten:set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! &Zeilenumbruch\ ein-\ und\ ausschalten:set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! Umbruch\ an\ &Wortgrenzen\ ein-\ und\ ausschalten:set\ lbr! menutrans Toggle\ &expand-tab:set\ et! &Erweiterung\ von\ Tabulatoren\ ein-\ und\ ausschalten:set\ et! menutrans Toggle\ &auto-indent:set\ ai! &Automatische\ Einrckung\ ein-\ und\ ausschalten:set\ ai! menutrans Toggle\ &C-indenting:set\ cin! &C-Einrckung\ ein-\ und\ ausschalten:set\ cin! " other options menutrans &Shiftwidth &Schiebeweite menutrans Soft\ &Tabstop &Tabulator menutrans Te&xt\ Width\.\.\. Te&xtbreite\.\.\. menutrans &File\ Format\.\.\. &Dateiformat\.\.\. menutrans C&olor\ Scheme F&arbschema\.\.\. menutrans &Keymap &Tastaturbelegung " }}} EDIT / EDITIEREN " {{{ TOOLS / WERKZEUGE if has("spell") menutrans &Spelling &Rechtschreibung menutrans &Spell\ Check\ On &Rechtschreibprfung\ an menutrans Spell\ Check\ &Off Rechtschreibprfung\ &aus menutrans To\ &Next\ error]s Zum\ &nchsten\ Fehler]s menutrans To\ &Previous\ error[s Zum\ &vorherigen\ Fehler[s menutrans Suggest\ &Correctionsz= &Korrekturvorschlgez= menutrans &Repeat\ correction:spellrepall &Wiederhole\ Korrektur:spellrepall menutrans Set\ language\ to\ "en" Verwende\ Wrterbuch\ "en" menutrans Set\ language\ to\ "en_au" Verwende\ Wrterbuch\ "en_au" menutrans Set\ language\ to\ "en_ca" Verwende\ Wrterbuch\ "en_ca" menutrans Set\ language\ to\ "en_gb" Verwende\ Wrterbuch\ "en_gb" menutrans Set\ language\ to\ "en_nz" Verwende\ Wrterbuch\ "en_nz" menutrans Set\ language\ to\ "en_us" Verwende\ Wrterbuch\ "en_us" menutrans Set\ language\ to\ "de" Verwende\ Wrterbuch\ "de" menutrans &Find\ More\ Languages &Suche\ nach\ Wrterbchern endif if has("folding") menutrans &Folding Fa<ung " open close folds menutrans &Enable/Disable\ foldszi &Ein-\ und\ ausschaltenzi menutrans &View\ Cursor\ Linezv Momentane\ &Position\ anzeigenzv menutrans Vie&w\ Cursor\ Line\ onlyzMzx &Ausschlielich\ momentane\ Position\ anzeigenzMzx menutrans C&lose\ more\ foldszm Faltungen\ &schlieenzm menutrans &Close\ all\ foldszM Alle\ Faltungen\ schlieenzM menutrans O&pen\ more\ foldszr Faltungen\ &ffnenzr menutrans &Open\ all\ foldszR Alle\ Faltungen\ ffnenzR " fold method menutrans Fold\ Met&hod Faltungs-&Methode menutrans M&anual &Manuell menutrans I&ndent &Einrckungen menutrans E&xpression &Ausdruck menutrans S&yntax &Syntax menutrans &Diff &Differenz menutrans Ma&rker Ma&rkierungen " create and delete folds " TODO accelerators menutrans Create\ &Foldzf Faltung\ erzeugenzf menutrans &Delete\ Foldzd Faltung\ lschenzd menutrans Delete\ &All\ FoldszD Alle\ Faltungen\ lschenzD " moving around in folds menutrans Fold\ column\ &width &Breite\ der\ Faltungsspalte endif " has folding if has("diff") menutrans &Diff &Differenz menutrans &Update &Aktualisieren menutrans &Get\ Block Block\ &einfgen menutrans &Put\ Block Block\ &bertragen endif menutrans &Tools &Werkzeuge menutrans &Jump\ to\ this\ tagg^] &Springe\ zum\ Tagg^] menutrans Jump\ &back^T Springe\ &zurck^T menutrans Build\ &Tags\ File Erstelle\ &Tag-Datei menutrans &Make:make &Erstellen:make menutrans &List\ Errors:cl &Fehler\ anzeigen:cl menutrans L&ist\ Messages:cl! &Hinweise\ anzeigen:cl! menutrans &Next\ Error:cn Zum\ &nchsten\ Fehler:cn menutrans &Previous\ Error:cp Zum\ &vorherigen\ Fehler:cp menutrans &Older\ List:cold <ere\ Liste:cold menutrans N&ewer\ List:cnew &Neuere\ Liste:cnew menutrans Error\ &Window Feh&ler-Fenster menutrans Se&t\ Compiler &Compiler menutrans Se&T\ Compiler &Compiler menutrans &Update:cwin &Aktualisieren:cwin menutrans &Open:copen &ffnen:copen menutrans &Close:cclose &Schlieen:cclose menutrans &Convert\ to\ HEX:%!xxd Nach\ HE&X\ konvertieren:%!xxd menutrans Conve&rt\ back:%!xxd\ -r Zurck\ konvertieren:%!xxd\ -r " }}} TOOLS / WERKZEUGE " {{{ SYNTAX / SYNTAX menutrans &Syntax &Syntax menutrans &Show\ filetypes\ in\ menu Dateitypen\ an&zeigen 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 Lschen menutrans &Alternate &Wechseln menutrans &Next &Nchster menutrans &Previous &Vorheriger " }}} BUFFERS / PUFFER " {{{ WINDOW / ANSICHT menutrans &Window &Ansicht menutrans &New^Wn &Neu^Wn menutrans S&plit^Ws Aufs&palten^Ws menutrans Split\ &Vertically^Wv &Vertikal\ aufspalten^Wv menutrans Split\ File\ E&xplorer Ver&zeichnis menutrans Sp&lit\ To\ #^W^^ Aufspa<en\ in\ #^W^^ menutrans &Close^Wc &Schlieen^Wc menutrans Close\ &Other(s)^Wo &Andere\ schlieen^Wo menutrans Ne&xt^Ww N&chstes^Ww menutrans P&revious^WW Vor&heriges^WW menutrans &Equal\ Size^W= &Gleiche\ Hhen^W= menutrans &Max\ Height^W_ &Maximale\ Hhe^W_ menutrans M&in\ Height^W1_ M&inimale\ Hhe^W1_ menutrans Max\ &Width^W\| Maximale\ &Breite^W\| menutrans Min\ Widt&h^W1\| Minimale\ Brei&te^W1\| menutrans Move\ &To V&erschiebe\ nach menutrans &Top^WK &Oben^WK menutrans &Bottom^WJ &Unten^WJ menutrans &Left\ side^WH &Links^WH menutrans &Right\ side^WL &Rechts^WL menutrans Rotate\ &Up^WR Rotiere\ nach\ &oben^WR menutrans Rotate\ &Down^Wr Rotiere\ nach\ &unten^Wr menutrans Select\ Fo&nt\.\.\. Auswahl\ der\ Schriftart\.\.\. " }}} WINDOW / ANSICHT " {{{ HELP / HILFE menutrans &Help &Hilfe menutrans &Overview &berblick menutrans &User\ Manual &Handbuch menutrans &How-to\ links How-to\ &Index menutrans &GUI &Graphische\ Oberflche 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 &Zurck menutrans Cu&t Aus&schneiden menutrans &Copy &Kopieren menutrans &Paste &Einfgen menutrans &Delete &Lschen menutrans Select\ Blockwise Auswahl\ blockartig menutrans Select\ &Word Auswahl\ des\ &Wortes menutrans Select\ &Sentence Auswahl\ des\ Sa&tzes menutrans Select\ Pa&ragraph Auswahl\ des\ Absatzes menutrans Select\ &Line Auswahl\ der\ &Zeile menutrans Select\ &Block Auswahl\ des\ &Blocks menutrans Select\ &All &Alles\ Auswhlen " }}} 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 Zurck tmenu ToolBar.Redo Wiederholen tmenu ToolBar.Cut Ausschneiden tmenu ToolBar.Copy Kopieren tmenu ToolBar.Paste Einfgen tmenu ToolBar.Find Suchen... tmenu ToolBar.FindNext Suche nchsten 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 Hhen tmenu ToolBar.WinMin Ansicht minimale Hhen tmenu ToolBar.WinClose Ansicht schlieen endif tmenu ToolBar.LoadSesn Sitzung laden tmenu ToolBar.SaveSesn Sitzung speichern tmenu ToolBar.RunScript Vim-Skript ausfhren tmenu ToolBar.Make Erstellen tmenu ToolBar.Shell Shell starten tmenu ToolBar.RunCtags Erstelle Tag-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, fr das Sie Hilfe bentigen:\n\nVerwenden Sie i_ fr Eingabe ('input') Befehle (z.B.: i_CTRL-X)\nVerwenden Sie c_ fr Befehls-Zeilen ('command-line') Befehle (z.B.: c_)\nVerwenden Sie ' fr Options-Namen (z.B.: 'shiftwidth')" let g:menutrans_path_dialog = "Geben Sie Such-Pfade fr 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 = "Whlen Sie ein Datei-Format aus" " }}} let &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/lang/menu_de_de.utf-8.vim000066400000000000000000000001311267703067000207370ustar00rootroot00000000000000" Menu Translations: German for UTF-8 encoding source :p:h/menu_de_de.latin1.vim vim-7.4.1689/runtime/lang/menu_en_gb.latin1.vim000066400000000000000000000007441267703067000212100ustar00rootroot00000000000000" Menu Translations: UK English " Maintainer: Mike Williams " 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 vim-7.4.1689/runtime/lang/menu_en_gb.utf-8.vim000066400000000000000000000001121267703067000207500ustar00rootroot00000000000000" Menu Translations: UK English source :p:h/menu_en_gb.latin1.vim vim-7.4.1689/runtime/lang/menu_english_united_kingdom.1252.vim000066400000000000000000000001241267703067000240400ustar00rootroot00000000000000" Menu Translations: UK English for ASCII source :p:h/menu_en_gb.latin1.vim vim-7.4.1689/runtime/lang/menu_english_united_kingdom.ascii.vim000066400000000000000000000001241267703067000245370ustar00rootroot00000000000000" Menu Translations: UK English for ASCII source :p:h/menu_en_gb.latin1.vim vim-7.4.1689/runtime/lang/menu_eo.utf-8.vim000066400000000000000000000426231267703067000203160ustar00rootroot00000000000000" Menu Translations: Esperanto " Maintainer: Dominique PELLE " Last Change: 2012 May 01 " " Quit when menu translations have already been done. if exists("did_menu_trans") finish endif let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim scriptencoding utf-8 menutrans &Help &Helpo menutrans &Overview &Enhavtabelo menutrans &User\ Manual &Uzula\ manlibro menutrans &How-to\ links &Kiel\ fari menutrans &Find\.\.\. T&rovi\.\.\. " -sep1- menutrans &Credits &Dankoj menutrans Co&pying &Permisilo menutrans &Sponsor/Register &Subteni/Registriĝi menutrans O&rphans &Orfoj " -sep2- menutrans &Version &Versio menutrans &About Pri\ &Vim let g:menutrans_help_dialog = "Tajpu komandon aŭ serĉendan vorton en la helparo.\n\nAldonu i_ por la komandoj de la enmeta reĝimo (ekz: i_CTRL-X)\nAldonu c_ por redakto de la komanda linio (ekz: c_)\nĈirkaŭi la opciojn per apostrofoj (ekz: 'shiftwidth')" menutrans &File &Dosiero menutrans &Open\.\.\.:e &Malfermi\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp Malfermi\ ÷\.\.\.:sp menutrans Open\ Tab\.\.\.:tabnew Malfermi\ &langeton\.\.\.:tabnew menutrans &New:enew &Nova:enew menutrans &Close:close &Fermi:close " -SEP1- menutrans &Save:w &Konservi:w menutrans Save\ &As\.\.\.:sav Konservi\ ki&el\.\.\.:sav " -SEP2- menutrans Split\ &Diff\ with\.\.\. Kom&pari\ divide\.\.\. menutrans Split\ Patched\ &By\.\.\. &Testi\ flikaĵon\.\.\. " -SEP3- menutrans &Print &Presi " -SEP4- menutrans Sa&ve-Exit:wqa Konservi\ kaj\ eli&ri:wqa menutrans E&xit:qa &Eliri:qa menutrans &Edit &Redakti menutrans &Undou &Malfariu menutrans &Redo^R Re&fari^R menutrans Rep&eat\. R&ipeti\. " -SEP1- menutrans Cu&t"+x &Tondi"+x menutrans &Copy"+y &Kopii"+y menutrans &Paste"+gP Al&glui"+gP menutrans Put\ &Before[p Enmeti\ &antaŭ[p menutrans Put\ &After]p Enmeti\ ma&lantaŭ]p menutrans &Deletex &Forviŝix menutrans &Select\ AllggVG A&partigi\ ĉionggVG " -SEP2- menutrans &Find\.\.\. &Trovi\.\.\. menutrans Find\ and\ Rep&lace\.\.\. Trovi\ kaj\ a&nstataŭigi\.\.\. menutrans &Find/ &Trovi/ menutrans Find\ and\ Rep&lace:%s Trovi\ kaj\ ansta&taŭigi:%s menutrans Find\ and\ Rep&lace:s Trovi\ kaj\ ansta&taŭigi:s " -SEP3- menutrans Settings\ &Window Fenestro\ de\ a&gordoj menutrans Startup\ &Settings Agordoj\ de\ prav&aloroj menutrans &Global\ Settings Mallo&kaj\ agordoj menutrans Toggle\ Pattern\ &Highlight:set\ hls! Baskuli\ emfazon\ de\ ŝa&blono:set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! Baskuli\ kongruon\ de\ uskle&co:set\ ic! menutrans Toggle\ &Showmatch:set\ sm! Baskuli\ kongruon\ de\ kram&poj:set\ sm! menutrans &Context\ lines Linioj\ de\ &kunteksto menutrans &Virtual\ Edit &Virtuala\ redakto menutrans Never &Neniam menutrans Block\ Selection &Bloka\ apartigo menutrans Insert\ mode &Enmeta\ reĝimo menutrans Block\ and\ Insert Blo&ko\ kaj\ enmeto menutrans Always Ĉia&m menutrans Toggle\ Insert\ &Mode:set\ im! Baskuli\ &enmetan\ reĝimon:set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! Baskuli\ kongruon\ kun\ &Vi:set\ cp! menutrans Search\ &Path\.\.\. &Serĉvojo\ de\ dosieroj\.\.\. menutrans Ta&g\ Files\.\.\. Dosiero\ de\ etike&doj\.\.\. " -SEP1- menutrans Toggle\ &Toolbar Baskuli\ &ilobreton menutrans Toggle\ &Bottom\ Scrollbar Baskuli\ su&ban\ rulumskalon menutrans Toggle\ &Left\ Scrollbar Baskuli\ &maldekstran\ rulumskalon menutrans Toggle\ &Right\ Scrollbar Baskuli\ &dekstran\ rulumskalon let g:menutrans_path_dialog = "Tajpu la vojon de serĉo de dosieroj.\nDisigu la dosierujojn per komoj." let g:menutrans_tags_dialog = "Tajpu la nomojn de dosieroj de etikedoj.\nDisigu la nomojn per komoj." menutrans F&ile\ Settings A&gordoj\ de\ dosiero menutrans Toggle\ Line\ &Numbering:set\ nu! Baskuli\ &numerojn\ de\ linioj:set\ nu! menutrans Toggle\ &List\ Mode:set\ list! Baskuli\ &listan\ reĝimon:set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! Baskuli\ linifal&don:set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! Baskuli\ &vortofaldon:set\ lbr! menutrans Toggle\ &expand-tab:set\ et! Baskuli\ ekspansio\ de\ &taboj:set\ et! menutrans Toggle\ &auto-indent:set\ ai! Baskuli\ &aŭtokrommarĝenon:set\ ai! menutrans Toggle\ &C-indenting:set\ cin! Baskuli\ &C-krommarĝenon:set\ cin! " -SEP2- menutrans &Shiftwidth &Larĝo\ de\ krommarĝeno menutrans Soft\ &Tabstop &Malm&olaj\ taboj menutrans Te&xt\ Width\.\.\. Larĝo\ de\ te&ksto\.\.\. menutrans &File\ Format\.\.\. &Formato\ de\ &dosiero\.\.\. let g:menutrans_textwidth_dialog = "Tajpu la novan larĝon de teksto\n(0 por malŝalti formatigon)." let g:menutrans_fileformat_dialog = "Elektu la formaton de la skribonta dosiero." let g:menutrans_fileformat_choices = " &Unikso \n &Dos \n &Mak \n &Rezigni " menutrans C&olor\ Scheme &Koloraro menutrans &Keymap Klavo&mapo menutrans None (nenio) menutrans Select\ Fo&nt\.\.\. Elekti\ &tiparon\.\.\. menutrans &Tools &Iloj menutrans &Jump\ to\ this\ tagg^] &Aliri\ al\ tiu\ etikedog^] menutrans Jump\ &back^T &Retroiri^T menutrans Build\ &Tags\ File Krei\ &etikedan\ dosieron " -SEP1- menutrans &Spelling &Literumilo menutrans &Spell\ Check\ On Ŝal&ti\ literumilon menutrans Spell\ Check\ &Off &Malŝalti\ literumilon menutrans To\ &Next\ error]s Al\ sek&vonta\ eraro]s menutrans To\ &Previous\ error[s Al\ an&taŭa\ eraro[s menutrans Suggest\ &Correctionsz= &Sugesti\ korektojnz= menutrans &Repeat\ correction:spellrepall R&ipeti\ korekton:spellrepall menutrans Set\ language\ to\ "en" Angla menutrans Set\ language\ to\ "en_au" Angla\ (Aŭstralio) menutrans Set\ language\ to\ "en_ca" Angla\ (Kanado) menutrans Set\ language\ to\ "en_gb" Angla\ (Britio) menutrans Set\ language\ to\ "en_nz" Angla\ (Novzelando) menutrans Set\ language\ to\ "en_us" Angla\ (Usono) menutrans &Find\ More\ Languages &Trovi\ pli\ da\ lingvoj menutrans &Folding &Faldo menutrans &Enable/Disable\ foldszi &Baskuli\ faldojnzi menutrans &View\ Cursor\ Linezv &Vidi\ linion\ de\ kursorozv menutrans Vie&w\ Cursor\ Line\ onlyzMzx Vidi\ nur\ &kursoran\ linionzMzx menutrans C&lose\ more\ foldszm F&ermi\ pli\ da\ faldojzm menutrans &Close\ all\ foldszM Fermi\ ĉiu&jn\ faldojnzM menutrans O&pen\ more\ foldszr &Malfermi\ pli\ da\ faldojzr menutrans &Open\ all\ foldszR Malfermi\ ĉiuj&n\ faldojnzR " -SEP1- menutrans Fold\ Met&hod &Metodo\ de\ faldo menutrans M&anual &Permana\ metodo menutrans I&ndent &Krommarĝeno menutrans E&xpression &Esprimo menutrans S&yntax &Sintakso menutrans &Diff &Komparo menutrans Ma&rker Ma&rko menutrans Create\ &Foldzf &Krei\ faldonzf menutrans &Delete\ Foldzd Forv&iŝi\ faldonzd menutrans Delete\ &All\ FoldszD Forviŝi\ ĉiu&jn\ faldojnzD " -SEP2- menutrans Fold\ col&umn\ width &Larĝo\ de\ falda\ kolumno menutrans &Diff Kom&pari menutrans &Update Ĝis&datigi menutrans &Get\ Block &Akiri\ blokon menutrans &Put\ Block Enme&ti\ blokon " -SEP2- menutrans &Make:make Lanĉi\ ma&ke:make menutrans &List\ Errors:cl Listigi\ &erarojn:cl menutrans L&ist\ Messages:cl! Listigi\ &mesaĝojn:cl! menutrans &Next\ Error:cn Sek&vanta\ eraro:cn menutrans &Previous\ Error:cp An&taŭa\ eraro:cp menutrans &Older\ List:cold Pli\ ma&lnova\ listo:cold menutrans N&ewer\ List:cnew Pli\ nova\ listo:cnew menutrans Error\ &Window &Fenestro\ de\ eraroj menutrans &Update:cwin Ĝis&datigi:cwin menutrans &Open:copen &Malfermi:copen menutrans &Close:cclose &Fermi:cclose " -SEP3- menutrans &Convert\ to\ HEX:%!xxd Konverti\ al\ deksesuma:%!xxd menutrans Conve&rt\ back:%!xxd\ -r Retrokonverti:%!xxd\ -r menutrans Se&T\ Compiler &Elekti\ kompililon menutrans &Buffers &Bufroj menutrans Dummy Fikcia menutrans &Refresh\ menu Ĝis&datigi\ menuon menutrans &Delete &Forviŝi menutrans &Alternate &Alterni menutrans &Next &Sekvanta menutrans &Previous An&taŭa " -SEP- menutrans &others a&liaj menutrans &u-z &u-z let g:menutrans_no_file = "[Neniu dosiero]" menutrans &Window Fene&stro menutrans &New^Wn &Nova^Wn menutrans S&plit^Ws Di&vidi^Ws menutrans Sp&lit\ To\ #^W^^ Dividi\ &al\ #^W^^ menutrans Split\ &Vertically^Wv Dividi\ &vertikale^Wv menutrans Split\ File\ E&xplorer Dividi\ &dosierfoliumilo " -SEP1- menutrans &Close^Wc &Fermi^Wc menutrans Close\ &Other(s)^Wo Fermi\ &aliajn^Wo " -SEP2- menutrans Move\ &To &Movu\ al menutrans &Top^WK Su&pro^WK menutrans &Bottom^WJ Su&bo^WJ menutrans &Left\ side^WH Maldekstra\ &flanko^WH menutrans &Right\ side^WL Dekstra\ f&lanko^WL menutrans Rotate\ &Up^WR Rota&cii\ supre^WR menutrans Rotate\ &Down^Wr Rotac&ii\ sube^Wr " -SEP3- menutrans &Equal\ Size^W= &Egala\ grando^W= menutrans &Max\ Height^W_ Ma&ksimuma\ alto^W_ menutrans M&in\ Height^W1_ Mi&nimuma\ alto^W1_ menutrans Max\ &Width^W\| Maksimuma\ &larĝo^W\| menutrans Min\ Widt&h^W1\| Minimuma\ lar&ĝo^W1\| " PopUp menutrans &Undo &Malfari " -SEP1- menutrans Cu&t &Tondi menutrans &Copy &Kopii menutrans &Paste &Al&glui " &Buffers.&Delete overwrites this one menutrans &Delete &Forviŝi " -SEP2- menutrans Select\ Blockwise Apartigi\ &bloke menutrans Select\ &Word Apartigi\ &vorton menutrans Select\ &Line Apartigi\ &linion menutrans Select\ &Block Apartigi\ blo&kon menutrans Select\ &All Apartigi\ ĉi&on " ToolBar menutrans Open Malfermi menutrans Save Konservi menutrans SaveAll Konservi\ ĉion menutrans Print Presi " -sep1- menutrans Undo Rezigni menutrans Redo Refari " -sep2- menutrans Cut Tondi menutrans Copy Kopii menutrans Paste Alglui " -sep3- menutrans Find Trovi menutrans FindNext Trovi\ sekvanten menutrans FindPrev Trovi\ antaŭen menutrans Replace Anstataŭigi " -sep4- menutrans New Nova menutrans WinSplit DividFen menutrans WinMax MaksFen menutrans WinMin MinFen menutrans WinVSplit VDividFen menutrans WinMaxWidth MaksLarĝFen menutrans WinMinWidth MinLarĝFen menutrans WinClose FermFen " -sep5- menutrans LoadSesn ŜargSeanc menutrans SaveSesn KonsSeanc menutrans RunScript LanĉSkript " -sep6- menutrans Make Make menutrans RunCtags KreiEtik menutrans TagJump IriAlEtik " -sep7- menutrans Help Helpo menutrans FindHelp SerĉHelp fun! Do_toolbar_tmenu() let did_toolbar_tmenu = 1 tmenu ToolBar.Open Malfermi dosieron tmenu ToolBar.Save Konservi aktualan dosieron tmenu ToolBar.SaveAll Konservi ĉiujn dosierojn tmenu ToolBar.Print Presi tmenu ToolBar.Undo Rezigni tmenu ToolBar.Redo Refari tmenu ToolBar.Cut Tondi tmenu ToolBar.Copy Kopii tmenu ToolBar.Paste Alglui if !has("gui_athena") tmenu ToolBar.Find Trovi tmenu ToolBar.FindNext Trovi sekvanten tmenu ToolBar.FindPrev Trovi antaŭen tmenu ToolBar.Replace Anstataŭigi endif if 0 " disabled; These are in the Windows menu tmenu ToolBar.New Nova fenestro tmenu ToolBar.WinSplit Dividi fenestron tmenu ToolBar.WinMax Maksimumi fenestron tmenu ToolBar.WinMin Minimumi fenestron tmenu ToolBar.WinVSplit Dividi vertikale tmenu ToolBar.WinMaxWidth Maksimumi larĝon de fenestro tmenu ToolBar.WinMinWidth Minimumi larĝon de fenestro tmenu ToolBar.WinClose Fermi fenestron endif tmenu ToolBar.LoadSesn Malfermi seancon tmenu ToolBar.SaveSesn Konservi aktualan seancon tmenu ToolBar.RunScript Ruli skripton Vim tmenu ToolBar.Make Lanĉi make tmenu ToolBar.RunCtags Krei etikedojn tmenu ToolBar.TagJump Atingi tiun etikedon tmenu ToolBar.Help Helpo de Vim tmenu ToolBar.FindHelp Serĉo en helparo endfun menutrans &Syntax &Sintakso menutrans &Off &Malŝalti menutrans &Manual &Permana menutrans A&utomatic &Aŭtomata menutrans on/off\ for\ &This\ file Ŝalti/Malŝalti\ por\ &tiu\ dosiero " The Start Of The Syntax Menu menutrans ABC\ music\ notation ABC\ (muzika\ notacio) menutrans AceDB\ model Modelo\ AceDB menutrans Apache\ config Konfiguro\ de\ Apache menutrans Apache-style\ config Konfiguro\ de\ stilo\ Apache menutrans ASP\ with\ VBScript ASP\ kun\ VBScript menutrans ASP\ with\ Perl ASP\ kun\ Perl menutrans Assembly Asemblilo menutrans BC\ calculator Kalkulilo\ BC menutrans BDF\ font Tiparo\ BDF menutrans BIND\ config Konfiguro\ de\ BIND menutrans BIND\ zone Zone\ BIND menutrans Cascading\ Style\ Sheets CSS menutrans Cfg\ Config\ file Konfigura\ dosiero\ \.cfg menutrans Cheetah\ template Ŝablono\ Cheetah menutrans commit\ file Dosiero\ commit menutrans Generic\ Config\ file Dosiero\ de\ ĝenerala\ konfiguro menutrans Digital\ Command\ Lang DCL menutrans DNS/BIND\ zone Regiono\ BIND/DNS menutrans Dylan\ interface Interfaco\ Dylan menutrans Dylan\ lid Dylan\ lid menutrans Elm\ filter\ rules Reguloj\ de\ filtrado\ Elm menutrans ERicsson\ LANGuage Erlang\ (Lingvo\ de\ Ericsson) menutrans Essbase\ script Skripto\ Essbase menutrans Eterm\ config Konfiguro\ de\ Eterm menutrans Exim\ conf Konfiguro\ de\ Exim menutrans Fvwm\ configuration Konfiguro\ de\ Fvwm menutrans Fvwm2\ configuration Konfiguro\ de\ Fvwm2 menutrans Fvwm2\ configuration\ with\ M4 Konfiguro\ de\ Fvwm2\ kun\ M4 menutrans GDB\ command\ file Komanda\ dosiero\ de\ GDB menutrans HTML\ with\ M4 HTML\ kun\ M4 menutrans Cheetah\ HTML\ template Ŝablono\ Cheetah\ HTML menutrans IDL\Generic\ IDL Ĝenerala\ IDL\IDL menutrans IDL\Microsoft\ IDL IDL\IDL\ Mikrosofto menutrans Indent\ profile Profilo\ Indent menutrans Inno\ setup Konfiguro\ de\ Inno menutrans InstallShield\ script Skripto\ InstallShield menutrans KDE\ script Skripto\ KDE menutrans LFTP\ config Konfiguro\ de\ LFTP menutrans LifeLines\ script Skripto\ LifeLines menutrans Lynx\ Style Stilo\ de\ Lynx menutrans Lynx\ config Konfiguro\ de\ Lynx menutrans Man\ page Manlibra\ paĝo menutrans MEL\ (for\ Maya) MEL\ (por\ Maya) menutrans 4DOS\ \.bat\ file Dosiero\ \.bat\ 4DOS menutrans \.bat\/\.cmd\ file Dosiero\ \.bat\/\.cmd menutrans \.ini\ file Dosiero\ \.ini menutrans Module\ Definition Difino\ de\ modulo menutrans Registry Registraro menutrans Resource\ file Dosiero\ de\ rimedoj menutrans Novell\ NCF\ batch Staplo\ Novell\ NCF menutrans NSIS\ script Skripto\ NSIS menutrans Oracle\ config Konfiguro\ de\ Oracle menutrans Palm\ resource\ compiler Tradukilo\ de\ rimedoj\ Palm menutrans PHP\ 3-4 PHP\ 3\ et\ 4 menutrans Postfix\ main\ config Ĉefa\ konfiguro\ de\ Postfix menutrans Povray\ scene\ descr Scenejo\ Povray menutrans Povray\ configuration Konfiguro\ de\ Povray menutrans Purify\ log Protokolo\ de\ Purify menutrans Readline\ config Konfiguro\ de\ Readline menutrans RCS\ log\ output Protokola\ eligo\ de\ RCS menutrans RCS\ file Dosiero\ RCS menutrans RockLinux\ package\ desc\. Priskribo\ de\ pakaĵoj\ RockLinux menutrans Samba\ config Konfiguro\ de\ Samba menutrans SGML\ catalog Katalogo\ SGML menutrans SGML\ DTD DTD\ SGML menutrans SGML\ Declaration Deklaracio\ SGML menutrans Shell\ script Skripto-ŝelo menutrans sh\ and\ ksh sh\ kaj\ ksh menutrans Sinda\ compare Komparo\ Sinda menutrans Sinda\ input Enigo\ Sinda menutrans Sinda\ output Eligo\ Sinda menutrans SKILL\ for\ Diva SKILL\ por\ Diva menutrans Smarty\ Templates Ŝablono\ Smarty menutrans SNNS\ network Reto\ SNNS menutrans SNNS\ pattern Ŝablono\ SNNS menutrans SNNS\ result Rezulto\ SNNS menutrans Snort\ Configuration Konfiguro\ de\ Snort menutrans Squid\ config Konfiguro\ de\ Squid menutrans Subversion\ commit Commit\ Subversion menutrans TAK\ compare Komparo\ TAK menutrans TAK\ input Enigo\ TAK menutrans TAK\ output Eligo\ TAK menutrans TeX\ configuration Konfiguro\ de\ TeX menutrans TF\ mud\ client TF\ (client\ MUD) menutrans Tidy\ configuration Konfiguro\ de\ Tidy menutrans Trasys\ input Enigo\ Trasys menutrans Command\ Line Komanda\ linio menutrans Geometry Geometrio menutrans Optics Optiko menutrans Vim\ help\ file Helpa\ dosiero\ de\ Vim menutrans Vim\ script Skripto\ Vim menutrans Viminfo\ file Dosiero\ Viminfo menutrans Virata\ config Konfiguro\ de\ Virata menutrans Wget\ config Konfiguro\ de\ wget menutrans Whitespace\ (add) Spacetoj menutrans WildPackets\ EtherPeek\ Decoder Malkodilo\ WildPackets\ EtherPeek menutrans X\ resources Rimedoj\ X menutrans XXD\ hex\ dump Eligo\ deksesuma\.\ de\ xxd menutrans XFree86\ Config Konfiguro\ de\ XFree86 " The End Of The Syntax Menu menutrans &Show\ filetypes\ in\ menu &Montri\ dosiertipojn\ en\ menuo " -SEP1- menutrans Set\ '&syntax'\ only Ŝalti\ nur\ '&syntax' menutrans Set\ '&filetype'\ too Ŝalti\ ankaŭ\ '&filetype' menutrans &Off M&alŝaltita " -SEP3- menutrans Co&lor\ test Testo\ de\ &koloroj menutrans &Highlight\ test Testo\ de\ &emfazo menutrans &Convert\ to\ HTML Konverti\ al\ &HTML let &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/lang/menu_eo_eo.utf-8.vim000066400000000000000000000001301267703067000207640ustar00rootroot00000000000000" Menu Translations: Esperanto for UTF-8 encoding source :p:h/menu_eo.utf-8.vim vim-7.4.1689/runtime/lang/menu_eo_xx.utf-8.vim000066400000000000000000000001301267703067000210200ustar00rootroot00000000000000" Menu Translations: Esperanto for UTF-8 encoding source :p:h/menu_eo.utf-8.vim vim-7.4.1689/runtime/lang/menu_es.latin1.vim000066400000000000000000000001071267703067000205360ustar00rootroot00000000000000" Menu Translations: Spanish source :p:h/menu_es_es.latin1.vim vim-7.4.1689/runtime/lang/menu_es.utf-8.vim000066400000000000000000000001321267703067000203070ustar00rootroot00000000000000" Menu Translations: Spanish for UTF-8 encoding source :p:h/menu_es_es.latin1.vim vim-7.4.1689/runtime/lang/menu_es_es.latin1.vim000066400000000000000000000327361267703067000212420ustar00rootroot00000000000000" Menu Translations: Espaol " Previous translator: Alejandro Lpez-Valencia " Last translator: Omar Campagne Polaino " Version: 7.2.245 " Last Change: 2012 May 01 " " Quit when menu translations have already been done. if exists("did_menu_trans") finish endif let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim " 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 Tabla\ de\ &contenidos menutrans &User\ Manual &Manual\ del\ usuario menutrans &How-to\ links &Enlaces\ a\ Cmo\ hago\.\.\.? menutrans &Find\.\.\. &Buscar\ en\ la\ ayuda menutrans &Credits &Reconocimientos menutrans O&rphans Ayude\ a\ los\ nios\ &hurfanos menutrans Co&pying &Trminos\ de\ Licencia menutrans Sponsor/Register Benefactor/Regstrese menutrans &Version &Versin\ e\ \informacin\ de\ configuracin menutrans &About &Acerca\ de\ Vim " File menu menutrans &File &Archivo menutrans &Open\.\.\.:e &Abrir\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp A&brir\ en\ otra\ ventana\.\.\.:sp menutrans &New:enew &Nuevo:enew menutrans Open\ Tab\.\.\.:tabnew Abrir\ pes&taa\.\.\.:tabnew menutrans &Close:close &Cerrar:close menutrans &Save:w &Guardar:w menutrans Save\ &As\.\.\.:sav Guardar\ &como\.\.\.:sav menutrans Split\ &Diff\ with\.\.\. &Mostrar\ diferencias\ con\.\.\. menutrans Split\ Patched\ &By\.\.\. Mostrar\ &parcheado\ por\.\.\. menutrans &Print &Imprimir menutrans Sa&ve-Exit:wqa Gua&rdar\ y\ salir:wqa menutrans E&xit:qa &Salir:qa " Edit menu menutrans &Edit &Editar menutrans &Undou &Deshaceru menutrans &Redo^R &Rehacer^R menutrans Rep&eat\. Repe&tir\. menutrans Cu&t"+x Cor&tar"+x menutrans &Copy"+y &Copiar"+y menutrans &Paste"+gP &Pegar"+gP menutrans Put\ &Before[p Poner\ &antes[p menutrans Put\ &After]p Poner\ &despus]p if has("win32") || has("win16") menutrans &Deletex S&uprimirx endif menutrans &Select\ allggVG &Seleccionar\ todoggVG menutrans &Find\.\.\. &Buscar\.\.\. menutrans &Find/ &Buscar/ menutrans Find\ and\ Rep&lace\.\.\. Buscar\ y\ R&eemplazar\.\.\. menutrans Find\ and\ Rep&lace:%s Buscar\ y\ R&eemplazar:%s menutrans Find\ and\ Rep&lace Buscar\ y\ R&eemplazar menutrans Find\ and\ Rep&lace:s Buscar\ y\ R&eemplazar:s menutrans Settings\ &Window &Ventana\ de\ opciones menutrans Startup\ &Settings Opciones\ de\ arranque " Edit/Global Settings menutrans &Global\ Settings Opciones\ &globales menutrans Toggle\ Pattern\ &Highlight:set\ hls! Activar/Desactivar\ &resaltado\ de\ sintaxis:set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! Activar/Desactivar\ &ignorar\ maysculas\ y\ minsculas:set\ ic! menutrans Toggle\ &Showmatch:set\ sm! Activar/Desactivar\ &mostrar\ coincidencias:set\ sm! menutrans &Context\ lines Lneas\ de\ &contexto menutrans &Virtual\ Edit Edicin\ &virtual menutrans Never Nunca menutrans Block\ Selection Seleccin\ de\ bloque menutrans Insert\ mode Modo\ de\ insercin menutrans Block\ and\ Insert Bloque\ e\ insercin menutrans Always Siempre menutrans Toggle\ Insert\ &Mode:set\ im! Activar/Desactivar\ modo\ de\ in&sercin:set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! Activar/Desactivar\ compatiblidad\ con\ Vi:set\ cp! menutrans Search\ &Path\.\.\. Ruta\ de\ &bsqueda\.\.\. menutrans Ta&g\ Files\.\.\. Ficheros\ de\ &etiquetas\.\.\. " 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 bsqueda para los archivos.\nSepare los nombres de los directorios con una coma." let g:menutrans_tags_dialog = "Introduzca los nombres de los archivos de tags.\nSepare los nombres con una coma." " Edit/File Settings menutrans F&ile\ Settings Opciones\ del\ &archivo " Boolean options menutrans Toggle\ Line\ &Numbering:set\ nu! Activar/Desactivar\ &numeracin\ de\ lneas:set\ nu! menutrans Toggle\ &List\ Mode:set\ list! Activar/Desactivar\ modo\ de\ lista:set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! Activar/Desactivar\ &quiebre\ de\ lneas:set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! Activar/Desactivar\ quiebre\ entre\ &palabras:set\ lbr! menutrans Toggle\ &expand-tab:set\ et! Activar/Desactivar\ &expansin\ de\ marcas\ de\ \tabulado:set\ et! menutrans Toggle\ &auto-indent:set\ ai! Activar/Desactivar\ &auto-sangrado:set\ ai! menutrans Toggle\ &C-indenting:set\ cin! Activar/Desactivar\ sangrado\ &C: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 lnea): " menutrans &File\ Format\.\.\. &Formato\ del\ archivo\.\.\. let g:menutrans_fileformat_dialog = "Seleccione el formato para escribir el archivo" 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 melocotn menutrans shine brillante menutrans Select\ Fo&nt\.\.\. Seleccionar\ fue&nte\.\.\. menutrans &Keymap Asociacin\ de\ teclados menutrans None Ninguna menutrans accents acentos menutrans arabic rabe menutrans czech checo menutrans greek griego menutrans hebrew hebreo menutrans hebrewp hebreo\ fontico menutrans lithuanian-baltic lituano-bltico 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\ tagg^] &Saltar\ a\ este\ etiquetag^] menutrans Jump\ &back^T Saltar\ &atrs^T menutrans Build\ &Tags\ File Crear\ archivo\ de\ &etiquetas\ menutrans &Diff Modo\ de\ &diferencias menutrans &Folding &Plegado menutrans &Make:make Ejecutar\ &Make:make menutrans &List\ Errors:cl &Lista\ de\ errores:cl menutrans L&ist\ Messages:cl! L&ista\ de\ mensajes:cl! menutrans &Next\ Error:cn &Error\ siguiente:cn menutrans &Previous\ Error:cp Error\ p&revio:cp menutrans &Older\ List:cold Lista\ de\ &viejos\ a\ nuevos:cold menutrans N&ewer\ List:cnew Lista\ de\ &nuevos\ a\ viejos:cnew menutrans Error\ &Window Ven&tana\ de\ errores menutrans &Set\ Compiler Esco&ger\ el\ compilador\ a\ usar menutrans &Convert\ to\ HEX:%!xxd Convertir\ a\ formato\ &hexadecimal:%!xxd menutrans Conve&rt\ back:%!xxd\ -r &Convertir\ al\ formato\ original:%!xxd\ -r " Tools.Spelling Menu menutrans &Spelling Correccin\ ortogrfica menutrans &Spell\ Check\ On &Activar\ correccin\ ortogrfica menutrans Spell\ Check\ &Off &Desactivar\ correccin\ ortogrfica menutrans To\ &Next\ error]s &Siguiente\ error]s menutrans To\ &Previous\ error[s Error\ &precedente[s menutrans Suggest\ &Correctionsz= Sugerir\ &correccinz= menutrans &Repeat\ correction:spellrepall &Repetir\ correccin:spellrepall an 40.335.205 &Tools.&Spelling.Castellano\ (es) :set spl=es spell menutrans Set\ language\ to\ "en" Ingls menutrans Set\ language\ to\ "en_au" Ingls\ (en_au) menutrans Set\ language\ to\ "en_ca" Ingls\ (en_ca) menutrans Set\ language\ to\ "en_gb" Ingls\ (en_gb) menutrans Set\ language\ to\ "en_nz" Ingls\ (en_nz) menutrans Set\ language\ to\ "en_us" Ingls\ (en_us) menutrans &Find\ More\ Languages &Buscar\ otras\ lenguas " Tools.Fold Menu menutrans &Enable/Disable\ foldszi &Activar/Desactivar\ pliegueszi menutrans &View\ Cursor\ Linezv &Ver\ lnea\ del\ cursorzv menutrans Vie&w\ Cursor\ Line\ onlyzMzx Ve&r\ slo\ la\ lnea\ del\ cursorzMzx menutrans C&lose\ more\ foldszm C&errar\ ms\ pliegueszm menutrans &Close\ all\ foldszM &Cerrar\ todos\ los\ pliegueszM menutrans O&pen\ more\ foldszr Abrir\ &ms\ pliegueszr menutrans &Open\ all\ foldszR &Abrir\ todos\ los\ pliegueszR " fold method menutrans Fold\ Met&hod &Mtodo\ de\ plegado " create and delete folds menutrans Create\ &Foldzf Crear\ &plieguezf menutrans &Delete\ Foldzd &Suprimir\ plieguezd menutrans Delete\ &All\ FoldszD Suprimir\ &todos\ los\ pliegueszD " 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:cwin &Actualizar menutrans &Open:copen A&brir menutrans &Close: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 archivo]" " Window menu menutrans &Window &Ventana menutrans &New^Wn Ventana\ &nueva^Wn menutrans S&plit^Ws &Dividir\ la\ ventana^Ws menutrans Sp&lit\ To\ #^W^^ D&ividir\ en\ el\ marcador\ (#)^W^^ menutrans Split\ &Vertically^Wv Dividir\ &verticalmente^Wv menutrans Split\ File\ E&xplorer &Abrir\ el\ Explorador\ de\ archivos menutrans &Close^Wc &Cerrar\ esta\ ventana^Wc menutrans Close\ &Other(s)^Wo Cerrar\ &otra(s)\ ventana(s)^Wo menutrans Move\ &To Mov&er\ a menutrans &Top^WK &Arriba^WK menutrans &Bottom^WJ A&bajo^WJ menutrans &Left\ side^WH Lado\ &izquierdo^WH menutrans &Right\ side^WL Lado\ &derecho^WL menutrans Rotate\ &Up^WR &Rotar\ hacia\ arriba^WR menutrans Rotate\ &Down^Wr Rotar\ hacia\ a&bajo^Wr menutrans &Equal\ Size^W= Mismo\ &tamao^W= menutrans &Max\ Height^W_ Altura\ &mxima^W_ menutrans M&in\ Height^W1_ Altura\ m&nima^W1_ menutrans Max\ &Width^W\| Anchura\ m&xima^W\| menutrans Min\ Widt&h^W1\| Anc&hura\ mnima^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\ &lnea 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 archivo tmenu ToolBar.Save Guardar archivo tmenu ToolBar.SaveAll Guardar todos los archivos 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 Altura mxima tmenu ToolBar.WinMin Altura mnima tmenu ToolBar.WinVSplit Dividir verticalmente tmenu ToolBar.WinMaxWidth Anchura mxima tmenu ToolBar.WinMinWidth Anchura mnima tmenu ToolBar.WinClose Cerrar ventana endif tmenu ToolBar.LoadSesn Cargar sesin tmenu ToolBar.SaveSesn Guardar sesin tmenu ToolBar.RunScript Ejecutar un archivo de rdenes tmenu ToolBar.Make Ejecutar Make tmenu ToolBar.Shell Abrir un intrprete de comandos tmenu ToolBar.RunCtags Generar un archivo de etiquetas tmenu ToolBar.TagJump Saltar a una etiqueta 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\ archivo menutrans Set\ '&syntax'\ only Activar\ slo\ sintaxis menutrans Set\ '&filetype'\ too Activar\ tambin\ tipo\ de\ archivo menutrans &Off &Desactivar\ sintaxis menutrans &Manual Sintaxis\ &manual menutrans A&utomatic Sintaxis\ a&utomtica menutrans on/off\ for\ &This\ file Activar/Desactivar\ en\ es&te\ archivo menutrans Co&lor\ test &Prueba\ de\ colores menutrans &Highlight\ test Prueba\ de\ &resaltado menutrans &Convert\ to\ HTML &Convertir\ a\ 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 lnea de comandos (e.g.: c_)\nAnteponga ` para un nombre de opcin (e.g.: `shiftwidth`)" let &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/lang/menu_es_es.utf-8.vim000066400000000000000000000001321267703067000207760ustar00rootroot00000000000000" Menu Translations: Spanish for UTF-8 encoding source :p:h/menu_es_es.latin1.vim vim-7.4.1689/runtime/lang/menu_fi.latin1.vim000066400000000000000000000001341267703067000205250ustar00rootroot00000000000000" Menu Translations: Finnish for latin 1 encoding source :p:h/menu_fi_fi.latin1.vim vim-7.4.1689/runtime/lang/menu_fi.utf-8.vim000066400000000000000000000001321267703067000202760ustar00rootroot00000000000000" Menu Translations: Finnish for UTF-8 encoding source :p:h/menu_fi_fi.latin1.vim vim-7.4.1689/runtime/lang/menu_fi_fi.latin1.vim000066400000000000000000000426211267703067000212120ustar00rootroot00000000000000" Menu Translations: Finnish " Maintainer: Flammie Pirinen " Last Change: 2012 May 01 " Quit when menu translations have already been done. if exists("did_menu_trans") finish endif let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim " Translations should be in latin1, if it requires latin9 or even unicode, " change this: if &enc != "cp1252" && &enc != "iso-8859-15" && &enc != "iso-8859-1" scriptencoding latin1 endif " Accels: TMYSPIO menutrans &File &Tiedosto " Accels: AJTUSNIDPOE menutrans &Open\.\.\.:e &Avaa\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp Avaa\ &jaettuna\.\.\.:sp menutrans Open\ Tab\.\.\.:tabnew Avaa\ &tabissa\.\.\.:tabnew menutrans &New:enew &Uusi:enew menutrans &Close:close &Sulje:close " -SEP1- menutrans &Save:w Talle&nna:w menutrans Save\ &As\.\.\.:sav Tallenna\ n&imell\.\.\.:sav " -SEP2- menutrans Split\ &Diff\ with\.\.\. Jaa\ &diffill\.\.\. menutrans Split\ Patched\ &By\.\.\. Jaa\ &patchilla\.\.\. " -SEP3- menutrans &Print Tul&osta " -SEP4- menutrans Sa&ve-Exit:wqa Tall&enna\ ja\ lopeta:wqa menutrans E&xit:qa &Lopeta:qa menutrans &Edit &Muokkaa " Accels: KPTLOIEJSAHRUYKVNF menutrans &Undou &Kumoau menutrans &Redo^R &Palauta^R menutrans Rep&eat\. &Toista\. " -SEP1- menutrans Cu&t"+x &Leikkaa"+x menutrans &Copy"+y K&opioi"+y menutrans &Paste"+gP L&iit"+gP menutrans Put\ &Before[p Lis\ &ennen[p menutrans Put\ &After]p Lis\ &jlkeen]p menutrans &Deletex Poi&stax menutrans &Select\ AllggVG V&alitse\ kaikkiggVG " -SEP2- menutrans &Find\.\.\. &Hae\.\.\. menutrans Find\ and\ Rep&lace\.\.\. Hae\ ja\ ko&rvaa\.\.\. menutrans &Find/ &Hae/ menutrans Find\ and\ Rep&lace:%s Hae\ ja\ ko&rvaa:%s menutrans Find\ and\ Rep&lace:s Hae\ ja\ ko&rvaa:s " -SEP3- menutrans Settings\ &Window Aset&usikkuna menutrans Startup\ &Settings &Kynnistysasetukset menutrans &Global\ Settings &Yleiset\ asetukset " Submenu: " Accels: KOSHVYIATLEPR menutrans Toggle\ Pattern\ &Highlight:set\ hls! &Korostus:set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! &Ohita\ kirjaintaso:set\ ic! menutrans Toggle\ &Showmatch:set\ sm! &Suljekorostus:set\ sm! menutrans &Context\ lines &Huomioitavat\ kontekstirivit " Subsubmenu: " Accels: ELSOA menutrans &Virtual\ Edit &Virtuaalimuokkaus menutrans Never &Ei koskaan menutrans Block\ Selection &Lohkovalinta menutrans Insert\ mode &Sytttila menutrans Block\ and\ Insert L&ohkosytttila menutrans Always &Aina menutrans Toggle\ Insert\ &Mode:set\ im! S&ytttila:set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! V&i-tila:set\ cp! menutrans Search\ &Path\.\.\. H&akupolku\.\.\. menutrans Ta&g\ Files\.\.\. &Tgitiedostot\.\.\. " -SEP1- menutrans Toggle\ &Toolbar Tyka&lupalkki menutrans Toggle\ &Bottom\ Scrollbar Vaakavi&erityspalkki menutrans Toggle\ &Left\ Scrollbar Vasen\ &pystyvierityspalkki menutrans Toggle\ &Right\ Scrollbar Oikea\ pystyvie&rityspalkki let g:menutrans_path_dialog = "Anna tiedostojen hakupolku.\nErota hakemistot pilkuin." let g:menutrans_tags_dialog = "Anna tgitiedostojen nimet.\nErota tidostot pilkuin." menutrans F&ile\ Settings Tiedostoasetu&kset " Submenu: " Accels: NLRSTACIBEM menutrans Toggle\ Line\ &Numbering:set\ nu! Rivi&numerointi:set\ nu! menutrans Toggle\ &List\ Mode:set\ list! &Listaustila:set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! &Rivitys:set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! &Sanoittainen rivitys:set\ lbr! menutrans Toggle\ &expand-tab:set\ et! Muuta\ &tabit\ vleiksi:set\ et! menutrans Toggle\ &auto-indent:set\ ai! &Automaattinen\ sisennys:set\ ai! menutrans Toggle\ &C-indenting:set\ cin! &C-kielen\ sisennys:set\ cin! " -SEP2- menutrans &Shiftwidth S&isennysleveys menutrans Soft\ &Tabstop Nennista&bulointi menutrans Te&xt\ Width\.\.\. Tekstinl&eveys\.\.\. menutrans &File\ Format\.\.\. Tiedosto&muoto\.\.\. let g:menutrans_textwidth_dialog = "Anna uusi tekstin leveys\n(0 poistaa kytst)" let g:menutrans_fileformat_dialog = "Anaa tiedoston kirjoitusmuoto." let g:menutrans_fileformat_choices = " &Unix \n &Dos \n &Mac \n &Peru " menutrans C&olor\ Scheme &Vriteema menutrans &Keymap &Nppinkartta menutrans None Ei mikn menutrans Select\ Fo&nt\.\.\. Valitse\ &fontti\.\.\. menutrans &Tools T&ykalut " Accels: ___OTDM__ menutrans &Jump\ to\ this\ tagg^] Siirry\ tgiing^] menutrans Jump\ &back^T Siirry\ takaisin^T menutrans Build\ &Tags\ File Luo\ tgitiedosto " -SEP1- menutrans &Spelling &Oikeinkirjoitus " Submenu: " Accels: OSEKT menutrans &Spell\ Check\ On &Oikaisuluku\ plle menutrans Spell\ Check\ &Off &Oikaisuluku\ pois\ plt menutrans To\ &Next\ error]s &Seuraavaan\ virheeseen]s menutrans To\ &Previous\ error[s &Edelliseen\ virheeseen[s menutrans Suggest\ &Correctionsz= Ehdota\ &korjaustaz= menutrans &Repeat\ correction:spellrepall &Toista\ korjaus:spellrepall menutrans Set\ language\ to\ "en" Aseta\ kieleksi\ en menutrans Set\ language\ to\ "en_au" Aseta\ kieleksi\ en_au menutrans Set\ language\ to\ "en_ca" Aseta\ kieleksi\ en_ca menutrans Set\ language\ to\ "en_gb" Aseta\ kieleksi\ en_gb menutrans Set\ language\ to\ "en_nz" Aseta\ kieleksi\ en_nz menutrans Set\ language\ to\ "en_us" Aseta\ kieleksi\ en_us menutrans &Find\ More\ Languages Hae\ lis\ kieli menutrans &Folding &Taitokset " Accels: TNVSAPEOKL menutrans &Enable/Disable\ foldszi &Taitoksetzi menutrans &View\ Cursor\ Linezv &Nyt\ kursorin\ rivizv menutrans Vie&w\ Cursor\ Line\ onlyzMzx Nyt\ &vain\ kursorin\ rivizMzx menutrans C&lose\ more\ foldszm &Sulje\ lis\ taitoksiazm menutrans &Close\ all\ foldszM &Sulje\ kaikki\ taitoksetzM menutrans O&pen\ more\ foldszr &Avaa\ lis\ taitoksiazr menutrans &Open\ all\ foldszR &Avaa\ kaikki\ taitoksetzR " -SEP1- menutrans Fold\ Met&hod Taitteluta&pa " Submenu: " Accels: MILSDM menutrans M&anual &Manuaalinen menutrans I&ndent S&isennys menutrans E&xpression I&lmaus menutrans S&yntax &Syntaksi menutrans &Diff &Diff menutrans Ma&rker &Merkit menutrans Create\ &Foldzf T&ee\ taitoszf menutrans &Delete\ Foldzd P&oista\ taitoszd menutrans Delete\ &All\ FoldszD Poista\ &kaikki\ taitoksetzD " -SEP2- menutrans Fold\ col&umn\ width Taitossarakkeen\ &leveys menutrans &Diff &Diffit " Submenu: " Accels: PHL menutrans &Update &Pivit menutrans &Get\ Block &Hae\ lohko menutrans &Put\ Block &Lis\ lohko " -SEP2- menutrans &Make:make &Make:make menutrans &List\ Errors:cl Virheluettelo:cl menutrans L&ist\ Messages:cl! Virheviestit:cl! menutrans &Next\ Error:cn Seuraava\ virhe:cn menutrans &Previous\ Error:cp Edellinen\ virhe:cp menutrans &Older\ List:cold Edellinen\ lista:cold menutrans N&ewer\ List:cnew Seuraava\ lista:cnew menutrans Error\ &Window Virheikkuna " Submenu: " Accels: PAS menutrans &Update:cwin &Pivit:cwin menutrans &Open:copen &Avaa:copen menutrans &Close:cclose &Sulje:cclose menutrans Se&T\ Compiler Ase&ta\ kntj " -SEP3- menutrans &Convert\ to\ HEX:%!xxd Muunna\ heksoiksi:%!xxd menutrans Conve&rt\ back:%!xxd\ -r Muunna\ takaisin:%!xxd\ -r menutrans &Syntax &Syntaksi " Accels: NSFPMAT menutrans &Show\ filetypes\ in\ menu &Nyt\ tiedostotyypit\ valikossa " -SEP1- menutrans Set\ '&syntax'\ only Aseta\ vain\ &syntax menutrans Set\ '&filetype'\ too Aseta\ mys\ &filetype menutrans &Off &Pois\ plt " -SEP3- menutrans Co&lor\ test Testaa\ vrit menutrans &Highlight\ test Testaa\ korostukset menutrans &Convert\ to\ HTML Muunna\ HTML:ksi " -SEP2- menutrans &Off &Pois\ plt menutrans &Manual &Manuaalinen menutrans A&utomatic &Automaattinen menutrans on/off\ for\ &This\ file Kytke\ &tlle\ tiedostolle " The Start Of The Syntax Menu menutrans ABC\ music\ notation ABC\ (notation\ musicale) menutrans AceDB\ model Modle\ 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\.\ gnrique menutrans Digital\ Command\ Lang DCL menutrans DNS/BIND\ zone Zone\ BIND/DNS menutrans Dylan\ interface Interface menutrans Dylan\ lid LID menutrans Elm\ filter\ rules Rgles\ 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\ gnrique 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 Dfinition\ 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 Scne\ 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 Dclaration\ SGML menutrans Shell\ script Script\ shell menutrans sh\ and\ ksh sh\ et\ ksh menutrans Sinda\ compare Comparaison\ Sinda menutrans Sinda\ input Entre\ Sinda menutrans Sinda\ output Sortie\ Sinda menutrans SKILL\ for\ Diva SKILL\ pour\ Diva menutrans Smarty\ Templates Patrons\ Smarty menutrans SNNS\ network Rseau\ SNNS menutrans SNNS\ pattern Motif\ SNNS menutrans SNNS\ result Rsultat\ SNNS menutrans Snort\ Configuration Config\.\ Snort menutrans Squid\ config Config\.\ Squid menutrans Subversion\ commit Commit\ Subversion menutrans TAK\ compare Comparaison\ TAK menutrans TAK\ input Entre\ 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 Entre\ Trasys menutrans Command\ Line Ligne\ de\ commande menutrans Geometry Gomtrie 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 Dcodeur\ WildPackets\ EtherPeek menutrans X\ resources Resources\ X menutrans XXD\ hex\ dump Sortie\ hexa\.\ de\ xxd menutrans XFree86\ Config Config\.\ XFree86 menutrans &Buffers &Puskurit " Accels: VPASE menutrans Dummy Dummy menutrans &Refresh\ menu Pivit\ &valikko menutrans &Delete &Poista menutrans &Alternate V&aihda menutrans &Next &Seuraava menutrans &Previous &Edellinen " -SEP- " (Alphabet menus) menutrans &others &muut let g:menutrans_no_file = "[Ei tiedostoja]" menutrans &Window &Ikkuna " Accels: UJPTSMIYAKOL menutrans &New^Wn &Uusi\ ikkuna^Wn menutrans S&plit^Ws &Jaa^Ws menutrans Sp&lit\ To\ #^W^^ &Jaa\ #^W^^ menutrans Split\ &Vertically^Wv Jaa\ &pystysuunnassa^Wv menutrans Split\ File\ E&xplorer Jaa\ &tiedostonhallinnalle " -SEP1- menutrans &Close^Wc &Sulje^Wc menutrans Close\ &Other(s)^Wo Sulje\ &muut^Wo " -SEP2- menutrans Move\ &To S&iirr " Submenu: " Accels: YAOV menutrans &Top^WK &Yls^WK menutrans &Bottom^WJ &Alas^WJ menutrans &Left\ side^WH &Oikealle^WH menutrans &Right\ side^WL &Vasemmalle^WL menutrans Rotate\ &Up^WR Vaihda\ &ylemms^WR menutrans Rotate\ &Down^Wr Vaihda\ &alemmas^Wr " -SEP3- menutrans &Equal\ Size^W= Saman\ &kokoisiksi^W= menutrans &Max\ Height^W_ Enimmisk&orkeuteen^W_ menutrans M&in\ Height^W1_ Vhimmisk&orkeuteen^W1_ menutrans Max\ &Width^W\| Enimmis&leveyteen^W\| menutrans Min\ Widt&h^W1\| Vhimmis&leveyteen^W1\| " (Plugin menus here) menutrans Plugin Liitnniset menutrans &Help &Ohje " Accels: YKUHTLROVI menutrans &Overview &Yleiskatsaus menutrans &User\ Manual &Kyttohje menutrans &How-to\ links K&UINKA-linkkej menutrans &Find\.\.\. &Hae\.\.\. " -sep1- menutrans &Credits &Tekijt menutrans Co&pying &Lisenssi menutrans &Sponsor/Register Sponsoroi/&Rekisteri menutrans O&rphans &Orvoista " -sep2- menutrans &Version &Versio menutrans &About T&ietoja let g:menutrans_help_dialog = "Anna komento tai sana, jota haetaan ohjeesta.\n\nAloita i_:ll sytttilan komentoja varten (esim. i_CTRL-X)\nAloita c_:ll komentorivi varten (esim. c_)\nKirjoita asetukset puolilainausmerkkeijin (esim. 'shiftwidth')" " PopUp menutrans &Undo &Kumoa " -SEP1- menutrans Cu&t &Leikkaa menutrans &Copy &Kopioi menutrans &Paste L&iit " &Buffers.&Delete overwrites this one menutrans &Delete &Poista " -SEP2- menutrans Select\ Blockwise Valitse\ lohkoittain menutrans Select\ &Word Valitse\ &sana menutrans Select\ &Line Valitse\ &rivi menutrans Select\ &Block Valitse\ &lohko menutrans Select\ &All Valitse\ &kaikki " ToolBar menutrans Open Avaa menutrans Save Tallenna menutrans SaveAll TallennaKaikki menutrans Print Tulosta " -sep1- menutrans Undo Kumoa menutrans Redo Palauta " -sep2- menutrans Cut Leikkaa menutrans Copy Kopioi menutrans Paste Liit " -sep3- menutrans Find Etsi menutrans FindNext EtsiSeur menutrans FindPrev EtsiEd menutrans Replace Korvaa " -sep4- menutrans New Uusi menutrans WinSplit JaaIkk menutrans WinMax IkkMax menutrans WinMin IkkMin menutrans WinVSplit JaaIkkV menutrans WinMaxWidth IkkMaxLev menutrans WinMinWidth IkkMinLev menutrans WinClose SuljeIkk " -sep5- menutrans LoadSesn AvaaSess menutrans SaveSesn TallSess menutrans RunScript AjaSkripti " -sep6- menutrans Make Make menutrans RunCtags AjaCTags menutrans TagJump TagHypp " -sep7- menutrans Help Ohje menutrans FindHelp OhjeHaku fun! Do_toolbar_tmenu() let did_toolbar_tmenu = 1 tmenu ToolBar.Open Avaa tiedosto tmenu ToolBar.Save Tallenna nykyinen tiedosto tmenu ToolBar.SaveAll Tallenna kaikki tiedostot tmenu ToolBar.Print Tulosta tmenu ToolBar.Undo Kumoa tmenu ToolBar.Redo Palauta tmenu ToolBar.Cut Leikkaa tmenu ToolBar.Copy Kopioi tmenu ToolBar.Paste Liit if !has("gui_athena") tmenu ToolBar.Find Hae tmenu ToolBar.FindNext Hae seuraava tmenu ToolBar.FindPrev Hae edellinen tmenu ToolBar.Replace Korvaa endif if 0 " disabled; These are in the Windows menu tmenu ToolBar.New Uusi ikkuna tmenu ToolBar.WinSplit Jaa ikkuna tmenu ToolBar.WinMax Maximiser fentre tmenu ToolBar.WinMin Minimiser fentre tmenu ToolBar.WinVSplit Fractionner verticalement tmenu ToolBar.WinMaxWidth Maximiser largeur fentre tmenu ToolBar.WinMinWidth Minimiser largeur fentre tmenu ToolBar.WinClose Fermer fentre endif tmenu ToolBar.LoadSesn Avaa sessio tmenu ToolBar.SaveSesn Tallenna nykyinen sessio tmenu ToolBar.RunScript Lataa vim-skripti tmenu ToolBar.Make Suorita make tmenu ToolBar.RunCtags Suorita CTags tmenu ToolBar.TagJump Hypp tgiin tmenu ToolBar.Help Vimin ohje tmenu ToolBar.FindHelp Etsi ohjeesta endfun let &cpo = s:keepcpo unlet s:keepcpo " vim: set fileencoding=latin1 vim-7.4.1689/runtime/lang/menu_fi_fi.utf-8.vim000066400000000000000000000001321267703067000207540ustar00rootroot00000000000000" Menu Translations: Finnish for UTF-8 encoding source :p:h/menu_fi_fi.latin1.vim vim-7.4.1689/runtime/lang/menu_finnish_finland.1252.vim000066400000000000000000000001521267703067000224610ustar00rootroot00000000000000" Menu Translations: Finnish for Windows CodePage 1252 encoding source :p:h/menu_fi_fi.latin1.vim vim-7.4.1689/runtime/lang/menu_fr.latin1.vim000066400000000000000000000001361267703067000205400ustar00rootroot00000000000000" Menu Translations: French for ISO 8859-1 encoding source :p:h/menu_fr_fr.latin1.vim vim-7.4.1689/runtime/lang/menu_fr.utf-8.vim000066400000000000000000000001311267703067000203060ustar00rootroot00000000000000" Menu Translations: French for UTF-8 encoding source :p:h/menu_fr_fr.latin1.vim vim-7.4.1689/runtime/lang/menu_fr_fr.latin1.vim000066400000000000000000000440751267703067000212410ustar00rootroot00000000000000" Menu Translations: Francais " Maintainer: Adrien Beau " First Version: Francois Thunus " Last Modification: David Blanchet " Last Change: 2012 May 01 " Quit when menu translations have already been done. if exists("did_menu_trans") finish endif let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim " 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 &Sommaire menutrans &User\ Manual &Manuel\ utilisateur menutrans &How-to\ links &Tches\ courantes menutrans &Find\.\.\. Rec&hercher\.\.\. " -sep1- menutrans &Credits &Remerciements menutrans Co&pying &License menutrans &Sponsor/Register Sponsor/&Enregistrement 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_)\nEntourez les options avec des apostrophes (ex: 'shiftwidth')" menutrans &File &Fichier menutrans &Open\.\.\.:e &Ouvrir\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp Ouvrir\ \ p&art\.\.\.:sp menutrans Open\ Tab\.\.\.:tabnew Ouvrir\ dans\ un\ onglet\.\.\.:tabnew menutrans &New:enew &Nouveau:enew menutrans &Close:close &Fermer:close " -SEP1- menutrans &Save:w &Enregistrer:w menutrans Save\ &As\.\.\.:sav Enregistrer\ &sous\.\.\.: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:wqa En®istrer\ et\ quitter:wqa menutrans E&xit:qa &Quitter:qa menutrans &Edit &Edition menutrans &Undou &Annuleru menutrans &Redo^R Re&faire^R menutrans Rep&eat\. R&pter\. " -SEP1- menutrans Cu&t"+x Co&uper"+x menutrans &Copy"+y Cop&ier"+y menutrans &Paste"+gP C&oller"+gP menutrans Put\ &Before[p Placer\ a&vant[p menutrans Put\ &After]p Placer\ apr&s]p menutrans &Deletex Effa&cerx menutrans &Select\ AllggVG &Slectionner\ toutggVG " -SEP2- menutrans &Find\.\.\. Rec&hercher\.\.\. menutrans Find\ and\ Rep&lace\.\.\. Re&mplacer\.\.\. menutrans &Find/ Rec&hercher/ menutrans Find\ and\ Rep&lace:%s Re&mplacer:%s menutrans Find\ and\ Rep&lace:s Re&mplacer:s " -SEP3- menutrans Settings\ &Window Fe&ntre\ des\ rglages menutrans &Global\ Settings Rglages\ globau&x menutrans Toggle\ Pattern\ &Highlight:set\ hls! &Surligner\ recherche\ on/off:set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! &Ignorer\ casse\ on/off:set\ ic! menutrans Toggle\ &Showmatch:set\ sm! Vrifier\ parenth&ses\ on/off:set\ sm! menutrans &Context\ lines Lignes\ &autour\ du\ curseur menutrans &Virtual\ Edit dition\ &virtuelle menutrans Never &Jamais menutrans Block\ Selection &Slection\ en\ bloc menutrans Insert\ mode &Mode\ insertion menutrans Block\ and\ Insert &Bloc\ et\ insertion menutrans Always &Toujours menutrans Toggle\ Insert\ &Mode:set\ im! I&nsertion\ permanente\ on/off:set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! &Compatibilit\ Vi\ on/off: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.\nSparez les rpertoires par des virgules." let g:menutrans_tags_dialog = "Entrez les noms des fichiers d'tiquettes.\nSparez les noms par des virgules." menutrans F&ile\ Settings Rglages\ fichie&r menutrans Toggle\ Line\ &Numbering:set\ nu! &Numrotation\ on/off:set\ nu! menutrans Toggle\ &List\ Mode:set\ list! Mode\ &listing\ on/off:set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! &Retour\ \ la\ ligne\ on/off:set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! Retour\ sur\ &mot\ on/off:set\ lbr! menutrans Toggle\ &expand-tab:set\ et! &Tab\.\ en\ espaces\ on/off:set\ et! menutrans Toggle\ &auto-indent:set\ ai! Indentation\ &auto\.\ on/off:set\ ai! menutrans Toggle\ &C-indenting:set\ cin! Indent\.\ langage\ &C\ on/off: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 dsactiver 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\.\.\. Slectionner\ &police\.\.\. menutrans &Tools &Outils menutrans &Jump\ to\ this\ tagg^] &Atteindre\ cette\ tiquetteg^] menutrans Jump\ &back^T Repartir\ en\ arri&re^T menutrans Build\ &Tags\ File &Gnrer\ fichier\ d'tiquettes " -SEP1- menutrans &Spelling &Orthographe menutrans &Spell\ Check\ On &Activer menutrans Spell\ Check\ &Off &Dsactiver menutrans To\ &Next\ error]s \ l'erreur\ &suivante]s menutrans To\ &Previous\ error[s \ l'erreur\ &prcdente[s menutrans Suggest\ &Correctionsz= Suggrer\ &correctionz= menutrans &Repeat\ correction:spellrepall &Reporter\ la\ correction:spellrepall an 40.335.205 &Tools.&Spelling.Franais\ (fr) :set spl=fr spell menutrans Set\ language\ to\ "en" Anglais menutrans Set\ language\ to\ "en_au" Anglais\ (en_au) menutrans Set\ language\ to\ "en_ca" Anglais\ (en_ca) menutrans Set\ language\ to\ "en_gb" Anglais\ (en_gb) menutrans Set\ language\ to\ "en_nz" Anglais\ (en_nz) menutrans Set\ language\ to\ "en_us" Anglais\ (en_us) menutrans &Find\ More\ Languages &Trouver\ d'autres\ langues menutrans &Folding &Replis menutrans &Enable/Disable\ foldszi &Replis\ on/offzi menutrans &View\ Cursor\ Linezv D&plier\ ligne\ curseurzv menutrans Vie&w\ Cursor\ Line\ onlyzMzx Tout\ plier\ &sauf\ ligne\ curseurzMzx menutrans C&lose\ more\ foldszm Fermer\ &plus\ de\ repliszm menutrans &Close\ all\ foldszM F&ermer\ tous\ les\ repliszM menutrans O&pen\ more\ foldszr Ouvrir\ pl&us\ de\ repliszr menutrans &Open\ all\ foldszR &Ouvrir\ tous\ les\ repliszR " -SEP1- menutrans Fold\ Met&hod &Mthode\ de\ repli menutrans M&anual &Manuelle menutrans I&ndent &Indentation menutrans E&xpression &Expression menutrans S&yntax &Syntaxe menutrans &Diff &Diffrence menutrans Ma&rker Ma&rqueurs menutrans Create\ &Foldzf &Crer\ replizf menutrans &Delete\ Foldzd E&ffacer\ replizd menutrans Delete\ &All\ FoldszD Effacer\ &tous\ les\ repliszD " -SEP2- menutrans Fold\ col&umn\ width &Largeur\ colonne\ replis menutrans &Diff &Diffrence menutrans &Update &Mettre\ \ jour menutrans &Get\ Block Corriger\ &ce\ tampon menutrans &Put\ Block Corriger\ l'&autre\ tampon " -SEP2- menutrans &Make:make Lancer\ ma&ke:make menutrans &List\ Errors:cl Lister\ &erreurs:cl menutrans L&ist\ Messages:cl! Lister\ &messages:cl! menutrans &Next\ Error:cn Erreur\ &suivante:cn menutrans &Previous\ Error:cp Erreur\ pr&cdente:cp "menutrans &Older\ List:cold A&ncienne\ liste:cold menutrans &Older\ List:cold Liste\ &prcdente:cold "menutrans N&ewer\ List:cnew No&uvelle\ liste:cnew menutrans N&ewer\ List:cnew Liste\ suivan&te:cnew menutrans Error\ &Window &Fentre\ d'erreurs menutrans &Update:cwin &Mettre\ \ jour:cwin menutrans &Open:copen &Ouvrir:copen menutrans &Close:cclose &Fermer:cclose " -SEP3- menutrans &Convert\ to\ HEX:%!xxd Convertir\ en\ he&xa:%!xxd menutrans Conve&rt\ back:%!xxd\ -r Dcon&vertir:%!xxd\ -r menutrans Se&T\ 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 &Prcdent " -SEP- menutrans &others au&tres menutrans &u-z &uvwxyz let g:menutrans_no_file = "[Aucun fichier]" menutrans &Window Fe&ntre menutrans &New^Wn &Nouvelle\ fentre^Wn menutrans S&plit^Ws &Fractionner^Ws menutrans Sp&lit\ To\ #^W^^ Fractionner\ p&our\ #^W^^ menutrans Split\ &Vertically^Wv Fractionner\ &verticalement^Wv menutrans Split\ File\ E&xplorer Fractionner\ &explorateur " -SEP1- menutrans &Close^Wc Fer&mer^Wc menutrans Close\ &Other(s)^Wo Fermer\ les\ &autres^Wo " -SEP2- menutrans Move\ &To &Dplacer\ vers\ le menutrans &Top^WK &Haut^WK menutrans &Bottom^WJ &Bas^WJ menutrans &Left\ side^WH Ct\ &gauche^WH menutrans &Right\ side^WL Ct\ &droit^WL menutrans Rotate\ &Up^WR Rotation\ vers\ le\ &haut^WR menutrans Rotate\ &Down^Wr Rotation\ vers\ le\ &bas^Wr " -SEP3- menutrans &Equal\ Size^W= galiser\ ta&illes^W= menutrans &Max\ Height^W_ Hau&teur\ maximale^W_ menutrans M&in\ Height^W1_ Ha&uteur\ minimale^W1_ menutrans Max\ &Width^W\| &Largeur\ maximale^W\| menutrans Min\ Widt&h^W1\| La&rgeur\ minimale^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 Slectionner\ &bloc menutrans Select\ &Word Slectionner\ &mot menutrans Select\ &Line Slectionner\ &ligne menutrans Select\ &Block Slectionner\ &bloc menutrans Select\ &All Slectionner\ &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 CrerEtiqu 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 prcdent tmenu ToolBar.Replace Remplacer endif if 0 " disabled; These are in the Windows menu tmenu ToolBar.New Nouvelle fentre tmenu ToolBar.WinSplit Fractionner fentre tmenu ToolBar.WinMax Maximiser fentre tmenu ToolBar.WinMin Minimiser fentre tmenu ToolBar.WinVSplit Fractionner verticalement tmenu ToolBar.WinMaxWidth Maximiser largeur fentre tmenu ToolBar.WinMinWidth Minimiser largeur fentre tmenu ToolBar.WinClose Fermer fentre 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 Crer 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 &Off Dsactiver 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 Modle\ 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\.\ gnrique menutrans Digital\ Command\ Lang DCL menutrans DNS/BIND\ zone Zone\ BIND/DNS menutrans Dylan\ interface Interface menutrans Dylan\ lid LID menutrans Elm\ filter\ rules Rgles\ 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\ gnrique 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 Dfinition\ 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 Scne\ 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 Dclaration\ SGML menutrans Shell\ script Script\ shell menutrans sh\ and\ ksh sh\ et\ ksh menutrans Sinda\ compare Comparaison\ Sinda menutrans Sinda\ input Entre\ Sinda menutrans Sinda\ output Sortie\ Sinda menutrans SKILL\ for\ Diva SKILL\ pour\ Diva menutrans Smarty\ Templates Patrons\ Smarty menutrans SNNS\ network Rseau\ SNNS menutrans SNNS\ pattern Motif\ SNNS menutrans SNNS\ result Rsultat\ SNNS menutrans Snort\ Configuration Config\.\ Snort menutrans Squid\ config Config\.\ Squid menutrans Subversion\ commit Commit\ Subversion menutrans TAK\ compare Comparaison\ TAK menutrans TAK\ input Entre\ 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 Entre\ Trasys menutrans Command\ Line Ligne\ de\ commande menutrans Geometry Gomtrie 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 Dcodeur\ 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\ surbrillance menutrans &Convert\ to\ HTML Con&vertir\ en\ HTML let &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/lang/menu_fr_fr.utf-8.vim000066400000000000000000000001311267703067000207750ustar00rootroot00000000000000" Menu Translations: French for UTF-8 encoding source :p:h/menu_fr_fr.latin1.vim vim-7.4.1689/runtime/lang/menu_french_france.1252.vim000066400000000000000000000001511267703067000221120ustar00rootroot00000000000000" Menu Translations: French for Windows CodePage 1252 encoding source :p:h/menu_fr_fr.latin1.vim vim-7.4.1689/runtime/lang/menu_german_germany.1252.vim000066400000000000000000000001511267703067000223220ustar00rootroot00000000000000" Menu Translations: German for Windows CodePage 1252 encoding source :p:h/menu_de_de.latin1.vim vim-7.4.1689/runtime/lang/menu_hu.iso_8859-2.vim000066400000000000000000000001361267703067000210030ustar00rootroot00000000000000" Menu Translations: Italian for UTF-8 encoding source :p:h/menu_hu_hu.iso_8859-2.vim vim-7.4.1689/runtime/lang/menu_hu.utf-8.vim000066400000000000000000000001311267703067000203130ustar00rootroot00000000000000" Menu Translations: Italian for UTF-8 encoding source :p:h/menu_hu_hu.utf-8.vim vim-7.4.1689/runtime/lang/menu_hu_hu.iso_8859-2.vim000066400000000000000000000262101267703067000215000ustar00rootroot00000000000000" Menu Translations: Hungarian (Magyar) " Original Translation: Zoltn rpdffy " Maintained By: Kontra Gergely " Last Change: 2012 May 01 " 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 gyorsbillentyt rendelni, lehetleg nem kezeteset. " Tovbbi tennival az y s z gyorsbillentyk kiirtsa, ezenkvl a g, j " billentyk irtsa is, mivel ez utbbiak alhzott vltozatt nem knny " felismerni. " Amennyiben valahol nem egyrtelmk a gyorsbillentyk (a gyorsbillentyt " letve nem hajtdik vgre a kiszemelt menpont, hanem csak kivlasztdik, " vagy msik menpont vlasztdik ki), vagy egyb hibt tallsz, krlek jelezd " nekem a fenti email cmen. " Mindennem visszajelzst szvesen fogadok. " Quit when menu translations have already been done. if exists("did_menu_trans") finish endif let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim scriptencoding iso-8859-2 " Help menu menutrans &Help &Sg menutrans &Overview &ttekints menutrans &How-to\ links &HOGYAN\ linkek menutrans &User\ Manual &Kziknyv menutrans &Credits &Szerzk,\ ksznetek menutrans Co&pying &Vdjegy menutrans O&rphans rv&k menutrans &Find\.\.\. Ke&ress\.\.\. menutrans &Version &Verzi menutrans &About &Nvjegy " File menu menutrans &File &Fjl menutrans &Open\.\.\.:e Meg&nyits\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp Megnyits\ j\ a&blakba\.\.\.:sp menutrans &New:enew j\ dok&umentum:enew menutrans &Close:close Be&zrs:close menutrans &Save:w &Ments:w menutrans Split\ &Diff\ with\.\.\. ssze&hasonlts\.\.\. menutrans Split\ Patched\ &By\.\.\. sszehasonlts\ &patch\ -el\.\.\. menutrans Save\ &As\.\.\.:sav Ment&s\ msknt\.\.\.:w menutrans &Print Nyomt&ats menutrans Sa&ve-Exit:wqa Ments\ s\ k&ilps:wqa menutrans E&xit:qa &Kilps:qa " Edit menu menutrans &Edit S&zerkeszts menutrans &Undou &Visszavonsu menutrans &Redo^R M&gis^R menutrans Rep&eat\. &Ismt\. menutrans Cu&t"+x &Kivgs"+x menutrans &Copy"+y &Msols"+y menutrans &Paste"+gP &Beilleszts"+gP menutrans Put\ &Before[p Beraks\ e&l[p menutrans Put\ &After]p Beraks\ &mg]p menutrans &Deletex &Trlsx menutrans &Select\ allggVG A&z\ sszes kijellseggvG menutrans &Find\.\.\. Ke&ress\.\.\. menutrans Find\ and\ Rep&lace\.\.\. Keress\ s\ c&sere\.\.\. menutrans Find\ and\ Rep&lace:%s Keress\ s\ c&sere:%s menutrans Find\ and\ Rep&lace Keress\ s\ c&sere menutrans Find\ and\ Rep&lace:s Keress\ s\ c&sere:s menutrans Settings\ &Window &Ablak\ belltsai menutrans &Global\ Settings l&talnos\ belltsok menutrans F&ile\ Settings &Fjl\ belltsok menutrans C&olor\ Scheme &Sznek menutrans &Keymap Billent&yzetkioszts " Edit.Global Settings menutrans Toggle\ Pattern\ &Highlight:set\ hls! &Minta\ kiemels\ BE/KI:set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! &Kis/nagybet\ azonos/klnbz:set\ ic! menutrans Toggle\ &Showmatch:set\ sm! &Zrjelpr\ mutatsa\ BE/KI:set\ sm! menutrans &Context\ lines &Kurzor\ ablak\ szltl menutrans &Virtual\ Edit &Virtulis\ szerkeszts menutrans Never &Soha menutrans Block\ Selection &Blokk\ kijellsekor menutrans Insert\ mode S&zveg\ bevitelekor menutrans Block\ and\ Insert Bl&okk\ kijellsekor\ s\ szveg\ bevitelekor menutrans Always &Mindig menutrans Toggle\ Insert\ &Mode:set\ im! &Szvegbeviteli\ md\ BE/KI:set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! &Vi\ kompatbilis\ md\ BE/Ki:set\ cp! menutrans Search\ &Path\.\.\. Ke&ressi\ tvonal\.\.\. menutrans Ta&g\ Files\.\.\. &Tag\ fjl\.\.\. menutrans Toggle\ &Toolbar &Eszkztr\ BE/KI menutrans Toggle\ &Bottom\ Scrollbar &Vzszintes\ Grgetsv\ BE/KI menutrans Toggle\ &Left\ Scrollbar &Bal\ grgetsv\ BE/KI menutrans Toggle\ &Right\ Scrollbar &Jobb\ grgetsv\ BE/KI menutrans None Nincs " Edit.File Settings menutrans Toggle\ Line\ &Numbering:set\ nu! Sorsz&mozs\ BE/KI:set\ nu! menutrans Toggle\ &List\ Mode:set\ list! &Lista\ md\ BE/KI:set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! Sor&trs\ BE/KI:set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! Sortrs\ s&zvgeknl\ BE/KI:set\ lbr! menutrans Toggle\ &expand-tab:set\ et! &Tab\ kifejts\ BE/KI:set\ et! menutrans Toggle\ &auto-indent:set\ ai! &Automatikus\ behzs\ BE/KI:set\ ai! menutrans Toggle\ &C-indenting:set\ cin! &C-behzs\ BE/KI:set\ cin! menutrans &Shiftwidth &Behzs\ mrtke\ ('sw') menutrans Soft\ &Tabstop T&abulls\ mrtke\ ('sts') menutrans Te&xt\ Width\.\.\. &Szveg\ szlessge\.\.\. menutrans &File\ Format\.\.\. &Fjlformtum\.\.\. " Tools menu menutrans &Tools &Eszkzk menutrans &Jump\ to\ this\ tagg^] &Ugrs\ a\ taghozg^] menutrans Jump\ &back^T Ugrs\ &vissza^T menutrans Build\ &Tags\ File &Tag\ fjl\ ksztse menutrans &Folding &Behajtsok menutrans &Make:make &Fordts:make menutrans &List\ Errors:cl &Hibk\ listja:cl menutrans L&ist\ Messages:cl! &zenetek\ listja:cl! menutrans &Next\ Error:cn &Kvetkez\ &hiba:cn menutrans &Previous\ Error:cp &Elz\ hiba:cp menutrans &Older\ List:cold &Rgebbi\ lista:cold menutrans N&ewer\ List:cnew &jabb\ lista:cnew menutrans Error\ &Window Hibaablak menutrans &Update:cwin &Frissts:cwin menutrans &Open:copen M&egnyits:copen menutrans &Close:cclose Be&zrs:cclose menutrans &Convert\ to\ HEX:%!xxd Norml->HEX\ nzet:%!xxd menutrans Conve&rt\ back:%!xxd\ -r HEX->Norml\ nzet:%!xxd\ -r menutrans &Set\ Compiler Fordt\ &megadsa " Tools.Folding menutrans &Enable/Disable\ foldszi Behajtsok\ BE&/KIzi menutrans &View\ Cursor\ Linezv &Aktulis\ sor\ ltszikzv menutrans Vie&w\ Cursor\ Line\ onlyzMzx &Csak\ aktulis\ sor\ ltszikzMzx menutrans C&lose\ more\ foldszm Kvetkez\ szint\ be&zrsazm menutrans &Close\ all\ foldszM sszes\ hajts\ &bezrsazM menutrans O&pen\ more\ foldszr Kvetkez\ szint\ ki&nyitsazr menutrans &Open\ all\ foldszR sszes\ hajts\ &kinyitsazR menutrans Fold\ Met&hod Behajtsok\ <rehozsa menutrans M&anual &Kzi menutrans I&ndent Be&hzs menutrans E&xpression Ki&fejezs menutrans S&yntax &Szintaxis menutrans &Diff &Diff-klnbsg menutrans Ma&rker &Jells menutrans Create\ &Foldzf &j\ behajtszf menutrans &Delete\ Foldzd Behajts\ &trlsezd menutrans Delete\ &All\ FoldszD ss&zes\ behajts\ trlsezD menutrans Fold\ col&umn\ width Behajtsok\ a\ &margn\ x\ oszlopban " Tools.Diff menutrans &Update &Frissts menutrans &Get\ Block Block\ &BE menutrans &Put\ Block Block\ &KI " Names for buffer menu. menutrans &Buffers &Pufferok menutrans &Refresh\ menu &Frissts menutrans Delete &Trls menutrans &Alternate &Csere menutrans &Next &Kvetkez menutrans &Previous &Elz " Window menu menutrans &Window &Ablak menutrans &New^Wn &j^Wn menutrans S&plit^Ws &Feloszts^Ws menutrans Sp&lit\ To\ #^W^^ Feloszts\ &#-val^W^^ menutrans Split\ &Vertically^Wv Feloszts\ F&gglegesen^Wv menutrans Split\ File\ E&xplorer j\ &intz menutrans &Close^Wc Be&zrs^Wc menutrans Close\ &Other(s)^Wo &Tbbi\ bezrsa^Wo menutrans Ne&xt^Ww &Kvetkez^Ww menutrans P&revious^WW &Elz^WW menutrans &Equal\ Size^W= &Azonos\ magassg^W= menutrans &Max\ Height^W_ Ma&x\ magassg^W_ menutrans M&in\ Height^W1_ &Min\ magassg^W1_ menutrans Max\ &Width^W\| Max\ &szlessg^W\| menutrans Min\ Widt&h^W1\| Mi&n\ szlessg^W1\| menutrans Move\ &To &Elmozdts menutrans &Top^WK &Fel^WK menutrans &Bottom^WJ &Le^WJ menutrans &Left\ side^WH &Balra^WH menutrans &Right\ side^WL &Jobbra^WL menutrans Rotate\ &Up^WR Grdts\ &felfel^WR menutrans Rotate\ &Down^Wr Grdts\ &lefel^Wr menutrans Select\ Fo&nt\.\.\. &Bettpus\.\.\. " The popup menu menutrans &Undo &Visszavons menutrans Cu&t &Kivgs menutrans &Copy &Msols menutrans &Paste &Beilleszts menutrans &Delete &Trls menutrans Select\ Blockwise Kijells\ blo&kknt menutrans Select\ &Word S&z\ kijellse menutrans Select\ &Line &Sor\ kijellse menutrans Select\ &Block B&lokk\ kijellse menutrans Select\ &All A&z\ sszes\ kijellse " The GUI toolbar if has("toolbar") if exists("*Do_toolbar_tmenu") delfun Do_toolbar_tmenu endif fun Do_toolbar_tmenu() tmenu ToolBar.Open Megnyits tmenu ToolBar.Save Ments tmenu ToolBar.SaveAll Mindet menti tmenu ToolBar.Print Nyomtats tmenu ToolBar.Undo Visszavons tmenu ToolBar.Redo Mgis tmenu ToolBar.Cut Kivgs tmenu ToolBar.Copy Msols tmenu ToolBar.Paste Beilleszts tmenu ToolBar.Find Keress tmenu ToolBar.FindNext Tovbb keress tmenu ToolBar.FindPrev Keress visszafel tmenu ToolBar.Replace Keress/csere tmenu ToolBar.LoadSesn Munkamenet beolvass tmenu ToolBar.SaveSesn Munkamenet ments tmenu ToolBar.RunScript Vim program indts tmenu ToolBar.Make Projekt pts tmenu ToolBar.Shell Shell indts tmenu ToolBar.RunCtags Tag pts tmenu ToolBar.TagJump Ugrs a kurzor alatti tagra tmenu ToolBar.Help Vim sg tmenu ToolBar.FindHelp Keress a Vim sgban endfun endif " Syntax menu menutrans &Syntax Sz&intaxis menutrans &Show\ filetypes\ in\ menu Fjl&tpusok\ 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\ ennl\ a\ fjlnl menutrans Co&lor\ test &Sznteszt menutrans &Highlight\ test Kiemels\ &teszt menutrans &Convert\ to\ HTML &HTML\ oldal\ ksztse " dialog texts let menutrans_no_file = "[Nincs file]" let menutrans_help_dialog = "rd be a kvnt szt vagy parancsot:\n\n A szvegbeviteli parancsok el rj i_-t (pl.: i_CTRL-X)\nA sorszerkesz parancsok el c_-t (pl.: c_)\nA vltozkat a ' jellel vedd krl (pl.: 'shiftwidth')" let g:menutrans_path_dialog = "rd be a keresett fjl lehetsges elrsi tjait, vesszvel elvlasztva" let g:menutrans_tags_dialog = "rd be a tag fjl lehetsges elrsi tjait, vesszvel elvlasztva" let g:menutrans_textwidth_dialog = "rd be a szveg szlessgt (0 = formzs kikapcsolva)" let g:menutrans_fileformat_dialog = "Vlaszd ki a fjl formtumt" let &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/lang/menu_hu_hu.utf-8.vim000066400000000000000000000251301267703067000210150ustar00rootroot00000000000000" Menu Translations: Hungarian (Magyar) " Original Translation: Zoltán Árpádffy " Maintained By: Kontra Gergely " Last Change: 2012 May 01 " " 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 let s:keepcpo= &cpo set cpo&vim scriptencoding utf-8 " Help menu menutrans &Help &Súgó menutrans &Overview Á&ttekintés 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\.\.\.:e Meg&nyitás\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp Megnyitás\ új\ a&blakba\.\.\.:sp menutrans &New:enew Új\ dok&umentum:enew menutrans &Close:close Be&zárás:close menutrans &Save:w &Mentés:w menutrans Split\ &Diff\ with\.\.\. Össze&hasonlítás\.\.\. menutrans Split\ Patched\ &By\.\.\. Összehasonlítás\ &patch\ -el\.\.\. menutrans Save\ &As\.\.\.:sav Menté&s\ másként\.\.\.:w menutrans &Print Nyomt&atás menutrans Sa&ve-Exit:wqa Mentés\ és\ k&ilépés:wqa menutrans E&xit:qa &Kilépés:qa " Edit menu menutrans &Edit S&zerkesztés menutrans &Undou &Visszavonásu menutrans &Redo^R Mé&gis^R menutrans Rep&eat\. &Ismét\. menutrans Cu&t"+x &Kivágás"+x menutrans &Copy"+y &Másolás"+y menutrans &Paste"+gP &Beillesztés"+gP menutrans Put\ &Before[p Berakás\ e&lé[p menutrans Put\ &After]p Berakás\ &mögé]p menutrans &Deletex &Törlésx menutrans &Select\ allggVG A&z\ összes kijelöléseggvG menutrans &Find\.\.\. Ke&resés\.\.\. menutrans Find\ and\ Rep&lace\.\.\. Keresés\ és\ c&sere\.\.\. menutrans Find\ and\ Rep&lace:%s Keresés\ és\ c&sere:%s menutrans Find\ and\ Rep&lace Keresés\ és\ c&sere menutrans Find\ and\ Rep&lace:s Keresés\ és\ c&sere: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:set\ hls! &Minta\ kiemelés\ BE/KI:set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! &Kis/nagybetű\ azonos/különböző:set\ ic! menutrans Toggle\ &Showmatch:set\ sm! &Zárójelpár\ mutatása\ BE/KI: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:set\ im! &Szövegbeviteli\ mód\ BE/KI:set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! &Vi\ kompatíbilis\ mód\ BE/Ki: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:set\ nu! Sorszá&mozás\ BE/KI:set\ nu! menutrans Toggle\ &List\ Mode:set\ list! &Lista\ mód\ BE/KI:set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! Sor&törés\ BE/KI:set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! Sortörés\ s&zóvégeknél\ BE/KI:set\ lbr! menutrans Toggle\ &expand-tab:set\ et! &Tab\ kifejtés\ BE/KI:set\ et! menutrans Toggle\ &auto-indent:set\ ai! &Automatikus\ behúzás\ BE/KI:set\ ai! menutrans Toggle\ &C-indenting:set\ cin! &C-behúzás\ BE/KI: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\ tagg^] &Ugrás\ a\ taghozg^] menutrans Jump\ &back^T Ugrás\ &vissza^T menutrans Build\ &Tags\ File &Tag\ fájl\ készítése menutrans &Folding &Behajtások menutrans &Make:make &Fordítás:make menutrans &List\ Errors:cl &Hibák\ listája:cl menutrans L&ist\ Messages:cl! Ü&zenetek\ listája:cl! menutrans &Next\ Error:cn &Következő\ &hiba:cn menutrans &Previous\ Error:cp &Előző\ hiba:cp menutrans &Older\ List:cold &Régebbi\ lista:cold menutrans N&ewer\ List:cnew &Újabb\ lista:cnew menutrans Error\ &Window Hibaablak menutrans &Update:cwin &Frissítés:cwin menutrans &Open:copen M&egnyitás:copen menutrans &Close:cclose Be&zárás:cclose menutrans &Convert\ to\ HEX:%!xxd Normál->HEX\ nézet:%!xxd menutrans Conve&rt\ back:%!xxd\ -r HEX->Normál\ nézet:%!xxd\ -r menutrans &Set\ Compiler Fordító\ &megadása " Tools.Folding menutrans &Enable/Disable\ foldszi Behajtások\ BE&/KIzi menutrans &View\ Cursor\ Linezv &Aktuális\ sor\ látszikzv menutrans Vie&w\ Cursor\ Line\ onlyzMzx &Csak\ aktuális\ sor\ látszikzMzx menutrans C&lose\ more\ foldszm Következő\ szint\ be&zárásazm menutrans &Close\ all\ foldszM Összes\ hajtás\ &bezárásazM menutrans O&pen\ more\ foldszr Következő\ szint\ ki&nyitásazr menutrans &Open\ all\ foldszR Összes\ hajtás\ &kinyitásazR 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\ &Foldzf Ú&j\ behajtászf menutrans &Delete\ Foldzd Behajtás\ &törlésezd menutrans Delete\ &All\ FoldszD Öss&zes\ behajtás\ törlésezD 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^Wn Ú&j^Wn menutrans S&plit^Ws &Felosztás^Ws menutrans Sp&lit\ To\ #^W^^ Felosztás\ &#-val^W^^ menutrans Split\ &Vertically^Wv Felosztás\ Fü&ggőlegesen^Wv menutrans Split\ File\ E&xplorer Új\ &intéző menutrans &Close^Wc Be&zárás^Wc menutrans Close\ &Other(s)^Wo &Többi\ bezárása^Wo menutrans Ne&xt^Ww &Következő^Ww menutrans P&revious^WW &Előző^WW menutrans &Equal\ Size^W= &Azonos\ magasság^W= menutrans &Max\ Height^W_ Ma&x\ magasság^W_ menutrans M&in\ Height^W1_ &Min\ magasság^W1_ menutrans Max\ &Width^W\| Max\ &szélesség^W\| menutrans Min\ Widt&h^W1\| Mi&n\ szélesség^W1\| menutrans Move\ &To &Elmozdítás menutrans &Top^WK &Fel^WK menutrans &Bottom^WJ &Le^WJ menutrans &Left\ side^WH &Balra^WH menutrans &Right\ side^WL &Jobbra^WL menutrans Rotate\ &Up^WR Gördítés\ &felfelé^WR menutrans Rotate\ &Down^Wr Gördítés\ &lefelé^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_)\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" let &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/lang/menu_it.latin1.vim000066400000000000000000000001071267703067000205430ustar00rootroot00000000000000" Menu Translations: Italian source :p:h/menu_it_it.latin1.vim vim-7.4.1689/runtime/lang/menu_it.utf-8.vim000066400000000000000000000001321267703067000203140ustar00rootroot00000000000000" Menu Translations: Italian for UTF-8 encoding source :p:h/menu_it_it.latin1.vim vim-7.4.1689/runtime/lang/menu_it_it.latin1.vim000066400000000000000000000311111267703067000212360ustar00rootroot00000000000000" Menu Translations: Italian / Italiano " Maintainer: Antonio Colombo " Vlad Sandrini " Luciano Montanaro " Last Change: 2012 May 01 " Quit when menu translations have already been done. if exists("did_menu_trans") finish endif let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim scriptencoding iso-8859-1 " Help / Aiuto menut &Help &Aiuto menut &Overview &Panoramica 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 modo Input (ad.es.: i_CTRL-X)\nPremetti c_ per comandi che editano la linea-comandi (ad.es.: c_)\nPremetti ' per un nome di opzione (ad.es.: 'shiftwidth')" " File menu "menut &File &File " menut &Open\.\.\.:e &Apri\.\.\.:e menut Sp&lit-Open\.\.\.:sp A&Pri\ nuova\ finestra\.\.\.:sp menut Open\ Tab\.\.\.:tabnew Apri\ nuova\ &Linguetta\.\.\.:tabnew menut &New:enew &Nuovo:enew menut &Close:close &Chiudi:close menut &Save:w &Salva:w menut Save\ &As\.\.\.:sav Salva\ &Con\ nome\.\.\.: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:wqa Sa&Lva\ ed\ esci:wqa menut E&xit:qa &Esci:qa " Edit / Modifica menut &Edit &Modifica menut &Undou &Annullau menut &Redo^R &Ripristina^R menut Rep&eat\. Ri&Peti\. menut Cu&t"+x &Taglia"+x menut &Copy"+y &Copia"+y menut &Paste"+gP &Incolla"+gP menut Put\ &Before[p &Metti\ davanti[p menut Put\ &After]p M&Etti\ dietro]p menut &Deletex Cance&Llax menut &Select\ allggVG Seleziona\ &TuttoggVG menut &Select\ AllggVG Seleziona\ &TuttoggVG menut &Find\.\.\. &Cerca\.\.\. menut Find\ and\ Rep&lace\.\.\. &Sostituisci\.\.\. menut Settings\ &Window &Finestra\ impostazioni menut Startup\ &Settings Impostazioni\ di\ &Avvio menut &Global\ Settings Impostazioni\ &Globali menut Question Domanda " Edit / Modifica Impostazioni Globali menut &Global\ Settings Impostazioni\ &Globali menut Toggle\ Pattern\ &Highlight:set\ hls! &Evidenzia\ ricerche\ S/No:set\ hls! menut Toggle\ &Ignore-case:set\ ic! &Ignora\ maiusc\.-minusc\.\ S/No:set\ ic! menut Toggle\ &Showmatch:set\ sm! Indica\ &Corrispondente\ S/No:set\ sm! menut &Context\ lines &Linee\ di\ contesto menut &Virtual\ Edit &Edit\ virtuale menut Never Mai menut Block\ Selection Selezione\ blocco menut Insert\ mode Modo\ insert menut Block\ and\ Insert Selezione\ blocco+inserimento menut Always Sempre menut Toggle\ Insert\ &Mode:set\ im! &Modo\ insert\ S/No:set\ im! menut Toggle\ Vi\ C&ompatible:set\ cp! C&Ompatibile\ VI\ S/No:set\ cp! menut Search\ &Path\.\.\. &Percorso\ 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:set\ nu! &Numerazione\ \ S/No:set\ nu! menut Toggle\ relati&ve\ Line\ Numbering:set\ rnu! Numerazione\ relati&Va\ S/No:set\ rnu! menut Toggle\ &List\ Mode:set\ list! Modo\ &List\ S/No:set\ list! menut Toggle\ Line\ &Wrap:set\ wrap! Linee\ &Continuate\ S/No:set\ wrap! menut Toggle\ W&rap\ at\ word:set\ lbr! A\ capo\ alla\ &Parola\ S/No:set\ lbr! menut Toggle\ &expand-tab:set\ et! &Espandi\ tabulazione\ S/No:set\ et! menut Toggle\ &auto-indent:set\ ai! Indentazione\ &Automatica\ S/No:set ai! menut Toggle\ &C-indenting:set\ cin! Indentazione\ stile\ &C\ S/No: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\ tagg^] &Vai\ a\ questa\ tagg^] menut Jump\ &back^T Torna\ &Indietro^T menut Build\ &Tags\ File Costruisci\ file\ &Tags\ " Menu ortografia / Spelling menut &Spelling &Ortografia menut &Spell\ Check\ On Attiva\ &Controllo\ ortografico menut Spell\ Check\ &Off &Disattiva\ controllo\ ortografico menut To\ &Next\ error]s Errore\ &Seguente]s menut To\ &Previous\ error[s Errore\ &Precedente[s menut Suggest\ &Correctionsz= &Suggerimentiz= menut &Repeat\ correction:spellrepall &Ripeti\ correzione:spellrepall menut Set\ language\ to\ "en" Imposta\ lingua\ a\ "en" menut Set\ language\ to\ "en_au" Imposta\ lingua\ a\ "en_au" menut Set\ language\ to\ "en_ca" Imposta\ lingua\ a\ "en_ca" menut Set\ language\ to\ "en_gb" Imposta\ lingua\ a\ "en_gb" menut Set\ language\ to\ "en_nz" Imposta\ lingua\ a\ "en_nz" menut Set\ language\ to\ "en_us" Imposta\ lingua\ a\ "en_us" menut Set\ language\ to\ "it" Imposta\ lingua\ a\ "it" menut Set\ language\ to\ "it_it" Imposta\ lingua\ a\ "it_it" menut Set\ language\ to\ "it_ch" Imposta\ lingua\ a\ "it_ch" menut &Find\ More\ Languages &Trova\ altre\ lingue " Menu piegature / Fold if has("folding") menut &Folding &Piegature " apri e chiudi piegature menut &Enable/Disable\ foldszi Pi&egature\ S/Nozi menut &View\ Cursor\ Linezv &Vedi\ linea\ col\ Cursorezv menut Vie&w\ Cursor\ Line\ onlyzMzx Vedi\ &Solo\ linea\ col\ CursorezMzx menut C&lose\ more\ foldszm C&Hiudi\ pi\ piegaturezm menut &Close\ all\ foldszM &Chiudi\ tutte\ le\ piegaturezM menut O&pen\ more\ foldszr A&Pri\ pi\ piegaturezr menut &Open\ all\ foldszR &Apri\ tutte\ le\ piegaturezR " 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\ &Foldzf Crea\ &Piegaturazf menut &Delete\ Foldzd &Leva\ piegaturazd menut Delete\ &All\ FoldszD Leva\ &Tutte\ le\ piegaturezD " 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:make Esegui\ &Make:make menut &List\ Errors:cl Lista\ &Errori:cl menut L&ist\ Messages:cl! Lista\ &Messaggi:cl! menut &Next\ Error:cn Errore\ s&Uccessivo:cn menut &Previous\ Error:cp Errore\ &Precedente:cp menut &Older\ List:cold Lista\ men&O\ recente:cold menut N&ewer\ List:cnew Lista\ pi\ rece&Nte:cnew menut Error\ &Window &Finestra\ errori menut &Update:cwin A&Ggiorna:cwin menut &Open:copen &Apri:copen menut &Close:cclose &Chiudi:cclose menut &Convert\ to\ HEX:%!xxd &Converti\ a\ esadecimale:%!xxd menut Conve&rt\ back:%!xxd\ -r Conve&rti\ da\ esadecimale:%!xxd\ -r menut Se&T\ 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 &S\ Attiva\ solo\ \ 'syntax' menut Set\ '&filetype'\ too &F\ 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^Wn &Nuova^Wn menut S&plit^Ws &Dividi\ lo\ schermo^Ws menut Sp&lit\ To\ #^W^^ D&Ividi\ verso\ #^W^^ menut Split\ &Vertically^Wv Di&Vidi\ verticalmente^Wv menut Split\ File\ E&xplorer Aggiungi\ finestra\ e&Xplorer menut &Close^Wc &Chiudi^Wc menut Close\ &Other(s)^Wo C&Hiudi\ altra(e)^Wo menut Move\ &To &Muovi\ verso menut &Top^WK &Cima^WK menut &Bottom^WJ &Fondo^WJ menut &Left\ side^WH Lato\ &Sinistro^WH menut &Right\ side^WL Lato\ &Destro^WL menut Rotate\ &Up^WR Ruota\ verso\ l'&Alto^WR menut Rotate\ &Down^Wr Ruota\ verso\ il\ &Basso^Wr menut &Equal\ Size^W= &Uguale\ ampiezza^W= menut &Max\ Height^W_ &Altezza\ massima^W_ menut M&in\ Height^W1_ A&Ltezza\ minima^W1_ menut Max\ &Width^W\| Larghezza\ massima^W\| menut Min\ Widt&h^W1\| Larghezza\ minima^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 let &cpo = s:keepcpo unlet s:keepcpo " vim: set sw=2 : vim-7.4.1689/runtime/lang/menu_it_it.utf-8.vim000066400000000000000000000001321267703067000210100ustar00rootroot00000000000000" Menu Translations: Italian for UTF-8 encoding source :p:h/menu_it_it.latin1.vim vim-7.4.1689/runtime/lang/menu_italian_italy.1252.vim000066400000000000000000000001221267703067000221500ustar00rootroot00000000000000" Menu Translations: Italian for Latin1 source :p:h/menu_it_it.latin1.vim vim-7.4.1689/runtime/lang/menu_ja.cp932.vim000066400000000000000000000004441267703067000201750ustar00rootroot00000000000000" Menu Translations: Japanese (for Windows) " Translated By: MURAOKA Taro " Last Change: 15-Jun-2012. " " Copyright (C) 2004,12 MURAOKA Taro " THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE. source :p:h/menu_japanese_japan.932.vim vim-7.4.1689/runtime/lang/menu_ja.euc-jp.vim000066400000000000000000000005331267703067000205170ustar00rootroot00000000000000" Menu Translations: Japanese (for UNIX) " Translated By: MURAOKA Taro " Last Change: 15-Jun-2012. " " Copyright (C) 2004,12 MURAOKA Taro " THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE. " eucjp is the same as euc-jp. Source the other one from here. source :p:h/menu_ja_jp.euc-jp.vim vim-7.4.1689/runtime/lang/menu_ja.eucjp.vim000066400000000000000000000005331267703067000204420ustar00rootroot00000000000000" Menu Translations: Japanese (for UNIX) " Translated By: MURAOKA Taro " Last Change: 15-Jun-2012. " " Copyright (C) 2004,12 MURAOKA Taro " THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE. " eucjp is the same as euc-jp. Source the other one from here. source :p:h/menu_ja_jp.euc-jp.vim vim-7.4.1689/runtime/lang/menu_ja.ujis.vim000066400000000000000000000005321267703067000203050ustar00rootroot00000000000000" Menu Translations: Japanese (for UNIX) " Translated By: MURAOKA Taro " Last Change: 15-Jun-2012. " " Copyright (C) 2004,12 MURAOKA Taro " THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE. " ujis is the same as euc-jp. Source the other one from here. source :p:h/menu_ja_jp.euc-jp.vim vim-7.4.1689/runtime/lang/menu_ja.utf-8.vim000066400000000000000000000002071267703067000202750ustar00rootroot00000000000000" Menu Translations: Japanese " eucjp is the same as euc-jp. Source the other one from here. source :p:h/menu_ja_jp.utf-8.vim vim-7.4.1689/runtime/lang/menu_ja_jp.cp932.vim000066400000000000000000000004441267703067000206660ustar00rootroot00000000000000" Menu Translations: Japanese (for Windows) " Translated By: MURAOKA Taro " Last Change: 15-Jun-2012. " " Copyright (C) 2004,12 MURAOKA Taro " THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE. source :p:h/menu_japanese_japan.932.vim vim-7.4.1689/runtime/lang/menu_ja_jp.euc-jp.vim000066400000000000000000000300741267703067000212130ustar00rootroot00000000000000" vi:set ts=8 sts=8 sw=8 tw=0: " " Menu Translations: Japanese (EUC-JP) " Last Translator: MURAOKA Taro " Last Change: 28-Jan-2016. " " Copyright (C) 2001-2016 MURAOKA Taro , " vim-jp (http://vim-jp.org/) " " THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE. " Quit when menu translations have already been done. if exists("did_menu_trans") finish endif let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim scriptencoding euc-jp " Help menu menutrans &Help إ(&H) menutrans &Overview ά(&O) 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_)\nץ̾ˤ ' ղäޤ. (: 'shiftwidth')" " File menu menutrans &File ե(&F) menutrans &Open\.\.\.:e (&O)\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp ʬ䤷Ƴ(&L)\.\.\.:sp menutrans Open\ Tab\.\.\.:tabnew ֥ڡdz:tabnew menutrans &New:enew (&N):enew menutrans &Close:close Ĥ(&C):close menutrans &Save:w ¸(&S):w menutrans Save\ &As\.\.\.:sav ̾դ¸(&A)\.\.\.:sav menutrans Split\ &Diff\ with\.\.\. ʬɽ(&D)\.\.\. menutrans Split\ Patched\ &By\.\.\. ѥå̤ɽ(&B)\.\.\. menutrans &Print (&P) menutrans Sa&ve-Exit:wqa ¸ƽλ(&V):wqa menutrans E&xit:qa λ(&X):qa " Edit menu menutrans &Edit Խ(&E) menutrans &Undou ä(&U)u menutrans &Redo^R ⤦٤(&R)^R menutrans Rep&eat\. ֤(&E)\. menutrans Cu&t"+x ڤ(&T)"+x menutrans &Copy"+y ԡ(&C)"+y menutrans &Paste"+gP Žդ(&P)"+gP menutrans Put\ &Before[p Ž(&B)[p menutrans Put\ &After]p Ž(&A)]p menutrans &Deletex ä(&D)x menutrans &Select\ AllggVG (&S)ggVG menutrans &Find\.\.\. (&F)\.\.\. menutrans &Find/ (&F)/ menutrans Find\ and\ Rep&lace\.\.\. ִ(&L)\.\.\. menutrans Find\ and\ Rep&lace:%s ִ(&L):%s menutrans Find\ and\ Rep&lace:s ִ(&L):s "menutrans Options\.\.\. ץ(&O)\.\.\. menutrans Settings\ &Window ꥦɥ(&W) menutrans Startup\ &Settings ư(&S) " Edit/Global Settings menutrans &Global\ Settings (&G) menutrans Toggle\ Pattern\ &Highlight:set\ hls! \ ѥĴ(&H):set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! \ 羮ʸ(&I):set\ ic! menutrans Toggle\ &Showmatch:set\ sm! \ ޥåɽ(&S):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:set\ im! \ (鿴)⡼(&M):set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! \ Viߴ⡼(&O):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:set\ nu! \ ֹɽ(&N):set\ nu! menutrans Toggle\ relati&ve\ Line\ Numbering:set\ rnu! \ йֹɽ(&V):set\ rnu! menutrans Toggle\ &List\ Mode:set\ list! \ ꥹȥ⡼(&L):set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! \ ֤(&W):set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! \ ñ֤(&R):set\ lbr! menutrans Toggle\ &expand-tab:set\ et! \ Ÿ(&E):set\ et! menutrans Toggle\ &auto-indent:set\ ai! \ ư(&A):set\ ai! menutrans Toggle\ &C-indenting:set\ cin! \ C(&C):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\ tagg^] (&J)g^] menutrans Jump\ &back^T (&B)^T menutrans Build\ &Tags\ File ե(&T) menutrans &Make:make ӥ(&M):make menutrans &List\ Errors:cl 顼ꥹ(&L):cl menutrans L&ist\ Messages:cl! åꥹ(&I):cl! menutrans &Next\ Error:cn Υ顼(&N):cn menutrans &Previous\ Error:cp Υ顼(&P):cp menutrans &Older\ List:cold Ťꥹ(&O):cold menutrans N&ewer\ List:cnew ꥹ(&E):cnew menutrans Error\ &Window 顼ɥ(&W) menutrans &Update:cwin (&U):cwin menutrans &Open:copen (&O):copen menutrans &Close:cclose Ĥ(&C):cclose menutrans &Convert\ to\ HEX:%!xxd HEXѴ(&C):%!xxd menutrans Conve&rt\ back:%!xxd\ -r HEXѴ(&R)%!xxd\ -r menutrans Se&T\ Compiler ѥ(&T) " Tools.Spelling Menu menutrans &Spelling ڥ(&S) menutrans &Spell\ Check\ On ڥåͭ(&S) menutrans Spell\ Check\ &Off ڥå̵(&O) menutrans To\ &Next\ error]s Υ顼(&N)]s menutrans To\ &Previous\ error[s Υ顼(&P)[s menutrans Suggest\ &Correctionsz= (&C)z= menutrans &Repeat\ correction:spellrepall 򷫤֤(&R):spellrepall menutrans Set\ language\ to\ "en" \ "en"\ ꤹ menutrans Set\ language\ to\ "en_au" \ "en_au"\ ꤹ menutrans Set\ language\ to\ "en_ca" \ "en_ca"\ ꤹ menutrans Set\ language\ to\ "en_gb" \ "en_gb"\ ꤹ menutrans Set\ language\ to\ "en_nz" \ "en_nz"\ ꤹ menutrans Set\ language\ to\ "en_us" \ "en_us"\ ꤹ menutrans &Find\ More\ Languages ¾θ򸡺(&F) " Tools.Fold Menu menutrans &Folding ޾(&F) " open close folds menutrans &Enable/Disable\ foldszi ͭ/̵(&E)zi menutrans &View\ Cursor\ Linezv Ԥɽ(&V)zv menutrans Vie&w\ Cursor\ Line\ onlyzMzx Ԥɽ(&W)zMzx menutrans C&lose\ more\ foldszm ޾ߤĤ(&L)zm menutrans &Close\ all\ foldszM ޾ߤĤ(&C)zM menutrans O&pen\ more\ foldszr ޾ߤ򳫤(&P)zr menutrans &Open\ all\ foldszR ޾ߤ򳫤(&O)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\ &Foldzf ޾ߺ(&F)zf menutrans &Delete\ Foldzd ޾ߺ(&D)zd menutrans Delete\ &All\ FoldszD ޾ߺ(&A)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^Wn (&N)^Wn menutrans S&plit^Ws ʬ(&P)^Ws menutrans Sp&lit\ To\ #^W^^ ΢Хåեʬ(&L)^W^^ menutrans Split\ &Vertically^Wv ľʬ(&V)^Wv menutrans Split\ File\ E&xplorer ե륨ץ(&X) menutrans &Close^Wc Ĥ(&C)^Wc menutrans Move\ &To ư(&T) menutrans &Top^WK (&T)^WK menutrans &Bottom^WJ (&B)^WJ menutrans &Left\ side^WH (&L)^WH menutrans &Right\ side^WL (&R)^WL menutrans Close\ &Other(s)^Wo ¾Ĥ(&O)^Wo menutrans Ne&xt^Ww (&X)^Ww menutrans P&revious^WW (&R)^WW menutrans &Equal\ Size^W= Ʊ⤵(&E)^W= menutrans &Max\ Height^W_ (&M)^W_ menutrans M&in\ Height^W1_ Ǿ(&i)^W1_ menutrans Max\ &Width^W\| (&W)^W\| menutrans Min\ Widt&h^W1\| Ǿ(&H)^W1\| menutrans Rotate\ &Up^WR ˥ơ(&U)^WR menutrans Rotate\ &Down^Wr ˥ơ(&D)^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\ &Sentence ʸ(&S) menutrans Select\ Pa&ragraph (&R) 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) let &cpo = s:keepcpo unlet s:keepcpo " filler to avoid the line above being recognized as a modeline " filler vim-7.4.1689/runtime/lang/menu_ja_jp.eucjp.vim000066400000000000000000000005331267703067000211330ustar00rootroot00000000000000" Menu Translations: Japanese (for UNIX) " Translated By: MURAOKA Taro " Last Change: 15-Jun-2012. " " Copyright (C) 2004,12 MURAOKA Taro " THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE. " eucjp is the same as euc-jp. Source the other one from here. source :p:h/menu_ja_jp.euc-jp.vim vim-7.4.1689/runtime/lang/menu_ja_jp.ujis.vim000066400000000000000000000005321267703067000207760ustar00rootroot00000000000000" Menu Translations: Japanese (for UNIX) " Translated By: MURAOKA Taro " Last Change: 15-Jun-2012. " " Copyright (C) 2004,12 MURAOKA Taro " THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE. " ujis is the same as euc-jp. Source the other one from here. source :p:h/menu_ja_jp.euc-jp.vim vim-7.4.1689/runtime/lang/menu_ja_jp.utf-8.vim000066400000000000000000000326071267703067000207770ustar00rootroot00000000000000" vi:set ts=8 sts=8 sw=8 tw=0: " " Menu Translations: Japanese (UTF-8) " Last Translator: MURAOKA Taro " Last Change: 28-Jan-2016. " " Copyright (C) 2001-2016 MURAOKA Taro , " vim-jp (http://vim-jp.org/) " " THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE. " Quit when menu translations have already been done. if exists("did_menu_trans") finish endif let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim scriptencoding utf-8 " Help menu menutrans &Help ヘルプ(&H) menutrans &Overview 概略(&O) 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_)\nオプションの名前には ' を付加します. (例: 'shiftwidth')" " File menu menutrans &File ファイル(&F) menutrans &Open\.\.\.:e 開く(&O)\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp 分割して開く(&L)\.\.\.:sp menutrans Open\ Tab\.\.\.:tabnew タブページで開く:tabnew menutrans &New:enew 新規作成(&N):enew menutrans &Close:close 閉じる(&C):close menutrans &Save:w 保存(&S):w menutrans Save\ &As\.\.\.:sav 名前を付けて保存(&A)\.\.\.:sav menutrans Split\ &Diff\ with\.\.\. 差分表示(&D)\.\.\. menutrans Split\ Patched\ &By\.\.\. パッチ結果を表示(&B)\.\.\. menutrans &Print 印刷(&P) menutrans Sa&ve-Exit:wqa 保存して終了(&V):wqa menutrans E&xit:qa 終了(&X):qa " Edit menu menutrans &Edit 編集(&E) menutrans &Undou 取り消す(&U)u menutrans &Redo^R もう一度やる(&R)^R menutrans Rep&eat\. 繰り返す(&E)\. menutrans Cu&t"+x 切り取り(&T)"+x menutrans &Copy"+y コピー(&C)"+y menutrans &Paste"+gP 貼り付け(&P)"+gP menutrans Put\ &Before[p 前に貼る(&B)[p menutrans Put\ &After]p 後に貼る(&A)]p menutrans &Deletex 消す(&D)x menutrans &Select\ AllggVG 全て選択(&S)ggVG menutrans &Find\.\.\. 検索(&F)\.\.\. menutrans &Find/ 検索(&F)/ menutrans Find\ and\ Rep&lace\.\.\. 置換(&L)\.\.\. menutrans Find\ and\ Rep&lace:%s 置換(&L):%s menutrans Find\ and\ Rep&lace:s 置換(&L):s "menutrans Options\.\.\. オプション(&O)\.\.\. menutrans Settings\ &Window 設定ウィンドウ(&W) menutrans Startup\ &Settings 起動時の設定(&S) " Edit/Global Settings menutrans &Global\ Settings 全体設定(&G) menutrans Toggle\ Pattern\ &Highlight:set\ hls! \ パターン強調切替(&H):set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! \ 大小文字区別切替(&I):set\ ic! menutrans Toggle\ &Showmatch:set\ sm! \ マッチ表示切替(&S):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:set\ im! \ 挿入(初心者)モード切替(&M):set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! \ Vi互換モード切替(&O):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:set\ nu! \ 行番号表示切替(&N):set\ nu! menutrans Toggle\ relati&ve\ Line\ Numbering:set\ rnu! \ 相対行番号表示切替(&V):set\ rnu! menutrans Toggle\ &List\ Mode:set\ list! \ リストモード切替(&L):set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! \ 行折返し切替(&W):set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! \ 単語折返し切替(&R):set\ lbr! menutrans Toggle\ &expand-tab:set\ et! \ タブ展開切替(&E):set\ et! menutrans Toggle\ &auto-indent:set\ ai! \ 自動字下げ切替(&A):set\ ai! menutrans Toggle\ &C-indenting:set\ cin! \ C言語字下げ切替(&C):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\ tagg^] タグジャンプ(&J)g^] menutrans Jump\ &back^T 戻る(&B)^T menutrans Build\ &Tags\ File タグファイル作成(&T) menutrans &Make:make ビルド(&M):make menutrans &List\ Errors:cl エラーリスト(&L):cl menutrans L&ist\ Messages:cl! メッセージリスト(&I):cl! menutrans &Next\ Error:cn 次のエラーへ(&N):cn menutrans &Previous\ Error:cp 前のエラーへ(&P):cp menutrans &Older\ List:cold 古いリスト(&O):cold menutrans N&ewer\ List:cnew 新しいリスト(&E):cnew menutrans Error\ &Window エラーウィンドウ(&W) menutrans &Update:cwin 更新(&U):cwin menutrans &Open:copen 開く(&O):copen menutrans &Close:cclose 閉じる(&C):cclose menutrans &Convert\ to\ HEX:%!xxd HEXへ変換(&C):%!xxd menutrans Conve&rt\ back:%!xxd\ -r HEXから逆変換(&R)%!xxd\ -r menutrans Se&T\ Compiler コンパイラ設定(&T) " Tools.Spelling Menu menutrans &Spelling スペリング(&S) menutrans &Spell\ Check\ On スペルチェック有効(&S) menutrans Spell\ Check\ &Off スペルチェック無効(&O) menutrans To\ &Next\ error]s 次のエラー(&N)]s menutrans To\ &Previous\ error[s 前のエラー(&P)[s menutrans Suggest\ &Correctionsz= 修正候補(&C)z= menutrans &Repeat\ correction:spellrepall 修正を繰り返す(&R):spellrepall menutrans Set\ language\ to\ "en" 言語を\ "en"\ に設定する menutrans Set\ language\ to\ "en_au" 言語を\ "en_au"\ に設定する menutrans Set\ language\ to\ "en_ca" 言語を\ "en_ca"\ に設定する menutrans Set\ language\ to\ "en_gb" 言語を\ "en_gb"\ に設定する menutrans Set\ language\ to\ "en_nz" 言語を\ "en_nz"\ に設定する menutrans Set\ language\ to\ "en_us" 言語を\ "en_us"\ に設定する menutrans &Find\ More\ Languages 他の言語を検索する(&F) " Tools.Fold Menu menutrans &Folding 折畳み(&F) " open close folds menutrans &Enable/Disable\ foldszi 有効/無効切替(&E)zi menutrans &View\ Cursor\ Linezv カーソル行を表示(&V)zv menutrans Vie&w\ Cursor\ Line\ onlyzMzx カーソル行だけを表示(&W)zMzx menutrans C&lose\ more\ foldszm 折畳みを閉じる(&L)zm menutrans &Close\ all\ foldszM 全折畳みを閉じる(&C)zM menutrans O&pen\ more\ foldszr 折畳みを開く(&P)zr menutrans &Open\ all\ foldszR 全折畳みを開く(&O)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\ &Foldzf 折畳み作成(&F)zf menutrans &Delete\ Foldzd 折畳み削除(&D)zd menutrans Delete\ &All\ FoldszD 全折畳み削除(&A)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^Wn 新規作成(&N)^Wn menutrans S&plit^Ws 分割(&P)^Ws menutrans Sp&lit\ To\ #^W^^ 裏バッファへ分割(&L)^W^^ menutrans Split\ &Vertically^Wv 垂直分割(&V)^Wv menutrans Split\ File\ E&xplorer ファイルエクスプローラ(&X) menutrans &Close^Wc 閉じる(&C)^Wc menutrans Move\ &To 移動(&T) menutrans &Top^WK 上(&T)^WK menutrans &Bottom^WJ 下(&B)^WJ menutrans &Left\ side^WH 左(&L)^WH menutrans &Right\ side^WL 右(&R)^WL menutrans Close\ &Other(s)^Wo 他を閉じる(&O)^Wo menutrans Ne&xt^Ww 次へ(&X)^Ww menutrans P&revious^WW 前へ(&R)^WW menutrans &Equal\ Size^W= 同じ高さに(&E)^W= menutrans &Max\ Height^W_ 最大高に(&M)^W_ menutrans M&in\ Height^W1_ 最小高に(&i)^W1_ menutrans Max\ &Width^W\| 最大幅に(&W)^W\| menutrans Min\ Widt&h^W1\| 最小幅に(&H)^W1\| menutrans Rotate\ &Up^WR 上にローテーション(&U)^WR menutrans Rotate\ &Down^Wr 下にローテーション(&D)^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\ &Sentence 文選択(&S) menutrans Select\ Pa&ragraph 段落選択(&R) 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) let &cpo = s:keepcpo unlet s:keepcpo " filler to avoid the line above being recognized as a modeline " filler vim-7.4.1689/runtime/lang/menu_japanese_japan.932.vim000066400000000000000000000300721267703067000222170ustar00rootroot00000000000000" vi:set ts=8 sts=8 sw=8 tw=0: " " Menu Translations: Japanese (CP932) " Last Translator: MURAOKA Taro " Last Change: 28-Jan-2016. " " Copyright (C) 2001-2016 MURAOKA Taro , " vim-jp (http://vim-jp.org/) " " THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE. " Quit when menu translations have already been done. if exists("did_menu_trans") finish endif let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim scriptencoding cp932 " Help menu menutrans &Help wv(&H) menutrans &Overview T(&O) menutrans &User\ Manual [U[}jA(&U) menutrans &How-to\ links &How-toN menutrans &Credits NWbg(&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 = "wvR}h͒P͂Ă:\n\n}[h̃R}hɂ i_ 擪ɕt܂. (: i_CTRL-X)\nR}hCҏWR}hɂ c_ 擪ɕt܂. (: c_)\nIvV̖Oɂ ' t܂. (: 'shiftwidth')" " File menu menutrans &File t@C(&F) menutrans &Open\.\.\.:e J(&O)\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp ĊJ(&L)\.\.\.:sp menutrans Open\ Tab\.\.\.:tabnew ^uy[WŊJ:tabnew menutrans &New:enew VK쐬(&N):enew menutrans &Close:close ‚(&C):close menutrans &Save:w ۑ(&S):w menutrans Save\ &As\.\.\.:sav Otĕۑ(&A)\.\.\.:sav menutrans Split\ &Diff\ with\.\.\. \(&D)\.\.\. menutrans Split\ Patched\ &By\.\.\. pb`ʂ\(&B)\.\.\. menutrans &Print (&P) menutrans Sa&ve-Exit:wqa ۑďI(&V):wqa menutrans E&xit:qa I(&X):qa " Edit menu menutrans &Edit ҏW(&E) menutrans &Undou (&U)u menutrans &Redo^R x(&R)^R menutrans Rep&eat\. JԂ(&E)\. menutrans Cu&t"+x ؂(&T)"+x menutrans &Copy"+y Rs[(&C)"+y menutrans &Paste"+gP \t(&P)"+gP menutrans Put\ &Before[p Oɓ\(&B)[p menutrans Put\ &After]p ɓ\(&A)]p menutrans &Deletex (&D)x menutrans &Select\ AllggVG SđI(&S)ggVG menutrans &Find\.\.\. (&F)\.\.\. menutrans &Find/ (&F)/ menutrans Find\ and\ Rep&lace\.\.\. u(&L)\.\.\. menutrans Find\ and\ Rep&lace:%s u(&L):%s menutrans Find\ and\ Rep&lace:s u(&L):s "menutrans Options\.\.\. IvV(&O)\.\.\. menutrans Settings\ &Window ݒEBhE(&W) menutrans Startup\ &Settings N̐ݒ(&S) " Edit/Global Settings menutrans &Global\ Settings S̐ݒ(&G) menutrans Toggle\ Pattern\ &Highlight:set\ hls! \ p^[ؑ(&H):set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! \ 召ʐؑ(&I):set\ ic! menutrans Toggle\ &Showmatch:set\ sm! \ }b`\ؑ(&S):set\ sm! menutrans &Context\ lines J[\Ӎs(&C) menutrans &Virtual\ Edit zҏW(&V) menutrans Never menutrans Block\ Selection ubNI menutrans Insert\ mode }[h menutrans Block\ and\ Insert ubN/}[h menutrans Always 펞 menutrans Toggle\ Insert\ &Mode:set\ im! \ }(S)[hؑ(&M):set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! \ Vi݊[hؑ(&O):set\ cp! menutrans Search\ &Path\.\.\. pX(&P)\.\.\. menutrans Ta&g\ Files\.\.\. ^Ot@C(&G)\.\.\. " " GUI options menutrans Toggle\ &Toolbar c[o[\ؑ(&T) menutrans Toggle\ &Bottom\ Scrollbar XN[o[()\ؑ(&B) menutrans Toggle\ &Left\ Scrollbar XN[o[()\ؑ(&L) menutrans Toggle\ &Right\ Scrollbar XN[o[(E)\ؑ(&R) let g:menutrans_path_dialog = "t@ČpX͂Ă:\nfBNg̓J} ( , ) ŋ؂Ă." let g:menutrans_tags_dialog = "^Ot@C̖O͂Ă:\nO̓J} ( , ) ŋ؂Ă." " Edit/File Settings " Boolean options menutrans F&ile\ Settings t@Cݒ(&I) menutrans Toggle\ Line\ &Numbering:set\ nu! \ sԍ\ؑ(&N):set\ nu! menutrans Toggle\ relati&ve\ Line\ Numbering:set\ rnu! \ ΍sԍ\ؑ(&V):set\ rnu! menutrans Toggle\ &List\ Mode:set\ list! \ Xg[hؑ(&L):set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! \ sܕԂؑ(&W):set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! \ PܕԂؑ(&R):set\ lbr! menutrans Toggle\ &expand-tab:set\ et! \ ^uWJؑ(&E):set\ et! menutrans Toggle\ &auto-indent:set\ ai! \ ؑ(&A):set\ ai! menutrans Toggle\ &C-indenting:set\ cin! \ Cꎚؑ(&C):set\ cin! " other options menutrans &Shiftwidth Vtg(&S) menutrans Soft\ &Tabstop \tgEFA^u(&T) menutrans Te&xt\ Width\.\.\. eLXg(&X)\.\.\. menutrans &File\ Format\.\.\. sLI(&F)\.\.\. let g:menutrans_textwidth_dialog = "eLXg̕('textwidth')ݒ肵Ă (0Ő`𖳌):" let g:menutrans_fileformat_dialog = "t@Co͂̍ۂ̉sĽ`Ił." let g:menutrans_fileformat_choices = "&Unix\n&Dos\n&Mac\nLZ(&C)" menutrans C&olor\ Scheme Fe[}I(&O) menutrans &Keymap L[}bv(&K) menutrans None Ȃ " Programming menu menutrans &Tools c[(&T) menutrans &Jump\ to\ this\ tagg^] ^OWv(&J)g^] menutrans Jump\ &back^T ߂(&B)^T menutrans Build\ &Tags\ File ^Ot@C쐬(&T) menutrans &Make:make rh(&M):make menutrans &List\ Errors:cl G[Xg(&L):cl menutrans L&ist\ Messages:cl! bZ[WXg(&I):cl! menutrans &Next\ Error:cn ̃G[(&N):cn menutrans &Previous\ Error:cp ÕG[(&P):cp menutrans &Older\ List:cold ÂXg(&O):cold menutrans N&ewer\ List:cnew VXg(&E):cnew menutrans Error\ &Window G[EBhE(&W) menutrans &Update:cwin XV(&U):cwin menutrans &Open:copen J(&O):copen menutrans &Close:cclose ‚(&C):cclose menutrans &Convert\ to\ HEX:%!xxd HEX֕ϊ(&C):%!xxd menutrans Conve&rt\ back:%!xxd\ -r HEXtϊ(&R)%!xxd\ -r menutrans Se&T\ Compiler RpCݒ(&T) " Tools.Spelling Menu menutrans &Spelling XyO(&S) menutrans &Spell\ Check\ On Xy`FbNL(&S) menutrans Spell\ Check\ &Off Xy`FbN(&O) menutrans To\ &Next\ error]s ̃G[(&N)]s menutrans To\ &Previous\ error[s ÕG[(&P)[s menutrans Suggest\ &Correctionsz= C(&C)z= menutrans &Repeat\ correction:spellrepall CJԂ(&R):spellrepall menutrans Set\ language\ to\ "en" \ "en"\ ɐݒ肷 menutrans Set\ language\ to\ "en_au" \ "en_au"\ ɐݒ肷 menutrans Set\ language\ to\ "en_ca" \ "en_ca"\ ɐݒ肷 menutrans Set\ language\ to\ "en_gb" \ "en_gb"\ ɐݒ肷 menutrans Set\ language\ to\ "en_nz" \ "en_nz"\ ɐݒ肷 menutrans Set\ language\ to\ "en_us" \ "en_us"\ ɐݒ肷 menutrans &Find\ More\ Languages ̌(&F) " Tools.Fold Menu menutrans &Folding ܏(&F) " open close folds menutrans &Enable/Disable\ foldszi L/ؑ(&E)zi menutrans &View\ Cursor\ Linezv J[\s\(&V)zv menutrans Vie&w\ Cursor\ Line\ onlyzMzx J[\s\(&W)zMzx menutrans C&lose\ more\ foldszm ܏݂‚(&L)zm menutrans &Close\ all\ foldszM S܏݂‚(&C)zM menutrans O&pen\ more\ foldszr ܏݂J(&P)zr menutrans &Open\ all\ foldszR S܏݂J(&O)zR " fold method menutrans Fold\ Met&hod ܏ݕ@(&H) menutrans M&anual 蓮(&A) menutrans I&ndent Cfg(&N) menutrans E&xpression ](&X) menutrans S&yntax V^bNX(&Y) menutrans &Diff (&D) menutrans Ma&rker }[J[(&R) " create and delete folds menutrans Create\ &Foldzf ܏ݍ쐬(&F)zf menutrans &Delete\ Foldzd ܏ݍ폜(&D)zd menutrans Delete\ &All\ FoldszD S܏ݍ폜(&A)zD " moving around in folds menutrans Fold\ col&umn\ width ܏݃J(&U) menutrans &Update XV(&U) menutrans &Get\ Block ubNo(&G) menutrans &Put\ Block ubNKp(&P) " Names for buffer menu. menutrans &Buffers obt@(&B) menutrans &Refresh\ menu j[ēǍ(&R) menutrans &Delete 폜(&D) menutrans &Alternate ֐ؑ(&A) menutrans &Next ̃obt@(&N) menutrans &Previous Õobt@(&P) menutrans [No\ File] [] let g:menutrans_no_file = "[]" " Window menu menutrans &Window EBhE(&W) menutrans &New^Wn VK쐬(&N)^Wn menutrans S&plit^Ws (&P)^Ws menutrans Sp&lit\ To\ #^W^^ obt@֕(&L)^W^^ menutrans Split\ &Vertically^Wv (&V)^Wv menutrans Split\ File\ E&xplorer t@CGNXv[(&X) menutrans &Close^Wc ‚(&C)^Wc menutrans Move\ &To ړ(&T) menutrans &Top^WK (&T)^WK menutrans &Bottom^WJ (&B)^WJ menutrans &Left\ side^WH (&L)^WH menutrans &Right\ side^WL E(&R)^WL menutrans Close\ &Other(s)^Wo ‚(&O)^Wo menutrans Ne&xt^Ww (&X)^Ww menutrans P&revious^WW O(&R)^WW menutrans &Equal\ Size^W= (&E)^W= menutrans &Max\ Height^W_ ő卂(&M)^W_ menutrans M&in\ Height^W1_ ŏ(&i)^W1_ menutrans Max\ &Width^W\| ő啝(&W)^W\| menutrans Min\ Widt&h^W1\| ŏ(&H)^W1\| menutrans Rotate\ &Up^WR Ƀ[e[V(&U)^WR menutrans Rotate\ &Down^Wr Ƀ[e[V(&D)^Wr menutrans Select\ Fo&nt\.\.\. tHgݒ(&N)\.\.\. " The popup menu menutrans &Undo (&U) menutrans Cu&t ؂(&T) menutrans &Copy Rs[(&C) menutrans &Paste \t(&P) menutrans &Delete 폜(&D) menutrans Select\ Blockwise `ubNI menutrans Select\ &Word PI(&W) menutrans Select\ &Sentence I(&S) menutrans Select\ Pa&ragraph iI(&R) menutrans Select\ &Line sI(&L) menutrans Select\ &Block ubNI(&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@CJ tmenu ToolBar.Save ݂̃t@Cۑ tmenu ToolBar.SaveAll ׂẴt@Cۑ tmenu ToolBar.Print tmenu ToolBar.Undo tmenu ToolBar.Redo x tmenu ToolBar.Cut Nbv{[h֐؂ tmenu ToolBar.Copy Nbv{[hփRs[ tmenu ToolBar.Paste Nbv{[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 VKEBhE쐬 tmenu ToolBar.WinSplit EBhE tmenu ToolBar.WinMax EBhEő剻 tmenu ToolBar.WinMin EBhEŏ tmenu ToolBar.WinClose EBhE‚ endif tmenu ToolBar.LoadSesn ZbVǍ tmenu ToolBar.SaveSesn ZbVۑ tmenu ToolBar.RunScript VimXNvgs tmenu ToolBar.Make vWFNgMake tmenu ToolBar.Shell VFJ tmenu ToolBar.RunCtags tags쐬 tmenu ToolBar.TagJump ^OWv tmenu ToolBar.Help Vimwv tmenu ToolBar.FindHelp Vimwv endfun endif " Syntax menu menutrans &Syntax V^bNX(&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/Itؑ(&T) menutrans Co&lor\ test J[eXg(&L) menutrans &Highlight\ test nCCgeXg(&H) menutrans &Convert\ to\ HTML HTMLփRo[g(&C) let &cpo = s:keepcpo unlet s:keepcpo " filler to avoid the line above being recognized as a modeline " filler vim-7.4.1689/runtime/lang/menu_ko.utf-8.vim000066400000000000000000000001051267703067000203110ustar00rootroot00000000000000" Menu Translations: Korean source :p:h/menu_ko_kr.utf-8.vim vim-7.4.1689/runtime/lang/menu_ko_kr.euckr.vim000066400000000000000000000244101267703067000211600ustar00rootroot00000000000000" Menu Translations: Korean " Maintainer: SungHyun Nam " Last Change: 2012 May 01 " Quit when menu translations have already been done. if exists("did_menu_trans") finish endif let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim scriptencoding euc-kr " Help menu menutrans &Help (&H) menutrans &Overview (&O) menutrans &User\ Manual \ Ŵ(&U) menutrans &How-to\ links Ͽ\ (&H) menutrans &GUI GUI(&G) menutrans &Find\.\.\. ã(&F)\.\.\. menutrans &Credits \ (&C) menutrans Co&pying ۱(&p) menutrans &Sponsor/Register Ŀ/(&S) menutrans O&rphans (&r) menutrans &Version (&V) menutrans &About \ α׷(&A) " File menu menutrans &File (&F) menutrans &Open\.\.\.:e (&O)\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp \ (&l)\.\.\.:sp menutrans Open\ Tab\.\.\.:tabnew \ \.\.\.:tabnew menutrans &New:enew ο(&N):enew menutrans &Close:close ݱ(&C):close menutrans &Save:w (&S):w menutrans Save\ &As\.\.\.:sav ٸ\ ̸\ (&A)\.\.\.:sav "menutrans Split\ &Diff\ with\.\.\. Split\ &Diff\ with\.\.\. "menutrans Split\ Patched\ &By\.\.\. Split\ Patched\ &By\.\.\. menutrans &Print μ(&P) menutrans Sa&ve-Exit:wqa ϰ\ (&v):wqa menutrans E&xit:qa (&x):qa " Edit menu menutrans &Edit (&E) menutrans &Undou (&U)u menutrans &Redo^R ٽ\ (&R)^R menutrans Rep&eat\. Ǯ(&e)\. menutrans Cu&t"+x ڸ(&t)"+x menutrans &Copy"+y (&C)"+y menutrans &Paste"+gP ̱(&P)"+gP menutrans Put\ &Before[p տ\ ̱(&B)[p menutrans Put\ &After]p ڿ\ ̱(&A)]p menutrans &Deletex (&D)x menutrans &Select\ AllggVG \ (&S)ggVG menutrans &Find\.\.\. ã(&F)\.\.\. menutrans Find\ and\ Rep&lace\.\.\. ãƼ\ ٲٱ(&l)\.\.\. menutrans Settings\ &Window \ â(&W) menutrans Startup\ &Settings \ (&S) " Edit/Global Settings menutrans &Global\ Settings \ (&G) menutrans Toggle\ Pattern\ &Highlight:set\ hls! \ ̶Ʈ\ (&H):set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! ҹ\ \ (&I):set\ ic! menutrans Toggle\ &Showmatch:set\ sm! Showmatch\ (&S):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:set\ im! \ \ (&M):set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! Vi\ ȣȯ\ (&o):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:set\ nu! \ ȣ̱\ (&N):set\ nu! menutrans Toggle\ &List\ Mode:set\ list! \ \ (&L):set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! \ Wrap\ (&W):set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! \ Wrap\ (&r):set\ lbr! menutrans Toggle\ &expand-tab:set\ et! \ Ȯ\ (&e):set\ et! menutrans Toggle\ &auto-indent:set\ ai! ڵεƮ\ (&a):set\ ai! menutrans Toggle\ &C-indenting:set\ cin! C-ε\ (&C):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\ tagg^] \ ǥ\ (&J)g^] menutrans Jump\ &back^T ڷ\ (&b)^T menutrans Build\ &Tags\ File ǥ\ \ (&T) menutrans &Spelling \ ˻(&S) menutrans &Spell\ Check\ On \ ˻\ (&S) menutrans Spell\ Check\ &Off \ ˻\ (&O) menutrans To\ &Next\ error]s \ (&N)]s menutrans To\ &Previous\ error[s \ (&P)[s menutrans Suggest\ &Correctionsz= \ (&C)z= menutrans &Repeat\ correction:spellrepall \ ݺ(&R):spellrepall menutrans Set\ language\ to\ "en" \ "en"\ menutrans Set\ language\ to\ "en_au" \ "en_au"\ menutrans Set\ language\ to\ "en_ca" \ "en_ca"\ menutrans Set\ language\ to\ "en_gb" \ "en_gb"\ menutrans Set\ language\ to\ "en_nz" \ "en_nz"\ menutrans Set\ language\ to\ "en_us" \ "en_us"\ menutrans &Find\ More\ Languages ٸ\ \ ã(&F) " Tools.Fold Menu menutrans &Folding (&F) " open close folds menutrans &Enable/Disable\ foldszi \ \ (&E)zi menutrans &View\ Cursor\ Linezv Ŀ\ \ (&V)zv menutrans Vie&w\ Cursor\ Line\ onlyzMzx Ŀ\ ٸ\ (&w)zMzx menutrans C&lose\ more\ foldszm \ \ \ ݱ(&l)zm menutrans &Close\ all\ foldszM \ \ ݱ(&C)zM menutrans O&pen\ more\ foldszr \ \ \ (&p)zr menutrans &Open\ all\ foldszR \ κ\ \ (&O)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\ &Foldzf \ (&F)zf menutrans &Delete\ Foldzd \ (&D)zd menutrans Delete\ &All\ FoldszD \ \ (&A)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:make (&M):make menutrans &List\ Errors:cl \ \ (&L):cl menutrans L&ist\ Messages:cl! ޽\ \ (&i):cl! menutrans &Next\ Error:cn \ (&N):cn menutrans &Previous\ Error:cp \ (&P):cp menutrans &Older\ List:cold \ (&O):cold menutrans N&ewer\ List:cnew ο\ (&e):cnew menutrans Error\ &Window \ â(&W) menutrans &Update:cwin (&U):cwin menutrans &Open:copen (&O):copen menutrans &Close:cclose ݱ(&C):cclose menutrans Se&T\ Compiler Ϸ\ (&T) menutrans &Convert\ to\ HEX:%!mc\ vim:xxd \ ȯ:%!mc\ vim:xxd menutrans &Convert\ to\ HEX:%!xxd \ ȯ(&C):%!xxd menutrans Conve&rt\ back:%!mc\ vim:xxd\ -r \ ȯ(&r):%!mc\ vim:xxd\ -r menutrans Conve&rt\ back:%!xxd\ -r \ ȯ(&r):%!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^Wn \ â(&N)^Wn menutrans S&plit^Ws (&p)^Ws menutrans Sp&lit\ To\ #^W^^ #\ (&l)^W^^ menutrans Split\ &Vertically^Wv η\ (&V)^Wv menutrans Split\ File\ E&xplorer \ ͽ÷η\ menutrans &Close^Wc ݱ(&C)^Wc menutrans Close\ &Other(s)^Wo ٸ\ â\ ݱ(&O)^Wo menutrans Move\ &To ̵(&T) menutrans &Top^WK (&T)^WK menutrans &Bottom^WJ ٴ(&B)^WJ menutrans &Left\ side^WH (&L)^WH menutrans &Right\ side^WL (&R)^WL menutrans Rotate\ &Up^WR \ ȸ(&U)^WR menutrans Rotate\ &Down^Wr Ʒ\ ȸ(&D)^Wr menutrans &Equal\ Size^W= \ ̷(&E)^W= menutrans &Max\ Height^W_ ִ\ ̷(&M)^W_ menutrans M&in\ Height^W1_ ּ\ ̷(&i)^W1_ menutrans Max\ &Width^W\| ִ\ ̷(&W)^W\| menutrans Min\ Widt&h^W1\| ּ\ ̷(&h)^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\ 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 Highlight\ (&H) menutrans &Convert\ to\ HTML HTML\ ȯ(&C) let &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/lang/menu_ko_kr.utf-8.vim000066400000000000000000000261211267703067000210130ustar00rootroot00000000000000" Menu Translations: Korean " Maintainer: SungHyun Nam " Last Change: 2012 May 01 " Quit when menu translations have already been done. if exists("did_menu_trans") finish endif let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim scriptencoding utf-8 " Help menu menutrans &Help 도움말(&H) menutrans &Overview 개관(&O) menutrans &User\ Manual 사용자\ 매뉴얼(&U) menutrans &How-to\ links 하우투\ 목록(&H) menutrans &GUI GUI(&G) menutrans &Find\.\.\. 찾기(&F)\.\.\. menutrans &Credits 고마운\ 분(&C) menutrans Co&pying 저작권(&p) menutrans &Sponsor/Register 후원/등록(&S) menutrans O&rphans 고아(&r) menutrans &Version 버젼(&V) menutrans &About 이\ 프로그램은(&A) " File menu menutrans &File 파일(&F) menutrans &Open\.\.\.:e 열기(&O)\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp 나눠서\ 열기(&l)\.\.\.:sp menutrans Open\ Tab\.\.\.:tabnew 탭\ 열기\.\.\.:tabnew menutrans &New:enew 새로운(&N):enew menutrans &Close:close 닫기(&C):close menutrans &Save:w 저장(&S):w menutrans Save\ &As\.\.\.:sav 다른\ 이름으로\ 저장(&A)\.\.\.:sav "menutrans Split\ &Diff\ with\.\.\. Split\ &Diff\ with\.\.\. "menutrans Split\ Patched\ &By\.\.\. Split\ Patched\ &By\.\.\. menutrans &Print 인쇄(&P) menutrans Sa&ve-Exit:wqa 저장하고\ 끝내기(&v):wqa menutrans E&xit:qa 끝내기(&x):qa " Edit menu menutrans &Edit 편집(&E) menutrans &Undou 취소(&U)u menutrans &Redo^R 다시\ 실행(&R)^R menutrans Rep&eat\. 되풀이(&e)\. menutrans Cu&t"+x 자르기(&t)"+x menutrans &Copy"+y 복사(&C)"+y menutrans &Paste"+gP 붙이기(&P)"+gP menutrans Put\ &Before[p 앞에\ 붙이기(&B)[p menutrans Put\ &After]p 뒤에\ 붙이기(&A)]p menutrans &Deletex 지우기(&D)x menutrans &Select\ AllggVG 모두\ 고르기(&S)ggVG menutrans &Find\.\.\. 찾기(&F)\.\.\. menutrans Find\ and\ Rep&lace\.\.\. 찾아서\ 바꾸기(&l)\.\.\. menutrans Settings\ &Window 설정\ 창(&W) menutrans Startup\ &Settings 시작\ 설정(&S) " Edit/Global Settings menutrans &Global\ Settings 전역\ 설정(&G) menutrans Toggle\ Pattern\ &Highlight:set\ hls! 패턴\ 하이라이트\ 토글(&H):set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! 대소문자\ 구분\ 토글(&I):set\ ic! menutrans Toggle\ &Showmatch:set\ sm! Showmatch\ 토글(&S):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:set\ im! 삽입\ 모드\ 토글(&M):set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! Vi\ 호환\ 토글(&o):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:set\ nu! 줄\ 번호붙이기\ 토글(&N):set\ nu! menutrans Toggle\ &List\ Mode:set\ list! 목록\ 모드\ 토글(&L):set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! 줄\ Wrap\ 토글(&W):set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! 낱말에서\ Wrap\ 토글(&r):set\ lbr! menutrans Toggle\ &expand-tab:set\ et! 탭\ 확장\ 토글(&e):set\ et! menutrans Toggle\ &auto-indent:set\ ai! 자동인덴트\ 토글(&a):set\ ai! menutrans Toggle\ &C-indenting:set\ cin! C-인덴팅\ 토글(&C):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\ tagg^] 이\ 꼬리표로\ 가기(&J)g^] menutrans Jump\ &back^T 뒤로\ 가기(&b)^T menutrans Build\ &Tags\ File 꼬리표\ 파일\ 만들기(&T) menutrans &Spelling 맞춤법\ 검사(&S) menutrans &Spell\ Check\ On 맞춤법\ 검사\ 시작(&S) menutrans Spell\ Check\ &Off 맞춤법\ 검사\ 끝(&O) menutrans To\ &Next\ error]s 다음\ 에러로(&N)]s menutrans To\ &Previous\ error[s 이전\ 에러로(&P)[s menutrans Suggest\ &Correctionsz= 수정\ 제안(&C)z= menutrans &Repeat\ correction:spellrepall 수정\ 반복(&R):spellrepall menutrans Set\ language\ to\ "en" 언어를\ "en"으로\ 설정 menutrans Set\ language\ to\ "en_au" 언어를\ "en_au"로\ 설정 menutrans Set\ language\ to\ "en_ca" 언어를\ "en_ca"로\ 설정 menutrans Set\ language\ to\ "en_gb" 언어를\ "en_gb"로\ 설정 menutrans Set\ language\ to\ "en_nz" 언어를\ "en_nz"으로\ 설정 menutrans Set\ language\ to\ "en_us" 언어를\ "en_us"로\ 설정 menutrans &Find\ More\ Languages 다른\ 언어\ 찾기(&F) " Tools.Fold Menu menutrans &Folding 접기(&F) " open close folds menutrans &Enable/Disable\ foldszi 접기\ 사용\ 토글(&E)zi menutrans &View\ Cursor\ Linezv 커서\ 줄\ 보기(&V)zv menutrans Vie&w\ Cursor\ Line\ onlyzMzx 커서\ 줄만\ 보기(&w)zMzx menutrans C&lose\ more\ foldszm 더\ 많은\ 접기\ 닫기(&l)zm menutrans &Close\ all\ foldszM 모든\ 접기\ 닫기(&C)zM menutrans O&pen\ more\ foldszr 더\ 많은\ 접기\ 열기(&p)zr menutrans &Open\ all\ foldszR 접힌\ 부분\ 모두\ 펴기(&O)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\ &Foldzf 접기\ 생성(&F)zf menutrans &Delete\ Foldzd 접기\ 삭제(&D)zd menutrans Delete\ &All\ FoldszD 모든\ 접기\ 삭제(&A)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:make 빌드(&M):make menutrans &List\ Errors:cl 에러\ 목록\ 보기(&L):cl menutrans L&ist\ Messages:cl! 메시지\ 목록\ 보기(&i):cl! menutrans &Next\ Error:cn 다음\ 에러(&N):cn menutrans &Previous\ Error:cp 이전\ 에러(&P):cp menutrans &Older\ List:cold 오래된\ 목록(&O):cold menutrans N&ewer\ List:cnew 새로운\ 목록(&e):cnew menutrans Error\ &Window 에러\ 창(&W) menutrans &Update:cwin 갱신(&U):cwin menutrans &Open:copen 열기(&O):copen menutrans &Close:cclose 닫기(&C):cclose menutrans Se&T\ Compiler 컴파일러\ 설정(&T) menutrans &Convert\ to\ HEX:%!mc\ vim:xxd 십육진으로\ 변환:%!mc\ vim:xxd menutrans &Convert\ to\ HEX:%!xxd 십육진으로\ 변환(&C):%!xxd menutrans Conve&rt\ back:%!mc\ vim:xxd\ -r 원래대로\ 변환(&r):%!mc\ vim:xxd\ -r menutrans Conve&rt\ back:%!xxd\ -r 원래대로\ 변환(&r):%!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^Wn 새\ 창(&N)^Wn menutrans S&plit^Ws 나누기(&p)^Ws menutrans Sp&lit\ To\ #^W^^ #으로\ 나누기(&l)^W^^ menutrans Split\ &Vertically^Wv 세로로\ 나누기(&V)^Wv menutrans Split\ File\ E&xplorer 파일\ 익스플로러\ 나누기 menutrans &Close^Wc 닫기(&C)^Wc menutrans Close\ &Other(s)^Wo 다른\ 창\ 닫기(&O)^Wo menutrans Move\ &To 이동(&T) menutrans &Top^WK 꼭대기(&T)^WK menutrans &Bottom^WJ 바닥(&B)^WJ menutrans &Left\ side^WH 왼쪽(&L)^WH menutrans &Right\ side^WL 오른쪽(&R)^WL menutrans Rotate\ &Up^WR 위로\ 회전(&U)^WR menutrans Rotate\ &Down^Wr 아래로\ 회전(&D)^Wr menutrans &Equal\ Size^W= 같은\ 높이로(&E)^W= menutrans &Max\ Height^W_ 최대\ 높이로(&M)^W_ menutrans M&in\ Height^W1_ 최소\ 높이로(&i)^W1_ menutrans Max\ &Width^W\| 최대\ 넓이로(&W)^W\| menutrans Min\ Widt&h^W1\| 최소\ 넓이로(&h)^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\ 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 Highlight\ 시험(&H) menutrans &Convert\ to\ HTML HTML로\ 변환(&C) let &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/lang/menu_ko_kr.vim000066400000000000000000000002221267703067000200430ustar00rootroot00000000000000" Menu Translations: Korean " Translated By: SungHyun Nam " Last Change: 2008 Sep 17 source :p:h/menu_ko_kr.euckr.vim vim-7.4.1689/runtime/lang/menu_nl.latin1.vim000066400000000000000000000001121267703067000205340ustar00rootroot00000000000000" Menu Translations: Nederlands source :p:h/menu_nl_nl.latin1.vim vim-7.4.1689/runtime/lang/menu_nl.utf-8.vim000066400000000000000000000001351267703067000203140ustar00rootroot00000000000000" Menu Translations: Nederlands for UTF-8 encoding source :p:h/menu_nl_nl.latin1.vim vim-7.4.1689/runtime/lang/menu_nl_nl.latin1.vim000066400000000000000000000243761267703067000212470ustar00rootroot00000000000000" Menu Translations: Nederlands " Maintainer: Bram Moolenaar " Last Change: 2012 May 01 " Quit when menu translations have already been done. if exists("did_menu_trans") finish endif let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim " 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 &Overzicht 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\.\.\.:e &Openen\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp In\ nieuw\ &Venster\ openen\.\.\.:sp menutrans &New:enew &Nieuw:enew menutrans &Close:close &Sluiten:close menutrans &Save:w &Bewaren:w menutrans Save\ &As\.\.\.:sav Bewaren\ als\.\.\.:sav menutrans Split\ &Diff\ with\.\.\. Toon\ diff\ met\.\.\. menutrans Split\ Patched\ &By\.\.\. Toon\ gewijzigd\ door\.\.\. menutrans &Print Af&drukken menutrans Sa&ve-Exit:wqa Bewaren\ en\ Afsluiten:wqa menutrans E&xit:qa &Afsluiten:qa " Edit menu menutrans &Edit Be&werken menutrans &Undou Terugu menutrans &Redo^R Voo&ruit^R menutrans Rep&eat\. &Herhalen\. menutrans Cu&t"+x &Knippen"+x menutrans &Copy"+y K&opieren"+y menutrans &Paste"+gP Plakken"+gP menutrans Put\ &Before[p Ervoor\ invoegen[p menutrans Put\ &After]p Erachter\ invoegen]p menutrans &Select\ allggVG Alles\ &MarkerenggVG menutrans &Find\.\.\. &Zoeken\.\.\. menutrans &Find/ &Zoeken/ menutrans Find\ and\ Rep&lace\.\.\. Zoeken\ en\ &Vervangen\.\.\. menutrans Find\ and\ Rep&lace:%s Zoeken\ en\ &Vervangen:%s menutrans Find\ and\ Rep&lace Zoeken\ en\ &Vervangen menutrans Find\ and\ Rep&lace:s Zoeken\ en\ &Vervangen: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:set\ hls! Flip\ Patroonkleuring:set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! Flip\ Negeren\ hoofd/kleine\ letters:set\ ic! menutrans Toggle\ &Showmatch:set\ sm! Flip\ Showmatch: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:set\ im! Flip\ Invoegmode:set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! Flip\ Vi\ Compatibiliteit: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:set\ nu! Flip\ regelnummers:set\ nu! menutrans Toggle\ &List\ Mode:set\ list! Flip\ list\ mode:set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! Flip\ regelafbreken:set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! Flip\ afbreken\ op\ woordgrens:set\ lbr! menutrans Toggle\ &expand-tab:set\ et! Flip\ tabexpansie:set\ et! menutrans Toggle\ &auto-indent:set\ ai! Flip\ automatisch\ indenteren:set\ ai! menutrans Toggle\ &C-indenting:set\ cin! Flip\ C-indenteren:set\ cin! menutrans Te&xt\ Width\.\.\. Tekstbreedte\.\.\. menutrans &File\ Format\.\.\. Bestandsformaat\.\.\. " Tools menu menutrans &Tools &Gereedschap menutrans &Jump\ to\ this\ tagg^] &Spring\ naar\ Tagg^] menutrans Jump\ &back^T Spring\ &Terug^T menutrans Build\ &Tags\ File Genereer\ &Tagsbestand menutrans &Make:make &Make\ uitvoeren:make menutrans &List\ Errors:cl &Foutenlijst:cl menutrans L&ist\ Messages:cl! &Berichtenlijst:cl! menutrans &Next\ Error:cn Volgende\ Fout:cn menutrans &Previous\ Error:cp Vorige\ Fout:cp menutrans &Older\ List:cold &Oudere\ Lijst:cold menutrans N&ewer\ List:cnew &Nieuwere\ Lijst:cnew menutrans Error\ &Window Foutenvenster menutrans &Update:cwin &Aanpassen:cwin menutrans &Open:copen &Openen:copen menutrans &Close:cclose &Sluiten:cclose menutrans &Convert\ to\ HEX:%!xxd Converteer\ naar\ HEX:%!xxd menutrans Conve&rt\ back:%!xxd\ -r Converteer\ terug:%!xxd\ -r menutrans &Set\ Compiler Kies\ Compiler " Tools.Folding menutrans &Enable/Disable\ foldszi Flip\ tonen\ foldszi menutrans &View\ Cursor\ Linezv Toon\ cursorregelzv menutrans Vie&w\ Cursor\ Line\ onlyzMzx Toon\ alleen\ cursorregelzMzx menutrans C&lose\ more\ foldszm Sluit\ meer\ foldszm menutrans &Close\ all\ foldszM Sluit\ alle\ foldszM menutrans O&pen\ more\ foldszr Open\ meer\ foldszr menutrans &Open\ all\ foldszR Open\ alle\ foldszR 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\ &Foldzf maak\ Foldzf menutrans &Delete\ Foldzd verwijder\ Foldzd menutrans Delete\ &All\ FoldszD verwijder\ alle\ FoldszD 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^Wn &Nieuw^Wn menutrans S&plit^Ws Splitsen^Ws menutrans Sp&lit\ To\ #^W^^ Splits\ naar\ #^W^^ menutrans Split\ &Vertically^Wv Splits\ &Vertikaal^Wv menutrans Split\ File\ E&xplorer Splits\ Bestandverkenner menutrans &Close^Wc &Sluiten^Wc menutrans Close\ &Other(s)^Wo &Sluit\ alle\ andere^Wo menutrans Ne&xt^Ww Volgende^Ww menutrans P&revious^WW &Vorige^WW menutrans &Equal\ Size^W= &Gelijke\ afmetingen^W= menutrans &Max\ Height^W_ &Maximale\ hoogte^W_ menutrans M&in\ Height^W1_ Mi&nimale\ hoogte^W1_ menutrans Max\ &Width^W\| Maximale\ breedte^W\| menutrans Min\ Widt&h^W1\| Minimale\ breedte^W1\| menutrans Move\ &To Verplaats\ naar menutrans &Top^WK Bovenkant^WK menutrans &Bottom^WJ Onderkant^WJ menutrans &Left\ side^WH Linkerkant^WH menutrans &Right\ side^WL Rechterkant^WL menutrans Rotate\ &Up^WR Roteren\ naar\ &boven^WR menutrans Rotate\ &Down^Wr Roteren\ naar\ &onder^Wr menutrans Select\ Fo&nt\.\.\. Selecteer\ font\.\.\. " The popup menu menutrans &Undo &Terug menutrans Cu&t Knip menutrans &Copy &Kopier 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 Kopiren 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_)\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" let &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/lang/menu_nl_nl.utf-8.vim000066400000000000000000000001351267703067000210050ustar00rootroot00000000000000" Menu Translations: Nederlands for UTF-8 encoding source :p:h/menu_nl_nl.latin1.vim vim-7.4.1689/runtime/lang/menu_no.latin1.vim000066400000000000000000000001751267703067000205500ustar00rootroot00000000000000" Menu Translations: Norwegian " menu_no.latin1.vim 289 2004-05-16 18:00:52Z sunny source :p:h/menu_no_no.latin1.vim vim-7.4.1689/runtime/lang/menu_no.utf-8.vim000066400000000000000000000002171267703067000203200ustar00rootroot00000000000000" Menu Translations: Norwegian for UTF-8 encoding " menu_no.utf-8.vim 289 2004-05-16 18:00:52Z sunny source :p:h/menu_no_no.latin1.vim vim-7.4.1689/runtime/lang/menu_no_no.latin1.vim000066400000000000000000000247741267703067000212570ustar00rootroot00000000000000" Menu Translations: Norwegian / Norsk (Bokml) " Maintainer: yvind A. Holm " Last Change: 2012 May 01 " 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 let s:keepcpo= &cpo set cpo&vim " 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\.\.\.:e &pne\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp pne\ i\ nytt\ &vindu\.\.\.:sp menutrans &New:enew &Ny\ fil:enew menutrans &Close:close L&ukk:close menutrans &Save:w &Lagre:w menutrans Save\ &As\.\.\.:sav Lagre\ s&om\.\.\.: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:wqa Lagre\ o&g\ avslutt:wqa menutrans E&xit:qa &Avslutt:qa menutrans &Edit &Rediger menutrans &Undou &Angreu menutrans &Redo^R &Gjenopprett^R menutrans Rep&eat\. &Repeter\. menutrans Cu&t"+x &Klipp\ ut"+x menutrans &Copy"+y K&opier"+y menutrans &Paste"+gP &Lim\ inn"+gP menutrans Put\ &Before[p Lim\ i&nn\ fr\ markr[p menutrans Put\ &After]p Lim\ inn\ &etter\ markr]p menutrans &Select\ AllggVG &Merk\ altggVG menutrans &Find\.\.\. &Sk\.\.\. menutrans Find\ and\ Rep&lace\.\.\. S&k\ og\ erstatt\.\.\. menutrans Settings\ &Window &Innstillinger menutrans &Global\ Settings Glo&bale\ innstillinger menutrans Toggle\ Pattern\ &Highlight:set\ hls! &Utheving\ av\ sketekst\ av/p:set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! &Forskjell\ mellom\ store/sm bokstaver\ av/p:set\ ic! menutrans Toggle\ &Showmatch:set\ sm! &Indikering\ av\ samsvarende\ parentes\ av/p: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:set\ im! Innsettings&modus\ av/p:set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! &Vi-kompatiblitet\ av/p:set\ cp! menutrans Search\ &Path\.\.\. &Skesti\.\.\. 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 &Hyre\ rullefelt\ av/p menutrans F&ile\ Settings Filo&ppsett menutrans Toggle\ Line\ &Numbering:set\ nu! &Linjenummer\ av/p:set\ nu! menutrans Toggle\ &List\ Mode:set\ list! L&istemodus\ av/p:set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! Li&njebryting\ av/p:set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! Linjebryting\ ved\ &ord\ av/p:set\ lbr! menutrans Toggle\ &expand-tab:set\ et! Utvidelse\ av\ &tabulatorer\ av/p:set\ et! menutrans Toggle\ &auto-indent:set\ ai! A&utomatisk\ innrykk\ av/p:set\ ai! menutrans Toggle\ &C-indenting:set\ cin! &C-innrykk\ av/p:set\ cin! menutrans &Shiftwidth &Strrelse\ 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 &Verkty menutrans &Jump\ to\ this\ tagg^] &Hopp\ til\ tag\ under\ markrg^] menutrans Jump\ &back^T Hopp\ &tilbake^T menutrans Build\ &Tags\ File Lag\ ta&gfil if has("folding") menutrans &Folding Fol&der menutrans &Enable/Disable\ foldszi &Folder\ av/pzi menutrans &View\ Cursor\ Linezv Se\ &markrlinjezv menutrans Vie&w\ Cursor\ Line\ onlyzMzx Se\ &bare\ markrlinjenzMzx menutrans C&lose\ more\ foldszm L&ukk\ flere\ folderzm menutrans &Close\ all\ foldszM Lukk\ &alle\ folderzM menutrans O&pen\ more\ foldszr &pne\ flere\ folderzr menutrans &Open\ all\ foldszR &pne\ alle\ folderzR 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\ &Foldzf La&g\ foldzf menutrans &Delete\ Foldzd &Slett\ foldzd menutrans Delete\ &All\ FoldszD Sl&ett\ alle\ folderzD 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:make &Kjr\ "make":make menutrans &List\ Errors:cl &List\ feil:cl menutrans L&ist\ Messages:cl! List\ &meldinger:cl! menutrans &Next\ Error:cn &Neste\ feil:cn menutrans &Previous\ Error:cp Fo&rrige\ feil:cp menutrans &Older\ List:cold &Eldre\ liste:cold menutrans N&ewer\ List:cnew N&yere\ liste:cnew menutrans Error\ &Window Fe&ilvindu menutrans &Update:cwin &Oppdater:cwin menutrans &Open:copen &pne:copen menutrans &Close:cclose &Lukk:cclose menutrans &Set\ Compiler &Velg\ kompilator menutrans &Convert\ to\ HEX:%!xxd Konverter\ til\ hek&sadesimal:%!xxd menutrans Conve&rt\ back:%!xxd\ -r K&onverter\ tilbake:%!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^Wn &Nytt^Wn menutrans S&plit^Ws &Splitt^Ws menutrans Sp&lit\ To\ #^W^^ Splitt\ &til\ #^W^^ menutrans Split\ &Vertically^Wv S&plitt\ loddrett^Ws menutrans Split\ File\ E&xplorer &Filbehandler menutrans &Close^Wc &Lukk^Wc menutrans Close\ &Other(s)^Wo Lukk\ &andre^Wo menutrans Move\ &To Fl&ytt\ til menutrans &Top^WK &Toppen^WK menutrans &Bottom^WJ &Bunnen^WJ menutrans &Left\ side^WH &Venstre\ side^WH menutrans &Right\ side^WL &Hyre\ side^WL menutrans Rotate\ &Up^WR Roter\ &opp^WR menutrans Rotate\ &Down^Wr &Roter\ ned^Wr menutrans &Equal\ Size^W= Lik\ st&rrelse^W= menutrans &Max\ Height^W_ &Maksimal\ hyde^W_ menutrans M&in\ Height^W1_ M&inimal\ hyde^W1_ menutrans Max\ &Width^W\| Ma&ksimal\ bredde^W\| menutrans Min\ Widt&h^W1\| Minimal\ &bredde^W1\| menutrans &Help &Hjelp menutrans &Overview &Oversikt menutrans &User\ Manual &Brukerhndbok menutrans &How-to\ links &Frstehjelp menutrans &Find\.\.\. &Sk\.\.\. menutrans &Credits &Kreditering menutrans Co&pying &Programlisens menutrans &Sponsor/Register S&ttte/Registrering menutrans O&rphans Fo&reldrelse 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 " Verktylinje 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 Sk... tmenu ToolBar.FindNext Finn neste tmenu ToolBar.FindPrev Finn forrige tmenu ToolBar.Replace Sk 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 vindushyde tmenu ToolBar.WinMin Minimal vindushyde tmenu ToolBar.WinClose Lukk vindu endif tmenu ToolBar.LoadSesn pne kt tmenu ToolBar.SaveSesn Lagre kt tmenu ToolBar.RunScript Kjr Vim-skript tmenu ToolBar.Make Kjr "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 Sk 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_)\nLegg til ' i begynnelsen for et valgnavn (f.eks.: 'shiftwidth')" let g:menutrans_path_dialog = "Skriv skesti 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" let &cpo = s:keepcpo unlet s:keepcpo " vim: set ts=8 sw=8 : " vim600: set fdm=indent : vim-7.4.1689/runtime/lang/menu_no_no.utf-8.vim000066400000000000000000000002221267703067000210100ustar00rootroot00000000000000" Menu Translations: Norwegian for UTF-8 encoding " menu_no_no.utf-8.vim 289 2004-05-16 18:00:52Z sunny source :p:h/menu_no_no.latin1.vim vim-7.4.1689/runtime/lang/menu_pl.cp1250.vim000066400000000000000000000001141267703067000202620ustar00rootroot00000000000000" Menu Translations: Polish source :p:h/menu_polish_poland.1250.vim vim-7.4.1689/runtime/lang/menu_pl_pl.cp1250.vim000066400000000000000000000001141267703067000207550ustar00rootroot00000000000000" Menu Translations: Polish source :p:h/menu_polish_poland.1250.vim vim-7.4.1689/runtime/lang/menu_pl_pl.iso_8859-2.vim000066400000000000000000000277761267703067000215200ustar00rootroot00000000000000" Menu Translations: Polish " Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) " Initial Translation: Marcin Dalecki " Last Change: 17 May 2010 " Quit when menu translations have already been done. if exists("did_menu_trans") finish endif let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim scriptencoding iso-8859-2 " Help menu menutrans &Help Po&moc menutrans &Overview &Oglnie menutrans &User\ Manual Podrcznik\ &uytkownika menutrans &How-to\ links &Odnoniki\ JTZ menutrans &Find\.\.\. &Szukaj\.\.\. menutrans &Credits Po&dzikowania menutrans Co&pying &Kopiowanie menutrans &Sponsor/Register &Sponsorowanie/Rejestracja menutrans O&rphans Sie&roty menutrans &Version &Wersja menutrans &About o\ &Programie " File menu menutrans &File &Plik menutrans &Open\.\.\.:e &Otwrz\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp Otwrz\ z\ &podziaem\.\.\.:sp menutrans &New:enew &Nowy:enew menutrans &Close:close &Zamknij:close menutrans &Save:w Za&pisz:w menutrans Save\ &As\.\.\.:sav Zapisz\ &jako\.\.\.:sav menutrans Split\ &Diff\ with\.\.\. Podziel\ na\ diff-a\ midzy\.\.\. menutrans Split\ Patched\ &By\.\.\. Podziel\ atane\ przez\.\.\. menutrans &Print &Drukuj menutrans Sa&ve-Exit:wqa W&yjcie\ z\ zapisem:wqa menutrans E&xit:qa &Wyjcie:qa menutrans Open\ Tab\.\.\.:tabnew Otwrz\ &kart\.\.\.:tabnew " Edit menu menutrans &Edit &Edycja menutrans &Undou &Cofniju menutrans &Redo^R &Ponw^R menutrans Rep&eat\. P&owtrz\. menutrans Cu&t"+x W&ytnij"+x menutrans &Copy"+y &Kopiuj"+y menutrans &Paste"+gP &Wklej"+gP menutrans Put\ &Before[p Wstaw\ p&rzed[p menutrans Put\ &After]p Wstaw\ p&o]p menutrans &Select\ AllggVG Z&aznacz\ caoggVG menutrans &Find\.\.\. &Szukaj\.\.\. menutrans &Find/ &Szukaj/ menutrans Find\ and\ Rep&lace\.\.\. &Zamie\.\.\. menutrans Find\ and\ Rep&lace:%s &Zamie:%s menutrans Find\ and\ Rep&lace &Zamie menutrans Find\ and\ Rep&lace:s &Zamie:s menutrans Options\.\.\. Opcje\.\.\. menutrans Settings\ &Window Ustawienia menutrans &Global\ Settings Ustawienia\ &globalne menutrans Startup\ &Settings Ustawienia\ &startowe menutrans F&ile\ Settings Ustawienia\ dla\ pliku menutrans Toggle\ Line\ &Numbering:set\ nu! &Numerowanie\ wierszy:set\ nu! menutrans Toggle\ &List\ Mode:set\ list! Tryb\ &listowania:set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! Za&wijanie\ wierszy:set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! amanie\ wie&rsza:set\ lbr! menutrans Toggle\ &expand-tab:set\ et! Rozwijani&e\ tabulatorw:set\ et! menutrans Toggle\ &auto-indent:set\ ai! &Automatyczne\ wcicia:set\ ai! menutrans Toggle\ &C-indenting:set\ cin! Wcicia\ &C:set\ cin! menutrans &Shiftwidth &Szeroko\ wcicia menutrans Te&xt\ Width\.\.\. Dugo\ linii\.\.\. menutrans &File\ Format\.\.\. &Format\ pliku\.\.\. menutrans Soft\ &Tabstop Rozmiar\ &tabulacji menutrans C&olor\ Scheme Zestawy\ kolorw menutrans &Keymap Ukady\ 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:set\ hls! Podwietlanie\ &wzorcw:set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! &Ignorowanie\ wielkoci:set\ ic! menutrans Toggle\ &Showmatch:set\ sm! &Pokazywanie\ pasujcych:set\ sm! menutrans &Context\ lines Wiersze\ &kontekstowe menutrans &Virtual\ Edit Edycja\ &wirtualna menutrans Never Nigdy menutrans Block\ Selection Zaznaczanie\ blokowe menutrans Insert\ mode Tryb\ wprowadzania menutrans Toggle\ Vi\ C&ompatible:set\ cp! Tryb\ zg&odnoci\ z\ Vi:set\ cp! menutrans Block\ and\ Insert Blokowe\ i\ wprowadzanie menutrans Always Zawsze menutrans Toggle\ Insert\ &Mode:set\ im! Tryb\ wprowadzania:set\ im! menutrans Search\ &Path\.\.\. Scieka\ poszukiwania\.\.\. menutrans Ta&g\ Files\.\.\. Pliki\ tagw\.\.\. " " GUI options menutrans Toggle\ &Toolbar Pasek\ narzdzi menutrans Toggle\ &Bottom\ Scrollbar Dolny\ przewijacz menutrans Toggle\ &Left\ Scrollbar &Lewy\ przewijacz menutrans Toggle\ &Right\ Scrollbar P&rawy\ przewijacz " Programming menu menutrans &Tools &Narzdzia menutrans &Jump\ to\ this\ tagg^] &Skocz\ do\ tagag^] menutrans Jump\ &back^T Skok\ w\ &ty^T menutrans Build\ &Tags\ File &Twrz\ plik\ tagw " Spelling menutrans &Spelling Pi&sownia menutrans &Spell\ Check\ On Wcz menutrans Spell\ Check\ &Off Wycz menutrans To\ &Next\ error]s Do\ &nastpnego\ bdu]s menutrans To\ &Previous\ error[s Do\ &poprzedniego\ bdu[s menutrans Suggest\ &Correctionsz= Sugestie\ poprawekz= menutrans &Repeat\ correction:spellrepall Powtr&z\ poprawk:spellrepall menutrans Set\ language\ to\ "en" Ustaw\ jzyk\ na\ "en" menutrans Set\ language\ to\ "en_au" Ustaw\ jzyk\ na\ "en_au" menutrans Set\ language\ to\ "en_ca" Ustaw\ jzyk\ na\ "en_ca" menutrans Set\ language\ to\ "en_gb" Ustaw\ jzyk\ na\ "en_gb" menutrans Set\ language\ to\ "en_nz" Ustaw\ jzyk\ na\ "en_nz" menutrans Set\ language\ to\ "en_us" Ustaw\ jzyk\ na\ "en_us" menutrans Set\ language\ to\ "pl" Ustaw\ jzyk\ na\ "pl" menutrans &Find\ More\ Languages &Znajd\ wicej\ jzykw " Folding menutrans &Folding &Zwijanie menutrans &Enable/Disable\ foldszi &Zwi/rozwizi menutrans &View\ Cursor\ Linezv &Linia\ kursorazv menutrans Vie&w\ Cursor\ Line\ onlyzMzx &Tylko\ linia\ kursorazMzx menutrans C&lose\ more\ foldszm Zwi\ wicejzm menutrans &Close\ all\ foldszM Z&wi\ wszystkiezM menutrans &Open\ all\ foldszR Rozwi\ wszystkiezR menutrans O&pen\ more\ foldszr R&ozwi\ wicejzr menutrans Create\ &Foldzf T&wrz\ zawiniciezf menutrans &Delete\ Foldzd U&su\ zawiniciezd menutrans Delete\ &All\ FoldszD &Usu\ wszystkie\ zawiniciazD menutrans Fold\ column\ &width Szeroko\ kolumny\ za&wini menutrans Fold\ Met&hod Me&toda\ zawijania menutrans M&anual &Rcznie menutrans I&ndent W&cicie menutrans E&xpression W&yraenie menutrans S&yntax S&kadnia menutrans Ma&rker Zn&acznik " Diff menutrans &Update &Odwie menutrans &Get\ Block &Pobierz\ blok menutrans &Put\ Block &Wstaw\ blok " Make and stuff... menutrans &Make:make M&ake:make menutrans &List\ Errors:cl &Poka\ bdy:cl menutrans L&ist\ Messages:cl! W&ylicz\ powiadomienia:cl! menutrans &Next\ Error:cn &Nastpny\ bd:cn menutrans &Previous\ Error:cp &Poprzedni\ bd:cp menutrans &Older\ List:cold &Starsza\ lista:cold menutrans N&ewer\ List:cnew N&owsza\ lista:cnew menutrans Error\ &Window Okno\ bd&w menutrans &Update:cwin Akt&ualizuj:cwin menutrans &Close:cclose &Zamknij:cclose menutrans &Open:copen &Otwrz:copen menutrans Se&T\ Compiler U&staw\ kompilator menutrans &Convert\ to\ HEX:%!xxd Kody\ szesnastkowe:%!xxd menutrans Conve&rt\ back:%!xxd\ -r Zwyky\ tekst:%!xxd\ -r " Names for buffer menu. menutrans &Buffers &Bufory menutrans &Refresh\ menu &Odwie menutrans &Delete &Skasuj menutrans &Alternate &Zmie menutrans &Next &Nastpny menutrans &Previous &Poprzedni menutrans [No\ File] [Brak\ Pliku] " Window menu menutrans &Window &Widoki menutrans &New^Wn &Nowy^Wn menutrans S&plit^Ws Po&dziel^Ws menutrans Sp&lit\ To\ #^W^^ P&odziel\ na\ #^W^^ menutrans Split\ &Vertically^Wv Podziel\ pionowo^Wv menutrans Split\ File\ E&xplorer Otwrz\ meneder\ plikw menutrans &Close^Wc &Zamknij^Wc menutrans Close\ &Other(s)^Wo Zamknij\ &inne^Wo menutrans Ne&xt^Ww &Nastpny^Ww menutrans P&revious^WW &Poprzedni^WW menutrans &Equal\ Size^W= &Wyrwnaj\ wysokoci^W= menutrans &Max\ Height^W_ Z&maksymalizuj\ wysoko^W_ menutrans M&in\ Height^W1_ Zminim&alizuj\ wysoko^W1_ menutrans Max\ Width^W\| Maksymalna\ szeroko^W\| menutrans Min\ Width^W1\| Minimalna\ szeroko^W1\| menutrans Max\ &Width^W\| Zmaksymalizuj\ szeroko^W\| menutrans Min\ Widt&h^W1\| Zminimalizuj\ szeroko^W1\| menutrans Move\ &To &Id\ do menutrans &Top^WK &Gra^WK menutrans &Bottom^WJ &D^WJ menutrans &Left\ side^WH &Lewa\ strona^WH menutrans &Right\ side^WL &Prawa\ strona^WL menutrans Rotate\ &Up^WR Obr\ w\ &gr^WR menutrans Rotate\ &Down^Wr Obr\ w\ &d^Wr menutrans Split\ &Vertically^Wv &Podziel\ w\ poziomie^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\ &Sentence Zaznacz\ &zdanie menutrans Select\ Pa&ragraph Zaznacz\ aka&pit menutrans Select\ &Word Zaznacz\ &sowo menutrans Select\ &Line Zaznacz\ w&iersz menutrans Select\ &Block Zaznacz\ &blok menutrans Select\ &All Zaznacz\ c&ao menutrans Input\ &Methods Wprowadza&nie " The GUI toolbar if has("toolbar") if exists("*Do_toolbar_tmenu") delfun Do_toolbar_tmenu endif fun Do_toolbar_tmenu() tmenu ToolBar.Open Otwrz plik tmenu ToolBar.Save Zapisz biecy plik tmenu ToolBar.SaveAll Zapisz wszystkie pliki tmenu ToolBar.Print Drukuj tmenu ToolBar.Undo Cofnij tmenu ToolBar.Redo Ponw tmenu ToolBar.Cut Wytnij tmenu ToolBar.Copy Skopiuj tmenu ToolBar.Paste Wklej tmenu ToolBar.Find Szukaj... tmenu ToolBar.FindNext Szukaj nastpnego 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 Zaaduj sesj tmenu ToolBar.SaveSesn Zachowaj biec sesj tmenu ToolBar.RunScript Uruchom skrypt Vima tmenu ToolBar.Make Wykonaj biecy projekt tmenu ToolBar.Shell Otwrz powok tmenu ToolBar.RunCtags Twrz tagi w biecym 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 &Skadnia menutrans &Show\ filetypes\ in\ menu Poka\ typy\ &plikw\ w\ menu menutrans Set\ '&syntax'\ only Ustaw\ tylko\ '&syntax' menutrans Set\ '&filetype'\ too Ustaw\ rwnie\ '&filetype' menutrans &Off &Wycz menutrans &Manual &Rcznie menutrans A&utomatic A&utomatyczne menutrans on/off\ for\ &This\ file wcz/w&ycz\ dla\ pliku menutrans Co&lor\ test Test\ &kolorw menutrans &Highlight\ test &Test\ podwietlania menutrans &Convert\ to\ HTML Przetwrz\ na\ &HTML " dialog texts let menutrans_no_file = "[Brak pliku]" let menutrans_help_dialog = "Wprowad komend lub sowo, aby otrzyma pomoc o:\n\nPrzedrostek i_ oznacza komend trybu Wprowadzania (np. i_CTRL-X)\nPrzedrostek c_ oznacza komend edycji wiersza komend (np. c_)\nPrzedrostek ' oznacza nazw opcji (np. 'shiftwidth')" let g:menutrans_path_dialog = "Wprowad ciek poszukiwania plikw.\nProsz rozdziela nazwy katalogw przecinkiem." let g:menutrans_tags_dialog = "Podaj nazwy plikw tagw.\nProsz rozdziela nazwy przecinkiem." let g:menutrans_textwidth_dialog = "Wprowad now szeroko tekstu (0 wycza przewijanie): " let g:menutrans_fileformat_dialog = "Wybierz format w ktrym ten plik ma by zapisany" let g:menutrans_fileformat_choices = "&Unix\n&Dos\n&Mac\n&Anuluj" let &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/lang/menu_pl_pl.utf-8.vim000066400000000000000000000303101267703067000210070ustar00rootroot00000000000000" Menu Translations: Polish " Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) " Initial Translation: Marcin Dalecki " Last Change: 17 May 2010 " Quit when menu translations have already been done. if exists("did_menu_trans") finish endif let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim scriptencoding utf-8 " Help menu menutrans &Help Po&moc menutrans &Overview &Ogólnie menutrans &User\ Manual Podręcznik\ &użytkownika menutrans &How-to\ links &Odnośniki\ JTZ menutrans &Find\.\.\. &Szukaj\.\.\. menutrans &Credits Po&dziękowania menutrans Co&pying &Kopiowanie menutrans &Sponsor/Register &Sponsorowanie/Rejestracja menutrans O&rphans Sie&roty menutrans &Version &Wersja menutrans &About o\ &Programie " File menu menutrans &File &Plik menutrans &Open\.\.\.:e &Otwórz\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp Otwórz\ z\ &podziałem\.\.\.:sp menutrans &New:enew &Nowy:enew menutrans &Close:close &Zamknij:close menutrans &Save:w Za&pisz:w menutrans Save\ &As\.\.\.:sav Zapisz\ &jako\.\.\.: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:wqa W&yjście\ z\ zapisem:wqa menutrans E&xit:qa &Wyjście:qa menutrans Open\ Tab\.\.\.:tabnew Otwórz\ &kartę\.\.\.:tabnew " Edit menu menutrans &Edit &Edycja menutrans &Undou &Cofniju menutrans &Redo^R &Ponów^R menutrans Rep&eat\. P&owtórz\. menutrans Cu&t"+x W&ytnij"+x menutrans &Copy"+y &Kopiuj"+y menutrans &Paste"+gP &Wklej"+gP menutrans Put\ &Before[p Wstaw\ p&rzed[p menutrans Put\ &After]p Wstaw\ p&o]p menutrans &Select\ AllggVG Z&aznacz\ całośćggVG menutrans &Find\.\.\. &Szukaj\.\.\. menutrans &Find/ &Szukaj/ menutrans Find\ and\ Rep&lace\.\.\. &Zamień\.\.\. menutrans Find\ and\ Rep&lace:%s &Zamień:%s menutrans Find\ and\ Rep&lace &Zamień menutrans Find\ and\ Rep&lace:s &Zamień:s menutrans Options\.\.\. Opcje\.\.\. menutrans Settings\ &Window Ustawienia menutrans &Global\ Settings Ustawienia\ &globalne menutrans Startup\ &Settings Ustawienia\ &startowe menutrans F&ile\ Settings Ustawienia\ dla\ pliku menutrans Toggle\ Line\ &Numbering:set\ nu! &Numerowanie\ wierszy:set\ nu! menutrans Toggle\ &List\ Mode:set\ list! Tryb\ &listowania:set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! Za&wijanie\ wierszy:set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! Łamanie\ wie&rsza:set\ lbr! menutrans Toggle\ &expand-tab:set\ et! Rozwijani&e\ tabulatorów:set\ et! menutrans Toggle\ &auto-indent:set\ ai! &Automatyczne\ wcięcia:set\ ai! menutrans Toggle\ &C-indenting:set\ cin! Wcięcia\ &C: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:set\ hls! Podświetlanie\ &wzorców:set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! &Ignorowanie\ wielkości:set\ ic! menutrans Toggle\ &Showmatch:set\ sm! &Pokazywanie\ pasujących:set\ sm! menutrans &Context\ lines Wiersze\ &kontekstowe menutrans &Virtual\ Edit Edycja\ &wirtualna menutrans Never Nigdy menutrans Block\ Selection Zaznaczanie\ blokowe menutrans Insert\ mode Tryb\ wprowadzania menutrans Toggle\ Vi\ C&ompatible:set\ cp! Tryb\ zg&odności\ z\ Vi:set\ cp! menutrans Block\ and\ Insert Blokowe\ i\ wprowadzanie menutrans Always Zawsze menutrans Toggle\ Insert\ &Mode:set\ im! Tryb\ wprowadzania: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\ tagg^] &Skocz\ do\ tagag^] menutrans Jump\ &back^T Skok\ w\ &tył^T menutrans Build\ &Tags\ File &Twórz\ plik\ tagów " Spelling menutrans &Spelling Pi&sownia menutrans &Spell\ Check\ On Włącz menutrans Spell\ Check\ &Off Wyłącz menutrans To\ &Next\ error]s Do\ &następnego\ błędu]s menutrans To\ &Previous\ error[s Do\ &poprzedniego\ błędu[s menutrans Suggest\ &Correctionsz= Sugestie\ poprawekz= menutrans &Repeat\ correction:spellrepall Powtór&z\ poprawkę:spellrepall menutrans Set\ language\ to\ "en" Ustaw\ język\ na\ "en" menutrans Set\ language\ to\ "en_au" Ustaw\ język\ na\ "en_au" menutrans Set\ language\ to\ "en_ca" Ustaw\ język\ na\ "en_ca" menutrans Set\ language\ to\ "en_gb" Ustaw\ język\ na\ "en_gb" menutrans Set\ language\ to\ "en_nz" Ustaw\ język\ na\ "en_nz" menutrans Set\ language\ to\ "en_us" Ustaw\ język\ na\ "en_us" menutrans Set\ language\ to\ "pl" Ustaw\ język\ na\ "pl" menutrans &Find\ More\ Languages &Znajdź\ więcej\ języków " Folding menutrans &Folding &Zwijanie menutrans &Enable/Disable\ foldszi &Zwiń/rozwińzi menutrans &View\ Cursor\ Linezv &Linia\ kursorazv menutrans Vie&w\ Cursor\ Line\ onlyzMzx &Tylko\ linia\ kursorazMzx menutrans C&lose\ more\ foldszm Zwiń\ więcejzm menutrans &Close\ all\ foldszM Z&wiń\ wszystkiezM menutrans &Open\ all\ foldszR Rozwiń\ wszystkiezR menutrans O&pen\ more\ foldszr R&ozwiń\ więcejzr menutrans Create\ &Foldzf T&wórz\ zawinięciezf menutrans &Delete\ Foldzd U&suń\ zawinięciezd menutrans Delete\ &All\ FoldszD &Usuń\ wszystkie\ zawinięciazD 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&yrażenie 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:make M&ake:make menutrans &List\ Errors:cl &Pokaż\ błędy:cl menutrans L&ist\ Messages:cl! W&ylicz\ powiadomienia:cl! menutrans &Next\ Error:cn &Następny\ błąd:cn menutrans &Previous\ Error:cp &Poprzedni\ błąd:cp menutrans &Older\ List:cold &Starsza\ lista:cold menutrans N&ewer\ List:cnew N&owsza\ lista:cnew menutrans Error\ &Window Okno\ błędó&w menutrans &Update:cwin Akt&ualizuj:cwin menutrans &Close:cclose &Zamknij:cclose menutrans &Open:copen &Otwórz:copen menutrans Se&T\ Compiler U&staw\ kompilator menutrans &Convert\ to\ HEX:%!xxd Kody\ szesnastkowe:%!xxd menutrans Conve&rt\ back:%!xxd\ -r Zwykły\ tekst:%!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^Wn &Nowy^Wn menutrans S&plit^Ws Po&dziel^Ws menutrans Sp&lit\ To\ #^W^^ P&odziel\ na\ #^W^^ menutrans Split\ &Vertically^Wv Podziel\ pionowo^Wv menutrans Split\ File\ E&xplorer Otwórz\ menedżer\ plików menutrans &Close^Wc &Zamknij^Wc menutrans Close\ &Other(s)^Wo Zamknij\ &inne^Wo menutrans Ne&xt^Ww &Następny^Ww menutrans P&revious^WW &Poprzedni^WW menutrans &Equal\ Size^W= &Wyrównaj\ wysokości^W= menutrans &Max\ Height^W_ Z&maksymalizuj\ wysokość^W_ menutrans M&in\ Height^W1_ Zminim&alizuj\ wysokość^W1_ menutrans Max\ Width^W\| Maksymalna\ szerokość^W\| menutrans Min\ Width^W1\| Minimalna\ szerokość^W1\| menutrans Max\ &Width^W\| Zmaksymalizuj\ szerokość^W\| menutrans Min\ Widt&h^W1\| Zminimalizuj\ szerokość^W1\| menutrans Move\ &To &Idź\ do menutrans &Top^WK &Góra^WK menutrans &Bottom^WJ &Dół^WJ menutrans &Left\ side^WH &Lewa\ strona^WH menutrans &Right\ side^WL &Prawa\ strona^WL menutrans Rotate\ &Up^WR Obróć\ w\ &górę^WR menutrans Rotate\ &Down^Wr Obróć\ w\ &dół^Wr menutrans Split\ &Vertically^Wv &Podziel\ w\ poziomie^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\ &Sentence Zaznacz\ &zdanie menutrans Select\ Pa&ragraph Zaznacz\ aka&pit menutrans Select\ &Word Zaznacz\ &słowo menutrans Select\ &Line Zaznacz\ w&iersz menutrans Select\ &Block Zaznacz\ &blok menutrans Select\ &All Zaznacz\ c&ałość menutrans Input\ &Methods Wprowadza&nie " 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_)\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" let g:menutrans_fileformat_choices = "&Unix\n&Dos\n&Mac\n&Anuluj" let &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/lang/menu_polish_poland.1250.vim000066400000000000000000000277721267703067000222020ustar00rootroot00000000000000" Menu Translations: Polish " Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) " Initial Translation: Marcin Dalecki " Last Change: 17 May 2010 " Quit when menu translations have already been done. if exists("did_menu_trans") finish endif let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim scriptencoding cp1250 " Help menu menutrans &Help Po&moc menutrans &Overview &Oglnie menutrans &User\ Manual Podrcznik\ &uytkownika menutrans &How-to\ links &Odnoniki\ JTZ menutrans &Find\.\.\. &Szukaj\.\.\. menutrans &Credits Po&dzikowania menutrans Co&pying &Kopiowanie menutrans &Sponsor/Register &Sponsorowanie/Rejestracja menutrans O&rphans Sie&roty menutrans &Version &Wersja menutrans &About o\ &Programie " File menu menutrans &File &Plik menutrans &Open\.\.\.:e &Otwrz\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp Otwrz\ z\ &podziaem\.\.\.:sp menutrans &New:enew &Nowy:enew menutrans &Close:close &Zamknij:close menutrans &Save:w Za&pisz:w menutrans Save\ &As\.\.\.:sav Zapisz\ &jako\.\.\.:sav menutrans Split\ &Diff\ with\.\.\. Podziel\ na\ diff-a\ midzy\.\.\. menutrans Split\ Patched\ &By\.\.\. Podziel\ atane\ przez\.\.\. menutrans &Print &Drukuj menutrans Sa&ve-Exit:wqa W&yjcie\ z\ zapisem:wqa menutrans E&xit:qa &Wyjcie:qa menutrans Open\ Tab\.\.\.:tabnew Otwrz\ &kart\.\.\.:tabnew " Edit menu menutrans &Edit &Edycja menutrans &Undou &Cofniju menutrans &Redo^R &Ponw^R menutrans Rep&eat\. P&owtrz\. menutrans Cu&t"+x W&ytnij"+x menutrans &Copy"+y &Kopiuj"+y menutrans &Paste"+gP &Wklej"+gP menutrans Put\ &Before[p Wstaw\ p&rzed[p menutrans Put\ &After]p Wstaw\ p&o]p menutrans &Select\ AllggVG Z&aznacz\ caoggVG menutrans &Find\.\.\. &Szukaj\.\.\. menutrans &Find/ &Szukaj/ menutrans Find\ and\ Rep&lace\.\.\. &Zamie\.\.\. menutrans Find\ and\ Rep&lace:%s &Zamie:%s menutrans Find\ and\ Rep&lace &Zamie menutrans Find\ and\ Rep&lace:s &Zamie:s menutrans Options\.\.\. Opcje\.\.\. menutrans Settings\ &Window Ustawienia menutrans &Global\ Settings Ustawienia\ &globalne menutrans Startup\ &Settings Ustawienia\ &startowe menutrans F&ile\ Settings Ustawienia\ dla\ pliku menutrans Toggle\ Line\ &Numbering:set\ nu! &Numerowanie\ wierszy:set\ nu! menutrans Toggle\ &List\ Mode:set\ list! Tryb\ &listowania:set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! Za&wijanie\ wierszy:set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! amanie\ wie&rsza:set\ lbr! menutrans Toggle\ &expand-tab:set\ et! Rozwijani&e\ tabulatorw:set\ et! menutrans Toggle\ &auto-indent:set\ ai! &Automatyczne\ wcicia:set\ ai! menutrans Toggle\ &C-indenting:set\ cin! Wcicia\ &C:set\ cin! menutrans &Shiftwidth &Szeroko\ wcicia menutrans Te&xt\ Width\.\.\. Dugo\ linii\.\.\. menutrans &File\ Format\.\.\. &Format\ pliku\.\.\. menutrans Soft\ &Tabstop Rozmiar\ &tabulacji menutrans C&olor\ Scheme Zestawy\ kolorw menutrans &Keymap Ukady\ 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:set\ hls! Podwietlanie\ &wzorcw:set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! &Ignorowanie\ wielkoci:set\ ic! menutrans Toggle\ &Showmatch:set\ sm! &Pokazywanie\ pasujcych:set\ sm! menutrans &Context\ lines Wiersze\ &kontekstowe menutrans &Virtual\ Edit Edycja\ &wirtualna menutrans Never Nigdy menutrans Block\ Selection Zaznaczanie\ blokowe menutrans Insert\ mode Tryb\ wprowadzania menutrans Toggle\ Vi\ C&ompatible:set\ cp! Tryb\ zg&odnoci\ z\ Vi:set\ cp! menutrans Block\ and\ Insert Blokowe\ i\ wprowadzanie menutrans Always Zawsze menutrans Toggle\ Insert\ &Mode:set\ im! Tryb\ wprowadzania:set\ im! menutrans Search\ &Path\.\.\. Scieka\ poszukiwania\.\.\. menutrans Ta&g\ Files\.\.\. Pliki\ tagw\.\.\. " " GUI options menutrans Toggle\ &Toolbar Pasek\ narzdzi menutrans Toggle\ &Bottom\ Scrollbar Dolny\ przewijacz menutrans Toggle\ &Left\ Scrollbar &Lewy\ przewijacz menutrans Toggle\ &Right\ Scrollbar P&rawy\ przewijacz " Programming menu menutrans &Tools &Narzdzia menutrans &Jump\ to\ this\ tagg^] &Skocz\ do\ tagag^] menutrans Jump\ &back^T Skok\ w\ &ty^T menutrans Build\ &Tags\ File &Twrz\ plik\ tagw " Spelling menutrans &Spelling Pi&sownia menutrans &Spell\ Check\ On Wcz menutrans Spell\ Check\ &Off Wycz menutrans To\ &Next\ error]s Do\ &nastpnego\ bdu]s menutrans To\ &Previous\ error[s Do\ &poprzedniego\ bdu[s menutrans Suggest\ &Correctionsz= Sugestie\ poprawekz= menutrans &Repeat\ correction:spellrepall Powtr&z\ poprawk:spellrepall menutrans Set\ language\ to\ "en" Ustaw\ jzyk\ na\ "en" menutrans Set\ language\ to\ "en_au" Ustaw\ jzyk\ na\ "en_au" menutrans Set\ language\ to\ "en_ca" Ustaw\ jzyk\ na\ "en_ca" menutrans Set\ language\ to\ "en_gb" Ustaw\ jzyk\ na\ "en_gb" menutrans Set\ language\ to\ "en_nz" Ustaw\ jzyk\ na\ "en_nz" menutrans Set\ language\ to\ "en_us" Ustaw\ jzyk\ na\ "en_us" menutrans Set\ language\ to\ "pl" Ustaw\ jzyk\ na\ "pl" menutrans &Find\ More\ Languages &Znajd\ wicej\ jzykw " Folding menutrans &Folding &Zwijanie menutrans &Enable/Disable\ foldszi &Zwi/rozwizi menutrans &View\ Cursor\ Linezv &Linia\ kursorazv menutrans Vie&w\ Cursor\ Line\ onlyzMzx &Tylko\ linia\ kursorazMzx menutrans C&lose\ more\ foldszm Zwi\ wicejzm menutrans &Close\ all\ foldszM Z&wi\ wszystkiezM menutrans &Open\ all\ foldszR Rozwi\ wszystkiezR menutrans O&pen\ more\ foldszr R&ozwi\ wicejzr menutrans Create\ &Foldzf T&wrz\ zawiniciezf menutrans &Delete\ Foldzd U&su\ zawiniciezd menutrans Delete\ &All\ FoldszD &Usu\ wszystkie\ zawiniciazD menutrans Fold\ column\ &width Szeroko\ kolumny\ za&wini menutrans Fold\ Met&hod Me&toda\ zawijania menutrans M&anual &Rcznie menutrans I&ndent W&cicie menutrans E&xpression W&yraenie menutrans S&yntax S&kadnia menutrans Ma&rker Zn&acznik " Diff menutrans &Update &Odwie menutrans &Get\ Block &Pobierz\ blok menutrans &Put\ Block &Wstaw\ blok " Make and stuff... menutrans &Make:make M&ake:make menutrans &List\ Errors:cl &Poka\ bdy:cl menutrans L&ist\ Messages:cl! W&ylicz\ powiadomienia:cl! menutrans &Next\ Error:cn &Nastpny\ bd:cn menutrans &Previous\ Error:cp &Poprzedni\ bd:cp menutrans &Older\ List:cold &Starsza\ lista:cold menutrans N&ewer\ List:cnew N&owsza\ lista:cnew menutrans Error\ &Window Okno\ bd&w menutrans &Update:cwin Akt&ualizuj:cwin menutrans &Close:cclose &Zamknij:cclose menutrans &Open:copen &Otwrz:copen menutrans Se&T\ Compiler U&staw\ kompilator menutrans &Convert\ to\ HEX:%!xxd Kody\ szesnastkowe:%!xxd menutrans Conve&rt\ back:%!xxd\ -r Zwyky\ tekst:%!xxd\ -r " Names for buffer menu. menutrans &Buffers &Bufory menutrans &Refresh\ menu &Odwie menutrans &Delete &Skasuj menutrans &Alternate &Zmie menutrans &Next &Nastpny menutrans &Previous &Poprzedni menutrans [No\ File] [Brak\ Pliku] " Window menu menutrans &Window &Widoki menutrans &New^Wn &Nowy^Wn menutrans S&plit^Ws Po&dziel^Ws menutrans Sp&lit\ To\ #^W^^ P&odziel\ na\ #^W^^ menutrans Split\ &Vertically^Wv Podziel\ pionowo^Wv menutrans Split\ File\ E&xplorer Otwrz\ meneder\ plikw menutrans &Close^Wc &Zamknij^Wc menutrans Close\ &Other(s)^Wo Zamknij\ &inne^Wo menutrans Ne&xt^Ww &Nastpny^Ww menutrans P&revious^WW &Poprzedni^WW menutrans &Equal\ Size^W= &Wyrwnaj\ wysokoci^W= menutrans &Max\ Height^W_ Z&maksymalizuj\ wysoko^W_ menutrans M&in\ Height^W1_ Zminim&alizuj\ wysoko^W1_ menutrans Max\ Width^W\| Maksymalna\ szeroko^W\| menutrans Min\ Width^W1\| Minimalna\ szeroko^W1\| menutrans Max\ &Width^W\| Zmaksymalizuj\ szeroko^W\| menutrans Min\ Widt&h^W1\| Zminimalizuj\ szeroko^W1\| menutrans Move\ &To &Id\ do menutrans &Top^WK &Gra^WK menutrans &Bottom^WJ &D^WJ menutrans &Left\ side^WH &Lewa\ strona^WH menutrans &Right\ side^WL &Prawa\ strona^WL menutrans Rotate\ &Up^WR Obr\ w\ &gr^WR menutrans Rotate\ &Down^Wr Obr\ w\ &d^Wr menutrans Split\ &Vertically^Wv &Podziel\ w\ poziomie^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\ &Sentence Zaznacz\ &zdanie menutrans Select\ Pa&ragraph Zaznacz\ aka&pit menutrans Select\ &Word Zaznacz\ &sowo menutrans Select\ &Line Zaznacz\ w&iersz menutrans Select\ &Block Zaznacz\ &blok menutrans Select\ &All Zaznacz\ c&ao menutrans Input\ &Methods Wprowadza&nie " The GUI toolbar if has("toolbar") if exists("*Do_toolbar_tmenu") delfun Do_toolbar_tmenu endif fun Do_toolbar_tmenu() tmenu ToolBar.Open Otwrz plik tmenu ToolBar.Save Zapisz biecy plik tmenu ToolBar.SaveAll Zapisz wszystkie pliki tmenu ToolBar.Print Drukuj tmenu ToolBar.Undo Cofnij tmenu ToolBar.Redo Ponw tmenu ToolBar.Cut Wytnij tmenu ToolBar.Copy Skopiuj tmenu ToolBar.Paste Wklej tmenu ToolBar.Find Szukaj... tmenu ToolBar.FindNext Szukaj nastpnego 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 Zaaduj sesj tmenu ToolBar.SaveSesn Zachowaj biec sesj tmenu ToolBar.RunScript Uruchom skrypt Vima tmenu ToolBar.Make Wykonaj biecy projekt tmenu ToolBar.Shell Otwrz powok tmenu ToolBar.RunCtags Twrz tagi w biecym 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 &Skadnia menutrans &Show\ filetypes\ in\ menu Poka\ typy\ &plikw\ w\ menu menutrans Set\ '&syntax'\ only Ustaw\ tylko\ '&syntax' menutrans Set\ '&filetype'\ too Ustaw\ rwnie\ '&filetype' menutrans &Off &Wycz menutrans &Manual &Rcznie menutrans A&utomatic A&utomatyczne menutrans on/off\ for\ &This\ file wcz/w&ycz\ dla\ pliku menutrans Co&lor\ test Test\ &kolorw menutrans &Highlight\ test &Test\ podwietlania menutrans &Convert\ to\ HTML Przetwrz\ na\ &HTML " dialog texts let menutrans_no_file = "[Brak pliku]" let menutrans_help_dialog = "Wprowad komend lub sowo, aby otrzyma pomoc o:\n\nPrzedrostek i_ oznacza komend trybu Wprowadzania (np. i_CTRL-X)\nPrzedrostek c_ oznacza komend edycji wiersza komend (np. c_)\nPrzedrostek ' oznacza nazw opcji (np. 'shiftwidth')" let g:menutrans_path_dialog = "Wprowad ciek poszukiwania plikw.\nProsz rozdziela nazwy katalogw przecinkiem." let g:menutrans_tags_dialog = "Podaj nazwy plikw tagw.\nProsz rozdziela nazwy przecinkiem." let g:menutrans_textwidth_dialog = "Wprowad now szeroko tekstu (0 wycza przewijanie): " let g:menutrans_fileformat_dialog = "Wybierz format w ktrym ten plik ma by zapisany" let g:menutrans_fileformat_choices = "&Unix\n&Dos\n&Mac\n&Anuluj" let &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/lang/menu_pt_br.latin1.vim000066400000000000000000000001031267703067000212310ustar00rootroot00000000000000" Menu translations: Portuguese source :p:h/menu_pt_br.vim vim-7.4.1689/runtime/lang/menu_pt_br.utf-8.vim000066400000000000000000000001261267703067000210110ustar00rootroot00000000000000" Menu translations: Portuguese for UTF-8 encoding source :p:h/menu_pt_br.vim vim-7.4.1689/runtime/lang/menu_pt_br.vim000066400000000000000000000274611267703067000200620ustar00rootroot00000000000000" Menu Translations: Portugus do Brasil " Maintainer: Jos de Paula " Last Change: 2012 May 01 " " Quit when menu translations have already been done. if exists("did_menu_trans") finish endif let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim " 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 &Contedo menutrans &User\ Manual &Manual\ do\ Usurio menutrans &How-to\ links &Como\ fazer? menutrans &Find\.\.\. &Procurar\.\.\. menutrans &Credits &Crditos menutrans O&rphans &rfos menutrans Co&pying &Licena menutrans &Sponsor/Register &Doar/Registrar menutrans &Version &Verso menutrans &About &Sobre " File menu menutrans &File &Arquivo menutrans &Open\.\.\.:e A&brir\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp Ab&rir\ em\ outra\ janela\.\.\.:sp menutrans &New:enew &Novo:enew menutrans &Close:close &Fechar:close menutrans &Save:w &Salvar:w menutrans Save\ &As\.\.\.:sav Sa&lvar\ como\.\.\.:sav menutrans Split\ &Diff\ with\.\.\. &Exibir\ diferenas\ com\.\.\. menutrans Split\ Patched\ &By\.\.\. Ex&ibir\ patcheado\ por\.\.\. menutrans &Print I&mprimir menutrans Sa&ve-Exit:wqa Sal&var\ e\ sair:wqa menutrans E&xit:qa Sai&r:qa " Edit menu menutrans &Edit &Editar menutrans &Undou &Desfazeru menutrans &Redo^R &Refazeru menutrans Rep&eat\. Repe&tir\. menutrans Cu&t"+x Re&cortar"+x menutrans &Copy"+y Cop&iar"+y menutrans &Paste"+gP C&olar"+gP menutrans Put\ &Before[p Colocar\ &antes[p menutrans Put\ &After]p Colocar\ &depois]p menutrans &Select\ allggVG &Selecionar\ tudoggVG menutrans &Find\.\.\. &Procurar\.\.\. menutrans Find\ and\ Rep&lace\.\.\. Procurar\ e\ substit&uir\.\.\. menutrans Find\ and\ Rep&lace:%s Procurar\ e\ substit&uir:%s menutrans Find\ and\ Rep&lace Procurar\ e\ substit&uir menutrans Find\ and\ Rep&lace:s Procurar\ e\ substituir:s menutrans Settings\ &Window &Opes menutrans Startup\ &Settings &Inicializao " Edit/Global Settings menutrans &Global\ Settings Opes\ &Globais menutrans Toggle\ Pattern\ &Highlight:set\ hls! Ativar/Desativar\ &Realce\ de\ Padres:set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! Ativar/Desativar\ &Ignorar\ maisculas:set\ ic! menutrans Toggle\ &Showmatch:set\ sm! Ativar/Desativar\ &coincidncias:set\ sm! menutrans &Context\ lines Linhas\ de\ C&ontexto menutrans &Virtual\ Edit Edio\ &Virtual menutrans Never Nunca menutrans Block\ Selection Seleo\ de\ Bloco menutrans Insert\ mode Modo\ de\ insero menutrans Block\ and\ Insert Bloco\ e\ insero menutrans Always Sempre menutrans Toggle\ Insert\ &Mode:set\ im! Ativar/Desativar\ Modo\ de\ In&sero:set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! Ativar/Desativar\ Co&mpatibilidade\ com\ Vi: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 diretrios com uma vrgula." let g:menutrans_tags_dialog = "Indique os nomes dos arquivos de tags.\nSepare os nomes com uma vrgula." " Edit/File Settings menutrans F&ile\ Settings Opes\ do\ &Arquivo " Boolean options menutrans Toggle\ Line\ &Numbering:set\ nu! Ativar/Desativar\ &numerao\ de\ linhas:set\ nu! menutrans Toggle\ &List\ Mode:set\ list! Ativar/Desativar\ modo\ &list:set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! Ativar/Desativar\ &quebra\ de\ linhas:set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! Ativar/Desativar\ quebra\ na\ &palavra:set\ lbr! menutrans Toggle\ &expand-tab:set\ et! Ativar/Desativar\ expanso de tabs:set\ et! menutrans Toggle\ &auto-indent:set\ ai! Ativar/Desativar\ &auto-indentao:set\ ai! menutrans Toggle\ &C-indenting:set\ cin! Ativar/Desativar\ indentao estilo &C:set\ cin! " other options menutrans &Shiftwidth Largura\ da\ &indentao menutrans Soft\ &Tabstop &Tabulao\ com\ espaos menutrans Te&xt\ Width\.\.\. Largura\ do\ te&xto\.\.\. let g:menutrans_textwidth_dialog = "Digite a nova largura do texto (0 para desativar a formatao): " 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 padro menutrans Select\ Fo&nt\.\.\. Selecionar\ fo&nte\.\.\. menutrans &Keymap &Mapa\ de\ teclado menutrans None Nenhum " Programming menu menutrans &Tools &Ferramentas menutrans &Jump\ to\ this\ tagg^] &Pular\ para\ este\ tagg^] menutrans Jump\ &back^T &Voltar^T menutrans Build\ &Tags\ File &Construir\ Arquivo\ de\ tags menutrans &Spelling &Ortografia menutrans &Folding &Dobra menutrans &Make:make &Make:make menutrans &List\ Errors:cl &Lista\ de\ erros:cl menutrans L&ist\ Messages:cl! Li&sta\ de\ mensagens:cl! menutrans &Next\ Error:cn P&rximo\ erro:cn menutrans &Previous\ Error:cp &Erro\ anterior:cp menutrans &Older\ List:cold Listar\ erros\ &antigos:cold menutrans N&ewer\ List:cnew Listar\ erros\ &novos:cnew menutrans Error\ &Window &Janela\ de\ erros menutrans Se&T\ Compiler Def&inir\ Compilador menutrans &Convert\ to\ HEX:%!xxd Converter\ para\ hexadecimal:%!xxd menutrans Conve&rt\ back:%!xxd\ -r Conver&ter\ de\ volta:%!xxd\ -r " Tools.Spelling menu menutrans &Spell Check On &Ativar Correo Ortogrfica menutrans &Spell Check Off &Desativar Correo Ortogrfica menutrans To &Next error]s &Prximo Erro]s menutrans To &Previous Error[s Erro A&nterior[s menutrans Suggest &Correctionsz= &Sugerir Correesz= menutrans &Repeat correction:spellrepall &Repetir Correo:spellrepall menutrans Set\ language\ to\ "en" Ingls menutrans Set\ language\ to\ "en_au" Ingls\ (en_au) menutrans Set\ language\ to\ "en_ca" Ingls\ (en_ca) menutrans Set\ language\ to\ "en_gb" Ingls\ (en_gb) menutrans Set\ language\ to\ "en_nz" Ingls\ (en_nz) menutrans Set\ language\ to\ "en_us" Ingls\ (en_us) menutrans &Find\ More\ Languages &Buscar mais idiomas " Tools.Fold Menu menutrans &Enable/Disable\ foldszi &Ativar/Desativar\ dobraszi menutrans &View\ Cursor\ Linezv &Ver\ linha\ do\ cursorzv menutrans Vie&w\ Cursor\ Line\ onlyzMzx Ve&r\ somente\ linha\ do\ cursorzMzx menutrans C&lose\ more\ foldszm &Fechar\ mais\ dobraszm menutrans &Close\ all\ foldszM F&echar\ todas\ as\ dobraszM menutrans O&pen\ more\ foldszr A&brir\ mais\ dobraszr menutrans &Open\ all\ foldszR Abr&ir\ todas\ as\ dobraszR " fold method menutrans Fold\ Met&hod &Modo\ de\ dobras menutrans Create\ &Foldzf Criar\ &dobraszf menutrans &Delete\ Foldzd Remover\ d&obraszd menutrans Delete\ &All\ FoldszD Remover\ &todas\ as\ dobraszD " 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 &Pr\ Bloco " Tools.Error Menu menutrans &Update:cwin &Atualizar:cwin menutrans &Open:copen A&brir:copen menutrans &Close:cclose &Fechar:cclose " Names for buffer menu. menutrans &Buffers &Buffers menutrans &Refresh\ menu A&tualizar\ menu menutrans &Delete &Apagar menutrans &Alternate A<ernar menutrans &Next P&rximo menutrans &Previous A&nterior let g:menutrans_no_file = "[Sem arquivos]" " Window menu menutrans &Window &Janela menutrans &New^Wn N&ova^Wn menutrans S&plit^Ws &Dividir^Ws menutrans Sp&lit\ To\ #^W^^ D&ividir\ para\ #^W^^ menutrans Split\ &Vertically^Wv Dividir\ &verticalmente^Wv menutrans Split\ File\ E&xplorer &Abrir\ Gerenciador\ de\ arquivos menutrans &Close^Wc &Fechar^Wc menutrans Close\ &Other(s)^Wo Fechar\ &outra(s)^Wo menutrans Move\ &To Mover\ ¶ menutrans &Top^WK A&cima^WK menutrans &Bottom^WJ A&baixo^WJ menutrans &Left\ side^WH Lado\ &esquerdo^WH menutrans &Right\ side^WL Lado\ di&reito^WL menutrans Rotate\ &Up^WR &Girar\ para\ cima^WR menutrans Rotate\ &Down^Wr Girar\ para\ bai&xo^Wr menutrans &Equal\ Size^W= Mesmo\ &Tamanho^W= menutrans &Max\ Height^W_ Altura\ &Mxima^W_ menutrans M&in\ Height^W1_ A<ura\ Mnima^W1_ menutrans Max\ &Width^W\| Larg&ura\ Mxima^W\| menutrans Min\ Widt&h^W1\| Largura\ M&nima^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 Seleo\ 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 Prximo 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 Mxima tmenu ToolBar.WinMin Janela Mnima tmenu ToolBar.WinVSplit Dividir Verticalmente tmenu ToolBar.WinMaxWidth Largura Mxima tmenu ToolBar.WinMinWidth Largura Mnima tmenu ToolBar.WinClose Fechar Janela endif tmenu ToolBar.LoadSesn Carregar Sesso tmenu ToolBar.SaveSesn Salvar Sesso 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\ tambm\ &tipo\ de\ arquivo menutrans &Off &Desativar menutrans &Manual &Manual menutrans A&utomatic A&utomtica 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_)\nAnteponha ` para um nome de opo (ex.: `shiftwidth`)" let &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/lang/menu_pt_pt.latin1.vim000066400000000000000000000001021267703067000212500ustar00rootroot00000000000000" Menu Translations: Portugus source :p:h/menu_pt_pt.vim vim-7.4.1689/runtime/lang/menu_pt_pt.utf-8.vim000066400000000000000000000001021267703067000210230ustar00rootroot00000000000000" Menu Translations: Portugus source :p:h/menu_pt_pt.vim vim-7.4.1689/runtime/lang/menu_pt_pt.vim000066400000000000000000000256211267703067000200760ustar00rootroot00000000000000" Menu Translations: Portugus " adaptado de pt_br. " Maintainer: Duarte Henriques " Quit when menu translations have already been done. if exists("did_menu_trans") finish endif let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim " 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 &Contedo menutrans &User\ Manual &Manual\ do\ Utilizador menutrans &How-to\ links &Como\ fazer? menutrans &Find\.\.\. &Procurar\.\.\. menutrans &Credits &Crditos menutrans O&rphans &rfos menutrans Co&pying &Licena menutrans &Version &Verso menutrans &About &Sobre " File menu menutrans &File &Ficheiro menutrans &Open\.\.\.:e A&brir\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp Abrir\ noutra\ &janela\.\.\.:sp menutrans &New:enew &Novo:enew menutrans &Close:close &Fechar:close menutrans &Save:w &Guardar:w menutrans Save\ &As\.\.\.:sav Gu&ardar\ como\.\.\.:sav menutrans Split\ &Diff\ with\.\.\. &Exibir\ diferenas\ com\.\.\. menutrans Split\ Patched\ &By\.\.\. Ex&ibir\ patcheado\ por\.\.\. menutrans &Print Im&primir menutrans Sa&ve-Exit:wqa Gua&rdar\ e\ sair:wqa menutrans E&xit:qa Sai&r:qa " Edit menu menutrans &Edit &Editar menutrans &Undou &Desfazeru menutrans &Redo^R &Refazeru menutrans Rep&eat\. Repe&tir\. menutrans Cu&t"+x &Cortar"+x menutrans &Copy"+y Cop&iar"+y menutrans &Paste"+gP C&olar"+gP menutrans Put\ &Before[p Colocar\ &antes[p menutrans Put\ &After]p Colocar\ &depois]p menutrans &Select\ allggVG &Seleccionar\ tudoggVG menutrans &Find\.\.\. &Procurar\.\.\. menutrans Find\ and\ Rep&lace\.\.\. Procurar\ e\ substit&uir\.\.\. menutrans Find\ and\ Rep&lace:%s Procurar\ e\ substit&uir:%s menutrans Find\ and\ Rep&lace Procurar\ e\ substit&uir menutrans Find\ and\ Rep&lace:s Procurar\ e\ substituir:s menutrans Settings\ &Window Op&es " Edit/Global Settings menutrans &Global\ Settings Opes\ &Globais menutrans Toggle\ Pattern\ &Highlight:set\ hls! Activar/Desactivar\ &Realce\ de\ Padres:set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! Activar/Desactivar\ &Ignorar\ maisculas:set\ ic! menutrans Toggle\ &Showmatch:set\ sm! Activar/Desactivar\ &coincidncias:set\ sm! menutrans &Context\ lines Linhas\ de\ C&ontexto menutrans &Virtual\ Edit Edio\ &Virtual menutrans Never Nunca menutrans Block\ Selection Seleo\ de\ Bloco menutrans Insert\ mode Modo\ de\ insero menutrans Block\ and\ Insert Bloco\ e\ insero menutrans Always Sempre menutrans Toggle\ Insert\ &Mode:set\ im! Activar/Desactivar\ Modo\ de\ In&sero:set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! Activar/Desactivar\ Co&mpatibilidade\ com\ Vi: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 diretrios com uma vrgula." let g:menutrans_tags_dialog = "Indique os nomes dos arquivos de tags.\nSepare os nomes com uma vrgula." " Edit/File Settings menutrans F&ile\ Settings Opes\ do\ &Arquivo " Boolean options menutrans Toggle\ Line\ &Numbering:set\ nu! Activar/Desactivar\ &numerao\ de\ linhas:set\ nu! menutrans Toggle\ &List\ Mode:set\ list! Activar/Desactivar\ modo\ &list:set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! Activar/Desactivar\ &quebra\ de\ linhas:set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! Activar/Desactivar\ quebra\ na\ &palavra:set\ lbr! menutrans Toggle\ &expand-tab:set\ et! Activar/Desactivar\ expanso de tabs:set\ et! menutrans Toggle\ &auto-indent:set\ ai! Activar/Desactivar\ &auto-indentao:set\ ai! menutrans Toggle\ &C-indenting:set\ cin! Activar/Desactivar\ indentao estilo &C:set\ cin! " other options menutrans &Shiftwidth Largura\ da\ &indentao menutrans Soft\ &Tabstop &Tabulao\ com\ espaos menutrans Te&xt\ Width\.\.\. Largura\ do\ te&xto\.\.\. let g:menutrans_textwidth_dialog = "Digite a nova largura do texto (0 para desativar a formatao): " 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 padro 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\ tagg^] Saltar\ para\ esta\ &tagg^] menutrans Jump\ &back^T &Voltar^T menutrans Build\ &Tags\ File &Construir\ Arquivo\ de\ tags menutrans &Folding &Dobra menutrans &Make:make &Make:make menutrans &List\ Errors:cl &Lista\ de\ erros:cl menutrans L&ist\ Messages:cl! Li&sta\ de\ mensagens:cl! menutrans &Next\ Error:cn P&rximo\ erro:cn menutrans &Previous\ Error:cp &Erro\ anterior:cp menutrans &Older\ List:cold Listar\ erros\ &antigos:cold menutrans N&ewer\ List:cnew Listar\ erros\ &novos:cnew menutrans Error\ &Window &Janela\ de\ erros menutrans &Set\ Compiler Def&inir\ Compilador menutrans &Convert\ to\ HEX:%!xxd Converter\ para\ hexadecimal:%!xxd menutrans Conve&rt\ back:%!xxd\ -r Conver&ter\ de\ volta:%!xxd\ -r " Tools.Fold Menu menutrans &Enable/Disable\ foldszi &Activar/Desactivar\ dobraszi menutrans &View\ Cursor\ Linezv &Ver\ linha\ do\ cursorzv menutrans Vie&w\ Cursor\ Line\ onlyzMzx Ve&r\ somente\ linha\ do\ cursorzMzx menutrans C&lose\ more\ foldszm &Fechar\ mais\ dobraszm menutrans &Close\ all\ foldszM F&echar\ todas\ as\ dobraszM menutrans O&pen\ more\ foldszr A&brir\ mais\ dobraszr menutrans &Open\ all\ foldszR Abr&ir\ todas\ as\ dobraszR " fold method menutrans Fold\ Met&hod &Modo\ de\ dobras menutrans Create\ &Foldzf Criar\ &dobraszf menutrans &Delete\ Foldzd Remover\ d&obraszd menutrans Delete\ &All\ FoldszD Remover\ &todas\ as\ dobraszD " 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 &Pr\ Bloco " Tools.Error Menu menutrans &Update:cwin &Actualizar:cwin menutrans &Open:copen A&brir:copen menutrans &Close:cclose &Fechar:cclose " Names for buffer menu. menutrans &Buffers &Buffers menutrans &Refresh\ menu A&ctualizar\ menu menutrans &Delete &Apagar menutrans &Alternate A<ernar menutrans &Next P&rximo menutrans &Previous A&nterior let g:menutrans_no_file = "[Sem arquivos]" " Window menu menutrans &Window &Janela menutrans &New^Wn N&ova^Wn menutrans S&plit^Ws &Dividir^Ws menutrans Sp&lit\ To\ #^W^^ D&ividir\ para\ #^W^^ menutrans Split\ &Vertically^Wv Dividir\ &verticalmente^Wv menutrans Split\ File\ E&xplorer &Abrir\ Gerenciador\ de\ arquivos menutrans &Close^Wc &Fechar^Wc menutrans Close\ &Other(s)^Wo Fechar\ &outra(s)^Wo menutrans Move\ &To Mover\ ¶ menutrans &Top^WK A&cima^WK menutrans &Bottom^WJ A&baixo^WJ menutrans &Left\ side^WH Lado\ &esquerdo^WH menutrans &Right\ side^WL Lado\ di&reito^WL menutrans Rotate\ &Up^WR &Girar\ para\ cima^WR menutrans Rotate\ &Down^Wr Girar\ para\ bai&xo^Wr menutrans &Equal\ Size^W= Mesmo\ &Tamanho^W= menutrans &Max\ Height^W_ Altura\ &Mxima^W_ menutrans M&in\ Height^W1_ A<ura\ Mnima^W1_ menutrans Max\ &Width^W\| Larg&ura\ Mxima^W\| menutrans Min\ Widt&h^W1\| Largura\ M&nima^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 Seleo\ 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 Prximo 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 Mxima tmenu ToolBar.WinMin Janela Mnima tmenu ToolBar.WinVSplit Dividir Verticalmente tmenu ToolBar.WinMaxWidth Largura Mxima tmenu ToolBar.WinMinWidth Largura Mnima tmenu ToolBar.WinClose Fechar Janela endif tmenu ToolBar.LoadSesn Carregar Sesso tmenu ToolBar.SaveSesn Salvar Sesso 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\ tambm\ &tipo\ de\ arquivo menutrans &Off &Desactivar menutrans &Manual &Manual menutrans A&utomatic A&utomtica 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_)\nAnteponha ` para um nome de opo (ex.: `shiftwidth`)" let &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/lang/menu_ru.utf-8.vim000066400000000000000000000001001267703067000203210ustar00rootroot00000000000000" Menu Translations: Russian source :p:h/menu_ru_ru.vim vim-7.4.1689/runtime/lang/menu_ru_ru.koi8-r.vim000066400000000000000000000323111267703067000212060ustar00rootroot00000000000000" Menu Translations: Russian " Maintainer: Sergey Alyoshin " Previous Maintainer: vassily ragosin " Last Change: 29 May 2013 " URL: cvs://cvs.sf.net:/cvsroot/ruvim/extras/menu/menu_ru_ru.vim " " $Id: menu_ru_ru.vim,v 1.1 2004/06/13 16:09:10 vimboss Exp $ " " Adopted for RuVim project by Vassily Ragosin. " First translation: Tim Alexeevsky , " based on ukrainian translation by Bohdan Vlasyuk " " " Quit when menu translations have already been done. " if exists("did_menu_trans") finish endif let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim scriptencoding koi8-r " Top menutrans &File & menutrans &Edit & menutrans &Tools & menutrans &Syntax & menutrans &Buffers & menutrans &Window & menutrans &Help & " " " " Help menu menutrans &Overview & 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\.\.\.:e &\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp &\ \.\.\.:sp menutrans Open\ Tab\.\.\.:tabnew \ &\.\.\.:tabnew menutrans &New:enew &:enew menutrans &Close:close &:close "-------------------- menutrans &Save:w &:w menutrans Save\ &As\.\.\.:sav \ &\.\.\.:sav "-------------------- menutrans Split\ &Diff\ with\.\.\. &\ \.\.\. menutrans Split\ Patched\ &By\.\.\. \ \ \ &\.\.\. "-------------------- menutrans &Print & menutrans Sa&ve-Exit:wqa &\ \ :wqa menutrans E&xit:qa &:qa " " " Edit menu menutrans &Undou &u menutrans &Redo^R &^R menutrans Rep&eat\. &\. "-------------------- menutrans Cu&t"+x &"+x menutrans &Copy"+y &"+y menutrans &Paste"+gP &"+gP menutrans Put\ &Before[p \ &[p menutrans Put\ &After]p \ &]p menutrans &Deletex &x menutrans &Select\ AllggVG &\ ӣggVG "-------------------- " Athena GUI only menutrans &Find/ &/ menutrans Find\ and\ Rep&lace:%s \ \ &:%s " End Athena GUI only menutrans &Find\.\.\./ &\.\.\./ menutrans Find\ and\ Rep&lace\.\.\. \ \ &\.\.\. menutrans Find\ and\ Rep&lace\.\.\.:%s \ \ &\.\.\.:%s menutrans Find\ and\ Rep&lace\.\.\.:s \ \ &\.\.\.:s "-------------------- menutrans Settings\ &Window \ \ & menutrans Startup\ &Settings \ & menutrans &Global\ Settings &\ menutrans F&ile\ Settings \ & menutrans C&olor\ Scheme &\ menutrans &Keymap \ & menutrans Select\ Fo&nt\.\.\. \ &\.\.\. ">>>----------------- Edit/Global settings menutrans Toggle\ Pattern\ &Highlight:set\ hls! \ &\ :set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! &\ :set\ ic! menutrans Toggle\ &Showmatch:set\ sm! \ \ &:set\ sm! menutrans &Context\ lines &\ \ menutrans &Virtual\ Edit &\ menutrans Toggle\ Insert\ &Mode:set\ im! \ &:set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! &\ \ Vi: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:set\ nu! &\ :set\ nu! menutrans Toggle\ relati&ve\ Line\ Numbering:set\ rnu! &\ \ :set\ nru! menutrans Toggle\ &List\ Mode:set\ list! &\ \ :set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! &\ \ :set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! \ &\ :set\ lbr! menutrans Toggle\ &expand-tab:set\ et! &\ \ :set\ et! menutrans Toggle\ &auto-indent:set\ ai! \ \ &:set\ ai! menutrans Toggle\ &C-indenting:set\ cin! \ \ \ &\ C:set\ cin! ">>>--- menutrans &Shiftwidth &\ menutrans Soft\ &Tabstop \ & menutrans Te&xt\ Width\.\.\. &\ \.\.\. menutrans &File\ Format\.\.\. &\ \.\.\. " " " " Tools menu menutrans &Jump\ to\ this\ tagg^] &\ \ g^] menutrans Jump\ &back^T &\ ^T menutrans Build\ &Tags\ File \ &\ "------------------- menutrans &Folding \ \ & menutrans &Spelling & menutrans &Diff &\ (diff) "------------------- menutrans &Make:make &:make menutrans &List\ Errors:cl \ &:cl menutrans L&ist\ Messages:cl! \ &\ \ \ :cl! menutrans &Next\ Error:cn &\ :cn menutrans &Previous\ Error:cp &\ :cp menutrans &Older\ List:cold \ &\ \ :cold menutrans N&ewer\ List:cnew \ &\ \ :cnew menutrans Error\ &Window &\ menutrans Se&T\ Compiler \ & "------------------- menutrans &Convert\ to\ HEX:%!xxd &\ \ HEX:%!xxd menutrans Conve&rt\ back:%!xxd\ -r \ &\ HEX:%!xxd\ -r ">>>---------------- Tools/Spelling menutrans &Spell\ Check\ On &\ \ menutrans Spell\ Check\ &Off &\ \ menutrans To\ &Next\ error]s &\ menutrans To\ &Previous\ error[s &\ menutrans Suggest\ &Correctionsz= \ & menutrans &Repeat\ correction:spellrepall &\ \ \ "------------------- menutrans Set\ language\ to\ "en" \ \ "en" menutrans Set\ language\ to\ "en_au" \ \ "en_au" menutrans Set\ language\ to\ "en_ca" \ \ "en_ca" menutrans Set\ language\ to\ "en_gb" \ \ "en_gb" menutrans Set\ language\ to\ "en_nz" \ \ "en_nz" menutrans Set\ language\ to\ "en_us" \ \ "en_us" menutrans &Find\ More\ Languages &\ \ let g:menutrans_set_lang_to = ' ' ">>>---------------- Folds menutrans &Enable/Disable\ foldszi /\ &zi menutrans &View\ Cursor\ Linezv \ \ \ &zv menutrans Vie&w\ Cursor\ Line\ onlyzMzx \ &\ \ \ zMzx menutrans C&lose\ more\ foldszm \ &\ zm menutrans &Close\ all\ foldszM \ &\ zM menutrans &Open\ all\ foldszR &\ \ zR menutrans O&pen\ more\ foldszr &\ \ zr menutrans Fold\ Met&hod &\ menutrans Create\ &Foldzf &\ zf menutrans &Delete\ Foldzd &\ zd menutrans Delete\ &All\ FoldszD \ &\ 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:cwin &:cwin menutrans &Close:cclose &:cclose menutrans &Open:copen &: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^Wn &\ ^Wn menutrans S&plit^Ws &\ ^Ws menutrans Sp&lit\ To\ #^W^^ \ &\ \ \ \ ^W^^ menutrans Split\ &Vertically^Wv \ \ &^Wv menutrans Split\ File\ E&xplorer \ \ \ &\ " menutrans &Close^Wc &\ \ ^Wc menutrans Close\ &Other(s)^Wo \ &\ ^Wo " menutrans Move\ &To & menutrans Rotate\ &Up^WR \ &^WR menutrans Rotate\ &Down^Wr \ &^Wr " menutrans &Equal\ Size^W= &\ ^W= menutrans &Max\ Height^W_ \ &^W_ menutrans M&in\ Height^W1_ \ &^W1_ menutrans Max\ &Width^W\| \ &^W\| menutrans Min\ Widt&h^W1\| &\ ^W1\| ">>>----------------- Window/Move To menutrans &Top^WK &^WK menutrans &Bottom^WJ &^WJ menutrans &Left\ side^WH &^WH menutrans &Right\ side^WL &^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_ (, _)\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 = "[ ]" let &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/lang/menu_ru_ru.utf-8.vim000066400000000000000000000001001267703067000210270ustar00rootroot00000000000000" Menu Translations: Russian source :p:h/menu_ru_ru.vim vim-7.4.1689/runtime/lang/menu_ru_ru.vim000066400000000000000000000405521267703067000201040ustar00rootroot00000000000000" Menu Translations: Russian " Maintainer: Sergey Alyoshin " Previous Maintainer: vassily ragosin " Last Change: 29 May 2013 " URL: cvs://cvs.sf.net:/cvsroot/ruvim/extras/menu/menu_ru_ru.vim " " $Id: menu_ru_ru.vim,v 1.1 2004/06/13 16:09:10 vimboss Exp $ " " Adopted for RuVim project by Vassily Ragosin. " First translation: Tim Alexeevsky , " based on ukrainian translation by Bohdan Vlasyuk " " " Quit when menu translations have already been done. " if exists("did_menu_trans") finish endif let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim scriptencoding utf-8 " Top menutrans &File &Файл menutrans &Edit П&равка menutrans &Tools &Инструменты menutrans &Syntax &Синтаксис menutrans &Buffers &Буферы menutrans &Window &Окно menutrans &Help С&правка " " " " Help menu menutrans &Overview &Обзор 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\.\.\.:e &Открыть\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp По&делить\ окно\.\.\.:sp menutrans Open\ Tab\.\.\.:tabnew Открыть\ в&кладку\.\.\.:tabnew menutrans &New:enew &Новый:enew menutrans &Close:close &Закрыть:close "-------------------- menutrans &Save:w &Сохранить:w menutrans Save\ &As\.\.\.:sav Сохранить\ &как\.\.\.:sav "-------------------- menutrans Split\ &Diff\ with\.\.\. Ср&авнить\ с\.\.\. menutrans Split\ Patched\ &By\.\.\. Сравнить\ с\ применением\ зап&латки\.\.\. "-------------------- menutrans &Print На&печатать menutrans Sa&ve-Exit:wqa Вы&ход\ с\ сохранением:wqa menutrans E&xit:qa &Выход:qa " " " Edit menu menutrans &Undou О&тменитьu menutrans &Redo^R В&ернуть^R menutrans Rep&eat\. Повторит&ь\. "-------------------- menutrans Cu&t"+x &Вырезать"+x menutrans &Copy"+y &Копировать"+y menutrans &Paste"+gP Вк&леить"+gP menutrans Put\ &Before[p Вклеить\ пере&д[p menutrans Put\ &After]p Вклеить\ по&сле]p menutrans &Deletex &Удалитьx menutrans &Select\ AllggVG В&ыделить\ всёggVG "-------------------- " Athena GUI only menutrans &Find/ &Поиск/ menutrans Find\ and\ Rep&lace:%s Поиск\ и\ &замена:%s " End Athena GUI only menutrans &Find\.\.\./ &Поиск\.\.\./ menutrans Find\ and\ Rep&lace\.\.\. Поиск\ и\ &замена\.\.\. menutrans Find\ and\ Rep&lace\.\.\.:%s Поиск\ и\ &замена\.\.\.:%s menutrans Find\ and\ Rep&lace\.\.\.:s Поиск\ и\ &замена\.\.\.:s "-------------------- menutrans Settings\ &Window Окно\ настройки\ &опций menutrans Startup\ &Settings Настройки\ запус&ка menutrans &Global\ Settings &Глобальные\ настройки menutrans F&ile\ Settings Настройки\ &файлов menutrans C&olor\ Scheme &Цветовая\ схема menutrans &Keymap Раскладка\ кл&авиатуры menutrans Select\ Fo&nt\.\.\. Выбор\ &шрифта\.\.\. ">>>----------------- Edit/Global settings menutrans Toggle\ Pattern\ &Highlight:set\ hls! Подсветка\ &найденных\ соответствий:set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! &Регистронезависимый\ поиск:set\ ic! menutrans Toggle\ &Showmatch:set\ sm! Показывать\ парные\ &элементы:set\ sm! menutrans &Context\ lines Стр&ок\ вокруг\ курсора menutrans &Virtual\ Edit Вир&туальное\ редактирование menutrans Toggle\ Insert\ &Mode:set\ im! Режим\ &Вставки:set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! &Совместимость\ с\ Vi: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:set\ nu! &Нумерация\ строк:set\ nu! menutrans Toggle\ relati&ve\ Line\ Numbering:set\ rnu! Относите&льная\ нумерация\ строк:set\ nru! menutrans Toggle\ &List\ Mode:set\ list! Отобра&жение\ невидимых\ символов:set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! &Перенос\ длинных\ строк:set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! Перенос\ &целых\ слов:set\ lbr! menutrans Toggle\ &expand-tab:set\ et! Про&белы\ вместо\ табуляции:set\ et! menutrans Toggle\ &auto-indent:set\ ai! Автоматическое\ форматирование\ &отступов:set\ ai! menutrans Toggle\ &C-indenting:set\ cin! Форматирование\ отступов\ в\ &стиле\ C:set\ cin! ">>>--- menutrans &Shiftwidth Вели&чина\ отступа menutrans Soft\ &Tabstop Ширина\ &табуляции menutrans Te&xt\ Width\.\.\. &Ширина\ текста\.\.\. menutrans &File\ Format\.\.\. &Формат\ файла\.\.\. " " " " Tools menu menutrans &Jump\ to\ this\ tagg^] &Переход\ к\ меткеg^] menutrans Jump\ &back^T &Вернуться\ назад^T menutrans Build\ &Tags\ File Создать\ &файл\ меток "------------------- menutrans &Folding Работа\ со\ &складками menutrans &Spelling Пр&авописание menutrans &Diff &Отличия\ (diff) "------------------- menutrans &Make:make Ко&мпиляция:make menutrans &List\ Errors:cl Список\ о&шибок:cl menutrans L&ist\ Messages:cl! Список\ все&х\ ошибок\ и\ предупреждений:cl! menutrans &Next\ Error:cn Следу&ющая\ ошибка:cn menutrans &Previous\ Error:cp П&редыдущая\ ошибка:cp menutrans &Older\ List:cold Более\ стар&ый\ список\ ошибок:cold menutrans N&ewer\ List:cnew Более\ све&жий\ список\ ошибок:cnew menutrans Error\ &Window Ок&но\ ошибок menutrans Se&T\ Compiler Выбор\ &компилятора "------------------- menutrans &Convert\ to\ HEX:%!xxd П&еревести\ в\ HEX:%!xxd menutrans Conve&rt\ back:%!xxd\ -r Перевести\ и&з\ HEX:%!xxd\ -r ">>>---------------- Tools/Spelling menutrans &Spell\ Check\ On &Вкл\ проверку\ правописания menutrans Spell\ Check\ &Off Вы&кл\ проверку\ правописания menutrans To\ &Next\ error]s &Следующая\ ошибка menutrans To\ &Previous\ error[s &Предыдущая\ ошибка menutrans Suggest\ &Correctionsz= Предложить\ исп&равления menutrans &Repeat\ correction:spellrepall Пов&торить\ исправление\ для\ всех "------------------- menutrans Set\ language\ to\ "en" Установить\ язык\ "en" menutrans Set\ language\ to\ "en_au" Установить\ язык\ "en_au" menutrans Set\ language\ to\ "en_ca" Установить\ язык\ "en_ca" menutrans Set\ language\ to\ "en_gb" Установить\ язык\ "en_gb" menutrans Set\ language\ to\ "en_nz" Установить\ язык\ "en_nz" menutrans Set\ language\ to\ "en_us" Установить\ язык\ "en_us" menutrans &Find\ More\ Languages &Найти\ больше\ языков let g:menutrans_set_lang_to = 'Установить язык' ">>>---------------- Folds menutrans &Enable/Disable\ foldszi Вкл/выкл\ &складкиzi menutrans &View\ Cursor\ Linezv Открыть\ строку\ с\ &курсоромzv menutrans Vie&w\ Cursor\ Line\ onlyzMzx Открыть\ &только\ строку\ с\ курсоромzMzx menutrans C&lose\ more\ foldszm Закрыть\ &больше\ складокzm menutrans &Close\ all\ foldszM Закрыть\ &все\ складкиzM menutrans &Open\ all\ foldszR Откр&ыть\ все\ складкиzR menutrans O&pen\ more\ foldszr Отк&рыть\ больше\ складокzr menutrans Fold\ Met&hod &Метод\ складок menutrans Create\ &Foldzf Со&здать\ складкуzf menutrans &Delete\ Foldzd У&далить\ складкуzd menutrans Delete\ &All\ FoldszD Удалить\ вс&е\ складки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:cwin О&бновить:cwin menutrans &Close:cclose &Закрыть:cclose menutrans &Open:copen &Открыть: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^Wn &Новое\ окно^Wn menutrans S&plit^Ws &Разделить\ окно^Ws menutrans Sp&lit\ To\ #^W^^ Открыть\ &соседний\ файл\ в\ новом\ окне^W^^ menutrans Split\ &Vertically^Wv Разделить\ по\ &вертикали^Wv menutrans Split\ File\ E&xplorer Открыть\ проводник\ по\ &файловой\ системе " menutrans &Close^Wc &Закрыть\ это\ окно^Wc menutrans Close\ &Other(s)^Wo Закрыть\ &остальные\ окна^Wo " menutrans Move\ &To &Переместить menutrans Rotate\ &Up^WR Сдвинуть\ ввер&х^WR menutrans Rotate\ &Down^Wr Сдвинуть\ в&низ^Wr " menutrans &Equal\ Size^W= О&динаковый\ размер^W= menutrans &Max\ Height^W_ Максимальная\ в&ысота^W_ menutrans M&in\ Height^W1_ Минимальная\ высо&та^W1_ menutrans Max\ &Width^W\| Максимальная\ &ширина^W\| menutrans Min\ Widt&h^W1\| Минимал&ьная\ ширина^W1\| ">>>----------------- Window/Move To menutrans &Top^WK В&верх^WK menutrans &Bottom^WJ В&низ^WJ menutrans &Left\ side^WH В&лево^WH menutrans &Right\ side^WL В&право^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_ для поиска команд Обычного режима (например, с_)\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 = "[Нет файла]" let &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/lang/menu_sk.cp1250.vim000066400000000000000000000001301267703067000202620ustar00rootroot00000000000000" Menu Translations: Slovak source :p:h/menu_slovak_slovak_republic.1250.vim vim-7.4.1689/runtime/lang/menu_sk_sk.1250.vim000066400000000000000000000003311267703067000204370ustar00rootroot00000000000000" Menu Translations: Slovak " Translated By: Martin Lacko " Last Change: 2003 May 11 " This is redirection to slovak menu-translations file source :p:h/menu_slovak_slovak_republic.1250.vim vim-7.4.1689/runtime/lang/menu_sk_sk.cp1250.vim000066400000000000000000000001301267703067000207570ustar00rootroot00000000000000" Menu Translations: Slovak source :p:h/menu_slovak_slovak_republic.1250.vim vim-7.4.1689/runtime/lang/menu_sk_sk.iso_8859-2.vim000066400000000000000000000235551267703067000215130ustar00rootroot00000000000000" Menu Translations: Slovak " Translated By: Martin Lacko " Last Change: 2012 May 01 " Quit when menu translations have already been done. if exists("did_menu_trans") finish endif let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim scriptencoding iso-8859-2 " Help menu menutrans &Help &Pomocnk menutrans &Overview &Prehad menutrans &User\ Manual Po&uvatesk\ manul menutrans &How-to\ links &Tipy menutrans &Find\.\.\. &Njs\.\.\. menutrans &Credits Po&akovanie menutrans O&rphans Si&roty menutrans Co&pying &Licencia menutrans &Version &Verzia menutrans &About &O\ programe " File menu menutrans &File &Sbor menutrans &Open\.\.\.:e &Otvori\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp Ot&vori\ v\ novom\ okne\.\.\.:sp menutrans &New:enew &Nov:enew menutrans &Close:close &Zatvori:close menutrans &Save:w &Uloi:w menutrans Save\ &As\.\.\.:sav Uloi\ &ako\.\.\.: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:wqa U&loi-Koniec:wqa menutrans E&xit:qa &Koniec:qa " Edit menu menutrans &Edit &pravy menutrans &Undou &Spu menutrans &Redo^R Z&rui\ sp^R menutrans Rep&eat\. &Opakova\. menutrans Cu&t"+x &Vystrihn"+x menutrans &Copy"+y &Koprova"+y menutrans &Paste"+gP V&loi"+gP menutrans Put\ &Before[p Vloi\ &pred[p menutrans Put\ &After]p Vloi\ za]p menutrans &Select\ allggVG Vy&bra\ vetkoggVG menutrans &Deletex Vy&mazax menutrans &Find\.\.\. &Njs\.\.\. menutrans Find\ and\ Rep&lace\.\.\. N&ahradi\.\.\. menutrans Settings\ &Window Mo&nosti menutrans &Global\ Settings &Globlne monosti menutrans Toggle\ Pattern\ &Highlight:set\ hls! Prepn\ paletu\ zvrazovania:set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! Prepn\ &ignorovanie vekosti:set\ ic! menutrans Toggle\ &Showmatch:set\ sm! Prepn\ &ukza\ zhodu:set\ sm! menutrans &Context\ lines &Kontextov\ riadky menutrans &Virtual\ Edit &Virtulne pravy menutrans Never Nikdy menutrans Block\ Selection Blokov\ vber menutrans Insert\ mode Reim\ vkladania menutrans Block\ and\ Insert Blok\ a\ vkladanie menutrans Always Vdy menutrans Toggle\ Insert\ &Mode:set\ im! Prepn\ rei&m\ vkladania:set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! Prepn\ vi\ kompatibilitu:set\ cp! menutrans Search\ &Path\.\.\. Cesta\ &hadania\.\.\. menutrans Ta&g\ Files\.\.\. Ta&gov sbory\.\.\. menutrans Toggle\ &Toolbar Prepn\ &panel menutrans Toggle\ &Bottom\ Scrollbar Prepn\ spodn\ posuvnk menutrans Toggle\ &Left\ Scrollbar Prepn\ av\ posuvnk menutrans Toggle\ &Right\ Scrollbar Prepn\ prav\ posuvnk menutrans F&ile\ Settings Nastavenia\ sboru menutrans Toggle\ Line\ &Numbering:set\ nu! Prepn\ slova&nie\ riadkov:set\ nu! menutrans Toggle\ &List\ Mode:set\ list! Prepn\ reim\ &zoznamu:set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! Prepn\ z&alamovanie\ riadkov:set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! Prepn\ za&lamovanie\ slov:set\ lbr! menutrans Toggle\ &expand-tab:set\ et! Prepn\ rozr&en\ tabultory:set\ et! menutrans Toggle\ &auto-indent:set\ ai! Prepn\ automatick\ &odsadzovanie:set\ ai! menutrans Toggle\ &C-indenting:set\ cin! Prepn\ &C-odsadzovanie:set\ cin! menutrans &Shiftwidth &rka\ iftu menutrans Soft\ &Tabstop &Softvrov\ tabultor menutrans Te&xt\ Width\.\.\. rka\ te&xtu\.\.\. menutrans &File\ Format\.\.\. &Formt\ sboru\.\.\. menutrans C&olor\ Scheme Far&ebn\ schma " Programming menu menutrans &Tools &Nstroje menutrans &Jump\ to\ this\ tagg^] &Skoi\ na\ znakug^] menutrans Jump\ &back^T Sk&oi\ sp^T menutrans Build\ &Tags\ File &Vytvori\ sbor\ znaiek menutrans &Folding &Vnranie menutrans &Enable/Disable\ foldszi Zapn/Vypn\ vnrani&ezi menutrans &View\ Cursor\ Linezv Zobrazi\ kurzoro&v\ riadokzv menutrans Vie&w\ Cursor\ Line\ onlyzMzx Zobrazi\ iba\ kurzorov\ riadokzMzx menutrans C&lose\ more\ foldszm Zatvori\ viac \vnorenzm menutrans &Close\ all\ foldszM Zatvor&i\ vetky\ vnoreniazM menutrans O&pen\ more\ foldszr O&tvori\ viac\ vnorenzr menutrans &Open\ all\ foldszR &Otvori\ vetky\ vnoreniazR menutrans Fold\ Met&hod Met&da\ vnrania menutrans M&anual M&anulne menutrans I&ndent Odsade&nie menutrans E&xpression &Vraz menutrans S&yntax S&yntax menutrans &Diff Roz&diel menutrans Ma&rker Zna&kova menutrans Create\ &Foldzf Vyt&vori\ vnoreniezf menutrans &Delete\ Foldzd V&ymaza\ vnoreniezd menutrans Delete\ &All\ FoldszD Vymaza\ vetky\ vnoreniazD menutrans Fold\ column\ &width rka\ &vkladanho\ stpca menutrans &Diff &Rozdiely menutrans &Update Akt&ualizova menutrans &Get\ Block Zob&ra\ blok menutrans &Put\ Block &Vloi\ blok menutrans Error\ &Window Chybov\ &okno menutrans &Update:cwin Akt&ualizova:cwin menutrans &Open:copen &Otvori:copen menutrans &Close:cclose &Zatvori:cclose menutrans &Convert\ to\ HEX:%!xxd &Konvertova\ do\ HEX:%!xxd menutrans Conve&rt\ back:%!xxd\ -r Konve&rtova\ sp:%!xxd\ -r menutrans &Make:make &Make:make menutrans &List\ Errors:cl Vpis\ &chb:cl menutrans L&ist\ Messages:cl! Vp&is\ sprv:cl! menutrans &Next\ Error:cn a&lia\ chyba:cn menutrans &Previous\ Error:cp &Predchdzajca\ chyba:cp menutrans &Older\ List:cold Sta&r\ zoznam:cold menutrans N&ewer\ List:cnew Nov\ &zoznam:cnew menutrans Error\ &Window:cwin Chybov\ o&kno:cwin menutrans &Set\ Compiler Vyberte\ k&ompiltor menutrans Convert\ to\ HEX:%!xxd Prvies\ do\ es&tnstkovho\ formtu:%!xxd menutrans Convert\ back:%!xxd\ -r Pr&evies\ sp:%!xxd\ -r " Names for buffer menu. menutrans &Buffers &Vyrovnvacia\ pam menutrans &Refresh\ menu Obnovi menutrans &Delete Vymaza menutrans &Alternate Zmeni menutrans &Next &alia menutrans &Previous &Predchdzajca menutrans [No File] [iadny\ sbor] " Window menu menutrans &Window &Okn menutrans &New^Wn &Nov^Wn menutrans S&plit^Ws &Rozdeli^Ws menutrans Sp&lit\ To\ #^W^^ Ro&zdeli\ na\ #^W^^ menutrans Split\ &Vertically^Wv Rozdeli\ &vertiklne^Wv menutrans Split\ File\ E&xplorer Otvori\ pri&eskumnka menutrans &Close^Wc Zatvor&i^Wc menutrans Close\ &Other(s)^Wo Zatvori\ i&n^Wo menutrans Move\ &To Presun& menutrans &Top^WK Na&hor^WK menutrans &Bottom^WJ Nado&l^WJ menutrans &Left\ side^WH V&avo^WJ menutrans &Right\ side^WL Vprav&o^WL menutrans Ne&xt^Ww &alie^Ww menutrans P&revious^WW &Predchdzajce^WW menutrans &Equal\ Size^W= Rovnak\ v&ka^W= menutrans &Max\ Height^W_ &Maximlna\ vka^W_ menutrans M&in\ Height^W1_ Minimlna\ v&ka^W1_ menutrans Max\ &Width^W\| Maximlna\ rka^W\| menutrans Min\ Widt&h^W1\| Minimlna irka^W1\| menutrans Rotate\ &Up^WR Rotova&\ nahor^WR menutrans Rotate\ &Down^Wr Rotova\ na&dol^Wr menutrans Select\ Fo&nt\.\.\. Vy&bra\ psmo\.\.\. " The popup menu menutrans &Undo &Sp menutrans Cu&t &Vystrihn menutrans &Copy &Koprova menutrans &Paste V&loi 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 sbor tmenu ToolBar.Save Uloi sbor tmenu ToolBar.SaveAll Uloi vetky tmenu ToolBar.Print Tla tmenu ToolBar.Undo Sp tmenu ToolBar.Redo Opakova tmenu ToolBar.Cut Vystrihn tmenu ToolBar.Copy Koprova tmenu ToolBar.Paste Vloi tmenu ToolBar.Find Njs... tmenu ToolBar.FindNext Njs alie tmenu ToolBar.FindPrev Njs predchdzajce 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 vertiklne tmenu ToolBar.WinMaxWidth Maximalizova rku okna tmenu ToolBar.WinMinWidth Minimalizova rku okna tmenu ToolBar.WinClose Zatvori okno endif tmenu ToolBar.LoadSesn Nata sedenie tmenu ToolBar.SaveSesn Uloi sedenie tmenu ToolBar.RunScript Spusti skript tmenu ToolBar.Make Spusti make tmenu ToolBar.Shell Spusti el tmenu ToolBar.RunCtags Spusti ctags tmenu ToolBar.TagJump Skoi na tag pod kurzorom tmenu ToolBar.Help Pomocnk tmenu ToolBar.FindHelp Njs pomocnka 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 &Rune menutrans A&utomatic A&utomaticky " menutrans o&n\ (this\ file) &Zapn\ (pre\ tento\ sbor) " menutrans o&ff\ (this\ file) Vyp&n\ (pre\ tento\ sbor ) menutrans on/off\ for\ &This\ file Zapn/vypn\ pre\ &tento\ sbor menutrans Co&lor\ test Test\ &farieb menutrans &Highlight\ test &Test\ zvrazovania menutrans &Convert\ to\ HTML &Previes\ do\ HTML let &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/lang/menu_sk_sk.vim000066400000000000000000000004101267703067000200470ustar00rootroot00000000000000" Menu Translations: Slovak " Translated By: Martin Lacko " Last Change: 2002 May 27 if has("win32") || has("win16") || has("dos16") || has("dos32") source :p:h/menu_sk_sk.1250.vim else source :p:h/menu_sk_sk.iso_8859-2.vim endif vim-7.4.1689/runtime/lang/menu_sl_si.cp1250.vim000066400000000000000000000315541267703067000207740ustar00rootroot00000000000000" Menu Translations: Slovenian / Slovensko " Maintainer: Mojca Miklavec " Originally By: Mojca Miklavec " Last Change: Sat, 17 Jun 2006 " vim:set foldmethod=marker tabstop=8: " TODO: add/check all '&'s " Quit when menu translations have already been done. if exists("did_menu_trans") finish endif let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim scriptencoding cp1250 " {{{ FILE / DATOTEKA menutrans &File &Datoteka menutrans &Open\.\.\.:e &Odpri\ \.\.\.:e menutrans Sp&lit-Open\.\.\.:sp Odpri\ de&ljeno\ \.\.\.:sp menutrans Open\ Tab\.\.\.:tabnew Odpri\ v\ zavi&hku\ \.\.\.:tabnew menutrans &New:enew &Nova:enew menutrans &Close:close &Zapri:close menutrans &Save:w &Shrani:w menutrans Save\ &As\.\.\.:sav Shrani\ &kot\ \.\.\.:sav menutrans &Print Na&tisni menutrans Sa&ve-Exit:wqa Shrani\ in\ &konaj:wqa menutrans E&xit:qa &Izhod:qa if has("diff") menutrans Split\ &Diff\ with\.\.\. Primerjaj\ z\ (di&ff)\ \.\.\. menutrans Split\ Patched\ &By\.\.\. &Popravi\ z\ (patch)\ \.\.\. endif " }}} FILE / DATOTEKA " {{{ EDIT / UREDI menutrans &Edit &Uredi menutrans &Undou &Razveljaviu menutrans &Redo^R &Obnovi^R menutrans Rep&eat\. Po&novi\. menutrans Cu&t"+x &Izrei"+x menutrans &Copy"+y &Kopiraj"+y menutrans &Paste"+gP &Prilepi"+gP menutrans Put\ &Before[p Vrini\ pred[p menutrans Put\ &After]p Vrini\ za]p menutrans &Deletex Iz&briix menutrans &Select\ allggVG Izberi\ vseggVG menutrans &Find\.\.\. Po&ii\ \.\.\. menutrans Find\ and\ Rep&lace\.\.\. Poii\ in\ &zamenjaj\ \.\.\. " [-- SETTINGS --] menutrans Settings\ &Window Nastavitve\ \.\.\. menutrans Startup\ &Settings Zaetne\ nastavitve menutrans &Global\ Settings &Globalne\ nastavitve menutrans Toggle\ Pattern\ &Highlight:set\ hls! Vkljui/izkljui\ poudarjanje\ iskanega\ niza:set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! Vkljui/izkljui\ loevanje\ velikih\ in\ malih\ rk:set\ ic! menutrans Toggle\ &Showmatch:set\ sm! Vkljui/izkljui\ kratek\ skok\ na\ pripadajoi\ oklepaj:set\ sm! menutrans &Context\ lines t\.\ vidnih\ vrstic\ pred/za\ kurzorjem menutrans &Virtual\ Edit Dovoli\ poloaj\ kazalka,\ kjer\ ni\ besedila menutrans Never Nikoli menutrans Block\ Selection Le\ med\ izbiranjem\ bloka menutrans Insert\ mode Le\ v\ nainu\ za\ pisanje menutrans Block\ and\ Insert Pri\ obojem menutrans Always Vedno menutrans Toggle\ Insert\ &Mode:set\ im! Vkljui/izkljui\ nain\ za\ pisanje:set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! Vkljui/izkljui\ zdruljivost\ z\ Vi-jem:set\ cp! menutrans Search\ &Path\.\.\. Pot\ za\ iskanje\ \.\.\. menutrans Ta&g\ Files\.\.\. Ta&g-datoteke\.\.\. menutrans Toggle\ &Toolbar Pokai/skrij\ Orodja menutrans Toggle\ &Bottom\ Scrollbar Pokai/skrij\ spodnji\ drsnik menutrans Toggle\ &Left\ Scrollbar Pokai/skrij\ levi\ drsnik menutrans Toggle\ &Right\ Scrollbar Pokai/skrij\ desni\ drsnik " Edit/File Settings menutrans F&ile\ Settings &Nastavitve\ datoteke " Boolean options menutrans Toggle\ Line\ &Numbering:set\ nu! Pokai/skrij\ tevilke\ vrstic:set\ nu! menutrans Toggle\ &List\ Mode:set\ list! Pokai/skrij\ nevidne\ znake:set\ list! " space/tab menutrans Toggle\ Line\ &Wrap:set\ wrap! Vkljui/izkljui\ prelome\ vrstic:set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! Vkljui/izkljui\ prelome\ vrstic\ med\ besedami:set\ lbr! menutrans Toggle\ &expand-tab:set\ et! Vkljui/izkljui\ zamenjavo\ tabulatorjev\ s\ presledki:set\ et! menutrans Toggle\ &auto-indent:set\ ai! Vkljui/izkljui\ avtomatsko\ zamikanje\ vrstic:set\ ai! menutrans Toggle\ &C-indenting:set\ cin! Vkljui/izkljui\ C-jevski\ nain\ zamikanja\ vrstic:set\ cin! " other options menutrans &Shiftwidth irina\ zamika\ vrstic menutrans Soft\ &Tabstop irina\ &tabulatorja menutrans Te&xt\ Width\.\.\. irina\ besedila\ \.\.\. menutrans &File\ Format\.\.\. Format\ &datoteke\ \.\.\. menutrans C&olor\ Scheme &Barvna\ shema\ \.\.\. menutrans &Keymap &Keymap menutrans Select\ Fo&nt\.\.\. Pisava\ \.\.\. " }}} EDIT / UREDI " {{{ TOOLS / ORODJA menutrans &Tools &Orodja menutrans &Jump\ to\ this\ tagg^] &Skoi\ k\ tej\ znakig^] menutrans Jump\ &back^T Skoi\ Na&zaj^T menutrans Build\ &Tags\ File Napravi\ datoteke\ z\ znakami\ (tag) if has("spell") menutrans &Spelling rkovalnik menutrans &Spell\ Check\ On &Vkljui menutrans Spell\ Check\ &Off &Izkljui menutrans To\ &Next\ error]s K\ &naslednji\ napaki]s menutrans To\ &Previous\ error[s K\ &prejnji\ napaki[s menutrans Suggest\ &Correctionsz= Predlagaj\ popravekz= menutrans &Repeat\ correction:spellrepall Po&novi\ popravke\ na\ vseh\ besedah:spellrepall menutrans Set\ language\ to\ "en" Angleki\ "en" menutrans Set\ language\ to\ "en_au" Angleki\ "en_au" menutrans Set\ language\ to\ "en_ca" Angleki\ "en_ca" menutrans Set\ language\ to\ "en_gb" Angleki\ "en_gb" menutrans Set\ language\ to\ "en_nz" Angleki\ "en_nz" menutrans Set\ language\ to\ "en_us" Angleki\ "en_us" menutrans Set\ language\ to\ "sl" Slovenski\ "sl" menutrans Set\ language\ to\ "de" Nemki\ "de" menutrans Set\ language\ to\ rkovalnik:\ menutrans &Find\ More\ Languages &Ostali\ jeziki endif if has("folding") menutrans &Folding Zvijanje\ kode " open close folds menutrans &Enable/Disable\ foldszi Omogoi/onemogoi\ zvijanjezi " Omogoi/onemogoi\ zavihke menutrans &View\ Cursor\ Linezv Pokai\ vrstico\ s\ kazalkomzv " kjer je kazalec menutrans Vie&w\ Cursor\ Line\ onlyzMzx Pokai\ samo\ vrstico\ s\ kazalkomzMzx menutrans C&lose\ more\ foldszm Zvij\ naslednji\ nivozm " Zapri\ ve\ zavihkov menutrans &Close\ all\ foldszM Zvij\ vso\ kodozM " Zapri\ vse\ zavihke menutrans O&pen\ more\ foldszr Razvij\ en\ nivozr " Odpri\ ve\ zavihkov menutrans &Open\ all\ foldszR Razvij\ vso\ kodozR " Odpri\ vse\ zavihke " fold method menutrans Fold\ Met&hod Kriterij\ za\ zvijanje " Ustvarjanje\ zavihkov menutrans M&anual &Rono menutrans I&ndent Glede\ na\ &poravnavo menutrans E&xpression Z\ &izrazi\ (foldexpr) menutrans S&yntax Glede\ na\ &sintakso menutrans &Diff Razlike\ (&diff) menutrans Ma&rker Z\ &markerji/oznabami " create and delete folds " TODO accelerators menutrans Create\ &Foldzf Ustvari\ zvitekzf menutrans &Delete\ Foldzd Izbrii\ zvitekzd menutrans Delete\ &All\ FoldszD Izbrii\ vse\ zvitkezD " moving around in folds menutrans Fold\ column\ &width irina\ drevesa\ z\ zvitki endif " has folding if has("diff") menutrans &Diff Razlike\ (&Diff) menutrans &Update &Posodobi menutrans &Get\ Block &Sprejmi\ (spremeni\ to\ okno) " XXX: check if translation is OK menutrans &Put\ Block &Polji\ (spremeni\ drugo\ okno) endif menutrans &Make:make Napravi\ (&make):make menutrans &List\ Errors:cl Pokai\ napake:cl menutrans L&ist\ Messages:cl! Pokai\ sporoila:cl! menutrans &Next\ Error:cn K\ &naslednji\ napaki:cn menutrans &Previous\ Error:cp K\ &prejnji\ napaki:cp menutrans &Older\ List:cold K\ &starejemu\ seznamu\ napak:cold menutrans N&ewer\ List:cnew K\ &novejemu\ seznamu\ napak:cnew menutrans Error\ &Window Okno\ z\ napakami menutrans &Update:cwin &Posodobi:cwin menutrans &Open:copen &Odpri:copen menutrans &Close:cclose &Zapri:cclose menutrans &Set\ Compiler Nastavi\ &prevajalnik menutrans Se&T\ Compiler Nastavi\ &prevajalnik " bug in original translation? menutrans &Convert\ to\ HEX:%!xxd Pretvori\ v\ HE&X:%!xxd menutrans Conve&rt\ back:%!xxd\ -r Pretvori\ nazaj:%!xxd\ -r " }}} TOOLS / ORODJA " {{{ SYNTAX / BARVANJE KODE menutrans &Syntax &Barvanje\ kode menutrans &Show\ filetypes\ in\ menu Podprte\ vrste\ datotek menutrans Set\ '&syntax'\ only Samo\ barvanje\ ('&syntax') menutrans Set\ '&filetype'\ too Tudi\ obnaanje\ ('&filetype') menutrans &Off &Izkljueno menutrans &Manual &Rono menutrans A&utomatic &Avtomatsko menutrans on/off\ for\ &This\ file Vkljui/izkljui\ za\ to\ datoteko menutrans Co&lor\ test Preizkus\ barv menutrans &Highlight\ test Preizkus\ barvanja\ kode menutrans &Convert\ to\ HTML Pretvori\ v\ &HTML " }}} SYNTAX / BARVANJE KODE " {{{ BUFFERS / MEDPOMNILNIK menutrans &Buffers &Medpomnilnik " XXX: ni najbolje: okno bi bolj pristajalo, ampak okno je e menutrans &Refresh\ menu &Osvei menutrans Delete &Brii menutrans &Alternate &Menjaj menutrans &Next &Naslednji menutrans &Previous &Prejnji menutrans [No\ File] [Brez\ datoteke] " }}} BUFFERS / MEDPOMNILNIK " {{{ WINDOW / OKNO menutrans &Window &Okno menutrans &New^Wn &Novo^Wn menutrans S&plit^Ws Razdeli^Ws menutrans Split\ &Vertically^Wv Razdeli\ navpino^Ws menutrans Split\ File\ E&xplorer Razdeli:\ Vsebina\ mape menutrans Sp&lit\ To\ #^W^^ Razdeli\ v\ #^W^^ menutrans &Close^Wc &Zapri^Wc menutrans Close\ &Other(s)^Wo Zapri\ &ostala^Wo menutrans Move\ &To Premakni menutrans &Top^WK &Gor^WK menutrans &Bottom^WJ &Dol^WJ menutrans &Left\ side^WH &Levo^WH menutrans &Right\ side^WL &Desno^WL menutrans Rotate\ &Up^WR Zavrti\ navzgor^WR menutrans Rotate\ &Down^Wr Zavrti\ navzdol^Wr menutrans &Equal\ Size^W= &Enaka\ velikost^W= menutrans &Max\ Height^W_ Najvije^W_ menutrans M&in\ Height^W1_ Najnije^W1_ menutrans Max\ &Width^W\| Najire^W\| menutrans Min\ Widt&h^W1\| Najoje^W1\| " }}} WINDOW / OKNO " {{{ HELP / POMO menutrans &Help &Pomo menutrans &Overview Hitri\ pregled menutrans &User\ Manual P&rironik menutrans &How-to\ links &How-to\ kazalo menutrans &Find\.\.\. Po&ii\ \.\.\. " conflicts with Edit.Find menutrans &Credits &Avtorji menutrans Co&pying &Licenca menutrans &Sponsor/Register Registracija\ in\ &donacije menutrans O&rphans &Sirotam menutrans &Version &Verzija menutrans &About &O\ programu " }}} HELP / POMO " {{{ POPUP menutrans &Undo &Razveljavi menutrans Cu&t &Izrei menutrans &Copy &Kopieraj menutrans &Paste &Prilepi menutrans &Delete &Zbrii menutrans Select\ Blockwise Izbiraj\ po\ blokih menutrans Select\ &Word Izberi\ &besedo menutrans Select\ &Sentence Izberi\ &stavek menutrans Select\ Pa&ragraph Izberi\ &odstavek menutrans Select\ &Line Izberi\ vrs&tico menutrans Select\ &Block Izberi\ b&lok menutrans &Select\ AllggVG Izberi\ &vseggVG " }}} POPUP " {{{ TOOLBAR if has("toolbar") if exists("*Do_toolbar_tmenu") delfun Do_toolbar_tmenu endif fun Do_toolbar_tmenu() tmenu ToolBar.Open Odpri datoteko tmenu ToolBar.Save Shrani datoteko tmenu ToolBar.SaveAll Shrani vse datoteke tmenu ToolBar.Print Natisni tmenu ToolBar.Undo Razveljavi tmenu ToolBar.Redo Obnovi tmenu ToolBar.Cut Izrei tmenu ToolBar.Copy Kopiraj tmenu ToolBar.Paste Prilepi tmenu ToolBar.Find Najdi ... tmenu ToolBar.FindNext Najdi naslednje tmenu ToolBar.FindPrev Najdi prejnje tmenu ToolBar.Replace Najdi in zamenjaj ... tmenu ToolBar.LoadSesn Naloi sejo tmenu ToolBar.SaveSesn Shrani trenutno sejo tmenu ToolBar.RunScript Izberi Vim skripto za izvajanje tmenu ToolBar.Make Napravi trenutni projekt (:make) tmenu ToolBar.RunCtags Napravi znake v trenutnem direktoriju (!ctags -R.) tmenu ToolBar.TagJump Skoi k znaki pod kurzorjem tmenu ToolBar.Help Pomo za Vim tmenu ToolBar.FindHelp Ii v pomoi za Vim endfun endif " }}} TOOLBAR " {{{ DIALOG TEXTS let g:menutrans_no_file = "[Brez datoteke]" let g:menutrans_help_dialog = "Vnesite ukaz ali besedo, za katero elite pomo:\n\nUporabite predpono i_ za ukaze v nainu za pisanje (npr.: i_CTRL-X)\nUporabite predpono c_ za ukaze v ukazni vrstici (command-line) (npr.: c_)\nUporabite predpono ' za imena opcij (npr.: 'shiftwidth')" let g:menutrans_path_dialog = "Vnesite poti za iskanje datotek.\nImena direktorijev loite z vejico." let g:menutrans_tags_dialog = "Vnesite imena datotek z znakami ('tag').\nImana loite z vejicami." let g:menutrans_textwidth_dialog = "Vnesite novo irino besedila (ali 0 za izklop formatiranja): " let g:menutrans_fileformat_dialog = "Izberite format datoteke" let g:menutrans_fileformat_choices = "&Unix\n&Dos\n&Mac\n&Preklii" " }}} let &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/lang/menu_sl_si.latin2.vim000066400000000000000000000315041267703067000212460ustar00rootroot00000000000000" Menu Translations: Slovenian / Slovensko " Maintainer: Mojca Miklavec " Originally By: Mojca Miklavec " Last Change: Mon, 12 Jun 2006 00:00:00 CEST " vim:set foldmethod=marker tabstop=8: " TODO: add/check all '&'s " Quit when menu translations have already been done. if exists("did_menu_trans") finish endif let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim scriptencoding latin2 " {{{ FILE / DATOTEKA menutrans &File &Datoteka menutrans &Open\.\.\.:e &Odpri\ \.\.\.:e menutrans Sp&lit-Open\.\.\.:sp Odpri\ de&ljeno\ \.\.\.:sp menutrans Open\ Tab\.\.\.:tabnew Odpri\ v\ zavi&hku\ \.\.\.:tabnew menutrans &New:enew &Nova:enew menutrans &Close:close &Zapri:close menutrans &Save:w &Shrani:w menutrans Save\ &As\.\.\.:sav Shrani\ &kot\ \.\.\.:sav menutrans &Print Na&tisni menutrans Sa&ve-Exit:wqa Shrani\ in\ &konaj:wqa menutrans E&xit:qa &Izhod:qa if has("diff") menutrans Split\ &Diff\ with\.\.\. Primerjaj\ z\ (di&ff)\ \.\.\. menutrans Split\ Patched\ &By\.\.\. &Popravi\ z\ (patch)\ \.\.\. endif " }}} FILE / DATOTEKA " {{{ EDIT / UREDI menutrans &Edit &Uredi menutrans &Undou &Razveljaviu menutrans &Redo^R &Obnovi^R menutrans Rep&eat\. Po&novi\. menutrans Cu&t"+x &Izrei"+x menutrans &Copy"+y &Kopiraj"+y menutrans &Paste"+gP &Prilepi"+gP menutrans Put\ &Before[p Vrini\ pred[p menutrans Put\ &After]p Vrini\ za]p menutrans &Deletex Iz&briix menutrans &Select\ allggVG Izberi\ vseggVG menutrans &Find\.\.\. Po&ii\ \.\.\. menutrans Find\ and\ Rep&lace\.\.\. Poii\ in\ &zamenjaj\ \.\.\. " [-- SETTINGS --] menutrans Settings\ &Window Nastavitve\ \.\.\. menutrans Startup\ &Settings Zaetne nastavitve menutrans &Global\ Settings &Globalne\ nastavitve menutrans Toggle\ Pattern\ &Highlight:set\ hls! Vkljui/izkljui\ poudarjanje\ iskanega\ niza:set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! Vkljui/izkljui\ loevanje\ velikih\ in\ malih\ rk:set\ ic! menutrans Toggle\ &Showmatch:set\ sm! Vkljui/izkljui\ kratek\ skok\ na\ pripadajoi\ oklepaj:set\ sm! menutrans &Context\ lines t\.\ vidnih\ vrstic\ pred/za\ kurzorjem menutrans &Virtual\ Edit Dovoli\ poloaj\ kazalka,\ kjer\ ni\ besedila menutrans Never Nikoli menutrans Block\ Selection Le\ med\ izbiranjem\ bloka menutrans Insert\ mode Le\ v\ nainu\ za\ pisanje menutrans Block\ and\ Insert Pri\ obojem menutrans Always Vedno menutrans Toggle\ Insert\ &Mode:set\ im! Vkljui/izkljui\ nain\ za\ pisanje:set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! Vkljui/izkljui\ zdruljivost\ z\ Vi-jem:set\ cp! menutrans Search\ &Path\.\.\. Pot\ za\ iskanje\ \.\.\. menutrans Ta&g\ Files\.\.\. Ta&g-datoteke\.\.\. menutrans Toggle\ &Toolbar Pokai/skrij\ Orodja menutrans Toggle\ &Bottom\ Scrollbar Pokai/skrij\ spodnji\ drsnik menutrans Toggle\ &Left\ Scrollbar Pokai/skrij\ levi\ drsnik menutrans Toggle\ &Right\ Scrollbar Pokai/skrij\ desni\ drsnik " Edit/File Settings menutrans F&ile\ Settings &Nastavitve\ datoteke " Boolean options menutrans Toggle\ Line\ &Numbering:set\ nu! Pokai/skrij\ tevilke\ vrstic:set\ nu! menutrans Toggle\ &List\ Mode:set\ list! Pokai/skrij\ nevidne\ znake:set\ list! " space/tab menutrans Toggle\ Line\ &Wrap:set\ wrap! Vkljui/izkljui\ prelome\ vrstic:set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! Vkljui/izkljui\ prelome\ vrstic\ med\ besedami:set\ lbr! menutrans Toggle\ &expand-tab:set\ et! Vkljui/izkljui\ zamenjavo\ tabulatorjev\ s\ presledki:set\ et! menutrans Toggle\ &auto-indent:set\ ai! Vkljui/izkljui\ avtomatsko\ zamikanje\ vrstic:set\ ai! menutrans Toggle\ &C-indenting:set\ cin! Vkljui/izkljui\ C-jevski\ nain\ zamikanja\ vrstic:set\ cin! " other options menutrans &Shiftwidth irina\ zamika\ vrstic menutrans Soft\ &Tabstop irina &tabulatorja menutrans Te&xt\ Width\.\.\. irina\ besedila\ \.\.\. menutrans &File\ Format\.\.\. Format\ &datoteke\ \.\.\. menutrans C&olor\ Scheme &Barvna\ shema\ \.\.\. menutrans &Keymap &Keymap menutrans Select\ Fo&nt\.\.\. Pisava\ \.\.\. " }}} EDIT / UREDI " {{{ TOOLS / ORODJA menutrans &Tools &Orodja menutrans &Jump\ to\ this\ tagg^] &Skoi\ k\ tej\ znakig^] menutrans Jump\ &back^T Skoi\ Na&zaj^T menutrans Build\ &Tags\ File Napravi\ datoteke\ z\ znakami\ (tag) if has("spell") menutrans &Spelling rkovalnik menutrans &Spell\ Check\ On &Vkljui menutrans Spell\ Check\ &Off &Izkljui menutrans To\ &Next\ error]s K\ &naslednji\ napaki]s menutrans To\ &Previous\ error[s K\ &prejnji\ napaki[s menutrans Suggest\ &Correctionsz= Predlagaj\ popravekz= menutrans &Repeat\ correction:spellrepall Po&novi\ popravke\ na\ vseh\ besedah:spellrepall menutrans Set\ language\ to\ "en" rkovalnik:\ angleki\ "en" menutrans Set\ language\ to\ "en_au" rkovalnik:\ angleki\ "en_au" menutrans Set\ language\ to\ "en_ca" rkovalnik:\ angleki\ "en_ca" menutrans Set\ language\ to\ "en_gb" rkovalnik:\ angleki\ "en_gb" menutrans Set\ language\ to\ "en_nz" rkovalnik:\ angleki\ "en_nz" menutrans Set\ language\ to\ "en_us" rkovalnik:\ angleki\ "en_us" menutrans Set\ language\ to\ "sl" rkovalnik:\ slovenski\ "sl" menutrans Set\ language\ to\ "de" rkovalnik:\ nemki\ "de" menutrans Set\ language\ to\ rkovalnik:\ menutrans &Find\ More\ Languages &Ostali\ jeziki endif if has("folding") menutrans &Folding Zavihek " open close folds menutrans &Enable/Disable\ foldszi Omogoi/onemogoi\ zavihkezi menutrans &View\ Cursor\ Linezv Pokai\ vrstico\ s\ kazalcemzv " kjer je kazalec menutrans Vie&w\ Cursor\ Line\ onlyzMzx Pokai\ samo\ vrstico\ s\ kazalcemzMzx menutrans C&lose\ more\ foldszm Zapri\ ve\ zavihkovzm menutrans &Close\ all\ foldszM Zapri\ vse\ zavihkezM menutrans O&pen\ more\ foldszr Odpri\ ve\ zavihkovzr menutrans &Open\ all\ foldszR Odpri\ vse\ zavihkezR " fold method menutrans Fold\ Met&hod Ustvarjanje\ zavihkov menutrans M&anual &Rono menutrans I&ndent Glede\ na\ &poravnavo menutrans E&xpression Z\ &izrazi\ (foldexpr) menutrans S&yntax Glede\ na\ &sintakso menutrans &Diff Razlike\ (&diff) menutrans Ma&rker Z\ &markerji/oznabami " create and delete folds " TODO accelerators menutrans Create\ &Foldzf Ustvari\ zavihekzf menutrans &Delete\ Foldzd Izbrii\ zavihekzd menutrans Delete\ &All\ FoldszD Izbrii\ vse\ zavihkezD " moving around in folds menutrans Fold\ column\ &width irina\ stolpca\ z\ zavihkom endif " has folding if has("diff") menutrans &Diff Razlike\ (&Diff) menutrans &Update &Posodobi menutrans &Get\ Block &Sprejmi\ (spremeni\ to\ okno) " TODO: check if translation is OK menutrans &Put\ Block &Polji\ (spremeni\ drugo\ okno) endif menutrans &Make:make Napravi\ (&make):make menutrans &List\ Errors:cl Pokai\ napake:cl menutrans L&ist\ Messages:cl! Pokai\ sporoila:cl! menutrans &Next\ Error:cn K\ &naslednji\ napaki:cn menutrans &Previous\ Error:cp K\ &prejnji\ napaki:cp menutrans &Older\ List:cold K\ &starejemu\ seznamu\ napak:cold menutrans N&ewer\ List:cnew K\ &novejemu\ seznamu\ napak:cnew menutrans Error\ &Window Okno\ z\ napakami menutrans &Update:cwin &Posodobi:cwin menutrans &Open:copen &Odpri:copen menutrans &Close:cclose &Zapri:cclose menutrans &Set\ Compiler Nastavi\ &prevajalnik menutrans Se&T\ Compiler Nastavi\ &prevajalnik " bug in original translation? menutrans &Convert\ to\ HEX:%!xxd Pretvori\ v\ HE&X:%!xxd menutrans Conve&rt\ back:%!xxd\ -r Pretvori\ nazaj:%!xxd\ -r " }}} TOOLS / ORODJA " {{{ SYNTAX / BARVANJE KODE menutrans &Syntax &Barvanje\ kode menutrans &Show\ filetypes\ in\ menu Podprte\ vrste\ datotek menutrans Set\ '&syntax'\ only Samo\ barvanje\ ('&syntax') menutrans Set\ '&filetype'\ too Tudi\ obnaanje\ ('&filetype') menutrans &Off &Izkljueno menutrans &Manual &Rono menutrans A&utomatic &Avtomatsko menutrans on/off\ for\ &This\ file Vkljui/izkljui\ za\ to\ datoteko menutrans Co&lor\ test Preizkus\ barv menutrans &Highlight\ test Preizkus\ barvanja\ kode menutrans &Convert\ to\ HTML Pretvori\ v\ &HTML " }}} SYNTAX / BARVANJE KODE " {{{ BUFFERS / MEDPOMNILNIK menutrans &Buffers &Medpomnilnik " XXX: ni najbolje: okno bi bolj pristajalo, ampak okno je e menutrans &Refresh\ menu &Osvei menutrans Delete &Brii menutrans &Alternate &Menjaj menutrans &Next &Naslednji menutrans &Previous &Prejnji menutrans [No\ File] [Brez\ datoteke] " }}} BUFFERS / MEDPOMNILNIK " {{{ WINDOW / OKNO menutrans &Window &Okno menutrans &New^Wn &Novo^Wn menutrans S&plit^Ws Razdeli^Ws menutrans Split\ &Vertically^Wv Razdeli\ navpino^Ws menutrans Split\ File\ E&xplorer Razdeli:\ Vsebina\ mape menutrans Sp&lit\ To\ #^W^^ Razdeli\ v\ #^W^^ menutrans &Close^Wc &Zapri^Wc menutrans Close\ &Other(s)^Wo Zapri\ &ostala^Wo menutrans Move\ &To Premakni menutrans &Top^WK &Gor^WK menutrans &Bottom^WJ &Dol^WJ menutrans &Left\ side^WH &Levo^WH menutrans &Right\ side^WL &Desno^WL menutrans Rotate\ &Up^WR Zavrti\ navzgor^WR menutrans Rotate\ &Down^Wr Zavrti\ navzdol^Wr menutrans &Equal\ Size^W= &Enaka\ velikost^W= menutrans &Max\ Height^W_ Najvije^W_ menutrans M&in\ Height^W1_ Najnije^W1_ menutrans Max\ &Width^W\| Najire^W\| menutrans Min\ Widt&h^W1\| Najoje^W1\| " }}} WINDOW / OKNO " {{{ HELP / POMO menutrans &Help &Pomo menutrans &Overview Hitri\ pregled menutrans &User\ Manual P&rironik menutrans &How-to\ links &How-to\ kazalo menutrans &Find\.\.\. Po&ii\ \.\.\. " conflicts with Edit.Find menutrans &Credits &Avtorji menutrans Co&pying &Licenca menutrans &Sponsor/Register Registracija\ in\ &donacije menutrans O&rphans &Sirotam menutrans &Version &Verzija menutrans &About &O\ programu " }}} HELP / POMO " {{{ POPUP menutrans &Undo &Razveljavi menutrans Cu&t &Izrei menutrans &Copy &Kopieraj menutrans &Paste &Prilepi menutrans &Delete &Zbrii menutrans Select\ Blockwise Izbiraj\ po\ blokih menutrans Select\ &Word Izberi\ &besedo menutrans Select\ &Sentence Izberi\ &stavek menutrans Select\ Pa&ragraph Izberi\ &odstavek menutrans Select\ &Line Izberi\ vrs&tico menutrans Select\ &Block Izberi\ b&lok menutrans Select\ &All Izberi\ &vse " }}} POPUP " {{{ TOOLBAR if has("toolbar") if exists("*Do_toolbar_tmenu") delfun Do_toolbar_tmenu endif fun Do_toolbar_tmenu() tmenu ToolBar.Open Odpri datoteko tmenu ToolBar.Save Shrani datoteko tmenu ToolBar.SaveAll Shrani vse datoteke tmenu ToolBar.Print Natisni tmenu ToolBar.Undo Razveljavi tmenu ToolBar.Redo Obnovi tmenu ToolBar.Cut Izrei tmenu ToolBar.Copy Kopiraj tmenu ToolBar.Paste Prilepi tmenu ToolBar.Find Najdi ... tmenu ToolBar.FindNext Najdi naslednje tmenu ToolBar.FindPrev Najdi prejnje tmenu ToolBar.Replace Najdi in zamenjaj ... tmenu ToolBar.LoadSesn Naloi sejo tmenu ToolBar.SaveSesn Shrani trenutno sejo tmenu ToolBar.RunScript Izberi Vim skripto za izvajanje tmenu ToolBar.Make Napravi trenutni projekt (:make) tmenu ToolBar.RunCtags Napravi znake v trenutnem direktoriju (!ctags -R.) tmenu ToolBar.TagJump Skoi k znaki pod kurzorjem tmenu ToolBar.Help Pomo za Vim tmenu ToolBar.FindHelp Ii v pomoi za Vim endfun endif " }}} TOOLBAR " {{{ DIALOG TEXTS let g:menutrans_no_file = "[Brez datoteke]" let g:menutrans_help_dialog = "Vnesite ukaz ali besedo, za katero elite pomo:\n\nUporabite predpono i_ za ukaze v nainu za pisanje (npr.: i_CTRL-X)\nUporabite predpono c_ za ukaze v ukazni vrstici (command-line) (npr.: c_)\nUporabite predpono ' za imena opcij (npr.: 'shiftwidth')" let g:menutrans_path_dialog = "Vnesite poti za iskanje datotek.\nImena direktorijev loite z vejico." let g:menutrans_tags_dialog = "Vnesite imena datotek z znakami ('tag').\nImana loite z vejicami." let g:menutrans_textwidth_dialog = "Vnesite novo irino besedila (ali 0 za izklop formatiranja): " let g:menutrans_fileformat_dialog = "Izberite format datoteke" let g:menutrans_fileformat_choices = "&Unix\n&Dos\n&Mac\n&Preklii" " }}} let &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/lang/menu_sl_si.utf-8.vim000066400000000000000000000317521267703067000210250ustar00rootroot00000000000000" Menu Translations: Slovenian / Slovensko " Maintainer: Mojca Miklavec " Originally By: Mojca Miklavec " Last Change: Sat, 17 Jun 2006 " vim:set foldmethod=marker tabstop=8: " TODO: add/check all '&'s " Quit when menu translations have already been done. if exists("did_menu_trans") finish endif let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim scriptencoding utf-8 " {{{ FILE / DATOTEKA menutrans &File &Datoteka menutrans &Open\.\.\.:e &Odpri\ \.\.\.:e menutrans Sp&lit-Open\.\.\.:sp Odpri\ de&ljeno\ \.\.\.:sp menutrans Open\ Tab\.\.\.:tabnew Odpri\ v\ zavi&hku\ \.\.\.:tabnew menutrans &New:enew &Nova:enew menutrans &Close:close &Zapri:close menutrans &Save:w &Shrani:w menutrans Save\ &As\.\.\.:sav Shrani\ &kot\ \.\.\.:sav menutrans &Print Na&tisni menutrans Sa&ve-Exit:wqa Shrani\ in\ &končaj:wqa menutrans E&xit:qa &Izhod:qa if has("diff") menutrans Split\ &Diff\ with\.\.\. Primerjaj\ z\ (di&ff)\ \.\.\. menutrans Split\ Patched\ &By\.\.\. &Popravi\ z\ (patch)\ \.\.\. endif " }}} FILE / DATOTEKA " {{{ EDIT / UREDI menutrans &Edit &Uredi menutrans &Undou &Razveljaviu menutrans &Redo^R &Obnovi^R menutrans Rep&eat\. Po&novi\. menutrans Cu&t"+x &Izreži"+x menutrans &Copy"+y &Kopiraj"+y menutrans &Paste"+gP &Prilepi"+gP menutrans Put\ &Before[p Vrini\ pred[p menutrans Put\ &After]p Vrini\ za]p menutrans &Deletex Iz&brišix menutrans &Select\ allggVG Izberi\ vseggVG menutrans &Find\.\.\. Po&išči\ \.\.\. menutrans Find\ and\ Rep&lace\.\.\. Poišči\ in\ &zamenjaj\ \.\.\. " [-- SETTINGS --] menutrans Settings\ &Window Nastavitve\ \.\.\. menutrans Startup\ &Settings Začetne\ nastavitve menutrans &Global\ Settings &Globalne\ nastavitve menutrans Toggle\ Pattern\ &Highlight:set\ hls! Vključi/izključi\ poudarjanje\ iskanega\ niza:set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! Vključi/izključi\ ločevanje\ velikih\ in\ malih\ črk:set\ ic! menutrans Toggle\ &Showmatch:set\ sm! Vključi/izključi\ kratek\ skok\ na\ pripadajoči\ oklepaj:set\ sm! menutrans &Context\ lines Št\.\ vidnih\ vrstic\ pred/za\ kurzorjem menutrans &Virtual\ Edit Dovoli\ položaj\ kazalčka,\ kjer\ ni\ besedila menutrans Never Nikoli menutrans Block\ Selection Le\ med\ izbiranjem\ bloka menutrans Insert\ mode Le\ v\ načinu\ za\ pisanje menutrans Block\ and\ Insert Pri\ obojem menutrans Always Vedno menutrans Toggle\ Insert\ &Mode:set\ im! Vključi/izključi\ način\ za\ pisanje:set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! Vključi/izključi\ združljivost\ z\ Vi-jem:set\ cp! menutrans Search\ &Path\.\.\. Pot\ za\ iskanje\ \.\.\. menutrans Ta&g\ Files\.\.\. Ta&g-datoteke\.\.\. menutrans Toggle\ &Toolbar Pokaži/skrij\ Orodja menutrans Toggle\ &Bottom\ Scrollbar Pokaži/skrij\ spodnji\ drsnik menutrans Toggle\ &Left\ Scrollbar Pokaži/skrij\ levi\ drsnik menutrans Toggle\ &Right\ Scrollbar Pokaži/skrij\ desni\ drsnik " Edit/File Settings menutrans F&ile\ Settings &Nastavitve\ datoteke " Boolean options menutrans Toggle\ Line\ &Numbering:set\ nu! Pokaži/skrij\ številke\ vrstic:set\ nu! menutrans Toggle\ &List\ Mode:set\ list! Pokaži/skrij\ nevidne\ znake:set\ list! " space/tab menutrans Toggle\ Line\ &Wrap:set\ wrap! Vključi/izključi\ prelome\ vrstic:set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! Vključi/izključi\ prelome\ vrstic\ med\ besedami:set\ lbr! menutrans Toggle\ &expand-tab:set\ et! Vključi/izključi\ zamenjavo\ tabulatorjev\ s\ presledki:set\ et! menutrans Toggle\ &auto-indent:set\ ai! Vključi/izključi\ avtomatsko\ zamikanje\ vrstic:set\ ai! menutrans Toggle\ &C-indenting:set\ cin! Vključi/izključi\ C-jevski\ način\ zamikanja\ vrstic:set\ cin! " other options menutrans &Shiftwidth Širina\ zamika\ vrstic menutrans Soft\ &Tabstop Širina\ &tabulatorja menutrans Te&xt\ Width\.\.\. Širina\ besedila\ \.\.\. menutrans &File\ Format\.\.\. Format\ &datoteke\ \.\.\. menutrans C&olor\ Scheme &Barvna\ shema\ \.\.\. menutrans &Keymap &Keymap menutrans Select\ Fo&nt\.\.\. Pisava\ \.\.\. " }}} EDIT / UREDI " {{{ TOOLS / ORODJA menutrans &Tools &Orodja menutrans &Jump\ to\ this\ tagg^] &Skoči\ k\ tej\ značkig^] menutrans Jump\ &back^T Skoči\ Na&zaj^T menutrans Build\ &Tags\ File Napravi\ datoteke\ z\ značkami\ (tag) if has("spell") menutrans &Spelling Črkovalnik menutrans &Spell\ Check\ On &Vključi menutrans Spell\ Check\ &Off &Izključi menutrans To\ &Next\ error]s K\ &naslednji\ napaki]s menutrans To\ &Previous\ error[s K\ &prejšnji\ napaki[s menutrans Suggest\ &Correctionsz= Predlagaj\ popravekz= menutrans &Repeat\ correction:spellrepall Po&novi\ popravke\ na\ vseh\ besedah:spellrepall menutrans Set\ language\ to\ "en" Angleški\ "en" menutrans Set\ language\ to\ "en_au" Angleški\ "en_au" menutrans Set\ language\ to\ "en_ca" Angleški\ "en_ca" menutrans Set\ language\ to\ "en_gb" Angleški\ "en_gb" menutrans Set\ language\ to\ "en_nz" Angleški\ "en_nz" menutrans Set\ language\ to\ "en_us" Angleški\ "en_us" menutrans Set\ language\ to\ "sl" Slovenski\ "sl" menutrans Set\ language\ to\ "de" Nemški\ "de" menutrans Set\ language\ to\ Črkovalnik:\ menutrans &Find\ More\ Languages &Ostali\ jeziki endif if has("folding") menutrans &Folding Zvijanje\ kode " open close folds menutrans &Enable/Disable\ foldszi Omogoči/onemogoči\ zvijanjezi " Omogoči/onemogoči\ zavihke menutrans &View\ Cursor\ Linezv Pokaži\ vrstico\ s\ kazalčkomzv " kjer je kazalec menutrans Vie&w\ Cursor\ Line\ onlyzMzx Pokaži\ samo\ vrstico\ s\ kazalčkomzMzx menutrans C&lose\ more\ foldszm Zvij\ naslednji\ nivozm " Zapri\ več\ zavihkov menutrans &Close\ all\ foldszM Zvij\ vso\ kodozM " Zapri\ vse\ zavihke menutrans O&pen\ more\ foldszr Razvij\ en\ nivozr " Odpri\ več\ zavihkov menutrans &Open\ all\ foldszR Razvij\ vso\ kodozR " Odpri\ vse\ zavihke " fold method menutrans Fold\ Met&hod Kriterij\ za\ zvijanje " Ustvarjanje\ zavihkov menutrans M&anual &Ročno menutrans I&ndent Glede\ na\ &poravnavo menutrans E&xpression Z\ &izrazi\ (foldexpr) menutrans S&yntax Glede\ na\ &sintakso menutrans &Diff Razlike\ (&diff) menutrans Ma&rker Z\ &markerji/označbami " create and delete folds " TODO accelerators menutrans Create\ &Foldzf Ustvari\ zvitekzf menutrans &Delete\ Foldzd Izbriši\ zvitekzd menutrans Delete\ &All\ FoldszD Izbriši\ vse\ zvitkezD " moving around in folds menutrans Fold\ column\ &width Širina\ drevesa\ z\ zvitki endif " has folding if has("diff") menutrans &Diff Razlike\ (&Diff) menutrans &Update &Posodobi menutrans &Get\ Block &Sprejmi\ (spremeni\ to\ okno) " XXX: check if translation is OK menutrans &Put\ Block &Pošlji\ (spremeni\ drugo\ okno) endif menutrans &Make:make Napravi\ (&make):make menutrans &List\ Errors:cl Pokaži\ napake:cl menutrans L&ist\ Messages:cl! Pokaži\ sporočila:cl! menutrans &Next\ Error:cn K\ &naslednji\ napaki:cn menutrans &Previous\ Error:cp K\ &prejšnji\ napaki:cp menutrans &Older\ List:cold K\ &starejšemu\ seznamu\ napak:cold menutrans N&ewer\ List:cnew K\ &novejšemu\ seznamu\ napak:cnew menutrans Error\ &Window Okno\ z\ napakami menutrans &Update:cwin &Posodobi:cwin menutrans &Open:copen &Odpri:copen menutrans &Close:cclose &Zapri:cclose menutrans &Set\ Compiler Nastavi\ &prevajalnik menutrans Se&T\ Compiler Nastavi\ &prevajalnik " bug in original translation? menutrans &Convert\ to\ HEX:%!xxd Pretvori\ v\ HE&X:%!xxd menutrans Conve&rt\ back:%!xxd\ -r Pretvori\ nazaj:%!xxd\ -r " }}} TOOLS / ORODJA " {{{ SYNTAX / BARVANJE KODE menutrans &Syntax &Barvanje\ kode menutrans &Show\ filetypes\ in\ menu Podprte\ vrste\ datotek menutrans Set\ '&syntax'\ only Samo\ barvanje\ ('&syntax') menutrans Set\ '&filetype'\ too Tudi\ obnašanje\ ('&filetype') menutrans &Off &Izključeno menutrans &Manual &Ročno menutrans A&utomatic &Avtomatsko menutrans on/off\ for\ &This\ file Vključi/izključi\ za\ to\ datoteko menutrans Co&lor\ test Preizkus\ barv menutrans &Highlight\ test Preizkus\ barvanja\ kode menutrans &Convert\ to\ HTML Pretvori\ v\ &HTML " }}} SYNTAX / BARVANJE KODE " {{{ BUFFERS / MEDPOMNILNIK menutrans &Buffers &Medpomnilnik " XXX: ni najbolje: okno bi bolj pristajalo, ampak okno je že menutrans &Refresh\ menu &Osveži menutrans Delete &Briši menutrans &Alternate &Menjaj menutrans &Next &Naslednji menutrans &Previous &Prejšnji menutrans [No\ File] [Brez\ datoteke] " }}} BUFFERS / MEDPOMNILNIK " {{{ WINDOW / OKNO menutrans &Window &Okno menutrans &New^Wn &Novo^Wn menutrans S&plit^Ws Razdeli^Ws menutrans Split\ &Vertically^Wv Razdeli\ navpično^Ws menutrans Split\ File\ E&xplorer Razdeli:\ Vsebina\ mape menutrans Sp&lit\ To\ #^W^^ Razdeli\ v\ #^W^^ menutrans &Close^Wc &Zapri^Wc menutrans Close\ &Other(s)^Wo Zapri\ &ostala^Wo menutrans Move\ &To Premakni menutrans &Top^WK &Gor^WK menutrans &Bottom^WJ &Dol^WJ menutrans &Left\ side^WH &Levo^WH menutrans &Right\ side^WL &Desno^WL menutrans Rotate\ &Up^WR Zavrti\ navzgor^WR menutrans Rotate\ &Down^Wr Zavrti\ navzdol^Wr menutrans &Equal\ Size^W= &Enaka\ velikost^W= menutrans &Max\ Height^W_ Najvišje^W_ menutrans M&in\ Height^W1_ Najnižje^W1_ menutrans Max\ &Width^W\| Najširše^W\| menutrans Min\ Widt&h^W1\| Najožje^W1\| " }}} WINDOW / OKNO " {{{ HELP / POMOČ menutrans &Help &Pomoč menutrans &Overview Hitri\ pregled menutrans &User\ Manual P&riročnik menutrans &How-to\ links &How-to\ kazalo menutrans &Find\.\.\. Po&išči\ \.\.\. " conflicts with Edit.Find menutrans &Credits &Avtorji menutrans Co&pying &Licenca menutrans &Sponsor/Register Registracija\ in\ &donacije menutrans O&rphans &Sirotam menutrans &Version &Verzija menutrans &About &O\ programu " }}} HELP / POMOČ " {{{ POPUP menutrans &Undo &Razveljavi menutrans Cu&t &Izreži menutrans &Copy &Kopieraj menutrans &Paste &Prilepi menutrans &Delete &Zbriši menutrans Select\ Blockwise Izbiraj\ po\ blokih menutrans Select\ &Word Izberi\ &besedo menutrans Select\ &Sentence Izberi\ &stavek menutrans Select\ Pa&ragraph Izberi\ &odstavek menutrans Select\ &Line Izberi\ vrs&tico menutrans Select\ &Block Izberi\ b&lok menutrans &Select\ AllggVG Izberi\ &vseggVG " }}} POPUP " {{{ TOOLBAR if has("toolbar") if exists("*Do_toolbar_tmenu") delfun Do_toolbar_tmenu endif fun Do_toolbar_tmenu() tmenu ToolBar.Open Odpri datoteko tmenu ToolBar.Save Shrani datoteko tmenu ToolBar.SaveAll Shrani vse datoteke tmenu ToolBar.Print Natisni tmenu ToolBar.Undo Razveljavi tmenu ToolBar.Redo Obnovi tmenu ToolBar.Cut Izreži tmenu ToolBar.Copy Kopiraj tmenu ToolBar.Paste Prilepi tmenu ToolBar.Find Najdi ... tmenu ToolBar.FindNext Najdi naslednje tmenu ToolBar.FindPrev Najdi prejšnje tmenu ToolBar.Replace Najdi in zamenjaj ... tmenu ToolBar.LoadSesn Naloži sejo tmenu ToolBar.SaveSesn Shrani trenutno sejo tmenu ToolBar.RunScript Izberi Vim skripto za izvajanje tmenu ToolBar.Make Napravi trenutni projekt (:make) tmenu ToolBar.RunCtags Napravi značke v trenutnem direktoriju (!ctags -R.) tmenu ToolBar.TagJump Skoči k znački pod kurzorjem tmenu ToolBar.Help Pomoč za Vim tmenu ToolBar.FindHelp Išči v pomoči za Vim endfun endif " }}} TOOLBAR " {{{ DIALOG TEXTS let g:menutrans_no_file = "[Brez datoteke]" let g:menutrans_help_dialog = "Vnesite ukaz ali besedo, za katero želite pomoč:\n\nUporabite predpono i_ za ukaze v načinu za pisanje (npr.: i_CTRL-X)\nUporabite predpono c_ za ukaze v ukazni vrstici (command-line) (npr.: c_)\nUporabite predpono ' za imena opcij (npr.: 'shiftwidth')" let g:menutrans_path_dialog = "Vnesite poti za iskanje datotek.\nImena direktorijev ločite z vejico." let g:menutrans_tags_dialog = "Vnesite imena datotek z značkami ('tag').\nImana ločite z vejicami." let g:menutrans_textwidth_dialog = "Vnesite novo širino besedila (ali 0 za izklop formatiranja): " let g:menutrans_fileformat_dialog = "Izberite format datoteke" let g:menutrans_fileformat_choices = "&Unix\n&Dos\n&Mac\n&Prekliči" " }}} let &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/lang/menu_slovak_slovak_republic.1250.vim000066400000000000000000000235511267703067000241010ustar00rootroot00000000000000" Menu Translations: Slovak " Translated By: Martin Lacko " Last Change: 2012 May 01 " Quit when menu translations have already been done. if exists("did_menu_trans") finish endif let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim scriptencoding cp1250 " Help menu menutrans &Help &Pomocnk menutrans &Overview &Prehad menutrans &User\ Manual Po&uvatesk\ manul menutrans &How-to\ links &Tipy menutrans &Find\.\.\. &Njs\.\.\. menutrans &Credits Po&akovanie menutrans O&rphans Si&roty menutrans Co&pying &Licencia menutrans &Version &Verzia menutrans &About &O\ programe " File menu menutrans &File &Sbor menutrans &Open\.\.\.:e &Otvori\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp Ot&vori\ v\ novom\ okne\.\.\.:sp menutrans &New:enew &Nov:enew menutrans &Close:close &Zatvori:close menutrans &Save:w &Uloi:w menutrans Save\ &As\.\.\.:sav Uloi\ &ako\.\.\.: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:wqa U&loi-Koniec:wqa menutrans E&xit:qa &Koniec:qa " Edit menu menutrans &Edit &pravy menutrans &Undou &Spu menutrans &Redo^R Z&rui\ sp^R menutrans Rep&eat\. &Opakova\. menutrans Cu&t"+x &Vystrihn"+x menutrans &Copy"+y &Koprova"+y menutrans &Paste"+gP V&loi"+gP menutrans Put\ &Before[p Vloi\ &pred[p menutrans Put\ &After]p Vloi\ za]p menutrans &Select\ allggVG Vy&bra\ vetkoggVG menutrans &Deletex Vy&mazax menutrans &Find\.\.\. &Njs\.\.\. menutrans Find\ and\ Rep&lace\.\.\. N&ahradi\.\.\. menutrans Settings\ &Window Mo&nosti menutrans &Global\ Settings &Globlne monosti menutrans Toggle\ Pattern\ &Highlight:set\ hls! Prepn\ paletu\ zvrazovania:set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! Prepn\ &ignorovanie vekosti:set\ ic! menutrans Toggle\ &Showmatch:set\ sm! Prepn\ &ukza\ zhodu:set\ sm! menutrans &Context\ lines &Kontextov\ riadky menutrans &Virtual\ Edit &Virtulne pravy menutrans Never Nikdy menutrans Block\ Selection Blokov\ vber menutrans Insert\ mode Reim\ vkladania menutrans Block\ and\ Insert Blok\ a\ vkladanie menutrans Always Vdy menutrans Toggle\ Insert\ &Mode:set\ im! Prepn\ rei&m\ vkladania:set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! Prepn\ vi\ kompatibilitu:set\ cp! menutrans Search\ &Path\.\.\. Cesta\ &hadania\.\.\. menutrans Ta&g\ Files\.\.\. Ta&gov sbory\.\.\. menutrans Toggle\ &Toolbar Prepn\ &panel menutrans Toggle\ &Bottom\ Scrollbar Prepn\ spodn\ posuvnk menutrans Toggle\ &Left\ Scrollbar Prepn\ av\ posuvnk menutrans Toggle\ &Right\ Scrollbar Prepn\ prav\ posuvnk menutrans F&ile\ Settings Nastavenia\ sboru menutrans Toggle\ Line\ &Numbering:set\ nu! Prepn\ slova&nie\ riadkov:set\ nu! menutrans Toggle\ &List\ Mode:set\ list! Prepn\ reim\ &zoznamu:set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! Prepn\ z&alamovanie\ riadkov:set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! Prepn\ za&lamovanie\ slov:set\ lbr! menutrans Toggle\ &expand-tab:set\ et! Prepn\ rozr&en\ tabultory:set\ et! menutrans Toggle\ &auto-indent:set\ ai! Prepn\ automatick\ &odsadzovanie:set\ ai! menutrans Toggle\ &C-indenting:set\ cin! Prepn\ &C-odsadzovanie:set\ cin! menutrans &Shiftwidth &rka\ iftu menutrans Soft\ &Tabstop &Softvrov\ tabultor menutrans Te&xt\ Width\.\.\. rka\ te&xtu\.\.\. menutrans &File\ Format\.\.\. &Formt\ sboru\.\.\. menutrans C&olor\ Scheme Far&ebn\ schma " Programming menu menutrans &Tools &Nstroje menutrans &Jump\ to\ this\ tagg^] &Skoi\ na\ znakug^] menutrans Jump\ &back^T Sk&oi\ sp^T menutrans Build\ &Tags\ File &Vytvori\ sbor\ znaiek menutrans &Folding &Vnranie menutrans &Enable/Disable\ foldszi Zapn/Vypn\ vnrani&ezi menutrans &View\ Cursor\ Linezv Zobrazi\ kurzoro&v\ riadokzv menutrans Vie&w\ Cursor\ Line\ onlyzMzx Zobrazi\ iba\ kurzorov\ riadokzMzx menutrans C&lose\ more\ foldszm Zatvori\ viac \vnorenzm menutrans &Close\ all\ foldszM Zatvor&i\ vetky\ vnoreniazM menutrans O&pen\ more\ foldszr O&tvori\ viac\ vnorenzr menutrans &Open\ all\ foldszR &Otvori\ vetky\ vnoreniazR menutrans Fold\ Met&hod Met&da\ vnrania menutrans M&anual M&anulne menutrans I&ndent Odsade&nie menutrans E&xpression &Vraz menutrans S&yntax S&yntax menutrans &Diff Roz&diel menutrans Ma&rker Zna&kova menutrans Create\ &Foldzf Vyt&vori\ vnoreniezf menutrans &Delete\ Foldzd V&ymaza\ vnoreniezd menutrans Delete\ &All\ FoldszD Vymaza\ vetky\ vnoreniazD menutrans Fold\ column\ &width rka\ &vkladanho\ stpca menutrans &Diff &Rozdiely menutrans &Update Akt&ualizova menutrans &Get\ Block Zob&ra\ blok menutrans &Put\ Block &Vloi\ blok menutrans Error\ &Window Chybov\ &okno menutrans &Update:cwin Akt&ualizova:cwin menutrans &Open:copen &Otvori:copen menutrans &Close:cclose &Zatvori:cclose menutrans &Convert\ to\ HEX:%!xxd &Konvertova\ do\ HEX:%!xxd menutrans Conve&rt\ back:%!xxd\ -r Konve&rtova\ sp:%!xxd\ -r menutrans &Make:make &Make:make menutrans &List\ Errors:cl Vpis\ &chb:cl menutrans L&ist\ Messages:cl! Vp&is\ sprv:cl! menutrans &Next\ Error:cn a&lia\ chyba:cn menutrans &Previous\ Error:cp &Predchdzajca\ chyba:cp menutrans &Older\ List:cold Sta&r\ zoznam:cold menutrans N&ewer\ List:cnew Nov\ &zoznam:cnew menutrans Error\ &Window:cwin Chybov\ o&kno:cwin menutrans &Set\ Compiler Vyberte\ k&ompiltor menutrans Convert\ to\ HEX:%!xxd Prvies\ do\ es&tnstkovho\ formtu:%!xxd menutrans Convert\ back:%!xxd\ -r Pr&evies\ sp:%!xxd\ -r " Names for buffer menu. menutrans &Buffers &Vyrovnvacia\ pam menutrans &Refresh\ menu Obnovi menutrans &Delete Vymaza menutrans &Alternate Zmeni menutrans &Next &alia menutrans &Previous &Predchdzajca menutrans [No File] [iadny\ sbor] " Window menu menutrans &Window &Okn menutrans &New^Wn &Nov^Wn menutrans S&plit^Ws &Rozdeli^Ws menutrans Sp&lit\ To\ #^W^^ Ro&zdeli\ na\ #^W^^ menutrans Split\ &Vertically^Wv Rozdeli\ &vertiklne^Wv menutrans Split\ File\ E&xplorer Otvori\ pri&eskumnka menutrans &Close^Wc Zatvor&i^Wc menutrans Close\ &Other(s)^Wo Zatvori\ i&n^Wo menutrans Move\ &To Presun& menutrans &Top^WK Na&hor^WK menutrans &Bottom^WJ Nado&l^WJ menutrans &Left\ side^WH V&avo^WJ menutrans &Right\ side^WL Vprav&o^WL menutrans Ne&xt^Ww &alie^Ww menutrans P&revious^WW &Predchdzajce^WW menutrans &Equal\ Size^W= Rovnak\ v&ka^W= menutrans &Max\ Height^W_ &Maximlna\ vka^W_ menutrans M&in\ Height^W1_ Minimlna\ v&ka^W1_ menutrans Max\ &Width^W\| Maximlna\ rka^W\| menutrans Min\ Widt&h^W1\| Minimlna irka^W1\| menutrans Rotate\ &Up^WR Rotova&\ nahor^WR menutrans Rotate\ &Down^Wr Rotova\ na&dol^Wr menutrans Select\ Fo&nt\.\.\. Vy&bra\ psmo\.\.\. " The popup menu menutrans &Undo &Sp menutrans Cu&t &Vystrihn menutrans &Copy &Koprova menutrans &Paste V&loi 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 sbor tmenu ToolBar.Save Uloi sbor tmenu ToolBar.SaveAll Uloi vetky tmenu ToolBar.Print Tla tmenu ToolBar.Undo Sp tmenu ToolBar.Redo Opakova tmenu ToolBar.Cut Vystrihn tmenu ToolBar.Copy Koprova tmenu ToolBar.Paste Vloi tmenu ToolBar.Find Njs... tmenu ToolBar.FindNext Njs alie tmenu ToolBar.FindPrev Njs predchdzajce 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 vertiklne tmenu ToolBar.WinMaxWidth Maximalizova rku okna tmenu ToolBar.WinMinWidth Minimalizova rku okna tmenu ToolBar.WinClose Zatvori okno endif tmenu ToolBar.LoadSesn Nata sedenie tmenu ToolBar.SaveSesn Uloi sedenie tmenu ToolBar.RunScript Spusti skript tmenu ToolBar.Make Spusti make tmenu ToolBar.Shell Spusti el tmenu ToolBar.RunCtags Spusti ctags tmenu ToolBar.TagJump Skoi na tag pod kurzorom tmenu ToolBar.Help Pomocnk tmenu ToolBar.FindHelp Njs pomocnka 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 &Rune menutrans A&utomatic A&utomaticky " menutrans o&n\ (this\ file) &Zapn\ (pre\ tento\ sbor) " menutrans o&ff\ (this\ file) Vyp&n\ (pre\ tento\ sbor ) menutrans on/off\ for\ &This\ file Zapn/vypn\ pre\ &tento\ sbor menutrans Co&lor\ test Test\ &farieb menutrans &Highlight\ test &Test\ zvrazovania menutrans &Convert\ to\ HTML &Previes\ do\ HTML let &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/lang/menu_spanish_spain.850.vim000066400000000000000000000000511267703067000221100ustar00rootroot00000000000000source :p:h/menu_es_es.latin1.vim vim-7.4.1689/runtime/lang/menu_sr.utf-8.vim000066400000000000000000000001061267703067000203250ustar00rootroot00000000000000" Menu Translations: Serbian source :p:h/menu_sr_rs.utf-8.vim vim-7.4.1689/runtime/lang/menu_sr_rs.ascii.vim000066400000000000000000000254161267703067000211710ustar00rootroot00000000000000" Menu Translations: Serbian " Maintainer: Aleksandar Jelenak " 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 let s:keepcpo= &cpo set cpo&vim " Help menu menutrans &Help Pomo&c menutrans &Overview &Pregled 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\.\.\.:e &Otvori\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp &Podeli-otvori\.\.\.:sp menutrans &New:enew &Nova:enew menutrans &Close:close &Zatvori:close menutrans &Save:w &Sacuvaj:w menutrans Save\ &As\.\.\.:sav Sacuvaj\ &kao\.\.\.: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:wqa Sacuvaj\ i\ za&vrsi:wqa menutrans E&xit:qa K&raj:qa " Edit menu menutrans &Edit &Uredjivanje menutrans &Undou &Vratiu menutrans &Redo^R &Povrati^R menutrans Rep&eat\. P&onovi\. menutrans Cu&t"+x Ise&ci"+x menutrans &Copy"+y &Kopiraj"+y menutrans &Paste"+gP &Ubaci"+gP menutrans &Paste"+P &Ubaci"+gP menutrans Put\ &Before[p Stavi\ pre&d[p menutrans Put\ &After]p Stavi\ &iza]p menutrans &Deletex Iz&brisix menutrans &Select\ allggVG Izaberi\ sv&eggVG 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:set\ hls! Naglasi\ &obrazce\ (da/ne):set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! Zanemari\ \velicinu\ &slova\ (da/ne):set\ ic! menutrans Toggle\ &Showmatch:set\ sm! Proveri\ pratecu\ &zagradu\ (da/ne):set\ sm! menutrans &Context\ lines Vidljivi\ &redovi menutrans &Virtual\ Edit Virtuelno\ &uredjivanje menutrans Toggle\ Insert\ &Mode:set\ im! Rezim\ u&nosa\ (da/ne):set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! '&Vi'\ saglasno\ (da/ne):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:set\ nu! Redni\ &brojevi\ (da/ne):set\ nu! menutrans Toggle\ &List\ Mode:set\ list! Rezim\ &liste\ (da/ne):set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! Obavijanje\ &redova\ (da/ne):set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! Prelomi\ &na\ rec\ (da/ne):set\ lbr! menutrans Toggle\ &expand-tab:set\ et! Razmaci\ umesto\ &tabulacije\ (da/ne):set\ et! menutrans Toggle\ &auto-indent:set\ ai! Auto-&uvlacenje\ (da/ne):set\ ai! menutrans Toggle\ &C-indenting:set\ cin! &Ce-uvlacenje\ (da/ne):set\ cin! " Edit/Keymap menutrans None Nijedan " Tools menu menutrans &Tools &Alatke menutrans &Jump\ to\ this\ tagg^] Skoci\ na\ &ovu\ oznakug^] menutrans Jump\ &back^T Skoci\ &natrag^T menutrans Build\ &Tags\ File Izgradi\ &datoteku\ oznaka menutrans &Folding &Podvijanje menutrans Create\ &Foldzf S&tvori\ podvijutakzf menutrans &Delete\ Foldzd O&brisi\ podvijutakzd menutrans Delete\ &All\ FoldszD Obrisi\ sve\ po&dvijutkezD menutrans Fold\ column\ &width Sirina\ &reda\ podvijutka menutrans &Diff &Uporedjivanje menutrans &Make:make 'mak&e':make menutrans &List\ Errors:cl Spisak\ &gresaka:cl menutrans L&ist\ Messages:cl! Sp&isak\ poruka:cl! menutrans &Next\ Error:cn S&ledeca\ greska:cn menutrans &Previous\ Error:cp Pre&thodna\ greska:cp menutrans &Older\ List:cold Stari\ spisa&k:cold menutrans N&ewer\ List:cnew No&vi\ spisak:cnew menutrans Error\ &Window Prozor\ sa\ g&reskama menutrans &Set\ Compiler I&zaberi\ prevodioca menutrans &Convert\ to\ HEX:%!xxd Pretvori\ u\ &HEKS:%!xxd menutrans Conve&rt\ back:%!xxd\ -r Vr&ati\ u\ prvobitan\ oblik:%!xxd\ -r " Tools/Folding menutrans &Enable/Disable\ foldszi &Omoguci/prekini\ podvijanjezi menutrans &View\ Cursor\ Linezv &Pokazi\ red\ sa\ kursoromzv menutrans Vie&w\ Cursor\ Line\ onlyzMzx Pokazi\ &samo\ red\ sa\ kursoromzMzx menutrans C&lose\ more\ foldszm &Zatvori\ vise\ podvijutakazm menutrans &Close\ all\ foldszM Zatvori\ s&ve\ podvijutkezM menutrans O&pen\ more\ foldszr Otvori\ vis&e\ podvijutakazr menutrans &Open\ all\ foldszR O&tvori\ sve\ podvijutkezR 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:cwin &Azuriraj:cwin menutrans &Open:copen &Otvori:copen menutrans &Close:cclose &Zatvori:cclose " Bufers menu menutrans &Buffers &Baferi menutrans &Refresh\ menu &Azuriraj menutrans Delete &Obrisi menutrans &Alternate A<ernativni menutrans &Next &Sledeci menutrans &Previous &Prethodni menutrans [No\ File] [Nema\ datoteke] " Window menu menutrans &Window &Prozor menutrans &New^Wn &Novi^Wn menutrans S&plit^Ws &Podeli^Ws menutrans Sp&lit\ To\ #^W^^ Podeli\ sa\ &alternativnim^W^^ menutrans Split\ &Vertically^Wv Podeli\ &uspravno^Wv menutrans Split\ File\ E&xplorer Podeli\ za\ pregled\ &datoteka menutrans &Close^Wc &Zatvori^Wc menutrans Close\ &Other(s)^Wo Zatvori\ &ostale^Wo "menutrans Ne&xt^Ww &Sledeci^Ww "menutrans P&revious^WW P&rethodni^WW menutrans Move\ &To Pre&mesti menutrans Rotate\ &Up^WR &Kruzno\ nagore^WR menutrans Rotate\ &Down^Wr Kruzno\ nadol&e^Wr menutrans &Equal\ Size^W= &Iste\ velicine^W= menutrans &Max\ Height^W_ Maksimalna\ &visina^W_ menutrans M&in\ Height^W1_ Minima&lna\ visina^W1_ menutrans Max\ &Width^W\| Maksimalna\ &sirina^W\| menutrans Min\ Widt&h^W1\| Minimalna\ si&rina^W1\| " Window/Move To menutrans &Top^WK &Vrh^WK menutrans &Bottom^WJ &Podnozje^WJ menutrans &Left\ side^WH U&levo^WH menutrans &Right\ side^WL U&desno^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_)\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]" let &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/lang/menu_sr_rs.iso_8859-2.vim000066400000000000000000000253311267703067000215230ustar00rootroot00000000000000" Menu Translations: Serbian " Maintainer: Aleksandar Jelenak " 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 let s:keepcpo= &cpo set cpo&vim scriptencoding iso8859-2 " Help menu menutrans &Help Pomo& menutrans &Overview &Pregled menutrans &User\ Manual &Uputstvo\ za\ korisnike menutrans &How-to\ links &Kako\ da\.\.\. menutrans &Find &Nai menutrans &Credits &Zasluge menutrans Co&pying P&reuzimanje menutrans O&rphans &Siroii menutrans &Version &Verzija menutrans &About &O\ programu " File menu menutrans &File &Datoteka menutrans &Open\.\.\.:e &Otvori\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp &Podeli-otvori\.\.\.:sp menutrans &New:enew &Nova:enew menutrans &Close:close &Zatvori:close menutrans &Save:w &Sauvaj:w menutrans Save\ &As\.\.\.:sav Sauvaj\ &kao\.\.\.: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:wqa Sauvaj\ i\ za&vri:wqa menutrans E&xit:qa K&raj:qa " Edit menu menutrans &Edit &Ureivanje menutrans &Undou &Vratiu menutrans &Redo^R &Povrati^R menutrans Rep&eat\. P&onovi\. menutrans Cu&t"+x Ise&ci"+x menutrans &Copy"+y &Kopiraj"+y menutrans &Paste"+gP &Ubaci"+gP menutrans &Paste"+P &Ubaci"+gP menutrans Put\ &Before[p Stavi\ pre&d[p menutrans Put\ &After]p Stavi\ &iza]p menutrans &Deletex Iz&briix menutrans &Select\ allggVG Izaberi\ sv&eggVG menutrans &Find\.\.\. &Nai\.\.\. menutrans Find\ and\ Rep&lace\.\.\. Nai\ i\ &zameni\.\.\. menutrans Settings\ &Window P&rozor\ podeavanja menutrans &Global\ Settings Op&ta\ podeavanja menutrans F&ile\ Settings Podeavanja\ 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:set\ hls! Naglasi\ &obrazce\ (da/ne):set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! Zanemari\ \veliinu\ &slova\ (da/ne):set\ ic! menutrans Toggle\ &Showmatch:set\ sm! Proveri\ prateu\ &zagradu\ (da/ne):set\ sm! menutrans &Context\ lines Vidljivi\ &redovi menutrans &Virtual\ Edit Virtuelno\ &ureivanje menutrans Toggle\ Insert\ &Mode:set\ im! Reim\ u&nosa\ (da/ne):set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! '&Vi'\ saglasno\ (da/ne):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 Reim\ unosa menutrans Block\ and\ Insert Blok\ i\ unos menutrans Always Uvek " Edit/File Settings menutrans Toggle\ Line\ &Numbering:set\ nu! Redni\ &brojevi\ (da/ne):set\ nu! menutrans Toggle\ &List\ Mode:set\ list! Reim\ &liste\ (da/ne):set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! Obavijanje\ &redova\ (da/ne):set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! Prelomi\ &na\ re\ (da/ne):set\ lbr! menutrans Toggle\ &expand-tab:set\ et! Razmaci\ umesto\ &tabulacije\ (da/ne):set\ et! menutrans Toggle\ &auto-indent:set\ ai! Auto-&uvlaenje\ (da/ne):set\ ai! menutrans Toggle\ &C-indenting:set\ cin! &Ce-uvlaenje\ (da/ne):set\ cin! " Edit/Keymap menutrans None Nijedan " Tools menu menutrans &Tools &Alatke menutrans &Jump\ to\ this\ tagg^] Skoi\ na\ &ovu\ oznakug^] menutrans Jump\ &back^T Skoi\ &natrag^T menutrans Build\ &Tags\ File Izgradi\ &datoteku\ oznaka menutrans &Folding &Podvijanje menutrans Create\ &Foldzf S&tvori\ podvijutakzf menutrans &Delete\ Foldzd O&brii\ podvijutakzd menutrans Delete\ &All\ FoldszD Obrii\ sve\ po&dvijutkezD menutrans Fold\ column\ &width irina\ &reda\ podvijutka menutrans &Diff &Uporeivanje menutrans &Make:make 'mak&e':make menutrans &List\ Errors:cl Spisak\ &greaka:cl menutrans L&ist\ Messages:cl! Sp&isak\ poruka:cl! menutrans &Next\ Error:cn S&ledea\ greka:cn menutrans &Previous\ Error:cp Pre&thodna\ greka:cp menutrans &Older\ List:cold Stari\ spisa&k:cold menutrans N&ewer\ List:cnew No&vi\ spisak:cnew menutrans Error\ &Window Prozor\ sa\ g&rekama menutrans &Set\ Compiler I&zaberi\ prevodioca menutrans &Convert\ to\ HEX:%!xxd Pretvori\ u\ &HEKS:%!xxd menutrans Conve&rt\ back:%!xxd\ -r Vr&ati\ u\ prvobitan\ oblik:%!xxd\ -r " Tools/Folding menutrans &Enable/Disable\ foldszi &Omogui/prekini\ podvijanjezi menutrans &View\ Cursor\ Linezv &Pokai\ red\ sa\ kursoromzv menutrans Vie&w\ Cursor\ Line\ onlyzMzx Pokai\ &samo\ red\ sa\ kursoromzMzx menutrans C&lose\ more\ foldszm &Zatvori\ vie\ podvijutakazm menutrans &Close\ all\ foldszM Zatvori\ s&ve\ podvijutkezM menutrans O&pen\ more\ foldszr Otvori\ vi&e\ podvijutakazr menutrans &Open\ all\ foldszR O&tvori\ sve\ podvijutkezR menutrans Fold\ Met&hod &Nain\ podvijanja " Tools/Folding/Fold Method menutrans M&anual &Runo menutrans I&ndent &Uvuenost menutrans E&xpression &Izraz menutrans S&yntax &Sintaksa "menutrans &Diff menutrans Ma&rker &Oznaka " Tools/Diff menutrans &Update &Auriraj menutrans &Get\ Block &Prihvati\ izmenu menutrans &Put\ Block Pre&baci\ izmenu " Tools/Error Window menutrans &Update:cwin &Auriraj:cwin menutrans &Open:copen &Otvori:copen menutrans &Close:cclose &Zatvori:cclose " Bufers menu menutrans &Buffers &Baferi menutrans &Refresh\ menu &Auriraj menutrans Delete &Obrii menutrans &Alternate A<ernativni menutrans &Next &Sledei menutrans &Previous &Prethodni menutrans [No\ File] [Nema\ datoteke] " Window menu menutrans &Window &Prozor menutrans &New^Wn &Novi^Wn menutrans S&plit^Ws &Podeli^Ws menutrans Sp&lit\ To\ #^W^^ Podeli\ sa\ &alternativnim^W^^ menutrans Split\ &Vertically^Wv Podeli\ &uspravno^Wv menutrans Split\ File\ E&xplorer Podeli\ za\ pregled\ &datoteka menutrans &Close^Wc &Zatvori^Wc menutrans Close\ &Other(s)^Wo Zatvori\ &ostale^Wo "menutrans Ne&xt^Ww &Sledei^Ww "menutrans P&revious^WW P&rethodni^WW menutrans Move\ &To Pre&mesti menutrans Rotate\ &Up^WR &Kruno\ nagore^WR menutrans Rotate\ &Down^Wr Kruno\ nadol&e^Wr menutrans &Equal\ Size^W= &Iste\ veliine^W= menutrans &Max\ Height^W_ Maksimalna\ &visina^W_ menutrans M&in\ Height^W1_ Minima&lna\ visina^W1_ menutrans Max\ &Width^W\| Maksimalna\ &irina^W\| menutrans Min\ Widt&h^W1\| Minimalna\ i&rina^W1\| " Window/Move To menutrans &Top^WK &Vrh^WK menutrans &Bottom^WJ &Podnoje^WJ menutrans &Left\ side^WH U&levo^WH menutrans &Right\ side^WL U&desno^WL " The popup menu menutrans &Undo &Vrati menutrans Cu&t &Iseci menutrans &Copy &Kopiraj menutrans &Paste &Ubaci menutrans &Delete I&zbrii 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 Uitaj tmenu ToolBar.Save Sauvaj tmenu ToolBar.SaveAll Sauvaj 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 Nai tmenu ToolBar.FindNext Nai sledei tmenu ToolBar.FindPrev Nai 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 Uitaj seansu tmenu ToolBar.SaveSesn Sauvaj seansu tmenu ToolBar.RunScript Izvri spis tmenu ToolBar.Make 'make' tmenu ToolBar.Shell Operativno okruenje tmenu ToolBar.RunCtags Napravi oznake tmenu ToolBar.TagJump Idi na oznaku tmenu ToolBar.Help Pomo tmenu ToolBar.FindHelp Nai objanjenje 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'\ &takoe menutrans &Off &Iskljueno menutrans &Manual &Runo 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 pojanjenje traite:\n\nDodajte i_ za naredbe unosa (npr. i_CTRL-X)\nDodajte c_ za naredbe komandnog reima (npr. s_)\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 spreava prelom)" let g:menutrans_fileformat_dialog = "Izaberite vrstu datoteke" let menutrans_no_file = "[Nema datoteke]" let &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/lang/menu_sr_rs.iso_8859-5.vim000066400000000000000000000252761267703067000215360ustar00rootroot00000000000000" Menu Translations: Serbian " Maintainer: Aleksandar Jelenak " 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 let s:keepcpo= &cpo set cpo&vim scriptencoding iso8859-5 " Help menu menutrans &Help & menutrans &Overview & 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\.\.\.:e &\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp &-\.\.\.:sp menutrans &New:enew &:enew menutrans &Close:close &:close menutrans &Save:w &:w menutrans Save\ &As\.\.\.:sav \ &\.\.\.:sav menutrans Split\ &Diff\ with\.\.\. \ \ &\ \.\.\. menutrans Split\ Patched\ &By\.\.\. &\ \ \ \.\.\. menutrans &Print & menutrans Sa&ve-Exit:wqa \ \ &:wqa menutrans E&xit:qa &:qa " Edit menu menutrans &Edit & menutrans &Undou &u menutrans &Redo^R &^R menutrans Rep&eat\. &\. menutrans Cu&t"+x &"+x menutrans &Copy"+y &"+y menutrans &Paste"+gP &"+gP menutrans &Paste"+P &"+gP menutrans Put\ &Before[p \ &[p menutrans Put\ &After]p \ &]p menutrans &Deletex &x menutrans &Select\ allggVG \ &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:set\ hls! \ &\ (/):set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! \ \\ &\ (/):set\ ic! menutrans Toggle\ &Showmatch:set\ sm! \ \ &\ (/):set\ sm! menutrans &Context\ lines \ & menutrans &Virtual\ Edit \ & menutrans Toggle\ Insert\ &Mode:set\ im! \ &\ (/):set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! '&Vi'\ \ (/):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:set\ nu! \ &\ (/):set\ nu! menutrans Toggle\ &List\ Mode:set\ list! \ &\ (/):set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! \ &\ (/):set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! \ &\ \ (/):set\ lbr! menutrans Toggle\ &expand-tab:set\ et! \ \ &\ (/):set\ et! menutrans Toggle\ &auto-indent:set\ ai! -&\ (/):set\ ai! menutrans Toggle\ &C-indenting:set\ cin! &-\ (/):set\ cin! " Edit/Keymap menutrans None " Tools menu menutrans &Tools & menutrans &Jump\ to\ this\ tagg^] \ \ &\ g^] menutrans Jump\ &back^T \ &^T menutrans Build\ &Tags\ File \ &\ menutrans &Folding & menutrans Create\ &Foldzf &\ zf menutrans &Delete\ Foldzd &\ zd menutrans Delete\ &All\ FoldszD \ \ &zD menutrans Fold\ column\ &width \ &\ menutrans &Diff & menutrans &Make:make 'mak&':make menutrans &List\ Errors:cl \ &:cl menutrans L&ist\ Messages:cl! &\ :cl! menutrans &Next\ Error:cn &\ :cn menutrans &Previous\ Error:cp &\ :cp menutrans &Older\ List:cold \ &:cold menutrans N&ewer\ List:cnew &\ :cnew menutrans Error\ &Window \ \ & menutrans &Set\ Compiler &\ menutrans &Convert\ to\ HEX:%!xxd \ \ &ŵ:%!xxd menutrans Conve&rt\ back:%!xxd\ -r &\ \ \ :%!xxd\ -r " Tools/Folding menutrans &Enable/Disable\ foldszi &/\ zi menutrans &View\ Cursor\ Linezv &\ \ \ zv menutrans Vie&w\ Cursor\ Line\ onlyzMzx \ &\ \ \ zMzx menutrans C&lose\ more\ foldszm &\ \ zm menutrans &Close\ all\ foldszM \ &\ zM menutrans O&pen\ more\ foldszr \ &\ zr menutrans &Open\ all\ foldszR &\ \ 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:cwin &:cwin menutrans &Open:copen &:copen menutrans &Close:cclose &: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^Wn &^Wn menutrans S&plit^Ws &^Ws menutrans Sp&lit\ To\ #^W^^ \ \ &^W^^ menutrans Split\ &Vertically^Wv \ &^Wv menutrans Split\ File\ E&xplorer \ \ \ & menutrans &Close^Wc &^Wc menutrans Close\ &Other(s)^Wo \ &^Wo "menutrans Ne&xt^Ww &^Ww "menutrans P&revious^WW &^WW menutrans Move\ &To & menutrans Rotate\ &Up^WR &\ ^WR menutrans Rotate\ &Down^Wr \ &^Wr menutrans &Equal\ Size^W= &\ ^W= menutrans &Max\ Height^W_ \ &^W_ menutrans M&in\ Height^W1_ &\ ^W1_ menutrans Max\ &Width^W\| \ &^W\| menutrans Min\ Widt&h^W1\| \ &^W1\| " Window/Move To menutrans &Top^WK &^WK menutrans &Bottom^WJ &^WJ menutrans &Left\ side^WH &^WH menutrans &Right\ side^WL &^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_ (. _)\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 = "[ ]" let &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/lang/menu_sr_rs.utf-8.vim000066400000000000000000000322401267703067000210350ustar00rootroot00000000000000" Menu Translations: Serbian " Maintainer: Aleksandar Jelenak " 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 let s:keepcpo= &cpo set cpo&vim scriptencoding utf-8 " Help menu menutrans &Help Помо&ћ menutrans &Overview &Преглед 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\.\.\.:e &Отвори\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp &Подели-отвори\.\.\.:sp menutrans &New:enew &Нова:enew menutrans &Close:close &Затвори:close menutrans &Save:w &Сачувај:w menutrans Save\ &As\.\.\.:sav Сачувај\ &као\.\.\.:sav menutrans Split\ &Diff\ with\.\.\. Подели\ и\ &упореди\ са\.\.\. menutrans Split\ Patched\ &By\.\.\. По&дели\ и\ преправи\ са\.\.\. menutrans &Print Шта&мпај menutrans Sa&ve-Exit:wqa Сачувај\ и\ за&врши:wqa menutrans E&xit:qa К&рај:qa " Edit menu menutrans &Edit &Уређивање menutrans &Undou &Вратиu menutrans &Redo^R &Поврати^R menutrans Rep&eat\. П&онови\. menutrans Cu&t"+x Исе&ци"+x menutrans &Copy"+y &Копирај"+y menutrans &Paste"+gP &Убаци"+gP menutrans &Paste"+P &Убаци"+gP menutrans Put\ &Before[p Стави\ пре&д[p menutrans Put\ &After]p Стави\ &иза]p menutrans &Deletex Из&бришиx menutrans &Select\ allggVG Изабери\ св&е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:set\ hls! Нагласи\ &образце\ (да/не):set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! Занемари\ \величину\ &слова\ (да/не):set\ ic! menutrans Toggle\ &Showmatch:set\ sm! Провери\ пратећу\ &заграду\ (да/не):set\ sm! menutrans &Context\ lines Видљиви\ &редови menutrans &Virtual\ Edit Виртуелно\ &уређивање menutrans Toggle\ Insert\ &Mode:set\ im! Режим\ у&носа\ (да/не):set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! '&Vi'\ сагласно\ (да/не):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:set\ nu! Редни\ &бројеви\ (да/не):set\ nu! menutrans Toggle\ &List\ Mode:set\ list! Режим\ &листе\ (да/не):set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! Обавијање\ &редова\ (да/не):set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! Преломи\ &на\ реч\ (да/не):set\ lbr! menutrans Toggle\ &expand-tab:set\ et! Размаци\ уместо\ &табулације\ (да/не):set\ et! menutrans Toggle\ &auto-indent:set\ ai! Ауто-&увлачење\ (да/не):set\ ai! menutrans Toggle\ &C-indenting:set\ cin! &Це-увлачење\ (да/не):set\ cin! " Edit/Keymap menutrans None Ниједан " Tools menu menutrans &Tools &Алатке menutrans &Jump\ to\ this\ tagg^] Скочи\ на\ &ову\ ознакуg^] menutrans Jump\ &back^T Скочи\ &натраг^T menutrans Build\ &Tags\ File Изгради\ &датотеку\ ознака menutrans &Folding &Подвијање menutrans Create\ &Foldzf С&твори\ подвијутакzf menutrans &Delete\ Foldzd О&бриши\ подвијутакzd menutrans Delete\ &All\ FoldszD Обриши\ све\ по&двијуткеzD menutrans Fold\ column\ &width Ширина\ &реда\ подвијутка menutrans &Diff &Упоређивање menutrans &Make:make 'mak&е':make menutrans &List\ Errors:cl Списак\ &грешака:cl menutrans L&ist\ Messages:cl! Сп&исак\ порука:cl! menutrans &Next\ Error:cn С&ледећа\ грешка:cn menutrans &Previous\ Error:cp Пре&тходна\ грешка:cp menutrans &Older\ List:cold Стари\ списа&к:cold menutrans N&ewer\ List:cnew Но&ви\ списак:cnew menutrans Error\ &Window Прозор\ са\ г&решкама menutrans &Set\ Compiler И&забери\ преводиоца menutrans &Convert\ to\ HEX:%!xxd Претвори\ у\ &ХЕКС:%!xxd menutrans Conve&rt\ back:%!xxd\ -r Вр&ати\ у\ првобитан\ облик:%!xxd\ -r " Tools/Folding menutrans &Enable/Disable\ foldszi &Омогући/прекини\ подвијањеzi menutrans &View\ Cursor\ Linezv &Покажи\ ред\ са\ курсоромzv menutrans Vie&w\ Cursor\ Line\ onlyzMzx Покажи\ &само\ ред\ са\ курсоромzMzx menutrans C&lose\ more\ foldszm &Затвори\ више\ подвијутакаzm menutrans &Close\ all\ foldszM Затвори\ с&ве\ подвијуткеzM menutrans O&pen\ more\ foldszr Отвори\ виш&е\ подвијутакаzr menutrans &Open\ all\ foldszR О&твори\ све\ подвијутке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:cwin &Ажурирај:cwin menutrans &Open:copen &Отвори:copen menutrans &Close:cclose &Затвори: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^Wn &Нови^Wn menutrans S&plit^Ws &Подели^Ws menutrans Sp&lit\ To\ #^W^^ Подели\ са\ &алтернативним^W^^ menutrans Split\ &Vertically^Wv Подели\ &усправно^Wv menutrans Split\ File\ E&xplorer Подели\ за\ преглед\ &датотека menutrans &Close^Wc &Затвори^Wc menutrans Close\ &Other(s)^Wo Затвори\ &остале^Wo "menutrans Ne&xt^Ww &Следећи^Ww "menutrans P&revious^WW П&ретходни^WW menutrans Move\ &To Пре&мести menutrans Rotate\ &Up^WR &Кружно\ нагоре^WR menutrans Rotate\ &Down^Wr Кружно\ надол&е^Wr menutrans &Equal\ Size^W= &Исте\ величине^W= menutrans &Max\ Height^W_ Максимална\ &висина^W_ menutrans M&in\ Height^W1_ Минима&лна\ висина^W1_ menutrans Max\ &Width^W\| Максимална\ &ширина^W\| menutrans Min\ Widt&h^W1\| Минимална\ ши&рина^W1\| " Window/Move To menutrans &Top^WK &Врх^WK menutrans &Bottom^WJ &Подножје^WJ menutrans &Left\ side^WH У&лево^WH menutrans &Right\ side^WL У&десно^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_ за наредбе командног режима (нпр. с_)\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 = "[Нема датотеке]" let &cpo = s:keepcpo unlet s:keepcpo " vim: tw=0 keymap=serbian vim-7.4.1689/runtime/lang/menu_sr_yu.ascii.vim000066400000000000000000000001061267703067000211670ustar00rootroot00000000000000" Menu Translations: Serbian source :p:h/menu_sr_rs.ascii.vim vim-7.4.1689/runtime/lang/menu_sr_yu.iso_8859-2.vim000066400000000000000000000001131267703067000215230ustar00rootroot00000000000000" Menu Translations: Serbian source :p:h/menu_sr_rs.iso_8859-2.vim vim-7.4.1689/runtime/lang/menu_sr_yu.iso_8859-5.vim000066400000000000000000000001131267703067000215260ustar00rootroot00000000000000" Menu Translations: Serbian source :p:h/menu_sr_rs.iso_8859-5.vim vim-7.4.1689/runtime/lang/menu_sr_yu.utf-8.vim000066400000000000000000000001061267703067000210420ustar00rootroot00000000000000" Menu Translations: Serbian source :p:h/menu_sr_rs.utf-8.vim vim-7.4.1689/runtime/lang/menu_sv.latin1.vim000066400000000000000000000001071267703067000205570ustar00rootroot00000000000000" Menu Translations: Swedish source :p:h/menu_sv_se.latin1.vim vim-7.4.1689/runtime/lang/menu_sv.utf-8.vim000066400000000000000000000001321267703067000203300ustar00rootroot00000000000000" Menu Translations: Swedish for UTF-8 encoding source :p:h/menu_sv_se.latin1.vim vim-7.4.1689/runtime/lang/menu_sv_se.latin1.vim000066400000000000000000000246401267703067000212560ustar00rootroot00000000000000" Menu Translations: Swedish " Maintainer: Johan Svedberg " Last Change: 2012 May 01 " Quit when menu translations have already been done. if exists("did_menu_trans") finish endif let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim " 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 &Hjlp menutrans &Overview &versikt menutrans &User\ Manual &Anvndarmanual menutrans &How-to\ links &Hur-gra-lnkar menutrans &Find\.\.\. &Sk\.\.\. menutrans &Credits &Tack menutrans Co&pying &Kopieringsrttigheter menutrans &Sponsor/Register &Sponsra/Registrera menutrans O&rphans &Frldralsa menutrans &Version &Version menutrans &About &Om " File menu menutrans &File &Arkiv menutrans &Open\.\.\.:e &ppna\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp ppna\ i\ splitt-vy\.\.\.:sp menutrans Open\ Tab\.\.\.:tabnew ppna\ flik\.\.\.:tabnew menutrans &New:enew &Ny:enew menutrans &Close:close S&tng:close menutrans &Save:w &Spara:w menutrans Save\ &As\.\.\.:sav Spara\ som\.\.\.:sav menutrans Split\ &Diff\ with\.\.\. Dela\ diff\ med\.\.\. menutrans Split\ Patched\ &By\.\.\. Dela\ lappad\ med\.\.\. menutrans &Print Skriv\ &ut menutrans Sa&ve-Exit:wqa Spara\ &och\ avsluta:wqa menutrans E&xit:qa &Avsluta:qa " Edit menu menutrans &Edit &Redigera menutrans &Undou &ngrau menutrans &Redo^R &Gr\ om^R menutrans Rep&eat\. &Repetera\. menutrans Cu&t"+x Klipp\ &ut"+x menutrans &Copy"+y &Kopiera"+y menutrans &Paste"+gP Klistra &in"+gP menutrans Put\ &Before[p Stt\ in\ &fre[p menutrans Put\ &After]p Stt\ in\ &efter]p menutrans &Select\ AllggVG &Markera\ alltggVG menutrans &Find\.\.\. &Sk\.\.\. menutrans &Find/ &Sk/ menutrans Find\ and\ Rep&lace\.\.\. Sk\ och\ erstt\.\.\. menutrans Find\ and\ Rep&lace:%s Sk\ och\ erstt:%s menutrans Find\ and\ Rep&lace Sk\ och\ erstt menutrans Find\ and\ Rep&lace:s Sk\ och\ erstt:s menutrans Settings\ &Window In&stllningar menutrans &Global\ Settings Gl&obala\ instllningar menutrans F&ile\ Settings Fi&linstllningar menutrans C&olor\ Scheme F&rgschema menutrans &Keymap &Tangentbordsuppsttning " Edit.Global Settings menutrans Toggle\ Pattern\ &Highlight:set\ hls! Vxla\ mnsterframhvning:set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! Vxla\ ignorering\ av\ storlek:set\ ic! menutrans Toggle\ &Showmatch:set\ sm! Vxla\ matchningsvisning:set\ sm! menutrans &Context\ lines Sammanhangsrader menutrans &Virtual\ Edit Virtuell\ redigering menutrans Never Aldrig menutrans Block\ Selection Blockval menutrans Insert\ mode Infogningslge menutrans Block\ and\ Insert Block\ och\ infogning menutrans Always Alltid menutrans Toggle\ Insert\ &Mode:set\ im! Vxla\ infogningslge:set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! Vxla\ Vi-kompabilitet:set\ cp! menutrans Search\ &Path\.\.\. Skvg\.\.\. menutrans Ta&g\ Files\.\.\. Taggfiler\.\.\. menutrans Toggle\ &Toolbar Vxla\ verktygsrad menutrans Toggle\ &Bottom\ Scrollbar Vxla\ rullningslista\ i\ botten menutrans Toggle\ &Left\ Scrollbar Vxla\ vnster\ rullningslista menutrans Toggle\ &Right\ Scrollbar Vxla\ hger\ rullningslista menutrans None Ingen " Edit.File Settings menutrans Toggle\ Line\ &Numbering:set\ nu! Vxla\ radnumrering:set\ nu! menutrans Toggle\ &List\ Mode:set\ list! Vxla\ listlge:set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! Vxla\ radbrytning:set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! Vxla\ radbrytning\ vid\ ord:set\ lbr! menutrans Toggle\ &expand-tab:set\ et! Vxla\ tab-expandering:set\ et! menutrans Toggle\ &auto-indent:set\ ai! Vxla\ auto-indentering:set\ ai! menutrans Toggle\ &C-indenting:set\ cin! Vxla\ C-indentering:set\ cin! menutrans &Shiftwidth Shiftbredd menutrans Soft\ &Tabstop Mjuk\ tab-stopp menutrans Te&xt\ Width\.\.\. Textbredd\.\.\. menutrans &File\ Format\.\.\. Filformat\.\.\. " Tools menu menutrans &Tools &Verktyg menutrans &Jump\ to\ this\ tagg^] &Hoppa\ till\ den\ hr\ taggeng^] menutrans Jump\ &back^T Hoppa\ tillbaka^T menutrans Build\ &Tags\ File Bygg\ taggfil menutrans &Make:make &Bygg:make menutrans &List\ Errors:cl Listfel:cl menutrans L&ist\ Messages:cl! Listmeddelande:cl! menutrans &Next\ Error:cn Nsta\ fel:cn menutrans &Previous\ Error:cp Tidigare\ fel:cp menutrans &Older\ List:cold &ldre\ lista:cold menutrans N&ewer\ List:cnew &Nyare\ lista:cnew menutrans Error\ &Window Felfnster menutrans &Update:cwin &Uppdatera:cwin menutrans &Open:copen &ppna:copen menutrans &Close:cclose &Stng:cclose menutrans &Convert\ to\ HEX:%!xxd Konvertera\ till\ HEX:%!xxd menutrans Conve&rt\ back:%!xxd\ -r Konvertera\ tillbaka:%!xxd\ -r menutrans Se&T\ Compiler Stt\ &kompilerare " Tools.Spelling menutrans &Spelling &Stavning menutrans &Spell\ Check\ On &Stavningskontroll\ p menutrans &Spell\ Check\ Off Stavningskontroll\ &av menutrans To\ &Next\ error]s Till\ &nsta\ fel menutrans To\ &Previous\ error[s Till\ &fregende\ fel menutrans Suggest\ &Correctionsz= Fresl\ &korrigeringar menutrans &Repeat\ correction:spellrepall &Upprepa\ korrigering " Tools.Folding menutrans &Enable/Disable\ foldszi Vxla\ veckzi menutrans &View\ Cursor\ Linezv Visa\ markrradzv menutrans Vie&w\ Cursor\ Line\ onlyzMzx Visa\ bara\ markrradzMzx menutrans C&lose\ more\ foldszm Stng\ mer\ veckzm menutrans &Close\ all\ foldszM Stng\ alla\ veckzM menutrans O&pen\ more\ foldszr ppna\ mer\ veckzr menutrans &Open\ all\ foldszR ppna\ mer\ veckzR 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\ &Foldzf Skapa\ veckzf menutrans &Delete\ Foldzd Ta\ bort\ veckzd menutrans Delete\ &All\ FoldszD Ta\ bort\ alla\ veckzD menutrans Fold\ col&umn\ width Veckcolumnsbredd " Tools.Diff menutrans &Update Uppdatera menutrans &Get\ Block Hmta\ block menutrans &Put\ Block Lmna\ block " Names for buffer menu. menutrans &Buffers &Buffertar menutrans &Refresh\ menu Uppdatera\ meny menutrans &Delete Ta\ bort menutrans &Alternate Alternativ menutrans &Next &Nsta menutrans &Previous &Tidigare " Window menu menutrans &Window &Fnster menutrans &New^Wn &Nytt^Wn menutrans S&plit^Ws Dela^Ws menutrans Sp&lit\ To\ #^W^^ Dela\ till\ #^W^^ menutrans Split\ &Vertically^Wv Dela\ &vertikalt^Wv menutrans Split\ File\ E&xplorer Dela\ filhanterare menutrans &Close^Wc &Stng^Wc menutrans Close\ &Other(s)^Wo &Stng\ alla\ andra^Wo menutrans Ne&xt^Ww Nsta^Ww menutrans P&revious^WW &Tidigare^WW menutrans &Equal\ Size^W= &Samma\ storlek^W= menutrans &Max\ Height^W_ &Maximal\ storlek^W_ menutrans M&in\ Height^W1_ M&inimal\ storlek^W1_ menutrans Max\ &Width^W\| Maximal\ bredd^W\| menutrans Min\ Widt&h^W1\| Minimal\ bredd^W1\| menutrans Move\ &To Flytta\ till menutrans &Top^WK Toppen^WK menutrans &Bottom^WJ Botten^WJ menutrans &Left\ side^WH &Vnstra\ sidan^WH menutrans &Right\ side^WL &Hgra\ sidan^WL menutrans Rotate\ &Up^WR Rotera\ upp^WR menutrans Rotate\ &Down^Wr Rotera\ ned^Wr menutrans Select\ Fo&nt\.\.\. Vlj\ 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 Gr om tmenu ToolBar.Cut Klipp ut tmenu ToolBar.Copy Kopiera tmenu ToolBar.Paste Klistra in tmenu ToolBar.Find Sk... tmenu ToolBar.FindNext Sk nsta tmenu ToolBar.FindPrev Sk tidigare tmenu ToolBar.Replace Sk och erstt... tmenu ToolBar.LoadSesn Ladda session tmenu ToolBar.SaveSesn Spara session tmenu ToolBar.RunScript Kr ett Vim-skript tmenu ToolBar.Make Bygg aktuellt projekt tmenu ToolBar.Shell ppna ett kommandoskal tmenu ToolBar.RunCtags Kr Ctags tmenu ToolBar.TagJump Hoppa till tagg under markr tmenu ToolBar.Help Hjlp tmenu ToolBar.FindHelp Sk i hjlp endfun endif " Syntax menu menutrans &Syntax &Syntax menutrans &Show\ filetypes\ in\ menu &Visa\ filtyper\ i\ meny menutrans &Off &Av menutrans &Manual &Manuellt menutrans A&utomatic Automatiskt menutrans on/off\ for\ &This\ file Av/P\ fr\ aktuell\ fil menutrans Co&lor\ test Frgtest menutrans &Highlight\ test Framhvningstest menutrans &Convert\ to\ HTML Konvertera\ till\ &HTML " dialog texts let menutrans_no_file = "[Ingen fil]" let menutrans_help_dialog = "Skriv in ett kommando eller ord som du vill ska hjlp p:\n\nBrja med i_ fr infogninglgeskommandon (t.ex. i_CTRL-X)\nBrja med c_ fr kommandoradredigeringskommandon (t.ex. c_)\nBrja med ' fr ett instllningsnamn (t.ex. 'shiftwidth')" let g:menutrans_path_dialog = "Skriv in skvg fr filer.\nSeparera katalognamn med komma" let g:menutrans_tags_dialog = "Skriv in namn p taggfiler.\nSeparera namn med komma." let g:menutrans_textwidth_dialog = "Vlj ny textbredd (0 fr att frhindra formatering): " let g:menutrans_fileformat_dialog = "Vlj filformat som filen ska sparas med" let &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/lang/menu_sv_se.utf-8.vim000066400000000000000000000001321267703067000210170ustar00rootroot00000000000000" Menu Translations: Swedish for UTF-8 encoding source :p:h/menu_sv_se.latin1.vim vim-7.4.1689/runtime/lang/menu_uk_ua.cp1251.vim000066400000000000000000000240431267703067000207630ustar00rootroot00000000000000" Menu Translations: Ukrainian " Maintainer: Bohdan Vlasyuk " 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 let s:keepcpo= &cpo set cpo&vim scriptencoding cp1251 " Help menu menutrans &Help & menutrans &Overview &\ 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\.\.\.:e &³\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp &\ \.\.\.:sp menutrans &New:enew &:enew menutrans &Close:close &:close menutrans &Save:w &':w menutrans Save\ &As\.\.\.:sav '\ &\.\.\.:sav menutrans Split\ &Diff\ with\.\.\. &\ \.\.\. menutrans Split\ Patched\ &By\.\.\. &\.\.\. menutrans &Print & menutrans Sa&ve-Exit:wqa \ \ &:wqa menutrans E&xit:qa &:qa " Edit menu menutrans &Edit & menutrans &Undou &³u menutrans &Redo^R &^R menutrans Rep&eat\. &\. menutrans Cu&t"+x &"+x menutrans &Copy"+y &"+y menutrans &Paste"+gP &"+gP menutrans Put\ &Before[p \ &[p menutrans Put\ &After]p \ &]p menutrans &Select\ allggVG &\ ggVG menutrans &Find\.\.\. &\.\.\. menutrans Find\ and\ Rep&lace\.\.\. &\.\.\. menutrans Settings\ &Window ³\ & menutrans &Global\ Settings \ & menutrans F&ile\ Settings \ \ & menutrans Toggle\ Line\ &Numbering:set\ nu! &\ :set\ nu! menutrans Toggle\ &List\ Mode:set\ list! \ &\ :set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! \ &:set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! \ \ &:set\ lbr! menutrans Toggle\ &expand-tab:set\ et! \ \ &:set\ et! menutrans Toggle\ &auto-indent:set\ ai! \ &:set\ ai! menutrans Toggle\ &C-indenting:set\ cin! ³\ \ \ &C: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:set\ hls! \ &:set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! &\ \\ \ \ :set\ ic! menutrans Toggle\ &Showmatch:set\ sm! &\ :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:set\ im! \ &: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\ tagg^] &\ \ g^] menutrans Jump\ &back^T &^T menutrans Build\ &Tags\ File &\ \ " Folding menutrans &Folding & menutrans &Enable/Disable\ foldszi &/\ zi menutrans &View\ Cursor\ Linezv &\ \ \ zv menutrans Vie&w\ Cursor\ Line\ onlyzMzx \ &\ \ \ zMzx menutrans C&lose\ more\ foldszm \ &\ zm menutrans &Close\ all\ foldszM \ &\ zM menutrans &Open\ all\ foldszR ³\ &\ zR menutrans O&pen\ more\ foldszr ³\ &\ zr menutrans Create\ &Foldzf &\ zf menutrans &Delete\ Foldzd &\ zd menutrans Delete\ &All\ FoldszD &\ \ 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:make &(make):make menutrans &List\ Errors:cl &\ :cl menutrans L&ist\ Messages:cl! &\ :cl! menutrans &Next\ Error:cn &\ :cn menutrans &Previous\ Error:cp &\ :cp menutrans &Older\ List:cold &\ :cold menutrans N&ewer\ List:cnew &\ :cnew menutrans Error\ &Window &³\ menutrans &Update:cwin &:cwin menutrans &Close:cclose &:cclose menutrans &Open:copen &³:copen menutrans &Set\ Compiler \ & menutrans &Convert\ to\ HEX:%!xxd \ \ \ :%!xxd menutrans Conve&rt\ back:%!xxd\ -r \ \ \ :%!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^Wn &^Wn menutrans S&plit^Ws &^Ws menutrans Sp&lit\ To\ #^W^^ \ \ &\ ^W^^ menutrans Split\ &Vertically^Wv \ &^Wv "menutrans Split\ &Vertically^Wv &\ ^Wv menutrans Split\ File\ E&xplorer \ \ &\ menutrans &Close^Wc &^Wc menutrans Close\ &Other(s)^Wo \ \ &^Wo menutrans Ne&xt^Ww &^Ww menutrans P&revious^WW &^WW menutrans &Equal\ Size^W= &\ ^W= menutrans &Max\ Height^W_ &\ ^W_ menutrans M&in\ Height^W1_ &\ ^W1_ menutrans Max\ &Width^W\| &\ ^W\| menutrans Min\ Widt&h^W1\| &\ ^W1\| menutrans Move\ &To & menutrans &Top^WK &^WK menutrans &Bottom^WJ &^WJ menutrans &Left\ side^WH &^WH menutrans &Right\ side^WL &^WL menutrans Rotate\ &Up^WR &\ ^WR menutrans Rotate\ &Down^Wr &\ ^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_ (. _)\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 &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/lang/menu_uk_ua.koi8-u.vim000066400000000000000000000240431267703067000211640ustar00rootroot00000000000000" Menu Translations: Ukrainian " Maintainer: Bohdan Vlasyuk " 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 let s:keepcpo= &cpo set cpo&vim scriptencoding koi8-u " Help menu menutrans &Help & menutrans &Overview &\ æ 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\.\.\.:e &\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp &Ħ\ צ\.\.\.:sp menutrans &New:enew &:enew menutrans &Close:close &:close menutrans &Save:w &':w menutrans Save\ &As\.\.\.:sav '\ &\.\.\.:sav menutrans Split\ &Diff\ with\.\.\. &Ҧ\ \.\.\. menutrans Split\ Patched\ &By\.\.\. &\.\.\. menutrans &Print & menutrans Sa&ve-Exit:wqa \ \ &:wqa menutrans E&xit:qa &Ȧ:qa " Edit menu menutrans &Edit & menutrans &Undou &ͦu menutrans &Redo^R &^R menutrans Rep&eat\. &\. menutrans Cu&t"+x &Ҧ"+x menutrans &Copy"+y &Ц"+y menutrans &Paste"+gP &"+gP menutrans Put\ &Before[p \ &[p menutrans Put\ &After]p \ &]p menutrans &Select\ allggVG &\ ggVG menutrans &Find\.\.\. &\.\.\. menutrans Find\ and\ Rep&lace\.\.\. &ͦ\.\.\. menutrans Settings\ &Window \ & menutrans &Global\ Settings Φ\ & menutrans F&ile\ Settings \ \ & menutrans Toggle\ Line\ &Numbering:set\ nu! &æ\ ˦:set\ nu! menutrans Toggle\ &List\ Mode:set\ list! \ &\ צ:set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! \ &:set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! \ \ &:set\ lbr! menutrans Toggle\ &expand-tab:set\ et! \ \ &æ:set\ et! menutrans Toggle\ &auto-indent:set\ ai! \ &צ:set\ ai! menutrans Toggle\ &C-indenting:set\ cin! \ \ \ &C: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:set\ hls! Ħ\ &:set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! &Ҧ\ \˦\ \ ̦\ ̦:set\ ic! menutrans Toggle\ &Showmatch:set\ sm! &\ :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:set\ im! \ &: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\ tagg^] &\ \ ͦg^] menutrans Jump\ &back^T &^T menutrans Build\ &Tags\ File &\ \ ͦ " Folding menutrans &Folding & menutrans &Enable/Disable\ foldszi &/\ zi menutrans &View\ Cursor\ Linezv &\ \ \ zv menutrans Vie&w\ Cursor\ Line\ onlyzMzx \ &\ \ \ zMzx menutrans C&lose\ more\ foldszm \ &¦\ ˦zm menutrans &Close\ all\ foldszM \ &Ӧ\ zM menutrans &Open\ all\ foldszR \ &Ӧ\ zR menutrans O&pen\ more\ foldszr \ &\ ˦zr menutrans Create\ &Foldzf &\ zf menutrans &Delete\ Foldzd &\ zd menutrans Delete\ &All\ FoldszD &\ Ӧ\ 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:make &(make):make menutrans &List\ Errors:cl &\ :cl menutrans L&ist\ Messages:cl! &\ צ:cl! menutrans &Next\ Error:cn &\ :cn menutrans &Previous\ Error:cp &\ :cp menutrans &Older\ List:cold &ۦ\ :cold menutrans N&ewer\ List:cnew &Φ\ :cnew menutrans Error\ &Window &\ menutrans &Update:cwin &:cwin menutrans &Close:cclose &:cclose menutrans &Open:copen &:copen menutrans &Set\ Compiler \ &Ц menutrans &Convert\ to\ HEX:%!xxd \ \ ۦצ\ :%!xxd menutrans Conve&rt\ back:%!xxd\ -r \ \ צ\ :%!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^Wn &^Wn menutrans S&plit^Ws &Ħ^Ws menutrans Sp&lit\ To\ #^W^^ Ħ\ \ &\ ^W^^ menutrans Split\ &Vertically^Wv Ħ\ &^Wv "menutrans Split\ &Vertically^Wv &Ħ\ ^Wv menutrans Split\ File\ E&xplorer Ħ\ \ &\ ̦ menutrans &Close^Wc &^Wc menutrans Close\ &Other(s)^Wo \ Ӧ\ &ۦ^Wo menutrans Ne&xt^Ww &^Ww menutrans P&revious^WW &Τ^WW menutrans &Equal\ Size^W= &Ҧ\ ͦ^W= menutrans &Max\ Height^W_ &¦\ ^W_ menutrans M&in\ Height^W1_ &\ ^W1_ menutrans Max\ &Width^W\| ¦&\ ^W\| menutrans Min\ Widt&h^W1\| &\ ^W1\| menutrans Move\ &To &ͦ menutrans &Top^WK &^WK menutrans &Bottom^WJ &^WJ menutrans &Left\ side^WH &̦^WH menutrans &Right\ side^WL &^WL menutrans Rotate\ &Up^WR &̦\ ^WR menutrans Rotate\ &Down^Wr &̦\ ^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_ (. _)\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 &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/lang/menu_vi_vn.vim000066400000000000000000000334131267703067000200670ustar00rootroot00000000000000" Menu Translations: Vietnamese " Maintainer: Phan Vinh Thinh " Last Change: 12 Mar 2005 " URL: http://iatp.vspu.ac.ru/phan/vietvim/lang/menu_vi_vn.vim " " " Adopted for VietVim project by Phan Vinh Thinh. " First translation: Phan Vinh Thinh " " " Quit when menu translations have already been done. " if exists("did_menu_trans") finish endif let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim scriptencoding utf-8 " Top menutrans &File &Tập\ tin menutrans &Edit &Soạn\ thảo menutrans &Tools Cô&ng\ cụ menutrans &Syntax &Cú\ pháp menutrans &Buffers &Bộ\ đệm menutrans &Window Cử&a\ sổ menutrans &Help Trợ\ &giúp " " " " Help menu menutrans &Overview &Tổng\ quan menutrans &User\ Manual &Hướng\ dẫn\ sử\ dụng menutrans &How-to\ links &Làm\ như\ thế\ nào menutrans &Find\.\.\. Tìm\ &kiếm\.\.\. "-------------------- menutrans &Credits Lời\ &cảm\ ơn menutrans Co&pying &Bản\ quyền menutrans &Sponsor/Register &Giúp\ đỡ/Đăng\ ký menutrans O&rphans Trẻ\ &mồ\ côi "-------------------- menutrans &Version &Phiên\ bản menutrans &About &Về\ Vim " " " File menu menutrans &Open\.\.\.:e &Mở\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp &Chia-Mở\.\.\.:sp menutrans &New:enew Mớ&i:enew menutrans &Close:close Đó&ng:close "-------------------- menutrans &Save:w &Ghi\ nhớ:w menutrans Save\ &As\.\.\.:sav Ghi\ n&hư\.\.\.:sav "-------------------- menutrans Split\ &Diff\ with\.\.\. &So\ sánh\ với\.\.\. menutrans Split\ Patched\ &By\.\.\. So\ sánh\ đã\ vá\ lỗi\ &bởi\.\.\. "-------------------- menutrans &Print In\ &ra menutrans Sa&ve-Exit:wqa Ghi\ nhớ\ rồi\ th&oát :wqa menutrans E&xit:qa &Thoát:qa " " " Edit menu menutrans &Undou &Hủy\ bướcu menutrans &Redo^R &Làm\ lại^R menutrans Rep&eat\. Lặ&p\ lại\. "-------------------- menutrans Cu&t"+x &Cắt"+x menutrans &Copy"+y &Sao\ chép"+y menutrans &Paste"+gP &Dán"+gP menutrans Put\ &Before[p Dán\ trướ&c[p menutrans Put\ &After]p Dán\ sa&u]p menutrans &Deletex &Xóax menutrans &Select\ AllggVG Chọ&n\ tất\ cảggVG "-------------------- menutrans &Find\.\.\./ &Tìm\ kiếm\.\.\./ menutrans Find\ and\ Rep&lace\.\.\. Tìm\ kiếm\ &và\ thay\ thế\.\.\. menutrans Find\ and\ Rep&lace\.\.\.:%s Tìm\ kiếm\ &và\ thay\ thế\.\.\.:%s menutrans Find\ and\ Rep&lace\.\.\.:s Tìm\ kiếm\ &và\ thay\ thế\.\.\:s "-------------------- menutrans Settings\ &Window Cửa\ &sổ\ thiết\ lập menutrans &Global\ Settings Thiết\ lập\ t&oàn\ cầu menutrans F&ile\ Settings &Thiết\ lập\ tập\ t&in menutrans C&olor\ Scheme Phối\ hợp\ màu\ &sắc menutrans &Keymap Sơ\ đồ\ &bàn\ phím menutrans Select\ Fo&nt\.\.\. Chọn\ &phông\ chữ\.\.\. ">>>----------------- Edit/Global settings menutrans Toggle\ Pattern\ &Highlight:set\ hls! &Chiếu\ sáng\ từ\ tìm\ thấy :set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! &Không\ tính\ đến\ kiểu\ chữ:set\ ic! menutrans Toggle\ &Showmatch:set\ sm! Cho\ &biết\ phần\ tử\ có\ cặp:set\ sm! menutrans &Context\ lines Số\ &dòng\ quanh\ con\ trỏ menutrans &Virtual\ Edit &Soạn\ thảo\ ảo menutrans Toggle\ Insert\ &Mode:set\ im! Chế\ độ\ chè&n:set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! Tương\ thích\ với\ &Vi:set\ cp! menutrans Search\ &Path\.\.\. Đường\ dẫn\ tìm\ &kiếm\.\.\. menutrans Ta&g\ Files\.\.\. Tập\ tin\ t&hẻ\ ghi\.\.\. " menutrans Toggle\ &Toolbar Ẩn/hiện\ th&anh\ công\ cụ menutrans Toggle\ &Bottom\ Scrollbar Ẩn/hiện\ thanh\ kéo\ nằ&m\ dưới menutrans Toggle\ &Left\ Scrollbar Ẩn/hiện\ thanh\ ké&o\ bên\ trái menutrans Toggle\ &Right\ Scrollbar Ẩn/hiện\ thanh\ kéo\ bên\ &phải ">>>->>>------------- Edit/Global settings/Virtual edit menutrans Never Tắt menutrans Block\ Selection Khi\ chọn\ khối menutrans Insert\ mode Trong\ chế\ độ\ Chèn menutrans Block\ and\ Insert Khi\ chọn\ khối\ và\ Chèn menutrans Always Luôn\ luôn\ bật ">>>----------------- Edit/File settings menutrans Toggle\ Line\ &Numbering:set\ nu! Đánh\ &số\ dòng:set\ nu! menutrans Toggle\ &List\ Mode:set\ list! &Chế\ độ\ danh\ sách:set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! &Ngắt\ những\ dòng\ dài:set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! Ngắt\ từ\ nguyên\ &vẹn:set\ lbr! menutrans Toggle\ &expand-tab:set\ et! &Dấu\ trắng\ thay\ cho\ tab:set\ et! menutrans Toggle\ &auto-indent:set\ ai! &Tự\ động\ thụt\ dòng:set\ ai! menutrans Toggle\ &C-indenting:set\ cin! T&hụt\ dòng\ kiểu\ C:set\ cin! ">>>--- menutrans &Shiftwidth Chiều\ &rộng\ thụt\ dòng menutrans Soft\ &Tabstop Chiều\ rộng\ T&ab menutrans Te&xt\ Width\.\.\. Chiều\ rộng\ văn\ &bản\.\.\. menutrans &File\ Format\.\.\. Định\ dạng\ tậ&p\ tin\.\.\. ">>>----------------- Edit/File settings/Color Scheme menutrans default Mặc\ định ">>>----------------- Edit/File settings/Keymap menutrans None Không\ dùng menutrans arabic Ả\ rập menutrans czech Séc menutrans esperanto Etperantô menutrans greek Hy\ Lạp menutrans hebrew Do\ thái menutrans hebrewp Do\ thái\ p menutrans lithuania-baltic Lát-vi\ Bal-tíc menutrans magyar Hungari menutrans persian-iranian Iran\ Ba\ Tư menutrans persian Ba\ Tư menutrans russian-jcuken Nga\ jcuken menutrans russian-jcukenwin Nga\ jcukenwin menutrans russian-yawerty Nga\ yawerty menutrans serbian-latin Xéc-bi\ La-tinh menutrans serbian Xéc-bi menutrans slovak slovak " " " " Tools menu menutrans &Jump\ to\ this\ tagg^] &Nhảy\ tới\ thẻ\ ghig^] menutrans Jump\ &back^T &Quay\ lại^T menutrans Build\ &Tags\ File &Tạo\ tập\ tin\ thẻ\ ghi "------------------- menutrans &Folding Nếp\ &gấp menutrans &Diff &Khác\ biệt (diff) "------------------- menutrans &Make:make &Biên\ dịch:make menutrans &List\ Errors:cl &Danh\ sách\ lỗi:cl menutrans L&ist\ Messages:cl! Danh\ &sách\ thông\ báo:cl! menutrans &Next\ Error:cn &Lỗi\ tiếp\ theo:cn menutrans &Previous\ Error:cp Lỗi\ t&rước:cp menutrans &Older\ List:cold Danh\ sách\ &cũ\ hơn:cold menutrans N&ewer\ List:cnew Danh\ sách\ &mới\ hơn:cnew menutrans Error\ &Window Cử&a\ sổ\ lỗi menutrans &Set\ Compiler C&họn\ trình\ biên\ dịch "------------------- menutrans &Convert\ to\ HEX:%!xxd Ch&uyển\ thành\ HEX:%!xxd menutrans Conve&rt\ back:%!xxd\ -r Chuyển\ từ\ HE&X:%!xxd\ -r ">>>---------------- Folds menutrans &Enable/Disable\ foldszi &Bật/tắt\ nếp\ gấpzi menutrans &View\ Cursor\ Linezv &Xem\ dòng\ có\ con\ trỏzv menutrans Vie&w\ Cursor\ Line\ onlyzMzx &Chỉ\ xem\ dòng\ có\ con\ trỏzMzx menutrans C&lose\ more\ foldszm Đóng\ &nhiều\ nếp\ gấp\ hơnzm menutrans &Close\ all\ foldszM Đóng\ mọi\ nếp\ &gấpzM menutrans &Open\ all\ foldszR &Mở\ mọi\ nếp\ gấpzR menutrans O&pen\ more\ foldszr Mở\ n&hiều\ nếp\ gấp\ hơnzr menutrans Fold\ Met&hod &Phương\ pháp\ gấp menutrans Create\ &Foldzf &Tạo\ nếp\ gấpzf menutrans &Delete\ Foldzd Xó&a\ nếp\ gấpzd menutrans Delete\ &All\ FoldszD Xóa\ mọ&i\ nếp\ gấpzD menutrans Fold\ col&umn\ width Chiều\ &rộng\ cột\ nếp\ gấp ">>>->>>----------- Tools/Folds/Fold Method menutrans M&anual &Thủ\ công menutrans I&ndent Thụt\ &dòng menutrans E&xpression &Biểu\ thức menutrans S&yntax &Cú\ pháp menutrans Ma&rker &Dấu\ hiệu ">>>--------------- Tools/Diff menutrans &Update &Cập\ nhật menutrans &Get\ Block &Thay\ đổi\ bộ\ đệm\ này menutrans &Put\ Block T&hay\ đổi\ bộ\ đệm\ khác ">>>--------------- Tools/Diff/Error window menutrans &Update:cwin &Cập\ nhật:cwin menutrans &Close:cclose Đó&ng:cclose menutrans &Open:copen &Mở:copen " " " Syntax menu " menutrans &Show\ filetypes\ in\ menu &Hiển\ thị\ loại\ tập\ tin\ trong\ trình\ đơn menutrans Set\ '&syntax'\ only &Chỉ\ thay\ đổi\ giá\ trị\ 'syntax' menutrans Set\ '&filetype'\ too Th&ay\ đổi\ cả\ giá\ trị\ 'filetype' menutrans &Off &Tắt menutrans &Manual &Bằng\ tay menutrans A&utomatic Tự\ độ&ng menutrans on/off\ for\ &This\ file Bật\ tắt\ &cho\ tập\ tin\ này menutrans Co&lor\ test &Kiểm\ tra\ màu\ sắc menutrans &Highlight\ test Kiểm\ tra\ chiếu\ &sáng menutrans &Convert\ to\ HTML &Chuyển\ thành\ HTML ">>>---------------- Syntax/AB menutrans Apache\ config Cấu\ hình\ Apache menutrans Ant\ build\ file Tập\ tin\ biên\ dịch\ Ant menutrans Apache-style\ config Cấu\ hình\ phong\ cách\ Apache menutrans Arc\ Macro\ Language Ngôn\ ngữ\ Macro\ Arc menutrans Arch\ inventory Kiểm\ kê\ Arch menutrans ASP\ with\ VBScript ASP\ với\ VBScript menutrans ASP\ with\ Perl ASP\ với\ Perl menutrans BC\ calculator Máy\ tính\ BC menutrans BDF\ font Phông\ chữ\ BDF menutrans blank không\ dùng ">>>---------------- Syntax/C menutrans Calendar Lịch menutrans Cheetah\ template Mẫu\ Cheetah menutrans Config Cấu\ hình " " " Buffers menu " menutrans &Refresh\ menu &Cập\ nhật\ trình\ đơn menutrans Delete &Xóa menutrans &Alternate Xen\ &kẽ menutrans &Next Tiế&p\ theo menutrans &Previous &Trước menutrans [No\ File] [Không\ có\ tập\ tin] " " " Window menu " menutrans &New^Wn &Mới^Wn menutrans S&plit^Ws &Chia\ đôi^Ws menutrans Sp&lit\ To\ #^W^^ Chia\ &tới\ #^W^^ menutrans Split\ &Vertically^Wv Chia\ &dọc^Wv menutrans Split\ File\ E&xplorer Mở\ trình\ &duyệt\ tập\ tin " menutrans &Close^Wc Đó&ng^Wc menutrans Close\ &Other(s)^Wo Đóng\ các\ cửa\ sổ\ &khác^Wo " menutrans Move\ &To C&huyển\ tới menutrans Rotate\ &Up^WR &Lên\ trên^WR menutrans Rotate\ &Down^Wr &Xuống\ dưới^Wr " menutrans &Equal\ Size^W= Cân\ &bằng\ kích\ thước^W= menutrans &Max\ Height^W_ Chiều\ c&ao\ lớn\ nhất^W_ menutrans M&in\ Height^W1_ Chiều\ ca&o\ nhỏ\ nhất^W1_ menutrans Max\ &Width^W\| Chiều\ &rộng\ lớn\ nhất^W\| menutrans Min\ Widt&h^W1\| Chiề&u\ rộng\ nhỏ\ nhất^W1\| ">>>----------------- Window/Move To menutrans &Top^WK Đầ&u^WK menutrans &Bottom^WJ &Cuối^WJ menutrans &Left\ side^WH &Trái^WH menutrans &Right\ side^WL &Phải^WL " " " The popup menu " " menutrans &Undo &Hủy\ bước menutrans Cu&t &Cắt menutrans &Copy &Sao\ chép menutrans &Paste &Dán menutrans &Delete &Xóa menutrans Select\ Blockwise Chọn\ &theo\ khối menutrans Select\ &Word Chọ&n\ từ menutrans Select\ &Line Chọn\ dòn&g menutrans Select\ &Block Chọn\ &khối menutrans Select\ &All Chọn\ tất\ &cả " " The GUI toolbar " if has("toolbar") if exists("*Do_toolbar_tmenu") delfun Do_toolbar_tmenu endif fun Do_toolbar_tmenu() tmenu ToolBar.Open Mở tập tin tmenu ToolBar.Save Ghi nhớ tập tin tmenu ToolBar.SaveAll Ghi nhớ tất cả tmenu ToolBar.Print In ra tmenu ToolBar.Undo Hủy bước tmenu ToolBar.Redo Làm lại tmenu ToolBar.Cut Cắt tmenu ToolBar.Copy Sao chép tmenu ToolBar.Paste Dán tmenu ToolBar.Find Tìm kiếm tmenu ToolBar.FindNext Tìm tiếp theo tmenu ToolBar.FindPrev Tìm ngược lại tmenu ToolBar.Replace Thay thế... tmenu ToolBar.LoadSesn Nạp buổi làm việc tmenu ToolBar.SaveSesn Ghi nhớ buổi làm việc tmenu ToolBar.RunScript Chạy script của Vim tmenu ToolBar.Make Biên dịch tmenu ToolBar.Shell Shell tmenu ToolBar.RunCtags Tạo tập tin thẻ ghi tmenu ToolBar.TagJump Chuyển tới thẻ ghi tmenu ToolBar.Help Trợ giúp tmenu ToolBar.FindHelp Tìm trong trợ giúp endfun endif " " " Dialog texts " " Find in help dialog " let g:menutrans_help_dialog = "Hãy nhập câu lệnh hoặc từ khóa tìm kiếm:\n\nThêm i_ để tìm kiếm câu lệnh của chế độ Nhập Input (Ví dụ, i_CTRL-X)\nThêm c_ để tìm kiếm câu lệnh của chế độ soạn thảo dòng lệnh (Ví dụ, с_)\nThêm ' để tìm kiếm trợ giúp cho một tùy chọn (ví dụ, 'shiftwidth')" " " Searh path dialog " let g:menutrans_path_dialog = "Hãy chỉ ra đường dẫn để tìm kiếm tập tin.\nTên của thư mục phân cách nhau bởi dấu phẩy." " " Tag files dialog " let g:menutrans_tags_dialog = "Nhập tên tập tin thẻ ghi (phân cách bởi dấu phẩy).\n" " " Text width dialog " let g:menutrans_textwidth_dialog = "Hãy nhập chiều rộng văn bản mới.\nNhập 0 để hủy bỏ." " " File format dialog " let g:menutrans_fileformat_dialog = "Hãy chọn định dạng tập tin." let g:menutrans_fileformat_choices = "&Unix\n&Dos\n&Mac\n&Hủy bỏ" " let menutrans_no_file = "[không có tập tin]" let &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/lang/menu_zh.big5.vim000066400000000000000000000001311267703067000202030ustar00rootroot00000000000000" Menu Translations: Traditional Chinese source :p:h/menu_chinese_taiwan.950.vim vim-7.4.1689/runtime/lang/menu_zh.cp936.vim000066400000000000000000000001421267703067000202230ustar00rootroot00000000000000" Menu Translations: Simplified Chinese (for Windows) source :p:h/menu_chinese_gb.936.vim vim-7.4.1689/runtime/lang/menu_zh.cp950.vim000066400000000000000000000001311267703067000202150ustar00rootroot00000000000000" Menu Translations: Traditional Chinese source :p:h/menu_chinese_taiwan.950.vim vim-7.4.1689/runtime/lang/menu_zh.gb2312.vim000066400000000000000000000001401267703067000202550ustar00rootroot00000000000000" Menu Translations: Simplified Chinese (for Windows) source :p:h/menu_zh_cn.gb2312.vim vim-7.4.1689/runtime/lang/menu_zh_cn.18030.vim000066400000000000000000000001221267703067000205100ustar00rootroot00000000000000" Menu Translations: Simplified Chinese source :p:h/menu_zh_cn.gb2312.vim vim-7.4.1689/runtime/lang/menu_zh_cn.cp936.vim000066400000000000000000000001421267703067000207030ustar00rootroot00000000000000" Menu Translations: Simplified Chinese (for Windows) source :p:h/menu_chinese_gb.936.vim vim-7.4.1689/runtime/lang/menu_zh_cn.gb2312.vim000066400000000000000000000246261267703067000207540ustar00rootroot00000000000000" Menu Translations: Simplified Chinese " Maintainer: Shun Bai " Previous Maintainer: Yuheng Xie " Last Change: 2014 Oct 15 " vim: ts=8 sw=8 noet " Quit when menu translations have already been done. if exists("did_menu_trans") finish endif let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim " This causes trouble for a broken iconv (symptom: last character is always " ??). Without this it works fine anyway, because gbk/cp936 is a superset of " gb2312. (suggested by Edward L. Fox) " scriptencoding gb2312 " Help menu menutrans &Help (&H) menutrans &Overview (&O) menutrans &User\ Manual ûֲ(&U) menutrans &How-to\ links How-to\ ָ(&H) menutrans &Find\.\.\. (&F)\.\.\. menutrans &Credits л(&C) menutrans Co&pying Ȩ(&P) menutrans &Sponsor/Register /ע(&S) menutrans O&rphans ¶(&R) menutrans &Version 汾(&V) menutrans &About (&A) " File menu menutrans &File ļ(&F) menutrans &Open\.\.\.:e (&O)\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp ָ(&L)\.\.\.:sp menutrans Open\ Tab\.\.\.:tabnew 򿪱ǩ\.\.\.:tabnew menutrans &New:enew ½(&N):enew menutrans &Close:close ر(&C):close menutrans &Save:w (&S):w menutrans Save\ &As\.\.\.:sav Ϊ(&A)\.\.\.:sav menutrans Split\ &Diff\ with\.\.\. ָȽ(Diff)(&D)\.\.\. menutrans Split\ Patched\ &By\.\.\. ָ򲹶(Patch)(&B)\.\.\. menutrans &Print ӡ(&P) menutrans Sa&ve-Exit:wqa 沢˳(&V):wqa menutrans E&xit:qa ˳(&X):qa " Edit menu menutrans &Edit ༭(&E) menutrans &Undou (&U)u menutrans &Redo^R (&R)^R menutrans Rep&eat\. ظϴβ(&E)\. menutrans Cu&t"+x (&T)"+x menutrans &Copy"+y (&C)"+y menutrans &Paste"+gP ճ(&P)"+gP menutrans Put\ &Before[p ճǰ(&B)[p menutrans Put\ &After]p ճ(&A)]p menutrans &Deletex ɾ(&D)x menutrans &Select\ AllggVG ȫѡ(&S)ggVG menutrans &Find\.\.\. (&F)\.\.\. menutrans Find\ and\ Rep&lace\.\.\. Һ滻(&L)\.\.\. menutrans &Find/ (&F)/ menutrans Find\ and\ Rep&lace:%s Һ滻(&L):%s menutrans Settings\ &Window 趨(&W) menutrans Startup\ &Settings 趨(&S) menutrans &Global\ Settings ȫ趨(&G) " Edit/Global Settings menutrans Toggle\ Pattern\ &Highlight:set\ hls! /ģʽ(&H):set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! /غԴСд(&I):set\ ic! menutrans Toggle\ &Showmatch:set\ sm! /ʾ(&S):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:set\ im! /زģʽ(&M):set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! /\ Vi\ :set\ cp! menutrans Search\ &Path\.\.\. ·(&P)\.\.\. menutrans Ta&g\ Files\.\.\. Tag\ ļ(&T)\.\.\. " 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:set\ nu! /ʾк(&N):set\ nu! menutrans Toggle\ relati&ve\ Line\ Numbering:set\ rnu! /к(&V):set\ rnu! menutrans Toggle\ &List\ Mode:set\ list! /\ list\ ģʽ(&L):set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! /(&W):set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! /(&R):set\ lbr! menutrans Toggle\ &expand-tab:set\ et! /չ\ tab(&E):set\ et! menutrans Toggle\ &auto-indent:set\ ai! /Զ(&A):set\ ai! menutrans Toggle\ &C-indenting:set\ cin! /\ C\ (&C):set\ cin! " other options menutrans &Shiftwidth (&S) menutrans Soft\ &Tabstop Soft\ Tab\ (&T) menutrans Te&xt\ Width\.\.\. ı(&X)\.\.\. menutrans &File\ Format\.\.\. ļʽ(&F)\.\.\. menutrans C&olor\ Scheme ɫ(&O) menutrans Select\ Fo&nt\.\.\. ѡ(&N)\.\.\. menutrans &Keymap ӳ(&K) " Programming menu menutrans &Tools (&T) menutrans &Jump\ to\ this\ tagg^] ת\ tag(&J)g^] menutrans Jump\ &back^T ת(&B)^T menutrans Build\ &Tags\ File \ Tags\ ļ(&T) " Tools.Spelling Menu menutrans &Spelling ƴд(&S) menutrans &Spell\ Check\ On ƴд(&S) menutrans Spell\ Check\ &Off رƴд(&O) menutrans To\ &Next\ error]s һ(&N)]s menutrans To\ &Previous\ error[s һ(&P)[s menutrans Suggest\ &Correctionsz= (&C)z= menutrans &Repeat\ correction:spellrepall ظ(&R):spellrepall menutrans Set\ language\ to\ "en" 趨Ϊ\ "en" menutrans Set\ language\ to\ "en_au" 趨Ϊ\ "en_au" menutrans Set\ language\ to\ "en_ca" 趨Ϊ\ "en_ca" menutrans Set\ language\ to\ "en_gb" 趨Ϊ\ "en_gb" menutrans Set\ language\ to\ "en_nz" 趨Ϊ\ "en_nz" menutrans Set\ language\ to\ "en_us" 趨Ϊ\ "en_us" menutrans &Find\ More\ Languages Ҹ(&F) " Tools.Fold Menu " open close folds menutrans &Folding ۵(&F) menutrans &Enable/Disable\ foldszi /۵(&E)zi menutrans &View\ Cursor\ Linezv 鿴(&V)zv menutrans Vie&w\ Cursor\ Line\ onlyzMzx 鿴(&W)zMzx menutrans C&lose\ more\ foldszm رո۵(&L)zm menutrans &Close\ all\ foldszM ر۵(&C)zM menutrans O&pen\ more\ foldszr 򿪸۵(&P)zr menutrans &Open\ all\ foldszR ۵(&O)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)(&D) menutrans Ma&rker (&R) " create and delete folds menutrans Create\ &Foldzf ۵(&F)zf menutrans &Delete\ Foldzd ɾ۵(&D)zd menutrans Delete\ &All\ FoldszD ɾ۵(&A)zD " moving around in folds menutrans Fold\ column\ &width ۵(&W) " Tools.Diff Menu menutrans &Diff Ƚ(Diff)(&D) menutrans &Update (&U) menutrans &Get\ Block õ(&G) menutrans &Put\ Block ÿ(&P) menutrans &Make:make Make(&M):make menutrans &List\ Errors:cl г(&L):cl menutrans L&ist\ Messages:cl! гϢ(&I):cl! menutrans &Next\ Error:cn һ(&N):cn menutrans &Previous\ Error:cp һ(&P):cp menutrans &Older\ List:cold ɵĴб(&O):cold menutrans N&ewer\ List:cnew µĴб(&E):cnew menutrans Error\ &Window 󴰿(&W) menutrans &Update:cwin (&U):cwin menutrans &Open:copen (&O):copen menutrans &Close:cclose ر(&C):cclose menutrans &Convert\ to\ HEX:%!xxd תʮ:%!xxd menutrans Conve&rt\ back:%!xxd\ -r ת:%!xxd\ -r menutrans Se&T\ Compiler 趨(&T) " 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^Wn ½(&N)^Wn menutrans S&plit^Ws ָ(&P)^Ws menutrans Sp&lit\ To\ #^W^^ ָ\ #(&L)^W^^ menutrans Split\ &Vertically^Wv ֱָ(&V)^Wv menutrans Split\ File\ E&xplorer ָļ(&X) menutrans &Close^Wc ر(&C)^Wc menutrans Close\ &Other(s)^Wo ر(&O)^Wo menutrans Move\ &To ƶ(&T) menutrans &Top^WK (&T)^WK menutrans &Bottom^WJ ׶(&B)^WJ menutrans &Left\ side^WH (&L)^WH menutrans &Right\ side^WL ұ(&R)^WL " menutrans Ne&xt^Ww һ(&X)^Ww " menutrans P&revious^WW һ(&R)^WW menutrans Rotate\ &Up^WR ֻ(&U)^WR menutrans Rotate\ &Down^Wr ֻ(&D)^Wr menutrans &Equal\ Size^W= ȴ(&E)^W= menutrans &Max\ Height^W_ ߶(&M)^W menutrans M&in\ Height^W1_ С߶(&I)^W1_ menutrans Max\ &Width^W\| (&W)^W\| menutrans Min\ Widt&h^W1\| С(&H)^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\ &Sentence ѡ(&S) menutrans Select\ Pa&ragraph ѡ(&R) 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 (:make) tmenu ToolBar.RunCtags ڵǰĿ¼ tags (!ctags -R .) tmenu ToolBar.TagJump תλõ tag tmenu ToolBar.Help Vim tmenu ToolBar.FindHelp Vim endfun endif " Syntax menu menutrans &Syntax ﷨(&S) menutrans &Show\ filetypes\ in\ menu ڲ˵ʾļ(&S) 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) menutrans Set\ '&syntax'\ only 趨\ 'syntax'(&S) menutrans Set\ '&filetype'\ too Ҳ趨\ 'filetype'(&F) let &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/lang/menu_zh_cn.gbk.vim000066400000000000000000000001221267703067000206000ustar00rootroot00000000000000" Menu Translations: Simplified Chinese source :p:h/menu_zh_cn.gb2312.vim vim-7.4.1689/runtime/lang/menu_zh_cn.utf-8.vim000066400000000000000000000257271267703067000210220ustar00rootroot00000000000000" Menu Translations: Simplified Chinese " Maintainer: Shun Bai " Previous Maintainer: Yuheng Xie " Last Change: 2014 Oct 15 " vim: ts=8 sw=8 noet " Quit when menu translations have already been done. if exists("did_menu_trans") finish endif let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim scriptencoding utf-8 " Help menu menutrans &Help 帮助(&H) menutrans &Overview 纵览(&O) menutrans &User\ Manual 用户手册(&U) menutrans &How-to\ links How-to\ 指引(&H) menutrans &Find\.\.\. 查找(&F)\.\.\. menutrans &Credits 致谢(&C) menutrans Co&pying 版权(&P) menutrans &Sponsor/Register 赞助/注册(&S) menutrans O&rphans 孤儿(&R) menutrans &Version 版本(&V) menutrans &About 关于(&A) " File menu menutrans &File 文件(&F) menutrans &Open\.\.\.:e 打开(&O)\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp 分割并打开(&L)\.\.\.:sp menutrans Open\ Tab\.\.\.:tabnew 打开标签\.\.\.:tabnew menutrans &New:enew 新建(&N):enew menutrans &Close:close 关闭(&C):close menutrans &Save:w 保存(&S):w menutrans Save\ &As\.\.\.:sav 另存为(&A)\.\.\.:sav menutrans Split\ &Diff\ with\.\.\. 分割比较(Diff)(&D)\.\.\. menutrans Split\ Patched\ &By\.\.\. 分割打补丁(Patch)(&B)\.\.\. menutrans &Print 打印(&P) menutrans Sa&ve-Exit:wqa 保存并退出(&V):wqa menutrans E&xit:qa 退出(&X):qa " Edit menu menutrans &Edit 编辑(&E) menutrans &Undou 撤销(&U)u menutrans &Redo^R 重做(&R)^R menutrans Rep&eat\. 重复上次操作(&E)\. menutrans Cu&t"+x 剪切(&T)"+x menutrans &Copy"+y 复制(&C)"+y menutrans &Paste"+gP 粘贴(&P)"+gP menutrans Put\ &Before[p 粘贴到光标前(&B)[p menutrans Put\ &After]p 粘贴到光标后(&A)]p menutrans &Deletex 删除(&D)x menutrans &Select\ AllggVG 全选(&S)ggVG menutrans &Find\.\.\. 查找(&F)\.\.\. menutrans Find\ and\ Rep&lace\.\.\. 查找和替换(&L)\.\.\. menutrans &Find/ 查找(&F)/ menutrans Find\ and\ Rep&lace:%s 查找和替换(&L):%s menutrans Settings\ &Window 设定窗口(&W) menutrans Startup\ &Settings 启动设定(&S) menutrans &Global\ Settings 全局设定(&G) " Edit/Global Settings menutrans Toggle\ Pattern\ &Highlight:set\ hls! 开/关模式高亮(&H):set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! 开/关忽略大小写(&I):set\ ic! menutrans Toggle\ &Showmatch:set\ sm! 开/关显示配对(&S):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:set\ im! 开/关插入模式(&M):set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! 开/关\ Vi\ 兼容:set\ cp! menutrans Search\ &Path\.\.\. 查找路径(&P)\.\.\. menutrans Ta&g\ Files\.\.\. Tag\ 文件(&T)\.\.\. " 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:set\ nu! 开/关显示行号(&N):set\ nu! menutrans Toggle\ relati&ve\ Line\ Numbering:set\ rnu! 开/关相对行号(&V):set\ rnu! menutrans Toggle\ &List\ Mode:set\ list! 开/关\ list\ 模式(&L):set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! 开/关折行(&W):set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! 开/关整词折行(&R):set\ lbr! menutrans Toggle\ &expand-tab:set\ et! 开/关扩展\ tab(&E):set\ et! menutrans Toggle\ &auto-indent:set\ ai! 开/关自动缩进(&A):set\ ai! menutrans Toggle\ &C-indenting:set\ cin! 开/关\ C\ 缩进(&C):set\ cin! " other options menutrans &Shiftwidth 缩进宽度(&S) menutrans Soft\ &Tabstop Soft\ Tab\ 宽度(&T) menutrans Te&xt\ Width\.\.\. 文本宽度(&X)\.\.\. menutrans &File\ Format\.\.\. 文件格式(&F)\.\.\. menutrans C&olor\ Scheme 配色方案(&O) menutrans Select\ Fo&nt\.\.\. 选择字体(&N)\.\.\. menutrans &Keymap 键盘映射(&K) " Programming menu menutrans &Tools 工具(&T) menutrans &Jump\ to\ this\ tagg^] 跳转到这个\ tag(&J)g^] menutrans Jump\ &back^T 跳转返回(&B)^T menutrans Build\ &Tags\ File 建立\ Tags\ 文件(&T) " Tools.Spelling Menu menutrans &Spelling 拼写检查(&S) menutrans &Spell\ Check\ On 打开拼写检查(&S) menutrans Spell\ Check\ &Off 关闭拼写检查(&O) menutrans To\ &Next\ error]s 上一个错误(&N)]s menutrans To\ &Previous\ error[s 下一个错误(&P)[s menutrans Suggest\ &Correctionsz= 修正建议(&C)z= menutrans &Repeat\ correction:spellrepall 重复修正(&R):spellrepall menutrans Set\ language\ to\ "en" 设定语言为\ "en" menutrans Set\ language\ to\ "en_au" 设定语言为\ "en_au" menutrans Set\ language\ to\ "en_ca" 设定语言为\ "en_ca" menutrans Set\ language\ to\ "en_gb" 设定语言为\ "en_gb" menutrans Set\ language\ to\ "en_nz" 设定语言为\ "en_nz" menutrans Set\ language\ to\ "en_us" 设定语言为\ "en_us" menutrans &Find\ More\ Languages 查找更多语言(&F) " Tools.Fold Menu " open close folds menutrans &Folding 折叠(&F) menutrans &Enable/Disable\ foldszi 启用/禁用折叠(&E)zi menutrans &View\ Cursor\ Linezv 查看此行(&V)zv menutrans Vie&w\ Cursor\ Line\ onlyzMzx 仅查看此行(&W)zMzx menutrans C&lose\ more\ foldszm 关闭更多折叠(&L)zm menutrans &Close\ all\ foldszM 关闭所有折叠(&C)zM menutrans O&pen\ more\ foldszr 打开更多折叠(&P)zr menutrans &Open\ all\ foldszR 打开所有折叠(&O)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)(&D) menutrans Ma&rker 标记(&R) " create and delete folds menutrans Create\ &Foldzf 创建折叠(&F)zf menutrans &Delete\ Foldzd 删除折叠(&D)zd menutrans Delete\ &All\ FoldszD 删除所有折叠(&A)zD " moving around in folds menutrans Fold\ column\ &width 折叠栏宽度(&W) " Tools.Diff Menu menutrans &Diff 比较(Diff)(&D) menutrans &Update 更新(&U) menutrans &Get\ Block 得到块(&G) menutrans &Put\ Block 放置块(&P) menutrans &Make:make Make(&M):make menutrans &List\ Errors:cl 列出错误(&L):cl menutrans L&ist\ Messages:cl! 列出消息(&I):cl! menutrans &Next\ Error:cn 下一个错误(&N):cn menutrans &Previous\ Error:cp 上一个错误(&P):cp menutrans &Older\ List:cold 更旧的错误列表(&O):cold menutrans N&ewer\ List:cnew 更新的错误列表(&E):cnew menutrans Error\ &Window 错误窗口(&W) menutrans &Update:cwin 更新(&U):cwin menutrans &Open:copen 打开(&O):copen menutrans &Close:cclose 关闭(&C):cclose menutrans &Convert\ to\ HEX:%!xxd 转换成十六进制:%!xxd menutrans Conve&rt\ back:%!xxd\ -r 转换返回:%!xxd\ -r menutrans Se&T\ Compiler 设定编译器(&T) " 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^Wn 新建(&N)^Wn menutrans S&plit^Ws 分割(&P)^Ws menutrans Sp&lit\ To\ #^W^^ 分割到\ #(&L)^W^^ menutrans Split\ &Vertically^Wv 垂直分割(&V)^Wv menutrans Split\ File\ E&xplorer 分割文件浏览器(&X) menutrans &Close^Wc 关闭(&C)^Wc menutrans Close\ &Other(s)^Wo 关闭其它窗口(&O)^Wo menutrans Move\ &To 移动到(&T) menutrans &Top^WK 顶端(&T)^WK menutrans &Bottom^WJ 底端(&B)^WJ menutrans &Left\ side^WH 左边(&L)^WH menutrans &Right\ side^WL 右边(&R)^WL " menutrans Ne&xt^Ww 下一个(&X)^Ww " menutrans P&revious^WW 上一个(&R)^WW menutrans Rotate\ &Up^WR 向上轮换(&U)^WR menutrans Rotate\ &Down^Wr 向下轮换(&D)^Wr menutrans &Equal\ Size^W= 等大(&E)^W= menutrans &Max\ Height^W_ 最大高度(&M)^W menutrans M&in\ Height^W1_ 最小高度(&I)^W1_ menutrans Max\ &Width^W\| 最大宽度(&W)^W\| menutrans Min\ Widt&h^W1\| 最小宽度(&H)^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\ &Sentence 选择句子(&S) menutrans Select\ Pa&ragraph 选择段落(&R) 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 (:make) tmenu ToolBar.RunCtags 在当前目录建立 tags (!ctags -R .) tmenu ToolBar.TagJump 跳转到光标位置的 tag tmenu ToolBar.Help Vim 帮助 tmenu ToolBar.FindHelp 查找 Vim 帮助 endfun endif " Syntax menu menutrans &Syntax 语法(&S) menutrans &Show\ filetypes\ in\ menu 在菜单中显示文件类型(&S) 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) menutrans Set\ '&syntax'\ only 仅设定\ 'syntax'(&S) menutrans Set\ '&filetype'\ too 也设定\ 'filetype'(&F) let &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/lang/menu_zh_tw.big5.vim000066400000000000000000000001311267703067000207150ustar00rootroot00000000000000" Menu Translations: Traditional Chinese source :p:h/menu_chinese_taiwan.950.vim vim-7.4.1689/runtime/lang/menu_zh_tw.cp950.vim000066400000000000000000000001311267703067000207270ustar00rootroot00000000000000" Menu Translations: Traditional Chinese source :p:h/menu_chinese_taiwan.950.vim vim-7.4.1689/runtime/lang/menu_zh_tw.utf-8.vim000066400000000000000000000324171267703067000210460ustar00rootroot00000000000000" Menu Translations: Traditional Chinese " Translated By: Hung-Te Lin " Last Change: 2012 May 01 " {{{ Quit when menu translations have already been done. if exists("did_menu_trans") finish endif let did_menu_trans = 1 " }}} let s:keepcpo= &cpo set cpo&vim scriptencoding utf-8 " {{{ Help menu: complete menutrans &Help 輔助說明(&H) " ------------------------------------------------------------------------ menutrans &Overview 說明文件總覽(&O) menutrans &User\ Manual 使用者手冊(&U) menutrans &How-to\ links 如何作\.\.\.(&H) menutrans &GUI 圖型界面(&G) menutrans &Credits 感謝(&C) menutrans Co&pying 版權(&P) menutrans &Sponsor/Register 贊助/註冊(&S) menutrans O&rphans 拯救孤兒(&R) " ------------------------------------------------------------------------ menutrans &Version 程式版本資訊(&V) menutrans &About 關於\ Vim(&A) " }}} " {{{ File menu: complete menutrans &File 檔案(&F) " ------------------------------------------------------------------------ menutrans &Open\.\.\.:e 開啟(&O)\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp 分割視窗並開啟(&L):sp menutrans &New:enew 編輯新檔案(&N):enew menutrans &Close:close 關閉檔案(&C):close " ------------------------------------------------------------------------ menutrans &Save:w 儲存(&S):w menutrans Save\ &As\.\.\.:sav 另存新檔(&A)\.\.\.:sav " ------------------------------------------------------------------------ menutrans Split\ &Diff\ with\.\.\. 比較(&Diff)\.\.\. menutrans Split\ Patched\ &By\.\.\. 執行Patch(&B)\.\.\. " ------------------------------------------------------------------------ menutrans &Print 列印(&P) " ------------------------------------------------------------------------ menutrans Sa&ve-Exit:wqa 儲存並離開(&V):wqa menutrans E&xit:qa 離開(&X):qa " }}} " {{{ Edit menu menutrans &Edit 編輯(&E) " ------------------------------------------------------------------------ menutrans &Undou 復原(&U)u menutrans &Redo^R 取消上次復原(&R)^R menutrans Rep&eat\. 重複上次動作(&E)\. " ------------------------------------------------------------------------ menutrans Cu&t"+x 剪下(&T)"+x menutrans &Copy"+y 複製(&C)"+y menutrans &Paste"+gP 貼上(&P)"+gP menutrans Put\ &Before[p 貼到游標前(&B)[p menutrans Put\ &After]p 貼到游標後(&A)]p menutrans &Deletex 刪除(&D)x menutrans &Select\ AllggVG 全選(&S)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:set\ nu! 切換顯示行號(&N):set\ nu! menutrans Toggle\ &List\ Mode:set\ list! 切換顯示行尾及TAB(&L):set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! 切換自動折行顯示(&W):set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! 切換折行顯示可任意斷句(&R):set\ lbr! menutrans Toggle\ &expand-tab:set\ et! 切換展開TAB(&E):set\ et! menutrans Toggle\ &auto-indent:set\ ai! 切換自動縮排(&A):set\ ai! menutrans Toggle\ &C-indenting:set\ cin! 切換C語言縮排(&C):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:set\ hls! 切換高亮度搜尋字串(&H):set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! 切換忽略大小寫(&I):set\ ic! menutrans Toggle\ &Showmatch:set\ sm! 切換顯示對應括號(&S):set\ sm! menutrans Toggle\ Vi\ C&ompatible:set\ cp! 切換傳統Vi相容模式(&O):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:set\ im! 切換插入模式(&M):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\ tagg^] 檢索游標處的標籤關鍵字(tag)(&J)g^] menutrans Jump\ &back^T 跳回檢索前的位置(&B)^T menutrans Build\ &Tags\ File 建立標籤索引檔\ Tags(&T) " ------------------------------------------------------------------------ menutrans &Folding 覆疊(Fold)設定(&F) " {{{ Tools.Fold menutrans &Enable/Disable\ foldszi 切換使用\ Folding(&E)zi menutrans &View\ Cursor\ Linezv 檢視此層\ Fold(&V)zv menutrans Vie&w\ Cursor\ Line\ onlyzMzx 只檢視此\ Fold(&W)zMzx menutrans C&lose\ more\ foldszm 收起一層\ Folds(&L)zm menutrans &Close\ all\ foldszM 收起所有\ Folds(&C)zM menutrans O&pen\ more\ foldszr 打開一層\ Folds(&P)zr menutrans &Open\ all\ foldszR 打開所有\ Folds(&O)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\ &Foldzf 建立\ Fold(&F)zf menutrans &Delete\ Foldzd 刪除\ Fold(&D)zd menutrans Delete\ &All\ FoldszD 刪除所有\ Fold(&A)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:make 執行\ Make(&M):make menutrans &List\ Errors:cl 列出編譯錯誤(&E):cl menutrans L&ist\ Messages:cl! 列出所有訊息(&I):cl! menutrans &Next\ Error:cn 下一個編譯錯誤處(&N):cn menutrans &Previous\ Error:cp 上一個編譯錯誤處(&P):cp menutrans &Older\ List:cold 檢視舊錯誤列表(&O):cold menutrans N&ewer\ List:cnew 檢視新錯誤列表(&E):cnew menutrans Error\ &Window 錯誤訊息視窗(&W) " {{{ Tools.ErrorWindow menutrans &Update:cwin 更新(&U):cwin menutrans &Open:copen 開啟(&O):copen menutrans &Close:cclose 關閉(&C):cclose " }}} menutrans &Set\ Compiler 設定編譯器Compiler(&S) " ------------------------------------------------------------------------ menutrans &Convert\ to\ HEX:%!xxd 轉換成16進位碼(&C):%!xxd menutrans Conve&rt\ back:%!xxd\ -r 從16進位碼轉換回文字(&R):%!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^Wn 開新視窗(&N)^Wn menutrans S&plit^Ws 分割視窗(&P)^Ws menutrans Sp&lit\ To\ #^W^^ 分割到#(&L)^W^^ menutrans Split\ &Vertically^Wv 垂直分割(&V)^Wv menutrans Split\ File\ E&xplorer 檔案總管式分割(&X) " ------------------------------------------------------------------------ menutrans &Close^Wc 關閉視窗(&C)^Wc menutrans Close\ &Other(s)^Wo 關閉其它視窗(&O)^Wo " ------------------------------------------------------------------------ menutrans Move\ &To 移至(&T) " {{{ Window.MoveTo menutrans &Top^WK 頂端(&T)^WK menutrans &Bottom^WJ 底端(&B)^WJ menutrans &Left\ side^WH 左邊(&L)^WH menutrans &Right\ side^WL 右邊(&R)^WL " }}} menutrans Rotate\ &Up^WR 上移視窗(&U)^WR menutrans Rotate\ &Down^Wr 下移視窗(&D)^Wr " ------------------------------------------------------------------------ menutrans &Equal\ Size^W= 所有視窗等高(&E)^W= menutrans &Max\ Height^W_ 最大高度(&M)^W menutrans M&in\ Height^W1_ 最小高度(&I)^W1_ menutrans Max\ &Width^W\| 最大寬度(&W)^W\| menutrans Min\ Widt&h^W1\| 最小寬度(&H)^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 " }}} let &cpo = s:keepcpo unlet s:keepcpo " vim:foldmethod=marker:nowrap:foldcolumn=2:foldlevel=1 vim-7.4.1689/runtime/macmap.vim000066400000000000000000000045761267703067000162470ustar00rootroot00000000000000" System gvimrc file for Mac OS X " Author: Benji Fisher " Last Change: Thu Mar 09 09:00 AM 2006 EST " " Define Mac-standard keyboard shortcuts. " We don't change 'cpoptions' here, because it would not be set properly when " a .vimrc file is found later. Thus don't use line continuation and use " in mappings. nnoremap :confirm enew vmap gv imap cmap omap nnoremap :browse confirm e vmap gv imap cmap omap nnoremap :if winheight(2) < 0 confirm enew else confirm close endif vmap gv imap cmap omap nnoremap :if expand("%") == ""browse confirm w elseconfirm wendif vmap gv imap cmap omap nnoremap :browse confirm saveas vmap gv imap cmap omap " From the Edit menu of SimpleText: nnoremap u vmap gv imap cmap omap vnoremap "+x vnoremap "+y cnoremap nnoremap "+gP cnoremap + execute 'vnoremap " \ ]) call extend(s:lines, [""]) if !empty(s:settings.prevent_copy) call extend(s:lines, \ ["", \ "", \ "

0
", \ "
", \ "
" \ ]) else call extend(s:lines, [""]) endif if s:settings.no_pre " if we're not using CSS we use a font tag which can't have a div inside if s:settings.use_css call extend(s:lines, ["
"]) endif else call extend(s:lines, ["
"])
endif

exe s:orgwin . "wincmd w"

" caches of style data
" initialize to include line numbers if using them
if s:settings.number_lines
  let s:stylelist = { s:LINENR_ID : ".LineNr { " . s:CSS1( s:LINENR_ID ) . "}" }
else
  let s:stylelist = {}
endif
let s:diffstylelist = {
      \   s:DIFF_A_ID : ".DiffAdd { " . s:CSS1( s:DIFF_A_ID ) . "}",
      \   s:DIFF_C_ID : ".DiffChange { " . s:CSS1( s:DIFF_C_ID ) . "}",
      \   s:DIFF_D_ID : ".DiffDelete { " . s:CSS1( s:DIFF_D_ID ) . "}",
      \   s:DIFF_T_ID : ".DiffText { " . s:CSS1( s:DIFF_T_ID ) . "}"
      \ }

" set up progress bar in the status line
if !s:settings.no_progress
  " ProgressBar Indicator
  let s:progressbar={}

  " Progessbar specific functions
  func! s:ProgressBar(title, max_value, winnr)
    let pgb=copy(s:progressbar)
    let pgb.title = a:title.' '
    let pgb.max_value = a:max_value
    let pgb.winnr = a:winnr
    let pgb.cur_value = 0
    let pgb.items = { 'title'   : { 'color' : 'Statusline' },
	  \'bar'     : { 'color' : 'Statusline' , 'fillcolor' : 'DiffDelete' , 'bg' : 'Statusline' } ,
	  \'counter' : { 'color' : 'Statusline' } }
    let pgb.last_value = 0
    let pgb.needs_redraw = 0
    " Note that you must use len(split) instead of len() if you want to use 
    " unicode in title.
    "
    " Subtract 3 for spacing around the title.
    " Subtract 4 for the percentage display.
    " Subtract 2 for spacing before this.
    " Subtract 2 more for the '|' on either side of the progress bar
    let pgb.subtractedlen=len(split(pgb.title, '\zs'))+3+4+2+2
    let pgb.max_len = 0
    set laststatus=2
    return pgb
  endfun

  " Function: progressbar.calculate_ticks() {{{1
  func! s:progressbar.calculate_ticks(pb_len)
    if a:pb_len<=0
      let pb_len = 100
    else
      let pb_len = a:pb_len
    endif
    let self.progress_ticks = map(range(pb_len+1), "v:val * self.max_value / pb_len")
  endfun

  "Function: progressbar.paint()
  func! s:progressbar.paint()
    " Recalculate widths.
    let max_len = winwidth(self.winnr)
    let pb_len = 0
    " always true on first call because of initial value of self.max_len
    if max_len != self.max_len
      let self.max_len = max_len

      " Progressbar length
      let pb_len = max_len - self.subtractedlen

      call self.calculate_ticks(pb_len)

      let self.needs_redraw = 1
      let cur_value = 0
      let self.pb_len = pb_len
    else
      " start searching at the last found index to make the search for the
      " appropriate tick value normally take 0 or 1 comparisons
      let cur_value = self.last_value
      let pb_len = self.pb_len
    endif

    let cur_val_max = pb_len > 0 ? pb_len : 100

    " find the current progress bar position based on precalculated thresholds
    while cur_value < cur_val_max && self.cur_value > self.progress_ticks[cur_value]
      let cur_value += 1
    endwhile

    " update progress bar
    if self.last_value != cur_value || self.needs_redraw || self.cur_value == self.max_value
      let self.needs_redraw = 1
      let self.last_value = cur_value

      let t_color  = self.items.title.color
      let b_fcolor = self.items.bar.fillcolor
      let b_color  = self.items.bar.color
      let c_color  = self.items.counter.color

      let stl =  "%#".t_color."#%-( ".self.title." %)".
	    \"%#".b_color."#".
	    \(pb_len>0 ?
	    \	('|%#'.b_fcolor."#%-(".repeat(" ",cur_value)."%)".
	    \	 '%#'.b_color."#".repeat(" ",pb_len-cur_value)."|"):
	    \	('')).
	    \"%=%#".c_color."#%( ".printf("%3.d ",100*self.cur_value/self.max_value)."%% %)"
      call setwinvar(self.winnr, '&stl', stl)
    endif
  endfun

  func! s:progressbar.incr( ... )
    let self.cur_value += (a:0 ? a:1 : 1)
    " if we were making a general-purpose progress bar, we'd need to limit to a
    " lower limit as well, but since we always increment with a positive value
    " in this script, we only need limit the upper value
    let self.cur_value = (self.cur_value > self.max_value ? self.max_value : self.cur_value)
    call self.paint()
  endfun
  " }}}
  if s:settings.dynamic_folds
    " to process folds we make two passes through each line
    let s:pgb = s:ProgressBar("Processing folds:", line('$')*2, s:orgwin)
  endif
endif

" First do some preprocessing for dynamic folding. Do this for the entire file
" so we don't accidentally start within a closed fold or something.
let s:allfolds = []

if s:settings.dynamic_folds
  let s:lnum = 1
  let s:end = line('$')
  " save the fold text and set it to the default so we can find fold levels
  let s:foldtext_save = &foldtext
  setlocal foldtext&

  " we will set the foldcolumn in the html to the greater of the maximum fold
  " level and the current foldcolumn setting
  let s:foldcolumn = &foldcolumn

  " get all info needed to describe currently closed folds
  while s:lnum <= s:end
    if foldclosed(s:lnum) == s:lnum
      " default fold text has '+-' and then a number of dashes equal to fold
      " level, so subtract 2 from index of first non-dash after the dashes
      " in order to get the fold level of the current fold
      let s:level = match(foldtextresult(s:lnum), '+-*\zs[^-]') - 2
      " store fold info for later use
      let s:newfold = {'firstline': s:lnum, 'lastline': foldclosedend(s:lnum), 'level': s:level,'type': "closed-fold"}
      call add(s:allfolds, s:newfold)
      " open the fold so we can find any contained folds
      execute s:lnum."foldopen"
    else
      if !s:settings.no_progress
	call s:pgb.incr()
	if s:pgb.needs_redraw
	  redrawstatus
	  let s:pgb.needs_redraw = 0
	endif
      endif
      let s:lnum = s:lnum + 1
    endif
  endwhile

  " close all folds to get info for originally open folds
  silent! %foldclose!
  let s:lnum = 1

  " the originally open folds will be all folds we encounter that aren't
  " already in the list of closed folds
  while s:lnum <= s:end
    if foldclosed(s:lnum) == s:lnum
      " default fold text has '+-' and then a number of dashes equal to fold
      " level, so subtract 2 from index of first non-dash after the dashes
      " in order to get the fold level of the current fold
      let s:level = match(foldtextresult(s:lnum), '+-*\zs[^-]') - 2
      let s:newfold = {'firstline': s:lnum, 'lastline': foldclosedend(s:lnum), 'level': s:level,'type': "closed-fold"}
      " only add the fold if we don't already have it
      if empty(s:allfolds) || index(s:allfolds, s:newfold) == -1
	let s:newfold.type = "open-fold"
	call add(s:allfolds, s:newfold)
      endif
      " open the fold so we can find any contained folds
      execute s:lnum."foldopen"
    else
      if !s:settings.no_progress
	call s:pgb.incr()
	if s:pgb.needs_redraw
	  redrawstatus
	  let s:pgb.needs_redraw = 0
	endif
      endif
      let s:lnum = s:lnum + 1
    endif
  endwhile

  " sort the folds so that we only ever need to look at the first item in the
  " list of folds
  call sort(s:allfolds, "s:FoldCompare")

  let &l:foldtext = s:foldtext_save
  unlet s:foldtext_save

  " close all folds again so we can get the fold text as we go
  silent! %foldclose!

  " Go through and remove folds we don't need to (or cannot) process in the
  " current conversion range
  "
  " If a fold is removed which contains other folds, which are included, we need
  " to adjust the level of the included folds as used by the conversion logic
  " (avoiding special cases is good)
  "
  " Note any time we remove a fold, either all of the included folds are in it,
  " or none of them, because we only remove a fold if neither its start nor its
  " end are within the conversion range.
  let leveladjust = 0
  for afold in s:allfolds
    let removed = 0
    if exists("g:html_start_line") && exists("g:html_end_line")
      if afold.firstline < g:html_start_line
	if afold.lastline <= g:html_end_line && afold.lastline >= g:html_start_line
	  " if a fold starts before the range to convert but stops within the
	  " range, we need to include it. Make it start on the first converted
	  " line.
	  let afold.firstline = g:html_start_line
	else
	  " if the fold lies outside the range or the start and stop enclose
	  " the entire range, don't bother parsing it
	  call remove(s:allfolds, index(s:allfolds, afold))
	  let removed = 1
	  if afold.lastline > g:html_end_line
	    let leveladjust += 1
	  endif
	endif
      elseif afold.firstline > g:html_end_line
	" If the entire fold lies outside the range we need to remove it.
	call remove(s:allfolds, index(s:allfolds, afold))
	let removed = 1
      endif
    elseif exists("g:html_start_line")
      if afold.firstline < g:html_start_line
	" if there is no last line, but there is a first line, the end of the
	" fold will always lie within the region of interest, so keep it
	let afold.firstline = g:html_start_line
      endif
    elseif exists("g:html_end_line")
      " if there is no first line we default to the first line in the buffer so
      " the fold start will always be included if the fold itself is included.
      " If however the entire fold lies outside the range we need to remove it.
      if afold.firstline > g:html_end_line
	call remove(s:allfolds, index(s:allfolds, afold))
	let removed = 1
      endif
    endif
    if !removed
      let afold.level -= leveladjust
      if afold.level+1 > s:foldcolumn
	let s:foldcolumn = afold.level+1
      endif
    endif
  endfor

  " if we've removed folds containing the conversion range from processing,
  " getting foldtext as we go won't know to open the removed folds, so the
  " foldtext would be wrong; open them now.
  "
  " Note that only when a start and an end line is specified will a fold
  " containing the current range ever be removed.
  while leveladjust > 0
    exe g:html_start_line."foldopen"
    let leveladjust -= 1
  endwhile
endif

" Now loop over all lines in the original text to convert to html.
" Use html_start_line and html_end_line if they are set.
if exists("g: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("g: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

" stack to keep track of all the folds containing the current line
let s:foldstack = []

if !s:settings.no_progress
  let s:pgb = s:ProgressBar("Processing lines:", s:end - s:lnum + 1, s:orgwin)
endif

if s:settings.number_lines
  let s:margin = strlen(s:end) + 1
else
  let s:margin = 0
endif

if has('folding') && !s:settings.ignore_folding
  let s:foldfillchar = &fillchars[matchend(&fillchars, 'fold:')]
  if s:foldfillchar == ''
    let s:foldfillchar = '-'
  endif
endif
let s:difffillchar = &fillchars[matchend(&fillchars, 'diff:')]
if s:difffillchar == ''
  let s:difffillchar = '-'
endif

let s:foldId = 0

if !s:settings.expand_tabs
  " If keeping tabs, add them to printable characters so we keep them when
  " formatting text (strtrans() doesn't replace printable chars)
  let s:old_isprint = &isprint
  setlocal isprint+=9
endif

while s:lnum <= s:end

  " If there are filler lines for diff mode, show these above the line.
  let s:filler = diff_filler(s:lnum)
  if s:filler > 0
    let s:n = s:filler
    while s:n > 0
      let s:new = repeat(s:difffillchar, 3)

      if s:n > 2 && s:n < s:filler && !s:settings.whole_filler
	let s:new = s:new . " " . s:filler . " inserted lines "
	let s:n = 2
      endif

      if !s:settings.no_pre
	" HTML line wrapping is off--go ahead and fill to the margin
	" TODO: what about when CSS wrapping is turned on?
	let s:new = s:new . repeat(s:difffillchar, &columns - strlen(s:new) - s:margin)
      else
	let s:new = s:new . repeat(s:difffillchar, 3)
      endif

      let s:new = s:HtmlFormat_d(s:new, s:DIFF_D_ID, 0)
      if s:settings.number_lines
	" Indent if line numbering is on. Indent gets style of line number
	" column.
	let s:new = s:HtmlFormat_n(repeat(' ', s:margin), s:LINENR_ID, 0, 0) . s:new
      endif
      if s:settings.dynamic_folds && !s:settings.no_foldcolumn && s:foldcolumn > 0
	" Indent for foldcolumn if there is one. Assume it's empty, there should
	" not be a fold for deleted lines in diff mode.
	let s:new = s:FoldColumn_fill() . s:new
      endif
      call add(s:lines, s:new.s:HtmlEndline)

      let s:n = s:n - 1
    endwhile
    unlet s:n
  endif
  unlet s:filler

  " Start the line with the line number.
  if s:settings.number_lines
    let s:numcol = repeat(' ', s:margin - 1 - strlen(s:lnum)) . s:lnum . ' '
  endif

  let s:new = ""

  if has('folding') && !s:settings.ignore_folding && foldclosed(s:lnum) > -1 && !s:settings.dynamic_folds
    "
    " This is the beginning of a folded block (with no dynamic folding)
    let s:new = foldtextresult(s:lnum)
    if !s:settings.no_pre
      " HTML line wrapping is off--go ahead and fill to the margin
      let s:new = s:new . repeat(s:foldfillchar, &columns - strlen(s:new))
    endif

    " put numcol in a separate group for sake of unselectable text
    let s:new = (s:settings.number_lines ? s:HtmlFormat_n(s:numcol, s:FOLDED_ID, 0, s:lnum): "") . s:HtmlFormat_t(s:new, s:FOLDED_ID, 0)

    " Skip to the end of the fold
    let s:new_lnum = foldclosedend(s:lnum)

    if !s:settings.no_progress
      call s:pgb.incr(s:new_lnum - s:lnum)
    endif

    let s:lnum = s:new_lnum

  else
    "
    " A line that is not folded, or doing dynamic folding.
    "
    let s:line = getline(s:lnum)
    let s:len = strlen(s:line)

    if s:settings.dynamic_folds
      " First insert a closing for any open folds that end on this line
      while !empty(s:foldstack) && get(s:foldstack,0).lastline == s:lnum-1
	let s:new = s:new.""
	call remove(s:foldstack, 0)
      endwhile

      " Now insert an opening for any new folds that start on this line
      let s:firstfold = 1
      while !empty(s:allfolds) && get(s:allfolds,0).firstline == s:lnum
	let s:foldId = s:foldId + 1
	let s:new .= ""


	" Unless disabled, add a fold column for the opening line of a fold.
	"
	" Note that dynamic folds require using css so we just use css to take
	" care of the leading spaces rather than using   in the case of
	" html_no_pre to make it easier
	if !s:settings.no_foldcolumn
	  " add fold column that can open the new fold
	  if s:allfolds[0].level > 1 && s:firstfold
	    let s:new = s:new . s:FoldColumn_build('|', s:allfolds[0].level - 1, 0, "",
		  \ 'toggle-open FoldColumn','javascript:toggleFold("fold'.s:foldstack[0].id.s:settings.id_suffix.'");')
	  endif
	  " add the filler spaces separately from the '+' char so that it can be
	  " shown/hidden separately during a hover unfold
	  let s:new = s:new . s:FoldColumn_build("+", 1, 0, "",
		\ 'toggle-open FoldColumn', 'javascript:toggleFold("fold'.s:foldId.s:settings.id_suffix.'");')
	  " If this is not the last fold we're opening on this line, we need
	  " to keep the filler spaces hidden if the fold is opened by mouse
	  " hover. If it is the last fold to open in the line, we shouldn't hide
	  " them, so don't apply the toggle-filler class.
	  let s:new = s:new . s:FoldColumn_build(" ", 1, s:foldcolumn - s:allfolds[0].level - 1, "",
		\ 'toggle-open FoldColumn'. (get(s:allfolds, 1, {'firstline': 0}).firstline == s:lnum ?" toggle-filler" :""),
		\ 'javascript:toggleFold("fold'.s:foldId.s:settings.id_suffix.'");')

	  " add fold column that can close the new fold
	  " only add extra blank space if we aren't opening another fold on the
	  " same line
	  if get(s:allfolds, 1, {'firstline': 0}).firstline != s:lnum
	    let s:extra_space = s:foldcolumn - s:allfolds[0].level
	  else
	    let s:extra_space = 0
	  endif
	  if s:firstfold
	    " the first fold in a line has '|' characters from folds opened in
	    " previous lines, before the '-' for this fold
	    let s:new .= s:FoldColumn_build('|', s:allfolds[0].level - 1, s:extra_space, '-',
		  \ 'toggle-closed FoldColumn', 'javascript:toggleFold("fold'.s:foldId.s:settings.id_suffix.'");')
	  else
	    " any subsequent folds in the line only add a single '-'
	    let s:new = s:new . s:FoldColumn_build("-", 1, s:extra_space, "",
		  \ 'toggle-closed FoldColumn', 'javascript:toggleFold("fold'.s:foldId.s:settings.id_suffix.'");')
	  endif
	  let s:firstfold = 0
	endif

	" Add fold text, moving the span ending to the next line so collapsing
	" of folds works correctly.
	" Put numcol in a separate group for sake of unselectable text.
	let s:new = s:new . (s:settings.number_lines ? s:HtmlFormat_n(s:numcol, s:FOLDED_ID, 0, 0) : "") . substitute(s:HtmlFormat_t(foldtextresult(s:lnum), s:FOLDED_ID, 0), '', s:HtmlEndline.'\n\0', '')
	let s:new = s:new . ""

	" open the fold now that we have the fold text to allow retrieval of
	" fold text for subsequent folds
	execute s:lnum."foldopen"
	call insert(s:foldstack, remove(s:allfolds,0))
	let s:foldstack[0].id = s:foldId
      endwhile

      " Unless disabled, add a fold column for other lines.
      "
      " Note that dynamic folds require using css so we just use css to take
      " care of the leading spaces rather than using   in the case of
      " html_no_pre to make it easier
      if !s:settings.no_foldcolumn
	if empty(s:foldstack)
	  " add the empty foldcolumn for unfolded lines if there is a fold
	  " column at all
	  if s:foldcolumn > 0
	    let s:new = s:new . s:FoldColumn_fill()
	  endif
	else
	  " add the fold column for folds not on the opening line
	  if get(s:foldstack, 0).firstline < s:lnum
	    let s:new = s:new . s:FoldColumn_build('|', s:foldstack[0].level, s:foldcolumn - s:foldstack[0].level, "",
		  \ 'FoldColumn', 'javascript:toggleFold("fold'.s:foldstack[0].id.s:settings.id_suffix.'");')
	  endif
	endif
      endif
    endif

    " Now continue with the unfolded line text
    if s:settings.number_lines
      let s:new = s:new . s:HtmlFormat_n(s:numcol, s:LINENR_ID, 0, s:lnum)
    elseif s:settings.line_ids
      let s:new = s:new . s:HtmlFormat_n("", s:LINENR_ID, 0, s:lnum)
    endif

    " Get the diff attribute, if any.
    let s:diffattr = diff_hlID(s:lnum, 1)

    " initialize conceal info to act like not concealed, just in case
    let s:concealinfo = [0, '']

    " Loop over each character in the line
    let s:col = 1

    " most of the time we won't use the diff_id, initialize to zero
    let s:diff_id = 0

    while s:col <= s:len || (s:col == 1 && s:diffattr)
      let s:startcol = s:col " The start column for processing text
      if !s:settings.ignore_conceal && has('conceal')
	let s:concealinfo = synconcealed(s:lnum, s:col)
      endif
      if !s:settings.ignore_conceal && s:concealinfo[0]
	let s:col = s:col + 1
	" Speed loop (it's small - that's the trick)
	" Go along till we find a change in the match sequence number (ending
	" the specific concealed region) or until there are no more concealed
	" characters.
	while s:col <= s:len && s:concealinfo == synconcealed(s:lnum, s:col) | let s:col = s:col + 1 | endwhile
      elseif s:diffattr
	let s:diff_id = diff_hlID(s:lnum, s:col)
	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 hlID
	while s:col <= s:len && s:id == synID(s:lnum, s:col, 1)
	      \   && s:diff_id == diff_hlID(s:lnum, s:col) |
	      \     let s:col = s:col + 1 |
	      \ endwhile
	if s:len < &columns && !s:settings.no_pre
	  " Add spaces at the end of the raw text line to extend the changed
	  " line to the full width.
	  let s:line = s:line . repeat(' ', &columns - virtcol([s:lnum, s:len]) - s:margin)
	  let s:len = &columns
	endif
      else
	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
      endif

      if s:settings.ignore_conceal || !s:concealinfo[0]
	" Expand tabs if needed
	let s:expandedtab = strpart(s:line, s:startcol - 1, s:col - s:startcol)
	if s:settings.expand_tabs
	  let s:offset = 0
	  let s:idx = stridx(s:expandedtab, "\t")
	  while s:idx >= 0
	    if has("multi_byte_encoding")
	      if s:startcol + s:idx == 1
		let s:i = &ts
	      else
		if s:idx == 0
		  let s:prevc = matchstr(s:line, '.\%' . (s:startcol + s:idx + s:offset) . 'c')
		else
		  let s:prevc = matchstr(s:expandedtab, '.\%' . (s:idx + 1) . 'c')
		endif
		let s:vcol = virtcol([s:lnum, s:startcol + s:idx + s:offset - len(s:prevc)])
		let s:i = &ts - (s:vcol % &ts)
	      endif
	      let s:offset -= s:i - 1
	    else
	      let s:i = &ts - ((s:idx + s:startcol - 1) % &ts)
	    endif
	    let s:expandedtab = substitute(s:expandedtab, '\t', repeat(' ', s:i), '')
	    let s:idx = stridx(s:expandedtab, "\t")
	  endwhile
	end

	" get the highlight group name to use
	let s:id = synIDtrans(s:id)
      else
	" use Conceal highlighting for concealed text
	let s:id = s:CONCEAL_ID
	let s:expandedtab = s:concealinfo[1]
      endif

      " Output the text with the same synID, with class set to the highlight ID
      " name, unless it has been concealed completely.
      if strlen(s:expandedtab) > 0
	let s:new = s:new . s:HtmlFormat(s:expandedtab,  s:id, s:diff_id, "", 0)
      endif
    endwhile
  endif

  call extend(s:lines, split(s:new.s:HtmlEndline, '\n', 1))
  if !s:settings.no_progress && s:pgb.needs_redraw
    redrawstatus
    let s:pgb.needs_redraw = 0
  endif
  let s:lnum = s:lnum + 1

  if !s:settings.no_progress
    call s:pgb.incr()
  endif
endwhile

if s:settings.dynamic_folds
  " finish off any open folds
  while !empty(s:foldstack)
    let s:lines[-1].=""
    call remove(s:foldstack, 0)
  endwhile

  " add fold column to the style list if not already there
  let s:id = s:FOLD_C_ID
  if !has_key(s:stylelist, s:id)
    let s:stylelist[s:id] = '.FoldColumn { ' . s:CSS1(s:id) . '}'
  endif
endif

if s:settings.no_pre
  if !s:settings.use_css
    " Close off the font tag that encapsulates the whole 
    call extend(s:lines, ["", "", ""])
  else
    call extend(s:lines, ["
", "", ""]) endif else call extend(s:lines, ["
", "", ""]) endif exe s:newwin . "wincmd w" call setline(1, s:lines) unlet s:lines " Mangle modelines so Vim doesn't try to use HTML text as a modeline if editing " this file in the future; need to do this after generating all the text in case " the modeline text has different highlight groups which all turn out to be " stripped from the final output. %s!\v(%(^|\s+)%([Vv]i%(m%([<=>]?\d+)?)?|ex)):!\1\:!ge " The generated HTML is admittedly ugly and takes a LONG time to fold. " Make sure the user doesn't do syntax folding when loading a generated file, " using a modeline. call append(line('$'), "") " Now, when we finally know which, we define the colors and styles if s:settings.use_css 1;/+ 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 "= 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 HtmlHiLink htmlLeadingSpace None 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 let &cpo = s:cpo_save unlet s:cpo_save " vim: ts=8 vim-7.4.1689/runtime/syntax/htmlcheetah.vim000066400000000000000000000012401267703067000206060ustar00rootroot00000000000000" Vim syntax file " Language: HTML with Cheetah tags " Maintainer: Max Ischenko " 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 :p:h/cheetah.vim so :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" vim-7.4.1689/runtime/syntax/htmldjango.vim000066400000000000000000000022521267703067000204530ustar00rootroot00000000000000" Vim syntax file " Language: Django HTML template " Maintainer: Dave Hodder " Last Change: 2014 Jul 13 " For version 5.x: Clear all syntax items " 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 :p:h/django.vim so :p:h/html.vim else runtime! syntax/django.vim runtime! syntax/html.vim unlet b:current_syntax endif syn cluster djangoBlocks add=djangoTagBlock,djangoVarBlock,djangoComment,djangoComBlock syn region djangoTagBlock start="{%" end="%}" contains=djangoStatement,djangoFilter,djangoArgument,djangoTagError display containedin=ALLBUT,@djangoBlocks syn region djangoVarBlock start="{{" end="}}" contains=djangoFilter,djangoArgument,djangoVarError display containedin=ALLBUT,@djangoBlocks syn region djangoComment start="{%\s*comment\(\s\+.\{-}\)\?%}" end="{%\s*endcomment\s*%}" contains=djangoTodo containedin=ALLBUT,@djangoBlocks syn region djangoComBlock start="{#" end="#}" contains=djangoTodo containedin=ALLBUT,@djangoBlocks let b:current_syntax = "htmldjango" vim-7.4.1689/runtime/syntax/htmlm4.vim000066400000000000000000000015521267703067000175330ustar00rootroot00000000000000" Vim syntax file " Language: HTML and M4 " Maintainer: Claudio Fleiner " 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 :p:h/html.vim else runtime! syntax/html.vim endif unlet b:current_syntax syn case match if version < 600 so :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 vim-7.4.1689/runtime/syntax/htmlos.vim000066400000000000000000000210471267703067000176350ustar00rootroot00000000000000" Vim syntax file " Language: HTML/OS by Aestiva " Maintainer: Jason Rust " 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 :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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/ia64.vim000066400000000000000000000252721267703067000170760ustar00rootroot00000000000000" Vim syntax file " Language: IA-64 (Itanium) assembly language " Maintainer: Parth Malwankar " 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: 2006 Sep 08 " For version 5.x: Clear all syntax items " 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 :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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/ibasic.vim000066400000000000000000000155741267703067000175710ustar00rootroot00000000000000" Vim syntax file " Language: ibasic " Maintainer: Mark Manning " Originator: Allan Kelly " Created: 10/1/2006 " Updated: 10/21/2006 " Description: A vim file to handle the IBasic file format. " Notes: " Updated by Mark Manning " Applied IBasic support to the already excellent support for standard " basic syntax (like QB). " " 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. " " This version is based upon the commands found in IBasic (www.pyxia.com). " MEM 10/6/2006 " " Quit when a (custom) syntax file was already loaded (Taken from c.vim) " if exists("b:current_syntax") finish endif " " Be sure to turn on the "case ignore" since current versions of basic " support both upper as well as lowercase letters. " syn case ignore " " A bunch of useful BASIC keywords " syn keyword ibasicStatement beep bload bsave call absolute chain chdir circle syn keyword ibasicStatement clear close cls color com common const data syn keyword ibasicStatement loop draw end environ erase error exit field syn keyword ibasicStatement files function get gosub goto syn keyword ibasicStatement input input# ioctl key kill let line locate syn keyword ibasicStatement lock unlock lprint using lset mkdir name syn keyword ibasicStatement on error open option base out paint palette pcopy syn keyword ibasicStatement pen play pmap poke preset print print# using pset syn keyword ibasicStatement put randomize read redim reset restore resume syn keyword ibasicStatement return rmdir rset run seek screen syn keyword ibasicStatement shared shell sleep sound static stop strig sub syn keyword ibasicStatement swap system timer troff tron type unlock syn keyword ibasicStatement view wait width window write syn keyword ibasicStatement date$ mid$ time$ " " Do the basic variables names first. This is because it " is the most inclusive of the tests. Later on we change " this so the identifiers are split up into the various " types of identifiers like functions, basic commands and " such. MEM 9/9/2006 " syn match ibasicIdentifier "\<[a-zA-Z_][a-zA-Z0-9_]*\>" syn match ibasicGenericFunction "\<[a-zA-Z_][a-zA-Z0-9_]*\>\s*("me=e-1,he=e-1 " " Function list " syn keyword ibasicBuiltInFunction abs asc atn cdbl cint clng cos csng csrlin cvd cvdmbf syn keyword ibasicBuiltInFunction cvi cvl cvs cvsmbf eof erdev erl err exp fileattr syn keyword ibasicBuiltInFunction fix fre freefile inp instr lbound len loc lof syn keyword ibasicBuiltInFunction log lpos mod peek pen point pos rnd sadd screen seek syn keyword ibasicBuiltInFunction setmem sgn sin spc sqr stick strig tab tan ubound syn keyword ibasicBuiltInFunction val valptr valseg varptr varseg syn keyword ibasicBuiltInFunction chr\$ command$ date$ environ$ erdev$ hex$ inkey$ syn keyword ibasicBuiltInFunction input$ ioctl$ lcases$ laft$ ltrim$ mid$ mkdmbf$ mkd$ syn keyword ibasicBuiltInFunction mki$ mkl$ mksmbf$ mks$ oct$ right$ rtrim$ space$ syn keyword ibasicBuiltInFunction str$ string$ time$ ucase$ varptr$ syn keyword ibasicTodo contained TODO syn cluster ibasicFunctionCluster contains=ibasicBuiltInFunction,ibasicGenericFunction syn keyword Conditional if else then elseif endif select case endselect syn keyword Repeat for do while next enddo endwhile wend syn keyword ibasicTypeSpecifier single double defdbl defsng syn keyword ibasicTypeSpecifier int integer uint uinteger int64 uint64 defint deflng syn keyword ibasicTypeSpecifier byte char string istring defstr syn keyword ibasicDefine dim def declare " "catch errors caused by wrong parenthesis " syn cluster ibasicParenGroup contains=ibasicParenError,ibasicIncluded,ibasicSpecial,ibasicTodo,ibasicUserCont,ibasicUserLabel,ibasicBitField syn region ibasicParen transparent start='(' end=')' contains=ALLBUT,@bParenGroup syn match ibasicParenError ")" syn match ibasicInParen contained "[{}]" " "integer number, or floating point number without a dot and with "f". " syn region ibasicHex start="&h" end="\W" syn region ibasicHexError start="&h\x*[g-zG-Z]" end="\W" syn match ibasicInteger "\<\d\+\(u\=l\=\|lu\|f\)\>" " "floating point number, with dot, optional exponent " syn match ibasicFloat "\<\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=\>" " "floating point number, starting with a dot, optional exponent " syn match ibasicFloat "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>" " "floating point number, without dot, with exponent " syn match ibasicFloat "\<\d\+e[-+]\=\d\+[fl]\=\>" " "hex number " syn match ibasicIdentifier "\<[a-zA-Z_][a-zA-Z0-9_]*\>" syn match ibasicFunction "\<[a-zA-Z_][a-zA-Z0-9_]*\>\s*("me=e-1,he=e-1 syn case match syn match ibasicOctalError "\<0\o*[89]" " " String and Character contstants " syn region ibasicString start='"' end='"' contains=ibasicSpecial,ibasicTodo syn region ibasicString start="'" end="'" contains=ibasicSpecial,ibasicTodo " " Comments " syn match ibasicSpecial contained "\\." syn region ibasicComment start="^rem" end="$" contains=ibasicSpecial,ibasicTodo syn region ibasicComment start=":\s*rem" end="$" contains=ibasicSpecial,ibasicTodo syn region ibasicComment start="\s*'" end="$" contains=ibasicSpecial,ibasicTodo syn region ibasicComment start="^'" end="$" contains=ibasicSpecial,ibasicTodo " " Now do the comments and labels " syn match ibasicLabel "^\d" syn region ibasicLineNumber start="^\d" end="\s" " " Pre-compiler options : FreeBasic " syn region ibasicPreCondit start="^\s*#\s*\(if\>\|ifdef\>\|ifndef\>\|elif\>\|else\>\|endif\>\)" skip="\\$" end="$" contains=ibasicString,ibasicCharacter,ibasicNumber,ibasicCommentError,ibasicSpaceError syn match ibasicInclude "^\s*#\s*include\s*" " " Create the clusters " syn cluster ibasicNumber contains=ibasicHex,ibasicInteger,ibasicFloat syn cluster ibasicError contains=ibasicHexError " " Used with OPEN statement " syn match ibasicFilenumber "#\d\+" " "syn sync ccomment ibasicComment " syn match ibasicMathOperator "[\+\-\=\|\*\/\>\<\%\()[\]]" contains=ibasicParen " " The default methods for highlighting. Can be overridden later " hi def link ibasicLabel Label hi def link ibasicConditional Conditional hi def link ibasicRepeat Repeat hi def link ibasicHex Number hi def link ibasicInteger Number hi def link ibasicFloat Number hi def link ibasicError Error hi def link ibasicHexError Error hi def link ibasicStatement Statement hi def link ibasicString String hi def link ibasicComment Comment hi def link ibasicLineNumber Comment hi def link ibasicSpecial Special hi def link ibasicTodo Todo hi def link ibasicGenericFunction Function hi def link ibasicBuiltInFunction Function hi def link ibasicTypeSpecifier Type hi def link ibasicDefine Type hi def link ibasicInclude Include hi def link ibasicIdentifier Identifier hi def link ibasicFilenumber ibasicTypeSpecifier hi def link ibasicMathOperator Operator let b:current_syntax = "ibasic" " vim: ts=8 vim-7.4.1689/runtime/syntax/icemenu.vim000066400000000000000000000015061267703067000177520ustar00rootroot00000000000000" Vim syntax file " Language: Icewm Menu " Maintainer: James Mahler " Last Change: Fri Apr 1 15:13:48 EST 2005 " 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("b:current_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" vim-7.4.1689/runtime/syntax/icon.vim000066400000000000000000000161761267703067000172660ustar00rootroot00000000000000" Vim syntax file " Language: Icon " Maintainer: Wendell Turner " 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 "¤t" 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 "®ions" 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 else command -nargs=+ HiLink hi def link 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" vim-7.4.1689/runtime/syntax/idl.vim000066400000000000000000000462021267703067000170770ustar00rootroot00000000000000" Vim syntax file " Language: IDL (Interface Description Language) " Created By: Jody Goldberg " Maintainer: Michael Geddes " Last Change: 2012 Jan 11 " 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. " There are some Microsoft extensions to idl files that are here. Some of " them are disabled by defining idl_no_ms_extensions. " " The more complex of the extensions are disabled by defining idl_no_extensions. " " History: " 2.0: Michael's new version " 2.1: Support for Vim 7 spell (Anduin Withers) " if exists("b:current_syntax") finish endif let s:cpo_save = &cpo try set cpo&vim if exists("idlsyntax_showerror") syn match idlError +\S+ skipwhite skipempty nextgroup=idlError endif syn region idlCppQuote start='\]*>" 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=idlError,idlSemiColon contains=idlUnion,idlStruct,idlEnum,idlInterface,idlComment,idlTypedef,idlConst,idlException,idlModule syn match idlModuleName contained "[a-zA-Z0-9_]\+" skipempty skipwhite nextgroup=idlModuleContent,idlError,idlSemiColon syn keyword idlModule module skipempty skipwhite nextgroup=idlModuleName " Interfaces syn cluster idlCommentable contains=idlComment syn cluster idlContentCluster contains=idlUnion,idlStruct,idlEnum,idlROAttr,idlAttr,idlOp,idlOneWayOp,idlException,idlConst,idlTypedef,idlAttributes,idlErrorSquareBracket,idlErrorBracket,idlInterfaceSections syn region idlInterfaceContent contained start="{" end="}" skipempty skipwhite nextgroup=idlError,idlSemiColon contains=@idlContentCluster,@idlCommentable 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,idlError,idlSemiColon syn keyword idlInterface interface dispinterface skipempty skipwhite nextgroup=idlInterfaceName syn keyword idlInterfaceSections contained properties methods skipempty skipwhite nextgroup=idlSectionColon,idlError syn match idlSectionColon contained ":" syn match idlLibraryName contained "[a-zA-Z0-9_]\+" skipempty skipwhite nextgroup=idlLibraryContent,idlError,idlSemiColon syn keyword idlLibrary library skipempty skipwhite nextgroup=idlLibraryName syn region idlLibraryContent contained start="{" end="}" skipempty skipwhite nextgroup=idlError,idlSemiColon contains=@idlCommentable,idlAttributes,idlErrorSquareBracket,idlErrorBracket,idlImportlib,idlCoclass,idlTypedef,idlInterface syn keyword idlImportlib contained importlib skipempty skipwhite nextgroup=idlStringArg syn region idlStringArg contained start="(" end=")" contains=idlString nextgroup=idlError,idlSemiColon,idlErrorBrace,idlErrorSquareBracket syn keyword idlCoclass coclass contained skipempty skipwhite nextgroup=idlCoclassName syn match idlCoclassName "[a-zA-Z0-9_]\+" contained skipempty skipwhite nextgroup=idlCoclassDefinition,idlError,idlSemiColon syn region idlCoclassDefinition contained start="{" end="}" contains=idlCoclassAttributes,idlInterface,idlErrorBracket,idlErrorSquareBracket skipempty skipwhite nextgroup=idlError,idlSemiColon syn region idlCoclassAttributes contained start=+\[+ end=+]+ skipempty skipwhite nextgroup=idlInterface contains=idlErrorBracket,idlErrorBrace,idlCoclassAttribute syn keyword idlCoclassAttribute contained default source "syn keyword idlInterface interface skipempty skipwhite nextgroup=idlInterfaceStubName syn match idlImportString +"\f\+"+ skipempty skipwhite nextgroup=idlError,idlSemiColon syn keyword idlImport import skipempty skipwhite nextgroup=idlImportString syn region idlAttributes start="\[" end="\]" contains=idlAttribute,idlAttributeParam,idlErrorBracket,idlErrorBrace,idlComment syn keyword idlAttribute contained propput propget propputref id helpstring object uuid pointer_default if !exists('idl_no_ms_extensions') syn keyword idlAttribute contained nonextensible dual version aggregatable restricted hidden noncreatable oleautomation endif syn region idlAttributeParam contained start="(" end=")" contains=idlString,idlUuid,idlLiteral,idlErrorBrace,idlErrorSquareBracket " skipwhite nextgroup=idlArraySize,idlParmList contains=idlArraySize,idlLiteral syn match idlErrorBrace contained "}" syn match idlErrorBracket contained ")" syn match idlErrorSquareBracket contained "\]" syn match idlUuid contained +[0-9a-zA-Z]\{8}-\([0-9a-zA-Z]\{4}-\)\{3}[0-9a-zA-Z]\{12}+ " Raises syn keyword idlRaises contained raises skipempty skipwhite nextgroup=idlRaises,idlContext,idlError,idlSemiColon " Context syn keyword idlContext contained context skipempty skipwhite nextgroup=idlRaises,idlContext,idlError,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 if !exists('idl_no_ms_extensions') syn keyword idlOpParms contained retval optional skipempty skipwhite nextgroup=idlParmType syn match idlOpParms contained +\<\(iid_is\|defaultvalue\)\s*([^)]*)+ skipempty skipwhite nextgroup=idlParamType syn keyword idlVariantType contained BSTR VARIANT VARIANT_BOOL long short unsigned double CURRENCY DATE syn region idlSafeArray contained matchgroup=idlVariantType start=+SAFEARRAY(\s*+ end=+)+ contains=idlVariantType endif syn region idlOpContents contained start="(" end=")" skipempty skipwhite nextgroup=idlRaises,idlContext,idlError,idlSemiColon contains=idlOpParms,idlSafeArray,idlVariantType,@idlCommentable 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=idlError,idlSemiColon,idlSimpDecl contains=idlId,idlAttributes,@idlCommentable syn match idlEnumName contained "[a-zA-Z0-9_]\+" skipempty skipwhite nextgroup=idlEnumContents syn keyword idlEnum enum skipempty skipwhite nextgroup=idlEnumName,idlEnumContents " Typedef syn keyword idlTypedef typedef skipempty skipwhite nextgroup=idlTypedefOtherTypeQualifier,idlDefBaseType,idlDefBaseTypeInt,idlDefSeqType,idlDefv1Enum,idlDefEnum,idlDefOtherType,idlDefAttributes,idlError if !exists('idl_no_extensions') syn keyword idlTypedefOtherTypeQualifier contained struct enum interface nextgroup=idlDefBaseType,idlDefBaseTypeInt,idlDefSeqType,idlDefv1Enum,idlDefEnum,idlDefOtherType,idlDefAttributes,idlError skipwhite syn region idlDefAttributes contained start="\[" end="\]" contains=idlAttribute,idlAttributeParam,idlErrorBracket,idlErrorBrace skipempty skipwhite nextgroup=idlDefBaseType,idlDefBaseTypeInt,idlDefSeqType,idlDefv1Enum,idlDefEnum,idlDefOtherType,idlError syn keyword idlDefBaseType contained float double char boolean octet any skipempty skipwhite nextgroup=idlTypedefDecl,idlError syn keyword idlDefBaseTypeInt contained short long skipempty skipwhite nextgroup=idlTypedefDecl,idlError syn match idlDefOtherType contained +\<\k\+\>+ skipempty nextgroup=idlTypedefDecl,idlError " syn keyword idlDefSeqType contained sequence skipempty skipwhite nextgroup=idlD4 " Enum typedef syn keyword idlDefEnum contained enum skipempty skipwhite nextgroup=idlDefEnumName,idlDefEnumContents syn match idlDefEnumName contained "[a-zA-Z0-9_]\+" skipempty skipwhite nextgroup=idlDefEnumContents,idlTypedefDecl syn region idlDefEnumContents contained start="{" end="}" skipempty skipwhite nextgroup=idlError,idlTypedefDecl contains=idlId,idlAttributes syn match idlTypedefDecl contained "[a-zA-Z0-9_]\+" skipempty skipwhite nextgroup=idlError,idlSemiColon endif " Struct syn region idlStructContent contained start="{" end="}" skipempty skipwhite nextgroup=idlError,idlSemiColon,idlSimpDecl contains=idlBaseType,idlBaseTypeInt,idlSeqType,@idlCommentable,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=idlError,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 if !exists('idl_no_extensions') syn sync match idlInterfaceSync grouphere idlInterfaceContent "\<\(disp\)\=interface\>\s\+\k\+\s*:\s*\k\+\_s*{" skipempty skipwhite nextgroup=idlError,idlSemiColon contains=@idlContentCluster,@idlCommentable syn sync maxlines=1000 minlines=100 else syn sync lines=200 endif " syn sync fromstart if !exists("did_idl_syntax_inits") let did_idl_syntax_inits = 1 " The default methods for highlighting. Can be overridden later command -nargs=+ HiLink hi def link 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 idlUuid Number HiLink idlType Type HiLink idlVariantType idlType HiLink idlModule Keyword HiLink idlInterface Keyword HiLink idlEnum Keyword HiLink idlStruct Keyword HiLink idlUnion Keyword HiLink idlTypedef Keyword HiLink idlException Keyword HiLink idlTypedefOtherTypeQualifier 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 SpecialComment HiLink idlParmName Identifier HiLink idlInheritFrom Identifier HiLink idlAttribute SpecialComment HiLink idlId Constant "HiLink idlCase Keyword HiLink idlCaseLabel Constant HiLink idlErrorBracket Error HiLink idlErrorBrace Error HiLink idlErrorSquareBracket Error HiLink idlImport Keyword HiLink idlImportString idlString HiLink idlCoclassAttribute StorageClass HiLink idlLibrary Keyword HiLink idlImportlib Keyword HiLink idlCoclass Keyword HiLink idlLibraryName Typedef HiLink idlCoclassName Typedef " hi idlLibraryContent guifg=red HiLink idlTypedefDecl Typedef HiLink idlDefEnum Keyword HiLink idlDefv1Enum Keyword HiLink idlDefEnumName Typedef HiLink idlDefEnumContents Paren HiLink idlDefBaseTypeInt idlType HiLink idlDefBaseType idlType HiLink idlDefSeqType idlType HiLink idlInterfaceSections Label if exists("idlsyntax_showerror") if exists("idlsyntax_showerror_soft") hi default idlError guibg=#d0ffd0 else HiLink idlError Error endif endif delcommand HiLink endif let b:current_syntax = "idl" finally let &cpo = s:cpo_save unlet s:cpo_save endtry " vim: sw=2 et vim-7.4.1689/runtime/syntax/idlang.vim000066400000000000000000000330021267703067000175570ustar00rootroot00000000000000" Interactive Data Language syntax file (IDL, too [:-)] " Maintainer: Aleksandar Jelenak " Last change: 2011 Apr 11 " Created by: Hermann Rochholz " 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 "\= 508 || !exists("did_idlang_syn_inits") if version < 508 let did_idlang_syn_inits = 1 command -nargs=+ HiLink hi link else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/indent.vim000066400000000000000000000157571267703067000176230ustar00rootroot00000000000000" Vim syntax file " Language: indent(1) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2010-01-23 " indent_is_bsd: If exists, will change somewhat to match BSD implementation " " 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 exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim setlocal iskeyword+=-,+ syn match indentError '\S\+' syn keyword indentTodo contained TODO FIXME XXX NOTE syn region indentComment start='/\*' end='\*/' \ contains=indentTodo,@Spell syn region indentComment start='//' skip='\\$' end='$' \ contains=indentTodo,@Spell if !exists("indent_is_bsd") syn match indentOptions '-i\|--indentation-level\|-il\|--indent-level' \ nextgroup=indentNumber skipwhite skipempty endif syn match indentOptions '-\%(bli\|c\%([bl]i\|[dip]\)\=\|di\=\|ip\=\|lc\=\|pp\=i\|sbi\|ts\|-\%(brace-indent\|comment-indentation\|case-brace-indentation\|declaration-comment-column\|continuation-indentation\|case-indentation\|else-endif-column\|line-comments-indentation\|declaration-indentation\|indent-level\|parameter-indentation\|line-length\|comment-line-length\|paren-indentation\|preprocessor-indentation\|struct-brace-indentation\|tab-size\)\)' \ nextgroup=indentNumber skipwhite skipempty syn match indentNumber display contained '\d\+\>' syn match indentOptions '-T' \ nextgroup=indentIdent skipwhite skipempty syn match indentIdent display contained '\h\w*\>' syn keyword indentOptions -bacc --blank-lines-after-ifdefs \ -bad --blank-lines-after-declarations \ -badp --blank-lines-after-procedure-declarations \ -bap --blank-lines-after-procedures \ -bbb --blank-lines-before-block-comments \ -bbo --break-before-boolean-operator \ -bc --blank-lines-after-commas \ -bfda --break-function-decl-args \ -bfde --break-function-decl-args-end \ -bl --braces-after-if-line \ -blf --braces-after-func-def-line \ -bls --braces-after-struct-decl-line \ -br --braces-on-if-line \ -brf --braces-on-func-def-line \ -brs --braces-on-struct-decl-line \ -bs --Bill-Shannon --blank-before-sizeof \ -c++ --c-plus-plus \ -cdb --comment-delimiters-on-blank-lines \ -cdw --cuddle-do-while \ -ce --cuddle-else \ -cs --space-after-cast \ -dj --left-justify-declarations \ -eei --extra-expression-indentation \ -fc1 --format-first-column-comments \ -fca --format-all-comments \ -gnu --gnu-style \ -h --help --usage \ -hnl --honour-newlines \ -kr --k-and-r-style --kernighan-and-ritchie --kernighan-and-ritchie-style \ -lp --continue-at-parentheses \ -lps --leave-preprocessor-space \ -nbacc --no-blank-lines-after-ifdefs \ -nbad --no-blank-lines-after-declarations \ -nbadp --no-blank-lines-after-procedure-declarations \ -nbap --no-blank-lines-after-procedures \ -nbbb --no-blank-lines-before-block-comments \ -nbbo --break-after-boolean-operator \ -nbc --no-blank-lines-after-commas \ -nbfda --dont-break-function-decl-args \ -nbfde --dont-break-function-decl-args-end \ -nbs --no-Bill-Shannon --no-blank-before-sizeof \ -ncdb --no-comment-delimiters-on-blank-lines \ -ncdw --dont-cuddle-do-while \ -nce --dont-cuddle-else \ -ncs --no-space-after-casts \ -ndj --dont-left-justify-declarations \ -neei --no-extra-expression-indentation \ -nfc1 --dont-format-first-column-comments \ -nfca --dont-format-comments \ -nhnl --ignore-newlines \ -nip --dont-indent-parameters --no-parameter-indentation \ -nlp --dont-line-up-parentheses \ -nlps --remove-preprocessor-space \ -npcs --no-space-after-function-call-names \ -npmt \ -npro --ignore-profile \ -nprs --no-space-after-parentheses \ -npsl --dont-break-procedure-type \ -nsaf --no-space-after-for \ -nsai --no-space-after-if \ -nsaw --no-space-after-while \ -nsc --dont-star-comments \ -nsob --leave-optional-blank-lines \ -nss --dont-space-special-semicolon \ -nut --no-tabs \ -nv --no-verbosity \ -o --output \ -o --output-file \ -orig --berkeley --berkeley-style --original --original-style \ -pcs --space-after-procedure-calls \ -pmt --preserve-mtime \ -prs --space-after-parentheses \ -psl --procnames-start-lines \ -saf --space-after-for \ -sai --space-after-if \ -saw --space-after-while \ -sc --start-left-side-of-comments \ -sob --swallow-optional-blank-lines \ -ss --space-special-semicolon \ -st --standard-output \ -ut --use-tabs \ -v --verbose \ -version --version \ -linux --linux-style if exists("indent_is_bsd") syn keyword indentOptions -ip -ei -nei endif 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 hi def link indentError Error hi def link indentComment Comment hi def link indentTodo Todo hi def link indentOptions Keyword hi def link indentNumber Number hi def link indentIdent Identifier let b:current_syntax = "indent" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/inform.vim000066400000000000000000000464661267703067000176350ustar00rootroot00000000000000" Vim syntax file " Language: Inform " Maintainer: Stephen Thomas (stephen@gowarthomas.com) " URL: http://www.gowarthomas.com/informvim " Last Change: 2006 April 20 " 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 "\" 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="\" 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 "\" 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 display else set iskeyword+=$ command -nargs=+ SynDisplay syntax endif " Grammar sections. syn region informGrammarSection matchgroup=informGramPreProc start="\" 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 "\" 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/initex.vim000066400000000000000000000454131267703067000176320ustar00rootroot00000000000000" Vim syntax file " Language: TeX (core definition) " Maintainer: Nikolai Weibull " Latest Revision: 2006-04-19 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim " This follows the grouping (sort of) found at " http://www.tug.org/utilities/plain/cseq.html#top-fam syn keyword initexTodo TODO FIXME XXX NOTE syn match initexComment display contains=initexTodo \ '\\\@' syn cluster initexBox \ contains=initexBoxCommand,initexBoxInternalQuantity, \ initexBoxParameterDimen,initexBoxParameterInteger, \ initexBoxParameterToken syn cluster initexCharacter \ contains=initexCharacterCommand,initexCharacterInternalQuantity, \ initexCharacterParameterInteger syn cluster initexDebugging \ contains=initexDebuggingCommand,initexDebuggingParameterInteger, \ initexDebuggingParameterToken syn cluster initexFileIO \ contains=initexFileIOCommand,initexFileIOInternalQuantity, \ initexFileIOParameterToken syn cluster initexFonts \ contains=initexFontsCommand,initexFontsInternalQuantity syn cluster initexGlue \ contains=initexGlueCommand,initexGlueDerivedCommand syn cluster initexHyphenation \ contains=initexHyphenationCommand,initexHyphenationDerivedCommand, \ initexHyphenationInternalQuantity,initexHyphenationParameterInteger syn cluster initexInserts \ contains=initexInsertsCommand,initexInsertsParameterDimen, \ initexInsertsParameterGlue,initexInsertsParameterInteger syn cluster initexJob \ contains=initexJobCommand,initexJobInternalQuantity, \ initexJobParameterInteger syn cluster initexKern \ contains=initexKernCommand,initexKernInternalQuantity syn cluster initexLogic \ contains=initexLogicCommand syn cluster initexMacro \ contains=initexMacroCommand,initexMacroDerivedCommand, \ initexMacroParameterInteger syn cluster initexMarks \ contains=initexMarksCommand syn cluster initexMath \ contains=initexMathCommand,initexMathDerivedCommand, \ initexMathInternalQuantity,initexMathParameterDimen, \ initexMathParameterGlue,initexMathParameterInteger, \ initexMathParameterMuglue,initexMathParameterToken syn cluster initexPage \ contains=initexPageInternalQuantity,initexPageParameterDimen, \ initexPageParameterGlue syn cluster initexParagraph \ contains=initexParagraphCommand,initexParagraphInternalQuantity, \ initexParagraphParameterDimen,initexParagraphParameterGlue, \ initexParagraphParameterInteger,initexParagraphParameterToken syn cluster initexPenalties \ contains=initexPenaltiesCommand,initexPenaltiesInternalQuantity, \ initexPenaltiesParameterInteger syn cluster initexRegisters \ contains=initexRegistersCommand,initexRegistersInternalQuantity syn cluster initexTables \ contains=initexTablesCommand,initexTablesParameterGlue, \ initexTablesParameterToken syn cluster initexCommand \ contains=initexBoxCommand,initexCharacterCommand, \ initexDebuggingCommand,initexFileIOCommand, \ initexFontsCommand,initexGlueCommand, \ initexHyphenationCommand,initexInsertsCommand, \ initexJobCommand,initexKernCommand,initexLogicCommand, \ initexMacroCommand,initexMarksCommand,initexMathCommand, \ initexParagraphCommand,initexPenaltiesCommand,initexRegistersCommand, \ initexTablesCommand syn match initexBoxCommand display contains=@NoSpell \ '\\\%([hv]\=box\|[cx]\=leaders\|copy\|[hv]rule\|lastbox\|setbox\|un[hv]\%(box\|copy\)\|vtop\)\>' syn match initexCharacterCommand display contains=@NoSpell \ '\\\%([] ]\|\%(^^M\|accent\|char\|\%(lower\|upper\)case\|number\|romannumeral\|string\)\>\)' syn match initexDebuggingCommand display contains=@NoSpell \ '\\\%(\%(batch\|\%(non\|error\)stop\|scroll\)mode\|\%(err\)\=message\|meaning\|show\%(box\%(breadth\|depth\)\=\|lists\|the\)\)\>' syn match initexFileIOCommand display contains=@NoSpell \ '\\\%(\%(close\|open\)\%(in\|out\)\|endinput\|immediate\|input\|read\|shipout\|special\|write\)\>' syn match initexFontsCommand display contains=@NoSpell \ '\\\%(/\|fontname\)\>' syn match initexGlueCommand display contains=@NoSpell \ '\\\%([hv]\|un\)skip\>' syn match initexHyphenationCommand display contains=@NoSpell \ '\\\%(discretionary\|hyphenation\|patterns\|setlanguage\)\>' syn match initexInsertsCommand display contains=@NoSpell \ '\\\%(insert\|split\%(bot\|first\)mark\|vsplit\)\>' syn match initexJobCommand display contains=@NoSpell \ '\\\%(dump\|end\|jobname\)\>' syn match initexKernCommand display contains=@NoSpell \ '\\\%(kern\|lower\|move\%(left\|right\)\|raise\|unkern\)\>' syn match initexLogicCommand display contains=@NoSpell \ '\\\%(else\|fi\|if[a-zA-Z@]\+\|or\)\>' " \ '\\\%(else\|fi\|if\%(case\|cat\|dim\|eof\|false\|[hv]box\|[hmv]mode\|inner\|num\|odd\|true\|void\|x\)\=\|or\)\>' syn match initexMacroCommand display contains=@NoSpell \ '\\\%(after\%(assignment\|group\)\|\%(begin\|end\)group\|\%(end\)\=csname\|e\=def\|expandafter\|futurelet\|global\|let\|long\|noexpand\|outer\|relax\|the\)\>' syn match initexMarksCommand display contains=@NoSpell \ '\\\%(bot\|first\|top\)\=mark\>' syn match initexMathCommand display contains=@NoSpell \ '\\\%(abovewithdelims\|delimiter\|display\%(limits\|style\)\|l\=eqno\|left\|\%(no\)\=limits\|math\%(accent\|bin\|char\|choice\|close\|code\|inner\|op\|open\|ord\|punct\|rel\)\|mkern\|mskip\|muskipdef\|nonscript\|\%(over\|under\)line\|radical\|right\|\%(\%(script\)\{1,2}\|text\)style\|vcenter\)\>' syn match initexParagraphCommand display contains=@NoSpell \ '\\\%(ignorespaces\|indent\|no\%(boundary\|indent\)\|par\|vadjust\)\>' syn match initexPenaltiesCommand display contains=@NoSpell \ '\\\%(un\)\=penalty\>' syn match initexRegistersCommand display contains=@NoSpell \ '\\\%(advance\|\%(count\|dimen\|skip\|toks\)def\|divide\|multiply\)\>' syn match initexTablesCommand display contains=@NoSpell \ '\\\%(cr\|crcr\|[hv]align\|noalign\|omit\|span\)\>' syn cluster initexDerivedCommand \ contains=initexGlueDerivedCommand,initexHyphenationDerivedCommand, \ initexMacroDerivedCommand,initexMathDerivedCommand syn match initexGlueDerivedCommand display contains=@NoSpell \ '\\\%([hv]fil\%(l\|neg\)\=\|[hv]ss\)\>' syn match initexHyphenationDerivedCommand display contains=@NoSpell \ '\\-' syn match initexMacroDerivedCommand display contains=@NoSpell \ '\\[gx]def\>' syn match initexMathDerivedCommand display contains=@NoSpell \ '\\\%(above\|atop\%(withdelims\)\=\|mathchardef\|over\|overwithdelims\)\>' syn cluster initexInternalQuantity \ contains=initexBoxInternalQuantity,initexCharacterInternalQuantity, \ initexFileIOInternalQuantity,initexFontsInternalQuantity, \ initexHyphenationInternalQuantity,initexJobInternalQuantity, \ initexKernInternalQuantity,initexMathInternalQuantity, \ initexPageInternalQuantity,initexParagraphInternalQuantity, \ initexPenaltiesInternalQuantity,initexRegistersInternalQuantity syn match initexBoxInternalQuantity display contains=@NoSpell \ '\\\%(badness\|dp\|ht\|prevdepth\|wd\)\>' syn match initexCharacterInternalQuantity display contains=@NoSpell \ '\\\%(catcode\|chardef\|\%([ul]c\|sf\)code\)\>' syn match initexFileIOInternalQuantity display contains=@NoSpell \ '\\inputlineno\>' syn match initexFontsInternalQuantity display contains=@NoSpell \ '\\\%(font\%(dimen\)\=\|nullfont\)\>' syn match initexHyphenationInternalQuantity display contains=@NoSpell \ '\\hyphenchar\>' syn match initexJobInternalQuantity display contains=@NoSpell \ '\\deadcycles\>' syn match initexKernInternalQuantity display contains=@NoSpell \ '\\lastkern\>' syn match initexMathInternalQuantity display contains=@NoSpell \ '\\\%(delcode\|mathcode\|muskip\|\%(\%(script\)\{1,2}\|text\)font\|skewchar\)\>' syn match initexPageInternalQuantity display contains=@NoSpell \ '\\page\%(depth\|fil\{1,3}stretch\|goal\|shrink\|stretch\|total\)\>' syn match initexParagraphInternalQuantity display contains=@NoSpell \ '\\\%(prevgraf\|spacefactor\)\>' syn match initexPenaltiesInternalQuantity display contains=@NoSpell \ '\\lastpenalty\>' syn match initexRegistersInternalQuantity display contains=@NoSpell \ '\\\%(count\|dimen\|skip\|toks\)\d\+\>' syn cluster initexParameterDimen \ contains=initexBoxParameterDimen,initexInsertsParameterDimen, \ initexMathParameterDimen,initexPageParameterDimen, \ initexParagraphParameterDimen syn match initexBoxParameterDimen display contains=@NoSpell \ '\\\%(boxmaxdepth\|[hv]fuzz\|overfullrule\)\>' syn match initexInsertsParameterDimen display contains=@NoSpell \ '\\splitmaxdepth\>' syn match initexMathParameterDimen display contains=@NoSpell \ '\\\%(delimitershortfall\|display\%(indent\|width\)\|mathsurround\|nulldelimiterspace\|predisplaysize\|scriptspace\)\>' syn match initexPageParameterDimen display contains=@NoSpell \ '\\\%([hv]offset\|maxdepth\|vsize\)\>' syn match initexParagraphParameterDimen display contains=@NoSpell \ '\\\%(emergencystretch\|\%(hang\|par\)indent\|hsize\|lineskiplimit\)\>' syn cluster initexParameterGlue \ contains=initexInsertsParameterGlue,initexMathParameterGlue, \ initexPageParameterGlue,initexParagraphParameterGlue, \ initexTablesParameterGlue syn match initexInsertsParameterGlue display contains=@NoSpell \ '\\splittopskip\>' syn match initexMathParameterGlue display contains=@NoSpell \ '\\\%(above\|below\)display\%(short\)\=skip\>' syn match initexPageParameterGlue display contains=@NoSpell \ '\\topskip\>' syn match initexParagraphParameterGlue display contains=@NoSpell \ '\\\%(baseline\|left\|line\|par\%(fill\)\=\|right\|x\=space\)skip\>' syn match initexTablesParameterGlue display contains=@NoSpell \ '\\tabskip\>' syn cluster initexParameterInteger \ contains=initexBoxParameterInteger,initexCharacterParameterInteger, \ initexDebuggingParameterInteger,initexHyphenationParameterInteger, \ initexInsertsParameterInteger,initexJobParameterInteger, \ initexMacroParameterInteger,initexMathParameterInteger, \ initexParagraphParameterInteger,initexPenaltiesParameterInteger, syn match initexBoxParameterInteger display contains=@NoSpell \ '\\[hv]badness\>' syn match initexCharacterParameterInteger display contains=@NoSpell \ '\\\%(\%(endline\|escape\|newline\)char\)\>' syn match initexDebuggingParameterInteger display contains=@NoSpell \ '\\\%(errorcontextlines\|pausing\|tracing\%(commands\|lostchars\|macros\|online\|output\|pages\|paragraphs\|restores|stats\)\)\>' syn match initexHyphenationParameterInteger display contains=@NoSpell \ '\\\%(defaulthyphenchar\|language\|\%(left\|right\)hyphenmin\|uchyph\)\>' syn match initexInsertsParameterInteger display contains=@NoSpell \ '\\\%(holdinginserts\)\>' syn match initexJobParameterInteger display contains=@NoSpell \ '\\\%(day\|mag\|maxdeadcycles\|month\|time\|year\)\>' syn match initexMacroParameterInteger display contains=@NoSpell \ '\\globaldefs\>' syn match initexMathParameterInteger display contains=@NoSpell \ '\\\%(binoppenalty\|defaultskewchar\|delimiterfactor\|displaywidowpenalty\|fam\|\%(post\|pre\)displaypenalty\|relpenalty\)\>' syn match initexParagraphParameterInteger display contains=@NoSpell \ '\\\%(\%(adj\|\%(double\|final\)hyphen\)demerits\|looseness\|\%(pre\)\=tolerance\)\>' syn match initexPenaltiesParameterInteger display contains=@NoSpell \ '\\\%(broken\|club\|exhyphen\|floating\|hyphen\|interline\|line\|output\|widow\)penalty\>' syn cluster initexParameterMuglue \ contains=initexMathParameterMuglue syn match initexMathParameterMuglue display contains=@NoSpell \ '\\\%(med\|thick\|thin\)muskip\>' syn cluster initexParameterDimen \ contains=initexBoxParameterToken,initexDebuggingParameterToken, \ initexFileIOParameterToken,initexMathParameterToken, \ initexParagraphParameterToken,initexTablesParameterToken syn match initexBoxParameterToken display contains=@NoSpell \ '\\every[hv]box\>' syn match initexDebuggingParameterToken display contains=@NoSpell \ '\\errhelp\>' syn match initexFileIOParameterToken display contains=@NoSpell \ '\\output\>' syn match initexMathParameterToken display contains=@NoSpell \ '\\every\%(display\|math\)\>' syn match initexParagraphParameterToken display contains=@NoSpell \ '\\everypar\>' syn match initexTablesParameterToken display contains=@NoSpell \ '\\everycr\>' hi def link initexCharacter Character hi def link initexNumber Number hi def link initexIdentifier Identifier hi def link initexStatement Statement hi def link initexConditional Conditional hi def link initexPreProc PreProc hi def link initexMacro Macro hi def link initexType Type hi def link initexDebug Debug hi def link initexTodo Todo hi def link initexComment Comment hi def link initexDimension initexNumber hi def link initexCommand initexStatement hi def link initexBoxCommand initexCommand hi def link initexCharacterCommand initexCharacter hi def link initexDebuggingCommand initexDebug hi def link initexFileIOCommand initexCommand hi def link initexFontsCommand initexType hi def link initexGlueCommand initexCommand hi def link initexHyphenationCommand initexCommand hi def link initexInsertsCommand initexCommand hi def link initexJobCommand initexPreProc hi def link initexKernCommand initexCommand hi def link initexLogicCommand initexConditional hi def link initexMacroCommand initexMacro hi def link initexMarksCommand initexCommand hi def link initexMathCommand initexCommand hi def link initexParagraphCommand initexCommand hi def link initexPenaltiesCommand initexCommand hi def link initexRegistersCommand initexCommand hi def link initexTablesCommand initexCommand hi def link initexDerivedCommand initexStatement hi def link initexGlueDerivedCommand initexDerivedCommand hi def link initexHyphenationDerivedCommand initexDerivedCommand hi def link initexMacroDerivedCommand initexDerivedCommand hi def link initexMathDerivedCommand initexDerivedCommand hi def link initexInternalQuantity initexIdentifier hi def link initexBoxInternalQuantity initexInternalQuantity hi def link initexCharacterInternalQuantity initexInternalQuantity hi def link initexFileIOInternalQuantity initexInternalQuantity hi def link initexFontsInternalQuantity initexInternalQuantity hi def link initexHyphenationInternalQuantity initexInternalQuantity hi def link initexJobInternalQuantity initexInternalQuantity hi def link initexKernInternalQuantity initexInternalQuantity hi def link initexMathInternalQuantity initexInternalQuantity hi def link initexPageInternalQuantity initexInternalQuantity hi def link initexParagraphInternalQuantity initexInternalQuantity hi def link initexPenaltiesInternalQuantity initexInternalQuantity hi def link initexRegistersInternalQuantity initexInternalQuantity hi def link initexParameterDimen initexNumber hi def link initexBoxParameterDimen initexParameterDimen hi def link initexInsertsParameterDimen initexParameterDimen hi def link initexMathParameterDimen initexParameterDimen hi def link initexPageParameterDimen initexParameterDimen hi def link initexParagraphParameterDimen initexParameterDimen hi def link initexParameterGlue initexNumber hi def link initexInsertsParameterGlue initexParameterGlue hi def link initexMathParameterGlue initexParameterGlue hi def link initexPageParameterGlue initexParameterGlue hi def link initexParagraphParameterGlue initexParameterGlue hi def link initexTablesParameterGlue initexParameterGlue hi def link initexParameterInteger initexNumber hi def link initexBoxParameterInteger initexParameterInteger hi def link initexCharacterParameterInteger initexParameterInteger hi def link initexDebuggingParameterInteger initexParameterInteger hi def link initexHyphenationParameterInteger initexParameterInteger hi def link initexInsertsParameterInteger initexParameterInteger hi def link initexJobParameterInteger initexParameterInteger hi def link initexMacroParameterInteger initexParameterInteger hi def link initexMathParameterInteger initexParameterInteger hi def link initexParagraphParameterInteger initexParameterInteger hi def link initexPenaltiesParameterInteger initexParameterInteger hi def link initexParameterMuglue initexNumber hi def link initexMathParameterMuglue initexParameterMuglue hi def link initexParameterToken initexIdentifier hi def link initexBoxParameterToken initexParameterToken hi def link initexDebuggingParameterToken initexParameterToken hi def link initexFileIOParameterToken initexParameterToken hi def link initexMathParameterToken initexParameterToken hi def link initexParagraphParameterToken initexParameterToken hi def link initexTablesParameterToken initexParameterToken let b:current_syntax = "initex" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/initng.vim000066400000000000000000000065061267703067000176220ustar00rootroot00000000000000" Vim syntax file " Language: initng .i files " Maintainer: Elan Ruusame " URL: http://glen.alkohol.ee/pld/initng/ " License: GPL v2 " Version: 0.13 " Last Change: $Date: 2007/05/05 17:17:40 $ " " Syntax highlighting for initng .i files. Inherits from sh.vim and adds " in the hiliting to start/stop {} blocks. Requires vim 6.3 or later. if &compatible || v:version < 603 finish endif if exists("b:current_syntax") finish endif syn case match let is_bash = 1 unlet! b:current_syntax syn include @shTop syntax/sh.vim syn region initngService matchgroup=initngServiceHeader start="^\s*\(service\|virtual\|daemon\|class\|cron\)\s\+\(\(\w\|[-/*]\)\+\(\s\+:\s\+\(\w\|[-/*]\)\+\)\?\)\s\+{" end="}" contains=@initngServiceCluster syn cluster initngServiceCluster contains=initngComment,initngAction,initngServiceOption,initngServiceHeader,initngDelim,initngVariable syn region initngAction matchgroup=initngActionHeader start="^\s*\(script start\|script stop\|script run\)\s*=\s*{" end="}" contains=@initngActionCluster syn cluster initngActionCluster contains=@shTop syn match initngDelim /[{}]/ contained syn region initngString start=/"/ end=/"/ skip=/\\"/ " option = value syn match initngServiceOption /.\+\s*=.\+;/ contains=initngServiceKeywords,initngSubstMacro contained " option without value syn match initngServiceOption /\w\+;/ contains=initngServiceKeywords,initngSubstMacro contained " options with value syn keyword initngServiceKeywords also_stop need use nice setuid contained syn keyword initngServiceKeywords delay chdir suid sgid start_pause env_file env_parse pid_file pidfile contained syn keyword initngServiceKeywords pid_of up_when_pid_set stdout stderr syncron just_before contained syn keyword initngServiceKeywords provide lockfile daemon_stops_badly contained syn match initngServiceKeywords /\(script\|exec\(_args\)\?\) \(start\|stop\|daemon\)/ contained syn match initngServiceKeywords /env\s\+\w\+/ contained " rlimits syn keyword initngServiceKeywords rlimit_cpu_hard rlimit_core_soft contained " single options syn keyword initngServiceKeywords last respawn network_provider require_network require_file critical forks contained " cron options syn keyword initngServiceKeywords hourly contained syn match initngVariable /\${\?\w\+\}\?/ " Substituted @foo@ macros: " ========== syn match initngSubstMacro /@[^@]\+@/ contained syn cluster initngActionCluster add=initngSubstMacro syn cluster shCommandSubList add=initngSubstMacro " Comments: " ========== syn cluster initngCommentGroup contains=initngTodo,@Spell syn keyword initngTodo TODO FIXME XXX contained syn match initngComment /#.*$/ contains=@initngCommentGroup " install_service #macros " TODO: syntax check for ifd-endd pairs " ========== syn region initngDefine start="^#\(endd\|elsed\|exec\|ifd\|endexec\|endd\)\>" skip="\\$" end="$" end="#"me=s-1 syn cluster shCommentGroup add=initngDefine syn cluster initngCommentGroup add=initngDefine hi def link initngComment Comment hi def link initngTodo Todo hi def link initngString String hi def link initngServiceKeywords Define hi def link initngServiceHeader Keyword hi def link initngActionHeader Type hi def link initngDelim Delimiter hi def link initngVariable PreProc hi def link initngSubstMacro Comment hi def link initngDefine Macro let b:current_syntax = "initng" vim-7.4.1689/runtime/syntax/inittab.vim000066400000000000000000000054151267703067000177620ustar00rootroot00000000000000" 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) " 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 else command -nargs=+ HiLink hi def link 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" vim-7.4.1689/runtime/syntax/ipfilter.vim000066400000000000000000000032651267703067000201470ustar00rootroot00000000000000" ipfilter syntax file " Language: ipfilter configuration file " Maintainer: Hendrik Scholz " Last Change: 2005 Jan 27 " " http://www.wormulon.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 " Comment syn match IPFComment /#.*$/ contains=ipfTodo syn keyword IPFTodo TODO XXX FIXME contained syn keyword IPFActionBlock block syn keyword IPFActionPass pass syn keyword IPFProto tcp udp icmp syn keyword IPFSpecial quick log first " how could we use keyword for words with '-' ? syn match IPFSpecial /return-rst/ syn match IPFSpecial /dup-to/ "syn match IPFSpecial /icmp-type unreach/ syn keyword IPFAny all any syn match IPFIPv4 /\d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}/ syn match IPFNetmask /\/\d\+/ " service name constants syn keyword IPFService auth bgp domain finger ftp http https ident syn keyword IPFService imap irc isakmp kerberos mail nameserver nfs syn keyword IPFService nntp ntp pop3 portmap pptp rpcbind rsync smtp syn keyword IPFService snmp snmptrap socks ssh sunrpc syslog telnet syn keyword IPFService tftp www " Comment hi def link IPFComment Comment hi def link IPFTodo Todo hi def link IPFService Constant hi def link IPFAction Type hi def link ipfActionBlock String hi def link ipfActionPass Type hi def link IPFSpecial Statement hi def link IPFIPv4 Label hi def link IPFNetmask String hi def link IPFAny Statement hi def link IPFProto Identifier vim-7.4.1689/runtime/syntax/ishd.vim000066400000000000000000000654371267703067000172710ustar00rootroot00000000000000" Vim syntax file " Language: InstallShield Script " Maintainer: Robert M. Cortopassi " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/iss.vim000066400000000000000000000123611267703067000171240ustar00rootroot00000000000000" Vim syntax file " Language: Inno Setup File (iss file) and My InnoSetup extension " Maintainer: Jason Mills (jmills@cs.mun.ca) " Previous Maintainer: Dominique Stphan (dominique@mggen.com) " Last Change: 2004 Dec 14 " " Todo: " - The paramter String: is matched as flag string (because of case ignore). " - Pascal scripting syntax is not recognized. " - Embedded double quotes confuse string matches. e.g. "asfd""asfa" " For version 5.x: Clear all syntax items " 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 " Preprocessor syn region issPreProc start="^\s*#" end="$" " Section syn region issSection start="\[" end="\]" " Label in the [Setup] Section syn match issDirective "^[^=]\+=" " URL syn match issURL "http[s]\=:\/\/.*$" " Parameters used for any section. " syn match issParam"[^: ]\+:" syn match issParam "Name:" syn match issParam "MinVersion:\|OnlyBelowVersion:\|Languages:" syn match issParam "Source:\|DestDir:\|DestName:\|CopyMode:" syn match issParam "Attribs:\|Permissions:\|FontInstall:\|Flags:" syn match issParam "FileName:\|Parameters:\|WorkingDir:\|HotKey:\|Comment:" syn match issParam "IconFilename:\|IconIndex:" syn match issParam "Section:\|Key:\|String:" syn match issParam "Root:\|SubKey:\|ValueType:\|ValueName:\|ValueData:" syn match issParam "RunOnceId:" syn match issParam "Type:\|Excludes:" syn match issParam "Components:\|Description:\|GroupDescription:\|Types:\|ExtraDiskSpaceRequired:" syn match issParam "StatusMsg:\|RunOnceId:\|Tasks:" syn match issParam "MessagesFile:\|LicenseFile:\|InfoBeforeFile:\|InfoAfterFile:" syn match issComment "^\s*;.*$" " 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 dontcopy syn keyword issFilesAttribs readonly hidden system syn keyword issFilesPermissions full modify readexec syn keyword issFilesFlags allowunsafefiles comparetimestampalso confirmoverwrite deleteafterinstall syn keyword issFilesFlags dontcopy dontverifychecksum external fontisnttruetype ignoreversion syn keyword issFilesFlags isreadme onlyifdestfileexists onlyifdoesntexist overwritereadonly syn keyword issFilesFlags promptifolder recursesubdirs regserver regtypelib restartreplace syn keyword issFilesFlags sharedfile skipifsourcedoesntexist sortfilesbyextension touch syn keyword issFilesFlags uninsremovereadonly uninsrestartdelete uninsneveruninstall syn keyword issFilesFlags replacesameversion nocompression noencryption noregerror " [Icons] syn keyword issIconsFlags closeonexit createonlyiffileexists dontcloseonexit syn keyword issIconsFlags runmaximized 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 dontcreatekey syn keyword issRegFlags preservestringtype noerror uninsclearvalue syn keyword issRegFlags uninsdeletekey uninsdeletekeyifempty uninsdeletevalue " [Run] and [UninstallRun] syn keyword issRunFlags hidewizard nowait postinstall runhidden runmaximized syn keyword issRunFlags runminimized shellexec skipifdoesntexist skipifnotsilent syn keyword issRunFlags skipifsilent unchecked waituntilidle " [Types] syn keyword issTypesFlags iscustom " [Components] syn keyword issComponentsFlags dontinheritcheck exclusive fixed restart disablenouninstallwarning " [UninstallDelete] and [InstallDelete] syn keyword issInstallDeleteType files filesandordirs dirifempty " [Tasks] syn keyword issTasksFlags checkedonce dontinheritcheck exclusive restart unchecked " Define the default highlighting. " For version 5.7 and earlier: only 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 else command -nargs=+ HiLink hi def link endif " The default methods for highlighting. Can be overridden later HiLink issSection Special HiLink issComment Comment HiLink issDirective Type HiLink issParam Type HiLink issFolder Special HiLink issString String HiLink issURL Include HiLink issPreProc PreProc HiLink issDirsFlags Keyword HiLink issFilesCopyMode Keyword HiLink issFilesAttribs Keyword HiLink issFilesPermissions 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 HiLink issTasksFlags Keyword delcommand HiLink endif let b:current_syntax = "iss" " vim:ts=8 vim-7.4.1689/runtime/syntax/ist.vim000066400000000000000000000046161267703067000171310ustar00rootroot00000000000000" Vim syntax file " Language: Makeindex style file, *.ist " Maintainer: Peter Meszaros " Last Change: 2012 Jan 08 by Thilo Six " For version 5.x: Clear all syntax items " 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:cpo_save = &cpo set cpo&vim 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 else command -nargs=+ HiLink hi def link 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" let &cpo = s:cpo_save unlet s:cpo_save " vim: ts=8 sw=2 vim-7.4.1689/runtime/syntax/j.vim000066400000000000000000000222371267703067000165620ustar00rootroot00000000000000" Vim syntax file " Language: J " Maintainer: David Bürgin <676c7473@gmail.com> " URL: https://github.com/glts/vim-j " Last Change: 2015-01-11 if exists('b:current_syntax') finish endif let s:save_cpo = &cpo set cpo&vim syntax case match syntax sync minlines=100 syntax cluster jStdlibItems contains=jStdlibNoun,jStdlibAdverb,jStdlibConjunction,jStdlibVerb syntax cluster jPrimitiveItems contains=jNoun,jAdverb,jConjunction,jVerb,jCopula syntax match jControl /\<\%(assert\|break\|case\|catch[dt]\=\|continue\|do\|else\%(if\)\=\|end\|fcase\|for\|if\|return\|select\|throw\|try\|whil\%(e\|st\)\)\./ syntax match jControl /\<\%(for\|goto\|label\)_\a\k*\./ " Standard library names. A few names need to be defined with ":syntax match" " because they would otherwise take precedence over the corresponding jControl " and jDefineExpression items. syntax keyword jStdlibNoun ARGV BINPATH CR CRLF DEL Debug EAV EMPTY FF FHS IF64 IFIOS IFJCDROID IFJHS IFQT IFRASPI IFUNIX IFWIN IFWINCE IFWINE IFWOW64 JB01 JBOXED JCHAR JCMPX JFL JINT JPTR JSIZES JSTR JTYPES JVERSION LF LF2 TAB UNAME UNXLIB dbhelp libjqt syntax keyword jStdlibAdverb define each every fapplylines inv inverse items leaf rows rxapply rxmerge table syntax keyword jStdlibConjunction bind cuts def on syntax keyword jStdlibVerb AND Endian IFDEF OR XOR anddf android_exec_am android_exec_host andunzip apply boxopen boxxopen bx calendar cd cdcb cder cderx cdf charsub chopstring cleartags clear coclass cocreate cocurrent codestroy coerase cofind cofindv cofullname coinfo coinsert compare coname conames conew conl conouns conounsx copath copathnl copathnlx coreset costate cut cutLF cutopen cutpara datatype dbctx dberm dberr dbg dbjmp dblocals dblxq dblxs dbnxt dbq dbr dbret dbrr dbrrx dbrun dbs dbsig dbsq dbss dbst dbstack dbstk dbstop dbstopme dbstopnext dbstops dbtrace dbview deb debc delstring detab dfh dir dircompare dircompares dirfind dirpath dirss dirssrplc dirtree dirused dlb dltb dltbs dquote drop dropafter dropto dtb dtbs echo empty endian erase evtloop exit expand f2utf8 fappend fappends fboxname fc fcompare fcompares fcopynew fdir ferase fetch fexist fexists fgets file2url fixdotdot fliprgb fmakex foldpara foldtext fpathcreate fpathname fputs fread freadblock freadr freads frename freplace fsize fss fssrplc fstamp fstringreplace ftype fview fwrite fwritenew fwrites getalpha getargs getdate getenv getqtbin hfd hostpathsep ic install iospath isatty isotimestamp isutf8 jcwdpath joinstring jpath jpathsep jsystemdefs launch list ljust load loadd loadtags mema memf memr memw nameclass namelist names nc nl pick quote require rjust rplc rxE rxall rxcomp rxcut rxeq rxerror rxfirst rxfree rxfrom rxhandles rxin rxindex rxinfo rxmatch rxmatches rxrplc rxutf8 script scriptd scripts setalpha setbreak shell show sign sminfo smoutput sort split splitnostring splitstring ss startupandroid startupconsole startupide stderr stdin stdout stringreplace symdat symget symset ta tagcp tagopen tagselect take takeafter taketo timespacex timestamp timex tmoutput toCRLF toHOST toJ todate todayno tolower topara toupper tsdiff tsrep tstamp type ucp ucpcount unxlib usleep utf8 uucp valdate wcsize weekday weeknumber weeksinyear winpathsep xedit syntax match jStdlibNoun /\<\%(adverb\|conjunction\|dyad\|monad\|noun\|verb\)\>/ syntax match jStdlibVerb /\<\%(Note\|\%(assert\|break\|do\)\.\@!\)\>/ " Numbers. Matching J numbers is difficult. In fact, the job cannot be done " with regular expressions alone. Below is a sketch of the pattern used. It " accepts most well-formed numbers and rejects most of the ill-formed ones. " See http://www.jsoftware.com/help/dictionary/dcons.htm for reference. " " "double1" and "double2" patterns: " (_?\d+(\.\d*)?|_\.\d+)([eE]_?\d+)? " (_?\d+(\.\d*)?|_\.\d+|\.\d+)([eE]_?\d+)? " " "rational1" and "rational2" patterns: " \k(r\k)?|__? " \k(r\k)?|__? " " "complex1" and "complex2" patterns: " \k((j|a[dr])\k)? " \k((j|a[dr])\k)? " " "basevalue" pattern: " _?[0-9a-z]+(\.[0-9a-z]*)?|_?\.[0-9a-z]+ " " all numbers: " \b\k([px]\k)?(b\k)?(?![0-9A-Za-z_.]) syntax match jNumber /\<_\.[0-9A-Za-z_.]\@!/ syntax match jNumber /\<_\=\d\+x[0-9A-Za-z_.]\@!/ syntax match jNumber /\<\%(__\=r_\=\d\+\|_\=\d\+r__\=\)[0-9A-Za-z_.]\@!/ syntax match jNumber /\<\%(\%(_\=\d\+\%(\.\d*\)\=\|_\.\d\+\)\%([eE]_\=\d\+\)\=\%(r\%(_\=\d\+\%(\.\d*\)\=\|_\.\d\+\|\.\d\+\)\%([eE]_\=\d\+\)\=\)\=\|__\=\)\%(\%(j\|a[dr]\)\%(\%(_\=\d\+\%(\.\d*\)\=\|_\.\d\+\|\.\d\+\)\%([eE]_\=\d\+\)\=\%(r\%(_\=\d\+\%(\.\d*\)\=\|_\.\d\+\|\.\d\+\)\%([eE]_\=\d\+\)\=\)\=\|__\=\)\)\=\%([px]\%(\%(_\=\d\+\%(\.\d*\)\=\|_\.\d\+\|\.\d\+\)\%([eE]_\=\d\+\)\=\%(r\%(_\=\d\+\%(\.\d*\)\=\|_\.\d\+\|\.\d\+\)\%([eE]_\=\d\+\)\=\)\=\|__\=\)\%(\%(j\|a[dr]\)\%(\%(_\=\d\+\%(\.\d*\)\=\|_\.\d\+\|\.\d\+\)\%([eE]_\=\d\+\)\=\%(r\%(_\=\d\+\%(\.\d*\)\=\|_\.\d\+\|\.\d\+\)\%([eE]_\=\d\+\)\=\)\=\|__\=\)\)\=\)\=\%(b\%(_\=[0-9a-z]\+\%(\.[0-9a-z]*\)\=\|_\=\.[0-9a-z]\+\)\)\=[0-9A-Za-z_.]\@!/ syntax region jString oneline start=/'/ skip=/''/ end=/'/ syntax keyword jArgument contained x y u v m n " Primitives. Order is significant both within the patterns and among " ":syntax match" statements. Refer to "Parts of speech" in the J dictionary. syntax match jNoun /\+*\-%$|,#][.:]\=\|[~}"][.:]\|{\%[::]\|\<\%([ACeEiIjLor]\.\|p\.\.\=\|[ipqsux]:\|0:\|_\=[1-9]:\)/ syntax match jCopula /=[.:]/ syntax match jConjunction /;\.\|\^:\|![.:]/ " Explicit noun definition. The difficulty is that the define expression can " occur in the middle of a line but the jNounDefine region must only start on " the next line. The trick is to split the problem into two regions and link " them with "nextgroup=". The fold wrapper provides syntax folding. syntax region jNounDefineFold \ matchgroup=NONE start=/\%(\%(\%(^\s*Note\)\|\<\%(0\|noun\)\s\+\%(\:\s*0\|def\s\+0\|define\)\)\>\)\@=/ \ keepend matchgroup=NONE end=/^\s*)\s*$/ \ contains=jNounDefineStart \ fold syntax region jNounDefineStart \ matchgroup=jDefineExpression start=/\%(\%(^\s*Note\)\|\<\%(0\|noun\)\s\+\%(\:\s*0\|def\s\+0\|define\)\)\>/ \ keepend matchgroup=NONE end=/$/ \ contains=@jStdlibItems,@jPrimitiveItems,jNumber,jString,jParenGroup,jParen,jComment \ contained oneline skipempty nextgroup=jDefineEnd,jNounDefine " These two items must have "contained", which allows them to match only after " jNounDefineStart thanks to the "nextgroup=" above. syntax region jNounDefine \ matchgroup=NONE start=/^/ \ matchgroup=jDefineEnd end=/^\s*)\s*$/ \ contained " This match is necessary in case of an empty noun definition syntax match jDefineEnd contained /^\s*)\s*$/ " Explicit verb, adverb, and conjunction definition syntax region jDefine \ matchgroup=jDefineExpression start=/\<\%([1-4]\|13\|adverb\|conjunction\|verb\|monad\|dyad\)\s\+\%(:\s*0\|def\s\+0\|define\)\>/ \ matchgroup=jDefineEnd end=/^\s*)\s*$/ \ contains=jControl,@jStdlibItems,@jPrimitiveItems,jNumber,jString,jArgument,jParenGroup,jParen,jComment,jDefineMonadDyad \ fold syntax match jDefineMonadDyad contained /^\s*:\s*$/ " Paired parentheses. When a jDefineExpression such as "3 : 0" is " parenthesised it will erroneously extend jParenGroup to span over the whole " definition body. This situation receives a special treatment here. syntax match jParen /(\%(\s*\%([0-4]\|13\|noun\|adverb\|conjunction\|verb\|monad\|dyad\)\s\+\%(:\s*0\|def\s\+0\|define\)\s*)\)\@=/ syntax match jParen contained /\%((\s*\%([0-4]\|13\|noun\|adverb\|conjunction\|verb\|monad\|dyad\)\s\+\%(:\s*0\|def\s\+0\|define\)\s*\)\@<=)/ syntax region jParenGroup \ matchgroup=jParen start=/(\%(\s*\%([0-4]\|13\|noun\|adverb\|conjunction\|verb\|monad\|dyad\)\s\+\%(:\s*0\|def\s\+0\|define\)\>\)\@!/ \ matchgroup=jParen end=/)/ \ oneline transparent syntax keyword jTodo contained TODO FIXME XXX syntax match jComment /\ " 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="\" end="\" contains=jalComment,jalPreProc,jalLabel,picIdentifier, picLabel,picASCII,picDecimal,picHexadecimal,picOctal,picComment,picString,picRegister,picRigisterPart,picOpcode,picDirective,jalPIC syn region jalAsm matchgroup=jalAsmKey start="\" 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="/" 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/jam.vim000066400000000000000000000647511267703067000171070ustar00rootroot00000000000000" Vim syntax file " Language: JAM " Maintainer: Ralf Lemke (ralflemk@t-online.de) " Last change: 2012 Jan 08 by Thilo Six " For version 5.x: Clear all syntax items " 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:cpo_save = &cpo set cpo&vim 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 else command -nargs=+ HiLink hi def link 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" let &cpo = s:cpo_save unlet s:cpo_save " vim: ts=8 vim-7.4.1689/runtime/syntax/jargon.vim000066400000000000000000000017561267703067000176140ustar00rootroot00000000000000" Vim syntax file " Language: Jargon File " Maintainer: " 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 else command -nargs=+ HiLink hi def link endif HiLink jargonChaptTitle Title HiLink jargonEmailAddr Comment HiLink jargonUrl Comment HiLink jargonMark Label delcommand HiLink endif let b:current_syntax = "jargon" vim-7.4.1689/runtime/syntax/java.vim000066400000000000000000000440251267703067000172510ustar00rootroot00000000000000" Vim syntax file " Language: Java " Maintainer: Claudio Fleiner " URL: http://www.fleiner.com/vim/syntax/java.vim " Last Change: 2015 March 01 " 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' syn region javaFold start="{" end="}" transparent fold endif let s:cpo_save = &cpo set cpo&vim " don't use standard HiLink, it will not work with included syntax files if version < 508 command! -nargs=+ JavaHiLink hi link else command! -nargs=+ JavaHiLink hi def link 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 "\\(\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*\"ms=s+1 syn keyword javaClassDecl enum syn match javaClassDecl "^class\>" syn match javaClassDecl "[^.]\s*\"ms=s+1 syn match javaAnnotation "@\([_$a-zA-Z][_$a-zA-Z0-9]*\.\)*[_$a-zA-Z][_$a-zA-Z0-9]*\>\(([^)]*)\)\=" contains=javaString syn match javaClassDecl "@interface\>" syn keyword javaBranch break continue nextgroup=javaUserLabelRef skipwhite syn match javaUserLabelRef "\k\+" contained syn match javaVarArg "\.\.\." syn keyword javaScopeDecl public protected private abstract if exists("java_highlight_java_lang_ids") let java_highlight_all=1 endif if exists("java_highlight_all") || exists("java_highlight_java") || exists("java_highlight_java_lang") " java.lang.* syn match javaLangClass "\" syn keyword javaR_JavaLang NegativeArraySizeException ArrayStoreException IllegalStateException RuntimeException IndexOutOfBoundsException UnsupportedOperationException ArrayIndexOutOfBoundsException ArithmeticException ClassCastException EnumConstantNotPresentException StringIndexOutOfBoundsException IllegalArgumentException IllegalMonitorStateException IllegalThreadStateException NumberFormatException NullPointerException TypeNotPresentException SecurityException syn cluster javaTop add=javaR_JavaLang syn cluster javaClasses add=javaR_JavaLang JavaHiLink javaR_JavaLang javaR_Java syn keyword javaC_JavaLang Process RuntimePermission StringKeySet CharacterData01 Class ThreadLocal ThreadLocalMap CharacterData0E Package Character StringCoding Long ProcessImpl ProcessEnvironment Short AssertionStatusDirectives 1PackageInfoProxy UnicodeBlock InheritableThreadLocal AbstractStringBuilder StringEnvironment ClassLoader ConditionalSpecialCasing CharacterDataPrivateUse StringBuffer StringDecoder Entry StringEntry WrappedHook StringBuilder StrictMath State ThreadGroup Runtime CharacterData02 MethodArray Object CharacterDataUndefined Integer Gate Boolean Enum Variable Subset StringEncoder Void Terminator CharsetSD IntegerCache CharacterCache Byte CharsetSE Thread SystemClassLoaderAction CharacterDataLatin1 StringValues StackTraceElement Shutdown ShortCache String ConverterSD ByteCache Lock EnclosingMethodInfo Math Float Value Double SecurityManager LongCache ProcessBuilder StringEntrySet Compiler Number UNIXProcess ConverterSE ExternalData CaseInsensitiveComparator CharacterData00 NativeLibrary syn cluster javaTop add=javaC_JavaLang syn cluster javaClasses add=javaC_JavaLang JavaHiLink javaC_JavaLang javaC_Java syn keyword javaE_JavaLang IncompatibleClassChangeError InternalError UnknownError ClassCircularityError AssertionError ThreadDeath IllegalAccessError NoClassDefFoundError ClassFormatError UnsupportedClassVersionError NoSuchFieldError VerifyError ExceptionInInitializerError InstantiationError LinkageError NoSuchMethodError Error UnsatisfiedLinkError StackOverflowError AbstractMethodError VirtualMachineError OutOfMemoryError syn cluster javaTop add=javaE_JavaLang syn cluster javaClasses add=javaE_JavaLang JavaHiLink javaE_JavaLang javaE_Java syn keyword javaX_JavaLang CloneNotSupportedException Exception NoSuchMethodException IllegalAccessException NoSuchFieldException Throwable InterruptedException ClassNotFoundException InstantiationException syn cluster javaTop add=javaX_JavaLang syn cluster javaClasses add=javaX_JavaLang JavaHiLink javaX_JavaLang javaX_Java JavaHiLink javaR_Java javaR_ JavaHiLink javaC_Java javaC_ JavaHiLink javaE_Java javaE_ JavaHiLink javaX_Java javaX_ JavaHiLink javaX_ javaExceptions JavaHiLink javaR_ javaExceptions JavaHiLink javaE_ javaExceptions JavaHiLink javaC_ javaConstant syn keyword javaLangObject clone equals finalize getClass hashCode syn keyword javaLangObject notify notifyAll toString wait JavaHiLink javaLangObject javaConstant syn cluster javaTop add=javaLangObject endif if filereadable(expand(":p:h")."/javaid.vim") source :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="\" matchgroup=NONE end=":" contains=javaNumber,javaCharacter,javaString syn match javaUserLabel "^\s*[_$a-zA-Z][_$a-zA-Z0-9_]*\s*:"he=e-1 contains=javaLabel syn keyword javaLabel default " highlighting C++ keywords as errors removed, too many people find it " annoying. Was: if !exists("java_allow_cpp_keywords") " 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,javaAnnotation,javaVarArg " 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 :p:h/html.vim unlet b:current_syntax " HTML enables spell checking for all text that is not in a syntax item. This " is wrong for Java (all identifiers would be spell-checked), so it's undone " here. syntax spell default syn region javaDocComment start="/\*\*" end="\*/" keepend contains=javaCommentTitle,@javaHtml,javaDocTags,javaDocSeeTag,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,javaDocSeeTag syn region javaDocTags contained start="{@\(code\|link\|linkplain\|inherit[Dd]oc\|doc[rR]oot\|value\)" end="}" syn match javaDocTags contained "@\(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\)\>" syn region javaDocSeeTag contained matchgroup=javaDocTags start="@see\s\+" matchgroup=NONE end="\_."re=e-1 contains=javaDocSeeTagParam syn match javaDocSeeTagParam contained @"\_[^"]\+"\|\|\(\k\|\.\)*\(#\k\+\((\_[^)]\+)\)\=\)\=@ extend 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[bB][0-1]\+\|0[0-7]*\|0[xX]\x\+\|\d\(\d\|_\d\)*\)[lL]\=\>" syn match javaNumber "\(\<\d\(\d\|_\d\)*\.\(\d\(\d\|_\d\)*\)\=\|\.\d\(\d\|_\d\)*\)\([eE][-+]\=\d\(\d\|_\d\)*\)\=[fFdD]\=" syn match javaNumber "\<\d\(\d\|_\d\)*[eE][-+]\=\d\(\d\|_\d\)*[fFdD]\=\>" syn match javaNumber "\<\d\(\d\|_\d\)*\([eE][-+]\=\d\(\d\|_\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,javaAnnotation syn region javaFuncDef start=+^\(\t\| \{8\}\)[$_a-zA-Z][$_a-zA-Z0-9_. \[\]<>]*([^-+*/]*,\s*+ end=+)+ contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses,javaAnnotation syn match javaFuncDef "^ [$_a-zA-Z][$_a-zA-Z0-9_. \[\]<>]*([^-+*/]*)" contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses,javaAnnotation syn region javaFuncDef start=+^ [$_a-zA-Z][$_a-zA-Z0-9_. \[\]<>]*([^-+*/]*,\s*+ end=+)+ contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses,javaAnnotation 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 syn region javaFuncDef start=+^\s\+\(\(public\|protected\|private\|static\|abstract\|final\|native\|synchronized\)\s\+\)*\(<.*>\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*(+ end=+)+ contains=javaScopeDecl,javaType,javaStorageClass,javaComment,javaLineComment,@javaClasses,javaAnnotation endif syn match javaLambdaDef "[a-zA-Z_][a-zA-Z0-9_]*\s*->" syn match javaBraces "[{}]" syn cluster javaTop add=javaFuncDef,javaBraces,javaLambdaDef 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 "\= 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 ")" " catch errors caused by wrong square 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_highlight_functions") syn match javaLambdaDef "([a-zA-Z0-9_<>\[\], \t]*)\s*->" " needs to be defined after the parenthesis error catcher to work endif 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 javaLambdaDef Function JavaHiLink javaFuncDef Function JavaHiLink javaVarArg 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 javaAnnotation PreProc JavaHiLink javaCommentTitle SpecialComment JavaHiLink javaDocTags Special JavaHiLink javaDocParam Function JavaHiLink javaDocSeeTagParam 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" let &cpo = s:cpo_save unlet s:cpo_save " vim: ts=8 vim-7.4.1689/runtime/syntax/javacc.vim000066400000000000000000000052271267703067000175600ustar00rootroot00000000000000" Vim syntax file " Language: JavaCC, a Java Compiler Compiler written by JavaSoft " Maintainer: Claudio Fleiner " URL: http://www.fleiner.com/vim/syntax/javacc.vim " Last Change: 2012 Oct 05 " 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 let s:cpo_save = &cpo set cpo&vim " source the java.vim file if version < 600 source :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 JDK_VERSION syn match javaccPackages "PARSER_END([^)]*)" syn match javaccPackages "PARSER_BEGIN([^)]*)" syn match javaccSpecToken "" " 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 else command -nargs=+ HiLink hi def link endif HiLink javaccSpecToken Statement HiLink javaccActionToken Type HiLink javaccPackages javaScopeDecl HiLink javaccToken String HiLink javaccError Error delcommand HiLink endif let b:current_syntax = "javacc" let &cpo = s:cpo_save unlet s:cpo_save " vim: ts=8 vim-7.4.1689/runtime/syntax/javascript.vim000066400000000000000000000125361267703067000205000ustar00rootroot00000000000000" Vim syntax file " Language: JavaScript " Maintainer: Claudio Fleiner " Updaters: Scott Shattuck (ss) " URL: http://www.fleiner.com/vim/syntax/javascript.vim " Changes: (ss) added keywords, reserved words, and other identifiers " (ss) repaired several quoting and grouping glitches " (ss) fixed regex parsing issue with multiple qualifiers [gi] " (ss) additional factoring of keywords, globals, and members " Last Change: 2012 Oct 05 " 2013 Jun 12: adjusted javaScriptRegexpString (Kevin Locke) " 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' elseif exists("b:current_syntax") && b:current_syntax == "javascript" finish endif let s:cpo_save = &cpo set cpo&vim " Drop fold if it set but vim doesn't support it. if version < 600 && exists("javaScript_fold") unlet javaScript_fold endif syn keyword javaScriptCommentTodo TODO FIXME XXX TBD contained syn match javaScriptLineComment "\/\/.*" contains=@Spell,javaScriptCommentTodo syn match javaScriptCommentSkip "^[ \t]*\*\($\|[ \t]\+\)" syn region javaScriptComment start="/\*" end="\*/" contains=@Spell,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=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[gim]\{0,2\}\s*$+ end=+/[gim]\{0,2\}\s*[;.,)\]}]+me=e-1 contains=@htmlPreproc oneline syn keyword javaScriptConditional if else switch syn keyword javaScriptRepeat while for do in syn keyword javaScriptBranch break continue syn keyword javaScriptOperator new delete instanceof typeof syn keyword javaScriptType Array Boolean Date Function Number Object String RegExp syn keyword javaScriptStatement return with syn keyword javaScriptBoolean true false syn keyword javaScriptNull null undefined syn keyword javaScriptIdentifier arguments this var let syn keyword javaScriptLabel case default syn keyword javaScriptException try catch finally throw syn keyword javaScriptMessage alert confirm prompt status syn keyword javaScriptGlobal self window top parent syn keyword javaScriptMember document event location syn keyword javaScriptDeprecated escape unescape syn keyword javaScriptReserved abstract boolean byte char class const debugger double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile if exists("javaScript_fold") syn match javaScriptFunction "\" syn region javaScriptFunctionFold start="\.*[^};]$" end="^\z1}.*$" transparent fold keepend syn sync match javaScriptSync grouphere javaScriptFunctionFold "\" syn sync match javaScriptSync grouphere NONE "^}" setlocal foldmethod=syntax setlocal foldtext=getline(v:foldstart) else syn keyword javaScriptFunction function syn match javaScriptBraces "[{}\[\]]" syn match javaScriptParens "[()]" endif syn sync fromstart syn sync maxlines=100 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 else command -nargs=+ HiLink hi def link 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 javaScriptNull Keyword HiLink javaScriptBoolean Boolean HiLink javaScriptRegexpString String HiLink javaScriptIdentifier Identifier HiLink javaScriptLabel Label HiLink javaScriptException Exception HiLink javaScriptMessage Keyword HiLink javaScriptGlobal Keyword HiLink javaScriptMember Keyword HiLink javaScriptDeprecated Exception HiLink javaScriptReserved Keyword HiLink javaScriptDebug Debug HiLink javaScriptConstant Label delcommand HiLink endif let b:current_syntax = "javascript" if main_syntax == 'javascript' unlet main_syntax endif let &cpo = s:cpo_save unlet s:cpo_save " vim: ts=8 vim-7.4.1689/runtime/syntax/jess.vim000066400000000000000000000150321267703067000172700ustar00rootroot00000000000000" Vim syntax file " Language: Jess " Maintainer: Paul Baleme " 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 "\" " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/jgraph.vim000066400000000000000000000031201267703067000175720ustar00rootroot00000000000000" 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 else command -nargs=+ HiLink hi def link endif HiLink jgraphComment Comment HiLink jgraphCmd Identifier HiLink jgraphType Type HiLink jgraphNumber Number delcommand HiLink endif let b:current_syntax = "jgraph" vim-7.4.1689/runtime/syntax/jovial.vim000066400000000000000000000100131267703067000176020ustar00rootroot00000000000000" Vim syntax file " Language: JOVIAL J73 " Version: 1.2 " Maintainer: Paul McGinnis " Last Change: 2011/06/17 " Remark: Based on MIL-STD-1589C for JOVIAL J73 language " Quit when a (custom) syntax file was already loaded if exists("b:current_syntax") finish endif syn case ignore syn keyword jovialTodo TODO FIXME XXX contained " JOVIAL beads - first digit is number of bits, [0-9A-V] is the bit value " representing 0-31 (for 5 bits on the bead) syn match jovialBitConstant "[1-5]B'[0-9A-V]'" syn match jovialNumber "\<\d\+\>" syn match jovialFloat "\d\+E[-+]\=\d\+" syn match jovialFloat "\d\+\.\d*\(E[-+]\=\d\+\)\=" syn match jovialFloat "\.\d\+\(E[-+]\=\d\+\)\=" syn region jovialComment start=/"/ end=/"/ contains=jovialTodo syn region jovialComment start=/%/ end=/%/ contains=jovialTodo " JOVIAL variable names. This rule is to prevent conflicts with strings. " Handle special case where ' character can be part of a JOVIAL variable name. syn match jovialIdentifier "[A-Z\$][A-Z0-9'\$]\+" syn region jovialString start="\s*'" skip=/''/ end=/'/ oneline " JOVIAL compiler directives -- see Section 9 in MIL-STD-1589C syn region jovialPreProc start="\s*![A-Z]\+" end=/;/ syn keyword jovialOperator AND OR NOT XOR EQV MOD " See Section 2.1 in MIL-STD-1589C for data types syn keyword jovialType ITEM B C P V syn match jovialType "\" syn match jovialType "\" syn match jovialType "\" syn match jovialType "\" syn keyword jovialStorageClass STATIC CONSTANT PARALLEL BLOCK N M D W syn keyword jovialStructure TABLE STATUS syn keyword jovialConstant NULL syn keyword jovialBoolean FALSE TRUE syn keyword jovialTypedef TYPE syn keyword jovialStatement ABORT BEGIN BY BYREF BYRES BYVAL CASE COMPOOL syn keyword jovialStatement DEF DEFAULT DEFINE ELSE END EXIT FALLTHRU FOR syn keyword jovialStatement GOTO IF INLINE INSTANCE LABEL LIKE OVERLAY POS syn keyword jovialStatement PROC PROGRAM REC REF RENT REP RETURN START STOP syn keyword jovialStatement TERM THEN WHILE " JOVIAL extensions, see section 8.2.2 in MIL-STD-1589C syn keyword jovialStatement CONDITION ENCAPSULATION EXPORTS FREE HANDLER IN INTERRUPT NEW syn keyword jovialStatement PROTECTED READONLY REGISTER SIGNAL TO UPDATE WITH WRITEONLY ZONE " implementation specific constants and functions, see section 1.4 in MIL-STD-1589C syn keyword jovialConstant BITSINBYTE BITSINWORD LOCSINWORD syn keyword jovialConstant BYTESINWORD BITSINPOINTER INTPRECISION syn keyword jovialConstant FLOATPRECISION FIXEDPRECISION FLOATRADIX syn keyword jovialConstant MAXFLOATPRECISION MAXFIXEDPRECISION syn keyword jovialConstant MAXINTSIZE MAXBYTES MAXBITS syn keyword jovialConstant MAXTABLESIZE MAXSTOP MINSTOP MAXSIGDIGITS syn keyword jovialFunction BYTEPOS MAXINT MININT syn keyword jovialFunction IMPLFLOATPRECISION IMPLFIXEDPRECISION IMPLINTSIZE syn keyword jovialFunction MINSIZE MINFRACTION MINSCALE MINRELPRECISION syn keyword jovialFunction MAXFLOAT MINFLOAT FLOATRELPRECISION syn keyword jovialFunction FLOATUNDERFLOW MAXFIXED MINFIXED " JOVIAL built-in functions syn keyword jovialFunction LOC NEXT BIT BYTE SHIFTL SHIFTR ABS SGN BITSIZE syn keyword jovialFunction BYTESIZE WORDSIZE LBOUND UBOUND NWDSEN FIRST syn keyword jovialFunction LAST NENT " Define the default highlighting. hi def link jovialBitConstant Number hi def link jovialBoolean Boolean hi def link jovialComment Comment hi def link jovialConstant Constant hi def link jovialFloat Float hi def link jovialFunction Function " No color highlighting for JOVIAL identifiers. See above, " this is to prevent confusion with JOVIAL strings "hi def link jovialIdentifier Identifier hi def link jovialNumber Number hi def link jovialOperator Operator hi def link jovialPreProc PreProc hi def link jovialStatement Statement hi def link jovialStorageClass StorageClass hi def link jovialString String hi def link jovialStructure Structure hi def link jovialTodo Todo hi def link jovialType Type hi def link jovialTypedef Typedef let b:current_syntax = "jovial" " vim: ts=8 vim-7.4.1689/runtime/syntax/jproperties.vim000066400000000000000000000134041267703067000206730ustar00rootroot00000000000000" Vim syntax file " Language: Java Properties resource file (*.properties[_*]) " Maintainer: Simon Baldwin " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/json.vim000066400000000000000000000142121267703067000172740ustar00rootroot00000000000000" Vim syntax file " Language: JSON " Maintainer: Eli Parra " Last Change: 2014 Aug 23 " Version: 0.12 if !exists("main_syntax") if version < 600 syntax clear elseif exists("b:current_syntax") finish endif let main_syntax = 'json' endif syntax match jsonNoise /\%(:\|,\)/ " NOTE that for the concealing to work your conceallevel should be set to 2 " Syntax: Strings " Separated into a match and region because a region by itself is always greedy syn match jsonStringMatch /"\([^"]\|\\\"\)\+"\ze[[:blank:]\r\n]*[,}\]]/ contains=jsonString if has('conceal') syn region jsonString oneline matchgroup=jsonQuote start=/"/ skip=/\\\\\|\\"/ end=/"/ concealends contains=jsonEscape contained else syn region jsonString oneline matchgroup=jsonQuote start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=jsonEscape contained endif " Syntax: JSON does not allow strings with single quotes, unlike JavaScript. syn region jsonStringSQError oneline start=+'+ skip=+\\\\\|\\"+ end=+'+ " Syntax: JSON Keywords " Separated into a match and region because a region by itself is always greedy syn match jsonKeywordMatch /"\([^"]\|\\\"\)\+"[[:blank:]\r\n]*\:/ contains=jsonKeyword if has('conceal') syn region jsonKeyword matchgroup=jsonQuote start=/"/ end=/"\ze[[:blank:]\r\n]*\:/ concealends contained else syn region jsonKeyword matchgroup=jsonQuote start=/"/ end=/"\ze[[:blank:]\r\n]*\:/ contained endif " Syntax: Escape sequences syn match jsonEscape "\\["\\/bfnrt]" contained syn match jsonEscape "\\u\x\{4}" contained " Syntax: Numbers syn match jsonNumber "-\=\<\%(0\|[1-9]\d*\)\%(\.\d\+\)\=\%([eE][-+]\=\d\+\)\=\>\ze[[:blank:]\r\n]*[,}\]]" " ERROR WARNINGS ********************************************** if (!exists("g:vim_json_warnings") || g:vim_json_warnings==1) " Syntax: Strings should always be enclosed with quotes. syn match jsonNoQuotesError "\<[[:alpha:]][[:alnum:]]*\>" syn match jsonTripleQuotesError /"""/ " Syntax: An integer part of 0 followed by other digits is not allowed. syn match jsonNumError "-\=\<0\d\.\d*\>" " Syntax: Decimals smaller than one should begin with 0 (so .1 should be 0.1). syn match jsonNumError "\:\@<=[[:blank:]\r\n]*\zs\.\d\+" " Syntax: No comments in JSON, see http://stackoverflow.com/questions/244777/can-i-comment-a-json-file syn match jsonCommentError "//.*" syn match jsonCommentError "\(/\*\)\|\(\*/\)" " Syntax: No semicolons in JSON syn match jsonSemicolonError ";" " Syntax: No trailing comma after the last element of arrays or objects syn match jsonTrailingCommaError ",\_s*[}\]]" " Syntax: Watch out for missing commas between elements syn match jsonMissingCommaError /\("\|\]\|\d\)\zs\_s\+\ze"/ syn match jsonMissingCommaError /\(\]\|\}\)\_s\+\ze"/ "arrays/objects as values syn match jsonMissingCommaError /}\_s\+\ze{/ "objects as elements in an array syn match jsonMissingCommaError /\(true\|false\)\_s\+\ze"/ "true/false as value endif " ********************************************** END OF ERROR WARNINGS " Allowances for JSONP: function call at the beginning of the file, " parenthesis and semicolon at the end. " Function name validation based on " http://stackoverflow.com/questions/2008279/validate-a-javascript-function-name/2008444#2008444 syn match jsonPadding "\%^[[:blank:]\r\n]*[_$[:alpha:]][_$[:alnum:]]*[[:blank:]\r\n]*(" syn match jsonPadding ");[[:blank:]\r\n]*\%$" " Syntax: Boolean syn match jsonBoolean /\(true\|false\)\(\_s\+\ze"\)\@!/ " Syntax: Null syn keyword jsonNull null " Syntax: Braces syn region jsonFold matchgroup=jsonBraces start="{" end=/}\(\_s\+\ze\("\|{\)\)\@!/ transparent fold syn region jsonFold matchgroup=jsonBraces start="\[" end=/]\(\_s\+\ze"\)\@!/ transparent fold " Define the default highlighting. " For version 5.7 and earlier: only when not done already " For version 5.8 and later: only when an item doesn't have highlighting yet if version >= 508 || !exists("did_json_syn_inits") if version < 508 let did_json_syn_inits = 1 command -nargs=+ HiLink hi link else command -nargs=+ HiLink hi def link endif HiLink jsonPadding Operator HiLink jsonString String HiLink jsonTest Label HiLink jsonEscape Special HiLink jsonNumber Number HiLink jsonBraces Delimiter HiLink jsonNull Function HiLink jsonBoolean Boolean HiLink jsonKeyword Label if (!exists("g:vim_json_warnings") || g:vim_json_warnings==1) HiLink jsonNumError Error HiLink jsonCommentError Error HiLink jsonSemicolonError Error HiLink jsonTrailingCommaError Error HiLink jsonMissingCommaError Error HiLink jsonStringSQError Error HiLink jsonNoQuotesError Error HiLink jsonTripleQuotesError Error endif HiLink jsonQuote Quote HiLink jsonNoise Noise delcommand HiLink endif let b:current_syntax = "json" if main_syntax == 'json' unlet main_syntax endif " Vim settings " vim: ts=8 fdm=marker " MIT License " Copyright (c) 2013, Jeroen Ruigrok van der Werven, Eli Parra "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 AUTHORS OR COPYRIGHT HOLDERS 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. "See https://twitter.com/elzr/status/294964017926119424 vim-7.4.1689/runtime/syntax/jsp.vim000066400000000000000000000060621267703067000171230ustar00rootroot00000000000000" Vim syntax file " Language: JSP (Java Server Pages) " Maintainer: Rafael Garcia-Suarez " URL: http://rgarciasuarez.free.fr/vim/syntax/jsp.vim " Last change: 2004 Feb 02 " Credits : Patch by Darren Greaves (recognizes 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 :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 syntax/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=// 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 clear htmlTag syn region htmlTag start=+<[^/%]+ end=+>+ contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition,@htmlPreproc,@htmlArgCluster,jspExpr,javaScript " Define the default highlighting. " For version 5.7 and earlier: only 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/kconfig.vim000066400000000000000000001067201267703067000177510ustar00rootroot00000000000000" Vim syntax file " Maintainer: Christian Brabandt " Previous Maintainer: Nikolai Weibull " Latest Revision: 2015-05-29 " License: Vim (see :h license) " Repository: https://github.com/chrisbra/vim-kconfig if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim if exists("g:kconfig_syntax_heavy") syn match kconfigBegin '^' nextgroup=kconfigKeyword \ skipwhite syn keyword kconfigTodo contained TODO FIXME XXX NOTE syn match kconfigComment display '#.*$' contains=kconfigTodo syn keyword kconfigKeyword config nextgroup=kconfigSymbol \ skipwhite syn keyword kconfigKeyword menuconfig nextgroup=kconfigSymbol \ skipwhite syn keyword kconfigKeyword comment menu mainmenu \ nextgroup=kconfigKeywordPrompt \ skipwhite syn keyword kconfigKeyword choice \ nextgroup=@kconfigConfigOptions \ skipwhite skipnl syn keyword kconfigKeyword endmenu endchoice syn keyword kconfigPreProc source \ nextgroup=kconfigPath \ skipwhite " TODO: This is a hack. The who .*Expr stuff should really be generated so " that we can reuse it for various nextgroups. syn keyword kconfigConditional if endif \ nextgroup=@kconfigConfigOptionIfExpr \ skipwhite syn match kconfigKeywordPrompt '"[^"\\]*\%(\\.[^"\\]*\)*"' \ contained \ nextgroup=@kconfigConfigOptions \ skipwhite skipnl syn match kconfigPath '"[^"\\]*\%(\\.[^"\\]*\)*"\|\S\+' \ contained syn match kconfigSymbol '\<\k\+\>' \ contained \ nextgroup=@kconfigConfigOptions \ skipwhite skipnl " FIXME: There is – probably – no reason to cluster these instead of just " defining them in the same group. syn cluster kconfigConfigOptions contains=kconfigTypeDefinition, \ kconfigInputPrompt, \ kconfigDefaultValue, \ kconfigDependencies, \ kconfigReverseDependencies, \ kconfigNumericalRanges, \ kconfigHelpText, \ kconfigDefBool, \ kconfigOptional syn keyword kconfigTypeDefinition bool boolean tristate string hex int \ contained \ nextgroup=kconfigTypeDefPrompt, \ @kconfigConfigOptions \ skipwhite skipnl syn match kconfigTypeDefPrompt '"[^"\\]*\%(\\.[^"\\]*\)*"' \ contained \ nextgroup=kconfigConfigOptionIf, \ @kconfigConfigOptions \ skipwhite skipnl syn match kconfigTypeDefPrompt "'[^'\\]*\%(\\.[^'\\]*\)*'" \ contained \ nextgroup=kconfigConfigOptionIf, \ @kconfigConfigOptions \ skipwhite skipnl syn keyword kconfigInputPrompt prompt \ contained \ nextgroup=kconfigPromptPrompt \ skipwhite syn match kconfigPromptPrompt '"[^"\\]*\%(\\.[^"\\]*\)*"' \ contained \ nextgroup=kconfigConfigOptionIf, \ @kconfigConfigOptions \ skipwhite skipnl syn match kconfigPromptPrompt "'[^'\\]*\%(\\.[^'\\]*\)*'" \ contained \ nextgroup=kconfigConfigOptionIf, \ @kconfigConfigOptions \ skipwhite skipnl syn keyword kconfigDefaultValue default \ contained \ nextgroup=@kconfigConfigOptionExpr \ skipwhite syn match kconfigDependencies 'depends on\|requires' \ contained \ nextgroup=@kconfigConfigOptionIfExpr \ skipwhite syn keyword kconfigReverseDependencies select \ contained \ nextgroup=@kconfigRevDepSymbol \ skipwhite syn cluster kconfigRevDepSymbol contains=kconfigRevDepCSymbol, \ kconfigRevDepNCSymbol syn match kconfigRevDepCSymbol '"[^"\\]*\%(\\.[^"\\]*\)*"' \ contained \ nextgroup=kconfigConfigOptionIf, \ @kconfigConfigOptions \ skipwhite skipnl syn match kconfigRevDepCSymbol "'[^'\\]*\%(\\.[^'\\]*\)*'" \ contained \ nextgroup=kconfigConfigOptionIf, \ @kconfigConfigOptions \ skipwhite skipnl syn match kconfigRevDepNCSymbol '\<\k\+\>' \ contained \ nextgroup=kconfigConfigOptionIf, \ @kconfigConfigOptions \ skipwhite skipnl syn keyword kconfigNumericalRanges range \ contained \ nextgroup=@kconfigRangeSymbol \ skipwhite syn cluster kconfigRangeSymbol contains=kconfigRangeCSymbol, \ kconfigRangeNCSymbol syn match kconfigRangeCSymbol '"[^"\\]*\%(\\.[^"\\]*\)*"' \ contained \ nextgroup=@kconfigRangeSymbol2 \ skipwhite skipnl syn match kconfigRangeCSymbol "'[^'\\]*\%(\\.[^'\\]*\)*'" \ contained \ nextgroup=@kconfigRangeSymbol2 \ skipwhite skipnl syn match kconfigRangeNCSymbol '\<\k\+\>' \ contained \ nextgroup=@kconfigRangeSymbol2 \ skipwhite skipnl syn cluster kconfigRangeSymbol2 contains=kconfigRangeCSymbol2, \ kconfigRangeNCSymbol2 syn match kconfigRangeCSymbol2 "'[^'\\]*\%(\\.[^'\\]*\)*'" \ contained \ nextgroup=kconfigConfigOptionIf, \ @kconfigConfigOptions \ skipwhite skipnl syn match kconfigRangeNCSymbol2 '\<\k\+\>' \ contained \ nextgroup=kconfigConfigOptionIf, \ @kconfigConfigOptions \ skipwhite skipnl syn region kconfigHelpText contained \ matchgroup=kconfigConfigOption \ start='\%(help\|---help---\)\ze\s*\n\z(\s\+\)' \ skip='^$' \ end='^\z1\@!' \ nextgroup=@kconfigConfigOptions \ skipwhite skipnl " XXX: Undocumented syn keyword kconfigDefBool def_bool \ contained \ nextgroup=@kconfigDefBoolSymbol \ skipwhite syn cluster kconfigDefBoolSymbol contains=kconfigDefBoolCSymbol, \ kconfigDefBoolNCSymbol syn match kconfigDefBoolCSymbol '"[^"\\]*\%(\\.[^"\\]*\)*"' \ contained \ nextgroup=kconfigConfigOptionIf, \ @kconfigConfigOptions \ skipwhite skipnl syn match kconfigDefBoolCSymbol "'[^'\\]*\%(\\.[^'\\]*\)*'" \ contained \ nextgroup=kconfigConfigOptionIf, \ @kconfigConfigOptions \ skipwhite skipnl syn match kconfigDefBoolNCSymbol '\<\k\+\>' \ contained \ nextgroup=kconfigConfigOptionIf, \ @kconfigConfigOptions \ skipwhite skipnl " XXX: This is actually only a valid option for “choice”, but treating it " specially would require a lot of extra groups. syn keyword kconfigOptional optional \ contained \ nextgroup=@kconfigConfigOptions \ skipwhite skipnl syn keyword kconfigConfigOptionIf if \ contained \ nextgroup=@kconfigConfigOptionIfExpr \ skipwhite syn cluster kconfigConfigOptionIfExpr contains=@kconfigConfOptIfExprSym, \ kconfigConfOptIfExprNeg, \ kconfigConfOptIfExprGroup syn cluster kconfigConfOptIfExprSym contains=kconfigConfOptIfExprCSym, \ kconfigConfOptIfExprNCSym syn match kconfigConfOptIfExprCSym '"[^"\\]*\%(\\.[^"\\]*\)*"' \ contained \ nextgroup=@kconfigConfigOptions, \ kconfigConfOptIfExprAnd, \ kconfigConfOptIfExprOr, \ kconfigConfOptIfExprEq, \ kconfigConfOptIfExprNEq \ skipwhite skipnl syn match kconfigConfOptIfExprCSym "'[^'\\]*\%(\\.[^'\\]*\)*'" \ contained \ nextgroup=@kconfigConfigOptions, \ kconfigConfOptIfExprAnd, \ kconfigConfOptIfExprOr, \ kconfigConfOptIfExprEq, \ kconfigConfOptIfExprNEq \ skipwhite skipnl syn match kconfigConfOptIfExprNCSym '\<\k\+\>' \ contained \ nextgroup=@kconfigConfigOptions, \ kconfigConfOptIfExprAnd, \ kconfigConfOptIfExprOr, \ kconfigConfOptIfExprEq, \ kconfigConfOptIfExprNEq \ skipwhite skipnl syn cluster kconfigConfOptIfExprSym2 contains=kconfigConfOptIfExprCSym2, \ kconfigConfOptIfExprNCSym2 syn match kconfigConfOptIfExprEq '=' \ contained \ nextgroup=@kconfigConfOptIfExprSym2 \ skipwhite syn match kconfigConfOptIfExprNEq '!=' \ contained \ nextgroup=@kconfigConfOptIfExprSym2 \ skipwhite syn match kconfigConfOptIfExprCSym2 "'[^'\\]*\%(\\.[^'\\]*\)*'" \ contained \ nextgroup=@kconfigConfigOptions, \ kconfigConfOptIfExprAnd, \ kconfigConfOptIfExprOr \ skipwhite skipnl syn match kconfigConfOptIfExprNCSym2 '\<\k\+\>' \ contained \ nextgroup=@kconfigConfigOptions, \ kconfigConfOptIfExprAnd, \ kconfigConfOptIfExprOr \ skipwhite skipnl syn match kconfigConfOptIfExprNeg '!' \ contained \ nextgroup=@kconfigConfigOptionIfExpr \ skipwhite syn match kconfigConfOptIfExprAnd '&&' \ contained \ nextgroup=@kconfigConfigOptionIfExpr \ skipwhite syn match kconfigConfOptIfExprOr '||' \ contained \ nextgroup=@kconfigConfigOptionIfExpr \ skipwhite syn match kconfigConfOptIfExprGroup '(' \ contained \ nextgroup=@kconfigConfigOptionIfGExp \ skipwhite " TODO: hm, this kind of recursion doesn't work right. We need another set of " expressions that have kconfigConfigOPtionIfGExp as nextgroup and a matcher " for '(' that sets it all off. syn cluster kconfigConfigOptionIfGExp contains=@kconfigConfOptIfGExpSym, \ kconfigConfOptIfGExpNeg, \ kconfigConfOptIfExprGroup syn cluster kconfigConfOptIfGExpSym contains=kconfigConfOptIfGExpCSym, \ kconfigConfOptIfGExpNCSym syn match kconfigConfOptIfGExpCSym '"[^"\\]*\%(\\.[^"\\]*\)*"' \ contained \ nextgroup=@kconfigConfigIf, \ kconfigConfOptIfGExpAnd, \ kconfigConfOptIfGExpOr, \ kconfigConfOptIfGExpEq, \ kconfigConfOptIfGExpNEq \ skipwhite skipnl syn match kconfigConfOptIfGExpCSym "'[^'\\]*\%(\\.[^'\\]*\)*'" \ contained \ nextgroup=@kconfigConfigIf, \ kconfigConfOptIfGExpAnd, \ kconfigConfOptIfGExpOr, \ kconfigConfOptIfGExpEq, \ kconfigConfOptIfGExpNEq \ skipwhite skipnl syn match kconfigConfOptIfGExpNCSym '\<\k\+\>' \ contained \ nextgroup=kconfigConfOptIfExprGrpE, \ kconfigConfOptIfGExpAnd, \ kconfigConfOptIfGExpOr, \ kconfigConfOptIfGExpEq, \ kconfigConfOptIfGExpNEq \ skipwhite skipnl syn cluster kconfigConfOptIfGExpSym2 contains=kconfigConfOptIfGExpCSym2, \ kconfigConfOptIfGExpNCSym2 syn match kconfigConfOptIfGExpEq '=' \ contained \ nextgroup=@kconfigConfOptIfGExpSym2 \ skipwhite syn match kconfigConfOptIfGExpNEq '!=' \ contained \ nextgroup=@kconfigConfOptIfGExpSym2 \ skipwhite syn match kconfigConfOptIfGExpCSym2 '"[^"\\]*\%(\\.[^"\\]*\)*"' \ contained \ nextgroup=kconfigConfOptIfExprGrpE, \ kconfigConfOptIfGExpAnd, \ kconfigConfOptIfGExpOr \ skipwhite skipnl syn match kconfigConfOptIfGExpCSym2 "'[^'\\]*\%(\\.[^'\\]*\)*'" \ contained \ nextgroup=kconfigConfOptIfExprGrpE, \ kconfigConfOptIfGExpAnd, \ kconfigConfOptIfGExpOr \ skipwhite skipnl syn match kconfigConfOptIfGExpNCSym2 '\<\k\+\>' \ contained \ nextgroup=kconfigConfOptIfExprGrpE, \ kconfigConfOptIfGExpAnd, \ kconfigConfOptIfGExpOr \ skipwhite skipnl syn match kconfigConfOptIfGExpNeg '!' \ contained \ nextgroup=@kconfigConfigOptionIfGExp \ skipwhite syn match kconfigConfOptIfGExpAnd '&&' \ contained \ nextgroup=@kconfigConfigOptionIfGExp \ skipwhite syn match kconfigConfOptIfGExpOr '||' \ contained \ nextgroup=@kconfigConfigOptionIfGExp \ skipwhite syn match kconfigConfOptIfExprGrpE ')' \ contained \ nextgroup=@kconfigConfigOptions, \ kconfigConfOptIfExprAnd, \ kconfigConfOptIfExprOr \ skipwhite skipnl syn cluster kconfigConfigOptionExpr contains=@kconfigConfOptExprSym, \ kconfigConfOptExprNeg, \ kconfigConfOptExprGroup syn cluster kconfigConfOptExprSym contains=kconfigConfOptExprCSym, \ kconfigConfOptExprNCSym syn match kconfigConfOptExprCSym '"[^"\\]*\%(\\.[^"\\]*\)*"' \ contained \ nextgroup=kconfigConfigOptionIf, \ kconfigConfOptExprAnd, \ kconfigConfOptExprOr, \ kconfigConfOptExprEq, \ kconfigConfOptExprNEq, \ @kconfigConfigOptions \ skipwhite skipnl syn match kconfigConfOptExprCSym "'[^'\\]*\%(\\.[^'\\]*\)*'" \ contained \ nextgroup=kconfigConfigOptionIf, \ kconfigConfOptExprAnd, \ kconfigConfOptExprOr, \ kconfigConfOptExprEq, \ kconfigConfOptExprNEq, \ @kconfigConfigOptions \ skipwhite skipnl syn match kconfigConfOptExprNCSym '\<\k\+\>' \ contained \ nextgroup=kconfigConfigOptionIf, \ kconfigConfOptExprAnd, \ kconfigConfOptExprOr, \ kconfigConfOptExprEq, \ kconfigConfOptExprNEq, \ @kconfigConfigOptions \ skipwhite skipnl syn cluster kconfigConfOptExprSym2 contains=kconfigConfOptExprCSym2, \ kconfigConfOptExprNCSym2 syn match kconfigConfOptExprEq '=' \ contained \ nextgroup=@kconfigConfOptExprSym2 \ skipwhite syn match kconfigConfOptExprNEq '!=' \ contained \ nextgroup=@kconfigConfOptExprSym2 \ skipwhite syn match kconfigConfOptExprCSym2 '"[^"\\]*\%(\\.[^"\\]*\)*"' \ contained \ nextgroup=kconfigConfigOptionIf, \ kconfigConfOptExprAnd, \ kconfigConfOptExprOr, \ @kconfigConfigOptions \ skipwhite skipnl syn match kconfigConfOptExprCSym2 "'[^'\\]*\%(\\.[^'\\]*\)*'" \ contained \ nextgroup=kconfigConfigOptionIf, \ kconfigConfOptExprAnd, \ kconfigConfOptExprOr, \ @kconfigConfigOptions \ skipwhite skipnl syn match kconfigConfOptExprNCSym2 '\<\k\+\>' \ contained \ nextgroup=kconfigConfigOptionIf, \ kconfigConfOptExprAnd, \ kconfigConfOptExprOr, \ @kconfigConfigOptions \ skipwhite skipnl syn match kconfigConfOptExprNeg '!' \ contained \ nextgroup=@kconfigConfigOptionExpr \ skipwhite syn match kconfigConfOptExprAnd '&&' \ contained \ nextgroup=@kconfigConfigOptionExpr \ skipwhite syn match kconfigConfOptExprOr '||' \ contained \ nextgroup=@kconfigConfigOptionExpr \ skipwhite syn match kconfigConfOptExprGroup '(' \ contained \ nextgroup=@kconfigConfigOptionGExp \ skipwhite syn cluster kconfigConfigOptionGExp contains=@kconfigConfOptGExpSym, \ kconfigConfOptGExpNeg, \ kconfigConfOptGExpGroup syn cluster kconfigConfOptGExpSym contains=kconfigConfOptGExpCSym, \ kconfigConfOptGExpNCSym syn match kconfigConfOptGExpCSym '"[^"\\]*\%(\\.[^"\\]*\)*"' \ contained \ nextgroup=kconfigConfOptExprGrpE, \ kconfigConfOptGExpAnd, \ kconfigConfOptGExpOr, \ kconfigConfOptGExpEq, \ kconfigConfOptGExpNEq \ skipwhite skipnl syn match kconfigConfOptGExpCSym "'[^'\\]*\%(\\.[^'\\]*\)*'" \ contained \ nextgroup=kconfigConfOptExprGrpE, \ kconfigConfOptGExpAnd, \ kconfigConfOptGExpOr, \ kconfigConfOptGExpEq, \ kconfigConfOptGExpNEq \ skipwhite skipnl syn match kconfigConfOptGExpNCSym '\<\k\+\>' \ contained \ nextgroup=kconfigConfOptExprGrpE, \ kconfigConfOptGExpAnd, \ kconfigConfOptGExpOr, \ kconfigConfOptGExpEq, \ kconfigConfOptGExpNEq \ skipwhite skipnl syn cluster kconfigConfOptGExpSym2 contains=kconfigConfOptGExpCSym2, \ kconfigConfOptGExpNCSym2 syn match kconfigConfOptGExpEq '=' \ contained \ nextgroup=@kconfigConfOptGExpSym2 \ skipwhite syn match kconfigConfOptGExpNEq '!=' \ contained \ nextgroup=@kconfigConfOptGExpSym2 \ skipwhite syn match kconfigConfOptGExpCSym2 '"[^"\\]*\%(\\.[^"\\]*\)*"' \ contained \ nextgroup=kconfigConfOptExprGrpE, \ kconfigConfOptGExpAnd, \ kconfigConfOptGExpOr \ skipwhite skipnl syn match kconfigConfOptGExpCSym2 "'[^'\\]*\%(\\.[^'\\]*\)*'" \ contained \ nextgroup=kconfigConfOptExprGrpE, \ kconfigConfOptGExpAnd, \ kconfigConfOptGExpOr \ skipwhite skipnl syn match kconfigConfOptGExpNCSym2 '\<\k\+\>' \ contained \ nextgroup=kconfigConfOptExprGrpE, \ kconfigConfOptGExpAnd, \ kconfigConfOptGExpOr \ skipwhite skipnl syn match kconfigConfOptGExpNeg '!' \ contained \ nextgroup=@kconfigConfigOptionGExp \ skipwhite syn match kconfigConfOptGExpAnd '&&' \ contained \ nextgroup=@kconfigConfigOptionGExp \ skipwhite syn match kconfigConfOptGExpOr '||' \ contained \ nextgroup=@kconfigConfigOptionGExp \ skipwhite syn match kconfigConfOptExprGrpE ')' \ contained \ nextgroup=kconfigConfigOptionIf, \ kconfigConfOptExprAnd, \ kconfigConfOptExprOr \ skipwhite skipnl syn sync minlines=50 hi def link kconfigTodo Todo hi def link kconfigComment Comment hi def link kconfigKeyword Keyword hi def link kconfigPreProc PreProc hi def link kconfigConditional Conditional hi def link kconfigPrompt String hi def link kconfigKeywordPrompt kconfigPrompt hi def link kconfigPath String hi def link kconfigSymbol String hi def link kconfigConstantSymbol Constant hi def link kconfigConfigOption Type hi def link kconfigTypeDefinition kconfigConfigOption hi def link kconfigTypeDefPrompt kconfigPrompt hi def link kconfigInputPrompt kconfigConfigOption hi def link kconfigPromptPrompt kconfigPrompt hi def link kconfigDefaultValue kconfigConfigOption hi def link kconfigDependencies kconfigConfigOption hi def link kconfigReverseDependencies kconfigConfigOption hi def link kconfigRevDepCSymbol kconfigConstantSymbol hi def link kconfigRevDepNCSymbol kconfigSymbol hi def link kconfigNumericalRanges kconfigConfigOption hi def link kconfigRangeCSymbol kconfigConstantSymbol hi def link kconfigRangeNCSymbol kconfigSymbol hi def link kconfigRangeCSymbol2 kconfigConstantSymbol hi def link kconfigRangeNCSymbol2 kconfigSymbol hi def link kconfigHelpText Normal hi def link kconfigDefBool kconfigConfigOption hi def link kconfigDefBoolCSymbol kconfigConstantSymbol hi def link kconfigDefBoolNCSymbol kconfigSymbol hi def link kconfigOptional kconfigConfigOption hi def link kconfigConfigOptionIf Conditional hi def link kconfigConfOptIfExprCSym kconfigConstantSymbol hi def link kconfigConfOptIfExprNCSym kconfigSymbol hi def link kconfigOperator Operator hi def link kconfigConfOptIfExprEq kconfigOperator hi def link kconfigConfOptIfExprNEq kconfigOperator hi def link kconfigConfOptIfExprCSym2 kconfigConstantSymbol hi def link kconfigConfOptIfExprNCSym2 kconfigSymbol hi def link kconfigConfOptIfExprNeg kconfigOperator hi def link kconfigConfOptIfExprAnd kconfigOperator hi def link kconfigConfOptIfExprOr kconfigOperator hi def link kconfigDelimiter Delimiter hi def link kconfigConfOptIfExprGroup kconfigDelimiter hi def link kconfigConfOptIfGExpCSym kconfigConstantSymbol hi def link kconfigConfOptIfGExpNCSym kconfigSymbol hi def link kconfigConfOptIfGExpEq kconfigOperator hi def link kconfigConfOptIfGExpNEq kconfigOperator hi def link kconfigConfOptIfGExpCSym2 kconfigConstantSymbol hi def link kconfigConfOptIfGExpNCSym2 kconfigSymbol hi def link kconfigConfOptIfGExpNeg kconfigOperator hi def link kconfigConfOptIfGExpAnd kconfigOperator hi def link kconfigConfOptIfGExpOr kconfigOperator hi def link kconfigConfOptIfExprGrpE kconfigDelimiter hi def link kconfigConfOptExprCSym kconfigConstantSymbol hi def link kconfigConfOptExprNCSym kconfigSymbol hi def link kconfigConfOptExprEq kconfigOperator hi def link kconfigConfOptExprNEq kconfigOperator hi def link kconfigConfOptExprCSym2 kconfigConstantSymbol hi def link kconfigConfOptExprNCSym2 kconfigSymbol hi def link kconfigConfOptExprNeg kconfigOperator hi def link kconfigConfOptExprAnd kconfigOperator hi def link kconfigConfOptExprOr kconfigOperator hi def link kconfigConfOptExprGroup kconfigDelimiter hi def link kconfigConfOptGExpCSym kconfigConstantSymbol hi def link kconfigConfOptGExpNCSym kconfigSymbol hi def link kconfigConfOptGExpEq kconfigOperator hi def link kconfigConfOptGExpNEq kconfigOperator hi def link kconfigConfOptGExpCSym2 kconfigConstantSymbol hi def link kconfigConfOptGExpNCSym2 kconfigSymbol hi def link kconfigConfOptGExpNeg kconfigOperator hi def link kconfigConfOptGExpAnd kconfigOperator hi def link kconfigConfOptGExpOr kconfigOperator hi def link kconfigConfOptExprGrpE kconfigConfOptIfExprGroup else syn keyword kconfigTodo contained TODO FIXME XXX NOTE syn match kconfigComment display '#.*$' contains=kconfigTodo syn keyword kconfigKeyword config menuconfig comment mainmenu syn keyword kconfigConditional menu endmenu choice endchoice if endif syn keyword kconfigPreProc source \ nextgroup=kconfigPath \ skipwhite syn keyword kconfigTriState y m n syn match kconfigSpecialChar contained '\\.' syn match kconfigSpecialChar '\\$' syn region kconfigPath matchgroup=kconfigPath \ start=+"+ skip=+\\\\\|\\\"+ end=+"+ \ contains=kconfigSpecialChar syn region kconfigPath matchgroup=kconfigPath \ start=+'+ skip=+\\\\\|\\\'+ end=+'+ \ contains=kconfigSpecialChar syn match kconfigPath '\S\+' \ contained syn region kconfigString matchgroup=kconfigString \ start=+"+ skip=+\\\\\|\\\"+ end=+"+ \ contains=kconfigSpecialChar syn region kconfigString matchgroup=kconfigString \ start=+'+ skip=+\\\\\|\\\'+ end=+'+ \ contains=kconfigSpecialChar syn keyword kconfigType bool boolean tristate string hex int syn keyword kconfigOption prompt default requires select range \ optional syn match kconfigOption 'depends\%( on\)\=' syn keyword kconfigMacro def_bool def_tristate syn region kconfigHelpText \ matchgroup=kconfigOption \ start='\%(help\|---help---\)\ze\s*\n\z(\s\+\)' \ skip='^$' \ end='^\z1\@!' syn sync match kconfigSyncHelp grouphere kconfigHelpText 'help\|---help---' hi def link kconfigTodo Todo hi def link kconfigComment Comment hi def link kconfigKeyword Keyword hi def link kconfigConditional Conditional hi def link kconfigPreProc PreProc hi def link kconfigTriState Boolean hi def link kconfigSpecialChar SpecialChar hi def link kconfigPath String hi def link kconfigString String hi def link kconfigType Type hi def link kconfigOption Identifier hi def link kconfigHelpText Normal hi def link kconfigmacro Macro endif let b:current_syntax = "kconfig" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/kivy.vim000066400000000000000000000017321267703067000173100ustar00rootroot00000000000000" Vim syntax file " Language: Kivy " Maintainer: Corey Prophitt " Last Change: May 29th, 2014 " Version: 1 " URL: http://kivy.org/ if exists("b:current_syntax") finish endif " Load Python syntax first (Python can be used within Kivy) syn include @pyth $VIMRUNTIME/syntax/python.vim " Kivy language rules can be found here " http://kivy.org/docs/guide/lang.html " Define Kivy syntax syn match kivyPreProc /#:.*/ syn match kivyComment /#.*/ syn match kivyRule /<\I\i*\(,\s*\I\i*\)*>:/ syn match kivyAttribute /\<\I\i*\>/ nextgroup=kivyValue syn region kivyValue start=":" end=/$/ contains=@pyth skipwhite syn region kivyAttribute matchgroup=kivyIdent start=/[\a_][\a\d_]*:/ end=/$/ contains=@pyth skipwhite hi def link kivyPreproc PreProc hi def link kivyComment Comment hi def link kivyRule Function hi def link kivyIdent Statement hi def link kivyAttribute Label let b:current_syntax = "kivy" " vim: ts=8 vim-7.4.1689/runtime/syntax/kix.vim000066400000000000000000000146631267703067000171300ustar00rootroot00000000000000" Vim syntax file " Language: KixTart 95, Kix2001 Windows script language http://kixtart.org/ " Maintainer: Richard Howarth " 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 "\\|\\|\" syn match kixIfOK contained "\\|\\|\" syn region kixIf transparent matchgroup=kixIfOK start="\" end="\" contains=ALLBUT,@kixIfBut syn match kixSelectError "\\|\\|\" syn match kixSelectOK contained "\\|\\|\" syn region kixSelect transparent matchgroup=kixSelectOK start="\" end="\" contains=ALLBUT,@kixSelectBut " Program control constructs. syn match kixDoError "\\|\" syn match kixDoOK contained "\\|\" syn region kixDo transparent matchgroup=kixDoOK start="\" end="\" contains=ALLBUT,@kixDoBut syn match kixWhileError "\\|\" syn match kixWhileOK contained "\\|\" syn region kixWhile transparent matchgroup=kixWhileOK start="\" end="\" contains=ALLBUT,@kixWhileBut syn match kixForNextError "\\|\\|\\|\" syn match kixForNextOK contained "\\|\\|\\|\" syn region kixForNext transparent matchgroup=kixForNextOK start="\" end="\" contains=ALLBUT,@kixForBut syn match kixForEachError "\\|\\|\" syn match kixForEachOK contained "\\|\\|\" syn region kixForEach transparent matchgroup=kixForEachOK start="\" end="\" 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/kscript.vim000066400000000000000000000044771267703067000200160ustar00rootroot00000000000000" Vim syntax file " Language: kscript " Maintainer: Thomas Capricelli " URL: http://aquila.rezel.enst.fr/thomas/vim/kscript.vim " CVS: $Id: kscript.vim,v 1.1 2004/06/13 17:40:02 vimboss Exp $ " For version 5.x: Clear all syntax items " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/kwt.vim000066400000000000000000000055461267703067000171420ustar00rootroot00000000000000" Vim syntax file " Language: kimwitu++ " Maintainer: Michael Piefel " 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 :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 "\= 508 || !exists("did_kwt_syn_inits") if version < 508 let did_kwt_syn_inits = 1 command -nargs=+ HiLink hi link else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/lace.vim000066400000000000000000000105021267703067000172250ustar00rootroot00000000000000" Vim syntax file " Language: lace " Maintainer: Jocelyn Fiat " 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 " For version 5.x: Clear all syntax items " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/latte.vim000066400000000000000000000076251267703067000174460ustar00rootroot00000000000000" Vim syntax file " Language: Latte " Maintainer: Nick Moffitt, " 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 else command -nargs=+ HiLink hi def link 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" vim-7.4.1689/runtime/syntax/ld.vim000066400000000000000000000055121267703067000167250ustar00rootroot00000000000000" Vim syntax file " Language: ld(1) script " Maintainer: Nikolai Weibull " Latest Revision: 2006-04-19 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn keyword ldTodo contained TODO FIXME XXX NOTE syn region ldComment start='/\*' end='\*/' contains=ldTodo,@Spell syn region ldFileName start=+"+ end=+"+ syn keyword ldPreProc SECTIONS MEMORY OVERLAY PHDRS VERSION INCLUDE syn match ldPreProc '\' syn match ldNumber display '\<0[xX]\x\+\>' syn match ldNumber display '\d\+[KM]\>' contains=ldNumberMult syn match ldNumberMult display '[KM]\>' syn match ldOctal contained display '\<0\o\+\>' \ contains=ldOctalZero syn match ldOctalZero contained display '\<0' syn match ldOctalError contained display '\<0\o*[89]\d*\>' hi def link ldTodo Todo hi def link ldComment Comment hi def link ldFileName String hi def link ldPreProc PreProc hi def link ldFunction Identifier hi def link ldKeyword Keyword hi def link ldType Type hi def link ldDataType ldType hi def link ldOutputType ldType hi def link ldPTType ldType hi def link ldSpecial Special hi def link ldIdentifier Identifier hi def link ldSections Constant hi def link ldSpecSections Special hi def link ldNumber Number hi def link ldNumberMult PreProc hi def link ldOctal ldNumber hi def link ldOctalZero PreProc hi def link ldOctalError Error let b:current_syntax = "ld" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/ldapconf.vim000066400000000000000000000317521267703067000201210ustar00rootroot00000000000000" Vim syntax file " Language: ldap.conf(5) configuration file. " Maintainer: Nikolai Weibull " Latest Revision: 2006-12-11 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn keyword ldapconfTodo contained TODO FIXME XXX NOTE syn region ldapconfComment display oneline start='^\s*#' end='$' \ contains=ldapconfTodo, \ @Spell syn match ldapconfBegin display '^' \ nextgroup=ldapconfOption, \ ldapconfDeprOption, \ ldapconfComment syn case ignore syn keyword ldapconfOption contained URI \ nextgroup=ldapconfURI \ skipwhite syn keyword ldapconfOption contained \ BASE \ BINDDN \ nextgroup=ldapconfDNAttrType \ skipwhite syn keyword ldapconfDeprOption contained \ HOST \ nextgroup=ldapconfHost \ skipwhite syn keyword ldapconfDeprOption contained \ PORT \ nextgroup=ldapconfPort \ skipwhite syn keyword ldapconfOption contained \ REFERRALS \ nextgroup=ldapconfBoolean \ skipwhite syn keyword ldapconfOption contained \ SIZELIMIT \ TIMELIMIT \ nextgroup=ldapconfInteger \ skipwhite syn keyword ldapconfOption contained \ DEREF \ nextgroup=ldapconfDerefWhen \ skipwhite syn keyword ldapconfOption contained \ SASL_MECH \ nextgroup=ldapconfSASLMechanism \ skipwhite syn keyword ldapconfOption contained \ SASL_REALM \ nextgroup=ldapconfSASLRealm \ skipwhite syn keyword ldapconfOption contained \ SASL_AUTHCID \ SASL_AUTHZID \ nextgroup=ldapconfSASLAuthID \ skipwhite syn keyword ldapconfOption contained \ SASL_SECPROPS \ nextgroup=ldapconfSASLSecProps \ skipwhite syn keyword ldapconfOption contained \ TLS_CACERT \ TLS_CERT \ TLS_KEY \ TLS_RANDFILE \ nextgroup=ldapconfFilename \ skipwhite syn keyword ldapconfOption contained \ TLS_CACERTDIR \ nextgroup=ldapconfPath \ skipwhite syn keyword ldapconfOption contained \ TLS_CIPHER_SUITE \ nextgroup=@ldapconfTLSCipher \ skipwhite syn keyword ldapconfOption contained \ TLS_REQCERT \ nextgroup=ldapconfTLSCertCheck \ skipwhite syn keyword ldapconfOption contained \ TLS_CRLCHECK \ nextgroup=ldapconfTLSCRLCheck \ skipwhite syn case match syn match ldapconfURI contained display \ 'ldaps\=://[^[:space:]:]\+\%(:\d\+\)\=' \ nextgroup=ldapconfURI \ skipwhite " LDAP Distinguished Names are defined in Section 3 of RFC 2253: " http://www.ietf.org/rfc/rfc2253.txt. syn match ldapconfDNAttrType contained display \ '\a[a-zA-Z0-9-]\+\|\d\+\%(\.\d\+\)*' \ nextgroup=ldapconfDNAttrTypeEq syn match ldapconfDNAttrTypeEq contained display \ '=' \ nextgroup=ldapconfDNAttrValue syn match ldapconfDNAttrValue contained display \ '\%([^,=+<>#;\\"]\|\\\%([,=+<>#;\\"]\|\x\x\)\)*\|#\%(\x\x\)\+\|"\%([^\\"]\|\\\%([,=+<>#;\\"]\|\x\x\)\)*"' \ nextgroup=ldapconfDNSeparator syn match ldapconfDNSeparator contained display \ '[+,]' \ nextgroup=ldapconfDNAttrType syn match ldapconfHost contained display \ '[^[:space:]:]\+\%(:\d\+\)\=' \ nextgroup=ldapconfHost \ skipwhite syn match ldapconfPort contained display \ '\d\+' syn keyword ldapconfBoolean contained \ on \ true \ yes \ off \ false \ no syn match ldapconfInteger contained display \ '\d\+' syn keyword ldapconfDerefWhen contained \ never \ searching \ finding \ always " Taken from http://www.iana.org/assignments/sasl-mechanisms. syn keyword ldapconfSASLMechanism contained \ KERBEROS_V4 \ GSSAPI \ SKEY \ EXTERNAL \ ANONYMOUS \ OTP \ PLAIN \ SECURID \ NTLM \ NMAS_LOGIN \ NMAS_AUTHEN \ KERBEROS_V5 syn match ldapconfSASLMechanism contained display \ 'CRAM-MD5\|GSS-SPNEGO\|DIGEST-MD5\|9798-[UM]-\%(RSA-SHA1-ENC\|\%(EC\)\=DSA-SHA1\)\|NMAS-SAMBA-AUTH' " TODO: I have been unable to find a definition for a SASL realm, " authentication identity, and proxy authorization identity. syn match ldapconfSASLRealm contained display \ '\S\+' syn match ldapconfSASLAuthID contained display \ '\S\+' syn keyword ldapconfSASLSecProps contained \ none \ noplain \ noactive \ nodict \ noanonymous \ forwardsec \ passcred \ nextgroup=ldapconfSASLSecPSep syn keyword ldapconfSASLSecProps contained \ minssf \ maxssf \ maxbufsize \ nextgroup=ldapconfSASLSecPEq syn match ldapconfSASLSecPEq contained display \ '=' \ nextgroup=ldapconfSASLSecFactor syn match ldapconfSASLSecFactor contained display \ '\d\+' \ nextgroup=ldapconfSASLSecPSep syn match ldapconfSASLSecPSep contained display \ ',' \ nextgroup=ldapconfSASLSecProps syn match ldapconfFilename contained display \ '.\+' syn match ldapconfPath contained display \ '.\+' " Defined in openssl-ciphers(1). " TODO: Should we include the stuff under CIPHER SUITE NAMES? syn cluster ldapconfTLSCipher contains=ldapconfTLSCipherOp, \ ldapconfTLSCipherName, \ ldapconfTLSCipherSort syn match ldapconfTLSCipherOp contained display \ '[+!-]' \ nextgroup=ldapconfTLSCipherName syn keyword ldapconfTLSCipherName contained \ DEFAULT \ COMPLEMENTOFDEFAULT \ ALL \ COMPLEMENTOFALL \ HIGH \ MEDIUM \ LOW \ EXP \ EXPORT \ EXPORT40 \ EXPORT56 \ eNULL \ NULL \ aNULL \ kRSA \ RSA \ kEDH \ kDHr \ kDHd \ aRSA \ aDSS \ DSS \ aDH \ kFZA \ aFZA \ eFZA \ FZA \ TLSv1 \ SSLv3 \ SSLv2 \ DH \ ADH \ AES \ 3DES \ DES \ RC4 \ RC2 \ IDEA \ MD5 \ SHA1 \ SHA \ Camellia \ nextgroup=ldapconfTLSCipherSep syn match ldapconfTLSCipherSort contained display \ '@STRENGTH' \ nextgroup=ldapconfTLSCipherSep syn match ldapconfTLSCipherSep contained display \ '[:, ]' \ nextgroup=@ldapconfTLSCipher syn keyword ldapconfTLSCertCheck contained \ never \ allow \ try \ demand \ hard syn keyword ldapconfTLSCRLCheck contained \ none \ peer \ all hi def link ldapconfTodo Todo hi def link ldapconfComment Comment hi def link ldapconfOption Keyword hi def link ldapconfDeprOption Error hi def link ldapconfString String hi def link ldapconfURI ldapconfString hi def link ldapconfDNAttrType Identifier hi def link ldapconfOperator Operator hi def link ldapconfEq ldapconfOperator hi def link ldapconfDNAttrTypeEq ldapconfEq hi def link ldapconfValue ldapconfString hi def link ldapconfDNAttrValue ldapconfValue hi def link ldapconfSeparator ldapconfOperator hi def link ldapconfDNSeparator ldapconfSeparator hi def link ldapconfHost ldapconfURI hi def link ldapconfNumber Number hi def link ldapconfPort ldapconfNumber hi def link ldapconfBoolean Boolean hi def link ldapconfInteger ldapconfNumber hi def link ldapconfType Type hi def link ldapconfDerefWhen ldapconfType hi def link ldapconfDefine Define hi def link ldapconfSASLMechanism ldapconfDefine hi def link ldapconfSASLRealm ldapconfURI hi def link ldapconfSASLAuthID ldapconfValue hi def link ldapconfSASLSecProps ldapconfType hi def link ldapconfSASLSecPEq ldapconfEq hi def link ldapconfSASLSecFactor ldapconfNumber hi def link ldapconfSASLSecPSep ldapconfSeparator hi def link ldapconfFilename ldapconfString hi def link ldapconfPath ldapconfFilename hi def link ldapconfTLSCipherOp ldapconfOperator hi def link ldapconfTLSCipherName ldapconfDefine hi def link ldapconfSpecial Special hi def link ldapconfTLSCipherSort ldapconfSpecial hi def link ldapconfTLSCipherSep ldapconfSeparator hi def link ldapconfTLSCertCheck ldapconfType hi def link ldapconfTLSCRLCheck ldapconfType let b:current_syntax = "ldapconf" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/ldif.vim000066400000000000000000000023001267703067000172340ustar00rootroot00000000000000" Vim syntax file " Language: LDAP LDIF " Maintainer: Zak Johnson " 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 else command -nargs=+ HiLink hi def link 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" vim-7.4.1689/runtime/syntax/less.vim000066400000000000000000000102061267703067000172700ustar00rootroot00000000000000" Vim syntax file " Language: less " Maintainer: Alessandro Vioni " URL: https://github.com/genoma/vim-less " Last Change: 2014 November 24 if exists("b:current_syntax") finish endif runtime! syntax/css.vim runtime! after/syntax/css.vim syn case ignore syn cluster lessCssProperties contains=cssFontProp,cssFontDescriptorProp,cssColorProp,cssTextProp,cssBoxProp,cssGeneratedContentProp,cssPagingProp,cssUIProp,cssRenderProp,cssAuralProp,cssTableProp syn cluster lessCssAttributes contains=css.*Attr,lessEndOfLineComment,lessComment,cssValue.*,cssColor,cssURL,lessDefault,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssRenderProp syn region lessDefinition matchgroup=cssBraces start="{" end="}" contains=TOP syn match lessProperty "\%([{};]\s*\|^\)\@<=\%([[:alnum:]-]\|#{[^{}]*}\)\+\s*:" contains=css.*Prop skipwhite nextgroup=lessCssAttribute contained containedin=lessDefinition syn match lessProperty "^\s*\zs\s\%(\%([[:alnum:]-]\|#{[^{}]*}\)\+\s*:\|:[[:alnum:]-]\+\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=lessCssAttribute syn match lessProperty "^\s*\zs\s\%(:\=[[:alnum:]-]\+\s*=\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=lessCssAttribute syn match lessCssAttribute +\%("\%([^"]\|\\"\)*"\|'\%([^']\|\\'\)*'\|#{[^{}]*}\|[^{};]\)*+ contained contains=@lessCssAttributes,lessVariable,lessFunction,lessInterpolation syn match lessDefault "!default\>" contained " less variables and media queries syn match lessVariable "@[[:alnum:]_-]\+" nextgroup=lessCssAttribute skipwhite syn match lessMedia "@media" nextgroup=lessCssAttribute skipwhite " Less functions syn match lessFunction "\<\%(escape\|e\|unit\)\>(\@=" contained syn match lessFunction "\<\%(ceil\|floor\|percentage\|round\|sqrt\|abs\|sin\|asin\|cos\|acos\|tan\|atan\|pi\|pow\|min\|max\)\>(\@=" contained syn match lessFunction "\<\%(rgb\|rgba\|argb\|argb\|hsl\|hsla\|hsv\|hsva\)\>(\@=" contained syn match lessFunction "\<\%(hue\|saturation\|lightness\|red\|green\|blue\|alpha\|luma\)\>(\@=" contained syn match lessFunction "\<\%(saturate\|desaturate\|lighten\|darken\|fadein\|fadeout\|fade\|spin\|mix\|greyscale\|contrast\)\>(\@=" contained syn match lessFunction "\<\%(multiply\|screen\|overlay\|softlight\|hardlight\|difference\|exclusion\|average\|negation\)\>(\@=" contained " Less id class visualization syn match lessIdChar "#[[:alnum:]_-]\@=" nextgroup=lessId,lessClassIdCall syn match lessId "[[:alnum:]_-]\+" contained syn match lessClassIdCall "[[:alnum:]_-]\+()" contained syn match lessClassChar "\.[[:alnum:]_-]\@=" nextgroup=lessClass,lessClassCall syn match lessClass "[[:alnum:]_-]\+" contained syn match lessClassCall "[[:alnum:]_-]\+()" contained syn match lessAmpersand "&" contains=lessIdChar,lessClassChar syn region lessInclude start="@import" end=";\|$" contains=lessComment,cssURL,cssUnicodeEscape,cssMediaType,cssStringQ,cssStringQQ syn keyword lessTodo FIXME NOTE TODO OPTIMIZE XXX contained syn region lessComment start="^\z(\s*\)//" end="^\%(\z1 \)\@!" contains=lessTodo,@Spell syn region lessCssComment start="^\z(\s*\)/\*" end="^\%(\z1 \)\@!" contains=lessTodo,@Spell syn match lessEndOfLineComment "//.*" contains=lessComment,lessTodo,@Spell hi def link lessEndOfLineComment lessComment hi def link lessCssComment lessComment hi def link lessComment Comment hi def link lessDefault cssImportant hi def link lessVariable Identifier hi def link lessFunction PreProc hi def link lessTodo Todo hi def link lessInclude Include hi def link lessIdChar Special hi def link lessClassChar Special hi def link lessAmpersand Character hi def link lessId Identifier hi def link lessClass Type hi def link lessCssAttribute PreProc hi def link lessClassCall Type hi def link lessClassIdCall Type hi def link lessTagName cssTagName hi def link lessDeprecated cssDeprecated hi def link lessMedia cssMedia let b:current_syntax = "less" " vim:set sw=2: vim-7.4.1689/runtime/syntax/lex.vim000066400000000000000000000151621267703067000171200ustar00rootroot00000000000000" Vim syntax file " Language: Lex " Maintainer: Charles E. Campbell " Last Change: Nov 14, 2012 " Version: 14 " URL: http://mysite.verizon.net/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/C++ syntax to start with let s:Cpath= fnameescape(expand(":p:h").(exists("g:lex_uses_cpp")? "/cpp.vim" : "/c.vim")) if !filereadable(s:Cpath) for s:Cpath in split(globpath(&rtp,(exists("g:lex_uses_cpp")? "syntax/cpp.vim" : "syntax/c.vim")),"\n") if filereadable(fnameescape(s:Cpath)) let s:Cpath= fnameescape(s:Cpath) break endif endfor endif exe "syn include @lexCcode ".s:Cpath " --- ========= --- " --- Lex stuff --- " --- ========= --- " Options Section syn match lexOptions '^%\s*option\>.*$' contains=lexPatString " Abbreviations Section if has("folding") syn region lexAbbrvBlock fold start="^\(\h\+\s\|%{\)" end="^\ze%%$" skipnl nextgroup=lexPatBlock contains=lexAbbrv,lexInclude,lexAbbrvComment,lexStartState else syn region lexAbbrvBlock start="^\(\h\+\s\|%{\)" end="^\ze%%$" skipnl nextgroup=lexPatBlock contains=lexAbbrv,lexInclude,lexAbbrvComment,lexStartState endif 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 if has("folding") syn region lexInclude fold matchgroup=lexSep start="^%{" end="%}" contained contains=@lexCcode syn region lexAbbrvComment fold start="^\s\+/\*" end="\*/" contains=@Spell syn region lexAbbrvComment fold start="\%^/\*" end="\*/" contains=@Spell syn region lexStartState fold matchgroup=lexAbbrv start="^%\a\+" end="$" contained else syn region lexInclude matchgroup=lexSep start="^%{" end="%}" contained contains=@lexCcode syn region lexAbbrvComment start="^\s\+/\*" end="\*/" contains=@Spell syn region lexAbbrvComment start="\%^/\*" end="\*/" contains=@Spell syn region lexStartState matchgroup=lexAbbrv start="^%\a\+" end="$" contained endif "%% : Patterns {Actions} if has("folding") syn region lexPatBlock fold matchgroup=Todo start="^%%$" matchgroup=Todo end="^%\ze%$" skipnl skipwhite nextgroup=lexFinalCodeBlock contains=lexPatTag,lexPatTagZone,lexPatComment,lexPat,lexPatInclude syn region lexPat fold start=+\S+ skip="\\\\\|\\." end="\s"me=e-1 skipwhite contained nextgroup=lexMorePat,lexPatSep,lexPattern contains=lexPatTag,lexPatString,lexSlashQuote,lexBrace syn region lexPatInclude fold matchgroup=lexSep start="^%{" end="%}" contained contains=lexPatCode syn region lexBrace fold start="\[" skip=+\\\\\|\\+ end="]" contained syn region lexPatString fold matchgroup=String start=+"+ skip=+\\\\\|\\"+ matchgroup=String end=+"+ contained else syn region lexPatBlock matchgroup=Todo start="^%%$" matchgroup=Todo end="^%%$" skipnl skipwhite nextgroup=lexFinalCodeBlock contains=lexPatTag,lexPatTagZone,lexPatComment,lexPat,lexPatInclude syn region lexPat start=+\S+ skip="\\\\\|\\." end="\s"me=e-1 skipwhite contained nextgroup=lexMorePat,lexPatSep,lexPattern contains=lexPatTag,lexPatString,lexSlashQuote,lexBrace syn region lexPatInclude matchgroup=lexSep start="^%{" end="%}" contained contains=lexPatCode syn region lexBrace start="\[" skip=+\\\\\|\\+ end="]" contained syn region lexPatString matchgroup=String start=+"+ skip=+\\\\\|\\"+ matchgroup=String end=+"+ contained endif syn match lexPatTag "^<\I\i*\(,\I\i*\)*>" contained nextgroup=lexPat,lexPatTag,lexMorePat,lexPatSep syn match lexPatTagZone "^<\I\i*\(,\I\i*\)*>\s\+\ze{" contained nextgroup=lexPatTagZoneStart syn match lexPatTag +^<\I\i*\(,\I\i*\)*>*\(\\\\\)*\\"+ contained nextgroup=lexPat,lexPatTag,lexMorePat,lexPatSep " Lex Patterns syn region lexPattern start='[^ \t{}]' end="$" contained contains=lexPatRange syn region lexPatRange matchgroup=Delimiter start='\[' skip='\\\\\|\\.' end='\]' contains=lexEscape syn match lexEscape '\%(\\\\\)*\\.' contained if has("folding") syn region lexPatTagZoneStart matchgroup=lexPatTag fold start='{' end='}' contained contains=lexPat,lexPatComment syn region lexPatComment start="\s\+/\*" end="\*/" fold skipnl contained contains=cTodo skipwhite nextgroup=lexPatComment,lexPat,@Spell else syn region lexPatTagZoneStart matchgroup=lexPatTag start='{' end='}' contained contains=lexPat,lexPatComment syn region lexPatComment start="\s\+/\*" end="\*/" skipnl contained contains=cTodo skipwhite nextgroup=lexPatComment,lexPat,@Spell endif syn match lexPatCodeLine "[^{\[].*" contained contains=@lexCcode syn match lexMorePat "\s*|\s*$" skipnl contained nextgroup=lexPat,lexPatTag,lexPatComment syn match lexPatSep "\s\+" contained nextgroup=lexMorePat,lexPatCode,lexPatCodeLine syn match lexSlashQuote +\(\\\\\)*\\"+ contained if has("folding") syn region lexPatCode matchgroup=Delimiter start="{" end="}" fold skipnl contained contains=@lexCcode,lexCFunctions else syn region lexPatCode matchgroup=Delimiter start="{" end="}" skipnl contained contains=@lexCcode,lexCFunctions endif " Lex "functions" which may appear in C/C++ code blocks syn keyword lexCFunctions BEGIN input unput woutput yyleng yylook yytext syn keyword lexCFunctions ECHO output winput wunput yyless yymore yywrap " %% " lexAbbrevBlock " %% " lexPatBlock " %% " lexFinalCodeBlock syn region lexFinalCodeBlock matchgroup=Todo start="%$"me=e-1 end="\%$" contained contains=@lexCcode " 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=500 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 lexAbbrvComment lexPatComment hi def link lexAbbrvRegExp Macro hi def link lexAbbrv SpecialChar hi def link lexBrace lexPat hi def link lexCFunctions Function hi def link lexCstruct cStructure hi def link lexMorePat SpecialChar hi def link lexOptions PreProc hi def link lexPatComment Comment hi def link lexPat Function hi def link lexPatString Function hi def link lexPatTag Special hi def link lexPatTagZone lexPatTag hi def link lexSep Delimiter hi def link lexSlashQuote lexPat hi def link lexStartState Statement let b:current_syntax = "lex" " vim:ts=10 vim-7.4.1689/runtime/syntax/lftp.vim000066400000000000000000000164431267703067000173000ustar00rootroot00000000000000" Vim syntax file " Language: lftp(1) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2007-06-17 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim setlocal iskeyword+=- syn region lftpComment display oneline start='#' end='$' \ contains=lftpTodo,@Spell syn keyword lftpTodo contained TODO FIXME XXX NOTE syn region lftpString contained display \ start=+"+ skip=+\\$\|\\"+ end=+"+ end=+$+ syn match lftpNumber contained display '\<\d\+\(\.\d\+\)\=\>' syn keyword lftpBoolean contained yes no on off true false syn keyword lftpInterval contained infinity inf never forever syn match lftpInterval contained '\<\(\d\+\(\.\d\+\)\=[dhms]\)\+\>' syn keyword lftpKeywords alias anon at bookmark cache cat cd chmod close \ cls command debug du echo exit fg find get \ get1 glob help history jobs kill lcd lftp \ lpwd ls mget mirror mkdir module more mput \ mrm mv nlist open pget put pwd queue quote \ reget recls rels renlist repeat reput rm \ rmdir scache site source suspend user version \ wait zcat zmore 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] \ exp[ire] siz[e] " cmd: syn keyword lftpSettings contained at[-exit] cls-c[ompletion-default] \ cls-d[efault] cs[h-history] \ default-p[rotocol] default-t[itle] syn keyword lftpSettings contained fai[l-exit] in[teractive] \ lo[ng-running] ls[-default] mo[ve-background] \ prom[pt] \ rem[ote-completion] \ save-c[wd-history] save-r[l-history] \ set-t[erm-status] statu[s-interval] \ te[rm-status] verb[ose] verify-h[ost] \ 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] \ cache-ex[pire] cache-s[ize] \ 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] \ au[to-sync-mode] b[ind-data-socket] \ ch[arset] cli[ent] dev[ice-prefix] \ fi[x-pasv-address] fxp-f[orce] \ fxp-p[assive-source] h[ome] la[ng] \ list-e[mpty-ok] list-o[ptions] \ nop[-interval] pas[sive-mode] \ port-i[pv4] port-r[ange] prox[y] \ rest-l[ist] rest-s[tor] \ retry-530 retry-530[-anonymous] \ sit[e-group] skey-a[llow] \ skey-f[orce] ssl-allow \ ssl-allow[-anonymous] ssl-au[th] \ ssl-f[orce] ssl-protect-d[ata] \ ssl-protect-l[ist] stat-[interval] \ sy[nc-mode] timez[one] use-a[bor] \ use-fe[at] use-fx[p] use-hf[tp] \ use-mdtm use-mdtm[-overloaded] \ use-ml[sd] use-p[ret] use-q[uit] \ use-site-c[hmod] use-site-i[dle] \ use-site-u[time] use-siz[e] \ use-st[at] use-te[lnet-iac] \ verify-a[ddress] verify-p[ort] \ w[eb-mode] " hftp: syn keyword lftpSettings contained w[eb-mode] cache prox[y] \ use-au[thorization] use-he[ad] use-ty[pe] " http: syn keyword lftpSettings contained accept accept-c[harset] \ accept-l[anguage] cache coo[kie] \ pos[t-content-type] prox[y] \ put-c[ontent-type] put-m[ethod] ref[erer] \ set-c[ookies] user[-agent] " https: syn keyword lftpSettings contained prox[y] " mirror: syn keyword lftpSettings contained exc[lude-regex] o[rder] \ parallel-d[irectories] \ parallel-t[ransfer-count] use-p[get-n] " module: syn keyword lftpSettings contained pat[h] " net: syn keyword lftpSettings contained connection-l[imit] \ connection-t[akeover] id[le] limit-m[ax] \ limit-r[ate] limit-total-m[ax] \ limit-total-r[ate] max-ret[ries] no-[proxy] \ pe[rsist-retries] reconnect-interval-b[ase] \ reconnect-interval-ma[x] \ reconnect-interval-mu[ltiplier] \ socket-bind-ipv4 socket-bind-ipv6 \ socket-bu[ffer] socket-m[axseg] timeo[ut] " sftp: syn keyword lftpSettings contained connect[-program] \ max-p[ackets-in-flight] prot[ocol-version] \ ser[ver-program] size-r[ead] size-w[rite] " ssl: syn keyword lftpSettings contained ca-f[ile] ca-p[ath] ce[rt-file] \ crl-f[ile] crl-p[ath] k[ey-file] \ verify-c[ertificate] " xfer: syn keyword lftpSettings contained clo[bber] dis[k-full-fatal] \ eta-p[eriod] eta-t[erse] mak[e-backup] \ max-red[irections] ra[te-period] hi def link lftpComment Comment hi def link lftpTodo Todo hi def link lftpString String hi def link lftpNumber Number hi def link lftpBoolean Boolean hi def link lftpInterval Number hi def link lftpKeywords Keyword hi def link lftpSettingsPrefix PreProc hi def link lftpSettings Type let b:current_syntax = "lftp" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/lhaskell.vim000066400000000000000000000116051267703067000201250ustar00rootroot00000000000000" 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 " Original Author: Arthur van Leeuwen " Last Change: 2010 Apr 11 " Version: 1.04 " " 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 " 2008 July 1: Removed % from guess list, as it totally breaks plain " text markup guessing " 2009 April 29: Fixed highlighting breakage in TeX mode, " thanks to Kalman Noel " " For version 5.x: Clear all syntax items " 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 or guess thinks it's TeX, read it. if b:lhs_markup == "tex" if version < 600 source :p:h/tex.vim set isk+=_ else runtime! syntax/tex.vim unlet b:current_syntax " Tex.vim removes "_" from 'iskeyword', but we need it for Haskell. setlocal isk+=_ endif syntax cluster lhsTeXContainer contains=tex.*Zone,texAbstract else syntax cluster lhsTeXContainer contains=.* endif " Literate Haskell is Haskell in between text, so at least read Haskell " highlighting if version < 600 syntax include @haskellTop :p:h/haskell.vim else syntax include @haskellTop syntax/haskell.vim endif syntax region lhsHaskellBirdTrack start="^>" end="\%(^[^>]\)\@=" contains=@haskellTop,lhsBirdTrack containedin=@lhsTeXContainer syntax region lhsHaskellBeginEndBlock start="^\\begin{code}\s*$" matchgroup=NONE end="\%(^\\end{code}.*$\)\@=" contains=@haskellTop,beginCodeBegin containedin=@lhsTeXContainer syntax match lhsBirdTrack "^>" contained syntax match beginCodeBegin "^\\begin" nextgroup=beginCodeCode contained syntax region beginCodeCode matchgroup=texDelimiter 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_tex_syntax_inits") if version < 508 let did_tex_syntax_inits = 1 command -nargs=+ HiLink hi link else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/libao.vim000066400000000000000000000011601267703067000174070ustar00rootroot00000000000000" Vim syntax file " Language: libao.conf(5) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2006-04-19 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn keyword libaoTodo contained TODO FIXME XXX NOTE syn region libaoComment display oneline start='^\s*#' end='$' \ contains=libaoTodo,@Spell syn keyword libaoKeyword default_driver hi def link libaoTodo Todo hi def link libaoComment Comment hi def link libaoKeyword Keyword let b:current_syntax = "libao" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/lifelines.vim000066400000000000000000000153771267703067000203120ustar00rootroot00000000000000" Vim syntax file " Language: LifeLines (v 3.0.62) " Maintainer: Patrick Texier " Location: " Last Change: 2010 May 7 " option to highlight error obsolete statements " add the following line to your .vimrc file : " let lifelines_deprecated = 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 " A bunch of useful LifeLines keywords 3.0.62 syn keyword lifelinesDecl char_encoding require option include syn keyword lifelinesStatement set syn keyword lifelinesUser getindi geindiset getfam getint getstr choosechild syn keyword lifelinesUser chooseindi choosespouse choosesubset menuchoose syn keyword lifelinesUser choosefam 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 lifelinesArithm cos sin tan arccos arcsin arctan syn keyword lifelinesArithm deg2dms dms2deg spdist syn keyword lifelinesIndi name fullname surname givens trimname birth syn keyword lifelinesIndi death burial baptism 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 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 lifelinesFam fathers mothers Parents syn keyword lifelinesList list empty length enqueue dequeue requeue syn keyword lifelinesList push pop setel getel forlist inlist dup clear syn keyword lifelinesTable table insert lookup syn keyword lifelinesGedcom xref tag value parent child sibling savenode syn keyword lifelinesGedcom fornodes traverse createnode addnode syn keyword lifelinesGedcom detachnode foreven fornotes forothr forsour syn keyword lifelinesGedcom reference dereference getrecord syn keyword lifelinesGedcom gengedcomstrong syn keyword lifelinesFunct date place year long short gettoday dayformat syn keyword lifelinesFunct monthformat dateformat extractdate eraformat syn keyword lifelinesFunct complexdate complexformat complexpic datepic syn keyword lifelinesFunct extractnames extractplaces extracttokens lower syn keyword lifelinesFunct yearformat syn keyword lifelinesFunct upper capitalize trim rjustify syn keyword lifelinesFunct concat strconcat strlen substring index syn keyword lifelinesFunct titlecase gettext 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 test syn keyword lifelinesFunct database version system stddate program syn keyword lifelinesFunct pvalue pagemode level extractdatestr debug syn keyword lifelinesFunct f float int free getcol getproperty heapused syn keyword lifelinesFunct sort rsort syn keyword lifelinesFunct deleteel syn keyword lifelinesFunct bytecode convertcode setlocale " New dates functions (since 3.0.51) syn keyword lifelinesFunct jd2date date2jd dayofweek setdate " options to highlight as error obsolete statements " please read ll-reportmanual. if exists("lifelines_deprecated") syn keyword lifelinesError getintmsg getindimsg getstrmsg syn keyword lifelinesError gengedcom gengedcomweak deletenode syn keyword lifelinesError save strsave syn keyword lifelinesError lengthset if version >= 700 let g:omni_syntax_group_exclude_lifelines = 'lifelinesError' endif else syn keyword lifelinesUser getintmsg getindimsg getstrmsg syn keyword lifelinesGedcom gengedcom gengedcomweak deletenode syn keyword lifelinesFunct save strsave syn keyword lifelinesIndi lengthset endif syn region lifelinesString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=lifelinesSpecial syn match lifelinesSpecial "\\\(\\\|\(n\|t\)\)" contained syn keyword lifelinesTodo contained TODO FIXME XXX syn region lifelinesComment start="/\*" end="\*/" contains=lifelinesTodo " integers syn match lifelinesNumber "-\=\<\d\+\>" "floats, with dot syn match lifelinesNumber "-\=\<\d\+\.\d*\>" "floats, starting with a dot syn match lifelinesNumber "-\=\.\d\+\>" " folding using {} if version >= 600 syn region lifelinesFoldBlock start="{" end="}" transparent fold endif "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 else command -nargs=+ HiLink hi def link 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 lifelinesSpecial Special HiLink lifelinesNumber Number HiLink lifelinesParenError Error HiLink lifelinesErrInParen Error HiLink lifelinesError Error HiLink lifelinesTodo Todo HiLink lifelinesDecl PreProc delcommand HiLink endif let b:current_syntax = "lifelines" " vim: ts=8 sw=4 vim-7.4.1689/runtime/syntax/lilo.vim000066400000000000000000000246601267703067000172720ustar00rootroot00000000000000" Vim syntax file " Language: lilo configuration (lilo.conf) " Maintainer: Niels Horn " Previous Maintainer: David Necas (Yeti) " Last Change: 2010-02-03 " Setup if version >= 600 if exists("b:current_syntax") finish endif else syntax clear endif if version >= 600 command -nargs=1 SetIsk setlocal iskeyword= else command -nargs=1 SetIsk set iskeyword= 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 :[^ "]\+: 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 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 install nextgroup=liloEqAnything,liloEqAnythingComment,liloError skipwhite skipempty syn keyword liloOption bios-passes-dl nextgroup=liloEqAnything,liloEqAnythingComment,liloError skipwhite skipempty syn keyword liloOption default label alias wmdefault nextgroup=liloEqLabelString,liloEqLabelStringComment,liloError skipwhite skipempty syn keyword liloKernelOpt ramdisk nextgroup=liloEqAnything,liloEqAnythingComment,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 addappend 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 boot-as 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 nextgroup=liloEqNumberList,liloEqNumberListComment,liloError skipwhite skipempty " Number list, some of the numbers followed by p syn keyword liloOption bmp-table bmp-timer nextgroup=liloEqDecNumberPList,liloEqDecNumberPListComment,liloError skipwhite skipempty " Flag syn keyword liloOption compact fix-table geometric ignore-table lba32 linear mandatory nowarn prompt syn keyword liloOption bmp-retain el-torito-bootable-CD large-memory suppress-boot-time-BIOS-data syn keyword liloKernelOpt read-only read-write syn keyword liloImageOpt bypass lock mandatory optional restricted single-key unsafe syn keyword liloImageOpt master-boot wmwarn wmdisable 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 liloEqLabelStringComment "#.*$" contained nextgroup=liloEqLabelString,liloEqLabelStringComment,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 liloEqLabelString "=" contained nextgroup=liloString,liloLabel,liloLabelStringComment,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 liloLabelStringComment "#.*$" contained nextgroup=liloString,liloLabel,liloLabelStringComment,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 else command -nargs=+ HiLink hi def link endif HiLink liloEqPath liloEquals HiLink liloEqWord liloEquals HiLink liloEqVga liloEquals HiLink liloEqDecNumber liloEquals HiLink liloEqHexNumber liloEquals HiLink liloEqNumber liloEquals HiLink liloEqString 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 liloEqAnythingComment liloComment HiLink liloPathComment liloComment HiLink liloVgaComment liloComment HiLink liloDecNumberComment liloComment HiLink liloHexNumberComment liloComment HiLink liloNumberComment liloComment HiLink liloStringComment 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" vim-7.4.1689/runtime/syntax/limits.vim000066400000000000000000000024311267703067000176240ustar00rootroot00000000000000" Vim syntax file " Language: limits(5) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2006-04-19 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn keyword limitsTodo contained TODO FIXME XXX NOTE syn region limitsComment display oneline start='^\s*#' end='$' \ contains=limitsTodo,@Spell syn match limitsBegin display '^' \ nextgroup=limitsUser,limitsDefault,limitsComment \ skipwhite syn match limitsUser contained '[^ \t#*]\+' \ nextgroup=limitsLimit,limitsDeLimit skipwhite syn match limitsDefault contained '*' \ nextgroup=limitsLimit,limitsDeLimit skipwhite syn match limitsLimit contained '[ACDFMNRSTUKLP]' nextgroup=limitsNumber syn match limitsDeLimit contained '-' syn match limitsNumber contained '\d\+\>' nextgroup=limitsLimit skipwhite hi def link limitsTodo Todo hi def link limitsComment Comment hi def link limitsUser Keyword hi def link limitsDefault Macro hi def link limitsLimit Identifier hi def link limitsDeLimit Special hi def link limitsNumber Number let b:current_syntax = "limits" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/liquid.vim000066400000000000000000000140501267703067000176120ustar00rootroot00000000000000" Vim syntax file " Language: Liquid " Maintainer: Tim Pope " Filenames: *.liquid " Last Change: 2013 May 30 if exists('b:current_syntax') finish endif if !exists('main_syntax') let main_syntax = 'liquid' endif if !exists('g:liquid_default_subtype') let g:liquid_default_subtype = 'html' endif if !exists('b:liquid_subtype') && main_syntax == 'liquid' let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$") let b:liquid_subtype = matchstr(s:lines,'liquid_subtype=\zs\w\+') if b:liquid_subtype == '' let b:liquid_subtype = matchstr(&filetype,'^liquid\.\zs\w\+') endif if b:liquid_subtype == '' let b:liquid_subtype = matchstr(substitute(expand('%:t'),'\c\%(\.liquid\)\+$','',''),'\.\zs\w\+$') endif if b:liquid_subtype == '' let b:liquid_subtype = g:liquid_default_subtype endif endif if exists('b:liquid_subtype') && b:liquid_subtype != '' exe 'runtime! syntax/'.b:liquid_subtype.'.vim' unlet! b:current_syntax endif syn case match if exists('b:liquid_subtype') && b:liquid_subtype != 'yaml' " YAML Front Matter syn include @liquidYamlTop syntax/yaml.vim unlet! b:current_syntax syn region liquidYamlHead start="\%^---$" end="^---\s*$" keepend contains=@liquidYamlTop,@Spell endif if !exists('g:liquid_highlight_types') let g:liquid_highlight_types = [] endif if !exists('s:subtype') let s:subtype = exists('b:liquid_subtype') ? b:liquid_subtype : '' for s:type in map(copy(g:liquid_highlight_types),'matchstr(v:val,"[^=]*$")') if s:type =~ '\.' let b:{matchstr(s:type,'[^.]*')}_subtype = matchstr(s:type,'\.\zs.*') endif exe 'syn include @liquidHighlight'.substitute(s:type,'\.','','g').' syntax/'.matchstr(s:type,'[^.]*').'.vim' unlet! b:current_syntax endfor unlet! s:type if s:subtype == '' unlet! b:liquid_subtype else let b:liquid_subtype = s:subtype endif unlet s:subtype endif syn region liquidStatement matchgroup=liquidDelimiter start="{%" end="%}" contains=@liquidStatement containedin=ALLBUT,@liquidExempt keepend syn region liquidExpression matchgroup=liquidDelimiter start="{{" end="}}" contains=@liquidExpression containedin=ALLBUT,@liquidExempt keepend syn region liquidComment matchgroup=liquidDelimiter start="{%\s*comment\s*%}" end="{%\s*endcomment\s*%}" contains=liquidTodo,@Spell containedin=ALLBUT,@liquidExempt keepend syn region liquidRaw matchgroup=liquidDelimiter start="{%\s*raw\s*%}" end="{%\s*endraw\s*%}" contains=TOP,@liquidExempt containedin=ALLBUT,@liquidExempt keepend syn cluster liquidExempt contains=liquidStatement,liquidExpression,liquidComment,liquidRaw,@liquidStatement,liquidYamlHead syn cluster liquidStatement contains=liquidConditional,liquidRepeat,liquidKeyword,@liquidExpression syn cluster liquidExpression contains=liquidOperator,liquidString,liquidNumber,liquidFloat,liquidBoolean,liquidNull,liquidEmpty,liquidPipe,liquidForloop syn keyword liquidKeyword highlight nextgroup=liquidTypeHighlight skipwhite contained syn keyword liquidKeyword endhighlight contained syn region liquidHighlight start="{%\s*highlight\s\+\w\+\s*%}" end="{% endhighlight %}" keepend for s:type in g:liquid_highlight_types exe 'syn match liquidTypeHighlight "\<'.matchstr(s:type,'[^=]*').'\>" contained' exe 'syn region liquidHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' start="{%\s*highlight\s\+'.matchstr(s:type,'[^=]*').'\s*%}" end="{% endhighlight %}" keepend contains=@liquidHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\.','','g') endfor unlet! s:type syn region liquidString matchgroup=liquidQuote start=+"+ end=+"+ contained syn region liquidString matchgroup=liquidQuote start=+'+ end=+'+ contained syn match liquidNumber "-\=\<\d\+\>" contained syn match liquidFloat "-\=\<\d\+\>\.\.\@!\%(\d\+\>\)\=" contained syn keyword liquidBoolean true false contained syn keyword liquidNull null nil contained syn match liquidEmpty "\" contained syn keyword liquidOperator and or not contained syn match liquidPipe '|' contained skipwhite nextgroup=liquidFilter syn keyword liquidFilter date capitalize downcase upcase first last join sort size strip_html strip_newlines newline_to_br replace replace_first remove remove_first truncate truncatewords prepend append minus plus times divided_by contained syn keyword liquidConditional if elsif else endif unless endunless case when endcase ifchanged endifchanged contained syn keyword liquidRepeat for endfor tablerow endtablerow in contained syn match liquidRepeat "\%({%\s*\)\@<=empty\>" contained syn keyword liquidKeyword assign cycle include with contained syn keyword liquidForloop forloop nextgroup=liquidForloopDot contained syn match liquidForloopDot "\." nextgroup=liquidForloopAttribute contained syn keyword liquidForloopAttribute length index index0 rindex rindex0 first last contained syn keyword liquidTablerowloop tablerowloop nextgroup=liquidTablerowloopDot contained syn match liquidTablerowloopDot "\." nextgroup=liquidTableForloopAttribute contained syn keyword liquidTablerowloopAttribute length index index0 col col0 index0 rindex rindex0 first last col_first col_last contained hi def link liquidDelimiter PreProc hi def link liquidComment Comment hi def link liquidTypeHighlight Type hi def link liquidConditional Conditional hi def link liquidRepeat Repeat hi def link liquidKeyword Keyword hi def link liquidOperator Operator hi def link liquidString String hi def link liquidQuote Delimiter hi def link liquidNumber Number hi def link liquidFloat Float hi def link liquidEmpty liquidNull hi def link liquidNull liquidBoolean hi def link liquidBoolean Boolean hi def link liquidFilter Function hi def link liquidForloop Identifier hi def link liquidForloopAttribute Identifier let b:current_syntax = 'liquid' if exists('main_syntax') && main_syntax == 'liquid' unlet main_syntax endif vim-7.4.1689/runtime/syntax/lisp.vim000066400000000000000000001067111267703067000173000ustar00rootroot00000000000000" Vim syntax file " Language: Lisp " Maintainer: Charles E. Campbell " Last Change: Jan 20, 2016 " Version: 24 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_LISP " " Thanks to F Xavier Noria for a list of 978 Common Lisp symbols taken from HyperSpec " Clisp additions courtesy of http://clisp.cvs.sourceforge.net/*checkout*/clisp/clisp/emacs/lisp.vim " --------------------------------------------------------------------- " Load Once: {{{1 if exists("b:current_syntax") finish endif if exists("g:lisp_isk") exe "setl isk=".g:lisp_isk elseif !has("patch-7.4.1141") setl isk=38,42,43,45,47-58,60-62,64-90,97-122,_ else syn iskeyword 38,42,43,45,47-58,60-62,64-90,97-122,_ endif if exists("g:lispsyntax_ignorecase") || exists("g:lispsyntax_clisp") set ignorecase endif " --------------------------------------------------------------------- " Clusters: {{{1 syn cluster lispAtomCluster contains=lispAtomBarSymbol,lispAtomList,lispAtomNmbr0,lispComment,lispDecl,lispFunc,lispLeadWhite syn cluster lispBaseListCluster contains=lispAtom,lispAtomBarSymbol,lispAtomMark,lispBQList,lispBarSymbol,lispComment,lispConcat,lispDecl,lispFunc,lispKey,lispList,lispNumber,lispEscapeSpecial,lispSymbol,lispVar,lispLeadWhite if exists("g:lisp_instring") syn cluster lispListCluster contains=@lispBaseListCluster,lispString,lispInString,lispInStringString else syn cluster lispListCluster contains=@lispBaseListCluster,lispString endif syn case ignore " --------------------------------------------------------------------- " Lists: {{{1 syn match lispSymbol contained ![^()'`,"; \t]\+! syn match lispBarSymbol contained !|..\{-}|! if exists("g:lisp_rainbow") && g:lisp_rainbow != 0 syn region lispParen0 matchgroup=hlLevel0 start="`\=(" end=")" skip="|.\{-}|" contains=@lispListCluster,lispParen1 syn region lispParen1 contained matchgroup=hlLevel1 start="`\=(" end=")" skip="|.\{-}|" contains=@lispListCluster,lispParen2 syn region lispParen2 contained matchgroup=hlLevel2 start="`\=(" end=")" skip="|.\{-}|" contains=@lispListCluster,lispParen3 syn region lispParen3 contained matchgroup=hlLevel3 start="`\=(" end=")" skip="|.\{-}|" contains=@lispListCluster,lispParen4 syn region lispParen4 contained matchgroup=hlLevel4 start="`\=(" end=")" skip="|.\{-}|" contains=@lispListCluster,lispParen5 syn region lispParen5 contained matchgroup=hlLevel5 start="`\=(" end=")" skip="|.\{-}|" contains=@lispListCluster,lispParen6 syn region lispParen6 contained matchgroup=hlLevel6 start="`\=(" end=")" skip="|.\{-}|" contains=@lispListCluster,lispParen7 syn region lispParen7 contained matchgroup=hlLevel7 start="`\=(" end=")" skip="|.\{-}|" contains=@lispListCluster,lispParen8 syn region lispParen8 contained matchgroup=hlLevel8 start="`\=(" end=")" skip="|.\{-}|" contains=@lispListCluster,lispParen9 syn region lispParen9 contained matchgroup=hlLevel9 start="`\=(" end=")" skip="|.\{-}|" contains=@lispListCluster,lispParen0 else syn region lispList matchgroup=Delimiter start="(" skip="|.\{-}|" matchgroup=Delimiter end=")" contains=@lispListCluster syn region lispBQList matchgroup=PreProc start="`(" skip="|.\{-}|" matchgroup=PreProc end=")" contains=@lispListCluster endif " --------------------------------------------------------------------- " Atoms: {{{1 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,lispEscapeSpecial syn match lispAtomNmbr contained "\<\d\+" syn match lispLeadWhite contained "^\s\+" " --------------------------------------------------------------------- " Standard Lisp Functions and Macros: {{{1 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 simple-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 "\" if exists("g:lispsyntax_clisp") " CLISP FFI: syn match lispFunc "\<\(ffi:\)\?with-c-\(place\|var\)\>" syn match lispFunc "\<\(ffi:\)\?with-foreign-\(object\|string\)\>" syn match lispFunc "\<\(ffi:\)\?default-foreign-\(language\|library\)\>" syn match lispFunc "\<\([us]_\?\)\?\(element\|deref\|cast\|slot\|validp\)\>" syn match lispFunc "\<\(ffi:\)\?set-foreign-pointer\>" syn match lispFunc "\<\(ffi:\)\?allocate-\(deep\|shallow\)\>" syn match lispFunc "\<\(ffi:\)\?c-lines\>" syn match lispFunc "\<\(ffi:\)\?foreign-\(value\|free\|variable\|function\|object\)\>" syn match lispFunc "\<\(ffi:\)\?foreign-address\(-null\|unsigned\)\?\>" syn match lispFunc "\<\(ffi:\)\?undigned-foreign-address\>" syn match lispFunc "\<\(ffi:\)\?c-var-\(address\|object\)\>" syn match lispFunc "\<\(ffi:\)\?typeof\>" syn match lispFunc "\<\(ffi:\)\?\(bit\)\?sizeof\>" " CLISP Macros, functions et al: syn match lispFunc "\<\(ext:\)\?with-collect\>" syn match lispFunc "\<\(ext:\)\?letf\*\?\>" syn match lispFunc "\<\(ext:\)\?finalize\>\>" syn match lispFunc "\<\(ext:\)\?memoized\>" syn match lispFunc "\<\(ext:\)\?getenv\>" syn match lispFunc "\<\(ext:\)\?convert-string-\(to\|from\)-bytes\>" syn match lispFunc "\<\(ext:\)\?ethe\>" syn match lispFunc "\<\(ext:\)\?with-gensyms\>" syn match lispFunc "\<\(ext:\)\?open-http\>" syn match lispFunc "\<\(ext:\)\?string-concat\>" syn match lispFunc "\<\(ext:\)\?with-http-\(in\|out\)put\>" syn match lispFunc "\<\(ext:\)\?with-html-output\>" syn match lispFunc "\<\(ext:\)\?expand-form\>" syn match lispFunc "\<\(ext:\)\?\(without-\)\?package-lock\>" syn match lispFunc "\<\(ext:\)\?re-export\>" syn match lispFunc "\<\(ext:\)\?saveinitmem\>" syn match lispFunc "\<\(ext:\)\?\(read\|write\)-\(integer\|float\)\>" syn match lispFunc "\<\(ext:\)\?\(read\|write\)-\(char\|byte\)-sequence\>" syn match lispFunc "\<\(custom:\)\?\*system-package-list\*\>" syn match lispFunc "\<\(custom:\)\?\*ansi\*\>" endif " --------------------------------------------------------------------- " Lisp Keywords (modifiers): {{{1 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 " defpackage arguments syn keyword lispKey :documentation :shadowing-import-from :modern :export syn keyword lispKey :case-sensitive :case-inverted :shadow :import-from :intern " lambda list keywords syn keyword lispKey &allow-other-keys &aux &body syn keyword lispKey &environment &key &optional &rest &whole " make-array argument syn keyword lispKey :fill-pointer " readtable-case values syn keyword lispKey :upcase :downcase :preserve :invert " eval-when situations syn keyword lispKey :load-toplevel :compile-toplevel :execute " ANSI Extended LOOP: syn keyword lispKey :while :until :for :do :if :then :else :when :unless :in syn keyword lispKey :across :finally :collect :nconc :maximize :minimize :sum syn keyword lispKey :and :with :initially :append :into :count :end :repeat syn keyword lispKey :always :never :thereis :from :to :upto :downto :below syn keyword lispKey :above :by :on :being :each :the :hash-key :hash-keys syn keyword lispKey :hash-value :hash-values :using :of-type :upfrom :downfrom if exists("g:lispsyntax_clisp") " CLISP FFI: syn keyword lispKey :arguments :return-type :library :full :malloc-free syn keyword lispKey :none :alloca :in :out :in-out :stdc-stdcall :stdc :c syn keyword lispKey :language :built-in :typedef :external syn keyword lispKey :fini :init-once :init-always endif " --------------------------------------------------------------------- " Standard Lisp Variables: {{{1 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: {{{1 syn region lispString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell if exists("g:lisp_instring") syn region lispInString keepend matchgroup=Delimiter start=+"(+rs=s+1 skip=+|.\{-}|+ matchgroup=Delimiter end=+)"+ contains=@lispBaseListCluster,lispInStringString syn region lispInStringString start=+\\"+ skip=+\\\\+ end=+\\"+ contained endif " --------------------------------------------------------------------- " Shared with Xlisp, Declarations, Macros, Functions: {{{1 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 if exists("g:lispsyntax_clisp") " CLISP FFI: syn match lispDecl "\<\(ffi:\)\?def-c-\(var\|const\|enum\|type\|struct\)\>" syn match lispDecl "\<\(ffi:\)\?def-call-\(out\|in\)\>" syn match lispDecl "\<\(ffi:\)\?c-\(function\|struct\|pointer\|string\)\>" syn match lispDecl "\<\(ffi:\)\?c-ptr\(-null\)\?\>" syn match lispDecl "\<\(ffi:\)\?c-array\(-ptr\|-max\)\?\>" syn match lispDecl "\<\(ffi:\)\?[us]\?\(char\|short\|int\|long\)\>" syn match lispDecl "\<\(win32:\|w32\)\?d\?word\>" syn match lispDecl "\<\([us]_\?\)\?int\(8\|16\|32\|64\)\(_t\)\?\>" syn keyword lispDecl size_t off_t time_t handle endif " --------------------------------------------------------------------- " Numbers: supporting integers and floating point numbers {{{1 syn match lispNumber "-\=\(\.\d\+\|\d\+\(\.\d*\)\=\)\([dDeEfFlL][-+]\=\d\+\)\=" syn match lispNumber "-\=\(\d\+/\d\+\)" syn match lispEscapeSpecial "\*\w[a-z_0-9-]*\*" syn match lispEscapeSpecial !#|[^()'`,"; \t]\+|#! syn match lispEscapeSpecial !#x\x\+! syn match lispEscapeSpecial !#o\o\+! syn match lispEscapeSpecial !#b[01]\+! syn match lispEscapeSpecial !#\\[ -}\~]! syn match lispEscapeSpecial !#[':][^()'`,"; \t]\+! syn match lispEscapeSpecial !#([^()'`,"; \t]\+)! syn match lispEscapeSpecial !#\\\%(Space\|Newline\|Tab\|Page\|Rubout\|Linefeed\|Return\|Backspace\)! syn match lispEscapeSpecial "\<+[a-zA-Z_][a-zA-Z_0-9-]*+\>" syn match lispConcat "\s\.\s" syn match lispParenError ")" " --------------------------------------------------------------------- " Comments: {{{1 syn cluster lispCommentGroup contains=lispTodo,@Spell syn match lispComment ";.*$" contains=@lispCommentGroup syn region lispCommentRegion start="#|" end="|#" contains=lispCommentRegion,@lispCommentGroup syn keyword lispTodo contained combak combak: todo todo: " --------------------------------------------------------------------- " Synchronization: {{{1 syn sync lines=100 " --------------------------------------------------------------------- " Define 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 command -nargs=+ HiLink hi def link 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 lispEscapeSpecial Type HiLink lispString String HiLink lispTodo Todo HiLink lispVar Statement if exists("g:lisp_rainbow") && g:lisp_rainbow != 0 if &bg == "dark" hi def hlLevel0 ctermfg=red guifg=red1 hi def hlLevel1 ctermfg=yellow guifg=orange1 hi def hlLevel2 ctermfg=green guifg=yellow1 hi def hlLevel3 ctermfg=cyan guifg=greenyellow hi def hlLevel4 ctermfg=magenta guifg=green1 hi def hlLevel5 ctermfg=red guifg=springgreen1 hi def hlLevel6 ctermfg=yellow guifg=cyan1 hi def hlLevel7 ctermfg=green guifg=slateblue1 hi def hlLevel8 ctermfg=cyan guifg=magenta1 hi def hlLevel9 ctermfg=magenta guifg=purple1 else hi def hlLevel0 ctermfg=red guifg=red3 hi def hlLevel1 ctermfg=darkyellow guifg=orangered3 hi def hlLevel2 ctermfg=darkgreen guifg=orange2 hi def hlLevel3 ctermfg=blue guifg=yellow3 hi def hlLevel4 ctermfg=darkmagenta guifg=olivedrab4 hi def hlLevel5 ctermfg=red guifg=green4 hi def hlLevel6 ctermfg=darkyellow guifg=paleturquoise3 hi def hlLevel7 ctermfg=darkgreen guifg=deepskyblue4 hi def hlLevel8 ctermfg=blue guifg=darkslateblue hi def hlLevel9 ctermfg=darkmagenta guifg=darkviolet endif endif delcommand HiLink endif let b:current_syntax = "lisp" " --------------------------------------------------------------------- " vim: ts=8 nowrap fdm=marker vim-7.4.1689/runtime/syntax/lite.vim000066400000000000000000000121151267703067000172600ustar00rootroot00000000000000" Vim syntax file " Language: lite " Maintainer: Lutz Eymers " 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 :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 :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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/litestep.vim000066400000000000000000000150101267703067000201510ustar00rootroot00000000000000" Vim syntax file " Language: LiteStep RC file " Maintainer: Nikolai Weibull " Latest Revision: 2007-02-22 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn keyword litestepTodo \ contained \ TODO FIXME XXX NOTE syn match litestepComment \ contained display contains=litestepTodo,@Spell \ ';.*$' syn case ignore syn cluster litestepBeginnings \ contains= \ litestepComment, \ litestepPreProc, \ litestepMultiCommandStart, \ litestepBangCommandStart, \ litestepGenericDirective syn match litestepGenericDirective \ contained display \ '\<\h\w\+\>' syn match litestepBeginning \ nextgroup=@litestepBeginnings skipwhite \ '^' syn keyword litestepPreProc \ contained \ Include \ If \ ElseIf \ Else \ EndIf syn cluster litestepMultiCommands \ contains= \ litestepMultiCommand syn match litestepMultiCommandStart \ nextgroup=@litestepMultiCommands \ '\*' syn match litestepMultiCommand \ contained display \ '\<\h\w\+\>' syn cluster litestepVariables \ contains= \ litestepBuiltinFolderVariable, \ litestepBuiltinConditionalVariable, \ litestepBuiltinResourceVariable, \ litestepBuiltinGUIDFolderMappingVariable, \ litestepVariable syn region litestepVariableExpansion \ display oneline transparent \ contains= \ @litestepVariables, \ litestepNumber, \ litestepMathOperator \ matchgroup=litestepVariableExpansion \ start='\$' \ end='\$' syn match litestepNumber \ display \ '\<\d\+\>' syn region litestepString \ display oneline contains=litestepVariableExpansion \ start=+"+ end=+"+ " TODO: unsure about this one. syn region litestepSubValue \ display oneline contains=litestepVariableExpansion \ start=+'+ end=+'+ syn keyword litestepBoolean \ true \ false "syn keyword litestepLine " \ ? "syn match litestepColor " \ display " \ '\<\x\+\>' syn match litestepRelationalOperator \ display \ '=\|<[>=]\=\|>=\=' syn keyword litestepLogicalOperator \ and \ or \ not syn match litestepMathOperator \ contained display \ '[+*/-]' syn keyword litestepBuiltinDirective \ LoadModule \ LSNoStartup \ LSAutoHideModules \ LSNoShellWarning \ LSSetAsShell \ LSUseSystemDDE \ LSDisableTrayService \ LSImageFolder \ ThemeAuthor \ ThemeName syn keyword litestepDeprecatedBuiltinDirective \ LSLogLevel \ LSLogFile syn match litestepVariable \ contained display \ '\<\h\w\+\>' syn keyword litestepBuiltinFolderVariable \ contained \ AdminToolsDir \ CommonAdminToolsDir \ CommonDesktopDir \ CommonFavorites \ CommonPrograms \ CommonStartMenu \ CommonStartup \ Cookies \ Desktop \ DesktopDir \ DocumentsDir \ Favorites \ Fonts \ History \ Internet \ InternetCache \ LitestepDir \ Nethood \ Printhood \ Programs \ QuickLaunch \ Recent \ Sendto \ Startmenu \ Startup \ Templates \ WinDir \ LitestepDir syn keyword litestepBuiltinConditionalVariable \ contained \ Win2000 \ Win95 \ Win98 \ Win9X \ WinME \ WinNT \ WinNT4 \ WinXP syn keyword litestepBuiltinResourceVariable \ contained \ CompileDate \ ResolutionX \ ResolutionY \ UserName syn keyword litestepBuiltinGUIDFolderMappingVariable \ contained \ AdminTools \ BitBucket \ Controls \ Dialup \ Documents \ Drives \ Network \ NetworkAndDialup \ Printers \ Scheduled syn cluster litestepBangs \ contains= \ litestepBuiltinBang, \ litestepBang syn match litestepBangStart \ nextgroup=@litestepBangs \ '!' syn match litestepBang \ contained display \ '\<\h\w\+\>' syn keyword litestepBuiltinBang \ contained \ About \ Alert \ CascadeWindows \ Confirm \ Execute \ Gather \ HideModules \ LogOff \ MinimizeWindows \ None \ Quit \ Recycle \ Refresh \ Reload \ ReloadModule \ RestoreWindows \ Run \ ShowModules \ Shutdown \ Switchuser \ TileWindowsH \ TileWindowsV \ ToggleModules \ UnloadModule hi def link litestepTodo Todo hi def link litestepComment Comment hi def link litestepDirective Keyword hi def link litestepGenericDirective litestepDirective hi def link litestepPreProc PreProc hi def link litestepMultiCommandStart litestepPreProc hi def link litestepMultiCommand litestepDirective hi def link litestepDelimiter Delimiter hi def link litestepVariableExpansion litestepDelimiter hi def link litestepNumber Number hi def link litestepString String hi def link litestepSubValue litestepString hi def link litestepBoolean Boolean "hi def link litestepLine "hi def link litestepColor Type hi def link litestepOperator Operator hi def link litestepRelationalOperator litestepOperator hi def link litestepLogicalOperator litestepOperator hi def link litestepMathOperator litestepOperator hi def link litestepBuiltinDirective litestepDirective hi def link litestepDeprecatedBuiltinDirective Error hi def link litestepVariable Identifier hi def link litestepBuiltinFolderVariable Identifier hi def link litestepBuiltinConditionalVariable Identifier hi def link litestepBuiltinResourceVariable Identifier hi def link litestepBuiltinGUIDFolderMappingVariable Identifier hi def link litestepBangStart litestepPreProc hi def link litestepBang litestepDirective hi def link litestepBuiltinBang litestepBang let b:current_syntax = "litestep" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/loginaccess.vim000066400000000000000000000101311267703067000206110ustar00rootroot00000000000000" Vim syntax file " Language: login.access(5) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2006-04-19 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn keyword loginaccessTodo contained TODO FIXME XXX NOTE syn region loginaccessComment display oneline start='^#' end='$' \ contains=loginaccessTodo,@Spell syn match loginaccessBegin display '^' \ nextgroup=loginaccessPermission, \ loginaccessComment skipwhite syn match loginaccessPermission contained display '[^#]' \ contains=loginaccessPermError \ nextgroup=loginaccessUserSep syn match loginaccessPermError contained display '[^+-]' syn match loginaccessUserSep contained display ':' \ nextgroup=loginaccessUsers, \ loginaccessAllUsers, \ loginaccessExceptUsers syn match loginaccessUsers contained display '[^, \t:]\+' \ nextgroup=loginaccessUserIntSep, \ loginaccessOriginSep syn match loginaccessAllUsers contained display '\' \ nextgroup=loginaccessUserIntSep, \ loginaccessOriginSep syn match loginaccessLocalUsers contained display '\' \ nextgroup=loginaccessUserIntSep, \ loginaccessOriginSep syn match loginaccessExceptUsers contained display '\' \ nextgroup=loginaccessUserIntSep, \ loginaccessOriginSep syn match loginaccessUserIntSep contained display '[, \t]' \ nextgroup=loginaccessUsers, \ loginaccessAllUsers, \ loginaccessExceptUsers syn match loginaccessOriginSep contained display ':' \ nextgroup=loginaccessOrigins, \ loginaccessAllOrigins, \ loginaccessExceptOrigins syn match loginaccessOrigins contained display '[^, \t]\+' \ nextgroup=loginaccessOriginIntSep syn match loginaccessAllOrigins contained display '\' \ nextgroup=loginaccessOriginIntSep syn match loginaccessLocalOrigins contained display '\' \ nextgroup=loginaccessOriginIntSep syn match loginaccessExceptOrigins contained display '\' \ nextgroup=loginaccessOriginIntSep syn match loginaccessOriginIntSep contained display '[, \t]' \ nextgroup=loginaccessOrigins, \ loginaccessAllOrigins, \ loginaccessExceptOrigins hi def link loginaccessTodo Todo hi def link loginaccessComment Comment hi def link loginaccessPermission Type hi def link loginaccessPermError Error hi def link loginaccessUserSep Delimiter hi def link loginaccessUsers Identifier hi def link loginaccessAllUsers Macro hi def link loginaccessLocalUsers Macro hi def link loginaccessExceptUsers Operator hi def link loginaccessUserIntSep loginaccessUserSep hi def link loginaccessOriginSep loginaccessUserSep hi def link loginaccessOrigins Identifier hi def link loginaccessAllOrigins Macro hi def link loginaccessLocalOrigins Macro hi def link loginaccessExceptOrigins loginaccessExceptUsers hi def link loginaccessOriginIntSep loginaccessUserSep let b:current_syntax = "loginaccess" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/logindefs.vim000066400000000000000000000165451267703067000203100ustar00rootroot00000000000000" Vim syntax file " Language: login.defs(5) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2010-11-29 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn match logindefsBegin display '^' \ nextgroup= \ logindefsComment, \ @logindefsKeyword \ skipwhite syn region logindefsComment display oneline start='^\s*#' end='$' \ contains=logindefsTodo,@Spell syn keyword logindefsTodo contained TODO FIXME XXX NOTE syn cluster logindefsKeyword contains= \ logindefsBooleanKeyword, \ logindefsEncryptKeyword, \ logindefsNumberKeyword, \ logindefsPathKeyword, \ logindefsPathsKeyword, \ logindefsStringKeyword syn keyword logindefsBooleanKeyword contained \ CHFN_AUTH \ CHSH_AUTH \ CREATE_HOME \ DEFAULT_HOME \ FAILLOG_ENAB \ LASTLOG_ENAB \ LOG_OK_LOGINS \ LOG_UNKFAIL_ENAB \ MAIL_CHECK_ENAB \ MD5_CRYPT_ENAB \ OBSCURE_CHECKS_ENAB \ PASS_ALWAYS_WARN \ PORTTIME_CHECKS_ENAB \ QUOTAS_ENAB \ SU_WHEEL_ONLY \ SYSLOG_SG_ENAB \ SYSLOG_SU_ENAB \ USERGROUPS_ENAB \ nextgroup=logindefsBoolean skipwhite syn keyword logindefsBoolean contained yes no syn keyword logindefsEncryptKeyword contained \ ENCRYPT_METHOD \ nextgroup=logindefsEncryptMethod skipwhite syn keyword logindefsEncryptMethod contained \ DES \ MD5 \ SHA256 \ SHA512 syn keyword logindefsNumberKeyword contained \ ERASECHAR \ FAIL_DELAY \ GID_MAX \ GID_MIN \ KILLCHAR \ LOGIN_RETRIES \ LOGIN_TIMEOUT \ MAX_MEMBERS_PER_GROUP \ PASS_CHANGE_TRIES \ PASS_MAX_DAYS \ PASS_MIN_DAYS \ PASS_WARN_AGE \ PASS_MAX_LEN \ PASS_MIN_LEN \ SHA_CRYPT_MAX_ROUNDS \ SHA_CRYPT_MIN_ROUNDS \ SYS_GID_MAX \ SYS_GID_MIN \ SYS_UID_MAX \ SYS_UID_MIN \ UID_MAX \ UID_MIN \ ULIMIT \ UMASK \ nextgroup=@logindefsNumber skipwhite syn cluster logindefsNumber contains= \ logindefsDecimal, \ logindefsHex, \ logindefsOctal, \ logindefsOctalError syn match logindefsDecimal contained '\<\d\+\>' syn match logindefsHex contained display '\<0x\x\+\>' syn match logindefsOctal contained display '\<0\o\+\>' \ contains=logindefsOctalZero syn match logindefsOctalZero contained display '\<0' syn match logindefsOctalError contained display '\<0\o*[89]\d*\>' syn keyword logindefsPathKeyword contained \ ENVIRON_FILE \ FAKE_SHELL \ FTMP_FILE \ HUSHLOGIN_FILE \ ISSUE_FILE \ MAIL_DIR \ MAIL_FILE \ NOLOGINS_FILE \ SULOG_FILE \ TTYTYPE_FILE \ nextgroup=logindefsPath skipwhite syn match logindefsPath contained '[[:graph:]]\+' syn keyword logindefsPathsKeyword contained \ CONSOLE \ ENV_PATH \ ENV_SUPATH \ MOTD_FILE \ nextgroup=logindefsPaths skipwhite syn match logindefsPaths contained '[^:]\+' \ nextgroup=logindefsPathDelim syn match logindefsPathDelim contained ':' nextgroup=logindefsPaths syn keyword logindefsStringKeyword contained \ CHFN_RESTRICT \ CONSOLE_GROUPS \ ENV_HZ \ ENV_TZ \ LOGIN_STRING \ SU_NAME \ TTYGROUP \ TTYPERM \ USERDEL_CMD \ nextgroup=logindefsString skipwhite syn match logindefsString contained '[[:graph:]]\+' hi def link logindefsComment Comment hi def link logindefsTodo Todo hi def link logindefsKeyword Keyword hi def link logindefsBooleanKeyword logindefsKeyword hi def link logindefsEncryptKeyword logindefsKeyword hi def link logindefsNumberKeyword logindefsKeyword hi def link logindefsPathKeyword logindefsKeyword hi def link logindefsPathsKeyword logindefsKeyword hi def link logindefsStringKeyword logindefsKeyword hi def link logindefsBoolean Boolean hi def link logindefsEncryptMethod Type hi def link logindefsNumber Number hi def link logindefsDecimal logindefsNumber hi def link logindefsHex logindefsNumber hi def link logindefsOctal logindefsNumber hi def link logindefsOctalZero PreProc hi def link logindefsOctalError Error hi def link logindefsPath String hi def link logindefsPaths logindefsPath hi def link logindefsPathDelim Delimiter hi def link logindefsString String let b:current_syntax = "logindefs" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/logtalk.vim000066400000000000000000000376431267703067000177750ustar00rootroot00000000000000" Vim syntax file " " Language: Logtalk " Maintainer: Paulo Moura " Last Change: February 4, 2012 " Quit when a syntax file was already loaded: if version < 600 syntax clear elseif exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim " 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=+'+ contains=logtalkEscapeSequence syn match logtalkEscapeSequence contained "\\\([\\abfnrtv\"\']\|\(x[a-fA-F0-9]\+\|[0-7]\+\)\\\)" " Logtalk message sending operators syn match logtalkOperator "::" 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=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator,logtalkString,logtalkAtom,logtalkEntityRel,logtalkLineComment syn region logtalkOpenEntityDir matchgroup=logtalkOpenEntityDirTag start=":- protocol(" matchgroup=logtalkOpenEntityDirTag end=")\." contains=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator,logtalkEntityRel,logtalkLineComment syn region logtalkOpenEntityDir matchgroup=logtalkOpenEntityDirTag start=":- category(" matchgroup=logtalkOpenEntityDirTag end=")\." contains=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator,logtalkEntityRel,logtalkLineComment " 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,logtalkVariable,logtalkNumber,logtalkOperator,logtalkString,logtalkAtom contained syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="specializes(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator,logtalkString,logtalkAtom contained syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="extends(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator,logtalkString,logtalkAtom contained syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="imports(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator,logtalkString,logtalkAtom contained syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="implements(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator,logtalkString,logtalkAtom contained syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="complements(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator,logtalkString,logtalkAtom contained " Logtalk directives syn region logtalkDir matchgroup=logtalkDirTag start=":- if(" matchgroup=logtalkDirTag end=")\." contains=ALL syn region logtalkDir matchgroup=logtalkDirTag start=":- elif(" matchgroup=logtalkDirTag end=")\." contains=ALL syn match logtalkDirTag ":- else\." syn match logtalkDirTag ":- endif\." syn region logtalkDir matchgroup=logtalkDirTag start=":- alias(" matchgroup=logtalkDirTag end=")\." contains=ALL syn region logtalkDir matchgroup=logtalkDirTag start=":- calls(" matchgroup=logtalkDirTag end=")\." contains=ALL syn region logtalkDir matchgroup=logtalkDirTag start=":- coinductive(" matchgroup=logtalkDirTag end=")\." contains=ALL syn region logtalkDir matchgroup=logtalkDirTag start=":- encoding(" matchgroup=logtalkDirTag end=")\." contains=ALL 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=":- multifile(" 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=":- meta_predicate(" matchgroup=logtalkDirTag end=")\." contains=ALL syn region logtalkDir matchgroup=logtalkDirTag start=":- meta_non_terminal(" matchgroup=logtalkDirTag end=")\." contains=ALL syn region logtalkDir matchgroup=logtalkDirTag start=":- op(" matchgroup=logtalkDirTag end=")\." contains=ALL syn region logtalkDir matchgroup=logtalkDirTag start=":- set_logtalk_flag(" matchgroup=logtalkDirTag end=")\." contains=ALL syn region logtalkDir matchgroup=logtalkDirTag start=":- synchronized(" matchgroup=logtalkDirTag end=")\." contains=ALL syn match logtalkDirTag ":- synchronized\." syn region logtalkDir matchgroup=logtalkDirTag start=":- uses(" matchgroup=logtalkDirTag end=")\." contains=ALL syn match logtalkDirTag ":- threaded\." " Prolog directives syn region logtalkDir matchgroup=logtalkDirTag start=":- ensure_loaded(" matchgroup=logtalkDirTag end=")\." contains=ALL syn region logtalkDir matchgroup=logtalkDirTag start=":- include(" matchgroup=logtalkDirTag end=")\." contains=ALL syn region logtalkDir matchgroup=logtalkDirTag start=":- set_prolog_flag(" matchgroup=logtalkDirTag end=")\." contains=ALL " Module directives syn region logtalkDir matchgroup=logtalkDirTag start=":- module(" matchgroup=logtalkDirTag end=")\." contains=ALL syn region logtalkDir matchgroup=logtalkDirTag start=":- export(" matchgroup=logtalkDirTag end=")\." contains=ALL syn region logtalkDir matchgroup=logtalkDirTag start=":- reexport(" matchgroup=logtalkDirTag end=")\." contains=ALL syn region logtalkDir matchgroup=logtalkDirTag start=":- use_module(" matchgroup=logtalkDirTag end=")\." contains=ALL " Logtalk built-in predicates syn match logtalkBuiltIn "\<\(abolish\|c\(reate\|urrent\)\)_\(object\|protocol\|category\)\ze(" syn match logtalkBuiltIn "\<\(object\|protocol\|category\)_property\ze(" syn match logtalkBuiltIn "\" syn match logtalkKeyword "\" syn match logtalkKeyword "\" syn match logtalkOperator "->" syn match logtalkKeyword "\" syn match logtalkOperator "@>=" " Term creation and decomposition syn match logtalkKeyword "\" " 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 "\<\(curren\|se\)t_\(in\|out\)put\ze(" syn match logtalkKeyword "\" syn match logtalkKeyword "\" syn match logtalkKeyword "\" " Term input/output syn match logtalkKeyword "\" " Atomic term processing syn match logtalkKeyword "\" " Sorting syn match logtalkKeyword "\<\(key\)\?sort\ze(" " Evaluable functors syn match logtalkOperator "+" syn match logtalkOperator "-" syn match logtalkOperator "\*" syn match logtalkOperator "//" syn match logtalkOperator "/" syn match logtalkKeyword "\" syn match logtalkKeyword "\" syn match logtalkKeyword "\" syn match logtalkKeyword "\" syn match logtalkKeyword "\>" syn match logtalkOperator "<<" syn match logtalkOperator "/\\" syn match logtalkOperator "\\/" syn match logtalkOperator "\\" " Logtalk list operator syn match logtalkOperator "|" " Logtalk existential quantifier operator syn match logtalkOperator "\^" " Logtalk numbers syn match logtalkNumber "\<\d\+\>" syn match logtalkNumber "\<\d\+\.\d\+\>" syn match logtalkNumber "\<\d\+[eE][-+]\=\d\+\>" syn match logtalkNumber "\<\d\+\.\d\+[eE][-+]\=\d\+\>" syn match logtalkNumber "\<0'.\|0''\|0'\"\>" syn match logtalkNumber "\<0b[0-1]\+\>" syn match logtalkNumber "\<0o\o\+\>" syn match logtalkNumber "\<0x\x\+\>" " Logtalk end-of-clause syn match logtalkOperator "\." " Logtalk comments syn region logtalkBlockComment start="/\*" end="\*/" fold syn match logtalkLineComment "%.*" syn cluster logtalkComment contains=logtalkBlockComment,logtalkLineComment " Logtalk conditional compilation folding syn region logtalkIfContainer transparent keepend extend start=":- if(" end=":- endif\." containedin=ALLBUT,@logtalkComment contains=NONE syn region logtalkIf transparent fold keepend start=":- if(" end=":- \(else\.\|elif(\)"ms=s-1,me=s-1 contained containedin=logtalkIfContainer nextgroup=logtalkElseIf,logtalkElse contains=TOP syn region logtalkElseIf transparent fold keepend start=":- elif(" end=":- \(else\.\|elif(\)"ms=s-1,me=s-1 contained containedin=logtalkIfContainer nextgroup=logtalkElseIf,logtalkElse contains=TOP syn region logtalkElse transparent fold keepend start=":- else\." end=":- endif\." contained containedin=logtalkIfContainer contains=TOP " Logtalk entity folding syn region logtalkEntity transparent fold keepend start=":- object(" end=":- end_object\." contains=ALL syn region logtalkEntity transparent fold keepend start=":- protocol(" end=":- end_protocol\." contains=ALL syn region logtalkEntity transparent fold keepend start=":- category(" end=":- end_category\." contains=ALL syn sync ccomment logtalkBlockComment 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 else command -nargs=+ HiLink hi def link endif HiLink logtalkBlockComment Comment HiLink logtalkLineComment Comment HiLink logtalkOpenEntityDir Normal HiLink logtalkOpenEntityDirTag PreProc HiLink logtalkIfContainer PreProc HiLink logtalkIf PreProc HiLink logtalkElseIf PreProc HiLink logtalkElse 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 logtalkEscapeSequence SpecialChar 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" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/lotos.vim000066400000000000000000000053101267703067000174620ustar00rootroot00000000000000" Vim syntax file " Language: LOTOS (Language Of Temporal Ordering Specifications, IS8807) " Maintainer: Daniel Amyot " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/lout.vim000066400000000000000000000112751267703067000173140ustar00rootroot00000000000000" Vim syntax file " Language: Lout " Maintainer: Christian V. J. Brssow " Last Change: So 12 Feb 2012 15:15:03 CET " Filenames: *.lout,*.lt " URL: http://www.cvjb.de/comp/vim/lout.vim " $Id: lout.vim,v 1.4 2012/02/12 15:16:17 bruessow Exp $ " " Lout: Basser Lout document formatting system. " Many Thanks to... " " 2012-02-12: " Thilo Six send a patch for cpoptions. " See the discussion at http://thread.gmane.org/gmane.editors.vim.devel/32151 " For version 5.x: Clear all syntax items " 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:cpo_save=&cpo set cpo&vim " 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 else command -nargs=+ HiLink hi def link 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" let &cpo=s:cpo_save unlet s:cpo_save " vim:ts=8:sw=4:nocindent:smartindent: vim-7.4.1689/runtime/syntax/lpc.vim000066400000000000000000000555331267703067000171140ustar00rootroot00000000000000" Vim syntax file " Language: LPC " Maintainer: Shizhu Pan " URL: http://poet.tomud.com/pub/lpc.vim.bz2 " Last Change: 2011 Dec 10 by Thilo Six " 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 let s:cpo_save = &cpo set cpo&vim " 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 " 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=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:*/,:// " 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 else command -nargs=+ HiLink hi def link 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" let &cpo = s:cpo_save unlet s:cpo_save " vim:ts=8:nosta:sw=2:ai:si: " vim600:set fdm=marker: }}}1 vim-7.4.1689/runtime/syntax/lprolog.vim000066400000000000000000000104001267703067000177740ustar00rootroot00000000000000" Vim syntax file " Language: LambdaProlog (Teyjus) " Filenames: *.mod *.sig " Maintainer: Markus Mottl " URL: http://www.ocaml.info/vim/syntax/lprolog.vim " Last Change: 2006 Feb 05 " 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="^\" matchgroup=lprologKeyword end="\." " Types syn match lprologKeyword "^\" 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/lscript.vim000066400000000000000000000303061267703067000200050ustar00rootroot00000000000000" 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/lsl.vim000066400000000000000000000366701267703067000171310ustar00rootroot00000000000000" Vim syntax file " Language: Linden Scripting Language " Maintainer: Timo Frenay " Last Change: 2012 Apr 30 " Quit when a syntax file was already loaded if exists("b:current_syntax") finish endif let s:keepcpo= &cpo set cpo&vim " Initializations syn case match " Keywords syn keyword lslKeyword default do else for if jump return state while " Types syn keyword lslType float integer key list quaternion rotation string vector " Labels syn match lslLabel +@\h\w*+ display " Constants syn keyword lslConstant \ ACTIVE AGENT AGENT_ALWAYS_RUN AGENT_ATTACHMENTS AGENT_AWAY AGENT_BUSY \ AGENT_CROUCHING AGENT_FLYING AGENT_IN_AIR AGENT_MOUSELOOK AGENT_ON_OBJECT \ AGENT_SCRIPTED AGENT_SITTING AGENT_TYPING AGENT_WALKING ALL_SIDES ANIM_ON \ ATTACH_BACK ATTACH_BELLY ATTACH_CHEST ATTACH_CHIN ATTACH_HEAD \ ATTACH_HUD_BOTTOM ATTACH_HUD_BOTTOM_LEFT ATTACH_HUD_BOTTOM_RIGHT \ ATTACH_HUD_CENTER_1 ATTACH_HUD_CENTER_2 ATTACH_HUD_TOP_CENTER \ ATTACH_HUD_TOP_LEFT ATTACH_HUD_TOP_RIGHT ATTACH_LEAR ATTACH_LEYE ATTACH_LFOOT \ ATTACH_LHAND ATTACH_LHIP ATTACH_LLARM ATTACH_LLLEG ATTACH_LPEC \ ATTACH_LSHOULDER ATTACH_LUARM ATTACH_LULEG ATTACH_MOUTH ATTACH_NOSE \ ATTACH_PELVIS ATTACH_REAR ATTACH_REYE ATTACH_RFOOT ATTACH_RHAND ATTACH_RHIP \ ATTACH_RLARM ATTACH_RLLEG ATTACH_RPEC ATTACH_RSHOULDER ATTACH_RUARM \ ATTACH_RULEG CAMERA_ACTIVE CAMERA_BEHINDNESS_ANGLE CAMERA_BEHINDNESS_LAG \ CAMERA_DISTANCE CAMERA_FOCUS CAMERA_FOCUS_LAG CAMERA_FOCUS_LOCKED \ CAMERA_FOCUS_OFFSET CAMERA_FOCUS_THRESHOLD CAMERA_PITCH CAMERA_POSITION \ CAMERA_POSITION_LAG CAMERA_POSITION_LOCKED CAMERA_POSITION_THRESHOLD \ CHANGED_ALLOWED_DROP CHANGED_COLOR CHANGED_INVENTORY CHANGED_LINK \ CHANGED_OWNER CHANGED_REGION CHANGED_SCALE CHANGED_SHAPE CHANGED_TELEPORT \ CHANGED_TEXTURE CLICK_ACTION_BUY CLICK_ACTION_NONE CLICK_ACTION_OPEN \ CLICK_ACTION_OPEN_MEDIA CLICK_ACTION_PAY CLICK_ACTION_PLAY CLICK_ACTION_SIT \ CLICK_ACTION_TOUCH CONTROL_BACK CONTROL_DOWN CONTROL_FWD CONTROL_LBUTTON \ CONTROL_LEFT CONTROL_ML_LBUTTON CONTROL_RIGHT CONTROL_ROT_LEFT \ CONTROL_ROT_RIGHT CONTROL_UP DATA_BORN DATA_NAME DATA_ONLINE DATA_PAYINFO \ DATA_RATING DATA_SIM_POS DATA_SIM_RATING DATA_SIM_STATUS DEBUG_CHANNEL \ DEG_TO_RAD EOF FALSE HTTP_BODY_MAXLENGTH HTTP_BODY_TRUNCATED HTTP_METHOD \ HTTP_MIMETYPE HTTP_VERIFY_CERT INVENTORY_ALL INVENTORY_ANIMATION \ INVENTORY_BODYPART INVENTORY_CLOTHING INVENTORY_GESTURE INVENTORY_LANDMARK \ INVENTORY_NONE INVENTORY_NOTECARD INVENTORY_OBJECT INVENTORY_SCRIPT \ INVENTORY_SOUND INVENTORY_TEXTURE LAND_LARGE_BRUSH LAND_LEVEL LAND_LOWER \ LAND_MEDIUM_BRUSH LAND_NOISE LAND_RAISE LAND_REVERT LAND_SMALL_BRUSH \ LAND_SMOOTH LINK_ALL_CHILDREN LINK_ALL_OTHERS LINK_ROOT LINK_SET LINK_THIS \ LIST_STAT_GEOMETRIC_MEAN LIST_STAT_MAX LIST_STAT_MEAN LIST_STAT_MEDIAN \ LIST_STAT_MIN LIST_STAT_NUM_COUNT LIST_STAT_RANGE LIST_STAT_STD_DEV \ LIST_STAT_SUM LIST_STAT_SUM_SQUARES LOOP MASK_BASE MASK_EVERYONE MASK_GROUP \ MASK_NEXT MASK_OWNER NULL_KEY OBJECT_CREATOR OBJECT_DESC OBJECT_GROUP \ OBJECT_NAME OBJECT_OWNER OBJECT_POS OBJECT_ROT OBJECT_UNKNOWN_DETAIL \ OBJECT_VELOCITY PARCEL_COUNT_GROUP PARCEL_COUNT_OTHER PARCEL_COUNT_OWNER \ PARCEL_COUNT_SELECTED PARCEL_COUNT_TEMP PARCEL_COUNT_TOTAL PARCEL_DETAILS_AREA \ PARCEL_DETAILS_DESC PARCEL_DETAILS_GROUP PARCEL_DETAILS_NAME \ PARCEL_DETAILS_OWNER PARCEL_FLAG_ALLOW_ALL_OBJECT_ENTRY \ PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS PARCEL_FLAG_ALLOW_CREATE_OBJECTS \ PARCEL_FLAG_ALLOW_DAMAGE PARCEL_FLAG_ALLOW_FLY \ PARCEL_FLAG_ALLOW_GROUP_OBJECT_ENTRY PARCEL_FLAG_ALLOW_GROUP_SCRIPTS \ PARCEL_FLAG_ALLOW_LANDMARK PARCEL_FLAG_ALLOW_SCRIPTS \ PARCEL_FLAG_ALLOW_TERRAFORM PARCEL_FLAG_LOCAL_SOUND_ONLY \ PARCEL_FLAG_RESTRICT_PUSHOBJECT PARCEL_FLAG_USE_ACCESS_GROUP \ PARCEL_FLAG_USE_ACCESS_LIST PARCEL_FLAG_USE_BAN_LIST \ PARCEL_FLAG_USE_LAND_PASS_LIST PARCEL_MEDIA_COMMAND_AGENT \ PARCEL_MEDIA_COMMAND_AUTO_ALIGN PARCEL_MEDIA_COMMAND_DESC \ PARCEL_MEDIA_COMMAND_LOOP PARCEL_MEDIA_COMMAND_LOOP_SET \ PARCEL_MEDIA_COMMAND_PAUSE PARCEL_MEDIA_COMMAND_PLAY PARCEL_MEDIA_COMMAND_SIZE \ PARCEL_MEDIA_COMMAND_STOP PARCEL_MEDIA_COMMAND_TEXTURE \ PARCEL_MEDIA_COMMAND_TIME PARCEL_MEDIA_COMMAND_TYPE \ PARCEL_MEDIA_COMMAND_UNLOAD PARCEL_MEDIA_COMMAND_URL PASSIVE \ PAYMENT_INFO_ON_FILE PAYMENT_INFO_USED PAY_DEFAULT PAY_HIDE PERM_ALL PERM_COPY \ PERM_MODIFY PERM_MOVE PERM_TRANSFER PERMISSION_ATTACH PERMISSION_CHANGE_LINKS \ PERMISSION_CONTROL_CAMERA PERMISSION_DEBIT PERMISSION_TAKE_CONTROLS \ PERMISSION_TRACK_CAMERA PERMISSION_TRIGGER_ANIMATION PI PI_BY_TWO PING_PONG \ PRIM_BUMP_BARK PRIM_BUMP_BLOBS PRIM_BUMP_BRICKS PRIM_BUMP_BRIGHT \ PRIM_BUMP_CHECKER PRIM_BUMP_CONCRETE PRIM_BUMP_DARK PRIM_BUMP_DISKS \ PRIM_BUMP_GRAVEL PRIM_BUMP_LARGETILE PRIM_BUMP_NONE PRIM_BUMP_SHINY \ PRIM_BUMP_SIDING PRIM_BUMP_STONE PRIM_BUMP_STUCCO PRIM_BUMP_SUCTION \ PRIM_BUMP_TILE PRIM_BUMP_WEAVE PRIM_BUMP_WOOD PRIM_CAST_SHADOWS PRIM_COLOR \ PRIM_FLEXIBLE PRIM_FULLBRIGHT PRIM_HOLE_CIRCLE PRIM_HOLE_DEFAULT \ PRIM_HOLE_SQUARE PRIM_HOLE_TRIANGLE PRIM_MATERIAL PRIM_MATERIAL_FLESH \ PRIM_MATERIAL_GLASS PRIM_MATERIAL_LIGHT PRIM_MATERIAL_METAL \ PRIM_MATERIAL_PLASTIC PRIM_MATERIAL_RUBBER PRIM_MATERIAL_STONE \ PRIM_MATERIAL_WOOD PRIM_PHANTOM PRIM_PHYSICS PRIM_POINT_LIGHT PRIM_POSITION \ PRIM_ROTATION PRIM_SCULPT_TYPE_CYLINDER PRIM_SCULPT_TYPE_PLANE \ PRIM_SCULPT_TYPE_SPHERE PRIM_SCULPT_TYPE_TORUS PRIM_SHINY_HIGH PRIM_SHINY_LOW \ PRIM_SHINY_MEDIUM PRIM_SHINY_NONE PRIM_SIZE PRIM_TEMP_ON_REZ PRIM_TEXGEN \ PRIM_TEXGEN_DEFAULT PRIM_TEXGEN_PLANAR PRIM_TEXTURE PRIM_TYPE PRIM_TYPE_BOX \ PRIM_TYPE_BOX PRIM_TYPE_CYLINDER PRIM_TYPE_CYLINDER PRIM_TYPE_LEGACY \ PRIM_TYPE_PRISM PRIM_TYPE_PRISM PRIM_TYPE_RING PRIM_TYPE_SCULPT \ PRIM_TYPE_SPHERE PRIM_TYPE_SPHERE PRIM_TYPE_TORUS PRIM_TYPE_TORUS \ PRIM_TYPE_TUBE PRIM_TYPE_TUBE PSYS_PART_BEAM_MASK PSYS_PART_BOUNCE_MASK \ PSYS_PART_DEAD_MASK PSYS_PART_EMISSIVE_MASK PSYS_PART_END_ALPHA \ PSYS_PART_END_COLOR PSYS_PART_END_SCALE PSYS_PART_FLAGS \ PSYS_PART_FOLLOW_SRC_MASK PSYS_PART_FOLLOW_VELOCITY_MASK \ PSYS_PART_INTERP_COLOR_MASK PSYS_PART_INTERP_SCALE_MASK PSYS_PART_MAX_AGE \ PSYS_PART_RANDOM_ACCEL_MASK PSYS_PART_RANDOM_VEL_MASK PSYS_PART_START_ALPHA \ PSYS_PART_START_COLOR PSYS_PART_START_SCALE PSYS_PART_TARGET_LINEAR_MASK \ PSYS_PART_TARGET_POS_MASK PSYS_PART_TRAIL_MASK PSYS_PART_WIND_MASK \ PSYS_SRC_ACCEL PSYS_SRC_ANGLE_BEGIN PSYS_SRC_ANGLE_END \ PSYS_SRC_BURST_PART_COUNT PSYS_SRC_BURST_RADIUS PSYS_SRC_BURST_RATE \ PSYS_SRC_BURST_SPEED_MAX PSYS_SRC_BURST_SPEED_MIN PSYS_SRC_INNERANGLE \ PSYS_SRC_MAX_AGE PSYS_SRC_OMEGA PSYS_SRC_OUTERANGLE PSYS_SRC_PATTERN \ PSYS_SRC_PATTERN_ANGLE PSYS_SRC_PATTERN_ANGLE_CONE \ PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY PSYS_SRC_PATTERN_DROP \ PSYS_SRC_PATTERN_EXPLODE PSYS_SRC_TARGET_KEY PSYS_SRC_TEXTURE PUBLIC_CHANNEL \ RAD_TO_DEG REGION_FLAG_ALLOW_DAMAGE REGION_FLAG_ALLOW_DIRECT_TELEPORT \ REGION_FLAG_BLOCK_FLY REGION_FLAG_BLOCK_TERRAFORM \ REGION_FLAG_DISABLE_COLLISIONS REGION_FLAG_DISABLE_PHYSICS \ REGION_FLAG_FIXED_SUN REGION_FLAG_RESTRICT_PUSHOBJECT REGION_FLAG_SANDBOX \ REMOTE_DATA_CHANNEL REMOTE_DATA_REPLY REMOTE_DATA_REQUEST REVERSE ROTATE SCALE \ SCRIPTED SMOOTH SQRT2 STATUS_BLOCK_GRAB STATUS_CAST_SHADOWS STATUS_DIE_AT_EDGE \ STATUS_PHANTOM STATUS_PHYSICS STATUS_RETURN_AT_EDGE STATUS_ROTATE_X \ STATUS_ROTATE_Y STATUS_ROTATE_Z STATUS_SANDBOX STRING_TRIM STRING_TRIM_HEAD \ STRING_TRIM_TAIL TRUE TWO_PI TYPE_FLOAT TYPE_INTEGER TYPE_INVALID TYPE_KEY \ TYPE_ROTATION TYPE_STRING TYPE_VECTOR VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY \ VEHICLE_ANGULAR_DEFLECTION_TIMESCALE VEHICLE_ANGULAR_FRICTION_TIMESCALE \ VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE VEHICLE_ANGULAR_MOTOR_DIRECTION \ VEHICLE_ANGULAR_MOTOR_TIMESCALE VEHICLE_BANKING_EFFICIENCY VEHICLE_BANKING_MIX \ VEHICLE_BANKING_TIMESCALE VEHICLE_BUOYANCY VEHICLE_FLAG_CAMERA_DECOUPLED \ VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT VEHICLE_FLAG_HOVER_TERRAIN_ONLY \ VEHICLE_FLAG_HOVER_UP_ONLY VEHICLE_FLAG_HOVER_WATER_ONLY \ VEHICLE_FLAG_LIMIT_MOTOR_UP VEHICLE_FLAG_LIMIT_ROLL_ONLY \ VEHICLE_FLAG_MOUSELOOK_BANK VEHICLE_FLAG_MOUSELOOK_STEER \ VEHICLE_FLAG_NO_DEFLECTION_UP VEHICLE_HOVER_EFFICIENCY VEHICLE_HOVER_HEIGHT \ VEHICLE_HOVER_TIMESCALE VEHICLE_LINEAR_DEFLECTION_EFFICIENCY \ VEHICLE_LINEAR_DEFLECTION_TIMESCALE VEHICLE_LINEAR_FRICTION_TIMESCALE \ VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE VEHICLE_LINEAR_MOTOR_TIMESCALE \ VEHICLE_LINEAR_MOTOR_DIRECTION VEHICLE_LINEAR_MOTOR_OFFSET \ VEHICLE_REFERENCE_FRAME VEHICLE_TYPE_AIRPLANE VEHICLE_TYPE_BALLOON \ VEHICLE_TYPE_BOAT VEHICLE_TYPE_CAR VEHICLE_TYPE_NONE VEHICLE_TYPE_SLED \ VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY VEHICLE_VERTICAL_ATTRACTION_TIMESCALE \ ZERO_ROTATION ZERO_VECTOR " Events syn keyword lslEvent \ attach at_rot_target at_target changed collision collision_end collision_start \ control dataserver email http_response land_collision land_collision_end \ land_collision_start link_message listen money moving_end moving_start \ not_at_rot_target no_sensor object_rez on_rez remote_data run_time_permissions \ sensor state_entry state_exit timer touch touch_end touch_start not_at_target " Functions syn keyword lslFunction \ llAbs llAcos llAddToLandBanList llAddToLandPassList llAdjustSoundVolume \ llAllowInventoryDrop llAngleBetween llApplyImpulse llApplyRotationalImpulse \ llAsin llAtan2 llAttachToAvatar llAvatarOnSitTarget llAxes2Rot llAxisAngle2Rot \ llBase64ToInteger llBase64ToString llBreakAllLinks llBreakLink llCSV2List \ llCeil llClearCameraParams llCloseRemoteDataChannel llCloud llCollisionFilter \ llCollisionSound llCollisionSprite llCos llCreateLink llDeleteSubList \ llDeleteSubString llDetachFromAvatar llDetectedGrab llDetectedGroup \ llDetectedKey llDetectedLinkNumber llDetectedName llDetectedOwner \ llDetectedPos llDetectedRot llDetectedType llDetectedVel llDialog llDie \ llDumpList2String llEdgeOfWorld llEjectFromLand llEmail llEscapeURL \ llEuler2Rot llFabs llFloor llForceMouselook llFrand llGetAccel llGetAgentInfo \ llGetAgentSize llGetAlpha llGetAndResetTime llGetAnimation llGetAnimationList \ llGetAttached llGetBoundingBox llGetCameraPos llGetCameraRot llGetCenterOfMass \ llGetColor llGetCreator llGetDate llGetEnergy llGetForce llGetFreeMemory \ llGetGMTclock llGetGeometricCenter llGetInventoryCreator llGetInventoryKey \ llGetInventoryName llGetInventoryNumber llGetInventoryPermMask \ llGetInventoryType llGetKey llGetLandOwnerAt llGetLinkKey llGetLinkName \ llGetLinkNumber llGetListEntryType llGetListLength llGetLocalPos llGetLocalRot \ llGetMass llGetNextEmail llGetNotecardLine llGetNumberOfNotecardLines \ llGetNumberOfPrims llGetNumberOfSides llGetObjectDesc llGetObjectDetails \ llGetObjectMass llGetObjectName llGetObjectPermMask llGetObjectPrimCount \ llGetOmega llGetOwner llGetOwnerKey llGetParcelDetails llGetParcelFlags \ llGetParcelMaxPrims llGetParcelPrimCount llGetParcelPrimOwners \ llGetPermissions llGetPermissionsKey llGetPos llGetPrimitiveParams \ llGetRegionCorner llGetRegionFPS llGetRegionFlags llGetRegionName \ llGetRegionTimeDilation llGetRootPosition llGetRootRotation llGetRot \ llGetScale llGetScriptName llGetScriptState llGetSimulatorHostname \ llGetStartParameter llGetStatus llGetSubString llGetSunDirection llGetTexture \ llGetTextureOffset llGetTextureRot llGetTextureScale llGetTime llGetTimeOfDay \ llGetTimestamp llGetTorque llGetUnixTime llGetVel llGetWallclock \ llGiveInventory llGiveInventoryList llGiveMoney llGodLikeRezObject llGround \ llGroundContour llGroundNormal llGroundRepel llGroundSlope llHTTPRequest \ llInsertString llInstantMessage llIntegerToBase64 llKey2Name llList2CSV \ llList2Float llList2Integer llList2Key llList2List llList2ListStrided \ llList2Rot llList2String llList2Vector llListFindList llListInsertList \ llListRandomize llListReplaceList llListSort llListStatistics llListen \ llListenControl llListenRemove llLoadURL llLog llLog10 llLookAt llLoopSound \ llLoopSoundMaster llLoopSoundSlave llMD5String llMakeExplosion llMakeFire \ llMakeFountain llMakeSmoke llMapDestination llMessageLinked llMinEventDelay \ llModPow llModifyLand llMoveToTarget llOffsetTexture llOpenRemoteDataChannel \ llOverMyLand llOwnerSay llParcelMediaCommandList llParcelMediaQuery \ llParseString2List llParseStringKeepNulls llParticleSystem llPassCollisions \ llPassTouches llPlaySound llPlaySoundSlave llPointAt llPow llPreloadSound \ llPushObject llRefreshPrimURL llRegionSay llReleaseCamera llReleaseControls \ llRemoteDataReply llRemoteDataSetRegion llRemoteLoadScript \ llRemoteLoadScriptPin llRemoveFromLandBanList llRemoveFromLandPassList \ llRemoveInventory llRemoveVehicleFlags llRequestAgentData \ llRequestInventoryData llRequestPermissions llRequestSimulatorData \ llResetLandBanList llResetLandPassList llResetOtherScript llResetScript \ llResetTime llRezAtRoot llRezObject llRot2Angle llRot2Axis llRot2Euler \ llRot2Fwd llRot2Left llRot2Up llRotBetween llRotLookAt llRotTarget \ llRotTargetRemove llRotateTexture llRound llSameGroup llSay llScaleTexture \ llScriptDanger llSendRemoteData llSensor llSensorRemove llSensorRepeat \ llSetAlpha llSetBuoyancy llSetCameraAtOffset llSetCameraEyeOffset \ llSetCameraParams llSetClickAction llSetColor llSetDamage llSetForce \ llSetForceAndTorque llSetHoverHeight llSetInventoryPermMask llSetLinkAlpha \ llSetLinkColor llSetLinkPrimitiveParams llSetLinkTexture llSetLocalRot \ llSetObjectDesc llSetObjectName llSetObjectPermMask llSetParcelMusicURL \ llSetPayPrice llSetPos llSetPrimURL llSetPrimitiveParams \ llSetRemoteScriptAccessPin llSetRot llSetScale llSetScriptState llSetSitText \ llSetSoundQueueing llSetSoundRadius llSetStatus llSetText llSetTexture \ llSetTextureAnim llSetTimerEvent llSetTorque llSetTouchText llSetVehicleFlags \ llSetVehicleFloatParam llSetVehicleRotationParam llSetVehicleType \ llSetVehicleVectorParam llShout llSin llSitTarget llSleep llSound \ llSoundPreload llSqrt llStartAnimation llStopAnimation llStopHover \ llStopLookAt llStopMoveToTarget llStopPointAt llStopSound llStringLength \ llStringToBase64 llStringTrim llSubStringIndex llTakeCamera llTakeControls \ llTan llTarget llTargetOmega llTargetRemove llTeleportAgentHome llToLower \ llToUpper llTriggerSound llTriggerSoundLimited llUnSit llUnescapeURL llVecDist \ llVecMag llVecNorm llVolumeDetect llWater llWhisper llWind llXorBase64Strings \ llXorBase64StringsCorrect " Operators syn match lslOperator +[-!%&*+/<=>^|~]+ display " Numbers syn match lslNumber +-\=\%(\<\d\+\|\%(\<\d\+\)\=\.\d\+\)\%([Ee][-+]\=\d\+\)\=\>\|\<0x\x\+\>+ display " Vectors and rotations syn match lslVectorRot +<[-\t +.0-9A-Za-z_]\+\%(,[-\t +.0-9A-Za-z_]\+\)\{2,3}>+ contains=lslNumber display " Vector and rotation properties syn match lslProperty +\.\@<=[sxyz]\>+ display " Strings syn region lslString start=+"+ skip=+\\.+ end=+"+ contains=lslSpecialChar,@Spell syn match lslSpecialChar +\\.+ contained display " Keys syn match lslKey +"\x\{8}-\x\{4}-\x\{4}-\x\{4}-\x\{12}"+ display " Parentheses, braces and brackets syn match lslBlock +[][(){}]+ display " Typecast operators syn match lslTypecast +(\%(float\|integer\|key\|list\|quaternion\|rotation\|string\|vector\))+ contains=lslType display " Comments syn match lslComment +//.*+ contains=@Spell " Define the default highlighting. hi def link lslKeyword Keyword hi def link lslType Type hi def link lslLabel Label hi def link lslConstant Constant hi def link lslEvent PreProc hi def link lslFunction Function hi def link lslOperator Operator hi def link lslNumber Number hi def link lslVectorRot Special hi def link lslProperty Identifier hi def link lslString String hi def link lslSpecialChar SpecialChar hi def link lslKey Special hi def link lslBlock Special hi def link lslTypecast Operator hi def link lslComment Comment let b:current_syntax = "lsl" let &cpo = s:keepcpo unlet s:keepcpo " vim: ts=8 vim-7.4.1689/runtime/syntax/lss.vim000066400000000000000000000122161267703067000171260ustar00rootroot00000000000000" Vim syntax file " Language: Lynx 2.7.1 style file " Maintainer: Scott Bigham " Last Change: 2004 Oct 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 " 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 vim-7.4.1689/runtime/syntax/lua.vim000066400000000000000000000341051267703067000171070ustar00rootroot00000000000000" Vim syntax file " Language: Lua 4.0, Lua 5.0, Lua 5.1 and Lua 5.2 " Maintainer: Marcus Aurelius Farias " First Author: Carlos Augusto Teixeira Mendes " Last Change: 2012 Aug 12 " Options: lua_version = 4 or 5 " lua_subversion = 0 (4.0, 5.0) or 1 (5.1) or 2 (5.2) " default 5.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 let s:cpo_save = &cpo set cpo&vim if !exists("lua_version") " Default is lua 5.2 let lua_version = 5 let lua_subversion = 2 elseif !exists("lua_subversion") " lua_version exists, but lua_subversion doesn't. So, set it to 0 let lua_subversion = 0 endif syn case match " syncing method syn sync minlines=100 " Comments syn keyword luaTodo contained TODO FIXME XXX syn match luaComment "--.*$" contains=luaTodo,@Spell if lua_version == 5 && lua_subversion == 0 syn region luaComment matchgroup=luaComment start="--\[\[" end="\]\]" contains=luaTodo,luaInnerComment,@Spell syn region luaInnerComment contained transparent start="\[\[" end="\]\]" elseif lua_version > 5 || (lua_version == 5 && lua_subversion >= 1) " Comments in Lua 5.1: --[[ ... ]], [=[ ... ]=], [===[ ... ]===], etc. syn region luaComment matchgroup=luaComment start="--\[\z(=*\)\[" end="\]\z1\]" contains=luaTodo,@Spell 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,luaParenError,luaTodo,luaSpecial,luaIfThen,luaElseifThen,luaElse,luaThenEnd,luaBlock,luaLoopBlock,luaIn,luaStatement syn region luaTableBlock transparent matchgroup=luaTable start="{" end="}" contains=ALLBUT,luaBraceError,luaTodo,luaSpecial,luaIfThen,luaElseifThen,luaElse,luaThenEnd,luaBlock,luaLoopBlock,luaIn,luaStatement syn match luaParenError ")" syn match luaBraceError "}" syn match luaError "\<\%(end\|else\|elseif\|then\|until\|in\)\>" " function ... end syn region luaFunctionBlock transparent matchgroup=luaFunction start="\" end="\" contains=ALLBUT,luaTodo,luaSpecial,luaElseifThen,luaElse,luaThenEnd,luaIn " if ... then syn region luaIfThen transparent matchgroup=luaCond start="\" end="\"me=e-4 contains=ALLBUT,luaTodo,luaSpecial,luaElseifThen,luaElse,luaIn nextgroup=luaThenEnd skipwhite skipempty " then ... end syn region luaThenEnd contained transparent matchgroup=luaCond start="\" end="\" contains=ALLBUT,luaTodo,luaSpecial,luaThenEnd,luaIn " elseif ... then syn region luaElseifThen contained transparent matchgroup=luaCond start="\" end="\" contains=ALLBUT,luaTodo,luaSpecial,luaElseifThen,luaElse,luaThenEnd,luaIn " else syn keyword luaElse contained else " do ... end syn region luaBlock transparent matchgroup=luaStatement start="\" end="\" contains=ALLBUT,luaTodo,luaSpecial,luaElseifThen,luaElse,luaThenEnd,luaIn " repeat ... until syn region luaLoopBlock transparent matchgroup=luaRepeat start="\" end="\" contains=ALLBUT,luaTodo,luaSpecial,luaElseifThen,luaElse,luaThenEnd,luaIn " while ... do syn region luaLoopBlock transparent matchgroup=luaRepeat start="\" end="\"me=e-2 contains=ALLBUT,luaTodo,luaSpecial,luaIfThen,luaElseifThen,luaElse,luaThenEnd,luaIn nextgroup=luaBlock skipwhite skipempty " for ... do and for ... in ... do syn region luaLoopBlock transparent matchgroup=luaRepeat start="\" end="\"me=e-2 contains=ALLBUT,luaTodo,luaSpecial,luaIfThen,luaElseifThen,luaElse,luaThenEnd nextgroup=luaBlock skipwhite skipempty syn keyword luaIn contained in " other keywords syn keyword luaStatement return local break if lua_version > 5 || (lua_version == 5 && lua_subversion >= 2) syn keyword luaStatement goto syn match luaLabel "::\I\i*::" endif syn keyword luaOperator and or not syn keyword luaConstant nil if lua_version > 4 syn keyword luaConstant true false endif " Strings if lua_version < 5 syn match luaSpecial contained "\\[\\abfnrtv\'\"]\|\\[[:digit:]]\{,3}" elseif lua_version == 5 if lua_subversion == 0 syn match luaSpecial contained #\\[\\abfnrtv'"[\]]\|\\[[:digit:]]\{,3}# syn region luaString2 matchgroup=luaString start=+\[\[+ end=+\]\]+ contains=luaString2,@Spell else if lua_subversion == 1 syn match luaSpecial contained #\\[\\abfnrtv'"]\|\\[[:digit:]]\{,3}# else " Lua 5.2 syn match luaSpecial contained #\\[\\abfnrtvz'"]\|\\x[[:xdigit:]]\{2}\|\\[[:digit:]]\{,3}# endif syn region luaString2 matchgroup=luaString start="\[\z(=*\)\[" end="\]\z1\]" contains=@Spell endif endif syn region luaString start=+'+ end=+'+ skip=+\\\\\|\\'+ contains=luaSpecial,@Spell syn region luaString start=+"+ end=+"+ skip=+\\\\\|\\"+ contains=luaSpecial,@Spell " integer number syn match luaNumber "\<\d\+\>" " floating point number, with dot, optional exponent syn match luaNumber "\<\d\+\.\d*\%([eE][-+]\=\d\+\)\=\>" " floating point number, starting with a dot, optional exponent syn match luaNumber "\.\d\+\%([eE][-+]\=\d\+\)\=\>" " floating point number, without dot, with exponent syn match luaNumber "\<\d\+[eE][-+]\=\d\+\>" " hex numbers if lua_version >= 5 if lua_subversion == 1 syn match luaNumber "\<0[xX]\x\+\>" elseif lua_subversion >= 2 syn match luaNumber "\<0[xX][[:xdigit:].]\+\%([pP][-+]\=\d\+\)\=\>" endif endif syn keyword luaFunc assert collectgarbage dofile error next syn keyword luaFunc print rawget rawset tonumber tostring type _VERSION if lua_version == 4 syn keyword luaFunc _ALERT _ERRORMESSAGE gcinfo 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 elseif lua_version == 5 syn keyword luaFunc getmetatable setmetatable syn keyword luaFunc ipairs pairs syn keyword luaFunc pcall xpcall syn keyword luaFunc _G loadfile rawequal require if lua_subversion == 0 syn keyword luaFunc getfenv setfenv syn keyword luaFunc loadstring unpack syn keyword luaFunc gcinfo loadlib LUA_PATH _LOADED _REQUIREDNAME else syn keyword luaFunc load select syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ if lua_subversion == 1 syn keyword luaFunc getfenv setfenv syn keyword luaFunc loadstring module unpack syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ elseif lua_subversion == 2 syn keyword luaFunc _ENV rawlen syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ endif syn match luaFunc /\/ endif syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ if lua_subversion == 0 syn match luaFunc /\/ else syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ endif if lua_subversion == 0 syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ elseif lua_subversion == 1 syn match luaFunc /\/ elseif lua_subversion == 2 syn match luaFunc /\/ syn match luaFunc /\/ endif syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ if lua_subversion == 0 syn match luaFunc /\/ syn match luaFunc /\/ else if lua_subversion == 1 syn match luaFunc /\/ endif syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ endif syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ if lua_subversion == 1 syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ elseif lua_subversion == 2 syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ syn match luaFunc /\/ 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_lua_syntax_inits") if version < 508 let did_lua_syntax_inits = 1 command -nargs=+ HiLink hi link else command -nargs=+ HiLink hi def link endif HiLink luaStatement Statement HiLink luaRepeat Repeat HiLink luaFor Repeat HiLink luaString String HiLink luaString2 String HiLink luaNumber Number HiLink luaOperator Operator HiLink luaIn Operator HiLink luaConstant Constant HiLink luaCond Conditional HiLink luaElse Conditional HiLink luaFunction Function HiLink luaComment Comment HiLink luaTodo Todo HiLink luaTable Structure HiLink luaError Error HiLink luaParenError Error HiLink luaBraceError Error HiLink luaSpecial SpecialChar HiLink luaFunc Identifier HiLink luaLabel Label delcommand HiLink endif let b:current_syntax = "lua" let &cpo = s:cpo_save unlet s:cpo_save " vim: et ts=8 sw=2 vim-7.4.1689/runtime/syntax/lynx.vim000066400000000000000000000146631267703067000173270ustar00rootroot00000000000000" Vim syntax file " Language: Lynx configuration file (lynx.cfg) " Maintainer: Doug Kearns " Last Change: 2013 Jun 20 " Lynx 2.8.7 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn match lynxStart "^" transparent skipwhite nextgroup=lynxOption syn match lynxComment "\(^\|\s\+\)#.*$" contains=lynxTodo syn keyword lynxTodo TODO NOTE FIXME XXX contained syn match lynxDelimiter ":" skipwhite nextgroup=lynxBoolean,lynxNumber,lynxNone,lynxRCOption syn case ignore syn keyword lynxBoolean TRUE FALSE ON OFF contained syn keyword lynxNone NONE contained syn case match syn match lynxNumber "-\=\<\d\+\>" contained "{{{ Options syn case ignore syn keyword lynxOption ACCEPT_ALL_COOKIES ALERTSECS ALWAYS_RESUBMIT_POSTS \ ALWAYS_TRUSTED_EXEC ANONFTP_PASSWORD ASSUMED_COLOR \ ASSUMED_DOC_CHARSET_CHOICE ASSUME_CHARSET ASSUME_LOCAL_CHARSET \ ASSUME_UNREC_CHARSET AUTO_SESSION AUTO_UNCACHE_DIRLISTS BAD_HTML \ BIBP_BIBHOST BIBP_GLOBAL_SERVER BLOCK_MULTI_BOOKMARKS BOLD_H1 \ BOLD_HEADERS BOLD_NAME_ANCHORS BOOKMARK_FILE BROKEN_FTP_EPSV \ BROKEN_FTP_RETR BZIP2_PATH CASE_SENSITIVE_ALWAYS_ON \ CASE_SENSITIVE_SEARCHING CHARACTER_SET CHARSETS_DIRECTORY \ CHARSET_SWITCH_RULES CHECKMAIL CHMOD_PATH COLLAPSE_BR_TAGS COLOR \ COLOR_STYLE COMPRESS_PATH CONNECT_TIMEOUT COOKIE_ACCEPT_DOMAINS \ COOKIE_FILE COOKIE_LOOSE_INVALID_DOMAINS \ COOKIE_QUERY_INVALID_DOMAINS COOKIE_REJECT_DOMAINS COOKIE_SAVE_FILE \ COOKIE_STRICT_INVALID_DOMAINS COPY_PATH CSO_PROXY CSWING_PATH \ DEBUGSECS DEFAULT_BOOKMARK_FILE DEFAULT_CACHE_SIZE DEFAULT_COLORS \ DEFAULT_EDITOR DEFAULT_INDEX_FILE DEFAULT_KEYPAD_MODE \ DEFAULT_KEYPAD_MODE_IS_NUMBERS_AS_ARROWS DEFAULT_USER_MODE \ DEFAULT_VIRTUAL_MEMORY_SIZE DELAYSECS DIRED_MENU DIR_LIST_ORDER \ DIR_LIST_STYLE DISPLAY DISPLAY_CHARSET_CHOICE DOWNLOADER EMACS_KEYS \ EMACS_KEYS_ALWAYS_ON ENABLE_LYNXRC ENABLE_SCROLLBACK EXTERNAL \ FILE_EDITOR FILE_SORTING_METHOD FINGER_PROXY FOCUS_WINDOW \ FORCE_8BIT_TOUPPER FORCE_COOKIE_PROMPT FORCE_EMPTY_HREFLESS_A \ FORCE_SSL_COOKIES_SECURE FORCE_SSL_PROMPT FORMS_OPTIONS FTP_FORMAT \ FTP_PASSIVE FTP_PROXY GLOBAL_EXTENSION_MAP GLOBAL_MAILCAP \ GOPHER_PROXY GOTOBUFFER GZIP_PATH HELPFILE HIDDEN_LINK_MARKER \ HISTORICAL_COMMENTS HTMLSRC_ATTRNAME_XFORM HTMLSRC_TAGNAME_XFORM \ HTTPS_PROXY HTTP_PROXY INCLUDE INFLATE_PATH INFOSECS INSTALL_PATH \ JUMPBUFFER JUMPFILE JUMP_PROMPT JUSTIFY JUSTIFY_MAX_VOID_PERCENT \ KBLAYOUT KEYBOARD_LAYOUT KEYMAP KEYPAD_MODE \ LEFTARROW_IN_TEXTFIELD_PROMPT LINEEDIT_MODE LIST_FORMAT \ LIST_NEWS_DATES LIST_NEWS_NUMBERS LOCALE_CHARSET LOCALHOST_ALIAS \ LOCAL_DOMAIN LOCAL_EXECUTION_LINKS_ALWAYS_ON \ LOCAL_EXECUTION_LINKS_ON_BUT_NOT_REMOTE LYNXCGI_DOCUMENT_ROOT \ LYNXCGI_ENVIRONMENT LYNX_HOST_NAME LYNX_SIG_FILE MAIL_ADRS \ MAIL_SYSTEM_ERROR_LOGGING MAKE_LINKS_FOR_ALL_IMAGES \ MAKE_PSEUDO_ALTS_FOR_INLINES MAX_COOKIES_BUFFER MAX_COOKIES_DOMAIN \ MAX_COOKIES_GLOBAL MESSAGESECS MINIMAL_COMMENTS MKDIR_PATH \ MULTI_BOOKMARK MULTI_BOOKMARK_SUPPORT MV_PATH NCR_IN_BOOKMARKS \ NESTED_TABLES NEWSPOST_PROXY NEWSREPLY_PROXY NEWS_CHUNK_SIZE \ NEWS_MAX_CHUNK NEWS_POSTING NEWS_PROXY NNTPSERVER NNTP_PROXY \ NONRESTARTING_SIGWINCH NO_DOT_FILES NO_FILE_REFERER \ NO_FORCED_CORE_DUMP NO_FROM_HEADER NO_ISMAP_IF_USEMAP NO_MARGINS \ NO_PAUSE NO_PROXY NO_REFERER_HEADER NO_TABLE_CENTER NO_TITLE \ NUMBER_FIELDS_ON_LEFT NUMBER_LINKS_ON_LEFT OUTGOING_MAIL_CHARSET \ PARTIAL PARTIAL_THRES PERSISTENT_COOKIES PERSONAL_EXTENSION_MAP \ PERSONAL_MAILCAP PERSONAL_MAIL_ADDRESS POSITIONABLE_EDITOR \ PREFERRED_CHARSET PREFERRED_ENCODING PREFERRED_LANGUAGE \ PREFERRED_MEDIA_TYPES PREPEND_BASE_TO_SOURCE \ PREPEND_CHARSET_TO_SOURCE PRETTYSRC PRETTYSRC_SPEC \ PRETTYSRC_VIEW_NO_ANCHOR_NUMBERING PRINTER QUIT_DEFAULT_YES RAW_MODE \ READ_TIMEOUT REFERER_WITH_QUERY REPLAYSECS REUSE_TEMPFILES \ RLOGIN_PATH RM_PATH RMDIR_PATH RULE RULESFILE \ RUN_ALL_EXECUTION_LINKS RUN_EXECUTION_LINKS_LOCAL SAVE_SPACE \ SCAN_FOR_BURIED_NEWS_REFS SCREEN_SIZE SCROLLBAR SCROLLBAR_ARROW \ SEEK_FRAG_AREA_IN_CUR SEEK_FRAG_MAP_IN_CUR SELECT_POPUPS \ SEND_USERAGENT SESSION_FILE SESSION_LIMIT SET_COOKIES SETFONT_PATH \ SHOW_COLOR SHOW_CURSOR SHOW_DOTFILES SHOW_KB_NAME SHOW_KB_RATE \ SNEWSPOST_PROXY SNEWSREPLY_PROXY SNEWS_PROXY SOFT_DQUOTES \ SOURCE_CACHE SOURCE_CACHE_FOR_ABORTED SSL_CERT_FILE STARTFILE \ STATUS_BUFFER_SIZE STRIP_DOTDOT_URLS SUBSTITUTE_UNDERSCORES \ SUB_BOOKMARKS SUFFIX SUFFIX_ORDER SYSLOG_REQUESTED_URLS SYSLOG_TEXT \ SYSTEM_EDITOR SYSTEM_MAIL SYSTEM_MAIL_FLAGS TAGSOUP TAR_PATH \ TELNET_PATH TEXTFIELDS_NEED_ACTIVATION TIMEOUT TN3270_PATH \ TOUCH_PATH TRIM_INPUT_FIELDS TRUSTED_EXEC TRUSTED_LYNXCGI \ UNCOMPRESS_PATH UNDERLINE_LINKS UNZIP_PATH UPLOADER \ URL_DOMAIN_PREFIXES URL_DOMAIN_SUFFIXES USERAGENT USER_MODE \ USE_FIXED_RECORDS USE_MOUSE USE_SELECT_POPUPS UUDECODE_PATH \ VERBOSE_IMAGES VIEWER VISITED_LINKS VI_KEYS VI_KEYS_ALWAYS_ON \ WAIS_PROXY XHTML_PARSING XLOADIMAGE_COMMAND ZCAT_PATH ZIP_PATH \ contained nextgroup=lynxDelimiter syn keyword lynxRCOption accept_all_cookies assume_charset auto_session \ bookmark_file case_sensitive_searching character_set \ cookie_accept_domains cookie_file cookie_loose_invalid_domains \ cookie_query_invalid_domains cookie_reject_domains \ cookie_strict_invalid_domains dir_list_style display emacs_keys \ file_editor file_sorting_method force_cookie_prompt force_ssl_prompt \ ftp_passive kblayout keypad_mode lineedit_mode locale_charset \ make_links_for_all_images make_pseudo_alts_for_inlines \ multi_bookmark no_pause personal_mail_address preferred_charset \ preferred_encoding preferred_language preferred_media_types raw_mode \ run_all_execution_links run_execution_links_on_local_files scrollbar \ select_popups send_useragent session_file set_cookies show_color \ show_cursor show_dotfiles show_kb_rate sub_bookmarks tagsoup \ underline_links user_mode useragent verbose_images vi_keys \ visited_links \ contained nextgroup=lynxDelimiter syn case match " }}} " cfg2html.pl formatting directives syn match lynxFormatDir "^\.h\d\s.*$" syn match lynxFormatDir "^\.\(ex\|nf\)\(\s\+\d\+\)\=$" syn match lynxFormatDir "^\.fi$" hi def link lynxBoolean Boolean hi def link lynxComment Comment hi def link lynxDelimiter Special hi def link lynxFormatDir Special hi def link lynxNone Constant hi def link lynxNumber Number hi def link lynxOption Identifier hi def link lynxRCOption lynxOption hi def link lynxTodo Todo let b:current_syntax = "lynx" let &cpo = s:cpo_save unlet s:cpo_save " vim: ts=8 fdm=marker: vim-7.4.1689/runtime/syntax/m4.vim000066400000000000000000000057671267703067000166620ustar00rootroot00000000000000" Vim syntax file " Language: M4 " Maintainer: Claudio Fleiner (claudio@fleiner.com) " URL: http://www.fleiner.com/vim/syntax/m4.vim " Last Change: 2005 Jan 15 " 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 "\<\(m4_\)\=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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/mail.vim000066400000000000000000000136651267703067000172600ustar00rootroot00000000000000" Vim syntax file " Language: Mail file " Previous Maintainer: Felix von Leitner " Maintainer: GI , where a='gi1242+vim', b='gmail', c='com' " Last Change: Wed 14 Aug 2013 08:24:52 AM PDT " Quit when a syntax file was already loaded if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim " 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 " According to RFC 2822 any printable ASCII character can appear in a field " name, except ':'. syn region mailHeader contains=@mailHeaderFields,@NoSpell start="^From .*\d\d\d\d$" skip="^\s" end="\v^[!-9;-~]*([^!-~]|$)"me=s-1 fold syn match mailHeaderKey contained contains=mailEmail,@NoSpell "^From\s.*\d\d\d\d$" " Nothing else depends on case. syn case ignore " Headers in properly quoted (with "> " or ">") emails are matched syn region mailHeader keepend contains=@mailHeaderFields,@mailQuoteExps,@NoSpell start="^\z(\(> \?\)*\)\v(newsgroups|x-([a-z\-])*|path|xref|message-id|from|((in-)?reply-)?to|b?cc|subject|return-path|received|date|replied):" skip="^\z1\s" end="\v^\z1[!-9;-~]*([^!-~]|$)"me=s-1 end="\v^\z1@!"me=s-1 end="\v^\z1(\> ?)+"me=s-1 fold " Usenet headers syn match mailHeaderKey contained contains=mailHeaderEmail,mailEmail,@NoSpell "\v(^(\> ?)*)@<=(Newsgroups|Followup-To|Message-ID|Supersedes|Control):.*$" syn region mailHeaderKey contained contains=mailHeaderEmail,mailEmail,@mailQuoteExps,@NoSpell start="\v(^(\> ?)*)@<=(to|b?cc):" skip=",$" end="$" syn match mailHeaderKey contained contains=mailHeaderEmail,mailEmail,@NoSpell "\v(^(\> ?)*)@<=(from|reply-to):.*$" fold syn match mailHeaderKey contained contains=@NoSpell "\v(^(\> ?)*)@<=date:" syn match mailSubject contained "\v^subject:.*$" fold syn match mailSubject contained contains=@NoSpell "\v(^(\> ?)+)@<=subject:.*$" " Anything in the header between < and > is an email address syn match mailHeaderEmail contained contains=@NoSpell "<.\{-}>" " Mail Signatures. (Begin with "-- ", end with change in quote level) syn region mailSignature keepend contains=@mailLinks,@mailQuoteExps start="^--\s$" end="^$" end="^\(> \?\)\+"me=s-1 fold syn region mailSignature keepend contains=@mailLinks,@mailQuoteExps,@NoSpell start="^\z(\(> \?\)\+\)--\s$" end="^\z1$" end="^\z1\@!"me=s-1 end="^\z1\(> \?\)\+"me=s-1 fold " Treat verbatim Text special. syn region mailVerbatim contains=@NoSpell keepend start="^#v+$" end="^#v-$" fold syn region mailVerbatim contains=@mailQuoteExps,@NoSpell keepend start="^\z(\(> \?\)\+\)#v+$" end="\z1#v-$" fold " URLs start with a known protocol or www,web,w3. syn match mailURL contains=@NoSpell `\v<(((https?|ftp|gopher)://|(mailto|file|news):)[^' <>"]+|(www|web|w3)[a-z0-9_-]*\.[a-z0-9._-]+\.[^' <>"]+)[a-z0-9/]` syn match mailEmail contains=@NoSpell "\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 important here! syn region mailQuoted6 keepend contains=mailVerbatim,mailHeader,@mailLinks,mailSignature,@NoSpell start="^\z(\(\([a-z]\+>\|[]|}>]\)[ \t]*\)\{5}\([a-z]\+>\|[]|}>]\)\)" end="^\z1\@!" fold syn region mailQuoted5 keepend contains=mailQuoted6,mailVerbatim,mailHeader,@mailLinks,mailSignature,@NoSpell start="^\z(\(\([a-z]\+>\|[]|}>]\)[ \t]*\)\{4}\([a-z]\+>\|[]|}>]\)\)" end="^\z1\@!" fold syn region mailQuoted4 keepend contains=mailQuoted5,mailQuoted6,mailVerbatim,mailHeader,@mailLinks,mailSignature,@NoSpell start="^\z(\(\([a-z]\+>\|[]|}>]\)[ \t]*\)\{3}\([a-z]\+>\|[]|}>]\)\)" end="^\z1\@!" fold syn region mailQuoted3 keepend contains=mailQuoted4,mailQuoted5,mailQuoted6,mailVerbatim,mailHeader,@mailLinks,mailSignature,@NoSpell start="^\z(\(\([a-z]\+>\|[]|}>]\)[ \t]*\)\{2}\([a-z]\+>\|[]|}>]\)\)" end="^\z1\@!" fold syn region mailQuoted2 keepend contains=mailQuoted3,mailQuoted4,mailQuoted5,mailQuoted6,mailVerbatim,mailHeader,@mailLinks,mailSignature,@NoSpell start="^\z(\(\([a-z]\+>\|[]|}>]\)[ \t]*\)\{1}\([a-z]\+>\|[]|}>]\)\)" end="^\z1\@!" fold syn region mailQuoted1 keepend contains=mailQuoted2,mailQuoted3,mailQuoted4,mailQuoted5,mailQuoted6,mailVerbatim,mailHeader,@mailLinks,mailSignature,@NoSpell start="^\z([a-z]\+>\|[]|}>]\)" end="^\z1\@!" fold " 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 mailVerbatim Special 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 Title 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" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/mailaliases.vim000066400000000000000000000053031267703067000206100ustar00rootroot00000000000000" Vim syntax file " Language: aliases(5) local alias database file " Maintainer: Nikolai Weibull " Latest Revision: 2008-04-14 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn keyword mailaliasesTodo contained TODO FIXME XXX NOTE syn region mailaliasesComment display oneline start='^\s*#' end='$' \ contains=mailaliasesTodo,@Spell syn match mailaliasesBegin display '^' \ nextgroup=mailaliasesName, \ mailaliasesComment syn match mailaliasesName contained '[[:alnum:]\._-]\+' \ nextgroup=mailaliasesColon syn region mailaliasesName contained oneline start=+"+ \ skip=+\\\\\|\\"+ end=+"+ \ nextgroup=mailaliasesColon syn match mailaliasesColon contained ':' \ nextgroup=@mailaliasesValue \ skipwhite skipnl syn cluster mailaliasesValue contains=mailaliasesValueAddress, \ mailaliasesValueFile, \ mailaliasesValueCommand, \ mailaliasesValueInclude syn match mailaliasesValueAddress contained '[^ \t/|,]\+' \ nextgroup=mailaliasesValueSep \ skipwhite skipnl syn match mailaliasesValueFile contained '/[^,]*' \ nextgroup=mailaliasesValueSep \ skipwhite skipnl syn match mailaliasesValueCommand contained '|[^,]*' \ nextgroup=mailaliasesValueSep \ skipwhite skipnl syn match mailaliasesValueInclude contained ':include:[^,]*' \ nextgroup=mailaliasesValueSep \ skipwhite skipnl syn match mailaliasesValueSep contained ',' \ nextgroup=@mailaliasesValue \ skipwhite skipnl hi def link mailaliasesTodo Todo hi def link mailaliasesComment Comment hi def link mailaliasesName Identifier hi def link mailaliasesColon Delimiter hi def link mailaliasesValueAddress String hi def link mailaliasesValueFile String hi def link mailaliasesValueCommand String hi def link mailaliasesValueInclude PreProc hi def link mailaliasesValueSep Delimiter let b:current_syntax = "mailaliases" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/mailcap.vim000066400000000000000000000021571267703067000177360ustar00rootroot00000000000000" Vim syntax file " Language: Mailcap configuration file " Maintainer: Doug Kearns " Last Change: 2013 Jun 01 if exists("b:current_syntax") finish endif syn match mailcapComment "^#.*" syn region mailcapString start=+"+ end=+"+ contains=mailcapSpecial oneline syn match mailcapDelimiter "\\\@" 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 hi def link mailcapComment Comment hi def link mailcapDelimiter Delimiter hi def link mailcapFlag Statement hi def link mailcapFieldname Statement hi def link mailcapSpecial Identifier hi def link mailcapTypeField Type hi def link mailcapString String let b:current_syntax = "mailcap" " vim: ts=8 vim-7.4.1689/runtime/syntax/make.vim000066400000000000000000000146331267703067000172470ustar00rootroot00000000000000" Vim syntax file " Language: Makefile " Maintainer: Claudio Fleiner " URL: http://www.fleiner.com/vim/syntax/make.vim " Last Change: 2015 Feb 28 " For version 5.x: Clear all syntax items " 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:cpo_save = &cpo set cpo&vim " some special characters syn match makeSpecial "^\s*[@+-]\+" syn match makeNextLine "\\\n\s*" " some directives syn match makePreCondit "^ *\(ifeq\>\|else\>\|endif\>\|ifneq\>\|ifdef\>\|ifndef\>\)" syn match makeInclude "^ *[-s]\=include" syn match makeStatement "^ *vpath" syn match makeExport "^ *\(export\|unexport\)\>" syn match makeOverride "^ *override" hi link makeOverride makeStatement hi link makeExport makeStatement " catch unmatched define/endef keywords. endef only matches it is by itself on a line, possibly followed by a commend 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 "^! *include" syn match makePreCondit "! *\(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 "^ *[^:#= \t]*\s*[:+?!*]="me=e-2 syn match makeIdent "^ *[^:#= \t]*\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-1 nextgroup=makeSource syn match makeImplicit "^\.[A-Za-z0-9_./\t -]\+\s*:[^=]"me=e-2 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,makeComment skipnl nextGroup=makeCommands syn match makeTarget "^[~A-Za-z0-9_./$()%*@-][A-Za-z0-9_./\t $()%*@-]*::\=\s*$" contains=makeIdent,makeSpecTarget,makeComment 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\)\>\s*:\{1,2}[^:=]"rs=e-1 end="[^\\]$" keepend contains=makeIdent,makeSpecTarget,makeNextLine,makeComment 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*::\=\s*$" contains=makeIdent,makeComment 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\|abspath\|addprefix\|addsuffix\|and\|basename\|call\|dir\|error\|eval\|filter-out\|filter\|findstring\|firstword\|flavor\|foreach\|if\|info\|join\|lastword\|notdir\|or\|origin\|patsubst\|realpath\|shell\|sort\|strip\|suffix\|value\|warning\|wildcard\|word\|wordlist\|words\)\>"ms=s+1 " Comment if exists("make_microsoft") syn match makeComment "#.*" contains=@Spell,makeTodo elseif !exists("make_no_comments") syn region makeComment start="#" end="^$" end="[^\\]$" keepend contains=@Spell,makeTodo syn match makeComment "#$" contains=@Spell 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=+\(\\\)\@= 508 || !exists("did_make_syn_inits") if version < 508 let did_make_syn_inits = 1 command -nargs=+ HiLink hi link else command -nargs=+ HiLink hi def link 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" let &cpo = s:cpo_save unlet s:cpo_save " vim: ts=8 vim-7.4.1689/runtime/syntax/mallard.vim000066400000000000000000000032761267703067000177470ustar00rootroot00000000000000" Vim syntax file " Language: Mallard " Maintainer: Jaromir Hradilek " URL: https://github.com/jhradilek/vim-syntax " Last Change: 11 February 2013 " Description: A syntax file for the Mallard markup language according to " Mallard 1.0 DRAFT as of 2013-02-11. if exists("b:current_syntax") finish endif do Syntax xml syn cluster xmlTagHook add=mallardTagName syn spell toplevel syn case match syn keyword mallardTagName app cite cmd code col colgroup comment contained syn keyword mallardTagName credit desc em email example figure contained syn keyword mallardTagName file gui guiseq info input item key contained syn keyword mallardTagName keyseq license link links list listing contained syn keyword mallardTagName media name note output p page quote contained syn keyword mallardTagName revision screen section span steps contained syn keyword mallardTagName subtitle synopsis sys table tbody td contained syn keyword mallardTagName terms tfoot thead title tr tree var contained syn keyword mallardTagName years contained syn region mallardComment start="" end=""me=e-10 contains=xmlTag,xmlNamespace,xmlTagName,xmlEndTag,xmlRegion,xmlEntity,@Spell keepend syn region mallardEmphasis start="" end="
"me=e-5 contains=xmlTag,xmlNamespace,xmlTagName,xmlEndTag,xmlRegion,xmlEntity,@Spell keepend syn region mallardTitle start="" end=""me=e-8 contains=xmlTag,xmlNamespace,xmlTagName,xmlEndTag,xmlRegion,xmlEntity,@Spell keepend hi def link mallardComment Comment hi def link mallardTagName Statement hi def link mallardTitle Title hi def mallardEmphasis term=italic cterm=italic gui=italic let b:current_syntax = "mallard" vim-7.4.1689/runtime/syntax/man.vim000066400000000000000000000037711267703067000171060ustar00rootroot00000000000000" Vim syntax file " Language: Man page " Maintainer: SungHyun Nam " Previous Maintainer: Gautam H. Mudunuri " Version Info: " Last Change: 2015 Nov 24 " Additional highlighting by Johannes Tanzler : " * 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 :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 :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*$"me=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 else command -nargs=+ HiLink hi def link 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: vim-7.4.1689/runtime/syntax/manconf.vim000066400000000000000000000103541267703067000177470ustar00rootroot00000000000000" Vim syntax file " Language: man.conf(5) - man configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2006-04-19 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn keyword manconfTodo contained TODO FIXME XXX NOTE syn region manconfComment display oneline start='^#' end='$' \ contains=manconfTodo,@Spell if !has("win32") && $OSTYPE =~ 'bsd' syn match manconfBegin display '^' \ nextgroup=manconfKeyword,manconfSection, \ manconfComment skipwhite syn keyword manconfKeyword contained _build _crunch \ nextgroup=manconfExtCmd skipwhite syn keyword manconfKeyword contained _suffix \ nextgroup=manconfExt skipwhite syn keyword manconfKeyword contained _crunch syn keyword manconfKeyword contained _subdir _version _whatdb \ nextgroup=manconfPaths skipwhite syn match manconfExtCmd contained display '\.\S\+' \ nextgroup=manconfPaths skipwhite syn match manconfSection contained '[^#_ \t]\S*' \ nextgroup=manconfPaths skipwhite syn keyword manconfSection contained _default \ nextgroup=manconfPaths skipwhite syn match manconfPaths contained display '\S\+' \ nextgroup=manconfPaths skipwhite syn match manconfExt contained display '\.\S\+' hi def link manconfExtCmd Type hi def link manconfSection Identifier hi def link manconfPaths String else syn match manconfBegin display '^' \ nextgroup=manconfBoolean,manconfKeyword, \ manconfDecompress,manconfComment skipwhite syn keyword manconfBoolean contained FSSTND FHS NOAUTOPATH NOCACHE syn keyword manconfKeyword contained MANBIN \ nextgroup=manconfPath skipwhite syn keyword manconfKeyword contained MANPATH MANPATH_MAP \ nextgroup=manconfFirstPath skipwhite syn keyword manconfKeyword contained APROPOS WHATIS TROFF NROFF JNROFF EQN \ NEQN JNEQN TBL COL REFER PIC VGRIND GRAP \ PAGER BROWSER HTMLPAGER CMP CAT COMPRESS \ DECOMPRESS MANDEFOPTIONS \ nextgroup=manconfCommand skipwhite syn keyword manconfKeyword contained COMPRESS_EXT \ nextgroup=manconfExt skipwhite syn keyword manconfKeyword contained MANSECT \ nextgroup=manconfManSect skipwhite syn match manconfPath contained display '\S\+' syn match manconfFirstPath contained display '\S\+' \ nextgroup=manconfSecondPath skipwhite syn match manconfSecondPath contained display '\S\+' syn match manconfCommand contained display '\%(/[^/ \t]\+\)\+' \ nextgroup=manconfCommandOpt skipwhite syn match manconfCommandOpt contained display '\S\+' \ nextgroup=manconfCommandOpt skipwhite syn match manconfExt contained display '\.\S\+' syn match manconfManSect contained '[^:]\+' nextgroup=manconfManSectSep syn match manconfManSectSep contained ':' nextgroup=manconfManSect syn match manconfDecompress contained '\.\S\+' \ nextgroup=manconfCommand skipwhite hi def link manconfBoolean Boolean hi def link manconfPath String hi def link manconfFirstPath manconfPath hi def link manconfSecondPath manconfPath hi def link manconfCommand String hi def link manconfCommandOpt Special hi def link manconfManSect Identifier hi def link manconfManSectSep Delimiter hi def link manconfDecompress Type endif hi def link manconfTodo Todo hi def link manconfComment Comment hi def link manconfKeyword Keyword hi def link manconfExt Type let b:current_syntax = "manconf" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/manual.vim000066400000000000000000000016151267703067000176030ustar00rootroot00000000000000" Vim syntax support file " Maintainer: Bram Moolenaar " Last Change: 2016 Feb 01 " 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 :p:h/synload.vim endif let syntax_manual = 1 " Overrule the connection between FileType and Syntax autocommands. This sets " the syntax when the file type is detected, without changing the value. augroup syntaxset au! FileType * exe "set syntax=" . &syntax augroup END " If the GUI is already running, may still need to install the FileType 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 $VIMRUNTIME/menu.vim endif vim-7.4.1689/runtime/syntax/maple.vim000066400000000000000000000676761267703067000174470ustar00rootroot00000000000000" Vim syntax file " Language: Maple V (based on release 4) " Maintainer: Charles E. Campbell " Last Change: Jan 20, 2016 " Version: 12 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_MAPLE " " Package Function Selection: {{{1 " Because there are a lot of packages, and because of the potential for namespace " clashes, this version of 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 " This syntax file contains all the keywords and top-level packages of Maple 9.5 " but only the contents of packages of Maple V Release 4, and the top-level " routines of Release 4. " For version 5.x: Clear all syntax items " 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 !has("patch-7.4.1141") setl isk=$,48-57,_,a-z,@-Z else syn 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 case match " parenthesis/curly/brace sanity checker 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 syn match mvDcolon "::" " Maple Packages, updated for Maple 9.5 syn keyword mvPackage algcurves ArrayTools Cache codegen syn keyword mvPackage CodeGeneration CodeTools combinat combstruct syn keyword mvPackage ContextMenu CurveFitting DEtools diffalg syn keyword mvPackage difforms DiscreteTransforms Domains ExternalCalling syn keyword mvPackage FileTools finance GaussInt genfunc syn keyword mvPackage geom3d geometry gfun Groebner syn keyword mvPackage group hashmset IntegerRelations inttrans syn keyword mvPackage LargeExpressions LibraryTools liesymm linalg syn keyword mvPackage LinearAlgebra LinearFunctionalSystems LinearOperators syn keyword mvPackage ListTools Logic LREtools Maplets syn keyword mvPackage MathematicalFunctions MathML Matlab syn keyword mvPackage MatrixPolynomialAlgebra MmaTranslator networks syn keyword mvPackage numapprox numtheory Optimization OreTools syn keyword mvPackage Ore_algebra OrthogonalSeries orthopoly padic syn keyword mvPackage PDEtools plots plottools PolynomialIdeals syn keyword mvPackage PolynomialTools powseries process QDifferenceEquations syn keyword mvPackage RandomTools RationalNormalForms RealDomain RootFinding syn keyword mvPackage ScientificConstants ScientificErrorAnalysis simplex syn keyword mvPackage Slode SNAP Sockets SoftwareMetrics syn keyword mvPackage SolveTools Spread stats StringTools syn keyword mvPackage Student student sumtools SumTools syn keyword mvPackage tensor TypeTools Units VariationalCalculus syn keyword mvPackage VectorCalculus Worksheet XMLTools " Language Support: {{{1 syn keyword mvTodo contained COMBAK FIXME TODO XXX if exists("g:mapleversion") && g:mapleversion < 9 syn region mvString start=+`+ skip=+``+ end=+`+ keepend contains=mvTodo,@Spell syn region mvString start=+"+ skip=+""+ end=+"+ keepend contains=@Spell 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 else syn region mvName start=+`+ skip=+``+ end=+`+ keepend contains=mvTodo syn region mvString start=+"+ skip=+""+ end=+"+ keepend contains=@Spell syn region mvDelayEval start=+'+ end=+'+ keepend contains=ALLBUT,mvError,mvBraceError,mvCurlyError,mvParenError syn match mvDelim "[;:]" display syn match mvAssign ":=" endif " 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 xor implies union intersect subset minus mod syn match mvOper "<>\|[<>]=\|[<>]\|=" syn match mvOper "&+\|&-\|&\*\|&\/\|&" syn match mvError "\.\.\." " MapleV Statements: ? statement {{{1 " MapleV Statements: ? statement " Split into booleans, conditionals, operators, repeat-logic, etc syn keyword mvBool true false FAIL syn keyword mvCond elif else fi if then syn match mvCond "end\s\+if" syn keyword mvRepeat by for in to syn keyword mvRepeat do from od while syn match mvRepeat "end\s\+do" syn keyword mvSpecial NULL syn match mvSpecial "\[\]\|{}" if exists("g:mapleversion") && g:mapleversion < 9 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 else syn keyword mvStatement option options read save syn keyword mvStatement break local remember stop syn keyword mvStatement done mod proc restart syn keyword mvStatement end mods quit return syn keyword mvStatement error next try catch syn keyword mvStatement finally assuming global export syn keyword mvStatement module description use endif " Builtin Constants: ? constants {{{1 syn keyword mvConstant Catalan I gamma infinity syn keyword mvConstant 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 else command -nargs=+ HiLink hi def link 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 HiLink mvDelim Delimiter " 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 mvDcolon Delimiter HiLink mvError Error HiLink mvLibrary Statement HiLink mvNumber Number HiLink mvOper Operator HiLink mvAssign Delimiter HiLink mvPackage Type HiLink mvPkgFunc Function HiLink mvPktOption Special HiLink mvRepeat Repeat HiLink mvSpecial Special HiLink mvStatement Statement HiLink mvName String HiLink mvString String HiLink mvTodo Todo delcommand HiLink endif " Current Syntax: {{{1 let b:current_syntax = "maple" " vim: ts=20 fdm=marker vim-7.4.1689/runtime/syntax/markdown.vim000066400000000000000000000161601267703067000201510ustar00rootroot00000000000000" Vim syntax file " Language: Markdown " Maintainer: Tim Pope " Filenames: *.markdown " Last Change: 2013 May 30 if exists("b:current_syntax") finish endif if !exists('main_syntax') let main_syntax = 'markdown' endif runtime! syntax/html.vim unlet! b:current_syntax if !exists('g:markdown_fenced_languages') let g:markdown_fenced_languages = [] endif for s:type in map(copy(g:markdown_fenced_languages),'matchstr(v:val,"[^=]*$")') if s:type =~ '\.' let b:{matchstr(s:type,'[^.]*')}_subtype = matchstr(s:type,'\.\zs.*') endif exe 'syn include @markdownHighlight'.substitute(s:type,'\.','','g').' syntax/'.matchstr(s:type,'[^.]*').'.vim' unlet! b:current_syntax endfor unlet! s:type syn sync minlines=10 syn case ignore syn match markdownValid '[<>]\c[a-z/$!]\@!' syn match markdownValid '&\%(#\=\w*;\)\@!' syn match markdownLineStart "^[<@]\@!" nextgroup=@markdownBlock,htmlSpecialChar syn cluster markdownBlock contains=markdownH1,markdownH2,markdownH3,markdownH4,markdownH5,markdownH6,markdownBlockquote,markdownListMarker,markdownOrderedListMarker,markdownCodeBlock,markdownRule syn cluster markdownInline contains=markdownLineBreak,markdownLinkText,markdownItalic,markdownBold,markdownCode,markdownEscape,@htmlTop,markdownError syn match markdownH1 "^.\+\n=\+$" contained contains=@markdownInline,markdownHeadingRule,markdownAutomaticLink syn match markdownH2 "^.\+\n-\+$" contained contains=@markdownInline,markdownHeadingRule,markdownAutomaticLink syn match markdownHeadingRule "^[=-]\+$" contained syn region markdownH1 matchgroup=markdownHeadingDelimiter start="##\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained syn region markdownH2 matchgroup=markdownHeadingDelimiter start="###\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained syn region markdownH3 matchgroup=markdownHeadingDelimiter start="####\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained syn region markdownH4 matchgroup=markdownHeadingDelimiter start="#####\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained syn region markdownH5 matchgroup=markdownHeadingDelimiter start="######\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained syn region markdownH6 matchgroup=markdownHeadingDelimiter start="#######\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained syn match markdownBlockquote ">\%(\s\|$\)" contained nextgroup=@markdownBlock syn region markdownCodeBlock start=" \|\t" end="$" contained " TODO: real nesting syn match markdownListMarker "\%(\t\| \{0,4\}\)[-*+]\%(\s\+\S\)\@=" contained syn match markdownOrderedListMarker "\%(\t\| \{0,4}\)\<\d\+\.\%(\s\+\S\)\@=" contained syn match markdownRule "\* *\* *\*[ *]*$" contained syn match markdownRule "- *- *-[ -]*$" contained syn match markdownLineBreak " \{2,\}$" syn region markdownIdDeclaration matchgroup=markdownLinkDelimiter start="^ \{0,3\}!\=\[" end="\]:" oneline keepend nextgroup=markdownUrl skipwhite syn match markdownUrl "\S\+" nextgroup=markdownUrlTitle skipwhite contained syn region markdownUrl matchgroup=markdownUrlDelimiter start="<" end=">" oneline keepend nextgroup=markdownUrlTitle skipwhite contained syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+"+ end=+"+ keepend contained syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+'+ end=+'+ keepend contained syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+(+ end=+)+ keepend contained syn region markdownLinkText matchgroup=markdownLinkTextDelimiter start="!\=\[\%(\_[^]]*]\%( \=[[(]\)\)\@=" end="\]\%( \=[[(]\)\@=" keepend nextgroup=markdownLink,markdownId skipwhite contains=@markdownInline,markdownLineStart syn region markdownLink matchgroup=markdownLinkDelimiter start="(" end=")" contains=markdownUrl keepend contained syn region markdownId matchgroup=markdownIdDelimiter start="\[" end="\]" keepend contained syn region markdownAutomaticLink matchgroup=markdownUrlDelimiter start="<\%(\w\+:\|[[:alnum:]_+-]\+@\)\@=" end=">" keepend oneline syn region markdownItalic start="\S\@<=\*\|\*\S\@=" end="\S\@<=\*\|\*\S\@=" keepend contains=markdownLineStart syn region markdownItalic start="\S\@<=_\|_\S\@=" end="\S\@<=_\|_\S\@=" keepend contains=markdownLineStart syn region markdownBold start="\S\@<=\*\*\|\*\*\S\@=" end="\S\@<=\*\*\|\*\*\S\@=" keepend contains=markdownLineStart,markdownItalic syn region markdownBold start="\S\@<=__\|__\S\@=" end="\S\@<=__\|__\S\@=" keepend contains=markdownLineStart,markdownItalic syn region markdownBoldItalic start="\S\@<=\*\*\*\|\*\*\*\S\@=" end="\S\@<=\*\*\*\|\*\*\*\S\@=" keepend contains=markdownLineStart syn region markdownBoldItalic start="\S\@<=___\|___\S\@=" end="\S\@<=___\|___\S\@=" keepend contains=markdownLineStart syn region markdownCode matchgroup=markdownCodeDelimiter start="`" end="`" keepend contains=markdownLineStart syn region markdownCode matchgroup=markdownCodeDelimiter start="`` \=" end=" \=``" keepend contains=markdownLineStart syn region markdownCode matchgroup=markdownCodeDelimiter start="^\s*```.*$" end="^\s*```\ze\s*$" keepend if main_syntax ==# 'markdown' for s:type in g:markdown_fenced_languages exe 'syn region markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' matchgroup=markdownCodeDelimiter start="^\s*```'.matchstr(s:type,'[^=]*').'\>.*$" end="^\s*```\ze\s*$" keepend contains=@markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\.','','g') endfor unlet! s:type endif syn match markdownEscape "\\[][\\`*_{}()#+.!-]" syn match markdownError "\w\@<=_\w\@=" hi def link markdownH1 htmlH1 hi def link markdownH2 htmlH2 hi def link markdownH3 htmlH3 hi def link markdownH4 htmlH4 hi def link markdownH5 htmlH5 hi def link markdownH6 htmlH6 hi def link markdownHeadingRule markdownRule hi def link markdownHeadingDelimiter Delimiter hi def link markdownOrderedListMarker markdownListMarker hi def link markdownListMarker htmlTagName hi def link markdownBlockquote Comment hi def link markdownRule PreProc hi def link markdownLinkText htmlLink hi def link markdownIdDeclaration Typedef hi def link markdownId Type hi def link markdownAutomaticLink markdownUrl hi def link markdownUrl Float hi def link markdownUrlTitle String hi def link markdownIdDelimiter markdownLinkDelimiter hi def link markdownUrlDelimiter htmlTag hi def link markdownUrlTitleDelimiter Delimiter hi def link markdownItalic htmlItalic hi def link markdownBold htmlBold hi def link markdownBoldItalic htmlBoldItalic hi def link markdownCodeDelimiter Delimiter hi def link markdownEscape Special hi def link markdownError Error let b:current_syntax = "markdown" if main_syntax ==# 'markdown' unlet main_syntax endif " vim:set sw=2: vim-7.4.1689/runtime/syntax/masm.vim000066400000000000000000000415111267703067000172620ustar00rootroot00000000000000" Vim syntax file " Language: Microsoft Macro Assembler (80x86) " Orig Author: Rob Brady " Maintainer: Wu Yongwei " Last Change: $Date: 2013/11/13 11:49:24 $ " $Revision: 1.48 $ " Quit when a syntax file was already loaded if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn case ignore syn match masmIdentifier "[@a-z_$?][@a-z0-9_$?]*" syn match masmLabel "^\s*[@a-z_$?][@a-z0-9_$?]*:"he=e-1 syn match masmDecimal "[-+]\?\d\+[dt]\?" syn match masmBinary "[-+]\?[0-1]\+[by]" "put this before hex or 0bfh dies! syn match masmOctal "[-+]\?[0-7]\+[oq]" syn match masmHexadecimal "[-+]\?[0-9]\x*h" syn match masmFloatRaw "[-+]\?[0-9]\x*r" syn match masmFloat "[-+]\?\d\+\.\(\d*\(E[-+]\?\d\+\)\?\)\?" syn match masmComment ";.*" contains=@Spell syn region masmComment start=+COMMENT\s*\z(\S\)+ end=+\z1.*+ contains=@Spell syn region masmString start=+'+ end=+'+ oneline contains=@Spell syn region masmString start=+"+ end=+"+ oneline contains=@Spell syn region masmTitleArea start=+\" syn match masmOperator "CARRY?" syn match masmOperator "OVERFLOW?" syn match masmOperator "PARITY?" syn match masmOperator "SIGN?" syn match masmOperator "ZERO?" syn keyword masmDirective ALIAS ASSUME CATSTR COMM DB DD DF DOSSEG DQ DT syn keyword masmDirective DW ECHO ELSE ELSEIF ELSEIF1 ELSEIF2 ELSEIFB syn keyword masmDirective ELSEIFDEF ELSEIFDIF ELSEIFDIFI ELSEIFE syn keyword masmDirective ELSEIFIDN ELSEIFIDNI ELSEIFNB ELSEIFNDEF END syn keyword masmDirective ENDIF ENDM ENDP ENDS EQU EVEN EXITM EXTERN syn keyword masmDirective EXTERNDEF EXTRN FOR FORC GOTO GROUP IF IF1 IF2 syn keyword masmDirective IFB IFDEF IFDIF IFDIFI IFE IFIDN IFIDNI IFNB syn keyword masmDirective IFNDEF INCLUDE INCLUDELIB INSTR INVOKE IRP syn keyword masmDirective IRPC LABEL LOCAL MACRO NAME OPTION ORG PAGE syn keyword masmDirective POPCONTEXT PROC PROTO PUBLIC PURGE PUSHCONTEXT syn keyword masmDirective RECORD REPEAT REPT SEGMENT SIZESTR STRUC syn keyword masmDirective STRUCT SUBSTR SUBTITLE SUBTTL TEXTEQU TITLE syn keyword masmDirective TYPEDEF UNION WHILE syn match masmDirective "\.8086\>" syn match masmDirective "\.8087\>" syn match masmDirective "\.NO87\>" 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 "\.486P\>" syn match masmDirective "\.586\>" syn match masmDirective "\.586P\>" syn match masmDirective "\.686\>" syn match masmDirective "\.686P\>" syn match masmDirective "\.K3D\>" syn match masmDirective "\.MMX\>" syn match masmDirective "\.XMM\>" syn match masmDirective "\.ALPHA\>" syn match masmDirective "\.DOSSEG\>" syn match masmDirective "\.SEQ\>" syn match masmDirective "\.CODE\>" syn match masmDirective "\.CONST\>" syn match masmDirective "\.DATA\>" syn match masmDirective "\.DATA?" syn match masmDirective "\.EXIT\>" syn match masmDirective "\.FARDATA\>" syn match masmDirective "\.FARDATA?" syn match masmDirective "\.MODEL\>" syn match masmDirective "\.STACK\>" syn match masmDirective "\.STARTUP\>" syn match masmDirective "\.IF\>" syn match masmDirective "\.ELSE\>" syn match masmDirective "\.ELSEIF\>" syn match masmDirective "\.ENDIF\>" syn match masmDirective "\.REPEAT\>" syn match masmDirective "\.UNTIL\>" syn match masmDirective "\.UNTILCXZ\>" syn match masmDirective "\.WHILE\>" syn match masmDirective "\.ENDW\>" syn match masmDirective "\.BREAK\>" syn match masmDirective "\.CONTINUE\>" syn match masmDirective "\.ERR\>" syn match masmDirective "\.ERR1\>" syn match masmDirective "\.ERR2\>" syn match masmDirective "\.ERRB\>" syn match masmDirective "\.ERRDEF\>" syn match masmDirective "\.ERRDIF\>" syn match masmDirective "\.ERRDIFI\>" syn match masmDirective "\.ERRE\>" syn match masmDirective "\.ERRIDN\>" syn match masmDirective "\.ERRIDNI\>" syn match masmDirective "\.ERRNB\>" syn match masmDirective "\.ERRNDEF\>" syn match masmDirective "\.ERRNZ\>" syn match masmDirective "\.LALL\>" syn match masmDirective "\.SALL\>" syn match masmDirective "\.XALL\>" syn match masmDirective "\.LFCOND\>" syn match masmDirective "\.SFCOND\>" syn match masmDirective "\.TFCOND\>" syn match masmDirective "\.CREF\>" syn match masmDirective "\.NOCREF\>" syn match masmDirective "\.XCREF\>" syn match masmDirective "\.LIST\>" syn match masmDirective "\.NOLIST\>" syn match masmDirective "\.XLIST\>" syn match masmDirective "\.LISTALL\>" syn match masmDirective "\.LISTIF\>" syn match masmDirective "\.NOLISTIF\>" syn match masmDirective "\.LISTMACRO\>" syn match masmDirective "\.NOLISTMACRO\>" syn match masmDirective "\.LISTMACROALL\>" syn match masmDirective "\.FPO\>" syn match masmDirective "\.RADIX\>" syn match masmDirective "\.SAFESEH\>" syn match masmDirective "%OUT\>" syn match masmDirective "ALIGN\>" syn match masmOption "ALIGN([0-9]\+)" syn keyword masmRegister AX BX CX DX SI DI BP SP syn keyword masmRegister CS DS SS ES FS GS syn keyword masmRegister AH BH CH DH AL BL CL DL syn keyword masmRegister EAX EBX ECX EDX ESI EDI EBP ESP syn keyword masmRegister CR0 CR2 CR3 CR4 syn keyword masmRegister DR0 DR1 DR2 DR3 DR6 DR7 syn keyword masmRegister TR3 TR4 TR5 TR6 TR7 syn match masmRegister "ST([0-7])" " x86-64 registers syn keyword masmRegister RAX RBX RCX RDX RSI RDI RBP RSP syn keyword masmRegister R8 R9 R10 R11 R12 R13 R14 R15 syn keyword masmRegister R8D R9D R10D R11D R12D R13D R14D R15D syn keyword masmRegister R8W R9W R10W R11W R12W R13W R14W R15W syn keyword masmRegister R8B R9B R10B R11B R12B R13B R14B R15B " SSE/AVX registers syn match masmRegister "\(X\|Y\)MM[0-9]\>" syn match masmRegister "\(X\|Y\)MM1[0-5]\>" " Instruction prefixes syn keyword masmOpcode LOCK REP REPE REPNE REPNZ REPZ " 8086/8088 opcodes syn keyword masmOpcode AAA AAD AAM AAS ADC ADD AND CALL CBW CLC CLD syn keyword masmOpcode CLI CMC CMP CMPS CMPSB CMPSW CWD DAA DAS DEC syn keyword masmOpcode DIV ESC HLT IDIV IMUL IN INC INT INTO IRET syn keyword masmOpcode JCXZ JMP LAHF LDS LEA LES LODS LODSB LODSW syn keyword masmOpcode LOOP LOOPE LOOPEW LOOPNE LOOPNEW LOOPNZ syn keyword masmOpcode LOOPNZW LOOPW LOOPZ LOOPZW MOV MOVS MOVSB syn keyword masmOpcode MOVSW MUL NEG NOP NOT OR OUT POP POPF PUSH syn keyword masmOpcode PUSHF RCL RCR RET RETF RETN ROL ROR SAHF SAL syn keyword masmOpcode SAR SBB SCAS SCASB SCASW SHL SHR STC STD STI syn keyword masmOpcode STOS STOSB STOSW SUB TEST WAIT XCHG XLAT XLATB syn keyword masmOpcode XOR syn match masmOpcode "J\(P[EO]\|\(N\?\([ABGL]E\?\|[CEOPSZ]\)\)\)\>" " 80186 opcodes syn keyword masmOpcode BOUND ENTER INS INSB INSW LEAVE OUTS OUTSB syn keyword masmOpcode OUTSW POPA PUSHA PUSHW " 80286 opcodes syn keyword masmOpcode ARPL LAR LSL SGDT SIDT SLDT SMSW STR VERR VERW " 80286/80386 privileged opcodes syn keyword masmOpcode CLTS LGDT LIDT LLDT LMSW LTR " 80386 opcodes syn keyword masmOpcode BSF BSR BT BTC BTR BTS CDQ CMPSD CWDE INSD syn keyword masmOpcode IRETD IRETDF IRETF JECXZ LFS LGS LODSD LOOPD syn keyword masmOpcode LOOPED LOOPNED LOOPNZD LOOPZD LSS MOVSD MOVSX syn keyword masmOpcode MOVZX OUTSD POPAD POPFD PUSHAD PUSHD PUSHFD syn keyword masmOpcode SCASD SHLD SHRD STOSD syn match masmOpcode "SET\(P[EO]\|\(N\?\([ABGL]E\?\|[CEOPSZ]\)\)\)\>" " 80486 opcodes syn keyword masmOpcode BSWAP CMPXCHG INVD INVLPG WBINVD XADD " Floating-point opcodes 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 FNSAVE syn keyword masmOpFloat FSCALE FSETPM FSIN FSINCOS FSQRT FST FSTCW syn keyword masmOpFloat FNSTCW FSTENV FNSTENV FSTP FSTSW FNSTSW FSUB syn keyword masmOpFloat FSUBP FSUBR FSUBRP FTST FUCOM FUCOMP FUCOMPP syn keyword masmOpFloat FWAIT FXAM FXCH FXTRACT FYL2X FYL2XP1 " Floating-point opcodes in Pentium and later processors syn keyword masmOpFloat FCMOVE FCMOVNE FCMOVB FCMOVBE FCMOVNB FCMOVNBE syn keyword masmOpFloat FCMOVU FCMOVNU FCOMI FUCOMI FCOMIP FUCOMIP syn keyword masmOpFloat FXSAVE FXRSTOR " MMX opcodes (Pentium w/ MMX, Pentium II, and later) syn keyword masmOpcode MOVD MOVQ PACKSSWB PACKSSDW PACKUSWB syn keyword masmOpcode PUNPCKHBW PUNPCKHWD PUNPCKHDQ syn keyword masmOpcode PUNPCKLBW PUNPCKLWD PUNPCKLDQ syn keyword masmOpcode PADDB PADDW PADDD PADDSB PADDSW PADDUSB PADDUSW syn keyword masmOpcode PSUBB PSUBW PSUBD PSUBSB PSUBSW PSUBUSB PSUBUSW syn keyword masmOpcode PMULHW PMULLW PMADDWD syn keyword masmOpcode PCMPEQB PCMPEQW PCMPEQD PCMPGTB PCMPGTW PCMPGTD syn keyword masmOpcode PAND PANDN POR PXOR syn keyword masmOpcode PSLLW PSLLD PSLLQ PSRLW PSRLD PSRLQ PSRAW PSRAD syn keyword masmOpcode EMMS " SSE opcodes (Pentium III and later) syn keyword masmOpcode MOVAPS MOVUPS MOVHPS MOVHLPS MOVLPS MOVLHPS syn keyword masmOpcode MOVMSKPS MOVSS syn keyword masmOpcode ADDPS ADDSS SUBPS SUBSS MULPS MULSS DIVPS DIVSS syn keyword masmOpcode RCPPS RCPSS SQRTPS SQRTSS RSQRTPS RSQRTSS syn keyword masmOpcode MAXPS MAXSS MINPS MINSS syn keyword masmOpcode CMPPS CMPSS COMISS UCOMISS syn keyword masmOpcode ANDPS ANDNPS ORPS XORPS syn keyword masmOpcode SHUFPS UNPCKHPS UNPCKLPS syn keyword masmOpcode CVTPI2PS CVTSI2SS CVTPS2PI CVTTPS2PI syn keyword masmOpcode CVTSS2SI CVTTSS2SI syn keyword masmOpcode LDMXCSR STMXCSR syn keyword masmOpcode PAVGB PAVGW PEXTRW PINSRW PMAXUB PMAXSW syn keyword masmOpcode PMINUB PMINSW PMOVMSKB PMULHUW PSADBW PSHUFW syn keyword masmOpcode MASKMOVQ MOVNTQ MOVNTPS SFENCE syn keyword masmOpcode PREFETCHT0 PREFETCHT1 PREFETCHT2 PREFETCHNTA " SSE2 opcodes (Pentium 4 and later) syn keyword masmOpcode MOVAPD MOVUPD MOVHPD MOVLPD MOVMSKPD MOVSD syn keyword masmOpcode ADDPD ADDSD SUBPD SUBSD MULPD MULSD DIVPD DIVSD syn keyword masmOpcode SQRTPD SQRTSD MAXPD MAXSD MINPD MINSD syn keyword masmOpcode ANDPD ANDNPD ORPD XORPD syn keyword masmOpcode CMPPD CMPSD COMISD UCOMISD syn keyword masmOpcode SHUFPD UNPCKHPD UNPCKLPD syn keyword masmOpcode CVTPD2PI CVTTPD2PI CVTPI2PD CVTPD2DQ syn keyword masmOpcode CVTTPD2DQ CVTDQ2PD CVTPS2PD CVTPD2PS syn keyword masmOpcode CVTSS2SD CVTSD2SS CVTSD2SI CVTTSD2SI CVTSI2SD syn keyword masmOpcode CVTDQ2PS CVTPS2DQ CVTTPS2DQ syn keyword masmOpcode MOVDQA MOVDQU MOVQ2DQ MOVDQ2Q PMULUDQ syn keyword masmOpcode PADDQ PSUBQ PSHUFLW PSHUFHW PSHUFD syn keyword masmOpcode PSLLDQ PSRLDQ PUNPCKHQDQ PUNPCKLQDQ syn keyword masmOpcode CLFLUSH LFENCE MFENCE PAUSE MASKMOVDQU syn keyword masmOpcode MOVNTPD MOVNTDQ MOVNTI " SSE3 opcodes (Pentium 4 w/ Hyper-Threading and later) syn keyword masmOpcode FISTTP LDDQU ADDSUBPS ADDSUBPD syn keyword masmOpcode HADDPS HSUBPS HADDPD HSUBPD syn keyword masmOpcode MOVSHDUP MOVSLDUP MOVDDUP MONITOR MWAIT " SSSE3 opcodes (Core and later) syn keyword masmOpcode PSIGNB PSIGNW PSIGND PABSB PABSW PABSD syn keyword masmOpcode PALIGNR PSHUFB PMULHRSW PMADDUBSW syn keyword masmOpcode PHSUBW PHSUBD PHSUBSW PHADDW PHADDD PHADDSW " SSE 4.1 opcodes (Penryn and later) syn keyword masmOpcode MPSADBW PHMINPOSUW PMULDQ PMULLD DPPS DPPD syn keyword masmOpcode BLENDPS BLENDPD BLENDVPS BLENDVPD syn keyword masmOpcode PBLENDVB PBLENDW syn keyword masmOpcode PMINSB PMAXSB PMINSD PMAXSD syn keyword masmOpcode PMINUW PMAXUW PMINUD PMAXUD syn keyword masmOpcode ROUNDPS ROUNDSS ROUNDPD ROUNDSD syn keyword masmOpcode INSERTPS PINSRB PINSRD PINSRQ syn keyword masmOpcode EXTRACTPS PEXTRB PEXTRD PEXTRQ syn keyword masmOpcode PMOVSXBW PMOVZXBW PMOVSXBD PMOVZXBD syn keyword masmOpcode PMOVSXBQ PMOVZXBQ PMOVSXWD PMOVZXWD syn keyword masmOpcode PMOVSXWQ PMOVZXWQ PMOVSXDQ PMOVZXDQ syn keyword masmOpcode PTEST PCMPEQQ PACKUSDW MOVNTDQA " SSE 4.2 opcodes (Nehalem and later) syn keyword masmOpcode PCMPESTRI PCMPESTRM PCMPISTRI PCMPISTRM PCMPGTQ syn keyword masmOpcode CRC32 POPCNT LZCNT " AES-NI (Westmere (2010) and later) syn keyword masmOpcode AESENC AESENCLAST AESDEC AESDECLAST syn keyword masmOpcode AESKEYGENASSIST AESIMC PCLMULQDQ " AVX (Sandy Bridge (2011) and later) syn keyword masmOpcode VBROADCASTSS VBROADCASTSD VBROADCASTF128 syn keyword masmOpcode VINSERTF128 VEXTRACTF128 VMASKMOVPS VMASKMOVPD syn keyword masmOpcode VPERMILPS VPERMILPD VPERM2F128 syn keyword masmOpcode VZEROALL VZEROUPPER " Other opcodes in Pentium and later processors syn keyword masmOpcode CMPXCHG8B CPUID UD2 syn keyword masmOpcode RSM RDMSR WRMSR RDPMC RDTSC SYSENTER SYSEXIT syn match masmOpcode "CMOV\(P[EO]\|\(N\?\([ABGL]E\?\|[CEOPSZ]\)\)\)\>" " The default highlighting hi def link masmLabel PreProc hi def link masmComment Comment hi def link masmDirective Statement hi def link masmType Type hi def link masmOperator Type hi def link masmOption Special hi def link masmRegister Special hi def link masmString String hi def link masmText String hi def link masmTitle Title hi def link masmOpcode Statement hi def link masmOpFloat Statement hi def link masmHexadecimal Number hi def link masmDecimal Number hi def link masmOctal Number hi def link masmBinary Number hi def link masmFloatRaw Number hi def link masmFloat Number hi def link masmIdentifier Identifier syntax sync minlines=50 let b:current_syntax = "masm" let &cpo = s:cpo_save unlet s:cpo_save " vim: ts=8 vim-7.4.1689/runtime/syntax/mason.vim000066400000000000000000000066161267703067000174510ustar00rootroot00000000000000" Vim syntax file " Language: Mason (Perl embedded in HTML) " Maintainer: Andrew Smith " 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 :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 :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="" contains=@perlTop syn region masonComp keepend matchgroup=Delimiter start="<&" end="&>" contains=@perlTop syn region masonArgs matchgroup=Delimiter start="<%args>" end="" contains=@perlTop syn region masonInit matchgroup=Delimiter start="<%init>" end="" contains=@perlTop syn region masonCleanup matchgroup=Delimiter start="<%cleanup>" end="" contains=@perlTop syn region masonOnce matchgroup=Delimiter start="<%once>" end="" contains=@perlTop syn region masonShared matchgroup=Delimiter start="<%shared>" end="" contains=@perlTop syn region masonDef matchgroup=Delimiter start="<%def[^>]*>" end="" contains=@htmlTop syn region masonMethod matchgroup=Delimiter start="<%method[^>]*>" end="" contains=@htmlTop syn region masonFlags matchgroup=Delimiter start="<%flags>" end="" contains=@perlTop syn region masonAttr matchgroup=Delimiter start="<%attr>" end="" contains=@perlTop syn region masonFilter matchgroup=Delimiter start="<%filter>" end="" contains=@perlTop syn region masonDoc matchgroup=Delimiter start="<%doc>" end="" syn region masonText matchgroup=Delimiter start="<%text>" end="" 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 else com -nargs=+ HiLink hi def link endif HiLink masonDoc Comment delc HiLink endif let b:current_syntax = "mason" if main_syntax == 'mason' unlet main_syntax endif vim-7.4.1689/runtime/syntax/master.vim000066400000000000000000000026331267703067000176220ustar00rootroot00000000000000" Vim syntax file " Language: Focus Master File " Maintainer: Rob Brady " Last Change: $Date: 2004/06/13 15:54:03 $ " URL: http://www.datatone.com/~robb/vim/syntax/master.vim " $Revision: 1.1 $ " 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 else command -nargs=+ HiLink hi def link endif HiLink masterKeyword Keyword HiLink masterComment Comment HiLink masterString String delcommand HiLink endif let b:current_syntax = "master" " vim: ts=8 vim-7.4.1689/runtime/syntax/matlab.vim000066400000000000000000000103511267703067000175630ustar00rootroot00000000000000" Vim syntax file " Language: Matlab " Maintainer: Maurizio Tranchero - maurizio(.)tranchero(@)gmail(.)com " Credits: Preben 'Peppe' Guldberg " Original author: Mario Eusebio " Last Change: Wed Jan 13 11:12:34 CET 2010 " sinh added to matlab implicit commands " Change History: " - 'global' and 'persistent' keyword are now recognized " For version 5.x: Clear all syntax items " 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 " MT_ADDON - added exception-specific keywords syn keyword matlabExceptions try catch syn keyword matlabOO classdef properties events methods syn keyword matlabTodo contained TODO syn keyword matlabScope global persistent " 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 " MT_ADDON - added 'skip' in order to deal with 'tic' escaping sequence syn region matlabString start=+'+ end=+'+ oneline skip=+''+ " 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 " MT_ADDON - correctly highlights words after '...' as comments syn match matlabComment "\.\.\..*$" contains=matlabTodo,matlabTab syn region matlabMultilineComment start=+%{+ end=+%}+ 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 sinh 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 else command -nargs=+ HiLink hi def link endif HiLink matlabTransposeOperator matlabOperator HiLink matlabOperator Operator HiLink matlabLineContinuation Special HiLink matlabLabel Label HiLink matlabConditional Conditional HiLink matlabExceptions 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 matlabOO Statement HiLink matlabSemicolon SpecialChar HiLink matlabComment Comment HiLink matlabMultilineComment Comment HiLink matlabScope Type 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 vim-7.4.1689/runtime/syntax/maxima.vim000066400000000000000000000453331267703067000176070ustar00rootroot00000000000000" Vim syntax file " Language: Maxima (symbolic algebra program) " Maintainer: Robert Dodier (robert.dodier@gmail.com) " Last Change: April 6, 2006 " Version: 1 " Adapted mostly from xmath.vim " Number formats adapted from 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 syn sync lines=1000 " parenthesis sanity checker syn region maximaZone matchgroup=Delimiter start="(" matchgroup=Delimiter end=")" transparent contains=ALLBUT,maximaError,maximaBraceError,maximaCurlyError syn region maximaZone matchgroup=Delimiter start="{" matchgroup=Delimiter end="}" transparent contains=ALLBUT,maximaError,maximaBraceError,maximaParenError syn region maximaZone matchgroup=Delimiter start="\[" matchgroup=Delimiter end="]" transparent contains=ALLBUT,maximaError,maximaCurlyError,maximaParenError syn match maximaError "[)\]}]" syn match maximaBraceError "[)}]" contained syn match maximaCurlyError "[)\]]" contained syn match maximaParenError "[\]}]" contained syn match maximaComma "[\[\](),;]" syn match maximaComma "\.\.\.$" " A bunch of useful maxima keywords syn keyword maximaConditional if then else elseif and or not syn keyword maximaRepeat do for thru " ---------------------- BEGIN LIST OF ALL FUNCTIONS (EXCEPT KEYWORDS) ---------------------- syn keyword maximaFunc abasep abs absboxchar absint acos acosh acot acoth acsc syn keyword maximaFunc acsch activate activecontexts addcol additive addrow adim syn keyword maximaFunc adjoint af aform airy algebraic algepsilon algexact algsys syn keyword maximaFunc alg_type alias aliases allbut all_dotsimp_denoms allroots allsym syn keyword maximaFunc alphabetic antid antidiff antisymmetric append appendfile syn keyword maximaFunc apply apply1 apply2 applyb1 apropos args array arrayapply syn keyword maximaFunc arrayinfo arraymake arrays asec asech asin asinh askexp syn keyword maximaFunc askinteger asksign assoc assoc_legendre_p assoc_legendre_q assume syn keyword maximaFunc assume_pos assume_pos_pred assumescalar asymbol asympa at atan syn keyword maximaFunc atan2 atanh atensimp atom atomgrad atrig1 atvalue augcoefmatrix syn keyword maximaFunc av backsubst backtrace bashindices batch batchload bc2 bdvac syn keyword maximaFunc berlefact bern bernpoly bessel besselexpand bessel_i bessel_j syn keyword maximaFunc bessel_k bessel_y beta bezout bffac bfhzeta bfloat bfloatp syn keyword maximaFunc bfpsi bfpsi0 bftorat bftrunc bfzeta bimetric binomial block syn keyword maximaFunc bothcoef box boxchar break breakup bug_report build_info buildq syn keyword maximaFunc burn cabs canform canten carg cartan catch cauchysum cbffac syn keyword maximaFunc cdisplay cf cfdisrep cfexpand cflength cframe_flag cgeodesic syn keyword maximaFunc changename changevar charpoly checkdiv check_overlaps christof syn keyword maximaFunc clear_rules closefile closeps cmetric cnonmet_flag coeff syn keyword maximaFunc coefmatrix cograd col collapse columnvector combine commutative syn keyword maximaFunc comp2pui compfile compile compile_file components concan concat syn keyword maximaFunc conj conjugate conmetderiv cons constant constantp cont2part syn keyword maximaFunc content context contexts contortion contract contragrad coord syn keyword maximaFunc copylist copymatrix cos cosh cosnpiflag cot coth covdiff syn keyword maximaFunc covect create_list csc csch csetup ctaylor ctaypov ctaypt syn keyword maximaFunc ctayswitch ctayvar ct_coords ct_coordsys ctorsion_flag ctransform syn keyword maximaFunc ctrgsimp current_let_rule_package dblint deactivate debugmode syn keyword maximaFunc declare declare_translated declare_weight decsym syn keyword maximaFunc default_let_rule_package defcon define define_variable defint syn keyword maximaFunc defmatch defrule deftaylor del delete deleten delta demo syn keyword maximaFunc demoivre denom dependencies depends derivabbrev derivdegree syn keyword maximaFunc derivlist derivsubst describe desolve determinant detout syn keyword maximaFunc diagmatrix diagmatrixp diagmetric diff dim dimension direct syn keyword maximaFunc disolate disp dispcon dispflag dispform dispfun display syn keyword maximaFunc display2d display_format_internal disprule dispterms distrib syn keyword maximaFunc divide divsum doallmxops domain domxexpt domxmxops domxnctimes syn keyword maximaFunc dontfactor doscmxops doscmxplus dot0nscsimp dot0simp dot1simp syn keyword maximaFunc dotassoc dotconstrules dotdistrib dotexptsimp dotident dotscrules syn keyword maximaFunc dotsimp dpart dscalar %e echelon %edispflag eigenvalues syn keyword maximaFunc eigenvectors eighth einstein eivals eivects ele2comp syn keyword maximaFunc ele2polynome ele2pui elem eliminate elliptic_e elliptic_ec syn keyword maximaFunc elliptic_eu elliptic_f elliptic_kc elliptic_pi ematrix %emode syn keyword maximaFunc endcons entermatrix entertensor entier %enumer equal equalp erf syn keyword maximaFunc erfflag errcatch error errormsg error_size error_syms syn keyword maximaFunc %e_to_numlog euler ev eval evenp every evflag evfun evundiff syn keyword maximaFunc example exp expand expandwrt expandwrt_denom expandwrt_factored syn keyword maximaFunc explose expon exponentialize expop express expt exptdispflag syn keyword maximaFunc exptisolate exptsubst extdiff extract_linear_equations ezgcd syn keyword maximaFunc facexpand factcomb factlim factor factorflag factorial factorout syn keyword maximaFunc factorsum facts false fast_central_elements fast_linsolve syn keyword maximaFunc fasttimes fb feature featurep features fft fib fibtophi fifth syn keyword maximaFunc filename_merge file_search file_search_demo file_search_lisp syn keyword maximaFunc file_search_maxima file_type fillarray findde first fix flatten syn keyword maximaFunc flipflag float float2bf floatnump flush flush1deriv flushd syn keyword maximaFunc flushnd forget fortindent fortran fortspaces fourcos fourexpand syn keyword maximaFunc fourier fourint fourintcos fourintsin foursimp foursin fourth syn keyword maximaFunc fpprec fpprintprec frame_bracket freeof fullmap fullmapl syn keyword maximaFunc fullratsimp fullratsubst funcsolve functions fundef funmake funp syn keyword maximaFunc gamma %gamma gammalim gauss gcd gcdex gcfactor gdet genfact syn keyword maximaFunc genindex genmatrix gensumnum get getchar gfactor gfactorsum syn keyword maximaFunc globalsolve go gradef gradefs gramschmidt grind grobner_basis syn keyword maximaFunc gschmit hach halfangles hermite hipow hodge horner i0 i1 syn keyword maximaFunc *read-base* ic1 ic2 icc1 icc2 ic_convert ichr1 ichr2 icounter syn keyword maximaFunc icurvature ident idiff idim idummy idummyx ieqn ieqnprint ifb syn keyword maximaFunc ifc1 ifc2 ifg ifgi ifr iframe_bracket_form iframes ifri ift syn keyword maximaFunc igeodesic_coords igeowedge_flag ikt1 ikt2 ilt imagpart imetric syn keyword maximaFunc inchar indexed_tensor indices inf %inf infeval infinity infix syn keyword maximaFunc inflag infolists init_atensor init_ctensor inm inmc1 inmc2 syn keyword maximaFunc innerproduct in_netmath inpart inprod inrt integerp integrate syn keyword maximaFunc integrate_use_rootsof integration_constant_counter interpolate syn keyword maximaFunc intfaclim intopois intosum intpolabs intpolerror intpolrel syn keyword maximaFunc invariant1 invariant2 inverse_jacobi_cd inverse_jacobi_cn syn keyword maximaFunc inverse_jacobi_cs inverse_jacobi_dc inverse_jacobi_dn syn keyword maximaFunc inverse_jacobi_ds inverse_jacobi_nc inverse_jacobi_nd syn keyword maximaFunc inverse_jacobi_ns inverse_jacobi_sc inverse_jacobi_sd syn keyword maximaFunc inverse_jacobi_sn invert is ishow isolate isolate_wrt_times syn keyword maximaFunc isqrt itr j0 j1 jacobi jacobi_cd jacobi_cn jacobi_cs jacobi_dc syn keyword maximaFunc jacobi_dn jacobi_ds jacobi_nc jacobi_nd jacobi_ns jacobi_sc syn keyword maximaFunc jacobi_sd jacobi_sn jn kdels kdelta keepfloat kill killcontext syn keyword maximaFunc kinvariant kostka kt labels lambda laplace lassociative last syn keyword maximaFunc lc2kdt lc_l lcm lc_u ldefint ldisp ldisplay leinstein length syn keyword maximaFunc let letrat let_rule_packages letrules letsimp levi_civita lfg syn keyword maximaFunc lfreeof lg lgtreillis lhospitallim lhs liediff limit limsubst syn keyword maximaFunc linear linechar linel linenum linsolve linsolve_params syn keyword maximaFunc linsolvewarn listarith listarray listconstvars listdummyvars syn keyword maximaFunc list_nc_monomials listoftens listofvars listp lmxchar load syn keyword maximaFunc loadfile loadprint local log logabs logarc logconcoeffp syn keyword maximaFunc logcontract logexpand lognegint lognumer logsimp lopow syn keyword maximaFunc lorentz_gauge lpart lratsubst lriem lriemann lsum ltreillis syn keyword maximaFunc m1pbranch macroexpansion mainvar make_array makebox makefact syn keyword maximaFunc makegamma makelist make_random_state make_transform map mapatom syn keyword maximaFunc maperror maplist matchdeclare matchfix matrix matrix_element_add syn keyword maximaFunc matrix_element_mult matrix_element_transpose matrixmap matrixp syn keyword maximaFunc mattrace max maxapplydepth maxapplyheight maxnegex maxposex syn keyword maximaFunc maxtayorder member min %minf minfactorial minor mod syn keyword maximaFunc mode_check_errorp mode_checkp mode_check_warnp mode_declare syn keyword maximaFunc mode_identity modulus mon2schur mono monomial_dimensions syn keyword maximaFunc multi_elem multinomial multi_orbit multiplicative multiplicities syn keyword maximaFunc multi_pui multsym multthru myoptions nc_degree ncexpt ncharpoly syn keyword maximaFunc negdistrib negsumdispflag newcontext newdet newton niceindices syn keyword maximaFunc niceindicespref ninth nm nmc noeval nolabels nonmetricity syn keyword maximaFunc nonscalar nonscalarp noun noundisp nounify nouns np npi syn keyword maximaFunc nptetrad nroots nterms ntermst nthroot ntrig num numberp numer syn keyword maximaFunc numerval numfactor nusum obase oddp ode2 op openplot_curves syn keyword maximaFunc operatorp opproperties opsubst optimize optimprefix optionset syn keyword maximaFunc orbit ordergreat ordergreatp orderless orderlessp outative syn keyword maximaFunc outchar outermap outofpois packagefile pade part part2cont syn keyword maximaFunc partfrac partition partpol partswitch permanent permut petrov syn keyword maximaFunc pfeformat pi pickapart piece playback plog plot2d plot2d_ps syn keyword maximaFunc plot3d plot_options poisdiff poisexpt poisint poislim poismap syn keyword maximaFunc poisplus poissimp poisson poissubst poistimes poistrim polarform syn keyword maximaFunc polartorect polynome2ele posfun potential powerdisp powers syn keyword maximaFunc powerseries pred prederror primep print printpois printprops syn keyword maximaFunc prodhack prodrac product programmode prompt properties props syn keyword maximaFunc propvars pscom psdraw_curve psexpand psi pui pui2comp pui2ele syn keyword maximaFunc pui2polynome pui_direct puireduc put qput qq quad_qag quad_qagi syn keyword maximaFunc quad_qags quad_qawc quad_qawf quad_qawo quad_qaws quanc8 quit syn keyword maximaFunc qunit quotient radcan radexpand radsubstflag random rank syn keyword maximaFunc rassociative rat ratalgdenom ratchristof ratcoef ratdenom syn keyword maximaFunc ratdenomdivide ratdiff ratdisrep rateinstein ratepsilon ratexpand syn keyword maximaFunc ratfac ratmx ratnumer ratnump ratp ratprint ratriemann ratsimp syn keyword maximaFunc ratsimpexpons ratsubst ratvars ratweight ratweights ratweyl syn keyword maximaFunc ratwtlvl read readonly realonly realpart realroots rearray syn keyword maximaFunc rectform recttopolar rediff refcheck rem remainder remarray syn keyword maximaFunc rembox remcomps remcon remcoord remfun remfunction remlet syn keyword maximaFunc remove remrule remsym remvalue rename reset residue resolvante syn keyword maximaFunc resolvante_alternee1 resolvante_bipartite resolvante_diedrale syn keyword maximaFunc resolvante_klein resolvante_klein3 resolvante_produit_sym syn keyword maximaFunc resolvante_unitaire resolvante_vierer rest resultant return syn keyword maximaFunc reveal reverse revert revert2 rhs ric ricci riem riemann syn keyword maximaFunc rinvariant risch rmxchar rncombine %rnum_list romberg rombergabs syn keyword maximaFunc rombergit rombergmin rombergtol room rootsconmode rootscontract syn keyword maximaFunc rootsepsilon round row run_testsuite save savedef savefactors syn keyword maximaFunc scalarmatrixp scalarp scalefactors scanmap schur2comp sconcat syn keyword maximaFunc scsimp scurvature sec sech second setcheck setcheckbreak syn keyword maximaFunc setelmx set_plot_option set_random_state setup_autoload syn keyword maximaFunc set_up_dot_simplifications setval seventh sf show showcomps syn keyword maximaFunc showratvars showtime sign signum similaritytransform simpsum syn keyword maximaFunc simtran sin sinh sinnpiflag sixth solve solvedecomposes syn keyword maximaFunc solveexplicit solvefactors solve_inconsistent_error solvenullwarn syn keyword maximaFunc solveradcan solvetrigwarn somrac sort sparse spherical_bessel_j syn keyword maximaFunc spherical_bessel_y spherical_hankel1 spherical_hankel2 syn keyword maximaFunc spherical_harmonic splice sqfr sqrt sqrtdispflag sstatus syn keyword maximaFunc stardisp status string stringout sublis sublis_apply_lambda syn keyword maximaFunc sublist submatrix subst substinpart substpart subvarp sum syn keyword maximaFunc sumcontract sumexpand sumhack sumsplitfact supcontext symbolp syn keyword maximaFunc symmetric symmetricp system tan tanh taylor taylordepth syn keyword maximaFunc taylorinfo taylor_logexpand taylor_order_coefficients taylorp syn keyword maximaFunc taylor_simplifier taylor_truncate_polynomials taytorat tcl_output syn keyword maximaFunc tcontract tellrat tellsimp tellsimpafter tensorkill tentex tenth syn keyword maximaFunc tex %th third throw time timer timer_devalue timer_info syn keyword maximaFunc tldefint tlimit tlimswitch todd_coxeter to_lisp totaldisrep syn keyword maximaFunc totalfourier totient tpartpol tr trace trace_options syn keyword maximaFunc transcompile translate translate_file transpose transrun syn keyword maximaFunc tr_array_as_ref tr_bound_function_applyp treillis treinat syn keyword maximaFunc tr_file_tty_messagesp tr_float_can_branch_complex syn keyword maximaFunc tr_function_call_default triangularize trigexpand trigexpandplus syn keyword maximaFunc trigexpandtimes triginverses trigrat trigreduce trigsign trigsimp syn keyword maximaFunc tr_numer tr_optimize_max_loop tr_semicompile tr_state_vars true syn keyword maximaFunc trunc truncate tr_warn_bad_function_calls tr_warn_fexpr syn keyword maximaFunc tr_warnings_get tr_warn_meval tr_warn_mode tr_warn_undeclared syn keyword maximaFunc tr_warn_undefined_variable tr_windy ttyoff ueivects ufg ug syn keyword maximaFunc ultraspherical undiff uniteigenvectors unitvector unknown unorder syn keyword maximaFunc unsum untellrat untimer untrace uric uricci uriem uriemann syn keyword maximaFunc use_fast_arrays uvect values vect_cross vectorpotential syn keyword maximaFunc vectorsimp verb verbify verbose weyl with_stdout writefile syn keyword maximaFunc xgraph_curves xthru zerobern zeroequiv zeromatrix zeta zeta%pi syn match maximaOp "[\*\/\+\-\#\!\~\^\=\:\<\>\@]" " ---------------------- END LIST OF ALL FUNCTIONS (EXCEPT KEYWORDS) ---------------------- syn case match " Labels (supports maxima's goto) syn match maximaLabel "^\s*<[a-zA-Z_][a-zA-Z0-9%_]*>" " String and Character constants " Highlight special characters (those which have a backslash) differently syn match maximaSpecial contained "\\\d\d\d\|\\." syn region maximaString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=maximaSpecial syn match maximaCharacter "'[^\\]'" syn match maximaSpecialChar "'\\.'" " number with no fractional part or exponent syn match maximaNumber /\<\d\+\>/ " floating point number with integer and fractional parts and optional exponent syn match maximaFloat /\<\d\+\.\d*\([BbDdEeSs][-+]\=\d\+\)\=\>/ " floating point number with no integer part and optional exponent syn match maximaFloat /\<\.\d\+\([BbDdEeSs][-+]\=\d\+\)\=\>/ " floating point number with no fractional part and optional exponent syn match maximaFloat /\<\d\+[BbDdEeSs][-+]\=\d\+\>/ " Comments: " maxima supports /* ... */ (like C) syn keyword maximaTodo contained TODO Todo DEBUG syn region maximaCommentBlock start="/\*" end="\*/" contains=maximaString,maximaTodo,maximaCommentBlock " synchronizing syn sync match maximaSyncComment grouphere maximaCommentBlock "/*" syn sync match maximaSyncComment 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_maxima_syntax_inits") if version < 508 let did_maxima_syntax_inits = 1 command -nargs=+ HiLink hi link else command -nargs=+ HiLink hi def link endif HiLink maximaBraceError maximaError HiLink maximaCmd maximaStatement HiLink maximaCurlyError maximaError HiLink maximaFuncCmd maximaStatement HiLink maximaParenError maximaError " The default methods for highlighting. Can be overridden later HiLink maximaCharacter Character HiLink maximaComma Function HiLink maximaCommentBlock Comment HiLink maximaConditional Conditional HiLink maximaError Error HiLink maximaFunc Delimiter HiLink maximaOp Delimiter HiLink maximaLabel PreProc HiLink maximaNumber Number HiLink maximaFloat Float HiLink maximaRepeat Repeat HiLink maximaSpecial Type HiLink maximaSpecialChar SpecialChar HiLink maximaStatement Statement HiLink maximaString String HiLink maximaTodo Todo delcommand HiLink endif let b:current_syntax = "maxima" vim-7.4.1689/runtime/syntax/mel.vim000066400000000000000000000072351267703067000171070ustar00rootroot00000000000000" Vim syntax file " Language: MEL (Maya Extension Language) " Maintainer: Robert Minsk " Last Change: May 27 1999 " Based on: Bram Moolenaar 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=/<>/ 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 else command -nargs=+ HiLink hi def link 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" vim-7.4.1689/runtime/syntax/messages.vim000066400000000000000000000051351267703067000201360ustar00rootroot00000000000000" Vim syntax file " Language: /var/log/messages file " Maintainer: Yakov Lerner " Latest Revision: 2008-06-29 " Changes: 2008-06-29 support for RFC3339 tuimestamps James Vega " 2016 Jan 19: messagesDate changed by Bram if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn match messagesBegin display '^' nextgroup=messagesDate,messagesDateRFC3339 syn match messagesDate contained display '[[:lower:][:upper:]][[:lower:][:upper:]][[:lower:][:upper:]] [ 0-9]\d *' \ nextgroup=messagesHour syn match messagesHour contained display '\d\d:\d\d:\d\d\s*' \ nextgroup=messagesHost syn match messagesDateRFC3339 contained display '\d\{4}-\d\d-\d\d' \ nextgroup=messagesRFC3339T syn match messagesRFC3339T contained display '\cT' \ nextgroup=messagesHourRFC3339 syn match messagesHourRFC3339 contained display '\c\d\d:\d\d:\d\d\(\.\d\+\)\=\([+-]\d\d:\d\d\|Z\)' \ nextgroup=messagesHost syn match messagesHost contained display '\S*\s*' \ nextgroup=messagesLabel syn match messagesLabel contained display '\s*[^:]*:\s*' \ nextgroup=messagesText contains=messagesKernel,messagesPID syn match messagesPID contained display '\[\zs\d\+\ze\]' syn match messagesKernel contained display 'kernel:' syn match messagesIP '\d\+\.\d\+\.\d\+\.\d\+' syn match messagesURL '\w\+://\S\+' syn match messagesText contained display '.*' \ contains=messagesNumber,messagesIP,messagesURL,messagesError syn match messagesNumber contained '0x[0-9a-fA-F]*\|\[<[0-9a-f]\+>\]\|\<\d[0-9a-fA-F]*' syn match messagesError contained '\c.*\<\(FATAL\|ERROR\|ERRORS\|FAILED\|FAILURE\).*' hi def link messagesDate Constant hi def link messagesHour Type hi def link messagesDateRFC3339 Constant hi def link messagesHourRFC3339 Type hi def link messagesRFC3339T Normal hi def link messagesHost Identifier hi def link messagesLabel Operator hi def link messagesPID Constant hi def link messagesKernel Special hi def link messagesError ErrorMsg hi def link messagesIP Constant hi def link messagesURL Underlined hi def link messagesText Normal hi def link messagesNumber Number let b:current_syntax = "messages" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/mf.vim000066400000000000000000000200641267703067000167270ustar00rootroot00000000000000" Vim syntax file " Language: Metafont " Maintainer: Andreas Scherer " 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 "\" " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/mgl.vim000066400000000000000000000075661267703067000171200ustar00rootroot00000000000000" Vim syntax file " Language: MGL " Version: 1.0 " Last Change: 2006 Feb 21 " Maintainer: Gero Kuhlmann " " $Id: mgl.vim,v 1.1 2006/02/21 22:08:20 vimboss Exp $ " if version < 600 syntax clear elseif exists("b:current_syntax") finish endif syn sync lines=250 syn keyword mglBoolean true false syn keyword mglConditional if else then syn keyword mglConstant nil syn keyword mglPredefined maxint syn keyword mglLabel case goto label syn keyword mglOperator to downto in of with syn keyword mglOperator and not or xor div mod syn keyword mglRepeat do for repeat while to until syn keyword mglStatement procedure function break continue return restart syn keyword mglStatement program begin end const var type syn keyword mglStruct record syn keyword mglType integer string char boolean char ipaddr array " String if !exists("mgl_one_line_string") syn region mglString matchgroup=mglString start=+'+ end=+'+ contains=mglStringEscape syn region mglString matchgroup=mglString start=+"+ end=+"+ contains=mglStringEscapeGPC else "wrong strings syn region mglStringError matchgroup=mglStringError start=+'+ end=+'+ end=+$+ contains=mglStringEscape syn region mglStringError matchgroup=mglStringError start=+"+ end=+"+ end=+$+ contains=mglStringEscapeGPC "right strings syn region mglString matchgroup=mglString start=+'+ end=+'+ oneline contains=mglStringEscape syn region mglString matchgroup=mglString start=+"+ end=+"+ oneline contains=mglStringEscapeGPC end syn match mglStringEscape contained "''" syn match mglStringEscapeGPC contained '""' if exists("mgl_symbol_operator") syn match mglSymbolOperator "[+\-/*=\%]" syn match mglSymbolOperator "[<>]=\=" syn match mglSymbolOperator "<>" syn match mglSymbolOperator ":=" syn match mglSymbolOperator "[()]" syn match mglSymbolOperator "\.\." syn match mglMatrixDelimiter "(." syn match mglMatrixDelimiter ".)" syn match mglMatrixDelimiter "[][]" endif syn match mglNumber "-\=\<\d\+\>" syn match mglHexNumber "\$[0-9a-fA-F]\+\>" syn match mglCharacter "\#[0-9]\+\>" syn match mglIpAddr "[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\>" syn region mglComment start="(\*" end="\*)" syn region mglComment start="{" end="}" syn region mglComment start="//" end="$" if !exists("mgl_no_functions") syn keyword mglFunction dispose new syn keyword mglFunction get load print select syn keyword mglFunction odd pred succ syn keyword mglFunction chr ord abs sqr syn keyword mglFunction exit syn keyword mglOperator at timeout endif syn region mglPreProc start="(\*\$" end="\*)" syn region mglPreProc start="{\$" end="}" syn keyword mglException try except raise syn keyword mglPredefined exception " Define the default highlighting. " For version 5.7 and earlier: only when not done already " For version 5.8 and later: only when an item doesn't have highlighting yet if version >= 508 || !exists("did_mgl_syn_inits") if version < 508 let did_mgl_syn_inits = 1 command -nargs=+ HiLink hi link else command -nargs=+ HiLink hi def link endif HiLink mglBoolean Boolean HiLink mglComment Comment HiLink mglConditional Conditional HiLink mglConstant Constant HiLink mglException Exception HiLink mglFunction Function HiLink mglLabel Label HiLink mglMatrixDelimiter Identifier HiLink mglNumber Number HiLink mglHexNumber Number HiLink mglCharacter Number HiLink mglIpAddr Number HiLink mglOperator Operator HiLink mglPredefined mglFunction HiLink mglPreProc PreProc HiLink mglRepeat Repeat HiLink mglStatement Statement HiLink mglString String HiLink mglStringEscape Special HiLink mglStringEscapeGPC Special HiLink mglStringError Error HiLink mglStruct mglStatement HiLink mglSymbolOperator mglOperator HiLink mglType Type delcommand HiLink endif let b:current_syntax = "mgl" " vim: ts=8 sw=2 vim-7.4.1689/runtime/syntax/mgp.vim000066400000000000000000000045371267703067000171170ustar00rootroot00000000000000" Vim syntax file " Language: mgp - MaGic Point " Maintainer: Gerfried Fuchs " 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 else command -nargs=+ HiLink hi def link 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" vim-7.4.1689/runtime/syntax/mib.vim000066400000000000000000000052101267703067000170700ustar00rootroot00000000000000" Vim syntax file " Language: Vim syntax file for SNMPv1 and SNMPv2 MIB and SMI files " Maintainer: Martin Smat " Original Author: David Pascoe " Written: Wed Jan 28 14:37:23 GMT--8:00 1998 " Last Changed: Mon Mar 23 2010 if exists("b:current_syntax") finish endif setlocal iskeyword=@,48-57,_,128-167,224-235,- 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 mibOperator "::=" syn match mibComment "\ *--.\{-}\(--\|$\)" syn match mibNumber "\<['0-9a-fA-FhH]*\>" syn region mibDescription start="\"" end="\"" contains=DEFAULT hi def link mibImplicit Statement hi def link mibOperator Statement hi def link mibComment Comment hi def link mibConstants String hi def link mibNumber Number hi def link mibDescription Identifier hi def link mibEpilogue SpecialChar hi def link mibValue Structure let b:current_syntax = "mib" vim-7.4.1689/runtime/syntax/mix.vim000066400000000000000000000054501267703067000171240ustar00rootroot00000000000000" Vim syntax file " Language: MIX (Donald Knuth's assembly language used in TAOCP) " Maintainer: Wu Yongwei " Filenames: *.mixal *.mix " Last Change: 2013 Nov 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 case ignore " Special processing of ALF directive: implementations vary whether quotation " marks are needed syn match mixAlfParam #\s\{1,2\}"\?[^"]\{,5\}"\?# contains=mixAlfDirective,mixString nextgroup=mixEndComment contained " Region for parameters syn match mixParam #[-+*/:=0-9a-z,()"]\+# contains=mixIdentifier,mixSpecial,mixNumber,mixString,mixLabel nextgroup=mixEndComment contained " Comment at the line end syn match mixEndComment ".*" contains=mixRegister contained " Identifier; must go before literals syn match mixIdentifier "[a-z0-9_]\+" contained " Literals syn match mixSpecial "[-+*/:=]" contained syn match mixNumber "[0-9]\+\>" contained syn region mixString start=+"+ skip=+\\"+ end=+"+ contained " Labels syn match mixLabel "^[a-z0-9_]\{,10\}\s\+" nextgroup=mixAlfSpecial,mixOpcode,mixDirective syn match mixLabel "[0-9][BF]" contained " Comments syn match mixComment "^\*.*" contains=mixRegister " Directives syn keyword mixDirective ORIG EQU CON END nextgroup=mixParam contained skipwhite syn keyword mixDirective ALF nextgroup=mixAlfParam contained " Opcodes syn keyword mixOpcode NOP HLT NUM CHAR FLOT FIX nextgroup=mixEndComment contained syn keyword mixOpcode FADD FSUB FMUL FDIV FCMP MOVE ADD SUB MUL DIV IOC IN OUT JRED JBUS JMP JSJ JOV JNOV JL JE JG JLE JNE JGE SLA SRA SLAX SRAX SLC SRC nextgroup=mixParam contained skipwhite syn match mixOpcode "LD[AX1-6]N\?\>" nextgroup=mixParam contained skipwhite syn match mixOpcode "ST[AX1-6JZ]\>" nextgroup=mixParam contained skipwhite syn match mixOpcode "EN[TN][AX1-6]\>" nextgroup=mixParam contained skipwhite syn match mixOpcode "INC[AX1-6]\>" nextgroup=mixParam contained skipwhite syn match mixOpcode "DEC[AX1-6]\>" nextgroup=mixParam contained skipwhite syn match mixOpcode "CMP[AX1-6]\>" nextgroup=mixParam contained skipwhite syn match mixOpcode "J[AX1-6]N\?[NZP]\>" nextgroup=mixParam contained skipwhite " Switch back to being case sensitive syn case match " Registers (only to used in comments now) syn keyword mixRegister rA rX rI1 rI2 rI3 rI4 rI5 rI6 rJ contained " The default highlighting hi def link mixRegister Special hi def link mixLabel Define hi def link mixComment Comment hi def link mixEndComment Comment hi def link mixDirective Keyword hi def link mixOpcode Keyword hi def link mixSpecial Special hi def link mixNumber Number hi def link mixString String hi def link mixAlfParam String hi def link mixIdentifier Identifier let b:current_syntax = "mix" let &cpo = s:cpo_save unlet s:cpo_save " vim: ts=8 vim-7.4.1689/runtime/syntax/mma.vim000066400000000000000000000272771267703067000171140ustar00rootroot00000000000000" Vim syntax file " Language: Mathematica " Maintainer: steve layland " Last Change: 2012 Feb 03 by Thilo Six " Source: http://members.wri.com/layland/vim/syntax/mma.vim " http://vim.sourceforge.net/scripts/script.php?script_id=1273 " Id: $Id: mma.vim,v 1.4 2006/04/14 20:40:38 vimboss Exp $ " NOTE: " " Empty .m files will automatically be presumed as Matlab files " unless you have the following in your .vimrc: " " let filetype_m="mma" " " I also recommend setting the default 'Comment' hilighting to something " other than the color used for 'Function', since both are plentiful in " most mathematica files, and they are often the same color (when using " background=dark). " " Credits: " o Original Mathematica syntax version written by " Wolfgang Waltenberger " o Some ideas like the CommentStar,CommentTitle were adapted " from the Java vim syntax file by Claudio Fleiner. Thanks! " o Everything else written by steve " " Bugs: " o Vim 6.1 didn't really have support for character classes " of other named character classes. For example, [\a\d] " didn't work. Therefore, a lot of this code uses explicit " character classes instead: [0-9a-zA-Z] " " TODO: " folding " fix nesting " finish populating popular symbols if version < 600 syntax clear elseif exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim " Group Definitions: syntax cluster mmaNotes contains=mmaTodo,mmaFixme syntax cluster mmaComments contains=mmaComment,mmaFunctionComment,mmaItem,mmaFunctionTitle,mmaCommentStar syntax cluster mmaCommentStrings contains=mmaLooseQuote,mmaCommentString,mmaUnicode syntax cluster mmaStrings contains=@mmaCommentStrings,mmaString syntax cluster mmaTop contains=mmaOperator,mmaGenericFunction,mmaPureFunction,mmaVariable " Predefined Constants: " to list all predefined Symbols would be too insane... " it's probably smarter to define a select few, and get the rest from " context if absolutely necessary. " TODO - populate this with other often used Symbols " standard fixed symbols: syntax keyword mmaVariable True False None Automatic All Null C General " mathematical constants: syntax keyword mmaVariable Pi I E Infinity ComplexInfinity Indeterminate GoldenRatio EulerGamma Degree Catalan Khinchin Glaisher " stream data / atomic heads: syntax keyword mmaVariable Byte Character Expression Number Real String Word EndOfFile Integer Symbol " sets: syntax keyword mmaVariable Integers Complexes Reals Booleans Rationals " character classes: syntax keyword mmaPattern DigitCharacter LetterCharacter WhitespaceCharacter WordCharacter EndOfString StartOfString EndOfLine StartOfLine WordBoundary " SelectionMove directions/units: syntax keyword mmaVariable Next Previous After Before Character Word Expression TextLine CellContents Cell CellGroup EvaluationCell ButtonCell GeneratedCell Notebook syntax keyword mmaVariable CellTags CellStyle CellLabel " TableForm positions: syntax keyword mmaVariable Above Below Left Right " colors: syntax keyword mmaVariable Black Blue Brown Cyan Gray Green Magenta Orange Pink Purple Red White Yellow " function attributes syntax keyword mmaVariable Protected Listable OneIdentity Orderless Flat Constant NumericFunction Locked ReadProtected HoldFirst HoldRest HoldAll HoldAllComplete SequenceHold NHoldFirst NHoldRest NHoldAll Temporary Stub " Comment Sections: " this: " :that: syntax match mmaItem "\%(^[( |*\t]*\)\@<=\%(:\+\|\w\)\w\+\%( \w\+\)\{0,3}:" contained contains=@mmaNotes " Comment Keywords: syntax keyword mmaTodo TODO NOTE HEY contained syntax match mmaTodo "X\{3,}" contained syntax keyword mmaFixme FIX[ME] FIXTHIS BROKEN contained syntax match mmaFixme "BUG\%( *\#\=[0-9]\+\)\=" contained " yay pirates... syntax match mmaFixme "\%(Y\=A\+R\+G\+\|GRR\+\|CR\+A\+P\+\)\%(!\+\)\=" contained " EmPHAsis: " this unnecessary, but whatever :) syntax match mmaemPHAsis "\%(^\|\s\)\([_/]\)[a-zA-Z0-9]\+\%([- \t':]\+[a-zA-Z0-9]\+\)*\1\%(\s\|$\)" contained contains=mmaemPHAsis syntax match mmaemPHAsis "\%(^\|\s\)(\@]\@!" contains=mmaOperator "pattern default: syntax match mmaPattern ": *[^ ,]\+[\], ]\@=" contains=@mmaCommentStrings,@mmaTop,mmaOperator "pattern head/test: syntax match mmaPattern "[A-Za-z0-9`]*_\+\%(\a\+\)\=\%(?([^)]\+)\|?[^\]},]\+\)\=" contains=@mmaTop,@mmaCommentStrings,mmaPatternError " Operators: " /: ^= ^:= UpValue " /; Conditional " := = DownValue " == === || " != =!= && Logic " >= <= < > " += -= *= " /= ++ -- Math " ^* " -> :> Rules " @@ @@@ Apply " /@ //@ Map " /. //. Replace " // @ Function application " <> ~~ String/Pattern join " ~ infix operator " . : Pattern operators syntax match mmaOperator "\%(@\{1,3}\|//[.@]\=\)" syntax match mmaOperator "\%(/[;:@.]\=\|\^\=:\==\)" syntax match mmaOperator "\%([-:=]\=>\|<=\=\)" "syntax match mmaOperator "\%(++\=\|--\=\|[/+-*]=\|[^*]\)" syntax match mmaOperator "[*+=^.:?-]" syntax match mmaOperator "\%(\~\~\=\)" syntax match mmaOperator "\%(=\{2,3}\|=\=!=\|||\=\|&&\|!\)" contains=ALLBUT,mmaPureFunction " Symbol Tags: " "SymbolName::item" "syntax match mmaSymbol "`\=[a-zA-Z$]\+[0-9a-zA-Z$]*\%(`\%([a-zA-Z$]\+[0-9a-zA-Z$]*\)\=\)*" contained syntax match mmaMessage "`\=\([a-zA-Z$]\+[0-9a-zA-Z$]*\)\%(`\%([a-zA-Z$]\+[0-9a-zA-Z$]*\)\=\)*::\a\+" contains=mmaMessageType syntax match mmaMessageType "::\a\+"hs=s+2 contained " Pure Functions: syntax match mmaPureFunction "#\%(#\|\d\+\)\=" syntax match mmaPureFunction "&" " Named Functions: " Since everything is pretty much a function, get this straight " from context syntax match mmaGenericFunction "[A-Za-z0-9`]\+\s*\%([@[]\|/:\|/\=/@\)\@=" contains=mmaOperator syntax match mmaGenericFunction "\~\s*[^~]\+\s*\~"hs=s+1,he=e-1 contains=mmaOperator,mmaBoring syntax match mmaGenericFunction "//\s*[A-Za-z0-9`]\+"hs=s+2 contains=mmaOperator " Numbers: syntax match mmaNumber "\<\%(\d\+\.\=\d*\|\d*\.\=\d\+\)\>" syntax match mmaNumber "`\d\+\%(\d\@!\.\|\>\)" " Special Characters: " \[Name] named character " \ooo octal " \.xx 2 digit hex " \:xxxx 4 digit hex (multibyte unicode) syntax match mmaUnicode "\\\[\w\+\d*\]" syntax match mmaUnicode "\\\%(\x\{3}\|\.\x\{2}\|:\x\{4}\)" " Syntax Errors: syntax match mmaError "\*)" containedin=ALLBUT,@mmaComments,@mmaStrings syntax match mmaError "\%([/]{3,}\|[&:|+*?~-]\{3,}\|[.=]\{4,}\|_\@<=\.\{2,}\|`\{2,}\)" containedin=ALLBUT,@mmaComments,@mmaStrings " Punctuation: " things that shouldn't really be highlighted, or highlighted " in they're own group if you _really_ want. :) " ( ) { } " TODO - use Delimiter group? syntax match mmaBoring "[(){}]" contained " ------------------------------------ " future explorations... " ------------------------------------ " Function Arguments: " anything between brackets [] " (fold) "syntax region mmaArgument start="\[" end="\]" containedin=ALLBUT,@mmaComments,@mmaStrings transparent fold " Lists: " (fold) "syntax region mmaLists start="{" end="}" containedin=ALLBUT,@mmaComments,@mmaStrings transparent fold " Regions: " (fold) "syntax region mmaRegion start="(\*\+[^<]* \*)" containedin=ALLBUT,@mmaStrings transparent fold keepend " show fold text set commentstring='(*%s*)' "set foldtext=MmaFoldText() "function MmaFoldText() " let line = getline(v:foldstart) " " let lines = v:foldend-v:foldstart+1 " " let sub = substitute(line, '(\*\+|\*\+)|[-*_]\+', '', 'g') " " if match(line, '(\*') != -1 " let lines = lines.' line comment' " else " let lines = lines.' lines' " endif " " return v:folddashes.' '.lines.' '.sub "endf "this is slow for computing folds, but it does so accurately syntax sync fromstart " but this seems to do alright for non fold syntax coloring. " for folding, however, it doesn't get the nesting right. " TODO - find sync group for multiline modules? ick... " sync multi line comments "syntax sync match syncComments groupthere NONE "\*)" "syntax sync match syncComments groupthere mmaComment "(\*" "set foldmethod=syntax "set foldnestmax=1 "set foldminlines=15 if version >= 508 || !exists("did_mma_syn_inits") if version < 508 let did_mma_syn_inits = 1 command -nargs=+ HiLink hi link else command -nargs=+ HiLink hi def link endif " NOTE - the following links are not guaranteed to " look good under all colorschemes. You might need to " :so $VIMRUNTIME/syntax/hitest.vim and tweak these to " look good in yours HiLink mmaComment Comment HiLink mmaCommentStar Comment HiLink mmaFunctionComment Comment HiLink mmaLooseQuote Comment HiLink mmaGenericFunction Function HiLink mmaVariable Identifier " HiLink mmaSymbol Identifier HiLink mmaOperator Operator HiLink mmaPatternOp Operator HiLink mmaPureFunction Operator HiLink mmaString String HiLink mmaCommentString String HiLink mmaUnicode String HiLink mmaMessage Type HiLink mmaNumber Type HiLink mmaPattern Type HiLink mmaError Error HiLink mmaFixme Error HiLink mmaPatternError Error HiLink mmaTodo Todo HiLink mmaemPHAsis Special HiLink mmaFunctionTitle Special HiLink mmaMessageType Special HiLink mmaItem Preproc delcommand HiLink endif let b:current_syntax = "mma" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/mmix.vim000066400000000000000000000121771267703067000173050ustar00rootroot00000000000000" Vim syntax file " Language: MMIX " Maintainer: Dirk Hsken, " Last Change: 2012 Jun 01 " (Dominique Pelle added @Spell) " Filenames: *.mms " URL: http://homepages.uni-tuebingen.de/student/dirk.huesken/vim/syntax/mmix.vim " Limitations: Comments must start with either % or // " (preferably %, 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=+"+ contains=@Spell 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 "%.*" contains=@Spell syn match mmixComment "//.*" contains=@Spell syn match mmixComment "^\*.*" contains=@Spell 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/mmp.vim000066400000000000000000000032021267703067000171110ustar00rootroot00000000000000" Vim syntax file " Language: Symbian meta-makefile definition (MMP) " Maintainer: Ron Aaron " Last Change: 2007/11/07 " URL: http://ronware.org/wiki/vim/mmp " Filetypes: *.mmp " For version 5.x: Clear all syntax items " 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 mmpComment "//.*" syn region mmpComment start="/\*" end="\*\/" syn keyword mmpKeyword aif asspabi assplibrary aaspexports baseaddress syn keyword mmpKeyword debuglibrary deffile document epocheapsize syn keyword mmpKeyword epocprocesspriority epocstacksize exportunfrozen syn keyword mmpStorage lang library linkas macro nostrictdef option syn keyword mmpStorage resource source sourcepath srcdbg startbitmap syn keyword mmpStorage start end staticlibrary strictdepend systeminclude syn keyword mmpStorage systemresource target targettype targetpath uid syn keyword mmpStorage userinclude win32_library syn match mmpIfdef "\#\(include\|ifdef\|ifndef\|if\|endif\|else\|elif\)" syn match mmpNumber "\d+" syn match mmpNumber "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 !exists("did_mmp_syntax_inits") let did_mmp_syntax_inits=1 hi def link mmpComment Comment hi def link mmpKeyword Keyword hi def link mmpStorage StorageClass hi def link mmpString String hi def link mmpNumber Number hi def link mmpOrdinal Operator hi def link mmpIfdef PreCondit endif let b:current_syntax = "mmp" " vim: ts=8 vim-7.4.1689/runtime/syntax/modconf.vim000066400000000000000000000025771267703067000177630ustar00rootroot00000000000000" Vim syntax file " Language: modules.conf(5) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2007-10-25 if exists("b:current_syntax") finish endif setlocal iskeyword+=- let s:cpo_save = &cpo set cpo&vim syn keyword modconfTodo FIXME TODO XXX NOTE syn region modconfComment start='#' skip='\\$' end='$' \ contains=modconfTodo,@Spell syn keyword modconfConditional if else elseif endif syn keyword modconfPreProc alias define include keep prune \ post-install post-remove pre-install \ pre-remove persistdir blacklist syn keyword modconfKeyword add above below install options probe probeall \ remove syn keyword modconfIdentifier depfile insmod_opt path generic_stringfile \ pcimapfile isapnpmapfile usbmapfile \ parportmapfile ieee1394mapfile pnpbiosmapfile syn match modconfIdentifier 'path\[[^]]\+\]' hi def link modconfTodo Todo hi def link modconfComment Comment hi def link modconfConditional Conditional hi def link modconfPreProc PreProc hi def link modconfKeyword Keyword hi def link modconfIdentifier Identifier let b:current_syntax = "modconf" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/model.vim000066400000000000000000000026751267703067000174350ustar00rootroot00000000000000" Vim syntax file " Language: Model " Maintainer: Bram Moolenaar " Last Change: 2005 Jun 20 " very basic things only (based on the vgrindefs file). " If you use this language, please improve it, and send me the patches! " Quit when a (custom) syntax file was already loaded if 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. " Only used when an item doesn't have highlighting yet hi def link modelKeyword Statement hi def link modelBlock PreProc hi def link modelComment Comment hi def link modelString String let b:current_syntax = "model" " vim: ts=8 sw=2 vim-7.4.1689/runtime/syntax/modsim3.vim000066400000000000000000000075641267703067000177120ustar00rootroot00000000000000" Vim syntax file " Language: Modsim III, by compuware corporation (www.compuware.com) " Maintainer: Philipp Jocham " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/modula2.vim000066400000000000000000000070441267703067000176730ustar00rootroot00000000000000" Vim syntax file " Language: Modula 2 " Maintainer: pf@artcom0.north.de (Peter Funk) " based on original work of Bram Moolenaar " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/modula3.vim000066400000000000000000000045721267703067000176770ustar00rootroot00000000000000" Vim syntax file " Language: Modula-3 " Maintainer: Timo Pedersen " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/monk.vim000066400000000000000000000247051267703067000172770ustar00rootroot00000000000000" Vim syntax file " Language: Monk (See-Beyond Technologies) " Maintainer: Mike Litherland " Last Change: 2012 Feb 03 by Thilo Six " 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 " 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 let s:cpo_save = &cpo set cpo&vim 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<=? 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>? 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 : 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 else command -nargs=+ HiLink hi def link 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" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/moo.vim000066400000000000000000000220431267703067000171160ustar00rootroot00000000000000" Vim syntax file " Language: MOO " Maintainer: Timo Frenay " 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 !%&(*+,\-/<=>?@[^`{|]\@!=\@!~ contained contains=mooCStyleComment else syn match mooExclamation display ~[\t !%&(*+,\-/<=>?@[^`{|]\@?@^|]\@?~ 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 vim-7.4.1689/runtime/syntax/mp.vim000066400000000000000000000131751267703067000167460ustar00rootroot00000000000000" Vim syntax file " Language: MetaPost " Maintainer: Andreas Scherer " 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 :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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/mplayerconf.vim000066400000000000000000000164771267703067000206610ustar00rootroot00000000000000" Vim syntax file " Language: mplayer(1) configuration file " Maintainer: Dmitri Vereshchagin " Previous Maintainer: Nikolai Weibull " Latest Revision: 2015-01-24 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim setlocal iskeyword+=- syn keyword mplayerconfTodo contained TODO FIXME XXX NOTE syn region mplayerconfComment display oneline start='#' end='$' \ contains=mplayerconfTodo,@Spell syn keyword mplayerconfPreProc include syn keyword mplayerconfBoolean yes no true false syn match mplayerconfNumber '\<\d\+\>' syn keyword mplayerconfOption hardframedrop nomouseinput bandwidth dumpstream \ rtsp-stream-over-tcp tv overlapsub \ sub-bg-alpha subfont-outline unicode format \ vo edl cookies fps zrfd af-adv nosound \ audio-density passlogfile vobsuboutindex autoq \ autosync benchmark colorkey nocolorkey edlout \ enqueue fixed-vo framedrop h identify input \ lircconf list-options loop menu menu-cfg \ menu-root nojoystick nolirc nortc playlist \ quiet really-quiet shuffle skin slave \ softsleep speed sstep use-stdin aid alang \ audio-demuxer audiofile audiofile-cache \ cdrom-device cache cdda channels chapter \ cookies-file demuxer dumpaudio dumpfile \ dumpvideo dvbin dvd-device dvdangle forceidx \ frames hr-mp3-seek idx ipv4-only-proxy \ loadidx mc mf ni nobps noextbased \ passwd prefer-ipv4 prefer-ipv6 rawaudio \ rawvideo saveidx sb srate ss tskeepbroken \ tsprog tsprobe user user-agent vid vivo \ dumpjacosub dumpmicrodvdsub dumpmpsub dumpsami \ dumpsrtsub dumpsub ffactor flip-hebrew font \ forcedsubsonly fribidi-charset ifo noautosub \ osdlevel sid slang spuaa spualign spugauss \ sub sub-bg-color sub-demuxer sub-fuzziness \ sub-no-text-pp subalign subcc subcp subdelay \ subfile subfont-autoscale subfont-blur \ subfont-encoding subfont-osd-scale \ subfont-text-scale subfps subpos subwidth \ utf8 vobsub vobsubid abs ao aofile aop delay \ mixer nowaveheader aa bpp brightness contrast \ dfbopts display double dr dxr2 fb fbmode \ fbmodeconfig forcexv fs fsmode-dontuse fstype \ geometry guiwid hue jpeg monitor-dotclock \ monitor-hfreq monitor-vfreq monitoraspect \ nograbpointer nokeepaspect noxv ontop panscan \ rootwin saturation screenw stop-xscreensaver \ vm vsync wid xineramascreen z zrbw zrcrop \ zrdev zrhelp zrnorm zrquality zrvdec zrxdoff \ ac af afm aspect flip lavdopts noaspect \ noslices novideo oldpp pp pphelp ssf stereo \ sws vc vfm x xvidopts xy y zoom vf vop \ audio-delay audio-preload endpos ffourcc \ include info noautoexpand noskip o oac of \ ofps ovc skiplimit v vobsubout vobsuboutid \ lameopts lavcopts nuvopts xvidencopts a52drc \ adapter af-add af-clr af-del af-pre \ allow-dangerous-playlist-parsing ass \ ass-border-color ass-bottom-margin ass-color \ ass-font-scale ass-force-style ass-hinting \ ass-line-spacing ass-styles ass-top-margin \ ass-use-margins ausid bluray-angle \ bluray-device border border-pos-x border-pos-y \ cache-min cache-seek-min capture codecpath \ codecs-file correct-pts crash-debug \ doubleclick-time dvd-speed edl-backward-delay \ edl-start-pts embeddedfonts fafmttag \ field-dominance fontconfig force-avi-aspect \ force-key-frames frameno-file fullscreen gamma \ gui gui-include gui-wid heartbeat-cmd \ heartbeat-interval hr-edl-seek \ http-header-fields idle ignore-start \ key-fifo-size list-properties menu-chroot \ menu-keepdir menu-startup mixer-channel \ monitor-orientation monitorpixelaspect \ mouse-movements msgcharset msgcolor msglevel \ msgmodule name noar nocache noconfig \ noconsolecontrols nocorrect-pts nodouble \ noedl-start-pts noencodedups \ noflip-hebrew-commas nogui noidx noodml \ nostop-xscreensaver nosub noterm-osd \ osd-duration osd-fractions panscanrange \ pausing playing-msg priority profile \ progbar-align psprobe pvr radio referrer \ refreshrate reuse-socket rtc rtc-device \ rtsp-destination rtsp-port \ rtsp-stream-over-http screenh show-profile \ softvol softvol-max sub-paths subfont \ term-osd-esc title tvscan udp-ip udp-master \ udp-port udp-seek-threshold udp-slave \ unrarexec use-filedir-conf use-filename-title \ vf-add vf-clr vf-del vf-pre volstep volume \ zrhdec zrydoff syn region mplayerconfString display oneline start=+"+ end=+"+ syn region mplayerconfString display oneline start=+'+ end=+'+ syn region mplayerconfProfile display oneline start='^\s*\[' end='\]' hi def link mplayerconfTodo Todo hi def link mplayerconfComment Comment hi def link mplayerconfPreProc PreProc hi def link mplayerconfBoolean Boolean hi def link mplayerconfNumber Number hi def link mplayerconfOption Keyword hi def link mplayerconfString String hi def link mplayerconfProfile Special let b:current_syntax = "mplayerconf" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/mrxvtrc.vim000066400000000000000000000226031267703067000200330ustar00rootroot00000000000000" Description : Vim syntax file for mrxvtrc (for mrxvt-0.5.0 and up) " Created : Wed 26 Apr 2006 01:20:53 AM CDT " Modified : Thu 02 Feb 2012 08:37:45 PM EST " Maintainer : GI , where a='gi1242+vim', b='gmail', c='com' " Quit when a syntax file was already loaded if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn case match " Errors syn match mrxvtrcError contained '\v\S+' " Comments syn match mrxvtrcComment contains=@Spell '^\s*[!#].*$' syn match mrxvtrcComment '\v^\s*[#!]\s*\w+[.*]\w+.*:.*' " " Options. " syn match mrxvtrcClass '\v^\s*\w+[.*]' \ nextgroup=mrxvtrcOptions,mrxvtrcProfile,@mrxvtrcPOpts,mrxvtrcError " Boolean options syn keyword mrxvtrcOptions contained nextgroup=mrxvtrcBColon,mrxvtrcError \ highlightTabOnBell syncTabTitle hideTabbar \ autohideTabbar bottomTabbar hideButtons \ syncTabIcon veryBoldFont maximized \ fullscreen reverseVideo loginShell \ jumpScroll scrollBar scrollbarRight \ scrollbarFloating scrollTtyOutputInhibit \ scrollTtyKeypress transparentForce \ transparentScrollbar transparentMenubar \ transparentTabbar tabUsePixmap utmpInhibit \ visualBell mapAlert meta8 \ mouseWheelScrollPage multibyte_cursor \ tripleclickwords showMenu xft xftNomFont \ xftSlowOutput xftAntialias xftHinting \ xftAutoHint xftGlobalAdvance cmdAllTabs \ protectSecondary thai borderLess \ overrideRedirect broadcast smartResize \ pointerBlank cursorBlink noSysConfig \ disableMacros linuxHomeEndKey sessionMgt \ boldColors smoothResize useFifo veryBright syn match mrxvtrcOptions contained nextgroup=mrxvtrcBColon,mrxvtrcError \ '\v' syn match mrxvtrcBColon contained skipwhite \ nextgroup=mrxvtrcBoolVal,mrxvtrcError ':' syn case ignore syn keyword mrxvtrcBoolVal contained skipwhite nextgroup=mrxvtrcError \ 0 1 yes no on off true false syn case match " Color options syn keyword mrxvtrcOptions contained nextgroup=mrxvtrcCColon,mrxvtrcError \ ufBackground textShadow tabForeground \ itabForeground tabBackground itabBackground \ scrollColor troughColor highlightColor \ cursorColor cursorColor2 pointerColor \ borderColor tintColor syn match mrxvtrcOptions contained nextgroup=mrxvtrcCColon,mrxvtrcError \ '\v' syn match mrxvtrcCColon contained skipwhite \ nextgroup=mrxvtrcColorVal ':' syn match mrxvtrcColorVal contained skipwhite nextgroup=mrxvtrcError \ '\v#[0-9a-fA-F]{6}' " Numeric options syn keyword mrxvtrcOptions contained nextgroup=mrxvtrcNColon,mrxvtrcError \ maxTabWidth minVisibleTabs \ scrollbarThickness xftmSize xftSize desktop \ externalBorder internalBorder lineSpace \ pointerBlankDelay cursorBlinkInterval \ shading backgroundFade bgRefreshInterval \ fading opacity opacityDegree xftPSize syn match mrxvtrcNColon contained skipwhite \ nextgroup=mrxvtrcNumVal,mrxvtrcError ':' syn match mrxvtrcNumVal contained skipwhite nextgroup=mrxvtrcError \ '\v[+-]?<(0[0-7]+|\d+|0x[0-9a-f]+)>' " String options syn keyword mrxvtrcOptions contained nextgroup=mrxvtrcSColon,mrxvtrcError \ tabTitle termName title clientName iconName \ bellCommand backspaceKey deleteKey \ printPipe cutChars answerbackString \ smClientID geometry path boldFont xftFont \ xftmFont xftPFont inputMethod \ greektoggle_key menu menubarPixmap \ scrollbarPixmap tabbarPixmap appIcon \ multichar_encoding initProfileList syn match mrxvtrcOptions contained nextgroup=mrxvtrcSColon,mrxvtrcError \ '\v' syn match mrxvtrcSColon contained skipwhite nextgroup=mrxvtrcStrVal ':' syn match mrxvtrcStrVal contained '\v\S.*' " Profile options syn cluster mrxvtrcPOpts contains=mrxvtrcPSOpts,mrxvtrcPCOpts,mrxvtrcPNOpts syn match mrxvtrcProfile contained nextgroup=@mrxvtrcPOpts,mrxvtrcError \ '\vprofile\d+\.' syn keyword mrxvtrcPSOpts contained nextgroup=mrxvtrcSColon,mrxvtrcError \ tabTitle command holdExitText holdExitTitle \ Pixmap workingDirectory titleFormat \ winTitleFormat syn keyword mrxvtrcPCOpts contained nextgroup=mrxvtrcCColon,mrxvtrcError \ background foreground syn keyword mrxvtrcPNOpts contained nextgroup=mrxvtrcNColon,mrxvtrcError \ holdExit saveLines " scrollbarStyle syn match mrxvtrcOptions contained skipwhite \ nextgroup=mrxvtrcSBstyle,mrxvtrcError \ '\v' " " Highlighting groups " hi def link mrxvtrcError Error hi def link mrxvtrcComment Comment hi def link mrxvtrcClass Statement hi def link mrxvtrcOptions mrxvtrcClass hi def link mrxvtrcBColon mrxvtrcClass hi def link mrxvtrcCColon mrxvtrcClass hi def link mrxvtrcNColon mrxvtrcClass hi def link mrxvtrcSColon mrxvtrcClass hi def link mrxvtrcProfile mrxvtrcClass hi def link mrxvtrcPSOpts mrxvtrcClass hi def link mrxvtrcPCOpts mrxvtrcClass hi def link mrxvtrcPNOpts mrxvtrcClass hi def link mrxvtrcBoolVal Boolean hi def link mrxvtrcStrVal String hi def link mrxvtrcColorVal Constant hi def link mrxvtrcNumVal Number hi def link mrxvtrcSBstyle mrxvtrcStrVal hi def link mrxvtrcSBalign mrxvtrcStrVal hi def link mrxvtrcTSmode mrxvtrcStrVal hi def link mrxvtrcGrkKbd mrxvtrcStrVal hi def link mrxvtrcXftWt mrxvtrcStrVal hi def link mrxvtrcXftSl mrxvtrcStrVal hi def link mrxvtrcXftWd mrxvtrcStrVal hi def link mrxvtrcXftHt mrxvtrcStrVal hi def link mrxvtrcPedit mrxvtrcStrVal hi def link mrxvtrcMod mrxvtrcStrVal hi def link mrxvtrcSelSty mrxvtrcStrVal hi def link mrxvtrcMacro Identifier hi def link mrxvtrcKey mrxvtrcClass hi def link mrxvtrcTitle mrxvtrcStrVal hi def link mrxvtrcShell Special hi def link mrxvtrcCmd PreProc hi def link mrxvtrcSubwin mrxvtrcStrVal let b:current_syntax = "mrxvtrc" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/msidl.vim000066400000000000000000000073661267703067000174470ustar00rootroot00000000000000" Vim syntax file " Language: MS IDL (Microsoft dialect of Interface Description Language) " Maintainer: Vadim Zeitlin " Last Change: 2012 Feb 12 by Thilo Six " For version 5.x: Clear all syntax items " 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:cpo_save = &cpo set cpo&vim " 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 else command -nargs=+ HiLink hi def link 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" let &cpo = s:cpo_save unlet s:cpo_save " vi: set ts=8 sw=4: vim-7.4.1689/runtime/syntax/msmessages.vim000066400000000000000000000144151267703067000204770ustar00rootroot00000000000000" Vim syntax file " Language: MS Message Text files (*.mc) " Maintainer: Kevin Locke " Last Change: 2008 April 09 " Location: http://kevinlocke.name/programs/vim/syntax/msmessages.vim " See format description at " This file is based on the rc.vim and 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 MS Messages keywords syn case ignore syn keyword msmessagesIdentifier MessageIdTypedef syn keyword msmessagesIdentifier SeverityNames syn keyword msmessagesIdentifier FacilityNames syn keyword msmessagesIdentifier LanguageNames syn keyword msmessagesIdentifier OutputBase syn keyword msmessagesIdentifier MessageId syn keyword msmessagesIdentifier Severity syn keyword msmessagesIdentifier Facility syn keyword msmessagesIdentifier OutputBase syn match msmessagesIdentifier /\/ nextgroup=msmessagesIdentEq skipwhite syn match msmessagesIdentEq transparent /=/ nextgroup=msmessagesIdentDef skipwhite contained syn match msmessagesIdentDef display /\w\+/ contained " Note: The Language keyword is highlighted as part of an msmessagesLangEntry " Set value syn case match syn region msmessagesSet start="(" end=")" transparent fold contains=msmessagesName keepend syn match msmessagesName /\w\+/ nextgroup=msmessagesSetEquals skipwhite contained syn match msmessagesSetEquals /=/ display transparent nextgroup=msmessagesNumVal skipwhite contained syn match msmessagesNumVal display transparent "\<\d\|\.\d" contains=msmessagesNumber,msmessagesFloat,msmessagesOctalError,msmessagesOctal nextgroup=msmessagesValSep syn match msmessagesValSep /:/ display nextgroup=msmessagesNameDef contained syn match msmessagesNameDef /\w\+/ display contained " Comments are converted to C source (by removing leading ;) " So we highlight the comments as C syn include @msmessagesC syntax/c.vim unlet b:current_syntax syn region msmessagesCComment matchgroup=msmessagesComment start=/;/ end=/$/ contains=@msmessagesC keepend " String and Character constants " Highlight special characters (those which have a escape) differently syn case ignore syn region msmessagesLangEntry start=/\\s*=\s*\S\+\s*$/hs=e+1 end=/^\./ contains=msmessagesFormat,msmessagesLangEntryEnd,msmessagesLanguage keepend syn match msmessagesLanguage /\" "hex number syn match msmessagesNumber display contained "\<0x\x\+\(u\=l\{0,2}\|ll\=u\)\>" " Flag the first zero of an octal number as something special syn match msmessagesOctal display contained "\<0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=msmessagesOctalZero syn match msmessagesOctalZero display contained "\<0" " flag an octal number with wrong digits syn match msmessagesOctalError display contained "\<0\o*[89]\d*" syn match msmessagesFloat display contained "\d\+f" "floating point number, with dot, optional exponent syn match msmessagesFloat display contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=" "floating point number, starting with a dot, optional exponent syn match msmessagesFloat display contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>" "floating point number, without dot, with exponent syn match msmessagesFloat display contained "\d\+e[-+]\=\d\+[fl]\=\>" "hexadecimal floating point number, optional leading digits, with dot, with exponent syn match msmessagesFloat display contained "0x\x*\.\x\+p[-+]\=\d\+[fl]\=\>" "hexadecimal floating point number, with leading digits, optional dot, with exponent syn match msmessagesFloat display contained "0x\x\+\.\=p[-+]\=\d\+[fl]\=\>" " Types (used in MessageIdTypedef statement) syn case match syn keyword msmessagesType int long short char syn keyword msmessagesType signed unsigned syn keyword msmessagesType size_t ssize_t sig_atomic_t syn keyword msmessagesType int8_t int16_t int32_t int64_t syn keyword msmessagesType uint8_t uint16_t uint32_t uint64_t syn keyword msmessagesType int_least8_t int_least16_t int_least32_t int_least64_t syn keyword msmessagesType uint_least8_t uint_least16_t uint_least32_t uint_least64_t syn keyword msmessagesType int_fast8_t int_fast16_t int_fast32_t int_fast64_t syn keyword msmessagesType uint_fast8_t uint_fast16_t uint_fast32_t uint_fast64_t syn keyword msmessagesType intptr_t uintptr_t syn keyword msmessagesType intmax_t uintmax_t " Add some Windows datatypes that will be common in msmessages files syn keyword msmessagesType BYTE CHAR SHORT SIZE_T SSIZE_T TBYTE TCHAR UCHAR USHORT syn keyword msmessagesType DWORD DWORDLONG DWORD32 DWORD64 syn keyword msmessagesType INT INT32 INT64 UINT UINT32 UINT64 syn keyword msmessagesType LONG LONGLONG LONG32 LONG64 syn keyword msmessagesType ULONG ULONGLONG ULONG32 ULONG64 " Sync to language entries, since they should be most common syn sync match msmessagesLangSync grouphere msmessagesLangEntry "\ " 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 :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 :p:h/lite.vim " Msql Region syn region msqlRegion matchgroup=Delimiter 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/mupad.vim000066400000000000000000000366371267703067000174500ustar00rootroot00000000000000" Vim syntax file " Language: MuPAD source " Maintainer: Dave Silvia " Filenames: *.mu " Date: 6/30/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 " Set default highlighting to Win2k if !exists("mupad_cmdextversion") let mupad_cmdextversion = 2 endif syn case match syn match mupadComment "//\p*$" syn region mupadComment start="/\*" end="\*/" syn region mupadString start="\"" skip=/\\"/ end="\"" syn match mupadOperator "(\|)\|:=\|::\|:\|;" " boolean syn keyword mupadOperator and or not xor syn match mupadOperator "==>\|\<=\>" " Informational syn keyword mupadSpecial FILEPATH NOTEBOOKFILE NOTEBOOKPATH " Set-able, e.g., DIGITS:=10 syn keyword mupadSpecial DIGITS HISTORY LEVEL syn keyword mupadSpecial MAXLEVEL MAXDEPTH ORDER syn keyword mupadSpecial TEXTWIDTH " Set-able, e.g., PRETTYPRINT:=TRUE syn keyword mupadSpecial PRETTYPRINT " Set-able, e.g., LIBPATH:="C:\\MuPAD Pro\\mylibdir" or LIBPATH:="/usr/MuPAD Pro/mylibdir" syn keyword mupadSpecial LIBPATH PACKAGEPATH syn keyword mupadSpecial READPATH TESTPATH WRITEPATH " Symbols and Constants syn keyword mupadDefine FAIL NIL syn keyword mupadDefine TRUE FALSE UNKNOWN syn keyword mupadDefine complexInfinity infinity syn keyword mupadDefine C_ CATALAN E EULER I PI Q_ R_ syn keyword mupadDefine RD_INF RD_NINF undefined unit universe Z_ " print() directives syn keyword mupadDefine Unquoted NoNL KeepOrder Typeset " domain specifics syn keyword mupadStatement domain begin end_domain end syn keyword mupadIdentifier inherits category axiom info doc interface " basic programming statements syn keyword mupadStatement proc begin end_proc syn keyword mupadUnderlined name local option save syn keyword mupadConditional if then elif else end_if syn keyword mupadConditional case of do break end_case syn keyword mupadRepeat for do next break end_for syn keyword mupadRepeat while do next break end_while syn keyword mupadRepeat repeat next break until end_repeat " domain packages/libraries syn keyword mupadType detools import linalg numeric numlib plot polylib syn match mupadType '\' "syn keyword mupadFunction contains " Functions dealing with prime numbers syn keyword mupadFunction phi invphi mersenne nextprime numprimedivisors syn keyword mupadFunction pollard prevprime primedivisors " Functions operating on Lists, Matrices, Sets, ... syn keyword mupadFunction array _index " Evaluation syn keyword mupadFunction float contains " stdlib syn keyword mupadFunction _exprseq _invert _lazy_and _lazy_or _negate syn keyword mupadFunction _stmtseq _invert intersect minus union syn keyword mupadFunction Ci D Ei O Re Im RootOf Si syn keyword mupadFunction Simplify syn keyword mupadFunction abs airyAi airyBi alias unalias anames append syn keyword mupadFunction arcsin arccos arctan arccsc arcsec arccot syn keyword mupadFunction arcsinh arccosh arctanh arccsch arcsech arccoth syn keyword mupadFunction arg args array assert assign assignElements syn keyword mupadFunction assume assuming asympt bernoulli syn keyword mupadFunction besselI besselJ besselK besselY beta binomial bool syn keyword mupadFunction bytes card syn keyword mupadFunction ceil floor round trunc syn keyword mupadFunction coeff coerce collect combine copyClosure syn keyword mupadFunction conjugate content context contfrac syn keyword mupadFunction debug degree degreevec delete _delete denom syn keyword mupadFunction densematrix diff dilog dirac discont div _div syn keyword mupadFunction divide domtype doprint erf erfc error eval evalassign syn keyword mupadFunction evalp exp expand export unexport expose expr syn keyword mupadFunction expr2text external extnops extop extsubsop syn keyword mupadFunction fact fact2 factor fclose finput fname fopen fprint syn keyword mupadFunction fread ftextinput readbitmap readdata pathname syn keyword mupadFunction protocol read readbytes write writebytes syn keyword mupadFunction float frac frame _frame frandom freeze unfreeze syn keyword mupadFunction funcenv gamma gcd gcdex genident genpoly syn keyword mupadFunction getpid getprop ground has hastype heaviside help syn keyword mupadFunction history hold hull hypergeom icontent id syn keyword mupadFunction ifactor igamma igcd igcdex ilcm in _in syn keyword mupadFunction indets indexval info input int int2text syn keyword mupadFunction interpolate interval irreducible is syn keyword mupadFunction isprime isqrt iszero ithprime kummerU lambertW syn keyword mupadFunction last lasterror lcm lcoeff ldegree length syn keyword mupadFunction level lhs rhs limit linsolve lllint syn keyword mupadFunction lmonomial ln loadmod loadproc log lterm syn keyword mupadFunction match map mapcoeffs maprat matrix max min syn keyword mupadFunction mod modp mods monomials multcoeffs new syn keyword mupadFunction newDomain _next nextprime nops syn keyword mupadFunction norm normal nterms nthcoeff nthmonomial nthterm syn keyword mupadFunction null numer ode op operator package syn keyword mupadFunction pade partfrac patchlevel pdivide syn keyword mupadFunction piecewise plot plotfunc2d plotfunc3d syn keyword mupadFunction poly poly2list polylog powermod print syn keyword mupadFunction product protect psi quit _quit radsimp random rationalize syn keyword mupadFunction rec rectform register reset return revert syn keyword mupadFunction rewrite select series setuserinfo share sign signIm syn keyword mupadFunction simplify syn keyword mupadFunction sin cos tan csc sec cot syn keyword mupadFunction sinh cosh tanh csch sech coth syn keyword mupadFunction slot solve syn keyword mupadFunction pdesolve matlinsolve matlinsolveLU toeplitzSolve syn keyword mupadFunction vandermondeSolve fsolve odesolve odesolve2 syn keyword mupadFunction polyroots polysysroots odesolveGeometric syn keyword mupadFunction realroot realroots mroots lincongruence syn keyword mupadFunction msqrts syn keyword mupadFunction sort split sqrt strmatch strprint syn keyword mupadFunction subs subset subsex subsop substring sum syn keyword mupadFunction surd sysname sysorder system table taylor tbl2text syn keyword mupadFunction tcoeff testargs testeq testtype text2expr syn keyword mupadFunction text2int text2list text2tbl rtime time syn keyword mupadFunction traperror type unassume unit universe syn keyword mupadFunction unloadmod unprotect userinfo val version syn keyword mupadFunction warning whittakerM whittakerW zeta zip " graphics plot:: syn keyword mupadFunction getDefault setDefault copy modify Arc2d Arrow2d syn keyword mupadFunction Arrow3d Bars2d Bars3d Box Boxplot Circle2d Circle3d syn keyword mupadFunction Cone Conformal Curve2d Curve3d Cylinder Cylindrical syn keyword mupadFunction Density Ellipse2d Function2d Function3d Hatch syn keyword mupadFunction Histogram2d HOrbital Implicit2d Implicit3d syn keyword mupadFunction Inequality Iteration Line2d Line3d Lsys Matrixplot syn keyword mupadFunction MuPADCube Ode2d Ode3d Parallelogram2d Parallelogram3d syn keyword mupadFunction Piechart2d Piechart3d Point2d Point3d Polar syn keyword mupadFunction Polygon2d Polygon3d Raster Rectangle Sphere syn keyword mupadFunction Ellipsoid Spherical Sum Surface SurfaceSet syn keyword mupadFunction SurfaceSTL Tetrahedron Hexahedron Octahedron syn keyword mupadFunction Dodecahedron Icosahedron Text2d Text3d Tube Turtle syn keyword mupadFunction VectorField2d XRotate ZRotate Canvas CoordinateSystem2d syn keyword mupadFunction CoordinateSystem3d Group2d Group3d Scene2d Scene3d ClippingBox syn keyword mupadFunction Rotate2d Rotate3d Scale2d Scale3d Transform2d syn keyword mupadFunction Transform3d Translate2d Translate3d AmbientLight syn keyword mupadFunction Camera DistantLight PointLight SpotLight " graphics Attributes " graphics Output Attributes syn keyword mupadIdentifier OutputFile OutputOptions " graphics Defining Attributes syn keyword mupadIdentifier Angle AngleRange AngleBegin AngleEnd syn keyword mupadIdentifier Area Axis AxisX AxisY AxisZ Base Top syn keyword mupadIdentifier BaseX TopX BaseY TopY BaseZ TopZ syn keyword mupadIdentifier BaseRadius TopRadius Cells syn keyword mupadIdentifier Center CenterX CenterY CenterZ syn keyword mupadIdentifier Closed ColorData CommandList Contours CoordinateType syn keyword mupadIdentifier Data DensityData DensityFunction From To syn keyword mupadIdentifier FromX ToX FromY ToY FromZ ToZ syn keyword mupadIdentifier Function FunctionX FunctionY FunctionZ syn keyword mupadIdentifier Function1 Function2 Baseline syn keyword mupadIdentifier Generations RotationAngle IterationRules StartRule StepLength syn keyword mupadIdentifier TurtleRules Ground Heights Moves Inequalities syn keyword mupadIdentifier InputFile Iterations StartingPoint syn keyword mupadIdentifier LineColorFunction FillColorFunction syn keyword mupadIdentifier Matrix2d Matrix3d syn keyword mupadIdentifier MeshList MeshListType MeshListNormals syn keyword mupadIdentifier MagneticQuantumNumber MomentumQuantumNumber PrincipalQuantumNumber syn keyword mupadIdentifier Name Normal NormalX NormalY NormalZ syn keyword mupadIdentifier ParameterName ParameterBegin ParameterEnd ParameterRange syn keyword mupadIdentifier Points2d Points3d Radius RadiusFunction syn keyword mupadIdentifier Position PositionX PositionY PositionZ syn keyword mupadIdentifier Scale ScaleX ScaleY ScaleZ Shift ShiftX ShiftY ShiftZ syn keyword mupadIdentifier SemiAxes SemiAxisX SemiAxisY SemiAxisZ syn keyword mupadIdentifier Tangent1 Tangent1X Tangent1Y Tangent1Z syn keyword mupadIdentifier Tangent2 Tangent2X Tangent2Y Tangent2Z syn keyword mupadIdentifier Text TextOrientation TextRotation syn keyword mupadIdentifier UName URange UMin UMax VName VRange VMin VMax syn keyword mupadIdentifier XName XRange XMin XMax YName YRange YMin YMax syn keyword mupadIdentifier ZName ZRange ZMin ZMax ViewingBox syn keyword mupadIdentifier ViewingBoxXMin ViewingBoxXMax ViewingBoxXRange syn keyword mupadIdentifier ViewingBoxYMin ViewingBoxYMax ViewingBoxYRange syn keyword mupadIdentifier ViewingBoxZMin ViewingBoxZMax ViewingBoxZRange syn keyword mupadIdentifier Visible " graphics Axis Attributes syn keyword mupadIdentifier Axes AxesInFront AxesLineColor AxesLineWidth syn keyword mupadIdentifier AxesOrigin AxesOriginX AxesOriginY AxesOriginZ syn keyword mupadIdentifier AxesTips AxesTitleAlignment syn keyword mupadIdentifier AxesTitleAlignmentX AxesTitleAlignmentY AxesTitleAlignmentZ syn keyword mupadIdentifier AxesTitles XAxisTitle YAxisTitle ZAxisTitle syn keyword mupadIdentifier AxesVisible XAxisVisible YAxisVisible ZAxisVisible syn keyword mupadIdentifier YAxisTitleOrientation " graphics Tick Marks Attributes syn keyword mupadIdentifier TicksAnchor XTicksAnchor YTicksAnchor ZTicksAnchor syn keyword mupadIdentifier TicksAt XTicksAt YTicksAt ZTicksAt syn keyword mupadIdentifier TicksBetween XTicksBetween YTicksBetween ZTicksBetween syn keyword mupadIdentifier TicksDistance XTicksDistance YTicksDistance ZTicksDistance syn keyword mupadIdentifier TicksNumber XTicksNumber YTicksNumber ZTicksNumber syn keyword mupadIdentifier TicksVisible XTicksVisible YTicksVisible ZTicksVisible syn keyword mupadIdentifier TicksLength TicksLabelStyle syn keyword mupadIdentifier XTicksLabelStyle YTicksLabelStyle ZTicksLabelStyle syn keyword mupadIdentifier TicksLabelsVisible syn keyword mupadIdentifier XTicksLabelsVisible YTicksLabelsVisible ZTicksLabelsVisible " graphics Grid Lines Attributes syn keyword mupadIdentifier GridInFront GridLineColor SubgridLineColor syn keyword mupadIdentifier GridLineStyle SubgridLineStyle GridLineWidth SubgridLineWidth syn keyword mupadIdentifier GridVisible XGridVisible YGridVisible ZGridVisible syn keyword mupadIdentifier SubgridVisible XSubgridVisible YSubgridVisible ZSubgridVisible " graphics Animation Attributes syn keyword mupadIdentifier Frames TimeRange TimeBegin TimeEnd syn keyword mupadIdentifier VisibleAfter VisibleBefore VisibleFromTo syn keyword mupadIdentifier VisibleAfterEnd VisibleBeforeBegin " graphics Annotation Attributes syn keyword mupadIdentifier Footer Header FooterAlignment HeaderAlignment syn keyword mupadIdentifier HorizontalAlignment TitleAlignment VerticalAlignment syn keyword mupadIdentifier Legend LegendEntry LegendText syn keyword mupadIdentifier LegendAlignment LegendPlacement LegendVisible syn keyword mupadIdentifier Title Titles syn keyword mupadIdentifier TitlePosition TitlePositionX TitlePositionY TitlePositionZ " graphics Layout Attributes syn keyword mupadIdentifier Bottom Left Height Width Layout Rows Columns syn keyword mupadIdentifier Margin BottomMargin TopMargin LeftMargin RightMargin syn keyword mupadIdentifier OutputUnits Spacing " graphics Calculation Attributes syn keyword mupadIdentifier AdaptiveMesh DiscontinuitySearch Mesh SubMesh syn keyword mupadIdentifier UMesh USubMesh VMesh VSubMesh syn keyword mupadIdentifier XMesh XSubMesh YMesh YSubMesh Zmesh " graphics Camera and Lights Attributes syn keyword mupadIdentifier CameraCoordinates CameraDirection syn keyword mupadIdentifier CameraDirectionX CameraDirectionY CameraDirectionZ syn keyword mupadIdentifier FocalPoint FocalPointX FocalPointY FocalPointZ syn keyword mupadIdentifier LightColor Lighting LightIntensity OrthogonalProjection syn keyword mupadIdentifier SpotAngle ViewingAngle syn keyword mupadIdentifier Target TargetX TargetY TargetZ " graphics Presentation Style and Fonts Attributes syn keyword mupadIdentifier ArrowLength syn keyword mupadIdentifier AxesTitleFont FooterFont HeaderFont LegendFont syn keyword mupadIdentifier TextFont TicksLabelFont TitleFont syn keyword mupadIdentifier BackgroundColor BackgroundColor2 BackgroundStyle syn keyword mupadIdentifier BackgroundTransparent Billboarding BorderColor BorderWidth syn keyword mupadIdentifier BoxCenters BoxWidths DrawMode Gap XGap YGap syn keyword mupadIdentifier Notched NotchWidth Scaling YXRatio ZXRatio syn keyword mupadIdentifier VerticalAsymptotesVisible VerticalAsymptotesStyle syn keyword mupadIdentifier VerticalAsymptotesColor VerticalAsymptotesWidth " graphics Line Style Attributes syn keyword mupadIdentifier LineColor LineColor2 LineColorType LineStyle syn keyword mupadIdentifier LinesVisible ULinesVisible VLinesVisible XLinesVisible syn keyword mupadIdentifier YLinesVisible LineWidth MeshVisible " graphics Point Style Attributes syn keyword mupadIdentifier PointColor PointSize PointStyle PointsVisible " graphics Surface Style Attributes syn keyword mupadIdentifier BarStyle Shadows Color Colors FillColor FillColor2 syn keyword mupadIdentifier FillColorTrue FillColorFalse FillColorUnknown FillColorType syn keyword mupadIdentifier Filled FillPattern FillPatterns FillStyle syn keyword mupadIdentifier InterpolationStyle Shading UseNormals " graphics Arrow Style Attributes syn keyword mupadIdentifier TipAngle TipLength TipStyle TubeDiameter syn keyword mupadIdentifier Tubular " graphics meta-documentation Attributes syn keyword mupadIdentifier objectGroupsListed if version >= 508 || !exists("did_mupad_syntax_inits") if version < 508 let did_mupad_syntax_inits = 1 command -nargs=+ HiLink hi link else command -nargs=+ HiLink hi def link endif HiLink mupadComment Comment HiLink mupadString String HiLink mupadOperator Operator HiLink mupadSpecial Special HiLink mupadStatement Statement HiLink mupadUnderlined Underlined HiLink mupadConditional Conditional HiLink mupadRepeat Repeat HiLink mupadFunction Function HiLink mupadType Type HiLink mupadDefine Define HiLink mupadIdentifier Identifier delcommand HiLink endif " TODO More comprehensive listing. vim-7.4.1689/runtime/syntax/mush.vim000066400000000000000000000322321267703067000173010ustar00rootroot00000000000000" MUSHcode syntax file " Maintainer: Rick Bird " Based on vim Syntax file by: Bek Oberin " Last Updated: Fri Nov 04 20:28:15 2005 " " For version 5.x: Clear all syntax items " 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 accent accname acos add after align syntax keyword mushFunction contained allof alphamax alphamin and andflags syntax keyword mushFunction contained andlflags andlpowers andpowers ansi aposs art syntax keyword mushFunction contained asin atan atan2 atrlock attrcnt band baseconv syntax keyword mushFunction contained beep before blank2tilde bnand bnot bor bound syntax keyword mushFunction contained brackets break bxor cand cansee capstr case syntax keyword mushFunction contained caseall cat ceil center checkpass children syntax keyword mushFunction contained chr clone cmds cnetpost comp con config conn syntax keyword mushFunction contained controls convsecs convtime convutcsecs cor syntax keyword mushFunction contained cos create ctime ctu dec decrypt default syntax keyword mushFunction contained delete die dig digest dist2d dist3d div syntax keyword mushFunction contained division divscope doing downdiv dynhelp e syntax keyword mushFunction contained edefault edit element elements elist elock syntax keyword mushFunction contained emit empire empower encrypt endtag entrances syntax keyword mushFunction contained eq escape etimefmt eval exit exp extract fdiv syntax keyword mushFunction contained filter filterbool findable first firstof syntax keyword mushFunction contained flags flip floor floordiv fmod fold syntax keyword mushFunction contained folderstats followers following foreach syntax keyword mushFunction contained fraction fullname functions get get_eval grab syntax keyword mushFunction contained graball grep grepi gt gte hasattr hasattrp syntax keyword mushFunction contained hasattrpval hasattrval hasdivpower hasflag syntax keyword mushFunction contained haspower haspowergroup hastype height hidden syntax keyword mushFunction contained home host hostname html idle idlesecs syntax keyword mushFunction contained idle_average idle_times idle_total if ifelse syntax keyword mushFunction contained ilev iname inc index indiv indivall insert syntax keyword mushFunction contained inum ipaddr isdaylight isdbref isint isnum syntax keyword mushFunction contained isword itemize items iter itext last lattr syntax keyword mushFunction contained lcon lcstr ldelete ldivisions left lemit syntax keyword mushFunction contained level lexits lflags link list lit ljust lmath syntax keyword mushFunction contained ln lnum loc localize locate lock loctree log syntax keyword mushFunction contained lparent lplayers lports lpos lsearch lsearchr syntax keyword mushFunction contained lstats lt lte lthings lvcon lvexits lvplayers syntax keyword mushFunction contained lvthings lwho mail maildstats mailfrom syntax keyword mushFunction contained mailfstats mailstats mailstatus mailsubject syntax keyword mushFunction contained mailtime map match matchall max mean median syntax keyword mushFunction contained member merge mid min mix mod modulo modulus syntax keyword mushFunction contained money mtime mudname mul munge mwho name nand syntax keyword mushFunction contained nattr ncon nearby neq nexits next nor not syntax keyword mushFunction contained nplayers nsemit nslemit nsoemit nspemit syntax keyword mushFunction contained nsremit nszemit nthings null num nvcon syntax keyword mushFunction contained nvexits nvplayers nvthings obj objeval objid syntax keyword mushFunction contained objmem oemit ooref open or ord orflags syntax keyword mushFunction contained orlflags orlpowers orpowers owner parent syntax keyword mushFunction contained parse pcreate pemit pi pickrand playermem syntax keyword mushFunction contained pmatch poll ports pos poss power powergroups syntax keyword mushFunction contained powers powover program prompt pueblo quitprog syntax keyword mushFunction contained quota r rand randword recv regedit regeditall syntax keyword mushFunction contained regeditalli regediti regmatch regmatchi syntax keyword mushFunction contained regrab regraball regraballi regrabi regrep syntax keyword mushFunction contained regrepi remainder remit remove repeat replace syntax keyword mushFunction contained rest restarts restarttime reswitch syntax keyword mushFunction contained reswitchall reswitchalli reswitchi reverse syntax keyword mushFunction contained revwords right rjust rloc rnum room root syntax keyword mushFunction contained round s scan scramble search secs secure sent syntax keyword mushFunction contained set setdiff setinter setq setr setunion sha0 syntax keyword mushFunction contained shl shr shuffle sign signal sin sort sortby syntax keyword mushFunction contained soundex soundlike soundslike space spellnum syntax keyword mushFunction contained splice sql sqlescape sqrt squish ssl syntax keyword mushFunction contained starttime stats stddev step strcat strinsert syntax keyword mushFunction contained stripaccents stripansi strlen strmatch syntax keyword mushFunction contained strreplace sub subj switch switchall t table syntax keyword mushFunction contained tag tagwrap tan tel terminfo textfile syntax keyword mushFunction contained tilde2blank time timefmt timestring tr syntax keyword mushFunction contained trigger trim trimpenn trimtiny trunc type u syntax keyword mushFunction contained ucstr udefault ufun uldefault ulocal updiv syntax keyword mushFunction contained utctime v vadd val valid vcross vdim vdot syntax keyword mushFunction contained version visible vmag vmax vmin vmul vsub syntax keyword mushFunction contained vtattr vtcount vtcreate vtdestroy vtlcon syntax keyword mushFunction contained vtloc vtlocate vtmaster vtname vtref vttel syntax keyword mushFunction contained vunit wait where width wipe wordpos words syntax keyword mushFunction contained wrap xcon xexits xget xor xplayers xthings syntax keyword mushFunction contained xvcon xvexits xvplayers xvthings zemit zfun syntax keyword mushFunction contained zmwho zone zwho " only highligh functions when they have an in-bracket immediately after syntax match mushFunctionBrackets "\i*(" contains=mushFunction " " regular mush commands syntax keyword mushAtCommandList contained @ALLHALT @ALLQUOTA @ASSERT @ATRCHOWN @ATRLOCK @ATTRIBUTE @BOOT syntax keyword mushAtCommandList contained @BREAK @CEMIT @CHANNEL @CHAT @CHOWN @CHOWNALL @CHZONE @CHZONEALL syntax keyword mushAtCommandList contained @CLOCK @CLONE @COBJ @COMMAND @CONFIG @CPATTR @CREATE @CRPLOG @DBCK syntax keyword mushAtCommandList contained @DECOMPILE @DESTROY @DIG @DISABLE @DIVISION @DOING @DOLIST @DRAIN syntax keyword mushAtCommandList contained @DUMP @EDIT @ELOCK @EMIT @EMPOWER @ENABLE @ENTRANCES @EUNLOCK @FIND syntax keyword mushAtCommandList contained @FIRSTEXIT @FLAG @FORCE @FUNCTION @EDIT @GREP @HALT @HIDE @HOOK @KICK syntax keyword mushAtCommandList contained @LEMIT @LEVEL @LINK @LIST @LISTMOTD @LOCK @LOG @LOGWIPE @LSET @MAIL @MALIAS syntax keyword mushAtCommandList contained @MAP @MOTD @MVATTR @NAME @NEWPASSWORD @NOTIFY @NSCEMIT @NSEMIT @NSLEMIT syntax keyword mushAtCommandList contained @NSOEMIT @NSPEMIT @NSPEMIT @NSREMIT @NSZEMIT @NUKE @OEMIT @OPEN @PARENT @PASSWORD syntax keyword mushAtCommandList contained @PCREATE @PEMIT @POLL @POOR @POWERLEVEL @PROGRAM @PROMPT @PS @PURGE @QUOTA syntax keyword mushAtCommandList contained @READCACHE @RECYCLE @REJECTMOTD @REMIT @RESTART @SCAN @SEARCH @SELECT @SET syntax keyword mushAtCommandList contained @SHUTDOWN @SITELOCK @SNOOP @SQL @SQUOTA @STATS @SWITCH @SWEEP @SWITCH @TELEPORT syntax keyword mushAtCommandList contained @TRIGGER @ULOCK @UNDESTROY @UNLINK @UNLOCK @UNRECYCLE @UPTIME @UUNLOCK @VERB syntax keyword mushAtCommandList contained @VERSION @WAIT @WALL @WARNINGS @WCHECK @WHEREIS @WIPE @ZCLONE @ZEMIT syntax match mushCommand "@\i\I*" contains=mushAtCommandList syntax keyword mushCommand AHELP ANEWS ATTRIB_SET BRIEF BRIEF BUY CHANGES DESERT syntax keyword mushCommand DISMISS DROP EMPTY ENTER EXAMINE FOLLOW GET GIVE GOTO syntax keyword mushCommand HELP HUH_COMMAND INVENTORY INVENTORY LOOK LEAVE LOOK syntax keyword mushCommand GOTO NEWS PAGE PAGE POSE RULES SAY SCORE SEMIPOSE syntax keyword mushCommand SPECIALNEWS TAKE TEACH THINK UNFOLLOW USE WHISPER WHISPER syntax keyword mushCommand WARN_ON_MISSING WHISPER WITH syntax match mushSpecial "\*\|!\|=\|-\|\\\|+" syntax match mushSpecial2 contained "\*" syn region mushString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=mushSpecial,mushSpecial2,@Spell 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 cluster mushCommentGroup contains=mushTodo syntax match mushComment "^\s*@@.*$" contains=mushTodo syntax match mushComment "^#[^define|^ifdef|^else|^pragma|^ifndef|^echo|^elif|^undef|^warning].*$" contains=mushTodo syntax match mushComment "^#$" contains=mushTodo syntax region mushComment matchgroup=mushCommentStart start="/@@" end="@@/" contains=@mushCommentGroup,mushCommentStartError,mushCommentString,@Spell syntax region mushCommentString contained start=+L\=\\\@" skip="\\$" end="$" end="//"me=s-1 contains=mushComment syn match mushPreCondit display "^\s*\(%:\|#\)\s*\(else\|endif\)\>" syn cluster mushPreProcGroup contains=mushPreCondit,mushIncluded,mushInclude,mushDefine,mushSpecial,mushString,mushCommentSkip,mushCommentString,@mushCommentGroup,mushCommentStartError syn region mushIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+ syn match mushIncluded display contained "<[^>]*>" syn match mushInclude display "^\s*\(%:\|#\)\s*include\>\s*["<]" contains=mushIncluded syn region mushDefine start="^\s*\(%:\|#\)\s*\(define\|undef\)\>" skip="\\$" end="$" end="//"me=s-1 contains=ALLBUT,@mushPreProcGroup,@Spell syn region mushPreProc start="^\s*\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@mushPreProcGroup 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 else command -nargs=+ HiLink hi def link endif " The default methods for highlighting. Can be overridden later HiLink mushAttribute Constant HiLink mushCommand Function HiLink mushNumber Number HiLink mushSetting PreProc HiLink mushFunction Statement HiLink mushVariable Identifier HiLink mushSpecial Special HiLink mushTodo Todo HiLink mushFlag Special HiLink mushIdentifier Identifier HiLink mushDefine Macro HiLink mushPreProc PreProc HiLink mushPreProcGroup PreProc HiLink mushPreCondit PreCondit HiLink mushIncluded cString HiLink mushInclude Include " Comments HiLink mushCommentStart mushComment HiLink mushComment Comment HiLink mushCommentString mushString delcommand HiLink endif let b:current_syntax = "mush" " mush: ts=17 vim-7.4.1689/runtime/syntax/muttrc.vim000066400000000000000000002362631267703067000176550ustar00rootroot00000000000000" Vim syntax file " Language: Mutt setup files " Original: Preben 'Peppe' Guldberg " Maintainer: Kyle Wheeler " Last Change: 2 Feb 2012 " This file covers mutt version 1.5.21 (and most of the mercurial tip) " Included are also a few features from 1.4.2.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 let s:cpo_save = &cpo set cpo&vim " Set the keyword characters if version < 600 set isk=@,48-57,_,- else setlocal isk=@,48-57,_,- endif " handling optional variables if !exists("use_mutt_sidebar") let use_mutt_sidebar=0 endif syn match muttrcComment "^# .*$" contains=@Spell syn match muttrcComment "^#[^ ].*$" 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 +[`|]+ syn match muttrcEscape +\\$+ " The variables takes the following arguments "syn match muttrcString contained "=\s*[^ #"'`]\+"lc=1 contains=muttrcEscape syn region muttrcString contained keepend start=+"+ms=e skip=+\\"+ end=+"+ contains=muttrcEscape,muttrcCommand,muttrcAction,muttrcShellString syn region muttrcString contained keepend start=+'+ms=e skip=+\\'+ end=+'+ contains=muttrcEscape,muttrcCommand,muttrcAction syn match muttrcStringNL contained skipwhite skipnl "\s*\\$" nextgroup=muttrcString,muttrcStringNL syn region muttrcShellString matchgroup=muttrcEscape keepend start=+`+ skip=+\\`+ end=+`+ contains=muttrcVarStr,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcCommand syn match muttrcRXChars contained /[^\\][][.*?+]\+/hs=s+1 syn match muttrcRXChars contained /[][|()][.*?+]*/ syn match muttrcRXChars contained /['"]^/ms=s+1 syn match muttrcRXChars contained /$['"]/me=e-1 syn match muttrcRXChars contained /\\/ " Why does muttrcRXString2 work with one \ when muttrcRXString requires two? syn region muttrcRXString contained skipwhite start=+'+ skip=+\\'+ end=+'+ contains=muttrcRXChars syn region muttrcRXString contained skipwhite start=+"+ skip=+\\"+ end=+"+ contains=muttrcRXChars syn region muttrcRXString contained skipwhite start=+[^ "'^]+ skip=+\\\s+ end=+\s+re=e-1 contains=muttrcRXChars " For some reason, skip refuses to match backslashes here... syn region muttrcRXString contained matchgroup=muttrcRXChars skipwhite start=+\^+ end=+[^\\]\s+re=e-1 contains=muttrcRXChars syn region muttrcRXString contained matchgroup=muttrcRXChars skipwhite start=+\^+ end=+$\s+ contains=muttrcRXChars syn region muttrcRXString2 contained skipwhite start=+'+ skip=+\'+ end=+'+ contains=muttrcRXChars syn region muttrcRXString2 contained skipwhite start=+"+ skip=+\"+ end=+"+ contains=muttrcRXChars " these must be kept synchronized with muttrcRXString, but are intended for " muttrcRXHooks syn region muttrcRXHookString contained keepend skipwhite start=+'+ skip=+\\'+ end=+'+ contains=muttrcRXString nextgroup=muttrcString,muttrcStringNL syn region muttrcRXHookString contained keepend skipwhite start=+"+ skip=+\\"+ end=+"+ contains=muttrcRXString nextgroup=muttrcString,muttrcStringNL syn region muttrcRXHookString contained keepend skipwhite start=+[^ "'^]+ skip=+\\\s+ end=+\s+re=e-1 contains=muttrcRXString nextgroup=muttrcString,muttrcStringNL syn region muttrcRXHookString contained keepend skipwhite start=+\^+ end=+[^\\]\s+re=e-1 contains=muttrcRXString nextgroup=muttrcString,muttrcStringNL syn region muttrcRXHookString contained keepend matchgroup=muttrcRXChars skipwhite start=+\^+ end=+$\s+ contains=muttrcRXString nextgroup=muttrcString,muttrcStringNL syn match muttrcRXHookStringNL contained skipwhite skipnl "\s*\\$" nextgroup=muttrcRXHookString,muttrcRXHookStringNL " these are exclusively for args lists (e.g. -rx pat pat pat ...) syn region muttrcRXPat contained keepend skipwhite start=+'+ skip=+\\'+ end=+'\s*+ contains=muttrcRXString nextgroup=muttrcRXPat syn region muttrcRXPat contained keepend skipwhite start=+"+ skip=+\\"+ end=+"\s*+ contains=muttrcRXString nextgroup=muttrcRXPat syn match muttrcRXPat contained /[^-'"#!]\S\+/ skipwhite contains=muttrcRXChars nextgroup=muttrcRXPat syn match muttrcRXDef contained "-rx\s\+" skipwhite nextgroup=muttrcRXPat syn match muttrcSpecial +\(['"]\)!\1+ syn match muttrcSetStrAssignment contained skipwhite /=\s*\%(\\\?\$\)\?[0-9A-Za-z_-]\+/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr contains=muttrcVariable,muttrcEscapedVariable syn region muttrcSetStrAssignment contained skipwhite keepend start=+=\s*"+hs=s+1 end=+"+ skip=+\\"+ nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr contains=muttrcString syn region muttrcSetStrAssignment contained skipwhite keepend start=+=\s*'+hs=s+1 end=+'+ skip=+\\'+ nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr contains=muttrcString syn match muttrcSetBoolAssignment contained skipwhite /=\s*\\\?\$\w\+/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr contains=muttrcVariable,muttrcEscapedVariable syn match muttrcSetBoolAssignment contained skipwhite /=\s*\%(yes\|no\)/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn match muttrcSetBoolAssignment contained skipwhite /=\s*"\%(yes\|no\)"/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn match muttrcSetBoolAssignment contained skipwhite /=\s*'\%(yes\|no\)'/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn match muttrcSetQuadAssignment contained skipwhite /=\s*\\\?\$\w\+/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr contains=muttrcVariable,muttrcEscapedVariable syn match muttrcSetQuadAssignment contained skipwhite /=\s*\%(ask-\)\?\%(yes\|no\)/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn match muttrcSetQuadAssignment contained skipwhite /=\s*"\%(ask-\)\?\%(yes\|no\)"/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn match muttrcSetQuadAssignment contained skipwhite /=\s*'\%(ask-\)\?\%(yes\|no\)'/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn match muttrcSetNumAssignment contained skipwhite /=\s*\\\?\$\w\+/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr contains=muttrcVariable,muttrcEscapedVariable syn match muttrcSetNumAssignment contained skipwhite /=\s*\d\+/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn match muttrcSetNumAssignment contained skipwhite /=\s*"\d\+"/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn match muttrcSetNumAssignment contained skipwhite /=\s*'\d\+'/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr " 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\|C[Cc]\|B[Cc][Cc]\|Reply-To\|Subject\|Return-Path\|Received\|Date\|Replied\|Attach\)\>:\=" syn match muttrcKeySpecial contained +\%(\\[Cc'"]\|\^\|\\[01]\d\{2}\)+ syn match muttrcKey contained "\S\+" contains=muttrcKeySpecial,muttrcKeyName syn region muttrcKey contained start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=muttrcKeySpecial,muttrcKeyName syn region muttrcKey contained start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=muttrcKeySpecial,muttrcKeyName syn match muttrcKeyName contained "\" syn match muttrcKeyName contained "\\[trne]" syn match muttrcKeyName contained "\c<\%(BackSpace\|BackTab\|Delete\|Down\|End\|Enter\|Esc\|Home\|Insert\|Left\|PageDown\|PageUp\|Return\|Right\|Space\|Tab\|Up\)>" syn match muttrcKeyName contained "" syn keyword muttrcVarBool skipwhite contained allow_8bit allow_ansi arrow_cursor ascii_chars askbcc askcc attach_split auto_tag autoedit beep beep_new nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained bounce_delivered braille_friendly check_new check_mbox_size nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained collapse_unread confirmappend confirmcreate crypt_autoencrypt nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained crypt_autopgp crypt_autosign crypt_autosmime crypt_replyencrypt nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained crypt_replysign crypt_replysignencrypted crypt_timestamp nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained crypt_use_gpgme crypt_use_pka delete_untag digest_collapse duplicate_threads nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained edit_hdrs edit_headers encode_from envelope_from fast_reply nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained fcc_clear followup_to force_name forw_decode nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained forw_decrypt forw_quote forward_decode forward_decrypt nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained forward_quote hdrs header help hidden_host hide_limited nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained hide_missing hide_thread_subject hide_top_limited nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained hide_top_missing honor_disposition ignore_linear_white_space ignore_list_reply_to imap_check_subscribed nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained imap_list_subscribed imap_passive imap_peek imap_servernoise nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained implicit_autoview include_onlyfirst keep_flagged nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained mailcap_sanitize maildir_header_cache_verify maildir_trash nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained mark_old markers menu_move_off menu_scroll message_cache_clean meta_key nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained metoo mh_purge mime_forward_decode narrow_tree pager_stop nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained pgp_auto_decode pgp_auto_traditional pgp_autoencrypt nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained pgp_autoinline pgp_autosign pgp_check_exit nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained pgp_create_traditional pgp_ignore_subkeys pgp_long_ids nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained pgp_replyencrypt pgp_replyinline pgp_replysign nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained pgp_replysignencrypted pgp_retainable_sigs pgp_show_unusable nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained pgp_strict_enc pgp_use_gpg_agent pipe_decode pipe_split nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained pop_auth_try_all pop_last print_decode print_split nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained prompt_after read_only reply_self resolve reverse_alias nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained reverse_name reverse_realname rfc2047_parameters save_address nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained save_empty save_name score sig_dashes sig_on_top nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained smart_wrap smime_ask_cert_label smime_decrypt_use_default_key nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained smime_is_default sort_re ssl_force_tls ssl_use_sslv2 nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained ssl_use_sslv3 ssl_use_tlsv1 ssl_usesystemcerts ssl_verify_dates ssl_verify_host status_on_top nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained strict_mime strict_threads suspend text_flowed thorough_search nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained thread_received tilde uncollapse_jump use_8bitmime nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained use_domain use_envelope_from use_from use_idn use_ipv6 nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained user_agent wait_key weed wrap_search write_bcc nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained noallow_8bit noallow_ansi noarrow_cursor noascii_chars noaskbcc nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained noaskcc noattach_split noauto_tag noautoedit nobeep nobeep_new nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained nobounce_delivered nobraille_friendly nocheck_new nocollapse_unread nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained noconfirmappend noconfirmcreate nocrypt_autoencrypt nocrypt_autopgp nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained nocrypt_autosign nocrypt_autosmime nocrypt_replyencrypt nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained nocrypt_replysign nocrypt_replysignencrypted nocrypt_timestamp nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained nocrypt_use_gpgme nodelete_untag nodigest_collapse noduplicate_threads nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained noedit_hdrs noedit_headers noencode_from noenvelope_from nofast_reply nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained nofcc_clear nofollowup_to noforce_name noforw_decode nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained noforw_decrypt noforw_quote noforward_decode noforward_decrypt nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained noforward_quote nohdrs noheader nohelp nohidden_host nohide_limited nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained nohide_missing nohide_thread_subject nohide_top_limited nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained nohide_top_missing nohonor_disposition noignore_list_reply_to noimap_check_subscribed nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained noimap_list_subscribed noimap_passive noimap_peek noimap_servernoise nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained noimplicit_autoview noinclude_onlyfirst nokeep_flagged nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained nomailcap_sanitize nomaildir_header_cache_verify nomaildir_trash nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained nomark_old nomarkers nomenu_move_off nomenu_scroll nometa_key nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained nometoo nomh_purge nomime_forward_decode nonarrow_tree nopager_stop nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained nopgp_auto_decode nopgp_auto_traditional nopgp_autoencrypt nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained nopgp_autoinline nopgp_autosign nopgp_check_exit nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained nopgp_create_traditional nopgp_ignore_subkeys nopgp_long_ids nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained nopgp_replyencrypt nopgp_replyinline nopgp_replysign nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained nopgp_replysignencrypted nopgp_retainable_sigs nopgp_show_unusable nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained nopgp_strict_enc nopgp_use_gpg_agent nopipe_decode nopipe_split nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained nopop_auth_try_all nopop_last noprint_decode noprint_split nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained noprompt_after noread_only noreply_self noresolve noreverse_alias nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained noreverse_name noreverse_realname norfc2047_parameters nosave_address nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained nosave_empty nosave_name noscore nosig_dashes nosig_on_top nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained nosmart_wrap nosmime_ask_cert_label nosmime_decrypt_use_default_key nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained nosmime_is_default nosort_re nossl_force_tls nossl_use_sslv2 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained nossl_use_sslv3 nossl_use_tlsv1 nossl_usesystemcerts nostatus_on_top nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained nostrict_threads nosuspend notext_flowed nothorough_search nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained nothread_received notilde nouncollapse_jump nouse_8bitmime nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained nouse_domain nouse_envelope_from nouse_from nouse_idn nouse_ipv6 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained nouser_agent nowait_key noweed nowrap_search nowrite_bcc nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained invallow_8bit invallow_ansi invarrow_cursor invascii_chars invaskbcc nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained invaskcc invattach_split invauto_tag invautoedit invbeep invbeep_new nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained invbounce_delivered invbraille_friendly invcheck_new invcollapse_unread nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained invconfirmappend invconfirmcreate invcrypt_autoencrypt invcrypt_autopgp nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained invcrypt_autosign invcrypt_autosmime invcrypt_replyencrypt nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained invcrypt_replysign invcrypt_replysignencrypted invcrypt_timestamp nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained invcrypt_use_gpgme invdelete_untag invdigest_collapse invduplicate_threads nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained invedit_hdrs invedit_headers invencode_from invenvelope_from invfast_reply nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained invfcc_clear invfollowup_to invforce_name invforw_decode nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained invforw_decrypt invforw_quote invforward_decode invforward_decrypt nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained invforward_quote invhdrs invheader invhelp invhidden_host invhide_limited nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained invhide_missing invhide_thread_subject invhide_top_limited nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained invhide_top_missing invhonor_disposition invignore_list_reply_to invimap_check_subscribed nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained invimap_list_subscribed invimap_passive invimap_peek invimap_servernoise nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained invimplicit_autoview invinclude_onlyfirst invkeep_flagged nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained invmailcap_sanitize invmaildir_header_cache_verify invmaildir_trash nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained invmark_old invmarkers invmenu_move_off invmenu_scroll invmeta_key nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained invmetoo invmh_purge invmime_forward_decode invnarrow_tree invpager_stop nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained invpgp_auto_decode invpgp_auto_traditional invpgp_autoencrypt nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained invpgp_autoinline invpgp_autosign invpgp_check_exit nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained invpgp_create_traditional invpgp_ignore_subkeys invpgp_long_ids nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained invpgp_replyencrypt invpgp_replyinline invpgp_replysign nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained invpgp_replysignencrypted invpgp_retainable_sigs invpgp_show_unusable nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained invpgp_strict_enc invpgp_use_gpg_agent invpipe_decode invpipe_split nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained invpop_auth_try_all invpop_last invprint_decode invprint_split nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained invprompt_after invread_only invreply_self invresolve invreverse_alias nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained invreverse_name invreverse_realname invrfc2047_parameters invsave_address nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained invsave_empty invsave_name invscore invsig_dashes invsig_on_top nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained invsmart_wrap invsmime_ask_cert_label invsmime_decrypt_use_default_key nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained invsmime_is_default invsort_re invssl_force_tls invssl_use_sslv2 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained invssl_use_sslv3 invssl_use_tlsv1 invssl_usesystemcerts invstatus_on_top nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained invstrict_threads invsuspend invtext_flowed invthorough_search nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained invthread_received invtilde invuncollapse_jump invuse_8bitmime nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained invuse_domain invuse_envelope_from invuse_from invuse_idn invuse_ipv6 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarBool skipwhite contained invuser_agent invwait_key invweed invwrap_search invwrite_bcc nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr if use_mutt_sidebar == 1 syn keyword muttrcVarBool skipwhite contained sidebar_visible sidebar_sort nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr endif syn keyword muttrcVarQuad skipwhite contained abort_nosubject abort_unmodified bounce copy nextgroup=muttrcSetQuadAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarQuad skipwhite contained crypt_verify_sig delete fcc_attach forward_edit honor_followup_to nextgroup=muttrcSetQuadAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarQuad skipwhite contained include mime_forward mime_forward_rest mime_fwd move nextgroup=muttrcSetQuadAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarQuad skipwhite contained pgp_mime_auto pgp_verify_sig pop_delete pop_reconnect nextgroup=muttrcSetQuadAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarQuad skipwhite contained postpone print quit recall reply_to ssl_starttls nextgroup=muttrcSetQuadAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarQuad skipwhite contained noabort_nosubject noabort_unmodified nobounce nocopy nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarQuad skipwhite contained nocrypt_verify_sig nodelete nofcc_attach noforward_edit nohonor_followup_to nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarQuad skipwhite contained noinclude nomime_forward nomime_forward_rest nomime_fwd nomove nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarQuad skipwhite contained nopgp_mime_auto nopgp_verify_sig nopop_delete nopop_reconnect nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarQuad skipwhite contained nopostpone noprint noquit norecall noreply_to nossl_starttls nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarQuad skipwhite contained invabort_nosubject invabort_unmodified invbounce invcopy nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarQuad skipwhite contained invcrypt_verify_sig invdelete invfcc_attach invforward_edit invhonor_followup_to nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarQuad skipwhite contained invinclude invmime_forward invmime_forward_rest invmime_fwd invmove nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarQuad skipwhite contained invpgp_mime_auto invpgp_verify_sig invpop_delete invpop_reconnect nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarQuad skipwhite contained invpostpone invprint invquit invrecall invreply_to invssl_starttls nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarNum skipwhite contained connect_timeout history imap_keepalive imap_pipeline_depth mail_check nextgroup=muttrcSetNumAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarNum skipwhite contained menu_context net_inc pager_context pager_index_lines pgp_timeout nextgroup=muttrcSetNumAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarNum skipwhite contained pop_checkinterval read_inc save_history score_threshold_delete nextgroup=muttrcSetNumAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarNum skipwhite contained score_threshold_flag score_threshold_read search_context sendmail_wait sleep_time nextgroup=muttrcSetNumAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarNum skipwhite contained smime_timeout ssl_min_dh_prime_bits timeout time_inc wrap wrapmargin nextgroup=muttrcSetNumAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarNum skipwhite contained write_inc nextgroup=muttrcSetNumAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr if use_mutt_sidebar == 1 syn keyword muttrcVarNum skipwhite contained sidebar_width nextgroup=muttrcSetNumAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr endif syn match muttrcFormatErrors contained /%./ syn match muttrcStrftimeEscapes contained /%[AaBbCcDdeFGgHhIjklMmnpRrSsTtUuVvWwXxYyZz+%]/ syn match muttrcStrftimeEscapes contained /%E[cCxXyY]/ syn match muttrcStrftimeEscapes contained /%O[BdeHImMSuUVwWy]/ syn region muttrcIndexFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcIndexFormatEscapes,muttrcIndexFormatConditionals,muttrcFormatErrors,muttrcTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn region muttrcIndexFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcIndexFormatEscapes,muttrcIndexFormatConditionals,muttrcFormatErrors,muttrcTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn region muttrcQueryFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcQueryFormatEscapes,muttrcQueryFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn region muttrcAliasFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcAliasFormatEscapes,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn region muttrcAliasFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcAliasFormatEscapes,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn region muttrcAttachFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcAttachFormatEscapes,muttrcAttachFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn region muttrcAttachFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcAttachFormatEscapes,muttrcAttachFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn region muttrcComposeFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcComposeFormatEscapes,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn region muttrcComposeFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcComposeFormatEscapes,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn region muttrcFolderFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcFolderFormatEscapes,muttrcFolderFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn region muttrcFolderFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcFolderFormatEscapes,muttrcFolderFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn region muttrcMixFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcMixFormatEscapes,muttrcMixFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn region muttrcMixFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcMixFormatEscapes,muttrcMixFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn region muttrcPGPFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPGPFormatEscapes,muttrcPGPFormatConditionals,muttrcFormatErrors,muttrcPGPTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn region muttrcPGPFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcPGPFormatEscapes,muttrcPGPFormatConditionals,muttrcFormatErrors,muttrcPGPTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn region muttrcPGPCmdFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPGPCmdFormatEscapes,muttrcPGPCmdFormatConditionals,muttrcVariable,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn region muttrcPGPCmdFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcPGPCmdFormatEscapes,muttrcPGPCmdFormatConditionals,muttrcVariable,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn region muttrcStatusFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcStatusFormatEscapes,muttrcStatusFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn region muttrcStatusFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcStatusFormatEscapes,muttrcStatusFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn region muttrcPGPGetKeysFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPGPGetKeysFormatEscapes,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn region muttrcPGPGetKeysFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcPGPGetKeysFormatEscapes,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn region muttrcSmimeFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcSmimeFormatEscapes,muttrcSmimeFormatConditionals,muttrcVariable,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn region muttrcSmimeFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcSmimeFormatEscapes,muttrcSmimeFormatConditionals,muttrcVariable,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn region muttrcStrftimeFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcStrftimeEscapes,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn region muttrcStrftimeFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcStrftimeEscapes,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr " The following info was pulled from hdr_format_str in hdrline.c syn match muttrcIndexFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[aAbBcCdDeEfFHilLmMnNOPsStTuvXyYZ%]/ syn match muttrcIndexFormatEscapes contained /%[>|*]./ syn match muttrcIndexFormatConditionals contained /%?[EFHlLMNOXyY]?/ nextgroup=muttrcFormatConditionals2 " The following info was pulled from alias_format_str in addrbook.c syn match muttrcAliasFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[afnrt%]/ " The following info was pulled from query_format_str in query.c syn match muttrcQueryFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[acent%]/ syn match muttrcQueryFormatConditionals contained /%?[e]?/ nextgroup=muttrcFormatConditionals2 " The following info was pulled from mutt_attach_fmt in recvattach.c syn match muttrcAttachFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[CcDdefImMnQstTuX%]/ syn match muttrcAttachFormatEscapes contained /%[>|*]./ syn match muttrcAttachFormatConditionals contained /%?[CcdDefInmMQstTuX]?/ nextgroup=muttrcFormatConditionals2 syn match muttrcFormatConditionals2 contained /[^?]*?/ " The following info was pulled from compose_format_str in compose.c syn match muttrcComposeFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[ahlv%]/ syn match muttrcComposeFormatEscapes contained /%[>|*]./ " The following info was pulled from folder_format_str in browser.c syn match muttrcFolderFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[CDdfFglNstu%]/ syn match muttrcFolderFormatEscapes contained /%[>|*]./ syn match muttrcFolderFormatConditionals contained /%?[N]?/ " The following info was pulled from mix_entry_fmt in remailer.c syn match muttrcMixFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[ncsa%]/ syn match muttrcMixFormatConditionals contained /%?[ncsa]?/ " The following info was pulled from crypt_entry_fmt in crypt-gpgme.c " and pgp_entry_fmt in pgpkey.c (note that crypt_entry_fmt supports " 'p', but pgp_entry_fmt does not). syn match muttrcPGPFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[nkualfctp%]/ syn match muttrcPGPFormatConditionals contained /%?[nkualfct]?/ " The following info was pulled from _mutt_fmt_pgp_command in " pgpinvoke.c syn match muttrcPGPCmdFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[pfsar%]/ syn match muttrcPGPCmdFormatConditionals contained /%?[pfsar]?/ nextgroup=muttrcFormatConditionals2 " The following info was pulled from status_format_str in status.c syn match muttrcStatusFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[bdfFhlLmMnopPrsStuvV%]/ syn match muttrcStatusFormatEscapes contained /%[>|*]./ syn match muttrcStatusFormatConditionals contained /%?[bdFlLmMnoptuV]?/ nextgroup=muttrcFormatConditionals2 " This matches the documentation, but directly contradicts the code " (according to the code, this should be identical to the " muttrcPGPCmdFormatEscapes syn match muttrcPGPGetKeysFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[r%]/ " The following info was pulled from _mutt_fmt_smime_command in " smime.c syn match muttrcSmimeFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[Cciskaf%]/ syn match muttrcSmimeFormatConditionals contained /%?[Cciskaf]?/ nextgroup=muttrcFormatConditionals2 syn region muttrcTimeEscapes contained start=+%{+ end=+}+ contains=muttrcStrftimeEscapes syn region muttrcTimeEscapes contained start=+%\[+ end=+\]+ contains=muttrcStrftimeEscapes syn region muttrcTimeEscapes contained start=+%(+ end=+)+ contains=muttrcStrftimeEscapes syn region muttrcTimeEscapes contained start=+%<+ end=+>+ contains=muttrcStrftimeEscapes syn region muttrcPGPTimeEscapes contained start=+%\[+ end=+\]+ contains=muttrcStrftimeEscapes syn keyword muttrcVarStr contained skipwhite attribution index_format message_format pager_format nextgroup=muttrcVarEqualsIdxFmt syn match muttrcVarEqualsIdxFmt contained skipwhite "=" nextgroup=muttrcIndexFormatStr syn keyword muttrcVarStr contained skipwhite alias_format nextgroup=muttrcVarEqualsAliasFmt syn match muttrcVarEqualsAliasFmt contained skipwhite "=" nextgroup=muttrcAliasFormatStr syn keyword muttrcVarStr contained skipwhite attach_format nextgroup=muttrcVarEqualsAttachFmt syn match muttrcVarEqualsAttachFmt contained skipwhite "=" nextgroup=muttrcAttachFormatStr syn keyword muttrcVarStr contained skipwhite compose_format nextgroup=muttrcVarEqualsComposeFmt syn match muttrcVarEqualsComposeFmt contained skipwhite "=" nextgroup=muttrcComposeFormatStr syn keyword muttrcVarStr contained skipwhite folder_format nextgroup=muttrcVarEqualsFolderFmt syn match muttrcVarEqualsFolderFmt contained skipwhite "=" nextgroup=muttrcFolderFormatStr syn keyword muttrcVarStr contained skipwhite mix_entry_format nextgroup=muttrcVarEqualsMixFmt syn match muttrcVarEqualsMixFmt contained skipwhite "=" nextgroup=muttrcMixFormatStr syn keyword muttrcVarStr contained skipwhite pgp_entry_format nextgroup=muttrcVarEqualsPGPFmt syn match muttrcVarEqualsPGPFmt contained skipwhite "=" nextgroup=muttrcPGPFormatStr syn keyword muttrcVarStr contained skipwhite query_format nextgroup=muttrcVarEqualsQueryFmt syn match muttrcVarEqualsQueryFmt contained skipwhite "=" nextgroup=muttrcQueryFormatStr syn keyword muttrcVarStr contained skipwhite pgp_decode_command pgp_verify_command pgp_decrypt_command pgp_clearsign_command pgp_sign_command pgp_encrypt_sign_command pgp_encrypt_only_command pgp_import_command pgp_export_command pgp_verify_key_command pgp_list_secring_command pgp_list_pubring_command nextgroup=muttrcVarEqualsPGPCmdFmt syn match muttrcVarEqualsPGPCmdFmt contained skipwhite "=" nextgroup=muttrcPGPCmdFormatStr syn keyword muttrcVarStr contained skipwhite status_format nextgroup=muttrcVarEqualsStatusFmt syn match muttrcVarEqualsStatusFmt contained skipwhite "=" nextgroup=muttrcStatusFormatStr syn keyword muttrcVarStr contained skipwhite pgp_getkeys_command nextgroup=muttrcVarEqualsPGPGetKeysFmt syn match muttrcVarEqualsPGPGetKeysFmt contained skipwhite "=" nextgroup=muttrcPGPGetKeysFormatStr syn keyword muttrcVarStr contained skipwhite smime_decrypt_command smime_verify_command smime_verify_opaque_command smime_sign_command smime_sign_opaque_command smime_encrypt_command smime_pk7out_command smime_get_cert_command smime_get_signer_cert_command smime_import_cert_command smime_get_cert_email_command nextgroup=muttrcVarEqualsSmimeFmt syn match muttrcVarEqualsSmimeFmt contained skipwhite "=" nextgroup=muttrcSmimeFormatStr syn keyword muttrcVarStr contained skipwhite date_format nextgroup=muttrcVarEqualsStrftimeFmt syn match muttrcVarEqualsStrftimeFmt contained skipwhite "=" nextgroup=muttrcStrftimeFormatStr syn match muttrcVPrefix contained /[?&]/ nextgroup=muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn match muttrcVarStr contained skipwhite 'my_[a-zA-Z0-9_]\+' nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarStr contained skipwhite alias_file assumed_charset attach_charset attach_sep nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarStr contained skipwhite certificate_file charset config_charset content_type nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarStr contained skipwhite default_hook display_filter dotlock_program dsn_notify nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarStr contained skipwhite dsn_return editor entropy_file envelope_from_address escape folder nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarStr contained skipwhite forw_format forward_format from gecos_mask hdr_format nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarStr contained skipwhite header_cache header_cache_compress header_cache_pagesize nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarStr contained skipwhite history_file hostname imap_authenticators nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarStr contained skipwhite imap_delim_chars imap_headers imap_idle imap_login imap_pass nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarStr contained skipwhite imap_user indent_str indent_string ispell locale mailcap_path nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarStr contained skipwhite mask mbox mbox_type message_cachedir mh_seq_flagged mh_seq_replied nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarStr contained skipwhite mh_seq_unseen mixmaster msg_format pager nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarStr contained skipwhite pgp_good_sign nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarStr contained skipwhite pgp_mime_signature_filename nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarStr contained skipwhite pgp_mime_signature_description pgp_sign_as nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarStr contained skipwhite pgp_sort_keys nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarStr contained skipwhite pipe_sep pop_authenticators pop_host pop_pass pop_user post_indent_str nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarStr contained skipwhite post_indent_string postponed preconnect print_cmd print_command nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarStr contained skipwhite query_command quote_regexp realname record reply_regexp send_charset nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarStr contained skipwhite sendmail shell signature simple_search smileys smime_ca_location nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarStr contained skipwhite smime_certificates smime_default_key nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarStr contained skipwhite smime_encrypt_with nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarStr contained skipwhite smime_keys smime_sign_as nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarStr contained skipwhite smtp_url smtp_authenticators smtp_pass sort sort_alias sort_aux nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarStr contained skipwhite sort_browser spam_separator spoolfile ssl_ca_certificates_file ssl_client_cert nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcVarStr contained skipwhite status_chars tmpdir to_chars tunnel visual nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr if use_mutt_sidebar == 1 syn keyword muttrcVarStr skipwhite contained sidebar_delim nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr endif " Present in 1.4.2.1 (pgp_create_traditional was a bool then) syn keyword muttrcVarBool contained skipwhite imap_force_ssl noimap_force_ssl invimap_force_ssl nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr "syn keyword muttrcVarQuad contained pgp_create_traditional nopgp_create_traditional invpgp_create_traditional syn keyword muttrcVarStr contained skipwhite alternates nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcMenu contained alias attach browser compose editor index pager postpone pgp mix query generic syn match muttrcMenuList "\S\+" contained contains=muttrcMenu syn match muttrcMenuCommas /,/ contained syn keyword muttrcHooks contained skipwhite account-hook charset-hook iconv-hook message-hook folder-hook mbox-hook save-hook fcc-hook fcc-save-hook send-hook send2-hook reply-hook crypt-hook syn keyword muttrcCommand auto_view alternative_order exec unalternative_order syn keyword muttrcCommand hdr_order iconv-hook ignore mailboxes my_hdr unmailboxes syn keyword muttrcCommand pgp-hook push score source unauto_view unhdr_order syn keyword muttrcCommand unignore unmono unmy_hdr unscore syn keyword muttrcCommand mime_lookup unmime_lookup ungroup syn keyword muttrcCommand unalternative_order syn keyword muttrcCommand skipwhite charset-hook nextgroup=muttrcRXString syn keyword muttrcCommand skipwhite unhook nextgroup=muttrcHooks syn keyword muttrcCommand skipwhite spam nextgroup=muttrcSpamPattern syn region muttrcSpamPattern contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcPattern nextgroup=muttrcString,muttrcStringNL syn region muttrcSpamPattern contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPattern nextgroup=muttrcString,muttrcStringNL syn keyword muttrcCommand skipwhite nospam nextgroup=muttrcNoSpamPattern syn region muttrcNoSpamPattern contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcPattern syn region muttrcNoSpamPattern contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPattern syn match muttrcAttachmentsMimeType contained "[*a-z0-9_-]\+/[*a-z0-9._-]\+\s*" skipwhite nextgroup=muttrcAttachmentsMimeType syn match muttrcAttachmentsFlag contained "[+-]\%([AI]\|inline\|attachment\)\s\+" skipwhite nextgroup=muttrcAttachmentsMimeType syn match muttrcAttachmentsLine "^\s*\%(un\)\?attachments\s\+" skipwhite nextgroup=muttrcAttachmentsFlag syn match muttrcUnHighlightSpace contained "\%(\s\+\|\\$\)" syn keyword muttrcAsterisk contained * syn keyword muttrcListsKeyword lists skipwhite nextgroup=muttrcGroupDef,muttrcComment syn keyword muttrcListsKeyword unlists skipwhite nextgroup=muttrcAsterisk,muttrcComment syn keyword muttrcSubscribeKeyword subscribe nextgroup=muttrcGroupDef,muttrcComment syn keyword muttrcSubscribeKeyword unsubscribe nextgroup=muttrcAsterisk,muttrcComment syn keyword muttrcAlternateKeyword contained alternates unalternates syn region muttrcAlternatesLine keepend start=+^\s*\%(un\)\?alternates\s+ skip=+\\$+ end=+$+ contains=muttrcAlternateKeyword,muttrcGroupDef,muttrcRXPat,muttrcUnHighlightSpace,muttrcComment " muttrcVariable includes a prefix because partial strings are considered " valid. syn match muttrcVariable contained "\\\@]\+" contains=muttrcEmail syn match muttrcFunction contained "\<\%(attach\|bounce\|copy\|delete\|display\|flag\|forward\|parent\|pipe\|postpone\|print\|recall\|resend\|save\|send\|tag\|undelete\)-message\>" syn match muttrcFunction contained "\<\%(delete\|next\|previous\|read\|tag\|break\|undelete\)-thread\>" syn match muttrcFunction contained "\" syn match muttrcFunction contained "\<\%(backward\|capitalize\|downcase\|forward\|kill\|upcase\)-word\>" syn match muttrcFunction contained "\<\%(delete\|filter\|first\|last\|next\|pipe\|previous\|print\|save\|select\|tag\|undelete\)-entry\>" syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" syn match muttrcFunction contained "\<\%(backspace\|backward-char\|bol\|bottom\|bottom-page\|buffy-cycle\|clear-flag\|complete\%(-query\)\?\|copy-file\|create-alias\|detach-file\|eol\|exit\|extract-keys\|\%(imap-\)\?fetch-mail\|forget-passphrase\|forward-char\|group-reply\|help\|ispell\|jump\|limit\|list-reply\|mail\|mail-key\|mark-as-new\|middle-page\|new-mime\|noop\|pgp-menu\|query\|query-append\|quit\|quote-char\|read-subthread\|redraw-screen\|refresh\|rename-file\|reply\|select-new\|set-flag\|shell-escape\|skip-quoted\|sort\|subscribe\|sync-mailbox\|top\|top-page\|transpose-chars\|unsubscribe\|untag-pattern\|verify-key\|what-key\|write-fcc\)\>" if use_mutt_sidebar == 1 syn match muttrcFunction contained "\]\{-}>" contains=muttrcBadAction,muttrcFunction,muttrcKeyName syn keyword muttrcCommand set skipwhite nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcCommand unset skipwhite nextgroup=muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcCommand reset skipwhite nextgroup=muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn keyword muttrcCommand toggle skipwhite nextgroup=muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr " First, functions that take regular expressions: syn match muttrcRXHookNot contained /!\s*/ skipwhite nextgroup=muttrcRXHookString,muttrcRXHookStringNL syn match muttrcRXHooks /\<\%(account\|folder\)-hook\>/ skipwhite nextgroup=muttrcRXHookNot,muttrcRXHookString,muttrcRXHookStringNL " Now, functions that take patterns syn match muttrcPatHookNot contained /!\s*/ skipwhite nextgroup=muttrcPattern syn match muttrcPatHooks /\<\%(mbox\|crypt\)-hook\>/ skipwhite nextgroup=muttrcPatHookNot,muttrcPattern syn match muttrcPatHooks /\<\%(message\|reply\|send\|send2\|save\|\|fcc\%(-save\)\?\)-hook\>/ skipwhite nextgroup=muttrcPatHookNot,muttrcOptPattern syn match muttrcBindFunction contained /\S\+\>/ skipwhite contains=muttrcFunction syn match muttrcBindFunctionNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcBindFunction,muttrcBindFunctionNL syn match muttrcBindKey contained /\S\+/ skipwhite contains=muttrcKey nextgroup=muttrcBindFunction,muttrcBindFunctionNL syn match muttrcBindKeyNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcBindKey,muttrcBindKeyNL syn match muttrcBindMenuList contained /\S\+/ skipwhite contains=muttrcMenu,muttrcMenuCommas nextgroup=muttrcBindKey,muttrcBindKeyNL syn match muttrcBindMenuListNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcBindMenuList,muttrcBindMenuListNL syn keyword muttrcCommand skipwhite bind nextgroup=muttrcBindMenuList,muttrcBindMenuListNL syn region muttrcMacroDescr contained keepend skipwhite start=+\s*\S+ms=e skip=+\\ + end=+ \|$+me=s syn region muttrcMacroDescr contained keepend skipwhite start=+'+ms=e skip=+\\'+ end=+'+me=s syn region muttrcMacroDescr contained keepend skipwhite start=+"+ms=e skip=+\\"+ end=+"+me=s syn match muttrcMacroDescrNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcMacroDescr,muttrcMacroDescrNL syn region muttrcMacroBody contained skipwhite start="\S" skip='\\ \|\\$' end=' \|$' contains=muttrcEscape,muttrcSet,muttrcUnset,muttrcReset,muttrcToggle,muttrcCommand,muttrcAction nextgroup=muttrcMacroDescr,muttrcMacroDescrNL syn region muttrcMacroBody matchgroup=Type contained skipwhite start=+'+ms=e skip=+\\'+ end=+'\|\%(\%(\\\\\)\@]\+>/ contains=muttrcEmail nextgroup=muttrcAliasComma syn match muttrcAliasEncEmailNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcAliasEncEmail,muttrcAliasEncEmailNL syn match muttrcAliasNameNoParens contained /[^<(@]\+\s\+/ nextgroup=muttrcAliasEncEmail,muttrcAliasEncEmailNL syn region muttrcAliasName contained matchgroup=Type start=/(/ end=/)/ skipwhite syn match muttrcAliasNameNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcAliasName,muttrcAliasNameNL syn match muttrcAliasENNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcAliasEmail,muttrcAliasEncEmail,muttrcAliasNameNoParens,muttrcAliasENNL syn match muttrcAliasKey contained /\s*[^- \t]\S\+/ skipwhite nextgroup=muttrcAliasEmail,muttrcAliasEncEmail,muttrcAliasNameNoParens,muttrcAliasENNL syn match muttrcAliasNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcAliasGroupDef,muttrcAliasKey,muttrcAliasNL syn keyword muttrcCommand skipwhite alias nextgroup=muttrcAliasGroupDef,muttrcAliasKey,muttrcAliasNL syn match muttrcUnAliasKey contained "\s*\w\+\s*" skipwhite nextgroup=muttrcUnAliasKey,muttrcUnAliasNL syn match muttrcUnAliasNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcUnAliasKey,muttrcUnAliasNL syn keyword muttrcCommand skipwhite unalias nextgroup=muttrcUnAliasKey,muttrcUnAliasNL syn match muttrcSimplePat contained "!\?\^\?[~][ADEFgGklNOpPQRSTuUvV=$]" syn match muttrcSimplePat contained "!\?\^\?[~][mnXz]\s*\%([<>-][0-9]\+[kM]\?\|[0-9]\+[kM]\?[-]\%([0-9]\+[kM]\?\)\?\)" syn match muttrcSimplePat contained "!\?\^\?[~][dr]\s*\%(\%(-\?[0-9]\{1,2}\%(/[0-9]\{1,2}\%(/[0-9]\{2}\%([0-9]\{2}\)\?\)\?\)\?\%([+*-][0-9]\+[ymwd]\)*\)\|\%(\%([0-9]\{1,2}\%(/[0-9]\{1,2}\%(/[0-9]\{2}\%([0-9]\{2}\)\?\)\?\)\?\%([+*-][0-9]\+[ymwd]\)*\)-\%([0-9]\{1,2}\%(/[0-9]\{1,2}\%(/[0-9]\{2}\%([0-9]\{2}\)\?\)\?\)\?\%([+*-][0-9]\+[ymwd]\)\?\)\?\)\|\%([<>=][0-9]\+[ymwd]\)\|\%(`[^`]\+`\)\|\%(\$[a-zA-Z0-9_-]\+\)\)" contains=muttrcShellString,muttrcVariable syn match muttrcSimplePat contained "!\?\^\?[~][bBcCefhHiLstxy]\s*" nextgroup=muttrcSimplePatRXContainer syn match muttrcSimplePat contained "!\?\^\?[%][bBcCefhHiLstxy]\s*" nextgroup=muttrcSimplePatString syn match muttrcSimplePat contained "!\?\^\?[=][bcCefhHiLstxy]\s*" nextgroup=muttrcSimplePatString syn region muttrcSimplePat contained keepend start=+!\?\^\?[~](+ end=+)+ contains=muttrcSimplePat "syn match muttrcSimplePat contained /'[^~=%][^']*/ contains=muttrcRXString syn region muttrcSimplePatString contained keepend start=+"+ end=+"+ skip=+\\"+ syn region muttrcSimplePatString contained keepend start=+'+ end=+'+ skip=+\\'+ syn region muttrcSimplePatString contained keepend start=+[^ "']+ skip=+\\ + end=+\s+re=e-1 syn region muttrcSimplePatRXContainer contained keepend start=+"+ end=+"+ skip=+\\"+ contains=muttrcRXString syn region muttrcSimplePatRXContainer contained keepend start=+'+ end=+'+ skip=+\\'+ contains=muttrcRXString syn region muttrcSimplePatRXContainer contained keepend start=+[^ "']+ skip=+\\ + end=+\s+re=e-1 contains=muttrcRXString syn match muttrcSimplePatMetas contained /[(|)]/ syn match muttrcOptSimplePat contained skipwhite /[~=%!(^].*/ contains=muttrcSimplePat,muttrcSimplePatMetas syn match muttrcOptSimplePat contained skipwhite /[^~=%!(^].*/ contains=muttrcRXString syn region muttrcOptPattern contained matchgroup=Type keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcOptSimplePat,muttrcUnHighlightSpace nextgroup=muttrcString,muttrcStringNL syn region muttrcOptPattern contained matchgroup=Type keepend skipwhite start=+'+ skip=+\\'+ end=+'+ contains=muttrcOptSimplePat,muttrcUnHighlightSpace nextgroup=muttrcString,muttrcStringNL syn region muttrcOptPattern contained keepend skipwhite start=+[~](+ end=+)+ skip=+\\)+ contains=muttrcSimplePat nextgroup=muttrcString,muttrcStringNL syn match muttrcOptPattern contained skipwhite /[~][A-Za-z]/ contains=muttrcSimplePat nextgroup=muttrcString,muttrcStringNL syn match muttrcOptPattern contained skipwhite /[.]/ nextgroup=muttrcString,muttrcStringNL " Keep muttrcPattern and muttrcOptPattern synchronized syn region muttrcPattern contained matchgroup=Type keepend skipwhite start=+"+ skip=+\\"+ end=+"+ contains=muttrcSimplePat,muttrcUnHighlightSpace,muttrcSimplePatMetas syn region muttrcPattern contained matchgroup=Type keepend skipwhite start=+'+ skip=+\\'+ end=+'+ contains=muttrcSimplePat,muttrcUnHighlightSpace,muttrcSimplePatMetas syn region muttrcPattern contained keepend skipwhite start=+[~](+ end=+)+ skip=+\\)+ contains=muttrcSimplePat syn match muttrcPattern contained skipwhite /[~][A-Za-z]/ contains=muttrcSimplePat syn match muttrcPattern contained skipwhite /[.]/ syn region muttrcPatternInner contained keepend start=+"[~=%!(^]+ms=s+1 skip=+\\"+ end=+"+me=e-1 contains=muttrcSimplePat,muttrcUnHighlightSpace,muttrcSimplePatMetas syn region muttrcPatternInner contained keepend start=+'[~=%!(^]+ms=s+1 skip=+\\'+ end=+'+me=e-1 contains=muttrcSimplePat,muttrcUnHighlightSpace,muttrcSimplePatMetas " Colour definitions takes object, foreground and background arguments (regexps excluded). syn match muttrcColorMatchCount contained "[0-9]\+" syn match muttrcColorMatchCountNL contained skipwhite skipnl "\s*\\$" nextgroup=muttrcColorMatchCount,muttrcColorMatchCountNL syn region muttrcColorRXPat contained start=+\s*'+ skip=+\\'+ end=+'\s*+ keepend skipwhite contains=muttrcRXString2 nextgroup=muttrcColorMatchCount,muttrcColorMatchCountNL syn region muttrcColorRXPat contained start=+\s*"+ skip=+\\"+ end=+"\s*+ keepend skipwhite contains=muttrcRXString2 nextgroup=muttrcColorMatchCount,muttrcColorMatchCountNL syn keyword muttrcColorField contained attachment body bold error hdrdefault header index indicator markers message normal quoted search signature status tilde tree underline syn match muttrcColorField contained "\" if use_mutt_sidebar == 1 syn keyword muttrcColorField contained sidebar_new endif syn keyword muttrcColor contained black blue cyan default green magenta red white yellow syn keyword muttrcColor contained brightblack brightblue brightcyan brightdefault brightgreen brightmagenta brightred brightwhite brightyellow syn match muttrcColor contained "\<\%(bright\)\=color\d\{1,3}\>" " Now for the structure of the color line syn match muttrcColorRXNL contained skipnl "\s*\\$" nextgroup=muttrcColorRXPat,muttrcColorRXNL syn match muttrcColorBG contained /\s*[$]\?\w\+/ contains=muttrcColor,muttrcVariable,muttrcUnHighlightSpace nextgroup=muttrcColorRXPat,muttrcColorRXNL syn match muttrcColorBGNL contained skipnl "\s*\\$" nextgroup=muttrcColorBG,muttrcColorBGNL syn match muttrcColorFG contained /\s*[$]\?\w\+/ contains=muttrcColor,muttrcVariable,muttrcUnHighlightSpace nextgroup=muttrcColorBG,muttrcColorBGNL syn match muttrcColorFGNL contained skipnl "\s*\\$" nextgroup=muttrcColorFG,muttrcColorFGNL syn match muttrcColorContext contained /\s*[$]\?\w\+/ contains=muttrcColorField,muttrcVariable,muttrcUnHighlightSpace nextgroup=muttrcColorFG,muttrcColorFGNL syn match muttrcColorNL contained skipnl "\s*\\$" nextgroup=muttrcColorContext,muttrcColorNL syn match muttrcColorKeyword contained /^\s*color\s\+/ nextgroup=muttrcColorContext,muttrcColorNL syn region muttrcColorLine keepend start=/^\s*color\s\+\%(index\|header\)\@!/ skip=+\\$+ end=+$+ contains=muttrcColorKeyword,muttrcComment,muttrcUnHighlightSpace " Now for the structure of the color index line syn match muttrcPatternNL contained skipnl "\s*\\$" nextgroup=muttrcPattern,muttrcPatternNL syn match muttrcColorBGI contained /\s*[$]\?\w\+\s*/ contains=muttrcColor,muttrcVariable,muttrcUnHighlightSpace nextgroup=muttrcPattern,muttrcPatternNL syn match muttrcColorBGNLI contained skipnl "\s*\\$" nextgroup=muttrcColorBGI,muttrcColorBGNLI syn match muttrcColorFGI contained /\s*[$]\?\w\+/ contains=muttrcColor,muttrcVariable,muttrcUnHighlightSpace nextgroup=muttrcColorBGI,muttrcColorBGNLI syn match muttrcColorFGNLI contained skipnl "\s*\\$" nextgroup=muttrcColorFGI,muttrcColorFGNLI syn match muttrcColorContextI contained /\s*\/ contains=muttrcUnHighlightSpace nextgroup=muttrcColorFGI,muttrcColorFGNLI syn match muttrcColorNLI contained skipnl "\s*\\$" nextgroup=muttrcColorContextI,muttrcColorNLI syn match muttrcColorKeywordI contained skipwhite /\/ nextgroup=muttrcColorContextI,muttrcColorNLI syn region muttrcColorLine keepend skipwhite start=/\/ skip=+\\$+ end=+$+ contains=muttrcColorKeywordI,muttrcComment,muttrcUnHighlightSpace " Now for the structure of the color header line syn match muttrcRXPatternNL contained skipnl "\s*\\$" nextgroup=muttrcRXString,muttrcRXPatternNL syn match muttrcColorBGH contained /\s*[$]\?\w\+\s*/ contains=muttrcColor,muttrcVariable,muttrcUnHighlightSpace nextgroup=muttrcRXString,muttrcRXPatternNL syn match muttrcColorBGNLH contained skipnl "\s*\\$" nextgroup=muttrcColorBGH,muttrcColorBGNLH syn match muttrcColorFGH contained /\s*[$]\?\w\+/ contains=muttrcColor,muttrcVariable,muttrcUnHighlightSpace nextgroup=muttrcColorBGH,muttrcColorBGNLH syn match muttrcColorFGNLH contained skipnl "\s*\\$" nextgroup=muttrcColorFGH,muttrcColorFGNLH syn match muttrcColorContextH contained /\s*\/ contains=muttrcUnHighlightSpace nextgroup=muttrcColorFGH,muttrcColorFGNLH syn match muttrcColorNLH contained skipnl "\s*\\$" nextgroup=muttrcColorContextH,muttrcColorNLH syn match muttrcColorKeywordH contained skipwhite /\/ nextgroup=muttrcColorContextH,muttrcColorNLH syn region muttrcColorLine keepend skipwhite start=/\/ skip=+\\$+ end=+$+ contains=muttrcColorKeywordH,muttrcComment,muttrcUnHighlightSpace " And now color's brother: syn region muttrcUnColorPatterns contained skipwhite start=+\s*'+ end=+'+ skip=+\\'+ contains=muttrcPattern nextgroup=muttrcUnColorPatterns,muttrcUnColorPatNL syn region muttrcUnColorPatterns contained skipwhite start=+\s*"+ end=+"+ skip=+\\"+ contains=muttrcPattern nextgroup=muttrcUnColorPatterns,muttrcUnColorPatNL syn match muttrcUnColorPatterns contained skipwhite /\s*[^'"\s]\S\*/ contains=muttrcPattern nextgroup=muttrcUnColorPatterns,muttrcUnColorPatNL syn match muttrcUnColorPatNL contained skipwhite skipnl /\s*\\$/ nextgroup=muttrcUnColorPatterns,muttrcUnColorPatNL syn match muttrcUnColorAll contained skipwhite /[*]/ syn match muttrcUnColorAPNL contained skipwhite skipnl /\s*\\$/ nextgroup=muttrcUnColorPatterns,muttrcUnColorAll,muttrcUnColorAPNL syn match muttrcUnColorIndex contained skipwhite /\s*index\s\+/ nextgroup=muttrcUnColorPatterns,muttrcUnColorAll,muttrcUnColorAPNL syn match muttrcUnColorIndexNL contained skipwhite skipnl /\s*\\$/ nextgroup=muttrcUnColorIndex,muttrcUnColorIndexNL syn match muttrcUnColorKeyword contained skipwhite /^\s*uncolor\s\+/ nextgroup=muttrcUnColorIndex,muttrcUnColorIndexNL syn region muttrcUnColorLine keepend start=+^\s*uncolor\s+ skip=+\\$+ end=+$+ contains=muttrcUnColorKeyword,muttrcComment,muttrcUnHighlightSpace " 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 else command -nargs=+ HiLink hi def link endif HiLink muttrcComment Comment HiLink muttrcEscape SpecialChar HiLink muttrcRXChars SpecialChar HiLink muttrcString String HiLink muttrcRXString String HiLink muttrcRXString2 String HiLink muttrcSpecial Special HiLink muttrcHooks Type HiLink muttrcGroupFlag Type HiLink muttrcGroupDef Macro HiLink muttrcAddrDef muttrcGroupFlag HiLink muttrcRXDef muttrcGroupFlag HiLink muttrcRXPat String HiLink muttrcAliasGroupName Macro HiLink muttrcAliasKey Identifier HiLink muttrcUnAliasKey Identifier HiLink muttrcAliasEncEmail Identifier HiLink muttrcAliasParens Type HiLink muttrcSetNumAssignment Number HiLink muttrcSetBoolAssignment Boolean HiLink muttrcSetQuadAssignment Boolean HiLink muttrcSetStrAssignment String HiLink muttrcEmail Special HiLink muttrcVariableInner Special HiLink muttrcEscapedVariable String HiLink muttrcHeader Type HiLink muttrcKeySpecial SpecialChar HiLink muttrcKey Type HiLink muttrcKeyName SpecialChar HiLink muttrcVarBool Identifier HiLink muttrcVarQuad Identifier HiLink muttrcVarNum Identifier HiLink muttrcVarStr Identifier HiLink muttrcMenu Identifier HiLink muttrcCommand Keyword HiLink muttrcMacroDescr String HiLink muttrcAction Macro HiLink muttrcBadAction Error HiLink muttrcBindFunction Error HiLink muttrcBindMenuList Error HiLink muttrcFunction Macro HiLink muttrcGroupKeyword muttrcCommand HiLink muttrcGroupLine Error HiLink muttrcSubscribeKeyword muttrcCommand HiLink muttrcSubscribeLine Error HiLink muttrcListsKeyword muttrcCommand HiLink muttrcListsLine Error HiLink muttrcAlternateKeyword muttrcCommand HiLink muttrcAlternatesLine Error HiLink muttrcAttachmentsLine muttrcCommand HiLink muttrcAttachmentsFlag Type HiLink muttrcAttachmentsMimeType String HiLink muttrcColorLine Error HiLink muttrcColorContext Error HiLink muttrcColorContextI Identifier HiLink muttrcColorContextH Identifier HiLink muttrcColorKeyword muttrcCommand HiLink muttrcColorKeywordI muttrcColorKeyword HiLink muttrcColorKeywordH muttrcColorKeyword HiLink muttrcColorField Identifier HiLink muttrcColor Type HiLink muttrcColorFG Error HiLink muttrcColorFGI Error HiLink muttrcColorFGH Error HiLink muttrcColorBG Error HiLink muttrcColorBGI Error HiLink muttrcColorBGH Error HiLink muttrcMonoAttrib muttrcColor HiLink muttrcMono muttrcCommand HiLink muttrcSimplePat Identifier HiLink muttrcSimplePatString Macro HiLink muttrcSimplePatMetas Special HiLink muttrcPattern Error HiLink muttrcUnColorLine Error HiLink muttrcUnColorKeyword muttrcCommand HiLink muttrcUnColorIndex Identifier HiLink muttrcShellString muttrcEscape HiLink muttrcRXHooks muttrcCommand HiLink muttrcRXHookNot Type HiLink muttrcPatHooks muttrcCommand HiLink muttrcPatHookNot Type HiLink muttrcFormatConditionals2 Type HiLink muttrcIndexFormatStr muttrcString HiLink muttrcIndexFormatEscapes muttrcEscape HiLink muttrcIndexFormatConditionals muttrcFormatConditionals2 HiLink muttrcAliasFormatStr muttrcString HiLink muttrcAliasFormatEscapes muttrcEscape HiLink muttrcAttachFormatStr muttrcString HiLink muttrcAttachFormatEscapes muttrcEscape HiLink muttrcAttachFormatConditionals muttrcFormatConditionals2 HiLink muttrcComposeFormatStr muttrcString HiLink muttrcComposeFormatEscapes muttrcEscape HiLink muttrcFolderFormatStr muttrcString HiLink muttrcFolderFormatEscapes muttrcEscape HiLink muttrcFolderFormatConditionals muttrcFormatConditionals2 HiLink muttrcMixFormatStr muttrcString HiLink muttrcMixFormatEscapes muttrcEscape HiLink muttrcMixFormatConditionals muttrcFormatConditionals2 HiLink muttrcPGPFormatStr muttrcString HiLink muttrcPGPFormatEscapes muttrcEscape HiLink muttrcPGPFormatConditionals muttrcFormatConditionals2 HiLink muttrcPGPCmdFormatStr muttrcString HiLink muttrcPGPCmdFormatEscapes muttrcEscape HiLink muttrcPGPCmdFormatConditionals muttrcFormatConditionals2 HiLink muttrcStatusFormatStr muttrcString HiLink muttrcStatusFormatEscapes muttrcEscape HiLink muttrcStatusFormatConditionals muttrcFormatConditionals2 HiLink muttrcPGPGetKeysFormatStr muttrcString HiLink muttrcPGPGetKeysFormatEscapes muttrcEscape HiLink muttrcSmimeFormatStr muttrcString HiLink muttrcSmimeFormatEscapes muttrcEscape HiLink muttrcSmimeFormatConditionals muttrcFormatConditionals2 HiLink muttrcTimeEscapes muttrcEscape HiLink muttrcPGPTimeEscapes muttrcEscape HiLink muttrcStrftimeEscapes Type HiLink muttrcStrftimeFormatStr muttrcString HiLink muttrcFormatErrors Error HiLink muttrcBindFunctionNL SpecialChar HiLink muttrcBindKeyNL SpecialChar HiLink muttrcBindMenuListNL SpecialChar HiLink muttrcMacroDescrNL SpecialChar HiLink muttrcMacroBodyNL SpecialChar HiLink muttrcMacroKeyNL SpecialChar HiLink muttrcMacroMenuListNL SpecialChar HiLink muttrcColorMatchCountNL SpecialChar HiLink muttrcColorNL SpecialChar HiLink muttrcColorRXNL SpecialChar HiLink muttrcColorBGNL SpecialChar HiLink muttrcColorFGNL SpecialChar HiLink muttrcAliasNameNL SpecialChar HiLink muttrcAliasENNL SpecialChar HiLink muttrcAliasNL SpecialChar HiLink muttrcUnAliasNL SpecialChar HiLink muttrcAliasGroupDefNL SpecialChar HiLink muttrcAliasEncEmailNL SpecialChar HiLink muttrcPatternNL SpecialChar HiLink muttrcUnColorPatNL SpecialChar HiLink muttrcUnColorAPNL SpecialChar HiLink muttrcUnColorIndexNL SpecialChar HiLink muttrcStringNL SpecialChar delcommand HiLink endif let b:current_syntax = "muttrc" let &cpo = s:cpo_save unlet s:cpo_save "EOF vim: ts=8 noet tw=100 sw=8 sts=0 ft=vim vim-7.4.1689/runtime/syntax/mysql.vim000066400000000000000000000427221267703067000174770ustar00rootroot00000000000000" Vim syntax file " Language: mysql " Maintainer: Kenneth J. Pronovici " Last Change: $LastChangedDate: 2010-04-22 09:48:02 -0500 (Thu, 22 Apr 2010) $ " 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 right 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][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 "--\_s.*" 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 keywords 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="subtime(" 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 else command -nargs=+ HiLink hi def link 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" vim-7.4.1689/runtime/syntax/named.vim000066400000000000000000000242611267703067000174140ustar00rootroot00000000000000" Vim syntax file " Language: BIND configuration file " Maintainer: Nick Hibma " Last change: 2007-01-30 " Filenames: named.conf, rndc.conf " Location: http://www.van-laarhoven.org/vim/syntax/named.vim " " Previously maintained by glory hump and updated by Marcin " Dalecki. " " This file could do with a lot of improvements, so comments are welcome. " Please submit the named.conf (segment) with any 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 syn case match if version >= 600 setlocal iskeyword=.,-,48-58,A-Z,a-z,_ else set iskeyword=.,-,48-58,A-Z,a-z,_ endif if version >= 600 syn sync match namedSync grouphere NONE "^(zone|controls|acl|key)" endif let s:save_cpo = &cpo set cpo-=C " BIND configuration file syn match namedComment "//.*" syn match namedComment "#.*" syn region namedComment start="/\*" end="\*/" syn region namedString start=/"/ end=/"/ contained " --- omitted trailing semicolon 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 " + these keywords are contained within `update-policy' section only syn keyword namedIntKeyword contained grant nextgroup=namedString skipwhite syn keyword namedIntKeyword contained name self subdomain wildcard nextgroup=namedString skipwhite syn keyword namedIntKeyword TXT A PTR NS SOA A6 CNAME MX ANY 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=namedIPlist 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 /\/ 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 else command -nargs=+ HiLink hi def link 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 namedIPaddr Number 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 vim-7.4.1689/runtime/syntax/nanorc.vim000066400000000000000000000245601267703067000176120ustar00rootroot00000000000000" Vim syntax file " Language: nanorc(5) - GNU nano configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2006-04-19 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn keyword nanorcTodo contained TODO FIXME XXX NOTE syn region nanorcComment display oneline start='^\s*#' end='$' \ contains=nanorcTodo,@Spell syn match nanorcBegin display '^' \ nextgroup=nanorcKeyword,nanorcComment \ skipwhite syn keyword nanorcKeyword contained set unset \ nextgroup=nanorcBoolOption, \ nanorcStringOption,nanorcNumberOption \ skipwhite syn keyword nanorcKeyword contained syntax \ nextgroup=nanorcSynGroupName skipwhite syn keyword nanorcKeyword contained color \ nextgroup=@nanorcFGColor skipwhite syn keyword nanorcBoolOption contained autoindent backup const cut \ historylog morespace mouse multibuffer \ noconvert nofollow nohelp nowrap preserve \ rebinddelete regexp smarthome smooth suspend \ tempfile view syn keyword nanorcStringOption contained backupdir brackets operatingdir \ punct quotestr speller whitespace \ nextgroup=nanorcString skipwhite syn keyword nanorcNumberOption contained fill tabsize \ nextgroup=nanorcNumber skipwhite syn region nanorcSynGroupName contained display oneline start=+"+ \ end=+"\ze\%([[:blank:]]\|$\)+ \ nextgroup=nanorcRegexes skipwhite syn match nanorcString contained display '".*"' syn region nanorcRegexes contained display oneline start=+"+ \ end=+"\ze\%([[:blank:]]\|$\)+ \ nextgroup=nanorcRegexes skipwhite syn match nanorcNumber contained display '[+-]\=\<\d\+\>' syn cluster nanorcFGColor contains=nanorcFGWhite,nanorcFGBlack, \ nanorcFGRed,nanorcFGBlue,nanorcFGGreen, \ nanorcFGYellow,nanorcFGMagenta,nanorcFGCyan, \ nanorcFGBWhite,nanorcFGBBlack,nanorcFGBRed, \ nanorcFGBBlue,nanorcFGBGreen,nanorcFGBYellow, \ nanorcFGBMagenta,nanorcFGBCyan syn keyword nanorcFGWhite contained white \ nextgroup=@nanorcFGSpec skipwhite syn keyword nanorcFGBlack contained black \ nextgroup=@nanorcFGSpec skipwhite syn keyword nanorcFGRed contained red \ nextgroup=@nanorcFGSpec skipwhite syn keyword nanorcFGBlue contained blue \ nextgroup=@nanorcFGSpec skipwhite syn keyword nanorcFGGreen contained green \ nextgroup=@nanorcFGSpec skipwhite syn keyword nanorcFGYellow contained yellow \ nextgroup=@nanorcFGSpec skipwhite syn keyword nanorcFGMagenta contained magenta \ nextgroup=@nanorcFGSpec skipwhite syn keyword nanorcFGCyan contained cyan \ nextgroup=@nanorcFGSpec skipwhite syn keyword nanorcFGBWhite contained brightwhite \ nextgroup=@nanorcFGSpec skipwhite syn keyword nanorcFGBBlack contained brightblack \ nextgroup=@nanorcFGSpec skipwhite syn keyword nanorcFGBRed contained brightred \ nextgroup=@nanorcFGSpec skipwhite syn keyword nanorcFGBBlue contained brightblue \ nextgroup=@nanorcFGSpec skipwhite syn keyword nanorcFGBGreen contained brightgreen \ nextgroup=@nanorcFGSpec skipwhite syn keyword nanorcFGBYellow contained brightyellow \ nextgroup=@nanorcFGSpec skipwhite syn keyword nanorcFGBMagenta contained brightmagenta \ nextgroup=@nanorcFGSpec skipwhite syn keyword nanorcFGBCyan contained brightcyan \ nextgroup=@nanorcFGSpec skipwhite syn cluster nanorcBGColor contains=nanorcBGWhite,nanorcBGBlack, \ nanorcBGRed,nanorcBGBlue,nanorcBGGreen, \ nanorcBGYellow,nanorcBGMagenta,nanorcBGCyan, \ nanorcBGBWhite,nanorcBGBBlack,nanorcBGBRed, \ nanorcBGBBlue,nanorcBGBGreen,nanorcBGBYellow, \ nanorcBGBMagenta,nanorcBGBCyan syn keyword nanorcBGWhite contained white \ nextgroup=@nanorcBGSpec skipwhite syn keyword nanorcBGBlack contained black \ nextgroup=@nanorcBGSpec skipwhite syn keyword nanorcBGRed contained red \ nextgroup=@nanorcBGSpec skipwhite syn keyword nanorcBGBlue contained blue \ nextgroup=@nanorcBGSpec skipwhite syn keyword nanorcBGGreen contained green \ nextgroup=@nanorcBGSpec skipwhite syn keyword nanorcBGYellow contained yellow \ nextgroup=@nanorcBGSpec skipwhite syn keyword nanorcBGMagenta contained magenta \ nextgroup=@nanorcBGSpec skipwhite syn keyword nanorcBGCyan contained cyan \ nextgroup=@nanorcBGSpec skipwhite syn keyword nanorcBGBWhite contained brightwhite \ nextgroup=@nanorcBGSpec skipwhite syn keyword nanorcBGBBlack contained brightblack \ nextgroup=@nanorcBGSpec skipwhite syn keyword nanorcBGBRed contained brightred \ nextgroup=@nanorcBGSpec skipwhite syn keyword nanorcBGBBlue contained brightblue \ nextgroup=@nanorcBGSpec skipwhite syn keyword nanorcBGBGreen contained brightgreen \ nextgroup=@nanorcBGSpec skipwhite syn keyword nanorcBGBYellow contained brightyellow \ nextgroup=@nanorcBGSpec skipwhite syn keyword nanorcBGBMagenta contained brightmagenta \ nextgroup=@nanorcBGSpec skipwhite syn keyword nanorcBGBCyan contained brightcyan \ nextgroup=@nanorcBGSpec skipwhite syn match nanorcBGColorSep contained ',' nextgroup=@nanorcBGColor syn cluster nanorcFGSpec contains=nanorcBGColorSep,nanorcRegexes, \ nanorcStartRegion syn cluster nanorcBGSpec contains=nanorcRegexes,nanorcStartRegion syn keyword nanorcStartRegion contained start nextgroup=nanorcStartRegionEq syn match nanorcStartRegionEq contained '=' nextgroup=nanorcRegion syn region nanorcRegion contained display oneline start=+"+ \ end=+"\ze\%([[:blank:]]\|$\)+ \ nextgroup=nanorcEndRegion skipwhite syn keyword nanorcEndRegion contained end nextgroup=nanorcStartRegionEq syn match nanorcEndRegionEq contained '=' nextgroup=nanorcRegex syn region nanorcRegex contained display oneline start=+"+ \ end=+"\ze\%([[:blank:]]\|$\)+ hi def link nanorcTodo Todo hi def link nanorcComment Comment hi def link nanorcKeyword Keyword hi def link nanorcBoolOption Identifier hi def link nanorcStringOption Identifier hi def link nanorcNumberOption Identifier hi def link nanorcSynGroupName String hi def link nanorcString String hi def link nanorcRegexes nanorcString hi def link nanorcNumber Number hi def nanorcFGWhite ctermfg=Gray guifg=Gray hi def nanorcFGBlack ctermfg=Black guifg=Black hi def nanorcFGRed ctermfg=DarkRed guifg=DarkRed hi def nanorcFGBlue ctermfg=DarkBlue guifg=DarkBlue hi def nanorcFGGreen ctermfg=DarkGreen guifg=DarkGreen hi def nanorcFGYellow ctermfg=Brown guifg=Brown hi def nanorcFGMagenta ctermfg=DarkMagenta guifg=DarkMagenta hi def nanorcFGCyan ctermfg=DarkCyan guifg=DarkCyan hi def nanorcFGBWhite ctermfg=White guifg=White hi def nanorcFGBBlack ctermfg=DarkGray guifg=DarkGray hi def nanorcFGBRed ctermfg=Red guifg=Red hi def nanorcFGBBlue ctermfg=Blue guifg=Blue hi def nanorcFGBGreen ctermfg=Green guifg=Green hi def nanorcFGBYellow ctermfg=Yellow guifg=Yellow hi def nanorcFGBMagenta ctermfg=Magenta guifg=Magenta hi def nanorcFGBCyan ctermfg=Cyan guifg=Cyan hi def link nanorcBGColorSep Normal hi def nanorcBGWhite ctermbg=Gray guibg=Gray hi def nanorcBGBlack ctermbg=Black guibg=Black hi def nanorcBGRed ctermbg=DarkRed guibg=DarkRed hi def nanorcBGBlue ctermbg=DarkBlue guibg=DarkBlue hi def nanorcBGGreen ctermbg=DarkGreen guibg=DarkGreen hi def nanorcBGYellow ctermbg=Brown guibg=Brown hi def nanorcBGMagenta ctermbg=DarkMagenta guibg=DarkMagenta hi def nanorcBGCyan ctermbg=DarkCyan guibg=DarkCyan hi def nanorcBGBWhite ctermbg=White guibg=White hi def nanorcBGBBlack ctermbg=DarkGray guibg=DarkGray hi def nanorcBGBRed ctermbg=Red guibg=Red hi def nanorcBGBBlue ctermbg=Blue guibg=Blue hi def nanorcBGBGreen ctermbg=Green guibg=Green hi def nanorcBGBYellow ctermbg=Yellow guibg=Yellow hi def nanorcBGBMagenta ctermbg=Magenta guibg=Magenta hi def nanorcBGBCyan ctermbg=Cyan guibg=Cyan hi def link nanorcStartRegion Type hi def link nanorcStartRegionEq Operator hi def link nanorcRegion nanorcString hi def link nanorcEndRegion Type hi def link nanorcEndRegionEq Operator hi def link nanorcRegex nanoRegexes let b:current_syntax = "nanorc" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/nasm.vim000066400000000000000000000617561267703067000173000ustar00rootroot00000000000000" Vim syntax file " Language: NASM - The Netwide Assembler (v0.98) " Maintainer: Andriy Sokolov " Original Author: Manuel M.H. Stol " Former Maintainer: Manuel M.H. Stol " Last Change: 2012 Feb 7 " NASM Home: http://www.nasm.us/ " 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="\" end="\" 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="\" end="\" 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="\" end="\" 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="\" end="\" 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 " Todo: allow STRUC/ISTRUC to be used inside preprocessor conditional block 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\|use\)\>"hs=e-3 syn match nasmPreProc "^\s*%line\>"hs=e-4 syn match nasmPreProc "^\s*%\(clear\|error\|fatal\)\>"hs=e-5 syn match nasmPreProc "^\s*%\(endrep\|strlen\|substr\)\>"hs=e-6 syn match nasmPreProc "^\s*%\(exitrep\|warning\)\>"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 nasmDefine "^\s*%unmacro\>"hs=e-7 syn match nasmInclude "^\s*%include\>"hs=e-7 " Todo: Treat the line tail after %fatal, %error, %warning as text " 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 "\" syn match nasmGen64Register "\" syn match nasmSegRegister "\<[C-GS]S\>" syn match nasmSpcRegister "\" syn match nasmFpuRegister "\" syn match nasmMmxRegister "\" syn match nasmSseRegister "\" syn match nasmCtrlRegister "\" syn match nasmDebugRegister "\" syn match nasmTestRegister "\" syn match nasmRegisterError "\<\(CR[15-9]\|DR[4-58-9]\|TR[0-28-9]\)\>" syn match nasmRegisterError "\" syn match nasmRegisterError "\\)" syn match nasmRegisterError "\" " 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 "\" syn match nasmInstrModifier "\(^\|:\)\s*[C-GS]S\>"ms=e-1 syn keyword nasmInstrModifier A16 A32 O16 O32 syn match nasmInstrModifier "\"lc=5,ms=e-1 " the 'to' keyword is not allowed for fpu-pop instructions (yet) "syn match nasmInstrModifier "\"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 "\" syn match nasmInstructnError "\\s*[^:]"he=e-1 syn match nasmStdInstruction "\<\(CMOV\|J\|SET\)\(N\=\([ABGL]E\=\|[CEOSZ]\)\|P[EO]\=\)\>" syn match nasmStdInstruction "\" 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 CMPSQ syn keyword nasmStdInstruction CMPXCHG CMPXCHG8B CPUID CWD[E] CQO syn keyword nasmStdInstruction DAA DAS DEC DIV ENTER syn keyword nasmStdInstruction IDIV IMUL INC INT[O] IRET[D] IRETW IRETQ syn keyword nasmStdInstruction JCXZ JECXZ JMP syn keyword nasmStdInstruction LAHF LDS LEA LEAVE LES LFS LGS LODSB LODSD LODSQ syn keyword nasmStdInstruction LODSW LOOP[E] LOOPNE LOOPNZ LOOPZ LSS syn keyword nasmStdInstruction MOVSB MOVSD MOVSW MOVSX MOVSQ MOVZX MUL NEG NOP NOT syn keyword nasmStdInstruction OR POPA[D] POPAW POPF[D] POPFW POPFQ syn keyword nasmStdInstruction PUSH[AD] PUSHAW PUSHF[D] PUSHFW PUSHFQ 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 STOSQ SUB syn keyword nasmStdInstruction TEST XADD XCHG XLATB XOR syn keyword nasmStdInstruction LFENCE MFENCE SFENCE " 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 "\"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 "\"me=s+3 syn keyword nasmSysInstruction INVLPG " Debugging Instructions: (privileged) syn match nasmDbgInstruction "\"me=s+3 syn keyword nasmDbgInstruction INT1 INT3 RDMSR RDTSC RDPMC WRMSR " Floating Point Instructions: (requires FPU) syn match nasmFpuInstruction "\" 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 "\" syn match nasmInstructnError "\" 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 "\" syn match nasmSseInstruction "\" 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 "\"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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/nastran.vim000066400000000000000000000210351267703067000177720ustar00rootroot00000000000000" Vim syntax file " Language: NASTRAN input/DMAP " Maintainer: Tom Kowalski " 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 else command -nargs=+ HiLink hi link 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 vim-7.4.1689/runtime/syntax/natural.vim000066400000000000000000000161631267703067000200000ustar00rootroot00000000000000" Vim syntax file " " Language: NATURAL " Version: 2.1.0.5 " Maintainer: Marko von Oppen " Last Changed: 2012-02-05 18:50:43 " Support: http://www.von-oppen.com/ " 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 let s:cpo_save = &cpo set cpo&vim " 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 numeric 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 syn keyword naturalKeyword alarm text help eject index window base size syn keyword naturalKeyword format printer skip lines " functions syn keyword naturalKeyword abs atn cos exp frac int log sgn sin sqrt tan val old syn keyword naturalKeyword pos " 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]*\>" " mark keyword special handling syn keyword naturalKeyword mark nextgroup=naturalMark skipwhite syn match naturalMark "\<\*[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 modified " 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 else command -nargs=+ HiLink hi def link 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 PreProc delcommand HiLink endif let b:current_syntax = "natural" let &cpo = s:cpo_save unlet s:cpo_save " vim:set ts=8 sw=8 noet ft=vim list: vim-7.4.1689/runtime/syntax/ncf.vim000066400000000000000000000325421267703067000170770ustar00rootroot00000000000000" Vim syntax file " Language: Novell "NCF" Batch File " Maintainer: Jonathan J. Miner " Last Change: Tue, 04 Sep 2001 16:20:33 CDT " $Id: ncf.vim,v 1.1 2004/06/13 16:31:58 vimboss Exp $ " 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 else command -nargs=+ HiLink hi def link 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" vim-7.4.1689/runtime/syntax/netrc.vim000066400000000000000000000036021267703067000174370ustar00rootroot00000000000000" Vim syntax file " Language: netrc(5) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2010-01-03 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn keyword netrcKeyword machine nextgroup=netrcMachine skipwhite skipnl syn keyword netrcKeyword account \ login \ nextgroup=netrcLogin,netrcSpecial skipwhite skipnl syn keyword netrcKeyword password nextgroup=netrcPassword skipwhite skipnl syn keyword netrcKeyword default syn keyword netrcKeyword macdef \ nextgroup=netrcInit,netrcMacroName skipwhite skipnl syn region netrcMacro contained start='.' end='^$' syn match netrcMachine contained display '\S\+' syn match netrcMachine contained display '"[^\\"]*\(\\.[^\\"]*\)*"' syn match netrcLogin contained display '\S\+' syn match netrcLogin contained display '"[^\\"]*\(\\.[^\\"]*\)*"' syn match netrcPassword contained display '\S\+' syn match netrcPassword contained display '"[^\\"]*\(\\.[^\\"]*\)*"' syn match netrcMacroName contained display '\S\+' \ nextgroup=netrcMacro skipwhite skipnl syn match netrcMacroName contained display '"[^\\"]*\(\\.[^\\"]*\)*"' \ nextgroup=netrcMacro skipwhite skipnl syn keyword netrcSpecial contained anonymous syn match netrcInit contained '\" contained skipwhite " ----------------------------- " Special filetype highlighting {{{1 " ----------------------------- if exists("g:netrw_special_syntax") && netrw_special_syntax syn match netrwBak "\(\S\+ \)*\S\+\.bak\>" contains=netrwTreeBar,@NoSpell syn match netrwCompress "\(\S\+ \)*\S\+\.\%(gz\|bz2\|Z\|zip\)\>" contains=netrwTreeBar,@NoSpell if has("unix") syn match netrwCoreDump "\" contains=netrwTreeBar,@NoSpell endif syn match netrwLex "\(\S\+ \)*\S\+\.\%(l\|lex\)\>" contains=netrwTreeBar,@NoSpell syn match netrwYacc "\(\S\+ \)*\S\+\.y\>" contains=netrwTreeBar,@NoSpell syn match netrwData "\(\S\+ \)*\S\+\.dat\>" contains=netrwTreeBar,@NoSpell syn match netrwDoc "\(\S\+ \)*\S\+\.\%(doc\|txt\|pdf\|ps\)" contains=netrwTreeBar,@NoSpell syn match netrwHdr "\(\S\+ \)*\S\+\.\%(h\|hpp\)\>" contains=netrwTreeBar,@NoSpell syn match netrwLib "\(\S\+ \)*\S*\.\%(a\|so\|lib\|dll\)\>" contains=netrwTreeBar,@NoSpell syn match netrwMakeFile "\<[mM]akefile\>\|\(\S\+ \)*\S\+\.mak\>" contains=netrwTreeBar,@NoSpell syn match netrwObj "\(\S\+ \)*\S*\.\%(o\|obj\)\>" contains=netrwTreeBar,@NoSpell syn match netrwTags "\<\(ANmenu\|ANtags\)\>" contains=netrwTreeBar,@NoSpell syn match netrwTags "\" contains=netrwTreeBar,@NoSpell syn match netrwTilde "\(\S\+ \)*\S\+\~\*\=\>" contains=netrwTreeBar,@NoSpell syn match netrwTmp "\\|\(\S\+ \)*\S*tmp\>" contains=netrwTreeBar,@NoSpell endif " --------------------------------------------------------------------- " Highlighting Links: {{{1 if !exists("did_drchip_netrwlist_syntax") let did_drchip_netrwlist_syntax= 1 hi default link netrwClassify Function hi default link netrwCmdSep Delimiter hi default link netrwComment Comment hi default link netrwDir Directory hi default link netrwHelpCmd Function hi default link netrwQHTopic Number hi default link netrwHidePat Statement hi default link netrwHideSep netrwComment hi default link netrwList Statement hi default link netrwVersion Identifier hi default link netrwSymLink Question hi default link netrwExe PreProc hi default link netrwDateSep Delimiter hi default link netrwTreeBar Special hi default link netrwTimeSep netrwDateSep hi default link netrwComma netrwComment hi default link netrwHide netrwComment hi default link netrwMarkFile TabLineSel hi default link netrwLink Special " special syntax highlighting (see :he g:netrw_special_syntax) hi default link netrwBak NonText hi default link netrwCompress Folded hi default link netrwCoreDump WarningMsg hi default link netrwData DiffChange hi default link netrwHdr netrwPlain hi default link netrwLex netrwPlain hi default link netrwLib DiffChange hi default link netrwMakefile DiffChange hi default link netrwObj Folded hi default link netrwTilde Folded hi default link netrwTmp Folded hi default link netrwTags Folded hi default link netrwYacc netrwPlain endif " Current Syntax: {{{1 let b:current_syntax = "netrwlist" " --------------------------------------------------------------------- " vim: ts=8 fdm=marker vim-7.4.1689/runtime/syntax/ninja.vim000066400000000000000000000051001267703067000174160ustar00rootroot00000000000000" ninja build file syntax. " Language: ninja build file as described at " http://martine.github.com/ninja/manual.html " Version: 1.4 " Last Change: 2014/05/13 " Maintainer: Nicolas Weber " Version 1.4 of this script is in the upstream vim repository and will be " included in the next vim release. If you change this, please send your change " upstream. " ninja lexer and parser are at " https://github.com/martine/ninja/blob/master/src/lexer.in.cc " https://github.com/martine/ninja/blob/master/src/manifest_parser.cc if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn case match syn match ninjaComment /#.*/ contains=@Spell " Toplevel statements are the ones listed here and " toplevel variable assignments (ident '=' value). " lexer.in.cc, ReadToken() and manifest_parser.cc, Parse() syn match ninjaKeyword "^build\>" syn match ninjaKeyword "^rule\>" syn match ninjaKeyword "^pool\>" syn match ninjaKeyword "^default\>" syn match ninjaKeyword "^include\>" syn match ninjaKeyword "^subninja\>" " Both 'build' and 'rule' begin a variable scope that ends " on the first line without indent. 'rule' allows only a " limited set of magic variables, 'build' allows general " let assignments. " manifest_parser.cc, ParseRule() syn region ninjaRule start="^rule" end="^\ze\S" contains=ALL transparent syn keyword ninjaRuleCommand contained command deps depfile description generator \ pool restat rspfile rspfile_content syn region ninjaPool start="^pool" end="^\ze\S" contains=ALL transparent syn keyword ninjaPoolCommand contained depth " Strings are parsed as follows: " lexer.in.cc, ReadEvalString() " simple_varname = [a-zA-Z0-9_-]+; " varname = [a-zA-Z0-9_.-]+; " $$ -> $ " $\n -> line continuation " '$ ' -> escaped space " $simple_varname -> variable " ${varname} -> variable syn match ninjaDollar "\$\$" syn match ninjaWrapLineOperator "\$$" syn match ninjaSimpleVar "\$[a-zA-Z0-9_-]\+" syn match ninjaVar "\${[a-zA-Z0-9_.-]\+}" " operators are: " variable assignment = " rule definition : " implicit dependency | " order-only dependency || syn match ninjaOperator "\(=\|:\||\|||\)\ze\s" hi def link ninjaComment Comment hi def link ninjaKeyword Keyword hi def link ninjaRuleCommand Statement hi def link ninjaPoolCommand Statement hi def link ninjaDollar ninjaOperator hi def link ninjaWrapLineOperator ninjaOperator hi def link ninjaOperator Operator hi def link ninjaSimpleVar ninjaVar hi def link ninjaVar Identifier let b:current_syntax = "ninja" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/nosyntax.vim000066400000000000000000000013631267703067000202110ustar00rootroot00000000000000" Vim syntax support file " Maintainer: Bram Moolenaar " Last Change: 2006 Apr 16 " This file is used for ":syntax off". " It removes the autocommands and stops highlighting for all buffers. if !has("syntax") finish endif " Remove all autocommands for the Syntax event. This also avoids that " "syntax=foo" in a modeline triggers the SynSet() function of synload.vim. au! Syntax " 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 if exists("syntax_on") unlet syntax_on endif if exists("syntax_manual") unlet syntax_manual endif vim-7.4.1689/runtime/syntax/nqc.vim000066400000000000000000000340601267703067000171070ustar00rootroot00000000000000" Vim syntax file " Language: NQC - Not Quite C, for LEGO mindstorms " NQC homepage: http://www.enteract.com/~dbaum/nqc/ " Maintainer: Stefan Scherer " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/nroff.vim000066400000000000000000000175501267703067000174450ustar00rootroot00000000000000" VIM syntax file " Language: nroff/groff " Maintainer: Pedro Alejandro Lpez-Valencia " URL: http://vorbote.wordpress.com/ " Last Change: 2012 Feb 2 " " {{{1 Acknowledgements " " ACKNOWLEDGEMENTS: " " My thanks to Jrme Plt , 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 let s:cpo_save = &cpo set cpo&vim " " {{{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 nroffReqArg 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 " ------------------------------------------------------------ " " XXX: write proper syntax highlight for eqn / tbl / pic ? " 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 else command -nargs=+ HiLink hi def link 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" let &cpo = s:cpo_save unlet s:cpo_save " vim600: set fdm=marker fdl=2: vim-7.4.1689/runtime/syntax/nsis.vim000066400000000000000000000232241267703067000173020ustar00rootroot00000000000000" Vim syntax file " Language: NSIS script, for version of NSIS 1.91 and later " Maintainer: Alex Jakushev " 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 else command -nargs=+ HiLink hi def link 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" vim-7.4.1689/runtime/syntax/obj.vim000066400000000000000000000061311267703067000170760ustar00rootroot00000000000000" Vim syntax file " Language: 3D wavefront's obj file " Maintainer: Vincent Berthoux " File Types: .obj (used in 3D) " Last Change: 2010 May 18 " " For version 5.x: Clear all syntax items " 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 objError "^\a\+" syn match objKeywords "^cstype\s" syn match objKeywords "^ctech\s" syn match objKeywords "^stech\s" syn match objKeywords "^deg\s" syn match objKeywords "^curv\(2\?\)\s" syn match objKeywords "^parm\s" syn match objKeywords "^surf\s" syn match objKeywords "^end\s" syn match objKeywords "^bzp\s" syn match objKeywords "^bsp\s" syn match objKeywords "^res\s" syn match objKeywords "^cdc\s" syn match objKeywords "^con\s" syn match objKeywords "^shadow_obj\s" syn match objKeywords "^trace_obj\s" syn match objKeywords "^usemap\s" syn match objKeywords "^lod\s" syn match objKeywords "^maplib\s" syn match objKeywords "^d_interp\s" syn match objKeywords "^c_interp\s" syn match objKeywords "^bevel\s" syn match objKeywords "^mg\s" syn match objKeywords "^s\s" syn match objKeywords "^con\s" syn match objKeywords "^trim\s" syn match objKeywords "^hole\s" syn match objKeywords "^scrv\s" syn match objKeywords "^sp\s" syn match objKeywords "^step\s" syn match objKeywords "^bmat\s" syn match objKeywords "^csh\s" syn match objKeywords "^call\s" syn match objComment "^#.*" syn match objVertex "^v\s" syn match objFace "^f\s" syn match objVertice "^vt\s" syn match objNormale "^vn\s" syn match objGroup "^g\s.*" syn match objMaterial "^usemtl\s.*" syn match objInclude "^mtllib\s.*" syn match objFloat "-\?\d\+\.\d\+\(e\(+\|-\)\d\+\)\?" syn match objInt "\d\+" syn match objIndex "\d\+\/\d*\/\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_cabal_syn_inits") if version < 508 let did_cabal_syn_inits = 1 command -nargs=+ HiLink hi link else command -nargs=+ HiLink hi def link endif HiLink objError Error HiLink objComment Comment HiLink objInclude PreProc HiLink objFloat Float HiLink objInt Number HiLink objGroup Structure HiLink objIndex Constant HiLink objMaterial Label HiLink objVertex Keyword HiLink objNormale Keyword HiLink objVertice Keyword HiLink objFace Keyword HiLink objKeywords Keyword delcommand HiLink endif let b:current_syntax = "obj" " vim: ts=8 vim-7.4.1689/runtime/syntax/objc.vim000066400000000000000000001213701267703067000172440ustar00rootroot00000000000000" Vim syntax file " Language: Objective-C " Maintainer: Kazunobu Kuriyama " Last Change: 2015 Dec 14 """ Preparation for loading ObjC stuff if exists("b:current_syntax") finish endif if &filetype != 'objcpp' syn clear runtime! syntax/c.vim endif let s:cpo_save = &cpo set cpo&vim """ ObjC proper stuff follows... syn keyword objcPreProcMacro __OBJC__ __OBJC2__ __clang__ " Defined Types syn keyword objcPrincipalType id Class SEL IMP BOOL instancetype syn keyword objcUsefulTerm nil Nil NO YES " Preprocessor Directives syn region objcImported display contained start=+"+ skip=+\\\\\|\\"+ end=+"+ syn match objcImported display contained "\(<\h[-a-zA-Z0-9_/]*\.h>\|<[a-z0-9]\+>\)" syn match objcImport display "^\s*\(%:\|#\)\s*import\>\s*["<]" contains=objcImported " ObjC Compiler Directives syn match objcObjDef display /@interface\>\|@implementation\>\|@end\>\|@class\>/ syn match objcProtocol display /@protocol\>\|@optional\>\|@required\>/ syn match objcProperty display /@property\>\|@synthesize\>\|@dynamic\>/ syn match objcIvarScope display /@private\>\|@protected\>\|@public\>\|@package\>/ syn match objcInternalRep display /@selector\>\|@encode\>/ syn match objcException display /@try\>\|@throw\>\|@catch\|@finally\>/ syn match objcThread display /@synchronized\>/ syn match objcPool display /@autoreleasepool\>/ syn match objcModuleImport display /@import\>/ " ObjC Constant Strings syn match objcSpecial display contained "%@" syn region objcString start=+\(@"\|"\)+ skip=+\\\\\|\\"+ end=+"+ contains=cFormat,cSpecial,objcSpecial " ObjC Hidden Arguments syn keyword objcHiddenArgument self _cmd super " ObjC Type Qualifiers for Blocks syn keyword objcBlocksQualifier __block " ObjC Type Qualifiers for Object Lifetime syn keyword objcObjectLifetimeQualifier __strong __weak __unsafe_unretained __autoreleasing " ObjC Type Qualifiers for Toll-Free Bridge syn keyword objcTollFreeBridgeQualifier __bridge __bridge_retained __bridge_transfer " ObjC Type Qualifiers for Remote Messaging syn match objcRemoteMessagingQualifier display contained /\((\s*oneway\s\+\|(\s*in\s\+\|(\s*out\s\+\|(\s*inout\s\+\|(\s*bycopy\s\+\(in\(out\)\?\|out\)\?\|(\s*byref\s\+\(in\(out\)\?\|out\)\?\)/hs=s+1 " ObjC Storage Classes syn keyword objcStorageClass _Nullable _Nonnull _Null_unspecified syn keyword objcStorageClass __nullable __nonnull __null_unspecified syn keyword objcStorageClass nullable nonnull null_unspecified " ObjC type specifier syn keyword objcTypeSpecifier __kindof __covariant " ObjC Type Infomation Parameters syn keyword objcTypeInfoParams ObjectType KeyType " shorthand syn cluster objcTypeQualifier contains=objcBlocksQualifier,objcObjectLifetimeQualifier,objcTollFreeBridgeQualifier,objcRemoteMessagingQualifier " ObjC Fast Enumeration syn match objcFastEnumKeyword display /\sin\(\s\|$\)/ " ObjC Literal Syntax syn match objcLiteralSyntaxNumber display /@\(YES\>\|NO\>\|\d\|-\|+\)/ contains=cNumber,cFloat,cOctal syn match objcLiteralSyntaxSpecialChar display /@'/ contains=cSpecialCharacter syn match objcLiteralSyntaxChar display /@'[^\\]'/ syn match objcLiteralSyntaxOp display /@\((\|\[\|{\)/me=e-1,he=e-1 " ObjC Declared Property Attributes syn match objDeclPropAccessorNameAssign display /\s*=\s*/ contained syn region objcDeclPropAccessorName display start=/\(getter\|setter\)/ end=/\h\w*/ contains=objDeclPropAccessorNameAssign syn keyword objcDeclPropAccessorType readonly readwrite contained syn keyword objcDeclPropAssignSemantics assign retain copy contained syn keyword objcDeclPropAtomicity nonatomic contained syn keyword objcDeclPropARC strong weak contained syn match objcDeclPropNullable /\((\|\s\)nullable\(,\|)\)/ms=s+1,hs=s+1,me=e-1,he=e-1 contained syn match objcDeclPropNonnull /\((\|\s\)nonnull\(,\|)\)/ms=s+1,hs=s+1,me=e-1,he=e-1 contained syn match objcDeclPropNullUnspecified /\((\|\s\)null_unspecified\(,\|)\)/ms=s+1,hs=s+1,me=e-1,he=e-1 contained syn keyword objcDeclProcNullResettable null_resettable contained syn region objcDeclProp display transparent keepend start=/@property\s*(/ end=/)/ contains=objcProperty,objcDeclPropAccessorName,objcDeclPropAccessorType,objcDeclPropAssignSemantics,objcDeclPropAtomicity,objcDeclPropARC,objcDeclPropNullable,objcDeclPropNonnull,objcDeclPropNullUnspecified,objcDeclProcNullResettable " To distinguish colons in methods and dictionaries from those in C's labels. syn match objcColon display /^\s*\h\w*\s*\:\(\s\|.\)/me=e-1,he=e-1 " To distinguish a protocol list from system header files syn match objcProtocolList display /<\h\w*\(\s*,\s*\h\w*\)*>/ contains=objcPrincipalType,cType,Type,objcType,objcTypeInfoParams " Type info for collection classes syn match objcTypeInfo display /<\h\w*\s*<\(\h\w*\s*\**\|\h\w*\)>>/ contains=objcPrincipalType,cType,Type,objcType,objcTypeInfoParams " shorthand syn cluster objcCEntities contains=cType,cStructure,cStorageClass,cString,cCharacter,cSpecialCharacter,cNumbers,cConstant,cOperator,cComment,cCommentL,cStatement,cLabel,cConditional,cRepeat syn cluster objcObjCEntities contains=objcHiddenArgument,objcPrincipalType,objcString,objcUsefulTerm,objcProtocol,objcInternalRep,objcException,objcThread,objcPool,objcModuleImport,@objcTypeQualifier,objcLiteralSyntaxNumber,objcLiteralSyntaxOp,objcLiteralSyntaxChar,objcLiteralSyntaxSpecialChar,objcProtocolList,objcColon,objcFastEnumKeyword,objcType,objcClass,objcMacro,objcEnum,objcEnumValue,objcExceptionValue,objcNotificationValue,objcConstVar,objcPreProcMacro,objcTypeInfo " Objective-C Message Expressions syn region objcMethodCall start=/\[/ end=/\]/ contains=objcMethodCall,objcBlocks,@objcObjCEntities,@objcCEntities " To distinguish class method and instance method syn match objcInstanceMethod display /^s*-\s*/ syn match objcClassMethod display /^s*+\s*/ " ObjC Blocks syn region objcBlocks start=/\(\^\s*([^)]\+)\s*{\|\^\s*{\)/ end=/}/ contains=objcBlocks,objcMethodCall,@objcObjCEntities,@objcCEntities syn cluster cParenGroup add=objcMethodCall syn cluster cPreProcGroup add=objcMethodCall """ Foundation Framework syn match objcClass /Protocol\s*\*/me=s+8,he=s+8 """"""""""""""""" " NSObjCRuntime.h syn keyword objcType NSInteger NSUInteger NSComparator syn keyword objcEnum NSComparisonResult syn keyword objcEnumValue NSOrderedAscending NSOrderedSame NSOrderedDescending syn keyword objcEnum NSEnumerationOptions syn keyword objcEnumValue NSEnumerationConcurrent NSEnumerationReverse syn keyword objcEnum NSSortOptions syn keyword objcEnumValue NSSortConcurrent NSSortStable syn keyword objcEnumValue NSNotFound syn keyword objcMacro NSIntegerMax NSIntegerMin NSUIntegerMax syn keyword objcMacro NS_INLINE NS_BLOCKS_AVAILABLE NS_NONATOMIC_IOSONLY NS_FORMAT_FUNCTION NS_FORMAT_ARGUMENT NS_RETURNS_RETAINED NS_RETURNS_NOT_RETAINED NS_RETURNS_INNER_POINTER NS_AUTOMATED_REFCOUNT_UNAVAILABLE NS_AUTOMATED_REFCOUNT_WEAK_UNAVAILABLE NS_REQUIRES_PROPERTY_DEFINITIONS NS_REPLACES_RECEIVER NS_RELEASES_ARGUMENT NS_VALID_UNTIL_END_OF_SCOPE NS_ROOT_CLASS NS_REQUIRES_SUPER NS_PROTOCOL_REQUIRES_EXPLICIT_IMPLEMENTATION NS_DESIGNATED_INITIALIZER NS_REQUIRES_NIL_TERMINATION syn keyword objcEnum NSQualityOfService syn keyword objcEnumValue NSQualityOfServiceUserInteractive NSQualityOfServiceUserInitiated NSQualityOfServiceUtility NSQualityOfServiceBackground NSQualityOfServiceDefault " NSRange.h syn keyword objcType NSRange NSRangePointer " NSGeometry.h syn keyword objcType NSPoint NSPointPointer NSPointArray NSSize NSSizePointer NSSizeArray NSRect NSRectPointer NSRectArray NSEdgeInsets syn keyword objcEnum NSRectEdge syn keyword objcEnumValue NSMinXEdge NSMinYEdge NSMaxXEdge NSMaxYEdge syn keyword objcEnumValue NSRectEdgeMinX NSRectEdgeMinY NSRectEdgeMaxX NSRectEdgeMaxY syn keyword objcConstVar NSZeroPoint NSZeroSize NSZeroRect NSEdgeInsetsZero syn keyword cType CGFloat CGPoint CGSize CGRect syn keyword objcEnum NSAlignmentOptions syn keyword objcEnumValue NSAlignMinXInward NSAlignMinYInward NSAlignMaxXInward NSAlignMaxYInward NSAlignWidthInward NSAlignHeightInward NSAlignMinXOutward NSAlignMinYOutward NSAlignMaxXOutward NSAlignMaxYOutward NSAlignWidthOutward NSAlignHeightOutward NSAlignMinXNearest NSAlignMinYNearest NSAlignMaxXNearest NSAlignMaxYNearest NSAlignWidthNearest NSAlignHeightNearest NSAlignRectFlipped NSAlignAllEdgesInward NSAlignAllEdgesOutward NSAlignAllEdgesNearest " NSDecimal.h syn keyword objcType NSDecimal syn keyword objcEnum NSRoundingMode syn keyword objcEnumValue NSRoundPlain NSRoundDown NSRoundUp NSRoundBankers syn keyword objcEnum NSCalculationError syn keyword objcEnumValue NSCalculationNoError NSCalculationLossOfPrecision NSCalculationUnderflow NSCalculationOverflow NSCalculationDivideByZero syn keyword objcConstVar NSDecimalMaxSize NSDecimalNoScale " NSDate.h syn match objcClass /NSDate\s*\*/me=s+6,he=s+6 syn keyword objcType NSTimeInterval syn keyword objcNotificationValue NSSystemClockDidChangeNotification syn keyword objcMacro NSTimeIntervalSince1970 " NSZone.h syn match objcType /NSZone\s*\*/me=s+6,he=s+6 syn keyword objcEnumValue NSScannedOption NSCollectorDisabledOption " NSError.h syn match objcClass /NSError\s*\*/me=s+7,he=s+7 syn keyword objcConstVar NSCocoaErrorDomain NSPOSIXErrorDomain NSOSStatusErrorDomain NSMachErrorDomain NSUnderlyingErrorKey NSLocalizedDescriptionKey NSLocalizedFailureReasonErrorKey NSLocalizedRecoverySuggestionErrorKey NSLocalizedRecoveryOptionsErrorKey NSRecoveryAttempterErrorKey NSHelpAnchorErrorKey NSStringEncodingErrorKey NSURLErrorKey NSFilePathErrorKey " NSException.h syn match objcClass /NSException\s*\*/me=s+11,he=s+11 syn match objcClass /NSAssertionHandler\s*\*/me=s+18,he=s+18 syn keyword objcType NSUncaughtExceptionHandler syn keyword objcConstVar NSGenericException NSRangeException NSInvalidArgumentException NSInternalInconsistencyException NSMallocException NSObjectInaccessibleException NSObjectNotAvailableException NSDestinationInvalidException NSPortTimeoutException NSInvalidSendPortException NSInvalidReceivePortException NSPortSendException NSPortReceiveException NSOldStyleException " NSNotification.h syn match objcClass /NSNotification\s*\*/me=s+14,he=s+14 syn match objcClass /NSNotificationCenter\s*\*/me=s+20,he=s+20 " NSDistributedNotificationCenter.h syn match objcClass /NSDistributedNotificationCenter\s*\*/me=s+31,he=s+31 syn keyword objcConstVar NSLocalNotificationCenterType syn keyword objcEnum NSNotificationSuspensionBehavior syn keyword objcEnumValue NSNotificationSuspensionBehaviorDrop NSNotificationSuspensionBehaviorCoalesce NSNotificationSuspensionBehaviorHold NSNotificationSuspensionBehaviorHold NSNotificationSuspensionBehaviorDeliverImmediately syn keyword objcEnumValue NSNotificationDeliverImmediately NSNotificationPostToAllSessions syn keyword objcEnum NSDistributedNotificationOptions syn keyword objcEnumValue NSDistributedNotificationDeliverImmediately NSDistributedNotificationPostToAllSessions " NSNotificationQueue.h syn match objcClass /NSNotificationQueue\s*\*/me=s+19,he=s+19 syn keyword objcEnum NSPostingStyle syn keyword objcEnumValue NSPostWhenIdle NSPostASAP NSPostNow syn keyword objcEnum NSNotificationCoalescing syn keyword objcEnumValue NSNotificationNoCoalescing NSNotificationCoalescingOnName NSNotificationCoalescingOnSender " NSEnumerator.h syn match objcClass /NSEnumerator\s*\*/me=s+12,he=s+12 syn match objcClass /NSEnumerator<.*>\s*\*/me=s+12,he=s+12 contains=objcTypeInfoParams syn keyword objcType NSFastEnumerationState " NSIndexSet.h syn match objcClass /NSIndexSet\s*\*/me=s+10,he=s+10 syn match objcClass /NSMutableIndexSet\s*\*/me=s+17,he=s+17 " NSCharecterSet.h syn match objcClass /NSCharacterSet\s*\*/me=s+14,he=s+14 syn match objcClass /NSMutableCharacterSet\s*\*/me=s+21,he=s+21 syn keyword objcConstVar NSOpenStepUnicodeReservedBase " NSURL.h syn match objcClass /NSURL\s*\*/me=s+5,he=s+5 syn keyword objcEnum NSURLBookmarkCreationOptions syn keyword objcEnumValue NSURLBookmarkCreationPreferFileIDResolution NSURLBookmarkCreationMinimalBookmark NSURLBookmarkCreationSuitableForBookmarkFile NSURLBookmarkCreationWithSecurityScope NSURLBookmarkCreationSecurityScopeAllowOnlyReadAccess syn keyword objcEnum NSURLBookmarkResolutionOptions syn keyword objcEnumValue NSURLBookmarkResolutionWithoutUI NSURLBookmarkResolutionWithoutMounting NSURLBookmarkResolutionWithSecurityScope syn keyword objcType NSURLBookmarkFileCreationOptions syn keyword objcConstVar NSURLFileScheme NSURLKeysOfUnsetValuesKey syn keyword objcConstVar NSURLNameKey NSURLLocalizedNameKey NSURLIsRegularFileKey NSURLIsDirectoryKey NSURLIsSymbolicLinkKey NSURLIsVolumeKey NSURLIsPackageKey NSURLIsApplicationKey NSURLApplicationIsScriptableKey NSURLIsSystemImmutableKey NSURLIsUserImmutableKey NSURLIsHiddenKey NSURLHasHiddenExtensionKey NSURLCreationDateKey NSURLContentAccessDateKey NSURLContentModificationDateKey NSURLAttributeModificationDateKey NSURLLinkCountKey NSURLParentDirectoryURLKey NSURLVolumeURLKey NSURLTypeIdentifierKey NSURLLocalizedTypeDescriptionKey NSURLLabelNumberKey NSURLLabelColorKey NSURLLocalizedLabelKey NSURLEffectiveIconKey NSURLCustomIconKey NSURLFileResourceIdentifierKey NSURLVolumeIdentifierKey NSURLPreferredIOBlockSizeKey NSURLIsReadableKey NSURLIsWritableKey NSURLIsExecutableKey NSURLFileSecurityKey NSURLIsExcludedFromBackupKey NSURLTagNamesKey NSURLPathKey NSURLIsMountTriggerKey NSURLGenerationIdentifierKey NSURLDocumentIdentifierKey NSURLAddedToDirectoryDateKey NSURLQuarantinePropertiesKey NSURLFileResourceTypeKey syn keyword objcConstVar NSURLFileResourceTypeNamedPipe NSURLFileResourceTypeCharacterSpecial NSURLFileResourceTypeDirectory NSURLFileResourceTypeBlockSpecial NSURLFileResourceTypeRegular NSURLFileResourceTypeSymbolicLink NSURLFileResourceTypeSocket NSURLFileResourceTypeUnknown NSURLThumbnailDictionaryKey NSURLThumbnailKey NSThumbnail1024x1024SizeKey syn keyword objcConstVar NSURLFileSizeKey NSURLFileAllocatedSizeKey NSURLTotalFileSizeKey NSURLTotalFileAllocatedSizeKey NSURLIsAliasFileKey NSURLFileProtectionKey NSURLFileProtectionNone NSURLFileProtectionComplete NSURLFileProtectionCompleteUnlessOpen NSURLFileProtectionCompleteUntilFirstUserAuthentication syn keyword objcConstVar NSURLVolumeLocalizedFormatDescriptionKey NSURLVolumeTotalCapacityKey NSURLVolumeAvailableCapacityKey NSURLVolumeResourceCountKey NSURLVolumeSupportsPersistentIDsKey NSURLVolumeSupportsSymbolicLinksKey NSURLVolumeSupportsHardLinksKey NSURLVolumeSupportsJournalingKey NSURLVolumeIsJournalingKey NSURLVolumeSupportsSparseFilesKey NSURLVolumeSupportsZeroRunsKey NSURLVolumeSupportsCaseSensitiveNamesKey NSURLVolumeSupportsCasePreservedNamesKey NSURLVolumeSupportsRootDirectoryDatesKey NSURLVolumeSupportsVolumeSizesKey NSURLVolumeSupportsRenamingKey NSURLVolumeSupportsAdvisoryFileLockingKey NSURLVolumeSupportsExtendedSecurityKey NSURLVolumeIsBrowsableKey NSURLVolumeMaximumFileSizeKey NSURLVolumeIsEjectableKey NSURLVolumeIsRemovableKey NSURLVolumeIsInternalKey NSURLVolumeIsAutomountedKey NSURLVolumeIsLocalKey NSURLVolumeIsReadOnlyKey NSURLVolumeCreationDateKey NSURLVolumeURLForRemountingKey NSURLVolumeUUIDStringKey NSURLVolumeNameKey NSURLVolumeLocalizedNameKey syn keyword objcConstVar NSURLIsUbiquitousItemKey NSURLUbiquitousItemHasUnresolvedConflictsKey NSURLUbiquitousItemIsDownloadedKey NSURLUbiquitousItemIsDownloadingKey NSURLUbiquitousItemIsUploadedKey NSURLUbiquitousItemIsUploadingKey NSURLUbiquitousItemPercentDownloadedKey NSURLUbiquitousItemPercentUploadedKey NSURLUbiquitousItemDownloadingStatusKey NSURLUbiquitousItemDownloadingErrorKey NSURLUbiquitousItemUploadingErrorKey NSURLUbiquitousItemDownloadRequestedKey NSURLUbiquitousItemContainerDisplayNameKey NSURLUbiquitousItemDownloadingStatusNotDownloaded NSURLUbiquitousItemDownloadingStatusDownloaded NSURLUbiquitousItemDownloadingStatusCurrent """""""""""" " NSString.h syn match objcClass /NSString\s*\*/me=s+8,he=s+8 syn match objcClass /NSMutableString\s*\*/me=s+15,he=s+15 syn keyword objcType unichar syn keyword objcExceptionValue NSParseErrorException NSCharacterConversionException syn keyword objcMacro NSMaximumStringLength syn keyword objcEnum NSStringCompareOptions syn keyword objcEnumValue NSCaseInsensitiveSearch NSLiteralSearch NSBackwardsSearch NSAnchoredSearch NSNumericSearch NSDiacriticInsensitiveSearch NSWidthInsensitiveSearch NSForcedOrderingSearch NSRegularExpressionSearch syn keyword objcEnum NSStringEncoding syn keyword objcEnumValue NSProprietaryStringEncoding syn keyword objcEnumValue NSASCIIStringEncoding NSNEXTSTEPStringEncoding NSJapaneseEUCStringEncoding NSUTF8StringEncoding NSISOLatin1StringEncoding NSSymbolStringEncoding NSNonLossyASCIIStringEncoding NSShiftJISStringEncoding NSISOLatin2StringEncoding NSUnicodeStringEncoding NSWindowsCP1251StringEncoding NSWindowsCP1252StringEncoding NSWindowsCP1253StringEncoding NSWindowsCP1254StringEncoding NSWindowsCP1250StringEncoding NSISO2022JPStringEncoding NSMacOSRomanStringEncoding NSUTF16StringEncoding NSUTF16BigEndianStringEncoding NSUTF16LittleEndianStringEncoding NSUTF32StringEncoding NSUTF32BigEndianStringEncoding NSUTF32LittleEndianStringEncoding syn keyword objcEnum NSStringEncodingConversionOptions syn keyword objcEnumValue NSStringEncodingConversionAllowLossy NSStringEncodingConversionExternalRepresentation syn keyword objcEnum NSStringEnumerationOptions syn keyword objcEnumValue NSStringEnumerationByLines NSStringEnumerationByParagraphs NSStringEnumerationByComposedCharacterSequences NSStringEnumerationByWords NSStringEnumerationBySentences NSStringEnumerationReverse NSStringEnumerationSubstringNotRequired NSStringEnumerationLocalized syn keyword objcConstVar NSStringTransformLatinToKatakana NSStringTransformLatinToHiragana NSStringTransformLatinToHangul NSStringTransformLatinToArabic NSStringTransformLatinToHebrew NSStringTransformLatinToThai NSStringTransformLatinToCyrillic NSStringTransformLatinToGreek NSStringTransformToLatin NSStringTransformMandarinToLatin NSStringTransformHiraganaToKatakana NSStringTransformFullwidthToHalfwidth NSStringTransformToXMLHex NSStringTransformToUnicodeName NSStringTransformStripCombiningMarks NSStringTransformStripDiacritics syn keyword objcConstVar NSStringEncodingDetectionSuggestedEncodingsKey NSStringEncodingDetectionDisallowedEncodingsKey NSStringEncodingDetectionUseOnlySuggestedEncodingsKey NSStringEncodingDetectionAllowLossyKey NSStringEncodingDetectionFromWindowsKey NSStringEncodingDetectionLossySubstitutionKey NSStringEncodingDetectionLikelyLanguageKey " NSAttributedString.h syn match objcClass /NSAttributedString\s*\*/me=s+18,he=s+18 syn match objcClass /NSMutableAttributedString\s*\*/me=s+25,he=s+25 syn keyword objcEnum NSAttributedStringEnumerationOptions syn keyword objcEnumValue NSAttributedStringEnumerationReverse NSAttributedStringEnumerationLongestEffectiveRangeNotRequired " NSValue.h syn match objcClass /NSValue\s*\*/me=s+7,he=s+7 syn match objcClass /NSNumber\s*\*/me=s+8,he=s+8 " NSDecimalNumber.h syn match objcClass /NSDecimalNumber\s*\*/me=s+15,he=s+15 syn match objcClass /NSDecimalNumberHandler\s*\*/me=s+22,he=s+22 syn keyword objcExceptionValue NSDecimalNumberExactnessException NSDecimalNumberOverflowException NSDecimalNumberUnderflowException NSDecimalNumberDivideByZeroException " NSData.h syn match objcClass /NSData\s*\*/me=s+6,he=s+6 syn match objcClass /NSMutableData\s*\*/me=s+13,he=s+13 syn keyword objcEnum NSDataReadingOptions syn keyword objcEnumValue NSDataReadingMappedIfSafe NSDataReadingUncached NSDataReadingMappedAlways NSDataReadingMapped NSMappedRead NSUncachedRead syn keyword objcEnum NSDataWritingOptions syn keyword objcEnumValue NSDataWritingAtomic NSDataWritingWithoutOverwriting NSDataWritingFileProtectionNone NSDataWritingFileProtectionComplete NSDataWritingFileProtectionCompleteUnlessOpen NSDataWritingFileProtectionCompleteUntilFirstUserAuthentication NSDataWritingFileProtectionMask NSAtomicWrite syn keyword objcEnum NSDataSearchOptions syn keyword objcEnumValue NSDataSearchBackwards NSDataSearchAnchored syn keyword objcEnum NSDataBase64EncodingOptions NSDataBase64DecodingOptions syn keyword objcEnumValue NSDataBase64Encoding64CharacterLineLength NSDataBase64Encoding76CharacterLineLength NSDataBase64EncodingEndLineWithCarriageReturn NSDataBase64EncodingEndLineWithLineFeed NSDataBase64DecodingIgnoreUnknownCharacters " NSArray.h syn match objcClass /NSArray\s*\*/me=s+7,he=s+7 syn match objcClass /NSArray<.*>\s*\*/me=s+7,he=s+7 contains=objcTypeInfoParams syn match objcClass /NSMutableArray\s*\*/me=s+14,he=s+14 syn match objcClass /NSMutableArray<.*>\s*\*/me=s+14,he=s+14 contains=objcTypeInfoParams syn keyword objcEnum NSBinarySearchingOptions syn keyword objcEnumValue NSBinarySearchingFirstEqual NSBinarySearchingLastEqual NSBinarySearchingInsertionIndex " NSDictionary.h syn match objcClass /NSDictionary\s*\*/me=s+12,he=s+12 syn match objcClass /NSDictionary<.*>\s*\*/me=s+12,he=s+12 contains=objcTypeInfoParams syn match objcClass /NSMutableDictionary\s*\*/me=s+19,he=s+19 syn match objcClass /NSMutableDictionary<.*>\s*\*/me=s+19,he=s+19 contains=objcTypeInfoParams " NSSet.h syn match objcClass /NSSet\s*\*/me=s+5,me=s+5 syn match objcClass /NSSet<.*>\s*\*/me=s+5,me=s+5 contains=objcTypeInfoParams syn match objcClass /NSMutableSet\s*\*/me=s+12,me=s+12 syn match objcClass /NSMutableSet<.*>\s*\*/me=s+12,me=s+12 contains=objcTypeInfoParams syn match objcClass /NSCountedSet\s*\*/me=s+12,me=s+12 syn match objcClass /NSCountedSet<.*>\s*\*/me=s+12,me=s+12 contains=objcTypeInfoParams " NSOrderedSet.h syn match objcClass /NSOrderedSet\s*\*/me=s+12,me=s+12 syn match objcClass /NSOrderedSet<.*>\s*\*/me=s+12,me=s+12 contains=objcTypeInfoParams syn match objcClass /NSMutableOrderedSet\s*\*/me=s+19,me=s+19 syn match objcClass /NSMutableOrderedSet<.*>\s*\*/me=s+19,me=s+19 """"""""""""""""""" " NSPathUtilities.h syn keyword objcEnum NSSearchPathDirectory syn keyword objcEnumValue NSApplicationDirectory NSDemoApplicationDirectory NSDeveloperApplicationDirectory NSAdminApplicationDirectory NSLibraryDirectory NSDeveloperDirectory NSUserDirectory NSDocumentationDirectory NSDocumentDirectory NSCoreServiceDirectory NSAutosavedInformationDirectory NSDesktopDirectory NSCachesDirectory NSApplicationSupportDirectory NSDownloadsDirectory NSInputMethodsDirectory NSMoviesDirectory NSMusicDirectory NSPicturesDirectory NSPrinterDescriptionDirectory NSSharedPublicDirectory NSPreferencePanesDirectory NSApplicationScriptsDirectory NSItemReplacementDirectory NSAllApplicationsDirectory NSAllLibrariesDirectory NSTrashDirectory syn keyword objcEnum NSSearchPathDomainMask syn keyword objcEnumValue NSUserDomainMask NSLocalDomainMask NSNetworkDomainMask NSSystemDomainMask NSAllDomainsMask " NSFileManger.h syn match objcClass /NSFileManager\s*\*/me=s+13,he=s+13 syn match objcClass /NSDirectoryEnumerator\s*\*/me=s+21,he=s+21 contains=objcTypeInfoParams syn match objcClass /NSDirectoryEnumerator<.*>\s*\*/me=s+21,he=s+21 syn keyword objcEnum NSVolumeEnumerationOptions syn keyword objcEnumValue NSVolumeEnumerationSkipHiddenVolumes NSVolumeEnumerationProduceFileReferenceURLs syn keyword objcEnum NSURLRelationship syn keyword objcEnumValue NSURLRelationshipContains NSURLRelationshipSame NSURLRelationshipOther syn keyword objcEnum NSFileManagerUnmountOptions syn keyword objcEnumValue NSFileManagerUnmountAllPartitionsAndEjectDisk NSFileManagerUnmountWithoutUI syn keyword objcConstVar NSFileManagerUnmountDissentingProcessIdentifierErrorKey syn keyword objcEnum NSDirectoryEnumerationOptions syn keyword objcEnumValue NSDirectoryEnumerationSkipsSubdirectoryDescendants NSDirectoryEnumerationSkipsPackageDescendants NSDirectoryEnumerationSkipsHiddenFiles syn keyword objcEnum NSFileManagerItemReplacementOptions syn keyword objcEnumValue NSFileManagerItemReplacementUsingNewMetadataOnly NSFileManagerItemReplacementWithoutDeletingBackupItem syn keyword objcNotificationValue NSUbiquityIdentityDidChangeNotification syn keyword objcConstVar NSFileType NSFileTypeDirectory NSFileTypeRegular NSFileTypeSymbolicLink NSFileTypeSocket NSFileTypeCharacterSpecial NSFileTypeBlockSpecial NSFileTypeUnknown NSFileSize NSFileModificationDate NSFileReferenceCount NSFileDeviceIdentifier NSFileOwnerAccountName NSFileGroupOwnerAccountName NSFilePosixPermissions NSFileSystemNumber NSFileSystemFileNumber NSFileExtensionHidden NSFileHFSCreatorCode NSFileHFSTypeCode NSFileImmutable NSFileAppendOnly NSFileCreationDate NSFileOwnerAccountID NSFileGroupOwnerAccountID NSFileBusy NSFileProtectionKey NSFileProtectionNone NSFileProtectionComplete NSFileProtectionCompleteUnlessOpen NSFileProtectionCompleteUntilFirstUserAuthentication NSFileSystemSize NSFileSystemFreeSize NSFileSystemNodes NSFileSystemFreeNodes " NSFileHandle.h syn match objcClass /NSFileHandle\s*\*/me=s+12,he=s+12 syn keyword objcExceptionValue NSFileHandleOperationException syn keyword objcNotificationValue NSFileHandleReadCompletionNotification NSFileHandleReadToEndOfFileCompletionNotification NSFileHandleConnectionAcceptedNotification NSFileHandleDataAvailableNotification NSFileHandleNotificationDataItem NSFileHandleNotificationFileHandleItem NSFileHandleNotificationMonitorModes syn match objcClass /NSPipe\s*\*/me=s+6,he=s+6 """""""""""" " NSLocale.h syn match objcClass /NSLocale\s*\*/me=s+8,he=s+8 syn keyword objcEnum NSLocaleLanguageDirection syn keyword objcEnumValue NSLocaleLanguageDirectionUnknown NSLocaleLanguageDirectionLeftToRight NSLocaleLanguageDirectionRightToLeft NSLocaleLanguageDirectionTopToBottom NSLocaleLanguageDirectionBottomToTop syn keyword objcNotificationValue NSCurrentLocaleDidChangeNotification syn keyword objcConstVar NSLocaleIdentifier NSLocaleLanguageCode NSLocaleCountryCode NSLocaleScriptCode NSLocaleVariantCode NSLocaleExemplarCharacterSet NSLocaleCalendar NSLocaleCollationIdentifier NSLocaleUsesMetricSystem NSLocaleMeasurementSystem NSLocaleDecimalSeparator NSLocaleGroupingSeparator NSLocaleCurrencySymbol NSLocaleCurrencyCode NSLocaleCollatorIdentifier NSLocaleQuotationBeginDelimiterKey NSLocaleQuotationEndDelimiterKey NSLocaleAlternateQuotationBeginDelimiterKey NSLocaleAlternateQuotationEndDelimiterKey NSGregorianCalendar NSBuddhistCalendar NSChineseCalendar NSHebrewCalendar NSIslamicCalendar NSIslamicCivilCalendar NSJapaneseCalendar NSRepublicOfChinaCalendar NSPersianCalendar NSIndianCalendar NSISO8601Calendar " NSFormatter.h syn match objcClass /NSFormatter\s*\*/me=s+11,he=s+11 syn keyword objcEnum NSFormattingContext NSFormattingUnitStyle syn keyword objcEnumValue NSFormattingContextUnknown NSFormattingContextDynamic NSFormattingContextStandalone NSFormattingContextListItem NSFormattingContextBeginningOfSentence NSFormattingContextMiddleOfSentence NSFormattingUnitStyleShort NSFormattingUnitStyleMedium NSFormattingUnitStyleLong " NSNumberFormatter.h syn match objcClass /NSNumberFormatter\s*\*/me=s+17,he=s+17 syn keyword objcEnum NSNumberFormatterStyle syn keyword objcEnumValue NSNumberFormatterNoStyle NSNumberFormatterDecimalStyle NSNumberFormatterCurrencyStyle NSNumberFormatterPercentStyle NSNumberFormatterScientificStyle NSNumberFormatterSpellOutStyle NSNumberFormatterOrdinalStyle NSNumberFormatterCurrencyISOCodeStyle NSNumberFormatterCurrencyPluralStyle NSNumberFormatterCurrencyAccountingStyle syn keyword objcEnum NSNumberFormatterBehavior syn keyword objcEnumValue NSNumberFormatterBehaviorDefault NSNumberFormatterBehavior10_0 NSNumberFormatterBehavior10_4 syn keyword objcEnum NSNumberFormatterPadPosition syn keyword objcEnumValue NSNumberFormatterPadBeforePrefix NSNumberFormatterPadAfterPrefix NSNumberFormatterPadBeforeSuffix NSNumberFormatterPadAfterSuffix syn keyword objcEnum NSNumberFormatterRoundingMode syn keyword objcEnumValue NSNumberFormatterRoundCeiling NSNumberFormatterRoundFloor NSNumberFormatterRoundDown NSNumberFormatterRoundUp NSNumberFormatterRoundHalfEven NSNumberFormatterRoundHalfDown NSNumberFormatterRoundHalfUp " NSDateFormatter.h syn match objcClass /NSDateFormatter\s*\*/me=s+15,he=s+15 syn keyword objcEnum NSDateFormatterStyle syn keyword objcEnumValue NSDateFormatterNoStyle NSDateFormatterShortStyle NSDateFormatterMediumStyle NSDateFormatterLongStyle NSDateFormatterFullStyle syn keyword objcEnum NSDateFormatterBehavior syn keyword objcEnumValue NSDateFormatterBehaviorDefault NSDateFormatterBehavior10_0 NSDateFormatterBehavior10_4 " NSCalendar.h syn match objcClass /NSCalendar\s*\*/me=s+10,he=s+10 syn keyword objcConstVar NSCalendarIdentifierGregorian NSCalendarIdentifierBuddhist NSCalendarIdentifierChinese NSCalendarIdentifierCoptic NSCalendarIdentifierEthiopicAmeteMihret NSCalendarIdentifierEthiopicAmeteAlem NSCalendarIdentifierHebrew NSCalendarIdentifierISO8601 NSCalendarIdentifierIndian NSCalendarIdentifierIslamic NSCalendarIdentifierIslamicCivil NSCalendarIdentifierJapanese NSCalendarIdentifierPersian NSCalendarIdentifierRepublicOfChina NSCalendarIdentifierIslamicTabular NSCalendarIdentifierIslamicUmmAlQura syn keyword objcEnum NSCalendarUnit syn keyword objcEnumValue NSCalendarUnitEra NSCalendarUnitYear NSCalendarUnitMonth NSCalendarUnitDay NSCalendarUnitHour NSCalendarUnitMinute NSCalendarUnitSecond NSCalendarUnitWeekday NSCalendarUnitWeekdayOrdinal NSCalendarUnitQuarter NSCalendarUnitWeekOfMonth NSCalendarUnitWeekOfYear NSCalendarUnitYearForWeekOfYear NSCalendarUnitNanosecond NSCalendarUnitCalendar NSCalendarUnitTimeZone syn keyword objcEnumValue NSEraCalendarUnit NSYearCalendarUnit NSMonthCalendarUnit NSDayCalendarUnit NSHourCalendarUnit NSMinuteCalendarUnit NSSecondCalendarUnit NSWeekCalendarUnit NSWeekdayCalendarUnit NSWeekdayOrdinalCalendarUnit NSQuarterCalendarUnit NSWeekOfMonthCalendarUnit NSWeekOfYearCalendarUnit NSYearForWeekOfYearCalendarUnit NSCalendarCalendarUnit NSTimeZoneCalendarUnit syn keyword objcEnumValue NSWrapCalendarComponents NSUndefinedDateComponent NSDateComponentUndefined syn match objcClass /NSDateComponents\s*\*/me=s+16,he=s+16 syn keyword objcEnum NSCalendarOptions syn keyword objcEnumValue NSCalendarWrapComponents NSCalendarMatchStrictly NSCalendarSearchBackwards NSCalendarMatchPreviousTimePreservingSmallerUnits NSCalendarMatchNextTimePreservingSmallerUnits NSCalendarMatchNextTime NSCalendarMatchFirst NSCalendarMatchLast syn keyword objcConstVar NSCalendarDayChangedNotification " NSTimeZone.h syn match objcClass /NSTimeZone\s*\*/me=s+10,he=s+10 syn keyword objcEnum NSTimeZoneNameStyle syn keyword objcEnumValue NSTimeZoneNameStyleStandard NSTimeZoneNameStyleShortStandard NSTimeZoneNameStyleDaylightSaving NSTimeZoneNameStyleShortDaylightSaving NSTimeZoneNameStyleGeneric NSTimeZoneNameStyleShortGeneric syn keyword objcNotificationValue NSSystemTimeZoneDidChangeNotification """"""""""" " NSCoder.h syn match objcClass /NSCoder\s*\*/me=s+7,he=s+7 " NSArchiver.h syn match objcClass /NSArchiver\s*\*/me=s+10,he=s+10 syn match objcClass /NSUnarchiver\s*\*/me=s+12,he=s+12 syn keyword objcExceptionValue NSInconsistentArchiveException " NSKeyedArchiver.h syn match objcClass /NSKeyedArchiver\s*\*/me=s+15,he=s+15 syn match objcClass /NSKeyedUnarchiver\s*\*/me=s+17,he=s+17 syn keyword objcExceptionValue NSInvalidArchiveOperationException NSInvalidUnarchiveOperationException syn keyword objcConstVar NSKeyedArchiveRootObjectKey """""""""""""""""" " NSPropertyList.h syn keyword objcEnum NSPropertyListMutabilityOptions syn keyword objcEnumValue NSPropertyListImmutable NSPropertyListMutableContainers NSPropertyListMutableContainersAndLeaves syn keyword objcEnum NSPropertyListFormat syn keyword objcEnumValue NSPropertyListOpenStepFormat NSPropertyListXMLFormat_v1_0 NSPropertyListBinaryFormat_v1_0 syn keyword objcType NSPropertyListReadOptions NSPropertyListWriteOptions " NSUserDefaults.h syn match objcClass /NSUserDefaults\s*\*/me=s+14,he=s+14 syn keyword objcConstVar NSGlobalDomain NSArgumentDomain NSRegistrationDomain syn keyword objcNotificationValue NSUserDefaultsDidChangeNotification " NSBundle.h syn match objcClass /NSBundle\s*\*/me=s+8,he=s+8 syn keyword objcEnumValue NSBundleExecutableArchitectureI386 NSBundleExecutableArchitecturePPC NSBundleExecutableArchitectureX86_64 NSBundleExecutableArchitecturePPC64 syn keyword objcNotificationValue NSBundleDidLoadNotification NSLoadedClasses NSBundleResourceRequestLowDiskSpaceNotification syn keyword objcConstVar NSBundleResourceRequestLoadingPriorityUrgent """"""""""""""""" " NSProcessInfo.h syn match objcClass /NSProcessInfo\s*\*/me=s+13,he=s+13 syn keyword objcEnumValue NSWindowsNTOperatingSystem NSWindows95OperatingSystem NSSolarisOperatingSystem NSHPUXOperatingSystem NSMACHOperatingSystem NSSunOSOperatingSystem NSOSF1OperatingSystem syn keyword objcType NSOperatingSystemVersion syn keyword objcEnum NSActivityOptions NSProcessInfoThermalState syn keyword objcEnumValue NSActivityIdleDisplaySleepDisabled NSActivityIdleSystemSleepDisabled NSActivitySuddenTerminationDisabled NSActivityAutomaticTerminationDisabled NSActivityUserInitiated NSActivityUserInitiatedAllowingIdleSystemSleep NSActivityBackground NSActivityLatencyCritical NSProcessInfoThermalStateNominal NSProcessInfoThermalStateFair NSProcessInfoThermalStateSerious NSProcessInfoThermalStateCritical syn keyword objcNotificationValue NSProcessInfoThermalStateDidChangeNotification NSProcessInfoPowerStateDidChangeNotification " NSTask.h syn match objcClass /NSTask\s*\*/me=s+6,he=s+6 syn keyword objcEnum NSTaskTerminationReason syn keyword objcEnumValue NSTaskTerminationReasonExit NSTaskTerminationReasonUncaughtSignal syn keyword objcNotificationValue NSTaskDidTerminateNotification " NSThread.h syn match objcClass /NSThread\s*\*/me=s+8,he=s+8 syn keyword objcNotificationValue NSWillBecomeMultiThreadedNotification NSDidBecomeSingleThreadedNotification NSThreadWillExitNotification " NSLock.h syn match objcClass /NSLock\s*\*/me=s+6,he=s+6 syn match objcClass /NSConditionLock\s*\*/me=s+15,he=s+15 syn match objcClass /NSRecursiveLock\s*\*/me=s+15,he=s+15 " NSDictributedLock syn match objcClass /NSDistributedLock\s*\*/me=s+17,he=s+17 " NSOperation.h """""""""""""""" syn match objcClass /NSOperation\s*\*/me=s+11,he=s+11 syn keyword objcEnum NSOperationQueuePriority syn keyword objcEnumValue NSOperationQueuePriorityVeryLow NSOperationQueuePriorityLow NSOperationQueuePriorityNormal NSOperationQueuePriorityHigh NSOperationQueuePriorityVeryHigh syn match objcClass /NSBlockOperation\s*\*/me=s+16,he=s+16 syn match objcClass /NSInvocationOperation\s*\*/me=s+21,he=s+21 syn keyword objcExceptionValue NSInvocationOperationVoidResultException NSInvocationOperationCancelledException syn match objcClass /NSOperationQueue\s*\*/me=s+16,he=s+16 syn keyword objcEnumValue NSOperationQueueDefaultMaxConcurrentOperationCount " NSConnection.h syn match objcClass /NSConnection\s*\*/me=s+12,he=s+12 syn keyword objcConstVar NSConnectionReplyMode syn keyword objcNotificationValue NSConnectionDidDieNotification NSConnectionDidInitializeNotification syn keyword objcExceptionValue NSFailedAuthenticationException " NSPort.h syn match objcClass /NSPort\s*\*/me=s+6,he=s+6 syn keyword objcType NSSocketNativeHandle syn keyword objcNotificationValue NSPortDidBecomeInvalidNotification syn match objcClass /NSMachPort\s*\*/me=s+10,he=s+10 syn keyword objcEnum NSMachPortOptions syn keyword objcEnumValue NSMachPortDeallocateNone NSMachPortDeallocateSendRight NSMachPortDeallocateReceiveRight syn match objcClass /NSMessagePort\s*\*/me=s+13,he=s+13 syn match objcClass /NSSocketPort\s*\*/me=s+12,he=s+12 " NSPortMessage.h syn match objcClass /NSPortMessage\s*\*/me=s+13,he=s+13 " NSDistantObject.h syn match objcClass /NSDistantObject\s*\*/me=s+15,he=s+15 " NSPortNameServer.h syn match objcClass /NSPortNameServer\s*\*/me=s+16,he=s+16 syn match objcClass /NSMessagePortNameServer\s*\*/me=s+23,he=s+23 syn match objcClass /NSSocketPortNameServer\s*\*/me=s+22,he=s+22 " NSHost.h syn match objcClass /NSHost\s*\*/me=s+6,he=s+6 " NSInvocation.h syn match objcClass /NSInvocation\s*\*/me=s+12,he=s+12 " NSMethodSignature.h syn match objcClass /NSMethodSignature\s*\*/me=s+17,he=s+17 """"" " NSScanner.h syn match objcClass /NSScanner\s*\*/me=s+9,he=s+9 " NSTimer.h syn match objcClass /NSTimer\s*\*/me=s+7,he=s+7 " NSAutoreleasePool.h syn match objcClass /NSAutoreleasePool\s*\*/me=s+17,he=s+17 " NSRunLoop.h syn match objcClass /NSRunLoop\s*\*/me=s+9,he=s+9 syn keyword objcConstVar NSDefaultRunLoopMode NSRunLoopCommonModes " NSNull.h syn match objcClass /NSNull\s*\*/me=s+6,he=s+6 " NSProxy.h syn match objcClass /NSProxy\s*\*/me=s+7,he=s+7 " NSObject.h syn match objcClass /NSObject\s*\*/me=s+8,he=s+8 " NSCache.h syn match objcClass /NSCache\s*\*/me=s+7,he=s+7 syn match objcClass /NSCache<.*>\s*\*/me=s+7,he=s+7 contains=objcTypeInfoParams " NSHashTable.h syn match objcClass /NSHashTable\s*\*/me=s+11,he=s+11 syn match objcClass /NSHashTable<.*>\s*\*/me=s+11,he=s+11 contains=objcTypeInfoParams syn keyword objcConstVar NSHashTableStrongMemory NSHashTableZeroingWeakMemory NSHashTableCopyIn NSHashTableObjectPointerPersonality NSHashTableWeakMemory syn keyword objcType NSHashTableOptions NSHashEnumerator NSHashTableCallBacks syn keyword objcConstVar NSIntegerHashCallBacks NSNonOwnedPointerHashCallBacks NSNonRetainedObjectHashCallBacks NSObjectHashCallBacks NSOwnedObjectIdentityHashCallBacks NSOwnedPointerHashCallBacks NSPointerToStructHashCallBacks NSOwnedObjectIdentityHashCallBacks NSOwnedObjectIdentityHashCallBacks NSIntHashCallBacks " NSMapTable.h syn match objcClass /NSMapTable\s*\*/me=s+10,he=s+10 syn match objcClass /NSMapTable<.*>\s*\*/me=s+10,he=s+10 contains=objcTypeInfoParams syn keyword objcConstVar NSPointerToStructHashCallBacks NSPointerToStructHashCallBacks NSPointerToStructHashCallBacks NSPointerToStructHashCallBacks NSPointerToStructHashCallBacks syn keyword objcConstVar NSMapTableStrongMemory NSMapTableZeroingWeakMemory NSMapTableCopyIn NSMapTableObjectPointerPersonality NSMapTableWeakMemory syn keyword objcType NSMapTableOptions NSMapEnumerator NSMapTableKeyCallBacks NSMapTableValueCallBacks syn keyword objcMacro NSNotAnIntMapKey NSNotAnIntegerMapKey NSNotAPointerMapKey syn keyword objcConstVar NSIntegerMapKeyCallBacks NSNonOwnedPointerMapKeyCallBacks NSNonOwnedPointerOrNullMapKeyCallBacks NSNonRetainedObjectMapKeyCallBacks NSObjectMapKeyCallBacks NSOwnedPointerMapKeyCallBacks NSIntMapKeyCallBacks NSIntegerMapValueCallBacks NSNonOwnedPointerMapValueCallBacks NSObjectMapValueCallBacks NSNonRetainedObjectMapValueCallBacks NSOwnedPointerMapValueCallBacks NSIntMapValueCallBacks " NSPointerFunctions.h syn match objcClass /NSPointerFunctions\s*\*/me=s+18,he=s+18 syn keyword objcEnum NSPointerFunctionsOptions syn keyword objcEnumValue NSPointerFunctionsStrongMemory NSPointerFunctionsZeroingWeakMemory NSPointerFunctionsOpaqueMemory NSPointerFunctionsMallocMemory NSPointerFunctionsMachVirtualMemory NSPointerFunctionsWeakMemory NSPointerFunctionsObjectPersonality NSPointerFunctionsOpaquePersonality NSPointerFunctionsObjectPointerPersonality NSPointerFunctionsCStringPersonality NSPointerFunctionsStructPersonality NSPointerFunctionsIntegerPersonality NSPointerFunctionsCopyIn """ Default Highlighting hi def link objcPreProcMacro cConstant hi def link objcPrincipalType cType hi def link objcUsefulTerm cConstant hi def link objcImport cInclude hi def link objcImported cString hi def link objcObjDef cOperator hi def link objcProtocol cOperator hi def link objcProperty cOperator hi def link objcIvarScope cOperator hi def link objcInternalRep cOperator hi def link objcException cOperator hi def link objcThread cOperator hi def link objcPool cOperator hi def link objcModuleImport cOperator hi def link objcSpecial cSpecial hi def link objcString cString hi def link objcHiddenArgument cStatement hi def link objcBlocksQualifier cStorageClass hi def link objcObjectLifetimeQualifier cStorageClass hi def link objcTollFreeBridgeQualifier cStorageClass hi def link objcRemoteMessagingQualifier cStorageClass hi def link objcStorageClass cStorageClass hi def link objcFastEnumKeyword cStatement hi def link objcLiteralSyntaxNumber cNumber hi def link objcLiteralSyntaxChar cCharacter hi def link objcLiteralSyntaxSpecialChar cCharacter hi def link objcLiteralSyntaxOp cOperator hi def link objcDeclPropAccessorName cConstant hi def link objcDeclPropAccessorType cConstant hi def link objcDeclPropAssignSemantics cConstant hi def link objcDeclPropAtomicity cConstant hi def link objcDeclPropARC cConstant hi def link objcDeclPropNullable cConstant hi def link objcDeclPropNonnull cConstant hi def link objcDeclPropNullUnspecified cConstant hi def link objcDeclProcNullResettable cConstant hi def link objcInstanceMethod Function hi def link objcClassMethod Function hi def link objcType cType hi def link objcClass cType hi def link objcTypeSpecifier cType hi def link objcMacro cConstant hi def link objcEnum cType hi def link objcEnumValue cConstant hi def link objcExceptionValue cConstant hi def link objcNotificationValue cConstant hi def link objcConstVar cConstant hi def link objcTypeInfoParams Identifier """ Final step let b:current_syntax = "objc" let &cpo = s:cpo_save unlet s:cpo_save " vim: ts=8 sw=2 sts=2 vim-7.4.1689/runtime/syntax/objcpp.vim000066400000000000000000000014221267703067000175770ustar00rootroot00000000000000" Vim syntax file " Language: Objective C++ " Maintainer: Kazunobu Kuriyama " Ex-Maintainer: Anthony Hodsdon " Last Change: 2007 Oct 29 " For version 5.x: Clear all syntax items " 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 :p:h/cpp.vim so :p:h/objc.vim else runtime! syntax/cpp.vim unlet b:current_syntax runtime! syntax/objc.vim endif syn keyword objCppNonStructure class template namespace transparent contained syn keyword objCppNonStatement new delete friend using transparent contained let b:current_syntax = "objcpp" vim-7.4.1689/runtime/syntax/ocaml.vim000066400000000000000000000330021267703067000174140ustar00rootroot00000000000000" Vim syntax file " Language: OCaml " Filenames: *.ml *.mli *.mll *.mly " Maintainers: Markus Mottl " Karl-Heinz Sylla " Issac Trotts " URL: http://www.ocaml.info/vim/syntax/ocaml.vim " Last Change: 2012 May 12 - Added Dominique Pellé's spell checking patch (MM) " 2012 Feb 01 - Improved module path highlighting (MM) " 2010 Oct 11 - Added highlighting of lnot (MM, thanks to Erick Matsen) " A minor patch was applied to the official version so that object/end " can be distinguished from begin/end, which is used for indentation, " and folding. (David Baelde) " For version 5.x: Clear all syntax items " For version 6.x: Quit when a syntax file was already loaded if version < 600 syntax clear elseif exists("b:current_syntax") && b:current_syntax == "ocaml" finish endif " OCaml is case sensitive. syn case match " Access to the method of an object syn match ocamlMethod "#" " Script headers highlighted like comments syn match ocamlComment "^#!.*" contains=@Spell " Scripting directives syn match ocamlScript "^#\<\(quit\|labels\|warnings\|directory\|cd\|load\|use\|install_printer\|remove_printer\|require\|thread\|trace\|untrace\|untrace_all\|print_depth\|print_length\|camlp4o\)\>" " 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 "\" syn match ocamlCountErr "\" if !exists("ocaml_revised") syn match ocamlDoErr "\" endif syn match ocamlDoneErr "\" syn match ocamlThenErr "\" " Error-highlighting of "end" without synchronization: " as keyword or as error (default) if exists("ocaml_noend_error") syn match ocamlKeyword "\" else syn match ocamlEndErr "\" 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,ocamlVal " 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=@Spell,ocamlComment,ocamlTodo syn keyword ocamlTodo contained TODO FIXME XXX NOTE " Objects syn region ocamlEnd matchgroup=ocamlObject start="\" matchgroup=ocamlObject end="\" contains=ALLBUT,@ocamlContained,ocamlEndErr " Blocks if !exists("ocaml_revised") syn region ocamlEnd matchgroup=ocamlKeyword start="\" matchgroup=ocamlKeyword end="\" contains=ALLBUT,@ocamlContained,ocamlEndErr endif " "for" syn region ocamlNone matchgroup=ocamlKeyword start="\" matchgroup=ocamlKeyword end="\<\(to\|downto\)\>" contains=ALLBUT,@ocamlContained,ocamlCountErr " "do" if !exists("ocaml_revised") syn region ocamlDo matchgroup=ocamlKeyword start="\" matchgroup=ocamlKeyword end="\" contains=ALLBUT,@ocamlContained,ocamlDoneErr endif " "if" syn region ocamlNone matchgroup=ocamlKeyword start="\" matchgroup=ocamlKeyword end="\" contains=ALLBUT,@ocamlContained,ocamlThenErr "" Modules " "sig" syn region ocamlSig matchgroup=ocamlModule start="\" matchgroup=ocamlModule end="\" contains=ALLBUT,@ocamlContained,ocamlEndErr,ocamlModule syn region ocamlModSpec matchgroup=ocamlKeyword start="\" matchgroup=ocamlModule end="\<\u\(\w\|'\)*\>" contained contains=@ocamlAllErrs,ocamlComment skipwhite skipempty nextgroup=ocamlModTRWith,ocamlMPRestr " "open" syn region ocamlNone matchgroup=ocamlKeyword start="\" matchgroup=ocamlModule end="\<\u\(\w\|'\)*\( *\. *\u\(\w\|'\)*\)*\>" contains=@ocamlAllErrs,ocamlComment " "include" syn match ocamlKeyword "\" skipwhite skipempty nextgroup=ocamlModParam,ocamlFullMod " "module" - somewhat complicated stuff ;-) syn region ocamlModule matchgroup=ocamlKeyword start="\" 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,ocamlVal 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="\" 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 keyword ocamlKeyword val syn region ocamlVal matchgroup=ocamlKeyword start="\" matchgroup=ocamlLCIdentifier end="\<\l\(\w\|'\)*\>" contains=@ocamlAllErrs,ocamlComment,ocamlFullMod skipwhite skipempty nextgroup=ocamlMPRestr 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="\" 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 " "struct" syn region ocamlStruct matchgroup=ocamlModule start="\<\(module\s\+\)\=struct\>" matchgroup=ocamlModule end="\" contains=ALLBUT,@ocamlContained,ocamlEndErr " "module type" syn region ocamlKeyword start="\\s*\\(\s*\\)\=" matchgroup=ocamlModule end="\<\w\(\w\|'\)*\>" contains=ocamlComment skipwhite skipempty nextgroup=ocamlMTDef syn match ocamlMTDef "=\s*\w\(\w\|'\)*\>"hs=s+1,me=s+1 skipwhite skipempty nextgroup=ocamlFullMod 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 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 format4 syn keyword ocamlType int int32 int64 lazy_t list nativeint option syn keyword ocamlType string unit syn keyword ocamlOperator asr lnot 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 ocamlCharacter "'\\x\x\x'" syn match ocamlCharErr "'\\\d\d'\|'\\\d'" syn match ocamlCharErr "'\\[^\'ntbr]'" syn region ocamlString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell 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\(_\|\d\)*[l|L|n]\?\>" syn match ocamlNumber "\<-\=0[x|X]\(\x\|_\)\+[l|L|n]\?\>" syn match ocamlNumber "\<-\=0[o|O]\(\o\|_\)\+[l|L|n]\?\>" syn match ocamlNumber "\<-\=0[b|B]\([01]\|_\)\+[l|L|n]\?\>" syn match ocamlFloat "\<-\=\d\(_\|\d\)*\.\?\(_\|\d\)*\([eE][-+]\=\d\(_\|\d\)*\)\=\>" " 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 "\" syn sync match ocamlDoSync groupthere ocamlDo "\" 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 "\" syn sync match ocamlStructSync grouphere ocamlStruct "\" syn sync match ocamlStructSync groupthere ocamlStruct "\" syn sync match ocamlSigSync grouphere ocamlSig "\" syn sync match ocamlSigSync groupthere ocamlSig "\" " Define the default highlighting. " For version 5.7 and earlier: only 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 else command -nargs=+ HiLink hi def link 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 ocamlObject 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 ocamlVal Keyword HiLink ocamlModPreRHS Keyword HiLink ocamlMPRestr2 Keyword HiLink ocamlKeyword Keyword HiLink ocamlMethod Include 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 vim-7.4.1689/runtime/syntax/occam.vim000066400000000000000000000105701267703067000174100ustar00rootroot00000000000000" Vim syntax file " Language: occam " Copyright: Fred Barnes , Mario Schweigler " Maintainer: Mario Schweigler " 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 /\:\=/ contained syn match occamNote /\:\=/ 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 else command -nargs=+ HiLink hi def link 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" vim-7.4.1689/runtime/syntax/omnimark.vim000066400000000000000000000153061267703067000201450ustar00rootroot00000000000000" Vim syntax file " Language: Omnimark " Maintainer: Paul Terray " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/openroad.vim000066400000000000000000000340101267703067000201300ustar00rootroot00000000000000" Vim syntax file " Language: CA-OpenROAD " Maintainer: Luis Moreno " 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 else command -nargs=+ HiLink hi def link 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" vim-7.4.1689/runtime/syntax/opl.vim000066400000000000000000000106541267703067000171230ustar00rootroot00000000000000" Vim syntax file " Language: OPL " Maintainer: Czo " Last Change: 2012 Feb 03 by Thilo Six " $Id: opl.vim,v 1.1 2004/06/13 17:34:11 vimboss Exp $ " 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 let s:cpo_save = &cpo set cpo&vim " 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 else command -nargs=+ HiLink hi def link 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" let &cpo = s:cpo_save unlet s:cpo_save " vim: ts=8 vim-7.4.1689/runtime/syntax/ora.vim000066400000000000000000000655071267703067000171210ustar00rootroot00000000000000" Vim syntax file " Language: Oracle config files (.ora) (Oracle 8i, ver. 8.1.5) " Maintainer: Sandor Kopanyi " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/pamconf.vim000066400000000000000000000126361267703067000177560ustar00rootroot00000000000000" Vim syntax file " Language: pam(8) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2011-08-03 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn match pamconfService '^[[:graph:]]\+' \ nextgroup=pamconfType, \ pamconfServiceLineCont skipwhite syn keyword pamconfTodo contained TODO FIXME XXX NOTE syn region pamconfComment display oneline start='#' end='$' \ contains=pamconfTodo,@Spell syn match pamconfServiceLineCont contained '\\$' \ nextgroup=pamconfType, \ pamconfServiceLineCont skipwhite skipnl syn keyword pamconfType account auth password session \ nextgroup=pamconfControl, \ pamconfTypeLineCont skipwhite syn match pamconfTypeLineCont contained '\\$' \ nextgroup=pamconfControl, \ pamconfTypeLineCont skipwhite skipnl syn keyword pamconfControl contained requisite required sufficient \ optional include substack \ nextgroup=pamconfMPath, \ pamconfControlLineContH skipwhite syn match pamconfControlBegin '\[' nextgroup=pamconfControlValues, \ pamconfControlLineCont skipwhite syn match pamconfControlLineCont contained '\\$' \ nextgroup=pamconfControlValues, \ pamconfControlLineCont skipwhite skipnl syn keyword pamconfControlValues contained success open_err symbol_err \ service_err system_err buf_err \ perm_denied auth_err cred_insufficient \ authinfo_unavail user_unknown maxtries \ new_authtok_reqd acct_expired session_err \ cred_unavail cred_expired cred_err \ no_module_data conv_err authtok_err \ authtok_recover_err authtok_lock_busy \ authtok_disable_aging try_again ignore \ abort authtok_expired module_unknown \ bad_item and default \ nextgroup=pamconfControlValueEq syn match pamconfControlValueEq contained '=' \ nextgroup=pamconfControlActionN, \ pamconfControlAction syn match pamconfControlActionN contained '\d\+\>' \ nextgroup=pamconfControlValues, \ pamconfControlLineCont,pamconfControlEnd \ skipwhite syn keyword pamconfControlAction contained ignore bad die ok done reset \ nextgroup=pamconfControlValues, \ pamconfControlLineCont,pamconfControlEnd \ skipwhite syn match pamconfControlEnd contained '\]' \ nextgroup=pamconfMPath, \ pamconfControlLineContH skipwhite syn match pamconfControlLineContH contained '\\$' \ nextgroup=pamconfMPath, \ pamconfControlLineContH skipwhite skipnl syn match pamconfMPath contained '\S\+' \ nextgroup=pamconfMPathLineCont, \ pamconfArgs skipwhite syn match pamconfArgs contained '\S\+' \ nextgroup=pamconfArgsLineCont, \ pamconfArgs skipwhite syn match pamconfMPathLineCont contained '\\$' \ nextgroup=pamconfMPathLineCont, \ pamconfArgs skipwhite skipnl syn match pamconfArgsLineCont contained '\\$' \ nextgroup=pamconfArgsLineCont, \ pamconfArgs skipwhite skipnl hi def link pamconfTodo Todo hi def link pamconfComment Comment hi def link pamconfService Statement hi def link pamconfServiceLineCont Special hi def link pamconfType Type hi def link pamconfTypeLineCont pamconfServiceLineCont hi def link pamconfControl Macro hi def link pamconfControlBegin Delimiter hi def link pamconfControlLineContH pamconfServiceLineCont hi def link pamconfControlLineCont pamconfServiceLineCont hi def link pamconfControlValues Identifier hi def link pamconfControlValueEq Operator hi def link pamconfControlActionN Number hi def link pamconfControlAction Identifier hi def link pamconfControlEnd Delimiter hi def link pamconfMPath String hi def link pamconfMPathLineCont pamconfServiceLineCont hi def link pamconfArgs Normal hi def link pamconfArgsLineCont pamconfServiceLineCont let b:current_syntax = "pamconf" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/papp.vim000066400000000000000000000100361267703067000172630ustar00rootroot00000000000000" Vim syntax file for the "papp" file format (_p_erl _app_lication) " " Language: papp " Maintainer: Marc Lehmann " Last Change: 2009 Nov 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 :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 :p:h/html.vim else syn include @PAppHtml syntax/html.vim endif unlet b:current_syntax syntax spell default " added by Bram endif if version < 600 syn include @PAppPerl :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="" end="" contains=papp_CDATAp,@PAppPerl keepend syn region papp_xperl matchgroup=xmlTag start="" end="" contains=papp_CDATAp,@PAppPerl keepend syn region papp_phtml matchgroup=xmlTag start="" end="" contains=papp_CDATAh,papp_ph_perl,papp_ph_html,papp_ph_hint,@PAppHtml keepend syn region papp_pxml matchgroup=xmlTag start="" end="" 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="" contains=@PAppPerl contained keepend syn region papp_CDATAh matchgroup=xmlCdataDecl start="" contains=papp_ph_perl,papp_ph_html,papp_ph_hint,@PAppHtml contained keepend syn region papp_CDATAx matchgroup=xmlCdataDecl start="" 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 "" syn sync match pappSync grouphere papp_CDATAh "^# *\(if\|elsif\|else\|endif\)" syn sync match pappSync grouphere papp_CDATAh "" syn sync match pappSync grouphere NONE "" 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" vim-7.4.1689/runtime/syntax/pascal.vim000066400000000000000000000357351267703067000176030ustar00rootroot00000000000000" Vim syntax file " Language: Pascal " Version: 2.8 " Last Change: 2004/10/17 17:47:30 " Maintainer: Xavier Crgut " Previous Maintainer: Mario Eusebio " Contributors: Tim Chase , " Stas Grabois , " Mazen NEIFER , " Klaus Hast , " Austin Ziegler , " Markus Koenig " For version 5.x: Clear all syntax items " 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 " 20011222az: Added new items. syn keyword pascalTodo contained TODO FIXME XXX DEBUG NOTE " 20010723az: When wanted, highlight the trailing whitespace -- this is " based on c_space_errors; to enable, use "pascal_space_errors". if exists("pascal_space_errors") if !exists("pascal_no_trail_space_error") syn match pascalSpaceError "\s\+$" endif if !exists("pascal_no_tab_space_error") syn match pascalSpaceError " \+\t"me=e-1 endif endif " 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,pascalSpaceError 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="\" 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="$" contains=pascalTodo,pascalSpaceError 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,pascalSpaceError 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 else command -nargs=+ HiLink hi def link 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 pascalSpaceError Error 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 vim-7.4.1689/runtime/syntax/passwd.vim000066400000000000000000000045771267703067000176410ustar00rootroot00000000000000" Vim syntax file " Language: passwd(5) password file " Maintainer: Nikolai Weibull " Latest Revision: 2006-10-03 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn match passwdBegin display '^' nextgroup=passwdAccount syn match passwdAccount contained display '[^:]\+' \ nextgroup=passwdPasswordColon syn match passwdPasswordColon contained display ':' \ nextgroup=passwdPassword,passwdShadow syn match passwdPassword contained display '[^:]\+' \ nextgroup=passwdUIDColon syn match passwdShadow contained display '[x*!]' \ nextgroup=passwdUIDColon syn match passwdUIDColon contained display ':' nextgroup=passwdUID syn match passwdUID contained display '\d\{0,10}' \ nextgroup=passwdGIDColon syn match passwdGIDColon contained display ':' nextgroup=passwdGID syn match passwdGID contained display '\d\{0,10}' \ nextgroup=passwdGecosColon syn match passwdGecosColon contained display ':' nextgroup=passwdGecos syn match passwdGecos contained display '[^:]*' \ nextgroup=passwdDirColon syn match passwdDirColon contained display ':' nextgroup=passwdDir syn match passwdDir contained display '/[^:]*' \ nextgroup=passwdShellColon syn match passwdShellColon contained display ':' \ nextgroup=passwdShell syn match passwdShell contained display '.*' hi def link passwdColon Normal hi def link passwdAccount Identifier hi def link passwdPasswordColon passwdColon hi def link passwdPassword Number hi def link passwdShadow Special hi def link passwdUIDColon passwdColon hi def link passwdUID Number hi def link passwdGIDColon passwdColon hi def link passwdGID Number hi def link passwdGecosColon passwdColon hi def link passwdGecos Comment hi def link passwdDirColon passwdColon hi def link passwdDir Type hi def link passwdShellColon passwdColon hi def link passwdShell Operator let b:current_syntax = "passwd" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/pcap.vim000066400000000000000000000036611267703067000172540ustar00rootroot00000000000000" Vim syntax file " Config file: printcap " Maintainer: Lennart Schultz (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 else command -nargs=+ HiLink hi def link endif HiLink pcapBad WarningMsg HiLink pcapBadword WarningMsg HiLink pcapComment Comment delcommand HiLink endif let b:current_syntax = "pcap" " vim: ts=8 vim-7.4.1689/runtime/syntax/pccts.vim000066400000000000000000000107011267703067000174360ustar00rootroot00000000000000" Vim syntax file " Language: PCCTS " Maintainer: Scott Bigham " 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 :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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/pdf.vim000066400000000000000000000067231267703067000171040ustar00rootroot00000000000000" Vim syntax file " Language: PDF " Maintainer: Tim Pope " Last Change: 2007 Dec 16 if exists("b:current_syntax") finish endif if !exists("main_syntax") let main_syntax = 'pdf' endif syn include @pdfXML syntax/xml.vim syn case match syn cluster pdfObjects contains=pdfBoolean,pdfConstant,pdfNumber,pdfFloat,pdfName,pdfHexString,pdfString,pdfArray,pdfHash,pdfReference,pdfComment syn keyword pdfBoolean true false contained syn keyword pdfConstant null contained syn match pdfNumber "[+-]\=\<\d\+\>" syn match pdfFloat "[+-]\=\<\%(\d\+\.\|\d*\.\d\+\)\>" contained syn match pdfNameError "#\X\|#\x\X\|#00" contained containedin=pdfName syn match pdfSpecialChar "#\x\x" contained containedin=pdfName syn match pdfName "/[^[:space:]\[\](){}<>/]*" contained syn match pdfHexError "[^[:space:][:xdigit:]<>]" contained "syn match pdfHexString "<\s*\x[^<>]*\x\s*>" contained contains=pdfHexError "syn match pdfHexString "<\s*\x\=\s*>" contained syn region pdfHexString matchgroup=pdfDelimiter start="<<\@!" end=">" contained contains=pdfHexError syn match pdfStringError "\\." contained containedin=pdfString syn match pdfSpecialChar "\\\%(\o\{1,3\}\|[nrtbf()\\]\)" contained containedin=pdfString syn region pdfString matchgroup=pdfDelimiter start="\\\@>" contains=@pdfObjects contained syn match pdfReference "\<\d\+\s\+\d\+\s\+R\>" "syn keyword pdfOperator R contained containedin=pdfReference syn region pdfObject matchgroup=pdfType start="\" end="\" contains=@pdfObjects syn region pdfObject matchgroup=pdfType start="\ " Homepage: http://github.com/vim-perl/vim-perl/tree/master " Bugs/requests: http://github.com/vim-perl/vim-perl/issues " Last Change: 2013-07-23 " Contributors: Andy Lester " Hinrik Örn Sigurðsson " Lukas Mai " Nick Hibma " Sonia Heimann " Rob Hoelz " and many others. " " Please download the most recent version first, before mailing " any comments. " " The following parameters are available for tuning the " perl syntax highlighting, with defaults given: " " let perl_include_pod = 1 " unlet perl_no_scope_in_variables " unlet perl_no_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 " unlet perl_nofold_packages " let perl_nofold_subs = 1 " unlet perl_fold_anonymous_subs if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim if exists('®expengine') let s:regexpengine=®expengine set regexpengine=1 endif " POD starts with ^= and ends with ^=cut if !exists("perl_include_pod") || perl_include_pod == 1 " 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,@Spell,perlTodo keepend fold extend syn region perlPOD start="^=cut" end="^=cut" contains=perlTodo keepend fold extend else syn region perlPOD start="^=[a-z]" end="^=cut" contains=@Pod,@Spell,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 syn cluster perlTop contains=TOP syn region perlBraces start="{" end="}" transparent extend " All keywords " syn match perlConditional "\<\%(if\|elsif\|unless\|given\|when\|default\)\>" syn match perlConditional "\\)\|\>\)" contains=perlElseIfError skipwhite skipnl skipempty syn match perlRepeat "\<\%(while\|for\%(each\)\=\|do\|until\|continue\)\>" syn match perlOperator "\<\%(defined\|undef\|eq\|ne\|[gl][et]\|cmp\|not\|and\|or\|xor\|not\|bless\|ref\|do\)\>" " for some reason, adding this as the nextgroup for perlControl fixes BEGIN " folding issues... syn match perlFakeGroup "" contained syn match perlControl "\<\%(BEGIN\|CHECK\|INIT\|END\|UNITCHECK\)\>\_s*" nextgroup=perlFakeGroup syn match perlStatementStorage "\<\%(my\|our\|local\|state\)\>" syn match perlStatementControl "\<\%(return\|last\|next\|redo\|goto\|break\)\>" syn match perlStatementScalar "\<\%(chom\=p\|chr\|crypt\|r\=index\|lc\%(first\)\=\|length\|ord\|pack\|sprintf\|substr\|uc\%(first\)\=\)\>" syn match perlStatementRegexp "\<\%(pos\|quotemeta\|split\|study\)\>" syn match perlStatementNumeric "\<\%(abs\|atan2\|cos\|exp\|hex\|int\|log\|oct\|rand\|sin\|sqrt\|srand\)\>" syn match perlStatementList "\<\%(splice\|unshift\|shift\|push\|pop\|join\|reverse\|grep\|map\|sort\|unpack\)\>" syn match perlStatementHash "\<\%(delete\|each\|exists\|keys\|values\)\>" syn match perlStatementIOfunc "\<\%(syscall\|dbmopen\|dbmclose\)\>" syn match perlStatementFiledesc "\<\%(binmode\|close\%(dir\)\=\|eof\|fileno\|getc\|lstat\|printf\=\|read\%(dir\|line\|pipe\)\|rewinddir\|say\|select\|stat\|tell\%(dir\)\=\|write\)\>" nextgroup=perlFiledescStatementNocomma skipwhite syn match perlStatementFiledesc "\<\%(fcntl\|flock\|ioctl\|open\%(dir\)\=\|read\|seek\%(dir\)\=\|sys\%(open\|read\|seek\|write\)\|truncate\)\>" nextgroup=perlFiledescStatementComma skipwhite syn match perlStatementVector "\" syn match perlStatementFiles "\<\%(ch\%(dir\|mod\|own\|root\)\|glob\|link\|mkdir\|readlink\|rename\|rmdir\|symlink\|umask\|unlink\|utime\)\>" syn match perlStatementFiles "-[rwxoRWXOezsfdlpSbctugkTBMAC]\>" syn match perlStatementFlow "\<\%(caller\|die\|dump\|eval\|exit\|wantarray\)\>" syn match perlStatementInclude "\<\%(require\|import\)\>" syn match perlStatementInclude "\<\%(use\|no\)\s\+\%(\%(attributes\|attrs\|autouse\|parent\|base\|big\%(int\|num\|rat\)\|blib\|bytes\|charnames\|constant\|diagnostics\|encoding\%(::warnings\)\=\|feature\|fields\|filetest\|if\|integer\|less\|lib\|locale\|mro\|open\|ops\|overload\|re\|sigtrap\|sort\|strict\|subs\|threads\%(::shared\)\=\|utf8\|vars\|version\|vmsish\|warnings\%(::register\)\=\)\>\)\=" syn match perlStatementProc "\<\%(alarm\|exec\|fork\|get\%(pgrp\|ppid\|priority\)\|kill\|pipe\|set\%(pgrp\|priority\)\|sleep\|system\|times\|wait\%(pid\)\=\)\>" syn match perlStatementSocket "\<\%(accept\|bind\|connect\|get\%(peername\|sock\%(name\|opt\)\)\|listen\|recv\|send\|setsockopt\|shutdown\|socket\%(pair\)\=\)\>" syn match perlStatementIPC "\<\%(msg\%(ctl\|get\|rcv\|snd\)\|sem\%(ctl\|get\|op\)\|shm\%(ctl\|get\|read\|write\)\)\>" syn match perlStatementNetwork "\<\%(\%(end\|[gs]et\)\%(host\|net\|proto\|serv\)ent\|get\%(\%(host\|net\)by\%(addr\|name\)\|protoby\%(name\|number\)\|servby\%(name\|port\)\)\)\>" syn match perlStatementPword "\<\%(get\%(pw\%(uid\|nam\)\|gr\%(gid\|nam\)\|login\)\)\|\%(end\|[gs]et\)\%(pw\|gr\)ent\>" syn match perlStatementTime "\<\%(gmtime\|localtime\|time\)\>" syn match perlStatementMisc "\<\%(warn\|format\|formline\|reset\|scalar\|prototype\|lock\|tied\=\|untie\)\>" syn keyword perlTodo TODO TODO: TBD TBD: FIXME FIXME: XXX XXX: NOTE NOTE: contained syn region perlStatementIndirObjWrap matchgroup=perlStatementIndirObj start="\<\%(map\|grep\|sort\|printf\=\|say\|system\|exec\)\>\s*{" end="}" contains=@perlTop,perlBraces extend syn match perlLabel "^\s*\h\w*\s*::\@!\%(\ is *not* considered as part of the " variable - there again, too complicated and too slow. " Special variables first ($^A, ...) and ($|, $', ...) syn match perlVarPlain "$^[ACDEFHILMNOPRSTVWX]\=" syn match perlVarPlain "$[\\\"\[\]'&`+*.,;=%~!?@#$<>(-]" syn match perlVarPlain "%+" syn match perlVarPlain "$\%(0\|[1-9]\d*\)" " 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 "[$@#%*&]\%(\%(::\|'\)\=\I\i*\%(\%(::\|'\)\I\i*\)*\)\=\%(::\|'\)\I"ms=s+1,me=e-1 contained " To not highlight packages in variables as a scope reference - i.e. in " $pack::var, pack:: is a scope, just set "perl_no_scope_in_variables" " If you don't want complex things like @{${"foo"}} to be processed, " just set the variable "perl_no_extended_vars"... if !exists("perl_no_scope_in_variables") syn match perlVarPlain "\%([@$]\|\$#\)\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod syn match perlVarPlain2 "%\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef syn match perlFunctionName "&\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod else syn match perlVarPlain "\%([@$]\|\$#\)\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod syn match perlVarPlain2 "%\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" syn match perlFunctionName "&\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod endif if !exists("perl_no_extended_vars") syn cluster perlExpr contains=perlStatementIndirObjWrap,perlStatementScalar,perlStatementRegexp,perlStatementNumeric,perlStatementList,perlStatementHash,perlStatementFiles,perlStatementTime,perlStatementMisc,perlVarPlain,perlVarPlain2,perlVarNotInMatches,perlVarSlash,perlVarBlock,perlVarBlock2,perlShellCommand,perlFloat,perlNumber,perlStringUnexpanded,perlString,perlQQ,perlArrow,perlBraces syn region perlArrow matchgroup=perlArrow start="->\s*(" end=")" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained syn region perlArrow matchgroup=perlArrow start="->\s*\[" end="\]" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained syn region perlArrow matchgroup=perlArrow start="->\s*{" end="}" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained syn match perlArrow "->\s*{\s*\I\i*\s*}" contains=perlVarSimpleMemberName nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained syn region perlArrow matchgroup=perlArrow start="->\s*\$*\I\i*\s*(" end=")" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained syn region perlVarBlock matchgroup=perlVarPlain start="\%($#\|[$@]\)\$*{" skip="\\}" end=+}\|\%(\%(<<\%('\|"\)\?\)\@=\)+ contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod extend syn region perlVarBlock2 matchgroup=perlVarPlain start="[%&*]\$*{" skip="\\}" end=+}\|\%(\%(<<\%('\|"\)\?\)\@=\)+ contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod extend syn match perlVarPlain2 "[%&*]\$*{\I\i*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod extend syn match perlVarPlain "\%(\$#\|[@$]\)\$*{\I\i*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod extend syn region perlVarMember matchgroup=perlVarPlain start="\%(->\)\={" skip="\\}" end="}" contained contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod extend syn match perlVarSimpleMember "\%(->\)\={\s*\I\i*\s*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contains=perlVarSimpleMemberName contained extend syn match perlVarSimpleMemberName "\I\i*" contained syn region perlVarMember matchgroup=perlVarPlain start="\%(->\)\=\[" skip="\\]" end="]" contained contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod extend syn match perlPackageConst "__PACKAGE__" nextgroup=perlMethod syn match perlMethod "->\$*\I\i*" contained nextgroup=perlVarSimpleMember,perlVarMember,perlMethod 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 "\\\%(\o\{1,3}\|x\%({\x\+}\|\x\{1,2}\)\|c.\|[^cx]\)" contained extend syn match perlSpecialStringU2 "\\." extend contained contains=NONE syn match perlSpecialStringU "\\\\" contained syn match perlSpecialMatch "\\[1-9]" contained extend syn match perlSpecialMatch "\\g\%(\d\+\|{\%(-\=\d\+\|\h\w*\)}\)" contained syn match perlSpecialMatch "\\k\%(<\h\w*>\|'\h\w*'\)" contained syn match perlSpecialMatch "{\d\+\%(,\%(\d\+\)\=\)\=}" contained syn match perlSpecialMatch "\[[]-]\=[^\[\]]*[]-]\=\]" contained extend syn match perlSpecialMatch "[+*()?.]" contained syn match perlSpecialMatch "(?[#:=!]" contained syn match perlSpecialMatch "(?[impsx]*\%(-[imsx]\+\)\=)" contained syn match perlSpecialMatch "(?\%([-+]\=\d\+\|R\))" contained syn match perlSpecialMatch "(?\%(&\|P[>=]\)\h\w*)" contained syn match perlSpecialMatch "(\*\%(\%(PRUNE\|SKIP\|THEN\)\%(:[^)]*\)\=\|\%(MARK\|\):[^)]*\|COMMIT\|F\%(AIL\)\=\|ACCEPT\))" 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 match perlElseIfError "else\_s*if" containedin=perlConditional syn keyword perlElseIfError elseif containedin=perlConditional " 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,perlSpecialStringU2 " These items are interpolated inside m// matches and s/// substitutions. syn cluster perlInterpSlash contains=perlSpecialString,perlSpecialMatch,perlVarPlain,perlVarBlock " 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 keepend " Constants " " Numbers syn match perlNumber "\<\%(0\%(x\x[[:xdigit:]_]*\|b[01][01_]*\|\o[0-7_]*\|\)\|[1-9][[:digit:]_]*\)\>" syn match perlFloat "\<\d[[:digit:]_]*[eE][\-+]\=\d\+" syn match perlFloat "\<\d[[:digit:]_]*\.[[:digit:]_]*\%([eE][\-+]\=\d\+\)\=" syn match perlFloat "\.[[:digit:]][[:digit:]_]*\%([eE][\-+]\=\d\+\)\=" syn match perlString "\<\%(v\d\+\%(\.\d\+\)*\|\d\+\%(\.\d\+\)\{2,}\)\>" contains=perlVStringV syn match perlVStringV "\+ extend contained contains=perlAnglesSQ,@perlInterpSQ keepend syn region perlParensDQ start=+(+ end=+)+ extend contained contains=perlParensDQ,@perlInterpDQ keepend syn region perlBracketsDQ start=+\[+ end=+\]+ extend contained contains=perlBracketsDQ,@perlInterpDQ keepend syn region perlBracesDQ start=+{+ end=+}+ extend contained contains=perlBracesDQ,@perlInterpDQ keepend syn region perlAnglesDQ start=+<+ end=+>+ extend contained contains=perlAnglesDQ,@perlInterpDQ keepend " Simple version of searches and matches syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@\s*\z([^[:space:]'([{<#]\)+ end=+\z1[msixpodualgc]*+ contains=@perlInterpMatch keepend extend syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@\)\@\)\@\)\@ and m[] which allows for comments and extra whitespace in the pattern syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@\)\@[msixpodualgc]*+ contains=@perlInterpMatch,perlAnglesDQ keepend extend syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@\)\@\s*\z([^[:space:]'([{<#]\)+ end=+\z1+me=e-1 contains=@perlInterpMatch nextgroup=perlSubstitutionGQQ keepend extend syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@\)\@\)\@\)\@\)\@+ contains=@perlInterpMatch,perlAnglesDQ nextgroup=perlSubstitutionGQQ skipwhite skipempty skipnl keepend extend syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@\)\@[msixpodualgcer]*+ contained contains=@perlInterpDQ,perlAnglesDQ keepend extend syn region perlSubstitutionSQ matchgroup=perlMatchStartEnd start=+'+ end=+'[msixpodualgcer]*+ contained contains=@perlInterpSQ keepend extend " Translations " perlMatch is the first part, perlTranslation* is the second, translator part. syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@\s*\z([^[:space:]([{<#]\)+ end=+\z1+me=e-1 contains=@perlInterpSQ nextgroup=perlTranslationGQ syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@\)\@\)\@\)\@+ contains=@perlInterpSQ,perlAnglesSQ nextgroup=perlTranslationGQ skipwhite skipempty skipnl syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@[cdsr]*+ contains=perlAnglesSQ contained " Strings and q, qq, qw and qr expressions syn region perlStringUnexpanded matchgroup=perlStringStartEnd start="'" end="'" contains=@perlInterpSQ keepend extend syn region perlString matchgroup=perlStringStartEnd start=+"+ end=+"+ contains=@perlInterpDQ keepend extend syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@\s*\z([^[:space:]#([{<]\)+ end=+\z1+ contains=@perlInterpSQ keepend extend syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@\)\@\)\@\)\@\)\@+ contains=@perlInterpSQ,perlAnglesSQ keepend extend syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@\s*\z([^[:space:]#([{<]\)+ end=+\z1+ contains=@perlInterpDQ keepend extend syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@\)\@\)\@\)\@\)\@+ contains=@perlInterpDQ,perlAnglesDQ keepend extend syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@\)\@\)\@\)\@\)\@\)\@+ contains=@perlInterpSQ,perlAnglesSQ keepend extend syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@\s*\z([^[:space:]#([{<'/]\)+ end=+\z1[imosx]*+ contains=@perlInterpMatch keepend extend syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@\)\@\)\@\)\@ and qr[] which allows for comments and extra whitespace in the pattern syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@\)\@[imosx]*+ contains=@perlInterpMatch,perlAnglesDQ,perlComment keepend extend syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@\zs\_[^)]\+" contained syn match perlSubPrototype +(\_[^)]*)\_s*\|+ nextgroup=perlSubAttributes,perlComment contained contains=perlSubPrototypeError syn match perlSubName +\%(\h\|::\|'\w\)\%(\w\|::\|'\w\)*\_s*\|+ contained nextgroup=perlSubPrototype,perlComment syn match perlFunction +\\_s*+ nextgroup=perlSubName if !exists("perl_no_scope_in_variables") syn match perlFunctionPRef "\h\w*::" contained syn match perlFunctionName "\h\w*[^:]" contained else syn match perlFunctionName "\h[[:alnum:]_:]*" contained endif " The => operator forces a bareword to the left of it to be interpreted as " a string syn match perlString "\I\@\)\@=" " All other # are comments, except ^#! syn match perlComment "#.*" contains=perlTodo,@Spell extend syn match perlSharpBang "^#!.*" " Formats syn region perlFormat matchgroup=perlStatementIOFunc start="^\s*\~]\+\%(\.\.\.\)\=" 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__$" skip="." end="." fold syntax region perlDATA start="^__END__$" skip="." end="." contains=perlPOD,@perlDATA fold else syntax region perlDATA start="^__DATA__$" skip="." end="." syntax region perlDATA start="^__END__$" skip="." end="." contains=perlPOD,@perlDATA endif " " Folding if exists("perl_fold") " Note: this bit must come before the actual highlighting of the "package" " keyword, otherwise this will screw up Pod lines that match /^package/ if !exists("perl_nofold_packages") syn region perlPackageFold start="^package \S\+;\s*\%(#.*\)\=$" end="^1;\=\s*\%(#.*\)\=$" end="\n\+package"me=s-1 transparent fold keepend endif if !exists("perl_nofold_subs") if exists("perl_fold_anonymous_subs") && perl_fold_anonymous_subs syn region perlSubFold start="\[^\n;]*{" end="}" transparent fold keepend extend syn region perlSubFold start="\<\%(BEGIN\|END\|CHECK\|INIT\)\>\s*{" end="}" transparent fold keepend else syn region perlSubFold start="^\z(\s*\)\.*[^};]$" end="^\z1}\s*\%(#.*\)\=$" transparent fold keepend syn region perlSubFold start="^\z(\s*\)\<\%(BEGIN\|END\|CHECK\|INIT\|UNITCHECK\)\>.*[^};]$" end="^\z1}\s*$" transparent fold keepend endif endif if exists("perl_fold_blocks") syn region perlBlockFold start="^\z(\s*\)\%(if\|elsif\|unless\|for\|while\|until\|given\)\s*(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" start="^\z(\s*\)foreach\s*\%(\%(my\|our\)\=\s*\S\+\s*\)\=(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" end="^\z1}\s*;\=\%(#.*\)\=$" transparent fold keepend syn region perlBlockFold start="^\z(\s*\)\%(do\|else\)\%(\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 command -nargs=+ HiLink hi def link " NOTE: If you're linking new highlight groups to perlString, please also put " them into b:match_skip in ftplugin/perl.vim. " 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 Keyword HiLink perlSubName Function HiLink perlSubPrototype Type HiLink perlSubAttributes PreProc HiLink perlSubAttributesCont perlSubAttributes HiLink perlComment Comment HiLink perlTodo Todo if exists("perl_string_as_statement") HiLink perlStringStartEnd perlStatement else HiLink perlStringStartEnd perlString endif HiLink perlVStringV perlStringStartEnd HiLink perlList perlStatement HiLink perlMisc perlStatement HiLink perlVarPlain perlIdentifier HiLink perlVarPlain2 perlIdentifier HiLink perlArrow perlIdentifier HiLink perlFiledescRead perlIdentifier HiLink perlFiledescStatement perlIdentifier HiLink perlVarSimpleMember perlIdentifier HiLink perlVarSimpleMemberName perlString HiLink perlVarNotInMatches perlIdentifier HiLink perlVarSlash perlIdentifier HiLink perlQQ perlString HiLink perlHereDoc perlString HiLink perlStringUnexpanded perlString HiLink perlSubstitutionSQ perlString HiLink perlSubstitutionGQQ perlString HiLink perlTranslationGQ 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 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 perlStatementInclude perlStatement HiLink perlStatementProc perlStatement HiLink perlStatementSocket perlStatement HiLink perlStatementIPC perlStatement HiLink perlStatementNetwork perlStatement HiLink perlStatementPword perlStatement HiLink perlStatementTime perlStatement HiLink perlStatementMisc perlStatement HiLink perlStatementIndirObj 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 perlDATA perlComment " NOTE: Due to a bug in Vim (or more likely, a misunderstanding on my part), " I had to remove the transparent property from the following regions " in order to get them to highlight correctly. Feel free to remove " these and reinstate the transparent property if you know how. HiLink perlParensSQ perlString HiLink perlBracketsSQ perlString HiLink perlBracesSQ perlString HiLink perlAnglesSQ perlString HiLink perlParensDQ perlString HiLink perlBracketsDQ perlString HiLink perlBracesDQ perlString HiLink perlAnglesDQ perlString HiLink perlSpecialStringU2 perlString " Possible errors HiLink perlNotEmptyLine Error HiLink perlElseIfError Error HiLink perlSubPrototypeError Error HiLink perlSubError Error delcommand HiLink " Syncing to speed up processing " if !exists("perl_no_sync_on_sub") syn sync match perlSync grouphere NONE "^\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" if exists('®expengine') let ®expengine=s:regexpengine unlet s:regexpengine endif let &cpo = s:cpo_save unlet s:cpo_save " XXX Change to sts=4:sw=4 " vim:ts=8:sts=2:sw=2:expandtab:ft=vim vim-7.4.1689/runtime/syntax/perl6.vim000066400000000000000000002212571267703067000173640ustar00rootroot00000000000000" Vim syntax file " Language: Perl 6 " Maintainer: vim-perl " Homepage: http://github.com/vim-perl/vim-perl/tree/master " Bugs/requests: http://github.com/vim-perl/vim-perl/issues " Last Change: 2013-07-21 " Contributors: Luke Palmer " Moritz Lenz " Hinrik Örn Sigurðsson " " This is a big undertaking. Perl 6 is the sort of language that only Perl " can parse. But I'll do my best to get vim to. " " You can associate the extension ".pl" with the filetype "perl6" by setting " autocmd BufNewFile,BufRead *.pl setf perl6 " in your ~/.vimrc. But that will infringe on Perl 5, so you might want to " put a modeline near the beginning or end of your Perl 6 files instead: " # vim: filetype=perl6 " TODO: " * Deal with s:Perl5// " * m:s// is a match, not a substitution " * Make these highlight as strings, not operators: " <==> <=:=> <===> <=~> <« »> «>» «<» " * Allow more keywords to match as function calls(leave() is export(), etc) " * Optimization: use nextgroup instead of lookaround (:help syn-nextgroup) " * Fix s''' substitutions being matched as package names " * Match s/// and m/// better, so things like "$s/" won't match " * Add more support for folding (:help syn-fold) " * Add more syntax syncing hooks (:help syn-sync) " * Q//: " :to, :heredoc " interpolate \q:s{$scalar} (though the spec isn't very clear on it) " " Impossible TODO?: " * Unspace " * Unicode bracketing characters for quoting (there are so many) " * Various tricks depending on context. I.e. we can't know when Perl " expects «*» to be a string or a hyperoperator. The latter is presumably " more common, so that's what we assume. " * Selective highlighting of Pod formatting codes with the :allow option " * Arbitrary number, order, and negation of adverbs to Q//, q//, qq//. " Currently only the first adverb is considered significant. Anything " more would require an exponential amount of regexes, making this " already slow syntax file even slower. " " If you want to have Pir code inside Q:PIR// strings highlighted, do: " let perl6_embedded_pir=1 " " The above requires pir.vim, which you can find in Parrot's repository: " https://svn.parrot.org/parrot/trunk/editor/ " " Some less than crucial things have been made optional to speed things up. " Look at the comments near the if/else branches in this file to see exactly " which features are affected. "perl6_extended_all" enables everything. " " The defaults are: " " unlet perl6_extended_comments " unlet perl6_extended_q " unlet perl6_extended_all " For version 5.x: Clear all syntax items " 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:keepcpo= &cpo set cpo&vim " identifiers syn match p6Normal display "\K\%(\k\|[-']\K\@=\)*" " This is used in the for loops below " Don't use the "syn keyword" construct because that always has higher " priority than matches/regions, so the words can't be autoquoted with " the "=>" and "p5=>" operators. All the lookaround stuff is to make sure " we don't match them as part of some other identifier. let s:before_keyword = " display \"\\%(\\k\\|\\K\\@<=[-']\\)\\@.;\\]" syn match p6Operator display "\%(:\@\)" " "i" requires a digit to the left, and no keyword char to the right syn match p6Operator display "\d\@<=i\k\@!" " index overloading syn match p6Operator display "\%(&\.(\@=\|@\.\[\@=\|%\.{\@=\)" " all infix operators except nonassocative ones let s:infix_a = [ \ "div % mod +& +< +> \\~& ?& \\~< \\~> +| +\\^ \\~| \\~\\^ ?| ?\\^ xx x", \ "\\~ && & also <== ==> <<== ==>> == != < <= > >= \\~\\~ eq ne lt le gt", \ "ge =:= === eqv before after \\^\\^ min max \\^ff ff\\^ \\^ff\\^", \ "\\^fff fff\\^ \\^fff\\^ fff ff ::= := \\.= => , : p5=> Z minmax", \ "\\.\\.\\. and andthen or orelse xor \\^ += -= /= \\*= \\~= //= ||=", \ "+ - \\*\\* \\* // / \\~ || |", \ ] " nonassociative infix operators let s:infix_n = "but does <=> leg cmp \\.\\. \\.\\.\\^\\^ \\^\\.\\. \\^\\.\\.\\^" let s:infix_a_long = join(s:infix_a, " ") let s:infix_a_words = split(s:infix_a_long) let s:infix_a_pattern = join(s:infix_a_words, "\\|") let s:infix_n_words = split(s:infix_n) let s:infix_n_pattern = join(s:infix_n_words, "\\|") let s:both = [s:infix_a_pattern, s:infix_n_pattern] let s:infix = join(s:both, "\\|") let s:infix_assoc = "!\\?\\%(" . s:infix_a_pattern . "\\)" let s:infix = "!\\?\\%(" . s:infix . "\\)" unlet s:infix_a s:infix_a_long s:infix_a_words s:infix_a_pattern unlet s:infix_n s:infix_n_pattern s:both " [+] reduce exec "syn match p6ReduceOp display \"\\k\\@" " does is a type constraint sometimes syn match p6TypeConstraint display "does\%(\s*\%(\k\|[-']\K\@=\)\)\@=" " int is a type sometimes syn match p6Type display "\\%(\s*(\|\s\+\d\)\@!" " these Routine names are also Properties, if preceded by "is" syn match p6Property display "\%(is\s\+\)\@<=\%(signature\|context\|also\|shape\)" " The sigil in ::*Package syn match p6PackageTwigil display "\%(::\)\@<=\*" " $ syn region p6MatchVarSigil \ matchgroup=p6Variable \ start="\$\%(<<\@!\)\@=" \ end=">\@<=" \ contains=p6MatchVar syn region p6MatchVar \ matchgroup=p6Twigil \ start="<" \ end=">" \ contained " Contextualizers syn match p6Context display "\<\%(item\|list\|slice\|hash\)\>" syn match p6Context display "\%(\$\|@\|%\|&\|@@\)(\@=" " the "$" placeholder in "$var1, $, var2 = @list" syn match p6Placeholder display "\%(,\s*\)\@<=\$\%(\K\|\%([.^*?=!~]\|:\@]*>\|«[^»]*»\|{[^}]*}\)\)*\)\.\?\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)\)" \ start="\ze\z(\$\%(\%(\%(\%([.^*?=!~]\|:\@]*>\|«[^»]*»\|{[^}]*}\)\)*\)\.\?\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)\)" \ end="\z1\zs" \ contained \ contains=TOP \ keepend syn region p6InterpArray \ matchgroup=p6Context \ start="@\ze()\@!" \ start="@@\ze()\@!" \ skip="([^)]*)" \ end=")\zs" \ contained \ contains=TOP syn region p6InterpHash \ start="\ze\z(%\$*\%(\%(\%(!\|/\|¢\)\|\%(\%(\%([.^*?=!~]\|:\@]*>\|«[^»]*»\|{[^}]*}\)\)*\)\.\?\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)\)" \ end="\z1\zs" \ contained \ contains=TOP \ keepend syn region p6InterpHash \ matchgroup=p6Context \ start="%\ze()\@!" \ skip="([^)]*)" \ end=")\zs" \ contained \ contains=TOP syn region p6InterpFunction \ start="\ze\z(&\%(\%(!\|/\|¢\)\|\%(\%(\%([.^*?=!~]\|:\@]*>\|«[^»]*»\|{[^}]*}\)\)*\)\.\?\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)\)" \ end="\z1\zs" \ contained \ contains=TOP \ keepend syn region p6InterpFunction \ matchgroup=p6Context \ start="&\ze()\@!" \ skip="([^)]*)" \ end=")\zs" \ contained \ contains=TOP syn region p6InterpClosure \ start="\\\@" contained syn match p6EscCloseFrench display "\\»" contained syn match p6EscBackTick display "\\`" contained syn match p6EscForwardSlash display "\\/" contained syn match p6EscVerticalBar display "\\|" contained syn match p6EscExclamation display "\\!" contained syn match p6EscComma display "\\," contained syn match p6EscDollar display "\\\$" contained syn match p6EscCloseCurly display "\\}" contained syn match p6EscCloseBracket display "\\\]" contained " misc escapes syn match p6EscOctOld display "\\\d\{1,3}" contained syn match p6EscNull display "\\0\d\@!" contained syn match p6EscCodePoint display "\%(\\c\)\@<=\%(\d\|\S\|\[\)\@=" contained nextgroup=p6CodePoint syn match p6EscHex display "\%(\\x\)\@<=\%(\x\|\[\)\@=" contained nextgroup=p6HexSequence syn match p6EscOct display "\%(\\o\)\@<=\%(\o\|\[\)\@=" contained nextgroup=p6OctSequence syn match p6EscQQ display "\\qq" contained nextgroup=p6QQSequence syn match p6EscOpenCurly display "\\{" contained syn match p6EscHash display "\\#" contained syn match p6EscBackSlash display "\\\\" contained syn region p6QQSequence \ matchgroup=p6Escape \ start="\[" \ skip="\[[^\]]*]" \ end="]" \ contained \ transparent \ contains=@p6Interp_qq syn match p6CodePoint display "\%(\d\+\|\S\)" contained syn region p6CodePoint \ matchgroup=p6Escape \ start="\[" \ end="]" \ contained syn match p6HexSequence display "\x\+" contained syn region p6HexSequence \ matchgroup=p6Escape \ start="\[" \ end="]" \ contained syn match p6OctSequence display "\o\+" contained syn region p6OctSequence \ matchgroup=p6Escape \ start="\[" \ end="]" \ contained " matches :key, :!key, :$var, :key, etc " Since we don't know in advance how the adverb ends, we use a trick. " Consume nothing with the start pattern (\ze at the beginning), " while capturing the whole adverb into \z1 and then putting it before " the match start (\zs) of the end pattern. syn region p6Adverb \ start="\ze\z(:!\?\K\%(\k\|[-']\K\@=\)*\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\?\)" \ start="\ze\z(:!\?[@$%]\$*\%(::\|\%(\$\@<=\d\+\|!\|/\|¢\)\|\%(\%([.^*?=!~]\|:\@ " FIXME: not sure how to distinguish this from the "less than" operator " in all cases. For now, it matches if any of the following is true: " " * There is whitespace missing on either side of the "<", since " people tend to put spaces around "less than" " * It comes after "enum", "for", "any", "all", or "none" " * It's the first or last thing on a line (ignoring whitespace) " * It's preceded by "= " " " It never matches when: " " * Preceded by [<+~=] (e.g. <>, =<$foo>) " * Followed by [-=] (e.g. <--, <=, <==) syn region p6StringAngle \ matchgroup=p6Quote \ start="\%(\<\%(enum\|for\|any\|all\|none\)\>\s*(\?\s*\)\@<=<\%(<\|=>\|[-=]\{1,2}>\@!\)\@!" \ start="\%(\s\|[<+~=]\)\@\|[-=]\{1,2}>\@!\)\@!" \ start="[<+~=]\@\|[-=]\{1,2}>\@!\)\@!" \ start="\%(^\s*\)\@<=<\%(<\|=>\|[-=]\{1,2}>\@!\)\@!" \ start="[<+~=]\@\|[-=]\{1,2}>\@!\)\@!" \ skip="\\\@" \ end=">" \ contains=p6InnerAnglesOne,p6EscBackSlash,p6EscCloseAngle syn region p6InnerAnglesOne \ matchgroup=p6StringAngle \ start="<" \ skip="\\\@" \ end=">" \ transparent \ contained \ contains=p6InnerAnglesOne " <> syn region p6StringAngles \ matchgroup=p6Quote \ start="<<=\@!" \ skip="\\\@" \ end=">>" \ contains=p6InnerAnglesTwo,@p6Interp_qq,p6Comment,p6EscHash,p6EscCloseAngle,p6Adverb,p6StringSQ,p6StringDQ syn region p6InnerAnglesTwo \ matchgroup=p6StringAngles \ start="<<" \ skip="\\\@" \ end=">>" \ transparent \ contained \ contains=p6InnerAnglesTwo " «words» syn region p6StringFrench \ matchgroup=p6Quote \ start="«" \ skip="\\\@" nextgroup=p6QPairs skipwhite skipempty syn match p6QPairs contained transparent skipwhite skipempty nextgroup=p6StringQ,p6StringQ_PIR "\%(\_s*:!\?\K\%(\k\|[-']\K\@=\)*\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\?\)*" if exists("perl6_embedded_pir") syn include @p6PIR syntax/pir.vim endif " hardcoded set of delimiters let s:delims = [ \ ["\\\"", "\\\"", "p6EscDoubleQuote", "\\\\\\@", "p6EscCloseAngle", "\\%(\\\\\\@\\|<[^>]*>\\)"], \ ["«", "»", "p6EscCloseFrench", "\\%(\\\\\\@>", "p6EscCloseAngle", "\\%(\\\\\\@>\\|<<\\%([^>]\\|>>\\@!\\)*>>\\)"]) call add(s:delims, ["\\s\\@<=<<<", ">>>", "p6EscCloseAngle", "\\%(\\\\\\@>>\\|<<<\\%([^>]\\|>\\%(>>\\)\\@!\\)*>>>\\)"]) endif if !exists("perl6_extended_q") && !exists("perl6_extended_all") " simple version, no special highlighting within the string for [start_delim, end_delim, end_group, skip] in s:delims exec "syn region p6StringQ matchgroup=p6Quote start=\"".start_delim."\" skip=\"".skip."\" end=\"".end_delim."\" contains=".end_group." contained" endfor if exists("perl6_embedded_pir") " highlight embedded PIR code for [start_delim, end_delim, end_group, skip] in s:delims exec "syn region p6StringQ_PIR matchgroup=p6Quote start=\"\\%(Q\\s*:PIR\\s*\\)\\@<=".start_delim."\" skip=\"".skip."\" end=\"".end_delim."\" contains=@p6PIR,".end_group." contained" endfor endif else let s:before = "syn region p6StringQ matchgroup=p6Quote start=\"\\%(" let s:after = "\\%(\\_s*:!\\?\\K\\%(\\k\\|[-']\\K\\@=\\)*\\%(([^)]*)\\|\\[[^\\]]*]\\|<[^>]*>\\|«[^»]*»\\|{[^}]*}\\)\\?\\)*\\_s*\\)\\@<=" let s:adverbs = [ \ ["s", "scalar"], \ ["a", "array"], \ ["h", "hash"], \ ["f", "function"], \ ["c", "closure"], \ ["b", "backslash"], \ ["w", "words"], \ ["ww", "quotewords"], \ ["x", "exec"], \ ] " these can't be conjoined with q and qq (e.g. as qqq and qqqq) let s:q_adverbs = [ \ ["q", "single"], \ ["qq", "double"], \ ] for [start_delim, end_delim, end_group, skip] in s:delims " Q, q, and qq with any number of (ignored) adverbs exec s:before ."Q". s:after .start_delim."\" end=\"". end_delim ."\""." contained" exec s:before ."q". s:after .start_delim ."\" skip=\"". skip ."\" end=\"". end_delim ."\" contains=". end_group .",@p6Interp_q"." contained" exec s:before ."qq". s:after .start_delim ."\" skip=\"". skip ."\" end=\"". end_delim ."\" contains=". end_group .",@p6Interp_qq"." contained" for [short, long] in s:adverbs " Qs, qs, qqs, Qa, qa, qqa, etc, with ignored adverbs exec s:before ."Q".short. s:after .start_delim ."\" end=\"". end_delim ."\" contains=@p6Interp_".long." contained" exec s:before ."q".short. s:after .start_delim ."\" skip=\"". skip ."\" end=\"". end_delim ."\" contains=". end_group .",@p6Interp_q,@p6Interp_".long." contained" exec s:before ."qq".short. s:after .start_delim ."\" skip=\"". skip ."\" end=\"". end_delim ."\" contains=". end_group .",@p6Interp_qq,@p6Interp_".long." contained" " Q, q, and qq, with one significant adverb exec s:before ."Q\\s*:\\%(".short."\\|".long."\\)". s:after .start_delim ."\" end=\"". end_delim ."\" contains=@p6Interp_".long." contained" for [q_short, q_long] in s:q_adverbs exec s:before ."Q\\s*:\\%(".q_short."\\|".q_long."\\)". s:after .start_delim ."\" end=\"". end_delim ."\" contains=@p6Interp_".q_long." contained" endfor exec s:before ."q\\s*:\\%(".short."\\|".long."\\)". s:after .start_delim ."\" skip=\"". skip ."\" end=\"". end_delim ."\" contains=". end_group .",@p6Interp_q,@p6Interp_".long." contained" exec s:before ."qq\\s*:\\%(".short."\\|".long."\\)". s:after .start_delim ."\" skip=\"". skip ."\" end=\"". end_delim ."\" contains=". end_group .",@p6Interp_qq,@p6Interp_".long." contained" for [short2, long2] in s:adverbs " Qs, qs, qqs, Qa, qa, qqa, etc, with one significant adverb exec s:before ."Q".short."\\s*:\\%(".short2."\\|".long2."\\)". s:after .start_delim ."\" end=\"". end_delim ."\" contains=@p6Interp_".long.",@p6Interp_".long2." contained" for [q_short2, q_long2] in s:q_adverbs exec s:before ."Q".short."\\s*:\\%(".q_short2."\\|".q_long2."\\)". s:after .start_delim ."\" end=\"". end_delim ."\" contains=@p6Interp_".long.",@p6Interp_".q_long2." contained" endfor exec s:before ."q".short."\\s*:\\%(".short2."\\|".long2."\\)". s:after .start_delim ."\" skip=\"". skip ."\" end=\"". end_delim ."\" contains=". end_group .",@p6Interp_q,@p6Interp_".long.",@p6Interp_".long2." contained" exec s:before ."qq".short."\\s*:\\%(".short2."\\|".long2."\\)". s:after .start_delim ."\" skip=\"". skip ."\" end=\"". end_delim ."\" contains=". end_group .",@p6Interp_qq,@p6Interp_".long.",@p6Interp_".long2." contained" endfor endfor endfor unlet s:before s:after s:adverbs s:q_adverbs endif unlet s:delims " Match these so something else above can't. E.g. the "q" in "role q { }" " should not be considered a string syn match p6Normal display "\%(\<\%(role\|grammar\|slang\)\s\+\)\@<=\K\%(\k\|[-']\K\@=\)*" " :key syn match p6Operator display ":\@ and p5=> autoquoting syn match p6StringP5Auto display "\K\%(\k\|[-']\K\@=\)*\ze\s\+p5=>" syn match p6StringAuto display "\K\%(\k\|[-']\K\@=\)*\ze\%(p5\)\@" syn match p6StringAuto display "\K\%(\k\|[-']\K\@=\)*\ze\s\+=>" syn match p6StringAuto display "\K\%(\k\|[-']\K\@=\)*p5\ze=>" " Hyperoperators. Needs to come after the quoting operators (<>, «», etc) exec "syn match p6HyperOp display \"»" .s:infix."»\\?\"" exec "syn match p6HyperOp display \"«\\?".s:infix."«\"" exec "syn match p6HyperOp display \"»" .s:infix."«\"" exec "syn match p6HyperOp display \"«" .s:infix. "»\"" exec "syn match p6HyperOp display \">>" .s:infix."\\%(>>\\)\\?\"" exec "syn match p6HyperOp display \"\\%(<<\\)\\?".s:infix."<<\"" exec "syn match p6HyperOp display \">>" .s:infix."<<\"" exec "syn match p6HyperOp display \"<<" .s:infix.">>\"" unlet s:infix " Regexes and grammars syn match p6RegexName display "\%(\<\%(regex\|rule\|token\)\s\+\)\@<=\K\%(\k\|[-']\K\@=\)*" nextgroup=p6RegexBlockCrap skipwhite skipempty syn match p6RegexBlockCrap "[^{]*" nextgroup=p6RegexBlock skipwhite skipempty transparent contained syn region p6RegexBlock \ matchgroup=p6Normal \ start="{" \ end="}" \ contained \ contains=@p6Regexen,@p6Variables " Perl 6 regex bits syn cluster p6Regexen \ add=p6RxMeta \ add=p6RxEscape \ add=p6EscHex \ add=p6EscOct \ add=p6EscNull \ add=p6RxAnchor \ add=p6RxCapture \ add=p6RxGroup \ add=p6RxAlternation \ add=p6RxAdverb \ add=p6RxAdverbArg \ add=p6RxStorage \ add=p6RxAssertion \ add=p6RxQuoteWords \ add=p6RxClosure \ add=p6RxStringSQ \ add=p6RxStringDQ \ add=p6Comment syn match p6RxMeta display contained ".\%(\k\|\s\)\@" \ contained \ contains=@p6Regexen,@p6Variables,p6RxCharClass,p6RxAssertCall syn region p6RxAssertCall \ matchgroup=p6Normal \ start="\%(::\|\%(\K\%(\k\|[-']\K\@=\)*\)\)\@<=(\@=" \ end=")\@<=" \ contained \ contains=TOP syn region p6RxCharClass \ matchgroup=p6StringSpecial2 \ start="\%(<[-!+?]\?\)\@<=\[" \ skip="\\]" \ end="]" \ contained \ contains=p6RxRange,p6RxEscape,p6EscHex,p6EscOct,p6EscNull syn region p6RxQuoteWords \ matchgroup=p6StringSpecial2 \ start="< " \ end=">" \ contained syn region p6RxAdverb \ start="\ze\z(:!\?\K\%(\k\|[-']\K\@=\)*\)" \ end="\z1\zs" \ contained \ contains=TOP \ keepend syn region p6RxAdverbArg \ start="\%(:!\?\K\%(\k\|[-']\K\@=\)*\)\@<=(" \ skip="([^)]*)" \ end=")" \ contained \ contains=TOP syn region p6RxStorage \ matchgroup=p6Operator \ start="\%(^\s*\)\@<=:\%(my\>\|temp\>\)\@=" \ end="$" \ contains=TOP \ contained " Perl 5 regex bits syn cluster p6RegexP5Base \ add=p6RxP5Escape \ add=p6RxP5Oct \ add=p6RxP5Hex \ add=p6RxP5EscMeta \ add=p6RxP5CodePoint \ add=p6RxP5Prop " normal regex stuff syn cluster p6RegexP5 \ add=@p6RegexP5Base \ add=p6RxP5Quantifier \ add=p6RxP5Meta \ add=p6RxP5QuoteMeta \ add=p6RxP5ParenMod \ add=p6RxP5Verb \ add=p6RxP5Count \ add=p6RxP5Named \ add=p6RxP5ReadRef \ add=p6RxP5WriteRef \ add=p6RxP5CharClass \ add=p6RxP5Anchor " inside character classes syn cluster p6RegexP5Class \ add=@p6RegexP5Base \ add=p6RxP5Posix \ add=p6RxP5Range syn match p6RxP5Escape display contained "\\\S" syn match p6RxP5CodePoint display contained "\\c\S\@=" nextgroup=p6RxP5CPId syn match p6RxP5CPId display contained "\S" syn match p6RxP5Oct display contained "\\\%(\o\{1,3}\)\@=" nextgroup=p6RxP5OctSeq syn match p6RxP5OctSeq display contained "\o\{1,3}" syn match p6RxP5Anchor display contained "[\^$]" syn match p6RxP5Hex display contained "\\x\%({\x\+}\|\x\{1,2}\)\@=" nextgroup=p6RxP5HexSeq syn match p6RxP5HexSeq display contained "\x\{1,2}" syn region p6RxP5HexSeq \ matchgroup=p6RxP5Escape \ start="{" \ end="}" \ contained syn region p6RxP5Named \ matchgroup=p6RxP5Escape \ start="\%(\\N\)\@<={" \ end="}" \ contained syn match p6RxP5Quantifier display contained "\%([+*]\|(\@" \ contained syn match p6RxP5WriteRef display contained "\\g\%(\d\|{\)\@=" nextgroup=p6RxP5WriteRefId syn match p6RxP5WriteRefId display contained "\d\+" syn region p6RxP5WriteRefId \ matchgroup=p6RxP5Escape \ start="{" \ end="}" \ contained syn match p6RxP5Prop display contained "\\[pP]\%(\a\|{\)\@=" nextgroup=p6RxP5PropId syn match p6RxP5PropId display contained "\a" syn region p6RxP5PropId \ matchgroup=p6RxP5Escape \ start="{" \ end="}" \ contained syn match p6RxP5Meta display contained "[(|).]" syn match p6RxP5ParenMod display contained "(\@<=?\@=" nextgroup=p6RxP5Mod,p6RxP5ModName,p6RxP5Code syn match p6RxP5Mod display contained "?\%(<\?=\|<\?!\|[#:|]\)" syn match p6RxP5Mod display contained "?-\?[impsx]\+" syn match p6RxP5Mod display contained "?\%([-+]\?\d\+\|R\)" syn match p6RxP5Mod display contained "?(DEFINE)" syn match p6RxP5Mod display contained "?\%(&\|P[>=]\)" nextgroup=p6RxP5ModDef syn match p6RxP5ModDef display contained "\h\w*" syn region p6RxP5ModName \ matchgroup=p6StringSpecial \ start="?'" \ end="'" \ contained syn region p6RxP5ModName \ matchgroup=p6StringSpecial \ start="?P\?<" \ end=">" \ contained syn region p6RxP5Code \ matchgroup=p6StringSpecial \ start="??\?{" \ end="})\@=" \ contained \ contains=TOP syn match p6RxP5EscMeta display contained "\\[?*.{}()[\]|\^$]" syn match p6RxP5Count display contained "\%({\d\+\%(,\%(\d\+\)\?\)\?}\)\@=" nextgroup=p6RxP5CountId syn region p6RxP5CountId \ matchgroup=p6RxP5Escape \ start="{" \ end="}" \ contained syn match p6RxP5Verb display contained "(\@<=\*\%(\%(PRUNE\|SKIP\|THEN\)\%(:[^)]*\)\?\|\%(MARK\|\):[^)]*\|COMMIT\|F\%(AIL\)\?\|ACCEPT\)" syn region p6RxP5QuoteMeta \ matchgroup=p6RxP5Escape \ start="\\Q" \ end="\\E" \ contained \ contains=@p6Variables,p6EscBackSlash syn region p6RxP5CharClass \ matchgroup=p6StringSpecial \ start="\[\^\?" \ skip="\\]" \ end="]" \ contained \ contains=@p6RegexP5Class syn region p6RxP5Posix \ matchgroup=p6RxP5Escape \ start="\[:" \ end=":]" \ contained syn match p6RxP5Range display contained "-" " 'string' inside a regex syn region p6RxStringSQ \ matchgroup=p6Quote \ start="'" \ skip="\\\@, mm, rx syn region p6Match \ matchgroup=p6Quote \ start="\%(\%(::\|[$@%&][.!^:*?]\?\|\.\)\@\@!>\@!" \ skip="\\>" \ end=">" \ contains=@p6Regexen,@p6Variables " m«foo», mm«foo», rx«foo» syn region p6Match \ matchgroup=p6Quote \ start="\%(\%(::\|[$@%&][.!^:*?]\?\|\.\)\@ syn region p6Match \ matchgroup=p6Quote \ start="\%(\%(::\|[$@%&][.!^:*?]\?\|\.\)\@\@!" \ skip="\\>" \ end=">" \ contains=@p6Regexen,@p6Variables " s«foo» syn region p6Match \ matchgroup=p6Quote \ start="\%(\%(::\|[$@%&][.!^:*?]\?\|\.\)\@ syn region p6Match \ matchgroup=p6Quote \ start="\%(\%(::\|[$@%&][.!^:*?]\?\|\.\)\@\@!" \ skip="\\>" \ end=">" \ contains=@p6RegexP5,p6Variables " m:P5«» syn region p6Match \ matchgroup=p6Quote \ start="\%(\%(::\|[$@%&][.!^:*?]\?\|\.\)\@]*>" \ end=">" \ matchgroup=p6Error \ start="^#<" \ contains=p6Attention,p6Comment syn region p6Comment \ matchgroup=p6Comment \ start="^\@]\|>>\@!\)*>>" \ end=">>" \ matchgroup=p6Error \ start="^#<<" \ contains=p6Attention,p6Comment syn region p6Comment \ matchgroup=p6Comment \ start="^\@]\|>\%(>>\)\@!\)*>>>" \ end=">>>" \ matchgroup=p6Error \ start="^#<<<" \ contains=p6Attention,p6Comment syn region p6Comment \ matchgroup=p6Comment \ start="^\@" \ end="^\ze\%(\s*$\|=\K\)" \ contains=p6PodAbbrCodeType \ keepend syn region p6PodAbbrCodeType \ matchgroup=p6PodType \ start="\K\k*" \ end="^\ze\%(\s*$\|=\K\)" \ contained \ contains=p6PodName,p6PodAbbrCode syn region p6PodAbbrCode \ start="^" \ end="^\ze\%(\s*$\|=\K\)" \ contained " Abbreviated blocks (everything is a comment) syn region p6PodAbbrRegion \ matchgroup=p6PodPrefix \ start="^=\zecomment\>" \ end="^\ze\%(\s*$\|=\K\)" \ contains=p6PodAbbrCommentType \ keepend syn region p6PodAbbrCommentType \ matchgroup=p6PodType \ start="\K\k*" \ end="^\ze\%(\s*$\|=\K\)" \ contained \ contains=p6PodComment,p6PodAbbrNoCode " Abbreviated blocks (implicit code allowed) syn region p6PodAbbrRegion \ matchgroup=p6PodPrefix \ start="^=\ze\%(pod\|item\|nested\|\u\+\)\>" \ end="^\ze\%(\s*$\|=\K\)" \ contains=p6PodAbbrType \ keepend syn region p6PodAbbrType \ matchgroup=p6PodType \ start="\K\k*" \ end="^\ze\%(\s*$\|=\K\)" \ contained \ contains=p6PodName,p6PodAbbr syn region p6PodAbbr \ start="^" \ end="^\ze\%(\s*$\|=\K\)" \ contained \ contains=@p6PodFormat,p6PodImplicitCode " Abbreviated block to end-of-file syn region p6PodAbbrRegion \ matchgroup=p6PodPrefix \ start="^=\zeEND\>" \ end="\%$" \ contains=p6PodAbbrEOFType \ keepend syn region p6PodAbbrEOFType \ matchgroup=p6PodType \ start="\K\k*" \ end="\%$" \ contained \ contains=p6PodName,p6PodAbbrEOF syn region p6PodAbbrEOF \ start="^" \ end="\%$" \ contained \ contains=@p6PodNestedBlocks,@p6PodFormat,p6PodImplicitCode " Directives syn region p6PodDirectRegion \ matchgroup=p6PodPrefix \ start="^=\%(config\|use\)\>" \ end="^\ze\%([^=]\|=\K\|\s*$\)" \ contains=p6PodDirectArgRegion \ keepend syn region p6PodDirectArgRegion \ matchgroup=p6PodType \ start="\S\+" \ end="^\ze\%([^=]\|=\K\|\s*$\)" \ contained \ contains=p6PodDirectConfigRegion syn region p6PodDirectConfigRegion \ start="" \ end="^\ze\%([^=]\|=\K\|\s*$\)" \ contained \ contains=@p6PodConfig " =encoding is a special directive syn region p6PodDirectRegion \ matchgroup=p6PodPrefix \ start="^=encoding\>" \ end="^\ze\%([^=]\|=\K\|\s*$\)" \ contains=p6PodEncodingArgRegion \ keepend syn region p6PodEncodingArgRegion \ matchgroup=p6PodName \ start="\S\+" \ end="^\ze\%([^=]\|=\K\|\s*$\)" \ contained " Paragraph blocks (implicit code forbidden) syn region p6PodParaRegion \ matchgroup=p6PodPrefix \ start="^=for\>" \ end="^\ze\%(\s*$\|=\K\)" \ contains=p6PodParaNoCodeTypeRegion \ keepend \ extend syn region p6PodParaNoCodeTypeRegion \ matchgroup=p6PodType \ start="\K\k*" \ end="^\ze\%(\s*$\|=\K\)" \ contained \ contains=p6PodParaNoCode,p6PodParaConfigRegion syn region p6PodParaConfigRegion \ start="" \ end="^\ze\%([^=]\|=\k\@\ze\s*code\>" \ end="^\ze\%(\s*$\|=\K\)" \ contains=p6PodParaCodeTypeRegion \ keepend \ extend syn region p6PodParaCodeTypeRegion \ matchgroup=p6PodType \ start="\K\k*" \ end="^\ze\%(\s*$\|=\K\)" \ contained \ contains=p6PodParaCode,p6PodParaConfigRegion syn region p6PodParaCode \ start="^[^=]" \ end="^\ze\%(\s*$\|=\K\)" \ contained " Paragraph blocks (implicit code allowed) syn region p6PodParaRegion \ matchgroup=p6PodPrefix \ start="^=for\>\ze\s*\%(pod\|item\|nested\|\u\+\)\>" \ end="^\ze\%(\s*$\|=\K\)" \ contains=p6PodParaTypeRegion \ keepend \ extend syn region p6PodParaTypeRegion \ matchgroup=p6PodType \ start="\K\k*" \ end="^\ze\%(\s*$\|=\K\)" \ contained \ contains=p6PodPara,p6PodParaConfigRegion syn region p6PodPara \ start="^[^=]" \ end="^\ze\%(\s*$\|=\K\)" \ contained \ contains=@p6PodFormat,p6PodImplicitCode " Paragraph block to end-of-file syn region p6PodParaRegion \ matchgroup=p6PodPrefix \ start="^=for\>\ze\s\+END\>" \ end="\%$" \ contains=p6PodParaEOFTypeRegion \ keepend \ extend syn region p6PodParaEOFTypeRegion \ matchgroup=p6PodType \ start="\K\k*" \ end="\%$" \ contained \ contains=p6PodParaEOF,p6PodParaConfigRegion syn region p6PodParaEOF \ start="^[^=]" \ end="\%$" \ contained \ contains=@p6PodNestedBlocks,@p6PodFormat,p6PodImplicitCode " Delimited blocks (implicit code forbidden) syn region p6PodDelimRegion \ matchgroup=p6PodPrefix \ start="^=begin\>" \ end="^=end\>" \ contains=p6PodDelimNoCodeTypeRegion \ keepend \ extend syn region p6PodDelimNoCodeTypeRegion \ matchgroup=p6PodType \ start="\K\k*" \ end="^\ze=end\>" \ contained \ contains=p6PodDelimNoCode,p6PodDelimConfigRegion syn region p6PodDelimConfigRegion \ start="" \ end="^\ze\%([^=]\|=\K\|\s*$\)" \ contained \ contains=@p6PodConfig syn region p6PodDelimNoCode \ start="^" \ end="^\ze=end\>" \ contained \ contains=@p6PodNestedBlocks,@p6PodFormat " Delimited blocks (everything is code) syn region p6PodDelimRegion \ matchgroup=p6PodPrefix \ start="^=begin\>\ze\s*code\>" \ end="^=end\>" \ contains=p6PodDelimCodeTypeRegion \ keepend \ extend syn region p6PodDelimCodeTypeRegion \ matchgroup=p6PodType \ start="\K\k*" \ end="^\ze=end\>" \ contained \ contains=p6PodDelimCode,p6PodDelimConfigRegion syn region p6PodDelimCode \ start="^" \ end="^\ze=end\>" \ contained \ contains=@p6PodNestedBlocks " Delimited blocks (implicit code allowed) syn region p6PodDelimRegion \ matchgroup=p6PodPrefix \ start="^=begin\>\ze\s*\%(pod\|item\|nested\|\u\+\)\>" \ end="^=end\>" \ contains=p6PodDelimTypeRegion \ keepend \ extend syn region p6PodDelimTypeRegion \ matchgroup=p6PodType \ start="\K\k*" \ end="^\ze=end\>" \ contained \ contains=p6PodDelim,p6PodDelimConfigRegion syn region p6PodDelim \ start="^" \ end="^\ze=end\>" \ contained \ contains=@p6PodNestedBlocks,@p6PodFormat,p6PodImplicitCode " Delimited block to end-of-file syn region p6PodDelimRegion \ matchgroup=p6PodPrefix \ start="^=begin\>\ze\s\+END\>" \ end="\%$" \ contains=p6PodDelimEOFTypeRegion \ extend syn region p6PodDelimEOFTypeRegion \ matchgroup=p6PodType \ start="\K\k*" \ end="\%$" \ contained \ contains=p6PodDelimEOF,p6PodDelimConfigRegion syn region p6PodDelimEOF \ start="^" \ end="\%$" \ contained \ contains=@p6PodNestedBlocks,@p6PodFormat,p6PodImplicitCode syn cluster p6PodConfig \ add=p6PodConfigOperator \ add=p6PodExtraConfig \ add=p6StringAuto \ add=p6PodAutoQuote \ add=p6StringSQ syn region p6PodParens \ start="(" \ end=")" \ contained \ contains=p6Number,p6StringSQ syn match p6PodAutoQuote display contained "=>" syn match p6PodConfigOperator display contained ":!\?" nextgroup=p6PodConfigOption syn match p6PodConfigOption display contained "[^[:space:](<]\+" nextgroup=p6PodParens,p6StringAngle syn match p6PodExtraConfig display contained "^=" syn match p6PodVerticalBar display contained "|" syn match p6PodColon display contained ":" syn match p6PodSemicolon display contained ";" syn match p6PodComma display contained "," syn match p6PodImplicitCode display contained "^\s.*" syn region p6PodDelimEndRegion \ matchgroup=p6PodType \ start="\%(^=end\>\)\@<=" \ end="\K\k*" " These may appear inside delimited blocks syn cluster p6PodNestedBlocks \ add=p6PodAbbrRegion \ add=p6PodDirectRegion \ add=p6PodParaRegion \ add=p6PodDelimRegion \ add=p6PodDelimEndRegion " Pod formatting codes syn cluster p6PodFormat \ add=p6PodFormatOne \ add=p6PodFormatTwo \ add=p6PodFormatThree \ add=p6PodFormatFrench " Balanced angles found inside formatting codes. Ensures proper nesting. syn region p6PodFormatAnglesOne \ matchgroup=p6PodFormat \ start="<" \ skip="<[^>]*>" \ end=">" \ transparent \ contained \ contains=p6PodFormatAnglesFrench,p6PodFormatAnglesOne syn region p6PodFormatAnglesTwo \ matchgroup=p6PodFormat \ start="<<" \ skip="<<[^>]*>>" \ end=">>" \ transparent \ contained \ contains=p6PodFormatAnglesFrench,p6PodFormatAnglesOne,p6PodFormatAnglesTwo syn region p6PodFormatAnglesThree \ matchgroup=p6PodFormat \ start="<<<" \ skip="<<<[^>]*>>>" \ end=">>>" \ transparent \ contained \ contains=p6PodFormatAnglesFrench,p6PodFormatAnglesOne,p6PodFormatAnglesTwo,p6PodFormatAnglesThree syn region p6PodFormatAnglesFrench \ matchgroup=p6PodFormat \ start="«" \ skip="«[^»]*»" \ end="»" \ transparent \ contained \ contains=p6PodFormatAnglesFrench,p6PodFormatAnglesOne,p6PodFormatAnglesTwo,p6PodFormatAnglesThree " All formatting codes syn region p6PodFormatOne \ matchgroup=p6PodFormatCode \ start="\u<" \ skip="<[^>]*>" \ end=">" \ contained \ contains=p6PodFormatAnglesOne,p6PodFormatFrench,p6PodFormatOne syn region p6PodFormatTwo \ matchgroup=p6PodFormatCode \ start="\u<<" \ skip="<<[^>]*>>" \ end=">>" \ contained \ contains=p6PodFormatAnglesTwo,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo syn region p6PodFormatThree \ matchgroup=p6PodFormatCode \ start="\u<<<" \ skip="<<<[^>]*>>>" \ end=">>>" \ contained \ contains=p6PodFormatAnglesThree,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodFormatThree syn region p6PodFormatFrench \ matchgroup=p6PodFormatCode \ start="\u«" \ skip="«[^»]*»" \ end="»" \ contained \ contains=p6PodFormatAnglesFrench,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodFormatThree " C<> and V<> don't allow nested formatting formatting codes syn region p6PodFormatOne \ matchgroup=p6PodFormatCode \ start="[CV]<" \ skip="<[^>]*>" \ end=">" \ contained \ contains=p6PodFormatAnglesOne syn region p6PodFormatTwo \ matchgroup=p6PodFormatCode \ start="[CV]<<" \ skip="<<[^>]*>>" \ end=">>" \ contained \ contains=p6PodFormatAnglesTwo syn region p6PodFormatThree \ matchgroup=p6PodFormatCode \ start="[CV]<<<" \ skip="<<<[^>]*>>>" \ end=">>>" \ contained \ contains=p6PodFormatAnglesThree syn region p6PodFormatFrench \ matchgroup=p6PodFormatCode \ start="[CV]«" \ skip="«[^»]*»" \ end="»" \ contained \ contains=p6PodFormatAnglesFrench " L<> can have a "|" separator syn region p6PodFormatOne \ matchgroup=p6PodFormatCode \ start="L<" \ skip="<[^>]*>" \ end=">" \ contained \ contains=p6PodFormatAnglesOne,p6PodFormatFrench,p6PodFormatOne,p6PodVerticalBar syn region p6PodFormatTwo \ matchgroup=p6PodFormatCode \ start="L<<" \ skip="<<[^>]*>>" \ end=">>" \ contained \ contains=p6PodFormatAnglesTwo,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodVerticalBar syn region p6PodFormatThree \ matchgroup=p6PodFormatCode \ start="L<<<" \ skip="<<<[^>]*>>>" \ end=">>>" \ contained \ contains=p6PodFormatAnglesThree,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodFormatThree,p6PodVerticalBar syn region p6PodFormatFrench \ matchgroup=p6PodFormatCode \ start="L«" \ skip="«[^»]*»" \ end="»" \ contained \ contains=p6PodFormatAnglesFrench,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodFormatThree,p6PodVerticalBar " E<> can have a ";" separator syn region p6PodFormatOne \ matchgroup=p6PodFormatCode \ start="E<" \ skip="<[^>]*>" \ end=">" \ contained \ contains=p6PodFormatAnglesOne,p6PodFormatFrench,p6PodFormatOne,p6PodSemiColon syn region p6PodFormatTwo \ matchgroup=p6PodFormatCode \ start="E<<" \ skip="<<[^>]*>>" \ end=">>" \ contained \ contains=p6PodFormatAnglesTwo,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodSemiColon syn region p6PodFormatThree \ matchgroup=p6PodFormatCode \ start="E<<<" \ skip="<<<[^>]*>>>" \ end=">>>" \ contained \ contains=p6PodFormatAnglesThree,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodFormatThree,p6PodSemiColon syn region p6PodFormatFrench \ matchgroup=p6PodFormatCode \ start="E«" \ skip="«[^»]*»" \ end="»" \ contained \ contains=p6PodFormatAnglesFrench,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodFormatThree,p6PodSemiColon " M<> can have a ":" separator syn region p6PodFormatOne \ matchgroup=p6PodFormatCode \ start="M<" \ skip="<[^>]*>" \ end=">" \ contained \ contains=p6PodFormatAnglesOne,p6PodFormatFrench,p6PodFormatOne,p6PodColon syn region p6PodFormatTwo \ matchgroup=p6PodFormatCode \ start="M<<" \ skip="<<[^>]*>>" \ end=">>" \ contained \ contains=p6PodFormatAnglesTwo,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodColon syn region p6PodFormatThree \ matchgroup=p6PodFormatCode \ start="M<<<" \ skip="<<<[^>]*>>>" \ end=">>>" \ contained \ contains=p6PodFormatAnglesThree,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodFormatThree,p6PodColon syn region p6PodFormatFrench \ matchgroup=p6PodFormatCode \ start="M«" \ skip="«[^»]*»" \ end="»" \ contained \ contains=p6PodFormatAnglesFrench,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodFormatThree,p6PodColon " D<> can have "|" and ";" separators syn region p6PodFormatOne \ matchgroup=p6PodFormatCode \ start="D<" \ skip="<[^>]*>" \ end=">" \ contained \ contains=p6PodFormatAnglesOne,p6PodFormatFrench,p6PodFormatOne,p6PodVerticalBar,p6PodSemiColon syn region p6PodFormatTwo \ matchgroup=p6PodFormatCode \ start="D<<" \ skip="<<[^>]*>>" \ end=">>" \ contained \ contains=p6PodFormatAngleTwo,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodVerticalBar,p6PodSemiColon syn region p6PodFormatThree \ matchgroup=p6PodFormatCode \ start="D<<<" \ skip="<<<[^>]*>>>" \ end=">>>" \ contained \ contains=p6PodFormatAnglesThree,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodFormatThree,p6PodVerticalBar,p6PodSemiColon syn region p6PodFormatFrench \ matchgroup=p6PodFormatCode \ start="D«" \ skip="«[^»]*»" \ end="»" \ contained \ contains=p6PodFormatAnglesFrench,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodFormatThree,p6PodVerticalBar,p6PodSemiColon " X<> can have "|", "," and ";" separators syn region p6PodFormatOne \ matchgroup=p6PodFormatCode \ start="X<" \ skip="<[^>]*>" \ end=">" \ contained \ contains=p6PodFormatAnglesOne,p6PodFormatFrench,p6PodFormatOne,p6PodVerticalBar,p6PodSemiColon,p6PodComma syn region p6PodFormatTwo \ matchgroup=p6PodFormatCode \ start="X<<" \ skip="<<[^>]*>>" \ end=">>" \ contained \ contains=p6PodFormatAnglesTwo,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodVerticalBar,p6PodSemiColon,p6PodComma syn region p6PodFormatThree \ matchgroup=p6PodFormatCode \ start="X<<<" \ skip="<<<[^>]*>>>" \ end=">>>" \ contained \ contains=p6PodFormatAnglesThree,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodFormatThree,p6PodVerticalBar,p6PodSemiColon,p6PodComma syn region p6PodFormatFrench \ matchgroup=p6PodFormatCode \ start="X«" \ skip="«[^»]*»" \ end="»" \ contained \ contains=p6PodFormatAnglesFrench,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodFormatThree,p6PodVerticalBar,p6PodSemiColon,p6PodComma " Define the default highlighting. " For version 5.7 and earlier: only when not done already " For version 5.8 and later: only when an item doesn't have highlighting yet if version >= 508 || !exists("did_perl6_syntax_inits") if version < 508 let did_perl6_syntax_inits = 1 command -nargs=+ HiLink hi link else command -nargs=+ HiLink hi def link endif HiLink p6EscOctOld p6Error HiLink p6PackageTwigil p6Twigil HiLink p6StringAngle p6String HiLink p6StringFrench p6String HiLink p6StringAngles p6String HiLink p6StringSQ p6String HiLink p6StringDQ p6String HiLink p6StringQ p6String HiLink p6RxStringSQ p6String HiLink p6RxStringDQ p6String HiLink p6Substitution p6String HiLink p6Transliteration p6String HiLink p6StringAuto p6String HiLink p6StringP5Auto p6String HiLink p6Key p6String HiLink p6Match p6String HiLink p6RegexBlock p6String HiLink p6RxP5CharClass p6String HiLink p6RxP5QuoteMeta p6String HiLink p6RxCharClass p6String HiLink p6RxQuoteWords p6String HiLink p6ReduceOp p6Operator HiLink p6ReverseCrossOp p6Operator HiLink p6HyperOp p6Operator HiLink p6QuoteQ p6Operator HiLink p6RxRange p6StringSpecial HiLink p6RxAnchor p6StringSpecial HiLink p6RxP5Anchor p6StringSpecial HiLink p6CodePoint p6StringSpecial HiLink p6RxMeta p6StringSpecial HiLink p6RxP5Range p6StringSpecial HiLink p6RxP5CPId p6StringSpecial HiLink p6RxP5Posix p6StringSpecial HiLink p6RxP5Mod p6StringSpecial HiLink p6RxP5HexSeq p6StringSpecial HiLink p6RxP5OctSeq p6StringSpecial HiLink p6RxP5WriteRefId p6StringSpecial HiLink p6HexSequence p6StringSpecial HiLink p6OctSequence p6StringSpecial HiLink p6RxP5Named p6StringSpecial HiLink p6RxP5PropId p6StringSpecial HiLink p6RxP5Quantifier p6StringSpecial HiLink p6RxP5CountId p6StringSpecial HiLink p6RxP5Verb p6StringSpecial HiLink p6Escape p6StringSpecial2 HiLink p6EscNull p6StringSpecial2 HiLink p6EscHash p6StringSpecial2 HiLink p6EscQQ p6StringSpecial2 HiLink p6EscQuote p6StringSpecial2 HiLink p6EscDoubleQuote p6StringSpecial2 HiLink p6EscBackTick p6StringSpecial2 HiLink p6EscForwardSlash p6StringSpecial2 HiLink p6EscVerticalBar p6StringSpecial2 HiLink p6EscExclamation p6StringSpecial2 HiLink p6EscDollar p6StringSpecial2 HiLink p6EscOpenCurly p6StringSpecial2 HiLink p6EscCloseCurly p6StringSpecial2 HiLink p6EscCloseBracket p6StringSpecial2 HiLink p6EscCloseAngle p6StringSpecial2 HiLink p6EscCloseFrench p6StringSpecial2 HiLink p6EscBackSlash p6StringSpecial2 HiLink p6RxEscape p6StringSpecial2 HiLink p6RxCapture p6StringSpecial2 HiLink p6RxAlternation p6StringSpecial2 HiLink p6RxP5 p6StringSpecial2 HiLink p6RxP5ReadRef p6StringSpecial2 HiLink p6RxP5Oct p6StringSpecial2 HiLink p6RxP5Hex p6StringSpecial2 HiLink p6RxP5EscMeta p6StringSpecial2 HiLink p6RxP5Meta p6StringSpecial2 HiLink p6RxP5Escape p6StringSpecial2 HiLink p6RxP5CodePoint p6StringSpecial2 HiLink p6RxP5WriteRef p6StringSpecial2 HiLink p6RxP5Prop p6StringSpecial2 HiLink p6Property Tag HiLink p6Attention Todo HiLink p6Type Type HiLink p6Error Error HiLink p6BlockLabel Label HiLink p6Float Float HiLink p6Normal Normal HiLink p6Package Normal HiLink p6PackageScope Normal HiLink p6Number Number HiLink p6VersionNum Number HiLink p6String String HiLink p6Repeat Repeat HiLink p6Keyword Keyword HiLink p6Pragma Keyword HiLink p6Module Keyword HiLink p6DeclareRoutine Keyword HiLink p6VarStorage Special HiLink p6FlowControl Special HiLink p6NumberBase Special HiLink p6Twigil Special HiLink p6StringSpecial2 Special HiLink p6VersionDot Special HiLink p6Comment Comment HiLink p6Include Include HiLink p6Shebang PreProc HiLink p6ClosureTrait PreProc HiLink p6Routine Function HiLink p6Operator Operator HiLink p6Version Operator HiLink p6Context Operator HiLink p6Quote Delimiter HiLink p6TypeConstraint PreCondit HiLink p6Exception Exception HiLink p6Placeholder Identifier HiLink p6Variable Identifier HiLink p6VarSlash Identifier HiLink p6VarNum Identifier HiLink p6VarExclam Identifier HiLink p6VarMatch Identifier HiLink p6VarName Identifier HiLink p6MatchVar Identifier HiLink p6RxP5ReadRefId Identifier HiLink p6RxP5ModDef Identifier HiLink p6RxP5ModName Identifier HiLink p6Conditional Conditional HiLink p6StringSpecial SpecialChar HiLink p6PodAbbr p6Pod HiLink p6PodAbbrEOF p6Pod HiLink p6PodAbbrNoCode p6Pod HiLink p6PodAbbrCode p6PodCode HiLink p6PodPara p6Pod HiLink p6PodParaEOF p6Pod HiLink p6PodParaNoCode p6Pod HiLink p6PodParaCode p6PodCode HiLink p6PodDelim p6Pod HiLink p6PodDelimEOF p6Pod HiLink p6PodDelimNoCode p6Pod HiLink p6PodDelimCode p6PodCode HiLink p6PodImplicitCode p6PodCode HiLink p6PodExtraConfig p6PodPrefix HiLink p6PodVerticalBar p6PodFormatCode HiLink p6PodColon p6PodFormatCode HiLink p6PodSemicolon p6PodFormatCode HiLink p6PodComma p6PodFormatCode HiLink p6PodFormatOne p6PodFormat HiLink p6PodFormatTwo p6PodFormat HiLink p6PodFormatThree p6PodFormat HiLink p6PodFormatFrench p6PodFormat HiLink p6PodType Type HiLink p6PodConfigOption String HiLink p6PodCode PreProc HiLink p6Pod Comment HiLink p6PodComment Comment HiLink p6PodAutoQuote Operator HiLink p6PodConfigOperator Operator HiLink p6PodPrefix Statement HiLink p6PodName Identifier HiLink p6PodFormatCode SpecialChar HiLink p6PodFormat SpecialComment delcommand HiLink endif " Syncing to speed up processing "syn sync match p6SyncPod groupthere p6PodAbbrRegion "^=\K\k*\>" "syn sync match p6SyncPod groupthere p6PodDirectRegion "^=\%(config\|use\|encoding\)\>" "syn sync match p6SyncPod groupthere p6PodParaRegion "^=for\>" "syn sync match p6SyncPod groupthere p6PodDelimRegion "^=begin\>" "syn sync match p6SyncPod groupthere p6PodDelimEndRegion "^=end\>" " Let's just sync whole file, the other methods aren't reliable (or I don't " know how to use them reliably) syn sync fromstart setlocal foldmethod=syntax let b:current_syntax = "perl6" let &cpo = s:keepcpo unlet s:keepcpo " vim:ts=8:sts=4:sw=4:expandtab:ft=vim vim-7.4.1689/runtime/syntax/pf.vim000066400000000000000000000053251267703067000167350ustar00rootroot00000000000000" pf syntax file " Language: OpenBSD packet filter configuration (pf.conf) " Original Author: Camiel Dobbelaar " Maintainer: Lauri Tirkkonen " Last Change: 2013 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 setlocal foldmethod=syntax syn sync fromstart syn cluster pfNotLS contains=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_:.]\@/ 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 else command -nargs=+ HiLink hi def link 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" vim-7.4.1689/runtime/syntax/pfmain.vim000066400000000000000000002654261267703067000176140ustar00rootroot00000000000000" Vim syntax file " Language: Postfix main.cf configuration " Maintainer: KELEMEN Peter " Last Updates: Anton Shestakov, Hong Xu " Last Change: 2015 Feb 10 " Version: 0.40 " URL: http://cern.ch/fuji/vim/syntax/pfmain.vim " Comment: Based on Postfix 2.12/3.0 postconf.5.html. 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_defer_code syntax keyword pfmainConf access_map_reject_code syntax keyword pfmainConf address_verify_cache_cleanup_interval 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_sender_dependent_default_transport_maps syntax keyword pfmainConf address_verify_sender_dependent_relayhost_maps syntax keyword pfmainConf address_verify_sender_ttl 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_add_missing_headers syntax keyword pfmainConf always_bcc syntax keyword pfmainConf anvil_rate_time_unit syntax keyword pfmainConf anvil_status_update_time syntax keyword pfmainConf append_at_myorigin syntax keyword pfmainConf append_dot_mydomain syntax keyword pfmainConf application_event_drain_time syntax keyword pfmainConf authorized_flush_users syntax keyword pfmainConf authorized_mailq_users syntax keyword pfmainConf authorized_submit_users syntax keyword pfmainConf authorized_verp_clients 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 bounce_template_file syntax keyword pfmainConf broken_sasl_auth_clients syntax keyword pfmainConf canonical_classes syntax keyword pfmainConf canonical_maps syntax keyword pfmainConf cleanup_service_name syntax keyword pfmainConf command_directory syntax keyword pfmainConf command_execution_directory syntax keyword pfmainConf command_expansion_filter syntax keyword pfmainConf command_time_limit syntax keyword pfmainConf compatibility_level syntax keyword pfmainConf config_directory syntax keyword pfmainConf confirm_delay_cleared syntax keyword pfmainConf connection_cache_protocol_timeout syntax keyword pfmainConf connection_cache_service_name syntax keyword pfmainConf connection_cache_status_update_time syntax keyword pfmainConf connection_cache_ttl_limit syntax keyword pfmainConf content_filter syntax keyword pfmainConf cyrus_sasl_config_path syntax keyword pfmainConf daemon_directory syntax keyword pfmainConf daemon_table_open_error_is_fatal syntax keyword pfmainConf daemon_timeout syntax keyword pfmainConf data_directory syntax keyword pfmainConf debug_peer_level syntax keyword pfmainConf debug_peer_list syntax keyword pfmainConf debugger_command 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_delivery_status_filter syntax keyword pfmainConf default_destination_concurrency_failed_cohort_limit syntax keyword pfmainConf default_destination_concurrency_limit syntax keyword pfmainConf default_destination_concurrency_negative_feedback syntax keyword pfmainConf default_destination_concurrency_positive_feedback syntax keyword pfmainConf default_destination_rate_delay syntax keyword pfmainConf default_destination_recipient_limit syntax keyword pfmainConf default_extra_recipient_limit syntax keyword pfmainConf default_filter_nexthop 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_recipient_refill_delay syntax keyword pfmainConf default_recipient_refill_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_logging_resolution_limit 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 destination_concurrency_feedback_debug syntax keyword pfmainConf detect_8bit_encoding_header 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 dnsblog_reply_delay syntax keyword pfmainConf dnsblog_service_name syntax keyword pfmainConf dont_remove syntax keyword pfmainConf double_bounce_sender syntax keyword pfmainConf duplicate_filter_limit syntax keyword pfmainConf empty_address_default_transport_maps_lookup_key syntax keyword pfmainConf empty_address_recipient syntax keyword pfmainConf empty_address_relayhost_maps_lookup_key syntax keyword pfmainConf enable_errors_to syntax keyword pfmainConf enable_long_queue_ids syntax keyword pfmainConf enable_original_recipient syntax keyword pfmainConf error_notice_recipient syntax keyword pfmainConf error_service_name syntax keyword pfmainConf execution_directory_expansion_filter syntax keyword pfmainConf expand_owner_alias syntax keyword pfmainConf export_environment syntax keyword pfmainConf extract_recipient_limit syntax keyword pfmainConf fallback_relay syntax keyword pfmainConf fallback_transport syntax keyword pfmainConf fallback_transport_maps 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 frozen_delivered_to 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 inet_protocols syntax keyword pfmainConf initial_destination_concurrency syntax keyword pfmainConf internal_mail_filter_classes 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 lmdb_map_size syntax keyword pfmainConf lmtp_address_preference syntax keyword pfmainConf lmtp_address_verify_target syntax keyword pfmainConf lmtp_assume_final syntax keyword pfmainConf lmtp_bind_address syntax keyword pfmainConf lmtp_bind_address6 syntax keyword pfmainConf lmtp_body_checks syntax keyword pfmainConf lmtp_cache_connection syntax keyword pfmainConf lmtp_cname_overrides_servername syntax keyword pfmainConf lmtp_connect_timeout syntax keyword pfmainConf lmtp_connection_cache_destinations syntax keyword pfmainConf lmtp_connection_cache_on_demand syntax keyword pfmainConf lmtp_connection_cache_time_limit syntax keyword pfmainConf lmtp_connection_reuse_count_limit syntax keyword pfmainConf lmtp_connection_reuse_time_limit 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_defer_if_no_mx_address_found syntax keyword pfmainConf lmtp_delivery_status_filter syntax keyword pfmainConf lmtp_destination_concurrency_limit syntax keyword pfmainConf lmtp_destination_recipient_limit syntax keyword pfmainConf lmtp_discard_lhlo_keyword_address_maps syntax keyword pfmainConf lmtp_discard_lhlo_keywords syntax keyword pfmainConf lmtp_dns_reply_filter syntax keyword pfmainConf lmtp_dns_resolver_options syntax keyword pfmainConf lmtp_dns_support_level syntax keyword pfmainConf lmtp_enforce_tls syntax keyword pfmainConf lmtp_generic_maps syntax keyword pfmainConf lmtp_header_checks syntax keyword pfmainConf lmtp_host_lookup syntax keyword pfmainConf lmtp_lhlo_name syntax keyword pfmainConf lmtp_lhlo_timeout syntax keyword pfmainConf lmtp_line_length_limit syntax keyword pfmainConf lmtp_mail_timeout syntax keyword pfmainConf lmtp_mime_header_checks syntax keyword pfmainConf lmtp_mx_address_limit syntax keyword pfmainConf lmtp_mx_session_limit syntax keyword pfmainConf lmtp_nested_header_checks syntax keyword pfmainConf lmtp_per_record_deadline syntax keyword pfmainConf lmtp_pix_workaround_delay_time syntax keyword pfmainConf lmtp_pix_workaround_maps syntax keyword pfmainConf lmtp_pix_workaround_threshold_time syntax keyword pfmainConf lmtp_pix_workarounds syntax keyword pfmainConf lmtp_quit_timeout syntax keyword pfmainConf lmtp_quote_rfc821_envelope syntax keyword pfmainConf lmtp_randomize_addresses syntax keyword pfmainConf lmtp_rcpt_timeout syntax keyword pfmainConf lmtp_reply_filter syntax keyword pfmainConf lmtp_rset_timeout syntax keyword pfmainConf lmtp_sasl_auth_cache_name syntax keyword pfmainConf lmtp_sasl_auth_cache_time syntax keyword pfmainConf lmtp_sasl_auth_enable syntax keyword pfmainConf lmtp_sasl_auth_soft_bounce syntax keyword pfmainConf lmtp_sasl_mechanism_filter syntax keyword pfmainConf lmtp_sasl_password_maps syntax keyword pfmainConf lmtp_sasl_path syntax keyword pfmainConf lmtp_sasl_security_options syntax keyword pfmainConf lmtp_sasl_tls_security_options syntax keyword pfmainConf lmtp_sasl_tls_verified_security_options syntax keyword pfmainConf lmtp_sasl_type syntax keyword pfmainConf lmtp_send_dummy_mail_auth syntax keyword pfmainConf lmtp_send_xforward_command syntax keyword pfmainConf lmtp_sender_dependent_authentication syntax keyword pfmainConf lmtp_skip_5xx_greeting syntax keyword pfmainConf lmtp_skip_quit_response syntax keyword pfmainConf lmtp_starttls_timeout syntax keyword pfmainConf lmtp_tcp_port syntax keyword pfmainConf lmtp_tls_CAfile syntax keyword pfmainConf lmtp_tls_CApath syntax keyword pfmainConf lmtp_tls_block_early_mail_reply syntax keyword pfmainConf lmtp_tls_cert_file syntax keyword pfmainConf lmtp_tls_ciphers syntax keyword pfmainConf lmtp_tls_dcert_file syntax keyword pfmainConf lmtp_tls_dkey_file syntax keyword pfmainConf lmtp_tls_eccert_file syntax keyword pfmainConf lmtp_tls_eckey_file syntax keyword pfmainConf lmtp_tls_enforce_peername syntax keyword pfmainConf lmtp_tls_exclude_ciphers syntax keyword pfmainConf lmtp_tls_fingerprint_cert_match syntax keyword pfmainConf lmtp_tls_fingerprint_digest syntax keyword pfmainConf lmtp_tls_force_insecure_host_tlsa_lookup syntax keyword pfmainConf lmtp_tls_key_file syntax keyword pfmainConf lmtp_tls_loglevel syntax keyword pfmainConf lmtp_tls_mandatory_ciphers syntax keyword pfmainConf lmtp_tls_mandatory_exclude_ciphers syntax keyword pfmainConf lmtp_tls_mandatory_protocols syntax keyword pfmainConf lmtp_tls_note_starttls_offer syntax keyword pfmainConf lmtp_tls_per_site syntax keyword pfmainConf lmtp_tls_policy_maps syntax keyword pfmainConf lmtp_tls_protocols syntax keyword pfmainConf lmtp_tls_scert_verifydepth syntax keyword pfmainConf lmtp_tls_secure_cert_match syntax keyword pfmainConf lmtp_tls_security_level syntax keyword pfmainConf lmtp_tls_session_cache_database syntax keyword pfmainConf lmtp_tls_session_cache_timeout syntax keyword pfmainConf lmtp_tls_trust_anchor_file syntax keyword pfmainConf lmtp_tls_verify_cert_match syntax keyword pfmainConf lmtp_use_tls syntax keyword pfmainConf lmtp_xforward_timeout syntax keyword pfmainConf local_command_shell syntax keyword pfmainConf local_delivery_status_filter syntax keyword pfmainConf local_destination_concurrency_limit syntax keyword pfmainConf local_destination_recipient_limit syntax keyword pfmainConf local_header_rewrite_clients 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 mailbox_transport_maps 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 master_service_disable 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_drop_headers syntax keyword pfmainConf message_reject_characters syntax keyword pfmainConf message_size_limit syntax keyword pfmainConf message_strip_characters syntax keyword pfmainConf meta_directory syntax keyword pfmainConf milter_command_timeout syntax keyword pfmainConf milter_connect_macros syntax keyword pfmainConf milter_connect_timeout syntax keyword pfmainConf milter_content_timeout syntax keyword pfmainConf milter_data_macros syntax keyword pfmainConf milter_default_action syntax keyword pfmainConf milter_end_of_data_macros syntax keyword pfmainConf milter_end_of_header_macros syntax keyword pfmainConf milter_header_checks syntax keyword pfmainConf milter_helo_macros syntax keyword pfmainConf milter_macro_daemon_name syntax keyword pfmainConf milter_macro_v syntax keyword pfmainConf milter_mail_macros syntax keyword pfmainConf milter_protocol syntax keyword pfmainConf milter_rcpt_macros syntax keyword pfmainConf milter_unknown_command_macros 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_instance_directories syntax keyword pfmainConf multi_instance_enable syntax keyword pfmainConf multi_instance_group syntax keyword pfmainConf multi_instance_name syntax keyword pfmainConf multi_instance_wrapper 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 non_smtpd_milters syntax keyword pfmainConf notify_classes syntax keyword pfmainConf nullmx_reject_code 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 pipe_delivery_status_filter syntax keyword pfmainConf plaintext_reject_code syntax keyword pfmainConf postmulti_control_commands syntax keyword pfmainConf postmulti_start_commands syntax keyword pfmainConf postmulti_stop_commands syntax keyword pfmainConf postscreen_access_list syntax keyword pfmainConf postscreen_bare_newline_action syntax keyword pfmainConf postscreen_bare_newline_enable syntax keyword pfmainConf postscreen_bare_newline_ttl syntax keyword pfmainConf postscreen_blacklist_action syntax keyword pfmainConf postscreen_cache_cleanup_interval syntax keyword pfmainConf postscreen_cache_map syntax keyword pfmainConf postscreen_cache_retention_time syntax keyword pfmainConf postscreen_client_connection_count_limit syntax keyword pfmainConf postscreen_command_count_limit syntax keyword pfmainConf postscreen_command_filter syntax keyword pfmainConf postscreen_command_time_limit syntax keyword pfmainConf postscreen_disable_vrfy_command syntax keyword pfmainConf postscreen_discard_ehlo_keyword_address_maps syntax keyword pfmainConf postscreen_discard_ehlo_keywords syntax keyword pfmainConf postscreen_dnsbl_action syntax keyword pfmainConf postscreen_dnsbl_reply_map syntax keyword pfmainConf postscreen_dnsbl_sites syntax keyword pfmainConf postscreen_dnsbl_threshold syntax keyword pfmainConf postscreen_dnsbl_timeout syntax keyword pfmainConf postscreen_dnsbl_ttl syntax keyword pfmainConf postscreen_dnsbl_whitelist_threshold syntax keyword pfmainConf postscreen_enforce_tls syntax keyword pfmainConf postscreen_expansion_filter syntax keyword pfmainConf postscreen_forbidden_commands syntax keyword pfmainConf postscreen_greet_action syntax keyword pfmainConf postscreen_greet_banner syntax keyword pfmainConf postscreen_greet_ttl syntax keyword pfmainConf postscreen_greet_wait syntax keyword pfmainConf postscreen_helo_required syntax keyword pfmainConf postscreen_non_smtp_command_action syntax keyword pfmainConf postscreen_non_smtp_command_enable syntax keyword pfmainConf postscreen_non_smtp_command_ttl syntax keyword pfmainConf postscreen_pipelining_action syntax keyword pfmainConf postscreen_pipelining_enable syntax keyword pfmainConf postscreen_pipelining_ttl syntax keyword pfmainConf postscreen_post_queue_limit syntax keyword pfmainConf postscreen_pre_queue_limit syntax keyword pfmainConf postscreen_reject_footer syntax keyword pfmainConf postscreen_tls_security_level syntax keyword pfmainConf postscreen_upstream_proxy_protocol syntax keyword pfmainConf postscreen_upstream_proxy_timeout syntax keyword pfmainConf postscreen_use_tls syntax keyword pfmainConf postscreen_watchdog_timeout syntax keyword pfmainConf postscreen_whitelist_interfaces syntax keyword pfmainConf prepend_delivered_header syntax keyword pfmainConf process_id syntax keyword pfmainConf process_id_directory syntax keyword pfmainConf process_name syntax keyword pfmainConf propagate_unmatched_extensions syntax keyword pfmainConf proxy_interfaces syntax keyword pfmainConf proxy_read_maps syntax keyword pfmainConf proxy_write_maps syntax keyword pfmainConf proxymap_service_name syntax keyword pfmainConf proxywrite_service_name syntax keyword pfmainConf qmgr_clog_warn_time syntax keyword pfmainConf qmgr_daemon_timeout syntax keyword pfmainConf qmgr_fudge_factor syntax keyword pfmainConf qmgr_ipc_timeout 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_client_port_logging 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_classes syntax keyword pfmainConf recipient_canonical_maps syntax keyword pfmainConf recipient_delimiter syntax keyword pfmainConf reject_code syntax keyword pfmainConf reject_tempfail_action 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 remote_header_rewrite_domain syntax keyword pfmainConf require_home_directory syntax keyword pfmainConf reset_owner_alias syntax keyword pfmainConf resolve_dequoted_address syntax keyword pfmainConf resolve_null_domain syntax keyword pfmainConf resolve_numeric_domain syntax keyword pfmainConf rewrite_service_name syntax keyword pfmainConf sample_directory syntax keyword pfmainConf send_cyrus_sasl_authzid syntax keyword pfmainConf sender_based_routing syntax keyword pfmainConf sender_bcc_maps syntax keyword pfmainConf sender_canonical_classes syntax keyword pfmainConf sender_canonical_maps syntax keyword pfmainConf sender_dependent_default_transport_maps syntax keyword pfmainConf sender_dependent_relayhost_maps syntax keyword pfmainConf sendmail_fix_line_endings syntax keyword pfmainConf sendmail_path syntax keyword pfmainConf service_throttle_time syntax keyword pfmainConf setgid_group syntax keyword pfmainConf shlib_directory syntax keyword pfmainConf show_user_unknown_table_name syntax keyword pfmainConf showq_service_name syntax keyword pfmainConf smtp_address_preference syntax keyword pfmainConf smtp_address_verify_target syntax keyword pfmainConf smtp_always_send_ehlo syntax keyword pfmainConf smtp_bind_address syntax keyword pfmainConf smtp_bind_address6 syntax keyword pfmainConf smtp_body_checks syntax keyword pfmainConf smtp_cname_overrides_servername syntax keyword pfmainConf smtp_connect_timeout syntax keyword pfmainConf smtp_connection_cache_destinations syntax keyword pfmainConf smtp_connection_cache_on_demand syntax keyword pfmainConf smtp_connection_cache_time_limit syntax keyword pfmainConf smtp_connection_reuse_count_limit syntax keyword pfmainConf smtp_connection_reuse_time_limit 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_delivery_status_filter syntax keyword pfmainConf smtp_destination_concurrency_limit syntax keyword pfmainConf smtp_destination_recipient_limit syntax keyword pfmainConf smtp_discard_ehlo_keyword_address_maps syntax keyword pfmainConf smtp_discard_ehlo_keywords syntax keyword pfmainConf smtp_dns_reply_filter syntax keyword pfmainConf smtp_dns_resolver_options syntax keyword pfmainConf smtp_dns_support_level syntax keyword pfmainConf smtp_enforce_tls syntax keyword pfmainConf smtp_fallback_relay syntax keyword pfmainConf smtp_generic_maps syntax keyword pfmainConf smtp_header_checks 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_mime_header_checks syntax keyword pfmainConf smtp_mx_address_limit syntax keyword pfmainConf smtp_mx_session_limit syntax keyword pfmainConf smtp_nested_header_checks syntax keyword pfmainConf smtp_never_send_ehlo syntax keyword pfmainConf smtp_per_record_deadline syntax keyword pfmainConf smtp_pix_workaround_delay_time syntax keyword pfmainConf smtp_pix_workaround_maps syntax keyword pfmainConf smtp_pix_workaround_threshold_time syntax keyword pfmainConf smtp_pix_workarounds 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_reply_filter syntax keyword pfmainConf smtp_rset_timeout syntax keyword pfmainConf smtp_sasl_auth_cache_name syntax keyword pfmainConf smtp_sasl_auth_cache_time syntax keyword pfmainConf smtp_sasl_auth_enable syntax keyword pfmainConf smtp_sasl_auth_soft_bounce syntax keyword pfmainConf smtp_sasl_mechanism_filter syntax keyword pfmainConf smtp_sasl_password_maps syntax keyword pfmainConf smtp_sasl_path 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_sasl_type syntax keyword pfmainConf smtp_send_dummy_mail_auth syntax keyword pfmainConf smtp_send_xforward_command syntax keyword pfmainConf smtp_sender_dependent_authentication syntax keyword pfmainConf smtp_skip_4xx_greeting 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_block_early_mail_reply syntax keyword pfmainConf smtp_tls_cert_file syntax keyword pfmainConf smtp_tls_cipherlist syntax keyword pfmainConf smtp_tls_ciphers syntax keyword pfmainConf smtp_tls_dcert_file syntax keyword pfmainConf smtp_tls_dkey_file syntax keyword pfmainConf smtp_tls_eccert_file syntax keyword pfmainConf smtp_tls_eckey_file syntax keyword pfmainConf smtp_tls_enforce_peername syntax keyword pfmainConf smtp_tls_exclude_ciphers syntax keyword pfmainConf smtp_tls_fingerprint_cert_match syntax keyword pfmainConf smtp_tls_fingerprint_digest syntax keyword pfmainConf smtp_tls_force_insecure_host_tlsa_lookup syntax keyword pfmainConf smtp_tls_key_file syntax keyword pfmainConf smtp_tls_loglevel syntax keyword pfmainConf smtp_tls_mandatory_ciphers syntax keyword pfmainConf smtp_tls_mandatory_exclude_ciphers syntax keyword pfmainConf smtp_tls_mandatory_protocols syntax keyword pfmainConf smtp_tls_note_starttls_offer syntax keyword pfmainConf smtp_tls_per_site syntax keyword pfmainConf smtp_tls_policy_maps syntax keyword pfmainConf smtp_tls_protocols syntax keyword pfmainConf smtp_tls_scert_verifydepth syntax keyword pfmainConf smtp_tls_secure_cert_match syntax keyword pfmainConf smtp_tls_security_level syntax keyword pfmainConf smtp_tls_session_cache_database syntax keyword pfmainConf smtp_tls_session_cache_timeout syntax keyword pfmainConf smtp_tls_trust_anchor_file syntax keyword pfmainConf smtp_tls_verify_cert_match syntax keyword pfmainConf smtp_tls_wrappermode 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_rate_limit syntax keyword pfmainConf smtpd_client_event_limit_exceptions syntax keyword pfmainConf smtpd_client_message_rate_limit syntax keyword pfmainConf smtpd_client_new_tls_session_rate_limit syntax keyword pfmainConf smtpd_client_port_logging syntax keyword pfmainConf smtpd_client_recipient_rate_limit syntax keyword pfmainConf smtpd_client_restrictions syntax keyword pfmainConf smtpd_command_filter syntax keyword pfmainConf smtpd_data_restrictions syntax keyword pfmainConf smtpd_delay_open_until_valid_rcpt syntax keyword pfmainConf smtpd_delay_reject syntax keyword pfmainConf smtpd_discard_ehlo_keyword_address_maps syntax keyword pfmainConf smtpd_discard_ehlo_keywords syntax keyword pfmainConf smtpd_dns_reply_filter syntax keyword pfmainConf smtpd_end_of_data_restrictions 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_forbidden_commands 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_log_access_permit_actions syntax keyword pfmainConf smtpd_milters syntax keyword pfmainConf smtpd_noop_commands syntax keyword pfmainConf smtpd_null_access_lookup_key syntax keyword pfmainConf smtpd_peername_lookup syntax keyword pfmainConf smtpd_per_record_deadline syntax keyword pfmainConf smtpd_policy_service_default_action syntax keyword pfmainConf smtpd_policy_service_max_idle syntax keyword pfmainConf smtpd_policy_service_max_ttl syntax keyword pfmainConf smtpd_policy_service_request_limit syntax keyword pfmainConf smtpd_policy_service_retry_delay syntax keyword pfmainConf smtpd_policy_service_timeout syntax keyword pfmainConf smtpd_policy_service_try_limit syntax keyword pfmainConf smtpd_proxy_ehlo syntax keyword pfmainConf smtpd_proxy_filter syntax keyword pfmainConf smtpd_proxy_options 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_footer syntax keyword pfmainConf smtpd_reject_unlisted_recipient syntax keyword pfmainConf smtpd_reject_unlisted_sender syntax keyword pfmainConf smtpd_relay_restrictions 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_authenticated_header syntax keyword pfmainConf smtpd_sasl_exceptions_networks syntax keyword pfmainConf smtpd_sasl_local_domain syntax keyword pfmainConf smtpd_sasl_path syntax keyword pfmainConf smtpd_sasl_security_options syntax keyword pfmainConf smtpd_sasl_service syntax keyword pfmainConf smtpd_sasl_tls_security_options syntax keyword pfmainConf smtpd_sasl_type syntax keyword pfmainConf smtpd_sender_login_maps syntax keyword pfmainConf smtpd_sender_restrictions syntax keyword pfmainConf smtpd_service_name 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_always_issue_session_ids 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_ciphers 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_eccert_file syntax keyword pfmainConf smtpd_tls_eckey_file syntax keyword pfmainConf smtpd_tls_eecdh_grade syntax keyword pfmainConf smtpd_tls_exclude_ciphers syntax keyword pfmainConf smtpd_tls_fingerprint_digest syntax keyword pfmainConf smtpd_tls_key_file syntax keyword pfmainConf smtpd_tls_loglevel syntax keyword pfmainConf smtpd_tls_mandatory_ciphers syntax keyword pfmainConf smtpd_tls_mandatory_exclude_ciphers syntax keyword pfmainConf smtpd_tls_mandatory_protocols syntax keyword pfmainConf smtpd_tls_protocols syntax keyword pfmainConf smtpd_tls_received_header syntax keyword pfmainConf smtpd_tls_req_ccert syntax keyword pfmainConf smtpd_tls_security_level 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_upstream_proxy_protocol syntax keyword pfmainConf smtpd_upstream_proxy_timeout syntax keyword pfmainConf smtpd_use_tls syntax keyword pfmainConf smtputf8_autodetect_classes syntax keyword pfmainConf smtputf8_enable syntax keyword pfmainConf soft_bounce syntax keyword pfmainConf stale_lock_time syntax keyword pfmainConf stress syntax keyword pfmainConf strict_7bit_headers syntax keyword pfmainConf strict_8bitmime syntax keyword pfmainConf strict_8bitmime_body syntax keyword pfmainConf strict_mailbox_ownership syntax keyword pfmainConf strict_mime_encoding_domain syntax keyword pfmainConf strict_rfc821_envelopes syntax keyword pfmainConf strict_smtputf8 syntax keyword pfmainConf sun_mailtool_compatibility syntax keyword pfmainConf swap_bangpath syntax keyword pfmainConf syslog_facility syntax keyword pfmainConf syslog_name syntax keyword pfmainConf tcp_windowsize syntax keyword pfmainConf tls_append_default_CA syntax keyword pfmainConf tls_daemon_random_bytes syntax keyword pfmainConf tls_dane_digest_agility syntax keyword pfmainConf tls_dane_digests syntax keyword pfmainConf tls_dane_trust_anchor_digest_enable syntax keyword pfmainConf tls_disable_workarounds syntax keyword pfmainConf tls_eecdh_strong_curve syntax keyword pfmainConf tls_eecdh_ultra_curve syntax keyword pfmainConf tls_export_cipherlist syntax keyword pfmainConf tls_high_cipherlist syntax keyword pfmainConf tls_legacy_public_key_fingerprints syntax keyword pfmainConf tls_low_cipherlist syntax keyword pfmainConf tls_medium_cipherlist syntax keyword pfmainConf tls_null_cipherlist syntax keyword pfmainConf tls_preempt_cipherlist 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 tls_session_ticket_cipher syntax keyword pfmainConf tls_ssl_options syntax keyword pfmainConf tls_wildcard_matches_multiple_labels syntax keyword pfmainConf tlsmgr_service_name syntax keyword pfmainConf tlsproxy_enforce_tls syntax keyword pfmainConf tlsproxy_service_name syntax keyword pfmainConf tlsproxy_tls_CAfile syntax keyword pfmainConf tlsproxy_tls_CApath syntax keyword pfmainConf tlsproxy_tls_always_issue_session_ids syntax keyword pfmainConf tlsproxy_tls_ask_ccert syntax keyword pfmainConf tlsproxy_tls_ccert_verifydepth syntax keyword pfmainConf tlsproxy_tls_cert_file syntax keyword pfmainConf tlsproxy_tls_ciphers syntax keyword pfmainConf tlsproxy_tls_dcert_file syntax keyword pfmainConf tlsproxy_tls_dh1024_param_file syntax keyword pfmainConf tlsproxy_tls_dh512_param_file syntax keyword pfmainConf tlsproxy_tls_dkey_file syntax keyword pfmainConf tlsproxy_tls_eccert_file syntax keyword pfmainConf tlsproxy_tls_eckey_file syntax keyword pfmainConf tlsproxy_tls_eecdh_grade syntax keyword pfmainConf tlsproxy_tls_exclude_ciphers syntax keyword pfmainConf tlsproxy_tls_fingerprint_digest syntax keyword pfmainConf tlsproxy_tls_key_file syntax keyword pfmainConf tlsproxy_tls_loglevel syntax keyword pfmainConf tlsproxy_tls_mandatory_ciphers syntax keyword pfmainConf tlsproxy_tls_mandatory_exclude_ciphers syntax keyword pfmainConf tlsproxy_tls_mandatory_protocols syntax keyword pfmainConf tlsproxy_tls_protocols syntax keyword pfmainConf tlsproxy_tls_req_ccert syntax keyword pfmainConf tlsproxy_tls_security_level syntax keyword pfmainConf tlsproxy_tls_session_cache_timeout syntax keyword pfmainConf tlsproxy_use_tls syntax keyword pfmainConf tlsproxy_watchdog_timeout syntax keyword pfmainConf trace_service_name syntax keyword pfmainConf transport_delivery_slot_cost syntax keyword pfmainConf transport_delivery_slot_discount syntax keyword pfmainConf transport_delivery_slot_loan syntax keyword pfmainConf transport_destination_concurrency_failed_cohort_limit syntax keyword pfmainConf transport_destination_concurrency_limit syntax keyword pfmainConf transport_destination_concurrency_negative_feedback syntax keyword pfmainConf transport_destination_concurrency_positive_feedback syntax keyword pfmainConf transport_destination_rate_delay syntax keyword pfmainConf transport_destination_recipient_limit syntax keyword pfmainConf transport_extra_recipient_limit syntax keyword pfmainConf transport_initial_destination_concurrency syntax keyword pfmainConf transport_maps syntax keyword pfmainConf transport_minimum_delivery_slots syntax keyword pfmainConf transport_recipient_limit syntax keyword pfmainConf transport_recipient_refill_delay syntax keyword pfmainConf transport_recipient_refill_limit syntax keyword pfmainConf transport_retry_time syntax keyword pfmainConf transport_time_limit syntax keyword pfmainConf trigger_timeout syntax keyword pfmainConf undisclosed_recipients_header syntax keyword pfmainConf unknown_address_reject_code syntax keyword pfmainConf unknown_address_tempfail_action syntax keyword pfmainConf unknown_client_reject_code syntax keyword pfmainConf unknown_helo_hostname_tempfail_action 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_defer_code syntax keyword pfmainConf unverified_recipient_reject_code syntax keyword pfmainConf unverified_recipient_reject_reason syntax keyword pfmainConf unverified_recipient_tempfail_action syntax keyword pfmainConf unverified_sender_defer_code syntax keyword pfmainConf unverified_sender_reject_code syntax keyword pfmainConf unverified_sender_reject_reason syntax keyword pfmainConf unverified_sender_tempfail_action syntax keyword pfmainConf verp_delimiter_filter syntax keyword pfmainConf virtual_alias_address_length_limit 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_delivery_status_filter 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_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 "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax match pfmainRef "$\" syntax keyword pfmainWord accept syntax keyword pfmainWord all syntax keyword pfmainWord always syntax keyword pfmainWord check_address_map syntax keyword pfmainWord check_ccert_access syntax keyword pfmainWord check_client_a_access syntax keyword pfmainWord check_client_access syntax keyword pfmainWord check_client_mx_access syntax keyword pfmainWord check_client_ns_access syntax keyword pfmainWord check_etrn_access syntax keyword pfmainWord check_helo_a_access syntax keyword pfmainWord check_helo_access syntax keyword pfmainWord check_helo_mx_access syntax keyword pfmainWord check_helo_ns_access syntax keyword pfmainWord check_policy_service syntax keyword pfmainWord check_recipient_a_access syntax keyword pfmainWord check_recipient_access syntax keyword pfmainWord check_recipient_maps syntax keyword pfmainWord check_recipient_mx_access syntax keyword pfmainWord check_recipient_ns_access syntax keyword pfmainWord check_relay_domains syntax keyword pfmainWord check_reverse_client_hostname_a_access syntax keyword pfmainWord check_reverse_client_hostname_access syntax keyword pfmainWord check_reverse_client_hostname_mx_access syntax keyword pfmainWord check_reverse_client_hostname_ns_access syntax keyword pfmainWord check_sasl_access syntax keyword pfmainWord check_sender_a_access syntax keyword pfmainWord check_sender_access syntax keyword pfmainWord check_sender_mx_access syntax keyword pfmainWord check_sender_ns_access syntax keyword pfmainWord class syntax keyword pfmainWord client_address syntax keyword pfmainWord client_port syntax keyword pfmainWord dane syntax keyword pfmainWord dane-only syntax keyword pfmainWord defer syntax keyword pfmainWord defer_if_permit syntax keyword pfmainWord defer_if_reject syntax keyword pfmainWord defer_unauth_destination syntax keyword pfmainWord disabled syntax keyword pfmainWord dns syntax keyword pfmainWord dnssec syntax keyword pfmainWord drop syntax keyword pfmainWord dunno syntax keyword pfmainWord enabled syntax keyword pfmainWord encrypt syntax keyword pfmainWord enforce syntax keyword pfmainWord envelope_recipient syntax keyword pfmainWord envelope_sender syntax keyword pfmainWord export syntax keyword pfmainWord fingerprint syntax keyword pfmainWord header_recipient syntax keyword pfmainWord header_sender syntax keyword pfmainWord high syntax keyword pfmainWord host syntax keyword pfmainWord ignore syntax keyword pfmainWord ipv4 syntax keyword pfmainWord ipv6 syntax keyword pfmainWord localtime syntax keyword pfmainWord low syntax keyword pfmainWord may syntax keyword pfmainWord maybe syntax keyword pfmainWord medium syntax keyword pfmainWord native syntax keyword pfmainWord never syntax keyword pfmainWord no_address_mappings syntax keyword pfmainWord no_header_body_checks syntax keyword pfmainWord no_header_reply syntax keyword pfmainWord no_milters syntax keyword pfmainWord no_unknown_recipient_checks syntax keyword pfmainWord none syntax keyword pfmainWord null syntax keyword pfmainWord off syntax keyword pfmainWord on syntax keyword pfmainWord permit syntax keyword pfmainWord permit_auth_destination syntax keyword pfmainWord permit_dnswl_client syntax keyword pfmainWord permit_inet_interfaces syntax keyword pfmainWord permit_mx_backup syntax keyword pfmainWord permit_mynetworks syntax keyword pfmainWord permit_naked_ip_address syntax keyword pfmainWord permit_rhswl_client syntax keyword pfmainWord permit_sasl_authenticated syntax keyword pfmainWord permit_tls_all_clientcerts syntax keyword pfmainWord permit_tls_clientcerts syntax keyword pfmainWord quarantine syntax keyword pfmainWord reject syntax keyword pfmainWord reject_authenticated_sender_login_mismatch syntax keyword pfmainWord reject_invalid_helo_hostname syntax keyword pfmainWord reject_invalid_hostname syntax keyword pfmainWord reject_known_sender_login_mismatch syntax keyword pfmainWord reject_maps_rbl syntax keyword pfmainWord reject_multi_recipient_bounce syntax keyword pfmainWord reject_non_fqdn_helo_hostname syntax keyword pfmainWord reject_non_fqdn_hostname syntax keyword pfmainWord reject_non_fqdn_recipient syntax keyword pfmainWord reject_non_fqdn_sender syntax keyword pfmainWord reject_plaintext_session syntax keyword pfmainWord reject_rbl syntax keyword pfmainWord reject_rbl_client syntax keyword pfmainWord reject_rhsbl_client syntax keyword pfmainWord reject_rhsbl_helo syntax keyword pfmainWord reject_rhsbl_recipient syntax keyword pfmainWord reject_rhsbl_reverse_client syntax keyword pfmainWord reject_rhsbl_sender syntax keyword pfmainWord reject_sender_login_mismatch syntax keyword pfmainWord reject_unauth_destination syntax keyword pfmainWord reject_unauth_pipelining syntax keyword pfmainWord reject_unauthenticated_sender_login_mismatch syntax keyword pfmainWord reject_unknown_address syntax keyword pfmainWord reject_unknown_client syntax keyword pfmainWord reject_unknown_client_hostname syntax keyword pfmainWord reject_unknown_forward_client_hostname syntax keyword pfmainWord reject_unknown_helo_hostname syntax keyword pfmainWord reject_unknown_hostname syntax keyword pfmainWord reject_unknown_recipient_domain syntax keyword pfmainWord reject_unknown_reverse_client_hostname syntax keyword pfmainWord reject_unknown_sender_domain syntax keyword pfmainWord reject_unlisted_recipient syntax keyword pfmainWord reject_unlisted_sender syntax keyword pfmainWord reject_unverified_recipient syntax keyword pfmainWord reject_unverified_sender syntax keyword pfmainWord secure syntax keyword pfmainWord server_name syntax keyword pfmainWord sleep syntax keyword pfmainWord smtpd_access_maps syntax keyword pfmainWord speed_adjust syntax keyword pfmainWord strong syntax keyword pfmainWord subnet syntax keyword pfmainWord tempfail syntax keyword pfmainWord ultra syntax keyword pfmainWord warn_if_reject syntax keyword pfmainWord CRYPTOPRO_TLSEXT_BUG syntax keyword pfmainWord DONT_INSERT_EMPTY_FRAGMENTS syntax keyword pfmainWord LEGACY_SERVER_CONNECT syntax keyword pfmainWord MICROSOFT_BIG_SSLV3_BUFFER syntax keyword pfmainWord MICROSOFT_SESS_ID_BUG syntax keyword pfmainWord MSIE_SSLV2_RSA_PADDING syntax keyword pfmainWord NETSCAPE_CHALLENGE_BUG syntax keyword pfmainWord NETSCAPE_REUSE_CIPHER_CHANGE_BUG syntax keyword pfmainWord SSLEAY_080_CLIENT_DH_BUG syntax keyword pfmainWord SSLREF2_REUSE_CERT_TYPE_BUG syntax keyword pfmainWord TLS_BLOCK_PADDING_BUG syntax keyword pfmainWord TLS_D5_BUG syntax keyword pfmainWord TLS_ROLLBACK_BUG syntax keyword pfmainDict btree cidr environ hash nis pcre proxy regexp sdbm static tcp unix syntax keyword pfmainQueueDir incoming active deferred corrupt hold syntax keyword pfmainTransport smtp lmtp unix local relay uucp virtual 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 syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\<2bounce\>" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" syntax match pfmainSpecial "\" if version >= 508 || !exists("pfmain_syntax_init") if version < 508 let pfmain_syntax_init = 1 command -nargs=+ HiLink hi link else command -nargs=+ HiLink hi def link endif HiLink pfmainConf Statement HiLink pfmainRef PreProc HiLink pfmainWord identifier HiLink pfmainDict Type HiLink pfmainQueueDir Constant HiLink pfmainTransport Constant HiLink pfmainLock Constant HiLink pfmainAnswer Constant HiLink pfmainComment Comment HiLink pfmainNumber Number HiLink pfmainTime Number HiLink pfmainIP Number HiLink pfmainVariable Error HiLink pfmainSpecial Special delcommand HiLink endif let b:current_syntax = "pfmain" " vim: ts=8 sw=2 vim-7.4.1689/runtime/syntax/php.vim000066400000000000000000002371101267703067000171160ustar00rootroot00000000000000" Vim syntax file " Language: php PHP 3/4/5 " Maintainer: Jason Woofenden " Last Change: Dec 26, 2015 " URL: https://jasonwoof.com/gitweb/?p=vim-syntax.git;a=blob;f=php.vim;hb=HEAD " Former Maintainers: Peter Hodge " Debian VIM Maintainers " " Note: If you are using a colour terminal with dark background, you will probably find " the 'elflord' colorscheme is much better for PHP's syntax than the default " colourscheme, because elflord's colours will better highlight the break-points " (Statements) in your code. " " 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 " " Added by Peter Hodge On June 9, 2006: " php_special_functions = 1|0 to highlight functions with abnormal behaviour " php_alt_comparisons = 1|0 to highlight comparison operators in an alternate colour " php_alt_assignByReference = 1|0 to highlight '= &' in an alternate colour " " Note: these all default to 1 (On), so you would set them to '0' to turn them off. " E.g., in your .vimrc or _vimrc file: " let php_special_functions = 0 " let php_alt_comparisons = 0 " let php_alt_assignByReference = 0 " Unletting these variables will revert back to their default (On). " " " 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) A 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 :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 :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 " make sure we can use \ at the begining of the line to do a continuation let s:cpo_save = &cpo set cpo&vim 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 contained " Predefined constants " Generated by: curl -q http://php.net/manual/en/errorfunc.constants.php | grep -oP 'E_\w+' | sort -u syn keyword phpCoreConstant E_ALL E_COMPILE_ERROR E_COMPILE_WARNING E_CORE_ERROR E_CORE_WARNING E_DEPRECATED E_ERROR E_NOTICE E_PARSE E_RECOVERABLE_ERROR E_STRICT E_USER_DEPRECATED E_USER_ERROR E_USER_NOTICE E_USER_WARNING E_WARNING contained syn case ignore syn keyword phpConstant __LINE__ __FILE__ __FUNCTION__ __METHOD__ __CLASS__ __DIR__ __NAMESPACE__ 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 json_decode json_encode json_last_error 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 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 goto contained " Keyword syn keyword phpKeyword var const contained " Type syn keyword phpType bool boolean int integer real double float string array object NULL contained " Structure syn keyword phpStructure namespace 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 "&&\|\" contained display syn match phpOperator "||\|\" 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 " Interpolated indentifiers (inside strings) syn match phpBrackets "[][}{]" contained display " errors syn match phpInterpSimpleError "\[[^]]*\]" contained display " fallback (if nothing else matches) syn match phpInterpSimpleError "->[^a-zA-Z_]" contained display " make sure these stay above the correct DollarCurlies so they don't take priority syn match phpInterpBogusDollarCurley "${[^}]*}" contained display " fallback (if nothing else matches) syn match phpinterpSimpleBracketsInner "\w\+" contained syn match phpInterpSimpleBrackets "\[\h\w*]" contained contains=phpBrackets,phpInterpSimpleBracketsInner syn match phpInterpSimpleBrackets "\[\d\+]" contained contains=phpBrackets,phpInterpSimpleBracketsInner syn match phpInterpSimpleBrackets "\[0[xX]\x\+]" contained contains=phpBrackets,phpInterpSimpleBracketsInner syn match phpInterpSimple "\$\h\w*\(\[[^]]*\]\|->\h\w*\)\?" contained contains=phpInterpSimpleBrackets,phpIdentifier,phpInterpSimpleError,phpMethods,phpMemberSelector display syn match phpInterpVarname "\h\w*" contained syn match phpInterpMethodName "\h\w*" contained " default color syn match phpInterpSimpleCurly "\${\h\w*}" contains=phpInterpVarname contained extend syn region phpInterpDollarCurley1Helper matchgroup=phpParent start="{" end="\[" contains=phpInterpVarname contained syn region phpInterpDollarCurly1 matchgroup=phpParent start="\${\h\w*\["rs=s+1 end="]}" contains=phpInterpDollarCurley1Helper,@phpClConst contained extend syn match phpInterpDollarCurley2Helper "{\h\w*->" contains=phpBrackets,phpInterpVarname,phpMemberSelector contained syn region phpInterpDollarCurly2 matchgroup=phpParent start="\${\h\w*->"rs=s+1 end="}" contains=phpInterpDollarCurley2Helper,phpInterpMethodName contained syn match phpInterpBogusDollarCurley "${\h\w*->}" contained display syn match phpInterpBogusDollarCurley "${\h\w*\[]}" contained display syn region phpInterpComplex matchgroup=phpParent start="{\$"rs=e-1 end="}" contains=phpIdentifier,phpMemberSelector,phpVarSelector,phpIdentifierComplexP contained extend syn region phpIdentifierComplexP matchgroup=phpParent start="\[" end="]" contains=@phpClInside contained " define a cluster to get all interpolation syntaxes for double-quoted strings syn cluster phpInterpDouble contains=phpInterpSimple,phpInterpSimpleCurly,phpInterpDollarCurly1,phpInterpDollarCurly2,phpInterpBogusDollarCurley,phpInterpComplex " Methoden syn match phpMethodsVar "->\h\w*" contained contains=phpMethods,phpMemberSelector display " Include syn keyword phpInclude include require include_once require_once use contained " Peter Hodge - added 'clone' keyword " Define syn keyword phpDefine new clone 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 " Backslash escapes syn case match " for double quotes and heredoc syn match phpBackslashSequences "\\[fnrtv\\\"$]" contained display syn match phpBackslashSequences "\\\d\{1,3}" contained contains=phpOctalError display syn match phpBackslashSequences "\\x\x\{1,2}" contained display " additional sequence for double quotes only syn match phpBackslashDoubleQuote "\\[\"]" contained display " for single quotes only syn match phpBackslashSingleQuote "\\[\\']" contained display syn case ignore " 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=phpStringDouble start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@phpAddStrings,phpBackslashSequences,phpBackslashDoubleQuote,@phpInterpDouble contained keepend syn region phpBacktick matchgroup=phpBacktick start=+`+ skip=+\\\\\|\\"+ end=+`+ contains=@phpAddStrings,phpIdentifier,phpBackslashSequences,phpIdentifierSimply,phpIdentifierComplex contained keepend syn region phpStringSingle matchgroup=phpStringSingle start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@phpAddStrings,phpBackslashSingleQuote contained keepend else syn region phpStringDouble matchgroup=phpStringDouble start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@phpAddStrings,phpBackslashSequences,phpBackslashDoubleQuote,@phpInterpDouble contained extend keepend syn region phpBacktick matchgroup=phpBacktick start=+`+ skip=+\\\\\|\\"+ end=+`+ contains=@phpAddStrings,phpIdentifier,phpBackslashSequences,phpIdentifierSimply,phpIdentifierComplex contained extend keepend syn region phpStringSingle matchgroup=phpStringSingle start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@phpAddStrings,phpBackslashSingleQuote contained keepend extend endif " HereDoc and NowDoc if version >= 600 syn case match " HereDoc syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\(\"\=\)\z(\I\i*\)\2$" end="^\z1\(;\=$\)\@=" contained contains=phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpBackslashSequences,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*\)\)\2$" end="^\z1\(;\=$\)\@=" contained contains=@htmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpBackslashSequences,phpMethodsVar keepend extend syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\(\"\=\)\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)\2$" end="^\z1\(;\=$\)\@=" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpBackslashSequences,phpMethodsVar keepend extend syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\(\"\=\)\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)\2$" end="^\z1\(;\=$\)\@=" contained contains=@htmlJavascript,phpIdentifierSimply,phpIdentifier,phpIdentifierComplex,phpBackslashSequences,phpMethodsVar keepend extend " NowDoc syn region phpNowDoc matchgroup=Delimiter start="\(<<<\)\@<='\z(\I\i*\)'$" end="^\z1\(;\=$\)\@=" contained keepend extend " including HTML,JavaScript,SQL even if not enabled via options syn region phpNowDoc matchgroup=Delimiter start="\(<<<\)\@<='\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)'$" end="^\z1\(;\=$\)\@=" contained contains=@htmlTop keepend extend syn region phpNowDoc matchgroup=Delimiter start="\(<<<\)\@<='\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)'$" end="^\z1\(;\=$\)\@=" contained contains=@sqlTop keepend extend syn region phpNowDoc matchgroup=Delimiter start="\(<<<\)\@<='\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)'$" end="^\z1\(;\=$\)\@=" contained contains=@htmlJavascript 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,phpBacktick,phpNumber,phpFloat,phpKeyword,phpType,phpBoolean,phpStructure,phpMethodsVar,phpConstant,phpCoreConstant,phpException syn cluster phpClInside contains=@phpClConst,phpComment,phpLabel,phpParent,phpParentError,phpInclude,phpHereDoc,phpNowDoc 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="" contains=@phpClTop else syn region phpRegion matchgroup=Delimiter start="" contains=@phpClTop endif syn region phpRegionSc matchgroup=Delimiter start=++ 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="" contains=@phpClTop keepend else syn region phpRegion matchgroup=Delimiter start="" contains=@phpClTop keepend endif syn region phpRegionSc matchgroup=Delimiter start=++ 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="" end="-]@]\=?[<>]@!" contained containedin=phpRegion " highlight the 'instanceof' operator as a comparison operator rather than a structure syntax case ignore syntax keyword phpComparison instanceof contained containedin=phpRegion hi link phpComparison Statement endif " ================================================================ " Sync if php_sync_method==-1 if exists("php_noShortTags") syn sync match phpRegionSync grouphere phpRegion "^\s*\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 syntax match phpDocCustomTags "@[a-zA-Z]*\(\s\+\|\n\|\r\)" containedin=phpComment syntax region phpDocTags start="{@\(example\|id\|internal\|inheritdoc\|link\|source\|toc\|tutorial\)" end="}" containedin=phpComment syntax match phpDocTags "@\(abstract\|access\|author\|category\|copyright\|deprecated\|example\|final\|global\|ignore\|internal\|license\|link\|method\|name\|package\|param\|property\|return\|see\|since\|static\|staticvar\|subpackage\|tutorial\|uses\|var\|version\|contributor\|modified\|filename\|description\|filesource\|throws\)\(\s\+\)\?" containedin=phpComment syntax match phpDocTodo "@\(todo\|fixme\|xxx\)\(\s\+\)\?" containedin=phpComment " Define the default highlighting. " For version 5.7 and earlier: only 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 else command -nargs=+ HiLink hi def link endif HiLink phpConstant Constant HiLink phpCoreConstant Constant HiLink phpComment Comment HiLink phpDocTags PreProc HiLink phpDocCustomTags Type 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 phpBacktick 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 phpBackslashSequences SpecialChar HiLink phpBackslashDoubleQuote SpecialChar HiLink phpBackslashSingleQuote SpecialChar HiLink phpParent Delimiter HiLink phpBrackets Delimiter HiLink phpIdentifierConst Delimiter HiLink phpParentError Error HiLink phpOctalError Error HiLink phpInterpSimpleError Error HiLink phpInterpBogusDollarCurley Error HiLink phpInterpDollarCurly1 Error HiLink phpInterpDollarCurly2 Error HiLink phpInterpSimpleBracketsInner String HiLink phpInterpSimpleCurly Delimiter HiLink phpInterpVarname Identifier HiLink phpTodo Todo HiLink phpDocTodo 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 " put cpoptions back the way we found it let &cpo = s:cpo_save unlet s:cpo_save " vim: ts=8 sts=2 sw=2 expandtab vim-7.4.1689/runtime/syntax/phtml.vim000066400000000000000000000002271267703067000174500ustar00rootroot00000000000000" Vim syntax file " PHTML used to be the filetype for PHP 2.0. Now everything is PHP. if !exists("b:current_syntax") runtime! syntax/php.vim endif vim-7.4.1689/runtime/syntax/pic.vim000066400000000000000000000072021267703067000170770ustar00rootroot00000000000000" Vim syntax file " Language: PIC16F84 Assembler (Microchip's microcontroller) " Maintainer: Aleksandar Veselinovic " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/pike.vim000066400000000000000000000150571267703067000172630ustar00rootroot00000000000000" Vim syntax file " Language: Pike " Maintainer: Francesco Chemolli " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/pilrc.vim000066400000000000000000000126011267703067000174340ustar00rootroot00000000000000" Vim syntax file " Language: pilrc - a resource compiler for Palm OS development " Maintainer: Brian Schau " 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 "\" syn match pilrcKeyword "\\s*\" syn match pilrcType "\" " 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 else command -nargs=+ HiLink hi def link 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" vim-7.4.1689/runtime/syntax/pine.vim000066400000000000000000000370211267703067000172610ustar00rootroot00000000000000" Vim syntax file " Language: Pine (email program) run commands " Maintainer: David Pascoe " 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 else command -nargs=+ HiLink hi def link endif HiLink pineConfig Type HiLink pineComment Comment HiLink pineOption Macro delcommand HiLink endif let b:current_syntax = "pine" " vim: ts=8 vim-7.4.1689/runtime/syntax/pinfo.vim000066400000000000000000000122441267703067000174410ustar00rootroot00000000000000" Vim syntax file " Language: pinfo(1) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2007-06-17 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim setlocal iskeyword+=- syn case ignore syn keyword pinfoTodo contained FIXME TODO XXX NOTE syn region pinfoComment start='^#' end='$' contains=pinfoTodo,@Spell syn keyword pinfoOptions MANUAL CUT-MAN-HEADERS CUT-EMPTY-MAN-LINES \ RAW-FILENAME APROPOS \ DONT-HANDLE-WITHOUT-TAG-TABLE HTTPVIEWER \ FTPVIEWER MAILEDITOR PRINTUTILITY MANLINKS \ INFOPATH MAN-OPTIONS STDERR-REDIRECTION \ LONG-MANUAL-LINKS FILTER-0xB7 \ QUIT-CONFIRMATION QUIT-CONFIRM-DEFAULT \ CLEAR-SCREEN-AT-EXIT CALL-READLINE-HISTORY \ HIGHLIGHTREGEXP SAFE-USER SAFE-GROUP syn keyword pinfoColors COL_NORMAL COL_TOPLINE COL_BOTTOMLINE \ COL_MENU COL_MENUSELECTED COL_NOTE \ COL_NOTESELECTED COL_URL COL_URLSELECTED \ COL_INFOHIGHLIGHT COL_MANUALBOLD \ COL_MANUALITALIC COL_SEARCHHIGHLIGHT 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 syn keyword pinfoKeys KEY_TOTALSEARCH_1 KEY_TOTALSEARCH_2 \ KEY_SEARCH_1 KEY_SEARCH_2 \ KEY_SEARCH_AGAIN_1 KEY_SEARCH_AGAIN_2 \ KEY_GOTO_1 KEY_GOTO_2 KEY_PREVNODE_1 \ KEY_PREVNODE_2 KEY_NEXTNODE_1 \ KEY_NEXTNODE_2 KEY_UP_1 KEY_UP_2 KEY_END_1 \ KEY_END_2 KEY_PGDN_1 KEY_PGDN_2 \ KEY_PGDN_AUTO_1 KEY_PGDN_AUTO_2 KEY_HOME_1 \ KEY_HOME_2 KEY_PGUP_1 KEY_PGUP_2 \ KEY_PGUP_AUTO_1 KEY_PGUP_AUTO_2 KEY_DOWN_1 \ KEY_DOWN_2 KEY_TOP_1 KEY_TOP_2 KEY_BACK_1 \ KEY_BACK_2 KEY_FOLLOWLINK_1 \ KEY_FOLLOWLINK_2 KEY_REFRESH_1 \ KEY_REFRESH_2 KEY_SHELLFEED_1 \ KEY_SHELLFEED_2 KEY_QUIT_1 KEY_QUIT_2 \ KEY_GOLINE_1 KEY_GOLINE_2 KEY_PRINT_1 \ KEY_PRINT_2 KEY_DIRPAGE_1 KEY_DIRPAGE_2 \ KEY_TWODOWN_1 KEY_TWODOWN_2 KEY_TWOUP_1 \ KEY_TWOUP_2 syn keyword pinfoSpecialKeys KEY_BREAK KEY_DOWN KEY_UP KEY_LEFT KEY_RIGHT \ KEY_DOWN KEY_HOME KEY_BACKSPACE KEY_NPAGE \ KEY_PPAGE KEY_END KEY_IC KEY_DC syn region pinfoSpecialKeys matchgroup=pinfoSpecialKeys transparent \ start=+KEY_\%(F\|CTRL\|ALT\)(+ end=+)+ syn region pinfoSimpleKey start=+'+ skip=+\\'+ end=+'+ \ contains=pinfoSimpleKeyEscape syn match pinfoSimpleKeyEscape +\\[\\nt']+ syn match pinfoKeycode '\<\d\+\>' syn keyword pinfoConstants TRUE FALSE YES NO hi def link pinfoTodo Todo hi def link pinfoComment Comment hi def link pinfoOptions Keyword hi def link pinfoColors Keyword hi def link pinfoColorDefault Normal hi def link pinfoSpecialKeys SpecialChar hi def link pinfoSimpleKey String hi def link pinfoSimpleKeyEscape SpecialChar hi def link pinfoKeycode Number hi def link pinfoConstants Constant hi def link pinfoKeys Keyword hi def pinfoColorBold cterm=bold hi def pinfoColorNoBold cterm=none hi def pinfoColorBlink cterm=inverse hi def pinfoColorNoBlink cterm=none hi def pinfoColorBlack ctermfg=Black guifg=Black hi def pinfoColorRed ctermfg=DarkRed guifg=DarkRed hi def pinfoColorGreen ctermfg=DarkGreen guifg=DarkGreen hi def pinfoColorYellow ctermfg=DarkYellow guifg=DarkYellow hi def pinfoColorBlue ctermfg=DarkBlue guifg=DarkBlue hi def pinfoColorMagenta ctermfg=DarkMagenta guifg=DarkMagenta hi def pinfoColorCyan ctermfg=DarkCyan guifg=DarkCyan hi def pinfoColorWhite ctermfg=LightGray guifg=LightGray let b:current_syntax = "pinfo" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/plaintex.vim000066400000000000000000000240611267703067000201520ustar00rootroot00000000000000" Vim syntax file " Language: TeX (plain.tex format) " Maintainer: Nikolai Weibull " Latest Revision: 2006-10-26 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn match plaintexControlSequence display contains=@NoSpell \ '\\[a-zA-Z@]\+' runtime! syntax/initex.vim unlet b:current_syntax syn match plaintexComment display \ contains=ALLBUT,initexComment,plaintexComment \ '^\s*%[CDM].*$' if exists("g:plaintex_delimiters") syn match plaintexDelimiter display '[][{}]' endif syn match plaintexRepeat display contains=@NoSpell \ '\\\%(loop\|repeat\)\>' syn match plaintexCommand display contains=@NoSpell \ '\\\%(plainoutput\|TeX\)\>' syn match plaintexBoxCommand display contains=@NoSpell \ '\\\%(null\|strut\)\>' syn match plaintexDebuggingCommand display contains=@NoSpell \ '\\\%(showhyphens\|tracingall\|wlog\)\>' syn match plaintexFontsCommand display contains=@NoSpell \ '\\\%(bf\|\%(five\|seven\)\%(bf\|i\|rm\|sy\)\|it\|oldstyle\|rm\|sl\|ten\%(bf\|ex\|it\=\|rm\|sl\|sy\|tt\)\|tt\)\>' syn match plaintexGlueCommand display contains=@NoSpell \ '\\\%(\%(big\|en\|med\|\%(no\|off\)interline\|small\)skip\|\%(center\|left\|right\)\=line\|\%(dot\|\%(left\|right\)arrow\)fill\|[hv]glue\|[lr]lap\|q\=quad\|space\|topglue\)\>' syn match plaintexInsertsCommand display contains=@NoSpell \ '\\\%(\%(end\|top\)insert\|v\=footnote\)\>' syn match plaintexJobCommand display contains=@NoSpell \ '\\\%(bye\|fmt\%(name\|version\)\)\>' syn match plaintexInsertsCommand display contains=@NoSpell \ '\\\%(mid\|page\)insert\>' syn match plaintexKernCommand display contains=@NoSpell \ '\\\%(en\|\%(neg\)\=thin\)space\>' syn match plaintexMacroCommand display contains=@NoSpell \ '\\\%(active\|[be]group\|empty\)\>' syn match plaintexPageCommand display contains=@NoSpell \ '\\\%(\%(super\)\=eject\|nopagenumbers\|\%(normal\|ragged\)bottom\)\>' syn match plaintexParagraphCommand display contains=@NoSpell \ '\\\%(endgraf\|\%(non\)\=frenchspacing\|hang\|item\%(item\)\=\|narrower\|normalbaselines\|obey\%(lines\|spaces\)\|openup\|proclaim\|\%(tt\)\=raggedright\|textindent\)\>' syn match plaintexPenaltiesCommand display contains=@NoSpell \ '\\\%(allow\|big\|fil\|good\|med\|no\|small\)\=break\>' syn match plaintexRegistersCommand display contains=@NoSpell \ '\\\%(advancepageno\|new\%(box\|count\|dimen\|fam\|help\|if\|insert\|language\|muskip\|read\|skip\|toks\|write\)\)\>' syn match plaintexTablesCommand display contains=@NoSpell \ '&\|\\+\|\\\%(cleartabs\|endline\|hidewidth\|ialign\|multispan\|settabs\|tabalign\)\>' if !exists("g:plaintex_no_math") syn region plaintexMath matchgroup=plaintexMath \ contains=@plaintexMath,@NoSpell \ start='\$' skip='\\\\\|\\\$' end='\$' syn region plaintexMath matchgroup=plaintexMath \ contains=@plaintexMath,@NoSpell keepend \ start='\$\$' skip='\\\\\|\\\$' end='\$\$' endif " Keep this after plaintexMath, as we don’t want math mode started at a \$. syn match plaintexCharacterCommand display contains=@NoSpell \ /\\\%(["#$%&'.=^_`~]\|``\|''\|-\{2,3}\|[?!]`\|^^L\|\~\|\%(a[ae]\|A[AE]\|acute\|[cdHoOPStuvijlL]\|copyright\|d\=dag\|folio\|ldotp\|[lr]q\|oe\|OE\|slash\|ss\|underbar\)\>\)/ syn cluster plaintexMath \ contains=plaintexMathCommand,plaintexMathBoxCommand, \ plaintexMathCharacterCommand,plaintexMathDelimiter, \ plaintexMathFontsCommand,plaintexMathLetter,plaintexMathSymbol, \ plaintexMathFunction,plaintexMathOperator,plaintexMathPunctuation, \ plaintexMathRelation syn match plaintexMathCommand display contains=@NoSpell contained \ '\\\%([!*,;>{}|_^]\|\%([aA]rrowvert\|[bB]ig\%(g[lmr]\=\|r\)\=\|\%(border\|p\)\=matrix\|displaylines\|\%(down\|up\)bracefill\|eqalign\%(no\)\|leqalignno\|[lr]moustache\|mathpalette\|root\|s[bp]\|skew\|sqrt\)\>\)' syn match plaintexMathBoxCommand display contains=@NoSpell contained \ '\\\%([hv]\=phantom\|mathstrut\|smash\)\>' syn match plaintexMathCharacterCommand display contains=@NoSpell contained \ '\\\%(b\|bar\|breve\|check\|d\=dots\=\|grave\|hat\|[lv]dots\|tilde\|vec\|wide\%(hat\|tilde\)\)\>' syn match plaintexMathDelimiter display contains=@NoSpell contained \ '\\\%(brace\%(vert\)\=\|brack\|cases\|choose\|[lr]\%(angle\|brace\|brack\|ceil\|floor\|group\)\|over\%(brace\|\%(left\|right\)arrow\)\|underbrace\)\>' syn match plaintexMathFontsCommand display contains=@NoSpell contained \ '\\\%(\%(bf\|it\|sl\|tt\)fam\|cal\|mit\)\>' syn match plaintexMathLetter display contains=@NoSpell contained \ '\\\%(aleph\|alpha\|beta\|chi\|[dD]elta\|ell\|epsilon\|eta\|[gG]amma\|[ij]math\|iota\|kappa\|[lL]ambda\|[mn]u\|[oO]mega\|[pP][hs]\=i\|rho\|[sS]igma\|tau\|[tT]heta\|[uU]psilon\|var\%(epsilon\|ph\=i\|rho\|sigma\|theta\)\|[xX]i\|zeta\)\>' syn match plaintexMathSymbol display contains=@NoSpell contained \ '\\\%(angle\|backslash\|bot\|clubsuit\|emptyset\|epsilon\|exists\|flat\|forall\|hbar\|heartsuit\|Im\|infty\|int\|lnot\|nabla\|natural\|neg\|pmod\|prime\|Re\|sharp\|smallint\|spadesuit\|surd\|top\|triangle\%(left\|right\)\=\|vdash\|wp\)\>' syn match plaintexMathFunction display contains=@NoSpell contained \ '\\\%(arc\%(cos\|sin\|tan\)\|arg\|\%(cos\|sin\|tan\)h\=\|coth\=\|csc\|de[gt]\|dim\|exp\|gcd\|hom\|inf\|ker\|lo\=g\|lim\%(inf\|sup\)\=\|ln\|max\|min\|Pr\|sec\|sup\)\>' syn match plaintexMathOperator display contains=@NoSpell contained \ '\\\%(amalg\|ast\|big\%(c[au]p\|circ\|o\%(dot\|plus\|times\|sqcup\)\|triangle\%(down\|up\)\|uplus\|vee\|wedge\|bmod\|bullet\)\|c[au]p\|cdot[ps]\=\|circ\|coprod\|d\=dagger\|diamond\%(suit\)\=\|div\|land\|lor\|mp\|o\%(dot\|int\|minus\|plus\|slash\|times\)pm\|prod\|setminus\|sqc[au]p\|sqsu[bp]seteq\|star\|su[bp]set\%(eq\)\=\|sum\|times\|uplus\|vee\|wedge\|wr\)\>' syn match plaintexMathPunctuation display contains=@NoSpell contained \ '\\\%(colon\)\>' syn match plaintexMathRelation display contains=@NoSpell contained \ '\\\%(approx\|asymp\|bowtie\|buildrel\|cong\|dashv\|doteq\|[dD]ownarrow\|equiv\|frown\|geq\=\|gets\|gg\|hook\%(left\|right\)arrow\|iff\|in\|leq\=\|[lL]eftarrow\|\%(left\|right\)harpoon\%(down\|up\)\|[lL]eftrightarrow\|ll\|[lL]ongleftrightarrow\|longmapsto\|[lL]ongrightarrow\|mapsto\|mid\|models\|[ns][ew]arrow\|neq\=\|ni\|not\%(in\)\=\|owns\|parallel\|perp\|prec\%(eq\)\=\|propto\|[rR]ightarrow\|rightleftharpoons\|sim\%(eq\)\=\|smile\|succ\%(eq\)\=\|to\|[uU]parrow\|[uU]pdownarrow\|[vV]ert\)\>' syn match plaintexParameterDimen display contains=@NoSpell \ '\\maxdimen\>' syn match plaintexMathParameterDimen display contains=@NoSpell \ '\\jot\>' syn match plaintexParagraphParameterGlue display contains=@NoSpell \ '\\\%(\%(big\|med\|small\)skipamount\|normalbaselineskip\|normallineskip\%(limit\)\=\)\>' syn match plaintexFontParameterInteger display contains=@NoSpell \ '\\magstep\%(half\)\=\>' syn match plaintexJobParameterInteger display contains=@NoSpell \ '\\magnification\>' syn match plaintexPageParameterInteger display contains=@NoSpell \ '\\pageno\>' syn match plaintexPageParameterToken display contains=@NoSpell \ '\\\%(foot\|head\)line\>' hi def link plaintexOperator Operator hi def link plaintexDelimiter Delimiter hi def link plaintexControlSequence Identifier hi def link plaintexComment Comment hi def link plaintexInclude Include hi def link plaintexRepeat Repeat hi def link plaintexCommand initexCommand hi def link plaintexBoxCommand plaintexCommand hi def link plaintexCharacterCommand initexCharacterCommand hi def link plaintexDebuggingCommand initexDebuggingCommand hi def link plaintexFontsCommand initexFontsCommand hi def link plaintexGlueCommand plaintexCommand hi def link plaintexInsertsCommand plaintexCommand hi def link plaintexJobCommand initexJobCommand hi def link plaintexKernCommand plaintexCommand hi def link plaintexMacroCommand initexMacroCommand hi def link plaintexPageCommand plaintexCommand hi def link plaintexParagraphCommand plaintexCommand hi def link plaintexPenaltiesCommand plaintexCommand hi def link plaintexRegistersCommand plaintexCommand hi def link plaintexTablesCommand plaintexCommand hi def link plaintexMath String hi def link plaintexMathCommand plaintexCommand hi def link plaintexMathBoxCommand plaintexBoxCommand hi def link plaintexMathCharacterCommand plaintexCharacterCommand hi def link plaintexMathDelimiter plaintexDelimiter hi def link plaintexMathFontsCommand plaintexFontsCommand hi def link plaintexMathLetter plaintexMathCharacterCommand hi def link plaintexMathSymbol plaintexMathLetter hi def link plaintexMathFunction Function hi def link plaintexMathOperator plaintexOperator hi def link plaintexMathPunctuation plaintexCharacterCommand hi def link plaintexMathRelation plaintexOperator hi def link plaintexParameterDimen initexParameterDimen hi def link plaintexMathParameterDimen initexMathParameterDimen hi def link plaintexParagraphParameterGlue initexParagraphParameterGlue hi def link plaintexFontParameterInteger initexFontParameterInteger hi def link plaintexJobParameterInteger initexJobParameterInteger hi def link plaintexPageParameterInteger initexPageParameterInteger hi def link plaintexPageParameterToken initexParameterToken let b:current_syntax = "plaintex" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/pli.vim000066400000000000000000000323131267703067000171110ustar00rootroot00000000000000" Vim syntax file " Modified from http://plnet.org/files/vim/ " using keywords from http://www.kednos.com/pli/docs/reference_manual/6291pro_contents.html " 2012-11-13 Alan Thompson if version < 600 syntax clear elseif exists("b:current_syntax") finish endif syn case ignore " Todo. syn keyword pl1Todo TODO FIXME XXX DEBUG NOTE " pl1CommentGroup allows adding matches for special things in comments " 20010723az: Added this so that these could be matched in comments... syn cluster pl1CommentGroup contains=pl1Todo syn match pl1Garbage "[^ \t()]" syn match pl1Identifier "[a-z][a-z0-9$_#]*" syn match pl1HostIdentifier ":[a-z][a-z0-9$_#]*" " 20010723az: When wanted, highlight the trailing whitespace -- this is " based on c_space_errors if exists("c_space_errors") if !exists("c_no_trail_space_error") syn match pl1SpaceError "\s\+$" endif if !exists("c_no_tab_space_error") syn match pl1SpaceError " \+\t"me=e-1 endif endif " Symbols. syn match pl1Symbol "\(;\|,\|\.\)" syn match pl1PreProcSym "%" " Operators. syn match pl1Operator "\(&\|:\|!\|+\|-\|\*\|/\|=\|<\|>\|@\|\*\*\|!=\|\~=\)" syn match pl1Operator "\(\^\|\^=\|<=\|>=\|:=\|=>\|\.\.\|||\|<<\|>>\|\"\)" " Attributes syn keyword pl1Attribute BACKWARDS BUFFERED BUF CONNECTED CONN CONSTANT EVENT syn keyword pl1Attribute EXCLUSIVE EXCL FORMAT GENERIC IRREDUCIBLE IRRED LOCAL syn keyword pl1Attribute REDUCIBLE RED TASK TRANSIENT UNBUFFERED UNBUF ALIGNED ANY syn keyword pl1Attribute AREA AUTOMATIC AUTO BASED BUILTIN CONDITION COND CONTROLLED syn keyword pl1Attribute CTL DEFINED DEF DIRECT ENVIRONMENT ENV EXTERNAL EXT FILE syn keyword pl1Attribute GLOBALDEF GLOBALREF INITIAL INIT INPUT INTERNAL INT KEYED syn keyword pl1Attribute LABEL LIKE LIST MEMBER NONVARYING NONVAR OPTIONAL OPTIONS syn keyword pl1Attribute OUTPUT PARAMETER PARM PICTURE PIC POSITION POS PRECISION syn keyword pl1Attribute PREC PRINT READONLY RECORD REFER RETURNS SEQUENTIAL SEQL syn keyword pl1Attribute STATIC STREAM STRUCTURE TRUNCATE UNALIGNED UNAL UNION UPDATE syn keyword pl1Attribute VARIABLE VARYING VAR COMPLEX CPLX REAL BINARY BIN BIT syn keyword pl1Attribute CHARACTER CHAR DECIMAL DEC DESCRIPTOR DESC DIMENSION DIM syn keyword pl1Attribute FIXED FLOAT OFFSET POINTER PTR REFERENCE VALUE VAL " Functions syn keyword pl1Function AFTER ALL ANY BEFORE COMPLETION CPLN CONJG COUNT syn keyword pl1Function CURRENTSTORAGE CSTG DATAFIELD DECAT DOT ERF ERFC IMAG syn keyword pl1Function ONCOUNT ONFIELD ONLOC POLY PRIORITY REPEAT SAMEKEY STATUS syn keyword pl1Function STORAGE STG ABS ACOS ACTUALCOUNT ADD ADDR ADDREL ALLOCATION syn keyword pl1Function ALLOCN ASIN ATAN ATAND ATANH BOOL BYTE BYTESIZE CEIL COLLATE syn keyword pl1Function COPY COS COSD COSH DATE DATETIME DECODE DISPLAY DIVIDE EMPTY syn keyword pl1Function ENCODE ERROR EVERY EXP EXTEND FLOOR FLUSH FREE HBOUND HIGH syn keyword pl1Function INDEX INFORM INT LBOUND LENGTH LINE LINENO LOG LOG10 LOG2 syn keyword pl1Function LOW LTRIM MAX MAXLENGTH MIN MOD MULTIPLY NEXT_VOLUME NULL syn keyword pl1Function ONARGSLIST ONCHAR ONCODE ONFILE ONKEY ONSOURCE PAGENO POSINT syn keyword pl1Function PRESENT PROD RANK RELEASE RESIGNAL REVERSE REWIND ROUND syn keyword pl1Function RTRIM SEARCH SIGN SIN SIND SINH SIZE SOME SPACEBLOCK SQRT syn keyword pl1Function STRING SUBSTR SUBTRACT SUM TAN TAND TANH TIME TRANSLATE TRIM syn keyword pl1Function TRUNC UNSPEC VALID VARIANT VERIFY WARN " Other keywords syn keyword pl1Other ATTENTION ATTN C CONVERSION CONV DATA NAME NOCONVERSION syn keyword pl1Other NOCONV NOFIXEDOVERFLOW NOFOFL NOOVERFLOW NOSIZE syn keyword pl1Other NOSTRINGRANGE NOSTRG NOSTRINGSIZE NOSTRZ NOSUBSCRIPTRANGE syn keyword pl1Other NOSUBRG NOZERODIVIDE NOZDIV OVERFLOW OFL PENDING RECORD syn keyword pl1Other REENTRANT SIZE STRINGRANGE STRG STRINGSIZE STRZ syn keyword pl1Other SUBSCRIPTRANGE SUBRG TRANSMIT A ANYCONDITION APPEND B B1 B2 syn keyword pl1Other B3 B4 BACKUP_DATE BATCH BLOCK_BOUNDARY_FORMAT BLOCK_IO syn keyword pl1Other BLOCK_SIZE BUCKET_SIZE BY CANCEL_CONTROL_O syn keyword pl1Other CARRIAGE_RETURN_FORMAT COLUMN COL CONTIGUOUS syn keyword pl1Other CONTIGUOUS_BEST_TRY CONVERSION CONV CREATION_DATE syn keyword pl1Other CURRENT_POSITION DEFAULT_FILE_NAME DEFERRED_WRITE E EDIT syn keyword pl1Other ENDFILE ENDPAGE EXPIRATION_DATE EXTENSION_SIZE F FAST_DELETE syn keyword pl1Other FILE_ID FILE_ID_TO FILE_SIZE FINISH FIXEDOVERFLOW FOFL syn keyword pl1Other FIXED_CONTROL_FROM FIXED_CONTROL_SIZE FIXED_CONTROL_SIZE_TO syn keyword pl1Other FIXED_CONTROL_TO FIXED_LENGTH_RECORDS FROM GROUP_PROTECTION syn keyword pl1Other IDENT IGNORE_LINE_MARKS IN INDEXED INDEX_NUMBER INITIAL_FILL syn keyword pl1Other INTO KEY KEYFROM KEYTO LINESIZE LOCK_ON_READ LOCK_ON_WRITE syn keyword pl1Other MAIN MANUAL_UNLOCKING MATCH_GREATER MATCH_GREATER_EQUAL syn keyword pl1Other MATCH_NEXT MATCH_NEXT_EQUAL MAXIMUM_RECORD_NUMBER syn keyword pl1Other MAXIMUM_RECORD_SIZE MULTIBLOCK_COUNT MULTIBUFFER_COUNT syn keyword pl1Other NOLOCK NONEXISTENT_RECORD NONRECURSIVE NO_ECHO NO_FILTER syn keyword pl1Other NO_SHARE OVERFLOW OFL OWNER_GROUP OWNER_ID OWNER_MEMBER syn keyword pl1Other OWNER_PROTECTION P PAGE PAGESIZE PRINTER_FORMAT PROMPT syn keyword pl1Other PURGE_TYPE_AHEAD R READ_AHEAD READ_CHECK READ_REGARDLESS syn keyword pl1Other RECORD_ID RECORD_ID_ACCESS RECORD_ID_TO RECURSIVE REPEAT syn keyword pl1Other RETRIEVAL_POINTERS REVISION_DATE REWIND_ON_CLOSE syn keyword pl1Other REWIND_ON_OPEN SCALARVARYING SET SHARED_READ SHARED_WRITE syn keyword pl1Other SKIP SPOOL STORAGE STRINGRANGE STRG SUBSCRIPTRANGE SUBRG syn keyword pl1Other SUPERSEDE SYSIN SYSPRINT SYSTEM_PROTECTION TAB TEMPORARY syn keyword pl1Other TIMEOUT_PERIOD TITLE TO UNDEFINEDFILE UNDF UNDERFLOW UFL syn keyword pl1Other UNTIL USER_OPEN VAXCONDITION WAIT_FOR_RECORD WHILE syn keyword pl1Other WORLD_PROTECTION WRITE_BEHIND WRITE_CHECK X ZERODIVIDE ZDIV " PreProcessor keywords syn keyword pl1PreProc ACTIVATE DEACTIVATE DECLARE DCL DICTIONARY DO END ERROR syn keyword pl1PreProc FATAL GOTO IF INCLUDE INFORM LIST NOLIST PAGE PROCEDURE PROC syn keyword pl1PreProc REPLACE RETURN SBTTL TITLE WARN THEN ELSE " Statements syn keyword pl1Statement CALL SUB ENTRY BY NAME CASE CHECK COPY DEFAULT DFT DELAY syn keyword pl1Statement DESCRIPTORS DISPLAY EXIT FETCH HALT IGNORE LIST LOCATE syn keyword pl1Statement NOCHECK NOLOCK NONE ORDER RANGE RELEASE REORDER REPLY SNAP syn keyword pl1Statement SYSTEM TAB UNLOCK WAIT ALLOCATE ALLOC BEGIN CALL CLOSE syn keyword pl1Statement DECLARE DCL DELETE DO ELSE END FORMAT GET GOTO GO TO IF syn keyword pl1Statement LEAVE NORESCAN ON OPEN OTHERWISE OTHER PROCEDURE PROC PUT syn keyword pl1Statement READ RESCAN RETURN REVERT REWRITE SELECT SIGNAL SNAP syn keyword pl1Statement STATEMENT STOP SYSTEM THEN WHEN WRITE " PL1's own keywords " syn match pl1Keyword "\" " syn match pl1Keyword "\.COUNT\>"hs=s+1 " syn match pl1Keyword "\.EXISTS\>"hs=s+1 " syn match pl1Keyword "\.FIRST\>"hs=s+1 " syn match pl1Keyword "\.LAST\>"hs=s+1 " syn match pl1Keyword "\.DELETE\>"hs=s+1 " syn match pl1Keyword "\.PREV\>"hs=s+1 " syn match pl1Keyword "\.NEXT\>"hs=s+1 if exists("pl1_highlight_triggers") syn keyword pl1Trigger INSERTING UPDATING DELETING endif " Conditionals. syn keyword pl1Conditional ELSIF ELSE IF syn match pl1Conditional "\" " Loops. syn keyword pl1Repeat FOR LOOP WHILE FORALL syn match pl1Repeat "\" " Various types of comments. " 20010723az: Added the ability to treat strings within comments just like " C does. if exists("c_comment_strings") syntax match pl1CommentSkip contained "^\s*\*\($\|\s\+\)" syntax region pl1CommentString contained start=+L\="+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=pl1CommentSkip syntax region pl1Comment2String contained start=+L\="+ skip=+\\\\\|\\"+ end=+"+ end="$" syntax region pl1CommentL start="--" skip="\\$" end="$" keepend contains=@pl1CommentGroup,pl1Comment2String,pl1CharLiteral,pl1BooleanLiteral,pl1NumbersCom,pl1SpaceError syntax region pl1Comment start="/\*" end="\*/" contains=@pl1CommentGroup,pl1Comment2String,pl1CharLiteral,pl1BooleanLiteral,pl1NumbersCom,pl1SpaceError else syntax region pl1CommentL start="--" skip="\\$" end="$" keepend contains=@pl1CommentGroup,pl1SpaceError syntax region pl1Comment start="/\*" end="\*/" contains=@pl1CommentGroup,pl1SpaceError endif " 20010723az: These are the old comment commands ... commented out. " syn match pl1Comment "--.*$" contains=pl1Todo " syn region pl1Comment start="/\*" end="\*/" contains=pl1Todo syn sync ccomment pl1Comment syn sync ccomment pl1CommentL " To catch unterminated string literals. syn match pl1StringError "'.*$" " Various types of literals. " 20010723az: Added stuff for comment matching. syn match pl1Numbers transparent "\<[+-]\=\d\|[+-]\=\.\d" contains=pl1IntLiteral,pl1FloatLiteral syn match pl1NumbersCom contained transparent "\<[+-]\=\d\|[+-]\=\.\d" contains=pl1IntLiteral,pl1FloatLiteral syn match pl1IntLiteral contained "[+-]\=\d\+" syn match pl1FloatLiteral contained "[+-]\=\d\+\.\d*" syn match pl1FloatLiteral contained "[+-]\=\d*\.\d*" "syn match pl1FloatLiteral "[+-]\=\([0-9]*\.[0-9]\+\|[0-9]\+\.[0-9]\+\)\(e[+-]\=[0-9]\+\)\=" syn match pl1CharLiteral "'[^']'" syn match pl1StringLiteral "'\([^']\|''\)*'" syn keyword pl1BooleanLiteral TRUE FALSE NULL " The built-in types. syn keyword pl1Storage ANYDATA ANYTYPE BFILE BINARY_INTEGER BLOB BOOLEAN syn keyword pl1Storage BYTE CHAR CHARACTER CLOB CURSOR DATE DAY DEC DECIMAL syn keyword pl1Storage DOUBLE DSINTERVAL_UNCONSTRAINED FLOAT HOUR syn keyword pl1Storage INT INTEGER INTERVAL LOB LONG MINUTE syn keyword pl1Storage MLSLABEL MONTH NATURAL NATURALN NCHAR NCHAR_CS NCLOB syn keyword pl1Storage NUMBER NUMERIC NVARCHAR PLS_INT PLS_INTEGER syn keyword pl1Storage POSITIVE POSITIVEN PRECISION RAW REAL RECORD syn keyword pl1Storage SECOND SIGNTYPE SMALLINT STRING SYS_REFCURSOR TABLE TIME syn keyword pl1Storage TIMESTAMP TIMESTAMP_UNCONSTRAINED syn keyword pl1Storage TIMESTAMP_TZ_UNCONSTRAINED syn keyword pl1Storage TIMESTAMP_LTZ_UNCONSTRAINED UROWID VARCHAR syn keyword pl1Storage VARCHAR2 YEAR YMINTERVAL_UNCONSTRAINED ZONE " A type-attribute is really a type. " 20020916bp: Removed leading part of pattern to avoid highlighting the " object syn match pl1TypeAttribute "%\(TYPE\|ROWTYPE\)\>" " All other attributes. syn match pl1Attribute "%\(BULK_EXCEPTIONS\|BULK_ROWCOUNT\|ISOPEN\|FOUND\|NOTFOUND\|ROWCOUNT\)\>" " Catch errors caused by wrong parentheses and brackets " 20010723az: significantly more powerful than the values -- commented out " below the replaced values. This adds the C functionality to PL/SQL. syn cluster pl1ParenGroup contains=pl1ParenError,@pl1CommentGroup,pl1CommentSkip,pl1IntLiteral,pl1FloatLiteral,pl1NumbersCom if exists("c_no_bracket_error") syn region pl1Paren transparent start='(' end=')' contains=ALLBUT,@pl1ParenGroup syn match pl1ParenError ")" syn match pl1ErrInParen contained "[{}]" else syn region pl1Paren transparent start='(' end=')' contains=ALLBUT,@pl1ParenGroup,pl1ErrInBracket syn match pl1ParenError "[\])]" syn match pl1ErrInParen contained "[{}]" syn region pl1Bracket transparent start='\[' end=']' contains=ALLBUT,@pl1ParenGroup,pl1ErrInParen syn match pl1ErrInBracket contained "[);{}]" endif " syn region pl1Paren transparent start='(' end=')' contains=ALLBUT,pl1ParenError " syn match pl1ParenError ")" " 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_pl1_syn_inits") if version < 508 let did_pl1_syn_inits = 1 command -nargs=+ HiLink hi link else command -nargs=+ HiLink hi def link endif HiLink pl1Attribute Macro HiLink pl1BlockError Error HiLink pl1BooleanLiteral Boolean HiLink pl1CharLiteral Character HiLink pl1Comment Comment HiLink pl1CommentL Comment HiLink pl1Conditional Conditional HiLink pl1Error Error HiLink pl1ErrInBracket Error HiLink pl1ErrInBlock Error HiLink pl1ErrInParen Error HiLink pl1Exception Function HiLink pl1FloatLiteral Float HiLink pl1Function Function HiLink pl1Garbage Error HiLink pl1HostIdentifier Label HiLink pl1Identifier Normal HiLink pl1IntLiteral Number HiLink pl1Operator Operator HiLink pl1Paren Normal HiLink pl1ParenError Error HiLink pl1SpaceError Error HiLink pl1Pseudo PreProc HiLink pl1PreProc PreProc HiLink pl1PreProcSym PreProc HiLink pl1Keyword Keyword HiLink pl1Other Keyword HiLink pl1Repeat Repeat HiLink pl1Statement Keyword HiLink pl1Storage StorageClass HiLink pl1StringError Error HiLink pl1StringLiteral String HiLink pl1CommentString String HiLink pl1Comment2String String HiLink pl1Symbol Normal HiLink pl1Trigger Function HiLink pl1TypeAttribute StorageClass HiLink pl1Todo Todo delcommand HiLink endif let b:current_syntax = "pl1" vim-7.4.1689/runtime/syntax/plm.vim000066400000000000000000000131071267703067000171150ustar00rootroot00000000000000" Vim syntax file " Language: PL/M " Maintainer: Philippe Coulonges " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/plp.vim000066400000000000000000000026721267703067000171250ustar00rootroot00000000000000" Vim syntax file " Language: PLP (Perl in HTML) " Maintainer: Juerd " 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 :p:h/html.vim syn include @PLPperl :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" vim-7.4.1689/runtime/syntax/plsql.vim000066400000000000000000000316561267703067000174710ustar00rootroot00000000000000" 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 "\" 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 "\" " 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 "\" " Loops. syn keyword plsqlRepeat FOR LOOP WHILE FORALL syn match plsqlRepeat "\" " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/po.vim000066400000000000000000000150421267703067000167430ustar00rootroot00000000000000" Vim syntax file " Language: po (gettext) " Maintainer: Dwayne Bailey " Last Change: 2015 Jun 07 " Contributors: Dwayne Bailey (Most advanced syntax highlighting) " Leonardo Fontenelle (Spell checking) " Nam SungHyun (Original 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 let s:keepcpo= &cpo set cpo&vim syn sync minlines=10 " Identifiers syn match poStatementMsgCTxt "^msgctxt" syn match poStatementMsgidplural "^msgid_plural" contained syn match poPluralCaseN "[0-9]" contained syn match poStatementMsgstr "^msgstr\(\[[0-9]\]\)" contains=poPluralCaseN " Simple HTML and XML highlighting syn match poHtml "<\_[^<>]\+>" contains=poHtmlTranslatables,poLineBreak syn match poHtmlNot +"<[^<]\+>"+ms=s+1,me=e-1 syn region poHtmlTranslatables start=+\(abbr\|alt\|content\|summary\|standby\|title\)=\\"+ms=e-1 end=+\\"+ contained contains=@Spell syn match poLineBreak +"\n"+ contained " Translation blocks syn region poMsgCTxt matchgroup=poStatementMsgCTxt start=+^msgctxt "+rs=e-1 matchgroup=poStringCTxt end=+^msgid "+me=s-1 contains=poStringCTxt syn region poMsgID matchgroup=poStatementMsgid start=+^msgid "+rs=e-1 matchgroup=poStringID end=+^msgstr\(\|\[[\]0\[]\]\) "+me=s-1 contains=poStringID,poStatementMsgidplural,poStatementMsgid syn region poMsgSTR matchgroup=poStatementMsgstr start=+^msgstr\(\|\[[\]0\[]\]\) "+rs=e-1 matchgroup=poStringSTR end=+\n\n+me=s-1 contains=poStringSTR,poStatementMsgstr syn region poStringCTxt start=+"+ skip=+\\\\\|\\"+ end=+"+ syn region poStringID start=+"+ skip=+\\\\\|\\"+ end=+"+ contained \ contains=poSpecial,poFormat,poCommentKDE,poPluralKDE,poKDEdesktopFile,poHtml,poAcceleratorId,poHtmlNot,poVariable syn region poStringSTR start=+"+ skip=+\\\\\|\\"+ end=+"+ contained \ contains=@Spell,poSpecial,poFormat,poHeaderItem,poCommentKDEError,poHeaderUndefined,poPluralKDEError,poMsguniqError,poKDEdesktopFile,poHtml,poAcceleratorStr,poHtmlNot,poVariable " Header and Copyright syn match poHeaderItem "\(Project-Id-Version\|Report-Msgid-Bugs-To\|POT-Creation-Date\|PO-Revision-Date\|Last-Translator\|Language-Team\|Language\|MIME-Version\|Content-Type\|Content-Transfer-Encoding\|Plural-Forms\|X-Generator\): " contained syn match poHeaderUndefined "\(PACKAGE VERSION\|YEAR-MO-DA HO:MI+ZONE\|FULL NAME \|LANGUAGE \|CHARSET\|ENCODING\|INTEGER\|EXPRESSION\)" contained syn match poCopyrightUnset "SOME DESCRIPTIVE TITLE\|FIRST AUTHOR , YEAR\|Copyright (C) YEAR Free Software Foundation, Inc\|YEAR THE PACKAGE\'S COPYRIGHT HOLDER\|PACKAGE" contained " Translation comment block including: translator comment, automatic coments, flags and locations syn match poComment "^#.*$" syn keyword poFlagFuzzy fuzzy contained syn match poCommentTranslator "^# .*$" contains=poCopyrightUnset syn match poCommentAutomatic "^#\..*$" syn match poCommentSources "^#:.*$" syn match poCommentFlags "^#,.*$" contains=poFlagFuzzy syn match poDiffOld '\(^#| "[^{]*+}\|{+[^}]*+}\|{+[^}]*\|"$\)' contained syn match poDiffNew '\(^#| "[^{]*-}\|{-[^}]*-}\|{-[^}]*\|"$\)' contained syn match poCommentDiff "^#|.*$" contains=poDiffOld,poDiffNew " Translations (also includes header fields as they appear in a translation msgstr) syn region poCommentKDE start=+"_: +ms=s+1 end="\\n" end="\"\n^msgstr"me=s-1 contained syn region poCommentKDEError start=+"\(\|\s\+\)_:+ms=s+1 end="\\n" end=+"\n\n+me=s-1 contained syn match poPluralKDE +"_n: +ms=s+1 contained syn region poPluralKDEError start=+"\(\|\s\+\)_n:+ms=s+1 end="\"\n\n"me=s-1 contained 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 " msguniq and msgcat conflicts syn region poMsguniqError matchgroup=poMsguniqErrorMarkers start="#-#-#-#-#" end='#\("\n"\|\)-\("\n"\|\)#\("\n"\|\)-\("\n"\|\)#\("\n"\|\)-\("\n"\|\)#\("\n"\|\)-\("\n"\|\)#\("\n"\|\)\\n' contained " Obsolete messages syn match poObsolete "^#\~.*$" " KDE Name= handling syn match poKDEdesktopFile "\"\(Name\|Comment\|GenericName\|Description\|Keywords\|About\)="ms=s+1,me=e-1 " Accelerator keys - this messes up if the preceding or following char is a multibyte unicode char syn match poAcceleratorId contained "[^&_~][&_~]\(\a\|\d\)[^:]"ms=s+1,me=e-1 syn match poAcceleratorStr contained "[^&_~][&_~]\(\a\|\d\)[^:]"ms=s+1,me=e-1 contains=@Spell " Variables simple syn match poVariable contained "%\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_po_syn_inits") if version < 508 let did_po_syn_inits = 1 command -nargs=+ HiLink hi link else command -nargs=+ HiLink hi def link endif HiLink poCommentSources PreProc HiLink poComment Comment HiLink poCommentAutomatic Comment HiLink poCommentTranslator Comment HiLink poCommentFlags Special HiLink poCommentDiff Comment HiLink poCopyrightUnset Todo HiLink poFlagFuzzy Todo HiLink poDiffOld Todo HiLink poDiffNew Special HiLink poObsolete Comment HiLink poStatementMsgid Statement HiLink poStatementMsgstr Statement HiLink poStatementMsgidplural Statement HiLink poStatementMsgCTxt Statement HiLink poPluralCaseN Constant HiLink poStringCTxt Comment HiLink poStringID String HiLink poStringSTR String HiLink poCommentKDE Comment HiLink poCommentKDEError Error HiLink poPluralKDE Comment HiLink poPluralKDEError Error HiLink poHeaderItem Identifier HiLink poHeaderUndefined Todo HiLink poKDEdesktopFile Identifier HiLink poHtml Identifier HiLink poHtmlNot String HiLink poHtmlTranslatables String HiLink poLineBreak String HiLink poFormat poSpecial HiLink poSpecial Special HiLink poAcceleratorId Special HiLink poAcceleratorStr Special HiLink poVariable Special HiLink poMsguniqError Special HiLink poMsguniqErrorMarkers Comment delcommand HiLink endif let b:current_syntax = "po" let &cpo = s:keepcpo unlet s:keepcpo " vim:set ts=8 sts=2 sw=2 noet: vim-7.4.1689/runtime/syntax/pod.vim000066400000000000000000000167721267703067000171220ustar00rootroot00000000000000" Vim syntax file " Language: Perl POD format " Maintainer: vim-perl " Previously: Scott Bigham " Homepage: http://github.com/vim-perl/vim-perl " Bugs/requests: http://github.com/vim-perl/vim-perl/issues " Last Change: 2013-07-21 " To add embedded POD documentation highlighting to your syntax file, add " the commands: " " syn include @Pod :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 let s:cpo_save = &cpo set cpo&vim " POD commands syn match podCommand "^=encoding" nextgroup=podCmdText contains=@NoSpell syn match podCommand "^=head[1234]" nextgroup=podCmdText contains=@NoSpell syn match podCommand "^=item" nextgroup=podCmdText contains=@NoSpell syn match podCommand "^=over" nextgroup=podOverIndent skipwhite contains=@NoSpell syn match podCommand "^=back" contains=@NoSpell syn match podCommand "^=cut" contains=@NoSpell syn match podCommand "^=pod" contains=@NoSpell syn match podCommand "^=for" nextgroup=podForKeywd skipwhite contains=@NoSpell syn match podCommand "^=begin" nextgroup=podForKeywd skipwhite contains=@NoSpell syn match podCommand "^=end" nextgroup=podForKeywd skipwhite contains=@NoSpell " Text of a =head1, =head2 or =item command syn match podCmdText ".*$" contained contains=podFormat,@NoSpell " Indent amount of =over command syn match podOverIndent "\d\+" contained contains=@NoSpell " Formatter identifier keyword for =for, =begin and =end commands syn match podForKeywd "\S\+" contained contains=@NoSpell " An indented line, to be displayed verbatim syn match podVerbatimLine "^\s.*$" contains=@NoSpell " Inline textual items handled specially by POD syn match podSpecial "\(\<\|&\)\I\i*\(::\I\i*\)*([^)]*)" contains=@NoSpell syn match podSpecial "[$@%]\I\i*\(::\I\i*\)*\>" contains=@NoSpell " Special formatting sequences syn region podFormat start="[IBSCLFX]<[^<]"me=e-1 end=">" oneline contains=podFormat,@NoSpell syn region podFormat start="[IBSCLFX]<<\s" end="\s>>" oneline contains=podFormat,@NoSpell syn match podFormat "Z<>" syn match podFormat "E<\(\d\+\|\I\i*\)>" contains=podEscape,podEscape2,@NoSpell syn match podEscape "\I\i*>"me=e-1 contained contains=@NoSpell syn match podEscape2 "\d\+>"me=e-1 contained contains=@NoSpell " Define the default highlighting. " For version 5.7 and earlier: only 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 else command -nargs=+ HiLink hi def link endif HiLink podCommand Statement HiLink podCmdText String HiLink podOverIndent Number HiLink podForKeywd Identifier HiLink podFormat Identifier HiLink podVerbatimLine PreProc HiLink podSpecial Identifier HiLink podEscape String HiLink podEscape2 Number delcommand HiLink endif if exists("perl_pod_spellcheck_headings") " Spell-check headings syn clear podCmdText syn match podCmdText ".*$" contained contains=podFormat endif if exists("perl_pod_formatting") " By default, escapes like C<> are not checked for spelling. Remove B<> " and I<> from the list of escapes. syn clear podFormat syn region podFormat start="[CLF]<[^<]"me=e-1 end=">" oneline contains=podFormat,@NoSpell syn region podFormat start="[CLF]<<\s" end="\s>>" oneline contains=podFormat,@NoSpell " Don't spell-check inside E<>, but ensure that the E< itself isn't " marked as a spelling mistake. syn match podFormat "E<\(\d\+\|\I\i*\)>" contains=podEscape,podEscape2,@NoSpell " Z<> is a mock formatting code. Ensure Z<> on its own isn't marked as a " spelling mistake. syn match podFormat "Z<>" contains=podEscape,podEscape2,@NoSpell " These are required so that whatever is *within* B<...>, I<...>, etc. is " spell-checked, but not the B, I, ... itself. syn match podBoldOpen "B<" contains=@NoSpell syn match podItalicOpen "I<" contains=@NoSpell syn match podNoSpaceOpen "S<" contains=@NoSpell syn match podIndexOpen "X<" contains=@NoSpell " Same as above but for the << >> syntax. syn match podBoldAlternativeDelimOpen "B<< " contains=@NoSpell syn match podItalicAlternativeDelimOpen "I<< " contains=@NoSpell syn match podNoSpaceAlternativeDelimOpen "S<< " contains=@NoSpell syn match podIndexAlternativeDelimOpen "X<< " contains=@NoSpell " Add support for spell checking text inside B<>, I<>, S<> and X<>. syn region podBold start="B<[^<]"me=e end=">" oneline contains=podBoldItalic,podBoldOpen syn region podBoldAlternativeDelim start="B<<\s" end="\s>>" oneline contains=podBoldAlternativeDelimOpen syn region podItalic start="I<[^<]"me=e end=">" oneline contains=podItalicBold,podItalicOpen syn region podItalicAlternativeDelim start="I<<\s" end="\s>>" oneline contains=podItalicAlternativeDelimOpen " Nested bold/italic and vice-versa syn region podBoldItalic contained start="I<[^<]"me=e end=">" oneline syn region podItalicBold contained start="B<[^<]"me=e end=">" oneline syn region podNoSpace start="S<[^<]"ms=s-2 end=">"me=e oneline contains=podNoSpaceOpen syn region podNoSpaceAlternativeDelim start="S<<\s"ms=s-2 end="\s>>"me=e oneline contains=podNoSpaceAlternativeDelimOpen syn region podIndex start="X<[^<]"ms=s-2 end=">"me=e oneline contains=podIndexOpen syn region podIndexAlternativeDelim start="X<<\s"ms=s-2 end="\s>>"me=e oneline contains=podIndexAlternativeDelimOpen " Restore this (otherwise B<> is shown as bold inside verbatim) syn match podVerbatimLine "^\s.*$" contains=@NoSpell " Ensure formatted text can be displayed in headings and items syn clear podCmdText if exists("perl_pod_spellcheck_headings") syn match podCmdText ".*$" contained contains=podFormat,podBold, \podBoldAlternativeDelim,podItalic,podItalicAlternativeDelim, \podBoldOpen,podItalicOpen,podBoldAlternativeDelimOpen, \podItalicAlternativeDelimOpen,podNoSpaceOpen else syn match podCmdText ".*$" contained contains=podFormat,podBold, \podBoldAlternativeDelim,podItalic,podItalicAlternativeDelim, \@NoSpell endif " Specify how to display these hi def podBold term=bold cterm=bold gui=bold hi link podBoldAlternativeDelim podBold hi link podBoldAlternativeDelimOpen podBold hi link podBoldOpen podBold hi link podNoSpace Identifier hi link podNoSpaceAlternativeDelim Identifier hi link podIndex Identifier hi link podIndexAlternativeDelim Identifier hi def podItalic term=italic cterm=italic gui=italic hi link podItalicAlternativeDelim podItalic hi link podItalicAlternativeDelimOpen podItalic hi link podItalicOpen podItalic hi def podBoldItalic term=italic,bold cterm=italic,bold gui=italic,bold hi def podItalicBold term=italic,bold cterm=italic,bold gui=italic,bold endif let b:current_syntax = "pod" let &cpo = s:cpo_save unlet s:cpo_save " vim: ts=8 vim-7.4.1689/runtime/syntax/postscr.vim000066400000000000000000001327151267703067000200310ustar00rootroot00000000000000" Vim syntax file " Language: PostScript - all Levels, selectable " Maintainer: Mike Williams " Filenames: *.ps,*.eps " Last Change: 31st October 2007 " 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,@Spell " 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,@Spell " DSC continuation line (no check that previous line is DSC comment) syn match postscrDSCComment "^%%+ *.*$" contains=@postscrString,@postscrNumber,@Spell " 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,@Spell syn match postscrASCIIStringError ")" " 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 postscrL2Operator "\(<<\|>>\)" syn keyword postscrL2Operator undef syn keyword postscrConstant globaldict shareddict " Device operators syn keyword postscrL2Operator setpagedevice currentpagedevice " Path operators syn keyword postscrL2Operator rectclip setbbox uappend ucache upath ustrokepath arct " Painting operators syn keyword postscrL2Operator rectfill rectstroke ufill ueofill ustroke " Array operators syn keyword postscrL2Operator currentpacking setpacking packedarray " Misc operators syn keyword postscrL2Operator languagelevel " Insideness operators syn keyword postscrL2Operator infill ineofill instroke inufill inueofill inustroke " GState operators syn keyword postscrL2Operator gstate setgstate currentgstate setcolor syn keyword postscrL2Operator setcolorspace currentcolorspace setstrokeadjust currentstrokeadjust syn keyword postscrL2Operator currentcolor " Device gstate operators syn keyword postscrL2Operator sethalftone currenthalftone setoverprint currentoverprint syn keyword postscrL2Operator setcolorrendering currentcolorrendering " Character operators syn keyword postscrL2Constant GlobalFontDirectory SharedFontDirectory syn keyword postscrL2Operator glyphshow selectfont syn keyword postscrL2Operator addglyph undefinefont xshow xyshow yshow " Pattern operators syn keyword postscrL2Operator makepattern setpattern execform " Resource operators syn keyword postscrL2Operator defineresource undefineresource findresource resourcestatus syn keyword postscrL2Repeat resourceforall " File operators syn keyword postscrL2Operator filter printobject writeobject setobjectformat currentobjectformat " VM operators syn keyword postscrL2Operator currentshared setshared defineuserobject execuserobject undefineuserobject syn keyword postscrL2Operator gcheck scheck startjob currentglobal setglobal syn keyword postscrConstant UserObjects " Interpreter operators syn keyword postscrL2Operator setucacheparams setvmthreshold ucachestatus setsystemparams syn keyword postscrL2Operator setuserparams currentuserparams setcacheparams currentcacheparams syn keyword postscrL2Operator 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 postscrL2Operator letter lettersmall legal ledger 11x17 a4 a3 a4small b5 note " Paper Tray operators syn keyword postscrL2Operator lettertray legaltray ledgertray a3tray a4tray b5tray 11x17tray " SCC compatibility operators syn keyword postscrL2Operator sccbatch sccinteractive setsccbatch setsccinteractive " Page duplexing operators syn keyword postscrL2Operator duplexmode firstside newsheet setduplexmode settumble tumble " Device compatability operators syn keyword postscrL2Operator devdismount devformat devmount devstatus syn keyword postscrL2Repeat devforall " Imagesetter compatability operators syn keyword postscrL2Operator accuratescreens checkscreen pagemargin pageparams setaccuratescreens setpage syn keyword postscrL2Operator setpagemargin setpageparams " Misc compatability operators syn keyword postscrL2Operator appletalktype buildtime byteorder checkpassword defaulttimeouts diskonline syn keyword postscrL2Operator diskstatus manualfeed manualfeedtimeout margins mirrorprint pagecount syn keyword postscrL2Operator pagestackorder printername processcolors sethardwareiomode setjobtimeout syn keyword postscrL2Operator setpagestockorder setprintername setresolution doprinterrors dostartpage syn keyword postscrL2Operator hardwareiomode initializedisk jobname jobtimeout ramsize realformat resolution syn keyword postscrL2Operator setdefaulttimeouts setdoprinterrors setdostartpage setdosysstart syn keyword postscrL2Operator setuserdiskpercent softwareiomode userdiskpercent waittimeout syn keyword postscrL2Operator setsoftwareiomode dosysstart emulate setmargins setmirrorprint endif " PS2 highlighting if postscr_level == 3 " Shading operators syn keyword postscrL3Operator setsmoothness currentsmoothness shfill " Clip operators syn keyword postscrL3Operator clipsave cliprestore " Pagedevive operators syn keyword postscrL3Operator setpage setpageparams " Device gstate operators syn keyword postscrL3Operator findcolorrendering " Font operators syn keyword postscrL3Operator 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 postscrGSOperator .setaccuratecurves .currentaccuratecurves .setclipoutside syn keyword postscrGSOperator .setdashadapt .currentdashadapt .setdefaultmatrix .setdotlength syn keyword postscrGSOperator .currentdotlength .setfilladjust2 .currentfilladjust2 syn keyword postscrGSOperator .currentclipoutside .setcurvejoin .currentcurvejoin syn keyword postscrGSOperator .setblendmode .currentblendmode .setopacityalpha .currentopacityalpha .setshapealpha .currentshapealpha syn keyword postscrGSOperator .setlimitclamp .currentlimitclamp .setoverprintmode .currentoverprintmode " GS path operators syn keyword postscrGSOperator .dashpath .rectappend " GS painting operators syn keyword postscrGSOperator .setrasterop .currentrasterop .setsourcetransparent syn keyword postscrGSOperator .settexturetransparent .currenttexturetransparent syn keyword postscrGSOperator .currentsourcetransparent " GS character operators syn keyword postscrGSOperator .charboxpath .type1execchar %Type1BuildChar %Type1BuildGlyph " GS mathematical operators syn keyword postscrGSMathOperator arccos arcsin " GS dictionary operators syn keyword postscrGSOperator .dicttomark .forceput .forceundef .knownget .setmaxlength " GS byte and string operators syn keyword postscrGSOperator .type1encrypt .type1decrypt syn keyword postscrGSOperator .bytestring .namestring .stringmatch " GS relational operators (seem like math ones to me!) syn keyword postscrGSMathOperator max min " GS file operators syn keyword postscrGSOperator findlibfile unread writeppmfile syn keyword postscrGSOperator .filename .fileposition .peekstring .unread " GS vm operators syn keyword postscrGSOperator .forgetsave " GS device operators syn keyword postscrGSOperator copydevice .getdevice makeimagedevice makewordimagedevice copyscanlines syn keyword postscrGSOperator setdevice currentdevice getdeviceprops putdeviceprops flushpage syn keyword postscrGSOperator finddevice findprotodevice .getbitsrect " GS misc operators syn keyword postscrGSOperator getenv .makeoperator .setdebug .oserrno .oserror .execn " GS rendering stack operators syn keyword postscrGSOperator .begintransparencygroup .discardtransparencygroup .endtransparencygroup syn keyword postscrGSOperator .begintransparencymask .discardtransparencymask .endtransparencymask .inittransparencymask syn keyword postscrGSOperator .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 else command -nargs=+ HiLink hi def link 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 postscrL2Repeat postscrRepeat HiLink postscrOperator Operator HiLink postscrL1Operator postscrOperator HiLink postscrL2Operator postscrOperator HiLink postscrL3Operator postscrOperator 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 postscrASCIIStringError postscrError HiLink postscrIdentifierError postscrError if exists("postscr_ghostscript") HiLink postscrGSOperator postscrOperator HiLink postscrGSMathOperator postscrMathOperator else HiLink postscrGSOperator postscrError HiLink postscrGSMathOperator postscrError endif delcommand HiLink endif let b:current_syntax = "postscr" " vim: ts=8 vim-7.4.1689/runtime/syntax/pov.vim000066400000000000000000000222101267703067000171240ustar00rootroot00000000000000" Vim syntax file " Language: PoV-Ray(tm) 3.7 Scene Description Language " Maintainer: David Necas (Yeti) " Last Change: 2011-04-23 " 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(":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 ovus parametric pattern photons plane poly polygon polynomial 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 inside_vector 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 maximum_reuse max_sample media minimum_reuse mm_per_unit nearest_count normal pretrace_end pretrace_start recursion_limit save_file syn keyword povDescriptors color colour rgb rgbt rgbf rgbft srgb srgbf srgbt srgbft syn match povDescriptors "\<\(red\|green\|blue\|gray\)\>" 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 subsurface syn keyword povDescriptors cylinder fisheye mesh_camera omnimax orthographic panoramic perspective spherical ultra_wide_angle syn keyword povDescriptors agate aoi average brick boxed bozo bumps cells checker crackle cylindrical dents facets function gradient granite hexagon julia leopard magnet mandel marble onion pavement planar quilted radial ripples slope spherical spiral1 spiral2 spotted square tiles tile2 tiling toroidal triangular 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 importance no_radiosity 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 area_illumination falloff jitter looks_like media_attenuation media_interaction method point_at radius tightness syn keyword povModifiers angle aperture bokeh blur_samples confidence direction focal_point h_angle location look_at right sky up v_angle variance syn keyword povModifiers all bump_size gamma interpolate map_type once premultiplied slope_map use_alpha use_color use_colour use_index syn match povModifiers "\<\(filter\|transmit\)\>" 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 exr gif hdr iff jpeg pgm png pot ppm sys tga tiff 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 bitwise_and bitwise_or bitwise_xor ceil cos cosh defined degrees dimensions dimension_size div exp file_exists floor inside int internal ln log max min mod pow prod radians rand seed select sin sinh sqrt strcmp strlen sum 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 datetime now 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 input_file_name image_width image_height false no off on pi true version yes syn match povConsts "\<[tuvxyz]\>" syn match povDotItem "\.\@<=\(blue\|green\|gray\|filter\|red\|transmit\|hf\|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\|for\|if\|ifdef\|ifndef\|switch\|while\)\>" syn match povLabelDir "#\s*\(break\|case\|default\|range\)\>" syn match povDeclareDir "#\s*\(declare\|default\|local\|macro\|undef\|version\)\>" nextgroup=povDeclareOption skipwhite syn keyword povDeclareOption deprecated once contained nextgroup=povDeclareOption skipwhite syn match povIncludeDir "#\s*include\>" syn match povFileDir "#\s*\(fclose\|fopen\|read\|write\)\>" syn keyword povFileDataType uint8 sint8 unit16be uint16le sint16be sint16le sint32le sint32be 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 "\\u\x\{4}\|\\\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 povSpecial 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 povDeclareOption Define hi def link povIncludeDir Include hi def link povFileDir PreProc hi def link povFileDataType Special 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" vim-7.4.1689/runtime/syntax/povini.vim000066400000000000000000000073061267703067000176350ustar00rootroot00000000000000" Vim syntax file " Language: PoV-Ray(tm) 3.7 configuration/initialization files " Maintainer: David Necas (Yeti) " Last Change: 2011-04-24 " 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(":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 Frame_Final Frame_Step Initial_Clock Final_Clock Subset_Start_Frame Subset_End_Frame Cyclic_Animation Clockless_Animation Real_Time_Raytracing Field_Render Odd_Field Work_Threads 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 Render_Block_Size Render_Block_Step Render_Pattern Max_Image_Buffer_Memory syn keyword poviniKeyword Output_to_File Output_File_Type Output_Alpha Bits_Per_Color Output_File_Name Buffer_Output Buffer_Size Dither Dither_Method File_Gamma syn keyword poviniKeyword BSP_Base BSP_Child BSP_Isect BSP_Max BSP_Miss 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 Bounding Bounding_Method Bounding_Threshold Light_Buffer Vista_Buffer Remove_Bounds Split_Unions Antialias Sampling_Method Antialias_Threshold Jitter Jitter_Amount Antialias_Depth Antialias_Gamma syn keyword poviniKeyword Pre_Scene_Return Pre_Frame_Return Post_Scene_Return Post_Frame_Return User_Abort_Return Fatal_Error_Return syn keyword poviniKeyword Radiosity Radiosity_File_Name Radiosity_From_File Radiosity_To_File Radiosity_Vain_Pretrace High_Reproducibility 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" vim-7.4.1689/runtime/syntax/ppd.vim000066400000000000000000000023531267703067000171110ustar00rootroot00000000000000" Vim syntax file " Language: PPD (PostScript printer description) file " Maintainer: Bjoern Jacke " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/ppwiz.vim000066400000000000000000000061531267703067000175010ustar00rootroot00000000000000" Vim syntax file " Language: PPWizard (preprocessor by Dennis Bareis) " Maintainer: Stefan Schwarzer " 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="" contains=@ppwizArgVal " Rexx variables syn region ppwizRexxVar start="" 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/prescribe.vim000066400000000000000000000053431267703067000203060ustar00rootroot00000000000000" Vim syntax file " Language: Kyocera PreScribe2e " Maintainer: Klaus Muth " URL: http://www.hampft.de/vim/syntax/prescribe.vim " Last Change: 2005 Mar 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 match prescribeSpecial "!R!" " all prescribe commands syn keyword prescribeStatement ALTF AMCR ARC ASFN ASTK BARC BLK BOX CALL syn keyword prescribeStatement CASS CIR CLIP CLPR CLSP COPY CPTH CSET CSTK syn keyword prescribeStatement CTXT DAF DAM DAP DELF DELM DPAT DRP DRPA DUPX syn keyword prescribeStatement DXPG DXSD DZP ENDD ENDM ENDR EPL EPRM EXIT syn keyword prescribeStatement FDIR FILL FLAT FLST FONT FPAT FRPO FSET FTMD syn keyword prescribeStatement GPAT ICCD INTL JOG LDFC MAP MCRO MDAT MID syn keyword prescribeStatement MLST MRP MRPA MSTK MTYP MZP NEWP PAGE PARC PAT syn keyword prescribeStatement PCRP PCZP PDIR RDRP PDZP PELP PIE PMRA PMRP PMZP syn keyword prescribeStatement PRBX PRRC PSRC PXPL RDMP RES RSL RGST RPCS RPF syn keyword prescribeStatement RPG RPP RPU RTTX RTXT RVCD RVRD SBM SCAP SCCS syn keyword prescribeStatement SCF SCG SCP SCPI SCRC SCS SCU SDP SEM SETF SFA syn keyword prescribeStatement SFNT SIMG SIR SLJN SLM SLPI SLPP SLS SMLT SPD syn keyword prescribeStatement SPL SPLT SPO SPSZ SPW SRM SRO SROP SSTK STAT STRK syn keyword prescribeStatement SULP SVCP TATR TEXT TPRS UNIT UOM WIDE WRED XPAT syn match prescribeStatement "\" syn match prescribeStatement "\" syn match prescribeStatement "\" syn match prescribeStatement "\" syn match prescribeStatement "\" syn match prescribeStatement "\" syn match prescribeStatement "\" syn match prescribeCSETArg "[0-9]\{1,3}[A-Z]" syn match prescribeFRPOArg "[A-Z][0-9]\{1,2}" syn match prescribeNumber "[0-9]\+" syn region prescribeString start=+'+ end=+'+ skip=+\\'+ syn region prescribeComment start=+CMNT+ 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_prescribe_syn_inits") if version < 508 let did_prescribe_syn_inits = 1 command -nargs=+ HiLink hi link else command -nargs=+ HiLink hi def link endif HiLink prescribeSpecial PreProc HiLink prescribeStatement Statement HiLink prescribeNumber Number HiLink prescribeCSETArg String HiLink prescribeFRPOArg String HiLink prescribeComment Comment delcommand HiLink endif let b:current_syntax = "prescribe" " vim: ts=8 vim-7.4.1689/runtime/syntax/privoxy.vim000066400000000000000000000067731267703067000200600ustar00rootroot00000000000000" Vim syntax file " Language: Privoxy actions file " Maintainer: Doug Kearns " URL: http://gus.gscit.monash.edu.au/~djkea2/vim/syntax/privoxy.vim " Last Change: 2007 Mar 30 " Privoxy 3.0.6 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim setlocal iskeyword=@,48-57,_,- syn keyword privoxyTodo contained TODO FIXME XXX NOTE syn match privoxyComment "#.*" contains=privoxyTodo,@Spell syn region privoxyActionLine matchgroup=privoxyActionLineDelimiter start="^\s*\zs{" end="}\ze\s*$" \ contains=privoxyEnabledPrefix,privoxyDisabledPrefix syn match privoxyEnabledPrefix "\%(^\|\s\|{\)\@<=+\l\@=" nextgroup=privoxyAction,privoxyFilterAction contained syn match privoxyDisabledPrefix "\%(^\|\s\|{\)\@<=-\l\@=" nextgroup=privoxyAction,privoxyFilterAction contained syn match privoxyAction "\%(add-header\|block\|content-type-overwrite\|crunch-client-header\|crunch-if-none-match\)\>" contained syn match privoxyAction "\%(crunch-incoming-cookies\|crunch-outgoing-cookies\|crunch-server-header\|deanimate-gifs\)\>" contained syn match privoxyAction "\%(downgrade-http-version\|fast-redirects\|filter-client-headers\|filter-server-headers\)\>" contained syn match privoxyAction "\%(filter\|force-text-mode\|handle-as-empty-document\|handle-as-image\)\>" contained syn match privoxyAction "\%(hide-accept-language\|hide-content-disposition\|hide-forwarded-for-headers\)\>" contained syn match privoxyAction "\%(hide-from-header\|hide-if-modified-since\|hide-referrer\|hide-user-agent\|inspect-jpegs\)\>" contained syn match privoxyAction "\%(kill-popups\|limit-connect\|overwrite-last-modified\|prevent-compression\|redirect\)\>" contained syn match privoxyAction "\%(send-vanilla-wafer\|send-wafer\|session-cookies-only\|set-image-blocker\)\>" contained syn match privoxyAction "\%(treat-forbidden-connects-like-blocks\)\>" syn match privoxyFilterAction "filter{[^}]*}" contained contains=privoxyFilterArg,privoxyActionBraces syn match privoxyActionBraces "[{}]" contained syn keyword privoxyFilterArg js-annoyances js-events html-annoyances content-cookies refresh-tags unsolicited-popups all-popups \ img-reorder banners-by-size banners-by-link webbugs tiny-textforms jumping-windows frameset-borders demoronizer \ shockwave-flash quicktime-kioskmode fun crude-parental ie-exploits site-specifics no-ping google yahoo msn blogspot \ x-httpd-php-to-html html-to-xml xml-to-html hide-tor-exit-notation contained " Alternative spellings syn match privoxyAction "\%(kill-popup\|hide-referer\|prevent-keeping-cookies\)\>" contained " Pre-3.0 compatibility syn match privoxyAction "\%(no-cookie-read\|no-cookie-set\|prevent-reading-cookies\|prevent-setting-cookies\)\>" contained syn match privoxyAction "\%(downgrade\|hide-forwarded\|hide-from\|image\|image-blocker\|no-compression\)\>" contained syn match privoxyAction "\%(no-cookies-keep\|no-cookies-read\|no-cookies-set\|no-popups\|vanilla-wafer\|wafer\)\>" contained syn match privoxySetting "\" syn match privoxyHeader "^\s*\zs{{\%(alias\|settings\)}}\ze\s*$" hi def link privoxyAction Identifier hi def link privoxyFilterAction Identifier hi def link privoxyActionLineDelimiter Delimiter hi def link privoxyDisabledPrefix SpecialChar hi def link privoxyEnabledPrefix SpecialChar hi def link privoxyHeader PreProc hi def link privoxySetting Identifier hi def link privoxyFilterArg Constant hi def link privoxyComment Comment hi def link privoxyTodo Todo let b:current_syntax = "privoxy" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/procmail.vim000066400000000000000000000045511267703067000201360ustar00rootroot00000000000000" Vim syntax file " Language: Procmail definition file " Maintainer: Melchior FRANZ " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/progress.vim000066400000000000000000000766061267703067000202060ustar00rootroot00000000000000" Vim syntax file " Language: Progress 4GL " Filename extensions: *.p (collides with Pascal), " *.i (collides with assembler) " *.w (collides with cweb) " Maintainer: Philip Uren Remove SPAXY spam block " Contributors: Matthew Stickney " Chris Ruprecht " Mikhail Kuperblum " John Florian " Version: 13 " Last Change: Nov 11 2012 " For version 5.x: Clear all syntax item " 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:cpo_save = &cpo set cpo&vim if version >= 600 setlocal iskeyword=@,48-57,_,-,!,#,$,% else set iskeyword=@,48-57,_,-,!,#,$,% endif " The Progress editor doesn't cope with tabs very well. set expandtab syn case ignore " Progress Blocks of code and mismatched "end." errors. syn match ProgressEndError "\" syn region ProgressDoBlock transparent matchgroup=ProgressDo start="\" matchgroup=ProgressDo end="\" contains=ALLBUT,ProgressProcedure,ProgressFunction syn region ProgressForBlock transparent matchgroup=ProgressFor start="\" matchgroup=ProgressFor end="\" contains=ALLBUT,ProgressProcedure,ProgressFunction syn region ProgressRepeatBlock transparent matchgroup=ProgressRepeat start="\" matchgroup=ProgressRepeat end="\" contains=ALLBUT,ProgressProcedure,ProgressFunction syn region ProgressCaseBlock transparent matchgroup=ProgressCase start="\" matchgroup=ProgressCase end="\\|\" 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 " If you like to highlight the whole line of " the start and end of procedures " to make the whole block of code stand out: syn match ProgressProcedure "^\s*procedure.*" syn match ProgressProcedure "^\s*end\s\s*procedure.*" syn match ProgressFunction "^\s*function.*" syn match ProgressFunction "^\s*end\s\s*function.*" " ... otherwise use this: " syn keyword ProgressFunction procedure function syn keyword ProgressReserved accum[ulate] active-form active-window add alias all alter ambig[uous] analyz[e] and any apply as asc[ending] syn keyword ProgressReserved assign asynchronous at attr[-space] audit-control audit-policy authorization auto-ret[urn] avail[able] back[ground] syn keyword ProgressReserved before-h[ide] begins bell between big-endian blank break buffer-comp[are] buffer-copy by by-pointer by-variant-point[er] call syn keyword ProgressReserved can-do can-find case case-sen[sitive] cast center[ed] check chr clear clipboard codebase-locator colon color column-lab[el] syn keyword ProgressReserved col[umns] com-self compiler connected control copy-lob count-of cpstream create current current-changed current-lang[uage] syn keyword ProgressReserved current-window current_date curs[or] database dataservers dataset dataset-handle db-remote-host dbcodepage dbcollation dbname syn keyword ProgressReserved dbparam dbrest[rictions] dbtaskid dbtype dbvers[ion] dde deblank debug-list debugger decimals declare default syn keyword ProgressReserved default-noxl[ate] default-window def[ine] delete delimiter desc[ending] dict[ionary] disable discon[nect] disp[lay] distinct do dos syn keyword ProgressReserved down drop dynamic-cast dynamic-func[tion] dynamic-new each editing else enable encode end entry error-stat[us] escape syn keyword ProgressReserved etime event-procedure except exclusive[-lock] exclusive-web[-user] exists export false fetch field[s] file-info[rmation] syn keyword ProgressReserved fill find find-case-sensitive find-global find-next-occurrence find-prev-occurrence find-select find-wrap-around first syn keyword ProgressReserved first-of focus font for form[at] fram[e] frame-col frame-db frame-down frame-field frame-file frame-inde[x] frame-line syn keyword ProgressReserved frame-name frame-row frame-val[ue] from from-c[hars] from-p[ixels] function-call-type gateway[s] get-attr-call-type get-byte syn keyword ProgressReserved get-codepage[s] get-coll[ations] get-column get-error-column get-error-row get-file-name get-file-offse[t] get-key-val[ue] syn keyword ProgressReserved get-message-type get-row getbyte global go-on go-pend[ing] grant graphic-e[dge] group having header help hide host-byte-order if syn keyword ProgressReserved import in index indicator input input-o[utput] insert into is is-attr[-space] join kblabel key-code key-func[tion] key-label syn keyword ProgressReserved keycode keyfunc[tion] keylabel keys keyword label last last-even[t] last-key last-of lastkey ldbname leave library like syn keyword ProgressReserved like-sequential line-count[er] listi[ng] little-endian locked log-manager lookup machine-class map member message message-lines mouse syn keyword ProgressReserved mpe new next next-prompt no no-attr[-space] no-error no-f[ill] no-help no-hide no-label[s] no-lobs no-lock no-map syn keyword ProgressReserved no-mes[sage] no-pause no-prefe[tch] no-return-val[ue] no-undo no-val[idate] no-wait not now 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 syn keyword ProgressReserved os-rename otherwise output overlay page page-bot[tom] page-num[ber] page-top param[eter] password-field pause pdbname syn keyword ProgressReserved persist[ent] pixels preproc[ess] privileges proc-ha[ndle] proc-st[atus] procedure-call-type process profiler program-name progress syn keyword ProgressReserved prompt[-for] promsgs propath provers[ion] publish put put-byte put-key-val[ue] putbyte query query-tuning quit r-index syn keyword ProgressReserved rcode-info[rmation] read-available read-exact-num readkey recid record-len[gth] rect[angle] release repeat reposition retain retry return syn keyword ProgressReserved return-val[ue] revert revoke row-created row-deleted row-modified row-unmodified run save sax-comple[te] sax-parser-error syn keyword ProgressReserved sax-running sax-uninitialized sax-write-begin sax-write-complete sax-write-content sax-write-element sax-write-error syn keyword ProgressReserved sax-write-idle sax-write-tag schema screen screen-io screen-lines scroll sdbname search search-self search-target security-policy syn keyword ProgressReserved seek select self session set set-attr-call-type setuser[id] share[-lock] shared show-stat[s] skip some source-procedure syn keyword ProgressReserved space status stream stream-handle stream-io string-xref subscribe super system-dialog table table-handle target-procedure syn keyword ProgressReserved term[inal] text text-cursor text-seg[-grow] then this-object this-procedure time title to today top-only trans[action] trigger syn keyword ProgressReserved triggers trim true underl[ine] undo unform[atted] union unique unix unless-hidden unsubscribe up update use-index use-revvideo syn keyword ProgressReserved use-underline user[id] using value values view view-as wait-for web-con[text] when where while window window-delayed-min[imize] syn keyword ProgressReserved window-maxim[ized] window-minim[ized] window-normal with work-tab[le] workfile write xcode xcode-session-key xref xref-xml yes " 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=+\~'\|\~\~\|\~"+ contains=@Spell syn region ProgressString matchgroup=ProgressQuote start=+'+ end=+'+ skip=+\~'\|\~\~\|\~"+ contains=@Spell 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]\+" " More values: Logicals, and Progress's unknown value, ?. syn match ProgressNumber "?" syn keyword ProgressNumber true false yes no " If you don't like tabs: syn match ProgressShowTab "\t" " If you don't like white space on the end of lines, uncomment this: " syn match ProgressSpaceError "\s\+$" syn region ProgressComment start="/\*" end="\*/" contains=ProgressComment,ProgressTodo,ProgressDebug,@Spell syn region ProgressInclude start="^[ ]*[{]" end="[}]" contains=ProgressPreProc,ProgressOperator,ProgressString,ProgressComment syn region ProgressPreProc start="&" end="\>" contained " This next line works reasonably well. " syn match ProgressOperator "[!;|)(:.><+*=-]" " " Progress allows a '-' to be part of an identifier. To be considered " the subtraction/negation operation operator it needs a non-word " character on either side. Also valid are cases where the minus " operation appears at the beginning or end of a line. " This next line trips up on "no-undo" etc. " syn match ProgressOperator "[!;|)(:.><+*=]\|\W-\W\|^-\W\|\W-$" syn match ProgressOperator "[!;|)(:.><+*=]\|\s-\s\|^-\s\|\s-$" syn keyword ProgressOperator <= <> >= syn keyword ProgressOperator abs[olute] accelerator accept-changes accept-row-changes across active actor add-buffer add-calc-col[umn] syn keyword ProgressOperator add-columns-from add-events-proc[edure] add-fields-from add-first add-header-entry add-index-field add-interval add-last syn keyword ProgressOperator add-like-col[umn] add-like-field add-like-index add-new-field add-new-index add-rel[ation] add-schema-location add-source-buffer syn keyword ProgressOperator add-super-proc[edure] adm-data advise after-buffer after-rowid after-table alert-box allow-column-searching allow-replication alternate-key syn keyword ProgressOperator always-on-top ansi-only anywhere append append-child appl-alert[-boxes] appl-context-id application apply-callback appserver-info syn keyword ProgressOperator appserver-password appserver-userid array-m[essage] ask-overwrite assembly async-request-count async-request-handle attach-data-source syn keyword ProgressOperator attached-pairlist attach attribute-names audit-enabled audit-event-context authentication-failed auto-comp[letion] auto-delete syn keyword ProgressOperator auto-delete-xml auto-end-key auto-endkey auto-go auto-ind[ent] auto-resize auto-synchronize auto-val[idate] auto-z[ap] automatic syn keyword ProgressOperator available-formats ave[rage] avg backward[s] base-ade base-key basic-logging batch[-mode] batch-size before-buffer before-rowid syn keyword ProgressOperator before-table begin-event-group bgc[olor] binary bind bind-where blob block-iteration-display border-b[ottom-chars] syn keyword ProgressOperator border-bottom-p[ixels] border-l[eft-chars] border-left-p[ixels] border-r[ight-chars] border-right-p[ixels] border-t[op-chars] syn keyword ProgressOperator border-top-p[ixels] both bottom box box-select[able] browse buffer buffer-chars buffer-create buffer-delete buffer-field buffer-handle syn keyword ProgressOperator buffer-lines buffer-n[ame] buffer-releas[e] buffer-validate buffer-value button[s] by-reference by-value byte bytes-read syn keyword ProgressOperator bytes-written cache cache-size call-name call-type can-crea[te] can-dele[te] can-query can-read can-set can-writ[e] cancel-break syn keyword ProgressOperator cancel-button cancel-requests cancelled caps careful-paint catch cdecl chained char[acter] character_length charset checked syn keyword ProgressOperator child-buffer child-num choose class class-type clear-appl-context clear-log clear-select[ion] clear-sort-arrow[s] syn keyword ProgressOperator client-connection-id client-principal client-tty client-type client-workstation clob clone-node close close-log code codepage syn keyword ProgressOperator codepage-convert col-of collate colon-align[ed] color-table column-bgc[olor] column-codepage column-dcolor column-fgc[olor] syn keyword ProgressOperator column-font column-movable column-of column-pfc[olor] column-read-only column-resizable column-sc[rolling] com-handle combo-box syn keyword ProgressOperator command compare[s] compile complete config-name connect constructor contents context context-help context-help-file syn keyword ProgressOperator context-help-id context-pop[up] control-box control-fram[e] convert convert-to-offs[et] copy-dataset copy-sax-attributes syn keyword ProgressOperator copy-temp-table count cpcase cpcoll cpint[ernal] cplog cpprint cprcodein cprcodeout cpterm crc-val[ue] create-like syn keyword ProgressOperator create-like-sequential create-node create-node-namespace create-result-list-entry create-test-file current-column current-env[ironment] syn keyword ProgressOperator current-iteration current-query current-result-row current-row-modified current-value cursor-char cursor-line cursor-offset data-b[ind] syn keyword ProgressOperator data-entry-ret[urn] data-rel[ation] data-source data-source-complete-map data-source-modified data-source-rowid data-t[ype] date syn keyword ProgressOperator date-f[ormat] day db-references dcolor dde-error dde-i[d] dde-item dde-name dde-topic debu[g] debug-alert syn keyword ProgressOperator declare-namespace decrypt default-buffer-handle default-but[ton] default-commit default-ex[tension] default-string syn keyword ProgressOperator default-value define-user-event-manager defined delete-char delete-current-row delete-header-entry delete-line delete-node syn keyword ProgressOperator delete-result-list-entry delete-selected-row delete-selected-rows descript[ion] deselect-focused-row deselect-rows deselect-selected-row syn keyword ProgressOperator destructor detach-data-source dialog-box dir directory disable-auto-zap disable-connections disable-dump-triggers syn keyword ProgressOperator disable-load-triggers disabled display-message display-timezone display-t[ype] domain-description domain-name domain-type double syn keyword ProgressOperator drag-enabled drop-down drop-down-list drop-target dump dump-logging-now dynamic dynamic-current-value dynamic-next-value echo syn keyword ProgressOperator edge[-chars] edge-p[ixels] edit-can-paste edit-can-undo edit-clear edit-copy edit-cut edit-paste edit-undo editor empty syn keyword ProgressOperator empty-dataset empty-temp-table enable-connections enabled encoding encrypt encrypt-audit-mac-key encryption-salt end-document syn keyword ProgressOperator end-element end-event-group end-file-drop end-key end-user-prompt endkey entered entry-types-list eq error error-col[umn] syn keyword ProgressOperator error-object-detail error-row error-stack-trace error-string event-group-id event-procedure-context event-t[ype] events exclusive-id syn keyword ProgressOperator execute execution-log exp expand expandable expire explicit export-principal extended extent external extract syn keyword ProgressOperator fetch-selected-row fgc[olor] file file-create-d[ate] file-create-t[ime] file-mod-d[ate] file-mod-t[ime] file-name file-off[set] syn keyword ProgressOperator file-size file-type filename fill-in fill-mode fill-where-string filled filters final finally find-by-rowid find-current syn keyword ProgressOperator find-first find-last find-unique finder first-async[-request] first-buffer first-child first-column first-data-source syn keyword ProgressOperator first-dataset first-form first-object first-proc[edure] first-query first-serv[er] first-server-socket first-socket syn keyword ProgressOperator first-tab-i[tem] fit-last-column fix-codepage fixed-only flat-button float focused-row focused-row-selected font-table force-file syn keyword ProgressOperator fore[ground] foreign-key-hidden form-input form-long-input formatte[d] forward-only forward[s] fragmen[t] frame-spa[cing] frame-x syn keyword ProgressOperator frame-y frequency from-cur[rent] full-height[-chars] full-height-p[ixels] full-pathn[ame] full-width[-chars] syn keyword ProgressOperator full-width-p[ixels] function ge generate-pbe-key generate-pbe-salt generate-random-key generate-uuid get get-attribute get-attribute-node syn keyword ProgressOperator get-binary-data get-bits get-blue[-value] get-browse-col[umn] get-buffer-handle get-byte-order get-bytes get-bytes-available syn keyword ProgressOperator get-callback-proc-context get-callback-proc-name get-cgi-list get-cgi-long-value get-cgi-value get-changes get-child get-child-rel[ation] syn keyword ProgressOperator get-config-value get-curr[ent] get-dataset-buffer get-dir get-document-element get-double get-dropped-file get-dynamic get-file syn keyword ProgressOperator get-firs[t] get-float get-green[-value] get-header-entr[y] get-index-by-namespace-name get-index-by-qname get-iteration get-last syn keyword ProgressOperator get-localname-by-index get-long get-message get-next get-node get-number get-parent get-pointer-value get-prev get-printers get-property syn keyword ProgressOperator get-qname-by-index get-red[-value] get-rel[ation] get-repositioned-row get-rgb[-value] get-selected[-widget] get-serialized get-short syn keyword ProgressOperator get-signature get-size get-socket-option get-source-buffer get-string get-tab-item get-text-height[-chars] get-text-height-p[ixels] syn keyword ProgressOperator get-text-width[-chars] get-text-width-p[ixels] get-top-buffer get-type-by-index get-type-by-namespace-name get-type-by-qname syn keyword ProgressOperator get-unsigned-long get-unsigned-short get-uri-by-index get-value-by-index get-value-by-namespace-name get-value-by-qname syn keyword ProgressOperator get-wait[-state] grayed grid-factor-h[orizontal] grid-factor-v[ertical] grid-snap grid-unit-height[-chars] grid-unit-height-p[ixels] syn keyword ProgressOperator grid-unit-width[-chars] grid-unit-width-p[ixels] grid-visible group-box gt guid handle handler has-lobs has-records height[-chars] syn keyword ProgressOperator height-p[ixels] help-topic hex-decode hex-encode hidden hint hori[zontal] html-charset html-end-of-line html-end-of-page syn keyword ProgressOperator html-frame-begin html-frame-end html-header-begin html-header-end html-title-begin html-title-end hwnd icfparam[eter] icon syn keyword ProgressOperator ignore-current-mod[ified] image image-down image-insensitive image-size image-size-c[hars] image-size-p[ixels] image-up immediate-display syn keyword ProgressOperator implements import-node import-principal in-handle increment-exclusive-id index-hint index-info[rmation] indexed-reposition syn keyword ProgressOperator info[rmation] inherit-bgc[olor] inherit-fgc[olor] inherits init[ial] initial-dir initial-filter initialize-document-type initiate syn keyword ProgressOperator inner inner-chars inner-lines input-value insert-attribute insert-b[acktab] insert-before insert-file insert-row syn keyword ProgressOperator insert-string insert-t[ab] instantiating-procedure int[eger] interface internal-entries interval invoke is-clas[s] syn keyword ProgressOperator is-codepage-fixed is-column-codepage is-lead-byte is-open is-parameter-set is-row-selected is-selected is-xml iso-date item syn keyword ProgressOperator items-per-row join-by-sqldb keep-connection-open keep-frame-z[-order] keep-messages keep-security-cache keep-tab-order key syn keyword ProgressOperator keyword-all label-bgc[olor] label-dc[olor] label-fgc[olor] label-font label-pfc[olor] labels landscape language[s] large syn keyword ProgressOperator large-to-small last-async[-request] last-batch last-child last-form last-object last-proce[dure] last-serv[er] last-server-socket syn keyword ProgressOperator last-socket last-tab-i[tem] lc le leading left left-align[ed] left-trim length line list-events list-item-pairs list-items syn keyword ProgressOperator list-property-names list-query-attrs list-set-attrs list-widgets literal-question load load-domains load-icon load-image load-image-down syn keyword ProgressOperator load-image-insensitive load-image-up load-mouse-p[ointer] load-picture load-small-icon lob-dir local-host local-name local-port syn keyword ProgressOperator locator-column-number locator-line-number locator-public-id locator-system-id locator-type lock-registration log log-audit-event syn keyword ProgressOperator log-entry-types log-threshold logfile-name logging-level logical login-expiration-timestamp login-host login-state logout long[char] syn keyword ProgressOperator longchar-to-node-value lookahead lower lt mandatory manual-highlight margin-extra margin-height[-chars] margin-height-p[ixels] syn keyword ProgressOperator margin-width[-chars] margin-width-p[ixels] mark-new mark-row-state matches max-button max-chars max-data-guess max-height[-chars] syn keyword ProgressOperator max-height-p[ixels] max-rows max-size max-val[ue] max-width[-chars] max-width-p[ixels] maximize max[imum] maximum-level memory memptr syn keyword ProgressOperator memptr-to-node-value menu menu-bar menu-item menu-k[ey] menu-m[ouse] menubar merge-by-field merge-changes merge-row-changes message-area syn keyword ProgressOperator message-area-font method min-button min-column-width-c[hars] min-column-width-p[ixels] min-height[-chars] min-height-p[ixels] syn keyword ProgressOperator min-schema-marshal min-size min-val[ue] min-width[-chars] min-width-p[ixels] min[imum] modified mod[ulo] month mouse-p[ointer] movable syn keyword ProgressOperator move-after[-tab-item] move-befor[e-tab-item] move-col[umn] move-to-b[ottom] move-to-eof move-to-t[op] mtime multi-compile multiple syn keyword ProgressOperator multiple-key multitasking-interval must-exist must-understand name namespace-prefix namespace-uri native ne needs-appserver-prompt syn keyword ProgressOperator needs-prompt nested new-instance new-row next-col[umn] next-rowid next-sibling next-tab-ite[m] next-value no-apply syn keyword ProgressOperator no-array-m[essage] no-assign no-attr-l[ist] no-auto-validate no-bind-where no-box no-console no-convert no-current-value no-debug syn keyword ProgressOperator no-drag no-echo no-empty-space no-focus no-index-hint no-inherit-bgc[olor] no-inherit-fgc[olor] no-join-by-sqldb no-lookahead syn keyword ProgressOperator no-row-markers no-schema-marshal no-scrollbar-v[ertical] no-separate-connection no-separators no-tab[-stop] no-und[erline] syn keyword ProgressOperator no-word-wrap node-value node-value-to-longchar node-value-to-memptr nonamespace-schema-location none normalize not-active syn keyword ProgressOperator num-buffers num-but[tons] num-child-relations num-children num-col[umns] num-copies num-dropped-files num-fields num-formats syn keyword ProgressOperator num-header-entries num-items num-iterations num-lines num-locked-col[umns] num-log-files num-messages num-parameters num-references syn keyword ProgressOperator num-relations num-repl[aced] num-results num-selected-rows num-selected[-widgets] num-source-buffers num-tabs num-to-retain syn keyword ProgressOperator num-top-buffers num-visible-col[umns] numeric numeric-dec[imal-point] numeric-f[ormat] numeric-sep[arator] object ok ok-cancel syn keyword ProgressOperator on-frame[-border] ordered-join ordinal orientation origin-handle origin-rowid os-getenv outer outer-join override owner owner-document syn keyword ProgressOperator page-size page-wid[th] paged parent parent-buffer parent-rel[ation] parse-status partial-key pascal pathname syn keyword ProgressOperator pbe-hash-alg[orithm] pbe-key-rounds perf[ormance] persistent-cache-disabled persistent-procedure pfc[olor] pixels-per-col[umn] syn keyword ProgressOperator pixels-per-row popup-m[enu] popup-o[nly] portrait position precision prefer-dataset prepare-string prepared presel[ect] prev syn keyword ProgressOperator prev-col[umn] prev-sibling prev-tab-i[tem] primary printer printer-control-handle printer-hdc printer-name printer-port syn keyword ProgressOperator printer-setup private private-d[ata] proce[dure] procedure-name progress-s[ource] property protected proxy proxy-password syn keyword ProgressOperator proxy-userid public public-id published-events put-bits put-bytes put-double put-float put-long put-short put-string syn keyword ProgressOperator put-unsigned-long put-unsigned-short query-close query-off-end query-open query-prepare question quoter radio-buttons radio-set random syn keyword ProgressOperator raw raw-transfer read read-file read-only read-xml read-xmlschema real recursive reference-only refresh syn keyword ProgressOperator refresh-audit-policy refreshable register-domain reject-changes reject-row-changes rejected relation-fi[elds] relations-active remote syn keyword ProgressOperator remote-host remote-port remove-attribute remove-child remove-events-proc[edure] remove-super-proc[edure] replace replace-child syn keyword ProgressOperator replace-selection-text replication-create replication-delete replication-write reposition-back[ward] reposition-forw[ard] reposition-to-row syn keyword ProgressOperator reposition-to-rowid request reset resiza[ble] resize restart-row restart-rowid result retain-s[hape] retry-cancel return-ins[erted] syn keyword ProgressOperator return-to-start-di[r] return-value-data-type returns reverse-from rgb-v[alue] right right-align[ed] right-trim roles round rounded syn keyword ProgressOperator routine-level row row-height[-chars] row-height-p[ixels] row-ma[rkers] row-of row-resizable row-state rowid rule run-proc[edure] syn keyword ProgressOperator save-as save-file save-row-changes save-where-string sax-attributes sax-parse sax-parse-first sax-parse-next sax-reader syn keyword ProgressOperator sax-writer schema-change schema-location schema-marshal schema-path screen-val[ue] scroll-bars scroll-delta scroll-offset syn keyword ProgressOperator scroll-to-current-row scroll-to-i[tem] scroll-to-selected-row scrollable scrollbar-h[orizontal] scrollbar-v[ertical] syn keyword ProgressOperator scrolled-row-pos[ition] scrolling seal seal-timestamp section select-all select-focused-row select-next-row select-prev-row select-row syn keyword ProgressOperator selectable selected selection-end selection-list selection-start selection-text send sensitive separate-connection syn keyword ProgressOperator separator-fgc[olor] separators server server-connection-bo[und] server-connection-bound-re[quest] server-connection-co[ntext] syn keyword ProgressOperator server-connection-id server-operating-mode server-socket session-end session-id set-actor set-appl-context set-attribute syn keyword ProgressOperator set-attribute-node set-blue[-value] set-break set-buffers set-byte-order set-callback set-callback-procedure set-client set-commit syn keyword ProgressOperator set-connect-procedure set-contents set-db-client set-dynamic set-green[-value] set-input-source set-must-understand set-node syn keyword ProgressOperator set-numeric-form[at] set-option set-output-destination set-parameter set-pointer-val[ue] set-property set-read-response-procedure syn keyword ProgressOperator set-red[-value] set-repositioned-row set-rgb[-value] set-rollback set-selection set-serialized set-size set-socket-option syn keyword ProgressOperator set-sort-arrow set-wait[-state] short show-in-task[bar] side-label-h[andle] side-lab[els] silent simple single single-character size syn keyword ProgressOperator size-c[hars] size-p[ixels] skip-deleted-rec[ord] slider small-icon small-title smallint soap-fault soap-fault-actor syn keyword ProgressOperator soap-fault-code soap-fault-detail soap-fault-string soap-header soap-header-entryref socket sort sort-ascending sort-number source syn keyword ProgressOperator sql sqrt ssl-server-name standalone start-document start-element start[ing] startup-parameters state-detail static syn keyword ProgressOperator status-area status-area-font stdcall stop stop-parsing stoppe[d] stored-proc[edure] stretch-to-fit strict string string-value syn keyword ProgressOperator sub-ave[rage] sub-count sub-max[imum] sub-menu sub-menu-help sub-min[imum] sub-total subst[itute] substr[ing] subtype sum syn keyword ProgressOperator super-proc[edures] suppress-namespace-processing suppress-w[arnings] suspend symmetric-encryption-algorithm symmetric-encryption-iv syn keyword ProgressOperator symmetric-encryption-key symmetric-support synchronize system-alert[-boxes] system-help system-id tab-position tab-stop table-crc-list syn keyword ProgressOperator table-list table-num[ber] target temp-dir[ectory] temp-table temp-table-prepar[e] terminate text-selected three-d through throw syn keyword ProgressOperator thru tic-marks time-source timezone title-bgc[olor] title-dc[olor] title-fgc[olor] title-fo[nt] to-rowid toggle-box syn keyword ProgressOperator tooltip tooltips top top-nav-query topic total tracking-changes trailing trans-init-proc[edure] transaction-mode syn keyword ProgressOperator transpar[ent] trunc[ate] ttcodepage type type-of unbox unbuff[ered] unique-id unique-match unload unsigned-byte unsigned-integer syn keyword ProgressOperator unsigned-long unsigned-short update-attribute upper url url-decode url-encode url-password url-userid use use-dic[t-exps] syn keyword ProgressOperator use-filename use-text use-widget-pool user-id valid-event valid-handle valid-object validate validate-expressio[n] syn keyword ProgressOperator validate-message validate-seal validate-xml validation-enabled var[iable] verb[ose] version vert[ical] view-first-column-on-reopen syn keyword ProgressOperator virtual-height[-chars] virtual-height-p[ixels] virtual-width[-chars] virtual-width-p[ixels] visible void wait warning weekday where-string syn keyword ProgressOperator widget widget-e[nter] widget-h[andle] widget-id widget-l[eave] widget-pool width[-chars] width-p[ixels] window-name syn keyword ProgressOperator window-sta[te] window-sys[tem] word-index word-wrap work-area-height-p[ixels] work-area-width-p[ixels] work-area-x work-area-y syn keyword ProgressOperator write-cdata write-characters write-comment write-data-element write-empty-element write-entity-ref write-external-dtd syn keyword ProgressOperator write-fragment write-message write-processing-instruction write-status write-xml write-xmlschema x x-document x-noderef x-of syn keyword ProgressOperator xml-data-type xml-node-name xml-node-type xml-schema-pat[h] xml-suppress-namespace-processing y y-of year year-offset yes-no syn keyword ProgressOperator yes-no-cancel syn keyword ProgressType char[acter] int[eger] int64 dec[imal] log[ical] da[te] datetime datetime-tz 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 else command -nargs=+ HiLink hi def link endif " The default methods for highlighting. Can be overridden later. HiLink ProgressByte Number HiLink ProgressCase Repeat HiLink ProgressComment Comment HiLink ProgressConditional Conditional HiLink ProgressDebug Debug HiLink ProgressDo Repeat HiLink ProgressEndError Error HiLink ProgressFor Repeat HiLink ProgressFunction Procedure HiLink ProgressIdentifier Identifier HiLink ProgressInclude Include HiLink ProgressMatrixDelimiter Identifier HiLink ProgressNumber Number HiLink ProgressOperator Operator HiLink ProgressPreProc PreProc HiLink ProgressProcedure Procedure HiLink ProgressQuote Delimiter HiLink ProgressRepeat Repeat HiLink ProgressReserved Statement HiLink ProgressSpaceError Error HiLink ProgressString String HiLink ProgressTodo Todo HiLink ProgressType Statement HiLink ProgressShowTab Error delcommand HiLink endif let b:current_syntax = "progress" let &cpo = s:cpo_save unlet s:cpo_save " vim: ts=8 sw=8 vim-7.4.1689/runtime/syntax/prolog.vim000066400000000000000000000107121267703067000176260ustar00rootroot00000000000000" Vim syntax file " Language: PROLOG " Maintainers: Thomas Koehler " Last Change: 2013 May 23 " URL: http://gott-gehabt.de/800_wer_wir_sind/thomas/Homepage/Computer/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 prologClause matchgroup=prologClauseHead start=+^\s*[a-z]\w*+ matchgroup=Normal end=+\.\s\|\.$+ contains=ALLBUT,prologClause 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 prologSpecialCharacter ":-" syn match prologSpecialCharacter "-->" syn match prologQuestion "?-.*\." contains=prologNumber endif 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_prolog_syn_inits") if version < 508 let did_prolog_syn_inits = 1 command -nargs=+ HiLink hi link else command -nargs=+ HiLink hi def link endif " The default highlighting. HiLink prologComment Comment HiLink prologCComment Comment HiLink prologCharCode Special if exists ("prolog_highlighting_clean") HiLink prologKeyword Statement HiLink prologClauseHead Statement HiLink prologClause Normal else HiLink prologKeyword Keyword HiLink prologClauseHead Constant HiLink prologClause Normal 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 vim-7.4.1689/runtime/syntax/promela.vim000066400000000000000000000034371267703067000177710ustar00rootroot00000000000000" Vim syntax file " Language: ProMeLa " Maintainer: Maurizio Tranchero - " First Release: Mon Oct 16 08:49:46 CEST 2006 " Last Change: Thu Aug 7 21:22:48 CEST 2008 " Version: 0.5 " For version 5.x: Clear all syntax items " 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 " syn case ignore " ProMeLa Keywords syn keyword promelaStatement proctype if else while chan do od fi break goto unless syn keyword promelaStatement active assert label atomic syn keyword promelaFunctions skip timeout run syn keyword promelaTodo contained TODO " ProMeLa Types syn keyword promelaType bit bool byte short int " Operators and special characters syn match promelaOperator "!" syn match promelaOperator "?" syn match promelaOperator "->" syn match promelaOperator "=" syn match promelaOperator "+" syn match promelaOperator "*" syn match promelaOperator "/" syn match promelaOperator "-" syn match promelaOperator "<" syn match promelaOperator ">" syn match promelaOperator "<=" syn match promelaOperator ">=" syn match promelaSpecial "\[" syn match promelaSpecial "\]" syn match promelaSpecial ";" syn match promelaSpecial "::" " ProMeLa Comments syn region promelaComment start="/\*" end="\*/" contains=promelaTodo,@Spell syn match promelaComment "//.*" contains=promelaTodo,@Spell " Class Linking hi def link promelaStatement Statement hi def link promelaType Type hi def link promelaComment Comment hi def link promelaOperator Type hi def link promelaSpecial Special hi def link promelaFunctions Special hi def link promelaString String hi def link promelaTodo Todo let b:current_syntax = "promela" vim-7.4.1689/runtime/syntax/proto.vim000066400000000000000000000055541267703067000174770ustar00rootroot00000000000000" syntax file for Protocol Buffers - Google's data interchange format " " Copyright 2008 Google Inc. All rights reserved. " " 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 " AUTHORS OR COPYRIGHT HOLDERS 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. " " http://code.google.com/p/protobuf/ if version < 600 syntax clear elseif exists("b:current_syntax") finish endif syn case match syn keyword protoTodo contained TODO FIXME XXX syn cluster protoCommentGrp contains=protoTodo syn keyword protoSyntax syntax import option syn keyword protoStructure package message group syn keyword protoRepeat optional required repeated syn keyword protoDefault default syn keyword protoExtend extend extensions to max syn keyword protoRPC service rpc returns syn keyword protoType int32 int64 uint32 uint64 sint32 sint64 syn keyword protoType fixed32 fixed64 sfixed32 sfixed64 syn keyword protoType float double bool string bytes syn keyword protoTypedef enum syn keyword protoBool true false syn match protoInt /-\?\<\d\+\>/ syn match protoInt /\<0[xX]\x+\>/ syn match protoFloat /\<-\?\d*\(\.\d*\)\?/ syn region protoComment start="\/\*" end="\*\/" contains=@protoCommentGrp syn region protoComment start="//" skip="\\$" end="$" keepend contains=@protoCommentGrp syn region protoString start=/"/ skip=/\\./ end=/"/ syn region protoString start=/'/ skip=/\\./ end=/'/ hi def link protoTodo Todo hi def link protoSyntax Include hi def link protoStructure Structure hi def link protoRepeat Repeat hi def link protoDefault Keyword hi def link protoExtend Keyword hi def link protoRPC Keyword hi def link protoType Type hi def link protoTypedef Typedef hi def link protoBool Boolean hi def link protoInt Number hi def link protoFloat Float hi def link protoComment Comment hi def link protoString String let b:current_syntax = "proto" vim-7.4.1689/runtime/syntax/protocols.vim000066400000000000000000000026111267703067000203470ustar00rootroot00000000000000" Vim syntax file " Language: protocols(5) - Internet protocols definition file " Maintainer: Nikolai Weibull " Latest Revision: 2006-04-19 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn match protocolsBegin display '^' \ nextgroup=protocolsName,protocolsComment syn match protocolsName contained display '[[:graph:]]\+' \ nextgroup=protocolsPort skipwhite syn match protocolsPort contained display '\d\+' \ nextgroup=protocolsAliases,protocolsComment \ skipwhite syn match protocolsAliases contained display '\S\+' \ nextgroup=protocolsAliases,protocolsComment \ skipwhite syn keyword protocolsTodo contained TODO FIXME XXX NOTE syn region protocolsComment display oneline start='#' end='$' \ contains=protocolsTodo,@Spell hi def link protocolsTodo Todo hi def link protocolsComment Comment hi def link protocolsName Identifier hi def link protocolsPort Number hi def link protocolsPPDiv Delimiter hi def link protocolsPPDivDepr Error hi def link protocolsProtocol Type hi def link protocolsAliases Macro let b:current_syntax = "protocols" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/psf.vim000066400000000000000000000110211267703067000171060ustar00rootroot00000000000000" Vim syntax file " Language: Software Distributor product specification file " (POSIX 1387.2-1995). " Maintainer: Rex Barzee " 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 else command -nargs=+ HiLink hi def link 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" vim-7.4.1689/runtime/syntax/ptcap.vim000066400000000000000000000105531267703067000174360ustar00rootroot00000000000000" Vim syntax file " Language: printcap/termcap database " Maintainer: Haakon Riiser " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/purifylog.vim000066400000000000000000000070541267703067000203510ustar00rootroot00000000000000" Vim syntax file " Language: purify log files " Maintainer: Gautam H. Mudunuri " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/pyrex.vim000066400000000000000000000037751267703067000175060ustar00rootroot00000000000000" Vim syntax file " Language: Pyrex " Maintainer: Marco Barisione " URL: http://marcobari.altervista.org/pyrex_vim.html " Last Change: 2009 Nov 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 Python syntax to start with if version < 600 so :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 pyrexInclude 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 pythonInclude syn keyword pythonInclude import syn match pythonInclude "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 else command -nargs=+ HiLink hi def link endif HiLink pyrexStatement Statement HiLink pyrexType Type HiLink pyrexStructure Structure HiLink pyrexInclude 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" vim-7.4.1689/runtime/syntax/python.vim000066400000000000000000000322201267703067000176430ustar00rootroot00000000000000" Vim syntax file " Language: Python " Maintainer: Zvezdan Petkovic " Last Change: 2016 Feb 20 " Credits: Neil Schemenauer " Dmitry Vasiliev " " This version is a major rewrite by Zvezdan Petkovic. " " - introduced highlighting of doctests " - updated keywords, built-ins, and exceptions " - corrected regular expressions for " " * functions " * decorators " * strings " * escapes " * numbers " * space error " " - corrected synchronization " - more highlighting is ON by default, except " - space error highlighting is OFF by default " " Optional highlighting can be controlled using these variables. " " let python_no_builtin_highlight = 1 " let python_no_doctest_code_highlight = 1 " let python_no_doctest_highlight = 1 " let python_no_exception_highlight = 1 " let python_no_number_highlight = 1 " let python_space_error_highlight = 1 " " All the options above can be switched on together. " " 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 " We need nocompatible mode in order to continue lines with backslashes. " Original setting will be restored. let s:cpo_save = &cpo set cpo&vim " Keep Python keywords in alphabetical order inside groups for easy " comparison with the table in the 'Python Language Reference' " https://docs.python.org/2/reference/lexical_analysis.html#keywords, " https://docs.python.org/3/reference/lexical_analysis.html#keywords. " Groups are in the order presented in NAMING CONVENTIONS in syntax.txt. " Exceptions come last at the end of each group (class and def below). " " Keywords 'with' and 'as' are new in Python 2.6 " (use 'from __future__ import with_statement' in Python 2.5). " " Some compromises had to be made to support both Python 3 and 2. " We include Python 3 features, but when a definition is duplicated, " the last definition takes precedence. " " - 'False', 'None', and 'True' are keywords in Python 3 but they are " built-ins in 2 and will be highlighted as built-ins below. " - 'exec' is a built-in in Python 3 and will be highlighted as " built-in below. " - 'nonlocal' is a keyword in Python 3 and will be highlighted. " - 'print' is a built-in in Python 3 and will be highlighted as " built-in below (use 'from __future__ import print_function' in 2) " - async and await were added in Python 3.5 and are soft keywords. " syn keyword pythonStatement False, None, True syn keyword pythonStatement as assert break continue del exec global syn keyword pythonStatement lambda nonlocal pass print return with yield syn keyword pythonStatement class def nextgroup=pythonFunction skipwhite syn keyword pythonConditional elif else if syn keyword pythonRepeat for while syn keyword pythonOperator and in is not or syn keyword pythonException except finally raise try syn keyword pythonInclude from import syn keyword pythonAsync async await " Decorators (new in Python 2.4) syn match pythonDecorator "@" display nextgroup=pythonFunction skipwhite " The zero-length non-grouping match before the function name is " extremely important in pythonFunction. Without it, everything is " interpreted as a function inside the contained environment of " doctests. " A dot must be allowed because of @MyClass.myfunc decorators. syn match pythonFunction \ "\%(\%(def\s\|class\s\|@\)\s*\)\@<=\h\%(\w\|\.\)*" contained syn match pythonComment "#.*$" contains=pythonTodo,@Spell syn keyword pythonTodo FIXME NOTE NOTES TODO XXX contained " Triple-quoted strings can contain doctests. syn region pythonString matchgroup=pythonQuotes \ start=+[uU]\=\z(['"]\)+ end="\z1" skip="\\\\\|\\\z1" \ contains=pythonEscape,@Spell syn region pythonString matchgroup=pythonTripleQuotes \ start=+[uU]\=\z('''\|"""\)+ end="\z1" keepend \ contains=pythonEscape,pythonSpaceError,pythonDoctest,@Spell syn region pythonRawString matchgroup=pythonQuotes \ start=+[uU]\=[rR]\z(['"]\)+ end="\z1" skip="\\\\\|\\\z1" \ contains=@Spell syn region pythonRawString matchgroup=pythonTripleQuotes \ start=+[uU]\=[rR]\z('''\|"""\)+ end="\z1" keepend \ contains=pythonSpaceError,pythonDoctest,@Spell 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 " Python allows case-insensitive Unicode IDs: http://www.unicode.org/charts/ syn match pythonEscape "\\N{\a\+\%(\s\a\+\)*}" contained syn match pythonEscape "\\$" if exists("python_highlight_all") if exists("python_no_builtin_highlight") unlet python_no_builtin_highlight endif if exists("python_no_doctest_code_highlight") unlet python_no_doctest_code_highlight endif if exists("python_no_doctest_highlight") unlet python_no_doctest_highlight endif if exists("python_no_exception_highlight") unlet python_no_exception_highlight endif if exists("python_no_number_highlight") unlet python_no_number_highlight endif let python_space_error_highlight = 1 endif " It is very important to understand all details before changing the " regular expressions below or their order. " The word boundaries are *not* the floating-point number boundaries " because of a possible leading or trailing decimal point. " The expressions below ensure that all valid number literals are " highlighted, and invalid number literals are not. For example, " " - a decimal point in '4.' at the end of a line is highlighted, " - a second dot in 1.0.0 is not highlighted, " - 08 is not highlighted, " - 08e0 or 08j are highlighted, " " and so on, as specified in the 'Python Language Reference'. " https://docs.python.org/2/reference/lexical_analysis.html#numeric-literals " https://docs.python.org/3/reference/lexical_analysis.html#numeric-literals if !exists("python_no_number_highlight") " numbers (including longs and complex) syn match pythonNumber "\<0[oO]\=\o\+[Ll]\=\>" syn match pythonNumber "\<0[xX]\x\+[Ll]\=\>" syn match pythonNumber "\<0[bB][01]\+[Ll]\=\>" syn match pythonNumber "\<\%([1-9]\d*\|0\)[Ll]\=\>" syn match pythonNumber "\<\d\+[jJ]\>" syn match pythonNumber "\<\d\+[eE][+-]\=\d\+[jJ]\=\>" syn match pythonNumber \ "\<\d\+\.\%([eE][+-]\=\d\+\)\=[jJ]\=\%(\W\|$\)\@=" syn match pythonNumber \ "\%(^\|\W\)\zs\d*\.\d\+\%([eE][+-]\=\d\+\)\=[jJ]\=\>" endif " Group the built-ins in the order in the 'Python Library Reference' for " easier comparison. " https://docs.python.org/2/library/constants.html " https://docs.python.org/3/library/constants.html " http://docs.python.org/2/library/functions.html " http://docs.python.org/3/library/functions.html " http://docs.python.org/2/library/functions.html#non-essential-built-in-functions " http://docs.python.org/3/library/functions.html#non-essential-built-in-functions " Python built-in functions are in alphabetical order. if !exists("python_no_builtin_highlight") " built-in constants " 'False', 'True', and 'None' are also reserved words in Python 3 syn keyword pythonBuiltin False True None syn keyword pythonBuiltin NotImplemented Ellipsis __debug__ " built-in functions syn keyword pythonBuiltin abs all any bin bool bytearray callable chr syn keyword pythonBuiltin classmethod compile complex delattr dict dir syn keyword pythonBuiltin divmod enumerate eval filter float format syn keyword pythonBuiltin frozenset getattr globals hasattr hash syn keyword pythonBuiltin help hex id input int isinstance syn keyword pythonBuiltin issubclass iter len list locals map max syn keyword pythonBuiltin memoryview min next object oct open ord pow syn keyword pythonBuiltin print property range repr reversed round set syn keyword pythonBuiltin setattr slice sorted staticmethod str syn keyword pythonBuiltin sum super tuple type vars zip __import__ " Python 2 only syn keyword pythonBuiltin basestring cmp execfile file syn keyword pythonBuiltin long raw_input reduce reload unichr syn keyword pythonBuiltin unicode xrange " Python 3 only syn keyword pythonBuiltin ascii bytes exec " non-essential built-in functions; Python 2 only syn keyword pythonBuiltin apply buffer coerce intern " avoid highlighting attributes as builtins syn match pythonAttribute /\.\h\w*/hs=s+1 contains=ALLBUT,pythonBuiltin transparent endif " From the 'Python Library Reference' class hierarchy at the bottom. " http://docs.python.org/2/library/exceptions.html " http://docs.python.org/3/library/exceptions.html if !exists("python_no_exception_highlight") " builtin base exceptions (used mostly as base classes for other exceptions) syn keyword pythonExceptions BaseException Exception syn keyword pythonExceptions ArithmeticError BufferError syn keyword pythonExceptions LookupError " builtin base exceptions removed in Python 3 syn keyword pythonExceptions EnvironmentError StandardError " builtin exceptions (actually raised) syn keyword pythonExceptions AssertionError AttributeError syn keyword pythonExceptions EOFError FloatingPointError GeneratorExit syn keyword pythonExceptions ImportError IndentationError syn keyword pythonExceptions IndexError KeyError KeyboardInterrupt syn keyword pythonExceptions MemoryError NameError NotImplementedError syn keyword pythonExceptions OSError OverflowError ReferenceError syn keyword pythonExceptions RuntimeError StopIteration SyntaxError syn keyword pythonExceptions SystemError SystemExit TabError TypeError syn keyword pythonExceptions UnboundLocalError UnicodeError syn keyword pythonExceptions UnicodeDecodeError UnicodeEncodeError syn keyword pythonExceptions UnicodeTranslateError ValueError syn keyword pythonExceptions ZeroDivisionError " builtin OS exceptions in Python 3 syn keyword pythonExceptions BlockingIOError BrokenPipeError syn keyword pythonExceptions ChildProcessError ConnectionAbortedError syn keyword pythonExceptions ConnectionError ConnectionRefusedError syn keyword pythonExceptions ConnectionResetError FileExistsError syn keyword pythonExceptions FileNotFoundError InterruptedError syn keyword pythonExceptions IsADirectoryError NotADirectoryError syn keyword pythonExceptions PermissionError ProcessLookupError syn keyword pythonExceptions RecursionError StopAsyncIteration syn keyword pythonExceptions TimeoutError " builtin exceptions deprecated/removed in Python 3 syn keyword pythonExceptions IOError VMSError WindowsError " builtin warnings syn keyword pythonExceptions BytesWarning DeprecationWarning FutureWarning syn keyword pythonExceptions ImportWarning PendingDeprecationWarning syn keyword pythonExceptions RuntimeWarning SyntaxWarning UnicodeWarning syn keyword pythonExceptions UserWarning Warning " builtin warnings in Python 3 syn keyword pythonExceptions ResourceWarning endif if exists("python_space_error_highlight") " trailing whitespace syn match pythonSpaceError display excludenl "\s\+$" " mixed tabs and spaces syn match pythonSpaceError display " \+\t" syn match pythonSpaceError display "\t\+ " endif " Do not spell doctests inside strings. " Notice that the end of a string, either ''', or """, will end the contained " doctest too. Thus, we do *not* need to have it as an end pattern. if !exists("python_no_doctest_highlight") if !exists("python_no_doctest_code_highlight") syn region pythonDoctest \ start="^\s*>>>\s" end="^\s*$" \ contained contains=ALLBUT,pythonDoctest,@Spell syn region pythonDoctestValue \ start=+^\s*\%(>>>\s\|\.\.\.\s\|"""\|'''\)\@!\S\++ end="$" \ contained else syn region pythonDoctest \ start="^\s*>>>" end="^\s*$" \ contained contains=@NoSpell endif endif " Sync at the beginning of class, function, or method definition. syn sync match pythonSync grouphere NONE "^\s*\%(def\|class\)\s\+\h\w*\s*(" if version >= 508 || !exists("did_python_syn_inits") if version <= 508 let did_python_syn_inits = 1 command -nargs=+ HiLink hi link else command -nargs=+ HiLink hi def link endif " The default highlight links. Can be overridden later. HiLink pythonStatement Statement HiLink pythonConditional Conditional HiLink pythonRepeat Repeat HiLink pythonOperator Operator HiLink pythonException Exception HiLink pythonInclude Include HiLink pythonAsync Statement HiLink pythonDecorator Define HiLink pythonFunction Function HiLink pythonComment Comment HiLink pythonTodo Todo HiLink pythonString String HiLink pythonRawString String HiLink pythonQuotes String HiLink pythonTripleQuotes pythonQuotes HiLink pythonEscape Special if !exists("python_no_number_highlight") HiLink pythonNumber Number endif if !exists("python_no_builtin_highlight") HiLink pythonBuiltin Function endif if !exists("python_no_exception_highlight") HiLink pythonExceptions Structure endif if exists("python_space_error_highlight") HiLink pythonSpaceError Error endif if !exists("python_no_doctest_highlight") HiLink pythonDoctest Special HiLink pythonDoctestValue Define endif delcommand HiLink endif let b:current_syntax = "python" let &cpo = s:cpo_save unlet s:cpo_save " vim:set sw=2 sts=2 ts=8 noet: vim-7.4.1689/runtime/syntax/qf.vim000066400000000000000000000011241267703067000167270ustar00rootroot00000000000000" Vim syntax file " Language: Quickfix window " Maintainer: Bram Moolenaar " 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 vim-7.4.1689/runtime/syntax/quake.vim000066400000000000000000000205321267703067000174330ustar00rootroot00000000000000" Vim syntax file " Language: Quake[1-3] configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2007-06-17 " 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 " Credits: Tomasz Kalkosinski wrote the original quake3Colors stuff if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim setlocal iskeyword+=-,+ syn keyword quakeTodo contained TODO FIXME XXX NOTE syn region quakeComment display oneline start='//' end='$' end=';' \ keepend contains=quakeTodo,@Spell syn region quakeString display oneline start=+"+ skip=+\\\\\|\\"+ \ end=+"\|$+ contains=quakeNumbers, \ @quakeCommands,@quake3Colors syn case ignore syn match quakeNumbers display transparent '\<-\=\d\|\.\d' \ contains=quakeNumber,quakeFloat, \ quakeOctalError,quakeOctal syn match quakeNumber contained display '\d\+\>' syn match quakeFloat contained display '\d\+\.\d*' syn match quakeFloat contained display '\.\d\+\>' if exists("quake_is_quake1") || exists("quake_is_quake2") syn match quakeOctal contained display '0\o\+\>' \ contains=quakeOctalZero syn match quakeOctalZero contained display '\<0' syn match quakeOctalError contained display '0\o*[89]\d*' endif 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 if exists("quake_is_quake3") syn cluster quake3Colors contains=quake3Red,quake3Green,quake3Yellow, \ quake3Blue,quake3Cyan,quake3Purple,quake3White, \ quake3Orange,quake3Grey,quake3Black,quake3Shadow syn region quake3Red contained start=+\^1+hs=e+1 end=+[$^"\n]+he=e-1 syn region quake3Green contained start=+\^2+hs=e+1 end=+[$^"\n]+he=e-1 syn region quake3Yellow contained start=+\^3+hs=e+1 end=+[$^"\n]+he=e-1 syn region quake3Blue contained start=+\^4+hs=e+1 end=+[$^"\n]+he=e-1 syn region quake3Cyan contained start=+\^5+hs=e+1 end=+[$^"\n]+he=e-1 syn region quake3Purple contained start=+\^6+hs=e+1 end=+[$^"\n]+he=e-1 syn region quake3White contained start=+\^7+hs=e+1 end=+[$^"\n]+he=e-1 syn region quake3Orange contained start=+\^8+hs=e+1 end=+[$^\"\n]+he=e-1 syn region quake3Grey contained start=+\^9+hs=e+1 end=+[$^"\n]+he=e-1 syn region quake3Black contained start=+\^0+hs=e+1 end=+[$^"\n]+he=e-1 syn region quake3Shadow contained start=+\^[Xx]+hs=e+1 end=+[$^"\n]+he=e-1 endif hi def link quakeComment Comment hi def link quakeTodo Todo hi def link quakeString String hi def link quakeNumber Number hi def link quakeOctal Number hi def link quakeOctalZero PreProc hi def link quakeFloat Number hi def link quakeOctalError Error hi def link quakeCommand quakeCommands hi def link quake1Command quakeCommands hi def link quake12Command quakeCommands hi def link quake2Command quakeCommands hi def link quake23Command quakeCommands hi def link quake3Command quakeCommands hi def link quakeCommands Keyword if exists("quake_is_quake3") hi quake3Red ctermfg=Red guifg=Red hi quake3Green ctermfg=Green guifg=Green hi quake3Yellow ctermfg=Yellow guifg=Yellow hi quake3Blue ctermfg=Blue guifg=Blue hi quake3Cyan ctermfg=Cyan guifg=Cyan hi quake3Purple ctermfg=DarkMagenta guifg=Purple hi quake3White ctermfg=White guifg=White hi quake3Black ctermfg=Black guifg=Black hi quake3Orange ctermfg=Brown guifg=Orange hi quake3Grey ctermfg=LightGrey guifg=LightGrey hi quake3Shadow cterm=underline gui=underline endif let b:current_syntax = "quake" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/r.vim000066400000000000000000000212461267703067000165710ustar00rootroot00000000000000" Vim syntax file " Language: R (GNU S) " Maintainer: Jakson Aquino " Former Maintainers: Vaidotas Zemlys " Tom Payne " Contributor: Johannes Ranke " Homepage: https://github.com/jalvesaq/R-Vim-runtime " Last Change: Thu Mar 10, 2016 12:26PM " Filenames: *.R *.r *.Rhistory *.Rt " " NOTE: The highlighting of R functions is defined in " runtime files created by a filetype plugin, if installed. " " CONFIGURATION: " Syntax folding can be turned on by " " let r_syntax_folding = 1 " " ROxygen highlighting can be turned off by " " let r_hl_roxygen = 0 " " Some lines of code were borrowed from Zhuojun Chen. if exists("b:current_syntax") finish endif setlocal iskeyword=@,48-57,_,. if exists("g:r_syntax_folding") && g:r_syntax_folding setlocal foldmethod=syntax endif if !exists("g:r_hl_roxygen") let g:r_hl_roxygen = 1 endif syn case match " Comment syn match rCommentTodo contained "\(BUG\|FIXME\|NOTE\|TODO\):" syn match rComment contains=@Spell,rCommentTodo,rOBlock "#.*" " Roxygen if g:r_hl_roxygen syn region rOBlock start="^\s*\n#\{1,2}' " start="\%^#\{1,2}' " end="^\(#\{1,2}'\)\@!" contains=rOTitle,rOKeyword,rOExamples,@Spell keepend syn region rOTitle start="^\s*\n#\{1,2}' " start="\%^#\{1,2}' " end="^\(#\{1,2}'\s*$\)\@=" contained contains=rOCommentKey syn match rOCommentKey "#\{1,2}'" containedin=rOTitle contained syn region rOExamples start="^#\{1,2}' @examples.*"rs=e+1,hs=e+1 end="^\(#\{1,2}' @.*\)\@=" end="^\(#\{1,2}'\)\@!" contained contains=rOKeyword syn match rOKeyword contained "@\(param\|return\|name\|rdname\|examples\|example\|include\|docType\)" syn match rOKeyword contained "@\(S3method\|TODO\|aliases\|alias\|assignee\|author\|callGraphDepth\|callGraph\)" syn match rOKeyword contained "@\(callGraphPrimitives\|concept\|exportClass\|exportMethod\|exportPattern\|export\|formals\)" syn match rOKeyword contained "@\(format\|importClassesFrom\|importFrom\|importMethodsFrom\|import\|keywords\|useDynLib\)" syn match rOKeyword contained "@\(method\|noRd\|note\|references\|seealso\|setClass\|slot\|source\|title\|usage\)" syn match rOKeyword contained "@\(family\|template\|templateVar\|description\|details\|inheritParams\|field\)" endif if &filetype == "rhelp" " string enclosed in double quotes syn region rString contains=rSpecial,@Spell start=/"/ skip=/\\\\\|\\"/ end=/"/ " string enclosed in single quotes syn region rString contains=rSpecial,@Spell start=/'/ skip=/\\\\\|\\'/ end=/'/ else " string enclosed in double quotes syn region rString contains=rSpecial,rStrError,@Spell start=/"/ skip=/\\\\\|\\"/ end=/"/ " string enclosed in single quotes syn region rString contains=rSpecial,rStrError,@Spell start=/'/ skip=/\\\\\|\\'/ end=/'/ endif syn match rStrError display contained "\\." " New line, carriage return, tab, backspace, bell, feed, vertical tab, backslash syn match rSpecial display contained "\\\(n\|r\|t\|b\|a\|f\|v\|'\|\"\)\|\\\\" " Hexadecimal and Octal digits syn match rSpecial display contained "\\\(x\x\{1,2}\|[0-8]\{1,3}\)" " Unicode characters syn match rSpecial display contained "\\u\x\{1,4}" syn match rSpecial display contained "\\U\x\{1,8}" syn match rSpecial display contained "\\u{\x\{1,4}}" syn match rSpecial display contained "\\U{\x\{1,8}}" " Statement syn keyword rStatement break next return syn keyword rConditional if else syn keyword rRepeat for in repeat while " Constant (not really) syn keyword rConstant T F LETTERS letters month.abb month.name pi syn keyword rConstant R.version.string syn keyword rNumber NA_integer_ NA_real_ NA_complex_ NA_character_ " Constants syn keyword rConstant NULL syn keyword rBoolean FALSE TRUE syn keyword rNumber NA Inf NaN " integer syn match rInteger "\<\d\+L" syn match rInteger "\<0x\([0-9]\|[a-f]\|[A-F]\)\+L" syn match rInteger "\<\d\+[Ee]+\=\d\+L" " number with no fractional part or exponent syn match rNumber "\<\d\+\>" " hexadecimal number syn match rNumber "\<0x\([0-9]\|[a-f]\|[A-F]\)\+" " 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\+" " complex number syn match rComplex "\<\d\+i" syn match rComplex "\<\d\++\d\+i" syn match rComplex "\<0x\([0-9]\|[a-f]\|[A-F]\)\+i" syn match rComplex "\<\d\+\.\d*\([Ee][-+]\=\d\+\)\=i" syn match rComplex "\<\.\d\+\([Ee][-+]\=\d\+\)\=i" syn match rComplex "\<\d\+[Ee][-+]\=\d\+i" syn match rAssign '=' syn match rOperator "&" syn match rOperator '-' syn match rOperator '\*' syn match rOperator '+' if &filetype != "rmd" && &filetype != "rrst" syn match rOperator "[|!<>^~/:]" else syn match rOperator "[|!<>^~`/:]" endif syn match rOperator "%\{2}\|%\S\{-}%" syn match rOperator '\([!><]\)\@<==' syn match rOperator '==' syn match rOpError '\*\{3}' syn match rOpError '//' syn match rOpError '&&&' syn match rOpError '|||' syn match rOpError '<<' syn match rOpError '>>' syn match rAssign "<\{1,2}-" syn match rAssign "->\{1,2}" " Special syn match rDelimiter "[,;:]" " Error if exists("g:r_syntax_folding") syn region rRegion matchgroup=Delimiter start=/(/ matchgroup=Delimiter end=/)/ transparent contains=ALLBUT,rError,rBraceError,rCurlyError fold syn region rRegion matchgroup=Delimiter start=/{/ matchgroup=Delimiter end=/}/ transparent contains=ALLBUT,rError,rBraceError,rParenError fold syn region rRegion matchgroup=Delimiter start=/\[/ matchgroup=Delimiter end=/]/ transparent contains=ALLBUT,rError,rCurlyError,rParenError fold else 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 endif syn match rError "[)\]}]" syn match rBraceError "[)}]" contained syn match rCurlyError "[)\]]" contained syn match rParenError "[\]}]" contained if !exists("g:R_hi_fun") let g:R_hi_fun = 1 endif if g:R_hi_fun " Nvim-R: runtime R/functions.vim " Vim-R-plugin: runtime r-plugin/functions.vim endif syn match rDollar display contained "\$" syn match rDollar display contained "@" " List elements will not be highlighted as functions: syn match rLstElmt "\$[a-zA-Z0-9\\._]*" contains=rDollar syn match rLstElmt "@[a-zA-Z0-9\\._]*" contains=rDollar " Functions that may add new objects syn keyword rPreProc library require attach detach source if &filetype == "rhelp" syn match rHelpIdent '\\method' syn match rHelpIdent '\\S4method' endif " Type syn keyword rType array category character complex double function integer list logical matrix numeric vector data.frame " Name of object with spaces if &filetype != "rmd" && &filetype != "rrst" syn region rNameWSpace start="`" end="`" endif if &filetype == "rhelp" syn match rhPreProc "^#ifdef.*" syn match rhPreProc "^#endif.*" syn match rhSection "\\dontrun\>" endif if exists("r_syn_minlines") exe "syn sync minlines=" . r_syn_minlines else syn sync minlines=40 endif " Define the default highlighting. hi def link rAssign Statement hi def link rBoolean Boolean hi def link rBraceError Error hi def link rComment Comment hi def link rCommentTodo Todo hi def link rComplex Number hi def link rConditional Conditional hi def link rConstant Constant hi def link rCurlyError Error hi def link rDelimiter Delimiter hi def link rDollar SpecialChar hi def link rError Error hi def link rFloat Float hi def link rFunction Function hi def link rHelpIdent Identifier hi def link rhPreProc PreProc hi def link rhSection PreCondit hi def link rInteger Number hi def link rLstElmt Normal hi def link rNameWSpace Normal hi def link rNumber Number hi def link rOperator Operator hi def link rOpError Error hi def link rParenError Error hi def link rPreProc PreProc hi def link rRepeat Repeat hi def link rSpecial SpecialChar hi def link rStatement Statement hi def link rString String hi def link rStrError Error hi def link rType Type if g:r_hl_roxygen hi def link rOKeyword Title hi def link rOBlock Comment hi def link rOTitle Title hi def link rOCommentKey Comment hi def link rOExamples SpecialComment endif let b:current_syntax="r" " vim: ts=8 sw=2 vim-7.4.1689/runtime/syntax/racc.vim000066400000000000000000000127471267703067000172460ustar00rootroot00000000000000" Vim default file " Language: Racc input file " Maintainer: Nikolai Weibull " Latest Revision: 2008-06-22 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn keyword raccTodo contained TODO FIXME XXX NOTE syn region raccComment start='/\*' end='\*/' \ contains=raccTodo,@Spell syn region raccComment display oneline start='#' end='$' \ contains=raccTodo,@Spell syn region raccClass transparent matchgroup=raccKeyword \ start='\' end='\'he=e-4 \ contains=raccComment,raccPrecedence, \ raccTokenDecl,raccExpect,raccOptions,raccConvert, \ raccStart, syn region raccPrecedence transparent matchgroup=raccKeyword \ start='\' end='\' \ contains=raccComment,raccPrecSpec syn keyword raccPrecSpec contained nonassoc left right \ nextgroup=raccPrecToken,raccPrecString skipwhite \ skipnl syn match raccPrecToken contained '\<\u[A-Z0-9_]*\>' \ nextgroup=raccPrecToken,raccPrecString skipwhite \ skipnl syn region raccPrecString matchgroup=raccPrecString start=+"+ \ skip=+\\\\\|\\"+ end=+"+ \ contains=raccSpecial \ nextgroup=raccPrecToken,raccPrecString skipwhite \ skipnl syn region raccPrecString matchgroup=raccPrecString start=+'+ \ skip=+\\\\\|\\'+ end=+'+ contains=raccSpecial \ nextgroup=raccPrecToken,raccPrecString skipwhite \ skipnl syn keyword raccTokenDecl contained token \ nextgroup=raccTokenR skipwhite skipnl syn match raccTokenR contained '\<\u[A-Z0-9_]*\>' \ nextgroup=raccTokenR skipwhite skipnl syn keyword raccExpect contained expect \ nextgroup=raccNumber skipwhite skipnl syn match raccNumber contained '\<\d\+\>' syn keyword raccOptions contained options \ nextgroup=raccOptionsR skipwhite skipnl syn keyword raccOptionsR contained omit_action_call result_var \ nextgroup=raccOptionsR skipwhite skipnl syn region raccConvert transparent contained matchgroup=raccKeyword \ start='\' end='\' \ contains=raccComment,raccConvToken skipwhite \ skipnl syn match raccConvToken contained '\<\u[A-Z0-9_]*\>' \ nextgroup=raccString skipwhite skipnl syn keyword raccStart contained start \ nextgroup=raccTargetS skipwhite skipnl syn match raccTargetS contained '\<\l[a-z0-9_]*\>' syn match raccSpecial contained '\\["'\\]' syn region raccString start=+"+ skip=+\\\\\|\\"+ end=+"+ \ contains=raccSpecial syn region raccString start=+'+ skip=+\\\\\|\\'+ end=+'+ \ contains=raccSpecial syn region raccRules transparent matchgroup=raccKeyword start='\' \ end='\' contains=raccComment,raccString, \ raccNumber,raccToken,raccTarget,raccDelimiter, \ raccAction syn match raccTarget contained '\<\l[a-z0-9_]*\>' syn match raccDelimiter contained '[:|]' syn match raccToken contained '\<\u[A-Z0-9_]*\>' syn include @raccRuby syntax/ruby.vim syn region raccAction transparent matchgroup=raccDelimiter \ start='{' end='}' contains=@raccRuby syn region raccHeader transparent matchgroup=raccPreProc \ start='^---- header.*' end='^----'he=e-4 \ contains=@raccRuby syn region raccInner transparent matchgroup=raccPreProc \ start='^---- inner.*' end='^----'he=e-4 \ contains=@raccRuby syn region raccFooter transparent matchgroup=raccPreProc \ start='^---- footer.*' end='^----'he=e-4 \ contains=@raccRuby syn sync match raccSyncHeader grouphere raccHeader '^---- header' syn sync match raccSyncInner grouphere raccInner '^---- inner' syn sync match raccSyncFooter grouphere raccFooter '^---- footer' hi def link raccTodo Todo hi def link raccComment Comment hi def link raccPrecSpec Type hi def link raccPrecToken raccToken hi def link raccPrecString raccString hi def link raccTokenDecl Keyword hi def link raccToken Identifier hi def link raccTokenR raccToken hi def link raccExpect Keyword hi def link raccNumber Number hi def link raccOptions Keyword hi def link raccOptionsR Identifier hi def link raccConvToken raccToken hi def link raccStart Keyword hi def link raccTargetS Type hi def link raccSpecial special hi def link raccString String hi def link raccTarget Type hi def link raccDelimiter Delimiter hi def link raccPreProc PreProc hi def link raccKeyword Keyword let b:current_syntax = "racc" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/radiance.vim000066400000000000000000000166511267703067000201020ustar00rootroot00000000000000" Vim syntax file " Language: Radiance Scene Description " Maintainer: Georg Mischler " 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="\" end="\<\k*\>" contains=radianceExtraType syn region radianceID start="\" end="\<\k*\>" contains=radianceExtraType syn region radianceID start="\" end="\<\k*\>" contains=radianceSurfType syn region radianceID start="\" end="\<\k*\>" contains=radianceSurfType syn region radianceID start="\" end="\<\k*\>" contains=radianceSurfType syn region radianceID start="\" end="\<\k*\>" contains=radianceSurfType syn region radianceID start="\" end="\<\k*\>" contains=radianceSurfType syn region radianceID start="\" end="\<\k*\>" contains=radianceSurfType syn region radianceID start="\" end="\<\k*\>" contains=radianceSurfType syn region radianceID start="\" end="\<\k*\>" contains=radianceSurfType syn region radianceID start="\" end="\<\k*\>" contains=radianceSurfType syn region radianceID start="\" end="\<\k*\>" contains=radianceLightType syn region radianceID start="\" end="\<\k*\>" contains=radianceLightType syn region radianceID start="\" end="\<\k*\>" contains=radianceLightType syn region radianceID start="\" end="\<\k*\>" contains=radianceLightType syn region radianceID start="\" end="\<\k*\>" contains=radianceMatType syn region radianceID start="\" end="\<\k*\>" contains=radianceMatType syn region radianceID start="\" end="\<\k*\>" contains=radianceMatType syn region radianceID start="\" end="\<\k*\>" contains=radianceMatType syn region radianceID start="\" end="\<\k*\>" contains=radianceMatType syn region radianceID start="\" end="\<\k*\>" contains=radianceMatType syn region radianceID start="\" end="\<\k*\>" contains=radianceMatType syn region radianceID start="\" end="\<\k*\>" contains=radianceMatType syn region radianceID start="\" end="\<\k*\>" contains=radianceMatType syn region radianceID start="\" end="\<\k*\>" contains=radianceMatType syn region radianceID start="\" end="\<\k*\>" contains=radianceMatType syn region radianceID start="\" end="\<\k*\>" contains=radianceMatType syn region radianceID start="\" end="\<\k*\>" contains=radianceMatType syn region radianceID start="\" end="\<\k*\>" contains=radianceMatType syn region radianceID start="\" end="\<\k*\>" contains=radianceMatType syn region radianceID start="\" end="\<\k*\>" contains=radianceMatType syn region radianceID start="\" end="\<\k*\>" contains=radianceMatType syn region radianceID start="\" end="\<\k*\>" contains=radianceMatType syn region radianceID start="\" end="\<\k*\>" contains=radianceMatType syn region radianceID start="\" end="\<\k*\>" contains=radianceMatType syn region radianceID start="\" end="\<\k*\>" contains=radianceMatType syn region radianceID start="\" end="\<\k*\>" contains=radiancePatType syn region radianceID start="\" end="\<\k*\>" contains=radiancePatType syn region radianceID start="\" end="\<\k*\>" contains=radiancePatType syn region radianceID start="\" end="\<\k*\>" contains=radiancePatType syn region radianceID start="\" end="\<\k*\>" contains=radiancePatType syn region radianceID start="\" end="\<\k*\>" contains=radiancePatType syn region radianceID start="\" end="\<\k*\>" contains=radiancePatType syn region radianceID start="\" end="\<\k*\>" contains=radianceTexType syn region radianceID start="\" end="\<\k*\>" contains=radianceTexType syn region radianceID start="\" end="\<\k*\>" contains=radianceMixType syn region radianceID start="\" end="\<\k*\>" contains=radianceMixType syn region radianceID start="\" 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/ratpoison.vim000066400000000000000000000423011267703067000203410ustar00rootroot00000000000000" Vim syntax file " Language: Ratpoison configuration/commands file ( /etc/ratpoisonrc ~/.ratpoisonrc ) " Maintainer: Magnus Woldrich " URL: http://github.com/trapd00r/vim-syntax-ratpoison " Last Change: 2011 Apr 11 " Previous Maintainer: Doug Kearns " For version 5.x: Clear all syntax items " 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 chdir contained syn keyword ratpoisonCommandArg clrunmanaged cnext colon compat cother contained syn keyword ratpoisonCommandArg cprev curframe dedicate definekey delete contained syn keyword ratpoisonCommandArg delkmap describekey echo escape exec contained syn keyword ratpoisonCommandArg fdump focus focusdown focuslast focusleft contained syn keyword ratpoisonCommandArg focusprev focusright focusup frestore fselect contained syn keyword ratpoisonCommandArg gdelete getenv getsel gmerge gmove contained syn keyword ratpoisonCommandArg gnew gnewbg gnext gprev gravity contained syn keyword ratpoisonCommandArg groups gselect help hsplit inext contained syn keyword ratpoisonCommandArg info iother iprev kill lastmsg contained syn keyword ratpoisonCommandArg license link listhook meta msgwait contained syn keyword ratpoisonCommandArg newkmap newwm next nextscreen number contained syn keyword ratpoisonCommandArg only other prev prevscreen prompt contained syn keyword ratpoisonCommandArg putsel quit ratclick rathold ratrelwarp contained syn keyword ratpoisonCommandArg ratwarp readkey redisplay redo remhook contained syn keyword ratpoisonCommandArg remove resize restart rudeness sdump contained syn keyword ratpoisonCommandArg select set setenv sfdump shrink contained syn keyword ratpoisonCommandArg source sselect startup_message time title contained syn keyword ratpoisonCommandArg tmpwm unalias undefinekey undo unmanage contained syn keyword ratpoisonCommandArg unsetenv verbexec version vsplit warp contained syn keyword ratpoisonCommandArg windows 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 fwcolor syn keyword ratpoisonSetArg bwcolor syn keyword ratpoisonSetArg historysize syn keyword ratpoisonSetArg historycompaction syn keyword ratpoisonSetArg historyexpansion syn keyword ratpoisonSetArg topkmap syn keyword ratpoisonSetArg barinpadding 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*\zsdedicate\ze\s*" nextgroup=ratpoisonNumberArg syn match ratpoisonStringCommand "^\s*\zsdefinekey\ze\s*" syn match ratpoisonStringCommand "^\s*\zsdelkmap\ze\s*" syn match ratpoisonStringCommand "^\s*\zsdescribekey\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*\zsprompt\ze\s*" syn match ratpoisonStringCommand "^\s*\zsratwarp\ze\s*" syn match ratpoisonStringCommand "^\s*\zsratrelwarp\ze\s*" syn match ratpoisonStringCommand "^\s*\zsratclick\ze\s*" syn match ratpoisonStringCommand "^\s*\zsrathold\ze\s*" 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*\zssselect\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*\zsundefinekey\ze\s*" 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*\zscnext\ze\s*$" syn match ratpoisonVoidCommand "^\s*\zscompat\ze\s*$" syn match ratpoisonVoidCommand "^\s*\zscother\ze\s*$" syn match ratpoisonVoidCommand "^\s*\zscprev\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*\zsfocusprev\ze\s*$" syn match ratpoisonVoidCommand "^\s*\zsfocusright\ze\s*$" syn match ratpoisonVoidCommand "^\s*\zsfocusup\ze\s*$" syn match ratpoisonVoidCommand "^\s*\zsfocus\ze\s*$" syn match ratpoisonVoidCommand "^\s*\zsfselect\ze\s*$" syn match ratpoisonVoidCommand "^\s*\zsgetsel\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*\zsinext\ze\s*$" syn match ratpoisonVoidCommand "^\s*\zsinfo\ze\s*$" syn match ratpoisonVoidCommand "^\s*\zsiother\ze\s*$" syn match ratpoisonVoidCommand "^\s*\zsiprev\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*\zsnextscreen\ze\s*$" syn match ratpoisonVoidCommand "^\s*\zsnext\ze\s*$" syn match ratpoisonVoidCommand "^\s*\zsonly\ze\s*$" syn match ratpoisonVoidCommand "^\s*\zsother\ze\s*$" syn match ratpoisonVoidCommand "^\s*\zsprevscreen\ze\s*$" syn match ratpoisonVoidCommand "^\s*\zsprev\ze\s*$" syn match ratpoisonVoidCommand "^\s*\zsputsel\ze\s*$" syn match ratpoisonVoidCommand "^\s*\zsquit\ze\s*$" syn match ratpoisonVoidCommand "^\s*\zsredisplay\ze\s*$" syn match ratpoisonVoidCommand "^\s*\zsredo\ze\s*$" syn match ratpoisonVoidCommand "^\s*\zsremove\ze\s*$" syn match ratpoisonVoidCommand "^\s*\zsrestart\ze\s*$" syn match ratpoisonVoidCommand "^\s*\zssdump\ze\s*$" syn match ratpoisonVoidCommand "^\s*\zssfdump\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*\zsundo\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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/rc.vim000066400000000000000000000245141267703067000167350ustar00rootroot00000000000000" Vim syntax file " Language: M$ Resource files (*.rc) " Maintainer: Christian Brabandt " Last Change: 2015-05-29 " Repository: https://github.com/chrisbra/vim-rc-syntax " License: Vim (see :h license) " Previous Maintainer: Heiko Erhardt " 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 RTEXT 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/rcs.vim000066400000000000000000000047351267703067000171230ustar00rootroot00000000000000" Vim syntax file " Language: RCS file " Maintainer: Dmitry Vasiliev " URL: https://github.com/hdima/vim-scripts/blob/master/syntax/rcs.vim " Last Change: 2012-02-11 " Filenames: *,v " Version: 1.12 " 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 else command -nargs=+ HiLink hi def link 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" vim-7.4.1689/runtime/syntax/rcslog.vim000066400000000000000000000017121267703067000176150ustar00rootroot00000000000000" Vim syntax file " Language: RCS log output " Maintainer: Joe Karthauser " 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 else command -nargs=+ HiLink hi def link endif HiLink rcslogFile Type HiLink rcslogRevision Constant HiLink rcslogDate Identifier delcommand HiLink endif let b:current_syntax = "rcslog" " vim: ts=8 vim-7.4.1689/runtime/syntax/readline.vim000066400000000000000000000403661267703067000201170ustar00rootroot00000000000000" Vim syntax file " Language: readline(3) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2012-04-25 " readline_has_bash - if defined add support for bash specific " settings/functions if exists('b:current_syntax') finish endif let s:cpo_save = &cpo set cpo&vim setlocal iskeyword+=- syn match readlineKey contained \ '\S' \ nextgroup=readlineKeyTerminator syn match readlineBegin display '^' \ nextgroup=readlineComment, \ readlineConditional, \ readlineInclude, \ readlineKeyName, \ readlineKey, \ readlineKeySeq, \ readlineKeyword \ skipwhite syn region readlineComment contained display oneline \ start='#' \ end='$' \ contains=readlineTodo, \ @Spell syn keyword readlineTodo contained \ TODO \ FIXME \ XXX \ NOTE syn match readlineConditional contained \ '$if\>' \ nextgroup=readlineTest, \ readlineTestApp \ skipwhite syn keyword readlineTest contained \ mode \ nextgroup=readlineTestModeEq syn match readlineTestModeEq contained \ '=' \ nextgroup=readlineEditingMode syn keyword readlineTest contained \ term \ nextgroup=readlineTestTermEq syn match readlineTestTermEq contained \ '=' \ nextgroup=readlineTestTerm syn match readlineTestTerm contained \ '\S\+' syn match readlineTestApp contained \ '\S\+' syn match readlineConditional contained display \ '$\%(else\|endif\)\>' syn match readlineInclude contained display \ '$include\>' \ nextgroup=readlinePath syn match readlinePath contained display \ '.\+' syn case ignore syn match readlineKeyName contained display \ nextgroup=readlineKeySeparator, \ readlineKeyTerminator \ '\%(Control\|Del\|Esc\|Escape\|LFD\|Meta\|Newline\|Ret\|Return\|Rubout\|Space\|Spc\|Tab\)' syn case match syn match readlineKeySeparator contained \ '-' \ nextgroup=readlineKeyName, \ readlineKey syn match readlineKeyTerminator contained \ ':' \ nextgroup=readlineFunction \ skipwhite syn region readlineKeySeq contained display oneline \ start=+"+ \ skip=+\\\\\|\\"+ \ end=+"+ \ contains=readlineKeyEscape \ nextgroup=readlineKeyTerminator syn match readlineKeyEscape contained display \ +\\\([CM]-\|[e\\"'abdfnrtv]\|\o\{3}\|x\x\{2}\)+ syn keyword readlineKeyword contained \ set \ nextgroup=readlineVariable \ skipwhite syn keyword readlineVariable contained \ nextgroup=readlineBellStyle \ skipwhite \ bell-style syn keyword readlineVariable contained \ nextgroup=readlineBoolean \ skipwhite \ bind-tty-special-chars \ completion-ignore-case \ completion-map-case \ convert-meta \ disable-completion \ echo-control-characters \ enable-keypad \ enable-meta-key \ expand-tilde \ history-preserve-point \ horizontal-scroll-mode \ input-meta \ meta-flag \ mark-directories \ mark-modified-lines \ mark-symlinked-directories \ match-hidden-files \ menu-complete-display-prefix \ output-meta \ page-completions \ print-completions-horizontally \ revert-all-at-newline \ show-all-if-ambiguous \ show-all-if-unmodified \ skip-completed-text \ visible-stats syn keyword readlineVariable contained \ nextgroup=readlineString \ skipwhite \ comment-begin \ isearch-terminators syn keyword readlineVariable contained \ nextgroup=readlineNumber \ skipwhite \ completion-display-width \ completion-prefix-display-length \ completion-query-items \ history-size syn keyword readlineVariable contained \ nextgroup=readlineEditingMode \ skipwhite \ editing-mode syn keyword readlineVariable contained \ nextgroup=readlineKeymap \ skipwhite \ keymap syn keyword readlineBellStyle contained \ audible \ visible \ none syn case ignore syn keyword readlineBoolean contained \ on \ off syn case match syn region readlineString contained display oneline \ matchgroup=readlineStringDelimiter \ start=+"+ \ skip=+\\\\\|\\"+ \ end=+"+ syn match readlineNumber contained display \ '[+-]\d\+\>' syn keyword readlineEditingMode contained \ emacs \ vi syn match readlineKeymap contained display \ 'emacs\%(-\%(standard\|meta\|ctlx\)\)\=\|vi\%(-\%(move\|command\|insert\)\)\=' syn keyword readlineFunction contained \ beginning-of-line \ end-of-line \ forward-char \ backward-char \ forward-word \ backward-word \ clear-screen \ redraw-current-line \ \ accept-line \ previous-history \ next-history \ beginning-of-history \ end-of-history \ reverse-search-history \ forward-search-history \ non-incremental-reverse-search-history \ non-incremental-forward-search-history \ history-search-forward \ history-search-backward \ yank-nth-arg \ yank-last-arg \ \ delete-char \ backward-delete-char \ forward-backward-delete-char \ quoted-insert \ tab-insert \ self-insert \ transpose-chars \ transpose-words \ upcase-word \ downcase-word \ capitalize-word \ overwrite-mode \ \ kill-line \ backward-kill-line \ unix-line-discard \ kill-whole-line \ kill-word \ backward-kill-word \ unix-word-rubout \ unix-filename-rubout \ delete-horizontal-space \ kill-region \ copy-region-as-kill \ copy-backward-word \ copy-forward-word \ yank \ yank-pop \ \ digit-argument \ universal-argument \ \ complete \ possible-completions \ insert-completions \ menu-complete \ menu-complete-backward \ delete-char-or-list \ \ start-kbd-macro \ end-kbd-macro \ call-last-kbd-macro \ \ re-read-init-file \ abort \ do-uppercase-version \ prefix-meta \ undo \ revert-line \ tilde-expand \ set-mark \ exchange-point-and-mark \ character-search \ character-search-backward \ skip-csi-sequence \ insert-comment \ dump-functions \ dump-variables \ dump-macros \ emacs-editing-mode \ vi-editing-mode \ \ vi-eof-maybe \ vi-movement-mode \ vi-undo \ vi-match \ vi-tilde-expand \ vi-complete \ vi-char-search \ vi-redo \ vi-search \ vi-arg-digit \ vi-append-eol \ vi-prev-word \ vi-change-to \ vi-delete-to \ vi-end-word \ vi-char-search \ vi-fetch-history \ vi-insert-beg \ vi-search-again \ vi-put \ vi-replace \ vi-subst \ vi-char-search \ vi-next-word \ vi-yank-to \ vi-first-print \ vi-yank-arg \ vi-goto-mark \ vi-append-mode \ vi-prev-word \ vi-change-to \ vi-delete-to \ vi-end-word \ vi-char-search \ vi-insert-mode \ vi-set-mark \ vi-search-again \ vi-put \ vi-change-char \ vi-subst \ vi-char-search \ vi-undo \ vi-next-word \ vi-delete \ vi-yank-to \ vi-column \ vi-change-case if exists("readline_has_bash") syn keyword readlineFunction contained \ shell-expand-line \ history-expand-line \ magic-space \ alias-expand-line \ history-and-alias-expand-line \ insert-last-argument \ operate-and-get-next \ forward-backward-delete-char \ delete-char-or-list \ complete-filename \ possible-filename-completions \ complete-username \ possible-username-completions \ complete-variable \ possible-variable-completions \ complete-hostname \ possible-hostname-completions \ complete-command \ possible-command-completions \ dynamic-complete-history \ complete-into-braces \ glob-expand-word \ glob-list-expansions \ display-shell-version \ glob-complete-word \ edit-and-execute-command endif hi def link readlineKey readlineKeySeq hi def link readlineComment Comment hi def link readlineTodo Todo hi def link readlineConditional Conditional hi def link readlineTest Type hi def link readlineDelimiter Delimiter hi def link readlineTestModeEq readlineEq hi def link readlineTestTermEq readlineEq hi def link readlineTestTerm readlineString hi def link readlineTestAppEq readlineEq hi def link readlineTestApp readlineString hi def link readlineInclude Include hi def link readlinePath String hi def link readlineKeyName SpecialChar hi def link readlineKeySeparator readlineKeySeq hi def link readlineKeyTerminator readlineDelimiter hi def link readlineKeySeq String hi def link readlineKeyEscape SpecialChar hi def link readlineKeyword Keyword hi def link readlineVariable Identifier hi def link readlineBellStyle Constant hi def link readlineBoolean Boolean hi def link readlineString String hi def link readlineStringDelimiter readlineString hi def link readlineNumber Number hi def link readlineEditingMode Constant hi def link readlineKeymap Constant hi def link readlineFunction Function let b:current_syntax = 'readline' let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/rebol.vim000066400000000000000000000165751267703067000174440ustar00rootroot00000000000000" Vim syntax file " Language: Rebol " Maintainer: Mike Williams " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/redif.vim000066400000000000000000002536421267703067000174300ustar00rootroot00000000000000" Vim syntax file " Language: ReDIF " Maintainer: Axel Castellane " Last Change: 2013 April 17 " Original Author: Axel Castellane " Source: http://openlib.org/acmes/root/docu/redif_1.html " File Extension: rdf " Note: The ReDIF format is used by RePEc. " To be compatible with Vim 5.8 use: if version < 600 syntax clear elseif exists("b:current_syntax") finish endif " ReDIF is case-insensitive syntax case ignore " Structure: Some fields determine what fields can come next. For example: " Template-Type " *-Name " File-URL " *-Institution " Those fields span a syntax region over several lines so that these regions " can only contain their respective items. " Any line which is not a correct template or part of an argument is an error. " This comes at the very beginning, so it has the lowest priority and will " only match if nothing else did. syntax match redifWrongLine /^.\+/ display highlight def link redifWrongLine redifError " Comments must start with # and it must be the first character of the line, " otherwise I believe that they are considered as part of an argument. syntax match redifComment /^#.*/ containedin=ALL display " Defines the 9 possible multi-lines regions of Template-Type and the fields " they can contain. syntax region redifRegionTemplatePaper start=/^Template-Type:\_s*ReDIF-Paper \d\+\.\d\+/ end=/^Template-Type:/me=s-1 contains=redifContainerFieldsPaper,redifWrongLine,redifRegionClusterAuthor,redifRegionClusterFile fold syntax region redifRegionTemplateArticle start=/^Template-Type:\_s*ReDIF-Article \d\+\.\d\+/ end=/^Template-Type:/me=s-1 contains=redifContainerFieldsArticle,redifWrongLine,redifRegionClusterAuthor,redifRegionClusterFile fold syntax region redifRegionTemplateChapter start=/^Template-Type:\_s*ReDIF-Chapter \d\+\.\d\+/ end=/^Template-Type:/me=s-1 contains=redifContainerFieldsChapter,redifWrongLine,redifRegionClusterAuthor,redifRegionClusterFile,redifRegionClusterProvider,redifRegionClusterPublisher,redifRegionClusterEditor fold syntax region redifRegionTemplateBook start=/^Template-Type:\_s*ReDIF-Book \d\+\.\d\+/ end=/^Template-Type:/me=s-1 contains=redifContainerFieldsBook,redifWrongLine,redifRegionClusterAuthor,redifRegionClusterFile,redifRegionClusterProvider,redifRegionClusterPublisher,redifRegionClusterEditor fold syntax region redifRegionTemplateSoftware start=/^Template-Type:\_s*ReDIF-Software \d\+\.\d\+/ end=/^Template-Type:/me=s-1 contains=redifContainerFieldsSoftware,redifWrongLine,redifRegionClusterAuthor,redifRegionClusterFile fold syntax region redifRegionTemplateArchive start=/^Template-Type:\_s*ReDIF-Archive \d\+\.\d\+/ end=/^Template-Type:/me=s-1 contains=redifContainerFieldsArchive,redifWrongLine fold syntax region redifRegionTemplateSeries start=/^Template-Type:\_s*ReDIF-Series \d\+\.\d\+/ end=/^Template-Type:/me=s-1 contains=redifContainerFieldsSeries,redifWrongLine,redifRegionClusterProvider,redifRegionClusterPublisher,redifRegionClusterEditor fold syntax region redifRegionTemplateInstitution start=/^Template-Type:\_s*ReDIF-Institution \d\+\.\d\+/ end=/^Template-Type:/me=s-1 contains=redifContainerFieldsInstitution,redifWrongLine,redifRegionClusterPrimary,redifRegionClusterSecondary,redifRegionClusterTertiary,redifRegionClusterQuaternary fold syntax region redifRegionTemplatePerson start=/^Template-Type:\_s*ReDIF-Person \d\+\.\d\+/ end=/^Template-Type:/me=s-1 contains=redifContainerFieldsPerson,redifWrongLine,redifRegionClusterWorkplace fold " All fields are foldable (These come before clusters, so they have lower " priority). So they are contained in a foldable syntax region. syntax region redifContainerFieldsPaper start=/^\S\{-}:/ end=/^\S\{-}:/me=s-1 contains=redifFieldTitle,redifFieldHandleOfWork,redifFieldLanguage,redifFieldContactEmail,redifFieldAbstract,redifFieldClassificationJEL,redifFieldKeywords,redifFieldNumber,redifFieldCreationDate,redifFieldRevisionDate,redifFieldPublicationStatus,redifFieldNote,redifFieldLength,redifFieldSeries,redifFieldAvailability,redifFieldOrderURL,redifFieldArticleHandle,redifFieldBookHandle,redifFieldChapterHandle,redifFieldPaperHandle,redifFieldSoftwareHandle,redifFieldRestriction,redifFieldPrice,redifFieldNotification,redifFieldPublicationType,redifFieldTemplateType,redifWrongLine contained transparent fold syntax region redifContainerFieldsArticle start=/^\S\{-}:/ end=/^\S\{-}:/me=s-1 contains=redifFieldTitle,redifFieldHandleOfWork,redifFieldLanguage,redifFieldContactEmail,redifFieldAbstract,redifFieldClassificationJEL,redifFieldKeywords,redifFieldNumber,redifFieldCreationDate,redifFieldPublicationStatus,redifFieldOrderURL,redifFieldArticleHandle,redifFieldBookHandle,redifFieldChapterHandle,redifFieldPaperHandle,redifFieldSoftwareHandle,redifFieldRestriction,redifFieldPrice,redifFieldNotification,redifFieldPublicationType,redifFieldJournal,redifFieldVolume,redifFieldYear,redifFieldIssue,redifFieldMonth,redifFieldPages,redifFieldNumber,redifFieldArticleHandle,redifFieldBookHandle,redifFieldChapterHandle,redifFieldPaperHandle,redifFieldSoftwareHandle,redifFieldTemplateType,redifWrongLine contained transparent fold syntax region redifContainerFieldsChapter start=/^\S\{-}:/ end=/^\S\{-}:/me=s-1 contains=redifFieldHandleOfWork,redifFieldTitle,redifFieldContactEmail,redifFieldAbstract,redifFieldClassificationJEL,redifFieldKeywords,redifFieldBookTitle,redifFieldYear,redifFieldMonth,redifFieldPages,redifFieldChapter,redifFieldVolume,redifFieldEdition,redifFieldSeries,redifFieldISBN,redifFieldPublicationStatus,redifFieldNote,redifFieldInBook,redifFieldOrderURL,redifFieldArticleHandle,redifFieldBookHandle,redifFieldChapterHandle,redifFieldPaperHandle,redifFieldSoftwareHandle,redifFieldTemplateType,redifWrongLine contained transparent fold syntax region redifContainerFieldsBook start=/^\S\{-}:/ end=/^\S\{-}:/me=s-1 contains=redifFieldTitle,redifFieldHandleOfWork,redifFieldContactEmail,redifFieldYear,redifFieldMonth,redifFieldVolume,redifFieldEdition,redifFieldSeries,redifFieldISBN,redifFieldPublicationStatus,redifFieldNote,redifFieldAbstract,redifFieldClassificationJEL,redifFieldKeywords,redifFieldHasChapter,redifFieldPrice,redifFieldOrderURL,redifFieldNumber,redifFieldCreationDate,redifFieldPublicationDate,redifFieldArticleHandle,redifFieldBookHandle,redifFieldChapterHandle,redifFieldPaperHandle,redifFieldSoftwareHandle,redifFieldTemplateType,redifWrongLine contained transparent fold syntax region redifContainerFieldsSoftware start=/^\S\{-}:/ end=/^\S\{-}:/me=s-1 contains=redifFieldHandleOfWork,redifFieldTitle,redifFieldProgrammingLanguage,redifFieldAbstract,redifFieldNumber,redifFieldVersion,redifFieldClassificationJEL,redifFieldKeywords,redifFieldSize,redifFieldSeries,redifFieldCreationDate,redifFieldRevisionDate,redifFieldNote,redifFieldRequires,redifFieldArticleHandle,redifFieldBookHandle,redifFieldChapterHandle,redifFieldPaperHandle,redifFieldSoftwareHandle,redifFieldTemplateType,redifWrongLine contained transparent fold syntax region redifContainerFieldsArchive start=/^\S\{-}:/ end=/^\S\{-}:/me=s-1 contains=redifFieldHandleOfArchive,redifFieldURL,redifFieldMaintainerEmail,redifFieldName,redifFieldMaintainerName,redifFieldMaintainerPhone,redifFieldMaintainerFax,redifFieldClassificationJEL,redifFieldHomepage,redifFieldDescription,redifFieldNotification,redifFieldRestriction,redifFieldTemplateType,redifWrongLine contained transparent fold syntax region redifContainerFieldsSeries start=/^\S\{-}:/ end=/^\S\{-}:/me=s-1 contains=redifFieldName,redifFieldHandleOfSeries,redifFieldMaintainerEmail,redifFieldType,redifFieldOrderEmail,redifFieldOrderHomepage,redifFieldOrderPostal,redifFieldPrice,redifFieldRestriction,redifFieldMaintainerPhone,redifFieldMaintainerFax,redifFieldMaintainerName,redifFieldDescription,redifFieldClassificationJEL,redifFieldKeywords,redifFieldNotification,redifFieldISSN,redifFieldFollowup,redifFieldPredecessor,redifFieldTemplateType,redifWrongLine contained transparent fold syntax region redifContainerFieldsInstitution start=/^\S\{-}:/ end=/^\S\{-}:/me=s-1 contains=redifFieldHandleOfInstitution,redifFieldPrimaryDefunct,redifFieldSecondaryDefunct,redifFieldTertiaryDefunct,redifFieldTemplateType,redifWrongLine contained transparent fold syntax region redifContainerFieldsPerson start=/^\S\{-}:/ end=/^\S\{-}:/me=s-1 contains=redifFieldHandleOfPerson,redifFieldNameFull,redifFieldNameFirst,redifFieldNameLast,redifFieldNamePrefix,redifFieldNameMiddle,redifFieldNameSuffix,redifFieldNameASCII,redifFieldEmail,redifFieldHomepage,redifFieldFax,redifFieldPostal,redifFieldPhone,redifFieldWorkplaceOrganization,redifFieldAuthorPaper,redifFieldAuthorArticle,redifFieldAuthorSoftware,redifFieldAuthorBook,redifFieldAuthorChapter,redifFieldEditorBook,redifFieldEditorSeries,redifFieldClassificationJEL,redifFieldShortId,redifFieldLastLoginDate,redifFieldRegisteredDate,redifWrongLine contained transparent fold " Defines the 10 possible clusters and what they can contain " A field not in the cluster ends the cluster. syntax region redifRegionClusterWorkplace start=/^Workplace-Name:/ skip=/^Workplace-\%(Name-English\|Homepage\|Postal\|Location\|Email\|Phone\|Fax\|Institution\):/ end=/^\S\{-}:/me=s-1 contained contains=redifWrongLine,redifContainerFieldsWorkplace fold syntax region redifRegionClusterPrimary start=/^Primary-Name:/ skip=/^Primary-\%(Name-English\|Homepage\|Postal\|Location\|Email\|Phone\|Fax\|Institution\):/ end=/^\S\{-}:/me=s-1 contained contains=redifWrongLine,redifContainerFieldsPrimary fold syntax region redifRegionClusterSecondary start=/^Secondary-Name:/ skip=/^Secondary-\%(Name-English\|Homepage\|Postal\|Location\|Email\|Phone\|Fax\|Institution\):/ end=/^\S\{-}:/me=s-1 contained contains=redifWrongLine,redifContainerFieldsSecondary fold syntax region redifRegionClusterTertiary start=/^Tertiary-Name:/ skip=/^Tertiary-\%(Name-English\|Homepage\|Postal\|Location\|Email\|Phone\|Fax\|Institution\):/ end=/^\S\{-}:/me=s-1 contained contains=redifWrongLine,redifContainerFieldsTertiary fold syntax region redifRegionClusterQuaternary start=/^Quaternary-Name:/ skip=/^Quaternary-\%(Name-English\|Homepage\|Postal\|Location\|Email\|Phone\|Fax\|Institution\):/ end=/^\S\{-}:/me=s-1 contained contains=redifWrongLine,redifContainerFieldsQuaternary fold syntax region redifRegionClusterProvider start=/^Provider-Name:/ skip=/^Provider-\%(Name-English\|Homepage\|Postal\|Location\|Email\|Phone\|Fax\|Institution\):/ end=/^\S\{-}:/me=s-1 contained contains=redifWrongLine,redifContainerFieldsProvider fold syntax region redifRegionClusterPublisher start=/^Publisher-Name:/ skip=/^Publisher-\%(Name-English\|Homepage\|Postal\|Location\|Email\|Phone\|Fax\|Institution\):/ end=/^\S\{-}:/me=s-1 contained contains=redifWrongLine,redifContainerFieldsPublisher fold syntax region redifRegionClusterAuthor start=/^Author-Name:/ skip=/^Author-\%(Name\%(-First\|-Last\)\|Homepage\|Email\|Fax\|Postal\|Phone\|Person\|Workplace-Name\):/ end=/^\S\{-}:/me=s-1 contained contains=redifWrongLine,redifRegionClusterAuthorWorkplace,redifContainerFieldsAuthor fold syntax region redifRegionClusterEditor start=/^Editor-Name:/ skip=/^Editor-\%(Name\%(-First\|-Last\)\|Homepage\|Email\|Fax\|Postal\|Phone\|Person\|Workplace-Name\):/ end=/^\S\{-}:/me=s-1 contained contains=redifWrongLine,redifRegionClusterEditorWorkplace,redifContainerFieldsEditor fold syntax region redifRegionClusterFile start=/^File-URL:/ skip=/^File-\%(Format\|Function\|Size\|Restriction\):/ end=/^\S\{-}:/me=s-1 contained contains=redifWrongLine,redifContainerFieldsFile fold " The foldable containers of the clusters. syntax region redifContainerFieldsWorkplace start=/^\S\{-}:/ end=/^\S\{-}:/me=s-1 contains=redifFieldWorkplaceName,redifFieldWorkplaceHomepage,redifFieldWorkplaceNameEnglish,redifFieldWorkplacePostal,redifFieldWorkplaceLocation,redifFieldWorkplaceEmail,redifFieldWorkplacePhone,redifFieldWorkplaceFax,redifFieldWorkplaceInstitution,redifWrongLine contained transparent fold syntax region redifContainerFieldsPrimary start=/^\S\{-}:/ end=/^\S\{-}:/me=s-1 contains=redifFieldPrimaryName,redifFieldPrimaryHomepage,redifFieldPrimaryNameEnglish,redifFieldPrimaryPostal,redifFieldPrimaryLocation,redifFieldPrimaryEmail,redifFieldPrimaryPhone,redifFieldPrimaryFax,redifFieldPrimaryInstitution,redifWrongLine contained transparent fold syntax region redifContainerFieldsSecondary start=/^\S\{-}:/ end=/^\S\{-}:/me=s-1 contains=redifFieldSecondaryName,redifFieldSecondaryHomepage,redifFieldSecondaryNameEnglish,redifFieldSecondaryPostal,redifFieldSecondaryLocation,redifFieldSecondaryEmail,redifFieldSecondaryPhone,redifFieldSecondaryFax,redifFieldSecondaryInstitution,redifWrongLine contained transparent fold syntax region redifContainerFieldsTertiary start=/^\S\{-}:/ end=/^\S\{-}:/me=s-1 contains=redifFieldTertiaryName,redifFieldTertiaryHomepage,redifFieldTertiaryNameEnglish,redifFieldTertiaryPostal,redifFieldTertiaryLocation,redifFieldTertiaryEmail,redifFieldTertiaryPhone,redifFieldTertiaryFax,redifFieldTertiaryInstitution,redifWrongLine contained transparent fold syntax region redifContainerFieldsQuaternary start=/^\S\{-}:/ end=/^\S\{-}:/me=s-1 contains=redifFieldQuaternaryName,redifFieldQuaternaryHomepage,redifFieldQuaternaryNameEnglish,redifFieldQuaternaryPostal,redifFieldQuaternaryLocation,redifFieldQuaternaryEmail,redifFieldQuaternaryPhone,redifFieldQuaternaryFax,redifFieldQuaternaryInstitution,redifWrongLine contained transparent fold syntax region redifContainerFieldsProvider start=/^\S\{-}:/ end=/^\S\{-}:/me=s-1 contains=redifFieldProviderName,redifFieldProviderHomepage,redifFieldProviderNameEnglish,redifFieldProviderPostal,redifFieldProviderLocation,redifFieldProviderEmail,redifFieldProviderPhone,redifFieldProviderFax,redifFieldProviderInstitution,redifWrongLine contained transparent fold syntax region redifContainerFieldsPublisher start=/^\S\{-}:/ end=/^\S\{-}:/me=s-1 contains=redifFieldPublisherName,redifFieldPublisherHomepage,redifFieldPublisherNameEnglish,redifFieldPublisherPostal,redifFieldPublisherLocation,redifFieldPublisherEmail,redifFieldPublisherPhone,redifFieldPublisherFax,redifFieldPublisherInstitution,redifWrongLine contained transparent fold syntax region redifContainerFieldsAuthor start=/^\S\{-}:/ end=/^\S\{-}:/me=s-1 contains=redifFieldAuthorName,redifFieldAuthorNameFirst,redifFieldAuthorNameLast,redifFieldAuthorHomepage,redifFieldAuthorEmail,redifFieldAuthorFax,redifFieldAuthorPostal,redifFieldAuthorPhone,redifFieldAuthorPerson,redifWrongLine contained transparent fold syntax region redifContainerFieldsEditor start=/^\S\{-}:/ end=/^\S\{-}:/me=s-1 contains=redifFieldEditorName,redifFieldEditorNameFirst,redifFieldEditorNameLast,redifFieldEditorHomepage,redifFieldEditorEmail,redifFieldEditorFax,redifFieldEditorPostal,redifFieldEditorPhone,redifFieldEditorPerson,redifWrongLine contained transparent fold syntax region redifContainerFieldsFile start=/^\S\{-}:/ end=/^\S\{-}:/me=s-1 contains=redifFieldFileURL,redifFieldFileFormat,redifFieldFileFunction,redifFieldFileSize,redifFieldFileRestriction,redifWrongLine contained transparent fold " The two clusters in cluster (must be presented after to have priority over " fields containers) syntax region redifRegionClusterAuthorWorkplace start=/^Author-Workplace-Name:/ skip=/^Author-Workplace-\%(Name-English\|Homepage\|Postal\|Location\|Email\|Phone\|Fax\|Institution\):/ end=/^\S\{-}:/me=s-1 contained contains=redifWrongLine,redifContainerFieldsAuthorWorkplace fold syntax region redifRegionClusterEditorWorkplace start=/^Editor-Workplace-Name:/ skip=/^Editor-Workplace-\%(Name-English\|Homepage\|Postal\|Location\|Email\|Phone\|Fax\|Institution\):/ end=/^\S\{-}:/me=s-1 contained contains=redifWrongLine,redifContainerFieldsEditorWorkplace fold " Their foldable fields containers syntax region redifContainerFieldsAuthorWorkplace start=/^\S\{-}:/ end=/^\S\{-}:/me=s-1 contains=redifFieldAuthorWorkplaceName,redifFieldAuthorWorkplaceHomepage,redifFieldAuthorWorkplaceNameEnglish,redifFieldAuthorWorkplacePostal,redifFieldAuthorWorkplaceLocation,redifFieldAuthorWorkplaceEmail,redifFieldAuthorWorkplacePhone,redifFieldAuthorWorkplaceFax,redifFieldAuthorWorkplaceInstitution,redifWrongLine contained transparent fold syntax region redifContainerFieldsEditorWorkplace start=/^\S\{-}:/ end=/^\S\{-}:/me=s-1 contains=redifFieldEditorWorkplaceName,redifFieldEditorWorkplaceHomepage,redifFieldEditorWorkplaceNameEnglish,redifFieldEditorWorkplacePostal,redifFieldEditorWorkplaceLocation,redifFieldEditorWorkplaceEmail,redifFieldEditorWorkplacePhone,redifFieldEditorWorkplaceFax,redifFieldEditorWorkplaceInstitution,redifWrongLine contained transparent fold " All the possible fields " Note: The "Handle" field is handled a little bit differently, because it " does not have the same meaning depending on the Template-Type. See: " /redifFieldHandleOf.... syntax match redifFieldAbstract /^Abstract:/ skipwhite skipempty nextgroup=redifArgumentAbstract contained syntax match redifFieldArticleHandle /^Article-Handle:/ skipwhite skipempty nextgroup=redifArgumentArticleHandle contained syntax match redifFieldAuthorArticle /^Author-Article:/ skipwhite skipempty nextgroup=redifArgumentAuthorArticle contained syntax match redifFieldAuthorBook /^Author-Book:/ skipwhite skipempty nextgroup=redifArgumentAuthorBook contained syntax match redifFieldAuthorChapter /^Author-Chapter:/ skipwhite skipempty nextgroup=redifArgumentAuthorChapter contained syntax match redifFieldAuthorEmail /^Author-Email:/ skipwhite skipempty nextgroup=redifArgumentAuthorEmail contained syntax match redifFieldAuthorFax /^Author-Fax:/ skipwhite skipempty nextgroup=redifArgumentAuthorFax contained syntax match redifFieldAuthorHomepage /^Author-Homepage:/ skipwhite skipempty nextgroup=redifArgumentAuthorHomepage contained syntax match redifFieldAuthorName /^Author-Name:/ skipwhite skipempty nextgroup=redifArgumentAuthorName contained syntax match redifFieldAuthorNameFirst /^Author-Name-First:/ skipwhite skipempty nextgroup=redifArgumentAuthorNameFirst contained syntax match redifFieldAuthorNameLast /^Author-Name-Last:/ skipwhite skipempty nextgroup=redifArgumentAuthorNameLast contained syntax match redifFieldAuthorPaper /^Author-Paper:/ skipwhite skipempty nextgroup=redifArgumentAuthorPaper contained syntax match redifFieldAuthorPerson /^Author-Person:/ skipwhite skipempty nextgroup=redifArgumentAuthorPerson contained syntax match redifFieldAuthorPhone /^Author-Phone:/ skipwhite skipempty nextgroup=redifArgumentAuthorPhone contained syntax match redifFieldAuthorPostal /^Author-Postal:/ skipwhite skipempty nextgroup=redifArgumentAuthorPostal contained syntax match redifFieldAuthorSoftware /^Author-Software:/ skipwhite skipempty nextgroup=redifArgumentAuthorSoftware contained syntax match redifFieldAuthorWorkplaceEmail /^Author-Workplace-Email:/ skipwhite skipempty nextgroup=redifArgumentAuthorWorkplaceEmail contained syntax match redifFieldAuthorWorkplaceFax /^Author-Workplace-Fax:/ skipwhite skipempty nextgroup=redifArgumentAuthorWorkplaceFax contained syntax match redifFieldAuthorWorkplaceHomepage /^Author-Workplace-Homepage:/ skipwhite skipempty nextgroup=redifArgumentAuthorWorkplaceHomepage contained syntax match redifFieldAuthorWorkplaceInstitution /^Author-Workplace-Institution:/ skipwhite skipempty nextgroup=redifArgumentAuthorWorkplaceInstitution contained syntax match redifFieldAuthorWorkplaceLocation /^Author-Workplace-Location:/ skipwhite skipempty nextgroup=redifArgumentAuthorWorkplaceLocation contained syntax match redifFieldAuthorWorkplaceName /^Author-Workplace-Name:/ skipwhite skipempty nextgroup=redifArgumentAuthorWorkplaceName contained syntax match redifFieldAuthorWorkplaceNameEnglish /^Author-Workplace-Name-English:/ skipwhite skipempty nextgroup=redifArgumentAuthorWorkplaceNameEnglish contained syntax match redifFieldAuthorWorkplacePhone /^Author-Workplace-Phone:/ skipwhite skipempty nextgroup=redifArgumentAuthorWorkplacePhone contained syntax match redifFieldAuthorWorkplacePostal /^Author-Workplace-Postal:/ skipwhite skipempty nextgroup=redifArgumentAuthorWorkplacePostal contained syntax match redifFieldAvailability /^Availability:/ skipwhite skipempty nextgroup=redifArgumentAvailability contained syntax match redifFieldBookHandle /^Book-Handle:/ skipwhite skipempty nextgroup=redifArgumentBookHandle contained syntax match redifFieldBookTitle /^Book-Title:/ skipwhite skipempty nextgroup=redifArgumentBookTitle contained syntax match redifFieldChapterHandle /^Chapter-Handle:/ skipwhite skipempty nextgroup=redifArgumentChapterHandle contained syntax match redifFieldChapter /^Chapter:/ skipwhite skipempty nextgroup=redifArgumentChapter contained syntax match redifFieldClassificationJEL /^Classification-JEL:/ skipwhite skipempty nextgroup=redifArgumentClassificationJEL contained syntax match redifFieldContactEmail /^Contact-Email:/ skipwhite skipempty nextgroup=redifArgumentContactEmail contained syntax match redifFieldCreationDate /^Creation-Date:/ skipwhite skipempty nextgroup=redifArgumentCreationDate contained syntax match redifFieldDescription /^Description:/ skipwhite skipempty nextgroup=redifArgumentDescription contained syntax match redifFieldEdition /^Edition:/ skipwhite skipempty nextgroup=redifArgumentEdition contained syntax match redifFieldEditorBook /^Editor-Book:/ skipwhite skipempty nextgroup=redifArgumentEditorBook contained syntax match redifFieldEditorEmail /^Editor-Email:/ skipwhite skipempty nextgroup=redifArgumentEditorEmail contained syntax match redifFieldEditorFax /^Editor-Fax:/ skipwhite skipempty nextgroup=redifArgumentEditorFax contained syntax match redifFieldEditorHomepage /^Editor-Homepage:/ skipwhite skipempty nextgroup=redifArgumentEditorHomepage contained syntax match redifFieldEditorName /^Editor-Name:/ skipwhite skipempty nextgroup=redifArgumentEditorName contained syntax match redifFieldEditorNameFirst /^Editor-Name-First:/ skipwhite skipempty nextgroup=redifArgumentEditorNameFirst contained syntax match redifFieldEditorNameLast /^Editor-Name-Last:/ skipwhite skipempty nextgroup=redifArgumentEditorNameLast contained syntax match redifFieldEditorPerson /^Editor-Person:/ skipwhite skipempty nextgroup=redifArgumentEditorPerson contained syntax match redifFieldEditorPhone /^Editor-Phone:/ skipwhite skipempty nextgroup=redifArgumentEditorPhone contained syntax match redifFieldEditorPostal /^Editor-Postal:/ skipwhite skipempty nextgroup=redifArgumentEditorPostal contained syntax match redifFieldEditorSeries /^Editor-Series:/ skipwhite skipempty nextgroup=redifArgumentEditorSeries contained syntax match redifFieldEditorWorkplaceEmail /^Editor-Workplace-Email:/ skipwhite skipempty nextgroup=redifArgumentEditorWorkplaceEmail contained syntax match redifFieldEditorWorkplaceFax /^Editor-Workplace-Fax:/ skipwhite skipempty nextgroup=redifArgumentEditorWorkplaceFax contained syntax match redifFieldEditorWorkplaceHomepage /^Editor-Workplace-Homepage:/ skipwhite skipempty nextgroup=redifArgumentEditorWorkplaceHomepage contained syntax match redifFieldEditorWorkplaceInstitution /^Editor-Workplace-Institution:/ skipwhite skipempty nextgroup=redifArgumentEditorWorkplaceInstitution contained syntax match redifFieldEditorWorkplaceLocation /^Editor-Workplace-Location:/ skipwhite skipempty nextgroup=redifArgumentEditorWorkplaceLocation contained syntax match redifFieldEditorWorkplaceName /^Editor-Workplace-Name:/ skipwhite skipempty nextgroup=redifArgumentEditorWorkplaceName contained syntax match redifFieldEditorWorkplaceNameEnglish /^Editor-Workplace-Name-English:/ skipwhite skipempty nextgroup=redifArgumentEditorWorkplaceNameEnglish contained syntax match redifFieldEditorWorkplacePhone /^Editor-Workplace-Phone:/ skipwhite skipempty nextgroup=redifArgumentEditorWorkplacePhone contained syntax match redifFieldEditorWorkplacePostal /^Editor-Workplace-Postal:/ skipwhite skipempty nextgroup=redifArgumentEditorWorkplacePostal contained syntax match redifFieldEmail /^Email:/ skipwhite skipempty nextgroup=redifArgumentEmail contained syntax match redifFieldFax /^Fax:/ skipwhite skipempty nextgroup=redifArgumentFax contained syntax match redifFieldFileFormat /^File-Format:/ skipwhite skipempty nextgroup=redifArgumentFileFormat contained syntax match redifFieldFileFunction /^File-Function:/ skipwhite skipempty nextgroup=redifArgumentFileFunction contained syntax match redifFieldFileRestriction /^File-Restriction:/ skipwhite skipempty nextgroup=redifArgumentFileRestriction contained syntax match redifFieldFileSize /^File-Size:/ skipwhite skipempty nextgroup=redifArgumentFileSize contained syntax match redifFieldFileURL /^File-URL:/ skipwhite skipempty nextgroup=redifArgumentFileURL contained syntax match redifFieldFollowup /^Followup:/ skipwhite skipempty nextgroup=redifArgumentFollowup contained syntax match redifFieldHandleOfArchive /^Handle:/ skipwhite skipempty nextgroup=redifArgumentHandleOfArchive contained syntax match redifFieldHandleOfInstitution /^Handle:/ skipwhite skipempty nextgroup=redifArgumentHandleOfInstitution contained syntax match redifFieldHandleOfPerson /^Handle:/ skipwhite skipempty nextgroup=redifArgumentHandleOfPerson contained syntax match redifFieldHandleOfSeries /^Handle:/ skipwhite skipempty nextgroup=redifArgumentHandleOfSeries contained syntax match redifFieldHandleOfWork /^Handle:/ skipwhite skipempty nextgroup=redifArgumentHandleOfWork contained syntax match redifFieldHasChapter /^HasChapter:/ skipwhite skipempty nextgroup=redifArgumentHasChapter contained syntax match redifFieldHomepage /^Homepage:/ skipwhite skipempty nextgroup=redifArgumentHomepage contained syntax match redifFieldInBook /^In-Book:/ skipwhite skipempty nextgroup=redifArgumentInBook contained syntax match redifFieldISBN /^ISBN:/ skipwhite skipempty nextgroup=redifArgumentISBN contained syntax match redifFieldISSN /^ISSN:/ skipwhite skipempty nextgroup=redifArgumentISSN contained syntax match redifFieldIssue /^Issue:/ skipwhite skipempty nextgroup=redifArgumentIssue contained syntax match redifFieldJournal /^Journal:/ skipwhite skipempty nextgroup=redifArgumentJournal contained syntax match redifFieldKeywords /^Keywords:/ skipwhite skipempty nextgroup=redifArgumentKeywords contained syntax match redifFieldKeywords /^Keywords:/ skipwhite skipempty nextgroup=redifArgumentKeywords contained syntax match redifFieldLanguage /^Language:/ skipwhite skipempty nextgroup=redifArgumentLanguage contained syntax match redifFieldLastLoginDate /^Last-Login-Date:/ skipwhite skipempty nextgroup=redifArgumentLastLoginDate contained syntax match redifFieldLength /^Length:/ skipwhite skipempty nextgroup=redifArgumentLength contained syntax match redifFieldMaintainerEmail /^Maintainer-Email:/ skipwhite skipempty nextgroup=redifArgumentMaintainerEmail contained syntax match redifFieldMaintainerFax /^Maintainer-Fax:/ skipwhite skipempty nextgroup=redifArgumentMaintainerFax contained syntax match redifFieldMaintainerName /^Maintainer-Name:/ skipwhite skipempty nextgroup=redifArgumentMaintainerName contained syntax match redifFieldMaintainerPhone /^Maintainer-Phone:/ skipwhite skipempty nextgroup=redifArgumentMaintainerPhone contained syntax match redifFieldMonth /^Month:/ skipwhite skipempty nextgroup=redifArgumentMonth contained syntax match redifFieldNameASCII /^Name-ASCII:/ skipwhite skipempty nextgroup=redifArgumentNameASCII contained syntax match redifFieldNameFirst /^Name-First:/ skipwhite skipempty nextgroup=redifArgumentNameFirst contained syntax match redifFieldNameFull /^Name-Full:/ skipwhite skipempty nextgroup=redifArgumentNameFull contained syntax match redifFieldNameLast /^Name-Last:/ skipwhite skipempty nextgroup=redifArgumentNameLast contained syntax match redifFieldNameMiddle /^Name-Middle:/ skipwhite skipempty nextgroup=redifArgumentNameMiddle contained syntax match redifFieldNamePrefix /^Name-Prefix:/ skipwhite skipempty nextgroup=redifArgumentNamePrefix contained syntax match redifFieldNameSuffix /^Name-Suffix:/ skipwhite skipempty nextgroup=redifArgumentNameSuffix contained syntax match redifFieldName /^Name:/ skipwhite skipempty nextgroup=redifArgumentName contained syntax match redifFieldNote /^Note:/ skipwhite skipempty nextgroup=redifArgumentNote contained syntax match redifFieldNotification /^Notification:/ skipwhite skipempty nextgroup=redifArgumentNotification contained syntax match redifFieldNumber /^Number:/ skipwhite skipempty nextgroup=redifArgumentNumber contained syntax match redifFieldOrderEmail /^Order-Email:/ skipwhite skipempty nextgroup=redifArgumentOrderEmail contained syntax match redifFieldOrderHomepage /^Order-Homepage:/ skipwhite skipempty nextgroup=redifArgumentOrderHomepage contained syntax match redifFieldOrderPostal /^Order-Postal:/ skipwhite skipempty nextgroup=redifArgumentOrderPostal contained syntax match redifFieldOrderURL /^Order-URL:/ skipwhite skipempty nextgroup=redifArgumentOrderURL contained syntax match redifFieldPages /^Pages:/ skipwhite skipempty nextgroup=redifArgumentPages contained syntax match redifFieldPaperHandle /^Paper-Handle:/ skipwhite skipempty nextgroup=redifArgumentPaperHandle contained syntax match redifFieldPhone /^Phone:/ skipwhite skipempty nextgroup=redifArgumentPhone contained syntax match redifFieldPostal /^Postal:/ skipwhite skipempty nextgroup=redifArgumentPostal contained syntax match redifFieldPredecessor /^Predecessor:/ skipwhite skipempty nextgroup=redifArgumentPredecessor contained syntax match redifFieldPrice /^Price:/ skipwhite skipempty nextgroup=redifArgumentPrice contained syntax match redifFieldPrimaryDefunct /^Primary-Defunct:/ skipwhite skipempty nextgroup=redifArgumentPrimaryDefunct contained syntax match redifFieldPrimaryEmail /^Primary-Email:/ skipwhite skipempty nextgroup=redifArgumentPrimaryEmail contained syntax match redifFieldPrimaryFax /^Primary-Fax:/ skipwhite skipempty nextgroup=redifArgumentPrimaryFax contained syntax match redifFieldPrimaryHomepage /^Primary-Homepage:/ skipwhite skipempty nextgroup=redifArgumentPrimaryHomepage contained syntax match redifFieldPrimaryInstitution /^Primary-Institution:/ skipwhite skipempty nextgroup=redifArgumentPrimaryInstitution contained syntax match redifFieldPrimaryLocation /^Primary-Location:/ skipwhite skipempty nextgroup=redifArgumentPrimaryLocation contained syntax match redifFieldPrimaryName /^Primary-Name:/ skipwhite skipempty nextgroup=redifArgumentPrimaryName contained syntax match redifFieldPrimaryNameEnglish /^Primary-Name-English:/ skipwhite skipempty nextgroup=redifArgumentPrimaryNameEnglish contained syntax match redifFieldPrimaryPhone /^Primary-Phone:/ skipwhite skipempty nextgroup=redifArgumentPrimaryPhone contained syntax match redifFieldPrimaryPostal /^Primary-Postal:/ skipwhite skipempty nextgroup=redifArgumentPrimaryPostal contained syntax match redifFieldProgrammingLanguage /^Programming-Language:/ skipwhite skipempty nextgroup=redifArgumentProgrammingLanguage contained syntax match redifFieldProviderEmail /^Provider-Email:/ skipwhite skipempty nextgroup=redifArgumentProviderEmail contained syntax match redifFieldProviderFax /^Provider-Fax:/ skipwhite skipempty nextgroup=redifArgumentProviderFax contained syntax match redifFieldProviderHomepage /^Provider-Homepage:/ skipwhite skipempty nextgroup=redifArgumentProviderHomepage contained syntax match redifFieldProviderInstitution /^Provider-Institution:/ skipwhite skipempty nextgroup=redifArgumentProviderInstitution contained syntax match redifFieldProviderLocation /^Provider-Location:/ skipwhite skipempty nextgroup=redifArgumentProviderLocation contained syntax match redifFieldProviderName /^Provider-Name:/ skipwhite skipempty nextgroup=redifArgumentProviderName contained syntax match redifFieldProviderNameEnglish /^Provider-Name-English:/ skipwhite skipempty nextgroup=redifArgumentProviderNameEnglish contained syntax match redifFieldProviderPhone /^Provider-Phone:/ skipwhite skipempty nextgroup=redifArgumentProviderPhone contained syntax match redifFieldProviderPostal /^Provider-Postal:/ skipwhite skipempty nextgroup=redifArgumentProviderPostal contained syntax match redifFieldPublicationDate /^Publication-Date:/ skipwhite skipempty nextgroup=redifArgumentPublicationDate contained syntax match redifFieldPublicationStatus /^Publication-Status:/ skipwhite skipempty nextgroup=redifArgumentPublicationStatus contained syntax match redifFieldPublicationType /^Publication-Type:/ skipwhite skipempty nextgroup=redifArgumentPublicationType contained syntax match redifFieldQuaternaryEmail /^Quaternary-Email:/ skipwhite skipempty nextgroup=redifArgumentQuaternaryEmail contained syntax match redifFieldQuaternaryFax /^Quaternary-Fax:/ skipwhite skipempty nextgroup=redifArgumentQuaternaryFax contained syntax match redifFieldQuaternaryHomepage /^Quaternary-Homepage:/ skipwhite skipempty nextgroup=redifArgumentQuaternaryHomepage contained syntax match redifFieldQuaternaryInstitution /^Quaternary-Institution:/ skipwhite skipempty nextgroup=redifArgumentQuaternaryInstitution contained syntax match redifFieldQuaternaryLocation /^Quaternary-Location:/ skipwhite skipempty nextgroup=redifArgumentQuaternaryLocation contained syntax match redifFieldQuaternaryName /^Quaternary-Name:/ skipwhite skipempty nextgroup=redifArgumentQuaternaryName contained syntax match redifFieldQuaternaryNameEnglish /^Quaternary-Name-English:/ skipwhite skipempty nextgroup=redifArgumentQuaternaryNameEnglish contained syntax match redifFieldQuaternaryPhone /^Quaternary-Phone:/ skipwhite skipempty nextgroup=redifArgumentQuaternaryPhone contained syntax match redifFieldQuaternaryPostal /^Quaternary-Postal:/ skipwhite skipempty nextgroup=redifArgumentQuaternaryPostal contained syntax match redifFieldRegisteredDate /^Registered-Date:/ skipwhite skipempty nextgroup=redifArgumentRegisteredDate contained syntax match redifFieldRequires /^Requires:/ skipwhite skipempty nextgroup=redifArgumentRequires contained syntax match redifFieldRestriction /^Restriction:/ skipwhite skipempty nextgroup=redifArgumentRestriction contained syntax match redifFieldRevisionDate /^Revision-Date:/ skipwhite skipempty nextgroup=redifArgumentRevisionDate contained syntax match redifFieldSecondaryDefunct /^Secondary-Defunct:/ skipwhite skipempty nextgroup=redifArgumentSecondaryDefunct contained syntax match redifFieldSecondaryEmail /^Secondary-Email:/ skipwhite skipempty nextgroup=redifArgumentSecondaryEmail contained syntax match redifFieldSecondaryFax /^Secondary-Fax:/ skipwhite skipempty nextgroup=redifArgumentSecondaryFax contained syntax match redifFieldSecondaryHomepage /^Secondary-Homepage:/ skipwhite skipempty nextgroup=redifArgumentSecondaryHomepage contained syntax match redifFieldSecondaryInstitution /^Secondary-Institution:/ skipwhite skipempty nextgroup=redifArgumentSecondaryInstitution contained syntax match redifFieldSecondaryLocation /^Secondary-Location:/ skipwhite skipempty nextgroup=redifArgumentSecondaryLocation contained syntax match redifFieldSecondaryName /^Secondary-Name:/ skipwhite skipempty nextgroup=redifArgumentSecondaryName contained syntax match redifFieldSecondaryNameEnglish /^Secondary-Name-English:/ skipwhite skipempty nextgroup=redifArgumentSecondaryNameEnglish contained syntax match redifFieldSecondaryPhone /^Secondary-Phone:/ skipwhite skipempty nextgroup=redifArgumentSecondaryPhone contained syntax match redifFieldSecondaryPostal /^Secondary-Postal:/ skipwhite skipempty nextgroup=redifArgumentSecondaryPostal contained syntax match redifFieldSeries /^Series:/ skipwhite skipempty nextgroup=redifArgumentSeries contained syntax match redifFieldShortId /^Short-Id:/ skipwhite skipempty nextgroup=redifArgumentShortId contained syntax match redifFieldSize /^Size:/ skipwhite skipempty nextgroup=redifArgumentSize contained syntax match redifFieldSoftwareHandle /^Software-Handle:/ skipwhite skipempty nextgroup=redifArgumentSoftwareHandle contained syntax match redifFieldTemplateType /^Template-Type:/ skipwhite skipempty nextgroup=redifArgumentTemplateType contained syntax match redifFieldTertiaryDefunct /^Tertiary-Defunct:/ skipwhite skipempty nextgroup=redifArgumentTertiaryDefunct contained syntax match redifFieldTertiaryEmail /^Tertiary-Email:/ skipwhite skipempty nextgroup=redifArgumentTertiaryEmail contained syntax match redifFieldTertiaryFax /^Tertiary-Fax:/ skipwhite skipempty nextgroup=redifArgumentTertiaryFax contained syntax match redifFieldTertiaryHomepage /^Tertiary-Homepage:/ skipwhite skipempty nextgroup=redifArgumentTertiaryHomepage contained syntax match redifFieldTertiaryInstitution /^Tertiary-Institution:/ skipwhite skipempty nextgroup=redifArgumentTertiaryInstitution contained syntax match redifFieldTertiaryLocation /^Tertiary-Location:/ skipwhite skipempty nextgroup=redifArgumentTertiaryLocation contained syntax match redifFieldTertiaryName /^Tertiary-Name:/ skipwhite skipempty nextgroup=redifArgumentTertiaryName contained syntax match redifFieldTertiaryNameEnglish /^Tertiary-Name-English:/ skipwhite skipempty nextgroup=redifArgumentTertiaryNameEnglish contained syntax match redifFieldTertiaryPhone /^Tertiary-Phone:/ skipwhite skipempty nextgroup=redifArgumentTertiaryPhone contained syntax match redifFieldTertiaryPostal /^Tertiary-Postal:/ skipwhite skipempty nextgroup=redifArgumentTertiaryPostal contained syntax match redifFieldTitle /^Title:/ skipwhite skipempty nextgroup=redifArgumentTitle contained syntax match redifFieldType /^Type:/ skipwhite skipempty nextgroup=redifArgumentType contained syntax match redifFieldURL /^URL:/ skipwhite skipempty nextgroup=redifArgumentURL contained syntax match redifFieldVersion /^Version:/ skipwhite skipempty nextgroup=redifArgumentVersion contained syntax match redifFieldVolume /^Volume:/ skipwhite skipempty nextgroup=redifArgumentVolume contained syntax match redifFieldWorkplaceEmail /^Workplace-Email:/ skipwhite skipempty nextgroup=redifArgumentWorkplaceEmail contained syntax match redifFieldWorkplaceFax /^Workplace-Fax:/ skipwhite skipempty nextgroup=redifArgumentWorkplaceFax contained syntax match redifFieldWorkplaceHomepage /^Workplace-Homepage:/ skipwhite skipempty nextgroup=redifArgumentWorkplaceHomepage contained syntax match redifFieldWorkplaceInstitution /^Workplace-Institution:/ skipwhite skipempty nextgroup=redifArgumentWorkplaceInstitution contained syntax match redifFieldWorkplaceLocation /^Workplace-Location:/ skipwhite skipempty nextgroup=redifArgumentWorkplaceLocation contained syntax match redifFieldWorkplaceName /^Workplace-Name:/ skipwhite skipempty nextgroup=redifArgumentWorkplaceName contained syntax match redifFieldWorkplaceNameEnglish /^Workplace-Name-English:/ skipwhite skipempty nextgroup=redifArgumentWorkplaceNameEnglish contained syntax match redifFieldWorkplaceOrganization /^Workplace-Organization:/ skipwhite skipempty nextgroup=redifArgumentWorkplaceOrganization contained syntax match redifFieldWorkplacePhone /^Workplace-Phone:/ skipwhite skipempty nextgroup=redifArgumentWorkplacePhone contained syntax match redifFieldWorkplacePostal /^Workplace-Postal:/ skipwhite skipempty nextgroup=redifArgumentWorkplacePostal contained syntax match redifFieldYear /^Year:/ skipwhite skipempty nextgroup=redifArgumentYear contained highlight def link redifFieldAbstract redifField highlight def link redifFieldArticleHandle redifField highlight def link redifFieldAuthorArticle redifField highlight def link redifFieldAuthorBook redifField highlight def link redifFieldAuthorChapter redifField highlight def link redifFieldAuthorEmail redifField highlight def link redifFieldAuthorFax redifField highlight def link redifFieldAuthorHomepage redifField highlight def link redifFieldAuthorName redifField highlight def link redifFieldAuthorNameFirst redifField highlight def link redifFieldAuthorNameLast redifField highlight def link redifFieldAuthorPaper redifField highlight def link redifFieldAuthorPerson redifField highlight def link redifFieldAuthorPhone redifField highlight def link redifFieldAuthorPostal redifField highlight def link redifFieldAuthorSoftware redifField highlight def link redifFieldAuthorWorkplaceEmail redifField highlight def link redifFieldAuthorWorkplaceFax redifField highlight def link redifFieldAuthorWorkplaceHomepage redifField highlight def link redifFieldAuthorWorkplaceInstitution redifField highlight def link redifFieldAuthorWorkplaceLocation redifField highlight def link redifFieldAuthorWorkplaceName redifField highlight def link redifFieldAuthorWorkplaceNameEnglish redifField highlight def link redifFieldAuthorWorkplacePhone redifField highlight def link redifFieldAuthorWorkplacePostal redifField highlight def link redifFieldAvailability redifField highlight def link redifFieldBookHandle redifField highlight def link redifFieldBookTitle redifField highlight def link redifFieldChapterHandle redifField highlight def link redifFieldChapter redifField highlight def link redifFieldClassificationJEL redifField highlight def link redifFieldContactEmail redifField highlight def link redifFieldCreationDate redifField highlight def link redifFieldDescription redifField highlight def link redifFieldEdition redifField highlight def link redifFieldEditorBook redifField highlight def link redifFieldEditorEmail redifField highlight def link redifFieldEditorFax redifField highlight def link redifFieldEditorHomepage redifField highlight def link redifFieldEditorName redifField highlight def link redifFieldEditorNameFirst redifField highlight def link redifFieldEditorNameLast redifField highlight def link redifFieldEditorPerson redifField highlight def link redifFieldEditorPhone redifField highlight def link redifFieldEditorPostal redifField highlight def link redifFieldEditorSeries redifField highlight def link redifFieldEditorWorkplaceEmail redifField highlight def link redifFieldEditorWorkplaceFax redifField highlight def link redifFieldEditorWorkplaceHomepage redifField highlight def link redifFieldEditorWorkplaceInstitution redifField highlight def link redifFieldEditorWorkplaceLocation redifField highlight def link redifFieldEditorWorkplaceName redifField highlight def link redifFieldEditorWorkplaceNameEnglish redifField highlight def link redifFieldEditorWorkplacePhone redifField highlight def link redifFieldEditorWorkplacePostal redifField highlight def link redifFieldEmail redifField highlight def link redifFieldFax redifField highlight def link redifFieldFileFormat redifField highlight def link redifFieldFileFunction redifField highlight def link redifFieldFileRestriction redifField highlight def link redifFieldFileSize redifField highlight def link redifFieldFileURL redifField highlight def link redifFieldFollowup redifField highlight def link redifFieldHandleOfArchive redifField highlight def link redifFieldHandleOfInstitution redifField highlight def link redifFieldHandleOfPerson redifField highlight def link redifFieldHandleOfSeries redifField highlight def link redifFieldHandleOfWork redifField highlight def link redifFieldHasChapter redifField highlight def link redifFieldHomepage redifField highlight def link redifFieldInBook redifField highlight def link redifFieldISBN redifField highlight def link redifFieldISSN redifField highlight def link redifFieldIssue redifField highlight def link redifFieldJournal redifField highlight def link redifFieldKeywords redifField highlight def link redifFieldKeywords redifField highlight def link redifFieldLanguage redifField highlight def link redifFieldLastLoginDate redifField highlight def link redifFieldLength redifField highlight def link redifFieldMaintainerEmail redifField highlight def link redifFieldMaintainerFax redifField highlight def link redifFieldMaintainerName redifField highlight def link redifFieldMaintainerPhone redifField highlight def link redifFieldMonth redifField highlight def link redifFieldNameASCII redifField highlight def link redifFieldNameFirst redifField highlight def link redifFieldNameFull redifField highlight def link redifFieldNameLast redifField highlight def link redifFieldNameMiddle redifField highlight def link redifFieldNamePrefix redifField highlight def link redifFieldNameSuffix redifField highlight def link redifFieldName redifField highlight def link redifFieldNote redifField highlight def link redifFieldNotification redifField highlight def link redifFieldNumber redifField highlight def link redifFieldOrderEmail redifField highlight def link redifFieldOrderHomepage redifField highlight def link redifFieldOrderPostal redifField highlight def link redifFieldOrderURL redifField highlight def link redifFieldPages redifField highlight def link redifFieldPaperHandle redifField highlight def link redifFieldPhone redifField highlight def link redifFieldPostal redifField highlight def link redifFieldPredecessor redifField highlight def link redifFieldPrice redifField highlight def link redifFieldPrimaryDefunct redifField highlight def link redifFieldPrimaryEmail redifField highlight def link redifFieldPrimaryFax redifField highlight def link redifFieldPrimaryHomepage redifField highlight def link redifFieldPrimaryInstitution redifField highlight def link redifFieldPrimaryLocation redifField highlight def link redifFieldPrimaryName redifField highlight def link redifFieldPrimaryNameEnglish redifField highlight def link redifFieldPrimaryPhone redifField highlight def link redifFieldPrimaryPostal redifField highlight def link redifFieldProgrammingLanguage redifField highlight def link redifFieldProviderEmail redifField highlight def link redifFieldProviderFax redifField highlight def link redifFieldProviderHomepage redifField highlight def link redifFieldProviderInstitution redifField highlight def link redifFieldProviderLocation redifField highlight def link redifFieldProviderName redifField highlight def link redifFieldProviderNameEnglish redifField highlight def link redifFieldProviderPhone redifField highlight def link redifFieldProviderPostal redifField highlight def link redifFieldPublicationDate redifField highlight def link redifFieldPublicationStatus redifField highlight def link redifFieldPublicationType redifField highlight def link redifFieldQuaternaryEmail redifField highlight def link redifFieldQuaternaryFax redifField highlight def link redifFieldQuaternaryHomepage redifField highlight def link redifFieldQuaternaryInstitution redifField highlight def link redifFieldQuaternaryLocation redifField highlight def link redifFieldQuaternaryName redifField highlight def link redifFieldQuaternaryNameEnglish redifField highlight def link redifFieldQuaternaryPhone redifField highlight def link redifFieldQuaternaryPostal redifField highlight def link redifFieldRegisteredDate redifField highlight def link redifFieldRequires redifField highlight def link redifFieldRestriction redifField highlight def link redifFieldRevisionDate redifField highlight def link redifFieldSecondaryDefunct redifField highlight def link redifFieldSecondaryEmail redifField highlight def link redifFieldSecondaryFax redifField highlight def link redifFieldSecondaryHomepage redifField highlight def link redifFieldSecondaryInstitution redifField highlight def link redifFieldSecondaryLocation redifField highlight def link redifFieldSecondaryName redifField highlight def link redifFieldSecondaryNameEnglish redifField highlight def link redifFieldSecondaryPhone redifField highlight def link redifFieldSecondaryPostal redifField highlight def link redifFieldSeries redifField highlight def link redifFieldShortId redifField highlight def link redifFieldSize redifField highlight def link redifFieldSoftwareHandle redifField highlight def link redifFieldTemplateType redifField highlight def link redifFieldTertiaryDefunct redifField highlight def link redifFieldTertiaryEmail redifField highlight def link redifFieldTertiaryFax redifField highlight def link redifFieldTertiaryHomepage redifField highlight def link redifFieldTertiaryInstitution redifField highlight def link redifFieldTertiaryLocation redifField highlight def link redifFieldTertiaryName redifField highlight def link redifFieldTertiaryNameEnglish redifField highlight def link redifFieldTertiaryPhone redifField highlight def link redifFieldTertiaryPostal redifField highlight def link redifFieldTitle redifField highlight def link redifFieldTitle redifField highlight def link redifFieldType redifField highlight def link redifFieldURL redifField highlight def link redifFieldVersion redifField highlight def link redifFieldVolume redifField highlight def link redifFieldWorkplaceEmail redifField highlight def link redifFieldWorkplaceFax redifField highlight def link redifFieldWorkplaceHomepage redifField highlight def link redifFieldWorkplaceInstitution redifField highlight def link redifFieldWorkplaceLocation redifField highlight def link redifFieldWorkplaceName redifField highlight def link redifFieldWorkplaceNameEnglish redifField highlight def link redifFieldWorkplaceOrganization redifField highlight def link redifFieldWorkplacePhone redifField highlight def link redifFieldWorkplacePostal redifField highlight def link redifFieldYear redifField " Deprecated " same as Provider-* " nextgroup=redifArgumentProvider* syntax match redifFieldPublisherEmail /^Publisher-Email:/ skipwhite skipempty nextgroup=redifArgumentProviderEmail contained syntax match redifFieldPublisherFax /^Publisher-Fax:/ skipwhite skipempty nextgroup=redifArgumentProviderFax contained syntax match redifFieldPublisherHomepage /^Publisher-Homepage:/ skipwhite skipempty nextgroup=redifArgumentProviderHomepage contained syntax match redifFieldPublisherInstitution /^Publisher-Institution:/ skipwhite skipempty nextgroup=redifArgumentProviderInstitution contained syntax match redifFieldPublisherLocation /^Publisher-Location:/ skipwhite skipempty nextgroup=redifArgumentProviderLocation contained syntax match redifFieldPublisherName /^Publisher-Name:/ skipwhite skipempty nextgroup=redifArgumentProviderName contained syntax match redifFieldPublisherNameEnglish /^Publisher-Name-English:/ skipwhite skipempty nextgroup=redifArgumentProviderNameEnglish contained syntax match redifFieldPublisherPhone /^Publisher-Phone:/ skipwhite skipempty nextgroup=redifArgumentProviderPhone contained syntax match redifFieldPublisherPostal /^Publisher-Postal:/ skipwhite skipempty nextgroup=redifArgumentProviderPostal contained highlight def link redifFieldPublisherEmail redifFieldDeprecated highlight def link redifFieldPublisherFax redifFieldDeprecated highlight def link redifFieldPublisherHomepage redifFieldDeprecated highlight def link redifFieldPublisherInstitution redifFieldDeprecated highlight def link redifFieldPublisherLocation redifFieldDeprecated highlight def link redifFieldPublisherName redifFieldDeprecated highlight def link redifFieldPublisherNameEnglish redifFieldDeprecated highlight def link redifFieldPublisherPhone redifFieldDeprecated highlight def link redifFieldPublisherPostal redifFieldDeprecated " Standard arguments " By default, they contain all the argument until another field is started: " start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 " For arguments that must not span more than one line, use a match: " /\%(^\S\{-}:\)\@!\S.*/ " AND ADD "display" " This is faster. " " Those arguments are not highlighted so far. They are here for future " extensions. " TODO Find more RegEx for these arguments " TODO Fax, Phone " TODO URL, Homepage " TODO Keywords " TODO Classification-JEL " TODO Short-Id, Author-Person, Editor-Person " " Arguments that may span several lines: syntax region redifArgumentAuthorWorkplaceLocation start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentAuthorWorkplacePostal start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentEditorPostal start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentEditorWorkplacePostal start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentFileFunction start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentIssue start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentJournal start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentOrderPostal start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentPostal start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentPrice start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentPrimaryLocation start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentPrimaryPostal start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentProviderLocation start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentProviderPostal start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentQuaternaryLocation start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentQuaternaryPostal start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentRequires start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentSecondaryLocation start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentSecondaryPostal start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentSize start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentTertiaryLocation start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentTertiaryPostal start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentVersion start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentWorkplaceLocation start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentWorkplacePhone start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentWorkplacePostal start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained " Arguments that may not span several lines: " If you are sure that these arguments cannot span several lines, change " them to a match: " /\%(^\S\{-}:\)\@!\S.*/ " AND ADD "display" after "contained" " You can use this command on each line that you want to change: " :s+\Vregion \(\w\+\) start=/\\%(^\\S\\{-}:\\)\\@!\\S/ end=/^\\S\\{-}:/me=s-1 contained+match \1 /\\%(^\\S\\{-}:\\)\\@!\\S.*/ contained display syntax region redifArgumentAuthorFax start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentAuthorHomepage start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentAuthorName start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentAuthorNameFirst start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentAuthorNameLast start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentAuthorPerson start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentAuthorPhone start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentAuthorPostal start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentAuthorWorkplaceFax start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentAuthorWorkplaceHomepage start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentAuthorWorkplaceName start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentAuthorWorkplaceNameEnglish start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentAuthorWorkplacePhone start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentEditorFax start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentEditorHomepage start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentEditorName start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentEditorNameFirst start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentEditorNameLast start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentEditorPerson start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentEditorPhone start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentEditorWorkplaceFax start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentEditorWorkplaceHomepage start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentEditorWorkplaceLocation start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentEditorWorkplaceName start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentEditorWorkplaceNameEnglish start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentEditorWorkplacePhone start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentFax start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentFileURL start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentHomepage start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentMaintainerFax start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentMaintainerName start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentMaintainerPhone start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentNameFirst start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentNameFull start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentNameLast start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentNameMiddle start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentNamePrefix start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentNameSuffix start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentName start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentNumber start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentOrderHomepage start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentOrderURL start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentPhone start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentPrimaryFax start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentPrimaryHomepage start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentPrimaryName start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentPrimaryNameEnglish start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentPrimaryPhone start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentProviderFax start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentProviderHomepage start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentProviderName start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentProviderNameEnglish start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentProviderPhone start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentQuaternaryFax start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentQuaternaryHomepage start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentQuaternaryName start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentQuaternaryNameEnglish start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentQuaternaryPhone start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentSecondaryFax start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentSecondaryHomepage start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentSecondaryName start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentSecondaryNameEnglish start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentSecondaryPhone start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentSeries start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentShortId start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentTertiaryFax start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentTertiaryHomepage start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentTertiaryName start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentTertiaryNameEnglish start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentTertiaryPhone start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentURL start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentWorkplaceFax start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentWorkplaceHomepage start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentWorkplaceName start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentWorkplaceNameEnglish start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained syntax region redifArgumentWorkplaceOrganization start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contained " Special arguments " Those arguments require special values " TODO Improve some RegEx " TODO Improve Emails " TODO Improve ISBN " TODO Improve ISSN " TODO Improve spell check (add words from economics. " expl=macroeconometrics, Schumpeterian, IS-LM, etc.) " " Template-Type syntax match redifArgumentTemplateType /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectTemplateType contained display syntax match redifCorrectTemplateType /ReDIF-\%(Paper\|Article\|Chapter\|Book\|Software\|Archive\|Series\|Institution\|Person\)/ nextgroup=redifTemplateVersionNumberContainer contained display syntax match redifTemplateVersionNumberContainer /.\+/ contains=redifTemplateVersionNumber contained display syntax match redifTemplateVersionNumber / \d\+\.\d\+/ nextgroup=redifWrongLineEnding contained display highlight def link redifArgumentTemplateType redifError highlight def link redifCorrectTemplateType Constant highlight def link redifTemplateVersionNumber Number highlight def link redifTemplateVersionNumberContainer redifError " Handles: " " Handles of Works: syntax match redifArgumentHandleOfWork /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectHandleOfWork contained display syntax match redifArgumentAuthorArticle /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectHandleOfWork contained display syntax match redifArgumentAuthorBook /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectHandleOfWork contained display syntax match redifArgumentAuthorChapter /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectHandleOfWork contained display syntax match redifArgumentAuthorPaper /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectHandleOfWork contained display syntax match redifArgumentAuthorSoftware /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectHandleOfWork contained display syntax match redifArgumentEditorBook /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectHandleOfWork contained display syntax match redifArgumentEditorSeries /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectHandleOfWork contained display syntax match redifArgumentInBook /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectHandleOfWork contained display syntax match redifArgumentHasChapter /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectHandleOfWork contained display syntax match redifArgumentArticleHandle /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectHandleOfWork contained display syntax match redifArgumentBookHandle /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectHandleOfWork contained display syntax match redifArgumentChapterHandle /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectHandleOfWork contained display syntax match redifArgumentPaperHandle /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectHandleOfWork contained display syntax match redifArgumentSoftwareHandle /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectHandleOfWork contained display syntax match redifCorrectHandleOfWork /RePEc:\a\a\a:\%(_\@!\w\)\{6}:\S\+/ contains=redifForbiddenCharactersInHandle,redifBestPracticeInHandle nextgroup=redifWrongLineEnding contained display " TODO Are those characters really forbidden??? syntax match redifForbiddenCharactersInHandle /[\/*?"<>|]/ contained display syntax match redifBestPracticeInHandle /\<\%([vi]:[1-9]\d*\|y:[1-9]\d\{3}\|p:[1-9]\d*-[1-9]\d*\|i:\%(jan\|feb\|mar\|apr\|may\|jun\|jul\|aug\|sep\|oct\|nov\|dec\|spr\|sum\|aut\|win\|spe\|Q[1-4]\|\d\d-\d\d\)\|Q:[1-4]\)\>/ contained display highlight def link redifArgumentHandleOfWork redifError highlight def link redifArgumentAuthorArticle redifError highlight def link redifArgumentAuthorBook redifError highlight def link redifArgumentAuthorChapter redifError highlight def link redifArgumentAuthorPaper redifError highlight def link redifArgumentAuthorSoftware redifError highlight def link redifArgumentEditorBook redifError highlight def link redifArgumentEditorSeries redifError highlight def link redifArgumentInBook redifError highlight def link redifArgumentHasChapter redifError highlight def link redifArgumentArticleHandle redifError highlight def link redifArgumentBookHandle redifError highlight def link redifArgumentChapterHandle redifError highlight def link redifArgumentPaperHandle redifError highlight def link redifArgumentSoftwareHandle redifError highlight def link redifForbiddenCharactersInHandle redifError highlight def link redifBestPracticeInHandle redifSpecial " Handles of Series: syntax match redifArgumentHandleOfSeries /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectHandleOfSeries contained display syntax match redifArgumentFollowup /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectHandleOfSeries contained display syntax match redifArgumentPredecessor /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectHandleOfSeries contained display syntax match redifCorrectHandleOfSeries /RePEc:\a\a\a:\%(_\@!\w\)\{6}/ nextgroup=redifWrongLineEnding contained display highlight def link redifArgumentHandleOfSeries redifError highlight def link redifArgumentFollowup redifError highlight def link redifArgumentPredecessor redifError " Handles of Archives: syntax match redifArgumentHandleOfArchive /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectHandleOfArchive contained display syntax match redifCorrectHandleOfArchive /RePEc:\a\a\a/ nextgroup=redifWrongLineEnding contained display highlight def link redifArgumentHandleOfArchive redifError " Handles of Person: syntax match redifArgumentHandleOfPerson /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectHandleOfPerson contained display syntax match redifCorrectHandleOfPerson /\%(\%(:\@!\S\)\{-}:\)\{2}[1-9]\d\{3}\%(-02\%(-[12]\d\|-0[1-9]\)\|-\%(0[469]\|11\)\%(-30\|-[12]\d\|-0[1-9]\)\|-\%(0[13578]\|1[02]\)\%(-3[01]\|-[12]\d\|-0[1-9]\)\):\S\+/ nextgroup=redifWrongLineEnding contained display highlight def link redifArgumentHandleOfPerson redifError " Handles of Institution: syntax match redifArgumentAuthorWorkplaceInstitution /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectHandleOfInstitution contained display syntax match redifArgumentEditorWorkplaceInstitution /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectHandleOfInstitution contained display syntax match redifArgumentPrimaryInstitution /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectHandleOfInstitution contained display syntax match redifArgumentProviderInstitution /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectHandleOfInstitution contained display syntax match redifArgumentPublisherInstitution /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectHandleOfInstitution contained display syntax match redifArgumentQuaternaryInstitution /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectHandleOfInstitution contained display syntax match redifArgumentSecondaryInstitution /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectHandleOfInstitution contained display syntax match redifArgumentTertiaryInstitution /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectHandleOfInstitution contained display syntax match redifArgumentWorkplaceInstitution /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectHandleOfInstitution contained display syntax match redifArgumentHandleOfInstitution /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectHandleOfInstitution contained display syntax match redifArgumentPrimaryDefunct /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectHandleOfInstitution contained display syntax match redifArgumentSecondaryDefunct /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectHandleOfInstitution contained display syntax match redifArgumentTertiaryDefunct /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectHandleOfInstitution contained display " TODO Are digits authorized? Apparently not. " Country codes: " http://www.iso.org/iso/country_codes/iso_3166_code_lists/country_names_and_code_elements.htm syntax match redifCorrectHandleOfInstitution /RePEc:\a\a\a:\a\{5}\(ea\|af\|ax\|al\|dz\|as\|ad\|ao\|ai\|aq\|ag\|ar\|am\|aw\|au\|at\|az\|bs\|bh\|bd\|bb\|by\|be\|bz\|bj\|bm\|bt\|bo\|bq\|ba\|bw\|bv\|br\|io\|bn\|bg\|bf\|bi\|kh\|cm\|ca\|cv\|ky\|cf\|td\|cl\|cn\|cx\|cc\|co\|km\|cg\|cd\|ck\|cr\|ci\|hr\|cu\|cw\|cy\|cz\|dk\|dj\|dm\|do\|ec\|eg\|sv\|gq\|er\|ee\|et\|fk\|fo\|fj\|fi\|fr\|gf\|pf\|tf\|ga\|gm\|ge\|de\|gh\|gi\|gr\|gl\|gd\|gp\|gu\|gt\|gg\|gn\|gw\|gy\|ht\|hm\|va\|hn\|hk\|hu\|is\|in\|id\|ir\|iq\|ie\|im\|il\|it\|jm\|jp\|je\|jo\|kz\|ke\|ki\|kp\|kr\|kw\|kg\|la\|lv\|lb\|ls\|lr\|ly\|li\|lt\|lu\|mo\|mk\|mg\|mw\|my\|mv\|ml\|mt\|mh\|mq\|mr\|mu\|yt\|mx\|fm\|md\|mc\|mn\|me\|ms\|ma\|mz\|mm\|na\|nr\|np\|nl\|nc\|nz\|ni\|ne\|ng\|nu\|nf\|mp\|no\|om\|pk\|pw\|ps\|pa\|pg\|py\|pe\|ph\|pn\|pl\|pt\|pr\|qa\|re\|ro\|ru\|rw\|bl\|sh\|kn\|lc\|mf\|pm\|vc\|ws\|sm\|st\|sa\|sn\|rs\|sc\|sl\|sg\|sx\|sk\|si\|sb\|so\|za\|gs\|ss\|es\|lk\|sd\|sr\|sj\|sz\|se\|ch\|sy\|tw\|tj\|tz\|th\|tl\|tg\|tk\|to\|tt\|tn\|tr\|tm\|tc\|tv\|ug\|ua\|ae\|gb\|us\|um\|uy\|uz\|vu\|ve\|vn\|vg\|vi\|wf\|eh\|ye\|zm\|zw\)/ nextgroup=redifWrongLineEnding contained display highlight def link redifArgumentHandleOfInstitution redifError highlight def link redifArgumentPrimaryDefunct redifError highlight def link redifArgumentSecondaryDefunct redifError highlight def link redifArgumentTertiaryDefunct redifError " Emails: syntax match redifArgumentAuthorEmail /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectEmail contained display syntax match redifArgumentAuthorWorkplaceEmail /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectEmail contained display syntax match redifArgumentContactEmail /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectEmail contained display syntax match redifArgumentEditorEmail /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectEmail contained display syntax match redifArgumentEditorWorkplaceEmail /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectEmail contained display syntax match redifArgumentEmail /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectEmail contained display syntax match redifArgumentMaintainerEmail /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectEmail contained display syntax match redifArgumentOrderEmail /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectEmail contained display syntax match redifArgumentPrimaryEmail /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectEmail contained display syntax match redifArgumentProviderEmail /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectEmail contained display syntax match redifArgumentPublisherEmail /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectEmail contained display syntax match redifArgumentQuaternaryEmail /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectEmail contained display syntax match redifArgumentSecondaryEmail /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectEmail contained display syntax match redifArgumentTertiaryEmail /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectEmail contained display syntax match redifArgumentWorkplaceEmail /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectEmail contained display syntax match redifCorrectEmail /\%(@\@!\S\)\+@\%(@\@!\S\)\+/ nextgroup=redifWrongLineEnding contained display highlight def link redifArgumentAuthorEmail redifError highlight def link redifArgumentAuthorWorkplaceEmail redifError highlight def link redifArgumentContactEmail redifError highlight def link redifArgumentEditorEmail redifError highlight def link redifArgumentEditorWorkplaceEmail redifError highlight def link redifArgumentEmail redifError highlight def link redifArgumentMaintainerEmail redifError highlight def link redifArgumentOrderEmail redifError highlight def link redifArgumentPrimaryEmail redifError highlight def link redifArgumentProviderEmail redifError highlight def link redifArgumentPublisherEmail redifError highlight def link redifArgumentQuaternaryEmail redifError highlight def link redifArgumentSecondaryEmail redifError highlight def link redifArgumentTertiaryEmail redifError highlight def link redifArgumentWorkplaceEmail redifError " Language " Source: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes syntax match redifArgumentLanguage /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectLanguage contained display syntax match redifCorrectLanguage /\<\(aa\|ab\|af\|ak\|als\|am\|an\|ang\|ar\|arc\|as\|ast\|av\|ay\|az\|ba\|bar\|bat-smg\|bcl\|be\|be-x-old\|bg\|bh\|bi\|bm\|bn\|bo\|bpy\|br\|bs\|bug\|bxr\|ca\|ce\|ceb\|ch\|cho\|chr\|chy\|co\|cr\|cs\|csb\|cu\|cv\|cy\|da\|de\|diq\|dsb\|dv\|dz\|ee\|el\|en\|eo\|es\|et\|eu\|ext\|fa\|ff\|fi\|fiu-vro\|fj\|fo\|fr\|frp\|fur\|fy\|ga\|gd\|gil\|gl\|gn\|got\|gu\|gv\|ha\|haw\|he\|hi\|ho\|hr\|ht\|hu\|hy\|hz\|ia\|id\|ie\|ig\|ii\|ik\|ilo\|io\|is\|it\|iu\|ja\|jbo\|jv\|ka\|kg\|ki\|kj\|kk\|kl\|km\|kn\|khw\|ko\|kr\|ks\|ksh\|ku\|kv\|kw\|ky\|la\|lad\|lan\|lb\|lg\|li\|lij\|lmo\|ln\|lo\|lt\|lv\|map-bms\|mg\|mh\|mi\|mk\|ml\|mn\|mo\|mr\|ms\|mt\|mus\|my\|na\|nah\|nap\|nd\|nds\|nds-nl\|ne\|new\|ng\|nl\|nn\|no\|nr\|nso\|nrm\|nv\|ny\|oc\|oj\|om\|or\|os\|pa\|pag\|pam\|pap\|pdc\|pi\|pih\|pl\|pms\|ps\|pt\|qu\|rm\|rmy\|rn\|ro\|roa-rup\|ru\|rw\|sa\|sc\|scn\|sco\|sd\|se\|sg\|sh\|si\|simple\|sk\|sl\|sm\|sn\|so\|sq\|sr\|ss\|st\|su\|sv\|sw\|ta\|te\|tet\|tg\|th\|ti\|tk\|tl\|tlh\|tn\|to\|tpi\|tr\|ts\|tt\|tum\|tw\|ty\|udm\|ug\|uk\|ur\|uz\|ve\|vi\|vec\|vls\|vo\|wa\|war\|wo\|xal\|xh\|yi\|yo\|za\|zh\|zh-min-nan\|zh-yue\|zu\)\>/ nextgroup=redifWrongLineEnding contained display highlight def link redifArgumentLanguage redifError highlight def link redifCorrectLanguage redifSpecial " Length " Based on the example in the documentation. But apparently any field is " possible syntax region redifArgumentLength start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contains=redifGoodLength contained syntax match redifGoodLength /1 page\|[1-9]\d*\%( pages\)\=/ contained display highlight def link redifGoodLength redifSpecial " Publication-Type syntax match redifArgumentPublicationType /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectPublicationType contained display syntax match redifCorrectPublicationType /\<\(journal article\|book\|book chapter\|working paper\|conference paper\|report\|other\)\>/ nextgroup=redifWrongLineEnding contained display highlight def link redifArgumentPublicationType redifError highlight def link redifCorrectPublicationType redifSpecial " Publication-Status syntax region redifArgumentPublicationStatus start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contains=redifSpecialPublicationStatus contained syntax match redifSpecialPublicationStatus /published\|forthcoming/ nextgroup=redifCorrectPublicationStatus contained display syntax region redifCorrectPublicationStatus start=/./ end=/^\S\{-}:/me=s-1 contained highlight def link redifArgumentPublicationStatus redifError highlight def link redifSpecialPublicationStatus redifSpecial " Month " TODO Are numbers also allowed? syntax match redifArgumentMonth /\%(^\S\{-}:\)\@!\S.*/ contains=redifGoodMonth contained display syntax match redifGoodMonth /\<\(Jan\%(uary\)\=\|Feb\%(ruary\)\=\|Mar\%(ch\)\=\|Apr\%(il\)\=\|May\|June\=\|July\=\|Aug\%(ust\)\=\|Sep\%(tember\)\=\|Oct\%(ober\)\=\|Nov\%(ember\)\=\|Dec\%(ember\)\=\)\>/ contained display highlight def link redifGoodMonth redifSpecial " Integers: Volume, Chapter syntax match redifArgumentVolume /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectInteger contained display syntax match redifArgumentChapter /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectInteger contained display syntax match redifCorrectInteger /[1-9]\d*/ nextgroup=redifWrongLineEnding contained display highlight def link redifArgumentVolume redifError highlight def link redifArgumentChapter redifError " Year syntax match redifArgumentYear /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectYear contained display syntax match redifCorrectYear /[1-9]\d\{3}/ nextgroup=redifWrongLineEnding contained display highlight def link redifArgumentYear redifError " Edition " Based on the example in the documentation. syntax match redifArgumentEdition /\%(^\S\{-}:\)\@!\S.*/ contains=redifGoodEdition contained display syntax match redifGoodEdition /1st\|2nd\|3rd\|[4-9]th\|[1-9]\d*\%(1st\|2nd\|3rd\|[4-9]th\)\|[1-9]\d*/ contained display highlight def link redifGoodEdition redifSpecial " ISBN syntax match redifArgumentISBN /\%(^\S\{-}:\)\@!\S.*/ contains=redifGoodISBN contained display syntax match redifGoodISBN /\d[0-9-]\{8,15}\d/ contained display highlight def link redifGoodISBN redifSpecial " ISSN syntax match redifArgumentISSN /\%(^\S\{-}:\)\@!\S.*/ contains=redifGoodISSN contained display syntax match redifGoodISSN /\d\{4}-\d\{3}[0-9X]/ contained display highlight def link redifGoodISSN redifSpecial " File-Size " Based on the example in the documentation. syntax region redifArgumentFileSize start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contains=redifGoodSize contained syntax match redifGoodSize /kb\|bytes/ contained display highlight def link redifGoodSize redifSpecial " Type syntax match redifArgumentType /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectType contained display syntax match redifCorrectType /ReDIF-Paper\|ReDIF-Software\|ReDIF-Article\|ReDIF-Chapter\|ReDIF-Book/ nextgroup=redifWrongLineEnding contained display highlight def link redifArgumentType redifError highlight def link redifCorrectType redifSpecial " Dates: Publication-Date, Creation-Date, Revision-Date, " Last-Login-Date, Registration-Date syntax match redifArgumentCreationDate /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectDate contained display syntax match redifArgumentLastLoginDate /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectDate contained display syntax match redifArgumentPublicationDate /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectDate contained display syntax match redifArgumentRegisteredDate /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectDate contained display syntax match redifArgumentRevisionDate /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectDate contained display syntax match redifCorrectDate /[1-9]\d\{3}\%(-02\%(-[12]\d\|-0[1-9]\)\=\|-\%(0[469]\|11\)\%(-30\|-[12]\d\|-0[1-9]\)\=\|-\%(0[13578]\|1[02]\)\%(-3[01]\|-[12]\d\|-0[1-9]\)\=\)\=/ nextgroup=redifWrongLineEnding contained display highlight def link redifArgumentCreationDate redifError highlight def link redifArgumentLastLoginDate redifError highlight def link redifArgumentPublicationDate redifError highlight def link redifArgumentRegisteredDate redifError highlight def link redifArgumentRevisionDate redifError " Classification-JEL syntax match redifArgumentClassificationJEL /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectJEL contained display syntax match redifCorrectJEL /\<\%(\u\d\{,2}[,; \t]\s*\)*\u\d\{,2}/ contains=redifSpecialJEL nextgroup=redifWrongLineEnding contained display syntax match redifSpecialJEL /\<\u\d\{,2}/ contained display highlight def link redifArgumentClassificationJEL redifError highlight def link redifSpecialJEL redifSpecial " Pages syntax match redifArgumentPages /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectPages contained display syntax match redifCorrectPages /[1-9]\d*-[1-9]\d*/ nextgroup=redifWrongLineEnding contained display highlight def link redifArgumentPages redifError " Name-ASCII syntax match redifArgumentNameASCII /\%(^\S\{-}:\)\@!\S.*/ contains=redifCorrectNameASCII contained display syntax match redifCorrectNameASCII /[ -~]/ contained display highlight def link redifArgumentNameASCII redifError " Programming-Language syntax match redifArgumentProgrammingLanguage /\%(^\S\{-}:\)\@!\S.*/ contains=redifGoodProgrammingLanguage contained display syntax match redifGoodProgrammingLanguage /\/ nextgroup=redifWrongLineEnding contained display highlight def link redifGoodProgrammingLanguage redifSpecial " File-Format " TODO The link in the documentation that gives the list of possible formats is broken. " ftp://ftp.isi.edu/in-notes/iana/assignments/media-types/media-types " These are based on the examples in the documentation. syntax match redifArgumentFileFormat /\%(^\S\{-}:\)\@!\S.*/ contains=redifGoodFormat contained display syntax match redifGoodFormat "\a\+/[[:alpha:]+-]\+" nextgroup=redifWrongLineEnding contains=redifSpecialFormat contained display syntax match redifSpecialFormat "application/atom+xml\|application/ecmascript\|application/EDI-X12\|application/EDIFACT\|application/json\|application/javascript\|application/octet-stream\|application/ogg\|application/pdf\|application/postscript\|application/rdf+xml\|application/rss+xml\|application/soap+xml\|application/font-woff\|application/xhtml+xml\|application/xml\|application/xml-dtd\|application/xop+xml\|application/zip\|application/gzip\|audio/basic\|audio/L24\|audio/mp4\|audio/mpeg\|audio/ogg\|audio/vorbis\|audio/vnd.rn-realaudio\|audio/vnd.wave\|audio/webm\|image/gif\|image/jpeg\|image/pjpeg\|image/png\|image/svg+xml\|image/tiff\|image/vnd.microsoft.icon\|message/http\|message/imdn+xml\|message/partial\|message/rfc822\|model/example\|model/iges\|model/mesh\|model/vrml\|model/x3d+binary\|model/x3d+vrml\|model/x3d+xml\|multipart/mixed\|multipart/alternative\|multipart/related\|multipart/form-data\|multipart/signed\|multipart/encrypted\|text/cmd\|text/css\|text/csv\|text/html\|text/javascript\|text/plain\|text/vcard\|text/xml\|video/mpeg\|video/mp4\|video/ogg\|video/quicktime\|video/webm\|video/x-matroska\|video/x-ms-wmv\|video/x-flv" contained display highlight def link redifSpecialFormat redifSpecial highlight def link redifArgumentFileFormat redifError " Keywords " Spell checked syntax match redifArgumentKeywords /\%(^\S\{-}:\)\@!\S.*/ contains=@Spell,redifKeywordsSemicolon contained syntax match redifKeywordsSemicolon /;/ contained highlight def link redifKeywordsSemicolon redifSpecial " Other spell-checked arguments " Very useful when copy-pasting abstracts that may contain hyphens or " ligatures. syntax region redifArgumentAbstract start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contains=@Spell contained syntax region redifArgumentAvailability start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contains=@Spell contained syntax region redifArgumentBookTitle start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contains=@Spell contained syntax region redifArgumentDescription start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contains=@Spell contained syntax region redifArgumentFileRestriction start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contains=@Spell contained syntax region redifArgumentNote start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contains=@Spell contained syntax region redifArgumentNotification start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contains=@Spell contained syntax region redifArgumentRestriction start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contains=@Spell contained syntax region redifArgumentTitle start=/\%(^\S\{-}:\)\@!\S/ end=/^\S\{-}:/me=s-1 contains=@Spell contained " Wrong line ending syntax match redifWrongLineEnding /.\+/ contained display highlight def link redifWrongLineEnding redifError " Final highlight highlight def link redifComment Comment highlight def link redifError Error highlight def link redifField Identifier highlight def link redifFieldDeprecated Identifier highlight def link redifSpecial Special " For deprecated fields: highlight redifFieldDeprecated term=undercurl cterm=undercurl gui=undercurl guisp=DarkGrey " Sync: The template-type (ReDIF-Paper, ReDIF-Archive, etc.) influences which " fields can follow. Thus sync must search backwards for it. " " I would like to simply ask VIM to search backward for the first occurence of " /^Template-Type:/, but it does not seem to be possible, so I have to start " from the beginning of the file... This might slow down a lot for files that " contain a lot of Template-Type statements. syntax sync fromstart " The problem with syntax sync match (tried below), it is that, for example, " it cannot realize when it is inside a Author-Name cluster, which is inside a " Template-Type template... " " TODO Is this linecont pattern really useful? It seems to work anyway... "syntax sync linecont /^\(Template-Type:\)\=\s*$/ " TODO This sync is surprising... It seems to work on several lines even " though I replaced \_s* by \s*, even without the linecont pattern... "syntax sync match redifSyncForTemplatePaper groupthere redifRegionTemplatePaper /^Template-Type:\s*ReDIF-Paper \d\+\.\d\+/ "syntax sync match redifSyncForTemplateArticle groupthere redifRegionTemplateArticle /^Template-Type:\s*ReDIF-Article \d\+\.\d\+/ "syntax sync match redifSyncForTemplateChapter groupthere redifRegionTemplateChapter /^Template-Type:\s*ReDIF-Chapter \d\+\.\d\+/ "syntax sync match redifSyncForTemplateBook groupthere redifRegionTemplateBook /^Template-Type:\s*ReDIF-Book \d\+\.\d\+/ "syntax sync match redifSyncForTemplateSoftware groupthere redifRegionTemplateSoftware /^Template-Type:\s*ReDIF-Software \d\+\.\d\+/ "syntax sync match redifSyncForTemplateArchive groupthere redifRegionTemplateArchive /^Template-Type:\s*ReDIF-Archive \d\+\.\d\+/ "syntax sync match redifSyncForTemplateSeries groupthere redifRegionTemplateSeries /^Template-Type:\s*ReDIF-Series \d\+\.\d\+/ "syntax sync match redifSyncForTemplateInstitution groupthere redifRegionTemplateInstitution /^Template-Type:\s*ReDIF-Institution \d\+\.\d\+/ "syntax sync match redifSyncForTemplatePerson groupthere redifRegionTemplatePerson /^Template-Type:\s*ReDIF-Person \d\+\.\d\+/ " I do not really know how sync linebreaks works, but it helps when making " changes on the argument when this argument is not on the same line than its " field. I just assume that people won't leave more than one line of " whitespace between fields and arguments (which is already very unlikely) " hence the value of 2. syntax sync linebreaks=2 " Since folding is defined by the syntax, set foldmethod to syntax. set foldmethod=syntax " Set "b:current_syntax" to the name of the syntax at the end: let b:current_syntax="redif" vim-7.4.1689/runtime/syntax/registry.vim000066400000000000000000000071331267703067000201770ustar00rootroot00000000000000" 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 (doesn't work) " Last change: 2014 Oct 31 " Included patch from Alexander A. Ulitin " 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]*\s*$\|^Windows Registry Editor Version \d*\.\d*\s*$" " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/remind.vim000066400000000000000000000055061267703067000176070ustar00rootroot00000000000000" Vim syntax file " Language: Remind " Maintainer: Davide Alberani " Last Change: 02 Nov 2015 " Version: 0.7 " URL: http://ismito.it/vim/syntax/remind.vim " " Remind is a sophisticated calendar and alarm program. " You can download remind from: " https://www.roaringpenguin.com/products/remind " " Changelog " version 0.7: updated email and link " version 0.6: added THROUGH keyword (courtesy of Ben Orchard) 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 FROM SCANFROM SCAN WARN SCHED THROUGH 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 COLOR syn keyword remindRun MSG MSF RUN CAL SATISFY SPECIAL PS PSFILE SHADE MOON syn keyword remindConditional IF ELSE ENDIF IFTRIG syn keyword remindDebug DEBUG DUMPVARS DUMP ERRMSG FLUSH PRESERVE syn match remindComment "#.*$" syn region remindString start=+'+ end=+'+ skip=+\\\\\|\\'+ oneline syn region remindString start=+"+ end=+"+ skip=+\\\\\|\\"+ oneline syn match remindVar "\$[_a-zA-Z][_a-zA-Z0-9]*" syn match remindSubst "%[^ ]" syn match remindAdvanceNumber "\(\*\|+\|-\|++\|--\)[0-9]\+" " XXX: use different separators for dates and times? syn match remindDateSeparators "[/:@\.-]" contained syn match remindTimes "[0-9]\{1,2}[:\.][0-9]\{1,2}" contains=remindDateSeparators " XXX: why not match only valid dates? Ok, checking for 'Feb the 30' would " be impossible, but at least check for valid months and times. syn match remindDates "'[0-9]\{4}[/-][0-9]\{1,2}[/-][0-9]\{1,2}\(@[0-9]\{1,2}[:\.][0-9]\{1,2}\)\?'" contains=remindDateSeparators " This will match trailing whitespaces that seem to break rem2ps. " Courtesy of Michael Dunn. syn match remindWarning display excludenl "\S\s\+$"ms=s+1 if version >= 508 || !exists("did_remind_syn_inits") if version < 508 let did_remind_syn_inits = 1 command -nargs=+ HiLink hi link else command -nargs=+ HiLink hi def link 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 remindTimes String HiLink remindString String HiLink remindDebug Debug HiLink remindVar Identifier HiLink remindSubst Constant HiLink remindAdvanceNumber Number HiLink remindDateSeparators Comment HiLink remindDates String HiLink remindWarning Error delcommand HiLink endif let b:current_syntax = "remind" " vim: ts=8 sw=2 vim-7.4.1689/runtime/syntax/resolv.vim000066400000000000000000000061431267703067000176410ustar00rootroot00000000000000" Vim syntax file " Language: resolver configuration file " Maintainer: Radu Dineiu " URL: https://raw.github.com/rid9/vim-resolv/master/resolv.vim " Last Change: 2013 May 21 " Version: 1.0 " " Credits: " David Necas (Yeti) " Stefano Zacchiroli if version < 600 syntax clear elseif exists("b:current_syntax") finish endif " Errors, comments and operators syn match resolvError /./ 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\|$\)\)\+/ contains=@resolvIPCluster syn match resolvHostnameSearch contained /\%(\%([-0-9A-Za-z_]\+\.\)*[-0-9A-Za-z_]\+\.\?\%(\s\|$\)\)\+/ syn match resolvIPNetmaskSortList contained /\%(\%(\d\{1,4}\.\)\{3}\d\{1,4}\%(\/\%(\%(\d\{1,4}\.\)\{,3}\d\{1,4}\)\)\?\%(\s\|$\)\)\+/ contains=resolvOperator,@resolvIPCluster " Identifiers syn match resolvNameserver /^\s*nameserver\>/ nextgroup=resolvIPNameserver skipwhite syn match resolvLwserver /^\s*lwserver\>/ nextgroup=resolvIPNameserver skipwhite syn match resolvDomain /^\s*domain\>/ nextgroup=resolvHostname skipwhite syn match resolvSearch /^\s*search\>/ nextgroup=resolvHostnameSearch skipwhite syn match resolvSortList /^\s*sortlist\>/ nextgroup=resolvIPNetmaskSortList skipwhite syn match resolvOptions /^\s*options\>/ nextgroup=resolvOption skipwhite " Options syn match resolvOption /\<\%(debug\|no_tld_query\|rotate\|no-check-names\|inet6\)\>/ contained nextgroup=resolvOption skipwhite syn match resolvOption /\<\%(ndots\|timeout\|attempts\):\d\+\>/ contained contains=resolvOperator nextgroup=resolvOption skipwhite " Additional errors syn match resolvError /^search .\{257,}/ if version >= 508 || !exists("did_config_syntax_inits") if version < 508 let did_config_syntax_inits = 1 command! -nargs=+ HiLink hi link else command! -nargs=+ HiLink hi def link 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 resolvLwserver 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 vim-7.4.1689/runtime/syntax/reva.vim000066400000000000000000000171241267703067000172650ustar00rootroot00000000000000" Vim syntax file " Language: Reva Forth " Version: 2011.2 " Last Change: 2012/02/13 " Maintainer: Ron Aaron " URL: http://ronware.org/reva/ " Filetypes: *.rf *.frt " NOTE: You should also have the ftplugin/reva.vim file to set 'isk' " For version 5.x: Clear all syntax items and don't load " For version 6.x: Quit when a syntax file was already loaded if version < 600 syntax clear echo "Reva syntax file requires version 6.0 or later of vim!" finish elseif exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn clear " Synchronization method syn sync ccomment syn sync maxlines=100 syn case ignore " Some special, non-FORTH keywords "syn keyword revaTodo contained todo fixme bugbug todo: bugbug: note: syn match revaTodo contained '\(todo\|fixme\|bugbug\|note\)[:]*' syn match revaTodo contained 'copyright\(\s(c)\)\=\(\s[0-9]\{2,4}\)\=' syn match revaHelpDesc '\S.*' contained syn match revaHelpStuff '\<\(def\|stack\|ctx\|ver\|os\|related\):\s.*' syn region revaHelpStuff start='\' end='^\S' contains=revaHelpDesc syn region revaEOF start='\<|||\>' end='{$}' contains=revaHelpStuff syn case match " basic mathematical and logical operators syn keyword revaoperators + - * / mod /mod negate abs min max umin umax syn keyword revaoperators and or xor not invert 1+ 1- syn keyword revaoperators m+ */ */mod m* um* m*/ um/mod fm/mod sm/rem syn keyword revaoperators d+ d- dnegate dabs dmin dmax > < = >> << u< <> " stack manipulations syn keyword revastack drop nip dup over tuck swap rot -rot ?dup pick roll syn keyword revastack 2drop 2nip 2dup 2over 2swap 2rot 3drop syn keyword revastack >r r> r@ rdrop " syn keyword revastack sp@ sp! rp@ rp! " address operations syn keyword revamemory @ ! +! c@ c! 2@ 2! align aligned allot allocate here free resize syn keyword revaadrarith chars char+ cells cell+ cell cell- 2cell+ 2cell- 3cell+ 4cell+ syn keyword revamemblks move fill " conditionals syn keyword revacond if else then =if >if if if0 ;; catch throw " iterations syn keyword revaloop while repeat until again syn keyword revaloop do loop i j leave unloop skip more " new words syn match revaColonDef '\ immediate syn keyword revadefine compile literal ' ['] " Built in words com! -nargs=+ Builtin syn keyword revaBuiltin Builtin execute ahead interp bye >body here pad words make Builtin accept close cr creat delete ekey emit fsize ioerr key? Builtin mtime open/r open/rw read rename seek space spaces stat Builtin tell type type_ write (seek) (argv) (save) 0; 0drop; Builtin >class >lz >name >xt alias alias: appname argc asciiz, asciizl, Builtin body> clamp depth disassemble findprev fnvhash getenv here, Builtin iterate last! last@ later link lz> lzmax os parse/ peek Builtin peek-n pop prior push put rp@ rpick save setenv slurp Builtin stack-empty? stack-iterate stack-size stack: THROW_BADFUNC Builtin THROW_BADLIB THROW_GENERIC used xt>size z, Builtin +lplace +place -chop /char /string bounds c+lplace c+place Builtin chop cmp cmpi count lc lcount lplace place quote rsplit search split Builtin zcount zt \\char Builtin chdir g32 k32 u32 getcwd getpid hinst osname stdin stdout Builtin (-lib) (bye) (call) (else) (find) (func) (here) (if (lib) (s0) (s^) Builtin (to~) (while) >in >rel ?literal appstart cold compiling? context? d0 default_class Builtin defer? dict dolstr dostr find-word h0 if) interp isa onexit Builtin onstartup pdoes pop>ebx prompt rel> rp0 s0 src srcstr state str0 then,> then> tib Builtin tp vector vector! word? xt? .ver revaver revaver# && '' 'constant 'context Builtin 'create 'defer 'does 'forth 'inline 'macro 'macront 'notail 'value 'variable Builtin (.r) (context) (create) (header) (hide) (inline) (p.r) (words~) (xfind) Builtin ++ -- , -2drop -2nip -link -swap . .2x .classes .contexts .funcs .libs .needs .r Builtin .rs .x 00; 0do 0if 1, 2, 3, 2* 2/ 2constant 2variable 3dup 4dup ;then >base >defer Builtin >rr ? ?do @execute @rem appdir argv as back base base! between chain cleanup-libs Builtin cmove> context?? ctrl-c ctx>name data: defer: defer@def dictgone do_cr eleave Builtin endcase endof eval exception exec false find func: header heapgone help help/ Builtin hex# hide inline{ last lastxt lib libdir literal, makeexename mnotail ms ms@ Builtin newclass noop nosavedict notail nul of off on p: padchar parse parseln Builtin parsews rangeof rdepth remains reset reva revaused rol8 rr> scratch setclass sp Builtin strof super> temp time&date true turnkey? undo vfunc: w! w@ Builtin xchg xchg2 xfind xt>name xwords { {{ }} } _+ _1+ _1- pathsep case \|| " p[ [''] [ ['] " debugging syn keyword revadebug .s dump see " basic character operations " syn keyword revaCharOps (.) CHAR EXPECT FIND WORD TYPE -TRAILING EMIT KEY " syn keyword revaCharOps KEY? TIB CR " syn match revaCharOps '\d >digit digit> >single >double >number >float " contexts syn keyword revavocs forth macro inline syn keyword revavocs context: syn match revavocs /\<\~[^~ ]*/ syn match revavocs /[^~ ]*\~\>/ " numbers syn keyword revamath decimal hex base binary octal syn match revainteger '\<-\=[0-9.]*[0-9.]\+\>' " recognize hex and binary numbers, the '$' and '%' notation is for greva syn match revainteger '\<\$\x*\x\+\>' " *1* --- dont't mess syn match revainteger '\<\x*\d\x*\>' " *2* --- this order! syn match revainteger '\<%[0-1]*[0-1]\+\>' syn match revainteger "\<'.\>" " Strings " syn region revaString start=+\.\?\"+ end=+"+ end=+$+ syn region revaString start=/"/ skip=/\\"/ end=/"/ " Comments syn region revaComment start='\\S\s' end='.*' contains=revaTodo syn match revaComment '\.(\s[^)]\{-})' contains=revaTodo syn region revaComment start='(\s' skip='\\)' end=')' contains=revaTodo syn match revaComment '(\s[^\-]*\-\-[^\-]\{-})' contains=revaTodo syn match revaComment '\<|\s.*$' contains=revaTodo syn match revaColonDef '\<:m\?\s*[^ \t]\+\>' contains=revaComment " Include files syn match revaInclude '\<\(include\|needs\)\s\+\S\+' " Define the default highlighting. if !exists("did_reva_syntax_inits") let did_reva_syntax_inits=1 " The default methods for highlighting. Can be overriden later. hi def link revaEOF cIf0 hi def link revaHelpStuff special hi def link revaHelpDesc Comment hi def link revaTodo Todo hi def link revaOperators Operator hi def link revaMath Number hi def link revaInteger Number hi def link revaStack Special hi def link revaFStack Special hi def link revaSP Special hi def link revaMemory Operator hi def link revaAdrArith Function hi def link revaMemBlks Function hi def link revaCond Conditional hi def link revaLoop Repeat hi def link revaColonDef Define hi def link revaEndOfColonDef Define hi def link revaDefine Define hi def link revaDebug Debug hi def link revaCharOps Character hi def link revaConversion String hi def link revaForth Statement hi def link revaVocs Statement hi def link revaString String hi def link revaComment Comment hi def link revaClassDef Define hi def link revaEndOfClassDef Define hi def link revaObjectDef Define hi def link revaEndOfObjectDef Define hi def link revaInclude Include hi def link revaBuiltin Keyword endif let b:current_syntax = "reva" let &cpo = s:cpo_save unlet s:cpo_save " vim: ts=8:sw=4:nocindent:smartindent: vim-7.4.1689/runtime/syntax/rexx.vim000066400000000000000000000363561267703067000173260ustar00rootroot00000000000000" Vim syntax file " Language: Rexx " Maintainer: Thomas Geulig " Last Change: 2012 Sep 14, added support for new ooRexx 4.0 features " URL: http://www.geulig.de/vim/rexx.vim " Special Thanks to Dan Sharp and Rony G. Flatscher " for comments and additions " For version 5.x: Clear all syntax items " 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 " add to valid identifier chars setlocal iskeyword+=. setlocal iskeyword+=! setlocal iskeyword+=? " ---rgf, position important: must be before comments etc. ! syn match rexxOperator "[=|\/\\\+\*\[\],;:<>&\~%\-]" " rgf syn match rexxIdentifier "\<[a-zA-Z\!\?_]\([a-zA-Z0-9._?!]\)*\>" syn match rexxIdentifier "\<\K\k*\>" syn match rexxEnvironmentSymbol "\<\.\k\+\>" " 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 \|when \|otherwise \)\s*\S*" contains=ALLBUT,rexxParse2,rexxRaise2,rexxForward2 " Considered keywords when used together in a phrase and begin a clause syn match rexxParse "\\|version\)\>" containedin=rexxClause contains=rexxParse2 syn match rexxParse2 "\" containedin=rexxParse syn match rexxKeyword contained "\" syn match rexxKeyword contained "\<\(address\|trace\)\( value\)\?\>" syn match rexxKeyword contained "\" syn match rexxKeyword contained "\<\(do\|loop\)\>\(\s\+label\s\+\k*\)\?\(\s\+forever\)\?\>" syn match rexxKeyword contained "\\s*\(strict\s*\)\?\" " Another keyword phrase, separated to aid highlighting in rexxFunction syn match rexxRegularCallSignal contained "\<\(call\|signal\)\s\(\s*on\>\|\s*off\>\)\@!\(\k\+\ze\|\ze(\)\(\s*\|;\|$\|(\)" syn region rexxLabel contained start="\<\(call\|signal\)\>\s*\zs\(\k*\|(\)" end="\ze\(\s*\|;\|$\|(\)" containedin=rexxRegularCallSignal syn match rexxExceptionHandling contained "\<\(call\|signal\)\>\s\+\<\(on\|off\)\>.*\(;\|$\)" contains=rexxComment " hilite label given after keyword "name" syn match rexxLabel "name\s\+\zs\k\+\ze" containedin=rexxExceptionHandling " hilite condition name (serves as label) syn match rexxLabel "\<\(call\|signal\)\>\s\+\<\(on\|off\)\>\s*\zs\k\+\ze\s*\(;\|$\)" containedin=rexxExceptionHandling " user exception handling, hilite user defined name syn region rexxLabel contained start="user\s\+\zs\k" end="\ze\(\s\|;\|$\)" containedin=rexxExceptionHandling " Considered keywords when they begin a clause syn match rexxKeywordStatements "\<\(arg\|catch\|do\|drop\|end\|exit\|expose\|finally\|forward\|if\|interpret\|iterate\|leave\|loop\|nop\)\>" syn match rexxKeywordStatements "\<\(options\|pull\|push\|queue\|raise\|reply\|return\|say\|select\|trace\)\>" " Conditional keywords starting a new statement syn match rexxConditional "\<\(then\|else\|when\|otherwise\)\(\s*\|;\|\_$\|\)\>" contains=rexxKeywordStatements " Conditional phrases syn match rexxLoopKeywords "\<\(to\|by\|for\|until\|while\|over\)\>" containedin=doLoopSelectLabelRegion " must be after Conditional phrases! syn match doLoopSelectLabelRegion "\<\(do\|loop\|select\)\>\s\+\(label\s\+\)\?\(\s\+\k\+\s\+\zs\\)\?\k*\(\s\+forever\)\?\(\s\|;\|$\)" contains=doLoopSelectLabelRegion,rexxStartValueAssignment,rexxLoopKeywords " color label's name syn match rexxLabel2 "\<\(do\|loop\|select\)\>\s\+label\s\+\zs\k*\ze" containedin=doLoopSelectLabelRegion " make sure control variable is normal " TODO: re-activate ? "rgf syn match rexxControlVariable "\<\(do\|loop\)\>\(\s\+label\s\+\k*\)\?\s\+\zs.*\ze\s\+\" containedin=doLoopSelectLabelRegion " make sure control variable assignment is normal syn match rexxStartValueAssignment "\<\(do\|loop\)\>\(\s\+label\s\+\k*\)\?\s\+\zs.*\ze\(=.*\)\?\s\+\" containedin=doLoopSelectLabelRegion " highlight label name syn match endIterateLeaveLabelRegion "\<\(end\|leave\|iterate\)\>\(\s\+\K\k*\)" contains=rexxLabel2 syn match rexxLabel2 "\<\(end\|leave\|iterate\)\>\s\+\zs\k*\ze" containedin=endIterateLeaveLabelRegion " Guard statement syn match rexxGuard "\(^\|;\|:\)\s*\\s\+\<\(on\|off\)\>" " Trace statement syn match rexxTrace "\(^\|;\|:\)\s*\\s\+\<\K\k*\>" " Raise statement " syn match rexxRaise "\(^\|;\|:\)\s\+\\s*\<\(propagate\|error\|failure\|syntax\|user\)\>\?" contains=rexxRaise2 syn match rexxRaise "\(^\|;\|:\)\s*\\s*\<\(propagate\|error\|failure\|syntax\|user\)\>\?" contains=rexxRaise2 syn match rexxRaise2 "\<\(additional\|array\|description\|exit\|propagate\|return\)\>" containedin=rexxRaise " Forward statement syn match rexxForward "\(^\|;\|:\)\\s*" contains=rexxForward2 syn match rexxForward2 "\<\(arguments\|array\|continue\|message\|class\|to\)\>" contained " Functions/Procedures syn match rexxFunction "\<\<[a-zA-Z\!\?_]\k*\>("me=e-1 syn match rexxFunction "[()]" " String constants syn region rexxString start=+"+ skip=+""+ end=+"\(x\|b\)\?+ oneline syn region rexxString start=+'+ skip=+''+ end=+'\(x\|b\)\?+ oneline syn region rexxParen transparent start='(' end=')' contains=ALLBUT,rexxParenError,rexxTodo,rexxLabel,rexxKeyword " Catch errors caused by wrong parenthesis syn match rexxParenError ")" syn match rexxInParen "[\\[\\]{}]" " Comments syn region rexxComment start="/\*" end="\*/" contains=rexxTodo,rexxComment syn match rexxCommentError "\*/" syn region rexxLineComment start="--" end="\_$" oneline " Highlight User Labels " check for labels between comments, labels stated in a statement in the middle of a line syn match rexxLabel "\(\_^\|;\)\s*\(\/\*.*\*\/\)*\s*\k\+\s*\(\/\*.*\*\/\)*\s*:"me=e-1 contains=rexxTodo,rexxComment syn keyword rexxTodo contained TODO FIXME XXX " ooRexx messages syn region rexxMessageOperator start="\(\~\|\~\~\)" end="\(\S\|\s\)"me=e-1 syn match rexxMessage "\(\~\|\~\~\)\s*\<\.*[a-zA-Z]\([a-zA-Z0-9._?!]\)*\>" contains=rexxMessageOperator " line continuations, take care of (line-)comments after it syn match rexxLineContinue ",\ze\s*\(--.*\|\/\*.*\)*$" " the following is necessary, otherwise three consecutive dashes will cause it to highlight the first one syn match rexxLineContinue "-\ze-\@!\s*\(--.*\|\s*\/\*.*\)\?$" " Special Variables syn keyword rexxSpecialVariable sigl rc result self super syn keyword rexxSpecialVariable .environment .error .input .local .methods .output .rs .stderr .stdin .stdout .stdque " Constants syn keyword rexxConst .true .false .nil .endOfLine .line .context " Rexx numbers " int like number syn match rexxNumber '\d\+' contained syn match rexxNumber '[-+]\s*\d\+' contained " Floating point number with decimal syn match rexxNumber '\d\+\.\d*' contained syn match rexxNumber '[-+]\s*\d\+\.\d*' contained " Floating point like number with E syn match rexxNumber '[-+]\s*\d*[eE][\-+]\d\+' contained syn match rexxNumber '\d*[eE][\-+]\d\+' contained " Floating point like number with E and decimal point (+,-) syn match rexxNumber '[-+]\s*\d*\.\d*[eE][\-+]\d\+' contained syn match rexxNumber '\d*\.\d*[eE][\-+]\d\+' contained " ooRexx builtin classes (as of version 3.2.0, fall 2007), first define dot to be o.k. in keywords syn keyword rexxBuiltinClass .Alarm .ArgUtil .Array .Bag .CaselessColumnComparator syn keyword rexxBuiltinClass .CaselessComparator .CaselessDescendingComparator .CircularQueue syn keyword rexxBuiltinClass .Class .Collection .ColumnComparator .Comparable .Comparator syn keyword rexxBuiltinClass .DateTime .DescendingComparator .Directory .File .InputOutputStream syn keyword rexxBuiltinClass .InputStream .InvertingComparator .List .MapCollection syn keyword rexxBuiltinClass .Message .Method .Monitor .MutableBuffer .Object syn keyword rexxBuiltinClass .OrderedCollection .OutputStream .Package .Properties .Queue syn keyword rexxBuiltinClass .RegularExpression .Relation .RexxContext .RexxQueue .Routine syn keyword rexxBuiltinClass .Set .SetCollection .Stem .Stream syn keyword rexxBuiltinClass .StreamSupplier .String .Supplier .Table .TimeSpan " Windows-only classes syn keyword rexxBuiltinClass .AdvancedControls .AnimatedButton .BaseDialog .ButtonControl syn keyword rexxBuiltinClass .CategoryDialog .CheckBox .CheckList .ComboBox .DialogControl syn keyword rexxBuiltinClass .DialogExtensions .DlgArea .DlgAreaU .DynamicDialog syn keyword rexxBuiltinClass .EditControl .InputBox .IntegerBox .ListBox .ListChoice syn keyword rexxBuiltinClass .ListControl .MenuObject .MessageExtensions .MultiInputBox syn keyword rexxBuiltinClass .MultiListChoice .OLEObject .OLEVariant syn keyword rexxBuiltinClass .PasswordBox .PlainBaseDialog .PlainUserDialog syn keyword rexxBuiltinClass .ProgressBar .ProgressIndicator .PropertySheet .RadioButton syn keyword rexxBuiltinClass .RcDialog .ResDialog .ScrollBar .SingleSelection .SliderControl syn keyword rexxBuiltinClass .StateIndicator .StaticControl .TabControl .TimedMessage syn keyword rexxBuiltinClass .TreeControl .UserDialog .VirtualKeyCodes .WindowBase syn keyword rexxBuiltinClass .WindowExtensions .WindowObject .WindowsClassesBase .WindowsClipboard syn keyword rexxBuiltinClass .WindowsEventLog .WindowsManager .WindowsProgramManager .WindowsRegistry " BSF4ooRexx classes syn keyword rexxBuiltinClass .BSF .bsf.dialog .bsf_proxy syn keyword rexxBuiltinClass .UNO .UNO_ENUM .UNO_CONSTANTS .UNO_PROPERTIES " ooRexx directives, ---rgf location important, otherwise directives in top of file not matched! syn region rexxClassDirective start="::\s*class\s*"ms=e+1 end="\ze\(\s\|;\|$\)" syn region rexxMethodDirective start="::\s*method\s*"ms=e+1 end="\ze\(\s\|;\|$\)" syn region rexxRequiresDirective start="::\s*requires\s*"ms=e+1 end="\ze\(\s\|;\|$\)" syn region rexxRoutineDirective start="::\s*routine\s*"ms=e+1 end="\ze\(\s\|;\|$\)" syn region rexxAttributeDirective start="::\s*attribute\s*"ms=e+1 end="\ze\(\s\|;\|$\)" " rgf, 2012-09-09 syn region rexxOptionsDirective start="::\s*options\s*"ms=e+1 end="\ze\(\s\|;\|$\)" syn region rexxConstantDirective start="::\s*constant\s*"ms=e+1 end="\ze\(\s\|;\|$\)" syn region rexxDirective start="\(^\|;\)\s*::\s*\w\+" end="\($\|;\)" contains=rexxString,rexxNumber,rexxComment,rexxLineComment,rexxClassDirective,rexxMethodDirective,rexxRoutineDirective,rexxRequiresDirective,rexxAttributeDirective,rexxOptionsDirective,rexxConstantDirective keepend syn match rexxOptionsDirective2 "\<\(digits\|form\|fuzz\|trace\)\>" containedin = rexxOptionsDirective3 syn region rexxOptionsDirective3 start="\(^\|;\)\s*::\s*options\s"ms=e+1 end="\($\|;\)" contains=rexxString,rexxNumber,rexxVariable,rexxComment,rexxLineComment containedin = rexxDirective syn region rexxVariable start="\zs\<\(\.\)\@!\K\k\+\>\ze\s*\(=\|,\|)\|%\|\]\|\\\||\|&\|+=\|-=\|<\|>\)" end="\(\_$\|.\)"me=e-1 syn match rexxVariable "\(=\|,\|)\|%\|\]\|\\\||\|&\|+=\|-=\|<\|>\)\s*\zs\K\k*\ze" " rgf, 2007-07-22: unfortunately, the entire region is colored (not only the " patterns), hence useless (vim 7.0)! (syntax-docs hint that that should work) " attempt: just colorize the parenthesis in matching colors, keep content " transparent to keep the formatting already done to it! " TODO: test on 7.3 " syn region par1 matchgroup=par1 start="(" matchgroup=par1 end=")" transparent contains=par2 " syn region par2 matchgroup=par2 start="(" matchgroup=par2 end=")" transparent contains=par3 contained " syn region par3 matchgroup=par3 start="(" matchgroup=par3 end=")" transparent contains=par4 contained " syn region par4 matchgroup=par4 start="(" matchgroup=par4 end=")" transparent contains=par5 contained " syn region par5 matchgroup=par5 start="(" matchgroup=par5 end=")" transparent contains=par1 contained " this will colorize the entire region, removing any colorizing already done! " syn region par1 matchgroup=par1 start="(" end=")" contains=par2 " syn region par2 matchgroup=par2 start="(" end=")" contains=par3 contained " syn region par3 matchgroup=par3 start="(" end=")" contains=par4 contained " syn region par4 matchgroup=par4 start="(" end=")" contains=par5 contained " syn region par5 matchgroup=par5 start="(" end=")" contains=par1 contained hi par1 ctermfg=red guifg=red "guibg=grey hi par2 ctermfg=blue guifg=blue "guibg=grey hi par3 ctermfg=darkgreen guifg=darkgreen "guibg=grey hi par4 ctermfg=darkyellow guifg=darkyellow "guibg=grey hi par5 ctermfg=darkgrey guifg=darkgrey "guibg=grey " line continuation (trailing comma or single dash) syn sync linecont "\(,\|-\ze-\@!\)\ze\s*\(--.*\|\/\*.*\)*$" " if !exists("rexx_minlines") " let rexx_minlines = 500 " endif " exec "syn sync ccomment rexxComment minlines=" . rexx_minlines " always scan from start, PCs have long become to be powerful enough for that exec "syn sync fromstart" " Define the default highlighting. " For version 5.7 and earlier: only 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 else command -nargs=+ HiLink hi def link endif " make binary and hex strings stand out hi rexxStringConstant term=bold,underline ctermfg=5 cterm=bold guifg=darkMagenta gui=bold HiLink rexxLabel2 Function HiLink doLoopSelectLabelRegion rexxKeyword HiLink endIterateLeaveLabelRegion rexxKeyword HiLink rexxLoopKeywords rexxKeyword " Todo HiLink rexxNumber Normal "DiffChange " HiLink rexxIdentifier DiffChange HiLink rexxRegularCallSignal Statement HiLink rexxExceptionHandling Statement HiLink rexxLabel Function HiLink rexxCharacter Character HiLink rexxParenError rexxError HiLink rexxInParen rexxError HiLink rexxCommentError rexxError HiLink rexxError Error HiLink rexxKeyword Statement HiLink rexxKeywordStatements Statement HiLink rexxFunction Function HiLink rexxString String HiLink rexxComment Comment HiLink rexxTodo Todo HiLink rexxSpecialVariable Special HiLink rexxConditional rexxKeyword HiLink rexxOperator Operator HiLink rexxMessageOperator rexxOperator HiLink rexxLineComment Comment HiLink rexxLineContinue WildMenu HiLink rexxDirective rexxKeyword HiLink rexxClassDirective Type HiLink rexxMethodDirective rexxFunction HiLink rexxAttributeDirective rexxFunction HiLink rexxRequiresDirective Include HiLink rexxRoutineDirective rexxFunction " rgf, 2012-09-09 HiLink rexxOptionsDirective rexxFunction HiLink rexxOptionsDirective2 rexxOptionsDirective HiLink rexxOptionsDirective3 Normal " rexxOptionsDirective HiLink rexxConstantDirective rexxFunction HiLink rexxConst Constant HiLink rexxTypeSpecifier Type HiLink rexxBuiltinClass rexxTypeSpecifier HiLink rexxEnvironmentSymbol rexxConst HiLink rexxMessage rexxFunction HiLink rexxParse rexxKeyword HiLink rexxParse2 rexxParse HiLink rexxGuard rexxKeyword HiLink rexxTrace rexxKeyword HiLink rexxRaise rexxKeyword HiLink rexxRaise2 rexxRaise HiLink rexxForward rexxKeyword HiLink rexxForward2 rexxForward delcommand HiLink endif let b:current_syntax = "rexx" "vim: ts=8 vim-7.4.1689/runtime/syntax/rhelp.vim000066400000000000000000000276051267703067000174470ustar00rootroot00000000000000" Vim syntax file " Language: R Help File " Maintainer: Jakson Aquino " Former Maintainer: Johannes Ranke " Homepage: https://github.com/jalvesaq/R-Vim-runtime " Last Change: Sat Feb 06, 2016 11:34AM " Remarks: - Includes R syntax highlighting in the appropriate " sections if an r.vim file is in the same directory or in the " default debian location. " - There is no Latex markup in equations " - Thanks to Will Gray for finding and fixing a bug " - No support for \var tag within quoted string " Version Clears: {{{1 if exists("b:current_syntax") finish endif scriptencoding utf-8 setlocal iskeyword=@,48-57,_,. syn case match " R help identifiers {{{1 syn region rhelpIdentifier matchgroup=rhelpSection start="\\name{" end="}" syn region rhelpIdentifier matchgroup=rhelpSection start="\\alias{" end="}" syn region rhelpIdentifier matchgroup=rhelpSection start="\\pkg{" end="}" contains=rhelpLink syn region rhelpIdentifier matchgroup=rhelpSection start="\\CRANpkg{" end="}" contains=rhelpLink syn region rhelpIdentifier matchgroup=rhelpSection start="\\method{" end="}" contained syn region rhelpIdentifier matchgroup=rhelpSection start="\\Rdversion{" end="}" " Highlighting of R code using an existing r.vim syntax file if available {{{1 syn include @R syntax/r.vim " Strings {{{1 syn region rhelpString start=/"/ skip=/\\"/ end=/"/ contains=rhelpSpecialChar,rhelpCodeSpecial,rhelpLink contained " Special characters in R strings syn match rhelpCodeSpecial display contained "\\\\\(n\|r\|t\|b\|a\|f\|v\|'\|\"\)\|\\\\" " Special characters ( \$ \& \% \# \{ \} \_) syn match rhelpSpecialChar "\\[$&%#{}_]" " R code {{{1 syn match rhelpDots "\\dots" containedin=@R syn region rhelpRcode matchgroup=Delimiter start="\\examples{" matchgroup=Delimiter transparent end="}" contains=@R,rhelpLink,rhelpIdentifier,rhelpString,rhelpSpecialChar,rhelpSection syn region rhelpRcode matchgroup=Delimiter start="\\usage{" matchgroup=Delimiter transparent end="}" contains=@R,rhelpIdentifier,rhelpS4method syn region rhelpRcode matchgroup=Delimiter start="\\synopsis{" matchgroup=Delimiter transparent end="}" contains=@R syn region rhelpRcode matchgroup=Delimiter start="\\special{" matchgroup=Delimiter transparent end="}" contains=@R if v:version > 703 syn region rhelpRcode matchgroup=Delimiter start="\\code{" skip='\\\@1" syn match rhelpKeyword "\\ldots\>" syn match rhelpKeyword "\\sspace\>" syn match rhelpKeyword "--" syn match rhelpKeyword "---" " Condition Keywords {{{2 syn match rhelpKeyword "\\if\>" syn match rhelpKeyword "\\ifelse\>" syn match rhelpKeyword "\\out\>" " Examples of usage: " \ifelse{latex}{\eqn{p = 5 + 6 - 7 \times 8}}{\eqn{p = 5 + 6 - 7 * 8}} " \ifelse{latex}{\out{$\alpha$}}{\ifelse{html}{\out{α}}{alpha}} " Keywords and operators valid only if in math mode {{{2 syn match rhelpMathOp "<" contained syn match rhelpMathOp ">" contained syn match rhelpMathOp "+" contained syn match rhelpMathOp "-" contained syn match rhelpMathOp "=" contained " Conceal function based on syntax/tex.vim {{{2 if exists("g:tex_conceal") let s:tex_conceal = g:tex_conceal else let s:tex_conceal = 'gm' endif function s:HideSymbol(pat, cchar, hide) if a:hide exe "syn match rhelpMathSymb '" . a:pat . "' contained conceal cchar=" . a:cchar else exe "syn match rhelpMathSymb '" . a:pat . "' contained" endif endfunction " Math symbols {{{2 if s:tex_conceal =~ 'm' let s:hd = 1 else let s:hd = 0 endif call s:HideSymbol('\\infty\>', '∞', s:hd) call s:HideSymbol('\\ge\>', '≥', s:hd) call s:HideSymbol('\\le\>', '≤', s:hd) call s:HideSymbol('\\prod\>', '∏', s:hd) call s:HideSymbol('\\sum\>', '∑', s:hd) syn match rhelpMathSymb "\\sqrt\>" contained " Greek letters {{{2 if s:tex_conceal =~ 'g' let s:hd = 1 else let s:hd = 0 endif call s:HideSymbol('\\alpha\>', 'α', s:hd) call s:HideSymbol('\\beta\>', 'β', s:hd) call s:HideSymbol('\\gamma\>', 'γ', s:hd) call s:HideSymbol('\\delta\>', 'δ', s:hd) call s:HideSymbol('\\epsilon\>', 'ϵ', s:hd) call s:HideSymbol('\\zeta\>', 'ζ', s:hd) call s:HideSymbol('\\eta\>', 'η', s:hd) call s:HideSymbol('\\theta\>', 'θ', s:hd) call s:HideSymbol('\\iota\>', 'ι', s:hd) call s:HideSymbol('\\kappa\>', 'κ', s:hd) call s:HideSymbol('\\lambda\>', 'λ', s:hd) call s:HideSymbol('\\mu\>', 'μ', s:hd) call s:HideSymbol('\\nu\>', 'ν', s:hd) call s:HideSymbol('\\xi\>', 'ξ', s:hd) call s:HideSymbol('\\pi\>', 'π', s:hd) call s:HideSymbol('\\rho\>', 'ρ', s:hd) call s:HideSymbol('\\sigma\>', 'σ', s:hd) call s:HideSymbol('\\tau\>', 'τ', s:hd) call s:HideSymbol('\\upsilon\>', 'υ', s:hd) call s:HideSymbol('\\phi\>', 'ϕ', s:hd) call s:HideSymbol('\\chi\>', 'χ', s:hd) call s:HideSymbol('\\psi\>', 'ψ', s:hd) call s:HideSymbol('\\omega\>', 'ω', s:hd) call s:HideSymbol('\\Gamma\>', 'Γ', s:hd) call s:HideSymbol('\\Delta\>', 'Δ', s:hd) call s:HideSymbol('\\Theta\>', 'Θ', s:hd) call s:HideSymbol('\\Lambda\>', 'Λ', s:hd) call s:HideSymbol('\\Xi\>', 'Ξ', s:hd) call s:HideSymbol('\\Pi\>', 'Π', s:hd) call s:HideSymbol('\\Sigma\>', 'Σ', s:hd) call s:HideSymbol('\\Upsilon\>', 'Υ', s:hd) call s:HideSymbol('\\Phi\>', 'Φ', s:hd) call s:HideSymbol('\\Psi\>', 'Ψ', s:hd) call s:HideSymbol('\\Omega\>', 'Ω', s:hd) delfunction s:HideSymbol " Note: The letters 'omicron', 'Alpha', 'Beta', 'Epsilon', 'Zeta', 'Eta', " 'Iota', 'Kappa', 'Mu', 'Nu', 'Omicron', 'Rho', 'Tau' and 'Chi' are listed " at src/library/tools/R/Rd2txt.R because they are valid in HTML, although " they do not make valid LaTeX code (e.g. Α versus \Alpha). " Links {{{1 syn region rhelpLink matchgroup=rhelpType start="\\link{" end="}" contained keepend extend syn region rhelpLink matchgroup=rhelpType start="\\link\[.\{-}\]{" end="}" contained keepend extend syn region rhelpLink matchgroup=rhelpType start="\\linkS4class{" end="}" contained keepend extend syn region rhelpLink matchgroup=rhelpType start="\\url{" end="}" contained keepend extend syn region rhelpLink matchgroup=rhelpType start="\\href{" end="}" contained keepend extend syn region rhelpLink matchgroup=rhelpType start="\\figure{" end="}" contained keepend extend " Verbatim like {{{1 syn region rhelpVerbatim matchgroup=rhelpType start="\\samp{" skip='\\\@1" syn match rhelpType "\\strong\>" syn match rhelpType "\\bold\>" syn match rhelpType "\\sQuote\>" syn match rhelpType "\\dQuote\>" syn match rhelpType "\\preformatted\>" syn match rhelpType "\\kbd\>" syn match rhelpType "\\file\>" syn match rhelpType "\\email\>" syn match rhelpType "\\enc\>" syn match rhelpType "\\var\>" syn match rhelpType "\\env\>" syn match rhelpType "\\option\>" syn match rhelpType "\\command\>" syn match rhelpType "\\newcommand\>" syn match rhelpType "\\renewcommand\>" syn match rhelpType "\\dfn\>" syn match rhelpType "\\cite\>" syn match rhelpType "\\acronym\>" syn match rhelpType "\\doi\>" " rhelp sections {{{1 syn match rhelpSection "\\encoding\>" syn match rhelpSection "\\title\>" syn match rhelpSection "\\item\>" syn match rhelpSection "\\description\>" syn match rhelpSection "\\concept\>" syn match rhelpSection "\\arguments\>" syn match rhelpSection "\\details\>" syn match rhelpSection "\\value\>" syn match rhelpSection "\\references\>" syn match rhelpSection "\\note\>" syn match rhelpSection "\\author\>" syn match rhelpSection "\\seealso\>" syn match rhelpSection "\\keyword\>" syn match rhelpSection "\\docType\>" syn match rhelpSection "\\format\>" syn match rhelpSection "\\source\>" syn match rhelpSection "\\itemize\>" syn match rhelpSection "\\describe\>" syn match rhelpSection "\\enumerate\>" syn match rhelpSection "\\item " syn match rhelpSection "\\item$" syn match rhelpSection "\\tabular{[lcr]*}" syn match rhelpSection "\\dontrun\>" syn match rhelpSection "\\dontshow\>" syn match rhelpSection "\\testonly\>" syn match rhelpSection "\\donttest\>" " Freely named Sections {{{1 syn region rhelpFreesec matchgroup=Delimiter start="\\section{" matchgroup=Delimiter transparent end="}" syn region rhelpFreesubsec matchgroup=Delimiter start="\\subsection{" matchgroup=Delimiter transparent end="}" syn match rhelpDelimiter "{\|\[\|(\|)\|\]\|}" " R help file comments {{{1 syn match rhelpComment /%.*$/ " Error {{{1 syn region rhelpRegion matchgroup=Delimiter start=/(/ matchgroup=Delimiter end=/)/ contains=@Spell,rhelpCodeSpecial,rhelpComment,rhelpDelimiter,rhelpDots,rhelpFreesec,rhelpFreesubsec,rhelpIdentifier,rhelpKeyword,rhelpLink,rhelpPreProc,rhelpRComment,rhelpRcode,rhelpRegion,rhelpS4method,rhelpSection,rhelpSexpr,rhelpSpecialChar,rhelpString,rhelpType,rhelpVerbatim,rhelpEquation syn region rhelpRegion matchgroup=Delimiter start=/{/ matchgroup=Delimiter end=/}/ contains=@Spell,rhelpCodeSpecial,rhelpComment,rhelpDelimiter,rhelpDots,rhelpFreesec,rhelpFreesubsec,rhelpIdentifier,rhelpKeyword,rhelpLink,rhelpPreProc,rhelpRComment,rhelpRcode,rhelpRegion,rhelpS4method,rhelpSection,rhelpSexpr,rhelpSpecialChar,rhelpString,rhelpType,rhelpVerbatim,rhelpEquation syn region rhelpRegion matchgroup=Delimiter start=/\[/ matchgroup=Delimiter end=/]/ contains=@Spell,rhelpCodeSpecial,rhelpComment,rhelpDelimiter,rhelpDots,rhelpFreesec,rhelpFreesubsec,rhelpIdentifier,rhelpKeyword,rhelpLink,rhelpPreProc,rhelpRComment,rhelpRcode,rhelpRegion,rhelpS4method,rhelpSection,rhelpSexpr,rhelpSpecialChar,rhelpString,rhelpType,rhelpVerbatim,rhelpEquation syn match rhelpError /[)\]}]/ syn match rhelpBraceError /[)}]/ contained syn match rhelpCurlyError /[)\]]/ contained syn match rhelpParenError /[\]}]/ contained syntax sync match rhelpSyncRcode grouphere rhelpRcode "\\examples{" " Define the default highlighting {{{1 hi def link rhelpVerbatim String hi def link rhelpDelimiter Delimiter hi def link rhelpIdentifier Identifier hi def link rhelpString String hi def link rhelpCodeSpecial Special hi def link rhelpKeyword Keyword hi def link rhelpDots Keyword hi def link rhelpLink Underlined hi def link rhelpType Type hi def link rhelpSection PreCondit hi def link rhelpError Error hi def link rhelpBraceError Error hi def link rhelpCurlyError Error hi def link rhelpParenError Error hi def link rhelpPreProc PreProc hi def link rhelpDelimiter Delimiter hi def link rhelpComment Comment hi def link rhelpRComment Comment hi def link rhelpSpecialChar SpecialChar hi def link rhelpMathSymb Special hi def link rhelpMathOp Operator let b:current_syntax = "rhelp" " vim: foldmethod=marker sw=2 vim-7.4.1689/runtime/syntax/rib.vim000066400000000000000000000046061267703067000171050ustar00rootroot00000000000000" Vim syntax file " Language: Renderman Interface Bytestream " Maintainer: Andrew Bromage " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/rmd.vim000066400000000000000000000052331267703067000171100ustar00rootroot00000000000000" markdown Text with R statements " Language: markdown with R code chunks " Homepage: https://github.com/jalvesaq/R-Vim-runtime " Last Change: Sat Feb 06, 2016 06:45AM " " CONFIGURATION: " To highlight chunk headers as R code, put in your vimrc: " let rmd_syn_hl_chunk = 1 if exists("b:current_syntax") finish endif " load all of pandoc info runtime syntax/pandoc.vim if exists("b:current_syntax") let rmdIsPandoc = 1 unlet b:current_syntax else let rmdIsPandoc = 0 runtime syntax/markdown.vim if exists("b:current_syntax") unlet b:current_syntax endif endif " load all of the r syntax highlighting rules into @R syntax include @R syntax/r.vim if exists("b:current_syntax") unlet b:current_syntax endif if exists("g:rmd_syn_hl_chunk") " highlight R code inside chunk header syntax match rmdChunkDelim "^[ \t]*```{r" contained syntax match rmdChunkDelim "}$" contained else syntax match rmdChunkDelim "^[ \t]*```{r.*}$" contained endif syntax match rmdChunkDelim "^[ \t]*```$" contained syntax region rmdChunk start="^[ \t]*``` *{r.*}$" end="^[ \t]*```$" contains=@R,rmdChunkDelim keepend fold " also match and syntax highlight in-line R code syntax match rmdEndInline "`" contained syntax match rmdBeginInline "`r " contained syntax region rmdrInline start="`r " end="`" contains=@R,rmdBeginInline,rmdEndInline keepend " match slidify special marker syntax match rmdSlidifySpecial "\*\*\*" if rmdIsPandoc == 0 syn match rmdBlockQuote /^\s*>.*\n\(.*\n\@" contains=@texMathZoneGroup " Region syntax match rmdLaTeXRegDelim "\$\$" contained syntax match rmdLaTeXRegDelim "\$\$latex$" contained syntax region rmdLaTeXRegion start="^\$\$" skip="\\\$" end="\$\$$" contains=@LaTeX,rmdLaTeXSt,rmdLaTeXRegDelim keepend syntax region rmdLaTeXRegion2 start="^\\\[" end="\\\]" contains=@LaTeX,rmdLaTeXSt,rmdLaTeXRegDelim keepend hi def link rmdLaTeXSt Statement hi def link rmdLaTeXInlDelim Special hi def link rmdLaTeXRegDelim Special endif setlocal iskeyword=@,48-57,_,. syn sync match rmdSyncChunk grouphere rmdChunk "^[ \t]*``` *{r" hi def link rmdChunkDelim Special hi def link rmdBeginInline Special hi def link rmdEndInline Special hi def link rmdBlockQuote Comment hi def link rmdSlidifySpecial Special let b:current_syntax = "rmd" " vim: ts=8 sw=2 vim-7.4.1689/runtime/syntax/rnc.vim000066400000000000000000000043131267703067000171060ustar00rootroot00000000000000" Vim syntax file " Language: Relax NG compact syntax " Maintainer: Nikolai Weibull " Latest Revision: 2007-06-17 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim setlocal iskeyword+=-,. syn keyword rncTodo contained TODO FIXME XXX NOTE syn region rncComment display oneline start='^\s*#' end='$' \ contains=rncTodo,@Spell syn match rncOperator display '[-|,&+?*~]' syn match rncOperator display '\%(|&\)\==' syn match rncOperator display '>>' syn match rncNamespace display '\<\k\+:' syn match rncQuoted display '\\\k\+\>' syn match rncSpecial display '\\x{\x\+}' syn region rncAnnotation transparent start='\[' end='\]' \ contains=ALLBUT,rncComment,rncTodo syn region rncLiteral display oneline start=+"+ end=+"+ \ contains=rncSpecial syn region rncLiteral display oneline start=+'+ end=+'+ syn region rncLiteral display oneline start=+"""+ end=+"""+ \ contains=rncSpecial syn region rncLiteral display oneline start=+'''+ end=+'''+ syn match rncDelimiter display '[{},()]' 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 syn match rncIdentifier display '\k\+\_s*\%(=\|&=\||=\)\@=' \ nextgroup=rncOperator syn keyword rncKeyword element attribute \ nextgroup=rncIdName skipwhite skipempty syn match rncIdName contained '\k\+' hi def link rncTodo Todo hi def link rncComment Comment hi def link rncOperator Operator hi def link rncNamespace Identifier hi def link rncQuoted Special hi def link rncSpecial SpecialChar hi def link rncAnnotation Special hi def link rncLiteral String hi def link rncDelimiter Delimiter hi def link rncKeyword Keyword hi def link rncIdentifier Identifier hi def link rncIdName Identifier let b:current_syntax = "rnc" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/rng.vim000066400000000000000000000014611267703067000171130ustar00rootroot00000000000000" Vim syntax file " Language: RELAX NG " Maintainer: Jaromir Hradilek " URL: https://github.com/jhradilek/vim-rng " Last Change: 25 March 2013 " Description: A syntax file for RELAX NG, a schema language for XML if exists('b:current_syntax') finish endif do Syntax xml syn spell toplevel syn cluster xmlTagHook add=rngTagName syn case match syn keyword rngTagName anyName attribute choice data define div contained syn keyword rngTagName element empty except externalRef grammar contained syn keyword rngTagName group include interleave list mixed name contained syn keyword rngTagName notAllowed nsName oneOrMore optional param contained syn keyword rngTagName parentRef ref start text value zeroOrMore contained hi def link rngTagName Statement let b:current_syntax = 'rng' vim-7.4.1689/runtime/syntax/rnoweb.vim000066400000000000000000000035641267703067000176270ustar00rootroot00000000000000" Vim syntax file " Language: R noweb Files " Maintainer: Johannes Ranke " Last Change: Sat Feb 06, 2016 06:47AM " Version: 0.9.1 " Remarks: - This file is inspired by the proposal of " Fernando Henrique Ferraz Pereira da Rosa " http://www.ime.usp.br/~feferraz/en/sweavevim.html " if exists("b:current_syntax") finish endif syn case match " Extension of Tex clusters {{{1 runtime syntax/tex.vim unlet b:current_syntax syn cluster texMatchGroup add=@rnoweb syn cluster texMathMatchGroup add=rnowebSexpr syn cluster texMathZoneGroup add=rnowebSexpr syn cluster texEnvGroup add=@rnoweb syn cluster texFoldGroup add=@rnoweb syn cluster texDocGroup add=@rnoweb syn cluster texPartGroup add=@rnoweb syn cluster texChapterGroup add=@rnoweb syn cluster texSectionGroup add=@rnoweb syn cluster texSubSectionGroup add=@rnoweb syn cluster texSubSubSectionGroup add=@rnoweb syn cluster texParaGroup add=@rnoweb " Highlighting of R code using an existing r.vim syntax file if available {{{1 syn include @rnowebR syntax/r.vim syn region rnowebChunk matchgroup=rnowebDelimiter start="^<<.*>>=" matchgroup=rnowebDelimiter end="^@" contains=@rnowebR,rnowebChunkReference,rnowebChunk fold keepend syn match rnowebChunkReference "^<<.*>>$" contained syn region rnowebSexpr matchgroup=Delimiter start="\\Sexpr{" matchgroup=Delimiter end="}" contains=@rnowebR contained " Sweave options command {{{1 syn region rnowebSweaveopts matchgroup=Delimiter start="\\SweaveOpts{" matchgroup=Delimiter end="}" " rnoweb Cluster {{{1 syn cluster rnoweb contains=rnowebChunk,rnowebChunkReference,rnowebDelimiter,rnowebSexpr,rnowebSweaveopts " Highlighting {{{1 hi def link rnowebDelimiter Delimiter hi def link rnowebSweaveOpts Statement hi def link rnowebChunkReference Delimiter let b:current_syntax = "rnoweb" " vim: foldmethod=marker: vim-7.4.1689/runtime/syntax/robots.vim000066400000000000000000000034601267703067000176360ustar00rootroot00000000000000" 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 Stphan (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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/rpcgen.vim000066400000000000000000000037251267703067000176100ustar00rootroot00000000000000" Vim syntax file " Language: rpcgen " Maintainer: Charles E. Campbell " Last Change: Jan 13, 2015 " Version: 10 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_RPCGEN if exists("b:current_syntax") finish endif " Read the C syntax to start with if version < 600 source :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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/rpl.vim000066400000000000000000000626011267703067000171250ustar00rootroot00000000000000" Vim syntax file " Language: RPL/2 " Version: 0.15.15 against RPL/2 version 4.00pre7i " Last Change: 2012 Feb 03 by Thilo Six " Maintainer: Jol BERTRAND " 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 let s:cpo_save = &cpo set cpo&vim " 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 else command -nargs=+ HiLink highlight default link 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" let &cpo = s:cpo_save unlet s:cpo_save " vim: ts=8 tw=132 vim-7.4.1689/runtime/syntax/rrst.vim000066400000000000000000000024711267703067000173210ustar00rootroot00000000000000" reStructured Text with R statements " Language: reST with R code chunks " Maintainer: Alex Zvoleff, azvoleff@mail.sdsu.edu " Homepage: https://github.com/jalvesaq/R-Vim-runtime " Last Change: Sat Feb 06, 2016 06:45AM " " CONFIGURATION: " To highlight chunk headers as R code, put in your vimrc: " let rrst_syn_hl_chunk = 1 if exists("b:current_syntax") finish endif " load all of the rst info runtime syntax/rst.vim unlet b:current_syntax " load all of the r syntax highlighting rules into @R syntax include @R syntax/r.vim setlocal iskeyword=@,48-57,_,. " highlight R chunks if exists("g:rrst_syn_hl_chunk") " highlight R code inside chunk header syntax match rrstChunkDelim "^\.\. {r" contained syntax match rrstChunkDelim "}$" contained else syntax match rrstChunkDelim "^\.\. {r .*}$" contained endif syntax match rrstChunkDelim "^\.\. \.\.$" contained syntax region rrstChunk start="^\.\. {r.*}$" end="^\.\. \.\.$" contains=@R,rrstChunkDelim keepend transparent fold " also highlight in-line R code syntax match rrstInlineDelim "`" contained syntax match rrstInlineDelim ":r:" contained syntax region rrstInline start=":r: *`" skip=/\\\\\|\\`/ end="`" contains=@R,rrstInlineDelim keepend hi def link rrstChunkDelim Special hi def link rrstInlineDelim Special let b:current_syntax = "rrst" " vim: ts=8 sw=2 vim-7.4.1689/runtime/syntax/rst.vim000066400000000000000000000207161267703067000171410ustar00rootroot00000000000000" Vim syntax file " Language: reStructuredText documentation format " Maintainer: Marshall Ward " Previous Maintainer: Nikolai Weibull " Latest Revision: 2016-01-05 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn case ignore syn match rstTransition /^[=`:.'"~^_*+#-]\{4,}\s*$/ syn cluster rstCruft contains=rstEmphasis,rstStrongEmphasis, \ rstInterpretedText,rstInlineLiteral,rstSubstitutionReference, \ rstInlineInternalTargets,rstFootnoteReference,rstHyperlinkReference syn region rstLiteralBlock matchgroup=rstDelimiter \ start='::\_s*\n\ze\z(\s\+\)' skip='^$' end='^\z1\@!' \ contains=@NoSpell syn region rstQuotedLiteralBlock matchgroup=rstDelimiter \ start="::\_s*\n\ze\z([!\"#$%&'()*+,-./:;<=>?@[\]^_`{|}~]\)" \ end='^\z1\@!' contains=@NoSpell syn region rstDoctestBlock oneline display matchgroup=rstDelimiter \ start='^>>>\s' end='^$' syn region rstTable transparent start='^\n\s*+[-=+]\+' end='^$' \ contains=rstTableLines,@rstCruft syn match rstTableLines contained display '|\|+\%(=\+\|-\+\)\=' syn region rstSimpleTable transparent \ start='^\n\%(\s*\)\@>\%(\%(=\+\)\@>\%(\s\+\)\@>\)\%(\%(\%(=\+\)\@>\%(\s*\)\@>\)\+\)\@>$' \ end='^$' \ contains=rstSimpleTableLines,@rstCruft syn match rstSimpleTableLines contained display \ '^\%(\s*\)\@>\%(\%(=\+\)\@>\%(\s\+\)\@>\)\%(\%(\%(=\+\)\@>\%(\s*\)\@>\)\+\)\@>$' syn match rstSimpleTableLines contained display \ '^\%(\s*\)\@>\%(\%(-\+\)\@>\%(\s\+\)\@>\)\%(\%(\%(-\+\)\@>\%(\s*\)\@>\)\+\)\@>$' syn cluster rstDirectives contains=rstFootnote,rstCitation, \ rstHyperlinkTarget,rstExDirective syn match rstExplicitMarkup '^\s*\.\.\_s' \ nextgroup=@rstDirectives,rstComment,rstSubstitutionDefinition let s:ReferenceName = '[[:alnum:]]\+\%([_.-][[:alnum:]]\+\)*' syn keyword rstTodo contained FIXME TODO XXX NOTE execute 'syn region rstComment contained' . \ ' start=/.*/' \ ' end=/^\s\@!/ contains=rstTodo' execute 'syn region rstFootnote contained matchgroup=rstDirective' . \ ' start=+\[\%(\d\+\|#\%(' . s:ReferenceName . '\)\=\|\*\)\]\_s+' . \ ' skip=+^$+' . \ ' end=+^\s\@!+ contains=@rstCruft,@NoSpell' execute 'syn region rstCitation contained matchgroup=rstDirective' . \ ' start=+\[' . s:ReferenceName . '\]\_s+' . \ ' skip=+^$+' . \ ' end=+^\s\@!+ contains=@rstCruft,@NoSpell' syn region rstHyperlinkTarget contained matchgroup=rstDirective \ start='_\%(_\|[^:\\]*\%(\\.[^:\\]*\)*\):\_s' skip=+^$+ end=+^\s\@!+ syn region rstHyperlinkTarget contained matchgroup=rstDirective \ start='_`[^`\\]*\%(\\.[^`\\]*\)*`:\_s' skip=+^$+ end=+^\s\@!+ syn region rstHyperlinkTarget matchgroup=rstDirective \ start=+^__\_s+ skip=+^$+ end=+^\s\@!+ execute 'syn region rstExDirective contained matchgroup=rstDirective' . \ ' start=+' . s:ReferenceName . '::\_s+' . \ ' skip=+^$+' . \ ' end=+^\s\@!+ contains=@rstCruft,rstLiteralBlock' execute 'syn match rstSubstitutionDefinition contained' . \ ' /|' . s:ReferenceName . '|\_s\+/ nextgroup=@rstDirectives' function! s:DefineOneInlineMarkup(name, start, middle, end, char_left, char_right) execute 'syn region rst' . a:name . \ ' start=+' . a:char_left . '\zs' . a:start . \ '\ze[^[:space:]' . a:char_right . a:start[strlen(a:start) - 1] . ']+' . \ a:middle . \ ' end=+\S' . a:end . '\ze\%($\|\s\|[''")\]}>/:.,;!?\\-]\)+' endfunction function! s:DefineInlineMarkup(name, start, middle, end) let middle = a:middle != "" ? \ (' skip=+\\\\\|\\' . a:middle . '+') : \ "" call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, "'", "'") call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '"', '"') call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '(', ')') call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '\[', '\]') call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '{', '}') call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '<', '>') call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '\%(^\|\s\|[/:]\)', '') execute 'syn match rst' . a:name . \ ' +\%(^\|\s\|[''"([{/:.,;!?\\-]\)+' execute 'hi def link rst' . a:name . 'Delimiter' . ' rst' . a:name endfunction call s:DefineInlineMarkup('Emphasis', '\*', '\*', '\*') call s:DefineInlineMarkup('StrongEmphasis', '\*\*', '\*', '\*\*') call s:DefineInlineMarkup('InterpretedTextOrHyperlinkReference', '`', '`', '`_\{0,2}') call s:DefineInlineMarkup('InlineLiteral', '``', "", '``') call s:DefineInlineMarkup('SubstitutionReference', '|', '|', '|_\{0,2}') call s:DefineInlineMarkup('InlineInternalTargets', '_`', '`', '`') syn match rstSections "^\%(\([=`:.'"~^_*+#-]\)\1\+\n\)\=.\+\n\([=`:.'"~^_*+#-]\)\2\+$" " TODO: Can’t remember why these two can’t be defined like the ones above. execute 'syn match rstFootnoteReference contains=@NoSpell' . \ ' +\[\%(\d\+\|#\%(' . s:ReferenceName . '\)\=\|\*\)\]_+' execute 'syn match rstCitationReference contains=@NoSpell' . \ ' +\[' . s:ReferenceName . '\]_\ze\%($\|\s\|[''")\]}>/:.,;!?\\-]\)+' execute 'syn match rstHyperlinkReference' . \ ' /\<' . s:ReferenceName . '__\=\ze\%($\|\s\|[''")\]}>/:.,;!?\\-]\)/' syn match rstStandaloneHyperlink contains=@NoSpell \ "\<\%(\%(\%(https\=\|file\|ftp\|gopher\)://\|\%(mailto\|news\):\)[^[:space:]'\"<>]\+\|www[[:alnum:]_-]*\.[[:alnum:]_-]\+\.[^[:space:]'\"<>]\+\)[[:alnum:]/]" syn region rstCodeBlock contained matchgroup=rstDirective \ start=+\%(sourcecode\|code\%(-block\)\=\)::\_s*\n\ze\z(\s\+\)+ \ skip=+^$+ \ end=+^\z1\@!+ \ contains=@NoSpell syn cluster rstDirectives add=rstCodeBlock if !exists('g:rst_syntax_code_list') let g:rst_syntax_code_list = ['vim', 'java', 'cpp', 'lisp', 'php', \ 'python', 'perl', 'sh'] endif for code in g:rst_syntax_code_list unlet! b:current_syntax " guard against setting 'isk' option which might cause problems (issue #108) let prior_isk = &l:iskeyword exe 'syn include @rst'.code.' syntax/'.code.'.vim' exe 'syn region rstDirective'.code.' matchgroup=rstDirective fold ' \.'start=#\%(sourcecode\|code\%(-block\)\=\)::\s\+'.code.'\_s*\n\ze\z(\s\+\)# ' \.'skip=#^$# ' \.'end=#^\z1\@!# contains=@NoSpell,@rst'.code exe 'syn cluster rstDirectives add=rstDirective'.code " reset 'isk' setting, if it has been changed if &l:iskeyword !=# prior_isk let &l:iskeyword = prior_isk endif unlet! prior_isk endfor " TODO: Use better syncing. syn sync minlines=50 linebreaks=2 hi def link rstTodo Todo hi def link rstComment Comment hi def link rstSections Title hi def link rstTransition rstSections hi def link rstLiteralBlock String hi def link rstQuotedLiteralBlock String hi def link rstDoctestBlock PreProc hi def link rstTableLines rstDelimiter hi def link rstSimpleTableLines rstTableLines hi def link rstExplicitMarkup rstDirective hi def link rstDirective Keyword hi def link rstFootnote String hi def link rstCitation String hi def link rstHyperlinkTarget String hi def link rstExDirective String hi def link rstSubstitutionDefinition rstDirective hi def link rstDelimiter Delimiter " TODO: I dunno... hi def rstEmphasis term=italic cterm=italic gui=italic hi def link rstStrongEmphasis Special "term=bold cterm=bold gui=bold hi def link rstInterpretedTextOrHyperlinkReference Identifier hi def link rstInlineLiteral String hi def link rstSubstitutionReference PreProc hi def link rstInlineInternalTargets Identifier hi def link rstFootnoteReference Identifier hi def link rstCitationReference Identifier hi def link rstHyperLinkReference Identifier hi def link rstStandaloneHyperlink Identifier hi def link rstCodeBlock String let b:current_syntax = "rst" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/rtf.vim000066400000000000000000000052641267703067000171250ustar00rootroot00000000000000" 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 Stphan (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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/ruby.vim000066400000000000000000000674061267703067000173210ustar00rootroot00000000000000" Vim syntax file " Language: Ruby " Maintainer: Doug Kearns " URL: https://github.com/vim-ruby/vim-ruby " Release Coordinator: Doug Kearns " ---------------------------------------------------------------------------- " " Previous Maintainer: Mirko Nasato " Thanks to perl.vim authors, and to Reimer Behrends. :-) (MN) " ---------------------------------------------------------------------------- if exists("b:current_syntax") finish endif if has("folding") && exists("ruby_fold") setlocal foldmethod=syntax endif syn cluster rubyNotTop contains=@rubyExtendedStringSpecial,@rubyRegexpSpecial,@rubyDeclaration,rubyConditional,rubyExceptional,rubyMethodExceptional,rubyTodo if exists("ruby_space_errors") if !exists("ruby_no_trail_space_error") syn match rubySpaceError display excludenl "\s\+$" endif if !exists("ruby_no_tab_space_error") syn match rubySpaceError display " \+\t"me=e-1 endif endif " Operators if exists("ruby_operators") syn match rubyOperator "[~!^&|*/%+-]\|\%(class\s*\)\@\|<=\|\%(<\|\>\|>=\|=\@\|\*\*\|\.\.\.\|\.\.\|::" syn match rubyOperator "->\|-=\|/=\|\*\*=\|\*=\|&&=\|&=\|&&\|||=\||=\|||\|%=\|+=\|!\~\|!=" syn region rubyBracketOperator matchgroup=rubyOperator start="\%(\w[?!]\=\|[]})]\)\@<=\[\s*" end="\s*]" contains=ALLBUT,@rubyNotTop endif " Expression Substitution and Backslash Notation syn match rubyStringEscape "\\\\\|\\[abefnrstv]\|\\\o\{1,3}\|\\x\x\{1,2}" contained display syn match rubyStringEscape "\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)" contained display syn match rubyQuoteEscape "\\[\\']" contained display syn region rubyInterpolation matchgroup=rubyInterpolationDelimiter start="#{" end="}" contained contains=ALLBUT,@rubyNotTop syn match rubyInterpolation "#\%(\$\|@@\=\)\w\+" display contained contains=rubyInterpolationDelimiter,rubyInstanceVariable,rubyClassVariable,rubyGlobalVariable,rubyPredefinedVariable syn match rubyInterpolationDelimiter "#\ze\%(\$\|@@\=\)\w\+" display contained syn match rubyInterpolation "#\$\%(-\w\|\W\)" display contained contains=rubyInterpolationDelimiter,rubyPredefinedVariable,rubyInvalidVariable syn match rubyInterpolationDelimiter "#\ze\$\%(-\w\|\W\)" display contained syn region rubyNoInterpolation start="\\#{" end="}" contained syn match rubyNoInterpolation "\\#{" display contained syn match rubyNoInterpolation "\\#\%(\$\|@@\=\)\w\+" display contained syn match rubyNoInterpolation "\\#\$\W" display contained syn match rubyDelimEscape "\\[(<{\[)>}\]]" transparent display contained contains=NONE syn region rubyNestedParentheses start="(" skip="\\\\\|\\)" matchgroup=rubyString end=")" transparent contained syn region rubyNestedCurlyBraces start="{" skip="\\\\\|\\}" matchgroup=rubyString end="}" transparent contained syn region rubyNestedAngleBrackets start="<" skip="\\\\\|\\>" matchgroup=rubyString end=">" transparent contained syn region rubyNestedSquareBrackets start="\[" skip="\\\\\|\\\]" matchgroup=rubyString end="\]" transparent contained " These are mostly Oniguruma ready syn region rubyRegexpComment matchgroup=rubyRegexpSpecial start="(?#" skip="\\)" end=")" contained syn region rubyRegexpParens matchgroup=rubyRegexpSpecial start="(\(?:\|?<\=[=!]\|?>\|?<[a-z_]\w*>\|?[imx]*-[imx]*:\=\|\%(?#\)\@!\)" skip="\\)" end=")" contained transparent contains=@rubyRegexpSpecial syn region rubyRegexpBrackets matchgroup=rubyRegexpCharClass start="\[\^\=" skip="\\\]" end="\]" contained transparent contains=rubyStringEscape,rubyRegexpEscape,rubyRegexpCharClass oneline syn match rubyRegexpCharClass "\\[DdHhSsWw]" contained display syn match rubyRegexpCharClass "\[:\^\=\%(alnum\|alpha\|ascii\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|xdigit\):\]" contained syn match rubyRegexpEscape "\\[].*?+^$|\\/(){}[]" contained syn match rubyRegexpQuantifier "[*?+][?+]\=" contained display syn match rubyRegexpQuantifier "{\d\+\%(,\d*\)\=}?\=" contained display syn match rubyRegexpAnchor "[$^]\|\\[ABbGZz]" contained display syn match rubyRegexpDot "\." contained display syn match rubyRegexpSpecial "|" contained display syn match rubyRegexpSpecial "\\[1-9]\d\=\d\@!" contained display syn match rubyRegexpSpecial "\\k<\%([a-z_]\w*\|-\=\d\+\)\%([+-]\d\+\)\=>" contained display syn match rubyRegexpSpecial "\\k'\%([a-z_]\w*\|-\=\d\+\)\%([+-]\d\+\)\='" contained display syn match rubyRegexpSpecial "\\g<\%([a-z_]\w*\|-\=\d\+\)>" contained display syn match rubyRegexpSpecial "\\g'\%([a-z_]\w*\|-\=\d\+\)'" contained display syn cluster rubyStringSpecial contains=rubyInterpolation,rubyNoInterpolation,rubyStringEscape syn cluster rubyExtendedStringSpecial contains=@rubyStringSpecial,rubyNestedParentheses,rubyNestedCurlyBraces,rubyNestedAngleBrackets,rubyNestedSquareBrackets syn cluster rubyRegexpSpecial contains=rubyInterpolation,rubyNoInterpolation,rubyStringEscape,rubyRegexpSpecial,rubyRegexpEscape,rubyRegexpBrackets,rubyRegexpCharClass,rubyRegexpDot,rubyRegexpQuantifier,rubyRegexpAnchor,rubyRegexpParens,rubyRegexpComment " Numbers and ASCII Codes syn match rubyASCIICode "\%(\w\|[]})\"'/]\)\@" display syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@" display syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@" display syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@" display syn match rubyFloat "\%(\%(\w\|[]})\"']\s*\)\@" display syn match rubyFloat "\%(\%(\w\|[]})\"']\s*\)\@" display " Identifiers syn match rubyLocalVariableOrMethod "\<[_[:lower:]][_[:alnum:]]*[?!=]\=" contains=NONE display transparent syn match rubyBlockArgument "&[_[:lower:]][_[:alnum:]]" contains=NONE display transparent syn match rubyConstant "\%(\%([.@$]\@\|::\)\@=\%(\s*(\)\@!" syn match rubyClassVariable "@@\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" display syn match rubyInstanceVariable "@\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" display syn match rubyGlobalVariable "$\%(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\|-.\)" syn match rubySymbol "[]})\"':]\@\|<=\|<\|===\|[=!]=\|[=!]\~\|!\|>>\|>=\|>\||\|-@\|-\|/\|\[]=\|\[]\|\*\*\|\*\|&\|%\|+@\|+\|`\)" syn match rubySymbol "[]})\"':]\@_,;:!?/.'"@$*\&+0]\)" syn match rubySymbol "[]})\"':]\@\@!\)\=" syn match rubySymbol "\%([{(,]\_s*\)\@<=\l\w*[!?]\=::\@!"he=e-1 syn match rubySymbol "[]})\"':]\@\|{\)\s*\)\@<=|" end="|" oneline display contains=rubyBlockParameter syn match rubyInvalidVariable "$[^ A-Za-z_-]" syn match rubyPredefinedVariable #$[!$&"'*+,./0:;<=>?@\`~]# syn match rubyPredefinedVariable "$\d\+" display syn match rubyPredefinedVariable "$_\>" display syn match rubyPredefinedVariable "$-[0FIKadilpvw]\>" display syn match rubyPredefinedVariable "$\%(deferr\|defout\|stderr\|stdin\|stdout\)\>" display syn match rubyPredefinedVariable "$\%(DEBUG\|FILENAME\|KCODE\|LOADED_FEATURES\|LOAD_PATH\|PROGRAM_NAME\|SAFE\|VERBOSE\)\>" display syn match rubyPredefinedConstant "\%(\%(\.\@\%(\s*(\)\@!" syn match rubyPredefinedConstant "\%(\%(\.\@\%(\s*(\)\@!" syn match rubyPredefinedConstant "\%(\%(\.\@\%(\s*(\)\@!" syn match rubyPredefinedConstant "\%(\%(\.\@\%(\s*(\)\@!" " Normal Regular Expression syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\%(^\|\<\%(and\|or\|while\|until\|unless\|if\|elsif\|when\|not\|then\|else\)\|[;\~=!|&(,[<>?:*+-]\)\s*\)\@<=/" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial fold syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\h\k*\s\+\)\@<=/[ \t=]\@!" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial fold " Generalized Regular Expression syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\z([~`!@#$%^&*_\-+=|\:;"',.? /]\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial fold syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r{" end="}[iomxneus]*" skip="\\\\\|\\}" contains=@rubyRegexpSpecial fold syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r<" end=">[iomxneus]*" skip="\\\\\|\\>" contains=@rubyRegexpSpecial,rubyNestedAngleBrackets,rubyDelimEscape fold syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\[" end="\][iomxneus]*" skip="\\\\\|\\\]" contains=@rubyRegexpSpecial fold syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r(" end=")[iomxneus]*" skip="\\\\\|\\)" contains=@rubyRegexpSpecial fold " Normal String and Shell Command Output syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial,@Spell fold syn region rubyString matchgroup=rubyStringDelimiter start="'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape,@Spell fold syn region rubyString matchgroup=rubyStringDelimiter start="`" end="`" skip="\\\\\|\\`" contains=@rubyStringSpecial fold " Generalized Single Quoted String, Symbol and Array of Strings syn region rubyString matchgroup=rubyStringDelimiter start="%[qwi]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold syn region rubyString matchgroup=rubyStringDelimiter start="%[qwi]{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimEscape syn region rubyString matchgroup=rubyStringDelimiter start="%[qwi]<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimEscape syn region rubyString matchgroup=rubyStringDelimiter start="%[qwi]\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimEscape syn region rubyString matchgroup=rubyStringDelimiter start="%[qwi](" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimEscape syn region rubyString matchgroup=rubyStringDelimiter start="%q " end=" " skip="\\\\\|\\)" fold syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\z([~`!@#$%^&*_\-+=|\:;"',.? /]\)" end="\z1" skip="\\\\\|\\\z1" fold syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimEscape syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimEscape syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimEscape syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s(" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimEscape " Generalized Double Quoted String and Array of Strings and Shell Command Output " Note: %= is not matched here as the beginning of a double quoted string syn region rubyString matchgroup=rubyStringDelimiter start="%\z([~`!@#$%^&*_\-+|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold syn region rubyString matchgroup=rubyStringDelimiter start="%[QWIx]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold syn region rubyString matchgroup=rubyStringDelimiter start="%[QWIx]\={" end="}" skip="\\\\\|\\}" contains=@rubyStringSpecial,rubyNestedCurlyBraces,rubyDelimEscape fold syn region rubyString matchgroup=rubyStringDelimiter start="%[QWIx]\=<" end=">" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimEscape fold syn region rubyString matchgroup=rubyStringDelimiter start="%[QWIx]\=\[" end="\]" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimEscape fold syn region rubyString matchgroup=rubyStringDelimiter start="%[QWIx]\=(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimEscape fold syn region rubyString matchgroup=rubyStringDelimiter start="%[Qx] " end=" " skip="\\\\\|\\)" contains=@rubyStringSpecial fold " Here Document syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@>\|[<>]=\=\|<=>\|===\|[=!]=\|[=!]\~\|!\|`\)\%([[:space:];#(]\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration syn cluster rubyDeclaration contains=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration,rubyModuleDeclaration,rubyClassDeclaration,rubyFunction,rubyBlockParameter " Keywords " Note: the following keywords have already been defined: " begin case class def do end for if module unless until while syn match rubyControl "\<\%(and\|break\|in\|next\|not\|or\|redo\|rescue\|retry\|return\)\>[?!]\@!" syn match rubyOperator "\[?!]\@!" syn match rubyBoolean "\<\%(true\|false\)\>[?!]\@!" syn match rubyPseudoVariable "\<\%(nil\|self\|__ENCODING__\|__FILE__\|__LINE__\|__callee__\|__method__\)\>[?!]\@!" " TODO: reorganise syn match rubyBeginEnd "\<\%(BEGIN\|END\)\>[?!]\@!" " Expensive Mode - match 'end' with the appropriate opening keyword for syntax " based folding and special highlighting of module/class/method definitions if !exists("b:ruby_no_expensive") && !exists("ruby_no_expensive") syn match rubyDefine "\" nextgroup=rubyAliasDeclaration skipwhite skipnl syn match rubyDefine "\" nextgroup=rubyMethodDeclaration skipwhite skipnl syn match rubyDefine "\" nextgroup=rubyFunction skipwhite skipnl syn match rubyClass "\" nextgroup=rubyClassDeclaration skipwhite skipnl syn match rubyModule "\" nextgroup=rubyModuleDeclaration skipwhite skipnl syn region rubyMethodBlock start="\" matchgroup=rubyDefine end="\%(\" contains=ALLBUT,@rubyNotTop fold syn region rubyBlock start="\" matchgroup=rubyClass end="\" contains=ALLBUT,@rubyNotTop fold syn region rubyBlock start="\" matchgroup=rubyModule end="\" contains=ALLBUT,@rubyNotTop fold " modifiers syn match rubyConditionalModifier "\<\%(if\|unless\)\>" display syn match rubyRepeatModifier "\<\%(while\|until\)\>" display syn region rubyDoBlock matchgroup=rubyControl start="\" end="\" contains=ALLBUT,@rubyNotTop fold " curly bracket block or hash literal syn region rubyCurlyBlock matchgroup=rubyCurlyBlockDelimiter start="{" end="}" contains=ALLBUT,@rubyNotTop fold syn region rubyArrayLiteral matchgroup=rubyArrayDelimiter start="\%(\w\|[\]})]\)\@" end="\" contains=ALLBUT,@rubyNotTop fold syn region rubyCaseExpression matchgroup=rubyConditional start="\" end="\" contains=ALLBUT,@rubyNotTop fold syn region rubyConditionalExpression matchgroup=rubyConditional start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+=-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@" end="\%(\%(\%(\.\@" contains=ALLBUT,@rubyNotTop fold syn match rubyConditional "\<\%(then\|else\|when\)\>[?!]\@!" contained containedin=rubyCaseExpression syn match rubyConditional "\<\%(then\|else\|elsif\)\>[?!]\@!" contained containedin=rubyConditionalExpression syn match rubyExceptional "\<\%(\%(\%(;\|^\)\s*\)\@<=rescue\|else\|ensure\)\>[?!]\@!" contained containedin=rubyBlockExpression syn match rubyMethodExceptional "\<\%(\%(\%(;\|^\)\s*\)\@<=rescue\|else\|ensure\)\>[?!]\@!" contained containedin=rubyMethodBlock " statements with optional 'do' syn region rubyOptionalDoLine matchgroup=rubyRepeat start="\[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@" matchgroup=rubyOptionalDo end="\%(\\)" end="\ze\%(;\|$\)" oneline contains=ALLBUT,@rubyNotTop syn region rubyRepeatExpression start="\[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@" matchgroup=rubyRepeat end="\" contains=ALLBUT,@rubyNotTop nextgroup=rubyOptionalDoLine fold if !exists("ruby_minlines") let ruby_minlines = 500 endif exec "syn sync minlines=" . ruby_minlines else syn match rubyControl "\[?!]\@!" nextgroup=rubyMethodDeclaration skipwhite skipnl syn match rubyControl "\[?!]\@!" nextgroup=rubyClassDeclaration skipwhite skipnl syn match rubyControl "\[?!]\@!" nextgroup=rubyModuleDeclaration skipwhite skipnl syn match rubyControl "\<\%(case\|begin\|do\|for\|if\|unless\|while\|until\|else\|elsif\|ensure\|then\|when\|end\)\>[?!]\@!" syn match rubyKeyword "\<\%(alias\|undef\)\>[?!]\@!" endif " Special Methods if !exists("ruby_no_special_methods") syn keyword rubyAccess public protected private public_class_method private_class_method public_constant private_constant module_function " attr is a common variable name syn match rubyAttribute "\%(\%(^\|;\)\s*\)\@<=attr\>\(\s*[.=]\)\@!" syn keyword rubyAttribute attr_accessor attr_reader attr_writer syn match rubyControl "\<\%(exit!\|\%(abort\|at_exit\|exit\|fork\|loop\|trap\)\>[?!]\@!\)" syn keyword rubyEval eval class_eval instance_eval module_eval syn keyword rubyException raise fail catch throw " false positive with 'include?' syn match rubyInclude "\[?!]\@!" syn keyword rubyInclude autoload extend load prepend require require_relative syn keyword rubyKeyword callcc caller lambda proc endif " Comments and Documentation syn match rubySharpBang "\%^#!.*" display syn keyword rubyTodo FIXME NOTE TODO OPTIMIZE XXX todo contained syn match rubyComment "#.*" contains=rubySharpBang,rubySpaceError,rubyTodo,@Spell if !exists("ruby_no_comment_fold") syn region rubyMultilineComment start="\%(\%(^\s*#.*\n\)\@" transparent contains=NONE syn match rubyKeywordAsMethod "\%(\%(\.\@" transparent contains=NONE syn match rubyKeywordAsMethod "\%(\%(\.\@" transparent contains=NONE syn match rubyKeywordAsMethod "\%(\%(\.\@" transparent contains=NONE syn match rubyKeywordAsMethod "\<\%(alias\|begin\|case\|class\|def\|do\|end\)[?!]" transparent contains=NONE syn match rubyKeywordAsMethod "\<\%(if\|module\|undef\|unless\|until\|while\)[?!]" transparent contains=NONE syn match rubyKeywordAsMethod "\%(\%(\.\@" transparent contains=NONE syn match rubyKeywordAsMethod "\%(\%(\.\@" transparent contains=NONE syn match rubyKeywordAsMethod "\%(\%(\.\@" transparent contains=NONE syn match rubyKeywordAsMethod "\%(\%(\.\@" transparent contains=NONE syn match rubyKeywordAsMethod "\%(\%(\.\@" transparent contains=NONE syn match rubyKeywordAsMethod "\%(\%(\.\@" transparent contains=NONE " __END__ Directive syn region rubyData matchgroup=rubyDataDirective start="^__END__$" end="\%$" fold hi def link rubyClass rubyDefine hi def link rubyModule rubyDefine hi def link rubyMethodExceptional rubyDefine hi def link rubyDefine Define hi def link rubyFunction Function hi def link rubyConditional Conditional hi def link rubyConditionalModifier rubyConditional hi def link rubyExceptional rubyConditional hi def link rubyRepeat Repeat hi def link rubyRepeatModifier rubyRepeat hi def link rubyOptionalDo rubyRepeat hi def link rubyControl Statement hi def link rubyInclude Include hi def link rubyInteger Number hi def link rubyASCIICode Character hi def link rubyFloat Float hi def link rubyBoolean Boolean hi def link rubyException Exception if !exists("ruby_no_identifiers") hi def link rubyIdentifier Identifier else hi def link rubyIdentifier NONE endif hi def link rubyClassVariable rubyIdentifier hi def link rubyConstant Type hi def link rubyGlobalVariable rubyIdentifier hi def link rubyBlockParameter rubyIdentifier hi def link rubyInstanceVariable rubyIdentifier hi def link rubyPredefinedIdentifier rubyIdentifier hi def link rubyPredefinedConstant rubyPredefinedIdentifier hi def link rubyPredefinedVariable rubyPredefinedIdentifier hi def link rubySymbol Constant hi def link rubyKeyword Keyword hi def link rubyOperator Operator hi def link rubyBeginEnd Statement hi def link rubyAccess Statement hi def link rubyAttribute Statement hi def link rubyEval Statement hi def link rubyPseudoVariable Constant hi def link rubyComment Comment hi def link rubyData Comment hi def link rubyDataDirective Delimiter hi def link rubyDocumentation Comment hi def link rubyTodo Todo hi def link rubyQuoteEscape rubyStringEscape hi def link rubyStringEscape Special hi def link rubyInterpolationDelimiter Delimiter hi def link rubyNoInterpolation rubyString hi def link rubySharpBang PreProc hi def link rubyRegexpDelimiter rubyStringDelimiter hi def link rubySymbolDelimiter rubyStringDelimiter hi def link rubyStringDelimiter Delimiter hi def link rubyHeredoc rubyString hi def link rubyString String hi def link rubyRegexpEscape rubyRegexpSpecial hi def link rubyRegexpQuantifier rubyRegexpSpecial hi def link rubyRegexpAnchor rubyRegexpSpecial hi def link rubyRegexpDot rubyRegexpCharClass hi def link rubyRegexpCharClass rubyRegexpSpecial hi def link rubyRegexpSpecial Special hi def link rubyRegexpComment Comment hi def link rubyRegexp rubyString hi def link rubyInvalidVariable Error hi def link rubyError Error hi def link rubySpaceError rubyError let b:current_syntax = "ruby" " vim: nowrap sw=2 sts=2 ts=8 noet: vim-7.4.1689/runtime/syntax/samba.vim000066400000000000000000000145741267703067000174210ustar00rootroot00000000000000" Vim syntax file " Language: samba configuration files (smb.conf) " Maintainer: Rafael Garcia-Suarez " URL: http://rgarciasuarez.free.fr/vim/syntax/samba.vim " Last change: 2009 Aug 06 " " New maintainer wanted! " " 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 /%[SPugUGHvhmLMNpRdaITD]/ 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 ports 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 " Since Samba 3.0.2 syn keyword sambaKeyword contained abort afs algorithmic backend syn keyword sambaKeyword contained charset cups defer display syn keyword sambaKeyword contained enable idmap kerberos lookups syn keyword sambaKeyword contained methods modules nested NIS ntlm NTLMv2 syn keyword sambaKeyword contained objects paranoid partners passdb syn keyword sambaKeyword contained plaintext prefix primary private syn keyword sambaKeyword contained profile quota realm replication syn keyword sambaKeyword contained reported rid schannel sendfile sharing syn keyword sambaKeyword contained shutdown signing special spnego syn keyword sambaKeyword contained store unknown unwriteable " Define the default highlighting. " For version 5.7 and earlier: only 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/sas.vim000066400000000000000000000273631267703067000171240ustar00rootroot00000000000000" Vim syntax file " Language: SAS " Maintainer: James Kidd " Last Change: 2012 Apr 20 " Corrected bug causing some keywords to appear as strings instead " 18 Jul 2008 by Paulo Tanimoto " Fixed comments with * taking multiple lines. " Fixed highlighting of macro keywords. " Added words to cases that didn't fit anywhere. " 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_]\>" " Block comment syn region sasComment start="/\*" end="\*/" contains=sasTodo " Ignore misleading //JCL SYNTAX... (Bob Heckel) syn region sasComment start="[^/][^/]/\*" end="\*/" contains=sasTodo " Previous code for comments was written by Bob Heckel " Comments with * may take multiple lines (Paulo Tanimoto) syn region sasComment start=";\s*\*"hs=s+1 end=";" contains=sasTodo " Comments with * starting after a semicolon (Paulo Tanimoto) syn region sasComment start="^\s*\*" end=";" 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 hllwarth 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 " Match declarations have to appear one per line (Paulo Tanimoto) syn match sasStatement "FOOTNOTE\d" syn match sasStatement "TITLE\d" " Match declarations have to appear one per line (Paulo Tanimoto) syn match sasMacro "%BQUOTE" syn match sasMacro "%NRBQUOTE" syn match sasMacro "%CMPRES" syn match sasMacro "%QCMPRES" syn match sasMacro "%COMPSTOR" syn match sasMacro "%DATATYP" syn match sasMacro "%DISPLAY" syn match sasMacro "%DO" syn match sasMacro "%ELSE" syn match sasMacro "%END" syn match sasMacro "%EVAL" syn match sasMacro "%GLOBAL" syn match sasMacro "%GOTO" syn match sasMacro "%IF" syn match sasMacro "%INDEX" syn match sasMacro "%INPUT" syn match sasMacro "%KEYDEF" syn match sasMacro "%LABEL" syn match sasMacro "%LEFT" syn match sasMacro "%LENGTH" syn match sasMacro "%LET" syn match sasMacro "%LOCAL" syn match sasMacro "%LOWCASE" syn match sasMacro "%MACRO" syn match sasMacro "%MEND" syn match sasMacro "%NRBQUOTE" syn match sasMacro "%NRQUOTE" syn match sasMacro "%NRSTR" syn match sasMacro "%PUT" syn match sasMacro "%QCMPRES" syn match sasMacro "%QLEFT" syn match sasMacro "%QLOWCASE" syn match sasMacro "%QSCAN" syn match sasMacro "%QSUBSTR" syn match sasMacro "%QSYSFUNC" syn match sasMacro "%QTRIM" syn match sasMacro "%QUOTE" syn match sasMacro "%QUPCASE" syn match sasMacro "%SCAN" syn match sasMacro "%STR" syn match sasMacro "%SUBSTR" syn match sasMacro "%SUPERQ" syn match sasMacro "%SYSCALL" syn match sasMacro "%SYSEVALF" syn match sasMacro "%SYSEXEC" syn match sasMacro "%SYSFUNC" syn match sasMacro "%SYSGET" syn match sasMacro "%SYSLPUT" syn match sasMacro "%SYSPROD" syn match sasMacro "%SYSRC" syn match sasMacro "%SYSRPUT" syn match sasMacro "%THEN" syn match sasMacro "%TO" syn match sasMacro "%TRIM" syn match sasMacro "%UNQUOTE" syn match sasMacro "%UNTIL" syn match sasMacro "%UPCASE" syn match sasMacro "%VERIFY" syn match sasMacro "%WHILE" syn match sasMacro "%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). " Added others that were missing. syn keyword sasUnderscore _ALL_ _AUTOMATIC_ _CHARACTER_ _INFILE_ _N_ _NAME_ _NULL_ _NUMERIC_ _USER_ _WEBOUT_ " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/sass.vim000066400000000000000000000131471267703067000173020ustar00rootroot00000000000000" Vim syntax file " Language: Sass " Maintainer: Tim Pope " Filenames: *.sass " Last Change: 2013 May 30 if exists("b:current_syntax") finish endif runtime! syntax/css.vim syn case ignore syn cluster sassCssProperties contains=cssFontProp,cssFontDescriptorProp,cssColorProp,cssTextProp,cssBoxProp,cssGeneratedContentProp,cssPagingProp,cssUIProp,cssRenderProp,cssAuralProp,cssTableProp syn cluster sassCssAttributes contains=css.*Attr,scssComment,cssValue.*,cssColor,cssURL,sassDefault,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssRenderProp syn region sassDefinition matchgroup=cssBraces start="{" end="}" contains=TOP syn match sassProperty "\%([{};]\s*\|^\)\@<=\%([[:alnum:]-]\|#{[^{}]*}\)\+\s*:" contains=css.*Prop skipwhite nextgroup=sassCssAttribute contained containedin=sassDefinition syn match sassProperty "^\s*\zs\s\%(\%([[:alnum:]-]\|#{[^{}]*}\)\+\s*:\|:[[:alnum:]-]\+\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=sassCssAttribute syn match sassProperty "^\s*\zs\s\%(:\=[[:alnum:]-]\+\s*=\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=sassCssAttribute syn match sassCssAttribute +\%("\%([^"]\|\\"\)*"\|'\%([^']\|\\'\)*'\|#{[^{}]*}\|[^{};]\)*+ contained contains=@sassCssAttributes,sassVariable,sassFunction,sassInterpolation syn match sassDefault "!default\>" contained syn match sassVariable "!\%(important\>\|default\>\)\@![[:alnum:]_-]\+" syn match sassVariable "$[[:alnum:]_-]\+" syn match sassVariableAssignment "\%([!$][[:alnum:]_-]\+\s*\)\@<=\%(||\)\==" nextgroup=sassCssAttribute skipwhite syn match sassVariableAssignment "\%([!$][[:alnum:]_-]\+\s*\)\@<=:" nextgroup=sassCssAttribute skipwhite syn match sassFunction "\<\%(rgb\|rgba\|red\|green\|blue\|mix\)\>(\@=" contained syn match sassFunction "\<\%(hsl\|hsla\|hue\|saturation\|lightness\|adjust-hue\|lighten\|darken\|saturate\|desaturate\|grayscale\|complement\)\>(\@=" contained syn match sassFunction "\<\%(alpha\|opacity\|rgba\|opacify\|fade-in\|transparentize\|fade-out\)\>(\@=" contained syn match sassFunction "\<\%(unquote\|quote\)\>(\@=" contained syn match sassFunction "\<\%(percentage\|round\|ceil\|floor\|abs\)\>(\@=" contained syn match sassFunction "\<\%(type-of\|unit\|unitless\|comparable\)\>(\@=" contained syn region sassInterpolation matchgroup=sassInterpolationDelimiter start="#{" end="}" contains=@sassCssAttributes,sassVariable,sassFunction containedin=cssStringQ,cssStringQQ,cssPseudoClass,sassProperty syn match sassMixinName "[[:alnum:]_-]\+" contained nextgroup=sassCssAttribute syn match sassMixin "^=" nextgroup=sassMixinName skipwhite syn match sassMixin "\%([{};]\s*\|^\s*\)\@<=@mixin" nextgroup=sassMixinName skipwhite syn match sassMixing "^\s\+\zs+" nextgroup=sassMixinName syn match sassMixing "\%([{};]\s*\|^\s*\)\@<=@include" nextgroup=sassMixinName skipwhite syn match sassExtend "\%([{};]\s*\|^\s*\)\@<=@extend" syn match sassPlaceholder "\%([{};]\s*\|^\s*\)\@<=%" nextgroup=sassMixinName skipwhite syn match sassFunctionName "[[:alnum:]_-]\+" contained nextgroup=sassCssAttribute syn match sassFunctionDecl "\%([{};]\s*\|^\s*\)\@<=@function" nextgroup=sassFunctionName skipwhite syn match sassReturn "\%([{};]\s*\|^\s*\)\@<=@return" syn match sassEscape "^\s*\zs\\" syn match sassIdChar "#[[:alnum:]_-]\@=" nextgroup=sassId syn match sassId "[[:alnum:]_-]\+" contained syn match sassClassChar "\.[[:alnum:]_-]\@=" nextgroup=sassClass syn match sassClass "[[:alnum:]_-]\+" contained syn match sassAmpersand "&" " TODO: Attribute namespaces " TODO: Arithmetic (including strings and concatenation) syn region sassInclude start="@import" end=";\|$" contains=scssComment,cssStringQ,cssStringQQ,cssURL,cssUnicodeEscape,cssMediaType syn region sassDebugLine end=";\|$" matchgroup=sassDebug start="@debug\>" contains=@sassCssAttributes,sassVariable,sassFunction syn region sassWarnLine end=";\|$" matchgroup=sassWarn start="@warn\>" contains=@sassCssAttributes,sassVariable,sassFunction syn region sassControlLine matchgroup=sassControl start="@\%(if\|else\%(\s\+if\)\=\|while\|for\|each\)\>" end="[{};]\@=\|$" contains=sassFor,@sassCssAttributes,sassVariable,sassFunction syn keyword sassFor from to through in contained syn keyword sassTodo FIXME NOTE TODO OPTIMIZE XXX contained syn region sassComment start="^\z(\s*\)//" end="^\%(\z1 \)\@!" contains=sassTodo,@Spell syn region sassCssComment start="^\z(\s*\)/\*" end="^\%(\z1 \)\@!" contains=sassTodo,@Spell hi def link sassCssComment sassComment hi def link sassComment Comment hi def link sassDefault cssImportant hi def link sassVariable Identifier hi def link sassFunction Function hi def link sassMixing PreProc hi def link sassMixin PreProc hi def link sassPlaceholder PreProc hi def link sassExtend PreProc hi def link sassFunctionDecl PreProc hi def link sassReturn PreProc hi def link sassTodo Todo hi def link sassInclude Include hi def link sassDebug sassControl hi def link sassWarn sassControl hi def link sassControl PreProc hi def link sassFor PreProc hi def link sassEscape Special hi def link sassIdChar Special hi def link sassClassChar Special hi def link sassInterpolationDelimiter Delimiter hi def link sassAmpersand Character hi def link sassId Identifier hi def link sassClass Type let b:current_syntax = "sass" " vim:set sw=2: vim-7.4.1689/runtime/syntax/sather.vim000066400000000000000000000073641267703067000176230ustar00rootroot00000000000000" Vim syntax file " Language: Sather/pSather " Maintainer: Claudio Fleiner " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/scheme.vim000066400000000000000000000424031267703067000175720ustar00rootroot00000000000000" Vim syntax file " Language: Scheme (R5RS + some R6RS extras) " Last Change: 2012 May 13 " Maintainer: Sergey Khorev " Original author: Dirk van Deun " 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. " MzScheme extensions can be activated with setting is_mzscheme variable " 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 let s:cpo_save = &cpo set cpo&vim syn case ignore " Fascist highlighting: everything that doesn't fit the rules is an error... syn match schemeError ![^ \t()\[\]";]*! syn match schemeError ")" " 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 " Popular Scheme extension: " using [] as well as () 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=ALL syn region schemeUnquote matchgroup=Delimiter start=",@(" end=")" contains=ALL 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=ALL syn region schemeUnquote matchgroup=Delimiter start=",@\[" end="\]" contains=ALL 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 " R6RS syn keyword schemeSyntax define-record-type fields protocol 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<=? 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>? 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 " R6RS syn keyword schemeFunc make-eq-hashtable make-eqv-hashtable make-hashtable syn keyword schemeFunc hashtable? hashtable-size hashtable-ref hashtable-set! syn keyword schemeFunc hashtable-delete! hashtable-contains? hashtable-update! syn keyword schemeFunc hashtable-copy hashtable-clear! hashtable-keys syn keyword schemeFunc hashtable-entries hashtable-equivalence-function hashtable-hash-function syn keyword schemeFunc hashtable-mutable? equal-hash string-hash string-ci-hash symbol-hash syn keyword schemeFunc find for-all exists filter partition fold-left fold-right syn keyword schemeFunc remp remove remv remq memp assp cons* " ... 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 !\.[ \t\[\]()";]!me=e-1 syn match schemeDelimiter !\.$! " ... and a single dot is not a number but a delimiter " This keeps all other stuff unhighlighted, except *stuff* and : syn match schemeOther ,[a-z!$%&*/:<=>?^_~+@#%-][-a-z!$%&*/:<=>?^_~0-9+.@#%]*, syn match schemeError ,[a-z!$%&*/:<=>?^_~+@#%-][-a-z!$%&*/:<=>?^_~0-9+.@#%]*[^-a-z!$%&*/:<=>?^_~0-9+.@ \t\[\]()";]\+[^ \t\[\]()";]*, syn match schemeOther "\.\.\." syn match schemeError !\.\.\.[^ \t\[\]()";]\+! " ... a special identifier syn match schemeConstant ,\*[-a-z!$%&*/:<=>?^_~0-9+.@]\+\*[ \t\[\]()";],me=e-1 syn match schemeConstant ,\*[-a-z!$%&*/:<=>?^_~0-9+.@]\+\*$, syn match schemeError ,\*[-a-z!$%&*/:<=>?^_~0-9+.@]*\*[^-a-z!$%&*/:<=>?^_~0-9+.@ \t\[\]()";]\+[^ \t\[\]()";]*, syn match schemeConstant ,<[-a-z!$%&*/:<=>?^_~0-9+.@]*>[ \t\[\]()";],me=e-1 syn match schemeConstant ,<[-a-z!$%&*/:<=>?^_~0-9+.@]*>$, syn match schemeError ,<[-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 schemeStruc matchgroup=Delimiter start="\[" matchgroup=Delimiter end="\]" contains=ALL syn region schemeStruc matchgroup=Delimiter start="#\[" matchgroup=Delimiter end="\]" contains=ALL " Simple literals: syn region schemeString start=+\%(\\\)\@?^_~0-9+.@#%]\+" " anything limited by |'s is identifier syn match schemeOther "|[^|]\+|" syn match schemeCharacter "#\\\%(return\|tab\)" " Modules require stmt syn keyword schemeExtSyntax module require dynamic-require lib prefix all-except prefix-all-except rename " modules provide stmt syn keyword schemeExtSyntax provide struct all-from all-from-except all-defined all-defined-except " Other from MzScheme syn keyword schemeExtSyntax with-handlers when unless instantiate define-struct case-lambda syntax-case syn keyword schemeExtSyntax free-identifier=? bound-identifier=? module-identifier=? syntax-object->datum syn keyword schemeExtSyntax datum->syntax-object syn keyword schemeExtSyntax let-values let*-values letrec-values set!-values fluid-let parameterize begin0 syn keyword schemeExtSyntax error raise opt-lambda define-values unit unit/sig define-signature syn keyword schemeExtSyntax invoke-unit/sig define-values/invoke-unit/sig compound-unit/sig import export syn keyword schemeExtSyntax link syntax quasisyntax unsyntax with-syntax syn keyword schemeExtFunc format system-type current-extension-compiler current-extension-linker syn keyword schemeExtFunc use-standard-linker use-standard-compiler syn keyword schemeExtFunc find-executable-path append-object-suffix append-extension-suffix syn keyword schemeExtFunc current-library-collection-paths current-extension-compiler-flags make-parameter syn keyword schemeExtFunc current-directory build-path normalize-path current-extension-linker-flags syn keyword schemeExtFunc file-exists? directory-exists? delete-directory/files delete-directory delete-file syn keyword schemeExtFunc system compile-file system-library-subpath getenv putenv current-standard-link-libraries syn keyword schemeExtFunc remove* file-size find-files fold-files directory-list shell-execute split-path syn keyword schemeExtFunc current-error-port process/ports process printf fprintf open-input-string open-output-string syn keyword schemeExtFunc get-output-string " exceptions syn keyword schemeExtFunc exn exn:application:arity exn:application:continuation exn:application:fprintf:mismatch syn keyword schemeExtFunc exn:application:mismatch exn:application:type exn:application:mismatch exn:break exn:i/o:filesystem exn:i/o:port syn keyword schemeExtFunc exn:i/o:port:closed exn:i/o:tcp exn:i/o:udp exn:misc exn:misc:application exn:misc:unsupported exn:module exn:read syn keyword schemeExtFunc exn:read:non-char exn:special-comment exn:syntax exn:thread exn:user exn:variable exn:application:mismatch syn keyword schemeExtFunc exn? exn:application:arity? exn:application:continuation? exn:application:fprintf:mismatch? exn:application:mismatch? syn keyword schemeExtFunc exn:application:type? exn:application:mismatch? exn:break? exn:i/o:filesystem? exn:i/o:port? exn:i/o:port:closed? syn keyword schemeExtFunc exn:i/o:tcp? exn:i/o:udp? exn:misc? exn:misc:application? exn:misc:unsupported? exn:module? exn:read? exn:read:non-char? syn keyword schemeExtFunc exn:special-comment? exn:syntax? exn:thread? exn:user? exn:variable? exn:application:mismatch? " Command-line parsing syn keyword schemeExtFunc command-line current-command-line-arguments once-any help-labels multi once-each " syntax quoting, unquoting and quasiquotation syn region schemeUnquote matchgroup=Delimiter start="#," end=![ \t\[\]()";]!me=e-1 contains=ALL syn region schemeUnquote matchgroup=Delimiter start="#,@" end=![ \t\[\]()";]!me=e-1 contains=ALL syn region schemeUnquote matchgroup=Delimiter start="#,(" end=")" contains=ALL syn region schemeUnquote matchgroup=Delimiter start="#,@(" end=")" contains=ALL syn region schemeUnquote matchgroup=Delimiter start="#,\[" end="\]" contains=ALL syn region schemeUnquote matchgroup=Delimiter start="#,@\[" end="\]" contains=ALL syn region schemeQuoted matchgroup=Delimiter start="#['`]" end=![ \t()\[\]";]!me=e-1 contains=ALL syn region schemeQuoted matchgroup=Delimiter start="#['`](" matchgroup=Delimiter end=")" contains=ALL endif if exists("b:is_chicken") || exists("is_chicken") " multiline comment syntax region schemeMultilineComment start=/#|/ end=/|#/ contains=@Spell,schemeMultilineComment syn match schemeOther "##[-a-z!$%&*/:<=>?^_~0-9+.@#%]\+" syn match schemeExtSyntax "#:[-a-z!$%&*/:<=>?^_~0-9+.@#%]\+" syn keyword schemeExtSyntax unit uses declare hide foreign-declare foreign-parse foreign-parse/spec syn keyword schemeExtSyntax foreign-lambda foreign-lambda* define-external define-macro load-library syn keyword schemeExtSyntax let-values let*-values letrec-values ->string require-extension syn keyword schemeExtSyntax let-optionals let-optionals* define-foreign-variable define-record syn keyword schemeExtSyntax pointer tag-pointer tagged-pointer? define-foreign-type syn keyword schemeExtSyntax require require-for-syntax cond-expand and-let* receive argc+argv syn keyword schemeExtSyntax fixnum? fx= fx> fx< fx>= fx<= fxmin fxmax syn keyword schemeExtFunc ##core#inline ##sys#error ##sys#update-errno " here-string syn region schemeString start=+#<<\s*\z(.*\)+ end=+^\z1$+ contains=@Spell if filereadable(expand(":p:h")."/cpp.vim") unlet! b:current_syntax syn include @ChickenC :p:h/cpp.vim syn region ChickenC matchgroup=schemeOther start=+(\@<=foreign-declare "+ end=+")\@=+ contains=@ChickenC syn region ChickenC matchgroup=schemeComment start=+foreign-declare\s*#<<\z(.*\)$+hs=s+15 end=+^\z1$+ contains=@ChickenC syn region ChickenC matchgroup=schemeOther start=+(\@<=foreign-parse "+ end=+")\@=+ contains=@ChickenC syn region ChickenC matchgroup=schemeComment start=+foreign-parse\s*#<<\z(.*\)$+hs=s+13 end=+^\z1$+ contains=@ChickenC syn region ChickenC matchgroup=schemeOther start=+(\@<=foreign-parse/spec "+ end=+")\@=+ contains=@ChickenC syn region ChickenC matchgroup=schemeComment start=+foreign-parse/spec\s*#<<\z(.*\)$+hs=s+18 end=+^\z1$+ contains=@ChickenC syn region ChickenC matchgroup=schemeComment start=+#>+ end=+<#+ contains=@ChickenC syn region ChickenC matchgroup=schemeComment start=+#>?+ end=+<#+ contains=@ChickenC syn region ChickenC matchgroup=schemeComment start=+#>!+ end=+<#+ contains=@ChickenC syn region ChickenC matchgroup=schemeComment start=+#>\$+ end=+<#+ contains=@ChickenC syn region ChickenC matchgroup=schemeComment start=+#>%+ end=+<#+ contains=@ChickenC endif " suggested by Alex Queiroz syn match schemeExtSyntax "#![-a-z!$%&*/:<=>?^_~0-9+.@#%]\+" syn region schemeString start=+#<#\s*\z(.*\)+ end=+^\z1$+ contains=@Spell endif " 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 else command -nargs=+ HiLink hi def link endif HiLink schemeSyntax Statement HiLink schemeFunc Function HiLink schemeString String HiLink schemeCharacter Character HiLink schemeNumber Number HiLink schemeBoolean Boolean HiLink schemeDelimiter Delimiter HiLink schemeConstant Constant HiLink schemeComment Comment HiLink schemeMultilineComment Comment HiLink schemeError Error HiLink schemeExtSyntax Type HiLink schemeExtFunc PreProc delcommand HiLink endif let b:current_syntax = "scheme" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/scilab.vim000066400000000000000000000067021267703067000175650ustar00rootroot00000000000000" " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/screen.vim000066400000000000000000000216201267703067000176030ustar00rootroot00000000000000" Vim syntax file " Language: screen(1) configuration file " Maintainer: Dmitri Vereshchagin " Previous Maintainer: Nikolai Weibull " Latest Revision: 2015-09-24 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn match screenEscape '\\.' syn keyword screenTodo contained TODO FIXME XXX NOTE syn region screenComment display oneline start='#' end='$' \ contains=screenTodo,@Spell syn region screenString display oneline start=+"+ skip=+\\"+ end=+"+ \ contains=screenVariable,screenSpecial syn region screenLiteral display oneline start=+'+ skip=+\\'+ end=+'+ syn match screenVariable contained display '$\%(\h\w*\|{\h\w*}\)' syn keyword screenBoolean on off syn match screenNumbers display '\<\d\+\>' syn match screenSpecials contained \ '%\%([%aAdDhlmMstuwWyY?:{]\|[0-9]*n\|0?cC\)' syn keyword screenCommands \ acladd \ aclchg \ acldel \ aclgrp \ aclumask \ activity \ addacl \ allpartial \ altscreen \ at \ attrcolor \ autodetach \ autonuke \ backtick \ bce \ bd_bc_down \ bd_bc_left \ bd_bc_right \ bd_bc_up \ bd_bell \ bd_braille_table \ bd_eightdot \ bd_info \ bd_link \ bd_lower_left \ bd_lower_right \ bd_ncrc \ bd_port \ bd_scroll \ bd_skip \ bd_start_braille \ bd_type \ bd_upper_left \ bd_upper_right \ bd_width \ bell \ bell_msg \ bind \ bindkey \ blanker \ blankerprg \ break \ breaktype \ bufferfile \ bumpleft \ bumpright \ c1 \ caption \ chacl \ charset \ chdir \ cjkwidth \ clear \ collapse \ colon \ command \ compacthist \ console \ copy \ crlf \ debug \ defautonuke \ defbce \ defbreaktype \ defc1 \ defcharset \ defencoding \ defescape \ defflow \ defgr \ defhstatus \ defkanji \ deflog \ deflogin \ defmode \ defmonitor \ defmousetrack \ defnonblock \ defobuflimit \ defscrollback \ defshell \ defsilence \ defslowpaste \ defutf8 \ defwrap \ defwritelock \ defzombie \ detach \ digraph \ dinfo \ displays \ dumptermcap \ echo \ encoding \ escape \ eval \ exec \ fit \ flow \ focus \ focusminsize \ gr \ group \ hardcopy \ hardcopy_append \ hardcopydir \ hardstatus \ height \ help \ history \ hstatus \ idle \ ignorecase \ info \ kanji \ kill \ lastmsg \ layout \ license \ lockscreen \ log \ logfile \ login \ logtstamp \ mapdefault \ mapnotnext \ maptimeout \ markkeys \ maxwin \ meta \ monitor \ mousetrack \ msgminwait \ msgwait \ multiuser \ nethack \ next \ nonblock \ number \ obuflimit \ only \ other \ partial \ password \ paste \ pastefont \ pow_break \ pow_detach \ pow_detach_msg \ prev \ printcmd \ process \ quit \ readbuf \ readreg \ redisplay \ register \ remove \ removebuf \ rendition \ reset \ resize \ screen \ scrollback \ select \ sessionname \ setenv \ setsid \ shell \ shelltitle \ silence \ silencewait \ sleep \ slowpaste \ sorendition \ sort \ source \ split \ startup_message \ stuff \ su \ suspend \ term \ termcap \ termcapinfo \ terminfo \ time \ title \ umask \ unbindall \ unsetenv \ utf8 \ vbell \ vbell_msg \ vbellwait \ verbose \ version \ wall \ width \ windowlist \ windows \ wrap \ writebuf \ writelock \ xoff \ xon \ zmodem \ zombie \ zombie_timeout hi def link screenEscape Special hi def link screenComment Comment hi def link screenTodo Todo hi def link screenString String hi def link screenLiteral String hi def link screenVariable Identifier hi def link screenBoolean Boolean hi def link screenNumbers Number hi def link screenSpecials Special hi def link screenCommands Keyword let b:current_syntax = "screen" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/scss.vim000066400000000000000000000006311267703067000172760ustar00rootroot00000000000000" Vim syntax file " Language: SCSS " Maintainer: Tim Pope " Filenames: *.scss " Last Change: 2010 Jul 26 if exists("b:current_syntax") finish endif runtime! syntax/sass.vim syn match scssComment "//.*" contains=sassTodo,@Spell syn region scssComment start="/\*" end="\*/" contains=sassTodo,@Spell hi def link scssComment sassComment let b:current_syntax = "scss" " vim:set sw=2: vim-7.4.1689/runtime/syntax/sd.vim000066400000000000000000000047701267703067000167410ustar00rootroot00000000000000" Language: streaming descriptor file " Maintainer: Puria Nafisi Azizi (pna) " License: This file can be redistribued and/or modified under the same terms " as Vim itself. " URL: http://netstudent.polito.it/vim_syntax/ " Last Change: 2012 Feb 03 by Thilo Six if version < 600 syntax clear elseif exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim " Always ignore case syn case ignore " Comments syn match sdComment /\s*[#;].*$/ " IP Adresses syn cluster sdIPCluster contains=sdIPError,sdIPSpecial syn match sdIPError /\%(\d\{4,}\|25[6-9]\|2[6-9]\d\|[3-9]\d\{2}\)[\.0-9]*/ contained syn match sdIPSpecial /\%(127\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}\)/ contained syn match sdIP contained /\%(\d\{1,4}\.\)\{3}\d\{1,4}/ contains=@sdIPCluster " Statements syn keyword sdStatement AGGREGATE AUDIO_CHANNELS syn keyword sdStatement BYTE_PER_PCKT BIT_PER_SAMPLE BITRATE syn keyword sdStatement CLOCK_RATE CODING_TYPE CREATOR syn match sdStatement /^\s*CODING_TYPE\>/ nextgroup=sdCoding skipwhite syn match sdStatement /^\s*ENCODING_NAME\>/ nextgroup=sdEncoding skipwhite syn keyword sdStatement FILE_NAME FRAME_LEN FRAME_RATE FORCE_FRAME_RATE syn keyword sdStatement LICENSE syn match sdStatement /^\s*MEDIA_SOURCE\>/ nextgroup=sdSource skipwhite syn match sdStatement /^\s*MULTICAST\>/ nextgroup=sdIP skipwhite syn keyword sdStatement PAYLOAD_TYPE PKT_LEN PRIORITY syn keyword sdStatement SAMPLE_RATE syn keyword sdStatement TITLE TWIN syn keyword sdStatement VERIFY " Known Options syn keyword sdEncoding H26L MPV MP2T MP4V-ES syn keyword sdCoding FRAME SAMPLE syn keyword sdSource STORED LIVE "Specials syn keyword sdSpecial TRUE FALSE NULL syn keyword sdDelimiter STREAM STREAM_END syn match sdError /^search .\{257,}/ if version >= 508 || !exists("did_config_syntax_inits") if version < 508 let did_config_syntax_inits = 1 command! -nargs=+ HiLink hi link else command! -nargs=+ HiLink hi def link endif HiLink sdIP Number HiLink sdHostname Type HiLink sdEncoding Identifier HiLink sdCoding Identifier HiLink sdSource Identifier HiLink sdComment Comment HiLink sdIPError Error HiLink sdError Error HiLink sdStatement Statement HiLink sdIPSpecial Special HiLink sdSpecial Special HiLink sdDelimiter Delimiter delcommand HiLink endif let b:current_syntax = "sd" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/sdc.vim000066400000000000000000000025571267703067000171050ustar00rootroot00000000000000" Vim syntax file " Language: SDC - Synopsys Design Constraints " Maintainer: Maurizio Tranchero - maurizio.tranchero@gmail.com " Last Change: Thu Mar 25 17:35:16 CET 2009 " Credits: based on TCL Vim syntax file " Version: 0.3 " Quit when a syntax file was already loaded if exists("b:current_syntax") finish endif " Read the TCL syntax to start with runtime! syntax/tcl.vim " SDC-specific keywords syn keyword sdcCollections foreach_in_collection syn keyword sdcObjectsQuery get_clocks get_ports syn keyword sdcObjectsInfo get_point_info get_node_info get_path_info syn keyword sdcObjectsInfo get_timing_paths set_attribute syn keyword sdcConstraints set_false_path syn keyword sdcNonIdealities set_min_delay set_max_delay syn keyword sdcNonIdealities set_input_delay set_output_delay syn keyword sdcNonIdealities set_load set_min_capacitance set_max_capacitance syn keyword sdcCreateOperations create_clock create_timing_netlist update_timing_netlist " command flags highlighting syn match sdcFlags "[[:space:]]-[[:alpha:]]*\>" " Define the default highlighting. hi def link sdcCollections Repeat hi def link sdcObjectsInfo Operator hi def link sdcCreateOperations Operator hi def link sdcObjectsQuery Operator hi def link sdcConstraints Operator hi def link sdcNonIdealities Operator hi def link sdcFlags Special let b:current_syntax = "sdc" " vim: ts=8 vim-7.4.1689/runtime/syntax/sdl.vim000066400000000000000000000155661267703067000171220ustar00rootroot00000000000000" Vim syntax file " Language: SDL " Maintainer: Michael Piefel " 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 command -nargs=+ Hi hi else command -nargs=+ HiLink hi def link command -nargs=+ Hi hi def 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 vim-7.4.1689/runtime/syntax/sed.vim000066400000000000000000000123501267703067000170770ustar00rootroot00000000000000" Vim syntax file " Language: sed " Maintainer: Haakon Riiser " URL: http://folk.uio.no/hakonrk/vim/syntax/sed.vim " Last Change: 2010 May 29 " 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 "[dDgGhHlnNpPqQx=]\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(" ") " ASCII: 32, EBCDIC: 64 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 else command -nargs=+ HiLink hi def link 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 = char2nr(" ") " ASCII: 32, EBCDIC: 64 while __sed_i <= __sed_last 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_last __sed_delimiter __sed_metacharacters let b:current_syntax = "sed" " vim: sts=4 sw=4 ts=8 vim-7.4.1689/runtime/syntax/sendpr.vim000066400000000000000000000017501267703067000176210ustar00rootroot00000000000000" Vim syntax file " Language: FreeBSD send-pr file " Maintainer: Hendrik Scholz " Last Change: 2012 Feb 03 " " 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 let s:cpo_save = &cpo set cpo&vim 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 let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/sensors.vim000066400000000000000000000027351267703067000200260ustar00rootroot00000000000000" Vim syntax file " Language: sensors.conf(5) - libsensors configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2006-04-19 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn keyword sensorsTodo contained TODO FIXME XXX NOTE syn region sensorsComment display oneline start='#' end='$' \ contains=sensorsTodo,@Spell syn keyword sensorsKeyword bus chip label compute ignore set syn region sensorsName display oneline \ start=+"+ skip=+\\\\\|\\"+ end=+"+ \ contains=sensorsNameSpecial syn match sensorsName display '\w\+' syn match sensorsNameSpecial display '\\["\\rnt]' syn match sensorsLineContinue '\\$' syn match sensorsNumber display '\d*.\d\+\>' syn match sensorsRealWorld display '@' syn match sensorsOperator display '[+*/-]' syn match sensorsDelimiter display '[()]' hi def link sensorsTodo Todo hi def link sensorsComment Comment hi def link sensorsKeyword Keyword hi def link sensorsName String hi def link sensorsNameSpecial SpecialChar hi def link sensorsLineContinue Special hi def link sensorsNumber Number hi def link sensorsRealWorld Identifier hi def link sensorsOperator Normal hi def link sensorsDelimiter Normal let b:current_syntax = "sensors" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/services.vim000066400000000000000000000034231267703067000201500ustar00rootroot00000000000000" Vim syntax file " Language: services(5) - Internet network services list " Maintainer: Nikolai Weibull " Latest Revision: 2006-04-19 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn match servicesBegin display '^' \ nextgroup=servicesName,servicesComment syn match servicesName contained display '[[:graph:]]\+' \ nextgroup=servicesPort skipwhite syn match servicesPort contained display '\d\+' \ nextgroup=servicesPPDiv,servicesPPDivDepr \ skipwhite syn match servicesPPDiv contained display '/' \ nextgroup=servicesProtocol skipwhite syn match servicesPPDivDepr contained display ',' \ nextgroup=servicesProtocol skipwhite syn match servicesProtocol contained display '\S\+' \ nextgroup=servicesAliases,servicesComment \ skipwhite syn match servicesAliases contained display '\S\+' \ nextgroup=servicesAliases,servicesComment \ skipwhite syn keyword servicesTodo contained TODO FIXME XXX NOTE syn region servicesComment display oneline start='#' end='$' \ contains=servicesTodo,@Spell hi def link servicesTodo Todo hi def link servicesComment Comment hi def link servicesName Identifier hi def link servicesPort Number hi def link servicesPPDiv Delimiter hi def link servicesPPDivDepr Error hi def link servicesProtocol Type hi def link servicesAliases Macro let b:current_syntax = "services" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/setserial.vim000066400000000000000000000121411267703067000203150ustar00rootroot00000000000000" Vim syntax file " Language: setserial(8) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2006-04-19 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn match setserialBegin display '^' \ nextgroup=setserialDevice,setserialComment \ skipwhite syn match setserialDevice contained display '\%(/[^ \t/]*\)\+' \ nextgroup=setserialParameter skipwhite syn keyword setserialParameter contained port irq baud_base divisor \ close_delay closing_wait rx_trigger \ tx_trigger flow_off flow_on rx_timeout \ nextgroup=setserialNumber skipwhite syn keyword setserialParameter contained uart \ nextgroup=setserialUARTType skipwhite syn keyword setserialParameter contained autoconfig auto_irq skip_test \ spd_hi spd_vhi spd_shi spd_warp spd_cust \ spd_normal sak fourport session_lockout \ pgrp_lockout hup_notify split_termios \ callout_nohup low_latency \ nextgroup=setserialParameter skipwhite syn match setserialParameter contained display \ '\^\%(auto_irq\|skip_test\|sak\|fourport\)' \ contains=setserialNegation \ nextgroup=setserialParameter skipwhite syn match setserialParameter contained display \ '\^\%(session_lockout\|pgrp_lockout\)' \ contains=setserialNegation \ nextgroup=setserialParameter skipwhite syn match setserialParameter contained display \ '\^\%(hup_notify\|split_termios\)' \ contains=setserialNegation \ nextgroup=setserialParameter skipwhite syn match setserialParameter contained display \ '\^\%(callout_nohup\|low_latency\)' \ contains=setserialNegation \ nextgroup=setserialParameter skipwhite syn keyword setserialParameter contained set_multiport \ nextgroup=setserialMultiport skipwhite syn match setserialNumber contained display '\<\d\+\>' \ nextgroup=setserialParameter skipwhite syn match setserialNumber contained display '0x\x\+' \ nextgroup=setserialParameter skipwhite syn keyword setserialUARTType contained none syn match setserialUARTType contained display \ '8250\|16[4789]50\|16550A\=\|16650\%(V2\)\=' \ nextgroup=setserialParameter skipwhite syn match setserialUARTType contained display '166[59]4' \ nextgroup=setserialParameter skipwhite syn match setserialNegation contained display '\^' syn match setserialMultiport contained '\' \ nextgroup=setserialPort skipwhite syn match setserialPort contained display '\<\d\+\>' \ nextgroup=setserialMask skipwhite syn match setserialPort contained display '0x\x\+' \ nextgroup=setserialMask skipwhite syn match setserialMask contained '\' \ nextgroup=setserialBitMask skipwhite syn match setserialBitMask contained display '\<\d\+\>' \ nextgroup=setserialMatch skipwhite syn match setserialBitMask contained display '0x\x\+' \ nextgroup=setserialMatch skipwhite syn match setserialMatch contained '\' \ nextgroup=setserialMatchBits skipwhite syn match setserialMatchBits contained display '\<\d\+\>' \ nextgroup=setserialMultiport skipwhite syn match setserialMatchBits contained display '0x\x\+' \ nextgroup=setserialMultiport skipwhite syn keyword setserialTodo contained TODO FIXME XXX NOTE syn region setserialComment display oneline start='^\s*#' end='$' \ contains=setserialTodo,@Spell hi def link setserialTodo Todo hi def link setserialComment Comment hi def link setserialDevice Normal hi def link setserialParameter Identifier hi def link setserialNumber Number hi def link setserialUARTType Type hi def link setserialNegation Operator hi def link setserialMultiport Type hi def link setserialPort setserialNumber hi def link setserialMask Type hi def link setserialBitMask setserialNumber hi def link setserialMatch Type hi def link setserialMatchBits setserialNumber let b:current_syntax = "setserial" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/sgml.vim000066400000000000000000000214011267703067000172630ustar00rootroot00000000000000" Vim syntax file " Language: SGML " Maintainer: Johannes Zellner " Last Change: Tue, 27 Apr 2004 15:05:21 CEST " Filenames: *.sgml,*.sgm " $Id: sgml.vim,v 1.1 2004/06/13 17:52:57 vimboss Exp $ " For version 5.x: Clear all syntax items " 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. " ^ ^ syn match sgmlAttribPunct +[:.]+ contained display " no highlighting for sgmlEqual (sgmlEqual has no highlighting group) syn match sgmlEqual +=+ " attribute, everything before the '=' " " PROVIDES: @sgmlAttribHook " " EXAMPLE: " " " ^^^^^^^^^^^^^ " syn match sgmlAttrib \ +[^-'"<]\@<=\<[a-zA-Z0-9.:]\+\>\([^'">]\@=\|$\)+ \ contained \ contains=sgmlAttribPunct,@sgmlAttribHook \ display " UNQUOTED value (not including the '=' -- sgmlEqual) " " PROVIDES: @sgmlValueHook " " EXAMPLE: " " " ^^^^^ " syn match sgmlValue \ +[^"' =/!?<>][^ =/!?<>]*+ \ contained \ contains=sgmlEntity,sgmlUnicodeNumberAttr,@sgmlValueHook \ display " QUOTED value (not including the '=' -- sgmlEqual) " " PROVIDES: @sgmlValueHook " " EXAMPLE: " " " ^^^^^^^ " " ^^^^^^^ " 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: " " " ^^^^^^^^^ " " ^^^^^^^ " 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: " " "']\+/\_[^/]\+/+ \ 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: " " " " " " some data " " " SGML specific: " compared to xmlRegion: " - removed folding " - added a single '/'in the start pattern " syn region sgmlRegion \ start=+<\z([^ /!?>"']\+\)\(\(\_[^/>]*[^/!?]>\)\|>\)+ \ end=++ \ contains=sgmlTag,sgmlEndTag,sgmlCdata,@sgmlRegionCluster,sgmlComment,sgmlEntity,sgmlUnicodeNumberData,@sgmlRegionHook \ keepend \ extend " empty tags. Just a container, no highlighting. " Compare this with sgmlTag. " " EXAMPLE: " " " " 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=++ contains=sgmlCommentPart,sgmlString,sgmlCommentError,sgmlTodo syn keyword sgmlTodo contained TODO FIXME XXX display syn match sgmlCommentError contained "[^>+ \ contains=sgmlCdataStart,sgmlCdataEnd,@sgmlCdataHook \ keepend \ extend " using the following line instead leads to corrupt folding at CDATA regions " syn match sgmlCdata ++ contains=sgmlCdataStart,sgmlCdataEnd,@sgmlCdataHook syn match sgmlCdataStart ++ contained " Processing instructions " This allows "?>" inside strings -- good idea? syn region sgmlProcessing matchgroup=sgmlProcessingDelim start="" contains=sgmlAttrib,sgmlEqualValue " DTD -- we use dtd.vim here syn region sgmlDocType matchgroup=sgmlDocTypeDecl start="\c" contains=sgmlDocTypeKeyword,sgmlInlineDTD,sgmlString syn keyword sgmlDocTypeKeyword contained DOCTYPE PUBLIC SYSTEM syn region sgmlInlineDTD contained start="\[" end="]" contains=@sgmlDTD syn include @sgmlDTD :p:h/dtd.vim " synchronizing " TODO !!! to be improved !!! syn sync match sgmlSyncDT grouphere sgmlDocType +\_.\(+ 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 vim-7.4.1689/runtime/syntax/sgmldecl.vim000066400000000000000000000046511267703067000201230ustar00rootroot00000000000000" Vim syntax file " Language: SGML (SGML Declaration ) " Last Change: jueves, 28 de diciembre de 2000, 13:51:44 CLST " Maintainer: "Daniel A. Molina W." " 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 let s:keepcpo= &cpo set cpo&vim syn case ignore syn region sgmldeclDeclBlock transparent start=++ 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 else command -nargs=+ HiLink hi def link 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" let &cpo = s:keepcpo unlet s:keepcpo " vim:set tw=78 ts=4: vim-7.4.1689/runtime/syntax/sgmllnx.vim000066400000000000000000000042711267703067000200130ustar00rootroot00000000000000" Vim syntax file " Language: SGML-linuxdoc (supported by old sgmltools-1.x) " Maintainer: SungHyun Nam " Last Change: 2013 May 13 " For version 5.x: Clear all syntax items " 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=++ 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 ++ syn region sgmllnxDocType start=++ " Define the default highlighting. " For version 5.7 and earlier: only 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 else command -nargs=+ HiLink hi def link 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: vim-7.4.1689/runtime/syntax/sh.vim000066400000000000000000001132741267703067000167450ustar00rootroot00000000000000" Vim syntax file " Language: shell (sh) Korn shell (ksh) bash (sh) " Maintainer: Charles E. Campbell " Previous Maintainer: Lennart Schultz " Last Change: Mar 12, 2016 " Version: 146 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH " For options and settings, please use: :help ft-sh-syntax " This file includes many ideas from Eric Brunet (eric.brunet@ens.fr) " For version 5.x: Clear all syntax items {{{1 " For version 6.x: Quit when a syntax file was already loaded if version < 600 syntax clear elseif exists("b:current_syntax") finish endif " trying to answer the question: which shell is /bin/sh, really? " If the user has not specified any of g:is_kornshell, g:is_bash, g:is_posix, g:is_sh, then guess. if !exists("g:is_kornshell") && !exists("g:is_bash") && !exists("g:is_posix") && !exists("g:is_sh") let s:shell = "" if executable("/bin/sh") let s:shell = resolve("/bin/sh") elseif executable("/usr/bin/sh") let s:shell = resolve("/usr/bin/sh") endif if s:shell =~ 'bash$' let g:is_bash= 1 elseif s:shell =~ 'ksh$' let g:is_kornshell = 1 elseif s:shell =~ 'dash$' let g:is_posix = 1 endif unlet s:shell endif " handling /bin/sh with is_kornshell/is_sh {{{1 " 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 "g:is_bash", "g:is_kornshell", " or "g:is_posix", 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("g:is_posix") && !exists("g:is_kornshell") let g:is_kornshell= g:is_posix endif if exists("g:is_kornshell") let b:is_kornshell= 1 if exists("b:is_sh") unlet b:is_sh endif elseif exists("g: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 " set up default g:sh_fold_enabled {{{1 " ================================ if !exists("g:sh_fold_enabled") let g:sh_fold_enabled= 0 elseif g:sh_fold_enabled != 0 && !has("folding") let g:sh_fold_enabled= 0 echomsg "Ignoring g:sh_fold_enabled=".g:sh_fold_enabled."; need to re-compile vim for +fold support" endif if !exists("s:sh_fold_functions") let s:sh_fold_functions= and(g:sh_fold_enabled,1) endif if !exists("s:sh_fold_heredoc") let s:sh_fold_heredoc = and(g:sh_fold_enabled,2) endif if !exists("s:sh_fold_ifdofor") let s:sh_fold_ifdofor = and(g:sh_fold_enabled,4) endif if g:sh_fold_enabled && &fdm == "manual" " Given that the user provided g:sh_fold_enabled " AND g:sh_fold_enabled is manual (usual default) " implies a desire for syntax-based folding setl fdm=syntax endif " set up the syntax-highlighting iskeyword if has("patch-7.4.1141") exe "syn iskeyword ".&iskeyword.",-" endif " Set up folding commands for shell {{{1 " ================================= if s:sh_fold_functions com! -nargs=* ShFoldFunctions fold else com! -nargs=* ShFoldFunctions endif if s:sh_fold_heredoc com! -nargs=* ShFoldHereDoc fold else com! -nargs=* ShFoldHereDoc endif if s:sh_fold_ifdofor com! -nargs=* ShFoldIfDoFor fold else com! -nargs=* ShFoldIfDoFor endif " sh syntax is case sensitive {{{1 syn case match " Clusters: contains=@... clusters {{{1 "================================== syn cluster shErrorList contains=shDoError,shIfError,shInError,shCaseError,shEsacError,shCurlyError,shParenError,shTestError,shOK if exists("b:is_kornshell") syn cluster ErrorList add=shDTestError endif syn cluster shArithParenList contains=shArithmetic,shCaseEsac,shComment,shDeref,shDo,shDerefSimple,shEcho,shEscape,shNumber,shOperator,shPosnParm,shExSingleQuote,shExDoubleQuote,shRedir,shSingleQuote,shDoubleQuote,shStatement,shVariable,shAlias,shTest,shCtrlSeq,shSpecial,shParen,bashSpecialVariables,bashStatement,shIf,shFor syn cluster shArithList contains=@shArithParenList,shParenError syn cluster shCaseEsacList contains=shCaseStart,shCase,shCaseBar,shCaseIn,shComment,shDeref,shDerefSimple,shCaseCommandSub,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote,shCtrlSeq,@shErrorList,shStringSpecial,shCaseRange syn cluster shCaseList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shRedir,shSetList,shSource,shStatement,shVariable,shCtrlSeq syn cluster shCommandSubList contains=shAlias,shArithmetic,shComment,shCmdParenRegion,shCtrlSeq,shDeref,shDerefSimple,shDoubleQuote,shEcho,shEscape,shExDoubleQuote,shExpr,shExSingleQuote,shNumber,shOperator,shOption,shPosnParm,shSingleQuote,shSpecial,shStatement,shSubSh,shTest,shVariable syn cluster shCurlyList contains=shNumber,shComma,shDeref,shDerefSimple,shDerefSpecial syn cluster shDblQuoteList contains=shCommandSub,shDeref,shDerefSimple,shEscape,shPosnParm,shCtrlSeq,shSpecial syn cluster shDerefList contains=shDeref,shDerefSimple,shDerefVar,shDerefSpecial,shDerefWordError,shDerefPSR,shDerefPPS syn cluster shDerefVarList contains=shDerefOp,shDerefVarArray,shDerefOpError syn cluster shEchoList contains=shArithmetic,shCommandSub,shDeref,shDerefSimple,shEscape,shExpr,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shCtrlSeq,shEchoQuote syn cluster shExprList1 contains=shCharClass,shNumber,shOperator,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shExpr,shDblBrace,shDeref,shDerefSimple,shCtrlSeq syn cluster shExprList2 contains=@shExprList1,@shCaseList,shTest syn cluster shFunctionList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shOption,shRedir,shSetList,shSource,shStatement,shVariable,shOperator,shCtrlSeq if exists("b:is_kornshell") || exists("b:is_bash") syn cluster shFunctionList add=shRepeat syn cluster shFunctionList add=shDblBrace,shDblParen endif syn cluster shHereBeginList contains=@shCommandSubList syn cluster shHereList contains=shBeginHere,shHerePayload syn cluster shHereListDQ contains=shBeginHere,@shDblQuoteList,shHerePayload syn cluster shIdList contains=shCommandSub,shWrapLineOperator,shSetOption,shDeref,shDerefSimple,shRedir,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shExpr,shCtrlSeq,shStringSpecial,shAtExpr syn cluster shIfList contains=@shLoopList,shDblBrace,shDblParen,shFunctionKey,shFunctionOne,shFunctionTwo syn cluster shLoopList contains=@shCaseList,@shErrorList,shCaseEsac,shConditional,shDblBrace,shExpr,shFor,shForPP,shIf,shOption,shSet,shTest,shTestOpr,shTouch syn cluster shSubShList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shIf,shRedir,shSetList,shSource,shStatement,shVariable,shCtrlSeq,shOperator syn cluster shTestList contains=shCharClass,shCommandSub,shCtrlSeq,shDeref,shDerefSimple,shDoubleQuote,shExDoubleQuote,shExpr,shExSingleQuote,shNumber,shOperator,shSingleQuote,shTest,shTestOpr " Echo: {{{1 " ==== " This one is needed INSIDE a CommandSub, so that `echo bla` be correct syn region shEcho matchgroup=shStatement start="\" skip="\\$" matchgroup=shEchoDelim end="$" matchgroup=NONE end="[<>;&|()`]"me=e-1 end="\d[<>]"me=e-2 end="\s#"me=e-2 contains=@shEchoList skipwhite nextgroup=shQuickComment syn region shEcho matchgroup=shStatement start="\" skip="\\$" matchgroup=shEchoDelim end="$" matchgroup=NONE end="[<>;&|()`]"me=e-1 end="\d[<>]"me=e-2 end="\s#"me=e-2 contains=@shEchoList skipwhite nextgroup=shQuickComment syn match shEchoQuote contained '\%(\\\\\)*\\["`'()]' " This must be after the strings, so that ... \" will be correct syn region shEmbeddedEcho contained matchgroup=shStatement start="\" skip="\\$" matchgroup=shEchoDelim end="$" matchgroup=NONE end="[<>;&|`)]"me=e-1 end="\d[<>]"me=e-2 end="\s#"me=e-2 contains=shNumber,shExSingleQuote,shSingleQuote,shDeref,shDerefSimple,shSpecialVar,shOperator,shExDoubleQuote,shDoubleQuote,shCharClass,shCtrlSeq " Alias: {{{1 " ===== if exists("b:is_kornshell") || exists("b:is_bash") syn match shStatement "\" syn region shAlias matchgroup=shStatement start="\\s\+\(\h[-._[:alnum:]]\+\)\@=" skip="\\$" end="\>\|`" syn region shAlias matchgroup=shStatement start="\\s\+\(\h[-._[:alnum:]]\+=\)\@=" skip="\\$" end="=" " Touch: {{{1 " ===== syn match shTouch '\[^;#]*' skipwhite nextgroup=shTouchList contains=shTouchCmd syn match shTouchCmd '\' contained endif " Error Codes: {{{1 " ============ if !exists("g:sh_no_error") syn match shDoError "\" syn match shIfError "\" syn match shInError "\" syn match shCaseError ";;" syn match shEsacError "\" syn match shCurlyError "}" syn match shParenError ")" syn match shOK '\.\(done\|fi\|in\|esac\)' if exists("b:is_kornshell") syn match shDTestError "]]" endif syn match shTestError "]" endif " Options: {{{1 " ==================== syn match shOption "\s\zs[-+][-_a-zA-Z#@]\+" syn match shOption "\s\zs--[^ \t$`'"|);]\+" " File Redirection Highlighted As Operators: {{{1 "=========================================== syn match shRedir "\d\=>\(&[-0-9]\)\=" syn match shRedir "\d\=>>-\=" syn match shRedir "\d\=<\(&[-0-9]\)\=" syn match shRedir "\d<<-\=" " Operators: {{{1 " ========== syn match shOperator "<<\|>>" contained syn match shOperator "[!&;|]" contained syn match shOperator "\[[[^:]\|\]]" contained syn match shOperator "[-=/*+%]\==" skipwhite nextgroup=shPattern syn match shPattern "\<\S\+\())\)\@=" contained contains=shExSingleQuote,shSingleQuote,shExDoubleQuote,shDoubleQuote,shDeref " Subshells: {{{1 " ========== syn region shExpr transparent matchgroup=shExprRegion start="{" end="}" contains=@shExprList2 nextgroup=shMoreSpecial syn region shSubSh transparent matchgroup=shSubShRegion start="[^(]\zs(" end=")" contains=@shSubShList nextgroup=shMoreSpecial " Tests: {{{1 "======= syn region shExpr matchgroup=shRange start="\[" skip=+\\\\\|\\$\|\[+ end="\]" contains=@shTestList,shSpecial syn region shTest transparent matchgroup=shStatement start="\+ end="\<;\_s*then\>" end="\" contains=@shIfList ShFoldIfDoFor syn region shFor matchgroup=shLoop start="\#\=" syn match shNumber "-\=\.\=\d\+\>#\=" syn match shCtrlSeq "\\\d\d\d\|\\[abcfnrtv0]" contained if exists("b:is_bash") syn match shSpecial "\\\o\o\o\|\\x\x\x\|\\c[^"]\|\\[abefnrtv]" contained endif if exists("b:is_bash") syn region shExSingleQuote matchgroup=shQuote start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial,shSpecial syn region shExDoubleQuote matchgroup=shQuote start=+\$"+ skip=+\\\\\|\\.\|\\"+ end=+"+ contains=@shDblQuoteList,shStringSpecial,shSpecial elseif !exists("g:sh_no_error") syn region shExSingleQuote matchGroup=Error start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial syn region shExDoubleQuote matchGroup=Error start=+\$"+ skip=+\\\\\|\\.+ end=+"+ contains=shStringSpecial endif syn region shSingleQuote matchgroup=shQuote start=+'+ end=+'+ contains=@Spell syn region shDoubleQuote matchgroup=shQuote start=+\%(\%(\\\\\)*\\\)\@" contained syn match shVariable "\<\([bwglsav]:\)\=[a-zA-Z0-9.!@_%+,]*\ze=" nextgroup=shVarAssign syn match shVarAssign "=" contained nextgroup=shCmdParenRegion,shPattern,shDeref,shDerefSimple,shDoubleQuote,shExDoubleQuote,shSingleQuote,shExSingleQuote syn region shAtExpr contained start="@(" end=")" contains=@shIdList if exists("b:is_bash") syn region shSetList oneline matchgroup=shSet start="\<\(declare\|typeset\|local\|export\|unset\)\>\ze[^/]" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+#\|=" contains=@shIdList syn region shSetList oneline matchgroup=shSet start="\\ze[^/]" end="\ze[;|)]\|$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+=" contains=@shIdList elseif exists("b:is_kornshell") syn region shSetList oneline matchgroup=shSet start="\<\(typeset\|export\|unset\)\>\ze[^/]" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList syn region shSetList oneline matchgroup=shSet start="\\ze[^/]" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList else syn region shSetList oneline matchgroup=shSet start="\<\(set\|export\|unset\)\>\ze[^/]" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList endif " Functions: {{{1 if !exists("g:is_posix") syn keyword shFunctionKey function skipwhite skipnl nextgroup=shFunctionTwo endif if exists("b:is_bash") ShFoldFunctions syn region shFunctionOne matchgroup=shFunction start="^\s*\h[-a-zA-Z_0-9]*\s*()\_s*{" end="}" contains=@shFunctionList skipwhite skipnl nextgroup=shFunctionStart,shQuickComment ShFoldFunctions syn region shFunctionTwo matchgroup=shFunction start="\<[^d][^o]\&\h[-a-zA-Z_0-9]*\s*\%(()\)\=\_s*{" end="}" contains=shFunctionKey,@shFunctionList contained skipwhite skipnl nextgroup=shFunctionStart,shQuickComment ShFoldFunctions syn region shFunctionThree matchgroup=shFunction start="^\s*\h[-a-zA-Z_0-9]*\s*()\_s*(" end=")" contains=@shFunctionList skipwhite skipnl nextgroup=shFunctionStart,shQuickComment ShFoldFunctions syn region shFunctionFour matchgroup=shFunction start="\<[^d][^o]\&\h[-a-zA-Z_0-9]*\s*\%(()\)\=\_s*)" end=")" contains=shFunctionKey,@shFunctionList contained skipwhite skipnl nextgroup=shFunctionStart,shQuickComment else ShFoldFunctions syn region shFunctionOne matchgroup=shFunction start="^\s*\h\w*\s*()\_s*{" end="}" contains=@shFunctionList skipwhite skipnl nextgroup=shFunctionStart,shQuickComment ShFoldFunctions syn region shFunctionTwo matchgroup=shFunction start="\<[^d][^o]\&\h\w*\s*\%(()\)\=\_s*{" end="}" contains=shFunctionKey,@shFunctionList contained skipwhite skipnl nextgroup=shFunctionStart,shQuickComment ShFoldFunctions syn region shFunctionThree matchgroup=shFunction start="^\s*\h\w*\s*()\_s*(" end=")" contains=@shFunctionList skipwhite skipnl nextgroup=shFunctionStart,shQuickComment ShFoldFunctions syn region shFunctionFour matchgroup=shFunction start="\<[^d][^o]\&\h\w*\s*\%(()\)\=\_s*(" end=")" contains=shFunctionKey,@shFunctionList contained skipwhite skipnl nextgroup=shFunctionStart,shQuickComment endif " Parameter Dereferencing: {{{1 " ======================== if !exists("g:sh_no_error") syn match shDerefWordError "[^}$[]" contained endif syn match shDerefSimple "\$\%(\k\+\|\d\)" syn region shDeref matchgroup=PreProc start="\${" end="}" contains=@shDerefList,shDerefVarArray syn match shDerefSimple "\$[-#*@!?]" syn match shDerefSimple "\$\$" if exists("b:is_bash") || exists("b:is_kornshell") syn region shDeref matchgroup=PreProc start="\${##\=" end="}" contains=@shDerefList syn region shDeref matchgroup=PreProc start="\${\$\$" end="}" contains=@shDerefList endif " ksh: ${!var[*]} array index list syntax: {{{1 " ======================================== if exists("b:is_kornshell") syn region shDeref matchgroup=PreProc start="\${!" end="}" contains=@shDerefVarArray endif " bash: ${!prefix*} and ${#parameter}: {{{1 " ==================================== if exists("b:is_bash") syn region shDeref matchgroup=PreProc start="\${!" end="\*\=}" contains=@shDerefList,shDerefOp syn match shDerefVar contained "{\@<=!\k\+" nextgroup=@shDerefVarList endif if exists("b:is_kornshell") syn match shDerefVar contained "{\@<=!\k[[:alnum:]_.]*" nextgroup=@shDerefVarList endif syn match shDerefSpecial contained "{\@<=[-*@?0]" nextgroup=shDerefOp,shDerefOpError syn match shDerefSpecial contained "\({[#!]\)\@<=[[:alnum:]*@_]\+" nextgroup=@shDerefVarList,shDerefOp syn match shDerefVar contained "{\@<=\k\+" nextgroup=@shDerefVarList if exists("b:is_kornshell") syn match shDerefVar contained "{\@<=\k[[:alnum:]_.]*" nextgroup=@shDerefVarList endif " sh ksh bash : ${var[... ]...} array reference: {{{1 syn region shDerefVarArray contained matchgroup=shDeref start="\[" end="]" contains=@shCommandSubList nextgroup=shDerefOp,shDerefOpError " Special ${parameter OPERATOR word} handling: {{{1 " 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 " bash : ${parameter^pattern} Case modification " bash : ${parameter^^pattern} Case modification " bash : ${parameter,pattern} Case modification " bash : ${parameter,,pattern} Case modification syn cluster shDerefPatternList contains=shDerefPattern,shDerefString if !exists("g:sh_no_error") syn match shDerefOpError contained ":[[:punct:]]" endif 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,shDerefEscape nextgroup=shDerefPattern syn region shDerefPattern contained start="{" end="}" contains=shDeref,shDerefSimple,shDerefString,shCommandSub nextgroup=shDerefPattern syn match shDerefEscape contained '\%(\\\\\)*\\.' endif if exists("b:is_bash") syn match shDerefOp contained "[,^]\{1,2}" nextgroup=@shDerefPatternList endif syn region shDerefString contained matchgroup=shDerefDelim start=+\%(\\\)\@" syn sync match shCaseEsacSync groupthere shCaseEsac "\" syn sync match shDoSync grouphere shDo "\" syn sync match shDoSync groupthere shDo "\" syn sync match shForSync grouphere shFor "\" syn sync match shForSync groupthere shFor "\" syn sync match shIfSync grouphere shIf "\" syn sync match shIfSync groupthere shIf "\" syn sync match shUntilSync grouphere shRepeat "\" syn sync match shWhileSync grouphere shRepeat "\" " Default Highlighting: {{{1 " ===================== hi def link shArithRegion shShellVariables hi def link shAtExpr shSetList hi def link shBeginHere shRedir hi def link shCaseBar shConditional hi def link shCaseCommandSub shCommandSub hi def link shCaseDoubleQuote shDoubleQuote hi def link shCaseIn shConditional hi def link shQuote shOperator hi def link shCaseSingleQuote shSingleQuote hi def link shCaseStart shConditional hi def link shCmdSubRegion shShellVariables hi def link shColon shComment hi def link shDerefOp shOperator hi def link shDerefPOL shDerefOp hi def link shDerefPPS shDerefOp hi def link shDerefPSR shDerefOp hi def link shDeref shShellVariables hi def link shDerefDelim shOperator hi def link shDerefSimple shDeref hi def link shDerefSpecial shDeref hi def link shDerefString shDoubleQuote hi def link shDerefVar shDeref hi def link shDoubleQuote shString hi def link shEcho shString hi def link shEchoDelim shOperator hi def link shEchoQuote shString hi def link shForPP shLoop hi def link shEmbeddedEcho shString hi def link shEscape shCommandSub hi def link shExDoubleQuote shDoubleQuote hi def link shExSingleQuote shSingleQuote hi def link shFunction Function hi def link shHereDoc shString hi def link shHerePayload shHereDoc hi def link shLoop shStatement hi def link shMoreSpecial shSpecial hi def link shNoQuote shDoubleQuote hi def link shOption shCommandSub hi def link shPattern shString hi def link shParen shArithmetic hi def link shPosnParm shShellVariables hi def link shQuickComment shComment hi def link shRange shOperator hi def link shRedir shOperator hi def link shSetListDelim shOperator hi def link shSetOption shOption 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 shTestPattern shString hi def link shTestDoubleQuote shString hi def link shTestSingleQuote shString hi def link shTouchCmd shStatement 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 shFunctionParen Delimiter hi def link shFunctionDelim Delimiter hi def link shCharClass shSpecial endif if exists("b:is_kornshell") hi def link kshSpecialVariables shShellVariables hi def link kshStatement shStatement hi def link shFunctionParen Delimiter endif if !exists("g:sh_no_error") 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 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 shCtrlSeq Special hi def link shExprRegion Delimiter hi def link shFunctionKey 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 hi def link shHereDoc01 shRedir hi def link shHereDoc02 shRedir hi def link shHereDoc03 shRedir hi def link shHereDoc04 shRedir hi def link shHereDoc05 shRedir hi def link shHereDoc06 shRedir hi def link shHereDoc07 shRedir hi def link shHereDoc08 shRedir hi def link shHereDoc09 shRedir hi def link shHereDoc10 shRedir hi def link shHereDoc11 shRedir hi def link shHereDoc12 shRedir hi def link shHereDoc13 shRedir hi def link shHereDoc14 shRedir hi def link shHereDoc15 shRedir hi def link shHereDoc16 shRedir hi def link shHereDoc17 shRedir hi def link shHereDoc18 shRedir hi def link shHereDoc19 shRedir hi def link shHereDoc20 shRedir hi def link shHereDoc21 shRedir " Delete shell folding commands {{{1 " ============================= delc ShFoldFunctions delc ShFoldHereDoc delc ShFoldIfDoFor " Set Current Syntax: {{{1 " =================== 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 fdm=marker vim-7.4.1689/runtime/syntax/sicad.vim000066400000000000000000000447751267703067000174270ustar00rootroot00000000000000" Vim syntax file " Language: SiCAD (procedure language) " Maintainer: Zsolt Branyiczky " 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 :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 "\"me=s+1 syn match sicadStatement "\"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 "\" contains=sicadGoto syn match sicadLabel2 "\" 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="\" end="\" " 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='\' 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='\' 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 "\" syn sync match sicadSyncComment grouphere sicadComment "\" " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/sieve.vim000066400000000000000000000031731267703067000174420ustar00rootroot00000000000000" Vim syntax file " Language: Sieve filtering language input file " Maintainer: Nikolai Weibull " Latest Revision: 2007-10-25 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn keyword sieveTodo contained TODO FIXME XXX NOTE syn region sieveComment start='/\*' end='\*/' contains=sieveTodo,@Spell syn region sieveComment display oneline start='#' end='$' \ contains=sieveTodo,@Spell syn case ignore syn match sieveTag display ':\h\w*' syn match sieveNumber display '\<\d\+[KMG]\=\>' syn match sieveSpecial display '\\["\\]' syn region sieveString start=+"+ skip=+\\\\\|\\"+ end=+"+ \ contains=sieveSpecial syn region sieveString start='text:' end='\n.\n' syn keyword sieveConditional if elsif else syn keyword sieveTest address allof anyof envelope exists false header \ not size true syn keyword sievePreProc require stop syn keyword sieveAction reject fileinto redirect keep discard syn keyword sieveKeyword vacation syn case match hi def link sieveTodo Todo hi def link sieveComment Comment hi def link sieveTag Type hi def link sieveNumber Number hi def link sieveSpecial Special hi def link sieveString String hi def link sieveConditional Conditional hi def link sieveTest Keyword hi def link sievePreProc PreProc hi def link sieveAction Function hi def link sieveKeyword Keyword let b:current_syntax = "sieve" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/simula.vim000066400000000000000000000071411267703067000176200ustar00rootroot00000000000000" Vim syntax file " Language: Simula " Maintainer: Haakon Riiser " 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="!\|\" 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="\"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 "\" syn match simulaOperator "\" syn match simulaReferenceType "\" " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/sinda.vim000066400000000000000000000100051267703067000174150ustar00rootroot00000000000000" 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 :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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/sindacmp.vim000066400000000000000000000032221267703067000201200ustar00rootroot00000000000000" 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/sindaout.vim000066400000000000000000000045641267703067000201620ustar00rootroot00000000000000" 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 :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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/sisu.vim000066400000000000000000000532351267703067000173160ustar00rootroot00000000000000" SiSU Vim syntax file " SiSU Maintainer: Ralph Amissah " SiSU Markup: SiSU (sisu-5.6.7) " Last Change: 2014-09-14 " URL: " "(originally looked at Ruby Vim by Mirko Nasato) if version < 600 syntax clear elseif exists("b:current_syntax") finish else endif let s:cpo_save = &cpo set cpo&vim "% "Errors: syn match sisu_error contains=sisu_link,sisu_error_wspace "" "% "Markers Identifiers: if !exists("sisu_no_identifiers") syn match sisu_mark_endnote "\~^" syn match sisu_break contains=@NoSpell " \\\\\( \|$\)\|
\|
" syn match sisu_control contains=@NoSpell "^\(-\\\\-\|=\\\\=\|-\.\.-\|<:p[bn]>\)\s*$" syn match sisu_control contains=@NoSpell "^<:\(bo\|---\)>\s*$" syn match sisu_marktail contains=@NoSpell "^--[+~-]#\s*$" syn match sisu_marktail "[~-]#" syn match sisu_control "\"" syn match sisu_underline "\(^\| \)_[a-zA-Z0-9]\+_\([ .,]\|$\)" syn match sisu_number contains=@NoSpell "[0-9a-f]\{32\}\|[0-9a-f]\{64\}" syn match sisu_link contains=@NoSpell "\(_\?https\?://\|\.\.\/\)\S\+" syn match sisu_link " \*\~\S\+" syn match sisu_require contains=@NoSpell "^<<\s*[a-zA-Z0-9^./_-]\+\.ss[it]$" syn match sisu_structure "^:A\~$" "% "Document Sub Headers: syn match sisu_sub_header_title "^\s\+:\(subtitle\|short\|edition\|language\|lang_char\|note\):\s" "group=sisu_header_content syn match sisu_sub_header_creator "^\s\+:\(author\|editor\|contributor\|illustrator\|photographer\|translator\|digitized_by\|prepared_by\|audio\|video\):\s" " &hon &institution syn match sisu_sub_header_rights "^\s\+:\(copyright\|text\|translation\|illustrations\|photographs\|preparation\|digitization\|audio\|video\|license\|all\):\s" " access_rights license syn match sisu_sub_header_classify "^\s\+:\(topic_register\|keywords\|subject\|dewey\|loc\):\s" syn match sisu_sub_header_identifier "^\s\+:\(oclc\|isbn\):\s" syn match sisu_sub_header_date "^\s\+:\(added_to_site\|available\|created\|issued\|modified\|published\|valid\|translated\|original_publication\):\s" syn match sisu_sub_header_original "^\s\+:\(publisher\|date\|language\|lang_char\|institution\|nationality\|source\):\s" syn match sisu_sub_header_make "^\s\+:\(headings\|num_top\|breaks\|language\|italics\|bold\|emphasis\|substitute\|omit\|plaintext_wrap\|texpdf_font_mono\|texpdf_font\|stamp\|promo\|ad\|manpage\|home_button_text\|home_button_image\|cover_image\|footer\):\s" syn match sisu_sub_header_notes "^\s\+:\(description\|abstract\|comment\|coverage\|relation\|source\|history\|type\|format\|prefix\|prefix_[ab]\|suffix\):\s" syn match sisu_within_index_ignore "\S\+[:;]\(\s\+\|$\)" syn match sisu_within_index "[:|;]\|+\d\+" "% "semantic markers: (ignore) syn match sisu_sem_marker ";{\|};[a-z._]*[a-z]" syn match sisu_sem_marker_block "\([a-z][a-z._]*\|\):{\|}:[a-z._]*[a-z]" syn match sisu_sem_ex_marker ";\[\|\];[a-z._]*[a-z]" syn match sisu_sem_ex_marker_block "\([a-z][a-z._]*\|\):\[\|\]:[a-z._]*[a-z]" syn match sisu_sem_block contains=sisu_error,sisu_error_wspace,sisu_content_alt,sisu_link,sisu_linked,sisu_break,sisu_sem_block,sisu_sem_content,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker,sisu_mark_endnote,sisu_content_endnote "\([a-z]*\):{[^}].\{-}}:\1" syn match sisu_sem_content contains=sisu_error,sisu_error_wspace,sisu_content_alt,sisu_link,sisu_linked,sisu_break,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker ";{[^}].\{-}};[a-z]\+" syn match sisu_sem_ex_block contains=sisu_error,sisu_error_wspace,sisu_content_alt,sisu_link,sisu_linked,sisu_break,sisu_sem_block,sisu_sem_content,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker,sisu_mark_endnote,sisu_content_endnote "\([a-z]*\):\[[^}].\{-}\]:\1" syn match sisu_sem_ex_content contains=sisu_error,sisu_error_wspace,sisu_content_alt,sisu_link,sisu_linked,sisu_break,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker ";\[[^}].\{-}\];[a-z]\+" endif "% "URLs Numbers And ASCII Codes: syn match sisu_number "\<\(0x\x\+\|0b[01]\+\|0\o\+\|0\.\d\+\|0\|[1-9][\.0-9_]*\)\>" syn match sisu_number "?\(\\M-\\C-\|\\c\|\\C-\|\\M-\)\=\(\\\o\{3}\|\\x\x\{2}\|\\\=\w\)" "% "Tuned Error: (is error if not already matched) syn match sisu_error contains=sisu_error "[\~/\*!_]{\|}[\~/\*!_]" syn match sisu_error contains=sisu_error "
]" "% "Simple Paired Enclosed Markup: "url/link syn region sisu_link contains=sisu_error,sisu_error_wspace matchgroup=sisu_action start="^<<\s*|[a-zA-Z0-9^._-]\+|@|[a-zA-Z0-9^._-]\+|"rs=s+2 end="$" "% "Document Header: " title syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_title matchgroup=sisu_header start="^[@]title:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$" " creator syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_creator matchgroup=sisu_header start="^[@]creator:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$" " dates syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_date matchgroup=sisu_header start="^[@]date:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$" " publisher syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_publisher matchgroup=sisu_header start="^[@]publisher:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$" " rights syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_rights matchgroup=sisu_header start="^[@]rights:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$" " classify document syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_classify matchgroup=sisu_header start="^[@]classify:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$" " identifier document syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_identifier matchgroup=sisu_header start="^[@]identifier:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$" " original language (depreciated) syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_original matchgroup=sisu_header start="^[@]original:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$" " notes syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_notes matchgroup=sisu_header start="^[@]notes:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$" " links of interest syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_linked,sisu_sub_header_links matchgroup=sisu_header start="^[@]links:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$" " make, processing instructions syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_make matchgroup=sisu_header start="^[@]make:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$" "% "Headings: syn region sisu_heading contains=sisu_mark_endnote,sisu_content_endnote,sisu_marktail,sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_ocn,sisu_error,sisu_error_wspace matchgroup=sisu_structure start="^\([1-4]\|:\?[A-D]\)\~\(\S\+\|[^-]\)" end="$" "% "Block Group Text: " table syn region sisu_content_alt contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^table{.\+" end="}table" " table syn region sisu_content_alt contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^```\s\+table" end="^```\(\s\|$\)" syn region sisu_content_alt contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^{\(t\|table\)\(\~h\)\?\(\sc[0-9]\+;\)\?[0-9; ]*}" end="\n$" " block, group, poem, alt syn region sisu_content_alt contains=sisu_mark_endnote,sisu_content_endnote,sisu_link,sisu_mark,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^\(block\|group\|poem\|alt\){" end="^}\1" syn region sisu_content_alt contains=sisu_mark_endnote,sisu_content_endnote,sisu_link,sisu_mark,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^```\s\+\(block\|group\|poem\|alt\)" end="^```\(\s\|$\)" " box syn region sisu_content_alt contains=sisu_mark_endnote,sisu_content_endnote,sisu_link,sisu_mark,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^box\(\.[a-z]\+\)\?{" end="^}box" syn region sisu_content_alt contains=sisu_mark_endnote,sisu_content_endnote,sisu_link,sisu_mark,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^```\s\+\box\(\.[a-z]\+\)\?" end="^```\(\s\|$\)" " code syn region sisu_content_alt contains=sisu_error,@NoSpell matchgroup=sisu_contain start="^code\(\.[a-z][0-9a-z_]\+\)\?{" end="^}code" syn region sisu_content_alt contains=sisu_error,@NoSpell matchgroup=sisu_contain start="^```\s\+code\(\.[a-z][0-9a-z_]\+\)\?" end="^```\(\s\|$\)" " quote syn region sisu_normal contains=sisu_fontface,sisu_bold,sisu_control,sisu_identifier,sisu_content_endnote,sisu_mark_endnote,sisu_link,sisu_sem_block,sisu_sem_content,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker,sisu_linked,sisu_error,sisu_error_wspace matchgroup=sisu_contain start="^```\s\+quote" end="^```\(\s\|$\)" "% "Endnotes: " regular endnote or asterisk or plus sign endnote syn region sisu_content_endnote contains=sisu_link,sisu_strikeout,sisu_underline,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error,sisu_error_wspace,sisu_mark,sisu_break,sisu_sem_block,sisu_sem_content,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker matchgroup=sisu_mark_endnote start="\~{[*+]*" end="}\~" skip="\n" " numbered asterisk or plus sign endnote syn region sisu_content_endnote contains=sisu_link,sisu_strikeout,sisu_underline,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error,sisu_error_wspace,sisu_mark,sisu_break,sisu_sem_block,sisu_sem_content,sisu_sem_marker matchgroup=sisu_mark_endnote start="\~\[[*+]*" end="\]\~" skip="\n" " endnote content marker (for binary content marking) syn region sisu_content_endnote contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_link,sisu_identifier,sisu_error,sisu_error_wspace,sisu_mark,sisu_break matchgroup=sisu_mark_endnote start="\^\~" end="\n$" "% "Links And Images: " image with url link (and possibly footnote of url) syn region sisu_linked contains=sisu_fontface,sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_sem_block,sisu_sem_content,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker,sisu_sem_block,sisu_error matchgroup=sisu_link start="{\(\~^\s\)\?" end="}\(https\?:/\/\|:\|\.\.\/\|#\)\S\+" oneline " sisu outputs, short notation syn region sisu_linked contains=sisu_fontface,sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_sem_block,sisu_sem_content,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker,sisu_sem_block,sisu_error matchgroup=sisu_link start="{\(\~^\s\)\?" end="\[[1-5][sS]*\]}\S\+\.ss[tm]" oneline " image syn region sisu_linked contains=sisu_fontface,sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_link start="{" end="}image" oneline "% "Some Line Operations: " bold line syn region sisu_bold contains=sisu_strikeout,sisu_identifier,sisu_content_endnote,sisu_mark_endnote,sisu_error,sisu_error_wspace matchgroup=sisu_markpara start="^!_ " end=" \\\\\|$" " indent and bullet paragraph syn region sisu_normal contains=sisu_fontface,sisu_bold,sisu_control,sisu_identifier,sisu_content_endnote,sisu_mark_endnote,sisu_link,sisu_sem_block,sisu_sem_content,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker,sisu_linked,sisu_error,sisu_error_wspace matchgroup=sisu_markpara start="^_\([1-9*]\|[1-9]\*\) " end="$" " indent and bullet (bold start) paragraph syn region sisu_bold contains=sisu_fontface,sisu_bold,sisu_control,sisu_identifier,sisu_content_endnote,sisu_mark_endnote,sisu_link,sisu_sem_block,sisu_sem_content,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker,sisu_linked,sisu_error,sisu_error_wspace matchgroup=sisu_markpara start="^_\([1-9*]\|[1-9]\*\)!_\? " end=" \\\\\|$" " hanging indent paragraph [proposed] syn region sisu_normal contains=sisu_fontface,sisu_bold,sisu_control,sisu_identifier,sisu_content_endnote,sisu_mark_endnote,sisu_link,sisu_sem_block,sisu_sem_content,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker,sisu_linked,sisu_error,sisu_error_wspace matchgroup=sisu_markpara start="^_[0-9]\?_[0-9] " end="$" " hanging indent (bold start/ definition) paragraph [proposed] syn region sisu_bold contains=sisu_fontface,sisu_bold,sisu_control,sisu_identifier,sisu_content_endnote,sisu_mark_endnote,sisu_link,sisu_sem_block,sisu_sem_content,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker,sisu_linked,sisu_error,sisu_error_wspace matchgroup=sisu_markpara start="^_[0-9]\?_[0-9]!_\? " end=" \\\\\|$" " list numbering syn region sisu_normal contains=sisu_strikeout,sisu_identifier,sisu_content_endnote,sisu_mark_endnote,sisu_link,sisu_linked,sisu_error,sisu_error_wspace matchgroup=sisu_markpara start="^\(#[ 1]\|_# \)" end="$" "% "Font Face Curly Brackets: "syn region sisu_identifier contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_sem start="\S\+:{" end="}:[^<>,.!?:; ]\+" oneline " book index: syn region sisu_index contains=sisu_within_index_ignore,sisu_within_index matchgroup=sisu_index_block start="^={" end="}" " emphasis: syn region sisu_bold contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="\*{" end="}\*" " bold: syn region sisu_bold contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="!{" end="}!" " underscore: syn region sisu_underline contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="_{" end="}_" " italics: syn region sisu_identifier contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="/{" end="}/" " added: syn region sisu_underline contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="+{" end="}+" " superscript: syn region sisu_identifier contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="\^{" end="}\^" " subscript: syn region sisu_identifier contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start=",{" end="}," " monospace: syn region sisu_identifier contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="#{" end="}#" " strikethrough: syn region sisu_strikeout contains=sisu_error matchgroup=sisu_fontface start="-{" end="}-" "% "Single Words Bold Italicise Etc: (depreciated) syn region sisu_bold contains=sisu_error matchgroup=sisu_bold start="\([ (]\|^\)\*[^\|{\n\~\\]"hs=e-1 end="\*"he=e-0 skip="[a-zA-Z0-9']" oneline syn region sisu_identifier contains=sisu_error matchgroup=sisu_content_alt start="\([ ]\|^\)/[^{ \|\n\\]"hs=e-1 end="/\[ \.\]" skip="[a-zA-Z0-9']" oneline "misc syn region sisu_identifier contains=sisu_error matchgroup=sisu_fontface start="\^[^ {\|\n\\]"rs=s+1 end="\^[ ,.;:'})\\\n]" skip="[a-zA-Z0-9']" oneline "% "Expensive Mode: if !exists("sisu_no_expensive") else " not Expensive syn region sisu_content_alt matchgroup=sisu_control start="^\s*def\s" matchgroup=NONE end="[?!]\|\>" skip="\.\|\(::\)" oneline endif " Expensive? "% "Headers And Headings: (Document Instructions) syn match sisu_control contains=sisu_error,sisu_error_wspace "4\~! \S\+" syn region sisu_markpara contains=sisu_error,sisu_error_wspace start="^=begin" end="^=end.*$" "% "Errors: syn match sisu_error_wspace contains=sisu_error_wspace "^\s\+[^:]" syn match sisu_error_wspace contains=sisu_error_wspace "\s\s\+" syn match sisu_error_wspace contains=sisu_error_wspace "\s\+$" syn match sisu_error contains=sisu_error_wspace "\t\+" syn match sisu_error contains=sisu_error,sisu_error_wspace "\([^ (][_\\]\||[^ (}]\)https\?:\S\+" syn match sisu_error contains=sisu_error "_\?https\?:\S\+[}><]" syn match sisu_error contains=sisu_error "\([!*/_\+,^]\){\([^(\}\1)]\)\{-}\n$" syn match sisu_error contains=sisu_error "^[\~]{[^{]\{-}\n$" syn match sisu_error contains=sisu_error "\s\+.{{" syn match sisu_error contains=sisu_error "^\~\s*$" syn match sisu_error contains=sisu_error "^0\~.*" syn match sisu_error contains=sisu_error "^[1-9]\~\s*$" syn match sisu_error contains=sisu_error "^[1-9]\~\S\+\s*$" syn match sisu_error contains=sisu_error "[^{]\~\^[^ \)]" syn match sisu_error contains=sisu_error "\~\^\s\+\.\s*" syn match sisu_error contains=sisu_error "{\~^\S\+" syn match sisu_error contains=sisu_error "[_/\*!^]{[ .,:;?><]*}[_/\*!^]" syn match sisu_error contains=sisu_error "[^ (\"'(\[][_/\*!]{\|}[_/\*!][a-zA-Z0-9)\]\"']" syn match sisu_error contains=sisu_error "" "errors for filetype sisu, though not error in 'metaverse': syn match sisu_error contains=sisu_error,sisu_match,sisu_strikeout,sisu_contain,sisu_content_alt,sisu_mark,sisu_break,sisu_number "<[a-zA-Z\/]\+>" syn match sisu_error "/\?<\([biu]\)>[^()]\{-}\n$" "% "Error Exceptions: syn match sisu_control "\n$" "contains=ALL "syn match sisu_control " //" syn match sisu_error "%{" syn match sisu_error "
_\?https\?:\S\+\|_\?https\?:\S\+
" syn match sisu_error "[><]_\?https\?:\S\+\|_\?https\?:\S\+[><]" syn match sisu_comment "^%\{1,2\}.\+" "% "Definitions Default Highlighting: hi def link sisu_normal Normal hi def link sisu_bold Statement hi def link sisu_header PreProc hi def link sisu_header_content Normal hi def link sisu_sub_header_title Statement hi def link sisu_sub_header_creator Statement hi def link sisu_sub_header_date Statement hi def link sisu_sub_header_publisher Statement hi def link sisu_sub_header_rights Statement hi def link sisu_sub_header_classify Statement hi def link sisu_sub_header_identifier Statement hi def link sisu_sub_header_original Statement hi def link sisu_sub_header_links Statement hi def link sisu_sub_header_notes Statement hi def link sisu_sub_header_make Statement hi def link sisu_heading Title hi def link sisu_structure Operator hi def link sisu_contain Include hi def link sisu_mark_endnote Delimiter hi def link sisu_require NonText hi def link sisu_link NonText hi def link sisu_linked String hi def link sisu_fontface Delimiter hi def link sisu_strikeout DiffDelete hi def link sisu_content_alt Special hi def link sisu_sem_content SpecialKey hi def link sisu_sem_block Special hi def link sisu_sem_marker Visual "hi def link sisu_sem_marker Structure hi def link sisu_sem_marker_block MatchParen hi def link sisu_sem_ex_marker FoldColumn hi def link sisu_sem_ex_marker_block Folded hi def link sisu_sem_ex_content Comment "hi def link sisu_sem_ex_content SpecialKey hi def link sisu_sem_ex_block Comment hi def link sisu_index SpecialKey hi def link sisu_index_block Visual hi def link sisu_content_endnote Special hi def link sisu_control Delimiter hi def link sisu_within_index Delimiter hi def link sisu_within_index_ignore SpecialKey hi def link sisu_ocn Include hi def link sisu_number Number hi def link sisu_identifier Function hi def link sisu_underline Underlined hi def link sisu_markpara Include hi def link sisu_marktail Include hi def link sisu_mark Identifier hi def link sisu_break Structure hi def link sisu_html Type hi def link sisu_action Identifier hi def link sisu_comment Comment hi def link sisu_error_sem_marker Error hi def link sisu_error_wspace Error hi def link sisu_error Error let b:current_syntax = "sisu" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/skill.vim000066400000000000000000000630041267703067000174440ustar00rootroot00000000000000" Vim syntax file " Language: SKILL " Maintainer: Toby Schaffer " 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 "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillKeywords "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillConditional "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillConditional "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillKeywords "\"hs=s+1 syn match skillKeywords "\"hs=s+1 syn match skillKeywords "\"hs=s+1 syn match skillKeywords "\"hs=s+1 syn match skillKeywords "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillKeywords "\"hs=s+1 syn match skillKeywords "\"hs=s+1 syn match skillKeywords "\"hs=s+1 syn match skillKeywords "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillRepeat "\"hs=s+1 syn match skillFunction "\<[fs]\=printf("he=e-1 syn match skillFunction "(f\=scanf\>"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillRepeat "\"hs=s+1 syn match skillConditional "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillKeywords "\"hs=s+1 syn match skillKeywords "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillKeywords "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillKeywords "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillKeywords "\<[mn]\=procedure("he=e-1 syn match skillFunction "(ncon[cs]\>"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillKeywords "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillKeywords "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillConditional "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillConditional "\"hs=s+1 syn match skillRepeat "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillFunction "\"hs=s+1 syn match skillcdfFunctions "\"hs=s+1 syn match skillgeFunctions "\"hs=s+1 syn match skillhiFunctions "\"hs=s+1 syn match skillleFunctions "\"hs=s+1 syn match skilldbefFunctions "\"hs=s+1 syn match skillddFunctions "\"hs=s+1 syn match skillpcFunctions "\"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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/sl.vim000066400000000000000000000105041267703067000167410ustar00rootroot00000000000000" Vim syntax file " Language: Renderman shader language " Maintainer: Dan Piponi " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/slang.vim000066400000000000000000000070661267703067000174400ustar00rootroot00000000000000" Vim syntax file " Language: S-Lang " Maintainer: Jan Hlavacek " 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 "\" 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 "\" 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/slice.vim000066400000000000000000000063441267703067000174310ustar00rootroot00000000000000" Vim syntax file " Language: Slice (ZeroC's Specification Language for Ice) " Maintainer: Morel Bodin " Last Change: 2005 Dec 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 " 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 dictionary 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 region sliceIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+ 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/slpconf.vim000066400000000000000000000270031267703067000177710ustar00rootroot00000000000000" Vim syntax file " Language: RFC 2614 - An API for Service Location configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2006-04-19 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn keyword slpconfTodo contained TODO FIXME XXX NOTE syn region slpconfComment display oneline start='^[#;]' end='$' \ contains=slpconfTodo,@Spell syn match slpconfBegin display '^' \ nextgroup=slpconfTag, \ slpconfComment skipwhite syn keyword slpconfTag contained net \ nextgroup=slpconfNetTagDot syn match slpconfNetTagDot contained display '.' \ nextgroup=slpconfNetTag syn keyword slpconfNetTag contained slp \ nextgroup=slpconfNetSlpTagdot syn match slpconfNetSlpTagDot contained display '.' \ nextgroup=slpconfNetSlpTag syn keyword slpconfNetSlpTag contained isDA traceDATraffic traceMsg \ traceDrop traceReg isBroadcastOnly \ passiveDADetection securityEnabled \ nextgroup=slpconfBooleanEq,slpconfBooleanHome \ skipwhite syn match slpconfBooleanHome contained display \ '\.\d\{1,3}\%(\.\d\{1,3}\)\{3}' \ nextgroup=slpconfBooleanEq skipwhite syn match slpconfBooleanEq contained display '=' \ nextgroup=slpconfBoolean skipwhite syn keyword slpconfBoolean contained true false TRUE FALSE syn keyword slpconfNetSlpTag contained DAHeartBeat multicastTTL \ DAActiveDiscoveryInterval \ multicastMaximumWait multicastTimeouts \ randomWaitBound MTU maxResults \ nextgroup=slpconfIntegerEq,slpconfIntegerHome \ skipwhite syn match slpconfIntegerHome contained display \ '\.\d\{1,3}\%(\.\d\{1,3}\)\{3}' \ nextgroup=slpconfIntegerEq skipwhite syn match slpconfIntegerEq contained display '=' \ nextgroup=slpconfInteger skipwhite syn match slpconfInteger contained display '\<\d\+\>' syn keyword slpconfNetSlpTag contained DAAttributes SAAttributes \ nextgroup=slpconfAttrEq,slpconfAttrHome \ skipwhite syn match slpconfAttrHome contained display \ '\.\d\{1,3}\%(\.\d\{1,3}\)\{3}' \ nextgroup=slpconfAttrEq skipwhite syn match slpconfAttrEq contained display '=' \ nextgroup=slpconfAttrBegin skipwhite syn match slpconfAttrBegin contained display '(' \ nextgroup=slpconfAttrTag skipwhite syn match slpconfAttrTag contained display \ '[^* \t_(),\\!<=>~[:cntrl:]]\+' \ nextgroup=slpconfAttrTagEq skipwhite syn match slpconfAttrTagEq contained display '=' \ nextgroup=@slpconfAttrValue skipwhite syn cluster slpconfAttrValueCon contains=slpconfAttrValueSep,slpconfAttrEnd syn cluster slpconfAttrValue contains=slpconfAttrIValue,slpconfAttrSValue, \ slpconfAttrBValue,slpconfAttrSSValue syn match slpconfAttrSValue contained display '[^ (),\\!<=>~[:cntrl:]]\+' \ nextgroup=@slpconfAttrValueCon skipwhite syn match slpconfAttrSSValue contained display '\\FF\%(\\\x\x\)\+' \ nextgroup=@slpconfAttrValueCon skipwhite syn match slpconfAttrIValue contained display '[-]\=\d\+\>' \ nextgroup=@slpconfAttrValueCon skipwhite syn keyword slpconfAttrBValue contained true false \ nextgroup=@slpconfAttrValueCon skipwhite syn match slpconfAttrValueSep contained display ',' \ nextgroup=@slpconfAttrValue skipwhite syn match slpconfAttrEnd contained display ')' \ nextgroup=slpconfAttrSep skipwhite syn match slpconfAttrSep contained display ',' \ nextgroup=slpconfAttrBegin skipwhite syn keyword slpconfNetSlpTag contained useScopes typeHint \ nextgroup=slpconfStringsEq,slpconfStringsHome \ skipwhite syn match slpconfStringsHome contained display \ '\.\d\{1,3}\%(\.\d\{1,3}\)\{3}' \ nextgroup=slpconfStringsEq skipwhite syn match slpconfStringsEq contained display '=' \ nextgroup=slpconfStrings skipwhite syn match slpconfStrings contained display \ '\%([[:digit:][:alpha:]]\|[!-+./:-@[-`{-~-]\|\\\x\x\)\+' \ nextgroup=slpconfStringsSep skipwhite syn match slpconfStringsSep contained display ',' \ nextgroup=slpconfStrings skipwhite syn keyword slpconfNetSlpTag contained DAAddresses \ nextgroup=slpconfAddressesEq,slpconfAddrsHome \ skipwhite syn match slpconfAddrsHome contained display \ '\.\d\{1,3}\%(\.\d\{1,3}\)\{3}' \ nextgroup=slpconfAddressesEq skipwhite syn match slpconfAddressesEq contained display '=' \ nextgroup=@slpconfAddresses skipwhite syn cluster slpconfAddresses contains=slpconfFQDNs,slpconfHostnumbers syn match slpconfFQDNs contained display \ '\a[[:alnum:]-]*[[:alnum:]]\|\a' \ nextgroup=slpconfAddressesSep skipwhite syn match slpconfHostnumbers contained display \ '\d\{1,3}\%(\.\d\{1,3}\)\{3}' \ nextgroup=slpconfAddressesSep skipwhite syn match slpconfAddressesSep contained display ',' \ nextgroup=@slpconfAddresses skipwhite syn keyword slpconfNetSlpTag contained serializedRegURL \ nextgroup=slpconfStringEq,slpconfStringHome \ skipwhite syn match slpconfStringHome contained display \ '\.\d\{1,3}\%(\.\d\{1,3}\)\{3}' \ nextgroup=slpconfStringEq skipwhite syn match slpconfStringEq contained display '=' \ nextgroup=slpconfString skipwhite syn match slpconfString contained display \ '\%([!-+./:-@[-`{-~-]\|\\\x\x\)\+\|[[:digit:][:alpha:]]' syn keyword slpconfNetSlpTag contained multicastTimeouts DADiscoveryTimeouts \ datagramTimeouts \ nextgroup=slpconfIntegersEq, \ slpconfIntegersHome skipwhite syn match slpconfIntegersHome contained display \ '\.\d\{1,3}\%(\.\d\{1,3}\)\{3}' \ nextgroup=slpconfIntegersEq skipwhite syn match slpconfIntegersEq contained display '=' \ nextgroup=slpconfIntegers skipwhite syn match slpconfIntegers contained display '\<\d\+\>' \ nextgroup=slpconfIntegersSep skipwhite syn match slpconfIntegersSep contained display ',' \ nextgroup=slpconfIntegers skipwhite syn keyword slpconfNetSlpTag contained interfaces \ nextgroup=slpconfHostnumsEq, \ slpconfHostnumsHome skipwhite syn match slpconfHostnumsHome contained display \ '\.\d\{1,3}\%(\.\d\{1,3}\)\{3}' \ nextgroup=slpconfHostnumsEq skipwhite syn match slpconfHostnumsEq contained display '=' \ nextgroup=slpconfOHostnumbers skipwhite syn match slpconfOHostnumbers contained display \ '\d\{1,3}\%(\.\d\{1,3}\)\{3}' \ nextgroup=slpconfHostnumsSep skipwhite syn match slpconfHostnumsSep contained display ',' \ nextgroup=slpconfOHostnumbers skipwhite syn keyword slpconfNetSlpTag contained locale \ nextgroup=slpconfLocaleEq,slpconfLocaleHome \ skipwhite syn match slpconfLocaleHome contained display \ '\.\d\{1,3}\%(\.\d\{1,3}\)\{3}' \ nextgroup=slpconfLocaleEq skipwhite syn match slpconfLocaleEq contained display '=' \ nextgroup=slpconfLocale skipwhite syn match slpconfLocale contained display '\a\{1,8}\%(-\a\{1,8}\)\=' hi def link slpconfTodo Todo hi def link slpconfComment Comment hi def link slpconfTag Identifier hi def link slpconfDelimiter Delimiter hi def link slpconfNetTagDot slpconfDelimiter hi def link slpconfNetTag slpconfTag hi def link slpconfNetSlpTagDot slpconfNetTagDot hi def link slpconfNetSlpTag slpconfTag hi def link slpconfHome Special hi def link slpconfBooleanHome slpconfHome hi def link slpconfEq Operator hi def link slpconfBooleanEq slpconfEq hi def link slpconfBoolean Boolean hi def link slpconfIntegerHome slpconfHome hi def link slpconfIntegerEq slpconfEq hi def link slpconfInteger Number hi def link slpconfAttrHome slpconfHome hi def link slpconfAttrEq slpconfEq hi def link slpconfAttrBegin slpconfDelimiter hi def link slpconfAttrTag slpconfTag hi def link slpconfAttrTagEq slpconfEq hi def link slpconfAttrIValue slpconfInteger hi def link slpconfAttrSValue slpconfString hi def link slpconfAttrBValue slpconfBoolean hi def link slpconfAttrSSValue slpconfString hi def link slpconfSeparator slpconfDelimiter hi def link slpconfAttrValueSep slpconfSeparator hi def link slpconfAttrEnd slpconfAttrBegin hi def link slpconfAttrSep slpconfSeparator hi def link slpconfStringsHome slpconfHome hi def link slpconfStringsEq slpconfEq hi def link slpconfStrings slpconfString hi def link slpconfStringsSep slpconfSeparator hi def link slpconfAddrsHome slpconfHome hi def link slpconfAddressesEq slpconfEq hi def link slpconfFQDNs String hi def link slpconfHostnumbers Number hi def link slpconfAddressesSep slpconfSeparator hi def link slpconfStringHome slpconfHome hi def link slpconfStringEq slpconfEq hi def link slpconfString String hi def link slpconfIntegersHome slpconfHome hi def link slpconfIntegersEq slpconfEq hi def link slpconfIntegers slpconfInteger hi def link slpconfIntegersSep slpconfSeparator hi def link slpconfHostnumsHome slpconfHome hi def link slpconfHostnumsEq slpconfEq hi def link slpconfOHostnumbers slpconfHostnumbers hi def link slpconfHostnumsSep slpconfSeparator hi def link slpconfLocaleHome slpconfHome hi def link slpconfLocaleEq slpconfEq hi def link slpconfLocale slpconfString let b:current_syntax = "slpconf" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/slpreg.vim000066400000000000000000000123261267703067000176230ustar00rootroot00000000000000" Vim syntax file " Language: RFC 2614 - An API for Service Location registration file " Maintainer: Nikolai Weibull " Latest Revision: 2006-04-19 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn keyword slpregTodo contained TODO FIXME XXX NOTE syn region slpregComment display oneline start='^[#;]' end='$' \ contains=slpregTodo,@Spell syn match slpregBegin display '^' \ nextgroup=slpregServiceURL, \ slpregComment syn match slpregServiceURL contained display 'service:' \ nextgroup=slpregServiceType syn match slpregServiceType contained display '\a[[:alpha:][:digit:]+-]*\%(\.\a[[:alpha:][:digit:]+-]*\)\=\%(:\a[[:alpha:][:digit:]+-]*\)\=' \ nextgroup=slpregServiceSAPCol syn match slpregServiceSAPCol contained display ':' \ nextgroup=slpregSAP syn match slpregSAP contained '[^,]\+' \ nextgroup=slpregLangSep "syn match slpregSAP contained display '\%(//\%(\%([[:alpha:][:digit:]$-_.~!*\'(),+;&=]*@\)\=\%([[:alnum:]][[:alnum:]-]*[[:alnum:]]\|[[:alnum:]]\.\)*\%(\a[[:alnum:]-]*[[:alnum:]]\|\a\)\%(:\d\+\)\=\)\=\|/at/\%([[:alpha:][:digit:]$-_.~]\|\\\x\x\)\{1,31}:\%([[:alpha:][:digit:]$-_.~]\|\\\x\x\)\{1,31}\%([[:alpha:][:digit:]$-_.~]\|\\\x\x\)\{1,31}\|/ipx/\x\{8}:\x\{12}:\x\{4}\)\%(/\%([[:alpha:][:digit:]$-_.~!*\'()+;?:@&=+]\|\\\x\x\)*\)*\%(;[^()\\!<=>~[:cntrl:]* \t_]\+\%(=[^()\\!<=>~[:cntrl:] ]\+\)\=\)*' syn match slpregLangSep contained display ',' \ nextgroup=slpregLang syn match slpregLang contained display '\a\{1,8}\%(-\a\{1,8\}\)\=' \ nextgroup=slpregLTimeSep syn match slpregLTimeSep contained display ',' \ nextgroup=slpregLTime syn match slpregLTime contained display '\d\{1,5}' \ nextgroup=slpregType,slpregUNewline syn match slpregType contained display '\a[[:alpha:][:digit:]+-]*' \ nextgroup=slpregUNewLine syn match slpregUNewLine contained '\s*\n' \ nextgroup=slpregScopes,slpregAttrList skipnl syn keyword slpregScopes contained scopes \ nextgroup=slpregScopesEq syn match slpregScopesEq contained '=' nextgroup=slpregScopeName syn match slpregScopeName contained '[^(),\\!<=>[:cntrl:];*+ ]\+' \ nextgroup=slpregScopeNameSep, \ slpregScopeNewline syn match slpregScopeNameSep contained ',' \ nextgroup=slpregScopeName syn match slpregScopeNewline contained '\s*\n' \ nextgroup=slpregAttribute skipnl syn match slpregAttribute contained '[^(),\\!<=>[:cntrl:]* \t_]\+' \ nextgroup=slpregAttributeEq, \ slpregScopeNewline syn match slpregAttributeEq contained '=' \ nextgroup=@slpregAttrValue syn cluster slpregAttrValueCon contains=slpregAttribute,slpregAttrValueSep syn cluster slpregAttrValue contains=slpregAttrIValue,slpregAttrSValue, \ slpregAttrBValue,slpregAttrSSValue syn match slpregAttrSValue contained display '[^(),\\!<=>~[:cntrl:]]\+' \ nextgroup=@slpregAttrValueCon skipwhite skipnl syn match slpregAttrSSValue contained display '\\FF\%(\\\x\x\)\+' \ nextgroup=@slpregAttrValueCon skipwhite skipnl syn match slpregAttrIValue contained display '[-]\=\d\+\>' \ nextgroup=@slpregAttrValueCon skipwhite skipnl syn keyword slpregAttrBValue contained true false \ nextgroup=@slpregAttrValueCon skipwhite skipnl syn match slpregAttrValueSep contained display ',' \ nextgroup=@slpregAttrValue skipwhite skipnl hi def link slpregTodo Todo hi def link slpregComment Comment hi def link slpregServiceURL Type hi def link slpregServiceType slpregServiceURL hi def link slpregServiceSAPCol slpregServiceURL hi def link slpregSAP slpregServiceURL hi def link slpregDelimiter Delimiter hi def link slpregLangSep slpregDelimiter hi def link slpregLang String hi def link slpregLTimeSep slpregDelimiter hi def link slpregLTime Number hi def link slpregType Type hi def link slpregScopes Identifier hi def link slpregScopesEq Operator hi def link slpregScopeName String hi def link slpregScopeNameSep slpregDelimiter hi def link slpregAttribute Identifier hi def link slpregAttributeEq Operator hi def link slpregAttrSValue String hi def link slpregAttrSSValue slpregAttrSValue hi def link slpregAttrIValue Number hi def link slpregAttrBValue Boolean hi def link slpregAttrValueSep slpregDelimiter let b:current_syntax = "slpreg" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/slpspi.vim000066400000000000000000000022211267703067000176320ustar00rootroot00000000000000" Vim syntax file " Language: RFC 2614 - An API for Service Location SPI file " Maintainer: Nikolai Weibull " Latest Revision: 2006-04-19 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn keyword slpspiTodo contained TODO FIXME XXX NOTE syn region slpspiComment display oneline start='^[#;]' end='$' \ contains=slpspiTodo,@Spell syn match slpspiBegin display '^' \ nextgroup=slpspiKeyType, \ slpspiComment skipwhite syn keyword slpspiKeyType contained PRIVATE PUBLIC \ nextgroup=slpspiString skipwhite syn match slpspiString contained '\S\+' \ nextgroup=slpspiKeyFile skipwhite syn match slpspiKeyFile contained '\S\+' hi def link slpspiTodo Todo hi def link slpspiComment Comment hi def link slpspiKeyType Type hi def link slpspiString Identifier hi def link slpspiKeyFile String let b:current_syntax = "slpspi" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/slrnrc.vim000066400000000000000000000315461267703067000176370ustar00rootroot00000000000000" Vim syntax file " Language: Slrn setup file (based on slrn 0.9.8.1) " Maintainer: Preben 'Peppe' Guldberg " Last Change: 23 April 2006 " For version 5.x: Clear all syntax items " 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 "\" 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_sort 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 complete cycle del delbol delbow 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 '\("\=\)\\1\s\+\S\+' skipwhite nextgroup=slrnrcKey contains=slrnrcSetKeyObj\(Str\)\=,slrnrcFunArt syn match slrnrcSetkeyGroup contained '\("\=\)\\1\s\+\S\+' skipwhite nextgroup=slrnrcKey contains=slrnrcSetKeyObj\(Str\)\=,slrnrcFunGroup syn match slrnrcSetkeyRead contained '\("\=\)\\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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/slrnsc.vim000066400000000000000000000067131267703067000176360ustar00rootroot00000000000000" Vim syntax file " Language: Slrn score file (based on slrn 0.9.8.0) " Maintainer: Preben 'Peppe' Guldberg " Last Change: 8 Oct 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/sm.vim000066400000000000000000000060661267703067000167520ustar00rootroot00000000000000" Vim syntax file " Language: sendmail " Maintainer: Charles E. Campbell " Last Change: Oct 23, 2014 " Version: 7 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SM if 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/smarty.vim000066400000000000000000000060231267703067000176430ustar00rootroot00000000000000" 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="\_[^>]*\" end="
"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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/smcl.vim000066400000000000000000000274011267703067000172650ustar00rootroot00000000000000" smcl.vim -- Vim syntax file for smcl files. " Language: SMCL -- Stata Markup and Control Language " Maintainer: Jeff Pitblado " Last Change: 26apr2006 " Version: 1.1.2 " Log: " 20mar2003 updated the match definition for cmdab " 14apr2006 'syntax clear' only under version control " check for 'b:current_syntax', removed 'did_smcl_syntax_inits' " 26apr2006 changed 'stata_smcl' to 'smcl' if version < 600 syntax clear elseif exists("b:current_syntax") finish endif syntax case match syn keyword smclCCLword current_date contained syn keyword smclCCLword current_time contained syn keyword smclCCLword rmsg_time contained syn keyword smclCCLword stata_version contained syn keyword smclCCLword version contained syn keyword smclCCLword born_date contained syn keyword smclCCLword flavor contained syn keyword smclCCLword SE contained syn keyword smclCCLword mode contained syn keyword smclCCLword console contained syn keyword smclCCLword os contained syn keyword smclCCLword osdtl contained syn keyword smclCCLword machine_type contained syn keyword smclCCLword byteorder contained syn keyword smclCCLword sysdir_stata contained syn keyword smclCCLword sysdir_updates contained syn keyword smclCCLword sysdir_base contained syn keyword smclCCLword sysdir_site contained syn keyword smclCCLword sysdir_plus contained syn keyword smclCCLword sysdir_personal contained syn keyword smclCCLword sysdir_oldplace contained syn keyword smclCCLword adopath contained syn keyword smclCCLword pwd contained syn keyword smclCCLword dirsep contained syn keyword smclCCLword max_N_theory contained syn keyword smclCCLword max_N_current contained syn keyword smclCCLword max_k_theory contained syn keyword smclCCLword max_k_current contained syn keyword smclCCLword max_width_theory contained syn keyword smclCCLword max_width_current contained syn keyword smclCCLword max_matsize contained syn keyword smclCCLword min_matsize contained syn keyword smclCCLword max_macrolen contained syn keyword smclCCLword macrolen contained syn keyword smclCCLword max_cmdlen contained syn keyword smclCCLword cmdlen contained syn keyword smclCCLword namelen contained syn keyword smclCCLword mindouble contained syn keyword smclCCLword maxdouble contained syn keyword smclCCLword epsdouble contained syn keyword smclCCLword minfloat contained syn keyword smclCCLword maxfloat contained syn keyword smclCCLword epsfloat contained syn keyword smclCCLword minlong contained syn keyword smclCCLword maxlong contained syn keyword smclCCLword minint contained syn keyword smclCCLword maxint contained syn keyword smclCCLword minbyte contained syn keyword smclCCLword maxbyte contained syn keyword smclCCLword maxstrvarlen contained syn keyword smclCCLword memory contained syn keyword smclCCLword maxvar contained syn keyword smclCCLword matsize contained syn keyword smclCCLword N contained syn keyword smclCCLword k contained syn keyword smclCCLword width contained syn keyword smclCCLword changed contained syn keyword smclCCLword filename contained syn keyword smclCCLword filedate contained syn keyword smclCCLword more contained syn keyword smclCCLword rmsg contained syn keyword smclCCLword dp contained syn keyword smclCCLword linesize contained syn keyword smclCCLword pagesize contained syn keyword smclCCLword logtype contained syn keyword smclCCLword linegap contained syn keyword smclCCLword scrollbufsize contained syn keyword smclCCLword varlabelpos contained syn keyword smclCCLword reventries contained syn keyword smclCCLword graphics contained syn keyword smclCCLword scheme contained syn keyword smclCCLword printcolor contained syn keyword smclCCLword adosize contained syn keyword smclCCLword maxdb contained syn keyword smclCCLword virtual contained syn keyword smclCCLword checksum contained syn keyword smclCCLword timeout1 contained syn keyword smclCCLword timeout2 contained syn keyword smclCCLword httpproxy contained syn keyword smclCCLword h_current contained syn keyword smclCCLword max_matsize contained syn keyword smclCCLword min_matsize contained syn keyword smclCCLword max_macrolen contained syn keyword smclCCLword macrolen contained syn keyword smclCCLword max_cmdlen contained syn keyword smclCCLword cmdlen contained syn keyword smclCCLword namelen contained syn keyword smclCCLword mindouble contained syn keyword smclCCLword maxdouble contained syn keyword smclCCLword epsdouble contained syn keyword smclCCLword minfloat contained syn keyword smclCCLword maxfloat contained syn keyword smclCCLword epsfloat contained syn keyword smclCCLword minlong contained syn keyword smclCCLword maxlong contained syn keyword smclCCLword minint contained syn keyword smclCCLword maxint contained syn keyword smclCCLword minbyte contained syn keyword smclCCLword maxbyte contained syn keyword smclCCLword maxstrvarlen contained syn keyword smclCCLword memory contained syn keyword smclCCLword maxvar contained syn keyword smclCCLword matsize contained syn keyword smclCCLword N contained syn keyword smclCCLword k contained syn keyword smclCCLword width contained syn keyword smclCCLword changed contained syn keyword smclCCLword filename contained syn keyword smclCCLword filedate contained syn keyword smclCCLword more contained syn keyword smclCCLword rmsg contained syn keyword smclCCLword dp contained syn keyword smclCCLword linesize contained syn keyword smclCCLword pagesize contained syn keyword smclCCLword logtype contained syn keyword smclCCLword linegap contained syn keyword smclCCLword scrollbufsize contained syn keyword smclCCLword varlabelpos contained syn keyword smclCCLword reventries contained syn keyword smclCCLword graphics contained syn keyword smclCCLword scheme contained syn keyword smclCCLword printcolor contained syn keyword smclCCLword adosize contained syn keyword smclCCLword maxdb contained syn keyword smclCCLword virtual contained syn keyword smclCCLword checksum contained syn keyword smclCCLword timeout1 contained syn keyword smclCCLword timeout2 contained syn keyword smclCCLword httpproxy contained syn keyword smclCCLword httpproxyhost contained syn keyword smclCCLword httpproxyport contained syn keyword smclCCLword httpproxyauth contained syn keyword smclCCLword httpproxyuser contained syn keyword smclCCLword httpproxypw contained syn keyword smclCCLword trace contained syn keyword smclCCLword tracedepth contained syn keyword smclCCLword tracesep contained syn keyword smclCCLword traceindent contained syn keyword smclCCLword traceexapnd contained syn keyword smclCCLword tracenumber contained syn keyword smclCCLword type contained syn keyword smclCCLword level contained syn keyword smclCCLword seed contained syn keyword smclCCLword searchdefault contained syn keyword smclCCLword pi contained syn keyword smclCCLword rc contained " Directive for the contant and current-value class syn region smclCCL start=/{ccl / end=/}/ oneline contains=smclCCLword " The order of the following syntax definitions is roughly that of the on-line " documentation for smcl in Stata, from within Stata see help smcl. " Format directives for line and paragraph modes syn match smclFormat /{smcl}/ syn match smclFormat /{sf\(\|:[^}]\+\)}/ syn match smclFormat /{it\(\|:[^}]\+\)}/ syn match smclFormat /{bf\(\|:[^}]\+\)}/ syn match smclFormat /{inp\(\|:[^}]\+\)}/ syn match smclFormat /{input\(\|:[^}]\+\)}/ syn match smclFormat /{err\(\|:[^}]\+\)}/ syn match smclFormat /{error\(\|:[^}]\+\)}/ syn match smclFormat /{res\(\|:[^}]\+\)}/ syn match smclFormat /{result\(\|:[^}]\+\)}/ syn match smclFormat /{txt\(\|:[^}]\+\)}/ syn match smclFormat /{text\(\|:[^}]\+\)}/ syn match smclFormat /{com\(\|:[^}]\+\)}/ syn match smclFormat /{cmd\(\|:[^}]\+\)}/ syn match smclFormat /{cmdab:[^:}]\+:[^:}()]*\(\|:\|:(\|:()\)}/ syn match smclFormat /{hi\(\|:[^}]\+\)}/ syn match smclFormat /{hilite\(\|:[^}]\+\)}/ syn match smclFormat /{ul \(on\|off\)}/ syn match smclFormat /{ul:[^}]\+}/ syn match smclFormat /{hline\(\| \d\+\| -\d\+\|:[^}]\+\)}/ syn match smclFormat /{dup \d\+:[^}]\+}/ syn match smclFormat /{c [^}]\+}/ syn match smclFormat /{char [^}]\+}/ syn match smclFormat /{reset}/ " Formatting directives for line mode syn match smclFormat /{title:[^}]\+}/ syn match smclFormat /{center:[^}]\+}/ syn match smclFormat /{centre:[^}]\+}/ syn match smclFormat /{center \d\+:[^}]\+}/ syn match smclFormat /{centre \d\+:[^}]\+}/ syn match smclFormat /{right:[^}]\+}/ syn match smclFormat /{lalign \d\+:[^}]\+}/ syn match smclFormat /{ralign \d\+:[^}]\+}/ syn match smclFormat /{\.\.\.}/ syn match smclFormat /{col \d\+}/ syn match smclFormat /{space \d\+}/ syn match smclFormat /{tab}/ " Formatting directives for paragraph mode syn match smclFormat /{bind:[^}]\+}/ syn match smclFormat /{break}/ syn match smclFormat /{p}/ syn match smclFormat /{p \d\+}/ syn match smclFormat /{p \d\+ \d\+}/ syn match smclFormat /{p \d\+ \d\+ \d\+}/ syn match smclFormat /{pstd}/ syn match smclFormat /{psee}/ syn match smclFormat /{phang\(\|2\|3\)}/ syn match smclFormat /{pmore\(\|2\|3\)}/ syn match smclFormat /{pin\(\|2\|3\)}/ syn match smclFormat /{p_end}/ syn match smclFormat /{opt \w\+\(\|:\w\+\)\(\|([^)}]*)\)}/ syn match smclFormat /{opth \w*\(\|:\w\+\)(\w*)}/ syn match smclFormat /{opth "\w\+\((\w\+:[^)}]\+)\)"}/ syn match smclFormat /{opth \w\+:\w\+(\w\+:[^)}]\+)}/ syn match smclFormat /{dlgtab\s*\(\|\d\+\|\d\+\s\+\d\+\):[^}]\+}/ syn match smclFormat /{p2colset\s\+\d\+\s\+\d\+\s\+\d\+\s\+\d\+}/ syn match smclFormat /{p2col\s\+:[^{}]*}.*{p_end}/ syn match smclFormat /{p2col\s\+:{[^{}]*}}.*{p_end}/ syn match smclFormat /{p2coldent\s*:[^{}]*}.*{p_end}/ syn match smclFormat /{p2coldent\s*:{[^{}]*}}.*{p_end}/ syn match smclFormat /{p2line\s*\(\|\d\+\s\+\d\+\)}/ syn match smclFormat /{p2colreset}/ syn match smclFormat /{synoptset\s\+\d\+\s\+\w\+}/ syn match smclFormat /{synopt\s*:[^{}]*}.*{p_end}/ syn match smclFormat /{synopt\s*:{[^{}]*}}.*{p_end}/ syn match smclFormat /{syntab\s*:[^{}]*}/ syn match smclFormat /{synopthdr}/ syn match smclFormat /{synoptline}/ " Link directive for line and paragraph modes syn match smclLink /{help [^}]\+}/ syn match smclLink /{helpb [^}]\+}/ syn match smclLink /{help_d:[^}]\+}/ syn match smclLink /{search [^}]\+}/ syn match smclLink /{search_d:[^}]\+}/ syn match smclLink /{browse [^}]\+}/ syn match smclLink /{view [^}]\+}/ syn match smclLink /{view_d:[^}]\+}/ syn match smclLink /{news:[^}]\+}/ syn match smclLink /{net [^}]\+}/ syn match smclLink /{net_d:[^}]\+}/ syn match smclLink /{netfrom_d:[^}]\+}/ syn match smclLink /{ado [^}]\+}/ syn match smclLink /{ado_d:[^}]\+}/ syn match smclLink /{update [^}]\+}/ syn match smclLink /{update_d:[^}]\+}/ syn match smclLink /{dialog [^}]\+}/ syn match smclLink /{back:[^}]\+}/ syn match smclLink /{clearmore:[^}]\+}/ syn match smclLink /{stata [^}]\+}/ syn match smclLink /{newvar\(\|:[^}]\+\)}/ syn match smclLink /{var\(\|:[^}]\+\)}/ syn match smclLink /{varname\(\|:[^}]\+\)}/ syn match smclLink /{vars\(\|:[^}]\+\)}/ syn match smclLink /{varlist\(\|:[^}]\+\)}/ syn match smclLink /{depvar\(\|:[^}]\+\)}/ syn match smclLink /{depvars\(\|:[^}]\+\)}/ syn match smclLink /{depvarlist\(\|:[^}]\+\)}/ syn match smclLink /{indepvars\(\|:[^}]\+\)}/ syn match smclLink /{dtype}/ syn match smclLink /{ifin}/ syn match smclLink /{weight}/ " Comment syn region smclComment start=/{\*/ end=/}/ oneline " Strings syn region smclString matchgroup=Nothing start=/"/ end=/"/ oneline syn region smclEString matchgroup=Nothing start=/`"/ end=/"'/ oneline contains=smclEString " assign highlight groups hi def link smclEString smclString hi def link smclCCLword Statement hi def link smclCCL Type hi def link smclFormat Statement hi def link smclLink Underlined hi def link smclComment Comment hi def link smclString String let b:current_syntax = "smcl" " vim: ts=8 vim-7.4.1689/runtime/syntax/smil.vim000066400000000000000000000135341267703067000172750ustar00rootroot00000000000000" Vim syntax file " Language: SMIL (Synchronized Multimedia Integration Language) " Maintainer: Herve Foucher " URL: http://www.helio.org/vim/syntax/smil.vim " Last Change: 2012 Feb 03 by Thilo Six " 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 let s:cpo_save = &cpo set cpo&vim " 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=++ 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 +]<"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=++ else syn region smilComment start=++ contains=smilCommentPart,smilCommentError syn match smilCommentError 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_smil_syntax_inits") if version < 508 let did_smil_syntax_inits = 1 command -nargs=+ HiLink hi link else command -nargs=+ HiLink hi def link 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 let &cpo = s:cpo_save unlet s:cpo_save " vim: ts=8 vim-7.4.1689/runtime/syntax/smith.vim000066400000000000000000000022531267703067000174510ustar00rootroot00000000000000" Vim syntax file " Language: SMITH " Maintainer: Rafal M. Sulejman " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/sml.vim000066400000000000000000000226471267703067000171310ustar00rootroot00000000000000" Vim syntax file " Language: SML " Filenames: *.sml *.sig " Maintainers: Markus Mottl " Fabrizio Zeno Cornelli " URL: http://www.ocaml.info/vim/syntax/sml.vim " Last Change: 2006 Oct 23 - Fixed character highlighting bug (MM) " 2002 Jun 02 - Fixed small typo (MM) " 2001 Nov 20 - Fixed small highlighting bug with modules (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 "\" " Error-highlighting of "end" without synchronization: " as keyword or as error (default) if exists("sml_noend_error") syn match smlKeyword "\" else syn match smlEndErr "\" 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="\" matchgroup=smlKeyword end="\" contains=ALLBUT,@smlContained,smlEndErr " local syn region smlEnd matchgroup=smlKeyword start="\" matchgroup=smlKeyword end="\" contains=ALLBUT,@smlContained,smlEndErr " abstype syn region smlNone matchgroup=smlKeyword start="\" matchgroup=smlKeyword end="\" contains=ALLBUT,@smlContained,smlEndErr " begin syn region smlEnd matchgroup=smlKeyword start="\" matchgroup=smlKeyword end="\" contains=ALLBUT,@smlContained,smlEndErr " if syn region smlNone matchgroup=smlKeyword start="\" matchgroup=smlKeyword end="\" contains=ALLBUT,@smlContained,smlThenErr "" Modules " "struct" syn region smlStruct matchgroup=smlModule start="\" matchgroup=smlModule end="\" contains=ALLBUT,@smlContained,smlEndErr " "sig" syn region smlSig matchgroup=smlModule start="\" matchgroup=smlModule end="\" contains=ALLBUT,@smlContained,smlEndErr,smlModule syn region smlModSpec matchgroup=smlKeyword start="\" matchgroup=smlModule end="\<\u\(\w\|'\)*\>" contained contains=@smlAllErrs,smlComment skipwhite skipempty nextgroup=smlModTRWith,smlMPRestr " "open" syn region smlNone matchgroup=smlKeyword start="\" 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="\" 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="\" 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="\" 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 "\" syn sync match smlEndSync groupthere smlEnd "\" syn sync match smlStructSync grouphere smlStruct "\" syn sync match smlStructSync groupthere smlStruct "\" syn sync match smlSigSync grouphere smlSig "\" syn sync match smlSigSync groupthere smlSig "\" " Define the default highlighting. " For version 5.7 and earlier: only 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/snnsnet.vim000066400000000000000000000052051267703067000200150ustar00rootroot00000000000000" Vim syntax file " Language: SNNS network file " Maintainer: Davide Alberani " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/snnspat.vim000066400000000000000000000045761267703067000200250ustar00rootroot00000000000000" Vim syntax file " Language: SNNS pattern file " Maintainer: Davide Alberani " Last Change: 2012 Feb 03 by Thilo Six " 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 let s:cpo_save = &cpo set cpo&vim " 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 else command -nargs=+ HiLink hi def link 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" let &cpo = s:cpo_save unlet s:cpo_save " vim: ts=8 sw=2 vim-7.4.1689/runtime/syntax/snnsres.vim000066400000000000000000000041401267703067000200150ustar00rootroot00000000000000" Vim syntax file " Language: SNNS result file " Maintainer: Davide Alberani " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/snobol4.vim000066400000000000000000000127511267703067000177110ustar00rootroot00000000000000" Vim syntax file " Language: SNOBOL4 " Maintainer: Rafal Sulejman " Site: http://rms.republika.pl/vim/syntax/snobol4.vim " Last change: 2006 may 10 " Changes: " - strict snobol4 mode (set snobol4_strict_mode to activate) " - incorrect HL of dots in strings corrected " - incorrect HL of dot-variables in parens corrected " - one character labels weren't displayed correctly. " - nonexistent Snobol4 keywords displayed as errors. " For version 5.x: Clear all syntax items " 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 " Snobol4 keywords syn keyword snobol4Keyword any apply arb arbno arg array syn keyword snobol4Keyword break syn keyword snobol4Keyword char clear code collect convert copy syn keyword snobol4Keyword data datatype date define detach differ dump dupl syn keyword snobol4Keyword endfile eq eval syn keyword snobol4Keyword field syn keyword snobol4Keyword ge gt ident syn keyword snobol4Keyword input integer item syn keyword snobol4Keyword le len lgt local lpad lt syn keyword snobol4Keyword ne notany syn keyword snobol4Keyword opsyn output syn keyword snobol4Keyword pos prototype syn keyword snobol4Keyword remdr replace rpad rpos rtab rewind syn keyword snobol4Keyword size span stoptr syn keyword snobol4Keyword tab table time trace trim terminal syn keyword snobol4Keyword unload syn keyword snobol4Keyword value " CSNOBOL keywords syn keyword snobol4ExtKeyword breakx syn keyword snobol4ExtKeyword char chop syn keyword snobol4ExtKeyword date delete syn keyword snobol4ExtKeyword exp syn keyword snobol4ExtKeyword freeze function syn keyword snobol4ExtKeyword host syn keyword snobol4ExtKeyword io_findunit syn keyword snobol4ExtKeyword label lpad leq lge lle llt lne log syn keyword snobol4ExtKeyword ord syn keyword snobol4ExtKeyword reverse rpad rsort rename syn keyword snobol4ExtKeyword serv_listen sset set sort sqrt substr syn keyword snobol4ExtKeyword thaw syn keyword snobol4ExtKeyword vdiffer syn region snobol4String matchgroup=Quote start=+"+ end=+"+ syn region snobol4String matchgroup=Quote start=+'+ end=+'+ syn match snobol4BogusStatement "^-[^ ][^ ]*" syn match snobol4Statement "^-\(include\|copy\|module\|line\|plusopts\|case\|error\|noerrors\|list\|unlist\|execute\|noexecute\|copy\)" syn match snobol4Constant /"[^a-z"']\.[a-z][a-z0-9\-]*"/hs=s+1 syn region snobol4Goto start=":[sf]\{0,1}(" end=")\|$\|;" contains=ALLBUT,snobol4ParenError syn match snobol4Number "\<\d*\(\.\d\d*\)*\>" syn match snobol4BogusSysVar "&\w\{1,}" syn match snobol4SysVar "&\(abort\|alphabet\|anchor\|arb\|bal\|case\|code\|dump\|errlimit\|errtext\|errtype\|fail\|fence\|fnclevel\|ftrace\|fullscan\|input\|lastno\|lcase\|maxlngth\|output\|parm\|rem\|rtntype\|stcount\|stfcount\|stlimit\|stno\|succeed\|trace\|trim\|ucase\)" syn match snobol4ExtSysVar "&\(gtrace\|line\|file\|lastline\|lastfile\)" syn match snobol4Label "\(^\|;\)[^-\.\+ \t\*\.]\{1,}[^ \t\*\;]*" syn match snobol4Comment "\(^\|;\)\([\*\|!;#].*$\)" " 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 else command -nargs=+ HiLink hi def link endif HiLink snobol4Constant Constant HiLink snobol4Label Label HiLink snobol4Goto Repeat HiLink snobol4Conditional Conditional HiLink snobol4Repeat Repeat HiLink snobol4Number Number HiLink snobol4Error Error HiLink snobol4Statement PreProc HiLink snobol4BogusStatement snobol4Error HiLink snobol4String String HiLink snobol4Comment Comment HiLink snobol4Special Special HiLink snobol4Todo Todo HiLink snobol4Keyword Keyword HiLink snobol4Function Function HiLink snobol4MathsOperator Operator HiLink snobol4ParenError snobol4Error HiLink snobol4ErrInParen snobol4Error HiLink snobol4ErrInBracket snobol4Error HiLink snobol4SysVar Keyword HiLink snobol4BogusSysVar snobol4Error if exists("snobol4_strict_mode") HiLink snobol4ExtSysVar WarningMsg HiLink snobol4ExtKeyword WarningMsg else HiLink snobol4ExtSysVar snobol4SysVar HiLink snobol4ExtKeyword snobol4Keyword endif delcommand HiLink endif let b:current_syntax = "snobol4" " vim: ts=8 vim-7.4.1689/runtime/syntax/spec.vim000066400000000000000000000307231267703067000172620ustar00rootroot00000000000000" Filename: spec.vim " Purpose: Vim syntax file " Language: SPEC: Build/install scripts for Linux RPM packages " Maintainer: Igor Gnatenko i.gnatenko.brain@gmail.com " Former Maintainer: Donovan Rebbechi elflord@panix.com (until March 2014) " Last Change: Sun Mar 2 10:33 MSK 2014 Igor Gnatenko " For version 5.x: Clear all syntax items " 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 '\' "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 items on specScriptArea's skip section syn region specSectionMacroArea oneline matchgroup=specSectionMacro start='^%\(define\|global\|patch\d*\|setup\|configure\|GNUconfigure\|find_lang\|makeinstall\|make_install\|include\)\>' end='$' contains=specCommandOpts,specMacroIdentifier syn region specSectionMacroBracketArea oneline matchgroup=specSectionMacro start='^%{\(configure\|GNUconfigure\|find_lang\|makeinstall\|make_install\)}' 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\|posttrans\)\>' skip='^%{\|^%\(define\|patch\d*\|configure\|GNUconfigure\|setup\|find_lang\|makeinstall\|make_install\)\>' 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="\" end="\" 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="\" end="\" contains=ALLBUT,shFunction,shIfError,shCase,@specListedFiles syn region shFor matchgroup=specBlock start="\" end="\" contains=ALLBUT,shFunction,shInError,shCase,@specListedFiles syn region shCaseEsac transparent matchgroup=specBlock start="\" matchgroup=NONE end="\"me=s-1 contains=ALLBUT,shFunction,shCaseError,@specListedFiles nextgroup=shCaseEsac syn region shCaseEsac matchgroup=specBlock start="\" end="\" 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 "\" syn sync match shDoSync groupthere shDo "\" syn sync match shIfSync grouphere shIf "\" syn sync match shIfSync groupthere shIf "\" syn sync match specIfSync grouphere specIf "%ifarch\|%ifos\|%ifnos" syn sync match specIfSync groupthere specIf "%endIf" syn sync match shForSync grouphere shFor "\" syn sync match shForSync groupthere shFor "\" syn sync match shCaseEsacSync grouphere shCaseEsac "\" syn sync match shCaseEsacSync groupthere shCaseEsac "\" " Define the default highlighting. " For version 5.7 and earlier: only 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/specman.vim000066400000000000000000000167401267703067000177610ustar00rootroot00000000000000" Vim syntax file " Language: SPECMAN E-LANGUAGE " Maintainer: Or Freund " 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 "[&|~>"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 else command -nargs=+ HiLink hi def link 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" vim-7.4.1689/runtime/syntax/spice.vim000066400000000000000000000051141267703067000174270ustar00rootroot00000000000000" Vim syntax file " Language: Spice circuit simulator input netlist " Maintainer: Noam Halevy " Last Change: 2012 Jun 01 " (Dominique Pelle added @Spell) " " 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 "^ \=\*.*$" contains=@Spell syn match spiceComment "\$.*$" contains=@Spell " 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 else command -nargs=+ HiLink hi def link 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 :p:h/spice.vim " vim: ts=8 vim-7.4.1689/runtime/syntax/splint.vim000066400000000000000000000374071267703067000176470ustar00rootroot00000000000000" Vim syntax file " Language: splint (C with lclint/splint Annotations) " Maintainer: Ralf Wildenhues " Splint Home: http://www.splint.org/ " Last Change: $Date: 2004/06/13 20:08:47 $ " $Revision: 1.1 $ " 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 :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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/spup.vim000066400000000000000000000337161267703067000173240ustar00rootroot00000000000000" Vim syntax file " Language: Speedup, plant simulator from AspenTech " Maintainer: Stefan.Schwarzer " URL: http://www.ndh.net/home/sschwarzer/download/spup.vim " Last Change: 2012 Feb 03 by Thilo Six " 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 let s:cpo_save = &cpo set cpo&vim " 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 else command -nargs=+ HiLink hi def link 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" let &cpo = s:cpo_save unlet s:cpo_save " vim:ts=8 vim-7.4.1689/runtime/syntax/spyce.vim000066400000000000000000000110021267703067000174400ustar00rootroot00000000000000" Vim syntax file " Language: SPYCE " Maintainer: Rimon Barr " URL: http://spyce.sourceforge.net " Last Change: 2009 Nov 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 ,, etc... if version < 600 so :p:h/html.vim else runtime! syntax/html.vim unlet b:current_syntax syntax spell default " added by Bram endif " include python syn include @Python :p:h/python.vim syn include @Html :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 vim-7.4.1689/runtime/syntax/sql.vim000066400000000000000000000023011267703067000171160ustar00rootroot00000000000000" Vim syntax file loader " Language: SQL " Maintainer: David Fishburn " Last Change: Thu Sep 15 2005 10:30:02 AM " Version: 1.0 " Description: Checks for a: " buffer local variable, " global variable, " If the above exist, it will source the type specified. " If none exist, it will source the default sql.vim 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 " Default to the standard Vim distribution file let filename = 'sqloracle' " Check for overrides. Buffer variables have the highest priority. if exists("b:sql_type_override") " Check the runtimepath to see if the file exists if globpath(&runtimepath, 'syntax/'.b:sql_type_override.'.vim') != '' let filename = b:sql_type_override endif elseif exists("g:sql_type_default") if globpath(&runtimepath, 'syntax/'.g:sql_type_default.'.vim') != '' let filename = g:sql_type_default endif endif " Source the appropriate file exec 'runtime syntax/'.filename.'.vim' " vim:sw=4: vim-7.4.1689/runtime/syntax/sqlanywhere.vim000066400000000000000000001220521267703067000206670ustar00rootroot00000000000000" Vim syntax file " Language: SQL, Adaptive Server Anywhere " Maintainer: David Fishburn " Last Change: 2013 May 13 " Version: 16.0.0 " Description: Updated to Adaptive Server Anywhere 16.0.0 " Updated to Adaptive Server Anywhere 12.0.1 (including spatial data) " Updated to Adaptive Server Anywhere 11.0.1 " Updated to Adaptive Server Anywhere 10.0.1 " Updated to Adaptive Server Anywhere 9.0.2 " Updated to Adaptive Server Anywhere 9.0.1 " Updated to Adaptive Server Anywhere 9.0.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 syn case ignore " The SQL reserved words, defined as keywords. syn keyword sqlSpecial false null true " common functions syn keyword sqlFunction abs argn avg bintohex bintostr syn keyword sqlFunction byte_length byte_substr char_length syn keyword sqlFunction compare count count_big datalength date syn keyword sqlFunction date_format dateadd datediff datename syn keyword sqlFunction datepart day dayname days debug_eng syn keyword sqlFunction dense_rank density dialect difference syn keyword sqlFunction dow estimate estimate_source evaluate syn keyword sqlFunction experience_estimate explanation syn keyword sqlFunction get_identity graphical_plan syn keyword sqlFunction graphical_ulplan greater grouping syn keyword sqlFunction hextobin hextoint hour hours identity syn keyword sqlFunction ifnull index_estimate inttohex isdate syn keyword sqlFunction isencrypted isnull isnumeric syn keyword sqlFunction lang_message length lesser like_end syn keyword sqlFunction like_start list long_ulplan lookup max syn keyword sqlFunction min minute minutes month monthname syn keyword sqlFunction months newid now nullif number syn keyword sqlFunction percent_rank plan quarter rand rank syn keyword sqlFunction regexp_compile regexp_compile_patindex syn keyword sqlFunction remainder rewrite rowid second seconds syn keyword sqlFunction short_ulplan similar sortkey soundex syn keyword sqlFunction stddev stack_trace str string strtobin strtouuid stuff syn keyword sqlFunction subpartition substr substring sum switchoffset sysdatetimeoffset syn keyword sqlFunction textptr todate todatetimeoffset today totimestamp traceback transactsql syn keyword sqlFunction ts_index_statistics ts_table_statistics syn keyword sqlFunction tsequal ulplan user_id user_name utc_now syn keyword sqlFunction uuidtostr varexists variance watcomsql syn keyword sqlFunction weeks wsql_state year years ymd " 9.0.1 functions syn keyword sqlFunction acos asin atan atn2 cast ceiling convert cos cot syn keyword sqlFunction char_length coalesce dateformat datetime degrees exp syn keyword sqlFunction floor getdate insertstr syn keyword sqlFunction log log10 lower mod pi power syn keyword sqlFunction property radians replicate round sign sin syn keyword sqlFunction sqldialect tan truncate truncnum syn keyword sqlFunction base64_encode base64_decode syn keyword sqlFunction hash compress decompress encrypt decrypt " 11.0.1 functions syn keyword sqlFunction connection_extended_property text_handle_vector_match syn keyword sqlFunction read_client_file write_client_file " 12.0.1 functions syn keyword sqlFunction http_response_header " string functions syn keyword sqlFunction ascii char left ltrim repeat syn keyword sqlFunction space right rtrim trim lcase ucase syn keyword sqlFunction locate charindex patindex replace syn keyword sqlFunction errormsg csconvert " property functions syn keyword sqlFunction db_id db_name property_name syn keyword sqlFunction property_description property_number syn keyword sqlFunction next_connection next_database property syn keyword sqlFunction connection_property db_property db_extended_property syn keyword sqlFunction event_parmeter event_condition event_condition_name " sa_ procedures syn keyword sqlFunction sa_add_index_consultant_analysis syn keyword sqlFunction sa_add_workload_query syn keyword sqlFunction sa_app_deregister syn keyword sqlFunction sa_app_get_infoStr syn keyword sqlFunction sa_app_get_status syn keyword sqlFunction sa_app_register syn keyword sqlFunction sa_app_registration_unlock syn keyword sqlFunction sa_app_set_infoStr syn keyword sqlFunction sa_audit_string syn keyword sqlFunction sa_check_commit syn keyword sqlFunction sa_checkpoint_execute syn keyword sqlFunction sa_conn_activity syn keyword sqlFunction sa_conn_compression_info syn keyword sqlFunction sa_conn_deregister syn keyword sqlFunction sa_conn_info syn keyword sqlFunction sa_conn_properties syn keyword sqlFunction sa_conn_properties_by_conn syn keyword sqlFunction sa_conn_properties_by_name syn keyword sqlFunction sa_conn_register syn keyword sqlFunction sa_conn_set_status syn keyword sqlFunction sa_create_analysis_from_query syn keyword sqlFunction sa_db_info syn keyword sqlFunction sa_db_properties syn keyword sqlFunction sa_disable_auditing_type syn keyword sqlFunction sa_disable_index syn keyword sqlFunction sa_disk_free_space syn keyword sqlFunction sa_enable_auditing_type syn keyword sqlFunction sa_enable_index syn keyword sqlFunction sa_end_forward_to syn keyword sqlFunction sa_eng_properties syn keyword sqlFunction sa_event_schedules syn keyword sqlFunction sa_exec_script syn keyword sqlFunction sa_flush_cache syn keyword sqlFunction sa_flush_statistics syn keyword sqlFunction sa_forward_to syn keyword sqlFunction sa_get_dtt syn keyword sqlFunction sa_get_histogram syn keyword sqlFunction sa_get_request_profile syn keyword sqlFunction sa_get_request_profile_sub syn keyword sqlFunction sa_get_request_times syn keyword sqlFunction sa_get_server_messages syn keyword sqlFunction sa_get_simulated_scale_factors syn keyword sqlFunction sa_get_workload_capture_status syn keyword sqlFunction sa_index_density syn keyword sqlFunction sa_index_levels syn keyword sqlFunction sa_index_statistics syn keyword sqlFunction sa_internal_alter_index_ability syn keyword sqlFunction sa_internal_create_analysis_from_query syn keyword sqlFunction sa_internal_disk_free_space syn keyword sqlFunction sa_internal_get_dtt syn keyword sqlFunction sa_internal_get_histogram syn keyword sqlFunction sa_internal_get_request_times syn keyword sqlFunction sa_internal_get_simulated_scale_factors syn keyword sqlFunction sa_internal_get_workload_capture_status syn keyword sqlFunction sa_internal_index_density syn keyword sqlFunction sa_internal_index_levels syn keyword sqlFunction sa_internal_index_statistics syn keyword sqlFunction sa_internal_java_loaded_classes syn keyword sqlFunction sa_internal_locks syn keyword sqlFunction sa_internal_pause_workload_capture syn keyword sqlFunction sa_internal_procedure_profile syn keyword sqlFunction sa_internal_procedure_profile_summary syn keyword sqlFunction sa_internal_read_backup_history syn keyword sqlFunction sa_internal_recommend_indexes syn keyword sqlFunction sa_internal_reset_identity syn keyword sqlFunction sa_internal_resume_workload_capture syn keyword sqlFunction sa_internal_start_workload_capture syn keyword sqlFunction sa_internal_stop_index_consultant syn keyword sqlFunction sa_internal_stop_workload_capture syn keyword sqlFunction sa_internal_table_fragmentation syn keyword sqlFunction sa_internal_table_page_usage syn keyword sqlFunction sa_internal_table_stats syn keyword sqlFunction sa_internal_virtual_sysindex syn keyword sqlFunction sa_internal_virtual_sysixcol syn keyword sqlFunction sa_java_loaded_classes syn keyword sqlFunction sa_jdk_version syn keyword sqlFunction sa_locks syn keyword sqlFunction sa_make_object syn keyword sqlFunction sa_pause_workload_capture syn keyword sqlFunction sa_proc_debug_attach_to_connection syn keyword sqlFunction sa_proc_debug_connect syn keyword sqlFunction sa_proc_debug_detach_from_connection syn keyword sqlFunction sa_proc_debug_disconnect syn keyword sqlFunction sa_proc_debug_get_connection_name syn keyword sqlFunction sa_proc_debug_release_connection syn keyword sqlFunction sa_proc_debug_request syn keyword sqlFunction sa_proc_debug_version syn keyword sqlFunction sa_proc_debug_wait_for_connection syn keyword sqlFunction sa_procedure_profile syn keyword sqlFunction sa_procedure_profile_summary syn keyword sqlFunction sa_read_backup_history syn keyword sqlFunction sa_recommend_indexes syn keyword sqlFunction sa_recompile_views syn keyword sqlFunction sa_remove_index_consultant_analysis syn keyword sqlFunction sa_remove_index_consultant_workload syn keyword sqlFunction sa_reset_identity syn keyword sqlFunction sa_resume_workload_capture syn keyword sqlFunction sa_server_option syn keyword sqlFunction sa_set_simulated_scale_factor syn keyword sqlFunction sa_setremoteuser syn keyword sqlFunction sa_setsubscription syn keyword sqlFunction sa_start_recording_commits syn keyword sqlFunction sa_start_workload_capture syn keyword sqlFunction sa_statement_text syn keyword sqlFunction sa_stop_index_consultant syn keyword sqlFunction sa_stop_recording_commits syn keyword sqlFunction sa_stop_workload_capture syn keyword sqlFunction sa_sync syn keyword sqlFunction sa_sync_sub syn keyword sqlFunction sa_table_fragmentation syn keyword sqlFunction sa_table_page_usage syn keyword sqlFunction sa_table_stats syn keyword sqlFunction sa_update_index_consultant_workload syn keyword sqlFunction sa_validate syn keyword sqlFunction sa_virtual_sysindex syn keyword sqlFunction sa_virtual_sysixcol " sp_ procedures syn keyword sqlFunction sp_addalias syn keyword sqlFunction sp_addauditrecord syn keyword sqlFunction sp_adddumpdevice syn keyword sqlFunction sp_addgroup syn keyword sqlFunction sp_addlanguage syn keyword sqlFunction sp_addlogin syn keyword sqlFunction sp_addmessage syn keyword sqlFunction sp_addremotelogin syn keyword sqlFunction sp_addsegment syn keyword sqlFunction sp_addserver syn keyword sqlFunction sp_addthreshold syn keyword sqlFunction sp_addtype syn keyword sqlFunction sp_adduser syn keyword sqlFunction sp_auditdatabase syn keyword sqlFunction sp_auditlogin syn keyword sqlFunction sp_auditobject syn keyword sqlFunction sp_auditoption syn keyword sqlFunction sp_auditsproc syn keyword sqlFunction sp_bindefault syn keyword sqlFunction sp_bindmsg syn keyword sqlFunction sp_bindrule syn keyword sqlFunction sp_changedbowner syn keyword sqlFunction sp_changegroup syn keyword sqlFunction sp_checknames syn keyword sqlFunction sp_checkperms syn keyword sqlFunction sp_checkreswords syn keyword sqlFunction sp_clearstats syn keyword sqlFunction sp_column_privileges syn keyword sqlFunction sp_columns syn keyword sqlFunction sp_commonkey syn keyword sqlFunction sp_configure syn keyword sqlFunction sp_cursorinfo syn keyword sqlFunction sp_databases syn keyword sqlFunction sp_datatype_info syn keyword sqlFunction sp_dboption syn keyword sqlFunction sp_dbremap syn keyword sqlFunction sp_depends syn keyword sqlFunction sp_diskdefault syn keyword sqlFunction sp_displaylogin syn keyword sqlFunction sp_dropalias syn keyword sqlFunction sp_dropdevice syn keyword sqlFunction sp_dropgroup syn keyword sqlFunction sp_dropkey syn keyword sqlFunction sp_droplanguage syn keyword sqlFunction sp_droplogin syn keyword sqlFunction sp_dropmessage syn keyword sqlFunction sp_dropremotelogin syn keyword sqlFunction sp_dropsegment syn keyword sqlFunction sp_dropserver syn keyword sqlFunction sp_dropthreshold syn keyword sqlFunction sp_droptype syn keyword sqlFunction sp_dropuser syn keyword sqlFunction sp_estspace syn keyword sqlFunction sp_extendsegment syn keyword sqlFunction sp_fkeys syn keyword sqlFunction sp_foreignkey syn keyword sqlFunction sp_getmessage syn keyword sqlFunction sp_help syn keyword sqlFunction sp_helpconstraint syn keyword sqlFunction sp_helpdb syn keyword sqlFunction sp_helpdevice syn keyword sqlFunction sp_helpgroup syn keyword sqlFunction sp_helpindex syn keyword sqlFunction sp_helpjoins syn keyword sqlFunction sp_helpkey syn keyword sqlFunction sp_helplanguage syn keyword sqlFunction sp_helplog syn keyword sqlFunction sp_helpprotect syn keyword sqlFunction sp_helpremotelogin syn keyword sqlFunction sp_helpsegment syn keyword sqlFunction sp_helpserver syn keyword sqlFunction sp_helpsort syn keyword sqlFunction sp_helptext syn keyword sqlFunction sp_helpthreshold syn keyword sqlFunction sp_helpuser syn keyword sqlFunction sp_indsuspect syn keyword sqlFunction sp_lock syn keyword sqlFunction sp_locklogin syn keyword sqlFunction sp_logdevice syn keyword sqlFunction sp_login_environment syn keyword sqlFunction sp_modifylogin syn keyword sqlFunction sp_modifythreshold syn keyword sqlFunction sp_monitor syn keyword sqlFunction sp_password syn keyword sqlFunction sp_pkeys syn keyword sqlFunction sp_placeobject syn keyword sqlFunction sp_primarykey syn keyword sqlFunction sp_procxmode syn keyword sqlFunction sp_recompile syn keyword sqlFunction sp_remap syn keyword sqlFunction sp_remote_columns syn keyword sqlFunction sp_remote_exported_keys syn keyword sqlFunction sp_remote_imported_keys syn keyword sqlFunction sp_remote_pcols syn keyword sqlFunction sp_remote_primary_keys syn keyword sqlFunction sp_remote_procedures syn keyword sqlFunction sp_remote_tables syn keyword sqlFunction sp_remoteoption syn keyword sqlFunction sp_rename syn keyword sqlFunction sp_renamedb syn keyword sqlFunction sp_reportstats syn keyword sqlFunction sp_reset_tsql_environment syn keyword sqlFunction sp_role syn keyword sqlFunction sp_server_info syn keyword sqlFunction sp_servercaps syn keyword sqlFunction sp_serverinfo syn keyword sqlFunction sp_serveroption syn keyword sqlFunction sp_setlangalias syn keyword sqlFunction sp_setreplicate syn keyword sqlFunction sp_setrepproc syn keyword sqlFunction sp_setreptable syn keyword sqlFunction sp_spaceused syn keyword sqlFunction sp_special_columns syn keyword sqlFunction sp_sproc_columns syn keyword sqlFunction sp_statistics syn keyword sqlFunction sp_stored_procedures syn keyword sqlFunction sp_syntax syn keyword sqlFunction sp_table_privileges syn keyword sqlFunction sp_tables syn keyword sqlFunction sp_tsql_environment syn keyword sqlFunction sp_tsql_feature_not_supported syn keyword sqlFunction sp_unbindefault syn keyword sqlFunction sp_unbindmsg syn keyword sqlFunction sp_unbindrule syn keyword sqlFunction sp_volchanged syn keyword sqlFunction sp_who syn keyword sqlFunction xp_scanf syn keyword sqlFunction xp_sprintf " server functions syn keyword sqlFunction col_length syn keyword sqlFunction col_name syn keyword sqlFunction index_col syn keyword sqlFunction object_id syn keyword sqlFunction object_name syn keyword sqlFunction proc_role syn keyword sqlFunction show_role syn keyword sqlFunction xp_cmdshell syn keyword sqlFunction xp_msver syn keyword sqlFunction xp_read_file syn keyword sqlFunction xp_real_cmdshell syn keyword sqlFunction xp_real_read_file syn keyword sqlFunction xp_real_sendmail syn keyword sqlFunction xp_real_startmail syn keyword sqlFunction xp_real_startsmtp syn keyword sqlFunction xp_real_stopmail syn keyword sqlFunction xp_real_stopsmtp syn keyword sqlFunction xp_real_write_file syn keyword sqlFunction xp_scanf syn keyword sqlFunction xp_sendmail syn keyword sqlFunction xp_sprintf syn keyword sqlFunction xp_startmail syn keyword sqlFunction xp_startsmtp syn keyword sqlFunction xp_stopmail syn keyword sqlFunction xp_stopsmtp syn keyword sqlFunction xp_write_file " http functions syn keyword sqlFunction http_header http_variable syn keyword sqlFunction next_http_header next_http_response_header next_http_variable syn keyword sqlFunction sa_set_http_header sa_set_http_option syn keyword sqlFunction sa_http_variable_info sa_http_header_info " http functions 9.0.1 syn keyword sqlFunction http_encode http_decode syn keyword sqlFunction html_encode html_decode " XML function support syn keyword sqlFunction openxml xmlelement xmlforest xmlgen xmlconcat xmlagg syn keyword sqlFunction xmlattributes " Spatial Compatibility Functions syn keyword sqlFunction ST_BdMPolyFromText syn keyword sqlFunction ST_BdMPolyFromWKB syn keyword sqlFunction ST_BdPolyFromText syn keyword sqlFunction ST_BdPolyFromWKB syn keyword sqlFunction ST_CPolyFromText syn keyword sqlFunction ST_CPolyFromWKB syn keyword sqlFunction ST_CircularFromTxt syn keyword sqlFunction ST_CircularFromWKB syn keyword sqlFunction ST_CompoundFromTxt syn keyword sqlFunction ST_CompoundFromWKB syn keyword sqlFunction ST_GeomCollFromTxt syn keyword sqlFunction ST_GeomCollFromWKB syn keyword sqlFunction ST_GeomFromText syn keyword sqlFunction ST_GeomFromWKB syn keyword sqlFunction ST_LineFromText syn keyword sqlFunction ST_LineFromWKB syn keyword sqlFunction ST_MCurveFromText syn keyword sqlFunction ST_MCurveFromWKB syn keyword sqlFunction ST_MLineFromText syn keyword sqlFunction ST_MLineFromWKB syn keyword sqlFunction ST_MPointFromText syn keyword sqlFunction ST_MPointFromWKB syn keyword sqlFunction ST_MPolyFromText syn keyword sqlFunction ST_MPolyFromWKB syn keyword sqlFunction ST_MSurfaceFromTxt syn keyword sqlFunction ST_MSurfaceFromWKB syn keyword sqlFunction ST_OrderingEquals syn keyword sqlFunction ST_PointFromText syn keyword sqlFunction ST_PointFromWKB syn keyword sqlFunction ST_PolyFromText syn keyword sqlFunction ST_PolyFromWKB " Spatial Structural Methods syn keyword sqlFunction ST_CoordDim syn keyword sqlFunction ST_CurveN syn keyword sqlFunction ST_Dimension syn keyword sqlFunction ST_EndPoint syn keyword sqlFunction ST_ExteriorRing syn keyword sqlFunction ST_GeometryN syn keyword sqlFunction ST_GeometryType syn keyword sqlFunction ST_InteriorRingN syn keyword sqlFunction ST_Is3D syn keyword sqlFunction ST_IsClosed syn keyword sqlFunction ST_IsEmpty syn keyword sqlFunction ST_IsMeasured syn keyword sqlFunction ST_IsRing syn keyword sqlFunction ST_IsSimple syn keyword sqlFunction ST_IsValid syn keyword sqlFunction ST_NumCurves syn keyword sqlFunction ST_NumGeometries syn keyword sqlFunction ST_NumInteriorRing syn keyword sqlFunction ST_NumPoints syn keyword sqlFunction ST_PointN syn keyword sqlFunction ST_StartPoint "Spatial Computation syn keyword sqlFunction ST_Length syn keyword sqlFunction ST_Area syn keyword sqlFunction ST_Centroid syn keyword sqlFunction ST_Area syn keyword sqlFunction ST_Centroid syn keyword sqlFunction ST_IsWorld syn keyword sqlFunction ST_Perimeter syn keyword sqlFunction ST_PointOnSurface syn keyword sqlFunction ST_Distance " Spatial Input/Output syn keyword sqlFunction ST_AsBinary syn keyword sqlFunction ST_AsGML syn keyword sqlFunction ST_AsGeoJSON syn keyword sqlFunction ST_AsSVG syn keyword sqlFunction ST_AsSVGAggr syn keyword sqlFunction ST_AsText syn keyword sqlFunction ST_AsWKB syn keyword sqlFunction ST_AsWKT syn keyword sqlFunction ST_AsXML syn keyword sqlFunction ST_GeomFromBinary syn keyword sqlFunction ST_GeomFromShape syn keyword sqlFunction ST_GeomFromText syn keyword sqlFunction ST_GeomFromWKB syn keyword sqlFunction ST_GeomFromWKT syn keyword sqlFunction ST_GeomFromXML " Spatial Cast Methods syn keyword sqlFunction ST_CurvePolyToPoly syn keyword sqlFunction ST_CurveToLine syn keyword sqlFunction ST_ToCircular syn keyword sqlFunction ST_ToCompound syn keyword sqlFunction ST_ToCurve syn keyword sqlFunction ST_ToCurvePoly syn keyword sqlFunction ST_ToGeomColl syn keyword sqlFunction ST_ToLineString syn keyword sqlFunction ST_ToMultiCurve syn keyword sqlFunction ST_ToMultiLine syn keyword sqlFunction ST_ToMultiPoint syn keyword sqlFunction ST_ToMultiPolygon syn keyword sqlFunction ST_ToMultiSurface syn keyword sqlFunction ST_ToPoint syn keyword sqlFunction ST_ToPolygon syn keyword sqlFunction ST_ToSurface " Array functions 16.x syn keyword sqlFunction array array_agg array_max_cardinality trim_array syn keyword sqlFunction error_line error_message error_procedure syn keyword sqlFunction error_sqlcode error_sqlstate error_stack_trace " keywords syn keyword sqlKeyword absolute accent access account action active activate add address admin syn keyword sqlKeyword aes_decrypt after aggregate algorithm allow_dup_row allow allowed alter syn keyword sqlKeyword always and angular ansi_substring any as append apply syn keyword sqlKeyword arbiter array asc ascii ase syn keyword sqlKeyword assign at atan2 atomic attended syn keyword sqlKeyword audit auditing authentication authorization axis syn keyword sqlKeyword autoincrement autostop batch bcp before syn keyword sqlKeyword between bit_and bit_length bit_or bit_substr bit_xor syn keyword sqlKeyword blank blanks block syn keyword sqlKeyword both bottom unbounded breaker bufferpool syn keyword sqlKeyword build bulk by byte bytes cache calibrate calibration syn keyword sqlKeyword cancel capability cardinality cascade cast syn keyword sqlKeyword catalog catch ceil change changes char char_convert syn keyword sqlKeyword check checkpointlog checksum class classes client cmp syn keyword sqlKeyword cluster clustered collation syn keyword sqlKeyword column columns syn keyword sqlKeyword command comments committed commitid comparisons syn keyword sqlKeyword compatible component compressed compute computes syn keyword sqlKeyword concat configuration confirm conflict connection syn keyword sqlKeyword console consolidate consolidated syn keyword sqlKeyword constraint constraints content syn keyword sqlKeyword convert coordinate coordinator copy count count_set_bits syn keyword sqlKeyword crc createtime critical cross cube cume_dist syn keyword sqlKeyword current cursor data data database syn keyword sqlKeyword current_timestamp current_user cycle syn keyword sqlKeyword databases datatype dba dbfile syn keyword sqlKeyword dbspace dbspaces dbspacename debug decoupled syn keyword sqlKeyword decrypted default defaults default_dbspace deferred syn keyword sqlKeyword definer definition syn keyword sqlKeyword delay deleting delimited dependencies desc syn keyword sqlKeyword description deterministic directory syn keyword sqlKeyword disable disabled disallow distinct disksandbox disk_sandbox syn keyword sqlKeyword dn do domain download duplicate syn keyword sqlKeyword dsetpass dttm dynamic each earth editproc effective ejb syn keyword sqlKeyword elimination ellipsoid else elseif syn keyword sqlKeyword email empty enable encapsulated encrypted encryption end syn keyword sqlKeyword encoding endif engine environment erase error errors escape escapes event syn keyword sqlKeyword event_parameter every exception exclude excluded exclusive exec syn keyword sqlKeyword existing exists expanded expiry express exprtype extended_property syn keyword sqlKeyword external externlogin factor failover false syn keyword sqlKeyword fastfirstrow feature fieldproc file files filler syn keyword sqlKeyword fillfactor final finish first first_keyword first_value syn keyword sqlKeyword flattening syn keyword sqlKeyword following force foreign format forjson forxml forxml_sep fp frame syn keyword sqlKeyword free freepage french fresh full function syn keyword sqlKeyword gb generic get_bit go global grid syn keyword sqlKeyword group handler hash having header hexadecimal syn keyword sqlKeyword hidden high history hg hng hold holdlock host syn keyword sqlKeyword hours http_body http_session_timeout id identified identity ignore syn keyword sqlKeyword ignore_dup_key ignore_dup_row immediate syn keyword sqlKeyword in inactiv inactive inactivity included increment incremental syn keyword sqlKeyword index index_enabled index_lparen indexonly info information syn keyword sqlKeyword inheritance inline inner inout insensitive inserting syn keyword sqlKeyword instead syn keyword sqlKeyword internal intersection into introduced inverse invoker syn keyword sqlKeyword iq is isolation syn keyword sqlKeyword jar java java_location java_main_userid java_vm_options syn keyword sqlKeyword jconnect jdk join json kb key keys keep language last syn keyword sqlKeyword last_keyword last_value lateral latitude syn keyword sqlKeyword ld ldap left len linear lf ln level like syn keyword sqlKeyword limit local location log syn keyword sqlKeyword logging logical login logscan long longitude low lru ls syn keyword sqlKeyword main major manage manual mark master syn keyword sqlKeyword match matched materialized max maxvalue maximum mb measure median membership syn keyword sqlKeyword merge metadata methods migrate minimum minor minutes minvalue mirror syn keyword sqlKeyword mode modify monitor move mru multiplex syn keyword sqlKeyword name named namespaces national native natural new next nextval syn keyword sqlKeyword ngram no noholdlock nolock nonclustered none normal not syn keyword sqlKeyword notify null nullable_constant nulls syn keyword sqlKeyword object objects oem_string of off offline offset olap syn keyword sqlKeyword old on online only openstring operator syn keyword sqlKeyword optimization optimizer option syn keyword sqlKeyword or order ordinality organization others out outer over owner syn keyword sqlKeyword package packetsize padding page pages syn keyword sqlKeyword paglock parallel parameter parent part partial syn keyword sqlKeyword partition partitions partner password path pctfree syn keyword sqlKeyword permissions perms plan planar policy polygon populate port postfilter preceding syn keyword sqlKeyword precisionprefetch prefilter prefix preserve preview previous syn keyword sqlKeyword primary prior priority priqty private privilege privileges procedure profile profiling syn keyword sqlKeyword property_is_cumulative property_is_numeric public publication publish publisher syn keyword sqlKeyword quiesce quote quotes range readclientfile readcommitted reader readfile readonly syn keyword sqlKeyword readpast readuncommitted readwrite rebuild syn keyword sqlKeyword received recompile recover recursive references syn keyword sqlKeyword referencing regex regexp regexp_substr relative relocate syn keyword sqlKeyword rename repeatable repeatableread replicate replication syn keyword sqlKeyword requests request_timeout required rereceive resend reserve reset syn keyword sqlKeyword resizing resolve resource respect restart syn keyword sqlKeyword restrict result retain retries syn keyword sqlKeyword returns reverse right role roles syn keyword sqlKeyword rollup root row row_number rowlock rows rowtype syn keyword sqlKeyword sa_index_hash sa_internal_fk_verify sa_internal_termbreak syn keyword sqlKeyword sa_order_preserving_hash sa_order_preserving_hash_big sa_order_preserving_hash_prefix syn keyword sqlKeyword sa_file_free_pages sa_internal_type_from_catalog sa_internal_valid_hash syn keyword sqlKeyword sa_internal_validate_value sa_json_element syn keyword sqlKeyword scale schedule schema scope script scripted scroll search seconds secqty security syn keyword sqlKeyword semi send sensitive sent sequence serializable syn keyword sqlKeyword server severity session set_bit set_bits sets syn keyword sqlKeyword shapefile share side simple since site size skip syn keyword sqlKeyword snap snapshot soapheader soap_header syn keyword sqlKeyword spatial split some sorted_data syn keyword sqlKeyword sql sqlcode sqlid sqlflagger sqlstate sqrt square syn keyword sqlKeyword stacker stale state statement statistics status stddev_pop stddev_samp syn keyword sqlKeyword stemmer stogroup stoplist storage store syn keyword sqlKeyword strip stripesizekb striping subpages subscribe subscription syn keyword sqlKeyword subtransaction suser_id suser_name suspend synchronization syn keyword sqlKeyword syntax_error table tables tablock syn keyword sqlKeyword tablockx target tb temp template temporary term then ties syn keyword sqlKeyword timezone timeout tls to to_char to_nchar tolerance top syn keyword sqlKeyword trace traced_plan tracing syn keyword sqlKeyword transfer transform transaction transactional treat tries syn keyword sqlKeyword true try tsequal type tune uncommitted unconditionally syn keyword sqlKeyword unenforced unicode unique unistr unit unknown unlimited unload syn keyword sqlKeyword unpartition unquiesce updatetime updating updlock upgrade upload syn keyword sqlKeyword upper usage use user syn keyword sqlKeyword using utc utilities validproc syn keyword sqlKeyword value values varchar variable syn keyword sqlKeyword varying var_pop var_samp vcat verbosity syn keyword sqlKeyword verify versions view virtual wait syn keyword sqlKeyword warning wd web when where with with_auto syn keyword sqlKeyword with_auto with_cube with_rollup without syn keyword sqlKeyword with_lparen within word work workload write writefile syn keyword sqlKeyword writeclientfile writer writers writeserver xlock syn keyword sqlKeyword war xml zeros zone " XML syn keyword sqlKeyword raw auto elements explicit " HTTP support syn keyword sqlKeyword authorization secure url service next_soap_header " HTTP 9.0.2 new procedure keywords syn keyword sqlKeyword namespace certificate certificates clientport proxy trusted_certificates_file " OLAP support 9.0.0 syn keyword sqlKeyword covar_pop covar_samp corr regr_slope regr_intercept syn keyword sqlKeyword regr_count regr_r2 regr_avgx regr_avgy syn keyword sqlKeyword regr_sxx regr_syy regr_sxy " Alternate keywords syn keyword sqlKeyword character dec options proc reference syn keyword sqlKeyword subtrans tran syn keyword " Login Mode Options syn keyword sqlKeywordLogin standard integrated kerberos LDAPUA syn keyword sqlKeywordLogin cloudadmin mixed " Spatial Predicates syn keyword sqlKeyword ST_Contains syn keyword sqlKeyword ST_ContainsFilter syn keyword sqlKeyword ST_CoveredBy syn keyword sqlKeyword ST_CoveredByFilter syn keyword sqlKeyword ST_Covers syn keyword sqlKeyword ST_CoversFilter syn keyword sqlKeyword ST_Crosses syn keyword sqlKeyword ST_Disjoint syn keyword sqlKeyword ST_Equals syn keyword sqlKeyword ST_EqualsFilter syn keyword sqlKeyword ST_Intersects syn keyword sqlKeyword ST_IntersectsFilter syn keyword sqlKeyword ST_IntersectsRect syn keyword sqlKeyword ST_OrderingEquals syn keyword sqlKeyword ST_Overlaps syn keyword sqlKeyword ST_Relate syn keyword sqlKeyword ST_Touches syn keyword sqlKeyword ST_Within syn keyword sqlKeyword ST_WithinFilter " Spatial Set operations syn keyword sqlKeyword ST_Affine syn keyword sqlKeyword ST_Boundary syn keyword sqlKeyword ST_Buffer syn keyword sqlKeyword ST_ConvexHull syn keyword sqlKeyword ST_ConvexHullAggr syn keyword sqlKeyword ST_Difference syn keyword sqlKeyword ST_Intersection syn keyword sqlKeyword ST_IntersectionAggr syn keyword sqlKeyword ST_SymDifference syn keyword sqlKeyword ST_Union syn keyword sqlKeyword ST_UnionAggr " Spatial Bounds syn keyword sqlKeyword ST_Envelope syn keyword sqlKeyword ST_EnvelopeAggr syn keyword sqlKeyword ST_Lat syn keyword sqlKeyword ST_LatMax syn keyword sqlKeyword ST_LatMin syn keyword sqlKeyword ST_Long syn keyword sqlKeyword ST_LongMax syn keyword sqlKeyword ST_LongMin syn keyword sqlKeyword ST_M syn keyword sqlKeyword ST_MMax syn keyword sqlKeyword ST_MMin syn keyword sqlKeyword ST_Point syn keyword sqlKeyword ST_X syn keyword sqlKeyword ST_XMax syn keyword sqlKeyword ST_XMin syn keyword sqlKeyword ST_Y syn keyword sqlKeyword ST_YMax syn keyword sqlKeyword ST_YMin syn keyword sqlKeyword ST_Z syn keyword sqlKeyword ST_ZMax syn keyword sqlKeyword ST_ZMin " Spatial Collection Aggregates syn keyword sqlKeyword ST_GeomCollectionAggr syn keyword sqlKeyword ST_LineStringAggr syn keyword sqlKeyword ST_MultiCurveAggr syn keyword sqlKeyword ST_MultiLineStringAggr syn keyword sqlKeyword ST_MultiPointAggr syn keyword sqlKeyword ST_MultiPolygonAggr syn keyword sqlKeyword ST_MultiSurfaceAggr syn keyword sqlKeyword ST_Perimeter syn keyword sqlKeyword ST_PointOnSurface " Spatial SRS syn keyword sqlKeyword ST_CompareWKT syn keyword sqlKeyword ST_FormatWKT syn keyword sqlKeyword ST_ParseWKT syn keyword sqlKeyword ST_TransformGeom syn keyword sqlKeyword ST_GeometryTypeFromBaseType syn keyword sqlKeyword ST_SnapToGrid syn keyword sqlKeyword ST_Transform syn keyword sqlKeyword ST_SRID syn keyword sqlKeyword ST_SRIDFromBaseType syn keyword sqlKeyword ST_LoadConfigurationData " Spatial Indexes syn keyword sqlKeyword ST_LinearHash syn keyword sqlKeyword ST_LinearUnHash syn keyword sqlOperator in any some all between exists syn keyword sqlOperator like escape not is and or syn keyword sqlOperator minus syn keyword sqlOperator prior distinct unnest syn keyword sqlStatement allocate alter attach backup begin break call case catch syn keyword sqlStatement checkpoint clear close comment commit configure connect syn keyword sqlStatement continue create deallocate declare delete describe syn keyword sqlStatement detach disconnect drop except execute exit explain fetch syn keyword sqlStatement for forward from get goto grant help if include syn keyword sqlStatement input insert install intersect leave load lock loop syn keyword sqlStatement message open output parameters passthrough syn keyword sqlStatement prepare print put raiserror read readtext refresh release syn keyword sqlStatement remote remove reorganize resignal restore resume syn keyword sqlStatement return revoke rollback save savepoint select syn keyword sqlStatement set setuser signal start stop synchronize syn keyword sqlStatement system trigger truncate try union unload update syn keyword sqlStatement validate waitfor whenever while window writetext syn keyword sqlType char nchar long varchar nvarchar text ntext uniqueidentifierstr xml syn keyword sqlType bigint bit decimal double varbit syn keyword sqlType float int integer numeric syn keyword sqlType smallint tinyint real syn keyword sqlType money smallmoney syn keyword sqlType date datetime datetimeoffset smalldatetime time timestamp syn keyword sqlType binary image varray varbinary uniqueidentifier syn keyword sqlType unsigned " Spatial types syn keyword sqlType st_geometry st_point st_curve st_surface st_geomcollection syn keyword sqlType st_linestring st_circularstring st_compoundcurve syn keyword sqlType st_curvepolygon st_polygon syn keyword sqlType st_multipoint st_multicurve st_multisurface syn keyword sqlType st_multilinestring st_multipolygon syn keyword sqlOption Allow_nulls_by_default syn keyword sqlOption Allow_read_client_file syn keyword sqlOption Allow_snapshot_isolation syn keyword sqlOption Allow_write_client_file syn keyword sqlOption Ansi_blanks syn keyword sqlOption Ansi_close_cursors_on_rollback syn keyword sqlOption Ansi_permissions syn keyword sqlOption Ansi_substring syn keyword sqlOption Ansi_update_constraints syn keyword sqlOption Ansinull syn keyword sqlOption Auditing syn keyword sqlOption Auditing_options syn keyword sqlOption Auto_commit_on_create_local_temp_index syn keyword sqlOption Background_priority syn keyword sqlOption Blocking syn keyword sqlOption Blocking_others_timeout syn keyword sqlOption Blocking_timeout syn keyword sqlOption Chained syn keyword sqlOption Checkpoint_time syn keyword sqlOption Cis_option syn keyword sqlOption Cis_rowset_size syn keyword sqlOption Close_on_endtrans syn keyword sqlOption Collect_statistics_on_dml_updates syn keyword sqlOption Conn_auditing syn keyword sqlOption Connection_authentication syn keyword sqlOption Continue_after_raiserror syn keyword sqlOption Conversion_error syn keyword sqlOption Cooperative_commit_timeout syn keyword sqlOption Cooperative_commits syn keyword sqlOption Database_authentication syn keyword sqlOption Date_format syn keyword sqlOption Date_order syn keyword sqlOption db_publisher syn keyword sqlOption Debug_messages syn keyword sqlOption Dedicated_task syn keyword sqlOption Default_dbspace syn keyword sqlOption Default_timestamp_increment syn keyword sqlOption Delayed_commit_timeout syn keyword sqlOption Delayed_commits syn keyword sqlOption Divide_by_zero_error syn keyword sqlOption Escape_character syn keyword sqlOption Exclude_operators syn keyword sqlOption Extended_join_syntax syn keyword sqlOption Extern_login_credentials syn keyword sqlOption Fire_triggers syn keyword sqlOption First_day_of_week syn keyword sqlOption For_xml_null_treatment syn keyword sqlOption Force_view_creation syn keyword sqlOption Global_database_id syn keyword sqlOption Http_session_timeout syn keyword sqlOption Http_connection_pool_basesize syn keyword sqlOption Http_connection_pool_timeout syn keyword sqlOption Integrated_server_name syn keyword sqlOption Isolation_level syn keyword sqlOption Java_class_path syn keyword sqlOption Java_location syn keyword sqlOption Java_main_userid syn keyword sqlOption Java_vm_options syn keyword sqlOption Lock_rejected_rows syn keyword sqlOption Log_deadlocks syn keyword sqlOption Login_mode syn keyword sqlOption Login_procedure syn keyword sqlOption Materialized_view_optimization syn keyword sqlOption Max_client_statements_cached syn keyword sqlOption Max_cursor_count syn keyword sqlOption Max_hash_size syn keyword sqlOption Max_plans_cached syn keyword sqlOption Max_priority syn keyword sqlOption Max_query_tasks syn keyword sqlOption Max_recursive_iterations syn keyword sqlOption Max_statement_count syn keyword sqlOption Max_temp_space syn keyword sqlOption Min_password_length syn keyword sqlOption Min_role_admins syn keyword sqlOption Nearest_century syn keyword sqlOption Non_keywords syn keyword sqlOption Odbc_describe_binary_as_varbinary syn keyword sqlOption Odbc_distinguish_char_and_varchar syn keyword sqlOption Oem_string syn keyword sqlOption On_charset_conversion_failure syn keyword sqlOption On_tsql_error syn keyword sqlOption Optimization_goal syn keyword sqlOption Optimization_level syn keyword sqlOption Optimization_workload syn keyword sqlOption Pinned_cursor_percent_of_cache syn keyword sqlOption Post_login_procedure syn keyword sqlOption Precision syn keyword sqlOption Prefetch syn keyword sqlOption Preserve_source_format syn keyword sqlOption Prevent_article_pkey_update syn keyword sqlOption Priority syn keyword sqlOption Progress_messages syn keyword sqlOption Query_mem_timeout syn keyword sqlOption Quoted_identifier syn keyword sqlOption Read_past_deleted syn keyword sqlOption Recovery_time syn keyword sqlOption Remote_idle_timeout syn keyword sqlOption Replicate_all syn keyword sqlOption Request_timeout syn keyword sqlOption Reserved_keywords syn keyword sqlOption Return_date_time_as_string syn keyword sqlOption Rollback_on_deadlock syn keyword sqlOption Row_counts syn keyword sqlOption Scale syn keyword sqlOption Secure_feature_key syn keyword sqlOption Sort_collation syn keyword sqlOption Sql_flagger_error_level syn keyword sqlOption Sql_flagger_warning_level syn keyword sqlOption String_rtruncation syn keyword sqlOption st_geometry_asbinary_format syn keyword sqlOption st_geometry_astext_format syn keyword sqlOption st_geometry_asxml_format syn keyword sqlOption st_geometry_describe_type syn keyword sqlOption st_geometry_interpolation syn keyword sqlOption st_geometry_on_invalid syn keyword sqlOption Subsume_row_locks syn keyword sqlOption Suppress_tds_debugging syn keyword sqlOption Synchronize_mirror_on_commit syn keyword sqlOption Tds_empty_string_is_null syn keyword sqlOption Temp_space_limit_check syn keyword sqlOption Time_format syn keyword sqlOption Time_zone_adjustment syn keyword sqlOption Timestamp_format syn keyword sqlOption Timestamp_with_time_zone_format syn keyword sqlOption Truncate_timestamp_values syn keyword sqlOption Tsql_outer_joins syn keyword sqlOption Tsql_variables syn keyword sqlOption Updatable_statement_isolation syn keyword sqlOption Update_statistics syn keyword sqlOption Upgrade_database_capability syn keyword sqlOption User_estimates syn keyword sqlOption Uuid_has_hyphens syn keyword sqlOption Verify_password_function syn keyword sqlOption Wait_for_commit syn keyword sqlOption Webservice_namespace_host syn keyword sqlOption Webservice_sessionid_name " Strings and characters: syn region sqlString start=+"+ end=+"+ contains=@Spell syn region sqlString start=+'+ end=+'+ contains=@Spell " Numbers: syn match sqlNumber "-\=\<\d*\.\=[0-9_]\>" " Comments: syn region sqlDashComment start=/--/ end=/$/ contains=@Spell syn region sqlSlashComment start=/\/\// end=/$/ contains=@Spell syn region sqlMultiComment start="/\*" end="\*/" contains=sqlMultiComment,@Spell syn cluster sqlComment contains=sqlDashComment,sqlSlashComment,sqlMultiComment,@Spell syn sync ccomment sqlComment syn sync ccomment sqlDashComment syn sync ccomment sqlSlashComment hi def link sqlDashComment Comment hi def link sqlSlashComment Comment hi def link sqlMultiComment Comment hi def link sqlNumber Number hi def link sqlOperator Operator hi def link sqlSpecial Special hi def link sqlKeyword Keyword hi def link sqlStatement Statement hi def link sqlString String hi def link sqlType Type hi def link sqlFunction Function hi def link sqlOption PreProc let b:current_syntax = "sqlanywhere" " vim:sw=4: vim-7.4.1689/runtime/syntax/sqlforms.vim000066400000000000000000000157401267703067000202000ustar00rootroot00000000000000" 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/sqlhana.vim000066400000000000000000000255641267703067000177660ustar00rootroot00000000000000" Vim syntax file " Language: SQL, SAP HANA In Memory Database " Maintainer: David Fishburn " Last Change: 2012 Oct 23 " Version: SP4 b (Q2 2012) " Homepage: http://www.vim.org/scripts/script.php?script_id=4275 " Description: Updated to SAP HANA SP4 " " For version 5.x: Clear all syntax items " 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. " These were pulled from the following SQL reference: " http://help.sap.com/hana/hana_sql_en.pdf " An easy approach is to copy all text from the PDF " into a Vim buffer. The keywords are in UPPER case, " so you can run the following commands to be left with " mainly the UPPER case words: " 1. Delete all words that do not begin with a Capital " %s/\(\<[^A-Z]\w*\>\)//g " 2. Remove all words where the 2nd letter is not a Capital " %s/\(\<[A-Z][^A-Z]\w*\>\)//g " 3. Remove all non-word (or space) characters " %s/[^0-9A-Za-z_ ]*//g " 4. Remove some known words " %s/\<\(SAP\|HANA\|OK\|AG\|IBM\|DB2\|AIX\|POWER\d\+\|UNIX\)\>//g " 5. Remove blank lines and trailing spaces " %s/\s\+$//g " %s/^\s\+//g " %s/^$\n//g " 6. Convert spaces to newlines remove single character " %s/[ ]\+/\r/g " %g/^\w$/d " 7. Sort and remove duplicates " :sort " :Uniq " 8. Use the WhatsMissing plugin against the sqlhana.vim file. " 9. Generated a file of all UPPER cased words which should not " be in the syntax file. These items should be removed " from the list in step 7. You can use WhatsNotMissing " between step 7 and this new file to weed out the words " we know are not syntax related. " 10. Use the WhatsMissingRemoveMatches to remove the words " from step 9. syn keyword sqlSpecial false null true " Supported Functions for Date/Time types syn keyword sqlFunction ADD_DAYS ADD_MONTHS ADD_SECONDS ADD_YEARS COALESCE syn keyword sqlFunction CURRENT_DATE CURRENT_TIME CURRENT_TIMESTAMP CURRENT_UTCDATE syn keyword sqlFunction CURRENT_UTCTIME CURRENT_UTCTIMESTAMP syn keyword sqlFunction DAYNAME DAYOFMONTH DAYOFYEAR DAYS_BETWEEN EXTRACT syn keyword sqlFunction GREATEST HOUR IFNULL ISOWEEK LAST_DAY LEAST LOCALTOUTC syn keyword sqlFunction MINUTE MONTH MONTHNAME NEXT_DAY NOW QUARTER SECOND syn keyword sqlFunction SECONDS_BETWEEN UTCTOLOCAL WEEK WEEKDAY YEAR syn keyword sqlFunction TO_CHAR TO_DATE TO_DATS TO_NCHAR TO_TIME TO_TIMESTAMP UTCTOLOCAL " Aggregate syn keyword sqlFunction COUNT MIN MAX SUM AVG STDDEV VAR " Datatype conversion syn keyword sqlFunction CAST TO_ALPHANUM TO_BIGINT TO_BINARY TO_BLOB TO_CHAR TO_CLOB syn keyword sqlFunction TO_DATE TO_DATS TO_DECIMAL TO_DOUBLE TO_INT TO_INTEGER TO_NCHAR syn keyword sqlFunction TO_NCLOB TO_NVARCHAR TO_REAL TO_SECONDDATE TO_SMALLDECIMAL syn keyword sqlFunction TO_SMALLINT TO_TIME TO_TIMESTAMP TO_TINYINT TO_VARCHAR TO_VARBINARY " Number functions syn keyword sqlFunction ABS ACOS ASIN ATAN ATAN2 BINTOHEX BITAND CEIL COS COSH COT syn keyword sqlFunction EXP FLOOR GREATEST HEXTOBIN LEAST LN LOG MOD POWER ROUND syn keyword sqlFunction SIGN SIN SINH SQRT TAN TANH UMINUS " String functions syn keyword sqlFunction ASCII CHAR CONCAT LCASE LENGTH LOCATE LOWER LPAD LTRIM syn keyword sqlFunction NCHAR REPLACE RPAD RTRIM SUBSTR_AFTER SUBSTR_BEFORE syn keyword sqlFunction SUBSTRING TRIM UCASE UNICODE UPPER " Miscellaneous functions syn keyword sqlFunction COALESCE CURRENT_CONNECTION CURRENT_SCHEMA CURRENT_USER syn keyword sqlFunction GROUPING_ID IFNULL MAP NULLIF SESSION_CONTEXT SESSION_USER SYSUUIDSQL syn keyword sqlFunction GET_NUM_SERVERS " sp_ procedures " syn keyword sqlFunction sp_addalias " Reserved keywords syn keyword sqlkeyword ALL AS AT BEFORE syn keyword sqlkeyword BEGIN BOTH BY syn keyword sqlkeyword CONDITION syn keyword sqlkeyword CURRVAL CURSOR DECLARE syn keyword sqlkeyword DISTINCT DO ELSE ELSEIF ELSIF syn keyword sqlkeyword END EXCEPTION EXEC syn keyword sqlkeyword FOR FROM GROUP syn keyword sqlkeyword HAVING IN syn keyword sqlkeyword INOUT INTO IS syn keyword sqlkeyword LEADING syn keyword sqlkeyword LOOP MINUS NATURAL NEXTVAL syn keyword sqlkeyword OF ON ORDER OUT syn keyword sqlkeyword PRIOR RETURN RETURNS REVERSE syn keyword sqlkeyword ROWID SELECT syn keyword sqlkeyword SQL START STOP SYSDATE syn keyword sqlkeyword SYSTIME SYSTIMESTAMP SYSUUID syn keyword sqlkeyword TRAILING USING UTCDATE syn keyword sqlkeyword UTCTIME UTCTIMESTAMP VALUES syn keyword sqlkeyword WHILE syn keyword sqlkeyword ANY SOME EXISTS ESCAPE " IF keywords syn keyword sqlkeyword IF " CASE keywords syn keyword sqlKeyword WHEN THEN " Syntax rules common to TEXT and SHORTTEXT keywords syn keyword sqlKeyword LANGUAGE DETECTION LINGUISTIC syn keyword sqlkeyword MIME TYPE syn keyword sqlkeyword EXACT WEIGHT FUZZY FUZZINESSTHRESHOLD SEARCH syn keyword sqlkeyword PHRASE INDEX RATIO REBUILD syn keyword sqlkeyword CONFIGURATION syn keyword sqlkeyword SEARCH ONLY syn keyword sqlkeyword FAST PREPROCESS syn keyword sqlkeyword SYNC SYNCHRONOUS ASYNC ASYNCHRONOUS FLUSH QUEUE syn keyword sqlkeyword EVERY AFTER MINUTES DOCUMENTS SUSPEND " Statement keywords (i.e. after ALTER or CREATE) syn keyword sqlkeyword AUDIT POLICY syn keyword sqlkeyword FULLTEXT syn keyword sqlkeyword SEQUENCE RESTART syn keyword sqlkeyword TABLE syn keyword sqlkeyword PROCEDURE STATISTICS syn keyword sqlkeyword SCHEMA syn keyword sqlkeyword SYNONYM syn keyword sqlkeyword VIEW syn keyword sqlkeyword COLUMN syn keyword sqlkeyword SYSTEM LICENSE syn keyword sqlkeyword SESSION syn keyword sqlkeyword CANCEL WORK syn keyword sqlkeyword PLAN CACHE syn keyword sqlkeyword LOGGING NOLOGGING RETENTION syn keyword sqlkeyword RECONFIGURE SERVICE syn keyword sqlkeyword RESET MONITORING syn keyword sqlkeyword SAVE DURATION PERFTRACE FUNCTION_PROFILER syn keyword sqlkeyword SAVEPOINT syn keyword sqlkeyword USER syn keyword sqlkeyword ROLE syn keyword sqlkeyword ASC DESC syn keyword sqlkeyword OWNED syn keyword sqlkeyword DEPENDENCIES SCRAMBLE " Create sequence syn keyword sqlkeyword INCREMENT MAXVALUE MINVALUE CYCLE " Create table syn keyword sqlkeyword HISTORY GLOBAL LOCAL TEMPORARY " Create trigger syn keyword sqlkeyword TRIGGER REFERENCING EACH DEFAULT syn keyword sqlkeyword SIGNAL RESIGNAL MESSAGE_TEXT OLD NEW syn keyword sqlkeyword EXIT HANDLER SQL_ERROR_CODE syn keyword sqlkeyword TARGET CONDITION SIGNAL " Alter table syn keyword sqlkeyword ADD DROP MODIFY GENERATED ALWAYS syn keyword sqlkeyword UNIQUE BTREE CPBTREE PRIMARY KEY syn keyword sqlkeyword CONSTRAINT PRELOAD NONE syn keyword sqlkeyword ROW THREADS BATCH syn keyword sqlkeyword MOVE PARTITION TO LOCATION PHYSICAL OTHERS syn keyword sqlkeyword ROUNDROBIN PARTITIONS HASH RANGE VALUE syn keyword sqlkeyword PERSISTENT DELTA AUTO AUTOMERGE " Create audit policy syn keyword sqlkeyword AUDITING SUCCESSFUL UNSUCCESSFUL syn keyword sqlkeyword PRIVILEGE STRUCTURED CHANGE LEVEL syn keyword sqlkeyword EMERGENCY ALERT CRITICAL WARNING INFO " Privileges syn keyword sqlkeyword DEBUG EXECUTE " Schema syn keyword sqlkeyword CASCADE RESTRICT PARAMETERS SCAN " Traces syn keyword sqlkeyword CLIENT CRASHDUMP EMERGENCYDUMP syn keyword sqlkeyword INDEXSERVER NAMESERVER DAEMON syn keyword sqlkeyword CLEAR REMOVE TRACES " Reclaim syn keyword sqlkeyword RECLAIM DATA VOLUME VERSION SPACE DEFRAGMENT SPARSIFY " Join syn keyword sqlkeyword INNER OUTER LEFT RIGHT FULL CROSS JOIN syn keyword sqlkeyword GROUPING SETS ROLLUP CUBE syn keyword sqlkeyword BEST LIMIT OFFSET syn keyword sqlkeyword WITH SUBTOTAL BALANCE TOTAL syn keyword sqlkeyword TEXT_FILTER FILL UP SORT MATCHES TOP syn keyword sqlkeyword RESULT OVERVIEW PREFIX MULTIPLE RESULTSETS " Lock syn keyword sqlkeyword EXCLUSIVE MODE NOWAIT " Transaction syn keyword sqlkeyword TRANSACTION ISOLATION READ COMMITTED syn keyword sqlkeyword REPEATABLE SERIALIZABLE WRITE " Saml syn keyword sqlkeyword SAML ASSERTION PROVIDER SUBJECT ISSUER " User syn keyword sqlkeyword PASSWORD IDENTIFIED EXTERNALLY ATTEMPTS ATTEMPTS syn keyword sqlkeyword ENABLE DISABLE OFF LIFETIME FORCE DEACTIVATE syn keyword sqlkeyword ACTIVATE IDENTITY KERBEROS " Grant syn keyword sqlkeyword ADMIN BACKUP CATALOG SCENARIO INIFILE MONITOR syn keyword sqlkeyword OPTIMIZER OPTION syn keyword sqlkeyword RESOURCE STRUCTUREDPRIVILEGE TRACE " Import syn keyword sqlkeyword CSV FILE CONTROL NO CHECK SKIP FIRST LIST syn keyword sqlkeyword RECORD DELIMITED FIELD OPTIONALLY ENCLOSED FORMAT " Roles syn keyword sqlkeyword PUBLIC CONTENT_ADMIN MODELING MONITORING " Miscellaneous syn keyword sqlkeyword APPLICATION BINARY IMMEDIATE COREFILE SECURITY DEFINER syn keyword sqlkeyword DUMMY INVOKER MATERIALIZED MESSEGE_TEXT PARAMETER PARAMETERS syn keyword sqlkeyword PART syn keyword sqlkeyword CONSTANT SQLEXCEPTION SQLWARNING syn keyword sqlOperator WHERE BETWEEN LIKE NULL CONTAINS syn keyword sqlOperator AND OR NOT CASE syn keyword sqlOperator UNION INTERSECT EXCEPT syn keyword sqlStatement ALTER CALL CALLS CREATE DROP RENAME TRUNCATE syn keyword sqlStatement DELETE INSERT UPDATE EXPLAIN syn keyword sqlStatement MERGE REPLACE UPSERT SELECT syn keyword sqlStatement SET UNSET LOAD UNLOAD syn keyword sqlStatement CONNECT DISCONNECT COMMIT LOCK ROLLBACK syn keyword sqlStatement GRANT REVOKE syn keyword sqlStatement EXPORT IMPORT syn keyword sqlType DATE TIME SECONDDATE TIMESTAMP TINYINT SMALLINT syn keyword sqlType INT INTEGER BIGINT SMALLDECIMAL DECIMAL syn keyword sqlType REAL DOUBLE FLOAT syn keyword sqlType VARCHAR NVARCHAR ALPHANUM SHORTTEXT VARBINARY syn keyword sqlType BLOB CLOB NCLOB TEXT DAYDATE syn keyword sqlOption Webservice_namespace_host " Strings and characters: syn region sqlString start=+"+ end=+"+ contains=@Spell syn region sqlString start=+'+ end=+'+ contains=@Spell " Numbers: syn match sqlNumber "-\=\<\d*\.\=[0-9_]\>" " Comments: syn region sqlDashComment start=/--/ end=/$/ contains=@Spell syn region sqlSlashComment start=/\/\// end=/$/ contains=@Spell syn region sqlMultiComment start="/\*" end="\*/" contains=sqlMultiComment,@Spell syn cluster sqlComment contains=sqlDashComment,sqlSlashComment,sqlMultiComment,@Spell syn sync ccomment sqlComment syn sync ccomment sqlDashComment syn sync ccomment sqlSlashComment hi def link sqlDashComment Comment hi def link sqlSlashComment Comment hi def link sqlMultiComment Comment hi def link sqlNumber Number hi def link sqlOperator Operator hi def link sqlSpecial Special hi def link sqlKeyword Keyword hi def link sqlStatement Statement hi def link sqlString String hi def link sqlType Type hi def link sqlFunction Function hi def link sqlOption PreProc let b:current_syntax = "sqlhana" " vim:sw=4: vim-7.4.1689/runtime/syntax/sqlinformix.vim000066400000000000000000000142141267703067000207000ustar00rootroot00000000000000" Vim syntax file " Informix Structured Query Language (SQL) and Stored Procedure Language (SPL) " Language: SQL, SPL (Informix Dynamic Server 2000 v9.2) " Maintainer: Dean Hill " Last Change: 2004 Aug 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 " === Comment syntax group === syn region sqlComment start="{" end="}" contains=sqlTodo syn match sqlComment "--.*$" contains=sqlTodo syn sync ccomment sqlComment " === Constant syntax group === " = Boolean subgroup = syn keyword sqlBoolean true false syn keyword sqlBoolean null syn keyword sqlBoolean public user syn keyword sqlBoolean current today syn keyword sqlBoolean year month day hour minute second fraction " = String subgroup = syn region sqlString start=+"+ end=+"+ syn region sqlString start=+'+ end=+'+ " = Numbers subgroup = syn match sqlNumber "-\=\<\d*\.\=[0-9_]\>" " === Statement syntax group === " SQL syn keyword sqlStatement allocate alter syn keyword sqlStatement begin syn keyword sqlStatement close commit connect create syn keyword sqlStatement database deallocate declare delete describe disconnect drop syn keyword sqlStatement execute fetch flush free get grant info insert syn keyword sqlStatement load lock open output syn keyword sqlStatement prepare put syn keyword sqlStatement rename revoke rollback select set start stop syn keyword sqlStatement truncate unload unlock update syn keyword sqlStatement whenever " SPL syn keyword sqlStatement call continue define syn keyword sqlStatement exit syn keyword sqlStatement let syn keyword sqlStatement return system trace " = Conditional subgroup = " SPL syn keyword sqlConditional elif else if then syn keyword sqlConditional case " Highlight "end if" with one or more separating spaces syn match sqlConditional "end \+if" " = Repeat subgroup = " SQL/SPL " Handle SQL triggers' "for each row" clause and SPL "for" loop syn match sqlRepeat "for\( \+each \+row\)\=" " SPL syn keyword sqlRepeat foreach while " Highlight "end for", etc. with one or more separating spaces syn match sqlRepeat "end \+for" syn match sqlRepeat "end \+foreach" syn match sqlRepeat "end \+while" " = Exception subgroup = " SPL syn match sqlException "on \+exception" syn match sqlException "end \+exception" syn match sqlException "end \+exception \+with \+resume" syn match sqlException "raise \+exception" " = Keyword subgroup = " SQL syn keyword sqlKeyword aggregate add as authorization autofree by syn keyword sqlKeyword cache cascade check cluster collation syn keyword sqlKeyword column connection constraint cross syn keyword sqlKeyword dataskip debug default deferred_prepare syn keyword sqlKeyword descriptor diagnostics syn keyword sqlKeyword each escape explain external syn keyword sqlKeyword file foreign fragment from function syn keyword sqlKeyword group having syn keyword sqlKeyword immediate index inner into isolation syn keyword sqlKeyword join key syn keyword sqlKeyword left level log syn keyword sqlKeyword mode modify mounting new no syn keyword sqlKeyword object of old optical option syn keyword sqlKeyword optimization order outer syn keyword sqlKeyword pdqpriority pload primary procedure syn keyword sqlKeyword references referencing release reserve syn keyword sqlKeyword residency right role routine row syn keyword sqlKeyword schedule schema scratch session set syn keyword sqlKeyword statement statistics synonym syn keyword sqlKeyword table temp temporary timeout to transaction trigger syn keyword sqlKeyword using values view violations syn keyword sqlKeyword where with work " Highlight "on" (if it's not followed by some words we've already handled) syn match sqlKeyword "on \+\(exception\)\@!" " SPL " Highlight "end" (if it's not followed by some words we've already handled) syn match sqlKeyword "end \+\(if\|for\|foreach\|while\|exception\)\@!" syn keyword sqlKeyword resume returning " = Operator subgroup = " SQL syn keyword sqlOperator not and or syn keyword sqlOperator in is any some all between exists syn keyword sqlOperator like matches syn keyword sqlOperator union intersect syn keyword sqlOperator distinct unique " === Identifier syntax group === " = Function subgroup = " SQL syn keyword sqlFunction abs acos asin atan atan2 avg syn keyword sqlFunction cardinality cast char_length character_length cos count syn keyword sqlFunction exp filetoblob filetoclob hex syn keyword sqlFunction initcap length logn log10 lower lpad syn keyword sqlFunction min max mod octet_length pow range replace root round rpad syn keyword sqlFunction sin sqrt stdev substr substring sum syn keyword sqlFunction to_char tan to_date trim trunc upper variance " === Type syntax group === " SQL syn keyword sqlType blob boolean byte char character clob syn keyword sqlType date datetime dec decimal double syn keyword sqlType float int int8 integer interval list lvarchar syn keyword sqlType money multiset nchar numeric nvarchar syn keyword sqlType real serial serial8 smallfloat smallint syn keyword sqlType text varchar varying " === Todo syntax group === 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 else command -nargs=+ HiLink hi def link endif " === Comment syntax group === HiLink sqlComment Comment " === Constant syntax group === HiLink sqlNumber Number HiLink sqlBoolean Boolean HiLink sqlString String " === Statment syntax group === HiLink sqlStatement Statement HiLink sqlConditional Conditional HiLink sqlRepeat Repeat HiLink sqlKeyword Keyword HiLink sqlOperator Operator HiLink sqlException Exception " === Identifier syntax group === HiLink sqlFunction Function " === Type syntax group === HiLink sqlType Type " === Todo syntax group === HiLink sqlTodo Todo delcommand HiLink endif let b:current_syntax = "sqlinformix" vim-7.4.1689/runtime/syntax/sqlj.vim000066400000000000000000000062201267703067000172740ustar00rootroot00000000000000" Vim syntax file " Language: sqlj " Maintainer: Andreas Fischbach " 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 :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 else command! -nargs=+ HiLink hi def link 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 delcommand HiLink endif let b:current_syntax = "sqlj" vim-7.4.1689/runtime/syntax/sqloracle.vim000066400000000000000000000147641267703067000203240ustar00rootroot00000000000000" Vim syntax file " Language: SQL, PL/SQL (Oracle 11g) " Maintainer: Christian Brabandt " Repository: https://github.com/chrisbra/vim-sqloracle-syntax " License: Vim " Previous Maintainer: Paul Moore " Last Change: 2015 Nov 24 if 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 case check cluster column syn keyword sqlKeyword cache 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 initrans into is level link logging loop syn keyword sqlKeyword maxextents maxtrans mode modify monitoring syn keyword sqlKeyword nocache nocompress nologging noparallel nowait of offline on online start syn keyword sqlKeyword parallel successful synonym table tablespace then to trigger uid syn keyword sqlKeyword unique user validate values view whenever syn keyword sqlKeyword where with option order pctfree pctused 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 analyze audit comment commit syn keyword sqlStatement delete drop execute explain grant lock noaudit syn keyword sqlStatement rename revoke rollback savepoint set syn keyword sqlStatement truncate " next ones are contained, so folding works. syn keyword sqlStatement create update alter select insert contained syn keyword sqlType boolean char character date float integer long syn keyword sqlType mlslabel number raw rowid varchar varchar2 varray " Strings: 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,@Spell fold syn match sqlComment "--.*$" contains=sqlTodo,@Spell " Setup Folding: " this is a hack, to get certain statements folded. " the keywords create/update/alter/select/insert need to " have contained option. syn region sqlFold start='^\s*\zs\c\(Create\|Update\|Alter\|Select\|Insert\)' end=';$\|^$' transparent fold contains=ALL syn sync ccomment sqlComment " Functions: " (Oracle 11g) " Aggregate Functions syn keyword sqlFunction avg collect corr corr_s corr_k count covar_pop covar_samp cume_dist dense_rank first syn keyword sqlFunction group_id grouping grouping_id last max median min percentile_cont percentile_disc percent_rank rank syn keyword sqlFunction regr_slope regr_intercept regr_count regr_r2 regr_avgx regr_avgy regr_sxx regr_syy regr_sxy syn keyword sqlFunction stats_binomial_test stats_crosstab stats_f_test stats_ks_test stats_mode stats_mw_test syn keyword sqlFunction stats_one_way_anova stats_t_test_one stats_t_test_paired stats_t_test_indep stats_t_test_indepu syn keyword sqlFunction stats_wsr_test stddev stddev_pop stddev_samp sum syn keyword sqlFunction sys_xmlagg var_pop var_samp variance xmlagg " Char Functions syn keyword sqlFunction ascii chr concat initcap instr length lower lpad ltrim syn keyword sqlFunction nls_initcap nls_lower nlssort nls_upper regexp_instr regexp_replace syn keyword sqlFunction regexp_substr replace rpad rtrim soundex substr translate treat trim upper " Comparison Functions syn keyword sqlFunction greatest least " Conversion Functions syn keyword sqlFunction asciistr bin_to_num cast chartorowid compose convert syn keyword sqlFunction decompose hextoraw numtodsinterval numtoyminterval rawtohex rawtonhex rowidtochar syn keyword sqlFunction rowidtonchar scn_to_timestamp timestamp_to_scn to_binary_double to_binary_float syn keyword sqlFunction to_char to_char to_char to_clob to_date to_dsinterval to_lob to_multi_byte syn keyword sqlFunction to_nchar to_nchar to_nchar to_nclob to_number to_dsinterval to_single_byte syn keyword sqlFunction to_timestamp to_timestamp_tz to_yminterval to_yminterval translate unistr " DataMining Functions syn keyword sqlFunction cluster_id cluster_probability cluster_set feature_id feature_set syn keyword sqlFunction feature_value prediction prediction_bounds prediction_cost syn keyword sqlFunction prediction_details prediction_probability prediction_set " Datetime Functions syn keyword sqlFunction add_months current_date current_timestamp dbtimezone extract syn keyword sqlFunction from_tz last_day localtimestamp months_between new_time syn keyword sqlFunction next_day numtodsinterval numtoyminterval round sessiontimezone syn keyword sqlFunction sys_extract_utc sysdate systimestamp to_char to_timestamp syn keyword sqlFunction to_timestamp_tz to_dsinterval to_yminterval trunc tz_offset " Numeric Functions syn keyword sqlFunction abs acos asin atan atan2 bitand ceil cos cosh exp syn keyword sqlFunction floor ln log mod nanvl power remainder round sign syn keyword sqlFunction sin sinh sqrt tan tanh trunc width_bucket " NLS Functions syn keyword sqlFunction ls_charset_decl_len nls_charset_id nls_charset_name " Various Functions syn keyword sqlFunction bfilename cardin coalesce collect decode dump empty_blob empty_clob syn keyword sqlFunction lnnvl nullif nvl nvl2 ora_hash powermultiset powermultiset_by_cardinality syn keyword sqlFunction sys_connect_by_path sys_context sys_guid sys_typeid uid user userenv vsizeality " XML Functions syn keyword sqlFunction appendchildxml deletexml depth extract existsnode extractvalue insertchildxml syn keyword sqlFunction insertxmlbefore path sys_dburigen sys_xmlagg sys_xmlgen updatexml xmlagg xmlcast syn keyword sqlFunction xmlcdata xmlcolattval xmlcomment xmlconcat xmldiff xmlelement xmlexists xmlforest syn keyword sqlFunction xmlparse xmlpatch xmlpi xmlquery xmlroot xmlsequence xmlserialize xmltable xmltransform " Todo: syn keyword sqlTodo TODO FIXME XXX DEBUG NOTE contained " Define the default highlighting. command -nargs=+ HiLink hi def link HiLink sqlComment Comment HiLink sqlFunction Function 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 let b:current_syntax = "sql" " vim: ts=8 vim-7.4.1689/runtime/syntax/sqr.vim000066400000000000000000000335611267703067000171400ustar00rootroot00000000000000" 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-connection 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-connection 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 /!\@= 508 || !exists("did_sqr_syn_inits") if version < 508 let did_sqr_syn_inits = 1 command -nargs=+ HiLink hi link else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/squid.vim000066400000000000000000000162261267703067000174570ustar00rootroot00000000000000" Vim syntax file " Language: Squid config file " Maintainer: Klaus Muth " Last Change: 2005 Jun 12 " URL: http://www.hampft.de/vim/syntax/squid.vim " ThanksTo: Ilya Sher , " Michael Dotzler " For version 5.x: Clear all syntax items " 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 announce_period syn keyword squidConf announce_port announce_to anonymize_headers syn keyword squidConf append_domain as_whois_server auth_param_basic syn keyword squidConf authenticate_children authenticate_program syn keyword squidConf authenticate_ttl broken_posts buffered_logs syn keyword squidConf cache_access_log cache_announce cache_dir syn keyword squidConf cache_dns_program cache_effective_group syn keyword squidConf cache_effective_user cache_host cache_host_acl syn keyword squidConf cache_host_domain cache_log cache_mem syn keyword squidConf cache_mem_high cache_mem_low cache_mgr syn keyword squidConf cachemgr_passwd cache_peer cache_peer_access syn keyword squidConf cahce_replacement_policy cache_stoplist syn keyword squidConf cache_stoplist_pattern cache_store_log cache_swap syn keyword squidConf cache_swap_high cache_swap_log cache_swap_low syn keyword squidConf client_db client_lifetime client_netmask syn keyword squidConf connect_timeout coredump_dir dead_peer_timeout syn keyword squidConf debug_options delay_access delay_class syn keyword squidConf delay_initial_bucket_level delay_parameters syn keyword squidConf delay_pools deny_info dns_children dns_defnames syn keyword squidConf dns_nameservers dns_testnames emulate_httpd_log syn keyword squidConf err_html_text fake_user_agent firewall_ip syn keyword squidConf forwarded_for forward_snmpd_port fqdncache_size syn keyword squidConf ftpget_options ftpget_program ftp_list_width syn keyword squidConf ftp_passive ftp_user half_closed_clients syn keyword squidConf header_access header_replace hierarchy_stoplist syn keyword squidConf high_response_time_warning high_page_fault_warning syn keyword squidConf htcp_port http_access http_anonymizer httpd_accel syn keyword squidConf httpd_accel_host httpd_accel_port syn keyword squidConf httpd_accel_uses_host_header syn keyword squidConf httpd_accel_with_proxy http_port http_reply_access syn keyword squidConf icp_access icp_hit_stale icp_port syn keyword squidConf icp_query_timeout ident_lookup ident_lookup_access syn keyword squidConf ident_timeout incoming_http_average syn keyword squidConf incoming_icp_average inside_firewall ipcache_high syn keyword squidConf ipcache_low 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 memory_pools syn keyword squidConf memory_pools_limit memory_replacement_policy syn keyword squidConf mime_table min_http_poll_cnt min_icp_poll_cnt syn keyword squidConf minimum_direct_hops minimum_object_size syn keyword squidConf minimum_retry_timeout miss_access negative_dns_ttl syn keyword squidConf negative_ttl neighbor_timeout neighbor_type_domain syn keyword squidConf netdb_high netdb_low netdb_ping_period syn keyword squidConf netdb_ping_rate never_direct no_cache syn keyword squidConf passthrough_proxy pconn_timeout pid_filename syn keyword squidConf pinger_program positive_dns_ttl prefer_direct syn keyword squidConf proxy_auth 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 read_timeout syn keyword squidConf redirect_children 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_body_max_size 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 udp_hit_obj syn keyword squidConf udp_hit_obj_size udp_incoming_address syn keyword squidConf udp_outgoing_address unique_hostname syn keyword squidConf unlinkd_program uri_whitespace useragent_log syn keyword squidConf visible_hostname wais_relay wais_relay_host syn keyword squidConf 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 syn keyword squidopt via parent no-digest heap lru realm syn keyword squidopt children credentialsttl none disable syn keyword squidopt offline_toggle diskd q1 q2 " 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 keyword squidAcl time dstdomain ident snmp_community 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/srec.vim000066400000000000000000000101631267703067000172600ustar00rootroot00000000000000" Vim syntax file " Language: Motorola S-Record " Maintainer: Markus Heidelberg " Last Change: 2015 Feb 24 " Each record (line) is built as follows: " " field digits states " " +----------+ " | start | 1 ('S') srecRecStart " +----------+ " | type | 1 srecRecType, (srecRecTypeUnknown) " +----------+ " | count | 2 srecByteCount " +----------+ " | address | 4/6/8 srecNoAddress, srecDataAddress, srecRecCount, srecStartAddress, (srecAddressFieldUnknown) " +----------+ " | data | 0..504/502/500 srecDataOdd, srecDataEven, (srecDataUnexpected) " +----------+ " | checksum | 2 srecChecksum " +----------+ " " States in parentheses in the upper format description indicate that they " should not appear in a valid 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 syn match srecRecStart "^S" syn match srecRecTypeUnknown "^S." contains=srecRecStart syn match srecRecType "^S[0-35-9]" contains=srecRecStart syn match srecByteCount "^S.[0-9a-fA-F]\{2}" contains=srecRecTypeUnknown nextgroup=srecAddressFieldUnknown,srecChecksum syn match srecByteCount "^S[0-35-9][0-9a-fA-F]\{2}" contains=srecRecType syn match srecAddressFieldUnknown "[0-9a-fA-F]\{2}" contained nextgroup=srecAddressFieldUnknown,srecChecksum syn match srecNoAddress "^S0[0-9a-fA-F]\{6}" contains=srecByteCount nextgroup=srecDataOdd,srecChecksum syn match srecDataAddress "^S1[0-9a-fA-F]\{6}" contains=srecByteCount nextgroup=srecDataOdd,srecChecksum syn match srecDataAddress "^S2[0-9a-fA-F]\{8}" contains=srecByteCount nextgroup=srecDataOdd,srecChecksum syn match srecDataAddress "^S3[0-9a-fA-F]\{10}" contains=srecByteCount nextgroup=srecDataOdd,srecChecksum syn match srecRecCount "^S5[0-9a-fA-F]\{6}" contains=srecByteCount nextgroup=srecDataUnexpected,srecChecksum syn match srecRecCount "^S6[0-9a-fA-F]\{8}" contains=srecByteCount nextgroup=srecDataUnexpected,srecChecksum syn match srecStartAddress "^S7[0-9a-fA-F]\{10}" contains=srecByteCount nextgroup=srecDataUnexpected,srecChecksum syn match srecStartAddress "^S8[0-9a-fA-F]\{8}" contains=srecByteCount nextgroup=srecDataUnexpected,srecChecksum syn match srecStartAddress "^S9[0-9a-fA-F]\{6}" contains=srecByteCount nextgroup=srecDataUnexpected,srecChecksum " alternating highlight per byte for easier reading syn match srecDataOdd "[0-9a-fA-F]\{2}" contained nextgroup=srecDataEven,srecChecksum syn match srecDataEven "[0-9a-fA-F]\{2}" contained nextgroup=srecDataOdd,srecChecksum " data bytes which should not exist syn match srecDataUnexpected "[0-9a-fA-F]\{2}" contained nextgroup=srecDataUnexpected,srecChecksum " Data digit pair regex usage also results in only highlighting the checksum " if the number of data characters is even. syn match srecChecksum "[0-9a-fA-F]\{2}$" 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_srec_syntax_inits") if version < 508 let did_srec_syntax_inits = 1 command -nargs=+ HiLink hi link else command -nargs=+ HiLink hi def link endif " The default methods for highlighting. Can be overridden later HiLink srecRecStart srecRecType HiLink srecRecTypeUnknown srecRecType HiLink srecRecType WarningMsg HiLink srecByteCount Constant hi def srecAddressFieldUnknown term=italic cterm=italic gui=italic HiLink srecNoAddress DiffAdd HiLink srecDataAddress Comment HiLink srecRecCount srecNoAddress HiLink srecStartAddress srecDataAddress hi def srecDataOdd term=bold cterm=bold gui=bold hi def srecDataEven term=NONE cterm=NONE gui=NONE HiLink srecDataUnexpected Error HiLink srecChecksum DiffChange delcommand HiLink endif let b:current_syntax = "srec" " vim: ts=8 vim-7.4.1689/runtime/syntax/sshconfig.vim000066400000000000000000000246131267703067000203140ustar00rootroot00000000000000" Vim syntax file " Language: OpenSSH client configuration file (ssh_config) " Author: David Necas (Yeti) " Maintainer: Dominik Fischer " Contributor: Leonard Ehrenfried " Contributor: Karsten Hopp " Last Change: 2016 Mar 1 " SSH Version: 7.2 " " 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 " case on syn case match " Comments syn match sshconfigComment "^#.*$" contains=sshconfigTodo syn match sshconfigComment "\s#.*$" contains=sshconfigTodo syn keyword sshconfigTodo TODO FIXME NOTE contained " Constants syn keyword sshconfigYesNo yes no ask syn keyword sshconfigYesNo any auto syn keyword sshconfigYesNo force autoask none syn keyword sshconfigCipher 3des blowfish syn keyword sshconfigCiphers 3des-cbc syn keyword sshconfigCiphers blowfish-cbc syn keyword sshconfigCiphers cast128-cbc syn keyword sshconfigCiphers arcfour syn keyword sshconfigCiphers arcfour128 syn keyword sshconfigCiphers arcfour256 syn keyword sshconfigCiphers aes128-cbc syn keyword sshconfigCiphers aes192-cbc syn keyword sshconfigCiphers aes256-cbc syn match sshconfigCiphers "\" syn keyword sshconfigCiphers aes128-ctr syn keyword sshconfigCiphers aes192-ctr syn keyword sshconfigCiphers aes256-ctr syn match sshconfigCiphers "\" syn match sshconfigCiphers "\" syn match sshconfigCiphers "\" syn keyword sshconfigMAC hmac-sha1 syn keyword sshconfigMAC mac-sha1-96 syn keyword sshconfigMAC mac-sha2-256 syn keyword sshconfigMAC mac-sha2-512 syn keyword sshconfigMAC mac-md5 syn keyword sshconfigMAC mac-md5-96 syn keyword sshconfigMAC mac-ripemd160 syn match sshconfigMAC "\" syn match sshconfigMAC "\" syn match sshconfigMAC "\" syn match sshconfigMAC "\" syn match sshconfigMAC "\" syn match sshconfigMAC "\" syn match sshconfigMAC "\" syn match sshconfigMAC "\" syn match sshconfigMAC "\" syn match sshconfigMAC "\" syn match sshconfigMAC "\" syn match sshconfigMAC "\" syn keyword sshconfigHostKeyAlgo ssh-ed25519 syn match sshconfigHostKeyAlgo "\" syn keyword sshconfigHostKeyAlgo ssh-rsa syn keyword sshconfigHostKeyAlgo ssh-dss syn keyword sshconfigHostKeyAlgo ecdsa-sha2-nistp256 syn keyword sshconfigHostKeyAlgo ecdsa-sha2-nistp384 syn keyword sshconfigHostKeyAlgo ecdsa-sha2-nistp521 syn match sshconfigHostKeyAlgo "\" syn match sshconfigHostKeyAlgo "\" syn match sshconfigHostKeyAlgo "\" syn match sshconfigHostKeyAlgo "\" syn match sshconfigHostKeyAlgo "\" syn keyword sshconfigPreferredAuth hostbased publickey password gssapi-with-mic 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 AUTHPRIV LOCAL0 LOCAL1 syn keyword sshconfigSysLogFacility LOCAL2 LOCAL3 LOCAL4 LOCAL5 LOCAL6 LOCAL7 syn keyword sshconfigAddressFamily inet inet6 syn match sshconfigIPQoS "af1[123]" syn match sshconfigIPQoS "af2[123]" syn match sshconfigIPQoS "af3[123]" syn match sshconfigIPQoS "af4[123]" syn match sshconfigIPQoS "cs[0-7]" syn keyword sshconfigIPQoS ef lowdelay throughput reliability syn keyword sshconfigKbdInteractive bsdauth pam skey syn keyword sshconfigKexAlgo diffie-hellman-group1-sha1 syn keyword sshconfigKexAlgo diffie-hellman-group14-sha1 syn keyword sshconfigKexAlgo diffie-hellman-group-exchange-sha1 syn keyword sshconfigKexAlgo diffie-hellman-group-exchange-sha256 syn keyword sshconfigKexAlgo ecdh-sha2-nistp256 syn keyword sshconfigKexAlgo ecdh-sha2-nistp384 syn keyword sshconfigKexAlgo ecdh-sha2-nistp521 syn match sshconfigKexAlgo "\" syn keyword sshconfigTunnel point-to-point ethernet syn match sshconfigVar "%[rhplLdun]\>" 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\+\>" syn match sshconfigHostPort "\(Host \)\@<=.\+" syn match sshconfigHostPort "\(HostName \)\@<=.\+" " case off syn case ignore " Keywords syn keyword sshconfigHostSect Host syn keyword sshconfigMatch canonical exec host originalhost user localuser all syn keyword sshconfigKeyword AddressFamily syn keyword sshconfigKeyword BatchMode syn keyword sshconfigKeyword BindAddress syn keyword sshconfigKeyword CanonicalDomains syn keyword sshconfigKeyword CanonicalizeFallbackLocal syn keyword sshconfigKeyword CanonicalizeHostname syn keyword sshconfigKeyword CanonicalizeMaxDots syn keyword sshconfigKeyword CertificateFile syn keyword sshconfigKeyword ChallengeResponseAuthentication syn keyword sshconfigKeyword CheckHostIP syn keyword sshconfigKeyword Cipher syn keyword sshconfigKeyword Ciphers syn keyword sshconfigKeyword ClearAllForwardings syn keyword sshconfigKeyword Compression syn keyword sshconfigKeyword CompressionLevel syn keyword sshconfigKeyword ConnectTimeout syn keyword sshconfigKeyword ConnectionAttempts syn keyword sshconfigKeyword ControlMaster syn keyword sshconfigKeyword ControlPath syn keyword sshconfigKeyword ControlPersist syn keyword sshconfigKeyword DynamicForward syn keyword sshconfigKeyword EnableSSHKeysign syn keyword sshconfigKeyword EscapeChar syn keyword sshconfigKeyword ExitOnForwardFailure syn keyword sshconfigKeyword ForwardAgent syn keyword sshconfigKeyword ForwardX11 syn keyword sshconfigKeyword ForwardX11Timeout syn keyword sshconfigKeyword ForwardX11Trusted syn keyword sshconfigKeyword GSSAPIAuthentication syn keyword sshconfigKeyword GSSAPIClientIdentity syn keyword sshconfigKeyword GSSAPIDelegateCredentials syn keyword sshconfigKeyword GSSAPIKeyExchange syn keyword sshconfigKeyword GSSAPIRenewalForcesRekey syn keyword sshconfigKeyword GSSAPIServerIdentity syn keyword sshconfigKeyword GSSAPITrustDNS syn keyword sshconfigKeyword GSSAPITrustDns syn keyword sshconfigKeyword GatewayPorts syn keyword sshconfigKeyword GlobalKnownHostsFile syn keyword sshconfigKeyword HashKnownHosts syn keyword sshconfigKeyword HostKeyAlgorithms syn keyword sshconfigKeyword HostKeyAlias syn keyword sshconfigKeyword HostName syn keyword sshconfigKeyword HostbasedAuthentication syn keyword sshconfigKeyword HostbasedKeyTypes syn keyword sshconfigKeyword IPQoS syn keyword sshconfigKeyword IdentitiesOnly syn keyword sshconfigKeyword IdentityFile syn keyword sshconfigKeyword IgnoreUnknown syn keyword sshconfigKeyword IPQoS syn keyword sshconfigKeyword KbdInteractiveAuthentication syn keyword sshconfigKeyword KbdInteractiveDevices syn keyword sshconfigKeyword KexAlgorithms syn keyword sshconfigKeyword LocalCommand syn keyword sshconfigKeyword LocalForward syn keyword sshconfigKeyword LogLevel syn keyword sshconfigKeyword MACs syn keyword sshconfigKeyword Match syn keyword sshconfigKeyword NoHostAuthenticationForLocalhost syn keyword sshconfigKeyword NumberOfPasswordPrompts syn keyword sshconfigKeyword PKCS11Provider syn keyword sshconfigKeyword PasswordAuthentication syn keyword sshconfigKeyword PermitLocalCommand syn keyword sshconfigKeyword Port syn keyword sshconfigKeyword PreferredAuthentications syn keyword sshconfigKeyword Protocol syn keyword sshconfigKeyword ProxyCommand syn keyword sshconfigKeyword ProxyUseFDPass syn keyword sshconfigKeyword PubkeyAcceptedKeyTypes syn keyword sshconfigKeyword PubkeyAuthentication syn keyword sshconfigKeyword RSAAuthentication syn keyword sshconfigKeyword RekeyLimit syn keyword sshconfigKeyword RemoteForward syn keyword sshconfigKeyword RequestTTY syn keyword sshconfigKeyword RhostsRSAAuthentication syn keyword sshconfigKeyword SendEnv syn keyword sshconfigKeyword ServerAliveCountMax syn keyword sshconfigKeyword ServerAliveInterval syn keyword sshconfigKeyword SmartcardDevice syn keyword sshconfigKeyword StrictHostKeyChecking syn keyword sshconfigKeyword TCPKeepAlive syn keyword sshconfigKeyword Tunnel syn keyword sshconfigKeyword TunnelDevice syn keyword sshconfigKeyword UseBlacklistedKeys syn keyword sshconfigKeyword UsePrivilegedPort syn keyword sshconfigKeyword User syn keyword sshconfigKeyword UserKnownHostsFile syn keyword sshconfigKeyword UseRoaming syn keyword sshconfigKeyword VerifyHostKeyDNS syn keyword sshconfigKeyword VisualHostKey syn keyword sshconfigKeyword 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 else command -nargs=+ HiLink hi def link endif HiLink sshconfigComment Comment HiLink sshconfigTodo Todo HiLink sshconfigHostPort sshconfigConstant HiLink sshconfigNumber sshconfigConstant HiLink sshconfigConstant Constant HiLink sshconfigYesNo sshconfigEnum HiLink sshconfigCipher sshconfigEnum HiLink sshconfigCiphers sshconfigEnum HiLink sshconfigMAC sshconfigEnum HiLink sshconfigHostKeyAlgo sshconfigEnum HiLink sshconfigLogLevel sshconfigEnum HiLink sshconfigSysLogFacility sshconfigEnum HiLink sshconfigAddressFamily sshconfigEnum HiLink sshconfigIPQoS sshconfigEnum HiLink sshconfigKbdInteractive sshconfigEnum HiLink sshconfigKexAlgo sshconfigEnum HiLink sshconfigTunnel sshconfigEnum HiLink sshconfigPreferredAuth sshconfigEnum HiLink sshconfigVar sshconfigEnum HiLink sshconfigEnum Identifier HiLink sshconfigSpecial Special HiLink sshconfigKeyword Keyword HiLink sshconfigHostSect Type HiLink sshconfigMatch Type delcommand HiLink endif let b:current_syntax = "sshconfig" " vim:set ts=8 sw=2 sts=2: vim-7.4.1689/runtime/syntax/sshdconfig.vim000066400000000000000000000261051267703067000204560ustar00rootroot00000000000000" Vim syntax file " Language: OpenSSH server configuration file (sshd_config) " Author: David Necas (Yeti) " Maintainer: Dominik Fischer " Contributor: Thilo Six " Contributor: Leonard Ehrenfried " Contributor: Karsten Hopp " Originally: 2009-07-09 " Last Change: 2016 Mar 1 " SSH Version: 7.2 " " 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 " case on syn case match " Comments syn match sshdconfigComment "^#.*$" contains=sshdconfigTodo syn match sshdconfigComment "\s#.*$" contains=sshdconfigTodo syn keyword sshdconfigTodo TODO FIXME NOTE contained " Constants syn keyword sshdconfigYesNo yes no none syn keyword sshdconfigAddressFamily any inet inet6 syn keyword sshdconfigPrivilegeSeparation sandbox syn keyword sshdconfigTcpForwarding local remote syn keyword sshdconfigRootLogin prohibit-password without-password forced-commands-only syn keyword sshdconfigCiphers 3des-cbc syn keyword sshdconfigCiphers blowfish-cbc syn keyword sshdconfigCiphers cast128-cbc syn keyword sshdconfigCiphers arcfour syn keyword sshdconfigCiphers arcfour128 syn keyword sshdconfigCiphers arcfour256 syn keyword sshdconfigCiphers aes128-cbc syn keyword sshdconfigCiphers aes192-cbc syn keyword sshdconfigCiphers aes256-cbc syn match sshdconfigCiphers "\" syn keyword sshdconfigCiphers aes128-ctr syn keyword sshdconfigCiphers aes192-ctr syn keyword sshdconfigCiphers aes256-ctr syn match sshdconfigCiphers "\" syn match sshdconfigCiphers "\" syn match sshdconfigCiphers "\" syn keyword sshdconfigMAC hmac-sha1 syn keyword sshdconfigMAC mac-sha1-96 syn keyword sshdconfigMAC mac-sha2-256 syn keyword sshdconfigMAC mac-sha2-512 syn keyword sshdconfigMAC mac-md5 syn keyword sshdconfigMAC mac-md5-96 syn keyword sshdconfigMAC mac-ripemd160 syn match sshdconfigMAC "\" syn match sshdconfigMAC "\" syn match sshdconfigMAC "\" syn match sshdconfigMAC "\" syn match sshdconfigMAC "\" syn match sshdconfigMAC "\" syn match sshdconfigMAC "\" syn match sshdconfigMAC "\" syn match sshdconfigMAC "\" syn match sshdconfigMAC "\" syn match sshdconfigMAC "\" syn match sshdconfigMAC "\" syn keyword sshdconfigHostKeyAlgo ssh-ed25519 syn match sshdconfigHostKeyAlgo "\" syn keyword sshdconfigHostKeyAlgo ssh-rsa syn keyword sshdconfigHostKeyAlgo ssh-dss syn keyword sshdconfigHostKeyAlgo ecdsa-sha2-nistp256 syn keyword sshdconfigHostKeyAlgo ecdsa-sha2-nistp384 syn keyword sshdconfigHostKeyAlgo ecdsa-sha2-nistp521 syn match sshdconfigHostKeyAlgo "\" syn match sshdconfigHostKeyAlgo "\" syn match sshdconfigHostKeyAlgo "\" syn match sshdconfigHostKeyAlgo "\" syn match sshdconfigHostKeyAlgo "\" syn keyword sshdconfigRootLogin prohibit-password 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 AUTHPRIV LOCAL0 LOCAL1 syn keyword sshdconfigSysLogFacility LOCAL2 LOCAL3 LOCAL4 LOCAL5 LOCAL6 LOCAL7 syn keyword sshdconfigCompression delayed syn match sshdconfigIPQoS "af1[123]" syn match sshdconfigIPQoS "af2[123]" syn match sshdconfigIPQoS "af3[123]" syn match sshdconfigIPQoS "af4[123]" syn match sshdconfigIPQoS "cs[0-7]" syn keyword sshdconfigIPQoS ef lowdelay throughput reliability syn keyword sshdconfigKexAlgo diffie-hellman-group1-sha1 syn keyword sshdconfigKexAlgo diffie-hellman-group14-sha1 syn keyword sshdconfigKexAlgo diffie-hellman-group-exchange-sha1 syn keyword sshdconfigKexAlgo diffie-hellman-group-exchange-sha256 syn keyword sshdconfigKexAlgo ecdh-sha2-nistp256 syn keyword sshdconfigKexAlgo ecdh-sha2-nistp384 syn keyword sshdconfigKexAlgo ecdh-sha2-nistp521 syn match sshdconfigKexAlgo "\" syn keyword sshdconfigTunnel point-to-point ethernet syn keyword sshdconfigSubsystem internal-sftp syn match sshdconfigVar "%[hu]\>" syn match sshdconfigVar "%%" 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\+\)\?\>" " FIXME: this matches quite a few things which are NOT valid IPv6 addresses syn match sshdconfigHostPort "\<\(\x\{,4}:\)\+\x\{,4}:\d\+\>" syn match sshdconfigTime "\<\(\d\+[sSmMhHdDwW]\)\+\>" " case off syn case ignore " Keywords syn keyword sshdconfigMatch Host User Group Address syn keyword sshdconfigKeyword AcceptEnv syn keyword sshdconfigKeyword AddressFamily syn keyword sshdconfigKeyword AllowAgentForwarding syn keyword sshdconfigKeyword AllowGroups syn keyword sshdconfigKeyword AllowStreamLocalForwarding syn keyword sshdconfigKeyword AllowTcpForwarding syn keyword sshdconfigKeyword AllowUsers syn keyword sshdconfigKeyword AuthenticationMethods syn keyword sshdconfigKeyword AuthorizedKeysFile syn keyword sshdconfigKeyword AuthorizedKeysCommand syn keyword sshdconfigKeyword AuthorizedKeysCommandUser syn keyword sshdconfigKeyword AuthorizedPrincipalsFile syn keyword sshdconfigKeyword Banner syn keyword sshdconfigKeyword ChallengeResponseAuthentication syn keyword sshdconfigKeyword ChrootDirectory syn keyword sshdconfigKeyword Ciphers syn keyword sshdconfigKeyword ClientAliveCountMax syn keyword sshdconfigKeyword ClientAliveInterval syn keyword sshdconfigKeyword Compression syn keyword sshdconfigKeyword DebianBanner syn keyword sshdconfigKeyword DenyGroups syn keyword sshdconfigKeyword DenyUsers syn keyword sshdconfigKeyword ForceCommand syn keyword sshdconfigKeyword GSSAPIAuthentication syn keyword sshdconfigKeyword GSSAPICleanupCredentials syn keyword sshdconfigKeyword GSSAPIKeyExchange syn keyword sshdconfigKeyword GSSAPIStoreCredentialsOnRekey syn keyword sshdconfigKeyword GSSAPIStrictAcceptorCheck syn keyword sshdconfigKeyword GatewayPorts syn keyword sshdconfigKeyword HostCertificate syn keyword sshdconfigKeyword HostKey syn keyword sshdconfigKeyword HostKeyAgent syn keyword sshdconfigKeyword HostKeyAlgorithms syn keyword sshdconfigKeyword HostbasedAcceptedKeyTypes syn keyword sshdconfigKeyword HostbasedAuthentication syn keyword sshdconfigKeyword HostbasedUsesNameFromPacketOnly syn keyword sshdconfigKeyword IPQoS syn keyword sshdconfigKeyword IgnoreRhosts syn keyword sshdconfigKeyword IgnoreUserKnownHosts syn keyword sshdconfigKeyword KbdInteractiveAuthentication syn keyword sshdconfigKeyword KerberosAuthentication syn keyword sshdconfigKeyword KerberosGetAFSToken syn keyword sshdconfigKeyword KerberosOrLocalPasswd syn keyword sshdconfigKeyword KerberosTicketCleanup syn keyword sshdconfigKeyword KexAlgorithms syn keyword sshdconfigKeyword KeyRegenerationInterval syn keyword sshdconfigKeyword ListenAddress syn keyword sshdconfigKeyword LogLevel syn keyword sshdconfigKeyword LoginGraceTime syn keyword sshdconfigKeyword MACs syn keyword sshdconfigKeyword Match syn keyword sshdconfigKeyword MaxAuthTries syn keyword sshdconfigKeyword MaxSessions syn keyword sshdconfigKeyword MaxStartups syn keyword sshdconfigKeyword PasswordAuthentication syn keyword sshdconfigKeyword PermitBlacklistedKeys syn keyword sshdconfigKeyword PermitEmptyPasswords syn keyword sshdconfigKeyword PermitOpen syn keyword sshdconfigKeyword PermitRootLogin syn keyword sshdconfigKeyword PermitTTY syn keyword sshdconfigKeyword PermitTunnel syn keyword sshdconfigKeyword PermitUserEnvironment syn keyword sshdconfigKeyword PermitUserRC syn keyword sshdconfigKeyword PidFile syn keyword sshdconfigKeyword Port syn keyword sshdconfigKeyword PrintLastLog syn keyword sshdconfigKeyword PrintMotd syn keyword sshdconfigKeyword Protocol syn keyword sshdconfigKeyword PubkeyAcceptedKeyTypes syn keyword sshdconfigKeyword PubkeyAuthentication syn keyword sshdconfigKeyword RSAAuthentication syn keyword sshdconfigKeyword RekeyLimit syn keyword sshdconfigKeyword RevokedKeys syn keyword sshdconfigKeyword RhostsRSAAuthentication syn keyword sshdconfigKeyword ServerKeyBits syn keyword sshdconfigKeyword ShowPatchLevel syn keyword sshdconfigKeyword StrictModes syn keyword sshdconfigKeyword Subsystem syn keyword sshdconfigKeyword SyslogFacility syn keyword sshdconfigKeyword TCPKeepAlive syn keyword sshdconfigKeyword TrustedUserCAKeys syn keyword sshdconfigKeyword UseDNS syn keyword sshdconfigKeyword UseLogin syn keyword sshdconfigKeyword UsePAM syn keyword sshdconfigKeyword UsePrivilegeSeparation syn keyword sshdconfigKeyword VersionAddendum syn keyword sshdconfigKeyword X11DisplayOffset syn keyword sshdconfigKeyword X11Forwarding syn keyword sshdconfigKeyword X11UseLocalhost syn keyword sshdconfigKeyword 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 else command -nargs=+ HiLink hi def link endif HiLink sshdconfigComment Comment HiLink sshdconfigTodo Todo HiLink sshdconfigHostPort sshdconfigConstant HiLink sshdconfigTime sshdconfigConstant HiLink sshdconfigNumber sshdconfigConstant HiLink sshdconfigConstant Constant HiLink sshdconfigYesNo sshdconfigEnum HiLink sshdconfigAddressFamily sshdconfigEnum HiLink sshdconfigPrivilegeSeparation sshdconfigEnum HiLink sshdconfigTcpForwarding sshdconfigEnum HiLink sshdconfigRootLogin sshdconfigEnum HiLink sshdconfigCiphers sshdconfigEnum HiLink sshdconfigMAC sshdconfigEnum HiLink sshdconfigHostKeyAlgo sshdconfigEnum HiLink sshdconfigRootLogin sshdconfigEnum HiLink sshdconfigLogLevel sshdconfigEnum HiLink sshdconfigSysLogFacility sshdconfigEnum HiLink sshdconfigVar sshdconfigEnum HiLink sshdconfigCompression sshdconfigEnum HiLink sshdconfigIPQoS sshdconfigEnum HiLink sshdconfigKexAlgo sshdconfigEnum HiLink sshdconfigTunnel sshdconfigEnum HiLink sshdconfigSubsystem sshdconfigEnum HiLink sshdconfigEnum Function HiLink sshdconfigSpecial Special HiLink sshdconfigKeyword Keyword HiLink sshdconfigMatch Type delcommand HiLink endif let b:current_syntax = "sshdconfig" " vim:set ts=8 sw=2 sts=2: vim-7.4.1689/runtime/syntax/st.vim000066400000000000000000000060751267703067000167610ustar00rootroot00000000000000" Vim syntax file " Language: Smalltalk " Maintainer: Arndt Hesse " Last Change: 2012 Feb 12 by Thilo Six " For version 5.x: Clear all syntax items " 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:cpo_save = &cpo set cpo&vim " 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 "\:" syn match stMethod "\:" syn match stMethod "\:" syn match stMethod "\:" syn match stMethod "\:" syn match stMethod "\:" syn match stMethod "\:" syn match stMethod "\:" syn match stMethod "\:" syn match stMethod "\:" syn match stMethod "\:" syn match stMethod "\:" syn match stMethod "\:" syn match stMethod "\:" syn match stMethod "\:" syn match stMethod "\:" syn match stMethod "\:" " 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 else command -nargs=+ HiLink hi def link 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" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/stata.vim000066400000000000000000000646461267703067000174570ustar00rootroot00000000000000" stata.vim -- Vim syntax file for Stata do, ado, and class files. " Language: Stata and/or Mata " Maintainer: Jeff Pitblado " Last Change: 26apr2006 " Version: 1.1.4 " Log: " 14apr2006 renamed syntax groups st* to stata* " 'syntax clear' only under version control " check for 'b:current_syntax', removed 'did_stata_syntax_inits' " 17apr2006 fixed start expression for stataFunc " 26apr2006 fixed brace confusion in stataErrInParen and stataErrInBracket " fixed paren/bracket confusion in stataFuncGroup if version < 600 syntax clear elseif exists("b:current_syntax") finish endif syntax case match " comments - single line " note that the triple slash continuing line comment comes free syn region stataStarComment start=/^\s*\*/ end=/$/ contains=stataComment oneline syn region stataSlashComment start="\s//" end=/$/ contains=stataComment oneline syn region stataSlashComment start="^//" end=/$/ contains=stataComment oneline " comments - multiple line syn region stataComment start="/\*" end="\*/" contains=stataComment " global macros - simple case syn match stataGlobal /\$\a\w*/ " global macros - general case syn region stataGlobal start=/\${/ end=/}/ oneline contains=@stataMacroGroup " local macros - general case syn region stataLocal start=/`/ end=/'/ oneline contains=@stataMacroGroup " numeric formats syn match stataFormat /%-\=\d\+\.\d\+[efg]c\=/ " numeric hex format syn match stataFormat /%-\=21x/ " string format syn match stataFormat /%\(\|-\|\~\)\d\+s/ " Statements syn keyword stataConditional else if syn keyword stataRepeat foreach syn keyword stataRepeat forv[alues] syn keyword stataRepeat while " Common programming commands syn keyword stataCommand about syn keyword stataCommand adopath syn keyword stataCommand adoupdate syn keyword stataCommand assert syn keyword stataCommand break syn keyword stataCommand by syn keyword stataCommand cap[ture] syn keyword stataCommand cd syn keyword stataCommand chdir syn keyword stataCommand checksum syn keyword stataCommand class syn keyword stataCommand classutil syn keyword stataCommand compress syn keyword stataCommand conf[irm] syn keyword stataCommand conren syn keyword stataCommand continue syn keyword stataCommand cou[nt] syn keyword stataCommand cscript syn keyword stataCommand cscript_log syn keyword stataCommand #delimit syn keyword stataCommand d[escribe] syn keyword stataCommand dir syn keyword stataCommand discard syn keyword stataCommand di[splay] syn keyword stataCommand do syn keyword stataCommand doedit syn keyword stataCommand drop syn keyword stataCommand edit syn keyword stataCommand end syn keyword stataCommand erase syn keyword stataCommand eret[urn] syn keyword stataCommand err[or] syn keyword stataCommand e[xit] syn keyword stataCommand expand syn keyword stataCommand expandcl syn keyword stataCommand file syn keyword stataCommand findfile syn keyword stataCommand format syn keyword stataCommand g[enerate] syn keyword stataCommand gettoken syn keyword stataCommand gl[obal] syn keyword stataCommand help syn keyword stataCommand hexdump syn keyword stataCommand include syn keyword stataCommand infile syn keyword stataCommand infix syn keyword stataCommand input syn keyword stataCommand insheet syn keyword stataCommand joinby syn keyword stataCommand la[bel] syn keyword stataCommand levelsof syn keyword stataCommand list syn keyword stataCommand loc[al] syn keyword stataCommand log syn keyword stataCommand ma[cro] syn keyword stataCommand mark syn keyword stataCommand markout syn keyword stataCommand marksample syn keyword stataCommand mata syn keyword stataCommand matrix syn keyword stataCommand memory syn keyword stataCommand merge syn keyword stataCommand mkdir syn keyword stataCommand more syn keyword stataCommand net syn keyword stataCommand nobreak syn keyword stataCommand n[oisily] syn keyword stataCommand note[s] syn keyword stataCommand numlist syn keyword stataCommand outfile syn keyword stataCommand outsheet syn keyword stataCommand _parse syn keyword stataCommand pause syn keyword stataCommand plugin syn keyword stataCommand post syn keyword stataCommand postclose syn keyword stataCommand postfile syn keyword stataCommand preserve syn keyword stataCommand print syn keyword stataCommand printer syn keyword stataCommand profiler syn keyword stataCommand pr[ogram] syn keyword stataCommand q[uery] syn keyword stataCommand qui[etly] syn keyword stataCommand rcof syn keyword stataCommand reg[ress] syn keyword stataCommand rename syn keyword stataCommand repeat syn keyword stataCommand replace syn keyword stataCommand reshape syn keyword stataCommand ret[urn] syn keyword stataCommand _rmcoll syn keyword stataCommand _rmcoll syn keyword stataCommand _rmcollright syn keyword stataCommand rmdir syn keyword stataCommand _robust syn keyword stataCommand save syn keyword stataCommand sca[lar] syn keyword stataCommand search syn keyword stataCommand serset syn keyword stataCommand set syn keyword stataCommand shell syn keyword stataCommand sleep syn keyword stataCommand sort syn keyword stataCommand split syn keyword stataCommand sret[urn] syn keyword stataCommand ssc syn keyword stataCommand su[mmarize] syn keyword stataCommand syntax syn keyword stataCommand sysdescribe syn keyword stataCommand sysdir syn keyword stataCommand sysuse syn keyword stataCommand token[ize] syn keyword stataCommand translate syn keyword stataCommand type syn keyword stataCommand unab syn keyword stataCommand unabcmd syn keyword stataCommand update syn keyword stataCommand use syn keyword stataCommand vers[ion] syn keyword stataCommand view syn keyword stataCommand viewsource syn keyword stataCommand webdescribe syn keyword stataCommand webseek syn keyword stataCommand webuse syn keyword stataCommand which syn keyword stataCommand who syn keyword stataCommand window " Literals syn match stataQuote /"/ syn region stataEString matchgroup=Nothing start=/`"/ end=/"'/ oneline contains=@stataMacroGroup,stataQuote,stataString,stataEString syn region stataString matchgroup=Nothing start=/"/ end=/"/ oneline contains=@stataMacroGroup " define clusters syn cluster stataFuncGroup contains=@stataMacroGroup,stataFunc,stataString,stataEstring,stataParen,stataBracket syn cluster stataMacroGroup contains=stataGlobal,stataLocal syn cluster stataParenGroup contains=stataParenError,stataBracketError,stataBraceError,stataSpecial,stataFormat " Stata functions " Math syn region stataFunc matchgroup=Function start=/\" " Conditional. syn keyword stpConditional if else elseif then syn match stpConditional "\" " Repeats. syn keyword stpRepeat for while loop syn match stpRepeat "\" " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/strace.vim000066400000000000000000000041371267703067000176110ustar00rootroot00000000000000" Vim syntax file " This is a GENERATED FILE. Please always refer to source file at the URI below. " Language: strace output " Maintainer: David Necas (Yeti) " Last Change: 2015-01-16 " Setup if version >= 600 if exists("b:current_syntax") finish endif else syntax clear endif syn case match " Parse the line syn match straceSpecialChar "\\\o\{1,3}\|\\." 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 else command -nargs=+ HiLink hi def link 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" vim-7.4.1689/runtime/syntax/sudoers.vim000066400000000000000000000530311267703067000200110ustar00rootroot00000000000000" Vim syntax file " Language: sudoers(5) configuration files " Maintainer: Nikolai Weibull " Latest Revision: 2011-02-24 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim " TODO: instead of 'skipnl', we would like to match a specific group that would " match \\$ and then continue with the nextgroup, actually, the skipnl doesn't " work... " TODO: treat 'ALL' like a special (yay, a bundle of new rules!!!) syn match sudoersUserSpec '^' nextgroup=@sudoersUserInSpec skipwhite syn match sudoersSpecEquals contained '=' nextgroup=@sudoersCmndSpecList skipwhite syn cluster sudoersCmndSpecList contains=sudoersUserRunasBegin,sudoersPASSWD,@sudoersCmndInSpec syn keyword sudoersTodo contained TODO FIXME XXX NOTE syn region sudoersComment display oneline start='#' end='$' contains=sudoersTodo syn keyword sudoersAlias User_Alias Runas_Alias nextgroup=sudoersUserAlias skipwhite skipnl syn keyword sudoersAlias Host_Alias nextgroup=sudoersHostAlias skipwhite skipnl syn keyword sudoersAlias Cmnd_Alias nextgroup=sudoersCmndAlias skipwhite skipnl syn match sudoersUserAlias contained '\<\u[A-Z0-9_]*\>' nextgroup=sudoersUserAliasEquals skipwhite skipnl syn match sudoersUserNameInList contained '\<\l\+\>' nextgroup=@sudoersUserList skipwhite skipnl syn match sudoersUIDInList contained '#\d\+\>' nextgroup=@sudoersUserList skipwhite skipnl syn match sudoersGroupInList contained '%\l\+\>' nextgroup=@sudoersUserList skipwhite skipnl syn match sudoersUserNetgroupInList contained '+\l\+\>' nextgroup=@sudoersUserList skipwhite skipnl syn match sudoersUserAliasInList contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersUserList skipwhite skipnl syn match sudoersUserName contained '\<\l\+\>' nextgroup=@sudoersParameter skipwhite skipnl syn match sudoersUID contained '#\d\+\>' nextgroup=@sudoersParameter skipwhite skipnl syn match sudoersGroup contained '%\l\+\>' nextgroup=@sudoersParameter skipwhite skipnl syn match sudoersUserNetgroup contained '+\l\+\>' nextgroup=@sudoersParameter skipwhite skipnl syn match sudoersUserAliasRef contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersParameter skipwhite skipnl syn match sudoersUserNameInSpec contained '\<\l\+\>' nextgroup=@sudoersUserSpec skipwhite skipnl syn match sudoersUIDInSpec contained '#\d\+\>' nextgroup=@sudoersUserSpec skipwhite skipnl syn match sudoersGroupInSpec contained '%\l\+\>' nextgroup=@sudoersUserSpec skipwhite skipnl syn match sudoersUserNetgroupInSpec contained '+\l\+\>' nextgroup=@sudoersUserSpec skipwhite skipnl syn match sudoersUserAliasInSpec contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersUserSpec skipwhite skipnl syn match sudoersUserNameInRunas contained '\<\l\+\>' nextgroup=@sudoersUserRunas skipwhite skipnl syn match sudoersUIDInRunas contained '#\d\+\>' nextgroup=@sudoersUserRunas skipwhite skipnl syn match sudoersGroupInRunas contained '%\l\+\>' nextgroup=@sudoersUserRunas skipwhite skipnl syn match sudoersUserNetgroupInRunas contained '+\l\+\>' nextgroup=@sudoersUserRunas skipwhite skipnl syn match sudoersUserAliasInRunas contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersUserRunas skipwhite skipnl syn match sudoersHostAlias contained '\<\u[A-Z0-9_]*\>' nextgroup=sudoersHostAliasEquals skipwhite skipnl syn match sudoersHostNameInList contained '\<\l\+\>' nextgroup=@sudoersHostList skipwhite skipnl syn match sudoersIPAddrInList contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}' nextgroup=@sudoersHostList skipwhite skipnl syn match sudoersNetworkInList contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}\%(/\%(\%(\d\{1,3}\.\)\{3}\d\{1,3}\|\d\+\)\)\=' nextgroup=@sudoersHostList skipwhite skipnl syn match sudoersHostNetgroupInList contained '+\l\+\>' nextgroup=@sudoersHostList skipwhite skipnl syn match sudoersHostAliasInList contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersHostList skipwhite skipnl syn match sudoersHostName contained '\<\l\+\>' nextgroup=@sudoersParameter skipwhite skipnl syn match sudoersIPAddr contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}' nextgroup=@sudoersParameter skipwhite skipnl syn match sudoersNetwork contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}\%(/\%(\%(\d\{1,3}\.\)\{3}\d\{1,3}\|\d\+\)\)\=' nextgroup=@sudoersParameter skipwhite skipnl syn match sudoersHostNetgroup contained '+\l\+\>' nextgroup=@sudoersParameter skipwhite skipnl syn match sudoersHostAliasRef contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersParameter skipwhite skipnl syn match sudoersHostNameInSpec contained '\<\l\+\>' nextgroup=@sudoersHostSpec skipwhite skipnl syn match sudoersIPAddrInSpec contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}' nextgroup=@sudoersHostSpec skipwhite skipnl syn match sudoersNetworkInSpec contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}\%(/\%(\%(\d\{1,3}\.\)\{3}\d\{1,3}\|\d\+\)\)\=' nextgroup=@sudoersHostSpec skipwhite skipnl syn match sudoersHostNetgroupInSpec contained '+\l\+\>' nextgroup=@sudoersHostSpec skipwhite skipnl syn match sudoersHostAliasInSpec contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersHostSpec skipwhite skipnl syn match sudoersCmndAlias contained '\<\u[A-Z0-9_]*\>' nextgroup=sudoersCmndAliasEquals skipwhite skipnl syn match sudoersCmndNameInList contained '[^[:space:],:=\\]\+\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=@sudoersCmndList,sudoersCommandEmpty,sudoersCommandArgs skipwhite syn match sudoersCmndAliasInList contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersCmndList skipwhite skipnl syn match sudoersCmndNameInSpec contained '[^[:space:],:=\\]\+\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=@sudoersCmndSpec,sudoersCommandEmptyInSpec,sudoersCommandArgsInSpec skipwhite syn match sudoersCmndAliasInSpec contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersCmndSpec skipwhite skipnl syn match sudoersUserAliasEquals contained '=' nextgroup=@sudoersUserInList skipwhite skipnl syn match sudoersUserListComma contained ',' nextgroup=@sudoersUserInList skipwhite skipnl syn match sudoersUserListColon contained ':' nextgroup=sudoersUserAlias skipwhite skipnl syn cluster sudoersUserList contains=sudoersUserListComma,sudoersUserListColon syn match sudoersUserSpecComma contained ',' nextgroup=@sudoersUserInSpec skipwhite skipnl syn cluster sudoersUserSpec contains=sudoersUserSpecComma,@sudoersHostInSpec syn match sudoersUserRunasBegin contained '(' nextgroup=@sudoersUserInRunas skipwhite skipnl syn match sudoersUserRunasComma contained ',' nextgroup=@sudoersUserInRunas skipwhite skipnl syn match sudoersUserRunasEnd contained ')' nextgroup=sudoersPASSWD,@sudoersCmndInSpec skipwhite skipnl syn cluster sudoersUserRunas contains=sudoersUserRunasComma,@sudoersUserInRunas,sudoersUserRunasEnd syn match sudoersHostAliasEquals contained '=' nextgroup=@sudoersHostInList skipwhite skipnl syn match sudoersHostListComma contained ',' nextgroup=@sudoersHostInList skipwhite skipnl syn match sudoersHostListColon contained ':' nextgroup=sudoersHostAlias skipwhite skipnl syn cluster sudoersHostList contains=sudoersHostListComma,sudoersHostListColon syn match sudoersHostSpecComma contained ',' nextgroup=@sudoersHostInSpec skipwhite skipnl syn cluster sudoersHostSpec contains=sudoersHostSpecComma,sudoersSpecEquals syn match sudoersCmndAliasEquals contained '=' nextgroup=@sudoersCmndInList skipwhite skipnl syn match sudoersCmndListComma contained ',' nextgroup=@sudoersCmndInList skipwhite skipnl syn match sudoersCmndListColon contained ':' nextgroup=sudoersCmndAlias skipwhite skipnl syn cluster sudoersCmndList contains=sudoersCmndListComma,sudoersCmndListColon syn match sudoersCmndSpecComma contained ',' nextgroup=@sudoersCmndSpecList skipwhite skipnl syn match sudoersCmndSpecColon contained ':' nextgroup=@sudoersUserInSpec skipwhite skipnl syn cluster sudoersCmndSpec contains=sudoersCmndSpecComma,sudoersCmndSpecColon syn cluster sudoersUserInList contains=sudoersUserNegationInList,sudoersUserNameInList,sudoersUIDInList,sudoersGroupInList,sudoersUserNetgroupInList,sudoersUserAliasInList syn cluster sudoersHostInList contains=sudoersHostNegationInList,sudoersHostNameInList,sudoersIPAddrInList,sudoersNetworkInList,sudoersHostNetgroupInList,sudoersHostAliasInList syn cluster sudoersCmndInList contains=sudoersCmndNegationInList,sudoersCmndNameInList,sudoersCmndAliasInList syn cluster sudoersUser contains=sudoersUserNegation,sudoersUserName,sudoersUID,sudoersGroup,sudoersUserNetgroup,sudoersUserAliasRef syn cluster sudoersHost contains=sudoersHostNegation,sudoersHostName,sudoersIPAddr,sudoersNetwork,sudoersHostNetgroup,sudoersHostAliasRef syn cluster sudoersUserInSpec contains=sudoersUserNegationInSpec,sudoersUserNameInSpec,sudoersUIDInSpec,sudoersGroupInSpec,sudoersUserNetgroupInSpec,sudoersUserAliasInSpec syn cluster sudoersHostInSpec contains=sudoersHostNegationInSpec,sudoersHostNameInSpec,sudoersIPAddrInSpec,sudoersNetworkInSpec,sudoersHostNetgroupInSpec,sudoersHostAliasInSpec syn cluster sudoersUserInRunas contains=sudoersUserNegationInRunas,sudoersUserNameInRunas,sudoersUIDInRunas,sudoersGroupInRunas,sudoersUserNetgroupInRunas,sudoersUserAliasInRunas syn cluster sudoersCmndInSpec contains=sudoersCmndNegationInSpec,sudoersCmndNameInSpec,sudoersCmndAliasInSpec syn match sudoersUserNegationInList contained '!\+' nextgroup=@sudoersUserInList skipwhite skipnl syn match sudoersHostNegationInList contained '!\+' nextgroup=@sudoersHostInList skipwhite skipnl syn match sudoersCmndNegationInList contained '!\+' nextgroup=@sudoersCmndInList skipwhite skipnl syn match sudoersUserNegation contained '!\+' nextgroup=@sudoersUser skipwhite skipnl syn match sudoersHostNegation contained '!\+' nextgroup=@sudoersHost skipwhite skipnl syn match sudoersUserNegationInSpec contained '!\+' nextgroup=@sudoersUserInSpec skipwhite skipnl syn match sudoersHostNegationInSpec contained '!\+' nextgroup=@sudoersHostInSpec skipwhite skipnl syn match sudoersUserNegationInRunas contained '!\+' nextgroup=@sudoersUserInRunas skipwhite skipnl syn match sudoersCmndNegationInSpec contained '!\+' nextgroup=@sudoersCmndInSpec skipwhite skipnl syn match sudoersCommandArgs contained '[^[:space:],:=\\]\+\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=sudoersCommandArgs,@sudoersCmndList skipwhite syn match sudoersCommandEmpty contained '""' nextgroup=@sudoersCmndList skipwhite skipnl syn match sudoersCommandArgsInSpec contained '[^[:space:],:=\\]\+\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=sudoersCommandArgsInSpec,@sudoersCmndSpec skipwhite syn match sudoersCommandEmptyInSpec contained '""' nextgroup=@sudoersCmndSpec skipwhite skipnl syn keyword sudoersDefaultEntry Defaults nextgroup=sudoersDefaultTypeAt,sudoersDefaultTypeColon,sudoersDefaultTypeGreaterThan,@sudoersParameter skipwhite skipnl syn match sudoersDefaultTypeAt contained '@' nextgroup=@sudoersHost skipwhite skipnl syn match sudoersDefaultTypeColon contained ':' nextgroup=@sudoersUser skipwhite skipnl syn match sudoersDefaultTypeGreaterThan contained '>' nextgroup=@sudoersUser skipwhite skipnl " TODO: could also deal with special characters here syn match sudoersBooleanParameter contained '!' nextgroup=sudoersBooleanParameter skipwhite skipnl syn keyword sudoersBooleanParameter contained skipwhite skipnl \ always_set_home \ authenticate \ closefrom_override \ env_editor \ env_reset \ fqdn \ ignore_dot \ ignore_local_sudoers \ insults \ log_host \ log_year \ long_otp_prompt \ mail_always \ mail_badpass \ mail_no_host \ mail_no_perms \ mail_no_user \ noexec \ path_info \ passprompt_override \ preserve_groups \ requiretty \ root_sudo \ rootpw \ runaspw \ set_home \ set_logname \ setenv \ shell_noargs \ stay_setuid \ targetpw \ tty_tickets \ visiblepw syn keyword sudoersIntegerParameter contained \ nextgroup=sudoersIntegerParameterEquals \ skipwhite skipnl \ closefrom \ passwd_tries \ loglinelen \ passwd_timeout \ timestamp_timeout \ umask syn keyword sudoersStringParameter contained \ nextgroup=sudoersStringParameterEquals \ skipwhite skipnl \ badpass_message \ editor \ mailsub \ noexec_file \ passprompt \ runas_default \ syslog_badpri \ syslog_goodpri \ sudoers_locale \ timestampdir \ timestampowner \ askpass \ env_file \ exempt_group \ lecture \ lecture_file \ listpw \ logfile \ mailerflags \ mailerpath \ mailfrom \ mailto \ secure_path \ syslog \ verifypw syn keyword sudoersListParameter contained \ nextgroup=sudoersListParameterEquals \ skipwhite skipnl \ env_check \ env_delete \ env_keep syn match sudoersParameterListComma contained ',' nextgroup=@sudoersParameter skipwhite skipnl syn cluster sudoersParameter contains=sudoersBooleanParameter,sudoersIntegerParameter,sudoersStringParameter,sudoersListParameter syn match sudoersIntegerParameterEquals contained '[+-]\==' nextgroup=sudoersIntegerValue skipwhite skipnl syn match sudoersStringParameterEquals contained '[+-]\==' nextgroup=sudoersStringValue skipwhite skipnl syn match sudoersListParameterEquals contained '[+-]\==' nextgroup=sudoersListValue skipwhite skipnl syn match sudoersIntegerValue contained '\d\+' nextgroup=sudoersParameterListComma skipwhite skipnl syn match sudoersStringValue contained '[^[:space:],:=\\]*\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=sudoersParameterListComma skipwhite skipnl syn region sudoersStringValue contained start=+"+ skip=+\\"+ end=+"+ nextgroup=sudoersParameterListComma skipwhite skipnl syn match sudoersListValue contained '[^[:space:],:=\\]*\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=sudoersParameterListComma skipwhite skipnl syn region sudoersListValue contained start=+"+ skip=+\\"+ end=+"+ nextgroup=sudoersParameterListComma skipwhite skipnl syn match sudoersPASSWD contained '\%(NO\)\=PASSWD:' nextgroup=@sudoersCmndInSpec skipwhite hi def link sudoersSpecEquals Operator hi def link sudoersTodo Todo hi def link sudoersComment Comment hi def link sudoersAlias Keyword hi def link sudoersUserAlias Identifier hi def link sudoersUserNameInList String hi def link sudoersUIDInList Number hi def link sudoersGroupInList PreProc hi def link sudoersUserNetgroupInList PreProc hi def link sudoersUserAliasInList PreProc hi def link sudoersUserName String hi def link sudoersUID Number hi def link sudoersGroup PreProc hi def link sudoersUserNetgroup PreProc hi def link sudoersUserAliasRef PreProc hi def link sudoersUserNameInSpec String hi def link sudoersUIDInSpec Number hi def link sudoersGroupInSpec PreProc hi def link sudoersUserNetgroupInSpec PreProc hi def link sudoersUserAliasInSpec PreProc hi def link sudoersUserNameInRunas String hi def link sudoersUIDInRunas Number hi def link sudoersGroupInRunas PreProc hi def link sudoersUserNetgroupInRunas PreProc hi def link sudoersUserAliasInRunas PreProc hi def link sudoersHostAlias Identifier hi def link sudoersHostNameInList String hi def link sudoersIPAddrInList Number hi def link sudoersNetworkInList Number hi def link sudoersHostNetgroupInList PreProc hi def link sudoersHostAliasInList PreProc hi def link sudoersHostName String hi def link sudoersIPAddr Number hi def link sudoersNetwork Number hi def link sudoersHostNetgroup PreProc hi def link sudoersHostAliasRef PreProc hi def link sudoersHostNameInSpec String hi def link sudoersIPAddrInSpec Number hi def link sudoersNetworkInSpec Number hi def link sudoersHostNetgroupInSpec PreProc hi def link sudoersHostAliasInSpec PreProc hi def link sudoersCmndAlias Identifier hi def link sudoersCmndNameInList String hi def link sudoersCmndAliasInList PreProc hi def link sudoersCmndNameInSpec String hi def link sudoersCmndAliasInSpec PreProc hi def link sudoersUserAliasEquals Operator hi def link sudoersUserListComma Delimiter hi def link sudoersUserListColon Delimiter hi def link sudoersUserSpecComma Delimiter hi def link sudoersUserRunasBegin Delimiter hi def link sudoersUserRunasComma Delimiter hi def link sudoersUserRunasEnd Delimiter hi def link sudoersHostAliasEquals Operator hi def link sudoersHostListComma Delimiter hi def link sudoersHostListColon Delimiter hi def link sudoersHostSpecComma Delimiter hi def link sudoersCmndAliasEquals Operator hi def link sudoersCmndListComma Delimiter hi def link sudoersCmndListColon Delimiter hi def link sudoersCmndSpecComma Delimiter hi def link sudoersCmndSpecColon Delimiter hi def link sudoersUserNegationInList Operator hi def link sudoersHostNegationInList Operator hi def link sudoersCmndNegationInList Operator hi def link sudoersUserNegation Operator hi def link sudoersHostNegation Operator hi def link sudoersUserNegationInSpec Operator hi def link sudoersHostNegationInSpec Operator hi def link sudoersUserNegationInRunas Operator hi def link sudoersCmndNegationInSpec Operator hi def link sudoersCommandArgs String hi def link sudoersCommandEmpty Special hi def link sudoersDefaultEntry Keyword hi def link sudoersDefaultTypeAt Special hi def link sudoersDefaultTypeColon Special hi def link sudoersDefaultTypeGreaterThan Special hi def link sudoersBooleanParameter Identifier hi def link sudoersIntegerParameter Identifier hi def link sudoersStringParameter Identifier hi def link sudoersListParameter Identifier hi def link sudoersParameterListComma Delimiter hi def link sudoersIntegerParameterEquals Operator hi def link sudoersStringParameterEquals Operator hi def link sudoersListParameterEquals Operator hi def link sudoersIntegerValue Number hi def link sudoersStringValue String hi def link sudoersListValue String hi def link sudoersPASSWD Special let b:current_syntax = "sudoers" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/svg.vim000066400000000000000000000006641267703067000171300ustar00rootroot00000000000000" Vim syntax file " Language: SVG (Scalable Vector Graphics) " Maintainer: Vincent Berthoux " File Types: .svg (used in Web and vector programs) " " Directly call the xml syntax, because SVG is an XML " dialect. But as some plugins base their effect on filetype, " providing a distinct filetype from xml is better. if exists("b:current_syntax") finish endif runtime! syntax/xml.vim let b:current_syntax = "svg" vim-7.4.1689/runtime/syntax/svn.vim000066400000000000000000000042761267703067000171420ustar00rootroot00000000000000" Vim syntax file " Language: Subversion (svn) commit file " Maintainer: Dmitry Vasiliev " URL: https://github.com/hdima/vim-scripts/blob/master/syntax/svn.vim " Last Change: 2013-11-08 " Filenames: svn-commit*.tmp " Version: 1.10 " Contributors: " " List of the contributors in alphabetical order: " " A. S. Budden " Ingo Karkat " Myk Taylor " Stefano Zacchiroli " For version 5.x: Clear all syntax items. " 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 spell toplevel syn match svnFirstLine "\%^.*" nextgroup=svnRegion,svnBlank skipnl syn match svnSummary "^.\{0,50\}" contained containedin=svnFirstLine nextgroup=svnOverflow contains=@Spell syn match svnOverflow ".*" contained contains=@Spell syn match svnBlank "^.*" contained contains=@Spell syn region svnRegion end="\%$" matchgroup=svnDelimiter start="^--.*--$" contains=svnRemoved,svnRenamed,svnAdded,svnModified,svnProperty,@NoSpell syn match svnRemoved "^D .*$" contained contains=@NoSpell syn match svnRenamed "^R[ M][ U][ +] .*$" contained contains=@NoSpell syn match svnAdded "^A[ M][ U][ +] .*$" contained contains=@NoSpell syn match svnModified "^M[ M][ U] .*$" contained contains=@NoSpell syn match svnProperty "^_M[ U] .*$" contained contains=@NoSpell " Synchronization. syn sync clear syn sync match svnSync grouphere svnRegion "^--.*--$"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 else command -nargs=+ HiLink hi def link endif HiLink svnSummary Keyword HiLink svnBlank Error HiLink svnRegion Comment HiLink svnDelimiter NonText HiLink svnRemoved Constant HiLink svnAdded Identifier HiLink svnModified Special HiLink svnProperty Special HiLink svnRenamed Special delcommand HiLink endif let b:current_syntax = "svn" vim-7.4.1689/runtime/syntax/syncolor.vim000066400000000000000000000077751267703067000202130ustar00rootroot00000000000000" Vim syntax support file " Maintainer: Bram Moolenaar " 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 command -nargs=* SynLink hi link else if syntax_cmd == "enable" " ":syntax enable" keeps any existing colors command -nargs=* SynColor hi def command -nargs=* SynLink hi def link elseif syntax_cmd == "reset" " ":syntax reset" resets all colors to the default command -nargs=* SynColor hi command -nargs=* SynLink hi! link 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 vim-7.4.1689/runtime/syntax/synload.vim000066400000000000000000000036241267703067000200010ustar00rootroot00000000000000" Vim syntax support file " Maintainer: Bram Moolenaar " Last Change: 2012 Sep 25 " 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("") if s == "ON" " :set syntax=ON if &filetype == "" echohl ErrorMsg echo "filetype unknown" echohl None endif let s = &filetype elseif s == "OFF" let s = "" endif if s != "" " Load the syntax file(s). When there are several, separated by dots, " load each in sequence. for name in split(s, '\.') exe "runtime! syntax/" . name . ".vim syntax/" . name . "/*.vim" endfor endif endfun " Handle adding doxygen to other languages (C, C++, C#, IDL, java, php, DataScript) au Syntax c,cpp,cs,idl,java,php,datascript \ if (exists('b:load_doxygen_syntax') && b:load_doxygen_syntax) \ || (exists('g:load_doxygen_syntax') && g:load_doxygen_syntax) \ | runtime! syntax/doxygen.vim \ | endif " 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 vim-7.4.1689/runtime/syntax/syntax.vim000066400000000000000000000023141267703067000176510ustar00rootroot00000000000000" Vim syntax support file " Maintainer: Bram Moolenaar " 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 :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("") 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 vim-7.4.1689/runtime/syntax/sysctl.vim000066400000000000000000000021651267703067000176500ustar00rootroot00000000000000" Vim syntax file " Language: sysctl.conf(5) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2011-05-02 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn match sysctlBegin display '^' \ nextgroup=sysctlToken,sysctlComment skipwhite syn match sysctlToken contained display '[^=]\+' \ nextgroup=sysctlTokenEq skipwhite syn match sysctlTokenEq contained display '=' nextgroup=sysctlValue skipwhite syn region sysctlValue contained display oneline \ matchgroup=sysctlValue start='\S' \ matchgroup=Normal end='\s*$' syn keyword sysctlTodo contained TODO FIXME XXX NOTE syn region sysctlComment display oneline start='^\s*[#;]' end='$' \ contains=sysctlTodo,@Spell hi def link sysctlTodo Todo hi def link sysctlComment Comment hi def link sysctlToken Identifier hi def link sysctlTokenEq Operator hi def link sysctlValue String let b:current_syntax = "sysctl" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/systemd.vim000066400000000000000000000002701267703067000200120ustar00rootroot00000000000000" Vim syntax file " Language: systemd.unit(5) if !exists('b:current_syntax') " Looks a lot like dosini files. runtime! syntax/dosini.vim let b:current_syntax = 'systemd' endif vim-7.4.1689/runtime/syntax/systemverilog.vim000066400000000000000000000075601267703067000212470ustar00rootroot00000000000000" Vim syntax file " Language: SystemVerilog " Maintainer: kocha " Last Change: 12-Aug-2013. " For version 5.x: Clear all syntax items " 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 Verilog syntax files if version < 600 so :p:h/verilog.vim else runtime! syntax/verilog.vim unlet b:current_syntax endif " IEEE1800-2005 syn keyword systemverilogStatement always_comb always_ff always_latch syn keyword systemverilogStatement class endclass new syn keyword systemverilogStatement virtual local const protected syn keyword systemverilogStatement package endpackage syn keyword systemverilogStatement rand randc constraint randomize syn keyword systemverilogStatement with inside dist syn keyword systemverilogStatement sequence endsequence randsequence syn keyword systemverilogStatement srandom syn keyword systemverilogStatement logic bit byte syn keyword systemverilogStatement int longint shortint syn keyword systemverilogStatement struct packed syn keyword systemverilogStatement final syn keyword systemverilogStatement import export syn keyword systemverilogStatement context pure syn keyword systemverilogStatement void shortreal chandle string syn keyword systemverilogStatement clocking endclocking iff syn keyword systemverilogStatement interface endinterface modport syn keyword systemverilogStatement cover covergroup coverpoint endgroup syn keyword systemverilogStatement property endproperty syn keyword systemverilogStatement program endprogram syn keyword systemverilogStatement bins binsof illegal_bins ignore_bins syn keyword systemverilogStatement alias matches solve static assert syn keyword systemverilogStatement assume super before expect bind syn keyword systemverilogStatement extends null tagged extern this syn keyword systemverilogStatement first_match throughout timeprecision syn keyword systemverilogStatement timeunit type union syn keyword systemverilogStatement uwire var cross ref wait_order intersect syn keyword systemverilogStatement wildcard within syn keyword systemverilogTypeDef typedef enum syn keyword systemverilogConditional randcase syn keyword systemverilogConditional unique priority syn keyword systemverilogRepeat return break continue syn keyword systemverilogRepeat do foreach syn keyword systemverilogLabel join_any join_none forkjoin " IEEE1800-2009 add syn keyword systemverilogStatement checker endchecker syn keyword systemverilogStatement accept_on reject_on syn keyword systemverilogStatement sync_accept_on sync_reject_on syn keyword systemverilogStatement eventually nexttime until until_with syn keyword systemverilogStatement s_always s_eventually s_nexttime s_until s_until_with syn keyword systemverilogStatement let untyped syn keyword systemverilogStatement strong weak syn keyword systemverilogStatement restrict global implies syn keyword systemverilogConditional unique0 " IEEE1800-2012 add syn keyword systemverilogStatement implements syn keyword systemverilogStatement interconnect soft nettype " Define the default highlighting. if version >= 508 || !exists("did_systemverilog_syn_inits") if version < 508 let did_systemverilog_syn_inits = 1 command -nargs=+ HiLink hi link else command -nargs=+ HiLink hi def link endif " The default highlighting. HiLink systemverilogStatement Statement HiLink systemverilogTypeDef TypeDef HiLink systemverilogConditional Conditional HiLink systemverilogRepeat Repeat HiLink systemverilogLabel Label HiLink systemverilogGlobal Define HiLink systemverilogNumber Number delcommand HiLink endif let b:current_syntax = "systemverilog" " vim: ts=8 vim-7.4.1689/runtime/syntax/tads.vim000066400000000000000000000160141267703067000172600ustar00rootroot00000000000000" Vim syntax file " Language: TADS " Maintainer: Amir Karger " $Date: 2004/06/13 19:28:45 $ " $Revision: 1.1 $ " 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 "\[^/]*" contains=tadsObjectDef,tadsClass syn match tadsClass contained "\" 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/tags.vim000066400000000000000000000030261267703067000172620ustar00rootroot00000000000000" Language: tags " Maintainer: Charles E. Campbell " Last Change: Oct 23, 2014 " Version: 4 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_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 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/tak.vim000066400000000000000000000064241267703067000171100ustar00rootroot00000000000000" 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 :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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/takcmp.vim000066400000000000000000000037071267703067000176110ustar00rootroot00000000000000" 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/takout.vim000066400000000000000000000046231267703067000176370ustar00rootroot00000000000000" 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 :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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/tar.vim000066400000000000000000000005651267703067000171170ustar00rootroot00000000000000" Language : Tar Listing Syntax " Maintainer : Bram Moolenaar " Last change: Sep 08, 2004 if exists("b:current_syntax") finish endif syn match tarComment '^".*' contains=tarFilename syn match tarFilename 'tarfile \zs.*' contained syn match tarDirectory '.*/$' hi def link tarComment Comment hi def link tarFilename Constant hi def link tarDirectory Type " vim: ts=8 vim-7.4.1689/runtime/syntax/taskdata.vim000066400000000000000000000024271267703067000201240ustar00rootroot00000000000000" Vim syntax file " Language: task data " Maintainer: John Florian " Updated: Wed Jul 8 19:46:20 EDT 2009 " For version 5.x: Clear all syntax items. " 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:keepcpo= &cpo set cpo&vim " Key Names for values. syn keyword taskdataKey description due end entry imask mask parent syn keyword taskdataKey priority project recur start status tags uuid syn match taskdataKey "annotation_\d\+" syn match taskdataUndo "^time.*$" syn match taskdataUndo "^\(old \|new \|---\)" " Values associated with key names. " " Strings syn region taskdataString matchgroup=Normal start=+"+ end=+"+ \ contains=taskdataEncoded,taskdataUUID,@Spell " " Special Embedded Characters (e.g., ",") syn match taskdataEncoded "&\a\+;" contained " UUIDs syn match taskdataUUID "\x\{8}-\(\x\{4}-\)\{3}\x\{12}" contained " The default methods for highlighting. Can be overridden later. hi def link taskdataEncoded Function hi def link taskdataKey Statement hi def link taskdataString String hi def link taskdataUUID Special hi def link taskdataUndo Type let b:current_syntax = "taskdata" let &cpo = s:keepcpo unlet s:keepcpo " vim:noexpandtab vim-7.4.1689/runtime/syntax/taskedit.vim000066400000000000000000000023121267703067000201310ustar00rootroot00000000000000" Vim syntax file " Language: support for 'task 42 edit' " Maintainer: John Florian " Updated: Wed Jul 8 19:46:32 EDT 2009 " For version 5.x: Clear all syntax items. " 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:keepcpo= &cpo set cpo&vim syn match taskeditHeading "^\s*#\s*Name\s\+Editable details\s*$" contained syn match taskeditHeading "^\s*#\s*-\+\s\+-\+\s*$" contained syn match taskeditReadOnly "^\s*#\s*\(UU\)\?ID:.*$" contained syn match taskeditReadOnly "^\s*#\s*Status:.*$" contained syn match taskeditReadOnly "^\s*#\s*i\?Mask:.*$" contained syn match taskeditKey "^ *.\{-}:" nextgroup=taskeditString syn match taskeditComment "^\s*#.*$" \ contains=taskeditReadOnly,taskeditHeading syn match taskeditString ".*$" contained contains=@Spell " The default methods for highlighting. Can be overridden later. hi def link taskeditComment Comment hi def link taskeditHeading Function hi def link taskeditKey Statement hi def link taskeditReadOnly Special hi def link taskeditString String let b:current_syntax = "taskedit" let &cpo = s:keepcpo unlet s:keepcpo " vim:noexpandtab vim-7.4.1689/runtime/syntax/tasm.vim000066400000000000000000000136431267703067000172760ustar00rootroot00000000000000" Vim syntax file " Language: TASM: turbo assembler by Borland " Maintaner: FooLman of United Force " Last Change: 2012 Feb 03 by Thilo Six " For version 5.x: Clear all syntax items " 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:cpo_save = &cpo set cpo&vim 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 "\" 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 else command -nargs=+ HiLink hi def link 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" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/tcl.vim000066400000000000000000000423271267703067000171150ustar00rootroot00000000000000" Vim syntax file " Language: Tcl/Tk " Maintainer: Taylor Venable " (previously Brett Cannon ) " (previously Dean Copsey ) " (previously Matt Neumann ) " (previously Allan Kelly ) " Original: Robin Becker " Last Change: 2014-02-12 " Version: 1.14 " URL: http://bitbucket.org/taylor_venable/metasyntax/src/tip/Config/vim/syntax/tcl.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 " Basic Tcl commands: http://www.tcl.tk/man/tcl8.6/TclCmd/contents.htm syn keyword tclCommand after append array bgerror binary cd chan clock close concat syn keyword tclCommand dde dict encoding eof error eval exec exit expr fblocked syn keyword tclCommand fconfigure fcopy file fileevent flush format gets glob syn keyword tclCommand global history http incr info interp join lappend lassign syn keyword tclCommand lindex linsert list llength lmap load lrange lrepeat syn keyword tclCommand lreplace lreverse lsearch lset lsort memory my namespace syn keyword tclCommand next nextto open package pid puts pwd read refchan regexp syn keyword tclCommand registry regsub rename scan seek self set socket source syn keyword tclCommand split string subst tell time trace unknown unload unset syn keyword tclCommand update uplevel upvar variable vwait " The 'Tcl Standard Library' commands: http://www.tcl.tk/man/tcl8.6/TclCmd/library.htm syn keyword tclCommand auto_execok auto_import auto_load auto_mkindex auto_reset syn keyword tclCommand auto_qualify tcl_findLibrary parray tcl_endOfWord syn keyword tclCommand tcl_startOfNextWord tcl_startOfPreviousWord syn keyword tclCommand tcl_wordBreakAfter tcl_wordBreakBefore " Global variables used by Tcl: http://www.tcl.tk/man/tcl8.6/TclCmd/tclvars.htm syn keyword tclVars auto_path env errorCode errorInfo tcl_library tcl_patchLevel syn keyword tclVars tcl_pkgPath tcl_platform tcl_precision tcl_rcFileName syn keyword tclVars tcl_traceCompile tcl_traceExec tcl_wordchars syn keyword tclVars tcl_nonwordchars tcl_version argc argv argv0 tcl_interactive " Strings which expr accepts as boolean values, aside from zero / non-zero. syn keyword tclBoolean true false on off yes no syn keyword tclProcCommand apply coroutine proc return tailcall yield yieldto syn keyword tclConditional if then else elseif switch syn keyword tclConditional catch try throw finally syn keyword tclLabel default 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[[:alnum:]_]*" " ${...} may contain any character except '}' syn match tclVarRef "${[^}]*}" " Used to facilitate hack to utilize string background for certain color " schemes, e.g. inkpot and lettuce. syn cluster tclVarRefC add=tclVarRef syn cluster tclSpecialC add=tclSpecial " The syntactic unquote-splicing replacement for [expand]. syn match tclExpand '\s{\*}' syn match tclExpand '^{\*}' " 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="\" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef syn region tcltkWidget matchgroup=tcltkWidgetColor start="\" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef syn region tcltkWidget matchgroup=tcltkWidgetColor start="\" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef syn region tcltkWidget matchgroup=tcltkWidgetColor start="\" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef syn region tcltkWidget matchgroup=tcltkWidgetColor start="\" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef syn region tcltkWidget matchgroup=tcltkWidgetColor start="\" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef syn region tcltkWidget matchgroup=tcltkWidgetColor start="\" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef syn region tcltkWidget matchgroup=tcltkWidgetColor start="\" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef syn region tcltkWidget matchgroup=tcltkWidgetColor start="\" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef syn region tcltkWidget matchgroup=tcltkWidgetColor start="\" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef syn region tcltkWidget matchgroup=tcltkWidgetColor start="\" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef syn region tcltkWidget matchgroup=tcltkWidgetColor start="\" 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="^\" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tclString,tclNumber,tclVarRef,tcltkCommand syn region tcltkCommand matchgroup=tcltkCommandColor start="\s\\|\[\"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="^\" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef syn region tcltkWidget matchgroup=tcltkWidgetColor start="\s\\|\[\"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="^\" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef syn region tcltkWidget matchgroup=tcltkWidgetColor start="\s\\|\[\"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="^\" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidget,tcltkWidgetSwitch,tcltkSwitch,tclNumber,tclVarRef,tclString syn region tcltkWidget matchgroup=tcltkWidgetColor start="\s\\|\[\"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="\" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tcltkPackConfSwitch,tclNumber,tclVarRef keepend syn region tcltkPackConf matchgroup=tcltkPackConfColor start="\" 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="\" matchgroup=NONE skip="^\s*$" end="{\|}\|]\|\"\|[^\\]*\s*$"me=e-1 contains=tclLineContinue,tcltkNamespaceSwitch " EXPR " commands associated with expr syn keyword tcltkMaths contained abs acos asin atan atan2 bool ceil cos cosh double entier syn keyword tcltkMaths contained exp floor fmod hypot int isqrt log log10 max min pow rand syn keyword tcltkMaths contained round sin sinh sqrt srand tan tanh wide syn region tcltkCommand matchgroup=tcltkCommandColor start="\" 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="\" 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="\" 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="\" 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="\" 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="\" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkLsortSwitch,tclNumber,tclVarRef,tclString,tcltkCommand syn keyword tclTodo contained TODO " Sequences which are backslash-escaped: http://www.tcl.tk/man/tcl8.5/TclCmd/Tcl.htm#M16 " Octal, hexadecimal, unicode codepoints, and the classics. " Tcl takes as many valid characters in a row as it can, so \xAZ in a string is newline followed by 'Z'. syn match tclSpecial contained '\\\([0-7]\{1,3}\|x\x\{1,2}\|u\x\{1,4}\|[abfnrtv]\)' syn match tclSpecial contained '\\[\[\]\{\}\"\$]' " Command appearing inside another command or inside a string. syn region tclEmbeddedStatement start='\[' end='\]' contained contains=tclCommand,tclNumber,tclLineContinue,tclString,tclVarRef,tclEmbeddedStatement " A string needs the skip argument as it may legitimately contain \". " Match at start of line syn region tclString start=+^"+ end=+"+ contains=@tclSpecialC skip=+\\\\\|\\"+ "Match all other legal strings. syn region tclString start=+[^\\]"+ms=s+1 end=+"+ contains=@tclSpecialC,@tclVarRefC,tclEmbeddedStatement skip=+\\\\\|\\"+ " Line continuation is backslash immediately followed by newline. syn match tclLineContinue '\\$' if exists('g:tcl_warn_continuation') syn match tclNotLineContinue '\\\s\+$' endif "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 match tclComment /^\s*\#.*$/ "syn match tclComment /;\s*\#.*$/hs=s+1 "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 else command -nargs=+ HiLink hi def link endif HiLink tcltkSwitch Special HiLink tclExpand Special HiLink tclLabel Label HiLink tclConditional Conditional HiLink tclRepeat Repeat HiLink tclNumber Number HiLink tclError Error HiLink tclCommand Statement HiLink tclProcCommand Type 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 if exists('g:tcl_warn_continuation') HiLink tclNotLineContinue ErrorMsg endif 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 tclVarRef Identifier delcommand HiLink endif let b:current_syntax = "tcl" " vim: ts=8 noet nolist vim-7.4.1689/runtime/syntax/tcsh.vim000066400000000000000000000317251267703067000172740ustar00rootroot00000000000000" tcsh.vim: Vim syntax file for tcsh scripts " Maintainer: Gautam Iyer " Modified: Thu 17 Dec 2009 06:05:07 PM EST " " 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 let s:oldcpo = &cpo set cpo&vim " Line continuation is used setlocal iskeyword+=- syn case match " ----- Clusters ----- syn cluster tcshModifiers contains=tcshModifier,tcshModifierError syn cluster tcshQuoteList contains=tcshDQuote,tcshSQuote,tcshBQuote syn cluster tcshStatementEnds contains=@tcshQuoteList,tcshComment,@tcshVarList,tcshRedir,tcshMeta,tcshHereDoc,tcshSpecial,tcshArguement syn cluster tcshStatements contains=tcshBuiltin,tcshCommands,tcshIf,tcshWhile syn cluster tcshVarList contains=tcshUsrVar,tcshArgv,tcshSubst syn cluster tcshConditions contains=tcshCmdSubst,tcshParenExpr,tcshOperator,tcshNumber,@tcshVarList " ----- Errors ----- " Define first, so can be easily overridden. syn match tcshError contained '\v\S.+' " ----- 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 those treated specially. Currently (un)set(env), " (un)alias, if, while, else, bindkey syn keyword tcshBuiltin nextgroup=tcshStatementEnd alloc bg 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 built-in / command till the lexical end of a " statement (;, |, ||, |&, && or end of line) syn region tcshStatementEnd transparent contained matchgroup=tcshBuiltin start='' end='\v\\@|$' contains=@tcshConditions,tcshSpecial,@tcshStatementEnds syn region tcshIfEnd contained matchgroup=tcshBuiltin contains=@tcshConditions,tcshSpecial start='(' end='\v\)%(\s+then>)?' skipwhite nextgroup=@tcshStatementEnds syn region tcshIfEnd contained matchgroup=tcshBuiltin contains=tcshCommands,tcshSpecial start='\v\{\s+' end='\v\s+\}%(\s+then>)?' skipwhite nextgroup=@tcshStatementEnds keepend " else statements syn keyword tcshBuiltin nextgroup=tcshIf skipwhite else " while statements (contains expressions / operators) syn keyword tcshBuiltin nextgroup=@tcshConditions,tcshSpecial skipwhite while " Conditions (for if and while) syn region tcshParenExpr contained contains=@tcshConditions,tcshSpecial matchgroup=tcshBuiltin start='(' end=')' syn region tcshCmdSubst contained contains=tcshCommands matchgroup=tcshBuiltin start='\v\{\s+' end='\v\s+\}' keepend " Bindkey. Internal editor functions syn keyword tcshBindkeyFuncs contained backward-char backward-delete-char \ backward-delete-word backward-kill-line backward-word \ beginning-of-line capitalize-word change-case \ change-till-end-of-line clear-screen complete-word \ complete-word-fwd complete-word-back complete-word-raw \ copy-prev-word copy-region-as-kill dabbrev-expand delete-char \ delete-char-or-eof delete-char-or-list \ delete-char-or-list-or-eof delete-word digit digit-argument \ down-history downcase-word end-of-file end-of-line \ exchange-point-and-mark expand-glob expand-history expand-line \ expand-variables forward-char forward-word \ gosmacs-transpose-chars history-search-backward \ history-search-forward insert-last-word i-search-fwd \ i-search-back keyboard-quit kill-line kill-region \ kill-whole-line list-choices list-choices-raw list-glob \ list-or-eof load-average magic-space newline normalize-path \ normalize-command overwrite-mode prefix-meta quoted-insert \ redisplay run-fg-editor run-help self-insert-command \ sequence-lead-in set-mark-command spell-word spell-line \ stuff-char toggle-literal-history transpose-chars \ transpose-gosling tty-dsusp tty-flush-output tty-sigintr \ tty-sigquit tty-sigtsusp tty-start-output tty-stop-output \ undefined-key universal-argument up-history upcase-word \ vi-beginning-of-next-word vi-add vi-add-at-eol vi-chg-case \ vi-chg-meta vi-chg-to-eol vi-cmd-mode vi-cmd-mode-complete \ vi-delprev vi-delmeta vi-endword vi-eword vi-char-back \ vi-char-fwd vi-charto-back vi-charto-fwd vi-insert \ vi-insert-at-bol vi-repeat-char-fwd vi-repeat-char-back \ vi-repeat-search-fwd vi-repeat-search-back vi-replace-char \ vi-replace-mode vi-search-back vi-search-fwd vi-substitute-char \ vi-substitute-line vi-word-back vi-word-fwd vi-undo vi-zero \ which-command yank yank-pop e_copy_to_clipboard \ e_paste_from_clipboard e_dosify_next e_dosify_prev e_page_up \ e_page_down syn keyword tcshBuiltin nextgroup=tcshBindkeyEnd bindkey syn region tcshBindkeyEnd contained transparent matchgroup=tcshBuiltin start='' skip='\\$' end='$' contains=@tcshQuoteList,tcshComment,@tcshVarList,tcshMeta,tcshSpecial,tcshArguement,tcshBindkeyFuncs " 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=@tcshConditions syn match tcshExprEnd contained '\v.{-};'hs=e contains=@tcshConditions " ----- Comments: ----- syn match tcshComment '#\s.*' contains=tcshTodo,tcshCommentTi,@Spell syn match tcshComment '\v#($|\S.*)' contains=tcshTodo,tcshCommentTi syn match tcshSharpBang '^#! .*$' syn match tcshCommentTi contained '\v#\s*\u\w*(\s+\u\w*)*:'hs=s+1 contains=tcshTodo syn match tcshTodo contained '\v\c' " ----- 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\\@, >>, >>&, >>!, >>&!] syn match tcshRedir contained '\v\<|\>\>?\&?!?' " Meta-chars syn match tcshMeta contained '\v[]{}*?[]' " Here documents (<<) syn region tcshHereDoc contained matchgroup=tcshShellVar start='\v\<\<\s*\z(\h\w*)' end='^\z1$' contains=@tcshVarList,tcshSpecial syn region tcshHereDoc contained matchgroup=tcshShellVar 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+>' " Arguments syn match tcshArguement contained '\v\s@<=-(\w|-)*' " Special characters. \xxx, or backslashed characters. "syn match tcshSpecial contained '\v\\@" syn match ttlNumber "\%(\<\d\+\|\$\x\+\)\>" syn match ttlString "'[^']*'" contains=@Spell syn match ttlString '"[^"]*"' contains=@Spell syn cluster ttlConstant contains=ttlCharacter,ttlNumber,ttlString syn match ttlLabel ":\s*\w\{1,32}\>" syn keyword ttlOperator and or xor not syn match ttlVar "\" syn match ttlVar "\" syn keyword ttlVar inputstr matchstr paramcnt result timeout mtimeout syn match ttlLine nextgroup=ttlStatement "^" syn match ttlStatement contained "\s*" \ nextgroup=ttlIf,ttlElseIf,ttlConditional,ttlRepeat, \ ttlFirstComment,ttlComment,ttlLabel,@ttlCommand syn cluster ttlCommand contains=ttlControlCommand,ttlCommunicationCommand, \ ttlStringCommand,ttlFileCommand,ttlPasswordCommand, \ ttlMiscCommand syn keyword ttlIf contained nextgroup=ttlIfExpression if syn keyword ttlElseIf contained nextgroup=ttlElseIfExpression elseif syn match ttlIfExpression contained "\s.*" \ contains=@ttlConstant,ttlVar,ttlOperator,ttlComment,ttlThen, \ @ttlCommand syn match ttlElseIfExpression contained "\s.*" \ contains=@ttlConstant,ttlVar,ttlOperator,ttlComment,ttlThen syn keyword ttlThen contained then syn keyword ttlConditional contained else endif syn keyword ttlRepeat contained for next until enduntil while endwhile syn match ttlRepeat contained \ "\<\%(do\|loop\)\%(\s\+\%(while\|until\)\)\?\>" syn keyword ttlControlCommand contained \ break call continue end execcmnd exit goto include \ mpause pause return syn keyword ttlCommunicationCommand contained \ bplusrecv bplussend callmenu changedir clearscreen \ closett connect cygconnect disconnect dispstr \ enablekeyb flushrecv gethostname getmodemstatus \ gettitle kmtfinish kmtget kmtrecv kmtsend loadkeymap \ logautoclosemode logclose loginfo logopen logpause \ logrotate logstart logwrite quickvanrecv \ quickvansend recvln restoresetup scprecv scpsend \ send sendbreak sendbroadcast sendfile sendkcode \ sendln sendlnbroadcast sendmulticast setbaud \ setdebug setdtr setecho setmulticastname setrts \ setsync settitle showtt testlink unlink wait \ wait4all waitevent waitln waitn waitrecv waitregex \ xmodemrecv xmodemsend ymodemrecv ymodemsend \ zmodemrecv zmodemsend syn keyword ttlStringCommand contained \ code2str expandenv int2str regexoption sprintf \ sprintf2 str2code str2int strcompare strconcat \ strcopy strinsert strjoin strlen strmatch strremove \ strreplace strscan strspecial strsplit strtrim \ tolower toupper syn keyword ttlFileCommand contained \ basename dirname fileclose fileconcat filecopy \ filecreate filedelete filelock filemarkptr fileopen \ filereadln fileread filerename filesearch fileseek \ fileseekback filestat filestrseek filestrseek2 \ filetruncate fileunlock filewrite filewriteln \ findfirst findnext findclose foldercreate \ folderdelete foldersearch getdir getfileattr makepath \ setdir setfileattr syn keyword ttlPasswordCommand contained \ delpassword getpassword ispassword passwordbox \ setpassword syn keyword ttlMiscCommand contained \ beep bringupbox checksum8 checksum8file checksum16 \ checksum16file checksum32 checksum32file closesbox \ clipb2var crc16 crc16file crc32 crc32file exec \ dirnamebox filenamebox getdate getenv getipv4addr \ getipv6addr getspecialfolder gettime getttdir getver \ ifdefined inputbox intdim listbox messagebox random \ rotateleft rotateright setdate setdlgpos setenv \ setexitcode settime show statusbox strdim uptime \ var2clipb yesnobox hi def link ttlCharacter Character hi def link ttlNumber Number hi def link ttlComment Comment hi def link ttlFirstComment Comment hi def link ttlString String hi def link ttlLabel Label hi def link ttlIf Conditional hi def link ttlElseIf Conditional hi def link ttlThen Conditional hi def link ttlConditional Conditional hi def link ttlRepeat Repeat hi def link ttlControlCommand Keyword hi def link ttlVar Identifier hi def link ttlOperator Operator hi def link ttlCommunicationCommand Keyword hi def link ttlStringCommand Keyword hi def link ttlFileCommand Keyword hi def link ttlPasswordCommand Keyword hi def link ttlMiscCommand Keyword let b:current_syntax = "teraterm" let &cpo = s:save_cpo unlet s:save_cpo " vim: ts=8 sw=2 sts=2 vim-7.4.1689/runtime/syntax/terminfo.vim000066400000000000000000000112671267703067000201550ustar00rootroot00000000000000" Vim syntax file " Language: terminfo(5) definition " Maintainer: Nikolai Weibull " Latest Revision: 2006-04-19 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn match terminfoKeywords '[,=#|]' syn keyword terminfoTodo contained TODO FIXME XXX NOTE syn region terminfoComment display oneline start='^#' end='$' \ contains=terminfoTodo,@Spell syn match terminfoNumbers '\<[0-9]\+\>' syn match terminfoSpecialChar '\\\(\o\{3}\|[Eenlrtbfs^\,:0]\)' syn match terminfoSpecialChar '\^\a' syn match terminfoDelay '$<[0-9]\+>' syn keyword terminfoBooleans bw am bce ccc xhp xhpa cpix crxw xt xenl eo gn \ hc chts km daisy hs hls in lpix da db mir \ msgr nxon xsb npc ndscr nrrmc os mc5i xcpa \ sam eslok hz ul xon syn keyword terminfoNumerics cols it lh lw lines lm xmc ma colors pairs wnum \ ncv nlab pb vt wsl bitwin bitype bufsz btns \ spinh spinv maddr mjump mcs npins orc orhi \ orl orvi cps widcs syn keyword terminfoStrings acsc cbt bel cr cpi lpi chr cvr csr rmp tbc mgc \ clear el1 el ed hpa cmdch cwin cup cud1 home \ civis cub1 mrcup cnorm cuf1 ll cuu1 cvvis \ defc dch1 dl1 dial dsl dclk hd enacs smacs \ smam blink bold smcup smdc dim swidm sdrfq \ smir sitm slm smicm snlq snrmq prot rev \ invis sshm smso ssubm ssupm smul sum smxon \ ech rmacs rmam sgr0 rmcup rmdc rwidm rmir \ ritm rlm rmicm rshm rmso rsubm rsupm rmul \ rum rmxon pause hook flash ff fsl wingo hup \ is1 is2 is3 if iprog initc initp ich1 il1 ip \ ka1 ka3 kb2 kbs kbeg kcbt kc1 kc3 kcan ktbc \ kclr kclo kcmd kcpy kcrt kctab kdch1 kdl1 \ kcud1 krmir kend kent kel ked kext kfnd khlp \ khome kich1 kil1 kcub1 kll kmrk kmsg kmov \ knxt knp kopn kopt kpp kprv kprt krdo kref \ krfr krpl krst kres kcuf1 ksav kBEG kCAN \ kCMD kCPY kCRT kDC kDL kslt kEND kEOL kEXT \ kind kFND kHLP kHOM kIC kLFT kMSG kMOV kNXT \ kOPT kPRV kPRT kri kRDO kRPL kRIT kRES kSAV \ kSPD khts kUND kspd kund kcuu1 rmkx smkx \ lf0 lf1 lf10 lf2 lf3 lf4 lf5 lf6 lf7 lf8 lf9 \ fln rmln smln rmm smm mhpa mcud1 mcub1 mcuf1 \ mvpa mcuu1 nel porder oc op pad dch dl cud \ mcud ich indn il cub mcub cuf mcuf rin cuu \ mccu pfkey pfloc pfx pln mc0 mc5p mc4 mc5 \ pulse qdial rmclk rep rfi rs1 rs2 rs3 rf rc \ vpa sc ind ri scs sgr setbsmgb smgbp sclk \ scp setb setf smgl smglp smgr smgrp hts smgt \ smgtp wind sbim scsd rbim rcsd subcs supcs \ ht docr tsl tone uc hu u0 u1 u2 u3 u4 u5 u6 \ u7 u8 u9 wait xoffc xonc zerom scesa bicr \ binel birep csnm csin colornm defbi devt \ dispc endbi smpch smsc rmpch rmsc getm kmous \ minfo pctrm pfxl reqmp scesc s0ds s1ds s2ds \ s3ds setab setaf setcolor smglr slines smgtb \ ehhlm elhlm erhlm ethlm evhlm sgr1 slengthsL syn match terminfoStrings display '\' 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]\)" hi def link terminfoComment Comment hi def link terminfoTodo Todo hi def link terminfoNumbers Number hi def link terminfoSpecialChar SpecialChar hi def link terminfoDelay Special hi def link terminfoBooleans Type hi def link terminfoNumerics Type hi def link terminfoStrings Type hi def link terminfoParameters Keyword hi def link terminfoKeywords Keyword let b:current_syntax = "terminfo" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/tex.vim000066400000000000000000001702211267703067000171260ustar00rootroot00000000000000" Vim syntax file " Language: TeX " Maintainer: Charles E. Campbell " Last Change: Mar 07, 2016 " Version: 93 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_TEX " " 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 " " 6. Please see :help latex-syntax for information on " syntax folding :help tex-folding " spell checking :help tex-nospell " commands and mathzones :help tex-runon " new command highlighting :help tex-morecommands " error highlighting :help tex-error " new math groups :help tex-math " new styles :help tex-style " using conceal mode :help tex-conceal " 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 let s:keepcpo= &cpo set cpo&vim scriptencoding utf-8 " 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 else command -nargs=+ HiLink hi def link endif endif " by default, enable all region-based highlighting let s:tex_fast= "bcmMprsSvV" if exists("g:tex_fast") if type(g:tex_fast) != 1 " g:tex_fast exists and is not a string, so " turn off all optional region-based highighting let s:tex_fast= "" else let s:tex_fast= g:tex_fast endif endif " let user determine which classes of concealment will be supported " a=accents/ligatures d=delimiters m=math symbols g=Greek s=superscripts/subscripts if !exists("g:tex_conceal") let s:tex_conceal= 'abdmgsS' else let s:tex_conceal= g:tex_conceal endif if !exists("g:tex_superscripts") let g:tex_superscripts= "[0-9a-zA-W.,:;+-<>/()=]" endif if !exists("g:tex_subscripts") let g:tex_subscripts= "[0-9aehijklmnoprstuvx,+-/().]" endif " Determine whether or not to use "*.sty" mode {{{1 " 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 s:extfname=expand("%:e") if exists("g:tex_stylish") let b:tex_stylish= g:tex_stylish elseif !exists("b:tex_stylish") if s:extfname == "sty" || s:extfname == "cls" || s:extfname == "clo" || s:extfname == "dtx" || s:extfname == "ltx" let b:tex_stylish= 1 else let b:tex_stylish= 0 endif endif " handle folding {{{1 if !exists("g:tex_fold_enabled") let s:tex_fold_enabled= 0 elseif g:tex_fold_enabled && !has("folding") let s:tex_fold_enabled= 0 echomsg "Ignoring g:tex_fold_enabled=".g:tex_fold_enabled."; need to re-compile vim for +fold support" else let s:tex_fold_enabled= 1 endif if s:tex_fold_enabled && &fdm == "manual" setl fdm=syntax endif if s:tex_fold_enabled && has("folding") com! -nargs=* TexFold fold else com! -nargs=* TexFold endif " (La)TeX keywords: uses the characters 0-9,a-z,A-Z,192-255 only... {{{1 " but _ is the only one that causes problems. " One may override this iskeyword setting by providing " g:tex_isk if exists("g:tex_isk") exe "setlocal isk=".g:tex_isk elseif !has("patch-7.4.1141") setl isk=48-57,a-z,A-Z,192-255 else syn iskeyword 48-57,a-z,A-Z,192-255 endif if b:tex_stylish setlocal isk+=@-@ endif if exists("g:tex_no_error") && g:tex_no_error let s:tex_no_error= 1 else let s:tex_no_error= 0 endif if exists("g:tex_comment_nospell") && g:tex_comment_nospell let s:tex_comment_nospell= 1 else let s:tex_comment_nospell= 0 endif if exists("g:tex_nospell") && g:tex_nospell let s:tex_nospell = 1 else let s:tex_nospell = 0 endif " Clusters: {{{1 " -------- syn cluster texCmdGroup contains=texCmdBody,texComment,texDefParm,texDelimiter,texDocType,texInput,texLength,texLigature,texMathDelim,texMathOper,texNewCmd,texNewEnv,texRefZone,texSection,texBeginEnd,texBeginEndName,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle if !s:tex_no_error syn cluster texCmdGroup add=texMathError endif syn cluster texEnvGroup contains=texMatcher,texMathDelim,texSpecialChar,texStatement syn cluster texFoldGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texInputFile,texLength,texLigature,texMatcher,texMathZoneV,texMathZoneW,texMathZoneX,texMathZoneY,texMathZoneZ,texNewCmd,texNewEnv,texOnlyMath,texOption,texParen,texRefZone,texSection,texBeginEnd,texSectionZone,texSpaceCode,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,@texMathZones,texTitle,texAbstract,texBoldStyle,texItalStyle,texNoSpell syn cluster texBoldGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texInputFile,texLength,texLigature,texMatcher,texMathZoneV,texMathZoneW,texMathZoneX,texMathZoneY,texMathZoneZ,texNewCmd,texNewEnv,texOnlyMath,texOption,texParen,texRefZone,texSection,texBeginEnd,texSectionZone,texSpaceCode,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,@texMathZones,texTitle,texAbstract,texBoldStyle,texBoldItalStyle,texNoSpell syn cluster texItalGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texInputFile,texLength,texLigature,texMatcher,texMathZoneV,texMathZoneW,texMathZoneX,texMathZoneY,texMathZoneZ,texNewCmd,texNewEnv,texOnlyMath,texOption,texParen,texRefZone,texSection,texBeginEnd,texSectionZone,texSpaceCode,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,@texMathZones,texTitle,texAbstract,texItalStyle,texItalBoldStyle,texNoSpell if !s:tex_nospell 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,@Spell syn cluster texStyleGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,texInputFile,texOption,texStyleStatement,@Spell,texStyleMatcher else 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 syn cluster texStyleGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,texInputFile,texOption,texStyleStatement,texStyleMatcher endif syn cluster texPreambleMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcher,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTitle,texTypeSize,texTypeStyle,texZone,texInputFile,texOption,texMathZoneZ syn cluster texRefGroup contains=texMatcher,texComment,texDelimiter if !exists("g:tex_no_math") syn cluster texPreambleMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcher,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTitle,texTypeSize,texTypeStyle,texZone,texInputFile,texOption,texMathZoneZ 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,texMathSymbol,texMathText,texRefZone,texSpecialChar,texStatement,texTypeSize,texTypeStyle if !s:tex_no_error syn cluster texMathMatchGroup add=texMathError syn cluster texMathZoneGroup add=texMathError endif syn cluster texMathZoneGroup add=@NoSpell " following used in the \part \chapter \section \subsection \subsubsection " \paragraph \subparagraph \author \title highlighting syn cluster texDocGroup contains=texPartZone,@texPartGroup syn cluster texPartGroup contains=texChapterZone,texSectionZone,texParaZone syn cluster texChapterGroup contains=texSectionZone,texParaZone syn cluster texSectionGroup contains=texSubSectionZone,texParaZone syn cluster texSubSectionGroup contains=texSubSubSectionZone,texParaZone syn cluster texSubSubSectionGroup contains=texParaZone syn cluster texParaGroup contains=texSubParaZone if has("conceal") && &enc == 'utf-8' syn cluster texMathZoneGroup add=texGreek,texSuperscript,texSubscript,texMathSymbol syn cluster texMathMatchGroup add=texGreek,texSuperscript,texSubscript,texMathSymbol endif endif " Try to flag {} and () mismatches: {{{1 if s:tex_fast =~# 'm' if !s:tex_no_error syn region texMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" transparent contains=@texMatchGroup,texError syn region texMatcher matchgroup=Delimiter start="\[" end="]" transparent contains=@texMatchGroup,texError,@NoSpell else syn region texMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" transparent contains=@texMatchGroup syn region texMatcher matchgroup=Delimiter start="\[" end="]" transparent contains=@texMatchGroup endif if !s:tex_nospell syn region texParen start="(" end=")" transparent contains=@texMatchGroup,@Spell else syn region texParen start="(" end=")" transparent contains=@texMatchGroup endif endif if !s:tex_no_error syn match texError "[}\])]" endif if s:tex_fast =~# 'M' if !exists("g:tex_no_math") if !s:tex_no_error syn match texMathError "}" contained endif syn region texMathMatcher matchgroup=Delimiter start="{" skip="\%(\\\\\)*\\}" end="}" end="%stopzone\>" contained contains=@texMathMatchGroup endif 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 !s: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 texBeginEnd "\\begin\>\|\\end\>" nextgroup=texBeginEndName if s:tex_fast =~# 'm' syn region texBeginEndName matchgroup=Delimiter start="{" end="}" contained nextgroup=texBeginEndModifier contains=texComment syn region texBeginEndModifier matchgroup=Delimiter start="\[" end="]" contained contains=texComment,@NoSpell endif " \documentclass, \documentstyle, \usepackage: {{{1 syn match texDocType "\\documentclass\>\|\\documentstyle\>\|\\usepackage\>" nextgroup=texBeginEndName,texDocTypeArgs if s:tex_fast =~# 'm' syn region texDocTypeArgs matchgroup=Delimiter start="\[" end="]" contained nextgroup=texBeginEndName contains=texComment,@NoSpell endif " Preamble syntax-based folding support: {{{1 if s:tex_fold_enabled && has("folding") syn region texPreamble transparent fold start='\zs\\documentclass\>' end='\ze\\begin{document}' contains=texStyle,@texPreambleMatchGroup endif " 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,texInputFileOpt syn match texInputFile "\\\(epsfig\|input\|usepackage\)\s*\(\[.*\]\)\={.\{-}}" contains=texStatement,texInputCurlies,texInputFileOpt syn match texInputCurlies "[{}]" contained if s:tex_fast =~# 'm' syn region texInputFileOpt matchgroup=Delimiter start="\[" end="\]" contained contains=texComment endif " 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 if s:tex_conceal !~# 'b' syn match texTypeStyle "\\textbf\>" syn match texTypeStyle "\\textit\>" endif 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 if s:tex_fast =~# 'p' if !s:tex_nospell TexFold syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' contains=@texFoldGroup,@texDocGroup,@Spell TexFold syn region texPartZone matchgroup=texSection start='\\part\>' end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texPartGroup,@Spell TexFold syn region texChapterZone matchgroup=texSection start='\\chapter\>' end='\ze\s*\\\%(chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texChapterGroup,@Spell TexFold syn region texSectionZone matchgroup=texSection start='\\section\>' end='\ze\s*\\\%(section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSectionGroup,@Spell TexFold syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSectionGroup,@Spell TexFold syn region texSubSubSectionZone matchgroup=texSection start='\\subsubsection\>' end='\ze\s*\\\%(\%(sub\)\{,2}section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSubSectionGroup,@Spell TexFold syn region texParaZone matchgroup=texSection start='\\paragraph\>' end='\ze\s*\\\%(paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texParaGroup,@Spell TexFold syn region texSubParaZone matchgroup=texSection start='\\subparagraph\>' end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@Spell TexFold syn region texTitle matchgroup=texSection start='\\\%(author\|title\)\>\s*{' end='}' contains=@texFoldGroup,@Spell TexFold syn region texAbstract matchgroup=texSection start='\\begin\s*{\s*abstract\s*}' end='\\end\s*{\s*abstract\s*}' contains=@texFoldGroup,@Spell else TexFold syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' contains=@texFoldGroup,@texDocGroup TexFold syn region texPartZone matchgroup=texSection start='\\part\>' end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texPartGroup TexFold syn region texChapterZone matchgroup=texSection start='\\chapter\>' end='\ze\s*\\\%(chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texChapterGroup TexFold syn region texSectionZone matchgroup=texSection start='\\section\>' end='\ze\s*\\\%(section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSectionGroup TexFold syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSectionGroup TexFold syn region texSubSubSectionZone matchgroup=texSection start='\\subsubsection\>' end='\ze\s*\\\%(\%(sub\)\{,2}section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSubSectionGroup TexFold syn region texParaZone matchgroup=texSection start='\\paragraph\>' end='\ze\s*\\\%(paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texParaGroup TexFold syn region texSubParaZone matchgroup=texSection start='\\subparagraph\>' end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup TexFold syn region texTitle matchgroup=texSection start='\\\%(author\|title\)\>\s*{' end='}' contains=@texFoldGroup TexFold syn region texAbstract matchgroup=texSection start='\\begin\s*{\s*abstract\s*}' end='\\end\s*{\s*abstract\s*}' contains=@texFoldGroup endif endif " particular support for bold and italic {{{1 if s:tex_fast =~# 'b' if s:tex_conceal =~# 'b' if !exists("g:tex_nospell") || !g:tex_nospell syn region texBoldStyle matchgroup=texTypeStyle start="\\textbf\s*{" matchgroup=texTypeStyle end="}" concealends contains=@texBoldGroup,@Spell syn region texBoldItalStyle matchgroup=texTypeStyle start="\\textit\s*{" matchgroup=texTypeStyle end="}" concealends contains=@texItalGroup,@Spell syn region texItalStyle matchgroup=texTypeStyle start="\\textit\s*{" matchgroup=texTypeStyle end="}" concealends contains=@texItalGroup,@Spell syn region texItalBoldStyle matchgroup=texTypeStyle start="\\textbf\s*{" matchgroup=texTypeStyle end="}" concealends contains=@texBoldGroup,@Spell else syn region texBoldStyle matchgroup=texTypeStyle start="\\textbf\s*{" matchgroup=texTypeStyle end="}" concealends contains=@texBoldGroup syn region texBoldItalStyle matchgroup=texTypeStyle start="\\textit\s*{" matchgroup=texTypeStyle end="}" concealends contains=@texItalGroup syn region texItalStyle matchgroup=texTypeStyle start="\\textit\s*{" matchgroup=texTypeStyle end="}" concealends contains=@texItalGroup syn region texItalBoldStyle matchgroup=texTypeStyle start="\\textbf\s*{" matchgroup=texTypeStyle end="}" concealends contains=@texBoldGroup endif endif endif " Bad Math (mismatched): {{{1 if !exists("g:tex_no_math") && !s:tex_no_error 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("g:tex_no_math") " TexNewMathZone: function 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 if s:tex_fold_enabled let foldcmd= " fold" else let foldcmd= "" endif exe "syn cluster texMathZones add=".grpname if s:tex_fast =~# 'M' exe 'syn region '.grpname.' start='."'".'\\begin\s*{\s*'.a:mathzone.'\s*}'."'".' end='."'".'\\end\s*{\s*'.a:mathzone.'\s*}'."'".' keepend contains=@texMathZoneGroup'.foldcmd 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*}"' endif exe 'hi def link '.grpname.' texMath' if a:starform let grpname = "texMathZone".a:sfx.'S' let syncname = "texSyncMathZone".a:sfx.'S' exe "syn cluster texMathZones add=".grpname if s:tex_fast =~# 'M' exe 'syn region '.grpname.' start='."'".'\\begin\s*{\s*'.a:mathzone.'\*\s*}'."'".' end='."'".'\\end\s*{\s*'.a:mathzone.'\*\s*}'."'".' keepend contains=@texMathZoneGroup'.foldcmd 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*}"' endif exe 'hi def link '.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 if s:tex_fast =~# 'M' if has("conceal") && &enc == 'utf-8' && s:tex_conceal =~# 'd' syn region texMathZoneV matchgroup=Delimiter start="\\(" matchgroup=Delimiter end="\\)\|%stopzone\>" keepend concealends contains=@texMathZoneGroup syn region texMathZoneW matchgroup=Delimiter start="\\\[" matchgroup=Delimiter end="\\]\|%stopzone\>" keepend concealends contains=@texMathZoneGroup syn region texMathZoneX matchgroup=Delimiter start="\$" skip="\\\\\|\\\$" matchgroup=Delimiter end="\$" end="%stopzone\>" concealends contains=@texMathZoneGroup syn region texMathZoneY matchgroup=Delimiter start="\$\$" matchgroup=Delimiter end="\$\$" end="%stopzone\>" keepend concealends contains=@texMathZoneGroup else 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 endif syn region texMathZoneZ matchgroup=texStatement start="\\ensuremath\s*{" matchgroup=texStatement end="}" end="%stopzone\>" contains=@texMathZoneGroup endif syn match texMathOper "[_^=]" contained " Text Inside Math Zones: {{{2 if s:tex_fast =~# 'M' if !exists("g:tex_nospell") || !g:tex_nospell syn region texMathText matchgroup=texStatement start='\\\(\(inter\)\=text\|mbox\)\s*{' end='}' contains=@texFoldGroup,@Spell else syn region texMathText matchgroup=texStatement start='\\\(\(inter\)\=text\|mbox\)\s*{' end='}' contains=@texFoldGroup endif endif " \left..something.. and \right..something.. support: {{{2 syn match texMathDelimBad contained "\S" if has("conceal") && &enc == 'utf-8' && s:tex_conceal =~# 'm' syn match texMathDelim contained "\\left\\{\>" skipwhite nextgroup=texMathDelimSet1,texMathDelimSet2,texMathDelimBad contains=texMathSymbol cchar={ syn match texMathDelim contained "\\right\\}\>" skipwhite nextgroup=texMathDelimSet1,texMathDelimSet2,texMathDelimBad contains=texMathSymbol cchar=} let s:texMathDelimList=[ \ ['<' , '<'] , \ ['>' , '>'] , \ ['(' , '('] , \ [')' , ')'] , \ ['\[' , '['] , \ [']' , ']'] , \ ['\\{' , '{'] , \ ['\\}' , '}'] , \ ['|' , '|'] , \ ['\\|' , '‖'] , \ ['\\backslash' , '\'] , \ ['\\downarrow' , '↓'] , \ ['\\Downarrow' , '⇓'] , \ ['\\langle' , '<'] , \ ['\\lbrace' , '['] , \ ['\\lceil' , '⌈'] , \ ['\\lfloor' , '⌊'] , \ ['\\lgroup' , '⌊'] , \ ['\\lmoustache' , '⎛'] , \ ['\\rangle' , '>'] , \ ['\\rbrace' , ']'] , \ ['\\rceil' , '⌉'] , \ ['\\rfloor' , '⌋'] , \ ['\\rgroup' , '⌋'] , \ ['\\rmoustache' , '⎞'] , \ ['\\uparrow' , '↑'] , \ ['\\Uparrow' , '↑'] , \ ['\\updownarrow', '↕'] , \ ['\\Updownarrow', '⇕']] syn match texMathDelim '\\[bB]igg\=[lr]' contained nextgroup=texMathDelimBad for texmath in s:texMathDelimList exe "syn match texMathDelim '\\\\[bB]igg\\=[lr]\\=".texmath[0]."' contained conceal cchar=".texmath[1] endfor else syn match texMathDelim contained "\\\(left\|right\)\>" skipwhite nextgroup=texMathDelimSet1,texMathDelimSet2,texMathDelimBad syn match texMathDelim contained "\\[bB]igg\=[lr]\=\>" skipwhite nextgroup=texMathDelimSet1,texMathDelimSet2,texMathDelimBad 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 syn match texMathDelim contained "\\\(left\|right\)arrow\>\|\<\([aA]rrow\|brace\)\=vert\>" syn match texMathDelim contained "\\lefteqn\>" 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("g:tex_no_math") syn match texOnlyMath "[_^]" endif syn match texSpecialChar "\^\^[0-9a-f]\{2}\|\^\^\S" if s:tex_conceal !~# 'S' syn match texSpecialChar '\\glq\>' contained conceal cchar=‚ syn match texSpecialChar '\\grq\>' contained conceal cchar=‘ syn match texSpecialChar '\\glqq\>' contained conceal cchar=„ syn match texSpecialChar '\\grqq\>' contained conceal cchar=“ syn match texSpecialChar '\\hyp\>' contained conceal cchar=- endif " Comments: {{{1 " Normal TeX LaTeX : %.... " Documented TeX Format: ^^A... -and- leading %s (only) if !s:tex_comment_nospell syn cluster texCommentGroup contains=texTodo,@Spell else syn cluster texCommentGroup contains=texTodo,@NoSpell endif syn case ignore syn keyword texTodo contained combak fixme todo xxx syn case match if s:extfname == "dtx" syn match texComment "\^\^A.*$" contains=@texCommentGroup syn match texComment "^%\+" contains=@texCommentGroup else if s:tex_fold_enabled " allows syntax-folding of 2 or more contiguous comment lines " single-line comments are not folded syn match texComment "%.*$" contains=@texCommentGroup if s:tex_fast =~# 'c' TexFold syn region texComment start="^\zs\s*%.*\_s*%" skip="^\s*%" end='^\ze\s*[^%]' contains=@texCommentGroup TexFold syn region texNoSpell contained matchgroup=texComment start="%\s*nospell\s*{" end="%\s*nospell\s*}" contains=@texFoldGroup,@NoSpell endif else syn match texComment "%.*$" contains=@texCommentGroup if s:tex_fast =~# 'c' syn region texNoSpell contained matchgroup=texComment start="%\s*nospell\s*{" end="%\s*nospell\s*}" contains=@texFoldGroup,@NoSpell endif endif endif " Separate lines used for verb` and verb# so that the end conditions {{{1 " will appropriately terminate. " If g:tex_verbspell exists, then verbatim texZones will permit spellchecking there. if s:tex_fast =~# 'v' if exists("g:tex_verbspell") && g:tex_verbspell syn region texZone start="\\begin{[vV]erbatim}" end="\\end{[vV]erbatim}\|%stopzone\>" contains=@Spell " listings package: syn region texZone start="\\begin{lstlisting}" end="\\end{lstlisting}\|%stopzone\>" contains=@Spell if version < 600 syn region texZone start="\\verb\*\=`" end="`\|%stopzone\>" contains=@Spell syn region texZone start="\\verb\*\=#" end="#\|%stopzone\>" contains=@Spell else if b:tex_stylish syn region texZone start="\\verb\*\=\z([^\ta-zA-Z@]\)" end="\z1\|%stopzone\>" contains=@Spell else syn region texZone start="\\verb\*\=\z([^\ta-zA-Z]\)" end="\z1\|%stopzone\>" contains=@Spell endif endif else syn region texZone start="\\begin{[vV]erbatim}" end="\\end{[vV]erbatim}\|%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 endif endif " Tex Reference Zones: {{{1 if s:tex_fast =~# 'r' syn region texZone matchgroup=texStatement start="@samp{" end="}\|%stopzone\>" contains=@texRefGroup syn region texRefZone matchgroup=texStatement start="\\nocite{" end="}\|%stopzone\>" contains=@texRefGroup syn region texRefZone matchgroup=texStatement start="\\bibliography{" end="}\|%stopzone\>" contains=@texRefGroup syn region texRefZone matchgroup=texStatement start="\\label{" end="}\|%stopzone\>" contains=@texRefGroup syn region texRefZone matchgroup=texStatement start="\\\(page\|eq\)ref{" end="}\|%stopzone\>" contains=@texRefGroup syn region texRefZone matchgroup=texStatement start="\\v\=ref{" end="}\|%stopzone\>" contains=@texRefGroup syn region texRefOption contained matchgroup=Delimiter start='\[' end=']' contains=@texRefGroup,texRefZone nextgroup=texRefOption,texCite syn region texCite contained matchgroup=Delimiter start='{' end='}' contains=@texRefGroup,texRefZone,texCite endif syn match texRefZone '\\cite\%([tp]\*\=\)\=' nextgroup=texRefOption,texCite " Handle newcommand, newenvironment : {{{1 syn match texNewCmd "\\newcommand\>" nextgroup=texCmdName skipwhite skipnl if s:tex_fast =~# 'V' 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 endif syn match texNewEnv "\\newenvironment\>" nextgroup=texEnvName skipwhite skipnl if s:tex_fast =~# 'V' 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 endif " 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 "\(``\|''\|,,\)" " makeatletter -- makeatother sections if !s:tex_no_error if s:tex_fast =~# 'S' syn region texStyle matchgroup=texStatement start='\\makeatletter' end='\\makeatother' contains=@texStyleGroup contained endif syn match texStyleStatement "\\[a-zA-Z@]\+" contained if s:tex_fast =~# 'S' syn region texStyleMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" contains=@texStyleGroup,texError contained syn region texStyleMatcher matchgroup=Delimiter start="\[" end="]" contains=@texStyleGroup,texError contained endif endif " Conceal mode support (supports set cole=2) {{{1 if has("conceal") && &enc == 'utf-8' " Math Symbols {{{2 " (many of these symbols were contributed by Björn Winckler) if s:tex_conceal =~# 'm' let s:texMathList=[ \ ['|' , '‖'], \ ['aleph' , 'ℵ'], \ ['amalg' , '∐'], \ ['angle' , '∠'], \ ['approx' , '≈'], \ ['ast' , '∗'], \ ['asymp' , '≍'], \ ['backepsilon' , '∍'], \ ['backsimeq' , '≃'], \ ['backslash' , '∖'], \ ['barwedge' , '⊼'], \ ['because' , '∵'], \ ['between' , '≬'], \ ['bigcap' , '∩'], \ ['bigcirc' , '○'], \ ['bigcup' , '∪'], \ ['bigodot' , '⊙'], \ ['bigoplus' , '⊕'], \ ['bigotimes' , '⊗'], \ ['bigsqcup' , '⊔'], \ ['bigtriangledown', '∇'], \ ['bigtriangleup' , '∆'], \ ['bigvee' , '⋁'], \ ['bigwedge' , '⋀'], \ ['blacksquare' , '∎'], \ ['bot' , '⊥'], \ ['bowtie' , '⋈'], \ ['boxdot' , '⊡'], \ ['boxminus' , '⊟'], \ ['boxplus' , '⊞'], \ ['boxtimes' , '⊠'], \ ['bullet' , '•'], \ ['bumpeq' , '≏'], \ ['Bumpeq' , '≎'], \ ['cap' , '∩'], \ ['Cap' , '⋒'], \ ['cdot' , '·'], \ ['cdots' , '⋯'], \ ['circ' , '∘'], \ ['circeq' , '≗'], \ ['circlearrowleft', '↺'], \ ['circlearrowright', '↻'], \ ['circledast' , '⊛'], \ ['circledcirc' , '⊚'], \ ['clubsuit' , '♣'], \ ['complement' , '∁'], \ ['cong' , '≅'], \ ['coprod' , '∐'], \ ['copyright' , '©'], \ ['cup' , '∪'], \ ['Cup' , '⋓'], \ ['curlyeqprec' , '⋞'], \ ['curlyeqsucc' , '⋟'], \ ['curlyvee' , '⋎'], \ ['curlywedge' , '⋏'], \ ['dagger' , '†'], \ ['dashv' , '⊣'], \ ['ddagger' , '‡'], \ ['ddots' , '⋱'], \ ['diamond' , '⋄'], \ ['diamondsuit' , '♢'], \ ['div' , '÷'], \ ['doteq' , '≐'], \ ['doteqdot' , '≑'], \ ['dotplus' , '∔'], \ ['dots' , '…'], \ ['dotsb' , '⋯'], \ ['dotsc' , '…'], \ ['dotsi' , '⋯'], \ ['dotso' , '…'], \ ['doublebarwedge' , '⩞'], \ ['downarrow' , '↓'], \ ['Downarrow' , '⇓'], \ ['ell' , 'ℓ'], \ ['emptyset' , '∅'], \ ['eqcirc' , '≖'], \ ['eqsim' , '≂'], \ ['eqslantgtr' , '⪖'], \ ['eqslantless' , '⪕'], \ ['equiv' , '≡'], \ ['exists' , '∃'], \ ['fallingdotseq' , '≒'], \ ['flat' , '♭'], \ ['forall' , '∀'], \ ['frown' , '⁔'], \ ['ge' , '≥'], \ ['geq' , '≥'], \ ['geqq' , '≧'], \ ['gets' , '←'], \ ['gg' , '⟫'], \ ['gneqq' , '≩'], \ ['gtrdot' , '⋗'], \ ['gtreqless' , '⋛'], \ ['gtrless' , '≷'], \ ['gtrsim' , '≳'], \ ['hbar' , 'ℏ'], \ ['heartsuit' , '♡'], \ ['hookleftarrow' , '↩'], \ ['hookrightarrow' , '↪'], \ ['iiint' , '∭'], \ ['iint' , '∬'], \ ['Im' , 'ℑ'], \ ['imath' , 'ɩ'], \ ['in' , '∈'], \ ['infty' , '∞'], \ ['int' , '∫'], \ ['lceil' , '⌈'], \ ['ldots' , '…'], \ ['le' , '≤'], \ ['leadsto' , '↝'], \ ['left(' , '('], \ ['left\[' , '['], \ ['left\\{' , '{'], \ ['leftarrow' , '←'], \ ['Leftarrow' , '⇐'], \ ['leftarrowtail' , '↢'], \ ['leftharpoondown', '↽'], \ ['leftharpoonup' , '↼'], \ ['leftrightarrow' , '↔'], \ ['Leftrightarrow' , '⇔'], \ ['leftrightsquigarrow', '↭'], \ ['leftthreetimes' , '⋋'], \ ['leq' , '≤'], \ ['leq' , '≤'], \ ['leqq' , '≦'], \ ['lessdot' , '⋖'], \ ['lesseqgtr' , '⋚'], \ ['lesssim' , '≲'], \ ['lfloor' , '⌊'], \ ['ll' , '≪'], \ ['lmoustache' , '╭'], \ ['lneqq' , '≨'], \ ['ltimes' , '⋉'], \ ['mapsto' , '↦'], \ ['measuredangle' , '∡'], \ ['mid' , '∣'], \ ['models' , '╞'], \ ['mp' , '∓'], \ ['nabla' , '∇'], \ ['natural' , '♮'], \ ['ncong' , '≇'], \ ['ne' , '≠'], \ ['nearrow' , '↗'], \ ['neg' , '¬'], \ ['neq' , '≠'], \ ['nexists' , '∄'], \ ['ngeq' , '≱'], \ ['ngeqq' , '≱'], \ ['ngtr' , '≯'], \ ['ni' , '∋'], \ ['nleftarrow' , '↚'], \ ['nLeftarrow' , '⇍'], \ ['nLeftrightarrow', '⇎'], \ ['nleq' , '≰'], \ ['nleqq' , '≰'], \ ['nless' , '≮'], \ ['nmid' , '∤'], \ ['notin' , '∉'], \ ['nprec' , '⊀'], \ ['nrightarrow' , '↛'], \ ['nRightarrow' , '⇏'], \ ['nsim' , '≁'], \ ['nsucc' , '⊁'], \ ['ntriangleleft' , '⋪'], \ ['ntrianglelefteq', '⋬'], \ ['ntriangleright' , '⋫'], \ ['ntrianglerighteq', '⋭'], \ ['nvdash' , '⊬'], \ ['nvDash' , '⊭'], \ ['nVdash' , '⊮'], \ ['nwarrow' , '↖'], \ ['odot' , '⊙'], \ ['oint' , '∮'], \ ['ominus' , '⊖'], \ ['oplus' , '⊕'], \ ['oslash' , '⊘'], \ ['otimes' , '⊗'], \ ['owns' , '∋'], \ ['P' , '¶'], \ ['parallel' , '║'], \ ['partial' , '∂'], \ ['perp' , '⊥'], \ ['pitchfork' , '⋔'], \ ['pm' , '±'], \ ['prec' , '≺'], \ ['precapprox' , '⪷'], \ ['preccurlyeq' , '≼'], \ ['preceq' , '⪯'], \ ['precnapprox' , '⪹'], \ ['precneqq' , '⪵'], \ ['precsim' , '≾'], \ ['prime' , '′'], \ ['prod' , '∏'], \ ['propto' , '∝'], \ ['rceil' , '⌉'], \ ['Re' , 'ℜ'], \ ['rfloor' , '⌋'], \ ['right)' , ')'], \ ['right]' , ']'], \ ['right\\}' , '}'], \ ['rightarrow' , '→'], \ ['Rightarrow' , '⇒'], \ ['rightarrowtail' , '↣'], \ ['rightleftharpoons', '⇌'], \ ['rightsquigarrow', '↝'], \ ['rightthreetimes', '⋌'], \ ['risingdotseq' , '≓'], \ ['rmoustache' , '╮'], \ ['rtimes' , '⋊'], \ ['S' , '§'], \ ['searrow' , '↘'], \ ['setminus' , '∖'], \ ['sharp' , '♯'], \ ['sim' , '∼'], \ ['simeq' , '⋍'], \ ['smile' , '‿'], \ ['spadesuit' , '♠'], \ ['sphericalangle' , '∢'], \ ['sqcap' , '⊓'], \ ['sqcup' , '⊔'], \ ['sqsubset' , '⊏'], \ ['sqsubseteq' , '⊑'], \ ['sqsupset' , '⊐'], \ ['sqsupseteq' , '⊒'], \ ['star' , '✫'], \ ['subset' , '⊂'], \ ['Subset' , '⋐'], \ ['subseteq' , '⊆'], \ ['subseteqq' , '⫅'], \ ['subsetneq' , '⊊'], \ ['subsetneqq' , '⫋'], \ ['succ' , '≻'], \ ['succapprox' , '⪸'], \ ['succcurlyeq' , '≽'], \ ['succeq' , '⪰'], \ ['succnapprox' , '⪺'], \ ['succneqq' , '⪶'], \ ['succsim' , '≿'], \ ['sum' , '∑'], \ ['supset' , '⊃'], \ ['Supset' , '⋑'], \ ['supseteq' , '⊇'], \ ['supseteqq' , '⫆'], \ ['supsetneq' , '⊋'], \ ['supsetneqq' , '⫌'], \ ['surd' , '√'], \ ['swarrow' , '↙'], \ ['therefore' , '∴'], \ ['times' , '×'], \ ['to' , '→'], \ ['top' , '⊤'], \ ['triangle' , '∆'], \ ['triangleleft' , '⊲'], \ ['trianglelefteq' , '⊴'], \ ['triangleq' , '≜'], \ ['triangleright' , '⊳'], \ ['trianglerighteq', '⊵'], \ ['twoheadleftarrow', '↞'], \ ['twoheadrightarrow', '↠'], \ ['uparrow' , '↑'], \ ['Uparrow' , '⇑'], \ ['updownarrow' , '↕'], \ ['Updownarrow' , '⇕'], \ ['varnothing' , '∅'], \ ['vartriangle' , '∆'], \ ['vdash' , '⊢'], \ ['vDash' , '⊨'], \ ['Vdash' , '⊩'], \ ['vdots' , '⋮'], \ ['vee' , '∨'], \ ['veebar' , '⊻'], \ ['Vvdash' , '⊪'], \ ['wedge' , '∧'], \ ['wp' , '℘'], \ ['wr' , '≀']] " \ ['jmath' , 'X'] " \ ['uminus' , 'X'] " \ ['uplus' , 'X'] for texmath in s:texMathList if texmath[0] =~# '\w$' exe "syn match texMathSymbol '\\\\".texmath[0]."\\>' contained conceal cchar=".texmath[1] else exe "syn match texMathSymbol '\\\\".texmath[0]."' contained conceal cchar=".texmath[1] endif endfor if &ambw == "double" syn match texMathSymbol '\\gg\>' contained conceal cchar=≫ syn match texMathSymbol '\\ll\>' contained conceal cchar=≪ else syn match texMathSymbol '\\gg\>' contained conceal cchar=⟫ syn match texMathSymbol '\\ll\>' contained conceal cchar=⟪ endif syn match texMathSymbol '\\hat{a}' contained conceal cchar=â syn match texMathSymbol '\\hat{A}' contained conceal cchar= syn match texMathSymbol '\\hat{c}' contained conceal cchar=ĉ syn match texMathSymbol '\\hat{C}' contained conceal cchar=Ĉ syn match texMathSymbol '\\hat{e}' contained conceal cchar=ê syn match texMathSymbol '\\hat{E}' contained conceal cchar=Ê syn match texMathSymbol '\\hat{g}' contained conceal cchar=ĝ syn match texMathSymbol '\\hat{G}' contained conceal cchar=Ĝ syn match texMathSymbol '\\hat{i}' contained conceal cchar=î syn match texMathSymbol '\\hat{I}' contained conceal cchar=Î syn match texMathSymbol '\\hat{o}' contained conceal cchar=ô syn match texMathSymbol '\\hat{O}' contained conceal cchar=Ô syn match texMathSymbol '\\hat{s}' contained conceal cchar=ŝ syn match texMathSymbol '\\hat{S}' contained conceal cchar=Ŝ syn match texMathSymbol '\\hat{u}' contained conceal cchar=û syn match texMathSymbol '\\hat{U}' contained conceal cchar=Û syn match texMathSymbol '\\hat{w}' contained conceal cchar=ŵ syn match texMathSymbol '\\hat{W}' contained conceal cchar=Ŵ syn match texMathSymbol '\\hat{y}' contained conceal cchar=ŷ syn match texMathSymbol '\\hat{Y}' contained conceal cchar=Ŷ " syn match texMathSymbol '\\bar{a}' contained conceal cchar=a̅ endif " Greek {{{2 if s:tex_conceal =~# 'g' fun! s:Greek(group,pat,cchar) exe 'syn match '.a:group." '".a:pat."' contained conceal cchar=".a:cchar endfun call s:Greek('texGreek','\\alpha\>' ,'α') call s:Greek('texGreek','\\beta\>' ,'β') call s:Greek('texGreek','\\gamma\>' ,'γ') call s:Greek('texGreek','\\delta\>' ,'δ') call s:Greek('texGreek','\\epsilon\>' ,'ϵ') call s:Greek('texGreek','\\varepsilon\>' ,'ε') call s:Greek('texGreek','\\zeta\>' ,'ζ') call s:Greek('texGreek','\\eta\>' ,'η') call s:Greek('texGreek','\\theta\>' ,'θ') call s:Greek('texGreek','\\vartheta\>' ,'ϑ') call s:Greek('texGreek','\\kappa\>' ,'κ') call s:Greek('texGreek','\\lambda\>' ,'λ') call s:Greek('texGreek','\\mu\>' ,'μ') call s:Greek('texGreek','\\nu\>' ,'ν') call s:Greek('texGreek','\\xi\>' ,'ξ') call s:Greek('texGreek','\\pi\>' ,'π') call s:Greek('texGreek','\\varpi\>' ,'ϖ') call s:Greek('texGreek','\\rho\>' ,'ρ') call s:Greek('texGreek','\\varrho\>' ,'ϱ') call s:Greek('texGreek','\\sigma\>' ,'σ') call s:Greek('texGreek','\\varsigma\>' ,'ς') call s:Greek('texGreek','\\tau\>' ,'τ') call s:Greek('texGreek','\\upsilon\>' ,'υ') call s:Greek('texGreek','\\phi\>' ,'ϕ') call s:Greek('texGreek','\\varphi\>' ,'φ') call s:Greek('texGreek','\\chi\>' ,'χ') call s:Greek('texGreek','\\psi\>' ,'ψ') call s:Greek('texGreek','\\omega\>' ,'ω') call s:Greek('texGreek','\\Gamma\>' ,'Γ') call s:Greek('texGreek','\\Delta\>' ,'Δ') call s:Greek('texGreek','\\Theta\>' ,'Θ') call s:Greek('texGreek','\\Lambda\>' ,'Λ') call s:Greek('texGreek','\\Xi\>' ,'Χ') call s:Greek('texGreek','\\Pi\>' ,'Π') call s:Greek('texGreek','\\Sigma\>' ,'Σ') call s:Greek('texGreek','\\Upsilon\>' ,'Υ') call s:Greek('texGreek','\\Phi\>' ,'Φ') call s:Greek('texGreek','\\Psi\>' ,'Ψ') call s:Greek('texGreek','\\Omega\>' ,'Ω') delfun s:Greek endif " Superscripts/Subscripts {{{2 if s:tex_conceal =~# 's' if s:tex_fast =~# 's' syn region texSuperscript matchgroup=Delimiter start='\^{' skip="\\\\\|\\[{}]" end='}' contained concealends contains=texSpecialChar,texSuperscripts,texStatement,texSubscript,texSuperscript,texMathMatcher syn region texSubscript matchgroup=Delimiter start='_{' skip="\\\\\|\\[{}]" end='}' contained concealends contains=texSpecialChar,texSubscripts,texStatement,texSubscript,texSuperscript,texMathMatcher endif " s:SuperSub: fun! s:SuperSub(group,leader,pat,cchar) if a:pat =~# '^\\' || (a:leader == '\^' && a:pat =~# g:tex_superscripts) || (a:leader == '_' && a:pat =~# g:tex_subscripts) " call Decho("SuperSub: group<".a:group."> leader<".a:leader."> pat<".a:pat."> cchar<".a:cchar.">") exe 'syn match '.a:group." '".a:leader.a:pat."' contained conceal cchar=".a:cchar exe 'syn match '.a:group."s '".a:pat ."' contained conceal cchar=".a:cchar.' nextgroup='.a:group.'s' endif endfun call s:SuperSub('texSuperscript','\^','0','⁰') call s:SuperSub('texSuperscript','\^','1','¹') call s:SuperSub('texSuperscript','\^','2','²') call s:SuperSub('texSuperscript','\^','3','³') call s:SuperSub('texSuperscript','\^','4','⁴') call s:SuperSub('texSuperscript','\^','5','⁵') call s:SuperSub('texSuperscript','\^','6','⁶') call s:SuperSub('texSuperscript','\^','7','⁷') call s:SuperSub('texSuperscript','\^','8','⁸') call s:SuperSub('texSuperscript','\^','9','⁹') call s:SuperSub('texSuperscript','\^','a','ᵃ') call s:SuperSub('texSuperscript','\^','b','ᵇ') call s:SuperSub('texSuperscript','\^','c','ᶜ') call s:SuperSub('texSuperscript','\^','d','ᵈ') call s:SuperSub('texSuperscript','\^','e','ᵉ') call s:SuperSub('texSuperscript','\^','f','ᶠ') call s:SuperSub('texSuperscript','\^','g','ᵍ') call s:SuperSub('texSuperscript','\^','h','ʰ') call s:SuperSub('texSuperscript','\^','i','ⁱ') call s:SuperSub('texSuperscript','\^','j','ʲ') call s:SuperSub('texSuperscript','\^','k','ᵏ') call s:SuperSub('texSuperscript','\^','l','ˡ') call s:SuperSub('texSuperscript','\^','m','ᵐ') call s:SuperSub('texSuperscript','\^','n','ⁿ') call s:SuperSub('texSuperscript','\^','o','ᵒ') call s:SuperSub('texSuperscript','\^','p','ᵖ') call s:SuperSub('texSuperscript','\^','r','ʳ') call s:SuperSub('texSuperscript','\^','s','ˢ') call s:SuperSub('texSuperscript','\^','t','ᵗ') call s:SuperSub('texSuperscript','\^','u','ᵘ') call s:SuperSub('texSuperscript','\^','v','ᵛ') call s:SuperSub('texSuperscript','\^','w','ʷ') call s:SuperSub('texSuperscript','\^','x','ˣ') call s:SuperSub('texSuperscript','\^','y','ʸ') call s:SuperSub('texSuperscript','\^','z','ᶻ') call s:SuperSub('texSuperscript','\^','A','ᴬ') call s:SuperSub('texSuperscript','\^','B','ᴮ') call s:SuperSub('texSuperscript','\^','D','ᴰ') call s:SuperSub('texSuperscript','\^','E','ᴱ') call s:SuperSub('texSuperscript','\^','G','ᴳ') call s:SuperSub('texSuperscript','\^','H','ᴴ') call s:SuperSub('texSuperscript','\^','I','ᴵ') call s:SuperSub('texSuperscript','\^','J','ᴶ') call s:SuperSub('texSuperscript','\^','K','ᴷ') call s:SuperSub('texSuperscript','\^','L','ᴸ') call s:SuperSub('texSuperscript','\^','M','ᴹ') call s:SuperSub('texSuperscript','\^','N','ᴺ') call s:SuperSub('texSuperscript','\^','O','ᴼ') call s:SuperSub('texSuperscript','\^','P','ᴾ') call s:SuperSub('texSuperscript','\^','R','ᴿ') call s:SuperSub('texSuperscript','\^','T','ᵀ') call s:SuperSub('texSuperscript','\^','U','ᵁ') call s:SuperSub('texSuperscript','\^','W','ᵂ') call s:SuperSub('texSuperscript','\^',',','︐') call s:SuperSub('texSuperscript','\^',':','︓') call s:SuperSub('texSuperscript','\^',';','︔') call s:SuperSub('texSuperscript','\^','+','⁺') call s:SuperSub('texSuperscript','\^','-','⁻') call s:SuperSub('texSuperscript','\^','<','˂') call s:SuperSub('texSuperscript','\^','>','˃') call s:SuperSub('texSuperscript','\^','/','ˊ') call s:SuperSub('texSuperscript','\^','(','⁽') call s:SuperSub('texSuperscript','\^',')','⁾') call s:SuperSub('texSuperscript','\^','\.','˙') call s:SuperSub('texSuperscript','\^','=','˭') call s:SuperSub('texSubscript','_','0','₀') call s:SuperSub('texSubscript','_','1','₁') call s:SuperSub('texSubscript','_','2','₂') call s:SuperSub('texSubscript','_','3','₃') call s:SuperSub('texSubscript','_','4','₄') call s:SuperSub('texSubscript','_','5','₅') call s:SuperSub('texSubscript','_','6','₆') call s:SuperSub('texSubscript','_','7','₇') call s:SuperSub('texSubscript','_','8','₈') call s:SuperSub('texSubscript','_','9','₉') call s:SuperSub('texSubscript','_','a','ₐ') call s:SuperSub('texSubscript','_','e','ₑ') call s:SuperSub('texSubscript','_','i','ᵢ') call s:SuperSub('texSubscript','_','o','ₒ') call s:SuperSub('texSubscript','_','u','ᵤ') call s:SuperSub('texSubscript','_',',','︐') call s:SuperSub('texSubscript','_','+','₊') call s:SuperSub('texSubscript','_','-','₋') call s:SuperSub('texSubscript','_','/','ˏ') call s:SuperSub('texSubscript','_','(','₍') call s:SuperSub('texSubscript','_',')','₎') call s:SuperSub('texSubscript','_','\.','‸') call s:SuperSub('texSubscript','_','r','ᵣ') call s:SuperSub('texSubscript','_','v','ᵥ') call s:SuperSub('texSubscript','_','x','ₓ') call s:SuperSub('texSubscript','_','\\beta\>' ,'ᵦ') call s:SuperSub('texSubscript','_','\\delta\>','ᵨ') call s:SuperSub('texSubscript','_','\\phi\>' ,'ᵩ') call s:SuperSub('texSubscript','_','\\gamma\>','ᵧ') call s:SuperSub('texSubscript','_','\\chi\>' ,'ᵪ') delfun s:SuperSub endif " Accented characters: {{{2 if s:tex_conceal =~# 'a' 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 fun! s:Accents(chr,...) let i= 1 for accent in ["`","\\'","^",'"','\~','\.','=',"c","H","k","r","u","v"] if i > a:0 break endif if strlen(a:{i}) == 0 || a:{i} == ' ' || a:{i} == '?' let i= i + 1 continue endif if accent =~# '\a' exe "syn match texAccent '".'\\'.accent.'\(\s*{'.a:chr.'}\|\s\+'.a:chr.'\)'."' conceal cchar=".a:{i} else exe "syn match texAccent '".'\\'.accent.'\s*\({'.a:chr.'}\|'.a:chr.'\)'."' conceal cchar=".a:{i} endif let i= i + 1 endfor endfun " \` \' \^ \" \~ \. \= \c \H \k \r \u \v call s:Accents('a','à','á','â','ä','ã','ȧ','ā',' ',' ','ą','å','ă','ǎ') call s:Accents('A','À','Á','Â','Ä','Ã','Ȧ','Ā',' ',' ','Ą','Å','Ă','Ǎ') call s:Accents('c',' ','ć','ĉ',' ',' ','ċ',' ','ç',' ',' ',' ',' ','č') call s:Accents('C',' ','Ć','Ĉ',' ',' ','Ċ',' ','Ç',' ',' ',' ',' ','Č') call s:Accents('d',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','ď') call s:Accents('D',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','Ď') call s:Accents('e','è','é','ê','ë','ẽ','ė','ē','ȩ',' ','ę',' ','ĕ','ě') call s:Accents('E','È','É','Ê','Ë','Ẽ','Ė','Ē','Ȩ',' ','Ę',' ','Ĕ','Ě') call s:Accents('g',' ','ǵ','ĝ',' ',' ','ġ',' ','ģ',' ',' ',' ','ğ','ǧ') call s:Accents('G',' ','Ǵ','Ĝ',' ',' ','Ġ',' ','Ģ',' ',' ',' ','Ğ','Ǧ') call s:Accents('h',' ',' ','ĥ',' ',' ',' ',' ',' ',' ',' ',' ',' ','ȟ') call s:Accents('H',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','Ȟ') call s:Accents('i','ì','í','î','ï','ĩ','į','ī',' ',' ','į',' ','ĭ','ǐ') call s:Accents('I','Ì','Í','Î','Ï','Ĩ','İ','Ī',' ',' ','Į',' ','Ĭ','Ǐ') call s:Accents('J',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','ǰ') call s:Accents('k',' ',' ',' ',' ',' ',' ',' ','ķ',' ',' ',' ',' ','ǩ') call s:Accents('K',' ',' ',' ',' ',' ',' ',' ','Ķ',' ',' ',' ',' ','Ǩ') call s:Accents('l',' ','ĺ','ľ',' ',' ',' ',' ','ļ',' ',' ',' ',' ','ľ') call s:Accents('L',' ','Ĺ','Ľ',' ',' ',' ',' ','Ļ',' ',' ',' ',' ','Ľ') call s:Accents('n',' ','ń',' ',' ','ñ',' ',' ','ņ',' ',' ',' ',' ','ň') call s:Accents('N',' ','Ń',' ',' ','Ñ',' ',' ','Ņ',' ',' ',' ',' ','Ň') call s:Accents('o','ò','ó','ô','ö','õ','ȯ','ō',' ','ő','ǫ',' ','ŏ','ǒ') call s:Accents('O','Ò','Ó','Ô','Ö','Õ','Ȯ','Ō',' ','Ő','Ǫ',' ','Ŏ','Ǒ') call s:Accents('r',' ','ŕ',' ',' ',' ',' ',' ','ŗ',' ',' ',' ',' ','ř') call s:Accents('R',' ','Ŕ',' ',' ',' ',' ',' ','Ŗ',' ',' ',' ',' ','Ř') call s:Accents('s',' ','ś','ŝ',' ',' ',' ',' ','ş',' ','ȿ',' ',' ','š') call s:Accents('S',' ','Ś','Ŝ',' ',' ',' ',' ','Ş',' ',' ',' ',' ','Š') call s:Accents('t',' ',' ',' ',' ',' ',' ',' ','ţ',' ',' ',' ',' ','ť') call s:Accents('T',' ',' ',' ',' ',' ',' ',' ','Ţ',' ',' ',' ',' ','Ť') call s:Accents('u','ù','ú','û','ü','ũ',' ','ū',' ','ű','ų','ů','ŭ','ǔ') call s:Accents('U','Ù','Ú','Û','Ü','Ũ',' ','Ū',' ','Ű','Ų','Ů','Ŭ','Ǔ') call s:Accents('w',' ',' ','ŵ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ') call s:Accents('W',' ',' ','Ŵ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ') call s:Accents('y','ỳ','ý','ŷ','ÿ','ỹ',' ',' ',' ',' ',' ',' ',' ',' ') call s:Accents('Y','Ỳ','Ý','Ŷ','Ÿ','Ỹ',' ',' ',' ',' ',' ',' ',' ',' ') call s:Accents('z',' ','ź',' ',' ',' ','ż',' ',' ',' ',' ',' ',' ','ž') call s:Accents('Z',' ','Ź',' ',' ',' ','Ż',' ',' ',' ',' ',' ',' ','Ž') call s:Accents('\\i','ì','í','î','ï','ĩ','į',' ',' ',' ',' ',' ','ĭ',' ') " \` \' \^ \" \~ \. \= \c \H \k \r \u \v delfun s:Accents syn match texAccent '\\aa\>' conceal cchar=å syn match texAccent '\\AA\>' conceal cchar=Å syn match texAccent '\\o\>' conceal cchar=ø syn match texAccent '\\O\>' conceal cchar=Ø syn match texLigature '\\AE\>' conceal cchar=Æ syn match texLigature '\\ae\>' conceal cchar=æ syn match texLigature '\\oe\>' conceal cchar=œ syn match texLigature '\\OE\>' conceal cchar=Œ syn match texLigature '\\ss\>' conceal cchar=ß endif endif endif " --------------------------------------------------------------------- " 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("g: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("g: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 hi texBoldStyle gui=bold cterm=bold hi texItalStyle gui=italic cterm=italic hi texBoldItalStyle gui=bold,italic cterm=bold,italic hi texItalBoldStyle gui=bold,italic cterm=bold,italic HiLink texCite texRefZone HiLink texDefCmd texDef HiLink texDefName texDef HiLink texDocType texCmdName HiLink texDocTypeArgs texCmdArgs HiLink texInputFileOpt texCmdArgs HiLink texInputCurlies texDelimiter HiLink texLigature texSpecialChar if !exists("g:tex_no_math") HiLink texMathDelimSet1 texMathDelim HiLink texMathDelimSet2 texMathDelim HiLink texMathDelimKey texMathDelim HiLink texMathMatcher texMath HiLink texAccent texStatement HiLink texGreek texStatement HiLink texSuperscript texStatement HiLink texSubscript texStatement HiLink texSuperscripts texSuperscript HiLink texSubscripts texSubscript HiLink texMathSymbol texStatement HiLink texMathZoneV texMath HiLink texMathZoneW texMath HiLink texMathZoneX texMath HiLink texMathZoneY texMath HiLink texMathZoneV texMath HiLink texMathZoneZ texMath endif HiLink texBeginEnd texCmdName HiLink texBeginEndName texSection HiLink texSpaceCode texStatement HiLink texStyleStatement 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 " Cleanup: {{{1 delc TexFold unlet s:extfname let b:current_syntax = "tex" let &cpo = s:keepcpo unlet s:keepcpo " vim: ts=8 fdm=marker vim-7.4.1689/runtime/syntax/texinfo.vim000066400000000000000000000624001267703067000200010ustar00rootroot00000000000000" Vim syntax file " Language: Texinfo (macro package for TeX) " Maintainer: Sandor Kopanyi " URL: <-> " Last Change: 2004 Jun 23 " " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/texmf.vim000066400000000000000000000046451267703067000174570ustar00rootroot00000000000000" 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) " 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 else command -nargs=+ HiLink hi def link 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" vim-7.4.1689/runtime/syntax/tf.vim000066400000000000000000000161051267703067000167370ustar00rootroot00000000000000" Vim syntax file " Language: tf " Maintainer: Lutz Eymers " 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 "\" contained syn match tfReadonly "\" 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/tidy.vim000066400000000000000000000146021267703067000172770ustar00rootroot00000000000000" Vim syntax file " Language: HMTL Tidy configuration file (/etc/tidyrc ~/.tidyrc) " Maintainer: Doug Kearns " Last Change: 2013 June 01 if exists("b:current_syntax") finish endif setlocal iskeyword=@,48-57,- 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\|user\)\>" contained " NOTE: use match rather than keyword here so that tidyEncoding 'raw' does not " always have precedence over tidyOption 'raw' syn match tidyEncoding "\<\%(ascii\|latin0\|latin1\|raw\|utf8\|iso2022\|mac\|utf16le\|utf16be\|utf16\|win1252\|ibm858\|big5\|shiftjis\)\>" contained syn match tidyNewline "\<\%(LF\|CRLF\|CR\)\>" 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,tidyNewline,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 "^anchor-as-name" 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 "^decorate-inferred-ul" contained syn match tidyOption "^doctype" contained syn match tidyOption "^doctype-mode" 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 "^gnu-emacs-file" 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 "^merge-divs" contained syn match tidyOption "^merge-spans" contained syn match tidyOption "^ncr" contained syn match tidyOption "^newline" contained syn match tidyOption "^numeric-entities" contained syn match tidyOption "^output-bom" contained syn match tidyOption "^output-encoding" contained syn match tidyOption "^output-file" contained syn match tidyOption "^output-html" contained syn match tidyOption "^output-xhtml" contained syn match tidyOption "^output-xml" contained syn match tidyOption "^preserve-entities" contained syn match tidyOption "^punctuation-wrap" 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 "^sort-attributes" 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 tidyOption "^vertical-space" 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 hi def link tidyBoolean Boolean hi def link tidyComment Comment hi def link tidyDelimiter Special hi def link tidyDoctype Constant hi def link tidyEncoding Constant hi def link tidyNewline Constant hi def link tidyNewTagDelimiter Special hi def link tidyNewTagOption Identifier hi def link tidyNewTagValue Constant hi def link tidyNumber Number hi def link tidyOption Identifier hi def link tidyRepeat Constant hi def link tidyString String hi def link tidyTodo Todo let b:current_syntax = "tidy" " vim: ts=8 vim-7.4.1689/runtime/syntax/tilde.vim000066400000000000000000000030021267703067000174170ustar00rootroot00000000000000" Vim syntax file " This file works only for Vim6.x " Language: Tilde " Maintainer: Tobias Rundstrm " URL: http://www.tildesoftware.net " CVS: $Id: tilde.vim,v 1.1 2004/06/13 19:31:51 vimboss Exp $ 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" vim-7.4.1689/runtime/syntax/tli.vim000066400000000000000000000040021267703067000171070ustar00rootroot00000000000000" Vim syntax file " Language: TealInfo source files (*.tli) " Maintainer: Kurt W. Andrews " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/tpp.vim000066400000000000000000000075251267703067000171370ustar00rootroot00000000000000" Vim syntax file " Language: tpp - Text Presentation Program " Maintainer: Debian Vim Maintainers " Former Maintainer: Gerfried Fuchs " Last Change: 2007-10-14 " URL: http://git.debian.org/?p=pkg-vim/vim.git;a=blob_plain;f=runtime/syntax/tpp.vim;hb=debian " Filenames: *.tpp " License: BSD " " XXX This file is in need of a new maintainer, Debian VIM Maintainers maintain " it only because patches have been submitted for it by Debian users and the " former maintainer was MIA (Missing In Action), taking over its " maintenance was thus the only way to include those patches. " If you care about this file, and have time to maintain it please do so! " " 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 syntax clear elseif exists("b:current_syntax") finish endif if !exists("main_syntax") let main_syntax = 'tpp' endif "" list of the legal switches/options syn match tppAbstractOptionKey contained "^--\%(author\|title\|date\|footer\) *" nextgroup=tppString syn match tppPageLocalOptionKey contained "^--\%(heading\|center\|right\|huge\|sethugefont\|exec\) *" nextgroup=tppString syn match tppPageLocalSwitchKey contained "^--\%(horline\|-\|\%(begin\|end\)\%(\%(shell\)\?output\|slide\%(left\|right\|top\|bottom\)\)\|\%(bold\|rev\|ul\)\%(on\|off\)\|withborder\)" syn match tppNewPageOptionKey contained "^--newpage *" nextgroup=tppString syn match tppColorOptionKey contained "^--\%(\%(bg\|fg\)\?color\) *" syn match tppTimeOptionKey contained "^--sleep *" syn match tppString contained ".*" syn match tppColor contained "\%(white\|yellow\|red\|green\|blue\|cyan\|magenta\|black\|default\)" syn match tppTime contained "\d\+" syn region tppPageLocalSwitch start="^--" end="$" contains=tppPageLocalSwitchKey oneline syn region tppColorOption start="^--\%(\%(bg\|fg\)\?color\)" end="$" contains=tppColorOptionKey,tppColor oneline syn region tppTimeOption start="^--sleep" end="$" contains=tppTimeOptionKey,tppTime oneline syn region tppNewPageOption start="^--newpage" end="$" contains=tppNewPageOptionKey oneline syn region tppPageLocalOption start="^--\%(heading\|center\|right\|huge\|sethugefont\|exec\)" end="$" contains=tppPageLocalOptionKey oneline syn region tppAbstractOption start="^--\%(author\|title\|date\|footer\)" end="$" contains=tppAbstractOptionKey oneline if main_syntax != 'sh' " shell command if version < 600 syn include @tppShExec :p:h/sh.vim else syn include @tppShExec syntax/sh.vim endif unlet b:current_syntax syn region shExec matchgroup=tppPageLocalOptionKey start='^--exec *' keepend end='$' contains=@tppShExec endif syn match tppComment "^--##.*$" " Define the default highlighting. " For version 5.7 and earlier: only when not done already " For version 5.8 and later: only when an item doesn't have highlighting yet if version >= 508 || !exists("did_tpp_syn_inits") if version < 508 let did_tpp_syn_inits = 1 command -nargs=+ HiLink hi link else command -nargs=+ HiLink hi def link endif HiLink tppAbstractOptionKey Special HiLink tppPageLocalOptionKey Keyword HiLink tppPageLocalSwitchKey Keyword HiLink tppColorOptionKey Keyword HiLink tppTimeOptionKey Comment HiLink tppNewPageOptionKey PreProc HiLink tppString String HiLink tppColor String HiLink tppTime Number HiLink tppComment Comment HiLink tppAbstractOption Error HiLink tppPageLocalOption Error HiLink tppPageLocalSwitch Error HiLink tppColorOption Error HiLink tppNewPageOption Error HiLink tppTimeOption Error delcommand HiLink endif let b:current_syntax = "tpp" " vim: ts=8 sw=2 vim-7.4.1689/runtime/syntax/trasys.vim000066400000000000000000000125301267703067000176510ustar00rootroot00000000000000" 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 :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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/treetop.vim000066400000000000000000000071101267703067000200040ustar00rootroot00000000000000" Vim syntax file " Language: Treetop " Maintainer: Nikolai Weibull " Latest Revision: 2011-03-14 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn keyword treetopTodo \ contained \ TODO \ FIXME \ XXX \ NOTE syn match treetopComment \ '#.*' \ display \ contains=treetopTodo syn include @treetopRuby syntax/ruby.vim unlet b:current_syntax syn keyword treetopKeyword \ require \ end syn region treetopKeyword \ matchgroup=treetopKeyword \ start='\<\%(grammar\|include\|module\)\>\ze\s' \ end='$' \ transparent \ oneline \ keepend \ contains=@treetopRuby syn keyword treetopKeyword \ rule \ nextgroup=treetopRuleName \ skipwhite skipnl syn match treetopGrammarName \ '\u\w*' \ contained syn match treetopRubyModuleName \ '\u\w*' \ contained syn match treetopRuleName \ '\h\w*' \ contained syn region treetopString \ matchgroup=treetopStringDelimiter \ start=+"+ \ end=+"+ syn region treetopString \ matchgroup=treetopStringDelimiter \ start=+'+ \ end=+'+ syn region treetopCharacterClass \ matchgroup=treetopCharacterClassDelimiter \ start=+\[+ \ skip=+\\\]+ \ end=+\]+ syn region treetopRubyBlock \ matchgroup=treetopRubyBlockDelimiter \ start=+{+ \ end=+}+ \ contains=@treetopRuby syn region treetopSemanticPredicate \ matchgroup=treetopSemanticPredicateDelimiter \ start=+[!&]{+ \ end=+}+ \ contains=@treetopRuby syn region treetopSubclassDeclaration \ matchgroup=treetopSubclassDeclarationDelimiter \ start=+<+ \ end=+>+ \ contains=@treetopRuby syn match treetopEllipsis \ +''+ hi def link treetopTodo Todo hi def link treetopComment Comment hi def link treetopKeyword Keyword hi def link treetopGrammarName Constant hi def link treetopRubyModuleName Constant hi def link treetopRuleName Identifier hi def link treetopString String hi def link treetopStringDelimiter treetopString hi def link treetopCharacterClass treetopString hi def link treetopCharacterClassDelimiter treetopCharacterClass hi def link treetopRubyBlockDelimiter PreProc hi def link treetopSemanticPredicateDelimiter PreProc hi def link treetopSubclassDeclarationDelimiter PreProc hi def link treetopEllipsis Special let b:current_syntax = 'treetop' let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/trustees.vim000066400000000000000000000030011267703067000201730ustar00rootroot00000000000000" Vim syntax file " Language: trustees " Maintainer: Nima Talebi " Last Change: 2005-10-12 if version < 600 syntax clear elseif exists("b:current_syntax") finish endif syntax case match syntax sync minlines=0 maxlines=0 " Errors & Comments syntax match tfsError /.*/ highlight link tfsError Error syntax keyword tfsSpecialComment TODO XXX FIXME contained highlight link tfsSpecialComment Todo syntax match tfsComment ~\s*#.*~ contains=tfsSpecialComment highlight link tfsComment Comment " Operators & Delimiters highlight link tfsSpecialChar Operator syntax match tfsSpecialChar ~[*!+]~ contained highlight link tfsDelimiter Delimiter syntax match tfsDelimiter ~:~ contained " Trustees Rules - Part 1 of 3 - The Device syntax region tfsRuleDevice matchgroup=tfsDeviceContainer start=~\[/~ end=~\]~ nextgroup=tfsRulePath oneline highlight link tfsRuleDevice Label highlight link tfsDeviceContainer PreProc " Trustees Rules - Part 2 of 3 - The Path syntax match tfsRulePath ~/[-_a-zA-Z0-9/]*~ nextgroup=tfsRuleACL contained contains=tfsDelimiter highlight link tfsRulePath String " Trustees Rules - Part 3 of 3 - The ACLs syntax match tfsRuleACL ~\(:\(\*\|[+]\{0,1\}[a-zA-Z0-9/]\+\):[RWEBXODCU!]\+\)\+$~ contained contains=tfsDelimiter,tfsRuleWho,tfsRuleWhat syntax match tfsRuleWho ~\(\*\|[+]\{0,1\}[a-zA-Z0-9/]\+\)~ contained contains=tfsSpecialChar highlight link tfsRuleWho Identifier syntax match tfsRuleWhat ~[RWEBXODCU!]\+~ contained contains=tfsSpecialChar highlight link tfsRuleWhat Structure vim-7.4.1689/runtime/syntax/tsalt.vim000066400000000000000000000206751267703067000174640ustar00rootroot00000000000000" Vim syntax file " Language: Telix (Modem Comm Program) SALT Script " Maintainer: Sean M. McKee " Last Change: 2012 Feb 03 by Thilo Six " 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 let s:cpo_save = &cpo set cpo&vim " 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 else command -nargs=+ HiLink hi def link 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" let &cpo = s:cpo_save unlet s:cpo_save " vim: ts=8 vim-7.4.1689/runtime/syntax/tsscl.vim000066400000000000000000000125641267703067000174630ustar00rootroot00000000000000" 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/tssgm.vim000066400000000000000000000061351267703067000174650ustar00rootroot00000000000000" 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/tssop.vim000066400000000000000000000042021267703067000174710ustar00rootroot00000000000000" 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/tt2.vim000066400000000000000000000173601267703067000170430ustar00rootroot00000000000000" Language: TT2 (Perl Template Toolkit) " Maintainer: vim-perl " Author: Moriki, Atsushi <4woods+vim@gmail.com> " Homepage: http://github.com/vim-perl/vim-perl " Bugs/requests: http://github.com/vim-perl/vim-perl/issues " Last Change: 2013-07-21 " " Instration: " put tt2.vim and tt2html.vim in to your syntax diretory. " " add below in your filetype.vim. " au BufNewFile,BufRead *.tt2 setf tt2 " or " au BufNewFile,BufRead *.tt2 " \ if ( getline(1) . getline(2) . getline(3) =~ '<\chtml' | " \ && getline(1) . getline(2) . getline(3) !~ '<[%?]' ) | " \ || getline(1) =~ '' " "PHP" " :let b:tt2_syn_tags = '' " "TT2 and HTML" " :let b:tt2_syn_tags = '\[% %] ' " " Changes: " 0.1.3 " Changed fileformat from 'dos' to 'unix' " Deleted 'echo' that print obstructive message " 0.1.2 " Added block comment syntax " e.g. [%# COMMENT " COMMENT TOO %] " [%# IT'S SAFE %] HERE IS OUTSIDE OF TT2 DIRECTIVE " [% # WRONG!! %] HERE STILL BE COMMENT " 0.1.1 " Release " 0.1.0 " Internal " " License: follow Vim :help uganda " if !exists("b:tt2_syn_tags") let b:tt2_syn_tags = '\[% %]' "let b:tt2_syn_tags = '\[% %] \[\* \*]' endif if !exists("b:tt2_syn_inc_perl") let b:tt2_syn_inc_perl = 1 endif if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn case match syn cluster tt2_top_cluster contains=tt2_perlcode,tt2_tag_region " TT2 TAG Region if exists("b:tt2_syn_tags") let s:str = b:tt2_syn_tags . ' ' let s:str = substitute(s:str,'^ \+','','g') let s:str = substitute(s:str,' \+',' ','g') while stridx(s:str,' ') > 0 let s:st = strpart(s:str,0,stridx(s:str,' ')) let s:str = substitute(s:str,'[^ ]* ','',"") let s:ed = strpart(s:str,0,stridx(s:str,' ')) let s:str = substitute(s:str,'[^ ]* ','',"") exec 'syn region tt2_tag_region '. \ 'matchgroup=tt2_tag '. \ 'start=+\(' . s:st .'\)[-]\=+ '. \ 'end=+[-]\=\(' . s:ed . '\)+ '. \ 'contains=@tt2_statement_cluster keepend extend' exec 'syn region tt2_commentblock_region '. \ 'matchgroup=tt2_tag '. \ 'start=+\(' . s:st .'\)[-]\=\(#\)\@=+ '. \ 'end=+[-]\=\(' . s:ed . '\)+ '. \ 'keepend extend' "Include Perl syntax when 'PERL' 'RAWPERL' block if b:tt2_syn_inc_perl syn include @Perl $VIMRUNTIME/syntax/perl.vim exec 'syn region tt2_perlcode '. \ 'start=+\(\(RAW\)\=PERL\s*[-]\=' . s:ed . '\(\n\)\=\)\@<=+ ' . \ 'end=+' . s:st . '[-]\=\s*END+me=s-1 contains=@Perl keepend' endif "echo 'TAGS ' . s:st . ' ' . s:ed unlet s:st unlet s:ed endwhile else syn region tt2_tag_region \ matchgroup=tt2_tag \ start=+\(\[%\)[-]\=+ \ end=+[-]\=%\]+ \ contains=@tt2_statement_cluster keepend extend syn region tt2_commentblock_region \ matchgroup=tt2_tag \ start=+\(\[%\)[-]\=#+ \ end=+[-]\=%\]+ \ keepend extend "Include Perl syntax when 'PERL' 'RAWPERL' block if b:tt2_syn_inc_perl syn include @Perl $VIMRUNTIME/syntax/perl.vim syn region tt2_perlcode \ start=+\(\(RAW\)\=PERL\s*[-]\=%]\(\n\)\=\)\@<=+ \ end=+\[%[-]\=\s*END+me=s-1 \ contains=@Perl keepend endif endif " Directive syn keyword tt2_directive contained \ GET CALL SET DEFAULT DEBUG \ LAST NEXT BREAK STOP BLOCK \ IF IN UNLESS ELSIF FOR FOREACH WHILE SWITCH CASE \ USE PLUGIN MACRO META \ TRY FINAL RETURN LAST \ CLEAR TO STEP AND OR NOT MOD DIV \ ELSE PERL RAWPERL END syn match tt2_directive +|+ contained syn keyword tt2_directive contained nextgroup=tt2_string_q,tt2_string_qq,tt2_blockname skipwhite skipempty \ INSERT INCLUDE PROCESS WRAPPER FILTER \ THROW CATCH syn keyword tt2_directive contained nextgroup=tt2_def_tag skipwhite skipempty \ TAGS syn match tt2_def_tag "\S\+\s\+\S\+\|\<\w\+\>" contained syn match tt2_variable +\I\w*+ contained syn match tt2_operator "[+*/%:?-]" contained syn match tt2_operator "\<\(mod\|div\|or\|and\|not\)\>" contained syn match tt2_operator "[!=<>]=\=\|&&\|||" contained syn match tt2_operator "\(\s\)\@<=_\(\s\)\@=" contained syn match tt2_operator "=>\|," contained syn match tt2_deref "\([[:alnum:]_)\]}]\s*\)\@<=\." contained syn match tt2_comment +#.*$+ contained extend syn match tt2_func +\<\I\w*\(\s*(\)\@=+ contained nextgroup=tt2_bracket_r skipempty skipwhite " syn region tt2_bracket_r start=+(+ end=+)+ contained contains=@tt2_statement_cluster keepend extend syn region tt2_bracket_b start=+\[+ end=+]+ contained contains=@tt2_statement_cluster keepend extend syn region tt2_bracket_b start=+{+ end=+}+ contained contains=@tt2_statement_cluster keepend extend syn region tt2_string_qq start=+"+ end=+"+ skip=+\\"+ contained contains=tt2_ivariable keepend extend syn region tt2_string_q start=+'+ end=+'+ skip=+\\'+ contained keepend extend syn match tt2_ivariable +\$\I\w*\>\(\.\I\w*\>\)*+ contained syn match tt2_ivariable +\${\I\w*\>\(\.\I\w*\>\)*}+ contained syn match tt2_number "\d\+" contained syn match tt2_number "\d\+\.\d\+" contained syn match tt2_number "0x\x\+" contained syn match tt2_number "0\o\+" contained syn match tt2_blockname "\f\+" contained nextgroup=tt2_blockname_joint skipwhite skipempty syn match tt2_blockname "$\w\+" contained contains=tt2_ivariable nextgroup=tt2_blockname_joint skipwhite skipempty syn region tt2_blockname start=+"+ end=+"+ skip=+\\"+ contained contains=tt2_ivariable nextgroup=tt2_blockname_joint keepend skipwhite skipempty syn region tt2_blockname start=+'+ end=+'+ skip=+\\'+ contained nextgroup=tt2_blockname_joint keepend skipwhite skipempty syn match tt2_blockname_joint "+" contained nextgroup=tt2_blockname skipwhite skipempty syn cluster tt2_statement_cluster contains=tt2_directive,tt2_variable,tt2_operator,tt2_string_q,tt2_string_qq,tt2_deref,tt2_comment,tt2_func,tt2_bracket_b,tt2_bracket_r,tt2_number " Synchronizing syn sync minlines=50 hi def link tt2_tag Type hi def link tt2_tag_region Type hi def link tt2_commentblock_region Comment hi def link tt2_directive Statement hi def link tt2_variable Identifier hi def link tt2_ivariable Identifier hi def link tt2_operator Statement hi def link tt2_string_qq String hi def link tt2_string_q String hi def link tt2_blockname String hi def link tt2_comment Comment hi def link tt2_func Function hi def link tt2_number Number if exists("b:tt2_syn_tags") unlet b:tt2_syn_tags endif let b:current_syntax = "tt2" let &cpo = s:cpo_save unlet s:cpo_save " vim:ts=4:sw=4 vim-7.4.1689/runtime/syntax/tt2html.vim000066400000000000000000000010041267703067000177140ustar00rootroot00000000000000" Language: TT2 embedded with HTML " Maintainer: vim-perl " Author: Moriki, Atsushi <4woods+vim@gmail.com> " Homepage: http://github.com/vim-perl/vim-perl " Bugs/requests: http://github.com/vim-perl/vim-perl/issues " Last Change: 2013-07-21 if exists("b:current_syntax") finish endif runtime! syntax/html.vim unlet b:current_syntax runtime! syntax/tt2.vim unlet b:current_syntax syn cluster htmlPreProc add=@tt2_top_cluster let b:current_syntax = "tt2html" vim-7.4.1689/runtime/syntax/tt2js.vim000066400000000000000000000010121267703067000173630ustar00rootroot00000000000000" Language: TT2 embedded with Javascript " Maintainer: Andy Lester " Author: Yates, Peter " Homepage: http://github.com/vim-perl/vim-perl " Bugs/requests: http://github.com/vim-perl/vim-perl/issues " Last Change: 2013-07-21 if exists("b:current_syntax") finish endif runtime! syntax/javascript.vim unlet b:current_syntax runtime! syntax/tt2.vim unlet b:current_syntax syn cluster javascriptPreProc add=@tt2_top_cluster let b:current_syntax = "tt2js" vim-7.4.1689/runtime/syntax/uc.vim000066400000000000000000000154151267703067000167400ustar00rootroot00000000000000" Vim syntax file " Language: UnrealScript " Maintainer: Mark Ferrell " 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="\" 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/udevconf.vim000066400000000000000000000022771267703067000201440ustar00rootroot00000000000000" Vim syntax file " Language: udev(8) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2006-04-19 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn keyword udevconfTodo contained TODO FIXME XXX NOTE syn region udevconfComment display oneline start='^\s*#' end='$' \ contains=udevconfTodo,@Spell syn match udevconfBegin display '^' \ nextgroup=udevconfVariable,udevconfComment \ skipwhite syn keyword udevconfVariable contained udev_root udev_db udev_rules udev_log \ nextgroup=udevconfVariableEq syn match udevconfVariableEq contained '[[:space:]=]' \ nextgroup=udevconfString skipwhite syn region udevconfString contained display oneline start=+"+ end=+"+ hi def link udevconfTodo Todo hi def link udevconfComment Comment hi def link udevconfVariable Identifier hi def link udevconfVariableEq Operator hi def link udevconfString String let b:current_syntax = "udevconf" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/udevperm.vim000066400000000000000000000045351267703067000201610ustar00rootroot00000000000000" Vim syntax file " Language: udev(8) permissions file " Maintainer: Nikolai Weibull " Latest Revision: 2006-04-19 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn match udevpermBegin display '^' nextgroup=udevpermDevice syn match udevpermDevice contained display '[^:]\+' \ contains=udevpermPattern \ nextgroup=udevpermUserColon syn match udevpermPattern contained '[*?]' syn region udevpermPattern contained start='\[!\=' end='\]' \ contains=udevpermPatRange syn match udevpermPatRange contained '[^[-]-[^]-]' syn match udevpermUserColon contained display ':' \ nextgroup=udevpermUser syn match udevpermUser contained display '[^:]\+' \ nextgroup=udevpermGroupColon syn match udevpermGroupColon contained display ':' \ nextgroup=udevpermGroup syn match udevpermGroup contained display '[^:]\+' \ nextgroup=udevpermPermColon syn match udevpermPermColon contained display ':' \ nextgroup=udevpermPerm syn match udevpermPerm contained display '\<0\=\o\+\>' \ contains=udevpermOctalZero syn match udevpermOctalZero contained display '\<0' syn match udevpermOctalError contained display '\<0\o*[89]\d*\>' syn keyword udevpermTodo contained TODO FIXME XXX NOTE syn region udevpermComment display oneline start='^\s*#' end='$' \ contains=udevpermTodo,@Spell hi def link udevpermTodo Todo hi def link udevpermComment Comment hi def link udevpermDevice String hi def link udevpermPattern SpecialChar hi def link udevpermPatRange udevpermPattern hi def link udevpermColon Normal hi def link udevpermUserColon udevpermColon hi def link udevpermUser Identifier hi def link udevpermGroupColon udevpermColon hi def link udevpermGroup Type hi def link udevpermPermColon udevpermColon hi def link udevpermPerm Number hi def link udevpermOctalZero PreProc hi def link udevpermOctalError Error let b:current_syntax = "udevperm" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/udevrules.vim000066400000000000000000000154441267703067000203510ustar00rootroot00000000000000" Vim syntax file " Language: udev(8) rules file " Maintainer: Nikolai Weibull " Latest Revision: 2006-12-18 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim " TODO: Line continuations. syn keyword udevrulesTodo contained TODO FIXME XXX NOTE syn region udevrulesComment display oneline start='^\s*#' end='$' \ contains=udevrulesTodo,@Spell syn keyword udevrulesRuleKey ACTION DEVPATH KERNEL SUBSYSTEM KERNELS \ SUBSYSTEMS DRIVERS RESULT \ nextgroup=udevrulesRuleTest \ skipwhite syn keyword udevrulesRuleKey ATTRS nextgroup=udevrulesAttrsPath syn region udevrulesAttrsPath display transparent \ matchgroup=udevrulesDelimiter start='{' \ matchgroup=udevrulesDelimiter end='}' \ contains=udevrulesPath \ nextgroup=udevrulesRuleTest \ skipwhite syn keyword udevrulesRuleKey ENV nextgroup=udevrulesEnvVar syn region udevrulesEnvVar display transparent \ matchgroup=udevrulesDelimiter start='{' \ matchgroup=udevrulesDelimiter end='}' \ contains=udevrulesVariable \ nextgroup=udevrulesRuleTest,udevrulesRuleEq \ skipwhite syn keyword udevrulesRuleKey PROGRAM RESULT \ nextgroup=udevrulesEStringTest,udevrulesEStringEq \ skipwhite syn keyword udevrulesAssignKey NAME SYMLINK OWNER GROUP RUN \ nextgroup=udevrulesEStringEq \ skipwhite syn keyword udevrulesAssignKey MODE LABEL GOTO WAIT_FOR_SYSFS \ nextgroup=udevrulesRuleEq \ skipwhite syn keyword udevrulesAssignKey ATTR nextgroup=udevrulesAttrsPath syn region udevrulesAttrKey display transparent \ matchgroup=udevrulesDelimiter start='{' \ matchgroup=udevrulesDelimiter end='}' \ contains=udevrulesKey \ nextgroup=udevrulesRuleEq \ skipwhite syn keyword udevrulesAssignKey IMPORT nextgroup=udevrulesImport, \ udevrulesEStringEq \ skipwhite syn region udevrulesImport display transparent \ matchgroup=udevrulesDelimiter start='{' \ matchgroup=udevrulesDelimiter end='}' \ contains=udevrulesImportType \ nextgroup=udevrulesEStringEq \ skipwhite syn keyword udevrulesImportType program file parent syn keyword udevrulesAssignKey OPTIONS \ nextgroup=udevrulesOptionsEq syn match udevrulesPath contained display '[^}]\+' syn match udevrulesVariable contained display '[^}]\+' syn match udevrulesRuleTest contained display '[=!:]=' \ nextgroup=udevrulesString skipwhite syn match udevrulesEStringTest contained display '[=!+:]=' \ nextgroup=udevrulesEString skipwhite syn match udevrulesRuleEq contained display '+=\|=\ze[^=]' \ nextgroup=udevrulesString skipwhite syn match udevrulesEStringEq contained '+=\|=\ze[^=]' \ nextgroup=udevrulesEString skipwhite syn match udevrulesOptionsEq contained '+=\|=\ze[^=]' \ nextgroup=udevrulesOptions skipwhite syn region udevrulesEString contained display oneline start=+"+ end=+"+ \ contains=udevrulesStrEscapes,udevrulesStrVars syn match udevrulesStrEscapes contained '%[knpbMmcPrN%]' " TODO: This can actually stand alone (without {…}), so add a nextgroup here. syn region udevrulesStrEscapes contained start='%c{' end='}' \ contains=udevrulesStrNumber syn region udevrulesStrEscapes contained start='%s{' end='}' \ contains=udevrulesPath syn region udevrulesStrEscapes contained start='%E{' end='}' \ contains=udevrulesVariable syn match udevrulesStrNumber contained '\d\++\=' syn match udevrulesStrVars contained display '$\%(kernel\|number\|devpath\|id\|major\|minor\|result\|parent\|root\|tempnode\)\>' syn region udevrulesStrVars contained start='$attr{' end='}' \ contains=udevrulesPath syn region udevrulesStrVars contained start='$env{' end='}' \ contains=udevrulesVariable syn match udevrulesStrVars contained display '\$\$' syn region udevrulesString contained display oneline start=+"+ end=+"+ \ contains=udevrulesPattern syn match udevrulesPattern contained '[*?]' syn region udevrulesPattern contained start='\[!\=' end='\]' \ contains=udevrulesPatRange syn match udevrulesPatRange contained '[^[-]-[^]-]' syn region udevrulesOptions contained display oneline start=+"+ end=+"+ \ contains=udevrulesOption,udevrulesOptionSep syn keyword udevrulesOption contained last_rule ignore_device ignore_remove \ all_partitions syn match udevrulesOptionSep contained ',' hi def link udevrulesTodo Todo hi def link udevrulesComment Comment hi def link udevrulesRuleKey Keyword hi def link udevrulesDelimiter Delimiter hi def link udevrulesAssignKey Identifier hi def link udevrulesPath Identifier hi def link udevrulesVariable Identifier hi def link udevrulesAttrKey Identifier " XXX: setting this to Operator makes for extremely intense highlighting. hi def link udevrulesEq Normal hi def link udevrulesRuleEq udevrulesEq hi def link udevrulesEStringEq udevrulesEq hi def link udevrulesOptionsEq udevrulesEq hi def link udevrulesEString udevrulesString hi def link udevrulesStrEscapes SpecialChar hi def link udevrulesStrNumber Number hi def link udevrulesStrVars Identifier hi def link udevrulesString String hi def link udevrulesPattern SpecialChar hi def link udevrulesPatRange SpecialChar hi def link udevrulesOptions udevrulesString hi def link udevrulesOption Type hi def link udevrulesOptionSep Delimiter hi def link udevrulesImportType Type let b:current_syntax = "udevrules" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/uil.vim000066400000000000000000000056671267703067000171320ustar00rootroot00000000000000" Vim syntax file " Language: Motif UIL (User Interface Language) " Maintainer: Thomas Koehler " Last Change: 2013 May 23 " URL: http://gott-gehabt.de/800_wer_wir_sind/thomas/Homepage/Computer/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 constants " Highlight special characters (those which have a backslash) differently syn match uilSpecial contained "\\\d\d\d\|\\." syn region uilString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell,uilSpecial syn match uilCharacter "'[^\\]'" syn region uilString start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@Spell,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]\x\+\>" syn region uilComment start="/\*" end="\*/" contains=@Spell,uilTodo syn match uilComment "!.*" contains=@Spell,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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/updatedb.vim000066400000000000000000000022701267703067000201140ustar00rootroot00000000000000" Vim syntax file " Language: updatedb.conf(5) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2009-05-25 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn keyword updatedbTodo contained TODO FIXME XXX NOTE syn region updatedbComment display oneline start='^\s*#' end='$' \ contains=updatedbTodo,@Spell syn match updatedbBegin display '^' \ nextgroup=updatedbName,updatedbComment skipwhite syn keyword updatedbName contained \ PRUNEFS \ PRUNENAMES \ PRUNEPATHS \ PRUNE_BIND_MOUNTS \ nextgroup=updatedbNameEq syn match updatedbNameEq contained display '=' nextgroup=updatedbValue syn region updatedbValue contained display oneline start='"' end='"' hi def link updatedbTodo Todo hi def link updatedbComment Comment hi def link updatedbName Identifier hi def link updatedbNameEq Operator hi def link updatedbValue String let b:current_syntax = "updatedb" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/upstart.vim000066400000000000000000000061051267703067000200270ustar00rootroot00000000000000" Vim syntax file " Language: Upstart job files " Maintainer: Michael Biebl " James Hunt " Last Change: 2012 Jan 16 " License: The Vim license " Version: 0.4 " Remark: Syntax highlighting for Upstart (init(8)) job files. " " It is inspired by the initng syntax file and includes sh.vim to do the " highlighting of script blocks. if version < 600 syntax clear elseif exists("b:current_syntax") finish endif let is_bash = 1 syn include @Shell syntax/sh.vim syn case match " avoid need to use 'match' for most events setlocal iskeyword+=- syn match upstartComment /#.*$/ contains=upstartTodo syn keyword upstartTodo TODO FIXME contained syn region upstartString start=/"/ end=/"/ skip=/\\"/ syn region upstartScript matchgroup=upstartStatement start="script" end="end script" contains=@upstartShellCluster syn cluster upstartShellCluster contains=@Shell " one argument syn keyword upstartStatement description author version instance expect syn keyword upstartStatement pid kill normal console env exit export syn keyword upstartStatement umask nice oom chroot chdir exec " two arguments syn keyword upstartStatement limit " one or more arguments (events) syn keyword upstartStatement emits syn keyword upstartStatement on start stop " flag, no parameter syn keyword upstartStatement respawn service instance manual debug task " prefix for exec or script syn keyword upstartOption pre-start post-start pre-stop post-stop " option for kill syn keyword upstartOption timeout " option for oom syn keyword upstartOption never " options for console syn keyword upstartOption output owner " options for expect syn keyword upstartOption fork daemon " options for limit syn keyword upstartOption unlimited " 'options' for start/stop on syn keyword upstartOption and or " Upstart itself and associated utilities syn keyword upstartEvent runlevel syn keyword upstartEvent started syn keyword upstartEvent starting syn keyword upstartEvent startup syn keyword upstartEvent stopped syn keyword upstartEvent stopping syn keyword upstartEvent control-alt-delete syn keyword upstartEvent keyboard-request syn keyword upstartEvent power-status-changed " D-Bus syn keyword upstartEvent dbus-activation " Display Manager (ie gdm) syn keyword upstartEvent desktop-session-start syn keyword upstartEvent login-session-start " mountall syn keyword upstartEvent all-swaps syn keyword upstartEvent filesystem syn keyword upstartEvent mounted syn keyword upstartEvent mounting syn keyword upstartEvent local-filesystems syn keyword upstartEvent remote-filesystems syn keyword upstartEvent virtual-filesystems " SysV umountnfs.sh syn keyword upstartEvent mounted-remote-filesystems " upstart-udev-bridge and ifup/down syn match upstartEvent /\<\i\{-1,}-device-\(added\|removed\|up\|down\)/ " upstart-socket-bridge syn keyword upstartEvent socket hi def link upstartComment Comment hi def link upstartTodo Todo hi def link upstartString String hi def link upstartStatement Statement hi def link upstartOption Type hi def link upstartEvent Define let b:current_syntax = "upstart" vim-7.4.1689/runtime/syntax/upstreamdat.vim000066400000000000000000000333401267703067000206570ustar00rootroot00000000000000" Vim syntax file " Language: Innovation Data Processing upstream.dat file " Maintainer: Rob Owens " Latest Revision: 2013-11-27 " Quit when a syntax file was already loaded if exists("b:current_syntax") finish endif " Parameters: syn keyword upstreamdat_Parameter ACCEPTPCREMOTE syn keyword upstreamdat_Parameter ACCEPTREMOTE syn keyword upstreamdat_Parameter ACTION syn keyword upstreamdat_Parameter ACTIVATEONENTRY syn keyword upstreamdat_Parameter ARCHIVEBIT syn keyword upstreamdat_Parameter ARCHIVEBIT syn keyword upstreamdat_Parameter ASCTOEBC syn keyword upstreamdat_Parameter ASRBACKUP syn keyword upstreamdat_Parameter ATTENDED syn keyword upstreamdat_Parameter AUTHORITATIVE syn keyword upstreamdat_Parameter AUTHORITATIVERESTORE syn keyword upstreamdat_Parameter AUTHORITATIVERESTORE syn keyword upstreamdat_Parameter BACKUPPROFILE syn keyword upstreamdat_Parameter BACKUPPROFILE2 syn keyword upstreamdat_Parameter BACKUPREPARSEFILES syn keyword upstreamdat_Parameter BACKUPREPARSEFILES syn keyword upstreamdat_Parameter BACKUPVERIFY syn keyword upstreamdat_Parameter BLANKTRUNC syn keyword upstreamdat_Parameter CALCDASDSIZE syn keyword upstreamdat_Parameter CHANGEDIRATTRIBS syn keyword upstreamdat_Parameter CHANGEDIRATTRIBS syn keyword upstreamdat_Parameter COMPRESSLEVEL syn keyword upstreamdat_Parameter CONTROLFILE syn keyword upstreamdat_Parameter DASDOVERRIDE syn keyword upstreamdat_Parameter DATELIMIT syn keyword upstreamdat_Parameter DATELIMIT syn keyword upstreamdat_Parameter DAYSOLD syn keyword upstreamdat_Parameter DAYSOLD syn keyword upstreamdat_Parameter DELETED syn keyword upstreamdat_Parameter DELETED syn keyword upstreamdat_Parameter DELETEPROMPTS syn keyword upstreamdat_Parameter DELETEPROMPTS syn keyword upstreamdat_Parameter DESTINATION syn keyword upstreamdat_Parameter DESTINATION syn keyword upstreamdat_Parameter DIRDELETE syn keyword upstreamdat_Parameter DIRECTORVMC syn keyword upstreamdat_Parameter DIRONLYRESTOREOK syn keyword upstreamdat_Parameter DIRSONLY syn keyword upstreamdat_Parameter DIRSONLY syn keyword upstreamdat_Parameter DISASTERRECOVERY syn keyword upstreamdat_Parameter DISPLAY syn keyword upstreamdat_Parameter DRIVEALIAS syn keyword upstreamdat_Parameter DRIVEALIAS syn keyword upstreamdat_Parameter DUALCOPY syn keyword upstreamdat_Parameter DUPDAYS syn keyword upstreamdat_Parameter DUPLICATE syn keyword upstreamdat_Parameter EBCTOASC syn keyword upstreamdat_Parameter ENCRYPT syn keyword upstreamdat_Parameter ENCRYPTLEVEL syn keyword upstreamdat_Parameter EXCLUDELISTNAME syn keyword upstreamdat_Parameter FAILBACKUPONERROR syn keyword upstreamdat_Parameter FAILBACKUPONERROR syn keyword upstreamdat_Parameter FAILIFNOFILES syn keyword upstreamdat_Parameter FAILIFNOFILES syn keyword upstreamdat_Parameter FAILIFSKIP syn keyword upstreamdat_Parameter FAILJOB syn keyword upstreamdat_Parameter FAILRESTOREONERROR syn keyword upstreamdat_Parameter FAILRESTOREONERROR syn keyword upstreamdat_Parameter FILEDATE syn keyword upstreamdat_Parameter FILEDATE syn keyword upstreamdat_Parameter FILEDELETE syn keyword upstreamdat_Parameter FILEDELETE syn keyword upstreamdat_Parameter FILES syn keyword upstreamdat_Parameter FILES syn keyword upstreamdat_Parameter FILESOPENFORUPDAT syn keyword upstreamdat_Parameter FILESOPENFORUPDAT syn keyword upstreamdat_Parameter FILETRANSFER syn keyword upstreamdat_Parameter GETREMOTEFILES syn keyword upstreamdat_Parameter HARDLINKDB syn keyword upstreamdat_Parameter HARDLINKS syn keyword upstreamdat_Parameter HARDLINKS syn keyword upstreamdat_Parameter HIDDENFILES syn keyword upstreamdat_Parameter HIDDENFILES syn keyword upstreamdat_Parameter HOLDTAPE syn keyword upstreamdat_Parameter HOLDUSERDIRS syn keyword upstreamdat_Parameter HOSTFILENAME syn keyword upstreamdat_Parameter HOSTRECORD syn keyword upstreamdat_Parameter HOSTSORT syn keyword upstreamdat_Parameter IGNOREPLUGINSFORRESTORE syn keyword upstreamdat_Parameter INCRDB syn keyword upstreamdat_Parameter INCRDBARCHIVEBIT syn keyword upstreamdat_Parameter INCRDBDELETEDFILES syn keyword upstreamdat_Parameter INCREMENTAL syn keyword upstreamdat_Parameter INCREMENTAL syn keyword upstreamdat_Parameter INQOPTIONS syn keyword upstreamdat_Parameter INSTALLWIN2KAGENT syn keyword upstreamdat_Parameter INSTALLWIN2KAGENT syn keyword upstreamdat_Parameter JOBOPTIONS syn keyword upstreamdat_Parameter JOBRETURNCODEMAP syn keyword upstreamdat_Parameter JOBWAITTIMELIMIT syn keyword upstreamdat_Parameter KEEPALIVE syn keyword upstreamdat_Parameter LANINTERFACE syn keyword upstreamdat_Parameter LANWSNAME syn keyword upstreamdat_Parameter LANWSPASSWORD syn keyword upstreamdat_Parameter LASTACCESS syn keyword upstreamdat_Parameter LASTACCESS syn keyword upstreamdat_Parameter LATESTDATE syn keyword upstreamdat_Parameter LATESTDATE syn keyword upstreamdat_Parameter LATESTTIME syn keyword upstreamdat_Parameter LATESTTIME syn keyword upstreamdat_Parameter LATESTVERSION syn keyword upstreamdat_Parameter LINEBLOCK syn keyword upstreamdat_Parameter LINETRUNC syn keyword upstreamdat_Parameter LISTENFORREMOTE syn keyword upstreamdat_Parameter LOCALBACKUP syn keyword upstreamdat_Parameter LOCALBACKUPDIR syn keyword upstreamdat_Parameter LOCALBACKUPMAX syn keyword upstreamdat_Parameter LOCALBACKUPMAXFILESIZE syn keyword upstreamdat_Parameter LOCALBACKUPMAXSIZE syn keyword upstreamdat_Parameter LOCALEXCLUDEFILE syn keyword upstreamdat_Parameter LOCALPARAMETERS syn keyword upstreamdat_Parameter LOCALPASSWORD syn keyword upstreamdat_Parameter LOCALRESTORE syn keyword upstreamdat_Parameter LOCALUSER syn keyword upstreamdat_Parameter LOFS syn keyword upstreamdat_Parameter LOGNONFATAL syn keyword upstreamdat_Parameter MAXBACKUPFILESFAIL syn keyword upstreamdat_Parameter MAXBACKUPTIME syn keyword upstreamdat_Parameter MAXDUPS syn keyword upstreamdat_Parameter MAXFILENAMESIZE syn keyword upstreamdat_Parameter MAXKFILESIZE syn keyword upstreamdat_Parameter MAXLOGDAYS syn keyword upstreamdat_Parameter MAXRESTOREFILESFAIL syn keyword upstreamdat_Parameter MAXRESTORETIME syn keyword upstreamdat_Parameter MAXRETRY syn keyword upstreamdat_Parameter MAXRPTDAYS syn keyword upstreamdat_Parameter MERGE syn keyword upstreamdat_Parameter MIGRBITS syn keyword upstreamdat_Parameter MIGRBITS syn keyword upstreamdat_Parameter MINCOMPRESSSIZE syn keyword upstreamdat_Parameter MINIMIZE syn keyword upstreamdat_Parameter MODIFYFILE syn keyword upstreamdat_Parameter MOUNTPOINTS syn keyword upstreamdat_Parameter MOUNTPOINTS syn keyword upstreamdat_Parameter NDS syn keyword upstreamdat_Parameter NDS syn keyword upstreamdat_Parameter NEWFILECOMPARE syn keyword upstreamdat_Parameter NFSBELOW syn keyword upstreamdat_Parameter NODATAOK syn keyword upstreamdat_Parameter NODIRFORINCREMENTAL syn keyword upstreamdat_Parameter NODIRFORINCREMENTAL syn keyword upstreamdat_Parameter NONFILEDATABITMAP syn keyword upstreamdat_Parameter NONFILEDATABITMAP syn keyword upstreamdat_Parameter NOPOINTRESTORE syn keyword upstreamdat_Parameter NOSPECINHERITANCE syn keyword upstreamdat_Parameter NOTIFYEVENTS syn keyword upstreamdat_Parameter NOTIFYFAILUREATTACHMENT syn keyword upstreamdat_Parameter NOTIFYSUCCESSATTACHMENT syn keyword upstreamdat_Parameter NOTIFYTARGETS syn keyword upstreamdat_Parameter NOUIDGIDNAMES syn keyword upstreamdat_Parameter NOUIDGIDNAMES syn keyword upstreamdat_Parameter NOVELLMIGRATE syn keyword upstreamdat_Parameter NOVELLMIGRATE syn keyword upstreamdat_Parameter NOVELLMIGRATEADDEXT syn keyword upstreamdat_Parameter NOVELLMIGRATEADDEXT syn keyword upstreamdat_Parameter NOVELLPROFILE syn keyword upstreamdat_Parameter NOVELLRECALL syn keyword upstreamdat_Parameter NTFSADDPERMISSION syn keyword upstreamdat_Parameter NTFSADDPERMISSION syn keyword upstreamdat_Parameter NTREGRESTORE syn keyword upstreamdat_Parameter OSTYPE syn keyword upstreamdat_Parameter OUTPORT syn keyword upstreamdat_Parameter PACKFLUSHAFTERFILE syn keyword upstreamdat_Parameter PACKRECSIZE syn keyword upstreamdat_Parameter PARAMETER syn keyword upstreamdat_Parameter PASSWORD syn keyword upstreamdat_Parameter PATHNAME syn keyword upstreamdat_Parameter PATHNAME syn keyword upstreamdat_Parameter PERFORMBITMAP syn keyword upstreamdat_Parameter PERFORMNUMRECORDS syn keyword upstreamdat_Parameter PERFORMRECORDSIZE syn keyword upstreamdat_Parameter PLUGIN syn keyword upstreamdat_Parameter PLUGIN syn keyword upstreamdat_Parameter PLUGINPARAMETERS syn keyword upstreamdat_Parameter PLUGINPARAMETERS syn keyword upstreamdat_Parameter POSTJOB syn keyword upstreamdat_Parameter PREJOB syn keyword upstreamdat_Parameter PRTYCLASS syn keyword upstreamdat_Parameter PRTYLEVEL syn keyword upstreamdat_Parameter RECALLCLEANUP syn keyword upstreamdat_Parameter RECALLOFFLINEFILES syn keyword upstreamdat_Parameter RECALLOFFLINEFILES syn keyword upstreamdat_Parameter RECORDSIZE syn keyword upstreamdat_Parameter REMOTEADDR syn keyword upstreamdat_Parameter REMOTEAPPLPREF syn keyword upstreamdat_Parameter REMOTEAPPLRETRY syn keyword upstreamdat_Parameter REMOTECONNECTTYPE syn keyword upstreamdat_Parameter REMOTEFLAGS syn keyword upstreamdat_Parameter REMOTEIPADAPTER syn keyword upstreamdat_Parameter REMOTELOCALPARAMETERS syn keyword upstreamdat_Parameter REMOTELOGMODE syn keyword upstreamdat_Parameter REMOTELUNAME syn keyword upstreamdat_Parameter REMOTEMAXRETRIES syn keyword upstreamdat_Parameter REMOTEMODENAME syn keyword upstreamdat_Parameter REMOTEPARAMETERFILE syn keyword upstreamdat_Parameter REMOTEPORT syn keyword upstreamdat_Parameter REMOTEREQUEST syn keyword upstreamdat_Parameter REMOTERESTART syn keyword upstreamdat_Parameter REMOTEROUTE syn keyword upstreamdat_Parameter REMOTETARGETNAME syn keyword upstreamdat_Parameter REMOTETCP syn keyword upstreamdat_Parameter REMOTETIMEOUT syn keyword upstreamdat_Parameter REMOTETMAXRETRY syn keyword upstreamdat_Parameter REMOTETPN syn keyword upstreamdat_Parameter REMOTEUSAPPL syn keyword upstreamdat_Parameter REMOTEVERIFY syn keyword upstreamdat_Parameter REMOTEWTOCOMP syn keyword upstreamdat_Parameter REPORTNAME syn keyword upstreamdat_Parameter REPORTOPTIONS syn keyword upstreamdat_Parameter RESTARTLASTFILE syn keyword upstreamdat_Parameter RESTART syn keyword upstreamdat_Parameter RESTARTTYPE syn keyword upstreamdat_Parameter RESTARTVERSIONDATE syn keyword upstreamdat_Parameter RESTOREARCHIVEBIT syn keyword upstreamdat_Parameter RESTORECHECKPOINT syn keyword upstreamdat_Parameter RESTOREDATELIMIT syn keyword upstreamdat_Parameter RESTOREDATELIMIT syn keyword upstreamdat_Parameter RESTOREFILEFAIL syn keyword upstreamdat_Parameter RESTOREMOUNTPOINTS syn keyword upstreamdat_Parameter RESTOREMOUNTPOINTS syn keyword upstreamdat_Parameter RESTORESEGMENTS syn keyword upstreamdat_Parameter RESTORESEGMENTS syn keyword upstreamdat_Parameter RESTORETODIFFFS syn keyword upstreamdat_Parameter RETAIN syn keyword upstreamdat_Parameter RETAIN syn keyword upstreamdat_Parameter ROOTENTRY syn keyword upstreamdat_Parameter ROOTENTRY syn keyword upstreamdat_Parameter SAN syn keyword upstreamdat_Parameter SCHEDULENAME syn keyword upstreamdat_Parameter SEGMENTEDFILESIZE syn keyword upstreamdat_Parameter SEGMENTEDFILESIZE syn keyword upstreamdat_Parameter SEGMENTSIZE syn keyword upstreamdat_Parameter SEGMENTSIZE syn keyword upstreamdat_Parameter SENDHOSTDETAILS syn keyword upstreamdat_Parameter SINGLEFS syn keyword upstreamdat_Parameter SIZETRC syn keyword upstreamdat_Parameter SKIP syn keyword upstreamdat_Parameter SKIPBACKUPSCAN syn keyword upstreamdat_Parameter SKIPOLD syn keyword upstreamdat_Parameter SKIPOLD syn keyword upstreamdat_Parameter SMSTARGETSERVICENAME syn keyword upstreamdat_Parameter SMSTSA syn keyword upstreamdat_Parameter SOLO syn keyword upstreamdat_Parameter SORTBACKUP syn keyword upstreamdat_Parameter SOSDISK syn keyword upstreamdat_Parameter SOSDISK syn keyword upstreamdat_Parameter SOSTIMESTAMP syn keyword upstreamdat_Parameter SOSTIMESTAMP syn keyword upstreamdat_Parameter SOSTIMESTAMPPATH syn keyword upstreamdat_Parameter SOSTIMESTAMPPATH syn keyword upstreamdat_Parameter SPECNUMBER syn keyword upstreamdat_Parameter SPECNUMBER syn keyword upstreamdat_Parameter SPECTYPE syn keyword upstreamdat_Parameter SPECTYPE syn keyword upstreamdat_Parameter STARTTIME syn keyword upstreamdat_Parameter STORAGETYPE syn keyword upstreamdat_Parameter SUBDIRECTORIES syn keyword upstreamdat_Parameter SUBDIRECTORIES syn keyword upstreamdat_Parameter SWITCHTOTAPEMB syn keyword upstreamdat_Parameter TCPADDRESS syn keyword upstreamdat_Parameter TCPTIMEOUT syn keyword upstreamdat_Parameter TIMEOVERRIDE syn keyword upstreamdat_Parameter TRACE syn keyword upstreamdat_Parameter TRANSLATE syn keyword upstreamdat_Parameter ULTRACOMP syn keyword upstreamdat_Parameter ULTREG syn keyword upstreamdat_Parameter ULTUPD syn keyword upstreamdat_Parameter UNCMACHINEALIAS syn keyword upstreamdat_Parameter UNCMACHINEALIAS syn keyword upstreamdat_Parameter USEALEBRA syn keyword upstreamdat_Parameter USECONTROLFILE syn keyword upstreamdat_Parameter USEGID syn keyword upstreamdat_Parameter USERID syn keyword upstreamdat_Parameter USEUID syn keyword upstreamdat_Parameter USNOUIDGIDERRORS syn keyword upstreamdat_Parameter UTF8 syn keyword upstreamdat_Parameter VAULTNUMBER syn keyword upstreamdat_Parameter VERSIONDATE syn keyword upstreamdat_Parameter WRITESPARSE syn keyword upstreamdat_Parameter XFERECORDSIZE syn keyword upstreamdat_Parameter XFERRECSEP syn keyword upstreamdat_Parameter XFERRECUSECR " File Specs: syn match upstreamdat_Filespec /file spec\c \d\{1,3}.*/ " Comments: syn match upstreamdat_Comment /^#.*/ hi def link upstreamdat_Parameter Type "hi def link upstreamdat_Filespec Underlined hi def link upstreamdat_Comment Comment let b:current_syntax = "upstreamdat" vim-7.4.1689/runtime/syntax/upstreaminstalllog.vim000066400000000000000000000017131267703067000222560ustar00rootroot00000000000000" Vim syntax file " Language: Innovation Data Processing UPSTREAMInstall.log file " Maintainer: Rob Owens " Latest Revision: 2013-06-17 " Quit when a syntax file was already loaded if exists("b:current_syntax") finish endif " Date: syn match upstreaminstalllog_Date /\u\l\l \u\l\l\s\{1,2}\d\{1,2} \d\d:\d\d:\d\d \d\d\d\d/ " Msg Types: syn match upstreaminstalllog_MsgD /Msg #MSI\d\{4,5}D/ syn match upstreaminstalllog_MsgE /Msg #MSI\d\{4,5}E/ syn match upstreaminstalllog_MsgI /Msg #MSI\d\{4,5}I/ syn match upstreaminstalllog_MsgW /Msg #MSI\d\{4,5}W/ " IP Address: syn match upstreaminstalllog_IPaddr / \d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}/ hi def link upstreaminstalllog_Date Underlined hi def link upstreaminstalllog_MsgD Type hi def link upstreaminstalllog_MsgE Error hi def link upstreaminstalllog_MsgW Constant hi def link upstreaminstalllog_IPaddr Identifier let b:current_syntax = "upstreaminstalllog" vim-7.4.1689/runtime/syntax/upstreamlog.vim000066400000000000000000000050741267703067000206730ustar00rootroot00000000000000" Vim syntax file " Language: Innovation Data Processing upstream.log file " Maintainer: Rob Owens " Latest Revision: 2013-09-19 " Quit when a syntax file was already loaded if exists("b:current_syntax") finish endif " Date: syn match upstreamlog_Date /\u\l\l \u\l\l\s\{1,2}\d\{1,2} \d\d:\d\d:\d\d \d\d\d\d/ " Msg Types: syn match upstreamlog_MsgD /Msg #\(Agt\|PC\|Srv\)\d\{4,5}D/ nextgroup=upstreamlog_Process skipwhite syn match upstreamlog_MsgE /Msg #\(Agt\|PC\|Srv\)\d\{4,5}E/ nextgroup=upstreamlog_Process skipwhite syn match upstreamlog_MsgI /Msg #\(Agt\|PC\|Srv\)\d\{4,5}I/ nextgroup=upstreamlog_Process skipwhite syn match upstreamlog_MsgW /Msg #\(Agt\|PC\|Srv\)\d\{4,5}W/ nextgroup=upstreamlog_Process skipwhite " Processes: syn region upstreamlog_Process start="(" end=")" contained " IP Address: syn match upstreamlog_IPaddr /\( \|(\)\zs\d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}/ " Profile: syn match upstreamlog_Profile /Using default configuration for profile \zs\S\{1,8}\ze/ syn match upstreamlog_Profile /Now running profile \zs\S\{1,8}\ze/ syn match upstreamlog_Profile /in profile set \zs\S\{1,8}\ze/ syn match upstreamlog_Profile /Migrate disk backup from profile \zs\S\{1,8}\ze/ syn match upstreamlog_Profile /Profileset=\zs\S\{1,8}\ze,/ syn match upstreamlog_Profile /Vault \(disk\|tape\) backup to vault \d\{1,4} from profile \zs\S\{1,8}\ze/ syn match upstreamlog_Profile /Profile name \zs\"\S\{1,8}\"/ syn match upstreamlog_Profile / Profile: \zs\S\{1,8}/ syn match upstreamlog_Profile / Profile: \zs\S\{1,8}\ze, / syn match upstreamlog_Profile /, profile: \zs\S\{1,8}\ze,/ syn match upstreamlog_Profile /found Profile: \zs\S\{1,8}\ze,/ syn match upstreamlog_Profile /Backup Profile: \zs\S\{1,8}\ze Version date/ syn match upstreamlog_Profile /Backup profile: \zs\S\{1,8}\ze Version date/ syn match upstreamlog_Profile /Full of \zs\S\{1,8}\ze$/ syn match upstreamlog_Profile /Incr. of \zs\S\{1,8}\ze$/ syn match upstreamlog_Profile /Profile=\zs\S\{1,8}\ze,/ " Target: syn region upstreamlog_Target start="Computer: \zs" end="\ze[\]\)]" syn region upstreamlog_Target start="Computer name \zs\"" end="\"\ze" syn region upstreamlog_Target start="request to registered name \zs" end=" " hi def link upstreamlog_Date Underlined hi def link upstreamlog_MsgD Type hi def link upstreamlog_MsgE Error hi def link upstreamlog_MsgW Constant hi def link upstreamlog_Process Statement hi def link upstreamlog_IPaddr Identifier hi def link upstreamlog_Profile Identifier hi def link upstreamlog_Target Identifier let b:current_syntax = "upstreamlog" vim-7.4.1689/runtime/syntax/upstreamrpt.vim000066400000000000000000000335651267703067000207250ustar00rootroot00000000000000" Vim syntax file " Language: Innovation Data Processing upstream.rpt file " Maintainer: Rob Owens " Latest Revision: 2014-03-13 " Quit when a syntax file was already loaded if exists("b:current_syntax") finish endif setlocal foldmethod=syntax " Parameters: syn keyword upstreamdat_Parameter ACCEPTPCREMOTE syn keyword upstreamdat_Parameter ACCEPTREMOTE syn keyword upstreamdat_Parameter ACTION syn keyword upstreamdat_Parameter ACTIVATEONENTRY syn keyword upstreamdat_Parameter ARCHIVEBIT syn keyword upstreamdat_Parameter ARCHIVEBIT syn keyword upstreamdat_Parameter ASCTOEBC syn keyword upstreamdat_Parameter ASRBACKUP syn keyword upstreamdat_Parameter ATTENDED syn keyword upstreamdat_Parameter AUTHORITATIVE syn keyword upstreamdat_Parameter AUTHORITATIVERESTORE syn keyword upstreamdat_Parameter AUTHORITATIVERESTORE syn keyword upstreamdat_Parameter BACKUPPROFILE syn keyword upstreamdat_Parameter BACKUPPROFILE2 syn keyword upstreamdat_Parameter BACKUPREPARSEFILES syn keyword upstreamdat_Parameter BACKUPREPARSEFILES syn keyword upstreamdat_Parameter BACKUPVERIFY syn keyword upstreamdat_Parameter BLANKTRUNC syn keyword upstreamdat_Parameter CALCDASDSIZE syn keyword upstreamdat_Parameter CHANGEDIRATTRIBS syn keyword upstreamdat_Parameter CHANGEDIRATTRIBS syn keyword upstreamdat_Parameter COMPRESSLEVEL syn keyword upstreamdat_Parameter CONTROLFILE syn keyword upstreamdat_Parameter DASDOVERRIDE syn keyword upstreamdat_Parameter DATELIMIT syn keyword upstreamdat_Parameter DATELIMIT syn keyword upstreamdat_Parameter DAYSOLD syn keyword upstreamdat_Parameter DAYSOLD syn keyword upstreamdat_Parameter DELETED syn keyword upstreamdat_Parameter DELETED syn keyword upstreamdat_Parameter DELETEPROMPTS syn keyword upstreamdat_Parameter DELETEPROMPTS syn keyword upstreamdat_Parameter DESTINATION syn keyword upstreamdat_Parameter DESTINATION syn keyword upstreamdat_Parameter DIRDELETE syn keyword upstreamdat_Parameter DIRECTORVMC syn keyword upstreamdat_Parameter DIRONLYRESTOREOK syn keyword upstreamdat_Parameter DIRSONLY syn keyword upstreamdat_Parameter DIRSONLY syn keyword upstreamdat_Parameter DISASTERRECOVERY syn keyword upstreamdat_Parameter DISPLAY syn keyword upstreamdat_Parameter DRIVEALIAS syn keyword upstreamdat_Parameter DRIVEALIAS syn keyword upstreamdat_Parameter DUALCOPY syn keyword upstreamdat_Parameter DUPDAYS syn keyword upstreamdat_Parameter DUPLICATE syn keyword upstreamdat_Parameter EBCTOASC syn keyword upstreamdat_Parameter ENCRYPT syn keyword upstreamdat_Parameter ENCRYPTLEVEL syn keyword upstreamdat_Parameter EXCLUDELISTNAME syn keyword upstreamdat_Parameter FAILBACKUPONERROR syn keyword upstreamdat_Parameter FAILBACKUPONERROR syn keyword upstreamdat_Parameter FAILIFNOFILES syn keyword upstreamdat_Parameter FAILIFNOFILES syn keyword upstreamdat_Parameter FAILIFSKIP syn keyword upstreamdat_Parameter FAILJOB syn keyword upstreamdat_Parameter FAILRESTOREONERROR syn keyword upstreamdat_Parameter FAILRESTOREONERROR syn keyword upstreamdat_Parameter FILEDATE syn keyword upstreamdat_Parameter FILEDATE syn keyword upstreamdat_Parameter FILEDELETE syn keyword upstreamdat_Parameter FILEDELETE syn keyword upstreamdat_Parameter FILES syn keyword upstreamdat_Parameter FILES syn keyword upstreamdat_Parameter FILESOPENFORUPDAT syn keyword upstreamdat_Parameter FILESOPENFORUPDAT syn keyword upstreamdat_Parameter FILETRANSFER syn keyword upstreamdat_Parameter GETREMOTEFILES syn keyword upstreamdat_Parameter HARDLINKDB syn keyword upstreamdat_Parameter HARDLINKS syn keyword upstreamdat_Parameter HARDLINKS syn keyword upstreamdat_Parameter HIDDENFILES syn keyword upstreamdat_Parameter HIDDENFILES syn keyword upstreamdat_Parameter HOLDTAPE syn keyword upstreamdat_Parameter HOLDUSERDIRS syn keyword upstreamdat_Parameter HOSTFILENAME syn keyword upstreamdat_Parameter HOSTRECORD syn keyword upstreamdat_Parameter HOSTSORT syn keyword upstreamdat_Parameter IGNOREPLUGINSFORRESTORE syn keyword upstreamdat_Parameter INCRDB syn keyword upstreamdat_Parameter INCRDBARCHIVEBIT syn keyword upstreamdat_Parameter INCRDBDELETEDFILES syn keyword upstreamdat_Parameter INCREMENTAL syn keyword upstreamdat_Parameter INCREMENTAL syn keyword upstreamdat_Parameter INQOPTIONS syn keyword upstreamdat_Parameter INSTALLWIN2KAGENT syn keyword upstreamdat_Parameter INSTALLWIN2KAGENT syn keyword upstreamdat_Parameter JOBOPTIONS syn keyword upstreamdat_Parameter JOBRETURNCODEMAP syn keyword upstreamdat_Parameter JOBWAITTIMELIMIT syn keyword upstreamdat_Parameter KEEPALIVE syn keyword upstreamdat_Parameter LANINTERFACE syn keyword upstreamdat_Parameter LANWSNAME syn keyword upstreamdat_Parameter LANWSPASSWORD syn keyword upstreamdat_Parameter LASTACCESS syn keyword upstreamdat_Parameter LASTACCESS syn keyword upstreamdat_Parameter LATESTDATE syn keyword upstreamdat_Parameter LATESTDATE syn keyword upstreamdat_Parameter LATESTTIME syn keyword upstreamdat_Parameter LATESTTIME syn keyword upstreamdat_Parameter LATESTVERSION syn keyword upstreamdat_Parameter LINEBLOCK syn keyword upstreamdat_Parameter LINETRUNC syn keyword upstreamdat_Parameter LISTENFORREMOTE syn keyword upstreamdat_Parameter LOCALBACKUP syn keyword upstreamdat_Parameter LOCALBACKUPDIR syn keyword upstreamdat_Parameter LOCALBACKUPMAX syn keyword upstreamdat_Parameter LOCALBACKUPMAXFILESIZE syn keyword upstreamdat_Parameter LOCALBACKUPMAXSIZE syn keyword upstreamdat_Parameter LOCALEXCLUDEFILE syn keyword upstreamdat_Parameter LOCALPARAMETERS syn keyword upstreamdat_Parameter LOCALPASSWORD syn keyword upstreamdat_Parameter LOCALRESTORE syn keyword upstreamdat_Parameter LOCALUSER syn keyword upstreamdat_Parameter LOFS syn keyword upstreamdat_Parameter LOGNONFATAL syn keyword upstreamdat_Parameter MAXBACKUPFILESFAIL syn keyword upstreamdat_Parameter MAXBACKUPTIME syn keyword upstreamdat_Parameter MAXDUPS syn keyword upstreamdat_Parameter MAXFILENAMESIZE syn keyword upstreamdat_Parameter MAXKFILESIZE syn keyword upstreamdat_Parameter MAXLOGDAYS syn keyword upstreamdat_Parameter MAXRESTOREFILESFAIL syn keyword upstreamdat_Parameter MAXRESTORETIME syn keyword upstreamdat_Parameter MAXRETRY syn keyword upstreamdat_Parameter MAXRPTDAYS syn keyword upstreamdat_Parameter MERGE syn keyword upstreamdat_Parameter MIGRBITS syn keyword upstreamdat_Parameter MIGRBITS syn keyword upstreamdat_Parameter MINCOMPRESSSIZE syn keyword upstreamdat_Parameter MINIMIZE syn keyword upstreamdat_Parameter MODIFYFILE syn keyword upstreamdat_Parameter MOUNTPOINTS syn keyword upstreamdat_Parameter MOUNTPOINTS syn keyword upstreamdat_Parameter NDS syn keyword upstreamdat_Parameter NDS syn keyword upstreamdat_Parameter NEWFILECOMPARE syn keyword upstreamdat_Parameter NFSBELOW syn keyword upstreamdat_Parameter NODATAOK syn keyword upstreamdat_Parameter NODIRFORINCREMENTAL syn keyword upstreamdat_Parameter NODIRFORINCREMENTAL syn keyword upstreamdat_Parameter NONFILEDATABITMAP syn keyword upstreamdat_Parameter NONFILEDATABITMAP syn keyword upstreamdat_Parameter NOPOINTRESTORE syn keyword upstreamdat_Parameter NOSPECINHERITANCE syn keyword upstreamdat_Parameter NOTIFYEVENTS syn keyword upstreamdat_Parameter NOTIFYFAILUREATTACHMENT syn keyword upstreamdat_Parameter NOTIFYSUCCESSATTACHMENT syn keyword upstreamdat_Parameter NOTIFYTARGETS syn keyword upstreamdat_Parameter NOUIDGIDNAMES syn keyword upstreamdat_Parameter NOUIDGIDNAMES syn keyword upstreamdat_Parameter NOVELLMIGRATE syn keyword upstreamdat_Parameter NOVELLMIGRATE syn keyword upstreamdat_Parameter NOVELLMIGRATEADDEXT syn keyword upstreamdat_Parameter NOVELLMIGRATEADDEXT syn keyword upstreamdat_Parameter NOVELLPROFILE syn keyword upstreamdat_Parameter NOVELLRECALL syn keyword upstreamdat_Parameter NTFSADDPERMISSION syn keyword upstreamdat_Parameter NTFSADDPERMISSION syn keyword upstreamdat_Parameter NTREGRESTORE syn keyword upstreamdat_Parameter OSTYPE syn keyword upstreamdat_Parameter OUTPORT syn keyword upstreamdat_Parameter PACKFLUSHAFTERFILE syn keyword upstreamdat_Parameter PACKRECSIZE syn keyword upstreamdat_Parameter PARAMETER syn keyword upstreamdat_Parameter PASSWORD syn keyword upstreamdat_Parameter PATHNAME syn keyword upstreamdat_Parameter PATHNAME syn keyword upstreamdat_Parameter PERFORMBITMAP syn keyword upstreamdat_Parameter PERFORMNUMRECORDS syn keyword upstreamdat_Parameter PERFORMRECORDSIZE syn keyword upstreamdat_Parameter PLUGIN syn keyword upstreamdat_Parameter PLUGIN syn keyword upstreamdat_Parameter PLUGINPARAMETERS syn keyword upstreamdat_Parameter PLUGINPARAMETERS syn keyword upstreamdat_Parameter POSTJOB syn keyword upstreamdat_Parameter PREJOB syn keyword upstreamdat_Parameter PRTYCLASS syn keyword upstreamdat_Parameter PRTYLEVEL syn keyword upstreamdat_Parameter RECALLCLEANUP syn keyword upstreamdat_Parameter RECALLOFFLINEFILES syn keyword upstreamdat_Parameter RECALLOFFLINEFILES syn keyword upstreamdat_Parameter RECORDSIZE syn keyword upstreamdat_Parameter REMOTEADDR syn keyword upstreamdat_Parameter REMOTEAPPLPREF syn keyword upstreamdat_Parameter REMOTEAPPLRETRY syn keyword upstreamdat_Parameter REMOTECONNECTTYPE syn keyword upstreamdat_Parameter REMOTEFLAGS syn keyword upstreamdat_Parameter REMOTEIPADAPTER syn keyword upstreamdat_Parameter REMOTELOCALPARAMETERS syn keyword upstreamdat_Parameter REMOTELOGMODE syn keyword upstreamdat_Parameter REMOTELUNAME syn keyword upstreamdat_Parameter REMOTEMAXRETRIES syn keyword upstreamdat_Parameter REMOTEMODENAME syn keyword upstreamdat_Parameter REMOTEPARAMETERFILE syn keyword upstreamdat_Parameter REMOTEPORT syn keyword upstreamdat_Parameter REMOTEREQUEST syn keyword upstreamdat_Parameter REMOTERESTART syn keyword upstreamdat_Parameter REMOTEROUTE syn keyword upstreamdat_Parameter REMOTETARGETNAME syn keyword upstreamdat_Parameter REMOTETCP syn keyword upstreamdat_Parameter REMOTETIMEOUT syn keyword upstreamdat_Parameter REMOTETMAXRETRY syn keyword upstreamdat_Parameter REMOTETPN syn keyword upstreamdat_Parameter REMOTEUSAPPL syn keyword upstreamdat_Parameter REMOTEVERIFY syn keyword upstreamdat_Parameter REMOTEWTOCOMP syn keyword upstreamdat_Parameter REPORTNAME syn keyword upstreamdat_Parameter REPORTOPTIONS syn keyword upstreamdat_Parameter RESTARTLASTFILE syn keyword upstreamdat_Parameter RESTART syn keyword upstreamdat_Parameter RESTARTTYPE syn keyword upstreamdat_Parameter RESTARTVERSIONDATE syn keyword upstreamdat_Parameter RESTOREARCHIVEBIT syn keyword upstreamdat_Parameter RESTORECHECKPOINT syn keyword upstreamdat_Parameter RESTOREDATELIMIT syn keyword upstreamdat_Parameter RESTOREDATELIMIT syn keyword upstreamdat_Parameter RESTOREFILEFAIL syn keyword upstreamdat_Parameter RESTOREMOUNTPOINTS syn keyword upstreamdat_Parameter RESTOREMOUNTPOINTS syn keyword upstreamdat_Parameter RESTORESEGMENTS syn keyword upstreamdat_Parameter RESTORESEGMENTS syn keyword upstreamdat_Parameter RESTORETODIFFFS syn keyword upstreamdat_Parameter RETAIN syn keyword upstreamdat_Parameter RETAIN syn keyword upstreamdat_Parameter ROOTENTRY syn keyword upstreamdat_Parameter ROOTENTRY syn keyword upstreamdat_Parameter SAN syn keyword upstreamdat_Parameter SCHEDULENAME syn keyword upstreamdat_Parameter SEGMENTEDFILESIZE syn keyword upstreamdat_Parameter SEGMENTEDFILESIZE syn keyword upstreamdat_Parameter SEGMENTSIZE syn keyword upstreamdat_Parameter SEGMENTSIZE syn keyword upstreamdat_Parameter SENDHOSTDETAILS syn keyword upstreamdat_Parameter SINGLEFS syn keyword upstreamdat_Parameter SIZETRC syn keyword upstreamdat_Parameter SKIP syn keyword upstreamdat_Parameter SKIPBACKUPSCAN syn keyword upstreamdat_Parameter SKIPOLD syn keyword upstreamdat_Parameter SKIPOLD syn keyword upstreamdat_Parameter SMSTARGETSERVICENAME syn keyword upstreamdat_Parameter SMSTSA syn keyword upstreamdat_Parameter SOLO syn keyword upstreamdat_Parameter SORTBACKUP syn keyword upstreamdat_Parameter SOSDISK syn keyword upstreamdat_Parameter SOSDISK syn keyword upstreamdat_Parameter SOSTIMESTAMP syn keyword upstreamdat_Parameter SOSTIMESTAMP syn keyword upstreamdat_Parameter SOSTIMESTAMPPATH syn keyword upstreamdat_Parameter SOSTIMESTAMPPATH syn keyword upstreamdat_Parameter SPECNUMBER syn keyword upstreamdat_Parameter SPECNUMBER syn keyword upstreamdat_Parameter SPECTYPE syn keyword upstreamdat_Parameter SPECTYPE syn keyword upstreamdat_Parameter STARTTIME syn keyword upstreamdat_Parameter STORAGETYPE syn keyword upstreamdat_Parameter SUBDIRECTORIES syn keyword upstreamdat_Parameter SUBDIRECTORIES syn keyword upstreamdat_Parameter SWITCHTOTAPEMB syn keyword upstreamdat_Parameter TCPADDRESS syn keyword upstreamdat_Parameter TCPTIMEOUT syn keyword upstreamdat_Parameter TIMEOVERRIDE syn keyword upstreamdat_Parameter TRACE syn keyword upstreamdat_Parameter TRANSLATE syn keyword upstreamdat_Parameter ULTRACOMP syn keyword upstreamdat_Parameter ULTREG syn keyword upstreamdat_Parameter ULTUPD syn keyword upstreamdat_Parameter UNCMACHINEALIAS syn keyword upstreamdat_Parameter UNCMACHINEALIAS syn keyword upstreamdat_Parameter USEALEBRA syn keyword upstreamdat_Parameter USECONTROLFILE syn keyword upstreamdat_Parameter USEGID syn keyword upstreamdat_Parameter USERID syn keyword upstreamdat_Parameter USEUID syn keyword upstreamdat_Parameter USNOUIDGIDERRORS syn keyword upstreamdat_Parameter UTF8 syn keyword upstreamdat_Parameter VAULTNUMBER syn keyword upstreamdat_Parameter VERSIONDATE syn keyword upstreamdat_Parameter WRITESPARSE syn keyword upstreamdat_Parameter XFERECORDSIZE syn keyword upstreamdat_Parameter XFERRECSEP syn keyword upstreamdat_Parameter XFERRECUSECR " File Specs: syn match upstreamdat_Filespec /file spec\c \d\{1,3}.*/ " Comments: syn match upstreamdat_Comment /^#.*/ " List Of Parameters: syn region upstreamdat_Parms start="Current Parameters:" end="End Of Parameters" transparent fold hi def link upstreamdat_Parameter Type "hi def link upstreamdat_Filespec Underlined hi def link upstreamdat_Comment Comment let b:current_syntax = "upstreamdat" vim-7.4.1689/runtime/syntax/usserverlog.vim000066400000000000000000000060561267703067000207120ustar00rootroot00000000000000" Vim syntax file " Language: Innovation Data Processing usserver.log file " Maintainer: Rob Owens " Latest Revision: 2013-09-19 " Quit when a syntax file was already loaded if exists("b:current_syntax") finish endif " Date: syn match usserverlog_Date /\u\l\l \u\l\l\s\{1,2}\d\{1,2} \d\d:\d\d:\d\d \d\d\d\d/ " Msg Types: syn match usserverlog_MsgD /Msg #\(Agt\|PC\|Srv\)\d\{4,5}D/ nextgroup=usserverlog_Process skipwhite syn match usserverlog_MsgE /Msg #\(Agt\|PC\|Srv\)\d\{4,5}E/ nextgroup=usserverlog_Process skipwhite syn match usserverlog_MsgI /Msg #\(Agt\|PC\|Srv\)\d\{4,5}I/ nextgroup=usserverlog_Process skipwhite syn match usserverlog_MsgW /Msg #\(Agt\|PC\|Srv\)\d\{4,5}W/ nextgroup=usserverlog_Process skipwhite " Processes: syn region usserverlog_Process start="(" end=")" contained " IP Address: syn match usserverlog_IPaddr /\( \|(\)\zs\d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}/ " Profile: syn match usserverlog_Profile /Using default configuration for profile \zs\S\{1,8}\ze/ syn match usserverlog_Profile /Now running profile \zs\S\{1,8}\ze/ syn match usserverlog_Profile /in profile set \zs\S\{1,8}\ze/ syn match usserverlog_Profile /Migrate disk backup from profile \zs\S\{1,8}\ze/ syn match usserverlog_Profile /Using profile prefix for profile \zs\S\{1,8}\ze/ syn match usserverlog_Profile /Add\/update profile \zs\S\{1,8}\ze/ syn match usserverlog_Profile /Profileset=\zs\S\{1,8}\ze,/ syn match usserverlog_Profile /profileset=\zs\S\{1,8}\ze/ syn match usserverlog_Profile /Vault \(disk\|tape\) backup to vault \d\{1,4} from profile \zs\S\{1,8}\ze/ syn match usserverlog_Profile /Profile name \zs\"\S\{1,8}\"/ syn match usserverlog_Profile / Profile: \zs\S\{1,8}/ syn match usserverlog_Profile / Profile: \zs\S\{1,8}\ze, / syn match usserverlog_Profile /, profile: \zs\S\{1,8}\ze,/ syn match usserverlog_Profile /Expecting Profile: \zs\S\{1,8}\ze,/ syn match usserverlog_Profile /found Profile: \zs\S\{1,8}\ze,/ syn match usserverlog_Profile /Profile \zs\S\{1,8} \zeis a member of group: / syn match upstreamlog_Profile /Backup Profile: \zs\S\{1,8}\ze Version date/ syn match upstreamlog_Profile /Backup profile: \zs\S\{1,8}\ze Version date/ syn match usserverlog_Profile /Full of \zs\S\{1,8}\ze$/ syn match usserverlog_Profile /Incr. of \zs\S\{1,8}\ze$/ syn match usserverlog_Profile /Profile=\zs\S\{1,8}\ze,/ " Target: syn region usserverlog_Target start="Computer: \zs" end="\ze[\]\)]" syn region usserverlog_Target start="Computer name \zs\"" end="\"\ze" syn region usserverlog_Target start="Registration add request successful \zs" end="$" syn region usserverlog_Target start="request to registered name \zs" end=" " syn region usserverlog_Target start=", sending to \zs" end="$" hi def link usserverlog_Date Underlined hi def link usserverlog_MsgD Type hi def link usserverlog_MsgE Error hi def link usserverlog_MsgW Constant hi def link usserverlog_Process Statement hi def link usserverlog_IPaddr Identifier hi def link usserverlog_Profile Identifier hi def link usserverlog_Target Identifier let b:current_syntax = "usserverlog" vim-7.4.1689/runtime/syntax/usw2kagtlog.vim000066400000000000000000000052161267703067000206000ustar00rootroot00000000000000" Vim syntax file " Language: Innovation Data Processing USW2KAgt.log file " Maintainer: Rob Owens " Latest Revision: 2014-04-01 " Quit when a syntax file was already loaded if exists("b:current_syntax") finish endif " Date: syn match usw2kagtlog_Date /\u\l\l \u\l\l\s\{1,2}\d\{1,2} \d\d:\d\d:\d\d \d\d\d\d/ " Msg Types: syn match usw2kagtlog_MsgD /Msg #\(Agt\|PC\|Srv\)\d\{4,5}D/ nextgroup=usw2kagtlog_Process skipwhite syn match usw2kagtlog_MsgE /Msg #\(Agt\|PC\|Srv\)\d\{4,5}E/ nextgroup=usw2kagtlog_Process skipwhite syn match usw2kagtlog_MsgI /Msg #\(Agt\|PC\|Srv\)\d\{4,5}I/ nextgroup=usw2kagtlog_Process skipwhite syn match usw2kagtlog_MsgW /Msg #\(Agt\|PC\|Srv\)\d\{4,5}W/ nextgroup=usw2kagtlog_Process skipwhite " Processes: syn region usw2kagtlog_Process start="(" end=")" contained "syn region usw2kagtlog_Process start="Starting the processing for a \zs\"" end="\ze client request" "syn region usw2kagtlog_Process start="Ending the processing for a \zs\"" end="\ze client request" "syn region usw2kagtlog_Process start="Starting the processing for a \zs\"" end="\ze client\s\{0,1}\r\{0,1}\s\{1,9}request" "syn region usw2kagtlog_Process start="Ending the processing for a \zs\"" end="\ze client\s\{0,1}\r\{0,1}\s\{1,9}request" syn region usw2kagtlog_Process start="Starting the processing for a \zs\"" end="\ze client" syn region usw2kagtlog_Process start="Ending the processing for a \zs\"" end="\ze client" " IP Address: syn match usw2kagtlog_IPaddr / \d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}/ " Profile: syn match usw2kagtlog_Profile /Profile name \zs\"\S\{1,8}\"/ syn match usw2kagtlog_Profile / Profile: \zs\S\{1,8}/ syn match usw2kagtlog_Profile / Profile: \zs\S\{1,8}\ze, / syn match upstreamlog_Profile /Backup Profile: \zs\S\{1,8}\ze Version date/ syn match upstreamlog_Profile /Backup profile: \zs\S\{1,8}\ze Version date/ syn match usw2kagtlog_Profile /Full of \zs\S\{1,8}\ze$/ syn match usw2kagtlog_Profile /Incr. of \zs\S\{1,8}\ze$/ syn match usw2kagtlog_Profile /profile name "\zs\S\{1,8}\ze"/ " Target: syn region usw2kagtlog_Target start="Computer: \zs" end="\ze[\]\)]" syn region usw2kagtlog_Target start="Computer name \zs\"" end="\"\ze" " Agent Keywords: syn keyword usw2kagtlog_Agentword opened closed hi def link usw2kagtlog_Date Underlined hi def link usw2kagtlog_MsgD Type hi def link usw2kagtlog_MsgE Error hi def link usw2kagtlog_MsgW Constant hi def link usw2kagtlog_Process Statement hi def link usw2kagtlog_IPaddr Identifier hi def link usw2kagtlog_Profile Identifier hi def link usw2kagtlog_Target Identifier hi def link usw2kagtlog_Agentword Special let b:current_syntax = "usw2kagentlog" vim-7.4.1689/runtime/syntax/valgrind.vim000066400000000000000000000062621267703067000201370ustar00rootroot00000000000000" Vim syntax file " Language: Valgrind Memory Debugger Output " Maintainer: Roger Luethi " Program URL: http://devel-home.kde.org/~sewardj/ " Last Change: 2015 Jan 27 " Included improvement by Dominique Pelle " " Notes: mostly based on strace.vim and xml.vim " " Contributors: Christoph Gysin " Quit when a syntax file was already loaded if exists("b:current_syntax") finish endif let s:keepcpo= &cpo set cpo&vim " Lines can be long with demangled c++ functions. setlocal synmaxcol=8000 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=+^==\zs+ \ end=+\ze==+ \ 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\zs0x\x\+" contained syn match valgrindFunc ": \zs\h[a-zA-Z0-9_:\[\]()<>&*+\-,=%!|^ ]*\ze([^)]*)$" contained syn match valgrindBin "(\(with\)\=in \zs\S\+)\@=" contained syn match valgrindSrc "(\zs[^)]*:\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" let &cpo = s:keepcpo unlet s:keepcpo vim-7.4.1689/runtime/syntax/vb.vim000066400000000000000000000502121267703067000167320ustar00rootroot00000000000000" Vim syntax file " Language: Visual Basic " Maintainer: Tim Chase " Former Maintainer: Robert M. Cortopassi " (tried multiple times to contact, but email bounced) " Last Change: " 2005 May 25 Synched with work by Thomas Barthel " 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 vbConditional If Then ElseIf Else Select Case syn keyword vbOperator AddressOf And ByRef ByVal Eqv Imp In syn keyword vbOperator Is Like Mod Not Or To Xor syn match vbOperator "[()+.,\-/*=&]" syn match vbOperator "[<>]=\=" syn match vbOperator "<>" syn match vbOperator "\s\+_$" syn keyword vbBoolean True False syn keyword vbConst Null Nothing syn keyword vbRepeat Do For ForEach Loop Next syn keyword vbRepeat Step To Until Wend While syn keyword vbEvents AccessKeyPress Activate ActiveRowChanged syn keyword vbEvents AfterAddFile AfterChangeFileName AfterCloseFile syn keyword vbEvents AfterColEdit AfterColUpdate AfterDelete syn keyword vbEvents AfterInsert AfterLabelEdit AfterRemoveFile syn keyword vbEvents AfterUpdate AfterWriteFile AmbientChanged syn keyword vbEvents ApplyChanges Associate AsyncProgress syn keyword vbEvents AsyncReadComplete AsyncReadProgress AxisActivated syn keyword vbEvents AxisLabelActivated AxisLabelSelected syn keyword vbEvents AxisLabelUpdated AxisSelected AxisTitleActivated syn keyword vbEvents AxisTitleSelected AxisTitleUpdated AxisUpdated syn keyword vbEvents BeforeClick BeforeColEdit BeforeColUpdate syn keyword vbEvents BeforeConnect BeforeDelete BeforeInsert syn keyword vbEvents BeforeLabelEdit BeforeLoadFile BeforeUpdate syn keyword vbEvents BeginRequest BeginTrans ButtonClick syn keyword vbEvents ButtonCompleted ButtonDropDown ButtonGotFocus syn keyword vbEvents ButtonLostFocus CallbackKeyDown Change Changed syn keyword vbEvents ChartActivated ChartSelected ChartUpdated Click syn keyword vbEvents Close CloseQuery CloseUp ColEdit ColResize syn keyword vbEvents Collapse ColumnClick CommitTrans Compare syn keyword vbEvents ConfigChageCancelled ConfigChanged syn keyword vbEvents ConfigChangedCancelled Connect ConnectionRequest syn keyword vbEvents CurrentRecordChanged DECommandAdded syn keyword vbEvents DECommandPropertyChanged DECommandRemoved syn keyword vbEvents DEConnectionAdded DEConnectionPropertyChanged syn keyword vbEvents DEConnectionRemoved DataArrival DataChanged syn keyword vbEvents DataUpdated DateClicked DblClick Deactivate syn keyword vbEvents DevModeChange DeviceArrival DeviceOtherEvent syn keyword vbEvents DeviceQueryRemove DeviceQueryRemoveFailed syn keyword vbEvents DeviceRemoveComplete DeviceRemovePending syn keyword vbEvents Disconnect DisplayChanged Dissociate syn keyword vbEvents DoGetNewFileName Done DonePainting DownClick syn keyword vbEvents DragDrop DragOver DropDown EditProperty EditQuery syn keyword vbEvents EndRequest EnterCell EnterFocus ExitFocus Expand syn keyword vbEvents FontChanged FootnoteActivated FootnoteSelected syn keyword vbEvents FootnoteUpdated Format FormatSize GotFocus syn keyword vbEvents HeadClick HeightChanged Hide InfoMessage syn keyword vbEvents IniProperties InitProperties Initialize syn keyword vbEvents ItemActivated ItemAdded ItemCheck ItemClick syn keyword vbEvents ItemReloaded ItemRemoved ItemRenamed syn keyword vbEvents ItemSeletected KeyDown KeyPress KeyUp LeaveCell syn keyword vbEvents LegendActivated LegendSelected LegendUpdated syn keyword vbEvents LinkClose LinkError LinkExecute LinkNotify syn keyword vbEvents LinkOpen Load LostFocus MouseDown MouseMove syn keyword vbEvents MouseUp NodeCheck NodeClick OLECompleteDrag syn keyword vbEvents OLEDragDrop OLEDragOver OLEGiveFeedback OLESetData syn keyword vbEvents OLEStartDrag ObjectEvent ObjectMove OnAddNew syn keyword vbEvents OnComm Paint PanelClick PanelDblClick PathChange syn keyword vbEvents PatternChange PlotActivated PlotSelected syn keyword vbEvents PlotUpdated PointActivated PointLabelActivated syn keyword vbEvents PointLabelSelected PointLabelUpdated PointSelected syn keyword vbEvents PointUpdated PowerQuerySuspend PowerResume syn keyword vbEvents PowerStatusChanged PowerSuspend ProcessTag syn keyword vbEvents ProcessingTimeout QueryChangeConfig QueryClose syn keyword vbEvents QueryComplete QueryCompleted QueryTimeout syn keyword vbEvents QueryUnload ReadProperties RepeatedControlLoaded syn keyword vbEvents RepeatedControlUnloaded Reposition syn keyword vbEvents RequestChangeFileName RequestWriteFile Resize syn keyword vbEvents ResultsChanged RetainedProject RollbackTrans syn keyword vbEvents RowColChange RowCurrencyChange RowResize syn keyword vbEvents RowStatusChanged Scroll SelChange SelectionChanged syn keyword vbEvents SendComplete SendProgress SeriesActivated syn keyword vbEvents SeriesSelected SeriesUpdated SettingChanged Show syn keyword vbEvents SplitChange Start StateChanged StatusUpdate syn keyword vbEvents SysColorsChanged Terminate TimeChanged Timer syn keyword vbEvents TitleActivated TitleSelected TitleUpdated syn keyword vbEvents UnboundAddData UnboundDeleteRow syn keyword vbEvents UnboundGetRelativeBookmark UnboundReadData syn keyword vbEvents UnboundWriteData Unformat Unload UpClick Updated syn keyword vbEvents UserEvent Validate ValidationError syn keyword vbEvents VisibleRecordChanged WillAssociate WillChangeData syn keyword vbEvents WillDissociate WillExecute WillUpdateRows syn keyword vbEvents WriteProperties syn keyword vbFunction Abs Array Asc AscB AscW Atn Avg BOF CBool CByte syn keyword vbFunction CCur CDate CDbl CInt CLng CSng CStr CVDate CVErr syn keyword vbFunction CVar CallByName Cdec Choose Chr ChrB ChrW Command syn keyword vbFunction Cos Count CreateObject CurDir DDB Date DateAdd syn keyword vbFunction DateDiff DatePart DateSerial DateValue Day Dir syn keyword vbFunction DoEvents EOF Environ Error Exp FV FileAttr syn keyword vbFunction FileDateTime FileLen FilterFix Fix Format syn keyword vbFunction FormatCurrency FormatDateTime FormatNumber syn keyword vbFunction FormatPercent FreeFile GetAllStrings GetAttr syn keyword vbFunction GetAutoServerSettings GetObject GetSetting Hex syn keyword vbFunction Hour IIf IMEStatus IPmt InStr Input InputB syn keyword vbFunction InputBox InstrB Int IsArray IsDate IsEmpty IsError syn keyword vbFunction IsMissing IsNull IsNumeric IsObject Join LBound syn keyword vbFunction LCase LOF LTrim Left LeftB Len LenB LoadPicture syn keyword vbFunction LoadResData LoadResPicture LoadResString Loc Log syn keyword vbFunction MIRR Max Mid MidB Min Minute Month MonthName syn keyword vbFunction MsgBox NPV NPer Now Oct PPmt PV Partition Pmt syn keyword vbFunction QBColor RGB RTrim Rate Replace Right RightB Rnd syn keyword vbFunction Round SLN SYD Second Seek Sgn Shell Sin Space Spc syn keyword vbFunction Split Sqr StDev StDevP Str StrComp StrConv syn keyword vbFunction StrReverse String Sum Switch Tab Tan Time syn keyword vbFunction TimeSerial TimeValue Timer Trim TypeName UBound syn keyword vbFunction UCase Val Var VarP VarType Weekday WeekdayName syn keyword vbFunction Year syn keyword vbMethods AboutBox Accept Activate Add AddCustom AddFile syn keyword vbMethods AddFromFile AddFromGuid AddFromString syn keyword vbMethods AddFromTemplate AddItem AddNew AddToAddInToolbar syn keyword vbMethods AddToolboxProgID Append AppendAppendChunk syn keyword vbMethods AppendChunk Arrange Assert AsyncRead BatchUpdate syn keyword vbMethods BeginQueryEdit BeginTrans Bind BuildPath syn keyword vbMethods CanPropertyChange Cancel CancelAsyncRead syn keyword vbMethods CancelBatch CancelUpdate CaptureImage CellText syn keyword vbMethods CellValue Circle Clear ClearFields ClearSel syn keyword vbMethods ClearSelCols ClearStructure Clone Close Cls syn keyword vbMethods ColContaining CollapseAll ColumnSize CommitTrans syn keyword vbMethods CompactDatabase Compose Connect Copy CopyFile syn keyword vbMethods CopyFolder CopyQueryDef Count CreateDatabase syn keyword vbMethods CreateDragImage CreateEmbed CreateField syn keyword vbMethods CreateFolder CreateGroup CreateIndex CreateLink syn keyword vbMethods CreatePreparedStatement CreatePropery CreateQuery syn keyword vbMethods CreateQueryDef CreateRelation CreateTableDef syn keyword vbMethods CreateTextFile CreateToolWindow CreateUser syn keyword vbMethods CreateWorkspace Customize Cut Delete syn keyword vbMethods DeleteColumnLabels DeleteColumns DeleteFile syn keyword vbMethods DeleteFolder DeleteLines DeleteRowLabels syn keyword vbMethods DeleteRows DeselectAll DesignerWindow DoVerb Drag syn keyword vbMethods Draw DriveExists Edit EditCopy EditPaste EndDoc syn keyword vbMethods EnsureVisible EstablishConnection Execute Exists syn keyword vbMethods Expand Export ExportReport ExtractIcon Fetch syn keyword vbMethods FetchVerbs FileExists Files FillCache Find syn keyword vbMethods FindFirst FindItem FindLast FindNext FindPrevious syn keyword vbMethods FolderExists Forward GetAbsolutePathName syn keyword vbMethods GetBaseName GetBookmark GetChunk GetClipString syn keyword vbMethods GetData GetDrive GetDriveName GetFile GetFileName syn keyword vbMethods GetFirstVisible GetFolder GetFormat GetHeader syn keyword vbMethods GetLineFromChar GetNumTicks GetParentFolderName syn keyword vbMethods GetRows GetSelectedPart GetSelection syn keyword vbMethods GetSpecialFolder GetTempName GetText syn keyword vbMethods GetVisibleCount GoBack GoForward Hide HitTest syn keyword vbMethods HoldFields Idle Import InitializeLabels Insert syn keyword vbMethods InsertColumnLabels InsertColumns InsertFile syn keyword vbMethods InsertLines InsertObjDlg InsertRowLabels syn keyword vbMethods InsertRows Item Keys KillDoc Layout Line Lines syn keyword vbMethods LinkExecute LinkPoke LinkRequest LinkSend Listen syn keyword vbMethods LoadFile LoadResData LoadResPicture LoadResString syn keyword vbMethods LogEvent MakeCompileFile MakeCompiledFile syn keyword vbMethods MakeReplica MoreResults Move MoveData MoveFile syn keyword vbMethods MoveFirst MoveFolder MoveLast MoveNext syn keyword vbMethods MovePrevious NavigateTo NewPage NewPassword syn keyword vbMethods NextRecordset OLEDrag OnAddinsUpdate OnConnection syn keyword vbMethods OnDisconnection OnStartupComplete Open syn keyword vbMethods OpenAsTextStream OpenConnection OpenDatabase syn keyword vbMethods OpenQueryDef OpenRecordset OpenResultset OpenURL syn keyword vbMethods Overlay PSet PaintPicture PastSpecialDlg Paste syn keyword vbMethods PeekData Play Point PopulatePartial PopupMenu syn keyword vbMethods Print PrintForm PrintReport PropertyChanged Quit syn keyword vbMethods Raise RandomDataFill RandomFillColumns syn keyword vbMethods RandomFillRows ReFill Read ReadAll ReadFromFile syn keyword vbMethods ReadLine ReadProperty Rebind Refresh RefreshLink syn keyword vbMethods RegisterDatabase ReleaseInstance Reload Remove syn keyword vbMethods RemoveAddInFromToolbar RemoveAll RemoveItem Render syn keyword vbMethods RepairDatabase ReplaceLine Reply ReplyAll Requery syn keyword vbMethods ResetCustom ResetCustomLabel ResolveName syn keyword vbMethods RestoreToolbar Resync Rollback RollbackTrans syn keyword vbMethods RowBookmark RowContaining RowTop Save SaveAs syn keyword vbMethods SaveFile SaveToFile SaveToOle1File SaveToolbar syn keyword vbMethods Scale ScaleX ScaleY Scroll SelPrint SelectAll syn keyword vbMethods SelectPart Send SendData Set SetAutoServerSettings syn keyword vbMethods SetData SetFocus SetOption SetSelection SetSize syn keyword vbMethods SetText SetViewport Show ShowColor ShowFont syn keyword vbMethods ShowHelp ShowOpen ShowPrinter ShowSave syn keyword vbMethods ShowWhatsThis SignOff SignOn Size Skip SkipLine syn keyword vbMethods Span Split SplitContaining StartLabelEdit syn keyword vbMethods StartLogging Stop Synchronize Tag TextHeight syn keyword vbMethods TextWidth ToDefaults Trace TwipsToChartPart syn keyword vbMethods TypeByChartType URLFor Update UpdateControls syn keyword vbMethods UpdateRecord UpdateRow Upto ValidateControls Value syn keyword vbMethods WhatsThisMode Write WriteBlankLines WriteLine syn keyword vbMethods WriteProperty WriteTemplate ZOrder syn keyword vbMethods rdoCreateEnvironment rdoRegisterDataSource syn keyword vbStatement Alias AppActivate As Base Beep Begin Call ChDir syn keyword vbStatement ChDrive Close Const Date Declare DefBool DefByte syn keyword vbStatement DefCur DefDate DefDbl DefDec DefInt DefLng DefObj syn keyword vbStatement DefSng DefStr DefVar Deftype DeleteSetting Dim Do syn keyword vbStatement Each ElseIf End Enum Erase Error Event Exit syn keyword vbStatement Explicit FileCopy For ForEach Function Get GoSub syn keyword vbStatement GoTo Gosub Implements Kill LSet Let Lib LineInput syn keyword vbStatement Load Lock Loop Mid MkDir Name Next On OnError Open syn keyword vbStatement Option Preserve Private Property Public Put RSet syn keyword vbStatement RaiseEvent Randomize ReDim Redim Reset Resume syn keyword vbStatement Return RmDir SavePicture SaveSetting Seek SendKeys syn keyword vbStatement Sendkeys Set SetAttr Static Step Stop Sub Time syn keyword vbStatement Type Unload Unlock Until Wend While Width With syn keyword vbStatement Write syn keyword vbKeyword As Binary ByRef ByVal Date Empty Error Friend Get syn keyword vbKeyword Input Is Len Lock Me Mid New Nothing Null On syn keyword vbKeyword Option Optional ParamArray Print Private Property syn keyword vbKeyword Public PublicNotCreateable OnNewProcessSingleUse syn keyword vbKeyword InSameProcessMultiUse GlobalMultiUse Resume Seek syn keyword vbKeyword Set Static Step String Time WithEvents syn keyword vbTodo contained TODO "Datatypes syn keyword vbTypes Boolean Byte Currency Date Decimal Double Empty syn keyword vbTypes Integer Long Object Single String Variant "VB defined values syn keyword vbDefine dbBigInt dbBinary dbBoolean dbByte dbChar syn keyword vbDefine dbCurrency dbDate dbDecimal dbDouble dbFloat syn keyword vbDefine dbGUID dbInteger dbLong dbLongBinary dbMemo syn keyword vbDefine dbNumeric dbSingle dbText dbTime dbTimeStamp syn keyword vbDefine dbVarBinary "VB defined values syn keyword vbDefine vb3DDKShadow vb3DFace vb3DHighlight vb3DLight syn keyword vbDefine vb3DShadow vbAbort vbAbortRetryIgnore syn keyword vbDefine vbActiveBorder vbActiveTitleBar vbAlias syn keyword vbDefine vbApplicationModal vbApplicationWorkspace syn keyword vbDefine vbAppTaskManager vbAppWindows vbArchive vbArray syn keyword vbDefine vbBack vbBinaryCompare vbBlack vbBlue vbBoolean syn keyword vbDefine vbButtonFace vbButtonShadow vbButtonText vbByte syn keyword vbDefine vbCalGreg vbCalHijri vbCancel vbCr vbCritical syn keyword vbDefine vbCrLf vbCurrency vbCyan vbDatabaseCompare syn keyword vbDefine vbDataObject vbDate vbDecimal vbDefaultButton1 syn keyword vbDefine vbDefaultButton2 vbDefaultButton3 vbDefaultButton4 syn keyword vbDefine vbDesktop vbDirectory vbDouble vbEmpty vbError syn keyword vbDefine vbExclamation vbFirstFourDays vbFirstFullWeek syn keyword vbDefine vbFirstJan1 vbFormCode vbFormControlMenu syn keyword vbDefine vbFormFeed vbFormMDIForm vbFriday vbFromUnicode syn keyword vbDefine vbGrayText vbGreen vbHidden vbHide vbHighlight syn keyword vbDefine vbHighlightText vbHiragana vbIgnore vbIMEAlphaDbl syn keyword vbDefine vbIMEAlphaSng vbIMEDisable vbIMEHiragana syn keyword vbDefine vbIMEKatakanaDbl vbIMEKatakanaSng vbIMEModeAlpha syn keyword vbDefine vbIMEModeAlphaFull vbIMEModeDisable syn keyword vbDefine vbIMEModeHangul vbIMEModeHangulFull syn keyword vbDefine vbIMEModeHiragana vbIMEModeKatakana syn keyword vbDefine vbIMEModeKatakanaHalf vbIMEModeNoControl syn keyword vbDefine vbIMEModeOff vbIMEModeOn vbIMENoOp vbIMEOff syn keyword vbDefine vbIMEOn vbInactiveBorder vbInactiveCaptionText syn keyword vbDefine vbInactiveTitleBar vbInfoBackground vbInformation syn keyword vbDefine vbInfoText vbInteger vbKatakana vbKey0 vbKey1 syn keyword vbDefine vbKey2 vbKey3 vbKey4 vbKey5 vbKey6 vbKey7 vbKey8 syn keyword vbDefine vbKey9 vbKeyA vbKeyAdd vbKeyB vbKeyBack vbKeyC syn keyword vbDefine vbKeyCancel vbKeyCapital vbKeyClear vbKeyControl syn keyword vbDefine vbKeyD vbKeyDecimal vbKeyDelete vbKeyDivide syn keyword vbDefine vbKeyDown vbKeyE vbKeyEnd vbKeyEscape vbKeyExecute syn keyword vbDefine vbKeyF vbKeyF1 vbKeyF10 vbKeyF11 vbKeyF12 vbKeyF13 syn keyword vbDefine vbKeyF14 vbKeyF15 vbKeyF16 vbKeyF2 vbKeyF3 vbKeyF4 syn keyword vbDefine vbKeyF5 vbKeyF6 vbKeyF7 vbKeyF8 vbKeyF9 vbKeyG syn keyword vbDefine vbKeyH vbKeyHelp vbKeyHome vbKeyI vbKeyInsert syn keyword vbDefine vbKeyJ vbKeyK vbKeyL vbKeyLButton vbKeyLeft vbKeyM syn keyword vbDefine vbKeyMButton vbKeyMenu vbKeyMultiply vbKeyN syn keyword vbDefine vbKeyNumlock vbKeyNumpad0 vbKeyNumpad1 syn keyword vbDefine vbKeyNumpad2 vbKeyNumpad3 vbKeyNumpad4 syn keyword vbDefine vbKeyNumpad5 vbKeyNumpad6 vbKeyNumpad7 syn keyword vbDefine vbKeyNumpad8 vbKeyNumpad9 vbKeyO vbKeyP syn keyword vbDefine vbKeyPageDown vbKeyPageUp vbKeyPause vbKeyPrint syn keyword vbDefine vbKeyQ vbKeyR vbKeyRButton vbKeyReturn vbKeyRight syn keyword vbDefine vbKeyS vbKeySelect vbKeySeparator vbKeyShift syn keyword vbDefine vbKeySnapshot vbKeySpace vbKeySubtract vbKeyT syn keyword vbDefine vbKeyTab vbKeyU vbKeyUp vbKeyV vbKeyW vbKeyX syn keyword vbDefine vbKeyY vbKeyZ vbLf vbLong vbLowerCase vbMagenta syn keyword vbDefine vbMaximizedFocus vbMenuBar vbMenuText syn keyword vbDefine vbMinimizedFocus vbMinimizedNoFocus vbMonday syn keyword vbDefine vbMsgBox vbMsgBoxHelpButton vbMsgBoxRight syn keyword vbDefine vbMsgBoxRtlReading vbMsgBoxSetForeground syn keyword vbDefine vbMsgBoxText vbNarrow vbNewLine vbNo vbNormal syn keyword vbDefine vbNormalFocus vbNormalNoFocus vbNull vbNullChar syn keyword vbDefine vbNullString vbObject vbObjectError vbOK syn keyword vbDefine vbOKCancel vbOKOnly vbProperCase vbQuestion syn keyword vbDefine vbReadOnly vbRed vbRetry vbRetryCancel vbSaturday syn keyword vbDefine vbScrollBars vbSingle vbString vbSunday vbSystem syn keyword vbDefine vbSystemModal vbTab vbTextCompare vbThursday syn keyword vbDefine vbTitleBarText vbTuesday vbUnicode vbUpperCase syn keyword vbDefine vbUseSystem vbUseSystemDayOfWeek vbVariant syn keyword vbDefine vbVerticalTab vbVolume vbWednesday vbWhite vbWide syn keyword vbDefine vbWindowBackground vbWindowFrame vbWindowText syn keyword vbDefine vbYellow vbYes vbYesNo vbYesNoCancel "Numbers "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\+\>" "syn match vbNumber "{[[:xdigit:]-]\+}\|&[hH][[:xdigit:]]\+&" "syn match vbNumber ":[[:xdigit:]]\+" "syn match vbNumber "[-+]\=\<\d\+\>" syn match vbFloat "[-+]\=\<\d\+[eE][\-+]\=\d\+" syn match vbFloat "[-+]\=\<\d\+\.\d*\([eE][\-+]\=\d\+\)\=" syn match vbFloat "[-+]\=\<\.\d\+\([eE][\-+]\=\d\+\)\=" " String and Character contstants syn region vbString start=+"+ end=+"\|$+ syn region vbComment start="\(^\|\s\)REM\s" end="$" contains=vbTodo syn region vbComment start="\(^\|\s\)\'" end="$" contains=vbTodo syn match vbLineNumber "^\d\+\(\s\|$\)" syn match vbTypeSpecifier "[a-zA-Z0-9][\$%&!#]"ms=s+1 syn match vbTypeSpecifier "#[a-zA-Z0-9]"me=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_vb_syntax_inits") if version < 508 let did_vb_syntax_inits = 1 command -nargs=+ HiLink hi link else command -nargs=+ HiLink hi def link endif HiLink vbBoolean Boolean HiLink vbLineNumber Comment HiLink vbComment Comment HiLink vbConditional Conditional HiLink vbConst Constant HiLink vbDefine Constant HiLink vbError Error HiLink vbFunction Identifier HiLink vbIdentifier Identifier HiLink vbNumber Number HiLink vbFloat Float HiLink vbMethods PreProc HiLink vbOperator Operator HiLink vbRepeat Repeat HiLink vbString String HiLink vbStatement Statement HiLink vbKeyword Statement HiLink vbEvents Special HiLink vbTodo Todo HiLink vbTypes Type HiLink vbTypeSpecifier Type delcommand HiLink endif let b:current_syntax = "vb" " vim: ts=8 vim-7.4.1689/runtime/syntax/vera.vim000066400000000000000000000465321267703067000172720ustar00rootroot00000000000000" Vim syntax file " Language: Vera " Maintainer: Dave Eggum (opine at bluebottle dOt com) " Last Change: 2005 Dec 19 " NOTE: extra white space at the end of the line will be highlighted if you " add this line to your colorscheme: " highlight SpaceError guibg=#204050 " (change the value for guibg to any color you like) " For version 5.x: Clear all syntax items " 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 Vera keywords syn keyword veraStatement break return continue fork join terminate syn keyword veraStatement breakpoint proceed syn keyword veraLabel bad_state bad_trans bind constraint coverage_group syn keyword veraLabel class CLOCK default function interface m_bad_state syn keyword veraLabel m_bad_trans m_state m_trans program randseq state syn keyword veraLabel task trans syn keyword veraConditional if else case casex casez randcase syn keyword veraRepeat repeat while for do foreach syn keyword veraModifier after all any around assoc_size async syn keyword veraModifier before big_endian bit_normal bit_reverse export syn keyword veraModifier extends extern little_endian local hdl_node hdl_task syn keyword veraModifier negedge none packed protected posedge public rules syn keyword veraModifier shadow soft static super this typedef unpacked var syn keyword veraModifier vca virtual virtuals wildcard with syn keyword veraType reg string enum event bit syn keyword veraType rand randc integer port prod syn keyword veraDeprecated call_func call_task close_conn get_bind get_bind_id syn keyword veraDeprecated get_conn_err mailbox_receive mailbox_send make_client syn keyword veraDeprecated make_server simwave_plot up_connections " predefined tasks and functions syn keyword veraTask alloc assoc_index cast_assign cm_coverage syn keyword veraTask cm_get_coverage cm_get_limit delay error error_mode syn keyword veraTask exit fclose feof ferror fflush flag fopen fprintf syn keyword veraTask freadb freadh freadstr get_cycle get_env get_memsize syn keyword veraTask get_plus_arg getstate get_systime get_time get_time_unit syn keyword veraTask initstate lock_file mailbox_get mailbox_put os_command syn keyword veraTask printf prodget prodset psprintf query query_str query_x syn keyword veraTask rand48 random region_enter region_exit rewind syn keyword veraTask semaphore_get semaphore_put setstate signal_connect syn keyword veraTask sprintf srandom sscanf stop suspend_thread sync syn keyword veraTask timeout trace trigger unit_delay unlock_file urand48 syn keyword veraTask urandom urandom_range vera_bit_reverse vera_crc syn keyword veraTask vera_pack vera_pack_big_endian vera_plot syn keyword veraTask vera_report_profile vera_unpack vera_unpack_big_endian syn keyword veraTask vsv_call_func vsv_call_task vsv_get_conn_err syn keyword veraTask vsv_make_client vsv_make_server vsv_up_connections syn keyword veraTask vsv_wait_for_done vsv_wait_for_input wait_child wait_var syn cluster veraOperGroup contains=veraOperator,veraOperParen,veraNumber,veraString,veraOperOk,veraType " syn match veraOperator "++\|--\|&\|\~&\||\|\~|\|^\|\~^\|\~\|><" " syn match veraOperator "*\|/\|%\|+\|-\|<<\|>>\|<\|<=\|>\|>=\|!in" " syn match veraOperator "=?=\|!?=\|==\|!=\|===\|!==\|&\~\|^\~\||\~" " syn match veraOperator "&&\|||\|=\|+=\|-=\|*=\|/=\|%=\|<<=\|>>=\|&=" " syn match veraOperator "|=\|^=\|\~&=\|\~|=\|\~^=" syn match veraOperator "[&|\~>" " "hex number " syn match veraNumber display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>" " syn match veraNumber "\(\<[0-9]\+\|\)'[bdoh][0-9a-fxzA-FXZ_]\+\>" syn match veraNumber "\<\(\<[0-9]\+\)\?\('[bdoh]\)\?[0-9a-fxz_]\+\>" " syn match veraNumber "\<[+-]\=[0-9]\+\>" " Flag the first zero of an octal number as something special syn match veraOctal display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=veraOctalZero syn match veraOctalZero display contained "\<0" syn match veraFloat display contained "\d\+f" "floating point number, with dot, optional exponent syn match veraFloat display contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=" "floating point number, starting with a dot, optional exponent syn match veraFloat display contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>" "floating point number, without dot, with exponent syn match veraFloat display contained "\d\+e[-+]\=\d\+[fl]\=\>" "hexadecimal floating point number, optional leading digits, with dot, with exponent syn match veraFloat display contained "0x\x*\.\x\+p[-+]\=\d\+[fl]\=\>" "hexadecimal floating point number, with leading digits, optional dot, with exponent syn match veraFloat display contained "0x\x\+\.\=p[-+]\=\d\+[fl]\=\>" " flag an octal number with wrong digits syn match veraOctalError display contained "0\o*[89]\d*" syn case match let vera_comment_strings = 1 if exists("vera_comment_strings") " A comment can contain veraString, veraCharacter and veraNumber. " But a "*/" inside a veraString in a veraComment DOES end the comment! So we " need to use a special type of veraString: veraCommentString, which also ends on " "*/", and sees a "*" at the start of the line as comment again. " Unfortunately this doesn't work very well for // type of comments :-( syntax match veraCommentSkip contained "^\s*\*\($\|\s\+\)" syntax region veraCommentString contained start=+L\=\\\@" syn match veraClass "\zs\w\+\ze::" syn match veraClass "\zs\w\+\ze\s\+\w\+\s*[=;,)\[]" contains=veraConstant,veraUserConstant syn match veraClass "\zs\w\+\ze\s\+\w\+\s*$" contains=veraConstant,veraUserConstant syn match veraUserMethod "\zs\w\+\ze\s*(" contains=veraConstant,veraUserConstant syn match veraObject "\zs\w\+\ze\.\w" syn match veraObject "\zs\w\+\ze\.\$\w" " Accept ` for # (Verilog) syn region veraPreCondit start="^\s*\(`\|#\)\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" end="//"me=s-1 contains=veraComment,veraCppString,veraCharacter,veraCppParen,veraParenError,veraNumbers,veraCommentError,veraSpaceError syn match veraPreCondit display "^\s*\(`\|#\)\s*\(else\|endif\)\>" if !exists("vera_no_if0") syn region veraCppOut start="^\s*\(`\|#\)\s*if\s\+0\+\>" end=".\@=\|$" contains=veraCppOut2 syn region veraCppOut2 contained start="0" end="^\s*\(`\|#\)\s*\(endif\>\|else\>\|elif\>\)" contains=veraSpaceError,veraCppSkip syn region veraCppSkip contained start="^\s*\(`\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(`\|#\)\s*endif\>" contains=veraSpaceError,veraCppSkip endif syn region veraIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+ syn match veraIncluded display contained "<[^>]*>" syn match veraInclude display "^\s*\(`\|#\)\s*include\>\s*["<]" contains=veraIncluded "syn match veraLineSkip "\\$" syn cluster veraPreProcGroup contains=veraPreCondit,veraIncluded,veraInclude,veraDefine,veraErrInParen,veraErrInBracket,veraUserLabel,veraSpecial,veraOctalZero,veraCppOut,veraCppOut2,veraCppSkip,veraFormat,veraNumber,veraFloat,veraOctal,veraOctalError,veraNumbersCom,veraString,veraCommentSkip,veraCommentString,veraComment2String,@veraCommentGroup,veraCommentStartError,veraParen,veraBracket,veraMulti syn region veraDefine start="^\s*\(`\|#\)\s*\(define\|undef\)\>" skip="\\$" end="$" end="//"me=s-1 contains=ALLBUT,@veraPreProcGroup,@Spell syn region veraPreProc start="^\s*\(`\|#\)\s*\(pragma\>\|line\>\|warning\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@veraPreProcGroup,@Spell " Highlight User Labels syn cluster veraMultiGroup contains=veraIncluded,veraSpecial,veraCommentSkip,veraCommentString,veraComment2String,@veraCommentGroup,veraCommentStartError,veraUserCont,veraUserLabel,veraBitField,veraOctalZero,veraCppOut,veraCppOut2,veraCppSkip,veraFormat,veraNumber,veraFloat,veraOctal,veraOctalError,veraNumbersCom,veraCppParen,veraCppBracket,veraCppString syn region veraMulti transparent start='?' skip='::' end=':' contains=ALLBUT,@veraMultiGroup,@Spell " syn region veraMulti transparent start='?' skip='::' end=':' contains=ALL " The above causes veraCppOut2 to catch on: " i = (isTrue) ? 0 : 1; " which ends up commenting the rest of the file " Avoid matching foo::bar() by requiring that the next char is not ':' syn cluster veraLabelGroup contains=veraUserLabel syn match veraUserCont display "^\s*\I\i*\s*:$" contains=@veraLabelGroup syn match veraUserCont display ";\s*\I\i*\s*:$" contains=@veraLabelGroup syn match veraUserCont display "^\s*\I\i*\s*:[^:]"me=e-1 contains=@veraLabelGroup syn match veraUserCont display ";\s*\I\i*\s*:[^:]"me=e-1 contains=@veraLabelGroup syn match veraUserLabel display "\I\i*" contained " Avoid recognizing most bitfields as labels syn match veraBitField display "^\s*\I\i*\s*:\s*[1-9]"me=e-1 syn match veraBitField display ";\s*\I\i*\s*:\s*[1-9]"me=e-1 if exists("vera_minlines") let b:vera_minlines = vera_minlines else if !exists("vera_no_if0") let b:vera_minlines = 50 " #if 0 constructs can be long else let b:vera_minlines = 15 " mostly for () constructs endif endif exec "syn sync ccomment veraComment minlines=" . b:vera_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_vera_syn_inits") if version < 508 let did_vera_syn_inits = 1 command -nargs=+ HiLink hi link else command -nargs=+ HiLink hi def link endif HiLink veraClass Identifier HiLink veraObject Identifier HiLink veraUserMethod Function HiLink veraTask Keyword HiLink veraModifier Tag HiLink veraDeprecated veraError HiLink veraMethods Statement " HiLink veraInterface Label HiLink veraInterface Function HiLink veraFormat veraSpecial HiLink veraCppString veraString HiLink veraCommentL veraComment HiLink veraCommentStart veraComment HiLink veraLabel Label HiLink veraUserLabel Label HiLink veraConditional Conditional HiLink veraRepeat Repeat HiLink veraCharacter Character HiLink veraSpecialCharacter veraSpecial HiLink veraNumber Number HiLink veraOctal Number HiLink veraOctalZero PreProc " link this to Error if you want HiLink veraFloat Float HiLink veraOctalError veraError HiLink veraParenError veraError HiLink veraErrInParen veraError HiLink veraErrInBracket veraError HiLink veraCommentError veraError HiLink veraCommentStartError veraError HiLink veraSpaceError SpaceError HiLink veraSpecialError veraError HiLink veraOperator Operator HiLink veraStructure Structure HiLink veraInclude Include HiLink veraPreProc PreProc HiLink veraDefine Macro HiLink veraIncluded veraString HiLink veraError Error HiLink veraStatement Statement HiLink veraPreCondit PreCondit HiLink veraType Type " HiLink veraConstant Constant HiLink veraConstant Keyword HiLink veraUserConstant Constant HiLink veraCommentString veraString HiLink veraComment2String veraString HiLink veraCommentSkip veraComment HiLink veraString String HiLink veraComment Comment HiLink veraSpecial SpecialChar HiLink veraTodo Todo HiLink veraCppSkip veraCppOut HiLink veraCppOut2 veraCppOut HiLink veraCppOut Comment delcommand HiLink endif let b:current_syntax = "vera" " vim: ts=8 vim-7.4.1689/runtime/syntax/verilog.vim000066400000000000000000000126311267703067000177750ustar00rootroot00000000000000" Vim syntax file " Language: Verilog " Maintainer: Mun Johl " Last Update: Wed Jul 20 16:04:19 PDT 2011 " For version 5.x: Clear all syntax items " 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. " NOTE: '?' was added so that verilogNumber would be processed correctly when " '?' is the last character of the number. if version >= 600 setlocal iskeyword=@,48-57,63,_,192-255 else set iskeyword=@,48-57,63,_,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 FIXME syn match verilogOperator "[&|~>" 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\+\|\)'[sS]\?[bB]\s*[0-1_xXzZ?]\+\>" syn match verilogNumber "\(\<\d\+\|\)'[sS]\?[oO]\s*[0-7_xXzZ?]\+\>" syn match verilogNumber "\(\<\d\+\|\)'[sS]\?[dD]\s*[0-9_xXzZ?]\+\>" syn match verilogNumber "\(\<\d\+\|\)'[sS]\?[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,@Spell 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 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_verilog_syn_inits") if version < 508 let did_verilog_syn_inits = 1 command -nargs=+ HiLink hi link else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/verilogams.vim000066400000000000000000000146341267703067000205030ustar00rootroot00000000000000" Vim syntax file " Language: Verilog-AMS " Maintainer: S. Myles Prather " " Version 1.1 S. Myles Prather " Moved some keywords to the type category. " Added the metrix suffixes to the number matcher. " Version 1.2 Prasanna Tamhankar " Minor reserved keyword updates. " Last Update: Thursday September 15 15:36:03 CST 2005 " For version 5.x: Clear all syntax items " 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 " Annex B.1 'All keywords' syn keyword verilogamsStatement above abs absdelay acos acosh ac_stim syn keyword verilogamsStatement always analog analysis and asin syn keyword verilogamsStatement asinh assign atan atan2 atanh syn keyword verilogamsStatement buf bufif0 bufif1 ceil cmos connectmodule syn keyword verilogamsStatement connectrules cos cosh cross ddt ddx deassign syn keyword verilogamsStatement defparam disable discipline syn keyword verilogamsStatement driver_update edge enddiscipline syn keyword verilogamsStatement endconnectrules endmodule endfunction endgenerate syn keyword verilogamsStatement endnature endparamset endprimitive endspecify syn keyword verilogamsStatement endtable endtask event exp final_step syn keyword verilogamsStatement flicker_noise floor flow force fork syn keyword verilogamsStatement function generate highz0 syn keyword verilogamsStatement highz1 hypot idt idtmod if ifnone inf initial syn keyword verilogamsStatement initial_step inout input join syn keyword verilogamsStatement laplace_nd laplace_np laplace_zd laplace_zp syn keyword verilogamsStatement large last_crossing limexp ln localparam log syn keyword verilogamsStatement macromodule max medium min module nand nature syn keyword verilogamsStatement negedge net_resolution nmos noise_table nor not syn keyword verilogamsStatement notif0 notif1 or output paramset pmos syn keyword verilogamsType parameter real integer electrical input output syn keyword verilogamsType inout reg tri tri0 tri1 triand trior trireg syn keyword verilogamsType string from exclude aliasparam ground genvar syn keyword verilogamsType branch time realtime syn keyword verilogamsStatement posedge potential pow primitive pull0 pull1 syn keyword verilogamsStatement pullup pulldown rcmos release syn keyword verilogamsStatement rnmos rpmos rtran rtranif0 rtranif1 syn keyword verilogamsStatement scalared sin sinh slew small specify specparam syn keyword verilogamsStatement sqrt strong0 strong1 supply0 supply1 syn keyword verilogamsStatement table tan tanh task timer tran tranif0 syn keyword verilogamsStatement tranif1 transition syn keyword verilogamsStatement vectored wait wand weak0 weak1 syn keyword verilogamsStatement white_noise wire wor wreal xnor xor zi_nd syn keyword verilogamsStatement zi_np zi_zd zi_zp syn keyword verilogamsRepeat forever repeat while for syn keyword verilogamsLabel begin end syn keyword verilogamsConditional if else case casex casez default endcase syn match verilogamsConstant ":inf"lc=1 syn match verilogamsConstant "-inf"lc=1 " Annex B.2 Discipline/nature syn keyword verilogamsStatement abstol access continuous ddt_nature discrete syn keyword verilogamsStatement domain idt_nature units " Annex B.3 Connect Rules syn keyword verilogamsStatement connect merged resolveto split syn match verilogamsOperator "[&|~>" syn match verilogamsConstant "\<[A-Z][A-Z0-9_]\+\>" syn match verilogamsNumber "\(\<\d\+\|\)'[bB]\s*[0-1_xXzZ?]\+\>" syn match verilogamsNumber "\(\<\d\+\|\)'[oO]\s*[0-7_xXzZ?]\+\>" syn match verilogamsNumber "\(\<\d\+\|\)'[dD]\s*[0-9_xXzZ?]\+\>" syn match verilogamsNumber "\(\<\d\+\|\)'[hH]\s*[0-9a-fA-F_xXzZ?]\+\>" syn match verilogamsNumber "\<[+-]\=[0-9_]\+\(\.[0-9_]*\|\)\(e[0-9_]*\|\)[TGMKkmunpfa]\=\>" syn region verilogamsString start=+"+ skip=+\\"+ end=+"+ contains=verilogamsEscape syn match verilogamsEscape +\\[nt"\\]+ contained syn match verilogamsEscape "\\\o\o\=\o\=" contained "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_verilogams_syn_inits") if version < 508 let did_verilogams_syn_inits = 1 command -nargs=+ HiLink hi link else command -nargs=+ HiLink hi def link endif " The default highlighting. HiLink verilogamsCharacter Character HiLink verilogamsConditional Conditional HiLink verilogamsRepeat Repeat HiLink verilogamsString String HiLink verilogamsTodo Todo HiLink verilogamsComment Comment HiLink verilogamsConstant Constant HiLink verilogamsLabel Label HiLink verilogamsNumber Number HiLink verilogamsOperator Special HiLink verilogamsStatement Statement HiLink verilogamsGlobal Define HiLink verilogamsDirective SpecialComment HiLink verilogamsEscape Special HiLink verilogamsType Type HiLink verilogamsSystask Function delcommand HiLink endif let b:current_syntax = "verilogams" " vim: ts=8 vim-7.4.1689/runtime/syntax/vgrindefs.vim000066400000000000000000000022761267703067000203210ustar00rootroot00000000000000" Vim syntax file " Language: Vgrindefs " Maintainer: Bram Moolenaar " Last Change: 2005 Jun 20 " The Vgrindefs file is used to specify a language for vgrind " Quit when a (custom) syntax file was already loaded if 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. " Only used when an item doesn't have highlighting yet hi def link vgrindefsField Statement hi def link vgrindefsComment Comment let b:current_syntax = "vgrindefs" " vim: ts=8 vim-7.4.1689/runtime/syntax/vhdl.vim000066400000000000000000000227361267703067000172720ustar00rootroot00000000000000" Vim syntax file " Language: VHDL [VHSIC (Very High Speed Integrated Circuit) Hardware Description Language] " Maintainer: Daniel Kho " Previous Maintainer: Czo " Credits: Stephan Hegel " Last Changed: 2016 Mar 05 by Daniel Kho if version < 600 syntax clear elseif exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim " 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 assume assume_guarantee syn keyword vhdlStatement begin block body buffer bus syn keyword vhdlStatement case component configuration constant syn keyword vhdlStatement context cover syn keyword vhdlStatement default disconnect downto syn keyword vhdlStatement elsif end entity exit syn keyword vhdlStatement file for function syn keyword vhdlStatement fairness force 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 parameter property protected syn keyword vhdlStatement range record register reject report return syn keyword vhdlStatement release restrict restrict_guarantee syn keyword vhdlStatement select severity signal shared syn keyword vhdlStatement subtype syn keyword vhdlStatement sequence strong syn keyword vhdlStatement then to transport type syn keyword vhdlStatement unaffected units until use syn keyword vhdlStatement variable syn keyword vhdlStatement vmode vprop vunit syn keyword vhdlStatement wait when while with syn keyword vhdlStatement note warning error failure " Linting of conditionals. syn match vhdlStatement "\<\(if\|else\)\>" syn match vhdlError "\" " Types and type qualifiers " Predefined standard VHDL types syn match vhdlType "\\'\=" syn match vhdlType "\\'\=" syn match vhdlType "\\'\=" syn match vhdlType "\\'\=" syn match vhdlType "\\'\=" syn match vhdlType "\\'\=" syn match vhdlType "\\'\=" syn match vhdlType "\\'\=" syn match vhdlType "\\'\=" syn match vhdlType "\\'\=" syn match vhdlType "\\'\=" syn match vhdlType "\\'\=" syn match vhdlType "\\'\=" syn match vhdlType "\\'\=" "syn keyword vhdlType severity_level syn keyword vhdlType line syn keyword vhdlType text " Predefined standard IEEE VHDL types syn match vhdlType "\\'\=" syn match vhdlType "\\'\=" syn match vhdlType "\\'\=" syn match vhdlType "\\'\=" syn match vhdlType "\\'\=" syn match vhdlType "\\'\=" syn match vhdlType "\\'\=" syn match vhdlType "\\'\=" syn match vhdlType "\\'\=" syn match vhdlType "\\'\=" " 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 "\'simple_name" syn match vhdlAttribute "\'instance_name" syn match vhdlAttribute "\'path_name" syn match vhdlAttribute "\'foreign" " VHPI " 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 "\'subtype" syn match vhdlAttribute "\'element" syn match vhdlAttribute "\'leftof" 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\-\?]\'" 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 " Concatenation and math operators syn match vhdlOperator "&\|+\|-\|\*\|\/" " Equality and comparison operators syn match vhdlOperator "=\|\/=\|>\|<\|>=" " Assignment operators syn match vhdlOperator "<=\|:=" syn match vhdlOperator "=>" " VHDL-2008 conversion, matching equality/non-equality operators syn match vhdlOperator "??\|?=\|?\/=\|?<\|?<=\|?>\|?>=" " VHDL-2008 external names syn match vhdlOperator "<<\|>>" " Linting for illegal operators " '=' syn match vhdlError "\(=\)[<=&+\-\*\/\\]\+" syn match vhdlError "[=&+\-\*\\]\+\(=\)" " '>', '<' " Allow external names: '<< ... >>' syn match vhdlError "\(>\)[<&+\-\/\\]\+" syn match vhdlError "[&+\-\/\\]\+\(>\)" syn match vhdlError "\(<\)[&+\-\/\\]\+" syn match vhdlError "[>=&+\-\/\\]\+\(<\)" " Covers most operators " support negative sign after operators. E.g. q<=-b; syn match vhdlError "\(&\|+\|\-\|\*\*\|\/=\|??\|?=\|?\/=\|?<=\|?>=\|>=\|<=\|:=\|=>\)[<>=&+\*\\?:]\+" syn match vhdlError "[<>=&+\-\*\\:]\+\(&\|+\|\*\*\|\/=\|??\|?=\|?\/=\|?<\|?<=\|?>\|?>=\|>=\|<=\|:=\|=>\)" syn match vhdlError "\(?<\|?>\)[<>&+\*\/\\?:]\+" syn match vhdlError "\(<<\|>>\)[<>&+\*\/\\?:]\+" "syn match vhdlError "[?]\+\(&\|+\|\-\|\*\*\|??\|?=\|?\/=\|?<\|?<=\|?>\|?>=\|:=\|=>\)" " '/' syn match vhdlError "\(\/\)[<>&+\-\*\/\\?:]\+" syn match vhdlError "[<>=&+\-\*\/\\:]\+\(\/\)" syn match vhdlSpecial "<>" 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 case match syn keyword vhdlTodo contained TODO NOTE syn keyword vhdlFixme contained FIXME syn case ignore syn region vhdlComment start="/\*" end="\*/" contains=vhdlTodo,vhdlFixme,@Spell syn match vhdlComment "\(^\|\s\)--.*" contains=vhdlTodo,vhdlFixme,@Spell " Standard IEEE P1076.6 preprocessor directives (metacomments). syn match vhdlPreProc "/\*\s*rtl_synthesis\s\+\(on\|off\)\s*\*/" syn match vhdlPreProc "\(^\|\s\)--\s*rtl_synthesis\s\+\(on\|off\)\s*" syn match vhdlPreProc "/\*\s*rtl_syn\s\+\(on\|off\)\s*\*/" syn match vhdlPreProc "\(^\|\s\)--\s*rtl_syn\s\+\(on\|off\)\s*" " Industry-standard directives. These are not standard VHDL, but are commonly " used in the industry. syn match vhdlPreProc "/\*\s*synthesis\s\+translate_\(on\|off\)\s*\*/" "syn match vhdlPreProc "/\*\s*simulation\s\+translate_\(on\|off\)\s*\*/" syn match vhdlPreProc "/\*\s*pragma\s\+translate_\(on\|off\)\s*\*/" syn match vhdlPreProc "/\*\s*pragma\s\+synthesis_\(on\|off\)\s*\*/" syn match vhdlPreProc "/\*\s*synopsys\s\+translate_\(on\|off\)\s*\*/" syn match vhdlPreProc "\(^\|\s\)--\s*synthesis\s\+translate_\(on\|off\)\s*" "syn match vhdlPreProc "\(^\|\s\)--\s*simulation\s\+translate_\(on\|off\)\s*" syn match vhdlPreProc "\(^\|\s\)--\s*pragma\s\+translate_\(on\|off\)\s*" syn match vhdlPreProc "\(^\|\s\)--\s*pragma\s\+synthesis_\(on\|off\)\s*" syn match vhdlPreProc "\(^\|\s\)--\s*synopsys\s\+translate_\(on\|off\)\s*" "Modify the following as needed. The trade-off is performance versus functionality. syn sync minlines=600 " Define the default highlighting. " For version 5.7 and earlier: only 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 else command -nargs=+ HiLink hi def link endif HiLink vhdlSpecial Special HiLink vhdlStatement Statement HiLink vhdlCharacter Character HiLink vhdlString String HiLink vhdlVector Number HiLink vhdlBoolean Number HiLink vhdlTodo Todo HiLink vhdlFixme Fixme HiLink vhdlComment Comment HiLink vhdlNumber Number HiLink vhdlTime Number HiLink vhdlType Type HiLink vhdlOperator Operator HiLink vhdlError Error HiLink vhdlAttribute Special HiLink vhdlPreProc PreProc delcommand HiLink endif let b:current_syntax = "vhdl" let &cpo = s:cpo_save unlet s:cpo_save " vim: ts=8 vim-7.4.1689/runtime/syntax/vim.vim000066400000000000000000001775711267703067000171400ustar00rootroot00000000000000" Vim syntax file " Language: Vim 7.4 script " Maintainer: Charles E. Campbell " Last Change: February 17, 2016 " Version: 7.4-44 " Automatically generated keyword lists: {{{1 " Quit when a syntax file was already loaded {{{2 if exists("b:current_syntax") finish endif let s:keepcpo= &cpo set cpo&vim " vimTodo: contains common special-notices for comments {{{2 " Use the vimCommentGroup cluster to add your own. syn keyword vimTodo contained COMBAK FIXME TODO XXX syn cluster vimCommentGroup contains=vimTodo,@Spell " regular vim commands {{{2 syn keyword vimCommand contained a arga[dd] argl[ocal] ba[ll] bn[ext] breakd[el] bufdo cabc[lear] cat[ch] ce[nter] cgetb[uffer] che[ckpath] cmapc[lear] cnf com cope[n] cs de delep delf di difft[his] dj[ump] dr[op] ec elsei[f] endf[unction] exi[t] filetype fix[del] for gr[ep] h[elp] hid[e] ij[ump] isp[lit] keepalt lad la[st] lcl[ose] lex[pr] lgete[xpr] ll lne lnf[ile] loc[kmarks] lr[ewind] lv[imgrep] marks mk mkv[imrc] mz[scheme] new noswap[file] o[pen] ped[it] pp[op] profd[el] ptf[irst] ptN[ext] py python3 re redr[aw] rew[ind] rubyf[ile] sa[rgument] sbn[ext] scripte[ncoding] setf[iletype] sh[ell] sim[alt] sm[ap] sni[ff] sor[t] spelli[nfo] spr[evious] start st[op] sunmenu syn ta tabf[ind] tabnew tabr[ewind] tcld[o] tj[ump] tN tr tu[nmenu] undoj[oin] uns[ilent] ve[rsion] vimgrepa[dd] vs[plit] winc[md] wN[ext] ws[verb] x[it] xnoremenu syn keyword vimCommand contained ab argd ar[gs] bd[elete] bN[ext] breakl[ist] b[uffer] cad cb[uffer] cex[pr] cgete[xpr] checkt[ime] cn cNf comc[lear] co[py] cscope debug d[elete] delf[unction] diffg[et] diffu[pdate] dl ds[earch] echoe[rr] em[enu] en[dif] exu[sage] fin fo[ld] fu grepa[dd] helpc[lose] his[tory] il[ist] iuna[bbrev] keepj[umps] laddb[uffer] lat lcs lf lg[etfile] lla[st] lnew[er] lNf[ile] lockv[ar] ls lvimgrepa[dd] mat[ch] mk[exrc] mo n n[ext] nu[mber] opt[ions] pe[rl] pr prof[ile] ptj[ump] ptp[revious] py3 q r[ead] redraws[tatus] ri[ght] rundo sav[eas] sbN[ext] scrip[tnames] setg[lobal] si sl sme sno[magic] so[urce] spellr[epall] sre[wind] startg[replace] stopi[nsert] sus[pend] sync tab tabfir[st] tabn[ext] tabs tclf[ile] tl[ast] tn[ext] tr[ewind] u undol[ist] up[date] vert[ical] vi[sual] w windo wp[revious] wundo xmapc[lear] xunme syn keyword vimCommand contained abc[lear] argd[elete] argu[ment] bel[owright] bo[tright] br[ewind] buffers caddb[uffer] cc cf cg[etfile] cl cN cnf[ile] comp[iler] cpf[ile] cstag debugg[reedy] deletel dell diffo[ff] dig dli[st] dsp[lit] echom[sg] en endt[ry] f fina[lly] foldc[lose] fun gui helpf[ind] i imapc[lear] j[oin] kee[pmarks] lad[dexpr] later lcscope lfdo lgr[ep] lli[st] lne[xt] lo lol[der] lt[ag] lw[indow] menut mks[ession] mod[e] nbc[lose] nmapc[lear] o ownsyntax perld[o] pre[serve] promptf[ind] ptl[ast] ptr[ewind] py3do qa[ll] rec[over] reg[isters] rightb[elow] ru[ntime] sba[ll] sbp[revious] scs setl[ocal] sig sla[st] smenu snoreme spe spellu[ndo] st star[tinsert] sts[elect] sv[iew] syncbind tabc[lose] tabl[ast] tabN[ext] ta[g] te[aroff] tm tN[ext] try un unh[ide] v vi viu[sage] wa[ll] winp[os] wq wv[iminfo] xme xunmenu syn keyword vimCommand contained abo[veleft] argdo as[cii] bf[irst] bp[revious] bro[wse] bun[load] cad[dexpr] ccl[ose] cfdo c[hange] cla[st] cnew[er] cNf[ile] con cp[revious] cuna[bbrev] del deletep delm[arks] diffp[atch] dig[raphs] do e echon endf endw[hile] f[ile] fin[d] folddoc[losed] fu[nction] gvim helpg[rep] ia in ju[mps] keepp[atterns] laddf[ile] lb[uffer] ld[o] lf[ile] lgrepa[dd] lmak[e] lN[ext] loadk lop[en] lua ma menut[ranslate] mksp[ell] m[ove] nb[key] noa ol[dfiles] p po[p] prev[ious] promptr[epl] ptn pts[elect] pydo q[uit] red res[ize] ru rv[iminfo] sbf[irst] sbr[ewind] scscope sf[ind] sign sl[eep] sn[ext] snoremenu spelld[ump] spellw[rong] sta[g] startr[eplace] sun[hide] sw[apname] syntime tabd[o] tabm[ove] tabo[nly] tags tf[irst] tm[enu] to[pleft] ts[elect] una[bbreviate] unl ve vie[w] vmapc[lear] wh[ile] win[size] wqa[ll] x xmenu xwininfo syn keyword vimCommand contained al[l] arge[dit] au bl[ast] brea[k] bu bw[ipeout] caddf[ile] cd cf[ile] changes cl[ist] cn[ext] col[der] conf[irm] cq[uit] cw[indow] delc[ommand] deletl delp diffpu[t] dir doau ea e[dit] endfo[r] ene[w] files fini[sh] foldd[oopen] g h helpt[ags] iabc[lear] intro k l lan lc[d] le[ft] lfir[st] lh[elpgrep] lmapc[lear] lnf loadkeymap lpf[ile] luado mak[e] mes mkv mz nbs[tart] noautocmd omapc[lear] pc[lose] popu p[rint] ps[earch] ptN pu[t] pyf[ile] quita[ll] redi[r] ret[ab] rub[y] sal[l] sbl[ast] sb[uffer] se[t] sfir[st] sil[ent] sm[agic] sN[ext] so spe[llgood] sp[lit] star stj[ump] sunme sy t tabe[dit] tabN tabp[revious] tc[l] th[row] tn tp[revious] tu u[ndo] unlo[ckvar] verb[ose] vim[grep] vne[w] win wn[ext] w[rite] xa[ll] xnoreme y[ank] syn keyword vimCommand contained ar argg[lobal] bad[d] bm[odified] breaka[dd] buf c cal[l] cdo cfir[st] chd[ir] clo[se] cN[ext] colo[rscheme] con[tinue] cr[ewind] d delel deletp dep diffs[plit] di[splay] dp earlier el[se] endfun ex filet fir[st] foldo[pen] go[to] ha[rdcopy] hi if is[earch] keepa la lan[guage] lch[dir] lefta[bove] lgetb[uffer] l[ist] lN lNf lo[adview] lp[revious] luafile ma[rk] messages mkvie[w] mzf[ile] ne noh[lsearch] on[ly] pe popu[p] pro pta[g] ptn[ext] pw[d] py[thon] r red[o] retu[rn] rubyd[o] san[dbox] sbm[odified] scrip syn match vimCommand contained "\" syn keyword vimStdPlugin contained DiffOrig Man N[ext] P[rint] S TOhtml XMLent XMLns " vimOptions are caught only when contained in a vimSet {{{2 syn keyword vimOption contained acd ambw arshape background ballooneval bg bl brk buftype cf cinkeys cmp comments conceallevel cpo cscopequickfix csqf cursorbind define diffexpr dy ef eol esckeys fcs fdn ff fileignorecase flp foldexpr foldnestmax fp gfm grepformat guifontwide helpheight highlight hlg im imd imstatusfunc indentkeys isf isprint km lazyredraw lispwords lpl macatsui maxcombine mef mls modelines mousehide mp nu omnifunc paragraphs penc pi previewwindow printmbfont pythondll redrawtime revins ro ruler scb scs sessionoptions shellquote shiftround showfulltag sidescrolloff smarttab sp spf srr startofline suffixes switchbuf ta taglength tbidi termbidi tgst titleold top ttimeoutlen ttyscroll ul ur verbosefile visualbell wcm wi wildmenu winfixwidth wm wrapscan syn keyword vimOption contained ai anti autochdir backspace balloonexpr bh bo browsedir casemap cfu cino cms commentstring confirm cpoptions cscoperelative csre cursorcolumn delcombine diffopt ea efm ep et fdc fdo ffs filetype fml foldignore foldopen fs gfn grepprg guiheadroom helplang history hls imactivatefunc imdisable inc indk isfname joinspaces kmp lbr list ls magic maxfuncdepth menuitems mm modifiable mousem mps number opendevice paste perldll pm printdevice printoptions pythonthreedll regexpengine ri rop rulerformat scr sect sft shellredir shiftwidth showmatch siso smc spc spl ss statusline suffixesadd sws tabline tagrelative tbis termencoding thesaurus titlestring tpm ttm ttytype undodir ut vfile vop wd wic wildmode winheight wmh write syn keyword vimOption contained akm antialias autoindent backup bdir bin bomb bs cb ch cinoptions co compatible consk cpt cscopetag cst cursorline dex digraph ead ei equalalways eventignore fde fdt fic fillchars fmr foldlevel foldtext fsync gfs gtl guioptions hf hk hlsearch imactivatekey imi include inex isi js kp lcs listchars lsp makeef maxmapdepth mfd mmd modified mousemodel msm numberwidth operatorfunc pastetoggle pex pmbcs printencoding prompt qe relativenumber rightleft rs runtimepath scroll sections sh shellslash shm showmode sj smd spell splitbelow ssl stl sw sxe tabpagemax tags tbs terse tildeop tl tr tty tw undofile vb vi wa weirdinvert wig wildoptions winminheight wmnu writeany syn keyword vimOption contained al ar autoread backupcopy bdlay binary breakat bsdir cc charconvert cinw cocu complete conskey crb cscopetagorder csto cwh dg dip eadirection ek equalprg ex fdi fen fileencoding fixendofline fo foldlevelstart formatexpr ft gfw gtt guipty hh hkmap ic imaf iminsert includeexpr inf isident key langmap linebreak lm luadll makeprg maxmem mh mmp more mouses mzq nuw opfunc patchexpr pexpr pmbfn printexpr pt quoteescape remap rightleftcmd rtp sb scrollbind secure shcf shelltemp shortmess showtabline slm sn spellcapcheck splitright ssop stmp swapfile sxq tabstop tagstack tc textauto timeout tm ts ttybuiltin tx undolevels vbs viewdir wak wfh wildchar wim winminwidth wmw writebackup syn keyword vimOption contained aleph arab autowrite backupdir belloff biosk breakindent bsk ccv ci cinwords cole completefunc copyindent cryptmethod cscopeverbose csverb debug dict dir eb enc errorbells expandtab fdl fenc fileencodings fixeol foldclose foldmarker formatlistpat gcr ghr guicursor guitablabel hi hkmapp icon imak ims incsearch infercase isk keymap langmenu lines lmap lw mat maxmempattern mis mmt mouse mouseshape mzquantum odev osfiletype patchmode pfn popt printfont pumheight rdt renderoptions rl ru sbo scrolljump sel shell shelltype shortname shq sm so spellfile spr st sts swapsync syn tag tal tcldll textmode timeoutlen to tsl ttyfast uc undoreload vdir viewoptions warn wfw wildcharm winaltkeys winwidth wop writedelay syn keyword vimOption contained allowrevins arabic autowriteall backupext beval bioskey breakindentopt bt cd cin clipboard colorcolumn completeopt cot cscopepathcomp cspc cuc deco dictionary directory ed encoding errorfile exrc fdls fencs fileformat fk foldcolumn foldmethod formatoptions gd go guifont guitabtooltip hid hkp iconstring imc imsearch inde insertmode iskeyword keymodel langnoremap linespace lnr lz matchpairs maxmemtot mkspellmem mod mousef mouset nf oft pa path ph preserveindent printheader pvh re report rlc rubydll sbr scrolloff selection shellcmdflag shellxescape showbreak si smartcase softtabstop spelllang sps sta su swb synmaxcol tagbsearch tb tenc textwidth title toolbar tsr ttym udf updatecount ve viminfo wb wh wildignore window wiv wrap ws syn keyword vimOption contained altkeymap arabicshape aw backupskip bex bk bri bufhidden cdpath cindent cmdheight columns concealcursor cp cscopeprg csprg cul def diff display edcompatible endofline errorformat fcl fdm fex fileformats fkmap foldenable foldminlines formatprg gdefault gp guifontset helpfile hidden hl ignorecase imcmdline imsf indentexpr is isp keywordprg laststatus lisp loadplugins ma matchtime mco ml modeline mousefocus mousetime nrformats ofu para pdev pheader previewheight printmbcharset pvw readonly restorescreen rnu ruf sc scrollopt selectmode shellpipe shellxquote showcmd sidescroll smartindent sol spellsuggest sr stal sua swf syntax tagcase tbi term tf titlelen toolbariconsize ttimeout ttymouse udir updatetime verbose virtualedit wc whichwrap wildignorecase winfixheight wiw wrapmargin ww syn keyword vimOption contained ambiwidth ari awa balloondelay bexpr bkc briopt buflisted cedit cink cmdwinheight com " vimOptions: These are the turn-off setting variants {{{2 syn keyword vimOption contained noacd noallowrevins noantialias noarabic noarshape noautoread noaw noballooneval nobinary nobk nobuflisted nocin noconfirm nocopyindent nocscoperelative nocsre nocuc nocursorcolumn nodelcombine nodigraph noed noendofline noerrorbells noex nofen nofixendofline nofkmap nogdefault nohidden nohkmapp nohlsearch noicon noim noimcmdline noimdisable noinf noinsertmode nojoinspaces nolazyredraw nolinebreak nolist nolpl noma nomagic noml nomodeline nomodified nomousef nomousehide nonumber noopendevice nopi nopreviewwindow nopvw norelativenumber norestorescreen nori norl noro noru nosb noscb noscs nosft noshelltemp noshortname noshowfulltag noshowmode nosm nosmartindent nosmd nosol nosplitbelow nospr nossl nostartofline noswapfile nota notagrelative notbi notbs noterse notextmode notgst notimeout noto notr nottybuiltin notx noundofile novisualbell nowarn noweirdinvert nowfw nowildignorecase nowinfixheight nowiv nowrap nowrite nowritebackup syn keyword vimOption contained noai noaltkeymap noar noarabicshape noautochdir noautowrite noawa nobeval nobiosk nobl nocf nocindent noconsk nocp nocscopetag nocst nocul nocursorline nodg noea noedcompatible noeol noesckeys noexpandtab nofic nofixeol nofoldenable noguipty nohk nohkp noic noignorecase noimc noimd noincsearch noinfercase nois nojs nolbr nolisp noloadplugins nolz nomacatsui nomh nomod nomodifiable nomore nomousefocus nonu noodev nopaste nopreserveindent noprompt noreadonly noremap norevins norightleft nornu nors noruler nosc noscrollbind nosecure noshellslash noshiftround noshowcmd noshowmatch nosi nosmartcase nosmarttab nosn nospell nosplitright nosr nosta nostmp noswf notagbsearch notagstack notbidi notermbidi notextauto notf notildeop notitle notop nottimeout nottyfast noudf novb nowa nowb nowfh nowic nowildmenu nowinfixwidth nowmnu nowrapscan nowriteany nows syn keyword vimOption contained noakm noanti noarab noari noautoindent noautowriteall nobackup nobin nobioskey nobomb noci nocompatible noconskey nocrb nocscopeverbose nocsverb nocursorbind nodeco nodiff noeb noek noequalalways noet noexrc nofileignorecase nofk nogd nohid nohkmap nohls " vimOptions: These are the invertible variants {{{2 syn keyword vimOption contained invacd invallowrevins invantialias invarabic invarshape invautoread invaw invballooneval invbinary invbk invbuflisted invcin invconfirm invcopyindent invcscoperelative invcsre invcuc invcursorcolumn invdelcombine invdigraph inved invendofline inverrorbells invex invfen invfixendofline invfkmap invgdefault invhidden invhkmapp invhlsearch invicon invim invimcmdline invimdisable invinf invinsertmode invjoinspaces invlazyredraw invlinebreak invlist invlpl invma invmagic invml invmodeline invmodified invmousef invmousehide invnumber invopendevice invpi invpreviewwindow invpvw invrelativenumber invrestorescreen invri invrl invro invru invsb invscb invscs invsft invshelltemp invshortname invshowfulltag invshowmode invsm invsmartindent invsmd invsol invsplitbelow invspr invssl invstartofline invswapfile invta invtagrelative invtbi invtbs invterse invtextmode invtgst invtimeout invto invtr invttybuiltin invtx invundofile invvisualbell invwarn invweirdinvert invwfw invwildignorecase invwinfixheight invwiv invwrap invwrite invwritebackup syn keyword vimOption contained invai invaltkeymap invar invarabicshape invautochdir invautowrite invawa invbeval invbiosk invbl invcf invcindent invconsk invcp invcscopetag invcst invcul invcursorline invdg invea invedcompatible inveol invesckeys invexpandtab invfic invfixeol invfoldenable invguipty invhk invhkp invic invignorecase invimc invimd invincsearch invinfercase invis invjs invlbr invlisp invloadplugins invlz invmacatsui invmh invmod invmodifiable invmore invmousefocus invnu invodev invpaste invpreserveindent invprompt invreadonly invremap invrevins invrightleft invrnu invrs invruler invsc invscrollbind invsecure invshellslash invshiftround invshowcmd invshowmatch invsi invsmartcase invsmarttab invsn invspell invsplitright invsr invsta invstmp invswf invtagbsearch invtagstack invtbidi invtermbidi invtextauto invtf invtildeop invtitle invtop invttimeout invttyfast invudf invvb invwa invwb invwfh invwic invwildmenu invwinfixwidth invwmnu invwrapscan invwriteany invws syn keyword vimOption contained invakm invanti invarab invari invautoindent invautowriteall invbackup invbin invbioskey invbomb invci invcompatible invconskey invcrb invcscopeverbose invcsverb invcursorbind invdeco invdiff inveb invek invequalalways invet invexrc invfileignorecase invfk invgd invhid invhkmap invhls " termcap codes (which can also be set) {{{2 syn keyword vimOption contained t_AB t_al t_bc t_ce t_cl t_Co t_Cs t_CV t_db t_dl t_DL t_EI 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_SI t_so t_sr t_SR t_te t_ti t_ts t_u7 t_ue t_us t_ut t_vb t_ve t_vi t_vs t_WP t_WS t_xn t_xs t_ZH t_ZR syn keyword vimOption contained t_AF t_AL t_cd t_Ce t_cm t_cs t_CS t_da 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 " AutoCmd 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 CmdUndefined CmdwinEnter CmdwinLeave ColorScheme CompleteDone CursorHold CursorHoldI CursorMoved CursorMovedI EncodingChanged FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileChangedShellPost FileEncoding FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre FilterWritePost FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter GUIFailed InsertChange InsertCharPre InsertEnter InsertLeave MenuPopup OptionSet QuickFixCmdPost QuickFixCmdPre QuitPre RemoteReply SessionLoadPost ShellCmdPost ShellFilterPost SourceCmd SourcePre SpellFileMissing StdinReadPost StdinReadPre SwapExists Syntax TabEnter TabLeave TermChanged TermResponse TextChanged TextChangedI User UserGettingBored VimEnter VimLeave VimLeavePre VimResized 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 ColorColumn Cursor CursorColumn CursorIM CursorLine CursorLineNr DiffAdd DiffChange DiffDelete DiffText Directory ErrorMsg FoldColumn Folded IncSearch LineNr MatchParen Menu ModeMsg MoreMsg NonText Normal Pmenu PmenuSbar PmenuSel PmenuThumb Question Scrollbar Search SignColumn SpecialKey SpellBad SpellCap SpellLocal SpellRare StatusLine StatusLineNC TabLine TabLineFill TabLineSel Title Tooltip VertSplit Visual VisualNOS WarningMsg WildMenu syn match vimHLGroup contained "Conceal" syn case match " Function Names {{{2 syn keyword vimFuncName contained abs alloc_fail argc argv assert_exception assert_true browse buflisted bufnr byteidx ceil cindent complete confirm cos cscope_connection delete diff_hlID eval exepath expand feedkeys filter float2nr fnameescape foldclosedend foldtextresult garbagecollect getbufvar getcharsearch getcmdtype getcwd getfsize getline getpid getreg gettabwinvar getwinvar globpath haslocaldir histdel hlexists iconv input inputrestore insert islocked jsondecode len line localtime luaeval mapcheck matchaddpos matchend max mode nr2char perleval printf pyeval reltime remote_foreground remote_send repeat round screencol searchdecl searchpos server2client setcharsearch setloclist setqflist settabwinvar shellescape sin soundfold split str2nr strftime strlen strtrans substitute synIDattr system tabpagenr taglist tanh tolower tr type undotree values visualmode winbufnr winheight winnr winrestview winwidth writefile syn keyword vimFuncName contained acos and argidx asin assert_fails atan browsedir bufloaded bufwinnr byteidxcomp changenr clearmatches complete_add connect cosh cursor did_filetype empty eventhandler exists expr8 filereadable finddir floor fnamemodify foldlevel foreground get getchar getcmdline getcmdwintype getfontname getftime getloclist getpos getregtype getwinposx glob has hasmapto histget hlID indent inputdialog inputsave invert items jsonencode libcall line2byte log map match matcharg matchlist min mzeval or pow pumvisible range reltimestr remote_peek remove resolve screenattr screenrow searchpair sendexpr serverlist setcmdpos setmatches setreg setwinvar shiftwidth sinh spellbadword sqrt strchars stridx strpart strwidth synconcealed synIDtrans systemlist tabpagewinnr tan tempname toupper trunc undofile uniq virtcol wildmenumode wincol winline winrestcmd winsaveview wordcount xor syn keyword vimFuncName contained add append arglistid assert_equal assert_false atan2 bufexists bufname byte2line call char2nr col complete_check copy count deepcopy diff_filler escape executable exp extend filewritable findfile fmod foldclosed foldtext function getbufline getcharmod getcmdpos getcurpos getfperm getftype getmatches getqflist gettabvar getwinposy glob2regpat has_key histadd histnr hostname index inputlist inputsecret isdirectory join keys libcallnr lispindent log10 maparg matchadd matchdelete matchstr mkdir nextnonblank pathshorten prevnonblank py3eval readfile remote_expr remote_read rename reverse screenchar search searchpairpos sendraw setbufvar setline setpos settabvar sha256 simplify sort spellsuggest str2float strdisplaywidth string strridx submatch synID synstack tabpagebuflist tagfiles "--- syntax here and above generated by mkvimvim --- " Special Vim Highlighting (not automatic) {{{1 " Set up folding commands if exists("g:vimsyn_folding") && g:vimsyn_folding =~# '[aflmpPrt]' if g:vimsyn_folding =~# 'a' com! -nargs=* VimFolda fold else com! -nargs=* VimFolda endif if g:vimsyn_folding =~# 'f' com! -nargs=* VimFoldf fold else com! -nargs=* VimFoldf endif if g:vimsyn_folding =~# 'l' com! -nargs=* VimFoldl fold else com! -nargs=* VimFoldl endif if g:vimsyn_folding =~# 'm' com! -nargs=* VimFoldm fold else com! -nargs=* VimFoldm endif if g:vimsyn_folding =~# 'p' com! -nargs=* VimFoldp fold else com! -nargs=* VimFoldp endif if g:vimsyn_folding =~# 'P' com! -nargs=* VimFoldP fold else com! -nargs=* VimFoldP endif if g:vimsyn_folding =~# 'r' com! -nargs=* VimFoldr fold else com! -nargs=* VimFoldr endif if g:vimsyn_folding =~# 't' com! -nargs=* VimFoldt fold else com! -nargs=* VimFoldt endif else com! -nargs=* VimFolda com! -nargs=* VimFoldf com! -nargs=* VimFoldl com! -nargs=* VimFoldm com! -nargs=* VimFoldp com! -nargs=* VimFoldP com! -nargs=* VimFoldr com! -nargs=* VimFoldt endif " commands not picked up by the generator (due to non-standard format) syn keyword vimCommand contained py3 " Deprecated variable options {{{2 if exists("g:vim_minlines") let g:vimsyn_minlines= g:vim_minlines endif if exists("g:vim_maxlines") let g:vimsyn_maxlines= g:vim_maxlines endif if exists("g:vimsyntax_noerror") let g:vimsyn_noerror= g:vimsyntax_noerror endif " Numbers {{{2 " ======= syn match vimNumber "\<\d\+\%(\.\d\+\%([eE][+-]\=\d\+\)\=\)\=" skipwhite nextgroup=vimGlobal,vimSubst,vimCommand syn match vimNumber "-\d\+\%(\.\d\+\%([eE][+-]\=\d\+\)\=\)\=" skipwhite nextgroup=vimGlobal,vimSubst,vimCommand syn match vimNumber "\<0[xX]\x\+" syn match vimNumber "\%(^\|[^a-zA-Z]\)\zs#\x\{6}" " All vimCommands are contained by vimIsCommands. {{{2 syn match vimCmdSep "[:|]\+" skipwhite nextgroup=vimAddress,vimAutoCmd,vimIsCommand,vimExtCmd,vimFilter,vimLet,vimMap,vimMark,vimSet,vimSyntax,vimUserCmd syn match vimIsCommand "\<\h\w*\>" contains=vimCommand syn match vimVar contained "\<\h[a-zA-Z0-9#_]*\>" syn match vimVar "\<[bwglsav]:\h[a-zA-Z0-9#_]*\>" syn match vimFBVar contained "\<[bwglsav]:\h[a-zA-Z0-9#_]*\>" syn keyword vimCommand contained in " Insertions And Appends: insert append {{{2 " ======================= 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! {{{2 " ======= syn match vimBehave "\" skipwhite nextgroup=vimBehaveModel,vimBehaveError syn keyword vimBehaveModel contained mswin xterm if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_nobehaveerror") syn match vimBehaveError contained "[^ ]\+" endif " Filetypes {{{2 " ========= syn match vimFiletype "\\s\+[eE][nN][dD]\>" endif syn keyword vimAugroupKey contained aug[roup] " Operators: {{{2 " ========= syn cluster vimOperGroup contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimRegister,vimContinue syn match vimOper "\(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|=\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimSpecFile syn match vimOper "||\|&&\|[-+.]" skipwhite nextgroup=vimString,vimSpecFile syn region vimOperParen matchgroup=vimParenSep start="(" end=")" contains=@vimOperGroup syn region vimOperParen matchgroup=vimSep start="{" end="}" contains=@vimOperGroup nextgroup=vimVar,vimFuncVar if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noopererror") syn match vimOperError ")" endif " Functions : Tag is provided for those who wish to highlight tagged functions {{{2 " ========= syn cluster vimFuncList contains=vimCommand,vimFunctionError,vimFuncKey,Tag,vimFuncSID syn cluster vimFuncBodyList contains=vimAbb,vimAddress,vimAugroupKey,vimAutoCmd,vimCmplxRepeat,vimComment,vimComment,vimContinue,vimCtrlChar,vimEcho,vimEchoHL,vimExecute,vimIf,vimIsCommand,vimFBVar,vimFunc,vimFunction,vimFuncVar,vimGlobal,vimHighlight,vimIsCommand,vimLet,vimLineComment,vimMap,vimMark,vimNorm,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSet,vimSpecFile,vimString,vimSubst,vimSynLine,vimUnmap,vimUserCommand syn match vimFunction "\\|[sSgGbBwWtTlL]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)*\ze\s*(" contains=@vimFuncList nextgroup=vimFuncBody if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f' syn region vimFuncBody contained fold start="\ze\s*(" matchgroup=vimCommand end="\<\(endf\>\|endfu\%[nction]\>\)" contains=@vimFuncBodyList else syn region vimFuncBody contained start="\ze\s*(" matchgroup=vimCommand end="\<\(endf\>\|endfu\%[nction]\>\)" contains=@vimFuncBodyList endif syn match vimFuncVar contained "a:\(\K\k*\|\d\+\)" syn match vimFuncSID contained "\c\|\" 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: {{{2 " ======================= syn cluster vimUserCmdList contains=vimAddress,vimSyntax,vimHighlight,vimAutoCmd,vimCmplxRepeat,vimComment,vimCtrlChar,vimEscapeBrace,vimFilter,vimFunc,vimFuncName,vimFunction,vimFunctionError,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 "\.*$" contains=vimUserAttrb,vimUserAttrbError,vimUserCommand,@vimUserCmdList syn match vimUserAttrbError contained "-\a\+\ze\s" syn match vimUserAttrb contained "-nargs=[01*?+]" contains=vimUserAttrbKey,vimOper syn match vimUserAttrb contained "-complete=" contains=vimUserAttrbKey,vimOper nextgroup=vimUserAttrbCmplt,vimUserCmdError syn match vimUserAttrb contained "-range\(=%\|=\d\+\)\=" contains=vimNumber,vimOper,vimUserAttrbKey syn match vimUserAttrb contained "-count\(=\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 "-buffer\>" contains=vimOper,vimUserAttrbKey syn match vimUserAttrb contained "-register\>" contains=vimOper,vimUserAttrbKey if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_nousercmderror") syn match vimUserCmdError contained "\S\+\>" endif 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 color command compiler cscope dir environment event expression file file_in_path filetype function help highlight locale mapping menu option shellcmd sign syntax tag tag_listfiles var syn keyword vimUserAttrbCmplt contained custom customlist nextgroup=vimUserAttrbCmpltFunc,vimUserCmdError syn match vimUserAttrbCmpltFunc contained ",\%([sS]:\|<[sS][iI][dD]>\)\=\%(\h\w*\%(#\h\w*\)\+\|\h\w*\)"hs=s+1 nextgroup=vimUserCmdError syn case match syn match vimUserAttrbCmplt contained "custom,\u\w*" " Lower Priority Comments: after some vim commands... {{{2 " ======================= syn match vimComment excludenl +\s"[^\-:.%#=*].*$+lc=1 contains=@vimCommentGroup,vimCommentString syn match vimComment +\!\\@]"+lc=1 skip=+\\\\\|\\"+ end=+"+ contains=@vimStringGroup syn region vimString oneline keepend start=+[^:a-zA-Z>!\\@]'+lc=1 end=+'+ 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/\s*\A"lc=1 skip="\\\\\|\\+" end="/" contains=@vimStringGroup syn match vimString contained +"[^"]*\\$+ skipnl nextgroup=vimStringCont syn match vimStringCont contained +\(\\\\\|.\)\{-}[^\\]"+ " Substitutions: {{{2 " ============= 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]\|sm\%[agic]\|sno\%[magic]\)[:[: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="\\\@]\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 "\'lc=1 syn match vimCmplxRepeat '@[0-9a-z".=@:]\ze\($\|[^a-zA-Z]\>\)' " Set command and associated set-options (vimOptions) with comment {{{2 syn region vimSet matchgroup=vimCommand start="\<\%(setl\%[ocal]\|setg\%[lobal]\|se\%[t]\)\>" skip="\%(\\\\\)*\\." end="$" matchgroup=vimNotation end="<[cC][rR]>" keepend oneline contains=vimSetEqual,vimOption,vimErrSetting,vimComment,vimSetString,vimSetMod syn region vimSetEqual contained start="[=:]\|[-+^]=" skip="\\\\\|\\\s" end="[| \t]\|$"me=e-1 contains=vimCtrlChar,vimSetSep,vimNotation,vimEnvvar oneline syn region vimSetString contained start=+="+hs=s+1 skip=+\\\\\|\\"+ end=+"+ contains=vimCtrlChar syn match vimSetSep contained "[,:]" skipwhite nextgroup=vimCommand syn match vimSetMod contained "&vim\=\|[!&?<]\|all&" " Let {{{2 " === syn keyword vimLet let unl[et] skipwhite nextgroup=vimVar,vimFuncVar " Abbreviations {{{2 " ============= syn keyword vimAbb ab[breviate] ca[bbrev] inorea[bbrev] cnorea[bbrev] norea[bbrev] ia[bbrev] skipwhite nextgroup=vimMapMod,vimMapLhs " Autocmd {{{2 " ======= 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! {{{2 " ================ syn region vimEcho oneline excludenl matchgroup=vimCommand start="\" skip="\(\\\\\)*\\|" end="$\||" contains=vimFunc,vimFuncVar,vimString,vimVar syn region vimExecute oneline excludenl matchgroup=vimCommand start="\" skip="\(\\\\\)*\\|" end="$\||\|<[cC][rR]>" contains=vimFuncVar,vimIsCommand,vimOper,vimNotation,vimOperParen,vimString,vimVar syn match vimEchoHL "echohl\=" skipwhite nextgroup=vimGroup,vimHLGroup,vimEchoHLNone syn case ignore syn keyword vimEchoHLNone none syn case match " Maps {{{2 " ==== syn match vimMap "\!\=\ze\s*[^(]" skipwhite nextgroup=vimMapMod,vimMapLhs syn keyword vimMap cm[ap] cno[remap] im[ap] ino[remap] lm[ap] ln[oremap] nm[ap] nn[oremap] no[remap] om[ap] ono[remap] smap snor[emap] vm[ap] vn[oremap] xm[ap] xn[oremap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs syn keyword vimMap mapc[lear] smapc[lear] syn keyword vimUnmap cu[nmap] iu[nmap] lu[nmap] nun[map] ou[nmap] sunm[ap] unm[ap] unm[ap] vu[nmap] xu[nmap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs syn match vimMapLhs contained "\S\+" contains=vimNotation,vimCtrlChar skipwhite nextgroup=vimMapRhs syn match vimMapBang contained "!" skipwhite nextgroup=vimMapMod,vimMapLhs syn match vimMapMod contained "\c<\(buffer\|expr\|\(local\)\=leader\|nowait\|plug\|script\|sid\|unique\|silent\)\+>" contains=vimMapModKey,vimMapModErr skipwhite nextgroup=vimMapMod,vimMapLhs syn match vimMapRhs contained ".*" contains=vimNotation,vimCtrlChar skipnl nextgroup=vimMapRhsExtend syn match vimMapRhsExtend contained "^\s*\\.*$" contains=vimContinue syn case ignore syn keyword vimMapModKey contained buffer expr leader localleader nowait plug script sid silent unique syn case match " Menus {{{2 " ===== 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\|\|\\\." 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) {{{2 " ====================== syn case ignore syn match vimNotation "\(\\\|\)\=<\([scamd]-\)\{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\|kpoint\|space\|k\=\(page\)\=\(\|down\|up\|k\d\>\)\)>" contains=vimBracket syn match vimNotation "\(\\\|\)\=<\([scam2-4]-\)\{0,4}\(right\|left\|middle\)\(mouse\)\=\(drag\|release\)\=>" contains=vimBracket syn match vimNotation "\(\\\|\)\=<\(bslash\|plug\|sid\|space\|bar\|nop\|nul\|lt\)>" contains=vimBracket syn match vimNotation '\(\\\|\)\=[0-9a-z"%#:.\-=]'he=e-1 contains=vimBracket syn match vimNotation '\(\\\|\)\=<\%(q-\)\=\(line[12]\|count\|bang\|reg\|args\|f-args\|lt\)>' contains=vimBracket syn match vimNotation "\(\\\|\)\=<\([cas]file\|abuf\|amatch\|cword\|cWORD\|client\)>" contains=vimBracket syn match vimBracket contained "[\\<>]" syn case match " User Function Highlighting {{{2 " (following Gautam Iyer's suggestion) " ========================== syn match vimFunc "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%([a-zA-Z0-9_]\+\.\)*\I[a-zA-Z0-9_.]*\)\ze\s*(" contains=vimFuncName,vimUserFunc,vimExecute syn match vimUserFunc contained "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%([a-zA-Z0-9_]\+\.\)*\I[a-zA-Z0-9_.]*\)\|\<\u[a-zA-Z0-9.]*\>\|\" contains=vimNotation syn match vimNotFunc "\\|\\|\\|\" " Errors And Warnings: {{{2 " ==================== if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimfunctionerror") syn match vimFunctionError "\s\zs[a-z0-9]\i\{-}\ze\s*(" contained contains=vimFuncKey,vimFuncBlank " syn match vimFunctionError "\s\zs\%(<[sS][iI][dD]>\|[sSgGbBwWtTlL]:\)[0-9]\i\{-}\ze\s*(" contained contains=vimFuncKey,vimFuncBlank syn match vimElseIfErr "\" syn match vimBufnrWarn /\" contains=vimCommand skipwhite nextgroup=vimSynType,vimComment syn match vimAuSyntax contained "\s+sy\%[ntax]" contains=vimCommand skipwhite nextgroup=vimSynType,vimComment syn cluster vimFuncBodyList add=vimSyntax " Syntax: case {{{2 syn keyword vimSynType contained case skipwhite nextgroup=vimSynCase,vimSynCaseError if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsyncaseerror") syn match vimSynCaseError contained "\i\+" endif syn keyword vimSynCase contained ignore match " Syntax: clear {{{2 syn keyword vimSynType contained clear skipwhite nextgroup=vimGroupList " Syntax: cluster {{{2 syn keyword vimSynType contained cluster skipwhite nextgroup=vimClusterName syn region vimClusterName contained matchgroup=vimGroupName start="\h\w*" skip="\\\\\|\\|" matchgroup=vimSep end="$\||" contains=vimGroupAdd,vimGroupRem,vimSynContains,vimSynError syn match vimGroupAdd contained "add=" nextgroup=vimGroupList syn match vimGroupRem contained "remove=" nextgroup=vimGroupList syn cluster vimFuncBodyList add=vimSynType,vimGroupAdd,vimGroupRem " Syntax: iskeyword {{{2 syn keyword vimSynType contained iskeyword skipwhite nextgroup=vimIskList syn match vimIskList contained '\S\+' contains=vimIskSep syn match vimIskSep contained ',' " Syntax: include {{{2 syn keyword vimSynType contained include skipwhite nextgroup=vimGroupList syn cluster vimFuncBodyList add=vimSynType " Syntax: keyword {{{2 syn cluster vimSynKeyGroup contains=vimSynNextgroup,vimSynKeyOpt,vimSynKeyContainedin syn keyword vimSynType contained keyword skipwhite nextgroup=vimSynKeyRegion syn region vimSynKeyRegion contained oneline keepend matchgroup=vimGroupName start="\h\w*" skip="\\\\\|\\|" matchgroup=vimSep end="|\|$" contains=@vimSynKeyGroup syn match vimSynKeyOpt contained "\<\(conceal\|contained\|transparent\|skipempty\|skipwhite\|skipnl\)\>" syn cluster vimFuncBodyList add=vimSynType " Syntax: match {{{2 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="\h\w*" 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 "\" 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 '"[^"]\+$' syn cluster vimFuncBodyList add=vimSynType " Syntax: sync {{{2 " ============ syn keyword vimSynType contained sync skipwhite nextgroup=vimSyncC,vimSyncLines,vimSyncMatch,vimSyncError,vimSyncLinebreak,vimSyncLinecont,vimSyncRegion if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsyncerror") syn match vimSyncError contained "\i\+" endif syn keyword vimSyncC contained ccomment clear fromstart syn keyword vimSyncMatch contained match skipwhite nextgroup=vimSyncGroupName syn keyword vimSyncRegion contained region skipwhite nextgroup=vimSynReg syn match vimSyncLinebreak contained "\" skipwhite nextgroup=vimSyncGroup syn match vimSyncGroup contained "\h\w*" skipwhite nextgroup=vimSynRegPat,vimSyncNone syn keyword vimSyncNone contained NONE " Additional IsCommand, here by reasons of precedence {{{2 " ==================== syn match vimIsCommand "\s*\a\+" transparent contains=vimCommand,vimNotation " Highlighting {{{2 " ============ syn cluster vimHighlightCluster contains=vimHiLink,vimHiClear,vimHiKeyList,vimComment if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimhictermerror") syn match vimHiCtermError contained "[^0-9]\i*" endif syn match vimHighlight "\" 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 undercurl 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 match vimHiCtermColor contained "\" syn case match syn match vimHiFontname contained "[a-zA-Z\-*]\+" syn match vimHiGuiFontname contained "'[a-zA-Z\-* ]\+'" syn match vimHiGuiRgb contained "#\x\{6}" " Highlighting: hi group key=arg ... {{{2 syn cluster vimHiCluster contains=vimGroup,vimHiGroup,vimHiTerm,vimHiCTerm,vimHiStartStop,vimHiCtermFgBg,vimHiGui,vimHiGuiFont,vimHiGuiFgBg,vimHiKeyError,vimNotation syn region vimHiKeyList contained oneline start="\i\+" skip="\\\\\|\\|" end="$\||" contains=@vimHiCluster if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_vimhikeyerror") syn match vimHiKeyError contained "\i\+="he=e-1 endif 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=vimHiNmbr,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\|sp\)="he=e-1 nextgroup=vimHiGroup,vimHiGuiFontname,vimHiGuiRgb,vimFgBgAttrib syn match vimHiTermcap contained "\S\+" contains=vimNotation syn match vimHiNmbr contained '\d\+' " Highlight: clear {{{2 syn keyword vimHiClear contained clear nextgroup=vimHiGroup " Highlight: link {{{2 syn region vimHiLink contained oneline matchgroup=vimCommand start="\(\\|\\)" end="$" contains=vimHiGroup,vimGroup,vimHLGroup,vimNotation syn cluster vimFuncBodyList add=vimHiLink " Control Characters {{{2 " ================== syn match vimCtrlChar "[- -]" " Beginners - Patterns that involve ^ {{{2 " ========= syn match vimLineComment +^[ \t:]*".*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle syn match vimCommentTitle '"\s*\%([sS]:\|\h\w*#\)\=\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 " Searches And Globals: {{{2 " ==================== syn match vimSearch '^\s*[/?].*' contains=vimSearchDelim syn match vimSearchDelim '^\s*\zs[/?]\|[/?]$' contained syn region vimGlobal matchgroup=Statement start='\:p:h")."/lua.vim") if !filereadable(s:luapath) for s:luapath in split(globpath(&rtp,"syntax/lua.vim"),"\n") if filereadable(fnameescape(s:luapath)) let s:luapath= fnameescape(s:luapath) break endif endfor endif if (g:vimsyn_embed =~# 'l' && has("lua")) && filereadable(s:luapath) unlet! b:current_syntax exe "syn include @vimLuaScript ".s:luapath VimFoldl syn region vimLuaRegion matchgroup=vimScriptDelim start=+lua\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimLuaScript VimFoldl syn region vimLuaRegion matchgroup=vimScriptDelim start=+lua\s*<<\s*$+ end=+\.$+ contains=@vimLuaScript syn cluster vimFuncBodyList add=vimLuaRegion else syn region vimEmbedError start=+lua\s*<<\s*\z(.*\)$+ end=+^\z1$+ syn region vimEmbedError start=+lua\s*<<\s*$+ end=+\.$+ endif unlet s:luapath " [-- perl --] {{{3 let s:perlpath= fnameescape(expand(":p:h")."/perl.vim") if !filereadable(s:perlpath) for s:perlpath in split(globpath(&rtp,"syntax/perl.vim"),"\n") if filereadable(fnameescape(s:perlpath)) let s:perlpath= fnameescape(s:perlpath) break endif endfor endif if (g:vimsyn_embed =~# 'p' && has("perl")) && filereadable(s:perlpath) unlet! b:current_syntax exe "syn include @vimPerlScript ".s:perlpath VimFoldp syn region vimPerlRegion matchgroup=vimScriptDelim start=+pe\%[rl]\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimPerlScript VimFoldp syn region vimPerlRegion matchgroup=vimScriptDelim start=+pe\%[rl]\s*<<\s*$+ end=+\.$+ contains=@vimPerlScript syn cluster vimFuncBodyList add=vimPerlRegion else syn region vimEmbedError start=+pe\%[rl]\s*<<\s*\z(.*\)$+ end=+^\z1$+ syn region vimEmbedError start=+pe\%[rl]\s*<<\s*$+ end=+\.$+ endif unlet s:perlpath " [-- ruby --] {{{3 let s:rubypath= fnameescape(expand(":p:h")."/ruby.vim") if !filereadable(s:rubypath) for s:rubypath in split(globpath(&rtp,"syntax/ruby.vim"),"\n") if filereadable(fnameescape(s:rubypath)) let s:rubypath= fnameescape(s:rubypath) break endif endfor endif if (g:vimsyn_embed =~# 'r' && has("ruby")) && filereadable(s:rubypath) unlet! b:current_syntax exe "syn include @vimRubyScript ".s:rubypath VimFoldr 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 syn cluster vimFuncBodyList add=vimRubyRegion else syn region vimEmbedError start=+rub[y]\s*<<\s*\z(.*\)$+ end=+^\z1$+ syn region vimEmbedError start=+rub[y]\s*<<\s*$+ end=+\.$+ endif unlet s:rubypath " [-- python --] {{{3 let s:pythonpath= fnameescape(expand(":p:h")."/python.vim") if !filereadable(s:pythonpath) for s:pythonpath in split(globpath(&rtp,"syntax/python.vim"),"\n") if filereadable(fnameescape(s:pythonpath)) let s:pythonpath= fnameescape(s:pythonpath) break endif endfor endif if g:vimsyn_embed =~# 'P' && (has("python") || has("python3")) && filereadable(s:pythonpath) unlet! b:current_syntax exe "syn include @vimPythonScript ".s:pythonpath VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+py\%[thon]3\=\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimPythonScript VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+py\%[thon]3\=\s*<<\s*$+ end=+\.$+ contains=@vimPythonScript VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+Py\%[thon]2or3\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimPythonScript VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+Py\%[thon]2or3\=\s*<<\s*$+ end=+\.$+ contains=@vimPythonScript syn cluster vimFuncBodyList add=vimPythonRegion else syn region vimEmbedError start=+py\%[thon]3\=\s*<<\s*\z(.*\)$+ end=+^\z1$+ syn region vimEmbedError start=+py\%[thon]3\=\s*<<\s*$+ end=+\.$+ endif unlet s:pythonpath " [-- tcl --] {{{3 if has("win32") || has("win95") || has("win64") || has("win16") " apparently has("tcl") has been hanging vim on some windows systems with cygwin let s:trytcl= (&shell !~ '\<\%(bash\>\|4[nN][tT]\|\\%(\.exe\)\=$') else let s:trytcl= 1 endif if s:trytcl let s:tclpath= fnameescape(expand(":p:h")."/tcl.vim") if !filereadable(s:tclpath) for s:tclpath in split(globpath(&rtp,"syntax/tcl.vim"),"\n") if filereadable(fnameescape(s:tclpath)) let s:tclpath= fnameescape(s:tclpath) break endif endfor endif if (g:vimsyn_embed =~# 't' && has("tcl")) && filereadable(s:tclpath) unlet! b:current_syntax exe "syn include @vimTclScript ".s:tclpath VimFoldt syn region vimTclRegion matchgroup=vimScriptDelim start=+tc[l]\=\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimTclScript VimFoldt syn region vimTclRegion matchgroup=vimScriptDelim start=+tc[l]\=\s*<<\s*$+ end=+\.$+ contains=@vimTclScript syn cluster vimFuncBodyList add=vimTclScript else syn region vimEmbedError start=+tc[l]\=\s*<<\s*\z(.*\)$+ end=+^\z1$+ syn region vimEmbedError start=+tc[l]\=\s*<<\s*$+ end=+\.$+ endif unlet s:tclpath else syn region vimEmbedError start=+tc[l]\=\s*<<\s*\z(.*\)$+ end=+^\z1$+ syn region vimEmbedError start=+tc[l]\=\s*<<\s*$+ end=+\.$+ endif unlet s:trytcl " [-- mzscheme --] {{{3 let s:mzschemepath= fnameescape(expand(":p:h")."/scheme.vim") if !filereadable(s:mzschemepath) for s:mzschemepath in split(globpath(&rtp,"syntax/mzscheme.vim"),"\n") if filereadable(fnameescape(s:mzschemepath)) let s:mzschemepath= fnameescape(s:mzschemepath) break endif endfor endif if (g:vimsyn_embed =~# 'm' && has("mzscheme")) && filereadable(s:mzschemepath) unlet! b:current_syntax let iskKeep= &isk exe "syn include @vimMzSchemeScript ".s:mzschemepath let &isk= iskKeep VimFoldm syn region vimMzSchemeRegion matchgroup=vimScriptDelim start=+mz\%[scheme]\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimMzSchemeScript VimFoldm syn region vimMzSchemeRegion matchgroup=vimScriptDelim start=+mz\%[scheme]\s*<<\s*$+ end=+\.$+ contains=@vimMzSchemeScript syn cluster vimFuncBodyList add=vimMzSchemeRegion else syn region vimEmbedError start=+mz\%[scheme]\s*<<\s*\z(.*\)$+ end=+^\z1$+ syn region vimEmbedError start=+mz\%[scheme]\s*<<\s*$+ end=+\.$+ endif unlet s:mzschemepath " Synchronize (speed) {{{2 "============ if exists("g:vimsyn_minlines") exe "syn sync minlines=".g:vimsyn_minlines endif if exists("g:vimsyn_maxlines") exe "syn sync maxlines=".g:vimsyn_maxlines else syn sync maxlines=60 endif syn sync linecont "^\s\+\\" syn sync match vimAugroupSyncA groupthere NONE "\\s\+[eE][nN][dD]" " ==================== " Highlighting Settings {{{2 " ==================== if !exists("g:vimsyn_noerror") hi def link vimBehaveError vimError hi def link vimCollClassErr vimError hi def link vimErrSetting vimError hi def link vimEmbedError vimError hi def link vimFTError vimError hi def link vimFunctionError vimError hi def link vimFunc vimError hi def link vimHiAttribList vimError hi def link vimHiCtermError vimError hi def link vimHiKeyError vimError hi def link vimKeyCodeError vimError hi def link vimMapModErr vimError hi def link vimSubstFlagErr vimError hi def link vimSynCaseError vimError hi def link vimBufnrWarn vimWarn endif hi def link vimAbb vimCommand hi def link vimAddress vimMark hi def link vimAugroupError vimError hi def link vimAugroupKey vimCommand hi def link vimAuHighlight vimHighlight hi def link vimAutoCmdOpt vimOption hi def link vimAutoCmd vimCommand hi def link vimAutoEvent Type hi def link vimAutoSet vimCommand hi def link vimBehaveModel vimBehave hi def link vimBehave vimCommand hi def link vimBracket Delimiter hi def link vimCmplxRepeat SpecialChar hi def link vimCommand Statement hi def link vimComment Comment hi def link vimCommentString vimString hi def link vimCommentTitle PreProc hi def link vimCondHL vimCommand hi def link vimContinue Special hi def link vimCtrlChar SpecialChar hi def link vimEchoHLNone vimGroup hi def link vimEchoHL vimCommand hi def link vimElseIfErr Error hi def link vimElseif vimCondHL hi def link vimEnvvar PreProc hi def link vimError Error hi def link vimFBVar vimVar hi def link vimFgBgAttrib vimHiAttrib hi def link vimFold Folded hi def link vimFTCmd vimCommand hi def link vimFTOption vimSynType hi def link vimFuncKey vimCommand hi def link vimFuncName Function hi def link vimFuncSID Special hi def link vimFuncVar Identifier hi def link vimGroupAdd vimSynOption hi def link vimGroupName vimGroup hi def link vimGroupRem vimSynOption hi def link vimGroupSpecial Special hi def link vimGroup Type hi def link vimHiAttrib PreProc hi def link vimHiClear vimHighlight 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 vimHiNmbr Number hi def link vimHiStartStop vimHiTerm hi def link vimHiTerm Type hi def link vimHLGroup vimGroup hi def link vimHLMod PreProc hi def link vimInsert vimString hi def link vimIskSep Delimiter hi def link vimKeyCode vimSpecFile hi def link vimKeyword Statement hi def link vimLet vimCommand hi def link vimLineComment vimComment hi def link vimMapBang vimCommand hi def link vimMapModKey vimFuncSID hi def link vimMapMod vimBracket hi def link vimMap vimCommand hi def link vimMark Number hi def link vimMarkNumber vimNumber hi def link vimMenuMod vimMapMod hi def link vimMenuNameMore vimMenuName hi def link vimMenuName PreProc hi def link vimMtchComment vimComment hi def link vimNorm vimCommand hi def link vimNotation Special hi def link vimNotFunc vimCommand hi def link vimNotPatSep vimString hi def link vimNumber Number hi def link vimOperError Error hi def link vimOper Operator hi def link vimOption PreProc hi def link vimParenSep Delimiter hi def link vimPatSepErr vimPatSep hi def link vimPatSepR vimPatSep hi def link vimPatSep SpecialChar hi def link vimPatSepZone vimString hi def link vimPatSepZ vimPatSep hi def link vimPattern Type hi def link vimPlainMark vimMark hi def link vimPlainRegister vimRegister hi def link vimRegister SpecialChar hi def link vimScriptDelim Comment hi def link vimSearchDelim Statement hi def link vimSearch vimString hi def link vimSep Delimiter hi def link vimSetMod vimOption hi def link vimSetSep Statement hi def link vimSetString vimString hi def link vimSpecFile Identifier hi def link vimSpecFileMod vimSpecFile hi def link vimSpecial Type hi def link vimStatement Statement hi def link vimStringCont vimString hi def link vimString String hi def link vimSubst1 vimSubst hi def link vimSubstDelim Delimiter hi def link vimSubstFlags Special hi def link vimSubstSubstr SpecialChar hi def link vimSubstTwoBS vimString hi def link vimSubst vimCommand hi def link vimSynCaseError Error hi def link vimSynCase Type hi def link vimSyncC Type hi def link vimSyncError Error hi def link vimSyncGroupName vimGroupName hi def link vimSyncGroup vimGroupName hi def link vimSyncKey Type hi def link vimSyncNone Type hi def link vimSynContains vimSynOption hi def link vimSynError Error 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 vimSynOption Special hi def link vimSynPatRange vimString hi def link vimSynRegOpt vimSynOption hi def link vimSynRegPat vimString hi def link vimSynReg Type hi def link vimSyntax vimCommand hi def link vimSynType vimSpecial hi def link vimTodo Todo hi def link vimUnmap vimMap hi def link vimUserAttrbCmpltFunc Special hi def link vimUserAttrbCmplt vimSpecial hi def link vimUserAttrbKey vimOption hi def link vimUserAttrb vimSpecial hi def link vimUserAttrbError Error hi def link vimUserCmdError Error hi def link vimUserCommand vimCommand hi def link vimUserFunc Normal hi def link vimVar Identifier hi def link vimWarn WarningMsg " Current Syntax Variable: {{{2 let b:current_syntax = "vim" " --------------------------------------------------------------------- " Cleanup: {{{1 delc VimFolda delc VimFoldf delc VimFoldl delc VimFoldm delc VimFoldp delc VimFoldP delc VimFoldr delc VimFoldt let &cpo = s:keepcpo unlet s:keepcpo " vim:ts=18 fdm=marker vim-7.4.1689/runtime/syntax/viminfo.vim000066400000000000000000000021441267703067000177730ustar00rootroot00000000000000" Vim syntax file " Language: Vim .viminfo file " Maintainer: Bram Moolenaar " Last Change: 2012 Feb 03 " Quit when a (custom) syntax file was already loaded if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim " 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. " Only used when an item doesn't have highlighting yet hi def link viminfoComment Comment hi def link viminfoError Error hi def link viminfoStatement Statement let b:current_syntax = "viminfo" let &cpo = s:cpo_save unlet s:cpo_save " vim: ts=8 sw=2 vim-7.4.1689/runtime/syntax/virata.vim000066400000000000000000000271421267703067000176170ustar00rootroot00000000000000" Vim syntax file " Language: Virata AConfig Configuration Script " Maintainer: Manuel M.H. Stol " 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 |Module from ) 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
|SLibrary ) 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 is syn region virataProcessDef transparent matchgroup=virataStatement start="^\s*Process\>" keepend end="$" contains=virataInProcess,virataInExec,virataNumberError,virataStringError,@virataGrpDefSubsts,@virataGrpIdents syn match virataInProcess contained "\" " Instance of syn region virataInstanceDef transparent matchgroup=virataStatement start="^\s*Instance\>" keepend end="$" contains=virataInInstance,virataNumberError,virataStringError,@virataGrpDefSubsts,@virataGrpIdents syn match virataInInstance contained "\" " Module from 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 "\" skipwhite nextgroup=@virataGrpFileIdents " Colour from 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 "\" skipwhite nextgroup=@virataGrpFileIdents " Link {} " Object {Executable []} syn match virataStatement "^\s*\(Link\|Object\)" " Executable [] 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 {} " MessageId syn match virataStatement "^\s*Message\(Id\)\=\>" skipwhite nextgroup=@virataGrpNumbers " MakeRule {} syn region virataMakeDef transparent matchgroup=virataStatement start="^\s*MakeRule\>" keepend end="$" contains=virataInMake,@virataGrpDefSubsts syn case match syn match virataInMake contained "\" syn case ignore " (Append|Edit|Copy)Rule syn match virataStatement "^\s*\(Append\|Copy\|Edit\)Rule\>" " AlterRules in syn region virataAlterDef transparent matchgroup=virataStatement start="^\s*AlterRules\>" keepend end="$" contains=virataInAlter,@virataGrpDefSubsts syn match virataInAlter contained "\" 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 else command -nargs=+ HiLink hi def link 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: vim-7.4.1689/runtime/syntax/vmasm.vim000066400000000000000000000212731267703067000174530ustar00rootroot00000000000000" Vim syntax file " Language: (VAX) Macro Assembly " Maintainer: Tom Uijldert " 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 "\" syn match vmasmOpcode "\" syn match vmasmOpcode "\" syn match vmasmOpcode "\" syn match vmasmOpcode "\" syn match vmasmOpcode "\" syn match vmasmOpcode "\" syn match vmasmOpcode "\" syn match vmasmOpcode "\" syn match vmasmOpcode "\" syn match vmasmOpcode "\" syn match vmasmOpcode "\" syn match vmasmOpcode "\" syn match vmasmOpcode "\" syn match vmasmOpcode "\" syn match vmasmOpcode "\" syn match vmasmOpcode "\" syn match vmasmOpcode "\" syn match vmasmOpcode "\" syn match vmasmOpcode "\" syn match vmasmOpcode "\" syn match vmasmOpcode "\" syn match vmasmOpcode "\" syn match vmasmOpcode "\" syn match vmasmOpcode "\" syn match vmasmOpcode "\" syn match vmasmOpcode "\" syn match vmasmOpcode "\" syn match vmasmOpcode "\" syn match vmasmOpcode "\" " 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 " ("^...") " 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 "\" syn match vmasmOperator "\" syn match vmasmOperator "\" syn match vmasmOperator "\<\(not_\)\=defined\>" syn match vmasmOperator "\<\(not_\)\=blank\>" syn match vmasmOperator "\" syn match vmasmOperator "\" syn match vmasmOperator "\" syn match vmasmOperator "\<[gl]t\>" syn match vmasmOperator "\" syn match vmasmOperator "\" syn match vmasmOperator "\" syn match vmasmOperator "\<[nlg]e\>" syn match vmasmOperator "\" " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/voscm.vim000066400000000000000000000154771267703067000174700ustar00rootroot00000000000000" Vim syntax file " Language: VOS CM macro " Maintainer: Andrew McGill andrewm at lunch.za.net " Last Change: Apr 06, 2007 " Version: 1 " URL: http://lunch.za.net/ " " For version 5.x: Clear all syntax items " For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax") finish endif syn case match " set iskeyword=48-57,_,a-z,A-Z syn match voscmStatement "^!" syn match voscmStatement "&\(label\|begin_parameters\|end_parameters\|goto\|attach_input\|break\|continue\|control\|detach_input\|display_line\|display_line_partial\|echo\|eof\|eval\|if\|mode\|return\|while\|set\|set_string\|then\|else\|do\|done\|end\)\>" syn match voscmJump "\(&label\|&goto\) *" nextgroup=voscmLabelId syn match voscmLabelId contained "\<[A-Za-z][A-Z_a-z0-9]* *$" syn match voscmSetvar "\(&set_string\|&set\) *" nextgroup=voscmVariable syn match voscmError "\(&set_string\|&set\) *&" syn match voscmVariable contained "\<[A-Za-z][A-Z_a-z0-9]\+\>" syn keyword voscmParamKeyword contained number req string switch allow byte disable_input hidden length longword max min no_abbrev output_path req required req_for_form word syn region voscmParamList matchgroup=voscmParam start="&begin_parameters" end="&end_parameters" contains=voscmParamKeyword,voscmString,voscmParamName,voscmParamId syn match voscmParamName contained "\(^\s*[A-Za-z_0-9]\+\s\+\)\@<=\k\+" syn match voscmParamId contained "\(^\s*\)\@<=\k\+" syn region par1 matchgroup=par1 start=/(/ end=/)/ contains=voscmFunction,voscmIdentifier,voscmString transparent " FIXME: functions should only be allowed after a bracket ... ie (ask ...): syn keyword voscmFunction contained abs access after ask before break byte calc ceil command_status concat syn keyword voscmFunction contained contents path_name copy count current_dir current_module date date_time syn keyword voscmFunction contained decimal directory_name end_of_file exists file_info floor given group_name syn keyword voscmFunction contained has_access hexadecimal home_dir index iso_date iso_date_time language_name syn keyword voscmFunction contained length lock_type locked ltrim master_disk max message min mod module_info syn keyword voscmFunction contained module_name object_name online path_name person_name process_dir process_info syn keyword voscmFunction contained process_type quote rank referencing_dir reverse rtrim search syn keyword voscmFunction contained software_purchased string substitute substr system_name terminal_info syn keyword voscmFunction contained terminal_name time translate trunc unique_string unquote user_name verify syn keyword voscmFunction contained where_path syn keyword voscmTodo contained TODO FIXME XXX DEBUG NOTE syn match voscmTab "\t\+" syn keyword voscmCommand add_entry_names add_library_path add_profile analyze_pc_samples attach_default_output attach_port batch bind break_process c c_preprocess call_thru cancel_batch_requests cancel_device_reservation cancel_print_requests cc change_current_dir check_posix cobol comment_on_manual compare_dirs compare_files convert_text_file copy_dir copy_file copy_tape cpp create_data_object create_deleted_record_index create_dir create_file create_index create_record_index create_tape_volumes cvt_fixed_to_stream cvt_stream_to_fixed debug delete_dir delete_file delete_index delete_library_path detach_default_output detach_port dismount_tape display display_access display_access_list display_batch_status display_current_dir display_current_module display_date_time display_default_access_list display_device_info display_dir_status display_disk_info display_disk_usage display_error display_file display_file_status display_line display_notices display_object_module_info display_print_defaults display_print_status display_program_module display_system_usage display_tape_params display_terminal_parameters dump_file dump_record dump_tape edit edit_form emacs enforce_region_locks fortran get_external_variable give_access give_default_access handle_sig_dfl harvest_pc_samples help kill line_edit link link_dirs list list_batch_requests list_devices list_gateways list_library_paths list_modules list_port_attachments list_print_requests list_process_cmd_limits list_save_tape list_systems list_tape list_terminal_types list_users locate_files locate_large_files login logout mount_tape move_device_reservation move_dir move_file mp_debug nls_edit_form pascal pl1 position_tape preprocess_file print profile propagate_access read_tape ready remove_access remove_default_access rename reserve_device restore_object save_object send_message set set_cpu_time_limit set_expiration_date set_external_variable set_file_allocation set_implicit_locking set_index_flags set_language set_library_paths set_line_wrap_width set_log_protected_file set_owner_access set_pipe_file set_priority set_ready set_safety_switch set_second_tape set_tape_drive_params set_tape_file_params set_tape_mount_params set_terminal_parameters set_text_file set_time_zone sleep sort start_logging start_process stop_logging stop_process tail_file text_data_merge translate_links truncate_file unlink update_batch_requests update_print_requests update_process_cmd_limits use_abbreviations use_message_file vcc verify_posix_access verify_save verify_system_access walk_dir where_command where_path who_locked write_tape syn match voscmIdentifier "&[A-Za-z][a-z0-9_A-Z]*&" syn match voscmString "'[^']*'" " Number formats syn match voscmNumber "\<\d\+\>" "Floating point number part only syn match voscmDecimalNumber "\.\d\+\([eE][-+]\=\d\)\=\>" "syn region voscmComment start="^[ ]*&[ ]+" end="$" "syn match voscmComment "^[ ]*&[ ].*$" "syn match voscmComment "^&$" syn region voscmComment start="^[ ]*&[ ]" end="$" contains=voscmTodo syn match voscmComment "^&$" syn match voscmContinuation "&+$" "syn match voscmIdentifier "[A-Za-z0-9&._-]\+" "Synchronization with Statement terminator $ " syn sync maxlines=100 hi def link voscmConditional Conditional hi def link voscmStatement Statement hi def link voscmSetvar Statement hi def link voscmNumber Number hi def link voscmDecimalNumber Float hi def link voscmString String hi def link voscmIdentifier Identifier hi def link voscmVariable Identifier hi def link voscmComment Comment hi def link voscmJump Statement hi def link voscmContinuation Macro hi def link voscmLabelId String hi def link voscmParamList NONE hi def link voscmParamId Identifier hi def link voscmParamName String hi def link voscmParam Statement hi def link voscmParamKeyword Statement hi def link voscmFunction Function hi def link voscmCommand Structure "hi def link voscmIdentifier NONE "hi def link voscmSpecial Special " not used hi def link voscmTodo Todo hi def link voscmTab Error hi def link voscmError Error let b:current_syntax = "voscm" " vim: ts=8 vim-7.4.1689/runtime/syntax/vrml.vim000066400000000000000000000316411267703067000173100ustar00rootroot00000000000000" Vim syntax file " Language: VRML97 " Modified from: VRML 1.0C by David Brown " Maintainer: vacancy! " Former Maintainer: Gregory Seidman " Last change: 2006 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 " 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\)*\(#.*$\)*\\(#.*$\)*\(,\|\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 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="\\(,\|\s\)*[A-Za-z_]"ms=e start="\\(,\|\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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/vroom.vim000066400000000000000000000070211267703067000174650ustar00rootroot00000000000000" Vim syntax file " Language: Vroom (vim testing and executable documentation) " Maintainer: David Barnett (https://github.com/google/vim-ft-vroom) " Last Change: 2014 Jul 23 " For version 5.x: Clear all syntax items. " For version 6.x and later: Quit when a syntax file was already loaded. if v:version < 600 syntax clear elseif exists('b:current_syntax') finish endif let s:cpo_save = &cpo set cpo-=C syn include @vroomVim syntax/vim.vim syn include @vroomShell syntax/sh.vim syntax region vroomAction \ matchgroup=vroomOutput \ start='\m^ ' end='\m$' keepend \ contains=vroomControlBlock syntax region vroomAction \ matchgroup=vroomOutput \ start='\m^ & ' end='\m$' keepend \ contains=vroomControlBlock syntax match vroomOutput '\m^ &$' syntax region vroomMessageBody \ matchgroup=vroomMessage \ start='\m^ \~ ' end='\m$' keepend \ contains=vroomControlBlock syntax region vroomColoredAction \ matchgroup=vroomInput \ start='\m^ > ' end='\m$' keepend \ contains=vimNotation,vroomControlBlock syntax region vroomAction \ matchgroup=vroomInput \ start='\m^ % ' end='\m$' keepend \ contains=vimNotation,vroomControlBlock syntax region vroomAction \ matchgroup=vroomContinuation \ start='\m^ |' end='\m$' keepend syntax region vroomAction \ start='\m^ \ze:' end='\m$' keepend \ contains=@vroomVim,vroomControlBlock syntax region vroomAction \ matchgroup=vroomDirective \ start='\m^ @\i\+' end='\m$' keepend \ contains=vroomControlBlock syntax region vroomSystemAction \ matchgroup=vroomSystem \ start='\m^ ! ' end='\m$' keepend \ contains=@vroomShell,vroomControlBlock syntax region vroomHijackAction \ matchgroup=vroomHijack \ start='\m^ \$ ' end='\m$' keepend \ contains=vroomControlBlock syntax match vroomControlBlock contains=vroomControlEscape,@vroomControls \ '\v \([^&()][^()]*\)$' syntax match vroomControlEscape '\m&' contained syntax cluster vroomControls \ contains=vroomDelay,vroomMode,vroomBuffer,vroomRange \,vroomChannel,vroomBind,vroomStrictness syntax match vroomRange '\v\.(,\+?(\d+|\$)?)?' contained syntax match vroomRange '\v\d*,\+?(\d+|\$)?' contained syntax match vroomBuffer '\v\d+,@!' contained syntax match vroomDelay '\v\d+(\.\d+)?s' contained syntax match vroomMode '\v<%(regex|glob|verbatim)' contained syntax match vroomChannel '\v<%(stderr|stdout|command|status)>' contained syntax match vroomBind '\v' contained syntax match vroomStrictness '\v\<%(STRICT|RELAXED|GUESS-ERRORS)\>' contained highlight default link vroomInput Identifier highlight default link vroomDirective vroomInput highlight default link vroomControlBlock vroomInput highlight default link vroomSystem vroomInput highlight default link vroomOutput Statement highlight default link vroomContinuation Constant highlight default link vroomHijack Special highlight default link vroomColoredAction Statement highlight default link vroomSystemAction vroomSystem highlight default link vroomHijackAction vroomHijack highlight default link vroomMessage vroomOutput highlight default link vroomMessageBody Constant highlight default link vroomControlEscape Special highlight default link vroomBuffer vroomInput highlight default link vroomRange Include highlight default link vroomMode Constant highlight default link vroomDelay Type highlight default link vroomStrictness vroomMode highlight default link vroomChannel vroomMode highlight default link vroomBind vroomMode let b:current_syntax = 'vroom' let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/vsejcl.vim000066400000000000000000000025611267703067000176150ustar00rootroot00000000000000" Vim syntax file " Language: JCL job control language - DOS/VSE " Maintainer: Davyd Ondrejko " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/wdiff.vim000066400000000000000000000021771267703067000174310ustar00rootroot00000000000000" Vim syntax file " Language: wDiff (wordwise diff) " Maintainer: Gerfried Fuchs " 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 else command -nargs=+ HiLink hi def link endif HiLink wdiffOld Special HiLink wdiffNew Identifier delcommand HiLink endif let b:current_syntax = "wdiff" vim-7.4.1689/runtime/syntax/web.vim000066400000000000000000000023671267703067000171100ustar00rootroot00000000000000" Vim syntax file " Language: WEB " Maintainer: Andreas Scherer " 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 :p:h/cweb.vim else runtime! syntax/cweb.vim unlet b:current_syntax endif " Replace C/C++ syntax by Pascal syntax. syntax include @webIncludedC :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 vim-7.4.1689/runtime/syntax/webmacro.vim000066400000000000000000000066171267703067000201340ustar00rootroot00000000000000" WebMacro syntax file " Language: WebMacro " Maintainer: Claudio Fleiner " 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 :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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/wget.vim000066400000000000000000000075711267703067000173030ustar00rootroot00000000000000" Vim syntax file " Language: Wget configuration file (/etc/wgetrc ~/.wgetrc) " Maintainer: Doug Kearns " Last Change: 2013 Jun 1 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn match wgetComment "#.*$" contains=wgetTodo contained syn keyword wgetTodo TODO NOTE FIXME XXX contained syn region wgetString start=+"+ skip=+\\\\\|\\"+ end=+"+ contained oneline syn region wgetString start=+'+ skip=+\\\\\|\\'+ end=+'+ contained oneline syn case ignore syn keyword wgetBoolean on off contained syn keyword wgetNumber inf contained syn case match syn match wgetNumber "\<\%(\d\+\|inf\)\>" contained syn match wgetQuota "\<\d\+[kKmM]\>" contained syn match wgetTime "\<\d\+[smhdw]\>" contained "{{{ Commands let s:commands = map([ \ "accept", \ "add_hostdir", \ "adjust_extension", \ "always_rest", \ "ask_password", \ "auth_no_challenge", \ "background", \ "backup_converted", \ "backups", \ "base", \ "bind_address", \ "ca_certificate", \ "ca_directory", \ "cache", \ "certificate", \ "certificate_type", \ "check_certificate", \ "connect_timeout", \ "content_disposition", \ "continue", \ "convert_links", \ "cookies", \ "cut_dirs", \ "debug", \ "default_page", \ "delete_after", \ "dns_cache", \ "dns_timeout", \ "dir_prefix", \ "dir_struct", \ "domains", \ "dot_bytes", \ "dots_in_line", \ "dot_spacing", \ "dot_style", \ "egd_file", \ "exclude_directories", \ "exclude_domains", \ "follow_ftp", \ "follow_tags", \ "force_html", \ "ftp_passwd", \ "ftp_password", \ "ftp_user", \ "ftp_proxy", \ "glob", \ "header", \ "html_extension", \ "htmlify", \ "http_keep_alive", \ "http_passwd", \ "http_password", \ "http_proxy", \ "https_proxy", \ "http_user", \ "ignore_case", \ "ignore_length", \ "ignore_tags", \ "include_directories", \ "inet4_only", \ "inet6_only", \ "input", \ "iri", \ "keep_session_cookies", \ "kill_longer", \ "limit_rate", \ "load_cookies", \ "locale", \ "local_encoding", \ "logfile", \ "login", \ "max_redirect", \ "mirror", \ "netrc", \ "no_clobber", \ "no_parent", \ "no_proxy", \ "numtries", \ "output_document", \ "page_requisites", \ "passive_ftp", \ "passwd", \ "password", \ "post_data", \ "post_file", \ "prefer_family", \ "preserve_permissions", \ "private_key", \ "private_key_type", \ "progress", \ "protocol_directories", \ "proxy_passwd", \ "proxy_password", \ "proxy_user", \ "quiet", \ "quota", \ "random_file", \ "random_wait", \ "read_timeout", \ "reclevel", \ "recursive", \ "referer", \ "reject", \ "relative_only", \ "remote_encoding", \ "remove_listing", \ "restrict_file_names", \ "retr_symlinks", \ "retry_connrefused", \ "robots", \ "save_cookies", \ "save_headers", \ "secure_protocol", \ "server_response", \ "show_all_dns_entries", \ "simple_host_check", \ "span_hosts", \ "spider", \ "strict_comments", \ "sslcertfile", \ "sslcertkey", \ "timeout", \ "time_stamping", \ "use_server_timestamps", \ "tries", \ "trust_server_names", \ "user", \ "use_proxy", \ "user_agent", \ "verbose", \ "wait", \ "wait_retry"], \ "substitute(v:val, '_', '[-_]\\\\=', 'g')") "}}} syn case ignore for cmd in s:commands exe 'syn match wgetCommand "' . cmd . '" nextgroup=wgetAssignmentOperator skipwhite contained' endfor syn case match syn match wgetStart "^" nextgroup=wgetCommand,wgetComment skipwhite syn match wgetAssignmentOperator "=" nextgroup=wgetString,wgetBoolean,wgetNumber,wgetQuota,wgetTime skipwhite contained hi def link wgetAssignmentOperator Special hi def link wgetBoolean Boolean hi def link wgetCommand Identifier hi def link wgetComment Comment hi def link wgetNumber Number hi def link wgetQuota Number hi def link wgetString String hi def link wgetTodo Todo let b:current_syntax = "wget" let &cpo = s:cpo_save unlet s:cpo_save " vim: ts=8 fdm=marker: vim-7.4.1689/runtime/syntax/whitespace.vim000066400000000000000000000005451267703067000204630ustar00rootroot00000000000000" 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 vim-7.4.1689/runtime/syntax/winbatch.vim000066400000000000000000000304041267703067000201230ustar00rootroot00000000000000" 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/wml.vim000066400000000000000000000141721267703067000171270ustar00rootroot00000000000000" Vim syntax file " Language: WML - Website MetaLanguage " Maintainer: Gerfried Fuchs " Filenames: *.wml " Last Change: 07 Feb 2002 " URL: http://alfie.ist.org/software/vim/syntax/wml.vim " " Original Version: Craig Small " 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 :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 :p:h/perl.vim else syn include @wmlPerlScript syntax/perl.vim endif unlet b:current_syntax syn region perlScript start=++ keepend end=++ contains=@wmlPerlScript,wmlPerlTag " eperl between '<:' and ':>' -- Alfie [1999-12-26] syn region perlScript start=+<:+ keepend end=+:>+ contains=@wmlPerlScript,wmlPerlTag syn match wmlPerlTag contained "" 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=++ keepend end=++ contains=wmlVerbatimTag syn match wmlVerbatimTag contained "" 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 "" 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 else command -nargs=+ HiLink hi def link 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" vim-7.4.1689/runtime/syntax/wsh.vim000066400000000000000000000023321267703067000171240ustar00rootroot00000000000000" Vim syntax file " Language: Windows Scripting Host " Maintainer: Paul Moore " 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 :p:h/vb.vim unlet b:current_syntax syn include @wshJavaScript :p:h/javascript.vim unlet b:current_syntax syn region wshVBScript \ matchgroup=xmlTag start="]*VBScript\(>\|[^>]*[^/>]>\)" \ matchgroup=xmlEndTag end="" \ fold \ contains=@wshVBScript \ keepend syn region wshJavaScript \ matchgroup=xmlTag start="]*J\(ava\)\=Script\(>\|[^>]*[^/>]>\)" \ matchgroup=xmlEndTag end="" \ 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 vim-7.4.1689/runtime/syntax/wsml.vim000066400000000000000000000131351267703067000173100ustar00rootroot00000000000000" Vim syntax file " Language: WSML " Maintainer: Thomas Haselwanter " URL: none " Last Change: 2006 Apr 30 " Quit when a syntax file was already loaded if version < 600 syntax clear elseif exists("b:current_syntax") finish endif " WSML syn keyword wsmlHeader wsmlVariant syn keyword wsmlNamespace namespace syn keyword wsmlTopLevel concept instance relationInstance ofType usesMediator usesService relation sharedVariables importsOntology syn keyword wsmlOntology hasValue memberOf ofType impliesType subConceptOf syn keyword wsmlAxiom axiom definedBy syn keyword wsmlService assumption effect postcondition precondition capability interface syn keyword wsmlTopLevel ooMediator wwMediator wgMediator ggMediator syn keyword wsmlMediation usesService source target syn match wsmlDataTypes "\( _string\| _decimal\| _integer\| _float\| _double\| _iri\| _sqname\| _boolean\| _duration\| _dateTime\| _time\| _date\| _gyearmonth\| _gyear\| _gmonthday\| _gday\| _gmonth\| _hexbinary\| _base64binary\)\((\S*)\)\?" contains=wsmlString,wsmlNumber,wsmlCharacter syn keyword wsmlTopLevel goal webService ontology syn keyword wsmlKeywordsInsideLEs true false memberOf hasValue subConceptOf ofType impliesType and or implies impliedBy equivalent neg naf forall exists syn keyword wsmlNFP nfp endnfp nonFunctionalProperties endNonFunctionalProperties syn region wsmlNFPregion start="nfp\|nonFunctionalProperties" end="endnfp\|endNonFunctionalProperties" contains=ALL syn region wsmlNamespace start="namespace" end="}" contains=wsmlIdentifier syn match wsmlOperator "!=\|:=:\|=<\|>=\|=\|+\|\*\|/\|<->\|->\|<-\|:-\|!-\|-\|<\|>" syn match wsmlBrace "(\|)\|\[\|\]\|{\|}" syn match wsmlIdentifier +_"\S*"+ syn match wsmlIdentifier "_#\d*" syn match wsmlSqName "[0-9A-Za-z]\+#[0-9A-Za-z]\+" syn match wsmlVariable "?[0-9A-Za-z]\+" " ASM-specific code syn keyword wsmlBehavioral choreography orchestration transitionRules syn keyword wsmlChoreographyPri stateSignature in out shared static controlled syn keyword wsmlChoreographySec with do withGrounding forall endForall choose if then endIf syn match wsmlChoreographyTer "\(\s\|\_^\)\(add\|delete\|update\)\s*(.*)" contains=wsmlKeywordsInsideLEs,wsmlIdentifier,wsmlSqName,wsmlString,wsmlNumber,wsmlDataTypes,wsmlVariable " Comments syn keyword wsmlTodo contained TODO syn keyword wsmlFixMe contained FIXME if exists("wsml_comment_strings") syn region wsmlCommentString contained start=+"+ end=+"+ end=+$+ end=+\*/+me=s-1,he=s-1 contains=wsmlSpecial,wsmlCommentStar,wsmlSpecialChar,@Spell syn region wsmlComment2String contained start=+"+ end=+$\|"+ contains=wsmlSpecial,wsmlSpecialChar,@Spell syn match wsmlCommentCharacter contained "'\\[^']\{1,6\}'" contains=wsmlSpecialChar syn match wsmlCommentCharacter contained "'\\''" contains=wsmlSpecialChar syn match wsmlCommentCharacter contained "'[^\\]'" syn cluster wsmlCommentSpecial add=wsmlCommentString,wsmlCommentCharacter,wsmlNumber syn cluster wsmlCommentSpecial2 add=wsmlComment2String,wsmlCommentCharacter,wsmlNumber endif syn region wsmlComment start="/\*" end="\*/" contains=@wsmlCommentSpecial,wsmlTodo,wsmlFixMe,@Spell syn match wsmlCommentStar contained "^\s*\*[^/]"me=e-1 syn match wsmlCommentStar contained "^\s*\*$" syn match wsmlLineComment "//.*" contains=@wsmlCommentSpecial2,wsmlTodo,@Spell syn cluster wsmlTop add=wsmlComment,wsmlLineComment "match the special comment /**/ syn match wsmlComment "/\*\*/" " Strings syn region wsmlString start=+"+ end=+"+ contains=wsmlSpecialChar,wsmlSpecialError,@Spell syn match wsmlCharacter "'[^']*'" contains=javaSpecialChar,javaSpecialCharError syn match wsmlCharacter "'\\''" contains=javaSpecialChar syn match wsmlCharacter "'[^\\]'" syn match wsmlNumber "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>" syn match wsmlNumber "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\=" syn match wsmlNumber "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>" syn match wsmlNumber "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>" " unicode characters syn match wsmlSpecial "\\u\d\{4\}" syn cluster wsmlTop add=wsmlString,wsmlCharacter,wsmlNumber,wsmlSpecial,wsmlStringError " Define the default highlighting. " " For version 5.7 and earlier: only when not done already " " For version 5.8 and later: only when an item doesn't have highlighting yet if version >= 508 || !exists("did_wsml_syn_inits") if version < 508 let did_wsml_syn_inits = 1 command -nargs=+ HiLink hi link else command -nargs=+ HiLink hi def link endif HiLink wsmlHeader TypeDef HiLink wsmlNamespace TypeDef HiLink wsmlOntology Statement HiLink wsmlAxiom TypeDef HiLink wsmlService TypeDef HiLink wsmlNFP TypeDef HiLink wsmlTopLevel TypeDef HiLink wsmlMediation TypeDef HiLink wsmlBehavioral TypeDef HiLink wsmlChoreographyPri TypeDef HiLink wsmlChoreographySec Operator HiLink wsmlChoreographyTer Special HiLink wsmlString String HiLink wsmlIdentifier Normal HiLink wsmlSqName Normal HiLink wsmlVariable Define HiLink wsmlKeywordsInsideLEs Operator HiLink wsmlOperator Operator HiLink wsmlBrace Operator HiLink wsmlCharacter Character HiLink wsmlNumber Number HiLink wsmlDataTypes Special HiLink wsmlComment Comment HiLink wsmlDocComment Comment HiLink wsmlLineComment Comment HiLink wsmlTodo Todo HiLink wsmlFixMe Error HiLink wsmlCommentTitle SpecialComment HiLink wsmlCommentStar wsmlComment endif delcommand HiLink let b:current_syntax = "wsml" let b:spell_options="contained" vim-7.4.1689/runtime/syntax/wvdial.vim000066400000000000000000000021051267703067000176070ustar00rootroot00000000000000" Vim syntax file " Language: Configuration file for WvDial " Maintainer: Prahlad Vaidyanathan " 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 vim-7.4.1689/runtime/syntax/xbl.vim000066400000000000000000000010701267703067000171060ustar00rootroot00000000000000" Vim syntax file " Language: XBL 1.0 " Maintainer: Doug Kearns " Latest Revision: 2007 November 5 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim runtime! syntax/xml.vim unlet b:current_syntax syn include @javascriptTop syntax/javascript.vim unlet b:current_syntax syn region xblJavascript \ matchgroup=xmlCdataStart start=++ \ contains=@javascriptTop keepend extend let b:current_syntax = "xbl" let &cpo = s:cpo_save unlet s:cpo_save " vim: ts=8 vim-7.4.1689/runtime/syntax/xdefaults.vim000066400000000000000000000141651267703067000203310ustar00rootroot00000000000000" Vim syntax file " Language: X resources files like ~/.Xdefaults (xrdb) " Maintainer: Johannes Zellner " Author and previous maintainer: " Gautam H. Mudunuri " Last Change: Di, 09 Mai 2006 23:10:23 CEST " $Id: xdefaults.vim,v 1.2 2007/05/05 17:19:40 vimboss Exp $ " " 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,@Spell " 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,@Spell 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,xdefaultsCppOut,xdefaultsCppOut2,xdefaultsCppSkip syn region xdefaultsDefine start="^\s*#\s*\(define\|undef\)\>" skip="\\$" end="$" contains=ALLBUT,@xdefaultsPreProcGroup,xdefaultsCommentH,xdefaultsErrorLine,xdefaultsLabel,xdefaultsValue syn region xdefaultsPreProc start="^\s*#\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@xdefaultsPreProcGroup,xdefaultsCommentH,xdefaultsErrorLine,xdefaultsLabel,xdefaultsValue " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/xf86conf.vim000066400000000000000000000351151267703067000177710ustar00rootroot00000000000000" Vim syntax file " This is a GENERATED FILE. Please always refer to source file at the URI below. " Language: XF86Config (XFree86 configuration file) " Former Maintainer: David Ne\v{c}as (Yeti) " Last Change: 2010 Nov 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(":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\|Extensions\|Vendor\|Keyboard\|Pointer\|InputClass\)\"" 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 contained else command -nargs=+ Xf86confdeclopt syn keyword xf86confOptionName 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\|Extensions\|Vendor\|Keyboard\|Pointer\|InputClass\)\"" 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" vim-7.4.1689/runtime/syntax/xhtml.vim000066400000000000000000000002721267703067000174600ustar00rootroot00000000000000" 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 vim-7.4.1689/runtime/syntax/xinetd.vim000066400000000000000000000335641267703067000176310ustar00rootroot00000000000000" Vim syntax file " Language: xinetd.conf(5) configuration file " Maintainer: Nikolai Weibull " Latest Revision: 2006-04-19 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn keyword xinetdTodo contained TODO FIXME XXX NOTE syn region xinetdComment display oneline start='^\s*#' end='$' \ contains=xinetdTodo,@Spell syn match xinetdService '^\s*service\>' \ nextgroup=xinetdServiceName skipwhite syn match xinetdServiceName contained '\S\+' \ nextgroup=xinetdServiceGroup skipwhite skipnl syn match xinetdDefaults '^\s*defaults' \ nextgroup=xinetdServiceGroup skipwhite skipnl syn region xinetdServiceGroup contained transparent \ matchgroup=xinetdServiceGroupD start='{' \ matchgroup=xinetdServiceGroupD end='}' \ contains=xinetdAttribute,xinetdReqAttribute, \ xinetdDisable syn keyword xinetdReqAttribute contained user server protocol \ nextgroup=xinetdStringEq skipwhite syn keyword xinetdAttribute contained id group bind \ interface \ nextgroup=xinetdStringEq skipwhite syn match xinetdStringEq contained display '=' \ nextgroup=xinetdString skipwhite syn match xinetdString contained display '\S\+' syn keyword xinetdAttribute contained type nextgroup=xinetdTypeEq skipwhite syn match xinetdTypeEq contained display '=' \ nextgroup=xinetdType skipwhite syn keyword xinetdType contained RPC INTERNAL TCPMUX TCPMUXPLUS \ UNLISTED \ nextgroup=xinetdType skipwhite syn keyword xinetdAttribute contained flags \ nextgroup=xinetdFlagsEq skipwhite syn cluster xinetdFlagsC contains=xinetdFlags,xinetdDeprFlags syn match xinetdFlagsEq contained display '=' \ nextgroup=@xinetdFlagsC skipwhite syn keyword xinetdFlags contained INTERCEPT NORETRY IDONLY NAMEINARGS \ NODELAY KEEPALIVE NOLIBWRAP SENSOR IPv4 IPv6 \ nextgroup=@xinetdFlagsC skipwhite syn keyword xinetdDeprFlags contained REUSE nextgroup=xinetdFlagsC skipwhite syn keyword xinetdDisable contained disable \ nextgroup=xinetdBooleanEq skipwhite syn match xinetdBooleanEq contained display '=' \ nextgroup=xinetdBoolean skipwhite syn keyword xinetdBoolean contained yes no syn keyword xinetdReqAttribute contained socket_type \ nextgroup=xinetdSocketTypeEq skipwhite syn match xinetdSocketTypeEq contained display '=' \ nextgroup=xinetdSocketType skipwhite syn keyword xinetdSocketType contained stream dgram raw seqpacket syn keyword xinetdReqAttribute contained wait \ nextgroup=xinetdBooleanEq skipwhite syn keyword xinetdAttribute contained groups mdns \ nextgroup=xinetdBooleanEq skipwhite syn keyword xinetdAttribute contained instances per_source rlimit_cpu \ rlimit_data rlimit_rss rlimit_stack \ nextgroup=xinetdUNumberEq skipwhite syn match xinetdUNumberEq contained display '=' \ nextgroup=xinetdUnlimited,xinetdNumber \ skipwhite syn keyword xinetdUnlimited contained UNLIMITED syn match xinetdNumber contained display '\<\d\+\>' syn keyword xinetdAttribute contained nice \ nextgroup=xinetdSignedNumEq skipwhite syn match xinetdSignedNumEq contained display '=' \ nextgroup=xinetdSignedNumber skipwhite syn match xinetdSignedNumber contained display '[+-]\=\d\+\>' syn keyword xinetdAttribute contained server_args \ enabled \ nextgroup=xinetdStringsEq skipwhite syn match xinetdStringsEq contained display '=' \ nextgroup=xinetdStrings skipwhite syn match xinetdStrings contained display '\S\+' \ nextgroup=xinetdStrings skipwhite syn keyword xinetdAttribute contained only_from no_access passenv \ nextgroup=xinetdStringsAdvEq skipwhite syn match xinetdStringsAdvEq contained display '[+-]\==' \ nextgroup=xinetdStrings skipwhite syn keyword xinetdAttribute contained access_times \ nextgroup=xinetdTimeRangesEq skipwhite syn match xinetdTimeRangesEq contained display '=' \ nextgroup=xinetdTimeRanges skipwhite syn match xinetdTimeRanges contained display \ '\%(0?\d\|1\d\|2[0-3]\):\%(0?\d\|[1-5]\d\)-\%(0?\d\|1\d\|2[0-3]\):\%(0?\d\|[1-5]\d\)' \ nextgroup=xinetdTimeRanges skipwhite syn keyword xinetdAttribute contained log_type nextgroup=xinetdLogTypeEq \ skipwhite syn match xinetdLogTypeEq contained display '=' \ nextgroup=xinetdLogType skipwhite syn keyword xinetdLogType contained SYSLOG nextgroup=xinetdSyslogType \ skipwhite syn keyword xinetdLogType contained FILE nextgroup=xinetdLogFile skipwhite syn keyword xinetdSyslogType contained daemon auth authpriv user mail lpr \ news uucp ftp local0 local1 local2 local3 \ local4 local5 local6 local7 \ nextgroup=xinetdSyslogLevel skipwhite syn keyword xinetdSyslogLevel contained emerg alert crit err warning notice \ info debug syn match xinetdLogFile contained display '\S\+' \ nextgroup=xinetdLogSoftLimit skipwhite syn match xinetdLogSoftLimit contained display '\<\d\+\>' \ nextgroup=xinetdLogHardLimit skipwhite syn match xinetdLogHardLimit contained display '\<\d\+\>' syn keyword xinetdAttribute contained log_on_success \ nextgroup=xinetdLogSuccessEq skipwhite syn match xinetdLogSuccessEq contained display '[+-]\==' \ nextgroup=xinetdLogSuccess skipwhite syn keyword xinetdLogSuccess contained PID HOST USERID EXIT DURATION TRAFFIC \ nextgroup=xinetdLogSuccess skipwhite syn keyword xinetdAttribute contained log_on_failure \ nextgroup=xinetdLogFailureEq skipwhite syn match xinetdLogFailureEq contained display '[+-]\==' \ nextgroup=xinetdLogFailure skipwhite syn keyword xinetdLogFailure contained HOST USERID ATTEMPT \ nextgroup=xinetdLogFailure skipwhite syn keyword xinetdReqAttribute contained rpc_version \ nextgroup=xinetdRPCVersionEq skipwhite syn match xinetdRPCVersionEq contained display '=' \ nextgroup=xinetdRPCVersion skipwhite syn match xinetdRPCVersion contained display '\d\+\%(-\d\+\)\=\>' syn keyword xinetdReqAttribute contained rpc_number port \ nextgroup=xinetdNumberEq skipwhite syn match xinetdNumberEq contained display '=' \ nextgroup=xinetdNumber skipwhite syn keyword xinetdAttribute contained env nextgroup=xinetdEnvEq skipwhite syn match xinetdEnvEq contained display '+\==' \ nextgroup=xinetdEnvName skipwhite syn match xinetdEnvName contained display '[^=]\+' \ nextgroup=xinetdEnvNameEq syn match xinetdEnvNameEq contained display '=' nextgroup=xinetdEnvValue syn match xinetdEnvValue contained display '\S\+' \ nextgroup=xinetdEnvName skipwhite syn keyword xinetdAttribute contained banner banner_success banner_failure \ nextgroup=xinetdPathEq skipwhite syn keyword xinetdPPAttribute include includedir \ nextgroup=xinetdPath skipwhite syn match xinetdPathEq contained display '=' \ nextgroup=xinetdPath skipwhite syn match xinetdPath contained display '\S\+' syn keyword xinetdAttribute contained redirect nextgroup=xinetdRedirectEq \ skipwhite syn match xinetdRedirectEq contained display '=' \ nextgroup=xinetdRedirectIP skipwhite syn match xinetdRedirectIP contained display '\S\+' \ nextgroup=xinetdNumber skipwhite syn keyword xinetdAttribute contained cps nextgroup=xinetdCPSEq skipwhite syn match xinetdCPSEq contained display '=' \ nextgroup=xinetdCPS skipwhite syn match xinetdCPS contained display '\<\d\+\>' \ nextgroup=xinetdNumber skipwhite syn keyword xinetdAttribute contained max_load nextgroup=xinetdFloatEq \ skipwhite syn match xinetdFloatEq contained display '=' \ nextgroup=xinetdFloat skipwhite syn match xinetdFloat contained display '\d\+\.\d*\|\.\d\+' syn keyword xinetdAttribute contained umask nextgroup=xinetdOctalEq \ skipwhite syn match xinetdOctalEq contained display '=' \ nextgroup=xinetdOctal,xinetdOctalError \ skipwhite syn match xinetdOctal contained display '\<0\o\+\>' \ contains=xinetdOctalZero syn match xinetdOctalZero contained display '\<0' syn match xinetdOctalError contained display '\<0\o*[89]\d*\>' syn keyword xinetdAttribute contained rlimit_as nextgroup=xinetdASEq \ skipwhite syn match xinetdASEq contained display '=' \ nextgroup=xinetdAS,xinetdUnlimited \ skipwhite syn match xinetdAS contained display '\d\+' nextgroup=xinetdASMult syn match xinetdASMult contained display '[KM]' syn keyword xinetdAttribute contained deny_time nextgroup=xinetdDenyTimeEq \ skipwhite syn match xinetdDenyTimeEq contained display '=' \ nextgroup=xinetdDenyTime,xinetdNumber \ skipwhite syn keyword xinetdDenyTime contained FOREVER NEVER hi def link xinetdTodo Todo hi def link xinetdComment Comment hi def link xinetdService Keyword hi def link xinetdServiceName String hi def link xinetdDefaults Keyword hi def link xinetdServiceGroupD Delimiter hi def link xinetdReqAttribute Keyword hi def link xinetdAttribute Type hi def link xinetdEq Operator hi def link xinetdStringEq xinetdEq hi def link xinetdString String hi def link xinetdTypeEq xinetdEq hi def link xinetdType Identifier hi def link xinetdFlagsEq xinetdEq hi def link xinetdFlags xinetdType hi def link xinetdDeprFlags WarningMsg hi def link xinetdDisable Special hi def link xinetdBooleanEq xinetdEq hi def link xinetdBoolean Boolean hi def link xinetdSocketTypeEq xinetdEq hi def link xinetdSocketType xinetdType hi def link xinetdUNumberEq xinetdEq hi def link xinetdUnlimited Define hi def link xinetdNumber Number hi def link xinetdSignedNumEq xinetdEq hi def link xinetdSignedNumber xinetdNumber hi def link xinetdStringsEq xinetdEq hi def link xinetdStrings xinetdString hi def link xinetdStringsAdvEq xinetdEq hi def link xinetdTimeRangesEq xinetdEq hi def link xinetdTimeRanges Number hi def link xinetdLogTypeEq xinetdEq hi def link xinetdLogType Keyword hi def link xinetdSyslogType xinetdType hi def link xinetdSyslogLevel Number hi def link xinetdLogFile xinetdPath hi def link xinetdLogSoftLimit xinetdNumber hi def link xinetdLogHardLimit xinetdNumber hi def link xinetdLogSuccessEq xinetdEq hi def link xinetdLogSuccess xinetdType hi def link xinetdLogFailureEq xinetdEq hi def link xinetdLogFailure xinetdType hi def link xinetdRPCVersionEq xinetdEq hi def link xinetdRPCVersion xinetdNumber hi def link xinetdNumberEq xinetdEq hi def link xinetdEnvEq xinetdEq hi def link xinetdEnvName Identifier hi def link xinetdEnvNameEq xinetdEq hi def link xinetdEnvValue String hi def link xinetdPPAttribute PreProc hi def link xinetdPathEq xinetdEq hi def link xinetdPath String hi def link xinetdRedirectEq xinetdEq hi def link xinetdRedirectIP String hi def link xinetdCPSEq xinetdEq hi def link xinetdCPS xinetdNumber hi def link xinetdFloatEq xinetdEq hi def link xinetdFloat xinetdNumber hi def link xinetdOctalEq xinetdEq hi def link xinetdOctal xinetdNumber hi def link xinetdOctalZero PreProc hi def link xinetdOctalError Error hi def link xinetdASEq xinetdEq hi def link xinetdAS xinetdNumber hi def link xinetdASMult PreProc hi def link xinetdDenyTimeEq xinetdEq hi def link xinetdDenyTime PreProc let b:current_syntax = "xinetd" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/xkb.vim000066400000000000000000000066071267703067000171200ustar00rootroot00000000000000" 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) " 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 else command -nargs=+ HiLink hi def link 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" vim-7.4.1689/runtime/syntax/xmath.vim000066400000000000000000000255231267703067000174530ustar00rootroot00000000000000" Vim syntax file " Language: xmath (a simulation tool) " Maintainer: Charles E. Campbell " Last Change: Sep 11, 2006 " Version: 7 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_XMATH " For version 5.x: Clear all syntax items " 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,@Spell 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 cluster xmathCommentGroup contains=xmathString,xmathTodo,@Spell syn keyword xmathTodo contained COMBAK DEBUG FIXME Todo TODO XXX syn match xmathComment "#.*$" contains=@xmathCommentGroup syn region xmathCommentBlock start="#{" end="}#" contains=@xmathCommentGroup " 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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/xml.vim000066400000000000000000000206411267703067000171260ustar00rootroot00000000000000" Vim syntax file " Language: XML " Maintainer: Johannes Zellner " Author and previous maintainer: " Paul Siegmann " Last Change: 2013 Jun 07 " Filenames: *.xml " $Id: xml.vim,v 1.3 2006/04/11 21:32:00 vimboss Exp $ " 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 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: " " " ^^^^^^^ syn region xmlString contained start=+"+ end=+"+ contains=xmlEntity,@Spell display syn region xmlString contained start=+'+ end=+'+ contains=xmlEntity,@Spell display " punctuation (within attributes) e.g. " ^ ^ " 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: " " " ^^^^^^^^^^^^^ " syn match xmlAttrib \ +[-'"<]\@1\%(['">]\@!\|$\)+ \ contained \ contains=xmlAttribPunct,@xmlAttribHook \ display " namespace spec " " PROVIDES: @xmlNamespaceHook " " EXAMPLE: " " " ^^^ " 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: " " " ^^^ " syn match xmlTagName \ +<\@1<=[^ /!?<>"']\++ \ 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: " " " 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: " " " ^^^^^^ " 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: " " " " " " some data " " syn region xmlRegion \ start=+<\z([^ /!?<>"']\+\)+ \ skip=++ \ end=++ \ matchgroup=xmlEndTag end=+/>+ \ fold \ contains=xmlTag,xmlEndTag,xmlCdata,xmlRegion,xmlComment,xmlEntity,xmlProcessing,@xmlRegionHook,@Spell \ 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=++ \ contains=xmlCommentStart,xmlCommentError \ extend \ fold else " no syntax folding: " - fold attribute removed " syn region xmlComment \ start=++ \ contains=xmlCommentStart,xmlCommentError \ extend endif syn match xmlCommentStart contained "+ \ contains=xmlCdataStart,xmlCdataEnd,@xmlCdataHook,@Spell \ keepend \ extend " using the following line instead leads to corrupt folding at CDATA regions " syn match xmlCdata ++ contains=xmlCdataStart,xmlCdataEnd,@xmlCdataHook syn match xmlCdataStart ++ contained " Processing instructions " This allows "?>" inside strings -- good idea? syn region xmlProcessing matchgroup=xmlProcessingDelim start="" contains=xmlAttrib,xmlEqual,xmlString if exists('g:xml_syntax_folding') " DTD -- we use dtd.vim here syn region xmlDocType matchgroup=xmlDocTypeDecl \ start="" \ fold \ contains=xmlDocTypeKeyword,xmlInlineDTD,xmlString else " no syntax folding: " - fold attribute removed " syn region xmlDocType matchgroup=xmlDocTypeDecl \ start="" \ 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 :p:h/dtd.vim unlet b:current_syntax " synchronizing " TODO !!! to be improved !!! syn sync match xmlSyncDT grouphere xmlDocType +\_.\(+ 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 xmlCommentStart xmlComment 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 vim-7.4.1689/runtime/syntax/xmodmap.vim000066400000000000000000001326431267703067000200010ustar00rootroot00000000000000" Vim syntax file " Language: xmodmap(1) definition file " Maintainer: Nikolai Weibull " Latest Revision: 2006-04-19 if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn keyword xmodmapTodo contained TODO FIXME XXX NOTE syn region xmodmapComment display oneline start='^!' end='$' \ contains=xmodmapTodo,@Spell 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 syn match xmodmapKeySym display '\<[A-Za-z]\>' " #include syn keyword xmodmapKeySym XK_VoidSymbol XK_BackSpace XK_Tab XK_Linefeed \ XK_Clear XK_Return XK_Pause XK_Scroll_Lock \ XK_Sys_Req XK_Escape XK_Delete XK_Multi_key \ XK_Codeinput XK_SingleCandidate \ XK_MultipleCandidate XK_PreviousCandidate \ XK_Kanji XK_Muhenkan XK_Henkan_Mode \ XK_Henkan XK_Romaji XK_Hiragana XK_Katakana \ XK_Hiragana_Katakana XK_Zenkaku XK_Hankaku \ XK_Zenkaku_Hankaku XK_Touroku XK_Massyo \ XK_Kana_Lock XK_Kana_Shift XK_Eisu_Shift \ XK_Eisu_toggle XK_Kanji_Bangou XK_Zen_Koho \ XK_Mae_Koho XK_Home XK_Left XK_Up XK_Right \ XK_Down XK_Prior XK_Page_Up XK_Next \ XK_Page_Down XK_End XK_Begin XK_Select \ XK_Print XK_Execute XK_Insert XK_Undo XK_Redo \ XK_Menu XK_Find XK_Cancel XK_Help XK_Break \ XK_Mode_switch XK_script_switch XK_Num_Lock \ XK_KP_Space XK_KP_Tab XK_KP_Enter XK_KP_F1 \ XK_KP_F2 XK_KP_F3 XK_KP_F4 XK_KP_Home \ XK_KP_Left XK_KP_Up XK_KP_Right XK_KP_Down \ XK_KP_Prior XK_KP_Page_Up XK_KP_Next \ XK_KP_Page_Down XK_KP_End XK_KP_Begin \ XK_KP_Insert XK_KP_Delete XK_KP_Equal \ XK_KP_Multiply XK_KP_Add XK_KP_Separator \ XK_KP_Subtract XK_KP_Decimal XK_KP_Divide \ XK_KP_0 XK_KP_1 XK_KP_2 XK_KP_3 XK_KP_4 \ XK_KP_5 XK_KP_6 XK_KP_7 XK_KP_8 XK_KP_9 XK_F1 \ XK_F2 XK_F3 XK_F4 XK_F5 XK_F6 XK_F7 XK_F8 \ XK_F9 XK_F10 XK_F11 XK_L1 XK_F12 XK_L2 XK_F13 \ XK_L3 XK_F14 XK_L4 XK_F15 XK_L5 XK_F16 XK_L6 \ XK_F17 XK_L7 XK_F18 XK_L8 XK_F19 XK_L9 XK_F20 \ XK_L10 XK_F21 XK_R1 XK_F22 XK_R2 XK_F23 \ XK_R3 XK_F24 XK_R4 XK_F25 XK_R5 XK_F26 \ XK_R6 XK_F27 XK_R7 XK_F28 XK_R8 XK_F29 \ XK_R9 XK_F30 XK_R10 XK_F31 XK_R11 XK_F32 \ XK_R12 XK_F33 XK_R13 XK_F34 XK_R14 XK_F35 \ XK_R15 XK_Shift_L XK_Shift_R XK_Control_L \ XK_Control_R XK_Caps_Lock XK_Shift_Lock \ XK_Meta_L XK_Meta_R XK_Alt_L XK_Alt_R \ XK_Super_L XK_Super_R XK_Hyper_L XK_Hyper_R \ XK_dead_hook XK_dead_horn XK_3270_Duplicate \ XK_3270_FieldMark XK_3270_Right2 XK_3270_Left2 \ XK_3270_BackTab XK_3270_EraseEOF \ XK_3270_EraseInput XK_3270_Reset \ XK_3270_Quit XK_3270_PA1 XK_3270_PA2 \ XK_3270_PA3 XK_3270_Test XK_3270_Attn \ XK_3270_CursorBlink XK_3270_AltCursor \ XK_3270_KeyClick XK_3270_Jump \ XK_3270_Ident XK_3270_Rule XK_3270_Copy \ XK_3270_Play XK_3270_Setup XK_3270_Record \ XK_3270_ChangeScreen XK_3270_DeleteWord \ XK_3270_ExSelect XK_3270_CursorSelect \ XK_3270_PrintScreen XK_3270_Enter XK_space \ XK_exclam XK_quotedbl XK_numbersign XK_dollar \ XK_percent XK_ampersand XK_apostrophe \ XK_quoteright XK_parenleft XK_parenright \ XK_asterisk XK_plus XK_comma XK_minus \ XK_period XK_slash XK_0 XK_1 XK_2 XK_3 \ XK_4 XK_5 XK_6 XK_7 XK_8 XK_9 XK_colon \ XK_semicolon XK_less XK_equal XK_greater \ XK_question XK_at XK_A XK_B XK_C XK_D XK_E \ XK_F XK_G XK_H XK_I XK_J XK_K XK_L XK_M XK_N \ XK_O XK_P XK_Q XK_R XK_S XK_T XK_U XK_V XK_W \ XK_X XK_Y XK_Z XK_bracketleft XK_backslash \ XK_bracketright XK_asciicircum XK_underscore \ XK_grave XK_quoteleft XK_a XK_b XK_c XK_d \ XK_e XK_f XK_g XK_h XK_i XK_j XK_k XK_l \ XK_m XK_n XK_o XK_p XK_q XK_r XK_s XK_t XK_u \ XK_v XK_w XK_x XK_y XK_z XK_braceleft XK_bar \ XK_braceright XK_asciitilde XK_nobreakspace \ XK_exclamdown XK_cent XK_sterling XK_currency \ XK_yen XK_brokenbar XK_section XK_diaeresis \ XK_copyright XK_ordfeminine XK_guillemotleft \ XK_notsign XK_hyphen XK_registered XK_macron \ XK_degree XK_plusminus XK_twosuperior \ XK_threesuperior XK_acute XK_mu XK_paragraph \ XK_periodcentered XK_cedilla XK_onesuperior \ XK_masculine XK_guillemotright XK_onequarter \ XK_onehalf XK_threequarters XK_questiondown \ XK_Agrave XK_Aacute XK_Acircumflex XK_Atilde \ XK_Adiaeresis XK_Aring XK_AE XK_Ccedilla \ XK_Egrave XK_Eacute XK_Ecircumflex \ XK_Ediaeresis XK_Igrave XK_Iacute \ XK_Icircumflex XK_Idiaeresis XK_ETH XK_Eth \ XK_Ntilde XK_Ograve XK_Oacute XK_Ocircumflex \ XK_Otilde XK_Odiaeresis XK_multiply \ XK_Ooblique XK_Ugrave XK_Uacute XK_Ucircumflex \ XK_Udiaeresis XK_Yacute XK_THORN XK_Thorn \ XK_ssharp XK_agrave XK_aacute XK_acircumflex \ XK_atilde XK_adiaeresis XK_aring XK_ae \ XK_ccedilla XK_egrave XK_eacute XK_ecircumflex \ XK_ediaeresis XK_igrave XK_iacute \ XK_icircumflex XK_idiaeresis XK_eth XK_ntilde \ XK_ograve XK_oacute XK_ocircumflex XK_otilde \ XK_odiaeresis XK_division XK_oslash XK_ugrave \ XK_uacute XK_ucircumflex XK_udiaeresis \ XK_yacute XK_thorn XK_ydiaeresis XK_Aogonek \ XK_breve XK_Lstroke XK_Lcaron XK_Sacute \ XK_Scaron XK_Scedilla XK_Tcaron XK_Zacute \ XK_Zcaron XK_Zabovedot XK_aogonek XK_ogonek \ XK_lstroke XK_lcaron XK_sacute XK_caron \ XK_scaron XK_scedilla XK_tcaron XK_zacute \ XK_doubleacute XK_zcaron XK_zabovedot \ XK_Racute XK_Abreve XK_Lacute XK_Cacute \ XK_Ccaron XK_Eogonek XK_Ecaron XK_Dcaron \ XK_Dstroke XK_Nacute XK_Ncaron XK_Odoubleacute \ XK_Rcaron XK_Uring XK_Udoubleacute \ XK_Tcedilla XK_racute XK_abreve XK_lacute \ XK_cacute XK_ccaron XK_eogonek XK_ecaron \ XK_dcaron XK_dstroke XK_nacute XK_ncaron \ XK_odoubleacute XK_udoubleacute XK_rcaron \ XK_uring XK_tcedilla XK_abovedot XK_Hstroke \ XK_Hcircumflex XK_Iabovedot XK_Gbreve \ XK_Jcircumflex XK_hstroke XK_hcircumflex \ XK_idotless XK_gbreve XK_jcircumflex \ XK_Cabovedot XK_Ccircumflex XK_Gabovedot \ XK_Gcircumflex XK_Ubreve XK_Scircumflex \ XK_cabovedot XK_ccircumflex XK_gabovedot \ XK_gcircumflex XK_ubreve XK_scircumflex XK_kra \ XK_kappa XK_Rcedilla XK_Itilde XK_Lcedilla \ XK_Emacron XK_Gcedilla XK_Tslash XK_rcedilla \ XK_itilde XK_lcedilla XK_emacron XK_gcedilla \ XK_tslash XK_ENG XK_eng XK_Amacron XK_Iogonek \ XK_Eabovedot XK_Imacron XK_Ncedilla XK_Omacron \ XK_Kcedilla XK_Uogonek XK_Utilde XK_Umacron \ XK_amacron XK_iogonek XK_eabovedot XK_imacron \ XK_ncedilla XK_omacron XK_kcedilla XK_uogonek \ XK_utilde XK_umacron XK_Babovedot XK_babovedot \ XK_Dabovedot XK_Wgrave XK_Wacute XK_dabovedot \ XK_Ygrave XK_Fabovedot XK_fabovedot \ XK_Mabovedot XK_mabovedot XK_Pabovedot \ XK_wgrave XK_pabovedot XK_wacute XK_Sabovedot \ XK_ygrave XK_Wdiaeresis XK_wdiaeresis \ XK_sabovedot XK_Wcircumflex XK_Tabovedot \ XK_Ycircumflex XK_wcircumflex \ XK_tabovedot XK_ycircumflex XK_OE XK_oe \ XK_Ydiaeresis XK_overline XK_kana_fullstop \ XK_kana_openingbracket XK_kana_closingbracket \ XK_kana_comma XK_kana_conjunctive \ XK_kana_middledot XK_kana_WO XK_kana_a \ XK_kana_i XK_kana_u XK_kana_e XK_kana_o \ XK_kana_ya XK_kana_yu XK_kana_yo \ XK_kana_tsu XK_kana_tu XK_prolongedsound \ XK_kana_A XK_kana_I XK_kana_U XK_kana_E \ XK_kana_O XK_kana_KA XK_kana_KI XK_kana_KU \ XK_kana_KE XK_kana_KO XK_kana_SA XK_kana_SHI \ XK_kana_SU XK_kana_SE XK_kana_SO XK_kana_TA \ XK_kana_CHI XK_kana_TI XK_kana_TSU \ XK_kana_TU XK_kana_TE XK_kana_TO XK_kana_NA \ XK_kana_NI XK_kana_NU XK_kana_NE XK_kana_NO \ XK_kana_HA XK_kana_HI XK_kana_FU XK_kana_HU \ XK_kana_HE XK_kana_HO XK_kana_MA XK_kana_MI \ XK_kana_MU XK_kana_ME XK_kana_MO XK_kana_YA \ XK_kana_YU XK_kana_YO XK_kana_RA XK_kana_RI \ XK_kana_RU XK_kana_RE XK_kana_RO XK_kana_WA \ XK_kana_N XK_voicedsound XK_semivoicedsound \ XK_kana_switch XK_Farsi_0 XK_Farsi_1 \ XK_Farsi_2 XK_Farsi_3 XK_Farsi_4 XK_Farsi_5 \ XK_Farsi_6 XK_Farsi_7 XK_Farsi_8 XK_Farsi_9 \ XK_Arabic_percent XK_Arabic_superscript_alef \ XK_Arabic_tteh XK_Arabic_peh XK_Arabic_tcheh \ XK_Arabic_ddal XK_Arabic_rreh XK_Arabic_comma \ XK_Arabic_fullstop XK_Arabic_0 XK_Arabic_1 \ XK_Arabic_2 XK_Arabic_3 XK_Arabic_4 \ XK_Arabic_5 XK_Arabic_6 XK_Arabic_7 \ XK_Arabic_8 XK_Arabic_9 XK_Arabic_semicolon \ XK_Arabic_question_mark XK_Arabic_hamza \ XK_Arabic_maddaonalef XK_Arabic_hamzaonalef \ XK_Arabic_hamzaonwaw XK_Arabic_hamzaunderalef \ XK_Arabic_hamzaonyeh XK_Arabic_alef \ XK_Arabic_beh XK_Arabic_tehmarbuta \ XK_Arabic_teh XK_Arabic_theh XK_Arabic_jeem \ XK_Arabic_hah XK_Arabic_khah XK_Arabic_dal \ XK_Arabic_thal XK_Arabic_ra XK_Arabic_zain \ XK_Arabic_seen XK_Arabic_sheen \ XK_Arabic_sad XK_Arabic_dad XK_Arabic_tah \ XK_Arabic_zah XK_Arabic_ain XK_Arabic_ghain \ XK_Arabic_tatweel XK_Arabic_feh XK_Arabic_qaf \ XK_Arabic_kaf XK_Arabic_lam XK_Arabic_meem \ XK_Arabic_noon XK_Arabic_ha XK_Arabic_heh \ XK_Arabic_waw XK_Arabic_alefmaksura \ XK_Arabic_yeh XK_Arabic_fathatan \ XK_Arabic_dammatan XK_Arabic_kasratan \ XK_Arabic_fatha XK_Arabic_damma \ XK_Arabic_kasra XK_Arabic_shadda \ XK_Arabic_sukun XK_Arabic_madda_above \ XK_Arabic_hamza_above XK_Arabic_hamza_below \ XK_Arabic_jeh XK_Arabic_veh XK_Arabic_keheh \ XK_Arabic_gaf XK_Arabic_noon_ghunna \ XK_Arabic_heh_doachashmee XK_Farsi_yeh \ XK_Arabic_yeh_baree XK_Arabic_heh_goal \ XK_Arabic_switch XK_Cyrillic_GHE_bar \ XK_Cyrillic_ghe_bar XK_Cyrillic_ZHE_descender \ XK_Cyrillic_zhe_descender \ XK_Cyrillic_KA_descender \ XK_Cyrillic_ka_descender \ XK_Cyrillic_KA_vertstroke \ XK_Cyrillic_ka_vertstroke \ XK_Cyrillic_EN_descender \ XK_Cyrillic_en_descender \ XK_Cyrillic_U_straight XK_Cyrillic_u_straight \ XK_Cyrillic_U_straight_bar \ XK_Cyrillic_u_straight_bar \ XK_Cyrillic_HA_descender \ XK_Cyrillic_ha_descender \ XK_Cyrillic_CHE_descender \ XK_Cyrillic_che_descender \ XK_Cyrillic_CHE_vertstroke \ XK_Cyrillic_che_vertstroke XK_Cyrillic_SHHA \ XK_Cyrillic_shha XK_Cyrillic_SCHWA \ XK_Cyrillic_schwa XK_Cyrillic_I_macron \ XK_Cyrillic_i_macron XK_Cyrillic_O_bar \ XK_Cyrillic_o_bar XK_Cyrillic_U_macron \ XK_Cyrillic_u_macron XK_Serbian_dje \ XK_Macedonia_gje XK_Cyrillic_io \ XK_Ukrainian_ie XK_Ukranian_je \ XK_Macedonia_dse XK_Ukrainian_i XK_Ukranian_i \ XK_Ukrainian_yi XK_Ukranian_yi XK_Cyrillic_je \ XK_Serbian_je XK_Cyrillic_lje XK_Serbian_lje \ XK_Cyrillic_nje XK_Serbian_nje XK_Serbian_tshe \ XK_Macedonia_kje XK_Ukrainian_ghe_with_upturn \ XK_Byelorussian_shortu XK_Cyrillic_dzhe \ XK_Serbian_dze XK_numerosign \ XK_Serbian_DJE XK_Macedonia_GJE \ XK_Cyrillic_IO XK_Ukrainian_IE XK_Ukranian_JE \ XK_Macedonia_DSE XK_Ukrainian_I XK_Ukranian_I \ XK_Ukrainian_YI XK_Ukranian_YI XK_Cyrillic_JE \ XK_Serbian_JE XK_Cyrillic_LJE XK_Serbian_LJE \ XK_Cyrillic_NJE XK_Serbian_NJE XK_Serbian_TSHE \ XK_Macedonia_KJE XK_Ukrainian_GHE_WITH_UPTURN \ XK_Byelorussian_SHORTU XK_Cyrillic_DZHE \ XK_Serbian_DZE XK_Cyrillic_yu \ XK_Cyrillic_a XK_Cyrillic_be XK_Cyrillic_tse \ XK_Cyrillic_de XK_Cyrillic_ie XK_Cyrillic_ef \ XK_Cyrillic_ghe XK_Cyrillic_ha XK_Cyrillic_i \ XK_Cyrillic_shorti XK_Cyrillic_ka \ XK_Cyrillic_el XK_Cyrillic_em XK_Cyrillic_en \ XK_Cyrillic_o XK_Cyrillic_pe XK_Cyrillic_ya \ XK_Cyrillic_er XK_Cyrillic_es XK_Cyrillic_te \ XK_Cyrillic_u XK_Cyrillic_zhe XK_Cyrillic_ve \ XK_Cyrillic_softsign XK_Cyrillic_yeru \ XK_Cyrillic_ze XK_Cyrillic_sha XK_Cyrillic_e \ XK_Cyrillic_shcha XK_Cyrillic_che \ XK_Cyrillic_hardsign XK_Cyrillic_YU \ XK_Cyrillic_A XK_Cyrillic_BE XK_Cyrillic_TSE \ XK_Cyrillic_DE XK_Cyrillic_IE XK_Cyrillic_EF \ XK_Cyrillic_GHE XK_Cyrillic_HA XK_Cyrillic_I \ XK_Cyrillic_SHORTI XK_Cyrillic_KA \ XK_Cyrillic_EL XK_Cyrillic_EM XK_Cyrillic_EN \ XK_Cyrillic_O XK_Cyrillic_PE XK_Cyrillic_YA \ XK_Cyrillic_ER XK_Cyrillic_ES XK_Cyrillic_TE \ XK_Cyrillic_U XK_Cyrillic_ZHE XK_Cyrillic_VE \ XK_Cyrillic_SOFTSIGN XK_Cyrillic_YERU \ XK_Cyrillic_ZE XK_Cyrillic_SHA XK_Cyrillic_E \ XK_Cyrillic_SHCHA XK_Cyrillic_CHE \ XK_Cyrillic_HARDSIGN XK_Greek_ALPHAaccent \ XK_Greek_EPSILONaccent XK_Greek_ETAaccent \ XK_Greek_IOTAaccent XK_Greek_IOTAdieresis \ XK_Greek_OMICRONaccent XK_Greek_UPSILONaccent \ XK_Greek_UPSILONdieresis \ XK_Greek_OMEGAaccent XK_Greek_accentdieresis \ XK_Greek_horizbar XK_Greek_alphaaccent \ XK_Greek_epsilonaccent XK_Greek_etaaccent \ XK_Greek_iotaaccent XK_Greek_iotadieresis \ XK_Greek_iotaaccentdieresis \ XK_Greek_omicronaccent XK_Greek_upsilonaccent \ XK_Greek_upsilondieresis \ XK_Greek_upsilonaccentdieresis \ XK_Greek_omegaaccent XK_Greek_ALPHA \ XK_Greek_BETA XK_Greek_GAMMA XK_Greek_DELTA \ XK_Greek_EPSILON XK_Greek_ZETA XK_Greek_ETA \ XK_Greek_THETA XK_Greek_IOTA XK_Greek_KAPPA \ XK_Greek_LAMDA XK_Greek_LAMBDA XK_Greek_MU \ XK_Greek_NU XK_Greek_XI XK_Greek_OMICRON \ XK_Greek_PI XK_Greek_RHO XK_Greek_SIGMA \ XK_Greek_TAU XK_Greek_UPSILON XK_Greek_PHI \ XK_Greek_CHI XK_Greek_PSI XK_Greek_OMEGA \ XK_Greek_alpha XK_Greek_beta XK_Greek_gamma \ XK_Greek_delta XK_Greek_epsilon XK_Greek_zeta \ XK_Greek_eta XK_Greek_theta XK_Greek_iota \ XK_Greek_kappa XK_Greek_lamda XK_Greek_lambda \ XK_Greek_mu XK_Greek_nu XK_Greek_xi \ XK_Greek_omicron XK_Greek_pi XK_Greek_rho \ XK_Greek_sigma XK_Greek_finalsmallsigma \ XK_Greek_tau XK_Greek_upsilon XK_Greek_phi \ XK_Greek_chi XK_Greek_psi XK_Greek_omega \ XK_Greek_switch XK_leftradical \ XK_topleftradical XK_horizconnector \ XK_topintegral XK_botintegral \ XK_vertconnector XK_topleftsqbracket \ XK_botleftsqbracket XK_toprightsqbracket \ XK_botrightsqbracket XK_topleftparens \ XK_botleftparens XK_toprightparens \ XK_botrightparens XK_leftmiddlecurlybrace \ XK_rightmiddlecurlybrace \ XK_topleftsummation XK_botleftsummation \ XK_topvertsummationconnector \ XK_botvertsummationconnector \ XK_toprightsummation XK_botrightsummation \ XK_rightmiddlesummation XK_lessthanequal \ XK_notequal XK_greaterthanequal XK_integral \ XK_therefore XK_variation XK_infinity \ XK_nabla XK_approximate XK_similarequal \ XK_ifonlyif XK_implies XK_identical XK_radical \ XK_includedin XK_includes XK_intersection \ XK_union XK_logicaland XK_logicalor \ XK_partialderivative XK_function XK_leftarrow \ XK_uparrow XK_rightarrow XK_downarrow XK_blank \ XK_soliddiamond XK_checkerboard XK_ht XK_ff \ XK_cr XK_lf XK_nl XK_vt XK_lowrightcorner \ XK_uprightcorner XK_upleftcorner \ XK_lowleftcorner XK_crossinglines \ XK_horizlinescan1 XK_horizlinescan3 \ XK_horizlinescan5 XK_horizlinescan7 \ XK_horizlinescan9 XK_leftt XK_rightt XK_bott \ XK_topt XK_vertbar XK_emspace XK_enspace \ XK_em3space XK_em4space XK_digitspace \ XK_punctspace XK_thinspace XK_hairspace \ XK_emdash XK_endash XK_signifblank XK_ellipsis \ XK_doubbaselinedot XK_onethird XK_twothirds \ XK_onefifth XK_twofifths XK_threefifths \ XK_fourfifths XK_onesixth XK_fivesixths \ XK_careof XK_figdash XK_leftanglebracket \ XK_decimalpoint XK_rightanglebracket \ XK_marker XK_oneeighth XK_threeeighths \ XK_fiveeighths XK_seveneighths XK_trademark \ XK_signaturemark XK_trademarkincircle \ XK_leftopentriangle XK_rightopentriangle \ XK_emopencircle XK_emopenrectangle \ XK_leftsinglequotemark XK_rightsinglequotemark \ XK_leftdoublequotemark XK_rightdoublequotemark \ XK_prescription XK_minutes XK_seconds \ XK_latincross XK_hexagram XK_filledrectbullet \ XK_filledlefttribullet XK_filledrighttribullet \ XK_emfilledcircle XK_emfilledrect \ XK_enopencircbullet XK_enopensquarebullet \ XK_openrectbullet XK_opentribulletup \ XK_opentribulletdown XK_openstar \ XK_enfilledcircbullet XK_enfilledsqbullet \ XK_filledtribulletup XK_filledtribulletdown \ XK_leftpointer XK_rightpointer XK_club \ XK_diamond XK_heart XK_maltesecross \ XK_dagger XK_doubledagger XK_checkmark \ XK_ballotcross XK_musicalsharp XK_musicalflat \ XK_malesymbol XK_femalesymbol XK_telephone \ XK_telephonerecorder XK_phonographcopyright \ XK_caret XK_singlelowquotemark \ XK_doublelowquotemark XK_cursor \ XK_leftcaret XK_rightcaret XK_downcaret \ XK_upcaret XK_overbar XK_downtack XK_upshoe \ XK_downstile XK_underbar XK_jot XK_quad \ XK_uptack XK_circle XK_upstile XK_downshoe \ XK_rightshoe XK_leftshoe XK_lefttack \ XK_righttack XK_hebrew_doublelowline \ XK_hebrew_aleph XK_hebrew_bet XK_hebrew_beth \ XK_hebrew_gimel XK_hebrew_gimmel \ XK_hebrew_dalet XK_hebrew_daleth \ XK_hebrew_he XK_hebrew_waw XK_hebrew_zain \ XK_hebrew_zayin XK_hebrew_chet XK_hebrew_het \ XK_hebrew_tet XK_hebrew_teth XK_hebrew_yod \ XK_hebrew_finalkaph XK_hebrew_kaph \ XK_hebrew_lamed XK_hebrew_finalmem \ XK_hebrew_mem XK_hebrew_finalnun XK_hebrew_nun \ XK_hebrew_samech XK_hebrew_samekh \ XK_hebrew_ayin XK_hebrew_finalpe XK_hebrew_pe \ XK_hebrew_finalzade XK_hebrew_finalzadi \ XK_hebrew_zade XK_hebrew_zadi XK_hebrew_qoph \ XK_hebrew_kuf XK_hebrew_resh XK_hebrew_shin \ XK_hebrew_taw XK_hebrew_taf XK_Hebrew_switch \ XK_Thai_kokai XK_Thai_khokhai XK_Thai_khokhuat \ XK_Thai_khokhwai XK_Thai_khokhon \ XK_Thai_khorakhang XK_Thai_ngongu \ XK_Thai_chochan XK_Thai_choching \ XK_Thai_chochang XK_Thai_soso XK_Thai_chochoe \ XK_Thai_yoying XK_Thai_dochada XK_Thai_topatak \ XK_Thai_thothan XK_Thai_thonangmontho \ XK_Thai_thophuthao XK_Thai_nonen \ XK_Thai_dodek XK_Thai_totao XK_Thai_thothung \ XK_Thai_thothahan XK_Thai_thothong \ XK_Thai_nonu XK_Thai_bobaimai XK_Thai_popla \ XK_Thai_phophung XK_Thai_fofa XK_Thai_phophan \ XK_Thai_fofan XK_Thai_phosamphao XK_Thai_moma \ XK_Thai_yoyak XK_Thai_rorua XK_Thai_ru \ XK_Thai_loling XK_Thai_lu XK_Thai_wowaen \ XK_Thai_sosala XK_Thai_sorusi XK_Thai_sosua \ XK_Thai_hohip XK_Thai_lochula XK_Thai_oang \ XK_Thai_honokhuk XK_Thai_paiyannoi \ XK_Thai_saraa XK_Thai_maihanakat \ XK_Thai_saraaa XK_Thai_saraam XK_Thai_sarai \ XK_Thai_saraii XK_Thai_saraue XK_Thai_sarauee \ XK_Thai_sarau XK_Thai_sarauu XK_Thai_phinthu \ XK_Thai_maihanakat_maitho XK_Thai_baht \ XK_Thai_sarae XK_Thai_saraae XK_Thai_sarao \ XK_Thai_saraaimaimuan XK_Thai_saraaimaimalai \ XK_Thai_lakkhangyao XK_Thai_maiyamok \ XK_Thai_maitaikhu XK_Thai_maiek XK_Thai_maitho \ XK_Thai_maitri XK_Thai_maichattawa \ XK_Thai_thanthakhat XK_Thai_nikhahit \ XK_Thai_leksun XK_Thai_leknung XK_Thai_leksong \ XK_Thai_leksam XK_Thai_leksi XK_Thai_lekha \ XK_Thai_lekhok XK_Thai_lekchet XK_Thai_lekpaet \ XK_Thai_lekkao XK_Hangul XK_Hangul_Start \ XK_Hangul_End XK_Hangul_Hanja XK_Hangul_Jamo \ XK_Hangul_Romaja XK_Hangul_Codeinput \ XK_Hangul_Jeonja XK_Hangul_Banja \ XK_Hangul_PreHanja XK_Hangul_PostHanja \ XK_Hangul_SingleCandidate \ XK_Hangul_MultipleCandidate \ XK_Hangul_PreviousCandidate XK_Hangul_Special \ XK_Hangul_switch XK_Hangul_Kiyeog \ XK_Hangul_SsangKiyeog XK_Hangul_KiyeogSios \ XK_Hangul_Nieun XK_Hangul_NieunJieuj \ XK_Hangul_NieunHieuh XK_Hangul_Dikeud \ XK_Hangul_SsangDikeud XK_Hangul_Rieul \ XK_Hangul_RieulKiyeog XK_Hangul_RieulMieum \ XK_Hangul_RieulPieub XK_Hangul_RieulSios \ XK_Hangul_RieulTieut XK_Hangul_RieulPhieuf \ XK_Hangul_RieulHieuh XK_Hangul_Mieum \ XK_Hangul_Pieub XK_Hangul_SsangPieub \ XK_Hangul_PieubSios XK_Hangul_Sios \ XK_Hangul_SsangSios XK_Hangul_Ieung \ XK_Hangul_Jieuj XK_Hangul_SsangJieuj \ XK_Hangul_Cieuc XK_Hangul_Khieuq \ XK_Hangul_Tieut XK_Hangul_Phieuf \ XK_Hangul_Hieuh XK_Hangul_A XK_Hangul_AE \ XK_Hangul_YA XK_Hangul_YAE XK_Hangul_EO \ XK_Hangul_E XK_Hangul_YEO XK_Hangul_YE \ XK_Hangul_O XK_Hangul_WA XK_Hangul_WAE \ XK_Hangul_OE XK_Hangul_YO XK_Hangul_U \ XK_Hangul_WEO XK_Hangul_WE XK_Hangul_WI \ XK_Hangul_YU XK_Hangul_EU XK_Hangul_YI \ XK_Hangul_I XK_Hangul_J_Kiyeog \ XK_Hangul_J_SsangKiyeog XK_Hangul_J_KiyeogSios \ XK_Hangul_J_Nieun XK_Hangul_J_NieunJieuj \ XK_Hangul_J_NieunHieuh XK_Hangul_J_Dikeud \ XK_Hangul_J_Rieul XK_Hangul_J_RieulKiyeog \ XK_Hangul_J_RieulMieum XK_Hangul_J_RieulPieub \ XK_Hangul_J_RieulSios XK_Hangul_J_RieulTieut \ XK_Hangul_J_RieulPhieuf XK_Hangul_J_RieulHieuh \ XK_Hangul_J_Mieum XK_Hangul_J_Pieub \ XK_Hangul_J_PieubSios XK_Hangul_J_Sios \ XK_Hangul_J_SsangSios XK_Hangul_J_Ieung \ XK_Hangul_J_Jieuj XK_Hangul_J_Cieuc \ XK_Hangul_J_Khieuq XK_Hangul_J_Tieut \ XK_Hangul_J_Phieuf XK_Hangul_J_Hieuh \ XK_Hangul_RieulYeorinHieuh \ XK_Hangul_SunkyeongeumMieum \ XK_Hangul_SunkyeongeumPieub XK_Hangul_PanSios \ XK_Hangul_KkogjiDalrinIeung \ XK_Hangul_SunkyeongeumPhieuf \ XK_Hangul_YeorinHieuh XK_Hangul_AraeA \ XK_Hangul_AraeAE XK_Hangul_J_PanSios \ XK_Hangul_J_KkogjiDalrinIeung \ XK_Hangul_J_YeorinHieuh XK_Korean_Won \ XK_Armenian_eternity XK_Armenian_ligature_ew \ XK_Armenian_full_stop XK_Armenian_verjaket \ XK_Armenian_parenright XK_Armenian_parenleft \ XK_Armenian_guillemotright \ XK_Armenian_guillemotleft XK_Armenian_em_dash \ XK_Armenian_dot XK_Armenian_mijaket \ XK_Armenian_separation_mark XK_Armenian_but \ XK_Armenian_comma XK_Armenian_en_dash \ XK_Armenian_hyphen XK_Armenian_yentamna \ XK_Armenian_ellipsis XK_Armenian_exclam \ XK_Armenian_amanak XK_Armenian_accent \ XK_Armenian_shesht XK_Armenian_question \ XK_Armenian_paruyk XK_Armenian_AYB \ XK_Armenian_ayb XK_Armenian_BEN \ XK_Armenian_ben XK_Armenian_GIM \ XK_Armenian_gim XK_Armenian_DA XK_Armenian_da \ XK_Armenian_YECH XK_Armenian_yech \ XK_Armenian_ZA XK_Armenian_za XK_Armenian_E \ XK_Armenian_e XK_Armenian_AT XK_Armenian_at \ XK_Armenian_TO XK_Armenian_to \ XK_Armenian_ZHE XK_Armenian_zhe \ XK_Armenian_INI XK_Armenian_ini \ XK_Armenian_LYUN XK_Armenian_lyun \ XK_Armenian_KHE XK_Armenian_khe \ XK_Armenian_TSA XK_Armenian_tsa \ XK_Armenian_KEN XK_Armenian_ken XK_Armenian_HO \ XK_Armenian_ho XK_Armenian_DZA XK_Armenian_dza \ XK_Armenian_GHAT XK_Armenian_ghat \ XK_Armenian_TCHE XK_Armenian_tche \ XK_Armenian_MEN XK_Armenian_men XK_Armenian_HI \ XK_Armenian_hi XK_Armenian_NU XK_Armenian_nu \ XK_Armenian_SHA XK_Armenian_sha XK_Armenian_VO \ XK_Armenian_vo XK_Armenian_CHA XK_Armenian_cha \ XK_Armenian_PE XK_Armenian_pe XK_Armenian_JE \ XK_Armenian_je XK_Armenian_RA XK_Armenian_ra \ XK_Armenian_SE XK_Armenian_se XK_Armenian_VEV \ XK_Armenian_vev XK_Armenian_TYUN \ XK_Armenian_tyun XK_Armenian_RE \ XK_Armenian_re XK_Armenian_TSO \ XK_Armenian_tso XK_Armenian_VYUN \ XK_Armenian_vyun XK_Armenian_PYUR \ XK_Armenian_pyur XK_Armenian_KE XK_Armenian_ke \ XK_Armenian_O XK_Armenian_o XK_Armenian_FE \ XK_Armenian_fe XK_Armenian_apostrophe \ XK_Armenian_section_sign XK_Georgian_an \ XK_Georgian_ban XK_Georgian_gan \ XK_Georgian_don XK_Georgian_en XK_Georgian_vin \ XK_Georgian_zen XK_Georgian_tan \ XK_Georgian_in XK_Georgian_kan XK_Georgian_las \ XK_Georgian_man XK_Georgian_nar XK_Georgian_on \ XK_Georgian_par XK_Georgian_zhar \ XK_Georgian_rae XK_Georgian_san \ XK_Georgian_tar XK_Georgian_un \ XK_Georgian_phar XK_Georgian_khar \ XK_Georgian_ghan XK_Georgian_qar \ XK_Georgian_shin XK_Georgian_chin \ XK_Georgian_can XK_Georgian_jil \ XK_Georgian_cil XK_Georgian_char \ XK_Georgian_xan XK_Georgian_jhan \ XK_Georgian_hae XK_Georgian_he XK_Georgian_hie \ XK_Georgian_we XK_Georgian_har XK_Georgian_hoe \ XK_Georgian_fi XK_Ccedillaabovedot \ XK_Xabovedot XK_Qabovedot XK_IE XK_UO \ XK_Zstroke XK_ccedillaabovedot XK_xabovedot \ XK_qabovedot XK_ie XK_uo XK_zstroke XK_SCHWA \ XK_schwa XK_Lbelowdot XK_Lstrokebelowdot \ XK_lbelowdot XK_lstrokebelowdot XK_Gtilde \ XK_gtilde XK_Abelowdot XK_abelowdot \ XK_Ahook XK_ahook XK_Acircumflexacute \ XK_acircumflexacute XK_Acircumflexgrave \ XK_acircumflexgrave XK_Acircumflexhook \ XK_acircumflexhook XK_Acircumflextilde \ XK_acircumflextilde XK_Acircumflexbelowdot \ XK_acircumflexbelowdot XK_Abreveacute \ XK_abreveacute XK_Abrevegrave XK_abrevegrave \ XK_Abrevehook XK_abrevehook XK_Abrevetilde \ XK_abrevetilde XK_Abrevebelowdot \ XK_abrevebelowdot XK_Ebelowdot XK_ebelowdot \ XK_Ehook XK_ehook XK_Etilde XK_etilde \ XK_Ecircumflexacute XK_ecircumflexacute \ XK_Ecircumflexgrave XK_ecircumflexgrave \ XK_Ecircumflexhook XK_ecircumflexhook \ XK_Ecircumflextilde XK_ecircumflextilde \ XK_Ecircumflexbelowdot XK_ecircumflexbelowdot \ XK_Ihook XK_ihook XK_Ibelowdot XK_ibelowdot \ XK_Obelowdot XK_obelowdot XK_Ohook XK_ohook \ XK_Ocircumflexacute XK_ocircumflexacute \ XK_Ocircumflexgrave XK_ocircumflexgrave \ XK_Ocircumflexhook XK_ocircumflexhook \ XK_Ocircumflextilde XK_ocircumflextilde \ XK_Ocircumflexbelowdot XK_ocircumflexbelowdot \ XK_Ohornacute XK_ohornacute XK_Ohorngrave \ XK_ohorngrave XK_Ohornhook XK_ohornhook \ XK_Ohorntilde XK_ohorntilde XK_Ohornbelowdot \ XK_ohornbelowdot XK_Ubelowdot XK_ubelowdot \ XK_Uhook XK_uhook XK_Uhornacute XK_uhornacute \ XK_Uhorngrave XK_uhorngrave XK_Uhornhook \ XK_uhornhook XK_Uhorntilde XK_uhorntilde \ XK_Uhornbelowdot XK_uhornbelowdot XK_Ybelowdot \ XK_ybelowdot XK_Yhook XK_yhook XK_Ytilde \ XK_ytilde XK_Ohorn XK_ohorn XK_Uhorn XK_uhorn \ XK_combining_tilde XK_combining_grave \ XK_combining_acute XK_combining_hook \ XK_combining_belowdot XK_EcuSign XK_ColonSign \ XK_CruzeiroSign XK_FFrancSign XK_LiraSign \ XK_MillSign XK_NairaSign XK_PesetaSign \ XK_RupeeSign XK_WonSign XK_NewSheqelSign \ XK_DongSign XK_EuroSign " #include syn keyword xmodmapKeySym SunXK_Sys_Req SunXK_Print_Screen SunXK_Compose \ SunXK_AltGraph SunXK_PageUp SunXK_PageDown \ SunXK_Undo SunXK_Again SunXK_Find SunXK_Stop \ SunXK_Props SunXK_Front SunXK_Copy SunXK_Open \ SunXK_Paste SunXK_Cut SunXK_PowerSwitch \ SunXK_AudioLowerVolume SunXK_AudioMute \ SunXK_AudioRaiseVolume SunXK_VideoDegauss \ SunXK_VideoLowerBrightness \ SunXK_VideoRaiseBrightness \ SunXK_PowerSwitchShift " #include syn keyword xmodmapKeySym XF86XK_ModeLock XF86XK_Standby \ XF86XK_AudioLowerVolume XF86XK_AudioMute \ XF86XK_AudioRaiseVolume XF86XK_AudioPlay \ XF86XK_AudioStop XF86XK_AudioPrev \ XF86XK_AudioNext XF86XK_HomePage \ XF86XK_Mail XF86XK_Start XF86XK_Search \ XF86XK_AudioRecord XF86XK_Calculator \ XF86XK_Memo XF86XK_ToDoList XF86XK_Calendar \ XF86XK_PowerDown XF86XK_ContrastAdjust \ XF86XK_RockerUp XF86XK_RockerDown \ XF86XK_RockerEnter XF86XK_Back XF86XK_Forward \ XF86XK_Stop XF86XK_Refresh XF86XK_PowerOff \ XF86XK_WakeUp XF86XK_Eject XF86XK_ScreenSaver \ XF86XK_WWW XF86XK_Sleep XF86XK_Favorites \ XF86XK_AudioPause XF86XK_AudioMedia \ XF86XK_MyComputer XF86XK_VendorHome \ XF86XK_LightBulb XF86XK_Shop XF86XK_History \ XF86XK_OpenURL XF86XK_AddFavorite \ XF86XK_HotLinks XF86XK_BrightnessAdjust \ XF86XK_Finance XF86XK_Community \ XF86XK_AudioRewind XF86XK_XF86BackForward \ XF86XK_Launch0 XF86XK_Launch1 XF86XK_Launch2 \ XF86XK_Launch3 XF86XK_Launch4 XF86XK_Launch5 \ XF86XK_Launch6 XF86XK_Launch7 XF86XK_Launch8 \ XF86XK_Launch9 XF86XK_LaunchA XF86XK_LaunchB \ XF86XK_LaunchC XF86XK_LaunchD XF86XK_LaunchE \ XF86XK_LaunchF XF86XK_ApplicationLeft \ XF86XK_ApplicationRight XF86XK_Book \ XF86XK_CD XF86XK_Calculater XF86XK_Clear \ XF86XK_Close XF86XK_Copy XF86XK_Cut \ XF86XK_Display XF86XK_DOS XF86XK_Documents \ XF86XK_Excel XF86XK_Explorer XF86XK_Game \ XF86XK_Go XF86XK_iTouch XF86XK_LogOff \ XF86XK_Market XF86XK_Meeting XF86XK_MenuKB \ XF86XK_MenuPB XF86XK_MySites XF86XK_New \ XF86XK_News XF86XK_OfficeHome XF86XK_Open \ XF86XK_Option XF86XK_Paste XF86XK_Phone \ XF86XK_Q XF86XK_Reply XF86XK_Reload \ XF86XK_RotateWindows XF86XK_RotationPB \ XF86XK_RotationKB XF86XK_Save XF86XK_ScrollUp \ XF86XK_ScrollDown XF86XK_ScrollClick \ XF86XK_Send XF86XK_Spell XF86XK_SplitScreen \ XF86XK_Support XF86XK_TaskPane XF86XK_Terminal \ XF86XK_Tools XF86XK_Travel XF86XK_UserPB \ XF86XK_User1KB XF86XK_User2KB XF86XK_Video \ XF86XK_WheelButton XF86XK_Word XF86XK_Xfer \ XF86XK_ZoomIn XF86XK_ZoomOut XF86XK_Away \ XF86XK_Messenger XF86XK_WebCam \ XF86XK_MailForward XF86XK_Pictures \ XF86XK_Music XF86XK_Switch_VT_1 \ XF86XK_Switch_VT_2 XF86XK_Switch_VT_3 \ XF86XK_Switch_VT_4 XF86XK_Switch_VT_5 \ XF86XK_Switch_VT_6 XF86XK_Switch_VT_7 \ XF86XK_Switch_VT_8 XF86XK_Switch_VT_9 \ XF86XK_Switch_VT_10 XF86XK_Switch_VT_11 \ XF86XK_Switch_VT_12 XF86XK_Ungrab \ XF86XK_ClearGrab XF86XK_Next_VMode \ XF86XK_Prev_VMode syn keyword xmodmapKeyword keycode keysym clear add remove pointer hi def link xmodmapComment Comment hi def link xmodmapTodo Todo hi def link xmodmapInt Number hi def link xmodmapHex Number hi def link xmodmapOctal Number hi def link xmodmapOctalError Error hi def link xmodmapKeySym Constant hi def link xmodmapKeyword Keyword let b:current_syntax = "xmodmap" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/syntax/xpm.vim000066400000000000000000000110571267703067000171330ustar00rootroot00000000000000" Vim syntax file " Language: X Pixmap " Maintainer: Ronald Schild " Last Change: 2008 May 28 " 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', '') if cpp =~ '[^0-9]' break " if cpp is not made of digits there must be something wrong endif " Highlight the Values string as normal string (no pixel string). " Only when there is no slash, it would terminate the pattern. if s !~ '/' exe 'syn match xpmValues /' . s . '/' endif hi link xpmValues String let n = 1 " n = color index elseif n <= colors " string is a color specification " get chars = 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' elseif color !~ "'" 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 else command -nargs=+ HiLink hi def link 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: vim-7.4.1689/runtime/syntax/xpm2.vim000066400000000000000000000115731267703067000172200ustar00rootroot00000000000000" Vim syntax file " Language: X Pixmap v2 " Maintainer: Steve Wall (hitched97@velnet.com) " Last Change: 2012 Jun 01 " (Dominique Pelle added @Spell) " Version: 5.8 " " Made from xpm.vim by Ronald Schild " For version 5.x: Clear all syntax items " 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:cpo_save = &cpo set cpo&vim syn region xpm2PixelString start="^" end="$" contains=@xpm2Colors syn keyword xpm2Todo TODO FIXME XXX contained syn match xpm2Comment "\!.*$" contains=@Spell,xpm2Todo if version < 508 command -nargs=+ HiLink hi link command -nargs=+ Hi hi else command -nargs=+ HiLink hi def link command -nargs=+ Hi hi def 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', '') if cpp =~ '[^0-9]' break " if cpp is not made of digits there must be something wrong endif " Highlight the Values string as normal string (no pixel string). " Only when there is no slash, it would terminate the pattern. if s !~ '/' exe 'syn match xpm2Values /' . s . '/' endif HiLink xpm2Values Statement let n = 1 " n = color index elseif n <= colors " string is a color specification " get chars = 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' elseif color !~ "'" 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" let &cpo = s:cpo_save unlet s:cpo_save " vim: ts=8:sw=2:noet: vim-7.4.1689/runtime/syntax/xquery.vim000066400000000000000000000160271267703067000176660ustar00rootroot00000000000000" Vim syntax file " Language: XQuery " Author: René Neumann " Author: Steve Spigarelli " Original Author: Jean-Marc Vanel " Last Change: mar jui 12 18:04:05 CEST 2005 " Filenames: *.xq " URL: http://jmvanel.free.fr/vim/xquery.vim " REFERENCES: " [1] http://www.w3.org/TR/xquery/ " Quit when a syntax file was already loaded if exists("b:current_syntax") finish endif " - is allowed in keywords setlocal iskeyword+=- runtime syntax/xml.vim syn case match " From XQuery grammar: syn keyword xqStatement ancestor ancestor-or-self and as ascending at attribute base-uri boundary-space by case cast castable child collation construction declare default descendant descendant-or-self descending div document element else empty encoding eq every except external following following-sibling for function ge greatest gt idiv if import in inherit-namespaces instance intersect is le least let lt mod module namespace ne no of or order ordered ordering parent preceding preceding-sibling preserve return satisfies schema self some stable strip then to treat typeswitch union unordered validate variable version where xmlspace xquery yes " TODO contains clashes with vim keyword syn keyword xqFunction abs adjust-date-to-timezone adjust-date-to-timezone adjust-dateTime-to-timezone adjust-dateTime-to-timezone adjust-time-to-timezone adjust-time-to-timezone avg base-uri base-uri boolean ceiling codepoint-equal codepoints-to-string collection collection compare concat count current-date current-dateTime current-time data dateTime day-from-date day-from-dateTime days-from-duration deep-equal deep-equal default-collation distinct-values distinct-values doc doc-available document-uri empty ends-with ends-with error error error error escape-uri exactly-one exists false floor hours-from-dateTime hours-from-duration hours-from-time id id idref idref implicit-timezone in-scope-prefixes index-of index-of insert-before lang lang last local-name local-name local-name-from-QName lower-case matches matches max max min min minutes-from-dateTime minutes-from-duration minutes-from-time month-from-date month-from-dateTime months-from-duration name name namespace-uri namespace-uri namespace-uri-for-prefix namespace-uri-from-QName nilled node-name normalize-space normalize-space normalize-unicode normalize-unicode not number number one-or-more position prefix-from-QName QName remove replace replace resolve-QName resolve-uri resolve-uri reverse root root round round-half-to-even round-half-to-even seconds-from-dateTime seconds-from-duration seconds-from-time starts-with starts-with static-base-uri string string string-join string-length string-length string-to-codepoints subsequence subsequence substring substring substring-after substring-after substring-before substring-before sum sum timezone-from-date timezone-from-dateTime timezone-from-time tokenize tokenize trace translate true unordered upper-case year-from-date year-from-dateTime years-from-duration zero-or-one syn keyword xqOperator add-dayTimeDuration-to-date add-dayTimeDuration-to-dateTime add-dayTimeDuration-to-time add-dayTimeDurations add-yearMonthDuration-to-date add-yearMonthDuration-to-dateTime add-yearMonthDurations base64Binary-equal boolean-equal boolean-greater-than boolean-less-than concatenate date-equal date-greater-than date-less-than dateTime-equal dateTime-greater-than dateTime-less-than dayTimeDuration-equal dayTimeDuration-greater-than dayTimeDuration-less-than divide-dayTimeDuration divide-dayTimeDuration-by-dayTimeDuration divide-yearMonthDuration divide-yearMonthDuration-by-yearMonthDuration except gDay-equal gMonth-equal gMonthDay-equal gYear-equal gYearMonth-equal hexBinary-equal intersect is-same-node multiply-dayTimeDuration multiply-yearMonthDuration node-after node-before NOTATION-equal numeric-add numeric-divide numeric-equal numeric-greater-than numeric-integer-divide numeric-less-than numeric-mod numeric-multiply numeric-subtract numeric-unary-minus numeric-unary-plus QName-equal subtract-dates-yielding-dayTimeDuration subtract-dateTimes-yielding-dayTimeDuration subtract-dayTimeDuration-from-date subtract-dayTimeDuration-from-dateTime subtract-dayTimeDuration-from-time subtract-dayTimeDurations subtract-times subtract-yearMonthDuration-from-date subtract-yearMonthDuration-from-dateTime subtract-yearMonthDurations time-equal time-greater-than time-less-than to union yearMonthDuration-equal yearMonthDuration-greater-than yearMonthDuration-less-than syn match xqType "xs:\(\|Datatype\|primitive\|string\|boolean\|float\|double\|decimal\|duration\|dateTime\|time\|date\|gYearMonth\|gYear\|gMonthDay\|gDay\|gMonth\|hexBinary\|base64Binary\|anyURI\|QName\|NOTATION\|\|normalizedString\|token\|language\|IDREFS\|ENTITIES\|NMTOKEN\|NMTOKENS\|Name\|NCName\|ID\|IDREF\|ENTITY\|integer\|nonPositiveInteger\|negativeInteger\|long\|int\|short\|byte\|nonNegativeInteger\|unsignedLong\|unsignedInt\|unsignedShort\|unsignedByte\|positiveInteger\)" " From XPath grammar: syn keyword xqXPath some every in in satisfies if then else to div idiv mod union intersect except instance of treat castable cast eq ne lt le gt ge is child descendant attribute self descendant-or-self following-sibling following namespace parent ancestor preceding-sibling preceding ancestor-or-self void item node document-node text comment processing-instruction attribute schema-attribute schema-element " eXist extensions syn match xqExist "&=" " XQdoc syn match XQdoc contained "@\(param\|return\|author\)\>" " floating point number, with dot, optional exponent syn match xqFloat "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=" " floating point number, starting with a dot, optional exponent syn match xqFloat "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>" " floating point number, without dot, with exponent syn match xqFloat "\d\+e[-+]\=\d\+[fl]\=\>" syn match xqNumber "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>" syn match xqNumber "\<\d\+\>" syn region xqString start=+\z(['"]\)+ skip=+\\.+ end=+\z1+ syn region xqComment start='(:' excludenl end=':)' contains=XQdoc syn match xqVariable "$\<[a-zA-Z:_][-.0-9a-zA-Z0-9:_]*\>" syn match xqSeparator ",\|;" syn region xqCode transparent contained start='{' excludenl end='}' contains=xqFunction,xqCode,xmlRegionBis,xqComment,xqStatement,xmlString,xqSeparator,xqNumber,xqVariable,xqString keepend extend syn region xmlRegionBis start=+<\z([^ /!?<>"']\+\)+ skip=++ end=++ end=+/>+ fold contains=xmlTag,xmlEndTag,xmlCdata,xmlRegionBis,xmlComment,xmlEntity,xmlProcessing,xqCode keepend extend hi def link xqNumber Number hi def link xqFloat Number hi def link xqString String hi def link xqVariable Identifier hi def link xqComment Comment hi def link xqSeparator Operator hi def link xqStatement Statement hi def link xqFunction Function hi def link xqOperator Operator hi def link xqType Type hi def link xqXPath Operator hi def link XQdoc Special hi def link xqExist Operator " override the xml highlighting "hi link xmlTag Structure "hi link xmlTagName Structure "hi link xmlEndTag Structure let b:current_syntax = "xquery" vim-7.4.1689/runtime/syntax/xs.vim000066400000000000000000006551431267703067000167730ustar00rootroot00000000000000" Vim syntax file " Language: XS (Perl extension interface language) " Author: Autogenerated from perl headers, on an original basis of Michael W. Dodge " Maintainer: vim-perl " Previous: Vincent Pit " Last Change: 2013-05-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 " Read the C syntax to start with if version < 600 source :p:h/c.vim else runtime! syntax/c.vim endif let xs_superseded = 1 " mark C functions superseded by Perl replacements let xs_not_core = 1 " mark private core functions if exists("xs_superseded") && xs_superseded syn keyword xsSuperseded atof atol calloc clearerr exit fclose feof ferror syn keyword xsSuperseded fflush fgetc fgetpos fgets fopen fprintf fputc fputs syn keyword xsSuperseded fread free freopen fseek fsetpos fwrite getc getenv syn keyword xsSuperseded isalnum isalpha iscntrl isdigit isgraph islower syn keyword xsSuperseded isprint ispunct isspace isupper isxdigit malloc syn keyword xsSuperseded memcpy memmove memset printf putc rand realloc syn keyword xsSuperseded rewind setenv sprintf srand stderr stdin stdout syn keyword xsSuperseded strcat strcmp strcpy strdup strlen strncat strncmp syn keyword xsSuperseded strncpy strstr strtod strtol strtoul system tolower syn keyword xsSuperseded toupper ungetc endif if exists("xs_not_core") && xs_not_core syn keyword xsPrivate F0convert Perl__add_range_to_invlist syn keyword xsPrivate Perl__core_swash_init Perl__invlist_contents syn keyword xsPrivate Perl__invlist_intersection_maybe_complement_2nd syn keyword xsPrivate Perl__invlist_invert Perl__invlist_invert_prop syn keyword xsPrivate Perl__invlist_populate_swatch syn keyword xsPrivate Perl__invlist_union_maybe_complement_2nd syn keyword xsPrivate Perl__is_utf8__perl_idstart Perl__new_invlist syn keyword xsPrivate Perl__swash_inversion_hash Perl__swash_to_invlist syn keyword xsPrivate Perl__to_fold_latin1 Perl_av_reify Perl_emulate_cop_io syn keyword xsPrivate Perl_find_rundefsvoffset Perl_get_re_arg syn keyword xsPrivate Perl_is_utf8_X_L Perl_is_utf8_X_LV Perl_is_utf8_X_LVT syn keyword xsPrivate Perl_is_utf8_X_LV_LVT_V Perl_is_utf8_X_T syn keyword xsPrivate Perl_is_utf8_X_V Perl_is_utf8_X_begin syn keyword xsPrivate Perl_is_utf8_X_extend Perl_is_utf8_X_non_hangul syn keyword xsPrivate Perl_is_utf8_X_prepend Perl_is_utf8_char syn keyword xsPrivate Perl_new_warnings_bitfield Perl_op_clear syn keyword xsPrivate Perl_ptr_table_clear Perl_qerror Perl_reg_named_buff syn keyword xsPrivate Perl_reg_named_buff_iter Perl_reg_numbered_buff_fetch syn keyword xsPrivate Perl_reg_numbered_buff_length syn keyword xsPrivate Perl_reg_numbered_buff_store Perl_reg_qr_package syn keyword xsPrivate Perl_reg_temp_copy Perl_regprop Perl_report_uninit syn keyword xsPrivate Perl_sv_compile_2op Perl_sv_setsv_cow syn keyword xsPrivate Perl_try_amagic_bin Perl_try_amagic_un syn keyword xsPrivate Perl_utf8_to_uvchr Perl_utf8_to_uvuni syn keyword xsPrivate Perl_vivify_defelem Perl_yylex S_F0convert S_Slab_to_rw syn keyword xsPrivate S__append_range_to_invlist S__new_invlist_C_array syn keyword xsPrivate S_add_alternate S_add_data S_add_utf16_textfilter syn keyword xsPrivate S_adjust_stack_on_leave S_amagic_cmp syn keyword xsPrivate S_amagic_cmp_locale S_amagic_i_ncmp S_amagic_ncmp syn keyword xsPrivate S_anonymise_cv_maybe S_ao S_apply_attrs syn keyword xsPrivate S_apply_attrs_my S_assert_uft8_cache_coherent syn keyword xsPrivate S_bad_type_pv S_bad_type_sv S_bytes_to_uni syn keyword xsPrivate S_check_locale_boundary_crossing S_check_type_and_open syn keyword xsPrivate S_check_uni S_checkcomma S_checkposixcc S_ckwarn_common syn keyword xsPrivate S_cl_and S_cl_anything S_cl_init S_cl_is_anything syn keyword xsPrivate S_cl_or S_clear_placeholders S_closest_cop S_cop_free syn keyword xsPrivate S_core_regclass_swash S_cr_textfilter S_curmad S_curse syn keyword xsPrivate S_cv_dump S_deb_curcv S_deb_stack_n S_debprof syn keyword xsPrivate S_debug_start_match S_del_sv syn keyword xsPrivate S_deprecate_commaless_var_list S_destroy_matcher syn keyword xsPrivate S_div128 S_do_chomp S_do_delete_local S_do_oddball syn keyword xsPrivate S_do_smartmatch S_do_trans_complex syn keyword xsPrivate S_do_trans_complex_utf8 S_do_trans_count syn keyword xsPrivate S_do_trans_count_utf8 S_do_trans_simple syn keyword xsPrivate S_do_trans_simple_utf8 S_docatch S_doeval S_dofindlabel syn keyword xsPrivate S_doform S_dooneliner S_doopen_pm S_doparseform syn keyword xsPrivate S_dopoptoeval S_dopoptogiven S_dopoptolabel syn keyword xsPrivate S_dopoptoloop S_dopoptosub_at S_dopoptowhen syn keyword xsPrivate S_dump_exec_pos S_dump_trie S_dump_trie_interim_list syn keyword xsPrivate S_dump_trie_interim_table S_dumpuntil S_dup_attrlist syn keyword xsPrivate S_exec_failed S_expect_number S_filter_gets syn keyword xsPrivate S_finalize_op S_find_and_forget_pmops syn keyword xsPrivate S_find_array_subscript S_find_beginning S_find_byclass syn keyword xsPrivate S_find_hash_subscript S_find_in_my_stash syn keyword xsPrivate S_find_uninit_var S_first_symbol S_fold_constants syn keyword xsPrivate S_forbid_setid S_force_ident S_force_list S_force_next syn keyword xsPrivate S_force_strict_version S_force_version S_force_word syn keyword xsPrivate S_forget_pmop S_gen_constant_list S_get_aux_mg syn keyword xsPrivate S_get_num S_glob_2number S_glob_assign_glob syn keyword xsPrivate S_glob_assign_ref S_grok_bslash_c S_grok_bslash_o syn keyword xsPrivate S_group_end S_gv_ename S_gv_get_super_pkg syn keyword xsPrivate S_gv_init_svtype S_gv_magicalize_isa syn keyword xsPrivate S_gv_magicalize_overload S_hfreeentries S_hsplit syn keyword xsPrivate S_hv_auxinit S_hv_delete_common S_hv_free_ent_ret syn keyword xsPrivate S_hv_magic_check S_hv_notallowed S_incline S_incpush syn keyword xsPrivate S_incpush_if_exists S_incpush_use_sep S_ingroup syn keyword xsPrivate S_init_ids S_init_interp S_init_main_stash syn keyword xsPrivate S_init_perllib S_init_postdump_symbols syn keyword xsPrivate S_init_predump_symbols S_inplace_aassign syn keyword xsPrivate S_intuit_method S_intuit_more S_invlist_extend syn keyword xsPrivate S_invlist_iternext S_invlist_search syn keyword xsPrivate S_invoke_exception_hook S_is_an_int syn keyword xsPrivate S_is_handle_constructor S_is_list_assignment syn keyword xsPrivate S_is_utf8_char_slow S_is_utf8_common S_isa_lookup syn keyword xsPrivate S_join_exact S_listkids S_looks_like_bool syn keyword xsPrivate S_magic_methcall1 S_make_matcher S_make_trie syn keyword xsPrivate S_make_trie_failtable S_matcher_matches_sv syn keyword xsPrivate S_mayberelocate S_measure_struct S_mem_log_common syn keyword xsPrivate S_mess_alloc S_method_common S_minus_v S_missingterm syn keyword xsPrivate S_modkids S_more_sv S_mro_clean_isarev syn keyword xsPrivate S_mro_gather_and_rename S_mro_get_linear_isa_dfs syn keyword xsPrivate S_mul128 S_mulexp10 S_my_exit_jump S_my_kid S_need_utf8 syn keyword xsPrivate S_newDEFSVOP S_newGIVWHENOP S_new_constant S_new_he syn keyword xsPrivate S_new_logop S_next_symbol S_nextchar syn keyword xsPrivate S_no_bareword_allowed S_no_fh_allowed S_no_op syn keyword xsPrivate S_not_a_number S_nuke_stacks S_num_overflow syn keyword xsPrivate S_open_script S_opt_scalarhv S_pack_rec syn keyword xsPrivate S_pad_alloc_name S_pad_check_dup S_pad_findlex syn keyword xsPrivate S_pad_reset S_parse_body S_path_is_absolute S_pidgone syn keyword xsPrivate S_pm_description S_pmtrans S_printbuf syn keyword xsPrivate S_process_special_blocks S_ptr_table_find S_put_byte syn keyword xsPrivate S_qsortsvu S_re_croak2 S_readpipe_override syn keyword xsPrivate S_ref_array_or_hash S_refcounted_he_value S_refkids syn keyword xsPrivate S_refto S_reg S_reg_check_named_buff_matched syn keyword xsPrivate S_reg_namedseq S_reg_node S_reg_recode S_reg_scan_name syn keyword xsPrivate S_reg_skipcomment S_reganode S_regatom S_regbranch syn keyword xsPrivate S_regclass S_regcppop S_regcppush S_regdump_extflags syn keyword xsPrivate S_reghop3 S_reghop4 S_reghopmaybe3 S_reginclass syn keyword xsPrivate S_reginsert S_regmatch S_regpiece S_regpposixcc syn keyword xsPrivate S_regrepeat S_regtail S_regtail_study S_regtry S_reguni syn keyword xsPrivate S_regwhite S_require_tie_mod S_restore_magic S_run_body syn keyword xsPrivate S_run_user_filter S_rxres_free S_rxres_restore syn keyword xsPrivate S_save_hek_flags S_save_lines S_save_magic syn keyword xsPrivate S_save_pushptri32ptr S_save_scalar_at S_scalar_mod_type syn keyword xsPrivate S_scalarboolean S_scalarkids S_scalarseq S_scan_commit syn keyword xsPrivate S_scan_const S_scan_formline S_scan_heredoc syn keyword xsPrivate S_scan_ident S_scan_inputsymbol S_scan_pat S_scan_str syn keyword xsPrivate S_scan_subst S_scan_trans S_scan_word S_search_const syn keyword xsPrivate S_sequence_num S_set_regclass_bit_fold syn keyword xsPrivate S_share_hek_flags S_simplify_sort S_skipspace syn keyword xsPrivate S_skipspace0 S_skipspace1 S_skipspace2 S_sortcv syn keyword xsPrivate S_sortcv_stacked S_sortcv_xsub syn keyword xsPrivate S_space_join_names_mortal S_start_force S_stdize_locale syn keyword xsPrivate S_strip_return S_study_chunk S_sublex_done syn keyword xsPrivate S_sublex_push S_sublex_start S_sv_2iuv_common syn keyword xsPrivate S_sv_2iuv_non_preserve S_sv_add_arena S_sv_dup_common syn keyword xsPrivate S_sv_dup_inc_multiple S_sv_exp_grow S_sv_i_ncmp syn keyword xsPrivate S_sv_ncmp S_sv_pos_b2u_midway S_sv_pos_u2b_cached syn keyword xsPrivate S_sv_pos_u2b_forwards S_sv_pos_u2b_midway syn keyword xsPrivate S_sv_release_COW S_swallow_bom S_swatch_get syn keyword xsPrivate S_to_byte_substr S_to_lower_latin1 S_to_utf8_substr syn keyword xsPrivate S_tokenize_use S_tokeq S_tokereport syn keyword xsPrivate S_too_few_arguments_pv S_too_few_arguments_sv syn keyword xsPrivate S_too_many_arguments_pv S_too_many_arguments_sv syn keyword xsPrivate S_uiv_2buf S_unpack_rec S_unreferenced_to_tmp_stack syn keyword xsPrivate S_unshare_hek_or_pvn S_unwind_handler_stack syn keyword xsPrivate S_update_debugger_info S_usage S_utf16_textfilter syn keyword xsPrivate S_utf8_mg_len_cache_update S_utf8_mg_pos_cache_update syn keyword xsPrivate S_validate_suid S_visit S_with_queued_errors syn keyword xsPrivate S_write_no_mem S_xmldump_attr S_yywarn Slab_to_rw syn keyword xsPrivate _add_range_to_invlist _append_range_to_invlist syn keyword xsPrivate _core_swash_init _invlist_array_init _invlist_contents syn keyword xsPrivate _invlist_intersection syn keyword xsPrivate _invlist_intersection_maybe_complement_2nd syn keyword xsPrivate _invlist_invert _invlist_invert_prop syn keyword xsPrivate _invlist_populate_swatch _invlist_subtract syn keyword xsPrivate _invlist_union _invlist_union_maybe_complement_2nd syn keyword xsPrivate _is_utf8__perl_idstart _new_invlist syn keyword xsPrivate _new_invlist_C_array _swash_inversion_hash syn keyword xsPrivate _swash_to_invlist _to_fold_latin1 add_alternate syn keyword xsPrivate add_cp_to_invlist add_data add_utf16_textfilter syn keyword xsPrivate adjust_stack_on_leave amagic_cmp amagic_cmp_locale syn keyword xsPrivate amagic_i_ncmp amagic_ncmp anonymise_cv_maybe ao syn keyword xsPrivate apply_attrs apply_attrs_my assert_uft8_cache_coherent syn keyword xsPrivate av_reify bad_type_pv bad_type_sv bytes_to_uni syn keyword xsPrivate check_locale_boundary_crossing check_type_and_open syn keyword xsPrivate check_uni checkcomma checkposixcc ckwarn_common cl_and syn keyword xsPrivate cl_anything cl_init cl_is_anything cl_or syn keyword xsPrivate clear_placeholders closest_cop cop_free syn keyword xsPrivate core_regclass_swash cr_textfilter curmad curse cv_dump syn keyword xsPrivate deb_curcv deb_stack_n debprof debug_start_match del_sv syn keyword xsPrivate deprecate_commaless_var_list destroy_matcher div128 syn keyword xsPrivate do_aexec do_chomp do_delete_local do_exec do_oddball syn keyword xsPrivate do_smartmatch do_trans_complex do_trans_complex_utf8 syn keyword xsPrivate do_trans_count do_trans_count_utf8 do_trans_simple syn keyword xsPrivate do_trans_simple_utf8 docatch doeval dofindlabel doform syn keyword xsPrivate dooneliner doopen_pm doparseform dopoptoeval syn keyword xsPrivate dopoptogiven dopoptolabel dopoptoloop dopoptosub_at syn keyword xsPrivate dopoptowhen dump_exec_pos dump_trie syn keyword xsPrivate dump_trie_interim_list dump_trie_interim_table syn keyword xsPrivate dumpuntil dup_attrlist exec_failed expect_number syn keyword xsPrivate filter_gets finalize_op find_and_forget_pmops syn keyword xsPrivate find_array_subscript find_beginning find_byclass syn keyword xsPrivate find_hash_subscript find_in_my_stash syn keyword xsPrivate find_rundefsvoffset find_uninit_var first_symbol syn keyword xsPrivate fold_constants forbid_setid force_ident force_list syn keyword xsPrivate force_next force_strict_version force_version syn keyword xsPrivate force_word gen_constant_list get_aux_mg syn keyword xsPrivate get_invlist_iter_addr get_invlist_len_addr syn keyword xsPrivate get_invlist_version_id_addr get_invlist_zero_addr syn keyword xsPrivate get_num glob_2number glob_assign_glob glob_assign_ref syn keyword xsPrivate grok_bslash_c grok_bslash_o group_end gv_ename syn keyword xsPrivate gv_get_super_pkg gv_init_svtype gv_magicalize_isa syn keyword xsPrivate gv_magicalize_overload hfreeentries hsplit hv_auxinit syn keyword xsPrivate hv_delete_common hv_free_ent_ret hv_magic_check syn keyword xsPrivate hv_notallowed incline incpush incpush_if_exists syn keyword xsPrivate incpush_use_sep ingroup init_ids init_interp syn keyword xsPrivate init_main_stash init_perllib init_postdump_symbols syn keyword xsPrivate init_predump_symbols inplace_aassign intuit_method syn keyword xsPrivate intuit_more invlist_array invlist_clone invlist_extend syn keyword xsPrivate invlist_iterinit invlist_iternext invlist_len syn keyword xsPrivate invlist_max invlist_search invlist_set_len invlist_trim syn keyword xsPrivate invoke_exception_hook is_an_int is_handle_constructor syn keyword xsPrivate is_list_assignment is_utf8_X_L is_utf8_X_LV syn keyword xsPrivate is_utf8_X_LVT is_utf8_X_LV_LVT_V is_utf8_X_T syn keyword xsPrivate is_utf8_X_V is_utf8_X_begin is_utf8_X_extend syn keyword xsPrivate is_utf8_X_non_hangul is_utf8_X_prepend is_utf8_char syn keyword xsPrivate is_utf8_char_slow is_utf8_common isa_lookup join_exact syn keyword xsPrivate listkids looks_like_bool magic_methcall1 make_matcher syn keyword xsPrivate make_trie make_trie_failtable matcher_matches_sv syn keyword xsPrivate mayberelocate measure_struct mem_log_common mess_alloc syn keyword xsPrivate method_common minus_v missingterm modkids more_sv syn keyword xsPrivate mro_clean_isarev mro_gather_and_rename syn keyword xsPrivate mro_get_linear_isa_dfs mul128 mulexp10 my_exit_jump syn keyword xsPrivate my_kid need_utf8 newDEFSVOP newGIVWHENOP new_he syn keyword xsPrivate new_logop next_symbol nextchar no_bareword_allowed syn keyword xsPrivate no_fh_allowed no_op not_a_number nuke_stacks syn keyword xsPrivate num_overflow op_clear open_script opt_scalarhv pack_rec syn keyword xsPrivate pad_alloc_name pad_check_dup pad_findlex pad_reset syn keyword xsPrivate parse_body path_is_absolute pidgone pm_description syn keyword xsPrivate pmtrans printbuf process_special_blocks ptr_table_clear syn keyword xsPrivate ptr_table_find put_byte qerror qsortsvu re_croak2 syn keyword xsPrivate readpipe_override ref_array_or_hash refcounted_he_value syn keyword xsPrivate refkids refto reg reg_check_named_buff_matched syn keyword xsPrivate reg_named_buff reg_named_buff_iter reg_namedseq syn keyword xsPrivate reg_node reg_numbered_buff_fetch syn keyword xsPrivate reg_numbered_buff_length reg_numbered_buff_store syn keyword xsPrivate reg_qr_package reg_recode reg_scan_name reg_skipcomment syn keyword xsPrivate reg_temp_copy reganode regatom regbranch regclass syn keyword xsPrivate regcppop regcppush regcurly regdump_extflags reghop3 syn keyword xsPrivate reghop4 reghopmaybe3 reginclass reginsert regmatch syn keyword xsPrivate regpiece regpposixcc regprop regrepeat regtail syn keyword xsPrivate regtail_study regtry reguni regwhite report_uninit syn keyword xsPrivate require_tie_mod restore_magic run_body run_user_filter syn keyword xsPrivate rxres_free rxres_restore save_hek_flags save_lines syn keyword xsPrivate save_magic save_pushptri32ptr save_scalar_at syn keyword xsPrivate scalar_mod_type scalarboolean scalarkids scalarseq syn keyword xsPrivate scan_commit scan_const scan_formline scan_heredoc syn keyword xsPrivate scan_ident scan_inputsymbol scan_pat scan_str syn keyword xsPrivate scan_subst scan_trans scan_word search_const syn keyword xsPrivate sequence_num set_regclass_bit set_regclass_bit_fold syn keyword xsPrivate share_hek_flags simplify_sort skipspace skipspace0 syn keyword xsPrivate skipspace1 skipspace2 sortcv sortcv_stacked sortcv_xsub syn keyword xsPrivate space_join_names_mortal start_force stdize_locale syn keyword xsPrivate strip_return study_chunk sublex_done sublex_push syn keyword xsPrivate sublex_start sv_2iuv_common sv_2iuv_non_preserve syn keyword xsPrivate sv_add_arena sv_compile_2op sv_dup_common syn keyword xsPrivate sv_dup_inc_multiple sv_exp_grow sv_i_ncmp sv_ncmp syn keyword xsPrivate sv_pos_b2u_midway sv_pos_u2b_cached sv_pos_u2b_forwards syn keyword xsPrivate sv_pos_u2b_midway sv_release_COW sv_setsv_cow syn keyword xsPrivate swallow_bom swatch_get to_byte_substr to_lower_latin1 syn keyword xsPrivate to_utf8_substr tokenize_use tokeq tokereport syn keyword xsPrivate too_few_arguments_pv too_few_arguments_sv syn keyword xsPrivate too_many_arguments_pv too_many_arguments_sv uiv_2buf syn keyword xsPrivate unpack_rec unreferenced_to_tmp_stack unshare_hek_or_pvn syn keyword xsPrivate unwind_handler_stack update_debugger_info usage syn keyword xsPrivate utf16_textfilter utf8_mg_len_cache_update syn keyword xsPrivate utf8_mg_pos_cache_update utf8_to_uvchr utf8_to_uvuni syn keyword xsPrivate visit vivify_defelem with_queued_errors write_no_mem syn keyword xsPrivate xmldump_attr yylex yywarn endif syn keyword xsType AMT AMTS ANY AV BHK BINOP BLOCK CHECKPOINT CLONE_PARAMS syn keyword xsType COP COPHH CV DB_Hash_t DB_Prefix_t DEBUG_t Direntry_t syn keyword xsType Fpos_t Free_t GP GV Gid_t Groups_t HE HEK HV I16 I32 I64 syn keyword xsType I8 IO IV Int64 JMPENV LISTOP LOGOP LOOP MADPROP MAGIC MGS syn keyword xsType MGVTBL Malloc_t Mmap_t Mode_t NEXTTOKE NV Netdb_hlen_t syn keyword xsType Netdb_host_t Netdb_name_t Netdb_net_t OP OPCODE OP_4tree syn keyword xsType Off_t Optype PAD PADLIST PADOFFSET PADOP PERL_CONTEXT syn keyword xsType PERL_SI PMOP PTR_TBL_ENT_t PTR_TBL_t PVOP PerlIO syn keyword xsType PerlIO_funcs PerlIO_list_s PerlIO_list_t PerlIOl syn keyword xsType PerlInterpreter Pid_t Quad_t REGEXP Rand_seed_t SSize_t syn keyword xsType STRLEN STRUCT_SV SUBLEXINFO SV SVOP Select_fd_set_t syn keyword xsType Shmat_t Signal_t Sigsave_t Size_t Sock_size_t Stat_t TM64 syn keyword xsType TOKEN Time64_T Time_t U16 U32 U64 U8 UNOP UV Uid_t Uquad_t syn keyword xsType XOP XPV XPVAV XPVBM XPVCV XPVFM XPVGV XPVHV XPVIO XPVIV syn keyword xsType XPVLV XPVMG XPVNV XPVUV Year _PerlIO _PerlIO_funcs syn keyword xsType _pMY_CXT _pTHX _reg_ac_data _reg_trie_data _reg_trie_state syn keyword xsType _reg_trie_trans _reg_trie_trans_list_elem _sublex_info syn keyword xsType _xhvnameu _xivu _xmgu _xnvu am_table am_table_short syn keyword xsType block_eval block_format block_givwhen block_hooks syn keyword xsType block_loop block_sub bool clone_params custom_op syn keyword xsType cv_flags_t expectation gccbug_semun line_t madprop magic syn keyword xsType mem_log_type mgvtbl mro_alg mro_meta my_cxt_t opcode p5rx syn keyword xsType pMY_CXT pMY_CXT_ pTHX pTHX_ padtidy_type perl_cond syn keyword xsType perl_debug_pad perl_key perl_memory_debug_header syn keyword xsType perl_mstats perl_mstats_t perl_mutex perl_os_thread syn keyword xsType perl_phase perl_vars perl_wait_queue pthread_addr_t syn keyword xsType ptr_tbl ptr_tbl_ent re_save_state refcounted_he syn keyword xsType reg_ac_data reg_data reg_substr_data reg_substr_datum syn keyword xsType reg_trie_data reg_trie_state reg_trie_trans syn keyword xsType reg_trie_trans_le regex_charset regnode regnode_1 syn keyword xsType regnode_2 regnode_2L regnode_charclass syn keyword xsType regnode_charclass_class regnode_string semun shared_he syn keyword xsType svtype thread_intern ufuncs xpv xpvav xpvcv xpvfm xpvgv syn keyword xsType xpvhv xpvhv_aux xpvio xpviv xpvlv xpvmg xpvnv xpvuv syn keyword xsType yytokentype syn keyword xsString IVdf NVef NVff NVgf SVf SVf256 SVf32 SVf_ UVof UVuf UVxf syn keyword xsConstant CXt_BLOCK CXt_EVAL CXt_FORMAT CXt_GIVEN CXt_LOOP_FOR syn keyword xsConstant CXt_LOOP_LAZYIV CXt_LOOP_LAZYSV CXt_LOOP_PLAIN syn keyword xsConstant CXt_NULL CXt_SUB CXt_SUBST CXt_WHEN FALSE G_ARRAY syn keyword xsConstant G_DISCARD G_EVAL G_FAKINGEVAL G_KEEPERR G_METHOD syn keyword xsConstant G_NOARGS G_NODEBUG G_SCALAR G_UNDEF_FILL G_VOID G_WANT syn keyword xsConstant G_WARN_ALL_MASK G_WARN_ALL_OFF G_WARN_ALL_ON syn keyword xsConstant G_WARN_OFF G_WARN_ON G_WARN_ONCE G_WRITING_TO_STDERR syn keyword xsConstant OA_AVREF OA_BASEOP OA_BASEOP_OR_UNOP OA_BINOP syn keyword xsConstant OA_CLASS_MASK OA_COP OA_CVREF OA_DANGEROUS OA_DEFGV syn keyword xsConstant OA_FILEREF OA_FILESTATOP OA_FOLDCONST OA_HVREF OA_LIST syn keyword xsConstant OA_LISTOP OA_LOGOP OA_LOOP OA_LOOPEXOP OA_MARK syn keyword xsConstant OA_OPTIONAL OA_OTHERINT OA_PADOP OA_PMOP syn keyword xsConstant OA_PVOP_OR_SVOP OA_RETSCALAR OA_SCALAR OA_SCALARREF syn keyword xsConstant OA_SVOP OA_TARGET OA_TARGLEX OA_UNOP OP_AASSIGN OP_ABS syn keyword xsConstant OP_ACCEPT OP_ADD OP_AEACH OP_AELEM OP_AELEMFAST syn keyword xsConstant OP_AELEMFAST_LEX OP_AKEYS OP_ALARM OP_AND OP_ANDASSIGN syn keyword xsConstant OP_ANONCODE OP_ANONHASH OP_ANONLIST OP_ASLICE OP_ATAN2 syn keyword xsConstant OP_AV2ARYLEN OP_AVALUES OP_BACKTICK OP_BIND OP_BINMODE syn keyword xsConstant OP_BIT_AND OP_BIT_OR OP_BIT_XOR OP_BLESS OP_BOOLKEYS syn keyword xsConstant OP_BREAK OP_CALLER OP_CHDIR OP_CHMOD OP_CHOMP OP_CHOP syn keyword xsConstant OP_CHOWN OP_CHR OP_CHROOT OP_CLOSE OP_CLOSEDIR syn keyword xsConstant OP_COMPLEMENT OP_CONCAT OP_COND_EXPR OP_CONNECT syn keyword xsConstant OP_CONST OP_CONTINUE OP_COREARGS OP_COS OP_CRYPT syn keyword xsConstant OP_CUSTOM OP_DBMCLOSE OP_DBMOPEN OP_DBSTATE OP_DEFINED syn keyword xsConstant OP_DELETE OP_DIE OP_DIVIDE OP_DOFILE OP_DOR syn keyword xsConstant OP_DORASSIGN OP_DUMP OP_EACH OP_EGRENT OP_EHOSTENT syn keyword xsConstant OP_ENETENT OP_ENTER OP_ENTEREVAL OP_ENTERGIVEN syn keyword xsConstant OP_ENTERITER OP_ENTERLOOP OP_ENTERSUB OP_ENTERTRY syn keyword xsConstant OP_ENTERWHEN OP_ENTERWRITE OP_EOF OP_EPROTOENT syn keyword xsConstant OP_EPWENT OP_EQ OP_ESERVENT OP_EXEC OP_EXISTS OP_EXIT syn keyword xsConstant OP_EXP OP_FC OP_FCNTL OP_FILENO OP_FLIP OP_FLOCK syn keyword xsConstant OP_FLOP OP_FORK OP_FORMLINE OP_FTATIME OP_FTBINARY syn keyword xsConstant OP_FTBLK OP_FTCHR OP_FTCTIME OP_FTDIR OP_FTEEXEC syn keyword xsConstant OP_FTEOWNED OP_FTEREAD OP_FTEWRITE OP_FTFILE OP_FTIS syn keyword xsConstant OP_FTLINK OP_FTMTIME OP_FTPIPE OP_FTREXEC OP_FTROWNED syn keyword xsConstant OP_FTRREAD OP_FTRWRITE OP_FTSGID OP_FTSIZE OP_FTSOCK syn keyword xsConstant OP_FTSUID OP_FTSVTX OP_FTTEXT OP_FTTTY OP_FTZERO OP_GE syn keyword xsConstant OP_GELEM OP_GETC OP_GETLOGIN OP_GETPEERNAME OP_GETPGRP syn keyword xsConstant OP_GETPPID OP_GETPRIORITY OP_GETSOCKNAME OP_GGRENT syn keyword xsConstant OP_GGRGID OP_GGRNAM OP_GHBYADDR OP_GHBYNAME syn keyword xsConstant OP_GHOSTENT OP_GLOB OP_GMTIME OP_GNBYADDR OP_GNBYNAME syn keyword xsConstant OP_GNETENT OP_GOTO OP_GPBYNAME OP_GPBYNUMBER syn keyword xsConstant OP_GPROTOENT OP_GPWENT OP_GPWNAM OP_GPWUID syn keyword xsConstant OP_GREPSTART OP_GREPWHILE OP_GSBYNAME OP_GSBYPORT syn keyword xsConstant OP_GSERVENT OP_GSOCKOPT OP_GT OP_GV OP_GVSV OP_HELEM syn keyword xsConstant OP_HEX OP_HINTSEVAL OP_HSLICE OP_INDEX OP_INT OP_IOCTL syn keyword xsConstant OP_ITER OP_I_ADD OP_I_DIVIDE OP_I_EQ OP_I_GE OP_I_GT syn keyword xsConstant OP_I_LE OP_I_LT OP_I_MODULO OP_I_MULTIPLY OP_I_NCMP syn keyword xsConstant OP_I_NE OP_I_NEGATE OP_I_POSTDEC OP_I_POSTINC syn keyword xsConstant OP_I_PREDEC OP_I_PREINC OP_I_SUBTRACT OP_JOIN OP_KEYS syn keyword xsConstant OP_KILL OP_LAST OP_LC OP_LCFIRST OP_LE OP_LEAVE syn keyword xsConstant OP_LEAVEEVAL OP_LEAVEGIVEN OP_LEAVELOOP OP_LEAVESUB syn keyword xsConstant OP_LEAVESUBLV OP_LEAVETRY OP_LEAVEWHEN OP_LEAVEWRITE syn keyword xsConstant OP_LEFT_SHIFT OP_LENGTH OP_LINESEQ OP_LINK OP_LIST syn keyword xsConstant OP_LISTEN OP_LOCALTIME OP_LOCK OP_LOG OP_LSLICE syn keyword xsConstant OP_LSTAT OP_LT OP_MAPSTART OP_MAPWHILE OP_MATCH syn keyword xsConstant OP_METHOD OP_METHOD_NAMED OP_MKDIR OP_MODULO OP_MSGCTL syn keyword xsConstant OP_MSGGET OP_MSGRCV OP_MSGSND OP_MULTIPLY OP_NCMP syn keyword xsConstant OP_NE OP_NEGATE OP_NEXT OP_NEXTSTATE OP_NOT OP_NULL syn keyword xsConstant OP_OCT OP_ONCE OP_OPEN OP_OPEN_DIR OP_OR OP_ORASSIGN syn keyword xsConstant OP_ORD OP_PACK OP_PADANY OP_PADAV OP_PADHV OP_PADSV syn keyword xsConstant OP_PIPE_OP OP_POP OP_POS OP_POSTDEC OP_POSTINC OP_POW syn keyword xsConstant OP_PREDEC OP_PREINC OP_PRINT OP_PROTOTYPE OP_PRTF syn keyword xsConstant OP_PUSH OP_PUSHMARK OP_PUSHRE OP_QR OP_QUOTEMETA syn keyword xsConstant OP_RAND OP_RANGE OP_RCATLINE OP_REACH OP_READ syn keyword xsConstant OP_READDIR OP_READLINE OP_READLINK OP_RECV OP_REDO syn keyword xsConstant OP_REF OP_REFGEN OP_REGCMAYBE OP_REGCOMP OP_REGCRESET syn keyword xsConstant OP_RENAME OP_REPEAT OP_REQUIRE OP_RESET OP_RETURN syn keyword xsConstant OP_REVERSE OP_REWINDDIR OP_RIGHT_SHIFT OP_RINDEX syn keyword xsConstant OP_RKEYS OP_RMDIR OP_RUNCV OP_RV2AV OP_RV2CV OP_RV2GV syn keyword xsConstant OP_RV2HV OP_RV2SV OP_RVALUES OP_SASSIGN OP_SAY syn keyword xsConstant OP_SCALAR OP_SCHOMP OP_SCHOP OP_SCMP OP_SCOPE OP_SEEK syn keyword xsConstant OP_SEEKDIR OP_SELECT OP_SEMCTL OP_SEMGET OP_SEMOP syn keyword xsConstant OP_SEND OP_SEQ OP_SETPGRP OP_SETPRIORITY OP_SGE syn keyword xsConstant OP_SGRENT OP_SGT OP_SHIFT OP_SHMCTL OP_SHMGET syn keyword xsConstant OP_SHMREAD OP_SHMWRITE OP_SHOSTENT OP_SHUTDOWN OP_SIN syn keyword xsConstant OP_SLE OP_SLEEP OP_SLT OP_SMARTMATCH OP_SNE OP_SNETENT syn keyword xsConstant OP_SOCKET OP_SOCKPAIR OP_SORT OP_SPLICE OP_SPLIT syn keyword xsConstant OP_SPRINTF OP_SPROTOENT OP_SPWENT OP_SQRT OP_SRAND syn keyword xsConstant OP_SREFGEN OP_SSELECT OP_SSERVENT OP_SSOCKOPT OP_STAT syn keyword xsConstant OP_STRINGIFY OP_STUB OP_STUDY OP_SUBST OP_SUBSTCONT syn keyword xsConstant OP_SUBSTR OP_SUBTRACT OP_SYMLINK OP_SYSCALL OP_SYSOPEN syn keyword xsConstant OP_SYSREAD OP_SYSSEEK OP_SYSTEM OP_SYSWRITE OP_TELL syn keyword xsConstant OP_TELLDIR OP_TIE OP_TIED OP_TIME OP_TMS OP_TRANS syn keyword xsConstant OP_TRANSR OP_TRUNCATE OP_UC OP_UCFIRST OP_UMASK syn keyword xsConstant OP_UNDEF OP_UNLINK OP_UNPACK OP_UNSHIFT OP_UNSTACK syn keyword xsConstant OP_UNTIE OP_UTIME OP_VALUES OP_VEC OP_WAIT OP_WAITPID syn keyword xsConstant OP_WANTARRAY OP_WARN OP_XOR OP_max OPf_KIDS OPf_KNOW syn keyword xsConstant OPf_LIST OPf_MOD OPf_PARENS OPf_REF OPf_SPECIAL syn keyword xsConstant OPf_STACKED OPf_WANT OPf_WANT_LIST OPf_WANT_SCALAR syn keyword xsConstant OPf_WANT_VOID OPpALLOW_FAKE OPpASSIGN_BACKWARDS syn keyword xsConstant OPpASSIGN_COMMON OPpASSIGN_CV_TO_GV OPpCONST_BARE syn keyword xsConstant OPpCONST_ENTERED OPpCONST_NOVER OPpCONST_SHORTCIRCUIT syn keyword xsConstant OPpCONST_STRICT OPpCONST_WARNING OPpCOREARGS_DEREF1 syn keyword xsConstant OPpCOREARGS_DEREF2 OPpCOREARGS_PUSHMARK syn keyword xsConstant OPpCOREARGS_SCALARMOD OPpDEREF OPpDEREF_AV OPpDEREF_HV syn keyword xsConstant OPpDEREF_SV OPpDONT_INIT_GV OPpEARLY_CV syn keyword xsConstant OPpENTERSUB_AMPER OPpENTERSUB_DB OPpENTERSUB_HASTARG syn keyword xsConstant OPpENTERSUB_INARGS OPpENTERSUB_LVAL_MASK syn keyword xsConstant OPpENTERSUB_NOPAREN OPpEVAL_BYTES OPpEVAL_COPHH syn keyword xsConstant OPpEVAL_HAS_HH OPpEVAL_UNICODE OPpEXISTS_SUB syn keyword xsConstant OPpEXIT_VMSISH OPpFLIP_LINENUM OPpFT_ACCESS syn keyword xsConstant OPpFT_AFTER_t OPpFT_STACKED OPpFT_STACKING OPpGREP_LEX syn keyword xsConstant OPpHUSH_VMSISH OPpITER_DEF OPpITER_REVERSED syn keyword xsConstant OPpLIST_GUESSED OPpLVAL_DEFER OPpLVAL_INTRO syn keyword xsConstant OPpMAYBE_LVSUB OPpMAY_RETURN_CONSTANT OPpOFFBYONE syn keyword xsConstant OPpOPEN_IN_CRLF OPpOPEN_IN_RAW OPpOPEN_OUT_CRLF syn keyword xsConstant OPpOPEN_OUT_RAW OPpOUR_INTRO OPpPAD_STATE syn keyword xsConstant OPpPV_IS_UTF8 OPpREFCOUNTED OPpREPEAT_DOLIST syn keyword xsConstant OPpREVERSE_INPLACE OPpRUNTIME OPpSLICE OPpSORT_DESCEND syn keyword xsConstant OPpSORT_INPLACE OPpSORT_INTEGER OPpSORT_NUMERIC syn keyword xsConstant OPpSORT_QSORT OPpSORT_REVERSE OPpSORT_STABLE syn keyword xsConstant OPpSUBSTR_REPL_FIRST OPpTARGET_MY OPpTRANS_ALL syn keyword xsConstant OPpTRANS_COMPLEMENT OPpTRANS_DELETE OPpTRANS_FROM_UTF syn keyword xsConstant OPpTRANS_GROWS OPpTRANS_IDENTICAL OPpTRANS_SQUASH syn keyword xsConstant OPpTRANS_TO_UTF PERL_MAGIC_READONLY_ACCEPTABLE syn keyword xsConstant PERL_MAGIC_TYPE_IS_VALUE_MAGIC syn keyword xsConstant PERL_MAGIC_TYPE_READONLY_ACCEPTABLE syn keyword xsConstant PERL_MAGIC_UTF8_CACHESIZE PERL_MAGIC_VALUE_MAGIC syn keyword xsConstant PERL_MAGIC_VTABLE_MASK PERL_MAGIC_arylen syn keyword xsConstant PERL_MAGIC_arylen_p PERL_MAGIC_backref PERL_MAGIC_bm syn keyword xsConstant PERL_MAGIC_checkcall PERL_MAGIC_collxfrm syn keyword xsConstant PERL_MAGIC_dbfile PERL_MAGIC_dbline PERL_MAGIC_defelem syn keyword xsConstant PERL_MAGIC_env PERL_MAGIC_envelem PERL_MAGIC_ext syn keyword xsConstant PERL_MAGIC_fm PERL_MAGIC_hints PERL_MAGIC_hintselem syn keyword xsConstant PERL_MAGIC_isa PERL_MAGIC_isaelem PERL_MAGIC_nkeys syn keyword xsConstant PERL_MAGIC_overload PERL_MAGIC_overload_elem syn keyword xsConstant PERL_MAGIC_overload_table PERL_MAGIC_pos PERL_MAGIC_qr syn keyword xsConstant PERL_MAGIC_regdata PERL_MAGIC_regdatum syn keyword xsConstant PERL_MAGIC_regex_global PERL_MAGIC_rhash syn keyword xsConstant PERL_MAGIC_shared PERL_MAGIC_shared_scalar syn keyword xsConstant PERL_MAGIC_sig PERL_MAGIC_sigelem PERL_MAGIC_study syn keyword xsConstant PERL_MAGIC_substr PERL_MAGIC_sv PERL_MAGIC_symtab syn keyword xsConstant PERL_MAGIC_taint PERL_MAGIC_tied PERL_MAGIC_tiedelem syn keyword xsConstant PERL_MAGIC_tiedscalar PERL_MAGIC_utf8 PERL_MAGIC_uvar syn keyword xsConstant PERL_MAGIC_uvar_elem PERL_MAGIC_vec PERL_MAGIC_vstring syn keyword xsConstant REGEX_ASCII_MORE_RESTRICTED_CHARSET syn keyword xsConstant REGEX_ASCII_RESTRICTED_CHARSET REGEX_DEPENDS_CHARSET syn keyword xsConstant REGEX_LOCALE_CHARSET REGEX_UNICODE_CHARSET SVfARG syn keyword xsConstant SVf_AMAGIC SVf_BREAK SVf_FAKE SVf_IOK SVf_IVisUV syn keyword xsConstant SVf_NOK SVf_OK SVf_OOK SVf_POK SVf_READONLY SVf_ROK syn keyword xsConstant SVf_THINKFIRST SVf_UTF8 SVp_IOK SVp_NOK SVp_POK syn keyword xsConstant SVp_SCREAM SVpad_NAME SVpad_OUR SVpad_STATE syn keyword xsConstant SVpad_TYPED SVpav_REAL SVpav_REIFY SVpbm_TAIL syn keyword xsConstant SVpbm_VALID SVpgv_GP SVphv_CLONEABLE SVphv_HASKFLAGS syn keyword xsConstant SVphv_LAZYDEL SVphv_REHASH SVphv_SHAREKEYS syn keyword xsConstant SVprv_PCS_IMPORTED SVprv_WEAKREF SVs_GMG SVs_OBJECT syn keyword xsConstant SVs_PADMY SVs_PADSTALE SVs_PADTMP SVs_RMG SVs_SMG syn keyword xsConstant SVs_TEMP SVt_BIND SVt_IV SVt_LAST SVt_NULL SVt_NV syn keyword xsConstant SVt_PV SVt_PVAV SVt_PVBM SVt_PVCV SVt_PVFM SVt_PVGV syn keyword xsConstant SVt_PVHV SVt_PVIO SVt_PVIV SVt_PVLV SVt_PVMG SVt_PVNV syn keyword xsConstant SVt_REGEXP SVt_RV TRUE XATTRBLOCK XATTRTERM XBLOCK syn keyword xsConstant XOPERATOR XREF XSTATE XTERM XTERMBLOCK XTERMORDORDOR syn keyword xsConstant padtidy_FORMAT padtidy_SUB padtidy_SUBCLONE syn keyword xsException XCPT_CATCH XCPT_RETHROW XCPT_TRY_END XCPT_TRY_START syn keyword xsException dXCPT syn keyword xsKeyword ALIAS: BOOT: CASE: CLEANUP: CODE: C_ARGS: DISABLE syn keyword xsKeyword ENABLE FALLBACK: IN INCLUDE: INIT: INPUT: INTERFACE: syn keyword xsKeyword INTERFACE_MACRO: IN_OUT IN_OUTLIST MODULE NO_INIT: syn keyword xsKeyword NO_OUTPUT: OUT OUTLIST OUTPUT: OVERLOAD: PACKAGE syn keyword xsKeyword POSTCALL: PPCODE: PREFIX PREINIT: PROTOTYPE: syn keyword xsKeyword PROTOTYPES: REQUIRE: SCOPE: VERSIONCHECK: length syn keyword xsFunction GetVars Gv_AMupdate PerlIO_clearerr PerlIO_close syn keyword xsFunction PerlIO_eof PerlIO_error PerlIO_fileno PerlIO_fill syn keyword xsFunction PerlIO_flush PerlIO_get_base PerlIO_get_bufsiz syn keyword xsFunction PerlIO_get_cnt PerlIO_get_ptr PerlIO_read PerlIO_seek syn keyword xsFunction PerlIO_set_cnt PerlIO_set_ptrcnt PerlIO_setlinebuf syn keyword xsFunction PerlIO_stderr PerlIO_stdin PerlIO_stdout PerlIO_tell syn keyword xsFunction PerlIO_unread PerlIO_write Perl_GetVars syn keyword xsFunction Perl_Gv_AMupdate Perl_PerlIO_clearerr syn keyword xsFunction Perl_PerlIO_close Perl_PerlIO_context_layers syn keyword xsFunction Perl_PerlIO_eof Perl_PerlIO_error Perl_PerlIO_fileno syn keyword xsFunction Perl_PerlIO_fill Perl_PerlIO_flush syn keyword xsFunction Perl_PerlIO_get_base Perl_PerlIO_get_bufsiz syn keyword xsFunction Perl_PerlIO_get_cnt Perl_PerlIO_get_ptr syn keyword xsFunction Perl_PerlIO_read Perl_PerlIO_seek Perl_PerlIO_set_cnt syn keyword xsFunction Perl_PerlIO_set_ptrcnt Perl_PerlIO_setlinebuf syn keyword xsFunction Perl_PerlIO_stderr Perl_PerlIO_stdin syn keyword xsFunction Perl_PerlIO_stdout Perl_PerlIO_tell Perl_PerlIO_unread syn keyword xsFunction Perl_PerlIO_write Perl_Slab_Alloc Perl_Slab_Free syn keyword xsFunction Perl__is_utf8_quotemeta Perl__to_uni_fold_flags syn keyword xsFunction Perl__to_utf8_fold_flags Perl__to_utf8_lower_flags syn keyword xsFunction Perl__to_utf8_title_flags Perl__to_utf8_upper_flags syn keyword xsFunction Perl_amagic_call Perl_amagic_deref_call Perl_any_dup syn keyword xsFunction Perl_apply_attrs_string Perl_atfork_lock syn keyword xsFunction Perl_atfork_unlock Perl_av_arylen_p Perl_av_clear syn keyword xsFunction Perl_av_create_and_push Perl_av_create_and_unshift_one syn keyword xsFunction Perl_av_delete Perl_av_exists Perl_av_extend syn keyword xsFunction Perl_av_fetch Perl_av_fill Perl_av_iter_p Perl_av_len syn keyword xsFunction Perl_av_make Perl_av_pop Perl_av_push Perl_av_shift syn keyword xsFunction Perl_av_store Perl_av_undef Perl_av_unshift syn keyword xsFunction Perl_block_gimme Perl_blockhook_register syn keyword xsFunction Perl_bytes_cmp_utf8 Perl_bytes_from_utf8 syn keyword xsFunction Perl_bytes_to_utf8 Perl_call_argv Perl_call_atexit syn keyword xsFunction Perl_call_list Perl_call_method Perl_call_pv syn keyword xsFunction Perl_call_sv Perl_caller_cx Perl_calloc Perl_cast_i32 syn keyword xsFunction Perl_cast_iv Perl_cast_ulong Perl_cast_uv syn keyword xsFunction Perl_ck_entersub_args_list Perl_ck_entersub_args_proto syn keyword xsFunction Perl_ck_entersub_args_proto_or_list Perl_ck_warner syn keyword xsFunction Perl_ck_warner_d Perl_ckwarn Perl_ckwarn_d syn keyword xsFunction Perl_clone_params_del Perl_clone_params_new syn keyword xsFunction Perl_cop_fetch_label Perl_cop_store_label Perl_croak syn keyword xsFunction Perl_croak_no_modify Perl_croak_nocontext syn keyword xsFunction Perl_croak_sv Perl_croak_xs_usage Perl_csighandler syn keyword xsFunction Perl_custom_op_desc Perl_custom_op_name syn keyword xsFunction Perl_custom_op_register Perl_custom_op_xop syn keyword xsFunction Perl_cv_clone Perl_cv_const_sv syn keyword xsFunction Perl_cv_get_call_checker Perl_cv_set_call_checker syn keyword xsFunction Perl_cv_undef Perl_cx_dump Perl_cx_dup Perl_cxinc syn keyword xsFunction Perl_deb Perl_deb_nocontext Perl_debop syn keyword xsFunction Perl_debprofdump Perl_debstack Perl_debstackptrs syn keyword xsFunction Perl_delimcpy Perl_despatch_signals Perl_die syn keyword xsFunction Perl_die_nocontext Perl_die_sv Perl_dirp_dup syn keyword xsFunction Perl_do_aspawn Perl_do_binmode Perl_do_close syn keyword xsFunction Perl_do_gv_dump Perl_do_gvgv_dump Perl_do_hv_dump syn keyword xsFunction Perl_do_join Perl_do_magic_dump Perl_do_op_dump syn keyword xsFunction Perl_do_open9 Perl_do_openn Perl_do_pmop_dump syn keyword xsFunction Perl_do_spawn Perl_do_spawn_nowait Perl_do_sprintf syn keyword xsFunction Perl_do_sv_dump Perl_doing_taint Perl_doref syn keyword xsFunction Perl_dounwind Perl_dowantarray Perl_dump_all syn keyword xsFunction Perl_dump_eval Perl_dump_fds Perl_dump_form syn keyword xsFunction Perl_dump_indent Perl_dump_mstats Perl_dump_packsubs syn keyword xsFunction Perl_dump_sub Perl_dump_vindent Perl_eval_pv syn keyword xsFunction Perl_eval_sv Perl_fbm_compile Perl_fbm_instr syn keyword xsFunction Perl_filter_add Perl_filter_del Perl_filter_read syn keyword xsFunction Perl_find_runcv Perl_find_rundefsv Perl_foldEQ syn keyword xsFunction Perl_foldEQ_latin1 Perl_foldEQ_locale syn keyword xsFunction Perl_foldEQ_utf8_flags Perl_form Perl_form_nocontext syn keyword xsFunction Perl_fp_dup Perl_fprintf_nocontext syn keyword xsFunction Perl_free_global_struct Perl_free_tmps Perl_get_av syn keyword xsFunction Perl_get_context Perl_get_cv Perl_get_cvn_flags syn keyword xsFunction Perl_get_hv Perl_get_mstats Perl_get_op_descs syn keyword xsFunction Perl_get_op_names Perl_get_ppaddr Perl_get_sv syn keyword xsFunction Perl_get_vtbl Perl_getcwd_sv Perl_gp_dup Perl_gp_free syn keyword xsFunction Perl_gp_ref Perl_grok_bin Perl_grok_hex syn keyword xsFunction Perl_grok_number Perl_grok_numeric_radix Perl_grok_oct syn keyword xsFunction Perl_gv_add_by_type Perl_gv_autoload_pv syn keyword xsFunction Perl_gv_autoload_pvn Perl_gv_autoload_sv Perl_gv_check syn keyword xsFunction Perl_gv_const_sv Perl_gv_dump Perl_gv_efullname syn keyword xsFunction Perl_gv_efullname4 Perl_gv_fetchfile syn keyword xsFunction Perl_gv_fetchfile_flags Perl_gv_fetchmeth_pv syn keyword xsFunction Perl_gv_fetchmeth_pv_autoload Perl_gv_fetchmeth_pvn syn keyword xsFunction Perl_gv_fetchmeth_pvn_autoload Perl_gv_fetchmeth_sv syn keyword xsFunction Perl_gv_fetchmeth_sv_autoload syn keyword xsFunction Perl_gv_fetchmethod_autoload syn keyword xsFunction Perl_gv_fetchmethod_pv_flags syn keyword xsFunction Perl_gv_fetchmethod_pvn_flags syn keyword xsFunction Perl_gv_fetchmethod_sv_flags Perl_gv_fetchpv syn keyword xsFunction Perl_gv_fetchpvn_flags Perl_gv_fetchsv syn keyword xsFunction Perl_gv_fullname Perl_gv_fullname4 Perl_gv_handler syn keyword xsFunction Perl_gv_init_pv Perl_gv_init_pvn Perl_gv_init_sv syn keyword xsFunction Perl_gv_name_set Perl_gv_stashpv Perl_gv_stashpvn syn keyword xsFunction Perl_gv_stashsv Perl_he_dup Perl_hek_dup syn keyword xsFunction Perl_hv_assert Perl_hv_clear syn keyword xsFunction Perl_hv_clear_placeholders Perl_hv_common syn keyword xsFunction Perl_hv_common_key_len Perl_hv_copy_hints_hv syn keyword xsFunction Perl_hv_delayfree_ent Perl_hv_eiter_p syn keyword xsFunction Perl_hv_eiter_set Perl_hv_fill Perl_hv_free_ent syn keyword xsFunction Perl_hv_iterinit Perl_hv_iterkey Perl_hv_iterkeysv syn keyword xsFunction Perl_hv_iternext_flags Perl_hv_iternextsv syn keyword xsFunction Perl_hv_iterval Perl_hv_ksplit Perl_hv_name_set syn keyword xsFunction Perl_hv_placeholders_get Perl_hv_placeholders_p syn keyword xsFunction Perl_hv_placeholders_set Perl_hv_riter_p syn keyword xsFunction Perl_hv_riter_set Perl_hv_scalar syn keyword xsFunction Perl_init_global_struct Perl_init_i18nl10n syn keyword xsFunction Perl_init_i18nl14n Perl_init_stacks Perl_init_tm syn keyword xsFunction Perl_instr Perl_is_ascii_string Perl_is_lvalue_sub syn keyword xsFunction Perl_is_uni_alnum Perl_is_uni_alnum_lc syn keyword xsFunction Perl_is_uni_alpha Perl_is_uni_alpha_lc syn keyword xsFunction Perl_is_uni_ascii Perl_is_uni_ascii_lc syn keyword xsFunction Perl_is_uni_cntrl Perl_is_uni_cntrl_lc syn keyword xsFunction Perl_is_uni_digit Perl_is_uni_digit_lc syn keyword xsFunction Perl_is_uni_graph Perl_is_uni_graph_lc syn keyword xsFunction Perl_is_uni_idfirst Perl_is_uni_idfirst_lc syn keyword xsFunction Perl_is_uni_lower Perl_is_uni_lower_lc syn keyword xsFunction Perl_is_uni_print Perl_is_uni_print_lc syn keyword xsFunction Perl_is_uni_punct Perl_is_uni_punct_lc syn keyword xsFunction Perl_is_uni_space Perl_is_uni_space_lc syn keyword xsFunction Perl_is_uni_upper Perl_is_uni_upper_lc syn keyword xsFunction Perl_is_uni_xdigit Perl_is_uni_xdigit_lc syn keyword xsFunction Perl_is_utf8_alnum Perl_is_utf8_alpha syn keyword xsFunction Perl_is_utf8_ascii Perl_is_utf8_char_buf syn keyword xsFunction Perl_is_utf8_cntrl Perl_is_utf8_digit syn keyword xsFunction Perl_is_utf8_graph Perl_is_utf8_idcont syn keyword xsFunction Perl_is_utf8_idfirst Perl_is_utf8_lower syn keyword xsFunction Perl_is_utf8_mark Perl_is_utf8_perl_space syn keyword xsFunction Perl_is_utf8_perl_word Perl_is_utf8_posix_digit syn keyword xsFunction Perl_is_utf8_print Perl_is_utf8_punct syn keyword xsFunction Perl_is_utf8_space Perl_is_utf8_string syn keyword xsFunction Perl_is_utf8_string_loclen Perl_is_utf8_upper syn keyword xsFunction Perl_is_utf8_xdigit Perl_is_utf8_xidcont syn keyword xsFunction Perl_is_utf8_xidfirst Perl_leave_scope syn keyword xsFunction Perl_lex_bufutf8 Perl_lex_discard_to syn keyword xsFunction Perl_lex_grow_linestr Perl_lex_next_chunk syn keyword xsFunction Perl_lex_peek_unichar Perl_lex_read_space syn keyword xsFunction Perl_lex_read_to Perl_lex_read_unichar Perl_lex_start syn keyword xsFunction Perl_lex_stuff_pv Perl_lex_stuff_pvn Perl_lex_stuff_sv syn keyword xsFunction Perl_lex_unstuff Perl_load_module syn keyword xsFunction Perl_load_module_nocontext Perl_looks_like_number syn keyword xsFunction Perl_magic_dump Perl_malloc Perl_markstack_grow syn keyword xsFunction Perl_mess Perl_mess_nocontext Perl_mess_sv Perl_mfree syn keyword xsFunction Perl_mg_clear Perl_mg_copy Perl_mg_dup Perl_mg_find syn keyword xsFunction Perl_mg_findext Perl_mg_free Perl_mg_free_type syn keyword xsFunction Perl_mg_get Perl_mg_length Perl_mg_magical Perl_mg_set syn keyword xsFunction Perl_mg_size Perl_mini_mktime Perl_moreswitches syn keyword xsFunction Perl_mro_get_from_name Perl_mro_get_linear_isa syn keyword xsFunction Perl_mro_get_private_data Perl_mro_method_changed_in syn keyword xsFunction Perl_mro_register Perl_mro_set_mro syn keyword xsFunction Perl_mro_set_private_data Perl_my_atof Perl_my_atof2 syn keyword xsFunction Perl_my_bcopy Perl_my_bzero Perl_my_chsize syn keyword xsFunction Perl_my_cxt_index Perl_my_cxt_init Perl_my_dirfd syn keyword xsFunction Perl_my_exit Perl_my_failure_exit Perl_my_fflush_all syn keyword xsFunction Perl_my_fork Perl_my_htonl Perl_my_memcmp syn keyword xsFunction Perl_my_memset Perl_my_ntohl Perl_my_pclose syn keyword xsFunction Perl_my_popen Perl_my_popen_list Perl_my_setenv syn keyword xsFunction Perl_my_snprintf Perl_my_socketpair Perl_my_sprintf syn keyword xsFunction Perl_my_strftime Perl_my_strlcat Perl_my_strlcpy syn keyword xsFunction Perl_my_swap Perl_my_vsnprintf Perl_newANONATTRSUB syn keyword xsFunction Perl_newANONHASH Perl_newANONLIST Perl_newANONSUB syn keyword xsFunction Perl_newASSIGNOP Perl_newATTRSUB Perl_newAVREF syn keyword xsFunction Perl_newBINOP Perl_newCONDOP Perl_newCONSTSUB syn keyword xsFunction Perl_newCONSTSUB_flags Perl_newCVREF Perl_newFORM syn keyword xsFunction Perl_newFOROP Perl_newGIVENOP Perl_newGVOP syn keyword xsFunction Perl_newGVREF Perl_newGVgen_flags Perl_newHVREF syn keyword xsFunction Perl_newHVhv Perl_newLISTOP Perl_newLOGOP syn keyword xsFunction Perl_newLOOPEX Perl_newLOOPOP Perl_newMYSUB syn keyword xsFunction Perl_newNULLLIST Perl_newOP Perl_newPADOP Perl_newPMOP syn keyword xsFunction Perl_newPROG Perl_newPVOP Perl_newRANGE Perl_newRV syn keyword xsFunction Perl_newRV_noinc Perl_newSLICEOP Perl_newSTATEOP syn keyword xsFunction Perl_newSV Perl_newSVOP Perl_newSVREF Perl_newSV_type syn keyword xsFunction Perl_newSVhek Perl_newSViv Perl_newSVnv Perl_newSVpv syn keyword xsFunction Perl_newSVpv_share Perl_newSVpvf syn keyword xsFunction Perl_newSVpvf_nocontext Perl_newSVpvn syn keyword xsFunction Perl_newSVpvn_flags Perl_newSVpvn_share Perl_newSVrv syn keyword xsFunction Perl_newSVsv Perl_newSVuv Perl_newUNOP Perl_newWHENOP syn keyword xsFunction Perl_newWHILEOP Perl_newXS Perl_newXS_flags syn keyword xsFunction Perl_new_collate Perl_new_ctype Perl_new_numeric syn keyword xsFunction Perl_new_stackinfo Perl_new_version Perl_ninstr syn keyword xsFunction Perl_nothreadhook Perl_op_append_elem syn keyword xsFunction Perl_op_append_list Perl_op_contextualize Perl_op_dump syn keyword xsFunction Perl_op_free Perl_op_linklist Perl_op_null syn keyword xsFunction Perl_op_prepend_elem Perl_op_refcnt_lock syn keyword xsFunction Perl_op_refcnt_unlock Perl_op_scope Perl_pack_cat syn keyword xsFunction Perl_packlist Perl_pad_add_anon Perl_pad_add_name_pv syn keyword xsFunction Perl_pad_add_name_pvn Perl_pad_add_name_sv syn keyword xsFunction Perl_pad_alloc Perl_pad_compname_type syn keyword xsFunction Perl_pad_findmy_pv Perl_pad_findmy_pvn syn keyword xsFunction Perl_pad_findmy_sv Perl_pad_new Perl_pad_setsv syn keyword xsFunction Perl_pad_sv Perl_pad_tidy Perl_parse_arithexpr syn keyword xsFunction Perl_parse_barestmt Perl_parse_block syn keyword xsFunction Perl_parse_fullexpr Perl_parse_fullstmt syn keyword xsFunction Perl_parse_label Perl_parse_listexpr syn keyword xsFunction Perl_parse_stmtseq Perl_parse_termexpr Perl_parser_dup syn keyword xsFunction Perl_pmop_dump Perl_pop_scope Perl_pregcomp syn keyword xsFunction Perl_pregexec Perl_pregfree Perl_pregfree2 syn keyword xsFunction Perl_prescan_version Perl_printf_nocontext syn keyword xsFunction Perl_ptr_table_fetch Perl_ptr_table_free syn keyword xsFunction Perl_ptr_table_new Perl_ptr_table_split syn keyword xsFunction Perl_ptr_table_store Perl_push_scope Perl_pv_display syn keyword xsFunction Perl_pv_escape Perl_pv_pretty Perl_pv_uni_display syn keyword xsFunction Perl_re_compile Perl_re_dup_guts Perl_re_intuit_start syn keyword xsFunction Perl_re_intuit_string Perl_realloc Perl_reentrant_free syn keyword xsFunction Perl_reentrant_init Perl_reentrant_retry syn keyword xsFunction Perl_reentrant_size Perl_reg_named_buff_all syn keyword xsFunction Perl_reg_named_buff_exists Perl_reg_named_buff_fetch syn keyword xsFunction Perl_reg_named_buff_firstkey syn keyword xsFunction Perl_reg_named_buff_nextkey Perl_reg_named_buff_scalar syn keyword xsFunction Perl_regclass_swash Perl_regdump Perl_regdupe_internal syn keyword xsFunction Perl_regexec_flags Perl_regfree_internal syn keyword xsFunction Perl_reginitcolors Perl_regnext Perl_repeatcpy syn keyword xsFunction Perl_require_pv Perl_rninstr Perl_rsignal syn keyword xsFunction Perl_rsignal_state Perl_runops_debug syn keyword xsFunction Perl_runops_standard Perl_rv2cv_op_cv Perl_rvpv_dup syn keyword xsFunction Perl_safesyscalloc Perl_safesysfree Perl_safesysmalloc syn keyword xsFunction Perl_safesysrealloc Perl_save_I16 Perl_save_I32 syn keyword xsFunction Perl_save_I8 Perl_save_adelete Perl_save_aelem_flags syn keyword xsFunction Perl_save_alloc Perl_save_aptr Perl_save_ary syn keyword xsFunction Perl_save_bool Perl_save_clearsv Perl_save_delete syn keyword xsFunction Perl_save_destructor Perl_save_destructor_x syn keyword xsFunction Perl_save_generic_pvref Perl_save_generic_svref syn keyword xsFunction Perl_save_gp Perl_save_hash Perl_save_hdelete syn keyword xsFunction Perl_save_helem_flags Perl_save_hints Perl_save_hptr syn keyword xsFunction Perl_save_int Perl_save_item Perl_save_iv syn keyword xsFunction Perl_save_list Perl_save_long Perl_save_nogv syn keyword xsFunction Perl_save_padsv_and_mortalize Perl_save_pptr syn keyword xsFunction Perl_save_pushi32ptr Perl_save_pushptr syn keyword xsFunction Perl_save_pushptrptr Perl_save_re_context syn keyword xsFunction Perl_save_scalar Perl_save_set_svflags syn keyword xsFunction Perl_save_shared_pvref Perl_save_sptr Perl_save_svref syn keyword xsFunction Perl_save_vptr Perl_savepv Perl_savepvn syn keyword xsFunction Perl_savesharedpv Perl_savesharedpvn syn keyword xsFunction Perl_savesharedsvpv Perl_savestack_grow syn keyword xsFunction Perl_savestack_grow_cnt Perl_savesvpv Perl_scan_bin syn keyword xsFunction Perl_scan_hex Perl_scan_num Perl_scan_oct syn keyword xsFunction Perl_scan_version Perl_scan_vstring Perl_screaminstr syn keyword xsFunction Perl_seed Perl_set_context Perl_set_numeric_local syn keyword xsFunction Perl_set_numeric_radix Perl_set_numeric_standard syn keyword xsFunction Perl_setdefout Perl_share_hek Perl_si_dup Perl_sortsv syn keyword xsFunction Perl_sortsv_flags Perl_ss_dup Perl_stack_grow syn keyword xsFunction Perl_start_subparse Perl_stashpv_hvname_match syn keyword xsFunction Perl_str_to_version Perl_sv_2bool_flags Perl_sv_2cv syn keyword xsFunction Perl_sv_2io Perl_sv_2iv_flags Perl_sv_2mortal syn keyword xsFunction Perl_sv_2nv_flags Perl_sv_2pv_flags Perl_sv_2pvbyte syn keyword xsFunction Perl_sv_2pvutf8 Perl_sv_2uv_flags Perl_sv_backoff syn keyword xsFunction Perl_sv_bless Perl_sv_cat_decode Perl_sv_catpv syn keyword xsFunction Perl_sv_catpv_flags Perl_sv_catpv_mg Perl_sv_catpvf syn keyword xsFunction Perl_sv_catpvf_mg Perl_sv_catpvf_mg_nocontext syn keyword xsFunction Perl_sv_catpvf_nocontext Perl_sv_catpvn_flags syn keyword xsFunction Perl_sv_catsv_flags Perl_sv_chop Perl_sv_clear syn keyword xsFunction Perl_sv_cmp Perl_sv_cmp_flags Perl_sv_cmp_locale syn keyword xsFunction Perl_sv_cmp_locale_flags Perl_sv_collxfrm_flags syn keyword xsFunction Perl_sv_copypv Perl_sv_dec Perl_sv_dec_nomg syn keyword xsFunction Perl_sv_derived_from Perl_sv_derived_from_pv syn keyword xsFunction Perl_sv_derived_from_pvn Perl_sv_derived_from_sv syn keyword xsFunction Perl_sv_destroyable Perl_sv_does Perl_sv_does_pv syn keyword xsFunction Perl_sv_does_pvn Perl_sv_does_sv Perl_sv_dump syn keyword xsFunction Perl_sv_dup Perl_sv_dup_inc Perl_sv_eq_flags syn keyword xsFunction Perl_sv_force_normal_flags Perl_sv_free Perl_sv_gets syn keyword xsFunction Perl_sv_grow Perl_sv_inc Perl_sv_inc_nomg syn keyword xsFunction Perl_sv_insert_flags Perl_sv_isa Perl_sv_isobject syn keyword xsFunction Perl_sv_iv Perl_sv_len Perl_sv_len_utf8 Perl_sv_magic syn keyword xsFunction Perl_sv_magicext Perl_sv_mortalcopy Perl_sv_newmortal syn keyword xsFunction Perl_sv_newref Perl_sv_nosharing Perl_sv_nounlocking syn keyword xsFunction Perl_sv_nv Perl_sv_peek Perl_sv_pos_b2u syn keyword xsFunction Perl_sv_pos_u2b Perl_sv_pos_u2b_flags Perl_sv_pvbyten syn keyword xsFunction Perl_sv_pvbyten_force Perl_sv_pvn syn keyword xsFunction Perl_sv_pvn_force_flags Perl_sv_pvn_nomg syn keyword xsFunction Perl_sv_pvutf8n Perl_sv_pvutf8n_force syn keyword xsFunction Perl_sv_recode_to_utf8 Perl_sv_reftype Perl_sv_replace syn keyword xsFunction Perl_sv_report_used Perl_sv_reset Perl_sv_rvweaken syn keyword xsFunction Perl_sv_setiv Perl_sv_setiv_mg Perl_sv_setnv syn keyword xsFunction Perl_sv_setnv_mg Perl_sv_setpv Perl_sv_setpv_mg syn keyword xsFunction Perl_sv_setpvf Perl_sv_setpvf_mg syn keyword xsFunction Perl_sv_setpvf_mg_nocontext Perl_sv_setpvf_nocontext syn keyword xsFunction Perl_sv_setpviv Perl_sv_setpviv_mg Perl_sv_setpvn syn keyword xsFunction Perl_sv_setpvn_mg Perl_sv_setref_iv Perl_sv_setref_nv syn keyword xsFunction Perl_sv_setref_pv Perl_sv_setref_pvn Perl_sv_setref_uv syn keyword xsFunction Perl_sv_setsv_flags Perl_sv_setsv_mg Perl_sv_setuv syn keyword xsFunction Perl_sv_setuv_mg Perl_sv_tainted Perl_sv_true syn keyword xsFunction Perl_sv_uni_display Perl_sv_unmagic Perl_sv_unmagicext syn keyword xsFunction Perl_sv_unref_flags Perl_sv_untaint Perl_sv_upgrade syn keyword xsFunction Perl_sv_usepvn_flags Perl_sv_utf8_decode syn keyword xsFunction Perl_sv_utf8_downgrade Perl_sv_utf8_encode syn keyword xsFunction Perl_sv_utf8_upgrade_flags_grow Perl_sv_uv syn keyword xsFunction Perl_sv_vcatpvf Perl_sv_vcatpvf_mg Perl_sv_vcatpvfn syn keyword xsFunction Perl_sv_vsetpvf Perl_sv_vsetpvf_mg Perl_sv_vsetpvfn syn keyword xsFunction Perl_swash_fetch Perl_swash_init Perl_sys_init syn keyword xsFunction Perl_sys_init3 Perl_sys_intern_clear syn keyword xsFunction Perl_sys_intern_dup Perl_sys_intern_init Perl_sys_term syn keyword xsFunction Perl_taint_env Perl_taint_proper Perl_tmps_grow syn keyword xsFunction Perl_to_uni_lower Perl_to_uni_lower_lc syn keyword xsFunction Perl_to_uni_title Perl_to_uni_title_lc syn keyword xsFunction Perl_to_uni_upper Perl_to_uni_upper_lc syn keyword xsFunction Perl_to_utf8_case Perl_unlnk Perl_unpack_str syn keyword xsFunction Perl_unpackstring Perl_unsharepvn Perl_upg_version syn keyword xsFunction Perl_utf16_to_utf8 Perl_utf16_to_utf8_reversed syn keyword xsFunction Perl_utf8_distance Perl_utf8_hop Perl_utf8_length syn keyword xsFunction Perl_utf8_to_bytes Perl_utf8_to_uvchr_buf syn keyword xsFunction Perl_utf8_to_uvuni_buf Perl_utf8n_to_uvchr syn keyword xsFunction Perl_utf8n_to_uvuni Perl_uvchr_to_utf8 syn keyword xsFunction Perl_uvchr_to_utf8_flags Perl_uvuni_to_utf8_flags syn keyword xsFunction Perl_valid_utf8_to_uvchr Perl_valid_utf8_to_uvuni syn keyword xsFunction Perl_vcmp Perl_vcroak Perl_vdeb Perl_vform syn keyword xsFunction Perl_vload_module Perl_vmess Perl_vnewSVpvf syn keyword xsFunction Perl_vnormal Perl_vnumify Perl_vstringify Perl_vverify syn keyword xsFunction Perl_vwarn Perl_vwarner Perl_warn Perl_warn_nocontext syn keyword xsFunction Perl_warn_sv Perl_warner Perl_warner_nocontext syn keyword xsFunction Perl_whichsig_pv Perl_whichsig_pvn Perl_whichsig_sv syn keyword xsFunction Perl_wrap_op_checker Slab_Alloc Slab_Free syn keyword xsFunction _is_utf8_quotemeta _to_uni_fold_flags syn keyword xsFunction _to_utf8_fold_flags _to_utf8_lower_flags syn keyword xsFunction _to_utf8_title_flags _to_utf8_upper_flags amagic_call syn keyword xsFunction amagic_deref_call any_dup apply_attrs_string syn keyword xsFunction atfork_lock atfork_unlock av_clear av_delete av_exists syn keyword xsFunction av_extend av_fetch av_fill av_len av_make av_pop syn keyword xsFunction av_push av_shift av_store av_undef av_unshift syn keyword xsFunction block_gimme bytes_cmp_utf8 bytes_from_utf8 syn keyword xsFunction bytes_to_utf8 call_argv call_atexit call_list syn keyword xsFunction call_method call_pv call_sv caller_cx cast_i32 cast_iv syn keyword xsFunction cast_ulong cast_uv ck_entersub_args_list syn keyword xsFunction ck_entersub_args_proto ck_entersub_args_proto_or_list syn keyword xsFunction ck_warner ck_warner_d croak croak_no_modify syn keyword xsFunction croak_nocontext croak_sv croak_xs_usage csighandler syn keyword xsFunction custom_op_desc custom_op_name cv_clone cv_const_sv syn keyword xsFunction cv_get_call_checker cv_set_call_checker cv_undef syn keyword xsFunction cx_dump cx_dup cxinc deb deb_nocontext debop syn keyword xsFunction debprofdump debstack debstackptrs delimcpy syn keyword xsFunction despatch_signals die die_nocontext die_sv dirp_dup syn keyword xsFunction do_aspawn do_binmode do_close do_gv_dump do_gvgv_dump syn keyword xsFunction do_hv_dump do_join do_magic_dump do_op_dump do_open9 syn keyword xsFunction do_openn do_pmop_dump do_spawn do_spawn_nowait syn keyword xsFunction do_sprintf do_sv_dump doing_taint doref dounwind syn keyword xsFunction dowantarray dump_all dump_eval dump_fds dump_form syn keyword xsFunction dump_indent dump_mstats dump_packsubs dump_sub syn keyword xsFunction dump_vindent eval_pv eval_sv fbm_compile fbm_instr syn keyword xsFunction filter_add filter_del filter_read find_runcv syn keyword xsFunction find_rundefsv foldEQ foldEQ_latin1 foldEQ_locale syn keyword xsFunction foldEQ_utf8_flags form form_nocontext fp_dup syn keyword xsFunction fprintf_nocontext free_global_struct free_tmps get_av syn keyword xsFunction get_context get_cv get_cvn_flags get_hv get_mstats syn keyword xsFunction get_op_descs get_op_names get_ppaddr get_sv get_vtbl syn keyword xsFunction getcwd_sv gp_dup gp_free gp_ref grok_bin grok_hex syn keyword xsFunction grok_number grok_numeric_radix grok_oct gv_add_by_type syn keyword xsFunction gv_autoload_pv gv_autoload_pvn gv_autoload_sv gv_check syn keyword xsFunction gv_const_sv gv_dump gv_efullname gv_efullname4 syn keyword xsFunction gv_fetchfile gv_fetchfile_flags gv_fetchmeth_pv syn keyword xsFunction gv_fetchmeth_pv_autoload gv_fetchmeth_pvn syn keyword xsFunction gv_fetchmeth_pvn_autoload gv_fetchmeth_sv syn keyword xsFunction gv_fetchmeth_sv_autoload gv_fetchmethod_autoload syn keyword xsFunction gv_fetchmethod_pv_flags gv_fetchmethod_pvn_flags syn keyword xsFunction gv_fetchmethod_sv_flags gv_fetchpv gv_fetchpvn_flags syn keyword xsFunction gv_fetchsv gv_fullname gv_fullname4 gv_handler syn keyword xsFunction gv_init_pv gv_init_pvn gv_init_sv gv_name_set syn keyword xsFunction gv_stashpv gv_stashpvn gv_stashsv he_dup hek_dup syn keyword xsFunction hv_clear hv_clear_placeholders hv_common syn keyword xsFunction hv_common_key_len hv_copy_hints_hv hv_delayfree_ent syn keyword xsFunction hv_free_ent hv_iterinit hv_iterkey hv_iterkeysv syn keyword xsFunction hv_iternext_flags hv_iternextsv hv_iterval hv_ksplit syn keyword xsFunction hv_name_set hv_scalar init_global_struct init_i18nl10n syn keyword xsFunction init_i18nl14n init_stacks init_tm instr syn keyword xsFunction is_ascii_string is_lvalue_sub is_uni_alnum syn keyword xsFunction is_uni_alnum_lc is_uni_alpha is_uni_alpha_lc syn keyword xsFunction is_uni_ascii is_uni_ascii_lc is_uni_cntrl syn keyword xsFunction is_uni_cntrl_lc is_uni_digit is_uni_digit_lc syn keyword xsFunction is_uni_graph is_uni_graph_lc is_uni_idfirst syn keyword xsFunction is_uni_idfirst_lc is_uni_lower is_uni_lower_lc syn keyword xsFunction is_uni_print is_uni_print_lc is_uni_punct syn keyword xsFunction is_uni_punct_lc is_uni_space is_uni_space_lc syn keyword xsFunction is_uni_upper is_uni_upper_lc is_uni_xdigit syn keyword xsFunction is_uni_xdigit_lc is_utf8_alnum is_utf8_alpha syn keyword xsFunction is_utf8_ascii is_utf8_char_buf is_utf8_cntrl syn keyword xsFunction is_utf8_digit is_utf8_graph is_utf8_idcont syn keyword xsFunction is_utf8_idfirst is_utf8_lower is_utf8_mark syn keyword xsFunction is_utf8_perl_space is_utf8_perl_word syn keyword xsFunction is_utf8_posix_digit is_utf8_print is_utf8_punct syn keyword xsFunction is_utf8_space is_utf8_string is_utf8_string_loclen syn keyword xsFunction is_utf8_upper is_utf8_xdigit is_utf8_xidcont syn keyword xsFunction is_utf8_xidfirst leave_scope lex_bufutf8 syn keyword xsFunction lex_discard_to lex_grow_linestr lex_next_chunk syn keyword xsFunction lex_peek_unichar lex_read_space lex_read_to syn keyword xsFunction lex_read_unichar lex_start lex_stuff_pv lex_stuff_pvn syn keyword xsFunction lex_stuff_sv lex_unstuff load_module syn keyword xsFunction load_module_nocontext looks_like_number magic_dump syn keyword xsFunction markstack_grow mess mess_nocontext mess_sv mg_clear syn keyword xsFunction mg_copy mg_dup mg_find mg_findext mg_free mg_free_type syn keyword xsFunction mg_get mg_length mg_magical mg_set mg_size mini_mktime syn keyword xsFunction moreswitches mro_get_linear_isa mro_method_changed_in syn keyword xsFunction my_atof my_atof2 my_bcopy my_bzero my_chsize my_dirfd syn keyword xsFunction my_exit my_failure_exit my_fflush_all my_fork my_htonl syn keyword xsFunction my_memcmp my_memset my_ntohl my_pclose my_popen syn keyword xsFunction my_popen_list my_setenv my_socketpair my_strftime syn keyword xsFunction my_swap newANONATTRSUB newANONHASH newANONLIST syn keyword xsFunction newANONSUB newASSIGNOP newATTRSUB newAVREF newBINOP syn keyword xsFunction newCONDOP newCONSTSUB newCONSTSUB_flags newCVREF syn keyword xsFunction newFORM newFOROP newGIVENOP newGVOP newGVREF syn keyword xsFunction newGVgen_flags newHVREF newHVhv newLISTOP newLOGOP syn keyword xsFunction newLOOPEX newLOOPOP newMYSUB newNULLLIST newOP syn keyword xsFunction newPADOP newPMOP newPROG newPVOP newRANGE newRV syn keyword xsFunction newRV_noinc newSLICEOP newSTATEOP newSV newSVOP syn keyword xsFunction newSVREF newSV_type newSVhek newSViv newSVnv newSVpv syn keyword xsFunction newSVpv_share newSVpvf newSVpvf_nocontext newSVpvn syn keyword xsFunction newSVpvn_flags newSVpvn_share newSVrv newSVsv newSVuv syn keyword xsFunction newUNOP newWHENOP newWHILEOP newXS newXS_flags syn keyword xsFunction new_collate new_ctype new_numeric new_stackinfo syn keyword xsFunction new_version ninstr nothreadhook op_append_elem syn keyword xsFunction op_append_list op_contextualize op_dump op_free syn keyword xsFunction op_linklist op_null op_prepend_elem op_refcnt_lock syn keyword xsFunction op_refcnt_unlock op_scope pack_cat packlist syn keyword xsFunction pad_add_anon pad_add_name_pv pad_add_name_pvn syn keyword xsFunction pad_add_name_sv pad_alloc pad_compname_type syn keyword xsFunction pad_findmy_pv pad_findmy_pvn pad_findmy_sv pad_new syn keyword xsFunction pad_setsv pad_sv pad_tidy parse_arithexpr syn keyword xsFunction parse_barestmt parse_block parse_fullexpr syn keyword xsFunction parse_fullstmt parse_label parse_listexpr syn keyword xsFunction parse_stmtseq parse_termexpr parser_dup pmop_dump syn keyword xsFunction pop_scope pregcomp pregexec pregfree pregfree2 syn keyword xsFunction prescan_version printf_nocontext ptr_table_fetch syn keyword xsFunction ptr_table_free ptr_table_new ptr_table_split syn keyword xsFunction ptr_table_store push_scope pv_display pv_escape syn keyword xsFunction pv_pretty pv_uni_display re_compile re_dup_guts syn keyword xsFunction re_intuit_start re_intuit_string reentrant_free syn keyword xsFunction reentrant_init reentrant_retry reentrant_size syn keyword xsFunction reg_named_buff_all reg_named_buff_exists syn keyword xsFunction reg_named_buff_fetch reg_named_buff_firstkey syn keyword xsFunction reg_named_buff_nextkey reg_named_buff_scalar syn keyword xsFunction regclass_swash regdump regdupe_internal regexec_flags syn keyword xsFunction regfree_internal reginitcolors regnext repeatcpy syn keyword xsFunction require_pv rninstr rsignal rsignal_state runops_debug syn keyword xsFunction runops_standard rv2cv_op_cv rvpv_dup safesyscalloc syn keyword xsFunction safesysfree safesysmalloc safesysrealloc save_I16 syn keyword xsFunction save_I32 save_I8 save_adelete save_aelem_flags syn keyword xsFunction save_alloc save_aptr save_ary save_bool save_clearsv syn keyword xsFunction save_delete save_destructor save_destructor_x syn keyword xsFunction save_generic_pvref save_generic_svref save_gp syn keyword xsFunction save_hash save_hdelete save_helem_flags save_hints syn keyword xsFunction save_hptr save_int save_item save_iv save_list syn keyword xsFunction save_long save_nogv save_padsv_and_mortalize save_pptr syn keyword xsFunction save_pushi32ptr save_pushptr save_pushptrptr syn keyword xsFunction save_re_context save_scalar save_set_svflags syn keyword xsFunction save_shared_pvref save_sptr save_svref save_vptr syn keyword xsFunction savepv savepvn savesharedpv savesharedpvn syn keyword xsFunction savesharedsvpv savestack_grow savestack_grow_cnt syn keyword xsFunction savesvpv scan_bin scan_hex scan_num scan_oct syn keyword xsFunction scan_version scan_vstring screaminstr seed set_context syn keyword xsFunction set_numeric_local set_numeric_radix syn keyword xsFunction set_numeric_standard setdefout share_hek si_dup sortsv syn keyword xsFunction sortsv_flags ss_dup stack_grow start_subparse syn keyword xsFunction stashpv_hvname_match str_to_version sv_2bool_flags syn keyword xsFunction sv_2cv sv_2io sv_2iv_flags sv_2mortal sv_2nv_flags syn keyword xsFunction sv_2pv_flags sv_2pvbyte sv_2pvutf8 sv_2uv_flags syn keyword xsFunction sv_backoff sv_bless sv_cat_decode sv_catpv syn keyword xsFunction sv_catpv_flags sv_catpv_mg sv_catpvf sv_catpvf_mg syn keyword xsFunction sv_catpvf_mg_nocontext sv_catpvf_nocontext syn keyword xsFunction sv_catpvn_flags sv_catsv_flags sv_chop sv_clear syn keyword xsFunction sv_cmp_flags sv_cmp_locale_flags sv_collxfrm_flags syn keyword xsFunction sv_copypv sv_dec sv_dec_nomg sv_derived_from syn keyword xsFunction sv_derived_from_pv sv_derived_from_pvn syn keyword xsFunction sv_derived_from_sv sv_destroyable sv_does sv_does_pv syn keyword xsFunction sv_does_pvn sv_does_sv sv_dump sv_dup sv_dup_inc syn keyword xsFunction sv_eq_flags sv_force_normal_flags sv_free sv_gets syn keyword xsFunction sv_grow sv_inc sv_inc_nomg sv_insert_flags sv_isa syn keyword xsFunction sv_isobject sv_iv sv_len sv_len_utf8 sv_magic syn keyword xsFunction sv_magicext sv_mortalcopy sv_newmortal sv_newref syn keyword xsFunction sv_nosharing sv_nounlocking sv_nv sv_peek sv_pos_b2u syn keyword xsFunction sv_pos_u2b sv_pos_u2b_flags sv_pvbyten syn keyword xsFunction sv_pvbyten_force sv_pvn sv_pvn_force_flags sv_pvn_nomg syn keyword xsFunction sv_pvutf8n sv_pvutf8n_force sv_recode_to_utf8 syn keyword xsFunction sv_reftype sv_replace sv_report_used sv_reset syn keyword xsFunction sv_rvweaken sv_setiv sv_setiv_mg sv_setnv sv_setnv_mg syn keyword xsFunction sv_setpv sv_setpv_mg sv_setpvf sv_setpvf_mg syn keyword xsFunction sv_setpvf_mg_nocontext sv_setpvf_nocontext sv_setpviv syn keyword xsFunction sv_setpviv_mg sv_setpvn sv_setpvn_mg sv_setref_iv syn keyword xsFunction sv_setref_nv sv_setref_pv sv_setref_pvn sv_setref_uv syn keyword xsFunction sv_setsv_flags sv_setsv_mg sv_setuv sv_setuv_mg syn keyword xsFunction sv_tainted sv_true sv_uni_display sv_unmagic syn keyword xsFunction sv_unmagicext sv_unref_flags sv_untaint sv_upgrade syn keyword xsFunction sv_usepvn_flags sv_utf8_decode sv_utf8_downgrade syn keyword xsFunction sv_utf8_encode sv_utf8_upgrade_flags_grow sv_uv syn keyword xsFunction sv_vcatpvf sv_vcatpvf_mg sv_vcatpvfn sv_vsetpvf syn keyword xsFunction sv_vsetpvf_mg sv_vsetpvfn swash_fetch swash_init syn keyword xsFunction sys_intern_clear sys_intern_dup sys_intern_init syn keyword xsFunction taint_env taint_proper tmps_grow to_uni_lower syn keyword xsFunction to_uni_lower_lc to_uni_title to_uni_title_lc syn keyword xsFunction to_uni_upper to_uni_upper_lc to_utf8_case unlnk syn keyword xsFunction unpack_str unpackstring unsharepvn upg_version syn keyword xsFunction utf16_to_utf8 utf16_to_utf8_reversed utf8_distance syn keyword xsFunction utf8_hop utf8_length utf8_to_bytes utf8_to_uvchr_buf syn keyword xsFunction utf8_to_uvuni_buf utf8n_to_uvchr utf8n_to_uvuni syn keyword xsFunction uvchr_to_utf8 uvchr_to_utf8_flags uvuni_to_utf8_flags syn keyword xsFunction valid_utf8_to_uvchr valid_utf8_to_uvuni vcmp vcroak syn keyword xsFunction vdeb vform vload_module vmess vnewSVpvf vnormal syn keyword xsFunction vnumify vstringify vverify vwarn vwarner warn syn keyword xsFunction warn_nocontext warn_sv warner warner_nocontext syn keyword xsFunction whichsig_pv whichsig_pvn whichsig_sv wrap_op_checker syn keyword xsVariable MARK MY_CXT ORIGMARK PL_I PL_No PL_Vars PL_VarsPtr syn keyword xsVariable PL_Yes PL_a2e PL_bincompat_options PL_bitcount syn keyword xsVariable PL_block_type PL_bufend PL_bufptr PL_charclass syn keyword xsVariable PL_check PL_copline PL_core_reg_engine PL_cshname syn keyword xsVariable PL_curforce PL_e2a PL_e2utf PL_endwhite PL_error_count syn keyword xsVariable PL_expect PL_faketokens PL_fold PL_fold_latin1 syn keyword xsVariable PL_fold_locale PL_force_link_funcs PL_freq syn keyword xsVariable PL_global_struct_size PL_hexdigit PL_in_my syn keyword xsVariable PL_in_my_stash PL_interp_size PL_interp_size_5_16_0 syn keyword xsVariable PL_last_lop PL_last_lop_op PL_last_uni PL_lasttoke syn keyword xsVariable PL_latin1_lc PL_lex_allbrackets PL_lex_brackets syn keyword xsVariable PL_lex_brackstack PL_lex_casemods PL_lex_casestack syn keyword xsVariable PL_lex_defer PL_lex_dojoin PL_lex_expect syn keyword xsVariable PL_lex_fakeeof PL_lex_formbrack PL_lex_inpat syn keyword xsVariable PL_lex_inwhat PL_lex_op PL_lex_repl PL_lex_starts syn keyword xsVariable PL_lex_state PL_lex_stuff PL_linestart PL_linestr syn keyword xsVariable PL_magic_data PL_magic_vtable_names PL_memory_wrap syn keyword xsVariable PL_mod_latin1_uc PL_multi_close PL_multi_end syn keyword xsVariable PL_multi_open PL_multi_start PL_nexttoke PL_nexttype syn keyword xsVariable PL_nextval PL_nextwhite PL_no_aelem PL_no_dir_func syn keyword xsVariable PL_no_func PL_no_helem_sv PL_no_localize_ref PL_no_mem syn keyword xsVariable PL_no_modify PL_no_myglob PL_no_security syn keyword xsVariable PL_no_sock_func PL_no_symref PL_no_symref_sv syn keyword xsVariable PL_no_usym PL_no_wrongref PL_oldbufptr PL_oldoldbufptr syn keyword xsVariable PL_op_desc PL_op_name PL_opargs PL_pending_ident syn keyword xsVariable PL_phase_names PL_ppaddr PL_preambled syn keyword xsVariable PL_realtokenstart PL_reg_extflags_name PL_reg_name syn keyword xsVariable PL_regkind PL_revision PL_rsfp PL_rsfp_filters syn keyword xsVariable PL_runops_dbg PL_runops_std PL_sh_path PL_sig_name syn keyword xsVariable PL_sig_num PL_simple PL_simple_bitmask PL_skipwhite syn keyword xsVariable PL_sublex_info PL_subversion PL_thisclose PL_thismad syn keyword xsVariable PL_thisopen PL_thisstuff PL_thistoken PL_thiswhite syn keyword xsVariable PL_tokenbuf PL_utf2e PL_utf8skip PL_uudmap PL_uuemap syn keyword xsVariable PL_valid_types_IVX PL_valid_types_IV_set syn keyword xsVariable PL_valid_types_NVX PL_valid_types_NV_set syn keyword xsVariable PL_valid_types_PVX PL_valid_types_RV PL_varies syn keyword xsVariable PL_varies_bitmask PL_version PL_warn_nl PL_warn_nosemi syn keyword xsVariable PL_warn_reserved PL_warn_uninit PL_warn_uninit_sv syn keyword xsVariable RETVAL SP TARG _aMY_CXT _aTHX aMY_CXT aMY_CXT_ aTHX syn keyword xsVariable aTHX_ items syn keyword xsMacro ABORT ACCEPT ADDOP AHOCORASICK AHOCORASICKC syn keyword xsMacro ALLOC_THREAD_KEY ALNUM ALNUMA ALNUML ALNUMU AMG_CALLun syn keyword xsMacro AMG_CALLunary AMGf_assign AMGf_noleft AMGf_noright syn keyword xsMacro AMGf_numeric AMGf_set AMGf_unary AMGfallNEVER AMGfallNO syn keyword xsMacro AMGfallYES AMT_AMAGIC AMT_AMAGIC_off AMT_AMAGIC_on syn keyword xsMacro AMT_OVERLOADED AMT_OVERLOADED_off AMT_OVERLOADED_on syn keyword xsMacro AMTf_AMAGIC AMTf_OVERLOADED ANDAND ANDOP ANONSUB ANYOF syn keyword xsMacro ANYOFV ANYOF_ALNUM ANYOF_ALNUMC ANYOF_ALNUML ANYOF_ALPHA syn keyword xsMacro ANYOF_ASCII ANYOF_BIT ANYOF_BITMAP ANYOF_BITMAP_BYTE syn keyword xsMacro ANYOF_BITMAP_CLEAR ANYOF_BITMAP_CLEARALL ANYOF_BITMAP_SET syn keyword xsMacro ANYOF_BITMAP_SETALL ANYOF_BITMAP_SIZE ANYOF_BITMAP_TEST syn keyword xsMacro ANYOF_BITMAP_TESTALLSET ANYOF_BITMAP_ZERO ANYOF_BLANK syn keyword xsMacro ANYOF_CLASS ANYOF_CLASSBITMAP_SIZE ANYOF_CLASS_BYTE syn keyword xsMacro ANYOF_CLASS_CLEAR ANYOF_CLASS_SET ANYOF_CLASS_SETALL syn keyword xsMacro ANYOF_CLASS_SIZE ANYOF_CLASS_SKIP ANYOF_CLASS_TEST syn keyword xsMacro ANYOF_CLASS_TEST_ANY_SET ANYOF_CLASS_ZERO ANYOF_CNTRL syn keyword xsMacro ANYOF_DIGIT ANYOF_EOS ANYOF_FLAGS ANYOF_FLAGS_ALL syn keyword xsMacro ANYOF_FOLD_SHARP_S ANYOF_GRAPH ANYOF_HORIZWS ANYOF_INVERT syn keyword xsMacro ANYOF_IS_SYNTHETIC ANYOF_LARGE ANYOF_LOCALE syn keyword xsMacro ANYOF_LOC_NONBITMAP_FOLD ANYOF_LOWER ANYOF_MAX syn keyword xsMacro ANYOF_NALNUM ANYOF_NALNUMC ANYOF_NALNUML ANYOF_NALPHA syn keyword xsMacro ANYOF_NASCII ANYOF_NBLANK ANYOF_NCNTRL ANYOF_NDIGIT syn keyword xsMacro ANYOF_NGRAPH ANYOF_NHORIZWS ANYOF_NLOWER ANYOF_NONBITMAP syn keyword xsMacro ANYOF_NONBITMAP_EMPTY ANYOF_NONBITMAP_NON_UTF8 syn keyword xsMacro ANYOF_NON_UTF8_LATIN1_ALL ANYOF_NPRINT ANYOF_NPSXSPC syn keyword xsMacro ANYOF_NPUNCT ANYOF_NSPACE ANYOF_NSPACEL ANYOF_NUPPER syn keyword xsMacro ANYOF_NVERTWS ANYOF_NXDIGIT ANYOF_PRINT ANYOF_PSXSPC syn keyword xsMacro ANYOF_PUNCT ANYOF_SIZE ANYOF_SKIP ANYOF_SPACE syn keyword xsMacro ANYOF_SPACEL ANYOF_UNICODE_ALL ANYOF_UPPER ANYOF_VERTWS syn keyword xsMacro ANYOF_XDIGIT ARCHLIB ARCHLIB_EXP ARCHNAME ARG ARG1 syn keyword xsMacro ARG1_LOC ARG1_SET ARG2 ARG2L ARG2L_LOC ARG2L_SET ARG2_LOC syn keyword xsMacro ARG2_SET ARGTARG ARG_LOC ARG_SET ARG_VALUE ARG__SET ARROW syn keyword xsMacro ASCII_MORE_RESTRICT_PAT_MODS ASCII_RESTRICT_PAT_MOD syn keyword xsMacro ASCII_RESTRICT_PAT_MODS ASCII_TO_NATIVE ASCII_TO_NEED syn keyword xsMacro ASCTIME_R_PROTO ASSERT_CURPAD_ACTIVE ASSERT_CURPAD_LEGAL syn keyword xsMacro ASSIGNOP Atof Atol Atoul AvALLOC AvARRAY AvARYLEN AvFILL syn keyword xsMacro AvFILLp AvMAX AvREAL AvREALISH AvREAL_off AvREAL_on syn keyword xsMacro AvREAL_only AvREIFY AvREIFY_off AvREIFY_on AvREIFY_only syn keyword xsMacro BACK BADVERSION BASEOP BHKf_bhk_eval BHKf_bhk_post_end syn keyword xsMacro BHKf_bhk_pre_end BHKf_bhk_start BIN BIN_EXP BITANDOP syn keyword xsMacro BITMAP_BYTE BITMAP_TEST BITOROP BIT_BUCKET BIT_DIGITS BOL syn keyword xsMacro BOUND BOUNDA BOUNDL BOUNDU BRANCH BRANCHJ BRANCH_next syn keyword xsMacro BRANCH_next_fail BSD_GETPGRP BSD_SETPGRP BSDish BUFSIZ syn keyword xsMacro BYTEORDER BhkDISABLE BhkENABLE BhkENTRY BhkENTRY_set syn keyword xsMacro BhkFLAGS Bit BmFLAGS BmPREVIOUS BmRARE BmUSEFUL syn keyword xsMacro CALLREGCOMP CALLREGCOMP_ENG CALLREGDUPE CALLREGDUPE_PVT syn keyword xsMacro CALLREGEXEC CALLREGFREE CALLREGFREE_PVT syn keyword xsMacro CALLREG_INTUIT_START CALLREG_INTUIT_STRING syn keyword xsMacro CALLREG_NAMED_BUFF_ALL CALLREG_NAMED_BUFF_CLEAR syn keyword xsMacro CALLREG_NAMED_BUFF_COUNT CALLREG_NAMED_BUFF_DELETE syn keyword xsMacro CALLREG_NAMED_BUFF_EXISTS CALLREG_NAMED_BUFF_FETCH syn keyword xsMacro CALLREG_NAMED_BUFF_FIRSTKEY CALLREG_NAMED_BUFF_NEXTKEY syn keyword xsMacro CALLREG_NAMED_BUFF_SCALAR CALLREG_NAMED_BUFF_STORE syn keyword xsMacro CALLREG_NUMBUF_FETCH CALLREG_NUMBUF_LENGTH syn keyword xsMacro CALLREG_NUMBUF_STORE CALLREG_PACKAGE CALLRUNOPS syn keyword xsMacro CALL_BLOCK_HOOKS CALL_FPTR CANY CAN_COW_FLAGS syn keyword xsMacro CAN_COW_MASK CAN_PROTOTYPE CAN_VAPROTO syn keyword xsMacro CASE_STD_PMMOD_FLAGS_PARSE_SET CASTFLAGS CASTNEGFLOAT syn keyword xsMacro CAT2 CATCH_GET CATCH_SET CHARBITS CHARSET_PAT_MODS syn keyword xsMacro CHECK_MALLOC_TAINT CHECK_MALLOC_TOO_LATE_FOR syn keyword xsMacro CHECK_MALLOC_TOO_LATE_FOR_ CLEAR_ARGARRAY CLEAR_ERRSV syn keyword xsMacro CLONEf_CLONE_HOST CLONEf_COPY_STACKS CLONEf_JOIN_IN syn keyword xsMacro CLONEf_KEEP_PTR_TABLE CLOSE CLUMP CLUMP_2IV CLUMP_2UV syn keyword xsMacro COLONATTR COMMIT COMMIT_next COMMIT_next_fail syn keyword xsMacro COND_BROADCAST COND_DESTROY COND_INIT COND_SIGNAL syn keyword xsMacro COND_WAIT CONTINUE CONTINUE_PAT_MOD COPHH_KEY_UTF8 syn keyword xsMacro COP_SEQ_RANGE_HIGH COP_SEQ_RANGE_LOW CPERLarg CPERLarg_ syn keyword xsMacro CPERLscope CPPLAST CPPMINUS CPPRUN CPPSTDIN CRYPT_R_PROTO syn keyword xsMacro CSH CTERMID_R_PROTO CTIME_R_PROTO CTYPE256 CURLY CURLYM syn keyword xsMacro CURLYM_A CURLYM_A_fail CURLYM_B CURLYM_B_fail CURLYN syn keyword xsMacro CURLYX CURLYX_end CURLYX_end_fail CURLY_B_max syn keyword xsMacro CURLY_B_max_fail CURLY_B_min CURLY_B_min_fail syn keyword xsMacro CURLY_B_min_known CURLY_B_min_known_fail syn keyword xsMacro CURRENT_FEATURE_BUNDLE CURRENT_HINTS CUTGROUP syn keyword xsMacro CUTGROUP_next CUTGROUP_next_fail CVf_ANON CVf_AUTOLOAD syn keyword xsMacro CVf_BUILTIN_ATTRS CVf_CLONE CVf_CLONED CVf_CONST syn keyword xsMacro CVf_CVGV_RC CVf_DYNFILE CVf_ISXSUB CVf_LVALUE CVf_METHOD syn keyword xsMacro CVf_NODEBUG CVf_UNIQUE CVf_WEAKOUTSIDE CXINC CXTYPEMASK syn keyword xsMacro CX_CURPAD_SAVE CX_CURPAD_SV CXp_FOR_DEF CXp_HASARGS syn keyword xsMacro CXp_MULTICALL CXp_ONCE CXp_REAL CXp_TRYBLOCK C_ARRAY_END syn keyword xsMacro C_ARRAY_LENGTH C_FAC_POSIX CopFILE CopFILEAV CopFILEAVx syn keyword xsMacro CopFILEGV CopFILEGV_set CopFILESV CopFILE_free syn keyword xsMacro CopFILE_set CopFILE_setn CopHINTHASH_get CopHINTHASH_set syn keyword xsMacro CopHINTS_get CopHINTS_set CopLABEL CopLABEL_alloc syn keyword xsMacro CopLABEL_len CopLABEL_len_flags CopLINE CopLINE_dec syn keyword xsMacro CopLINE_inc CopLINE_set CopSTASH CopSTASHPV syn keyword xsMacro CopSTASHPV_set CopSTASH_eq CopSTASH_free CopSTASH_len syn keyword xsMacro CopSTASH_len_set CopSTASH_ne CopSTASH_set Copy CopyD Ctl syn keyword xsMacro CvANON CvANON_off CvANON_on CvAUTOLOAD CvAUTOLOAD_off syn keyword xsMacro CvAUTOLOAD_on CvCLONE CvCLONED CvCLONED_off CvCLONED_on syn keyword xsMacro CvCLONE_off CvCLONE_on CvCONST CvCONST_off CvCONST_on syn keyword xsMacro CvCVGV_RC CvCVGV_RC_off CvCVGV_RC_on CvDEPTH CvDYNFILE syn keyword xsMacro CvDYNFILE_off CvDYNFILE_on CvEVAL CvEVAL_off CvEVAL_on syn keyword xsMacro CvFILE CvFILEGV CvFILE_set_from_cop CvFLAGS CvGV CvGV_set syn keyword xsMacro CvISXSUB CvISXSUB_off CvISXSUB_on CvLVALUE CvLVALUE_off syn keyword xsMacro CvLVALUE_on CvMETHOD CvMETHOD_off CvMETHOD_on CvNODEBUG syn keyword xsMacro CvNODEBUG_off CvNODEBUG_on CvOUTSIDE CvOUTSIDE_SEQ syn keyword xsMacro CvPADLIST CvPROTO CvPROTOLEN CvROOT CvSPECIAL syn keyword xsMacro CvSPECIAL_off CvSPECIAL_on CvSTART CvSTASH CvSTASH_set syn keyword xsMacro CvUNIQUE CvUNIQUE_off CvUNIQUE_on CvWEAKOUTSIDE syn keyword xsMacro CvWEAKOUTSIDE_off CvWEAKOUTSIDE_on CvXSUB CvXSUBANY syn keyword xsMacro CxFOREACH CxFOREACHDEF CxHASARGS CxITERVAR syn keyword xsMacro CxITERVAR_PADSV CxLABEL CxLABEL_len CxLABEL_len_flags syn keyword xsMacro CxLVAL CxMULTICALL CxOLD_IN_EVAL CxOLD_OP_TYPE CxONCE syn keyword xsMacro CxPADLOOP CxREALEVAL CxTRYBLOCK CxTYPE CxTYPE_is_LOOP syn keyword xsMacro DBL_DIG DBL_MAX DBL_MIN DBM_ckFilter DBM_setFilter syn keyword xsMacro DB_VERSION_MAJOR_CFG DB_VERSION_MINOR_CFG syn keyword xsMacro DB_VERSION_PATCH_CFG DEBUG_A DEBUG_A_FLAG DEBUG_A_TEST syn keyword xsMacro DEBUG_A_TEST_ DEBUG_B DEBUG_BUFFERS_r DEBUG_B_FLAG syn keyword xsMacro DEBUG_B_TEST DEBUG_B_TEST_ DEBUG_C DEBUG_COMPILE_r syn keyword xsMacro DEBUG_CX DEBUG_C_FLAG DEBUG_C_TEST DEBUG_C_TEST_ DEBUG_D syn keyword xsMacro DEBUG_DB_RECURSE_FLAG DEBUG_DUMP_r DEBUG_D_FLAG syn keyword xsMacro DEBUG_D_TEST DEBUG_D_TEST_ DEBUG_EXECUTE_r DEBUG_EXTRA_r syn keyword xsMacro DEBUG_FLAGS_r DEBUG_GPOS_r DEBUG_H DEBUG_H_FLAG syn keyword xsMacro DEBUG_H_TEST DEBUG_H_TEST_ DEBUG_INTUIT_r DEBUG_J_FLAG syn keyword xsMacro DEBUG_J_TEST DEBUG_J_TEST_ DEBUG_M DEBUG_MASK syn keyword xsMacro DEBUG_MATCH_r DEBUG_M_FLAG DEBUG_M_TEST DEBUG_M_TEST_ syn keyword xsMacro DEBUG_OFFSETS_r DEBUG_OPTIMISE_MORE_r DEBUG_OPTIMISE_r syn keyword xsMacro DEBUG_P DEBUG_PARSE_r DEBUG_P_FLAG DEBUG_P_TEST syn keyword xsMacro DEBUG_P_TEST_ DEBUG_Pv DEBUG_Pv_TEST DEBUG_Pv_TEST_ syn keyword xsMacro DEBUG_R DEBUG_R_FLAG DEBUG_R_TEST DEBUG_R_TEST_ syn keyword xsMacro DEBUG_SCOPE DEBUG_STACK_r DEBUG_STATE_r DEBUG_T syn keyword xsMacro DEBUG_TOP_FLAG DEBUG_TRIE_COMPILE_MORE_r syn keyword xsMacro DEBUG_TRIE_COMPILE_r DEBUG_TRIE_EXECUTE_MORE_r syn keyword xsMacro DEBUG_TRIE_EXECUTE_r DEBUG_TRIE_r DEBUG_T_FLAG syn keyword xsMacro DEBUG_T_TEST DEBUG_T_TEST_ DEBUG_U DEBUG_U_FLAG syn keyword xsMacro DEBUG_U_TEST DEBUG_U_TEST_ DEBUG_Uv DEBUG_Uv_TEST syn keyword xsMacro DEBUG_Uv_TEST_ DEBUG_X DEBUG_X_FLAG DEBUG_X_TEST syn keyword xsMacro DEBUG_X_TEST_ DEBUG_Xv DEBUG_Xv_TEST DEBUG_Xv_TEST_ syn keyword xsMacro DEBUG__ DEBUG_c DEBUG_c_FLAG DEBUG_c_TEST DEBUG_c_TEST_ syn keyword xsMacro DEBUG_f DEBUG_f_FLAG DEBUG_f_TEST DEBUG_f_TEST_ DEBUG_l syn keyword xsMacro DEBUG_l_FLAG DEBUG_l_TEST DEBUG_l_TEST_ DEBUG_m syn keyword xsMacro DEBUG_m_FLAG DEBUG_m_TEST DEBUG_m_TEST_ DEBUG_o syn keyword xsMacro DEBUG_o_FLAG DEBUG_o_TEST DEBUG_o_TEST_ DEBUG_p syn keyword xsMacro DEBUG_p_FLAG DEBUG_p_TEST DEBUG_p_TEST_ DEBUG_q syn keyword xsMacro DEBUG_q_FLAG DEBUG_q_TEST DEBUG_q_TEST_ DEBUG_r syn keyword xsMacro DEBUG_r_FLAG DEBUG_r_TEST DEBUG_r_TEST_ DEBUG_s syn keyword xsMacro DEBUG_s_FLAG DEBUG_s_TEST DEBUG_s_TEST_ DEBUG_t_FLAG syn keyword xsMacro DEBUG_t_TEST DEBUG_t_TEST_ DEBUG_u DEBUG_u_FLAG syn keyword xsMacro DEBUG_u_TEST DEBUG_u_TEST_ DEBUG_v DEBUG_v_FLAG syn keyword xsMacro DEBUG_v_TEST DEBUG_v_TEST_ DEBUG_x DEBUG_x_FLAG syn keyword xsMacro DEBUG_x_TEST DEBUG_x_TEST_ DEFAULT DEFAULT_PAT_MOD syn keyword xsMacro DEFINEP DEFSV DEFSV_set DEPENDS_PAT_MOD DEPENDS_PAT_MODS syn keyword xsMacro DETACH DIE DIGIT DIGITA DIGITL DIR DM_ARRAY_ISA DM_DELAY syn keyword xsMacro DM_EGID DM_EUID DM_GID DM_RGID DM_RUID DM_UID DO DOINIT syn keyword xsMacro DOLSHARP DONT_DECLARE_STD DORDOR DOROP DOSISH DOTDOT syn keyword xsMacro DOUBLESIZE DO_UTF8 DPTR2FPTR DRAND48_R_PROTO DUP_WARNINGS syn keyword xsMacro Drand01 ELSE ELSIF EMBEDMYMALLOC END ENDGRENT_R_PROTO syn keyword xsMacro ENDHOSTENT_R_PROTO ENDLIKE ENDNETENT_R_PROTO syn keyword xsMacro ENDPROTOENT_R_PROTO ENDPWENT_R_PROTO ENDSERVENT_R_PROTO syn keyword xsMacro END_EXTERN_C ENTER ENTER_with_name ENTRY_PROBE ENUM_BOOL syn keyword xsMacro EOF EOL EOS EQOP ERRHV ERRSV EVAL EVAL_AB EVAL_AB_fail syn keyword xsMacro EVAL_INEVAL EVAL_INREQUIRE EVAL_KEEPERR EVAL_NULL syn keyword xsMacro EVAL_WARNONLY EXACT EXACTF EXACTFA EXACTFL EXACTFU syn keyword xsMacro EXACTFU_SS EXACTFU_TRICKYFOLD EXEC_ARGV_CAST EXEC_PAT_MOD syn keyword xsMacro EXEC_PAT_MODS EXPECT EXT EXTCONST EXTEND EXTEND_MORTAL syn keyword xsMacro EXTERN_C EXTPERLIO EXTRA_SIZE EXTRA_STEP_2ARGS EXT_MGVTBL syn keyword xsMacro EXT_PAT_MODS FAKE_BIT_BUCKET FAKE_DEFAULT_SIGNAL_HANDLERS syn keyword xsMacro FAKE_PERSISTENT_SIGNAL_HANDLERS FBMcf_TAIL syn keyword xsMacro FBMcf_TAIL_DOLLAR FBMcf_TAIL_DOLLARM FBMcf_TAIL_Z syn keyword xsMacro FBMcf_TAIL_z FBMrf_MULTILINE FCNTL_CAN_LOCK FD_CLR syn keyword xsMacro FD_ISSET FD_SET FD_ZERO FEATURE_ARYBASE_IS_ENABLED syn keyword xsMacro FEATURE_BUNDLE_510 FEATURE_BUNDLE_511 FEATURE_BUNDLE_515 syn keyword xsMacro FEATURE_BUNDLE_CUSTOM FEATURE_BUNDLE_DEFAULT syn keyword xsMacro FEATURE_EVALBYTES_IS_ENABLED FEATURE_FC_IS_ENABLED syn keyword xsMacro FEATURE_IS_ENABLED FEATURE_SAY_IS_ENABLED syn keyword xsMacro FEATURE_STATE_IS_ENABLED FEATURE_SWITCH_IS_ENABLED syn keyword xsMacro FEATURE_UNICODE_IS_ENABLED FEATURE_UNIEVAL_IS_ENABLED syn keyword xsMacro FEATURE___SUB___IS_ENABLED FFLUSH_NULL FF_0DECIMAL syn keyword xsMacro FF_BLANK FF_CHECKCHOP FF_CHECKNL FF_CHOP FF_DECIMAL syn keyword xsMacro FF_END FF_FETCH FF_HALFSPACE FF_ITEM FF_LINEGLOB syn keyword xsMacro FF_LINEMARK FF_LINESNGL FF_LITERAL FF_MORE FF_NEWLINE syn keyword xsMacro FF_SKIP FF_SPACE FILE FILE_base FILE_bufsiz FILE_cnt syn keyword xsMacro FILE_ptr FILL_ADVANCE_NODE FILL_ADVANCE_NODE_ARG syn keyword xsMacro FILTER_DATA FILTER_ISREADER FILTER_READ FITS_IN_8_BITS syn keyword xsMacro FLAGS FLEXFILENAMES FOLDEQ_S1_ALREADY_FOLDED syn keyword xsMacro FOLDEQ_S2_ALREADY_FOLDED FOLDEQ_UTF8_LOCALE syn keyword xsMacro FOLDEQ_UTF8_NOMIX_ASCII FOLD_FLAGS_FULL FOLD_FLAGS_LOCALE syn keyword xsMacro FOR FORMAT FPTR2DPTR FREETMPS FREE_THREAD_KEY FSEEKSIZE syn keyword xsMacro FUNC FUNC0 FUNC0OP FUNC0SUB FUNC1 FUNCMETH FUNCTION__ syn keyword xsMacro F_atan2_amg F_cos_amg F_exp_amg F_log_amg F_pow_amg syn keyword xsMacro F_sin_amg F_sqrt_amg Fflush FmLINES FreeOp Fstat syn keyword xsMacro GDBMNDBM_H_USES_PROTOTYPES GETATARGET GETGRENT_R_PROTO syn keyword xsMacro GETGRGID_R_PROTO GETGRNAM_R_PROTO GETHOSTBYADDR_R_PROTO syn keyword xsMacro GETHOSTBYNAME_R_PROTO GETHOSTENT_R_PROTO GETLOGIN_R_PROTO syn keyword xsMacro GETNETBYADDR_R_PROTO GETNETBYNAME_R_PROTO syn keyword xsMacro GETNETENT_R_PROTO GETPROTOBYNAME_R_PROTO syn keyword xsMacro GETPROTOBYNUMBER_R_PROTO GETPROTOENT_R_PROTO syn keyword xsMacro GETPWENT_R_PROTO GETPWNAM_R_PROTO GETPWUID_R_PROTO syn keyword xsMacro GETSERVBYNAME_R_PROTO GETSERVBYPORT_R_PROTO syn keyword xsMacro GETSERVENT_R_PROTO GETSPNAM_R_PROTO GETTARGET syn keyword xsMacro GETTARGETSTACKED GET_RE_DEBUG_FLAGS syn keyword xsMacro GET_RE_DEBUG_FLAGS_DECL GIMME GIMME_V GIVEN syn keyword xsMacro GLOBAL_PAT_MOD GMTIME_MAX GMTIME_MIN GMTIME_R syn keyword xsMacro GMTIME_R_PROTO GOSTART GOSUB GPOS GRAMBARESTMT GRAMBLOCK syn keyword xsMacro GRAMEXPR GRAMFULLSTMT GRAMPROG GRAMSTMTSEQ syn keyword xsMacro GREEK_CAPITAL_LETTER_MU GREEK_SMALL_LETTER_MU syn keyword xsMacro GROK_NUMERIC_RADIX GROUPP GRPASSWD GV_ADD GV_ADDINEVAL syn keyword xsMacro GV_ADDMG GV_ADDMULTI GV_ADDWARN GV_AUTOLOAD syn keyword xsMacro GV_AUTOLOAD_ISMETHOD GV_CROAK GV_NOADD_MASK syn keyword xsMacro GV_NOADD_NOINIT GV_NOEXPAND GV_NOINIT GV_NOTQUAL syn keyword xsMacro GV_NO_SVGMAGIC GVf_ASSUMECV GVf_IMPORTED GVf_IMPORTED_AV syn keyword xsMacro GVf_IMPORTED_CV GVf_IMPORTED_HV GVf_IMPORTED_SV GVf_INTRO syn keyword xsMacro GVf_IN_PAD GVf_MULTI Gconvert Gid_t_f Gid_t_sign syn keyword xsMacro Gid_t_size GvASSIGN_GENERATION GvASSIGN_GENERATION_set syn keyword xsMacro GvASSUMECV GvASSUMECV_off GvASSUMECV_on GvAV GvAVn GvCV syn keyword xsMacro GvCVGEN GvCV_set GvCVu GvEGV GvEGVx GvENAME GvENAMELEN syn keyword xsMacro GvENAMEUTF8 GvENAME_HEK GvESTASH GvFILE GvFILEGV syn keyword xsMacro GvFILE_HEK GvFLAGS GvFORM GvGP GvGP_set GvHV GvHVn syn keyword xsMacro GvIMPORTED GvIMPORTED_AV GvIMPORTED_AV_off syn keyword xsMacro GvIMPORTED_AV_on GvIMPORTED_CV GvIMPORTED_CV_off syn keyword xsMacro GvIMPORTED_CV_on GvIMPORTED_HV GvIMPORTED_HV_off syn keyword xsMacro GvIMPORTED_HV_on GvIMPORTED_SV GvIMPORTED_SV_off syn keyword xsMacro GvIMPORTED_SV_on GvIMPORTED_off GvIMPORTED_on GvINTRO syn keyword xsMacro GvINTRO_off GvINTRO_on GvIN_PAD GvIN_PAD_off GvIN_PAD_on syn keyword xsMacro GvIO GvIOn GvIOp GvLINE GvMULTI GvMULTI_off GvMULTI_on syn keyword xsMacro GvNAME GvNAMELEN GvNAMELEN_get GvNAMEUTF8 GvNAME_HEK syn keyword xsMacro GvNAME_get GvREFCNT GvSTASH GvSV GvSVn GvXPVGV Gv_AMG syn keyword xsMacro HASATTRIBUTE_DEPRECATED HASATTRIBUTE_FORMAT syn keyword xsMacro HASATTRIBUTE_MALLOC HASATTRIBUTE_NONNULL syn keyword xsMacro HASATTRIBUTE_NORETURN HASATTRIBUTE_PURE syn keyword xsMacro HASATTRIBUTE_UNUSED HASATTRIBUTE_WARN_UNUSED_RESULT syn keyword xsMacro HASCONST HASHBRACK HASVOLATILE HAS_64K_LIMIT HAS_ACCESS syn keyword xsMacro HAS_ALARM HAS_ATOLL HAS_BCMP HAS_BCOPY HAS_BOOL syn keyword xsMacro HAS_BUILTIN_CHOOSE_EXPR HAS_BUILTIN_EXPECT HAS_BZERO syn keyword xsMacro HAS_C99_VARIADIC_MACROS HAS_CHOWN HAS_CHROOT HAS_CLEARENV syn keyword xsMacro HAS_COPYSIGNL HAS_CRYPT HAS_CTERMID HAS_CUSERID syn keyword xsMacro HAS_DBL_DIG HAS_DBMINIT_PROTO HAS_DIFFTIME HAS_DIRFD syn keyword xsMacro HAS_DLERROR HAS_DRAND48_PROTO HAS_DUP2 HAS_EACCESS syn keyword xsMacro HAS_ENDGRENT HAS_ENDHOSTENT HAS_ENDNETENT HAS_ENDPROTOENT syn keyword xsMacro HAS_ENDPWENT HAS_ENDSERVENT HAS_FAST_STDIO HAS_FCHDIR syn keyword xsMacro HAS_FCHMOD HAS_FCHOWN HAS_FCNTL HAS_FD_SET HAS_FGETPOS syn keyword xsMacro HAS_FINITE HAS_FINITEL HAS_FLOCK HAS_FLOCK_PROTO HAS_FORK syn keyword xsMacro HAS_FPATHCONF HAS_FREXPL HAS_FSEEKO HAS_FSETPOS syn keyword xsMacro HAS_FSTATFS HAS_FSTATVFS HAS_FSYNC HAS_FTELLO HAS_FUTIMES syn keyword xsMacro HAS_GETADDRINFO HAS_GETCWD HAS_GETGRENT HAS_GETGROUPS syn keyword xsMacro HAS_GETHOSTBYADDR HAS_GETHOSTBYNAME HAS_GETHOSTENT syn keyword xsMacro HAS_GETHOSTNAME HAS_GETHOST_PROTOS HAS_GETITIMER syn keyword xsMacro HAS_GETLOGIN HAS_GETMNTENT HAS_GETNAMEINFO syn keyword xsMacro HAS_GETNETBYADDR HAS_GETNETBYNAME HAS_GETNETENT syn keyword xsMacro HAS_GETNET_PROTOS HAS_GETPAGESIZE HAS_GETPGID HAS_GETPGRP syn keyword xsMacro HAS_GETPPID HAS_GETPRIORITY HAS_GETPROTOBYNAME syn keyword xsMacro HAS_GETPROTOBYNUMBER HAS_GETPROTOENT HAS_GETPROTO_PROTOS syn keyword xsMacro HAS_GETPWENT HAS_GETSERVBYNAME HAS_GETSERVBYPORT syn keyword xsMacro HAS_GETSERVENT HAS_GETSERV_PROTOS HAS_GETSPNAM syn keyword xsMacro HAS_GETTIMEOFDAY HAS_GNULIBC HAS_GROUP HAS_HASMNTOPT syn keyword xsMacro HAS_HTOVL HAS_HTOVS HAS_ILOGBL HAS_INETNTOP HAS_INETPTON syn keyword xsMacro HAS_INET_ATON HAS_INT64_T HAS_IOCTL HAS_IPV6_MREQ syn keyword xsMacro HAS_ISASCII HAS_ISBLANK HAS_ISINF HAS_ISNAN HAS_ISNANL syn keyword xsMacro HAS_KILL HAS_KILLPG HAS_LCHOWN HAS_LDBL_DIG HAS_LINK syn keyword xsMacro HAS_LOCALECONV HAS_LOCKF HAS_LONG_DOUBLE HAS_LONG_LONG syn keyword xsMacro HAS_LSEEK_PROTO HAS_LSTAT HAS_MADVISE HAS_MBLEN syn keyword xsMacro HAS_MBSTOWCS HAS_MBTOWC HAS_MEMCHR HAS_MEMCMP HAS_MEMCPY syn keyword xsMacro HAS_MEMMOVE HAS_MEMSET HAS_MKDIR HAS_MKDTEMP HAS_MKFIFO syn keyword xsMacro HAS_MKSTEMP HAS_MKSTEMPS HAS_MKTIME HAS_MMAP HAS_MODFL syn keyword xsMacro HAS_MODFL_PROTO HAS_MPROTECT HAS_MSG HAS_MSG_CTRUNC syn keyword xsMacro HAS_MSG_DONTROUTE HAS_MSG_OOB HAS_MSG_PEEK HAS_MSG_PROXY syn keyword xsMacro HAS_MSYNC HAS_MUNMAP HAS_NICE HAS_NL_LANGINFO HAS_OPEN3 syn keyword xsMacro HAS_PASSWD HAS_PATHCONF HAS_PAUSE HAS_PIPE HAS_POLL syn keyword xsMacro HAS_PRCTL HAS_PRCTL_SET_NAME HAS_PROCSELFEXE syn keyword xsMacro HAS_PTHREAD_ATTR_SETSCOPE syn keyword xsMacro HAS_PTHREAD_UNCHECKED_GETSPECIFIC_NP HAS_READDIR syn keyword xsMacro HAS_READLINK HAS_READV HAS_RECVMSG HAS_RENAME syn keyword xsMacro HAS_REWINDDIR HAS_RMDIR HAS_SANE_MEMCMP HAS_SBRK_PROTO syn keyword xsMacro HAS_SCALBNL HAS_SCHED_YIELD HAS_SCM_RIGHTS HAS_SEEKDIR syn keyword xsMacro HAS_SELECT HAS_SEM HAS_SENDMSG HAS_SETEGID HAS_SETEUID syn keyword xsMacro HAS_SETGRENT HAS_SETGROUPS HAS_SETHOSTENT HAS_SETITIMER syn keyword xsMacro HAS_SETLINEBUF HAS_SETLOCALE HAS_SETNETENT HAS_SETPGID syn keyword xsMacro HAS_SETPGRP HAS_SETPRIORITY HAS_SETPROTOENT HAS_SETPWENT syn keyword xsMacro HAS_SETREGID HAS_SETRESGID HAS_SETRESUID HAS_SETREUID syn keyword xsMacro HAS_SETSERVENT HAS_SETSID HAS_SETVBUF HAS_SHM syn keyword xsMacro HAS_SHMAT_PROTOTYPE HAS_SIGACTION HAS_SIGNBIT syn keyword xsMacro HAS_SIGPROCMASK HAS_SIGSETJMP HAS_SIN6_SCOPE_ID syn keyword xsMacro HAS_SNPRINTF HAS_SOCKADDR_IN6 HAS_SOCKATMARK syn keyword xsMacro HAS_SOCKATMARK_PROTO HAS_SOCKET HAS_SQRTL syn keyword xsMacro HAS_STATIC_INLINE HAS_STRCHR HAS_STRCOLL HAS_STRFTIME syn keyword xsMacro HAS_STRTOD HAS_STRTOL HAS_STRTOLD HAS_STRTOLL HAS_STRTOQ syn keyword xsMacro HAS_STRTOUL HAS_STRTOULL HAS_STRTOUQ HAS_STRUCT_CMSGHDR syn keyword xsMacro HAS_STRUCT_MSGHDR HAS_STRUCT_STATFS syn keyword xsMacro HAS_STRUCT_STATFS_F_FLAGS HAS_STRXFRM HAS_SYMLINK syn keyword xsMacro HAS_SYSCALL HAS_SYSCALL_PROTO HAS_SYSCONF HAS_SYSTEM syn keyword xsMacro HAS_SYS_ERRLIST HAS_TCGETPGRP HAS_TCSETPGRP HAS_TELLDIR syn keyword xsMacro HAS_TELLDIR_PROTO HAS_TIME HAS_TIMEGM HAS_TIMES syn keyword xsMacro HAS_TM_TM_GMTOFF HAS_TM_TM_ZONE HAS_TRUNCATE HAS_TZNAME syn keyword xsMacro HAS_UALARM HAS_UMASK HAS_UNAME HAS_UNSETENV HAS_USLEEP syn keyword xsMacro HAS_USLEEP_PROTO HAS_USTAT HAS_UTIME HAS_VPRINTF syn keyword xsMacro HAS_VSNPRINTF HAS_VTOHL HAS_VTOHS HAS_WAIT HAS_WAIT4 syn keyword xsMacro HAS_WAITPID HAS_WCSTOMBS HAS_WCTOMB HAS_WRITEV syn keyword xsMacro HAVE_THREAD_INTERN HEK_BASESIZE HEK_FLAGS HEK_HASH syn keyword xsMacro HEK_KEY HEK_LEN HEK_REHASH HEK_REHASH_on HEK_UTF8 syn keyword xsMacro HEK_UTF8_off HEK_UTF8_on HEK_WASUTF8 HEK_WASUTF8_off syn keyword xsMacro HEK_WASUTF8_on HEKf HEKf256 HEKfARG HE_SVSLOT HEf_SVKEY syn keyword xsMacro HINTS_REFCNT_INIT HINTS_REFCNT_LOCK HINTS_REFCNT_TERM syn keyword xsMacro HINTS_REFCNT_UNLOCK HINT_BLOCK_SCOPE HINT_BYTES syn keyword xsMacro HINT_EXPLICIT_STRICT_REFS HINT_EXPLICIT_STRICT_SUBS syn keyword xsMacro HINT_EXPLICIT_STRICT_VARS HINT_FEATURE_MASK syn keyword xsMacro HINT_FEATURE_SHIFT HINT_FILETEST_ACCESS HINT_INTEGER syn keyword xsMacro HINT_LEXICAL_IO_IN HINT_LEXICAL_IO_OUT HINT_LOCALE syn keyword xsMacro HINT_LOCALE_NOT_CHARS HINT_LOCALIZE_HH HINT_NEW_BINARY syn keyword xsMacro HINT_NEW_FLOAT HINT_NEW_INTEGER HINT_NEW_RE syn keyword xsMacro HINT_NEW_STRING HINT_NO_AMAGIC HINT_RE_EVAL HINT_RE_FLAGS syn keyword xsMacro HINT_RE_TAINT HINT_SORT_MERGESORT HINT_SORT_QUICKSORT syn keyword xsMacro HINT_SORT_SORT_BITS HINT_SORT_STABLE HINT_STRICT_REFS syn keyword xsMacro HINT_STRICT_SUBS HINT_STRICT_VARS HINT_UNI_8_BIT syn keyword xsMacro HINT_UTF8 HORIZWS HV_DELETE HV_DISABLE_UVAR_XKEY syn keyword xsMacro HV_FETCH_EMPTY_HE HV_FETCH_ISEXISTS HV_FETCH_ISSTORE syn keyword xsMacro HV_FETCH_JUST_SV HV_FETCH_LVALUE syn keyword xsMacro HV_ITERNEXT_WANTPLACEHOLDERS HV_NAME_SETALL syn keyword xsMacro HVhek_ENABLEHVKFLAGS HVhek_FREEKEY HVhek_KEYCANONICAL syn keyword xsMacro HVhek_MASK HVhek_PLACEHOLD HVhek_REHASH HVhek_UNSHARED syn keyword xsMacro HVhek_UTF8 HVhek_WASUTF8 HVrhek_IV HVrhek_PV syn keyword xsMacro HVrhek_PV_UTF8 HVrhek_UV HVrhek_delete HVrhek_typemask syn keyword xsMacro HVrhek_undef H_PERL HeHASH HeKEY HeKEY_hek HeKEY_sv syn keyword xsMacro HeKFLAGS HeKLEN HeKLEN_UTF8 HeKREHASH HeKUTF8 HeKWASUTF8 syn keyword xsMacro HeNEXT HePV HeSVKEY HeSVKEY_force HeSVKEY_set HeUTF8 syn keyword xsMacro HeVAL HvARRAY HvAUX HvEITER HvEITER_get HvEITER_set syn keyword xsMacro HvENAME HvENAMELEN HvENAMELEN_get HvENAMEUTF8 HvENAME_HEK syn keyword xsMacro HvENAME_HEK_NN HvENAME_get HvFILL HvHASKFLAGS syn keyword xsMacro HvHASKFLAGS_off HvHASKFLAGS_on HvKEYS HvLAZYDEL syn keyword xsMacro HvLAZYDEL_off HvLAZYDEL_on HvMAX HvMROMETA HvNAME syn keyword xsMacro HvNAMELEN HvNAMELEN_get HvNAMEUTF8 HvNAME_HEK syn keyword xsMacro HvNAME_HEK_NN HvNAME_get HvPLACEHOLDERS syn keyword xsMacro HvPLACEHOLDERS_get HvPLACEHOLDERS_set HvREHASH syn keyword xsMacro HvREHASH_off HvREHASH_on HvRITER HvRITER_get HvRITER_set syn keyword xsMacro HvSHAREKEYS HvSHAREKEYS_off HvSHAREKEYS_on HvTOTALKEYS syn keyword xsMacro HvUSEDKEYS I16SIZE I16TYPE I16_MAX I16_MIN I286 I32SIZE syn keyword xsMacro I32TYPE I32_MAX I32_MAX_P1 I32_MIN I64SIZE I64TYPE I8SIZE syn keyword xsMacro I8TYPE I8_TO_NATIVE IF IFMATCH IFMATCH_A IFMATCH_A_fail syn keyword xsMacro IFTHEN IGNORE_PAT_MOD INIT INIT_THREADS syn keyword xsMacro INIT_TRACK_MEMPOOL INSUBP INT2PTR INT32_MIN INT64_C syn keyword xsMacro INT64_MIN INTSIZE INT_64_T INT_PAT_MODS syn keyword xsMacro INVERSION_UNAFFECTED_FLAGS IN_BYTES IN_LOCALE syn keyword xsMacro IN_LOCALE_COMPILETIME IN_LOCALE_RUNTIME syn keyword xsMacro IN_PERL_COMPILETIME IN_PERL_RUNTIME IN_SOME_LOCALE_FORM syn keyword xsMacro IN_SOME_LOCALE_FORM_COMPILETIME syn keyword xsMacro IN_SOME_LOCALE_FORM_RUNTIME IN_UNI_8_BIT IOCPARM_LEN syn keyword xsMacro IOf_ARGV IOf_DIDTOP IOf_FAKE_DIRP IOf_FLUSH IOf_NOLINE syn keyword xsMacro IOf_START IOf_UNTAINT ISHISH IS_ANYOF_TRIE syn keyword xsMacro IS_NUMBER_GREATER_THAN_UV_MAX IS_NUMBER_INFINITY syn keyword xsMacro IS_NUMBER_IN_UV IS_NUMBER_NAN IS_NUMBER_NEG syn keyword xsMacro IS_NUMBER_NOT_INT IS_NUMERIC_RADIX IS_PADCONST IS_PADGV syn keyword xsMacro IS_TRIE_AC IS_UTF8_CHAR IS_UTF8_CHAR_1 IS_UTF8_CHAR_2 syn keyword xsMacro IS_UTF8_CHAR_3 IS_UTF8_CHAR_3a IS_UTF8_CHAR_3b syn keyword xsMacro IS_UTF8_CHAR_3c IS_UTF8_CHAR_3d IS_UTF8_CHAR_4 syn keyword xsMacro IS_UTF8_CHAR_4a IS_UTF8_CHAR_4b IS_UTF8_CHAR_4c syn keyword xsMacro IS_UTF8_CHAR_5 IS_UTF8_CHAR_5a IS_UTF8_CHAR_5b syn keyword xsMacro IS_UTF8_CHAR_FAST IVSIZE IVTYPE IV_DIG IV_MAX IV_MAX_P1 syn keyword xsMacro IV_MIN I_32 I_ARPA_INET I_ASSERT I_CRYPT I_DBM I_DIRENT syn keyword xsMacro I_DLFCN I_FLOAT I_GDBM I_GDBMNDBM I_GRP I_INTTYPES syn keyword xsMacro I_LANGINFO I_LIMITS I_LOCALE I_MATH I_MNTENT I_NETDB syn keyword xsMacro I_NETINET_IN I_NETINET_TCP I_POLL I_PTHREAD I_PWD syn keyword xsMacro I_SHADOW I_STDARG I_STDBOOL I_STDDEF I_STDLIB I_STRING syn keyword xsMacro I_SYSLOG I_SYSUIO I_SYSUTSNAME I_SYS_DIR I_SYS_FILE syn keyword xsMacro I_SYS_IOCTL I_SYS_MOUNT I_SYS_PARAM I_SYS_POLL syn keyword xsMacro I_SYS_RESOURCE I_SYS_SELECT I_SYS_STAT I_SYS_STATFS syn keyword xsMacro I_SYS_STATVFS I_SYS_TIME I_SYS_TIMES I_SYS_TYPES I_SYS_UN syn keyword xsMacro I_SYS_VFS I_SYS_WAIT I_TERMIOS I_TIME I_UNISTD I_USTAT syn keyword xsMacro I_UTIME I_V I_VALUES IoANY IoBOTTOM_GV IoBOTTOM_NAME syn keyword xsMacro IoDIRP IoFLAGS IoFMT_GV IoFMT_NAME IoIFP IoLINES syn keyword xsMacro IoLINES_LEFT IoOFP IoPAGE IoPAGE_LEN IoTOP_GV IoTOP_NAME syn keyword xsMacro IoTYPE IoTYPE_APPEND IoTYPE_CLOSED IoTYPE_IMPLICIT syn keyword xsMacro IoTYPE_NUMERIC IoTYPE_PIPE IoTYPE_RDONLY IoTYPE_RDWR syn keyword xsMacro IoTYPE_SOCKET IoTYPE_STD IoTYPE_WRONLY IsSet syn keyword xsMacro JMPENV_BOOTSTRAP JMPENV_JUMP JMPENV_POP JMPENV_PUSH JOIN syn keyword xsMacro KEEPCOPY_PAT_MOD KEEPCOPY_PAT_MODS KEEPS KEEPS_next syn keyword xsMacro KEEPS_next_fail KEYWORD_PLUGIN_DECLINE syn keyword xsMacro KEYWORD_PLUGIN_EXPR KEYWORD_PLUGIN_STMT KEY_AUTOLOAD syn keyword xsMacro KEY_BEGIN KEY_CHECK KEY_CORE KEY_DESTROY KEY_END KEY_INIT syn keyword xsMacro KEY_NULL KEY_UNITCHECK KEY___DATA__ KEY___END__ syn keyword xsMacro KEY___FILE__ KEY___LINE__ KEY___PACKAGE__ KEY___SUB__ syn keyword xsMacro KEY_abs KEY_accept KEY_alarm KEY_and KEY_atan2 KEY_bind syn keyword xsMacro KEY_binmode KEY_bless KEY_break KEY_caller KEY_chdir syn keyword xsMacro KEY_chmod KEY_chomp KEY_chop KEY_chown KEY_chr KEY_chroot syn keyword xsMacro KEY_close KEY_closedir KEY_cmp KEY_connect KEY_continue syn keyword xsMacro KEY_cos KEY_crypt KEY_dbmclose KEY_dbmopen KEY_default syn keyword xsMacro KEY_defined KEY_delete KEY_die KEY_do KEY_dump KEY_each syn keyword xsMacro KEY_else KEY_elsif KEY_endgrent KEY_endhostent syn keyword xsMacro KEY_endnetent KEY_endprotoent KEY_endpwent KEY_endservent syn keyword xsMacro KEY_eof KEY_eq KEY_eval KEY_evalbytes KEY_exec KEY_exists syn keyword xsMacro KEY_exit KEY_exp KEY_fc KEY_fcntl KEY_fileno KEY_flock syn keyword xsMacro KEY_for KEY_foreach KEY_fork KEY_format KEY_formline syn keyword xsMacro KEY_ge KEY_getc KEY_getgrent KEY_getgrgid KEY_getgrnam syn keyword xsMacro KEY_gethostbyaddr KEY_gethostbyname KEY_gethostent syn keyword xsMacro KEY_getlogin KEY_getnetbyaddr KEY_getnetbyname syn keyword xsMacro KEY_getnetent KEY_getpeername KEY_getpgrp KEY_getppid syn keyword xsMacro KEY_getpriority KEY_getprotobyname KEY_getprotobynumber syn keyword xsMacro KEY_getprotoent KEY_getpwent KEY_getpwnam KEY_getpwuid syn keyword xsMacro KEY_getservbyname KEY_getservbyport KEY_getservent syn keyword xsMacro KEY_getsockname KEY_getsockopt KEY_given KEY_glob syn keyword xsMacro KEY_gmtime KEY_goto KEY_grep KEY_gt KEY_hex KEY_if syn keyword xsMacro KEY_index KEY_int KEY_ioctl KEY_join KEY_keys KEY_kill syn keyword xsMacro KEY_last KEY_lc KEY_lcfirst KEY_le KEY_length KEY_link syn keyword xsMacro KEY_listen KEY_local KEY_localtime KEY_lock KEY_log syn keyword xsMacro KEY_lstat KEY_lt KEY_m KEY_map KEY_mkdir KEY_msgctl syn keyword xsMacro KEY_msgget KEY_msgrcv KEY_msgsnd KEY_my KEY_ne KEY_next syn keyword xsMacro KEY_no KEY_not KEY_oct KEY_open KEY_opendir KEY_or syn keyword xsMacro KEY_ord KEY_our KEY_pack KEY_package KEY_pipe KEY_pop syn keyword xsMacro KEY_pos KEY_print KEY_printf KEY_prototype KEY_push KEY_q syn keyword xsMacro KEY_qq KEY_qr KEY_quotemeta KEY_qw KEY_qx KEY_rand syn keyword xsMacro KEY_read KEY_readdir KEY_readline KEY_readlink syn keyword xsMacro KEY_readpipe KEY_recv KEY_redo KEY_ref KEY_rename syn keyword xsMacro KEY_require KEY_reset KEY_return KEY_reverse syn keyword xsMacro KEY_rewinddir KEY_rindex KEY_rmdir KEY_s KEY_say syn keyword xsMacro KEY_scalar KEY_seek KEY_seekdir KEY_select KEY_semctl syn keyword xsMacro KEY_semget KEY_semop KEY_send KEY_setgrent KEY_sethostent syn keyword xsMacro KEY_setnetent KEY_setpgrp KEY_setpriority KEY_setprotoent syn keyword xsMacro KEY_setpwent KEY_setservent KEY_setsockopt KEY_shift syn keyword xsMacro KEY_shmctl KEY_shmget KEY_shmread KEY_shmwrite syn keyword xsMacro KEY_shutdown KEY_sin KEY_sleep KEY_socket KEY_socketpair syn keyword xsMacro KEY_sort KEY_splice KEY_split KEY_sprintf KEY_sqrt syn keyword xsMacro KEY_srand KEY_stat KEY_state KEY_study KEY_sub KEY_substr syn keyword xsMacro KEY_symlink KEY_syscall KEY_sysopen KEY_sysread syn keyword xsMacro KEY_sysseek KEY_system KEY_syswrite KEY_tell KEY_telldir syn keyword xsMacro KEY_tie KEY_tied KEY_time KEY_times KEY_tr KEY_truncate syn keyword xsMacro KEY_uc KEY_ucfirst KEY_umask KEY_undef KEY_unless syn keyword xsMacro KEY_unlink KEY_unpack KEY_unshift KEY_untie KEY_until syn keyword xsMacro KEY_use KEY_utime KEY_values KEY_vec KEY_wait KEY_waitpid syn keyword xsMacro KEY_wantarray KEY_warn KEY_when KEY_while KEY_write KEY_x syn keyword xsMacro KEY_xor KEY_y LABEL syn keyword xsMacro LATIN_CAPITAL_LETTER_A_WITH_RING_ABOVE syn keyword xsMacro LATIN_CAPITAL_LETTER_SHARP_S syn keyword xsMacro LATIN_CAPITAL_LETTER_Y_WITH_DIAERESIS syn keyword xsMacro LATIN_SMALL_LETTER_A_WITH_RING_ABOVE syn keyword xsMacro LATIN_SMALL_LETTER_SHARP_S syn keyword xsMacro LATIN_SMALL_LETTER_Y_WITH_DIAERESIS LDBL_DIG LEAVE syn keyword xsMacro LEAVESUB LEAVE_SCOPE LEAVE_with_name LEX_DONT_CLOSE_RSFP syn keyword xsMacro LEX_EVALBYTES LEX_IGNORE_UTF8_HINTS LEX_KEEP_PREVIOUS syn keyword xsMacro LEX_NOTPARSING LEX_START_COPIED LEX_START_FLAGS syn keyword xsMacro LEX_START_SAME_FILTER LEX_STUFF_UTF8 LIBERAL syn keyword xsMacro LIBM_LIB_VERSION LIB_INVARG LIKELY LINKLIST LNBREAK LOCAL syn keyword xsMacro LOCALE_PAT_MOD LOCALE_PAT_MODS LOCALTIME_MAX syn keyword xsMacro LOCALTIME_MIN LOCALTIME_R LOCALTIME_R_PROTO syn keyword xsMacro LOCAL_PATCH_COUNT LOCK_DOLLARZERO_MUTEX LOC_SED LOGICAL syn keyword xsMacro LONGJMP LONGLONGSIZE LONGSIZE LONG_DOUBLESIZE syn keyword xsMacro LONG_DOUBLE_EQUALS_DOUBLE LOOPEX LOOP_PAT_MODS LSEEKSIZE syn keyword xsMacro LSTOP LSTOPSUB LVRET L_R_TZSET LvFLAGS LvTARG LvTARGLEN syn keyword xsMacro LvTARGOFF LvTYPE MADPROP_IN_BASEOP MAD_NULL MAD_OP MAD_PV syn keyword xsMacro MAD_SV MALLOC_CHECK_TAINT MALLOC_CHECK_TAINT2 syn keyword xsMacro MALLOC_CTL_H MALLOC_INIT MALLOC_OVERHEAD MALLOC_TERM syn keyword xsMacro MALLOC_TOO_LATE_FOR MARKPOINT MARKPOINT_next syn keyword xsMacro MARKPOINT_next_fail MASK MATCHOP MAXARG MAXO MAXPATHLEN syn keyword xsMacro MAXSYSFD MAX_CHARSET_NAME_LENGTH MAX_FEATURE_LEN syn keyword xsMacro MAX_PORTABLE_UTF8_TWO_BYTE syn keyword xsMacro MAX_RECURSE_EVAL_NOCHANGE_DEPTH MAYBE_DEREF_GV syn keyword xsMacro MAYBE_DEREF_GV_flags MAYBE_DEREF_GV_nomg MBOL syn keyword xsMacro MEMBER_TO_FPTR MEM_ALIGNBYTES MEM_LOG_ALLOC MEM_LOG_FREE syn keyword xsMacro MEM_LOG_REALLOC MEM_SIZE MEM_SIZE_MAX MEM_WRAP_CHECK syn keyword xsMacro MEM_WRAP_CHECK_ MEM_WRAP_CHECK_1 MEM_WRAP_CHECK_2 MEOL syn keyword xsMacro METHOD MEXTEND MGf_COPY MGf_DUP MGf_GSKIP MGf_LOCAL syn keyword xsMacro MGf_MINMATCH MGf_REFCOUNTED MGf_TAINTEDDIR MICRO_SIGN syn keyword xsMacro MINMOD MJD_OFFSET_DEBUG MRO_GET_PRIVATE_DATA MSPAGAIN syn keyword xsMacro MULOP MULTICALL MULTILINE_PAT_MOD MULTIPLICITY MUTABLE_AV syn keyword xsMacro MUTABLE_CV MUTABLE_GV MUTABLE_HV MUTABLE_IO MUTABLE_PTR syn keyword xsMacro MUTABLE_SV MUTEX_DESTROY MUTEX_INIT syn keyword xsMacro MUTEX_INIT_CALLS_MALLOC MUTEX_INIT_NEEDS_MUTEX_ZEROED syn keyword xsMacro MUTEX_LOCK MUTEX_UNLOCK MY MYSUB MYSWAP MY_CXT_CLONE syn keyword xsMacro MY_CXT_INDEX MY_CXT_INIT MY_CXT_INIT_ARG syn keyword xsMacro MY_CXT_INIT_INTERP M_PAT_MODS M_VOID MgPV MgPV_const syn keyword xsMacro MgPV_nolen_const MgTAINTEDDIR MgTAINTEDDIR_off syn keyword xsMacro MgTAINTEDDIR_on Mkdir Move MoveD NALNUM NALNUMA NALNUML syn keyword xsMacro NALNUMU NATIVE8_TO_UNI NATIVE_IS_INVARIANT syn keyword xsMacro NATIVE_TO_ASCII NATIVE_TO_I8 NATIVE_TO_NEED NATIVE_TO_UNI syn keyword xsMacro NATIVE_TO_UTF NBOUND NBOUNDA NBOUNDL NBOUNDU syn keyword xsMacro NDBM_H_USES_PROTOTYPES NDIGIT NDIGITA NDIGITL syn keyword xsMacro NEED_PTHREAD_INIT NEED_VA_COPY NEGATIVE_INDICES_VAR syn keyword xsMacro NETDB_R_OBSOLETE NEWSV NEXTOPER NEXT_LINE_CHAR NEXT_OFF syn keyword xsMacro NGROUPP NHORIZWS NOAMP NODE_ALIGN NODE_ALIGN_FILL syn keyword xsMacro NODE_STEP_B NODE_STEP_REGNODE NODE_SZ_STR NOLINE syn keyword xsMacro NONDESTRUCT_PAT_MOD NONDESTRUCT_PAT_MODS NOOP syn keyword xsMacro NORETURN_FUNCTION_END NORMAL NOTHING NOTOP NOT_IN_PAD syn keyword xsMacro NO_ENV_ARRAY_IN_MAIN NO_LOCALE syn keyword xsMacro NO_LOCALECONV_MON_THOUSANDS_SEP NREF NREFF NREFFA NREFFL syn keyword xsMacro NREFFU NSIG NSPACE NSPACEA NSPACEL NSPACEU NUM2PTR syn keyword xsMacro NVERTWS NVSIZE NVTYPE NV_DIG NV_EPSILON NV_INF syn keyword xsMacro NV_MANT_DIG NV_MAX NV_MAX_10_EXP NV_MIN NV_MIN_10_EXP syn keyword xsMacro NV_NAN NV_OVERFLOWS_INTEGERS_AT NV_PRESERVES_UV_BITS syn keyword xsMacro NV_WITHIN_IV NV_WITHIN_UV New NewOp NewOpSz Newc Newx syn keyword xsMacro Newxc Newxz Newz NofAMmeth Null Nullav Nullch Nullcv syn keyword xsMacro Nullfp Nullgv Nullhe Nullhek Nullhv Nullop Nullsv OASHIFT syn keyword xsMacro OCSHIFT ONCE_PAT_MOD ONCE_PAT_MODS OPEN OPERAND OPFAIL syn keyword xsMacro OPTIMIZED OP_BINARY OP_CHECK_MUTEX_INIT syn keyword xsMacro OP_CHECK_MUTEX_LOCK OP_CHECK_MUTEX_TERM syn keyword xsMacro OP_CHECK_MUTEX_UNLOCK OP_CLASS OP_DESC OP_GIMME syn keyword xsMacro OP_GIMME_REVERSE OP_IS_DIRHOP OP_IS_FILETEST syn keyword xsMacro OP_IS_FILETEST_ACCESS OP_IS_NUMCOMPARE OP_IS_SOCKET syn keyword xsMacro OP_LVALUE_NO_CROAK OP_MEM_TO_REG OP_NAME OP_REFCNT_INIT syn keyword xsMacro OP_REFCNT_LOCK OP_REFCNT_TERM OP_REFCNT_UNLOCK syn keyword xsMacro OP_REG_TO_MEM OROP OROR OSNAME OSVERS O_CREAT O_RDONLY syn keyword xsMacro O_RDWR O_TEXT O_WRONLY Off Off_t_size OpREFCNT_dec syn keyword xsMacro OpREFCNT_inc OpREFCNT_set OutCopFILE PAD_BASE_SV syn keyword xsMacro PAD_CLONE_VARS PAD_COMPNAME_FLAGS syn keyword xsMacro PAD_COMPNAME_FLAGS_isOUR PAD_COMPNAME_GEN syn keyword xsMacro PAD_COMPNAME_GEN_set PAD_COMPNAME_OURSTASH syn keyword xsMacro PAD_COMPNAME_PV PAD_COMPNAME_SV PAD_COMPNAME_TYPE syn keyword xsMacro PAD_FAKELEX_ANON PAD_FAKELEX_MULTI PAD_RESTORE_LOCAL syn keyword xsMacro PAD_SAVE_LOCAL PAD_SAVE_SETNULLPAD PAD_SETSV PAD_SET_CUR syn keyword xsMacro PAD_SET_CUR_NOSAVE PAD_SV PAD_SVl PARENT_FAKELEX_FLAGS syn keyword xsMacro PARENT_PAD_INDEX PARSE_OPTIONAL PATCHLEVEL PEG PERLDB_ALL syn keyword xsMacro PERLDB_GOTO PERLDB_INTER PERLDB_LINE PERLDB_NAMEANON syn keyword xsMacro PERLDB_NAMEEVAL PERLDB_NOOPT PERLDB_SAVESRC syn keyword xsMacro PERLDB_SAVESRC_INVALID PERLDB_SAVESRC_NOSUBS syn keyword xsMacro PERLDB_SINGLE PERLDB_SUB PERLDB_SUBLINE PERLDB_SUB_NN syn keyword xsMacro PERLDBf_GOTO PERLDBf_INTER PERLDBf_LINE PERLDBf_NAMEANON syn keyword xsMacro PERLDBf_NAMEEVAL PERLDBf_NONAME PERLDBf_NOOPT syn keyword xsMacro PERLDBf_SAVESRC PERLDBf_SAVESRC_INVALID syn keyword xsMacro PERLDBf_SAVESRC_NOSUBS PERLDBf_SINGLE PERLDBf_SUB syn keyword xsMacro PERLDBf_SUBLINE PERLIOBUF_DEFAULT_BUFSIZ PERLIO_DUP_CLONE syn keyword xsMacro PERLIO_DUP_FD PERLIO_FUNCS_CAST PERLIO_FUNCS_CONST syn keyword xsMacro PERLIO_FUNCS_DECL PERLIO_F_APPEND PERLIO_F_CANREAD syn keyword xsMacro PERLIO_F_CANWRITE PERLIO_F_CLEARED PERLIO_F_CRLF syn keyword xsMacro PERLIO_F_EOF PERLIO_F_ERROR PERLIO_F_FASTGETS syn keyword xsMacro PERLIO_F_LINEBUF PERLIO_F_NOTREG PERLIO_F_OPEN syn keyword xsMacro PERLIO_F_RDBUF PERLIO_F_TEMP PERLIO_F_TRUNCATE syn keyword xsMacro PERLIO_F_TTY PERLIO_F_UNBUF PERLIO_F_UTF8 PERLIO_F_WRBUF syn keyword xsMacro PERLIO_INIT PERLIO_IS_STDIO PERLIO_K_BUFFERED syn keyword xsMacro PERLIO_K_CANCRLF PERLIO_K_DESTRUCT PERLIO_K_DUMMY syn keyword xsMacro PERLIO_K_FASTGETS PERLIO_K_MULTIARG PERLIO_K_RAW syn keyword xsMacro PERLIO_K_UTF8 PERLIO_LAYERS PERLIO_NOT_STDIO syn keyword xsMacro PERLIO_STDTEXT PERLIO_TERM PERLIO_USING_CRLF syn keyword xsMacro PERLSI_DESTROY PERLSI_DIEHOOK PERLSI_MAGIC PERLSI_MAIN syn keyword xsMacro PERLSI_OVERLOAD PERLSI_REQUIRE PERLSI_SIGNAL PERLSI_SORT syn keyword xsMacro PERLSI_UNDEF PERLSI_UNKNOWN PERLSI_WARNHOOK PERL_ABS syn keyword xsMacro PERL_ALLOC_CHECK PERL_API_REVISION PERL_API_SUBVERSION syn keyword xsMacro PERL_API_VERSION PERL_API_VERSION_STRING syn keyword xsMacro PERL_ARENA_ROOTS_SIZE PERL_ARENA_SIZE syn keyword xsMacro PERL_ARGS_ASSERT_ADD_ALTERNATE PERL_ARGS_ASSERT_ADD_DATA syn keyword xsMacro PERL_ARGS_ASSERT_ADD_UTF16_TEXTFILTER syn keyword xsMacro PERL_ARGS_ASSERT_ADJUST_STACK_ON_LEAVE syn keyword xsMacro PERL_ARGS_ASSERT_ALLOCMY PERL_ARGS_ASSERT_AMAGIC_CALL syn keyword xsMacro PERL_ARGS_ASSERT_AMAGIC_CMP syn keyword xsMacro PERL_ARGS_ASSERT_AMAGIC_CMP_LOCALE syn keyword xsMacro PERL_ARGS_ASSERT_AMAGIC_DEREF_CALL syn keyword xsMacro PERL_ARGS_ASSERT_AMAGIC_I_NCMP syn keyword xsMacro PERL_ARGS_ASSERT_AMAGIC_NCMP syn keyword xsMacro PERL_ARGS_ASSERT_ANONYMISE_CV_MAYBE syn keyword xsMacro PERL_ARGS_ASSERT_ANY_DUP PERL_ARGS_ASSERT_APPLY syn keyword xsMacro PERL_ARGS_ASSERT_APPLY_ATTRS syn keyword xsMacro PERL_ARGS_ASSERT_APPLY_ATTRS_MY syn keyword xsMacro PERL_ARGS_ASSERT_APPLY_ATTRS_STRING syn keyword xsMacro PERL_ARGS_ASSERT_ASSERT_UFT8_CACHE_COHERENT syn keyword xsMacro PERL_ARGS_ASSERT_AV_ARYLEN_P PERL_ARGS_ASSERT_AV_CLEAR syn keyword xsMacro PERL_ARGS_ASSERT_AV_CREATE_AND_PUSH syn keyword xsMacro PERL_ARGS_ASSERT_AV_CREATE_AND_UNSHIFT_ONE syn keyword xsMacro PERL_ARGS_ASSERT_AV_DELETE PERL_ARGS_ASSERT_AV_EXISTS syn keyword xsMacro PERL_ARGS_ASSERT_AV_EXTEND PERL_ARGS_ASSERT_AV_FETCH syn keyword xsMacro PERL_ARGS_ASSERT_AV_FILL PERL_ARGS_ASSERT_AV_ITER_P syn keyword xsMacro PERL_ARGS_ASSERT_AV_LEN PERL_ARGS_ASSERT_AV_MAKE syn keyword xsMacro PERL_ARGS_ASSERT_AV_POP PERL_ARGS_ASSERT_AV_PUSH syn keyword xsMacro PERL_ARGS_ASSERT_AV_REIFY PERL_ARGS_ASSERT_AV_SHIFT syn keyword xsMacro PERL_ARGS_ASSERT_AV_STORE PERL_ARGS_ASSERT_AV_UNDEF syn keyword xsMacro PERL_ARGS_ASSERT_AV_UNSHIFT PERL_ARGS_ASSERT_BAD_TYPE_PV syn keyword xsMacro PERL_ARGS_ASSERT_BAD_TYPE_SV PERL_ARGS_ASSERT_BIND_MATCH syn keyword xsMacro PERL_ARGS_ASSERT_BLOCKHOOK_REGISTER syn keyword xsMacro PERL_ARGS_ASSERT_BYTES_CMP_UTF8 syn keyword xsMacro PERL_ARGS_ASSERT_BYTES_FROM_UTF8 syn keyword xsMacro PERL_ARGS_ASSERT_BYTES_TO_UNI syn keyword xsMacro PERL_ARGS_ASSERT_BYTES_TO_UTF8 PERL_ARGS_ASSERT_CALL_ARGV syn keyword xsMacro PERL_ARGS_ASSERT_CALL_LIST PERL_ARGS_ASSERT_CALL_METHOD syn keyword xsMacro PERL_ARGS_ASSERT_CALL_PV PERL_ARGS_ASSERT_CALL_SV syn keyword xsMacro PERL_ARGS_ASSERT_CANDO PERL_ARGS_ASSERT_CHECKCOMMA syn keyword xsMacro PERL_ARGS_ASSERT_CHECKPOSIXCC syn keyword xsMacro PERL_ARGS_ASSERT_CHECK_LOCALE_BOUNDARY_CROSSING syn keyword xsMacro PERL_ARGS_ASSERT_CHECK_TYPE_AND_OPEN syn keyword xsMacro PERL_ARGS_ASSERT_CHECK_UTF8_PRINT syn keyword xsMacro PERL_ARGS_ASSERT_CK_ANONCODE PERL_ARGS_ASSERT_CK_BITOP syn keyword xsMacro PERL_ARGS_ASSERT_CK_CHDIR PERL_ARGS_ASSERT_CK_CMP syn keyword xsMacro PERL_ARGS_ASSERT_CK_CONCAT PERL_ARGS_ASSERT_CK_DEFINED syn keyword xsMacro PERL_ARGS_ASSERT_CK_DELETE PERL_ARGS_ASSERT_CK_DIE syn keyword xsMacro PERL_ARGS_ASSERT_CK_EACH syn keyword xsMacro PERL_ARGS_ASSERT_CK_ENTERSUB_ARGS_CORE syn keyword xsMacro PERL_ARGS_ASSERT_CK_ENTERSUB_ARGS_LIST syn keyword xsMacro PERL_ARGS_ASSERT_CK_ENTERSUB_ARGS_PROTO syn keyword xsMacro PERL_ARGS_ASSERT_CK_ENTERSUB_ARGS_PROTO_OR_LIST syn keyword xsMacro PERL_ARGS_ASSERT_CK_EOF PERL_ARGS_ASSERT_CK_EVAL syn keyword xsMacro PERL_ARGS_ASSERT_CK_EXEC PERL_ARGS_ASSERT_CK_EXISTS syn keyword xsMacro PERL_ARGS_ASSERT_CK_EXIT PERL_ARGS_ASSERT_CK_FTST syn keyword xsMacro PERL_ARGS_ASSERT_CK_FUN PERL_ARGS_ASSERT_CK_GLOB syn keyword xsMacro PERL_ARGS_ASSERT_CK_GREP PERL_ARGS_ASSERT_CK_INDEX syn keyword xsMacro PERL_ARGS_ASSERT_CK_JOIN PERL_ARGS_ASSERT_CK_LENGTH syn keyword xsMacro PERL_ARGS_ASSERT_CK_LFUN PERL_ARGS_ASSERT_CK_LISTIOB syn keyword xsMacro PERL_ARGS_ASSERT_CK_MATCH PERL_ARGS_ASSERT_CK_METHOD syn keyword xsMacro PERL_ARGS_ASSERT_CK_NULL PERL_ARGS_ASSERT_CK_OPEN syn keyword xsMacro PERL_ARGS_ASSERT_CK_READLINE PERL_ARGS_ASSERT_CK_REPEAT syn keyword xsMacro PERL_ARGS_ASSERT_CK_REQUIRE PERL_ARGS_ASSERT_CK_RETURN syn keyword xsMacro PERL_ARGS_ASSERT_CK_RFUN PERL_ARGS_ASSERT_CK_RVCONST syn keyword xsMacro PERL_ARGS_ASSERT_CK_SASSIGN PERL_ARGS_ASSERT_CK_SELECT syn keyword xsMacro PERL_ARGS_ASSERT_CK_SHIFT PERL_ARGS_ASSERT_CK_SMARTMATCH syn keyword xsMacro PERL_ARGS_ASSERT_CK_SORT PERL_ARGS_ASSERT_CK_SPAIR syn keyword xsMacro PERL_ARGS_ASSERT_CK_SPLIT PERL_ARGS_ASSERT_CK_SUBR syn keyword xsMacro PERL_ARGS_ASSERT_CK_SUBSTR PERL_ARGS_ASSERT_CK_SVCONST syn keyword xsMacro PERL_ARGS_ASSERT_CK_TELL PERL_ARGS_ASSERT_CK_TRUNC syn keyword xsMacro PERL_ARGS_ASSERT_CK_WARNER PERL_ARGS_ASSERT_CK_WARNER_D syn keyword xsMacro PERL_ARGS_ASSERT_CLEAR_PLACEHOLDERS syn keyword xsMacro PERL_ARGS_ASSERT_CLONE_PARAMS_DEL syn keyword xsMacro PERL_ARGS_ASSERT_CLONE_PARAMS_NEW syn keyword xsMacro PERL_ARGS_ASSERT_CLOSEST_COP PERL_ARGS_ASSERT_CL_AND syn keyword xsMacro PERL_ARGS_ASSERT_CL_ANYTHING PERL_ARGS_ASSERT_CL_INIT syn keyword xsMacro PERL_ARGS_ASSERT_CL_IS_ANYTHING PERL_ARGS_ASSERT_CL_OR syn keyword xsMacro PERL_ARGS_ASSERT_COP_FETCH_LABEL syn keyword xsMacro PERL_ARGS_ASSERT_COP_FREE syn keyword xsMacro PERL_ARGS_ASSERT_COP_STORE_LABEL syn keyword xsMacro PERL_ARGS_ASSERT_CORESUB_OP syn keyword xsMacro PERL_ARGS_ASSERT_CORE_PROTOTYPE syn keyword xsMacro PERL_ARGS_ASSERT_CORE_REGCLASS_SWASH syn keyword xsMacro PERL_ARGS_ASSERT_CROAK_SV PERL_ARGS_ASSERT_CROAK_XS_USAGE syn keyword xsMacro PERL_ARGS_ASSERT_CURSE PERL_ARGS_ASSERT_CUSTOM_OP_DESC syn keyword xsMacro PERL_ARGS_ASSERT_CUSTOM_OP_NAME syn keyword xsMacro PERL_ARGS_ASSERT_CUSTOM_OP_REGISTER syn keyword xsMacro PERL_ARGS_ASSERT_CUSTOM_OP_XOP PERL_ARGS_ASSERT_CVGV_SET syn keyword xsMacro PERL_ARGS_ASSERT_CVSTASH_SET syn keyword xsMacro PERL_ARGS_ASSERT_CV_CKPROTO_LEN_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_CV_CLONE PERL_ARGS_ASSERT_CV_DUMP syn keyword xsMacro PERL_ARGS_ASSERT_CV_GET_CALL_CHECKER syn keyword xsMacro PERL_ARGS_ASSERT_CV_SET_CALL_CHECKER syn keyword xsMacro PERL_ARGS_ASSERT_CV_UNDEF PERL_ARGS_ASSERT_CX_DUMP syn keyword xsMacro PERL_ARGS_ASSERT_CX_DUP PERL_ARGS_ASSERT_DEB syn keyword xsMacro PERL_ARGS_ASSERT_DEBOP PERL_ARGS_ASSERT_DEBPROF syn keyword xsMacro PERL_ARGS_ASSERT_DEBUG_START_MATCH syn keyword xsMacro PERL_ARGS_ASSERT_DEB_NOCONTEXT syn keyword xsMacro PERL_ARGS_ASSERT_DEB_STACK_N PERL_ARGS_ASSERT_DELIMCPY syn keyword xsMacro PERL_ARGS_ASSERT_DEL_SV PERL_ARGS_ASSERT_DESTROY_MATCHER syn keyword xsMacro PERL_ARGS_ASSERT_DIE_SV PERL_ARGS_ASSERT_DIE_UNWIND syn keyword xsMacro PERL_ARGS_ASSERT_DIRP_DUP PERL_ARGS_ASSERT_DIV128 syn keyword xsMacro PERL_ARGS_ASSERT_DOFILE PERL_ARGS_ASSERT_DOFINDLABEL syn keyword xsMacro PERL_ARGS_ASSERT_DOFORM PERL_ARGS_ASSERT_DOONELINER syn keyword xsMacro PERL_ARGS_ASSERT_DOOPEN_PM PERL_ARGS_ASSERT_DOPARSEFORM syn keyword xsMacro PERL_ARGS_ASSERT_DOPOPTOLABEL syn keyword xsMacro PERL_ARGS_ASSERT_DOPOPTOSUB_AT PERL_ARGS_ASSERT_DOREF syn keyword xsMacro PERL_ARGS_ASSERT_DO_AEXEC PERL_ARGS_ASSERT_DO_AEXEC5 syn keyword xsMacro PERL_ARGS_ASSERT_DO_ASPAWN PERL_ARGS_ASSERT_DO_BINMODE syn keyword xsMacro PERL_ARGS_ASSERT_DO_CHOMP PERL_ARGS_ASSERT_DO_DUMP_PAD syn keyword xsMacro PERL_ARGS_ASSERT_DO_EOF PERL_ARGS_ASSERT_DO_EXEC syn keyword xsMacro PERL_ARGS_ASSERT_DO_EXEC3 PERL_ARGS_ASSERT_DO_GVGV_DUMP syn keyword xsMacro PERL_ARGS_ASSERT_DO_GV_DUMP PERL_ARGS_ASSERT_DO_HV_DUMP syn keyword xsMacro PERL_ARGS_ASSERT_DO_IPCCTL PERL_ARGS_ASSERT_DO_IPCGET syn keyword xsMacro PERL_ARGS_ASSERT_DO_JOIN PERL_ARGS_ASSERT_DO_MAGIC_DUMP syn keyword xsMacro PERL_ARGS_ASSERT_DO_MSGRCV PERL_ARGS_ASSERT_DO_MSGSND syn keyword xsMacro PERL_ARGS_ASSERT_DO_NCMP PERL_ARGS_ASSERT_DO_ODDBALL syn keyword xsMacro PERL_ARGS_ASSERT_DO_OPEN PERL_ARGS_ASSERT_DO_OPEN9 syn keyword xsMacro PERL_ARGS_ASSERT_DO_OPENN PERL_ARGS_ASSERT_DO_OP_DUMP syn keyword xsMacro PERL_ARGS_ASSERT_DO_OP_XMLDUMP syn keyword xsMacro PERL_ARGS_ASSERT_DO_PMOP_DUMP syn keyword xsMacro PERL_ARGS_ASSERT_DO_PMOP_XMLDUMP syn keyword xsMacro PERL_ARGS_ASSERT_DO_PRINT PERL_ARGS_ASSERT_DO_SEMOP syn keyword xsMacro PERL_ARGS_ASSERT_DO_SHMIO PERL_ARGS_ASSERT_DO_SPAWN syn keyword xsMacro PERL_ARGS_ASSERT_DO_SPAWN_NOWAIT syn keyword xsMacro PERL_ARGS_ASSERT_DO_SPRINTF PERL_ARGS_ASSERT_DO_SV_DUMP syn keyword xsMacro PERL_ARGS_ASSERT_DO_SYSSEEK PERL_ARGS_ASSERT_DO_TELL syn keyword xsMacro PERL_ARGS_ASSERT_DO_TRANS syn keyword xsMacro PERL_ARGS_ASSERT_DO_TRANS_COMPLEX syn keyword xsMacro PERL_ARGS_ASSERT_DO_TRANS_COMPLEX_UTF8 syn keyword xsMacro PERL_ARGS_ASSERT_DO_TRANS_COUNT syn keyword xsMacro PERL_ARGS_ASSERT_DO_TRANS_COUNT_UTF8 syn keyword xsMacro PERL_ARGS_ASSERT_DO_TRANS_SIMPLE syn keyword xsMacro PERL_ARGS_ASSERT_DO_TRANS_SIMPLE_UTF8 syn keyword xsMacro PERL_ARGS_ASSERT_DO_VECGET PERL_ARGS_ASSERT_DO_VECSET syn keyword xsMacro PERL_ARGS_ASSERT_DO_VOP PERL_ARGS_ASSERT_DUMPUNTIL syn keyword xsMacro PERL_ARGS_ASSERT_DUMP_EXEC_POS PERL_ARGS_ASSERT_DUMP_FDS syn keyword xsMacro PERL_ARGS_ASSERT_DUMP_FORM PERL_ARGS_ASSERT_DUMP_INDENT syn keyword xsMacro PERL_ARGS_ASSERT_DUMP_MSTATS syn keyword xsMacro PERL_ARGS_ASSERT_DUMP_PACKSUBS syn keyword xsMacro PERL_ARGS_ASSERT_DUMP_PACKSUBS_PERL syn keyword xsMacro PERL_ARGS_ASSERT_DUMP_SUB PERL_ARGS_ASSERT_DUMP_SUB_PERL syn keyword xsMacro PERL_ARGS_ASSERT_DUMP_SV_CHILD PERL_ARGS_ASSERT_DUMP_TRIE syn keyword xsMacro PERL_ARGS_ASSERT_DUMP_TRIE_INTERIM_LIST syn keyword xsMacro PERL_ARGS_ASSERT_DUMP_TRIE_INTERIM_TABLE syn keyword xsMacro PERL_ARGS_ASSERT_DUMP_VINDENT syn keyword xsMacro PERL_ARGS_ASSERT_DUP_ATTRLIST syn keyword xsMacro PERL_ARGS_ASSERT_EMULATE_COP_IO PERL_ARGS_ASSERT_EVAL_PV syn keyword xsMacro PERL_ARGS_ASSERT_EVAL_SV PERL_ARGS_ASSERT_EXEC_FAILED syn keyword xsMacro PERL_ARGS_ASSERT_EXPECT_NUMBER PERL_ARGS_ASSERT_F0CONVERT syn keyword xsMacro PERL_ARGS_ASSERT_FBM_COMPILE PERL_ARGS_ASSERT_FBM_INSTR syn keyword xsMacro PERL_ARGS_ASSERT_FEATURE_IS_ENABLED syn keyword xsMacro PERL_ARGS_ASSERT_FILTER_DEL PERL_ARGS_ASSERT_FILTER_GETS syn keyword xsMacro PERL_ARGS_ASSERT_FILTER_READ PERL_ARGS_ASSERT_FINALIZE_OP syn keyword xsMacro PERL_ARGS_ASSERT_FINALIZE_OPTREE syn keyword xsMacro PERL_ARGS_ASSERT_FIND_AND_FORGET_PMOPS syn keyword xsMacro PERL_ARGS_ASSERT_FIND_ARRAY_SUBSCRIPT syn keyword xsMacro PERL_ARGS_ASSERT_FIND_BEGINNING syn keyword xsMacro PERL_ARGS_ASSERT_FIND_BYCLASS syn keyword xsMacro PERL_ARGS_ASSERT_FIND_HASH_SUBSCRIPT syn keyword xsMacro PERL_ARGS_ASSERT_FIND_IN_MY_STASH syn keyword xsMacro PERL_ARGS_ASSERT_FIND_RUNDEFSV2 syn keyword xsMacro PERL_ARGS_ASSERT_FIND_SCRIPT syn keyword xsMacro PERL_ARGS_ASSERT_FIRST_SYMBOL PERL_ARGS_ASSERT_FOLDEQ syn keyword xsMacro PERL_ARGS_ASSERT_FOLDEQ_LATIN1 syn keyword xsMacro PERL_ARGS_ASSERT_FOLDEQ_LOCALE syn keyword xsMacro PERL_ARGS_ASSERT_FOLDEQ_UTF8_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_FOLD_CONSTANTS syn keyword xsMacro PERL_ARGS_ASSERT_FORCE_IDENT syn keyword xsMacro PERL_ARGS_ASSERT_FORCE_STRICT_VERSION syn keyword xsMacro PERL_ARGS_ASSERT_FORCE_VERSION syn keyword xsMacro PERL_ARGS_ASSERT_FORCE_WORD PERL_ARGS_ASSERT_FORGET_PMOP syn keyword xsMacro PERL_ARGS_ASSERT_FORM PERL_ARGS_ASSERT_FORM_NOCONTEXT syn keyword xsMacro PERL_ARGS_ASSERT_FPRINTF_NOCONTEXT syn keyword xsMacro PERL_ARGS_ASSERT_FP_DUP syn keyword xsMacro PERL_ARGS_ASSERT_FREE_GLOBAL_STRUCT syn keyword xsMacro PERL_ARGS_ASSERT_GETCWD_SV PERL_ARGS_ASSERT_GETENV_LEN syn keyword xsMacro PERL_ARGS_ASSERT_GET_AUX_MG PERL_ARGS_ASSERT_GET_AV syn keyword xsMacro PERL_ARGS_ASSERT_GET_CV PERL_ARGS_ASSERT_GET_CVN_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_GET_DB_SUB syn keyword xsMacro PERL_ARGS_ASSERT_GET_DEBUG_OPTS PERL_ARGS_ASSERT_GET_HV syn keyword xsMacro PERL_ARGS_ASSERT_GET_INVLIST_ITER_ADDR syn keyword xsMacro PERL_ARGS_ASSERT_GET_INVLIST_LEN_ADDR syn keyword xsMacro PERL_ARGS_ASSERT_GET_INVLIST_VERSION_ID_ADDR syn keyword xsMacro PERL_ARGS_ASSERT_GET_INVLIST_ZERO_ADDR syn keyword xsMacro PERL_ARGS_ASSERT_GET_MSTATS PERL_ARGS_ASSERT_GET_NUM syn keyword xsMacro PERL_ARGS_ASSERT_GET_SV PERL_ARGS_ASSERT_GLOB_2NUMBER syn keyword xsMacro PERL_ARGS_ASSERT_GLOB_ASSIGN_GLOB syn keyword xsMacro PERL_ARGS_ASSERT_GLOB_ASSIGN_REF PERL_ARGS_ASSERT_GP_DUP syn keyword xsMacro PERL_ARGS_ASSERT_GROK_BIN PERL_ARGS_ASSERT_GROK_BSLASH_O syn keyword xsMacro PERL_ARGS_ASSERT_GROK_HEX PERL_ARGS_ASSERT_GROK_NUMBER syn keyword xsMacro PERL_ARGS_ASSERT_GROK_NUMERIC_RADIX syn keyword xsMacro PERL_ARGS_ASSERT_GROK_OCT PERL_ARGS_ASSERT_GROUP_END syn keyword xsMacro PERL_ARGS_ASSERT_GV_AMUPDATE syn keyword xsMacro PERL_ARGS_ASSERT_GV_AUTOLOAD_PV syn keyword xsMacro PERL_ARGS_ASSERT_GV_AUTOLOAD_PVN syn keyword xsMacro PERL_ARGS_ASSERT_GV_AUTOLOAD_SV PERL_ARGS_ASSERT_GV_CHECK syn keyword xsMacro PERL_ARGS_ASSERT_GV_CONST_SV PERL_ARGS_ASSERT_GV_DUMP syn keyword xsMacro PERL_ARGS_ASSERT_GV_EFULLNAME syn keyword xsMacro PERL_ARGS_ASSERT_GV_EFULLNAME3 syn keyword xsMacro PERL_ARGS_ASSERT_GV_EFULLNAME4 PERL_ARGS_ASSERT_GV_ENAME syn keyword xsMacro PERL_ARGS_ASSERT_GV_FETCHFILE syn keyword xsMacro PERL_ARGS_ASSERT_GV_FETCHFILE_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_GV_FETCHMETHOD syn keyword xsMacro PERL_ARGS_ASSERT_GV_FETCHMETHOD_AUTOLOAD syn keyword xsMacro PERL_ARGS_ASSERT_GV_FETCHMETHOD_PVN_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_GV_FETCHMETHOD_PV_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_GV_FETCHMETHOD_SV_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_GV_FETCHMETH_PV syn keyword xsMacro PERL_ARGS_ASSERT_GV_FETCHMETH_PVN syn keyword xsMacro PERL_ARGS_ASSERT_GV_FETCHMETH_PVN_AUTOLOAD syn keyword xsMacro PERL_ARGS_ASSERT_GV_FETCHMETH_PV_AUTOLOAD syn keyword xsMacro PERL_ARGS_ASSERT_GV_FETCHMETH_SV syn keyword xsMacro PERL_ARGS_ASSERT_GV_FETCHMETH_SV_AUTOLOAD syn keyword xsMacro PERL_ARGS_ASSERT_GV_FETCHPV syn keyword xsMacro PERL_ARGS_ASSERT_GV_FETCHPVN_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_GV_FETCHSV PERL_ARGS_ASSERT_GV_FULLNAME syn keyword xsMacro PERL_ARGS_ASSERT_GV_FULLNAME3 syn keyword xsMacro PERL_ARGS_ASSERT_GV_FULLNAME4 syn keyword xsMacro PERL_ARGS_ASSERT_GV_GET_SUPER_PKG syn keyword xsMacro PERL_ARGS_ASSERT_GV_INIT_PV PERL_ARGS_ASSERT_GV_INIT_PVN syn keyword xsMacro PERL_ARGS_ASSERT_GV_INIT_SV syn keyword xsMacro PERL_ARGS_ASSERT_GV_INIT_SVTYPE syn keyword xsMacro PERL_ARGS_ASSERT_GV_MAGICALIZE_ISA syn keyword xsMacro PERL_ARGS_ASSERT_GV_MAGICALIZE_OVERLOAD syn keyword xsMacro PERL_ARGS_ASSERT_GV_NAME_SET PERL_ARGS_ASSERT_GV_STASHPV syn keyword xsMacro PERL_ARGS_ASSERT_GV_STASHPVN PERL_ARGS_ASSERT_GV_STASHSV syn keyword xsMacro PERL_ARGS_ASSERT_GV_TRY_DOWNGRADE syn keyword xsMacro PERL_ARGS_ASSERT_HEK_DUP PERL_ARGS_ASSERT_HE_DUP syn keyword xsMacro PERL_ARGS_ASSERT_HFREEENTRIES syn keyword xsMacro PERL_ARGS_ASSERT_HFREE_NEXT_ENTRY PERL_ARGS_ASSERT_HSPLIT syn keyword xsMacro PERL_ARGS_ASSERT_HV_ASSERT PERL_ARGS_ASSERT_HV_AUXINIT syn keyword xsMacro PERL_ARGS_ASSERT_HV_BACKREFERENCES_P syn keyword xsMacro PERL_ARGS_ASSERT_HV_CLEAR_PLACEHOLDERS syn keyword xsMacro PERL_ARGS_ASSERT_HV_COMMON_KEY_LEN syn keyword xsMacro PERL_ARGS_ASSERT_HV_DELAYFREE_ENT syn keyword xsMacro PERL_ARGS_ASSERT_HV_DELETE PERL_ARGS_ASSERT_HV_DELETE_ENT syn keyword xsMacro PERL_ARGS_ASSERT_HV_EITER_P PERL_ARGS_ASSERT_HV_EITER_SET syn keyword xsMacro PERL_ARGS_ASSERT_HV_ENAME_ADD syn keyword xsMacro PERL_ARGS_ASSERT_HV_ENAME_DELETE syn keyword xsMacro PERL_ARGS_ASSERT_HV_EXISTS PERL_ARGS_ASSERT_HV_EXISTS_ENT syn keyword xsMacro PERL_ARGS_ASSERT_HV_FETCH PERL_ARGS_ASSERT_HV_FETCH_ENT syn keyword xsMacro PERL_ARGS_ASSERT_HV_FILL PERL_ARGS_ASSERT_HV_FREE_ENT syn keyword xsMacro PERL_ARGS_ASSERT_HV_FREE_ENT_RET syn keyword xsMacro PERL_ARGS_ASSERT_HV_ITERINIT PERL_ARGS_ASSERT_HV_ITERKEY syn keyword xsMacro PERL_ARGS_ASSERT_HV_ITERKEYSV syn keyword xsMacro PERL_ARGS_ASSERT_HV_ITERNEXT syn keyword xsMacro PERL_ARGS_ASSERT_HV_ITERNEXTSV syn keyword xsMacro PERL_ARGS_ASSERT_HV_ITERNEXT_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_HV_ITERVAL syn keyword xsMacro PERL_ARGS_ASSERT_HV_KILL_BACKREFS syn keyword xsMacro PERL_ARGS_ASSERT_HV_KSPLIT PERL_ARGS_ASSERT_HV_MAGIC syn keyword xsMacro PERL_ARGS_ASSERT_HV_MAGIC_CHECK syn keyword xsMacro PERL_ARGS_ASSERT_HV_NAME_SET syn keyword xsMacro PERL_ARGS_ASSERT_HV_NOTALLOWED syn keyword xsMacro PERL_ARGS_ASSERT_HV_PLACEHOLDERS_GET syn keyword xsMacro PERL_ARGS_ASSERT_HV_PLACEHOLDERS_P syn keyword xsMacro PERL_ARGS_ASSERT_HV_PLACEHOLDERS_SET syn keyword xsMacro PERL_ARGS_ASSERT_HV_RITER_P PERL_ARGS_ASSERT_HV_RITER_SET syn keyword xsMacro PERL_ARGS_ASSERT_HV_SCALAR PERL_ARGS_ASSERT_INCLINE syn keyword xsMacro PERL_ARGS_ASSERT_INCPUSH syn keyword xsMacro PERL_ARGS_ASSERT_INCPUSH_IF_EXISTS syn keyword xsMacro PERL_ARGS_ASSERT_INCPUSH_USE_SEP syn keyword xsMacro PERL_ARGS_ASSERT_INIT_ARGV_SYMBOLS syn keyword xsMacro PERL_ARGS_ASSERT_INIT_POSTDUMP_SYMBOLS syn keyword xsMacro PERL_ARGS_ASSERT_INIT_TM PERL_ARGS_ASSERT_INPLACE_AASSIGN syn keyword xsMacro PERL_ARGS_ASSERT_INSTR PERL_ARGS_ASSERT_INTUIT_METHOD syn keyword xsMacro PERL_ARGS_ASSERT_INTUIT_MORE syn keyword xsMacro PERL_ARGS_ASSERT_INVLIST_ARRAY syn keyword xsMacro PERL_ARGS_ASSERT_INVLIST_CLONE syn keyword xsMacro PERL_ARGS_ASSERT_INVLIST_EXTEND syn keyword xsMacro PERL_ARGS_ASSERT_INVLIST_ITERINIT syn keyword xsMacro PERL_ARGS_ASSERT_INVLIST_ITERNEXT syn keyword xsMacro PERL_ARGS_ASSERT_INVLIST_LEN PERL_ARGS_ASSERT_INVLIST_MAX syn keyword xsMacro PERL_ARGS_ASSERT_INVLIST_SEARCH syn keyword xsMacro PERL_ARGS_ASSERT_INVLIST_SET_LEN syn keyword xsMacro PERL_ARGS_ASSERT_INVLIST_TRIM PERL_ARGS_ASSERT_IO_CLOSE syn keyword xsMacro PERL_ARGS_ASSERT_ISA_LOOKUP PERL_ARGS_ASSERT_IS_AN_INT syn keyword xsMacro PERL_ARGS_ASSERT_IS_ASCII_STRING syn keyword xsMacro PERL_ARGS_ASSERT_IS_HANDLE_CONSTRUCTOR syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_ALNUM syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_ALPHA syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_ASCII syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_CHAR syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_CHAR_BUF syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_CHAR_SLOW syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_CNTRL syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_COMMON syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_DIGIT syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_GRAPH syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_IDCONT syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_IDFIRST syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_LOWER syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_MARK syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_PERL_SPACE syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_PERL_WORD syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_POSIX_DIGIT syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_PRINT syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_PUNCT syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_SPACE syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_STRING syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_STRING_LOC syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_STRING_LOCLEN syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_UPPER syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_XDIGIT syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_XIDCONT syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_XIDFIRST syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_X_BEGIN syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_X_EXTEND syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_X_L syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_X_LV syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_X_LVT syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_X_LV_LVT_V syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_X_NON_HANGUL syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_X_PREPEND syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_X_T PERL_ARGS_ASSERT_IS_UTF8_X_V syn keyword xsMacro PERL_ARGS_ASSERT_JMAYBE PERL_ARGS_ASSERT_JOIN_EXACT syn keyword xsMacro PERL_ARGS_ASSERT_KEYWORD syn keyword xsMacro PERL_ARGS_ASSERT_KEYWORD_PLUGIN_STANDARD syn keyword xsMacro PERL_ARGS_ASSERT_LEX_DISCARD_TO syn keyword xsMacro PERL_ARGS_ASSERT_LEX_READ_TO syn keyword xsMacro PERL_ARGS_ASSERT_LEX_STUFF_PV syn keyword xsMacro PERL_ARGS_ASSERT_LEX_STUFF_PVN syn keyword xsMacro PERL_ARGS_ASSERT_LEX_STUFF_SV syn keyword xsMacro PERL_ARGS_ASSERT_LEX_UNSTUFF PERL_ARGS_ASSERT_LOAD_MODULE syn keyword xsMacro PERL_ARGS_ASSERT_LOAD_MODULE_NOCONTEXT syn keyword xsMacro PERL_ARGS_ASSERT_LOCALIZE syn keyword xsMacro PERL_ARGS_ASSERT_LOOKS_LIKE_BOOL syn keyword xsMacro PERL_ARGS_ASSERT_LOOKS_LIKE_NUMBER PERL_ARGS_ASSERT_LOP syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_CLEARENV syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_CLEARHINT syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_CLEARHINTS syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_CLEARISA syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_CLEARPACK syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_CLEARSIG syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_CLEAR_ALL_ENV syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_EXISTSPACK syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_FREEARYLEN_P syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_FREEOVRLD syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_GET syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_GETARYLEN syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_GETDEFELEM syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_GETNKEYS syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_GETPACK syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_GETPOS syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_GETSIG syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_GETSUBSTR syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_GETTAINT syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_GETUVAR syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_GETVEC syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_KILLBACKREFS syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_LEN syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_METHCALL syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_METHCALL1 syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_METHPACK syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_NEXTPACK syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_REGDATA_CNT syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_REGDATUM_GET syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_REGDATUM_SET syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SCALARPACK syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SET syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SETAMAGIC syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SETARYLEN syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SETCOLLXFRM syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SETDBLINE syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SETDEFELEM syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SETENV syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SETHINT syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SETISA syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SETMGLOB syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SETNKEYS syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SETPACK syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SETPOS syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SETREGEXP syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SETSIG syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SETSUBSTR syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SETTAINT syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SETUTF8 syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SETUVAR syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SETVEC syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SETVSTRING syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SET_ALL_ENV syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SIZEPACK syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_WIPEPACK syn keyword xsMacro PERL_ARGS_ASSERT_MAKE_MATCHER PERL_ARGS_ASSERT_MAKE_TRIE syn keyword xsMacro PERL_ARGS_ASSERT_MAKE_TRIE_FAILTABLE syn keyword xsMacro PERL_ARGS_ASSERT_MALLOCED_SIZE syn keyword xsMacro PERL_ARGS_ASSERT_MATCHER_MATCHES_SV syn keyword xsMacro PERL_ARGS_ASSERT_MAYBERELOCATE syn keyword xsMacro PERL_ARGS_ASSERT_MEASURE_STRUCT syn keyword xsMacro PERL_ARGS_ASSERT_MEM_COLLXFRM syn keyword xsMacro PERL_ARGS_ASSERT_MEM_LOG_COMMON PERL_ARGS_ASSERT_MESS syn keyword xsMacro PERL_ARGS_ASSERT_MESS_NOCONTEXT PERL_ARGS_ASSERT_MESS_SV syn keyword xsMacro PERL_ARGS_ASSERT_METHOD_COMMON PERL_ARGS_ASSERT_MG_CLEAR syn keyword xsMacro PERL_ARGS_ASSERT_MG_COPY PERL_ARGS_ASSERT_MG_DUP syn keyword xsMacro PERL_ARGS_ASSERT_MG_FREE PERL_ARGS_ASSERT_MG_FREE_TYPE syn keyword xsMacro PERL_ARGS_ASSERT_MG_GET PERL_ARGS_ASSERT_MG_LENGTH syn keyword xsMacro PERL_ARGS_ASSERT_MG_LOCALIZE PERL_ARGS_ASSERT_MG_MAGICAL syn keyword xsMacro PERL_ARGS_ASSERT_MG_SET PERL_ARGS_ASSERT_MG_SIZE syn keyword xsMacro PERL_ARGS_ASSERT_MINI_MKTIME syn keyword xsMacro PERL_ARGS_ASSERT_MORESWITCHES syn keyword xsMacro PERL_ARGS_ASSERT_MRO_CLEAN_ISAREV syn keyword xsMacro PERL_ARGS_ASSERT_MRO_GATHER_AND_RENAME syn keyword xsMacro PERL_ARGS_ASSERT_MRO_GET_FROM_NAME syn keyword xsMacro PERL_ARGS_ASSERT_MRO_GET_LINEAR_ISA syn keyword xsMacro PERL_ARGS_ASSERT_MRO_GET_LINEAR_ISA_DFS syn keyword xsMacro PERL_ARGS_ASSERT_MRO_GET_PRIVATE_DATA syn keyword xsMacro PERL_ARGS_ASSERT_MRO_ISA_CHANGED_IN syn keyword xsMacro PERL_ARGS_ASSERT_MRO_META_DUP syn keyword xsMacro PERL_ARGS_ASSERT_MRO_META_INIT syn keyword xsMacro PERL_ARGS_ASSERT_MRO_METHOD_CHANGED_IN syn keyword xsMacro PERL_ARGS_ASSERT_MRO_PACKAGE_MOVED syn keyword xsMacro PERL_ARGS_ASSERT_MRO_REGISTER syn keyword xsMacro PERL_ARGS_ASSERT_MRO_SET_MRO syn keyword xsMacro PERL_ARGS_ASSERT_MRO_SET_PRIVATE_DATA syn keyword xsMacro PERL_ARGS_ASSERT_MUL128 syn keyword xsMacro PERL_ARGS_ASSERT_MUNGE_QWLIST_TO_PAREN_LIST syn keyword xsMacro PERL_ARGS_ASSERT_MY_ATOF PERL_ARGS_ASSERT_MY_ATOF2 syn keyword xsMacro PERL_ARGS_ASSERT_MY_ATTRS PERL_ARGS_ASSERT_MY_BCOPY syn keyword xsMacro PERL_ARGS_ASSERT_MY_BZERO PERL_ARGS_ASSERT_MY_CXT_INDEX syn keyword xsMacro PERL_ARGS_ASSERT_MY_CXT_INIT PERL_ARGS_ASSERT_MY_KID syn keyword xsMacro PERL_ARGS_ASSERT_MY_MEMCMP PERL_ARGS_ASSERT_MY_MEMSET syn keyword xsMacro PERL_ARGS_ASSERT_MY_POPEN PERL_ARGS_ASSERT_MY_POPEN_LIST syn keyword xsMacro PERL_ARGS_ASSERT_MY_SNPRINTF PERL_ARGS_ASSERT_MY_SPRINTF syn keyword xsMacro PERL_ARGS_ASSERT_MY_STRFTIME PERL_ARGS_ASSERT_MY_SWABN syn keyword xsMacro PERL_ARGS_ASSERT_MY_VSNPRINTF PERL_ARGS_ASSERT_NEED_UTF8 syn keyword xsMacro PERL_ARGS_ASSERT_NEWAVREF PERL_ARGS_ASSERT_NEWCONDOP syn keyword xsMacro PERL_ARGS_ASSERT_NEWFOROP PERL_ARGS_ASSERT_NEWGIVENOP syn keyword xsMacro PERL_ARGS_ASSERT_NEWGIVWHENOP PERL_ARGS_ASSERT_NEWGP syn keyword xsMacro PERL_ARGS_ASSERT_NEWGVGEN_FLAGS PERL_ARGS_ASSERT_NEWGVOP syn keyword xsMacro PERL_ARGS_ASSERT_NEWHVREF PERL_ARGS_ASSERT_NEWLOGOP syn keyword xsMacro PERL_ARGS_ASSERT_NEWLOOPEX PERL_ARGS_ASSERT_NEWMADSV syn keyword xsMacro PERL_ARGS_ASSERT_NEWPADOP PERL_ARGS_ASSERT_NEWPROG syn keyword xsMacro PERL_ARGS_ASSERT_NEWRANGE PERL_ARGS_ASSERT_NEWRV syn keyword xsMacro PERL_ARGS_ASSERT_NEWRV_NOINC PERL_ARGS_ASSERT_NEWSVOP syn keyword xsMacro PERL_ARGS_ASSERT_NEWSVPVF syn keyword xsMacro PERL_ARGS_ASSERT_NEWSVPVF_NOCONTEXT syn keyword xsMacro PERL_ARGS_ASSERT_NEWSVREF PERL_ARGS_ASSERT_NEWSVRV syn keyword xsMacro PERL_ARGS_ASSERT_NEWWHENOP PERL_ARGS_ASSERT_NEWXS syn keyword xsMacro PERL_ARGS_ASSERT_NEWXS_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_NEWXS_LEN_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_NEW_CONSTANT PERL_ARGS_ASSERT_NEW_CTYPE syn keyword xsMacro PERL_ARGS_ASSERT_NEW_LOGOP PERL_ARGS_ASSERT_NEW_VERSION syn keyword xsMacro PERL_ARGS_ASSERT_NEW_WARNINGS_BITFIELD syn keyword xsMacro PERL_ARGS_ASSERT_NEXTARGV PERL_ARGS_ASSERT_NEXTCHAR syn keyword xsMacro PERL_ARGS_ASSERT_NEXT_SYMBOL PERL_ARGS_ASSERT_NINSTR syn keyword xsMacro PERL_ARGS_ASSERT_NOT_A_NUMBER syn keyword xsMacro PERL_ARGS_ASSERT_NO_BAREWORD_ALLOWED syn keyword xsMacro PERL_ARGS_ASSERT_NO_FH_ALLOWED PERL_ARGS_ASSERT_NO_OP syn keyword xsMacro PERL_ARGS_ASSERT_OOPSAV PERL_ARGS_ASSERT_OOPSHV syn keyword xsMacro PERL_ARGS_ASSERT_OPEN_SCRIPT syn keyword xsMacro PERL_ARGS_ASSERT_OPT_SCALARHV PERL_ARGS_ASSERT_OP_CLEAR syn keyword xsMacro PERL_ARGS_ASSERT_OP_CONTEXTUALIZE syn keyword xsMacro PERL_ARGS_ASSERT_OP_DUMP PERL_ARGS_ASSERT_OP_INTEGERIZE syn keyword xsMacro PERL_ARGS_ASSERT_OP_LINKLIST PERL_ARGS_ASSERT_OP_NULL syn keyword xsMacro PERL_ARGS_ASSERT_OP_REFCNT_DEC syn keyword xsMacro PERL_ARGS_ASSERT_OP_STD_INIT PERL_ARGS_ASSERT_OP_XMLDUMP syn keyword xsMacro PERL_ARGS_ASSERT_PACKAGE PERL_ARGS_ASSERT_PACKAGE_VERSION syn keyword xsMacro PERL_ARGS_ASSERT_PACKLIST PERL_ARGS_ASSERT_PACK_CAT syn keyword xsMacro PERL_ARGS_ASSERT_PACK_REC PERL_ARGS_ASSERT_PADLIST_DUP syn keyword xsMacro PERL_ARGS_ASSERT_PAD_ADD_ANON syn keyword xsMacro PERL_ARGS_ASSERT_PAD_ADD_NAME_PV syn keyword xsMacro PERL_ARGS_ASSERT_PAD_ADD_NAME_PVN syn keyword xsMacro PERL_ARGS_ASSERT_PAD_ADD_NAME_SV syn keyword xsMacro PERL_ARGS_ASSERT_PAD_ALLOC_NAME syn keyword xsMacro PERL_ARGS_ASSERT_PAD_CHECK_DUP syn keyword xsMacro PERL_ARGS_ASSERT_PAD_FINDLEX syn keyword xsMacro PERL_ARGS_ASSERT_PAD_FINDMY_PV syn keyword xsMacro PERL_ARGS_ASSERT_PAD_FINDMY_PVN syn keyword xsMacro PERL_ARGS_ASSERT_PAD_FINDMY_SV syn keyword xsMacro PERL_ARGS_ASSERT_PAD_FIXUP_INNER_ANONS syn keyword xsMacro PERL_ARGS_ASSERT_PAD_PEG PERL_ARGS_ASSERT_PAD_PUSH syn keyword xsMacro PERL_ARGS_ASSERT_PAD_SETSV PERL_ARGS_ASSERT_PARSER_DUP syn keyword xsMacro PERL_ARGS_ASSERT_PARSER_FREE syn keyword xsMacro PERL_ARGS_ASSERT_PARSE_UNICODE_OPTS syn keyword xsMacro PERL_ARGS_ASSERT_PATH_IS_ABSOLUTE syn keyword xsMacro PERL_ARGS_ASSERT_PERLIO_READ syn keyword xsMacro PERL_ARGS_ASSERT_PERLIO_UNREAD syn keyword xsMacro PERL_ARGS_ASSERT_PERLIO_WRITE syn keyword xsMacro PERL_ARGS_ASSERT_PERL_ALLOC_USING syn keyword xsMacro PERL_ARGS_ASSERT_PERL_CLONE syn keyword xsMacro PERL_ARGS_ASSERT_PERL_CLONE_USING syn keyword xsMacro PERL_ARGS_ASSERT_PERL_CONSTRUCT syn keyword xsMacro PERL_ARGS_ASSERT_PERL_DESTRUCT PERL_ARGS_ASSERT_PERL_FREE syn keyword xsMacro PERL_ARGS_ASSERT_PERL_PARSE PERL_ARGS_ASSERT_PERL_RUN syn keyword xsMacro PERL_ARGS_ASSERT_PMRUNTIME PERL_ARGS_ASSERT_PMTRANS syn keyword xsMacro PERL_ARGS_ASSERT_PM_DESCRIPTION syn keyword xsMacro PERL_ARGS_ASSERT_POPULATE_ISA PERL_ARGS_ASSERT_PREGCOMP syn keyword xsMacro PERL_ARGS_ASSERT_PREGEXEC PERL_ARGS_ASSERT_PREGFREE2 syn keyword xsMacro PERL_ARGS_ASSERT_PRESCAN_VERSION syn keyword xsMacro PERL_ARGS_ASSERT_PRINTBUF syn keyword xsMacro PERL_ARGS_ASSERT_PRINTF_NOCONTEXT syn keyword xsMacro PERL_ARGS_ASSERT_PROCESS_SPECIAL_BLOCKS syn keyword xsMacro PERL_ARGS_ASSERT_PTR_TABLE_FETCH syn keyword xsMacro PERL_ARGS_ASSERT_PTR_TABLE_FIND syn keyword xsMacro PERL_ARGS_ASSERT_PTR_TABLE_SPLIT syn keyword xsMacro PERL_ARGS_ASSERT_PTR_TABLE_STORE syn keyword xsMacro PERL_ARGS_ASSERT_PUT_BYTE PERL_ARGS_ASSERT_PV_DISPLAY syn keyword xsMacro PERL_ARGS_ASSERT_PV_ESCAPE PERL_ARGS_ASSERT_PV_PRETTY syn keyword xsMacro PERL_ARGS_ASSERT_PV_UNI_DISPLAY PERL_ARGS_ASSERT_QERROR syn keyword xsMacro PERL_ARGS_ASSERT_QSORTSVU syn keyword xsMacro PERL_ARGS_ASSERT_REENTRANT_RETRY syn keyword xsMacro PERL_ARGS_ASSERT_REFCOUNTED_HE_FETCH_PV syn keyword xsMacro PERL_ARGS_ASSERT_REFCOUNTED_HE_FETCH_PVN syn keyword xsMacro PERL_ARGS_ASSERT_REFCOUNTED_HE_FETCH_SV syn keyword xsMacro PERL_ARGS_ASSERT_REFCOUNTED_HE_NEW_PV syn keyword xsMacro PERL_ARGS_ASSERT_REFCOUNTED_HE_NEW_PVN syn keyword xsMacro PERL_ARGS_ASSERT_REFCOUNTED_HE_NEW_SV syn keyword xsMacro PERL_ARGS_ASSERT_REFCOUNTED_HE_VALUE syn keyword xsMacro PERL_ARGS_ASSERT_REFTO PERL_ARGS_ASSERT_REG syn keyword xsMacro PERL_ARGS_ASSERT_REGANODE PERL_ARGS_ASSERT_REGATOM syn keyword xsMacro PERL_ARGS_ASSERT_REGBRANCH PERL_ARGS_ASSERT_REGCLASS syn keyword xsMacro PERL_ARGS_ASSERT_REGCLASS_SWASH PERL_ARGS_ASSERT_REGCPPOP syn keyword xsMacro PERL_ARGS_ASSERT_REGCURLY PERL_ARGS_ASSERT_REGDUMP syn keyword xsMacro PERL_ARGS_ASSERT_REGDUPE_INTERNAL syn keyword xsMacro PERL_ARGS_ASSERT_REGEXEC_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_REGFREE_INTERNAL syn keyword xsMacro PERL_ARGS_ASSERT_REGHOP3 PERL_ARGS_ASSERT_REGHOP4 syn keyword xsMacro PERL_ARGS_ASSERT_REGHOPMAYBE3 PERL_ARGS_ASSERT_REGINCLASS syn keyword xsMacro PERL_ARGS_ASSERT_REGINSERT PERL_ARGS_ASSERT_REGMATCH syn keyword xsMacro PERL_ARGS_ASSERT_REGPIECE PERL_ARGS_ASSERT_REGPPOSIXCC syn keyword xsMacro PERL_ARGS_ASSERT_REGPROP PERL_ARGS_ASSERT_REGREPEAT syn keyword xsMacro PERL_ARGS_ASSERT_REGTAIL PERL_ARGS_ASSERT_REGTAIL_STUDY syn keyword xsMacro PERL_ARGS_ASSERT_REGTRY PERL_ARGS_ASSERT_REGUNI syn keyword xsMacro PERL_ARGS_ASSERT_REGWHITE syn keyword xsMacro PERL_ARGS_ASSERT_REG_CHECK_NAMED_BUFF_MATCHED syn keyword xsMacro PERL_ARGS_ASSERT_REG_NAMEDSEQ syn keyword xsMacro PERL_ARGS_ASSERT_REG_NAMED_BUFF syn keyword xsMacro PERL_ARGS_ASSERT_REG_NAMED_BUFF_ALL syn keyword xsMacro PERL_ARGS_ASSERT_REG_NAMED_BUFF_EXISTS syn keyword xsMacro PERL_ARGS_ASSERT_REG_NAMED_BUFF_FETCH syn keyword xsMacro PERL_ARGS_ASSERT_REG_NAMED_BUFF_FIRSTKEY syn keyword xsMacro PERL_ARGS_ASSERT_REG_NAMED_BUFF_ITER syn keyword xsMacro PERL_ARGS_ASSERT_REG_NAMED_BUFF_NEXTKEY syn keyword xsMacro PERL_ARGS_ASSERT_REG_NAMED_BUFF_SCALAR syn keyword xsMacro PERL_ARGS_ASSERT_REG_NODE syn keyword xsMacro PERL_ARGS_ASSERT_REG_NUMBERED_BUFF_FETCH syn keyword xsMacro PERL_ARGS_ASSERT_REG_NUMBERED_BUFF_LENGTH syn keyword xsMacro PERL_ARGS_ASSERT_REG_NUMBERED_BUFF_STORE syn keyword xsMacro PERL_ARGS_ASSERT_REG_QR_PACKAGE syn keyword xsMacro PERL_ARGS_ASSERT_REG_RECODE syn keyword xsMacro PERL_ARGS_ASSERT_REG_SCAN_NAME syn keyword xsMacro PERL_ARGS_ASSERT_REG_SKIPCOMMENT syn keyword xsMacro PERL_ARGS_ASSERT_REG_TEMP_COPY PERL_ARGS_ASSERT_REPEATCPY syn keyword xsMacro PERL_ARGS_ASSERT_REPORT_REDEFINED_CV syn keyword xsMacro PERL_ARGS_ASSERT_REQUIRE_PV syn keyword xsMacro PERL_ARGS_ASSERT_REQUIRE_TIE_MOD syn keyword xsMacro PERL_ARGS_ASSERT_RE_COMPILE PERL_ARGS_ASSERT_RE_CROAK2 syn keyword xsMacro PERL_ARGS_ASSERT_RE_DUP_GUTS syn keyword xsMacro PERL_ARGS_ASSERT_RE_INTUIT_START syn keyword xsMacro PERL_ARGS_ASSERT_RE_INTUIT_STRING syn keyword xsMacro PERL_ARGS_ASSERT_RNINSTR PERL_ARGS_ASSERT_RSIGNAL_SAVE syn keyword xsMacro PERL_ARGS_ASSERT_RUN_USER_FILTER syn keyword xsMacro PERL_ARGS_ASSERT_RV2CV_OP_CV PERL_ARGS_ASSERT_RVPV_DUP syn keyword xsMacro PERL_ARGS_ASSERT_RXRES_FREE syn keyword xsMacro PERL_ARGS_ASSERT_RXRES_RESTORE syn keyword xsMacro PERL_ARGS_ASSERT_RXRES_SAVE PERL_ARGS_ASSERT_SAME_DIRENT syn keyword xsMacro PERL_ARGS_ASSERT_SAVESHAREDSVPV PERL_ARGS_ASSERT_SAVESVPV syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_ADELETE syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_AELEM_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_APTR PERL_ARGS_ASSERT_SAVE_ARY syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_BOOL PERL_ARGS_ASSERT_SAVE_CLEARSV syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_DELETE syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_DESTRUCTOR syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_GENERIC_PVREF syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_GENERIC_SVREF syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_GP PERL_ARGS_ASSERT_SAVE_HASH syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_HDELETE syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_HEK_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_HELEM_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_HPTR PERL_ARGS_ASSERT_SAVE_I16 syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_I32 PERL_ARGS_ASSERT_SAVE_I8 syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_INT PERL_ARGS_ASSERT_SAVE_ITEM syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_IV PERL_ARGS_ASSERT_SAVE_LINES syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_LIST PERL_ARGS_ASSERT_SAVE_LONG syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_MAGIC syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_MORTALIZESV syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_NOGV PERL_ARGS_ASSERT_SAVE_PPTR syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_SCALAR syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_SCALAR_AT syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_SET_SVFLAGS syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_SHARED_PVREF syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_SPTR PERL_ARGS_ASSERT_SAVE_SVREF syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_VPTR PERL_ARGS_ASSERT_SCALARBOOLEAN syn keyword xsMacro PERL_ARGS_ASSERT_SCALARVOID PERL_ARGS_ASSERT_SCAN_BIN syn keyword xsMacro PERL_ARGS_ASSERT_SCAN_COMMIT PERL_ARGS_ASSERT_SCAN_CONST syn keyword xsMacro PERL_ARGS_ASSERT_SCAN_FORMLINE syn keyword xsMacro PERL_ARGS_ASSERT_SCAN_HEREDOC PERL_ARGS_ASSERT_SCAN_HEX syn keyword xsMacro PERL_ARGS_ASSERT_SCAN_IDENT syn keyword xsMacro PERL_ARGS_ASSERT_SCAN_INPUTSYMBOL syn keyword xsMacro PERL_ARGS_ASSERT_SCAN_NUM PERL_ARGS_ASSERT_SCAN_OCT syn keyword xsMacro PERL_ARGS_ASSERT_SCAN_PAT PERL_ARGS_ASSERT_SCAN_STR syn keyword xsMacro PERL_ARGS_ASSERT_SCAN_SUBST PERL_ARGS_ASSERT_SCAN_TRANS syn keyword xsMacro PERL_ARGS_ASSERT_SCAN_VERSION syn keyword xsMacro PERL_ARGS_ASSERT_SCAN_VSTRING PERL_ARGS_ASSERT_SCAN_WORD syn keyword xsMacro PERL_ARGS_ASSERT_SCREAMINSTR syn keyword xsMacro PERL_ARGS_ASSERT_SEARCH_CONST syn keyword xsMacro PERL_ARGS_ASSERT_SET_CONTEXT syn keyword xsMacro PERL_ARGS_ASSERT_SET_REGCLASS_BIT syn keyword xsMacro PERL_ARGS_ASSERT_SET_REGCLASS_BIT_FOLD syn keyword xsMacro PERL_ARGS_ASSERT_SHARE_HEK syn keyword xsMacro PERL_ARGS_ASSERT_SHARE_HEK_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_SIMPLIFY_SORT PERL_ARGS_ASSERT_SI_DUP syn keyword xsMacro PERL_ARGS_ASSERT_SKIPSPACE PERL_ARGS_ASSERT_SKIPSPACE0 syn keyword xsMacro PERL_ARGS_ASSERT_SKIPSPACE1 PERL_ARGS_ASSERT_SKIPSPACE2 syn keyword xsMacro PERL_ARGS_ASSERT_SLAB_FREE PERL_ARGS_ASSERT_SLAB_TO_RW syn keyword xsMacro PERL_ARGS_ASSERT_SOFTREF2XV PERL_ARGS_ASSERT_SORTCV syn keyword xsMacro PERL_ARGS_ASSERT_SORTCV_STACKED syn keyword xsMacro PERL_ARGS_ASSERT_SORTCV_XSUB PERL_ARGS_ASSERT_SORTSV syn keyword xsMacro PERL_ARGS_ASSERT_SORTSV_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_SPACE_JOIN_NAMES_MORTAL syn keyword xsMacro PERL_ARGS_ASSERT_SS_DUP PERL_ARGS_ASSERT_STACK_GROW syn keyword xsMacro PERL_ARGS_ASSERT_START_GLOB syn keyword xsMacro PERL_ARGS_ASSERT_STASHPV_HVNAME_MATCH syn keyword xsMacro PERL_ARGS_ASSERT_STDIZE_LOCALE syn keyword xsMacro PERL_ARGS_ASSERT_STRIP_RETURN syn keyword xsMacro PERL_ARGS_ASSERT_STR_TO_VERSION syn keyword xsMacro PERL_ARGS_ASSERT_STUDY_CHUNK syn keyword xsMacro PERL_ARGS_ASSERT_SUB_CRUSH_DEPTH syn keyword xsMacro PERL_ARGS_ASSERT_SV_2BOOL_FLAGS PERL_ARGS_ASSERT_SV_2CV syn keyword xsMacro PERL_ARGS_ASSERT_SV_2IO PERL_ARGS_ASSERT_SV_2IUV_COMMON syn keyword xsMacro PERL_ARGS_ASSERT_SV_2IUV_NON_PRESERVE syn keyword xsMacro PERL_ARGS_ASSERT_SV_2NUM PERL_ARGS_ASSERT_SV_2PVBYTE syn keyword xsMacro PERL_ARGS_ASSERT_SV_2PVBYTE_NOLEN syn keyword xsMacro PERL_ARGS_ASSERT_SV_2PVUTF8 syn keyword xsMacro PERL_ARGS_ASSERT_SV_2PVUTF8_NOLEN syn keyword xsMacro PERL_ARGS_ASSERT_SV_2PV_NOLEN syn keyword xsMacro PERL_ARGS_ASSERT_SV_ADD_ARENA syn keyword xsMacro PERL_ARGS_ASSERT_SV_ADD_BACKREF syn keyword xsMacro PERL_ARGS_ASSERT_SV_BACKOFF PERL_ARGS_ASSERT_SV_BLESS syn keyword xsMacro PERL_ARGS_ASSERT_SV_CATPV PERL_ARGS_ASSERT_SV_CATPVF syn keyword xsMacro PERL_ARGS_ASSERT_SV_CATPVF_MG syn keyword xsMacro PERL_ARGS_ASSERT_SV_CATPVF_MG_NOCONTEXT syn keyword xsMacro PERL_ARGS_ASSERT_SV_CATPVF_NOCONTEXT syn keyword xsMacro PERL_ARGS_ASSERT_SV_CATPVN syn keyword xsMacro PERL_ARGS_ASSERT_SV_CATPVN_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_SV_CATPVN_MG syn keyword xsMacro PERL_ARGS_ASSERT_SV_CATPV_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_SV_CATPV_MG PERL_ARGS_ASSERT_SV_CATSV syn keyword xsMacro PERL_ARGS_ASSERT_SV_CATSV_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_SV_CATSV_MG PERL_ARGS_ASSERT_SV_CATXMLPV syn keyword xsMacro PERL_ARGS_ASSERT_SV_CATXMLPVN syn keyword xsMacro PERL_ARGS_ASSERT_SV_CATXMLSV syn keyword xsMacro PERL_ARGS_ASSERT_SV_CAT_DECODE PERL_ARGS_ASSERT_SV_CHOP syn keyword xsMacro PERL_ARGS_ASSERT_SV_CLEAR syn keyword xsMacro PERL_ARGS_ASSERT_SV_COLLXFRM_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_SV_COMPILE_2OP syn keyword xsMacro PERL_ARGS_ASSERT_SV_COMPILE_2OP_IS_BROKEN syn keyword xsMacro PERL_ARGS_ASSERT_SV_COPYPV syn keyword xsMacro PERL_ARGS_ASSERT_SV_DEL_BACKREF syn keyword xsMacro PERL_ARGS_ASSERT_SV_DERIVED_FROM syn keyword xsMacro PERL_ARGS_ASSERT_SV_DERIVED_FROM_PV syn keyword xsMacro PERL_ARGS_ASSERT_SV_DERIVED_FROM_PVN syn keyword xsMacro PERL_ARGS_ASSERT_SV_DERIVED_FROM_SV syn keyword xsMacro PERL_ARGS_ASSERT_SV_DOES PERL_ARGS_ASSERT_SV_DOES_PV syn keyword xsMacro PERL_ARGS_ASSERT_SV_DOES_PVN PERL_ARGS_ASSERT_SV_DOES_SV syn keyword xsMacro PERL_ARGS_ASSERT_SV_DUMP PERL_ARGS_ASSERT_SV_DUP syn keyword xsMacro PERL_ARGS_ASSERT_SV_DUP_COMMON syn keyword xsMacro PERL_ARGS_ASSERT_SV_DUP_INC syn keyword xsMacro PERL_ARGS_ASSERT_SV_DUP_INC_MULTIPLE syn keyword xsMacro PERL_ARGS_ASSERT_SV_EXP_GROW syn keyword xsMacro PERL_ARGS_ASSERT_SV_FORCE_NORMAL syn keyword xsMacro PERL_ARGS_ASSERT_SV_FORCE_NORMAL_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_SV_FREE2 PERL_ARGS_ASSERT_SV_GETS syn keyword xsMacro PERL_ARGS_ASSERT_SV_GROW PERL_ARGS_ASSERT_SV_INSERT syn keyword xsMacro PERL_ARGS_ASSERT_SV_INSERT_FLAGS PERL_ARGS_ASSERT_SV_ISA syn keyword xsMacro PERL_ARGS_ASSERT_SV_IV PERL_ARGS_ASSERT_SV_I_NCMP syn keyword xsMacro PERL_ARGS_ASSERT_SV_KILL_BACKREFS syn keyword xsMacro PERL_ARGS_ASSERT_SV_MAGIC PERL_ARGS_ASSERT_SV_MAGICEXT syn keyword xsMacro PERL_ARGS_ASSERT_SV_NCMP PERL_ARGS_ASSERT_SV_NV syn keyword xsMacro PERL_ARGS_ASSERT_SV_POS_B2U syn keyword xsMacro PERL_ARGS_ASSERT_SV_POS_B2U_MIDWAY syn keyword xsMacro PERL_ARGS_ASSERT_SV_POS_U2B syn keyword xsMacro PERL_ARGS_ASSERT_SV_POS_U2B_CACHED syn keyword xsMacro PERL_ARGS_ASSERT_SV_POS_U2B_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_SV_POS_U2B_FORWARDS syn keyword xsMacro PERL_ARGS_ASSERT_SV_POS_U2B_MIDWAY PERL_ARGS_ASSERT_SV_PV syn keyword xsMacro PERL_ARGS_ASSERT_SV_PVBYTE PERL_ARGS_ASSERT_SV_PVBYTEN syn keyword xsMacro PERL_ARGS_ASSERT_SV_PVBYTEN_FORCE PERL_ARGS_ASSERT_SV_PVN syn keyword xsMacro PERL_ARGS_ASSERT_SV_PVN_FORCE syn keyword xsMacro PERL_ARGS_ASSERT_SV_PVN_FORCE_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_SV_PVN_NOMG PERL_ARGS_ASSERT_SV_PVUTF8 syn keyword xsMacro PERL_ARGS_ASSERT_SV_PVUTF8N syn keyword xsMacro PERL_ARGS_ASSERT_SV_PVUTF8N_FORCE syn keyword xsMacro PERL_ARGS_ASSERT_SV_RECODE_TO_UTF8 syn keyword xsMacro PERL_ARGS_ASSERT_SV_REF PERL_ARGS_ASSERT_SV_REFTYPE syn keyword xsMacro PERL_ARGS_ASSERT_SV_RELEASE_COW syn keyword xsMacro PERL_ARGS_ASSERT_SV_REPLACE PERL_ARGS_ASSERT_SV_RESET syn keyword xsMacro PERL_ARGS_ASSERT_SV_RVWEAKEN PERL_ARGS_ASSERT_SV_SETHEK syn keyword xsMacro PERL_ARGS_ASSERT_SV_SETIV PERL_ARGS_ASSERT_SV_SETIV_MG syn keyword xsMacro PERL_ARGS_ASSERT_SV_SETNV PERL_ARGS_ASSERT_SV_SETNV_MG syn keyword xsMacro PERL_ARGS_ASSERT_SV_SETPV PERL_ARGS_ASSERT_SV_SETPVF syn keyword xsMacro PERL_ARGS_ASSERT_SV_SETPVF_MG syn keyword xsMacro PERL_ARGS_ASSERT_SV_SETPVF_MG_NOCONTEXT syn keyword xsMacro PERL_ARGS_ASSERT_SV_SETPVF_NOCONTEXT syn keyword xsMacro PERL_ARGS_ASSERT_SV_SETPVIV syn keyword xsMacro PERL_ARGS_ASSERT_SV_SETPVIV_MG PERL_ARGS_ASSERT_SV_SETPVN syn keyword xsMacro PERL_ARGS_ASSERT_SV_SETPVN_MG syn keyword xsMacro PERL_ARGS_ASSERT_SV_SETPV_MG syn keyword xsMacro PERL_ARGS_ASSERT_SV_SETREF_IV syn keyword xsMacro PERL_ARGS_ASSERT_SV_SETREF_NV syn keyword xsMacro PERL_ARGS_ASSERT_SV_SETREF_PV syn keyword xsMacro PERL_ARGS_ASSERT_SV_SETREF_PVN syn keyword xsMacro PERL_ARGS_ASSERT_SV_SETREF_UV PERL_ARGS_ASSERT_SV_SETSV syn keyword xsMacro PERL_ARGS_ASSERT_SV_SETSV_COW syn keyword xsMacro PERL_ARGS_ASSERT_SV_SETSV_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_SV_SETSV_MG PERL_ARGS_ASSERT_SV_SETUV syn keyword xsMacro PERL_ARGS_ASSERT_SV_SETUV_MG PERL_ARGS_ASSERT_SV_TAINT syn keyword xsMacro PERL_ARGS_ASSERT_SV_TAINTED PERL_ARGS_ASSERT_SV_UNGLOB syn keyword xsMacro PERL_ARGS_ASSERT_SV_UNI_DISPLAY syn keyword xsMacro PERL_ARGS_ASSERT_SV_UNMAGIC syn keyword xsMacro PERL_ARGS_ASSERT_SV_UNMAGICEXT PERL_ARGS_ASSERT_SV_UNREF syn keyword xsMacro PERL_ARGS_ASSERT_SV_UNREF_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_SV_UNTAINT PERL_ARGS_ASSERT_SV_UPGRADE syn keyword xsMacro PERL_ARGS_ASSERT_SV_USEPVN syn keyword xsMacro PERL_ARGS_ASSERT_SV_USEPVN_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_SV_USEPVN_MG syn keyword xsMacro PERL_ARGS_ASSERT_SV_UTF8_DECODE syn keyword xsMacro PERL_ARGS_ASSERT_SV_UTF8_DOWNGRADE syn keyword xsMacro PERL_ARGS_ASSERT_SV_UTF8_ENCODE syn keyword xsMacro PERL_ARGS_ASSERT_SV_UTF8_UPGRADE syn keyword xsMacro PERL_ARGS_ASSERT_SV_UTF8_UPGRADE_FLAGS_GROW syn keyword xsMacro PERL_ARGS_ASSERT_SV_UV PERL_ARGS_ASSERT_SV_VCATPVF syn keyword xsMacro PERL_ARGS_ASSERT_SV_VCATPVFN syn keyword xsMacro PERL_ARGS_ASSERT_SV_VCATPVF_MG syn keyword xsMacro PERL_ARGS_ASSERT_SV_VSETPVF PERL_ARGS_ASSERT_SV_VSETPVFN syn keyword xsMacro PERL_ARGS_ASSERT_SV_VSETPVF_MG syn keyword xsMacro PERL_ARGS_ASSERT_SV_XMLPEEK PERL_ARGS_ASSERT_SWALLOW_BOM syn keyword xsMacro PERL_ARGS_ASSERT_SWASH_FETCH PERL_ARGS_ASSERT_SWASH_INIT syn keyword xsMacro PERL_ARGS_ASSERT_SWATCH_GET PERL_ARGS_ASSERT_SYS_INIT syn keyword xsMacro PERL_ARGS_ASSERT_SYS_INIT3 syn keyword xsMacro PERL_ARGS_ASSERT_SYS_INTERN_DUP syn keyword xsMacro PERL_ARGS_ASSERT_TAINT_PROPER syn keyword xsMacro PERL_ARGS_ASSERT_TIED_METHOD syn keyword xsMacro PERL_ARGS_ASSERT_TOKENIZE_USE PERL_ARGS_ASSERT_TOKEN_FREE syn keyword xsMacro PERL_ARGS_ASSERT_TOKEN_GETMAD PERL_ARGS_ASSERT_TOKEQ syn keyword xsMacro PERL_ARGS_ASSERT_TOKEREPORT syn keyword xsMacro PERL_ARGS_ASSERT_TOO_FEW_ARGUMENTS_PV syn keyword xsMacro PERL_ARGS_ASSERT_TOO_FEW_ARGUMENTS_SV syn keyword xsMacro PERL_ARGS_ASSERT_TOO_MANY_ARGUMENTS_PV syn keyword xsMacro PERL_ARGS_ASSERT_TOO_MANY_ARGUMENTS_SV syn keyword xsMacro PERL_ARGS_ASSERT_TO_BYTE_SUBSTR syn keyword xsMacro PERL_ARGS_ASSERT_TO_UNI_LOWER syn keyword xsMacro PERL_ARGS_ASSERT_TO_UNI_TITLE syn keyword xsMacro PERL_ARGS_ASSERT_TO_UNI_UPPER syn keyword xsMacro PERL_ARGS_ASSERT_TO_UTF8_CASE syn keyword xsMacro PERL_ARGS_ASSERT_TO_UTF8_FOLD syn keyword xsMacro PERL_ARGS_ASSERT_TO_UTF8_LOWER syn keyword xsMacro PERL_ARGS_ASSERT_TO_UTF8_SUBSTR syn keyword xsMacro PERL_ARGS_ASSERT_TO_UTF8_TITLE syn keyword xsMacro PERL_ARGS_ASSERT_TO_UTF8_UPPER syn keyword xsMacro PERL_ARGS_ASSERT_TRANSLATE_SUBSTR_OFFSETS syn keyword xsMacro PERL_ARGS_ASSERT_UIV_2BUF PERL_ARGS_ASSERT_UNLNK syn keyword xsMacro PERL_ARGS_ASSERT_UNPACKSTRING PERL_ARGS_ASSERT_UNPACK_REC syn keyword xsMacro PERL_ARGS_ASSERT_UNPACK_STR syn keyword xsMacro PERL_ARGS_ASSERT_UNREFERENCED_TO_TMP_STACK syn keyword xsMacro PERL_ARGS_ASSERT_UPG_VERSION syn keyword xsMacro PERL_ARGS_ASSERT_UTF16_TEXTFILTER syn keyword xsMacro PERL_ARGS_ASSERT_UTF16_TO_UTF8 syn keyword xsMacro PERL_ARGS_ASSERT_UTF16_TO_UTF8_REVERSED syn keyword xsMacro PERL_ARGS_ASSERT_UTF8N_TO_UVCHR syn keyword xsMacro PERL_ARGS_ASSERT_UTF8N_TO_UVUNI syn keyword xsMacro PERL_ARGS_ASSERT_UTF8_DISTANCE PERL_ARGS_ASSERT_UTF8_HOP syn keyword xsMacro PERL_ARGS_ASSERT_UTF8_LENGTH syn keyword xsMacro PERL_ARGS_ASSERT_UTF8_MG_LEN_CACHE_UPDATE syn keyword xsMacro PERL_ARGS_ASSERT_UTF8_MG_POS_CACHE_UPDATE syn keyword xsMacro PERL_ARGS_ASSERT_UTF8_TO_BYTES syn keyword xsMacro PERL_ARGS_ASSERT_UTF8_TO_UVCHR syn keyword xsMacro PERL_ARGS_ASSERT_UTF8_TO_UVCHR_BUF syn keyword xsMacro PERL_ARGS_ASSERT_UTF8_TO_UVUNI syn keyword xsMacro PERL_ARGS_ASSERT_UTF8_TO_UVUNI_BUF syn keyword xsMacro PERL_ARGS_ASSERT_UTILIZE PERL_ARGS_ASSERT_UVCHR_TO_UTF8 syn keyword xsMacro PERL_ARGS_ASSERT_UVCHR_TO_UTF8_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_UVUNI_TO_UTF8 syn keyword xsMacro PERL_ARGS_ASSERT_UVUNI_TO_UTF8_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_VALIDATE_SUID syn keyword xsMacro PERL_ARGS_ASSERT_VALID_UTF8_TO_UVCHR syn keyword xsMacro PERL_ARGS_ASSERT_VALID_UTF8_TO_UVUNI syn keyword xsMacro PERL_ARGS_ASSERT_VCMP PERL_ARGS_ASSERT_VDEB syn keyword xsMacro PERL_ARGS_ASSERT_VFORM PERL_ARGS_ASSERT_VISIT syn keyword xsMacro PERL_ARGS_ASSERT_VIVIFY_DEFELEM syn keyword xsMacro PERL_ARGS_ASSERT_VIVIFY_REF PERL_ARGS_ASSERT_VLOAD_MODULE syn keyword xsMacro PERL_ARGS_ASSERT_VMESS PERL_ARGS_ASSERT_VNEWSVPVF syn keyword xsMacro PERL_ARGS_ASSERT_VNORMAL PERL_ARGS_ASSERT_VNUMIFY syn keyword xsMacro PERL_ARGS_ASSERT_VSTRINGIFY PERL_ARGS_ASSERT_VVERIFY syn keyword xsMacro PERL_ARGS_ASSERT_VWARN PERL_ARGS_ASSERT_VWARNER syn keyword xsMacro PERL_ARGS_ASSERT_WAIT4PID PERL_ARGS_ASSERT_WARN syn keyword xsMacro PERL_ARGS_ASSERT_WARNER PERL_ARGS_ASSERT_WARNER_NOCONTEXT syn keyword xsMacro PERL_ARGS_ASSERT_WARN_NOCONTEXT PERL_ARGS_ASSERT_WARN_SV syn keyword xsMacro PERL_ARGS_ASSERT_WATCH PERL_ARGS_ASSERT_WHICHSIG_PV syn keyword xsMacro PERL_ARGS_ASSERT_WHICHSIG_PVN syn keyword xsMacro PERL_ARGS_ASSERT_WHICHSIG_SV syn keyword xsMacro PERL_ARGS_ASSERT_WITH_QUEUED_ERRORS syn keyword xsMacro PERL_ARGS_ASSERT_WRAP_OP_CHECKER syn keyword xsMacro PERL_ARGS_ASSERT_WRITE_TO_STDERR syn keyword xsMacro PERL_ARGS_ASSERT_XMLDUMP_ATTR syn keyword xsMacro PERL_ARGS_ASSERT_XMLDUMP_FORM syn keyword xsMacro PERL_ARGS_ASSERT_XMLDUMP_INDENT syn keyword xsMacro PERL_ARGS_ASSERT_XMLDUMP_PACKSUBS syn keyword xsMacro PERL_ARGS_ASSERT_XMLDUMP_PACKSUBS_PERL syn keyword xsMacro PERL_ARGS_ASSERT_XMLDUMP_SUB syn keyword xsMacro PERL_ARGS_ASSERT_XMLDUMP_SUB_PERL syn keyword xsMacro PERL_ARGS_ASSERT_XMLDUMP_VINDENT syn keyword xsMacro PERL_ARGS_ASSERT_XS_APIVERSION_BOOTCHECK syn keyword xsMacro PERL_ARGS_ASSERT_XS_VERSION_BOOTCHECK syn keyword xsMacro PERL_ARGS_ASSERT_YYERROR PERL_ARGS_ASSERT_YYERROR_PV syn keyword xsMacro PERL_ARGS_ASSERT_YYERROR_PVN PERL_ARGS_ASSERT_YYWARN syn keyword xsMacro PERL_ARGS_ASSERT__APPEND_RANGE_TO_INVLIST syn keyword xsMacro PERL_ARGS_ASSERT__CORE_SWASH_INIT syn keyword xsMacro PERL_ARGS_ASSERT__INVLIST_ARRAY_INIT syn keyword xsMacro PERL_ARGS_ASSERT__INVLIST_CONTENTS syn keyword xsMacro PERL_ARGS_ASSERT__INVLIST_INTERSECTION_MAYBE_COMPLEMENT_2ND syn keyword xsMacro PERL_ARGS_ASSERT__INVLIST_INVERT syn keyword xsMacro PERL_ARGS_ASSERT__INVLIST_INVERT_PROP syn keyword xsMacro PERL_ARGS_ASSERT__INVLIST_POPULATE_SWATCH syn keyword xsMacro PERL_ARGS_ASSERT__INVLIST_UNION_MAYBE_COMPLEMENT_2ND syn keyword xsMacro PERL_ARGS_ASSERT__IS_UTF8_QUOTEMETA syn keyword xsMacro PERL_ARGS_ASSERT__IS_UTF8__PERL_IDSTART syn keyword xsMacro PERL_ARGS_ASSERT__NEW_INVLIST_C_ARRAY syn keyword xsMacro PERL_ARGS_ASSERT__SWASH_INVERSION_HASH syn keyword xsMacro PERL_ARGS_ASSERT__SWASH_TO_INVLIST syn keyword xsMacro PERL_ARGS_ASSERT__TO_FOLD_LATIN1 syn keyword xsMacro PERL_ARGS_ASSERT__TO_UNI_FOLD_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT__TO_UPPER_TITLE_LATIN1 syn keyword xsMacro PERL_ARGS_ASSERT__TO_UTF8_FOLD_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT__TO_UTF8_LOWER_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT__TO_UTF8_TITLE_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT__TO_UTF8_UPPER_FLAGS PERL_ASYNC_CHECK syn keyword xsMacro PERL_BITFIELD16 PERL_BITFIELD32 PERL_BITFIELD8 syn keyword xsMacro PERL_CALLCONV PERL_CHECK_INITED PERL_CKDEF PERL_DEB syn keyword xsMacro PERL_DEBUG PERL_DEBUG_PAD PERL_DEBUG_PAD_ZERO syn keyword xsMacro PERL_DEFAULT_DO_EXEC3_IMPLEMENTATION syn keyword xsMacro PERL_DONT_CREATE_GVSV syn keyword xsMacro PERL_ENABLE_EXPERIMENTAL_REGEX_OPTIMISATIONS syn keyword xsMacro PERL_ENABLE_EXTENDED_TRIE_OPTIMISATION syn keyword xsMacro PERL_ENABLE_POSITIVE_ASSERTION_STUDY syn keyword xsMacro PERL_ENABLE_TRIE_OPTIMISATION PERL_EXIT_DESTRUCT_END syn keyword xsMacro PERL_EXIT_EXPECTED PERL_EXPORT_C PERL_FILE_IS_ABSOLUTE syn keyword xsMacro PERL_FILTER_EXISTS PERL_FLUSHALL_FOR_CHILD PERL_FPU_INIT syn keyword xsMacro PERL_FPU_POST_EXEC PERL_FPU_PRE_EXEC PERL_FS_VERSION syn keyword xsMacro PERL_FS_VER_FMT PERL_GCC_BRACE_GROUPS_FORBIDDEN syn keyword xsMacro PERL_GET_CONTEXT PERL_GET_INTERP PERL_GET_THX syn keyword xsMacro PERL_GET_VARS PERL_GIT_UNPUSHED_COMMITS syn keyword xsMacro PERL_GLOBAL_STRUCT PERL_GPROF_MONCONTROL PERL_HASH syn keyword xsMacro PERL_HASH_INTERNAL PERL_HASH_INTERNAL_ PERL_HASH_SEED syn keyword xsMacro PERL_HV_ARRAY_ALLOC_BYTES PERL_IMPLICIT_CONTEXT syn keyword xsMacro PERL_INTERPRETER_SIZE_UPTO_MEMBER PERL_INT_MAX syn keyword xsMacro PERL_INT_MIN PERL_LOADMOD_DENY PERL_LOADMOD_IMPORT_OPS syn keyword xsMacro PERL_LOADMOD_NOIMPORT PERL_LONG_MAX PERL_LONG_MIN syn keyword xsMacro PERL_MALLOC_WRAP PERL_MG_UFUNC PERL_MY_SNPRINTF_GUARDED syn keyword xsMacro PERL_MY_VSNPRINTF_GUARDED PERL_NEED_MY_BETOH16 syn keyword xsMacro PERL_NEED_MY_BETOH32 PERL_NEED_MY_BETOHI syn keyword xsMacro PERL_NEED_MY_BETOHL PERL_NEED_MY_BETOHS syn keyword xsMacro PERL_NEED_MY_HTOBE16 PERL_NEED_MY_HTOBE32 syn keyword xsMacro PERL_NEED_MY_HTOBEI PERL_NEED_MY_HTOBEL syn keyword xsMacro PERL_NEED_MY_HTOBES PERL_NEED_MY_HTOLE16 syn keyword xsMacro PERL_NEED_MY_HTOLE32 PERL_NEED_MY_HTOLEI syn keyword xsMacro PERL_NEED_MY_HTOLEL PERL_NEED_MY_HTOLES syn keyword xsMacro PERL_NEED_MY_LETOH16 PERL_NEED_MY_LETOH32 syn keyword xsMacro PERL_NEED_MY_LETOHI PERL_NEED_MY_LETOHL syn keyword xsMacro PERL_NEED_MY_LETOHS PERL_NO_DEV_RANDOM PERL_OBJECT_THIS syn keyword xsMacro PERL_OBJECT_THIS_ PERL_PADSEQ_INTRO PERL_PATCHNUM syn keyword xsMacro PERL_PPADDR_INITED PERL_PPDEF PERL_PRESERVE_IVUV syn keyword xsMacro PERL_PRIeldbl PERL_PRIfldbl PERL_PRIgldbl syn keyword xsMacro PERL_PV_ESCAPE_ALL PERL_PV_ESCAPE_FIRSTCHAR syn keyword xsMacro PERL_PV_ESCAPE_NOBACKSLASH PERL_PV_ESCAPE_NOCLEAR syn keyword xsMacro PERL_PV_ESCAPE_NONASCII PERL_PV_ESCAPE_QUOTE syn keyword xsMacro PERL_PV_ESCAPE_RE PERL_PV_ESCAPE_UNI syn keyword xsMacro PERL_PV_ESCAPE_UNI_DETECT PERL_PV_PRETTY_DUMP syn keyword xsMacro PERL_PV_PRETTY_ELLIPSES PERL_PV_PRETTY_LTGT syn keyword xsMacro PERL_PV_PRETTY_NOCLEAR PERL_PV_PRETTY_QUOTE syn keyword xsMacro PERL_PV_PRETTY_REGPROP PERL_QUAD_MAX PERL_QUAD_MIN syn keyword xsMacro PERL_REENTR_API PERL_REGMATCH_SLAB_SLOTS PERL_REVISION syn keyword xsMacro PERL_SCAN_ALLOW_UNDERSCORES PERL_SCAN_DISALLOW_PREFIX syn keyword xsMacro PERL_SCAN_GREATER_THAN_UV_MAX PERL_SCAN_SILENT_ILLDIGIT syn keyword xsMacro PERL_SCAN_SILENT_NON_PORTABLE PERL_SCNfldbl syn keyword xsMacro PERL_SCRIPT_MODE PERL_SET_CONTEXT PERL_SET_INTERP syn keyword xsMacro PERL_SET_PHASE PERL_SET_THX PERL_SHORT_MAX PERL_SHORT_MIN syn keyword xsMacro PERL_SIGNALS_UNSAFE_FLAG PERL_STACK_OVERFLOW_CHECK syn keyword xsMacro PERL_STATIC_INLINE PERL_STRLEN_EXPAND_SHIFT syn keyword xsMacro PERL_STRLEN_ROUNDUP PERL_STRLEN_ROUNDUP_QUANTUM syn keyword xsMacro PERL_SUBVERSION PERL_SUB_DEPTH_WARN PERL_SYS_INIT syn keyword xsMacro PERL_SYS_INIT3 PERL_SYS_INIT3_BODY PERL_SYS_INIT_BODY syn keyword xsMacro PERL_SYS_TERM PERL_SYS_TERM_BODY PERL_TARGETARCH syn keyword xsMacro PERL_UCHAR_MAX PERL_UCHAR_MIN PERL_UINT_MAX PERL_UINT_MIN syn keyword xsMacro PERL_ULONG_MAX PERL_ULONG_MIN PERL_UNICODE_ALL_FLAGS syn keyword xsMacro PERL_UNICODE_ARGV PERL_UNICODE_ARGV_FLAG syn keyword xsMacro PERL_UNICODE_DEFAULT_FLAGS PERL_UNICODE_IN syn keyword xsMacro PERL_UNICODE_INOUT PERL_UNICODE_INOUT_FLAG syn keyword xsMacro PERL_UNICODE_IN_FLAG PERL_UNICODE_LOCALE syn keyword xsMacro PERL_UNICODE_LOCALE_FLAG PERL_UNICODE_MAX syn keyword xsMacro PERL_UNICODE_OUT PERL_UNICODE_OUT_FLAG PERL_UNICODE_STD syn keyword xsMacro PERL_UNICODE_STDERR PERL_UNICODE_STDERR_FLAG syn keyword xsMacro PERL_UNICODE_STDIN PERL_UNICODE_STDIN_FLAG syn keyword xsMacro PERL_UNICODE_STDOUT PERL_UNICODE_STDOUT_FLAG syn keyword xsMacro PERL_UNICODE_STD_FLAG PERL_UNICODE_UTF8CACHEASSERT syn keyword xsMacro PERL_UNICODE_UTF8CACHEASSERT_FLAG syn keyword xsMacro PERL_UNICODE_WIDESYSCALLS PERL_UNICODE_WIDESYSCALLS_FLAG syn keyword xsMacro PERL_UNUSED_ARG PERL_UNUSED_CONTEXT PERL_UNUSED_DECL syn keyword xsMacro PERL_UNUSED_VAR PERL_UQUAD_MAX PERL_UQUAD_MIN syn keyword xsMacro PERL_USES_PL_PIDSTATUS PERL_USE_GCC_BRACE_GROUPS syn keyword xsMacro PERL_USHORT_MAX PERL_USHORT_MIN PERL_VERSION syn keyword xsMacro PERL_VERSION_STRING PERL_WAIT_FOR_CHILDREN syn keyword xsMacro PERL_WARNHOOK_FATAL PERL_WRITE_MSG_TO_CONSOLE syn keyword xsMacro PERL_XS_EXPORT_C PHASE_CHANGE_PROBE PHOSTNAME syn keyword xsMacro PIPESOCK_MODE PIPE_OPEN_MODE PLUGEXPR PLUGSTMT PLUS syn keyword xsMacro PL_ASCII PL_AboveLatin1 PL_Argv PL_Cmd PL_DBcv PL_DBgv syn keyword xsMacro PL_DBline PL_DBsignal PL_DBsingle PL_DBsub PL_DBtrace syn keyword xsMacro PL_Dir PL_Env PL_Gappctx PL_Gcheck PL_Gcheck_mutex syn keyword xsMacro PL_Gcsighandlerp PL_Gcurinterp PL_Gdo_undump syn keyword xsMacro PL_Gdollarzero_mutex PL_Gfold_locale PL_Ghints_mutex syn keyword xsMacro PL_Gkeyword_plugin PL_Gmalloc_mutex PL_Gmmap_page_size syn keyword xsMacro PL_Gmy_ctx_mutex PL_Gmy_cxt_index PL_Gop_mutex PL_Gop_seq syn keyword xsMacro PL_Gop_sequence PL_Gperlio_debug_fd PL_Gperlio_fd_refcnt syn keyword xsMacro PL_Gperlio_fd_refcnt_size PL_Gperlio_mutex PL_Gppaddr syn keyword xsMacro PL_Gsh_path PL_Gsig_defaulting PL_Gsig_handlers_initted syn keyword xsMacro PL_Gsig_ignoring PL_Gsig_trapped PL_Gsigfpe_saved syn keyword xsMacro PL_Gsv_placeholder PL_Gthr_key PL_Gtimesbase syn keyword xsMacro PL_Guse_safe_putenv PL_Gveto_cleanup PL_Gwatch_pvx syn keyword xsMacro PL_L1Cased PL_L1PosixAlnum PL_L1PosixAlpha syn keyword xsMacro PL_L1PosixGraph PL_L1PosixLower PL_L1PosixPrint syn keyword xsMacro PL_L1PosixPunct PL_L1PosixUpper PL_L1PosixWord PL_LIO syn keyword xsMacro PL_Latin1 PL_Mem PL_MemParse PL_MemShared syn keyword xsMacro PL_OP_SLAB_ALLOC PL_OpPtr PL_OpSlab PL_OpSpace syn keyword xsMacro PL_PerlSpace PL_PosixAlnum PL_PosixAlpha PL_PosixBlank syn keyword xsMacro PL_PosixCntrl PL_PosixDigit PL_PosixGraph PL_PosixLower syn keyword xsMacro PL_PosixPrint PL_PosixPunct PL_PosixSpace PL_PosixUpper syn keyword xsMacro PL_PosixWord PL_PosixXDigit PL_Proc PL_Sock PL_StdIO syn keyword xsMacro PL_Sv PL_VertSpace PL_XPerlSpace PL_XPosixBlank syn keyword xsMacro PL_XPosixCntrl PL_XPosixSpace PL_XPosixXDigit PL_Xpv syn keyword xsMacro PL_amagic_generation PL_an PL_apiversion PL_appctx syn keyword xsMacro PL_argvgv PL_argvout_stack PL_argvoutgv PL_basetime syn keyword xsMacro PL_beginav PL_beginav_save PL_blockhooks PL_body_arenas syn keyword xsMacro PL_body_roots PL_bodytarget PL_bostr PL_breakable_sub_gen syn keyword xsMacro PL_check_mutex PL_checkav PL_checkav_save PL_chopset syn keyword xsMacro PL_clocktick PL_collation_ix PL_collation_name syn keyword xsMacro PL_collation_standard PL_collxfrm_base PL_collxfrm_mult syn keyword xsMacro PL_colors PL_colorset PL_compcv PL_compiling PL_comppad syn keyword xsMacro PL_comppad_name PL_comppad_name_fill syn keyword xsMacro PL_comppad_name_floor PL_cop_seqmax PL_cryptseen syn keyword xsMacro PL_cshlen PL_csighandlerp PL_curcop PL_curcopdb syn keyword xsMacro PL_curinterp PL_curpad PL_curpm PL_curstack syn keyword xsMacro PL_curstackinfo PL_curstash PL_curstname syn keyword xsMacro PL_custom_op_descs PL_custom_op_names PL_custom_ops syn keyword xsMacro PL_cv_has_eval PL_dbargs PL_debstash PL_debug syn keyword xsMacro PL_debug_pad PL_def_layerlist PL_defgv PL_defoutgv syn keyword xsMacro PL_defstash PL_delaymagic PL_delaymagic_egid syn keyword xsMacro PL_delaymagic_euid PL_delaymagic_gid PL_delaymagic_uid syn keyword xsMacro PL_destroyhook PL_diehook PL_dirty PL_do_undump syn keyword xsMacro PL_dollarzero_mutex PL_doswitches PL_dowarn PL_dumper_fd syn keyword xsMacro PL_dumpindent PL_e_script PL_efloatbuf PL_efloatsize syn keyword xsMacro PL_encoding PL_endav PL_envgv PL_errgv PL_errors syn keyword xsMacro PL_eval_root PL_eval_start PL_evalseq PL_exit_flags syn keyword xsMacro PL_exitlist PL_exitlistlen PL_fdpid PL_filemode syn keyword xsMacro PL_firstgv PL_forkprocess PL_formfeed PL_formtarget syn keyword xsMacro PL_generation PL_gensym PL_glob_index PL_globalstash syn keyword xsMacro PL_globhook PL_hash_seed PL_hintgv PL_hints syn keyword xsMacro PL_hints_mutex PL_hv_fetch_ent_mh PL_in_clean_all syn keyword xsMacro PL_in_clean_objs PL_in_eval PL_in_load_module PL_incgv syn keyword xsMacro PL_initav PL_inplace PL_isarev PL_keyword_plugin syn keyword xsMacro PL_known_layers PL_last_in_gv PL_last_swash_hv syn keyword xsMacro PL_last_swash_key PL_last_swash_klen PL_last_swash_slen syn keyword xsMacro PL_last_swash_tmps PL_lastfd PL_lastgotoprobe syn keyword xsMacro PL_laststatval PL_laststype PL_localizing PL_localpatches syn keyword xsMacro PL_lockhook PL_madskills PL_main_cv PL_main_root syn keyword xsMacro PL_main_start PL_mainstack PL_malloc_mutex PL_markstack syn keyword xsMacro PL_markstack_max PL_markstack_ptr PL_max_intro_pending syn keyword xsMacro PL_maxo PL_maxsysfd PL_memory_debug_header PL_mess_sv syn keyword xsMacro PL_min_intro_pending PL_minus_E PL_minus_F PL_minus_a syn keyword xsMacro PL_minus_c PL_minus_l PL_minus_n PL_minus_p syn keyword xsMacro PL_mmap_page_size PL_modcount PL_modglobal syn keyword xsMacro PL_my_ctx_mutex PL_my_cxt_index PL_my_cxt_keys syn keyword xsMacro PL_my_cxt_list PL_my_cxt_size PL_nomemok PL_nrs syn keyword xsMacro PL_numeric_local PL_numeric_name PL_numeric_radix_sv syn keyword xsMacro PL_numeric_standard PL_ofsgv PL_oldname PL_op PL_op_mask syn keyword xsMacro PL_op_mutex PL_op_seq PL_op_sequence PL_opfreehook syn keyword xsMacro PL_opsave PL_origalen PL_origargc PL_origargv syn keyword xsMacro PL_origenviron PL_origfilename PL_ors_sv PL_osname syn keyword xsMacro PL_pad_reset_pending PL_padix PL_padix_floor PL_parser syn keyword xsMacro PL_patchlevel PL_peepp PL_perl_destruct_level PL_perldb syn keyword xsMacro PL_perlio PL_perlio_debug_fd PL_perlio_fd_refcnt syn keyword xsMacro PL_perlio_fd_refcnt_size PL_perlio_mutex PL_phase syn keyword xsMacro PL_pidstatus PL_preambleav PL_profiledata PL_psig_name syn keyword xsMacro PL_psig_pend PL_psig_ptr PL_ptr_table PL_reentrant_buffer syn keyword xsMacro PL_reentrant_retint PL_reg_curpm PL_reg_eval_set syn keyword xsMacro PL_reg_flags PL_reg_leftiter PL_reg_magic syn keyword xsMacro PL_reg_match_utf8 PL_reg_maxiter PL_reg_oldcurpm syn keyword xsMacro PL_reg_oldpos PL_reg_oldsaved PL_reg_oldsavedlen syn keyword xsMacro PL_reg_poscache PL_reg_poscache_size PL_reg_start_tmp syn keyword xsMacro PL_reg_start_tmpl PL_reg_starttry PL_reg_state syn keyword xsMacro PL_regdummy PL_regeol PL_regex_pad PL_regex_padav syn keyword xsMacro PL_reginput PL_reginterp_cnt PL_registered_mros syn keyword xsMacro PL_reglastcloseparen PL_reglastparen PL_regmatch_slab syn keyword xsMacro PL_regmatch_state PL_regoffs PL_regsize PL_rehash_seed syn keyword xsMacro PL_rehash_seed_set PL_replgv PL_restartjmpenv syn keyword xsMacro PL_restartop PL_rpeepp PL_rs PL_runops PL_savebegin syn keyword xsMacro PL_savestack PL_savestack_ix PL_savestack_max syn keyword xsMacro PL_sawampersand PL_scopestack PL_scopestack_ix syn keyword xsMacro PL_scopestack_max PL_scopestack_name PL_secondgv syn keyword xsMacro PL_sharehook PL_sig_defaulting PL_sig_handlers_initted syn keyword xsMacro PL_sig_ignoring PL_sig_pending PL_sig_trapped syn keyword xsMacro PL_sigfpe_saved PL_sighandlerp PL_signalhook PL_signals syn keyword xsMacro PL_slab_count PL_slabs PL_sort_RealCmp PL_sortcop syn keyword xsMacro PL_sortstash PL_splitstr PL_srand_called PL_stack_base syn keyword xsMacro PL_stack_max PL_stack_sp PL_start_env PL_stashcache syn keyword xsMacro PL_statbuf PL_statcache PL_statgv PL_statname syn keyword xsMacro PL_statusvalue PL_statusvalue_posix PL_statusvalue_vms syn keyword xsMacro PL_stderrgv PL_stdingv PL_strtab PL_sub_generation syn keyword xsMacro PL_subline PL_subname PL_sv_arenaroot PL_sv_count syn keyword xsMacro PL_sv_no PL_sv_objcount PL_sv_placeholder PL_sv_root syn keyword xsMacro PL_sv_serial PL_sv_undef PL_sv_yes PL_sys_intern syn keyword xsMacro PL_taint_warn PL_tainted PL_tainting PL_thr_key syn keyword xsMacro PL_threadhook PL_timesbase PL_timesbuf PL_tmps_floor syn keyword xsMacro PL_tmps_ix PL_tmps_max PL_tmps_stack PL_top_env syn keyword xsMacro PL_toptarget PL_unicode PL_unitcheckav syn keyword xsMacro PL_unitcheckav_save PL_unlockhook PL_unsafe syn keyword xsMacro PL_use_safe_putenv PL_utf8_X_L PL_utf8_X_LV PL_utf8_X_LVT syn keyword xsMacro PL_utf8_X_LV_LVT_V PL_utf8_X_T PL_utf8_X_V syn keyword xsMacro PL_utf8_X_begin PL_utf8_X_extend PL_utf8_X_non_hangul syn keyword xsMacro PL_utf8_X_prepend PL_utf8_alnum PL_utf8_alpha syn keyword xsMacro PL_utf8_digit PL_utf8_foldable PL_utf8_foldclosures syn keyword xsMacro PL_utf8_graph PL_utf8_idcont PL_utf8_idstart syn keyword xsMacro PL_utf8_lower PL_utf8_mark PL_utf8_perl_idstart syn keyword xsMacro PL_utf8_print PL_utf8_punct PL_utf8_quotemeta syn keyword xsMacro PL_utf8_space PL_utf8_tofold PL_utf8_tolower syn keyword xsMacro PL_utf8_totitle PL_utf8_toupper PL_utf8_upper syn keyword xsMacro PL_utf8_xdigit PL_utf8_xidcont PL_utf8_xidstart syn keyword xsMacro PL_utf8cache PL_utf8locale PL_veto_cleanup PL_vtbl_amagic syn keyword xsMacro PL_vtbl_amagicelem PL_vtbl_arylen PL_vtbl_arylen_p syn keyword xsMacro PL_vtbl_backref PL_vtbl_bm PL_vtbl_collxfrm syn keyword xsMacro PL_vtbl_dbline PL_vtbl_defelem PL_vtbl_env syn keyword xsMacro PL_vtbl_envelem PL_vtbl_fm PL_vtbl_hints syn keyword xsMacro PL_vtbl_hintselem PL_vtbl_isa PL_vtbl_isaelem syn keyword xsMacro PL_vtbl_mglob PL_vtbl_nkeys PL_vtbl_ovrld PL_vtbl_pack syn keyword xsMacro PL_vtbl_packelem PL_vtbl_pos PL_vtbl_regdata syn keyword xsMacro PL_vtbl_regdatum PL_vtbl_regexp PL_vtbl_sigelem syn keyword xsMacro PL_vtbl_substr PL_vtbl_sv PL_vtbl_taint PL_vtbl_utf8 syn keyword xsMacro PL_vtbl_uvar PL_vtbl_vec PL_vtbl_vstring PL_warnhook syn keyword xsMacro PL_watch_pvx PL_watchaddr PL_watchok PL_xmlfp PMFUNC syn keyword xsMacro PM_GETRE PM_SETRE PMf_BASE_SHIFT PMf_COMPILETIME syn keyword xsMacro PMf_CONST PMf_CONTINUE PMf_EVAL PMf_EXTENDED PMf_FOLD syn keyword xsMacro PMf_GLOBAL PMf_KEEP PMf_KEEPCOPY PMf_MAYBE_CONST syn keyword xsMacro PMf_MULTILINE PMf_NONDESTRUCT PMf_ONCE PMf_RETAINT syn keyword xsMacro PMf_SINGLELINE PMf_USED POPBLOCK POPEVAL POPFORMAT syn keyword xsMacro POPLOOP POPMARK POPSTACK POPSTACK_TO POPSUB POPSUBST syn keyword xsMacro POP_MULTICALL POP_SAVEARRAY POPi POPl POPn POPp POPpbytex syn keyword xsMacro POPpconstx POPpx POPq POPs POPu POPul POPuq POSTDEC syn keyword xsMacro POSTINC POWOP PP PREC_LOW PREDEC PREGf_CUTGROUP_SEEN syn keyword xsMacro PREGf_IMPLICIT PREGf_NAUGHTY PREGf_SKIP syn keyword xsMacro PREGf_VERBARG_SEEN PREINC PREVOPER PRINTF_FORMAT_NULL_OK syn keyword xsMacro PRIVATEREF PRIVLIB PRIVLIB_EXP PRIVSHIFT PROCSELFEXE_PATH syn keyword xsMacro PRUNE PSEUDO PTHREAD_ATFORK PTHREAD_ATTR_SETDETACHSTATE syn keyword xsMacro PTHREAD_CREATE PTHREAD_CREATE_JOINABLE syn keyword xsMacro PTHREAD_GETSPECIFIC PTHREAD_GETSPECIFIC_INT PTR2IV PTR2NV syn keyword xsMacro PTR2UV PTR2nat PTR2ul PTRSIZE PTRV PUSHBLOCK PUSHEVAL syn keyword xsMacro PUSHFORMAT PUSHGIVEN PUSHLOOP_FOR PUSHLOOP_PLAIN PUSHMARK syn keyword xsMacro PUSHSTACK PUSHSTACKi PUSHSUB PUSHSUBST PUSHSUB_BASE syn keyword xsMacro PUSHSUB_DB PUSHTARG PUSHWHEN PUSH_MULTICALL PUSHi syn keyword xsMacro PUSHmortal PUSHn PUSHp PUSHs PUSHu PUTBACK PWGECOS syn keyword xsMacro PWPASSWD Pause PeRl_CaTiFy PeRl_StGiFy PerlDir_chdir syn keyword xsMacro PerlDir_close PerlDir_mapA PerlDir_mapW PerlDir_mkdir syn keyword xsMacro PerlDir_open PerlDir_read PerlDir_rewind PerlDir_rmdir syn keyword xsMacro PerlDir_seek PerlDir_tell PerlEnv_ENVgetenv syn keyword xsMacro PerlEnv_ENVgetenv_len PerlEnv_clearenv syn keyword xsMacro PerlEnv_free_childdir PerlEnv_free_childenv syn keyword xsMacro PerlEnv_get_child_IO PerlEnv_get_childdir syn keyword xsMacro PerlEnv_get_childenv PerlEnv_getenv PerlEnv_getenv_len syn keyword xsMacro PerlEnv_lib_path PerlEnv_os_id PerlEnv_putenv syn keyword xsMacro PerlEnv_sitelib_path PerlEnv_uname PerlEnv_vendorlib_path syn keyword xsMacro PerlIOArg PerlIOBase PerlIONext PerlIOSelf PerlIOValid syn keyword xsMacro PerlIO_canset_cnt PerlIO_exportFILE PerlIO_fast_gets syn keyword xsMacro PerlIO_fdopen PerlIO_findFILE PerlIO_getc PerlIO_getname syn keyword xsMacro PerlIO_has_base PerlIO_has_cntptr PerlIO_importFILE syn keyword xsMacro PerlIO_isutf8 PerlIO_open PerlIO_printf PerlIO_putc syn keyword xsMacro PerlIO_puts PerlIO_releaseFILE PerlIO_reopen syn keyword xsMacro PerlIO_rewind PerlIO_sprintf PerlIO_stdoutf syn keyword xsMacro PerlIO_tmpfile PerlIO_ungetc PerlIO_vprintf syn keyword xsMacro PerlLIO_access PerlLIO_chmod PerlLIO_chown PerlLIO_chsize syn keyword xsMacro PerlLIO_close PerlLIO_dup PerlLIO_dup2 PerlLIO_flock syn keyword xsMacro PerlLIO_fstat PerlLIO_ioctl PerlLIO_isatty PerlLIO_link syn keyword xsMacro PerlLIO_lseek PerlLIO_lstat PerlLIO_mkstemp syn keyword xsMacro PerlLIO_mktemp PerlLIO_open PerlLIO_open3 PerlLIO_read syn keyword xsMacro PerlLIO_rename PerlLIO_setmode PerlLIO_stat syn keyword xsMacro PerlLIO_tmpnam PerlLIO_umask PerlLIO_unlink PerlLIO_utime syn keyword xsMacro PerlLIO_write PerlMemParse_calloc PerlMemParse_free syn keyword xsMacro PerlMemParse_free_lock PerlMemParse_get_lock syn keyword xsMacro PerlMemParse_is_locked PerlMemParse_malloc syn keyword xsMacro PerlMemParse_realloc PerlMemShared_calloc syn keyword xsMacro PerlMemShared_free PerlMemShared_free_lock syn keyword xsMacro PerlMemShared_get_lock PerlMemShared_is_locked syn keyword xsMacro PerlMemShared_malloc PerlMemShared_realloc PerlMem_calloc syn keyword xsMacro PerlMem_free PerlMem_free_lock PerlMem_get_lock syn keyword xsMacro PerlMem_is_locked PerlMem_malloc PerlMem_realloc syn keyword xsMacro PerlProc_DynaLoad PerlProc_GetOSError PerlProc__exit syn keyword xsMacro PerlProc_abort PerlProc_crypt PerlProc_execl syn keyword xsMacro PerlProc_execv PerlProc_execvp PerlProc_exit syn keyword xsMacro PerlProc_fork PerlProc_getegid PerlProc_geteuid syn keyword xsMacro PerlProc_getgid PerlProc_getlogin PerlProc_getpid syn keyword xsMacro PerlProc_gettimeofday PerlProc_getuid PerlProc_kill syn keyword xsMacro PerlProc_killpg PerlProc_lasthost PerlProc_longjmp syn keyword xsMacro PerlProc_pause PerlProc_pclose PerlProc_pipe syn keyword xsMacro PerlProc_popen PerlProc_popen_list PerlProc_setgid syn keyword xsMacro PerlProc_setjmp PerlProc_setuid PerlProc_signal syn keyword xsMacro PerlProc_sleep PerlProc_spawnvp PerlProc_times syn keyword xsMacro PerlProc_wait PerlProc_waitpid PerlSIO_canset_cnt syn keyword xsMacro PerlSIO_clearerr PerlSIO_fast_gets PerlSIO_fclose syn keyword xsMacro PerlSIO_fdopen PerlSIO_fdupopen PerlSIO_feof syn keyword xsMacro PerlSIO_ferror PerlSIO_fflush PerlSIO_fgetc syn keyword xsMacro PerlSIO_fgetpos PerlSIO_fgets PerlSIO_fileno syn keyword xsMacro PerlSIO_fopen PerlSIO_fputc PerlSIO_fputs PerlSIO_fread syn keyword xsMacro PerlSIO_freopen PerlSIO_fseek PerlSIO_fsetpos syn keyword xsMacro PerlSIO_ftell PerlSIO_fwrite PerlSIO_get_base syn keyword xsMacro PerlSIO_get_bufsiz PerlSIO_get_cnt PerlSIO_get_ptr syn keyword xsMacro PerlSIO_has_base PerlSIO_has_cntptr PerlSIO_init syn keyword xsMacro PerlSIO_printf PerlSIO_rewind PerlSIO_set_cnt syn keyword xsMacro PerlSIO_set_ptr PerlSIO_setbuf PerlSIO_setlinebuf syn keyword xsMacro PerlSIO_setvbuf PerlSIO_stderr PerlSIO_stdin syn keyword xsMacro PerlSIO_stdout PerlSIO_stdoutf PerlSIO_tmpfile syn keyword xsMacro PerlSIO_ungetc PerlSIO_vprintf PerlSock_accept syn keyword xsMacro PerlSock_bind PerlSock_closesocket PerlSock_connect syn keyword xsMacro PerlSock_endhostent PerlSock_endnetent syn keyword xsMacro PerlSock_endprotoent PerlSock_endservent syn keyword xsMacro PerlSock_gethostbyaddr PerlSock_gethostbyname syn keyword xsMacro PerlSock_gethostent PerlSock_gethostname syn keyword xsMacro PerlSock_getnetbyaddr PerlSock_getnetbyname syn keyword xsMacro PerlSock_getnetent PerlSock_getpeername syn keyword xsMacro PerlSock_getprotobyname PerlSock_getprotobynumber syn keyword xsMacro PerlSock_getprotoent PerlSock_getservbyname syn keyword xsMacro PerlSock_getservbyport PerlSock_getservent syn keyword xsMacro PerlSock_getsockname PerlSock_getsockopt PerlSock_htonl syn keyword xsMacro PerlSock_htons PerlSock_inet_addr PerlSock_inet_ntoa syn keyword xsMacro PerlSock_listen PerlSock_ntohl PerlSock_ntohs syn keyword xsMacro PerlSock_recv PerlSock_recvfrom PerlSock_select syn keyword xsMacro PerlSock_send PerlSock_sendto PerlSock_sethostent syn keyword xsMacro PerlSock_setnetent PerlSock_setprotoent syn keyword xsMacro PerlSock_setservent PerlSock_setsockopt PerlSock_shutdown syn keyword xsMacro PerlSock_socket PerlSock_socketpair Perl_assert syn keyword xsMacro Perl_atan2 Perl_atof Perl_atof2 Perl_ceil Perl_cos syn keyword xsMacro Perl_debug_log Perl_error_log Perl_exp Perl_floor syn keyword xsMacro Perl_fmod Perl_fp_class Perl_fp_class_denorm syn keyword xsMacro Perl_fp_class_inf Perl_fp_class_nan Perl_fp_class_ndenorm syn keyword xsMacro Perl_fp_class_ninf Perl_fp_class_nnorm Perl_fp_class_norm syn keyword xsMacro Perl_fp_class_nzero Perl_fp_class_pdenorm syn keyword xsMacro Perl_fp_class_pinf Perl_fp_class_pnorm syn keyword xsMacro Perl_fp_class_pzero Perl_fp_class_qnan Perl_fp_class_snan syn keyword xsMacro Perl_fp_class_zero Perl_frexp Perl_isfinite Perl_isinf syn keyword xsMacro Perl_isnan Perl_log Perl_malloc_good_size Perl_modf syn keyword xsMacro Perl_pow Perl_pp_accept Perl_pp_aelemfast_lex syn keyword xsMacro Perl_pp_andassign Perl_pp_avalues Perl_pp_bind syn keyword xsMacro Perl_pp_bit_xor Perl_pp_chmod Perl_pp_chomp syn keyword xsMacro Perl_pp_connect Perl_pp_cos Perl_pp_custom syn keyword xsMacro Perl_pp_dbmclose Perl_pp_dofile Perl_pp_dor syn keyword xsMacro Perl_pp_dorassign Perl_pp_dump Perl_pp_egrent syn keyword xsMacro Perl_pp_enetent Perl_pp_eprotoent Perl_pp_epwent syn keyword xsMacro Perl_pp_eservent Perl_pp_exp Perl_pp_fcntl syn keyword xsMacro Perl_pp_ftatime Perl_pp_ftbinary Perl_pp_ftblk syn keyword xsMacro Perl_pp_ftchr Perl_pp_ftctime Perl_pp_ftdir syn keyword xsMacro Perl_pp_fteexec Perl_pp_fteowned Perl_pp_fteread syn keyword xsMacro Perl_pp_ftewrite Perl_pp_ftfile Perl_pp_ftmtime syn keyword xsMacro Perl_pp_ftpipe Perl_pp_ftrexec Perl_pp_ftrwrite syn keyword xsMacro Perl_pp_ftsgid Perl_pp_ftsize Perl_pp_ftsock syn keyword xsMacro Perl_pp_ftsuid Perl_pp_ftsvtx Perl_pp_ftzero syn keyword xsMacro Perl_pp_getpeername Perl_pp_getsockname Perl_pp_ggrgid syn keyword xsMacro Perl_pp_ggrnam Perl_pp_ghbyaddr Perl_pp_ghbyname syn keyword xsMacro Perl_pp_gnbyaddr Perl_pp_gnbyname Perl_pp_gpbyname syn keyword xsMacro Perl_pp_gpbynumber Perl_pp_gpwnam Perl_pp_gpwuid syn keyword xsMacro Perl_pp_gsbyname Perl_pp_gsbyport Perl_pp_gsockopt syn keyword xsMacro Perl_pp_hex Perl_pp_i_postdec Perl_pp_i_postinc syn keyword xsMacro Perl_pp_i_predec Perl_pp_i_preinc Perl_pp_keys syn keyword xsMacro Perl_pp_kill Perl_pp_lcfirst Perl_pp_lineseq syn keyword xsMacro Perl_pp_listen Perl_pp_localtime Perl_pp_log syn keyword xsMacro Perl_pp_lstat Perl_pp_mapstart Perl_pp_msgctl syn keyword xsMacro Perl_pp_msgget Perl_pp_msgrcv Perl_pp_msgsnd syn keyword xsMacro Perl_pp_orassign Perl_pp_padany Perl_pp_pop syn keyword xsMacro Perl_pp_postdec Perl_pp_predec Perl_pp_reach Perl_pp_read syn keyword xsMacro Perl_pp_recv Perl_pp_regcmaybe Perl_pp_rindex syn keyword xsMacro Perl_pp_rv2hv Perl_pp_rvalues Perl_pp_say Perl_pp_scalar syn keyword xsMacro Perl_pp_schomp Perl_pp_scope Perl_pp_seek Perl_pp_semop syn keyword xsMacro Perl_pp_send Perl_pp_sge Perl_pp_sgrent Perl_pp_sgt syn keyword xsMacro Perl_pp_shmctl Perl_pp_shmget Perl_pp_shmread syn keyword xsMacro Perl_pp_shutdown Perl_pp_slt Perl_pp_snetent syn keyword xsMacro Perl_pp_socket Perl_pp_sprotoent Perl_pp_spwent syn keyword xsMacro Perl_pp_sqrt Perl_pp_sservent Perl_pp_ssockopt syn keyword xsMacro Perl_pp_symlink Perl_pp_transr Perl_pp_unlink syn keyword xsMacro Perl_pp_utime Perl_pp_values Perl_safesysmalloc_size syn keyword xsMacro Perl_sharepvn Perl_signbit Perl_sin Perl_sqrt syn keyword xsMacro Perl_va_copy PmopSTASH PmopSTASHPV PmopSTASHPV_set syn keyword xsMacro PmopSTASH_flags PmopSTASH_flags_set PmopSTASH_free syn keyword xsMacro PmopSTASH_set Poison PoisonFree PoisonNew PoisonWith syn keyword xsMacro QR_PAT_MODS QUADKIND QUAD_IS_INT QUAD_IS_INT64_T syn keyword xsMacro QUAD_IS_LONG QUAD_IS_LONG_LONG QUAD_IS___INT64 QWLIST syn keyword xsMacro RANDBITS RANDOM_R_PROTO RD_NODATA READDIR64_R_PROTO syn keyword xsMacro READDIR_R_PROTO REENTRANT_PROTO_B_B REENTRANT_PROTO_B_BI syn keyword xsMacro REENTRANT_PROTO_B_BW REENTRANT_PROTO_B_CCD syn keyword xsMacro REENTRANT_PROTO_B_CCS REENTRANT_PROTO_B_IBI syn keyword xsMacro REENTRANT_PROTO_B_IBW REENTRANT_PROTO_B_SB syn keyword xsMacro REENTRANT_PROTO_B_SBI REENTRANT_PROTO_I_BI syn keyword xsMacro REENTRANT_PROTO_I_BW REENTRANT_PROTO_I_CCSBWR syn keyword xsMacro REENTRANT_PROTO_I_CCSD REENTRANT_PROTO_I_CII syn keyword xsMacro REENTRANT_PROTO_I_CIISD REENTRANT_PROTO_I_CSBI syn keyword xsMacro REENTRANT_PROTO_I_CSBIR REENTRANT_PROTO_I_CSBWR syn keyword xsMacro REENTRANT_PROTO_I_CSBWRE REENTRANT_PROTO_I_CSD syn keyword xsMacro REENTRANT_PROTO_I_CWISBWRE REENTRANT_PROTO_I_CWISD syn keyword xsMacro REENTRANT_PROTO_I_D REENTRANT_PROTO_I_H syn keyword xsMacro REENTRANT_PROTO_I_IBI REENTRANT_PROTO_I_IBW syn keyword xsMacro REENTRANT_PROTO_I_ICBI REENTRANT_PROTO_I_ICSBWR syn keyword xsMacro REENTRANT_PROTO_I_ICSD REENTRANT_PROTO_I_ID syn keyword xsMacro REENTRANT_PROTO_I_IISD REENTRANT_PROTO_I_ISBWR syn keyword xsMacro REENTRANT_PROTO_I_ISD REENTRANT_PROTO_I_LISBI syn keyword xsMacro REENTRANT_PROTO_I_LISD REENTRANT_PROTO_I_LS syn keyword xsMacro REENTRANT_PROTO_I_SB REENTRANT_PROTO_I_SBI syn keyword xsMacro REENTRANT_PROTO_I_SBIE REENTRANT_PROTO_I_SBIH syn keyword xsMacro REENTRANT_PROTO_I_SBIR REENTRANT_PROTO_I_SBWR syn keyword xsMacro REENTRANT_PROTO_I_SBWRE REENTRANT_PROTO_I_SD syn keyword xsMacro REENTRANT_PROTO_I_ST REENTRANT_PROTO_I_St syn keyword xsMacro REENTRANT_PROTO_I_TISD REENTRANT_PROTO_I_TS syn keyword xsMacro REENTRANT_PROTO_I_TSBI REENTRANT_PROTO_I_TSBIR syn keyword xsMacro REENTRANT_PROTO_I_TSBWR REENTRANT_PROTO_I_TSR syn keyword xsMacro REENTRANT_PROTO_I_TsISBWRE REENTRANT_PROTO_I_UISBWRE syn keyword xsMacro REENTRANT_PROTO_I_iS REENTRANT_PROTO_I_lS syn keyword xsMacro REENTRANT_PROTO_I_uISBWRE REENTRANT_PROTO_S_CBI syn keyword xsMacro REENTRANT_PROTO_S_CCSBI REENTRANT_PROTO_S_CIISBIE syn keyword xsMacro REENTRANT_PROTO_S_CSBI REENTRANT_PROTO_S_CSBIE syn keyword xsMacro REENTRANT_PROTO_S_CWISBIE REENTRANT_PROTO_S_CWISBWIE syn keyword xsMacro REENTRANT_PROTO_S_ICSBI REENTRANT_PROTO_S_ISBI syn keyword xsMacro REENTRANT_PROTO_S_LISBI REENTRANT_PROTO_S_SBI syn keyword xsMacro REENTRANT_PROTO_S_SBIE REENTRANT_PROTO_S_SBW syn keyword xsMacro REENTRANT_PROTO_S_TISBI REENTRANT_PROTO_S_TSBI syn keyword xsMacro REENTRANT_PROTO_S_TSBIE REENTRANT_PROTO_S_TWISBIE syn keyword xsMacro REENTRANT_PROTO_V_D REENTRANT_PROTO_V_H syn keyword xsMacro REENTRANT_PROTO_V_ID REENTR_H REENTR_MEMZERO REF syn keyword xsMacro REFCOUNTED_HE_EXISTS REFCOUNTED_HE_KEY_UTF8 REFF REFFA syn keyword xsMacro REFFL REFFU REFGEN REF_HE_KEY REGMATCH_STATE_MAX syn keyword xsMacro REGNODE_MAX REGNODE_SIMPLE REGNODE_VARIES REG_ANY syn keyword xsMacro REG_INFTY REG_MAGIC REG_SEEN_CANY REG_SEEN_CUTGROUP syn keyword xsMacro REG_SEEN_EVAL REG_SEEN_EXACTF_SHARP_S REG_SEEN_GPOS syn keyword xsMacro REG_SEEN_LOOKBEHIND REG_SEEN_RECURSE syn keyword xsMacro REG_SEEN_RUN_ON_COMMENT REG_SEEN_SANY REG_SEEN_VERBARG syn keyword xsMacro REG_SEEN_ZERO_LEN REG_TOP_LEVEL_BRANCHES RELOP RENUM syn keyword xsMacro REQUIRE RESTORE_ERRNO RESTORE_NUMERIC_LOCAL syn keyword xsMacro RESTORE_NUMERIC_STANDARD RETPUSHNO RETPUSHUNDEF syn keyword xsMacro RETPUSHYES RETSETNO RETSETUNDEF RETSETYES RETURN RETURNOP syn keyword xsMacro RETURNX RETURN_PROBE REXEC_CHECKED REXEC_COPY_STR syn keyword xsMacro REXEC_IGNOREPOS REXEC_NOT_FIRST REXEC_SCREAM syn keyword xsMacro RE_DEBUG_COMPILE_DUMP RE_DEBUG_COMPILE_FLAGS syn keyword xsMacro RE_DEBUG_COMPILE_MASK RE_DEBUG_COMPILE_OPTIMISE syn keyword xsMacro RE_DEBUG_COMPILE_PARSE RE_DEBUG_COMPILE_TRIE syn keyword xsMacro RE_DEBUG_EXECUTE_INTUIT RE_DEBUG_EXECUTE_MASK syn keyword xsMacro RE_DEBUG_EXECUTE_MATCH RE_DEBUG_EXECUTE_TRIE syn keyword xsMacro RE_DEBUG_EXTRA_BUFFERS RE_DEBUG_EXTRA_GPOS syn keyword xsMacro RE_DEBUG_EXTRA_MASK RE_DEBUG_EXTRA_OFFDEBUG syn keyword xsMacro RE_DEBUG_EXTRA_OFFSETS RE_DEBUG_EXTRA_OPTIMISE syn keyword xsMacro RE_DEBUG_EXTRA_STACK RE_DEBUG_EXTRA_STATE syn keyword xsMacro RE_DEBUG_EXTRA_TRIE RE_DEBUG_FLAG RE_DEBUG_FLAGS syn keyword xsMacro RE_PV_COLOR_DECL RE_PV_QUOTED_DECL RE_SV_DUMPLEN syn keyword xsMacro RE_SV_ESCAPE RE_SV_TAIL RE_TRACK_PATTERN_OFFSETS syn keyword xsMacro RE_TRIE_MAXBUF_INIT RE_TRIE_MAXBUF_NAME RMS_DIR RMS_FAC syn keyword xsMacro RMS_FEX RMS_FNF RMS_IFI RMS_ISI RMS_PRV RUNOPS_DEFAULT syn keyword xsMacro RV2CVOPCV_MARK_EARLY RV2CVOPCV_RETURN_NAME_GV syn keyword xsMacro RX_ANCHORED_SUBSTR RX_ANCHORED_UTF8 RX_BUFF_IDX_FULLMATCH syn keyword xsMacro RX_BUFF_IDX_POSTMATCH RX_BUFF_IDX_PREMATCH syn keyword xsMacro RX_CHECK_SUBSTR RX_ENGINE RX_EXTFLAGS RX_FLOAT_SUBSTR syn keyword xsMacro RX_FLOAT_UTF8 RX_GOFS RX_HAS_CUTGROUP RX_LASTCLOSEPAREN syn keyword xsMacro RX_LASTPAREN RX_MATCH_COPIED RX_MATCH_COPIED_off syn keyword xsMacro RX_MATCH_COPIED_on RX_MATCH_COPIED_set RX_MATCH_COPY_FREE syn keyword xsMacro RX_MATCH_TAINTED RX_MATCH_TAINTED_off RX_MATCH_TAINTED_on syn keyword xsMacro RX_MATCH_TAINTED_set RX_MATCH_UTF8 RX_MATCH_UTF8_off syn keyword xsMacro RX_MATCH_UTF8_on RX_MATCH_UTF8_set RX_MINLEN RX_MINLENRET syn keyword xsMacro RX_NPARENS RX_OFFS RX_PRECOMP RX_PRECOMP_const RX_PRELEN syn keyword xsMacro RX_REFCNT RX_SAVED_COPY RX_SEEN_EVALS RX_SUBBEG RX_SUBLEN syn keyword xsMacro RX_UTF8 RX_WRAPLEN RX_WRAPPED RX_WRAPPED_const RXapif_ALL syn keyword xsMacro RXapif_CLEAR RXapif_DELETE RXapif_EXISTS RXapif_FETCH syn keyword xsMacro RXapif_FIRSTKEY RXapif_NEXTKEY RXapif_ONE RXapif_REGNAME syn keyword xsMacro RXapif_REGNAMES RXapif_REGNAMES_COUNT RXapif_SCALAR syn keyword xsMacro RXapif_STORE RXf_ANCH RXf_ANCH_BOL RXf_ANCH_GPOS syn keyword xsMacro RXf_ANCH_MBOL RXf_ANCH_SBOL RXf_ANCH_SINGLE syn keyword xsMacro RXf_BASE_SHIFT RXf_CANY_SEEN RXf_CHECK_ALL RXf_COPY_DONE syn keyword xsMacro RXf_EVAL_SEEN RXf_GPOS_CHECK RXf_GPOS_FLOAT RXf_GPOS_SEEN syn keyword xsMacro RXf_INTUIT_TAIL RXf_LOOKBEHIND_SEEN RXf_MATCH_UTF8 syn keyword xsMacro RXf_NOSCAN RXf_NULL RXf_PMf_CHARSET RXf_PMf_COMPILETIME syn keyword xsMacro RXf_PMf_EXTENDED RXf_PMf_FOLD RXf_PMf_KEEPCOPY syn keyword xsMacro RXf_PMf_MULTILINE RXf_PMf_SINGLELINE RXf_PMf_STD_PMMOD syn keyword xsMacro RXf_PMf_STD_PMMOD_SHIFT RXf_SKIPWHITE RXf_SPLIT syn keyword xsMacro RXf_START_ONLY RXf_TAINTED RXf_TAINTED_SEEN syn keyword xsMacro RXf_USE_INTUIT RXf_USE_INTUIT_ML RXf_USE_INTUIT_NOML syn keyword xsMacro RXf_WHITE RXi_GET RXi_GET_DECL RXi_SET RXp_EXTFLAGS syn keyword xsMacro RXp_MATCH_COPIED RXp_MATCH_COPIED_off RXp_MATCH_COPIED_on syn keyword xsMacro RXp_MATCH_TAINTED RXp_MATCH_UTF8 RXp_PAREN_NAMES syn keyword xsMacro ReREFCNT_dec ReREFCNT_inc Renew Renewc RsPARA RsRECORD syn keyword xsMacro RsSIMPLE RsSNARF SAFE_TRIE_NODENUM SANY SAVEADELETE syn keyword xsMacro SAVEBOOL SAVECLEARSV SAVECOMPILEWARNINGS SAVECOMPPAD syn keyword xsMacro SAVECOPFILE SAVECOPFILE_FREE SAVECOPLINE SAVECOPSTASH syn keyword xsMacro SAVECOPSTASH_FREE SAVEDELETE SAVEDESTRUCTOR syn keyword xsMacro SAVEDESTRUCTOR_X SAVEFREECOPHH SAVEFREEOP SAVEFREEPV syn keyword xsMacro SAVEFREESV SAVEGENERICPV SAVEGENERICSV SAVEHDELETE syn keyword xsMacro SAVEHINTS SAVEI16 SAVEI32 SAVEI8 SAVEINT SAVEIV SAVELONG syn keyword xsMacro SAVEMORTALIZESV SAVEOP SAVEPADSVANDMORTALIZE SAVEPARSER syn keyword xsMacro SAVEPPTR SAVESETSVFLAGS SAVESHAREDPV SAVESPTR syn keyword xsMacro SAVESTACK_ALLOC_FOR_RE_SAVE_STATE SAVESTACK_CXPOS syn keyword xsMacro SAVESTACK_POS SAVESWITCHSTACK SAVETMPS SAVEVPTR syn keyword xsMacro SAVE_DEFSV SAVE_ERRNO SAVE_MASK SAVE_TIGHT_SHIFT syn keyword xsMacro SAVEf_KEEPOLDELEM SAVEf_SETMAGIC SAVEt_ADELETE syn keyword xsMacro SAVEt_AELEM SAVEt_ALLOC SAVEt_APTR SAVEt_AV SAVEt_BOOL syn keyword xsMacro SAVEt_CLEARSV SAVEt_COMPILE_WARNINGS SAVEt_COMPPAD syn keyword xsMacro SAVEt_DELETE SAVEt_DESTRUCTOR SAVEt_DESTRUCTOR_X syn keyword xsMacro SAVEt_FREECOPHH SAVEt_FREEOP SAVEt_FREEPV SAVEt_FREESV syn keyword xsMacro SAVEt_GENERIC_PVREF SAVEt_GENERIC_SVREF SAVEt_GP syn keyword xsMacro SAVEt_GVSV SAVEt_HELEM SAVEt_HINTS SAVEt_HPTR SAVEt_HV syn keyword xsMacro SAVEt_I16 SAVEt_I32 SAVEt_I32_SMALL SAVEt_I8 SAVEt_INT syn keyword xsMacro SAVEt_INT_SMALL SAVEt_ITEM SAVEt_IV SAVEt_LONG syn keyword xsMacro SAVEt_MORTALIZESV SAVEt_NSTAB SAVEt_OP syn keyword xsMacro SAVEt_PADSV_AND_MORTALIZE SAVEt_PARSER SAVEt_PPTR syn keyword xsMacro SAVEt_REGCONTEXT SAVEt_RE_STATE SAVEt_SAVESWITCHSTACK syn keyword xsMacro SAVEt_SET_SVFLAGS SAVEt_SHARED_PVREF SAVEt_SPTR syn keyword xsMacro SAVEt_STACK_CXPOS SAVEt_STACK_POS SAVEt_SV SAVEt_SVREF syn keyword xsMacro SAVEt_VPTR SBOL SCAN_DEF SCAN_REPL SCAN_TR SCHEDULE syn keyword xsMacro SCHED_YIELD SCOPE_SAVES_SIGNAL_MASK SEEK_CUR SEEK_END syn keyword xsMacro SEEK_SET SELECT_MIN_BITS SEOL SETERRNO SETGRENT_R_PROTO syn keyword xsMacro SETHOSTENT_R_PROTO SETLOCALE_R_PROTO SETNETENT_R_PROTO syn keyword xsMacro SETPROTOENT_R_PROTO SETPWENT_R_PROTO SETSERVENT_R_PROTO syn keyword xsMacro SETTARG SET_MARK_OFFSET SET_NUMERIC_LOCAL syn keyword xsMacro SET_NUMERIC_STANDARD SET_THR SET_THREAD_SELF SETi SETn syn keyword xsMacro SETp SETs SETsv SETsvUN SETu SHARP_S_SKIP SHIFTOP syn keyword xsMacro SHORTSIZE SH_PATH SIGABRT SIGILL SIG_NAME SIG_NUM syn keyword xsMacro SIG_SIZE SINGLE_PAT_MOD SITEARCH SITEARCH_EXP SITELIB syn keyword xsMacro SITELIB_EXP SITELIB_STEM SIZE_ALIGN SIZE_ONLY SKIP syn keyword xsMacro SKIP_next SKIP_next_fail SLOPPYDIVIDE SOCKET_OPEN_MODE syn keyword xsMacro SPACE SPACEA SPACEL SPACEU SPAGAIN SPRINTF_RETURNS_STRLEN syn keyword xsMacro SRAND48_R_PROTO SRANDOM_R_PROTO SSCHECK SSGROW SSNEW syn keyword xsMacro SSNEWa SSNEWat SSNEWt SSPOPBOOL SSPOPDPTR SSPOPDXPTR syn keyword xsMacro SSPOPINT SSPOPIV SSPOPLONG SSPOPPTR SSPOPUV SSPTR SSPTRt syn keyword xsMacro SSPUSHBOOL SSPUSHDPTR SSPUSHDXPTR SSPUSHINT SSPUSHIV syn keyword xsMacro SSPUSHLONG SSPUSHPTR SSPUSHUV SS_ACCVIO SS_DEVOFFLINE syn keyword xsMacro SS_IVCHAN SS_NORMAL ST STANDARD_C STAR STARTPERL syn keyword xsMacro START_EXTERN_C START_MY_CXT STATIC STATUS_ALL_FAILURE syn keyword xsMacro STATUS_ALL_SUCCESS STATUS_CURRENT STATUS_EXIT syn keyword xsMacro STATUS_EXIT_SET STATUS_NATIVE STATUS_NATIVE_CHILD_SET syn keyword xsMacro STATUS_UNIX STATUS_UNIX_EXIT_SET STATUS_UNIX_SET STDCHAR syn keyword xsMacro STDIO_PTR_LVALUE STDIO_PTR_LVAL_SETS_CNT syn keyword xsMacro STDIO_STREAM_ARRAY STD_PAT_MODS STD_PMMOD_FLAGS_CLEAR syn keyword xsMacro STMT_END STMT_START STORE_NUMERIC_LOCAL_SET_STANDARD syn keyword xsMacro STORE_NUMERIC_STANDARD_SET_LOCAL STRERROR_R_PROTO STRING syn keyword xsMacro STRINGIFY STRUCT_OFFSET STRUCT_SV STR_LEN STR_SZ syn keyword xsMacro STR_WITH_LEN ST_INO_SIGN ST_INO_SIZE SUB syn keyword xsMacro SUBST_TAINT_BOOLRET SUBST_TAINT_PAT SUBST_TAINT_REPL syn keyword xsMacro SUBST_TAINT_RETAINT SUBST_TAINT_STR SUBVERSION SUCCEED syn keyword xsMacro SUSPEND SVTYPEMASK SV_CATBYTES SV_CATUTF8 syn keyword xsMacro SV_CHECK_THINKFIRST SV_CHECK_THINKFIRST_COW_DROP syn keyword xsMacro SV_CONST_RETURN SV_COW_DROP_PV SV_COW_OTHER_PVS syn keyword xsMacro SV_COW_SHARED_HASH_KEYS SV_DO_COW_SVSETSV syn keyword xsMacro SV_FORCE_UTF8_UPGRADE SV_GMAGIC SV_HAS_TRAILING_NUL syn keyword xsMacro SV_IMMEDIATE_UNREF SV_MUTABLE_RETURN SV_NOSTEAL syn keyword xsMacro SV_SAVED_COPY SV_SKIP_OVERLOAD SV_SMAGIC syn keyword xsMacro SV_UNDEF_RETURNS_NULL SV_UTF8_NO_ENCODING SVrepl_EVAL syn keyword xsMacro SVt_MASK SWITCHSTACK SYMBIAN SYSTEM_GMTIME_MAX syn keyword xsMacro SYSTEM_GMTIME_MIN SYSTEM_LOCALTIME_MAX syn keyword xsMacro SYSTEM_LOCALTIME_MIN S_IEXEC S_IFIFO S_IFMT S_IREAD syn keyword xsMacro S_IRGRP S_IROTH S_IRUSR S_IRWXG S_IRWXO S_IRWXU S_ISBLK syn keyword xsMacro S_ISCHR S_ISDIR S_ISFIFO S_ISGID S_ISLNK S_ISREG S_ISSOCK syn keyword xsMacro S_ISUID S_IWGRP S_IWOTH S_IWRITE S_IWUSR S_IXGRP S_IXOTH syn keyword xsMacro S_IXUSR S_PAT_MODS Safefree Semctl Sigjmp_buf Siglongjmp syn keyword xsMacro Sigsetjmp Size_t_size StGiFy StashHANDLER Stat Strerror syn keyword xsMacro Strtol Strtoul StructCopy SvAMAGIC SvAMAGIC_off syn keyword xsMacro SvAMAGIC_on SvANY SvCANEXISTDELETE SvCOMPILED syn keyword xsMacro SvCOMPILED_off SvCOMPILED_on SvCUR SvCUR_set syn keyword xsMacro SvDESTROYABLE SvEND SvEND_set SvENDx SvEVALED syn keyword xsMacro SvEVALED_off SvEVALED_on SvFAKE SvFAKE_off SvFAKE_on syn keyword xsMacro SvFLAGS SvGAMAGIC SvGETMAGIC SvGMAGICAL SvGMAGICAL_off syn keyword xsMacro SvGMAGICAL_on SvGROW SvGROW_mutable SvIMMORTAL SvIOK syn keyword xsMacro SvIOK_UV SvIOK_notUV SvIOK_off SvIOK_on SvIOK_only syn keyword xsMacro SvIOK_only_UV SvIOKp SvIOKp_on SvIS_FREED SvIV SvIVX syn keyword xsMacro SvIVXx SvIV_nomg SvIV_please SvIV_please_nomg SvIV_set syn keyword xsMacro SvIVx SvIsCOW SvIsCOW_normal SvIsCOW_shared_hash SvIsUV syn keyword xsMacro SvIsUV_off SvIsUV_on SvLEN SvLEN_set SvLENx SvLOCK syn keyword xsMacro SvMAGIC SvMAGICAL SvMAGICAL_off SvMAGICAL_on SvMAGIC_set syn keyword xsMacro SvNIOK SvNIOK_off SvNIOKp SvNOK SvNOK_off SvNOK_on syn keyword xsMacro SvNOK_only SvNOKp SvNOKp_on SvNV SvNVX SvNVXx SvNV_nomg syn keyword xsMacro SvNV_set SvNVx SvOBJECT SvOBJECT_off SvOBJECT_on SvOK syn keyword xsMacro SvOK_off SvOK_off_exc_UV SvOKp SvOOK SvOOK_off syn keyword xsMacro SvOOK_offset SvOOK_on SvOURSTASH SvOURSTASH_set SvPADMY syn keyword xsMacro SvPADMY_on SvPADSTALE SvPADSTALE_off SvPADSTALE_on syn keyword xsMacro SvPADTMP SvPADTMP_off SvPADTMP_on SvPAD_OUR SvPAD_OUR_on syn keyword xsMacro SvPAD_STATE SvPAD_STATE_on SvPAD_TYPED SvPAD_TYPED_on syn keyword xsMacro SvPCS_IMPORTED SvPCS_IMPORTED_off SvPCS_IMPORTED_on syn keyword xsMacro SvPEEK SvPOK SvPOK_off SvPOK_on SvPOK_only syn keyword xsMacro SvPOK_only_UTF8 SvPOKp SvPOKp_on SvPV SvPVX SvPVX_const syn keyword xsMacro SvPVX_mutable SvPVXx SvPV_const SvPV_flags syn keyword xsMacro SvPV_flags_const SvPV_flags_const_nolen syn keyword xsMacro SvPV_flags_mutable SvPV_force SvPV_force_flags syn keyword xsMacro SvPV_force_flags_mutable SvPV_force_flags_nolen syn keyword xsMacro SvPV_force_mutable SvPV_force_nolen SvPV_force_nomg syn keyword xsMacro SvPV_force_nomg_nolen SvPV_free SvPV_mutable SvPV_nolen syn keyword xsMacro SvPV_nolen_const SvPV_nomg SvPV_nomg_const syn keyword xsMacro SvPV_nomg_const_nolen SvPV_nomg_nolen SvPV_renew SvPV_set syn keyword xsMacro SvPV_shrink_to_cur SvPVbyte SvPVbyte_force SvPVbyte_nolen syn keyword xsMacro SvPVbytex SvPVbytex_force SvPVbytex_nolen SvPVutf8 syn keyword xsMacro SvPVutf8_force SvPVutf8_nolen SvPVutf8x SvPVutf8x_force syn keyword xsMacro SvPVx SvPVx_const SvPVx_force SvPVx_nolen syn keyword xsMacro SvPVx_nolen_const SvREADONLY SvREADONLY_off SvREADONLY_on syn keyword xsMacro SvREFCNT SvREFCNT_dec SvREFCNT_inc SvREFCNT_inc_NN syn keyword xsMacro SvREFCNT_inc_simple SvREFCNT_inc_simple_NN syn keyword xsMacro SvREFCNT_inc_simple_void SvREFCNT_inc_simple_void_NN syn keyword xsMacro SvREFCNT_inc_void SvREFCNT_inc_void_NN SvRELEASE_IVX syn keyword xsMacro SvRELEASE_IVX_ SvRMAGICAL SvRMAGICAL_off SvRMAGICAL_on syn keyword xsMacro SvROK SvROK_off SvROK_on SvRV SvRV_const SvRV_set SvRVx syn keyword xsMacro SvRX SvRXOK SvSCREAM SvSCREAM_off SvSCREAM_on SvSETMAGIC syn keyword xsMacro SvSHARE SvSHARED_HASH SvSHARED_HEK_FROM_PV SvSMAGICAL syn keyword xsMacro SvSMAGICAL_off SvSMAGICAL_on SvSTASH SvSTASH_set syn keyword xsMacro SvSetMagicSV SvSetMagicSV_nosteal SvSetSV SvSetSV_and syn keyword xsMacro SvSetSV_nosteal SvSetSV_nosteal_and SvTAIL SvTAIL_off syn keyword xsMacro SvTAIL_on SvTAINT SvTAINTED SvTAINTED_off SvTAINTED_on syn keyword xsMacro SvTEMP SvTEMP_off SvTEMP_on SvTHINKFIRST SvTIED_mg syn keyword xsMacro SvTIED_obj SvTRUE SvTRUE_nomg SvTRUEx SvTYPE SvUNLOCK syn keyword xsMacro SvUOK SvUPGRADE SvUTF8 SvUTF8_off SvUTF8_on SvUV SvUVX syn keyword xsMacro SvUVXx SvUV_nomg SvUV_set SvUVx SvVALID SvVALID_off syn keyword xsMacro SvVALID_on SvVOK SvVSTRING_mg SvWEAKREF SvWEAKREF_off syn keyword xsMacro SvWEAKREF_on Sv_Grow TAIL TAINT TAINT_ENV TAINT_IF syn keyword xsMacro TAINT_NOT TAINT_PROPER THING THR THREAD_CREATE syn keyword xsMacro THREAD_CREATE_NEEDS_STACK THREAD_POST_CREATE syn keyword xsMacro THREAD_RET_CAST THREAD_RET_TYPE syn keyword xsMacro TIED_METHOD_ARGUMENTS_ON_STACK syn keyword xsMacro TIED_METHOD_MORTALIZE_NOT_NEEDED TIED_METHOD_SAY syn keyword xsMacro TIME64_CONFIG_H TIME64_H TM TMPNAM_R_PROTO TOO_LATE_FOR syn keyword xsMacro TOO_LATE_FOR_ TOPBLOCK TOPMARK TOPi TOPl TOPm1s TOPn TOPp syn keyword xsMacro TOPp1s TOPpx TOPq TOPs TOPu TOPul TOPuq TRIE TRIEC syn keyword xsMacro TRIE_BITMAP TRIE_BITMAP_BYTE TRIE_BITMAP_CLEAR syn keyword xsMacro TRIE_BITMAP_SET TRIE_BITMAP_TEST TRIE_CHARCOUNT syn keyword xsMacro TRIE_NODEIDX TRIE_NODENUM TRIE_WORDS_OFFSET TRIE_next syn keyword xsMacro TRIE_next_fail TTYNAME_R_PROTO TWO_BYTE_UTF8_TO_UNI syn keyword xsMacro TYPE_CHARS TYPE_DIGITS Timeval U16SIZE U16TYPE U16_CONST syn keyword xsMacro U16_MAX U16_MIN U32SIZE U32TYPE U32_ALIGNMENT_REQUIRED syn keyword xsMacro U32_CONST U32_MAX U32_MAX_P1 U32_MAX_P1_HALF U32_MIN syn keyword xsMacro U64SIZE U64TYPE U64_CONST U8SIZE U8TYPE U8_MAX U8_MIN syn keyword xsMacro UCHARAT UINT32_MIN UINT64_C UINT64_MIN UMINUS UNDERBAR syn keyword xsMacro UNICODE_ALLOW_ANY UNICODE_ALLOW_SUPER syn keyword xsMacro UNICODE_ALLOW_SURROGATE UNICODE_BYTE_ORDER_MARK syn keyword xsMacro UNICODE_DISALLOW_FE_FF syn keyword xsMacro UNICODE_DISALLOW_ILLEGAL_INTERCHANGE syn keyword xsMacro UNICODE_DISALLOW_NONCHAR UNICODE_DISALLOW_SUPER syn keyword xsMacro UNICODE_DISALLOW_SURROGATE syn keyword xsMacro UNICODE_GREEK_CAPITAL_LETTER_SIGMA syn keyword xsMacro UNICODE_GREEK_SMALL_LETTER_FINAL_SIGMA syn keyword xsMacro UNICODE_GREEK_SMALL_LETTER_SIGMA syn keyword xsMacro UNICODE_IS_BYTE_ORDER_MARK UNICODE_IS_FE_FF syn keyword xsMacro UNICODE_IS_NONCHAR UNICODE_IS_REPLACEMENT syn keyword xsMacro UNICODE_IS_SUPER UNICODE_IS_SURROGATE UNICODE_LINE_SEPA_0 syn keyword xsMacro UNICODE_LINE_SEPA_1 UNICODE_LINE_SEPA_2 syn keyword xsMacro UNICODE_PARA_SEPA_0 UNICODE_PARA_SEPA_1 syn keyword xsMacro UNICODE_PARA_SEPA_2 UNICODE_PAT_MOD UNICODE_PAT_MODS syn keyword xsMacro UNICODE_REPLACEMENT UNICODE_SURROGATE_FIRST syn keyword xsMacro UNICODE_SURROGATE_LAST UNICODE_WARN_FE_FF syn keyword xsMacro UNICODE_WARN_ILLEGAL_INTERCHANGE UNICODE_WARN_NONCHAR syn keyword xsMacro UNICODE_WARN_SUPER UNICODE_WARN_SURROGATE UNIOP UNIOPSUB syn keyword xsMacro UNISKIP UNI_DISPLAY_BACKSLASH UNI_DISPLAY_ISPRINT syn keyword xsMacro UNI_DISPLAY_QQ UNI_DISPLAY_REGEX UNI_IS_INVARIANT syn keyword xsMacro UNI_TO_NATIVE UNLESS UNLESSM UNLIKELY UNLINK syn keyword xsMacro UNLOCK_DOLLARZERO_MUTEX UNTIL USE USE_64_BIT_ALL syn keyword xsMacro USE_64_BIT_INT USE_64_BIT_RAWIO USE_64_BIT_STDIO syn keyword xsMacro USE_BSDPGRP USE_DYNAMIC_LOADING USE_ENVIRON_ARRAY syn keyword xsMacro USE_HASH_SEED USE_HEAP_INSTEAD_OF_STACK USE_LARGE_FILES syn keyword xsMacro USE_LEFT USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE syn keyword xsMacro USE_LOCALE_NUMERIC USE_PERLIO USE_REENTRANT_API syn keyword xsMacro USE_SEMCTL_SEMID_DS USE_SEMCTL_SEMUN USE_STAT_BLOCKS syn keyword xsMacro USE_STAT_RDEV USE_STDIO USE_STDIO_BASE USE_STDIO_PTR syn keyword xsMacro USE_STRUCT_COPY USE_SYSTEM_GMTIME USE_SYSTEM_LOCALTIME syn keyword xsMacro USE_THREADS USE_TM64 USE_UTF8_IN_NAMES UTF8SKIP syn keyword xsMacro UTF8_ACCUMULATE UTF8_ALLOW_ANY UTF8_ALLOW_ANYUV syn keyword xsMacro UTF8_ALLOW_CONTINUATION UTF8_ALLOW_DEFAULT syn keyword xsMacro UTF8_ALLOW_EMPTY UTF8_ALLOW_FFFF UTF8_ALLOW_LONG syn keyword xsMacro UTF8_ALLOW_NON_CONTINUATION UTF8_ALLOW_SHORT syn keyword xsMacro UTF8_ALLOW_SURROGATE UTF8_CHECK_ONLY UTF8_DISALLOW_FE_FF syn keyword xsMacro UTF8_DISALLOW_ILLEGAL_INTERCHANGE UTF8_DISALLOW_NONCHAR syn keyword xsMacro UTF8_DISALLOW_SUPER UTF8_DISALLOW_SURROGATE syn keyword xsMacro UTF8_EIGHT_BIT_HI UTF8_EIGHT_BIT_LO syn keyword xsMacro UTF8_FIRST_PROBLEMATIC_CODE_POINT_FIRST_BYTE syn keyword xsMacro UTF8_IS_CONTINUATION UTF8_IS_CONTINUED syn keyword xsMacro UTF8_IS_DOWNGRADEABLE_START UTF8_IS_INVARIANT syn keyword xsMacro UTF8_IS_NONCHAR_ syn keyword xsMacro UTF8_IS_NONCHAR_GIVEN_THAT_NON_SUPER_AND_GE_PROBLEMATIC syn keyword xsMacro UTF8_IS_START UTF8_IS_SUPER UTF8_IS_SURROGATE syn keyword xsMacro UTF8_MAXBYTES UTF8_MAXBYTES_CASE UTF8_MAXLEN syn keyword xsMacro UTF8_MAX_FOLD_CHAR_EXPAND UTF8_QUAD_MAX UTF8_TWO_BYTE_HI syn keyword xsMacro UTF8_TWO_BYTE_HI_nocast UTF8_TWO_BYTE_LO syn keyword xsMacro UTF8_TWO_BYTE_LO_nocast UTF8_WARN_FE_FF syn keyword xsMacro UTF8_WARN_ILLEGAL_INTERCHANGE UTF8_WARN_NONCHAR syn keyword xsMacro UTF8_WARN_SUPER UTF8_WARN_SURROGATE syn keyword xsMacro UTF_ACCUMULATION_OVERFLOW_MASK UTF_ACCUMULATION_SHIFT syn keyword xsMacro UTF_CONTINUATION_MARK UTF_CONTINUATION_MASK syn keyword xsMacro UTF_START_MARK UTF_START_MASK UTF_TO_NATIVE UVSIZE UVTYPE syn keyword xsMacro UVXf UV_DIG UV_MAX UV_MAX_P1 UV_MAX_P1_HALF UV_MIN UVf syn keyword xsMacro U_32 U_I U_L U_S U_V Uid_t_f Uid_t_sign Uid_t_size syn keyword xsMacro VAL_EAGAIN VAL_O_NONBLOCK VDf VERB VERTWS VOIDFLAGS syn keyword xsMacro VOIDUSED VOL VTBL_amagic VTBL_amagicelem VTBL_arylen syn keyword xsMacro VTBL_bm VTBL_collxfrm VTBL_dbline VTBL_defelem VTBL_env syn keyword xsMacro VTBL_envelem VTBL_fm VTBL_glob VTBL_isa VTBL_isaelem syn keyword xsMacro VTBL_mglob VTBL_nkeys VTBL_pack VTBL_packelem VTBL_pos syn keyword xsMacro VTBL_regdata VTBL_regdatum VTBL_regexp VTBL_sigelem syn keyword xsMacro VTBL_substr VTBL_sv VTBL_taint VTBL_uvar VTBL_vec syn keyword xsMacro WARN_ALL WARN_ALLstring WARN_AMBIGUOUS WARN_BAREWORD syn keyword xsMacro WARN_CLOSED WARN_CLOSURE WARN_DEBUGGING WARN_DEPRECATED syn keyword xsMacro WARN_DIGIT WARN_EXEC WARN_EXITING WARN_GLOB syn keyword xsMacro WARN_ILLEGALPROTO WARN_IMPRECISION WARN_INPLACE syn keyword xsMacro WARN_INTERNAL WARN_IO WARN_LAYER WARN_MALLOC WARN_MISC syn keyword xsMacro WARN_NEWLINE WARN_NONCHAR WARN_NONEstring syn keyword xsMacro WARN_NON_UNICODE WARN_NUMERIC WARN_ONCE WARN_OVERFLOW syn keyword xsMacro WARN_PACK WARN_PARENTHESIS WARN_PIPE WARN_PORTABLE syn keyword xsMacro WARN_PRECEDENCE WARN_PRINTF WARN_PROTOTYPE WARN_QW syn keyword xsMacro WARN_RECURSION WARN_REDEFINE WARN_REGEXP WARN_RESERVED syn keyword xsMacro WARN_SEMICOLON WARN_SEVERE WARN_SIGNAL WARN_SUBSTR syn keyword xsMacro WARN_SURROGATE WARN_SYNTAX WARN_TAINT WARN_THREADS syn keyword xsMacro WARN_UNINITIALIZED WARN_UNOPENED WARN_UNPACK WARN_UNTIE syn keyword xsMacro WARN_UTF8 WARN_VOID WARNshift WARNsize WEXITSTATUS WHEN syn keyword xsMacro WHILE WHILEM WHILEM_A_max WHILEM_A_max_fail WHILEM_A_min syn keyword xsMacro WHILEM_A_min_fail WHILEM_A_pre WHILEM_A_pre_fail syn keyword xsMacro WHILEM_B_max WHILEM_B_max_fail WHILEM_B_min syn keyword xsMacro WHILEM_B_min_fail WIDEST_UTYPE WIFEXITED WIFSIGNALED syn keyword xsMacro WIFSTOPPED WIN32SCK_IS_STDSCK WNOHANG WORD WSTOPSIG syn keyword xsMacro WTERMSIG WUNTRACED XHvTOTALKEYS XOPd_xop_class syn keyword xsMacro XOPd_xop_desc XOPd_xop_name XOPd_xop_peep XOPf_xop_class syn keyword xsMacro XOPf_xop_desc XOPf_xop_name XOPf_xop_peep XPUSHTARG syn keyword xsMacro XPUSHi XPUSHmortal XPUSHn XPUSHp XPUSHs XPUSHu XPUSHundef syn keyword xsMacro XS XSANY XSINTERFACE_CVT XSINTERFACE_CVT_ANON syn keyword xsMacro XSINTERFACE_FUNC XSINTERFACE_FUNC_SET XSPROTO XSRETURN syn keyword xsMacro XSRETURN_EMPTY XSRETURN_IV XSRETURN_NO XSRETURN_NV syn keyword xsMacro XSRETURN_PV XSRETURN_PVN XSRETURN_UNDEF XSRETURN_UV syn keyword xsMacro XSRETURN_YES XST_mIV XST_mNO XST_mNV XST_mPV XST_mPVN syn keyword xsMacro XST_mUNDEF XST_mUV XST_mYES XS_APIVERSION_BOOTCHECK syn keyword xsMacro XS_DYNAMIC_FILENAME XS_EXTERNAL XS_INTERNAL syn keyword xsMacro XS_VERSION_BOOTCHECK XSprePUSH XTENDED_PAT_MOD XopDISABLE syn keyword xsMacro XopENABLE XopENTRY XopENTRY_set XopFLAGS YADAYADA YIELD syn keyword xsMacro YYEMPTY YYSTYPE_IS_DECLARED YYSTYPE_IS_TRIVIAL syn keyword xsMacro YYTOKENTYPE Zero ZeroD _ _CANNOT _CC_ALNUMC_A syn keyword xsMacro _CC_ALNUMC_L1 _CC_ALPHA_A _CC_ALPHA_L1 _CC_BLANK_A syn keyword xsMacro _CC_BLANK_L1 _CC_CHARNAME_CONT _CC_CNTRL_A _CC_CNTRL_L1 syn keyword xsMacro _CC_DIGIT_A _CC_GRAPH_A _CC_GRAPH_L1 _CC_IDFIRST_A syn keyword xsMacro _CC_IDFIRST_L1 _CC_LOWER_A _CC_LOWER_L1 syn keyword xsMacro _CC_NONLATIN1_FOLD _CC_OCTAL_A _CC_PRINT_A _CC_PRINT_L1 syn keyword xsMacro _CC_PSXSPC_A _CC_PSXSPC_L1 _CC_PUNCT_A _CC_PUNCT_L1 syn keyword xsMacro _CC_QUOTEMETA _CC_SPACE_A _CC_SPACE_L1 _CC_UPPER_A syn keyword xsMacro _CC_UPPER_L1 _CC_WORDCHAR_A _CC_WORDCHAR_L1 _CC_XDIGIT_A syn keyword xsMacro _CPERLarg _GNU_SOURCE syn keyword xsMacro _HAS_NONLATIN1_FOLD_CLOSURE_ONLY_FOR_USE_BY_REGCOMP_DOT_C_AND_REGEXEC_DOT_C syn keyword xsMacro _INC_PERL_XSUB_H _PERLIOL_H _PERLIO_H _PERL_OBJECT_THIS syn keyword xsMacro _REGEXP_COMMON _RXf_PMf_CHARSET_SHIFT _RXf_PMf_SHIFT_NEXT syn keyword xsMacro _SOCKADDR_LEN _STDIO_H _STDIO_INCLUDED _V _XPVCV_COMMON syn keyword xsMacro _XPV_HEAD __Inc__IPerl___ __PATCHLEVEL_H_INCLUDED__ syn keyword xsMacro __STDIO_LOADED __attribute__deprecated__ syn keyword xsMacro __attribute__format__ __attribute__format__null_ok__ syn keyword xsMacro __attribute__malloc__ __attribute__nonnull__ syn keyword xsMacro __attribute__noreturn__ __attribute__pure__ syn keyword xsMacro __attribute__unused__ __attribute__warn_unused_result__ syn keyword xsMacro __filbuf __flsbuf __perlapi_h__ _config_h_ _exit _filbuf syn keyword xsMacro _flsbuf _isQUOTEMETA _stdopen _swab_16_ _swab_32_ syn keyword xsMacro _swab_64_ aTHXo aTHXo_ aTHXx aTHXx_ abort accept access syn keyword xsMacro anchored_end_shift anchored_offset anchored_substr syn keyword xsMacro anchored_utf8 asctime assert assert_not_ROK syn keyword xsMacro assert_not_glob atoll bcmp bind blk_eval blk_format syn keyword xsMacro blk_gimme blk_givwhen blk_loop blk_oldcop blk_oldmarksp syn keyword xsMacro blk_oldpm blk_oldscopesp blk_oldsp blk_sub blk_u16 boolSV syn keyword xsMacro cBINOP cBINOPo cBINOPx cBOOL cCOP cCOPo cCOPx cGVOP_gv syn keyword xsMacro cGVOPo_gv cGVOPx_gv cLISTOP cLISTOPo cLISTOPx cLOGOP syn keyword xsMacro cLOGOPo cLOGOPx cLOOP cLOOPo cLOOPx cPADOP cPADOPo syn keyword xsMacro cPADOPx cPMOP cPMOPo cPMOPx cPVOP cPVOPo cPVOPx cSVOP syn keyword xsMacro cSVOP_sv cSVOPo cSVOPo_sv cSVOPx cSVOPx_sv cSVOPx_svp syn keyword xsMacro cUNOP cUNOPo cUNOPx chdir check_end_shift syn keyword xsMacro check_offset_max check_offset_min check_substr check_utf8 syn keyword xsMacro child_offset_bits chmod chsize ckDEAD ckWARN ckWARN2 syn keyword xsMacro ckWARN2_d ckWARN3 ckWARN3_d ckWARN4 ckWARN4_d ckWARN_d syn keyword xsMacro close closedir connect cop_hints_2hv cop_hints_fetch_pv syn keyword xsMacro cop_hints_fetch_pvn cop_hints_fetch_pvs syn keyword xsMacro cop_hints_fetch_sv cophh_2hv cophh_copy cophh_delete_pv syn keyword xsMacro cophh_delete_pvn cophh_delete_pvs cophh_delete_sv syn keyword xsMacro cophh_fetch_pv cophh_fetch_pvn cophh_fetch_pvs syn keyword xsMacro cophh_fetch_sv cophh_free cophh_new_empty cophh_store_pv syn keyword xsMacro cophh_store_pvn cophh_store_pvs cophh_store_sv crypt syn keyword xsMacro ctermid ctime cv_ckproto cx_type cxstack cxstack_ix syn keyword xsMacro cxstack_max dATARGET dAX dAXMARK dEXT dEXTCONST dITEMS syn keyword xsMacro dJMPENV dMARK dMULTICALL dMY_CXT dMY_CXT_INTERP syn keyword xsMacro dMY_CXT_SV dNOOP dORIGMARK dPOPPOPiirl dPOPPOPnnrl syn keyword xsMacro dPOPPOPssrl dPOPTOPiirl dPOPTOPiirl_nomg syn keyword xsMacro dPOPTOPiirl_ul_nomg dPOPTOPnnrl dPOPTOPnnrl_nomg syn keyword xsMacro dPOPTOPssrl dPOPXiirl dPOPXiirl_ul_nomg dPOPXnnrl syn keyword xsMacro dPOPXssrl dPOPiv dPOPnv dPOPnv_nomg dPOPqv dPOPss dPOPuqv syn keyword xsMacro dPOPuv dSAVEDERRNO dSAVE_ERRNO dSP dTARG dTARGET syn keyword xsMacro dTARGETSTACKED dTHR dTHX dTHXa dTHXo dTHXoa dTHXs dTHXx syn keyword xsMacro dTOPiv dTOPnv dTOPqv dTOPss dTOPuqv dTOPuv dUNDERBAR dVAR syn keyword xsMacro dXSARGS dXSFUNCTION dXSI32 dXSTARG dXSUB_SYS deprecate syn keyword xsMacro djSP do_open drand48 dup dup2 endgrent endhostent syn keyword xsMacro endnetent endprotoent endpwent endservent environ execl syn keyword xsMacro execv execvp fcntl fd_set fdopen fileno float_end_shift syn keyword xsMacro float_max_offset float_min_offset float_substr float_utf8 syn keyword xsMacro flock flockfile foldEQ_utf8 frewind fscanf fstat ftell syn keyword xsMacro ftruncate ftrylockfile funlockfile fwrite1 generic_uni syn keyword xsMacro generic_utf8 get_cvs getc_unlocked getegid geteuid getgid syn keyword xsMacro getgrent getgrgid getgrnam gethostbyaddr gethostbyname syn keyword xsMacro gethostent gethostname getlogin getnetbyaddr getnetbyname syn keyword xsMacro getnetent getpeername getpid getprotobyname syn keyword xsMacro getprotobynumber getprotoent getpwent getpwnam getpwuid syn keyword xsMacro getservbyname getservbyport getservent getsockname syn keyword xsMacro getsockopt getspnam gettimeofday getuid getw gv_AVadd syn keyword xsMacro gv_HVadd gv_IOadd gv_SVadd gv_autoload4 gv_efullname3 syn keyword xsMacro gv_fetchmeth gv_fetchmeth_autoload gv_fetchmethod syn keyword xsMacro gv_fetchmethod_flags gv_fetchpvn gv_fetchpvs syn keyword xsMacro gv_fetchsv_nomg gv_fullname3 gv_init gv_stashpvs htoni syn keyword xsMacro htonl htons htovl htovs hv_delete hv_delete_ent hv_exists syn keyword xsMacro hv_exists_ent hv_fetch hv_fetch_ent hv_fetchs hv_iternext syn keyword xsMacro hv_magic hv_store hv_store_ent hv_store_flags hv_stores syn keyword xsMacro hv_undef ibcmp ibcmp_locale ibcmp_utf8 inet_addr syn keyword xsMacro inet_ntoa init_os_extras init_thread_intern ioctl isALNUM syn keyword xsMacro isALNUMC isALNUMC_A isALNUMC_L1 isALNUMC_LC syn keyword xsMacro isALNUMC_LC_utf8 isALNUMU isALNUM_LC isALNUM_LC_utf8 syn keyword xsMacro isALNUM_LC_uvchr isALNUM_lazy isALNUM_lazy_if isALNUM_uni syn keyword xsMacro isALNUM_utf8 isALPHA isALPHAU isALPHA_A isALPHA_L1 syn keyword xsMacro isALPHA_LC isALPHA_LC_utf8 isALPHA_LC_uvchr isALPHA_uni syn keyword xsMacro isALPHA_utf8 isASCII isASCII_A isASCII_L1 isASCII_LC syn keyword xsMacro isASCII_uni isASCII_utf8 isBLANK isBLANK_A isBLANK_L1 syn keyword xsMacro isBLANK_LC isBLANK_LC_uni isBLANK_LC_utf8 isBLANK_uni syn keyword xsMacro isBLANK_utf8 isCHARNAME_CONT isCNTRL isCNTRL_A isCNTRL_L1 syn keyword xsMacro isCNTRL_LC isCNTRL_LC_utf8 isCNTRL_LC_uvchr isCNTRL_uni syn keyword xsMacro isCNTRL_utf8 isDIGIT isDIGIT_A isDIGIT_L1 isDIGIT_LC syn keyword xsMacro isDIGIT_LC_utf8 isDIGIT_LC_uvchr isDIGIT_uni isDIGIT_utf8 syn keyword xsMacro isGRAPH isGRAPH_A isGRAPH_L1 isGRAPH_LC isGRAPH_LC_utf8 syn keyword xsMacro isGRAPH_LC_uvchr isGRAPH_uni isGRAPH_utf8 isGV syn keyword xsMacro isGV_with_GP isGV_with_GP_off isGV_with_GP_on syn keyword xsMacro isIDCONT_utf8 isIDFIRST isIDFIRST_A isIDFIRST_L1 syn keyword xsMacro isIDFIRST_LC isIDFIRST_LC_utf8 isIDFIRST_LC_uvchr syn keyword xsMacro isIDFIRST_lazy isIDFIRST_lazy_if isIDFIRST_uni syn keyword xsMacro isIDFIRST_utf8 isLEXWARN_off isLEXWARN_on isLOWER syn keyword xsMacro isLOWER_A isLOWER_L1 isLOWER_LC isLOWER_LC_utf8 syn keyword xsMacro isLOWER_LC_uvchr isLOWER_uni isLOWER_utf8 isOCTAL syn keyword xsMacro isOCTAL_A isOCTAL_L1 isPRINT isPRINT_A isPRINT_L1 syn keyword xsMacro isPRINT_LC isPRINT_LC_utf8 isPRINT_LC_uvchr isPRINT_uni syn keyword xsMacro isPRINT_utf8 isPSXSPC isPSXSPC_A isPSXSPC_L1 isPSXSPC_LC syn keyword xsMacro isPSXSPC_LC_uni isPSXSPC_LC_utf8 isPSXSPC_uni syn keyword xsMacro isPSXSPC_utf8 isPUNCT isPUNCT_A isPUNCT_L1 isPUNCT_LC syn keyword xsMacro isPUNCT_LC_utf8 isPUNCT_LC_uvchr isPUNCT_uni isPUNCT_utf8 syn keyword xsMacro isSPACE isSPACE_A isSPACE_L1 isSPACE_LC isSPACE_LC_utf8 syn keyword xsMacro isSPACE_LC_uvchr isSPACE_uni isSPACE_utf8 isUPPER syn keyword xsMacro isUPPER_A isUPPER_L1 isUPPER_LC isUPPER_LC_utf8 syn keyword xsMacro isUPPER_LC_uvchr isUPPER_uni isUPPER_utf8 isWARN_ONCE syn keyword xsMacro isWARN_on isWARNf_on isWORDCHAR isWORDCHAR_A syn keyword xsMacro isWORDCHAR_L1 isXDIGIT isXDIGIT_A isXDIGIT_L1 syn keyword xsMacro isXDIGIT_uni isXDIGIT_utf8 is_HORIZWS is_HORIZWS_cp syn keyword xsMacro is_HORIZWS_latin1 is_HORIZWS_latin1_safe is_HORIZWS_safe syn keyword xsMacro is_HORIZWS_utf8 is_HORIZWS_utf8_safe is_LAX_VERSION syn keyword xsMacro is_LNBREAK is_LNBREAK_latin1 is_LNBREAK_latin1_safe syn keyword xsMacro is_LNBREAK_safe is_LNBREAK_utf8 is_LNBREAK_utf8_safe syn keyword xsMacro is_STRICT_VERSION is_TRICKYFOLD is_TRICKYFOLD_cp syn keyword xsMacro is_TRICKYFOLD_safe is_VERTWS is_VERTWS_cp syn keyword xsMacro is_VERTWS_latin1 is_VERTWS_latin1_safe is_VERTWS_safe syn keyword xsMacro is_VERTWS_utf8 is_VERTWS_utf8_safe is_utf8_string_loc syn keyword xsMacro isatty kBINOP kCOP kGVOP_gv kLISTOP kLOGOP kLOOP kPADOP syn keyword xsMacro kPMOP kPVOP kSVOP kSVOP_sv kUNOP kill killpg syn keyword xsMacro lex_stuff_pvs link listen lockf longjmp lseek lstat syn keyword xsMacro mPUSHi mPUSHn mPUSHp mPUSHs mPUSHu mXPUSHi mXPUSHn syn keyword xsMacro mXPUSHp mXPUSHs mXPUSHu memEQ memEQs memNE memNEs memchr syn keyword xsMacro memcmp memzero mkdir mktemp my my_betoh16 my_betoh32 syn keyword xsMacro my_betoh64 my_betohi my_betohl my_betohn my_betohs syn keyword xsMacro my_binmode my_htobe16 my_htobe32 my_htobe64 my_htobei syn keyword xsMacro my_htobel my_htoben my_htobes my_htole16 my_htole32 syn keyword xsMacro my_htole64 my_htolei my_htolel my_htolen my_htoles syn keyword xsMacro my_letoh16 my_letoh32 my_letoh64 my_letohi my_letohl syn keyword xsMacro my_letohn my_letohs my_lstat my_snprintf my_sprintf syn keyword xsMacro my_stat my_strlcat my_strlcpy my_vsnprintf newAV newGVgen syn keyword xsMacro newHV newIO newRV_inc newSUB newSVpvn_utf8 newSVpvs syn keyword xsMacro newSVpvs_flags newSVpvs_share newXSproto ntohi ntohl syn keyword xsMacro ntohs opASSIGN op_getmad op_lvalue open opendir pTHX_1 syn keyword xsMacro pTHX_2 pTHX_3 pTHX_4 pTHX_5 pTHX_6 pTHX_7 pTHX_8 pTHX_9 syn keyword xsMacro pTHX_FORMAT pTHX_VALUE pTHX_VALUE_ pTHX__FORMAT syn keyword xsMacro pTHX__VALUE pTHX__VALUE_ pTHXo pTHXo_ pTHXx pTHXx_ pVAR syn keyword xsMacro pWARN_ALL pWARN_NONE pWARN_STD packWARN packWARN2 syn keyword xsMacro packWARN3 packWARN4 pad_add_name_pvs pad_findmy_pvs syn keyword xsMacro pad_peg padadd_NO_DUP_CHECK padadd_OUR padadd_STATE syn keyword xsMacro padadd_UTF8_NAME padnew_CLONE padnew_SAVE padnew_SAVESUB syn keyword xsMacro panic_write2 pause pclose pipe popen prepare_SV_for_RV syn keyword xsMacro pthread_attr_init pthread_condattr_default pthread_create syn keyword xsMacro pthread_key_create pthread_keycreate syn keyword xsMacro pthread_mutexattr_default pthread_mutexattr_init syn keyword xsMacro pthread_mutexattr_settype putc_unlocked putenv putw syn keyword xsMacro random read readdir readdir64 recv recvfrom ref syn keyword xsMacro refcounted_he_fetch_pvs refcounted_he_new_pvs rename syn keyword xsMacro rewinddir rmdir sTHX safecalloc safefree safemalloc syn keyword xsMacro saferealloc save_aelem save_freeop save_freepv syn keyword xsMacro save_freesv save_helem save_mortalizesv save_op savepvs syn keyword xsMacro savesharedpvs sb_dstr sb_iters sb_m sb_maxiters syn keyword xsMacro sb_oldsave sb_orig sb_rflags sb_rx sb_rxres sb_rxtainted syn keyword xsMacro sb_s sb_strend sb_targ seedDrand01 seekdir select send syn keyword xsMacro sendto setbuf setgid setgrent sethostent setjmp syn keyword xsMacro setlinebuf setlocale setmode setnetent setprotoent syn keyword xsMacro setpwent setregid setreuid setservent setsockopt setuid syn keyword xsMacro setvbuf share_hek_hek sharepvn shutdown signal sleep syn keyword xsMacro socket socketpair specialWARN srand48 srandom stat syn keyword xsMacro stdoutf strEQ strGE strGT strLE strLT strNE strchr syn keyword xsMacro strerror stringify stringify_immed strnEQ strnNE strrchr syn keyword xsMacro strtoll strtoull sv_2bool sv_2iv sv_2nv sv_2pv syn keyword xsMacro sv_2pv_nolen sv_2pv_nomg sv_2pvbyte_nolen syn keyword xsMacro sv_2pvutf8_nolen sv_2uv sv_catpv_nomg sv_catpvn syn keyword xsMacro sv_catpvn_mg sv_catpvn_nomg sv_catpvn_utf8_upgrade syn keyword xsMacro sv_catpvs sv_catpvs_flags sv_catpvs_mg sv_catpvs_nomg syn keyword xsMacro sv_catsv sv_catsv_mg sv_catsv_nomg sv_catxmlpvs sv_cmp syn keyword xsMacro sv_cmp_locale sv_collxfrm sv_eq sv_force_normal sv_insert syn keyword xsMacro sv_nolocking sv_nounlocking sv_pv sv_pvbyte sv_pvn_force syn keyword xsMacro sv_pvn_force_nomg sv_pvutf8 sv_setpvs sv_setpvs_mg syn keyword xsMacro sv_setref_pvs sv_setsv sv_setsv_nomg sv_taint sv_unref syn keyword xsMacro sv_usepvn sv_usepvn_mg sv_utf8_upgrade syn keyword xsMacro sv_utf8_upgrade_flags sv_utf8_upgrade_nomg tTHX telldir syn keyword xsMacro times tmpfile tmpnam toCTRL toFOLD_uni toLOWER syn keyword xsMacro toLOWER_LATIN1 toLOWER_LC toLOWER_uni toLOWER_utf8 syn keyword xsMacro toTITLE_uni toTITLE_utf8 toUPPER toUPPER_LATIN1_MOD syn keyword xsMacro toUPPER_LC toUPPER_uni toUPPER_utf8 to_uni_fold syn keyword xsMacro to_utf8_fold to_utf8_lower to_utf8_title to_utf8_upper syn keyword xsMacro truncate tryAMAGICbin_MG tryAMAGICunDEREF syn keyword xsMacro tryAMAGICunTARGET tryAMAGICun_MG ttyname umask uname syn keyword xsMacro unlink unpackWARN1 unpackWARN2 unpackWARN3 unpackWARN4 syn keyword xsMacro utf8n_to_uvchr utime uvchr_to_utf8 uvuni_to_utf8 vTHX syn keyword xsMacro vfprintf vtohl vtohs wait want_vtbl_bm want_vtbl_fm syn keyword xsMacro what_TRICKYFOLD what_TRICKYFOLD_safe what_len_TRICKYFOLD syn keyword xsMacro what_len_TRICKYFOLD_safe whichsig write xio_any xio_dirp syn keyword xsMacro xiv_iv xuv_uv yystype " Define the default highlighting. " For version 5.7 and earlier: only 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 else command -nargs=+ HiLink hi def link endif HiLink xsPrivate Error HiLink xsSuperseded Error HiLink xsType Type HiLink xsString String HiLink xsConstant Constant HiLink xsException Exception HiLink xsKeyword Keyword HiLink xsFunction Function HiLink xsVariable Identifier HiLink xsMacro Macro delcommand HiLink endif let b:current_syntax = "xs" " vim: ts=8 vim-7.4.1689/runtime/syntax/xsd.vim000066400000000000000000000041151267703067000171220ustar00rootroot00000000000000" Vim syntax file " Language: XSD (XML Schema) " Maintainer: Johannes Zellner " Last Change: Tue, 27 Apr 2004 14:54:59 CEST " Filenames: *.xsd " $Id: xsd.vim,v 1.1 2004/06/13 18:20:48 vimboss Exp $ " 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 vim-7.4.1689/runtime/syntax/xslt.vim000066400000000000000000000041661267703067000173240ustar00rootroot00000000000000" Vim syntax file " Language: XSLT " Maintainer: Johannes Zellner " Last Change: Sun, 28 Oct 2001 21:22:24 +0100 " Filenames: *.xsl " $Id: xslt.vim,v 1.1 2004/06/13 15:52:10 vimboss Exp $ " 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 vim-7.4.1689/runtime/syntax/xxd.vim000066400000000000000000000022251267703067000171270ustar00rootroot00000000000000" Vim syntax file " Language: bin using xxd " Maintainer: Charles E. Campbell " Last Change: Oct 23, 2014 " Version: 8 " Notes: use :help xxd to see how to invoke it " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_XXD " For version 5.x: Clear all syntax items " 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 else command -nargs=+ HiLink hi def link endif HiLink xxdAddress Constant HiLink xxdSep Identifier HiLink xxdAscii Statement delcommand HiLink endif let b:current_syntax = "xxd" " vim: ts=4 vim-7.4.1689/runtime/syntax/yacc.vim000066400000000000000000000126571267703067000172550ustar00rootroot00000000000000" Vim syntax file " Language: Yacc " Maintainer: Charles E. Campbell " Last Change: Apr 02, 2015 " Version: 13 " URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax " " Options: {{{1 " g:yacc_uses_cpp : if this variable exists, then C++ is loaded rather than C " --------------------------------------------------------------------- " this version of syntax/yacc.vim requires 6.0 or later if version < 600 finish endif if exists("b:current_syntax") syntax clear endif " --------------------------------------------------------------------- " Folding Support {{{1 if has("folding") com! -nargs=+ SynFold fold else com! -nargs=+ SynFold endif " --------------------------------------------------------------------- " Read the C syntax to start with {{{1 " Read the C/C++ syntax to start with let s:Cpath= fnameescape(expand(":p:h").(exists("g:yacc_uses_cpp")? "/cpp.vim" : "/c.vim")) if !filereadable(s:Cpath) for s:Cpath in split(globpath(&rtp,(exists("g:yacc_uses_cpp")? "syntax/cpp.vim" : "syntax/c.vim")),"\n") if filereadable(fnameescape(s:Cpath)) let s:Cpath= fnameescape(s:Cpath) break endif endfor endif exe "syn include @yaccCode ".s:Cpath " --------------------------------------------------------------------- " Yacc Clusters: {{{1 syn cluster yaccInitCluster contains=yaccKey,yaccKeyActn,yaccBrkt,yaccType,yaccString,yaccUnionStart,yaccHeader2,yaccComment,yaccDefines,yaccParseParam,yaccParseOption syn cluster yaccRulesCluster contains=yaccNonterminal,yaccString,yaccComment " --------------------------------------------------------------------- " Yacc Sections: {{{1 SynFold syn region yaccInit start='.'ms=s-1,rs=s-1 matchgroup=yaccSectionSep end='^%%$'me=e-2,re=e-2 contains=@yaccInitCluster nextgroup=yaccRules skipwhite skipempty contained SynFold syn region yaccInit2 start='\%^.'ms=s-1,rs=s-1 matchgroup=yaccSectionSep end='^%%$'me=e-2,re=e-2 contains=@yaccInitCluster nextgroup=yaccRules skipwhite skipempty SynFold syn region yaccHeader2 matchgroup=yaccSep start="^\s*\zs%{" end="^\s*%}" contains=@yaccCode nextgroup=yaccInit skipwhite skipempty contained SynFold syn region yaccHeader matchgroup=yaccSep start="^\s*\zs%{" end="^\s*%}" contains=@yaccCode nextgroup=yaccInit skipwhite skipempty SynFold syn region yaccRules matchgroup=yaccSectionSep start='^%%$' end='^%%$'me=e-2,re=e-2 contains=@yaccRulesCluster nextgroup=yaccEndCode skipwhite skipempty contained SynFold syn region yaccEndCode matchgroup=yaccSectionSep start='^%%$' end='\%$' contains=@yaccCode contained " --------------------------------------------------------------------- " Yacc Commands: {{{1 syn match yaccDefines '^%define\s\+.*$' syn match yaccParseParam '%\(parse\|lex\)-param\>' skipwhite nextgroup=yaccParseParamStr syn match yaccParseOption '%\%(api\.pure\|pure-parser\|locations\|error-verbose\)\>' syn region yaccParseParamStr contained matchgroup=Delimiter start='{' end='}' contains=cStructure syn match yaccDelim "[:|]" contained syn match yaccOper "@\d\+" contained syn match yaccKey "^\s*%\(token\|type\|left\|right\|start\|ident\|nonassoc\)\>" contained syn match yaccKey "\s%\(prec\|expect\)\>" contained syn match yaccKey "\$\(<[a-zA-Z_][a-zA-Z_0-9]*>\)\=[\$0-9]\+" contained syn keyword yaccKeyActn yyerrok yyclearin contained syn match yaccUnionStart "^%union" skipwhite skipnl nextgroup=yaccUnion contained SynFold syn region yaccUnion matchgroup=yaccCurly start="{" matchgroup=yaccCurly end="}" contains=@yaccCode contained syn match yaccBrkt "[<>]" contained syn match yaccType "<[a-zA-Z_][a-zA-Z0-9_]*>" contains=yaccBrkt contained SynFold syn region yaccNonterminal start="^\s*\a\w*\ze\_s*\(/\*\_.\{-}\*/\)\=\_s*:" matchgroup=yaccDelim end=";" matchgroup=yaccSectionSep end='^%%$'me=e-2,re=e-2 contains=yaccAction,yaccDelim,yaccString,yaccComment contained syn region yaccComment start="/\*" end="\*/" syn match yaccString "'[^']*'" contained " --------------------------------------------------------------------- " I'd really like to highlight just the outer {}. Any suggestions??? {{{1 syn match yaccCurlyError "[{}]" SynFold syn region yaccAction matchgroup=yaccCurly start="{" end="}" contains=@yaccCode,yaccVar contained syn match yaccVar '\$\d\+\|\$\$\|\$<\I\i*>\$\|\$<\I\i*>\d\+' containedin=cParen,cPreProc,cMulti contained " --------------------------------------------------------------------- " Yacc synchronization: {{{1 syn sync fromstart " --------------------------------------------------------------------- " Define the default highlighting. {{{1 if !exists("did_yacc_syn_inits") hi def link yaccBrkt yaccStmt hi def link yaccComment Comment hi def link yaccCurly Delimiter hi def link yaccCurlyError Error hi def link yaccDefines cDefine hi def link yaccDelim Delimiter hi def link yaccKeyActn Special hi def link yaccKey yaccStmt hi def link yaccNonterminal Function hi def link yaccOper yaccStmt hi def link yaccParseOption cDefine hi def link yaccParseParam yaccParseOption hi def link yaccSectionSep Todo hi def link yaccSep Delimiter hi def link yaccStmt Statement hi def link yaccString String hi def link yaccType Type hi def link yaccUnionStart yaccKey hi def link yaccVar Special endif " --------------------------------------------------------------------- " Cleanup: {{{1 delcommand SynFold let b:current_syntax = "yacc" " --------------------------------------------------------------------- " Modelines: {{{1 " vim: ts=15 fdm=marker vim-7.4.1689/runtime/syntax/yaml.vim000066400000000000000000000311001267703067000172600ustar00rootroot00000000000000" Vim syntax file " Language: YAML (YAML Ain't Markup Language) 1.2 " Maintainer: Nikolai Pavlov " First author: Nikolai Weibull " Latest Revision: 2015-03-28 if exists('b:current_syntax') finish endif let s:cpo_save = &cpo set cpo&vim " Choose the schema to use " TODO: Validate schema if !exists('b:yaml_schema') if exists('g:yaml_schema') let b:yaml_schema = g:yaml_schema else let b:yaml_schema = 'core' endif endif let s:ns_char = '\%([\n\r\uFEFF \t]\@!\p\)' let s:ns_word_char = '[[:alnum:]_\-]' let s:ns_uri_char = '\%(%\x\x\|'.s:ns_word_char.'\|[#/;?:@&=+$,.!~*''()[\]]\)' let s:ns_tag_char = '\%(%\x\x\|'.s:ns_word_char.'\|[#/;?:@&=+$.~*''()]\)' let s:c_ns_anchor_char = '\%([\n\r\uFEFF \t,[\]{}]\@!\p\)' let s:c_indicator = '[\-?:,[\]{}#&*!|>''"%@`]' let s:c_flow_indicator = '[,[\]{}]' let s:ns_char_without_c_indicator = substitute(s:ns_char, '\v\C[\zs', '\=s:c_indicator[1:-2]', '') let s:_collection = '[^\@!\(\%(\\\.\|\[^\\\]]\)\+\)]' let s:_neg_collection = '[^\(\%(\\\.\|\[^\\\]]\)\+\)]' function s:SimplifyToAssumeAllPrintable(p) return substitute(a:p, '\V\C\\%('.s:_collection.'\\@!\\p\\)', '[^\1]', '') endfunction let s:ns_char = s:SimplifyToAssumeAllPrintable(s:ns_char) let s:ns_char_without_c_indicator = s:SimplifyToAssumeAllPrintable(s:ns_char_without_c_indicator) let s:c_ns_anchor_char = s:SimplifyToAssumeAllPrintable(s:c_ns_anchor_char) function s:SimplifyAdjacentCollections(p) return substitute(a:p, '\V\C'.s:_collection.'\\|'.s:_collection, '[\1\2]', 'g') endfunction let s:ns_uri_char = s:SimplifyAdjacentCollections(s:ns_uri_char) let s:ns_tag_char = s:SimplifyAdjacentCollections(s:ns_tag_char) let s:c_verbatim_tag = '!<'.s:ns_uri_char.'\+>' let s:c_named_tag_handle = '!'.s:ns_word_char.'\+!' let s:c_secondary_tag_handle = '!!' let s:c_primary_tag_handle = '!' let s:c_tag_handle = '\%('.s:c_named_tag_handle. \ '\|'.s:c_secondary_tag_handle. \ '\|'.s:c_primary_tag_handle.'\)' let s:c_ns_shorthand_tag = s:c_tag_handle . s:ns_tag_char.'\+' let s:c_non_specific_tag = '!' let s:c_ns_tag_property = s:c_verbatim_tag. \ '\|'.s:c_ns_shorthand_tag. \ '\|'.s:c_non_specific_tag let s:c_ns_anchor_name = s:c_ns_anchor_char.'\+' let s:c_ns_anchor_property = '&'.s:c_ns_anchor_name let s:c_ns_alias_node = '\*'.s:c_ns_anchor_name let s:ns_directive_name = s:ns_char.'\+' let s:ns_local_tag_prefix = '!'.s:ns_uri_char.'*' let s:ns_global_tag_prefix = s:ns_tag_char.s:ns_uri_char.'*' let s:ns_tag_prefix = s:ns_local_tag_prefix. \ '\|'.s:ns_global_tag_prefix let s:ns_plain_safe_out = s:ns_char let s:ns_plain_safe_in = '\%('.s:c_flow_indicator.'\@!'.s:ns_char.'\)' let s:ns_plain_safe_in = substitute(s:ns_plain_safe_in, '\V\C\\%('.s:_collection.'\\@!'.s:_neg_collection.'\\)', '[^\1\2]', '') let s:ns_plain_safe_in_without_colhash = substitute(s:ns_plain_safe_in, '\V\C'.s:_neg_collection, '[^\1:#]', '') let s:ns_plain_safe_out_without_colhash = substitute(s:ns_plain_safe_out, '\V\C'.s:_neg_collection, '[^\1:#]', '') let s:ns_plain_first_in = '\%('.s:ns_char_without_c_indicator.'\|[?:\-]\%('.s:ns_plain_safe_in.'\)\@=\)' let s:ns_plain_first_out = '\%('.s:ns_char_without_c_indicator.'\|[?:\-]\%('.s:ns_plain_safe_out.'\)\@=\)' let s:ns_plain_char_in = '\%('.s:ns_char.'#\|:'.s:ns_plain_safe_in.'\|'.s:ns_plain_safe_in_without_colhash.'\)' let s:ns_plain_char_out = '\%('.s:ns_char.'#\|:'.s:ns_plain_safe_out.'\|'.s:ns_plain_safe_out_without_colhash.'\)' let s:ns_plain_out = s:ns_plain_first_out . s:ns_plain_char_out.'*' let s:ns_plain_in = s:ns_plain_first_in . s:ns_plain_char_in.'*' syn keyword yamlTodo contained TODO FIXME XXX NOTE syn region yamlComment display oneline start='\%\(^\|\s\)#' end='$' \ contains=yamlTodo execute 'syn region yamlDirective oneline start='.string('^\ze%'.s:ns_directive_name.'\s\+').' '. \ 'end="$" '. \ 'contains=yamlTAGDirective,'. \ 'yamlYAMLDirective,'. \ 'yamlReservedDirective '. \ 'keepend' syn match yamlTAGDirective '%TAG\s\+' contained nextgroup=yamlTagHandle execute 'syn match yamlTagHandle contained nextgroup=yamlTagPrefix '.string(s:c_tag_handle.'\s\+') execute 'syn match yamlTagPrefix contained nextgroup=yamlComment ' . string(s:ns_tag_prefix) syn match yamlYAMLDirective '%YAML\s\+' contained nextgroup=yamlYAMLVersion syn match yamlYAMLVersion '\d\+\.\d\+' contained nextgroup=yamlComment execute 'syn match yamlReservedDirective contained nextgroup=yamlComment '. \string('%\%(\%(TAG\|YAML\)\s\)\@!'.s:ns_directive_name) syn region yamlFlowString matchgroup=yamlFlowStringDelimiter start='"' skip='\\"' end='"' \ contains=yamlEscape \ nextgroup=yamlKeyValueDelimiter syn region yamlFlowString matchgroup=yamlFlowStringDelimiter start="'" skip="''" end="'" \ contains=yamlSingleEscape \ nextgroup=yamlKeyValueDelimiter syn match yamlEscape contained '\\\%([\\"abefnrtv\^0_ NLP\n]\|x\x\x\|u\x\{4}\|U\x\{8}\)' syn match yamlSingleEscape contained "''" syn match yamlBlockScalarHeader contained '\s\+\zs[|>]\%([+-]\=[1-9]\|[1-9]\=[+-]\)\=' syn cluster yamlConstant contains=yamlBool,yamlNull syn cluster yamlFlow contains=yamlFlowString,yamlFlowMapping,yamlFlowCollection syn cluster yamlFlow add=yamlFlowMappingKey,yamlFlowMappingMerge syn cluster yamlFlow add=@yamlConstant,yamlPlainScalar,yamlFloat syn cluster yamlFlow add=yamlTimestamp,yamlInteger,yamlMappingKeyStart syn cluster yamlFlow add=yamlComment syn region yamlFlowMapping matchgroup=yamlFlowIndicator start='{' end='}' contains=@yamlFlow syn region yamlFlowCollection matchgroup=yamlFlowIndicator start='\[' end='\]' contains=@yamlFlow execute 'syn match yamlPlainScalar /'.s:ns_plain_out.'/' execute 'syn match yamlPlainScalar contained /'.s:ns_plain_in.'/' syn match yamlMappingKeyStart '?\ze\s' syn match yamlMappingKeyStart '?' contained execute 'syn match yamlFlowMappingKey /\%#=1'.s:ns_plain_in.'\%(\s\+'.s:ns_plain_in.'\)*\ze\s*:/ contained '. \'nextgroup=yamlKeyValueDelimiter' syn match yamlFlowMappingMerge /<<\ze\s*:/ contained nextgroup=yamlKeyValueDelimiter syn match yamlBlockCollectionItemStart '^\s*\zs-\%(\s\+-\)*\s' nextgroup=yamlBlockMappingKey,yamlBlockMappingMerge " Use the old regexp engine, the NFA engine doesn't like all the \@ items. execute 'syn match yamlBlockMappingKey /\%#=1^\s*\zs'.s:ns_plain_out.'\%(\s\+'.s:ns_plain_out.'\)*\ze\s*:\%(\s\|$\)/ '. \'nextgroup=yamlKeyValueDelimiter' execute 'syn match yamlBlockMappingKey /\%#=1\s*\zs'.s:ns_plain_out.'\%(\s\+'.s:ns_plain_out.'\)*\ze\s*:\%(\s\|$\)/ contained '. \'nextgroup=yamlKeyValueDelimiter' syn match yamlBlockMappingMerge /^\s*\zs<<\ze:\%(\s\|$\)/ nextgroup=yamlKeyValueDelimiter syn match yamlBlockMappingMerge /<<\ze\s*:\%(\s\|$\)/ nextgroup=yamlKeyValueDelimiter contained syn match yamlKeyValueDelimiter /\s*:/ contained syn match yamlKeyValueDelimiter /\s*:/ contained syn cluster yamlScalarWithSpecials contains=yamlPlainScalar,yamlBlockMappingKey,yamlFlowMappingKey let s:_bounder = s:SimplifyToAssumeAllPrintable('\%([[\]{}, \t]\@!\p\)') if b:yaml_schema is# 'json' syn keyword yamlNull null contained containedin=@yamlScalarWithSpecials syn keyword yamlBool true false exe 'syn match yamlInteger /'.s:_bounder.'\@1 " 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 "\" syn match z8aInstruction "\" syn match z8aInstruction "\" syn match z8aSpecInst "\"me=s+3 syn match z8aSpecInst "\"me=s+3 syn match z8aSpecInst "\"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 else command -nargs=+ HiLink hi def link 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 vim-7.4.1689/runtime/syntax/zimbu.vim000066400000000000000000000144561267703067000174630ustar00rootroot00000000000000" Vim syntax file " Language: Zimbu " Maintainer: Bram Moolenaar " Last Change: 2014 Nov 23 if exists("b:current_syntax") finish endif syn include @Ccode syntax/c.vim syn keyword zimbuTodo TODO FIXME XXX contained syn match zimbuNoBar "|" contained syn match zimbuParam "|[^| ]\+|" contained contains=zimbuNoBar syn match zimbuNoBacktick "`" contained syn match zimbuCode "`[^`]\+`" contained contains=zimbuNoBacktick syn match zimbuComment "#.*$" contains=zimbuTodo,zimbuParam,zimbuCode,@Spell syn match zimbuComment "/\*.\{-}\*/" contains=zimbuTodo,zimbuParam,zimbuCode,@Spell syn match zimbuChar "'\\\=.'" syn keyword zimbuBasicType bool status syn keyword zimbuBasicType int1 int2 int3 int4 int5 int6 int7 syn keyword zimbuBasicType int9 int10 int11 int12 int13 int14 int15 syn keyword zimbuBasicType int int8 int16 int32 int64 bigInt syn keyword zimbuBasicType nat nat8 byte nat16 nat32 nat64 bigNat syn keyword zimbuBasicType nat1 nat2 nat3 nat4 nat5 nat6 nat7 syn keyword zimbuBasicType nat9 nat10 nat11 nat12 nat13 nat14 nat15 syn keyword zimbuBasicType float float32 float64 float80 float128 syn keyword zimbuBasicType fixed1 fixed2 fixed3 fixed4 fixed5 fixed6 syn keyword zimbuBasicType fixed7 fixed8 fixed9 fixed10 fixed11 fixed12 syn keyword zimbuBasicType fixed13 fixed14 fixed15 syn keyword zimbuCompType string varString syn keyword zimbuCompType byteString varByteString syn keyword zimbuCompType tuple array list dict dictList set callback syn keyword zimbuCompType sortedList multiDict multiDictList multiSet syn keyword zimbuCompType complex complex32 complex64 complex80 complex128 syn keyword zimbuCompType proc func def thread evalThread lock cond pipe syn keyword zimbuType VAR dyn type USE GET syn match zimbuType "IO.File" syn match zimbuType "IO.Stat" syn keyword zimbuStatement IF ELSE ELSEIF IFNIL WHILE REPEAT FOR IN TO STEP syn keyword zimbuStatement DO UNTIL SWITCH WITH syn keyword zimbuStatement TRY CATCH FINALLY syn keyword zimbuStatement GENERATE_IF GENERATE_ELSE GENERATE_ELSEIF syn keyword zimbuStatement GENERATE_ERROR syn keyword zimbuStatement BUILD_IF BUILD_ELSE BUILD_ELSEIF syn keyword zimbuStatement CASE DEFAULT FINAL ABSTRACT VIRTUAL DEFINE REPLACE syn keyword zimbuStatement IMPLEMENTS EXTENDS PARENT LOCAL syn keyword zimbuStatement PART ALIAS TYPE CONNECT WRAP syn keyword zimbuStatement BREAK CONTINUE PROCEED syn keyword zimbuStatement RETURN EXIT THROW DEFER syn keyword zimbuStatement IMPORT AS OPTIONS MAIN syn keyword zimbuStatement INTERFACE PIECE INCLUDE MODULE ENUM BITS syn keyword zimbuStatement SHARED STATIC syn keyword zimbuStatement LAMBDA syn match zimbuStatement "\<\(FUNC\|PROC\|DEF\)\>" syn match zimbuStatement "\" syn match zimbuStatement "}" syn match zimbuAttribute "@backtrace=no\>" syn match zimbuAttribute "@backtrace=yes\>" syn match zimbuAttribute "@abstract\>" syn match zimbuAttribute "@earlyInit\>" syn match zimbuAttribute "@default\>" syn match zimbuAttribute "@define\>" syn match zimbuAttribute "@replace\>" syn match zimbuAttribute "@final\>" syn match zimbuAttribute "@primitive\>" syn match zimbuAttribute "@notOnExit\>" syn match zimbuAttribute "@private\>" syn match zimbuAttribute "@protected\>" syn match zimbuAttribute "@public\>" syn match zimbuAttribute "@local\>" syn match zimbuAttribute "@file\>" syn match zimbuAttribute "@directory\>" syn match zimbuAttribute "@read=private\>" syn match zimbuAttribute "@read=protected\>" syn match zimbuAttribute "@read=public\>" syn match zimbuAttribute "@read=file\>" syn match zimbuAttribute "@read=directory\>" syn match zimbuAttribute "@items=private\>" syn match zimbuAttribute "@items=protected\>" syn match zimbuAttribute "@items=public\>" syn match zimbuAttribute "@items=file\>" syn match zimbuAttribute "@items=directory\>" syn keyword zimbuMethod NEW EQUAL COPY COMPARE SIZE GET SET INIT EARLYINIT syn keyword zimbuOperator IS ISNOT ISA ISNOTA syn keyword zimbuModule ARG CHECK E GC IO LOG PROTO SYS HTTP ZC ZWT T TIME THREAD syn match zimbuImport "\.\zsPROTO" syn match zimbuImport "\.\zsCHEADER" "syn match zimbuString +"\([^"\\]\|\\.\)*\("\|$\)+ contains=zimbuStringExpr syn region zimbuString start=+"+ skip=+[^"\\]\|\\.+ end=+"\|$+ contains=zimbuStringExpr syn match zimbuString +R"\([^"]\|""\)*\("\|$\)+ syn region zimbuLongString start=+''"+ end=+"''+ syn match zimbuStringExpr +\\([^)]*)+hs=s+2,he=e-1 contained contains=zimbuString,zimbuParenPairOuter syn region zimbuParenPairOuter start=+(+ms=s+1 end=+)+me=e-1 contained contains=zimbuString,zimbuParenPair syn region zimbuParenPair start=+(+ end=+)+ contained contains=zimbuString,zimbuParenPair syn keyword zimbuFixed TRUE FALSE NIL THIS THISTYPE FAIL OK syn keyword zimbuError NULL " trailing whitespace syn match zimbuSpaceError display excludenl "\S\s\+$"ms=s+1 " mixed tabs and spaces syn match zimbuSpaceError display " \+\t" syn match zimbuSpaceError display "\t\+ " syn match zimbuUses contained "\ " Previous Maintainer: Nikolai Weibull " Latest Revision: 2016-02-15 " License: Vim (see :h license) " Repository: https://github.com/chrisbra/vim-zsh if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim if v:version > 704 || (v:version == 704 && has("patch1142")) syn iskeyword @,48-57,_,192-255,#,- else setlocal iskeyword+=- endif if get(g:, 'zsh_fold_enable', 0) setlocal foldmethod=syntax endif syn keyword zshTodo contained TODO FIXME XXX NOTE syn region zshComment oneline start='\%(^\|\s*\)#' end='$' \ contains=zshTodo,@Spell fold syn region zshComment start='^\s*#' end='^\%(\s*#\)\@!' \ contains=zshTodo,@Spell fold syn match zshPreProc '^\%1l#\%(!\|compdef\|autoload\).*$' syn match zshQuoted '\\.' syn region zshString matchgroup=zshStringDelimiter start=+"+ end=+"+ \ contains=zshQuoted,@zshDerefs,@zshSubst fold syn region zshString matchgroup=zshStringDelimiter start=+'+ end=+'+ fold " XXX: This should probably be more precise, but Zsh seems a bit confused about it itself syn region zshPOSIXString matchgroup=zshStringDelimiter start=+\$'+ \ end=+'+ contains=zshQuoted syn match zshJobSpec '%\(\d\+\|?\=\w\+\|[%+-]\)' syn keyword zshPrecommand noglob nocorrect exec command builtin - time syn keyword zshDelimiter do done end syn keyword zshConditional if then elif else fi case in esac select syn keyword zshRepeat while until repeat syn keyword zshRepeat for foreach nextgroup=zshVariable skipwhite syn keyword zshException always syn keyword zshKeyword function nextgroup=zshKSHFunction skipwhite syn match zshKSHFunction contained '\w\S\+' syn match zshFunction '^\s*\k\+\ze\s*()' syn match zshOperator '||\|&&\|;\|&!\=' syn match zshRedir '\d\=\(<\|<>\|<<<\|<&\s*[0-9p-]\=\)' syn match zshRedir '\d\=\(>\|>>\|>&\s*[0-9p-]\=\|&>\|>>&\|&>>\)[|!]\=' syn match zshRedir '|&\=' syn region zshHereDoc matchgroup=zshRedir \ start='<\@' \ contains=@zshSubst syn region zshHereDoc matchgroup=zshRedir \ start='<\@' \ contains=@zshSubst syn region zshHereDoc matchgroup=zshRedir \ start='<\@' \ contains=@zshSubst syn region zshHereDoc matchgroup=zshRedir \ start=+<\@' syn region zshHereDoc matchgroup=zshRedir \ start=+<\@' syn match zshVariable '\<\h\w*' contained syn match zshVariableDef '\<\h\w*\ze+\==' " XXX: how safe is this? syn region zshVariableDef oneline \ start='\$\@' endif if s:zsh_syntax_variables =~ 'long\|all' syn match zshLongDeref '\$\%(ARGC\|argv\|status\|pipestatus\|CPUTYPE\|EGID\|EUID\|ERRNO\|GID\|HOST\|LINENO\|LOGNAME\)' syn match zshLongDeref '\$\%(MACHTYPE\|OLDPWD OPTARG\|OPTIND\|OSTYPE\|PPID\|PWD\|RANDOM\|SECONDS\|SHLVL\|signals\)' syn match zshLongDeref '\$\%(TRY_BLOCK_ERROR\|TTY\|TTYIDLE\|UID\|USERNAME\|VENDOR\|ZSH_NAME\|ZSH_VERSION\|REPLY\|reply\|TERM\)' endif if s:zsh_syntax_variables =~ 'all' syn match zshDeref '\$[=^~]*[#+]*\h\w*\>' else syn match zshDeref transparent contains=NONE '\$[=^~]*[#+]*\h\w*\>' endif syn match zshCommands '\%(^\|\s\)[.:]\ze\s' syn keyword zshCommands alias autoload bg bindkey break bye cap cd \ chdir clone comparguments compcall compctl \ compdescribe compfiles compgroups compquote \ comptags comptry compvalues continue dirs \ disable disown echo echotc echoti emulate \ enable eval exec exit export false fc fg \ functions getcap getln getopts hash history \ jobs kill let limit log logout popd print \ printf pushd pushln pwd r read readonly \ rehash return sched set setcap setopt shift \ source stat suspend test times trap true \ ttyctl type ulimit umask unalias unfunction \ unhash unlimit unset unsetopt vared wait \ whence where which zcompile zformat zftp zle \ zmodload zparseopts zprof zpty zregexparse \ zsocket zstyle ztcp " Options, generated by: echo ${(j:\n:)options[(I)*]} | sort " Create a list of option names from zsh source dir: " #!/bin/zsh " topdir=/path/to/zsh-xxx " grep '^pindex([A-Za-z_]*)$' $topdir/Src/Doc/Zsh/optionsyo | " while read opt " do " echo ${${(L)opt#pindex\(}%\)} " done syn case ignore syn keyword zshOptions aliases allexport all_export alwayslastprompt \ always_last_prompt always_lastprompt alwaystoend always_to_end appendcreate \ append_create appendhistory append_history autocd auto_cd autocontinue \ auto_continue autolist auto_list \ automenu auto_menu autonamedirs auto_name_dirs \ autoparamkeys auto_param_keys autoparamslash \ auto_param_slash autopushd auto_pushd autoremoveslash \ auto_remove_slash autoresume auto_resume badpattern bad_pattern \ banghist bang_hist bareglobqual bare_glob_qual \ bashautolist bash_auto_list bashrematch bash_rematch \ beep bgnice bg_nice braceccl brace_ccl braceexpand brace_expand \ bsdecho bsd_echo caseglob case_glob casematch case_match \ cbases c_bases cdablevars cdable_vars cd_able_vars chasedots chase_dots \ chaselinks chase_links checkjobs check_jobs \ clobber combiningchars combining_chars completealiases \ complete_aliases completeinword complete_in_word \ continueonerror continue_on_error correct \ correctall correct_all cprecedences c_precedences \ cshjunkiehistory csh_junkie_history cshjunkieloops \ csh_junkie_loops cshjunkiequotes csh_junkie_quotes \ csh_nullcmd csh_null_cmd cshnullcmd csh_null_cmd cshnullglob csh_null_glob \ debugbeforecmd debug_before_cmd dotglob dot_glob dvorak \ emacs equals errexit err_exit errreturn err_return evallineno \ eval_lineno exec extendedglob extended_glob extendedhistory \ extended_history flowcontrol flow_control forcefloat \ force_float functionargzero function_argzero function_arg_zero glob globalexport \ global_export globalrcs global_rcs globassign glob_assign \ globcomplete glob_complete globdots glob_dots glob_subst \ globsubst globstarshort glob_star_short hashall hash_all hashcmds \ hash_cmds hashdirs hash_dirs hashexecutablesonly hash_executables_only \ hashlistall hash_list_all histallowclobber hist_allow_clobber histappend \ hist_append histbeep hist_beep hist_expand hist_expire_dups_first \ histexpand histexpiredupsfirst histfcntllock hist_fcntl_lock \ histfindnodups hist_find_no_dups histignorealldups \ hist_ignore_all_dups histignoredups hist_ignore_dups \ histignorespace hist_ignore_space histlexwords hist_lex_words \ histnofunctions hist_no_functions histnostore hist_no_store \ histreduceblanks hist_reduce_blanks histsavebycopy \ hist_save_by_copy histsavenodups hist_save_no_dups \ histsubstpattern hist_subst_pattern histverify hist_verify \ hup ignorebraces ignore_braces ignoreclosebraces ignore_close_braces \ ignoreeof ignore_eof incappendhistory inc_append_history \ incappendhistorytime inc_append_history_time interactive \ interactivecomments interactive_comments ksharrays ksh_arrays \ kshautoload ksh_autoload kshglob ksh_glob kshoptionprint \ ksh_option_print kshtypeset ksh_typeset kshzerosubscript \ ksh_zero_subscript listambiguous list_ambiguous listbeep \ list_beep listpacked list_packed listrowsfirst list_rows_first \ listtypes list_types localloops local_loops localoptions \ local_options localpatterns local_patterns localtraps \ local_traps log login longlistjobs long_list_jobs magicequalsubst \ magic_equal_subst mailwarn mail_warn mail_warning mark_dirs \ mailwarning markdirs menucomplete menu_complete monitor \ multibyte multi_byte multifuncdef multi_func_def multios \ multi_os nomatch no_match notify nullglob null_glob numericglobsort \ numeric_glob_sort octalzeroes octal_zeroes onecmd one_cmd \ overstrike over_strike pathdirs path_dirs pathscript \ path_script physical pipefail pipe_fail posixaliases \ posix_aliases posixargzero posix_arg_zero posix_argzero posixbuiltins \ posix_builtins posixcd posix_cd posixidentifiers posix_identifiers \ posixjobs posix_jobs posixstrings posix_strings posixtraps \ posix_traps printeightbit print_eight_bit printexitvalue \ print_exit_value privileged promptbang prompt_bang promptcr \ prompt_cr promptpercent prompt_percent promptsp prompt_sp \ promptsubst prompt_subst promptvars prompt_vars pushdignoredups \ pushd_ignore_dups pushdminus pushd_minus pushdsilent pushd_silent \ pushdtohome pushd_to_home rcexpandparam rc_expandparam rc_expand_param rcquotes \ rc_quotes rcs recexact rec_exact rematchpcre re_match_pcre rematch_pcre \ restricted rmstarsilent rm_star_silent rmstarwait rm_star_wait \ sharehistory share_history shfileexpansion sh_file_expansion \ shglob sh_glob shinstdin shin_stdin shnullcmd sh_nullcmd \ shoptionletters sh_option_letters shortloops short_loops shwordsplit \ sh_word_split singlecommand single_command singlelinezle single_line_zle \ sourcetrace source_trace stdin sunkeyboardhack sun_keyboard_hack \ trackall track_all transientrprompt transient_rprompt \ trapsasync traps_async typesetsilent type_set_silent typeset_silent unset verbose vi \ warncreateglobal warn_create_global xtrace zle syn keyword zshOptions noaliases no_aliases noallexport no_allexport noall_export no_all_export noalwayslastprompt no_alwayslastprompt \ noalways_lastprompt no_always_lastprompt no_always_last_prompt noalwaystoend no_alwaystoend noalways_to_end no_always_to_end \ noappendcreate no_appendcreate no_append_create noappendhistory no_appendhistory noappend_history no_append_history noautocd \ no_autocd no_auto_cd noautocontinue no_autocontinue noauto_continue no_auto_continue noautolist no_autolist noauto_list \ no_auto_list noautomenu no_automenu noauto_menu no_auto_menu noautonamedirs no_autonamedirs noauto_name_dirs \ no_auto_name_dirs noautoparamkeys no_autoparamkeys noauto_param_keys no_auto_param_keys noautoparamslash no_autoparamslash \ noauto_param_slash no_auto_param_slash noautopushd no_autopushd noauto_pushd no_auto_pushd noautoremoveslash no_autoremoveslash \ noauto_remove_slash no_auto_remove_slash noautoresume no_autoresume noauto_resume no_auto_resume nobadpattern no_badpattern no_bad_pattern \ nobanghist no_banghist nobang_hist no_bang_hist nobareglobqual no_bareglobqual nobare_glob_qual no_bare_glob_qual \ nobashautolist no_bashautolist nobash_auto_list no_bash_auto_list nobashrematch no_bashrematch nobash_rematch no_bash_rematch \ nobeep no_beep nobgnice no_bgnice no_bg_nice nobraceccl no_braceccl nobrace_ccl no_brace_ccl nobraceexpand no_braceexpand nobrace_expand no_brace_expand \ nobsdecho no_bsdecho nobsd_echo no_bsd_echo nocaseglob no_caseglob nocase_glob no_case_glob nocasematch no_casematch nocase_match no_case_match \ nocbases no_cbases no_c_bases nocdablevars no_cdablevars no_cdable_vars nocd_able_vars no_cd_able_vars nochasedots no_chasedots nochase_dots no_chase_dots \ nochaselinks no_chaselinks nochase_links no_chase_links nocheckjobs no_checkjobs nocheck_jobs no_check_jobs \ noclobber no_clobber nocombiningchars no_combiningchars nocombining_chars no_combining_chars nocompletealiases no_completealiases \ nocomplete_aliases no_complete_aliases nocompleteinword no_completeinword nocomplete_in_word no_complete_in_word \ nocontinueonerror no_continueonerror nocontinue_on_error no_continue_on_error nocorrect no_correct \ nocorrectall no_correctall nocorrect_all no_correct_all nocprecedences no_cprecedences noc_precedences no_c_precedences \ nocshjunkiehistory no_cshjunkiehistory nocsh_junkie_history no_csh_junkie_history nocshjunkieloops no_cshjunkieloops \ nocsh_junkie_loops no_csh_junkie_loops nocshjunkiequotes no_cshjunkiequotes nocsh_junkie_quotes no_csh_junkie_quotes \ nocshnullcmd no_cshnullcmd no_csh_nullcmd nocsh_null_cmd no_csh_null_cmd nocshnullglob no_cshnullglob nocsh_null_glob no_csh_null_glob \ nodebugbeforecmd no_debugbeforecmd nodebug_before_cmd no_debug_before_cmd nodotglob no_dotglob nodot_glob no_dot_glob nodvorak no_dvorak \ noemacs no_emacs noequals no_equals noerrexit no_errexit noerr_exit no_err_exit noerrreturn no_errreturn noerr_return no_err_return noevallineno no_evallineno \ noeval_lineno no_eval_lineno noexec no_exec noextendedglob no_extendedglob noextended_glob no_extended_glob noextendedhistory no_extendedhistory \ noextended_history no_extended_history noflowcontrol no_flowcontrol noflow_control no_flow_control noforcefloat no_forcefloat \ noforce_float no_force_float nofunctionargzero no_functionargzero nofunction_arg_zero no_function_argzero no_function_arg_zero noglob no_glob noglobalexport no_globalexport \ noglobal_export no_global_export noglobalrcs no_globalrcs noglobal_rcs no_global_rcs noglobassign no_globassign noglob_assign no_glob_assign \ noglobcomplete no_globcomplete noglob_complete no_glob_complete noglobdots no_globdots noglob_dots no_glob_dots \ noglobstarshort no_glob_star_short noglob_subst no_glob_subst \ noglobsubst no_globsubst nohashall no_hashall nohash_all no_hash_all nohashcmds no_hashcmds nohash_cmds no_hash_cmds nohashdirs no_hashdirs \ nohash_dirs no_hash_dirs nohashexecutablesonly no_hashexecutablesonly nohash_executables_only no_hash_executables_only nohashlistall no_hashlistall \ nohash_list_all no_hash_list_all nohistallowclobber no_histallowclobber nohist_allow_clobber no_hist_allow_clobber nohistappend no_histappend \ nohist_append no_hist_append nohistbeep no_histbeep nohist_beep no_hist_beep nohist_expand no_hist_expand nohist_expire_dups_first no_hist_expire_dups_first \ nohistexpand no_histexpand nohistexpiredupsfirst no_histexpiredupsfirst nohistfcntllock no_histfcntllock nohist_fcntl_lock no_hist_fcntl_lock \ nohistfindnodups no_histfindnodups nohist_find_no_dups no_hist_find_no_dups nohistignorealldups no_histignorealldups \ nohist_ignore_all_dups no_hist_ignore_all_dups nohistignoredups no_histignoredups nohist_ignore_dups no_hist_ignore_dups \ nohistignorespace no_histignorespace nohist_ignore_space no_hist_ignore_space nohistlexwords no_histlexwords nohist_lex_words no_hist_lex_words \ nohistnofunctions no_histnofunctions nohist_no_functions no_hist_no_functions nohistnostore no_histnostore nohist_no_store no_hist_no_store \ nohistreduceblanks no_histreduceblanks nohist_reduce_blanks no_hist_reduce_blanks nohistsavebycopy no_histsavebycopy \ nohist_save_by_copy no_hist_save_by_copy nohistsavenodups no_histsavenodups nohist_save_no_dups no_hist_save_no_dups \ nohistsubstpattern no_histsubstpattern nohist_subst_pattern no_hist_subst_pattern nohistverify no_histverify nohist_verify no_hist_verify \ nohup no_hup noignorebraces no_ignorebraces noignore_braces no_ignore_braces noignoreclosebraces no_ignoreclosebraces noignore_close_braces no_ignore_close_braces \ noignoreeof no_ignoreeof noignore_eof no_ignore_eof noincappendhistory no_incappendhistory noinc_append_history no_inc_append_history \ noincappendhistorytime no_incappendhistorytime noinc_append_history_time no_inc_append_history_time nointeractive no_interactive \ nointeractivecomments no_interactivecomments nointeractive_comments no_interactive_comments noksharrays no_ksharrays noksh_arrays no_ksh_arrays \ nokshautoload no_kshautoload noksh_autoload no_ksh_autoload nokshglob no_kshglob noksh_glob no_ksh_glob nokshoptionprint no_kshoptionprint \ noksh_option_print no_ksh_option_print nokshtypeset no_kshtypeset noksh_typeset no_ksh_typeset nokshzerosubscript no_kshzerosubscript \ noksh_zero_subscript no_ksh_zero_subscript nolistambiguous no_listambiguous nolist_ambiguous no_list_ambiguous nolistbeep no_listbeep \ nolist_beep no_list_beep nolistpacked no_listpacked nolist_packed no_list_packed nolistrowsfirst no_listrowsfirst nolist_rows_first no_list_rows_first \ nolisttypes no_listtypes nolist_types no_list_types nolocalloops no_localloops nolocal_loops no_local_loops nolocaloptions no_localoptions \ nolocal_options no_local_options nolocalpatterns no_localpatterns nolocal_patterns no_local_patterns nolocaltraps no_localtraps \ nolocal_traps no_local_traps nolog no_log nologin no_login nolonglistjobs no_longlistjobs nolong_list_jobs no_long_list_jobs nomagicequalsubst no_magicequalsubst \ nomagic_equal_subst no_magic_equal_subst nomailwarn no_mailwarn nomail_warn no_mail_warn nomail_warning no_mail_warning nomark_dirs no_mark_dirs \ nomailwarning no_mailwarning nomarkdirs no_markdirs nomenucomplete no_menucomplete nomenu_complete no_menu_complete nomonitor no_monitor \ nomultibyte no_multibyte nomulti_byte no_multi_byte nomultifuncdef no_multifuncdef nomulti_func_def no_multi_func_def nomultios no_multios \ nomulti_os no_multi_os nonomatch no_nomatch nono_match no_no_match nonotify no_notify nonullglob no_nullglob nonull_glob no_null_glob nonumericglobsort no_numericglobsort \ nonumeric_glob_sort no_numeric_glob_sort nooctalzeroes no_octalzeroes nooctal_zeroes no_octal_zeroes noonecmd no_onecmd noone_cmd no_one_cmd \ nooverstrike no_overstrike noover_strike no_over_strike nopathdirs no_pathdirs nopath_dirs no_path_dirs nopathscript no_pathscript \ nopath_script no_path_script nophysical no_physical nopipefail no_pipefail nopipe_fail no_pipe_fail noposixaliases no_posixaliases \ noposix_aliases no_posix_aliases noposixargzero no_posixargzero no_posix_argzero noposix_arg_zero no_posix_arg_zero noposixbuiltins no_posixbuiltins \ noposix_builtins no_posix_builtins noposixcd no_posixcd noposix_cd no_posix_cd noposixidentifiers no_posixidentifiers noposix_identifiers no_posix_identifiers \ noposixjobs no_posixjobs noposix_jobs no_posix_jobs noposixstrings no_posixstrings noposix_strings no_posix_strings noposixtraps no_posixtraps \ noposix_traps no_posix_traps noprinteightbit no_printeightbit noprint_eight_bit no_print_eight_bit noprintexitvalue no_printexitvalue \ noprint_exit_value no_print_exit_value noprivileged no_privileged nopromptbang no_promptbang noprompt_bang no_prompt_bang nopromptcr no_promptcr \ noprompt_cr no_prompt_cr nopromptpercent no_promptpercent noprompt_percent no_prompt_percent nopromptsp no_promptsp noprompt_sp no_prompt_sp \ nopromptsubst no_promptsubst noprompt_subst no_prompt_subst nopromptvars no_promptvars noprompt_vars no_prompt_vars nopushdignoredups no_pushdignoredups \ nopushd_ignore_dups no_pushd_ignore_dups nopushdminus no_pushdminus nopushd_minus no_pushd_minus nopushdsilent no_pushdsilent nopushd_silent no_pushd_silent \ nopushdtohome no_pushdtohome nopushd_to_home no_pushd_to_home norcexpandparam no_rcexpandparam norc_expandparam no_rc_expandparam no_rc_expand_param norcquotes no_rcquotes \ norc_quotes no_rc_quotes norcs no_rcs norecexact no_recexact norec_exact no_rec_exact norematchpcre no_rematchpcre nore_match_pcre no_re_match_pcre no_rematch_pcre \ norestricted no_restricted normstarsilent no_rmstarsilent norm_star_silent no_rm_star_silent normstarwait no_rmstarwait norm_star_wait no_rm_star_wait \ nosharehistory no_sharehistory noshare_history no_share_history noshfileexpansion no_shfileexpansion nosh_file_expansion no_sh_file_expansion \ noshglob no_shglob nosh_glob no_sh_glob noshinstdin no_shinstdin noshin_stdin no_shin_stdin noshnullcmd no_shnullcmd nosh_nullcmd no_sh_nullcmd \ noshoptionletters no_shoptionletters nosh_option_letters no_sh_option_letters noshortloops no_shortloops noshort_loops no_short_loops noshwordsplit no_shwordsplit \ nosh_word_split no_sh_word_split nosinglecommand no_singlecommand nosingle_command no_single_command nosinglelinezle no_singlelinezle nosingle_line_zle no_single_line_zle \ nosourcetrace no_sourcetrace nosource_trace no_source_trace nostdin no_stdin nosunkeyboardhack no_sunkeyboardhack nosun_keyboard_hack no_sun_keyboard_hack \ notrackall no_trackall notrack_all no_track_all notransientrprompt no_transientrprompt notransient_rprompt no_transient_rprompt \ notrapsasync no_trapsasync notrapasync no_trapasync no_traps_async notypesetsilent no_typesetsilent notype_set_silent no_type_set_silent no_typeset_silent \nounset no_unset \ noverbose no_verbose novi no_vi nowarncreateglobal no_warncreateglobal nowarn_create_global no_warn_create_global noxtrace no_xtrace nozle no_zle syn case match syn keyword zshTypes float integer local typeset declare private " XXX: this may be too much " syn match zshSwitches '\s\zs--\=[a-zA-Z0-9-]\+' syn match zshNumber '[+-]\=\<\d\+\>' syn match zshNumber '[+-]\=\<0x\x\+\>' syn match zshNumber '[+-]\=\<0\o\+\>' syn match zshNumber '[+-]\=\d\+#[-+]\=\w\+\>' syn match zshNumber '[+-]\=\d\+\.\d\+\>' " TODO: $[...] is the same as $((...)), so add that as well. syn cluster zshSubst contains=zshSubst,zshOldSubst,zshMathSubst syn region zshSubst matchgroup=zshSubstDelim transparent \ start='\$(' skip='\\)' end=')' contains=TOP fold syn region zshParentheses transparent start='(' skip='\\)' end=')' fold syn region zshMathSubst matchgroup=zshSubstDelim transparent \ start='\$((' skip='\\)' \ matchgroup=zshSubstDelim end='))' \ contains=zshParentheses,@zshSubst,zshNumber, \ @zshDerefs,zshString keepend fold syn region zshBrackets contained transparent start='{' skip='\\}' \ end='}' fold syn region zshBrackets transparent start='{' skip='\\}' \ end='}' contains=TOP fold syn region zshSubst matchgroup=zshSubstDelim start='\${' skip='\\}' \ end='}' contains=@zshSubst,zshBrackets,zshQuoted,zshString fold syn region zshOldSubst matchgroup=zshSubstDelim start=+`+ skip=+\\`+ \ end=+`+ contains=TOP,zshOldSubst fold syn sync minlines=50 maxlines=90 syn sync match zshHereDocSync grouphere NONE '<<-\=\s*\%(\\\=\S\+\|\(["']\)\S\+\1\)' syn sync match zshHereDocEndSync groupthere NONE '^\s*EO\a\+\>' hi def link zshTodo Todo hi def link zshComment Comment hi def link zshPreProc PreProc hi def link zshQuoted SpecialChar hi def link zshString String hi def link zshStringDelimiter zshString hi def link zshPOSIXString zshString hi def link zshJobSpec Special hi def link zshPrecommand Special hi def link zshDelimiter Keyword hi def link zshConditional Conditional hi def link zshException Exception hi def link zshRepeat Repeat hi def link zshKeyword Keyword hi def link zshFunction None hi def link zshKSHFunction zshFunction hi def link zshHereDoc String hi def link zshOperator None hi def link zshRedir Operator hi def link zshVariable None hi def link zshVariableDef zshVariable hi def link zshDereferencing PreProc if s:zsh_syntax_variables =~ 'short\|all' hi def link zshShortDeref zshDereferencing else hi def link zshShortDeref None endif if s:zsh_syntax_variables =~ 'long\|all' hi def link zshLongDeref zshDereferencing else hi def link zshLongDeref None endif if s:zsh_syntax_variables =~ 'all' hi def link zshDeref zshDereferencing else hi def link zshDeref None endif hi def link zshCommands Keyword hi def link zshOptions Constant hi def link zshTypes Type hi def link zshSwitches Special hi def link zshNumber Number hi def link zshSubst PreProc hi def link zshMathSubst zshSubst hi def link zshOldSubst zshSubst hi def link zshSubstDelim zshSubst let b:current_syntax = "zsh" let &cpo = s:cpo_save unlet s:cpo_save vim-7.4.1689/runtime/termcap000066400000000000000000000077051267703067000156470ustar00rootroot00000000000000# # Demonstration of a termcap file (for the Amiga and Archimedes) # # Maintainer: Bram Moolenaar # 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 # vim-7.4.1689/runtime/tools.info000077500000000000000000000011601267703067000162760ustar00rootroot00000000000000B 'z'z dj! 'xKI)"#ی\?B @?<<<<<<=?/UWB @??Ovim-7.4.1689/runtime/tools/000077500000000000000000000000001267703067000154205ustar00rootroot00000000000000vim-7.4.1689/runtime/tools/README.txt000066400000000000000000000022101267703067000171110ustar00rootroot00000000000000Some 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. 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. unicode.vim Vim script to generate tables for src/mbyte.c. [xxd (and tee for OS/2) can be found in the src directory] vim-7.4.1689/runtime/tools/blink.c000066400000000000000000000007401267703067000166640ustar00rootroot00000000000000/* * 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 int main() { while (1) { printf("\e[?25h"); fflush(stdout); usleep(400000); /* on time */ printf("\e[?25l"); fflush(stdout); usleep(250000); /* off time */ } return 0; } vim-7.4.1689/runtime/tools/ccfilter.1000066400000000000000000000042641267703067000173030ustar00rootroot00000000000000.TH ccfilter 1 "01-Apr-97" .SH NAME ccfilter \- a compiler's output filter for vim quickfix .SH SYNOPSIS ccfilter [ .B ] .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 Treat input as '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 vim-7.4.1689/runtime/tools/ccfilter.c000066400000000000000000000206421267703067000173630ustar00rootroot00000000000000/* ======================================================================= */ /* 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 #include #include #include #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 []\n" "Where: 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 Treat input as '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 : %s\n", COMPILER_Names[COMPILER_DEFAULT][0] ); fprintf( stderr, "Acceptable parameters for 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) return ShowUsage("Error: Missing parameter for -o\n"); i++; COMPILER = -1; for (j=1; j <> 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[]: Entering directory `'^ are used to follow the directory changes during the make process, providing in the part, a relative (if possible) directory path to the erroneous file. 1) GCC: Recognized lines are of the format: - ^In file included from ::^ Line following this one is used as is always 'e' (error) is always '0' - ^::^ is always 'e' (error) is always '0' 2) AIX: Recognized lines are of the format: - ^"", line .: <> () ", 3) HPUX: Recognized lines are of the format: - ^cc: "", line : : ^ is always '0' 4) SOLARIS: Recognized lines are of the format: - ^"", line : warning: ^ This assumes is "W" is always '0' - ^"", line : ^ This assumes is "E" is always '0' 5) ATT / NCR: Recognized lines are of the format: - ^ "",L/C<>:^ or - ^ "",L/C:^ Following lines beginning with a pipe (|) are continuation lines, and are therefore appended to the - ^ "",L:^ is '0' Following lines beginning with a pipe (|) are continuation lines, and are therefore appended to the 6) SGI-IRIX: Recognized lines are of the format: - ^cfe: : : : ^ or ^cfe: : , line : ^ 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 . vim-7.4.1689/runtime/tools/demoserver.py000066400000000000000000000060421267703067000201470ustar00rootroot00000000000000#!/usr/bin/python # # Server that will accept connections from a Vim channel. # Run this server and then in Vim you can open the channel: # :let handle = ch_open('localhost:8765') # # Then Vim can send requests to the server: # :let response = ch_sendexpr(handle, 'hello!') # # And you can control Vim by typing a JSON message here, e.g.: # ["ex","echo 'hi there'"] # # There is no prompt, just type a line and press Enter. # To exit cleanly type "quit". # # See ":help channel-demo" in Vim. # # This requires Python 2.6 or later. from __future__ import print_function import json import socket import sys import threading try: # Python 3 import socketserver except ImportError: # Python 2 import SocketServer as socketserver thesocket = None class ThreadedTCPRequestHandler(socketserver.BaseRequestHandler): def handle(self): print("=== socket opened ===") global thesocket thesocket = self.request while True: try: data = self.request.recv(4096).decode('utf-8') except socket.error: print("=== socket error ===") break except IOError: print("=== socket closed ===") break if data == '': print("=== socket closed ===") break print("received: {0}".format(data)) try: decoded = json.loads(data) except ValueError: print("json decoding failed") decoded = [-1, ''] # Send a response if the sequence number is positive. # Negative numbers are used for "eval" responses. if decoded[0] >= 0: if decoded[1] == 'hello!': response = "got it" else: response = "what?" encoded = json.dumps([decoded[0], response]) print("sending {0}".format(encoded)) self.request.sendall(encoded.encode('utf-8')) thesocket = None class ThreadedTCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer): pass if __name__ == "__main__": HOST, PORT = "localhost", 8765 server = ThreadedTCPServer((HOST, PORT), ThreadedTCPRequestHandler) ip, port = server.server_address # Start a thread with the server -- that thread will then start one # more thread for each request server_thread = threading.Thread(target=server.serve_forever) # Exit the server thread when the main thread terminates server_thread.daemon = True server_thread.start() print("Server loop running in thread: ", server_thread.name) print("Listening on port {0}".format(PORT)) while True: typed = sys.stdin.readline() if "quit" in typed: print("Goodbye!") break if thesocket is None: print("No socket yet") else: print("sending {0}".format(typed)) thesocket.sendall(typed.encode('utf-8')) server.shutdown() server.server_close() vim-7.4.1689/runtime/tools/efm_filter.pl000077500000000000000000000017221267703067000200760ustar00rootroot00000000000000#!/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 \n"); } $filename = @ARGV[0]; open (OUT, ">$filename") || die ("Can't open file: \"$filename\""); while () { print; if ( (/"(.*)", line (\d+): (e)rror\((\d+)\):/) || (/"(.*)", line (\d+): (w)arning\((\d+)\):/) ) { $file=$1; $line=$2; $errortype="\u$3"; $errornr=$4; chop($errormsg=); $errormsg =~ s/^\s*//; $sourceline=; $column=index(, "^") - 1; print OUT "$file>$line:$column:$errortype:$errornr:$errormsg\n"; } } close(OUT); exit(0); vim-7.4.1689/runtime/tools/efm_filter.txt000066400000000000000000000021341267703067000202750ustar00rootroot00000000000000[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 vim-7.4.1689/runtime/tools/efm_perl.pl000077500000000000000000000072311267703067000175540ustar00rootroot00000000000000#!/usr/bin/perl -w # vimparse.pl - Reformats the error messages of the Perl interpreter for use # with the quickfix mode of Vim # # Copyright (c) 2001 by Joerg Ziefle # 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 ] [programargs] # # -c compile only, don't run (perl -wc) # -f write errors to # # 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<] [programargs] -c compile only, don't run (executes 'perl -wc') -f write errors to 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; }; vim-7.4.1689/runtime/tools/mve.awk000077500000000000000000000007441267703067000167230ustar00rootroot00000000000000#!/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) } vim-7.4.1689/runtime/tools/mve.txt000066400000000000000000000011031267703067000167430ustar00rootroot00000000000000[ 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. vim-7.4.1689/runtime/tools/pltags.pl000077500000000000000000000203511267703067000172530ustar00rootroot00000000000000#!/usr/bin/env perl # pltags - create a tags file for Perl code, for use by vi(m) # # Distributed with Vim , latest version always available # at # # Version 2.3, 28 February 2002 # # Written by Michael Schaap . 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 \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 () { # 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"; } vim-7.4.1689/runtime/tools/ref000077500000000000000000000002111267703067000161140ustar00rootroot00000000000000#!/bin/sh # # ref - Check spelling of the arguments # # Usage: ref word .. # # can be used for the K command of Vim # spell <\fP] [\fI-s \fP] .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 \fP" Name of tags file to create. (default is 'tags') .IP "\fB-s \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). vim-7.4.1689/runtime/tools/shtags.pl000077500000000000000000000064171267703067000172610ustar00rootroot00000000000000#!/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 ] -t Name of tags file to create. (default is 'tags') -s 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. 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( ) { /^\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"; } } vim-7.4.1689/runtime/tools/unicode.vim000066400000000000000000000250311267703067000175640ustar00rootroot00000000000000" Script to extract tables from Unicode .txt files, to be used in src/mbyte.c. " The format of the UnicodeData.txt file is explained here: " http://www.unicode.org/Public/5.1.0/ucd/UCD.html " For the other files see the header. " " Usage: Vim -S " " Author: Bram Moolenaar " Last Update: 2010 Jan 12 " Parse lines of UnicodeData.txt. Creates a list of lists in s:dataprops. func! ParseDataToProps() let s:dataprops = [] let lnum = 1 while lnum <= line('$') let l = split(getline(lnum), '\s*;\s*', 1) if len(l) != 15 echoerr 'Found ' . len(l) . ' items in line ' . lnum . ', expected 15' return endif call add(s:dataprops, l) let lnum += 1 endwhile endfunc " Parse lines of CaseFolding.txt. Creates a list of lists in s:foldprops. func! ParseFoldProps() let s:foldprops = [] let lnum = 1 while lnum <= line('$') let line = getline(lnum) if line !~ '^#' && line !~ '^\s*$' let l = split(line, '\s*;\s*', 1) if len(l) != 4 echoerr 'Found ' . len(l) . ' items in line ' . lnum . ', expected 4' return endif call add(s:foldprops, l) endif let lnum += 1 endwhile endfunc " Parse lines of EastAsianWidth.txt. Creates a list of lists in s:widthprops. func! ParseWidthProps() let s:widthprops = [] let lnum = 1 while lnum <= line('$') let line = getline(lnum) if line !~ '^#' && line !~ '^\s*$' let l = split(line, '\s*;\s*', 1) if len(l) != 2 echoerr 'Found ' . len(l) . ' items in line ' . lnum . ', expected 2' return endif call add(s:widthprops, l) endif let lnum += 1 endwhile endfunc " Build the toLower or toUpper table in a new buffer. " Uses s:dataprops. func! BuildCaseTable(name, index) let start = -1 let end = -1 let step = 0 let add = -1 let ranges = [] for p in s:dataprops if p[a:index] != '' let n = ('0x' . p[0]) + 0 let nl = ('0x' . p[a:index]) + 0 if start >= 0 && add == nl - n && (step == 0 || n - end == step) " continue with same range. let step = n - end let end = n else if start >= 0 " produce previous range call Range(ranges, start, end, step, add) endif let start = n let end = n let step = 0 let add = nl - n endif endif endfor if start >= 0 call Range(ranges, start, end, step, add) endif " New buffer to put the result in. new exe "file to" . a:name call setline(1, "static convertStruct to" . a:name . "[] =") call setline(2, "{") call append('$', ranges) call setline('$', getline('$')[:-2]) " remove last comma call setline(line('$') + 1, "};") wincmd p endfunc " Build the foldCase table in a new buffer. " Uses s:foldprops. func! BuildFoldTable() let start = -1 let end = -1 let step = 0 let add = -1 let ranges = [] for p in s:foldprops if p[1] == 'C' || p[1] == 'S' let n = ('0x' . p[0]) + 0 let nl = ('0x' . p[2]) + 0 if start >= 0 && add == nl - n && (step == 0 || n - end == step) " continue with same range. let step = n - end let end = n else if start >= 0 " produce previous range call Range(ranges, start, end, step, add) endif let start = n let end = n let step = 0 let add = nl - n endif endif endfor if start >= 0 call Range(ranges, start, end, step, add) endif " New buffer to put the result in. new file foldCase call setline(1, "static convertStruct foldCase[] =") call setline(2, "{") call append('$', ranges) call setline('$', getline('$')[:-2]) " remove last comma call setline(line('$') + 1, "};") wincmd p endfunc func! Range(ranges, start, end, step, add) let s = printf("\t{0x%x,0x%x,%d,%d},", a:start, a:end, a:step == 0 ? -1 : a:step, a:add) call add(a:ranges, s) endfunc " Build the combining table. " Uses s:dataprops. func! BuildCombiningTable() let start = -1 let end = -1 let ranges = [] for p in s:dataprops if p[2] == 'Mn' || p[2] == 'Mc' || p[2] == 'Me' let n = ('0x' . p[0]) + 0 if start >= 0 && end + 1 == n " continue with same range. let end = n else if start >= 0 " produce previous range call add(ranges, printf("\t{0x%04x, 0x%04x},", start, end)) endif let start = n let end = n endif endif endfor if start >= 0 call add(ranges, printf("\t{0x%04x, 0x%04x},", start, end)) endif " New buffer to put the result in. new file combining call setline(1, " static struct interval combining[] =") call setline(2, " {") call append('$', ranges) call setline('$', getline('$')[:-2]) " remove last comma call setline(line('$') + 1, " };") wincmd p endfunc " Build the double width or ambiguous width table in a new buffer. " Uses s:widthprops and s:dataprops. func! BuildWidthTable(pattern, tableName) let start = -1 let end = -1 let ranges = [] let dataidx = 0 for p in s:widthprops if p[1][0] =~ a:pattern if p[0] =~ '\.\.' " It is a range. we don't check for composing char then. let rng = split(p[0], '\.\.') if len(rng) != 2 echoerr "Cannot parse range: '" . p[0] . "' in width table" endif let n = ('0x' . rng[0]) + 0 let n_last = ('0x' . rng[1]) + 0 else let n = ('0x' . p[0]) + 0 let n_last = n endif " Find this char in the data table. while 1 let dn = ('0x' . s:dataprops[dataidx][0]) + 0 if dn >= n break endif let dataidx += 1 endwhile if dn != n && n_last == n echoerr "Cannot find character " . n . " in data table" endif " Only use the char when it's not a composing char. " But use all chars from a range. let dp = s:dataprops[dataidx] if n_last > n || (dp[2] != 'Mn' && dp[2] != 'Mc' && dp[2] != 'Me') if start >= 0 && end + 1 == n " continue with same range. else if start >= 0 " produce previous range call add(ranges, printf("\t{0x%04x, 0x%04x},", start, end)) if a:pattern == 'A' call add(s:ambitable, [start, end]) else call add(s:doubletable, [start, end]) endif endif let start = n endif let end = n_last endif endif endfor if start >= 0 call add(ranges, printf("\t{0x%04x, 0x%04x},", start, end)) if a:pattern == 'A' call add(s:ambitable, [start, end]) else call add(s:doubletable, [start, end]) endif endif " New buffer to put the result in. new exe "file " . a:tableName call setline(1, " static struct interval " . a:tableName . "[] =") call setline(2, " {") call append('$', ranges) call setline('$', getline('$')[:-2]) " remove last comma call setline(line('$') + 1, " };") wincmd p endfunc " Build the amoji width table in a new buffer. func! BuildEmojiTable(pattern, tableName) let alltokens = [] let widthtokens = [] let lines = map(filter(filter(getline(1, '$'), 'v:val=~"^[1-9]"'), 'v:val=~a:pattern'), 'matchstr(v:val,"^\\S\\+")') for n in range(len(lines)) let line = lines[n] let token = split(line, '\.\.') let first = ('0x' . token[0]) + 0 if len(token) == 1 let last = first else let last = ('0x' . token[1]) + 0 endif let token = [first, last] if len(alltokens) > 0 && (token[0] - 1 == alltokens[-1][1]) let alltokens[-1][1] = token[1] else call add(alltokens, token) endif " Characters below 1F000 may be considered single width traditionally, " making them double width causes problems. if first < 0x1f000 continue endif " exclude characters that are in the "ambiguous" or "doublewidth" table for ambi in s:ambitable if first >= ambi[0] && first <= ambi[1] let first = ambi[1] + 1 endif if last >= ambi[0] && last <= ambi[1] let last = ambi[0] - 1 endif endfor for double in s:doubletable if first >= double[0] && first <= double[1] let first = double[1] + 1 endif if last >= double[0] && last <= double[1] let last = double[0] - 1 endif endfor if first <= last let token = [first, last] if len(widthtokens) > 0 && (token[0] - 1 == widthtokens[-1][1]) let widthtokens[-1][1] = token[1] else call add(widthtokens, token) endif endif endfor let allranges = map(alltokens, 'printf("\t{0x%04x, 0x%04x},", v:val[0], v:val[1])') let widthranges = map(widthtokens, 'printf("\t{0x%04x, 0x%04x},", v:val[0], v:val[1])') " New buffer to put the result in. new exe "file " . a:tableName . '_all' call setline(1, " static struct interval " . a:tableName . "_all[] =") call setline(2, " {") call append('$', allranges) call setline('$', getline('$')[:-2]) " remove last comma call setline(line('$') + 1, " };") wincmd p " New buffer to put the result in. new exe "file " . a:tableName . '_width' call setline(1, " static struct interval " . a:tableName . "_width[] =") call setline(2, " {") call append('$', widthranges) call setline('$', getline('$')[:-2]) " remove last comma call setline(line('$') + 1, " };") wincmd p endfunc " Try to avoid hitting E36 set equalalways " Edit the Unicode text file. Requires the netrw plugin. edit http://unicode.org/Public/UNIDATA/UnicodeData.txt " Parse each line, create a list of lists. call ParseDataToProps() " Build the toLower table. call BuildCaseTable("Lower", 13) " Build the toUpper table. call BuildCaseTable("Upper", 12) " Build the ranges of composing chars. call BuildCombiningTable() " Edit the case folding text file. Requires the netrw plugin. edit http://www.unicode.org/Public/UNIDATA/CaseFolding.txt " Parse each line, create a list of lists. call ParseFoldProps() " Build the foldCase table. call BuildFoldTable() " Edit the width text file. Requires the netrw plugin. edit http://www.unicode.org/Public/UNIDATA/EastAsianWidth.txt " Parse each line, create a list of lists. call ParseWidthProps() " Build the double width table. let s:doubletable = [] call BuildWidthTable('[WF]', 'doublewidth') " Build the ambiguous width table. let s:ambitable = [] call BuildWidthTable('A', 'ambiguous') " Edit the emoji text file. Requires the netrw plugin. edit http://www.unicode.org/Public/emoji/3.0/emoji-data.txt " Build the emoji table. Ver. 1.0 - 6.0 " Must come after the "ambiguous" table call BuildEmojiTable('; Emoji\s\+# [1-6]\.[0-9]', 'emoji') vim-7.4.1689/runtime/tools/vim132000077500000000000000000000004731267703067000163730ustar00rootroot00000000000000#!/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" vim-7.4.1689/runtime/tools/vim_vs_net.cmd000066400000000000000000000014361267703067000202620ustar00rootroot00000000000000@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 Courtesy 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 more 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" vim-7.4.1689/runtime/tools/vimm000077500000000000000000000002741267703067000163210ustar00rootroot00000000000000#!/bin/sh # enable DEC locator input model on remote terminal printf "\033[1;2'z\033[1;3'{\c" vim "$@" # disable DEC locator input model on remote terminal printf "\033[2;4'{\033[0'z\c" vim-7.4.1689/runtime/tools/vimspell.sh000077500000000000000000000026661267703067000176240ustar00rootroot00000000000000#!/bin/sh # # Spell a file & generate the syntax statements necessary to # highlight in vim. Based on a program from Krishna Gadepalli # . # # I use the following mappings (in .vimrc): # # noremap :so `vimspell.sh %` # noremap :syntax clear SpellErrors # # Neil Schemenauer # March 1999 # updated 2008 Jul 17 by Bram # # Safe method for the temp file by Javier Fernndez-Sanguino_Pea INFILE=$1 tmp="${TMPDIR-/tmp}" OUTFILE=`mktemp -t vimspellXXXXXX || tempfile -p vimspell || echo none` # If the standard commands failed then create the file # since we cannot create a directory (we cannot remove it on exit) # create a file in the safest way possible. if test "$OUTFILE" = none; then OUTFILE=$tmp/vimspell$$ [ -e $OUTFILE ] && { echo "Cannot use temporary file $OUTFILE, it already exists!"; exit 1 ; } (umask 077; touch $OUTFILE) fi # Note the copy of vimspell cannot be deleted on exit since it is # used by vim, otherwise it should do this: # trap "rm -f $OUTFILE" 0 1 2 3 9 11 13 15 # # 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 vim-7.4.1689/runtime/tools/vimspell.txt000066400000000000000000000014631267703067000200200ustar00rootroot00000000000000vimspell.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 . 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 :so `vimspell.sh %` noremap :syntax clear SpellErrors 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 vim-7.4.1689/runtime/tools/xcmdsrv_client.c000066400000000000000000000325621267703067000206200ustar00rootroot00000000000000/* 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 #include #ifdef HAVE_SELECT #include #include #include #else #include #endif #include #include /* Client API */ char * sendToVim(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} ", 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(Display *dpy, XErrorEvent *error_event); static int AppendPropCarefully(Display *display, Window window, Atom property, char *value, int length); static Window LookupName(Display *dpy, char *name, int delete, char **loose); static int SendInit(Display *dpy); static char *SendEventProc(Display *dpy, XEvent *eventPtr, int expect, int *code); static int IsSerialName(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( 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(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( 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, ®Prop); 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( 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( 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(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(char *str) { int len = strlen(str); return (len > 1 && isdigit(str[len - 1])); } vim-7.4.1689/runtime/tutor.info000077500000000000000000000011601267703067000163130ustar00rootroot00000000000000LB ''`dj"HH'K)Y6"'\?B @?<<<<<<=?/UWB @??Ovim-7.4.1689/runtime/tutor/000077500000000000000000000000001267703067000154355ustar00rootroot00000000000000vim-7.4.1689/runtime/tutor/Makefile000066400000000000000000000047431267703067000171050ustar00rootroot00000000000000# 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. # # Similarly for Russian and Korean all: tutor.utf-8 \ tutor.bar \ tutor.ca.utf-8 \ tutor.de.utf-8 \ tutor.el tutor.el.cp737 \ tutor.eo \ tutor.es.utf-8 \ tutor.fr.utf-8 \ tutor.hr tutor.hr.cp1250 \ tutor.hu tutor.hu.cp1250 \ tutor.it.utf-8 \ tutor.ja.sjis tutor.ja.euc \ tutor.ko.euc \ tutor.nl \ tutor.no.utf-8 \ tutor.nb \ tutor.nb.utf-8 \ tutor.ru tutor.ru.cp1251 \ tutor.sv.utf-8 \ tutor.zh.utf-8 tutor.utf-8: tutor iconv -f ISO-8859-1 -t UTF-8 tutor > tutor.utf-8 tutor.bar: tutor.bar.utf-8 iconv -f UTF-8 -t ISO-8859-1 tutor.bar.utf-8 > tutor.bar tutor.ca.utf-8: tutor.ca iconv -f ISO-8859-1 -t UTF-8 tutor.ca > tutor.ca.utf-8 tutor.eo: tutor.eo.utf-8 iconv -f UTF-8 -t ISO-8859-3 tutor.eo.utf-8 > tutor.eo tutor.de.utf-8: tutor.de iconv -f ISO-8859-1 -t UTF-8 tutor.de > tutor.de.utf-8 tutor.el: tutor.el.utf-8 iconv -f UTF-8 -t ISO-8859-7 tutor.el.utf-8 > tutor.el tutor.el.cp737: tutor.el.utf-8 iconv -f UTF-8 -t cp737 tutor.el.utf-8 > tutor.el.cp737 tutor.es.utf-8: tutor.es iconv -f ISO-8859-1 -t UTF-8 tutor.es > tutor.es.utf-8 tutor.fr.utf-8: tutor.fr iconv -f ISO-8859-1 -t UTF-8 tutor.fr > tutor.fr.utf-8 tutor.hu: tutor.hu.utf-8 iconv -f UTF-8 -t ISO-8859-2 tutor.hu.utf-8 > tutor.hu tutor.hu.cp1250: tutor.hu.utf-8 iconv -f UTF-8 -t cp1250 tutor.hu.utf-8 > tutor.hu.cp1250 tutor.hr: tutor.hr.utf-8 iconv -f UTF-8 -t ISO-8859-2 tutor.hr.utf-8 > tutor.hr tutor.hr.cp1250: tutor.hr.utf-8 iconv -f UTF-8 -t cp1250 tutor.hr.utf-8 > tutor.hr.cp1250 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 tutor.nl: tutor.nl.utf-8 iconv -f UTF-8 -t ISO-8859-1 tutor.nl.utf-8 > tutor.nl tutor.no.utf-8: tutor.no iconv -f ISO-8859-1 -t UTF-8 tutor.no > tutor.no.utf-8 # nb is an alias for no tutor.nb: tutor.no cp tutor.no tutor.nb tutor.nb.utf-8: tutor.no.utf-8 cp tutor.no.utf-8 tutor.nb.utf-8 tutor.ru: tutor.ru.utf-8 iconv -f UTF-8 -t KOI8-R tutor.ru.utf-8 > tutor.ru tutor.ru.cp1251: tutor.ru.utf-8 iconv -f UTF-8 -t cp1251 tutor.ru.utf-8 > tutor.ru.cp1251 tutor.sv.utf-8: tutor.sv iconv -f ISO-8859-1 -t UTF-8 tutor.sv > tutor.sv.utf-8 tutor.zh.utf-8: tutor.zh.big5 iconv -f BIG-5 -t UTF-8 tutor.zh.big5 > tutor.zh.utf-8 vim-7.4.1689/runtime/tutor/README.el.cp737.txt000066400000000000000000000020671267703067000204010ustar00rootroot00000000000000 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] vim-7.4.1689/runtime/tutor/README.el.txt000066400000000000000000000020671267703067000175370ustar00rootroot00000000000000 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] vim-7.4.1689/runtime/tutor/README.txt000066400000000000000000000015361267703067000171400ustar00rootroot00000000000000Tutor 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] vim-7.4.1689/runtime/tutor/README.txt.info000077500000000000000000000013421267703067000200700ustar00rootroot000000000000000""j"z "8!u00 "6^,LN on ^?B"y7.3B74ԖEipOaFBc5 vO $,17\0'Vvʜ\dFbpp8q{8 #ɡ~= W&9݆f mc +i r9c !zcZ 8i#&>ȢEg wZ.>: 5ca&0xJ,U@(֟t\PFu1-ԔFham}5uϘ;a-LʰTl 7 3)`do mb +kcka> ;0gmkĞ p~rS ҳ 5OM Y :c/MuchMorevim-7.4.1689/runtime/tutor/tutor000066400000000000000000001007401267703067000165370ustar00rootroot00000000000000=============================================================================== = W e l c o m e t o t h e V I M T u t o r - Version 1.7 = =============================================================================== 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. ATTENTION: 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 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. Really! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 1.2: EXITING VIM !! NOTE: Before executing any of the steps below, read this entire lesson!! 1. Press the key (to make sure you are in Normal mode). 2. Type: :q! . This exits the editor, DISCARDING any changes you have made. 3. Get back here by executing the command that got you into this tutor. That might be: vimtutor 4. If you have these steps memorized and are confident, execute steps 1 through 3 to exit and re-enter the editor. NOTE: :q! discards any changes you made. In a few lessons you will learn how to save the changes to a file. 5. Move the cursor down to Lesson 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 1.3: TEXT EDITING - DELETION ** 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 ** 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 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 lesson 1.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 1.5: TEXT EDITING - APPENDING ** Press A to append text. ** 1. Move the cursor to the first line below marked --->. It does not matter on what character the cursor is in that line. 2. Press A and type in the necessary additions. 3. As the text has been appended press to return to Normal mode. 4. Move the cursor to the second line marked ---> and repeat steps 2 and 3 to correct this sentence. ---> There is some text missing from th There is some text missing from this line. ---> There is also some text miss There is also some text missing here. 5. When you are comfortable appending text move to lesson 1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 1.6: EDITING A FILE ** Use :wq to save a file and exit. ** !! NOTE: Before executing any of the steps below, read this entire lesson!! 1. Exit this tutor as you did in lesson 1.2: :q! Or, if you have access to another terminal, do the following there. 2. At the shell prompt type this command: vim tutor 'vim' is the command to start the Vim editor, 'tutor' is the name of the file you wish to edit. Use a file that may be changed. 3. Insert and delete text as you learned in the previous lessons. 4. Save the file with changes and exit Vim with: :wq 5. If you have quit vimtutor in step 1 restart the vimtutor and move down to the following summary. 6. After reading the above steps and understanding them: do it. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 start Vim from the shell prompt type: vim FILENAME 3. To exit Vim type: :q! to trash all changes. OR type: :wq to save the changes. 4. To delete the character at the cursor type: x 5. To insert or append text type: i type inserted text insert before the cursor A type appended text append after the line NOTE: Pressing 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 a word. ** 1. Press 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 letter d will appear on the last line of the screen as you type it. Vim is waiting for you to type w . If you see another character than d you typed something wrong; press 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 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 OPERATORS AND MOTIONS Many commands that change text are made from an operator and a motion. The format for a delete command with the d delete operator is as follows: d motion Where: d - is the delete operator. motion - is what the operator will operate on (listed below). A short list of motions: w - until the start of the next word, EXCLUDING its first character. e - to the end of the current word, INCLUDING the last character. $ - to the end of the line, INCLUDING the last character. Thus typing de will delete from the cursor to the end of the word. NOTE: Pressing just the motion while in Normal mode without an operator will move the cursor as specified. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 2.4: USING A COUNT FOR A MOTION ** Typing a number before a motion repeats it that many times. ** 1. Move the cursor to the start of the line marked ---> below. 2. Type 2w to move the cursor two words forward. 3. Type 3e to move the cursor to the end of the third word forward. 4. Type 0 (zero) to move to the start of the line. 5. Repeat steps 2 and 3 with different numbers. ---> This is just a line with words you can move around in. 6. Move on to Lesson 2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 2.5: USING A COUNT TO DELETE MORE ** Typing a number with an operator repeats it that many times. ** In the combination of the delete operator and a motion mentioned above you insert a count before the motion to delete more: d number motion 1. Move the cursor to the first UPPER CASE word in the line marked --->. 2. Type d2w to delete the two UPPER CASE words 3. Repeat steps 1 and 2 with a different count to delete the consecutive UPPER CASE words with one command ---> this ABC DE line FGHI JK LMN OP of words is Q RS TUV cleaned up. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 2.6: OPERATING ON LINES ** 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 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 to delete 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.7: 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 up to the next 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. To repeat a motion prepend it with a number: 2w 5. The format for a change command is: operator [number] motion where: operator - is what to do, such as d for delete [number] - is an optional count to repeat the motion motion - moves over the text to operate on, such as w (word), $ (to the end of line), etc. 6. To move to the start of the line use a zero: 0 7. 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 previously deleted text after the cursor. ** 1. Move the cursor to the first ---> line below. 2. Type dd to delete the line and store it in a Vim register. 3. Move the cursor to the c) line, ABOVE where the deleted line should go. 4. Type p to put the line below the cursor. 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 rx to replace the character at the cursor with x . ** 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 be there. 4. Repeat steps 2 and 3 until the first line is equal to the second one. ---> 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.3. NOTE: Remember that you should be learning by doing, not memorization. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 3.3: THE CHANGE OPERATOR ** To change until the end of a word, type ce . ** 1. Move the cursor to the first line below marked --->. 2. Place the cursor on the u in lubw. 3. Type ce and the correct word (in this case, type ine ). 4. Press and move to the next character that needs 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 operator. ---> This line has a few words that need changing using the change operator. Notice that ce deletes the word and places you in Insert mode. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 3.4: MORE CHANGES USING c ** The change operator is used with the same motions as delete. ** 1. The change operator works in the same way as delete. The format is: c [number] motion 2. The motions are the same, such as w (word) and $ (end of line). 3. Move to the first line below marked --->. 4. Move the cursor to the first error. 5. Type c$ and type the rest of the line like the second and press . ---> 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. NOTE: You can use the Backspace key to correct mistakes while typing. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 3 SUMMARY 1. To put back text that has just 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 you want to have there. 3. The change operator allows you to change from the cursor to where the motion takes you. eg. Type ce 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: c [number] motion Now go on to the next lesson. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 4.1: CURSOR LOCATION AND FILE STATUS ** Type CTRL-G to show your location in the file and the file status. Type 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 . We call this CTRL-G. A message will appear at the bottom of the page with the filename and the position in the file. Remember the line number for Step 3. NOTE: You may see the cursor position in the lower right corner of the screen This happens when the 'ruler' option is set (see :help 'ruler' ) 2. Press G to move you to the bottom of the file. Type gg to move you to the start of the file. 3. Type the number of the line you were on and then G . This will return you to the line you were on when you first pressed CTRL-G. 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' . 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 N . 4. To search for a phrase in the backward direction, use ? instead of / . 5. To go back to where you came from press CTRL-O (Keep Ctrl down while pressing the letter o). Repeat to go back further. CTRL-I goes forward. ---> "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, unless the 'wrapscan' option has been reset. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 will move to the matching parenthesis or bracket. 4. Type % to move the cursor to the other matching bracket. 5. Move the cursor to another (,),[,],{ or } and see what % does. ---> 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: THE SUBSTITUTE COMMAND ** Type :s/old/new/g to substitute 'new' for 'old'. ** 1. Move the cursor to the line below marked --->. 2. Type :s/thee/the . Note that this command only changes the first occurrence of "thee" in the line. 3. Now type :s/thee/the/g . Adding the g flag means to substitute globally in the line, change all occurrences of "thee" in 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 line numbers of the range of lines where the substitution is to be done. Type :%s/old/new/g to change every occurrence in the whole file. Type :%s/old/new/gc to find every occurrence in the whole file, with a prompt whether to substitute or not. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 4 SUMMARY 1. CTRL-G displays your location in the file and the file status. G moves to the end of the file. number G moves to that line number. gg moves to the first line. 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 N to search in the opposite direction. CTRL-O takes you back to older positions, CTRL-I to newer positions. 3. Typing % while the cursor is on a (,),[,],{, or } goes to its match. 4. To substitute new for the first old in 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-line 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 . 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, also with arguments. NOTE: All : commands must be finished by hitting From here on we will not always mention it. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 5.2: MORE ON WRITING FILES ** To save the changes made to the text, type :w FILENAME. ** 1. Type :!dir or :!ls to get a listing of your directory. You already know you must hit 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 (the Vim Tutor) under the name TEST. To verify this, type :!dir or :!ls again to see your directory. NOTE: If you were to exit Vim and start it again with vim 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: SELECTING TEXT TO WRITE ** To save part of the file, type v motion :w FILENAME ** 1. Move the cursor to this line. 2. Press v and move the cursor to the fifth item below. Notice that the text is highlighted. 3. Press the : character. At the bottom of the screen :'<,'> will appear. 4. Type w TEST , where TEST is a filename that does not exist yet. Verify that you see :'<,'>w TEST before you press . 5. Vim will write the selected lines to the file TEST. Use :!dir or :!ls to see it. Do not remove it yet! We will use it in the next lesson. NOTE: Pressing v starts Visual selection. You can move the cursor around to make the selection bigger or smaller. Then you can use an operator to do something with the text. For example, d deletes the text. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 5.4: RETRIEVING AND MERGING FILES ** To insert the contents of a file, type :r FILENAME ** 1. Place the cursor just above this line. NOTE: After executing Step 2 you will see text from Lesson 5.3. Then move DOWN to see this lesson again. 2. Now retrieve your TEST file using the command :r TEST where TEST is the name of the file you used. The file you retrieve is placed below the cursor line. 3. 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. NOTE: You can also read the output of an external command. For example, :r !ls reads the output of the ls command and puts it below the cursor. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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. v motion :w FILENAME saves the Visually selected lines in file FILENAME. 4. :r FILENAME retrieves disk file FILENAME and puts it below the cursor position. 5. :r !dir reads the output of the dir command and puts it below 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 the lowercase letter o to open up a line BELOW the cursor and place you in Insert mode. 3. Now type some text and press 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 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 start of the line below marked --->. 2. Press e until the cursor is on the end of li . 3. Type an a (lowercase) to append text AFTER the cursor. 4. Complete the word like the line below it. Press to exit Insert mode. 5. Use e to move to the next incomplete word and repeat steps 3 and 4. ---> This li will allow you to pract appendi text to a line. ---> This line will allow you to practice appending text to a line. NOTE: a, i and A all go to the same Insert mode, the only difference is where the characters are inserted. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 6.3: ANOTHER WAY TO REPLACE ** Type a capital R to replace more than one character. ** 1. Move the cursor to the first line below marked --->. Move the cursor to the beginning of the first xxx . 2. Now press R and type the number below it in the second line, so that it replaces the xxx . 3. Press to leave Replace mode. Notice that the rest of the line remains unmodified. 4. Repeat the steps to replace the remaining xxx. ---> Adding 123 to xxx gives you xxx. ---> Adding 123 to 456 gives you 579. NOTE: Replace mode is like Insert mode, but every typed character deletes an existing character. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 6.4: COPY AND PASTE TEXT ** Use the y operator to copy text and p to paste it ** 1. Go to the line marked with ---> below and place the cursor after "a)". 2. Start Visual mode with v and move the cursor to just before "first". 3. Type y to yank (copy) the highlighted text. 4. Move the cursor to the end of the next line: j$ 5. Type p to put (paste) the text. Then type: a second . 6. Use Visual mode to select " item.", yank it with y , move to the end of the next line with j$ and put the text there with p . ---> a) this is the first item. b) NOTE: you can also use y as an operator; yw yanks one word. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 6.5: SET OPTION ** Set an option so a search or substitute ignores case ** 1. Search for 'ignore' by entering: /ignore Repeat several times by pressing n . 2. Set the 'ic' (Ignore case) option by entering: :set ic 3. Now search for 'ignore' again by pressing n Notice that Ignore and IGNORE are now also found. 4. Set the 'hlsearch' and 'incsearch' options: :set hls is 5. Now type the search command again and see what happens: /ignore 6. To disable ignoring case enter: :set noic NOTE: To remove the highlighting of matches enter: :nohlsearch NOTE: If you want to ignore case for just one search command, use \c in the phrase: /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 6 SUMMARY 1. Type o to open a line BELOW the cursor and start Insert mode. Type O to open a line ABOVE the cursor. 2. Type a to insert text AFTER the cursor. Type A to insert text after the end of the line. 3. The e command moves to the end of a word. 4. The y operator yanks (copies) text, p puts (pastes) it. 5. Typing a capital R enters Replace mode until is pressed. 6. Typing ":set xxx" sets the option "xxx". Some options are: 'ic' 'ignorecase' ignore upper/lower case when searching 'is' 'incsearch' show partial matches for a search phrase 'hls' 'hlsearch' highlight all matching phrases You can either use the long or the short option name. 7. Prepend "no" to switch an option off: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 7.1: GETTING HELP ** Use the on-line help system ** Vim has a comprehensive on-line help system. To get started, try one of these three: - press the key (if you have one) - press the key (if you have one) - type :help Read the text in the help window to find out how the help works. Type CTRL-W CTRL-W to jump from one window to another. Type :q 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 ): :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 7.2: CREATE A STARTUP SCRIPT ** Enable 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: :e ~/.vimrc for Unix :e $VIM/_vimrc for MS-Windows 2. Now read the example "vimrc" file contents: :r $VIMRUNTIME/vimrc_example.vim 3. Write the file with: :w The next time you start Vim it will use syntax highlighting. You can add all your preferred settings to this "vimrc" file. For more information type :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 7.3: COMPLETION ** Command line completion with CTRL-D and ** 1. Make sure Vim is not in compatible mode: :set nocp 2. Look what files exist in the directory: :!ls or :!dir 3. Type the start of a command: :e 4. Press CTRL-D and Vim will show a list of commands that start with "e". 5. Press and Vim will complete the command name to ":edit". 6. Now add a space and the start of an existing file name: :edit FIL 7. Press . Vim will complete the name (if it is unique). NOTE: Completion works for many commands. Just try pressing CTRL-D and . It is especially useful for :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 7 SUMMARY 1. Type :help or press or to open a help window. 2. Type :help cmd to find help on cmd . 3. Type CTRL-W CTRL-W to jump to another window 4. Type :q to close the help window 5. Create a vimrc startup script to keep your preferred settings. 6. When typing a : command, press CTRL-D to see possible completions. Press to use one completion. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim-7.4.1689/runtime/tutor/tutor.bar000066400000000000000000001177001267703067000173060ustar00rootroot00000000000000=============================================================================== = G o t i k a m i n n W I M M - S c h a i n e r - Fassung 1.7 = =============================================================================== Dyr Wimm ist ayn gro mchtigs Blat, ds was mit aynn Wsn Befelh aufwartt; z vil, d myn s allsand in aynn Schainer wie dnn daader unterbrng. Der Schainer ist yso aufbaut, d yr halt netty die Befelh allsand bringt, wost brauchst, dst mit iem fr s Eerste wirklich bbs anfangen kanst. Durchhinarechtn kanst di, wennst willst, in ayner halbetn Stund; ds haisst, wennst di nit groo mit n Prbln und Tftln aufhaltst. OBACHT: Die Faudungen, wost daader finddst, gaand istig s Gwort ndern. Dsswgn machst eyn n Bstn glei ayn Aamum von derer Dautticht daader. Haast alsnan ds Gwort daader mit n Befelh "vimtutor bar" ausherlaassn, ist s ee schoon ayn Aamum. Mir kan s nit oft gnueg sagn, d der Schainer daader istig gan n ebn ghoert. Also muesst schoon aau die Befelh +ausfern, wennst ys gscheid ler- nen willst. Mit n Lsn yllain ist s +nit taan! Ietz schaust grad non, d dein Fststlltastn nit druckt ist; und aft geest glei aynmaal mit dyr j-Tastn abwrts (yso laaufft ds nmlich), hinst dst de gantze Letzn 1.1 auf n Bildschirm haast. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 1.1: MIT N MRKL UMAYNANDFARN ** Dyrmitst mit n Mrkl umaynandkimmst, druck h, j, k und l wie unt zaigt. ** ^ Ayn slsbrugg: k De Tastn h ist winster und +geet aau gan winster. < h l > S l leit zesm und richtt si gan zesm. j S j kan myn wie aynn Pfeil gan unt seghn. v Mit n k kimmst gan n KOPF. 1. Ietz ruedertst ainfach mit n Mrkl auf n Bildschirm umaynand, hinst dst di sicher felst. 2. Halt d Abhin-Tastn (j) druckt; aft rumplt s ainfach weiter. Netty yso kimmst gan dyr naehstn Letzn. 3. Wie gsait, ietz bewgst di also mit derer Tastn gan dyr Letzn 1.2. Non bbs: Allweil, wenn dyr niemer ganz wol ist, wasst bbenn druckt haast, aft zipfst ; naacher bist wider ganz gwon in dyr Befelhs-Artweis. Nbnbei gsait kimmst gwonerweil aau mit de Pfeiltastnen weiter. Aber hjkl seind z haissn s Wimm-Urgstain; und de "Hrtn" seind ganz dyr- fr, d myn bei +dene bleibt. Prblt s ainfach aus! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 1.2: NN WIMM AUSSCHALTTN ALSO, EE WENNST BBS VON DAA UNT AUSFERST, LIS LIEBER ZEERST DE GANTZE LET- ZN! 1. Druck d -Tastn, dyrmitst aau gwi in dyr Befelhs-Artweis bist. 2. Demmlt :q! . Daa dyrmit benddst ys Blat und verwirffst allss, wasst bbenn gndert haast. 3. Balst nn Eingib seghst, gib d Faudung ein, wo di zo dnn Schainer brun- gen haat, also vimtutor bar . 4. Also, wenn ietz allsse sitzt, naacherd ferst d Schritt 1 hinst 3 aus, mit wasst ys Blat verlaasst und aft wider einhinkimmst. Anmrkung: Mit :q! verwirffst allss, wasst gndert older enther gschribn haast. In aynn ttlych Letznen lernst acht, wiest ds allss in ayner Dautticht speichertst. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 1.3: GWORT BARECHTN - LSCHN ** Druck x , dyrmitst ds Zaichen unter n Mrkl lschst. ** 1. Bewg di mit n Mrkl auf de mit ---> angmrkte Zeil unt. 2. Zo n Faeler Verbssern farst mit n Mrkl netty auf ds Zaichen, ds wo glscht ghoert. 3. Druck de Tastn x , dst ds berflssige Zaichen lschst. 4. Ietz tuest so lang weiter mit 2 hinst 4, hinst d dyr Saz stimmt. ---> De Kkuue sprangg bber nn Maanad. 5. Wenn ietz de Zeil verbssert ist, geest gan dyr Letzn 1.4. weiter. Und ganz wichtig: Dyrweilst dnn Schainer durcharechtst, versuech nit bbenn, allss auswendig z lernen; nn, lern ainfach mit n Anwenddn! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 1.4: GWORT BARECHTN - EINFEGN ** Druck i , dyrmitst bbs einfegst. ** 1. Bewg nn Mrkl zo dyr eerstn untignen Zeil, wo mit ---> angeet. 2. Dyrmitst de eerste Zeil wie de zwaitte machst, bewg nn Mrkl auf ds eerste Zaichen NAACH derer Stll, daa wo s Gwort eingfegt werdn sollt. 3. Druck i und gib ds ein, was abgeet. 4. Wenn ieweils ayn Faeler verweitert ist, aft druck ; dyrmit kimmst gan dyr Befelhsartweis zrugg. So, und ietz tuest ainfach yso weiter, hinst d dyr Saz stimmt. ---> Daader gt dd bbs b. ---> Daader geet diend bbs ab. 5. Balst mainst, dst ys Gwort-Einfegn kanst, aft geest gan dyr Letzn 1.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 1.5: GWORT BARECHTN - ANFEGN ** Druck A gan n Gwort Anfegn. ** 1. Gee mit n Mrkl gan dyr eerstn untignen Zeil, wo ayn ---> dyrvor haat. Daa ist s gleich, wo gnaun dyr Mrkl in derer Zeil steet. 2. Demmlt A und gib de entsprchetn Ergntzungen ein. 3. Wennst mit n Anfegn frtig bist, aft druckst , dst wider eyn de Befelhsartweis zruggkimmst. 4. So, und ietz geest aft non gan dyr zwaittn mit ---> angmrktn Zeil; und daadl machst ys netty yso. ---> In derer Zeil gee In derer Zeil geet ayn Weeng ayn Gwort ab. ---> Aau daader stee Aau daader steet bbs Unvollstndigs. 5. Wennst s Anfegn von Gwort drauf haast, naacherd gee gan dyr Letzn 1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 1.6: AYN DAUTTICHT BARECHTN ** Mit :wq speichertst ayn Dautticht und verlaasst nn Wimm ganz. ** !! OBACHT: Ee wennst mit dnn alln daa unt weitertuest, lis zeerst de gantze Letzn durch!! 1. Verlaa also s Blat, wie s in dyr Letzn 1.2. haisst, mit :q! ! 2. Gib d Faudung eyn n Eingib ein: vim Schainer . 'vim' ruefft s Blat auf, und 'Schainer' haisst de Dautticht, wost barechtn willst. Dyrmit haast also ayn Dautticht, d wost barechtn kanst. 3. Ietz fegst bbs ein older lschst bbs, wiest ys in de vorignen Letznen glernt haast. 4. Speichert de gnderte Dautticht und verlaa nn Wimm mit :wq . 5. Schmei nn Wimmschainer neu an und gee gan dyr folgetn Zammenfassung. 6. Aft dst de obignen Schritt glsn und kppt haast, kanst ys durchfern. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZAMMENFASSUNG VON DYR LETZN 1 1. Dyr Mrkl werd mit de Tastnen hjkl older aau mit de Pfeiltastnen gsteuert. h (winst) j (ab) k (auf) l (zes) 2. Um nn Wimm umbb n Eingib aus z ginnen, demmlt: vim DAUTTICHT . 3. Willst nn Wimm verlaassn und aau allss verwerffen, aft gibst ein: und :q! . Gan n Verlaassn und Speichern aber zipfst und :wq . 4. Willst ds Zaichen lschn, daa wo dyr Mrkl drauf ist, demmltst x . 5. Willst bbs vor n Mrkl eingbn, zipfst i und drafter . Mechst ys aber eyn s Zeilnend anhinhngen, benutzt ys A . Und ainfach naach n Mrkl fegst ys mit a ein. Anmrkung: Druckst , kimmst eyn de Befelhsartweis zrugg older brichst ayn Faudung ab, d wo dyr schiefgangen ist. Ietz tue mit dyr Letzn 2 weiter. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 2.1.: LSHFAUDUNGEN ** Demmlt dw , dyrmitst ayn Wort lschst. ** 1. Druck , dyrmit s aau gwi ist, dst in dyr Befelhsartweis bist. 2. Bewg nn Mrkl zo dyr mit ---> angmrktn Zeil unt. 3. Und daa geest ietz auf n Anfang von aynn Wort, ds wo glscht ghoert. 4. Zipf dw , dst ds gantze Wort lschst. Nbnbei: Dyr Buechstabn d erscheint auf dyr lsstn Zeil von n Bildschirm, sobaldst n eingibst. Dyr Wimm wartt ietz drauf, d bbs kimmt, al- so daader ayn w . Seghst freilich bbs Anderts wie ayn d , naacherd haast bbs Falschs demmlt. Druck aft und prblt s non aynmaal. ---> Ayn ttlych Wrter lustig ghoernd nit Fisper eyn dnn Saz einhin. 5. fert d Schritt 3 und 4, hinst d dyr Saz psst, und gee aft gan dyr Letzn 2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 2.2.: NON MEERER LSHFAUDUNGEN ** Gib d$ ein, dst hinst eyn s Zeilnend lschst. ** 1. Druck , dyrmitst aau gwi in dyr Befelhsartweis bist. 2. Bewg nn Mrkl hinst eyn de mit ---> angmrkte Zeil untn. 3. Gee mit n Mrkl auf s End von dyr faelerfreien Zeil, NAACH n eerstn . . 4. Zipf d$ , dst hinst eyn s End von dyr Zeil lschst. ---> bber haat s End von dyr Zeil doplt eingbn. doplt eingbn. 5. Gee weiter gan dyr Letzn 2.3, dyrmitst versteest, was daader ablaaufft. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 2.3: PFEMERER UND WOLENDER Vil Faudungen, wo s Gwort ndernd, stznd si aus aynn Pfemerer und aynn Wo- lend zamm. Bal i also bbs lschn will, schreib i ainsting d und aft s "Wo- lend", ds haisst also, "wolend", "wohin" d i will - older was i halt gnaun lschn will. Daader also, was i wie lschn kan: w - hinst eyn n Anfang von n naehstn Wort AANE dnn sein eersts Zaichen. e - gan n End von n ietzundn Wort MIT dnn seinn lsstn Zaichen. $ - zo n End von dyr Zeil MIT derer irn lsstn Zaichen. Also lscht de Tastnfolg de allss umbb n Mrkl hinst eyn s Wortend. Anmrkung: Gib i grad ds zwaitte Zaichen yllain ein, ruckt halt dyr Mrkl entsprchet weiter. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 2.4: MIT AYNN ZLER D WOLENDER FERN ** Gib i ayn Zal vor aynn Wolend ein, werd ds Sel entsprchet oft gangen. ** 1. Bewg nn Mrkl gan n Anfang von dyr Zeil mit ---> dyrvor unt. 2. Zipf 2w , dst mit n Mrkl zwai Wrter weitergeest. 3. Zipf 3e , dst mit n Mrkl auf s End von n drittn Wort kimmst. 4. Zipf 0 (aynn Nuller), dst eyn n Anfang von dyr Zeil hinkimmst. 5. Widerhol d Schritt 2 und 3 mit verschaidne Zler. ---> Ds ist ietz grad ayn Zeil zo n drinn Umaynanderruedern. 6. Gee weiter gan dyr Letzn 2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 2.5: DURCH AYNN ZLER GLEI MEERER LSCHN ** Ayn Zal vor aynn Pfemerer fert dnn entsprchet oft aus. ** Also, i mecht lschn, und zwaar bbs Bestimmts, und ds so und so oft: Daa dyrzue benutz i aynn Zler: d Zler Wolend (also nn Bewgungsschrit) 1. Bewg nn Mrkl zo n eerstn Wort in GROOSSBUECHSTABN in dyr mit ---> an- gmrktn Zeil. 2. Demmlt d2w , dyrmitst de ganz groogschribnen Wrter lschst. 3. fert d Schritt 1 und 2 mit dnn entsprchetn Zler, dyrmitst de drauf- folgetn ganz grogschribnen Wrter mit ayner ainzignen Faudung lschst: ---> D ABC DE Zeil FGHI JK LMN OP mit Wrter ist Q RS TUV ietz berichtigt. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 2.6: ARECHTN AUF ZEILN ** Zipf dd , um ayn gantze Zeil z lschn. ** Weil s gro oft vrkimmt, d myn gantze Zeiln lscht, kaamend schoon d Ent- wickler von n Urwimm daa drauf, d myn ainfach dd gan dnn Zwk schreibt. 1. Bewg nn Mrkl gan dyr zwaittn Zeil in n untignen "Gedicht". 2. Zipf dd , um d Zeil z lschn. 3. Ietz bewgst di gan dyr viertn Zeil. 4. Zipf 2dd , um zwo Zeiln zo n Lschn. ---> 1) Roosn seind root; ---> 2) Drunter ist s Koot. ---> 3) Veigerln seind blau. ---> 4) Umgrabn tuet s d Sau. ---> 5) D Ur sait de Zeit, ---> 6) Sait, d s mi freut, ---> 7) Dirndl, dein Gschau. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 2.7: RUGGGNGIG MACHEN (RUGGLN) ** Zipf u , dyrmitst de lsstn Faudungen ruggltst ** ** older U , um ayn gantze Zeil widerherzstlln. ** 1. Bewg nn Mrkl gan dyr mit ---> angmrktn Zeil unt und gee dyrmit auf n eerstn Faeler. 2. Zipf x , dst ds eerste z vile Zaichen lschst. 3. Ietz demmlt u , dyrmitst de lsste Faudung ruggltst. 4. Ietz behb allsand Faeler auf dyr Zeil mit dyr Hilf von n Befelh x . 5. Aft gibst ayn U (groo) ein, dst de Zeil wider yso hinbringst, wie s gwsn ist. 6. So, und ietz demmltst so oft u , hinst dst s U und de andern Fau- dungen rugggngig gmacht haast. 7. Und ietzet widerum schreibst so oft r , hinst dst allsand Be- felh widerhergstllt, z haissn allsse rugg-grugglt haast (also d Rugggn- gigmachungen rugggngig gmacht). ---> Beerichtig d Faeller voon dehrer Zeiil und sttll s mitt n Ruggruggln wi- der her. 8. Die Faudungen seind gro wichtig; s helffend ainn nrrisch weiter. Ietz gee weiter gan dyr Zammenfassung von dyr Letzn 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZAMMENFASSUNG VON DYR LETZN 2 1. Um von n Mrkl aus hinst eyn s naehste Wort zo n Lschn, zipf: dw 2. Um umbb n Mrkl hinst eyn s End von dyr Zeil zo n Lschn, demmlt d$ 3. Dyrmitst ayn gantze Zeil lschst, gib ein: dd 4. Mechst ayn Bewgung, ayn "Wolend", fters, stll de entsprchete Zal dyr- vor: 3dw older aau: d3w 5. Dyr Pfueg fr ayn nderungsfaudung lautt yso: Pfemerer [Zal] Bewgungsschrit (Wolend) Und ds haisst: Dyr PFEMERER gibt an, WAS taan ghoert, bbenn d = lschn (delete). [ZAL] - Ayn Zal KAN myn angbn, wenn myn halt ayn Wolend fter habn will. S WOLEND, also dyr Schrit WOHIN, besagt, auf was i aushin will, bbenn auf aynn Wortanfang ( w ), s End von dyr Zeil ( $ ) und so weiter. 6. Dst eyn n Anfang von dyr Zeil hinkimmst, schreib aynn Nuller: 0 7. Um bbs Vorigs wider z ruggln, gib ein: u (klain also) Um allsand nderungen in ayner Zeil z ruggln, haast: U (also groo) Um "rugg-z-ruggln", also allss wider herzstlln, zipf: r ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 3.1: ANFEGN (put) ** Zipf p , dyrmitst bbs gnetty Glschts naach n Mrkl anfegst. ** 1. Bewg nn Mrkl gan dyr eerstn untignen Zeil mit ---> dyrvor. 2. Zipf dd , um sele Zeil z lschn und dyrmit in ayner Wimm-Osn zo n Spei- chern. 3. Bewg nn Mrkl gan dyr Zeil c), BER derer, daa wo de glschte Zeil ein- hinkemmen sollt. 4. So, und ietz gibst ainfach p ein, und schoon haast d Zeil unter derer mit n Mrkl drinn. 5. fert d Schritt 2 hinst 4, hinst dst allsand Zeiln yso naachynaynand haast, wie s hinghoernd. ---> d) Kanst du ds aau? ---> b) Veigerln seind blau. ---> c) Bedachtn kan myn lernen. ---> a) Roosn seind root. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 3.2: ERSTZN (replace) ** Zipf rx , um ds Zaichen unter n Mrkl durch x z erstzn. ** 1. Bewg nn Mrkl zo dyr eerstn untignen Zeil mit ---> dyrvor. 2. Bewg nn Mrkl, hinst d yr auf n eerstn Faeler steet. 3. Zipf r und drafter ds Zaichen, wo dyrfr daa hinghoert. 4. Widerhol d Schritt 2 und 3, hinst dst de eerste Zeil gmae dyr zwaittn berichtigt haast: ---> Wie d Zeit eingobn wurd, wurdnd ainike falsche Zastnen zipft! ---> Wie d Zeil eingbn wurd, wurdnd ainige falsche Tastnen zipft! 5. Ietz tue mit dyr Letzn 3.3 weiter. Anmrkung: Vergi nit drauf, dst mit n Anwenddn lernen solltst und nit bbenn mit n Auswendiglernen! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 3.3: NDERN (change) ** Um hinst eyn s Wortend z ndern, zipf ce . ** 1. Gee mit n Mrkl auf de eerste mit ---> angmrkte Zeil. 2. Ietz farst netty auf s "s" von Wstwr hin. 3. Zipf ce ein und aft d Wortberichtigung, daader also rter . 4. Druck und bewg nn Mrkl zo n naehstn Zaichen, wo gndert ghoert. 5. fert d Schritt 3 und 4, hinst d dyr eerste Saz wie dyr zwaitte ist. ---> Ainige Wstwr von derer Zlww ghhnnd mit n ndern-Pfemerer gaauu. ---> Ainige Wrter von derer Zeil ghoernd mit n ndern-Pfemerer gndert. ce lscht also s Wort und schlaaufft di eyn d Eingaab-Artweis. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 3.4.: NON MEERER NDERUNGEN PFELFS c ** D Lshfaudung c arechtt mit de nmlichnen Wolender wie d mit d ** 1. Dyr nder-Pfemerer arechtt anleich wie d Lshfaudung mit d , und zwaar yso: c [Zal] Bewgungsschrit (Wolend) 2. D Wolender seind de gleichn, bbenn w fr Wort und $ fr s Zeilnend. 3. Bewg di zo dyr eerstn untignen Zeil mit ---> . 4. Ietz geest auf dnn eerstn Faeler. 5. Zipf c$ , gib nn Rest von dyr Zeil wie in dyr zwaittn ein und druck aft . ---> S End von derer Zeil sollt an de zwaitte daader anglichen werdn. ---> S End von derer Zeil sollt mit n Befelh c$ berichtigt werdn. Denk allweil dran, dst iederzeit mit dyr Ruggtastn Faeler ausbssern kanst. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZAMMENFASSUNG VON DYR LETZN 3 1. Um ayn vorher glschts Gwort anzfegn, zipf p . Daa dyrmit werd ds gantze Gwort NAACH n Mrkl angfegt. Wenn s ayn gantze Zeil gwsn ist, werd d sel als de Zeil unterhalb n Mrkl eingfegt. 2. Um ds Zaichen unter n Mrkl, also wo dyr Mrkl ist, z erstzn, zipf r und aft ds Zaichen, wost daadl habn willst. 3. Dyr nderungspfemerer ( c = change) laasst ainn umbb n Mrkl hinst eyn s End von n Wolend ndern. Zipf ce , dyrmitst umbb n Mrkl hinst eyn s End von n Wort ndertst, und c$ hinst eyn s End von dyr Zeil. 4. Fr d nderung lautt dyr Pfueg: c [Zal] Wolend Ietz tue mit dyr naehstn Letzn weiter. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 4.1: MRKLSTLLUNG UND DAUTTICHTDARSTAND ** Demmlt g, dst nn Befand und Darstand von dyr Dautticht anzaigst. ** ** Zipf G , dyrmitst auf ayn bestimmte Zeil in dyr Dautticht hinkimmst. ** Anmrkung: Lis d gantze Letzn daader durch, ee wennst iewign bbs unternimmst! 1. Druck g . Auf ds hin erscheint auf derer Seitt ganz unt ayn Dar- standsmeldung mit n Dauttichtnam und n Befand innerhalb dyr Dautticht. Mrk dyr de Zeilnnummer fr n Schrit 3. Anmrkung: Mglicherweis seghst aau nn Mrklbefand in n zesmen untern Bild- schirmgg. Aft ist s "Lindl" (ruler) eingstllt; meerer ber ds laasst dyr dyr Befelh :help 'ruler' ausher. 2. Druck G , um an s End von dyr Dautticht z kemmen. gg gibst ein, dst gan n Anfang von dyr Dautticht aufhinkimmst. 3. Gib d Nummer von derer Zeil ein, daa wost vorher warst, und aft non G . Ds bringt di zrugg gan seler Zeil, daa wost stuenddst, wiest ds eerste Maal g gadruckst. 4. Wennst di sicher gnueg felst, aft fer d Schritt 1 hinst 3 aus. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 4.2: DYR BEFELH ZO N SUECHEN ** Zipf / und dyrnaach aynn Ausdruk, um selbignen zo n Suechen. ** 1. Du gibst also in dyr Befelhsartweis s Zaichen / ein. Ds sel wie aau dyr Mrkl erscheinend drauf unt auf n Schirm, netty wie bei dyr Faudung : . 2. Ietz zipf Faeeler . Netty um ds 'Faeeler' willst ietz suechen. 3. Willst um gnaun dnn Ausdruk weitersuechen, zipf ainfach n (wie next). Willst hinzrugg suechen, aft gibst N ein. 4. Um von Haus aus zruggaus z suechen, nimm ? statt / her. 5. Dyrmitst wider daa hinkimmst, wost herkemmen bist, nimm o , und ds fter, wennst weiter zrugg willst. Mit i widerum kimmst vorwrts. ---> Aynn Faeler schreibt myn nit "Faeeler"; Faeeler ist ayn Faeler Anmrkung: Wenn d Suech s Dauttichtend dyrraicht haat, geet s eyn n Anfang wi- der weiter dyrmit, men Sach dyr Schaltter 'wrapscan' wr auf aus. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 4.3: DE GGNKLAMMERN FINDDN ** Zipf % , um de entsprchete Klammer ) , ] older } z finddn. ** 1. Stz nn Mrkl auf iewign aine von dene drei Klammern ( , [ older { in dyr untignen Zeil, wo mit ---> angmrkt ist. 2. Ietzet zipf s Zaichen % . 3. Dyr Mrkl geet ietz auf de pssete schliessete Klammer. 4. Ietz demmlt % , und dyrmit kimmst gan dyr ffneretn Klammer zrugg. 5. Stz nn Mrkl auf ayn anderne Klammer von ({[]}) und prblt % aus. ---> Ds ( ist bloo ayn Pochzeil ( mit [ verschaidne ] { Klammern } drinn. )) Anmrkung: Um d Mglichkeit gaast bsunders froo sein, wennst aynmaal in aynn Spaichgwort verzweiflt ayn faelete Ggnklammer suechst! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 4.4: D ERSTZUNGSFAUDUNG (substitute) ** Zipf :s/alt/neu/g , um 'alt' durch 'neu' zo n Erstzn. ** 1. Gee mit n Mrkl zo dyr unt steehetn mit ---> angmrktn Zeil. 2. Zipf :s/dee/de . Der Befelh erstzt alsnan grad ds +eerste "dee", wo vrkimmt. 3. Ietz prblt s mit :s/dee/de/g . Ds zuestzliche g ("Pflok" nennt myn bbs Slchers) bewirkt, d allss, was dyrmit kennzaichnet ist, innerhalb von dyr ainn Zeil erstzt werd. ---> Dee schoenste Zeit, d myn dee Blemln anschaut, ist dee schoene Lan- gesszeit. 4. Um ietz allsand Suechbegriff innerhalb von zwo Zeiln zo n ndern, zipf :#,#s/alt/neu/g , wobei # ieweils fr de eerste und lsste Zeil von dnn Pfraich steet. :%s/alt/neu/g zipfst, dst d Vrkemmen in dyr gantzn Dautticht ndertst. Mit :%s/alt/neu/gc finddst allsand Vrkemmen in dyr gsamtn Dautticht; daa werst aber zeerst non gfraagt, obst ys erstzn willst older nity. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZAMMENFASSUNG VON DYR LETZN 4 1. g zaigt dnn ietzundn Dauttichtbefand und nn Darstand dyrvon an. G bringt di an s End von dyr Dautticht. G bringt di gan dyr entsprchetn Zeilnnummer. gg geet +grad yso. gg bringt di zo dyr eerstn Zeil. 2. D Eingaab von / mit aynn Ausdruk suecht VRSHLING um dnn Ausdruk. Gibst ? und aynn Suechbegrif ein, suecht s um dnn RSHLING. Zipf naach ayner Suech n ; naacherd werd in de gleiche Richtung weiter- gsuecht. Mit N geet s umkeerter weiter. o bringt di zo lterne Befndd zrugg, i zo neuerne. 3. D Eingaab von % , wenn dyr Mrkl auf ainer von dene Klammern steet: ({[ )]} , bringt di zo dyr Ggnklammer. 4. Um ds eerste Vrkemmen von "alt" in ayner Zeil durch "neu" z erstzn, zipf :s/alt/neu . Um allsand in ayner Zeil z erstzn, zipf :s/alt/neu/g . Mechst allss in zwo Zeiln erstzn, demmlt zo n Beispil :5,6s/alt/neu/g . Mechst allss in dyr gantzn Dautticht erstzn, gib ein: :%s/alt/neu/g . Willst ayn ieds Maal bstaetln, hng 'c' wie confirm hint anhin. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 5.1: ZWISCHNDRINN AYNN AUSSERIGNEN BEFELH AUSFERN ** Willst ayn Gffaudung ausfern, gib ainfach d sel naach :! ein. ** 1. Zipf dnn bekanntn Befelh : , dyrmitst mit n Mrkl auf n Bildschirm ganz abhin kimmst. Draufhin kanst aynn gwonen Gfbefelh eingbn. 2. Zeerst kimmt aber non ayn Ruefzaichen ! . Und ietzet haast d Mglich- keit, ayn beliebige ausserige Gffaudung auszfern. 3. Als Beispil zipf :!ls ; und schoon haast ayn Auflistung von deinn Verzaichniss, netty wie wennst ganz gwon in n Eingib wrst. Geet ls aus iewign aynn Grund nit, aft prblt s mit :!dir . Also non aynmaal: Mit dnn Angang kan ayn iede beliebige ausserige Faudung aus- gfert werdn, aau mit Auerwerdd. Und wolgmrkt: Alle Befelh, wo mit : angeend, messend mit bst- tigt werdn. Ds dyrsagn myr frba +niemer. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 5.2: NON MEERER DRBER, WIE MYN DAUTTICHTN SCHREIBT ** Um bbs Gnderts neu z speichern, zipf :w NEUER_DAUTTICHTNAM . ** 1. Zipf :!dir older :!ls , dst dyr ayn Auflistung von deinn Verzaich- niss ausherlaasst. Dst drafter eingbn muesst, waisst ee schoon. 2. Suech dyr aynn Dauttichtnam aus, dnn wo s non nit geit, bbenn POCH . 3. Ietz demmlt: :w POCH (also mit POCH als dnn neuen Dauttichtnam). 4. Ds speichert ietz de gantze Dautticht, also nn Wimmschainer, unter dnn Nam POCH. Ds kanst leicht berpreffen, indem dst ainfach :!ls older :!dir zipfst und dyrmit deinn Verzaichnissinhalt seghst. Anmrkung: Stigst ietz aus n Wimm aus und gnnst n aft wider mit vim POCH , naacherd wr d Dautticht ayn gnaune Aamum von n Schainer dyrselbn, wiest n gspeichert haast. 5. Ietz verweitert d Dautticht - fallsst s Fenstl haast - , mit :!del POCH beziehungsweis bei aynn Unixgebu mit :!rm POCH . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 5.3: AYNN TAIL VON N GWORT ZO N SPEICHERN AUSWALN ** Um aynn Tail von dyr Dautticht z speichern, zipf v [Wolend] :w DAUTTICHT ** 1. Ruck nn Mrkl auf netty d Zeil daader. 2. Demmlt v und gee mit n Mrkl auf dnn fmftn Auflistungspunt untet. Du seghst glei, d s Gwort vrherghbt erscheint. 3. Druck s Zaichen : . Ganz unt auf n Bildschirm erscheint :'<,'> . 4. Zipf w POCH , wobei s dnn Dauttichtnam POCH non nit geit. Vergwi di, dst ds :'<,'>w POCH aau +seghst, ee wennst druckst. 5. Dyr Wimm schreibt de ausgwaltn Zeiln eyn de Dautticht POCH einhin. Benutz :!dir older :!ls , dst ds berpreffst. Lsh s fein nit bbenn! Mir brauchend s nmlich fr de naehste Letzn. Anmrkung: Druckt myn v , ginnt d Sichtisch-Auswal. Du kanst mit n Mrkl um- aynandfarn, um d Auswal z verndern. Drafter kan myn mit yn aynn Pfemerer mit dnn Gwort bbs machen. Zo n Beispil lscht d ds Gwort. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 5.4: EINLSN UND ZAMMENFERN VON DAUTTICHTN ** Um nn Inhalt von ayner Dautticht einzlsn, zipf :r DAUTTICHTNAM ** 1. Stz nn Mrkl ber d Zeil daader. OBACHT: Aft dst nn Schrit 2 ausgfert haast, seghst auf aynmaal bbs aus dyr Letzn 5.3. Bewg di naacherd wider abwrts, dyrmitst d Letzn wi- derfinddst. 2. Ietz lis dein Dautticht POCH ein, indem dst d Faudung :r POCH aus- ferst, wobei wie gsait POCH fr dnn von dir ausgsuechtn Dauttichtnam steet. De einglsne Dautticht werd unterhalb dyr Mrklzeil eingfegt. 3. Um zo n berpreffen, ob de Dautticht aau gwi einglsn ist, gee zrugg; und du seghst, d s ietz zwo Ausfrtigungen von dyr Letzn 5.3. geit, s Urniss und de eingfegte Dauttichtfassung. Anmrkung: Du kanst aau d Ausgaab von aynn Ausserigbefelh einlsn. Zo n Bei- spil list :r !ls d Ausgaab von dyr Faudung ls ein und fegt s unterhalb n Mrkl ein. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZAMMENFASSUNG VON DYR LETZN 5 1. :!FAUDUNG fert aynn ausserignen Befelh aus. Daader ayn ttlych gwnddte Beispiler: (Fenstl) (Unix - Linux) :!dir :!ls - listt s Verzaichniss auf. :!del DAUTTICHT :!rm DAUTTICHT - verweitert sele Dautticht. 2. :w DAUTTICHT speichert de ietzunde Wimmdautticht unter dnn besagtn Nam. 3. v WOLEND :w DAUTTICHTNAM schreibt de sichtisch ausgwaltn Zeiln eyn de Dautticht mit seln Nam. 4. :r DAUTTICHTNAM ladt sele Dautticht und fegt s unterhalb n Mrklbefand ein. 5. :r !dir list d Ausgaab von dyr Faudung dir und fegt s unterhalb n Mrklbefand ein. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 6.1: ZEIL FFNEN (open) ** Zipf o , um ayn Zeil unterhalb n Mrkl z ffnen und eyn d ** ** Einfegartweis z kemmen. ** 1. Bewg nn Mrkl zo dyr eerstn mit ---> angmrktn Zeil unt. 2. Zipf o (klain), um ayn Zeil UNTERHALB n Mrkl z ffnen und mit dyr Ein- fegartweis weiterztuen. 3. Ietzet zipf ayn Weeng bbs und druck , um d Einfegartweis z ver- laassn. ---> Mit o werd dyr Mrkl in dyr Einfegartweis auf de offene Zeil gstzt. 4. Um ayn Zeil OBERHALB n Mrkl aufzmachen, gib ainfach ayn groosss O statt yn aynn klainen ein. Versuech ds auf dyr untignen Zeil. ---> ffnet ayn Zeil ber derer daader mit O , wenn dyr Mrkl auf derer Zeil ist. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 6.2: GWORT ANFEGN (append) ** Zipf a , um bbs NAACH n Mrkl einzfegn. ** 1. Bewg nn Mrkl gan n Anfang von dyr eerstn ebungszeil mit ---> unt. 2. Druck e , hinst d dyr Mrkl an n End von Zei steet. 3. Zipf ayn klains a , um bbs NAACH n Mrkl anzfegn. 4. Vergntz ds Wort wie in dyr Zeil drunter. Druck , um d Schreib- Artweis z verlaassn. 5. Bewg di mit e zo n naehstn ungantzn Wort und widerhol d Schritt 3 und 4. ---> D Ze biett ayn Glgn , ayn Gwort in ayner Zeil anzf. ---> D Zeil biett ayn Glgnet, ayn Gwort in ayner Zeil anzfegn. Anmrkung: a , i und A bringend ainn gleichermaan eyn d Einfegartweis; dyr ainzige Unterschaid ist, WO mit n Einfegn angfangt werd. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 6.3: AYN ANDERNE WEIS ZO N ERSTZN (replace) ** Demmlt ayn groosss R , um meerer als wie grad ain Zaichen z erstzn. ** 1. Bewg nn Mrkl zo dyr eerstn untignen, mit ---> angmrktn Zeil. Gee mit n Mrkl gan n Anfang von n eerstn xxx . 2. Ietz druck R und zipf sele Zal, wo drunter in dyr zwaittn Zeil steet, yso d de sel s xxx erstzt. 3. Druck , um d Erstzungsartweis z verlaassn. Du gspannst, d dyr Rest von dyr Zeil unverndert bleibt. 4. fert die Schritt, um ds berblibne xxx z erstzn. ---> S Zunddn von 123 zo xxx ergibt xxx. ---> S Zunddn von 123 zo 456 ergibt 579. Anmrkung: D Erstzungsartweis ist wie d Einfegartweis, aber ayn ieds eindem- mlte Zaichen lscht ayn vorhanddns. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 6.4: GWORT AAMEN UND EINFEGN ** Benutz nn Pfemerer y , um bbs z aamen, und p , um bbs einzfegn. ** 1. Gee zo dyr mit ---> angmrktn Zeil unt und stz nn Mrkl hinter "a)". 2. Ginn d Sichtisch-Artweis mit v und bewg nn Mrkl gnaun vor "eerste". 3. Zipf y , um dnn vrherghbtn Tail z aamen. 4. Bewg nn Mrkl gan n End von dyr naehstn Zeil: j$ 5. Demmlt p , um ds Gwort einzfegn, und aft: a zwaitte . 6. Benutz d Sichtischartweis, um " Eintrag." auszwaln, aam s mittls y , be- wg di gan n End von dyr naehstn Zeil mit j$ und feg s Gwort dortn mit p an. ---> a) ds ist dyr eerste Eintrag. b) Anmrkung: Du kanst y aau als Pfemerer verwenddn; yw zo n Beispil aamt hinst eyn n naehstn Wortanfang (aane dnn selber). ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 6.5: SCHALTTER STZN ** Stz aynn Schaltter yso, d ayn Suech older Erstzung Groo- und Klain- ** ** schreibung bergeet. ** 1. Suech um 'bergee", indem dst /bergee eingibst. Widerhol d Suech ayn ttlych Maal, indem dst de Tastn n druckst. 2. Stz de Zwisl - nn Schaltter - 'ic' (ignore case), indem dst :set ic eingibst. 3. Ietz suech wider um 'bergee' und tue aau wider mit n weiter. Daa fallt dyr auf, d ietz bbenn aau bergee und BERGEE hergeet. 4. Stz de Zwisln 'hlsearch' und 'incsearch' pfelfs: :set hls is 5. Widerhol d Suech und bobacht, was ietz gschieght: /bergee 6. Dst groo und klain wider gwon unterscheidst, zipf: :set noic Anmrkung: Mechst de Trffer niemer vrherghbt seghn, gib ein: :nohlsearch Anmrkung: Sollt klain/groo bei ayner ainzignen Suech wurst sein, benutz \c in n Suechausdruk: /bergee\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZAMMENFASSUNG VON DYR LETZN 6 1. Zipf o , um ayn Zeil UNTERHALB n Mrkl z ffnen und d Einfegartweis z ginnen. Zipf O , um ayn Zeil OBERHALB n Mrkl z ffnen. 2. Zipf a , um NAACH n Mrkl ayn Gwort einzfegn. Zipf A , um ayn Gwort naach n Zeilnend anzfegn. 3. D Faudung e bringt di gan n End von aynn Wort. 4. Dyr Pfemerer y (yank) aamt bbs, p (put) fegt ds ein. 5. Ayn groosss R geet eyn d Erstzungsartweis, hinst d myn druckt. 6. D Eingaab von ":set xxx" stzt de Zwisl "xxx". Ayn ttlych Zwisln seind: 'ic' 'ignorecase' Groo/klain wurst bei ayner Suech 'is' 'incsearch' Zaig aau schoon ayn Tailberainstimmung 'hls' 'hlsearch' Hb allsand pssetn Ausdrck vrher Dyr Schaltternam kan in dyr Kurz- older Langform angbn werdn. 7. Stll yn ayner Zwisl "no" voran, dst ys abschalttst: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 7.1: AYN HILFGWORT AUFRUEFFEN ** Nutz ds einbaute Hilfgebu, de "Betribsanlaittung". ** Eyn n Wimm ist ayn ausferliche "Gebrauchsanweisung" einbaut. Fr s Eerste prblt ainfach ains von dene dreu aus: - Druck d -Tastn, wennst bbenn aine haast. - Druck de Tastn , fallsst ys haast. - Zipf :help Lis di eyn s Hilffenster ein, dyrmitst draufkimmst, wie ds mit dyr Hilf geet. Demmlt w w , um von ainn Fenster zo n andern zo n Springen. Demmlt :q , um s Hilffenster zo n Schliessn. Du kanst zo so guet wie allssand ayn Hilf finddn, indem dst yn dyr Faudung :help aynn Auerwerd naachstllst und istig nit vergisst. Prblt ds: :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 7.2: ERSTLL AYN GIN-SCHRIPF ** Mutz nn Wimm mit de einbautn Faehigkeitn auf. ** Dyr Wimm besitzt ayn Wsn Schftungen, wo ber n Urwimm aushingeend, aber de meerern dyrvon seind in dyr Vorgaab ausgschaltt. Dyrmitst meerer aus n Wimm ausherholst, erstllst ayn "vimrc"-Dautticht. 1. Lg ayn "vimrc"-Dautticht an; ds geet ie naach Betribsgebu verschidn: :e ~/.vimrc fr s Unix :e $VIM/_vimrc bei n Fenstl 2. Ietz lis nn Inhalt von dyr Beispil-"vimrc"-Dautticht ein: :r $VIMRUNTIME/vimrc_example.vim 3. Speichert de Dautticht mit: :w 4. Bei n naehstn Gin von n Wimm ist aft d Fegnussvrherhbung zuegschalttn. Du kanst dyr allss eyn d Dautticht einhinschreibn, wasst bstndig habn willst. Meerer dyrzue erfarst unter: :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 7.3: VERGNTZN ** Befelhszeilnvergntzung mit d und ** 1. Vergwi di, d dyr Wimm nit auf n Urwimm-"Glais" fart: :set nocp 2. Schaug naach, wlcherne Dauttichtn d s in n Verzaichniss geit: :!ls older :!dir 3. Zipf nn Anfang von ayner Faudung: :e 4. Druck d , und dyr Wimm zaigt ayn Listn von Faudungen, wo mit "e" angeend. 5. Druck , und dyr Wimm vervollstndigt nn Faudungsnam zo ":edit". 6. Feg ayn Laerzaichen und nn Anfang von ayner besteehetn Dautticht an: :edit DAU 7. Druck . Dyr Wimm vergntzt nn Nam, ds haisst, wenn yr aindeuttig ist. Anmrkung: D Vergntzung geit s fr aynn Hauffen Faudungen. Versuech ainfach d und . Bsunders ntzlich ist ds bei :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZAMMENFASSUNG VON DYR LETZN 7 1. Zipf :help oder druck oder , um ayn Hilffenster z ffnen. 2. Zipf :help FAUDUNG , um auf ayn Hilf gan aynn Befelh z kemmen. 3. Zipf w w , um zo n andern Fenster z springen. 4. Zipf :q , um s Hilffenster z schliessn. 5. Erstll ayn vimrc-Ginschripf zuer Sicherung von deine Mtzneinstllungen. 6. Druck d , aft dst naach : ayn Faudung angfangt haast, dyr- mitst mgliche Vergntzungen anzaigt kriegst. Druck fr ain Vervollstndigung yllain. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ds wr ietzet s End von n Wimmschainer. Gangen ist s daa drum, aynn kurtzn und bndignen berblik ber s Blat WIMM z lifern, netty vil gnueg, d myn fr s Eerste wirklich bbs dyrmit anfangen kan. Dyrmit ist s aber auf kain Weitn non nit taan; dyr Wimm haat schoon non vil meerer auf Lager. Lis als Naehsts aynmaal s Benutzerhandbuech: :help user-manual Zo n Weiterlsn und Weiterlernen wr ds Buech daader zo n Empfelhen: Vim - Vi Improved - von n OUALLINE Steve Verlaag: New Riders Ds ist ds eerste Buech, wo ganz yn n Wimm gwidmt ist, netty ds Grechte fr Anfnger. Es haat ayn Wsn Beispiler und aau Bilder drinn. See http://iccf-holland.org/click5.html Ds folgete Buech ist schoon lter und meerer ber n Urwimm als wie ber n Wimm, aber aau zo n Empfelhen: Textbearbeitung mit dem vi-Editor - von dyr LAMB Linda und n ROBBINS Arnold - Verlaag O'Reilly - Buechlaittzal (ISBN): 3897211262 In dnn Buech kan myn fast allss finddn, was myn mit n Urwimm angeen mecht. De sxte Ausgaab enthaltt aau schoon bbs ber n Wimm. Als ietzunde Bezugniss fr d Fassung 7 und ayn pfrenge Einferung dient ds folgete Buech: vim ge-packt von n WOBST Reinhard mitp-Verlaag, Buechlaittzal 978-3-8266-1781-2 Trotz dyr recht pfrengen Darstllung ist s durch seine viln ntzlichnen Bei- spiler aau fr Einsteiger grad grecht. Probhaeupster und de Beispilschripfer seind zesig zo n Kriegn; see http://iccf-holland.org/click5.html Verfasst habnd dnn Schainer dyr PIERCE Michael C. und WARE Robert K. von dyr Kolraader Knappnschuel (Colorado School of Mines). Er beruet auf Entwrff, wo dyr SMITH Charles von dyr Kolraader Allschuel (Colorado State University) zuer Verfegung gstllt haat. Gundpost: bware@mines.colorado.edu Fr n Wimm haat n dyr MOOLENAAR Bram barechtt. De bairische berstzung stammt von n HELL Sepp 2009, ayn Weeng berarechtt 2011. Sein Gundpostbrcht ist sturmibund@t-online.de ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim-7.4.1689/runtime/tutor/tutor.bar.utf-8000066400000000000000000001215651267703067000202540ustar00rootroot00000000000000=============================================================================== = G o t i k a m i n n W I M M - S c h a i n e r - Fassung 1.7 = =============================================================================== Dyr Wimm ist ayn gro mächtigs Blat, dös was mit aynn Wösn Befelh aufwartt; z vil, däß myn s allsand in aynn Schainer wie dönn daader unterbräng. Der Schainer ist yso aufbaut, däß yr halt netty die Befelh allsand bringt, wost brauchst, däßst mit iem für s Eerste wirklich öbbs anfangen kanst. Durchhinarechtn kanst di, wennst willst, in ayner halbetn Stund; dös haisst, wennst di nit grooß mit n Pröbln und Tüftln aufhaltst. OBACHT: Die Faudungen, wost daader finddst, gaand istig s Gwort öndern. Dösswögn machst eyn n Böstn glei ayn Aamum von derer Dautticht daader. Haast alsnan dös Gwort daader mit n Befelh "vimtutor bar" ausherlaassn, ist s ee schoon ayn Aamum. Mir kan s nit oft gnueg sagn, däß der Schainer daader istig gan n Üebn ghoert. Also muesst schoon aau die Befelh +ausfüern, wennst ys gscheid ler- nen willst. Mit n Lösn yllain ist s +nit taan! Ietz schaust grad non, däß dein Föststölltastn nit druckt ist; und aft geest glei aynmaal mit dyr j-Tastn abwärts (yso laaufft dös nömlich), hinst däßst de gantze Letzn 1.1 auf n Bildschirm haast. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 1.1: MIT N MÖRKL UMAYNANDFARN ** Dyrmitst mit n Mörkl umaynandkimmst, druck h, j, k und l wie unt zaigt. ** ^ Ayn Öslsbrugg: k De Tastn h ist winster und +geet aau gan winster. < h l > S l leit zesm und richtt si gan zesm. j S j kan myn wie aynn Pfeil gan unt seghn. v Mit n k kimmst gan n KOPF. 1. Ietz ruedertst ainfach mit n Mörkl auf n Bildschirm umaynand, hinst däßst di sicher füelst. 2. Halt d Abhin-Tastn (j) druckt; aft rumplt s ainfach weiter. Netty yso kimmst gan dyr naehstn Letzn. 3. Wie gsait, ietz bewögst di also mit derer Tastn gan dyr Letzn 1.2. Non öbbs: Allweil, wenn dyr niemer ganz wol ist, wasst öbbenn druckt haast, aft zipfst ; naacher bist wider ganz gwon in dyr Befelhs-Artweis. Nöbnbei gsait kimmst gwonerweil aau mit de Pfeiltastnen weiter. Aber hjkl seind z haissn s Wimm-Urgstain; und de "Hörtn" seind ganz dyr- für, däß myn bei +dene bleibt. Pröblt s ainfach aus! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 1.2: ÖNN WIMM AUSSCHALTTN ALSO, EE WENNST ÖBBS VON DAA UNT AUSFÜERST, LIS LIEBER ZEERST DE GANTZE LET- ZN! 1. Druck d -Tastn, dyrmitst aau gwiß in dyr Befelhs-Artweis bist. 2. Demmlt :q! . Daa dyrmit benddst ys Blat und verwirffst allss, wasst öbbenn göndert haast. 3. Balst önn Eingib seghst, gib dö Faudung ein, wo di zo dönn Schainer brun- gen haat, also vimtutor bar . 4. Also, wenn ietz allsse sitzt, naacherd füerst d Schritt 1 hinst 3 aus, mit wasst ys Blat verlaasst und aft wider einhinkimmst. Anmörkung: Mit :q! verwirffst allss, wasst göndert older enther gschribn haast. In aynn Öttlych Letznen lernst acht, wiest dös allss in ayner Dautticht speichertst. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 1.3: GWORT BARECHTN - LÖSCHN ** Druck x , dyrmitst dös Zaichen unter n Mörkl löschst. ** 1. Bewög di mit n Mörkl auf de mit ---> angmörkte Zeil unt. 2. Zo n Faeler Verbössern farst mit n Mörkl netty auf dös Zaichen, dös wo glöscht ghoert. 3. Druck de Tastn x , däßst dös überflüssige Zaichen löschst. 4. Ietz tuest so lang weiter mit 2 hinst 4, hinst däß dyr Saz stimmt. ---> De Kkuue sprangg übber nn Maanad. 5. Wenn ietz de Zeil verbössert ist, geest gan dyr Letzn 1.4. weiter. Und ganz wichtig: Dyrweilst dönn Schainer durcharechtst, versuech nit öbbenn, allss auswendig z lernen; nän, lern ainfach mit n Anwenddn! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 1.4: GWORT BARECHTN - EINFÜEGN ** Druck i , dyrmitst öbbs einfüegst. ** 1. Bewög önn Mörkl zo dyr eerstn untignen Zeil, wo mit ---> angeet. 2. Dyrmitst de eerste Zeil wie de zwaitte machst, bewög önn Mörkl auf dös eerste Zaichen NAACH derer Stöll, daa wo s Gwort eingfüegt werdn sollt. 3. Druck i und gib dös ein, was abgeet. 4. Wenn ieweils ayn Faeler verweitert ist, aft druck ; dyrmit kimmst gan dyr Befelhsartweis zrugg. So, und ietz tuest ainfach yso weiter, hinst däß dyr Saz stimmt. ---> Daader gt dd öbbs b. ---> Daader geet diend öbbs ab. 5. Balst mainst, däßst ys Gwort-Einfüegn kanst, aft geest gan dyr Letzn 1.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 1.5: GWORT BARECHTN - ANFÜEGN ** Druck A gan n Gwort Anfüegn. ** 1. Gee mit n Mörkl gan dyr eerstn untignen Zeil, wo ayn ---> dyrvor haat. Daa ist s gleich, wo gnaun dyr Mörkl in derer Zeil steet. 2. Demmlt A und gib de entspröchetn Ergöntzungen ein. 3. Wennst mit n Anfüegn förtig bist, aft druckst , däßst wider eyn de Befelhsartweis zruggkimmst. 4. So, und ietz geest aft non gan dyr zwaittn mit ---> angmörktn Zeil; und daadl machst ys netty yso. ---> In derer Zeil gee In derer Zeil geet ayn Weeng ayn Gwort ab. ---> Aau daader stee Aau daader steet öbbs Unvollstöndigs. 5. Wennst s Anfüegn von Gwort drauf haast, naacherd gee gan dyr Letzn 1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 1.6: AYN DAUTTICHT BARECHTN ** Mit :wq speichertst ayn Dautticht und verlaasst önn Wimm ganz. ** !! OBACHT: Ee wennst mit dönn alln daa unt weitertuest, lis zeerst de gantze Letzn durch!! 1. Verlaaß also s Blat, wie s in dyr Letzn 1.2. haisst, mit :q! ! 2. Gib dö Faudung eyn n Eingib ein: vim Schainer . 'vim' ruefft s Blat auf, und 'Schainer' haisst de Dautticht, wost barechtn willst. Dyrmit haast also ayn Dautticht, dö wost barechtn kanst. 3. Ietz füegst öbbs ein older löschst öbbs, wiest ys in de vorignen Letznen glernt haast. 4. Speichert de gönderte Dautticht und verlaaß önn Wimm mit :wq . 5. Schmeiß önn Wimmschainer neu an und gee gan dyr folgetn Zammenfassung. 6. Aft däßst de obignen Schritt glösn und käppt haast, kanst ys durchfüern. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZAMMENFASSUNG VON DYR LETZN 1 1. Dyr Mörkl werd mit de Tastnen hjkl older aau mit de Pfeiltastnen gsteuert. h (winst) j (ab) k (auf) l (zes) 2. Um önn Wimm umbb n Eingib aus z ginnen, demmlt: vim DAUTTICHT . 3. Willst önn Wimm verlaassn und aau allss verwerffen, aft gibst ein: und :q! . Gan n Verlaassn und Speichern aber zipfst und :wq . 4. Willst dös Zaichen löschn, daa wo dyr Mörkl drauf ist, demmltst x . 5. Willst öbbs vor n Mörkl eingöbn, zipfst i und drafter . Mechst ys aber eyn s Zeilnend anhinhöngen, benutzt ys A . Und ainfach naach n Mörkl füegst ys mit a ein. Anmörkung: Druckst , kimmst eyn de Befelhsartweis zrugg older brichst ayn Faudung ab, dö wo dyr schiefgangen ist. Ietz tue mit dyr Letzn 2 weiter. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 2.1.: LÖSHFAUDUNGEN ** Demmlt dw , dyrmitst ayn Wort löschst. ** 1. Druck , dyrmit s aau gwiß ist, däßst in dyr Befelhsartweis bist. 2. Bewög önn Mörkl zo dyr mit ---> angmörktn Zeil unt. 3. Und daa geest ietz auf n Anfang von aynn Wort, dös wo glöscht ghoert. 4. Zipf dw , däßst dös gantze Wort löschst. Nöbnbei: Dyr Buechstabn d erscheint auf dyr lösstn Zeil von n Bildschirm, sobaldst n eingibst. Dyr Wimm wartt ietz drauf, däß öbbs kimmt, al- so daader ayn w . Seghst freilich öbbs Anderts wie ayn d , naacherd haast öbbs Falschs demmlt. Druck aft und pröblt s non aynmaal. ---> Ayn Öttlych Wörter lustig ghoernd nit Fisper eyn dönn Saz einhin. 5. Äfert d Schritt 3 und 4, hinst däß dyr Saz pässt, und gee aft gan dyr Letzn 2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 2.2.: NON MEERER LÖSHFAUDUNGEN ** Gib d$ ein, däßst hinst eyn s Zeilnend löschst. ** 1. Druck , dyrmitst aau gwiß in dyr Befelhsartweis bist. 2. Bewög önn Mörkl hinst eyn de mit ---> angmörkte Zeil untn. 3. Gee mit n Mörkl auf s End von dyr faelerfreien Zeil, NAACH n eerstn . . 4. Zipf d$ , däßst hinst eyn s End von dyr Zeil löschst. ---> Öbber haat s End von dyr Zeil doplt eingöbn. doplt eingöbn. 5. Gee weiter gan dyr Letzn 2.3, dyrmitst versteest, was daader ablaaufft. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 2.3: PFEMERER UND WOLENDER Vil Faudungen, wo s Gwort öndernd, sötznd si aus aynn Pfemerer und aynn Wo- lend zamm. Bal i also öbbs löschn will, schreib i ainsting d und aft s "Wo- lend", dös haisst also, "wolend", "wohin" däß i will - older was i halt gnaun löschn will. Daader also, was i wie löschn kan: w - hinst eyn n Anfang von n naehstn Wort AANE dönn sein eersts Zaichen. e - gan n End von n ietzundn Wort MIT dönn seinn lösstn Zaichen. $ - zo n End von dyr Zeil MIT derer irn lösstn Zaichen. Also löscht de Tastnfolg de allss umbb n Mörkl hinst eyn s Wortend. Anmörkung: Gib i grad dös zwaitte Zaichen yllain ein, ruckt halt dyr Mörkl entspröchet weiter. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 2.4: MIT AYNN ZÖLER D WOLENDER ÄFERN ** Gib i ayn Zal vor aynn Wolend ein, werd dös Sel entspröchet oft gangen. ** 1. Bewög önn Mörkl gan n Anfang von dyr Zeil mit ---> dyrvor unt. 2. Zipf 2w , däßst mit n Mörkl zwai Wörter weitergeest. 3. Zipf 3e , däßst mit n Mörkl auf s End von n drittn Wort kimmst. 4. Zipf 0 (aynn Nuller), däßst eyn n Anfang von dyr Zeil hinkimmst. 5. Widerhol d Schritt 2 und 3 mit verschaidne Zöler. ---> Dös ist ietz grad ayn Zeil zo n drinn Umaynanderruedern. 6. Gee weiter gan dyr Letzn 2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 2.5: DURCH AYNN ZÖLER GLEI MEERER LÖSCHN ** Ayn Zal vor aynn Pfemerer füert dönn entspröchet oft aus. ** Also, i mecht löschn, und zwaar öbbs Bestimmts, und dös so und so oft: Daa dyrzue benutz i aynn Zöler: d Zöler Wolend (also önn Bewögungsschrit) 1. Bewög önn Mörkl zo n eerstn Wort in GROOSSBUECHSTABN in dyr mit ---> an- gmörktn Zeil. 2. Demmlt d2w , dyrmitst de ganz grooßgschribnen Wörter löschst. 3. Äfert d Schritt 1 und 2 mit dönn entspröchetn Zöler, dyrmitst de drauf- folgetn ganz großgschribnen Wörter mit ayner ainzignen Faudung löschst: ---> Dö ABC DE Zeil FGHI JK LMN OP mit Wörter ist Q RS TUV ietz berichtigt. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 2.6: ARECHTN AUF ZEILN ** Zipf dd , um ayn gantze Zeil z löschn. ** Weil s gro oft vürkimmt, däß myn gantze Zeiln löscht, kaamend schoon d Ent- wickler von n Urwimm daa drauf, däß myn ainfach dd gan dönn Zwök schreibt. 1. Bewög önn Mörkl gan dyr zwaittn Zeil in n untignen "Gedicht". 2. Zipf dd , um dö Zeil z löschn. 3. Ietz bewögst di gan dyr viertn Zeil. 4. Zipf 2dd , um zwo Zeiln zo n Löschn. ---> 1) Roosn seind root; ---> 2) Drunter ist s Koot. ---> 3) Veigerln seind blau. ---> 4) Umgrabn tuet s d Sau. ---> 5) D Ur sait de Zeit, ---> 6) Sait, däß s mi freut, ---> 7) Dirndl, dein Gschau. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 2.7: RUGGGÖNGIG MACHEN (RUGGLN) ** Zipf u , dyrmitst de lösstn Faudungen ruggltst ** ** older U , um ayn gantze Zeil widerherzstölln. ** 1. Bewög önn Mörkl gan dyr mit ---> angmörktn Zeil unt und gee dyrmit auf n eerstn Faeler. 2. Zipf x , däßst dös eerste z vile Zaichen löschst. 3. Ietz demmlt u , dyrmitst de lösste Faudung ruggltst. 4. Ietz behöb allsand Faeler auf dyr Zeil mit dyr Hilf von n Befelh x . 5. Aft gibst ayn U (grooß) ein, däßst de Zeil wider yso hinbringst, wie s gwösn ist. 6. So, und ietz demmltst so oft u , hinst däßst s U und de andern Fau- dungen rugggöngig gmacht haast. 7. Und ietzet widerum schreibst so oft r , hinst däßst allsand Be- felh widerhergstöllt, z haissn allsse rugg-grugglt haast (also d Rugggön- gigmachungen rugggöngig gmacht). ---> Beerichtig d Faeller voon dehrer Zeiil und sttöll s mitt n Ruggruggln wi- der her. 8. Die Faudungen seind gro wichtig; sö helffend ainn närrisch weiter. Ietz gee weiter gan dyr Zammenfassung von dyr Letzn 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZAMMENFASSUNG VON DYR LETZN 2 1. Um von n Mörkl aus hinst eyn s naehste Wort zo n Löschn, zipf: dw 2. Um umbb n Mörkl hinst eyn s End von dyr Zeil zo n Löschn, demmlt d$ 3. Dyrmitst ayn gantze Zeil löschst, gib ein: dd 4. Mechst ayn Bewögung, ayn "Wolend", öfters, stöll de entspröchete Zal dyr- vor: 3dw older aau: d3w 5. Dyr Pfueg für ayn Önderungsfaudung lautt yso: Pfemerer [Zal] Bewögungsschrit (Wolend) Und dös haisst: Dyr PFEMERER gibt an, WAS taan ghoert, öbbenn d = löschn (»delete«). [ZAL] - Ayn Zal KAN myn angöbn, wenn myn halt ayn Wolend öfter habn will. S WOLEND, also dyr Schrit WOHIN, besagt, auf was i aushin will, öbbenn auf aynn Wortanfang ( w ), s End von dyr Zeil ( $ ) und so weiter. 6. Däßst eyn n Anfang von dyr Zeil hinkimmst, schreib aynn Nuller: 0 7. Um öbbs Vorigs wider z ruggln, gib ein: u (klain also) Um allsand Önderungen in ayner Zeil z ruggln, haast: U (also grooß) Um "rugg-z-ruggln", also allss wider herzstölln, zipf: r ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 3.1: ANFÜEGN (»put«) ** Zipf p , dyrmitst öbbs gnetty Glöschts naach n Mörkl anfüegst. ** 1. Bewög önn Mörkl gan dyr eerstn untignen Zeil mit ---> dyrvor. 2. Zipf dd , um sele Zeil z löschn und dyrmit in ayner Wimm-Osn zo n Spei- chern. 3. Bewög önn Mörkl gan dyr Zeil c), ÜBER derer, daa wo de glöschte Zeil ein- hinkemmen sollt. 4. So, und ietz gibst ainfach p ein, und schoon haast dö Zeil unter derer mit n Mörkl drinn. 5. Äfert d Schritt 2 hinst 4, hinst däßst allsand Zeiln yso naachynaynand haast, wie s hinghoernd. ---> d) Kanst du dös aau? ---> b) Veigerln seind blau. ---> c) Bedachtn kan myn lernen. ---> a) Roosn seind root. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 3.2: ERSÖTZN (»replace«) ** Zipf rx , um dös Zaichen unter n Mörkl durch x z ersötzn. ** 1. Bewög önn Mörkl zo dyr eerstn untignen Zeil mit ---> dyrvor. 2. Bewög önn Mörkl, hinst däß yr auf n eerstn Faeler steet. 3. Zipf r und drafter dös Zaichen, wo dyrfür daa hinghoert. 4. Widerhol d Schritt 2 und 3, hinst däßst de eerste Zeil gmaeß dyr zwaittn berichtigt haast: ---> Wie dö Zeit eingobn wurd, wurdnd ainike falsche Zastnen zipft! ---> Wie dö Zeil eingöbn wurd, wurdnd ainige falsche Tastnen zipft! 5. Ietz tue mit dyr Letzn 3.3 weiter. Anmörkung: Vergiß nit drauf, däßst mit n Anwenddn lernen solltst und nit öbbenn mit n Auswendiglernen! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 3.3: ÖNDERN (»change«) ** Um hinst eyn s Wortend z öndern, zipf ce . ** 1. Gee mit n Mörkl auf de eerste mit ---> angmörkte Zeil. 2. Ietz farst netty auf s "s" von Wstwr hin. 3. Zipf ce ein und aft d Wortberichtigung, daader also örter . 4. Druck und bewög önn Mörkl zo n naehstn Zaichen, wo göndert ghoert. 5. Äfert d Schritt 3 und 4, hinst däß dyr eerste Saz wie dyr zwaitte ist. ---> Ainige Wstwr von derer Zlww ghhnnd mit n Öndern-Pfemerer gaauu. ---> Ainige Wörter von derer Zeil ghoernd mit n Öndern-Pfemerer göndert. ce löscht also s Wort und schlaaufft di eyn d Eingaab-Artweis. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 3.4.: NON MEERER ÖNDERUNGEN PFELFS c ** D Löshfaudung c arechtt mit de nömlichnen Wolender wie dö mit d ** 1. Dyr Önder-Pfemerer arechtt anleich wie d Löshfaudung mit d , und zwaar yso: c [Zal] Bewögungsschrit (Wolend) 2. D Wolender seind de gleichn, öbbenn w für Wort und $ für s Zeilnend. 3. Bewög di zo dyr eerstn untignen Zeil mit ---> . 4. Ietz geest auf dönn eerstn Faeler. 5. Zipf c$ , gib önn Rest von dyr Zeil wie in dyr zwaittn ein und druck aft . ---> S End von derer Zeil sollt an de zwaitte daader anglichen werdn. ---> S End von derer Zeil sollt mit n Befelh c$ berichtigt werdn. Denk allweil dran, däßst iederzeit mit dyr Ruggtastn Faeler ausbössern kanst. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZAMMENFASSUNG VON DYR LETZN 3 1. Um ayn vorher glöschts Gwort anzfüegn, zipf p . Daa dyrmit werd dös gantze Gwort NAACH n Mörkl angfüegt. Wenn s ayn gantze Zeil gwösn ist, werd dö sel als de Zeil unterhalb n Mörkl eingfüegt. 2. Um dös Zaichen unter n Mörkl, also wo dyr Mörkl ist, z ersötzn, zipf r und aft dös Zaichen, wost daadl habn willst. 3. Dyr Önderungspfemerer ( c = »change«) laasst ainn umbb n Mörkl hinst eyn s End von n Wolend öndern. Zipf ce , dyrmitst umbb n Mörkl hinst eyn s End von n Wort öndertst, und c$ hinst eyn s End von dyr Zeil. 4. Für d Önderung lautt dyr Pfueg: c [Zal] Wolend Ietz tue mit dyr naehstn Letzn weiter. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 4.1: MÖRKLSTÖLLUNG UND DAUTTICHTDARSTAND ** Demmlt g, däßst önn Befand und Darstand von dyr Dautticht anzaigst. ** ** Zipf G , dyrmitst auf ayn bestimmte Zeil in dyr Dautticht hinkimmst. ** Anmörkung: Lis dö gantze Letzn daader durch, ee wennst iewign öbbs unternimmst! 1. Druck g . Auf dös hin erscheint auf derer Seitt ganz unt ayn Dar- standsmeldung mit n Dauttichtnam und n Befand innerhalb dyr Dautticht. Mörk dyr de Zeilnnummer für n Schrit 3. Anmörkung: Müglicherweis seghst aau önn Mörklbefand in n zesmen untern Bild- schirmögg. Aft ist s "Lindl" (»ruler«) eingstöllt; meerer über dös laasst dyr dyr Befelh :help 'ruler' ausher. 2. Druck G , um an s End von dyr Dautticht z kemmen. gg gibst ein, däßst gan n Anfang von dyr Dautticht aufhinkimmst. 3. Gib d Nummer von derer Zeil ein, daa wost vorher warst, und aft non G . Dös bringt di zrugg gan seler Zeil, daa wost stuenddst, wiest dös eerste Maal g gadruckst. 4. Wennst di sicher gnueg füelst, aft füer d Schritt 1 hinst 3 aus. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 4.2: DYR BEFELH ZO N SUECHEN ** Zipf / und dyrnaach aynn Ausdruk, um selbignen zo n Suechen. ** 1. Du gibst also in dyr Befelhsartweis s Zaichen / ein. Dös sel wie aau dyr Mörkl erscheinend drauf unt auf n Schirm, netty wie bei dyr Faudung : . 2. Ietz zipf Faeeler . Netty um dös 'Faeeler' willst ietz suechen. 3. Willst um gnaun dönn Ausdruk weitersuechen, zipf ainfach n (wie »next«). Willst hinzrugg suechen, aft gibst N ein. 4. Um von Haus aus zruggaus z suechen, nimm ? statt / her. 5. Dyrmitst wider daa hinkimmst, wost herkemmen bist, nimm o , und dös öfter, wennst weiter zrugg willst. Mit i widerum kimmst vorwärts. ---> Aynn Faeler schreibt myn nit "Faeeler"; Faeeler ist ayn Faeler Anmörkung: Wenn d Suech s Dauttichtend dyrraicht haat, geet s eyn n Anfang wi- der weiter dyrmit, men Sach dyr Schaltter 'wrapscan' wär auf aus. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 4.3: DE GÖGNKLAMMERN FINDDN ** Zipf % , um de entspröchete Klammer ) , ] older } z finddn. ** 1. Sötz önn Mörkl auf iewign aine von dene drei Klammern ( , [ older { in dyr untignen Zeil, wo mit ---> angmörkt ist. 2. Ietzet zipf s Zaichen % . 3. Dyr Mörkl geet ietz auf de pässete schliessete Klammer. 4. Ietz demmlt % , und dyrmit kimmst gan dyr öffneretn Klammer zrugg. 5. Sötz önn Mörkl auf ayn anderne Klammer von ({[]}) und pröblt % aus. ---> Dös ( ist blooß ayn Pochzeil ( mit [ verschaidne ] { Klammern } drinn. )) Anmörkung: Um dö Müglichkeit gaast bsunders froo sein, wennst aynmaal in aynn Spaichgwort verzweiflt ayn faelete Gögnklammer suechst! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 4.4: D ERSÖTZUNGSFAUDUNG (»substitute«) ** Zipf :s/alt/neu/g , um 'alt' durch 'neu' zo n Ersötzn. ** 1. Gee mit n Mörkl zo dyr unt steehetn mit ---> angmörktn Zeil. 2. Zipf :s/dee/de . Der Befelh ersötzt alsnan grad dös +eerste "dee", wo vürkimmt. 3. Ietz pröblt s mit :s/dee/de/g . Dös zuesötzliche g ("Pflok" nennt myn öbbs Sölchers) bewirkt, däß allss, was dyrmit kennzaichnet ist, innerhalb von dyr ainn Zeil ersötzt werd. ---> Dee schoenste Zeit, däß myn dee Blüemln anschaut, ist dee schoene Lan- gesszeit. 4. Um ietz allsand Suechbegriff innerhalb von zwo Zeiln zo n Öndern, zipf :#,#s/alt/neu/g , wobei # ieweils für de eerste und lösste Zeil von dönn Pfraich steet. :%s/alt/neu/g zipfst, däßst d Vürkemmen in dyr gantzn Dautticht öndertst. Mit :%s/alt/neu/gc finddst allsand Vürkemmen in dyr gsamtn Dautticht; daa werst aber zeerst non gfraagt, obst ys ersötzn willst older nity. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZAMMENFASSUNG VON DYR LETZN 4 1. g zaigt dönn ietzundn Dauttichtbefand und önn Darstand dyrvon an. G bringt di an s End von dyr Dautticht. G bringt di gan dyr entspröchetn Zeilnnummer. gg geet +grad yso. gg bringt di zo dyr eerstn Zeil. 2. D Eingaab von / mit aynn Ausdruk suecht VÜRSHLING um dönn Ausdruk. Gibst ? und aynn Suechbegrif ein, suecht s um dönn ÄRSHLING. Zipf naach ayner Suech n ; naacherd werd in de gleiche Richtung weiter- gsuecht. Mit N geet s umkeerter weiter. o bringt di zo ölterne Befändd zrugg, i zo neuerne. 3. D Eingaab von % , wenn dyr Mörkl auf ainer von dene Klammern steet: ({[ )]} , bringt di zo dyr Gögnklammer. 4. Um dös eerste Vürkemmen von "alt" in ayner Zeil durch "neu" z ersötzn, zipf :s/alt/neu . Um allsand in ayner Zeil z ersötzn, zipf :s/alt/neu/g . Mechst allss in zwo Zeiln ersötzn, demmlt zo n Beispil :5,6s/alt/neu/g . Mechst allss in dyr gantzn Dautticht ersötzn, gib ein: :%s/alt/neu/g . Willst ayn ieds Maal bstaetln, höng 'c' wie »confirm« hint anhin. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 5.1: ZWISCHNDRINN AYNN AUSSERIGNEN BEFELH AUSFÜERN ** Willst ayn Gfäßfaudung ausfüern, gib ainfach dö sel naach :! ein. ** 1. Zipf dönn bekanntn Befelh : , dyrmitst mit n Mörkl auf n Bildschirm ganz abhin kimmst. Draufhin kanst aynn gwonen Gfäßbefelh eingöbn. 2. Zeerst kimmt aber non ayn Ruefzaichen ! . Und ietzet haast d Müglich- keit, ayn beliebige ausserige Gfäßfaudung auszfüern. 3. Als Beispil zipf :!ls ; und schoon haast ayn Auflistung von deinn Verzaichniss, netty wie wennst ganz gwon in n Eingib wärst. Geet ls aus iewign aynn Grund nit, aft pröblt s mit :!dir . Also non aynmaal: Mit dönn Angang kan ayn iede beliebige ausserige Faudung aus- gfüert werdn, aau mit Auerwerdd. Und wolgmörkt: Alle Befelh, wo mit : angeend, müessend mit bstö- tigt werdn. Dös dyrsagn myr fürbaß +niemer. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 5.2: NON MEERER DRÜBER, WIE MYN DAUTTICHTN SCHREIBT ** Um öbbs Gönderts neu z speichern, zipf :w NEUER_DAUTTICHTNAM . ** 1. Zipf :!dir older :!ls , däßst dyr ayn Auflistung von deinn Verzaich- niss ausherlaasst. Däßst drafter eingöbn muesst, waisst ee schoon. 2. Suech dyr aynn Dauttichtnam aus, dönn wo s non nit geit, öbbenn POCH . 3. Ietz demmlt: :w POCH (also mit POCH als dönn neuen Dauttichtnam). 4. Dös speichert ietz de gantze Dautticht, also önn Wimmschainer, unter dönn Nam POCH. Dös kanst leicht überprüeffen, indem däßst ainfach :!ls older :!dir zipfst und dyrmit deinn Verzaichnissinhalt seghst. Anmörkung: Stigst ietz aus n Wimm aus und gännst n aft wider mit vim POCH , naacherd wär dö Dautticht ayn gnaune Aamum von n Schainer dyrselbn, wiest n gspeichert haast. 5. Ietz verweitert dö Dautticht - fallsst s Fenstl haast - , mit :!del POCH beziehungsweis bei aynn Unixgebäu mit :!rm POCH . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 5.3: AYNN TAIL VON N GWORT ZO N SPEICHERN AUSWALN ** Um aynn Tail von dyr Dautticht z speichern, zipf v [Wolend] :w DAUTTICHT ** 1. Ruck önn Mörkl auf netty dö Zeil daader. 2. Demmlt v und gee mit n Mörkl auf dönn fümftn Auflistungspunt untet. Du seghst glei, däß s Gwort vürherghöbt erscheint. 3. Druck s Zaichen : . Ganz unt auf n Bildschirm erscheint :'<,'> . 4. Zipf w POCH , wobei s dönn Dauttichtnam POCH non nit geit. Vergwiß di, däßst dös :'<,'>w POCH aau +seghst, ee wennst druckst. 5. Dyr Wimm schreibt de ausgwaltn Zeiln eyn de Dautticht POCH einhin. Benutz :!dir older :!ls , däßst dös überprüeffst. Lösh s fein nit öbbenn! Mir brauchend s nömlich für de naehste Letzn. Anmörkung: Druckt myn v , ginnt d Sichtisch-Auswal. Du kanst mit n Mörkl um- aynandfarn, um d Auswal z veröndern. Drafter kan myn mit yn aynn Pfemerer mit dönn Gwort öbbs machen. Zo n Beispil löscht d dös Gwort. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 5.4: EINLÖSN UND ZAMMENFÜERN VON DAUTTICHTN ** Um önn Inhalt von ayner Dautticht einzlösn, zipf :r DAUTTICHTNAM ** 1. Sötz önn Mörkl über dö Zeil daader. OBACHT: Aft däßst önn Schrit 2 ausgfüert haast, seghst auf aynmaal öbbs aus dyr Letzn 5.3. Bewög di naacherd wider abwärts, dyrmitst dö Letzn wi- derfinddst. 2. Ietz lis dein Dautticht POCH ein, indem däßst d Faudung :r POCH aus- füerst, wobei wie gsait POCH für dönn von dir ausgsuechtn Dauttichtnam steet. De einglösne Dautticht werd unterhalb dyr Mörklzeil eingfüegt. 3. Um zo n Überprüeffen, ob de Dautticht aau gwiß einglösn ist, gee zrugg; und du seghst, däß s ietz zwo Ausförtigungen von dyr Letzn 5.3. geit, s Urniss und de eingfüegte Dauttichtfassung. Anmörkung: Du kanst aau d Ausgaab von aynn Ausserigbefelh einlösn. Zo n Bei- spil list :r !ls d Ausgaab von dyr Faudung ls ein und füegt s unterhalb n Mörkl ein. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZAMMENFASSUNG VON DYR LETZN 5 1. :!FAUDUNG füert aynn ausserignen Befelh aus. Daader ayn Öttlych gwänddte Beispiler: (Fenstl) (Unix - Linux) :!dir :!ls - listt s Verzaichniss auf. :!del DAUTTICHT :!rm DAUTTICHT - verweitert sele Dautticht. 2. :w DAUTTICHT speichert de ietzunde Wimmdautticht unter dönn besagtn Nam. 3. v WOLEND :w DAUTTICHTNAM schreibt de sichtisch ausgwaltn Zeiln eyn de Dautticht mit seln Nam. 4. :r DAUTTICHTNAM ladt sele Dautticht und füegt s unterhalb n Mörklbefand ein. 5. :r !dir list d Ausgaab von dyr Faudung dir und füegt s unterhalb n Mörklbefand ein. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 6.1: ZEIL ÖFFNEN (»open«) ** Zipf o , um ayn Zeil unterhalb n Mörkl z öffnen und eyn d ** ** Einfüegartweis z kemmen. ** 1. Bewög önn Mörkl zo dyr eerstn mit ---> angmörktn Zeil unt. 2. Zipf o (klain), um ayn Zeil UNTERHALB n Mörkl z öffnen und mit dyr Ein- füegartweis weiterztuen. 3. Ietzet zipf ayn Weeng öbbs und druck , um d Einfüegartweis z ver- laassn. ---> Mit o werd dyr Mörkl in dyr Einfüegartweis auf de offene Zeil gsötzt. 4. Um ayn Zeil OBERHALB n Mörkl aufzmachen, gib ainfach ayn groosss O statt yn aynn klainen ein. Versuech dös auf dyr untignen Zeil. ---> Öffnet ayn Zeil über derer daader mit O , wenn dyr Mörkl auf derer Zeil ist. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 6.2: GWORT ANFÜEGN (»append«) ** Zipf a , um öbbs NAACH n Mörkl einzfüegn. ** 1. Bewög önn Mörkl gan n Anfang von dyr eerstn Üebungszeil mit ---> unt. 2. Druck e , hinst däß dyr Mörkl an n End von Zei steet. 3. Zipf ayn klains a , um öbbs NAACH n Mörkl anzfüegn. 4. Vergöntz dös Wort wie in dyr Zeil drunter. Druck , um d Schreib- Artweis z verlaassn. 5. Bewög di mit e zo n naehstn ungantzn Wort und widerhol d Schritt 3 und 4. ---> Dö Ze biett ayn Glögn , ayn Gwort in ayner Zeil anzfü. ---> Dö Zeil biett ayn Glögnet, ayn Gwort in ayner Zeil anzfüegn. Anmörkung: a , i und A bringend ainn gleichermaaßn eyn d Einfüegartweis; dyr ainzige Unterschaid ist, WO mit n Einfüegn angfangt werd. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 6.3: AYN ANDERNE WEIS ZO N ERSÖTZN (»replace«) ** Demmlt ayn groosss R , um meerer als wie grad ain Zaichen z ersötzn. ** 1. Bewög önn Mörkl zo dyr eerstn untignen, mit ---> angmörktn Zeil. Gee mit n Mörkl gan n Anfang von n eerstn xxx . 2. Ietz druck R und zipf sele Zal, wo drunter in dyr zwaittn Zeil steet, yso däß de sel s xxx ersötzt. 3. Druck , um d Ersötzungsartweis z verlaassn. Du gspannst, däß dyr Rest von dyr Zeil unveröndert bleibt. 4. Äfert die Schritt, um dös überblibne xxx z ersötzn. ---> S Zunddn von 123 zo xxx ergibt xxx. ---> S Zunddn von 123 zo 456 ergibt 579. Anmörkung: D Ersötzungsartweis ist wie d Einfüegartweis, aber ayn ieds eindem- mlte Zaichen löscht ayn vorhanddns. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 6.4: GWORT AAMEN UND EINFÜEGN ** Benutz önn Pfemerer y , um öbbs z aamen, und p , um öbbs einzfüegn. ** 1. Gee zo dyr mit ---> angmörktn Zeil unt und sötz önn Mörkl hinter "a)". 2. Ginn d Sichtisch-Artweis mit v und bewög önn Mörkl gnaun vor "eerste". 3. Zipf y , um dönn vürherghöbtn Tail z aamen. 4. Bewög önn Mörkl gan n End von dyr naehstn Zeil: j$ 5. Demmlt p , um dös Gwort einzfüegn, und aft: a zwaitte . 6. Benutz d Sichtischartweis, um " Eintrag." auszwaln, aam s mittls y , be- wög di gan n End von dyr naehstn Zeil mit j$ und füeg s Gwort dortn mit p an. ---> a) dös ist dyr eerste Eintrag. b) Anmörkung: Du kanst y aau als Pfemerer verwenddn; yw zo n Beispil aamt hinst eyn n naehstn Wortanfang (aane dönn selber). ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 6.5: SCHALTTER SÖTZN ** Sötz aynn Schaltter yso, däß ayn Suech older Ersötzung Grooß- und Klain- ** ** schreibung übergeet. ** 1. Suech um 'übergee", indem däßst /übergee eingibst. Widerhol d Suech ayn Öttlych Maal, indem däßst de Tastn n druckst. 2. Sötz de Zwisl - önn Schaltter - 'ic' (»ignore case«), indem däßst :set ic eingibst. 3. Ietz suech wider um 'übergee' und tue aau wider mit n weiter. Daa fallt dyr auf, däß ietz öbbenn aau Übergee und ÜBERGEE hergeet. 4. Sötz de Zwisln 'hlsearch' und 'incsearch' pfelfs: :set hls is 5. Widerhol d Suech und bobacht, was ietz gschieght: /übergee 6. Däßst grooß und klain wider gwon unterscheidst, zipf: :set noic Anmörkung: Mechst de Tröffer niemer vürherghöbt seghn, gib ein: :nohlsearch Anmörkung: Sollt klain/grooß bei ayner ainzignen Suech wurst sein, benutz \c in n Suechausdruk: /übergee\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZAMMENFASSUNG VON DYR LETZN 6 1. Zipf o , um ayn Zeil UNTERHALB n Mörkl z öffnen und d Einfüegartweis z ginnen. Zipf O , um ayn Zeil OBERHALB n Mörkl z öffnen. 2. Zipf a , um NAACH n Mörkl ayn Gwort einzfüegn. Zipf A , um ayn Gwort naach n Zeilnend anzfüegn. 3. D Faudung e bringt di gan n End von aynn Wort. 4. Dyr Pfemerer y (»yank«) aamt öbbs, p (»put«) füegt dös ein. 5. Ayn groosss R geet eyn d Ersötzungsartweis, hinst däß myn druckt. 6. D Eingaab von ":set xxx" sötzt de Zwisl "xxx". Ayn Öttlych Zwisln seind: 'ic' 'ignorecase' Grooß/klain wurst bei ayner Suech 'is' 'incsearch' Zaig aau schoon ayn Tailüberainstimmung 'hls' 'hlsearch' Höb allsand pässetn Ausdrück vürher Dyr Schaltternam kan in dyr Kurz- older Langform angöbn werdn. 7. Stöll yn ayner Zwisl "no" voran, däßst ys abschalttst: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 7.1: AYN HILFGWORT AUFRUEFFEN ** Nutz dös einbaute Hilfgebäu, de "Betribsanlaittung". ** Eyn n Wimm ist ayn ausfüerliche "Gebrauchsanweisung" einbaut. Für s Eerste pröblt ainfach ains von dene dreu aus: - Druck d -Tastn, wennst öbbenn aine haast. - Druck de Tastn , fallsst ys haast. - Zipf :help Lis di eyn s Hilffenster ein, dyrmitst draufkimmst, wie dös mit dyr Hilf geet. Demmlt w w , um von ainn Fenster zo n andern zo n Springen. Demmlt :q , um s Hilffenster zo n Schliessn. Du kanst zo so guet wie allssand ayn Hilf finddn, indem däßst yn dyr Faudung :help aynn Auerwerd naachstöllst und istig nit vergisst. Pröblt dös: :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 7.2: ERSTÖLL AYN GIN-SCHRIPF ** Mutz önn Wimm mit de einbautn Faehigkeitn auf. ** Dyr Wimm besitzt ayn Wösn Schäftungen, wo über n Urwimm aushingeend, aber de meerern dyrvon seind in dyr Vorgaab ausgschaltt. Dyrmitst meerer aus n Wimm ausherholst, erstöllst ayn "vimrc"-Dautticht. 1. Lög ayn "vimrc"-Dautticht an; dös geet ie naach Betribsgebäu verschidn: :e ~/.vimrc für s Unix :e $VIM/_vimrc bei n Fenstl 2. Ietz lis önn Inhalt von dyr Beispil-"vimrc"-Dautticht ein: :r $VIMRUNTIME/vimrc_example.vim 3. Speichert de Dautticht mit: :w 4. Bei n naehstn Gin von n Wimm ist aft d Füegnussvürherhöbung zuegschalttn. Du kanst dyr allss eyn dö Dautticht einhinschreibn, wasst bständig habn willst. Meerer dyrzue erfarst unter: :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 7.3: VERGÖNTZN ** Befelhszeilnvergöntzung mit d und ** 1. Vergwiß di, däß dyr Wimm nit auf n Urwimm-"Glais" fart: :set nocp 2. Schaug naach, wölcherne Dauttichtn däß s in n Verzaichniss geit: :!ls older :!dir 3. Zipf önn Anfang von ayner Faudung: :e 4. Druck d , und dyr Wimm zaigt ayn Listn von Faudungen, wo mit "e" angeend. 5. Druck , und dyr Wimm vervollstöndigt önn Faudungsnam zo ":edit". 6. Füeg ayn Laerzaichen und önn Anfang von ayner besteehetn Dautticht an: :edit DAU 7. Druck . Dyr Wimm vergöntzt önn Nam, dös haisst, wenn yr aindeuttig ist. Anmörkung: D Vergöntzung geit s für aynn Hauffen Faudungen. Versuech ainfach d und . Bsunders nützlich ist dös bei :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZAMMENFASSUNG VON DYR LETZN 7 1. Zipf :help oder druck oder , um ayn Hilffenster z öffnen. 2. Zipf :help FAUDUNG , um auf ayn Hilf gan aynn Befelh z kemmen. 3. Zipf w w , um zo n andern Fenster z springen. 4. Zipf :q , um s Hilffenster z schliessn. 5. Erstöll ayn vimrc-Ginschripf zuer Sicherung von deine Mötzneinstöllungen. 6. Druck d , aft däßst naach : ayn Faudung angfangt haast, dyr- mitst mügliche Vergöntzungen anzaigt kriegst. Druck für ain Vervollstöndigung yllain. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Dös wär ietzet s End von n Wimmschainer. Gangen ist s daa drum, aynn kurtzn und bündignen Überblik über s Blat WIMM z lifern, netty vil gnueg, däß myn für s Eerste wirklich öbbs dyrmit anfangen kan. Dyrmit ist s aber auf kain Weitn non nit taan; dyr Wimm haat schoon non vil meerer auf Lager. Lis als Naehsts aynmaal s Benutzerhandbuech: :help user-manual Zo n Weiterlösn und Weiterlernen wör dös Buech daader zo n Empfelhen: Vim - Vi Improved - von n OUALLINE Steve Verlaag: New Riders Dös ist dös eerste Buech, wo ganz yn n Wimm gwidmt ist, netty dös Grechte für Anfönger. Es haat ayn Wösn Beispiler und aau Bilder drinn. See http://iccf-holland.org/click5.html Dös folgete Buech ist schoon ölter und meerer über n Urwimm als wie über n Wimm, aber aau zo n Empfelhen: Textbearbeitung mit dem vi-Editor - von dyr LAMB Linda und n ROBBINS Arnold - Verlaag O'Reilly - Buechlaittzal (ISBN): 3897211262 In dönn Buech kan myn fast allss finddn, was myn mit n Urwimm angeen mecht. De söxte Ausgaab enthaltt aau schoon öbbs über n Wimm. Als ietzunde Bezugniss für d Fassung 7 und ayn pfrenge Einfüerung dient dös folgete Buech: vim ge-packt von n WOBST Reinhard mitp-Verlaag, Buechlaittzal 978-3-8266-1781-2 Trotz dyr recht pfrengen Darstöllung ist s durch seine viln nützlichnen Bei- spiler aau für Einsteiger grad grecht. Probhaeupster und de Beispilschripfer seind zesig zo n Kriegn; see http://iccf-holland.org/click5.html Verfasst habnd dönn Schainer dyr PIERCE Michael C. und WARE Robert K. von dyr Kolraader Knappnschuel (Colorado School of Mines). Er beruet auf Entwürff, wo dyr SMITH Charles von dyr Kolraader Allschuel (Colorado State University) zuer Verfüegung gstöllt haat. Gundpost: bware@mines.colorado.edu Für n Wimm haat n dyr MOOLENAAR Bram barechtt. De bairische Übersötzung stammt von n HELL Sepp 2009, ayn Weeng überarechtt 2011. Sein Gundpostbrächt ist sturmibund@t-online.de ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim-7.4.1689/runtime/tutor/tutor.ca000066400000000000000000000647421267703067000171340ustar00rootroot00000000000000=============================================================================== = 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 bsiques que us permetin fer servir el Vim com a editor de propsit 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 cpia d'aquest fitxer per practicar-hi (si heu comenat amb el programa vimtutor aix que esteu llegint ja s una cpia). 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 noms llegiu el text el ms probable s que les oblideu. Ara assegureu-vos que la tecla de bloqueig de majscules 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 prxima lli. 3. Usant la tecla avall, aneu a la lli 1.2. Nota: Si no esteu segurs de la tecla que heu premut, premeu per tornar al mode Normal. Llavors torneu a teclejar l'ordre que voleu. Nota: Les tecles de moviment del cursor (fletxes) tamb funcionen. Per usant hjkl anireu ms rpid, quan us hi hgiu acostumant. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lli 1.2: ENTRAR I SORTIR DEL VIM !! NOTA: Abans de seguir els passos segents llegiu *tota* la lli!! 1. Premeu (per estar segurs que esteu en el mode Normal). 2. Teclegeu: :q! . ---> Amb aix sortireu de l'editor SENSE desar els canvis que hgiu pogut fer. Si voleu desar els canvis teclegeu: :wq 3. Quan vegeu l'introductor de la shell escriviu l'ordre amb la qual heu arribat a aquest tutor. Podria ser: vimtutor O b: vim tutor ---> '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 carcter de sota el cursor. ** 1. Moveu el cursor fins la lnia que hi ha ms avall marcada amb --->. 2. Poseu el cursor a sobre el carcter que cal esborrar, per corregir els errors. 3. Premeu la tecla x per esborrar el carcter. 4. Repetiu els passos 2 i 3 fins que la frase sigui correcta. ---> Unna vaaca vva salttar sobbree la llluna. 5. Ara que la lnia 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 lnia marcada amb --->. 2. Per fer la primera lnia igual que la segona poseu el cursor sobre el primer carcter POSTERIOR al text que s'ha d'inserir. 3. Premeu la tecla i i escriviu el text que falta. 4. Quan hgiu acabat premeu per tornar al mode Normal. Repetiu els passos 2, 3 i 4 per corregir la frase. ---> Falten carctrs en aquesta . ---> Falten alguns carcters en aquesta lnia. 5. Quan us trobeu cmodes 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 3. Per sortir teclegeu: :q! per descartar els canvis. O B teclegeu: :wq per desar els canvis. 4. Per esborrar el carcter 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 NOTA: La tecla us portar al mode Normal o cancellar 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 per estar segurs que esteu en mode normal. 2. Moveu el cursor avall fins la lnia marcada amb --->. 3. Moveu el cursor fins el principi de la paraula que s'ha d'esborrar. 4. Teclegeu dw per fer desaparixer la paraula. NOTA: Les lletres dw apareixeran a la lnia de baix de la pantalla mentre les aneu escrivint. Si us equivoqueu premeu i torneu a comenar. ---> 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: MS ORDRES PER ESBORRAR ** Escriviu d$ per esborrar fins al final de la lnia. ** 1. Premeu per estar segurs que esteu en el mode Normal. 2. Moveu el cursor avall fins a la lnia marcada amb --->. 3. Moveu el cursor fins el final de la lnia correcta (DESPRS del primer . ). 4. Teclegeu d$ per esborrar fins al final de la lnia. ---> Alg ha escrit el final d'aquesta lnia dos cops. lnia 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 segent: [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 lnia. NOTA: Per als aventurers: si teclegeu noms 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 lnia. ** Com que molt sovint s'han d'eliminar lnies senceres els dissenyadors del Vi van creure que seria ms fcil teclejar dd per esborrar tota la lnia. 1. Moveu el cursor a la segona lnia de la frase de baix. 2. Teclegeu dd per esborrar la lnia. 3. Ara aneu a la quarta lnia. 4. Teclegeu 2dd per esborrar dues lnies (recordeu nombre-ordre-objecte). 1) Les roses sn vermelles, 2) El fang s divertit, 3) Les violetes sn 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 lnia. ** 1. Moveu el cursor sobre el primer error de lnia de baix marcada amb ---> 2. Premeu x per esborrar el carcter no desitjat. 3. Ara premeu u per desfer l'ltima ordre executada. 4. Aquest cop corregiu tots els errors de la lnia amb l'ordre x. 5. Ara premeu U per restablir la lnia 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 lnia i dessfeu-los aamb desfer. 8. Aquestes ordres sn 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 lnia teclegeu: d$ 3. Per esborrar una lnia 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 lnia), etc. 5. Per desfer les accions anteriors premeu: u Per desfer tots el canvis en una lnia 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 desprs del cursor. ** 1. Moveu el cursor a la primera lnia de llista de baix. 2. Teclegeu dd per esborrar la lnia i desar-la a la memria. 3. Moveu el cursor a la lnia ANTERIOR on hauria d'anar. 4. En mode Normal, premeu p per inserir la lnia. 5. Repetiu els passos 2, 3 i 4 per ordenar les lnies correctament. d) Pots aprendre tu? b) Les violetes sn blaves, c) L'intelligncia s'aprn, a) Les roses sn vermelles, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lli 3.2: L'ORDRE SUBSTITUIR ** Premeu r i un carcter per substituir el carcter de sota el cursor. ** 1. Moveu el cursor a la primera lnia de sota marcada amb --->. 2. Moveu el cursor a sobre del primer carcter equivocat. 3. Premeu r i tot seguit el carcter correcte per corregir l'error. 4. Repetiu els passos 2 i 3 fins que la lnia sigui correcta. ---> Quen van escroure aquerta lnia, algh va apretar tikles equivocades! ---> Quan van escriure aquesta lnia, 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 lnia 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 i aneu al segent 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 lnia t algunes paraules que s'han de canviar. Noteu que cw no noms canvia la paraula, tamb us posa en mode d'inserci. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lli 3.4: MS 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 sn els mateixos, com w (paraula), $ (final de lnia), etc. 3. Moveu el cursor fins la primera lnia marcada amb --->. 4. Avanceu fins al primer error. 5. Premeu c$ per fer la lnia igual que la segona i premeu . ---> El final d'aquesta lnia necessita canvis per ser igual que la segona. ---> El final d'aquesta lnia 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 DESPRS del cursor (si heu esborrat una lnia anir a parar a la lnia SEGENT d'on hi ha el cursor). 2. Per substituir el carcter de sota el cursor, premeu r i tot seguit el carcter que ha de reemplaar 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 lnia. 4. El format de l'ordre canviar s: [nombre] c objecte O B c [nombre] objecte Ara aneu a la prxima 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 lnia determinada. ** Nota: No proveu res fins que hgiu llegit TOTA la lli!! 1. Mantingueu premuda la tecla Control i premeu g . A la part de baix de la pgina apareixer un lnia amb el nom del fitxer i la lnia en la qual us trobeu. Recordeu el nmero de la lnia pel Pas 3. 2. Premeu Shift-G per anar al final de tot del fitxer. 3. Teclegeu el nmero de la lnia on reu i desprs premeu Shift-G. Aix us tornar a la lnia on reu quan heu premut per primer cop Ctrl-g. (Quan teclegeu el nmero 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 carcter / . Noteu que el cursor apareix a la part de baix de la pantalla igual que amb l'ordre : . 2. Ara escriviu 'errroor' . 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 PARNTESIS ** Premeu % per cercar el ),], o } corresponent. ** 1. Poseu el cursor en qualsevol (, [, o { de la lnia marcada amb --->. 2. Ara premeu el carcter % . 3. El cursor hauria d'anar a la clau o parntesis corresponent. 4. Premeu % per tornar el cursor al primer parntesi. ---> Aix ( s una lnia amb carcters (, [ ] i { } de prova. )) Nota: Aix s molt til per trobar errors en programes informtics! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lli 4.4: UNA MANERA DE CANVIAR ERRORS ** Escriviu :s/vell/nou/g per substituir 'vell' per 'nou'. ** 1. Moveu el cursor a la lnia de sota marcada amb --->. 2. Escriviu :s/laa/la . Aquesta ordre noms canvia la primera coincidncia que es trobi a la lnia. 3. Ara escriviu :s/laa/la/g per fer una substituci global. Aix canviar totes les coincidncies que es trobin a la lnia. ---> laa millor poca per veure laa flor s laa primavera. 4. Per canviar totes les coincidncies d'una cadena entre dues lnies, escriviu :#,#s/vell/nou/g on #,# sn els nombres de les lnies. 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 nmero seguit de Shift-G us porta a la lnia corresponent. 2. L'ordre / seguida d'una frase cerca la frase ENDAVANT. L'ordre ? seguida d'una frase cerca la frase ENDARRERE. Desprs d'una cerca premeu n per trobar la prxima coincidncia en la mateixa direcci, o Shift-N per cercar en la direcci contrria. 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 lnia :s/vell/nou Per substituir tots els 'vell' per 'nou' en una lnia :s/vell/nou/g Per substituir frases entre les lnies # i # :#,#s/vell/nou/g Per substituir totes les coincidncies 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 collocar el cursor a la part de baix de la pantalla. Aix us permet entrar una ordre. 2. Ara teclegeu el carcter ! (signe d'exclamaci). Aix us permet executar qualsevol ordre de la shell. 3. Com a exemple escriviu ls i tot seguit premeu . Aix us mostrar el contingut del directori, tal com si estigussiu a la lnia 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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lli 5.2: MS 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 prmer desprs 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 cpia 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 pgina i premeu Ctrl-g per saber el nmero de la lnia. RECORDEU AQUEST NMERO! 3. Ara aneu a baix de tot de la pgina i torneu a prmer Ctrl-g. RECORDEU AQUEST NMERO TAMB! 4. Per desar NOMS una secci en un fitxer, escriviu :#,# w PROVA on #,# sn els dos nmeros 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 pgina. NOTA: Desprs 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 cpies de la lli 5.3: l'original i la del fitxer. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LLI 5 SUMARI 1. :!ordre executa una ordre externa. Alguns exemples tils sn: (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 lnies 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 lnia sota el cursor i entrar en mode inserci. ** 1. Moveu el cursor a la lnia de sota marcada amb --->. 2. Premeu o (minscula) per obrir una lnia SOTA el cursor i situar-vos en mode d'inserci. 3. Ara copieu la lnia marcada amb ---> i premeu per tornar al mode normal. ---> Desprs de prmer o el cursor es situa a la lnia nova en mode inserci. 4. Per obrir una lnia SOBRE el cursor, premeu la O majscula, en lloc de la minscula. Proveu-ho amb la lnia de sota. Obriu una lnia sobre aquesta amb Shift-O amb el cursor en aquesta lnia. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lli 6.2: L'ORDRE AFEGIR ** Premeu a per afegir text DESPRS del cursor. ** 1. Moveu el cursor al final de la primera lnia de sota marcada amb ---> prement $ en el mode Normal. 2. Premeu la lletra a (minscula) per afegir text DESPRS del carcter sota el cursor. (La A majscula afegeix text al final de lnia.) Nota: Aix s'evita haver de prmer i , l'ltim carcter, el text a inserir, la tecla , cursor a la dreta, i finalment x , noms per afegir text a final de lnia. 3. Ara completeu la primera lnia. 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 lnia us permetr practicar ---> Aquesta lnia us permetr practicar afegir text a final de lnia. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lli 6.3: UNA ALTRA MANERA DE SUBSTITUIR ** Teclegeu una R majscula per substituir ms d'un carcter. ** 1. Moveu el cursor a la lnia de sota marcada amb --->. 2. Poseu el cursor al principi de la primera paraula que es diferent respecte a la segona lnia marcada amb ---> (la paraula "l'ltima"). 3. Ara premeu R i substituu el que queda de text a la primera lnia escrivint sobre el text vell, per fer-la igual que la segona. ---> Per fer aquesta lnia igual que l'ltima useu les tecles. ---> Per fer aquesta lnia igual que la segona, premeu R i el text nou. 4. Tingueu en compte que en prmer 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 diferncies entre majscules i minscules ** 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 ms. 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 lnia SOTA la del cursor i mou el cursor a la nova lnia, en mode Inserci. La O majscula obre la lnia a SOBRE la que hi ha el cursor. 2. Premeu una a per afegir text DESPRS del carcter sota el cursor. La A majscula afegeix automticament el text a final de lnia. 3. L'ordre R majscula us posa en mode substituci fins que premeu . 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 (si en teniu alguna) - premeu la tecla (si en teniu alguna) - escriviu :help Teclegeu :q per tancar la finestra d'ajuda. Podeu trobar ajuda sobre prcticament qualsevol tema donant un argument a l'ordre ":help". Proveu aix (no oblideu prmer ): :help w :help c_ 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 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 (per estar segurs que esteu en el mode Normal). 2. Teclegeu: :q! . ---> Amb això sortireu de l'editor SENSE desar els canvis que hàgiu pogut fer. Si voleu desar els canvis teclegeu: :wq 3. Quan vegeu l'introductor de la shell escriviu l'ordre amb la qual heu arribat a aquest tutor. Podria ser: vimtutor O bé: vim tutor ---> '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 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 3. Per sortir teclegeu: :q! per descartar els canvis. O BÉ teclegeu: :wq 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 NOTA: La tecla 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 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 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 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 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 . ---> 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' . 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 . 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 . 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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 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 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 , 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 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 . 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 (si en teniu alguna) - premeu la tecla (si en teniu alguna) - escriviu :help Teclegeu :q 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 ): :help w :help c_ Klvesa l je vpravo a vykon pohyb vpravo. j Klvesa j vypad na ipku dolu. v 1. Pohybuj kurzorem po obrazovce dokud si na to nezvykne. 2. Dr klvesu pro pohyb dolu (j), dokud se jej funkce nezopakuje. ---> Te v jak se pesunout na nsledujc lekci. 3. Pouitm klvesy dolu pejdi na lekci 1.2. Poznmka: Pokud si nkdy nejsi jist nm, co jsi napsal, stla pro pechod do Normlnho mdu. Pot pepi poadovan pkaz. Poznmka: Kurzorov klvesy tak funguj, avak pouvn hjkl je rychlej jakmile si na nj zvykne. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 1.2: SPUTN A UKONEN VIM !! POZNMKA: Ped vykonnm tchto krok si peti celou lekci!! 1. Stla (pro ujitn, e se nachz v Normlnm mdu). 2. Napi: :q! . ---> Tmto ukon editor BEZ uloen zmn, kter si vykonal. Pokud chce uloit zmny a ukonit editor napi: :wq 3. A se dostane na pkazov dek, napi pkaz, kterm se dostane zpt do tto vuky. To me bt: vimtutor Bn se pouv: vim tutor ---> 'vim' znamen sputn editoru, 'tutor' je soubor k editaci. 4. Pokud si tyto kroky spolehliv pamatuje, vykonej kroky 1 a 3, m ukon a znovu spust editor. Potom pesu kurzor dolu na lekci 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 1.3: PRAVA TEXTU - MAZN ** Stisknutm klvesy x v Normlnm mdu smae znak na mst kurzoru. ** 1. Pesu kurzor ne na dek oznaen --->. 2. K odstrann chyb pejdi kurzorem na znak, kter chce smazat. 3. Stla klvesu x k odstrann nechtnch znak. 4. Opakuj kroky 2 a 4 dokud nen vta sprvn. ---> Krva skoilla pess mssc. 5. Pokud je vta sprvn, pejdi na lekci 1.4. POZNMKA: Nesna se pouze zapamatovat pedvdn pkazy, u se je pouvnm. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 1.4: PRAVA TEXTU - VKLDN ** Stlaen klvesy i v Normlnm mdu umouje vkldn textu. ** 1. Pesu kurzor na prvn dek oznaen --->. 2. Pro upraven prvnho dku do podoby dku druhho, pesu kurzor na prvn znak za msto, kde m bt text vloen. 3. Stla i a napi potebn dodatek. 4. Po opraven kad chyby stla pro nvrat do Normlnho mdu. Opakuj kroky 2 a 4 dokud nen vta sprvn. ---> Njak txt na tto . ---> Njak text chyb na tto dce. 5. Pokud ji ovld vkldn textu, pejdi na nsledujc shrnut. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SHRNUT LEKCE 1 1. Kurzorem se pohybuje pomoc ipek nebo klvesami hjkl. h (vlevo) j (dolu) k (nahoru) l (vpravo) 2. Pro sputn Vimu (z pkazovho dku) napi: vim SOUBOR 3. Pro ukonen Vimu napi: :q! bez uloen zmn. anebo: :wq pro uloen zmn. 4. Pro smazn znaku pod kurzorem napi v Normlnm mdu: x 5. Pro vkldn textu od msta kurzoru napi v Normlnm mdu: i vkldan text POZNMKA: Stlaen t pemst do Normlnho mdu nebo zru nechtn a sten dokonen pkaz. Nyn pokrauj Lekc 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 2.1: PKAZY MAZN ** Pkaz dw smae znaky do konce slova. ** 1. Stla k ubezpeen, e jsi v Normlnm mdu. 2. Pesu kurzor ne na dek oznaen --->. 3. Pesu kurzor na zatek slova, kter je poteba smazat. 4. Napi dw , aby slovo zmizelo. POZNMKA: Psmena dw se zobraz na poslednm dku obrazovky jakmile je nape. Kdy nape nco patn, stla a zani znova. ---> Jsou tu njak slova zbava, kter nepat list do tto vty. 5. Opakuj kroky 3 a 4 dokud nen vta sprvn a pejdi na lekci 2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 2.2: VCE PKAZ MAZN ** Napsn pkazu d$ smae ve a do konce dky. ** 1. Stla k ubezpeen, e jsi v Normlnm mdu. 2. Pesu kurzor ne na dek oznaen --->. 3. Pesu kurzor na konec sprvn vty (ZA prvn teku). 4. Napi d$ ,aby jsi smazal znaky a do konce dku. ---> Nkdo napsal konec tto vty dvakrt. konec tto vty dvakrt. 5. Pejdi na lekci 2.3 pro pochopen toho, co se stalo. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 2.3: ROZIOVAC PKAZY A OBJEKTY Formt mazacho pkazu d je nsledujc: [slo] d objekt NEBO d [slo] objekt Kde: slo - udv kolikrt se pkaz vykon (voliteln, vchoz=1). d - je pkaz mazn. objekt - udv na em se pkaz vykonv (vypsan ne). Krtk vpis objekt: w - od kurzoru do konce slova, vetn mezer. e - od kurzoru do konce slova, BEZ mezer. $ - od kurzoru do konce dku. POZNMKA: Stlaenm klvesy objektu v Normlnm mdu se kurzor pesune na msto upesnn ve vpisu objekt. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 2.4: VJIMKA Z 'PKAZ-OBJEKT' ** Napsnm dd smae cel dek. ** Vzhledem k astosti mazn celho dku se autoi Vimu rozhodli, e bude jednodu napsat prost dv d k smazn celho dku. 1. Pesu kurzor na druh dek spodnho textu. 2. Napi dd pro smazn dku. 3. Pejdi na tvrt dek. 4. Napi 2dd (vzpome si slo-pkaz-objekt) pro smazn dvou dk. 1) Re jsou erven, 2) Blto je zbavn, 3) Fialky jsou modr, 4) Mm auto, 5) Hodinky ukazuj as, 6) Cukr je sladk, 7) A to jsi i ty. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 2.5: PKAZ UNDO ** Stla u pro vrcen poslednho pkazu, U pro celou dku. ** 1. Pesu kurzor ne na dek oznaen ---> a pemsti ho na prvn chybu. 2. Napi x pro smazn prvnho nechtnho znaku. 3. Te napi u m vrt zpt posledn vykonan pkaz. 4. Nyn oprav vechny chyby na dku pomoc pkazu x . 5. Napi velk U m vrt dek do pvodnho stavu. 6. Te napi u nkolikrt, m vrt zpt pkaz U . 7. Stla CTRL-R (klvesu CTRL dr stlaenou a stiskni R) nkolikrt, m vrt zpt pedtm vrcen pkazy (redo). ---> Opprav chybby nna toomto dku a nahra je pommoc undo. 8. Toto jsou velmi uiten pkazy. Nyn pejdi na souhrn Lekce 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SHRNUT LEKCE 2 1. Pro smazn znak od kurzoru do konce slova napi: dw 2. Pro smazn znak od kurzoru do konce dku napi: d$ 3. Pro smazn celho dku napi: dd 4. Formt pkazu v Normlnm mdu je: [slo] pkaz objekt NEBO pkaz [slo] objekt kde: slo - udv poet opakovn pkazu pkaz - udv co je teba vykonat, napklad d mae objekt - udv rozsah pkazu, napklad w (slovo), $ (do konce dku), atd. 5. Pro vrcen pedel innosti, napi: u (mal u) Pro vrcen vech prav na dku napi: U (velk U) Pro vrcen vrcench prav (redo) napi: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 3.1: PKAZ VLOIT ** Pka p vlo posledn vymazan text za kurzor. ** 1. Pesu kurzor ne na posledn dek textu. 2. Napi dd pro smazn dku a jeho uloen do bufferu. 3. Pesu kurzor VݩE tam, kam smazan dek pat. 4. V Normlnm mdu napi p pro optn vloen dku. 5. Opakuj kroky 2 a 4 dokud dky nebudou ve sprvnm poad. d) Tak se doke vzdlvat? b) Fialky jsou modr, c) Inteligence se u, a) Re jsou erven, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 3.2: PKAZ NAHRAZEN ** Napsnm r a znaku se nahrad znak pod kurzorem. ** 1. Pesu kurzor ne na prvn dek oznaen --->. 2. Pesu kurzor na zatek prvn chyby. 3. Napi r a potom znak, kter nahrad chybu. 4. Opakuj kroky 2 a 3 dokud nen prvn dka sprvn. ---> Kdi byl pzn tento deg, nkdu stlail paqn klvesy! ---> Kdy byl psn tento dek, nkdo stlal patn klvesy! 5. Nyn pejdi na Lekci 3.2. POZNMKA: Zapamatuj si, e by ses ml uit pouvnm, ne zapamatovnm. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 3.3: PKAZ PRAVY ** Pokud chce zmnit st nebo cel slovo, napi cw . ** 1. Pesu kurzor ne na prvn dek oznaen --->. 2. Umsti kurzor na psmeno i v slov iok. 3. Napi cw a oprav slovo (v tomto ppad napi 'dek'.) 4. Stla a pejdi na dal chybu (prvn znak, kter teba zmnit.) 5. Opakuj kroky 3 a 4 dokud nen prvn vta stejn jako ta druh. ---> Tento iok m nkolik skic, kter psadoinsa zmnit pasdgf pkazu. ---> Tento dek m nkolik slov, kter potebuj zmnit pomoc pkazu. Vimni si, e cw nejen nahrazuje slovo, ale tak pemst do vkldn. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 3.4: VCE ZMN POUITM c ** Pkaz pro pravu se dru se stejnmi objekty jako ten pro mazn. ** 1. Pkaz pro pravu pracuje stejn jako pro mazn. Formt je: [slo] c objekt NEBO c [slo] objekt 2. Objekty jsou tak shodn, jako nap.: w (slovo), $ (konec dku), atd. 3. Pejdi ne na prvn dek oznaen --->. 4. Pesu kurzor na prvn rozdl. 5. Napi c$ pro upraven zbytku dku podle toho druhho a stla . ---> Konec tohoto dku potebuje pomoc, aby byl jako ten druh. ---> Konec tohoto dku potebuje opravit pouitm pkazu c$ . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SHRNUT LEKCE 3 1. Pro vloen textu, kter byl smazn, napi p . To vlo smazan text ZA kurzor (pokud byl dek smazan, pejde na dek pod kurzorem). 2. Pro nahrazen znaku pod kurzorem, napi r a potom znak, kterm chce pvodn znak nahradit. 3. Pkaz na upravovn umouje zmnit specifikovan objekt od kurzoru do konce objektu. Napklad: Napi cw ,m zmn text od pozice kurzoru do konce slova, c$ zmn text do konce dku. 4. Formt pro nahrazovn je: [slo] c objekt NEBO c [slo] objekt Nyn pejdi na nsledujc lekci. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 4.1: POZICE A STATUS SOUBORU ** Stla CTRL-g pro zobrazen sv pozice v souboru a statusu souboru. Stla SHIFT-G pro pechod na dek v souboru. ** Poznmka: Peti si celou lekci ne zane vykonvat kroky!! 1. Dr klvesu Ctrl stlaenou a stiskni g . Vespod obrazovky se zobraz stavov dek s nzvem souboru a dkou na kter se nachz. Zapamatuj si slo dku pro krok 3. 2. Stla shift-G pro pesun na konec souboru. 3. Napi slo dku na kterm si se nachzel a stla shift-G. To t vrt na dek, na kterm jsi dve stiskl Ctrl-g. (Kdy pe sla, tak se NEZOBRAZUJ na obrazovce.) 4. Pokud se ct schopn vykonat tyto kroky, vykonej je. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 4.2: PKAZ VYHLEDVN ** Napi / nsledovan etzcem pro vyhledn onoho etzce. ** 1. Stiskni / v Normlnm mdu. Vimni si, e tento znak se spolu s kurzorem zobraz v doln sti obrazovky jako pkaz : . 2. Nyn napi 'chhybba' . To je slovo, kter chce vyhledat. 3. Pro vyhledn dalho vsledku stejnho etzce, jednodue stla n . Pro vyhledn dalho vsledku stejnho etzce opanm smrem, stiskni Shift-N. 4. Pokud chce vyhledat etzec v opanm smru, pouij pkaz ? msto pkazu / . ---> "chhybba" nen zpsob, jak hlskovat chyba; chhybba je chyba. Poznmka: Kdy vyhledvn doshne konce souboru, bude pokraovat na jeho zatku. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 4.3: VYHLEDVN PROV ZVORKY ** Napi % pro nalezen prov ),], nebo } . ** 1. Pemsti kurzor na kteroukoli (, [, nebo { v dku oznaenm --->. 2. Nyn napi znak % . 3. Kurzor se pemst na odpovdajc zvorku. 4. Stla % pro pesun kurzoru zpt na otvrajc zvorku. ---> Toto ( je testovac dek ('s, ['s ] a {'s } v nm. )) Poznmka: Toto je velmi uiten p ladn programu s chybjcmi uzavracmi zvorkami. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 4.4: ZPSOB JAK ZMNIT CHYBY ** Napi :s/star/nov/g pro nahrazen slova 'nov' za 'star'. ** 1. Pesu kurzor na dek oznaen --->. 2. Napi :s/dobr/dobr . Vimni si, e tento pkaz zmn pouze prvn vskyt v dku. 3. Nyn napi :s/dobr/dobr/g co znamen celkov nahrazen v dku. Toto nahrad vechny vskyty v dku. ---> dobr suroviny a dobr nin jsou zkladem dobr kuchyn. 4. Pro zmnu vech vskyt etzce mezi dvma dky, Napi :#,#s/star/nov/g kde #,# jsou sla onch dek. Napi :%s/star/nov/g pro zmnu vech vskyt v celm souboru. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SHRNUT LEKCE 4 1. Ctrl-g vype tvou pozici v souboru a status souboru. Shift-G t pemst na konec souboru. slo nsledovan Shift-G t pesune na dan slo dku. 2. Napsn / nsledovan etzcem vyhled etzec smrem DOPEDU. Napsn ? nsledovan etzcem vyhled etzec smrem DOZADU. Napsn n po vyhledvn najde nsledujc vskyt etzce ve stejnm smru, Shift-N ve smru opanm. 3. Stisknut % kdy je kurzor na (,),[,],{, nebo } najde odpovdajc provou zvorku. 4. Pro nahrazen novho za prvn star v dku napi :s/star/nov Pro nahrazen novho za vechny star v dku napi :s/star/nov/g Pro nahrazen etzc mezi dvmi dkami # napi :#,#s/star/nov/g Pro nahrazen vech vskyt v souboru napi :%s/star/nov/g Pro potvrzen kadho nahrazen pidej 'c' :%s/star/nov/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 5.1: JAK VYKONAT VNJ PKAZ ** Napi :! nsledovan vnjm pkazem pro sputn pkazu. ** 1. Napi obvykl pkaz : , kter umst kurzor na spodek obrazovky To umon napsat pkaz. 2. Nyn stiskni ! (vykink). To umon vykonat jakkoliv vnj pkaz z pkazovho dku. 3. Napklad napi ls za ! a stiskni . Tento pkaz zobraz obsah tvho adrese jako v pkazovm dku. Vyzkouej :!dir pokud ls nefunguje. Poznmka: Takto je mon vykonat jakkoliv pkaz. Poznmka: Vechny pkazy : mus bt dokonen stisknutm ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 5.2: VCE O UKLDN SOUBOR ** Pro uloen zmn v souboru napi :w SOUBOR. ** 1. Napi :!dir nebo :!ls pro vpis aktulnho adrese. U v, e za tmto mus stisknout . 2. Vyber si nzev souboru, kter jet neexistuje, napklad TEST. 3. Nyn napi: :w TEST (kde TEST je vybran nzev souboru.) 4. To ulo cel soubor (Vuka Vimu) pod nzvem TEST. Pro oven napi znovu :!dir , m zobraz obsah adrese. Poznmka: Jakmile ukon Vim a znovu ho spust s nzvem souboru TEST, soubor bude pesn kopie vuky, kdy si ji ukldal. 5. Nyn odstra soubor napsnm (MS-DOS): :!del TEST nebo (Unix): :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 5.3: VBROV PKAZ ULOEN ** Pro uloen sti souboru napi :#,# w SOUBOR ** 1. Jet jednou napi :!dir nebo :!ls pro vpis aktulnho adrese a vyber vhodn nzev souboru jako nap. TEST. 2. Pesu kurzor na vrch tto strnky a stiskni Ctrl-g pro zobrazen sla dku. ZAPAMATUJ SI TOTO SLO! 3. Nyn se pesu na spodek tto strnky a opt stiskni Ctrl-g. ZAPAMATUJ SI I SLO TOHOTO DKU! 4. Pro uloen POUZE sti souboru, napi :#,# w TEST kde #,# jsou sla dvou zapamatovanch dk (vrch, spodek) a TEST je nzev souboru. 5. Znova se ujisti, e tam ten soubor je pomoc :!dir ale NEODSTRAUJ ho. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 5.4: SLUOVN SOUBOR ** K vloen obsahu souboru napi :r NZEV_SOUBORU ** 1. Napi :!dir pro ujitn, e soubor TEST stle existuje. 2. Pesu kurzor na vrch tto strnky. POZNMKA: Po vykonn kroku 3 uvid lekci 5.3. Potom se opt pesu dol na tuto lekci. 3. Nyn vlo soubor TEST pouitm pkazu :r TEST kde TEST je nzev souboru. POZNMKA: Soubor, kter vkld se vlo od msta, kde se nachz kurzor. 4. Pro potvrzen vloen souboru, pesu kurzor zpt a vimni si, e te m dv kopie lekce 5.3, originl a souborovou verzi. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SHRNUT LEKCE 5 1. :!pkaz vykon vnj pkaz. Nkter uiten pklady jsou: (MS-DOS) (Unix) :!dir :!ls - zobraz obsah souboru. :!del SOUBOR :!rm SOUBOR - odstran SOUBOR. 2. :w SOUBOR ulo aktuln text jako SOUBOR na disk. 3. :#,#w SOUBOR ulo dky od # do # do SOUBORU. 4. :r SOUBOR vybere z disku SOUBOR a vlo ho do editovanho souboru za pozici kurzoru. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 6.1: PKAZ OTEVT ** Napi o pro vloen dku pod kurzor a pepnut do Vkldacho mdu. ** 1. Pemsti kurzor ne na dek oznaen --->. 2. Napi o (mal) pro vloen dku POD kurzor a pepnut do Vkldacho mdu. 3. Nyn zkopruj dek oznaen ---> a stiskni pro ukonen Vkldacho mdu. ---> Po stisknut o se kurzor pemst na vloen dek do Vkldacho mdu. 4. Pro oteven dku NAD kurzorem jednodue napi velk O , msto malho o. Vyzkouej si to na nsledujcm dku. Vlo dek nad tmto napsnm Shift-O po umstn kurzoru na tento dek. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 6.2: PKAZ PIDAT ** Stiskni a pro vloen textu ZA kurzor. ** 1. Pesu kurzor na ne na konec dky oznaen ---> stisknutm $ v Normlnm mdu. 2. Stiskni a (mal) pro pidn textu ZA znak, kter je pod kurzorem. (Velk A pid na konec dku.) Poznmka: Tmto se vyhne stisknut i , poslednho znaku, textu na vloen, , kurzor doprava, a nakonec x na pidvn na konec dku! 3. Nyn dokon prvn dek. Vimni si, e pidvn je vlastn stejn jako Vkldac md, krom msta, kam se text vkld. ---> Tento dek ti umouje nacviit ---> Tento dek ti umouje nacviit pidvn textu na konec dky. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 6.3: JIN ZPSOB NAHRAZOVN ** Napi velk R pro nahrazen vc ne jednoho znaku. ** 1. Pesu kurzor na prvn dek oznaen --->. 2. Umsti kurzor na zatek prvnho slova, kter je odlin od druhho dku oznaenho ---> (slovo 'posledn'). 3. Nyn stiskni R a nahra zbytek textu na prvnm dku pepsnm starho textu tak, aby byl prvn dek stejn jako ten druh. ---> Pro upraven prvnho dku do tvaru toho posledn na stran pouij kl. ---> Pro upraven prvnho dku do tvaru toho druhho, napi R a nov text. 4. Vimni si, e jakmile stiskne vechen nezmnn text zstv. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 6.4: NASTAVEN MONOST ** Nastav monost, e vyhledvn anebo nahrazovn nedb velikosti psmen ** 1. Vyhledej etzec 'ignore' napsnm: /ignore Zopakuj nkolikrt stisknut klvesy n. 2. Nastav monost 'ic' (Ignore case) napsnm pkazu: :set ic 3. Nyn znovu vyhledej 'ignore' stisknutm: n Nkolikrt hledn zopakuj stisknutm klvesy n. 4. Nastav monosti 'hlsearch' a 'incsearch': :set hls is 5. Nyn znovu vykonej vyhledvac pkaz a sleduj, co se stane: /ignore 6. Pro vypnut zvrazovn vsledk napi: :nohlsearch ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SHRHNUT LEKCE 6 1. Stisknut o oteve nov dek POD kurzorem a umst kurzor na vloen dek do Vkldacho mdu. Napsn velkho O oteve dek NAD dkem, na kterm je kurzor. 2. Stiskni a pro vloen textu ZA znak na pozici kurzoru. Napsn velkho A automaticky pid text na konec dku. 3. Stisknut velkho R pepne do Nahrazovacho mdu, dokud nestiskne pro jeho ukonen. 4. Napsn ":set xxx" nastav monosti "xxx". ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCE 7: PKAZY ON-LINE NPOVDY ** Pouvej on-line systm npovdy ** Vim m obshl on-line systm npovdy. Pro zatek vyzkouej jeden z nsledujcch: - stiskni klvesu (pokud ji m) - stiskni klvesu (pokud ji m) - napi :help Napi :q pro uzaven okna npovdy. Me najt npovdu k jakmukoliv tmatu pidnm argumentu k pkazu ":help". Zkus tyto (nezapome stisknout ): :help w :help c_ Klvesa l je vpravo a vykon pohyb vpravo. j Klvesa j vypad na ipku dolu. v 1. Pohybuj kurzorem po obrazovce dokud si na to nezvykne. 2. Dr klvesu pro pohyb dolu (j), dokud se jej funkce nezopakuje. ---> Te v jak se pesunout na nsledujc lekci. 3. Pouitm klvesy dolu pejdi na lekci 1.2. Poznmka: Pokud si nkdy nejsi jist nm, co jsi napsal, stla pro pechod do Normlnho mdu. Pot pepi poadovan pkaz. Poznmka: Kurzorov klvesy tak funguj, avak pouvn hjkl je rychlej jakmile si na nj zvykne. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 1.2: SPUTN A UKONEN VIM !! POZNMKA: Ped vykonnm tchto krok si peti celou lekci!! 1. Stla (pro ujitn, e se nachz v Normlnm mdu). 2. Napi: :q! . ---> Tmto ukon editor BEZ uloen zmn, kter si vykonal. Pokud chce uloit zmny a ukonit editor napi: :wq 3. A se dostane na pkazov dek, napi pkaz, kterm se dostane zpt do tto vuky. To me bt: vimtutor Bn se pouv: vim tutor ---> 'vim' znamen sputn editoru, 'tutor' je soubor k editaci. 4. Pokud si tyto kroky spolehliv pamatuje, vykonej kroky 1 a 3, m ukon a znovu spust editor. Potom pesu kurzor dolu na lekci 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 1.3: PRAVA TEXTU - MAZN ** Stisknutm klvesy x v Normlnm mdu smae znak na mst kurzoru. ** 1. Pesu kurzor ne na dek oznaen --->. 2. K odstrann chyb pejdi kurzorem na znak, kter chce smazat. 3. Stla klvesu x k odstrann nechtnch znak. 4. Opakuj kroky 2 a 4 dokud nen vta sprvn. ---> Krva skoilla pess mssc. 5. Pokud je vta sprvn, pejdi na lekci 1.4. POZNMKA: Nesna se pouze zapamatovat pedvdn pkazy, u se je pouvnm. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 1.4: PRAVA TEXTU - VKLDN ** Stlaen klvesy i v Normlnm mdu umouje vkldn textu. ** 1. Pesu kurzor na prvn dek oznaen --->. 2. Pro upraven prvnho dku do podoby dku druhho, pesu kurzor na prvn znak za msto, kde m bt text vloen. 3. Stla i a napi potebn dodatek. 4. Po opraven kad chyby stla pro nvrat do Normlnho mdu. Opakuj kroky 2 a 4 dokud nen vta sprvn. ---> Njak txt na tto . ---> Njak text chyb na tto dce. 5. Pokud ji ovld vkldn textu, pejdi na nsledujc shrnut. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SHRNUT LEKCE 1 1. Kurzorem se pohybuje pomoc ipek nebo klvesami hjkl. h (vlevo) j (dolu) k (nahoru) l (vpravo) 2. Pro sputn Vimu (z pkazovho dku) napi: vim SOUBOR 3. Pro ukonen Vimu napi: :q! bez uloen zmn. anebo: :wq pro uloen zmn. 4. Pro smazn znaku pod kurzorem napi v Normlnm mdu: x 5. Pro vkldn textu od msta kurzoru napi v Normlnm mdu: i vkldan text POZNMKA: Stlaen t pemst do Normlnho mdu nebo zru nechtn a sten dokonen pkaz. Nyn pokrauj Lekc 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 2.1: PKAZY MAZN ** Pkaz dw smae znaky do konce slova. ** 1. Stla k ubezpeen, e jsi v Normlnm mdu. 2. Pesu kurzor ne na dek oznaen --->. 3. Pesu kurzor na zatek slova, kter je poteba smazat. 4. Napi dw , aby slovo zmizelo. POZNMKA: Psmena dw se zobraz na poslednm dku obrazovky jakmile je nape. Kdy nape nco patn, stla a zani znova. ---> Jsou tu njak slova zbava, kter nepat list do tto vty. 5. Opakuj kroky 3 a 4 dokud nen vta sprvn a pejdi na lekci 2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 2.2: VCE PKAZ MAZN ** Napsn pkazu d$ smae ve a do konce dky. ** 1. Stla k ubezpeen, e jsi v Normlnm mdu. 2. Pesu kurzor ne na dek oznaen --->. 3. Pesu kurzor na konec sprvn vty (ZA prvn teku). 4. Napi d$ ,aby jsi smazal znaky a do konce dku. ---> Nkdo napsal konec tto vty dvakrt. konec tto vty dvakrt. 5. Pejdi na lekci 2.3 pro pochopen toho, co se stalo. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 2.3: ROZIOVAC PKAZY A OBJEKTY Formt mazacho pkazu d je nsledujc: [slo] d objekt NEBO d [slo] objekt Kde: slo - udv kolikrt se pkaz vykon (voliteln, vchoz=1). d - je pkaz mazn. objekt - udv na em se pkaz vykonv (vypsan ne). Krtk vpis objekt: w - od kurzoru do konce slova, vetn mezer. e - od kurzoru do konce slova, BEZ mezer. $ - od kurzoru do konce dku. POZNMKA: Stlaenm klvesy objektu v Normlnm mdu se kurzor pesune na msto upesnn ve vpisu objekt. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 2.4: VJIMKA Z 'PKAZ-OBJEKT' ** Napsnm dd smae cel dek. ** Vzhledem k astosti mazn celho dku se autoi Vimu rozhodli, e bude jednodu napsat prost dv d k smazn celho dku. 1. Pesu kurzor na druh dek spodnho textu. 2. Napi dd pro smazn dku. 3. Pejdi na tvrt dek. 4. Napi 2dd (vzpome si slo-pkaz-objekt) pro smazn dvou dk. 1) Re jsou erven, 2) Blto je zbavn, 3) Fialky jsou modr, 4) Mm auto, 5) Hodinky ukazuj as, 6) Cukr je sladk, 7) A to jsi i ty. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 2.5: PKAZ UNDO ** Stla u pro vrcen poslednho pkazu, U pro celou dku. ** 1. Pesu kurzor ne na dek oznaen ---> a pemsti ho na prvn chybu. 2. Napi x pro smazn prvnho nechtnho znaku. 3. Te napi u m vrt zpt posledn vykonan pkaz. 4. Nyn oprav vechny chyby na dku pomoc pkazu x . 5. Napi velk U m vrt dek do pvodnho stavu. 6. Te napi u nkolikrt, m vrt zpt pkaz U . 7. Stla CTRL-R (klvesu CTRL dr stlaenou a stiskni R) nkolikrt, m vrt zpt pedtm vrcen pkazy (redo). ---> Opprav chybby nna toomto dku a nahra je pommoc undo. 8. Toto jsou velmi uiten pkazy. Nyn pejdi na souhrn Lekce 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SHRNUT LEKCE 2 1. Pro smazn znak od kurzoru do konce slova napi: dw 2. Pro smazn znak od kurzoru do konce dku napi: d$ 3. Pro smazn celho dku napi: dd 4. Formt pkazu v Normlnm mdu je: [slo] pkaz objekt NEBO pkaz [slo] objekt kde: slo - udv poet opakovn pkazu pkaz - udv co je teba vykonat, napklad d mae objekt - udv rozsah pkazu, napklad w (slovo), $ (do konce dku), atd. 5. Pro vrcen pedel innosti, napi: u (mal u) Pro vrcen vech prav na dku napi: U (velk U) Pro vrcen vrcench prav (redo) napi: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 3.1: PKAZ VLOIT ** Pka p vlo posledn vymazan text za kurzor. ** 1. Pesu kurzor ne na posledn dek textu. 2. Napi dd pro smazn dku a jeho uloen do bufferu. 3. Pesu kurzor V݊E tam, kam smazan dek pat. 4. V Normlnm mdu napi p pro optn vloen dku. 5. Opakuj kroky 2 a 4 dokud dky nebudou ve sprvnm poad. d) Tak se doke vzdlvat? b) Fialky jsou modr, c) Inteligence se u, a) Re jsou erven, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 3.2: PKAZ NAHRAZEN ** Napsnm r a znaku se nahrad znak pod kurzorem. ** 1. Pesu kurzor ne na prvn dek oznaen --->. 2. Pesu kurzor na zatek prvn chyby. 3. Napi r a potom znak, kter nahrad chybu. 4. Opakuj kroky 2 a 3 dokud nen prvn dka sprvn. ---> Kdi byl pzn tento deg, nkdu stlail paqn klvesy! ---> Kdy byl psn tento dek, nkdo stlal patn klvesy! 5. Nyn pejdi na Lekci 3.2. POZNMKA: Zapamatuj si, e by ses ml uit pouvnm, ne zapamatovnm. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 3.3: PKAZ PRAVY ** Pokud chce zmnit st nebo cel slovo, napi cw . ** 1. Pesu kurzor ne na prvn dek oznaen --->. 2. Umsti kurzor na psmeno i v slov iok. 3. Napi cw a oprav slovo (v tomto ppad napi 'dek'.) 4. Stla a pejdi na dal chybu (prvn znak, kter teba zmnit.) 5. Opakuj kroky 3 a 4 dokud nen prvn vta stejn jako ta druh. ---> Tento iok m nkolik skic, kter psadoinsa zmnit pasdgf pkazu. ---> Tento dek m nkolik slov, kter potebuj zmnit pomoc pkazu. Vimni si, e cw nejen nahrazuje slovo, ale tak pemst do vkldn. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 3.4: VCE ZMN POUITM c ** Pkaz pro pravu se dru se stejnmi objekty jako ten pro mazn. ** 1. Pkaz pro pravu pracuje stejn jako pro mazn. Formt je: [slo] c objekt NEBO c [slo] objekt 2. Objekty jsou tak shodn, jako nap.: w (slovo), $ (konec dku), atd. 3. Pejdi ne na prvn dek oznaen --->. 4. Pesu kurzor na prvn rozdl. 5. Napi c$ pro upraven zbytku dku podle toho druhho a stla . ---> Konec tohoto dku potebuje pomoc, aby byl jako ten druh. ---> Konec tohoto dku potebuje opravit pouitm pkazu c$ . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SHRNUT LEKCE 3 1. Pro vloen textu, kter byl smazn, napi p . To vlo smazan text ZA kurzor (pokud byl dek smazan, pejde na dek pod kurzorem). 2. Pro nahrazen znaku pod kurzorem, napi r a potom znak, kterm chce pvodn znak nahradit. 3. Pkaz na upravovn umouje zmnit specifikovan objekt od kurzoru do konce objektu. Napklad: Napi cw ,m zmn text od pozice kurzoru do konce slova, c$ zmn text do konce dku. 4. Formt pro nahrazovn je: [slo] c objekt NEBO c [slo] objekt Nyn pejdi na nsledujc lekci. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 4.1: POZICE A STATUS SOUBORU ** Stla CTRL-g pro zobrazen sv pozice v souboru a statusu souboru. Stla SHIFT-G pro pechod na dek v souboru. ** Poznmka: Peti si celou lekci ne zane vykonvat kroky!! 1. Dr klvesu Ctrl stlaenou a stiskni g . Vespod obrazovky se zobraz stavov dek s nzvem souboru a dkou na kter se nachz. Zapamatuj si slo dku pro krok 3. 2. Stla shift-G pro pesun na konec souboru. 3. Napi slo dku na kterm si se nachzel a stla shift-G. To t vrt na dek, na kterm jsi dve stiskl Ctrl-g. (Kdy pe sla, tak se NEZOBRAZUJ na obrazovce.) 4. Pokud se ct schopn vykonat tyto kroky, vykonej je. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 4.2: PKAZ VYHLEDVN ** Napi / nsledovan etzcem pro vyhledn onoho etzce. ** 1. Stiskni / v Normlnm mdu. Vimni si, e tento znak se spolu s kurzorem zobraz v doln sti obrazovky jako pkaz : . 2. Nyn napi 'chhybba' . To je slovo, kter chce vyhledat. 3. Pro vyhledn dalho vsledku stejnho etzce, jednodue stla n . Pro vyhledn dalho vsledku stejnho etzce opanm smrem, stiskni Shift-N. 4. Pokud chce vyhledat etzec v opanm smru, pouij pkaz ? msto pkazu / . ---> "chhybba" nen zpsob, jak hlskovat chyba; chhybba je chyba. Poznmka: Kdy vyhledvn doshne konce souboru, bude pokraovat na jeho zatku. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 4.3: VYHLEDVN PROV ZVORKY ** Napi % pro nalezen prov ),], nebo } . ** 1. Pemsti kurzor na kteroukoli (, [, nebo { v dku oznaenm --->. 2. Nyn napi znak % . 3. Kurzor se pemst na odpovdajc zvorku. 4. Stla % pro pesun kurzoru zpt na otvrajc zvorku. ---> Toto ( je testovac dek ('s, ['s ] a {'s } v nm. )) Poznmka: Toto je velmi uiten p ladn programu s chybjcmi uzavracmi zvorkami. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 4.4: ZPSOB JAK ZMNIT CHYBY ** Napi :s/star/nov/g pro nahrazen slova 'nov' za 'star'. ** 1. Pesu kurzor na dek oznaen --->. 2. Napi :s/dobr/dobr . Vimni si, e tento pkaz zmn pouze prvn vskyt v dku. 3. Nyn napi :s/dobr/dobr/g co znamen celkov nahrazen v dku. Toto nahrad vechny vskyty v dku. ---> dobr suroviny a dobr nin jsou zkladem dobr kuchyn. 4. Pro zmnu vech vskyt etzce mezi dvma dky, Napi :#,#s/star/nov/g kde #,# jsou sla onch dek. Napi :%s/star/nov/g pro zmnu vech vskyt v celm souboru. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SHRNUT LEKCE 4 1. Ctrl-g vype tvou pozici v souboru a status souboru. Shift-G t pemst na konec souboru. slo nsledovan Shift-G t pesune na dan slo dku. 2. Napsn / nsledovan etzcem vyhled etzec smrem DOPEDU. Napsn ? nsledovan etzcem vyhled etzec smrem DOZADU. Napsn n po vyhledvn najde nsledujc vskyt etzce ve stejnm smru, Shift-N ve smru opanm. 3. Stisknut % kdy je kurzor na (,),[,],{, nebo } najde odpovdajc provou zvorku. 4. Pro nahrazen novho za prvn star v dku napi :s/star/nov Pro nahrazen novho za vechny star v dku napi :s/star/nov/g Pro nahrazen etzc mezi dvmi dkami # napi :#,#s/star/nov/g Pro nahrazen vech vskyt v souboru napi :%s/star/nov/g Pro potvrzen kadho nahrazen pidej 'c' :%s/star/nov/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 5.1: JAK VYKONAT VNJ PKAZ ** Napi :! nsledovan vnjm pkazem pro sputn pkazu. ** 1. Napi obvykl pkaz : , kter umst kurzor na spodek obrazovky To umon napsat pkaz. 2. Nyn stiskni ! (vykink). To umon vykonat jakkoliv vnj pkaz z pkazovho dku. 3. Napklad napi ls za ! a stiskni . Tento pkaz zobraz obsah tvho adrese jako v pkazovm dku. Vyzkouej :!dir pokud ls nefunguje. Poznmka: Takto je mon vykonat jakkoliv pkaz. Poznmka: Vechny pkazy : mus bt dokonen stisknutm ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 5.2: VCE O UKLDN SOUBOR ** Pro uloen zmn v souboru napi :w SOUBOR. ** 1. Napi :!dir nebo :!ls pro vpis aktulnho adrese. U v, e za tmto mus stisknout . 2. Vyber si nzev souboru, kter jet neexistuje, napklad TEST. 3. Nyn napi: :w TEST (kde TEST je vybran nzev souboru.) 4. To ulo cel soubor (Vuka Vimu) pod nzvem TEST. Pro oven napi znovu :!dir , m zobraz obsah adrese. Poznmka: Jakmile ukon Vim a znovu ho spust s nzvem souboru TEST, soubor bude pesn kopie vuky, kdy si ji ukldal. 5. Nyn odstra soubor napsnm (MS-DOS): :!del TEST nebo (Unix): :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 5.3: VBROV PKAZ ULOEN ** Pro uloen sti souboru napi :#,# w SOUBOR ** 1. Jet jednou napi :!dir nebo :!ls pro vpis aktulnho adrese a vyber vhodn nzev souboru jako nap. TEST. 2. Pesu kurzor na vrch tto strnky a stiskni Ctrl-g pro zobrazen sla dku. ZAPAMATUJ SI TOTO SLO! 3. Nyn se pesu na spodek tto strnky a opt stiskni Ctrl-g. ZAPAMATUJ SI I SLO TOHOTO DKU! 4. Pro uloen POUZE sti souboru, napi :#,# w TEST kde #,# jsou sla dvou zapamatovanch dk (vrch, spodek) a TEST je nzev souboru. 5. Znova se ujisti, e tam ten soubor je pomoc :!dir ale NEODSTRAUJ ho. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 5.4: SLUOVN SOUBOR ** K vloen obsahu souboru napi :r NZEV_SOUBORU ** 1. Napi :!dir pro ujitn, e soubor TEST stle existuje. 2. Pesu kurzor na vrch tto strnky. POZNMKA: Po vykonn kroku 3 uvid lekci 5.3. Potom se opt pesu dol na tuto lekci. 3. Nyn vlo soubor TEST pouitm pkazu :r TEST kde TEST je nzev souboru. POZNMKA: Soubor, kter vkld se vlo od msta, kde se nachz kurzor. 4. Pro potvrzen vloen souboru, pesu kurzor zpt a vimni si, e te m dv kopie lekce 5.3, originl a souborovou verzi. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SHRNUT LEKCE 5 1. :!pkaz vykon vnj pkaz. Nkter uiten pklady jsou: (MS-DOS) (Unix) :!dir :!ls - zobraz obsah souboru. :!del SOUBOR :!rm SOUBOR - odstran SOUBOR. 2. :w SOUBOR ulo aktuln text jako SOUBOR na disk. 3. :#,#w SOUBOR ulo dky od # do # do SOUBORU. 4. :r SOUBOR vybere z disku SOUBOR a vlo ho do editovanho souboru za pozici kurzoru. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 6.1: PKAZ OTEVT ** Napi o pro vloen dku pod kurzor a pepnut do Vkldacho mdu. ** 1. Pemsti kurzor ne na dek oznaen --->. 2. Napi o (mal) pro vloen dku POD kurzor a pepnut do Vkldacho mdu. 3. Nyn zkopruj dek oznaen ---> a stiskni pro ukonen Vkldacho mdu. ---> Po stisknut o se kurzor pemst na vloen dek do Vkldacho mdu. 4. Pro oteven dku NAD kurzorem jednodue napi velk O , msto malho o. Vyzkouej si to na nsledujcm dku. Vlo dek nad tmto napsnm Shift-O po umstn kurzoru na tento dek. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 6.2: PKAZ PIDAT ** Stiskni a pro vloen textu ZA kurzor. ** 1. Pesu kurzor na ne na konec dky oznaen ---> stisknutm $ v Normlnm mdu. 2. Stiskni a (mal) pro pidn textu ZA znak, kter je pod kurzorem. (Velk A pid na konec dku.) Poznmka: Tmto se vyhne stisknut i , poslednho znaku, textu na vloen, , kurzor doprava, a nakonec x na pidvn na konec dku! 3. Nyn dokon prvn dek. Vimni si, e pidvn je vlastn stejn jako Vkldac md, krom msta, kam se text vkld. ---> Tento dek ti umouje nacviit ---> Tento dek ti umouje nacviit pidvn textu na konec dky. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 6.3: JIN ZPSOB NAHRAZOVN ** Napi velk R pro nahrazen vc ne jednoho znaku. ** 1. Pesu kurzor na prvn dek oznaen --->. 2. Umsti kurzor na zatek prvnho slova, kter je odlin od druhho dku oznaenho ---> (slovo 'posledn'). 3. Nyn stiskni R a nahra zbytek textu na prvnm dku pepsnm starho textu tak, aby byl prvn dek stejn jako ten druh. ---> Pro upraven prvnho dku do tvaru toho posledn na stran pouij kl. ---> Pro upraven prvnho dku do tvaru toho druhho, napi R a nov text. 4. Vimni si, e jakmile stiskne vechen nezmnn text zstv. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 6.4: NASTAVEN MONOST ** Nastav monost, e vyhledvn anebo nahrazovn nedb velikosti psmen ** 1. Vyhledej etzec 'ignore' napsnm: /ignore Zopakuj nkolikrt stisknut klvesy n. 2. Nastav monost 'ic' (Ignore case) napsnm pkazu: :set ic 3. Nyn znovu vyhledej 'ignore' stisknutm: n Nkolikrt hledn zopakuj stisknutm klvesy n. 4. Nastav monosti 'hlsearch' a 'incsearch': :set hls is 5. Nyn znovu vykonej vyhledvac pkaz a sleduj, co se stane: /ignore 6. Pro vypnut zvrazovn vsledk napi: :nohlsearch ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SHRHNUT LEKCE 6 1. Stisknut o oteve nov dek POD kurzorem a umst kurzor na vloen dek do Vkldacho mdu. Napsn velkho O oteve dek NAD dkem, na kterm je kurzor. 2. Stiskni a pro vloen textu ZA znak na pozici kurzoru. Napsn velkho A automaticky pid text na konec dku. 3. Stisknut velkho R pepne do Nahrazovacho mdu, dokud nestiskne pro jeho ukonen. 4. Napsn ":set xxx" nastav monosti "xxx". ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCE 7: PKAZY ON-LINE NPOVDY ** Pouvej on-line systm npovdy ** Vim m obshl on-line systm npovdy. Pro zatek vyzkouej jeden z nsledujcch: - stiskni klvesu (pokud ji m) - stiskni klvesu (pokud ji m) - napi :help Napi :q pro uzaven okna npovdy. Me najt npovdu k jakmukoliv tmatu pidnm argumentu k pkazu ":help". Zkus tyto (nezapome stisknout ): :help w :help c_ Klávesa l je vpravo a vykoná pohyb vpravo. j Klávesa j vypadá na šipku dolu. v 1. Pohybuj kurzorem po obrazovce dokud si na to nezvykneš. 2. Drž klávesu pro pohyb dolu (j), dokud se její funkce nezopakuje. ---> Teď víš jak se přesunout na následující lekci. 3. Použitím klávesy dolu přejdi na lekci 1.2. Poznámka: Pokud si někdy nejsi jist něčím, co jsi napsal, stlač pro přechod do Normálního módu. Poté přepiš požadovaný příkaz. Poznámka: Kurzorové klávesy také fungují, avšak používání hjkl je rychlejší jakmile si na něj zvykneš. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 1.2: SPUŠTĚNÍ A UKONČENÍ VIM !! POZNÁMKA: Před vykonáním těchto kroků si přečti celou lekci!! 1. Stlač (pro ujištění, že se nacházíš v Normálním módu). 2. Napiš: :q! . ---> Tímto ukončíš editor BEZ uložení změn, které si vykonal. Pokud chceš uložit změny a ukončit editor napiš: :wq 3. Až se dostaneš na příkazový řádek, napiš příkaz, kterým se dostaneš zpět do této výuky. To může být: vimtutor Běžně se používá: vim tutor ---> 'vim' znamená spuštění editoru, 'tutor' je soubor k editaci. 4. Pokud si tyto kroky spolehlivě pamatuješ, vykonej kroky 1 až 3, čímž ukončíš a znovu spustíš editor. Potom přesuň kurzor dolu na lekci 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 1.3: ÚPRAVA TEXTU - MAZÁNÍ ** Stisknutím klávesy x v Normálním módu smažeš znak na místě kurzoru. ** 1. Přesuň kurzor níže na řádek označený --->. 2. K odstranění chyb přejdi kurzorem na znak, který chceš smazat. 3. Stlač klávesu x k odstranění nechtěných znaků. 4. Opakuj kroky 2 až 4 dokud není věta správně. ---> Krááva skoččilla přess měssíc. 5. Pokud je věta správně, přejdi na lekci 1.4. POZNÁMKA: Nesnaž se pouze zapamatovat předváděné příkazy, uč se je používáním. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 1.4: ÚPRAVA TEXTU - VKLÁDÁNÍ ** Stlačení klávesy i v Normálním módu umožňuje vkládání textu. ** 1. Přesuň kurzor na první řádek označený --->. 2. Pro upravení prvního řádku do podoby řádku druhého, přesuň kurzor na první znak za místo, kde má být text vložený. 3. Stlač i a napiš potřebný dodatek. 4. Po opravení každé chyby stlač pro návrat do Normálního módu. Opakuj kroky 2 až 4 dokud není věta správně. ---> Nějaký txt na této . ---> Nějaký text chybí na této řádce. 5. Pokud již ovládáš vkládání textu, přejdi na následující shrnutí. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SHRNUTÍ LEKCE 1 1. Kurzorem se pohybuje pomocí šipek nebo klávesami hjkl. h (vlevo) j (dolu) k (nahoru) l (vpravo) 2. Pro spuštění Vimu (z příkazového řádku) napiš: vim SOUBOR 3. Pro ukončení Vimu napiš: :q! bez uložení změn. anebo: :wq pro uložení změn. 4. Pro smazání znaku pod kurzorem napiš v Normálním módu: x 5. Pro vkládání textu od místa kurzoru napiš v Normálním módu: i vkládaný text POZNÁMKA: Stlačení tě přemístí do Normálního módu nebo zruší nechtěný a částečně dokončený příkaz. Nyní pokračuj Lekcí 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 2.1: PŘÍKAZY MAZÁNÍ ** Příkaz dw smaže znaky do konce slova. ** 1. Stlač k ubezpečení, že jsi v Normálním módu. 2. Přesuň kurzor níže na řádek označený --->. 3. Přesuň kurzor na začátek slova, které je potřeba smazat. 4. Napiš dw , aby slovo zmizelo. POZNÁMKA: Písmena dw se zobrazí na posledním řádku obrazovky jakmile je napíšeš. Když napíšeš něco špatně, stlač a začni znova. ---> Jsou tu nějaká slova zábava, která nepatří list do této věty. 5. Opakuj kroky 3 až 4 dokud není věta správně a přejdi na lekci 2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 2.2: VÍCE PŘÍKAZŮ MAZÁNÍ ** Napsání příkazu d$ smaže vše až do konce řádky. ** 1. Stlač k ubezpečení, že jsi v Normálním módu. 2. Přesuň kurzor níže na řádek označený --->. 3. Přesuň kurzor na konec správné věty (ZA první tečku). 4. Napiš d$ ,aby jsi smazal znaky až do konce řádku. ---> Někdo napsal konec této věty dvakrát. konec této věty dvakrát. 5. Přejdi na lekci 2.3 pro pochopení toho, co se stalo. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 2.3: ROZŠIŘOVACÍ PŘÍKAZY A OBJEKTY Formát mazacího příkazu d je následující: [číslo] d objekt NEBO d [číslo] objekt Kde: číslo - udává kolikrát se příkaz vykoná (volitelné, výchozí=1). d - je příkaz mazání. objekt - udává na čem se příkaz vykonává (vypsané níže). Krátký výpis objektů: w - od kurzoru do konce slova, včetně mezer. e - od kurzoru do konce slova, BEZ mezer. $ - od kurzoru do konce řádku. POZNÁMKA: Stlačením klávesy objektu v Normálním módu se kurzor přesune na místo upřesněné ve výpisu objektů. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 2.4: VÝJIMKA Z 'PŘÍKAZ-OBJEKT' ** Napsáním dd smažeš celý řádek. ** Vzhledem k častosti mazání celého řádku se autoři Vimu rozhodli, že bude jednoduší napsat prostě dvě d k smazání celého řádku. 1. Přesuň kurzor na druhý řádek spodního textu. 2. Napiš dd pro smazání řádku. 3. Přejdi na čtvrtý řádek. 4. Napiš 2dd (vzpomeň si číslo-příkaz-objekt) pro smazání dvou řádků. 1) Růže jsou červené, 2) Bláto je zábavné, 3) Fialky jsou modré, 4) Mám auto, 5) Hodinky ukazují čas, 6) Cukr je sladký, 7) A to jsi i ty. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 2.5: PŘÍKAZ UNDO ** Stlač u pro vrácení posledního příkazu, U pro celou řádku. ** 1. Přesuň kurzor níže na řádek označený ---> a přemísti ho na první chybu. 2. Napiš x pro smazání prvního nechtěného znaku. 3. Teď napiš u čímž vrátíš zpět poslední vykonaný příkaz. 4. Nyní oprav všechny chyby na řádku pomocí příkazu x . 5. Napiš velké U čímž vrátíš řádek do původního stavu. 6. Teď napiš u několikrát, čímž vrátíš zpět příkaz U . 7. Stlač CTRL-R (klávesu CTRL drž stlačenou a stiskni R) několikrát, čímž vrátíš zpět předtím vrácené příkazy (redo). ---> Opprav chybby nna toomto řádku a nahraď je pommocí undo. 8. Toto jsou velmi užitečné příkazy. Nyní přejdi na souhrn Lekce 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SHRNUTÍ LEKCE 2 1. Pro smazání znaků od kurzoru do konce slova napiš: dw 2. Pro smazání znaků od kurzoru do konce řádku napiš: d$ 3. Pro smazání celého řádku napiš: dd 4. Formát příkazu v Normálním módu je: [číslo] příkaz objekt NEBO příkaz [číslo] objekt kde: číslo - udává počet opakování příkazu příkaz - udává co je třeba vykonat, například d maže objekt - udává rozsah příkazu, například w (slovo), $ (do konce řádku), atd. 5. Pro vrácení předešlé činnosti, napiš: u (malé u) Pro vrácení všech úprav na řádku napiš: U (velké U) Pro vrácení vrácených úprav (redo) napiš: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 3.1: PŘÍKAZ VLOŽIT ** Příka p vloží poslední vymazaný text za kurzor. ** 1. Přesuň kurzor níže na poslední řádek textu. 2. Napiš dd pro smazání řádku a jeho uložení do bufferu. 3. Přesuň kurzor VÝŠE tam, kam smazaný řádek patří. 4. V Normálním módu napiš p pro opětné vložení řádku. 5. Opakuj kroky 2 až 4 dokud řádky nebudou ve správném pořadí. d) Také se dokážeš vzdělávat? b) Fialky jsou modré, c) Inteligence se učí, a) Růže jsou červené, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 3.2: PŘÍKAZ NAHRAZENÍ ** Napsáním r a znaku se nahradí znak pod kurzorem. ** 1. Přesuň kurzor níže na první řádek označený --->. 2. Přesuň kurzor na začátek první chyby. 3. Napiš r a potom znak, který nahradí chybu. 4. Opakuj kroky 2 až 3 dokud není první řádka správně. ---> Kdiž byl pzán tento řádeg, někdu stlažil špaqné klávesy! ---> Když byl psán tento řádek, někdo stlačíl špatné klávesy! 5. Nyní přejdi na Lekci 3.2. POZNÁMKA: Zapamatuj si, že by ses měl učit používáním, ne zapamatováním. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 3.3: PŘÍKAZ ÚPRAVY ** Pokud chceš změnit část nebo celé slovo, napiš cw . ** 1. Přesuň kurzor níže na první řádek označený --->. 2. Umísti kurzor na písmeno i v slově řiťok. 3. Napiš cw a oprav slovo (v tomto případě napiš 'ádek'.) 4. Stlač a přejdi na další chybu (první znak, který třeba změnit.) 5. Opakuj kroky 3 až 4 dokud není první věta stejná jako ta druhá. ---> Tento řiťok má několik skic, které psadoinsa změnit pasdgf příkazu. ---> Tento řádek má několik slov, které potřebují změnit pomocí příkazu. Všimni si, že cw nejen nahrazuje slovo, ale také přemístí do vkládání. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 3.4: VÍCE ZMĚN POUŽITÍM c ** Příkaz pro úpravu se druží se stejnými objekty jako ten pro mazání. ** 1. Příkaz pro úpravu pracuje stejně jako pro mazání. Formát je: [číslo] c objekt NEBO c [číslo] objekt 2. Objekty jsou také shodné, jako např.: w (slovo), $ (konec řádku), atd. 3. Přejdi níže na první řádek označený --->. 4. Přesuň kurzor na první rozdíl. 5. Napiš c$ pro upravení zbytku řádku podle toho druhého a stlač . ---> Konec tohoto řádku potřebuje pomoc, aby byl jako ten druhý. ---> Konec tohoto řádku potřebuje opravit použitím příkazu c$ . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SHRNUTÍ LEKCE 3 1. Pro vložení textu, který byl smazán, napiš p . To vloží smazaný text ZA kurzor (pokud byl řádek smazaný, přejde na řádek pod kurzorem). 2. Pro nahrazení znaku pod kurzorem, napiš r a potom znak, kterým chceš původní znak nahradit. 3. Příkaz na upravování umožňuje změnit specifikovaný objekt od kurzoru do konce objektu. Například: Napiš cw ,čímž změníš text od pozice kurzoru do konce slova, c$ změní text do konce řádku. 4. Formát pro nahrazování je: [číslo] c objekt NEBO c [číslo] objekt Nyní přejdi na následující lekci. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 4.1: POZICE A STATUS SOUBORU ** Stlač CTRL-g pro zobrazení své pozice v souboru a statusu souboru. Stlač SHIFT-G pro přechod na řádek v souboru. ** Poznámka: Přečti si celou lekci než začneš vykonávat kroky!! 1. Drž klávesu Ctrl stlačenou a stiskni g . Vespod obrazovky se zobrazí stavový řádek s názvem souboru a řádkou na které se nacházíš. Zapamatuj si číslo řádku pro krok 3. 2. Stlač shift-G pro přesun na konec souboru. 3. Napiš číslo řádku na kterém si se nacházel a stlač shift-G. To tě vrátí na řádek, na kterém jsi dříve stiskl Ctrl-g. (Když píšeš čísla, tak se NEZOBRAZUJÍ na obrazovce.) 4. Pokud se cítíš schopný vykonat tyto kroky, vykonej je. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 4.2: PŘÍKAZ VYHLEDÁVÁNÍ ** Napiš / následované řetězcem pro vyhledání onoho řetězce. ** 1. Stiskni / v Normálním módu. Všimni si, že tento znak se spolu s kurzorem zobrazí v dolní části obrazovky jako příkaz : . 2. Nyní napiš 'chhybba' . To je slovo, které chceš vyhledat. 3. Pro vyhledání dalšího výsledku stejného řetězce, jednoduše stlač n . Pro vyhledání dalšího výsledku stejného řetězce opačným směrem, stiskni Shift-N. 4. Pokud chceš vyhledat řetězec v opačném směru, použij příkaz ? místo příkazu / . ---> "chhybba" není způsob, jak hláskovat chyba; chhybba je chyba. Poznámka: Když vyhledávání dosáhne konce souboru, bude pokračovat na jeho začátku. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 4.3: VYHLEDÁVÁNÍ PÁROVÉ ZÁVORKY ** Napiš % pro nalezení párové ),], nebo } . ** 1. Přemísti kurzor na kteroukoli (, [, nebo { v řádku označeném --->. 2. Nyní napiš znak % . 3. Kurzor se přemístí na odpovídající závorku. 4. Stlač % pro přesun kurzoru zpět na otvírající závorku. ---> Toto ( je testovací řádek ('s, ['s ] a {'s } v něm. )) Poznámka: Toto je velmi užitečné pří ladění programu s chybějícími uzavíracími závorkami. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 4.4: ZPŮSOB JAK ZMĚNIT CHYBY ** Napiš :s/staré/nové/g pro nahrazení slova 'nové' za 'staré'. ** 1. Přesuň kurzor na řádek označený --->. 2. Napiš :s/dobréé/dobré . Všimni si, že tento příkaz změní pouze první výskyt v řádku. 3. Nyní napiš :s/dobréé/dobré/g což znamená celkové nahrazení v řádku. Toto nahradí všechny výskyty v řádku. ---> dobréé suroviny a dobréé náčiní jsou základem dobréé kuchyně. 4. Pro změnu všech výskytů řetězce mezi dvěma řádky, Napiš :#,#s/staré/nové/g kde #,# jsou čísla oněch řádek. Napiš :%s/staré/nové/g pro změnu všech výskytů v celém souboru. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SHRNUTÍ LEKCE 4 1. Ctrl-g vypíše tvou pozici v souboru a status souboru. Shift-G tě přemístí na konec souboru. Číslo následované Shift-G tě přesune na dané číslo řádku. 2. Napsání / následované řetězcem vyhledá řetězec směrem DOPŘEDU. Napsání ? následované řetězcem vyhledá řetězec směrem DOZADU. Napsání n po vyhledávání najde následující výskyt řetězce ve stejném směru, Shift-N ve směru opačném. 3. Stisknutí % když je kurzor na (,),[,],{, nebo } najde odpovídající párovou závorku. 4. Pro nahrazení nového za první starý v řádku napiš :s/staré/nové Pro nahrazení nového za všechny staré v řádku napiš :s/staré/nové/g Pro nahrazení řetězců mezi dvěmi řádkami # napiš :#,#s/staré/nové/g Pro nahrazení všech výskytů v souboru napiš :%s/staré/nové/g Pro potvrzení každého nahrazení přidej 'c' :%s/staré/nové/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 5.1: JAK VYKONAT VNĚJŠÍ PŘÍKAZ ** Napiš :! následované vnějším příkazem pro spuštění příkazu. ** 1. Napiš obvyklý příkaz : , který umístí kurzor na spodek obrazovky To umožní napsat příkaz. 2. Nyní stiskni ! (vykřičník). To umožní vykonat jakýkoliv vnější příkaz z příkazového řádku. 3. Například napiš ls za ! a stiskni . Tento příkaz zobrazí obsah tvého adresáře jako v příkazovém řádku. Vyzkoušej :!dir pokud ls nefunguje. Poznámka: Takto je možné vykonat jakýkoliv příkaz. Poznámka: Všechny příkazy : musí být dokončené stisknutím ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 5.2: VÍCE O UKLÁDÁNÍ SOUBORŮ ** Pro uložení změn v souboru napiš :w SOUBOR. ** 1. Napiš :!dir nebo :!ls pro výpis aktuálního adresáře. Už víš, že za tímto musíš stisknout . 2. Vyber si název souboru, který ještě neexistuje, například TEST. 3. Nyní napiš: :w TEST (kde TEST je vybraný název souboru.) 4. To uloží celý soubor (Výuka Vimu) pod názvem TEST. Pro ověření napiš znovu :!dir , čímž zobrazíš obsah adresáře. Poznámka: Jakmile ukončíš Vim a znovu ho spustíš s názvem souboru TEST, soubor bude přesná kopie výuky, když si ji ukládal. 5. Nyní odstraň soubor napsáním (MS-DOS): :!del TEST nebo (Unix): :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 5.3: VÝBĚROVÝ PŘÍKAZ ULOŽENÍ ** Pro uložení části souboru napiš :#,# w SOUBOR ** 1. Ještě jednou napiš :!dir nebo :!ls pro výpis aktuálního adresáře a vyber vhodný název souboru jako např. TEST. 2. Přesuň kurzor na vrch této stránky a stiskni Ctrl-g pro zobrazení čísla řádku. ZAPAMATUJ SI TOTO ČÍSLO! 3. Nyní se přesuň na spodek této stránky a opět stiskni Ctrl-g. ZAPAMATUJ SI I ČÍSLO TOHOTO ŘÁDKU! 4. Pro uložení POUZE části souboru, napiš :#,# w TEST kde #,# jsou čísla dvou zapamatovaných řádků (vrch, spodek) a TEST je název souboru. 5. Znova se ujisti, že tam ten soubor je pomocí :!dir ale NEODSTRAŇUJ ho. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 5.4: SLUČOVÁNÍ SOUBORŮ ** K vložení obsahu souboru napiš :r NÁZEV_SOUBORU ** 1. Napiš :!dir pro ujištění, že soubor TEST stále existuje. 2. Přesuň kurzor na vrch této stránky. POZNÁMKA: Po vykonání kroku 3 uvidíš lekci 5.3. Potom se opět přesuň dolů na tuto lekci. 3. Nyní vlož soubor TEST použitím příkazu :r TEST kde TEST je název souboru. POZNÁMKA: Soubor, který vkládáš se vloží od místa, kde se nachází kurzor. 4. Pro potvrzení vložení souboru, přesuň kurzor zpět a všimni si, že teď máš dvě kopie lekce 5.3, originál a souborovou verzi. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SHRNUTÍ LEKCE 5 1. :!příkaz vykoná vnější příkaz. Některé užitečné příklady jsou: (MS-DOS) (Unix) :!dir :!ls - zobrazí obsah souboru. :!del SOUBOR :!rm SOUBOR - odstraní SOUBOR. 2. :w SOUBOR uloží aktuální text jako SOUBOR na disk. 3. :#,#w SOUBOR uloží řádky od # do # do SOUBORU. 4. :r SOUBOR vybere z disku SOUBOR a vloží ho do editovaného souboru za pozici kurzoru. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 6.1: PŘÍKAZ OTEVŘÍT ** Napiš o pro vložení řádku pod kurzor a přepnutí do Vkládacího módu. ** 1. Přemísti kurzor níže na řádek označený --->. 2. Napiš o (malé) pro vložení řádku POD kurzor a přepnutí do Vkládacího módu. 3. Nyní zkopíruj řádek označený ---> a stiskni pro ukončení Vkládacího módu. ---> Po stisknutí o se kurzor přemístí na vložený řádek do Vkládacího módu. 4. Pro otevření řádku NAD kurzorem jednoduše napiš velké O , místo malého o. Vyzkoušej si to na následujícím řádku. Vlož řádek nad tímto napsáním Shift-O po umístění kurzoru na tento řádek. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 6.2: PŘÍKAZ PŘIDAT ** Stiskni a pro vložení textu ZA kurzor. ** 1. Přesuň kurzor na níže na konec řádky označené ---> stisknutím $ v Normálním módu. 2. Stiskni a (malé) pro přidání textu ZA znak, který je pod kurzorem. (Velké A přidá na konec řádku.) Poznámka: Tímto se vyhneš stisknutí i , posledního znaku, textu na vložení, , kurzor doprava, a nakonec x na přidávání na konec řádku! 3. Nyní dokončí první řádek. Všimni si, že přidávání je vlastně stejné jako Vkládací mód, kromě místa, kam se text vkládá. ---> Tento řádek ti umožňuje nacvičit ---> Tento řádek ti umožňuje nacvičit přidávání textu na konec řádky. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 6.3: JINÝ ZPŮSOB NAHRAZOVÁNÍ ** Napiš velké R pro nahrazení víc než jednoho znaku. ** 1. Přesuň kurzor na první řádek označený --->. 2. Umísti kurzor na začátek prvního slova, které je odlišné od druhého řádku označeného ---> (slovo 'poslední'). 3. Nyní stiskni R a nahraď zbytek textu na prvním řádku přepsáním starého textu tak, aby byl první řádek stejný jako ten druhý. ---> Pro upravení prvního řádku do tvaru toho poslední na straně použij kl. ---> Pro upravení prvního řádku do tvaru toho druhého, napiš R a nový text. 4. Všimni si, že jakmile stiskneš všechen nezměněný text zůstává. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekce 6.4: NASTAVENÍ MOŽNOSTÍ ** Nastav možnost, že vyhledávání anebo nahrazování nedbá velikosti písmen ** 1. Vyhledej řetězec 'ignore' napsáním: /ignore Zopakuj několikrát stisknutí klávesy n. 2. Nastav možnost 'ic' (Ignore case) napsáním příkazu: :set ic 3. Nyní znovu vyhledej 'ignore' stisknutím: n Několikrát hledání zopakuj stisknutím klávesy n. 4. Nastav možnosti 'hlsearch' a 'incsearch': :set hls is 5. Nyní znovu vykonej vyhledávací příkaz a sleduj, co se stane: /ignore 6. Pro vypnutí zvýrazňování výsledků napiš: :nohlsearch ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SHRHNUTÍ LEKCE 6 1. Stisknutí o otevře nový řádek POD kurzorem a umístí kurzor na vložený řádek do Vkládacího módu. Napsání velkého O otevře řádek NAD řádkem, na kterém je kurzor. 2. Stiskni a pro vložení textu ZA znak na pozici kurzoru. Napsání velkého A automaticky přidá text na konec řádku. 3. Stisknutí velkého R přepne do Nahrazovacího módu, dokud nestiskneš pro jeho ukončení. 4. Napsání ":set xxx" nastaví možnosti "xxx". ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCE 7: PŘÍKAZY ON-LINE NÁPOVĚDY ** Používej on-line systém nápovědy ** Vim má obsáhlý on-line systém nápovědy. Pro začátek vyzkoušej jeden z následujících: - stiskni klávesu (pokud ji máš) - stiskni klávesu (pokud ji máš) - napiš :help Napiš :q pro uzavření okna nápovědy. Můžeš najít nápovědu k jakémukoliv tématu přidáním argumentu k příkazu ":help". Zkus tyto (nezapomeň stisknout ): :help w :help c_ 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 umher, bis Du Dich sicher fhlst. 2. Halte die Nach-Unten-Taste (j) gedrckt, bis sie sich wiederholt. Jetzt weit Du, wie Du Dich zur nchsten Lektion bewegen kannst. 3. Benutze die Nach-Unten-Taste, um Dich zu Lektion 1.2 zu bewegen. Anmerkung: Immer, wenn Du Dir unsicher bist ber das, was Du getippt hast, drcke , um Dich in den Normalmodus zu begeben. Dann gib das gewnschte Kommando noch einmal ein. Anmerkung: 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 einmal daran gewhnt hast. Wirklich! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 1.2: VIM BEENDEN !! Hinweis: Bevor Du einen der unten aufgefhrten Schritte ausfhrst, lies diese gesamte Lektion!! 1. Drcke die Taste (um sicherzustellen, dass Du im Normalmodus bist). 2. Tippe: :q! . Dies beendet den Editor und VERWIRFT alle nderungen, die Du gemacht hast. 3. Wenn Du die Eingabeaufforderung siehst, gib das Kommando ein, das Dich zu diesem Tutor gefhrt hat. Dies wre: vimtutor 4. Wenn Du Dir diese Schritte eingeprgt hast und Du Dich sicher fhlst, fhre Schritte 1 bis 3 aus, um den Editor zu verlassen und wieder hineinzugelangen. Anmerkung: :q! verwirft alle nderungen, die Du gemacht hast. Einige Lektionen spter lernst Du, die nderungen in einer Datei zu speichern. 5. Bewege den Cursor abwrts zu Lektion 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 1.3: TEXT EDITIEREN - LSCHEN ** Drcke x , um das Zeichen unter dem Cursor zu lschen. ** 1. Bewege den Cursor zu der mit ---> markierten Zeile unten. 2. Um die Fehler zu beheben, bewege den Cursor, bis er ber dem Zeichen steht, das gelscht werden soll. 3. Drcke die x Taste, um das unerwnschte Zeichen zu lschen. 4. Wiederhole die Schritte 2 bis 4, bis der Satz korrekt ist. ---> Die Kkuh sprangg bberr deen Moond. 5. Nun, da die Zeile korrekt ist, gehe weiter zur Lektion 1.4. Anmerkung: Whrend Du durch diesen Tutor gehst, versuche nicht, auswendig zu lernen, lerne vielmehr durch Anwenden. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 1.4: TEXT EDITIEREN - EINFGEN ** Drcke i , um Text einzufgen. ** 1. Bewege den Cursor zur ersten unten stehenden mit ---> markierten Zeile. 2. Um die erste Zeile mit der zweiten gleichzumachen, bewege den Cursor auf das erste Zeichen NACH der Stelle, an der Text eingefgt werden soll. 3. Drcke i und gib die ntigen Ergnzungen ein. 4. Wenn jeweils ein Fehler beseitigt ist, drcke , um zum Normalmodus zurckzukehren. Wiederhole 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 Einfgen von Text sicher fhlst, gehe zu Lektion 1.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 1.5: TEXT EDITIEREN - ANFGEN ** Drcke A , um Text anzufgen. ** 1. Bewege den Cursor zur ersten unten stehenden mit ---> markierten Zeile. Dabei ist gleichgltig, auf welchem Zeichen der Zeile der Cursor steht. 2. Drcke A und gib die erforderlichen Ergnzungen ein. 3. Wenn das Anfgen abgeschlossen ist, drcke , um in den Normalmodus zurckzukehren. 4. Bewege den Cursor zur zweiten mit ---> markierten Zeile und wiederhole die Schritte 2 und 3, um den Satz zu auszubessern. ---> In dieser Zeile feh In dieser Zeile fehlt etwas Text. ---> Auch hier steh Auch hier steht etwas Unvollstndiges. 5. Wenn Du dich mit dem Anfgen von Text sicher fhlst, gehe zu Lektion 1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 1.6: EINE DATEI EDITIEREN ** Benutze :wq , um eine Datei zu speichern und Vim zu verlassen. ** !! Hinweis: Bevor Du einen der unten aufgefhrten Schritte ausfhrst, lies diese gesamte Lektion!! 1. Verlasse den Editor so wie in Lektion 1.2: :q! Oder, falls du Zugriff zu einem anderen Terminal hast, fhre das Folgende dort aus. 2. Gib dieses Kommando in die Eingabeaufforderung ein: vim tutor 'vim' ist der Aufruf des Editors, 'tutor' ist die zu editierende Datei. Benutze eine Datei, die gendert werden darf. 3. Fge Text ein oder lsche ihn, wie Du in den vorangehenden Lektionen gelernt hast. 4. Speichere die genderte Datei und verlasse Vim mit: :wq 5. Falls Du in Schritt 1 den vimtutor beendet hast, starte vimtutor neu und bewege dich abwrts bis zur folgenden Zusammenfassung. 6. Nachdem Du obige Schritte gelesen und verstanden hast: fhre sie durch. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZUSAMMENFASSUNG VON LEKTION 1 1. Der Cursor wird mit den Pfeiltasten oder den Tasten hjkl bewegt. h (links) j (unten) k (aufwrts) l (rechts) 2. Um Vim aus der Eingabeaufforderung zu starten, tippe: vim DATEI 3. Um Vim zu verlassen und alle nderungen zu verwerfen, tippe: :q! . 4. Um das Zeichen unter dem Cursor zu lschen, tippe: x 5. Um Text einzufgen oder anzufgen, tippe: i Einzufgenden Text eingeben Einfgen vor dem Cursor A Anzufgenden Text eingeben Anfgen nach dem Zeilenende Anmerkung: Drcken von bringt Dich in den Normalmodus oder bricht ein ungewolltes, erst teilweise eingegebenes Kommando ab. Nun fahre mit Lektion 2 fort. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 2.1: LSCHKOMMANDOS ** Tippe dw , um ein Wort zu lschen. ** 1. Drcke , um sicherzustellen, dass Du im Normalmodus bist. 2. Bewege den Cursor zu der mit ---> markierten Zeile unten. 3. Bewege den Cursor zum Anfang eines Wortes, das gelscht werden soll. 4. Tippe dw , um das Wort zu entfernen. Anmerkung: Der Buchstabe d erscheint auf der untersten Zeile des Schirms, wenn Du ihn eingibst. Vim wartet darauf, dass Du w eingibst. Falls Du ein anderes Zeichen als d siehst, hast Du etwas Falsches getippt; drcke und beginne noch einmal. ---> Einige Wrter lustig gehren nicht Papier in diesen Satz. 5. Wiederhole die Schritte 3 und 4, bis der Satz korrekt ist und gehe zur Lektion 2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 2.2: WEITERE LSCHKOMMANDOS ** Tippe d$ , um bis zum Ende der Zeile zu lschen. ** 1. Drcke , um sicherzustellen, dass Du im Normalmodus 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 Zeilenende zu lschen. ---> Jemand hat das Ende der Zeile doppelt eingegeben. doppelt eingegeben. 5. Gehe weiter zur Lektion 2.3 , um zu verstehen, was hierbei vorgeht. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 2.3: BER OPERATOREN UND BEWEGUNGSZGE Viele Kommandos, die Text ndern, setzen sich aus einem Operator und einer Bewegung zusammen. Das Format fr ein Lschkommando mit dem Lschoperator d lautet wie folgt: d Bewegung wobei: d - der Lschoperator Bewegung - worauf der Lschoperator angewandt wird (unten aufgefhrt). Eine kleine Auflistung von Bewegungen: w - bis zum Beginn des nchsten Wortes OHNE dessen erstes Zeichen. e - zum Ende des aktuellen Wortes MIT dessen letztem Zeichen. $ - zum Ende der Zeile MIT dem letzten Zeichen. Dementsprechend lscht die Eingabe von de vom Cursor an bis zum Wortende. Anmerkung: Die Eingabe lediglich des Bewegungsteils im Normalmodus bewegt den Cursor entsprechend. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 2.4: ANWENDUNG EINES ZHLERS FR EINEN BEWEGUNGSSCHRITT ** Die Eingabe einer Zahl vor einem Bewegungsschritt wiederholt diesen. ** 1. Bewege den Cursor zum Beginn der mit ---> markierten Zeile unten. 2. Tippe 2w , um den Cursor zwei Wrter vorwrts zu bewegen. 3. Tippe 3e , um den Cursor zum Ende des dritten Wortes zu bewegen. 4. Tippe 0 (Null) , um zum Anfang der Zeile zu gelangen. 5. Wiederhole Schritte 2 und 3 mit verschiedenen Nummern. ---> Dies ist nur eine Zeile aus Wrtern, um sich darin herumzubewegen. 6. Gehe weiter zu Lektion 2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 2.5: ANWENDUNG EINES ZHLERS FR MEHRERE LSCHVORGNGE ** Die Eingabe einer Zahl mit einem Operator wiederholt diesen mehrfach. ** In der Kombination aus Lschoperator und Bewegungsschritt (siehe oben) stellt man, um mehr zu lschen dem Schritt einen Zhler voran: d Nummer Bewegungsschritt 1. Bewege den Cursor zum ersten Wort in GROSSBUCHSTABEN in der mit ---> markieren Zeile. 2. Tippe d2w , um die zwei Wrter in GROSSBUCHSTABEN zu lschen. 3. Wiederhole Schritte 1 und 2 mit einem anderen Zhler, um die darauffol- genden Wrter in GROSSBUCHSTABEN mit einem einzigen Kommando zu lschen. ---> Diese ABC DE Zeile FGHI JK LMN OP mit Wrtern ist Q RS TUV bereinigt. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 2.6: ARBEITEN AUF ZEILEN ** Tippe dd , um eine ganze Zeile zu lschen. ** Wegen der Hufigkeit, dass man ganze Zeilen lscht, kamen die Entwickler von Vi darauf, dass es leichter wre, einfach zwei d's einzugeben, um eine Zeile zu lschen. 1. Bewege den Cursor zur zweiten Zeile in der unten stehenden Redewendung. 2. Tippe dd , um die Zeile zu lschen. 3. Nun bewege Dich zur vierten Zeile. 4. Tippe 2dd , um zwei Zeilen zu lschen. ---> 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.7: RCKGNGIG MACHEN (UNDO) ** Tippe u , um die letzten Kommandos rckgngig 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 unerwnschte Zeichen zu lschen. 3. Nun tippe u , um das soeben ausgefhrte Kommando rckgngig zu machen. 4. Jetzt behebe alle Fehler auf der Zeile mit Hilfe des x Kommandos. 5. Nun tippe ein groes U , um die Zeile in ihren Ursprungszustand wiederherzustellen. 6. Nun tippe u einige Male, um das U und die vorhergehenden Kommandos rckgngig zu machen. 7. Nun tippe CTRL-R (halte CTRL gedrckt und drcke R) mehrere Male, um die Kommandos wiederherzustellen (die Rckgngigmachungen rckgngig machen). ---> Beehebe die Fehller diesser Zeile und sttelle sie mitt 'undo' wieder her. 8. Dies sind sehr ntzliche Kommandos. Nun gehe weiter zur Zusammenfassung von Lektion 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZUSAMMENFASSUNG VON LEKTION 2 1. Um vom Cursor bis zum nchsten Wort zu lschen, tippe: dw 2. Um vom Cursor bis zum Ende einer Zeile zu lschen, tippe: d$ 3. Um eine ganze Zeile zu lschen, tippe: dd 4. Um eine Bewegung zu wiederholen, stelle eine Nummer voran: 2w 5. Das Format fr ein nderungskommando ist: Operator [Anzahl] Bewegungsschritt wobei: Operator - gibt an, was getan werden soll, zum Beispiel d fr delete [Anzahl] - ein optionaler Zhler, um den Bewegungsschritt zu wiederholen Bewegungsschritt - Bewegung ber den zu ndernden Text, wie w (Wort), $ (zum Ende der Zeile), etc. 6. Um Dich zum Anfang der Zeile zu begeben, benutze die Null: 0 7. Um vorherige Aktionen rckgngig zu machen, tippe: u (kleines u) Um alle nderungen auf einer Zeile rckgngig zu machen: U (groes U) Um die Rckgngigmachungen rckgngig zu machen, tippe: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 3.1: ANFGEN (PUT) ** Tippe p , um vorher gelschten Text nach dem Cursor anzufgen. ** 1. Bewege den Cursor zur ersten unten stehenden mit ---> markierten Zeile. 2. Tippe dd , um die Zeile zu lschen und sie in einem Vim-Register zu speichern. 3. Bewege den Cursor zur Zeile c), BER derjenigen, wo die gelschte Zeile platziert werden soll. 4. Tippe p , um die Zeile unterhalb des Cursors 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 lernbar, ---> a) Rosen sind rot, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 3.2: ERSETZEN (REPLACE) ** Tippe rx , um das Zeichen unter dem Cursor durch x 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 anschlieend das Zeichen, welches dort stehen sollte. 4. Wiederhole Schritte 2 und 3, bis die erste Zeile gleich der zweiten ist. ---> Alf 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. Anmerkung: Erinnere Dich daran, dass Du durch Anwenden lernen solltest, nicht durch Auswendiglernen. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 3.3: NDERN (CHANGE) ** Um eine nderung bis zum Wortende durchzufhren, tippe ce . ** 1. Bewege den Cursor zur ersten unten stehenden mit ---> markierten Zeile. 2. Platziere den Cursor auf das s von Wstwr. 3. Tippe ce und die Wortkorrektur ein (in diesem Fall tippe rter ). 4. Drcke und bewege den Cursor zum nchsten zu ndernden Zeichen. 5. Wiederhole Schritte 3 und 4 bis der erste Satz gleich dem zweiten ist. ---> Einige Wstwr dieser Zlaww lasdjlaf mit dem ndern-Operator gaaauu werden. ---> Einige Wrter dieser Zeile sollen mit dem ndern-Operator gendert werden. Beachte, dass ce das Wort lscht und Dich in den Eingabemodus versetzt. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 3.4: MEHR NDERUNGEN MITTELS c ** Das change-Kommando arbeitet mit denselben Bewegungen wie delete. ** 1. Der change Operator arbeitet in gleicher Weise wie delete. Das Format ist: c [Anzahl] Bewegungsschritt 2. Die Bewegungsschritte sind die gleichen , so wie w (Wort) und $ (Zeilenende). 3. Bewege Dich zur ersten unten stehenden mit ---> markierten Zeile. 4. Bewege den Cursor zum ersten Fehler. 5. Tippe c$ , gib den Rest der Zeile wie in der zweiten ein, drcke . ---> Das Ende dieser Zeile soll an die zweite Zeile angeglichen werden. ---> Das Ende dieser Zeile soll mit dem c$ Kommando korrigiert werden. Anmerkung: Du kannst die Rcktaste benutzen, um Tippfehler zu korrigieren. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZUSAMMENFASSUNG VON LEKTION 3 1. Um einen vorher gelschten Text anzufgen, tippe p . Dies fgt den gelschten Text NACH dem Cursor an (wenn eine ganze Zeile gelscht wurde, wird diese in die Zeile unter dem Cursor eingefgt). 2. Um das Zeichen unter dem Cursor zu ersetzen, tippe r und danach das an dieser Stelle gewollte Zeichen. 3. Der nderungs- (change) Operator erlaubt, vom Cursor bis zum Ende des Bewegungsschrittes zu ndern. Tippe ce , um eine nderung vom Cursor bis zum Ende des Wortes vorzunehmen; c$ bis zum Ende einer Zeile. 4. Das Format fr change ist: c [Anzahl] Bewegungsschritt Nun fahre mit der nchsten Lektion fort. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 4.1: CURSORPOSITION UND DATEISTATUS ** Tippe CTRL-G , um deine Dateiposition sowie den Dateistatus anzuzeigen. ** ** Tippe G , um Dich zu einer Zeile in der Datei zu begeben. ** Anmerkung: Lies diese gesamte Lektion, bevor Du irgendeinen Schritt ausfhrst!! 1. Halte die Ctrl Taste unten und drcke g . Dies nennen wir CTRL-G. Eine Statusmeldung am Fu der Seite erscheint mit dem Dateinamen und der Position innerhalb der Datei. Merke Dir die Zeilennummer fr Schritt 3. Anmerkung: Mglicherweise siehst Du die Cursorposition in der unteren rechten Bildschirmecke. Dies ist Auswirkung der 'ruler' Option (siehe :help 'ruler') 2. Drcke G , um Dich zum Ende der Datei zu begeben. Tippe gg , um Dich zum Anfang der Datei zu begeben. 3. Gib die Nummer der Zeile ein, auf der Du vorher warst, gefolgt von G . Dies bringt Dich zurck zu der Zeile, auf der Du gestanden hast, als Du das erste Mal CTRL-G gedrckt hast. 4. Wenn Du Dich sicher genug fhlst, fhre die Schritte 1 bis 3 aus. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 4.2: DAS SUCHEN - KOMMANDO ** Tippe / gefolgt von einem Ausdruck, um nach dem Ausdruck zu suchen. ** 1. Im Normalmodus, tippe das / Zeichen. Beachte, dass das / und der Cursor am Fu des Schirms erscheinen, so wie beim : Kommando. 2. Nun tippe 'Fehhler' . Dies ist das Wort, nach dem Du suchen willst. 3. Um nach demselben Ausdruck weiterzusuchen, tippe einfach n (fr next). Um nach demselben Ausdruck in der Gegenrichtung zu suchen, tippe N . 4. Um nach einem Ausdruck rckwrts zu suchen , benutze ? statt / . 5. Um dahin zurckzukehren, von wo Du gekommen bist, drcke CTRL-O (Halte Ctrl unten und drcke den Buchstaben o). Wiederhole dies, um noch weiter zurckzugehen. CTRL-I geht vorwrts. ---> Fehler schreibt sich nicht "Fehhler"; Fehhler ist ein Fehler Anmerkung: Wenn die Suche das Dateiende erreicht hat, wird sie am Anfang fortgesetzt, es sei denn, die 'wrapscan' Option wurde abgeschaltet. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 4.3: PASSENDE KLAMMERN FINDEN ** Tippe % , um eine gegenberliegenden Klammer ),], oder } zu finden. ** 1. Platziere den Cursor auf irgendeinem der Zeichen (, [, oder { in der unten stehenden Zeile, die mit ---> markiert ist. 2. Nun tippe das % Zeichen. 3. Der Cursor bewegt sich zur passenden gegenberliegenden Klammer. 4. Tippe % , um den Cursor zur passenden anderen Klammer zu bewegen. 5. Setze den Cursor auf ein anderes (,),[,],{ oder } und probiere % aus. ---> Dies ( ist eine Testzeile ( mit [ verschiedenen ] { Klammern } darin. )) Anmerkung: Diese Funktionalitt ist sehr ntzlich bei der Fehlersuche in einem Programmtext, in dem passende Klammern fehlen! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 4.4: DAS ERSETZUNGSKOMMANDO (SUBSTITUTE) ** 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 . Beachte, dass der Befehl nur das erste Vorkommen von "diee" ersetzt. 3. Nun tippe :s/diee/die/g . Das Zufgen des Flags g bedeutet, eine globale Ersetzung ber die Zeile durchzufhren, dies ersetzt alle Vorkommen von "diee" auf der Zeile. ---> diee schnste Zeit, um diee Blumen anzuschauen, ist diee Frhlingszeit. 4. Um alle Vorkommen einer Zeichenkette innerhalb zweier Zeilen zu ndern, tippe :#,#s/alt/neu/g wobei #,# die Zeilennummern des Bereiches sind, in dem die Ersetzung durchgefhrt werden soll. Tippe :%s/alt/neu/g um alle Vorkommen in der gesamten Datei zu ndern. Tippe :%s/alt/neu/gc um alle Vorkommen in der gesamten Datei zu finden mit einem Fragedialog, ob ersetzt werden soll oder nicht. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZUSAMMENFASSUNG VON LEKTION 4 1. CTRL-G zeigt die aktuelle Dateiposition sowie den Dateistatus. G bringt Dich zum Ende der Datei. Nummer G bringt Dich zur entsprechenden Zeilennummer. gg bringt Dich zur ersten Zeile. 2. Die Eingabe von / plus einem Ausdruck sucht VORWRTS nach dem Ausdruck. Die Eingabe von ? plus einem Ausdruck sucht RCKWRTS nach dem Ausdruck. Tippe nach einer Suche n , um das nchste Vorkommen in der gleichen Richtung zu finden; oder N , um in der Gegenrichtung zu suchen. CTRL-O bringt Dich zurck zu lteren Positionen, CTRL-I zu neueren. 3. Die Eingabe von % , wenn der Cursor sich auf (,),[,],{, oder } befindet, bringt Dich zur Gegenklammer. 4. Um das erste Vorkommen von "alt" in einer Zeile durch "neu" zu ersetzen, tippe :s/alt/neu Um alle Vorkommen von "alt" in der Zeile ersetzen, tippe :s/alt/neu/g Um Ausdrcke innerhalb zweier Zeilen # zu ersetzen :#,#s/alt/neu/g Um alle Vorkommen in der ganzen Datei zu ersetzen, tippe :%s/alt/neu/g Fr eine jedesmalige Besttigung, addiere 'c' (confirm) :%s/alt/neu/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 5.1: AUSFHREN EINES EXTERNEN KOMMANDOS ** Gib :! , gefolgt von einem externen Kommando ein, um es auszufhren. ** 1. Tippe das vertraute Kommando : , um den Cursor auf den Fu des Schirms zu setzen. Dies erlaubt Dir, ein Kommandozeilen-Kommando einzugeben. 2. Nun tippe ein ! (Ausrufezeichen). Dies ermglicht Dir, ein beliebiges, externes Shellkommando auszufhren. 3. Als Beispiel tippe ls nach dem ! und drcke . Dies liefert eine Auflistung deines Verzeichnisses; genauso, als wenn Du in der Eingabeaufforderung wrst. Oder verwende :!dir , falls ls nicht geht. Anmerkung: Mit dieser Methode kann jedes beliebige externe Kommando ausgefhrt werden, auch mit Argumenten. Anmerkung: Alle : Kommandos mssen durch Eingabe von abgeschlossen werden. Von jetzt an erwhnen wir dies nicht jedesmal. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 5.2: MEHR BER DAS SCHREIBEN VON DATEIEN ** Um am Text durchgefhrte nderungen zu speichern, tippe :w DATEINAME. ** 1. Tippe :!dir oder :!ls , um eine Auflistung deines Verzeichnisses zu erhalten. Du weit nun bereits, dass Du danach eingeben musst. 2. Whle einen Dateinamen, der noch nicht existiert, z.B. TEST. 3. Nun tippe: :w TEST (wobei TEST der gewhlte Dateiname ist). 4. Dies speichert die ganze Datei (den Vim Tutor) unter dem Namen TEST. Um dies zu berprfen, tippe nochmals :!ls bzw. !dir, um deinen Verzeichnisinhalt zu sehen. Anmerkung: Wrdest Du Vim jetzt beenden und danach wieder mit vim TEST starten, dann wre diese Datei eine exakte Kopie des Tutors zu dem Zeitpunkt, als Du ihn gespeichert hast. 5. Nun entferne die Datei durch Eingabe von (MS-DOS): :!del TEST oder (Unix): :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 5.3: AUSWHLEN VON TEXT ZUM SCHREIBEN ** Um einen Abschnitt der Datei zu speichern, tippe v Bewegung :w DATEI ** 1. Bewege den Cursor zu dieser Zeile. 2. Tippe v und bewege den Cursor zum fnften Auflistungspunkt unten. Beachte, dass der Text hervorgehoben wird. 3. Drcke das Zeichen : . Am Fu des Schirms erscheint :'<,'> . 4. Tippe w TEST , wobei TEST ein noch nicht vorhandener Dateiname ist. Vergewissere Dich, dass Du :'<,'>w TEST siehst, bevor Du drckst. 5. Vim schreibt die ausgewhlten Zeilen in die Datei TEST. Benutze :!dir oder :!ls , um sie zu sehen. Lsche sie noch nicht! Wir werden sie in der nchsten Lektion benutzen. Hinweis: Drcken von v startet die Visuelle Auswahl. Du kannst den Cursor umherbewegen, um die Auswahl zu vergrern oder zu verkleinern. Anschlieend lsst sich ein Operator anwenden, um mit dem Text etwas zu tun. Zum Beispiel lscht d den Text. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 5.4: EINLESEN UND ZUSAMMENFHREN VON DATEIEN ** Um den Inhalt einer Datei einzulesen, tippe :r DATEINAME ** 1. Platziere den Cursor direkt ber dieser Zeile. BEACHTE: Nachdem Du Schritt 2 ausgefhrt hast, wirst Du Text aus Lektion 5.3 sehen. Dann bewege Dich wieder ABWRTS, Lektion 5.4 wiederzusehen. 2. Nun lies deine Datei TEST ein indem Du das Kommando :r TEST ausfhrst, wobei TEST der von Dir verwendete Dateiname ist. Die eingelesene Datei wird unterhalb der Cursorzeile eingefgt. 3. Um zu berprfen, dass die Datei eingelesen wurde, gehe zurck und beachte, dass es jetzt zwei Kopien von Lektion 5.3 gibt, das Original und die eingefgte Dateiversion. Anmerkung: Du kannst auch die Ausgabe eines externen Kommandos einlesen. Zum Beispiel liest :r !ls die Ausgabe des Kommandos ls ein und platziert sie unterhalb des Cursors. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZUSAMMENFASSUNG VON LEKTION 5 1. :!Kommando fhrt ein externes Kommando aus. Einige ntzliche Beispiele sind (MS-DOS) (Unix) :!dir :!ls - zeigt eine Verzeichnisauflistung. :!del DATEINAME :!rm DATEINAME - entfernt Datei DATEINAME. 2. :w DATEINAME speichert die aktuelle Vim-Datei unter dem Namen DATEINAME. 3. v Bewegung :w DATEINAME schreibt die Visuell ausgewhlten Zeilen in die Datei DATEINAME. 4. :r DATEINAME ldt die Datei DATEINAME und fgt sie unterhalb der Cursorposition ein. 5. :r !dir liest die Ausgabe des Kommandos dir und fgt sie unterhalb der Cursorposition ein. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 6.1: ZEILEN FFNEN (OPEN) ** Tippe o , um eine Zeile unterhalb des Cursors zu ffnen und Dich in ** ** den Einfgemodus zu begeben. ** 1. Bewege den Cursor zu der ersten mit ---> markierten Zeile unten. 2. Tippe o (klein geschrieben), um eine Zeile UNTERHALB des Cursors zu ffnen und Dich in den Einfgemodus zu begeben. 3. Nun tippe etwas Text und drcke , um den Einfgemodus zu verlassen. ---> Mit o wird der Cursor auf der offenen Zeile im Einfgemodus platziert. 4. Um eine Zeile BERHALB des Cursors aufzumachen, gib einfach ein groes O statt einem kleinen o ein. Versuche dies auf der unten stehenden Zeile. ---> ffne eine Zeile ber dieser mit O , wenn der Cursor auf dieser Zeile ist. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 6.2: TEXT ANFGEN (APPEND) ** Tippe a , um Text NACH dem Cursor einzufgen. ** 1. Bewege den Cursor zum Anfang der ersten bungszeile mit ---> unten. 2. Drcke e , bis der Cursor am Ende von Zei steht. 3. Tippe ein kleines a , um Text NACH dem Cursor anzufgen. 4. Vervollstndige das Wort so wie in der Zeile darunter. Drcke , um den Einfgemodus zu verlassen. 5. Bewege Dich mit e zum nchsten unvollstndigen Wort und wiederhole Schritte 3 und 4. ---> Diese Zei bietet Gelegen , Text in einer Zeile anzuf. ---> Diese Zeile bietet Gelegenheit, Text in einer Zeile anzufgen. Anmerkung: a, i und A gehen alle gleichermaen in den Einfgemodus; der einzige Unterschied ist, wo die Zeichen eingefgt werden. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 6.3: EINE ANDERE ART DES ERSETZENS (REPLACE) ** Tippe ein groes R , um mehr als ein Zeichen zu ersetzen. ** 1. Bewege den Cursor zur ersten unten stehenden, mit ---> markierten Zeile. Bewege den Cursor zum Anfang des ersten xxx . 2. Nun drcke R und tippe die Nummer, die darunter in der zweiten Zeile steht, so dass diese das xxx ersetzt. 3. Drcke , um den Ersetzungsmodus zu verlassen. Beachte, dass der Rest der Zeile unverndert bleibt. 4. Wiederhole die Schritte, um das verbliebene xxx zu ersetzen. ---> Das Addieren von 123 zu xxx ergibt xxx. ---> Das Addieren von 123 zu 456 ergibt 579. Anmerkung: Der Ersetzungsmodus ist wie der Einfgemodus, aber jedes eingetippte Zeichen lscht ein vorhandenes Zeichen. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 6.4: TEXT KOPIEREN UND EINFGEN ** Benutze den y Operator, um Text zu kopieren; p , um ihn einzufgen ** 1. Gehe zu der mit ---> markierten Zeile unten; setze den Cursor hinter "a)". 2. Starte den Visuellen Modus mit v , bewege den Cursor genau vor "erste". 3. Tippe y , um den hervorgehoben Text zu kopieren. 4. Bewege den Cursor zum Ende der nchsten Zeile: j$ 5. Tippe p , um den Text einzufgen und anschlieend: a zweite . 6. Benutze den Visuellen Modus, um " Eintrag." auszuwhlen, kopiere mittels y , bewege Dich zum Ende der nchsten Zeile mit j$ und fge den Text dort mit p an. ---> a) dies ist der erste Eintrag. b) Anmerkung: Du kannst y auch als Operator verwenden; yw kopiert ein Wort. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 6.5: OPTIONEN SETZEN ** Setze eine Option so, dass eine Suche oder Ersetzung Gro- ** ** und Kleinschreibung ignoriert ** 1. Suche nach 'ignoriere', indem Du /ignoriere eingibst. Wiederhole die Suche einige Male, indem Du die n - Taste drckst. 2. Setze die 'ic' (Ignore case) - Option, indem Du :set ic eingibst. 3. Nun suche wieder nach 'ignoriere', indem Du n tippst. Beachte, dass jetzt Ignoriere und auch IGNORIERE gefunden wird. 4. Setze die 'hlsearch' und 'incsearch' - Optionen: :set hls is 5. Wiederhole die Suche und beobachte, was passiert: /ignoriere 6. Um das Ignorieren von Gro/Kleinschreibung abzuschalten, tippe: :set noic Anmerkung: Um die Hervorhebung der Treffer zu entfernen, gib ein: :nohlsearch Anmerkung: Um die Schreibweise fr eine einzige Suche zu ignorieren, benutze \c im Suchausdruck: /ignoriere\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZUSAMMENFASSUNG VON LEKTION 6 1. Tippe o , um eine Zeile UNTER dem Cursor zu ffnen und den Einfgemodus zu starten Tippe O , um eine Zeile BER dem Cursor zu ffnen. 2. Tippe a , um Text NACH dem Cursor anzufgen. Tippe A , um Text nach dem Zeilenende anzufgen. 3. Das Kommando e bringt Dich zum Ende eines Wortes. 4. Der Operator y (yank) kopiert Text, p (put) fgt ihn ein. 5. Ein groes R geht in den Ersetzungsmodus bis zum Drcken von . 6. Die Eingabe von ":set xxx" setzt die Option "xxx". Einige Optionen sind: 'ic' 'ignorecase' Ignoriere Gro/Kleinschreibung bei einer Suche 'is' 'incsearch' Zeige Teilbereinstimmungen fr einen Suchausdruck 'hls' 'hlsearch' Hebe alle passenden Ausdrcke hervor Der Optionsname kann in der Kurz- oder der Langform angegeben werden. 7. Stelle einer Option "no" voran, um sie abzuschalten: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 7.1 : AUFRUFEN VON HILFE ** Nutze das eingebaute Hilfesystem ** Vim besitzt ein umfassendes eingebautes Hilfesystem. Fr den Anfang probiere eins der drei folgenden Dinge aus: - Drcke die - Taste (falls Du eine besitzt) - Drcke die Taste (falls Du eine besitzt) - Tippe :help Lies den Text im Hilfefenster, um zu verstehen wie die Hilfe funktioniert. Tippe CTRL-W CTRL-W , um von einem Fenster zum anderen zu springen. Tippe :q , um das Hilfefenster zu schlieen. Du kannst Hilfe zu praktisch jedem Thema finden, indem Du dem ":help"- Kommando ein Argument gibst. Probiere folgendes ( nicht vergessen): :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 7.2: ERSTELLE EIN START-SKRIPT ** Aktiviere die Features von Vim ** Vim besitzt viele Funktionalitten, die ber Vi hinausgehen, aber die meisten von ihnen sind standardmig deaktiviert. Um mehr Funktionalitten zu nutzen, musst Du eine "vimrc" - Datei erstellen. 1. Starte das Editieren der "vimrc"-Datei, abhngig von deinem System: :e ~/.vimrc fr Unix :e $VIM/_vimrc fr MS-Windows 2. Nun lies den Inhalt der Beispiel-"vimrc"-Datei ein: :r $VIMRUNTIME/vimrc_example.vim 3. Speichere die Datei mit: :w Beim nchsten Start von Vim wird die Syntaxhervorhebung aktiviert sein. Du kannst all deine bevorzugten Optionen zu dieser "vimrc"-Datei zufgen. Fr mehr Informationen tippe :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 7.3: VERVOLLSTNDIGEN ** Kommandozeilenvervollstndigung mit CTRL-D und ** 1. Stelle sicher, dass Vim nicht im Vi-Kompatibilittsmodus ist: :set nocp 2. Siehe nach, welche Dateien im Verzeichnis existieren: :!ls oder :dir 3. Tippe den Beginn eines Kommandos: :e 4. Drcke CTRL-D und Vim zeigt eine Liste mit "e" beginnender Kommandos. 5. Drcke und Vim vervollstndigt den Kommandonamen zu ":edit". 6. Nun fge ein Leerzeichen und den Anfang einer existierenden Datei an: :edit DAT 7. Drcke . Vim vervollstndigt den Namen (falls er eindeutig ist). Anmerkung: Vervollstndigung funktioniert fr viele Kommandos. Probiere einfach CTRL-D und . Dies ist insbesondere ntzlich fr :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZUSAMMENFASSUNG VON LEKTION 7 1. Tippe :help oder drcke oder , um ein Hilfefenster zu ffnen. 2. Tippe :help Kommando , um Hilfe ber Kommando zu erhalten. 3. Tippe CTRL-W CTRL-W , um zum anderen Fenster zu springen. 4. Tippe :q , um das Hilfefenster zu schlieen. 5. Erstelle ein vimrc - Startskript mit deinen bevorzugter Einstellungen. 6. Drcke CTRL-D nach dem Tippen eines : Kommandos, um mgliche Vervollstndigungen anzusehen. Drcke , um eine Vervollstndigung zu anzuwenden. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Damit ist der Vim Tutor beendet. Seine Intention war, einen kurzen und bndigen berblick ber den Vim Editor zu geben; gerade genug, um relativ leicht mit ihm umgehen zu knnen. Der Vim Tutor hat nicht den geringsten Anspruch auf Vollstndigkeit; Vim hat noch weitaus mehr Kommandos. Lies als nchstes das User Manual: ":help user-manual". Fr weiteres Lesen und Lernen ist folgendes Buch empfehlenswert : Vim - Vi Improved - von Steve Oualline Verlag: New Riders Das erste Buch, welches durchgngig Vim gewidmet ist. Besonders ntzlich fr Anfnger. Viele Beispiele und Bilder sind enthalten. Siehe http://iccf-holland.org/click5.html Folgendes Buch ist lter und mehr ber Vi als Vim, aber auch empfehlenswert: Textbearbeitung mit dem Vi-Editor - von Linda Lamb und Arnold Robbins Verlag O'Reilly - ISBN: 3897211262 In diesem Buch kann man fast alles finden, was man mit Vi tun mchte. Die sechste Ausgabe enthlt auch Informationen ber Vim. Als aktuelle Referenz fr Version 6.2 und knappe Einfhrung dient das folgende Buch: vim ge-packt von Reinhard Wobst mitp-Verlag, ISBN 3-8266-1425-9 Trotz der kompakten Darstellung ist es durch viele ntzliche Beispiele auch fr Einsteiger empfehlenswert. Probekapitel und die Beispielskripte sind online erhltlich. Siehe http://iccf-holland.org/click5.html Dieses Tutorial wurde geschrieben von Michael C. Pierce und Robert K. Ware, Colorado School of Mines. Es benutzt Ideen, die Charles Smith, Colorado State University, zur Verfgung stellte. E-Mail: bware@mines.colorado.edu. Bearbeitet fr Vim von Bram Moolenaar. Deutsche bersetzung von Joachim Hofmann 2015. E-Mail: Joachim.Hof@gmx.de ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim-7.4.1689/runtime/tutor/tutor.de.utf-8000066400000000000000000001145261267703067000200770ustar00rootroot00000000000000=============================================================================== = W i l l k o m m e n im V I M T u t o r - Version 1.7.de.1 = =============================================================================== 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, dass Du die Fähigkeit erlangst, Vim mit Leichtigkeit als einen Allzweck-Editor zu verwenden. Die Zeit für das Durcharbeiten dieses Tutors beträgt ca. 25-30 Minuten, abhängig davon, wie viel Zeit Du mit Experimentieren verbringst. ACHTUNG: Die in den Lektionen angewendeten Kommandos werden den Text modifizieren. Erstelle eine Kopie dieser Datei, in der Du üben willst (falls Du "vimtutor" aufgerufen hast, ist dies bereits eine Kopie). Es ist wichtig, sich zu vergegenwärtigen, dass dieser Tutor für das Anwenden konzipiert ist. Das bedeutet, dass Du die Befehle anwenden 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 Mal, 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 umher, 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. Anmerkung: Immer, wenn Du Dir unsicher bist über das, was Du getippt hast, drücke , um Dich in den Normalmodus zu begeben. Dann gib das gewünschte Kommando noch einmal ein. Anmerkung: 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 einmal daran gewöhnt hast. Wirklich! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 1.2: VIM BEENDEN !! Hinweis: Bevor Du einen der unten aufgeführten Schritte ausführst, lies diese gesamte Lektion!! 1. Drücke die Taste (um sicherzustellen, dass Du im Normalmodus bist). 2. Tippe: :q! . Dies beendet den Editor und VERWIRFT alle Änderungen, die Du gemacht hast. 3. Wenn Du die Eingabeaufforderung siehst, gib das Kommando ein, das Dich zu diesem Tutor geführt hat. Dies wäre: vimtutor 4. Wenn Du Dir diese Schritte eingeprägt hast und Du Dich sicher fühlst, führe Schritte 1 bis 3 aus, um den Editor zu verlassen und wieder hineinzugelangen. Anmerkung: :q! verwirft alle Änderungen, die Du gemacht hast. Einige Lektionen später lernst Du, die Änderungen in einer Datei zu speichern. 5. Bewege den Cursor abwärts zu Lektion 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 1.3: TEXT EDITIEREN - LÖSCHEN ** 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 über dem Zeichen steht, das gelöscht werden soll. 3. Drücke die x Taste, um das unerwünschte Zeichen zu löschen. 4. Wiederhole die Schritte 2 bis 4, bis der Satz korrekt ist. ---> Die Kkuh sprangg übberr deen Moond. 5. Nun, da 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 ** Drücke i , um Text einzufügen. ** 1. Bewege den Cursor zur ersten unten stehenden mit ---> markierten Zeile. 2. Um die erste Zeile mit der zweiten gleichzumachen, bewege den Cursor auf das erste Zeichen NACH der Stelle, an der Text eingefügt werden soll. 3. Drücke i und gib die nötigen Ergänzungen ein. 4. Wenn jeweils ein Fehler beseitigt ist, drücke , um zum Normalmodus zurückzukehren. Wiederhole 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, gehe zu Lektion 1.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 1.5: TEXT EDITIEREN - ANFÜGEN ** Drücke A , um Text anzufügen. ** 1. Bewege den Cursor zur ersten unten stehenden mit ---> markierten Zeile. Dabei ist gleichgültig, auf welchem Zeichen der Zeile der Cursor steht. 2. Drücke A und gib die erforderlichen Ergänzungen ein. 3. Wenn das Anfügen abgeschlossen ist, drücke , um in den Normalmodus zurückzukehren. 4. Bewege den Cursor zur zweiten mit ---> markierten Zeile und wiederhole die Schritte 2 und 3, um den Satz zu auszubessern. ---> In dieser Zeile feh In dieser Zeile fehlt etwas Text. ---> Auch hier steh Auch hier steht etwas Unvollständiges. 5. Wenn Du dich mit dem Anfügen von Text sicher fühlst, gehe zu Lektion 1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 1.6: EINE DATEI EDITIEREN ** Benutze :wq , um eine Datei zu speichern und Vim zu verlassen. ** !! Hinweis: Bevor Du einen der unten aufgeführten Schritte ausführst, lies diese gesamte Lektion!! 1. Verlasse den Editor so wie in Lektion 1.2: :q! Oder, falls du Zugriff zu einem anderen Terminal hast, führe das Folgende dort aus. 2. Gib dieses Kommando in die Eingabeaufforderung ein: vim tutor 'vim' ist der Aufruf des Editors, 'tutor' ist die zu editierende Datei. Benutze eine Datei, die geändert werden darf. 3. Füge Text ein oder lösche ihn, wie Du in den vorangehenden Lektionen gelernt hast. 4. Speichere die geänderte Datei und verlasse Vim mit: :wq 5. Falls Du in Schritt 1 den vimtutor beendet hast, starte vimtutor neu und bewege dich abwärts bis zur folgenden Zusammenfassung. 6. Nachdem Du obige Schritte gelesen und verstanden hast: führe sie durch. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZUSAMMENFASSUNG VON LEKTION 1 1. Der Cursor wird mit den Pfeiltasten oder den Tasten hjkl bewegt. h (links) j (unten) k (aufwärts) l (rechts) 2. Um Vim aus der Eingabeaufforderung zu starten, tippe: vim DATEI 3. Um Vim zu verlassen und alle Änderungen zu verwerfen, tippe: :q! . 4. Um das Zeichen unter dem Cursor zu löschen, tippe: x 5. Um Text einzufügen oder anzufügen, tippe: i Einzufügenden Text eingeben Einfügen vor dem Cursor A Anzufügenden Text eingeben Anfügen nach dem Zeilenende Anmerkung: Drücken von bringt Dich in den Normalmodus oder bricht ein ungewolltes, erst teilweise eingegebenes Kommando ab. Nun fahre mit Lektion 2 fort. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 2.1: LÖSCHKOMMANDOS ** Tippe dw , um ein Wort zu löschen. ** 1. Drücke , um sicherzustellen, dass Du im Normalmodus 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. Anmerkung: Der Buchstabe d erscheint auf der untersten Zeile des Schirms, wenn Du ihn eingibst. Vim wartet darauf, dass Du w eingibst. Falls Du ein anderes Zeichen als d siehst, hast Du etwas Falsches getippt; drücke und beginne noch einmal. ---> 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 zur Lektion 2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 2.2: WEITERE LÖSCHKOMMANDOS ** Tippe d$ , um bis zum Ende der Zeile zu löschen. ** 1. Drücke , um sicherzustellen, dass Du im Normalmodus 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 Zeilenende 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 vorgeht. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 2.3: ÜBER OPERATOREN UND BEWEGUNGSZÜGE Viele Kommandos, die Text ändern, setzen sich aus einem Operator und einer Bewegung zusammen. Das Format für ein Löschkommando mit dem Löschoperator d lautet wie folgt: d Bewegung wobei: d - der Löschoperator Bewegung - worauf der Löschoperator angewandt wird (unten aufgeführt). Eine kleine Auflistung von Bewegungen: w - bis zum Beginn des nächsten Wortes OHNE dessen erstes Zeichen. e - zum Ende des aktuellen Wortes MIT dessen letztem Zeichen. $ - zum Ende der Zeile MIT dem letzten Zeichen. Dementsprechend löscht die Eingabe von de vom Cursor an bis zum Wortende. Anmerkung: Die Eingabe lediglich des Bewegungsteils im Normalmodus bewegt den Cursor entsprechend. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 2.4: ANWENDUNG EINES ZÄHLERS FÜR EINEN BEWEGUNGSSCHRITT ** Die Eingabe einer Zahl vor einem Bewegungsschritt wiederholt diesen. ** 1. Bewege den Cursor zum Beginn der mit ---> markierten Zeile unten. 2. Tippe 2w , um den Cursor zwei Wörter vorwärts zu bewegen. 3. Tippe 3e , um den Cursor zum Ende des dritten Wortes zu bewegen. 4. Tippe 0 (Null) , um zum Anfang der Zeile zu gelangen. 5. Wiederhole Schritte 2 und 3 mit verschiedenen Nummern. ---> Dies ist nur eine Zeile aus Wörtern, um sich darin herumzubewegen. 6. Gehe weiter zu Lektion 2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 2.5: ANWENDUNG EINES ZÄHLERS FÜR MEHRERE LÖSCHVORGÄNGE ** Die Eingabe einer Zahl mit einem Operator wiederholt diesen mehrfach. ** In der Kombination aus Löschoperator und Bewegungsschritt (siehe oben) stellt man, um mehr zu löschen dem Schritt einen Zähler voran: d Nummer Bewegungsschritt 1. Bewege den Cursor zum ersten Wort in GROSSBUCHSTABEN in der mit ---> markieren Zeile. 2. Tippe d2w , um die zwei Wörter in GROSSBUCHSTABEN zu löschen. 3. Wiederhole Schritte 1 und 2 mit einem anderen Zähler, um die darauffol- genden Wörter in GROSSBUCHSTABEN mit einem einzigen Kommando zu löschen. ---> Diese ABC DE Zeile FGHI JK LMN OP mit Wörtern ist Q RS TUV bereinigt. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 2.6: ARBEITEN AUF ZEILEN ** Tippe dd , um eine ganze Zeile zu löschen. ** Wegen der Häufigkeit, dass man ganze Zeilen löscht, kamen die Entwickler von Vi darauf, dass es leichter wäre, einfach zwei d's 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 , um zwei 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.7: 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 unerwünschte Zeichen zu löschen. 3. Nun tippe u , um das soeben ausgeführte Kommando rückgängig zu machen. 4. Jetzt behebe alle Fehler auf der Zeile mit Hilfe des x Kommandos. 5. Nun tippe ein großes U , um die Zeile in ihren Ursprungszustand wiederherzustellen. 6. Nun tippe u einige Male, um das U und die vorhergehenden Kommandos rückgängig zu machen. 7. Nun tippe CTRL-R (halte CTRL gedrückt und drücke R) mehrere Male, um die Kommandos wiederherzustellen (die Rückgängigmachungen rückgängig machen). ---> Beehebe die Fehller diesser Zeile und sttelle sie mitt 'undo' wieder her. 8. Dies sind sehr nützliche Kommandos. Nun gehe weiter zur Zusammenfassung von Lektion 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZUSAMMENFASSUNG VON LEKTION 2 1. Um vom Cursor bis zum nächsten Wort 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. Um eine Bewegung zu wiederholen, stelle eine Nummer voran: 2w 5. Das Format für ein Änderungskommando ist: Operator [Anzahl] Bewegungsschritt wobei: Operator - gibt an, was getan werden soll, zum Beispiel d für delete [Anzahl] - ein optionaler Zähler, um den Bewegungsschritt zu wiederholen Bewegungsschritt - Bewegung über den zu ändernden Text, wie w (Wort), $ (zum Ende der Zeile), etc. 6. Um Dich zum Anfang der Zeile zu begeben, benutze die Null: 0 7. 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 vorher gelöschten Text nach dem Cursor anzufügen. ** 1. Bewege den Cursor zur ersten unten stehenden mit ---> markierten Zeile. 2. Tippe dd , um die Zeile zu löschen und sie in einem Vim-Register zu speichern. 3. Bewege den Cursor zur Zeile c), ÜBER derjenigen, wo die gelöschte Zeile platziert werden soll. 4. Tippe p , um die Zeile unterhalb des Cursors 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 lernbar, ---> a) Rosen sind rot, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 3.2: ERSETZEN (REPLACE) ** Tippe rx , um das Zeichen unter dem Cursor durch x 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 dort stehen sollte. 4. Wiederhole Schritte 2 und 3, bis die erste Zeile gleich der zweiten ist. ---> Alf 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. Anmerkung: Erinnere Dich daran, dass Du durch Anwenden lernen solltest, nicht durch Auswendiglernen. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 3.3: ÄNDERN (CHANGE) ** Um eine Änderung bis zum Wortende durchzuführen, tippe ce . ** 1. Bewege den Cursor zur ersten unten stehenden mit ---> markierten Zeile. 2. Platziere den Cursor auf das s von Wstwr. 3. Tippe ce und die Wortkorrektur ein (in diesem Fall tippe örter ). 4. Drücke und bewege den Cursor zum nächsten zu ändernden Zeichen. 5. Wiederhole Schritte 3 und 4 bis der erste Satz gleich dem zweiten ist. ---> Einige Wstwr dieser Zlaww lasdjlaf mit dem Ändern-Operator gaaauu werden. ---> Einige Wörter dieser Zeile sollen mit dem Ändern-Operator geändert werden. Beachte, dass ce das Wort löscht und Dich in den Eingabemodus versetzt. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 3.4: MEHR ÄNDERUNGEN MITTELS c ** Das change-Kommando arbeitet mit denselben Bewegungen wie delete. ** 1. Der change Operator arbeitet in gleicher Weise wie delete. Das Format ist: c [Anzahl] Bewegungsschritt 2. Die Bewegungsschritte sind die gleichen , so wie w (Wort) und $ (Zeilenende). 3. Bewege Dich zur ersten unten stehenden mit ---> markierten Zeile. 4. Bewege den Cursor zum ersten Fehler. 5. Tippe c$ , gib den Rest der Zeile wie in der zweiten ein, drücke . ---> Das Ende dieser Zeile soll an die zweite Zeile angeglichen werden. ---> Das Ende dieser Zeile soll mit dem c$ Kommando korrigiert werden. Anmerkung: Du kannst die Rücktaste benutzen, um Tippfehler zu korrigieren. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZUSAMMENFASSUNG VON LEKTION 3 1. Um einen vorher gelöschten Text anzufügen, tippe p . Dies fügt den gelöschten Text NACH dem Cursor an (wenn eine ganze Zeile gelöscht wurde, wird diese in die Zeile unter dem Cursor eingefügt). 2. Um das Zeichen unter dem Cursor zu ersetzen, tippe r und danach das an dieser Stelle gewollte Zeichen. 3. Der Änderungs- (change) Operator erlaubt, vom Cursor bis zum Ende des Bewegungsschrittes zu ändern. Tippe ce , um eine Änderung vom Cursor bis zum Ende des Wortes vorzunehmen; c$ bis zum Ende einer Zeile. 4. Das Format für change ist: c [Anzahl] Bewegungsschritt Nun fahre mit der nächsten Lektion fort. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 4.1: CURSORPOSITION UND DATEISTATUS ** Tippe CTRL-G , um deine Dateiposition sowie den Dateistatus anzuzeigen. ** ** Tippe G , um Dich zu einer Zeile in der Datei zu begeben. ** Anmerkung: Lies diese gesamte Lektion, bevor Du irgendeinen Schritt ausführst!! 1. Halte die Ctrl Taste unten und drücke g . Dies nennen wir CTRL-G. Eine Statusmeldung am Fuß der Seite erscheint mit dem Dateinamen und der Position innerhalb der Datei. Merke Dir die Zeilennummer für Schritt 3. Anmerkung: Möglicherweise siehst Du die Cursorposition in der unteren rechten Bildschirmecke. Dies ist Auswirkung der 'ruler' Option (siehe :help 'ruler') 2. Drücke G , um Dich zum Ende der Datei zu begeben. Tippe gg , um Dich zum Anfang der Datei zu begeben. 3. Gib die Nummer der Zeile ein, auf der Du vorher warst, gefolgt von G . Dies bringt Dich zurück zu der Zeile, auf der Du gestanden hast, als Du das erste Mal CTRL-G gedrückt hast. 4. Wenn Du Dich 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. Im Normalmodus, tippe das / Zeichen. Beachte, dass das / und der Cursor am Fuß des Schirms erscheinen, so wie beim : Kommando. 2. Nun tippe 'Fehhler' . Dies ist das Wort, nach dem Du suchen willst. 3. Um nach demselben Ausdruck weiterzusuchen, tippe einfach n (für next). Um nach demselben Ausdruck in der Gegenrichtung zu suchen, tippe N . 4. Um nach einem Ausdruck rückwärts zu suchen , benutze ? statt / . 5. Um dahin zurückzukehren, von wo Du gekommen bist, drücke CTRL-O (Halte Ctrl unten und drücke den Buchstaben o). Wiederhole dies, um noch weiter zurückzugehen. CTRL-I geht vorwärts. ---> Fehler schreibt sich nicht "Fehhler"; Fehhler ist ein Fehler Anmerkung: Wenn die Suche das Dateiende erreicht hat, wird sie am Anfang fortgesetzt, es sei denn, die 'wrapscan' Option wurde abgeschaltet. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 4.3: PASSENDE KLAMMERN FINDEN ** Tippe % , um eine gegenüberliegenden Klammer ),], oder } zu finden. ** 1. Platziere den Cursor auf irgendeinem der Zeichen (, [, oder { in der unten stehenden Zeile, die mit ---> markiert ist. 2. Nun tippe das % Zeichen. 3. Der Cursor bewegt sich zur passenden gegenüberliegenden Klammer. 4. Tippe % , um den Cursor zur passenden anderen Klammer zu bewegen. 5. Setze den Cursor auf ein anderes (,),[,],{ oder } und probiere % aus. ---> Dies ( ist eine Testzeile ( mit [ verschiedenen ] { Klammern } darin. )) Anmerkung: Diese Funktionalität ist sehr nützlich bei der Fehlersuche in einem Programmtext, in dem passende Klammern fehlen! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 4.4: DAS ERSETZUNGSKOMMANDO (SUBSTITUTE) ** 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 . Beachte, dass der Befehl nur das erste Vorkommen von "diee" ersetzt. 3. Nun tippe :s/diee/die/g . Das Zufügen des Flags g bedeutet, eine globale Ersetzung über die Zeile durchzuführen, dies ersetzt alle Vorkommen von "diee" auf der Zeile. ---> diee schönste Zeit, um diee Blumen anzuschauen, ist diee Frühlingszeit. 4. Um alle Vorkommen einer Zeichenkette innerhalb zweier Zeilen zu ändern, tippe :#,#s/alt/neu/g wobei #,# die Zeilennummern des Bereiches sind, in dem die Ersetzung durchgeführt werden soll. Tippe :%s/alt/neu/g um alle Vorkommen in der gesamten Datei zu ändern. Tippe :%s/alt/neu/gc um alle Vorkommen in der gesamten Datei zu finden mit einem Fragedialog, ob ersetzt werden soll oder nicht. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZUSAMMENFASSUNG VON LEKTION 4 1. CTRL-G zeigt die aktuelle Dateiposition sowie den Dateistatus. G bringt Dich zum Ende der Datei. Nummer G bringt Dich zur entsprechenden Zeilennummer. gg bringt Dich zur ersten Zeile. 2. Die Eingabe von / plus einem Ausdruck sucht VORWÄRTS nach dem Ausdruck. Die Eingabe von ? plus 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 N , um in der Gegenrichtung zu suchen. CTRL-O bringt Dich zurück zu älteren Positionen, CTRL-I zu neueren. 3. Die Eingabe von % , wenn der Cursor sich auf (,),[,],{, oder } befindet, bringt Dich zur Gegenklammer. 4. Um das erste Vorkommen von "alt" in einer Zeile durch "neu" zu ersetzen, tippe :s/alt/neu Um alle Vorkommen von "alt" in der Zeile ersetzen, tippe :s/alt/neu/g Um Ausdrücke innerhalb zweier Zeilen # zu ersetzen :#,#s/alt/neu/g Um alle Vorkommen in der ganzen Datei zu ersetzen, tippe :%s/alt/neu/g Für eine jedesmalige Bestätigung, addiere 'c' (confirm) :%s/alt/neu/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 den Fuß des Schirms zu setzen. Dies erlaubt Dir, ein Kommandozeilen-Kommando einzugeben. 2. Nun tippe ein ! (Ausrufezeichen). Dies ermöglicht Dir, ein beliebiges, externes Shellkommando auszuführen. 3. Als Beispiel tippe ls nach dem ! und drücke . Dies liefert eine Auflistung deines Verzeichnisses; genauso, als wenn Du in der Eingabeaufforderung wärst. Oder verwende :!dir , falls ls nicht geht. Anmerkung: Mit dieser Methode kann jedes beliebige externe Kommando ausgeführt werden, auch mit Argumenten. Anmerkung: Alle : Kommandos müssen durch Eingabe von abgeschlossen werden. Von jetzt an erwähnen wir dies nicht jedesmal. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 5.2: MEHR ÜBER DAS SCHREIBEN VON DATEIEN ** Um am Text durchgeführte Änderungen zu speichern, tippe :w DATEINAME. ** 1. Tippe :!dir oder :!ls , um eine Auflistung deines Verzeichnisses zu erhalten. Du weißt nun bereits, dass Du danach eingeben musst. 2. Wähle einen Dateinamen, der noch nicht existiert, z.B. TEST. 3. Nun tippe: :w TEST (wobei TEST der gewählte Dateiname ist). 4. Dies speichert die ganze Datei (den Vim Tutor) unter dem Namen TEST. Um dies zu überprüfen, tippe nochmals :!ls bzw. !dir, um deinen Verzeichnisinhalt zu sehen. Anmerkung: Würdest Du Vim jetzt beenden und danach wieder mit vim TEST starten, 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 (MS-DOS): :!del TEST oder (Unix): :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 5.3: AUSWÄHLEN VON TEXT ZUM SCHREIBEN ** Um einen Abschnitt der Datei zu speichern, tippe v Bewegung :w DATEI ** 1. Bewege den Cursor zu dieser Zeile. 2. Tippe v und bewege den Cursor zum fünften Auflistungspunkt unten. Beachte, dass der Text hervorgehoben wird. 3. Drücke das Zeichen : . Am Fuß des Schirms erscheint :'<,'> . 4. Tippe w TEST , wobei TEST ein noch nicht vorhandener Dateiname ist. Vergewissere Dich, dass Du :'<,'>w TEST siehst, bevor Du drückst. 5. Vim schreibt die ausgewählten Zeilen in die Datei TEST. Benutze :!dir oder :!ls , um sie zu sehen. Lösche sie noch nicht! Wir werden sie in der nächsten Lektion benutzen. Hinweis: Drücken von v startet die Visuelle Auswahl. Du kannst den Cursor umherbewegen, um die Auswahl zu vergrößern oder zu verkleinern. Anschließend lässt sich ein Operator anwenden, um mit dem Text etwas zu tun. Zum Beispiel löscht d den Text. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 5.4: EINLESEN UND ZUSAMMENFÜHREN VON DATEIEN ** Um den Inhalt einer Datei einzulesen, tippe :r DATEINAME ** 1. Platziere den Cursor direkt über dieser Zeile. BEACHTE: Nachdem Du Schritt 2 ausgeführt hast, wirst Du Text aus Lektion 5.3 sehen. Dann bewege Dich wieder ABWÄRTS, Lektion 5.4 wiederzusehen. 2. Nun lies deine Datei TEST ein indem Du das Kommando :r TEST ausführst, wobei TEST der von Dir verwendete Dateiname ist. Die eingelesene Datei wird unterhalb der Cursorzeile eingefügt. 3. Um zu überprüfen, dass die Datei eingelesen wurde, gehe zurück und beachte, dass es jetzt zwei Kopien von Lektion 5.3 gibt, das Original und die eingefügte Dateiversion. Anmerkung: Du kannst auch die Ausgabe eines externen Kommandos einlesen. Zum Beispiel liest :r !ls die Ausgabe des Kommandos ls ein und platziert sie unterhalb des Cursors. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZUSAMMENFASSUNG VON LEKTION 5 1. :!Kommando führt ein externes Kommando aus. Einige nützliche Beispiele sind (MS-DOS) (Unix) :!dir :!ls - zeigt eine Verzeichnisauflistung. :!del DATEINAME :!rm DATEINAME - entfernt Datei DATEINAME. 2. :w DATEINAME speichert die aktuelle Vim-Datei unter dem Namen DATEINAME. 3. v Bewegung :w DATEINAME schreibt die Visuell ausgewählten Zeilen in die Datei DATEINAME. 4. :r DATEINAME lädt die Datei DATEINAME und fügt sie unterhalb der Cursorposition ein. 5. :r !dir liest die Ausgabe des Kommandos dir und fügt sie unterhalb der Cursorposition ein. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 6.1: ZEILEN ÖFFNEN (OPEN) ** Tippe o , um eine Zeile unterhalb des Cursors zu öffnen und Dich in ** ** den Einfügemodus zu begeben. ** 1. Bewege den Cursor zu der ersten mit ---> markierten Zeile unten. 2. Tippe o (klein geschrieben), um eine Zeile UNTERHALB des Cursors zu öffnen und Dich in den Einfügemodus zu begeben. 3. Nun tippe etwas Text und drücke , um den Einfügemodus zu verlassen. ---> Mit o wird der Cursor auf der offenen Zeile im Einfügemodus platziert. 4. Um eine Zeile ÜBERHALB des Cursors aufzumachen, gib einfach ein großes O statt einem kleinen o ein. Versuche dies auf der unten stehenden Zeile. ---> Öffne eine Zeile über dieser mit 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 Anfang der ersten Übungszeile mit ---> unten. 2. Drücke e , bis der Cursor am Ende von Zei steht. 3. Tippe ein kleines a , um Text NACH dem Cursor anzufügen. 4. Vervollständige das Wort so wie in der Zeile darunter. Drücke , um den Einfügemodus zu verlassen. 5. Bewege Dich mit e zum nächsten unvollständigen Wort und wiederhole Schritte 3 und 4. ---> Diese Zei bietet Gelegen , Text in einer Zeile anzufü. ---> Diese Zeile bietet Gelegenheit, Text in einer Zeile anzufügen. Anmerkung: a, i und A gehen alle gleichermaßen in den Einfügemodus; der einzige Unterschied ist, wo die Zeichen eingefügt werden. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 6.3: EINE ANDERE ART 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. Bewege den Cursor zum Anfang des ersten xxx . 2. Nun drücke R und tippe die Nummer, die darunter in der zweiten Zeile steht, so dass diese das xxx ersetzt. 3. Drücke , um den Ersetzungsmodus zu verlassen. Beachte, dass der Rest der Zeile unverändert bleibt. 4. Wiederhole die Schritte, um das verbliebene xxx zu ersetzen. ---> Das Addieren von 123 zu xxx ergibt xxx. ---> Das Addieren von 123 zu 456 ergibt 579. Anmerkung: Der Ersetzungsmodus ist wie der Einfügemodus, aber jedes eingetippte Zeichen löscht ein vorhandenes Zeichen. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 6.4: TEXT KOPIEREN UND EINFÜGEN ** Benutze den y Operator, um Text zu kopieren; p , um ihn einzufügen ** 1. Gehe zu der mit ---> markierten Zeile unten; setze den Cursor hinter "a)". 2. Starte den Visuellen Modus mit v , bewege den Cursor genau vor "erste". 3. Tippe y , um den hervorgehoben Text zu kopieren. 4. Bewege den Cursor zum Ende der nächsten Zeile: j$ 5. Tippe p , um den Text einzufügen und anschließend: a zweite . 6. Benutze den Visuellen Modus, um " Eintrag." auszuwählen, kopiere mittels y , bewege Dich zum Ende der nächsten Zeile mit j$ und füge den Text dort mit p an. ---> a) dies ist der erste Eintrag. b) Anmerkung: Du kannst y auch als Operator verwenden; yw kopiert ein Wort. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 6.5: OPTIONEN SETZEN ** Setze eine Option so, dass eine Suche oder Ersetzung Groß- ** ** und Kleinschreibung ignoriert ** 1. Suche nach 'ignoriere', indem Du /ignoriere eingibst. Wiederhole die Suche einige Male, indem Du die n - Taste drückst. 2. Setze die 'ic' (Ignore case) - Option, indem Du :set ic eingibst. 3. Nun suche wieder nach 'ignoriere', indem Du n tippst. Beachte, dass jetzt Ignoriere und auch IGNORIERE gefunden wird. 4. Setze die 'hlsearch' und 'incsearch' - Optionen: :set hls is 5. Wiederhole die Suche und beobachte, was passiert: /ignoriere 6. Um das Ignorieren von Groß/Kleinschreibung abzuschalten, tippe: :set noic Anmerkung: Um die Hervorhebung der Treffer zu entfernen, gib ein: :nohlsearch Anmerkung: Um die Schreibweise für eine einzige Suche zu ignorieren, benutze \c im Suchausdruck: /ignoriere\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZUSAMMENFASSUNG VON LEKTION 6 1. Tippe o , um eine Zeile UNTER dem Cursor zu öffnen und den Einfügemodus zu starten Tippe O , um eine Zeile ÜBER dem Cursor zu öffnen. 2. Tippe a , um Text NACH dem Cursor anzufügen. Tippe A , um Text nach dem Zeilenende anzufügen. 3. Das Kommando e bringt Dich zum Ende eines Wortes. 4. Der Operator y (yank) kopiert Text, p (put) fügt ihn ein. 5. Ein großes R geht in den Ersetzungsmodus bis zum Drücken von . 6. Die Eingabe von ":set xxx" setzt die Option "xxx". Einige Optionen sind: 'ic' 'ignorecase' Ignoriere Groß/Kleinschreibung bei einer Suche 'is' 'incsearch' Zeige Teilübereinstimmungen für einen Suchausdruck 'hls' 'hlsearch' Hebe alle passenden Ausdrücke hervor Der Optionsname kann in der Kurz- oder der Langform angegeben werden. 7. Stelle einer Option "no" voran, um sie abzuschalten: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 7.1 : AUFRUFEN VON 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 - Taste (falls Du eine besitzt) - Drücke die Taste (falls Du eine besitzt) - Tippe :help Lies den Text im Hilfefenster, um zu verstehen wie die Hilfe funktioniert. Tippe CTRL-W CTRL-W , um von einem Fenster zum anderen zu springen. Tippe :q , um das Hilfefenster zu schließen. Du kannst Hilfe zu praktisch jedem Thema finden, indem Du dem ":help"- Kommando ein Argument gibst. Probiere folgendes ( nicht vergessen): :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 7.2: ERSTELLE EIN START-SKRIPT ** Aktiviere die Features von Vim ** Vim besitzt viele Funktionalitäten, die über Vi hinausgehen, aber die meisten von ihnen sind standardmäßig deaktiviert. Um mehr Funktionalitäten zu nutzen, musst Du eine "vimrc" - Datei erstellen. 1. Starte das Editieren der "vimrc"-Datei, abhängig von deinem System: :e ~/.vimrc für Unix :e $VIM/_vimrc für MS-Windows 2. Nun lies den Inhalt der Beispiel-"vimrc"-Datei ein: :r $VIMRUNTIME/vimrc_example.vim 3. Speichere die Datei mit: :w Beim nächsten Start von Vim wird die Syntaxhervorhebung aktiviert sein. Du kannst all deine bevorzugten Optionen zu dieser "vimrc"-Datei zufügen. Für mehr Informationen tippe :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 7.3: VERVOLLSTÄNDIGEN ** Kommandozeilenvervollständigung mit CTRL-D und ** 1. Stelle sicher, dass Vim nicht im Vi-Kompatibilitätsmodus ist: :set nocp 2. Siehe nach, welche Dateien im Verzeichnis existieren: :!ls oder :dir 3. Tippe den Beginn eines Kommandos: :e 4. Drücke CTRL-D und Vim zeigt eine Liste mit "e" beginnender Kommandos. 5. Drücke und Vim vervollständigt den Kommandonamen zu ":edit". 6. Nun füge ein Leerzeichen und den Anfang einer existierenden Datei an: :edit DAT 7. Drücke . Vim vervollständigt den Namen (falls er eindeutig ist). Anmerkung: Vervollständigung funktioniert für viele Kommandos. Probiere einfach CTRL-D und . Dies ist insbesondere nützlich für :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZUSAMMENFASSUNG VON LEKTION 7 1. Tippe :help oder drücke oder , um ein Hilfefenster zu öffnen. 2. Tippe :help Kommando , um Hilfe über Kommando zu erhalten. 3. Tippe CTRL-W CTRL-W , um zum anderen Fenster zu springen. 4. Tippe :q , um das Hilfefenster zu schließen. 5. Erstelle ein vimrc - Startskript mit deinen bevorzugter Einstellungen. 6. Drücke CTRL-D nach dem Tippen eines : Kommandos, um mögliche Vervollständigungen anzusehen. Drücke , um eine Vervollständigung zu anzuwenden. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Damit ist der Vim Tutor beendet. Seine Intention war, einen kurzen und bündigen Überblick über den Vim Editor zu geben; 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. Lies als nächstes das User Manual: ":help user-manual". Für weiteres Lesen und Lernen ist folgendes Buch empfehlenswert : Vim - Vi Improved - von Steve Oualline Verlag: New Riders Das erste Buch, welches durchgängig Vim gewidmet ist. Besonders nützlich für Anfänger. Viele Beispiele und Bilder sind enthalten. Siehe http://iccf-holland.org/click5.html Folgendes Buch ist älter und mehr über Vi als Vim, aber auch empfehlenswert: Textbearbeitung mit dem Vi-Editor - von Linda Lamb und Arnold Robbins 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. Als aktuelle Referenz für Version 6.2 und knappe Einführung dient das folgende Buch: vim ge-packt von Reinhard Wobst mitp-Verlag, ISBN 3-8266-1425-9 Trotz der kompakten Darstellung ist es durch viele nützliche Beispiele auch für Einsteiger empfehlenswert. Probekapitel und die Beispielskripte sind online erhältlich. Siehe http://iccf-holland.org/click5.html Dieses Tutorial wurde geschrieben von Michael C. Pierce und 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 2015. E-Mail: Joachim.Hof@gmx.de ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim-7.4.1689/runtime/tutor/tutor.el000066400000000000000000000730161267703067000171430ustar00rootroot00000000000000=============================================================================== = 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. : , . . : . hjkl , . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1.2: VIM !! : , !! 1. ( ). 2. : :q! . ---> . : :wq 3. , . : vimtutor : vim tutor ---> '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. . 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 3. : :q! . : :wq . 4. : x 5. : i : . 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2.1: ** dw . ** 1. . 2. --->. 3. . 4. dw . : dw . , . ---> There are a some words fun that don't belong paper in this sentence. 5. 3 4 2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2.2: ** d$ . ** 1. . 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. ( ). 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$ . ---> 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' . . 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 . . 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 ! . , . :!dir ls . ---> : . ---> : : . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5.2: ** , :w . ** 1. :!dir :!ls . . 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. ---> . ---> 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 , , , , -, , 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. , . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 . 4. ":set xxx" "xxx". ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 7: ON-LINE ** on-line ** Vim on-line . , : - ( ) - ( ) - :help :q . , ":help". ( ): :help w :help c_ 㡫 l 夘 . j 㡫 j ᝜ ᡠ . v 1. 婫 椞 ⮨ 韜 ᤜ. 2. 㩫 ⤦ 㡫 (j) ⮨ . ---> 騘 ⨜ 嫜 棜 ៞. 3. 餫 㡫, 嫜 ៞ 1.2. ਫ਼: ᢢ ᫠ 㩘, 㩫 嫜 ᩫ. 㩫 ⢘. ਫ਼: 㡫 ⧜ 婞 禬. hjkl 嫜 嫜 櫜, 梠 婜. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ៞ 1.2: VIM !! : ⩜ ᧦ 㣘, ᩫ 梦 ៞!! 1. 㩫 㡫 ( 婫 嚦 ᩫ). 2. 㩫: :q! . ---> ⨮ ᡫ 驜 槦 ⮜ ᤜ. ⢜ 驜 ⨟ 㩫: :wq 3.  嫜 , 㩫 㡘 㚞. 夘: vimtutor 穘: vim tutor ---> '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. 餜 ៜ ៦ 㩫 ⯜ ᩫ. ᙜ 㣘 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 3. 嫜 ᯫ: :q! 樨 . ᯫ: :wq 㡜 . 4. ᯜ ⤘ 㨘 ᩫ 㩫: x 5. ᚜ 壜 橦 婫 ᩫ ᯫ: i 㩫 壜 : 餫 嫜 ᩫ 驜 磞 ⤞ . 騘 婫 ៞ 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ៞ 2.1: ** ᯫ dw ᯜ ⮨ ⢦ 嘪 ⥞. ** 1. 㩫 嫜 櫠 婫 ᩫ. 2. 婫 ⤞ --->. 3. 夜 ⥞ ⧜ . 4. ᯫ dw ᤜ ⥞ . : ᣣ dw 椞 橦 嫜. ᯘ ᫠ ៦, 㩫 㩫 . ---> There are a some words fun that don't belong paper in this sentence. 5. ᙜ 㣘 3 4 ⮨ 櫘 夘 ੫ 夜 ៞ 2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ៞ 2.2: ** 㩫 d$ ᯜ ⮨ ⢦ . ** 1. 㩫 嫜 櫠 婫 ᩫ. 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. 㩫 夜 棜 ៦ ( 髦 㨘 ). 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$ ᤜ 梦 因 竜 㩫 . ---> 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' . 夘 ⥞ ⢜ ᥜ. 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 . 驫 櫠 ᝜ 椦 髞 ᤠ . 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 ! 㩫 . 婜 婫 暦 , 㩘 . 㩫 :!dir ls 眠. ---> ਫ਼: 夘 ⩜ 㧦 ૜ 槦. ---> ਫ਼:  : ⧜ 坦 餫 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ៞ 5.2: ** 驜 ᚜ ᤘ , ᯫ :w . ** 1. ᯫ :!dir :!ls ᨜ 婫 暦 . 웞 ⨜ 櫠 ⧜ 㩜 . 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. 騘 ᯫ ⤞ ---> 㩫 嫜 ᩫ ⤦. ---> 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 , 㨘, 壜 , , -, ⢦, 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. 驫 櫠 櫘 ᫜ 嫜, ⤜ 㧦 ૦ 壜. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ៞ 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 ⨮ ᩫ ᩫ ⮨ ⢟. 4. ᭦ ":set xxx" 坜 "xxx". ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 7: ON-LINE ** 㩫 on-line 穫 㟜 ** Vim ⮜ ⤘ on-line 穫 㟜. 㩜, ᩫ ᧦ : - 㩫 㡫 ( ⮜ ᧦) - 㩫 㡫 ( ⮜ ᧦) - ᯫ :help ᯫ :q 婜 ៬ 㟜. 嫜 嫜 㟜 ៜ 壜, 夦 ᣜ ":help". ᩫ ( ᫜ ᫜ ): :help w :help c_ Το πλήκτρο l είναι δεξιά και κινεί στα δεξιά. j Το πλήκτρο j μοιάζει με βελάκι προς τα κάτω. v 1. Μετακινείστε τον δρομέα τριγύρω στην οθόνη μέχρι να νοιώθετε άνετα. 2. Κρατήστε πατημένο το κάτω πλήκτρο (j) μέχρι να επαναληφθεί. ---> Τώρα ξέρετε πώς να μετακινηθείτε στο επόμενο μάθημα. 3. Χρησιμοποιώντας το κάτω πλήκτρο, μετακινηθείτε στο Μάθημα 1.2. Σημείωση: Αν αμφιβάλλετε για κάτι που πατήσατε, πατήστε για να βρεθείτε στην Κανονική Κατάσταση. Μετά πατήστε ξανά την εντολή που θέλατε. Σημείωση: Τα πλήκτρα του δρομέα θα πρέπει επίσης να δουλεύουν. Αλλά με τα hjkl θα μπορείτε να κινηθείτε πολύ γρηγορότερα, μόλις τα συνηθίσετε. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Μάθημα 1.2: ΜΠΑΙΝΟΝΤΑΣ ΚΑΙ ΒΓΑΙΝΟΝΤΑΣ ΣΤΟΝ VIM !! ΣΗΜΕΙΩΣΗ: Πριν εκτελέσετε κάποιο από τα βήματα, διαβάστε όλο το μάθημα!! 1. Πατήστε το πλήκτρο (για να είστε σίγουρα στην Κανονική Κατάσταση). 2. Πληκτρολογήστε: :q! . ---> Αυτό εξέρχεται από τον συντάκτη ΧΩΡΙΣ να σώσει όποιες αλλαγές έχετε κάνει. Αν θέλετε να σώσετε τις αλλαγές και να εξέρθετε πληκτρολογήστε: :wq 3. Όταν δείτε την προτροπή του φλοιού, πληκτρολογήστε την εντολή με την οποία μπήκατε σε αυτήν την περιήγηση. Μπορεί να είναι: vimtutor Κανονικά θα χρησιμοποιούσατε: vim tutor ---> '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. Καθώς διορθώνετε κάθε λάθος πατήστε για να επιστρέψετε στην Κανονική Κατάσταση. Επαναλάβετε τα βήματα 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 ΑΡΧΕΙΟ 3. Για να βγείτε γράψτε: :q! για απόρριψη των αλλαγών. Ή γράψτε: :wq για αποθήκευση των αλλαγών. 4. Για να διαγράψετε έναν χαρακτήρα κάτω από τον δρομέα σε Κανονική Κατάσταση πατήστε: x 5. Για να εισάγετε κείμενο στον δρομέα όσο είστε σε Κανονική Κατάσταση γράψτε: i πληκτρολογήστε το κείμενο ΣΗΜΕΙΩΣΗ: Πατώντας θα τοποθετηθείτε στην Κανονική Κατάσταση ή θα ακυρώσετε μία ανεπιθύμητη και μερικώς ολοκληρωμένη εντολή. Τώρα συνεχίστε με το Μάθημα 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Μάθημα 2.1: ΕΝΤΟΛΕΣ ΔΙΑΓΡΑΦΗΣ ** Γράψτε dw για να διαγράψετε μέχρι το τέλος μίας λέξης. ** 1. Πατήστε για να βεβαιωθείτε ότι είστε στην Κανονική Κατάσταση. 2. Μετακινείστε τον δρομέα στην παρακάτω γραμμή σημειωμένη με --->. 3. Πηγαίνετε τον δρομέα στην αρχή της λέξης που πρέπει να διαγραφεί. 4. Γράψτε dw για να κάνετε την λέξη να εξαφανιστεί. ΣΗΜΕΙΩΣΗ: Τα γράμματα dw θα εμφανιστούν στην τελευταία γραμμή της οθόνης όσο τα πληκτρολογείτε. Αν γράψατε κάτι λάθος, πατήστε και ξεκινήστε από την αρχή. ---> There are a some words fun that don't belong paper in this sentence. 5. Επαναλάβετε τα βήματα 3 και 4 μέχρι η πρόταση να είναι σωστή και πηγαίνετε στο Μάθημα 2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Μάθημα 2.2: ΠΕΡΙΣΣΟΤΕΡΕΣ ΕΝΤΟΛΕΣ ΔΙΑΓΡΑΦΗΣ ** Πληκτρολογήστε d$ για να διαγράψετε μέχρι το τέλος της γραμμής. ** 1. Πατήστε για να βεβαιωθείτε ότι είστε στην Κανονική Κατάσταση. 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. Πατήστε και πηγαίνετε στο επόμενο λάθος (στον πρώτο χαρακτήρα προς αλλαγή). 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$ για να κάνετε το υπόλοιπο της γραμμής ίδιο με τη δεύτερη και πατήστε . ---> 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' . Αυτή είναι η λέξη που θέλετε να ψάξετε. 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 . Σημειώστε ότι αυτή η εντολή αλλάζει μόνο την πρώτη εμφάνιση στη γραμμή. 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 μετά από το ! και πατήστε . Αυτό θα σας εμφανίσει μία λίστα του καταλόγου σας, ακριβώς σαν να ήσασταν στην προτροπή του φλοιού. Ή χρησιμοποιήστε :!dir αν το ls δεν δουλεύει. ---> Σημείωση: Είναι δυνατόν να εκτελέσετε οποιαδήποτε εξωτερική εντολή με αυτόν τον τρόπο. ---> Σημείωση: Όλες οι εντολές : πρέπει να τερματίζονται πατώντας το . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Μάθημα 5.2: ΠΕΡΙΣΣΟΤΕΡΑ ΠΕΡΙ ΕΓΓΡΑΦΗΣ ΑΡΧΕΙΩΝ ** Για να σώσετε τις αλλάγες που κάνατε στο αρχείο, γράψτε :w ΑΡΧΕΙΟ. ** 1. Γράψτε :!dir ή :!ls για να πάρετε μία λίστα του καταλόγου σας. Ήδη ξέρετε ότι πρέπει να πατήσετε μετά από αυτό. 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. Τώρα αντιγράψτε τη σημειωμένη με ---> γραμμή και πατήστε για να βγείτε από την Κατάσταση Κειμένου. ---> 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 , τον τελευταίο χαρακτήρα, το κείμενο της εισαγωγής, , δρομέα-δεξιά, και τέλος, 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. Σημειώστε ότι όταν πατάτε για να βγείτε, παραμένει οποιοδήποτε αναλλοίωτο κείμενο. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Μάθημα 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 εισέρχεται στην Κατάσταη Αντικατάστασης μέχρι να πατηθεί το και να εξέλθει. 4. Γράφοντας ":set xxx" ρυθμίζει την επιλογή "xxx". ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ΜΑΘΗΜΑ 7: ON-LINE ΕΝΤΟΛΕΣ ΒΟΗΘΕΙΑΣ ** Χρησιμοποιήστε το on-line σύστημα βοήθειας ** Ο Vim έχει ένα περιεκτικό on-line σύστημα βοήθειας. Για να ξεκινήσει, δοκιμάστε κάποιο από τα τρία: - πατήστε το πλήκτρο (αν έχετε κάποιο) - πατήστε το πλήκτρο (αν έχετε κάποιο) - γράψτε :help Γράψτε :q για να κλείσετε το παράθυρο της βοήθειας. Μπορείτε να βρείτε βοήθεια πάνω σε κάθε αντικείμενο, δίνοντας μία παράμετρο στην εντολή ":help". Δοκιμάστε αυτά (μην ξεχνάτε να πατάτε ): :help w :help c_ La klavo l estas la plej dekstra kaj movas dekstren. j La klavo j aspektas kiel malsuprena sago. v 1. Movu la kursoron sur la ekrano is kiam vi sentas vin komforta. 2. Premu la klavon (j) is kiam i ripetas. Vi nun scias, kiel movii al la sekvanta leciono 3. Uzante la malsuprenan klavon, moviu al la leciono 1.2. RIMARKO: Se vi dubas pri tio, kion vi premis, premu por reiri al la normala reimo. Tiam repremu la deziratan komandon. RIMARKO: La klavoj de la kursoro devus anka funkcii. Sed uzante hjkl, vi kapablos movii pli rapide post kiam vi kutimios. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 1.2: ELIRI EL VIM !! RIMARKO: Anta ol plenumi iujn subajn paojn ajn, legu la tutan lecionon!! 1. Premu la klavon (por certigi, ke vi estas en normala reimo). 2. Tajpu: :q! . Tio eliras el la rekdaktilo, SEN konservi la anojn, kiujn vi faris. 3. Kiam vi vidas la elinviton, tajpu la komandon kiun vi uzis por eniri en i tiu instruilo. Tio estus: vimtutor 4. Se vi memoris tiujn paojn kaj sentas vin memfida, plenumu la paojn 1 is 3 por eliri kaj reeniri la redaktilon. RIMARKO: :q! eliras sen konservi la anojn, kiujn vi faris. Post kelkaj lecionoj, vi lernos kiel konservi la anojn al dosiero. 5. Movu la kursoron suben is la leciono 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 1.3: REDAKTO DE TEKSTO - FORVIO ** Premu x por forvii la signon sub la kursoro. ** 1. Movu la kursoron al la suba linio markita per --->. 2. Por korekti la erarojn, movu la kursoron is kiam i estas sur la forvienda signo. 3. Premu la klavon x por forvii la nedeziratan signon. 4. Ripetu paojn 2 is 4 is kiam la frazo estas usta. ---> La boovinno saaltiss ssur laa luuno. 5. Post kiam la linio estas usta, iru al la leciono 1.4 RIMARKO: Trairante la instruilon, ne provu memori, lernu per la uzo. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 1.4: REDAKTO DE TEKSTO - ENMETO ** Premu i por enmeti tekston. ** 1. Movu la kursoron al la unua suba linio markita per --->. 2. Por igi la unuan linion sama kiel la dua, movu la kursoron sur la unuan signon post kie la teksto estas enmetenda. 3. Premu i kaj tajpu la bezonatajn aldonojn. 4. Premu kiam la eraroj estas korektitaj por reiri al la normala reimo. Ripetu la paojn 2 is 4 por korekti la frazon. ---> Mank en i linio. ---> Mankas teksto en i tiu linio. 5. Kiam vi sentas vin komforta pri enmeto de teksto, moviu al la leciono 1.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 1.5: REDAKTO DE TEKSTO - POSTALDONO ** Premu A por postaldoni tekston. ** 1. Movu la kursoron al la unua suba linio markita per --->. Ne gravas sur kiu signo estas la kursoro. 2. Premu majusklan A kaj tajpu la bezonatajn aldonojn. 3. Post kiam la teksto estas aldonita, premu por reiri al la normala reimo. 4. Movu la kursoron al la dua linio markita per ---> kaj ripetu la paojn 2 kaj 3 por korekti la frazon. ---> Mankas teksto el ti Mankas teksto el tiu linio. ---> Mankas anka teks Mankas anka teksto i tie. 5 Kiam vi sentas vin komforta pri postaldono de teksto, moviu al la leciono 1.6 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 1.6: REDAKTI DOSIERON ** Uzu :wq por konservi dosieron kaj eliri. ** !! RIMARKO: Anta ol plenumi iun suban paon ajn, legu la tutan lecionon!! 1. Eliru el la instruilo kiel vi faris en la leciono 1.2: :q! A, se vi havas atingon al alia terminalo, faru tion, kio sekvas tie. 2. e la elinvito, tajpu i tiun komandon: vim tutor 'vim' estas la komando por lani la redaktilon Vim, 'tutor' estas la dosiernomo de la dosiero, kiun vi volas redakti. Uzu dosieron, kiu aneblas. 3. Enmetu kaj forviu tekston, kiel vi lernis en la antaaj lecionoj. 4. Konservu la dosieron kun anoj kaj eliru el Vim per: :wq 5. Se vi eliris la instruilon vimtutor en pao 1, restartigu la intruilon vimtutor kaj moviu suben al la sekvanta resumo. 6. Post kiam vi legis la suprajn paojn, kaj komprenis ilin: faru ilin. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 1 RESUMO 1. La kursoro movias a per la sagoklavoj, a per la klavoj hjkl. h (liven) j (suben) k (supren) l (dekstren) 2. Por lani Vim el la elinvito, tajpu: vim DOSIERNOMO 3. Por eliri el Vim, tajpu: :q! por rezigni la anojn 4. Por forvii la signojn e la pozicio de la kursoro, tajpu: x 5. Por enmeti a postaldoni tekston, tajpu: i tajpu enmetendan tekston enmetas tekston anta la kursoro A tajpu la postaldonendan tekston postaldonas post la kursoro RIMARKO: Premo de iras al la normala reimo, a rezignas la nedeziratan a parte plenumita komando. Nun darigu al la leciono 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 2.1: KOMANDOJ DE FORVIO ** Tajpu dw por forvii vorton. ** 1. Premu por certigi, ke vi estas en normala reimo. 2. Movu la kursoron al la linio markita per --->. 3. Movu la kursoron al la komenco de vorto, kiu forviendas. 4. Tajpu dw por forvii la vorton. RIMARKO: La litero d aperos en la lasta linio sur la ekrano kiam vi tajpas in. Vim atendas is kiam vi tajpas w . Se vi vidas alian signon ol d vi tajpis ion mise; premu kaj rekomencu. ---> Estas iuj vortoj kiuj Zamenhof ne devus esti akuzativo en i tiu frazo. 5. Ripetu paojn 3 kaj 4 is kiam la frazo estas usta kaj moviu al la leciono 2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 2.2: PLIAJ KOMANDOJ DE FORVIO ** Tajpu d$ por forvii la finon de la linio. ** 1. Premu por certigi, ke vi estas en normala reimo. 2. Movu la kursoron sur la suban linion markita per --->. 3. Movu la kursoron e la fino de la usta linio (POST la unua . ). 4. Tajpu d$ por forivi is la fino de la linio. ---> Iu tajpis la finon de i tiu linio dufoje. fino de i tiu linio dufoje. 5. Moviu al la leciono 2.3 por kompreni kio okazas. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 2.3: PRI OPERATOROJ KAJ MOVOJ Multaj komandoj, kiuj anas la tekston, estas faritaj de operatoro kaj movo. La formato de komando de forvio per la operatoro de forvio d estas kiel sekvas: d movo Kie: d - estas la operatoro de movo movo - estas tio, pri kio la operatoro operacios (listigita sube) Mallonga listo de movoj: w - is la komenco de la sekvanta vorto, krom ia unua signo. e - is la fino de la nuna vorto, krom la lasta signo. $ - is la fino de la linio, krom la lasta signo. Do tajpo de 'de' forvios ekde la kursoro is la fino de la vorto. RIMARKO: Premo de nur la movo en Normala reimo sen operatoro movos la kursoron kiel specifite. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 2.4: UZI NOMBRON POR MOVO ** Tajpo de nombro anta movo ripetas in lafoje. ** 1. Movu la kursoron e la komenco de la suba linio markita per --->. 2. Tajpu 2w por movi la kursoron je du vortoj antaen. 3. Tajpu 3e por movi la kursoron e la fino de la tria vorto antaen. 4. Tajpu 0 (nul) por movii e la komenco de la linio. 5. Ripetu paojn 2 is 3 kun malsamaj nombroj. ---> Tio estas nur linio kun vortoj, kie vi povas movii. 6. Moviu al la leciono 2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 2.5: UZI NOMBRON POR FORVII PLI ** Tajpo de nombro kun operatoro ripetas in lafoje. ** En la kombinao de la operatoro de forvio, kaj movo kiel menciita i-supre, eblas aldoni nombron anta la movo por pli forvii: d nombro movo 1. Movu la kursoron e la unua MAJUSKLA vorto en la linio markita per --->. 2. Tajpu d2w por forvii la du MAJUSKLAJN vortojn 3. Ripetu paojn 1 is 2 per malsama nombro por forvii la sinsekvajn MAJUSKLAJN vortojn per unu komando ---> Tiu AB CDE linio FGHI JK LMN OP de vortoj estas Q RS TUV purigita. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 2.6: OPERACII SUR LINIOJ ** Tajpu dd por forvii tutan linion. ** Pro la ofteco de forvio de tuta linio, la verkisto de Vi decidis, ke estus pli facile simple tajpi du d-ojn por forvii linion. 1. Movu la kursoron sur la duan linion en la suba frazo. 2. Tajpu dd por forvii la linion. 3. Nun moviu al la kvara linio. 4. Tajpu 2dd por forvii du liniojn. ---> 1) Rozoj estas ruaj, ---> 2) limo estas amuza, ---> 3) Violoj estas bluaj, ---> 4) Mi havas aton, ---> 5) Horlooj diras kioma horo estas, ---> 6) Sukero estas dola, ---> 7) Kaj tiel vi estas. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 2.7: LA KOMANDO DE MALFARO ** Premu u por malfari la lastajn komandojn, U por ripari la tutan linion. ** 1. Movu la kursoron e la suba linio markita per ---> kaj metu in sur la unuan eraron. 2. Tajpu x por forvii la unuan nedeziratan signon. 3. Nun tajpu u por malfari la lastan plenumitan komandon. 4. i-foje, riparu iujn erarojn en la linio kaj ia originala stato. 5. Nun tajpu majusklan U por igi la linion al ia antaa stato. 6. Nun tajpu u kelkfoje por malfari la U kaj antaajn komandojn. 7. Nun tajpu CTRL-R (premante la CTRL klavon dum vi premas R) kelkfoje por refari la komandojn (malfari la malfarojn). ---> Koorektii la erarojn sur tiuu i liniio kaj remettu illlin per malfaro. 8. Tiuj estas tre utilaj komandoj. Nun moviu al la leciono 2 RESUMO. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 2 RESUMO 1. Por forvii ekde la kursoro is la sekvanta vorto, tajpu: dw 2. Por forvii ekde la kursoro is la fino de la linio, tajpu: d$ 3. Por forvii tutan linion, tajpu: dd 4. Por ripeti movon, antametu nombron: 2w 5. La formato de ana komando estas: operatoro [nombro] movo kie: operatoro - estas tio, kio farendas, kiel d por forvii [nombro] - estas opcia nombro por ripeti la movon movo - movas sur la teksto por operacii, kiel ekzemple w (vorto), $ (is fino de linio), ktp. 6. Por movii al la komenco de la linio, uzu nul: 0 7. Por malfari antaajn agojn, tajpu: u (minuskla u) Por malfari iujn anojn sur la linio, tajpu: U (majuskla U) Por refari la malfarojn, tajpu: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 3.1 LA KOMANDO DE METO ** Tajpu p por meti tekston forviitan antae post la kursoro. ** 1. Movu la kursoron e la unua ---> suba linio. 2. Tajpu dd por forvii la linion kaj konservi in ene de reistro de Vim. 3. Movu la kursoron e la linio c), SUPER kie la forviita linio devus esti. 4. Tajpu p por meti la linion sub la kursoron. 5. Ripetu la paojn 2 is 4 por meti iujn liniojn en la usta ordo. ---> d) u anka vi povas lerni? ---> b) Violoj estas bluaj, ---> c) Inteligenteco lerneblas, ---> a) Rozoj estas ruaj, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 3.2 LA KOMANDO DE ANSTATAIGO ** Tajpu rx por anstataigi la signon e la kursoro per x . ** 1. Movu la kursoron e la unua suba linio markita per --->. 2. Movu la kursoron is la unua eraro. 3. Tajpu r kaj la signon, kiu devus esti tie. 4. Ripetu paojn 2 kaj 3 is kiam la unua linio egalas la duan. ---> Kiem tiu lanio estis tajpita, iu pramis la nauftajn klovojn! ---> Kiam tiu linio estis tajpita, iu premis la neustajn klavojn! 5. Nun moviu al la leciono 3.3. RIMARKO: Memoru, ke vi devus lerni per uzo, kaj ne per memorado. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 3.3 LA OPERATORO DE ANO ** Por ani is la fino de la vorto, tajpu ce . ** 1. Movu la kursoron e la unua suba linio markita per --->. 2. Metu la kursoron sur la d en lduzw 3. Tajpu ce kaj la ustan vorton (en tiu i kazo, tajpu inio ). 4. Premu kaj moviu al la sekvanta signo, kiu bezonas anon. 5. Ripetu la paojn 3 kaj 4 is kiam la unua frazo egalas la duan. ---> Tiu lduzw havas kelkajn vortojn, kiii bezas anon per la anooto. ---> Tiu linio havas kelkajn vortojn, kiuj bezonas anon per la anoperatoro. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 3.4 PLIAJ ANOJ PER c ** La operatoro de ano uzeblas kun la sama movo kiel forvio. ** 1. La operatoro de ano funkcias sammaniere kiel forvio. La formato estas: c [nombro] movo 2. La movoj estas samaj, kiel ekzemple w (vorto) kaj $ (fino de linio). 3. Moviu e la unua suba linio markita per --->. 4. Movu la kursoron al la unua eraro. 5. Tajpu c$ kaj tajpu la reston de la linio kiel la dua kaj premu . ---> La fino de i tiu linio bezonas helpon por igi in same kiel la dua. ---> La fino de i tiu linio bezonas korektojn per uzo de la komando c$ RIMARKO: Vi povas uzi la klavon Retropao por korekti erarojn dum vi tajpas. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 3 RESUMO 1. Por remeti tekston, kiun vi us forviis, tajpu p. Tio metas la forviitan tekston POST la kursoro (se linio estis forviita, i iros en la linion sub la kursoro). 2. Por anstataigi la signon sub la kursoro, tajpu r kaj tiam la signon kion vi deziras havi tie. 3. La operatoro de ano ebligas al vi ani ekde la kursoro, is kie la movo iras. Ekz. tajpu ce por ani ekde la kursoro is la fino de la vorto, c$ por ani is la fino de la linio. 4. La formato de ano estas: c [nombro] movo Nun darigu al la sekvanta leciono. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 4.1: POZICIO DE KURSORO KAJ STATO DE DOSIERO ** Tajpu CTRL-G por montri vian pozicion en la dosiero kaj la dosierstaton. Tajpu G por movii al linio en la dosiero. ** RIMARKO: Legu la tutan lecionon anta ol plenumi iun paon ajn!! 1. Premu la klavon Ctrl kaj premu g . Oni nomas tion CTRL-G. Mesao aperos e la suba parto de la pao kun la dosiernomo kaj la pozicio en la dosiero. Memoru la numeron de la linio por pao 3. RIMARKO: Vi eble vidas la pozicion de la kursoro e la suba dekstra angulo de la ekrano. Tio okazas kiam la agordo 'ruler' estas altita (vidu :help 'ruler') 2. Premu G por movii e la subo de la dosiero. Tajpu gg por movii e la komenco de la dosiero. 3. Tajpu la numeron de la linio kie vi estis kaj poste G . Tio removos vin al la linio, kie vi estis kiam vi unue premis CTRL-G. 4. Se vi sentas vin komforta, plenumu paojn 1 is 3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 4.2 LA KOMANDO DE SERO ** Tajpu / kaj poste frazon por seri la frazon. ** 1. En normala reimo, tajpu la / signon. Rimarku, ke i kaj la kursoro aperas e la suba parto de la ekrano kiel por la : komando. 2. Nun tajpu 'errarro' . Tio estas la vorto, kion vi volas seri. 3. Por seri la saman frazon denove, simple tajpu n . Por seri la saman frazon denove en la retrodirekto, tajpu N . 4. Por seri frazon en la retrodirekto, uzu ? anstata / . 5. Por reiri tien, el kie vi venis, premu CTRL-O (Premu Ctrl kaj o literon o). Ripetu por pli retroiri. CTRL-I iras antaen. ---> "errarro" ne estas maniero por literumi eraro; errarro estas eraro. RIMARKO: Kiam la sero atingas la finon de la dosiero, i daras e la komenco, krom se la agordo 'wrapscan' estas malaltita. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 4.3 SERO DE KONGRUAJ KRAMPOJ ** Tajpu % por trovi kongruan ), ] a } ** 1. Poziciu la kursoron sur iun (, [ a { en la linio markita per --->. 2. Nun tajpu la % signon. 3. La kursoro movias al la kongrua krampo. 4. Tajpu % por movi la kursoron al la alia kongrua krampo. 5. Movu la kursoron al la alia (, ), [, ], {, } kaj observu tion, kion % faras. ---> i tiu ( estas testa linio kun (-oj, [-oj, ]-oj kaj {-oj, }-oj en i. )) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 4.4 LA KOMANDO DE ANSTATAIGO ** Tajpu :s/malnova/nova/g por anstataigi 'nova' per 'malnova'. ** 1. Movu la kursoron al la suba linio markita per --->. 2. Tajpu :s/laa/la . Rimarku, ke la komando anas nur la unuan okazaon de "laa" en la linio. 3. Nun tajpu :s/laa/la/g . Aldono de g opcio signifas mallokan anstataigon en la linio. i anas iujn okazaojn de "laa" en la linio. ---> laa plej bona tempo por vidi florojn estas en laa printempo. 4. Por ani iujn okazaojn de iu ena signo inter du linioj, tajpu :#,#s/malnova/nova/g kie #,# estas la numeroj de linioj de la intervalo de la linioj kie la anstataigo okazos. Tajpu :%s/malnova/nova/g por ani iujn okazaojn en la tuta dosiero. Tajpu :s/malnova/nova/gc por trovi iujn okazaojn en la tuta dosiero, kun invitilo u anstataigi a ne. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 4 RESUMO 1. CTRL-G vidigas vian pozicion en la dosiero kaj la staton de la dosiero. G movas la kursoron al la fino de la dosiero. numero G movas la kursoron al numero de tiu linio. gg movas la kursoron al la unua linio. 2. Tajpo de / kaj frazon seras la frazon antaen. Tajpo de ? kaj frazon seras la frazon malantaen. Post sero, tajpu n por trovi la sekvantan okazaon en la sama direkto a N por seri en la mala direkto. CTRL-O movas vin al la antaaj pozicioj, CTRL-I al la novaj pozicioj. 3. Tajpo de % kiam la kursoro estas sur (,),[,],{ a } movias al ia kongruo. 4. Por anstataigi 'nova' en la unua 'malnova' en linio :s/malnova/nova Por anstataigi 'nova' en iuj 'malnova'-oj en linio :s/malnova/nova/g Por anstataigi frazon inter du #-aj linioj :#,#s/malnova/nova/g Por anstataigi iujn okazaojn en la dosiero :%s/malnova/nova/g Por demandi konfirmon iu-foje, aldonu 'c' :%s/malnova/nova/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 5.1 KIEL PLENUMI EKSTERAN KOMANDON ** Tajpu :! sekvata de ekstera komando por plenumi la komandon. ** 1. Tajpu la konatan komandon : por pozicii la kursoron e la suba parto de la ekrano. Tio ebligas tajpadon de komando en komanda linio. 2. Nun tajpu la ! (krisigno) signon. Tio ebligas al vi plenumi iun eksteran elan komandon ajn. 3. Ekzemple, tajpu ls post ! kaj tajpu . Tio listigos la enhavon de la dosierujo, same kiel se vi estis en ela invito. A uzu :!dir se ls ne funkcias. RIMARKO: Eblas plenumi iun eksteran komandon ajn tiamaniere, anka kun argumentoj. RIMARKO: iuj : komandoj devas finii per tajpo de Ekde nun, ni ne plu mencios tion. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 5.2 PLI PRI KONSERVO DE DOSIERO ** Por konservi la faritajn anojn en la teksto, tajpu :w DOSIERNOMO. ** 1. Tajpu !dir a !ls por akiri liston de via dosierujo. Vi jam scias, ke vi devas tajpi post tio. 2. Elektu dosieron, kiu ankora ne ekzistas, kiel ekzemple TESTO. 3. Nun tajpu: :w TESTO (kie TESTO estas la elektita dosiernomo) 4. Tio konservas la tutan dosieron (instruilon de Vim) kun la nomo TESTO. Por kontroli tion, tajpu :!dir a :!ls denove por vidigi vian dosierujon. RIMARKO: Se vi volus eliri el Vim kaj restartigi in denove per vim TESTO, la dosiero estus precize same kiel kopio de la instruilo kiam vi konservis in. 5. Nun forviu la dosieron tajpante (MS-DOS): :!del TESTO a (UNIKSO): :!rm TESTO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 5.3 APARTIGI KONSERVENDAN TESTON ** Por konservi parton de la dosiero, tajpu v movo :w DOSIERNOMO ** 1. Movu la kursoron al tiu linio. 2. Premu v kaj movu la kursoron al la kvina suba ero. Rimarku, ke la teksto emfazias. 3. Premu la : signon. e la fino de la ekrano :'<,'> aperos. 4. Tajpu w TESTO , kie TESTO estas dosiernomo, kiu ankora ne ekzistas. Kontrolu, ke vi vidas :'<,'>w TESTO anta premi . 5. Vim konservos la apartigitajn liniojn al la dosiero TESTO. Uzu :dir a :!ls por vidigi in. Ne forviu in. Ni uzos in en la sekvanta leciono. RIMARKO: Premo de v komencas Viduman apartigon. Vi povas movi la kursoron por pligrandigi a malpligrandigi la apartigon. Tiam vi povas uzi operatoron por plenumi ion kun la teksto. Ekzemple, d forvias la tekston. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 5.4 AKIRI KAJ KUNFANDI DOSIEROJN ** Por enmeti la enhavon de dosiero, tajpu :r DOSIERNOMON ** 1. Movu la kursoron us super i tiu linio. RIMARKO: Post plenumo de pao 2, vi vidos tekston el la leciono 5.3. Tiam moviu SUBEN por vidi tiun lecionon denove. 2. Nun akiru vian dosieron TESTO uzante la komandon :r TESTO kie TESTO estas la nomo de la dosiero, kiun vi uzis. La dosiero, kion vi akiras, estas metita sub la linio de la kursoro. 3. Por kontroli, u la dosiero akiriis, retromovu la kursoron kaj rimarku, ke estas nun du kopioj de la leciono 5.3, la originala kaj la versio mem de la dosiero. RIMARKO: Vi nun povas legi la eliron de ekstera komando. Ekzemple, :r !ls legas la eliron de la komando ls kaj metas in sub la kursoron. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 5 RESUMO 1. :!komando plenumas eksteran komandon. Iuj utilaj ekzemploj estas: (MS-DOS) (UNIKSO) :!dir :!ls - listigas dosierujon :!del DOSIERNOMO :!rm DOSIERNOMO - forvias la dosieron DOSIERNOMO 2. :w DOSIERNOMO konservas la nunan dosieron de Vim al disko kun la nomo DOSIERNOMO. 3. v movo :w DOSIERNOMO konservas la Viduman apartigon de linioj en dosiero DOSIERNOMO. 4. :r DOSIERNOMO akiras la dosieron DOSIERNOMO el la disko kaj metas in sub la pozicion de la kursoro. 5. :r !dir legas la eligon de la komando dir kaj metas in sub la pozicion de la kursoro. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 6.1 LA KOMANDO DE MALFERMO ** Tajpu o por malfermi linion sub la kursoro kaj eniri Enmetan reimon. ** 1. Movu la kursoron al la suba linio markita per --->. 2. Tajpu la minusklan literon o por malfermi linion SUB la kursoro kaj eniri la Enmetan reimon. 3. Nun tajpu tekston kaj premu por eliri la Enmetan reimon. ---> Post tajpo de o la kursoro movias al la malfermata linio en Enmeta reimo. 4. Por malfermi linion SUPER la kursoro, nur tajpu majusklan O , anstata minusklan o. Provu tion per la suba linio. ---> Malfermu linion SUPER tiu tajpante O dum la kursoro estas sur tiu linio. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 6.2 LA KOMANDO DE POSTALDONO ** Tajpu a por enmeti POST la kursoro. ** 1. Movu la kursoron e la komenco de la linio markita per --->. 2. Premu e is kiam la kursoro estas e la fino de li. 3. Tajpu a (minuskle) por aldoni tekston POST la kursoro. 4. Kompletigu la vorton same kiel la linio sub i. Premu por eliri la Enmetan reimon. 5. Uzu e por movii al la sekvanta nekompleta vorto kaj ripetu paojn 3 kaj 4. ---> i tiu lin ebligos vin ekz vin postal tekston al linio. ---> i tiu linio ebligos vin ekzerci vin postaldoni tekston al linio. RIMARKO: iu a, i kaj A iras al la sama Enmeta reimo, la nura malsamo estas tie, kie la signoj estas enmetitaj. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 6.3 ALIA MANIERO POR ANSTATAIGI ** Tajpu majusklan R por anstataigi pli ol unu signo. ** 1. Movu la kursoron al la unua suba linio markita per --->. Movu la kursoron al la komenco de la unua xxx . 2. Nun premu R kaj tajpu la nombron sub i en la dua linio, por ke i anstataigu la xxx . 3. Premu por foriri la Anstataigan reimon. Rimarku, ke la cetera parto de la linio restas neanata. 4. Ripetu la paojn por anstataigi la restantajn xxx. ---> Aldono de 123 al xxx donas al vi xxx. ---> Aldono de 123 al 456 donas al vi 579. RIMARKO: Anstataiga reimo estas same kiel Enmeta reimo, sed iu signo tajpita forvias ekzistan signon. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 6.4 KOPII KAJ ALGLUI TEKSTON ** Uzu la y operatoron por kopii tekston, kaj p por alglui in ** 1. Iru al la linio markita per ---> sube kaj poziciu la kursoron post "a)". 2. Komencu la Viduman reimon per v kaj movu la kursoron us anta "unua". 3. Tajpu y por kopii la emfazitan tekston. 4. Movu la kursoron e la fino de la linio: j$ 5. Tajpu p por alglui la tekston. Tiam tajpu: a dua . 6. Uzu Viduman reimon por apartigi " ero.", kopiu in per y , moviu e la fino de la sekvanta linio per j$ kaj algluu la tekston tie per p . ---> a) tio estas la unua ero. b) RIMARKO: vi povas anka uzi y kiel operatoro; yw kopias unu vorton. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 6.5 AGORDI OPCION ** Agordu opcion por ke sero a anstataigo ignoru usklecon ** 1. Seru 'ignori' per tajpo de /ignori Ripetu plurfoje premante n . 2. altu la opcion 'ic' (ignori usklecon) per: :set ic 3. Nun seru 'ignori' denove premante n Rimarku, ke Ignori kaj IGNORI estas nun troveblas. 4. altu la opciojn 'hlsearch' kaj 'incsearch': :set hls is 5. Nun retajpu la seran komandon kaj vidu kio okazas: /ignore 6. Por malalti ignoron de uskleco: :set noic RIMARKO: Por forigi emfazon de kongruo, tajpu: :nohlsearch RIMARKO: Se vi deziras ignori usklecon por nur unu sera komando, uzu \c en la frazo: /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 6 RESUMO 1. Tajpu o por malfermi linion SUB la kursoro kaj eki en Enmeta reimo. 1. Tajpu O por malfermi linion SUPER la kursoro. 2. Tajpu a por enmeti tekston POST la kursoro. Tajpu A por enmeti tekston post la fino de la linio. 3. La e komando movas la kursoron al la fino de vorto. 4. la y operatoro kopias tekston, p algluas in. 5. Tajpo de majuskla R eniras la Anstataigan reimon is kiam estas premita. 6. Tajpo de ":set xxx" altas la opcion "xxx". Iuj opcioj estas: 'ic' 'ignorecase' ignori usklecon dum sero 'is' 'incsearch' montru partan kongruon dum sero 'hls' 'hlsearch' emfazas iujn kongruajn frazojn Vi povas uzi a la longan, a la mallongan nomon de opcio. 7. Antaaldonu "no" por malalti la opcion: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 7.1 AKIRI HELPON ** Uzu la helpan sistemon ** Vim havas ampleksan helpan sistemon. Por komencii, provu unu el la tiuj tri: - premu la klavon (se vi havas in) - premu la klavon (se vi havas in) - tajpu :help Legu la tekston en la helpfenestro por trovi kiel helpo funkcias. Tajpu CTRL-W CTRL-W por salti de unu fenestro al la alia. Tajpu :q por fermi la helpan fenestron. Vi povas trovi helpon pri io ajn aldonante argumenton al la komando ":help". Provu tiujn (ne forgesu premi ): :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 7.2 KREI STARTAN SKRIPTON ** Ebligu kapablojn de Vim ** Vim havas multe pli da kapabloj ol Vi, sed la plej multaj estas defalte malaltitaj. Por ekuzi la kapablojn, vi devas krei dosieron "vimrc". 1. Ekredaktu la dosieron "vimrc". Tio dependas de via sistemo: :e ~/.vimrc por Unikso :e $VIM/_vimrc por MS-Vindozo 2. Nun legu la enhavon de la ekzempla "vimrc" :r $VIMRUNTIME/vimrc_example.vim 3. Konservu la dosieron per: :w La sekvantan fojon, kiam vi lanas Vim, i uzos sintaksan emfazon. Vi povas aldoni iujn viajn preferatajn agordojn al tiu dosiero "vimrc". Por pli da informoj, tajpu :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 7.3 KOMPLETIGO ** Kompletigo de komanda linio per CTRL-D kaj ** 1. Certigu ke Vim estas en kongrua reimo: :set nocp 2. Rigardu tiujn dosierojn, kiuj ekzistas en la dosierujo: :!ls a :!dir 3. Tajpu la komencon de komando: :e 4. Premu CTRL-D kaj Vim montros liston de komandoj, kiuj komencas per "e". 5. Premu kaj Vim kompletigos la nomon de la komando al ":edit". 6. Nun aldonu spaceton kaj la komencon de ekzistanta nomo: :edit DOSI 7. Premu . Vim kompletigos la nomon (se i estas unika) RIMARKO: Kompletigo funkcias por multaj komandoj. Nur provu premi CTRL-D kaj . Estas aparte utila por :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 7 RESUMO 1. Tajpu :help a premu a por malfermi helpan fenestron. 2. Tajpu :help kmd por trovi helpon pri kmd. 3. Tajpu CTRL-W CTRL-W por salti al alia fenestro. 4. Tajpu :q to fermi la helpan fenestron. 5. Kreu komencan skripton vimrc por konservi viajn agordojn. 6. Kiam vi tajpas : komandon, premu CTRL-D por vidi iujn kompleteblojn. Premu por uzi unu kompletigon. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tio konkludas la instruilon de Vim. i celis doni mallongan superrigardon de la redaktilo Vim, nur tion kio sufias por ebligi al vi facilan uzon de la redaktilo. Estas nepre nekompleta, ar Vim havas multajn multajn pliajn komandojn. Legu la manlibron: ":help user-manual". Tiu instruilo estis verkita de Michael C. Pierce kaj Robert K. Ware, el la Koloradia Lernejo de Minejoj (Colorado School of Mines) uzante ideojn provizitajn de Charles Smith el la Stata Universitato de Koloradio (Colorado State University) Retpoto: bware@mines.colorado.edu. Modifita por Vim de Bram Moolenaar. Esperantigita fare de Dominique Pell, 2008-04-01 Retpoto: dominique.pelle@gmail.com Lasta ano: 2011-11-27 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim-7.4.1689/runtime/tutor/tutor.eo.utf-8000066400000000000000000001054211267703067000201040ustar00rootroot00000000000000============================================================================== = B o n v e n o n al la I n s t r u i l o de V I M - Versio 1.7 = ============================================================================== Vim estas tre potenca redaktilo, kiu havas multajn komandojn, tro da ili por ĉion klarigi en instruilo kiel ĉi tiu. Ĉi tiu instruilo estas fasonita por priskribi sufiĉajn komandojn, por ke vi kapablu uzi Vim kun sufiĉa facileco. La tempo bezonata por plenumi la kurson estas 25-30 minutoj, kaj dependas de kiom da tempo estas uzata por eksperimenti. ATENTU: La komandoj en la lecionoj ŝanĝos la tekston. Kopiu tiun ĉi dosieron por ekzerci vin (se vi lanĉis "vimtutor", tiam estas jam kopio). Gravas memori, ke ĉi tiu instruilo estas organizata por instrui per la uzo. Tio signifas, ke vi devas plenumi la komandojn por bone lerni ilin. Se vi nur legas la tekston, vi forgesos la komandojn! Nun, certigu, ke la majuskla baskulo NE estas en reĝimo majuskla, kaj premu la klavon j sufiĉe da fojoj por movi la kursoron, kaj por ke la leciono 1.1 plenigu la ekranon. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 1.1: MOVI LA KURSORON ** Por movi la kursoron, premu la h,j,k,l klavojn kiel montrite. ** ^ k Konsilo: La klavo h estas la plej liva kaj movas liven. < h l > La klavo l estas la plej dekstra kaj movas dekstren. j La klavo j aspektas kiel malsuprena sago. v 1. Movu la kursoron sur la ekrano ĝis kiam vi sentas vin komforta. 2. Premu la klavon (j) ĝis kiam ĝi ripetas. Vi nun scias, kiel moviĝi al la sekvanta leciono 3. Uzante la malsuprenan klavon, moviĝu al la leciono 1.2. RIMARKO: Se vi dubas pri tio, kion vi premis, premu por reiri al la normala reĝimo. Tiam repremu la deziratan komandon. RIMARKO: La klavoj de la kursoro devus ankaŭ funkcii. Sed uzante hjkl, vi kapablos moviĝi pli rapide post kiam vi kutimiĝos. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 1.2: ELIRI EL VIM !! RIMARKO: Antaŭ ol plenumi iujn subajn paŝojn ajn, legu la tutan lecionon!! 1. Premu la klavon (por certigi, ke vi estas en normala reĝimo). 2. Tajpu: :q! . Tio eliras el la rekdaktilo, SEN konservi la ŝanĝojn, kiujn vi faris. 3. Kiam vi vidas la ŝelinviton, tajpu la komandon kiun vi uzis por eniri en ĉi tiu instruilo. Tio estus: vimtutor 4. Se vi memoris tiujn paŝojn kaj sentas vin memfida, plenumu la paŝojn 1 ĝis 3 por eliri kaj reeniri la redaktilon. RIMARKO: :q! eliras sen konservi la ŝanĝojn, kiujn vi faris. Post kelkaj lecionoj, vi lernos kiel konservi la ŝanĝojn al dosiero. 5. Movu la kursoron suben ĝis la leciono 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 1.3: REDAKTO DE TEKSTO - FORVIŜO ** Premu x por forviŝi la signon sub la kursoro. ** 1. Movu la kursoron al la suba linio markita per --->. 2. Por korekti la erarojn, movu la kursoron ĝis kiam ĝi estas sur la forviŝenda signo. 3. Premu la klavon x por forviŝi la nedeziratan signon. 4. Ripetu paŝojn 2 ĝis 4 ĝis kiam la frazo estas ĝusta. ---> La boovinno saaltiss ssur laa luuno. 5. Post kiam la linio estas ĝusta, iru al la leciono 1.4 RIMARKO: Trairante la instruilon, ne provu memori, lernu per la uzo. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 1.4: REDAKTO DE TEKSTO - ENMETO ** Premu i por enmeti tekston. ** 1. Movu la kursoron al la unua suba linio markita per --->. 2. Por igi la unuan linion sama kiel la dua, movu la kursoron sur la unuan signon post kie la teksto estas enmetenda. 3. Premu i kaj tajpu la bezonatajn aldonojn. 4. Premu kiam la eraroj estas korektitaj por reiri al la normala reĝimo. Ripetu la paŝojn 2 ĝis 4 por korekti la frazon. ---> Mank en ĉi linio. ---> Mankas teksto en ĉi tiu linio. 5. Kiam vi sentas vin komforta pri enmeto de teksto, moviĝu al la leciono 1.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 1.5: REDAKTO DE TEKSTO - POSTALDONO ** Premu A por postaldoni tekston. ** 1. Movu la kursoron al la unua suba linio markita per --->. Ne gravas sur kiu signo estas la kursoro. 2. Premu majusklan A kaj tajpu la bezonatajn aldonojn. 3. Post kiam la teksto estas aldonita, premu por reiri al la normala reĝimo. 4. Movu la kursoron al la dua linio markita per ---> kaj ripetu la paŝojn 2 kaj 3 por korekti la frazon. ---> Mankas teksto el ti Mankas teksto el tiu linio. ---> Mankas ankaŭ teks Mankas ankaŭ teksto ĉi tie. 5 Kiam vi sentas vin komforta pri postaldono de teksto, moviĝu al la leciono 1.6 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 1.6: REDAKTI DOSIERON ** Uzu :wq por konservi dosieron kaj eliri. ** !! RIMARKO: Antaŭ ol plenumi iun suban paŝon ajn, legu la tutan lecionon!! 1. Eliru el la instruilo kiel vi faris en la leciono 1.2: :q! Aŭ, se vi havas atingon al alia terminalo, faru tion, kio sekvas tie. 2. Ĉe la ŝelinvito, tajpu ĉi tiun komandon: vim tutor 'vim' estas la komando por lanĉi la redaktilon Vim, 'tutor' estas la dosiernomo de la dosiero, kiun vi volas redakti. Uzu dosieron, kiu ŝanĝeblas. 3. Enmetu kaj forviŝu tekston, kiel vi lernis en la antaŭaj lecionoj. 4. Konservu la dosieron kun ŝanĝoj kaj eliru el Vim per: :wq 5. Se vi eliris la instruilon vimtutor en paŝo 1, restartigu la intruilon vimtutor kaj moviĝu suben al la sekvanta resumo. 6. Post kiam vi legis la suprajn paŝojn, kaj komprenis ilin: faru ilin. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 1 RESUMO 1. La kursoro moviĝas aŭ per la sagoklavoj, aŭ per la klavoj hjkl. h (liven) j (suben) k (supren) l (dekstren) 2. Por lanĉi Vim el la ŝelinvito, tajpu: vim DOSIERNOMO 3. Por eliri el Vim, tajpu: :q! por rezigni la ŝanĝojn 4. Por forviŝi la signojn ĉe la pozicio de la kursoro, tajpu: x 5. Por enmeti aŭ postaldoni tekston, tajpu: i tajpu enmetendan tekston enmetas tekston antaŭ la kursoro A tajpu la postaldonendan tekston postaldonas post la kursoro RIMARKO: Premo de iras al la normala reĝimo, aŭ rezignas la nedeziratan aŭ parte plenumita komando. Nun daŭrigu al la leciono 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 2.1: KOMANDOJ DE FORVIŜO ** Tajpu dw por forviŝi vorton. ** 1. Premu por certigi, ke vi estas en normala reĝimo. 2. Movu la kursoron al la linio markita per --->. 3. Movu la kursoron al la komenco de vorto, kiu forviŝendas. 4. Tajpu dw por forviŝi la vorton. RIMARKO: La litero d aperos en la lasta linio sur la ekrano kiam vi tajpas ĝin. Vim atendas ĝis kiam vi tajpas w . Se vi vidas alian signon ol d vi tajpis ion mise; premu kaj rekomencu. ---> Estas iuj vortoj kiuj Zamenhof ne devus esti akuzativo en ĉi tiu frazo. 5. Ripetu paŝojn 3 kaj 4 ĝis kiam la frazo estas ĝusta kaj moviĝu al la leciono 2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 2.2: PLIAJ KOMANDOJ DE FORVIŜO ** Tajpu d$ por forviŝi la finon de la linio. ** 1. Premu por certigi, ke vi estas en normala reĝimo. 2. Movu la kursoron sur la suban linion markita per --->. 3. Movu la kursoron ĉe la fino de la ĝusta linio (POST la unua . ). 4. Tajpu d$ por forivŝi ĝis la fino de la linio. ---> Iu tajpis la finon de ĉi tiu linio dufoje. fino de ĉi tiu linio dufoje. 5. Moviĝu al la leciono 2.3 por kompreni kio okazas. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 2.3: PRI OPERATOROJ KAJ MOVOJ Multaj komandoj, kiuj ŝanĝas la tekston, estas faritaj de operatoro kaj movo. La formato de komando de forviŝo per la operatoro de forviŝo d estas kiel sekvas: d movo Kie: d - estas la operatoro de movo movo - estas tio, pri kio la operatoro operacios (listigita sube) Mallonga listo de movoj: w - ĝis la komenco de la sekvanta vorto, krom ĝia unua signo. e - ĝis la fino de la nuna vorto, krom la lasta signo. $ - ĝis la fino de la linio, krom la lasta signo. Do tajpo de 'de' forviŝos ekde la kursoro ĝis la fino de la vorto. RIMARKO: Premo de nur la movo en Normala reĝimo sen operatoro movos la kursoron kiel specifite. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 2.4: UZI NOMBRON POR MOVO ** Tajpo de nombro antaŭ movo ripetas ĝin laŭfoje. ** 1. Movu la kursoron ĉe la komenco de la suba linio markita per --->. 2. Tajpu 2w por movi la kursoron je du vortoj antaŭen. 3. Tajpu 3e por movi la kursoron ĉe la fino de la tria vorto antaŭen. 4. Tajpu 0 (nul) por moviĝi ĉe la komenco de la linio. 5. Ripetu paŝojn 2 ĝis 3 kun malsamaj nombroj. ---> Tio estas nur linio kun vortoj, kie vi povas moviĝi. 6. Moviĝu al la leciono 2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 2.5: UZI NOMBRON POR FORVIŜI PLI ** Tajpo de nombro kun operatoro ripetas ĝin laŭfoje. ** En la kombinaĵo de la operatoro de forviŝo, kaj movo kiel menciita ĉi-supre, eblas aldoni nombron antaŭ la movo por pli forviŝi: d nombro movo 1. Movu la kursoron ĉe la unua MAJUSKLA vorto en la linio markita per --->. 2. Tajpu d2w por forviŝi la du MAJUSKLAJN vortojn 3. Ripetu paŝojn 1 ĝis 2 per malsama nombro por forviŝi la sinsekvajn MAJUSKLAJN vortojn per unu komando ---> Tiu AB CDE linio FGHI JK LMN OP de vortoj estas Q RS TUV purigita. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 2.6: OPERACII SUR LINIOJ ** Tajpu dd por forviŝi tutan linion. ** Pro la ofteco de forviŝo de tuta linio, la verkisto de Vi decidis, ke estus pli facile simple tajpi du d-ojn por forviŝi linion. 1. Movu la kursoron sur la duan linion en la suba frazo. 2. Tajpu dd por forviŝi la linion. 3. Nun moviĝu al la kvara linio. 4. Tajpu 2dd por forviŝi du liniojn. ---> 1) Rozoj estas ruĝaj, ---> 2) Ŝlimo estas amuza, ---> 3) Violoj estas bluaj, ---> 4) Mi havas aŭton, ---> 5) Horloĝoj diras kioma horo estas, ---> 6) Sukero estas dolĉa, ---> 7) Kaj tiel vi estas. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 2.7: LA KOMANDO DE MALFARO ** Premu u por malfari la lastajn komandojn, U por ripari la tutan linion. ** 1. Movu la kursoron ĉe la suba linio markita per ---> kaj metu ĝin sur la unuan eraron. 2. Tajpu x por forviŝi la unuan nedeziratan signon. 3. Nun tajpu u por malfari la lastan plenumitan komandon. 4. Ĉi-foje, riparu ĉiujn erarojn en la linio kaj ĝia originala stato. 5. Nun tajpu majusklan U por igi la linion al ĝia antaŭa stato. 6. Nun tajpu u kelkfoje por malfari la U kaj antaŭajn komandojn. 7. Nun tajpu CTRL-R (premante la CTRL klavon dum vi premas R) kelkfoje por refari la komandojn (malfari la malfarojn). ---> Koorektii la erarojn sur tiuu ĉi liniio kaj remettu illlin per malfaro. 8. Tiuj estas tre utilaj komandoj. Nun moviĝu al la leciono 2 RESUMO. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 2 RESUMO 1. Por forviŝi ekde la kursoro ĝis la sekvanta vorto, tajpu: dw 2. Por forviŝi ekde la kursoro ĝis la fino de la linio, tajpu: d$ 3. Por forviŝi tutan linion, tajpu: dd 4. Por ripeti movon, antaŭmetu nombron: 2w 5. La formato de ŝanĝa komando estas: operatoro [nombro] movo kie: operatoro - estas tio, kio farendas, kiel d por forviŝi [nombro] - estas opcia nombro por ripeti la movon movo - movas sur la teksto por operacii, kiel ekzemple w (vorto), $ (ĝis fino de linio), ktp. 6. Por moviĝi al la komenco de la linio, uzu nul: 0 7. Por malfari antaŭajn agojn, tajpu: u (minuskla u) Por malfari ĉiujn ŝanĝojn sur la linio, tajpu: U (majuskla U) Por refari la malfarojn, tajpu: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 3.1 LA KOMANDO DE METO ** Tajpu p por meti tekston forviŝitan antaŭe post la kursoro. ** 1. Movu la kursoron ĉe la unua ---> suba linio. 2. Tajpu dd por forviŝi la linion kaj konservi ĝin ene de reĝistro de Vim. 3. Movu la kursoron ĉe la linio c), SUPER kie la forviŝita linio devus esti. 4. Tajpu p por meti la linion sub la kursoron. 5. Ripetu la paŝojn 2 ĝis 4 por meti ĉiujn liniojn en la ĝusta ordo. ---> d) Ĉu ankaŭ vi povas lerni? ---> b) Violoj estas bluaj, ---> c) Inteligenteco lerneblas, ---> a) Rozoj estas ruĝaj, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 3.2 LA KOMANDO DE ANSTATAŬIGO ** Tajpu rx por anstataŭigi la signon ĉe la kursoro per x . ** 1. Movu la kursoron ĉe la unua suba linio markita per --->. 2. Movu la kursoron ĝis la unua eraro. 3. Tajpu r kaj la signon, kiu devus esti tie. 4. Ripetu paŝojn 2 kaj 3 ĝis kiam la unua linio egalas la duan. ---> Kiem tiu lanio estis tajpita, iu pramis la naĝuftajn klovojn! ---> Kiam tiu linio estis tajpita, iu premis la neĝustajn klavojn! 5. Nun moviĝu al la leciono 3.3. RIMARKO: Memoru, ke vi devus lerni per uzo, kaj ne per memorado. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 3.3 LA OPERATORO DE ŜANĜO ** Por ŝanĝi ĝis la fino de la vorto, tajpu ce . ** 1. Movu la kursoron ĉe la unua suba linio markita per --->. 2. Metu la kursoron sur la d en lduzw 3. Tajpu ce kaj la ĝustan vorton (en tiu ĉi kazo, tajpu inio ). 4. Premu kaj moviĝu al la sekvanta signo, kiu bezonas ŝanĝon. 5. Ripetu la paŝojn 3 kaj 4 ĝis kiam la unua frazo egalas la duan. ---> Tiu lduzw havas kelkajn vortojn, kiii bezas ŝanĝon per la ŝanĝooto. ---> Tiu linio havas kelkajn vortojn, kiuj bezonas ŝanĝon per la ŝanĝoperatoro. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 3.4 PLIAJ ŜANĜOJ PER c ** La operatoro de ŝanĝo uzeblas kun la sama movo kiel forviŝo. ** 1. La operatoro de ŝanĝo funkcias sammaniere kiel forviŝo. La formato estas: c [nombro] movo 2. La movoj estas samaj, kiel ekzemple w (vorto) kaj $ (fino de linio). 3. Moviĝu ĉe la unua suba linio markita per --->. 4. Movu la kursoron al la unua eraro. 5. Tajpu c$ kaj tajpu la reston de la linio kiel la dua kaj premu . ---> La fino de ĉi tiu linio bezonas helpon por igi ĝin same kiel la dua. ---> La fino de ĉi tiu linio bezonas korektojn per uzo de la komando c$ RIMARKO: Vi povas uzi la klavon Retropaŝo por korekti erarojn dum vi tajpas. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 3 RESUMO 1. Por remeti tekston, kiun vi ĵus forviŝis, tajpu p. Tio metas la forviŝitan tekston POST la kursoro (se linio estis forviŝita, ĝi iros en la linion sub la kursoro). 2. Por anstataŭigi la signon sub la kursoro, tajpu r kaj tiam la signon kion vi deziras havi tie. 3. La operatoro de ŝanĝo ebligas al vi ŝanĝi ekde la kursoro, ĝis kie la movo iras. Ekz. tajpu ce por ŝanĝi ekde la kursoro ĝis la fino de la vorto, c$ por ŝanĝi ĝis la fino de la linio. 4. La formato de ŝanĝo estas: c [nombro] movo Nun daŭrigu al la sekvanta leciono. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 4.1: POZICIO DE KURSORO KAJ STATO DE DOSIERO ** Tajpu CTRL-G por montri vian pozicion en la dosiero kaj la dosierstaton. Tajpu G por moviĝi al linio en la dosiero. ** RIMARKO: Legu la tutan lecionon antaŭ ol plenumi iun paŝon ajn!! 1. Premu la klavon Ctrl kaj premu g . Oni nomas tion CTRL-G. Mesaĝo aperos ĉe la suba parto de la paĝo kun la dosiernomo kaj la pozicio en la dosiero. Memoru la numeron de la linio por paŝo 3. RIMARKO: Vi eble vidas la pozicion de la kursoro ĉe la suba dekstra angulo de la ekrano. Tio okazas kiam la agordo 'ruler' estas ŝaltita (vidu :help 'ruler') 2. Premu G por moviĝi ĉe la subo de la dosiero. Tajpu gg por moviĝi ĉe la komenco de la dosiero. 3. Tajpu la numeron de la linio kie vi estis kaj poste G . Tio removos vin al la linio, kie vi estis kiam vi unue premis CTRL-G. 4. Se vi sentas vin komforta, plenumu paŝojn 1 ĝis 3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 4.2 LA KOMANDO DE SERĈO ** Tajpu / kaj poste frazon por serĉi la frazon. ** 1. En normala reĝimo, tajpu la / signon. Rimarku, ke ĝi kaj la kursoro aperas ĉe la suba parto de la ekrano kiel por la : komando. 2. Nun tajpu 'errarro' . Tio estas la vorto, kion vi volas serĉi. 3. Por serĉi la saman frazon denove, simple tajpu n . Por serĉi la saman frazon denove en la retrodirekto, tajpu N . 4. Por serĉi frazon en la retrodirekto, uzu ? anstataŭ / . 5. Por reiri tien, el kie vi venis, premu CTRL-O (Premu Ctrl kaj o literon o). Ripetu por pli retroiri. CTRL-I iras antaŭen. ---> "errarro" ne estas maniero por literumi eraro; errarro estas eraro. RIMARKO: Kiam la serĉo atingas la finon de la dosiero, ĝi daŭras ĉe la komenco, krom se la agordo 'wrapscan' estas malŝaltita. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 4.3 SERĈO DE KONGRUAJ KRAMPOJ ** Tajpu % por trovi kongruan ), ] aŭ } ** 1. Poziciu la kursoron sur iun (, [ aŭ { en la linio markita per --->. 2. Nun tajpu la % signon. 3. La kursoro moviĝas al la kongrua krampo. 4. Tajpu % por movi la kursoron al la alia kongrua krampo. 5. Movu la kursoron al la alia (, ), [, ], {, } kaj observu tion, kion % faras. ---> Ĉi tiu ( estas testa linio kun (-oj, [-oj, ]-oj kaj {-oj, }-oj en ĝi. )) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 4.4 LA KOMANDO DE ANSTATAŭIGO ** Tajpu :s/malnova/nova/g por anstataŭigi 'nova' per 'malnova'. ** 1. Movu la kursoron al la suba linio markita per --->. 2. Tajpu :s/laa/la . Rimarku, ke la komando ŝanĝas nur la unuan okazaĵon de "laa" en la linio. 3. Nun tajpu :s/laa/la/g . Aldono de g opcio signifas mallokan anstataŭigon en la linio. Ĝi ŝanĝas ĉiujn okazaĵojn de "laa" en la linio. ---> laa plej bona tempo por vidi florojn estas en laa printempo. 4. Por ŝanĝi ĉiujn okazaĵojn de iu ĉena signo inter du linioj, tajpu :#,#s/malnova/nova/g kie #,# estas la numeroj de linioj de la intervalo de la linioj kie la anstataŭigo okazos. Tajpu :%s/malnova/nova/g por ŝanĝi ĉiujn okazaĵojn en la tuta dosiero. Tajpu :s/malnova/nova/gc por trovi ĉiujn okazaĵojn en la tuta dosiero, kun invitilo ĉu anstataŭigi aŭ ne. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 4 RESUMO 1. CTRL-G vidigas vian pozicion en la dosiero kaj la staton de la dosiero. G movas la kursoron al la fino de la dosiero. numero G movas la kursoron al numero de tiu linio. gg movas la kursoron al la unua linio. 2. Tajpo de / kaj frazon serĉas la frazon antaŭen. Tajpo de ? kaj frazon serĉas la frazon malantaŭen. Post serĉo, tajpu n por trovi la sekvantan okazaĵon en la sama direkto aŭ N por serĉi en la mala direkto. CTRL-O movas vin al la antaŭaj pozicioj, CTRL-I al la novaj pozicioj. 3. Tajpo de % kiam la kursoro estas sur (,),[,],{ aŭ } moviĝas al ĝia kongruo. 4. Por anstataŭigi 'nova' en la unua 'malnova' en linio :s/malnova/nova Por anstataŭigi 'nova' en ĉiuj 'malnova'-oj en linio :s/malnova/nova/g Por anstataŭigi frazon inter du #-aj linioj :#,#s/malnova/nova/g Por anstataŭigi ĉiujn okazaĵojn en la dosiero :%s/malnova/nova/g Por demandi konfirmon ĉiu-foje, aldonu 'c' :%s/malnova/nova/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 5.1 KIEL PLENUMI EKSTERAN KOMANDON ** Tajpu :! sekvata de ekstera komando por plenumi la komandon. ** 1. Tajpu la konatan komandon : por pozicii la kursoron ĉe la suba parto de la ekrano. Tio ebligas tajpadon de komando en komanda linio. 2. Nun tajpu la ! (krisigno) signon. Tio ebligas al vi plenumi iun eksteran ŝelan komandon ajn. 3. Ekzemple, tajpu ls post ! kaj tajpu . Tio listigos la enhavon de la dosierujo, same kiel se vi estis en ŝela invito. Aŭ uzu :!dir se ls ne funkcias. RIMARKO: Eblas plenumi iun eksteran komandon ajn tiamaniere, ankaŭ kun argumentoj. RIMARKO: Ĉiuj : komandoj devas finiĝi per tajpo de Ekde nun, ni ne plu mencios tion. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 5.2 PLI PRI KONSERVO DE DOSIERO ** Por konservi la faritajn ŝanĝojn en la teksto, tajpu :w DOSIERNOMO. ** 1. Tajpu !dir aŭ !ls por akiri liston de via dosierujo. Vi jam scias, ke vi devas tajpi post tio. 2. Elektu dosieron, kiu ankoraŭ ne ekzistas, kiel ekzemple TESTO. 3. Nun tajpu: :w TESTO (kie TESTO estas la elektita dosiernomo) 4. Tio konservas la tutan dosieron (instruilon de Vim) kun la nomo TESTO. Por kontroli tion, tajpu :!dir aŭ :!ls denove por vidigi vian dosierujon. RIMARKO: Se vi volus eliri el Vim kaj restartigi ĝin denove per vim TESTO, la dosiero estus precize same kiel kopio de la instruilo kiam vi konservis ĝin. 5. Nun forviŝu la dosieron tajpante (MS-DOS): :!del TESTO aŭ (UNIKSO): :!rm TESTO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 5.3 APARTIGI KONSERVENDAN TESTON ** Por konservi parton de la dosiero, tajpu v movo :w DOSIERNOMO ** 1. Movu la kursoron al tiu linio. 2. Premu v kaj movu la kursoron al la kvina suba ero. Rimarku, ke la teksto emfaziĝas. 3. Premu la : signon. Ĉe la fino de la ekrano :'<,'> aperos. 4. Tajpu w TESTO , kie TESTO estas dosiernomo, kiu ankoraŭ ne ekzistas. Kontrolu, ke vi vidas :'<,'>w TESTO antaŭ premi . 5. Vim konservos la apartigitajn liniojn al la dosiero TESTO. Uzu :dir aŭ :!ls por vidigi ĝin. Ne forviŝu ĝin. Ni uzos ĝin en la sekvanta leciono. RIMARKO: Premo de v komencas Viduman apartigon. Vi povas movi la kursoron por pligrandigi aŭ malpligrandigi la apartigon. Tiam vi povas uzi operatoron por plenumi ion kun la teksto. Ekzemple, d forviŝas la tekston. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 5.4 AKIRI KAJ KUNFANDI DOSIEROJN ** Por enmeti la enhavon de dosiero, tajpu :r DOSIERNOMON ** 1. Movu la kursoron ĵus super ĉi tiu linio. RIMARKO: Post plenumo de paŝo 2, vi vidos tekston el la leciono 5.3. Tiam moviĝu SUBEN por vidi tiun lecionon denove. 2. Nun akiru vian dosieron TESTO uzante la komandon :r TESTO kie TESTO estas la nomo de la dosiero, kiun vi uzis. La dosiero, kion vi akiras, estas metita sub la linio de la kursoro. 3. Por kontroli, ĉu la dosiero akiriĝis, retromovu la kursoron kaj rimarku, ke estas nun du kopioj de la leciono 5.3, la originala kaj la versio mem de la dosiero. RIMARKO: Vi nun povas legi la eliron de ekstera komando. Ekzemple, :r !ls legas la eliron de la komando ls kaj metas ĝin sub la kursoron. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 5 RESUMO 1. :!komando plenumas eksteran komandon. Iuj utilaj ekzemploj estas: (MS-DOS) (UNIKSO) :!dir :!ls - listigas dosierujon :!del DOSIERNOMO :!rm DOSIERNOMO - forviŝas la dosieron DOSIERNOMO 2. :w DOSIERNOMO konservas la nunan dosieron de Vim al disko kun la nomo DOSIERNOMO. 3. v movo :w DOSIERNOMO konservas la Viduman apartigon de linioj en dosiero DOSIERNOMO. 4. :r DOSIERNOMO akiras la dosieron DOSIERNOMO el la disko kaj metas ĝin sub la pozicion de la kursoro. 5. :r !dir legas la eligon de la komando dir kaj metas ĝin sub la pozicion de la kursoro. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 6.1 LA KOMANDO DE MALFERMO ** Tajpu o por malfermi linion sub la kursoro kaj eniri Enmetan reĝimon. ** 1. Movu la kursoron al la suba linio markita per --->. 2. Tajpu la minusklan literon o por malfermi linion SUB la kursoro kaj eniri la Enmetan reĝimon. 3. Nun tajpu tekston kaj premu por eliri la Enmetan reĝimon. ---> Post tajpo de o la kursoro moviĝas al la malfermata linio en Enmeta reĝimo. 4. Por malfermi linion SUPER la kursoro, nur tajpu majusklan O , anstataŭ minusklan o. Provu tion per la suba linio. ---> Malfermu linion SUPER tiu tajpante O dum la kursoro estas sur tiu linio. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 6.2 LA KOMANDO DE POSTALDONO ** Tajpu a por enmeti POST la kursoro. ** 1. Movu la kursoron ĉe la komenco de la linio markita per --->. 2. Premu e ĝis kiam la kursoro estas ĉe la fino de li. 3. Tajpu a (minuskle) por aldoni tekston POST la kursoro. 4. Kompletigu la vorton same kiel la linio sub ĝi. Premu por eliri la Enmetan reĝimon. 5. Uzu e por moviĝi al la sekvanta nekompleta vorto kaj ripetu paŝojn 3 kaj 4. ---> Ĉi tiu lin ebligos vin ekz vin postal tekston al linio. ---> Ĉi tiu linio ebligos vin ekzerci vin postaldoni tekston al linio. RIMARKO: Ĉiu a, i kaj A iras al la sama Enmeta reĝimo, la nura malsamo estas tie, kie la signoj estas enmetitaj. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 6.3 ALIA MANIERO POR ANSTATAŬIGI ** Tajpu majusklan R por anstataŭigi pli ol unu signo. ** 1. Movu la kursoron al la unua suba linio markita per --->. Movu la kursoron al la komenco de la unua xxx . 2. Nun premu R kaj tajpu la nombron sub ĝi en la dua linio, por ke ĝi anstataŭigu la xxx . 3. Premu por foriri la Anstataŭigan reĝimon. Rimarku, ke la cetera parto de la linio restas neŝanĝata. 4. Ripetu la paŝojn por anstataŭigi la restantajn xxx. ---> Aldono de 123 al xxx donas al vi xxx. ---> Aldono de 123 al 456 donas al vi 579. RIMARKO: Anstataŭiga reĝimo estas same kiel Enmeta reĝimo, sed ĉiu signo tajpita forviŝas ekzistan signon. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 6.4 KOPII KAJ ALGLUI TEKSTON ** Uzu la y operatoron por kopii tekston, kaj p por alglui ĝin ** 1. Iru al la linio markita per ---> sube kaj poziciu la kursoron post "a)". 2. Komencu la Viduman reĝimon per v kaj movu la kursoron ĵus antaŭ "unua". 3. Tajpu y por kopii la emfazitan tekston. 4. Movu la kursoron ĉe la fino de la linio: j$ 5. Tajpu p por alglui la tekston. Tiam tajpu: a dua . 6. Uzu Viduman reĝimon por apartigi " ero.", kopiu ĝin per y , moviĝu ĉe la fino de la sekvanta linio per j$ kaj algluu la tekston tie per p . ---> a) tio estas la unua ero. b) RIMARKO: vi povas ankaŭ uzi y kiel operatoro; yw kopias unu vorton. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 6.5 AGORDI OPCION ** Agordu opcion por ke serĉo aŭ anstataŭigo ignoru usklecon ** 1. Serĉu 'ignori' per tajpo de /ignori Ripetu plurfoje premante n . 2. Ŝaltu la opcion 'ic' (ignori usklecon) per: :set ic 3. Nun serĉu 'ignori' denove premante n Rimarku, ke Ignori kaj IGNORI estas nun troveblas. 4. Ŝaltu la opciojn 'hlsearch' kaj 'incsearch': :set hls is 5. Nun retajpu la serĉan komandon kaj vidu kio okazas: /ignore 6. Por malŝalti ignoron de uskleco: :set noic RIMARKO: Por forigi emfazon de kongruo, tajpu: :nohlsearch RIMARKO: Se vi deziras ignori usklecon por nur unu serĉa komando, uzu \c en la frazo: /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 6 RESUMO 1. Tajpu o por malfermi linion SUB la kursoro kaj eki en Enmeta reĝimo. 1. Tajpu O por malfermi linion SUPER la kursoro. 2. Tajpu a por enmeti tekston POST la kursoro. Tajpu A por enmeti tekston post la fino de la linio. 3. La e komando movas la kursoron al la fino de vorto. 4. la y operatoro kopias tekston, p algluas ĝin. 5. Tajpo de majuskla R eniras la Anstataŭigan reĝimon ĝis kiam estas premita. 6. Tajpo de ":set xxx" ŝaltas la opcion "xxx". Iuj opcioj estas: 'ic' 'ignorecase' ignori usklecon dum serĉo 'is' 'incsearch' montru partan kongruon dum serĉo 'hls' 'hlsearch' emfazas ĉiujn kongruajn frazojn Vi povas uzi aŭ la longan, aŭ la mallongan nomon de opcio. 7. Antaŭaldonu "no" por malŝalti la opcion: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 7.1 AKIRI HELPON ** Uzu la helpan sistemon ** Vim havas ampleksan helpan sistemon. Por komenciĝi, provu unu el la tiuj tri: - premu la klavon (se vi havas ĝin) - premu la klavon (se vi havas ĝin) - tajpu :help Legu la tekston en la helpfenestro por trovi kiel helpo funkcias. Tajpu CTRL-W CTRL-W por salti de unu fenestro al la alia. Tajpu :q por fermi la helpan fenestron. Vi povas trovi helpon pri io ajn aldonante argumenton al la komando ":help". Provu tiujn (ne forgesu premi ): :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 7.2 KREI STARTAN SKRIPTON ** Ebligu kapablojn de Vim ** Vim havas multe pli da kapabloj ol Vi, sed la plej multaj estas defaŭlte malŝaltitaj. Por ekuzi la kapablojn, vi devas krei dosieron "vimrc". 1. Ekredaktu la dosieron "vimrc". Tio dependas de via sistemo: :e ~/.vimrc por Unikso :e $VIM/_vimrc por MS-Vindozo 2. Nun legu la enhavon de la ekzempla "vimrc" :r $VIMRUNTIME/vimrc_example.vim 3. Konservu la dosieron per: :w La sekvantan fojon, kiam vi lanĉas Vim, ĝi uzos sintaksan emfazon. Vi povas aldoni ĉiujn viajn preferatajn agordojn al tiu dosiero "vimrc". Por pli da informoj, tajpu :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 7.3 KOMPLETIGO ** Kompletigo de komanda linio per CTRL-D kaj ** 1. Certigu ke Vim estas en kongrua reĝimo: :set nocp 2. Rigardu tiujn dosierojn, kiuj ekzistas en la dosierujo: :!ls aŭ :!dir 3. Tajpu la komencon de komando: :e 4. Premu CTRL-D kaj Vim montros liston de komandoj, kiuj komencas per "e". 5. Premu kaj Vim kompletigos la nomon de la komando al ":edit". 6. Nun aldonu spaceton kaj la komencon de ekzistanta nomo: :edit DOSI 7. Premu . Vim kompletigos la nomon (se ĝi estas unika) RIMARKO: Kompletigo funkcias por multaj komandoj. Nur provu premi CTRL-D kaj . Estas aparte utila por :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 7 RESUMO 1. Tajpu :help aŭ premu por malfermi helpan fenestron. 2. Tajpu :help kmd por trovi helpon pri kmd. 3. Tajpu CTRL-W CTRL-W por salti al alia fenestro. 4. Tajpu :q to fermi la helpan fenestron. 5. Kreu komencan skripton vimrc por konservi viajn agordojn. 6. Kiam vi tajpas : komandon, premu CTRL-D por vidi ĉiujn kompleteblojn. Premu por uzi unu kompletigon. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tio konkludas la instruilon de Vim. Ĝi celis doni mallongan superrigardon de la redaktilo Vim, nur tion kio sufiĉas por ebligi al vi facilan uzon de la redaktilo. Estas nepre nekompleta, ĉar Vim havas multajn multajn pliajn komandojn. Legu la manlibron: ":help user-manual". Tiu instruilo estis verkita de Michael C. Pierce kaj Robert K. Ware, el la Koloradia Lernejo de Minejoj (Colorado School of Mines) uzante ideojn provizitajn de Charles Smith el la Stata Universitato de Koloradio (Colorado State University) Retpoŝto: bware@mines.colorado.edu. Modifita por Vim de Bram Moolenaar. Esperantigita fare de Dominique Pellé, 2008-04-01 Retpoŝto: dominique.pelle@gmail.com Lasta ŝanĝo: 2011-11-27 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim-7.4.1689/runtime/tutor/tutor.es000066400000000000000000000657141267703067000171600ustar00rootroot00000000000000=============================================================================== = B i e n v e n i d o a l t u t o r d e V I M - Versin 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 diseado para describir suficientes mandatos para que usted sea capaz de aprender fcilmente a usar Vim como un editor de propsito general. El tiempo necesario para completar el tutor es aproximadamente de 25-30 minutos, dependiendo de cuanto tiempo se dedique a la experimentacin. Los mandatos de estas lecciones modificarn 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 ensear con la prctica. Esto significa que es necesario ejecutar los mandatos para aprenderlos adecuadamente. Si nicamente se lee el texto, se olvidarn los mandatos. Ahora, asegrese de que la tecla de bloqueo de maysculas no est activada y pulse la tecla j lo suficiente para mover el cursor de forma que la Leccin 1.1 ocupe completamente la pantalla. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leccin 1.1: MOVIMIENTOS DEL CURSOR ** Para mover el cursor, pulse las teclas h,j,k,l de la forma que se indica. ** ^ k Indicacin: 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 cmodo con ello. 2. Mantenga pulsada la tecla j hasta que se repita automgicamente. ---> Ahora ya sabe como llegar a la leccin siguiente. 3. Utilizando la tecla abajo, vaya a la Leccin 1.2. Nota: Si alguna vez no est seguro sobre algo que ha tecleado, pulse para situarse en modo Normal. Luego vuelva a teclear la orden que deseaba. Nota: Las teclas de movimiento del cursor tambin funcionan. Pero usando hjkl podr moverse mucho ms rpido una vez que se acostumbre a ello. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leccin 1.2: ENTRANDO Y SALIENDO DE VIM NOTA: Antes de ejecutar alguno de los pasos siguientes lea primero la leccin entera!! 1. Pulse la tecla (para asegurarse de que est en modo Normal). 2. Escriba: :q! ---> Esto provoca la salida del editor SIN guardar ningn cambio que se haya hecho. Si quiere guardar los cambios y salir escriba: :wq 3. Cuando vea el smbolo del sistema, escriba el mandato que le trajo a este tutor. ste puede haber sido: vimtutor Normalmente se usara: vim tutor ---> '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. Despus mueva el cursor hasta la Leccin 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leccin 1.3: EDICIN DE TEXTO - BORRADO ** Estando en modo Normal pulse x para borrar el carcter sobre el cursor. **j 1. Mueva el cursor a la lnea de abajo sealada con --->. 2. Para corregir los errores, mueva el cursor hasta que est bajo el carcter que va aser borrado. 3. Pulse la tecla x para borrar el carcter 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 lnea esta correcta, contine con la Leccin 1.4. NOTA: A medida que vaya avanzando en este tutor no intente memorizar, aprenda practicando. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leccin 1.4: EDICIN DE TEXTO - INSERCIN ** Estando en modo Normal pulse i para insertar texto. ** 1. Mueva el cursor a la primera lnea de abajo sealada con --->. 2. Para que la primera lnea se igual a la segunda mueva el cursor bajo el primer carcter que sigue al texto que ha de ser insertado. 3. Pulse i y escriba los caracteres a aadir. 4. A medida que sea corregido cada error pulse 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 lnea. 5. Cuando se sienta cmodo insertando texto pase al resumen que esta ms abajo. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RESUMEN DE LA LECCIN 1 1. El cursor se mueve utilizando las teclas de las flechas o las teclas hjkl. h (izquierda) j (abajo) k (arriba) l (derecha) 2. Para acceder a Vim (desde el smbolo del sistema %) escriba: vim FILENAME 3. Para salir de Vim escriba: :q! para eliminar todos los cambios. 4. Para borrar un carcter sobre el cursor en modo Normal pulse: x 5. Para insertar texto en la posicin del cursor estando en modo Normal: pulse i escriba el texto pulse NOTA: Pulsando se vuelve al modo Normal o cancela un mandato no deseado o incompleto. Ahora contine con la Leccin 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leccin 2.1: MANDATOS PARA BORRAR ** Escriba dw para borrar hasta el final de una palabra ** 1. Pulse para asegurarse de que est en el modo Normal. 2. Mueva el cursor a la lnea de abajo sealada 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 aparecern en la ltima lnea de la pantalla cuando las escriba. Si escribe algo equivocado pulse y comience de nuevo. ---> Hay algunas palabras psalo bien que no pertenecen papel a esta frase. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leccin 2.2: MS MANDATOS PARA BORRAR ** Escriba d$ para borrar hasta el final de la lnea. ** 1. Pulse para asegurarse de que est en el modo Normal. 2. Mueva el cursor a la lnea de abajo sealada con --->. 3. Mueva el cursor al final de la lnea correcta (DESPUS del primer . ). 4. Escriba d$ para borrar hasta el final de la lnea. ---> Alguien ha escrito el final de esta lnea dos veces. esta lnea dos veces. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leccin 2.3: SOBRE MANDATOS Y OBJETOS El formato del mandato de borrar d es como sigue: [nmero] d objeto O d [nmero] objeto donde: nmero - es cuntas 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 lnea. NOTE: Para los aventureros, pulsando slo el objeto estando en modo Normal sin un mandato mover el cursor como se especifica en la lista de objetos. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leccin 2.4: UNA EXCEPCIN AL 'MANDATO-OBJETO' ** Escriba dd para borrar una lnea entera. ** Debido a la frecuencia con que se borran lneas enteras, los diseadores de Vim decidieron que sera ms fcil el escribir simplemente dos des en una fila para borrar una lnea. 1. Mueva el cursor a la segunda lnea de la lista de abajo. 2. Escriba dd para borrar la lnea. 3. Muvase ahora a la cuarta lnea. 4. Escriba 2dd (recuerde nmero-mandato-objeto) para borrar las dos lneas. 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. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leccin 2.5: EL MANDATO DESHACER ** Pulse u para deshacer los ltimos mandatos, U para deshacer una lnea entera. ** 1. Mueva el cursor a la lnea de abajo sealada con ---> y sitelo bajo el primer error. 2. Pulse x para borrar el primer carter errneo. 3. Pulse ahora u para deshacer el ltimo mandato ejecutado. 4. Ahora corrija todos los errores de la lnea usando el mandato x. 5. Pulse ahora U mayscula para devolver la lnea 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 lnea y vuuelva a ponerlos coon deshacer. 8. Estos mandatos son muy tiles. Ahora pase al resumen de la Leccin 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RESUMEN DE LA LECCIN 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 lnea pulse: d$ 3. Para borrar una lnea enter pulse: dd 4. El formato de un mandato en modo Normal es: [nmero] mandato objeto O mandato [nmero] objeto donde: nmero - es cuntas 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 lnea), etc. 5. Para deshacer acciones previas pulse: u (u minscula) Para deshacer todos los cambios de una lnea pulse: U (U mayscula) Para deshacer lo deshecho pulse: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leccin 3.1: EL MANDATO PUT (poner) ** Pulse p para poner lo ltimo que ha borrado despus del cursor. ** 1. Mueva el cursor al final de la lista de abajo. 2. Escriba dd para borrar la lnea y almacenarla en el buffer de Vim. 3. Mueva el cursor a la lnea que debe quedar por debajo de la lnea a mover. 4. Estando en mod Normal, pulse p para restituir la lnea borrada. 5. Repita los pasos 2 a 4 para poner todas las lneas en el orden correcto. d) Puedes aprenderla tu? b) Las violetas son azules, c) La inteligencia se aprende, a) Las rosas son rojas, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leccin 3.2: EL MANDATO REPLACE (remplazar) ** Pulse r y un carcter para sustituir el carcter sobre el cursor. ** 1. Mueva el cursor a la primera lnea de abajo sealada con --->. 2. Mueva el cursor para situarlo bajo el primer error. 3. Pulse r y el carcter que debe sustituir al errneo. 4. Repita los pasos 2 y 3 hasta que la primera lnea est corregida. ---> Cuendo esta lnea fue rscrita alguien pulso algunas teclas equibocadas! ---> Cuando esta lnea fue escrita alguien puls algunas teclas equivocadas! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leccin 3.3: EL MANDATO CHANGE (cambiar) ** Para cambiar parte de una palabra o toda ella escriba cw . ** 1. Mueva el cursor a la primera lnea de abajo sealada con --->. 2. Site el cursor en la u de lubrs. 3. Escriba cw y corrija la palabra (en este caso, escriba 'nea'). 4. Pulse y mueva el cursor al error siguiente (el primer carcter 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 lnea tiene unas pocas palabras que corregir usando el mandato change. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leccin 3.4: MS 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: [nmero] c objeto O c [nmero] objeto 2. Los objetos son tambim los mismos, tales como w (palabra), $ (fin de la lnea), etc. 3. Mueva el cursor a la primera lnea de abajo sealada con --->. 4. Mueva el cursor al primer error. 5. Escriba c$ para hacer que el resto de la lnea sea como la segunda y pulse . ---> El final de esta lnea necesita alguna ayuda para que sea como la segunda. ---> El final de esta lnea necesita ser corregido usando el mandato c$. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RESUMEN DE LA LECCIN 3 1. Para sustituir texto que ha sido borrado, pulse p . Esto Pone el texto borrado DESPUS del cursor (si lo que se ha borrado es una lnea se situar sobre la lnea que est sobre el cursor). 2. Para sustituir el carcter bajo el cursor, pulse r y luego el carcter que sustituir al original. 3. El mandato change le permite cambiar el objeto especificado desde la posicin 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 lnea. 4. El formato para change es: [nmero] c objeto O c [nmero] objeto Pase ahora a la leccin siguiente. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leccin 4.1: SITUACIN EN EL FICHERO Y SU ESTADO ** Pulse CTRL-g para mostrar su situacin en el fichero y su estado. Pulse MAYU-G para moverse a una determinada lnea del fichero. ** Nota: Lea esta leccin entera antes de ejecutar alguno de los pasos!! 1. Mantenga pulsada la tecla Ctrl y pulse g . Aparece una lnea de estado al final de la pantalla con el nombre del fichero y la lnea en la que est situado. Recuerde el nmero de la lnea para el Paso 3. 2. Pulse Mayu-G para ir al final del fichero. 3. Escriba el nmero de la lnea en la que estaba y despes Mayu-G. Esto le volver a la lnea en la que estaba cuando puls Ctrl-g. (Cuando escriba los nmeros NO se mostrarn en la pantalla). 4. Si se siente confiado en poder hacer esto ejecute los pasos 1 a 3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leccin 4.2: EL MANDATO SEARCH (buscar) ** Escriba / seguido de una frase para buscar la frase. ** 1. En modo Normal pulse el carcter / . Fjese que tanto el carcter / como el cursor aparecen en la ltima lnea de la pantalla, lo mismo que el mandato : . 2. Escriba ahora errroor . Esta es la palabra que quiere buscar. 3. Para repetir la bsqueda, simplemente pulse n . Para busacar la misma frase en la direccin opuesta, pulse Mayu-N . 4. Si quiere buscar una frase en la direccin opuesta (hacia arriba), utilice el mandato ? en lugar de / . ---> Cuando la bsqueda alcanza el final del fichero continuar desde el principio. errroor no es la forma de deletrear error; errroor es un error. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leccin 4.3: BSQUEDA PARA COMPROBAR PARNTESIS ** Pulse % para encontrar el parntesis correspondiente a ),] o } . ** 1. Site el cursor en cualquiera de los caracteres ), ] o } en la lnea de abajo sealada con --->. 2. Pulse ahora el carcter % . 3. El cursor debera situarse en el parntesis (, corchete [ o llave { correspondiente. 4. Pulse % para mover de nuevo el cursor al parntesis, corchete o llave correspondiente. ---> Esto ( es una lnea de prueba con (, [, ], {, y } en ella. )). Nota: Esto es muy til en la deteccin de errores en un programa con parntesis, corchetes o llaves disparejos. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leccin 4.4: UNA FORMA DE CAMBIAR ERRORES ** Escriba :s/viejo/nuevo/g para sustituir 'viejo' por 'nuevo'. ** 1. Mueva el cursor a la lnea de abajo sealada con --->. 2. Escriba :s/laas/las/ . Tenga en cuenta que este mandato cambia slo la primera aparicin en la lnea de la expresin a cambiar. ---> Laas mejores pocas para ver laas flores son laas primaveras. 4. Para cambiar todas las apariciones de una expresin ente dos lneas escriba :#,#s/viejo/nuevo/g donde #,# son los nmeros de las dos lneas. Escriba :%s/viejo/nuevo/g para hacer los cambios en todo el fichero. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RESUMEN DE LA LECCIN 4 1. Ctrl-g muestra la posicin del cursor en el fichero y su estado. Mayu-G mueve el cursor al final del fichero. Un nmero de lnea sewguido de Mayu-G mueve el cursor a la lnea con ese nmero. 2. Pulsando / seguido de una frase busca la frase hacia ADELANTE. Pulsando ? seguido de una frase busca la frase hacia ATRS. Despus de una bsqueda pulse n para encontrar la aparicin siguiente en la misma direccin. 3. Pulsando % cuando el cursor esta sobre (,), [,], { o } localiza la pareja correspondiente. 4. Para cambiar viejo por nuevo en una lnea pulse :s/viejo/nuevo Para cambiar todos los viejo por nuevo en una lnea pulse :s/viejo/nuevo/g Para cambiar frases entre dos nmeros de lneas pulse :#,#s/viejo/nuevo/g Para cambiar viejo por nuevo en todo el fichero pulse :%s/viejo/nuevo/g Para pedir confirmacin en cada caso aada 'c' :%s/viejo/nuevo/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leccin 5.1: CMO 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 carcter ! (signo de admiracin). Esto le permitir ejecutar cualquier mandato del sistema. 3. Como ejemplo escriba ls despus del ! y luego pulse . Esto le mostrar una lista de su directorio, igual que si estuviera en el smbolo 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 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leccin 5.2: MS 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 despus de ello. 2. Elija un nombre de fichero que todava no exista, como TEST. 3. Ahora escriba :w TEST (donde TEST es el nombre de fichero elegido). 4. Esta accin 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 sera una copia exacta del tutor cuando lo ha guardado. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leccin 5.3: UN MANDATO DE ESCRITURA SELECTIVO ** Para guardar parte del fuchero escriba :#,# NOMBRE_DEL_FICHERO ** 1. Escriba de nuevo, una vez ms, :!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 nmero de la lnea correspondiente. RECUERDE ESTE NMERO! 3. Ahora mueva el cursor a la ltima lnea de la pantalla y pulse Ctrl-g de nuevo. RECUERDE TAMBIN ESTE NMERO! 4. Para guardar SOLAMENTE una parte de un fichero, escriba :#,# w TEST donde #,# son los nmeros que usted ha recordado (primera lnea, ltima lnea) y TEST es su nombre de dichero. 5. De nuevo, vea que el fichero esta ah con :!dir pero NO lo borre. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leccin 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: Despus de ejecutar el paso 3 se ver la Leccin 5.3. Luego muvase hacia ABAJO para ver esta leccin 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 sita a partir de la posicin del cursor. 4. Para verificar que el fichero ha sido recuperado, mueva el cursor hacia arriba y vea que hay dos copias de la Leccin 5.3, la original y la versin del fichero. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RESUMEN DE LA LECCIN 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 lneas # 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 posicin del cursor. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leccin 6.1: EL MANDATO OPEN (abrir) ** Pulse o para abrir una lnea debajo del cursor y situarle en modo Insert ** 1. Mueva el cursor a la lnea de abajo sealada con --->. 2. Pulse o (minscula) para abrir una lnea por DEBAJO del cursor y situarle en modo Insert. 3. Ahora copie la lnea sealada con ---> y pulse para salir del modo Insert. ---> Luego de pulsar o el cursor se sita en la lnea abierta en modo Insert. 4. Para abrir una lnea por encima del cursor, simplemente pulse una O mayscula, en lugar de una o minscula. Pruebe este en la lnea siguiente. Abra una lnea sobre sta pulsando Mayu-O cuando el curso est en esta lnea. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leccin 6.2: EL MANDATO APPEND (aadir) ** Pulse a para insertar texto DESPUS del cursor. ** 1. Mueva el cursor al final de la primera lnea de abajo sealada con ---> pulsando $ en modo Normal. 2. Escriba una a (minscula) para aadir texto DESPUS del carcter que est sobre el cursor. (A mayscula aade texto al final de la lnea). Nota: Esto evita el pulsar i , el ltimo carcter, el texto a insertar, , cursor a la derecha y, finalmente, x , slo para aadir algo al final de una lnea! 3. Complete ahora la primera lnea. Ntese que append es exactamente lo mismo que modo Insert, excepto por el lugar donde se inserta el texto. ---> Esta lnea le permitir praticar ---> Esta lnea le permitir praticar el aadido de texto al final de una lnea. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leccin 6.3: OTRA VERSIN DE REPLACE (remplazar) ** Pulse una R mayscula para sustituir ms de un carcter. ** 1. Mueva el cursor a la primera lnea de abajo sealada con --->. 2. Site el cursor al comienzo de la primera palabra que sea diferente de las de la segunda lnea marcada con ---> (la palabra 'anterior'). 3. Ahora pulse R y sustituya el resto del texto de la primera lnea escribiendo sobre el viejo texto para que la primera lnea sea igual que la primera. ---> Para hacer que esta lnea sea igual que la anterior use las teclas. ---> Para hacer que esta lnea sea igual que la siguiente escriba R y el texto. 4. Ntese que cuando pulse para salir, el texto no alterado permanece. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leccin 6.4: FIJAR OPCIONES ** Fijar una opcin de forma que una bsqueda o sustitucin ignore la caja ** (Para el concepto de caja de una letra, vase la nota al final del fichero) 1. Busque 'ignorar' introduciendo: /ignorar Repita varias veces la bsque pulsando la tecla n 2. Fije la opcin 'ic' (Ignorar la caja de la letra) escribiendo: :set ic 3. Ahora busque 'ignorar' de nuevo pulsando n Repita la bsqueda varias veces ms pulsando la tecla n 4. Fije las opciones 'hlsearch' y 'insearch': :set hls is 5. Ahora introduzca la orden de bsqueda otra vez, y vea qu pasa: /ignore ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RESUMEN DE LA LECCIN 6 1. Pulsando o abre una lnea por DEBAJO del cursor y sita el cursor en la lnea abierta en modo Insert. Pulsando una O mayscula se abre una lnea SOBRE la que est el cursor. 2. Pulse una a para insertar texto DESPUS del carcter sobre el cursor. Pulsando una A mayscula aade automticamente texto al final de la lnea. 3. Pulsando una R mayscula se entra en modo Replace hasta que, para salir, se pulse . 4. Escribiendo :set xxx fija la opcin xxx ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leccin 7: MANDATOS PARA LA AYUDA EN LNEA ** Utilice el sistema de ayuda en lnea ** Vim dispone de un sistema de ayuda en lnea. Para activarlo, pruebe una de estas tres formas: - pulse la tecla (si dispone de ella) - pulse la tecla (si dispone de ella) - escriba :help Escriba :q para cerrar la ventana de ayuda. Puede encontrar ayuda en casi cualquier tema aadiendo un argumento al mandato :help mandato. Pruebe stos: :help w :help c_ :help insert-index ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Aqu concluye el tutor de Vim. Est pensado para dar una visin breve del editor Vim, lo suficiente para permitirle usar el editor de forma bastante sencilla. Est muy lejos de estar completo pues Vim tiene muchsimos ms 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 edicin incluye tambin informacin 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 ingls por: Eduardo F. Amatria Correo electrnico: eferna1@platea.pntic.mec.es ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim-7.4.1689/runtime/tutor/tutor.es.utf-8000066400000000000000000000666111267703067000201170ustar00rootroot00000000000000=============================================================================== = 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 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 (para asegurarse de que está en modo Normal). 2. Escriba: :q! ---> Esto provoca la salida del editor SIN guardar ningún cambio que se haya hecho. Si quiere guardar los cambios y salir escriba: :wq 3. Cuando vea el símbolo del sistema, escriba el mandato que le trajo a este tutor. Éste puede haber sido: vimtutor Normalmente se usaría: vim tutor ---> '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 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 utilizando 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: vim FILENAME 3. Para salir de Vim escriba: :q! 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 NOTA: Pulsando 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 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 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 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 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 . ---> 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 . 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/ . 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 . 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 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 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 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, , 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 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 . 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 (si dispone de ella) - pulse la tecla (si dispone de ella) - escriba :help Escriba :q 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 :help c_ :help insert-index ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim-7.4.1689/runtime/tutor/tutor.fr000066400000000000000000001132311267703067000171440ustar00rootroot00000000000000=============================================================================== = B i e n v e n u e dans l e T u t o r i e l de V I M - Version 1.7 = =============================================================================== Vim est un diteur trs puissant qui a trop de commandes pour pouvoir toutes les expliquer dans un cours comme celui-ci, qui est conu pour en dcrire 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 exprimenter. ATTENTION : Les commandes utilises dans les leons modifieront le texte. Faites une copie de ce fichier afin de vous entraner dessus (si vous avez lanc "vimtutor" ceci est dj une copie). Il est important de garder en tte que ce cours est conu pour apprendre par la pratique. Cela signifie que vous devez excuter les commandes pour les apprendre correctement. Si vous vous contentez de lire le texte, vous oublierez les commandes ! Maintenant, vrifiez que votre clavier n'est PAS verrouill en majuscules, et appuyez la touche j le nombre de fois suffisant pour que la Leon 1.1 remplisse compltement l'cran. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leon 1.1 : DPLACEMENT DU CURSEUR ** Pour dplacer le curseur, appuyez les touches h,j,k,l comme indiqu. ** ^ k Astuce : La touche h est gauche et dplace gauche. < h l > La touche l est droite et dplace droite. j La touche j ressemble une flche vers le bas. v 1. Dplacez le curseur sur l'cran jusqu' vous sentir l'aise. 2. Maintenez la touche Bas (j) enfonce jusqu' ce qu'elle se rpte. Maintenant vous tes capable de vous dplacer jusqu' la leon suivante. 3. En utilisant la touche Bas, allez la Leon 1.2. NOTE : Si jamais vous doutez de ce que vous venez de taper, appuyez pour revenir en mode Normal. Puis retapez la commande que vous vouliez. NOTE : Les touches flches devraient galement fonctionner. Mais en utilisant hjkl vous pourrez vous dplacer beaucoup plus rapidement, une fois que vous aurez pris l'habitude. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leon 1.2 : SORTIR DE VIM !! NOTE : Avant d'effectuer les tapes ci-dessous, lisez toute cette leon !! 1. Appuyez la touche (pour tre sr d'tre en mode Normal). 2. Tapez : :q! Ceci quitte l'diteur SANS enregistrer les changements que vous avez faits. 3. Lorsque l'invite du shell vous sera prsente, tapez la commande qui vous a men dans ce tutoriel. Cela pourrait tre : vimtutor 4. Si vous avez mmoris ces tapes et tes confiant, effectuez les tapes 1 3 pour sortir puis rentrer dans l'diteur. NOTE : :q! annule tous les changements que vous avez faits. Dans quelques leons, vous apprendrez enregistrer les changements. 5. Dplacez le curseur la Leon 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leon 1.3 : DITION DE TEXTE - EFFACEMENT ** Appuyez x pour effacer le caractre sous le curseur. ** 1. Dplacez le curseur sur la ligne marque ---> ci-dessous. 2. Pour corriger les erreurs, dplacez le curseur jusqu' ce qu'il soit sur un caractre effacer. 3. Appuyez la touche x pour effacer le caractre redondant. 4. Rptez 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 Leon 1.4. NOTE : En avanant dans ce cours, n'essayez pas de mmoriser, apprenez par la pratique. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leon 1.4 : DITION DE TEXTE - INSERTION ** Appuyez i pour insrer du texte. ** 1. Dplacez le curseur sur la premire ligne marque ---> ci-dessous. 2. Pour rendre la premire ligne identique la seconde, mettez le curseur sur le premier caractre APRS l'endroit o insrer le texte. 3. Appuyez i et tapez les caractres qui manquent. 4. Une fois qu'une erreur est corrige, appuyez pour revenir en mode Normal. Rptez les tapes 2 4 pour corriger la phrase. ---> Il mnqe caractres cette . ---> Il manque des caractres dans cette ligne. 5. Une fois que vous tes l'aise avec l'insertion de texte, allez la Leon 1.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leon 1.5 : DITION DE TEXTE - AJOUTER ** Appuyez A pour ajouter du text. ** 1. Dplacez le curseur sur la premire ligne ci-dessous marque --->. Peu importe sur quel caractre se trouve le curseur sur cette ligne. 2. Appuyez A et tapez les ajouts ncessaires. 3. Quand le texte a t ajout, appuyez pour revenir en mode Normal. 4. Dplacez le curseur sur la seconde ligne marque ---> et rptez les tapes 2 et 3 pour corriger la phrase. ---> Il manque du texte partir de cet Il manque du texte partir de cette ligne. ---> Il manque aussi du te Il manque aussi du texte ici. 5. Quand vous vous sentez suffisamment l'aise pour ajouter du texte, allez la Leon 1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leon 1.6 : DITER UN FICHIER ** Utilisez :wq pour enregistrer un fichier et sortir. ** !! NOTE : Lisez toute la leon avant d'excuter les instructions ci-dessous !! 1. Sortez de ce tutoriel comme vous l'avez fait dans la Leon 1.2 : :q! Ou, si vous avez accs un autre terminal, excutez y les actions qui suivent. 2. l'invite du shell, tapez cette commande : vim tutor 'vim' est la commande pour dmarrer l'diteur Vim, 'tutor' est le nom du fichier que vous souhaitez diter. Utilisez un fichier qui peut tre modifi. 3. Insrez et effacez du texte comme vous l'avez appris dans les leons prcdentes. 4. Enregistrez le fichier avec les changements et sortez de Vim avec : :wq 5. Si vous avez quitt vimtutor l'tape 1, recommencez vimtutor et dplacez-vous en bas vers le rsum suivant. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RSUM DE LA LEON 1 1. Le curseur se dplace avec les touches flches ou les touches hjkl. h (gauche) j (bas) k (haut) l (droite) 2. Pour dmarrer Vim l'invite du shell tapez : vim FICHIER 3. Pour quitter Vim tapez : :q! pour perdre tous les changements. OU tapez : :wq pour enregistrer les changements. 4. Pour effacer un caractre sous le curseur tapez : x 5. Pour insrer ou ajouter du texte tapez : i tapez le texte insrer avant le curseur A tapez le texte ajouter aprs le curseur NOTE : Appuyer vous place en mode Normal ou annule une commande partiellement tape dont vous ne voulez plus. Passez maintenant la leon 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leon 2.1 : COMMANDES D'EFFACEMENT ** Tapez dw pour effacer un mot. ** 1. Appuyez pour tre sr d'tre en mode Normal. 2. Dplacez le curseur sur la ligne marque ---> ci-dessous. 3. Placez le curseur sur le dbut d'un mot qui a besoin d'tre effac. 4. Tapez dw pour faire disparatre ce mot. NOTE : La lettre d apparatra sur la dernire ligne de l'cran lors de votre frappe. Vim attend que vous tapiez w . Si vous voyez un autre caractre que d vous avez tap autre chose ; appuyez et recommencez. ---> Il y a quelques drle mots qui n'ont rien faire papier sur cette ligne. 5. Rptez les tapes 3 et 4 jusqu' ce que la phrase soit correcte et allez la Leon 2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leon 2.2 : PLUS DE COMMANDES D'EFFACEMENTS ** Tapez d$ pour effacer jusqu' la fin de la ligne. ** 1. Appuyez pour tre sr d'tre en mode Normal. 2. Dplacez le curseur sur la ligne marque ---> ci-dessous. 3. Dplacez le curseur jusqu' la fin de la ligne correcte (APRS 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 Leon 2.3 pour comprendre ce qui se passe. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leon 2.3 : PROPOS DES OPRATEURS ET DES MOUVEMENTS Plusieurs commandes qui changent le texte sont constitues d'un oprateur et d'un mouvement. Le format pour une commande d'effacement avec l'oprateur d d'effacement est le suivant : d mouvement O : d - est l'oprateur d'effacement mouvement - est le mouvement sur lequel agit l'oprateur (lists ci-dessous) Une courte liste de mouvements : w - jusqu'au dbut du prochain mot, en EXCLUANT son premier caractre. e - jusqu' la fin du mot courant, en EXCLUANT son dernier caractre. $ - jusqu' la fin de la ligne, en INCLUANT son dernier caractre. Ainsi, taper de va effacer depuis le curseur jusqu' la fin du mot. NOTE : Le seul appui d'un mouvement en mode Normal, sans commande, dplace le curseur comme indiqu. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leon 2.4 : UTILISER UN QUANTIFICATEUR AVEC UN MOUVEMENT ** Taper un nombre avant un mouvement le rpte autant de fois. ** 1. Dplacez le curseur au dbut de la ligne marque ---> ci-dessous. 2. Tapez 2w pour dplacer le curseur de 2 mots vers l'avant. 3. Tapez 3e pour dplacer le curseur la fin du troisime mot vers l'avant. 4. Tapez 0 (zro) pour dplacer au dbut de la ligne. 5. Rptez les tapes 2 et 3 avec des quantificateurs diffrents. ---> Ceci est juste une ligne avec des mots o vous pouvez vous dplacer. 6. Dplacez-vous la Leon 2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leon 2.5 : UTILISER UN QUANTIFICATEUR POUR EFFACER PLUS ** Taper un nombre avec un oprateur le rpte autant de fois. ** Outre la combinaison de l'oprateur d'effacement avec un dplacement mentionn ci-dessus, vous pouvez insrer un nombre (quantificateur) pour effacer encore plus : d nombre dplacement 1. Dplacez le curseur vers le premier mot en MAJUSCULES dans la ligne marque --->. 2. Tapez d2w pour effacer les deux mots en MAJUSCULES. 3. Rptez les tapes 1 et 2 avec des quantificateurs diffrents pour effacer les mots suivants en MAJUSCULES l'aide d'une commande. ---> Cette ABC DE ligne FGHI JK LMN OP de mots est Q RS TUV nettoye. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leon 2.6 : OPREZ SUR DES LIGNES ** Tapez dd pour effacer une ligne complte. ** Vu le nombre de fois o l'on efface des lignes compltes, les concepteurs de Vi ont dcid qu'il serait plus facile de taper simplement deux d 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 quatrime ligne. 4. Tapez 2dd pour effacer deux lignes. ---> 1) Les roses sont rouges, ---> 2) La boue c'est drle, ---> 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. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leon 2.7 : L'ANNULATION ** Tapez u pour annuler les dernires commandes. ** ** Tapez U pour rcuprer toute une ligne. ** 1. Dplacez le curseur sur la ligne marque ---> ci-dessous et placez-le sur la premire erreur. 2. Tapez x pour effacer le premier caractre redondant. 3. Puis tapez u pour annuler la dernire commande excute. 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 prcdentes. 7. Maintenant tapez CTRL-R (maintenez la touche CTRL enfonce pendant que vous appuyez 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 trs utiles. Maintenant, allez au rsum de la Leon 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RSUM DE LA LEON 2 1. Pour effacer du curseur jusqu'au mot suivant tapez : dw 2. Pour effacer du curseur jusqu' la fin d'une ligne tapez : d$ 3. Pour effacer toute une ligne tapez : dd 4. Pour rpter un dplacement ajoutez un quantificateur : 2w 5. Le format d'une commande de changement est : oprateur [nombre] dplacement O : oprateur - est ce qu'il faut faire, comme d pour effacer. [nombre] - un quantificateur optionnel pour rpter le dplacement. dplacement - dplace le long du texte oprer, tel que w (mot), $ (jusqu' la fin de ligne), etc. 6. Pour se dplacer au dbut de ligne, utilisez un zro : 0 5. Pour annuler des actions prcdentes, tapez : u (u minuscule) Pour annuler tous les changements sur une ligne tapez : U (U majuscule) Pour annuler l'annulation tapez : CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leon 3.1 : LE COLLAGE ** Tapez p pour placer aprs le curseur ce qui vient d'tre effac. ** 1. Placez le curseur sur la premire ligne ci-dessous marque --->. 2. Tapez dd pour effacer la ligne et la placer dans un registre de Vim. 3. Dplacez le curseur sur la ligne c) au-dessus o vous voulez remettre la ligne efface. 4. En mode Normal, tapez p pour remettre la ligne en dessous du curseur. 5. Rptez 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, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leon 3.2 : LA COMMANDE DE REMPLACEMENT ** Tapez rx pour remplacer un caractre sous le curseur par x . ** 1. Dplacez le curseur sur la premire ligne marque ---> ci-dessous. 2. Placez le curseur de manire ce qu'il surplombe la premire erreur. 3. Tapez r suivi du caractre qui doit corriger l'erreur. 4. Rptez les tapes 2 et 3 jusqu' ce que la premire ligne soit gale la seconde. ---> 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 Leon 3.3. NOTE : N'oubliez pas que vous devriez apprendre par la pratique, pas par mmorisation. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leon 3.3 : L'OPRATEUR DE CHANGEMENT ** Pour changer jusqu' la fin d'un mot, tapez ce .** 1. Dplacez le curseur sur la premire ligne marque ---> ci-dessous. 2. Placez le curseur sur le u de luhko. 3. Tapez ce et corrigez le mot (dans notre cas, tapez 'igne'.) 4. Appuyez et placez-vous sur le prochain caractre qui doit tre chang. 5. Rptez les tapes 3 et 4 jusqu' ce que la premire 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 changs. Notez que ce efface le mot et vous place ensuite en mode Insertion. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leon 3.4 : PLUS DE CHANGEMENTS AVEC c ** L'oprateur de changement fonctionne avec les mmes dplacements que l'effacement. ** 1. L'oprateur de changement fonctionne de la mme manire que l'effacement. Le format est : c [nombre] dplacement 2. Les dplacements sont identiques : w (mot) et $ (fin de ligne). 3. Dplacez-vous sur la premire ligne marque ---> ci-dessous. 4. Placez le curseur sur la premire erreur. 5. Tapez c$ et tapez le reste de la ligne afin qu'elle soit identique la seconde ligne, puis tapez . ---> La fin de cette ligne doit tre rendue identique la seconde. ---> La fin de cette ligne doit tre corrige avec la commande c$ . NOTE : Vous pouvez utiliser la touche Retour Arrire pour corriger les erreurs lorsque vous tapez. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RSUM DE LA LEON 3 1. Pour remettre le texte qui a dj t effac, tapez p . Cela Place le texte effac APRS le curseur (si une ligne complte a t efface, elle sera place sous la ligne du curseur). 2. Pour remplacer le caractre sous le curseur, tapez r suivi du caractre qui remplacera l'original. 3. L'oprateur de changement vous permet de changer depuis la position du curseur jusqu'o le dplacement vous amne. Par exemple, tapez ce 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 : c [nombre] dplacement Passez maintenant la leon suivante. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leon 4.1 : POSITION DU CURSEUR ET TAT DU FICHIER ** Tapez CTRL-G pour afficher votre position dans le fichier et son tat. Tapez G pour vous rendre une ligne donne du fichier. ** NOTE : Lisez toute cette leon avant d'effectuer l'une des tapes !! 1. Maintenez enfonce la touche CTRL et appuyez sur g . On appelle cela CTRL-G. Une ligne d'tat va apparatre en bas de l'cran avec le nom du fichier et le numro de la ligne o vous tes. Notez ce numro, il servira lors de l'tape 3. NOTE : Vous pouvez peut-tre voir le curseur en bas droite de l'cran. Ceci arrive quand l'option 'ruler' est active (voir :help 'ruler') 2. Tapez G pour vous dplacer la fin du fichier. Tapez gg pour vous dplacer au dbut du fichier. 3. Tapez le numro de la ligne o vous tiez suivi de G . Cela vous ramnera la ligne o vous tiez au dpart quand vous aviez appuy CTRL-G. 4. Si vous vous sentez prt faire ceci, effectuez les tapes 1 3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leon 4.2 : LA RECHERCHE ** Tapez / suivi d'un texte pour rechercher ce texte. ** 1. Tapez le caractre / 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' . C'est le mot que vous voulez rechercher. 3. Pour rechercher nouveau le mme texte, tapez simplement n . Pour rechercher le mme texte dans la direction oppose, tapez N . 4. Pour rechercher une phrase dans la direction oppose, utilisez ? au lieu de / . ---> erreur ne s'crit pas "errreuur" ; errreuur est une erreur. NOTE : Quand la recherche atteint la fin du fichier, elle reprend au dbut sauf si l'option 'wrapscan' est dsactive. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leon 4.3 : RECHERCHE DES PARENTHSES CORRESPONDANTES ** Tapez % pour trouver des ), ] ou } correspondants. ** 1. Placez le curseur sur l'un des (, [ ou { de la ligne marque ---> ci-dessous. 2. Puis tapez le caractre % . 3. Le curseur se dplacera sur la parenthse out crochet correspondant. 4. Tapez % pour replacer le curseur sur la parenthse ou crochet correspondant. 5. Dplacez le curseur sur un autre (,),[,],{ ou } et regardez ce que fait % . ---> Voici ( une ligne de test contenant des (, des [ ] et des { } )). NOTE : Cette fonctionnalit est trs utile lors du dbogage d'un programme qui contient des parenthses dsquilibres ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leon 4.4 : LA COMMANDE DE SUBSTITUTION ** Tapez :s/ancien/nouveau/g pour remplacer 'ancien' par 'nouveau'. ** 1. Dplacez le curseur sur la ligne marque ---> ci-dessous. 2. Tapez :s/lee/le . Notez que cette commande change seulement la premire occurrence de "lee" dans la ligne. 3. Puis tapez :s/lee/le/g . L'ajout du drapeau g ordonne de faire une substitution globale sur la ligne, et change toutes les occurrences de "lee" sur la ligne. ---> lee meilleur moment pour regarder lees fleurs est pendant lee printemps. 4. Pour changer toutes les occurrences d'un texte, entre deux lignes, tapez :#,#s/ancien/nouveau/g o #,# sont les numros de lignes de la plage o la substitution doit tre faite. Tapez :%s/ancien/nouveau/g pour changer toutes les occurrences dans tout le fichier. Tapez :%s/ancien/nouveau/gc pour trouver toutes les occurrences dans tout le fichier avec une invite pour confirmer ou infirmer chaque substitution. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RSUM DE LA LEON 4 1. CTRL-G affiche la position dans le fichier et l'tat de celui-ci. G dplace la fin du fichier. nombre G dplace au numro de ligne. gg dplace la premire ligne. 2. Taper / suivi d'un texte recherche ce texte vers l'AVANT. Taper ? suivi d'un texte recherche ce texte vers l'ARRIRE. Aprs une recherche tapez n pour trouver l'occurrence suivante dans la mme direction ou Maj-N pour rechercher dans la direction oppose. 3. Taper % lorsque le curseur est sur (, ), [, ], { ou } dplace celui-ci sur le caractre 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 numros de ligne tapez :#,#s/aa/bb/g Pour remplacer toutes les occurrences dans le fichier tapez :%s/aa/bb/g Pour demander une confirmation chaque fois ajoutez 'c' :%s/aa/bb/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leon 5.1 : COMMENT EXCUTER UNE COMMANDE EXTERNE ** Tapez :! suivi d'une commande externe pour excuter 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'excuter n'importe quelle commande valide pour votre interprteur (shell). 3. Par exemple, tapez ls aprs le ! et appuyez . Ceci affichera la liste des fichiers du rpertoire courant, comme si vous aviez tap la commande l'invite du shell. Utilisez :!dir si :!ls ne marche pas. NOTE : Il est possible d'excuter n'importe quelle commande externe de cette manire, avec ou sans argument. NOTE : Toutes les commandes : doivent finir par la frappe de . partir de maintenant, nous ne le mentionnerons plus. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leon 5.2 : PLUS DE DTAILS SUR L'ENREGISTREMENT DE FICHIERS ** Pour enregistrer les changements faits au texte, tapez :w FICHIER . ** 1. Tapez :!dir ou :!ls pour avoir la liste des fichiers dans le rpertoire courant. Vous savez dj qu'il faut appuyer aprs 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 enregistre tout le fichier (Tutoriel Vim) sous le nom TEST. Pour le vrifier, tapez :!dir ou :!ls de nouveau pour revisualiser votre rpertoire. NOTE : Si vous quittez Vim et le redmarrez de nouveau avec le fichier TEST, celui-ci sera une copie exacte de ce cours au moment o vous l'avez enregistr. 5. Maintenant, effacez le fichier en tapant (MS-DOS) : :!del TEST ou (Unix) : :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leon 5.3 : SLECTION DU TEXTE ENREGISTRER ** Pour enregistrer une portion du fichier, tapez : v dplacement :w FICHIER ** 1. Dplacez le curseur sur cette ligne. 2. Appuyez v et dplacez le curseur vers la cinquime ligne plus bas. Remarquez que le texte est en surbrillance. 3. Appuyez : . En bas de l'cran :'<,'> va apparatre. 4. Tapez w TEST , o TEST est un nom de fichier qui n'existe pas. Vrifiez que vous voyez :'<,'>w TEST avant de d'appuyer sur . 5. Vim va enregistrer les lignes slectionnes dans le fichier TEST. Utilisez :!dir ou :!ls pour le voir. Ne l'effacez pas encore ! Nous allons l'utiliser dans la leon suivante. NOTE : L'appui de v dmarre la slection Visuelle. Vous pouvez dplacer le curseur pour agrandir ou rtrcir la slection. Puis vous pouvez utiliser un oprateur pour faire quelque chose sur le texte. Par exemple, d efface le texte. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leon 5.4 : RCUPRATION ET FUSION DE FICHIERS ** Pour insrer le contenu d'un fichier, tapez :r FICHIER ** 1. Placez le curseur juste au-dessus de cette ligne. NOTE : Aprs avoir excut l'tape 2 vous verrez du texte de la Leon 5.3. Puis dplacez-vous vers le bas pour voir cette leon nouveau. 2. Maintenant rcuprez votre fichier TEST en utilisant la commande :r TEST o TEST est le nom de votre fichier. Le fichier que vous rcuprez est plac au-dessous de la ligne du curseur. 4. Pour vrifier que le fichier a bien t insr, remontez et vrifiez qu'il y a maintenant deux copies de la Leon 5.3, l'originale et celle contenue dans le fichier. NOTE : Vous pouvez aussi lire la sortie d'une commande externe. Par exemple, :r !ls lit la sortie de la commande ls et la place sous la ligne du curseur. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RSUM DE LA LEON 5 1. :!commande excute une commande externe. Quelques exemples pratiques : (MS-DOS) (Unix) :!dir :!ls affiche le contenu du rpertoire courant. :!del FICHIER :!rm FICHIER efface FICHIER. 2. :w FICHIER enregistre le fichier Vim courant sur le disque avec pour nom FICHIER. 3. v dplacement :w FICHIER sauvegarde les lignes de la slection Visuelle dans le fichier FICHIER. 4. :r FICHIER rcupre le contenu du fichier FICHIER et l'insre sous la position du curseur. 5. :r !dir lit la sortie de la commande dir et l'insre sous la position du curseur. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leon 6.1 : LA COMMANDE D'OUVERTURE ** Tapez o pour ouvrir une ligne sous le curseur et y aller en Insertion. ** 1. Dplacez le curseur sur la ligne marque ---> ci-dessous. 2. Tapez la lettre o minuscule pour ouvrir une ligne SOUS le curseur et vous y placer en mode Insertion. 3. Puis tapez du texte et appuyez pour sortir du 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, plutt qu'un o minuscule. Faites un essai sur la ligne ci-dessous. ---> Ouvrez une ligne ci-dessus en tapant O lorsque le curseur est ici. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leon 6.2 : LA COMMANDE D'AJOUT ** Tapez a pour insrer du texte APRS le curseur. ** 1. Placez le curseur au dbut de la ligne marque ---> ci-dessous. 2. Appuyez e jusqu' ce que le curseur soit sur la fin de li . 3. Appuyez a (minuscule) pour ajouter du texte APRS le curseur. 4. Compltez le mot comme dans la ligne dessous. Appuyez pour sortir du mode Insertion. 5. Utilisez e pour vous dplacer vers le mot incomplet suivant et rptez les tapes 3 et 4. ---> Cette li vous perm de pratiq l'ajout de t dans une ligne. ---> Cette ligne vous permet de pratiquer l'ajout de texte dans une ligne. NOTE : a, i, A vont tous dans le mme mode Insertion, la seule diffrence est l'endroit o les caractres sont insrs. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leon 6.3 : UNE AUTRE MANIRE DE REMPLACER ** Tapez un R majuscule pour remplacer plus d'un caractre. ** 1. Dplacez le curseur sur la premire ligne marque ---> ci-dessous. Dplacez le curseur sur le dbut du premier xxx . 2. Appuyez maintenant R et tapez le nombre dessous dans la deuxime ligne, de manire remplacer le xxx . 3. Appuyez pour quitter le mode Remplacement. Notez que le reste de la ligne demeure inchang. 4. Rptez les tapes pour remplacer les xxx restants. ---> L'ajout de 123 xxx donne xxx. ---> L'ajout de 123 456 donne 579. NOTE : Le mode Remplacement est comme le mode Insertion, mais tous les caractres taps effacent un caractre existant. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leon 6.4 : COPIER ET COLLER DU TEXTE ** Utilisez l'oprateur y pour copier du texte et p pour le coller ** 1. Allez la ligne marque ---> ci-dessous et placez le curseur aprs "a)". 2. Dmarrez le mode Visuel avec v et dplacez le curseur juste devant "premier". 3. Tapez y pour copier le texte en surbrillance. 4. Dplacez le curseur la fin de la ligne suivante : j$ 5. Tapez p pour coller le texte. Puis tapez : un second . 6. Utilisez le mode Visuel pour slectionner "lment", copiez-le avec y , dplacez-vous la fin de la ligne suivant avec j$ et collez le texte cet endroit avec p . ---> a) ceci est le premier lment. b) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leon 6.4 : RGLAGE DES OPTIONS ** Rglons une option afin que la recherche et la substitution ignore la casse des caractres. ** 1. Recherchez 'ignore' en tapant : /ignore Rptez ceci plusieurs fois en utilisant la touche n . 2. Activez l'option 'ic' (ignorer casse) en tapant :set ic . 3. Puis cherchez 'ignore' de nouveau en utilisant n . Remarquez que Ignore et IGNORE sont maintenant aussi trouvs. 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 dsactiver 'ignorer casse', entrez : :set noic NOTE : Pour enlever la surbrillance des rsultats, entrez : :nohlsearch NOTE : Si vous voulez ignorer la casse uniquement pour une recherche, utilisez \c dans la phrase : /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RSUM DE LA LEON 6 1. Taper o ouvre une ligne SOUS le curseur et dmarre le mode Insertion. Taper O ouvre une ligne au-DESSUS du curseur. 2. Taper a pour insrer du texte APRS le curseur. Taper A pour insrer du texte aprs la fin de ligne. 3. Taper e dplace la fin du mot. 4. Taper y copie du texte, p le colle. 5. Taper R majuscule active le mode Remplacement jusqu' ce qu' soit appuy. 6. Taper ":set xxx" active l'option "xxx". Quelques options sont : 'ic' 'ingnorecase' pour ignorer la casse lors des recherches. 'is' 'incsearch' pour montrer les appariements partiels. 'hls' 'hlsearch' pour mettre en surbrillance les appariements. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leon 7.1 : OBTENIR DE L'AIDE ** Utiliser le systme d'aide en ligne. ** Vim a un systme complet d'aide en ligne. Pour y accder, essayez l'une de ces trois mthodes : - appuyez la touche (si vous en avez une) - appuyez la touche (si vous en avez une) - tapez :help Lisez le texte dans la fentre d'aide pour savoir comment fonctionne l'aide. Tapez CTRL-W CTRL-W pour sauter d'une fentre l'autre. Tapez :q pour fermer la fentre d'aide. Vous pouvez accder l'aide sur peu prs n'importe quel sujet en donnant des arguments la commande :help . Essayez par exemple (n'oubliez pas d'appuyer sur ) : :help w :help c_CTRL-D :help c_ ** 1. Mettez Vim soit en mode non compatible : set nocp 2. Regardez quels fichiers existent dans le rpertoire : !ls ou !dir 3. Tapez le dbut d'une commande : :e 4. Appuyez CTRL-D et Vim affichera une liste de commandes qui commencent par "e". 5. Appuyez et Vim compltera le nom de la commande : ":edit" 6. Ajoutez maintenant un espace et le dbut d'un fichier existant : :edit FIC 7 Appuyez . Vim va complter le nom (s'il est unique). NOTE : Le compltement fonctionne pour de nombreuses commandes. Essayez d'appuyer CTRL-D et . C'est utile en particulier pour :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RSUM DE LA LEON 7 1. Tapez :help ou appuyez ou pour ouvrir la fentre d'aide. 2. Tapez :help cmd pour trouver l'aide sur cmd . 3. Tapez CTRL-W CTRL-W pour sauter une autre fentre. 4. Tapez :q pour fermer la fentre d'aide. 5. Crez un script de dmarrage vimrc pour conserver vos rglages prfrs. 6. Quand vous tapez une commande : appuyez CTRL-D pour voir les compltements possibles. Appuyez pour utiliser un compltement. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ceci conclut le Tutoriel Vim. Le but tait de vous donner un bref aperu 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 plus de commandes. Un Manuel de l'utilisateur est disponible en anglais : :help user-manual Pour continuer dcouvrir et apprendre Vim, il existe un livre traduit en franais. Il parle plus de Vi que de Vim, mais pourra vous tre utile. L'diteur Vi - Collection Prcis et concis - par Arnold Robbins diteur : O'Reilly France ISBN : 2-84177-102-4 Deux livres en anglais sont galement mentionns dans la version originale de ce tutoriel, dont un qui traite spcifiquement de Vim. Merci de vous y rfrer si vous tes intresss. Ce tutoriel a t crit par Michael C. Pierce et Robert K. Ware de l'cole des Mines du Colorado et reprend des ides fournies par Charles Smith, Universit d'tat du Colorado. E-mail : bware@mines.colorado.edu. Modifi pour Vim par Bram Moolenaar. Traduit en franais par Adrien Beau, en avril 2001. Dernires mises jour par Dominique Pell. E-mail : dominique.pelle@gmail.com Last Change : 2014 Aug 18 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim-7.4.1689/runtime/tutor/tutor.fr.utf-8000066400000000000000000001147051267703067000201150ustar00rootroot00000000000000=============================================================================== = B i e n v e n u e dans l e T u t o r i e l de V I M - Version 1.7 = =============================================================================== 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. ATTENTION : 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 verrouillé 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 : SORTIR 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! Ceci quitte l'éditeur SANS enregistrer les changements que vous avez faits. 3. Lorsque l'invite du shell vous sera présentée, tapez la commande qui vous a mené dans ce tutoriel. Cela pourrait être : vimtutor 4. Si vous avez mémorisé ces étapes et êtes confiant, effectuez les étapes 1 à 3 pour sortir puis rentrer dans l'éditeur. NOTE : :q! annule tous les changements que vous avez faits. Dans quelques leçons, vous apprendrez à enregistrer les changements. 5. Déplacez le curseur à la Leçon 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leçon 1.3 : ÉDITION DE TEXTE - EFFACEMENT ** 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 ** 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 à la Leçon 1.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leçon 1.5 : ÉDITION DE TEXTE - AJOUTER ** Appuyez A pour ajouter du text. ** 1. Déplacez le curseur sur la première ligne ci-dessous marquée --->. Peu importe sur quel caractère se trouve le curseur sur cette ligne. 2. Appuyez A et tapez les ajouts nécessaires. 3. Quand le texte a été ajouté, appuyez <Échap> pour revenir en mode Normal. 4. Déplacez le curseur sur la seconde ligne marquée ---> et répétez les étapes 2 et 3 pour corriger la phrase. ---> Il manque du texte à partir de cet Il manque du texte à partir de cette ligne. ---> Il manque aussi du te Il manque aussi du texte ici. 5. Quand vous vous sentez suffisamment à l'aise pour ajouter du texte, allez à la Leçon 1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leçon 1.6 : ÉDITER UN FICHIER ** Utilisez :wq pour enregistrer un fichier et sortir. ** !! NOTE : Lisez toute la leçon avant d'exécuter les instructions ci-dessous !! 1. Sortez de ce tutoriel comme vous l'avez fait dans la Leçon 1.2 : :q! Ou, si vous avez accès à un autre terminal, exécutez y les actions qui suivent. 2. À l'invite du shell, tapez cette commande : vim tutor 'vim' est la commande pour démarrer l'éditeur Vim, 'tutor' est le nom du fichier que vous souhaitez éditer. Utilisez un fichier qui peut être modifié. 3. Insérez et effacez du texte comme vous l'avez appris dans les leçons précédentes. 4. Enregistrez le fichier avec les changements et sortez de Vim avec : :wq 5. Si vous avez quitté vimtutor à l'étape 1, recommencez vimtutor et déplacez-vous en bas vers le résumé suivant. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 démarrer Vim à l'invite du shell tapez : vim FICHIER 3. Pour quitter Vim tapez : <Échap> :q! pour perdre tous les changements. OU tapez : <Échap> :wq pour enregistrer les changements. 4. Pour effacer un caractère sous le curseur tapez : x 5. Pour insérer ou ajouter du texte tapez : i tapez le texte à insérer avant le curseur <Échap> A tapez le texte à ajouter après le curseur <Échap> NOTE : Appuyer <Échap> vous place en mode Normal ou annule une commande partiellement tapée dont vous ne voulez plus. Passez maintenant à la leçon 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leçon 2.1 : COMMANDES D'EFFACEMENT ** Tapez dw pour effacer 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 : La lettre d apparaîtra sur la dernière ligne de l'écran lors de votre frappe. Vim attend que vous tapiez w . Si vous voyez un autre caractère que d vous avez tapé autre 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 DE COMMANDES 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 de la ligne correcte (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 : À PROPOS DES OPÉRATEURS ET DES MOUVEMENTS Plusieurs commandes qui changent le texte sont constituées d'un opérateur et d'un mouvement. Le format pour une commande d'effacement avec l'opérateur d d'effacement est le suivant : d mouvement Où : d - est l'opérateur d'effacement mouvement - est le mouvement sur lequel agit l'opérateur (listés ci-dessous) Une courte liste de mouvements : w - jusqu'au début du prochain mot, en EXCLUANT son premier caractère. e - jusqu'à la fin du mot courant, en EXCLUANT son dernier caractère. $ - jusqu'à la fin de la ligne, en INCLUANT son dernier caractère. Ainsi, taper de va effacer depuis le curseur jusqu'à la fin du mot. NOTE : Le seul appui d'un mouvement en mode Normal, sans commande, déplace le curseur comme indiqué. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leçon 2.4 : UTILISER UN QUANTIFICATEUR AVEC UN MOUVEMENT ** Taper un nombre avant un mouvement le répète autant de fois. ** 1. Déplacez le curseur au début de la ligne marquée ---> ci-dessous. 2. Tapez 2w pour déplacer le curseur de 2 mots vers l'avant. 3. Tapez 3e pour déplacer le curseur à la fin du troisième mot vers l'avant. 4. Tapez 0 (zéro) pour déplacer au début de la ligne. 5. Répétez les étapes 2 et 3 avec des quantificateurs différents. ---> Ceci est juste une ligne avec des mots où vous pouvez vous déplacer. 6. Déplacez-vous à la Leçon 2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leçon 2.5 : UTILISER UN QUANTIFICATEUR POUR EFFACER PLUS ** Taper un nombre avec un opérateur le répète autant de fois. ** Outre la combinaison de l'opérateur d'effacement avec un déplacement mentionné ci-dessus, vous pouvez insérer un nombre (quantificateur) pour effacer encore plus : d nombre déplacement 1. Déplacez le curseur vers le premier mot en MAJUSCULES dans la ligne marquée --->. 2. Tapez d2w pour effacer les deux mots en MAJUSCULES. 3. Répétez les étapes 1 et 2 avec des quantificateurs différents pour effacer les mots suivants en MAJUSCULES à l'aide d'une commande. ---> Cette ABC DE ligne FGHI JK LMN OP de mots est Q RS TUV nettoyée. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leçon 2.6 : OPÉREZ SUR DES LIGNES ** 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 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 pour effacer 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.7 : 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 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'au mot suivant tapez : dw 2. Pour effacer du curseur jusqu'à la fin d'une ligne tapez : d$ 3. Pour effacer toute une ligne tapez : dd 4. Pour répéter un déplacement ajoutez un quantificateur : 2w 5. Le format d'une commande de changement est : opérateur [nombre] déplacement Où : opérateur - est ce qu'il faut faire, comme d pour effacer. [nombre] - un quantificateur optionnel pour répéter le déplacement. déplacement - déplace le long du texte à opérer, tel que w (mot), $ (jusqu'à la fin de ligne), etc. 6. Pour se déplacer au début de ligne, utilisez un zéro : 0 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 ci-dessous marquée --->. 2. Tapez dd pour effacer la ligne et la placer dans un registre de Vim. 3. Déplacez le curseur sur la ligne c) au-dessus où vous voulez remettre la ligne effacée. 4. En mode Normal, tapez p pour remettre la ligne en dessous du curseur. 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 : LA COMMANDE DE REMPLACEMENT ** Tapez rx pour remplacer un caractère sous le curseur par x . ** 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 égale à la seconde. ---> 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 : L'OPÉRATEUR DE CHANGEMENT ** Pour changer jusqu'à la fin d'un mot, tapez ce .** 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 ce et corrigez le mot (dans notre cas, tapez 'igne'.) 4. Appuyez <Échap> et placez-vous sur le prochain 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 ce efface le mot et vous place ensuite en mode Insertion. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leçon 3.4 : PLUS DE CHANGEMENTS AVEC c ** L'opérateur de changement fonctionne avec les mêmes déplacements que l'effacement. ** 1. L'opérateur de changement fonctionne de la même manière que l'effacement. Le format est : c [nombre] déplacement 2. Les déplacements sont identiques : w (mot) et $ (fin de ligne). 3. Déplacez-vous sur la première ligne marquée ---> ci-dessous. 4. Placez le curseur sur la première erreur. 5. Tapez c$ et tapez le reste de la ligne afin qu'elle soit 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$ . NOTE : Vous pouvez utiliser la touche Retour Arrière pour corriger les erreurs lorsque vous tapez. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RÉSUMÉ DE LA LEÇON 3 1. Pour remettre le texte qui a déjà été 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. L'opérateur de changement vous permet de changer depuis la position du curseur jusqu'où le déplacement vous amène. Par exemple, tapez ce 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 : c [nombre] déplacement Passez maintenant à la leçon suivante. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leçon 4.1 : POSITION DU CURSEUR ET ÉTAT DU FICHIER ** Tapez CTRL-G pour afficher votre position dans le fichier et son état. Tapez 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 . On appelle cela CTRL-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. NOTE : Vous pouvez peut-être voir le curseur en bas à droite de l'écran. Ceci arrive quand l'option 'ruler' est activée (voir :help 'ruler') 2. Tapez G pour vous déplacer à la fin du fichier. Tapez gg pour vous déplacer au début du fichier. 3. Tapez le numéro de la ligne où vous étiez suivi de G . Cela vous ramènera à la ligne où vous étiez au départ quand vous aviez appuyé CTRL-G. 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' . 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 N . 4. Pour rechercher une phrase dans la direction opposée, utilisez ? au lieu 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 sauf si l'option 'wrapscan' est désactivée. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 se déplacera sur la parenthèse out crochet correspondant. 4. Tapez % pour replacer le curseur sur la parenthèse ou crochet correspondant. 5. Déplacez le curseur sur un autre (,),[,],{ ou } et regardez ce que fait % . ---> 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 : LA COMMANDE DE SUBSTITUTION ** 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 . Notez que cette commande change seulement la première occurrence de "lee" dans la ligne. 3. Puis tapez :s/lee/le/g . L'ajout du drapeau g ordonne de faire une substitution globale sur la ligne, et change toutes les occurrences de "lee" sur la ligne. ---> lee meilleur moment pour regarder lees fleurs est pendant lee printemps. 4. Pour changer toutes les occurrences d'un texte, entre deux lignes, tapez :#,#s/ancien/nouveau/g où #,# sont les numéros de lignes de la plage où la substitution doit être faite. Tapez :%s/ancien/nouveau/g pour changer toutes les occurrences dans tout le fichier. Tapez :%s/ancien/nouveau/gc pour trouver toutes les occurrences dans tout le fichier avec une invite pour confirmer ou infirmer chaque substitution. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RÉSUMÉ DE LA LEÇON 4 1. CTRL-G affiche la position dans le fichier et l'état de celui-ci. G déplace à la fin du fichier. nombre G déplace au numéro de ligne. gg déplace à la première 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'occurrence 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 occurrences 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 . Ceci affichera la liste des fichiers du répertoire 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, avec ou sans argument. NOTE : Toutes les commandes : doivent finir par la frappe de . À partir de maintenant, nous ne le mentionnerons plus. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leçon 5.2 : PLUS DE DÉTAILS SUR L'ENREGISTREMENT DE FICHIERS ** Pour enregistrer les changements faits au texte, tapez :w FICHIER . ** 1. Tapez :!dir ou :!ls pour avoir la liste des fichiers dans le répertoire courant. Vous savez déjà qu'il faut appuyer 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 enregistre tout le fichier (Tutoriel Vim) sous le nom TEST. Pour le vérifier, tapez :!dir ou :!ls de nouveau pour revisualiser votre répertoire. NOTE : Si vous quittez Vim et le redémarrez de nouveau avec le fichier TEST, celui-ci sera une copie exacte de ce cours au moment où vous l'avez enregistré. 5. Maintenant, effacez le fichier en tapant (MS-DOS) : :!del TEST ou (Unix) : :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leçon 5.3 : SÉLECTION DU TEXTE À ENREGISTRER ** Pour enregistrer une portion du fichier, tapez : v déplacement :w FICHIER ** 1. Déplacez le curseur sur cette ligne. 2. Appuyez v et déplacez le curseur vers la cinquième ligne plus bas. Remarquez que le texte est en surbrillance. 3. Appuyez : . En bas de l'écran :'<,'> va apparaître. 4. Tapez w TEST , où TEST est un nom de fichier qui n'existe pas. Vérifiez que vous voyez :'<,'>w TEST avant de d'appuyer sur . 5. Vim va enregistrer les lignes sélectionnées dans le fichier TEST. Utilisez :!dir ou :!ls pour le voir. Ne l'effacez pas encore ! Nous allons l'utiliser dans la leçon suivante. NOTE : L'appui de v démarre la sélection Visuelle. Vous pouvez déplacer le curseur pour agrandir ou rétrécir la sélection. Puis vous pouvez utiliser un opérateur pour faire quelque chose sur le texte. Par exemple, d efface le texte. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leçon 5.4 : RÉCUPÉRATION ET FUSION DE FICHIERS ** Pour insérer le contenu d'un fichier, tapez :r FICHIER ** 1. Placez le curseur juste au-dessus de cette ligne. NOTE : Après avoir exécuté l'étape 2 vous verrez du texte de la Leçon 5.3. Puis déplacez-vous vers le bas pour voir cette leçon à nouveau. 2. Maintenant récupérez votre fichier TEST en utilisant la commande :r TEST où TEST est le nom de votre fichier. Le fichier que vous récupérez est placé au-dessous de la ligne du 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. NOTE : Vous pouvez aussi lire la sortie d'une commande externe. Par exemple, :r !ls lit la sortie de la commande ls et la place sous la ligne du curseur. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 répertoire courant. :!del FICHIER :!rm FICHIER efface FICHIER. 2. :w FICHIER enregistre le fichier Vim courant sur le disque avec pour nom FICHIER. 3. v déplacement :w FICHIER sauvegarde les lignes de la sélection Visuelle dans le fichier FICHIER. 4. :r FICHIER récupère le contenu du fichier FICHIER et l'insère sous la position du curseur. 5. :r !dir lit la sortie de la commande dir et l'insère sous la position du curseur. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leçon 6.1 : LA COMMANDE D'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 la lettre o minuscule pour ouvrir une ligne SOUS le curseur et vous y placer en mode Insertion. 3. Puis tapez du texte et appuyez <Échap> pour sortir du 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 O lorsque le curseur est ici. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leçon 6.2 : LA COMMANDE D'AJOUT ** Tapez a pour insérer du texte APRÈS le curseur. ** 1. Placez le curseur au début de la ligne marquée ---> ci-dessous. 2. Appuyez e jusqu'à ce que le curseur soit sur la fin de li . 3. Appuyez a (minuscule) pour ajouter du texte APRÈS le curseur. 4. Complétez le mot comme dans la ligne dessous. Appuyez <Échap> pour sortir du mode Insertion. 5. Utilisez e pour vous déplacer vers le mot incomplet suivant et répétez les étapes 3 et 4. ---> Cette li vous perm de pratiq l'ajout de t dans une ligne. ---> Cette ligne vous permet de pratiquer l'ajout de texte dans une ligne. NOTE : a, i, A vont tous dans le même mode Insertion, la seule différence est l'endroit où les caractères sont insérés. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leçon 6.3 : UNE AUTRE MANIÈRE DE REMPLACER ** 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. Déplacez le curseur sur le début du premier xxx . 2. Appuyez maintenant R et tapez le nombre dessous dans la deuxième ligne, de manière à remplacer le xxx . 3. Appuyez <Échap> pour quitter le mode Remplacement. Notez que le reste de la ligne demeure inchangé. 4. Répétez les étapes pour remplacer les xxx restants. ---> L'ajout de 123 à xxx donne xxx. ---> L'ajout de 123 à 456 donne 579. NOTE : Le mode Remplacement est comme le mode Insertion, mais tous les caractères tapés effacent un caractère existant. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leçon 6.4 : COPIER ET COLLER DU TEXTE ** Utilisez l'opérateur y pour copier du texte et p pour le coller ** 1. Allez à la ligne marquée ---> ci-dessous et placez le curseur après "a)". 2. Démarrez le mode Visuel avec v et déplacez le curseur juste devant "premier". 3. Tapez y pour copier le texte en surbrillance. 4. Déplacez le curseur à la fin de la ligne suivante : j$ 5. Tapez p pour coller le texte. Puis tapez : un second <Échap> . 6. Utilisez le mode Visuel pour sélectionner "élément", copiez-le avec y , déplacez-vous à la fin de la ligne suivant avec j$ et collez le texte à cet endroit avec p . ---> a) ceci est le premier élément. b) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leçon 6.4 : RÉGLAGE DES OPTIONS ** Réglons une option afin que la recherche et la substitution ignore 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 cherchez 'ignore' de nouveau en utilisant n . Remarquez que Ignore et IGNORE sont maintenant aussi trouvés. 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 désactiver 'ignorer casse', entrez : :set noic NOTE : Pour enlever la surbrillance des résultats, entrez : :nohlsearch NOTE : Si vous voulez ignorer la casse uniquement pour une recherche, utilisez \c dans la phrase : /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RÉSUMÉ DE LA LEÇON 6 1. Taper o ouvre une ligne SOUS le curseur et démarre le mode Insertion. Taper O ouvre une ligne au-DESSUS du curseur. 2. Taper a pour insérer du texte APRÈS le curseur. Taper A pour insérer du texte après la fin de ligne. 3. Taper e déplace à la fin du mot. 4. Taper y copie du texte, p le colle. 5. Taper R majuscule active le mode Remplacement jusqu'à ce qu' <Échap> soit appuyé. 6. Taper ":set xxx" active l'option "xxx". Quelques options sont : 'ic' 'ingnorecase' pour ignorer la casse lors des recherches. 'is' 'incsearch' pour montrer les appariements partiels. 'hls' 'hlsearch' pour mettre en surbrillance les appariements. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leçon 7.1 : OBTENIR DE L'AIDE ** 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 (si vous en avez une) - appuyez la touche (si vous en avez une) - tapez :help Lisez le texte dans la fenêtre d'aide pour savoir comment fonctionne l'aide. Tapez CTRL-W CTRL-W pour sauter d'une fenêtre à l'autre. Tapez :q 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 ) : :help w :help c_CTRL-D :help c_ ** 1. Mettez Vim soit en mode non compatible : set nocp 2. Regardez quels fichiers existent dans le répertoire : !ls ou !dir 3. Tapez le début d'une commande : :e 4. Appuyez CTRL-D et Vim affichera une liste de commandes qui commencent par "e". 5. Appuyez et Vim complétera le nom de la commande : ":edit" 6. Ajoutez maintenant un espace et le début d'un fichier existant : :edit FIC 7 Appuyez . Vim va compléter le nom (s'il est unique). NOTE : Le complètement fonctionne pour de nombreuses commandes. Essayez d'appuyer CTRL-D et . C'est utile en particulier pour :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RÉSUMÉ DE LA LEÇON 7 1. Tapez :help ou appuyez ou pour ouvrir la fenêtre d'aide. 2. Tapez :help cmd pour trouver l'aide sur cmd . 3. Tapez CTRL-W CTRL-W pour sauter à une autre fenêtre. 4. Tapez :q pour fermer la fenêtre d'aide. 5. Créez un script de démarrage vimrc pour conserver vos réglages préférés. 6. Quand vous tapez une commande : appuyez CTRL-D pour voir les complètements possibles. Appuyez pour utiliser un complètement. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 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és. 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, Université d'État du Colorado. E-mail : bware@mines.colorado.edu. Modifié pour Vim par Bram Moolenaar. Traduit en français par Adrien Beau, en avril 2001. Dernières mises à jour par Dominique Pellé. E-mail : dominique.pelle@gmail.com Last Change : 2014 Aug 18 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim-7.4.1689/runtime/tutor/tutor.hr000066400000000000000000001021651267703067000171520ustar00rootroot00000000000000=============================================================================== = D o b r o d o l i u VIM p r i r u n i k - Verzija 1.7 = =============================================================================== Vim je vrlo moan editor koji ima mnogo naredbi, previe da bi ih se svih ovdje spomenulo. Namjena prirunika je objasniti dovoljno naredbi kako bi poetnici znatno lake koristili ovaj svestran editor. Priblino vrijeme potrebno za uspjean zavretak prirunika je oko 30 minuta a ovisi o tome koliko e te vremena odvojiti za vjebanje. UPOZORENJE: Naredbe u ovom priruniku e promijeniti ovaj tekst. Napravite kopiju ove datoteke kako bi ste na istoj vjebali (ako ste pokrenuli "vimtutor" ovo je ve kopija). Vrlo je vano primijetiti da je ovaj prirunik namijenjen za vjebanje. Preciznije, morate izvriti naredbe u Vim-u kako bi ste iste nauili pravilno koristiti. Ako samo itate tekst, zaboraviti e te naredbe! Ako je CapsLock ukljuen ISKLJUITE ga. Pritiskajte tipku j kako bi pomakli kursor sve dok Lekcija 1.1 ne ispuni ekran. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1.1: POMICANJE KURSORA ** Za pomicanje kursora, pritisnite h,j,k,l tipke kako je prikazano ** ^ k Savjet: h tipka je lijevo i pomie kursor lijevo. < h l > l tipka je desno i pomie kursor desno. j j izgleda kao strelica usmjerena dolje. v 1. Pomiite kursor po ekranu dok se ne naviknete na koritenje. 2. Drite tipku (j) pritisnutom. Sada znate kako doi do sljedee lekcije. 3. Koristei tipku j prijeite na sljedeu lekciju 1.2. NAPOMENA: Ako niste sigurni to ste zapravo pritisnuli uvijek koristite tipku kako bi preli u Normal mod i onda pokuajte ponovno. NAPOMENA: Kursorske tipke rade isto. Koritenje hjkl tipaka je znatno bre, nakon to se jednom naviknete na njihovo koritenje. Stvarno! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1.2: IZLAZ IZ VIM-a !! UPOZORENJE: Prije izvoenja bilo kojeg koraka, proitajte cijelu lekciju!! 1. Pritisnite tipku (Vim je sada u Normal modu). 2. Otipkajte: :q! . Izlaz iz editora, GUBE se sve napravljene promjene. 3. Kada se pojavi ljuska, utipkajte naredbu koja je pokrenula ovaj prirunik: vimtutor 4. Ako ste upamtili ove korake, izvrite ih redom od 1 do 3 kako bi ponovno pokrenuli editor. NAPOMENA: :q! ponitava sve promjene koje ste napravili. U sljedeim lekcijama nauit e te kako promjene sauvati. 5. Pomaknite kursor na Lekciju 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1.3: PROMJENA TEKSTA - BRISANJE ** Pritisnite x za brisanje znaka pod kursorom. ** 1. Pomaknite kursor na liniju oznaenu s --->. 2. Kako bi ste ispravili pogreke, pomiite kursor dok se ne bude nalazio na slovu kojeg trebate izbrisati. 3. Pritisnite tipku x kako bi uklonili neeljeno slovo. 4. Ponovite korake od 2 do 4 dok ne ispravite sve pogreke. ---> KKKravaa jee presskoila mmjeseccc. 5. Nakon to ispravite liniju, prijeite na lekciju 1.4. NAPOMENA: Koristei ovaj prirunik ne pokuavajte pamtiti ve uite primjenom. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1.4: PROMJENA TEKSTA - UBACIVANJE ** Pritisnite i za ubacivanje teksta ispred kursora. ** 1. Pomaknite kursor na prvu sljedeu liniju oznaenu s --->. 2. Kako bi napravili prvu liniju istovjetnoj drugoj, pomaknite kursor na prvi znak POSLIJE kojeg e te utipkati potreban tekst. 3. Pritisnite i te utipkajte potrebne nadopune. 4. Nakon to ispravite pogreku pritisnite kako bi vratili Vim u Normal mod. Ponovite korake od 2 do 4 kako bi ispravili sve pogreke. ---> Nedje no teka od v lin. ---> Nedostaje neto teksta od ove linije. 5. Prijeite na sljedeu lekciju. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1.5: PROMJENA TEKSTA - DODAVANJE ** Pritisnite A za dodavanje teksta. ** 1. Pomaknite kursor na prvu sljedeu liniju oznaenu s --->. Nije vano na kojem se slovu nalazi kursor na toj liniji. 2. Pritisnite A i napravite potrebne promjene. 3. Nakon to ste dodali tekst, pritisnite za povratak u Normal mod. 4. Pomaknite kursor na drugu liniju oznaenu s ---> i ponovite korake 2 i 3 dok ne popravite tekst. ---> Ima neto teksta koji nedostaje n Ima neto teksta koji nedostaje na ovoj liniji. ---> Ima neto teksta koji ne Ima neto teksta koji nedostaje ba ovdje. 5. Prijeite na lekciju 1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1.6: PROMJENA DATOTEKE ** Koristite :wq za spremanje teksta i naputanje Vim-a. ** !! UPOZORENJE: Prije izvravanja bilo kojeg koraka, proitajte lekciju!! 1. Izaite iz programa kao sto ste napravili u lekciji 1.2: :q! 2. Iz ljuske utipkajte sljedeu naredbu: vim tutor 'vim' je naredba pokretanja Vim editora, 'tutor' je ime datoteke koju elite ureivati. Koristite datoteku koju imate ovlasti mijenjati. 3. Ubacite i izbriite tekst kao to ste to napravili u lekcijama prije. 4. Sauvajte promjenjeni tekst i izaite iz Vim-a: :wq 5. Ponovno pokrenite vimtutor i nastavite itati saetak koji sljedi. 6. Nakon sto proitate gornje korake i u potpunosti ih razumijete: izvrite ih. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1 SAETAK 1. Kursor se pomie strelicama ili pomou hjkl tipaka. h (lijevo) j (dolje) k (gore) l (desno) 2. Pokretanje Vim-a iz ljuske: vim IME_DATOTEKE 3. Izlaz: :q! sve promjene su izgubljene. ILI: :wq promjene su sauvane. 4. Brisanje znaka na kojem se nalazi kursor: x 5. Ubacivanja ili dodavanje teksta: i utipkajte tekst unos ispred kursora A utipkajte tekst dodavanje na kraju linije NAPOMENA: Tipkanjem tipke prebacuje Vim u Normal mod i prekida neeljenu ili djelomino zavrenu naredbu. Nastavite itati Lekciju 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 2.1: NAREDBE BRISANJA ** Tipkajte dw za brisanje rijei. ** 1. Pritisnite kako bi bili sigurni da je Vim u Normal modu. 2. Pomaknite kursor na liniju oznaenu s --->. 3. Pomaknite kursor na poetak rijei koju treba izbrisati. 4. Otipkajte dw kako bi uklonili rije. NAPOMENA: Vim e prikazati slovo d na zadnjoj liniji kad ga otipkate. Vim eka da otipkate w . Ako je prikazano neko drugo slovo, krivo ste otipkali; pritisnite i pokuajte ponovno. ---> Neke rijei smijeno ne pripadaju na papir ovoj reenici. 5. Ponovite korake 3 i 4 dok ne ispravite reenicu; prijeite na Lekciju 2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 2.2: JO BRISANJA ** Otipkajte d$ za brisanje znakova do kraja linije. ** 1. Pritisnite kako bi bili sigurni da je Vim u Normal modu. 2. Pomaknite kursor na liniju oznaenu s --->. 3. Pomaknite kursor do kraja ispravne reenice (POSLJE prve . ). 4. Otipkajte d$ kako bi izbrisali sve znakove do kraja linije. ---> Netko je utipkao kraj ove linije dvaput. kraj ove linije dvaput. 5. Prijeite na Lekciju 2.3 za bolje objanjenje. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 2.3: UKRATKO O OPERATORIMA I POKRETIMA Mnogo naredbi koje mijenjaju tekst se sastoje od operatora i pokreta. Oblik naredbe brisanja sa d operatorom je sljedei: d pokret Pri emu je: d - operator brisanja. pokret - ono na emu e se operacija izvravati (navedeno u nastavku). Kratka lista pokreta: w - sve do poetka sljedee rijei, NE UKLJUUJUI prvo slovo. e - sve do kraja trenutane rijei, UKLJUUJUI zadnje slovo. $ - sve do kraje linije, UKLJUUJUI zadnje slovo. Tipkanjem de e se brisati od kursora do kraja rijei. NAPOMENA: Pritiskajui samo pokrete dok ste u Normal modu bez operatora e pomicati kursor kao to je navedeno. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 2.4: KORITENJE BROJANJA ZA POKRETE ** Tipkanjem nekog broja prije pokreta, pokret se izvrava toliko puta. ** 1. Pomaknite kursor na liniju oznaenu s --->. 2. Otipkajte 2w da pomaknete kursor dvije rijei naprijed. 3. Otipkajte 3e da pomaknete kursor na kraj tree rijei naprijed. 4. Otipkajte 0 (nulu) da pomaknete kursor na poetak linije. 5. Ponovite korake 2 i 3 s nekim drugim brojevima. ---> Reenica sa rijeima po kojoj moete pomicati kursor. 6. Prijeite na Lekciju 2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 2.5: KORITENJE BROJANJA ZA VEE BRISANJE ** Tipkanje broja N s operatorom ponavlja ga N-puta. ** U kombinaciji operatora brisanja i pokreta spomenutih iznad ubacujete broj prije pokreta kako bi izbrisali vie znakova: d broj pokret 1. Pomaknite kursor na prvo slovo u rijei sa VELIKIM SLOVIMA oznaenu s --->. 2. Otipkajte 2dw da izbriete dvije rijei sa VELIKIM SLOVIMA 3. Ponovite korake 1 i 2 sa razliitim brojevima da izbriete uzastopne rijei sa VELIKIM SLOVIMA sa samo jednom naredbom. ---> ova ABC DE linija FGHI JK LMN OP rijei je RS TUVZ popravljena. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 2.6: OPERIRANJE NAD LINIJAMA ** Otipkajte dd za brisanje cijele linije. ** Zbog uestalosti brisanja cijelih linija, dizajneri Vi-a su odluili da je lake brisati linije tipkanjem d dvaput. 1. Pomaknite kursor na drugu liniju u donjoj kitici. 2. Otipkajte dd kako bi izbrisali liniju. 3. Pomaknite kursor na etvrtu liniju. 4. Otipkajte 2dd kako bi izbrisali dvije linije. ---> 1) Rue su crvene, ---> 2) Plaa je super, ---> 3) Ljubice su plave, ---> 4) Imam auto, ---> 5) Satovi ukazuju vrijeme, ---> 6) eer je sladak ---> 7) Kao i ti. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 2.7: NAREDBA PONITENJA ** Pritisnite u za ponitenje zadnje naredbe, U za cijelu liniju. ** 1. Pomaknite kursor na liniju oznaenu s ---> i postavite kursor na prvu pogreku. 2. Otipkajte x kako bi izbrisali prvi neeljeni znak. 3. Otipkajte u kako bi ponitili zadnju izvrenu naredbu. 4. Ovaj put ispravite sve pogreke na liniji koristei x naredbu. 5. Sada utipkajte veliko U kako bi ponitili sve promjene na liniji, vraajui je u prijanje stanje. 6. Sada utipkajte u nekoliko puta kako bi ponitili U i prijanje naredbe. 7. Sada utipkajte CTRL-R (drei CTRL tipku pritisnutom dok ne pritisnete R) nekoliko puta kako bi vratili promjene (ponitili ponitenja). ---> Poopravite pogreke nna ovvoj liniji ii poonititeee ih. 8. Vrlo korisne naredbe. Prijeite na saetak Lekcije 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 2 SAETAK 1. Brisanje od kursora do sljedee rijei: dw 2. Brisanje od kursora do kraja linije: d$ 3. Brisanje cijele linije: dd 4. Za ponavljanje pokreta prethodite mu broj: 2w 5. Oblik naredbe mijenjanja: operator [broj] pokret gdje je: operator - to napraviti, npr. d za brisanje [broj] - neobavezan broj ponavljanja pokreta pokret - kretanje po tekstu po kojem se operira, kao to je: w (rije), $ (kraj linije), itd. 6. Postavljanje kursora na poetak linije: 0 7. Za ponitenje prethodnih promjena, pritisnite: u (malo u) Za ponitenje svih promjena na liniji, pritisnite: U (veliko U) Za vraanja promjena, utipkajte: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 3.1: NAREDBA POSTAVI ** p za unos prethodno izbrisanog teksta iza kursora. ** 1. Pomaknite kursor na prvu sljedeu liniju oznaenu s --->. 2. Otipkajte dd kako bi izbrisali liniju i spremili je u Vim registar. 3. Pomaknite kursor na liniju c), IZNAD linije koju trebate unijeti. 4. Otipkajte p kako bi postavili liniju ispod kursora. 5. Ponovite korake 2 do 4 kako bi postavili sve linije u pravilnom rasporedu. ---> d) Moe li i ti nauiti? ---> b) Ljubice su plave, ---> c) Inteligencija je nauena, ---> a) Rue su crvene, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 3.2: NAREDBA PROMJENE ** Otipkajte rx za zamjenu slova ispod kursora sa slovom x . ** 1. Pomaknite kursor na prvu sljedeu liniju oznaenu s --->. 2. Pomaknite kursor tako da se nalazi na prvoj pogreci. 3. Otipkajte r i nakon toga ispravan znak na tom mjestu. 4. Ponovite korake 2 i 3 sve dok prva linije ne bude istovjetna drugoj. ---> Kede ju ovu limija tupjana, natko je protuskao kruve tupke! ---> Kada je ova linija tipkana, netko je pritiskao krive tipke! 5. Prijeite na Lekciju 3.2. NAPOMENA: Prisjetite da trebate uiti vjebanjem, ne pamenjem. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 3.3: OPERATOR MIJENJANJA ** Za mijenjanje do kraja rijei, istipkajte ce . ** 1. Pomaknite kursor na prvu sljedeu liniju oznaenu s --->. 2. Postavite kursor na a u lackmb. 3. Otipkajte ce i ispravite rije (u ovom sluaju otipkajte inija ). 4. Pritisnite i pomaknite kursor na sljedei znak kojeg je potrebno ispraviti. 5. Ponovite korake 3 i 4 sve dok prva reenica ne postane istovjetna drugoj. ---> Ova lackmb ima nekoliko rjlcah koje trfcb mijdmlfsz. ---> Ova linija ima nekoliko rijei koje treba mijenjati. Primijetite da ce brie rije i postavlja Vim u Insert mod. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 3.4: JO MIJENJANJA KORITENJEM c ** Naredba mijenjanja se koristi sa istim pokretima kao i brisanje. ** 1. Operator mijenjanja se koristi na isti nain kao i operator brisanja: c [broj] pokret 2. Pokreti su isti, npr: w (rije) i $ (kraj linije). 3. Pomaknite kursor na prvu sljedeu liniju oznaenu s --->. 4. Pomaknite kursor na prvu pogreku. 5. Otipkajte c$ i utipkajte ostatak linije tako da bude istovjetna drugoj te pritisnite . ---> Kraj ove linije treba pomo tako da izgleda kao linija ispod. ---> Kraj ove linije treba ispraviti koritenjem c$ naredbe. NAPOMENA: Moete koristiti Backspace za ispravljanje greaka. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 3 SAETAK 1. Za postavljanje teksta koji je upravo izbrisan, pritisnite p . Ovo postavlja tekst IZA kursora (ako je pak linija izbrisana tekst se postavlja na liniju ispod kursora). 2. Za promjenu znaka na kojem se nalazi kursor, pritisnite r i nakon toga eljeni znak. 3. Operator mijenjanja dozvoljava promjenu teksta od kursora do pozicije do koje dovede pokret. tj. Otipkajte ce za mijenjanje od kursora do kraja rijei, c$ za mijenjanje od kursora do kraja linije. 4. Oblik naredbe mijenjanja: c [broj] pokret Prijeite na sljedeu lekciju. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 4.1: POZICIJA KURSORA I STATUS DATOTEKE ** CTRL-G za prikaz pozicije kursora u datoteci i status datoteke. Pritisnite G za pomicanje kursora na neku liniju u datoteci. ** NAPOMENA: Proitajte cijelu lekciju prije izvrenja bilo kojeg koraka!! 1. Drite Ctrl tipku pritisnutom i pritisnite g . Ukratko: CTRL-G. Vim e ispisati poruku na dnu ekrana sa imenom datoteke i pozicijom kursora u datoteci. Zapamtite broj linije za 3. korak. NAPOMENA: Moete vidjeti poziciju kursora u donjem desnom kutu ako je postavka 'ruler' aktivirana (objanjeno u 6. lekciji). 2. Pritisnite G za pomicanje kursora na kraj datoteke. Otipkajte gg za pomicanje kursora na poetak datoteke. 3. Otipkajte broj linije na kojoj ste bili maloprije i zatim G . Kursor e se vratiti na liniju na kojoj se nalazio kada ste otipkali CTRL-G. 4. Ako ste spremni, izvrite korake od 1 do 3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 4.2: NAREDBE TRAENJA ** Otipkajte / i nakon toga izraz kojeg elite traiti. ** 1. U Normal modu otipkajte / znak. Primijetite da se znak pojavio zajedno sa kursorom na dnu ekrana kao kod : naredbe. 2. Sada otipkajte 'grrrreka' . To je rije koju zapravo traite. 3. Za ponovno traenje istog izraza, otipkajte n . Za traenje istog izraza ali u suprotnom smjeru, otipkajte N . 4. Za traenje izraza unatrag, koristite ? umjesto / . 5. Za povratak na prethodnu poziciju koristite CTRL-O (drite Ctrl pritisnutim dok ne pritisnete tipku o). Ponavljajte sve dok se ne vratite na poetak. CTRL-I slino kao CTRL-O ali u suprotnom smjeru. ---> "pogrrrreka" je pogreno; umjesto pogrrrreka treba stajati pogreka. NAPOMENA: Ako se traenjem doe do kraja datoteke nastavit e se od njenog poetka osim ako je postavka 'wrapscan' deaktivirana. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 4.3: TRAENJE PRIPADAJUE ZAGRADE ** Otipkajte % za pronalazak pripadajue ), ] ili } . ** 1. Postavite kursor na bilo koju od ( , [ ili { otvorenih zagrada u liniji oznaenoj s --->. 2. Otipkajte znak % . 3. Kursor e se pomaknuti na pripadajuu zatvorenu zagradu. 4. Otipkajte % kako bi pomakli kursor na drugu pripadajuu zagradu. 5. Pomaknite kursor na neku od (,),[,],{ ili } i ponovite % naredbu. ---> Linija ( testiranja obinih ( [ uglatih ] i { vitiastih } zagrada.)) NAPOMENA: Vrlo korisno u ispravljanju koda sa nepripadajuim zagradama! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 4.4: NAREDBE ZAMIJENE ** Otipkajte :s/staro/novo/g da zamijenite 'staro' za 'novo'. ** 1. Pomaknite kursor na liniju oznaenu s --->. 2. Otipkajte :s/cvr/cvr . Primjetite da ova naredba zamjenjuje samo prvi "cvr" u liniji. 3. Otipkajte :s/cvr/cvr/g . Dodavanje g stavke znai da e se naredba izvriti na cijeloj liniji, zamjenjivanjem svih "cvr" u liniji. ---> i cvri cvri cvrak na voru crne smre. 4. Za zamjenu svih izraza u rasponu dviju linija, otipkajte :#,#s/staro/novo/g #,# su brojevi linije datoteke na kojima te izmeu njih e se izvriti zamjena. Otipkajte :%s/staro/novo/g za zamjenu svih izraza u cijeloj datoteci. Otipkajte :%s/staro/novo/gc za pronalazak svakog izraza u datoteci i potvrdu zamjene. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 4 SAETAK 1. CTRL-G prikazuje poziciju kursora u datoteci i status datoteke. G postavlja kursor na zadnju liniju datoteke. broj G postavlja kursor na broj liniju. gg postavlja kursor na prvu liniju. 2. Tipkanje / sa izrazom trai UNAPRIJED taj izraz. Tipkanje ? sa izrazom trai UNATRAG taj izraz. Nakon naredbe traenja koristite n za pronalazak izraza u istom smjeru, i N za pronalazak istog izraza ali u suprotnom smjeru. CTRL-O vraa kursor na prethodnu poziciju, CTRL-I na sljedeu poziciju. 3. Tipkanje % dok je kursor na zagradi pomie ga na pripadajuu zagradu. 4. Za zamjenu prvog izraza staro za izraz novo :s/staro/novo Za zamjenu svih izraza staro na cijeloj liniji :s/staro/novo/g Za zamjenu svih izraza staro u rasponu linija #,# :#,#s/staro/novo/g Za zamjenu u cijeloj datoteci :%s/staro/novo/g Za potvrdu svake zamjene dodajte 'c' :%s/staro/novo/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 5.1: IZVRAVANJE VANJSKIH NAREDBI ** Otipkajte :! sa vanjskom naredbom koju elite izvriti. ** 1. Otipkajte poznatu naredbu : kako bi kursor premjestili na dno ekrana. Time omoguavate unos naredbe u naredbenoj liniji. 2. Otipkajte znak ! (usklinik). Tako omoguavate izvravanje naredbe vanjske ljuske. 3. Kao primjer otipkajte ls nakon ! te pritisnite . Ovo e prikazati sadraj direktorija, kao da ste u ljusci. Koristite :!dir ako :!ls ne radi. NAPOMENA: Mogue je izvravati bilo koju vanjsku naredbu na ovaj nain, zajedno sa njenim argumentima. NAPOMENA: Sve : naredbe se izvravaju nakon to pritisnete U daljnjem tekstu to nee uvijek biti napomenuto. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 5.2: VIE O SPREMANJU DATOTEKA ** Za spremanje promjena, otipkajte :w IME_DATOTEKE. ** 1. Otipkajte :!dir ili :!ls za pregled direktorija. Ve znate da morate pritisnuti na kraju tipkanja. 2. Izaberite ime datoteke koja jo ne postoji, npr. TEST. 3. Otipkajte: :w TEST (gdje je TEST ime koje ste prethodno odabrali.) 4. Time e te spremiti cijelu datoteku (Vim Tutor) pod imenom TEST. Za provjeru, otipkajte ponovno :!dir ili :!ls za pregled direktorija. NAPOMENA: Ako bi napustili Vim i ponovno ga pokrenuli sa vim TEST , datoteka bi bila potpuna kopija ove datoteke u trenutku kada ste je spremili. 5. Izbriite datoteku tako da otipkate (MS-DOS): :!del TEST ili (Unix): :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 5.3: SPREMANJE OZNAENOG TEKSTA ** Kako bi spremili dio datoteke, otipkajte v pokret :w IME_DATOTEKE ** 1. Pomaknite kursor na ovu liniju. 2. Pritisnite v i pomaknite kursor pet linija ispod ove. Primijetite promjenu, oznaeni tekst se razlikuje od obinog. 3. Pritisnite : znak. Na dnu ekrana pojavit e se :'<,'> . 4. Otipkajte w TEST , pritom je TEST ime datoteke koja jo ne postoji. Provjerite da zaista pie :'<,'>w TEST prije nego to pritisnite . 5. Vim e spremiti oznaeni tekst u TEST. Provjerite sa :!dir ili :!ls . Nemojte je jo brisati! Koristiti e te je u sljedeoj lekciji. NAPOMENA: Tipka v zapoinje Vizualno oznaavanje. Moete pomicati kursor unaokolo kako bi mijenjali veliinu oznaenog teksta. Moete koristiti i operatore. Npr, d e izbrisati oznaeni tekst. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 5.4: UITAVANJE DATOTEKA ** Za ubacivanje sadraja datoteke, otipkajte :r IME_DATOTEKE ** 1. Postavite kursor iznad ove linije. NAPOMENA: Nakon to izvrite 2. korak vidjeti e te tekst iz Lekcije 5.3. Stoga pomaknite kursor DOLJE kako bi ponovno vidjeli ovu lekciju. 2. Uitajte vau TEST datoteku koristei naredbu :r TEST gdje je TEST ime datoteke koju ste koristili u prethodnoj lekciji. Sadraj uitane datoteke je ubaen liniju ispod kursora. 3. Kako bi provjerili da je datoteka uitana, vratite kursor unatrag i primijetite dvije kopije Lekcije 5.3, originalnu i onu iz datoteke. NAPOMENA: Moete takoer uitati ispis vanjske naredbe. Npr, :r !ls e uitati ispis ls naredbe i postaviti ispis liniju ispod kursora. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 5 SAETAK 1. :!naredba izvrava vanjsku naredbu. Korisni primjeri: (MS-DOS) (Unix) :!dir :!ls - pregled direktorija. :!del DATOTEKA :!rm DATOTEKA - brie datoteku DATOTEKA. 2. :w DATOTEKA zapisuje trenutanu datoteku na disk sa imenom DATOTEKA. 3. v pokret :w IME_DATOTEKE sprema vizualno oznaene linije u datoteku IME_DATOTEKE. 4. :r IME_DATOTEKE uitava datoteku IME_DATOTEKE sa diska i stavlja njen sadraj liniju ispod kursora. 5. :r !dir uitava ispis naredbe dir i postavlja sadraj ispisa liniju ispod kursora. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 6.1: NAREDBA OTVORI ** Pritisnite o kako bi otvorili liniju ispod kursora i preli u Insert mod. ** 1. Pomaknite kursor na sljedeu liniju oznaenu s --->. 2. Otipkajte malo o kako bi otvorili novu liniju ISPOD kursora i preli u Insert mod. 3. Otipkajte neto teksta i nakon toga pritisnite kako bi napustili Insert mod. ---> Nakon to pritisnete o kursor e prei u novu liniju u Insert mod. 4. Za otvaranje linije IZNAD kursora, otipkajte umjesto malog o veliko O , Pokuajte na donjoj liniji oznaenoj s --->. ---> Otvorite liniju iznad ove - otipkajte O dok je kursor na ovoj liniji. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 6.2: NAREDBA DODAJ ** Otipkajte a za dodavanje teksta IZA kursora. ** 1. Pomaknite kursor na poetak sljedee linije oznaene s --->. 2. Tipkajte e dok se kursor ne nalazi na kraju li . 3. Otipkajte a (malo) kako bi dodali tekst IZA kursora. 4. Dopunite rije kao to je na liniji ispod. Pritisnite za izlaz iz Insert moda. 5. Sa e prijeite na sljedeu nepotpunu rije i ponovite korake 3 i 4. ---> Ova li omoguava vje dodav teksta nekoj liniji. ---> Ova linija omoguava vjebanje dodavanja teksta nekoj liniji. NAPOMENA: Sa i, a, i A prelazite u isti Insert mod, jedina razlika je u poziciji od koje e se tekst ubacivati. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 6.3: DRUGI NAIN MIJENJANJA ** Otipkajte veliko R kako bi zamijelili vie od jednog znaka. ** 1. Pomaknite kursor na prvu sljedeu liniju oznaenu s --->. Pomaknite kursor na poetak prvog xxx . 2. Pritisnite R i otipkajte broj koji je liniju ispod, tako da zamijeni xxx . 3. Pritisnite za izlaz iz Replace moda. Primijetite da je ostatak linije ostao nepromjenjen. 5. Ponovite korake kako bi zamijenili preostali xxx. ---> Zbrajanje: 123 plus xxx je xxx. ---> Zbrajanje: 123 plus 456 je 579. NAPOMENA: Replace mod je kao Insert mod, ali sa bitnom razlikom, svaki otipkani znak brie ve postojei. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 6.4: KOPIRANJE I LIJEPLJENJE TEKSTA ** Koristite y operator za kopiranje a p za lijepljenje teksta. ** 1. Pomaknite kursor na liniju s ---> i postavite kursor nakon "a)". 2. Pokrenite Visual mod sa v i pomaknite kursor sve do ispred "prva". 3. Pritisnite y kako bi kopirali oznaeni tekst. 4. Pomaknite kursor do kraja sljedee linije: j$ 5. Pritisnite p kako bi zalijepili tekst. Onda utipkajte: druga . 6. Koristite Visual mod kako bi oznaili " linija.", kopirajte: y , kursor postavite na kraj sljedee linije: j$ i ondje zalijepite tekst: p . ---> a) ovo je prva linija. b) NAPOMENA: moete koristiti y kao operator; yw kopira jednu rije. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 6.5: MIJENJANJE POSTAVKI ** Postavka: naredbe traenja i zamijene ne razlikuju VELIKA i mala slova ** 1. Potraite 'razlika' tipkanjem: /razlika Nekoliko puta ponovite pritiskanjem n . 2. Aktivirajte 'ic' (Ignore case) postavku: :set ic 3. Ponovno potraite 'razlika' tipkanjem n Primijetite da su sada i RAZLIKA i Razlika pronaeni. 4. Aktivirajte 'hlsearch' i 'incsearch' postavke: :set hls is 5. Otipkajte naredbu traenja i primijetite razlike: /razlika 6. Za deaktiviranje ic postavke koristite: :set noic NAPOMENA: Za neoznaavanje pronaenih izraza otipkajte: :nohlsearch NAPOMENA: Bez razlikovanja velikih i malih slova u samo jednoj naredbi koristite \c u izrazu: /razlika\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 6 SAETAK 1. Pritisnite o za otvaranje linije ISPOD kursora i prelazak u Insert mod. Pritisnite O za otvaranje linije IZNAD kursora. 2. Pritisnite a za unos teksta IZA kursora. Pritisnite A za unos teksta na kraju linije. 3. Naredba e pomie kursor na kraj rijei. 4. Operator y kopira tekst, p ga lijepi. 5. Tipkanjem velikog R Vim prelazi u Replace mod dok ne pritisnete . 6. Tipkanjem ":set xxx" aktivira postavku "xxx". Neke postavke su: 'ic' 'ignorecase' ne razlikuje velika/mala slova pri traenju 'is' 'incsearch' trai nedovrene izraze 'hls' 'hlsearch' oznai sve pronaene izraze Moete koristite dugo ili kratko ime postavke. 7. Prethodite "no" imenu postavke za deaktiviranje iste: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 7.1: DOBIVANJE POMOI ** Koristite on-line sustav pomoi ** Vim ima detaljan on-line sustav pomoi. Za poetak, pokuajte jedno od sljedeeg: - pritisnite tipku (ako je vaa tipkovnica ima) - pritisnite tipku (ako je vaa tipkovnica ima) - utipkajte :help Proitajte tekst u prozoru pomoi kako bi ste se znali sluiti istom. Tipkanjem CTRL-W CTRL-W prelazite iz jednog prozora u drugi. Otipkajte :q kako bi zatvorili prozor pomoi. Pronai e te pomo o bilo kojoj temi, tako da dodate upit samoj ":help" naredbi. Pokuajte (ne zaboravite pritisnuti ): :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 7.2: PRAVLJENJE SKRIPTE ** Aktivirajte Vim mogunosti ** Vim ima mnogo vie alata od Vi-ja, ali veina njih nije aktivirana. Kako bi mogli koristiti vie mogunosti napravite "vimrc" datoteku. 1. Uredite "vimrc" datoteku. Ovo ovisi o vaem sistemu: :e ~/.vimrc za Unix :e $VIM/_vimrc za MS-Windows 2. Sada uitajte primjer sadraja "vimrc" datoteke: :r $VIMRUNTIME/vimrc_example.vim 3. Sauvajte datoteku sa: :w Sljedeeg puta kada pokrenete Vim, bojanje sintakse teksta biti e aktivirano. Sve vae postavke moete dodati u "vimrc" datoteku. Za vie informacija otipkajte :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 7.3: AUTOMATSKO DOVRAVANJE ** Dovravanje iz naredbene linije pomou CTRL-D i ** 1. Provjerite da Vim nije u Vi modu: :set nocp 2. Pogledajte koje datoteke postoje u direktoriju: :!ls or :!dir 3. Otipkajte poetak naredbe: :e 4. Tipkajte CTRL-D i prikazati e se lista naredbi koje zapoinju sa "e". 5. Pritisnite i Vim e dopuniti unos u naredbu ":edit". 6. Dodajte razmak i poetak datoteke: :edit FIL 7. Pritisnite . Vim e nadopuniti ime datoteke (ako je jedinstveno). NAPOMENA: Mogue je dopuniti mnoge naredbe. Koristite CTRL-D i . Naroito je korisno za :help naredbe. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 7 SAETAK 1. Otipkajte :help ili pritisnite ili za pomo. 2. Otipkajte :help naredba kako bi dobili pomo za naredba . 3. Otipkajte CTRL-W CTRL-W za prelazak u drugi prozor 4. Otipkajte :q kako bi zatvorili prozor pomoi 5. Napravite vimrc skriptu za podizanje kako bi u nju spremali vae omiljene postavke. 6. Kada tipkate naredbu koja zapoinje sa : pritisnite CTRL-D kako bi vidjeli mogue valjane vrijednosti. Pritisnite kako bi odabrali jednu od njih. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Kraj. Cilj prirunika je da pokae kratak pregled Vim editora, tek toliko da omogui njegovo koritenje. Prirunik nije potpun jer Vim ima mnogo vie naredbi. Za vie informacija: ":help user-manual". Za itanje i koritenje, preporuamo: Vim - Vi Improved - by Steve Oualline Izdava: New Riders Prva knjiga potpuno posveena Vim-u. Vrlo korisna za poetnike. Sa mnogo primjera i slika. Posjetite http://iccf-holland.org/click5.html Sljedea knjiga je neto starija i vie o Vi-u nego o Vim-u, preporuamo: Learning the Vi Editor - by Linda Lamb Izdava: O'Reilly & Associates Inc. Solidna knjiga, moete saznati skoro sve to moete napraviti u Vi-u. esto izdanje ima neto informacija i o Vim-u. Ovaj prirunik su napisali: Michael C. Pierce i Robert K. Ware, Colorado School of Mines koristei ideje Charles Smith, Colorado State University. E-pota: bware@mines.colorado.edu. Naknadne promjene napravio je Bram Moolenaar. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Preveo na hrvatski: Paul B. Mahol Preinaka 1.42, Lipanj 2008 vim-7.4.1689/runtime/tutor/tutor.hr.cp1250000066400000000000000000001021651267703067000200630ustar00rootroot00000000000000=============================================================================== = D o b r o d o l i u VIM p r i r u n i k - Verzija 1.7 = =============================================================================== Vim je vrlo moan editor koji ima mnogo naredbi, previe da bi ih se svih ovdje spomenulo. Namjena prirunika je objasniti dovoljno naredbi kako bi poetnici znatno lake koristili ovaj svestran editor. Priblino vrijeme potrebno za uspjean zavretak prirunika je oko 30 minuta a ovisi o tome koliko e te vremena odvojiti za vjebanje. UPOZORENJE: Naredbe u ovom priruniku e promijeniti ovaj tekst. Napravite kopiju ove datoteke kako bi ste na istoj vjebali (ako ste pokrenuli "vimtutor" ovo je ve kopija). Vrlo je vano primijetiti da je ovaj prirunik namijenjen za vjebanje. Preciznije, morate izvriti naredbe u Vim-u kako bi ste iste nauili pravilno koristiti. Ako samo itate tekst, zaboraviti e te naredbe! Ako je CapsLock ukljuen ISKLJUITE ga. Pritiskajte tipku j kako bi pomakli kursor sve dok Lekcija 1.1 ne ispuni ekran. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1.1: POMICANJE KURSORA ** Za pomicanje kursora, pritisnite h,j,k,l tipke kako je prikazano ** ^ k Savjet: h tipka je lijevo i pomie kursor lijevo. < h l > l tipka je desno i pomie kursor desno. j j izgleda kao strelica usmjerena dolje. v 1. Pomiite kursor po ekranu dok se ne naviknete na koritenje. 2. Drite tipku (j) pritisnutom. Sada znate kako doi do sljedee lekcije. 3. Koristei tipku j prijeite na sljedeu lekciju 1.2. NAPOMENA: Ako niste sigurni to ste zapravo pritisnuli uvijek koristite tipku kako bi preli u Normal mod i onda pokuajte ponovno. NAPOMENA: Kursorske tipke rade isto. Koritenje hjkl tipaka je znatno bre, nakon to se jednom naviknete na njihovo koritenje. Stvarno! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1.2: IZLAZ IZ VIM-a !! UPOZORENJE: Prije izvoenja bilo kojeg koraka, proitajte cijelu lekciju!! 1. Pritisnite tipku (Vim je sada u Normal modu). 2. Otipkajte: :q! . Izlaz iz editora, GUBE se sve napravljene promjene. 3. Kada se pojavi ljuska, utipkajte naredbu koja je pokrenula ovaj prirunik: vimtutor 4. Ako ste upamtili ove korake, izvrite ih redom od 1 do 3 kako bi ponovno pokrenuli editor. NAPOMENA: :q! ponitava sve promjene koje ste napravili. U sljedeim lekcijama nauit e te kako promjene sauvati. 5. Pomaknite kursor na Lekciju 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1.3: PROMJENA TEKSTA - BRISANJE ** Pritisnite x za brisanje znaka pod kursorom. ** 1. Pomaknite kursor na liniju oznaenu s --->. 2. Kako bi ste ispravili pogreke, pomiite kursor dok se ne bude nalazio na slovu kojeg trebate izbrisati. 3. Pritisnite tipku x kako bi uklonili neeljeno slovo. 4. Ponovite korake od 2 do 4 dok ne ispravite sve pogreke. ---> KKKravaa jee presskoila mmjeseccc. 5. Nakon to ispravite liniju, prijeite na lekciju 1.4. NAPOMENA: Koristei ovaj prirunik ne pokuavajte pamtiti ve uite primjenom. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1.4: PROMJENA TEKSTA - UBACIVANJE ** Pritisnite i za ubacivanje teksta ispred kursora. ** 1. Pomaknite kursor na prvu sljedeu liniju oznaenu s --->. 2. Kako bi napravili prvu liniju istovjetnoj drugoj, pomaknite kursor na prvi znak POSLIJE kojeg e te utipkati potreban tekst. 3. Pritisnite i te utipkajte potrebne nadopune. 4. Nakon to ispravite pogreku pritisnite kako bi vratili Vim u Normal mod. Ponovite korake od 2 do 4 kako bi ispravili sve pogreke. ---> Nedje no teka od v lin. ---> Nedostaje neto teksta od ove linije. 5. Prijeite na sljedeu lekciju. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1.5: PROMJENA TEKSTA - DODAVANJE ** Pritisnite A za dodavanje teksta. ** 1. Pomaknite kursor na prvu sljedeu liniju oznaenu s --->. Nije vano na kojem se slovu nalazi kursor na toj liniji. 2. Pritisnite A i napravite potrebne promjene. 3. Nakon to ste dodali tekst, pritisnite za povratak u Normal mod. 4. Pomaknite kursor na drugu liniju oznaenu s ---> i ponovite korake 2 i 3 dok ne popravite tekst. ---> Ima neto teksta koji nedostaje n Ima neto teksta koji nedostaje na ovoj liniji. ---> Ima neto teksta koji ne Ima neto teksta koji nedostaje ba ovdje. 5. Prijeite na lekciju 1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1.6: PROMJENA DATOTEKE ** Koristite :wq za spremanje teksta i naputanje Vim-a. ** !! UPOZORENJE: Prije izvravanja bilo kojeg koraka, proitajte lekciju!! 1. Izaite iz programa kao sto ste napravili u lekciji 1.2: :q! 2. Iz ljuske utipkajte sljedeu naredbu: vim tutor 'vim' je naredba pokretanja Vim editora, 'tutor' je ime datoteke koju elite ureivati. Koristite datoteku koju imate ovlasti mijenjati. 3. Ubacite i izbriite tekst kao to ste to napravili u lekcijama prije. 4. Sauvajte promjenjeni tekst i izaite iz Vim-a: :wq 5. Ponovno pokrenite vimtutor i nastavite itati saetak koji sljedi. 6. Nakon sto proitate gornje korake i u potpunosti ih razumijete: izvrite ih. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1 SAETAK 1. Kursor se pomie strelicama ili pomou hjkl tipaka. h (lijevo) j (dolje) k (gore) l (desno) 2. Pokretanje Vim-a iz ljuske: vim IME_DATOTEKE 3. Izlaz: :q! sve promjene su izgubljene. ILI: :wq promjene su sauvane. 4. Brisanje znaka na kojem se nalazi kursor: x 5. Ubacivanja ili dodavanje teksta: i utipkajte tekst unos ispred kursora A utipkajte tekst dodavanje na kraju linije NAPOMENA: Tipkanjem tipke prebacuje Vim u Normal mod i prekida neeljenu ili djelomino zavrenu naredbu. Nastavite itati Lekciju 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 2.1: NAREDBE BRISANJA ** Tipkajte dw za brisanje rijei. ** 1. Pritisnite kako bi bili sigurni da je Vim u Normal modu. 2. Pomaknite kursor na liniju oznaenu s --->. 3. Pomaknite kursor na poetak rijei koju treba izbrisati. 4. Otipkajte dw kako bi uklonili rije. NAPOMENA: Vim e prikazati slovo d na zadnjoj liniji kad ga otipkate. Vim eka da otipkate w . Ako je prikazano neko drugo slovo, krivo ste otipkali; pritisnite i pokuajte ponovno. ---> Neke rijei smijeno ne pripadaju na papir ovoj reenici. 5. Ponovite korake 3 i 4 dok ne ispravite reenicu; prijeite na Lekciju 2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 2.2: JO BRISANJA ** Otipkajte d$ za brisanje znakova do kraja linije. ** 1. Pritisnite kako bi bili sigurni da je Vim u Normal modu. 2. Pomaknite kursor na liniju oznaenu s --->. 3. Pomaknite kursor do kraja ispravne reenice (POSLJE prve . ). 4. Otipkajte d$ kako bi izbrisali sve znakove do kraja linije. ---> Netko je utipkao kraj ove linije dvaput. kraj ove linije dvaput. 5. Prijeite na Lekciju 2.3 za bolje objanjenje. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 2.3: UKRATKO O OPERATORIMA I POKRETIMA Mnogo naredbi koje mijenjaju tekst se sastoje od operatora i pokreta. Oblik naredbe brisanja sa d operatorom je sljedei: d pokret Pri emu je: d - operator brisanja. pokret - ono na emu e se operacija izvravati (navedeno u nastavku). Kratka lista pokreta: w - sve do poetka sljedee rijei, NE UKLJUUJUI prvo slovo. e - sve do kraja trenutane rijei, UKLJUUJUI zadnje slovo. $ - sve do kraje linije, UKLJUUJUI zadnje slovo. Tipkanjem de e se brisati od kursora do kraja rijei. NAPOMENA: Pritiskajui samo pokrete dok ste u Normal modu bez operatora e pomicati kursor kao to je navedeno. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 2.4: KORITENJE BROJANJA ZA POKRETE ** Tipkanjem nekog broja prije pokreta, pokret se izvrava toliko puta. ** 1. Pomaknite kursor na liniju oznaenu s --->. 2. Otipkajte 2w da pomaknete kursor dvije rijei naprijed. 3. Otipkajte 3e da pomaknete kursor na kraj tree rijei naprijed. 4. Otipkajte 0 (nulu) da pomaknete kursor na poetak linije. 5. Ponovite korake 2 i 3 s nekim drugim brojevima. ---> Reenica sa rijeima po kojoj moete pomicati kursor. 6. Prijeite na Lekciju 2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 2.5: KORITENJE BROJANJA ZA VEE BRISANJE ** Tipkanje broja N s operatorom ponavlja ga N-puta. ** U kombinaciji operatora brisanja i pokreta spomenutih iznad ubacujete broj prije pokreta kako bi izbrisali vie znakova: d broj pokret 1. Pomaknite kursor na prvo slovo u rijei sa VELIKIM SLOVIMA oznaenu s --->. 2. Otipkajte 2dw da izbriete dvije rijei sa VELIKIM SLOVIMA 3. Ponovite korake 1 i 2 sa razliitim brojevima da izbriete uzastopne rijei sa VELIKIM SLOVIMA sa samo jednom naredbom. ---> ova ABC DE linija FGHI JK LMN OP rijei je RS TUVZ popravljena. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 2.6: OPERIRANJE NAD LINIJAMA ** Otipkajte dd za brisanje cijele linije. ** Zbog uestalosti brisanja cijelih linija, dizajneri Vi-a su odluili da je lake brisati linije tipkanjem d dvaput. 1. Pomaknite kursor na drugu liniju u donjoj kitici. 2. Otipkajte dd kako bi izbrisali liniju. 3. Pomaknite kursor na etvrtu liniju. 4. Otipkajte 2dd kako bi izbrisali dvije linije. ---> 1) Rue su crvene, ---> 2) Plaa je super, ---> 3) Ljubice su plave, ---> 4) Imam auto, ---> 5) Satovi ukazuju vrijeme, ---> 6) eer je sladak ---> 7) Kao i ti. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 2.7: NAREDBA PONITENJA ** Pritisnite u za ponitenje zadnje naredbe, U za cijelu liniju. ** 1. Pomaknite kursor na liniju oznaenu s ---> i postavite kursor na prvu pogreku. 2. Otipkajte x kako bi izbrisali prvi neeljeni znak. 3. Otipkajte u kako bi ponitili zadnju izvrenu naredbu. 4. Ovaj put ispravite sve pogreke na liniji koristei x naredbu. 5. Sada utipkajte veliko U kako bi ponitili sve promjene na liniji, vraajui je u prijanje stanje. 6. Sada utipkajte u nekoliko puta kako bi ponitili U i prijanje naredbe. 7. Sada utipkajte CTRL-R (drei CTRL tipku pritisnutom dok ne pritisnete R) nekoliko puta kako bi vratili promjene (ponitili ponitenja). ---> Poopravite pogreke nna ovvoj liniji ii poonititeee ih. 8. Vrlo korisne naredbe. Prijeite na saetak Lekcije 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 2 SAETAK 1. Brisanje od kursora do sljedee rijei: dw 2. Brisanje od kursora do kraja linije: d$ 3. Brisanje cijele linije: dd 4. Za ponavljanje pokreta prethodite mu broj: 2w 5. Oblik naredbe mijenjanja: operator [broj] pokret gdje je: operator - to napraviti, npr. d za brisanje [broj] - neobavezan broj ponavljanja pokreta pokret - kretanje po tekstu po kojem se operira, kao to je: w (rije), $ (kraj linije), itd. 6. Postavljanje kursora na poetak linije: 0 7. Za ponitenje prethodnih promjena, pritisnite: u (malo u) Za ponitenje svih promjena na liniji, pritisnite: U (veliko U) Za vraanja promjena, utipkajte: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 3.1: NAREDBA POSTAVI ** p za unos prethodno izbrisanog teksta iza kursora. ** 1. Pomaknite kursor na prvu sljedeu liniju oznaenu s --->. 2. Otipkajte dd kako bi izbrisali liniju i spremili je u Vim registar. 3. Pomaknite kursor na liniju c), IZNAD linije koju trebate unijeti. 4. Otipkajte p kako bi postavili liniju ispod kursora. 5. Ponovite korake 2 do 4 kako bi postavili sve linije u pravilnom rasporedu. ---> d) Moe li i ti nauiti? ---> b) Ljubice su plave, ---> c) Inteligencija je nauena, ---> a) Rue su crvene, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 3.2: NAREDBA PROMJENE ** Otipkajte rx za zamjenu slova ispod kursora sa slovom x . ** 1. Pomaknite kursor na prvu sljedeu liniju oznaenu s --->. 2. Pomaknite kursor tako da se nalazi na prvoj pogreci. 3. Otipkajte r i nakon toga ispravan znak na tom mjestu. 4. Ponovite korake 2 i 3 sve dok prva linije ne bude istovjetna drugoj. ---> Kede ju ovu limija tupjana, natko je protuskao kruve tupke! ---> Kada je ova linija tipkana, netko je pritiskao krive tipke! 5. Prijeite na Lekciju 3.2. NAPOMENA: Prisjetite da trebate uiti vjebanjem, ne pamenjem. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 3.3: OPERATOR MIJENJANJA ** Za mijenjanje do kraja rijei, istipkajte ce . ** 1. Pomaknite kursor na prvu sljedeu liniju oznaenu s --->. 2. Postavite kursor na a u lackmb. 3. Otipkajte ce i ispravite rije (u ovom sluaju otipkajte inija ). 4. Pritisnite i pomaknite kursor na sljedei znak kojeg je potrebno ispraviti. 5. Ponovite korake 3 i 4 sve dok prva reenica ne postane istovjetna drugoj. ---> Ova lackmb ima nekoliko rjlcah koje trfcb mijdmlfsz. ---> Ova linija ima nekoliko rijei koje treba mijenjati. Primijetite da ce brie rije i postavlja Vim u Insert mod. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 3.4: JO MIJENJANJA KORITENJEM c ** Naredba mijenjanja se koristi sa istim pokretima kao i brisanje. ** 1. Operator mijenjanja se koristi na isti nain kao i operator brisanja: c [broj] pokret 2. Pokreti su isti, npr: w (rije) i $ (kraj linije). 3. Pomaknite kursor na prvu sljedeu liniju oznaenu s --->. 4. Pomaknite kursor na prvu pogreku. 5. Otipkajte c$ i utipkajte ostatak linije tako da bude istovjetna drugoj te pritisnite . ---> Kraj ove linije treba pomo tako da izgleda kao linija ispod. ---> Kraj ove linije treba ispraviti koritenjem c$ naredbe. NAPOMENA: Moete koristiti Backspace za ispravljanje greaka. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 3 SAETAK 1. Za postavljanje teksta koji je upravo izbrisan, pritisnite p . Ovo postavlja tekst IZA kursora (ako je pak linija izbrisana tekst se postavlja na liniju ispod kursora). 2. Za promjenu znaka na kojem se nalazi kursor, pritisnite r i nakon toga eljeni znak. 3. Operator mijenjanja dozvoljava promjenu teksta od kursora do pozicije do koje dovede pokret. tj. Otipkajte ce za mijenjanje od kursora do kraja rijei, c$ za mijenjanje od kursora do kraja linije. 4. Oblik naredbe mijenjanja: c [broj] pokret Prijeite na sljedeu lekciju. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 4.1: POZICIJA KURSORA I STATUS DATOTEKE ** CTRL-G za prikaz pozicije kursora u datoteci i status datoteke. Pritisnite G za pomicanje kursora na neku liniju u datoteci. ** NAPOMENA: Proitajte cijelu lekciju prije izvrenja bilo kojeg koraka!! 1. Drite Ctrl tipku pritisnutom i pritisnite g . Ukratko: CTRL-G. Vim e ispisati poruku na dnu ekrana sa imenom datoteke i pozicijom kursora u datoteci. Zapamtite broj linije za 3. korak. NAPOMENA: Moete vidjeti poziciju kursora u donjem desnom kutu ako je postavka 'ruler' aktivirana (objanjeno u 6. lekciji). 2. Pritisnite G za pomicanje kursora na kraj datoteke. Otipkajte gg za pomicanje kursora na poetak datoteke. 3. Otipkajte broj linije na kojoj ste bili maloprije i zatim G . Kursor e se vratiti na liniju na kojoj se nalazio kada ste otipkali CTRL-G. 4. Ako ste spremni, izvrite korake od 1 do 3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 4.2: NAREDBE TRAENJA ** Otipkajte / i nakon toga izraz kojeg elite traiti. ** 1. U Normal modu otipkajte / znak. Primijetite da se znak pojavio zajedno sa kursorom na dnu ekrana kao kod : naredbe. 2. Sada otipkajte 'grrrreka' . To je rije koju zapravo traite. 3. Za ponovno traenje istog izraza, otipkajte n . Za traenje istog izraza ali u suprotnom smjeru, otipkajte N . 4. Za traenje izraza unatrag, koristite ? umjesto / . 5. Za povratak na prethodnu poziciju koristite CTRL-O (drite Ctrl pritisnutim dok ne pritisnete tipku o). Ponavljajte sve dok se ne vratite na poetak. CTRL-I slino kao CTRL-O ali u suprotnom smjeru. ---> "pogrrrreka" je pogreno; umjesto pogrrrreka treba stajati pogreka. NAPOMENA: Ako se traenjem doe do kraja datoteke nastavit e se od njenog poetka osim ako je postavka 'wrapscan' deaktivirana. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 4.3: TRAENJE PRIPADAJUE ZAGRADE ** Otipkajte % za pronalazak pripadajue ), ] ili } . ** 1. Postavite kursor na bilo koju od ( , [ ili { otvorenih zagrada u liniji oznaenoj s --->. 2. Otipkajte znak % . 3. Kursor e se pomaknuti na pripadajuu zatvorenu zagradu. 4. Otipkajte % kako bi pomakli kursor na drugu pripadajuu zagradu. 5. Pomaknite kursor na neku od (,),[,],{ ili } i ponovite % naredbu. ---> Linija ( testiranja obinih ( [ uglatih ] i { vitiastih } zagrada.)) NAPOMENA: Vrlo korisno u ispravljanju koda sa nepripadajuim zagradama! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 4.4: NAREDBE ZAMIJENE ** Otipkajte :s/staro/novo/g da zamijenite 'staro' za 'novo'. ** 1. Pomaknite kursor na liniju oznaenu s --->. 2. Otipkajte :s/cvr/cvr . Primjetite da ova naredba zamjenjuje samo prvi "cvr" u liniji. 3. Otipkajte :s/cvr/cvr/g . Dodavanje g stavke znai da e se naredba izvriti na cijeloj liniji, zamjenjivanjem svih "cvr" u liniji. ---> i cvri cvri cvrak na voru crne smre. 4. Za zamjenu svih izraza u rasponu dviju linija, otipkajte :#,#s/staro/novo/g #,# su brojevi linije datoteke na kojima te izmeu njih e se izvriti zamjena. Otipkajte :%s/staro/novo/g za zamjenu svih izraza u cijeloj datoteci. Otipkajte :%s/staro/novo/gc za pronalazak svakog izraza u datoteci i potvrdu zamjene. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 4 SAETAK 1. CTRL-G prikazuje poziciju kursora u datoteci i status datoteke. G postavlja kursor na zadnju liniju datoteke. broj G postavlja kursor na broj liniju. gg postavlja kursor na prvu liniju. 2. Tipkanje / sa izrazom trai UNAPRIJED taj izraz. Tipkanje ? sa izrazom trai UNATRAG taj izraz. Nakon naredbe traenja koristite n za pronalazak izraza u istom smjeru, i N za pronalazak istog izraza ali u suprotnom smjeru. CTRL-O vraa kursor na prethodnu poziciju, CTRL-I na sljedeu poziciju. 3. Tipkanje % dok je kursor na zagradi pomie ga na pripadajuu zagradu. 4. Za zamjenu prvog izraza staro za izraz novo :s/staro/novo Za zamjenu svih izraza staro na cijeloj liniji :s/staro/novo/g Za zamjenu svih izraza staro u rasponu linija #,# :#,#s/staro/novo/g Za zamjenu u cijeloj datoteci :%s/staro/novo/g Za potvrdu svake zamjene dodajte 'c' :%s/staro/novo/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 5.1: IZVRAVANJE VANJSKIH NAREDBI ** Otipkajte :! sa vanjskom naredbom koju elite izvriti. ** 1. Otipkajte poznatu naredbu : kako bi kursor premjestili na dno ekrana. Time omoguavate unos naredbe u naredbenoj liniji. 2. Otipkajte znak ! (usklinik). Tako omoguavate izvravanje naredbe vanjske ljuske. 3. Kao primjer otipkajte ls nakon ! te pritisnite . Ovo e prikazati sadraj direktorija, kao da ste u ljusci. Koristite :!dir ako :!ls ne radi. NAPOMENA: Mogue je izvravati bilo koju vanjsku naredbu na ovaj nain, zajedno sa njenim argumentima. NAPOMENA: Sve : naredbe se izvravaju nakon to pritisnete U daljnjem tekstu to nee uvijek biti napomenuto. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 5.2: VIE O SPREMANJU DATOTEKA ** Za spremanje promjena, otipkajte :w IME_DATOTEKE. ** 1. Otipkajte :!dir ili :!ls za pregled direktorija. Ve znate da morate pritisnuti na kraju tipkanja. 2. Izaberite ime datoteke koja jo ne postoji, npr. TEST. 3. Otipkajte: :w TEST (gdje je TEST ime koje ste prethodno odabrali.) 4. Time e te spremiti cijelu datoteku (Vim Tutor) pod imenom TEST. Za provjeru, otipkajte ponovno :!dir ili :!ls za pregled direktorija. NAPOMENA: Ako bi napustili Vim i ponovno ga pokrenuli sa vim TEST , datoteka bi bila potpuna kopija ove datoteke u trenutku kada ste je spremili. 5. Izbriite datoteku tako da otipkate (MS-DOS): :!del TEST ili (Unix): :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 5.3: SPREMANJE OZNAENOG TEKSTA ** Kako bi spremili dio datoteke, otipkajte v pokret :w IME_DATOTEKE ** 1. Pomaknite kursor na ovu liniju. 2. Pritisnite v i pomaknite kursor pet linija ispod ove. Primijetite promjenu, oznaeni tekst se razlikuje od obinog. 3. Pritisnite : znak. Na dnu ekrana pojavit e se :'<,'> . 4. Otipkajte w TEST , pritom je TEST ime datoteke koja jo ne postoji. Provjerite da zaista pie :'<,'>w TEST prije nego to pritisnite . 5. Vim e spremiti oznaeni tekst u TEST. Provjerite sa :!dir ili :!ls . Nemojte je jo brisati! Koristiti e te je u sljedeoj lekciji. NAPOMENA: Tipka v zapoinje Vizualno oznaavanje. Moete pomicati kursor unaokolo kako bi mijenjali veliinu oznaenog teksta. Moete koristiti i operatore. Npr, d e izbrisati oznaeni tekst. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 5.4: UITAVANJE DATOTEKA ** Za ubacivanje sadraja datoteke, otipkajte :r IME_DATOTEKE ** 1. Postavite kursor iznad ove linije. NAPOMENA: Nakon to izvrite 2. korak vidjeti e te tekst iz Lekcije 5.3. Stoga pomaknite kursor DOLJE kako bi ponovno vidjeli ovu lekciju. 2. Uitajte vau TEST datoteku koristei naredbu :r TEST gdje je TEST ime datoteke koju ste koristili u prethodnoj lekciji. Sadraj uitane datoteke je ubaen liniju ispod kursora. 3. Kako bi provjerili da je datoteka uitana, vratite kursor unatrag i primijetite dvije kopije Lekcije 5.3, originalnu i onu iz datoteke. NAPOMENA: Moete takoer uitati ispis vanjske naredbe. Npr, :r !ls e uitati ispis ls naredbe i postaviti ispis liniju ispod kursora. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 5 SAETAK 1. :!naredba izvrava vanjsku naredbu. Korisni primjeri: (MS-DOS) (Unix) :!dir :!ls - pregled direktorija. :!del DATOTEKA :!rm DATOTEKA - brie datoteku DATOTEKA. 2. :w DATOTEKA zapisuje trenutanu datoteku na disk sa imenom DATOTEKA. 3. v pokret :w IME_DATOTEKE sprema vizualno oznaene linije u datoteku IME_DATOTEKE. 4. :r IME_DATOTEKE uitava datoteku IME_DATOTEKE sa diska i stavlja njen sadraj liniju ispod kursora. 5. :r !dir uitava ispis naredbe dir i postavlja sadraj ispisa liniju ispod kursora. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 6.1: NAREDBA OTVORI ** Pritisnite o kako bi otvorili liniju ispod kursora i preli u Insert mod. ** 1. Pomaknite kursor na sljedeu liniju oznaenu s --->. 2. Otipkajte malo o kako bi otvorili novu liniju ISPOD kursora i preli u Insert mod. 3. Otipkajte neto teksta i nakon toga pritisnite kako bi napustili Insert mod. ---> Nakon to pritisnete o kursor e prei u novu liniju u Insert mod. 4. Za otvaranje linije IZNAD kursora, otipkajte umjesto malog o veliko O , Pokuajte na donjoj liniji oznaenoj s --->. ---> Otvorite liniju iznad ove - otipkajte O dok je kursor na ovoj liniji. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 6.2: NAREDBA DODAJ ** Otipkajte a za dodavanje teksta IZA kursora. ** 1. Pomaknite kursor na poetak sljedee linije oznaene s --->. 2. Tipkajte e dok se kursor ne nalazi na kraju li . 3. Otipkajte a (malo) kako bi dodali tekst IZA kursora. 4. Dopunite rije kao to je na liniji ispod. Pritisnite za izlaz iz Insert moda. 5. Sa e prijeite na sljedeu nepotpunu rije i ponovite korake 3 i 4. ---> Ova li omoguava vje dodav teksta nekoj liniji. ---> Ova linija omoguava vjebanje dodavanja teksta nekoj liniji. NAPOMENA: Sa i, a, i A prelazite u isti Insert mod, jedina razlika je u poziciji od koje e se tekst ubacivati. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 6.3: DRUGI NAIN MIJENJANJA ** Otipkajte veliko R kako bi zamijelili vie od jednog znaka. ** 1. Pomaknite kursor na prvu sljedeu liniju oznaenu s --->. Pomaknite kursor na poetak prvog xxx . 2. Pritisnite R i otipkajte broj koji je liniju ispod, tako da zamijeni xxx . 3. Pritisnite za izlaz iz Replace moda. Primijetite da je ostatak linije ostao nepromjenjen. 5. Ponovite korake kako bi zamijenili preostali xxx. ---> Zbrajanje: 123 plus xxx je xxx. ---> Zbrajanje: 123 plus 456 je 579. NAPOMENA: Replace mod je kao Insert mod, ali sa bitnom razlikom, svaki otipkani znak brie ve postojei. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 6.4: KOPIRANJE I LIJEPLJENJE TEKSTA ** Koristite y operator za kopiranje a p za lijepljenje teksta. ** 1. Pomaknite kursor na liniju s ---> i postavite kursor nakon "a)". 2. Pokrenite Visual mod sa v i pomaknite kursor sve do ispred "prva". 3. Pritisnite y kako bi kopirali oznaeni tekst. 4. Pomaknite kursor do kraja sljedee linije: j$ 5. Pritisnite p kako bi zalijepili tekst. Onda utipkajte: druga . 6. Koristite Visual mod kako bi oznaili " linija.", kopirajte: y , kursor postavite na kraj sljedee linije: j$ i ondje zalijepite tekst: p . ---> a) ovo je prva linija. b) NAPOMENA: moete koristiti y kao operator; yw kopira jednu rije. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 6.5: MIJENJANJE POSTAVKI ** Postavka: naredbe traenja i zamijene ne razlikuju VELIKA i mala slova ** 1. Potraite 'razlika' tipkanjem: /razlika Nekoliko puta ponovite pritiskanjem n . 2. Aktivirajte 'ic' (Ignore case) postavku: :set ic 3. Ponovno potraite 'razlika' tipkanjem n Primijetite da su sada i RAZLIKA i Razlika pronaeni. 4. Aktivirajte 'hlsearch' i 'incsearch' postavke: :set hls is 5. Otipkajte naredbu traenja i primijetite razlike: /razlika 6. Za deaktiviranje ic postavke koristite: :set noic NAPOMENA: Za neoznaavanje pronaenih izraza otipkajte: :nohlsearch NAPOMENA: Bez razlikovanja velikih i malih slova u samo jednoj naredbi koristite \c u izrazu: /razlika\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 6 SAETAK 1. Pritisnite o za otvaranje linije ISPOD kursora i prelazak u Insert mod. Pritisnite O za otvaranje linije IZNAD kursora. 2. Pritisnite a za unos teksta IZA kursora. Pritisnite A za unos teksta na kraju linije. 3. Naredba e pomie kursor na kraj rijei. 4. Operator y kopira tekst, p ga lijepi. 5. Tipkanjem velikog R Vim prelazi u Replace mod dok ne pritisnete . 6. Tipkanjem ":set xxx" aktivira postavku "xxx". Neke postavke su: 'ic' 'ignorecase' ne razlikuje velika/mala slova pri traenju 'is' 'incsearch' trai nedovrene izraze 'hls' 'hlsearch' oznai sve pronaene izraze Moete koristite dugo ili kratko ime postavke. 7. Prethodite "no" imenu postavke za deaktiviranje iste: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 7.1: DOBIVANJE POMOI ** Koristite on-line sustav pomoi ** Vim ima detaljan on-line sustav pomoi. Za poetak, pokuajte jedno od sljedeeg: - pritisnite tipku (ako je vaa tipkovnica ima) - pritisnite tipku (ako je vaa tipkovnica ima) - utipkajte :help Proitajte tekst u prozoru pomoi kako bi ste se znali sluiti istom. Tipkanjem CTRL-W CTRL-W prelazite iz jednog prozora u drugi. Otipkajte :q kako bi zatvorili prozor pomoi. Pronai e te pomo o bilo kojoj temi, tako da dodate upit samoj ":help" naredbi. Pokuajte (ne zaboravite pritisnuti ): :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 7.2: PRAVLJENJE SKRIPTE ** Aktivirajte Vim mogunosti ** Vim ima mnogo vie alata od Vi-ja, ali veina njih nije aktivirana. Kako bi mogli koristiti vie mogunosti napravite "vimrc" datoteku. 1. Uredite "vimrc" datoteku. Ovo ovisi o vaem sistemu: :e ~/.vimrc za Unix :e $VIM/_vimrc za MS-Windows 2. Sada uitajte primjer sadraja "vimrc" datoteke: :r $VIMRUNTIME/vimrc_example.vim 3. Sauvajte datoteku sa: :w Sljedeeg puta kada pokrenete Vim, bojanje sintakse teksta biti e aktivirano. Sve vae postavke moete dodati u "vimrc" datoteku. Za vie informacija otipkajte :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 7.3: AUTOMATSKO DOVRAVANJE ** Dovravanje iz naredbene linije pomou CTRL-D i ** 1. Provjerite da Vim nije u Vi modu: :set nocp 2. Pogledajte koje datoteke postoje u direktoriju: :!ls or :!dir 3. Otipkajte poetak naredbe: :e 4. Tipkajte CTRL-D i prikazati e se lista naredbi koje zapoinju sa "e". 5. Pritisnite i Vim e dopuniti unos u naredbu ":edit". 6. Dodajte razmak i poetak datoteke: :edit FIL 7. Pritisnite . Vim e nadopuniti ime datoteke (ako je jedinstveno). NAPOMENA: Mogue je dopuniti mnoge naredbe. Koristite CTRL-D i . Naroito je korisno za :help naredbe. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 7 SAETAK 1. Otipkajte :help ili pritisnite ili za pomo. 2. Otipkajte :help naredba kako bi dobili pomo za naredba . 3. Otipkajte CTRL-W CTRL-W za prelazak u drugi prozor 4. Otipkajte :q kako bi zatvorili prozor pomoi 5. Napravite vimrc skriptu za podizanje kako bi u nju spremali vae omiljene postavke. 6. Kada tipkate naredbu koja zapoinje sa : pritisnite CTRL-D kako bi vidjeli mogue valjane vrijednosti. Pritisnite kako bi odabrali jednu od njih. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Kraj. Cilj prirunika je da pokae kratak pregled Vim editora, tek toliko da omogui njegovo koritenje. Prirunik nije potpun jer Vim ima mnogo vie naredbi. Za vie informacija: ":help user-manual". Za itanje i koritenje, preporuamo: Vim - Vi Improved - by Steve Oualline Izdava: New Riders Prva knjiga potpuno posveena Vim-u. Vrlo korisna za poetnike. Sa mnogo primjera i slika. Posjetite http://iccf-holland.org/click5.html Sljedea knjiga je neto starija i vie o Vi-u nego o Vim-u, preporuamo: Learning the Vi Editor - by Linda Lamb Izdava: O'Reilly & Associates Inc. Solidna knjiga, moete saznati skoro sve to moete napraviti u Vi-u. esto izdanje ima neto informacija i o Vim-u. Ovaj prirunik su napisali: Michael C. Pierce i Robert K. Ware, Colorado School of Mines koristei ideje Charles Smith, Colorado State University. E-pota: bware@mines.colorado.edu. Naknadne promjene napravio je Bram Moolenaar. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Preveo na hrvatski: Paul B. Mahol Preinaka 1.42, Lipanj 2008 vim-7.4.1689/runtime/tutor/tutor.hr.utf-8000066400000000000000000001031741267703067000201150ustar00rootroot00000000000000=============================================================================== = D o b r o d o š l i u VIM p r i r u č n i k - Verzija 1.7 = =============================================================================== Vim je vrlo moćan editor koji ima mnogo naredbi, previše da bi ih se svih ovdje spomenulo. Namjena priručnika je objasniti dovoljno naredbi kako bi početnici znatno lakše koristili ovaj svestran editor. Približno vrijeme potrebno za uspješan završetak priručnika je oko 30 minuta a ovisi o tome koliko će te vremena odvojiti za vježbanje. UPOZORENJE: Naredbe u ovom priručniku će promijeniti ovaj tekst. Napravite kopiju ove datoteke kako bi ste na istoj vježbali (ako ste pokrenuli "vimtutor" ovo je već kopija). Vrlo je važno primijetiti da je ovaj priručnik namijenjen za vježbanje. Preciznije, morate izvršiti naredbe u Vim-u kako bi ste iste naučili pravilno koristiti. Ako samo čitate tekst, zaboraviti će te naredbe! Ako je CapsLock uključen ISKLJUČITE ga. Pritiskajte tipku j kako bi pomakli kursor sve dok Lekcija 1.1 ne ispuni ekran. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1.1: POMICANJE KURSORA ** Za pomicanje kursora, pritisnite h,j,k,l tipke kako je prikazano ** ^ k Savjet: h tipka je lijevo i pomiče kursor lijevo. < h l > l tipka je desno i pomiče kursor desno. j j izgleda kao strelica usmjerena dolje. v 1. Pomičite kursor po ekranu dok se ne naviknete na korištenje. 2. Držite tipku (j) pritisnutom. Sada znate kako doći do sljedeće lekcije. 3. Koristeći tipku j prijeđite na sljedeću lekciju 1.2. NAPOMENA: Ako niste sigurni što ste zapravo pritisnuli uvijek koristite tipku kako bi prešli u Normal mod i onda pokušajte ponovno. NAPOMENA: Kursorske tipke rade isto. Korištenje hjkl tipaka je znatno brže, nakon što se jednom naviknete na njihovo korištenje. Stvarno! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1.2: IZLAZ IZ VIM-a !! UPOZORENJE: Prije izvođenja bilo kojeg koraka, pročitajte cijelu lekciju!! 1. Pritisnite tipku (Vim je sada u Normal modu). 2. Otipkajte: :q! . Izlaz iz editora, GUBE se sve napravljene promjene. 3. Kada se pojavi ljuska, utipkajte naredbu koja je pokrenula ovaj priručnik: vimtutor 4. Ako ste upamtili ove korake, izvršite ih redom od 1 do 3 kako bi ponovno pokrenuli editor. NAPOMENA: :q! poništava sve promjene koje ste napravili. U sljedećim lekcijama naučit će te kako promjene sačuvati. 5. Pomaknite kursor na Lekciju 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1.3: PROMJENA TEKSTA - BRISANJE ** Pritisnite x za brisanje znaka pod kursorom. ** 1. Pomaknite kursor na liniju označenu s --->. 2. Kako bi ste ispravili pogreške, pomičite kursor dok se ne bude nalazio na slovu kojeg trebate izbrisati. 3. Pritisnite tipku x kako bi uklonili neželjeno slovo. 4. Ponovite korake od 2 do 4 dok ne ispravite sve pogreške. ---> KKKravaa jee presskočila mmjeseccc. 5. Nakon što ispravite liniju, prijeđite na lekciju 1.4. NAPOMENA: Koristeći ovaj priručnik ne pokušavajte pamtiti već učite primjenom. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1.4: PROMJENA TEKSTA - UBACIVANJE ** Pritisnite i za ubacivanje teksta ispred kursora. ** 1. Pomaknite kursor na prvu sljedeću liniju označenu s --->. 2. Kako bi napravili prvu liniju istovjetnoj drugoj, pomaknite kursor na prvi znak POSLIJE kojeg će te utipkati potreban tekst. 3. Pritisnite i te utipkajte potrebne nadopune. 4. Nakon što ispravite pogrešku pritisnite kako bi vratili Vim u Normal mod. Ponovite korake od 2 do 4 kako bi ispravili sve pogreške. ---> Nedje no teka od v lin. ---> Nedostaje nešto teksta od ove linije. 5. Prijeđite na sljedeću lekciju. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1.5: PROMJENA TEKSTA - DODAVANJE ** Pritisnite A za dodavanje teksta. ** 1. Pomaknite kursor na prvu sljedeću liniju označenu s --->. Nije važno na kojem se slovu nalazi kursor na toj liniji. 2. Pritisnite A i napravite potrebne promjene. 3. Nakon što ste dodali tekst, pritisnite za povratak u Normal mod. 4. Pomaknite kursor na drugu liniju označenu s ---> i ponovite korake 2 i 3 dok ne popravite tekst. ---> Ima nešto teksta koji nedostaje n Ima nešto teksta koji nedostaje na ovoj liniji. ---> Ima nešto teksta koji ne Ima nešto teksta koji nedostaje baš ovdje. 5. Prijeđite na lekciju 1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1.6: PROMJENA DATOTEKE ** Koristite :wq za spremanje teksta i napuštanje Vim-a. ** !! UPOZORENJE: Prije izvršavanja bilo kojeg koraka, pročitajte lekciju!! 1. Izađite iz programa kao sto ste napravili u lekciji 1.2: :q! 2. Iz ljuske utipkajte sljedeću naredbu: vim tutor 'vim' je naredba pokretanja Vim editora, 'tutor' je ime datoteke koju želite uređivati. Koristite datoteku koju imate ovlasti mijenjati. 3. Ubacite i izbrišite tekst kao što ste to napravili u lekcijama prije. 4. Sačuvajte promjenjeni tekst i izađite iz Vim-a: :wq 5. Ponovno pokrenite vimtutor i nastavite čitati sažetak koji sljedi. 6. Nakon sto pročitate gornje korake i u potpunosti ih razumijete: izvršite ih. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1 SAŽETAK 1. Kursor se pomiče strelicama ili pomoću hjkl tipaka. h (lijevo) j (dolje) k (gore) l (desno) 2. Pokretanje Vim-a iz ljuske: vim IME_DATOTEKE 3. Izlaz: :q! sve promjene su izgubljene. ILI: :wq promjene su sačuvane. 4. Brisanje znaka na kojem se nalazi kursor: x 5. Ubacivanja ili dodavanje teksta: i utipkajte tekst unos ispred kursora A utipkajte tekst dodavanje na kraju linije NAPOMENA: Tipkanjem tipke prebacuje Vim u Normal mod i prekida neželjenu ili djelomično završenu naredbu. Nastavite čitati Lekciju 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 2.1: NAREDBE BRISANJA ** Tipkajte dw za brisanje riječi. ** 1. Pritisnite kako bi bili sigurni da je Vim u Normal modu. 2. Pomaknite kursor na liniju označenu s --->. 3. Pomaknite kursor na početak riječi koju treba izbrisati. 4. Otipkajte dw kako bi uklonili riječ. NAPOMENA: Vim će prikazati slovo d na zadnjoj liniji kad ga otipkate. Vim čeka da otipkate w . Ako je prikazano neko drugo slovo, krivo ste otipkali; pritisnite i pokušajte ponovno. ---> Neke riječi smiješno ne pripadaju na papir ovoj rečenici. 5. Ponovite korake 3 i 4 dok ne ispravite rečenicu; prijeđite na Lekciju 2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 2.2: JOŠ BRISANJA ** Otipkajte d$ za brisanje znakova do kraja linije. ** 1. Pritisnite kako bi bili sigurni da je Vim u Normal modu. 2. Pomaknite kursor na liniju označenu s --->. 3. Pomaknite kursor do kraja ispravne rečenice (POSLJE prve . ). 4. Otipkajte d$ kako bi izbrisali sve znakove do kraja linije. ---> Netko je utipkao kraj ove linije dvaput. kraj ove linije dvaput. 5. Prijeđite na Lekciju 2.3 za bolje objašnjenje. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 2.3: UKRATKO O OPERATORIMA I POKRETIMA Mnogo naredbi koje mijenjaju tekst se sastoje od operatora i pokreta. Oblik naredbe brisanja sa d operatorom je sljedeći: d pokret Pri čemu je: d - operator brisanja. pokret - ono na čemu će se operacija izvršavati (navedeno u nastavku). Kratka lista pokreta: w - sve do početka sljedeće riječi, NE UKLJUČUJUĆI prvo slovo. e - sve do kraja trenutačne riječi, UKLJUČUJUĆI zadnje slovo. $ - sve do kraje linije, UKLJUČUJUĆI zadnje slovo. Tipkanjem de će se brisati od kursora do kraja riječi. NAPOMENA: Pritiskajući samo pokrete dok ste u Normal modu bez operatora će pomicati kursor kao što je navedeno. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 2.4: KORIŠTENJE BROJANJA ZA POKRETE ** Tipkanjem nekog broja prije pokreta, pokret se izvršava toliko puta. ** 1. Pomaknite kursor na liniju označenu s --->. 2. Otipkajte 2w da pomaknete kursor dvije riječi naprijed. 3. Otipkajte 3e da pomaknete kursor na kraj treće riječi naprijed. 4. Otipkajte 0 (nulu) da pomaknete kursor na početak linije. 5. Ponovite korake 2 i 3 s nekim drugim brojevima. ---> Rečenica sa riječima po kojoj možete pomicati kursor. 6. Prijeđite na Lekciju 2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 2.5: KORIŠTENJE BROJANJA ZA VEĆE BRISANJE ** Tipkanje broja N s operatorom ponavlja ga N-puta. ** U kombinaciji operatora brisanja i pokreta spomenutih iznad ubacujete broj prije pokreta kako bi izbrisali više znakova: d broj pokret 1. Pomaknite kursor na prvo slovo u riječi sa VELIKIM SLOVIMA označenu s --->. 2. Otipkajte 2dw da izbrišete dvije riječi sa VELIKIM SLOVIMA 3. Ponovite korake 1 i 2 sa različitim brojevima da izbrišete uzastopne riječi sa VELIKIM SLOVIMA sa samo jednom naredbom. ---> ova ABCČĆ DĐE linija FGHI JK LMN OP riječi je RSŠ TUVZŽ popravljena. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 2.6: OPERIRANJE NAD LINIJAMA ** Otipkajte dd za brisanje cijele linije. ** Zbog učestalosti brisanja cijelih linija, dizajneri Vi-a su odlučili da je lakše brisati linije tipkanjem d dvaput. 1. Pomaknite kursor na drugu liniju u donjoj kitici. 2. Otipkajte dd kako bi izbrisali liniju. 3. Pomaknite kursor na četvrtu liniju. 4. Otipkajte 2dd kako bi izbrisali dvije linije. ---> 1) Ruže su crvene, ---> 2) Plaža je super, ---> 3) Ljubice su plave, ---> 4) Imam auto, ---> 5) Satovi ukazuju vrijeme, ---> 6) Šećer je sladak ---> 7) Kao i ti. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 2.7: NAREDBA PONIŠTENJA ** Pritisnite u za poništenje zadnje naredbe, U za cijelu liniju. ** 1. Pomaknite kursor na liniju označenu s ---> i postavite kursor na prvu pogrešku. 2. Otipkajte x kako bi izbrisali prvi neželjeni znak. 3. Otipkajte u kako bi poništili zadnju izvršenu naredbu. 4. Ovaj put ispravite sve pogreške na liniji koristeći x naredbu. 5. Sada utipkajte veliko U kako bi poništili sve promjene na liniji, vraćajući je u prijašnje stanje. 6. Sada utipkajte u nekoliko puta kako bi poništili U i prijašnje naredbe. 7. Sada utipkajte CTRL-R (držeći CTRL tipku pritisnutom dok ne pritisnete R) nekoliko puta kako bi vratili promjene (poništili poništenja). ---> Poopravite pogreške nna ovvoj liniji ii pooništiteee ih. 8. Vrlo korisne naredbe. Prijeđite na sažetak Lekcije 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 2 SAŽETAK 1. Brisanje od kursora do sljedeće riječi: dw 2. Brisanje od kursora do kraja linije: d$ 3. Brisanje cijele linije: dd 4. Za ponavljanje pokreta prethodite mu broj: 2w 5. Oblik naredbe mijenjanja: operator [broj] pokret gdje je: operator - što napraviti, npr. d za brisanje [broj] - neobavezan broj ponavljanja pokreta pokret - kretanje po tekstu po kojem se operira, kao što je: w (riječ), $ (kraj linije), itd. 6. Postavljanje kursora na početak linije: 0 7. Za poništenje prethodnih promjena, pritisnite: u (malo u) Za poništenje svih promjena na liniji, pritisnite: U (veliko U) Za vraćanja promjena, utipkajte: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 3.1: NAREDBA POSTAVI ** p za unos prethodno izbrisanog teksta iza kursora. ** 1. Pomaknite kursor na prvu sljedeću liniju označenu s --->. 2. Otipkajte dd kako bi izbrisali liniju i spremili je u Vim registar. 3. Pomaknite kursor na liniju c), IZNAD linije koju trebate unijeti. 4. Otipkajte p kako bi postavili liniju ispod kursora. 5. Ponovite korake 2 do 4 kako bi postavili sve linije u pravilnom rasporedu. ---> d) Možeš li i ti naučiti? ---> b) Ljubice su plave, ---> c) Inteligencija je naučena, ---> a) Ruže su crvene, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 3.2: NAREDBA PROMJENE ** Otipkajte rx za zamjenu slova ispod kursora sa slovom x . ** 1. Pomaknite kursor na prvu sljedeću liniju označenu s --->. 2. Pomaknite kursor tako da se nalazi na prvoj pogrešci. 3. Otipkajte r i nakon toga ispravan znak na tom mjestu. 4. Ponovite korake 2 i 3 sve dok prva linije ne bude istovjetna drugoj. ---> Kede ju ovu limija tupjana, natko je protuskao kruve tupke! ---> Kada je ova linija tipkana, netko je pritiskao krive tipke! 5. Prijeđite na Lekciju 3.2. NAPOMENA: Prisjetite da trebate učiti vježbanjem, ne pamćenjem. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 3.3: OPERATOR MIJENJANJA ** Za mijenjanje do kraja riječi, istipkajte ce . ** 1. Pomaknite kursor na prvu sljedeću liniju označenu s --->. 2. Postavite kursor na a u lackmb. 3. Otipkajte ce i ispravite riječ (u ovom slučaju otipkajte inija ). 4. Pritisnite i pomaknite kursor na sljedeći znak kojeg je potrebno ispraviti. 5. Ponovite korake 3 i 4 sve dok prva rečenica ne postane istovjetna drugoj. ---> Ova lackmb ima nekoliko rjlcah koje trfcb mijdmlfsz. ---> Ova linija ima nekoliko riječi koje treba mijenjati. Primijetite da ce briše riječ i postavlja Vim u Insert mod. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 3.4: JOŠ MIJENJANJA KORIŠTENJEM c ** Naredba mijenjanja se koristi sa istim pokretima kao i brisanje. ** 1. Operator mijenjanja se koristi na isti način kao i operator brisanja: c [broj] pokret 2. Pokreti su isti, npr: w (riječ) i $ (kraj linije). 3. Pomaknite kursor na prvu sljedeću liniju označenu s --->. 4. Pomaknite kursor na prvu pogrešku. 5. Otipkajte c$ i utipkajte ostatak linije tako da bude istovjetna drugoj te pritisnite . ---> Kraj ove linije treba pomoć tako da izgleda kao linija ispod. ---> Kraj ove linije treba ispraviti korištenjem c$ naredbe. NAPOMENA: Možete koristiti Backspace za ispravljanje grešaka. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 3 SAŽETAK 1. Za postavljanje teksta koji je upravo izbrisan, pritisnite p . Ovo postavlja tekst IZA kursora (ako je pak linija izbrisana tekst se postavlja na liniju ispod kursora). 2. Za promjenu znaka na kojem se nalazi kursor, pritisnite r i nakon toga željeni znak. 3. Operator mijenjanja dozvoljava promjenu teksta od kursora do pozicije do koje dovede pokret. tj. Otipkajte ce za mijenjanje od kursora do kraja riječi, c$ za mijenjanje od kursora do kraja linije. 4. Oblik naredbe mijenjanja: c [broj] pokret Prijeđite na sljedeću lekciju. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 4.1: POZICIJA KURSORA I STATUS DATOTEKE ** CTRL-G za prikaz pozicije kursora u datoteci i status datoteke. Pritisnite G za pomicanje kursora na neku liniju u datoteci. ** NAPOMENA: Pročitajte cijelu lekciju prije izvršenja bilo kojeg koraka!! 1. Držite Ctrl tipku pritisnutom i pritisnite g . Ukratko: CTRL-G. Vim će ispisati poruku na dnu ekrana sa imenom datoteke i pozicijom kursora u datoteci. Zapamtite broj linije za 3. korak. NAPOMENA: Možete vidjeti poziciju kursora u donjem desnom kutu ako je postavka 'ruler' aktivirana (objašnjeno u 6. lekciji). 2. Pritisnite G za pomicanje kursora na kraj datoteke. Otipkajte gg za pomicanje kursora na početak datoteke. 3. Otipkajte broj linije na kojoj ste bili maloprije i zatim G . Kursor će se vratiti na liniju na kojoj se nalazio kada ste otipkali CTRL-G. 4. Ako ste spremni, izvršite korake od 1 do 3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 4.2: NAREDBE TRAŽENJA ** Otipkajte / i nakon toga izraz kojeg želite tražiti. ** 1. U Normal modu otipkajte / znak. Primijetite da se znak pojavio zajedno sa kursorom na dnu ekrana kao kod : naredbe. 2. Sada otipkajte 'grrrreška' . To je riječ koju zapravo tražite. 3. Za ponovno traženje istog izraza, otipkajte n . Za traženje istog izraza ali u suprotnom smjeru, otipkajte N . 4. Za traženje izraza unatrag, koristite ? umjesto / . 5. Za povratak na prethodnu poziciju koristite CTRL-O (držite Ctrl pritisnutim dok ne pritisnete tipku o). Ponavljajte sve dok se ne vratite na početak. CTRL-I slično kao CTRL-O ali u suprotnom smjeru. ---> "pogrrrreška" je pogrešno; umjesto pogrrrreška treba stajati pogreška. NAPOMENA: Ako se traženjem dođe do kraja datoteke nastavit će se od njenog početka osim ako je postavka 'wrapscan' deaktivirana. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 4.3: TRAŽENJE PRIPADAJUĆE ZAGRADE ** Otipkajte % za pronalazak pripadajuće ), ] ili } . ** 1. Postavite kursor na bilo koju od ( , [ ili { otvorenih zagrada u liniji označenoj s --->. 2. Otipkajte znak % . 3. Kursor će se pomaknuti na pripadajuću zatvorenu zagradu. 4. Otipkajte % kako bi pomakli kursor na drugu pripadajuću zagradu. 5. Pomaknite kursor na neku od (,),[,],{ ili } i ponovite % naredbu. ---> Linija ( testiranja običnih ( [ uglatih ] i { vitičastih } zagrada.)) NAPOMENA: Vrlo korisno u ispravljanju koda sa nepripadajućim zagradama! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 4.4: NAREDBE ZAMIJENE ** Otipkajte :s/staro/novo/g da zamijenite 'staro' za 'novo'. ** 1. Pomaknite kursor na liniju označenu s --->. 2. Otipkajte :s/cvrćč/cvrč . Primjetite da ova naredba zamjenjuje samo prvi "cvrćč" u liniji. 3. Otipkajte :s/cvrćč/cvrč/g . Dodavanje g stavke znači da će se naredba izvršiti na cijeloj liniji, zamjenjivanjem svih "cvrćč" u liniji. ---> i cvrćči cvrćči cvrćčak na čvoru crne smrče. 4. Za zamjenu svih izraza u rasponu dviju linija, otipkajte :#,#s/staro/novo/g #,# su brojevi linije datoteke na kojima te između njih će se izvršiti zamjena. Otipkajte :%s/staro/novo/g za zamjenu svih izraza u cijeloj datoteci. Otipkajte :%s/staro/novo/gc za pronalazak svakog izraza u datoteci i potvrdu zamjene. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 4 SAŽETAK 1. CTRL-G prikazuje poziciju kursora u datoteci i status datoteke. G postavlja kursor na zadnju liniju datoteke. broj G postavlja kursor na broj liniju. gg postavlja kursor na prvu liniju. 2. Tipkanje / sa izrazom traži UNAPRIJED taj izraz. Tipkanje ? sa izrazom traži UNATRAG taj izraz. Nakon naredbe traženja koristite n za pronalazak izraza u istom smjeru, i N za pronalazak istog izraza ali u suprotnom smjeru. CTRL-O vraća kursor na prethodnu poziciju, CTRL-I na sljedeću poziciju. 3. Tipkanje % dok je kursor na zagradi pomiče ga na pripadajuću zagradu. 4. Za zamjenu prvog izraza staro za izraz novo :s/staro/novo Za zamjenu svih izraza staro na cijeloj liniji :s/staro/novo/g Za zamjenu svih izraza staro u rasponu linija #,# :#,#s/staro/novo/g Za zamjenu u cijeloj datoteci :%s/staro/novo/g Za potvrdu svake zamjene dodajte 'c' :%s/staro/novo/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 5.1: IZVRŠAVANJE VANJSKIH NAREDBI ** Otipkajte :! sa vanjskom naredbom koju želite izvršiti. ** 1. Otipkajte poznatu naredbu : kako bi kursor premjestili na dno ekrana. Time omogućavate unos naredbe u naredbenoj liniji. 2. Otipkajte znak ! (uskličnik). Tako omogućavate izvršavanje naredbe vanjske ljuske. 3. Kao primjer otipkajte ls nakon ! te pritisnite . Ovo će prikazati sadržaj direktorija, kao da ste u ljusci. Koristite :!dir ako :!ls ne radi. NAPOMENA: Moguće je izvršavati bilo koju vanjsku naredbu na ovaj način, zajedno sa njenim argumentima. NAPOMENA: Sve : naredbe se izvršavaju nakon što pritisnete U daljnjem tekstu to neće uvijek biti napomenuto. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 5.2: VIŠE O SPREMANJU DATOTEKA ** Za spremanje promjena, otipkajte :w IME_DATOTEKE. ** 1. Otipkajte :!dir ili :!ls za pregled direktorija. Već znate da morate pritisnuti na kraju tipkanja. 2. Izaberite ime datoteke koja još ne postoji, npr. TEST. 3. Otipkajte: :w TEST (gdje je TEST ime koje ste prethodno odabrali.) 4. Time će te spremiti cijelu datoteku (Vim Tutor) pod imenom TEST. Za provjeru, otipkajte ponovno :!dir ili :!ls za pregled direktorija. NAPOMENA: Ako bi napustili Vim i ponovno ga pokrenuli sa vim TEST , datoteka bi bila potpuna kopija ove datoteke u trenutku kada ste je spremili. 5. Izbrišite datoteku tako da otipkate (MS-DOS): :!del TEST ili (Unix): :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 5.3: SPREMANJE OZNAČENOG TEKSTA ** Kako bi spremili dio datoteke, otipkajte v pokret :w IME_DATOTEKE ** 1. Pomaknite kursor na ovu liniju. 2. Pritisnite v i pomaknite kursor pet linija ispod ove. Primijetite promjenu, označeni tekst se razlikuje od običnog. 3. Pritisnite : znak. Na dnu ekrana pojavit će se :'<,'> . 4. Otipkajte w TEST , pritom je TEST ime datoteke koja još ne postoji. Provjerite da zaista piše :'<,'>w TEST prije nego što pritisnite . 5. Vim će spremiti označeni tekst u TEST. Provjerite sa :!dir ili :!ls . Nemojte je još brisati! Koristiti će te je u sljedećoj lekciji. NAPOMENA: Tipka v započinje Vizualno označavanje. Možete pomicati kursor unaokolo kako bi mijenjali veličinu označenog teksta. Možete koristiti i operatore. Npr, d će izbrisati označeni tekst. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 5.4: UČITAVANJE DATOTEKA ** Za ubacivanje sadržaja datoteke, otipkajte :r IME_DATOTEKE ** 1. Postavite kursor iznad ove linije. NAPOMENA: Nakon što izvršite 2. korak vidjeti će te tekst iz Lekcije 5.3. Stoga pomaknite kursor DOLJE kako bi ponovno vidjeli ovu lekciju. 2. Učitajte vašu TEST datoteku koristeći naredbu :r TEST gdje je TEST ime datoteke koju ste koristili u prethodnoj lekciji. Sadržaj učitane datoteke je ubačen liniju ispod kursora. 3. Kako bi provjerili da je datoteka učitana, vratite kursor unatrag i primijetite dvije kopije Lekcije 5.3, originalnu i onu iz datoteke. NAPOMENA: Možete također učitati ispis vanjske naredbe. Npr, :r !ls će učitati ispis ls naredbe i postaviti ispis liniju ispod kursora. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 5 SAŽETAK 1. :!naredba izvršava vanjsku naredbu. Korisni primjeri: (MS-DOS) (Unix) :!dir :!ls - pregled direktorija. :!del DATOTEKA :!rm DATOTEKA - briše datoteku DATOTEKA. 2. :w DATOTEKA zapisuje trenutačnu datoteku na disk sa imenom DATOTEKA. 3. v pokret :w IME_DATOTEKE sprema vizualno označene linije u datoteku IME_DATOTEKE. 4. :r IME_DATOTEKE učitava datoteku IME_DATOTEKE sa diska i stavlja njen sadržaj liniju ispod kursora. 5. :r !dir učitava ispis naredbe dir i postavlja sadržaj ispisa liniju ispod kursora. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 6.1: NAREDBA OTVORI ** Pritisnite o kako bi otvorili liniju ispod kursora i prešli u Insert mod. ** 1. Pomaknite kursor na sljedeću liniju označenu s --->. 2. Otipkajte malo o kako bi otvorili novu liniju ISPOD kursora i prešli u Insert mod. 3. Otipkajte nešto teksta i nakon toga pritisnite kako bi napustili Insert mod. ---> Nakon što pritisnete o kursor će preći u novu liniju u Insert mod. 4. Za otvaranje linije IZNAD kursora, otipkajte umjesto malog o veliko O , Pokušajte na donjoj liniji označenoj s --->. ---> Otvorite liniju iznad ove - otipkajte O dok je kursor na ovoj liniji. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 6.2: NAREDBA DODAJ ** Otipkajte a za dodavanje teksta IZA kursora. ** 1. Pomaknite kursor na početak sljedeće linije označene s --->. 2. Tipkajte e dok se kursor ne nalazi na kraju li . 3. Otipkajte a (malo) kako bi dodali tekst IZA kursora. 4. Dopunite riječ kao što je na liniji ispod. Pritisnite za izlaz iz Insert moda. 5. Sa e prijeđite na sljedeću nepotpunu riječ i ponovite korake 3 i 4. ---> Ova li omogućava vje dodav teksta nekoj liniji. ---> Ova linija omogućava vježbanje dodavanja teksta nekoj liniji. NAPOMENA: Sa i, a, i A prelazite u isti Insert mod, jedina razlika je u poziciji od koje će se tekst ubacivati. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 6.3: DRUGI NAČIN MIJENJANJA ** Otipkajte veliko R kako bi zamijelili više od jednog znaka. ** 1. Pomaknite kursor na prvu sljedeću liniju označenu s --->. Pomaknite kursor na početak prvog xxx . 2. Pritisnite R i otipkajte broj koji je liniju ispod, tako da zamijeni xxx . 3. Pritisnite za izlaz iz Replace moda. Primijetite da je ostatak linije ostao nepromjenjen. 5. Ponovite korake kako bi zamijenili preostali xxx. ---> Zbrajanje: 123 plus xxx je xxx. ---> Zbrajanje: 123 plus 456 je 579. NAPOMENA: Replace mod je kao Insert mod, ali sa bitnom razlikom, svaki otipkani znak briše već postojeći. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 6.4: KOPIRANJE I LIJEPLJENJE TEKSTA ** Koristite y operator za kopiranje a p za lijepljenje teksta. ** 1. Pomaknite kursor na liniju s ---> i postavite kursor nakon "a)". 2. Pokrenite Visual mod sa v i pomaknite kursor sve do ispred "prva". 3. Pritisnite y kako bi kopirali označeni tekst. 4. Pomaknite kursor do kraja sljedeće linije: j$ 5. Pritisnite p kako bi zalijepili tekst. Onda utipkajte: druga . 6. Koristite Visual mod kako bi označili " linija.", kopirajte: y , kursor postavite na kraj sljedeće linije: j$ i ondje zalijepite tekst: p . ---> a) ovo je prva linija. b) NAPOMENA: možete koristiti y kao operator; yw kopira jednu riječ. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 6.5: MIJENJANJE POSTAVKI ** Postavka: naredbe traženja i zamijene ne razlikuju VELIKA i mala slova ** 1. Potražite 'razlika' tipkanjem: /razlika Nekoliko puta ponovite pritiskanjem n . 2. Aktivirajte 'ic' (Ignore case) postavku: :set ic 3. Ponovno potražite 'razlika' tipkanjem n Primijetite da su sada i RAZLIKA i Razlika pronađeni. 4. Aktivirajte 'hlsearch' i 'incsearch' postavke: :set hls is 5. Otipkajte naredbu traženja i primijetite razlike: /razlika 6. Za deaktiviranje ic postavke koristite: :set noic NAPOMENA: Za neoznačavanje pronađenih izraza otipkajte: :nohlsearch NAPOMENA: Bez razlikovanja velikih i malih slova u samo jednoj naredbi koristite \c u izrazu: /razlika\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 6 SAŽETAK 1. Pritisnite o za otvaranje linije ISPOD kursora i prelazak u Insert mod. Pritisnite O za otvaranje linije IZNAD kursora. 2. Pritisnite a za unos teksta IZA kursora. Pritisnite A za unos teksta na kraju linije. 3. Naredba e pomiče kursor na kraj riječi. 4. Operator y kopira tekst, p ga lijepi. 5. Tipkanjem velikog R Vim prelazi u Replace mod dok ne pritisnete . 6. Tipkanjem ":set xxx" aktivira postavku "xxx". Neke postavke su: 'ic' 'ignorecase' ne razlikuje velika/mala slova pri traženju 'is' 'incsearch' traži nedovršene izraze 'hls' 'hlsearch' označi sve pronađene izraze Možete koristite dugo ili kratko ime postavke. 7. Prethodite "no" imenu postavke za deaktiviranje iste: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 7.1: DOBIVANJE POMOĆI ** Koristite on-line sustav pomoći ** Vim ima detaljan on-line sustav pomoći. Za početak, pokušajte jedno od sljedećeg: - pritisnite tipku (ako je vaša tipkovnica ima) - pritisnite tipku (ako je vaša tipkovnica ima) - utipkajte :help Pročitajte tekst u prozoru pomoći kako bi ste se znali služiti istom. Tipkanjem CTRL-W CTRL-W prelazite iz jednog prozora u drugi. Otipkajte :q kako bi zatvorili prozor pomoći. Pronaći će te pomoć o bilo kojoj temi, tako da dodate upit samoj ":help" naredbi. Pokušajte (ne zaboravite pritisnuti ): :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 7.2: PRAVLJENJE SKRIPTE ** Aktivirajte Vim mogućnosti ** Vim ima mnogo više alata od Vi-ja, ali većina njih nije aktivirana. Kako bi mogli koristiti više mogućnosti napravite "vimrc" datoteku. 1. Uredite "vimrc" datoteku. Ovo ovisi o vašem sistemu: :e ~/.vimrc za Unix :e $VIM/_vimrc za MS-Windows 2. Sada učitajte primjer sadržaja "vimrc" datoteke: :r $VIMRUNTIME/vimrc_example.vim 3. Sačuvajte datoteku sa: :w Sljedećeg puta kada pokrenete Vim, bojanje sintakse teksta biti će aktivirano. Sve vaše postavke možete dodati u "vimrc" datoteku. Za više informacija otipkajte :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 7.3: AUTOMATSKO DOVRŠAVANJE ** Dovršavanje iz naredbene linije pomoću CTRL-D i ** 1. Provjerite da Vim nije u Vi modu: :set nocp 2. Pogledajte koje datoteke postoje u direktoriju: :!ls or :!dir 3. Otipkajte početak naredbe: :e 4. Tipkajte CTRL-D i prikazati će se lista naredbi koje započinju sa "e". 5. Pritisnite i Vim će dopuniti unos u naredbu ":edit". 6. Dodajte razmak i početak datoteke: :edit FIL 7. Pritisnite . Vim će nadopuniti ime datoteke (ako je jedinstveno). NAPOMENA: Moguće je dopuniti mnoge naredbe. Koristite CTRL-D i . Naročito je korisno za :help naredbe. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 7 SAŽETAK 1. Otipkajte :help ili pritisnite ili za pomoć. 2. Otipkajte :help naredba kako bi dobili pomoć za naredba . 3. Otipkajte CTRL-W CTRL-W za prelazak u drugi prozor 4. Otipkajte :q kako bi zatvorili prozor pomoći 5. Napravite vimrc skriptu za podizanje kako bi u nju spremali vaše omiljene postavke. 6. Kada tipkate naredbu koja započinje sa : pritisnite CTRL-D kako bi vidjeli moguće valjane vrijednosti. Pritisnite kako bi odabrali jednu od njih. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Kraj. Cilj priručnika je da pokaže kratak pregled Vim editora, tek toliko da omogući njegovo korištenje. Priručnik nije potpun jer Vim ima mnogo više naredbi. Za više informacija: ":help user-manual". Za čitanje i korištenje, preporučamo: Vim - Vi Improved - by Steve Oualline Izdavač: New Riders Prva knjiga potpuno posvećena Vim-u. Vrlo korisna za početnike. Sa mnogo primjera i slika. Posjetite http://iccf-holland.org/click5.html Sljedeća knjiga je nešto starija i više o Vi-u nego o Vim-u, preporučamo: Learning the Vi Editor - by Linda Lamb Izdavač: O'Reilly & Associates Inc. Solidna knjiga, možete saznati skoro sve što možete napraviti u Vi-u. Šesto izdanje ima nešto informacija i o Vim-u. Ovaj priručnik su napisali: Michael C. Pierce i Robert K. Ware, Colorado School of Mines koristeći ideje Charles Smith, Colorado State University. E-pošta: bware@mines.colorado.edu. Naknadne promjene napravio je Bram Moolenaar. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Preveo na hrvatski: Paul B. Mahol Preinaka 1.42, Lipanj 2008 vim-7.4.1689/runtime/tutor/tutor.hu000066400000000000000000000650721267703067000171620ustar00rootroot00000000000000=============================================================================== == d v z l j k a V I M - o k t a t b a n - 1.5-s verzi == =============================================================================== A Vim egy nagyon hatkony szerkeszt, amelynek rengeteg utastsa van, tl sok, hogy egy ilyen oktatban (tutorban), mint az itteni mindet elmagyarzzuk. Ez az oktat arra trekszik, hogy annyit elmagyarzzon, amennyi elg, hogy knnyedn hasznljuk a Vim-et, az ltalnos cl szvegszerkesztt. A feladatok megoldshoz 25-30 perc szksges attl fggen, mennyit tltnk a ksrletezssel. A leckben szerepl utastsok mdostani fogjk a szveget. Ksztsen msolatot errl a fjlrl, ha gyakorolni akar. (Ha "vimtutor"-ral indtotta, akkor ez mr egy msolat.) Fontos megrteni, hogy ez az oktat cselekedve tanttat. Ez azt jelenti, hogy nnek ajnlott vgrehajtania az utastsokat, hogy megfelelen megtanulja azokat. Ha csak olvassa, elfelejti! Most bizonyosodjon, meg, hogy a Caps-Lock gombja NINCS lenyomva, s Nyomja meg megfelel szmszor a j gombot, hogy az 1.1-es lecke teljesen a kpernyn legyen! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1.1. lecke: A KURZOR MOZGATSA ** A kurzor mozgatshoz nyomja meg a h,j,k,l gombokat az albbi szerint. ** ^ k Tipp: A h billenty van balra, s balra mozgat < h l > A l billenty van jobbra, s jobbra mozgat j A j billenty olyan, mint egy lefele nyl v 1. Mozgassa a kurzort krbe az ablakban, amg hozz nem szokik! 2. Tartsa lenyomva a lefelt (j), akkor ismtldik! ---> Most tudja, hogyan mehet a kvetkez leckre. 3. A lefel gomb hasznlatval menjen a 1.2. leckre! Megj: Ha nem biztos benne, mit nyomott meg, nyomja meg az -et, hogy norml mdba kerljn, s ismtelje meg a parancsot! Megj: A kurzor gomboknak is mkdnik kell, de a hjkl hasznlatval sokkal gyorsabban tud, mozogni, ha hozzszokik. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1.2. lecke: BE S KILPS A VIMBL !! MEGJ: Mieltt vgrehajtja az albbi lpseket, olvassa vgig a leckt !! 1. Nyomja meg az gombot (hogy biztosan norml mdban legyen). 2. rja: :q! . ---> Ezzel kilp a szerkesztbl a vltozsok MENTSE NLKL. Ha menteni szeretn a vltozsokat s kilpni, rja: :wq 3. Amikor a shell promptot ltja, rja be a parancsot, amely ebbe az oktatba hozza: Ez valsznleg: vimtutor Normlis esetben ezt rn: vim tutor.hu ---> 'vim' jelenti a vimbe belpst, 'tutor.hu' a fjl, amit szerkeszteni kvn. 4. Ha megjegyezte a lpseket s biztos magban, hajtsa vgre a lpseket 1-tl 3-ig, hogy kilpjen s visszatrjen a szerkesztbe. Azutn menjen az 1.3. leckre. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1.3. lecke: SZVEG SZERKESZTSE - TRLS ** Norml mdban nyomjon x-et, hogy a kurzor alatti karaktert trlje. ** 1. Mozgassa a kurzort a ---> kezdet sorra! 2. A hibk kijavtshoz mozgassa a kurzort amg a trlend karakter fl nem r. 3. Nyomja meg az x gombot, hogy trlje a nem kvnt karaktert. 4. Ismtelje a 2, 3, 4-es lpseket, hogy kijavtsa a mondatot. ---> szi jjjell izziik aa galaggonya rruuhja. 5. Ha a sor helyes, ugorjon a 1.4. leckre. MEGJ: A tanuls sorn ne memorizlni prbljon, hanem hasznlat sorn tanuljon. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1.4. lecke: SZVEG SZERKESZTSE - BESZRS ** Norml mdban i megnyomsval lehet beilleszteni. ** 1. Az albbi els ---> kezdet sorra menjen. 2. Ahhoz, hogy az elst azonoss tegye a msodikkal, mozgassa a kurzort az els karakterre, amely UTN szveget kell beszrni. 3. Nyomjon i-t s rja be a megfelel szveget. 4. Amikor mindent bert, nyomjon -et, hogy Norml mdba visszatrjen. Ismtelje a 2 s 4 kztti lpseket, hogy kijavtsa a mondatot. ---> Az that sol hizik pr sz. ---> Az itt lthat sorbl hinyzik pr rsz. 5. Ha mr begyakorolta a beszrst, menjen az albbi sszefoglalra. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1. LECKE SSZEFOGLALJA 1. A kurzort vagy a nyilakkal vagy a hjkl gombokkal mozgathatja. h (balra) j (le) k (fel) l (jobbra) 2. A Vimbe (a $ prompttl) gy lphet be: vim FILENAME 3. A Vimbl gy lphet ki: :q! a vltoztatsok eldobsval. vagy gy: :wq a vltozsok mentsvel. 4. A kurzor alatti karakter trlse norml mdban: x 5. Szveg beszrsa a kurzor utn norml mdban: i gpelje be a szveget MEGJ: Az megnyomsa norml mdba viszi, vagy megszakt egy nem befejezett rszben befejezett parancsot. Most folytassuk a 2. leckvel! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2.1. lecke: TRL UTASTSOK ** dw trl a sz vgig. ** 1. Nyomjon -et, hogy megbizonyosodjon, hogy norml mdban van! 2. Mozgassa a kurzort a ---> kezdet sorra! 3. Mozgassa a kurzort arra annak a sznak az elejre, amit trlni szeretne. Trlje az llatokat a mondatbl. 4. A sz trlshez rja: dw MEGJ: Ha rosszul kezdte az utastst csak nyomjon gombot a megszaktshoz. ---> Pr sz kutya nem uhu illik pingvin a mondatba tehn. 5. Ismtelje a 3 s 4 kztti utastsokat amg kell s ugorjon a 2.2 leckre! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2.2. lecke: MG TBB TRL UTASTS ** d$ bersval a sor vgig trlhet. ** 1. Nyomjon -et, hogy megbizonyosodjon, hogy norml mdban van! 2. Mozgassa a kurzort a ---> kezdet sorra! 3. Mozgassa a kurzort a helyes sor vgre (az els . UTN)! 4. d$ begpelsvel trlje a sor vgt! ---> Valaki a sor vgt ktszer gpelte be. ktszer gpelte be. 5. Menjen a 2.3. leckre, hogy megrtse mi trtnt! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2.3. lecke: UTASTSOKRL S MOZGSOKRL A d (delete=trls) utasts formja a kvetkez: [szm] d mozgs VAGY d [szm] mozgs Ahol: szm - hnyszor hajtdjon vgre a parancs (elhagyhat, alaprtk=1). d - a trls (delete) utasts. mozgs - amin a parancsnak teljeslnie kell (albb listzva). Mozgsok rvid listja: w - a kurzortl a sz vgig, belertve a szkzt. e - a kurzortl a sz vgig, NEM belertve a szkzt. $ - a kurzortl a sor vgig. MEGJ: Csupn a mozgs begpelsvel (parancs nlkl) a kurzor mozgs ltal megadott helyre kerl. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2.4. lecke: EGSZ SOROK FELDOLGOZSA ** dd bersval trlheti az egsz sort. ** A teljes sor trlsnek gyakorisga miatt a Vi tervezi elhatroztk, hogy knnyebb lenne csupn a d-t ktszer megnyomni, hogy egy sort trljnk. 1. Mozgassa a kurzort az albbi kifejezsek msodik sorra! 2. dd begpelsvel trlje a sort! 3. Menjen a 3. (eredetileg 4.) sorra! 4. 2dd (ugyebr szm-utasts-mozgs) begpelsvel trljn kt sort! 1) Alv szegek a jghideg homokban, 2) - kezdi a klt - 3) Plaktmagnyban z jjelek. 4) Pingvinek ne fljetek, 5) Tvolrl egy vaku villant, 6) gve hagytad a folyosn a villanyt. 7) Ma ontjk vremet. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2.5. lecke: A VISSZAVONS (UNDO) PARANCS ** u gpelsvel visszavonhat az utols parancs, U az egsz sort helyrelltja. ** 1. Menjnk az albbi ---> kezdet sor els hibjra! 2. x lenyomsval trlje az els felesleges karaktert! 3. u megnyomsval vonja vissza az utolsnak vgrehajtott utastst! 4. Msodjra javtson ki minden hibt a sorban az x utastssal! 5. Most nagy U -val lltsa vissza a sor eredeti llapott! 6. Nyomja meg az u gombot prszor, hogy az U s az azt megelz utastsokat visszalltsa! 7. CTRL-R (CTRL gomb lenyomsa mellett ssn R-t) prszor csinlja jra a visszavont parancsokat (redo)! ---> Javtsa a hhibkaat ebbben a sooorban majd lltsa visszaaa az eredetit. 8. Ezek nagyon hasznos parancsok. Most ugorjon a 2. lecke sszefoglaljra. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2. LECKE SSZEFOGLALJA 1. Trls a kurzortl a sz vgig: dw 2. Trls a kurzortl a sor vgig: d$ 3. Egsz sor trlse: dd 4. Egy utasts alakja norml mdban: [szm] utasts mozgs VAGY utasts [szm] mozgs ahol: szm - hnyszor ismteljk a parancsot utasts - mit tegynk, pl. d a trlskor mozgs - mire hasson az utasts, pldul w (sz=word), $ (a sor vgig), stb. 5. Az elz tett visszavonsa (undo): u (kis u) A sor sszes vltozsnak visszavonsa: U (nagy U) Visszavonsok visszavonsa: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3.1. lecke: A BEILLESZTS (PUT) PARANCS ** p letsvel az utolsnak trltet a kurzor utn illeszthetjk. ** 1. Mozgassuk a kurzort az albbi sorok els sorra. 2. dd letsvel trljk a sort s eltroldik a Vim pufferben. 3. Mozgassuk a kurzort azeltt a sor ELTTI sorba, ahov mozgatni szeretnnk a trlt sort. 4. Norml mdban rjunk p bett a trlt sor beillesztshez. 5. Folytassuk a 2-4. utastsokkal hogy a helyes sorrendet kapjuk. d) Can you learn too? b) Violets are blue, c) Intelligence is learned, a) Roses are red, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3.2. lecke: AZ TRS (REPLACE) PARANCS ** r s a karakterek letsvel a kurzor alatti karaktert megvltoztatjuk. ** 1. Mozgassuk a kurzort az els ---> kezdet sorra! 2. Mozgassuk a kurzort az els hiba fl! 3. r majd a kvnt karakter letsvel vltoztassuk meg a hibsat! 4. A 2. s 3. lpsekkel javtsuk az sszes hibt! ---> Whan this lime was tuoed in, someone presswd some wrojg keys! ---> When this line was typed in, someone pressed some wrong keys! 5. Menjnk a 3.2. leckre! MEGJ: Emlkezzen, hogy nem memorizlssal, hanem gyakorlssal tanuljon. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3.3. lecke: A CSERE (CHANGE) PARANCS ** A sz egy rsznek megvltoztatshoz rjuk: cw . ** 1. Mozgassuk a kurzort az els ---> kezdet sorra! 2. Vigye a kurzort a Ezen sz z betje fl! 3. cw s a helyes szrsz (itt 'bben') bersval javtsa a szt! 4. lenyomsa utn a kvetkez hibra ugorjon (az els cserlend karakterre)! 5. A 3. s 4. lpsek ismtlsvel az els mondatot tegye a msodikkal azonoss! ---> Ezen a sorrrrr pr szra meg kell vltozzanak a change utaskrs. ---> Ebben a sorban pr szt meg kell vltoztatni a change utastssal. Vegyk szre, hogy a cw nem csak a szt rja t, hanem beszr (insert) mdba vlt. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3.4. lecke: TBBFLE VLTOZTATS c-VEL ** A c utasts hasznlhat ugyanazokkal az mozgsokkal mint a trls ** 1. A change utasts a trlssel azonosan viselkedik. A forma: [szm] c mozgs OR c [szm] mozgs 2. A mozgsok is azonosak, pl. w (sz), $ (sorvg), stb. 3. Mozgassuk a kurzort az els ---> kezdet sorra! 4. Menjnk az els hibra! 5. c$ begpelsvel a sorvgeket tegyk azonoss s nyomjunk -et! ---> Ennek a sornak a vge kiigaztsra szorul, hogy megegyezzen a msodikkal. ---> Ennek a sornak a vge a c$ paranccsal vltoztathat meg. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3. LECKE SSZEFOGLALJA 1. A mr trlt sort beillesztshez nyomjunk p-t. Ez a trlt szveget a kurzor UTN helyezi (ha sor kerlt trlsre, a kurzor alatti sorba). 2. A kurzor alatti karakter trshoz az r-et s azt a karaktert nyomjuk, amellyel az eredetit fell szeretnnk rni. 3. A vltoztats (c) utasts a karaktertl az mozgs vgig vltoztatja meg az mozgst. Pldul a cw a kurzortl a sz vgig, a c$ a sor vgig. 4. A vltoztats formtuma: [szm] c mozgs VAGY c [szm] mozgs Ugorjunk a kvetkez leckre! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4.1. lecke: HELY S FJLLLAPOT ** CTRL-g megnyomsval megnzhetjk a helynket a fjlban s a fjl llapott. SHIFT-G letsvel a fjl adott sorra ugorhatunk. ** Megj: Olvassuk el az egsz leckt a lpsek vgrehajtsa eltt!! 1. Tartsuk nyomva a Ctrl gombot s nyomjunk g-t. Az llapotsor megjelenik a lap aljn a fjlnvvel s az aktulis sor sorszmval. Jegyezzk meg a sorszmot a 3. lpshez! 2. Nyomjunk Shift-G-t a lap aljra ugrshoz! 3. ssk be az eredeti sor szmt, majd ssnk shift-G-t! Ezzel visszajutunk az eredeti sorra ahol Ctrl-g-t nyomtunk. (A bert szm NEM fog megjelenni a kpernyn.) 4. Ha megjegyezte a feladatot, hajtsa vgre az 1-3. lpseket! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4.2. lecke: A KERESS (SEARCH) PARANCS ** / majd a kvnt kifejezs bersval kereshetjk meg a kifejezst. ** 1. Norml mdban ssnk / karaktert! Ez s a kurzor megjelenik a kperny aljn, ahogy a : utasts is. 2. rjuk be: 'hiibaa' ! Ez az a sz amit keresnk. 3. A kifejezs jabb keresshez ssk le egyszeren: n . A kifejezs ellenkez irnyban trtn keresshez ezt ssk be: Shift-N . 4. Ha visszafel szeretne keresni, akkor ? kell a / helyett. ---> "hiibaa" nem a helyes mdja a hiba lersnak; a hiibaa egy hiba. Megj: Ha a keress elri a fjl vgt, akkor az elejn kezdi. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4.3. lecke: ZRJELEK PRJNAK KERESSE ** % letsvel megtalljuk a ),], vagy } prjt. ** 1. Helyezze a kurzort valamelyik (, [, vagy { zrjelre a ---> kezdet sorban! 2. ssn % karaktert! 3. A kurzor a zrjel prjra fog ugrani. 4. % letsvel visszaugrik az eredeti zrjelre. ---> Ez ( egy tesztsor (-ekkel, [-ekkel ] s {-ekkel } a sorban. )) Megj: Ez nagyon hasznos, ha olyan programot debugolunk, amelyben a zrjelek nem prosak! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4.4. lecke: A HIBK KIJAVTSNAK EGY MDJA ** :s/rgi/j/g begpelsvel az 'j'-ra cserljk a 'rgi'-t. ** 1. Menjnk a ---> kezdet sorra! 2. rjuk be: :s/eggy/egy . Ekkor csak az els vltozik meg a sorban. 3. Most ezt rjuk: :s/eggy/egg/g amely globlisan helyettest a sorban, azaz minden elfordulst. Ez a sorban minden elfordulst helyettest. ---> eggy heggy meggy, szembe jn eggy msik heggy. 4. Kt sor kztt a karaktersor minden elfordulsnak helyettestse: :#,#s/rgi/j/g ahol #,# a kt sor sorszma. :%s/rgi/j/g a fjlbeli sszes elforduls helyettestse. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4. LECKE SSZEFOGLALJA 1. Ctrl-g kirja az kurzor helyt a fjlban s a fjl llapott. Shift-G a fjl vgre megy, gg az elejre. Egy szm utn Shift-G az adott szm sorra ugrik. 2. / utn egy kifejezs ELREFELE keresi a kifejezst. 2. ? utn egy kifejezs VISSZAFELE keresi a kifejezst. Egy keress utn az n a kvetkez elfordulst keresi azonos irnyban Shift-N az ellenkez irnyban keres. 3. % begpelsvel, ha (,),[,],{, vagy } karakteren vagyunk a zrjel prjra ugrik. 4. az els rgi helyettestse jjal a sorban :s/rgi/j az sszes rgi helyettestse jjal a sorban :s/rgi/j/g kt sor kztti kifejezsekre :#,#s/rgi/j/g # helyn az aktulis sor (.) s az utols ($) is llhat :.,$/rgi/j/g A fjlbeli sszes elforduls helyettestse :%s/rgi/j/g Mindenkori megerstsre vr 'c' hatsra :%s/rgi/j/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5.1. lecke: KLS PARANCS VGREHAJTSA ** :! utn kls parancsot rva vgrehajtdik a parancs. ** 1. rjuk be az ismers : parancsot, hogy a kurzort a kperny aljra helyezzk. Ez lehetv teszi egy parancs berst. 2. ! (felkiltjel) bersval tegyk lehetv kls hj (shell)-parancs vgrehajtst. 3. rjunk pldul ls parancsot a ! utn majd ssnk -t. Ez ki fogja listzni a knyvtrunkat ugyangy, mintha a shell promptnl lennnk. Vagy rja ezt :!dir ha az ls nem mkdik. Megj: Ilymdon brmely kls utasts vgrehajthat. Megj: Minden : parancs utn -t kell tni. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5.2. lecke: BVEBBEN A FJLOK RSRL ** A fjlok vltozsait gy rhatjuk ki :w FJLNV. ** 1. :!dir vagy :!ls bersval listzzuk a knyvtrunkat! n mr tudja, hogy -t kell tnie utna. 2. Vlasszon egy fjlnevet, amely mg nem ltezik pl. TESZT! 3. rja: :w TESZT (ahol TESZT a vlasztott fjlnv)! 4. Ez elmenti a teljes fjlt (a Vim oktatjt) TESZT nven. Ellenrzskpp rjuk ismt :!dir hogy lssuk a knyvtrat! (Felfel gombbal : utn az elz utastsok visszahozhatak.) Megj: Ha n kilpne a Vimbl s s visszatrne a TESZT fjlnvvel, akkor a fjl az oktat mentskori pontos msolata lenne. 5. Tvoltsa el a fjlt (MS-DOS): :!del TESZT vagy (Unix): :!rm TESZT ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5.3. lecke: EGY KIVLASZTOTT RSZ KIRSA ** A fjl egy rsznek kirshoz rja :#,# w FJLNV ** 1. :!dir vagy :!ls bersval listzza a knyvtrat, s vlasszon egy megfelel fjlnevet, pl. TESZT. 2. Mozgassa a kurzort ennek az oldalnak a tetejre, s nyomjon Ctrl-g-t, hogy megtudja a sorszmot. JEGYEZZE MEG A SZMOT! 3. Most menjen a lap aljra, s sse be ismt: Ctrl-g. EZT A SZMOT IS JEGYEZZE MEG! 4. Ha csak ezt a rszt szeretn menteni a fjlnak, rja :#,# w TESZT ahol #,# a kt sorszm, amit megjegyzett, TESZT az n fjlneve. 5. Ismt nzze meg, hogy a fjl ott van (:!dir) de NE trlje. 6. Vimben ltezik egy msik lehetsg: nyomja meg a Shift-V gombprt az els menteni kvnt soron, majd menjen le az utolsra, ezutn rja :w TESZT2 Ekkor a TESZT2 fjlba kerl a kijellt rsz. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5.4. lecke: FJLOK VISSZALLTSA S SSZEFZSE ** Egy fjl tartalmnak beillesztshez rja :r FJLNV ** 1. :!dir bersval nzze meg, hogy az n TESZT fjlja ltezik mg. 2. Helyezze a kurzort ennek az oldalnak a tetejre. MEGJ: A 3. lps utn az 5.3. leckt fogja ltni. Azutn LEFEL indulva keresse meg ismt ezt a leckt. 3. Most szrja be a TESZT nev fjlt a :r TESZT paranccsal, ahol TESZT az n fjljnak a neve. MEGJ: A fjl, amit beillesztett a kurzora alatt helyezkedik el. 4. Hogy ellenrizzk, hogy a fjlt tnyleg beillesztettk, menjen vissza, s nzze meg, hogy ktszer szerepel az 5.3. lecke! Az eredeti mellett a fjlbl bemsolt is ott van. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5. LECKE SSZEFOGLALJA 1. :!parancs vgrehajt egy kls utastst. Pr hasznos plda: (MS-DOS) (Unix) :!dir :!ls - knyvtrlista kirsa. :!del FJLNV :!rm FJLNV - FJLNV nev fjl trlse. 2. :w FJLNV kirja a jelenlegi Vim-fjlt a lemezre FJNV nven. 3. :#,#w FJLNV kirja a kt sorszm (#) kztti sorokat FJLNV-be Msik lehetsg, hogy a kezdsornl Shift-v-t nyom lemegy az utols sorra, majd ezt ti be :w FJLNV 4. :r FJLNV beolvassa a FJLNV fjlt s behelyezi a jelenlegi fjlba a kurzorpozci utni sorba. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6.1. lecke: A MEGNYITS (OPEN) PARANCS ** o bersval nyit egy j sort a kurzor alatt s beszr mdba vlt ** 1. Mozgassuk a kurzort a ---> kezdet sorra. 2. o (kicsi) bersval nyisson egy sort a kurzor ALATT! Ekkor automatikusan beszr (insert) mdba kerl. 3. Msolja le a ---> jel sort s megnyomsval lpjen ki a beszr mdbl. ---> Az o lenyomsa utn a kurzor a kvetkez sor elejn ll beszr mdban. 4. A kurzor FELETTI sor megnyitshoz egyszeren nagy O bett rjon kicsi helyett. Prblja ki a kvetkez soron! Nyisson egy j sort efelett Shift-O megnyomsval, mialatt a kurzor ezen a soron ll. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6.2. lecke: AZ APPEND PARANCS ** a lenyomsval a kurzor UTN szrhatunk szveget. ** 1. Mozgassuk a kurzort a kvetkez ---> kezdet sor vgre gy, hogy norml mdban $-t r be. 2. Kis "a" letsvel szveget szrhat be AMG a karakter mg, amelyen a kurzor ll. (A nagy "A" az egsz sor vgre rja a szveget.) Megj: A Vimben a sor legvgre is lehet llni, azonban ez eldjben a Vi-ban nem lehetsges, ezrt abban az a nlkl elg krlmnyes a sor vghez szveget rni. 3. Egsztse ki az els sort. Vegye szre, hogy az a utasts (append) teljesen egyezik az i-vel (insert) csupn a beszrt szveg helye klnbzik. ---> Ez a sor lehetv teszi nnek, hogy gyakorolja ---> Ez a sor lehetv teszi nnek, hogy gyakorolja a sor vgre beillesztst. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6.3. lecke: AZ TRS MSIK VLTOZATA ** Nagy R bersval rhat fell tbb mint egy karaktert. ** 1. Mozgassuk a kurzort az els ---> kezdet sorra! 2. Helyezze a kurzort az els sz elejre amely eltr a msodik ---> kezdet sor tartalmtl (a 'az utolsval' rsztl). 3. Nyomjon R karaktert s rja t a szveg maradkt az els sorban gy, hogy a kt sor egyez legyen. ---> Az els sort tegye azonoss az utolsval: hasznlja a gombokat. ---> Az els sort tegye azonoss a msodikkal: rjon R-t s az j szveget. 4. Jegyezzk meg, ha -et nyomok, akkor a vltozatlanul hagyott szvegek vltozatlanok maradnak. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6.4. lecke: BELLTSOK ** lltsuk be, hogy a keress s a helyettests ne fggjn kis/NAGYbetktl ** 1. Keressk meg az 'ignore'-t az berva: /ignore Ezt ismteljk tbbszr az n billentyvel 2. lltsuk be az 'ic' (Ignore case) lehetsget gy: :set ic 3. Most keressnk ismt az 'ignore'-ra n-nel Ismteljk meg tbbszr a keresst: n 4. lltsuk be a 'hlsearch' s 'incsearch' lehetsgeket: :set hls is 5. Most ismt rjuk be a keresparancsot, s lssuk mi trtnik: /ignore 6. A kiemelst szntessk meg albbi utastsok egyikvel: :set nohls vagy :nohlsearch ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6. LECKE SSZEFOGLALJA 1. o bersval j sort nyitunk meg a sor ALATT s a kurzor az j sorban lesz beszrs-mdban. Nagy O a sor FELETT nyit j sort, s oda kerl a kurzor. 2. a bersval az aktulis karaktertl UTN (jobbra) szrhatunk be szveget. Nagy A automatikusan a sor legvghez adja hozz a szveget. 3. A nagy R betsvel tr (replace) mdba kerlnk lenyomsig. 4. ":set xxx" bersval az "xxx" opci llthat be. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 7. lecke: AZ ON-LINE SG PARANCSAI ** Az online sgrendszer hasznlata ** A Vim rszletes sgval rendelkezik. Indulshoz a kvetkezk egyikt tegye: - nyomja meg a gombot (ha van ilyen) - nyomja meg az gombot (ha van ilyen) - rja be: :help :q bersval zrhatja be a sgablakot. Majdnem minden tmakrrl tallhat sgt, argumentum megadsval ":help" utasts . Prblja az albbiakat ki (-t ne felejtsk): :help w :help c_, 2006-2012 vim-7.4.1689/runtime/tutor/tutor.hu.cp1250000066400000000000000000000650721267703067000200730ustar00rootroot00000000000000=============================================================================== == d v z l j k a V I M - o k t a t b a n - 1.5-s verzi == =============================================================================== A Vim egy nagyon hatkony szerkeszt, amelynek rengeteg utastsa van, tl sok, hogy egy ilyen oktatban (tutorban), mint az itteni mindet elmagyarzzuk. Ez az oktat arra trekszik, hogy annyit elmagyarzzon, amennyi elg, hogy knnyedn hasznljuk a Vim-et, az ltalnos cl szvegszerkesztt. A feladatok megoldshoz 25-30 perc szksges attl fggen, mennyit tltnk a ksrletezssel. A leckben szerepl utastsok mdostani fogjk a szveget. Ksztsen msolatot errl a fjlrl, ha gyakorolni akar. (Ha "vimtutor"-ral indtotta, akkor ez mr egy msolat.) Fontos megrteni, hogy ez az oktat cselekedve tanttat. Ez azt jelenti, hogy nnek ajnlott vgrehajtania az utastsokat, hogy megfelelen megtanulja azokat. Ha csak olvassa, elfelejti! Most bizonyosodjon, meg, hogy a Caps-Lock gombja NINCS lenyomva, s Nyomja meg megfelel szmszor a j gombot, hogy az 1.1-es lecke teljesen a kpernyn legyen! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1.1. lecke: A KURZOR MOZGATSA ** A kurzor mozgatshoz nyomja meg a h,j,k,l gombokat az albbi szerint. ** ^ k Tipp: A h billenty van balra, s balra mozgat < h l > A l billenty van jobbra, s jobbra mozgat j A j billenty olyan, mint egy lefele nyl v 1. Mozgassa a kurzort krbe az ablakban, amg hozz nem szokik! 2. Tartsa lenyomva a lefelt (j), akkor ismtldik! ---> Most tudja, hogyan mehet a kvetkez leckre. 3. A lefel gomb hasznlatval menjen a 1.2. leckre! Megj: Ha nem biztos benne, mit nyomott meg, nyomja meg az -et, hogy norml mdba kerljn, s ismtelje meg a parancsot! Megj: A kurzor gomboknak is mkdnik kell, de a hjkl hasznlatval sokkal gyorsabban tud, mozogni, ha hozzszokik. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1.2. lecke: BE S KILPS A VIMBL !! MEGJ: Mieltt vgrehajtja az albbi lpseket, olvassa vgig a leckt !! 1. Nyomja meg az gombot (hogy biztosan norml mdban legyen). 2. rja: :q! . ---> Ezzel kilp a szerkesztbl a vltozsok MENTSE NLKL. Ha menteni szeretn a vltozsokat s kilpni, rja: :wq 3. Amikor a shell promptot ltja, rja be a parancsot, amely ebbe az oktatba hozza: Ez valsznleg: vimtutor Normlis esetben ezt rn: vim tutor.hu ---> 'vim' jelenti a vimbe belpst, 'tutor.hu' a fjl, amit szerkeszteni kvn. 4. Ha megjegyezte a lpseket s biztos magban, hajtsa vgre a lpseket 1-tl 3-ig, hogy kilpjen s visszatrjen a szerkesztbe. Azutn menjen az 1.3. leckre. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1.3. lecke: SZVEG SZERKESZTSE - TRLS ** Norml mdban nyomjon x-et, hogy a kurzor alatti karaktert trlje. ** 1. Mozgassa a kurzort a ---> kezdet sorra! 2. A hibk kijavtshoz mozgassa a kurzort amg a trlend karakter fl nem r. 3. Nyomja meg az x gombot, hogy trlje a nem kvnt karaktert. 4. Ismtelje a 2, 3, 4-es lpseket, hogy kijavtsa a mondatot. ---> szi jjjell izziik aa galaggonya rruuhja. 5. Ha a sor helyes, ugorjon a 1.4. leckre. MEGJ: A tanuls sorn ne memorizlni prbljon, hanem hasznlat sorn tanuljon. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1.4. lecke: SZVEG SZERKESZTSE - BESZRS ** Norml mdban i megnyomsval lehet beilleszteni. ** 1. Az albbi els ---> kezdet sorra menjen. 2. Ahhoz, hogy az elst azonoss tegye a msodikkal, mozgassa a kurzort az els karakterre, amely UTN szveget kell beszrni. 3. Nyomjon i-t s rja be a megfelel szveget. 4. Amikor mindent bert, nyomjon -et, hogy Norml mdba visszatrjen. Ismtelje a 2 s 4 kztti lpseket, hogy kijavtsa a mondatot. ---> Az that sol hizik pr sz. ---> Az itt lthat sorbl hinyzik pr rsz. 5. Ha mr begyakorolta a beszrst, menjen az albbi sszefoglalra. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1. LECKE SSZEFOGLALJA 1. A kurzort vagy a nyilakkal vagy a hjkl gombokkal mozgathatja. h (balra) j (le) k (fel) l (jobbra) 2. A Vimbe (a $ prompttl) gy lphet be: vim FILENAME 3. A Vimbl gy lphet ki: :q! a vltoztatsok eldobsval. vagy gy: :wq a vltozsok mentsvel. 4. A kurzor alatti karakter trlse norml mdban: x 5. Szveg beszrsa a kurzor utn norml mdban: i gpelje be a szveget MEGJ: Az megnyomsa norml mdba viszi, vagy megszakt egy nem befejezett rszben befejezett parancsot. Most folytassuk a 2. leckvel! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2.1. lecke: TRL UTASTSOK ** dw trl a sz vgig. ** 1. Nyomjon -et, hogy megbizonyosodjon, hogy norml mdban van! 2. Mozgassa a kurzort a ---> kezdet sorra! 3. Mozgassa a kurzort arra annak a sznak az elejre, amit trlni szeretne. Trlje az llatokat a mondatbl. 4. A sz trlshez rja: dw MEGJ: Ha rosszul kezdte az utastst csak nyomjon gombot a megszaktshoz. ---> Pr sz kutya nem uhu illik pingvin a mondatba tehn. 5. Ismtelje a 3 s 4 kztti utastsokat amg kell s ugorjon a 2.2 leckre! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2.2. lecke: MG TBB TRL UTASTS ** d$ bersval a sor vgig trlhet. ** 1. Nyomjon -et, hogy megbizonyosodjon, hogy norml mdban van! 2. Mozgassa a kurzort a ---> kezdet sorra! 3. Mozgassa a kurzort a helyes sor vgre (az els . UTN)! 4. d$ begpelsvel trlje a sor vgt! ---> Valaki a sor vgt ktszer gpelte be. ktszer gpelte be. 5. Menjen a 2.3. leckre, hogy megrtse mi trtnt! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2.3. lecke: UTASTSOKRL S MOZGSOKRL A d (delete=trls) utasts formja a kvetkez: [szm] d mozgs VAGY d [szm] mozgs Ahol: szm - hnyszor hajtdjon vgre a parancs (elhagyhat, alaprtk=1). d - a trls (delete) utasts. mozgs - amin a parancsnak teljeslnie kell (albb listzva). Mozgsok rvid listja: w - a kurzortl a sz vgig, belertve a szkzt. e - a kurzortl a sz vgig, NEM belertve a szkzt. $ - a kurzortl a sor vgig. MEGJ: Csupn a mozgs begpelsvel (parancs nlkl) a kurzor mozgs ltal megadott helyre kerl. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2.4. lecke: EGSZ SOROK FELDOLGOZSA ** dd bersval trlheti az egsz sort. ** A teljes sor trlsnek gyakorisga miatt a Vi tervezi elhatroztk, hogy knnyebb lenne csupn a d-t ktszer megnyomni, hogy egy sort trljnk. 1. Mozgassa a kurzort az albbi kifejezsek msodik sorra! 2. dd begpelsvel trlje a sort! 3. Menjen a 3. (eredetileg 4.) sorra! 4. 2dd (ugyebr szm-utasts-mozgs) begpelsvel trljn kt sort! 1) Alv szegek a jghideg homokban, 2) - kezdi a klt - 3) Plaktmagnyban z jjelek. 4) Pingvinek ne fljetek, 5) Tvolrl egy vaku villant, 6) gve hagytad a folyosn a villanyt. 7) Ma ontjk vremet. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2.5. lecke: A VISSZAVONS (UNDO) PARANCS ** u gpelsvel visszavonhat az utols parancs, U az egsz sort helyrelltja. ** 1. Menjnk az albbi ---> kezdet sor els hibjra! 2. x lenyomsval trlje az els felesleges karaktert! 3. u megnyomsval vonja vissza az utolsnak vgrehajtott utastst! 4. Msodjra javtson ki minden hibt a sorban az x utastssal! 5. Most nagy U -val lltsa vissza a sor eredeti llapott! 6. Nyomja meg az u gombot prszor, hogy az U s az azt megelz utastsokat visszalltsa! 7. CTRL-R (CTRL gomb lenyomsa mellett ssn R-t) prszor csinlja jra a visszavont parancsokat (redo)! ---> Javtsa a hhibkaat ebbben a sooorban majd lltsa visszaaa az eredetit. 8. Ezek nagyon hasznos parancsok. Most ugorjon a 2. lecke sszefoglaljra. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2. LECKE SSZEFOGLALJA 1. Trls a kurzortl a sz vgig: dw 2. Trls a kurzortl a sor vgig: d$ 3. Egsz sor trlse: dd 4. Egy utasts alakja norml mdban: [szm] utasts mozgs VAGY utasts [szm] mozgs ahol: szm - hnyszor ismteljk a parancsot utasts - mit tegynk, pl. d a trlskor mozgs - mire hasson az utasts, pldul w (sz=word), $ (a sor vgig), stb. 5. Az elz tett visszavonsa (undo): u (kis u) A sor sszes vltozsnak visszavonsa: U (nagy U) Visszavonsok visszavonsa: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3.1. lecke: A BEILLESZTS (PUT) PARANCS ** p letsvel az utolsnak trltet a kurzor utn illeszthetjk. ** 1. Mozgassuk a kurzort az albbi sorok els sorra. 2. dd letsvel trljk a sort s eltroldik a Vim pufferben. 3. Mozgassuk a kurzort azeltt a sor ELTTI sorba, ahov mozgatni szeretnnk a trlt sort. 4. Norml mdban rjunk p bett a trlt sor beillesztshez. 5. Folytassuk a 2-4. utastsokkal hogy a helyes sorrendet kapjuk. d) Can you learn too? b) Violets are blue, c) Intelligence is learned, a) Roses are red, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3.2. lecke: AZ TRS (REPLACE) PARANCS ** r s a karakterek letsvel a kurzor alatti karaktert megvltoztatjuk. ** 1. Mozgassuk a kurzort az els ---> kezdet sorra! 2. Mozgassuk a kurzort az els hiba fl! 3. r majd a kvnt karakter letsvel vltoztassuk meg a hibsat! 4. A 2. s 3. lpsekkel javtsuk az sszes hibt! ---> Whan this lime was tuoed in, someone presswd some wrojg keys! ---> When this line was typed in, someone pressed some wrong keys! 5. Menjnk a 3.2. leckre! MEGJ: Emlkezzen, hogy nem memorizlssal, hanem gyakorlssal tanuljon. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3.3. lecke: A CSERE (CHANGE) PARANCS ** A sz egy rsznek megvltoztatshoz rjuk: cw . ** 1. Mozgassuk a kurzort az els ---> kezdet sorra! 2. Vigye a kurzort a Ezen sz z betje fl! 3. cw s a helyes szrsz (itt 'bben') bersval javtsa a szt! 4. lenyomsa utn a kvetkez hibra ugorjon (az els cserlend karakterre)! 5. A 3. s 4. lpsek ismtlsvel az els mondatot tegye a msodikkal azonoss! ---> Ezen a sorrrrr pr szra meg kell vltozzanak a change utaskrs. ---> Ebben a sorban pr szt meg kell vltoztatni a change utastssal. Vegyk szre, hogy a cw nem csak a szt rja t, hanem beszr (insert) mdba vlt. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3.4. lecke: TBBFLE VLTOZTATS c-VEL ** A c utasts hasznlhat ugyanazokkal az mozgsokkal mint a trls ** 1. A change utasts a trlssel azonosan viselkedik. A forma: [szm] c mozgs OR c [szm] mozgs 2. A mozgsok is azonosak, pl. w (sz), $ (sorvg), stb. 3. Mozgassuk a kurzort az els ---> kezdet sorra! 4. Menjnk az els hibra! 5. c$ begpelsvel a sorvgeket tegyk azonoss s nyomjunk -et! ---> Ennek a sornak a vge kiigaztsra szorul, hogy megegyezzen a msodikkal. ---> Ennek a sornak a vge a c$ paranccsal vltoztathat meg. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3. LECKE SSZEFOGLALJA 1. A mr trlt sort beillesztshez nyomjunk p-t. Ez a trlt szveget a kurzor UTN helyezi (ha sor kerlt trlsre, a kurzor alatti sorba). 2. A kurzor alatti karakter trshoz az r-et s azt a karaktert nyomjuk, amellyel az eredetit fell szeretnnk rni. 3. A vltoztats (c) utasts a karaktertl az mozgs vgig vltoztatja meg az mozgst. Pldul a cw a kurzortl a sz vgig, a c$ a sor vgig. 4. A vltoztats formtuma: [szm] c mozgs VAGY c [szm] mozgs Ugorjunk a kvetkez leckre! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4.1. lecke: HELY S FJLLLAPOT ** CTRL-g megnyomsval megnzhetjk a helynket a fjlban s a fjl llapott. SHIFT-G letsvel a fjl adott sorra ugorhatunk. ** Megj: Olvassuk el az egsz leckt a lpsek vgrehajtsa eltt!! 1. Tartsuk nyomva a Ctrl gombot s nyomjunk g-t. Az llapotsor megjelenik a lap aljn a fjlnvvel s az aktulis sor sorszmval. Jegyezzk meg a sorszmot a 3. lpshez! 2. Nyomjunk Shift-G-t a lap aljra ugrshoz! 3. ssk be az eredeti sor szmt, majd ssnk shift-G-t! Ezzel visszajutunk az eredeti sorra ahol Ctrl-g-t nyomtunk. (A bert szm NEM fog megjelenni a kpernyn.) 4. Ha megjegyezte a feladatot, hajtsa vgre az 1-3. lpseket! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4.2. lecke: A KERESS (SEARCH) PARANCS ** / majd a kvnt kifejezs bersval kereshetjk meg a kifejezst. ** 1. Norml mdban ssnk / karaktert! Ez s a kurzor megjelenik a kperny aljn, ahogy a : utasts is. 2. rjuk be: 'hiibaa' ! Ez az a sz amit keresnk. 3. A kifejezs jabb keresshez ssk le egyszeren: n . A kifejezs ellenkez irnyban trtn keresshez ezt ssk be: Shift-N . 4. Ha visszafel szeretne keresni, akkor ? kell a / helyett. ---> "hiibaa" nem a helyes mdja a hiba lersnak; a hiibaa egy hiba. Megj: Ha a keress elri a fjl vgt, akkor az elejn kezdi. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4.3. lecke: ZRJELEK PRJNAK KERESSE ** % letsvel megtalljuk a ),], vagy } prjt. ** 1. Helyezze a kurzort valamelyik (, [, vagy { zrjelre a ---> kezdet sorban! 2. ssn % karaktert! 3. A kurzor a zrjel prjra fog ugrani. 4. % letsvel visszaugrik az eredeti zrjelre. ---> Ez ( egy tesztsor (-ekkel, [-ekkel ] s {-ekkel } a sorban. )) Megj: Ez nagyon hasznos, ha olyan programot debugolunk, amelyben a zrjelek nem prosak! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4.4. lecke: A HIBK KIJAVTSNAK EGY MDJA ** :s/rgi/j/g begpelsvel az 'j'-ra cserljk a 'rgi'-t. ** 1. Menjnk a ---> kezdet sorra! 2. rjuk be: :s/eggy/egy . Ekkor csak az els vltozik meg a sorban. 3. Most ezt rjuk: :s/eggy/egg/g amely globlisan helyettest a sorban, azaz minden elfordulst. Ez a sorban minden elfordulst helyettest. ---> eggy heggy meggy, szembe jn eggy msik heggy. 4. Kt sor kztt a karaktersor minden elfordulsnak helyettestse: :#,#s/rgi/j/g ahol #,# a kt sor sorszma. :%s/rgi/j/g a fjlbeli sszes elforduls helyettestse. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4. LECKE SSZEFOGLALJA 1. Ctrl-g kirja az kurzor helyt a fjlban s a fjl llapott. Shift-G a fjl vgre megy, gg az elejre. Egy szm utn Shift-G az adott szm sorra ugrik. 2. / utn egy kifejezs ELREFELE keresi a kifejezst. 2. ? utn egy kifejezs VISSZAFELE keresi a kifejezst. Egy keress utn az n a kvetkez elfordulst keresi azonos irnyban Shift-N az ellenkez irnyban keres. 3. % begpelsvel, ha (,),[,],{, vagy } karakteren vagyunk a zrjel prjra ugrik. 4. az els rgi helyettestse jjal a sorban :s/rgi/j az sszes rgi helyettestse jjal a sorban :s/rgi/j/g kt sor kztti kifejezsekre :#,#s/rgi/j/g # helyn az aktulis sor (.) s az utols ($) is llhat :.,$/rgi/j/g A fjlbeli sszes elforduls helyettestse :%s/rgi/j/g Mindenkori megerstsre vr 'c' hatsra :%s/rgi/j/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5.1. lecke: KLS PARANCS VGREHAJTSA ** :! utn kls parancsot rva vgrehajtdik a parancs. ** 1. rjuk be az ismers : parancsot, hogy a kurzort a kperny aljra helyezzk. Ez lehetv teszi egy parancs berst. 2. ! (felkiltjel) bersval tegyk lehetv kls hj (shell)-parancs vgrehajtst. 3. rjunk pldul ls parancsot a ! utn majd ssnk -t. Ez ki fogja listzni a knyvtrunkat ugyangy, mintha a shell promptnl lennnk. Vagy rja ezt :!dir ha az ls nem mkdik. Megj: Ilymdon brmely kls utasts vgrehajthat. Megj: Minden : parancs utn -t kell tni. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5.2. lecke: BVEBBEN A FJLOK RSRL ** A fjlok vltozsait gy rhatjuk ki :w FJLNV. ** 1. :!dir vagy :!ls bersval listzzuk a knyvtrunkat! n mr tudja, hogy -t kell tnie utna. 2. Vlasszon egy fjlnevet, amely mg nem ltezik pl. TESZT! 3. rja: :w TESZT (ahol TESZT a vlasztott fjlnv)! 4. Ez elmenti a teljes fjlt (a Vim oktatjt) TESZT nven. Ellenrzskpp rjuk ismt :!dir hogy lssuk a knyvtrat! (Felfel gombbal : utn az elz utastsok visszahozhatak.) Megj: Ha n kilpne a Vimbl s s visszatrne a TESZT fjlnvvel, akkor a fjl az oktat mentskori pontos msolata lenne. 5. Tvoltsa el a fjlt (MS-DOS): :!del TESZT vagy (Unix): :!rm TESZT ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5.3. lecke: EGY KIVLASZTOTT RSZ KIRSA ** A fjl egy rsznek kirshoz rja :#,# w FJLNV ** 1. :!dir vagy :!ls bersval listzza a knyvtrat, s vlasszon egy megfelel fjlnevet, pl. TESZT. 2. Mozgassa a kurzort ennek az oldalnak a tetejre, s nyomjon Ctrl-g-t, hogy megtudja a sorszmot. JEGYEZZE MEG A SZMOT! 3. Most menjen a lap aljra, s sse be ismt: Ctrl-g. EZT A SZMOT IS JEGYEZZE MEG! 4. Ha csak ezt a rszt szeretn menteni a fjlnak, rja :#,# w TESZT ahol #,# a kt sorszm, amit megjegyzett, TESZT az n fjlneve. 5. Ismt nzze meg, hogy a fjl ott van (:!dir) de NE trlje. 6. Vimben ltezik egy msik lehetsg: nyomja meg a Shift-V gombprt az els menteni kvnt soron, majd menjen le az utolsra, ezutn rja :w TESZT2 Ekkor a TESZT2 fjlba kerl a kijellt rsz. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5.4. lecke: FJLOK VISSZALLTSA S SSZEFZSE ** Egy fjl tartalmnak beillesztshez rja :r FJLNV ** 1. :!dir bersval nzze meg, hogy az n TESZT fjlja ltezik mg. 2. Helyezze a kurzort ennek az oldalnak a tetejre. MEGJ: A 3. lps utn az 5.3. leckt fogja ltni. Azutn LEFEL indulva keresse meg ismt ezt a leckt. 3. Most szrja be a TESZT nev fjlt a :r TESZT paranccsal, ahol TESZT az n fjljnak a neve. MEGJ: A fjl, amit beillesztett a kurzora alatt helyezkedik el. 4. Hogy ellenrizzk, hogy a fjlt tnyleg beillesztettk, menjen vissza, s nzze meg, hogy ktszer szerepel az 5.3. lecke! Az eredeti mellett a fjlbl bemsolt is ott van. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5. LECKE SSZEFOGLALJA 1. :!parancs vgrehajt egy kls utastst. Pr hasznos plda: (MS-DOS) (Unix) :!dir :!ls - knyvtrlista kirsa. :!del FJLNV :!rm FJLNV - FJLNV nev fjl trlse. 2. :w FJLNV kirja a jelenlegi Vim-fjlt a lemezre FJNV nven. 3. :#,#w FJLNV kirja a kt sorszm (#) kztti sorokat FJLNV-be Msik lehetsg, hogy a kezdsornl Shift-v-t nyom lemegy az utols sorra, majd ezt ti be :w FJLNV 4. :r FJLNV beolvassa a FJLNV fjlt s behelyezi a jelenlegi fjlba a kurzorpozci utni sorba. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6.1. lecke: A MEGNYITS (OPEN) PARANCS ** o bersval nyit egy j sort a kurzor alatt s beszr mdba vlt ** 1. Mozgassuk a kurzort a ---> kezdet sorra. 2. o (kicsi) bersval nyisson egy sort a kurzor ALATT! Ekkor automatikusan beszr (insert) mdba kerl. 3. Msolja le a ---> jel sort s megnyomsval lpjen ki a beszr mdbl. ---> Az o lenyomsa utn a kurzor a kvetkez sor elejn ll beszr mdban. 4. A kurzor FELETTI sor megnyitshoz egyszeren nagy O bett rjon kicsi helyett. Prblja ki a kvetkez soron! Nyisson egy j sort efelett Shift-O megnyomsval, mialatt a kurzor ezen a soron ll. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6.2. lecke: AZ APPEND PARANCS ** a lenyomsval a kurzor UTN szrhatunk szveget. ** 1. Mozgassuk a kurzort a kvetkez ---> kezdet sor vgre gy, hogy norml mdban $-t r be. 2. Kis "a" letsvel szveget szrhat be AMG a karakter mg, amelyen a kurzor ll. (A nagy "A" az egsz sor vgre rja a szveget.) Megj: A Vimben a sor legvgre is lehet llni, azonban ez eldjben a Vi-ban nem lehetsges, ezrt abban az a nlkl elg krlmnyes a sor vghez szveget rni. 3. Egsztse ki az els sort. Vegye szre, hogy az a utasts (append) teljesen egyezik az i-vel (insert) csupn a beszrt szveg helye klnbzik. ---> Ez a sor lehetv teszi nnek, hogy gyakorolja ---> Ez a sor lehetv teszi nnek, hogy gyakorolja a sor vgre beillesztst. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6.3. lecke: AZ TRS MSIK VLTOZATA ** Nagy R bersval rhat fell tbb mint egy karaktert. ** 1. Mozgassuk a kurzort az els ---> kezdet sorra! 2. Helyezze a kurzort az els sz elejre amely eltr a msodik ---> kezdet sor tartalmtl (a 'az utolsval' rsztl). 3. Nyomjon R karaktert s rja t a szveg maradkt az els sorban gy, hogy a kt sor egyez legyen. ---> Az els sort tegye azonoss az utolsval: hasznlja a gombokat. ---> Az els sort tegye azonoss a msodikkal: rjon R-t s az j szveget. 4. Jegyezzk meg, ha -et nyomok, akkor a vltozatlanul hagyott szvegek vltozatlanok maradnak. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6.4. lecke: BELLTSOK ** lltsuk be, hogy a keress s a helyettests ne fggjn kis/NAGYbetktl ** 1. Keressk meg az 'ignore'-t az berva: /ignore Ezt ismteljk tbbszr az n billentyvel 2. lltsuk be az 'ic' (Ignore case) lehetsget gy: :set ic 3. Most keressnk ismt az 'ignore'-ra n-nel Ismteljk meg tbbszr a keresst: n 4. lltsuk be a 'hlsearch' s 'incsearch' lehetsgeket: :set hls is 5. Most ismt rjuk be a keresparancsot, s lssuk mi trtnik: /ignore 6. A kiemelst szntessk meg albbi utastsok egyikvel: :set nohls vagy :nohlsearch ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6. LECKE SSZEFOGLALJA 1. o bersval j sort nyitunk meg a sor ALATT s a kurzor az j sorban lesz beszrs-mdban. Nagy O a sor FELETT nyit j sort, s oda kerl a kurzor. 2. a bersval az aktulis karaktertl UTN (jobbra) szrhatunk be szveget. Nagy A automatikusan a sor legvghez adja hozz a szveget. 3. A nagy R betsvel tr (replace) mdba kerlnk lenyomsig. 4. ":set xxx" bersval az "xxx" opci llthat be. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 7. lecke: AZ ON-LINE SG PARANCSAI ** Az online sgrendszer hasznlata ** A Vim rszletes sgval rendelkezik. Indulshoz a kvetkezk egyikt tegye: - nyomja meg a gombot (ha van ilyen) - nyomja meg az gombot (ha van ilyen) - rja be: :help :q bersval zrhatja be a sgablakot. Majdnem minden tmakrrl tallhat sgt, argumentum megadsval ":help" utasts . Prblja az albbiakat ki (-t ne felejtsk): :help w :help c_, 2006-2012 vim-7.4.1689/runtime/tutor/tutor.hu.utf-8000066400000000000000000000704321267703067000201200ustar00rootroot00000000000000=============================================================================== == Ü d v ö z ö l j ü k a V I M - o k t a t ó b a n - 1.5-ös verzió == =============================================================================== A Vim egy nagyon hatékony szerkesztő, amelynek rengeteg utasítása van, túl sok, hogy egy ilyen oktatóban (tutorban), mint az itteni mindet elmagyarázzuk. Ez az oktató arra törekszik, hogy annyit elmagyarázzon, amennyi elég, hogy könnyedén használjuk a Vim-et, az általános célú szövegszerkesztőt. A feladatok megoldásához 25-30 perc szükséges attól függően, mennyit töltünk a kísérletezéssel. A leckében szereplő utasítások módosítani fogják a szöveget. Készítsen másolatot erről a fájlról, ha gyakorolni akar. (Ha "vimtutor"-ral indította, akkor ez már egy másolat.) Fontos megérteni, hogy ez az oktató cselekedve taníttat. Ez azt jelenti, hogy Önnek ajánlott végrehajtania az utasításokat, hogy megfelelően megtanulja azokat. Ha csak olvassa, elfelejti! Most bizonyosodjon, meg, hogy a Caps-Lock gombja NINCS lenyomva, és Nyomja meg megfelelő számúszor a j gombot, hogy az 1.1-es lecke teljesen a képernyőn legyen! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1.1. lecke: A KURZOR MOZGATÁSA ** A kurzor mozgatásához nyomja meg a h,j,k,l gombokat az alábbi szerint. ** ^ k Tipp: A h billentyű van balra, és balra mozgat < h l > A l billentyű van jobbra, és jobbra mozgat j A j billentyű olyan, mint egy lefele nyíl v 1. Mozgassa a kurzort körbe az ablakban, amíg hozzá nem szokik! 2. Tartsa lenyomva a lefelét (j), akkor ismétlődik! ---> Most tudja, hogyan mehet a következő leckére. 3. A lefelé gomb használatával menjen a 1.2. leckére! Megj: Ha nem biztos benne, mit nyomott meg, nyomja meg az -et, hogy normál módba kerüljön, és ismételje meg a parancsot! Megj: A kurzor gomboknak is működniük kell, de a hjkl használatával sokkal gyorsabban tud, mozogni, ha hozzászokik. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1.2. lecke: BE ÉS KILÉPÉS A VIMBŐL !! MEGJ: Mielőtt végrehajtja az alábbi lépéseket, olvassa végig a leckét !! 1. Nyomja meg az gombot (hogy biztosan normál módban legyen). 2. Írja: :q! . ---> Ezzel kilép a szerkesztőből a változások MENTÉSE NÉLKÜL. Ha menteni szeretné a változásokat és kilépni, írja: :wq 3. Amikor a shell promptot látja, írja be a parancsot, amely ebbe az oktatóba hozza: Ez valószínűleg: vimtutor Normális esetben ezt írná: vim tutor.hu ---> 'vim' jelenti a vimbe belépést, 'tutor.hu' a fájl, amit szerkeszteni kíván. 4. Ha megjegyezte a lépéseket és biztos magában, hajtsa végre a lépéseket 1-től 3-ig, hogy kilépjen és visszatérjen a szerkesztőbe. Azután menjen az 1.3. leckére. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1.3. lecke: SZÖVEG SZERKESZTÉSE - TÖRLÉS ** Normál módban nyomjon x-et, hogy a kurzor alatti karaktert törölje. ** 1. Mozgassa a kurzort a ---> kezdetű sorra! 2. A hibák kijavításához mozgassa a kurzort amíg a törlendő karakter fölé nem ér. 3. Nyomja meg az x gombot, hogy törölje a nem kívánt karaktert. 4. Ismételje a 2, 3, 4-es lépéseket, hogy kijavítsa a mondatot. ---> ŐŐszi éjjjell izziik aa galaggonya rruuhája. 5. Ha a sor helyes, ugorjon a 1.4. leckére. MEGJ: A tanulás során ne memorizálni próbáljon, hanem használat során tanuljon. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1.4. lecke: SZÖVEG SZERKESZTÉSE - BESZÚRÁS ** Normál módban i megnyomásával lehet beilleszteni. ** 1. Az alábbi első ---> kezdetű sorra menjen. 2. Ahhoz, hogy az elsőt azonossá tegye a másodikkal, mozgassa a kurzort az első karakterre, amely UTÁN szöveget kell beszúrni. 3. Nyomjon i-t és írja be a megfelelő szöveget. 4. Amikor mindent beírt, nyomjon -et, hogy Normál módba visszatérjen. Ismételje a 2 és 4 közötti lépéseket, hogy kijavítsa a mondatot. ---> Az átható soól hizik pár ész. ---> Az itt látható sorból hiányzik pár rész. 5. Ha már begyakorolta a beszúrást, menjen az alábbi összefoglalóra. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1. LECKE ÖSSZEFOGLALÓJA 1. A kurzort vagy a nyilakkal vagy a hjkl gombokkal mozgathatja. h (balra) j (le) k (fel) l (jobbra) 2. A Vimbe (a $ prompttól) így léphet be: vim FILENAME 3. A Vimből így léphet ki: :q! a változtatások eldobásával. vagy így: :wq a változások mentésével. 4. A kurzor alatti karakter törlése normál módban: x 5. Szöveg beszúrása a kurzor után normál módban: i gépelje be a szöveget MEGJ: Az megnyomása normál módba viszi, vagy megszakít egy nem befejezett részben befejezett parancsot. Most folytassuk a 2. leckével! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2.1. lecke: TÖRLŐ UTASÍTÁSOK ** dw töröl a szó végéig. ** 1. Nyomjon -et, hogy megbizonyosodjon, hogy normál módban van! 2. Mozgassa a kurzort a ---> kezdetű sorra! 3. Mozgassa a kurzort arra annak a szónak az elejére, amit törölni szeretne. Törölje az állatokat a mondatból. 4. A szó törléséhez írja: dw MEGJ: Ha rosszul kezdte az utasítást csak nyomjon gombot a megszakításához. ---> Pár szó kutya nem uhu illik pingvin a mondatba tehén. 5. Ismételje a 3 és 4 közötti utasításokat amíg kell és ugorjon a 2.2 leckére! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2.2. lecke: MÉG TÖBB TÖRLŐ UTASÍTÁS ** d$ beírásával a sor végéig törölhet. ** 1. Nyomjon -et, hogy megbizonyosodjon, hogy normál módban van! 2. Mozgassa a kurzort a ---> kezdetű sorra! 3. Mozgassa a kurzort a helyes sor végére (az első . UTÁN)! 4. d$ begépelésével törölje a sor végét! ---> Valaki a sor végét kétszer gépelte be. kétszer gépelte be. 5. Menjen a 2.3. leckére, hogy megértse mi történt! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2.3. lecke: UTASÍTÁSOKRÓL ÉS MOZGÁSOKRÓL A d (delete=törlés) utasítás formája a következő: [szám] d mozgás VAGY d [szám] mozgás Ahol: szám - hányszor hajtódjon végre a parancs (elhagyható, alapérték=1). d - a törlés (delete) utasítás. mozgás - amin a parancsnak teljesülnie kell (alább listázva). Mozgások rövid listája: w - a kurzortól a szó végéig, beleértve a szóközt. e - a kurzortól a szó végéig, NEM beleértve a szóközt. $ - a kurzortól a sor végéig. MEGJ: Csupán a mozgás begépelésével (parancs nélkül) a kurzor mozgás által megadott helyre kerül. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2.4. lecke: EGÉSZ SOROK FELDOLGOZÁSA ** dd beírásával törölheti az egész sort. ** A teljes sor törlésének gyakorisága miatt a Vi tervezői elhatározták, hogy könnyebb lenne csupán a d-t kétszer megnyomni, hogy egy sort töröljünk. 1. Mozgassa a kurzort az alábbi kifejezések második sorára! 2. dd begépelésével törölje a sort! 3. Menjen a 3. (eredetileg 4.) sorra! 4. 2dd (ugyebár szám-utasítás-mozgás) begépelésével töröljön két sort! 1) Alvó szegek a jéghideg homokban, 2) - kezdi a költő - 3) Plakátmagányban ázó éjjelek. 4) Pingvinek ne féljetek, 5) Távolról egy vaku villant, 6) Égve hagytad a folyosón a villanyt. 7) Ma ontják véremet. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2.5. lecke: A VISSZAVONÁS (UNDO) PARANCS ** u gépelésével visszavonható az utolsó parancs, U az egész sort helyreállítja. ** 1. Menjünk az alábbi ---> kezdetű sor első hibájára! 2. x lenyomásával törölje az első felesleges karaktert! 3. u megnyomásával vonja vissza az utolsónak végrehajtott utasítást! 4. Másodjára javítson ki minden hibát a sorban az x utasítással! 5. Most nagy U -val állítsa vissza a sor eredeti állapotát! 6. Nyomja meg az u gombot párszor, hogy az U és az azt megelőző utasításokat visszaállítsa! 7. CTRL-R (CTRL gomb lenyomása mellett üssön R-t) párszor csinálja újra a visszavont parancsokat (redo)! ---> Javíítsa a hhibákaat ebbben a sooorban majd állítsa visszaaa az eredetit. 8. Ezek nagyon hasznos parancsok. Most ugorjon a 2. lecke összefoglalójára. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2. LECKE ÖSSZEFOGLALÓJA 1. Törlés a kurzortól a szó végéig: dw 2. Törlés a kurzortól a sor végéig: d$ 3. Egész sor törlése: dd 4. Egy utasítás alakja normál módban: [szám] utasítás mozgás VAGY utasítás [szám] mozgás ahol: szám - hányszor ismételjük a parancsot utasítás - mit tegyünk, pl. d a törléskor mozgás - mire hasson az utasítás, például w (szó=word), $ (a sor végéig), stb. 5. Az előző tett visszavonása (undo): u (kis u) A sor összes változásának visszavonása: U (nagy U) Visszavonások visszavonása: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3.1. lecke: A BEILLESZTÉS (PUT) PARANCS ** p leütésével az utolsónak töröltet a kurzor után illeszthetjük. ** 1. Mozgassuk a kurzort az alábbi sorok első sorára. 2. dd leütésével töröljük a sort és eltárolódik a Vim pufferében. 3. Mozgassuk a kurzort azelőtt a sor ELŐTTI sorba, ahová mozgatni szeretnénk a törölt sort. 4. Normál módban írjunk p betűt a törölt sor beillesztéséhez. 5. Folytassuk a 2-4. utasításokkal hogy a helyes sorrendet kapjuk. d) Can you learn too? b) Violets are blue, c) Intelligence is learned, a) Roses are red, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3.2. lecke: AZ ÁTÍRÁS (REPLACE) PARANCS ** r és a karakterek leütésével a kurzor alatti karaktert megváltoztatjuk. ** 1. Mozgassuk a kurzort az első ---> kezdetű sorra! 2. Mozgassuk a kurzort az első hiba fölé! 3. r majd a kívánt karakter leütésével változtassuk meg a hibásat! 4. A 2. és 3. lépésekkel javítsuk az összes hibát! ---> Whan this lime was tuoed in, someone presswd some wrojg keys! ---> When this line was typed in, someone pressed some wrong keys! 5. Menjünk a 3.2. leckére! MEGJ: Emlékezzen, hogy nem memorizálással, hanem gyakorlással tanuljon. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3.3. lecke: A CSERE (CHANGE) PARANCS ** A szó egy részének megváltoztatásához írjuk: cw . ** 1. Mozgassuk a kurzort az első ---> kezdetű sorra! 2. Vigye a kurzort a Ezen szó z betűje fölé! 3. cw és a helyes szórész (itt 'bben') beírásával javítsa a szót! 4. lenyomása után a következő hibára ugorjon (az első cserélendő karakterre)! 5. A 3. és 4. lépések ismétlésével az első mondatot tegye a másodikkal azonossá! ---> Ezen a sorrrrr pár szóra meg kell változzanak a change utaskíréső. ---> Ebben a sorban pár szót meg kell változtatni a change utasítással. Vegyük észre, hogy a cw nem csak a szót írja át, hanem beszúró (insert) módba vált. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3.4. lecke: TÖBBFÉLE VÁLTOZTATÁS c-VEL ** A c utasítás használható ugyanazokkal az mozgásokkal mint a törlés ** 1. A change utasítás a törléssel azonosan viselkedik. A forma: [szám] c mozgás OR c [szám] mozgás 2. A mozgások is azonosak, pl. w (szó), $ (sorvég), stb. 3. Mozgassuk a kurzort az első ---> kezdetű sorra! 4. Menjünk az első hibára! 5. c$ begépelésével a sorvégeket tegyük azonossá és nyomjunk -et! ---> Ennek a sornak a vége kiigazításra szorul, hogy megegyezzen a másodikkal. ---> Ennek a sornak a vége a c$ paranccsal változtatható meg. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3. LECKE ÖSSZEFOGLALÓJA 1. A már törölt sort beillesztéséhez nyomjunk p-t. Ez a törölt szöveget a kurzor UTÁN helyezi (ha sor került törlésre, a kurzor alatti sorba). 2. A kurzor alatti karakter átírásához az r-et és azt a karaktert nyomjuk, amellyel az eredetit felül szeretnénk írni. 3. A változtatás (c) utasítás a karaktertől az mozgás végéig változtatja meg az mozgást. Például a cw a kurzortól a szó végéig, a c$ a sor végéig. 4. A változtatás formátuma: [szám] c mozgás VAGY c [szám] mozgás Ugorjunk a következő leckére! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4.1. lecke: HELY ÉS FÁJLÁLLAPOT ** CTRL-g megnyomásával megnézhetjük a helyünket a fájlban és a fájl állapotát. SHIFT-G leütésével a fájl adott sorára ugorhatunk. ** Megj: Olvassuk el az egész leckét a lépések végrehajtása előtt!! 1. Tartsuk nyomva a Ctrl gombot és nyomjunk g-t. Az állapotsor megjelenik a lap alján a fájlnévvel és az aktuális sor sorszámával. Jegyezzük meg a sorszámot a 3. lépéshez! 2. Nyomjunk Shift-G-t a lap aljára ugráshoz! 3. Üssük be az eredeti sor számát, majd üssünk shift-G-t! Ezzel visszajutunk az eredeti sorra ahol Ctrl-g-t nyomtunk. (A beírt szám NEM fog megjelenni a képernyőn.) 4. Ha megjegyezte a feladatot, hajtsa végre az 1-3. lépéseket! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4.2. lecke: A KERESÉS (SEARCH) PARANCS ** / majd a kívánt kifejezés beírásával kereshetjük meg a kifejezést. ** 1. Normál módban üssünk / karaktert! Ez és a kurzor megjelenik a képernyő alján, ahogy a : utasítás is. 2. Írjuk be: 'hiibaa' ! Ez az a szó amit keresünk. 3. A kifejezés újabb kereséséhez üssük le egyszerűen: n . A kifejezés ellenkező irányban történő kereséséhez ezt üssük be: Shift-N . 4. Ha visszafelé szeretne keresni, akkor ? kell a / helyett. ---> "hiibaa" nem a helyes módja a hiba leírásának; a hiibaa egy hiba. Megj: Ha a keresés eléri a fájl végét, akkor az elején kezdi. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4.3. lecke: ZÁRÓJELEK PÁRJÁNAK KERESÉSE ** % leütésével megtaláljuk a ),], vagy } párját. ** 1. Helyezze a kurzort valamelyik (, [, vagy { zárójelre a ---> kezdetű sorban! 2. Üssön % karaktert! 3. A kurzor a zárójel párjára fog ugrani. 4. % leütésével visszaugrik az eredeti zárójelre. ---> Ez ( egy tesztsor (-ekkel, [-ekkel ] és {-ekkel } a sorban. )) Megj: Ez nagyon hasznos, ha olyan programot debugolunk, amelyben a zárójelek nem párosak! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4.4. lecke: A HIBÁK KIJAVÍTÁSÁNAK EGY MÓDJA ** :s/régi/új/g begépelésével az 'új'-ra cseréljük a 'régi'-t. ** 1. Menjünk a ---> kezdetű sorra! 2. Írjuk be: :s/eggy/egy . Ekkor csak az első változik meg a sorban. 3. Most ezt írjuk: :s/eggy/egg/g amely globálisan helyettesít a sorban, azaz minden előfordulást. Ez a sorban minden előfordulást helyettesít. ---> eggy heggy meggy, szembe jön eggy másik heggy. 4. Két sor között a karaktersor minden előfordulásának helyettesítése: :#,#s/régi/új/g ahol #,# a két sor sorszáma. :%s/régi/új/g a fájlbeli összes előfordulás helyettesítése. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4. LECKE ÖSSZEFOGLALÓJA 1. Ctrl-g kiírja az kurzor helyét a fájlban és a fájl állapotát. Shift-G a fájl végére megy, gg az elejére. Egy szám után Shift-G az adott számú sorra ugrik. 2. / után egy kifejezés ELŐREFELE keresi a kifejezést. 2. ? után egy kifejezés VISSZAFELE keresi a kifejezést. Egy keresés után az n a következő előfordulást keresi azonos irányban Shift-N az ellenkező irányban keres. 3. % begépelésével, ha (,),[,],{, vagy } karakteren vagyunk a zárójel párjára ugrik. 4. az első régi helyettesítése újjal a sorban :s/régi/új az összes régi helyettesítése újjal a sorban :s/régi/új/g két sor közötti kifejezésekre :#,#s/régi/új/g # helyén az aktuális sor (.) és az utolsó ($) is állhat :.,$/régi/új/g A fájlbeli összes előfordulás helyettesítése :%s/régi/új/g Mindenkori megerősítésre vár 'c' hatására :%s/régi/új/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5.1. lecke: KÜLSŐ PARANCS VÉGREHAJTÁSA ** :! után külső parancsot írva végrehajtódik a parancs. ** 1. Írjuk be az ismerős : parancsot, hogy a kurzort a képernyő aljára helyezzük. Ez lehetővé teszi egy parancs beírását. 2. ! (felkiáltójel) beírásával tegyük lehetővé külső héj (shell)-parancs végrehajtását. 3. Írjunk például ls parancsot a ! után majd üssünk -t. Ez ki fogja listázni a könyvtárunkat ugyanúgy, mintha a shell promptnál lennénk. Vagy írja ezt :!dir ha az ls nem működik. Megj: Ilymódon bármely külső utasítás végrehajtható. Megj: Minden : parancs után -t kell ütni. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5.2. lecke: BŐVEBBEN A FÁJLOK ÍRÁSÁRÓL ** A fájlok változásait így írhatjuk ki :w FÁJLNÉV. ** 1. :!dir vagy :!ls beírásával listázzuk a könyvtárunkat! Ön már tudja, hogy -t kell ütnie utána. 2. Válasszon egy fájlnevet, amely még nem létezik pl. TESZT! 3. Írja: :w TESZT (ahol TESZT a választott fájlnév)! 4. Ez elmenti a teljes fájlt (a Vim oktatóját) TESZT néven. Ellenőrzésképp írjuk ismét :!dir hogy lássuk a könyvtárat! (Felfelé gombbal : után az előző utasítások visszahozhatóak.) Megj: Ha Ön kilépne a Vimből és és visszatérne a TESZT fájlnévvel, akkor a fájl az oktató mentéskori pontos másolata lenne. 5. Távolítsa el a fájlt (MS-DOS): :!del TESZT vagy (Unix): :!rm TESZT ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5.3. lecke: EGY KIVÁLASZTOTT RÉSZ KIÍRÁSA ** A fájl egy részének kiírásához írja :#,# w FÁJLNÉV ** 1. :!dir vagy :!ls beírásával listázza a könyvtárat, és válasszon egy megfelelő fájlnevet, pl. TESZT. 2. Mozgassa a kurzort ennek az oldalnak a tetejére, és nyomjon Ctrl-g-t, hogy megtudja a sorszámot. JEGYEZZE MEG A SZÁMOT! 3. Most menjen a lap aljára, és üsse be ismét: Ctrl-g. EZT A SZÁMOT IS JEGYEZZE MEG! 4. Ha csak ezt a részét szeretné menteni a fájlnak, írja :#,# w TESZT ahol #,# a két sorszám, amit megjegyzett, TESZT az Ön fájlneve. 5. Ismét nézze meg, hogy a fájl ott van (:!dir) de NE törölje. 6. Vimben létezik egy másik lehetőség: nyomja meg a Shift-V gombpárt az első menteni kívánt soron, majd menjen le az utolsóra, ezután írja :w TESZT2 Ekkor a TESZT2 fájlba kerül a kijelölt rész. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5.4. lecke: FÁJLOK VISSZAÁLLÍTÁSA ÉS ÖSSZEFŰZÉSE ** Egy fájl tartalmának beillesztéséhez írja :r FÁJLNÉV ** 1. :!dir beírásával nézze meg, hogy az Ön TESZT fájlja létezik még. 2. Helyezze a kurzort ennek az oldalnak a tetejére. MEGJ: A 3. lépés után az 5.3. leckét fogja látni. Azután LEFELÉ indulva keresse meg ismét ezt a leckét. 3. Most szúrja be a TESZT nevű fájlt a :r TESZT paranccsal, ahol TESZT az Ön fájljának a neve. MEGJ: A fájl, amit beillesztett a kurzora alatt helyezkedik el. 4. Hogy ellenőrizzük, hogy a fájlt tényleg beillesztettük, menjen vissza, és nézze meg, hogy kétszer szerepel az 5.3. lecke! Az eredeti mellett a fájlból bemásolt is ott van. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5. LECKE ÖSSZEFOGLALÓJA 1. :!parancs végrehajt egy külső utasítást. Pár hasznos példa: (MS-DOS) (Unix) :!dir :!ls - könyvtárlista kiírása. :!del FÁJLNÉV :!rm FÁJLNÉV - FÁJLNÉV nevű fájl törlése. 2. :w FÁJLNÉV kiírja a jelenlegi Vim-fájlt a lemezre FÁJNÉV néven. 3. :#,#w FÁJLNÉV kiírja a két sorszám (#) közötti sorokat FÁJLNÉV-be Másik lehetőség, hogy a kezdősornál Shift-v-t nyom lemegy az utolsó sorra, majd ezt üti be :w FÁJLNÉV 4. :r FÁJLNÉV beolvassa a FÁJLNÉV fájlt és behelyezi a jelenlegi fájlba a kurzorpozíció utáni sorba. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6.1. lecke: A MEGNYITÁS (OPEN) PARANCS ** o beírásával nyit egy új sort a kurzor alatt és beszúró módba vált ** 1. Mozgassuk a kurzort a ---> kezdetű sorra. 2. o (kicsi) beírásával nyisson egy sort a kurzor ALATT! Ekkor automatikusan beszúró (insert) módba kerül. 3. Másolja le a ---> jelű sort és megnyomásával lépjen ki a beszúró módból. ---> Az o lenyomása után a kurzor a következő sor elején áll beszúró módban. 4. A kurzor FELETTI sor megnyitásához egyszerűen nagy O betűt írjon kicsi helyett. Próbálja ki a következő soron! Nyisson egy új sort efelett Shift-O megnyomásával, mialatt a kurzor ezen a soron áll. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6.2. lecke: AZ APPEND PARANCS ** a lenyomásával a kurzor UTÁN szúrhatunk szöveget. ** 1. Mozgassuk a kurzort a következő ---> kezdetű sor végére úgy, hogy normál módban $-t ír be. 2. Kis "a" leütésével szöveget szúrhat be AMÖGÉ a karakter mögé, amelyen a kurzor áll. (A nagy "A" az egész sor végére írja a szöveget.) Megj: A Vimben a sor legvégére is lehet állni, azonban ez elődjében a Vi-ban nem lehetséges, ezért abban az a nélkül elég körülményes a sor végéhez szöveget írni. 3. Egészítse ki az első sort. Vegye észre, hogy az a utasítás (append) teljesen egyezik az i-vel (insert) csupán a beszúrt szöveg helye különbözik. ---> Ez a sor lehetővé teszi Önnek, hogy gyakorolja ---> Ez a sor lehetővé teszi Önnek, hogy gyakorolja a sor végére beillesztést. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6.3. lecke: AZ ÁTÍRÁS MÁSIK VÁLTOZATA ** Nagy R beírásával írhat felül több mint egy karaktert. ** 1. Mozgassuk a kurzort az első ---> kezdetű sorra! 2. Helyezze a kurzort az első szó elejére amely eltér a második ---> kezdetű sor tartalmától (a 'az utolsóval' résztől). 3. Nyomjon R karaktert és írja át a szöveg maradékát az első sorban úgy, hogy a két sor egyező legyen. ---> Az első sort tegye azonossá az utolsóval: használja a gombokat. ---> Az első sort tegye azonossá a másodikkal: írjon R-t és az új szöveget. 4. Jegyezzük meg, ha -et nyomok, akkor a változatlanul hagyott szövegek változatlanok maradnak. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6.4. lecke: BEÁLLÍTÁSOK ** Állítsuk be, hogy a keresés és a helyettesítés ne függjön kis/NAGYbetűktől ** 1. Keressük meg az 'ignore'-t az beírva: /ignore Ezt ismételjük többször az n billentyűvel 2. Állítsuk be az 'ic' (Ignore case) lehetőséget így: :set ic 3. Most keressünk ismét az 'ignore'-ra n-nel Ismételjük meg többször a keresést: n 4. Állítsuk be a 'hlsearch' és 'incsearch' lehetőségeket: :set hls is 5. Most ismét írjuk be a keresőparancsot, és lássuk mi történik: /ignore 6. A kiemelést szüntessük meg alábbi utasítások egyikével: :set nohls vagy :nohlsearch ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6. LECKE ÖSSZEFOGLALÓJA 1. o beírásával új sort nyitunk meg a sor ALATT és a kurzor az új sorban lesz beszúrás-módban. Nagy O a sor FELETT nyit új sort, és oda kerül a kurzor. 2. a beírásával az aktuális karaktertől UTÁN (jobbra) szúrhatunk be szöveget. Nagy A automatikusan a sor legvégéhez adja hozzá a szöveget. 3. A nagy R beütésével átíró (replace) módba kerülünk lenyomásáig. 4. ":set xxx" beírásával az "xxx" opció állítható be. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 7. lecke: AZ ON-LINE SÚGÓ PARANCSAI ** Az online súgórendszer használata ** A Vim részletes súgóval rendelkezik. Induláshoz a következők egyikét tegye: - nyomja meg a gombot (ha van ilyen) - nyomja meg az gombot (ha van ilyen) - írja be: :help :q beírásával zárhatja be a súgóablakot. Majdnem minden témakörről találhat súgót, argumentum megadásával ":help" utasítás . Próbálja az alábbiakat ki (-t ne felejtsük): :help w :help c_, 2006-2012 vim-7.4.1689/runtime/tutor/tutor.info000066400000000000000000000017141267703067000174720ustar00rootroot00000000000000F"s@"{"3"3u0F     nj      nj          ǀ   ǀF  ǀ   ǀ     nj      nj        /vim vim-7.4.1689/runtime/tutor/tutor.it000066400000000000000000001067471267703067000171670ustar00rootroot00000000000000=============================================================================== = Benvenuto alla G u i d a all'Editor V I M - Versione 1.7 = =============================================================================== 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. ATTENZIONE! 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 seguente. 3. Usando il tasto "gi" spostati alla Lezione 1.2. NOTA: Quando non sei sicuro del tasto che hai premuto, premi 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, dopo che ci si abitua. Davvero! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 1.2: USCIRE DA VIM !! NOTA: Prima di eseguire quanto richiesto, leggi la Lezione per intero!! 1. Premi il tasto (per assicurarti di essere in Modalit Normale). 2. Batti: :q! . Cos esci dall'Editor SCARTANDO qualsiasi modifica fatta. 3. Quando vedi il PROMPT della Shell, batti il comando con cui sei arrivato qui. Sarebbe: vimtutor 4. Se hai memorizzato questi comandi e ti senti pronto, esegui i passi da 1 a 3 per uscire e rientrare nell'Editor. NOTA: :q! SCARTA qualsiasi modifica fatta. In una delle prossime lezioni imparerai come salvare un file che hai modificato. 5. Muovi in gi il cursore per passare alla lezione 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 1.3: MODIFICA DI TESTI - CANCELLAZIONE ** Premere 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: MODIFICA DI TESTI - INSERIMENTO ** Premere 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 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 alla lezione 1.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 1.5: MODIFICA DI TESTI - AGGIUNTA ** Premere A per aggiungere testo a fine linea. ** 1. Muovi il cursore alla prima linea qui sotto, indicata da --->. Non importa dove posizionato il cursore sulla linea stessa. 2. Batti A e inserisci le necessarie aggiunte. 3. Alla fine della aggiunta premi per tornare in modalit Normale. 4. Muovi il cursore alla seconda linea indicata ---> e ripeti i passi 2 e 3 per correggere questa frase. ---> C' del testo che manca da qu C' del testo che manca da questa linea. ---> C' anche del testo che ma C' anche del testo che manca qui. 5. Quando sei a tuo agio nell'aggiunta di testo vai alla lezione 1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 1.6: MODIFICARE UN FILE ** Usare :wq per salvare un file e uscire. ** !! NOTA: Prima di eseguire quanto richiesto, leggi la Lezione per intero!! 1. Esci da Vim come hai fatto nella lezione 1.2: :q! 2. Quando vedi il PROMPT della Shell, batti il comando: vim tutor 'vim' il comando per richiamare Vim, 'tutor' il nome del file che desideri modificare. Usa un file che possa essere modificato. 3. Inserisci e cancella testo come hai imparato nelle lezioni precedenti. 4. Salva il file ed esci da Vim con: :wq 5. Rientra in vimtutor e scendi al sommario che segue. 6. Dopo aver letto i passi qui sopra ed averli compresi: eseguili. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 della Shell batti: vim NOMEFILE 3. Per uscire da Vim batti: :q! per uscire senza salvare. oppure batti: :wq per uscire salvando modifiche. 4. Per cancellare il carattere sotto al cursore batti: x 5. Per inserire testo subito prima del cursore batti: i batti testo inserito inserisci prima del cursore A batti testo aggiunto aggiungi a fine linea NOTA: premendo 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 una parola. ** 1. Premi 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: La lettera d sar visibile sull'ultima linea dello schermo mentre la batti. Vim attende che tu batta w . Se vedi una lettera diversa da d hai battuto qualcosa di sbagliato; premi 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 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: OPERATORI E MOVIMENTI Molti comandi di modifica testi consistono in un operatore e un movimento. Il formato del comando di cancellazione con l'operatore d il seguente: d movimento Dove: d - l'operatore di cancellazione movimento - indica dove l'operatore va applicato (lista qui sotto). Breve lista di movimenti: w - fino a inizio della parola seguente, ESCLUSO il suo primo carattere. e - alla fine della parola corrente, COMPRESO il suo ultimo carattere. $ - dal cursore fino a fine linea, COMPRESO l'ultimo carattere della linea. Quindi se batti de cancelli dal cursore fino a fine parola. NOTA: Se batti solo il movimento mentre sei in Modalit Normale, senza nessun operatore, il cursore si muover come specificato. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 2.4: USO DI UN CONTATORE PER UN MOVIMENTO ** Se batti un numero prima di un movimento, lo ripeti altrettante volte. ** 1. Muovi il cursore fino all'inizio della linea qui sotto, indicata da --->. 2. Batti 2w per spostare il cursore due parole pi avanti. 3. Batti 3e per spostare il cursore alla fine della terza parola seguente. 4. Batti 0 (zero) per posizionarti all'inizio della linea. 5. Ripeti i passi 2 e 3 usando numeri differenti. ---> Questa solo una linea con parole all'interno della quale puoi muoverti. 6. Vai alla Lezione 2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 2.5: USO DI UN CONTATORE PER CANCELLARE DI PIU' ** Se batti un numero prima di un movimento, lo ripeti altrettante volte. ** Nella combinazione dell'operatore cancella e di un movimento, descritto prima, inserite un contatore prima del movimento per cancellare di pi: d numero movimento 1. Muovi il cursore alla prima parola MAIUSCOLA nella riga indicata da --->. 2. Batti d2w per cancellare le due parole MAIUSCOLE 3. Ripeti i passi 1 e 2 con un contatore diverso per cancellare le parole MAIUSCOLE consecutive con un solo comando ---> questa ABC DE linea FGHI JK LMN OP di parole Q RS TUV ora ripulita. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 2.6: LAVORARE SU LINEE INTERE ** Batti dd per cancellare un'intera linea. ** Per la frequenza con cui capita di cancellare linee intere, chi ha disegnato 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 per cancellare due linee. ---> 1) Le rose sono rosse, ---> 2) Il fango divertente, ---> 3) Le viole sono blu, ---> 4) Io ho un'automobile, ---> 5) Gli orologi segnano il tempo, ---> 6) Lo zucchero dolce, ---> 7) E cos sei anche tu. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 2.7: 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 (tieni il tasto CTRL schiacciato mentre batti r) per rieseguire 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 parola seguente batti: dw 2. Per cancellare dal cursore fino alla fine della linea batti: d$ 3. Per cancellare un'intera linea batti: dd 4. Per eseguire pi volte un movimento, mettici davanti un numero: 2w 5. Il formato per un comando di modifica : operatore [numero] movimento dove: operatore - indica il da farsi, ad es. d per [delete] cancellare [numero] - contatore facoltativo di ripetizione del movimento movimento - spostamento nel testo su cui operare, ad es. w [word] parola, $ (fino a fine linea), etc. 6. Per andare a inizio linea usate uno zero: 0 7. 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 ["redo"] batti: CTRL-r ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 3.1: IL COMANDO PUT [METTI, PONI] ** Batti p per porre [put] testo (cancellato prima) dopo il cursore. ** 1. Muovi il cursore alla prima linea indicata con ---> qui in basso. 2. Batti dd per cancellare la linea e depositarla in un registro di Vim. 3. Muovi il cursore fino alla linea c) SOPRA quella dove andrebbe messa la linea appena cancellata. 4. Batti p per mettere la linea sotto il cursore. 5. Ripeti i passi da 2 a 4 per mettere tutte le linee nel giusto ordine. ---> d) Puoi impararla tu? ---> b) Le viole sono blu, ---> c) La saggezza si impara, ---> a) Le rose sono rosse, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 3.2: IL COMANDO REPLACE [RIMPIAZZARE] ** Batti rx per rimpiazzare il carattere sotto al cursore con x . ** 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 stare qui. 4. Ripeti i passi 2 e 3 finch la prima linea uguale alla seconda. ---> Ammattendo quetta lince, 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: L'OPERATORE CHANGE [CAMBIA] ** Per cambiare fino alla fine di una parola, batti ce . ** 1. Muovi il cursore alla prima linea qui sotto, indicata da --->. 2. Posiziona il cursore alla u in lubw. 3. Batti ce e la parola corretta (in questo caso, batti inea ). 4. Premi e vai sul prossimo 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 l'operatore CHANGE. ---> Questa linea ha alcune parole da cambiare usando l'operatore CHANGE. Nota che ce cancella la parola, e ti mette anche in Modalit Inserimento [Insert Mode] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 3.4: ALTRI CAMBIAMENTI USANDO c ** L'operatore c [CHANGE] agisce sugli stessi movimenti di d [DELETE] ** 1. L'operatore CHANGE si comporta come DELETE. Il formato : c [numero] movimento 2. I movimenti 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$ e inserisci resto della linea utilizzando come modello la linea seguente, e quando hai finito premi ---> 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$ . NOTA: Puoi usare il tasto Backspace se devi correggere errori di battitura. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 3 SOMMARIO 1. Per reinserire del testo 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 che vuoi sostituire. 3. L'operatore change ti permette di cambiare dal cursore fino a dove arriva il movimento. Ad es. Batti ce per cambiare dal cursore fino alla fine della parola, c$ per cambiare fino a fine linea. 4. Il formato di change : c [numero] movimento Ora vai alla prossima Lezione. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 4.1: POSIZIONAMENTO E SITUAZIONE FILE ** Batti CTRL-G per vedere a che punto sei nel file e la situazione ** ** del file. Batti G per raggiungere una linea nel file. ** NOTA: Leggi l'intera Lezione prima di eseguire un qualsiasi passo!! 1. Tieni premuto il tasto CTRL e batti g . Ossia batti CTRL-G. Un messaggio apparir in fondo alla pagina con il NOME FILE e la posizione nel file. Ricordati il numero della linea per il Passo 3. NOTA: La posizione del cursore si vede nell'angolo in basso a destra dello schermo, se impostata l'opzione 'ruler' (righello, vedi :help ruler). 2. Premi G [G Maiuscolo] per posizionarti in fondo al file. Batti gg per posizionarti in cima al 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. 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' . 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. Per ricercare una frase nella direzione opposta, usa ? al posto di / . 5. Per tornare dove eri prima nel file premi CTRL-O (tieni il tasto CTRL schiacciato mentre premi la lettera o). Ripeti CTRL-O per andare ancora indietro. Puoi usare CTRL-I per tornare in avanti. NOTA: "errroore" non il modo giusto di digitare errore; errroore un errore. NOTA: Quando la ricerca arriva a fine file, ricomincia dall'inizio del file, a meno che l'opzione 'wrapscan' sia stata disattivata. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 4.3: RICERCA DI PARENTESI CORRISPONDENTI ** Batti % per trovare una ),], o } corrispondente. ** 1. Posiziona il cursore su una (, [, o { nella linea sotto, indicata da --->. 2. Adesso batti il carattere % . 3. Il cursore si sposter sulla parentesi corrispondente. 4. Batti % per muovere il cursore all'altra parentesi 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: L'OPERATORE SOSTITUZIONE (SUBSTITUTE) ** 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 . Nota che questo comando cambia solo LA PRIMA occorrenza di "lla" sulla linea. 3. Adesso batti :s/lla/la/g . Aggiungendo la flag g si chiede di sostituire "globalmente" sulla linea, ossia 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 che delimitano il gruppo di linee in cui si vuole sostituire. Batti :%s/vecchio/nuovo/g per cambiare ogni occorrenza nell'intero file. Batti :%s/vecchio/nuovo/gc per trovare ogni occorrenza nell'intero file ricevendo per ognuna una richiesta se effettuare o meno la sostituzione. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 4 SOMMARIO 1. CTRL-G visualizza a che punto sei nel file e la situazione del file. G [G Maiuscolo] ti porta all'ultima linea del file. numero G ti porta alla linea con quel numero. gg ti porta alla prima linea del 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. CTRL-O ti porta alla posizione precedente, CTRL-I a quella pi nuova. 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 quel comando. ** 1. Batti il comando : per posizionare il cursore in fondo allo schermo. Ci ti permette di immettere un comando dalla linea comandi. 2. Adesso batti il carattere ! (punto esclamativo). Ci ti permette di eseguire qualsiasi comando esterno si possa eseguire nella "shell". 3. Ad esempio batti ls dopo il ! e poi premi . Questo visualizza una lista della tua directory, proprio come se fossi in una "shell". Usa :!dir se ls non funziona. [Unix: ls MS-DOS: dir] NOTA: E' possibile in questo modo eseguire un comando a piacere, specificando anche dei parametri per i comandi stessi. NOTA: Tutti i comandi : devono essere terminati premendo Da qui in avanti non lo ripeteremo ogni volta. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 5.2: ANCORA SULLA SCRITTURA DEI FILE ** Per salvare le modifiche apportate a un testo batti :w NOMEFILE. ** 1. Batti :!dir or :!ls per procurarti una lista della tua directory. Gi sai che devi premere 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 verifica batti ancora :!dir o :!ls per listare la tua directory. NOTA: Se esci da Vim e riesegui Vim battendo vim TEST , il file aperto sar una copia esatta di "tutor.it" al momento del salvataggio. 5. Ora cancella il file battendo (MS-DOS): :!del TEST o (Unix): :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 5.3: SELEZIONARE IL TESTO DA SCRIVERE ** Per salvare una porzione di file, batti v movimento :w NOMEFILE ** 1. Muovi il cursore su questa linea. 2. Premi v e muovi il cursore fino alla linea numerata 5., qui sotto. Nota che il testo viene evidenziato. 3. Batti il carattere : . In fondo allo schermo apparir :'<,'> . 4. Batti w TEST , dove TEST il nome di un file non ancora esistente. Verifica che si veda :'<,'>w TEST prima di dare . 5. Vim scriver nel file TEST le linee che hai selezionato. Usa :!dir o :!ls per controllare che esiste. Non cancellarlo ora! Ti servir nella prossima lezione. NOTA: Battere v inizia una selezione visuale. Puoi muovere il cursore come vuoi, e rendere la selezione pi piccola o pi grande. Poi puoi usare un operatore per agire sul testo selezionato. Ad es., d cancella il testo. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 5.4: INSERIRE E RIUNIRE FILE ** Per inserire il contenuto di un file, batti :r NOMEFILE ** 1. Posiziona il cursore appena sopra questa riga. NOTA: Dopo aver eseguito il Passo 2 vedrai il testo della Lezione 5.3. Quindi spostati IN GIU' per tornare ancora a questa Lezione. 2. Ora inserisci il tuo file TEST con il comando :r TEST dove TEST il nome che hai usato per creare il file. Il file richiesto inserito sotto la linea in cui si trova il cursore. 3. 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 che viene dal file. NOTA: Puoi anche leggere l'output prodotto da un comando esterno. Ad es. :r !ls legge l'output del comando ls e lo inserisce sotto la linea in cui si trova il cursore. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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. v movimento :w NOMEFILE salva le linee selezionate in maniera visuale nel file NOMEFILE. 4. :r NOMEFILE legge il file NOMEFILE da disco e lo inserisce nel file che stai modificando, dopo la linea in cui posizionato il cursore. 5. :r !dir legge l'output del comando dir e lo inserisce dopo la linea in cui posizionato il cursore. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 6.1: IL COMANDO OPEN [APRIRE] ** Batti o per aprire una linea sotto il cursore ** ** e passare in Modalit Inserimento. ** 1. Muovi il cursore fino alla linea qui sotto, indicata da --->. 2. Batti la lettera minuscola o per aprire una linea sotto il cursore e passare in Modalit Inserimento. 3. Poi inserisci del testo e premi 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 una O maiuscola, invece che una o minuscola. Prova sulla linea qui sotto. Apri una linea SOPRA questa battendo O mentre il cursore su questa linea. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 6.2: IL COMANDO APPEND [AGGIUNGERE] ** Batti a per inserire testo DOPO il cursore. ** 1. Muovi il cursore all'inizio della linea qui sotto, indicata da --->. 2. Batti e finch il cursore arriva alla fine di li . 3. Batti una a (minuscola) per aggiungere testo DOPO il cursore. 4. Completa la parola come mostrato nella linea successiva. Premi per uscire dalla Modalit Inserimento. 5. Usa e per passare alla successiva parola incompleta e ripeti i passi 3 e 4. ---> Questa li ti permetter di esercit ad aggiungere testo a una linea. ---> Questa linea ti permetter di esercitarti ad aggiungere testo a una linea. NOTA: a, i ed A entrano sempre in Modalit Inserimento, la sola differenza dove verranno inseriti i caratteri. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 6.3: UN ALTRO MODO DI RIMPIAZZARE [REPLACE] ** Batti una R maiuscola per rimpiazzare pi di un carattere. ** 1. Muovi il cursore alla prima linea qui sotto, indicata da --->. Muovi il cursore all'inizio del primo xxx . 2. Ora batti R e batti il numero che vedi nella linea seguente, in modo che rimpiazzi l' xxx . 3. Premi per uscire dalla Modalit Replace. Nota che il resto della linea resta invariato. 4. Ripeti i passi in modo da rimpiazzare l'altro xxx . ---> Aggiungendo 123 a xxx si ottiene xxx. ---> Aggiungendo 123 a 456 si ottiene 579. NOTA: La Modalit Replace come la Modalit Inserimento, ma ogni carattere che viene battuto ricopre un carattere esistente. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 6.4: COPIA E INCOLLA DEL TESTO ** usa l'operatore y per copiare del testo e p per incollarlo ** 1. Vai alla linea indicata da ---> qui sotto, e metti il cursore dopo "a)". 2. Entra in Modalit Visuale con v e metti il cursore davanti a "primo". 3. Batti y per copiare [yank] il testo evidenziato. 4. Muovi il cursore alla fine della linea successiva: j$ 5. Batti p per incollare [paste] il testo. Poi batti: a secondo . 6. Usa la Modalit Visuale per selezionare " elemento.", copialo con y , Vai alla fine della linea successiva con j$ e incolla il testo con p . ---> a) questo il primo elemento. b) NOTA: Puoi usare y come operatore; yw copia una parola [word]. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 6.5: SET [IMPOSTA] UN'OPZIONE ** Imposta un'opzione per ignorare maiuscole/minuscole ** ** durante la ricerca/sostituzione ** 1. Ricerca 'nota' battendo: /nota Ripeti la ricerca pi volte usando il tasto n 2. Imposta l'opzione 'ic' (Ignore Case, [Ignora maiuscolo/minuscolo]) battendo: :set ic 3. Ora ricerca ancora 'nota' premendo il tasto n Troverai adesso anche Nota e NOTA . 4. Imposta le opzioni 'hlsearch' e 'incsearch' :set hls is 5. Ora batti ancora il comando di ricerca, e guarda cosa succede: /nota 6. Per disabilitare il riconoscimento di maiuscole/minuscole batti: :set noic NOTA: Per non evidenziare le occorrenze trovate batti: :nohlsearch NOTA: Per ignorare maiuscole/minuscole solo per una ricerca, usa \c nel comando di ricerca: /nota\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 6 SOMMARIO 1. Batti o per aggiungere una linea SOTTO il cursore ed entrare in Modalit Inserimento. Batti O per aggiungere una linea SOPRA il cursore. 2. Batti a per inserire testo DOPO il cursore. Batti A per inserire testo alla fine della linea. 3. Il comando e sposta il cursore alla fine di una parola. 4. L'operatore y copia del testo, p incolla del testo. 5. Batti R per entrare in Modalit Replace, e ne esci premendo . 6. Batti ":set xxx" per impostare l'opzione "xxx". Alcun opzioni sono: 'ic' 'ignorecase' ignorare maiuscole/minuscole nella ricerca 'is' 'incsearch' mostra occorrenze parziali durante una ricerca 'hls' 'hlsearch' evidenzia tutte le occorrenze di una ricerca Puoi usare sia il nome completo di un'opzione che quello abbreviato. 7. Usa il prefisso "no" per annullare una opzione: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 7.1: OTTENERE AIUTO ** Usa il sistema di aiuto on-line ** Vim ha un esauriente sistema di aiuto on-line. Per cominciare, prova una di queste alternative: - premi il tasto (se ce n' uno) - premi il tasto (se ce n' uno) - batti :help OPPURE :h Leggi il testo nella finestra di aiuto per vedere come funziona l'aiuto. Batti CTRL-W CTRL-W per passare da una finestra all'altra. Batti :q per chiudere la finestra di aiuto. Puoi trovare aiuto su quasi tutto, dando un argomento al comando ":help" Prova questi (non dimenticare di premere ): :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 7.2: PREPARARE 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 creare un file "vimrc". 1. Comincia a editare il file "vimrc". Questo dipende dal tuo sistema: :e ~/.vimrc per Unix :e $VIM/_vimrc per MS-Windows 2. Ora leggi i contenuti del file "vimrc" distribuito come esempio: :r $VIMRUNTIME/vimrc_example.vim 3. Scrivi il file con: :w La prossima volta che apri Vim, sar abilitata la colorazione sintattica. Puoi aggiungere a questo file "vimrc" tutte le tue impostazioni preferite. Per maggiori informazioni batti: :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 7.3: COMPLETAMENTO ** Completamento linea comandi con CTRL-D e ** 1. Imposta Vim in modalit compatibile: :set nocp 2. Guarda i file esistenti nella directory: :!ls o :!dir 3. Batti l'inizio di un comando: :e 4. Premi CTRL-D e Vim ti mostra una lista di comandi che iniziano per "e". 5. Premi e Vim completa per te il nome comando come ":edit". 6. Ora batti uno spazio e l'inizio del nome di un file esistente: :edit FIL 7. Premi . Vim completer il nome del file (se il solo possibile). NOTA: Il completamento disponibile per molti comandi. Prova a battere CTRL-D e . Particolarmente utile per :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 7 Sommario 1. Batti :help o premi o per aprire una finestra di aiuto. 2. Batti :help comando per avere aiuto su comando . 3. Batti CTRL-W CTRL-W per saltare alla prossima finestra. 4. Batti :q per chiudere la finestra di aiuto. 5. Crea uno script iniziale vimrc contenente le tue impostazioni preferite. 6. Mentre batti un comando : , premi CTRL-D per vedere i possibili completamenti. Premi per usare il completamento desiderato. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 (anche in italiano): ":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: azc100@gmail.com ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim-7.4.1689/runtime/tutor/tutor.it.utf-8000066400000000000000000001071511267703067000201170ustar00rootroot00000000000000=============================================================================== = Benvenuto alla G u i d a all'Editor V I M - Versione 1.7 = =============================================================================== 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. ATTENZIONE! 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 seguente. 3. Usando il tasto "giù" spostati alla Lezione 1.2. NOTA: Quando non sei sicuro del tasto che hai premuto, premi 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, dopo che ci si abitua. Davvero! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 1.2: USCIRE DA VIM !! NOTA: Prima di eseguire quanto richiesto, leggi la Lezione per intero!! 1. Premi il tasto (per assicurarti di essere in Modalità Normale). 2. Batti: :q! . Così esci dall'Editor SCARTANDO qualsiasi modifica fatta. 3. Quando vedi il PROMPT della Shell, batti il comando con cui sei arrivato qui. Sarebbe: vimtutor 4. Se hai memorizzato questi comandi e ti senti pronto, esegui i passi da 1 a 3 per uscire e rientrare nell'Editor. NOTA: :q! SCARTA qualsiasi modifica fatta. In una delle prossime lezioni imparerai come salvare un file che hai modificato. 5. Muovi in giù il cursore per passare alla lezione 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 1.3: MODIFICA DI TESTI - CANCELLAZIONE ** Premere 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: MODIFICA DI TESTI - INSERIMENTO ** Premere 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 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 alla lezione 1.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 1.5: MODIFICA DI TESTI - AGGIUNTA ** Premere A per aggiungere testo a fine linea. ** 1. Muovi il cursore alla prima linea qui sotto, indicata da --->. Non importa dove è posizionato il cursore sulla linea stessa. 2. Batti A e inserisci le necessarie aggiunte. 3. Alla fine della aggiunta premi per tornare in modalità Normale. 4. Muovi il cursore alla seconda linea indicata ---> e ripeti i passi 2 e 3 per correggere questa frase. ---> C'è del testo che manca da qu C'è del testo che manca da questa linea. ---> C'è anche del testo che ma C'è anche del testo che manca qui. 5. Quando sei a tuo agio nell'aggiunta di testo vai alla lezione 1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 1.6: MODIFICARE UN FILE ** Usare :wq per salvare un file e uscire. ** !! NOTA: Prima di eseguire quanto richiesto, leggi la Lezione per intero!! 1. Esci da Vim come hai fatto nella lezione 1.2: :q! 2. Quando vedi il PROMPT della Shell, batti il comando: vim tutor 'vim' è il comando per richiamare Vim, 'tutor' è il nome del file che desideri modificare. Usa un file che possa essere modificato. 3. Inserisci e cancella testo come hai imparato nelle lezioni precedenti. 4. Salva il file ed esci da Vim con: :wq 5. Rientra in vimtutor e scendi al sommario che segue. 6. Dopo aver letto i passi qui sopra ed averli compresi: eseguili. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 della Shell batti: vim NOMEFILE 3. Per uscire da Vim batti: :q! per uscire senza salvare. oppure batti: :wq per uscire salvando modifiche. 4. Per cancellare il carattere sotto al cursore batti: x 5. Per inserire testo subito prima del cursore batti: i batti testo inserito inserisci prima del cursore A batti testo aggiunto aggiungi a fine linea NOTA: premendo 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 una parola. ** 1. Premi 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: La lettera d sarà visibile sull'ultima linea dello schermo mentre la batti. Vim attende che tu batta w . Se vedi una lettera diversa da d hai battuto qualcosa di sbagliato; premi 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 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: OPERATORI E MOVIMENTI Molti comandi di modifica testi consistono in un operatore e un movimento. Il formato del comando di cancellazione con l'operatore d è il seguente: d movimento Dove: d - è l'operatore di cancellazione movimento - indica dove l'operatore va applicato (lista qui sotto). Breve lista di movimenti: w - fino a inizio della parola seguente, ESCLUSO il suo primo carattere. e - alla fine della parola corrente, COMPRESO il suo ultimo carattere. $ - dal cursore fino a fine linea, COMPRESO l'ultimo carattere della linea. Quindi se batti de cancelli dal cursore fino a fine parola. NOTA: Se batti solo il movimento mentre sei in Modalità Normale, senza nessun operatore, il cursore si muoverà come specificato. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 2.4: USO DI UN CONTATORE PER UN MOVIMENTO ** Se batti un numero prima di un movimento, lo ripeti altrettante volte. ** 1. Muovi il cursore fino all'inizio della linea qui sotto, indicata da --->. 2. Batti 2w per spostare il cursore due parole più avanti. 3. Batti 3e per spostare il cursore alla fine della terza parola seguente. 4. Batti 0 (zero) per posizionarti all'inizio della linea. 5. Ripeti i passi 2 e 3 usando numeri differenti. ---> Questa è solo una linea con parole all'interno della quale puoi muoverti. 6. Vai alla Lezione 2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 2.5: USO DI UN CONTATORE PER CANCELLARE DI PIU' ** Se batti un numero prima di un movimento, lo ripeti altrettante volte. ** Nella combinazione dell'operatore cancella e di un movimento, descritto prima, inserite un contatore prima del movimento per cancellare di più: d numero movimento 1. Muovi il cursore alla prima parola MAIUSCOLA nella riga indicata da --->. 2. Batti d2w per cancellare le due parole MAIUSCOLE 3. Ripeti i passi 1 e 2 con un contatore diverso per cancellare le parole MAIUSCOLE consecutive con un solo comando ---> questa ABC DE linea FGHI JK LMN OP di parole è Q RS TUV ora ripulita. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 2.6: LAVORARE SU LINEE INTERE ** Batti dd per cancellare un'intera linea. ** Per la frequenza con cui capita di cancellare linee intere, chi ha disegnato 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 per cancellare due linee. ---> 1) Le rose sono rosse, ---> 2) Il fango è divertente, ---> 3) Le viole sono blu, ---> 4) Io ho un'automobile, ---> 5) Gli orologi segnano il tempo, ---> 6) Lo zucchero è dolce, ---> 7) E così sei anche tu. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 2.7: 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 (tieni il tasto CTRL schiacciato mentre batti r) per rieseguire 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 parola seguente batti: dw 2. Per cancellare dal cursore fino alla fine della linea batti: d$ 3. Per cancellare un'intera linea batti: dd 4. Per eseguire più volte un movimento, mettici davanti un numero: 2w 5. Il formato per un comando di modifica è: operatore [numero] movimento dove: operatore - indica il da farsi, ad es. d per [delete] cancellare [numero] - contatore facoltativo di ripetizione del movimento movimento - spostamento nel testo su cui operare, ad es. w [word] parola, $ (fino a fine linea), etc. 6. Per andare a inizio linea usate uno zero: 0 7. 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 ["redo"] batti: CTRL-r ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 3.1: IL COMANDO PUT [METTI, PONI] ** Batti p per porre [put] testo (cancellato prima) dopo il cursore. ** 1. Muovi il cursore alla prima linea indicata con ---> qui in basso. 2. Batti dd per cancellare la linea e depositarla in un registro di Vim. 3. Muovi il cursore fino alla linea c) SOPRA quella dove andrebbe messa la linea appena cancellata. 4. Batti p per mettere la linea sotto il cursore. 5. Ripeti i passi da 2 a 4 per mettere tutte le linee nel giusto ordine. ---> d) Puoi impararla tu? ---> b) Le viole sono blu, ---> c) La saggezza si impara, ---> a) Le rose sono rosse, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 3.2: IL COMANDO REPLACE [RIMPIAZZARE] ** Batti rx per rimpiazzare il carattere sotto al cursore con x . ** 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 stare qui. 4. Ripeti i passi 2 e 3 finché la prima linea è uguale alla seconda. ---> Ammattendo quetta lince, 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: L'OPERATORE CHANGE [CAMBIA] ** Per cambiare fino alla fine di una parola, batti ce . ** 1. Muovi il cursore alla prima linea qui sotto, indicata da --->. 2. Posiziona il cursore alla u in lubw. 3. Batti ce e la parola corretta (in questo caso, batti inea ). 4. Premi e vai sul prossimo 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 l'operatore CHANGE. ---> Questa linea ha alcune parole da cambiare usando l'operatore CHANGE. Nota che ce cancella la parola, e ti mette anche in Modalità Inserimento [Insert Mode] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 3.4: ALTRI CAMBIAMENTI USANDO c ** L'operatore c [CHANGE] agisce sugli stessi movimenti di d [DELETE] ** 1. L'operatore CHANGE si comporta come DELETE. Il formato è: c [numero] movimento 2. I movimenti 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$ e inserisci resto della linea utilizzando come modello la linea seguente, e quando hai finito premi ---> 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$ . NOTA: Puoi usare il tasto Backspace se devi correggere errori di battitura. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 3 SOMMARIO 1. Per reinserire del testo 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 che vuoi sostituire. 3. L'operatore change ti permette di cambiare dal cursore fino a dove arriva il movimento. Ad es. Batti ce per cambiare dal cursore fino alla fine della parola, c$ per cambiare fino a fine linea. 4. Il formato di change è: c [numero] movimento Ora vai alla prossima Lezione. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 4.1: POSIZIONAMENTO E SITUAZIONE FILE ** Batti CTRL-G per vedere a che punto sei nel file e la situazione ** ** del file. Batti G per raggiungere una linea nel file. ** NOTA: Leggi l'intera Lezione prima di eseguire un qualsiasi passo!! 1. Tieni premuto il tasto CTRL e batti g . Ossia batti CTRL-G. Un messaggio apparirà in fondo alla pagina con il NOME FILE e la posizione nel file. Ricordati il numero della linea per il Passo 3. NOTA: La posizione del cursore si vede nell'angolo in basso a destra dello schermo, se è impostata l'opzione 'ruler' (righello, vedi :help ruler). 2. Premi G [G Maiuscolo] per posizionarti in fondo al file. Batti gg per posizionarti in cima al 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. 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' . 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. Per ricercare una frase nella direzione opposta, usa ? al posto di / . 5. Per tornare dove eri prima nel file premi CTRL-O (tieni il tasto CTRL schiacciato mentre premi la lettera o). Ripeti CTRL-O per andare ancora indietro. Puoi usare CTRL-I per tornare in avanti. NOTA: "errroore" non è il modo giusto di digitare errore; errroore è un errore. NOTA: Quando la ricerca arriva a fine file, ricomincia dall'inizio del file, a meno che l'opzione 'wrapscan' sia stata disattivata. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 4.3: RICERCA DI PARENTESI CORRISPONDENTI ** Batti % per trovare una ),], o } corrispondente. ** 1. Posiziona il cursore su una (, [, o { nella linea sotto, indicata da --->. 2. Adesso batti il carattere % . 3. Il cursore si sposterà sulla parentesi corrispondente. 4. Batti % per muovere il cursore all'altra parentesi 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: L'OPERATORE SOSTITUZIONE (SUBSTITUTE) ** 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 . Nota che questo comando cambia solo LA PRIMA occorrenza di "lla" sulla linea. 3. Adesso batti :s/lla/la/g . Aggiungendo la flag g si chiede di sostituire "globalmente" sulla linea, ossia 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 che delimitano il gruppo di linee in cui si vuole sostituire. Batti :%s/vecchio/nuovo/g per cambiare ogni occorrenza nell'intero file. Batti :%s/vecchio/nuovo/gc per trovare ogni occorrenza nell'intero file ricevendo per ognuna una richiesta se effettuare o meno la sostituzione. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 4 SOMMARIO 1. CTRL-G visualizza a che punto sei nel file e la situazione del file. G [G Maiuscolo] ti porta all'ultima linea del file. numero G ti porta alla linea con quel numero. gg ti porta alla prima linea del 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. CTRL-O ti porta alla posizione precedente, CTRL-I a quella più nuova. 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 quel comando. ** 1. Batti il comando : per posizionare il cursore in fondo allo schermo. Ciò ti permette di immettere un comando dalla linea comandi. 2. Adesso batti il carattere ! (punto esclamativo). Ciò ti permette di eseguire qualsiasi comando esterno si possa eseguire nella "shell". 3. Ad esempio batti ls dopo il ! e poi premi . Questo visualizza una lista della tua directory, proprio come se fossi in una "shell". Usa :!dir se ls non funziona. [Unix: ls MS-DOS: dir] NOTA: E' possibile in questo modo eseguire un comando a piacere, specificando anche dei parametri per i comandi stessi. NOTA: Tutti i comandi : devono essere terminati premendo Da qui in avanti non lo ripeteremo ogni volta. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 5.2: ANCORA SULLA SCRITTURA DEI FILE ** Per salvare le modifiche apportate a un testo batti :w NOMEFILE. ** 1. Batti :!dir or :!ls per procurarti una lista della tua directory. Già sai che devi premere 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 verifica batti ancora :!dir o :!ls per listare la tua directory. NOTA: Se esci da Vim e riesegui Vim battendo vim TEST , il file aperto sarà una copia esatta di "tutor.it" al momento del salvataggio. 5. Ora cancella il file battendo (MS-DOS): :!del TEST o (Unix): :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 5.3: SELEZIONARE IL TESTO DA SCRIVERE ** Per salvare una porzione di file, batti v movimento :w NOMEFILE ** 1. Muovi il cursore su questa linea. 2. Premi v e muovi il cursore fino alla linea numerata 5., qui sotto. Nota che il testo viene evidenziato. 3. Batti il carattere : . In fondo allo schermo apparirà :'<,'> . 4. Batti w TEST , dove TEST è il nome di un file non ancora esistente. Verifica che si veda :'<,'>w TEST prima di dare . 5. Vim scriverà nel file TEST le linee che hai selezionato. Usa :!dir o :!ls per controllare che esiste. Non cancellarlo ora! Ti servirà nella prossima lezione. NOTA: Battere v inizia una selezione visuale. Puoi muovere il cursore come vuoi, e rendere la selezione più piccola o più grande. Poi puoi usare un operatore per agire sul testo selezionato. Ad es., d cancella il testo. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 5.4: INSERIRE E RIUNIRE FILE ** Per inserire il contenuto di un file, batti :r NOMEFILE ** 1. Posiziona il cursore appena sopra questa riga. NOTA: Dopo aver eseguito il Passo 2 vedrai il testo della Lezione 5.3. Quindi spostati IN GIU' per tornare ancora a questa Lezione. 2. Ora inserisci il tuo file TEST con il comando :r TEST dove TEST è il nome che hai usato per creare il file. Il file richiesto è inserito sotto la linea in cui si trova il cursore. 3. 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 che viene dal file. NOTA: Puoi anche leggere l'output prodotto da un comando esterno. Ad es. :r !ls legge l'output del comando ls e lo inserisce sotto la linea in cui si trova il cursore. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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. v movimento :w NOMEFILE salva le linee selezionate in maniera visuale nel file NOMEFILE. 4. :r NOMEFILE legge il file NOMEFILE da disco e lo inserisce nel file che stai modificando, dopo la linea in cui è posizionato il cursore. 5. :r !dir legge l'output del comando dir e lo inserisce dopo la linea in cui è posizionato il cursore. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 6.1: IL COMANDO OPEN [APRIRE] ** Batti o per aprire una linea sotto il cursore ** ** e passare in Modalità Inserimento. ** 1. Muovi il cursore fino alla linea qui sotto, indicata da --->. 2. Batti la lettera minuscola o per aprire una linea sotto il cursore e passare in Modalità Inserimento. 3. Poi inserisci del testo e premi 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 una O maiuscola, invece che una o minuscola. Prova sulla linea qui sotto. Apri una linea SOPRA questa battendo O mentre il cursore è su questa linea. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 6.2: IL COMANDO APPEND [AGGIUNGERE] ** Batti a per inserire testo DOPO il cursore. ** 1. Muovi il cursore all'inizio della linea qui sotto, indicata da --->. 2. Batti e finché il cursore arriva alla fine di li . 3. Batti una a (minuscola) per aggiungere testo DOPO il cursore. 4. Completa la parola come mostrato nella linea successiva. Premi per uscire dalla Modalità Inserimento. 5. Usa e per passare alla successiva parola incompleta e ripeti i passi 3 e 4. ---> Questa li ti permetterà di esercit ad aggiungere testo a una linea. ---> Questa linea ti permetterà di esercitarti ad aggiungere testo a una linea. NOTA: a, i ed A entrano sempre in Modalità Inserimento, la sola differenza è dove verranno inseriti i caratteri. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 6.3: UN ALTRO MODO DI RIMPIAZZARE [REPLACE] ** Batti una R maiuscola per rimpiazzare più di un carattere. ** 1. Muovi il cursore alla prima linea qui sotto, indicata da --->. Muovi il cursore all'inizio del primo xxx . 2. Ora batti R e batti il numero che vedi nella linea seguente, in modo che rimpiazzi l' xxx . 3. Premi per uscire dalla Modalità Replace. Nota che il resto della linea resta invariato. 4. Ripeti i passi in modo da rimpiazzare l'altro xxx . ---> Aggiungendo 123 a xxx si ottiene xxx. ---> Aggiungendo 123 a 456 si ottiene 579. NOTA: La Modalità Replace è come la Modalità Inserimento, ma ogni carattere che viene battuto ricopre un carattere esistente. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 6.4: COPIA E INCOLLA DEL TESTO ** usa l'operatore y per copiare del testo e p per incollarlo ** 1. Vai alla linea indicata da ---> qui sotto, e metti il cursore dopo "a)". 2. Entra in Modalità Visuale con v e metti il cursore davanti a "primo". 3. Batti y per copiare [yank] il testo evidenziato. 4. Muovi il cursore alla fine della linea successiva: j$ 5. Batti p per incollare [paste] il testo. Poi batti: a secondo . 6. Usa la Modalità Visuale per selezionare " elemento.", copialo con y , Vai alla fine della linea successiva con j$ e incolla il testo con p . ---> a) questo è il primo elemento. b) NOTA: Puoi usare y come operatore; yw copia una parola [word]. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 6.5: SET [IMPOSTA] UN'OPZIONE ** Imposta un'opzione per ignorare maiuscole/minuscole ** ** durante la ricerca/sostituzione ** 1. Ricerca 'nota' battendo: /nota Ripeti la ricerca più volte usando il tasto n 2. Imposta l'opzione 'ic' (Ignore Case, [Ignora maiuscolo/minuscolo]) battendo: :set ic 3. Ora ricerca ancora 'nota' premendo il tasto n Troverai adesso anche Nota e NOTA . 4. Imposta le opzioni 'hlsearch' e 'incsearch' :set hls is 5. Ora batti ancora il comando di ricerca, e guarda cosa succede: /nota 6. Per disabilitare il riconoscimento di maiuscole/minuscole batti: :set noic NOTA: Per non evidenziare le occorrenze trovate batti: :nohlsearch NOTA: Per ignorare maiuscole/minuscole solo per una ricerca, usa \c nel comando di ricerca: /nota\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 6 SOMMARIO 1. Batti o per aggiungere una linea SOTTO il cursore ed entrare in Modalità Inserimento. Batti O per aggiungere una linea SOPRA il cursore. 2. Batti a per inserire testo DOPO il cursore. Batti A per inserire testo alla fine della linea. 3. Il comando e sposta il cursore alla fine di una parola. 4. L'operatore y copia del testo, p incolla del testo. 5. Batti R per entrare in Modalità Replace, e ne esci premendo . 6. Batti ":set xxx" per impostare l'opzione "xxx". Alcun opzioni sono: 'ic' 'ignorecase' ignorare maiuscole/minuscole nella ricerca 'is' 'incsearch' mostra occorrenze parziali durante una ricerca 'hls' 'hlsearch' evidenzia tutte le occorrenze di una ricerca Puoi usare sia il nome completo di un'opzione che quello abbreviato. 7. Usa il prefisso "no" per annullare una opzione: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 7.1: OTTENERE AIUTO ** Usa il sistema di aiuto on-line ** Vim ha un esauriente sistema di aiuto on-line. Per cominciare, prova una di queste alternative: - premi il tasto (se ce n'è uno) - premi il tasto (se ce n'è uno) - batti :help OPPURE :h Leggi il testo nella finestra di aiuto per vedere come funziona l'aiuto. Batti CTRL-W CTRL-W per passare da una finestra all'altra. Batti :q per chiudere la finestra di aiuto. Puoi trovare aiuto su quasi tutto, dando un argomento al comando ":help" Prova questi (non dimenticare di premere ): :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 7.2: PREPARARE 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 creare un file "vimrc". 1. Comincia a editare il file "vimrc". Questo dipende dal tuo sistema: :e ~/.vimrc per Unix :e $VIM/_vimrc per MS-Windows 2. Ora leggi i contenuti del file "vimrc" distribuito come esempio: :r $VIMRUNTIME/vimrc_example.vim 3. Scrivi il file con: :w La prossima volta che apri Vim, sarà abilitata la colorazione sintattica. Puoi aggiungere a questo file "vimrc" tutte le tue impostazioni preferite. Per maggiori informazioni batti: :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 7.3: COMPLETAMENTO ** Completamento linea comandi con CTRL-D e ** 1. Imposta Vim in modalità compatibile: :set nocp 2. Guarda i file esistenti nella directory: :!ls o :!dir 3. Batti l'inizio di un comando: :e 4. Premi CTRL-D e Vim ti mostra una lista di comandi che iniziano per "e". 5. Premi e Vim completa per te il nome comando come ":edit". 6. Ora batti uno spazio e l'inizio del nome di un file esistente: :edit FIL 7. Premi . Vim completerà il nome del file (se è il solo possibile). NOTA: Il completamento è disponibile per molti comandi. Prova a battere CTRL-D e . Particolarmente utile per :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 7 Sommario 1. Batti :help o premi o per aprire una finestra di aiuto. 2. Batti :help comando per avere aiuto su comando . 3. Batti CTRL-W CTRL-W per saltare alla prossima finestra. 4. Batti :q per chiudere la finestra di aiuto. 5. Crea uno script iniziale vimrc contenente le tue impostazioni preferite. 6. Mentre batti un comando : , premi CTRL-D per vedere i possibili completamenti. Premi per usare il completamento desiderato. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 (anche in italiano): ":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: azc100@gmail.com ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim-7.4.1689/runtime/tutor/tutor.ja.euc000066400000000000000000001010211267703067000176740ustar00rootroot00000000000000=============================================================================== = V I M (塼ȥꥢ) - Version 1.7 = =============================================================================== Vim ϡΥ塼ȥꥢˤ¿Υޥɤ ˶ϤʥǥǤΥ塼ȥꥢϡʤ Vim ǽǥ ȤƻȤʤ褦ˤʤΤ˽ʬʥޥɤˤĤ򤹤褦 ʤäƤޤ 塼ȥꥢλΤɬפʻ֤ϡФޥɤΤˤɤ ֤ȤΤˤޤ褽2530ʬǤ ATTENTION: ʲѥޥɤˤϤʸϤѹΤ⤢ޤϤ ˥ԡޤ礦("vimtutor"ʤС˥ԡƤޤ) Υ塼ȥꥢ뤬ȤȤdzФȤߤˤʤäƤ뤳Ȥ򡢿 ƤʤФʤޤؽˤϥޥɤºݤ˻ʤ ʤʤΤǤʸϤɤʤСä˺Ƥޤޤ! 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: 򥿥פƤ뤫Ƚʤʤä顢򲡤ƥΡޥ⡼ɤˤ ޤ줫Ϥ褦ȤƤޥɤϤޤ礦 NOTE: 륭ǤưǤޤ hjkl ˰ٴƤޤСϤ뤫 ®ư뤳ȤǤǤ礦ޥ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ å 1.2: VIM εưȽλ !! NOTE: ʲΤ륹ƥåפԤˡΥåɤߤޤ礦!! 1. 򲡤ޤ礦(μ¤˥Ρޥ⡼ɤˤ뤿) 2. Τ褦˥: :q! ˤԽƤ¸˥ǥλޤ 3. Υ塼ȥꥢϤ٤Υޥɤ¹Ԥȡޤ Υޥɤ: vimtutor 4. ޤǤΥƥåפФĤʤСƥå 1 3 ޤǤ ݤ˻ơVim 1ٽλƤƤӵưޤ礦 NOTE: :q! Ƥѹ˴ޤåˤѹե ¸ˡˤĤƤٶƤޤ礦 5. 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. ְ㤤 򲡤ƥޥɥ⡼ɤꡢʸˤʤ ˥ƥå 2 4 򷫤֤ޤ礦 ---> ˤ ­ʤ ƥ 롣 ---> ˤ Ĥ ­ʤ ƥ 롣 5. ˡ狼äå 1.5 ؿʤߤޤ礦 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ å 1.5: ƥԽ - ɲ ** ƥȤɲäˤ A 򲡤ޤ礦 ** 1. ʲ ---> ȼ줿ǽιԤ˥ưޤ礦 뤬ʸˤäƤ⤫ޤޤ 2. ɲäɬפʾ A 򥿥פޤ礦 3. ƥȤɲä顢 򲡤ƥΡޥ⡼ɤޤ礦 4. 2ܤ ---> ȼ줿ذưƥå 2 3 򷫤֤ʸˡ ޤ礦 ---> ˤϴְäƥȤ ˤϴְäƥȤޤ ---> ˤְäƥ ˤְäƥȤޤ 5. ƥȤɲäڲˤʤäƤå 1.6 ؿʤߤޤ礦 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ å 1.6: եԽ ** ե¸ƽλˤ :wq ȥפޤ ** !! NOTE: ʲΥƥåפ¹ԤˡޤΤɤǤ!! 1. å 1.2 Ǥä褦 :q! 򥿥פơΥ塼ȥꥢλ ޤ뤤ϡ̤üϤǰʲƤԤäƤ⤫ޤ ޤ 2. ץץȤǤΥޥɤ򥿥פޤ: vim tutor 'vim' Vim ǥư륳ޥɡ'tutor' Խե ̾ǤѹƤ褤եȤޤ礦 3. Υådzؤ褦ˡƥȤޤ 4. ѹե¸ޤ: :wq 5. ƥå 1 vimtutuor λ vimtutor ٵưʲ ؿʤߤޤ礦 6. ʾΥƥåפɤ򤷤Ǥ¹Ԥޤ礦 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ å 1 1. ⤷ hjkl ǰưޤ h () j () k () l () 2. Vim ưˤϥץץȤ vim ե̾ ȥפޤ 3. Vim λˤ :q! ȥפޤ(ѹ˴) ⤷ :wq ȥפޤ(ѹ¸) 4. βʸˤϡΡޥ⡼ɤ x ȥפޤ 5. ΰ֤ʸˤϡΡޥ⡼ɤ i ȥפޤ i ƥȤΥ ֤ɲ A ƥȤɲ ɲ NOTE: 򲡤ȥΡޥ⡼ɤ˰ܹԤޤκݡְä ΥޥɤäȤǤޤ ơ³ƥå 2 Ϥޤ礦 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ å 2.1: ޥ ** ñޤǤˤ dw ȥפޤ礦 ** 1. Ρޥ⡼ɤǤ뤳Ȥǧ뤿 򲡤ޤ礦 2. ʲ ---> ȼ줿Ԥ˥ưޤ礦 3. äñƬ˥ưޤ礦 4. ñ뤿 dw ȥפޤ礦 NOTE: פȡdw Ȥʸ꡼κDzԤ˸ޤ פְäƤޤäˤ 򲡤Ƥľޤ礦 ---> ʸ ˤ Ĥ Τ ɬפΤʤ ñ ޤޤ ޤ 5. 3 4 ޤǤʸʤޤǷ֤å 2.2 ؿʤߤޤ礦 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ å 2.2: ¾κޥ ** ԤޤǤˤ d$ ȥפޤ礦 ** 1. Ρޥ⡼ɤǤ뤳ȤǧΤ 򲡤ޤ礦 2. ʲ ---> ȼ줿Ԥ˥ưޤ礦 3. ʸإưޤ礦(ǽ θǤ) 4. ޤǺΤ d$ ȥפޤ礦 ---> ïιԤκǸ2٥פޤ 2٥פޤ 5. ɤȤ򤹤뤿ˡå 2.3 ؿʤߤޤ礦 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ å 2.3: ڥ졼ȥ⡼ ¿Υޥɤϥڥ졼ȥ⡼󤫤ƥȤѹäޤ ޥ d Υڥ졼ϼͤˤʤäƤޤ: d ⡼ 줾: d - ޥɡ ⡼ - ФƯ뤫(ʲ˵󤲤ޤ) ڥ졼ΰ: w - ֤ޤñޤǡ e - ֤ޤޤʤñޤǡ $ - ֤ޤǡ Ĥޤ de ȥפȡ֤ñνޤǤޤ NOTE: ͤϡΡޥ⡼ɤˤƥޥɤʤ˥⡼򲡤 ߤޤ礦뤬ŪǼ֤˰ưϤǤ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ å 2.4: ⡼˥ȤѤ ** Ԥ֤Υ⡼˿ͤ򥿥פޤ ** 1. ʲ ---> ȼ줿ԤƬ˥ưޤ 2. 2w 򥿥פñ2ʬ˰ưޤ 3. 3e 򥿥פ3ܤñνü˰ưޤ 4. 0 ()򥿥פƹƬ˰ưޤ 5. ƥå 2 3 㤦ͤȤäƷ֤ޤ ---> This is just a line with words you can move around in. 6. å 2.5 ˿ʤߤޤ礦 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ å 2.5: ¿뤿˥ȤѤ ** ڥ졼ȥȤ򥿥פȡʣ󷫤֤ޤ ** ҤκΥڥ졼ȥ⡼Ȥ߹碌˥Ȥɲä뤳Ȥǡ ¿κԤޤ: d ⡼ 1. ---> ȼ줿ԤιƬʬ˥ưޤ礦 2. UPPER CASE ñ2Ĥ d2w ȥפƺޤ 3. UPPER CASE ȤϢ³ñ1ĤΥޥɤȰۤʤ륫Ȥꤷ ƥå 1 2 򷫤֤ޤ ---> ABC DEԤFGHI JK LMN OPñQ RS TUVˤʤä NOTE: ڥ졼 d ȥ⡼δ֤˥ȤȤä硢ڥ졼Τʤ Υ⡼Τ褦ưޤ : 3dw d3w Ʊǡ3w ޤ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ å 2.6: Ԥ ** Τˤ dd ȥפޤ ** Τ٤¿ΤǡViΥǥʡϹԤκ d 2󥿥פ ñʤΤ˷ޤ 1. ʲζ2ܤ˥ưޤ 2. dd ȥפƹԤޤ 3. 4ܤ˰ưޤ 4. 2dd ȥפ2Ԥޤ ---> 1) Х֤ ---> 2) ĤޤʤΤϳڤ ---> 3) ߥĤ ---> 4) ϼ֤äƤ롢 ---> 5) פ𤲤롢 ---> 6) ϴŤ ---> 7) ޥʡ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ å 2.7: ľޥ ** ǸΥޥɤäˤ 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. ⡼򷫤֤ˤϿͤͿޤ: 2w 5. ѹѤ륳ޥɤη ڥ졼 [] ⡼ 줾: ڥ졼 - d Dz򤹤뤫 - Υޥɤ򲿲󷫤֤ ⡼ - w (ñ) $ ()ʤɤǡƥȤβФƯ 뤫 6. ԤƬ˰ưˤϥѤޤ: 0 7. ưä: 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.3 ؿʤߤޤ礦 NOTE: ºݤ˻ޤ礦褷ƳФˤϤʤȡ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ å 3.3: ѹޥ ** ñΰ⤷Τѹˤ cw ȥפޤ ** 1. ʲ ---> ȼ줿ǽιԤ˥ưޤ礦 2. lubw u ΰ֤˥ưޤ礦 3. cw ȥפñ򥿥פޤ礦(ξ 'ine' ȥ) 4. δְ㤤(ѹ٤ʸƬ)˰ư뤿 򥿥פޤ 5. ǽιԤιԤͤˤʤޤǥƥå 3 4 򷫤֤ޤ ---> This lubw has a few wptfd that mrrf changing usf the change operator. ---> This line has a few words that need changing using the change operator. cw ñѹǤʤԤ뤳Ȥդޤ礦 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ å 3.4: c Ѥ¾ѹ ** ѹޥɤϡޥɤƱͤ˥֥ȤѤޤ ** 1. ѹޥɤϡޥɤƱ褦ư򤷤ޤη c [] ⡼ 2. ֥ȤƱǡw ñ졢 $ ϹʤɤȤäΤǤ 3. ʲ ---> ȼ줿Ԥ˥ưޤ礦 4. ǽδְ㤤إưޤ礦 5. 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. NOTE: δְ㤤ϥХåڡȤäľȤǤޤ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ å 3 1. ˺줿ƥȤ֤ˤϡp 򥿥פޤϺ 줿ƥȤ򥫡θޤ(ñ̤Ǻ줿ΤʤС Τ뼡ιԤޤ) 2. βʸ֤ˤϡr 򥿥פ塢֤ ʸ򥿥פޤ 3. ѹޥɤǤϥ֤Υ⡼ǻꤵ뽪üޤǤ 뤳ȤǽǤ㤨 cw ʤХ֤ñνޤǡ c$ ʤйԤνޤǤѹޤ 4. ѹޥɤη c [] ⡼ Υåؿʤߤޤ礦 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ å 4.1: ֤ȥեξ ** եǤΰ֤ȥեξ֤ɽˤ CTRL-G 򥿥פޤ եΤԤ˰ưˤ G 򥿥פޤ ** NOTE: ƥåפ¹ԤˡΥåƤܤ̤ޤ礦!! 1. CTRL 򲡤ޤ g 򲡤ޤ礦 CTRL-G ȸƤǤޤ ڡΰֲ˥ե̾ȹֹ椬ɽϤǤ ƥå 3Τ ˹ֹФƤޤ礦 NOTE: ̤α˥ΰ֤ɽƤ뤫⤷ޤ󡣤 'ruler' ץ(:help 'ruler' 򻲾)ꤹ뤳Ȥɽޤ 2. DzԤ˰ư뤿 G 򥿥פޤ礦 եƬ˰ưˤ gg ȥפޤ礦 3. ۤɤιԤֹ򥿥פ G 򥿥פޤ礦ǽ CTRL-G 򲡤 äϤǤ 4. Ƥ饹ƥå 1 3 ¹Ԥޤ礦 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ å 4.2: ޥ ** 򸡺ˤ / ȡ򥿥פޤ** 1. Ρޥ⡼ɤ / Ȥʸ򥿥פޤֲ̰ : ޥɤ Ʊͤ / 뤳Ȥ˵ŤǤ礦 2. Ǥϡ'errroor' ȥפޤ礦줬ñǤ 3. Ʊ⤦ٸȤ ñ n 򥿥פޤ ˸򸡺Ȥ N 򥿥פޤ 4. ˸򸡺ϡ/ ? ޥɤѤޤ 5. ξˤ CTRL-O (Ctrl 򲡤³ʤ o ʸ)򥿥פ ޤˤϤ򷫤֤ޤCTRL-I Ǥ ---> "errroor" error ȥڥ뤬㤤ޤ; errroor Ϥ error Ǥ NOTE: եνãȡץ 'wrapscan' ꤵƤ ϡեƬ鸡³Ԥޤ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ å 4.3: б̤򸡺 ** б ),] } 򸡺ˤ % 򥿥פޤ ** 1. ---> Ǽ줿Ԥ (,[ { Τɤ줫˥ưޤ礦 2. % ȥפޤ礦 3. б̤˰ưϤǤ 4. ǽγ̤˰ưˤ % ȥפޤ礦 5. ¾ (,),[,],{ } ǥư% 򤷤Ƥ뤫ǧޤ礦 ---> 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 ȥפޤ礦ΥޥɤϤιԤǺǽ˸ ĤäΤˤԤʤ뤳Ȥ˵Ĥޤ礦 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 եΤǸĤΤФѹ롣 :%s/old/new/gc եΤǸĤΤФơ11ijǧȤ ѹ롣 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ å 4 1. CTRL-G ϥեǤΰ֤ȥեξܺ٤ɽޤ G ϥեκDzԤ˰ưޤ G ϤιԤ˰ưޤ gg ƬԤ˰ưޤ 2. / θ˸򥿥פ˸򸡺ޤ ? θ˸򥿥פȸ˸򸡺ޤ θ n ƱμθN ϵθ򤷤ޤ CTRL-O Ͼ˰ܤCTRL-I Ͼ򼡤˰ưޤ 3. (,),[,],{, ⤷ } ˥뤬֤ % 򥿥פФˤʤʸ ذưޤ 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. ! Ȥʸ(ò)򥿥פޤ礦 dz륳ޥɤ¹ԤǤͤˤʤޤ 3. Ȥ ! ³ ls ȥפ 򲡤ޤ礦 ץץȤΤ褦˥ǥ쥯ȥΰɽϤǤ ⤷ ls ưʤʤ :!dir Ѥޤ礦 NOTE: ˡˤäƤ륳ޥɤ¹Ԥ뤳ȤǤޤ Ϳޤ NOTE: Ƥ : ޥɤ 򲡤ƽλʤФʤޤ ʹߤǤϤΤȤ˸ڤޤ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ å 5.2: ¾Υեؽ񤭹 ** եѹ¸ˤ :w ե̾ ȥפޤ ** 1. ǥ쥯ȥΰ뤿 :!dir ⤷ :!ls ȥפޤ礦 Τ 򲡤Τϴˤ¸ΤǤ͡ 2. TEST Τ褦ˡΥǥ쥯ȥ̵ե̾Ӥޤ 3. Ǥ :w TEST ȥפޤ礦 (TEST ϡե̾Ǥ) 4. ˤեΤ TEST Ȥ̾¸ޤ ⤦ :!dir ⤷ :!ls ȥפƳǧƤߤޤ礦 NOTE: Vim λե̾ TEST ȶ˵ưȡ¸ 塼ȥꥢʣǤ夬ϤǤ 5. ˡΤ褦˥פƥեäޤ礦(MS-DOS): :!del TEST ⤷(Unix): :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ å 5.3: 򤷤񤭹 ** եΰ֤¸ˤϡv ⡼ :w FILENAME 򥿥פޤ ** 1. ιԤ˥ưޤ 2. v 򲡤ʲ5ܤ˥ưޤƥȤĴɽ ܤƲ 3. ʸ : 򲡤ȡ̤κDz :'<,'> ޤ 4. w TEST (TEST ¸ߤʤե̾)򥿥פޤ 򲡤 :'<,'>w TEST ȤʤäƤ뤳ȤǧƲ 5. Vim TEST Ȥե򤵤줿Ԥ񤭹Ǥ礦 !dir ⤷ !ls Ǥǧޤ ϺʤǤƲΥåǻѤޤ NOTE: v 򲡤ȡVisual 򤬻ϤޤޤưȤǡϰϤ 礭⾮ǤޤˡϰϤФƥڥ졼Ŭ ޤ㤨 d ϥƥȤޤ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ å 5.4: եμȹʻ ** եȤˤ :r ե̾ ȥפޤ ** 1. ʲιԤ˹碌ޤ NOTE: ƥå 2 μ¹Ը塢å 5.3 ΥƥȤޤ˲äƤ Υå˰ưޤ礦 2. Ǥ TEST Ȥե :r TEST Ȥޥɤɤ߹ߤޤ礦 Ǥ TEST ϻȤե̾ΤȤǤ ɤ߹ޤ줿եϡԤβˤޤ 3. եǧƤߤޤ礦᤹ȡå5.3 ꥸʥȥեˤΤ2Ĥ뤳Ȥ狼ޤ NOTE: ޥɤνϤɤ߹ळȤޤ㤨С :r !ls ls ޥɤνϤ򥫡ʲɤ߹ߤޤ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ å 5 1. :!command ˤä ޥɤ¹Ԥޤ 褯Ȥ: (MS-DOS) (Unix) :!dir :!ls - ǥ쥯ȥΰ򸫤롣 :!del FILENAME :!rm FILENAME - ե롣 2. :w ե̾ ˤäƥե̾Ȥե뤬ǥ˽񤭹ޤ롣 3. v ⡼ :w FILENAME Ȥȡӥ奢Ԥե¸ 롣 4. :r ե̾ ˤե̾Ȥե뤬ǥޤ졢 ֤β롣 5. :r !dir dir ޥɤνϤ򥫡ְʲɤ߹ࡣ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ å 6.1: ץ󥳥ޥ ** o 򥿥פȡβιԤ⡼ɤޤ ** 1. ʲ ---> ȼ줿Ԥ˥ưޤ礦 2. o (ʸ) 򥿥פơβιԤ򳫤⡼ɤޤ 3. ⡼ɤλ٤ 򥿥פޤ ---> o 򥿥פȥϳԤذư⡼ɤޤ 4. ξιԤˤϡʸ o ǤϤʤñʸ O 򥿥פޤιԤǻƤߤޤ礦 ---> ιԤξˤϡιԤإ֤ O 򥿥פޤ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ å 6.2: ɲåޥ ** μΰ֤ƥȤɲäˤ a ȥפޤ ** 1. ---> Ǽ줿Ԥذưޤ礦 2. e 򲡤 li νüޤǥưޤ 3. θ˥ƥȤɲä뤿 a (ʸ) 򥿥פޤ 4. βιԤΤ褦ñ˴ޤ⡼ɤȴ٤ ޤ 5. e ȤäƼԴñذưƥå 3 4 򷫤֤ޤ ---> This li will allow you to pract appendi text to a line. ---> This line will allow you to practice appending text to a line. NOTE: a, i A Ʊ⡼ɤذܤޤʸ֤ۤʤ ޤ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ å 6.3: ¾ִˡ ** 1ʸʾ֤ˤʸ R ȥפޤ礦 ** 1. ʲ ---> ȼ줿Ԥ˥ưޤǽ xxx Ƭ˰ư ޤ 2. R 򲡤ơ2ܤοͤ򥿥פ뤳Ȥǡxxx ִޤ 3. ִ⡼ɤȴˤ 򲡤ޤԤλĤ꤬ѹƤʤޤޤ ʤ뤳ȤդƤ 4. Ĥä xxx 򥹥ƥåפ򷫤ִ֤ޤ礦 ---> Adding 123 to xxx gives you xxx. ---> Adding 123 to 456 gives you 579. NOTE: ִ⡼ɤ⡼ɤ˻ƤޤƤΥפ줿ʸϴ¸ʸ ޤ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ å 6.4: ƥȤΥԡȥڡ ** ƥȤΥԡˤϥڥ졼 y 򡢥ڡȤˤ p Ȥޤ ** 1. ---> ȼ줿Ԥذư "a)" θ֤Ƥޤ 2. v ǥӥ奢⡼ɤ򳫻Ϥ"first"μޤǥưޤ 3. y 򥿥פƶĴɽ줿ƥȤ yank (ԡ)ޤ 4. ιԤιޤǥưޤ: j$ 5. p 򲡤Žդ(put)Ƥ顢򥿥פޤ: a second 6. ӥ奢⡼ɤ " item." 򤷡y ǥ󥯡ιԤιޤ j$ ư p ǥƥȤ򤽤 put ޤ ---> a) this is the first item. b) NOTE: ñ1 yank Τ y 򥪥ڥ졼Ȥ yw Ȥ뤳Ȥޤ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ å 6.5: ץ ** ִκݤʸ/ʸ̵뤹ˤϡץꤷޤ ** 1. ͤϤ 'ignore' 򸡺ޤ礦: /ignore n 򲡤Ʋ٤򷫤֤ޤ 2. ͤϤ 'ic' (Ignore Case ά) ץꤷޤ: :set ic 3. Ǥ n ˤäƤ⤦1 'ignore' 򸡺ޤ n 򲡤Ƥ˿󸡺򷫤֤ޤ礦 4. 'hlsearch' 'incsearch' ץꤷޤ礦: :set hls is 5. ޥɤϤơ뤫Ƥߤޤ礦: /ignore 6. ʸʸζ̵̤ˤˤϼͤϤޤ: :set noic NOTE: ޥåζĴɽˤϼͤϤޤ: :nohlsearch NOTE: 1Ĥθޥɤʸʸζ̤᤿ʤСե졼 \c Ѥޤ: /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ å 6 1. o 򥿥פȥβιԤ򳫤ơ⡼ɤˤʤ롣 O (ʸ) 򥿥פȥξιԤ⡼ɤˤʤ롣 2. ʸμƥȤɲäˤ a ȥפ롣 ˼ưǥƥȤˤʸ A 򥿥פ롣 3. e ޥɤñνüư롣 4. y ڥ졼ϥƥȤ yank (ԡ)p Ϥ put (ڡ)롣 5. ʸ R 򥿥פִ⡼ɤꡢ򲡤ȴ롣 6. ":set xxx" ȥפȥץ "xxx" ꤵ롣 'ic' 'ignorecase' ʸʸζ̤ʤ 'is' 'incsearch' ե졼ʬޥåƤʬɽ 'hls' 'hlsearch' ޥå뤹٤Ĵɽ ĹûɤΥץ̾ǤѤǤޤ 7. "no" Ϳץ̵ˤޤ: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ å 7.1: 饤إץޥ ** 饤إפѤޤ礦 ** Vim ˤϹϤˤ錄륪饤إץƥबޤ إפ򳫻Ϥˤϡ3ĤΤɤ줫1ĤƤߤޤ礦: - إץ 򲡤(⤷ʤ) - 򲡤(⤷ʤ) - :help ȥפ롣 إץɥΥƥȤɤȡإפưǤޤ CTRL-W CTRL-W ȥפ إץɥإפޤ :q ȥפ إץɥĤޤ ":help" ޥɤ˰Ϳ뤳Ȥˤꡢ̾Υإפ򸫤Ĥ뤳 ǤޤƤߤޤ礦( 򥿥פ˺ʤ褦): :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ å 7.2: ưץȤκ ** 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" եءߤɲä뤳ȤǤޤ ¿ξˤ :help vimrc-intro ȥפޤ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ å 7.3: 䴰 ** CTRL-D ǥޥɥ饤䴰 ** 1. ߴ⡼ɤǤʤȤǧޤ: :set nocp 2. ߤΥǥ쥯ȥ˺ߤե :!ls :!dir dzǧޤ 3. ޥɤγϤ򥿥פޤ: :e 4. CTRL-D 򲡤 Vim "e" Ϥޤ륳ޥɤΰɽޤ 5. 򲡤 Vim ":edit" Ȥޥ̾䴰ޤ 6. ˶ȡ¸Υե̾λϤޤäޤ: :edit FIL 7. 򲡤 Vim ̾䴰ޤ(⤷Ĥ̵ä) NOTE: 䴰¿Υޥɤưޤ CTRL-D ƤߤƤ ä :help κݤΩޤ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ å 7 1. إץɥ򳫤ˤ :help Ȥ뤫 򲡤 2. ޥ(cmd)Υإפ򸡺ˤ :help cmd ȥפ롣 3. ̤Υɥإפˤ CTRL-W CTRL-W ȥפ롣 4. إץɥĤˤ :q ȥפ롣 5. ߤݤĤˤ vimrc ưץȤ롣 6. : command Dzǽ䴰򸫤ˤ CTRL-D 򥿥פ롣 䴰Ѥˤ 򲡤 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ˤ Vim Υ塼ȥꥢ򽪤ޤǥñˡ⽼ʬ ȤȤǤ褦ˤȡVim λijǰΤߤ褦Ȥޤ 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. ܸ ٹ ƽ ¼ Ϻ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vi:set ts=8 sts=4 sw=4 tw=78: vim-7.4.1689/runtime/tutor/tutor.ja.sjis000066400000000000000000001010211267703067000200700ustar00rootroot00000000000000=============================================================================== = V I M { (`[gA) - Version 1.7 = =============================================================================== Vim ́Ã`[gAŐɂ͑̃R}h ɋ͂ȃGfB^[łB̃`[gÁAȂ Vim 𖜔\GfB ^[ƂĎgȂ悤ɂȂ̂ɏ\ȃR}hɂ‚Đ悤 ȂĂ܂B `[gÂɕKvȎԂ́AoR}ĥɂǂꂾ Ԃĝɂ܂A悻2530łB ATTENTION: ȉ̗KpR}hɂ͂͂̕ύX̂܂BKn߂O ɃRs[쐬܂傤("vimtutor"Ȃ΁AɃRs[Ă܂)B ̃`[gAAgƂŊodg݂ɂȂĂ邱ƂAS ĂȂ΂Ȃ܂BwKɂ̓R}hۂɎȂ ȂȂ̂łB͂ǂ񂾂Ȃ΁AƖYĂ܂܂!B ACapsbN(Shift-Lock)L[ĂȂƂmFAʂ bX1.1 S\Ƃ܂ŁAj L[ăJ[\ړ 傤B ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 1.1: J[\̈ړ ** J[\ړɂ́Al h,j,k,l ܂ ** ^ k qg: h L[͍Ɉړ܂B < h l > l L[͉EɈړ܂B j j L[͉L[̂悤ȃL[łB v 1. ړɊ܂ŁAXN[ŃJ[\ړ܂傤B 2. ւ̃L[(j)‚ÂƁAAĈړł܂B Ŏ̃bXɈړ@킩܂ˁB 3. ւ̃L[gāAbX1.2 Ɉړ܂傤B NOTE: ^CvĂ邩ȂȂAăm[}[hɂ ܂Bꂩ͂悤ƂĂR}hē͂܂傤B NOTE: J[\L[łړł܂B hjkl ɈxĂ܂΁A͂邩 ɑړ邱Ƃłł傤B}W! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 1.2: VIM ̋NƏI !! NOTE: ȉ̂XebvsOɁÃbXǂ݂܂傤!! 1. L[܂傤B(mɃm[}[hɂ邽) 2. ̂悤Ƀ^Cv: :q! ɂҏWeۑɃGfB^I܂B 3. ̃`[gAn߂ׂ̃R}hsƁAɖ߂܂B ̃R}h: vimtutor 4. ܂ł̃XebvoM‚Ȃ΁AXebv 1 3 ܂ł ۂɎāAVim 1xIĂĂыN܂傤B NOTE: :q! ͑SĂ̕ύXj܂BbXɂĕύXt@Cɕ @ɂ‚Ă׋Ă܂傤B 5. 1.3܂ŃJ[\ړ܂傤B ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 1.3: eLXgҏW - 폜 ** m[}[hɂăJ[\̉̕폜ɂ x ܂ ** 1. ȉ ---> ƎꂽsɃJ[\ړ܂傤B 2. ԈႢC邽߂ɁA폜ŏ̕܂ŃJ[\ړ܂B 3. sKvȕ x č폜܂傤B 4. Ȃ܂ Xebv 2 4 JԂ܂傤B ---> ‚‚ Ă Ƃт͂˂ 5. sȂAbX 1.4 ֐i݂܂傤B NOTE: SẴbXʂāAo悤Ƃ̂ł͂ȂۂɂĂ݂܂傤B ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 1.4: eLXgҏW - } ** m[}[hɂăeLXg}ɂ i ܂ ** 1. ȉ ---> Ǝꂽŏ̍sɃJ[\ړ܂傤B 2. 1sڂ2sڂƓlɂ邽߂ɁAeLXg}Ȃ΂ȂȂʒu ̎̕ɃJ[\ړ܂B 3. i L[ĂAljKvȕ^Cv܂傤B 4. ԈႢC ăR}h[hɖ߂AɂȂl ɃXebv 2 4 JԂ܂傤B ---> ɂ Ȃ eLXg B ---> s ɂ ‚ Ȃ eLXg B 5. }̕@킩烌bX 1.5 ֐i݂܂傤B ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 1.5: eLXgҏW - lj ** eLXgljɂ A ܂傤 ** 1. ȉ ---> Ǝꂽŏ̍sɃJ[\ړ܂傤B J[\̕ɂĂ܂܂B 2. ljKvȏꏊ A ^Cv܂傤B 3. eLXgljIA ăm[}[hɖ߂܂傤B 4. 2sڂ ---> ƎꂽꏊֈړAXebv 2 3 JԂĕ@ C܂傤B ---> ɂ͊ԈeLXg ɂ͊ԈeLXg܂B ---> ɂԈeLX ɂԈeLXg܂B 5. eLXg̒ljyɂȂĂ烌bX 1.6 ֐i݂܂傤B ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 1.6: t@C̕ҏW ** t@CۑďIɂ :wq ƃ^Cv܂ ** !! NOTE: ȉ̃XebvsOɁA܂Ŝǂł!! 1. bX 1.2 ł悤 :q! ^CvāÃ`[gAI ܂B邢́Aʂ̒[ꍇ͂ňȉ̓esĂ܂ ܂B 2. VFvvgł̃R}h^Cv܂: vim tutor 'vim' Vim GfB^NR}hA'tutor' ͕ҏWt@C OłBύXĂ悢t@Cg܂傤B 3. ÕbXŊw񂾂悤ɁAeLXg}A폜܂B 4. ύXt@Cɕۑ܂: :wq 5. Xebv 1 vimtutuor Iꍇ vimtutor ēxNAȉ v֐i݂܂傤B 6. ȏ̃Xebvǂŗłs܂傤B ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 1 v 1. J[\͖L[ hjkl L[ňړ܂B h () j () k () l (E) 2. Vim Nɂ̓vvg vim t@C ƃ^Cv܂B 3. Vim Iɂ :q! ƃ^Cv܂(ύXj)B :wq ƃ^Cv܂(ύXۑ)B 4. J[\̉̕폜ɂ́Am[}[h x ƃ^Cv܂B 5. J[\̈ʒuɕ}ɂ́Am[}[h i ƃ^Cv܂B i eLXg̃^Cv J[\ʒuɒlj A eLXg̒lj sɒlj NOTE: L[ƃm[}[hɈڍs܂B̍ہAԈ͓r ̃R}hƂł܂B āAăbX 2 n߂܂傤B ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 2.1: 폜R}h ** P̖܂ł폜ɂ dw ƃ^Cv܂傤 ** 1. m[}[hł邱ƂmF邽߂ ܂傤B 2. ȉ ---> ƎꂽsɃJ[\ړ܂傤B 3. P̐擪ɃJ[\ړ܂傤B 4. P폜邽߂ dw ƃ^Cv܂傤B NOTE: ^CvƁAdw ƂXN[̍ʼnsɌ܂B ^CvԈĂ܂ɂ Ă蒼܂傤B ---> ɂ ‚ ̂ Kv̂Ȃ P ܂܂ ܂B 5. 3 4 ܂ł𕶂Ȃ܂ŌJԂAbX 2.2 ֐i݂܂傤B ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 2.2: ̑̍폜R}h ** s̖܂ł폜ɂ d$ ƃ^Cv܂傤 ** 1. m[}[hł邱ƂmF̂ ܂傤B 2. ȉ ---> ƎꂽsɃJ[\ړ܂傤B 3. ̖փJ[\ړ܂傤(ŏ B ̌ł)B 4. s܂ō폜̂ d$ ƃ^Cv܂傤B ---> N̍s̍Ō2x^Cv܂B 2x^Cv܂B 5. ǂƂ邽߂ɁAbX 2.3 ֐i݂܂傤B ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 2.3: Iy[^ƃ[V ̃R}h̓Iy[^ƃ[VeLXgɕύX܂B 폜R}h d ̃Iy[^͎̗lɂȂĂ܂: d [V ꂼ: d - 폜R}hB [V - ɑ΂ē邩(ȉɋ܂)B Iy[^̈ꕔꗗ: w - J[\ʒu󔒂܂ޒP̖܂ŁB e - J[\ʒu󔒂܂܂ȂP̖܂ŁB $ - J[\ʒus܂ŁB ‚܂ de ƃ^CvƁAJ[\ʒuP̏I܂ł폜܂B NOTE: `ĺAm[}[hɂăR}hȂɃ[V ݂܂傤BJ[\ړIꗗŎʒuɈړ͂łB ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 2.4: [VɃJEggp ** sJԂ̃[V̑Oɐl^Cv܂B ** 1. ȉ ---> Ǝꂽs̐擪ɃJ[\ړ܂B 2. 2w ^CvĒP2•OɈړ܂B 3. 3e ^Cv3–ڂ̒P̏I[Ɉړ܂B 4. 0 ([)^CvčsɈړ܂B 5. Xebv 2 3 ႤlgČJԂ܂B ---> This is just a line with words you can move around in. 6. bX 2.5 ɐi݂܂傤B ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 2.5: 葽폜邽߂ɃJEggp ** Iy[^ƃJEg^CvƁȂ삪JԂ܂B ** q̍폜̃Iy[^ƃ[V̑gݍ킹ɃJEglj邱ƂŁA 葽̍폜s܂: d l [V 1. ---> Ǝꂽs̍sɃJ[\ړ܂傤B 2. UPPER CASE ̒P2‚ d2w ƃ^Cvč폜܂B 3. UPPER CASE ƂAPA1‚̃R}hƈقȂJEgw肵A Xebv 1 2 JԂ܂B ---> ABC DEsFGHI JK LMN OPPQ RS TUVYɂȂB NOTE: Iy[^ d ƃ[V̊ԂɃJEggꍇAIy[^̂Ȃ ꍇ̃[V̂悤ɓ삵܂B : 3dw d3w ͓ŁA3w 폜܂B ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 2.6: s̑ ** sŜ폜ɂ dd ƃ^Cv܂ ** sŜ폜px̂ŁAVĩfUCi[͍s̍폜 d 2^Cv ȒPȂ̂Ɍ߂܂B 1. ȉ̋2sڂɃJ[\ړ܂B 2. dd ƃ^Cvčs폜܂B 3. 4sڂɈړ܂B 4. 2dd ƃ^Cv2s폜܂B ---> 1) o͐ԂA ---> 2) ‚܂Ȃ̂͊yA ---> 3) X~͐‚A ---> 4) ͎ԂĂA ---> 5) vA ---> 6) ͊ ---> 7) I}Gi[ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 2.7: 蒼R}h ** Ō̃R}hɂ u ܂BU ͍sŜ̎łB ** 1. ȉ ---> ƎꂽsɃJ[\ړAŏ̊ԈႢɃJ[\ ړ܂傤B 2. x ^CvĂȂ擪̕폜܂傤B 3. Au ^CvčŌɎsR}h܂傤B 4. x́Ax gpČSďC܂傤B 5. 啶 U ^CvāAs̏Ԃɖ߂܂傤B 6. u ^CvĒO U R}h܂傤B 7. ł̓R}hĎŝ CTRL-R (CTRL ܂ R ł)𐔉 ^CvĂ݂܂傤(̎)B ---> ̂̍ŝ̊ԈႢCXAł̏C܂܂B 8. ͂ƂĂ֗ȃR}hłBbX 2 v֐i݂܂傤B ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 2 v 1. J[\ʒuP̖܂ł폜ɂ dw ƃ^Cv܂B 2. J[\ʒus̖܂ł폜ɂ d$ ƃ^Cv܂B 3. sŜ폜ɂ dd ƃ^Cv܂B 4. [VJԂɂ͐lt^܂: 2w 5. ύXɗpR}ȟ` Iy[^ [l] [V ꂼ: Iy[^ - 폜 d ̗ނʼn邩B l - ̃R}hJԂB [V - w (P) $ (s)Ȃǂ̗ނŁAeLXg̉ɑ΂ē 邩B 6. s̐擪Ɉړɂ̓[gp܂: 0 7. O̓: u ( u) sŜ̕ύX: U (啶 U) ̎: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 3.1: \tR}h ** Ōɍ폜ꂽsJ[\̌ɓ\tɂ p ^Cv܂ ** 1. ȉ̒i̍ŏ̍sɃJ[\ړ܂傤B 2. dd ƃ^Cvčs폜AVim ̃obt@Ɋi[܂傤B 3. 폜s{ׂʒȕ̍s܂ŁAJ[\ړ܂傤B 4. m[}[h p ^CvĊi[sʂɖ߂܂B 5. ԂȂlɃXebv 2 4 JԂ܂傤B d) MwԂƂł? b) X~͐‚A c) mbƂ͊wԂ́A a) o͐ԂA ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 3.2: uR}h ** J[\̉̕uɂ r ^Cv܂ ** 1. ȉ ---> Ǝꂽŏ̍sɃJ[\ړ܂傤B 2. ŏ̊ԈႢ̐擪ɃJ[\ړ܂傤B 3. r ƃ^CvAԈĂ镶uA^Cv܂傤B 4. ŏ̍sȂ܂ŃXebv 2 3 JԂ܂傤B ---> ̍l͂ˁA̐l͊‚L[! ---> ̍s͂ɁA̐l͊‚ԈL[܂! 5. AbX 3.3 ֐i݂܂傤B NOTE: ۂɎ܂傤BĊo邾ɂ͂ȂƁB ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 3.3: ύXR}h ** P̈ꕔA͑ŜύXɂ cw ƃ^Cv܂ ** 1. ȉ ---> Ǝꂽŏ̍sɃJ[\ړ܂傤B 2. lubw u ̈ʒuɃJ[\ړ܂傤B 3. cw ƃ^CvAP^Cv܂傤(̏ꍇ 'ine' ƃ^Cv)B 4. ̊ԈႢ(ύXׂ̐擪)Ɉړ邽߂ ^Cv܂B 5. ŏ̍s̍s̗lɂȂ܂ŃXebv 3 4 JԂ܂B ---> This lubw has a few wptfd that mrrf changing usf the change operator. ---> This line has a few words that need changing using the change operator. cw ͒PύX邾łȂA}s邱Ƃɒӂ܂傤B ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 3.4: c gp̑̕ύX ** ύXR}h́A폜R}hƓlɃIuWFNggp܂ ** 1. ύXR}h́A폜R}hƓ悤ȓ܂B̌` c [l] [V 2. IuWFNgŁAw ͒PA $ ͍sȂǂƂ̂łB 3. ȉ ---> ƎꂽsɃJ[\ړ܂傤B 4. ŏ̊ԈႢփJ[\ړ܂傤B 5. c$ ƃ^Cvčs̎cQsڂ̗lɂA ܂傤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. NOTE: ^Cv̊ԈႢ̓obNXy[XL[gĒƂł܂B ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 3 v 1. ɍ폜ꂽeLXgĔzuɂ́Ap ^Cv܂B͍폜 ꂽeLXgJ[\̌ɑ}܂(sPʂō폜ꂽ̂Ȃ΁AJ[ \̂鎟̍sɑ}܂)B 2. J[\̉̕uɂ́Ar ^CvAu ^Cv܂B 3. ύXR}hł̓J[\ʒũ[VŎw肳I[܂ł X邱Ƃ”\łBႦ cw Ȃ΃J[\ʒuP̏I܂ŁA c$ Ȃ΍s̏I܂łύX܂B 4. ύXR}ȟ` c [l] [V ÃbX֐i݂܂傤B ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 4.1: ʒuƃt@C̏ ** t@Cł̈ʒuƃt@C̏Ԃ\ɂ CTRL-G ^Cv܂B t@ĈsɈړɂ G ^Cv܂ ** NOTE: XebvsOɁÃbXSĂɖڂʂ܂傤!! 1. CTRL ܂ g ܂傤B̑ CTRL-G ƌĂł܂B y[ẄԉɃt@Cƍsԍ\͂łB Xebv 3̂ ɍsԍoĂ܂傤B NOTE: ʂ̉EɃJ[\̈ʒu\Ă邩܂B 'ruler' IvV(:help 'ruler' Q)ݒ肷邱Ƃŕ\܂B 2. ʼnsɈړ邽߂ G ^Cv܂傤B t@C̐擪Ɉړɂ gg ƃ^Cv܂傤B 3. قǂ̍s̔ԍ^Cv G ^Cv܂傤Bŏ CTRL-G s ɖ߂ė͂łB 4. MĂXebv 1 3 s܂傤B ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 4.2: R}h ** ɂ / ƁAO^Cv܂B** 1. m[}[h / Ƃ^Cv܂Bʈԉ : R}h l / 邱ƂɋCÂł傤B 2. ł́A'errroor' ƃ^Cv܂傤BꂪPłB 3. xƂ P n ^Cv܂B tɌƂ N ^Cv܂B 4. tɌꍇ́A/ ̑ ? R}hgp܂B 5. ̏ꏊɖ߂ɂ CTRL-O (Ctrl Ȃ o ^Cv)^Cv ܂Bɖ߂ɂ͂JԂ܂BCTRL-I ͑OłB ---> "errroor" error ƃXyႢ܂; errroor ͂ error łB NOTE: t@C̏IɒBƁAIvV 'wrapscan' ݒ肳Ă ꍇ́At@C̐擪猟𑱍s܂B ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 4.3: Ή銇ʂ ** Ή ),] } ɂ % ^Cv܂ ** 1. ---> Ŏꂽs (,[ { ̂ǂꂩɃJ[\ړ܂傤B 2. % ƃ^Cv܂傤B 3. J[\͑Ή銇ʂɈړ͂łB 4. ŏ̊ʂɈړɂ % ƃ^Cv܂傤B 5. (,),[,],{ } ŃJ[\ړA% Ă邩mF܂傤B ---> This ( is a test line with ('s, ['s ] and {'s } in it. )) NOTE: ̋@\͊ʂvĂȂvOfobÔɂƂĂ𗧂 ܂B ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 4.4: ԈႢύX@ ** 'old' 'new' ɒuɂ :s/old/new/g ƃ^Cv܂ ** 1. ȉ ---> ƎꂽsɃJ[\ړ܂傤B 2. :s/thee/the ƃ^Cv܂傤B̃R}h͂̍sōŏɌ ‚̂ɂsȂ邱ƂɋC‚܂傤B 3. ł :s/thee/the/g ƃ^Cv܂傤BsŜ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 #,# ɂ͒u͈͂̊JnƏI̍sԍw肵 B :%s/old/new/g t@CŜŌ‚̂ɑ΂ĕύXB :%s/old/new/gc t@CŜŌ‚̂ɑ΂āA11ŠmFƂ ύXB ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 4 v 1. CTRL-G ̓t@Cł̈ʒuƃt@C̏ڍׂ\܂B G ̓t@C̍ʼnsɈړ܂B l G ͂̍sɈړ܂B gg ͐擪sɈړ܂B 2. / ̌Ɍ^CvƑOɌ܂B ? ̌Ɍ^CvƌɌ܂B ̌ n ͓̎̌AN ͋ť܂B CTRL-O ͏ꏊOɈڂACTRL-I ͏ꏊɈړ܂B 3. (,),[,],{, } ɃJ[\Ԃ % ^CvƑ΂ɂȂ镶 ֈړ܂B 4. ݍs̍ŏ old new ɒuB :s/old/new ݍs̑SĂ old new ɒuB :s/old/new/g 2‚ # ԂŌuB :#,#s/old/new/g t@C̒̑SĂ̌uB :%s/old/new/g 'c' ƒu̓xɊmF߂B :%s/old/new/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 5.1: OR}hs@ ** :! ̌ɎsOR}h^Cv܂ ** 1. ʂ̍ʼnɃJ[\ړ悤Ae : ^Cv܂傤B ŃR}h^CvłlɂȂ܂B 2. ! Ƃ(Q)^Cv܂傤B ŊOVFR}hsłlɂȂ܂B 3. Ƃ ! ɑ ls ƃ^Cv ܂傤B VFvvĝ悤ɃfBNg̈ꗗ\͂łB ls ȂȂ :!dir gp܂傤B NOTE: ̕@ɂĂR}hs邱Ƃł܂B ^܂B NOTE: SĂ : R}h ďIȂ΂Ȃ܂B ȍ~ł͂̂ƂɌy܂B ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 5.2: ̑̃t@C֏ ** t@C֕ύXۑɂ :w t@C ƃ^Cv܂ ** 1. fBNg̈ꗗ𓾂邽߂ :!dir :!ls ƃ^Cv܂傤B ̂ ̂͊ɂmłˁB 2. TEST ̂悤ɁÃfBNgɖt@C‘Iт܂B 3. ł :w TEST ƃ^Cv܂傤 (TEST ́AI񂾃t@Cł)B 4. ɂt@CŜ TEST ƂOŕۑ܂B x :!dir :!ls ƃ^CvĊmFĂ݂܂傤B NOTE: Vim IAt@C TEST ƋɋNƁAۑ `[gA̕łオ͂łB 5. ɁÂ悤Ƀ^Cvăt@C܂傤(MS-DOS): :!del TEST (Unix): :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 5.3: I ** t@C̈ʒuۑɂ́Av [V :w FILENAME ^Cv܂B ** 1. ̍sɃJ[\ړ܂B 2. v Aȉ̑5ڂɃJ[\ړ܂BeLXg\ ɒڂĉB 3. : ƁAʂ̍ʼn :'<,'> ܂B 4. w TEST (TEST ݂͑Ȃt@C)^Cv܂B O :'<,'>w TEST ƂȂĂ邱ƂmFĉB 5. Vim TEST Ƃt@CɑIꂽsނł傤B !dir !ls łmF܂B ͍폜ȂłĉB̃bXŎgp܂B NOTE: v ƁAVisual In܂܂BJ[\𓮂ƂŁAI͈͂ 傫ł܂BɁȂI͈͂ɑ΂ăIy[^Kp ܂BႦ d ̓eLXg폜܂B ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 5.4: t@C̎捞ƍ ** t@C̒g}ɂ :r t@C ƃ^Cv܂ ** 1. J[\ȉ̍sɍ킹܂B NOTE: Xebv 2 ̎sAbX 5.3 ̃eLXg܂BɉĂ ̃bXɈړ܂傤B 2. ł TEST Ƃt@C :r TEST ƂR}hœǂݍ݂܂傤B ł TEST ͎gt@C̖ÔƂłB ǂݍ܂ꂽt@ĆAJ[\s̉ɂ܂B 3. 捞񂾃t@CmFĂ݂܂傤BJ[\߂ƁAbX5.3 IWiƃt@Cɂ̂2‚邱Ƃ킩܂B NOTE: OR}h̏o͂ǂݍނƂo܂BႦ΁A :r !ls ls R}h̏o͂J[\ȉɓǂݍ݂܂B ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 5 v 1. :!command ɂ OR}hs܂B 悭g: (MS-DOS) (Unix) :!dir :!ls - fBNg̈ꗗB :!del FILENAME :!rm FILENAME - t@C폜B 2. :w t@C ɂăt@CƂt@CfBXNɏ܂B 3. v [V :w FILENAME ƂƁArWAIst@Cɕۑ B 4. :r t@C ɂt@CƂt@CfBXN捞܂A J[\ʒủɑ}B 5. :r !dir dir R}h̏o͂J[\ʒuȉɓǂݍށB ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 6.1: I[vR}h ** o ^CvƁAJ[\̉̍sJA}[hɓ܂ ** 1. ȉ ---> ƎꂽsɃJ[\ړ܂傤B 2. o () ^CvāAJ[\̉̍sJA}[hɓ܂B 3. ɑ}[hIׂ ^Cv܂B ---> o ^CvƃJ[\͊Jsֈړ}[hɓ܂B 4. J[\̏̍sɑ}ɂ́A o ł͂ȂAPɑ啶 O ^Cv܂B̍sŎĂ݂܂傤B ---> ̍s֑̏}ɂ́A̍sփJ[\u O ^Cv܂B ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 6.2: ljR}h ** J[\̎̈ʒueLXgljɂ a ƃ^Cv܂ ** 1. J[\ ---> Ŏꂽsֈړ܂傤B 2. e li ̏I[܂ŃJ[\ړ܂B 3. J[\̌ɃeLXglj邽߂ a () ^Cv܂B 4. ̉̍ŝ悤ȒPɊ܂B}[h𔲂ׂ ܂B 5. e gĎ̕sSȒPֈړAXebv 3 4 JԂ܂B ---> This li will allow you to pract appendi text to a line. ---> This line will allow you to practice appending text to a line. NOTE: a, i A ͓}[hֈڂ܂A}ʒuقȂ ܂B ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 6.3: ̑̒u@ ** 1ȏuɂ͑啶 R ƃ^Cv܂傤 ** 1. ȉ ---> ƎꂽsɃJ[\ړ܂Bŏ xxx ̐擪Ɉړ ܂B 2. R āA2sڂ̐l^Cv邱ƂŁAxxx u܂B 3. u[h𔲂ɂ ܂Bs̎c肪ύXĂȂ܂܂ Ȃ邱ƂɒӂĂB 4. c xxx XebvJԂĒu܂傤B ---> Adding 123 to xxx gives you xxx. ---> Adding 123 to 456 gives you 579. NOTE: u[h͑}[hɎĂ܂ASẴ^Cvꂽ͊̕ 폜܂B ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 6.4: eLXg̃Rs[ƃy[Xg ** eLXg̃Rs[ɂ̓Iy[^ y Ay[Xgɂ p g܂ ** 1. ---> ƎꂽsֈړAJ[\ "a)" ̌ɒuĂ܂B 2. v ŃrWA[hJnA"first"̎O܂ŃJ[\ړ܂B 3. y ^Cvċ\ꂽeLXg yank (Rs[)܂B 4. ̍s̍s܂ŃJ[\ړ܂: j$ 5. p ē\t(put)ĂA^Cv܂: a second 6. rWA[h " item." IAy ŃNA̍s̍s܂ j$ ړA p ŃeLXg put ܂B ---> a) this is the first item. b) NOTE: P1 yank ̂ y Iy[^Ƃ yw Ƃ邱Ƃo܂B ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 6.5: IvV̐ݒ ** u̍ۂɑ啶/𖳎ɂ́AIvVݒ肵܂ ** 1. ̗lɓ͂ 'ignore' ܂傤: /ignore n ĉxJԂ܂B 2. ̗lɓ͂ 'ic' (Ignore Case ̗) IvVݒ肵܂: :set ic 3. ł n ɂĂ1x 'ignore' ܂B n Ăɐ񌟍JԂ܂傤B 4. 'hlsearch' 'incsearch' IvVݒ肵܂傤: :set hls is 5. R}hē͂āAN邩Ă݂܂傤: /ignore 6. 啶̋ʂ𖳌ɂɂ͎̗lɓ͂܂: :set noic NOTE: }b`̋\߂ɂ͎̗lɓ͂܂: :nohlsearch NOTE: 1‚̌R}h啶̋ʂ߂Ȃ΁At[Y \c gp܂: /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 6 v 1. o ^CvƃJ[\̉̍sJāAő}[hɂȂB O (啶) ^CvƃJ[\̏̍ső}[hɂȂB 2. J[\̎̕eLXgljɂ a ƃ^CvB sɎŃeLXg}ɂ͑啶 A ^CvB 3. e R}h͒P̏I[J[\ړB 4. y Iy[^̓eLXg yank (Rs[)Ap ͂ put (y[Xg)B 5. 啶 R ^Cvƒu[hɓAƔB 6. ":set xxx" ƃ^CvƃIvV "xxx" ݒ肳B 'ic' 'ignorecase' ɑ啶̋ʂȂ 'is' 'incsearch' t[Yɕ}b`Ă镔\ 'hls' 'hlsearch' }b`邷ׂ\ AZAǂ̃IvVłgpł܂B 7. "no" t^AIvV𖳌ɂ܂: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 7.1: ICwvR}h ** ICwvgp܂傤 ** Vim ɂ͍L͂ɂ킽ICwvVXe܂B wvJnɂ́A3‚̂ǂꂩ1‚Ă݂܂傤: - wvL[ (Ȃ)B - L[(Ȃ)B - :help ƃ^CvB wvEBhẼeLXgǂނƁAwv̓삪ł܂B CTRL-W CTRL-W ƃ^Cv wvEBhEփWv܂B :q ƃ^Cv wvEBhE‚܂B ":help" R}hɈ^邱ƂɂA薼̃wv‚邱 ł܂BĂ݂܂傤( ^CvYȂ悤): :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 7.2: NXNvg̍쐬 ** Vim ̓𔭊 ** Vim ɂ Vi ̓𓥂܂Ă܂ÂقƂǂ͏Ԃɂ gps‚ƂȂĂ܂B葽̓g͂߂ɂ "vimrc" t@C 쐬܂B 1. "vimrc" t@C̕ҏWJnB̓VXeɈˑ܂B :edit ~/.vimrc UNIX :edit $VIM/_vimrc MS-Windows 2. ŃTv "vimrc" ǂݍ݂܂B :read $VIMRUNTIME/vimrc_example.vim 3. ȉ̂悤Ƀt@C֏݂܂B :write Vim NƁAFÂ\g悤ɂȂł傤B "vimrc" t@CցAD݂̐ݒlj邱Ƃł܂B 葽̏𓾂ɂ :help vimrc-intro ƃ^Cv܂B ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 7.3: ⊮ ** CTRL-D ŃR}hC⊮ ** 1. ݊[hłȂƂmF܂: :set nocp 2. ݂̃fBNgɍ݂t@C :!ls :!dir ŊmF܂B 3. R}h̊Jn^Cv܂: :e 4. CTRL-D Vim "e" n܂R}ḧꗗ\܂B 5. Vim ":edit" ƂR}h⊮܂B 6. ɋ󔒂ƁÃt@C̎n܂܂: :edit FIL 7. Vim ͖O⊮܂B(‚ꍇ) NOTE: ⊮͑̃R}hœ삵܂B CTRL-D Ă݂Ă B :help ̍ۂɖ𗧂܂B ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 7 v 1. wvEBhEJɂ :help Ƃ邩 B 2. R}h(cmd)̃wvɂ :help cmd ƃ^CvB 3. ʂ̃EBhEփWvɂ CTRL-W CTRL-W ƃ^CvB 4. wvEBhE‚ɂ :q ƃ^CvB 5. D݂̐ݒۂ‚ɂ vimrc NXNvg쐬B 6. : command ʼn”\ȕ⊮ɂ CTRL-D ^CvB ⊮gpɂ B ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ɂ Vim ̃`[gAI܂BGfB^ȒPɁA[ gƂł悤ɂƁAVim ̎ŠTO̗v_݂̂`悤Ƃ܂B Vim ɂ͂ɑ̃R}hAőSĂ邱Ƃ͂ł܂B ȍ~̓[U[}jAQƂ: ":help user-manual" Ȍ̊wK̂߂ɁA̖{𐄑E܂B Vim - Vi Improved - by Steve Oualline oŎ: New Riders ŏ̖{͊S Vim ̂߂ɏ܂BƂ킯S҂ɂ͂߂łB ̗}łfڂĂ܂B URLQƂĉ 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 ̃`[gA Colorado State University Charles Smith ̃ACfA ɁAColorado School of Mines Michael C. Pierce Robert K. Ware ɂď܂B E-mail: bware@mines.colorado.edu. Modified for Vim by Bram Moolenaar. { { ׍O ďC Y ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vi:set ts=8 sts=4 sw=4 tw=78: vim-7.4.1689/runtime/tutor/tutor.ja.utf-8000066400000000000000000001257701267703067000201040ustar00rootroot00000000000000=============================================================================== = V I M 教 本 (チュートリアル) へ よ う こ そ - Version 1.7 = =============================================================================== Vim は、このチュートリアルで説明するには多すぎる程のコマンドを備えた非常 に強力なエディターです。このチュートリアルは、あなたが Vim を万能エディ ターとして使いこなせるようになるのに十分なコマンドについて説明をするよう なっています。 チュートリアルを完了するのに必要な時間は、覚えたコマンドを試すのにどれだ け時間を使うのかにもよりますが、およそ25から30分です。 ATTENTION: 以下の練習用コマンドにはこの文章を変更するものもあります。練習を始める前 にコピーを作成しましょう("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: 何をタイプしているか判らなくなったら、を押してノーマルモードにし ます。それから入力しようとしていたコマンドを再入力しましょう。 NOTE: カーソルキーでも移動できます。しかし hjkl に一度慣れてしまえば、はるか に速く移動することができるでしょう。いやマジで! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 1.2: VIM の起動と終了 !! NOTE: 以下のあらゆるステップを行う前に、このレッスンを読みましょう!! 1. キーを押しましょう。(確実にノーマルモードにするため) 2. 次のようにタイプ: :q! これにより編集した内容を保存せずにエディタが終了します。 3. このチュートリアルを始める為のコマンドを実行すると、ここに戻れます。 そのコマンドは: vimtutor 4. これまでのステップを覚え自信がついたならば、ステップ 1 から 3 までを実 際に試して、Vim を1度終了してから再び起動しましょう。 NOTE: :q! は全ての変更を破棄します。レッスンにて変更をファイルに保 存する方法についても勉強していきましょう。 5. 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. 間違いを修正したら を押してコマンドモードに戻り、正しい文になる様 にステップ 2 から 4 を繰り返しましょう。 ---> この には 足りない テキスト ある。 ---> この 行 には 幾つか 足りない テキスト が ある。 5. 挿入の方法がわかったらレッスン 1.5 へ進みましょう。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 1.5: テキスト編集 - 追加 ** テキストを追加するには A を押しましょう ** 1. 以下の ---> と示された最初の行にカーソルを移動しましょう。 カーソルがその文字上にあってもかまいません。 2. 追加が必要な場所で A をタイプしましょう。 3. テキストを追加し終えたら、 を押してノーマルモードに戻りましょう。 4. 2行目の ---> と示された場所へ移動し、ステップ 2 から 3 を繰り返して文法 を修正しましょう。 ---> ここには間違ったテキストがあり ここには間違ったテキストがあります。 ---> ここにも間違ったテキス ここにも間違ったテキストがあります。 5. テキストの追加が軽快になってきたらレッスン 1.6 へ進みましょう。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 1.6: ファイルの編集 ** ファイルを保存して終了するには :wq とタイプします ** !! NOTE: 以下のステップを実行する前に、まず全体を読んでください!! 1. レッスン 1.2 でやったように :q! をタイプして、このチュートリアルを終了 します。あるいは、別の端末がある場合はそこで以下の内容を行ってもかまい ません。 2. シェルプロンプトでこのコマンドをタイプします: vim tutor 'vim'が Vim エディタを起動するコマンド、'tutor' は編集したいファイルの 名前です。変更してもよいファイルを使いましょう。 3. 前のレッスンで学んだように、テキストを挿入、削除します。 4. 変更をファイルに保存します: :wq 5. ステップ 1 で vimtutuor を終了した場合は vimtutor を再度起動し、以下の 要約へ進みましょう。 6. 以上のステップを読んで理解した上でこれを実行しましょう。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 1 要約 1. カーソルは矢印キーもしくは hjkl キーで移動します。 h (左) j (下) k (上) l (右) 2. Vim を起動するにはプロンプトから vim ファイル名 とタイプします。 3. Vim を終了するには :q! とタイプします(変更を破棄)。 もしくは :wq とタイプします(変更を保存)。 4. カーソルの下の文字を削除するには、ノーマルモードで x とタイプします。 5. カーソルの位置に文字を挿入するには、ノーマルモードで i とタイプします。 i テキストのタイプ カーソル位置に追加 A テキストの追加 行末に追加 NOTE: キーを押すとノーマルモードに移行します。その際、間違ったり入力途 中のコマンドを取り消すことができます。 さて、続けてレッスン 2 を始めましょう。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 2.1: 削除コマンド ** 単語の末尾までを削除するには dw とタイプしましょう ** 1. ノーマルモードであることを確認するために を押しましょう。 2. 以下の ---> と示された行にカーソルを移動しましょう。 3. 消したい単語の先頭にカーソルを移動しましょう。 4. 単語を削除するために dw とタイプしましょう。 NOTE: タイプすると、dw という文字がスクリーンの最下行に現われます。 タイプを間違ってしまった時には を押してやり直しましょう。 ---> この 文 紙 には いくつかの たのしい 必要のない 単語 が 含まれて います。 5. 3 から 4 までを文が正しくなるまで繰り返し、レッスン 2.2 へ進みましょう。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 2.2: その他の削除コマンド ** 行の末尾までを削除するには d$ とタイプしましょう ** 1. ノーマルモードであることを確認するのに を押しましょう。 2. 以下の ---> と示された行にカーソルを移動しましょう。 3. 正しい文の末尾へカーソルを移動しましょう(最初の 。 の後です)。 4. 行末まで削除するのに d$ とタイプしましょう。 ---> 誰かがこの行の最後を2度タイプしました。 2度タイプしました。 5. どういうことか理解するために、レッスン 2.3 へ進みましょう。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 2.3: オペレータとモーション 多くのコマンドはオペレータとモーションからテキストに変更を加えます。 削除コマンド d のオペレータは次の様になっています: d モーション それぞれ: d - 削除コマンド。 モーション - 何に対して働きかけるか(以下に挙げます)。 オペレータの一部一覧: w - カーソル位置から空白を含む単語の末尾まで。 e - カーソル位置から空白を含まない単語の末尾まで。 $ - カーソル位置から行末まで。 つまり de とタイプすると、カーソル位置から単語の終わりまでを削除します。 NOTE: 冒険したい人は、ノーマルモードにてコマンドなしにモーションを押して みましょう。カーソルが目的語一覧で示される位置に移動するはずです。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 2.4: モーションにカウントを使用する ** 何回も行いたい繰り返しのモーションの前に数値をタイプします。 ** 1. 以下の ---> と示された行の先頭にカーソルを移動します。 2. 2w をタイプして単語2つ分前に移動します。 3. 3e をタイプして3つ目の単語の終端に移動します。 4. 0 (ゼロ)をタイプして行頭に移動します。 5. ステップ 2 と 3 を違う数値を使って繰り返します。 ---> This is just a line with words you can move around in. 6. レッスン 2.5 に進みましょう。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 2.5: より多くを削除するためにカウントを使用する ** オペレータとカウントをタイプすると、その操作が複数回繰り返されます。 ** 既述の削除のオペレータとモーションの組み合わせにカウントを追加することで、 より多くの削除が行えます: d 数値 モーション 1. ---> と示された行の行頭部分にカーソルを移動しましょう。 2. UPPER CASE の単語2つを d2w とタイプして削除します。 3. UPPER CASE という連続した単語を、1つのコマンドと異なるカウントを指定し、 ステップ 1 と 2 を繰り返します。 ---> このABC DE行のFGHI JK LMN OP単語はQ RS TUV綺麗になった。 NOTE: オペレータ d とモーションの間にカウントを使った場合、オペレータのない 場合のモーションのように動作します。 例: 3dw と d3w は同等で、3w を削除します。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 2.6: 行の操作 ** 行全体を削除するには dd とタイプします ** 行全体を削除する頻度が多いので、Viのデザイナーは行の削除を d の2回タイプと いう簡単なものに決めました。 1. 以下の句の2行目にカーソルを移動します。 2. dd とタイプして行を削除します。 3. さらに4行目に移動します。 4. 2dd とタイプして2行を削除します。 ---> 1) バラは赤い、 ---> 2) つまらないものは楽しい、 ---> 3) スミレは青い、 ---> 4) 私は車をもっている、 ---> 5) 時計が時刻を告げる、 ---> 6) 砂糖は甘い ---> 7) オマエモナー ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 2.7: やり直しコマンド ** 最後のコマンドを取り消すには 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. モーションを繰り返すには数値を付与します: 2w 5. 変更に用いるコマンドの形式は オペレータ [数値] モーション それぞれ: オペレータ - 削除 d の類で何をするか。 数値 - そのコマンドを何回繰り返すか。 モーション - w (単語)や $ (行末)などの類で、テキストの何に対して働きか けるか。 6. 行の先頭に移動するにはゼロを使用します: 0 7. 前回の動作を取消す: 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.3 へ進みましょう。 NOTE: 実際に試しましょう。決して覚えるだけにはしないこと。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 3.3: 変更コマンド ** 単語の一部、もしくは全体を変更するには cw とタイプします ** 1. 以下の ---> と示された最初の行にカーソルを移動しましょう。 2. lubw の u の位置にカーソルを移動しましょう。 3. cw とタイプし、正しい単語をタイプしましょう(この場合 'ine' とタイプ)。 4. 次の間違い(変更すべき文字の先頭)に移動するために をタイプします。 5. 最初の行が次の行の様になるまでステップ 3 と 4 を繰り返します。 ---> This lubw has a few wptfd that mrrf changing usf the change operator. ---> This line has a few words that need changing using the change operator. cw は単語を変更するだけでなく、挿入も行えることに注意しましょう。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 3.4: c を使用したその他の変更 ** 変更コマンドは、削除コマンドと同じ様にオブジェクトを使用します ** 1. 変更コマンドは、削除コマンドと同じような動作をします。その形式は c [数値] モーション 2. オブジェクトも同じで、w は単語、 $ は行末などといったものです。 3. 以下の ---> と示された行にカーソルを移動しましょう。 4. 最初の間違いへカーソルを移動しましょう。 5. c$ とタイプして行の残りを2行目の様にし、 を押しましょう。 ---> 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. NOTE: タイプ中の間違いはバックスペースキーを使って直すこともできます。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 3 要約 1. 既に削除されたテキストを再配置するには、p をタイプします。これは削除さ れたテキストをカーソルの後に挿入します(行単位で削除されたのならば、カー ソルのある次の行に挿入されます)。 2. カーソルの下の文字を置き換えるには、r をタイプした後、それを置き換える 文字をタイプします。 3. 変更コマンドではカーソル位置から特定のモーションで指定される終端までを変 更することが可能です。例えば cw ならばカーソル位置から単語の終わりまで、 c$ ならば行の終わりまでを変更します。 4. 変更コマンドの形式は c [数値] モーション さぁ、次のレッスンへ進みましょう。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 4.1: 位置とファイルの情報 ** ファイル内での位置とファイルの状態を表示するには CTRL-G をタイプします。 ファイル内のある行に移動するには G をタイプします ** NOTE: ステップを実行する前に、このレッスン全てに目を通しましょう!! 1. CTRL を押したまま g を押しましょう。この操作を CTRL-G と呼んでいます。 ページの一番下にファイル名と行番号が表示されるはずです。 ステップ 3のため に行番号を覚えておきましょう。 NOTE: 画面の右下隅にカーソルの位置が表示されているかもしれません。これは 'ruler' オプション(:help 'ruler' を参照)を設定することで表示されます。 2. 最下行に移動するために G をタイプしましょう。 ファイルの先頭に移動するには gg とタイプしましょう。 3. 先ほどの行の番号をタイプし G をタイプしましょう。最初に CTRL-G を押した行 に戻って来るはずです。 4. 自信が持てたらステップ 1 から 3 を実行しましょう。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 4.2: 検索コマンド ** 語句を検索するには / と、前方検索する語句をタイプします。** 1. ノーマルモードで / という文字をタイプします。画面一番下に : コマンドと 同じ様に / が現れることに気づくでしょう。 2. では、'errroor' とタイプしましょう。これが検索したい単語です。 3. 同じ語をもう一度検索するときは 単に n をタイプします。 逆方向に語句を検索するときは N をタイプします。 4. 逆方向に語句を検索する場合は、/ の代わりに ? コマンドを使用します。 5. 元の場所に戻るには CTRL-O (Ctrl を押し続けながら o 文字タイプ)をタイプし ます。さらに戻るにはこれを繰り返します。CTRL-I は前方向です。 ---> "errroor" は error とスペルが違います; errroor はいわゆる error です。 NOTE: 検索がファイルの終わりに達すると、オプション 'wrapscan' が設定されている 場合は、ファイルの先頭から検索を続行します。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 4.3: 対応する括弧を検索 ** 対応する ),] や } を検索するには % をタイプします ** 1. 下の ---> で示された行で (,[ か { のどれかにカーソルを移動しましょう。 2. そこで % とタイプしましょう。 3. カーソルは対応する括弧に移動するはずです。 4. 最初の括弧に移動するには % とタイプしましょう。 5. 他の (,),[,],{ や } でカーソルを移動し、% が何をしているか確認しましょう。 ---> 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 とタイプしましょう。このコマンドはその行で最初に見 つかったものにだけ行なわれることに気をつけましょう。 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 ファイル全体で見つかるものに対して変更する。 :%s/old/new/gc ファイル全体で見つかるものに対して、1つ1つ確認をとりな がら変更する。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 4 要約 1. CTRL-G はファイルでの位置とファイルの詳細を表示します。 G はファイルの最下行に移動します。 数値 G はその行に移動します。 gg は先頭行に移動します。 2. / の後に語句をタイプすると前方に語句を検索します。 ? の後に語句をタイプすると後方に語句を検索します。 検索の後の n は同じ方向の次の検索を、N は逆方向の検索をします。 CTRL-O は場所を前に移し、CTRL-I は場所を次に移動します。 3. (,),[,],{, もしくは } 上にカーソルがある状態で % をタイプすると対になる文 字へ移動します。 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 とタイプし を押しましょう。 シェルプロンプトのようにディレクトリの一覧が表示されるはずです。 もしくは ls が動かないならば :!dir を使用しましょう。 NOTE: この方法によってあらゆるコマンドが実行することができます。もちろん引数 も与えられます。 NOTE: 全ての : コマンドは を押して終了しなければなりません。 以降ではこのことに言及しません。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 5.2: その他のファイルへ書き込み ** ファイルへ変更を保存するには :w ファイル名 とタイプします ** 1. ディレクトリの一覧を得るために :!dir もしくは :!ls とタイプしましょう。 このあと を押すのは既にご存知ですね。 2. TEST のように、そのディレクトリに無いファイル名を一つ選びます。 3. では :w TEST とタイプしましょう (TEST は、選んだファイル名です)。 4. これによりファイル全体が TEST という名前で保存されます。 もう一度 :!dir もしくは :!ls とタイプして確認してみましょう。 NOTE: ここで Vim を終了し、ファイル名 TEST と共に起動すると、保存した時の チュートリアルの複製ができ上がるはずです。 5. さらに、次のようにタイプしてファイルを消しましょう(MS-DOS): :!del TEST もしくは(Unix): :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 5.3: 選択した書き込み ** ファイルの位置を保存するには、v モーションと :w FILENAME をタイプします。 ** 1. この行にカーソルを移動します。 2. v を押し、以下の第5項目にカーソルを移動します。テキストが強調表示されるの に注目して下さい。 3. 文字 : を押すと、画面の最下部に :'<,'> が現れます。 4. w TEST (TEST は存在しないファイル名)をタイプします。 を押す前に :'<,'>w TEST となっていることを確認して下さい。 5. Vim は TEST というファイルに選択された行を書き込むでしょう。 !dir もしくは !ls でそれを確認します。 それは削除しないでおいて下さい。次のレッスンで使用します。 NOTE: v を押すと、Visual 選択が始まります。カーソルを動かすことで、選択範囲を 大きくも小さくもできます。さらに、その選択範囲に対してオペレータを適用 きます。例えば d はテキストを削除します。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 5.4: ファイルの取込と合併 ** ファイルの中身を挿入するには :r ファイル名 とタイプします ** 1. カーソルを以下の行に合わせます。 NOTE: ステップ 2 の実行後、レッスン 5.3 のテキストが現れます。下に下がってこ のレッスンに移動しましょう。 2. では TEST というファイルを :r TEST というコマンドで読み込みましょう。 ここでいう TEST は使うファイルの名前のことです。 読み込まれたファイルは、カーソル行の下にあります。 3. 取込んだファイルを確認してみましょう。カーソルを戻すと、レッスン5.3 の オリジナルとファイルによるものの2つがあることがわかります。 NOTE: 外部コマンドの出力を読み込むことも出来ます。例えば、 :r !ls は ls コマンドの出力をカーソル以下に読み込みます。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 5 要約 1. :!command によって 外部コマンドを実行します。 よく使う例: (MS-DOS) (Unix) :!dir :!ls - ディレクトリ内の一覧を見る。 :!del FILENAME :!rm FILENAME - ファイルを削除する。 2. :w ファイル名 によってファイル名というファイルがディスクに書き込まれる。 3. v モーションで :w FILENAME とすると、ビジュアル選択行がファイルに保存さ れる。 4. :r ファイル名 によりファイル名というファイルがディスクより取込まれ、 カーソル位置の下に挿入される。 5. :r !dir は dir コマンドの出力をカーソル位置以下に読み込む。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 6.1: オープンコマンド ** o をタイプすると、カーソルの下の行が開き、挿入モードに入ります ** 1. 以下の ---> と示された行にカーソルを移動しましょう。 2. o (小文字) をタイプして、カーソルの下の行を開き、挿入モードに入ります。 3. さらに挿入モードを終了する為に をタイプします。 ---> o をタイプするとカーソルは開いた行へ移動し挿入モードに入ります。 4. カーソルの上の行に挿入するには、小文字の o ではなく、単純に大文字の O をタイプします。次の行で試してみましょう。 ---> この行の上へ挿入するには、この行へカーソルを置いて O をタイプします。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 6.2: 追加コマンド ** カーソルの次の位置からテキストを追加するには a とタイプします ** 1. カーソルを ---> で示された行へ移動しましょう。 2. e を押して li の終端部までカーソルを移動します。 3. カーソルの後ろにテキストを追加するために a (小文字) をタイプします。 4. その下の行のような単語に完成させます。挿入モードを抜ける為に を押 します。 5. e を使って次の不完全な単語へ移動し、ステップ 3 と 4 を繰り返します。 ---> This li will allow you to pract appendi text to a line. ---> This line will allow you to practice appending text to a line. NOTE: a, i と A は同じ挿入モードへ移りますが、文字が挿入される位置だけが異なり ます。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 6.3: その他の置換方法 ** 1文字以上を置き換えるには大文字の R とタイプしましょう ** 1. 以下の ---> と示された行にカーソルを移動します。最初の xxx の先頭に移動し ます。 2. R を押して、2行目の数値をタイプすることで、xxx が置換されます。 3. 置換モードを抜けるには を押します。行の残りが変更されていないままに なることに注意してください。 4. 残った xxx をステップを繰り返して置換しましょう。 ---> Adding 123 to xxx gives you xxx. ---> Adding 123 to 456 gives you 579. NOTE: 置換モードは挿入モードに似ていますが、全てのタイプされた文字は既存の文字 を削除します。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 6.4: テキストのコピーとペースト ** テキストのコピーにはオペレータ y を、ペーストには p を使います ** 1. ---> と示された行へ移動し、カーソルを "a)" の後に置いておきます。 2. v でビジュアルモードを開始し、"first"の手前までカーソルを移動します。 3. y をタイプして強調表示されたテキストを yank (コピー)します。 4. 次の行の行末までカーソルを移動します: j$ 5. p を押して貼り付け(put)てから、次をタイプします: a second 6. ビジュアルモードで " item." を選択し、y でヤンク、次の行の行末まで j$ で 移動し、 p でテキストをそこに put します。 ---> a) this is the first item. b) NOTE: 単語を1つ yank するのに y をオペレータとして yw とすることも出来ます。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 6.5: オプションの設定 ** 検索や置換の際に大文字/小文字を無視するには、オプションを設定します ** 1. 次の様に入力して 'ignore' を検索しましょう: /ignore n を押して何度か検索を繰り返します。 2. 次の様に入力して 'ic' (Ignore Case の略) オプションを設定します: :set ic 3. では n によってもう1度 'ignore' を検索します。 n を押してさらに数回検索を繰り返しましょう。 4. 'hlsearch' と 'incsearch' オプションを設定しましょう: :set hls is 5. 検索コマンドを再入力して、何が起こるか見てみましょう: /ignore 6. 大文字小文字の区別を無効にするには次の様に入力します: :set noic NOTE: マッチの強調表示をやめるには次の様に入力します: :nohlsearch NOTE: 1つの検索コマンドだけ大文字小文字の区別をやめたいならば、フレーズに \c を使用します: /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 6 要約 1. o をタイプするとカーソルの下の行を開けて、そこで挿入モードになる。 O (大文字) をタイプするとカーソルの上の行で挿入モードになる。 2. カーソル上の文字の次からテキストを追加するには a とタイプする。 行末に自動でテキストを挿入するには大文字 A をタイプする。 3. e コマンドは単語の終端部カーソルを移動する。 4. y オペレータはテキストを yank (コピー)し、p はそれを put (ペースト)する。 5. 大文字の R をタイプすると置換モードに入り、を押すと抜ける。 6. ":set xxx" とタイプするとオプション "xxx" が設定される。 'ic' 'ignorecase' 検索時に大文字小文字の区別しない 'is' 'incsearch' 検索フレーズに部分マッチしている部分を表示する 'hls' 'hlsearch' マッチするすべを強調表示する 長い方、短い方、どちらのオプション名でも使用できます。 7. "no" を付与し、オプションを無効にします: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 7.1: オンラインヘルプコマンド ** オンラインヘルプを使用しましょう ** Vim には広範にわたるオンラインヘルプシステムがあります。 ヘルプを開始するには、これら3つのどれか1つを試してみましょう: - ヘルプキー を押す(もしあるならば)。 - キーを押す(もしあるならば)。 - :help とタイプする。 ヘルプウィンドウのテキストを読むと、ヘルプの動作が理解できます。 CTRL-W CTRL-W とタイプすると ヘルプウィンドウへジャンプします。 :q とタイプすると ヘルプウィンドウが閉じられます。 ":help" コマンドに引数を与えることにより、あらゆる題名のヘルプを見つけること ができます。これらを試してみましょう( をタイプし忘れないように): :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 7.2: 起動スクリプトの作成 ** 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" ファイルへ、お好みの設定を追加することができます。 より多くの情報を得るには :help vimrc-intro とタイプします。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 7.3: 補完 ** CTRL-D と でコマンドラインを補完する ** 1. 互換モードでないことを確認します: :set nocp 2. 現在のディレクトリに在るファイルを :!ls か :!dir で確認します。 3. コマンドの開始をタイプします: :e 4. CTRL-D を押すと Vim は "e" から始まるコマンドの一覧を表示します。 5. を押すと Vim は ":edit" というコマンド名を補完します。 6. さらに空白と、既存のファイル名の始まりを加えます: :edit FIL 7. を押すと Vim は名前を補完します。(もし一つしか無かった場合) NOTE: 補完は多くのコマンドで動作します。そして CTRL-D と 押してみてくだ さい。特に :help の際に役立ちます。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 7 要約 1. ヘルプウィンドウを開くには :help とするか もしくは を押す。 2. コマンド(cmd)のヘルプを検索するには :help cmd とタイプする。 3. 別のウィンドウへジャンプするには CTRL-W CTRL-W とタイプする。 4. ヘルプウィンドウを閉じるには :q とタイプする。 5. お好みの設定を保つには vimrc 起動スクリプトを作成する。 6. : command で可能な補完を見るには CTRL-D をタイプする。 補完を使用するには を押す。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ これにて 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. 日本語訳 松本 泰弘 監修 村岡 太郎 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vi:set ts=8 sts=4 sw=4 tw=78: vim-7.4.1689/runtime/tutor/tutor.ko.euc000066400000000000000000000651161267703067000177310ustar00rootroot00000000000000=============================================================================== = (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 ʽÿ. : ʴ 𰡰 Է Ǿٸ, , ưʽÿ. Ŀ ϴ ٽ ԷϽʽÿ. : ĿŰ ۵ Դϴ. hjkl ͼ, ĿŰ ξ ̵ Դϴ. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 1.2: ϰ !! : Ʒ ִ ܰ踦 ϱ , lesson ü ʽÿ!! 1. Ű Ȯϰ ɴϴ. 2. Էմϴ: :q! ---> ̷ ϸ, ٲ * ʰ* ⸦ ϴ. Էմϴ: :wq 3. Ʈ δٸ, ٽ ̷ ƿ Էմϴ. vimtutor Ǵ ֽϴ. vim tutor.ko ---> '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. Ŀ ưϴ. ùٸ 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 3. ä :q! :wq 4. 忡 Ŀ ġ ڸ x Էմϴ. 5. 忡 Ŀ ġ ؽƮ Ϸ i ؽƮ Էϰ ϴ. : ư , ġ ʴ ̳ Էµ ϴ ϴ. ׷ Lesson 2 սô. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 2.1: (DELETION) ** ܾ dw ġ ˴ϴ. ** 1. Ű Ȯϰ ɴϴ. 2. Ʒ ---> ǥõ Ŀ űϴ. 3. ܾ ó Ŀ űϴ. 4. dw ļ ܾ ϴ. : Ѵ ϸ ȭ ٿ dw ڰ ǥõ˴ϴ. ߸ ƴٸ, ٽ Ͻʽÿ. ---> 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. Ű Ȯϰ ɴϴ. 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. ϴ (Ǿ ù ڷ ϴ.) 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$ ԷϿ, ι° ó ǵ ʽÿ. ---> 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' ģ ġʽÿ. ܾ ã մϴ. 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 Է Ĩϴ. ٿ ó ߰ߵ ͸ ٲ۴ٴ Ϳ Ͻʽÿ. 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 Է ĺʽÿ. Ʈ ó 丮 µ Դϴ. ls ʴ´ٸ :!dir õ ʽÿ. :  ܺ ɵ ֽϴ. : : ľ ˴ϴ. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 5.2: ڼ ** Ϸ Ϸ, :w FILENAME Ͻʽÿ. ** 1. :!dir Ǵ :!ls ԷϿ 丮 Ʈ ɴϴ. ľѴٴ ̹ ˰ Դϴ. 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. ---> ǥõ 忡 ʽÿ. ---> 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 , Ŀ Ʒ ִ ڸ ݺϰ, ְ, ƿͼ, Ŀ ű 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. , ٲ ؽƮ ״ ˴ϴ. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 Էϸ ٲٱ 尡 ˴ϴ. 4. ":set xxx" ϸ "xxx" ɼ ˴ϴ. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LESSON 7: ¶ ** ¶ ý ϱ ** ¶ ý մϴ. , ϳ õغʽÿ: - Ű . (Ű ִ ) - Ű . (Ű ִ ) - :help ԷѴ. â :q ԷϽʽÿ. ":help" ɿ ڸ ָ  ã ֽϴ. ʽÿ. ( Ű ʽÿ.) :help w :help c_ l 키는 오른쪽에 있으며, 오른쪽으로 j 움직입니다. v j 키는 아래방향 화살표처럼 생겼습니다. 1. 익숙해질 때까지 커서를 스크린 상에서 움직여 보십시오. 2. 아래 방향키 (j)를 반복입력이 될 때까지 누르고 계십시오. ---> 이제 다음 lesson으로 가는 방법을 알게 되었습니다. 3. 아래 방향키를 이용하여, Lesson 1.2 로 가십시오. 참고: 원하지 않는 무언가가 입력이 되었다면, 를 눌러서, 명령 모드로 돌아가십시오. 그 후에 원하는 명령을 다시 입력하십시오. 참고: 커서키 또한 작동할 것입니다. 하지만 hjkl에 익숙해지면, 커서키보다 훨씬 빠르게 이동할 수 있을 것입니다. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 1.2: 빔을 시작하고 끝내기 !! 주의: 아래 있는 단계를 실행하기 전에, 이 lesson 전체를 읽으십시오!! 1. 키를 눌러서 확실하게 명령 모드로 빠져 나옵니다. 2. 다음과 같이 입력합니다: :q! ---> 이렇게 하면, 바뀐 내용을 *저장하지 않고* 편집기를 빠져나갑니다. 저장한 후 빠져나가려면 다음과 같이 입력합니다: :wq 3. 쉘 프롬프트가 보인다면, 다시 길잡이로 돌아오기 위해 다음과 같이 입력합니다. vimtutor 또는 다음과 같을 수도 있습니다. vim tutor.ko ---> '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. 수정한 후에는 를 눌러서 명령 모드로 돌아갑니다. 문장을 올바르게 만들기 위해 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 3. 수정한 내용을 무시한 채로 빔에서 빠져나가려면 :q! 저장한 후 빔에서 빠져나가려면 :wq 4. 명령 모드에서 커서가 위치한 곳의 글자를 지우려면 x 를 입력합니다. 5. 명령 모드에서 커서가 위치한 곳에 텍스트를 삽입하려면 i 를 누른 후 텍스트를 입력하고 를 누릅니다. 참고: 는 명령 모드로 돌아가는 데 쓰며, 원치 않는 명령이나 완전히 입력되지 않은 명령을 취소하는 데에도 씁니다. 그럼 Lesson 2를 시작합시다. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 2.1: 삭제(DELETION) 명령 ** 한 단어를 끝까지 지우려면 dw 라고 치면 됩니다. ** 1. 키를 눌러서 확실하게 명령 모드로 빠져 나옵니다. 2. 아래에 ---> 로 표시된 줄 까지 커서를 옮깁니다. 3. 지워야할 단어의 처음으로 커서를 옮깁니다. 4. dw 라고 쳐서 그 단어를 지웁니다. 주의: 위에서 말한대로 하면 화면의 마지막 줄에 dw 라는 글자가 표시됩니다. 잘못 쳤다면, 를 눌러서 다시 시작하십시오. ---> 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. 키를 눌러서 확실하게 명령 모드로 빠져 나옵니다. 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. 를 누른 후 다음 에러로 갑니다 (수정되어야할 첫 글자로 갑니다.) 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$ 를 입력하여, 그 줄의 나머지가 두번째 줄처럼 되도록 수정한 후 를 누르십시오. ---> 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' 라고 친 후 를 치십시오. 이 단어를 찾으려고 합니다. 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 를 입력한 후 를 칩니다. 이 명령은 그 줄에서 처음으로 발견된 것만 바꾼다는 것에 주의하십시오. 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 를 입력한 후 를 쳐보십시오. 쉘 프롬프트 에서처럼 디렉토리의 목록이 출력될 것입니다. ls 가 동작하지 않는다면 :!dir 을 시도해 보십시오. 참고: 어떤 외부 명령도 이 방법으로 실행할 수 있습니다. 참고: 모든 : 명령은 를 쳐야 마무리 됩니다. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 5.2: 보다 자세한 파일 저장 ** 수정된 내용을 파일로 저장하려면, :w FILENAME 하십시오. ** 1. :!dir 또는 :!ls 를 입력하여 디렉토리의 리스트를 얻어옵니다. 위의 명령 후 를 쳐야한다는 것은 이미 알고 있을 것입니다. 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. ---> 로 표시된 줄을 복사한 후 를 눌러서 편집 모드에서 나오십시오. ---> 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를 누르고, 커서 아래에 있던 글자를 반복하고, 글을 끼워넣고, 를 눌러 명령 모드로 돌아와서, 커서를 오른쪽으로 옮기고 마지막으로 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. 를 눌러서 나가면, 바뀌지 않은 텍스트는 그대로 남게 됩니다. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 을 입력하면 를 눌러서 나가기 전까지 바꾸기 모드가 됩니다. 4. ":set xxx" 를 하면 "xxx" 옵션이 설정됩니다. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LESSON 7: 온라인 도움말 명령 ** 온라인 도움말 시스템 사용하기 ** 빔은 폭 넓은 온라인 도움말 시스템을 제공합니다. 도움말을 보려면, 다음 세가지 중 하나를 시도해보십시오: - 키를 누른다. (키가 있는 경우) - 키를 누른다. (키가 있는 경우) - :help 라고 입력한다. 도움말 창을 닫으려면 :q 라고 입력하십시오. ":help" 라는 명령에 인자를 주면 어떤 주제에 관한 도움말을 찾을 수 있습니다. 다음 명령을 내려 보십시오. ( 키를 누르는 것을 잊지 마십시오.) :help w :help c_ l-tasten er til hyre og flytter til hyre. j j-tasten ser ut som en pil som peker nedover. v 1. Flytt markren rundt p skjermen til du har ftt 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 for g til normalmodus. Skriv deretter kommandoen du nsket p nytt. Merk: Piltastene skal ogs virke. Men ved bruke hjkl vil du vre i stand til bevege markren mye raskere nr du er blitt vant til det. Helt sant! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.2: AVSLUTTE VIM !! MERK: Fr du utfrer noen av punktene nedenfor, les hele leksjonen!! 1. Trykk -tasten (for forsikre deg om at du er i normalmodus). 2. Skriv: :q! . Dette avslutter editoren og FORKASTER alle forandringer som du har gjort. 3. Nr du ser kommandolinjen i skallet, skriv kommandoen som startet denne innfringen. Den er: vimtutor 4. Hvis du er sikker p at du husker dette, utfr punktene 1 til 3 for avslutte og starte editoren p nytt. MERK: :q! forkaster alle forandringer som du gjorde. I lpet av noen f leksjoner vil du lre hvordan du lagrer forandringene til en fil. 5. Flytt markren ned til leksjon 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.3: REDIGERING AV TEKST -- SLETTING ** Trykk x for slette tegnet under markren. ** 1. Flytt markren til den frste linjen merket med --->. 2. For ordne feilene p linjen, flytt markren til den er opp tegnet som skal slettes. 3. Trykk tasten x for slette det unskede tegnet. 4. Repeter punkt 2 til 4 til setningen er lik den som er under. ---> Hessstennnn brrrsnudddde ii gaaata. ---> Hesten brsnudde i gata. 5. N som linjen er korrekt, g til leksjon 1.4. MERK: Nr du gr gjennom innfringen, ikke bare prv huske kommandoene, men bruk dem helt til de sitter. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.4: REDIGERING AV TEKST -- INNSETTING ** Trykk i for sette inn tekst. ** 1. Flytt markren til den frste linjen som er merket med --->. 2. For gjre den frste linjen lik den andre, flytt markren til den str 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 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. Nr du fler deg komfortabel med sette inn tekst, g til oppsummeringen nedenfor. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.5: REDIGERING AV TEKST -- LEGGE TIL ** Trykk A for legge til tekst. ** 1. Flytt markren til den frste linjen nedenfor merket --->. Det har ikke noe si hvor markren er plassert p den linjen. 2. Trykk A og skriv inn det som skal legges til. 3. Nr teksten er lagt til, trykk for returnere til normalmodusen. 4. Flytt markren til den andre linjen markert med ---> og repeter steg 2 og 3 for reparere denne setningen. ---> Det mangler noe tekst p Det mangler noe tekst p denne linjen. ---> Det mangler ogs litt tek Det mangler ogs litt tekst p denne linjen. 5. Nr du fler at du behersker legge til tekst, g til leksjon 1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.6: REDIGERE EN FIL ** Bruk :wq for lagre en fil og avslutte. ** !! MERK: Fr du utfrer noen av stegene nedenfor, les hele denne leksjonen!! 1. Avslutt denne innfringen som du gjorde i leksjon 1.2: :q! 2. Skriv denne kommandoen p kommandolinja: vim tutor vim er kommandoen for starte Vim-editoren, tutor er navnet p fila som du vil redigere. Bruk en fil som kan forandres. 3. Sett inn og slett tekst som du lrte i de foregende leksjonene. 4. Lagre filen med forandringene og avslutt Vim med: :wq 5. Start innfringen p nytt og flytt ned til oppsummeringen som flger. 6. Etter ha lest og forsttt stegene ovenfor: Sett i gang. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OPPSUMMERING AV LEKSJON 1 1. Markren beveges ved hjelp av piltastene eller hjkl-tastene. h (venstre) j (ned) k (opp) l (hyre) 2. For starte Vim fra skall-kommandolinjen, skriv: vim FILNAVN 3. For avslutte Vim, skriv: :q! for forkaste endringer. ELLER skriv: :wq for lagre forandringene. 4. For slette tegnet under markren, trykk: x 5. For sette inn eller legge til tekst, trykk: i skriv innsatt tekst sett inn fr markren A skriv tillagt tekst legg til p slutten av linjen MERK: Nr du trykker gr du til normalmodus eller du avbryter en unsket og delvis fullfrt kommando. N kan du g videre til leksjon 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 2.1: SLETTEKOMMANDOER ** Trykk dw for slette et ord. ** 1. Trykk for vre sikker p at du er i normalmodus. 2. Flytt markren til den frste linjen nedenfor merket --->. 3. Flytt markren til begynnelsen av ordet som skal slettes. 4. Trykk dw og ordet vil forsvinne. MERK: Bokstaven d vil komme til syne p den nederste linjen p skjermen nr du skriver den. Vim venter p at du skal skrive w . Hvis du ser et annet tegn enn d har du skrevet noe feil; trykk og start p nytt. ---> Det er agurk tre ord eple som ikke hrer pre hjemme i denne setningen. ---> Det er tre ord som ikke hrer hjemme i denne setningen. 5. Repeter punkt 3 og 4 til den frste 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 for vre sikker p at du er i normalmodus. 2. Flytt markren til linjen nedenfor merket --->. 3. Flytt markren til punktet der linjen skal kuttes (ETTER frste punktum). 4. Trykk d$ for slette alt til slutten av linjen. ---> Noen skrev slutten p linjen en gang for mye. linjen en gang for mye. 5. G til leksjon 2.3 for forst hva som skjer. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 2.3: OM OPERATORER OG BEVEGELSER Mange kommandoer som forandrer teksten er laget ut i fra en operator og en bevegelse. Formatet for en slettekommando med sletteoperatoren d er: d bevegelse Der: d - er sletteoperatoren. bevegelse - er hva operatoren vil opere p (listet nedenfor). En kort liste med bevegelser: w - til starten av det neste ordet, UNNTATT det frste tegnet. e - til slutten av det nvrende ordet, INKLUDERT det siste tegnet. $ - til slutten av linjen, INKLUDERT det siste tegnet. Ved skrive de vil alts alt fra markren til slutten av ordet bli slettet. MERK: Ved skrive kun bevegelsen i normalmodusen uten en operator vil markren flyttes som spesifisert. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKSJON 2.4: BRUK AV TELLER FOR EN BEVEGELSE ** Ved skrive et tall foran en bevegelse repeterer den s mange ganger. ** 1. Flytt markren til starten av linjen markert ---> nedenfor. 2. Skriv 2w for flytte markren to ord framover. 3. Skriv 3e for flytte markren framover til slutten av det tredje ordet. 4. Skriv 0 (null) for flytte til starten av linjen. 5. Repeter steg 2 og 3 med forskjellige tall. ---> Dette er en linje med noen ord som du kan bevege deg rundt p. 6. G videre til leksjon 2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 2.5: BRUK AV ANTALL FOR SLETTE MER ** Et tall sammen med en operator repeterer den s mange ganger. ** I kombinasjonen med sletteoperatoren og en bevegelse nevnt ovenfor setter du inn antall fr bevegelsen for slette mer: d nummer bevegelse 1. Flytt markren til det frste ordet med STORE BOKSTAVER p linjen markert med --->. 2. Skriv 2dw for slette de to ordene med store bokstaver. 3. Repeter steg 1 og 2 med forskjelling antall for slette de etterflgende ordene som har store bokstaver. ---> Denne ABC DE linjen FGHI JK LMN OP er n Q RS TUV litt mer lesbar. MERK: Et antall mellom operatoren d og bevegelsen virker p samme mte som bruke bevegelsen uten en operator. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 2.6: OPERERE P LINJER ** 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 vre lettere rett og slett trykke to d-er for slette en linje. 1. Flytt markren til den andre linjen i verset nedenfor. 2. Trykk dd slette linjen. 3. Flytt deretter til den fjerde linjen. 4. Trykk 2dd for slette to linjer. ---> 1) Roser er rde, ---> 2) Gjrme er gy, ---> 3) Fioler er bl, ---> 4) Jeg har en bil, ---> 5) Klokker viser tiden, ---> 6) Druer er ste ---> 7) Og du er likes. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 2.7: ANGRE-KOMMANDOEN ** Trykk u for angre siste kommando, U for fikse en hel linje. ** 1. Flytt markren til linjen nedenfor merket ---> og plasser den p den frste feilen. 2. Trykk x for slette det frste unskede tegnet. 3. Trykk s u for angre den siste utfrte kommandoen. 4. Deretter ordner du alle feilene p linjene ved bruke kommandoen x . 5. Trykk n en stor U for sette linjen tilbake til det den var originalt. 6. Trykk u noen ganger for angre U og foregende kommandoer. 7. Deretter trykker du CTRL-R (hold CTRL nede mens du trykker R) noen ganger for gjenopprette kommandoene (omgjre 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 markren fram til det neste ordet, trykk: dw 2. For slette fra markren til slutten av en linje, trykk: d$ 3. For slette en hel linje, trykk: dd 4. For repetere en bevegelse, sett et nummer foran: 2w 5. Formatet for en forandringskommando er: operator [nummer] bevegelse der: operator - hva som skal gjres, f.eks. d for slette [nummer] - et valgfritt antall for repetere bevegelsen bevegelse - hva kommandoen skal operere p, eksempelvis w (ord), $ (til slutten av linjen) og s videre. 6. For g til starten av en linje, bruk en null: 0 7. For angre tidligere endringer, skriv: u (liten u) For angre alle forandringer p en linje, skriv: U (stor U) For omgjre angringen, trykk: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 3.1: LIM INN-KOMMANDOEN ** Trykk p for lime inn tidligere slettet tekst etter markren ** 1. Flytt markren til den frste linjen med ---> nedenfor. 2. Trykk dd for slette linjen og lagre den i et Vim-register. 3. Flytt markren til c)-linjen, OVER posisjonen linjen skal settes inn. 4. Trykk p for legge linjen under markren. 5. Repeter punkt 2 til 4 helt til linjene er i riktig rekkeflge. ---> d) Kan du ogs lre? ---> b) Fioler er bl, ---> c) Intelligens m lres, ---> a) Roser er rde, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 3.2: ERSTATT-KOMMANDOEN ** Trykk rx for erstatte tegnet under markren med x. ** 1. Flytt markren til den frste linjen nedenfor merket --->. 2. Flytt markren s den str opp den frste feilen. 3. Trykk r og deretter tegnet som skal vre der. 4. Repeter punkt 2 og 3 til den frste linjen er lik den andre. ---> Da dfnne lynjxn ble zkrevet, var det nen som tjykket 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 br lre ved BRUKE, ikke pugge. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 3.3: FORANDRE-OPERATOREN ** For forandre til slutten av et ord, trykk ce . ** 1. Flytt markren til den frste linjen nedenfor som er merket --->. 2. Plasser markren p u i lubjwr. 3. Trykk ce og det korrekte ordet (i dette tilfellet, skriv injen). 4. Trykk og g til det neste tegnet som skal forandres. 5. Repeter punkt 3 og 4 helt til den frste setningen er lik den andre. ---> Denne lubjwr har noen wgh som m forkwp med forkzryas-kommandoen. ---> Denne linjen har noen ord som m forandres med forandre-kommandoen. Vr oppmerksom p at ce sletter ordet og gr inn i innsettingsmodus. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 3.4: FLERE FORANDRINGER VED BRUK AV c ** Forandringskommandoen blir brukt med de samme bevegelser som slett. ** 1. Forandringsoperatoren fungerer p samme mte som slett. Formatet er: c [nummer] bevegelse 2. Bevegelsene er de samme, som for eksempel w (ord) og $ (slutten av en linje). 3. G til den frste linjen nedenfor som er merket --->. 4. Flytt markren til den frste feilen. 5. Skriv c$ og skriv resten av linjen lik den andre og trykk . ---> Slutten p denne linjen trenger litt hjelp for gjre den lik den neste. ---> Slutten p denne linjen trenger bli rettet ved bruk av c$-kommandoen. MERK: Du kan bruke slettetasten for rette feil mens du skriver. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OPPSUMMERING AV LEKSJON 3 1. For legge tilbake tekst som nettopp er blitt slettet, trykk p . Dette limer inn den slettede teksten ETTER markren (hvis en linje ble slettet vil den bli limt inn p linjen under markren). 2. For erstatte et tegn under markren, trykk r og deretter tegnet som du vil ha der. 3. Forandringsoperatoren lar deg forandre fra markren til dit bevegelsen tar deg. Det vil si, skriv ce for forandre fra markren til slutten av ordet, c$ for forandre til slutten av linjen. 4. Formatet for forandre er: c [nummer] bevegelse N kan du g til neste leksjon. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 4.1: POSISJONERING AV MARKREN OG FILSTATUS ** Trykk CTRL-G for vise posisjonen i filen og filstatusen. Trykk G for g til en spesifikk linje i filen. ** Merk: Les hele leksjonen fr du utfrer noen av punktene! 1. Hold nede Ctrl-tasten og trykk g . Vi kaller dette CTRL-G. En melding vil komme til syne p bunnen av skjermen med filnavnet og posisjonen i filen. Husk linjenummeret for bruk i steg 3. Merk: Du kan se markrposisjonen i nederste hyre hjrne av skjermen. Dette skjer nr ruler-valget er satt (forklart i leksjon 6). 2. Trykk G for g til bunnen av filen. Skriv gg for g til begynnelsen av filen. 3. Skriv inn linjenummeret du var p og deretter G . Dette vil fre deg tilbake til linjen du var p da du frst trykket CTRL-G. 4. Utfr steg 1 til 3 hvis du fler deg sikker p prosedyren. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 4.2: SKEKOMMANDOEN ** Skriv / etterfulgt av en skestreng som du vil lete etter. ** 1. Trykk / nr du er i normalmodusen. Legg merke til at skrstreken og markren kommer til syne p bunnen av skjermen i likhet med :-kommandoene. 2. Skriv feeeiil og trykk . Dette er teksten du vil lete etter. 3. For finne neste forekomst av skestrengen, trykk n . For lete etter samme sketeksten i motsatt retning, trykk N . 4. For lete etter en tekst bakover i filen, bruk ? istedenfor / . 5. For g tilbake til der du kom fra, trykk CTRL-O (Hold Ctrl nede mens du trykker bokstaven o ). Repeter for g enda lengre tilbake. CTRL-I gr framover. ---> feeeiil er ikke mten skrive feil p, feeeiil er helt feil. Merk: Nr skingen nr slutten av filen, vil den fortsette fra starten unntatt hvis wrapscan-valget er resatt. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 4.3: FINN SAMSVARENDE PARENTESER ** Trykk % for finne en samsvarende ), ] eller } . ** 1. Plasser markren p en (, [ eller { p linjen nedenfor merket --->. 2. Trykk % . 3. Markren vil g til den samsvarende parentesen eller hakeparentesen. 4. Trykk % for flytte markren til den andre samsvarende parentesen. 5. Flytt markren til en annen (, ), [, ], { eller } og se hva % gjr. ---> Dette ( er en testlinje med (, [ ] og { } i den )). Merk: Dette er veldig nyttig til feilsking i programmer som har ubalansert antall parenteser! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 4.4: ERSTATT-KOMMANDOEN ** Skriv :s/gammel/ny/g for erstatte gammel med ny. ** 1. Flytt markren til linjen nedenfor som er merket med --->. 2. Skriv :s/deen/den/ . Legg merke til at denne kommandoen bare forandrer den frste forekomsten av deen p linjen. 3. Skriv :s/deen/den/g . Nr g-flagget legges til, betyr dette global erstatning p linjen og erstatter alle forekomster av deen p linjen. ---> deen som kan kaste deen tyngste steinen lengst er deen beste 4. For erstatte alle forekomster av en tekststreng mellom to linjer, skriv :#,#s/gammel/ny/g der #,# er linjenumrene p de to linjene for linjeomrdet erstatningen skal gjres. Skriv :%s/gammel/ny/g for erstatte tekst i hele filen. Skriv :%s/gammel/ny/gc for finne alle forekomster i hele filen, og deretter sprre om teksten skal erstattes eller ikke. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OPPSUMMERING AV LEKSJON 4 1. Ctrl-G viser nvrende posisjon i filen og filstatusen. G gr til slutten av filen. nummer G gr til det linjenummeret. gg gr til den frste linjen. 2. Skriv / etterfulgt av en sketekst for lete FRAMOVER etter teksten. Skriv ? etterfulgt av en sketekst for lete BAKOVER etter teksten. Etter et sk kan du trykke n for finne neste forekomst i den samme retningen eller N for lete i motsatt retning. CTRL-O tar deg tilbake til gamle posisjoner, CTRL-I til nyere posisjoner. 3. Skriv % nr markren str p en (, ), [, ], { eller } for finne den som samsvarer. 4. Erstatte gammel med frste 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 UTFRE EN EKSTERN KOMMANDO ** Skriv :! etterfulgt av en ekstern kommando for utfre denne. ** 1. Skriv den velkjente kommandoen : for plassere markren p bunnen av skjermen. Dette lar deg skrive en kommandolinjekommando. 2. N kan du skrive tegnet ! . Dette lar deg utfre en hvilken som helst ekstern kommando. 3. Som et eksempel, skriv ls etter utropstegnet og trykk . Du vil n f en liste over filene i katalogen, akkurat som om du hadde kjrt kommandoen direkte fra kommandolinjen i skallet. Eller bruk :!dir hvis ls ikke virker. MERK: Det er mulig kjre alle eksterne kommandoer p denne mten, ogs med parametere. MERK: Alle :-kommandoer m avsluttes med . Fra dette punktet er det ikke alltid vi nevner det. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 5.2: MER OM LAGRING AV FILER ** For lagre endringene gjort i en tekst, skriv :w FILNAVN. ** 1. Skriv :!dir eller :!ls for f en liste over filene i katalogen. Du vet allerede at du m trykke 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 innfringen) under navnet TEST . For sjekke dette, skriv :!dir eller :!ls igjen for se innholdet av katalogen. Merk: Hvis du n hadde avsluttet Vim og startet p nytt igjen med vim TEST, ville filen vrt en eksakt kopi av innfringen 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: VELGE TEKST SOM SKAL LAGRES ** For lagre en del av en fil, skriv v bevegelse :w FILNAVN ** 1. Flytt markren til denne linjen. 2. Trykk v og flytt markren til det femte elementet nedenfor. Legg merke til at teksten blir markert. 3. Trykk : (kolon). P bunnen av skjermen vil :'<,'> komme til syne. 4. Trykk w TEST , der TEST er et filnavn som ikke finnes enda. Kontroller at du ser :'<,'>w TEST fr du trykker Enter. 5. Vim vil skrive de valgte linjene til filen TEST. Bruk :!dir eller :!ls for se den. Ikke slett den enda! Vi vil bruke den i neste leksjon. MERK: Ved trykke v startes visuelt valg. Du kan flytte markren rundt for gjre det valgte omrdet strre eller mindre. Deretter kan du bruke en operator for gjre noe med teksten. For eksempel sletter d teksten. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 5.4: HENTING OG SAMMENSLING AV FILER ** For lese inn en annen fil inn i nvrende buffer, skriv :r FILNAVN ** 1. Plasser markren like over denne linjen. MERK: Etter ha utfrt steg 2 vil du se teksten fra leksjon 5.3. G deretter NED for se denne leksjonen igjen. 2. Hent TEST-filen ved bruke kommandoen :r TEST der TEST er navnet p filen du brukte. Filen du henter blir plassert nedenfor markrlinjen. 3. For sjekke at filen ble hentet, g tilbake og se at det er to kopier av leksjon 5.3, originalen og denne versjonen. MERK: Du kan ogs lese utdataene av en ekstern kommando. For eksempel, :r !ls leser utdataene av ls-kommandoen og legger dem nedenfor markren. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OPPSUMMERING AV LEKSJON 5 1. :!kommando utfrer en ekstern kommandio. Noen nyttige eksempler er: (MS-DOS) (Unix) :!dir :!ls - List filene i katalogen. :!del FILNAVN :!rm FILNAVN - Slett filen FILNAVN. 2. :w FILNAVN skriver den nvrende Vim-filen disken med navnet FILNAVN . 3. v bevegelse :w FILNAVN lagrer de visuelt valgte linjene til filen FILNAVN. 4. :r FILNAVN henter filen FILNAVN og legger den inn nedenfor markren. 5. :r !dir leser utdataene fra dir-kommandoen og legger dem nedenfor markrposisjonen. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 6.1: PNE LINJE-KOMMANDOEN ** Skriv o for pne opp for en ny linje etter markren og g til innsettingsmodus ** 1. Flytt markren til linjen nedenfor merket --->. 2. Skriv o (liten o) for pne opp en linje NEDENFOR markren og g inn i innsettingsmodus. 3. Skriv litt tekst og trykk for g ut av innsettingsmodusen. ---> Etter at o er skrevet blir markren plassert p den tomme linjen. 4. For pne en ny linje OVER markren, trykk rett og slett en stor O istedenfor en liten o . Prv dette p linjen nedenfor. ---> Lag ny linje over denne ved trykke O mens markren er p denne linjen. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 6.2: LEGG TIL-KOMMANDOEN ** Skriv a for legge til tekst ETTER markren. ** 1. Flytt markren til starten av linjen merket ---> nedenfor. 2. Trykk e til markren er p slutten av li. 3. Trykk a (liten a) for legge til tekst ETTER markren. 4. Fullfr ordet snn som p linjen nedenfor. Trykk for g ut av innsettingsmodusen. 5. Bruk e for g til det neste ufullstendige ordet og repeter steg 3 og 4. ---> Denne li lar deg ve p leg til tek p en linje. ---> Denne linjen lar deg ve p legge til tekst p en linje. Merk: a, i og A gr alle til den samme innsettingsmodusen, den eneste forskjellen er hvor tegnene blir satt inn. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 6.3: EN ANNEN MTE ERSTATTE P ** Skriv en stor R for erstatte mer enn ett tegn. ** 1. Flytt markren til den frste linjen nedenfor merket --->. Flytt markren til begynnelsen av den frste xxx-en. 2. Trykk R og skriv inn tallet som str nedenfor p den andre linjen s det erstatter xxx. 3. Trykk for g ut av erstatningsmodusen. Legg merke til at resten av linjen forblir uforandret. 4. Repeter stegene for erstatte den gjenvrende xxx. ---> Ved legge 123 til xxx fr vi xxx. ---> Ved legge 123 til 456 fr vi 579. MERK: Erstatningsmodus er lik insettingsmodus, men hvert tegn som skrives erstatter et eksisterende tegn. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 6.4: KOPIERE OG LIME INN TEKST ** Bruk y-operatoren for kopiere tekst og p for lime den inn ** 1. G til linjen merket ---> nedenfor og plasser markren etter a). 2. G inn i visuell modus med v og flytt markren til like fr frste. 3. Trykk y for kopiere (engelsk: yank) den uthevede teksten. 4. Flytt markren til slutten av den neste linjen: j$ 5. Trykk p for lime inn teksten. Trykk deretter: a andre . 6. Bruk visuell modus for velge valget., kopier det med y , g til slutten av den neste linjen med j$ og legg inn teksten der med p . ---> a) Dette er det frste valget. b) Merk: Du kan ogs bruke y som en operator; yw kopierer ett ord. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 6.5: SETT VALG ** Sett et valg s sk eller erstatning ignorerer store/sm bokstaver. ** 1. Let etter ignore ved skrive: /ignore Repeter flere ganger ved trykke n . 2. Sett ic-valget (Ignore Case) ved skrive: :set ic 3. Sk etter ignore igjen ved trykke n . Legg merke til at bde Ignore og IGNORE blir funnet. 4. Sett hlsearch- og incsearch-valgene: :set hls is 5. Skriv skekommandoen igjen og se hva som skjer: /ignore 6. For sl av ignorering av store/sm bokstaver, skriv: :set noic Merk: For fjerne uthevingen av treff, skriv: :nohlsearch Merk: Hvis du vil ignorere store/sm bokstaver for kun en skekommando, bruk \c i uttrykket: /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OPPSUMMERING AV LEKSJON 6 1. Trykk o for legge til en linje NEDENFOR markren og g inn i innsettingsmodus. Trykk O for pne en linje OVER markren. 2. Skriv a for sette inn tekst ETTER markren. Skriv A for sette inn tekst etter slutten av linjen. 3. Kommandoen e gr til slutten av et ord. 4. Operatoren y (yank) kopierer tekst, p (paste) limer den inn. 5. Ved trykke R gr du inn i erstatningsmodus helt til trykkes. 6. Skriv :set xxx for sette valget xxx. Noen valg er: ic ignorecase ignorer store/sm bokstaver under sk is incsearch vis delvise treff for en sketekst hls hlsearch uthev alle sketreff 7. Legg til no foran valget for sl det av: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 7.1: F HJELP ** Bruk det innebygde hjelpesystemet. ** Vim har et omfattende innebygget hjelpesystem. For starte det, prv en av disse mtene: - Trykk Hjelp-tasten (hvis du har en) - Trykk F1-tasten (hvis du har en) - Skriv :help Les teksten i hjelpevinduet for finne ut hvordan hjelpen virker. Skriv CTRL-W CTRL-W for hoppe fra et vindu til et annet Skriv :q for lukke hjelpevinduet. Du kan f hjelp for omtrent alle temaer om Vim ved skrive et parameter til :help-kommandoen. Prv disse (ikke glem trykke ): :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 7.2: LAG ET OPPSTARTSSKRIPT ** Sl p funksjoner i Vim ** Vim har mange flere funksjoner enn Vi, men flesteparten av dem er sltt av som standard. For begynne bruke flere funksjoner m du lage en vimrc-fil. 1. Start redigeringen av vimrc-filen. Dette avhenger av systemet ditt: :e ~/.vimrc for Unix :e $VIM/_vimrc for MS Windows 2. Les inn eksempelfilen for vimrc: :r $VIMRUNTIME/vimrc_example.vim 3. Lagre filen med: :w Neste gang du starter Vim vil den bruke syntaks-utheving. Du kan legge til alle dine foretrukne oppsett i denne vimrc-filen. For mer informasjon, skriv :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 7.3: FULLFRING ** Kommandolinjefullfring med CTRL-D og ** 1. Vr sikker p at Vim ikke er i Vi-kompatibel modus: :set nocp 2. Se hvilke filer som er i katalogen: :!ls eller :!dir 3. Skriv starten p en kommando: :e 4. Trykk CTRL-D og Vim vil vise en liste over kommandoer som starter med e. 5. Trykk og Vim vil fullfre kommandonavnet til :edit. 6. Legg til et mellomrom og starten p et eksisterende filnavn: :edit FIL 7. Trykk . Vim vil fullfre navnet (hvis det er unikt). MERK: Fullfring fungerer for mange kommandoer. Prv ved trykke CTRL-D og . Det er spesielt nyttig for bruk sammen med :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OPPSUMMERING AV LEKSJON 7 1. Skriv :help eller trykk eller for pne et hjelpevindu. 2. Skriv :help kommando for f hjelp om kommando . 3. Trykk CTRL-W CTRL-W for hoppe til et annet vindu. 4. Trykk :q for lukke hjelpevinduet. 5. Opprett et vimrc-oppstartsskript for lagre favorittvalgene dine. 6. Nr du skriver en :-kommando, trykk CTRL-D for se mulige fullfringer. Trykk for bruke en fullfring. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Her slutter innfringen 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 nr 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 frste boken som er fullt og helt dedisert 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 innfringen er skrevet av Michael C. Pierce og Robert K. Ware, Colorado School of Mines med ider av Charles Smith, Colorado State University. E-mail: bware@mines.colorado.edu . Modifisert for Vim av Bram Moolenaar. Oversatt av yvind A. Holm. E-mail: vimtutor _AT_ sunbase.org Id: tutor.no 406 2007-03-18 22:48:36Z sunny ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim: set ts=8 : vim-7.4.1689/runtime/tutor/tutor.nb.utf-8000066400000000000000000001051411267703067000200770ustar00rootroot00000000000000=============================================================================== = 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.7 = =============================================================================== 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. MERK: 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 for å flytte markøren 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 for å gå til normalmodus. Skriv deretter kommandoen du ønsket på nytt. 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. Helt sant! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.2: AVSLUTTE VIM !! MERK: Før du utfører noen av punktene nedenfor, les hele leksjonen!! 1. Trykk -tasten (for å forsikre deg om at du er i normalmodus). 2. Skriv: :q! . Dette avslutter editoren og FORKASTER alle forandringer som du har gjort. 3. Når du ser kommandolinjen i skallet, skriv kommandoen som startet denne innføringen. Den er: vimtutor 4. Hvis du er sikker på at du husker dette, utfør punktene 1 til 3 for å avslutte og starte editoren på nytt. MERK: :q! forkaster alle forandringer som du gjorde. I løpet av noen få leksjoner vil du lære hvordan du lagrer forandringene til en fil. 5. Flytt markøren ned til leksjon 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.3: REDIGERING AV TEKST -- SLETTING ** Trykk 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. ---> Hessstennnn brrråsnudddde ii gaaata. ---> Hesten bråsnudde i gata. 5. Nå som linjen er korrekt, gå til leksjon 1.4. MERK: 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 ** 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 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. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.5: REDIGERING AV TEKST -- LEGGE TIL ** Trykk A for å legge til tekst. ** 1. Flytt markøren til den første linjen nedenfor merket --->. Det har ikke noe å si hvor markøren er plassert på den linjen. 2. Trykk A og skriv inn det som skal legges til. 3. Når teksten er lagt til, trykk for å returnere til normalmodusen. 4. Flytt markøren til den andre linjen markert med ---> og repeter steg 2 og 3 for å reparere denne setningen. ---> Det mangler noe tekst p Det mangler noe tekst på denne linjen. ---> Det mangler også litt tek Det mangler også litt tekst på denne linjen. 5. Når du føler at du behersker å legge til tekst, gå til leksjon 1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.6: REDIGERE EN FIL ** Bruk :wq for å lagre en fil og avslutte. ** !! MERK: Før du utfører noen av stegene nedenfor, les hele denne leksjonen!! 1. Avslutt denne innføringen som du gjorde i leksjon 1.2: :q! 2. Skriv denne kommandoen på kommandolinja: vim tutor «vim» er kommandoen for å starte Vim-editoren, «tutor» er navnet på fila som du vil redigere. Bruk en fil som kan forandres. 3. Sett inn og slett tekst som du lærte i de foregående leksjonene. 4. Lagre filen med forandringene og avslutt Vim med: :wq 5. Start innføringen på nytt og flytt ned til oppsummeringen som følger. 6. Etter å ha lest og forstått stegene ovenfor: Sett i gang. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 3. For å avslutte Vim, skriv: :q! for å forkaste endringer. ELLER skriv: :wq for å lagre forandringene. 4. For å slette tegnet under markøren, trykk: x 5. For å sette inn eller legge til tekst, trykk: i skriv innsatt tekst sett inn før markøren A skriv tillagt tekst legg til på slutten av linjen MERK: Når du trykker 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 et ord. ** 1. Trykk 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: Bokstaven d vil komme til syne på den nederste linjen på skjermen når du skriver den. Vim venter på at du skal skrive w . Hvis du ser et annet tegn enn d har du skrevet noe feil; trykk 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 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. linjen en gang for mye. 5. Gå til leksjon 2.3 for å forstå hva som skjer. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 2.3: OM OPERATORER OG BEVEGELSER Mange kommandoer som forandrer teksten er laget ut i fra en operator og en bevegelse. Formatet for en slettekommando med sletteoperatoren d er: d bevegelse Der: d - er sletteoperatoren. bevegelse - er hva operatoren vil opere på (listet nedenfor). En kort liste med bevegelser: w - til starten av det neste ordet, UNNTATT det første tegnet. e - til slutten av det nåværende ordet, INKLUDERT det siste tegnet. $ - til slutten av linjen, INKLUDERT det siste tegnet. Ved å skrive de vil altså alt fra markøren til slutten av ordet bli slettet. MERK: Ved å skrive kun bevegelsen i normalmodusen uten en operator vil markøren flyttes som spesifisert. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKSJON 2.4: BRUK AV TELLER FOR EN BEVEGELSE ** Ved å skrive et tall foran en bevegelse repeterer den så mange ganger. ** 1. Flytt markøren til starten av linjen markert ---> nedenfor. 2. Skriv 2w for å flytte markøren to ord framover. 3. Skriv 3e for å flytte markøren framover til slutten av det tredje ordet. 4. Skriv 0 (null) for å flytte til starten av linjen. 5. Repeter steg 2 og 3 med forskjellige tall. ---> Dette er en linje med noen ord som du kan bevege deg rundt på. 6. Gå videre til leksjon 2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 2.5: BRUK AV ANTALL FOR Å SLETTE MER ** Et tall sammen med en operator repeterer den så mange ganger. ** I kombinasjonen med sletteoperatoren og en bevegelse nevnt ovenfor setter du inn antall før bevegelsen for å slette mer: d nummer bevegelse 1. Flytt markøren til det første ordet med STORE BOKSTAVER på linjen markert med --->. 2. Skriv 2dw for å slette de to ordene med store bokstaver. 3. Repeter steg 1 og 2 med forskjelling antall for å slette de etterfølgende ordene som har store bokstaver. ---> Denne ABC DE linjen FGHI JK LMN OP er nå Q RS TUV litt mer lesbar. MERK: Et antall mellom operatoren d og bevegelsen virker på samme måte som å bruke bevegelsen uten en operator. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 2.6: OPERERE PÅ LINJER ** 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 for å slette en linje. 1. Flytt markøren til den andre linjen i verset nedenfor. 2. Trykk dd å slette linjen. 3. Flytt deretter til den fjerde linjen. 4. Trykk 2dd for å slette to linjer. ---> 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.7: 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 kommandoen x . 5. Trykk nå en stor U for å sette linjen tilbake til det den var originalt. 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 fram til det neste ordet, trykk: dw 2. For å slette fra markøren til slutten av en linje, trykk: d$ 3. For å slette en hel linje, trykk: dd 4. For å repetere en bevegelse, sett et nummer foran: 2w 5. Formatet for en forandringskommando er: operator [nummer] bevegelse der: operator - hva som skal gjøres, f.eks. d for å slette [nummer] - et valgfritt antall for å repetere bevegelsen bevegelse - hva kommandoen skal operere på, eksempelvis w (ord), $ (til slutten av linjen) og så videre. 6. For å gå til starten av en linje, bruk en null: 0 7. For å angre tidligere endringer, 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 tidligere slettet tekst etter markøren ** 1. Flytt markøren til den første linjen med ---> nedenfor. 2. Trykk dd for å slette linjen og lagre den i et Vim-register. 3. Flytt markøren til c)-linjen, OVER posisjonen linjen skal settes inn. 4. Trykk p for å legge linjen under markøren. 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 rx for å erstatte tegnet under markøren med x. ** 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 være der. 4. Repeter punkt 2 og 3 til den første linjen er lik den andre. ---> Da dfnne lynjxn ble zkrevet, var det nøen som tjykket 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»-OPERATOREN ** For å forandre til slutten av et ord, trykk ce . ** 1. Flytt markøren til den første linjen nedenfor som er merket --->. 2. Plasser markøren på u i «lubjwr». 3. Trykk ce og det korrekte ordet (i dette tilfellet, skriv «injen»). 4. Trykk og gå til det neste 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 ce sletter ordet og går inn i innsettingsmodus. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 3.4: FLERE FORANDRINGER VED BRUK AV c ** Forandringskommandoen blir brukt med de samme bevegelser som «slett». ** 1. Forandringsoperatoren fungerer på samme måte som «slett». Formatet er: c [nummer] bevegelse 2. Bevegelsene er de samme, som for eksempel w (ord) og $ (slutten av en linje). 3. Gå til den første linjen nedenfor som er merket --->. 4. Flytt markøren til den første feilen. 5. Skriv c$ og skriv resten av linjen lik den andre og trykk . ---> 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. MERK: Du kan bruke slettetasten for å rette feil mens du skriver. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OPPSUMMERING AV LEKSJON 3 1. For å legge tilbake tekst som nettopp 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 du vil ha der. 3. Forandringsoperatoren lar deg forandre fra markøren til dit bevegelsen tar deg. Det vil si, skriv ce for å forandre fra markøren til slutten av ordet, c$ for å forandre til slutten av linjen. 4. Formatet for «forandre» er: c [nummer] bevegelse Nå kan du gå til neste leksjon. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 4.1: POSISJONERING AV MARKØREN OG FILSTATUS ** Trykk CTRL-G for å vise posisjonen i filen og filstatusen. Trykk 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 . Vi kaller dette CTRL-G. En melding vil komme til syne på bunnen av skjermen med filnavnet og posisjonen i filen. Husk linjenummeret for bruk i steg 3. Merk: Du kan se markørposisjonen i nederste høyre hjørne av skjermen. Dette skjer når «ruler»-valget er satt (forklart i leksjon 6). 2. Trykk G for å gå til bunnen av filen. Skriv gg for å gå til begynnelsen av filen. 3. Skriv inn linjenummeret du var på og deretter G . Dette vil føre deg tilbake til linjen du var på da du først trykket CTRL-G. 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 . 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 N . 4. For å lete etter en tekst bakover i filen, bruk ? istedenfor / . 5. For å gå tilbake til der du kom fra, trykk CTRL-O (Hold Ctrl nede mens du trykker bokstaven o ). Repeter for å gå enda lengre tilbake. CTRL-I går framover. ---> «feeeiil» er ikke måten å skrive «feil» på, feeeiil er helt feil. Merk: Når søkingen når slutten av filen, vil den fortsette fra starten unntatt hvis «wrapscan»-valget er resatt. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 vil gå til den samsvarende parentesen eller hakeparentesen. 4. Trykk % for å flytte markøren til den andre samsvarende parentesen. 5. Flytt markøren til en annen (, ), [, ], { eller } og se hva % gjør. ---> Dette ( er en testlinje med (, [ ] og { } i den )). Merk: Dette er veldig nyttig til feilsøking i programmer som har ubalansert antall parenteser! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 4.4: ERSTATT-KOMMANDOEN ** Skriv :s/gammel/ny/g for å erstatte «gammel» med «ny». ** 1. Flytt markøren til linjen nedenfor som er merket med --->. 2. Skriv :s/deen/den/ . Legg merke til at denne kommandoen bare forandrer den første forekomsten av «deen» på linjen. 3. Skriv :s/deen/den/g . Når g-flagget legges til, betyr dette global erstatning på linjen og erstatter alle forekomster av «deen» på linjen. ---> deen som kan kaste deen tyngste steinen lengst er deen beste 4. For å erstatte alle forekomster av en tekststreng mellom to linjer, skriv :#,#s/gammel/ny/g der #,# er linjenumrene på de to linjene for linjeområdet erstatningen skal gjøres. Skriv :%s/gammel/ny/g for å erstatte tekst i hele filen. Skriv :%s/gammel/ny/gc for å finne alle forekomster i hele filen, og deretter spørre om teksten skal erstattes eller ikke. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OPPSUMMERING AV LEKSJON 4 1. Ctrl-G viser nåværende posisjon i filen og filstatusen. G går til slutten av filen. nummer G går til det linjenummeret. gg går til den første 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 N for å lete i motsatt retning. CTRL-O tar deg tilbake til gamle posisjoner, CTRL-I til nyere posisjoner. 3. Skriv % når markøren står på en (, ), [, ], { eller } for å finne den som samsvarer. 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 kommandolinjekommando. 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 . Du vil nå få en liste over filene i katalogen, akkurat som om du hadde kjørt kommandoen direkte fra kommandolinjen i skallet. Eller bruk :!dir hvis «ls» ikke virker. MERK: Det er mulig å kjøre alle eksterne kommandoer på denne måten, også med parametere. MERK: Alle «:»-kommandoer må avsluttes med . Fra dette punktet er det ikke alltid vi nevner det. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 5.2: MER OM LAGRING AV FILER ** For å lagre endringene gjort i en tekst, skriv :w FILNAVN. ** 1. Skriv :!dir eller :!ls for å få en liste over filene i katalogen. Du vet allerede at du må trykke 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 eller :!ls igjen for å se innholdet av katalogen. Merk: Hvis du nå hadde avsluttet Vim og startet på nytt igjen med «vim 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: VELGE TEKST SOM SKAL LAGRES ** For å lagre en del av en fil, skriv v bevegelse :w FILNAVN ** 1. Flytt markøren til denne linjen. 2. Trykk v og flytt markøren til det femte elementet nedenfor. Legg merke til at teksten blir markert. 3. Trykk : (kolon). På bunnen av skjermen vil :'<,'> komme til syne. 4. Trykk w TEST , der TEST er et filnavn som ikke finnes enda. Kontroller at du ser :'<,'>w TEST før du trykker Enter. 5. Vim vil skrive de valgte linjene til filen TEST. Bruk :!dir eller :!ls for å se den. Ikke slett den enda! Vi vil bruke den i neste leksjon. MERK: Ved å trykke v startes visuelt valg. Du kan flytte markøren rundt for å gjøre det valgte området større eller mindre. Deretter kan du bruke en operator for å gjøre noe med teksten. For eksempel sletter d teksten. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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. Plasser markøren like over denne linjen. MERK: Etter å ha utført steg 2 vil du se teksten fra leksjon 5.3. Gå deretter NED for å se denne leksjonen igjen. 2. Hent TEST-filen ved å bruke kommandoen :r TEST der TEST er navnet på filen du brukte. Filen du henter blir plassert nedenfor markørlinjen. 3. For å sjekke at filen ble hentet, gå tilbake og se at det er to kopier av leksjon 5.3, originalen og denne versjonen. MERK: Du kan også lese utdataene av en ekstern kommando. For eksempel, :r !ls leser utdataene av ls-kommandoen og legger dem nedenfor markøren. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 FILNAVN :!rm FILNAVN - Slett filen FILNAVN. 2. :w FILNAVN skriver den nåværende Vim-filen disken med navnet FILNAVN . 3. v bevegelse :w FILNAVN lagrer de visuelt valgte linjene til filen FILNAVN. 4. :r FILNAVN henter filen FILNAVN og legger den inn nedenfor markøren. 5. :r !dir leser utdataene fra «dir»-kommandoen og legger dem nedenfor markørposisjonen. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 6.1: «ÅPNE LINJE»-KOMMANDOEN ** Skriv o for å «åpne opp» for en ny linje etter markøren og gå til innsettingsmodus ** 1. Flytt markøren til linjen nedenfor merket --->. 2. Skriv o (liten o) for å åpne opp en linje NEDENFOR markøren og gå inn i innsettingsmodus. 3. Skriv litt tekst og trykk for å gå ut av innsettingsmodusen. ---> Etter at o er skrevet blir markøren plassert på den tomme linjen. 4. For å åpne en ny linje OVER markøren, trykk rett og slett en stor O istedenfor en liten o . Prøv dette på linjen nedenfor. ---> Lag ny linje over denne ved å trykke O mens markøren er på denne linjen. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 6.2: «LEGG TIL»-KOMMANDOEN ** Skriv a for å legge til tekst ETTER markøren. ** 1. Flytt markøren til starten av linjen merket ---> nedenfor. 2. Trykk e til markøren er på slutten av «li». 3. Trykk a (liten a) for å legge til tekst ETTER markøren. 4. Fullfør ordet sånn som på linjen nedenfor. Trykk for å gå ut av innsettingsmodusen. 5. Bruk e for å gå til det neste ufullstendige ordet og repeter steg 3 og 4. ---> Denne li lar deg øve på å leg til tek på en linje. ---> Denne linjen lar deg øve på å legge til tekst på en linje. Merk: a, i og A går alle til den samme innsettingsmodusen, den eneste forskjellen er hvor tegnene blir satt inn. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 6.3: EN ANNEN MÅTE Å ERSTATTE PÅ ** Skriv en stor R for å erstatte mer enn ett tegn. ** 1. Flytt markøren til den første linjen nedenfor merket --->. Flytt markøren til begynnelsen av den første «xxx»-en. 2. Trykk R og skriv inn tallet som står nedenfor på den andre linjen så det erstatter xxx. 3. Trykk for å gå ut av erstatningsmodusen. Legg merke til at resten av linjen forblir uforandret. 4. Repeter stegene for å erstatte den gjenværende xxx. ---> Ved å legge 123 til xxx får vi xxx. ---> Ved å legge 123 til 456 får vi 579. MERK: Erstatningsmodus er lik insettingsmodus, men hvert tegn som skrives erstatter et eksisterende tegn. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 6.4: KOPIERE OG LIME INN TEKST ** Bruk y-operatoren for å kopiere tekst og p for å lime den inn ** 1. Gå til linjen merket ---> nedenfor og plasser markøren etter «a)». 2. Gå inn i visuell modus med v og flytt markøren til like før «første». 3. Trykk y for å kopiere (engelsk: «yank») den uthevede teksten. 4. Flytt markøren til slutten av den neste linjen: j$ 5. Trykk p for å lime inn teksten. Trykk deretter: a andre . 6. Bruk visuell modus for å velge « valget.», kopier det med y , gå til slutten av den neste linjen med j$ og legg inn teksten der med p . ---> a) Dette er det første valget. b) Merk: Du kan også bruke y som en operator; yw kopierer ett ord. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 6.5: SETT VALG ** Sett et valg så søk eller erstatning ignorerer store/små bokstaver. ** 1. Let etter «ignore» ved å skrive: /ignore Repeter flere ganger ved å trykke n . 2. Sett «ic»-valget (Ignore Case) ved å skrive: :set ic 3. Søk etter «ignore» igjen ved å trykke n . Legg merke til at både «Ignore» og «IGNORE» blir funnet. 4. Sett «hlsearch»- og «incsearch»-valgene: :set hls is 5. Skriv søkekommandoen igjen og se hva som skjer: /ignore 6. For å slå av ignorering av store/små bokstaver, skriv: :set noic Merk: For å fjerne uthevingen av treff, skriv: :nohlsearch Merk: Hvis du vil ignorere store/små bokstaver for kun en søkekommando, bruk \c i uttrykket: /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OPPSUMMERING AV LEKSJON 6 1. Trykk o for å legge til en linje NEDENFOR markøren og gå inn i innsettingsmodus. Trykk O for å åpne en linje OVER markøren. 2. Skriv a for å sette inn tekst ETTER markøren. Skriv A for å sette inn tekst etter slutten av linjen. 3. Kommandoen e går til slutten av et ord. 4. Operatoren y («yank») kopierer tekst, p («paste») limer den inn. 5. Ved å trykke R går du inn i erstatningsmodus helt til trykkes. 6. Skriv «:set xxx» for å sette valget «xxx». Noen valg er: «ic» «ignorecase» ignorer store/små bokstaver under søk «is» «incsearch» vis delvise treff for en søketekst «hls» «hlsearch» uthev alle søketreff 7. Legg til «no» foran valget for å slå det av: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 7.1: FÅ HJELP ** Bruk det innebygde hjelpesystemet. ** Vim har et omfattende innebygget hjelpesystem. For å starte det, prøv en av disse måtene: - Trykk Hjelp-tasten (hvis du har en) - Trykk F1-tasten (hvis du har en) - Skriv :help Les teksten i hjelpevinduet for å finne ut hvordan hjelpen virker. Skriv CTRL-W CTRL-W for å hoppe fra et vindu til et annet Skriv :q for å lukke hjelpevinduet. Du kan få hjelp for omtrent alle temaer om Vim ved å skrive et parameter til «:help»-kommandoen. Prøv disse (ikke glem å trykke ): :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 7.2: 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 flere funksjoner må du lage en «vimrc»-fil. 1. Start redigeringen av «vimrc»-filen. Dette avhenger av systemet ditt: :e ~/.vimrc for Unix :e $VIM/_vimrc for MS Windows 2. Les inn eksempelfilen for «vimrc»: :r $VIMRUNTIME/vimrc_example.vim 3. Lagre filen med: :w Neste gang du starter Vim vil den bruke syntaks-utheving. Du kan legge til alle dine foretrukne oppsett i denne «vimrc»-filen. For mer informasjon, skriv :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 7.3: FULLFØRING ** Kommandolinjefullføring med CTRL-D og ** 1. Vær sikker på at Vim ikke er i Vi-kompatibel modus: :set nocp 2. Se hvilke filer som er i katalogen: :!ls eller :!dir 3. Skriv starten på en kommando: :e 4. Trykk CTRL-D og Vim vil vise en liste over kommandoer som starter med «e». 5. Trykk og Vim vil fullføre kommandonavnet til «:edit». 6. Legg til et mellomrom og starten på et eksisterende filnavn: :edit FIL 7. Trykk . Vim vil fullføre navnet (hvis det er unikt). MERK: Fullføring fungerer for mange kommandoer. Prøv ved å trykke CTRL-D og . Det er spesielt nyttig for bruk sammen med :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OPPSUMMERING AV LEKSJON 7 1. Skriv :help eller trykk eller for å åpne et hjelpevindu. 2. Skriv :help kommando for å få hjelp om kommando . 3. Trykk CTRL-W CTRL-W for å hoppe til et annet vindu. 4. Trykk :q for å lukke hjelpevinduet. 5. Opprett et vimrc-oppstartsskript for å lagre favorittvalgene dine. 6. Når du skriver en «:»-kommando, trykk CTRL-D for å se mulige fullføringer. Trykk for å bruke en fullføring. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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ørste boken som er fullt og helt dedisert 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. E-mail: bware@mines.colorado.edu . Modifisert for Vim av Bram Moolenaar. Oversatt av Øyvind A. Holm. E-mail: vimtutor _AT_ sunbase.org Id: tutor.no 406 2007-03-18 22:48:36Z sunny ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim: set ts=8 : vim-7.4.1689/runtime/tutor/tutor.nl000066400000000000000000001107041267703067000171500ustar00rootroot00000000000000 ========================================================================== = W e l k o m b i j d e V I M l e s s e n - Versie 1.7 = ========================================================================== Vim is een krachtige editor met veel commando's, te veel om uit te leggen in lessen zoals deze. Deze lessen zijn bedoeld om voldoende commando's te behandelen om je in staat te stellen met Vim te werken als een editor voor algemeen gebruik. Deze lessen zullen 25 tot 30 minuten in beslag nemen, afhankelijk van de tijd die wordt besteed aan het uitproberen van de commando's. LET OP: Door de commando's in deze lessen verandert de tekst. Maak een kopie van dit bestand om mee te oefenen (als je "vimtutor" uitvoerde, is dit al een kopie). Deze lessen zijn bedoeld om al doende te leren. Dat betekent dat je de commando's moet uitvoeren om ze goed te leren kennen. Als je de tekst alleen maar doorleest, zal je de commando's niet leren! Zorg ervoor dat de toets NIET is ingedrukt en druk vaak genoeg op de j-toets om de cursor zo te bewegen dat les 1.1 volledig op het scherm staat. LET OP: In deze lessen worden omwille van de duidelijkheid vaak spaties gebruikt binnen een commando (bv. "40 G" of "operator [getal] beweging"). Tik deze spaties echter NIET. Ze verstoren de werking. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 1.1: VERPLAATS DE CURSOR ** De cursor wordt verplaatst met de toetsen h, j, k, l zoals aangegeven. ** ^ k Hint: De h is de meest linkse en beweegt naar links. < h l > De l is de meest rechtse en beweegt naar rechts. j De j lijkt op een pijl naar beneden. v 1. Beweeg de cursor over het scherm om er vertrouwd mee te raken. 2. Druk de omlaag-toets (j) tot hij repeteert. Nu weet je hoe je de volgende les bereikt. 3. Gebruik de omlaag-toets om naar les 1.2 te gaan. OPMERKING: Als je twijfelt aan wat je tikte, druk om in de opdracht- modus te komen. Tik daarna het commando dat bedoeld wordt. OPMERKING: Pijltjes-toetsen werken ook. Met de hjkl-toetsen kan je sneller rondbewegen, als je er eenmaal aan gewend bent. Echt waar! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 1.2: VIM AFSLUITEN !! LET OP: Lees deze les goed door voordat je iets uitvoert!! 1. Druk de toets (om zeker in de opdrachtmodus te zitten). 2. Tik :q! Hiermee wordt de editor afgesloten. Alle veranderingen gaan VERLOREN. 3. Nu zie je de shell-prompt. Tik het commando waarmee je deze lessen hebt opgeroepen. Dat is normaal gesproken: vimtutor 4. Als je deze stappen goed hebt doorgelezen, voer dan de stappen 1 tot 3 uit om de editor te verlaten en weer op te starten. LET OP: :q! verwerpt alle veranderingen die je aanbracht. Een paar lessen verder zal je leren hoe veranderingen worden opgeslagen in een bestand. 5. Beweeg de cursor omlaag naar les 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 1.3: TEKST BEWERKEN - WISSEN ** Tik x om het teken onder de cursor te wissen. ** 1. Ga met de cursor naar de regel verderop met --->. 2. Zet de cursor op een teken dat moet worden gewist om een fout te herstellen. 3. Tik x om het ongewenste teken te wissen. 4. Herhaal deze stappen tot de regel goed is. ---> Vi kkent eenn opdracccchtmodus en een invooegmmmmodus. 5. Nu de regel gecorrigeerd is kan je naar les 1.4 gaan. LET OP: Probeer de lessen niet uit je hoofd te leren. Leer al doende. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 1.4: TEKST BEWERKEN - INVOEGEN ** Tik i ('insert') om tekst in te voegen. ** 1. Ga met de cursor naar de eerste regel verderop met --->. 2. Maak de eerste regel gelijk aan de tweede. Zet daarvoor de cursor op de plaats waar tekst moet worden ingevoegd. 3. Tik i en daarna de nodige aanvullingen. 4. Tik na elke herstelde fout om terug te keren in de opdrachtmodus. Herhaal de stappen 2 tot 4 om de zin te verbeteren. ---> Aan regel ontekt wat . ---> Aan deze regel ontbreekt wat tekst. 5. Ga naar les 1.5 als je gewend bent aan het invoegen van tekst. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 1.5: TEKST BEWERKEN - TOEVOEGEN ** Tik A ('append') om tekst toe te voegen. ** 1. Ga met de cursor naar de eerste regel verderop met --->. Het maakt niet uit waar de cursor in deze regel staat. 2. Tik hoofdletter A en tik de nodige aanvullingen. 3. Tik nadat de tekst is aangevuld. Zo keer je terug in de opdrachtmodus. 4. Ga naar de tweede regel verderop met ---> en herhaal stap 2 en 3 om deze zin te corrigeren. ---> Er ontbreekt wat tekst aan de Er ontbreekt wat tekst aan deze regel. ---> Hier ontbreekt ook w Hier ontbreekt ook wat tekst. 5. Ga naar les 1.6 als je vertrouwd bent geraakt aan het toevoegen van tekst. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 1.6: EEN BESTAND EDITTEN ** Gebruik :wq om een bestand op te slaan en de editor te verlaten. ** !! LET OP: Lees deze les helemaal door voordat je een van de volgende stappen uitvoert!! 1. Verlaat deze les zoals je in les 1.2 deed: :q! Of gebruik een andere terminal als je daar de beschikking over hebt. Doe daar het volgende. 2. Tik het volgende commando na de shell-prompt: vim les 'vim' (vaak ook 'vi') is het commando om de Vim-editor te starten, 'les' is de naam van het bestand, dat je gaat bewerken. Kies een andere naam als er al een bestand 'les' bestaat, dat niet veranderd mag worden. 3. Voeg naar eigen keus tekst toe, zoals je geleerd hebt in eerdere lessen. 4. Sla het bestand met de wijzigingen op en verlaat Vim met :wq 5. Herstart vimtutor als je deze bij stap 1 hebt verlaten en ga verder met de volgende samenvatting. 6. Voer deze stappen uit nadat je ze hebt gelezen en begrepen. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SAMENVATTING Les 1 1. De cursor wordt bewogen met de pijltjestoetsen of de hjkl-toetsen. h (links) j (omlaag) k (omhoog) l (rechts) 2. Start Vim van de shell-prompt. Tik: vim BESTANDSNAAM 3. Sluit Vim af met :q! om de veranderingen weg te gooien. OF tik :wq om de veranderingen te bewaren. 4. Wis het teken onder de cursor met: x 5. Invoegen of toevoegen van tekst, tik: i en daarna de in te voegen tekst voeg in vanaf de cursor A en daarna de toe te voegen tekst voeg toe achter de regel OPMERKING: Met kom je terug in opdrachtmodus en wordt een ongewenst of gedeeltelijk uitgevoerd commando afgebroken. Ga nu verder met les 2.1. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 2.1: WIS-COMMANDO'S ** Tik dw ('delete word') om een woord te wissen. ** 1. Druk op om zeker in de opdrachtmodus te zijn. 2. Ga naar de regel hieronder, die met ---> begint. 3. Ga met de cursor naar het begin van een woord dat moet worden gewist. 4. Met het tikken van dw verdwijnt het woord. OPMERKING: De letter d verschijnt op de laatste regel van het scherm zodra je hem tikt. Vim is aan het wachten tot je de w tikt. Als je een ander teken dan d ziet, heb je iets verkeerds getikt. Druk op en begin opnieuw. NOG EEN OPMERKING: Dit werkt alleen als de optie 'showcmd' is ingeschakeld. Dat gebeurt met :set showcmd ---> Er zijn een het paar ggg woorden, die niet in deze len zin thuishoren. 5. Herhaal de stappen 3 en 4 tot de zin goed is en ga naar les 2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 2.2: MEER WIS-COMMANDO'S ** Tik d$ om te wissen tot het einde van de regel. ** 1. Druk op om zeker in de opdrachtmodus te zijn. 2. Ga naar de regel hieronder, die met ---> begint. 3. Ga met de cursor naar het einde van de correcte regel (NA de eerste . ). 4. Tik d$ om te wissen tot het einde van de regel. ---> Iemand heeft het einde van deze regel dubbel getikt. dubbel getikt. 5. Ga naar les 2.3 voor uitleg. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 2.3: OVER OPERATOREN EN BEWEGINGEN Veel commando's die de tekst veranderen, bestaan uit een operator en een beweging. De samenstelling van een wis-commando met de operator d is: d beweging Daarbij is: d - de wis-operator beweging - het bereik waarop de operator werkt (zie het lijstje hieronder) Een korte lijst van bewegingen vanaf de cursor: w - tot het begin van het volgende woord, ZONDER het eerste teken daarvan. e - tot het einde van het huidige woord, INCLUSIEF het laatste teken. $ - tot het einde van de regel, INCLUSIEF het laatste teken. Het tikken van de wist tekst vanaf de cursor tot het eind van het woord. OPMERKING: Het intikken van alleen maar de beweging, zonder een operator, in de opdrachtmodus beweegt de cursor (respectievelijk naar het volgende woord, naar het eind van het huidige woord en naar het eind van de regel). ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 2.4: GEBRUIK VAN EEN TELLER BIJ EEN BEWEGING ** Een getal voor een beweging herhaalt het zoveel keer. ** 1. Ga naar de regel hieronder, die met ---> begint. 2. Tik 2w zodat de cursor twee woorden vooruit gaat. 3. Tik 3e zodat de cursor naar het einde van het derde woord gaat. 4. Tik 0 (nul) om naar het begin van de regel te gaan. 5. Herhaal de stappen 2 en 3 met andere getallen. ---> Dit is een regel met woorden waarin je heen en weer kan bewegen. 6. Ga verder met les 2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 2.5: GEBRUIK EEN TELLER OM MEER TE WISSEN ** Een getal met een operator zorgt dat deze zoveel keer wordt herhaald. ** Bij de combinatie van wis-operator en beweging kan je voor de beweging een teller zetten om meer te wissen: d [teller] beweging 1. Ga naar het eerste woord in HOOFDLETTERS in de regel na --->. 2. Met d2w worden twee woorden (in dit voorbeeld in hoofdletters) gewist. 3. Herhaal de stappen 1 en 2 met verschillende tellers om de verschillende woorden in hoofdletters met n commando te wissen. ---> deze ABC DE regel FGHI JK LMN OP is QZ RS ontdaan van rommel. OPMERKING: De teller kan ook aan het begin staan: d2w en 2dw werken allebei. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 2.6: BEWERKING VAN HELE REGELS ** Tik dd om een hele regel te wissen. ** Omdat het wissen van een hele regel vaak voorkomt, besloten de ontwerpers van Vi dat met het tikken van dd simpelweg een hele regel gewist wordt. 1. Ga met de cursor naar de tweede regel van de zinnetjes hieronder. 2. Tik dd om de regel te wissen. 3. Ga nu naar de vierde regel. 4. Tik 2dd om twee regels te wissen. ---> 1) Rozen zijn rood. ---> 2) Modder is leuk. ---> 3) Viooltjes zijn blauw. ---> 4) Ik heb een auto. ---> 5) De klok slaat de tijd. ---> 6) Suiker is zoet. ---> 7) En dat ben jij ook. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 2.7: HET COMMANDO HERSTEL ** u maakt het laatste commando ongedaan, U herstelt een hele regel. ** 1. Ga met de cursor naar de regel hieronder met ---> en zet hem op de eerste fout. 2. Tik x om het eerste ongewenste teken te wissen. 3. Tik nu u en maak daarmee het vorige commando ongedaan. 4. Herstel nu alle fouten in de regel met het x commando. 5. Tik een hoofdletter U om de regel in z'n oorspronkelijke staat terug te brengen. 6. Tik nu een paar keer u en herstel daarmee de U en eerdere commando's. 7. Tik nu een paar keer CTRL-R (Ctrl-toets ingedrukt houden en R tikken) en voer daarmee de commando's opnieuw uit: 'redo' oftewel 'undo de undo's'. ---> Heerstel de fouten inn deeze regel en brenng ze weer terugg met undo. 8. Dit zijn heel nuttige commando's. Ga verder met samenvatting van les 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SAMENVATTING Les 2 1. Wis van de cursor tot het volgende woord met dw 2. Wis van de cursor tot het eind van de regel met d$ 3. Wis de hele regel met dd 4. Herhaal een beweging door er een getal voor te zetten: 2w 5. De opbouw van een wijzigingscommando is: operator [getal] beweging daarbij is: operator - wat er moet gebeuren, bijvoorbeeld d om te wissen [getal] - een (niet-verplichte) teller om 'beweging' te herhalen beweging - een beweging door de te wijzigen tekst zoals w (woord) of $ (tot het einde van de regel) enz. 6. Ga naar het begin van de regel met nul: 0 7. Undo de voorgaande actie met u (kleine letter) Undo alle veranderingen in een regel met U (hoofdletter) Undo de undo's met CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 3.1: HET COMMANDO PLAK ** Tik p ('put') en plak daarmee zojuist gewiste tekst na te cursor. ** 1. Ga met de cursor naar de eerste regel met ---> hierna. 2. Wis de regel met dd en bewaar hem zodoende in een Vim-register. 3. Ga naar de c-regel, waar de gewiste regel ONDER moet komen. 4. Tik p om de regel terug te zetten onder de regel met de cursor. 5. Herhaal de stappen 2 tot 4 om de regels in de goede volgorde te zetten. ---> d) Krijg je het ook onder de knie? ---> b) Viooltjes zijn blauw, ---> c) Begrip is te leren, ---> a) Rozen zijn rood, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 3.2: HET COMMANDO VERVANG ** Tik rx ('replace') om het teken onder de cursor te vervangen door x. ** 1. Ga naar de eerste regel hieronder met --->. 2. Zet de cursor op de eerste fout. 3. Tik r en dan het teken dat er hoort te staan. 4. Herhaal de stappen 2 en 3 tot de eerste regel gelijk is aan de tweede. ---> Bij het tokken van dezf hegel heeft iemamd verklerde letters getikt. ---> Bij het tikken van deze regel heeft iemand verkeerde letters getikt. 5. Ga nu naar les 3.3. LET OP: Door het te doen, leer je beter dan door het uit je hoofd te leren. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 3.3: HET COMMANDO VERANDER ** Tik ce om te veranderen tot het einde van een woord. ** 1. Ga met de cursor naar de eerste regel hieronder met --->. 2. Zet de cursor op de u van ruch. 3. Tik ce en de juiste letters (in dit geval "egel"). 4. Druk en ga naar het volgende teken dat moet worden veranderd. 5. Herhaal de stappen 3 en 4 tot de eerste regel gelijk is aan de tweede. ---> In deze ruch staan een paar weedrim die veranderd moud worden. ---> In deze regel staan een paar woorden die veranderd moeten worden. LET OP: Met ce wordt (het laatste deel van) een woord gewist en kom je in de invoegmodus. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 3.4: MEER VERANDERINGEN MET c 1. Het commando verander ('change') werkt op dezelfde manier als wis. De opbouw is: c [teller] beweging 2. De bewegingen zijn hetzelfde, zoals w (woord) en $ (einde regel). 3. Ga naar de eerste regel hieronder met --->. 4. Zet de cursor op de eerste fout. 5. Tik c$ en tik de rest van de regel zodat hij gelijk wordt aan de tweede en sluit af met . ---> Het einde van deze regel moet precies zo worden als de tweede regel. ---> Het einde van deze regel moet gecorrigeerd worden met het commando c$. OPMERKING: Je kan de toets gebruiken om tikfouten te herstellen. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SAMENVATTING Les 3 1. Tik p om tekst terug te plakken, die zojuist is gewist. Dit zet de gewiste tekst ACHTER de cursor (als een hele regel is gewist komt deze op de regel ONDER de cursor. 2. Het teken waarop de cursor staat wordt vervangen met r gevolgd door het teken dat je daar wilt hebben. 3. Het commando 'verander' stelt je in staat om tekst te veranderen vanaf de cursor tot waar de 'beweging' je brengt. Dat wil zeggen: tik ce om te veranderen vanaf de cursor tot het einde van het woord, c$ om te veranderen tot het einde van de regel. 4. De opbouw van het commando verander is: c [teller] beweging Ga nu naar de volgende les. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 4.1: PLAATS VAN DE CURSOR EN STATUS VAN HET BESTAND ** CTRL-G laat zien waar (regelnummer) je je bevindt en wat de status van het bestand is. Met [nummer] G ga je naar een bepaalde regel. ** LET OP: Lees de hele les voordat je een stap uitvoert!! 1. Hou de Ctrl-toets ingedrukt en tik g . Dit noemen we CTRL-G. Onderaan de pagina verschijnt een boodschap met de bestandsnaam en de positie in het bestand. Onthou het regelnummer voor stap 3. OPMERKING: Als de optie 'ruler' aan staat, wordt de positie van de cursor (regelnummer, kolom) steeds in de rechter-onderhoek van het scherm vermeld. In dit geval vermeldt CTRL-G geen regelnummer. CTRL-G geeft ook de status aan, namelijk of de tekst veranderd is ('modified') sinds het de laatste keer is opgeslagen. 2. Tik hoofdletter G om naar het einde van het bestand te gaan. Tik gg om naar het begin van het bestand te gaan. 3. Tik het regelnummer waar je bij stap 1 was en daarna G . Dit brengt je terug naar de regel waar je was toen je de eerste keer CTRL-G tikte. 4. Voer de stappen 1 tot 3 uit als je dit goed hebt gelezen. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 4.2: HET COMMANDO ZOEKEN ** Met /ZOEK wordt naar de zoekterm (n of meer woorden) gezocht. ** 1. Tik in de opdrachtmodus het teken / . Je ziet dat het met de cursor aan de onderkant van het scherm verschijnt, zoals bij het :-commando. 2. Tik nu 'ffouut' . Dit is het woord waarnaar gezocht wordt. 3. Tik n om verder te zoeken met dezelfde zoekterm. Zoek met N met dezelfde zoekterm in de tegenovergestelde richting. 4. Zoek in achterwaartse richting met ?zoekterm in plaats van / . 5. Keer terug naar de vorige hit met CTRL-O (hou Ctrl-toets ingedrukt en tik letter o). Herhaal om verder terug te gaan. CTRL-I gaat vooruit. ---> "ffouut" is niet de juiste spelling van fout, ffouut is een fout. OPMERKING: Als zoeken het einde van het bestand bereikt, wordt vanaf het begin doorgezocht, tenzij de optie 'wrapscan' is uitgeschakeld. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 4.3: GA NAAR CORRESPONDERENDE HAAKJES ** Tik % om naar corresponderende ), ] of } te gaan. ** 1. Zet de cursor op een (, [ of { in de regel hieronder met --->. 2. Tik dan het teken % . 3. De cursor gaan naar het overeenkomstige haakje. 4. Met opnieuw % gaat de cursor terug naar het eerste haakje. 5. Plaats de cursor op een ander haakje en bekijk wat % doet. ---> Dit ( is een testregel met ('s, ['s ] en {'s } erin. )) OPMERKING: Dit is nuttig bij het debuggen van een programma waarin haakjes niet corresponderen. Met de optie 'showmatch' wordt ook aangegeven of haakjes corresponderen, maar de cursor wordt niet (blijvend) verplaatst. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 4.4: HET VERVANG COMMANDO ** Tik :s/oud/nieuw/g om 'oud' door 'nieuw' te vervangen. ** 1. Ga met de cursor naar de regel hieronder met --->. 2. Tik :s/dee/de . Zoals je ziet, vervangt ('substitute') dit commando alleen de eerste "dee" in de regel. 3. Tik nu :s/dee/de/g . Met de g-vlag ('global') wordt elke "dee" in de regel vervangen. ---> dee beste tijd om dee bloemen te zien is in dee lente. 4. Om in (een deel van) een tekst elk 'oud' te vervangen door 'nieuw': tik :#,#s/oud/nieuw/g waar #,# de regelnummers zijn die het gebied begrenzen waarin wordt vervangen. tik :%s/oud/nieuw/g om alles te vervangen in het hele bestand. tik :%s/oud/nieuw/gc om elke 'oud' in het hele bestand te vinden en te vragen of er vervangen moet worden. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SAMENVATTING Les 4 1. CTRL-G laat positie in het bestand zien en de status van het bestand. G verplaatst je naar het einde van het bestand. nummer G verplaatst je naar regelnummer. gg verplaatst je naar de eerste regel. 2. Met / en een zoekterm wordt VOORWAARTS gezocht naar de term. Met ? en een zoekterm wordt ACHTERWAARTS gezocht naar de term. Tik n na een zoekopdracht om de volgende hit te vinden, of tik N om in de andere richting te zoeken. CTRL-O brengt je naar eerdere hit, CTRL-I naar nieuwere. 3. Tik % terwijl de cursor op een haakje ([{}]) staat, om naar het corresponderende haakje te gaan. 4. :s/oud/nieuw vervangt het eerste 'oud' in een regel door 'nieuw'. :s/oud/nieuw/g vervangt elk 'oud' in een regel door 'nieuw'. :#,#s/oud/nieuw/g vervangt elk 'oud' door 'nieuw' tussen de regelnummers. :%s/oud/nieuw/g vervangt elk 'oud' door 'nieuw' in het hele bestand. Voeg c toe (:%s/oud/nieuw/gc) om elke keer om bevestiging ('confirmation') te vragen. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 5.1: HOE EEN EXTERN COMMANDO WORDT UITGEVOERD ** Tik :! gevolgd door een extern commando om dat uit te voeren. ** 1. Tik het commando : waarmee de cursor op de onderste regel van het scherm komt te staan. Nu kan je een opdracht geven via de commando-regel. 2. Tik een ! (uitroepteken). Dit stelt je in staat om elk shell-commando uit te voeren. 3. Tik bijvoorbeeld ls na het uitroepteken en daarna . Hiermee krijg je de inhoud van je map te zien, net alsof je de opdracht gaf vanaf de shell-prompt. Probeer :!dir als het niet werkt. OPMERKING: Elk extern commando kan op deze manier uitgevoerd worden, ook met argumenten. OPMERKING: Alle commando's na : moeten worden afgesloten met . Vanaf nu zullen we dat niet meer altijd vermelden. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 5.2: MEER OVER HET OPSLAAN VAN BESTANDEN ** Tik :w BESTANDSNAAM om de tekst mt veranderingen op te slaan. ** 1. Tik :!dir of :!ls om de inhoud van je map te tonen. Je weet inmiddels dat je daarna een moet tikken. 2. Kies een bestandsnaam die nog niet bestaat, bijvoorbeeld TEST. 3. Tik nu: :w TEST (als je de naam TEST hebt gekozen). 4. Hierdoor wordt het hele bestand (de VIM lessen) opgeslagen onder de naam TEST. Tik weer :!dir of :!ls om dit te controleren. OPMERKING: Als je Vim zou verlaten en opnieuw zou starten met vim TEST is het bestand een exacte kopie van de lessen, zoals je ze opsloeg. 5. Wis het bestand nu met de opdracht (MS-DOS) :!del TEST of (Unix) :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 5.3: EEN DEEL VAN DE TEKST OPSLAAN ** Sla een deel van het bestand op met v beweging :w BESTANDSNAAM ** 1. Ga naar deze regel. 2. Tik v en ga met de cursor naar stap 5 hieronder. Je ziet dat de tekst oplicht. 3. Tik : . Onderaan het scherm zal :'<,'> verschijnen. 4. Tik w TEST , waar TEST een bestandsnaam is, die nog niet bestaat. Controleer dat je :'<,'>w TEST ziet staan voordat je tikt. 5. Vim slaat nu de geselecteerde regels op in het bestand TEST. Met :!dir of !ls kan je dat zien. Wis het nog niet! We zullen het in de volgende les gebruiken. OPMERKING: Het tikken van v zet zichtbare modus ('visual selection') aan. Je kan de cursor rondbewegen om de selectie groter of kleiner te maken. Vervolgens kan je een commando gebruiken om iets met de tekst te doen. Met d bijvoorbeeld wis je de tekst. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 5.4: OPHALEN EN SAMENVOEGEN VAN BESTANDEN ** Tik :r BESTANDSNAAM om de inhoud van een bestand in te voegen. ** 1. Zet de cursor precies boven deze regel. OPMERKING: Na het uitvoeren van stap 2 zie je tekst van les 5.3. Scrol daarna naar beneden om deze les weer te zien. 2. Haal nu het bestand TEST op met het commando :r TEST . Het bestand dat je ophaalt komt onder de regel waarin de cursor staat. 3. Controleer dat er een bestand is opgehaald. Ga met de cursor omhoog. Dan zie je de tekst van les 5.3 dubbel, het origineel en de versie uit het bestand. OPMERKING: Je kan ook de uitvoer van een extern commando inlezen. Om een voorbeeld te geven: :r !ls leest de uitvoer van het commando ls en zet dat onder de regel waarin de cursor staat. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SAMENVATTING Les 5 1. :!COMMANDO voert een extern commando uit. Enkele bruikbare voorbeelden zijn: (MS-DOS) (Unix) :!dir :!ls - laat de inhoud van een map zien :!del BESTAND :!rm BESTAND - wist bestand BESTAND 2. :w BESTANDSNAAM schrijft het huidige Vim-bestand naar disk met de naam BESTANDSNAAM. 3. v beweging :w BESTANDSNAAM laat je in zichtbare modus een fragment selecteren, dat wordt opgeslagen in het bestand BESTANDSNAAM. 4. :r BESTANDSNAAM haalt het bestand BESTANDSNAAM op en voegt het onder de cursor-positie in de tekst in. 5. :r !dir leest de uitvoer van het externe commando dir en zet het onder de cursor-positie. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 6.1: HET COMMANDO OPEN ** Tik o om een regel onder de cursor te openen in invoegmodus. ** 1. Ga naar de eerste regel beneden met --->. 2. Tik de kleine letter o en open daarmee een regel ONDER de cursor en ga naar de invoegmodus. 3. Tik wat tekst in en sluit af met om de invoegmodus te verlaten. ---> Als je o tikt, komt de cursor in een nieuwe regel in invoegmodus. 4. Om een regel BOVEN de cursor te openen, moet je gewoon een hoofdletter O tikken in plaats van een kleine letter. Probeer dat vanaf de volgende regel. ---> Open een regel hierboven. Tik een O terwijl de cursor hier staat. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 6.2: HET COMMANDO TOEVOEGEN ** Tik a om tekst toe te voegen ACHTER de cursor. ** 1. Ga naar het begin van de regel beneden met --->. 2. Tik e tot de cursor op het einde van "ste" staat. 3. Tik een (kleine letter) a ('append') om toe te voegen ACHTER de cursor. 4. Vul het woord aan zoals in de volgende regel. Druk om de invoegmodus te verlaten. 5. Ga met e naar het einde van het volgende onvolledige woord en herhaal de stappen 3 en 4. ---> Deze regel ste je in staat om te oef in het toevo van tekst. Deze regel stelt je in staat om te oefenen in het toevoegen van tekst. OPMERKING: a, i en A openen allemaal dezelfde invoegmodus, het enige verschil is waar tekens worden ingevoegd. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 6.3: VERVANGEN OP EEN ANDERE MANIER ** Tik een hoofdletter R om meer dan n teken te vervangen. ** 1. Ga naar de eerste regel beneden met --->. Ga met de cursor naar het begin van de eerste "xxx" . 2. Tik nu R en daarna het getal eronder in de tweede regel, zodat xxx wordt vervangen. 3. Druk om de vervangmodus te verlaten. Je ziet dat de rest van de regel ongewijzigd blijft. 4. Herhaal de stappen om de overgebleven xxx te vervangen. ---> Optellen van 123 en xxx geeft je xxx. ---> Optellen van 123 en 456 geeft je 579. OPMERKING: Vervangmodus lijkt op invoegmodus, maar elk teken dat je tikt, vervangt een bestaand teken. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 6.4: TEKST KOPIREN EN PLAKKEN ** Gebruik y om tekst te kopiren en p om te plakken. ** 1. Ga naar de regel beneden met ---> en zet de cursor achter "a)". 2. Zet zichtbare modus aan met v en zet de cursor juist voor "eerste". 3. Tik y ('yank') om de opgelichte tekst ("dit is het") te kopiren. 4. Ga met j$ met de cursor naar het einde van de volgende regel. 5. Plak de gekopieerde tekst met p en tik a tweede . 6. Selecteer in zichtbare modus "onderdeel", kopieer het met y en ga met j$ naar het einde van de tweede regel. Plak de tekst daar met p . ---> a) dit is het eerste onderdeel b) OPMERKING: Je kan y ook als operator gebruiken; yw kopieert een woord, yy een hele regel. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 6.5: OPTIES GEBRUIKEN ** Gebruik een optie voor al dan niet hoofdlettergevoelig zoeken. ** 1. Zoek naar 'hoofdlettergevoelig' met /hoofdlettergevoelig Herhaal het zoeken enkele keren door n te tikken. 2. Schakel de optie 'ic' ('ignore case', niet-hoofdlettergevoelig) in met :set ic 3. Zoek met n opnieuw naar 'hoofdlettergevoelig'. Je ziet dat Hoofdlettergevoelig en HOOFDLETTERGEVOELIG nu ook gevonden worden. 4. Schakel de opties 'hlsearch' (treffers oplichten) en 'incsearch' (toon gedeeltelijke treffers bij intikken) in met :set hls is 5. Tik weer /hoofdlettergevoelig en kijk wat er gebeurt. 6. Schakel 'hoofdlettergevoelig' weer in met :set noic OPMERKING: Schakel het oplichten van treffers uit met :nohlsearch OPMERKING: Om bij een enkel zoek-commando de hoofdlettergevoeligheid om te draaien kan \c worden gebruikt na de zoekterm: /hoofdlettergevoelig\c . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SAMENVATTING Les 6 1. Tik o om een regel te openen ONDER de cursor en invoegmodus te starten. Tik O om een regel te openen BOVEN de cursor. 2. Tik a om tekst toe te voegen NA de cursor. Tik A om tekst toe te voegen aan het einde van de regel. 3. Het commando e beweegt de cursor naar het einde van een woord. 4. De operator y yankt (kopieert) tekst, p zet het terug (plakt). 5. Met hoofdletter R wordt de vervangmodus geopend, met afgesloten. 6. Met :set xxx wordt optie 'xxx' ingeschakeld. Opties zijn bijvoorbeeld: ic ignorecase geen verschil hoofdletters/kleine letters bij zoeken is incsearch toon gedeeltelijke treffers tijdens intikken zoekterm hls hlsearch laat alle treffers oplichten Je kan zowel de lange als de korte naam van een optie gebruiken. 7. Zet 'no' voor de naam om een optie uit te schakelen: :set noic schakelt 'ic' uit. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 7.1: HULP INROEPEN ** Het gebruik van ingebouwde hulp. ** Vim heeft een uitgebreid ingebouwd hulpsysteem. Probeer, om te beginnen, n van deze drie: - druk de toets (als je die hebt) - druk de toets (als je die hebt) - tik :help Lees de tekst in het help-venster om te leren hoe 'help' werkt. Tik CTRL-W CTRL-W om van het ene venster naar het andere te gaan. Met :q wordt het help-venster gesloten. Je kan hulp vinden over nagenoeg elk onderwerp door een argument aan het commando :help toe te voegen. Probeer deze (en vergeet niet): :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 7.2: SCHRIJF EEN CONFIGURATIEBESTAND ** Mogelijkheden van Vim uitbreiden. ** Vim kent veel meer mogelijkheden dan Vi, maar de meeste zijn standaard uitgeschakeld. Om meer functies te gebruiken moet je een 'vimrc'-bestand schrijven. 1. Bewerk het bestand 'vimrc'. Hoe dat moet hangt af van je systeem: :e ~/.vimrc voor Unix :e $VIM/_vimrc voor MS-Windows 2. Lees de inhoud van het voorbeeld-bestand: :r $VIMRUNTIME/vimrc_example.vim 3. Sla het bestand op met :w De volgende keer dat je Vim start wordt 'syntaxiskleuring' gebruiken. Je kan al je voorkeursinstellingen toevoegen aan dit 'vimrc'-bestand. Tik :help vimrc-intro voor meer informatie. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 7.3: AANVULLEN ** Aanvullen van de 'command line' met CTRL-D en . ** 1. Zorg dat Vim niet in 'compatible mode' is met :set nocp 2. Kijk welke bestanden zich in de map bevinden met :!ls of :!dir 3. Tik het begin van een commando: :e 4. Met CTRL-D toont Vim een lijst commando's, die met "e" beginnen. 5. Druk enkele keren . Vim laat aanvullingen zien, zoals ":edit", dat we hier gebruiken. 6. Voeg een spatie toe en de eerste letter(s) van een bestaande bestandsnaam: :edit BESTAND 7. Druk . Vim vult de naam aan (als hij uniek is). OPMERKING: Aanvullen werkt bij tal van commando's. Probeer gewoon CTRL-D en . Het is bijzonder nuttig bij :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SAMENVATTING Les 7 1. Tik :help of druk of om een help-venster te openen. 2. Tik :help CMD voor hulp over CMD . 3. Tik CTRL-W CTRL-W om naar een ander venster te gaan. 4. Tik :q om het help-venster te sluiten. 5. Maak een bestand met de naam 'vimrc' voor je voorkeursinstellingen. 6. Druk CTRL-D tijdens het intikken van een :-commando om mogelijke aanvullingen te zien. Druk om aanvullen te gebruiken. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Hiermee komen de Vim-lessen tot een einde. Ze waren bedoeld om een kort overzicht te geven van de Vim-editor, juist voldoende om de editor redelijk makkelijk te gebruiken. Deze lessen zijn verre van volledig. Vim kent veel meer commando's. Lees hierna de handleiding voor gebruikers: ":help user-manual". Voor verdere studie wordt aanbevolen: Vim - Vi Improved - door Steve Oualline Uitgever: New Riders Dit is het eerste boek dat geheel aan Vim is gewijd. Speciaal geschikt voor beginners. Met veel voorbeelden en afbeeldingen. Zie http://iccf-holland.org/click5.html Het volgende boek is ouder en gaat meer over Vi dan Vim, maar het wordt toch aanbevolen: Learning the Vi Editor - door Linda Lamb Uitgever: O'Reilly & Associates Inc. Het is een goed boek om nagenoeg alles te weten te komen dat je met Vi zou willen doen. De zesde en vooral de nieuwe zevende druk (onder de titel Learning the Vi and Vim Editors door Arnold Robbins, Elbert Hannah & Linda Lamb) bevat ook informatie over Vim. Deze lessen zijn geschreven door Michael C. Pierce en Robert K. Ware, Colorado School of Mines met gebruikmaking van ideen van Charles Smith van de Colorado State University. E-mail: bware@mines.colorado.edu. Aangepast voor Vim door Bram Moolenaar. Nederlandse vertaling door Rob Bishoff, april 2012 e-mail: rob.bishoff@hccnet.nl) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim-7.4.1689/runtime/tutor/tutor.nl.utf-8000066400000000000000000001107211267703067000201110ustar00rootroot00000000000000 ========================================================================== = W e l k o m b i j d e V I M l e s s e n - Versie 1.7 = ========================================================================== Vim is een krachtige editor met veel commando's, te veel om uit te leggen in lessen zoals deze. Deze lessen zijn bedoeld om voldoende commando's te behandelen om je in staat te stellen met Vim te werken als een editor voor algemeen gebruik. Deze lessen zullen 25 tot 30 minuten in beslag nemen, afhankelijk van de tijd die wordt besteed aan het uitproberen van de commando's. LET OP: Door de commando's in deze lessen verandert de tekst. Maak een kopie van dit bestand om mee te oefenen (als je "vimtutor" uitvoerde, is dit al een kopie). Deze lessen zijn bedoeld om al doende te leren. Dat betekent dat je de commando's moet uitvoeren om ze goed te leren kennen. Als je de tekst alleen maar doorleest, zal je de commando's niet leren! Zorg ervoor dat de toets NIET is ingedrukt en druk vaak genoeg op de j-toets om de cursor zo te bewegen dat les 1.1 volledig op het scherm staat. LET OP: In deze lessen worden omwille van de duidelijkheid vaak spaties gebruikt binnen een commando (bv. "40 G" of "operator [getal] beweging"). Tik deze spaties echter NIET. Ze verstoren de werking. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 1.1: VERPLAATS DE CURSOR ** De cursor wordt verplaatst met de toetsen h, j, k, l zoals aangegeven. ** ^ k Hint: De h is de meest linkse en beweegt naar links. < h l > De l is de meest rechtse en beweegt naar rechts. j De j lijkt op een pijl naar beneden. v 1. Beweeg de cursor over het scherm om er vertrouwd mee te raken. 2. Druk de omlaag-toets (j) tot hij repeteert. Nu weet je hoe je de volgende les bereikt. 3. Gebruik de omlaag-toets om naar les 1.2 te gaan. OPMERKING: Als je twijfelt aan wat je tikte, druk om in de opdracht- modus te komen. Tik daarna het commando dat bedoeld wordt. OPMERKING: Pijltjes-toetsen werken ook. Met de hjkl-toetsen kan je sneller rondbewegen, als je er eenmaal aan gewend bent. Echt waar! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 1.2: VIM AFSLUITEN !! LET OP: Lees deze les goed door voordat je iets uitvoert!! 1. Druk de toets (om zeker in de opdrachtmodus te zitten). 2. Tik :q! Hiermee wordt de editor afgesloten. Alle veranderingen gaan VERLOREN. 3. Nu zie je de shell-prompt. Tik het commando waarmee je deze lessen hebt opgeroepen. Dat is normaal gesproken: vimtutor 4. Als je deze stappen goed hebt doorgelezen, voer dan de stappen 1 tot 3 uit om de editor te verlaten en weer op te starten. LET OP: :q! verwerpt alle veranderingen die je aanbracht. Een paar lessen verder zal je leren hoe veranderingen worden opgeslagen in een bestand. 5. Beweeg de cursor omlaag naar les 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 1.3: TEKST BEWERKEN - WISSEN ** Tik x om het teken onder de cursor te wissen. ** 1. Ga met de cursor naar de regel verderop met --->. 2. Zet de cursor op een teken dat moet worden gewist om een fout te herstellen. 3. Tik x om het ongewenste teken te wissen. 4. Herhaal deze stappen tot de regel goed is. ---> Vi kkent eenn opdracccchtmodus en een invooegmmmmodus. 5. Nu de regel gecorrigeerd is kan je naar les 1.4 gaan. LET OP: Probeer de lessen niet uit je hoofd te leren. Leer al doende. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 1.4: TEKST BEWERKEN - INVOEGEN ** Tik i ('insert') om tekst in te voegen. ** 1. Ga met de cursor naar de eerste regel verderop met --->. 2. Maak de eerste regel gelijk aan de tweede. Zet daarvoor de cursor op de plaats waar tekst moet worden ingevoegd. 3. Tik i en daarna de nodige aanvullingen. 4. Tik na elke herstelde fout om terug te keren in de opdrachtmodus. Herhaal de stappen 2 tot 4 om de zin te verbeteren. ---> Aan regel ontekt wat . ---> Aan deze regel ontbreekt wat tekst. 5. Ga naar les 1.5 als je gewend bent aan het invoegen van tekst. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 1.5: TEKST BEWERKEN - TOEVOEGEN ** Tik A ('append') om tekst toe te voegen. ** 1. Ga met de cursor naar de eerste regel verderop met --->. Het maakt niet uit waar de cursor in deze regel staat. 2. Tik hoofdletter A en tik de nodige aanvullingen. 3. Tik nadat de tekst is aangevuld. Zo keer je terug in de opdrachtmodus. 4. Ga naar de tweede regel verderop met ---> en herhaal stap 2 en 3 om deze zin te corrigeren. ---> Er ontbreekt wat tekst aan de Er ontbreekt wat tekst aan deze regel. ---> Hier ontbreekt ook w Hier ontbreekt ook wat tekst. 5. Ga naar les 1.6 als je vertrouwd bent geraakt aan het toevoegen van tekst. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 1.6: EEN BESTAND EDITTEN ** Gebruik :wq om een bestand op te slaan en de editor te verlaten. ** !! LET OP: Lees deze les helemaal door voordat je een van de volgende stappen uitvoert!! 1. Verlaat deze les zoals je in les 1.2 deed: :q! Of gebruik een andere terminal als je daar de beschikking over hebt. Doe daar het volgende. 2. Tik het volgende commando na de shell-prompt: vim les 'vim' (vaak ook 'vi') is het commando om de Vim-editor te starten, 'les' is de naam van het bestand, dat je gaat bewerken. Kies een andere naam als er al een bestand 'les' bestaat, dat niet veranderd mag worden. 3. Voeg naar eigen keus tekst toe, zoals je geleerd hebt in eerdere lessen. 4. Sla het bestand met de wijzigingen op en verlaat Vim met :wq 5. Herstart vimtutor als je deze bij stap 1 hebt verlaten en ga verder met de volgende samenvatting. 6. Voer deze stappen uit nadat je ze hebt gelezen en begrepen. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SAMENVATTING Les 1 1. De cursor wordt bewogen met de pijltjestoetsen of de hjkl-toetsen. h (links) j (omlaag) k (omhoog) l (rechts) 2. Start Vim van de shell-prompt. Tik: vim BESTANDSNAAM 3. Sluit Vim af met :q! om de veranderingen weg te gooien. OF tik :wq om de veranderingen te bewaren. 4. Wis het teken onder de cursor met: x 5. Invoegen of toevoegen van tekst, tik: i en daarna de in te voegen tekst voeg in vanaf de cursor A en daarna de toe te voegen tekst voeg toe achter de regel OPMERKING: Met kom je terug in opdrachtmodus en wordt een ongewenst of gedeeltelijk uitgevoerd commando afgebroken. Ga nu verder met les 2.1. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 2.1: WIS-COMMANDO'S ** Tik dw ('delete word') om een woord te wissen. ** 1. Druk op om zeker in de opdrachtmodus te zijn. 2. Ga naar de regel hieronder, die met ---> begint. 3. Ga met de cursor naar het begin van een woord dat moet worden gewist. 4. Met het tikken van dw verdwijnt het woord. OPMERKING: De letter d verschijnt op de laatste regel van het scherm zodra je hem tikt. Vim is aan het wachten tot je de w tikt. Als je een ander teken dan d ziet, heb je iets verkeerds getikt. Druk op en begin opnieuw. NOG EEN OPMERKING: Dit werkt alleen als de optie 'showcmd' is ingeschakeld. Dat gebeurt met :set showcmd ---> Er zijn een het paar ggg woorden, die niet in deze len zin thuishoren. 5. Herhaal de stappen 3 en 4 tot de zin goed is en ga naar les 2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 2.2: MEER WIS-COMMANDO'S ** Tik d$ om te wissen tot het einde van de regel. ** 1. Druk op om zeker in de opdrachtmodus te zijn. 2. Ga naar de regel hieronder, die met ---> begint. 3. Ga met de cursor naar het einde van de correcte regel (NA de eerste . ). 4. Tik d$ om te wissen tot het einde van de regel. ---> Iemand heeft het einde van deze regel dubbel getikt. dubbel getikt. 5. Ga naar les 2.3 voor uitleg. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 2.3: OVER OPERATOREN EN BEWEGINGEN Veel commando's die de tekst veranderen, bestaan uit een operator en een beweging. De samenstelling van een wis-commando met de operator d is: d beweging Daarbij is: d - de wis-operator beweging - het bereik waarop de operator werkt (zie het lijstje hieronder) Een korte lijst van bewegingen vanaf de cursor: w - tot het begin van het volgende woord, ZONDER het eerste teken daarvan. e - tot het einde van het huidige woord, INCLUSIEF het laatste teken. $ - tot het einde van de regel, INCLUSIEF het laatste teken. Het tikken van de wist tekst vanaf de cursor tot het eind van het woord. OPMERKING: Het intikken van alleen maar de beweging, zonder een operator, in de opdrachtmodus beweegt de cursor (respectievelijk naar het volgende woord, naar het eind van het huidige woord en naar het eind van de regel). ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 2.4: GEBRUIK VAN EEN TELLER BIJ EEN BEWEGING ** Een getal voor een beweging herhaalt het zoveel keer. ** 1. Ga naar de regel hieronder, die met ---> begint. 2. Tik 2w zodat de cursor twee woorden vooruit gaat. 3. Tik 3e zodat de cursor naar het einde van het derde woord gaat. 4. Tik 0 (nul) om naar het begin van de regel te gaan. 5. Herhaal de stappen 2 en 3 met andere getallen. ---> Dit is een regel met woorden waarin je heen en weer kan bewegen. 6. Ga verder met les 2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 2.5: GEBRUIK EEN TELLER OM MEER TE WISSEN ** Een getal met een operator zorgt dat deze zoveel keer wordt herhaald. ** Bij de combinatie van wis-operator en beweging kan je voor de beweging een teller zetten om meer te wissen: d [teller] beweging 1. Ga naar het eerste woord in HOOFDLETTERS in de regel na --->. 2. Met d2w worden twee woorden (in dit voorbeeld in hoofdletters) gewist. 3. Herhaal de stappen 1 en 2 met verschillende tellers om de verschillende woorden in hoofdletters met één commando te wissen. ---> deze ABC DE regel FGHI JK LMN OP is QZ RS ontdaan van rommel. OPMERKING: De teller kan ook aan het begin staan: d2w en 2dw werken allebei. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 2.6: BEWERKING VAN HELE REGELS ** Tik dd om een hele regel te wissen. ** Omdat het wissen van een hele regel vaak voorkomt, besloten de ontwerpers van Vi dat met het tikken van dd simpelweg een hele regel gewist wordt. 1. Ga met de cursor naar de tweede regel van de zinnetjes hieronder. 2. Tik dd om de regel te wissen. 3. Ga nu naar de vierde regel. 4. Tik 2dd om twee regels te wissen. ---> 1) Rozen zijn rood. ---> 2) Modder is leuk. ---> 3) Viooltjes zijn blauw. ---> 4) Ik heb een auto. ---> 5) De klok slaat de tijd. ---> 6) Suiker is zoet. ---> 7) En dat ben jij ook. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 2.7: HET COMMANDO HERSTEL ** u maakt het laatste commando ongedaan, U herstelt een hele regel. ** 1. Ga met de cursor naar de regel hieronder met ---> en zet hem op de eerste fout. 2. Tik x om het eerste ongewenste teken te wissen. 3. Tik nu u en maak daarmee het vorige commando ongedaan. 4. Herstel nu alle fouten in de regel met het x commando. 5. Tik een hoofdletter U om de regel in z'n oorspronkelijke staat terug te brengen. 6. Tik nu een paar keer u en herstel daarmee de U en eerdere commando's. 7. Tik nu een paar keer CTRL-R (Ctrl-toets ingedrukt houden en R tikken) en voer daarmee de commando's opnieuw uit: 'redo' oftewel 'undo de undo's'. ---> Heerstel de fouten inn deeze regel en brenng ze weer terugg met undo. 8. Dit zijn heel nuttige commando's. Ga verder met samenvatting van les 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SAMENVATTING Les 2 1. Wis van de cursor tot het volgende woord met dw 2. Wis van de cursor tot het eind van de regel met d$ 3. Wis de hele regel met dd 4. Herhaal een beweging door er een getal voor te zetten: 2w 5. De opbouw van een wijzigingscommando is: operator [getal] beweging daarbij is: operator - wat er moet gebeuren, bijvoorbeeld d om te wissen [getal] - een (niet-verplichte) teller om 'beweging' te herhalen beweging - een beweging door de te wijzigen tekst zoals w (woord) of $ (tot het einde van de regel) enz. 6. Ga naar het begin van de regel met nul: 0 7. Undo de voorgaande actie met u (kleine letter) Undo alle veranderingen in een regel met U (hoofdletter) Undo de undo's met CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 3.1: HET COMMANDO PLAK ** Tik p ('put') en plak daarmee zojuist gewiste tekst na te cursor. ** 1. Ga met de cursor naar de eerste regel met ---> hierna. 2. Wis de regel met dd en bewaar hem zodoende in een Vim-register. 3. Ga naar de c-regel, waar de gewiste regel ONDER moet komen. 4. Tik p om de regel terug te zetten onder de regel met de cursor. 5. Herhaal de stappen 2 tot 4 om de regels in de goede volgorde te zetten. ---> d) Krijg je het ook onder de knie? ---> b) Viooltjes zijn blauw, ---> c) Begrip is te leren, ---> a) Rozen zijn rood, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 3.2: HET COMMANDO VERVANG ** Tik rx ('replace') om het teken onder de cursor te vervangen door x. ** 1. Ga naar de eerste regel hieronder met --->. 2. Zet de cursor op de eerste fout. 3. Tik r en dan het teken dat er hoort te staan. 4. Herhaal de stappen 2 en 3 tot de eerste regel gelijk is aan de tweede. ---> Bij het tokken van dezf hegel heeft iemamd verklerde letters getikt. ---> Bij het tikken van deze regel heeft iemand verkeerde letters getikt. 5. Ga nu naar les 3.3. LET OP: Door het te doen, leer je beter dan door het uit je hoofd te leren. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 3.3: HET COMMANDO VERANDER ** Tik ce om te veranderen tot het einde van een woord. ** 1. Ga met de cursor naar de eerste regel hieronder met --->. 2. Zet de cursor op de u van ruch. 3. Tik ce en de juiste letters (in dit geval "egel"). 4. Druk en ga naar het volgende teken dat moet worden veranderd. 5. Herhaal de stappen 3 en 4 tot de eerste regel gelijk is aan de tweede. ---> In deze ruch staan een paar weedrim die veranderd moud worden. ---> In deze regel staan een paar woorden die veranderd moeten worden. LET OP: Met ce wordt (het laatste deel van) een woord gewist en kom je in de invoegmodus. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 3.4: MEER VERANDERINGEN MET c 1. Het commando verander ('change') werkt op dezelfde manier als wis. De opbouw is: c [teller] beweging 2. De bewegingen zijn hetzelfde, zoals w (woord) en $ (einde regel). 3. Ga naar de eerste regel hieronder met --->. 4. Zet de cursor op de eerste fout. 5. Tik c$ en tik de rest van de regel zodat hij gelijk wordt aan de tweede en sluit af met . ---> Het einde van deze regel moet precies zo worden als de tweede regel. ---> Het einde van deze regel moet gecorrigeerd worden met het commando c$. OPMERKING: Je kan de toets gebruiken om tikfouten te herstellen. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SAMENVATTING Les 3 1. Tik p om tekst terug te plakken, die zojuist is gewist. Dit zet de gewiste tekst ACHTER de cursor (als een hele regel is gewist komt deze op de regel ONDER de cursor. 2. Het teken waarop de cursor staat wordt vervangen met r gevolgd door het teken dat je daar wilt hebben. 3. Het commando 'verander' stelt je in staat om tekst te veranderen vanaf de cursor tot waar de 'beweging' je brengt. Dat wil zeggen: tik ce om te veranderen vanaf de cursor tot het einde van het woord, c$ om te veranderen tot het einde van de regel. 4. De opbouw van het commando verander is: c [teller] beweging Ga nu naar de volgende les. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 4.1: PLAATS VAN DE CURSOR EN STATUS VAN HET BESTAND ** CTRL-G laat zien waar (regelnummer) je je bevindt en wat de status van het bestand is. Met [nummer] G ga je naar een bepaalde regel. ** LET OP: Lees de hele les voordat je een stap uitvoert!! 1. Hou de Ctrl-toets ingedrukt en tik g . Dit noemen we CTRL-G. Onderaan de pagina verschijnt een boodschap met de bestandsnaam en de positie in het bestand. Onthou het regelnummer voor stap 3. OPMERKING: Als de optie 'ruler' aan staat, wordt de positie van de cursor (regelnummer, kolom) steeds in de rechter-onderhoek van het scherm vermeld. In dit geval vermeldt CTRL-G geen regelnummer. CTRL-G geeft ook de status aan, namelijk of de tekst veranderd is ('modified') sinds het de laatste keer is opgeslagen. 2. Tik hoofdletter G om naar het einde van het bestand te gaan. Tik gg om naar het begin van het bestand te gaan. 3. Tik het regelnummer waar je bij stap 1 was en daarna G . Dit brengt je terug naar de regel waar je was toen je de eerste keer CTRL-G tikte. 4. Voer de stappen 1 tot 3 uit als je dit goed hebt gelezen. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 4.2: HET COMMANDO ZOEKEN ** Met /ZOEK wordt naar de zoekterm (één of meer woorden) gezocht. ** 1. Tik in de opdrachtmodus het teken / . Je ziet dat het met de cursor aan de onderkant van het scherm verschijnt, zoals bij het :-commando. 2. Tik nu 'ffouut' . Dit is het woord waarnaar gezocht wordt. 3. Tik n om verder te zoeken met dezelfde zoekterm. Zoek met N met dezelfde zoekterm in de tegenovergestelde richting. 4. Zoek in achterwaartse richting met ?zoekterm in plaats van / . 5. Keer terug naar de vorige hit met CTRL-O (hou Ctrl-toets ingedrukt en tik letter o). Herhaal om verder terug te gaan. CTRL-I gaat vooruit. ---> "ffouut" is niet de juiste spelling van fout, ffouut is een fout. OPMERKING: Als zoeken het einde van het bestand bereikt, wordt vanaf het begin doorgezocht, tenzij de optie 'wrapscan' is uitgeschakeld. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 4.3: GA NAAR CORRESPONDERENDE HAAKJES ** Tik % om naar corresponderende ), ] of } te gaan. ** 1. Zet de cursor op een (, [ of { in de regel hieronder met --->. 2. Tik dan het teken % . 3. De cursor gaan naar het overeenkomstige haakje. 4. Met opnieuw % gaat de cursor terug naar het eerste haakje. 5. Plaats de cursor op een ander haakje en bekijk wat % doet. ---> Dit ( is een testregel met ('s, ['s ] en {'s } erin. )) OPMERKING: Dit is nuttig bij het debuggen van een programma waarin haakjes niet corresponderen. Met de optie 'showmatch' wordt ook aangegeven of haakjes corresponderen, maar de cursor wordt niet (blijvend) verplaatst. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 4.4: HET VERVANG COMMANDO ** Tik :s/oud/nieuw/g om 'oud' door 'nieuw' te vervangen. ** 1. Ga met de cursor naar de regel hieronder met --->. 2. Tik :s/dee/de . Zoals je ziet, vervangt ('substitute') dit commando alleen de eerste "dee" in de regel. 3. Tik nu :s/dee/de/g . Met de g-vlag ('global') wordt elke "dee" in de regel vervangen. ---> dee beste tijd om dee bloemen te zien is in dee lente. 4. Om in (een deel van) een tekst elk 'oud' te vervangen door 'nieuw': tik :#,#s/oud/nieuw/g waar #,# de regelnummers zijn die het gebied begrenzen waarin wordt vervangen. tik :%s/oud/nieuw/g om alles te vervangen in het hele bestand. tik :%s/oud/nieuw/gc om elke 'oud' in het hele bestand te vinden en te vragen of er vervangen moet worden. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SAMENVATTING Les 4 1. CTRL-G laat positie in het bestand zien en de status van het bestand. G verplaatst je naar het einde van het bestand. nummer G verplaatst je naar regelnummer. gg verplaatst je naar de eerste regel. 2. Met / en een zoekterm wordt VOORWAARTS gezocht naar de term. Met ? en een zoekterm wordt ACHTERWAARTS gezocht naar de term. Tik n na een zoekopdracht om de volgende hit te vinden, of tik N om in de andere richting te zoeken. CTRL-O brengt je naar eerdere hit, CTRL-I naar nieuwere. 3. Tik % terwijl de cursor op een haakje ([{}]) staat, om naar het corresponderende haakje te gaan. 4. :s/oud/nieuw vervangt het eerste 'oud' in een regel door 'nieuw'. :s/oud/nieuw/g vervangt elk 'oud' in een regel door 'nieuw'. :#,#s/oud/nieuw/g vervangt elk 'oud' door 'nieuw' tussen de regelnummers. :%s/oud/nieuw/g vervangt elk 'oud' door 'nieuw' in het hele bestand. Voeg c toe (:%s/oud/nieuw/gc) om elke keer om bevestiging ('confirmation') te vragen. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 5.1: HOE EEN EXTERN COMMANDO WORDT UITGEVOERD ** Tik :! gevolgd door een extern commando om dat uit te voeren. ** 1. Tik het commando : waarmee de cursor op de onderste regel van het scherm komt te staan. Nu kan je een opdracht geven via de commando-regel. 2. Tik een ! (uitroepteken). Dit stelt je in staat om elk shell-commando uit te voeren. 3. Tik bijvoorbeeld ls na het uitroepteken en daarna . Hiermee krijg je de inhoud van je map te zien, net alsof je de opdracht gaf vanaf de shell-prompt. Probeer :!dir als het niet werkt. OPMERKING: Elk extern commando kan op deze manier uitgevoerd worden, ook met argumenten. OPMERKING: Alle commando's na : moeten worden afgesloten met . Vanaf nu zullen we dat niet meer altijd vermelden. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 5.2: MEER OVER HET OPSLAAN VAN BESTANDEN ** Tik :w BESTANDSNAAM om de tekst mèt veranderingen op te slaan. ** 1. Tik :!dir of :!ls om de inhoud van je map te tonen. Je weet inmiddels dat je daarna een moet tikken. 2. Kies een bestandsnaam die nog niet bestaat, bijvoorbeeld TEST. 3. Tik nu: :w TEST (als je de naam TEST hebt gekozen). 4. Hierdoor wordt het hele bestand (de VIM lessen) opgeslagen onder de naam TEST. Tik weer :!dir of :!ls om dit te controleren. OPMERKING: Als je Vim zou verlaten en opnieuw zou starten met vim TEST is het bestand een exacte kopie van de lessen, zoals je ze opsloeg. 5. Wis het bestand nu met de opdracht (MS-DOS) :!del TEST of (Unix) :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 5.3: EEN DEEL VAN DE TEKST OPSLAAN ** Sla een deel van het bestand op met v beweging :w BESTANDSNAAM ** 1. Ga naar deze regel. 2. Tik v en ga met de cursor naar stap 5 hieronder. Je ziet dat de tekst oplicht. 3. Tik : . Onderaan het scherm zal :'<,'> verschijnen. 4. Tik w TEST , waar TEST een bestandsnaam is, die nog niet bestaat. Controleer dat je :'<,'>w TEST ziet staan voordat je tikt. 5. Vim slaat nu de geselecteerde regels op in het bestand TEST. Met :!dir of !ls kan je dat zien. Wis het nog niet! We zullen het in de volgende les gebruiken. OPMERKING: Het tikken van v zet zichtbare modus ('visual selection') aan. Je kan de cursor rondbewegen om de selectie groter of kleiner te maken. Vervolgens kan je een commando gebruiken om iets met de tekst te doen. Met d bijvoorbeeld wis je de tekst. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 5.4: OPHALEN EN SAMENVOEGEN VAN BESTANDEN ** Tik :r BESTANDSNAAM om de inhoud van een bestand in te voegen. ** 1. Zet de cursor precies boven deze regel. OPMERKING: Na het uitvoeren van stap 2 zie je tekst van les 5.3. Scrol daarna naar beneden om deze les weer te zien. 2. Haal nu het bestand TEST op met het commando :r TEST . Het bestand dat je ophaalt komt onder de regel waarin de cursor staat. 3. Controleer dat er een bestand is opgehaald. Ga met de cursor omhoog. Dan zie je de tekst van les 5.3 dubbel, het origineel en de versie uit het bestand. OPMERKING: Je kan ook de uitvoer van een extern commando inlezen. Om een voorbeeld te geven: :r !ls leest de uitvoer van het commando ls en zet dat onder de regel waarin de cursor staat. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SAMENVATTING Les 5 1. :!COMMANDO voert een extern commando uit. Enkele bruikbare voorbeelden zijn: (MS-DOS) (Unix) :!dir :!ls - laat de inhoud van een map zien :!del BESTAND :!rm BESTAND - wist bestand BESTAND 2. :w BESTANDSNAAM schrijft het huidige Vim-bestand naar disk met de naam BESTANDSNAAM. 3. v beweging :w BESTANDSNAAM laat je in zichtbare modus een fragment selecteren, dat wordt opgeslagen in het bestand BESTANDSNAAM. 4. :r BESTANDSNAAM haalt het bestand BESTANDSNAAM op en voegt het onder de cursor-positie in de tekst in. 5. :r !dir leest de uitvoer van het externe commando dir en zet het onder de cursor-positie. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 6.1: HET COMMANDO OPEN ** Tik o om een regel onder de cursor te openen in invoegmodus. ** 1. Ga naar de eerste regel beneden met --->. 2. Tik de kleine letter o en open daarmee een regel ONDER de cursor en ga naar de invoegmodus. 3. Tik wat tekst in en sluit af met om de invoegmodus te verlaten. ---> Als je o tikt, komt de cursor in een nieuwe regel in invoegmodus. 4. Om een regel BOVEN de cursor te openen, moet je gewoon een hoofdletter O tikken in plaats van een kleine letter. Probeer dat vanaf de volgende regel. ---> Open een regel hierboven. Tik een O terwijl de cursor hier staat. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 6.2: HET COMMANDO TOEVOEGEN ** Tik a om tekst toe te voegen ACHTER de cursor. ** 1. Ga naar het begin van de regel beneden met --->. 2. Tik e tot de cursor op het einde van "ste" staat. 3. Tik een (kleine letter) a ('append') om toe te voegen ACHTER de cursor. 4. Vul het woord aan zoals in de volgende regel. Druk om de invoegmodus te verlaten. 5. Ga met e naar het einde van het volgende onvolledige woord en herhaal de stappen 3 en 4. ---> Deze regel ste je in staat om te oef in het toevo van tekst. Deze regel stelt je in staat om te oefenen in het toevoegen van tekst. OPMERKING: a, i en A openen allemaal dezelfde invoegmodus, het enige verschil is waar tekens worden ingevoegd. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 6.3: VERVANGEN OP EEN ANDERE MANIER ** Tik een hoofdletter R om meer dan één teken te vervangen. ** 1. Ga naar de eerste regel beneden met --->. Ga met de cursor naar het begin van de eerste "xxx" . 2. Tik nu R en daarna het getal eronder in de tweede regel, zodat xxx wordt vervangen. 3. Druk om de vervangmodus te verlaten. Je ziet dat de rest van de regel ongewijzigd blijft. 4. Herhaal de stappen om de overgebleven xxx te vervangen. ---> Optellen van 123 en xxx geeft je xxx. ---> Optellen van 123 en 456 geeft je 579. OPMERKING: Vervangmodus lijkt op invoegmodus, maar elk teken dat je tikt, vervangt een bestaand teken. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 6.4: TEKST KOPIËREN EN PLAKKEN ** Gebruik y om tekst te kopiëren en p om te plakken. ** 1. Ga naar de regel beneden met ---> en zet de cursor achter "a)". 2. Zet zichtbare modus aan met v en zet de cursor juist voor "eerste". 3. Tik y ('yank') om de opgelichte tekst ("dit is het") te kopiëren. 4. Ga met j$ met de cursor naar het einde van de volgende regel. 5. Plak de gekopieerde tekst met p en tik a tweede . 6. Selecteer in zichtbare modus "onderdeel", kopieer het met y en ga met j$ naar het einde van de tweede regel. Plak de tekst daar met p . ---> a) dit is het eerste onderdeel b) OPMERKING: Je kan y ook als operator gebruiken; yw kopieert een woord, yy een hele regel. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 6.5: OPTIES GEBRUIKEN ** Gebruik een optie voor al dan niet hoofdlettergevoelig zoeken. ** 1. Zoek naar 'hoofdlettergevoelig' met /hoofdlettergevoelig Herhaal het zoeken enkele keren door n te tikken. 2. Schakel de optie 'ic' ('ignore case', niet-hoofdlettergevoelig) in met :set ic 3. Zoek met n opnieuw naar 'hoofdlettergevoelig'. Je ziet dat Hoofdlettergevoelig en HOOFDLETTERGEVOELIG nu ook gevonden worden. 4. Schakel de opties 'hlsearch' (treffers oplichten) en 'incsearch' (toon gedeeltelijke treffers bij intikken) in met :set hls is 5. Tik weer /hoofdlettergevoelig en kijk wat er gebeurt. 6. Schakel 'hoofdlettergevoelig' weer in met :set noic OPMERKING: Schakel het oplichten van treffers uit met :nohlsearch OPMERKING: Om bij een enkel zoek-commando de hoofdlettergevoeligheid om te draaien kan \c worden gebruikt na de zoekterm: /hoofdlettergevoelig\c . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SAMENVATTING Les 6 1. Tik o om een regel te openen ONDER de cursor en invoegmodus te starten. Tik O om een regel te openen BOVEN de cursor. 2. Tik a om tekst toe te voegen NA de cursor. Tik A om tekst toe te voegen aan het einde van de regel. 3. Het commando e beweegt de cursor naar het einde van een woord. 4. De operator y yankt (kopieert) tekst, p zet het terug (plakt). 5. Met hoofdletter R wordt de vervangmodus geopend, met afgesloten. 6. Met :set xxx wordt optie 'xxx' ingeschakeld. Opties zijn bijvoorbeeld: ic ignorecase geen verschil hoofdletters/kleine letters bij zoeken is incsearch toon gedeeltelijke treffers tijdens intikken zoekterm hls hlsearch laat alle treffers oplichten Je kan zowel de lange als de korte naam van een optie gebruiken. 7. Zet 'no' voor de naam om een optie uit te schakelen: :set noic schakelt 'ic' uit. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 7.1: HULP INROEPEN ** Het gebruik van ingebouwde hulp. ** Vim heeft een uitgebreid ingebouwd hulpsysteem. Probeer, om te beginnen, één van deze drie: - druk de toets (als je die hebt) - druk de toets (als je die hebt) - tik :help Lees de tekst in het help-venster om te leren hoe 'help' werkt. Tik CTRL-W CTRL-W om van het ene venster naar het andere te gaan. Met :q wordt het help-venster gesloten. Je kan hulp vinden over nagenoeg elk onderwerp door een argument aan het commando :help toe te voegen. Probeer deze (en vergeet niet): :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 7.2: SCHRIJF EEN CONFIGURATIEBESTAND ** Mogelijkheden van Vim uitbreiden. ** Vim kent veel meer mogelijkheden dan Vi, maar de meeste zijn standaard uitgeschakeld. Om meer functies te gebruiken moet je een 'vimrc'-bestand schrijven. 1. Bewerk het bestand 'vimrc'. Hoe dat moet hangt af van je systeem: :e ~/.vimrc voor Unix :e $VIM/_vimrc voor MS-Windows 2. Lees de inhoud van het voorbeeld-bestand: :r $VIMRUNTIME/vimrc_example.vim 3. Sla het bestand op met :w De volgende keer dat je Vim start wordt 'syntaxiskleuring' gebruiken. Je kan al je voorkeursinstellingen toevoegen aan dit 'vimrc'-bestand. Tik :help vimrc-intro voor meer informatie. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 7.3: AANVULLEN ** Aanvullen van de 'command line' met CTRL-D en . ** 1. Zorg dat Vim niet in 'compatible mode' is met :set nocp 2. Kijk welke bestanden zich in de map bevinden met :!ls of :!dir 3. Tik het begin van een commando: :e 4. Met CTRL-D toont Vim een lijst commando's, die met "e" beginnen. 5. Druk enkele keren . Vim laat aanvullingen zien, zoals ":edit", dat we hier gebruiken. 6. Voeg een spatie toe en de eerste letter(s) van een bestaande bestandsnaam: :edit BESTAND 7. Druk . Vim vult de naam aan (als hij uniek is). OPMERKING: Aanvullen werkt bij tal van commando's. Probeer gewoon CTRL-D en . Het is bijzonder nuttig bij :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SAMENVATTING Les 7 1. Tik :help of druk of om een help-venster te openen. 2. Tik :help CMD voor hulp over CMD . 3. Tik CTRL-W CTRL-W om naar een ander venster te gaan. 4. Tik :q om het help-venster te sluiten. 5. Maak een bestand met de naam 'vimrc' voor je voorkeursinstellingen. 6. Druk CTRL-D tijdens het intikken van een :-commando om mogelijke aanvullingen te zien. Druk om aanvullen te gebruiken. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Hiermee komen de Vim-lessen tot een einde. Ze waren bedoeld om een kort overzicht te geven van de Vim-editor, juist voldoende om de editor redelijk makkelijk te gebruiken. Deze lessen zijn verre van volledig. Vim kent veel meer commando's. Lees hierna de handleiding voor gebruikers: ":help user-manual". Voor verdere studie wordt aanbevolen: Vim - Vi Improved - door Steve Oualline Uitgever: New Riders Dit is het eerste boek dat geheel aan Vim is gewijd. Speciaal geschikt voor beginners. Met veel voorbeelden en afbeeldingen. Zie http://iccf-holland.org/click5.html Het volgende boek is ouder en gaat meer over Vi dan Vim, maar het wordt toch aanbevolen: Learning the Vi Editor - door Linda Lamb Uitgever: O'Reilly & Associates Inc. Het is een goed boek om nagenoeg alles te weten te komen dat je met Vi zou willen doen. De zesde en vooral de nieuwe zevende druk (onder de titel Learning the Vi and Vim Editors door Arnold Robbins, Elbert Hannah & Linda Lamb) bevat ook informatie over Vim. Deze lessen zijn geschreven door Michael C. Pierce en Robert K. Ware, Colorado School of Mines met gebruikmaking van ideeën van Charles Smith van de Colorado State University. E-mail: bware@mines.colorado.edu. Aangepast voor Vim door Bram Moolenaar. Nederlandse vertaling door Rob Bishoff, april 2012 e-mail: rob.bishoff@hccnet.nl) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim-7.4.1689/runtime/tutor/tutor.no000066400000000000000000001035041267703067000171530ustar00rootroot00000000000000=============================================================================== = 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.7 = =============================================================================== Vim er en meget kraftig editor med mange kommandoer, alt for mange til kunne g gjennom alle i en innfring som denne. Den er beregnet p sette deg inn i bruken av nok kommandoer s du vil vre i stand til lett kunne bruke Vim som en editor til alle forml. Tiden som kreves for g gjennom denne innfringen tar ca. 25-30 minutter, avhengig av hvor mye tid du bruker til eksperimentering. MERK: Kommandoene i leksjonene vil modifisere teksten. Lag en kopi av denne filen som du kan ve deg p (hvis du kjrte vimtutor-kommandoen, er dette allerede en kopi). Det er viktig huske at denne innfringen er beregnet p lring gjennom bruk. Det betyr at du m utfre kommandoene for lre dem skikkelig. Hvis du bare leser teksten, vil du glemme kommandoene! Frst av alt, sjekk at Caps Lock IKKE er aktiv og trykk j-tasten for flytte markren helt til leksjon 1.1 fyller skjermen. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.1: FLYTTING AV MARKREN ** For flytte markren, 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 hyre og flytter til hyre. j j-tasten ser ut som en pil som peker nedover. v 1. Flytt markren rundt p skjermen til du har ftt 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 for g til normalmodus. Skriv deretter kommandoen du nsket p nytt. Merk: Piltastene skal ogs virke. Men ved bruke hjkl vil du vre i stand til bevege markren mye raskere nr du er blitt vant til det. Helt sant! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.2: AVSLUTTE VIM !! MERK: Fr du utfrer noen av punktene nedenfor, les hele leksjonen!! 1. Trykk -tasten (for forsikre deg om at du er i normalmodus). 2. Skriv: :q! . Dette avslutter editoren og FORKASTER alle forandringer som du har gjort. 3. Nr du ser kommandolinjen i skallet, skriv kommandoen som startet denne innfringen. Den er: vimtutor 4. Hvis du er sikker p at du husker dette, utfr punktene 1 til 3 for avslutte og starte editoren p nytt. MERK: :q! forkaster alle forandringer som du gjorde. I lpet av noen f leksjoner vil du lre hvordan du lagrer forandringene til en fil. 5. Flytt markren ned til leksjon 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.3: REDIGERING AV TEKST -- SLETTING ** Trykk x for slette tegnet under markren. ** 1. Flytt markren til den frste linjen merket med --->. 2. For ordne feilene p linjen, flytt markren til den er opp tegnet som skal slettes. 3. Trykk tasten x for slette det unskede tegnet. 4. Repeter punkt 2 til 4 til setningen er lik den som er under. ---> Hessstennnn brrrsnudddde ii gaaata. ---> Hesten brsnudde i gata. 5. N som linjen er korrekt, g til leksjon 1.4. MERK: Nr du gr gjennom innfringen, ikke bare prv huske kommandoene, men bruk dem helt til de sitter. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.4: REDIGERING AV TEKST -- INNSETTING ** Trykk i for sette inn tekst. ** 1. Flytt markren til den frste linjen som er merket med --->. 2. For gjre den frste linjen lik den andre, flytt markren til den str 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 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. Nr du fler deg komfortabel med sette inn tekst, g til oppsummeringen nedenfor. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.5: REDIGERING AV TEKST -- LEGGE TIL ** Trykk A for legge til tekst. ** 1. Flytt markren til den frste linjen nedenfor merket --->. Det har ikke noe si hvor markren er plassert p den linjen. 2. Trykk A og skriv inn det som skal legges til. 3. Nr teksten er lagt til, trykk for returnere til normalmodusen. 4. Flytt markren til den andre linjen markert med ---> og repeter steg 2 og 3 for reparere denne setningen. ---> Det mangler noe tekst p Det mangler noe tekst p denne linjen. ---> Det mangler ogs litt tek Det mangler ogs litt tekst p denne linjen. 5. Nr du fler at du behersker legge til tekst, g til leksjon 1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.6: REDIGERE EN FIL ** Bruk :wq for lagre en fil og avslutte. ** !! MERK: Fr du utfrer noen av stegene nedenfor, les hele denne leksjonen!! 1. Avslutt denne innfringen som du gjorde i leksjon 1.2: :q! 2. Skriv denne kommandoen p kommandolinja: vim tutor vim er kommandoen for starte Vim-editoren, tutor er navnet p fila som du vil redigere. Bruk en fil som kan forandres. 3. Sett inn og slett tekst som du lrte i de foregende leksjonene. 4. Lagre filen med forandringene og avslutt Vim med: :wq 5. Start innfringen p nytt og flytt ned til oppsummeringen som flger. 6. Etter ha lest og forsttt stegene ovenfor: Sett i gang. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OPPSUMMERING AV LEKSJON 1 1. Markren beveges ved hjelp av piltastene eller hjkl-tastene. h (venstre) j (ned) k (opp) l (hyre) 2. For starte Vim fra skall-kommandolinjen, skriv: vim FILNAVN 3. For avslutte Vim, skriv: :q! for forkaste endringer. ELLER skriv: :wq for lagre forandringene. 4. For slette tegnet under markren, trykk: x 5. For sette inn eller legge til tekst, trykk: i skriv innsatt tekst sett inn fr markren A skriv tillagt tekst legg til p slutten av linjen MERK: Nr du trykker gr du til normalmodus eller du avbryter en unsket og delvis fullfrt kommando. N kan du g videre til leksjon 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 2.1: SLETTEKOMMANDOER ** Trykk dw for slette et ord. ** 1. Trykk for vre sikker p at du er i normalmodus. 2. Flytt markren til den frste linjen nedenfor merket --->. 3. Flytt markren til begynnelsen av ordet som skal slettes. 4. Trykk dw og ordet vil forsvinne. MERK: Bokstaven d vil komme til syne p den nederste linjen p skjermen nr du skriver den. Vim venter p at du skal skrive w . Hvis du ser et annet tegn enn d har du skrevet noe feil; trykk og start p nytt. ---> Det er agurk tre ord eple som ikke hrer pre hjemme i denne setningen. ---> Det er tre ord som ikke hrer hjemme i denne setningen. 5. Repeter punkt 3 og 4 til den frste 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 for vre sikker p at du er i normalmodus. 2. Flytt markren til linjen nedenfor merket --->. 3. Flytt markren til punktet der linjen skal kuttes (ETTER frste punktum). 4. Trykk d$ for slette alt til slutten av linjen. ---> Noen skrev slutten p linjen en gang for mye. linjen en gang for mye. 5. G til leksjon 2.3 for forst hva som skjer. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 2.3: OM OPERATORER OG BEVEGELSER Mange kommandoer som forandrer teksten er laget ut i fra en operator og en bevegelse. Formatet for en slettekommando med sletteoperatoren d er: d bevegelse Der: d - er sletteoperatoren. bevegelse - er hva operatoren vil opere p (listet nedenfor). En kort liste med bevegelser: w - til starten av det neste ordet, UNNTATT det frste tegnet. e - til slutten av det nvrende ordet, INKLUDERT det siste tegnet. $ - til slutten av linjen, INKLUDERT det siste tegnet. Ved skrive de vil alts alt fra markren til slutten av ordet bli slettet. MERK: Ved skrive kun bevegelsen i normalmodusen uten en operator vil markren flyttes som spesifisert. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKSJON 2.4: BRUK AV TELLER FOR EN BEVEGELSE ** Ved skrive et tall foran en bevegelse repeterer den s mange ganger. ** 1. Flytt markren til starten av linjen markert ---> nedenfor. 2. Skriv 2w for flytte markren to ord framover. 3. Skriv 3e for flytte markren framover til slutten av det tredje ordet. 4. Skriv 0 (null) for flytte til starten av linjen. 5. Repeter steg 2 og 3 med forskjellige tall. ---> Dette er en linje med noen ord som du kan bevege deg rundt p. 6. G videre til leksjon 2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 2.5: BRUK AV ANTALL FOR SLETTE MER ** Et tall sammen med en operator repeterer den s mange ganger. ** I kombinasjonen med sletteoperatoren og en bevegelse nevnt ovenfor setter du inn antall fr bevegelsen for slette mer: d nummer bevegelse 1. Flytt markren til det frste ordet med STORE BOKSTAVER p linjen markert med --->. 2. Skriv 2dw for slette de to ordene med store bokstaver. 3. Repeter steg 1 og 2 med forskjelling antall for slette de etterflgende ordene som har store bokstaver. ---> Denne ABC DE linjen FGHI JK LMN OP er n Q RS TUV litt mer lesbar. MERK: Et antall mellom operatoren d og bevegelsen virker p samme mte som bruke bevegelsen uten en operator. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 2.6: OPERERE P LINJER ** 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 vre lettere rett og slett trykke to d-er for slette en linje. 1. Flytt markren til den andre linjen i verset nedenfor. 2. Trykk dd slette linjen. 3. Flytt deretter til den fjerde linjen. 4. Trykk 2dd for slette to linjer. ---> 1) Roser er rde, ---> 2) Gjrme er gy, ---> 3) Fioler er bl, ---> 4) Jeg har en bil, ---> 5) Klokker viser tiden, ---> 6) Druer er ste ---> 7) Og du er likes. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 2.7: ANGRE-KOMMANDOEN ** Trykk u for angre siste kommando, U for fikse en hel linje. ** 1. Flytt markren til linjen nedenfor merket ---> og plasser den p den frste feilen. 2. Trykk x for slette det frste unskede tegnet. 3. Trykk s u for angre den siste utfrte kommandoen. 4. Deretter ordner du alle feilene p linjene ved bruke kommandoen x . 5. Trykk n en stor U for sette linjen tilbake til det den var originalt. 6. Trykk u noen ganger for angre U og foregende kommandoer. 7. Deretter trykker du CTRL-R (hold CTRL nede mens du trykker R) noen ganger for gjenopprette kommandoene (omgjre 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 markren fram til det neste ordet, trykk: dw 2. For slette fra markren til slutten av en linje, trykk: d$ 3. For slette en hel linje, trykk: dd 4. For repetere en bevegelse, sett et nummer foran: 2w 5. Formatet for en forandringskommando er: operator [nummer] bevegelse der: operator - hva som skal gjres, f.eks. d for slette [nummer] - et valgfritt antall for repetere bevegelsen bevegelse - hva kommandoen skal operere p, eksempelvis w (ord), $ (til slutten av linjen) og s videre. 6. For g til starten av en linje, bruk en null: 0 7. For angre tidligere endringer, skriv: u (liten u) For angre alle forandringer p en linje, skriv: U (stor U) For omgjre angringen, trykk: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 3.1: LIM INN-KOMMANDOEN ** Trykk p for lime inn tidligere slettet tekst etter markren ** 1. Flytt markren til den frste linjen med ---> nedenfor. 2. Trykk dd for slette linjen og lagre den i et Vim-register. 3. Flytt markren til c)-linjen, OVER posisjonen linjen skal settes inn. 4. Trykk p for legge linjen under markren. 5. Repeter punkt 2 til 4 helt til linjene er i riktig rekkeflge. ---> d) Kan du ogs lre? ---> b) Fioler er bl, ---> c) Intelligens m lres, ---> a) Roser er rde, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 3.2: ERSTATT-KOMMANDOEN ** Trykk rx for erstatte tegnet under markren med x. ** 1. Flytt markren til den frste linjen nedenfor merket --->. 2. Flytt markren s den str opp den frste feilen. 3. Trykk r og deretter tegnet som skal vre der. 4. Repeter punkt 2 og 3 til den frste linjen er lik den andre. ---> Da dfnne lynjxn ble zkrevet, var det nen som tjykket 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 br lre ved BRUKE, ikke pugge. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 3.3: FORANDRE-OPERATOREN ** For forandre til slutten av et ord, trykk ce . ** 1. Flytt markren til den frste linjen nedenfor som er merket --->. 2. Plasser markren p u i lubjwr. 3. Trykk ce og det korrekte ordet (i dette tilfellet, skriv injen). 4. Trykk og g til det neste tegnet som skal forandres. 5. Repeter punkt 3 og 4 helt til den frste setningen er lik den andre. ---> Denne lubjwr har noen wgh som m forkwp med forkzryas-kommandoen. ---> Denne linjen har noen ord som m forandres med forandre-kommandoen. Vr oppmerksom p at ce sletter ordet og gr inn i innsettingsmodus. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 3.4: FLERE FORANDRINGER VED BRUK AV c ** Forandringskommandoen blir brukt med de samme bevegelser som slett. ** 1. Forandringsoperatoren fungerer p samme mte som slett. Formatet er: c [nummer] bevegelse 2. Bevegelsene er de samme, som for eksempel w (ord) og $ (slutten av en linje). 3. G til den frste linjen nedenfor som er merket --->. 4. Flytt markren til den frste feilen. 5. Skriv c$ og skriv resten av linjen lik den andre og trykk . ---> Slutten p denne linjen trenger litt hjelp for gjre den lik den neste. ---> Slutten p denne linjen trenger bli rettet ved bruk av c$-kommandoen. MERK: Du kan bruke slettetasten for rette feil mens du skriver. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OPPSUMMERING AV LEKSJON 3 1. For legge tilbake tekst som nettopp er blitt slettet, trykk p . Dette limer inn den slettede teksten ETTER markren (hvis en linje ble slettet vil den bli limt inn p linjen under markren). 2. For erstatte et tegn under markren, trykk r og deretter tegnet som du vil ha der. 3. Forandringsoperatoren lar deg forandre fra markren til dit bevegelsen tar deg. Det vil si, skriv ce for forandre fra markren til slutten av ordet, c$ for forandre til slutten av linjen. 4. Formatet for forandre er: c [nummer] bevegelse N kan du g til neste leksjon. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 4.1: POSISJONERING AV MARKREN OG FILSTATUS ** Trykk CTRL-G for vise posisjonen i filen og filstatusen. Trykk G for g til en spesifikk linje i filen. ** Merk: Les hele leksjonen fr du utfrer noen av punktene! 1. Hold nede Ctrl-tasten og trykk g . Vi kaller dette CTRL-G. En melding vil komme til syne p bunnen av skjermen med filnavnet og posisjonen i filen. Husk linjenummeret for bruk i steg 3. Merk: Du kan se markrposisjonen i nederste hyre hjrne av skjermen. Dette skjer nr ruler-valget er satt (forklart i leksjon 6). 2. Trykk G for g til bunnen av filen. Skriv gg for g til begynnelsen av filen. 3. Skriv inn linjenummeret du var p og deretter G . Dette vil fre deg tilbake til linjen du var p da du frst trykket CTRL-G. 4. Utfr steg 1 til 3 hvis du fler deg sikker p prosedyren. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 4.2: SKEKOMMANDOEN ** Skriv / etterfulgt av en skestreng som du vil lete etter. ** 1. Trykk / nr du er i normalmodusen. Legg merke til at skrstreken og markren kommer til syne p bunnen av skjermen i likhet med :-kommandoene. 2. Skriv feeeiil og trykk . Dette er teksten du vil lete etter. 3. For finne neste forekomst av skestrengen, trykk n . For lete etter samme sketeksten i motsatt retning, trykk N . 4. For lete etter en tekst bakover i filen, bruk ? istedenfor / . 5. For g tilbake til der du kom fra, trykk CTRL-O (Hold Ctrl nede mens du trykker bokstaven o ). Repeter for g enda lengre tilbake. CTRL-I gr framover. ---> feeeiil er ikke mten skrive feil p, feeeiil er helt feil. Merk: Nr skingen nr slutten av filen, vil den fortsette fra starten unntatt hvis wrapscan-valget er resatt. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 4.3: FINN SAMSVARENDE PARENTESER ** Trykk % for finne en samsvarende ), ] eller } . ** 1. Plasser markren p en (, [ eller { p linjen nedenfor merket --->. 2. Trykk % . 3. Markren vil g til den samsvarende parentesen eller hakeparentesen. 4. Trykk % for flytte markren til den andre samsvarende parentesen. 5. Flytt markren til en annen (, ), [, ], { eller } og se hva % gjr. ---> Dette ( er en testlinje med (, [ ] og { } i den )). Merk: Dette er veldig nyttig til feilsking i programmer som har ubalansert antall parenteser! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 4.4: ERSTATT-KOMMANDOEN ** Skriv :s/gammel/ny/g for erstatte gammel med ny. ** 1. Flytt markren til linjen nedenfor som er merket med --->. 2. Skriv :s/deen/den/ . Legg merke til at denne kommandoen bare forandrer den frste forekomsten av deen p linjen. 3. Skriv :s/deen/den/g . Nr g-flagget legges til, betyr dette global erstatning p linjen og erstatter alle forekomster av deen p linjen. ---> deen som kan kaste deen tyngste steinen lengst er deen beste 4. For erstatte alle forekomster av en tekststreng mellom to linjer, skriv :#,#s/gammel/ny/g der #,# er linjenumrene p de to linjene for linjeomrdet erstatningen skal gjres. Skriv :%s/gammel/ny/g for erstatte tekst i hele filen. Skriv :%s/gammel/ny/gc for finne alle forekomster i hele filen, og deretter sprre om teksten skal erstattes eller ikke. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OPPSUMMERING AV LEKSJON 4 1. Ctrl-G viser nvrende posisjon i filen og filstatusen. G gr til slutten av filen. nummer G gr til det linjenummeret. gg gr til den frste linjen. 2. Skriv / etterfulgt av en sketekst for lete FRAMOVER etter teksten. Skriv ? etterfulgt av en sketekst for lete BAKOVER etter teksten. Etter et sk kan du trykke n for finne neste forekomst i den samme retningen eller N for lete i motsatt retning. CTRL-O tar deg tilbake til gamle posisjoner, CTRL-I til nyere posisjoner. 3. Skriv % nr markren str p en (, ), [, ], { eller } for finne den som samsvarer. 4. Erstatte gammel med frste 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 UTFRE EN EKSTERN KOMMANDO ** Skriv :! etterfulgt av en ekstern kommando for utfre denne. ** 1. Skriv den velkjente kommandoen : for plassere markren p bunnen av skjermen. Dette lar deg skrive en kommandolinjekommando. 2. N kan du skrive tegnet ! . Dette lar deg utfre en hvilken som helst ekstern kommando. 3. Som et eksempel, skriv ls etter utropstegnet og trykk . Du vil n f en liste over filene i katalogen, akkurat som om du hadde kjrt kommandoen direkte fra kommandolinjen i skallet. Eller bruk :!dir hvis ls ikke virker. MERK: Det er mulig kjre alle eksterne kommandoer p denne mten, ogs med parametere. MERK: Alle :-kommandoer m avsluttes med . Fra dette punktet er det ikke alltid vi nevner det. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 5.2: MER OM LAGRING AV FILER ** For lagre endringene gjort i en tekst, skriv :w FILNAVN. ** 1. Skriv :!dir eller :!ls for f en liste over filene i katalogen. Du vet allerede at du m trykke 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 innfringen) under navnet TEST . For sjekke dette, skriv :!dir eller :!ls igjen for se innholdet av katalogen. Merk: Hvis du n hadde avsluttet Vim og startet p nytt igjen med vim TEST, ville filen vrt en eksakt kopi av innfringen 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: VELGE TEKST SOM SKAL LAGRES ** For lagre en del av en fil, skriv v bevegelse :w FILNAVN ** 1. Flytt markren til denne linjen. 2. Trykk v og flytt markren til det femte elementet nedenfor. Legg merke til at teksten blir markert. 3. Trykk : (kolon). P bunnen av skjermen vil :'<,'> komme til syne. 4. Trykk w TEST , der TEST er et filnavn som ikke finnes enda. Kontroller at du ser :'<,'>w TEST fr du trykker Enter. 5. Vim vil skrive de valgte linjene til filen TEST. Bruk :!dir eller :!ls for se den. Ikke slett den enda! Vi vil bruke den i neste leksjon. MERK: Ved trykke v startes visuelt valg. Du kan flytte markren rundt for gjre det valgte omrdet strre eller mindre. Deretter kan du bruke en operator for gjre noe med teksten. For eksempel sletter d teksten. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 5.4: HENTING OG SAMMENSLING AV FILER ** For lese inn en annen fil inn i nvrende buffer, skriv :r FILNAVN ** 1. Plasser markren like over denne linjen. MERK: Etter ha utfrt steg 2 vil du se teksten fra leksjon 5.3. G deretter NED for se denne leksjonen igjen. 2. Hent TEST-filen ved bruke kommandoen :r TEST der TEST er navnet p filen du brukte. Filen du henter blir plassert nedenfor markrlinjen. 3. For sjekke at filen ble hentet, g tilbake og se at det er to kopier av leksjon 5.3, originalen og denne versjonen. MERK: Du kan ogs lese utdataene av en ekstern kommando. For eksempel, :r !ls leser utdataene av ls-kommandoen og legger dem nedenfor markren. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OPPSUMMERING AV LEKSJON 5 1. :!kommando utfrer en ekstern kommandio. Noen nyttige eksempler er: (MS-DOS) (Unix) :!dir :!ls - List filene i katalogen. :!del FILNAVN :!rm FILNAVN - Slett filen FILNAVN. 2. :w FILNAVN skriver den nvrende Vim-filen disken med navnet FILNAVN . 3. v bevegelse :w FILNAVN lagrer de visuelt valgte linjene til filen FILNAVN. 4. :r FILNAVN henter filen FILNAVN og legger den inn nedenfor markren. 5. :r !dir leser utdataene fra dir-kommandoen og legger dem nedenfor markrposisjonen. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 6.1: PNE LINJE-KOMMANDOEN ** Skriv o for pne opp for en ny linje etter markren og g til innsettingsmodus ** 1. Flytt markren til linjen nedenfor merket --->. 2. Skriv o (liten o) for pne opp en linje NEDENFOR markren og g inn i innsettingsmodus. 3. Skriv litt tekst og trykk for g ut av innsettingsmodusen. ---> Etter at o er skrevet blir markren plassert p den tomme linjen. 4. For pne en ny linje OVER markren, trykk rett og slett en stor O istedenfor en liten o . Prv dette p linjen nedenfor. ---> Lag ny linje over denne ved trykke O mens markren er p denne linjen. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 6.2: LEGG TIL-KOMMANDOEN ** Skriv a for legge til tekst ETTER markren. ** 1. Flytt markren til starten av linjen merket ---> nedenfor. 2. Trykk e til markren er p slutten av li. 3. Trykk a (liten a) for legge til tekst ETTER markren. 4. Fullfr ordet snn som p linjen nedenfor. Trykk for g ut av innsettingsmodusen. 5. Bruk e for g til det neste ufullstendige ordet og repeter steg 3 og 4. ---> Denne li lar deg ve p leg til tek p en linje. ---> Denne linjen lar deg ve p legge til tekst p en linje. Merk: a, i og A gr alle til den samme innsettingsmodusen, den eneste forskjellen er hvor tegnene blir satt inn. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 6.3: EN ANNEN MTE ERSTATTE P ** Skriv en stor R for erstatte mer enn ett tegn. ** 1. Flytt markren til den frste linjen nedenfor merket --->. Flytt markren til begynnelsen av den frste xxx-en. 2. Trykk R og skriv inn tallet som str nedenfor p den andre linjen s det erstatter xxx. 3. Trykk for g ut av erstatningsmodusen. Legg merke til at resten av linjen forblir uforandret. 4. Repeter stegene for erstatte den gjenvrende xxx. ---> Ved legge 123 til xxx fr vi xxx. ---> Ved legge 123 til 456 fr vi 579. MERK: Erstatningsmodus er lik insettingsmodus, men hvert tegn som skrives erstatter et eksisterende tegn. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 6.4: KOPIERE OG LIME INN TEKST ** Bruk y-operatoren for kopiere tekst og p for lime den inn ** 1. G til linjen merket ---> nedenfor og plasser markren etter a). 2. G inn i visuell modus med v og flytt markren til like fr frste. 3. Trykk y for kopiere (engelsk: yank) den uthevede teksten. 4. Flytt markren til slutten av den neste linjen: j$ 5. Trykk p for lime inn teksten. Trykk deretter: a andre . 6. Bruk visuell modus for velge valget., kopier det med y , g til slutten av den neste linjen med j$ og legg inn teksten der med p . ---> a) Dette er det frste valget. b) Merk: Du kan ogs bruke y som en operator; yw kopierer ett ord. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 6.5: SETT VALG ** Sett et valg s sk eller erstatning ignorerer store/sm bokstaver. ** 1. Let etter ignore ved skrive: /ignore Repeter flere ganger ved trykke n . 2. Sett ic-valget (Ignore Case) ved skrive: :set ic 3. Sk etter ignore igjen ved trykke n . Legg merke til at bde Ignore og IGNORE blir funnet. 4. Sett hlsearch- og incsearch-valgene: :set hls is 5. Skriv skekommandoen igjen og se hva som skjer: /ignore 6. For sl av ignorering av store/sm bokstaver, skriv: :set noic Merk: For fjerne uthevingen av treff, skriv: :nohlsearch Merk: Hvis du vil ignorere store/sm bokstaver for kun en skekommando, bruk \c i uttrykket: /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OPPSUMMERING AV LEKSJON 6 1. Trykk o for legge til en linje NEDENFOR markren og g inn i innsettingsmodus. Trykk O for pne en linje OVER markren. 2. Skriv a for sette inn tekst ETTER markren. Skriv A for sette inn tekst etter slutten av linjen. 3. Kommandoen e gr til slutten av et ord. 4. Operatoren y (yank) kopierer tekst, p (paste) limer den inn. 5. Ved trykke R gr du inn i erstatningsmodus helt til trykkes. 6. Skriv :set xxx for sette valget xxx. Noen valg er: ic ignorecase ignorer store/sm bokstaver under sk is incsearch vis delvise treff for en sketekst hls hlsearch uthev alle sketreff 7. Legg til no foran valget for sl det av: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 7.1: F HJELP ** Bruk det innebygde hjelpesystemet. ** Vim har et omfattende innebygget hjelpesystem. For starte det, prv en av disse mtene: - Trykk Hjelp-tasten (hvis du har en) - Trykk F1-tasten (hvis du har en) - Skriv :help Les teksten i hjelpevinduet for finne ut hvordan hjelpen virker. Skriv CTRL-W CTRL-W for hoppe fra et vindu til et annet Skriv :q for lukke hjelpevinduet. Du kan f hjelp for omtrent alle temaer om Vim ved skrive et parameter til :help-kommandoen. Prv disse (ikke glem trykke ): :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 7.2: LAG ET OPPSTARTSSKRIPT ** Sl p funksjoner i Vim ** Vim har mange flere funksjoner enn Vi, men flesteparten av dem er sltt av som standard. For begynne bruke flere funksjoner m du lage en vimrc-fil. 1. Start redigeringen av vimrc-filen. Dette avhenger av systemet ditt: :e ~/.vimrc for Unix :e $VIM/_vimrc for MS Windows 2. Les inn eksempelfilen for vimrc: :r $VIMRUNTIME/vimrc_example.vim 3. Lagre filen med: :w Neste gang du starter Vim vil den bruke syntaks-utheving. Du kan legge til alle dine foretrukne oppsett i denne vimrc-filen. For mer informasjon, skriv :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 7.3: FULLFRING ** Kommandolinjefullfring med CTRL-D og ** 1. Vr sikker p at Vim ikke er i Vi-kompatibel modus: :set nocp 2. Se hvilke filer som er i katalogen: :!ls eller :!dir 3. Skriv starten p en kommando: :e 4. Trykk CTRL-D og Vim vil vise en liste over kommandoer som starter med e. 5. Trykk og Vim vil fullfre kommandonavnet til :edit. 6. Legg til et mellomrom og starten p et eksisterende filnavn: :edit FIL 7. Trykk . Vim vil fullfre navnet (hvis det er unikt). MERK: Fullfring fungerer for mange kommandoer. Prv ved trykke CTRL-D og . Det er spesielt nyttig for bruk sammen med :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OPPSUMMERING AV LEKSJON 7 1. Skriv :help eller trykk eller for pne et hjelpevindu. 2. Skriv :help kommando for f hjelp om kommando . 3. Trykk CTRL-W CTRL-W for hoppe til et annet vindu. 4. Trykk :q for lukke hjelpevinduet. 5. Opprett et vimrc-oppstartsskript for lagre favorittvalgene dine. 6. Nr du skriver en :-kommando, trykk CTRL-D for se mulige fullfringer. Trykk for bruke en fullfring. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Her slutter innfringen 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 nr 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 frste boken som er fullt og helt dedisert 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 innfringen er skrevet av Michael C. Pierce og Robert K. Ware, Colorado School of Mines med ider av Charles Smith, Colorado State University. E-mail: bware@mines.colorado.edu . Modifisert for Vim av Bram Moolenaar. Oversatt av yvind A. Holm. E-mail: vimtutor _AT_ sunbase.org Id: tutor.no 406 2007-03-18 22:48:36Z sunny ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim: set ts=8 : vim-7.4.1689/runtime/tutor/tutor.no.utf-8000066400000000000000000001051411267703067000201140ustar00rootroot00000000000000=============================================================================== = 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.7 = =============================================================================== 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. MERK: 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 for å flytte markøren 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 for å gå til normalmodus. Skriv deretter kommandoen du ønsket på nytt. 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. Helt sant! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.2: AVSLUTTE VIM !! MERK: Før du utfører noen av punktene nedenfor, les hele leksjonen!! 1. Trykk -tasten (for å forsikre deg om at du er i normalmodus). 2. Skriv: :q! . Dette avslutter editoren og FORKASTER alle forandringer som du har gjort. 3. Når du ser kommandolinjen i skallet, skriv kommandoen som startet denne innføringen. Den er: vimtutor 4. Hvis du er sikker på at du husker dette, utfør punktene 1 til 3 for å avslutte og starte editoren på nytt. MERK: :q! forkaster alle forandringer som du gjorde. I løpet av noen få leksjoner vil du lære hvordan du lagrer forandringene til en fil. 5. Flytt markøren ned til leksjon 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.3: REDIGERING AV TEKST -- SLETTING ** Trykk 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. ---> Hessstennnn brrråsnudddde ii gaaata. ---> Hesten bråsnudde i gata. 5. Nå som linjen er korrekt, gå til leksjon 1.4. MERK: 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 ** 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 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. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.5: REDIGERING AV TEKST -- LEGGE TIL ** Trykk A for å legge til tekst. ** 1. Flytt markøren til den første linjen nedenfor merket --->. Det har ikke noe å si hvor markøren er plassert på den linjen. 2. Trykk A og skriv inn det som skal legges til. 3. Når teksten er lagt til, trykk for å returnere til normalmodusen. 4. Flytt markøren til den andre linjen markert med ---> og repeter steg 2 og 3 for å reparere denne setningen. ---> Det mangler noe tekst p Det mangler noe tekst på denne linjen. ---> Det mangler også litt tek Det mangler også litt tekst på denne linjen. 5. Når du føler at du behersker å legge til tekst, gå til leksjon 1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.6: REDIGERE EN FIL ** Bruk :wq for å lagre en fil og avslutte. ** !! MERK: Før du utfører noen av stegene nedenfor, les hele denne leksjonen!! 1. Avslutt denne innføringen som du gjorde i leksjon 1.2: :q! 2. Skriv denne kommandoen på kommandolinja: vim tutor «vim» er kommandoen for å starte Vim-editoren, «tutor» er navnet på fila som du vil redigere. Bruk en fil som kan forandres. 3. Sett inn og slett tekst som du lærte i de foregående leksjonene. 4. Lagre filen med forandringene og avslutt Vim med: :wq 5. Start innføringen på nytt og flytt ned til oppsummeringen som følger. 6. Etter å ha lest og forstått stegene ovenfor: Sett i gang. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 3. For å avslutte Vim, skriv: :q! for å forkaste endringer. ELLER skriv: :wq for å lagre forandringene. 4. For å slette tegnet under markøren, trykk: x 5. For å sette inn eller legge til tekst, trykk: i skriv innsatt tekst sett inn før markøren A skriv tillagt tekst legg til på slutten av linjen MERK: Når du trykker 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 et ord. ** 1. Trykk 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: Bokstaven d vil komme til syne på den nederste linjen på skjermen når du skriver den. Vim venter på at du skal skrive w . Hvis du ser et annet tegn enn d har du skrevet noe feil; trykk 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 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. linjen en gang for mye. 5. Gå til leksjon 2.3 for å forstå hva som skjer. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 2.3: OM OPERATORER OG BEVEGELSER Mange kommandoer som forandrer teksten er laget ut i fra en operator og en bevegelse. Formatet for en slettekommando med sletteoperatoren d er: d bevegelse Der: d - er sletteoperatoren. bevegelse - er hva operatoren vil opere på (listet nedenfor). En kort liste med bevegelser: w - til starten av det neste ordet, UNNTATT det første tegnet. e - til slutten av det nåværende ordet, INKLUDERT det siste tegnet. $ - til slutten av linjen, INKLUDERT det siste tegnet. Ved å skrive de vil altså alt fra markøren til slutten av ordet bli slettet. MERK: Ved å skrive kun bevegelsen i normalmodusen uten en operator vil markøren flyttes som spesifisert. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKSJON 2.4: BRUK AV TELLER FOR EN BEVEGELSE ** Ved å skrive et tall foran en bevegelse repeterer den så mange ganger. ** 1. Flytt markøren til starten av linjen markert ---> nedenfor. 2. Skriv 2w for å flytte markøren to ord framover. 3. Skriv 3e for å flytte markøren framover til slutten av det tredje ordet. 4. Skriv 0 (null) for å flytte til starten av linjen. 5. Repeter steg 2 og 3 med forskjellige tall. ---> Dette er en linje med noen ord som du kan bevege deg rundt på. 6. Gå videre til leksjon 2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 2.5: BRUK AV ANTALL FOR Å SLETTE MER ** Et tall sammen med en operator repeterer den så mange ganger. ** I kombinasjonen med sletteoperatoren og en bevegelse nevnt ovenfor setter du inn antall før bevegelsen for å slette mer: d nummer bevegelse 1. Flytt markøren til det første ordet med STORE BOKSTAVER på linjen markert med --->. 2. Skriv 2dw for å slette de to ordene med store bokstaver. 3. Repeter steg 1 og 2 med forskjelling antall for å slette de etterfølgende ordene som har store bokstaver. ---> Denne ABC DE linjen FGHI JK LMN OP er nå Q RS TUV litt mer lesbar. MERK: Et antall mellom operatoren d og bevegelsen virker på samme måte som å bruke bevegelsen uten en operator. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 2.6: OPERERE PÅ LINJER ** 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 for å slette en linje. 1. Flytt markøren til den andre linjen i verset nedenfor. 2. Trykk dd å slette linjen. 3. Flytt deretter til den fjerde linjen. 4. Trykk 2dd for å slette to linjer. ---> 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.7: 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 kommandoen x . 5. Trykk nå en stor U for å sette linjen tilbake til det den var originalt. 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 fram til det neste ordet, trykk: dw 2. For å slette fra markøren til slutten av en linje, trykk: d$ 3. For å slette en hel linje, trykk: dd 4. For å repetere en bevegelse, sett et nummer foran: 2w 5. Formatet for en forandringskommando er: operator [nummer] bevegelse der: operator - hva som skal gjøres, f.eks. d for å slette [nummer] - et valgfritt antall for å repetere bevegelsen bevegelse - hva kommandoen skal operere på, eksempelvis w (ord), $ (til slutten av linjen) og så videre. 6. For å gå til starten av en linje, bruk en null: 0 7. For å angre tidligere endringer, 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 tidligere slettet tekst etter markøren ** 1. Flytt markøren til den første linjen med ---> nedenfor. 2. Trykk dd for å slette linjen og lagre den i et Vim-register. 3. Flytt markøren til c)-linjen, OVER posisjonen linjen skal settes inn. 4. Trykk p for å legge linjen under markøren. 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 rx for å erstatte tegnet under markøren med x. ** 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 være der. 4. Repeter punkt 2 og 3 til den første linjen er lik den andre. ---> Da dfnne lynjxn ble zkrevet, var det nøen som tjykket 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»-OPERATOREN ** For å forandre til slutten av et ord, trykk ce . ** 1. Flytt markøren til den første linjen nedenfor som er merket --->. 2. Plasser markøren på u i «lubjwr». 3. Trykk ce og det korrekte ordet (i dette tilfellet, skriv «injen»). 4. Trykk og gå til det neste 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 ce sletter ordet og går inn i innsettingsmodus. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 3.4: FLERE FORANDRINGER VED BRUK AV c ** Forandringskommandoen blir brukt med de samme bevegelser som «slett». ** 1. Forandringsoperatoren fungerer på samme måte som «slett». Formatet er: c [nummer] bevegelse 2. Bevegelsene er de samme, som for eksempel w (ord) og $ (slutten av en linje). 3. Gå til den første linjen nedenfor som er merket --->. 4. Flytt markøren til den første feilen. 5. Skriv c$ og skriv resten av linjen lik den andre og trykk . ---> 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. MERK: Du kan bruke slettetasten for å rette feil mens du skriver. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OPPSUMMERING AV LEKSJON 3 1. For å legge tilbake tekst som nettopp 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 du vil ha der. 3. Forandringsoperatoren lar deg forandre fra markøren til dit bevegelsen tar deg. Det vil si, skriv ce for å forandre fra markøren til slutten av ordet, c$ for å forandre til slutten av linjen. 4. Formatet for «forandre» er: c [nummer] bevegelse Nå kan du gå til neste leksjon. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 4.1: POSISJONERING AV MARKØREN OG FILSTATUS ** Trykk CTRL-G for å vise posisjonen i filen og filstatusen. Trykk 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 . Vi kaller dette CTRL-G. En melding vil komme til syne på bunnen av skjermen med filnavnet og posisjonen i filen. Husk linjenummeret for bruk i steg 3. Merk: Du kan se markørposisjonen i nederste høyre hjørne av skjermen. Dette skjer når «ruler»-valget er satt (forklart i leksjon 6). 2. Trykk G for å gå til bunnen av filen. Skriv gg for å gå til begynnelsen av filen. 3. Skriv inn linjenummeret du var på og deretter G . Dette vil føre deg tilbake til linjen du var på da du først trykket CTRL-G. 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 . 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 N . 4. For å lete etter en tekst bakover i filen, bruk ? istedenfor / . 5. For å gå tilbake til der du kom fra, trykk CTRL-O (Hold Ctrl nede mens du trykker bokstaven o ). Repeter for å gå enda lengre tilbake. CTRL-I går framover. ---> «feeeiil» er ikke måten å skrive «feil» på, feeeiil er helt feil. Merk: Når søkingen når slutten av filen, vil den fortsette fra starten unntatt hvis «wrapscan»-valget er resatt. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 vil gå til den samsvarende parentesen eller hakeparentesen. 4. Trykk % for å flytte markøren til den andre samsvarende parentesen. 5. Flytt markøren til en annen (, ), [, ], { eller } og se hva % gjør. ---> Dette ( er en testlinje med (, [ ] og { } i den )). Merk: Dette er veldig nyttig til feilsøking i programmer som har ubalansert antall parenteser! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 4.4: ERSTATT-KOMMANDOEN ** Skriv :s/gammel/ny/g for å erstatte «gammel» med «ny». ** 1. Flytt markøren til linjen nedenfor som er merket med --->. 2. Skriv :s/deen/den/ . Legg merke til at denne kommandoen bare forandrer den første forekomsten av «deen» på linjen. 3. Skriv :s/deen/den/g . Når g-flagget legges til, betyr dette global erstatning på linjen og erstatter alle forekomster av «deen» på linjen. ---> deen som kan kaste deen tyngste steinen lengst er deen beste 4. For å erstatte alle forekomster av en tekststreng mellom to linjer, skriv :#,#s/gammel/ny/g der #,# er linjenumrene på de to linjene for linjeområdet erstatningen skal gjøres. Skriv :%s/gammel/ny/g for å erstatte tekst i hele filen. Skriv :%s/gammel/ny/gc for å finne alle forekomster i hele filen, og deretter spørre om teksten skal erstattes eller ikke. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OPPSUMMERING AV LEKSJON 4 1. Ctrl-G viser nåværende posisjon i filen og filstatusen. G går til slutten av filen. nummer G går til det linjenummeret. gg går til den første 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 N for å lete i motsatt retning. CTRL-O tar deg tilbake til gamle posisjoner, CTRL-I til nyere posisjoner. 3. Skriv % når markøren står på en (, ), [, ], { eller } for å finne den som samsvarer. 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 kommandolinjekommando. 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 . Du vil nå få en liste over filene i katalogen, akkurat som om du hadde kjørt kommandoen direkte fra kommandolinjen i skallet. Eller bruk :!dir hvis «ls» ikke virker. MERK: Det er mulig å kjøre alle eksterne kommandoer på denne måten, også med parametere. MERK: Alle «:»-kommandoer må avsluttes med . Fra dette punktet er det ikke alltid vi nevner det. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 5.2: MER OM LAGRING AV FILER ** For å lagre endringene gjort i en tekst, skriv :w FILNAVN. ** 1. Skriv :!dir eller :!ls for å få en liste over filene i katalogen. Du vet allerede at du må trykke 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 eller :!ls igjen for å se innholdet av katalogen. Merk: Hvis du nå hadde avsluttet Vim og startet på nytt igjen med «vim 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: VELGE TEKST SOM SKAL LAGRES ** For å lagre en del av en fil, skriv v bevegelse :w FILNAVN ** 1. Flytt markøren til denne linjen. 2. Trykk v og flytt markøren til det femte elementet nedenfor. Legg merke til at teksten blir markert. 3. Trykk : (kolon). På bunnen av skjermen vil :'<,'> komme til syne. 4. Trykk w TEST , der TEST er et filnavn som ikke finnes enda. Kontroller at du ser :'<,'>w TEST før du trykker Enter. 5. Vim vil skrive de valgte linjene til filen TEST. Bruk :!dir eller :!ls for å se den. Ikke slett den enda! Vi vil bruke den i neste leksjon. MERK: Ved å trykke v startes visuelt valg. Du kan flytte markøren rundt for å gjøre det valgte området større eller mindre. Deretter kan du bruke en operator for å gjøre noe med teksten. For eksempel sletter d teksten. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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. Plasser markøren like over denne linjen. MERK: Etter å ha utført steg 2 vil du se teksten fra leksjon 5.3. Gå deretter NED for å se denne leksjonen igjen. 2. Hent TEST-filen ved å bruke kommandoen :r TEST der TEST er navnet på filen du brukte. Filen du henter blir plassert nedenfor markørlinjen. 3. For å sjekke at filen ble hentet, gå tilbake og se at det er to kopier av leksjon 5.3, originalen og denne versjonen. MERK: Du kan også lese utdataene av en ekstern kommando. For eksempel, :r !ls leser utdataene av ls-kommandoen og legger dem nedenfor markøren. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 FILNAVN :!rm FILNAVN - Slett filen FILNAVN. 2. :w FILNAVN skriver den nåværende Vim-filen disken med navnet FILNAVN . 3. v bevegelse :w FILNAVN lagrer de visuelt valgte linjene til filen FILNAVN. 4. :r FILNAVN henter filen FILNAVN og legger den inn nedenfor markøren. 5. :r !dir leser utdataene fra «dir»-kommandoen og legger dem nedenfor markørposisjonen. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 6.1: «ÅPNE LINJE»-KOMMANDOEN ** Skriv o for å «åpne opp» for en ny linje etter markøren og gå til innsettingsmodus ** 1. Flytt markøren til linjen nedenfor merket --->. 2. Skriv o (liten o) for å åpne opp en linje NEDENFOR markøren og gå inn i innsettingsmodus. 3. Skriv litt tekst og trykk for å gå ut av innsettingsmodusen. ---> Etter at o er skrevet blir markøren plassert på den tomme linjen. 4. For å åpne en ny linje OVER markøren, trykk rett og slett en stor O istedenfor en liten o . Prøv dette på linjen nedenfor. ---> Lag ny linje over denne ved å trykke O mens markøren er på denne linjen. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 6.2: «LEGG TIL»-KOMMANDOEN ** Skriv a for å legge til tekst ETTER markøren. ** 1. Flytt markøren til starten av linjen merket ---> nedenfor. 2. Trykk e til markøren er på slutten av «li». 3. Trykk a (liten a) for å legge til tekst ETTER markøren. 4. Fullfør ordet sånn som på linjen nedenfor. Trykk for å gå ut av innsettingsmodusen. 5. Bruk e for å gå til det neste ufullstendige ordet og repeter steg 3 og 4. ---> Denne li lar deg øve på å leg til tek på en linje. ---> Denne linjen lar deg øve på å legge til tekst på en linje. Merk: a, i og A går alle til den samme innsettingsmodusen, den eneste forskjellen er hvor tegnene blir satt inn. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 6.3: EN ANNEN MÅTE Å ERSTATTE PÅ ** Skriv en stor R for å erstatte mer enn ett tegn. ** 1. Flytt markøren til den første linjen nedenfor merket --->. Flytt markøren til begynnelsen av den første «xxx»-en. 2. Trykk R og skriv inn tallet som står nedenfor på den andre linjen så det erstatter xxx. 3. Trykk for å gå ut av erstatningsmodusen. Legg merke til at resten av linjen forblir uforandret. 4. Repeter stegene for å erstatte den gjenværende xxx. ---> Ved å legge 123 til xxx får vi xxx. ---> Ved å legge 123 til 456 får vi 579. MERK: Erstatningsmodus er lik insettingsmodus, men hvert tegn som skrives erstatter et eksisterende tegn. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 6.4: KOPIERE OG LIME INN TEKST ** Bruk y-operatoren for å kopiere tekst og p for å lime den inn ** 1. Gå til linjen merket ---> nedenfor og plasser markøren etter «a)». 2. Gå inn i visuell modus med v og flytt markøren til like før «første». 3. Trykk y for å kopiere (engelsk: «yank») den uthevede teksten. 4. Flytt markøren til slutten av den neste linjen: j$ 5. Trykk p for å lime inn teksten. Trykk deretter: a andre . 6. Bruk visuell modus for å velge « valget.», kopier det med y , gå til slutten av den neste linjen med j$ og legg inn teksten der med p . ---> a) Dette er det første valget. b) Merk: Du kan også bruke y som en operator; yw kopierer ett ord. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 6.5: SETT VALG ** Sett et valg så søk eller erstatning ignorerer store/små bokstaver. ** 1. Let etter «ignore» ved å skrive: /ignore Repeter flere ganger ved å trykke n . 2. Sett «ic»-valget (Ignore Case) ved å skrive: :set ic 3. Søk etter «ignore» igjen ved å trykke n . Legg merke til at både «Ignore» og «IGNORE» blir funnet. 4. Sett «hlsearch»- og «incsearch»-valgene: :set hls is 5. Skriv søkekommandoen igjen og se hva som skjer: /ignore 6. For å slå av ignorering av store/små bokstaver, skriv: :set noic Merk: For å fjerne uthevingen av treff, skriv: :nohlsearch Merk: Hvis du vil ignorere store/små bokstaver for kun en søkekommando, bruk \c i uttrykket: /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OPPSUMMERING AV LEKSJON 6 1. Trykk o for å legge til en linje NEDENFOR markøren og gå inn i innsettingsmodus. Trykk O for å åpne en linje OVER markøren. 2. Skriv a for å sette inn tekst ETTER markøren. Skriv A for å sette inn tekst etter slutten av linjen. 3. Kommandoen e går til slutten av et ord. 4. Operatoren y («yank») kopierer tekst, p («paste») limer den inn. 5. Ved å trykke R går du inn i erstatningsmodus helt til trykkes. 6. Skriv «:set xxx» for å sette valget «xxx». Noen valg er: «ic» «ignorecase» ignorer store/små bokstaver under søk «is» «incsearch» vis delvise treff for en søketekst «hls» «hlsearch» uthev alle søketreff 7. Legg til «no» foran valget for å slå det av: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 7.1: FÅ HJELP ** Bruk det innebygde hjelpesystemet. ** Vim har et omfattende innebygget hjelpesystem. For å starte det, prøv en av disse måtene: - Trykk Hjelp-tasten (hvis du har en) - Trykk F1-tasten (hvis du har en) - Skriv :help Les teksten i hjelpevinduet for å finne ut hvordan hjelpen virker. Skriv CTRL-W CTRL-W for å hoppe fra et vindu til et annet Skriv :q for å lukke hjelpevinduet. Du kan få hjelp for omtrent alle temaer om Vim ved å skrive et parameter til «:help»-kommandoen. Prøv disse (ikke glem å trykke ): :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 7.2: 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 flere funksjoner må du lage en «vimrc»-fil. 1. Start redigeringen av «vimrc»-filen. Dette avhenger av systemet ditt: :e ~/.vimrc for Unix :e $VIM/_vimrc for MS Windows 2. Les inn eksempelfilen for «vimrc»: :r $VIMRUNTIME/vimrc_example.vim 3. Lagre filen med: :w Neste gang du starter Vim vil den bruke syntaks-utheving. Du kan legge til alle dine foretrukne oppsett i denne «vimrc»-filen. For mer informasjon, skriv :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 7.3: FULLFØRING ** Kommandolinjefullføring med CTRL-D og ** 1. Vær sikker på at Vim ikke er i Vi-kompatibel modus: :set nocp 2. Se hvilke filer som er i katalogen: :!ls eller :!dir 3. Skriv starten på en kommando: :e 4. Trykk CTRL-D og Vim vil vise en liste over kommandoer som starter med «e». 5. Trykk og Vim vil fullføre kommandonavnet til «:edit». 6. Legg til et mellomrom og starten på et eksisterende filnavn: :edit FIL 7. Trykk . Vim vil fullføre navnet (hvis det er unikt). MERK: Fullføring fungerer for mange kommandoer. Prøv ved å trykke CTRL-D og . Det er spesielt nyttig for bruk sammen med :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OPPSUMMERING AV LEKSJON 7 1. Skriv :help eller trykk eller for å åpne et hjelpevindu. 2. Skriv :help kommando for å få hjelp om kommando . 3. Trykk CTRL-W CTRL-W for å hoppe til et annet vindu. 4. Trykk :q for å lukke hjelpevinduet. 5. Opprett et vimrc-oppstartsskript for å lagre favorittvalgene dine. 6. Når du skriver en «:»-kommando, trykk CTRL-D for å se mulige fullføringer. Trykk for å bruke en fullføring. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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ørste boken som er fullt og helt dedisert 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. E-mail: bware@mines.colorado.edu . Modifisert for Vim av Bram Moolenaar. Oversatt av Øyvind A. Holm. E-mail: vimtutor _AT_ sunbase.org Id: tutor.no 406 2007-03-18 22:48:36Z sunny ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim: set ts=8 : vim-7.4.1689/runtime/tutor/tutor.pl000066400000000000000000001025451267703067000171560ustar00rootroot00000000000000=============================================================================== = W i t a j w t u t o r i a l u V I M - a - Wersja 1.7. = =============================================================================== Vim to potny edytor, ktry posiada wiele polece, zbyt duo, by wyjani je wszystkie w tym tutorialu. Ten przewodnik ma nauczy Ci posugiwa si wystarczajco wieloma komendami, by mg atwo uywa Vima jako edytora oglnego przeznaczenia. Czas potrzebny na ukoczenie tutoriala to 25 do 30 minut i zaley od tego jak wiele czasu spdzisz na eksperymentowaniu. UWAGA: Polecenia wykonywane w czasie lekcji zmodyfikuj tekst. Zrb wczeniej kopi tego pliku do wicze (jeli zacze komend "vimtutor", to ju pracujesz na kopii). Pamitaj, e przewodnik ten zosta zaprojektowany do nauki poprzez wiczenia. Oznacza to, e musisz wykonywa polecenia, by nauczy si ich prawidowo. Jeli bdziesz jedynie czyta tekst, szybko zapomnisz wiele polece! Teraz upewnij si, e nie masz wcinitego Caps Locka i wciskaj j tak dugo dopki Lekcja 1.1. nie wypeni cakowicie ekranu. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 1.1.: PORUSZANIE SI KURSOREM ** By wykona ruch kursorem, wcinij h, j, k, l jak pokazano. ** ^ k Wskazwka: h jest po lewej < h l > l jest po prawej j j wyglda jak strzaka w d v 1. Poruszaj kursorem dopki nie bdziesz pewien, e pamitasz polecenia. 2. Trzymaj j tak dugo a bdzie si powtarza. Teraz wiesz jak doj do nastpnej lekcji. 3. Uywajc strzaki w d przejd do nastpnej lekcji. Uwaga: Jeli nie jeste pewien czego co wpisae, wcinij , by wrci do trybu Normal. Wtedy powtrz polecenie. Uwaga: Klawisze kursora take powinny dziaa, ale uywajc hjkl bdziesz w stanie porusza si o wiele szybciej, jak si tylko przyzwyczaisz. Naprawd! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 1.2.: WYCHODZENIE Z VIM-a !! UWAGA: Przed wykonaniem jakiegokolwiek polecenia przeczytaj ca lekcj !! 1. Wcinij (aby upewni si, e jeste w trybie Normal). 2. Wpisz: :q!. To spowoduje wyjcie z edytora PORZUCAJC wszelkie zmiany, jakie zdye zrobi. Jeli chcesz zapamita zmiany i wyj, wpisz: :wq 3. Kiedy widzisz znak zachty powoki wpisz komend, eby wrci do tutoriala. Czyli: vimtutor 4. Jeli chcesz zapamita polecenia, wykonaj kroki 1. do 3., aby wyj i wrci do edytora. UWAGA: :q! porzuca wszelkie zmiany jakie zrobie. W nastpnych lekcjach dowiesz si jak je zapamitywa. 5. Przenie kursor do lekcji 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 1.3.: EDYCJA TEKSTU - KASOWANIE ** Wcinij x aby usun znak pod kursorem. ** 1. Przenie kursor do linii poniej oznaczonej --->. 2. By poprawi bdy, naprowad kursor na znak do usunicia. 3. Wcinij x aby usun niechciany znak. 4. Powtarzaj kroki 2. do 4. dopki zdanie nie jest poprawne. ---> Kkrowa prrzeskoczya prrzez ksiiycc. 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) ** Wcinij i aby wstawi tekst. ** 1. Przenie kursor do pierwszej linii poniej oznaczonej --->. 2. Aby poprawi pierwszy wiersz, ustaw kursor na pierwszym znaku PO tym, gdzie tekst ma by wstawiony. 3. Wcinij i a nastpnie wpisz konieczne poprawki. 4. Po poprawieniu bdu wcinij , by wrci do trybu Normal. Powtarzaj kroki 2. do 4., aby poprawi cae zdanie. ---> W tej brkje troch . ---> W tej linii brakuje troch tekstu. 5. Kiedy czujesz si swobodnie wstawiajc tekst, przejd do podsumowania poniej. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 1.5.: EDYCJA TEKSTU - APPENDING (dodawanie) ** Wcinij A by doda tekst. ** 1. Przenie kursor do pierwszej linii poniej oznaczonej --->. Nie ma znaczenia, ktry to bdzie znak. 2. Wcinij A i wpisz odpowiednie dodatki. 3. Kiedy tekst zosta dodany, wcinij i wr do trybu Normalnego. 4. Przenie kursor do drugiej linii oznaczonej ---> i powtrz kroki 2. i 3., aby poprawi zdanie. ---> Brakuje tu tro Brakuje tu troch tekstu. ---> Tu te troch bra Tu te troch brakuje. 5. Kiedy ju utrwalie wiczenie, przejd do lekcji 1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 1.6.: EDYCJA PLIKU ** Uyj :wq aby zapisa plik i wyj. ** !! UWAGA: zanim wykonasz jakiekolwiek polecenia przeczytaj ca lekcj !! 1. Zakocz tutorial tak jak w lekcji 1.2.: :q! lub, jeli masz dostp do innego terminala, wykonaj kolejne kroki tam. 2. W powoce wydaj polecenie: vim tutor "vim" jest poleceniem uruchamiajcym edytor Vim. 'tutor' to nazwa pliku, jaki chcesz edytowa. Uyj pliku, ktry moe zosta zmieniony. 3. Dodaj i usu tekst tak, jak si nauczye w poprzednich lekcjach. 4. Zapisz plik ze zmianami i opu Vima: :wq 5. Jeli zakoczye vimtutor w kroku 1., uruchom go ponownie i przejd do podsumowania poniej. 6. Po przeczytaniu wszystkich krokw i ich zrozumieniu: wykonaj je. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCJA 1. PODSUMOWANIE 1. Poruszasz kursorem uywajc "strzaek" i klawiszy hjkl . h (w lewo) j (w d) k (do gry) l (w prawo) 2. By wej do Vima, (z powoki) wpisz: vim NAZWA_PLIKU 3. By wyj z Vima, wpisz: :q! by usun wszystkie zmiany. LUB: :wq by zmiany zachowa. 4. By usun znak pod kursorem, wcinij: x 5. By wstawi tekst przed kursorem lub doda: i wpisz tekst wstawi przed kursorem A wpisz tekst doda na kocu linii UWAGA: Wcinicie przeniesie Ci z powrotem do trybu Normal lub odwoa niechciane lub czciowo wprowadzone polecenia. Teraz moemy kontynuowa i przej do Lekcji 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 2.1.: POLECENIE DELETE (usuwanie) ** Wpisz dw by usun wyraz. ** 1. Wcinij , by upewni si, e jeste w trybie Normal. 2. Przenie kursor do linii poniej oznaczonej --->. 3. Przesu kursor na pocztek wyrazu, ktry chcesz usun. 4. Wpisz dw by usun wyraz. UWAGA: Litera d pojawi si na dole ekranu. Vim czeka na wpisanie w . Jeli zobaczysz inny znak, oznacza to, e wpisae co le; wcinij i zacznij od pocztku. ---> Jest tu par papier wyrazw, ktre kamie nie nale do noyce tego zdania. 5. Powtarzaj kroki 3. i 4. dopki zdanie nie bdzie poprawne, potem przejd do Lekcji 2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 2.2.: WICEJ POLECE USUWAJCYCH ** Wpisz d$ aby usun tekst do koca linii. ** 1. Wcinij aby si upewni, e jeste w trybie Normal. 2. Przenie kursor do linii poniej oznaczonej --->. 3. Przenie kursor do koca 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 stao. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 2.3.: O OPERATORACH I RUCHACH Wiele polece zmieniajcych tekst jest zoonych z operatora i ruchu. Format dla polecenia usuwajcego z operatorem d jest nastpujcy: d ruch gdzie: d - operator usuwania. ruch - na czym polecenie bdzie wykonywane (lista poniej). Krtka lista ruchw: w - do pocztku nastpnego wyrazu WYCZAJC pierwszy znak. e - do koca biecego wyrazu, WCZAJC ostatni znak. $ - do koca linii, WCZAJC ostatni znak. W ten sposb wpisanie de usunie znaki od kursora do koca wyrazu. UWAGA: Wpisanie tylko ruchu w trybie Normal bez operatora przeniesie kursor tak, jak to okrelono. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 2.4.: UYCIE MNONIKA DLA RUCHU ** Wpisanie liczby przed ruchem powtarza ruch odpowiedni ilo razy. ** 1. Przenie kursor na pocztek linii poniej zaznaczonej --->. 2. Wpisz 2w aby przenie kursor o dwa wyrazy do przodu. 3. Wpisz 3e aby przenie kursor do koca trzeciego wyrazu w przd. 4. Wpisz 0 (zero), aby przenie kursor na pocztek linii. 5. Powtrz kroki 2. i 3. z innymi liczbami. ---> To jest zwyky wiersz z wyrazami, po ktrych moesz si porusza. 6. Przejd do lekcji 2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 2.5.: UYCIE MNONIKA, BY WICEJ USUN ** Wpisanie liczby z operatorem powtarza go odpowiedni ilo razy. ** W wyej wspomnianej kombinacji operatora usuwania i ruchu podaj mnonik przed ruchem, by wicej usun: d liczba ruch 1. Przenie kursor do pierwszego wyrazu KAPITALIKAMI w linii zaznaczonej --->. 2. Wpisz 2dw aby usun dwa wyrazy KAPITALIKAMI. 3. Powtarzaj kroki 1. i 2. z innymi mnonikami, aby usun kolejne wyrazy KAPITALIKAMI jednym poleceniem ---> ta ASD WE linia QWE ASDF ZXCV FG wyrazw zostaa ERT FGH CF oczyszczona. UWAGA: Mnonik pomidzy operatorem d i ruchem dziaa podobnie do ruchu bez operatora. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 2.6.: OPEROWANIE NA LINIACH ** Wpisz dd aby usun ca lini. ** Z powodu czstoci usuwania caych linii, projektanci Vi zdecydowali, e bdzie atwiej wpisa dwa razy d aby usun lini. 1. Przenie kursor do drugiego zdania z wierszyka poniej. 2. Wpisz dd aby usun wiersz. 3. Teraz przenie si do czwartego wiersza. 4. Wpisz 2dd aby usun dwa wiersze. ---> 1) Re s czerwone, ---> 2) Boto jest fajne, ---> 3) Fioki s niebieskie, ---> 4) Mam samochd, ---> 5) Zegar podaje czas, ---> 6) Cukier jest sodki, ---> 7) I ty te. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 2.7.: POLECENIE UNDO (cofnij) ** Wcinij u aby cofn skutki ostatniego polecenia. U za, by cofn skutki dla caej linii. ** 1. Przenie kursor do zdania poniej oznaczonego ---> i umie go na pierwszym bdzie. 2. Wpisz x aby usun pierwszy niechciany znak. 3. Teraz wcinij u aby cofn skutki ostatniego polecenia. 4. Tym razem popraw wszystkie bdy w linii uywajc polecenia x . 5. Teraz wcinij wielkie U aby przywrci lini do oryginalnego stanu. 6. Teraz wcinij u kilka razy, by cofn U i poprzednie polecenia. 7. Teraz wpisz CTRL-R (trzymaj rwnoczenie wcinite klawisze CTRL i R) kilka razy, by cofn cofnicia. ---> Poopraw bdyyy w teej liniii i zaamiie je prrzez coofnij. 8. To s bardzo poyteczne polecenia. Przejd teraz do podsumowania Lekcji 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCJA 2. PODSUMOWANIE 1. By usun znaki od kursora do nastpnego wyrazu, wpisz: dw 2. By usun znaki od kursora do koca linii, wpisz: d$ 3. By usun ca lini: dd 4. By powtrzy ruch, poprzed go liczb: 2w 5. Format polecenia zmiany to: operator [liczba] ruch gdzie: operator - to, co trzeba zrobi (np. d dla usuwania) [liczba] - opcjonalne, ile razy powtrzy ruch ruch - przenosi nad tekstem do operowania, takim jak w (wyraz), $ (do koca linii) etc. 6. By przej do pocztku linii, uyj zera: 0 7. By cofn poprzednie polecenie, wpisz: u (mae u) By cofn wszystkie zmiany w linii, wpisz: U (wielkie U) By cofn cofnicie, wpisz: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 3.1.: POLECENIE PUT (wstaw) ** Wpisz p by wstawi ostatnie usunicia za kursorem. ** 1. Przenie kursor do pierwszej linii ---> poniej. 2. Wpisz dd aby usun lini i przechowa j w rejestrze Vima. 3. Przenie kursor do linii c), POWYEJ tej, gdzie usunita linia powinna si znajdowa. 4. Wcinij p by wstawi lini poniej kursora. 5. Powtarzaj kroki 2. do 4. a znajd si w odpowiednim porzdku. ---> d) Jak dwa anioki. ---> b) Na dole fioki, ---> c) A my si kochamy, ---> a) Na grze re, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 3.2.: POLECENIE REPLACE (zastp) ** Wpisz rx aby zastpi znak pod kursorem na x . ** 1. Przenie kursor do pierwszej linii poniej oznaczonej ---> 2. Ustaw kursor na pierwszym bdzie. 3. Wpisz r a potem znak jaki powinien go zastpi. 4. Powtarzaj kroki 2. i 3. dopki pierwsza linia nie bdzie taka, jak druga. ---> Kjedy ten wiersz bi wstkiwany, kto wcizn per zych klawirzy! ---> Kiedy ten wiersz by wstukiwany, kto wcisn par zych klawiszy! 5. Teraz czas na Lekcj 3.3. UWAGA: Pamitaj, by uczy si wiczc, a nie pamiciowo. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 3.3.: OPERATOR CHANGE (zmie) ** By zmieni do koca wyrazu, wpisz ce . ** 1. Przenie kursor do pierwszej linii poniej oznaczonej --->. 2. Umie kursor na u w lunos. 3. Wpisz ce i popraw wyraz (w tym wypadku wstaw inia ). 4. Wcinij i przejd do nastpnej planowanej zmiany. 5. Powtarzaj kroki 3. i 4. dopki pierwsze zdanie nie bdzie takie same, jak drugie. ---> Ta lunos ma pire sw, ktre tina zbnic uifajonc pcmazu zmie. ---> Ta linia ma par sw, ktre trzeba zmieni uywajc polecenia zmie. Zauwa, e ce nie tylko zamienia wyraz, ale take zmienia tryb na Insert (wprowadzanie). ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 3.4.: WICEJ ZMIAN UYWAJC c ** Polecenie change uywa takich samych ruchw, jak delete. ** 1. Operator change dziaa tak samo, jak delete. Format wyglda tak: c [liczba] ruch 2. Ruchy s take takie same, np.: w (wyraz), $ (koniec linii) etc. 3. Przenie si do pierwszej linii poniej oznaczonej ---> 4. Ustaw kursor na pierwszym bdzie. 5. Wpisz c$ , popraw koniec wiersza i wcinij . ---> Koniec tego wiersza musi by poprawiony, aby wyglda tak, jak drugi. ---> Koniec tego wiersza musi by poprawiony uywajc polecenia c$ . UWAGA: Moesz uywa aby poprawia bdy w czasie pisania. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCJA 3. PODSUMOWANIE 1. Aby wstawi tekst, ktry zosta wczeniej usunity wcinij p . To polecenie wstawia skasowany tekst PO kursorze (jeli caa linia zostaa usunita, zostanie ona umieszczona w linii poniej kursora). 2. By zamieni znak pod kursorem, wcinij r a potem znak, ktry ma zastpi oryginalny. 3. Operator change pozwala Ci na zastpienie od kursora do miejsca, gdzie zabraby Ci ruch. Np. wpisz ce aby zamieni tekst od kursora do koca wyrazu, c$ aby zmieni tekst do koca linii. 4. Format do polecenia change (zmie): c [liczba] obiekt Teraz przejd do nastpnej lekcji. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 4.1.: POOENIE KURSORA ORAZ STATUS PLIKU ** Nacinij CTRL-G aby zobaczy swoje pooenie w pliku i status pliku. Nacinij G aby przej do linii w pliku. ** UWAGA: Przeczytaj ca lekcj zanim wykonasz jakie polecenia!!! 1. Przytrzymaj klawisz CTRL i wcinij g . Uywamy notacji CTRL-G. Na dole strony pojawi si pasek statusu z nazw pliku i pozycj w pliku. Zapamitaj numer linii dla potrzeb kroku 3. UWAGA: Moesz te zobaczy pozycj kursora w prawym, dolnym rogu ekranu. Dzieje si tak kiedy ustawiona jest opcja 'ruler' (wicej w lekcji 6.). 2. Wcinij G aby przej na koniec pliku. Wcinij gg aby przej do pocztku pliku. 3. Wpisz numer linii, w ktrej bye a potem G . To przeniesie Ci z powrotem do linii, w ktrej bye kiedy wcisne CTRL-G. 4. Jeli czujesz si wystarczajco pewnie, wykonaj kroki 1-3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 4.2.: POLECENIE SZUKAJ ** Wpisz / a nastpnie wyraenie, 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 bond . To jest sowo, ktrego chcesz szuka. 3. By szuka tej samej frazy ponownie, po prostu wcinij n . Aby szuka tej frazy w przeciwnym, kierunku wcinij N . 4. Jeli chcesz szuka frazy do tyu, uyj polecenia ? zamiast / . 5. Aby wrci gdzie bye, wcinij CTRL-O. Powtarzaj, by wrci dalej. CTRL-I idzie do przodu. Uwaga: 'bond' to nie jest metoda, by przeliterowa bd; 'bond' to bd. Uwaga: Kiedy szukanie osignie koniec pliku, bdzie kontynuowane od pocztku o ile opcja 'wrapscan' nie zostaa przestawiona. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 4.3.: W POSZUKIWANIU PARUJCYCH NAWIASW ** Wpisz % by znale parujcy ), ], lub } . ** 1. Umie kursor na ktrym z (, [, lub { w linii poniej oznaczonej --->. 2. Teraz wpisz znak % . 3. Kursor powinien si znale na parujcym nawiasie. 4. Wcinij % aby przenie kursor z powrotem do parujcego nawiasu. 5. Przenie kursor do innego (,),[,],{ lub } i zobacz co robi % . ---> To ( jest linia testowa z (, [, ] i {, } . )) Uwaga: Ta funkcja jest bardzo uyteczna w debuggowaniu programu z niesparowanymi nawiasami! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 4.4.: POLECENIE SUBSTITUTE (zamiana) ** Wpisz :s/stary/nowy/g aby zamieni 'stary' na 'nowy'. ** 1. Przenie kursor do linii poniej oznaczonej --->. 2. Wpisz :s/czaas/czas . Zauwa, e to polecenie zmienia tylko pierwsze wystpienie 'czaas' w linii. 3. Teraz wpisz :s/czaas/czas/g . Dodane g oznacza zamian (substytucj) globalnie w caej linii. Zmienia wszystkie wystpienia 'czaas' w linii. ---> Najlepszy czaas na zobaczenie najadniejszych kwiatw to czaas wiosny. 4. Aby zmieni wszystkie wystpienia acucha znakw pomidzy dwoma liniami, wpisz: :#,#s/stare/nowe/g gdzie #,# s numerami linii ograniczajcych region, gdzie ma nastpi zamiana. wpisz :%s/stare/nowe/g by zmieni wszystkie wystpienia w caym pliku. wpisz :%s/stare/nowe/gc by zmieni wszystkie wystpienia w caym pliku, proszc o potwierdzenie za kadym razem. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCJA 4. PODSUMOWANIE 1. CTRL-G pokae Twoj pozycj w pliku i status pliku. SHIFT-G przenosi Ci do koca pliku. G przenosi do koca pliku. liczba G przenosi do linii [liczba]. gg przenosi do pierwszej linii. 2. Wpisanie / a nastpnie acucha znakw szuka acucha DO PRZODU. Wpisanie ? a nastpnie acucha znakw szuka acucha DO TYU. Po wyszukiwaniu wcinij n by znale nastpne wystpienie szukanej frazy w tym samym kierunku lub N by szuka w kierunku przeciwnym. CTRL-O przenosi do starszych pozycji, CTRL-I do nowszych. 3. Wpisanie % gdy kursor znajduje si na (,),[,],{, lub } lokalizuje parujcy 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 pomidzy dwoma liniami # wpisz :#,#s/stary/nowy/g By zamieni wszystkie wystpienia w pliku, wpisz :%s/stary/nowy/g By Vim prosi Ci o potwierdzenie, dodaj 'c' :%s/stary/nowy/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 5.1.: JAK WYKONA POLECENIA ZEWNTRZNE? ** Wpisz :! a nastpnie zewntrzne polecenie, by je wykona. ** 1. Wpisz znajome polecenie : by ustawi kursor na dole ekranu. To pozwala na wprowadzenie komendy linii polece. 2. Teraz wstaw ! (wykrzyknik). To umoliwi Ci wykonanie dowolnego zewntrznego polecenia powoki. 3. Jako przykad wpisz ls za ! a nastpnie wcinij . To polecenie pokae spis plikw w Twoim katalogu, tak jakby by przy znaku zachty powoki. Moesz te uy :!dir jeli ls nie dziaa. Uwaga: W ten sposb mona wykona wszystkie polecenia powoki. Uwaga: Wszystkie polecenia : musz by zakoczone . Od tego momentu nie zawsze bdziemy o tym wspomina. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 5.2.: WICEJ O ZAPISYWANIU PLIKW ** By zachowa zmiany w tekcie, wpisz :w NAZWA_PLIKU . ** 1. Wpisz :!dir lub :!ls by zobaczy spis plikw w katalogu. Ju wiesz, e musisz po tym wcisn . 2. Wybierz nazw pliku, jaka jeszcze nie istnieje, np. TEST. 3. Teraz wpisz: :w TEST (gdzie TEST jest nazw pliku jak wybrae.) 4. To polecenie zapamita cay plik (Vim Tutor) pod nazw TEST. By to sprawdzi, wpisz :!dir lub :!ls eby znowu zobaczy list plikw. Uwaga: Zauwa, e gdyby teraz wyszed z Vima, a nastpnie wszed ponownie poleceniem vim TEST , plik byby dokadn kopi tutoriala, kiedy go zapisywae. 5. Teraz usu plik wpisujc (MS-DOS): :!del TEST lub (Unix): :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 5.3.: WYBRANIE TEKSTU DO ZAPISU ** By zachowa cz pliku, wpisz v ruch :w NAZWA_PLIKU ** 1. Przenie kursor do tego wiersza. 2. Wcinij v i przenie kursor do punktu 5. Zauwa, e tekst zosta podwietlony. 3. Wcinij znak : . Na dole ekranu pojawi si :'<,'> . 4. Wpisz w TEST , gdzie TEST to nazwa pliku, ktry jeszcze nie istnieje. Upewnij si, e widzisz :'<,'>w TEST zanim wciniesz Enter. 5. Vim zapisze wybrane linie do pliku TEST. Uyj :!dir lub :!ls , eby to zobaczy. Jeszcze go nie usuwaj! Uyjemy go w nastpnej lekcji. UWAGA: Wcinicie v zaczyna tryb Wizualny. Moesz porusza kursorem, by zmieni rozmiary zaznaczenia. Moesz te uy operatora, by zrobi co z tekstem. Na przykad d usuwa tekst. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 5.4.: WSTAWIANIE I CZENIE PLIKW ** By wstawi zawarto pliku, wpisz :r NAZWA_PLIKU ** 1. Umie kursor tu powyej tej linii. UWAGA: Po wykonaniu kroku 2. zobaczysz tekst z Lekcji 5.3. Potem przejd do DOU, by zobaczy ponownie t lekcj. 2. Teraz wczytaj plik TEST uywajc polecenia :r TEST , gdzie TEST jest nazw pliku. Wczytany plik jest umieszczony poniej linii z kursorem. 3. By sprawdzi czy plik zosta wczytany, cofnij kursor i zobacz, e teraz s dwie kopie Lekcji 5.3., orygina i kopia z pliku. UWAGA: Moesz te wczyta wyjcie zewntrznego polecenia. Na przykad :r !ls wczytuje wyjcie polecenia ls i umieszcza je pod poniej kursora. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCJA 5. PODSUMOWANIE 1. :!polecenie wykonuje polecenie zewntrzne. Uytecznymi przykadami s: :!dir - pokazuje spis plikw w katalogu. :!rm NAZWA_PLIKU - usuwa plik NAZWA_PLIKU. 2. :w NAZWA_PLIKU zapisuje obecny plik Vima na dysk z nazw NAZWA_PLIKU. 3. v ruch :w NAZWA_PLIKU zapisuje Wizualnie wybrane linie do NAZWA_PLIKU. 4. :r NAZWA_PLIKU wczytuje z dysku plik NAZWA_PLIKU i wstawia go do biecego pliku poniej kursora. 5. :r !dir wczytuje wyjcie polecenia dir i umieszcza je poniej kursora. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 6.1.: POLECENIE OPEN (otwrz) ** Wpisz o by otworzy lini poniej kursora i przenie si do trybu Insert (wprowadzanie). ** 1. Przenie kursor do linii poniej oznaczonej --->. 2. Wpisz o (mae), by otworzy lini PONIEJ kursora i przenie si do trybu Insert (wprowadzanie). 3. Wpisz troch tekstu i wcinij by wyj z trybu Insert (wprowadzanie). ---> Po wciniciu o kursor znajdzie si w otwartej linii w trybie Insert. 4. By otworzy lini POWYEJ kursora, wcinij wielkie O zamiast maego o . Wyprbuj to na linii poniej. ---> Otwrz lini powyej wciskajc SHIFT-O gdy kursor bdzie na tej linii. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 6.2.: POLECENIE APPEND (dodaj) ** Wpisz a by doda tekst ZA kursorem. ** 1. Przenie kursor do pocztku pierwszej linii poniej oznaczonej ---> 2. Wciskaj e dopki kursor nie bdzie na kocu li . 3. Wpisz a (mae), aby doda tekst ZA znakiem pod kursorem. 4. Dokocz wyraz tak, jak w linii poniej. Wcinij aby opuci tryb Insert. 5. Uyj e by przej do kolejnego niedokoczonego wyrazu i powtarzaj kroki 3. i 4. ---> Ta li poz Ci wi dodaw teks do ko lin ---> Ta linia pozwoli Ci wiczy dodawanie tekstu do koca linii. Uwaga: a , i oraz A prowadz do trybu Insert, jedyn rnic jest miejsce, gdzie nowe znaki bd dodawane. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 6.3.: INNA WERSJA REPLACE (zamiana) ** Wpisz wielkie R by zamieni wicej ni jeden znak. ** 1. Przenie kursor do pierwszej linii poniej oznaczonej --->. Przenie kursor do pierwszego xxx . 2. Wcinij R i wpisz numer poniej w drugiej linii, tak, e zastpi on xxx. 3. Wcinij by opuci tryb Replace. Zauwa, e reszta linii pozostaje niezmieniona. 5. Powtarzaj kroki by wymieni wszystkie xxx. ---> Dodanie 123 do xxx daje xxx. ---> Dodanie 123 do 456 daje 579. UWAGA: Tryb Replace jest jak tryb Insert, ale kady znak usuwa istniejcy znak. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 6.4.: KOPIOWANIE I WKLEJANIE TEKSTU ** uyj operatora y aby skopiowa tekst i p aby go wklei ** 1. Przejd do linii oznaczonej ---> i umie kursor za "a)". 2. Wejd w tryb Wizualny v i przenie kursor na pocztek "pierwszy". 3. Wcinij y aby kopiowa (yankowa) podwietlony tekst. 4. Przenie kursor do koca nastpnej linii: j$ 5. Wcinij p aby wklei (wpakowa) tekst. Dodaj: a drugi . 6. Uyj trybu Wizualnego, aby wybra " element.", yankuj go y , przejd do koca nastpnej linii j$ i upakuj tam tekst z p . ---> a) to jest pierwszy element. b) Uwaga: moesz uy y jako operatora; yw kopiuje jeden wyraz. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 6.5.: USTAWIANIE OPCJI ** Ustawianie opcji tak, by szukaj lub substytucja ignoroway wielko liter ** 1. Szukaj 'ignore' wpisujc: /ignore Powtrz szukanie kilka razy naciskajc klawisz n . 2. Ustaw opcj 'ic' (Ignore case -- ignoruj wielko liter) poprzez wpisanie: :set ic 3. Teraz szukaj 'ignore' ponownie wciskajc: n Zauwa, e Ignore i IGNORE take s teraz znalezione. 4. Ustaw opcje 'hlsearch' i 'incsearch': :set hls is 5. Teraz wprowad polecenie szukaj ponownie i zobacz co si zdarzy: /ignore 6. Aby wyczy ignorowanie wielkoci liter: :set noic Uwaga: Aby usun podwietlanie dopasowa, wpisz: :nohlsearch Uwaga: Aby ignorowa wielko liter dla jednego wyszukiwania: /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCJA 6. PODSUMOWANIE 1. Wpisanie o otwiera lini PONIEJ kursora. Wpisanie O otwiera lini POWYEJ kursora. 2. Wpisanie a wstawia tekst ZA znakiem, na ktrym jest kursor. Wpisanie A dodaje tekst na kocu linii. 3. Polecenie e przenosi do koca wyrazu. 4. Operator y yankuje (kopiuje) tekst, p pakuje (wkleja) go. 5. Wpisanie wielkiego R wprowadza w tryb Replace (zamiana) dopki nie zostanie wcinity . 6. Wpisanie ":set xxx" ustawia opcj "xxx". Niektre opcje: 'ic' 'ignorecase' ignoruj wielko znakw 'is' 'incsearch' poka czciowe dopasowania 'hls' 'hlsearch' podwietl wszystkie dopasowania Moesz uy zarwno dugiej, jak i krtkiej formy. 7. Dodaj "no", aby wyczy opcj: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCJA 7.1. JAK UZYSKA POMOC? ** Uycie systemu pomocy on-line ** Vim posiada bardzo dobry system pomocy on-line. By zacz, sprbuj jednej z trzech moliwoci: - wcinij klawisz (jeli taki masz) - wcinij klawisz (jeli taki masz) - wpisz :help Przeczytaj tekst w oknie pomocy, aby dowiedzie si jak dziaa pomoc. wpisz CTRL-W CTRL-W aby przeskoczy z jednego okna do innego wpisz :q aby zamkn okno pomocy. Moesz te znale pomoc na kady temat podajc argument polecenia ":help". Sprbuj tych (nie zapomnij wcisn ): :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCJA 7.2. TWORZENIE SKRYPTU STARTOWEGO ** Wcz moliwoci Vima ** Vim ma o wiele wicej moliwoci ni Vi, ale wikszo z nich jest domylnie wyczona. Jeli chcesz wczy te moliwoci na starcie musisz utworzy plik "vimrc". 1. Pocztek edycji pliku "vimrc" zaley od Twojego systemu: :edit ~/.vimrc dla Uniksa :edit $VIM/_vimrc dla MS-Windows 2. Teraz wczytaj przykadowy plik "vimrc": :read $VIMRUNTIME/vimrc_example.vim 3. Zapisz plik: :w Nastpnym razem, gdy zaczniesz prac w Vimie bdzie on uywa podwietlania skadni. Moesz doda wszystkie swoje ulubione ustawienia do tego pliku "vimrc". Aby uzyska wicej informacji, wpisz :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 7.3.: UZUPENIANIE ** Uzupenianie linii polece z CTRL-D i ** 1. Upewnij si, e Vim nie jest w trybie kompatybilnoci: :set nocp 2. Zerknij, jakie pliki s w biecym katalogu: :!ls lub :!dir 3. Wpisz pocztek polecenia: :e 4. Wcinij CTRL-D i Vim pokae list polece, jakie zaczynaj si na "e". 5. Wcinij i Vim uzupeni polecenie do ":edit". 6. Dodaj spacj i zacznij wpisywa nazw istniejcego pliku: :edit FIL 7. Wcinij . Vim uzupeni nazw (jeli jest niepowtarzalna). UWAGA: Uzupenianie dziaa dla wielu polece. Sprbuj wcisn CTRL-D i . Uyteczne zwaszcza przy :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 7. PODSUMOWANIE 1. Wpisz :help albo wcinij lub aby otworzy okno pomocy. 2. Wpisz :help cmd aby uzyska pomoc o cmd . 3. Wpisz CTRL-W CTRL-W aby przeskoczy do innego okna. 4. Wpisz :q aby zamkn okno pomocy. 5. Utwrz plik startowy vimrc aby zachowa wybrane ustawienia. 6. Po poleceniu : , wcinij CTRL-D aby zobaczy moliwe uzupenienia. Wcinij aby uy jednego z nich. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tutaj si koczy tutorial Vima. Zosta on pomylany tak, aby da krtki przegld jego moliwoci, wystarczajcy by mg go uywa. Jest on daleki od kompletnoci, poniewa Vim ma o wiele, wiele wicej polece. Dla dalszej nauki rekomendujemy ksik: Vim - Vi Improved - autor Steve Oualline Wydawca: New Riders Pierwsza ksika cakowicie powicona Vimowi. Uyteczna zwaszcza dla pocztkujcych. Zawiera wiele przykadw i ilustracji. Zobacz http://iccf-holland.org./click5.html Starsza pozycja i bardziej o Vi ni o Vimie, ale take warta polecenia: Learning the Vi Editor - autor Linda Lamb Wydawca: O'Reilly & Associates Inc. To dobra ksika, by dowiedzie si niemal wszystkiego, co chciaby zrobi z Vi. Szsta edycja zawiera te informacje o Vimie. 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 ksieczka zawierajca spis polece vi i jego najwaniejszych klonw (midzy innymi Vima). 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 tumaczeniu. Ten tutorial zosta napisany przez Michaela C. Pierce'a i Roberta K. Ware'a, Colorado School of Mines korzystajc z pomocy Charlesa Smitha, Colorado State University. E-mail: bware@mines.colorado.edu. Zmodyfikowane dla Vima przez Brama Moolenaara. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Przetumaczone przez Mikoaja Machowskiego, Sierpie 2001, rev. Marzec 2002 2nd rev. Wrzesie 2004 3rd rev. Marzec 2006 4th rev. Grudzie 2008 Wszelkie uwagi prosz kierowa na: mikmach@wp.pl vim-7.4.1689/runtime/tutor/tutor.pl.cp1250000066400000000000000000001025451267703067000200670ustar00rootroot00000000000000=============================================================================== = W i t a j w t u t o r i a l u V I M - a - Wersja 1.7. = =============================================================================== Vim to potny edytor, ktry posiada wiele polece, zbyt duo, by wyjani je wszystkie w tym tutorialu. Ten przewodnik ma nauczy Ci posugiwa si wystarczajco wieloma komendami, by mg atwo uywa Vima jako edytora oglnego przeznaczenia. Czas potrzebny na ukoczenie tutoriala to 25 do 30 minut i zaley od tego jak wiele czasu spdzisz na eksperymentowaniu. UWAGA: Polecenia wykonywane w czasie lekcji zmodyfikuj tekst. Zrb wczeniej kopi tego pliku do wicze (jeli zacze komend "vimtutor", to ju pracujesz na kopii). Pamitaj, e przewodnik ten zosta zaprojektowany do nauki poprzez wiczenia. Oznacza to, e musisz wykonywa polecenia, by nauczy si ich prawidowo. Jeli bdziesz jedynie czyta tekst, szybko zapomnisz wiele polece! Teraz upewnij si, e nie masz wcinitego Caps Locka i wciskaj j tak dugo dopki Lekcja 1.1. nie wypeni cakowicie ekranu. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 1.1.: PORUSZANIE SI KURSOREM ** By wykona ruch kursorem, wcinij h, j, k, l jak pokazano. ** ^ k Wskazwka: h jest po lewej < h l > l jest po prawej j j wyglda jak strzaka w d v 1. Poruszaj kursorem dopki nie bdziesz pewien, e pamitasz polecenia. 2. Trzymaj j tak dugo a bdzie si powtarza. Teraz wiesz jak doj do nastpnej lekcji. 3. Uywajc strzaki w d przejd do nastpnej lekcji. Uwaga: Jeli nie jeste pewien czego co wpisae, wcinij , by wrci do trybu Normal. Wtedy powtrz polecenie. Uwaga: Klawisze kursora take powinny dziaa, ale uywajc hjkl bdziesz w stanie porusza si o wiele szybciej, jak si tylko przyzwyczaisz. Naprawd! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 1.2.: WYCHODZENIE Z VIM-a !! UWAGA: Przed wykonaniem jakiegokolwiek polecenia przeczytaj ca lekcj !! 1. Wcinij (aby upewni si, e jeste w trybie Normal). 2. Wpisz: :q!. To spowoduje wyjcie z edytora PORZUCAJC wszelkie zmiany, jakie zdye zrobi. Jeli chcesz zapamita zmiany i wyj, wpisz: :wq 3. Kiedy widzisz znak zachty powoki wpisz komend, eby wrci do tutoriala. Czyli: vimtutor 4. Jeli chcesz zapamita polecenia, wykonaj kroki 1. do 3., aby wyj i wrci do edytora. UWAGA: :q! porzuca wszelkie zmiany jakie zrobie. W nastpnych lekcjach dowiesz si jak je zapamitywa. 5. Przenie kursor do lekcji 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 1.3.: EDYCJA TEKSTU - KASOWANIE ** Wcinij x aby usun znak pod kursorem. ** 1. Przenie kursor do linii poniej oznaczonej --->. 2. By poprawi bdy, naprowad kursor na znak do usunicia. 3. Wcinij x aby usun niechciany znak. 4. Powtarzaj kroki 2. do 4. dopki zdanie nie jest poprawne. ---> Kkrowa prrzeskoczya prrzez ksiiycc. 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) ** Wcinij i aby wstawi tekst. ** 1. Przenie kursor do pierwszej linii poniej oznaczonej --->. 2. Aby poprawi pierwszy wiersz, ustaw kursor na pierwszym znaku PO tym, gdzie tekst ma by wstawiony. 3. Wcinij i a nastpnie wpisz konieczne poprawki. 4. Po poprawieniu bdu wcinij , by wrci do trybu Normal. Powtarzaj kroki 2. do 4., aby poprawi cae zdanie. ---> W tej brkje troch . ---> W tej linii brakuje troch tekstu. 5. Kiedy czujesz si swobodnie wstawiajc tekst, przejd do podsumowania poniej. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 1.5.: EDYCJA TEKSTU - APPENDING (dodawanie) ** Wcinij A by doda tekst. ** 1. Przenie kursor do pierwszej linii poniej oznaczonej --->. Nie ma znaczenia, ktry to bdzie znak. 2. Wcinij A i wpisz odpowiednie dodatki. 3. Kiedy tekst zosta dodany, wcinij i wr do trybu Normalnego. 4. Przenie kursor do drugiej linii oznaczonej ---> i powtrz kroki 2. i 3., aby poprawi zdanie. ---> Brakuje tu tro Brakuje tu troch tekstu. ---> Tu te troch bra Tu te troch brakuje. 5. Kiedy ju utrwalie wiczenie, przejd do lekcji 1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 1.6.: EDYCJA PLIKU ** Uyj :wq aby zapisa plik i wyj. ** !! UWAGA: zanim wykonasz jakiekolwiek polecenia przeczytaj ca lekcj !! 1. Zakocz tutorial tak jak w lekcji 1.2.: :q! lub, jeli masz dostp do innego terminala, wykonaj kolejne kroki tam. 2. W powoce wydaj polecenie: vim tutor "vim" jest poleceniem uruchamiajcym edytor Vim. 'tutor' to nazwa pliku, jaki chcesz edytowa. Uyj pliku, ktry moe zosta zmieniony. 3. Dodaj i usu tekst tak, jak si nauczye w poprzednich lekcjach. 4. Zapisz plik ze zmianami i opu Vima: :wq 5. Jeli zakoczye vimtutor w kroku 1., uruchom go ponownie i przejd do podsumowania poniej. 6. Po przeczytaniu wszystkich krokw i ich zrozumieniu: wykonaj je. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCJA 1. PODSUMOWANIE 1. Poruszasz kursorem uywajc "strzaek" i klawiszy hjkl . h (w lewo) j (w d) k (do gry) l (w prawo) 2. By wej do Vima, (z powoki) wpisz: vim NAZWA_PLIKU 3. By wyj z Vima, wpisz: :q! by usun wszystkie zmiany. LUB: :wq by zmiany zachowa. 4. By usun znak pod kursorem, wcinij: x 5. By wstawi tekst przed kursorem lub doda: i wpisz tekst wstawi przed kursorem A wpisz tekst doda na kocu linii UWAGA: Wcinicie przeniesie Ci z powrotem do trybu Normal lub odwoa niechciane lub czciowo wprowadzone polecenia. Teraz moemy kontynuowa i przej do Lekcji 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 2.1.: POLECENIE DELETE (usuwanie) ** Wpisz dw by usun wyraz. ** 1. Wcinij , by upewni si, e jeste w trybie Normal. 2. Przenie kursor do linii poniej oznaczonej --->. 3. Przesu kursor na pocztek wyrazu, ktry chcesz usun. 4. Wpisz dw by usun wyraz. UWAGA: Litera d pojawi si na dole ekranu. Vim czeka na wpisanie w . Jeli zobaczysz inny znak, oznacza to, e wpisae co le; wcinij i zacznij od pocztku. ---> Jest tu par papier wyrazw, ktre kamie nie nale do noyce tego zdania. 5. Powtarzaj kroki 3. i 4. dopki zdanie nie bdzie poprawne, potem przejd do Lekcji 2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 2.2.: WICEJ POLECE USUWAJCYCH ** Wpisz d$ aby usun tekst do koca linii. ** 1. Wcinij aby si upewni, e jeste w trybie Normal. 2. Przenie kursor do linii poniej oznaczonej --->. 3. Przenie kursor do koca 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 stao. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 2.3.: O OPERATORACH I RUCHACH Wiele polece zmieniajcych tekst jest zoonych z operatora i ruchu. Format dla polecenia usuwajcego z operatorem d jest nastpujcy: d ruch gdzie: d - operator usuwania. ruch - na czym polecenie bdzie wykonywane (lista poniej). Krtka lista ruchw: w - do pocztku nastpnego wyrazu WYCZAJC pierwszy znak. e - do koca biecego wyrazu, WCZAJC ostatni znak. $ - do koca linii, WCZAJC ostatni znak. W ten sposb wpisanie de usunie znaki od kursora do koca wyrazu. UWAGA: Wpisanie tylko ruchu w trybie Normal bez operatora przeniesie kursor tak, jak to okrelono. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 2.4.: UYCIE MNONIKA DLA RUCHU ** Wpisanie liczby przed ruchem powtarza ruch odpowiedni ilo razy. ** 1. Przenie kursor na pocztek linii poniej zaznaczonej --->. 2. Wpisz 2w aby przenie kursor o dwa wyrazy do przodu. 3. Wpisz 3e aby przenie kursor do koca trzeciego wyrazu w przd. 4. Wpisz 0 (zero), aby przenie kursor na pocztek linii. 5. Powtrz kroki 2. i 3. z innymi liczbami. ---> To jest zwyky wiersz z wyrazami, po ktrych moesz si porusza. 6. Przejd do lekcji 2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 2.5.: UYCIE MNONIKA, BY WICEJ USUN ** Wpisanie liczby z operatorem powtarza go odpowiedni ilo razy. ** W wyej wspomnianej kombinacji operatora usuwania i ruchu podaj mnonik przed ruchem, by wicej usun: d liczba ruch 1. Przenie kursor do pierwszego wyrazu KAPITALIKAMI w linii zaznaczonej --->. 2. Wpisz 2dw aby usun dwa wyrazy KAPITALIKAMI. 3. Powtarzaj kroki 1. i 2. z innymi mnonikami, aby usun kolejne wyrazy KAPITALIKAMI jednym poleceniem ---> ta ASD WE linia QWE ASDF ZXCV FG wyrazw zostaa ERT FGH CF oczyszczona. UWAGA: Mnonik pomidzy operatorem d i ruchem dziaa podobnie do ruchu bez operatora. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 2.6.: OPEROWANIE NA LINIACH ** Wpisz dd aby usun ca lini. ** Z powodu czstoci usuwania caych linii, projektanci Vi zdecydowali, e bdzie atwiej wpisa dwa razy d aby usun lini. 1. Przenie kursor do drugiego zdania z wierszyka poniej. 2. Wpisz dd aby usun wiersz. 3. Teraz przenie si do czwartego wiersza. 4. Wpisz 2dd aby usun dwa wiersze. ---> 1) Re s czerwone, ---> 2) Boto jest fajne, ---> 3) Fioki s niebieskie, ---> 4) Mam samochd, ---> 5) Zegar podaje czas, ---> 6) Cukier jest sodki, ---> 7) I ty te. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 2.7.: POLECENIE UNDO (cofnij) ** Wcinij u aby cofn skutki ostatniego polecenia. U za, by cofn skutki dla caej linii. ** 1. Przenie kursor do zdania poniej oznaczonego ---> i umie go na pierwszym bdzie. 2. Wpisz x aby usun pierwszy niechciany znak. 3. Teraz wcinij u aby cofn skutki ostatniego polecenia. 4. Tym razem popraw wszystkie bdy w linii uywajc polecenia x . 5. Teraz wcinij wielkie U aby przywrci lini do oryginalnego stanu. 6. Teraz wcinij u kilka razy, by cofn U i poprzednie polecenia. 7. Teraz wpisz CTRL-R (trzymaj rwnoczenie wcinite klawisze CTRL i R) kilka razy, by cofn cofnicia. ---> Poopraw bdyyy w teej liniii i zaamiie je prrzez coofnij. 8. To s bardzo poyteczne polecenia. Przejd teraz do podsumowania Lekcji 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCJA 2. PODSUMOWANIE 1. By usun znaki od kursora do nastpnego wyrazu, wpisz: dw 2. By usun znaki od kursora do koca linii, wpisz: d$ 3. By usun ca lini: dd 4. By powtrzy ruch, poprzed go liczb: 2w 5. Format polecenia zmiany to: operator [liczba] ruch gdzie: operator - to, co trzeba zrobi (np. d dla usuwania) [liczba] - opcjonalne, ile razy powtrzy ruch ruch - przenosi nad tekstem do operowania, takim jak w (wyraz), $ (do koca linii) etc. 6. By przej do pocztku linii, uyj zera: 0 7. By cofn poprzednie polecenie, wpisz: u (mae u) By cofn wszystkie zmiany w linii, wpisz: U (wielkie U) By cofn cofnicie, wpisz: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 3.1.: POLECENIE PUT (wstaw) ** Wpisz p by wstawi ostatnie usunicia za kursorem. ** 1. Przenie kursor do pierwszej linii ---> poniej. 2. Wpisz dd aby usun lini i przechowa j w rejestrze Vima. 3. Przenie kursor do linii c), POWYEJ tej, gdzie usunita linia powinna si znajdowa. 4. Wcinij p by wstawi lini poniej kursora. 5. Powtarzaj kroki 2. do 4. a znajd si w odpowiednim porzdku. ---> d) Jak dwa anioki. ---> b) Na dole fioki, ---> c) A my si kochamy, ---> a) Na grze re, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 3.2.: POLECENIE REPLACE (zastp) ** Wpisz rx aby zastpi znak pod kursorem na x . ** 1. Przenie kursor do pierwszej linii poniej oznaczonej ---> 2. Ustaw kursor na pierwszym bdzie. 3. Wpisz r a potem znak jaki powinien go zastpi. 4. Powtarzaj kroki 2. i 3. dopki pierwsza linia nie bdzie taka, jak druga. ---> Kjedy ten wiersz bi wstkiwany, kto wcizn per zych klawirzy! ---> Kiedy ten wiersz by wstukiwany, kto wcisn par zych klawiszy! 5. Teraz czas na Lekcj 3.3. UWAGA: Pamitaj, by uczy si wiczc, a nie pamiciowo. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 3.3.: OPERATOR CHANGE (zmie) ** By zmieni do koca wyrazu, wpisz ce . ** 1. Przenie kursor do pierwszej linii poniej oznaczonej --->. 2. Umie kursor na u w lunos. 3. Wpisz ce i popraw wyraz (w tym wypadku wstaw inia ). 4. Wcinij i przejd do nastpnej planowanej zmiany. 5. Powtarzaj kroki 3. i 4. dopki pierwsze zdanie nie bdzie takie same, jak drugie. ---> Ta lunos ma pire sw, ktre tina zbnic uifajonc pcmazu zmie. ---> Ta linia ma par sw, ktre trzeba zmieni uywajc polecenia zmie. Zauwa, e ce nie tylko zamienia wyraz, ale take zmienia tryb na Insert (wprowadzanie). ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 3.4.: WICEJ ZMIAN UYWAJC c ** Polecenie change uywa takich samych ruchw, jak delete. ** 1. Operator change dziaa tak samo, jak delete. Format wyglda tak: c [liczba] ruch 2. Ruchy s take takie same, np.: w (wyraz), $ (koniec linii) etc. 3. Przenie si do pierwszej linii poniej oznaczonej ---> 4. Ustaw kursor na pierwszym bdzie. 5. Wpisz c$ , popraw koniec wiersza i wcinij . ---> Koniec tego wiersza musi by poprawiony, aby wyglda tak, jak drugi. ---> Koniec tego wiersza musi by poprawiony uywajc polecenia c$ . UWAGA: Moesz uywa aby poprawia bdy w czasie pisania. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCJA 3. PODSUMOWANIE 1. Aby wstawi tekst, ktry zosta wczeniej usunity wcinij p . To polecenie wstawia skasowany tekst PO kursorze (jeli caa linia zostaa usunita, zostanie ona umieszczona w linii poniej kursora). 2. By zamieni znak pod kursorem, wcinij r a potem znak, ktry ma zastpi oryginalny. 3. Operator change pozwala Ci na zastpienie od kursora do miejsca, gdzie zabraby Ci ruch. Np. wpisz ce aby zamieni tekst od kursora do koca wyrazu, c$ aby zmieni tekst do koca linii. 4. Format do polecenia change (zmie): c [liczba] obiekt Teraz przejd do nastpnej lekcji. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 4.1.: POOENIE KURSORA ORAZ STATUS PLIKU ** Nacinij CTRL-G aby zobaczy swoje pooenie w pliku i status pliku. Nacinij G aby przej do linii w pliku. ** UWAGA: Przeczytaj ca lekcj zanim wykonasz jakie polecenia!!! 1. Przytrzymaj klawisz CTRL i wcinij g . Uywamy notacji CTRL-G. Na dole strony pojawi si pasek statusu z nazw pliku i pozycj w pliku. Zapamitaj numer linii dla potrzeb kroku 3. UWAGA: Moesz te zobaczy pozycj kursora w prawym, dolnym rogu ekranu. Dzieje si tak kiedy ustawiona jest opcja 'ruler' (wicej w lekcji 6.). 2. Wcinij G aby przej na koniec pliku. Wcinij gg aby przej do pocztku pliku. 3. Wpisz numer linii, w ktrej bye a potem G . To przeniesie Ci z powrotem do linii, w ktrej bye kiedy wcisne CTRL-G. 4. Jeli czujesz si wystarczajco pewnie, wykonaj kroki 1-3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 4.2.: POLECENIE SZUKAJ ** Wpisz / a nastpnie wyraenie, 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 bond . To jest sowo, ktrego chcesz szuka. 3. By szuka tej samej frazy ponownie, po prostu wcinij n . Aby szuka tej frazy w przeciwnym, kierunku wcinij N . 4. Jeli chcesz szuka frazy do tyu, uyj polecenia ? zamiast / . 5. Aby wrci gdzie bye, wcinij CTRL-O. Powtarzaj, by wrci dalej. CTRL-I idzie do przodu. Uwaga: 'bond' to nie jest metoda, by przeliterowa bd; 'bond' to bd. Uwaga: Kiedy szukanie osignie koniec pliku, bdzie kontynuowane od pocztku o ile opcja 'wrapscan' nie zostaa przestawiona. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 4.3.: W POSZUKIWANIU PARUJCYCH NAWIASW ** Wpisz % by znale parujcy ), ], lub } . ** 1. Umie kursor na ktrym z (, [, lub { w linii poniej oznaczonej --->. 2. Teraz wpisz znak % . 3. Kursor powinien si znale na parujcym nawiasie. 4. Wcinij % aby przenie kursor z powrotem do parujcego nawiasu. 5. Przenie kursor do innego (,),[,],{ lub } i zobacz co robi % . ---> To ( jest linia testowa z (, [, ] i {, } . )) Uwaga: Ta funkcja jest bardzo uyteczna w debuggowaniu programu z niesparowanymi nawiasami! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 4.4.: POLECENIE SUBSTITUTE (zamiana) ** Wpisz :s/stary/nowy/g aby zamieni 'stary' na 'nowy'. ** 1. Przenie kursor do linii poniej oznaczonej --->. 2. Wpisz :s/czaas/czas . Zauwa, e to polecenie zmienia tylko pierwsze wystpienie 'czaas' w linii. 3. Teraz wpisz :s/czaas/czas/g . Dodane g oznacza zamian (substytucj) globalnie w caej linii. Zmienia wszystkie wystpienia 'czaas' w linii. ---> Najlepszy czaas na zobaczenie najadniejszych kwiatw to czaas wiosny. 4. Aby zmieni wszystkie wystpienia acucha znakw pomidzy dwoma liniami, wpisz: :#,#s/stare/nowe/g gdzie #,# s numerami linii ograniczajcych region, gdzie ma nastpi zamiana. wpisz :%s/stare/nowe/g by zmieni wszystkie wystpienia w caym pliku. wpisz :%s/stare/nowe/gc by zmieni wszystkie wystpienia w caym pliku, proszc o potwierdzenie za kadym razem. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCJA 4. PODSUMOWANIE 1. CTRL-G pokae Twoj pozycj w pliku i status pliku. SHIFT-G przenosi Ci do koca pliku. G przenosi do koca pliku. liczba G przenosi do linii [liczba]. gg przenosi do pierwszej linii. 2. Wpisanie / a nastpnie acucha znakw szuka acucha DO PRZODU. Wpisanie ? a nastpnie acucha znakw szuka acucha DO TYU. Po wyszukiwaniu wcinij n by znale nastpne wystpienie szukanej frazy w tym samym kierunku lub N by szuka w kierunku przeciwnym. CTRL-O przenosi do starszych pozycji, CTRL-I do nowszych. 3. Wpisanie % gdy kursor znajduje si na (,),[,],{, lub } lokalizuje parujcy 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 pomidzy dwoma liniami # wpisz :#,#s/stary/nowy/g By zamieni wszystkie wystpienia w pliku, wpisz :%s/stary/nowy/g By Vim prosi Ci o potwierdzenie, dodaj 'c' :%s/stary/nowy/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 5.1.: JAK WYKONA POLECENIA ZEWNTRZNE? ** Wpisz :! a nastpnie zewntrzne polecenie, by je wykona. ** 1. Wpisz znajome polecenie : by ustawi kursor na dole ekranu. To pozwala na wprowadzenie komendy linii polece. 2. Teraz wstaw ! (wykrzyknik). To umoliwi Ci wykonanie dowolnego zewntrznego polecenia powoki. 3. Jako przykad wpisz ls za ! a nastpnie wcinij . To polecenie pokae spis plikw w Twoim katalogu, tak jakby by przy znaku zachty powoki. Moesz te uy :!dir jeli ls nie dziaa. Uwaga: W ten sposb mona wykona wszystkie polecenia powoki. Uwaga: Wszystkie polecenia : musz by zakoczone . Od tego momentu nie zawsze bdziemy o tym wspomina. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 5.2.: WICEJ O ZAPISYWANIU PLIKW ** By zachowa zmiany w tekcie, wpisz :w NAZWA_PLIKU . ** 1. Wpisz :!dir lub :!ls by zobaczy spis plikw w katalogu. Ju wiesz, e musisz po tym wcisn . 2. Wybierz nazw pliku, jaka jeszcze nie istnieje, np. TEST. 3. Teraz wpisz: :w TEST (gdzie TEST jest nazw pliku jak wybrae.) 4. To polecenie zapamita cay plik (Vim Tutor) pod nazw TEST. By to sprawdzi, wpisz :!dir lub :!ls eby znowu zobaczy list plikw. Uwaga: Zauwa, e gdyby teraz wyszed z Vima, a nastpnie wszed ponownie poleceniem vim TEST , plik byby dokadn kopi tutoriala, kiedy go zapisywae. 5. Teraz usu plik wpisujc (MS-DOS): :!del TEST lub (Unix): :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 5.3.: WYBRANIE TEKSTU DO ZAPISU ** By zachowa cz pliku, wpisz v ruch :w NAZWA_PLIKU ** 1. Przenie kursor do tego wiersza. 2. Wcinij v i przenie kursor do punktu 5. Zauwa, e tekst zosta podwietlony. 3. Wcinij znak : . Na dole ekranu pojawi si :'<,'> . 4. Wpisz w TEST , gdzie TEST to nazwa pliku, ktry jeszcze nie istnieje. Upewnij si, e widzisz :'<,'>w TEST zanim wciniesz Enter. 5. Vim zapisze wybrane linie do pliku TEST. Uyj :!dir lub :!ls , eby to zobaczy. Jeszcze go nie usuwaj! Uyjemy go w nastpnej lekcji. UWAGA: Wcinicie v zaczyna tryb Wizualny. Moesz porusza kursorem, by zmieni rozmiary zaznaczenia. Moesz te uy operatora, by zrobi co z tekstem. Na przykad d usuwa tekst. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 5.4.: WSTAWIANIE I CZENIE PLIKW ** By wstawi zawarto pliku, wpisz :r NAZWA_PLIKU ** 1. Umie kursor tu powyej tej linii. UWAGA: Po wykonaniu kroku 2. zobaczysz tekst z Lekcji 5.3. Potem przejd do DOU, by zobaczy ponownie t lekcj. 2. Teraz wczytaj plik TEST uywajc polecenia :r TEST , gdzie TEST jest nazw pliku. Wczytany plik jest umieszczony poniej linii z kursorem. 3. By sprawdzi czy plik zosta wczytany, cofnij kursor i zobacz, e teraz s dwie kopie Lekcji 5.3., orygina i kopia z pliku. UWAGA: Moesz te wczyta wyjcie zewntrznego polecenia. Na przykad :r !ls wczytuje wyjcie polecenia ls i umieszcza je pod poniej kursora. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCJA 5. PODSUMOWANIE 1. :!polecenie wykonuje polecenie zewntrzne. Uytecznymi przykadami s: :!dir - pokazuje spis plikw w katalogu. :!rm NAZWA_PLIKU - usuwa plik NAZWA_PLIKU. 2. :w NAZWA_PLIKU zapisuje obecny plik Vima na dysk z nazw NAZWA_PLIKU. 3. v ruch :w NAZWA_PLIKU zapisuje Wizualnie wybrane linie do NAZWA_PLIKU. 4. :r NAZWA_PLIKU wczytuje z dysku plik NAZWA_PLIKU i wstawia go do biecego pliku poniej kursora. 5. :r !dir wczytuje wyjcie polecenia dir i umieszcza je poniej kursora. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 6.1.: POLECENIE OPEN (otwrz) ** Wpisz o by otworzy lini poniej kursora i przenie si do trybu Insert (wprowadzanie). ** 1. Przenie kursor do linii poniej oznaczonej --->. 2. Wpisz o (mae), by otworzy lini PONIEJ kursora i przenie si do trybu Insert (wprowadzanie). 3. Wpisz troch tekstu i wcinij by wyj z trybu Insert (wprowadzanie). ---> Po wciniciu o kursor znajdzie si w otwartej linii w trybie Insert. 4. By otworzy lini POWYEJ kursora, wcinij wielkie O zamiast maego o . Wyprbuj to na linii poniej. ---> Otwrz lini powyej wciskajc SHIFT-O gdy kursor bdzie na tej linii. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 6.2.: POLECENIE APPEND (dodaj) ** Wpisz a by doda tekst ZA kursorem. ** 1. Przenie kursor do pocztku pierwszej linii poniej oznaczonej ---> 2. Wciskaj e dopki kursor nie bdzie na kocu li . 3. Wpisz a (mae), aby doda tekst ZA znakiem pod kursorem. 4. Dokocz wyraz tak, jak w linii poniej. Wcinij aby opuci tryb Insert. 5. Uyj e by przej do kolejnego niedokoczonego wyrazu i powtarzaj kroki 3. i 4. ---> Ta li poz Ci wi dodaw teks do ko lin ---> Ta linia pozwoli Ci wiczy dodawanie tekstu do koca linii. Uwaga: a , i oraz A prowadz do trybu Insert, jedyn rnic jest miejsce, gdzie nowe znaki bd dodawane. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 6.3.: INNA WERSJA REPLACE (zamiana) ** Wpisz wielkie R by zamieni wicej ni jeden znak. ** 1. Przenie kursor do pierwszej linii poniej oznaczonej --->. Przenie kursor do pierwszego xxx . 2. Wcinij R i wpisz numer poniej w drugiej linii, tak, e zastpi on xxx. 3. Wcinij by opuci tryb Replace. Zauwa, e reszta linii pozostaje niezmieniona. 5. Powtarzaj kroki by wymieni wszystkie xxx. ---> Dodanie 123 do xxx daje xxx. ---> Dodanie 123 do 456 daje 579. UWAGA: Tryb Replace jest jak tryb Insert, ale kady znak usuwa istniejcy znak. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 6.4.: KOPIOWANIE I WKLEJANIE TEKSTU ** uyj operatora y aby skopiowa tekst i p aby go wklei ** 1. Przejd do linii oznaczonej ---> i umie kursor za "a)". 2. Wejd w tryb Wizualny v i przenie kursor na pocztek "pierwszy". 3. Wcinij y aby kopiowa (yankowa) podwietlony tekst. 4. Przenie kursor do koca nastpnej linii: j$ 5. Wcinij p aby wklei (wpakowa) tekst. Dodaj: a drugi . 6. Uyj trybu Wizualnego, aby wybra " element.", yankuj go y , przejd do koca nastpnej linii j$ i upakuj tam tekst z p . ---> a) to jest pierwszy element. b) Uwaga: moesz uy y jako operatora; yw kopiuje jeden wyraz. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 6.5.: USTAWIANIE OPCJI ** Ustawianie opcji tak, by szukaj lub substytucja ignoroway wielko liter ** 1. Szukaj 'ignore' wpisujc: /ignore Powtrz szukanie kilka razy naciskajc klawisz n . 2. Ustaw opcj 'ic' (Ignore case -- ignoruj wielko liter) poprzez wpisanie: :set ic 3. Teraz szukaj 'ignore' ponownie wciskajc: n Zauwa, e Ignore i IGNORE take s teraz znalezione. 4. Ustaw opcje 'hlsearch' i 'incsearch': :set hls is 5. Teraz wprowad polecenie szukaj ponownie i zobacz co si zdarzy: /ignore 6. Aby wyczy ignorowanie wielkoci liter: :set noic Uwaga: Aby usun podwietlanie dopasowa, wpisz: :nohlsearch Uwaga: Aby ignorowa wielko liter dla jednego wyszukiwania: /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCJA 6. PODSUMOWANIE 1. Wpisanie o otwiera lini PONIEJ kursora. Wpisanie O otwiera lini POWYEJ kursora. 2. Wpisanie a wstawia tekst ZA znakiem, na ktrym jest kursor. Wpisanie A dodaje tekst na kocu linii. 3. Polecenie e przenosi do koca wyrazu. 4. Operator y yankuje (kopiuje) tekst, p pakuje (wkleja) go. 5. Wpisanie wielkiego R wprowadza w tryb Replace (zamiana) dopki nie zostanie wcinity . 6. Wpisanie ":set xxx" ustawia opcj "xxx". Niektre opcje: 'ic' 'ignorecase' ignoruj wielko znakw 'is' 'incsearch' poka czciowe dopasowania 'hls' 'hlsearch' podwietl wszystkie dopasowania Moesz uy zarwno dugiej, jak i krtkiej formy. 7. Dodaj "no", aby wyczy opcj: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCJA 7.1. JAK UZYSKA POMOC? ** Uycie systemu pomocy on-line ** Vim posiada bardzo dobry system pomocy on-line. By zacz, sprbuj jednej z trzech moliwoci: - wcinij klawisz (jeli taki masz) - wcinij klawisz (jeli taki masz) - wpisz :help Przeczytaj tekst w oknie pomocy, aby dowiedzie si jak dziaa pomoc. wpisz CTRL-W CTRL-W aby przeskoczy z jednego okna do innego wpisz :q aby zamkn okno pomocy. Moesz te znale pomoc na kady temat podajc argument polecenia ":help". Sprbuj tych (nie zapomnij wcisn ): :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCJA 7.2. TWORZENIE SKRYPTU STARTOWEGO ** Wcz moliwoci Vima ** Vim ma o wiele wicej moliwoci ni Vi, ale wikszo z nich jest domylnie wyczona. Jeli chcesz wczy te moliwoci na starcie musisz utworzy plik "vimrc". 1. Pocztek edycji pliku "vimrc" zaley od Twojego systemu: :edit ~/.vimrc dla Uniksa :edit $VIM/_vimrc dla MS-Windows 2. Teraz wczytaj przykadowy plik "vimrc": :read $VIMRUNTIME/vimrc_example.vim 3. Zapisz plik: :w Nastpnym razem, gdy zaczniesz prac w Vimie bdzie on uywa podwietlania skadni. Moesz doda wszystkie swoje ulubione ustawienia do tego pliku "vimrc". Aby uzyska wicej informacji, wpisz :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 7.3.: UZUPENIANIE ** Uzupenianie linii polece z CTRL-D i ** 1. Upewnij si, e Vim nie jest w trybie kompatybilnoci: :set nocp 2. Zerknij, jakie pliki s w biecym katalogu: :!ls lub :!dir 3. Wpisz pocztek polecenia: :e 4. Wcinij CTRL-D i Vim pokae list polece, jakie zaczynaj si na "e". 5. Wcinij i Vim uzupeni polecenie do ":edit". 6. Dodaj spacj i zacznij wpisywa nazw istniejcego pliku: :edit FIL 7. Wcinij . Vim uzupeni nazw (jeli jest niepowtarzalna). UWAGA: Uzupenianie dziaa dla wielu polece. Sprbuj wcisn CTRL-D i . Uyteczne zwaszcza przy :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 7. PODSUMOWANIE 1. Wpisz :help albo wcinij lub aby otworzy okno pomocy. 2. Wpisz :help cmd aby uzyska pomoc o cmd . 3. Wpisz CTRL-W CTRL-W aby przeskoczy do innego okna. 4. Wpisz :q aby zamkn okno pomocy. 5. Utwrz plik startowy vimrc aby zachowa wybrane ustawienia. 6. Po poleceniu : , wcinij CTRL-D aby zobaczy moliwe uzupenienia. Wcinij aby uy jednego z nich. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tutaj si koczy tutorial Vima. Zosta on pomylany tak, aby da krtki przegld jego moliwoci, wystarczajcy by mg go uywa. Jest on daleki od kompletnoci, poniewa Vim ma o wiele, wiele wicej polece. Dla dalszej nauki rekomendujemy ksik: Vim - Vi Improved - autor Steve Oualline Wydawca: New Riders Pierwsza ksika cakowicie powicona Vimowi. Uyteczna zwaszcza dla pocztkujcych. Zawiera wiele przykadw i ilustracji. Zobacz http://iccf-holland.org./click5.html Starsza pozycja i bardziej o Vi ni o Vimie, ale take warta polecenia: Learning the Vi Editor - autor Linda Lamb Wydawca: O'Reilly & Associates Inc. To dobra ksika, by dowiedzie si niemal wszystkiego, co chciaby zrobi z Vi. Szsta edycja zawiera te informacje o Vimie. 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 ksieczka zawierajca spis polece vi i jego najwaniejszych klonw (midzy innymi Vima). 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 tumaczeniu. Ten tutorial zosta napisany przez Michaela C. Pierce'a i Roberta K. Ware'a, Colorado School of Mines korzystajc z pomocy Charlesa Smitha, Colorado State University. E-mail: bware@mines.colorado.edu. Zmodyfikowane dla Vima przez Brama Moolenaara. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Przetumaczone przez Mikoaja Machowskiego, Sierpie 2001, rev. Marzec 2002 2nd rev. Wrzesie 2004 3rd rev. Marzec 2006 4th rev. Grudzie 2008 Wszelkie uwagi prosz kierowa na: mikmach@wp.pl vim-7.4.1689/runtime/tutor/tutor.pl.utf-8000066400000000000000000001051731267703067000201200ustar00rootroot00000000000000=============================================================================== = W i t a j w t u t o r i a l u V I M - a - Wersja 1.7. = =============================================================================== 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ć Vima 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. UWAGA: 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). Pamiętaj, że przewodnik ten został zaprojektowany do nauki poprzez ćwiczenia. Oznacza to, ż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 Caps Locka 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 , 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. Naprawdę! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 1.2.: WYCHODZENIE Z VIM-a !! UWAGA: Przed wykonaniem jakiegokolwiek polecenia przeczytaj całą lekcję !! 1. Wciśnij (aby upewnić się, że jesteś w trybie Normal). 2. Wpisz: :q!. To spowoduje wyjście z edytora PORZUCAJĄC wszelkie zmiany, jakie zdążyłeś zrobić. Jeśli chcesz zapamiętać zmiany i wyjść, wpisz: :wq 3. Kiedy widzisz znak zachęty powłoki wpisz komendę, żeby wrócić do tutoriala. Czyli: vimtutor 4. Jeśli chcesz zapamiętać polecenia, wykonaj kroki 1. do 3., aby wyjść i wrócić do edytora. UWAGA: :q! porzuca wszelkie zmiany jakie zrobiłeś. W następnych lekcjach dowiesz się jak je zapamiętywać. 5. Przenieś kursor do lekcji 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 1.3.: EDYCJA TEKSTU - KASOWANIE ** 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) ** 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 , 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.5.: EDYCJA TEKSTU - APPENDING (dodawanie) ** Wciśnij A by dodać tekst. ** 1. Przenieś kursor do pierwszej linii poniżej oznaczonej --->. Nie ma znaczenia, który to będzie znak. 2. Wciśnij A i wpisz odpowiednie dodatki. 3. Kiedy tekst został dodany, wciśnij i wróć do trybu Normalnego. 4. Przenieś kursor do drugiej linii oznaczonej ---> i powtórz kroki 2. i 3., aby poprawić zdanie. ---> Brakuje tu tro Brakuje tu trochę tekstu. ---> Tu też trochę bra Tu też trochę brakuje. 5. Kiedy już utrwaliłeś ćwiczenie, przejdź do lekcji 1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 1.6.: EDYCJA PLIKU ** Użyj :wq aby zapisać plik i wyjść. ** !! UWAGA: zanim wykonasz jakiekolwiek polecenia przeczytaj całą lekcję !! 1. Zakończ tutorial tak jak w lekcji 1.2.: :q! lub, jeśli masz dostęp do innego terminala, wykonaj kolejne kroki tam. 2. W powłoce wydaj polecenie: vim tutor "vim" jest poleceniem uruchamiającym edytor Vim. 'tutor' to nazwa pliku, jaki chcesz edytować. Użyj pliku, który może zostać zmieniony. 3. Dodaj i usuń tekst tak, jak się nauczyłeś w poprzednich lekcjach. 4. Zapisz plik ze zmianami i opuść Vima: :wq 5. Jeśli zakończyłeś vimtutor w kroku 1., uruchom go ponownie i przejdź do podsumowania poniżej. 6. Po przeczytaniu wszystkich kroków i ich zrozumieniu: wykonaj je. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 Vima, (z powłoki) wpisz: vim NAZWA_PLIKU 3. By wyjść z Vima, wpisz: :q! by usunąć wszystkie zmiany. LUB: :wq by zmiany zachować. 4. By usunąć znak pod kursorem, wciśnij: x 5. By wstawić tekst przed kursorem lub dodać: i wpisz tekst wstawi przed kursorem A wpisz tekst doda na końcu linii UWAGA: Wciśnięcie 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ąć wyraz. ** 1. Wciśnij , by upewnić się, że jesteś w trybie Normal. 2. Przenieś kursor do linii poniżej oznaczonej --->. 3. Przesuń kursor na początek wyrazu, który chcesz usunąć. 4. Wpisz dw by usunąć wyraz. UWAGA: Litera d pojawi się na dole ekranu. Vim czeka na wpisanie w . Jeśli zobaczysz inny znak, oznacza to, że wpisałeś coś źle; wciśnij 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 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 OPERATORACH I RUCHACH Wiele poleceń zmieniających tekst jest złożonych z operatora i ruchu. Format dla polecenia usuwającego z operatorem d jest następujący: d ruch gdzie: d - operator usuwania. ruch - na czym polecenie będzie wykonywane (lista poniżej). Krótka lista ruchów: w - do początku następnego wyrazu WYŁĄCZAJĄC pierwszy znak. e - do końca bieżącego wyrazu, WŁĄCZAJĄC ostatni znak. $ - do końca linii, WŁĄCZAJĄC ostatni znak. W ten sposób wpisanie de usunie znaki od kursora do końca wyrazu. UWAGA: Wpisanie tylko ruchu w trybie Normal bez operatora przeniesie kursor tak, jak to określono. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 2.4.: UŻYCIE MNOŻNIKA DLA RUCHU ** Wpisanie liczby przed ruchem powtarza ruch odpowiednią ilość razy. ** 1. Przenieś kursor na początek linii poniżej zaznaczonej --->. 2. Wpisz 2w aby przenieść kursor o dwa wyrazy do przodu. 3. Wpisz 3e aby przenieść kursor do końca trzeciego wyrazu w przód. 4. Wpisz 0 (zero), aby przenieść kursor na początek linii. 5. Powtórz kroki 2. i 3. z innymi liczbami. ---> To jest zwykły wiersz z wyrazami, po których możesz się poruszać. 6. Przejdź do lekcji 2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 2.5.: UŻYCIE MNOŻNIKA, BY WIĘCEJ USUNĄĆ ** Wpisanie liczby z operatorem powtarza go odpowiednią ilość razy. ** W wyżej wspomnianej kombinacji operatora usuwania i ruchu podaj mnożnik przed ruchem, by więcej usunąć: d liczba ruch 1. Przenieś kursor do pierwszego wyrazu KAPITALIKAMI w linii zaznaczonej --->. 2. Wpisz 2dw aby usunąć dwa wyrazy KAPITALIKAMI. 3. Powtarzaj kroki 1. i 2. z innymi mnożnikami, aby usunąć kolejne wyrazy KAPITALIKAMI jednym poleceniem ---> ta ASD WE linia QWE ASDF ZXCV FG wyrazów została ERT FGH CF oczyszczona. UWAGA: Mnożnik pomiędzy operatorem d i ruchem działa podobnie do ruchu bez operatora. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 2.6.: OPEROWANIE NA LINIACH ** Wpisz dd aby usunąć całą linię. ** Z powodu częstości usuwania całych linii, projektanci Vi zdecydowali, że będzie łatwiej wpisać dwa razy d aby usunąć linię. 1. Przenieś kursor do drugiego zdania z wierszyka poniżej. 2. Wpisz dd aby usunąć wiersz. 3. Teraz przenieś się do czwartego wiersza. 4. Wpisz 2dd aby usunąć dwa 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.7.: 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 wpisz CTRL-R (trzymaj równocześnie wciśnięte klawisze CTRL i R) kilka razy, by cofnąć cofnięcia. ---> Poopraw błę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 następnego wyrazu, wpisz: dw 2. By usunąć znaki od kursora do końca linii, wpisz: d$ 3. By usunąć całą linię: dd 4. By powtórzyć ruch, poprzedź go liczbą: 2w 5. Format polecenia zmiany to: operator [liczba] ruch gdzie: operator - to, co trzeba zrobić (np. d dla usuwania) [liczba] - opcjonalne, ile razy powtórzyć ruch ruch - przenosi nad tekstem do operowania, takim jak w (wyraz), $ (do końca linii) etc. 6. By przejść do początku linii, użyj zera: 0 7. By cofnąć poprzednie polecenie, wpisz: u (małe u) By cofnąć wszystkie zmiany w linii, wpisz: U (wielkie U) By cofnąć cofnięcie, wpisz: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 3.1.: POLECENIE PUT (wstaw) ** Wpisz p by wstawić ostatnie usunięcia za kursorem. ** 1. Przenieś kursor do pierwszej linii ---> poniżej. 2. Wpisz dd aby usunąć linię i przechować ją w rejestrze Vima. 3. Przenieś kursor do linii c), POWYŻEJ tej, gdzie usunięta linia powinna się znajdować. 4. Wciśnij p by wstawić linię poniżej kursora. 5. Powtarzaj 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 rx aby zastąpić znak pod kursorem na x . ** 1. Przenieś kursor do pierwszej linii poniżej oznaczonej ---> 2. Ustaw kursor na pierwszym błędzie. 3. Wpisz r a potem znak jaki powinien go zastąpić. 4. Powtarzaj kroki 2. i 3. dopóki pierwsza linia nie będzie taka, jak druga. ---> 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.: OPERATOR CHANGE (zmień) ** By zmienić do końca wyrazu, wpisz ce . ** 1. Przenieś kursor do pierwszej linii poniżej oznaczonej --->. 2. Umieść kursor na u w lunos. 3. Wpisz ce i popraw wyraz (w tym wypadku wstaw inia ). 4. Wciśnij i przejdź do następnej planowanej zmiany. 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 ce 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 ruchów, jak delete. ** 1. Operator change działa tak samo, jak delete. Format wygląda tak: c [liczba] ruch 2. Ruchy 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 . ---> Koniec tego wiersza musi być poprawiony, aby wyglądał tak, jak drugi. ---> Koniec tego wiersza musi być poprawiony używając polecenia c$ . UWAGA: Możesz używać aby poprawiać błędy w czasie pisania. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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. Operator change pozwala Ci na zastąpienie od kursora do miejsca, gdzie zabrałby Cię ruch. Np. wpisz ce aby zamienić tekst od kursora do końca wyrazu, c$ aby zmienić tekst do końca linii. 4. Format do polecenia change (zmień): c [liczba] obiekt Teraz przejdź do następnej lekcji. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 4.1.: POŁOŻENIE KURSORA ORAZ STATUS PLIKU ** Naciśnij CTRL-G aby zobaczyć swoje położenie w pliku i status pliku. Naciśnij G aby przejść do linii w pliku. ** UWAGA: Przeczytaj całą lekcję zanim wykonasz jakieś polecenia!!! 1. Przytrzymaj klawisz CTRL i wciśnij g . Używamy notacji CTRL-G. Na dole strony pojawi się pasek statusu z nazwą pliku i pozycją w pliku. Zapamiętaj numer linii dla potrzeb kroku 3. UWAGA: Możesz też zobaczyć pozycję kursora w prawym, dolnym rogu ekranu. Dzieje się tak kiedy ustawiona jest opcja 'ruler' (więcej w lekcji 6.). 2. Wciśnij G aby przejść na koniec pliku. Wciśnij gg aby przejść do początku pliku. 3. Wpisz numer linii, w której byłeś a potem G . To przeniesie Cię z powrotem do linii, w której byłeś kiedy wcisnąłeś CTRL-G. 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 . 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 N . 4. Jeśli chcesz szukać frazy do tyłu, użyj polecenia ? zamiast / . 5. Aby wrócić gdzie byłeś, wciśnij CTRL-O. Powtarzaj, by wrócić dalej. CTRL-I idzie do przodu. Uwaga: 'błond' to nie jest metoda, by przeliterować błąd; 'błond' to błąd. Uwaga: Kiedy szukanie osiągnie koniec pliku, będzie kontynuowane od początku o ile opcja 'wrapscan' nie została przestawiona. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 4.3.: W POSZUKIWANIU PARUJĄCYCH NAWIASÓW ** Wpisz % by znaleźć parują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. 5. Przenieś kursor do innego (,),[,],{ lub } i zobacz co robi % . ---> To ( jest linia testowa z (, [, ] i {, } . )) Uwaga: Ta funkcja jest bardzo użyteczna w debuggowaniu programu z niesparowanymi nawiasami! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 4.4.: POLECENIE SUBSTITUTE (zamiana) ** Wpisz :s/stary/nowy/g aby zamienić 'stary' na 'nowy'. ** 1. Przenieś kursor do linii poniżej oznaczonej --->. 2. Wpisz :s/czaas/czas . Zauważ, że to polecenie zmienia tylko pierwsze wystąpienie 'czaas' w linii. 3. Teraz wpisz :s/czaas/czas/g . Dodane g oznacza zamianę (substytucję) globalnie w całej linii. Zmienia wszystkie wystąpienia 'czaas' 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 linii ograniczających region, gdzie ma nastąpić zamiana. wpisz :%s/stare/nowe/g by zmienić wszystkie wystąpienia w całym pliku. wpisz :%s/stare/nowe/gc by zmienić wszystkie wystąpienia w całym pliku, prosząc o potwierdzenie za każdym razem. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCJA 4. PODSUMOWANIE 1. CTRL-G pokaże Twoją pozycję w pliku i status pliku. SHIFT-G przenosi Cię do końca pliku. G przenosi do końca pliku. liczba G przenosi do linii [liczba]. gg przenosi do pierwszej linii. 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 w tym samym kierunku lub N by szukać w kierunku przeciwnym. CTRL-O przenosi do starszych pozycji, CTRL-I do nowszych. 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 potwierdzenie, 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 komendy linii poleceń. 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 . 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 . Od tego momentu nie zawsze będziemy o tym wspominać. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 5.2.: WIĘCEJ O ZAPISYWANIU PLIKÓW ** By zachować zmiany w tekście, wpisz :w NAZWA_PLIKU . ** 1. Wpisz :!dir lub :!ls by zobaczyć spis plików w katalogu. Już wiesz, że musisz po tym wcisnąć . 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 lub :!ls żeby znowu zobaczyć listę plików. Uwaga: Zauważ, że gdybyś teraz wyszedł z Vima, a następnie wszedł ponownie poleceniem vim TEST , plik byłby dokładną kopią tutoriala, kiedy go zapisywałeś. 5. Teraz usuń plik wpisując (MS-DOS): :!del TEST lub (Unix): :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 5.3.: WYBRANIE TEKSTU DO ZAPISU ** By zachować część pliku, wpisz v ruch :w NAZWA_PLIKU ** 1. Przenieś kursor do tego wiersza. 2. Wciśnij v i przenieś kursor do punktu 5. Zauważ, że tekst został podświetlony. 3. Wciśnij znak : . Na dole ekranu pojawi się :'<,'> . 4. Wpisz w TEST , gdzie TEST to nazwa pliku, który jeszcze nie istnieje. Upewnij się, że widzisz :'<,'>w TEST zanim wciśniesz Enter. 5. Vim zapisze wybrane linie do pliku TEST. Użyj :!dir lub :!ls , żeby to zobaczyć. Jeszcze go nie usuwaj! Użyjemy go w następnej lekcji. UWAGA: Wciśnięcie v zaczyna tryb Wizualny. Możesz poruszać kursorem, by zmienić rozmiary zaznaczenia. Możesz też użyć operatora, by zrobić coś z tekstem. Na przykład d usuwa tekst. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 5.4.: WSTAWIANIE I ŁĄCZENIE PLIKÓW ** By wstawić zawartość pliku, wpisz :r NAZWA_PLIKU ** 1. Umieść kursor tuż powyżej tej linii. UWAGA: Po wykonaniu kroku 2. zobaczysz tekst z Lekcji 5.3. Potem przejdź do DOŁU, by zobaczyć ponownie tę lekcję. 2. Teraz wczytaj plik TEST używając polecenia :r TEST , gdzie TEST jest nazwą pliku. Wczytany plik jest umieszczony poniżej linii z kursorem. 3. By sprawdzić czy plik został wczytany, cofnij kursor i zobacz, że teraz są dwie kopie Lekcji 5.3., oryginał i kopia z pliku. UWAGA: Możesz też wczytać wyjście zewnętrznego polecenia. Na przykład :r !ls wczytuje wyjście polecenia ls i umieszcza je pod poniżej kursora. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 Vima na dysk z nazwą NAZWA_PLIKU. 3. v ruch :w NAZWA_PLIKU zapisuje Wizualnie wybrane linie do NAZWA_PLIKU. 4. :r NAZWA_PLIKU wczytuje z dysku plik NAZWA_PLIKU i wstawia go do bieżącego pliku poniżej kursora. 5. :r !dir wczytuje wyjście polecenia dir i umieszcza je poniżej kursora. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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. Wpisz trochę tekstu i wciśnij by wyjść z trybu Insert (wprowadzanie). ---> Po wciśnięciu o kursor znajdzie się w otwartej linii w trybie Insert. 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 początku pierwszej linii poniżej oznaczonej ---> 2. Wciskaj e dopóki kursor nie będzie na końcu li . 3. Wpisz a (małe), aby dodać tekst ZA znakiem pod kursorem. 4. Dokończ wyraz tak, jak w linii poniżej. Wciśnij aby opuścić tryb Insert. 5. Użyj e by przejść do kolejnego niedokończonego wyrazu i powtarzaj kroki 3. i 4. ---> Ta li poz Ci ćwi dodaw teks do koń lin ---> Ta linia pozwoli Ci ćwiczyć dodawanie tekstu do końca linii. Uwaga: a , i oraz A prowadzą do trybu Insert, jedyną różnicą jest miejsce, gdzie nowe znaki będą dodawane. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 --->. Przenieś kursor do pierwszego xxx . 2. Wciśnij R i wpisz numer poniżej w drugiej linii, tak, że zastąpi on xxx. 3. Wciśnij by opuścić tryb Replace. Zauważ, że reszta linii pozostaje niezmieniona. 5. Powtarzaj kroki by wymienić wszystkie xxx. ---> Dodanie 123 do xxx daje xxx. ---> Dodanie 123 do 456 daje 579. UWAGA: Tryb Replace jest jak tryb Insert, ale każdy znak usuwa istniejący znak. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 6.4.: KOPIOWANIE I WKLEJANIE TEKSTU ** użyj operatora y aby skopiować tekst i p aby go wkleić ** 1. Przejdź do linii oznaczonej ---> i umieść kursor za "a)". 2. Wejdź w tryb Wizualny v i przenieś kursor na początek "pierwszy". 3. Wciśnij y aby kopiować (yankować) podświetlony tekst. 4. Przenieś kursor do końca następnej linii: j$ 5. Wciśnij p aby wkleić (wpakować) tekst. Dodaj: a drugi . 6. Użyj trybu Wizualnego, aby wybrać " element.", yankuj go y , przejdź do końca następnej linii j$ i upakuj tam tekst z p . ---> a) to jest pierwszy element. b) Uwaga: możesz użyć y jako operatora; yw kopiuje jeden wyraz. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 6.5.: USTAWIANIE OPCJI ** Ustawianie opcji tak, by szukaj lub substytucja ignorowały wielkość liter ** 1. Szukaj 'ignore' wpisując: /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 wciskając: n Zauważ, że Ignore i IGNORE także są teraz znalezione. 4. Ustaw opcje 'hlsearch' i 'incsearch': :set hls is 5. Teraz wprowadź polecenie szukaj ponownie i zobacz co się zdarzy: /ignore 6. Aby wyłączyć ignorowanie wielkości liter: :set noic Uwaga: Aby usunąć podświetlanie dopasowań, wpisz: :nohlsearch Uwaga: Aby ignorować wielkość liter dla jednego wyszukiwania: /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCJA 6. PODSUMOWANIE 1. Wpisanie o otwiera linię PONIŻEJ kursora. Wpisanie O otwiera linię POWYŻEJ kursora. 2. Wpisanie a wstawia tekst ZA znakiem, na którym jest kursor. Wpisanie A dodaje tekst na końcu linii. 3. Polecenie e przenosi do końca wyrazu. 4. Operator y yankuje (kopiuje) tekst, p pakuje (wkleja) go. 5. Wpisanie wielkiego R wprowadza w tryb Replace (zamiana) dopóki nie zostanie wciśnięty . 6. Wpisanie ":set xxx" ustawia opcję "xxx". Niektóre opcje: 'ic' 'ignorecase' ignoruj wielkość znaków 'is' 'incsearch' pokaż częściowe dopasowania 'hls' 'hlsearch' podświetl wszystkie dopasowania Możesz użyć zarówno długiej, jak i krótkiej formy. 7. Dodaj "no", aby wyłączyć opcję: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCJA 7.1. JAK UZYSKAĆ POMOC? ** 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 (jeśli taki masz) - wciśnij klawisz (jeśli taki masz) - wpisz :help Przeczytaj tekst w oknie pomocy, aby dowiedzieć się jak działa pomoc. wpisz CTRL-W CTRL-W aby przeskoczyć z jednego okna do innego wpisz :q aby zamknąć okno pomocy. Możesz też znaleźć pomoc na każdy temat podając argument polecenia ":help". Spróbuj tych (nie zapomnij wcisnąć ): :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCJA 7.2. TWORZENIE SKRYPTU STARTOWEGO ** Włącz możliwości Vima ** 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 Uniksa :edit $VIM/_vimrc dla MS-Windows 2. Teraz wczytaj przykładowy plik "vimrc": :read $VIMRUNTIME/vimrc_example.vim 3. Zapisz plik: :w 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". Aby uzyskać więcej informacji, wpisz :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 7.3.: UZUPEŁNIANIE ** Uzupełnianie linii poleceń z CTRL-D i ** 1. Upewnij się, że Vim nie jest w trybie kompatybilności: :set nocp 2. Zerknij, jakie pliki są w bieżącym katalogu: :!ls lub :!dir 3. Wpisz początek polecenia: :e 4. Wciśnij CTRL-D i Vim pokaże listę poleceń, jakie zaczynają się na "e". 5. Wciśnij i Vim uzupełni polecenie do ":edit". 6. Dodaj spację i zacznij wpisywać nazwę istniejącego pliku: :edit FIL 7. Wciśnij . Vim uzupełni nazwę (jeśli jest niepowtarzalna). UWAGA: Uzupełnianie działa dla wielu poleceń. Spróbuj wcisnąć CTRL-D i . Użyteczne zwłaszcza przy :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 7. PODSUMOWANIE 1. Wpisz :help albo wciśnij lub aby otworzyć okno pomocy. 2. Wpisz :help cmd aby uzyskać pomoc o cmd . 3. Wpisz CTRL-W CTRL-W aby przeskoczyć do innego okna. 4. Wpisz :q aby zamknąć okno pomocy. 5. Utwórz plik startowy vimrc aby zachować wybrane ustawienia. 6. Po poleceniu : , wciśnij CTRL-D aby zobaczyć możliwe uzupełnienia. Wciśnij aby użyć jednego z nich. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tutaj się kończy tutorial Vima. 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ążka całkowicie poświęcona Vimowi. Użyteczna zwłaszcza dla początkujących. Zawiera wiele przykładów i ilustracji. Zobacz http://iccf-holland.org./click5.html Starsza pozycja i bardziej o Vi niż o Vimie, 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 Vimie. 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 Vima). 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 Vima przez Brama Moolenaara. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Przetłumaczone przez Mikołaja Machowskiego, Sierpień 2001, rev. Marzec 2002 2nd rev. Wrzesień 2004 3rd rev. Marzec 2006 4th rev. Grudzień 2008 Wszelkie uwagi proszę kierować na: mikmach@wp.pl vim-7.4.1689/runtime/tutor/tutor.pt000066400000000000000000001071531267703067000171660ustar00rootroot00000000000000=============================================================================== = B e m V i n d o a o V I M T u t o r - Verso 1.7 pt_BR = =============================================================================== Vim um poderoso editor que possui muitos comandos, tantos que seria impossvel ensinar num tutorial como este. Este tutorial planejado para apresentar os comandos suficientes para voc ficar habilitado a usar facilmente o Vim como um editor de textos genrico. O tempo aproximado requerido para completar o tutorial de 25-30 minutos, dependendo de quanto tempo gasto praticando os comandos. ATENO: Os comandos nas lies vo modificar o texto. Utilize uma cpia deste arquivo para praticar os comandos (se voc iniciou o "vimtutor", esta j uma cpia). importante lembrar que este tutorial planejado para ensinar atravs da prtica. Isso significa que voc precisa executar os comandos para aprend-los adequadamente. Se voc somente ler o texto, esquecer os comandos! Agora, certifique-se de que sua tecla Shift-Lock (ou Caps Lock) no esteja ativada e pressione a tecla j o bastante para mover o cursor at que a Lio 1.1 esteja completamente na tela. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lio 1.1: MOVENDO O CURSOR ** Para mover o cursor, pressione as teclas h,j,k,l conforme indicado. ** ^ k Dica: A tecla h est esquerda e move para a esquerda. < h l > A tecla l est direita e move para a direita. j A tecla j se parece com uma seta para baixo. v 1. Mova o cursor pela tela at que voc se sinta confortvel. 2. Segure pressionada a tecla (j) at haver repetio. Agora voc j sabe como ir para a prxima lio. 3. Usando a tecla j, mova at a lio 1.2. NOTA: Se voc est inseguro sobre o que digitou, pressione para coloc-lo no modo Normal. Ento redigite o comando que voc queria. NOTA: As teclas de cursor devem funcionar tambm. Mas usando hjkl, to logo esteja acostumado, voc poder se mover muito mais rapidamente. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lio 1.2: SAINDO DO VIM !! NOTA: Antes de executar qualquer dos passos abaixo, leia a lio inteira !! 1. Pressione (para ter certeza de que est no modo Normal). 2. Digite :q! . Isso sai do editor SEM salvar qualquer mudana que tenha sido feita. Se quiser salvar as alteraes e sair, digite :wq 3. Repita o procedimento que lhe trouxe a este tutorial. O procedimento pode ter sido a digitao de: vimtutor . 4. Se voc memorizou estes passos e est confiante, execute os passos de 1 a 3 para sair e reentrar no editor. NOTA: :q! descarta qualquer mudana. Em uma prxima lio ser ensinado como salvar as mudanas feitas em um arquivo. 5. Desa o cursor at a Lio 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lio 1.3: EDITANDO TEXTOS - DELEO ** No modo Normal, pressione x para deletar o caractere sob o cursor. ** 1. Mova o cursor para a linha abaixo marcada com --->. 2. Para corrigir os erros, mova o cursor at que ele esteja sobre o caractere a ser deletado. 3. Pressione a tecla x para deletar o caractere indesejado. 4. Repita os passos 2 at 4 at que a sentena esteja correta. ---> A vvaca pullouu por ccimaa dda luuua. 5. Agora que a sentena est correta, v para a Lio 1.4. NOTA: Enquanto segue este tutorial, no tente memorizar, aprenda pelo uso. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lio 1.4: EDITANDO TEXTOS - INSERO ** Pressione i para inserir texto. ** 1. Mova o cursor at a primeira linha abaixo marcada com --->. 2. Para fazer a primeira linha ficar igual segunda, mova o cursor para o primeiro caractere DEPOIS de onde o texto dever ser inserido. 3. Pressione i e digite as adies necessrias. 4. Assim que cada erro for corrigido pressione para retornar ao modo Normal. Repita os passos 2 at 4 para corrigir a sentena. ---> Tem text fatado desta . ---> Tem algum texto faltando desta linha. 5. Quando se sentir confortvel com a insero de texto, mova o cursor para a lio 1.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lio 1.5: EDITANDO TEXTO - ADICIONANDO ** Pressione A para adicionar texto. ** 1. Mova o curso para a primeira linha abaixo marcada com --->. No importa sobre qual caractere o cursor estar na linha. 2. Pressione A e digite as adies necessrias. 3. Quando adicionar o texto, pressione para retornar ao modo Normal. 4. Mova o cursor para a segunda linha marcada ---> e repita os passos 2 e 3 para corrigir o texto. ---> H algum texto faltando des H algum texto faltando desta linha. H algum texto faltan ---> H algum texto faltando aqui. 5. Quando se sentir confortvel adicionando texto, mova para a lio 1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lio 1.6: EDITANDO UM ARQUIVO ** Use :wq para salvar um arquivo e sair. ** !! NOTA: Antes de executar qualquer um dos passos abaixo, leia esta lio completamente!! 1. Saia deste tutorial como o fez na lio 1.2: :q! Ou, se tiver acesso a outro terminal, faa o seguinte nele. 2. No prompt do shell, digite esse comando: vim tutor 'vim' is comando para iniciar o editor Vim e 'tutor' o nome do arquivo que voc deseja editar. Use um arquivo que possa ser modificado. 3. Insira e delete texto tal como aprendeu com as lies anteriores. 4. Salve o arquivo com as mudanas e saia do Vim com: :wq 5. Se voc tiver sado do vimtutor no passo 1, reinicie o vimtutor e v para o sumrio seguinte. 6. Aps ler os passos acima e compreend-los, execute-os. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SUMRIO DA LIO 1 1. O cursor movido usando tanto as teclas de seta quanto as teclas hjkl. h (esquerda) j (para baixo) k (para cima) l (direita) 2. Para entrar no Vim a partir de um shell digite: vim NOMEDOARQUIVO 3. Para sair do Vim digite: :q! para descartar as alteraes. OU digite: :wq para salvar as alteraes. 4. Para deletar um caractere sob o cursor no modo Normal digite: x 5. Para inserir texto na posio do cursor enquanto estiver no modo Normal digite: i digite o texto inserir depois do cursor A digite o texto adicionar no final da linha NOTA: Pressionando voc ir para o modo Normal ou cancelar um comando ainda incompleto. Agora continue com a Lio 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lio 2.1: COMANDOS DE DELEO ** Digite dw para deletar at o final de uma palavra. ** 1. Pressione para ter certeza de que est no modo Normal. 2. Mova o cursor at a linha abaixo marcada com --->. 3. Mova o cursor at o comeo da palavra que precisa ser deletada. 4. Digite dw para fazer a palavra desaparecer. NOTA: A letra d vai aparece na ltima linha da tela enquanto voc a digita. O Vim est lhe esperando digitar um w . Se voc digitou alguma coisa errada, pressione e comece de novo. ---> Tem a algumas oi palavras diverso que no pertencem papel a esta sentena. 5. Repita os passos 3 ao 4 at que a sentena esteja correta e v para a Lio 2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lio 2.2: MAIS COMANDOS DE DELEO ** Digite d$ para deletar at o final da linha. ** 1. Pressione para ter certeza de estar no modo Normal. 2. Mova o cursor at a linha abaixo marcada com --->. 3. Mova o cursor at o fim da linha correta (DEPOIS do primeiro .). 4. Digite d$ para deletar at o final da linha. ---> Algum digitou o final desta linha duas vezes. desta linha duas vezes. 5. V para a lio 2.3 para entender o que est acontecendo. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lio 2.3: SOBRE OPERADORES E MOVIMENTOS Muitos comandos que mudam texto so feitos de um operador e um movimento. O formato para um comando deletar com o operador de deleo d tem a seguinte forma: d movimento Onde: d - o operador deletar. movimento - como o operador vai operar (listado abaixo). Uma pequena lista de teclas de movimento: w - do cursor at o fim da palavra, incluindo o espao. e - do cursor at o fim da palavra, NO incluindo o espao. $ - do cursor at o fim da linha. Portanto, digitando de ir deletar do cursor ao fim da palavra. NOTA: Pressionando apenas a tecla de movimento enquanto em modo Normal, sem o operador, ir mover o cursor como especificado na lista de teclas de movimento. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lio 2.4: USANDO UM CONTADOR PARA UM MOVIMENTO ** Digitando um nmero antes de um movimento repete-o muitas vezes. ** 1. Mova o cursor para o comeo da linha marcada com ---> abaixo. 2. Digite 2w para mover o cursor duas palavras adiante. 3. Digite 3e para mover o cursor para o fim da terceira palavra adiante. 4. Digite 0 (zero) para mover para o incio da linha. 5. Repita os passos 2 e 3 com diferentes nmeros. ---> Esta uma linha com algumas palavras para lhe permitir fazer movimentos. 6. V para a Lio 2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lio 2.5: USANDO UM CONTADOR PARA DELETAR MAIS ** Digitando um nmero com um operador repete-o esse nmero de vezes. ** Voc deve inserir um contador entre o operador de deleo e o movimento mencionados acima para para deletar mais: d nmero movimento 1. Movimente o cursor para a primeira palavra com LETRAS MAISCULAS na linha marcada com --->. 2. Digite d2w para deletar as duas palavras com LETRAS MAISCULAS. 3. Repita os passos 1 e 2 com diferentes contadores para deletar as palavras de LETRAS MAISCULAS com um comando. ---> esta ABC DE linha FGHI JK LMN OP de palavras est Q RS TUV limpa. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lio 2.6: OPERANDO SOBRE LINHAS ** Digite dd para deletar uma linha inteira. ** Em virtude da frequncia em deletar uma linha inteira, os projetistas do Vi decidiram que seria mais simples digitar dois d's numa linha para delet-la. 1. Mova o cursor at a segunda linha na lista a baixo. 2. Digite dd para deletar a linha. 3. Agora mova at a quarta linha. 4. Digite 2dd para deletar duas linhas. ---> 1) Rosas so vermelhas, ---> 2) Lama divertida, ---> 3) Violetas so azuis, ---> 4) Eu tenho um carro, ---> 5) Relgios dizem as horas, ---> 6) Acar doce, ---> 7) E assim voc. Notas do tradutor: Lama (mud) em ingls pode significar fofoca, difamao. H rima no texto original. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lio 2.7: O COMANDO UNDO (DESFAZER) ** Pressione u para desfazer os ltimos comandos, U restaura linha inteira.** 1. Mova o cursor para a linha abaixo marcada com ---> e posicione-o sobre o primeiro erro. 2. Digite x para deletar o primeiro caractere indesejado. 3. Agora, digite u para desfazer o ltimo comando executado. 4. Desta vez, corrija todos os erros na linha usando o comando x . 5. Agora, digite um U maisculo para retornar a linha ao seu estado original. 6. Digite u algumas vezes para desfazer o U e os comandos anteriores. 7. Digite CTRL-R (segurando a tecla CTRL enquanto digita R) algumas vezes para refazer os comandos (desfazer os undo's). ---> Corriija os erros nnesta linha e reetorne-os com undo. 8. Esses comandos so muito teis. Agora v para o sumrio da Lio 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SUMRIO DA LIO 2 1. Para deletar do cursor at o fim de uma palavra digite: dw 2. Para deletar do cursor at o fim de uma linha digite: d$ 3. Para deletar uma linha inteira digite: dd 4. Para repetir um movimento adicione antes um nmero: 2w 5. O formato para um comando no modo Normal : operador [nmero] movimento onde: operador - o que ser feito, como d para deletar nmero - quantas vezes o comando ser repetido movimento - movimento sobre o texto que sofrer a operao, como w (palavra), $ (at o final da linha), etc. 5. Para desfazer um ao anterior, digite: u (minsculo) Para desfazer todas as modificaes em uma linha digite: U (maisculo) Para desfazer o que foi desfeito digite: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lio 3.1: O COMANDO PUT (PR) ** Digite p para colocar a ltima deleo aps o cursor. ** 1. Mova o cursor at a primeira linha na lista abaixo. 2. Digite dd para deletar a linha e guard-la no buffer do Vim. 3. Mova o cursor at a linha ACIMA de onde a linha deletada deve ficar. 4. No modo Normal, digite p para inserir a linha. 5. Repita os passos 2 ao 4 para pr todas as linhas na ordem correta. d) Voc pode aprender tambm? b) Violetas so azuis, c) Inteligncia se aprende, a) Rosas so vermelhas, Nota do tradutor: H rima no original. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lio 3.2: O COMANDO REPLACE (SUBSTITUIR) ** Digite rx para substituir o caractere sob o cursor por x . ** 1. Mova o cursor at a primeira linha abaixo marcada com --->. 2. Mova o cursor at que ele esteja sobre o primeiro erro. 3. Digite r e ento o caractere que deveria estar l. 4. Repita os passos 2 e 3 at que a primeira linha esteja correta. ---> Quendo este limha foi dugitada, alguem pressioniu algumas teclas erradzs! ---> Quando esta linha foi digitada, algum pressionou algumas teclas erradas! 5. Agora v para a Lio 3.3. NOTA: Lembre-se que voc deve aprender pelo uso, no pela memorizao. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lio 3.3: O OPERADOR CHANGE (MUDAR) ** Para mudar toda uma palavra ou parte dela, digite cw . ** 1. Mova o cursor at a primeira linha abaixo marcada com --->. 2. Posicione o cursor sobre o u em lunba. 3. Digite cw e a palavra correta (nesse caso, digite 'inha'.) 4. Pressione e mova para o prximo caractere a ser alterado. 5. Repita os passos 3 e 4 at que a primeira sentena esteja igual segunda. ---> Essa lunba tem pwlesmfr que ocrimmm soi alteradas cup o comando change. ---> Essa linha tem palavras que precisam ser alteradas com o comando change. Note que cw no somente substitui a palavra, mas tambm lhe coloca no modo de insero. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lio 3.4: MAIS MUDANAS USANDO c ** O operador change usado com os mesmos objetos que delete. ** 1. O operador change trabalha da mesma maneira que o delete. O formato : c [nmero] movimento 2. Os movimentos tambm so os mesmos: w (palavra), $ (fim da linha), etc. 3. Mova at a primeira linha abaixo marcada com --->. 4. Mova o cursor at o primeiro erro. 5. Digite c$ para fazer o resto da linha ficar igual segunda e pressione . ---> O fim desta linha precisa de ajuda para ficar igual segunda. ---> O fim desta linha precisa ser corrigido usando o comando c$. NOTA: Voc pode usar a tecla Backspace para corrigir erros enquanto digita. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SUMRIO DA LIO 3 1. Para inserir um texto que j foi deletado, digite p . Isso coloca o texto deletado APS o cursor (se uma linha deletada ela ser inserida na linha abaixo do cursor). 2. Para substituir o caractere sob o cursor, digite r e ento o caractere que ir substituir o original. 3. O comando change possibilita mudar do cursor at onde o movimento for. Ex: Digite cw para mudar do cursor at o fim de uma palavra, c$ para mudar at o fim da linha. 4. O formato para uma operao change : c [nmero] movimento Agora v para a prxima lio. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lio 4.1: LOCALIZAO DO CURSOR E STATUS DO ARQUIVO ** Digite CTRL-G para mostrar sua localizao no arquivo e seu status. Digite G para mover para uma linha do arquivo. ** Nota: Leia esta lio inteira antes de executar qualquer um dos passos!! 1. Segure pressionada a tecla Ctrl e pressione g . Ns chamamos isso de CTRL-G. Uma mensagem aparecer no rodap da pgina com o nome do arquivo e a sua posio no arquivo. Lembre-se do nmero da linha para o Passo 3. NOTA: A posio do cursor pode estar visvel no canto direito inferior da tela. Isso acontece quando a opo 'ruler' est ativa (veja :help 'ruler' ). 2. Pressione G para mover para o final do arquivo. Digite gg para mover para o incio do arquivo. 3. Digite o nmero da linha em que voc estava e ento G . Isto retornar o cursor linha em que voc estava quando pressionou CTRL-G. 4. Se voc estiver confiante para fazer isto, execute os passos 1 ao 3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lio 4.2: O COMANDO SEARCH (PROCURA) ** Digite / seguido por uma string para procurar pela string. ** 1. No modo Normal digite o caractere / . Note que ele e o cursor aparecem no rodap da tela, como ocorre com o comando : . 2. Agora digite 'errroo' . Esta a palavra que voc quer procurar. 3. Para procurar pela mesma palavra de novo, simplesmente tecle n . Para procurar pela mesma palavra na direo oposta, tecle N . 4. Se voc quer procurar por uma string no sentido de frente para trs, use ? em vez de / . 5. Para voltar para onde estava, pressione CTRL-O (mantenha a tecla Ctrl pressionada e pressione a tecla o). Repita para voltar outras posies. CTRL-I segue para posies mais recentes. ---> "errroo" no uma maneira de escrever erro; errroo um erro. NOTA: Quando a busca atinge o final do arquivo ela continuar do comeo, a menos que a opo 'wrapscan' esteja desativada. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lio 4.3: PROCURA POR CASAMENTO DE PARNTESES ** Digite % para achar um casamento de ),], ou } . ** 1. Posicione o cursor em qualquer (, [, ou { na linha abaixo marcada com --->. 2. Agora digite o caractere % . 3. O cursor deve estar no parnteses ou colchetes que casa com o primeiro. 4. Digite % para mover o cursor de volta ao primeiro colchete ou parnteses (por casamento). ---> Isto ( uma linha de teste contendo ('s, ['s ] e {'s }. )) Nota: Isso muito til para corrigir um programa com parnteses no-casados! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lio 4.4: O COMANDO SUBSTITUIR ** Digite :s/velho/novo/g para substituir 'velho' por 'novo'. ** 1. Mova o cursor para a linha abaixo marcada com --->. 2. Digite :s/aa/a . Note que este comando somente muda a primeira ocorrncia na linha. 3. Agora digite :s/aa/a/g significando substituir globalmente na linha. Isto muda todas as ocorrncias na linha. ---> aa melhor poca para ver aas flores aa primavera. 4. Para mudar toda ocorrncia de uma string entre duas linhas, digite :#,#s/velho/novo/g onde #,# so os nmeros das duas linhas. Digite :%s/velho/novo/g para mudar todas as ocorrncias no arquivo inteiro. Digite :%s/velho/novo/gc para mudar todas as ocorrncia no arquivo inteiro, com a opo de confirmar cada substituio. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SUMRIO DA LIO 4 1. CTRL-G mostra a sua localizao no arquivo e o status do mesmo. G move para o final do arquivo. nmero G move para esta linha com esse nmero. gg move para a primeira linha. 2. Digitando / seguido por uma expresso procura FRENTE por ela. Digitando ? seguido por uma expresso procura pela expresso de TRS PARA FRENTE. Aps uma busca, digite n para achar a prxima ocorrncia na mesma direo ou N para procurar na direo oposta. CTRL-O leva a posies antigas e CTRL-I a posies mais recentes. 3. Digitando % enquanto o cursor est sobre um (,),[,],{, ou } localiza o par que casa com ele. 4. Para substituir: o primeiro 'velho' de uma linha por 'novo' digite :s/velho/novo todos os 'velho's em uma linha por 'novo' digite :s/velho/novo/g expresses entre dois nmeros (#) de linhas digite :#,#s/velho/novo todas as ocorrncias no arquivo digite :%s/velho/novo/g Para confirmar cada substituio adicione 'c' :%s/velho/novo/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lio 5.1: COMO EXECUTAR UM COMANDO EXTERNO ** Digite :! seguido por um comando externo para executar esse comando. ** 1. Digite o familiar comando : para levar o cursor ao rodap da tela. Isso lhe permite entrar um comando. 2. Agora digite o caractere ! (ponto de exclamao). Isso lhe permite executar qualquer comando do shell. 3. Como um exemplo digite ls seguindo o ! e ento tecle . Isto ir mostrar uma listagem do seu diretrio, como se voc estivesse no prompt do shell. Ou use :!dir se ls no funcionar. NOTA: possvel executar qualquer comando externo dessa maneira, inclusive com argumentos. NOTA: Todos os comandos : devem ser finalizados teclando-se Daqui em diante no iremos mencionar isso sempre. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lio 5.2: MAIS SOBRE SALVAR ARQUIVOS ** Para salvar as alteraes no texto, digite :w NOMEDOARQUIVO. ** 1. Digite :!dir ou :!ls para ter uma listagem de seu diretrio. Voc j deve saber que precisa teclar depois disso. 2. Escolha um nome de arquivo que ainda no exista, como TESTE. 3. Agora digite: :w TESTE (onde TESTE o nome que voc escolheu.) 4. Isto salva o arquivo inteiro (o Vim Tutor) com o nome TESTE. Para verificar isso, digite :!ls de novo para ver seu diretrio NOTA: Se voc sair do Vim e entrar de novo com o nome do arquivo TESTE, o arquivo deve ser uma cpia exata do tutor quando voc o salvou. 5. Agora remova o arquivo digitando (MS-DOS): :!del TESTE ou (Unix): :!rm TESTE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lio 5.3: SELECIONANDO O TEXTO A SER SALVO ** Para salvar parte de um arquivo, digite v movimento NOMEDOARQUIVO ** 1. Mova o cursor para esta linha. 2. Pressione v e mova o cursor para o quinto item abaixo. Note que o texto realado. 3. Pressione o caractere : e note que aparecer :'<,'> no lado inferior da tela. 4. Digite w TESTE , sendo TESTE um nome de arquivo que no existe ainda. Voc dever ver :'<,'>w TESTE antes de pressionar . 5. O Vim salvar as linhas selecionadas no arquivo TESTE. Use :!dir ou !:ls para v-lo. No o apague agora! Ns o usaremos na prxima lio. NOTA: Pressionando v inicia o modo Visual de seleo. Voc pode mover o cursor pela tela para tornar a seleo maior ou menor. Pode, ento, usar um operador para executar alguma ao. Por exemplo, d deleta o texto. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lio 5.4: RECUPERANDO E JUNTANDO ARQUIVOS ** Para inserir o contedo de um arquivo, digite :r NOMEDOARQUIVO ** 1. Posicione o cursor logo acima desta linha. NOTA: Depois de executar o Passo 2 voc ver a lio 5.3. Ento DESA o cursor para ver esta lio novamente. 2. Agora recupere o arquivo TESTE usando o comando :r TESTE onde TESTE o nome do arquivo. O arquivo recuperado colocado abaixo da linha atual do cursor. 3. Para verificar que o arquivo foi recuperado, volte com o cursor e verifique que agora existem duas cpias da Lio 5.3, a original e a verso do arquivo. NOTA: Voc tambm pode ler a sada de um comando externo. Por exemplo, :r !ls l a sada do comando ls e coloca o resultado abaixo do cursor. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SUMRIO DA LIO 5 1. :!comando executa um comando externo. Alguns exemplos teis so: (MS-DOS) (UNIX) :!dir :!ls - lista contedo do diretrio. :!del ARQUIVO :!rm ARQUIVO - remove ARQUIVO. 2. :w ARQUIVO salva o atual arquivo do Vim para o disco com o nome ARQUIVO. 3. v movimento :w ARQUIVO salva as linhas Visualmente selecionadas em ARQUIVO. 4. :r ARQUIVO recupera ARQUIVO do disco e o insere dentro do arquivo atual na posio do cursor. 5. :r !dir l a sada do comando dir e coloca o resultado abaixo da posio atual do cursor. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lio 6.1: O COMANDO OPEN (ABRIR) ** Digite o para abrir uma linha embaixo do cursor e ir para o modo de Insero (INSERT). ** 1. Mova o cursor para a linha abaixo marcada com --->. 2. Digite o (minsculo) para abrir uma linha ABAIXO do cursor e ir para o modo de Insero (INSERT). 3. Agora digite algum texto e pressione para sair do modo de Insero. ---> Aps teclar o o cursor colocado na linha aberta no modo de Insero. 4. Para abrir uma linha ACIMA do cursor, simplesmente tecle um O maisculo, em vez de um o minsculo. Tente isso na linha abaixo. ---> Abra uma linha acima desta teclando O enquanto o cursor est nesta linha. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lio 6.2: O COMANDO APPEND ** Digite a para inserir texto DEPOIS do cursor. ** 1. Mova o cursor para o incio da linha marcada com ---> . 2. Pressione e at o cursor ficar sobre o final de li . 3. Digite um a (minsculo) para adicionar texto DEPOIS do caractere sob o cursor. 4. Complete a palavra conforme a linha abaixo. Pressione para sair do modo de Insero. 5. Use e para mover para a prxima palavra incompleta repita os passos 3 e 4. ---> Esta lin lhe permite pratic a adi de texto a uma linha. ---> Esta linha lhe permite praticar a adio de texto a uma linha. NOTA: a, i e A levam ao mesmo modo de Insero, a nica diferena onde os caracteres so inseridos. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lio 6.3: UMA OUTRA VERSO DO REPLACE (SUBSTITUIR) ** Digite um R maisculo para substituir mais de um caractere. ** 1. Mova o cursor para a primeira linha abaixo marcada com --->. Mova o cursor para o incio do primeiro xxx . 2. Agora pressione R e digite os nmeros que esto abaixo dele, na segunda linha, para substituir o xxx . 3. Pressione para sair do modo de Substituio. Note que o resto da linha permanece inalterada. 4. Repita os passos para substituir os xxx restantes. ---> Adicionando 123 a xxx resulta em xxx. ---> Adicionando 123 a 456 resulta em 579. NOTA: O modo de Substituio como o modo de Insero, mas cada caractere digitado deleta um caractere existente. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lio 6.4: COPIAR E COLAR TEXTO ** Use o operador y para copiar texto e p para col-lo. ** 1. V para a linha marcada com ---> abaixo e posicione o cursor aps "a)". 2. Inicie o modo Visual com v e mova o cursor para logo antes de "primeiro". 3. Digite y para copiar o texto selecionado. 4. Mova o cursor para o final da prxima linha: j$ 5. Digite p par pr (colar) o texto. Ento, digite: o segundo . 6. Use o modo Visual para selecionar " item.", copie-o com y , mova para o fina da prxima linha com j$ e ponha (cole) o texto com p . ---> a) esse o primeiro item. b) NOTA: Voc tambm pode usar y como um operador; por exemplo, yw copia uma palavra. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lio 6.5: CONFIGURAR PREFERNCIAS ** Configurar uma preferncia de modo que um search ou substitute ignora se as letras esto em maisculas ou minsculas. ** 1. Procure por 'ignore' entrando: /ignore Repita vrias vezes teclando n . 2. Configure a opo 'ic' (Ignore case) digitando: :set ic 3. Agora procure por 'ignore' de novo teclando: n Repita vrias vezes. 4. Configure as opes 'hlsearch' e 'incsearch': :set hls is 5. Agora entre com o comando search de novo, e veja o que acontece: /ignore 6. Para desabilitar a desconsiderao de maisculas e minsculas: :set noic NOTA: Para remover o realce dos termos localizados entre: :nohlsearch NOTA: Se quiser ignorar a diferena entre maisculas e minsculas em apenas uma pesquisa, use \c no comando: /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SUMRIO DA LIO 6 1. Digite o para abrir uma linha ABAIXO do cursor e iniciar o modo de Insero. Digite O para abrir uma linha ACIMA da linha onde o cursor est. 2. Digite a para adicionar texto DEPOIS do caractere onde est o cursor. Digite A para adicionar texto ao final da linha. 3. O comando e move o cursor para o final de uma palavra. 4. O operador y copia texto, p pe (cola) o texto copiado. 5. Digitando R entra-se no modo de Substituio at que seja pressionado. 6. Digitando ":set xxx" modifica-se a opo "xxx". Algumas opes so: 'ic' 'ignorecase' ignora diferena entre maisculas/minsculas 'is' 'incsearch' realiza a busca enquanto se digita 'hls' 'hlsearch' reala todos os trechos localizados Voc tanto pode usar o nome curto quanto o nome longo da opo. 7. Adicione o prefixo "no" para desabilitar uma opo: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LIO 7.1: OBTENDO AJUDA ** Usar o sistema de ajuda do prprio Vim ** O Vim possui sistema de ajuda abrangente. Para comear, tente algum desses trs: - pressione a tecla (se voc tiver uma) - pressione a tecla (se voc tiver uma) - digite :help Leia o texto da ajuda para aprender como o sistema de ajuda funciona. Digite CTRL-W CTRL-W para pular de uma janela para outra. Digite :q para fechar a janela da ajuda. Voc pode achar ajuda sobre qualquer assunto, fornecendo um argumento para o comando ":help". Tente isto (no esquea de pressionar ): :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lio 7.2: CRIAR UM SCRIPT DE INICIALIZAO ** Habilitar recursos do Vim ** O Vim tem muito mais recursos do que o Vi, mas na sua maioria eles so desabilitados por padro. Para usar mais recursos, voc tem que criar um arquivo "vimrc". 1. Comece a editar o arquivo "vimrc". Isso depende do sistema: :e ~/.vimrc para Unix :e $VIM/_vimrc para MS-Windows 2. Agora, leia o contedo do arquivo "vimrc" de exemplo: :r $VIM/vimrc_example.vim 3. Salve o arquivo com: :w Da prxima vez que o Vim for iniciado, ele ir usar realce de sintaxe. Voc pode adicionar suas configuraes preferidas para esse arquivo "vimrc". Para maiores informaes, digite: :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lio 7.3: COMPLETAO ** Completao da linha de comando com CTRL-D e ** 1. Certifique-se de que o Vim no est no modo compatvel: :set nocp 2. Olhe quais arquivos existem no diretrio: :!ls ou :!dir 3. Digite o incio de um comando: :e 4. Pressione CTRL-D e o Vim ir mostrar a lista dos comandos iniciados com "e". 5. Pressione e o Vim ir completar o nome do comando para ":edit". 6. Agora, adicione um espao e o incio do nome de um arquivo existente: :edit ARQ 7. Pressione . O Vim ir completar o nome (se ele for nico). NOTA: A completao funciona com muitos comandos. Basta pressionar CTRL-D e . Isso especialmente til para :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SUMRIO DA LIO 7 1. Digite :help ou pressione ou para abrir a janela de ajuda. 2. Digite :help cmd para achar a ajuda sobre cmd . 3. Digite CTRL-W CTRL-W para pular de uma janela para outra. 4. Digite :q para fechar a janela de ajuda. 5. Crie um script de inicializao vimrc para ativar automaticamente as suas configuraes preferidas. 6. Quando pressionando um comando : , pressione CTRL-D para ver as possibilidade de completao. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Isto conclui o Vim tutor. Ele pretendeu dar uma breve apresentao do editor Vim, somente o bastante para que voc possa usar o editor com facilidade. Ele est longe de ser completo, uma vez que o Vim possui muitos, muitos mais comandos. O prximo passo ler o manual: ":help user-manual". Livro recomendado em Portugus sobre o Vim: O editor de texto Vim - de Srgio Luiz Arajo da Silva et al. http://code.google.com/p/vimbook/ Para futura leitura e estudo, este livro recomendado: Vim - Vi Improved - de Steve Oualline Editora: New Riders Este o primeiro livro completamente dedicado ao Vim. Especialmente til para iniciantes, com muitos exemplos e ilustraes. Veja http://iccf-holland.org/click5.html Esse livro mais antigo e mais sobre o Vi do que sobre o Vim, mas tambm recomendado: Learning the Vi Editor - de Linda Lamb Editora: O'Reilly & Associates Inc. Este um bom livro para aprender quase tudo o que voc quer fazer com o Vi. A sexta edio tambm inclui informaes sobre o Vim. Este tutorial foi escrito por Michael C. Pierce e Robert K. Ware, Colorado School of Mines, usando idias fornecidas por Charles Smith, Colorado State University. E-mail: bware@mines.colorado.edu. Modificado para o Vim por Bram Moolenaar. Verso 1.4 traduzida para o portugus por Marcelo Drudi Miranda, Escola Politcnica da Universidade de So Paulo. Reviso e atualizao da traduo para a verso 1.7 por Jakson Aquino, Universidade Federal do Cear: E-mail: jalvesaq@gmail.com Last Change: 2010 Jul 27 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim-7.4.1689/runtime/tutor/tutor.pt.utf-8000066400000000000000000001105221267703067000201220ustar00rootroot00000000000000=============================================================================== = B e m V i n d o a o V I M T u t o r - Versão 1.7 pt_BR = =============================================================================== Vim é um poderoso editor que possui muitos comandos, tantos que seria impossível ensinar num tutorial como este. Este tutorial é planejado para apresentar os comandos suficientes para você ficar habilitado a usar facilmente o Vim como um editor de textos genérico. O tempo aproximado requerido para completar o tutorial é de 25-30 minutos, dependendo de quanto tempo é gasto praticando os comandos. ATENÇÃO: Os comandos nas lições vão modificar o texto. Utilize uma cópia deste arquivo para praticar os comandos (se você iniciou o "vimtutor", esta já é uma cópia). É importante lembrar que este tutorial é planejado para ensinar através da prática. Isso significa que você precisa executar os comandos para aprendê-los adequadamente. Se você somente ler o texto, esquecerá os comandos! Agora, certifique-se de que sua tecla Shift-Lock (ou Caps Lock) não esteja ativada e pressione a tecla j o bastante para mover o cursor até que a Lição 1.1 esteja completamente na tela. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lição 1.1: MOVENDO O CURSOR ** Para mover o cursor, pressione as teclas h,j,k,l conforme indicado. ** ^ k Dica: A tecla h está à esquerda e move para a esquerda. < h l > A tecla l está à direita e move para a direita. j A tecla j se parece com uma seta para baixo. v 1. Mova o cursor pela tela até que você se sinta confortável. 2. Segure pressionada a tecla (j) até haver repetição. Agora você já sabe como ir para a próxima lição. 3. Usando a tecla j, mova até a lição 1.2. NOTA: Se você está inseguro sobre o que digitou, pressione para colocá-lo no modo Normal. Então redigite o comando que você queria. NOTA: As teclas de cursor devem funcionar também. Mas usando hjkl, tão logo esteja acostumado, você poderá se mover muito mais rapidamente. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lição 1.2: SAINDO DO VIM !! NOTA: Antes de executar qualquer dos passos abaixo, leia a lição inteira !! 1. Pressione (para ter certeza de que está no modo Normal). 2. Digite :q! . Isso sai do editor SEM salvar qualquer mudança que tenha sido feita. Se quiser salvar as alterações e sair, digite :wq 3. Repita o procedimento que lhe trouxe a este tutorial. O procedimento pode ter sido a digitação de: vimtutor . 4. Se você memorizou estes passos e está confiante, execute os passos de 1 a 3 para sair e reentrar no editor. NOTA: :q! descarta qualquer mudança. Em uma próxima lição será ensinado como salvar as mudanças feitas em um arquivo. 5. Desça o cursor até a Lição 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lição 1.3: EDITANDO TEXTOS - DELEÇÃO ** No modo Normal, pressione x para deletar o caractere sob o cursor. ** 1. Mova o cursor para a linha abaixo marcada com --->. 2. Para corrigir os erros, mova o cursor até que ele esteja sobre o caractere a ser deletado. 3. Pressione a tecla x para deletar o caractere indesejado. 4. Repita os passos 2 até 4 até que a sentença esteja correta. ---> A vvaca pullouu por ccimaa dda luuua. 5. Agora que a sentença está correta, vá para a Lição 1.4. NOTA: Enquanto segue este tutorial, não tente memorizar, aprenda pelo uso. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lição 1.4: EDITANDO TEXTOS - INSERÇÃO ** Pressione i para inserir texto. ** 1. Mova o cursor até a primeira linha abaixo marcada com --->. 2. Para fazer a primeira linha ficar igual à segunda, mova o cursor para o primeiro caractere DEPOIS de onde o texto deverá ser inserido. 3. Pressione i e digite as adições necessárias. 4. Assim que cada erro for corrigido pressione para retornar ao modo Normal. Repita os passos 2 até 4 para corrigir a sentença. ---> Tem text fatado desta . ---> Tem algum texto faltando desta linha. 5. Quando se sentir confortável com a inserção de texto, mova o cursor para a lição 1.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lição 1.5: EDITANDO TEXTO - ADICIONANDO ** Pressione A para adicionar texto. ** 1. Mova o curso para a primeira linha abaixo marcada com --->. Não importa sobre qual caractere o cursor estará na linha. 2. Pressione A e digite as adições necessárias. 3. Quando adicionar o texto, pressione para retornar ao modo Normal. 4. Mova o cursor para a segunda linha marcada ---> e repita os passos 2 e 3 para corrigir o texto. ---> Há algum texto faltando des Há algum texto faltando desta linha. Há algum texto faltan ---> Há algum texto faltando aqui. 5. Quando se sentir confortável adicionando texto, mova para a lição 1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lição 1.6: EDITANDO UM ARQUIVO ** Use :wq para salvar um arquivo e sair. ** !! NOTA: Antes de executar qualquer um dos passos abaixo, leia esta lição completamente!! 1. Saia deste tutorial como o fez na lição 1.2: :q! Ou, se tiver acesso a outro terminal, faça o seguinte nele. 2. No prompt do shell, digite esse comando: vim tutor 'vim' is é comando para iniciar o editor Vim e 'tutor' é o nome do arquivo que você deseja editar. Use um arquivo que possa ser modificado. 3. Insira e delete texto tal como aprendeu com as lições anteriores. 4. Salve o arquivo com as mudanças e saia do Vim com: :wq 5. Se você tiver saído do vimtutor no passo 1, reinicie o vimtutor e vá para o sumário seguinte. 6. Após ler os passos acima e compreendê-los, execute-os. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SUMÁRIO DA LIÇÃO 1 1. O cursor é movido usando tanto as teclas de seta quanto as teclas hjkl. h (esquerda) j (para baixo) k (para cima) l (direita) 2. Para entrar no Vim a partir de um shell digite: vim NOMEDOARQUIVO 3. Para sair do Vim digite: :q! para descartar as alterações. OU digite: :wq para salvar as alterações. 4. Para deletar um caractere sob o cursor no modo Normal digite: x 5. Para inserir texto na posição do cursor enquanto estiver no modo Normal digite: i digite o texto inserir depois do cursor A digite o texto adicionar no final da linha NOTA: Pressionando você irá para o modo Normal ou cancelará um comando ainda incompleto. Agora continue com a Lição 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lição 2.1: COMANDOS DE DELEÇÃO ** Digite dw para deletar até o final de uma palavra. ** 1. Pressione para ter certeza de que está no modo Normal. 2. Mova o cursor até a linha abaixo marcada com --->. 3. Mova o cursor até o começo da palavra que precisa ser deletada. 4. Digite dw para fazer a palavra desaparecer. NOTA: A letra d vai aparece na última linha da tela enquanto você a digita. O Vim está lhe esperando digitar um w . Se você digitou alguma coisa errada, pressione e comece de novo. ---> Tem a algumas oi palavras diversão que não pertencem papel a esta sentença. 5. Repita os passos 3 ao 4 até que a sentença esteja correta e vá para a Lição 2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lição 2.2: MAIS COMANDOS DE DELEÇÃO ** Digite d$ para deletar até o final da linha. ** 1. Pressione para ter certeza de estar no modo Normal. 2. Mova o cursor até a linha abaixo marcada com --->. 3. Mova o cursor até o fim da linha correta (DEPOIS do primeiro .). 4. Digite d$ para deletar até o final da linha. ---> Alguém digitou o final desta linha duas vezes. desta linha duas vezes. 5. Vá para a lição 2.3 para entender o que está acontecendo. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lição 2.3: SOBRE OPERADORES E MOVIMENTOS Muitos comandos que mudam texto são feitos de um operador e um movimento. O formato para um comando deletar com o operador de deleção d tem a seguinte forma: d movimento Onde: d - é o operador deletar. movimento - é como o operador vai operar (listado abaixo). Uma pequena lista de teclas de movimento: w - do cursor até o fim da palavra, incluindo o espaço. e - do cursor até o fim da palavra, NÃO incluindo o espaço. $ - do cursor até o fim da linha. Portanto, digitando de irá deletar do cursor ao fim da palavra. NOTA: Pressionando apenas a tecla de movimento enquanto em modo Normal, sem o operador, irá mover o cursor como especificado na lista de teclas de movimento. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lição 2.4: USANDO UM CONTADOR PARA UM MOVIMENTO ** Digitando um número antes de um movimento repete-o muitas vezes. ** 1. Mova o cursor para o começo da linha marcada com ---> abaixo. 2. Digite 2w para mover o cursor duas palavras adiante. 3. Digite 3e para mover o cursor para o fim da terceira palavra adiante. 4. Digite 0 (zero) para mover para o início da linha. 5. Repita os passos 2 e 3 com diferentes números. ---> Esta é uma linha com algumas palavras para lhe permitir fazer movimentos. 6. Vá para a Lição 2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lição 2.5: USANDO UM CONTADOR PARA DELETAR MAIS ** Digitando um número com um operador repete-o esse número de vezes. ** Você deve inserir um contador entre o operador de deleção e o movimento mencionados acima para para deletar mais: d número movimento 1. Movimente o cursor para a primeira palavra com LETRAS MAIÚSCULAS na linha marcada com --->. 2. Digite d2w para deletar as duas palavras com LETRAS MAIÚSCULAS. 3. Repita os passos 1 e 2 com diferentes contadores para deletar as palavras de LETRAS MAIÚSCULAS com um comando. ---> esta ABC DE linha FGHI JK LMN OP de palavras está Q RS TUV limpa. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lição 2.6: OPERANDO SOBRE LINHAS ** Digite dd para deletar uma linha inteira. ** Em virtude da frequência em deletar uma linha inteira, os projetistas do Vi decidiram que seria mais simples digitar dois d's numa linha para deletá-la. 1. Mova o cursor até a segunda linha na lista a baixo. 2. Digite dd para deletar a linha. 3. Agora mova até a quarta linha. 4. Digite 2dd para deletar duas linhas. ---> 1) Rosas são vermelhas, ---> 2) Lama é divertida, ---> 3) Violetas são azuis, ---> 4) Eu tenho um carro, ---> 5) Relógios dizem as horas, ---> 6) Açúcar é doce, ---> 7) E assim é você. Notas do tradutor: Lama (mud) em inglês pode significar fofoca, difamação. Há rima no texto original. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lição 2.7: O COMANDO UNDO (DESFAZER) ** Pressione u para desfazer os últimos comandos, U restaura linha inteira.** 1. Mova o cursor para a linha abaixo marcada com ---> e posicione-o sobre o primeiro erro. 2. Digite x para deletar o primeiro caractere indesejado. 3. Agora, digite u para desfazer o último comando executado. 4. Desta vez, corrija todos os erros na linha usando o comando x . 5. Agora, digite um U maiúsculo para retornar a linha ao seu estado original. 6. Digite u algumas vezes para desfazer o U e os comandos anteriores. 7. Digite CTRL-R (segurando a tecla CTRL enquanto digita R) algumas vezes para refazer os comandos (desfazer os undo's). ---> Corriija os erros nnesta linha e reetorne-os com undo. 8. Esses comandos são muito úteis. Agora vá para o sumário da Lição 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SUMÁRIO DA LIÇÃO 2 1. Para deletar do cursor até o fim de uma palavra digite: dw 2. Para deletar do cursor até o fim de uma linha digite: d$ 3. Para deletar uma linha inteira digite: dd 4. Para repetir um movimento adicione antes um número: 2w 5. O formato para um comando no modo Normal é: operador [número] movimento onde: operador - é o que será feito, como d para deletar número - é quantas vezes o comando será repetido movimento - movimento sobre o texto que sofrerá a operação, como w (palavra), $ (até o final da linha), etc. 5. Para desfazer um ação anterior, digite: u (minúsculo) Para desfazer todas as modificações em uma linha digite: U (maiúsculo) Para desfazer o que foi desfeito digite: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lição 3.1: O COMANDO PUT (PÔR) ** Digite p para colocar a última deleção após o cursor. ** 1. Mova o cursor até a primeira linha na lista abaixo. 2. Digite dd para deletar a linha e guardá-la no buffer do Vim. 3. Mova o cursor até a linha ACIMA de onde a linha deletada deve ficar. 4. No modo Normal, digite p para inserir a linha. 5. Repita os passos 2 ao 4 para pôr todas as linhas na ordem correta. d) Você pode aprender também? b) Violetas são azuis, c) Inteligência se aprende, a) Rosas são vermelhas, Nota do tradutor: Há rima no original. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lição 3.2: O COMANDO REPLACE (SUBSTITUIR) ** Digite rx para substituir o caractere sob o cursor por x . ** 1. Mova o cursor até a primeira linha abaixo marcada com --->. 2. Mova o cursor até que ele esteja sobre o primeiro erro. 3. Digite r e então o caractere que deveria estar lá. 4. Repita os passos 2 e 3 até que a primeira linha esteja correta. ---> Quendo este limha foi dugitada, alguem pressioniu algumas teclas erradzs! ---> Quando esta linha foi digitada, alguém pressionou algumas teclas erradas! 5. Agora vá para a Lição 3.3. NOTA: Lembre-se que você deve aprender pelo uso, não pela memorização. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lição 3.3: O OPERADOR CHANGE (MUDAR) ** Para mudar toda uma palavra ou parte dela, digite cw . ** 1. Mova o cursor até a primeira linha abaixo marcada com --->. 2. Posicione o cursor sobre o u em lunba. 3. Digite cw e a palavra correta (nesse caso, digite 'inha'.) 4. Pressione e mova para o próximo caractere a ser alterado. 5. Repita os passos 3 e 4 até que a primeira sentença esteja igual à segunda. ---> Essa lunba tem pwlesmfr que ocrimmm soi alteradas cup o comando change. ---> Essa linha tem palavras que precisam ser alteradas com o comando change. Note que cw não somente substitui a palavra, mas também lhe coloca no modo de inserção. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lição 3.4: MAIS MUDANÇAS USANDO c ** O operador change é usado com os mesmos objetos que delete. ** 1. O operador change trabalha da mesma maneira que o delete. O formato é: c [número] movimento 2. Os movimentos também são os mesmos: w (palavra), $ (fim da linha), etc. 3. Mova até a primeira linha abaixo marcada com --->. 4. Mova o cursor até o primeiro erro. 5. Digite c$ para fazer o resto da linha ficar igual à segunda e pressione . ---> O fim desta linha precisa de ajuda para ficar igual à segunda. ---> O fim desta linha precisa ser corrigido usando o comando c$. NOTA: Você pode usar a tecla Backspace para corrigir erros enquanto digita. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SUMÁRIO DA LIÇÃO 3 1. Para inserir um texto que já foi deletado, digite p . Isso coloca o texto deletado APÓS o cursor (se uma linha é deletada ela será inserida na linha abaixo do cursor). 2. Para substituir o caractere sob o cursor, digite r e então o caractere que irá substituir o original. 3. O comando change possibilita mudar do cursor até onde o movimento for. Ex: Digite cw para mudar do cursor até o fim de uma palavra, c$ para mudar até o fim da linha. 4. O formato para uma operação change é: c [número] movimento Agora vá para a próxima lição. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lição 4.1: LOCALIZAÇÃO DO CURSOR E STATUS DO ARQUIVO ** Digite CTRL-G para mostrar sua localização no arquivo e seu status. Digite G para mover para uma linha do arquivo. ** Nota: Leia esta lição inteira antes de executar qualquer um dos passos!! 1. Segure pressionada a tecla Ctrl e pressione g . Nós chamamos isso de CTRL-G. Uma mensagem aparecerá no rodapé da página com o nome do arquivo e a sua posição no arquivo. Lembre-se do número da linha para o Passo 3. NOTA: A posição do cursor pode estar visível no canto direito inferior da tela. Isso acontece quando a opção 'ruler' está ativa (veja :help 'ruler' ). 2. Pressione G para mover para o final do arquivo. Digite gg para mover para o início do arquivo. 3. Digite o número da linha em que você estava e então G . Isto retornará o cursor à linha em que você estava quando pressionou CTRL-G. 4. Se você estiver confiante para fazer isto, execute os passos 1 ao 3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lição 4.2: O COMANDO SEARCH (PROCURA) ** Digite / seguido por uma string para procurar pela string. ** 1. No modo Normal digite o caractere / . Note que ele e o cursor aparecem no rodapé da tela, como ocorre com o comando : . 2. Agora digite 'errroo' . Esta é a palavra que você quer procurar. 3. Para procurar pela mesma palavra de novo, simplesmente tecle n . Para procurar pela mesma palavra na direção oposta, tecle N . 4. Se você quer procurar por uma string no sentido de frente para trás, use ? em vez de / . 5. Para voltar para onde estava, pressione CTRL-O (mantenha a tecla Ctrl pressionada e pressione a tecla o). Repita para voltar outras posições. CTRL-I segue para posições mais recentes. ---> "errroo" não é uma maneira de escrever erro; errroo é um erro. NOTA: Quando a busca atinge o final do arquivo ela continuará do começo, a menos que a opção 'wrapscan' esteja desativada. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lição 4.3: PROCURA POR CASAMENTO DE PARÊNTESES ** Digite % para achar um casamento de ),], ou } . ** 1. Posicione o cursor em qualquer (, [, ou { na linha abaixo marcada com --->. 2. Agora digite o caractere % . 3. O cursor deve estar no parênteses ou colchetes que casa com o primeiro. 4. Digite % para mover o cursor de volta ao primeiro colchete ou parênteses (por casamento). ---> Isto ( é uma linha de teste contendo ('s, ['s ] e {'s }. )) Nota: Isso é muito útil para corrigir um programa com parênteses não-casados! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lição 4.4: O COMANDO SUBSTITUIR ** Digite :s/velho/novo/g para substituir 'velho' por 'novo'. ** 1. Mova o cursor para a linha abaixo marcada com --->. 2. Digite :s/aa/a . Note que este comando somente muda a primeira ocorrência na linha. 3. Agora digite :s/aa/a/g significando substituir globalmente na linha. Isto muda todas as ocorrências na linha. ---> aa melhor época para ver aas flores é aa primavera. 4. Para mudar toda ocorrência de uma string entre duas linhas, digite :#,#s/velho/novo/g onde #,# são os números das duas linhas. Digite :%s/velho/novo/g para mudar todas as ocorrências no arquivo inteiro. Digite :%s/velho/novo/gc para mudar todas as ocorrência no arquivo inteiro, com a opção de confirmar cada substituição. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SUMÁRIO DA LIÇÃO 4 1. CTRL-G mostra a sua localização no arquivo e o status do mesmo. G move para o final do arquivo. número G move para esta linha com esse número. gg move para a primeira linha. 2. Digitando / seguido por uma expressão procura À FRENTE por ela. Digitando ? seguido por uma expressão procura pela expressão de TRÁS PARA FRENTE. Após uma busca, digite n para achar a próxima ocorrência na mesma direção ou N para procurar na direção oposta. CTRL-O leva a posições antigas e CTRL-I a posições mais recentes. 3. Digitando % enquanto o cursor está sobre um (,),[,],{, ou } localiza o par que casa com ele. 4. Para substituir: o primeiro 'velho' de uma linha por 'novo' digite :s/velho/novo todos os 'velho's em uma linha por 'novo' digite :s/velho/novo/g expressões entre dois números (#) de linhas digite :#,#s/velho/novo todas as ocorrências no arquivo digite :%s/velho/novo/g Para confirmar cada substituição adicione 'c' :%s/velho/novo/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lição 5.1: COMO EXECUTAR UM COMANDO EXTERNO ** Digite :! seguido por um comando externo para executar esse comando. ** 1. Digite o familiar comando : para levar o cursor ao rodapé da tela. Isso lhe permite entrar um comando. 2. Agora digite o caractere ! (ponto de exclamação). Isso lhe permite executar qualquer comando do shell. 3. Como um exemplo digite ls seguindo o ! e então tecle . Isto irá mostrar uma listagem do seu diretório, como se você estivesse no prompt do shell. Ou use :!dir se ls não funcionar. NOTA: É possível executar qualquer comando externo dessa maneira, inclusive com argumentos. NOTA: Todos os comandos : devem ser finalizados teclando-se Daqui em diante não iremos mencionar isso sempre. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lição 5.2: MAIS SOBRE SALVAR ARQUIVOS ** Para salvar as alterações no texto, digite :w NOMEDOARQUIVO. ** 1. Digite :!dir ou :!ls para ter uma listagem de seu diretório. Você já deve saber que precisa teclar depois disso. 2. Escolha um nome de arquivo que ainda não exista, como TESTE. 3. Agora digite: :w TESTE (onde TESTE é o nome que você escolheu.) 4. Isto salva o arquivo inteiro (o Vim Tutor) com o nome TESTE. Para verificar isso, digite :!ls de novo para ver seu diretório NOTA: Se você sair do Vim e entrar de novo com o nome do arquivo TESTE, o arquivo deve ser uma cópia exata do tutor quando você o salvou. 5. Agora remova o arquivo digitando (MS-DOS): :!del TESTE ou (Unix): :!rm TESTE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lição 5.3: SELECIONANDO O TEXTO A SER SALVO ** Para salvar parte de um arquivo, digite v movimento NOMEDOARQUIVO ** 1. Mova o cursor para esta linha. 2. Pressione v e mova o cursor para o quinto item abaixo. Note que o texto é realçado. 3. Pressione o caractere : e note que aparecerá :'<,'> no lado inferior da tela. 4. Digite w TESTE , sendo TESTE um nome de arquivo que não existe ainda. Você deverá ver :'<,'>w TESTE antes de pressionar . 5. O Vim salvará as linhas selecionadas no arquivo TESTE. Use :!dir ou !:ls para vê-lo. Não o apague agora! Nós o usaremos na próxima lição. NOTA: Pressionando v inicia o modo Visual de seleção. Você pode mover o cursor pela tela para tornar a seleção maior ou menor. Pode, então, usar um operador para executar alguma ação. Por exemplo, d deleta o texto. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lição 5.4: RECUPERANDO E JUNTANDO ARQUIVOS ** Para inserir o conteúdo de um arquivo, digite :r NOMEDOARQUIVO ** 1. Posicione o cursor logo acima desta linha. NOTA: Depois de executar o Passo 2 você verá a lição 5.3. Então DESÇA o cursor para ver esta lição novamente. 2. Agora recupere o arquivo TESTE usando o comando :r TESTE onde TESTE é o nome do arquivo. O arquivo recuperado é colocado abaixo da linha atual do cursor. 3. Para verificar que o arquivo foi recuperado, volte com o cursor e verifique que agora existem duas cópias da Lição 5.3, a original e a versão do arquivo. NOTA: Você também pode ler a saída de um comando externo. Por exemplo, :r !ls lê a saída do comando ls e coloca o resultado abaixo do cursor. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SUMÁRIO DA LIÇÃO 5 1. :!comando executa um comando externo. Alguns exemplos úteis são: (MS-DOS) (UNIX) :!dir :!ls - lista conteúdo do diretório. :!del ARQUIVO :!rm ARQUIVO - remove ARQUIVO. 2. :w ARQUIVO salva o atual arquivo do Vim para o disco com o nome ARQUIVO. 3. v movimento :w ARQUIVO salva as linhas Visualmente selecionadas em ARQUIVO. 4. :r ARQUIVO recupera ARQUIVO do disco e o insere dentro do arquivo atual na posição do cursor. 5. :r !dir lê a saída do comando dir e coloca o resultado abaixo da posição atual do cursor. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lição 6.1: O COMANDO OPEN (ABRIR) ** Digite o para abrir uma linha embaixo do cursor e ir para o modo de Inserção (INSERT). ** 1. Mova o cursor para a linha abaixo marcada com --->. 2. Digite o (minúsculo) para abrir uma linha ABAIXO do cursor e ir para o modo de Inserção (INSERT). 3. Agora digite algum texto e pressione para sair do modo de Inserção. ---> Após teclar o o cursor é colocado na linha aberta no modo de Inserção. 4. Para abrir uma linha ACIMA do cursor, simplesmente tecle um O maiúsculo, em vez de um o minúsculo. Tente isso na linha abaixo. ---> Abra uma linha acima desta teclando O enquanto o cursor está nesta linha. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lição 6.2: O COMANDO APPEND ** Digite a para inserir texto DEPOIS do cursor. ** 1. Mova o cursor para o início da linha marcada com ---> . 2. Pressione e até o cursor ficar sobre o final de li . 3. Digite um a (minúsculo) para adicionar texto DEPOIS do caractere sob o cursor. 4. Complete a palavra conforme a linha abaixo. Pressione para sair do modo de Inserção. 5. Use e para mover para a próxima palavra incompleta repita os passos 3 e 4. ---> Esta lin lhe permite pratic a adiç de texto a uma linha. ---> Esta linha lhe permite praticar a adição de texto a uma linha. NOTA: a, i e A levam ao mesmo modo de Inserção, a única diferença é onde os caracteres são inseridos. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lição 6.3: UMA OUTRA VERSÃO DO REPLACE (SUBSTITUIR) ** Digite um R maiúsculo para substituir mais de um caractere. ** 1. Mova o cursor para a primeira linha abaixo marcada com --->. Mova o cursor para o início do primeiro xxx . 2. Agora pressione R e digite os números que estão abaixo dele, na segunda linha, para substituir o xxx . 3. Pressione para sair do modo de Substituição. Note que o resto da linha permanece inalterada. 4. Repita os passos para substituir os xxx restantes. ---> Adicionando 123 a xxx resulta em xxx. ---> Adicionando 123 a 456 resulta em 579. NOTA: O modo de Substituição é como o modo de Inserção, mas cada caractere digitado deleta um caractere existente. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lição 6.4: COPIAR E COLAR TEXTO ** Use o operador y para copiar texto e p para colá-lo. ** 1. Vá para a linha marcada com ---> abaixo e posicione o cursor após "a)". 2. Inicie o modo Visual com v e mova o cursor para logo antes de "primeiro". 3. Digite y para copiar o texto selecionado. 4. Mova o cursor para o final da próxima linha: j$ 5. Digite p par pôr (colar) o texto. Então, digite: o segundo . 6. Use o modo Visual para selecionar " item.", copie-o com y , mova para o fina da próxima linha com j$ e ponha (cole) o texto com p . ---> a) esse é o primeiro item. b) NOTA: Você também pode usar y como um operador; por exemplo, yw copia uma palavra. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lição 6.5: CONFIGURAR PREFERÊNCIAS ** Configurar uma preferência de modo que um search ou substitute ignora se as letras estão em maiúsculas ou minúsculas. ** 1. Procure por 'ignore' entrando: /ignore Repita várias vezes teclando n . 2. Configure a opção 'ic' (Ignore case) digitando: :set ic 3. Agora procure por 'ignore' de novo teclando: n Repita várias vezes. 4. Configure as opções 'hlsearch' e 'incsearch': :set hls is 5. Agora entre com o comando search de novo, e veja o que acontece: /ignore 6. Para desabilitar a desconsideração de maiúsculas e minúsculas: :set noic NOTA: Para remover o realce dos termos localizados entre: :nohlsearch NOTA: Se quiser ignorar a diferença entre maiúsculas e minúsculas em apenas uma pesquisa, use \c no comando: /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SUMÁRIO DA LIÇÃO 6 1. Digite o para abrir uma linha ABAIXO do cursor e iniciar o modo de Inserção. Digite O para abrir uma linha ACIMA da linha onde o cursor está. 2. Digite a para adicionar texto DEPOIS do caractere onde está o cursor. Digite A para adicionar texto ao final da linha. 3. O comando e move o cursor para o final de uma palavra. 4. O operador y copia texto, p põe (cola) o texto copiado. 5. Digitando R entra-se no modo de Substituição até que seja pressionado. 6. Digitando ":set xxx" modifica-se a opção "xxx". Algumas opções são: 'ic' 'ignorecase' ignora diferença entre maiúsculas/minúsculas 'is' 'incsearch' realiza a busca enquanto se digita 'hls' 'hlsearch' realça todos os trechos localizados Você tanto pode usar o nome curto quanto o nome longo da opção. 7. Adicione o prefixo "no" para desabilitar uma opção: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LIÇÃO 7.1: OBTENDO AJUDA ** Usar o sistema de ajuda do próprio Vim ** O Vim possui sistema de ajuda abrangente. Para começar, tente algum desses três: - pressione a tecla (se você tiver uma) - pressione a tecla (se você tiver uma) - digite :help Leia o texto da ajuda para aprender como o sistema de ajuda funciona. Digite CTRL-W CTRL-W para pular de uma janela para outra. Digite :q para fechar a janela da ajuda. Você pode achar ajuda sobre qualquer assunto, fornecendo um argumento para o comando ":help". Tente isto (não esqueça de pressionar ): :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lição 7.2: CRIAR UM SCRIPT DE INICIALIZAÇÃO ** Habilitar recursos do Vim ** O Vim tem muito mais recursos do que o Vi, mas na sua maioria eles são desabilitados por padrão. Para usar mais recursos, você tem que criar um arquivo "vimrc". 1. Comece a editar o arquivo "vimrc". Isso depende do sistema: :e ~/.vimrc para Unix :e $VIM/_vimrc para MS-Windows 2. Agora, leia o conteúdo do arquivo "vimrc" de exemplo: :r $VIM/vimrc_example.vim 3. Salve o arquivo com: :w Da próxima vez que o Vim for iniciado, ele irá usar realce de sintaxe. Você pode adicionar suas configurações preferidas para esse arquivo "vimrc". Para maiores informações, digite: :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lição 7.3: COMPLETAÇÃO ** Completação da linha de comando com CTRL-D e ** 1. Certifique-se de que o Vim não está no modo compatível: :set nocp 2. Olhe quais arquivos existem no diretório: :!ls ou :!dir 3. Digite o início de um comando: :e 4. Pressione CTRL-D e o Vim irá mostrar a lista dos comandos iniciados com "e". 5. Pressione e o Vim irá completar o nome do comando para ":edit". 6. Agora, adicione um espaço e o início do nome de um arquivo existente: :edit ARQ 7. Pressione . O Vim irá completar o nome (se ele for único). NOTA: A completação funciona com muitos comandos. Basta pressionar CTRL-D e . Isso é especialmente útil para :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SUMÁRIO DA LIÇÃO 7 1. Digite :help ou pressione ou para abrir a janela de ajuda. 2. Digite :help cmd para achar a ajuda sobre cmd . 3. Digite CTRL-W CTRL-W para pular de uma janela para outra. 4. Digite :q para fechar a janela de ajuda. 5. Crie um script de inicialização vimrc para ativar automaticamente as suas configurações preferidas. 6. Quando pressionando um comando : , pressione CTRL-D para ver as possibilidade de completação. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Isto conclui o Vim tutor. Ele pretendeu dar uma breve apresentação do editor Vim, somente o bastante para que você possa usar o editor com facilidade. Ele está longe de ser completo, uma vez que o Vim possui muitos, muitos mais comandos. O próximo passo é ler o manual: ":help user-manual". Livro recomendado em Português sobre o Vim: O editor de texto Vim - de Sérgio Luiz Araújo da Silva et al. http://code.google.com/p/vimbook/ Para futura leitura e estudo, este livro é recomendado: Vim - Vi Improved - de Steve Oualline Editora: New Riders Este é o primeiro livro completamente dedicado ao Vim. Especialmente útil para iniciantes, com muitos exemplos e ilustrações. Veja http://iccf-holland.org/click5.html Esse livro é mais antigo e mais sobre o Vi do que sobre o Vim, mas também é recomendado: Learning the Vi Editor - de Linda Lamb Editora: O'Reilly & Associates Inc. Este é um bom livro para aprender quase tudo o que você quer fazer com o Vi. A sexta edição também inclui informações sobre o Vim. Este tutorial foi escrito por Michael C. Pierce e Robert K. Ware, Colorado School of Mines, usando idéias fornecidas por Charles Smith, Colorado State University. E-mail: bware@mines.colorado.edu. Modificado para o Vim por Bram Moolenaar. Versão 1.4 traduzida para o português por Marcelo Drudi Miranda, Escola Politécnica da Universidade de São Paulo. Revisão e atualização da tradução para a versão 1.7 por Jakson Aquino, Universidade Federal do Ceará: E-mail: jalvesaq@gmail.com Last Change: 2010 Jul 27 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim-7.4.1689/runtime/tutor/tutor.ru000066400000000000000000001062671267703067000171760ustar00rootroot00000000000000=============================================================================== = VIM -- 1.7 = =============================================================================== 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. ! , , (Normal mode). . ! () . , hjkl , . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1.2: VIM !! ! , , !! 1. ( , , (Normal mode)). 2. : :q! . ( , :q! .) . 3. , , . : vimtutor 4. , , 1 3 . ! :q! . . 5. 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1.3: -- ** x . ** 1. , --->. 2. , , . 3. x . 4. 2 4 . ---> . 5. , , 1.4. ! , . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1.4: -- ** , i . ** 1. , --->. 2. , , . 3. i . 4. . 2 4, . ---> . ---> . 5. , 1.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1.5: -- ** , A . ** 1. , --->. . 2. A . 3. . 4. , ---> 2 4 . ---> . ---> . 5. , 1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1.6: ** :wq Vim. ** !! ! , , !! 1. Vim, 1.2: :q! , , Σ. 2. : vim tutor `vim' -- Vim, `tutor' -- . , . 3. , . 4. Vim : :wq 5. vimtutor 1, vimtutor . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 1. , hjkl. h () j () k () l () 2. Vim ( ) : vim _ 3. Vim : :q! . : :wq . 4. , : x 5. , : i : a ! (Normal mode) ף ۣ . 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2.1: ** dw . ** 1. , . 2. , --->. 3. , . 4. dw . ! dw . - ң , . ---> . 5. 3 4, 2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2.2: ** d$ . ** 1. , . 2. , --->. 3. ( ). 4. d$ . ---> - . . 5. , , 2.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2.3: , , . d : d : d - . - ( ). : w - , . e - , . $ - . ^ - . ! (Normal mode) , . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2.4: ** ģ . ** 1. ---> . 2. 2w ң . 3. 3e ң . 4. 0 () . 5. 2 3 . ---> . 6. 2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2.5: ** ģ . ** : d 1. ---> . 2. d2w . 3. 1 2 . ---> . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2.6: ** dd . ** , Vi d. 1. , . 2. dd . 3. ף . 4. 2dd . ---> 1) , ---> 2) , ! ---> 3) ``'', ``'' --- ! ---> 4) ! ---> 5) ... ---> 6) `' ---> 7) . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2.7: `' ** 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. : 2w 5. : [] [] : [] - , - , d - , w (), $ ( ), .. 6. : 0 7. () : 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.3. ! , , . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3.3: ** ce . ** 1. , --->. 2. `o' `'. 3. ce ( , `'). 4. ( , ). 5. 3 4 . ---> . ---> . , ce , . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3.4: c ** , . ** 1. , . : [] c c [] 2. : w (), $ ( ) .. 3. , --->. 4. . 5. c$ , , . ---> , . ---> c$ . ! Backspace . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 1. , ̣, p . ̣ ( , ). 2. r . 3. . , ce , c$ . 4. : [] c c [] . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4.1: ** CTRL-g . G (SHIFT-G) . ** ! ! 1. Ctrl g . , . , 3. 2. Shift g . 3. , Shift-G. Σ , , Ctrl-g. 4. , 1 3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4.2: ** / . ** 1. (Normal mode) / . , , : . 2. '' . , . 3. , , n . , Shift-N . 4. , ? / . 5. , , Ctrl-O. ( Ctrl o ). . ң Ctrl-I . ---> "" `'; . ! , . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4.3: ** % ), ] } . ** 1. (, [ { , --->. 2. % . 3. . 4. % . ---> ( , (, [ ] { } . )) ! ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4.4: ** :s///g '' ''. ** 1. , --->. 2. :s// . , . 3. :s///g , g . . ---> , , . 4. , :#,#s///g #,# -- . :%s///g . :%s///gc . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 1. Ctrl-g . Shift-G . , Shift-G . gg . 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 ! . , , . :!dir , ls . ! . ! , : , . . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5.2: ** , ģ , :w _. ** 1. :!dir :!ls . , . 2. , ݣ , TEST. 3. :w TEST ( TEST -- , .) 4. ( Vim) TEST. , :!dir :!ls . ! Vim TEST (.. vim TEST ), , . 5. , MS-DOS :!del TEST Unix :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5.3: ** , v ţ :w _ ** 1. . 2. v . , . 3. : :'<,'> . 4. w TEST ( TEST -- , ݣ ). , :'<,'>w TEST. 5. Vim TEST. , :!dir :!ls . , . ! v . . - , , d. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5.4: ** , :r _ ** 1. . ! 2 5.3. . 2. TEST, :r TEST , TEST -- . 3. , , Σ 5.3: TEST. ! . , :r !ls ls . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 1. :! . : (MS-DOS) (Unix) :!dir :!ls -- . :!del :!rm -- . 2. :w _ Vim . 3. v :w _ . 4. :r _ . 5. :r !dir dir . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6.1: ** o (Insert mode) ** 1. , --->. 2. o ( ) , (Insert mode). 3. - . ---> o ģ . 4. , O , o . . ---> , ţ Shift-O. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6.2: ** a , . ** 1. , --->. 2. e c . 3. a ( ) , . ( A .) 4. , . (Insert mode). 5. e ۣ 3 4. ---> . ---> . ! a , i A , , . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6.3: ** R . ** 1. , --->, xxx. 2. R xxx. 3. . Σ. 4. xxx. ---> 123 xxx xxx. ---> 123 456 579. ! , ģ . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6.4: ** y p ** 1. , --->, `)'. 2. v `'. 3. y . 4. j$ . 5. p . `' . ---> ) . ) ! yw ( y w ) . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6.5: ** ** 1. `', : / . , n . 2. `ic' ( ), : :set ic 3. `', : n , `' `'. 4. `hlsearch' `incsearch': :set hls is 5. , : / 6. ޣ : :set noic ! : :nohlsearch ! , \ : /\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6 1. o . O . 2. a . A . 3. e . 4. y , p -- . 5. R . 6. `:set xxx' `xxx', : `ic' `ignorecase' `is' `incsearch' `hls' `hlsearch' 7. `no' : :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 7.1: ** ** Vim . ң : - ( ) - ( ) - :help . CTRL-W CTRL-W . :q . , `:help'. ( ): :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 7.2: ** Vim ** Vim , Vi, . `vimrc'. 1. `vimrc'. : :e ~/.vimrc Unix :e $VIM/_vimrc MS-Windows 2. `vimrc': :r $VIMRUNTIME/vimrc_example.vim 3. `vimrc': :w Vim . , , `vimrc'. :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 7.3: ** CTRL-D ** 1. , Vim : :set nocp 2. : :!ls :!dir 3. : :e 4. CTRL-D Vim `e'. 5. Vim `:edit'. 6. : :edit 7. Vim , . ! . CTRL-D . :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 7 1. :help , . 2. :help cmd . 3. CTRL-W CTRL-W . 4. :q ( ). 5. `vimrc'. 6. : , CTRL-D . . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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. Michael C. Pierce Robert K. Ware, Colorado School of Mines , Charles Smith, Colorado State University. E-mail: bware@mines.colorado.edu. Vim (Bram Moolenaar). : , 2002. ̣ , 2014. Translators: Andrey Kiselev , 2002. Sergey Alyoshin , 2014. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim-7.4.1689/runtime/tutor/tutor.ru.cp1251000066400000000000000000001062671267703067000201100ustar00rootroot00000000000000=============================================================================== = VIM -- 1.7 = =============================================================================== 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. ! , , (Normal mode). . ! () . , hjkl , . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1.2: VIM !! ! , , !! 1. ( , , (Normal mode)). 2. : :q! . ( , :q! .) . 3. , , . : vimtutor 4. , , 1 3 . ! :q! . . 5. 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1.3: -- ** x . ** 1. , --->. 2. , , . 3. x . 4. 2 4 . ---> . 5. , , 1.4. ! , . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1.4: -- ** , i . ** 1. , --->. 2. , , . 3. i . 4. . 2 4, . ---> . ---> . 5. , 1.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1.5: -- ** , A . ** 1. , --->. . 2. A . 3. . 4. , ---> 2 4 . ---> . ---> . 5. , 1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1.6: ** :wq Vim. ** !! ! , , !! 1. Vim, 1.2: :q! , , . 2. : vim tutor `vim' -- Vim, `tutor' -- . , . 3. , . 4. Vim : :wq 5. vimtutor 1, vimtutor . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 1. , hjkl. h () j () k () l () 2. Vim ( ) : vim _ 3. Vim : :q! . : :wq . 4. , : x 5. , : i : a ! (Normal mode) . 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2.1: ** dw . ** 1. , . 2. , --->. 3. , . 4. dw . ! dw . - , . ---> . 5. 3 4, 2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2.2: ** d$ . ** 1. , . 2. , --->. 3. ( ). 4. d$ . ---> - . . 5. , , 2.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2.3: , , . d : d : d - . - ( ). : w - , . e - , . $ - . ^ - . ! (Normal mode) , . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2.4: ר ** . ** 1. ---> . 2. 2w . 3. 3e . 4. 0 () . 5. 2 3 . ---> . 6. 2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2.5: ר ** . ** : d 1. ---> . 2. d2w . 3. 1 2 . ---> . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2.6: ** dd . ** , Vi d. 1. , . 2. dd . 3. . 4. 2dd . ---> 1) , ---> 2) , ! ---> 3) ``'', ``'' --- ! ---> 4) ! ---> 5) ... ---> 6) `' ---> 7) . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2.7: `' ** 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. : 2w 5. : [] [] : [] - , - , d - , w (), $ ( ), .. 6. : 0 7. () : 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.3. ! , , . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3.3: ** ce . ** 1. , --->. 2. `o' `'. 3. ce ( , `'). 4. ( , ). 5. 3 4 . ---> . ---> . , ce , . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3.4: c ** , . ** 1. , . Ÿ : [] c c [] 2. : w (), $ ( ) .. 3. , --->. 4. . 5. c$ , , . ---> , . ---> c$ . ! Backspace . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 1. , , p . ( , ). 2. r . 3. . , ce , c$ . 4. : [] c c [] . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4.1: ** CTRL-g . G (SHIFT-G) . ** ! ! 1. Ctrl g . , . , 3. 2. Shift g . 3. , Shift-G. , , Ctrl-g. 4. , 1 3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4.2: ** / . ** 1. (Normal mode) / . , , : . 2. '' . , . 3. , , n . , Shift-N . 4. , ? / . 5. , , Ctrl-O. ( Ctrl o ). . Ctrl-I . ---> "" `'; . ! , . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4.3: ** % ), ] } . ** 1. (, [ { , --->. 2. % . 3. . 4. % . ---> ( , (, [ ] { } . )) ! ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4.4: ** :s///g '' ''. ** 1. , --->. 2. :s// . , . 3. :s///g , g . . ---> , , . 4. , :#,#s///g #,# -- . :%s///g . :%s///gc . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 1. Ctrl-g . Shift-G . , Shift-G . gg . 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 ! . , , . :!dir , ls . ! . ! , : , . . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5.2: ** , , :w _. ** 1. :!dir :!ls . , . 2. , , TEST. 3. :w TEST ( TEST -- , .) 4. ( Vim) TEST. , :!dir :!ls . ! Vim TEST (.. vim TEST ), , . 5. , MS-DOS :!del TEST Unix :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5.3: ** , v :w _ ** 1. . 2. v . , . 3. : :'<,'> . 4. w TEST ( TEST -- , ). , :'<,'>w TEST. 5. Vim TEST. , :!dir :!ls . , . ! v . . - , , d. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5.4: ** , :r _ ** 1. . ! 2 5.3. . 2. TEST, :r TEST , TEST -- . 3. , , 5.3: TEST. ! . , :r !ls ls . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 1. :! . : (MS-DOS) (Unix) :!dir :!ls -- . :!del :!rm -- . 2. :w _ Vim . 3. v :w _ . 4. :r _ . 5. :r !dir dir . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6.1: ** o (Insert mode) ** 1. , --->. 2. o ( ) , (Insert mode). 3. - . ---> o . 4. , O , o . . ---> , Shift-O. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6.2: ** a , . ** 1. , --->. 2. e c . 3. a ( ) , . ( A .) 4. , . (Insert mode). 5. e 3 4. ---> . ---> . ! a , i A , , . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6.3: ٨ ** R . ** 1. , --->, xxx. 2. R xxx. 3. . . 4. xxx. ---> 123 xxx xxx. ---> 123 456 579. ! , . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6.4: ** y p ** 1. , --->, `)'. 2. v `'. 3. y . 4. j$ . 5. p . `' . ---> ) . ) ! yw ( y w ) . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6.5: ** ** 1. `', : / . , n . 2. `ic' ( ), : :set ic 3. `', : n , `' `'. 4. `hlsearch' `incsearch': :set hls is 5. , : / 6. : :set noic ! : :nohlsearch ! , \ : /\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6 1. o . O . 2. a . A . 3. e . 4. y , p -- . 5. R . 6. `:set xxx' `xxx', : `ic' `ignorecase' `is' `incsearch' `hls' `hlsearch' 7. `no' : :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 7.1: ** ** Vim . : - ( ) - ( ) - :help . CTRL-W CTRL-W . :q . , `:help'. ( ): :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 7.2: ** Vim ** Vim , Vi, . `vimrc'. 1. `vimrc'. : :e ~/.vimrc Unix :e $VIM/_vimrc MS-Windows 2. `vimrc': :r $VIMRUNTIME/vimrc_example.vim 3. `vimrc': :w Vim . , , `vimrc'. :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 7.3: ** CTRL-D ** 1. , Vim : :set nocp 2. : :!ls :!dir 3. : :e 4. CTRL-D Vim `e'. 5. Vim `:edit'. 6. : :edit 7. Vim , . ! . CTRL-D . :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 7 1. :help , . 2. :help cmd . 3. CTRL-W CTRL-W . 4. :q ( ). 5. `vimrc'. 6. : , CTRL-D . . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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. Michael C. Pierce Robert K. Ware, Colorado School of Mines , Charles Smith, Colorado State University. E-mail: bware@mines.colorado.edu. Vim (Bram Moolenaar). : , 2002. , 2014. Translators: Andrey Kiselev , 2002. Sergey Alyoshin , 2014. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim-7.4.1689/runtime/tutor/tutor.ru.utf-8000066400000000000000000001600201267703067000201230ustar00rootroot00000000000000=============================================================================== = Д о б р о п о ж а л о в а т ь в у ч е б н и к VIM -- версия 1.7 = =============================================================================== 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. Замечание! Если вы пока не уверены в том, что набираете, нажмите для перехода в обычный режим (Normal mode). После этого перенаберите требуемую команду. Замечание! Обычные клавиши управления курсором (стрелки) также должны работать. Однако, клавиши hjkl позволят вам перемещаться значительно быстрее, как только вы научитесь ими пользоваться. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 1.2: ЗАВЕРШЕНИЕ РАБОТЫ С VIM !! ВНИМАНИЕ! Прежде, чем выполнять любой из описанных ниже шагов, прочтите урок целиком !! 1. Нажмите клавишу (для того, чтобы удостовериться, что вы в обычном режиме (Normal mode)). 2. Наберите: :q! . (Это означает, что вы должны набрать три символа :q! и нажать клавишу ввод.) Это позволит вам выйти из редактора БЕЗ СОХРАНЕНИЯ любых сделанных изменений. 3. Когда вы увидите приглашение командной оболочки, наберите команду, которая привела вас в этот учебник. Это может быть: vimtutor 4. Если вы уверены в том, что запомнили эти шаги, выполните шаги от 1 до 3 чтобы выйти снова запустить редактор. Замечание! :q! отбрасывает любые сделанные вами изменения. Через несколько уроков вы узнаете как сохранять изменения в файл. 5. Переместите курсор вниз к Уроку 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 1.3: РЕДАКТИРОВАНИЕ ТЕКСТА -- УДАЛЕНИЕ ** Находясь в обычном режиме нажмите x для удаления символа под курсором. ** 1. Переместите курсор к строке ниже, помеченной --->. 2. Для исправления ошибок, переместите курсор, пока он не окажется над удаляемым символом. 3. Нажмите клавишу x для удаления требуемого символа. 4. Повторите шаги со 2 по 4 пока строка не будет исправлена. ---> От тттопота копытт пппыль ппо ппполю леттитт. 5. Теперь, когда строка откорректирована, переходите к Уроку 1.4. Замечание! В ходе освоения этого учебника не пытайтесь запоминать, учите в процессе использования. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 1.4: РЕДАКТИРОВАНИЕ ТЕКСТА -- ВСТАВКА ** Находясь в обычном режиме, нажмите i для вставки текста. ** 1. Переместите курсор к первой строке ниже, помеченной --->. 2. Для того, чтобы сделать первую строку идентичной второй, поместите курсор на символ ПЕРЕД которым следует вставить текст. 3. Нажмите i и наберите требуемые добавления. 4. После исправления всех ошибок нажмите для возврата в обычный режим. Повторите шаги со 2 по 4, пока фраза не будет исправлена полностью. ---> Часть текста в строке бесследно . ---> Часть текста в этой строке бесследно пропала. 5. Когда освоите вставку текста, переходите к Уроку 1.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 1.5: РЕДАКТИРОВАНИЕ ТЕКСТА -- ДОБАВЛЕНИЕ ** Находясь в обычном режиме, нажмите A для добавления текста. ** 1. Переместите курсор к первой строке ниже, помеченной --->. Не имеет значения на каком символе расположен курсор на этой строке. 2. Нажмите A и наберите требуемые добавления. 3. После добавления требуемого текста нажмите для возврата в обычный режим. 4. Переместите курсор на следующую строку, помеченную ---> и повторите шаги со 2 по 4 для исправления этой строки. ---> Часть текста в этой строке бессле Часть текста в этой строке бесследно пропала. ---> Здесь также не достаёт час Здесь также не достаёт части текста. 5. Когда освоите добавление текста, переходите к Уроку 1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 1.6: РЕДАКТИРОВАНИЕ ФАЙЛА ** Используйте :wq для сохранения файла и выхода из Vim. ** !! ВНИМАНИЕ! Прежде, чем выполнять любой из описанных ниже шагов, прочтите урок целиком !! 1. Выйдите из Vim, как вы это узнали в Уроке 1.2: :q! Или, если у вас есть доступ к другому терминалу, можете сделать следующее в нём. 2. По приглашению командной оболочки введите следующую команду: vim tutor `vim' -- команда для запуска редактора Vim, а `tutor' -- имя файла для редактирования. Используете имя файла, который можно изменять. 3. Вставляйте и удаляйте текст, как вы научились в предыдущих уроках. 4. Сохраните файл с изменениями и выйдите из Vim выполнив: :wq 5. Если вы вышли из vimtutor на шаге 1, перезапустите vimtutor и переходите к следующему Резюме. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ РЕЗЮМЕ УРОКА 1 1. Курсор перемещается либо клавишами со стрелками, либо клавишами hjkl. h (влево) j (вниз) k (вверх) l (вправо) 2. Для запуска Vim (из приглашения командной оболочки) наберите: vim ИМЯ_ФАЙЛА 3. Для завершения работы с Vim наберите: :q! чтобы отказаться от сохранения изменений. Или наберите: :wq чтобы сохранить изменения. 4. Для удаления символа под курсором в обычном режиме, нажмите: x 5. Чтобы вставить текст перед курсором в обычном режиме, наберите: i вводите вставляемый текст Чтобы добавить текст после курсора: a вводите добавляемый текст Замечание! Нажатие переместит вас в обычный режим (Normal mode) либо прервёт нежелательную и частично завершённую команду. Теперь переходите к Уроку 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 2.1: КОМАНДЫ УДАЛЕНИЯ ** Наберите dw для удаления участка текста до конца слова. ** 1. Нажмите , чтобы перейти в обычный режим. 2. Переместите курсор вниз, к строке помеченной --->. 3. Переместите курсор в начало слова, которое следует удалить. 4. Наберите dw для удаления этого слова. Замечание! Во время набора буквы dw появятся справа в самой нижней строке экрана. Если вы что-то наберёте неправильно, нажмите и начните сначала. ---> Несколько слов рафинад в этом предложении автокран излишни. 5. Повторите шаги 3 и 4, пока не исправите все ошибки и переходите к Уроку 2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 2.2: ДОПОЛНИТЕЛЬНЫЕ КОМАНДЫ УДАЛЕНИЯ ** Наберите d$ для удаления текста до конца строки. ** 1. Нажмите , чтобы перейти в обычный режим. 2. Переместите курсор вниз, к строке помеченной --->. 3. Переместите курсор к концу правильной строки (ПОСЛЕ первой точки). 4. Наберите d$ для удаления остатка строки. ---> Кто-то набрал окончание этой строки дважды. окончание этой строки дважды. 5. Чтобы лучше разобраться в том, как это происходит, переходите к Уроку 2.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 2.3: КОМАНДЫ И ОБЪЕКТЫ Многие команды, изменяющие текст, состоят из оператора и объекта. Формат команды удаления с оператором d следующий: d объект Здесь: d - оператор удаления. объект - над чем должна быть выполнена команда (перечислено ниже). Краткий список объектов: w - от курсора до конца слова, включая последующий пробел. e - от курсора до конца слова, НЕ включая последующий пробел. $ - от курсора до конца строки. ^ - от курсора до начала строки. Замечание! Простое нажатие на символ объекта в обычном режиме (Normal mode) без предварительного оператора переместит курсор так, как указано в списке объектов. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 2.4: ИСПОЛЬЗОВАНИЕ СЧЁТЧИКА ДЛЯ ПЕРЕМЕЩЕНИЯ ** Ввод числа перед оператором перемещения приведёт к его повторению заданное количество раз. ** 1. Переместите курсор к началу строки отмеченной ---> ниже. 2. Наберите 2w для перемещения курсора вперёд к началу второго слова. 3. Наберите 3e для перемещения курсора вперёд к концу третьего слова. 4. Наберите 0 (нуль) для перемещения к началу строки. 5. Повторите шаги 2 и 3 с различными числами. ---> Обычная строка из слов для вашего перемещения по ней. 6. Переходите к Уроку 2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 2.5: ИСПОЛЬЗОВАНИЕ СЧЁТЧИКА ДЛЯ УДАЛЕНИЯ ** Ввод числа перед оператором приведёт к его повторению заданное количество раз. ** Добавьте число перед перед объектом в комбинацию оператора удаления и перемещения указанную выше для удаления указанного количества объектов: d число объект 1. Переместите курсор к первому слову из прописных букв в отмеченной ---> строке ниже. 2. Наберите d2w для удаления двух слов из прописных букв. 3. Повторите шаги 1 и 2 с другими числами для удаления последовательных слов из прописных букв одной командой. ---> эта АБВ ГД строка ЕЖЗИ КЛ МНО из слов П РС ТУФ очищена. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 2.6: ОПЕРАЦИИ СО СТРОКАМИ ** Наберите dd для удаления целой строки. ** В связи с частой необходимостью удаления целой строки, создатели Vi решили для упрощения сделать возможным удаление строки набором двух d. 1. Переместите курсор вниз, ко второй строке фразы. 2. Наберите dd для удаления строки. 3. Теперь переместитесь к четвёртой строке. 4. Наберите 2dd для удаления двух строк. ---> 1) Летом я хожу на стадион, ---> 2) О, как внезапно кончился диван! ---> 3) Я болею за ``Зенит'', ``Зенит'' --- чемпион! ---> 4) Печально я гляжу на наше поколение! ---> 5) Его грядущее иль пусто иль темно... ---> 6) Я сижу на скамейке в ложе `Б' ---> 7) И играю на большой жестяной трубе. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 2.7: КОМАНДА `ОТМЕНА' ** Нажмите 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. Для повтора перемещения введите количество перед командой: 2w 5. Формат команды в обычном режиме имеет вид: [число] команда объект ИЛИ команда [число] объект где: [число] - сколько раз повторить выполнение команды, опционально команда - что выполнить, например d для удаления объект - на что должна воздействовать команда, например w (слово), $ (до конца строки), и т.д. 6. Для перехода к началу строки используйте нуль: 0 7. Для отмены (отката) предшествующих действий наберите: 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.3. Замечание! Помните, что вы должны учиться в процессе работы, а не просто запоминая. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 3.3: КОМАНДА ИЗМЕНЕНИЯ ** Для изменения конечной части слова наберите ce . ** 1. Переместите курсор вниз, к строке помеченной --->. 2. Расположите курсор над буквой `o' в слове `сола'. 3. Наберите ce и исправьте слово (в данном случае, наберите `лов'). 4. Нажмите и переходите к следующей ошибке (к первому символу, который надо изменить). 5. Повторите шаги 3 и 4 пока первое предложение не станет идентичным второму. ---> Несколько сола в эьгц строке тпгшцбь редалзкуюиесвх. ---> Несколько слов в этой строке требуют редактирования. Обратите внимание, что ce не только удаляет слово, но и переводит вас в режим вставки. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 3.4: ПРОДОЛЖАЕМ ИЗМЕНЯТЬ С КОМАНДОЙ c ** Команда замены используется с теми же объектами, что и команда удаления. ** 1. Команда изменения применяется таким же образом, как и команда удаления. Её формат таков: [число] c объект ИЛИ c [число] объект 2. Объекты также совпадают: w (слово), $ (конец строки) и т.п. 3. Переместите курсор вниз, к строке помеченной --->. 4. Перейдите к первой ошибке. 5. Наберите c$ и отредактируйте первую строку так, чтобы она совпадала со второй, после чего нажмите . ---> Конец этой строки нуждается в помощи, чтобы стать похожим на второй. ---> Конец этой строки нуждается в помощи команды c$ . Замечание! Клавиша Backspace может использоваться для исправления при наборе. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ РЕЗЮМЕ УРОКА 3 1. Для вставки текста, который только что был удалён, наберите p . Эта команда вставит удалённый текст ПОСЛЕ курсора (если была удалена строка, то она будет помещена в строке под курсором). 2. Для замены символа под курсором наберите r и затем заменяющий символ. 3. Команда изменения позволяет вам изменить указанный объект от курсора до окончания перемещения. Например, наберите ce для замены от курсора до конца слова, c$ для изменения до конца строки. 4. Формат команды изменения таков: [число] c объект ИЛИ c [число] объект Теперь переходите к следующему уроку. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 4.1: ИНФОРМАЦИЯ О ФАЙЛЕ И РАСПОЛОЖЕНИИ В НЕМ ** Наберите CTRL-g чтобы увидеть ваше месторасположение в файле и информацию о файле. Наберите G (SHIFT-G) для перемещения к заданной строке в файле. ** Замечание! Прочитайте весь урок прежде чем выполнять любые команды! 1. Удерживая клавишу Ctrl нажмите g . Внизу экрана появится строка статуса с именем файла и номером строки, в которой вы находитесь. Запомните номер строки, он потребуется на Шаге 3. 2. Удерживая клавишу Shift нажмите g для перемещения к концу файла. 3. Наберите номер строки, в которой вы находились и затем Shift-G. Это вернёт вас к строке, в которой вы были, когда в первый раз нажали Ctrl-g. 4. Если вы запомнили все вышесказанное, выполните шаги с 1 по 3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 4.2: КОМАНДА ПОИСКА ** Наберите / и затем введите искомую фразу. ** 1. В обычном режиме (Normal mode) наберите символ / . Обратите внимание, что он вместе с курсором появится внизу экрана, как это происходит с командой : . 2. Теперь наберите 'ошшшибка' . Это то слово, которое вы будете искать. 3. Для того, чтобы повторить поиск, просто нажмите n . Для поиска этой же фразы в обратном направлении, нажмите Shift-N . 4. Если вы желаете сразу искать в обратном направлении, используйте команду ? вместо / . 5. Для того, чтобы вернуться туда, откуда вы начали поиск нажмите Ctrl-O. (Удерживая нажатой клавишу Ctrl нажмите o ). Повторите несколько раз для дальнейшего перехода. Для перехода вперёд используйте Ctrl-I . ---> "ошшшибка" это не способ написания слова `ошибка'; ошшшибка это ошибка. Замечание! Если при поиске будет достигнут конц файла, то поиск будет продолжен с начала. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 4.3: ПОИСК ПАРНЫХ СКОБОК ** Наберите % для поиска парных ), ] или } . ** 1. Поместите курсор над любой из (, [ или { в строке ниже, помеченной --->. 2. Теперь наберите символ % . 3. Курсор должен перескочить на парную скобку. 4. Наберите % для возврата курсора назад к первой скобке. ---> Это ( строка, содержащая такие (, такие [ ] и такие { } скобки. )) Замечание! Это очень удобно при отладке программ с пропущенными скобками! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 4.4: СПОСОБ ИСПРАВЛЕНИЯ ОШИБОК ** Наберите :s/было/стало/g для замены 'было' на 'стало'. ** 1. Переместите курсор вниз, к строке помеченной --->. 2. Наберите :s/уводю/увожу . Обратите внимание на то, что эта команда заменит только первое найденное вхождение в строке. 3. Теперь наберите :s/уводю/увожу/g , добавленная в конце g означает подстановку глобально во всей строке. Это заменит все найденные в строке вхождения. ---> Я уводю к отверженным селеньям, я уводю сквозь вековечный стон, я уводю к забытым поколеньям. 4. Для замены всех вхождений последовательности символов между двумя строками, наберите :#,#s/было/стало/g где #,# -- номера этих строк. Наберите :%s/было/стало/g для замены всех вхождений во всем файле. Наберите :%s/было/стало/gc для поиска всех вхождений во всем файле и запроса подтверждения замены. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ РЕЗЮМЕ УРОКА 4 1. Ctrl-g показывает ваше положение в файле и информацию о нем. Shift-G перемещает вас в конец файла. Номер, за которым следует Shift-G позволяет перейти к строке с этим номером. gg перемещает вас к первой строке файла. 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 после ! и нажмите . Команда выведет список файлов в текущем каталоге, точно также, как если бы вы ввели эту команду в приглашении оболочки. Или попробуйте :!dir , если команда ls не сработала. Замечание! Таким способом можно выполнить любую внешнюю команду с указанием аргументов. Замечание! Все команды, начинающиеся с : , должны завершаться нажатием . Далее на это не всегда будет обращаться особое внимание. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 5.2: КАК ЗАПИСАТЬ ФАЙЛ ** Для сохранения изменений, произведённых в файле, наберите :w ИМЯ_ФАЙЛА. ** 1. Наберите :!dir или :!ls для получения списка файлов в текущем каталоге. Как вам уже известно, после ввода команды надо нажать . 2. Придумайте название для файла, которое ещё не существует, например TEST. 3. Теперь наберите :w TEST (где TEST -- это имя файла, придуманное вами.) 4. Команда сохранит весь этот файл (Учебник по Vim) под именем TEST. Чтобы удостовериться в этом, снова наберите :!dir или :!ls и просмотрите каталог. Замечание! Если вы выйдете из Vim и затем запустите его снова с файлом TEST (т.е. выполните vim TEST ), этот файл будет точной копией учебника в тот момент, когда вы его сохранили. 5. Теперь удалите этот файл, набрав для MS-DOS :!del TEST для Unix :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 5.3: ВЫБОРОЧНОЕ СОХРАНЕНИЕ ** Для сохранения части файла, наберите v выберите часть и сохраните её :w ИМЯ_ФАЙЛА ** 1. Переместите курсор к этой строке. 2. Нажмите v и переместите курсор ниже к пятому шагу. Обратите внимание, что текст подсвечен. 3. Нажмите : и внизу экрана появится :'<,'> . 4. Введите w TEST (где TEST -- имя файла, который ещё не существует). До нажатия , проверьте что внизу экрана написано :'<,'>w TEST. 5. Vim запишет выбранные строки в файл TEST. Как и прежде, убедитесь в наличии этого файла командой :!dir или :!ls . НЕ УДАЛЯЙТЕ этот файл, он потребуется в следующем уроке. Замечание! Нажатие v начинает визуальный выбор. Вы можете перемещать курсор для изменения выбора. Затем для выбранного фрагмента можно выполнить какой-то оператор, например, удалить нажатием d. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 5.4: ЧТЕНИЕ И ОБЪЕДИНЕНИЕ ФАЙЛОВ ** Для вставки содержимого из файла, наберите :r ИМЯ_ФАЙЛА ** 1. Установите курсор над этой строкой. Замечание! После выполнения Шага 2 вы увидите текст из Урока 5.3. Переместитесь ВНИЗ по тексту до этого урока. 2. Теперь прочитайте ваш файл TEST, используя команду :r TEST , где TEST -- это имя файла. 3. Для проверки что содержимое файла было вставлено, переместитесь по тексту и удостоверьтесь, что теперь в нём две копии Урока 5.3: исходная и из файла TEST. Замечание! Вставить можно и вывод внешней команды. Например, :r !ls прочитает вывод команды ls и вставит его ниже курсора. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ РЕЗЮМЕ УРОКА 5 1. :!команда исполняет внешнюю команду. Некоторые полезные примеры: (MS-DOS) (Unix) :!dir :!ls -- вывести список файлов в каталоге. :!del ИМЯ :!rm ИМЯ -- удалить файл по имени. 2. :w ИМЯ_ФАЙЛА записывает текущий редактируемый в Vim файл на диск под указанным именем. 3. v перемещение :w ИМЯ_ФАЙЛА сохраняет визуально выбранные строки в файл с указанным именем. 4. :r ИМЯ_ФАЙЛА считывает с диска файл с указанным именем и помещает его ниже курсора. 5. :r !dir читает вывод команды dir и помещает его ниже курсора. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 6.1: КОМАНДА СОЗДАНИЯ ** Наберите o чтобы создать пустую строку под курсором и перейти в режим вставки (Insert mode) ** 1. Переместите курсор вниз, к строке помеченной --->. 2. Наберите o (в нижнем регистре) для того, чтобы создать пустую строку НИЖЕ курсора и перейти в режим вставки (Insert mode). 3. Теперь наберите какой-нибудь текст и нажмите для выхода из режима вставки. ---> После нажатия o курсор перейдёт на новую пустую строку в режиме вставки. 4. Для создания строки ВЫШЕ курсора, просто наберите заглавную O , вместо строчной o . Попробуйте проделать это с нижеследующей строкой. ---> Создайте новую строку над этой, поместив на неё курсор и нажав Shift-O. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 6.2: КОМАНДА ДОБАВЛЕНИЯ ** Наберите a , чтобы вставить текст ПОСЛЕ курсора. ** 1. Переместите курсор вниз, в начало первой строки помеченной --->. 2. Набирайте e пока курсор не переместиться на конец cтро . 3. Наберите a (в нижнем регистре) для добавления текста ПОСЛЕ символа, находящегося под курсором. (Заглавная A позволяет добавить в конец строки.) 4. Допишите слово так, как показано в строке ниже. Нажмите для выхода из режима вставки (Insert mode). 5. Используйте e для перехода к концу следующего незавершённого слова и повторите шаги 3 и 4. ---> Эта стро позволит вам попрактиков в добавле текста. ---> Эта строчка позволит вам попрактиковаться в добавлении текста. Замечание! a , i и A переводят в один и тот же режим вставки, различие только в том, где вставляются символы. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 6.3: ЕЩЁ ОДИН СПОСОБ ЗАМЕНЫ ** Наберите заглавную R для замены более чем одного символа. ** 1. Переместите курсор вниз, к первой строке помеченной --->, и в начало первого слова xxx. 2. Теперь нажмите R и введите число указанный ниже во второй строке чтобы заменить xxx. 3. Нажмите для выхода из режима замены. Заметьте что остаток строки не был изменён. 4. Повторите эти шаги для замены оставшихся xxx. ---> Добавление 123 к xxx даёт xxx. ---> Добавление 123 к 456 даёт 579. Замечание! Режим замены похож на режим вставки, но каждый введённый символ удаляет существующий. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 6.4: КОПИРОВАНИЕ И ВСТАВКА ТЕКСТА ** Используйте команду y для копирования и p для вставки ** 1. Переместите курсор вниз, к первой строке помеченной --->, и после `а)'. 2. Переключитесь в режим визуального выбора нажав v и переместите курсор перед словом `первый'. 3. Введите y для копирования подсвеченного текста. 4. Переместите курсор в конец следующей строки комбинацией j$ . 5. Нажмите p для вставки текста. Затем введите `второй' и нажмите . ---> а) Этот элемент первый. б) Замечание! Также возможно использовать yw (команду y с оператором w ) для копирования одного слова. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 6.5: УСТАНОВКА ПАРАМЕТРОВ ** Установка параметра для игнорирования регистра при поиске или замене ** 1. Найдите слово `игнорировать', набрав: /игнорировать . Повторите поиск несколько раз, нажимая клавишу n . 2. Установите параметр `ic' (игнорировать регистр), набрав: :set ic 3. Теперь снова несколько раз сделайте поиск слова `игнорировать', нажимая: n Заметьте, что теперь находятся `Игнорировать' и `ИГНОРИРОВАТЬ'. 4. Установите параметры `hlsearch' и `incsearch': :set hls is 5. Теперь опять введите команду поиска и посмотрите, что получится: /игнорировать 6. Для возвращения учёта регистра при поиске наберите: :set noic Замечание! Для отключения подсветки совпадений наберите: :nohlsearch Замечание! Если вы хотите игнорировать регистр только для одного поиска, используйте \с в команде поиска: /игнорировать\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ РЕЗЮМЕ УРОКА 6 1. Нажмите o для создания строки НИЖЕ курсора и перехода в режим вставки. Нажмите O для создания строки ВЫШЕ курсора. 2. Нажмите a для вставки текста ПОСЛЕ курсора. Нажмите A для вставки текста в конец строки. 3. Команда e подводит курсор к концу слова. 4. Команда y копирует текст, p -- вставляет скопированный текст. 5. Нажатие заглавной R переводит в режим замены до нажатия клавиши . 6. Наберите `:set xxx' для включения параметра `xxx', некоторые параметры: `ic' `ignorecase' игнорирование регистра при поиске `is' `incsearch' отображение частичных совпадений при поиске `hls' `hlsearch' подсветка всех совпадений при поиске 7. Добавьте `no' перед параметром для его отключения: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 7.1: ВСТРОЕННАЯ СПРАВКА ** Используйте встроенную справочную систему ** Vim обладает мощной встроенной справочной системой. Для начала попробуйте один из трёх вариантов: - нажмите клавишу (если таковая имеется на клавиатуре) - нажмите клавишу (если таковая имеется на клавиатуре) - наберите :help Прочитайте текст в окне справки для получения представления о том как работает справка. Нажмите CTRL-W CTRL-W для перехода от окна к окну. Наберите :q чтобы закрыть окно справки. Вы можете найти справку для любого понятия или команды, задав соответствующий аргумент команде `:help'. Попробуйте следующее (не забудьте нажать ): :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 7.2: СОЗДАНИЕ СТАРТОВОГО СЦЕНАРИЯ ** Включим возможности Vim ** Vim имеет намного больше возможностей, чем Vi, но большинство из них по умолчанию выключены. Для использования больших возможностей вам следует создать файл `vimrc'. 1. Отредактируйте новый файл `vimrc'. Его расположение зависит от используемой системы: :e ~/.vimrc для Unix :e $VIM/_vimrc для MS-Windows 2. Теперь прочитайте пример файла `vimrc': :r $VIMRUNTIME/vimrc_example.vim 3. Запишите созданный вами новый файл `vimrc': :w Теперь при следующем запуске Vim будет включена подсветка синтаксиса. Все настройки, предпочитаемые вами, могут быть добавлены в файл `vimrc'. Для дальнейшей информации наберите :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 7.3: ДОПОЛНЕНИЕ ** Командную строку можно дополнить нажав CTRL-D и ** 1. Удостоверьтесь, что Vim не в режиме совместимости: :set nocp 2. Посмотрите какие файлы есть в каталоге: :!ls или :!dir 3. Наберите начало команды: :e 4. Нажмите CTRL-D и Vim отобразит список команд начинающихся на `e'. 5. Нажмите и Vim дополнит название команды до `:edit'. 6. Теперь добавьте пробел и начало существующего имени файла: :edit ФАЙ 7. Нажмите и Vim дополнит имя файла, если оно уникальное. Замечание! Дополнение работает для многих команд. Попробуйте нажать CTRL-D и . Это особенно полезно для команды :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ РЕЗЮМЕ УРОКА 7 1. Наберите :help или нажмите , или для открытия окна справки. 2. Наберите :help cmd для поиска справки по команде. 3. Нажмите CTRL-W CTRL-W для перехода к другому окну. 4. Наберите :q для закрытия окна справки (если оно активно). 5. Для хранения ваших настроек создайте стартовый сценарий `vimrc'. 6. При наборе : команды, нажмите CTRL-D для отображения возможных дополнений. Нажмите для использования дополнения. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ На этом завершается Учебник 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. Этот учебник написал Michael C. Pierce и Robert K. Ware, Colorado School of Mines с использованием идей, которые предложил Charles Smith, Colorado State University. E-mail: bware@mines.colorado.edu. Доработано для Vim Брамом Моленаром (Bram Moolenaar). Перевод: Андрей Киселев , 2002. Сергей Алёшин , 2014. Translators: Andrey Kiselev , 2002. Sergey Alyoshin , 2014. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim-7.4.1689/runtime/tutor/tutor.sk000066400000000000000000001010421267703067000171470ustar00rootroot00000000000000=============================================================================== = V i t a j t e v o V I M T u t o r i a l i - Verzia 1.7 = =============================================================================== Vim je vemi vkonn editor, ktor m prli vea prkazov na to aby mohli byt vetky popsan vo vuke akou je tto. Tto vuka popisuje dostaton mnostvo prkazov nato aby bolo mon pouva Vim ako viacelov editor. Priblin as potrebn na prebratie tejto vuky je 25-30 mint, zvis na tom, koko je strvenho asu s preskavanm. UPOZORNENIE: Prkazy v lekcich modifikuj text. Vytvor kpiu tohto sboru aby sa mohlo precviova na om (pri tarte "vimtutor" je toto kpia). Je dleit zapamta si, e tto vuka je vytvoren pre vuku pouvanm. To znamen, e je potrebn si prkazy vyska, aby bolo uenie sprvne. Ak len itas text, prkazy zabudne! Presved sa, e Shift-Lock NIEJE stlaen a stlat klvesu j niekoko krt, aby sa kurzor posunul natoko, e lekcia 1.1 celkom zapln obrazovku. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 1.1: POHYB KURZOROM ** Pre pohyb kurzorum stla klvesy h,j,k,l ako je znzornen. ** ^ k Funkcia: Klvesa h je naavo a vykon pohyb doava. < h l > Klvesa l je napravo a vykon pohyb doprava. j Klvesa j vyzer ako pka dole v 1. Pohybuj kurzorom po obrazovke, km si na to nezvykne. 2. Dr stlaen klvesu pre pohyb dole (j), km sa jej funkcia nezopakuje. ---> Teraz sa u vie pohybova na nasledujcu lekciu. 3. Pouitm klvesy pre pohyb dole prejdi na Lekciu 1.2. Poznmka: Ak si niesi ist tm o si napsal, stla na prechod do normlneho mdu. Poznmka: Kurzorov klvesy s tie funkn. Ale pouvanm hjkl sa bude schopn pohybova rchlejie, ke si zvykne ich pouva. Naozaj! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCIA 1.2: ZATVRANIE VIMU !! POZNMKA: Pred vykonanm tchto krokov si pretaj cel tto lekciu !! 1. Stla klvesu (aby si sa uite nachdzal v normlnom mde) 2. Nap: :q! . Tm ukon prcu s editorom BEZ uloenia zmien, ktor si vykonal. 3. Ke sa dostane na prkazov riadok, nap prkaz, ktorm sa dostane spe do tejto vuky. To me by: vimtutor 4. Ak si si tieto kroky spoahlivo zapamtal, vykonaj kroky 1 a 3, pre ukonenie a znovu spustenie editora. POZNMKA: :q! neulo zmeny, ktor si vykonal. O niekoko lekci sa nau ako uloi zmeny do sboru 5. presu kurzor dole na lekciu 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 1.3: EDITCIA TEXTU - MAZANIE ** Stlaenie klvesy x v normlnom mde zmae znak na mieste kurzora. ** 1. Presu kurzor niie na riadok oznaen znakou --->. 2. Aby si mohol odstrni chyby, pohybuj kurzorom km neprejde na znak, ktor chce zmaza. 3. Stla klvesu x aby sa zmazal nechcen znak. 4. Zopakuj kroky 2 a 4 a km veta nieje sprvna. ---> Kraava skooilla ccezz mesiiac. 5. Ak je veta sprvna, prejdi na lekciu 1.4. POZNMKA: Neskaj si zapamta obsah tejto vuky, ale sa u pouvanm. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 1.4: EDITCIA TEXTU - VKLADANIE ** Stlaenie klvesy i umouje vkladanie textu. ** 1. Presu kurzor niie na prv riadok za znaku --->. 2. Pre upravenie prvho riadku do rovnakho tvaru ako je druh riadok, presu kurzor na prv znak za misto, kde m by text vloen. 3. Stla klvesu i a nap potrebn text. 4. Po opraven kadej chyby, stla pre nvrat do normlneho mdu. Zopakuj kroky 2 a 4 km nieje veta sprvna. ---> Tu je text chbajci tejto. ---> Tu je nejak text chbajci od tejto iary. 5. Ke sa dostatone nau vklada text, prejdi na nasledujce zhrnutie. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 1.5: EDITCIA TEXTU - PRIDVANIE ** Stlaenie klvesy A umouje pridva text. ** 1. Presu kurozr niie na prv riadok za znakou --->. Nezle na tom, na ktorom znaku sa kurzor v tom riadku nachdza. 2. Stla klvesu A a nap potrebn text. 3. Po pridan textu stla klvesu pre nvrat do Normlneho mdu. 4. Presu kurozr na druh riadok oznaen ---> a zopakuj kroky 2 a 3 km nieje veta sprvna. ---> Tu je nejak text chbajci o Tu je nejak text chbajci od tiato. ---> Tu tie chba nej Tu tie chba nejak text. 5. Ke sa dostatone nau pridva text, prejdi na lekciu 1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 1.6: EDITCIA SBORU ** Napsanm :wq sa sbor ulo a zavrie ** !! POZNMKA: Pred vykonanm tchto krokov si pretaj cel lekciu!! 1. Opusti tto vuku, ako si to urobil v lekcii 1.2: :q! 2. Do prkazovho riadku nap prkaz: vim tutor 'vim' je prkaz, ktor spust editor Vim, 'tutor' je meno sboru, ktor chce editova. Poui tak sbor, ktor me meni. 3. Vlo a zma text tak, ako si sa nauil v predolch lekciach. 4. Ulo sbor so zmenami a opusti Vim prkazom: :wq 5. Retartuj vimtutor a presu sa dole na nasledujce zhrnutie. 6. Urob tak po pretan predolch krokov a porozumeniu im. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZHRNUTIE LEKCIE 1 1. Kurzor sa pohybuje pouitm klves so pkami alebo klvesmi hjkl. h (do lava) j (dole) k (hore) l (doprava) 2. Pre spustenie Vimu (z prkazovho riadku) nap: vim FILENAME 3. Na ukonenie Vimu nap: :q! pre zruenie vetkch zmien alebo nap: :wq pre uloenie zmien. 4. Na zmazanie znaku na mieste kurzora nap: x 5. Pre vloenie textu na mieste kurzora v normlnom mde nap: i nap vkladan text vkladanie pred kurzor A nap pridvan text vkladanie za riadok POZNMKA: Stlaenie a premiestn do normlneho mdu alebo zru nejak nechcen a iastone dokonen prkaz. Teraz pokrauj lekciou 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 2.1: Mazacie prkazy ** Napsanie prkazu dw zmae znaky do konca slova. ** 1. Stla aby si bol bezpene v normlnom mde. 2. Presu kurzor niie na riadok oznaen znakou --->. 3. Presu kurzor na zaiatok slova, ktor je potrebn zmaza. 4. Nap dw aby slovo zmizlo. POZNMKA: Psmeno d sa zobraz na poslednom riadku obrazovky ke ho nape. Vim na teba pok, aby si mohol napsa psmeno w. Ak vid nieo in ako d , tak si napsal nesprvny znak; stla a zani znova. ---> Tu je niekoko slov zbava, ktor nie patria list do tejto vety. 5. Zopakuj kroky 3 a 4 km veta nieje sprvna a prejdi na lekciu 2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 2.2: VIAC MAZACCH PRKAZOV ** Napsanie prkazu d$ zmae znaky do konca riadku ** 1. Stla aby si bol bezpene v normlnom mde. 2. Presu kurzor niie na riadok oznaen znakou --->. 3. Presu kurzor na koniec sprvnej vety (ZA prv bodku). 4. Nap d$ aby sa zmazali znaky do konca riadku. ---> Niekto napsal koniec tohto riadku dvakrt. koniec tohot riadku dvakrt. 5. Prejdi na lekciu 2.3 pre pochopenie toho o sa stalo. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 2.3: OPERTORY A POHYBY Vea prkazov, ktor menia text s odvoden od opertorov a pohybov. Formt pre prkaz mazania klvesou d je nasledovn: d pohyb kde: d - je mazac opertor pohyb - je to o opertor vykonva (vypsan niie) Krtky list pohybov: w - do zaiatku alieho slova, okrem jeho prvho psmena. e - do konca terajieho slova, vrtane poslednho znaku. $ - do konca riadku, vrtane poslednho znaku Take napsanm de sa zmae vetko od kurzora do konca slova. POZNMKA: Stlaenm iba pohybu v normlnom mde bez opertora sa presunie kurzor tak ako je to pecivikovan. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 2.4: Pouitie viacnsobnho pohybu ** Napsanm sla pred pohyb ho zopakuje zadn poet krt ** 1. Presu kurozr niie na zaiatok riadku oznaenho --->. 2. Nap 2w a kurozr sa presunie o dve slov vpred. 3. Nap 3e a kurozr sa presunie vpred na koniec tretieho slova. 4. Nap 0 (nula) a kurozr sa presunie na zaiatok riadku. 5. Zopakuj kroky 2 a 3 s rznymi slami. ---> Toto je riadok so slovami po kotrch sa mete pohybova. 6. Prejdi na lekciu 2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 2.5: POUITIE VIACNSOBNHO MAZANIA PRE HROMADN MAZANIE ** Napsanie sla spolu s opertorom ho zopakuje zadan poet krt ** V kombincii opertorov mazania a pohybu spomnanho vyie vlo poet pred pohyb pre docielenie hromadnho mazania: d slo pohyb 1. Presu kurzor na prv slovo psan VEKMI PSMENAMI v riadku oznaenom --->. 2. Nap 2dw a zmae dve slov psan VEKMI PSMENAMI 3. Zopakuj kroky 1 a 2 s pouitm rzneho sla tak aby si zmazal slov psan vekmi psmenami jednm prkazom. ---> Tento ABC DE riadok FGHI JK LMN OP so slovamI je Q RS TUV vycisteny. POZNMKA: slo medzi opertorom d a pohybom funguje podobne ako pri pouit s pohybom bez opertora. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 2.6: OPERCIE S RIADKAMI ** Napsanie prkazu dd zmae cel riadok. ** Vzhadom na frekvenciu mazania celho riadku, sa autori Vimu rozhodli, e bude jednoduchie maza cel riadok napsanm dvoch psmen 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 aby si zmazal dva riadky. 1) Rue s erven, 2) Blato je zbavn, 3) Fialky s modr, 4) Mm auto, 5) Hodinky ukazuj as, 6) Cukor je sladk, 7) A to si ty. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 2.7: PRKAZ UNDO ** Stla u pre vrtenie poslednho prkazu, U pre pravu celho riadku. ** 1. Presu kurzor niie na riadok oznaen znakou ---> a premiestni ho na prv chybu. 2. Nap x pre zmazanie prvho nechcenho riadku. 3. Teraz nap u m vrt sp posledne vykonan prkaz. 4. Teraz oprav vetky chyby na riadku pouitm prkazu x . 5. Teraz nap vek U m vrt riadok do pvodnho stavu. 6. Teraz nap u niekoko krt, m vrt sp prkaz U. 7. Teraz nap CTRL-R (dr klvesu CTRL stlaen km stla R) niekoko krt, m vrt sp predtm vrten prkazy (undo z undo). ---> Opprav chybby nna toomto riadku a zmee ich pommocou undo. 8. Tieto prkazy s asto pouvan. 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 celho riadku nap: dd 4. Pre zopakovanie pohybu, nap pred neho slo: 2w 5. Formt pre pkaz: opertor [slo] pohyb kde: opertor - o treba robi, naprklad d pre zmazanie [slo] - je voliten poet pre opakovanie pohybu pohyb - pohyb po texte vzhadom na opertor, naprklad w (slovo), $ (do konca riadku), at. 6. Pre pohyb na zaiatok riadku poui nulu: 0 7. Pre vrtenie sp predolej opercie nap: u (mal u) Pre vrtenie vetkch prav na riadku nap: U (vek U) Pre vrtenie vrtench prav nap: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 3.1: PRKAZ VLOI ** Napsanie prkazu p vlo psledn vmaz za kurzor. ** 1. Presu kurzor niie na prv riadok textu. 2. Nap dd m zmae riadok a ulo ho do buffera editora Vim. 3. Presu kurzor vyie tam, kam zmazan riadok patr. 4. Ak nape v normlnom mde p zmazan riadk sa vlo. 5. Zopakuj kroky 2 a 4, km riadky nies v sprvnom porad. ---> d) Tie sa doke vzdelva? ---> b) Fialky s modr, ---> c) Inteligencia sa vzdelva, ---> a) Rue s erven, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 3.2: PRKAZ NAHRADENIA ** Napsanm rx sa nahrad znak na mieste kurzora znakom x . ** 1. Presu kurzor niie na prv riadok textu oznaenho znakou --->. 2. Presu kurzor na zaiatok prvej chyby. 3. nap r a potom znak, ktor tam m by. 4. Zopakuj kroky 2 a 3, km prv riadok nieje zhodn s druhm. ---> Ka bol tento riasok paan, niekro stlail nesprbne klvesy! ---> Ke bol tento riadok psan, niekto stlail nesprvne klvesy! 5. Teraz prejdi na lekciu 3.2. POZNMKA: Pamtaj si, e naui sa me len pouvanim, nie pamtanm. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 3.3. PRKAZ PRAVY ** Ak chce zmeni as slova do konca slova, nap ce . ** 1. Presu kurzor niie na prv riadok oznaen znakou --->. 2. Umiestni kurzor na psmeno o v slove rosfpl. 3. Nap ce a oprav slovo (v tomto prpade nap 'iadok'.) 4. Stla a prejdi na al znak, ktor treba zmeni. 5. Zopakuj kroky 3 a 4, km prv veta nieje rovnak ako druh. ---> Tento rosfpl m niekoko skic, ktor je pirewvb zmeni piyun prkazu. ---> Tento riadok m niekoko slov, ktor je potrebn zmeni pouitm prkazu. Poznmka, e ce zmae slovo a nastav vkladac md. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 3.4: VIAC ZMIEN POUITM c ** Prkaz pre pravy sa pouva s rovnakmi pohybmi ako pre mazanie ** 1. Prkaz pre pravy pracuje rovnako ako pre mazanie. Formt je: c [slo] pohyb 2. Pohyby s rovnak, ako naprklad w (slovo) a $ (koniec riadku). 3. Presu kurzor niie na prv riadok oznaen znakou --->. 4. Presu kurzor na prv chybu. 5. nap c$ aby si mohol upravi zvyok riadku poda druhho a stla . ---> Koniec tohto riadku potrebuje pomoc, aby bol ako druhy. ---> Koniec tohto riadku potrebuje opravi pouitm prkazu c$ . POZNMKA: Me poui klvesu backspace na pravu zmien poas psania. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCIA 3 ZHRNUTIE 1. Na vloenie 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 pvodn znak. 3. Prkaz na upravenie umouje zmeni od kurzora a po miesto, ktor uruje pohyb. napr. Nap ce m zmn text od pozcie kurzora do konca slova, c$ zmen text do konca riadku. 4. Formt pre nahradenie je: c [slo] pohyb Teraz prejdi na nalsedujcu lekciu. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 4.1: POZCIA A STATUS SBORU ** Stla CTRL-g pre zobrazenie svojej pozcie v sbore a statusu sboru. Nap G pre presun na riadok v sbore. ** Poznmka: Pretaj si cel tto lekciu skr ako zane vykonva kroky!! 1. Dr stlaen klvesu Ctrl a stla g . Toto nazvame CTRL-G. Na spodu obrazovky sa zobraz sprva s nzvom sboru a pozciou v sbore. Zapamtajsi si slo riadku pre pouitie v kroku 3. 2. Stla G m sa dostane na spodok sboru. Nap gg m sa dostane na zaiatok sboru. 3. Nap slo riadku na ktorom si sa nachdzal a stla G. To a vrti na riadok, na ktorom si prv krt stlail CTRL-G. 4. Ak sa ct schopn vykona teto kroky, vykonaj kroky 1 a 3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 4.2: PRKAZ VYHADVANIA ** Nap / nasledovan reazcom pre vyhadanie prslunho reazca. ** 1. Nap znak / v normlnom mde. Poznmka, e tento znak sa spolu s kurzorom zobraz v dolnej asti obrazovky s : prkazom. 2. Teraz nap 'errroor' . To je slovo, ktor chce vyhada. 3. Pre vyhadanie alieho vskytu rovnakho reazca, stla jednoducho n. Pre vyhadanie alieho vskytu rovnakho reazca opanm smerom, N. 4. Ak chce vyhada reazec v sptnom smere, pou prkaz ? miesto prkazu /. 5. Pre nvrat na miesto z ktorho si priiel stla CTRL-O (dr stlaen klvesu Ctrl poas stlaenia klvesy o). Zopakuj pre al nvrat sp. CTRL-I ide vpred. POZNMKA: "errroor" nieje spsob hlskovania error; errroor je error. POZNMKA: Ke vyhadvanie dosiahne koniec tohto sboru, bude pokraova na zaiatku, dokia nieje resetovan nastavenie 'wrapscan' . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 4.3: VYHADVANIE ZODPOVEDAJCICH ZTAVORIEK ** Nap % pre vyhadanie prslunho znaku ),], alebo } . ** 1. Premiestni kurzor na hocak zo znakov (, [, alebo { v riadku niie oznaenho znakou --->. 2. Teraz nap znak % . 3. Kurzor sa premiestni na zodpovedajcu ztvorku. 4. Nap % pre presun kurzoru sp na otvrajcu ztvorku. 5. Presu kurzor na in zo znakov (,),[,],{ alebo } a vimni si o % vykonva. ---> Toto ( je testovac riadok s ('s, ['s ] a {'s } v riadku. )) Poznmka: Toto je vemi vhodn pou pri laden programu s chbajcimi uzatvrajcimi ztvorkami! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 4.4: PRKAZ NAHRADENIA ** Nap :s/star/nov/g pre nahradenie slova 'star' za slovo 'nov'. ** 1. Presu kurzor niie na riadok oznaen znakou --->. 2. Nap :s/thee/the . Poznamka, e tento prkaz zmen len prv vskyt "thee" v riadku. 3. Teraz nap :s/thee/the/g o znamen celkov nahradenie v riadku. Toto nahrad vetky vskyty v riadku. ---> Thee best time to see thee flowers in thee spring. 4. Pre zmenu vetkch vskytov danho reazca medzi dvomi ridakami, nap :#,#s/star/nov/g kde #,# s sla dvoch riadkov, v rozsahu ktorch sa nahradenie vykon. nap :%s/star/nov/g pre zmenu vetkch vskytov v celom riadku nap :%s/star/nov/gc njde vetky vskyty v celom sbore, s otzkou i nahradi alebo nie ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCIA 4 ZHRNUTIE 1. CTRL-g vype tvoju pozciu v sbore a status sboru. G a premiestni na koniec riadku. slo G a premiestni na riadok s slom. gg a presunie na prv riadok 2. Napsanie / nasledovan reazcom vyhad reazec smerom DOPREDU. Napsanie ? nasledovan reazcom vyhada reazec smerom DOZADU. Napsanie n po vyhadvan, vyhad nasledujci vskyt reazca v rovnakom smere, priom N vyhad v opanom smere. CTRL-O a vrti sp na stariu pozciu, CTRL-I na noviu pozciu. 3. Napsanie % ke kurzor je na (,),[,],{, alebo } njde zodpovdajcu prnu ztvorku. 4. Pre nahradenie novho za prv star v riadku nap :s/star/nov Pre nahradenie novho za vetky star v riadku nap :s/star/nov/g Pre nahradenie reazcov medzi dvoma riadkami 3 nap :#,#/star/nov/g Pre nahradenie vetkch vskytov v sbore nap :%s/star/nov/g Pre potvrdenie kadho nahradenia pridaj 'c' :%s/star/nov/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 5.1 AKO SPUSTI VONKAJ PRKAZ ** Nap prkaz :! nasledovan vonkajm prkazom pre spustenie prkazu ** 1. Nap obvykl pkaz : ktor nastav kurzor na spodok obrazovky. To umon napsa prkaz. 2. Teraz nap ! (vkrink). To umon spusti hociak vonkaj prkaz z prkazovho riadku. 3. Ako prklad nap ls za ! a stla . Tento prkaz zobraz obsah tvojho adresra rovnako ako na prkazovom riadku. Alebo poui :!dir ak ls nefunguje. Poznmka: Takto je mon spusti hociak vonkaj prkaz s argumentami. Poznmka: Vetky prkazy : musia by dokonen stlaenm ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 5.2: VIAC O UKLADAN SBOROV ** Pre uloenie zmien v sbore, nap :w FILENAME. ** 1. Nap :!dir alebo :!ls pre vpis aktulneho adresra. U vie, e mus za tmto stlai . 2. Vyber nzov sboru, ktor ete neexistuje, ako napr. TEST. 3. Teraz nap: :w TEST (kde TEST je nzov vybratho sboru.) 4. To ulo cel sbor (Vim Tutor) pod nzovm TEST. Pre overenie nap :!dir , m zobraz obsah adresra. Poznmka: e ak ukon prcu s editorom Vim a znovu ho spust prkazom vim TEST, sbor bude kpia vuky, ke si ho uloil. 5. Teraz odstr sbor napsanm (MS-DOS): :!del TEST alebo (Unix): :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 5.3 VBER TEXTU PRE ULOENIE ** Pre uloenie asti sboru, nap v pohyb :w FILENAME ** 1. Presu kurozr na tento riadok. 2. Stla v a presu kurozr na piatu poloku dole. Poznmka, e tento text je vyznaen (highlighted). 3. Stla klvesu : . V spodnej asti okna sa objav :'<,'>. 4. Nap w TEST , kde TEST je meno sboru, ktor zatial neexistuje. Skontroluj, e vid :'<,'>w TEST predtm ne stla Enter. 5. Vim zape oznaen riadky do sboru TEST. Poui :!dir alebo :!ls pre overenie. Zatial ho ete nema! Pouijeme ho v alej lekcii. POZNMKA: Stlaenm klvesy v sa spust vizulne oznaovanie. Me pohybova kurzorom pre upresnenie vyznaenho textu. Potom me poui opertor pre vykonanie nejakej akcie s textom. Naprklad d zmae vyznaen text. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 5.4: VBER A ZLUOVANIE SBOROV ** Pre vloenie obsahu sboru, nap :r FILENAME ** 1. Premiestni kurzor nad tento riadok. POZNMKA: Po vykonan kroku 2 uvid text z lekcie 5.3. Potom sa presu dole, aby si videl tto lekciu. 3. Teraz vlo sbor TEST pouitm prkazu :r TEST kde TEST je nzov sboru. Sbor, ktor si pouil je umiestnen pod riadkom s kurzorom. POZNMKA: Me tie nata vstup vonkajieho prkazu. Naprklad :r !ls nata vstup prkazu ls a umiestni ho za pozciu kurzora. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCIA 5 ZHRNUTIE 1. :!prkaz spust vonkaj prkaz. Niektor vyuiten prklady s: (MS_DOS) (UNIX) :!dir :!ls - zobraz obsah adresra :!del FILENAME :!rm FILENAME - odstrni sbor FILENAME 2. :w FILENAME ulo aktulny sbor na disk pod menom FILENAME. 3. v pohyb :w FILENAME ulo vizulne oznaen riadky do sboru FILENAME. 4. :r FILENAME vyberie z disku sbor FILENAME a vlo ho do aktulneho sboru za pozciou kurzora. 5. :r !dir nata vstup z prkazu dir a vlo ho za pozciu kurzora. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 6.1: PRKAZ OTVORI ** Nap o pre vloenie riadku pod kurzor a prepnutie do vkladacieho mdu ** 1. Presu kurzor niie na riadok oznaen znakou --->. 2. Nap o (mal psmeno) pre vloenie istho riadku pod kurzorm a prepnutie do vkladacieho mdu. 3. Teraz skopruj riadok oznaen ---> a stla pre ukonenie vkladacieho mdu. ---> Po napsan o sa kurzor premiestn na vloen riadok do vkladacieho mdu. 4. Pre otvorenie riadku nad kurzorom, jednotucho nap vek O , namiesto malho o. Vyskaj si to na riadku dole. ---> Vlo riadok nad tmto napsanm O, ke kurzor je na tomto riadku. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 6.2: PRKAZ PRIDA ** Nap a pre vloenie textu ZA kurzor. ** 1. Presu kurzor niie na koniec prvho riadku oznaenho znakou ---> 2. Stla klvesu e dokia kurozr nieje na konci riadku. 3. Nap a (mal psmeno) pre pridanie textu ZA kurzorom. 4. Dokon slovo tak ako je to v druhom riadku. Stla pre opustenie vkladacieho mdu. 5. Poui e na presun na alie nedokonen slovo a zopakuj kroky 3 a 4. ---> Tento ri ti dovouje ncv privan testu na koniec riadku. ---> Tento riadok ti dovouje ncvik pridvania textu na koniec riadku. POZNMKA: a, i, A tartuj rovnak vkladac md, jedin rozidel je, kde sa znaky vkladaj. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 6.3: IN SPOSOB NAHRADZOVANIA ** Nap vek R pre nahradenie viac ako jednho znaku. ** 1. Presu kurzor niie na prv riadok oznaen znakou --->. Premiestni kurzor na zaiatok prvho vskytu xxx. 2. Teraz nap R a nap slo uveden v druhom riadku, take sa nm nahrad pvodn xxx. 3. Stla pre opustenie nahradzovacieho mdu. Poznmka, e zvyok riadku zostane nezmenen. 4. Zopakuj tieto kroky pre nahradenie zvynch xxx. ---> Pridanm 123 ku xxx dostane xxx. ---> Pridanm 123 ku 456 dostane 579. POZNMKA: Nahradzovac md je ako vkladac md, ale kad napsan znak zmae existujci znak. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 6.4: Copy Paste textu ** pou opertor y pre copy textku a p pre jeho paste ** 1. Cho niie na riadok oznaen ---> a umiestni kurozr za "a)". 2. Natartuj vizulny md pouitm v a presu kurozr pred "first". 3. Nap y pre vystrihnutie (copy) oznaenho textu. 4. Presu kurozr na koniec alieho riadku: j$ 5. Nap p pre vlonie (paste) textu. Potom nap: a druha . 6. Poui vizulny md pre oznaenie "poloka.", vystrihni to pouitm y, presu sa na koniec nasledujceho riadku pouitm j$ a vlo sem text pouitm p. ---> a) toto je prv poloka ---> b) POZNMKA: Me poui tie y ako opertor; yw vystrihne jedno slovo. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 6.5: NASTAVENIE MONOST ** Nastav monosti, take vyhadvanie alebo nahradzovanie ignoruje rozliovanie ** 1. Vyhadaj reazec 'ignore' napsanm: /ignore Zopakuj vyhadvanie niekoko krt stlaenm klvesy n . 2. Nastav monos 'ic' (Ignore case) napsanm prkazu: :set ic 3. Teraz vyhadaj reazec 'ingore' znova stlaenm klvesy n Poznmka, e teraz s vyhadan aj Ignore a IGNORE. 4. Nastav monosi 'hlsearch' a 'incsearch': :set hls is 5. Teraz spusti vyhadvac prkaz znovu, a pozri o sa stalo: /ignore 6. Pre opetovn zapnutie rozlyovania vekch a malch psmen nap: :set noic POZNMKA: Na odstrnenie zvraznenia vrazov nap: :nohlsearch POZNMKA: Ak chce nerozlyova vekos psmen len pre jedno pouitie vyhadvacieho prkazu, poui \c: /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCIA 6 ZHRNUTIE 1. Nap o pre otvorenie riadku pod kurzorom a tart vkladacieho mdu. Nap O pre otvorenie riadku nad kurzorom. 2. Nap a pre vkladanie textu ZA kurzor. Nap A pre vkladanie textu za koncom riadku. 3. Prkaz e presunie kurozr na koniec slova 4. Opertor y vystrihne (skopruje) text, p ho vlo. 5. Napsanie vekho R prepne do nahradzovacieho mdu, km nieje stlaen . 6. Napsanie ":set xxx" nastav monos "xxx". Niektor nastavenia s: 'ic' 'ignorecase' ignoruje vek a mal psmen poas vyhadvania. 'is' 'incsearch' zobrazuje iaston reazce vyhadvanho reazca. 'hls' 'hlsearch' vyzna vetky vyhadvan reazce. Me poui hociktor z dlhch a krtkych nzvov monost. 7. Vlo "no" pred nastavenie pre jeho vypnutie: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCIA 7.1: ZSKANIE NPOVEDY ** Pouvaj on-line systm npovedy ** Vim m obsiahly on-line systm npovedy. Pre odtartovanie, vyskaj jeden z tchto troch: - stla klvesu (ak nejak m) - stla klvesu (ak nejak m) - nap :help taj text v okne npovedy pre zskanie predstavy ako npoveda funguje. Nap CTRL-W CTRL-W pre skok z jednho okna do druhho. Nap :q m zatvor okno npovedy. Me njs help ku hociakej tme pridanm argumentu ku prkazu ":help". Vyskaj tieto (nezabudni stlai ): :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCIA 7.2: VYTVORENIE TARTOVACIEHO SKRIPTU ** Zapni funkcie editora Vim ** Vim m omnoho viac funkcii ne Vi, ale veina z nich je implicitne vypnut. Pre pouvanie viac Vim funkcii vytvor "vimrc" sbor. 1. Zani editova "vimrc" sbor, to zvis na pouitom systme: :e ~/.vimrc pre Unix :e $VIM/_vimrc pre MS-Windows 2. Teraz si pretaj text prkladu "vimrc" sboru: :r $VIMRUNTIME/vimrc_example.vim 3. Ulo sbor: :w Pri nasledujcom tarte editora Vim sa pouije zvrazovanie syntaxe. Do "vimrc" sboru me prida vetky svoje uprednostovan nastavenia. Pre viac informcii nap :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCIA 7.3 DOKONENIE ** Dokoni prkaz na prkazovom riadku pouitm CTRL-D a ** 1. Uisti sa, e Vim nieje v kompatibilnom mde: :set nocp 2. Pozri sa ak sbory sa nachdzaj v adresri: :!ls alebo :!dir 3. Nap zaiatok prkazu: :e 4. Stla CTRL-D a Vim zobraz zoznam prkazov zanajcich "e". 5. Stla a Vim dokon meno prkazu na ":edit". 6. Teraz pridaj medzernk a zaiatok mena existujceho sboru: :edit FIL 7. Stla . Vim dokon meno (ak je jedinen). POZNMKA: Dokonovanie funguje pre vea prkazov. Vyskaj stlaenie CTRL-D a . pecilne je to uiton pre prkaz :help. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCIA 7 ZHRNUTIE 1. Nap :help alebo stla alebo pre otvorenie okna npovedy. 2. Nap :help prkaz pre vyhadanie npovedy ku prkazu prkaz. 3. Nap CTRL-W CTRL-W na preskoenie do inho okna. 4. Nap :q pre zatvorenie okna npovedy 5. Vytvor tartovac skript vimrc pre udranie uprednostovanch nastaven. 6. Poas psania prkazu : stla CTRL-D pre zobrazenie dokonen. Stla pre pouitie jednho z dokonen. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Toto vymedzuje vuku Vimu. Toto je uren pre strucn prehad o editore Vim, plne postaujce pre ahk a obstojn pouvanie tohto editora. Tto vuka je aleko od kompletnosti, pretoe Vim m omnoho viacej prkazov. Ako alie si pretaj uvatsk manul: ":help user-manual". Pre alie tanie a tdium je odporan kniha: Vim - Vi Improved - od Steve Oualline Vydavate: New Riders Prv kniha uren pre Vim. pecilne vhodn pre zaiatonkov. Obsahuje mnostvo prkladov a obrzkov. Pozri na http://iccf-holland.org/click5.html Tto kniha je staria a je viac o Vi ako o Vim, ale je tie odporan: Learning the Vi Editor - od Linda Lamb Vydavate: O'Reilly & Associates Inc. Je to dobr kniha pre zskanie vedomost o prci s editorom Vi. ieste vydanie obsahuje tie informcie o editore Vim. Tto vuka bola napsan autormi Michael C. Pierce a Robert K. Ware, Colorado School of Mines s pouitm mylienok dodanmi od Charles Smith, Colorado State University. E-mail: bware@mines.colorado.edu. Modifikovan pre Vim od Bram Moolenaar. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Preklad do Sloveniny: ubo elko e-mail: celbos@inmail.sk Last Change: 2006 Apr 18 encoding: iso8859-2 vim-7.4.1689/runtime/tutor/tutor.sk.cp1250000066400000000000000000001010371267703067000200640ustar00rootroot00000000000000=============================================================================== = V i t a j t e v o V I M T u t o r i a l i - Verzia 1.7 = =============================================================================== Vim je vemi vkonn editor, ktor m prli vea prkazov na to aby mohli byt vetky popsan vo vuke akou je tto. Tto vuka popisuje dostaton mnostvo prkazov nato aby bolo mon pouva Vim ako viacelov editor. Priblin as potrebn na prebratie tejto vuky je 25-30 mint, zvis na tom, koko je strvenho asu s preskavanm. UPOZORNENIE: Prkazy v lekcich modifikuj text. Vytvor kpiu tohto sboru aby sa mohlo precviova na om (pri tarte "vimtutor" je toto kpia). Je dleit zapamta si, e tto vuka je vytvoren pre vuku pouvanm. To znamen, e je potrebn si prkazy vyska, aby bolo uenie sprvne. Ak len itas text, prkazy zabudne! Presved sa, e Shift-Lock NIEJE stlaen a stlat klvesu j niekoko krt, aby sa kurzor posunul natoko, e lekcia 1.1 celkom zapln obrazovku. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 1.1: POHYB KURZOROM ** Pre pohyb kurzorum stla klvesy h,j,k,l ako je znzornen. ** ^ k Funkcia: Klvesa h je naavo a vykon pohyb doava. < h l > Klvesa l je napravo a vykon pohyb doprava. j Klvesa j vyzer ako pka dole v 1. Pohybuj kurzorom po obrazovke, km si na to nezvykne. 2. Dr stlaen klvesu pre pohyb dole (j), km sa jej funkcia nezopakuje. ---> Teraz sa u vie pohybova na nasledujcu lekciu. 3. Pouitm klvesy pre pohyb dole prejdi na Lekciu 1.2. Poznmka: Ak si niesi ist tm o si napsal, stla na prechod do normlneho mdu. Poznmka: Kurzorov klvesy s tie funkn. Ale pouvanm hjkl sa bude schopn pohybova rchlejie, ke si zvykne ich pouva. Naozaj! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCIA 1.2: ZATVRANIE VIMU !! POZNMKA: Pred vykonanm tchto krokov si pretaj cel tto lekciu !! 1. Stla klvesu (aby si sa uite nachdzal v normlnom mde) 2. Nap: :q! . Tm ukon prcu s editorom BEZ uloenia zmien, ktor si vykonal. 3. Ke sa dostane na prkazov riadok, nap prkaz, ktorm sa dostane spe do tejto vuky. To me by: vimtutor 4. Ak si si tieto kroky spoahlivo zapamtal, vykonaj kroky 1 a 3, pre ukonenie a znovu spustenie editora. POZNMKA: :q! neulo zmeny, ktor si vykonal. O niekoko lekci sa nau ako uloi zmeny do sboru 5. presu kurzor dole na lekciu 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 1.3: EDITCIA TEXTU - MAZANIE ** Stlaenie klvesy x v normlnom mde zmae znak na mieste kurzora. ** 1. Presu kurzor niie na riadok oznaen znakou --->. 2. Aby si mohol odstrni chyby, pohybuj kurzorom km neprejde na znak, ktor chce zmaza. 3. Stla klvesu x aby sa zmazal nechcen znak. 4. Zopakuj kroky 2 a 4 a km veta nieje sprvna. ---> Kraava skooilla ccezz mesiiac. 5. Ak je veta sprvna, prejdi na lekciu 1.4. POZNMKA: Neskaj si zapamta obsah tejto vuky, ale sa u pouvanm. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 1.4: EDITCIA TEXTU - VKLADANIE ** Stlaenie klvesy i umouje vkladanie textu. ** 1. Presu kurzor niie na prv riadok za znaku --->. 2. Pre upravenie prvho riadku do rovnakho tvaru ako je druh riadok, presu kurzor na prv znak za misto, kde m by text vloen. 3. Stla klvesu i a nap potrebn text. 4. Po opraven kadej chyby, stla pre nvrat do normlneho mdu. Zopakuj kroky 2 a 4 km nieje veta sprvna. ---> Tu je text chbajci tejto. ---> Tu je nejak text chbajci od tejto iary. 5. Ke sa dostatone nau vklada text, prejdi na nasledujce zhrnutie. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 1.5: EDITCIA TEXTU - PRIDVANIE ** Stlaenie klvesy A umouje pridva text. ** 1. Presu kurozr niie na prv riadok za znakou --->. Nezle na tom, na ktorom znaku sa kurzor v tom riadku nachdza. 2. Stla klvesu A a nap potrebn text. 3. Po pridan textu stla klvesu pre nvrat do Normlneho mdu. 4. Presu kurozr na druh riadok oznaen ---> a zopakuj kroky 2 a 3 km nieje veta sprvna. ---> Tu je nejak text chbajci o Tu je nejak text chbajci od tiato. ---> Tu tie chba nej Tu tie chba nejak text. 5. Ke sa dostatone nau pridva text, prejdi na lekciu 1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 1.6: EDITCIA SBORU ** Napsanm :wq sa sbor ulo a zavrie ** !! POZNMKA: Pred vykonanm tchto krokov si pretaj cel lekciu!! 1. Opusti tto vuku, ako si to urobil v lekcii 1.2: :q! 2. Do prkazovho riadku nap prkaz: vim tutor 'vim' je prkaz, ktor spust editor Vim, 'tutor' je meno sboru, ktor chce editova. Poui tak sbor, ktor me meni. 3. Vlo a zma text tak, ako si sa nauil v predolch lekciach. 4. Ulo sbor so zmenami a opusti Vim prkazom: :wq 5. Retartuj vimtutor a presu sa dole na nasledujce zhrnutie. 6. Urob tak po pretan predolch krokov a porozumeniu im. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZHRNUTIE LEKCIE 1 1. Kurzor sa pohybuje pouitm klves so pkami alebo klvesmi hjkl. h (do lava) j (dole) k (hore) l (doprava) 2. Pre spustenie Vimu (z prkazovho riadku) nap: vim FILENAME 3. Na ukonenie Vimu nap: :q! pre zruenie vetkch zmien alebo nap: :wq pre uloenie zmien. 4. Na zmazanie znaku na mieste kurzora nap: x 5. Pre vloenie textu na mieste kurzora v normlnom mde nap: i nap vkladan text vkladanie pred kurzor A nap pridvan text vkladanie za riadok POZNMKA: Stlaenie a premiestn do normlneho mdu alebo zru nejak nechcen a iastone dokonen prkaz. Teraz pokrauj lekciou 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 2.1: Mazacie prkazy ** Napsanie prkazu dw zmae znaky do konca slova. ** 1. Stla aby si bol bezpene v normlnom mde. 2. Presu kurzor niie na riadok oznaen znakou --->. 3. Presu kurzor na zaiatok slova, ktor je potrebn zmaza. 4. Nap dw aby slovo zmizlo. POZNMKA: Psmeno d sa zobraz na poslednom riadku obrazovky ke ho nape. Vim na teba pok, aby si mohol napsa psmeno w. Ak vid nieo in ako d , tak si napsal nesprvny znak; stla a zani znova. ---> Tu je niekoko slov zbava, ktor nie patria list do tejto vety. 5. Zopakuj kroky 3 a 4 km veta nieje sprvna a prejdi na lekciu 2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 2.2: VIAC MAZACCH PRKAZOV ** Napsanie prkazu d$ zmae znaky do konca riadku ** 1. Stla aby si bol bezpene v normlnom mde. 2. Presu kurzor niie na riadok oznaen znakou --->. 3. Presu kurzor na koniec sprvnej vety (ZA prv bodku). 4. Nap d$ aby sa zmazali znaky do konca riadku. ---> Niekto napsal koniec tohto riadku dvakrt. koniec tohot riadku dvakrt. 5. Prejdi na lekciu 2.3 pre pochopenie toho o sa stalo. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 2.3: OPERTORY A POHYBY Vea prkazov, ktor menia text s odvoden od opertorov a pohybov. Formt pre prkaz mazania klvesou d je nasledovn: d pohyb kde: d - je mazac opertor pohyb - je to o opertor vykonva (vypsan niie) Krtky list pohybov: w - do zaiatku alieho slova, okrem jeho prvho psmena. e - do konca terajieho slova, vrtane poslednho znaku. $ - do konca riadku, vrtane poslednho znaku Take napsanm de sa zmae vetko od kurzora do konca slova. POZNMKA: Stlaenm iba pohybu v normlnom mde bez opertora sa presunie kurzor tak ako je to pecivikovan. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 2.4: Pouitie viacnsobnho pohybu ** Napsanm sla pred pohyb ho zopakuje zadn poet krt ** 1. Presu kurozr niie na zaiatok riadku oznaenho --->. 2. Nap 2w a kurozr sa presunie o dve slov vpred. 3. Nap 3e a kurozr sa presunie vpred na koniec tretieho slova. 4. Nap 0 (nula) a kurozr sa presunie na zaiatok riadku. 5. Zopakuj kroky 2 a 3 s rznymi slami. ---> Toto je riadok so slovami po kotrch sa mete pohybova. 6. Prejdi na lekciu 2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 2.5: POUITIE VIACNSOBNHO MAZANIA PRE HROMADN MAZANIE ** Napsanie sla spolu s opertorom ho zopakuje zadan poet krt ** V kombincii opertorov mazania a pohybu spomnanho vyie vlo poet pred pohyb pre docielenie hromadnho mazania: d slo pohyb 1. Presu kurzor na prv slovo psan VEKMI PSMENAMI v riadku oznaenom --->. 2. Nap 2dw a zmae dve slov psan VEKMI PSMENAMI 3. Zopakuj kroky 1 a 2 s pouitm rzneho sla tak aby si zmazal slov psan vekmi psmenami jednm prkazom. ---> Tento ABC DE riadok FGHI JK LMN OP so slovamI je Q RS TUV vycisteny. POZNMKA: slo medzi opertorom d a pohybom funguje podobne ako pri pouit s pohybom bez opertora. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 2.6: OPERCIE S RIADKAMI ** Napsanie prkazu dd zmae cel riadok. ** Vzhadom na frekvenciu mazania celho riadku, sa autori Vimu rozhodli, e bude jednoduchie maza cel riadok napsanm dvoch psmen 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 aby si zmazal dva riadky. 1) Rue s erven, 2) Blato je zbavn, 3) Fialky s modr, 4) Mm auto, 5) Hodinky ukazuj as, 6) Cukor je sladk, 7) A to si ty. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 2.7: PRKAZ UNDO ** Stla u pre vrtenie poslednho prkazu, U pre pravu celho riadku. ** 1. Presu kurzor niie na riadok oznaen znakou ---> a premiestni ho na prv chybu. 2. Nap x pre zmazanie prvho nechcenho riadku. 3. Teraz nap u m vrt sp posledne vykonan prkaz. 4. Teraz oprav vetky chyby na riadku pouitm prkazu x . 5. Teraz nap vek U m vrt riadok do pvodnho stavu. 6. Teraz nap u niekoko krt, m vrt sp prkaz U. 7. Teraz nap CTRL-R (dr klvesu CTRL stlaen km stla R) niekoko krt, m vrt sp predtm vrten prkazy (undo z undo). ---> Opprav chybby nna toomto riadku a zmee ich pommocou undo. 8. Tieto prkazy s asto pouvan. 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 celho riadku nap: dd 4. Pre zopakovanie pohybu, nap pred neho slo: 2w 5. Formt pre pkaz: opertor [slo] pohyb kde: opertor - o treba robi, naprklad d pre zmazanie [slo] - je voliten poet pre opakovanie pohybu pohyb - pohyb po texte vzhadom na opertor, naprklad w (slovo), $ (do konca riadku), at. 6. Pre pohyb na zaiatok riadku poui nulu: 0 7. Pre vrtenie sp predolej opercie nap: u (mal u) Pre vrtenie vetkch prav na riadku nap: U (vek U) Pre vrtenie vrtench prav nap: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 3.1: PRKAZ VLOI ** Napsanie prkazu p vlo psledn vmaz za kurzor. ** 1. Presu kurzor niie na prv riadok textu. 2. Nap dd m zmae riadok a ulo ho do buffera editora Vim. 3. Presu kurzor vyie tam, kam zmazan riadok patr. 4. Ak nape v normlnom mde p zmazan riadk sa vlo. 5. Zopakuj kroky 2 a 4, km riadky nies v sprvnom porad. ---> d) Tie sa doke vzdelva? ---> b) Fialky s modr, ---> c) Inteligencia sa vzdelva, ---> a) Rue s erven, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 3.2: PRKAZ NAHRADENIA ** Napsanm rx sa nahrad znak na mieste kurzora znakom x . ** 1. Presu kurzor niie na prv riadok textu oznaenho znakou --->. 2. Presu kurzor na zaiatok prvej chyby. 3. nap r a potom znak, ktor tam m by. 4. Zopakuj kroky 2 a 3, km prv riadok nieje zhodn s druhm. ---> Ka bol tento riasok paan, niekro stlail nesprbne klvesy! ---> Ke bol tento riadok psan, niekto stlail nesprvne klvesy! 5. Teraz prejdi na lekciu 3.2. POZNMKA: Pamtaj si, e naui sa me len pouvanim, nie pamtanm. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 3.3. PRKAZ PRAVY ** Ak chce zmeni as slova do konca slova, nap ce . ** 1. Presu kurzor niie na prv riadok oznaen znakou --->. 2. Umiestni kurzor na psmeno o v slove rosfpl. 3. Nap ce a oprav slovo (v tomto prpade nap 'iadok'.) 4. Stla a prejdi na al znak, ktor treba zmeni. 5. Zopakuj kroky 3 a 4, km prv veta nieje rovnak ako druh. ---> Tento rosfpl m niekoko skic, ktor je pirewvb zmeni piyun prkazu. ---> Tento riadok m niekoko slov, ktor je potrebn zmeni pouitm prkazu. Poznmka, e ce zmae slovo a nastav vkladac md. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 3.4: VIAC ZMIEN POUITM c ** Prkaz pre pravy sa pouva s rovnakmi pohybmi ako pre mazanie ** 1. Prkaz pre pravy pracuje rovnako ako pre mazanie. Formt je: c [slo] pohyb 2. Pohyby s rovnak, ako naprklad w (slovo) a $ (koniec riadku). 3. Presu kurzor niie na prv riadok oznaen znakou --->. 4. Presu kurzor na prv chybu. 5. nap c$ aby si mohol upravi zvyok riadku poda druhho a stla . ---> Koniec tohto riadku potrebuje pomoc, aby bol ako druhy. ---> Koniec tohto riadku potrebuje opravi pouitm prkazu c$ . POZNMKA: Me poui klvesu backspace na pravu zmien poas psania. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCIA 3 ZHRNUTIE 1. Na vloenie 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 pvodn znak. 3. Prkaz na upravenie umouje zmeni od kurzora a po miesto, ktor uruje pohyb. napr. Nap ce m zmn text od pozcie kurzora do konca slova, c$ zmen text do konca riadku. 4. Formt pre nahradenie je: c [slo] pohyb Teraz prejdi na nalsedujcu lekciu. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 4.1: POZCIA A STATUS SBORU ** Stla CTRL-g pre zobrazenie svojej pozcie v sbore a statusu sboru. Nap G pre presun na riadok v sbore. ** Poznmka: Pretaj si cel tto lekciu skr ako zane vykonva kroky!! 1. Dr stlaen klvesu Ctrl a stla g . Toto nazvame CTRL-G. Na spodu obrazovky sa zobraz sprva s nzvom sboru a pozciou v sbore. Zapamtajsi si slo riadku pre pouitie v kroku 3. 2. Stla G m sa dostane na spodok sboru. Nap gg m sa dostane na zaiatok sboru. 3. Nap slo riadku na ktorom si sa nachdzal a stla G. To a vrti na riadok, na ktorom si prv krt stlail CTRL-G. 4. Ak sa ct schopn vykona teto kroky, vykonaj kroky 1 a 3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 4.2: PRKAZ VYHADVANIA ** Nap / nasledovan reazcom pre vyhadanie prslunho reazca. ** 1. Nap znak / v normlnom mde. Poznmka, e tento znak sa spolu s kurzorom zobraz v dolnej asti obrazovky s : prkazom. 2. Teraz nap 'errroor' . To je slovo, ktor chce vyhada. 3. Pre vyhadanie alieho vskytu rovnakho reazca, stla jednoducho n. Pre vyhadanie alieho vskytu rovnakho reazca opanm smerom, N. 4. Ak chce vyhada reazec v sptnom smere, pou prkaz ? miesto prkazu /. 5. Pre nvrat na miesto z ktorho si priiel stla CTRL-O (dr stlaen klvesu Ctrl poas stlaenia klvesy o). Zopakuj pre al nvrat sp. CTRL-I ide vpred. POZNMKA: "errroor" nieje spsob hlskovania error; errroor je error. POZNMKA: Ke vyhadvanie dosiahne koniec tohto sboru, bude pokraova na zaiatku, dokia nieje resetovan nastavenie 'wrapscan' . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 4.3: VYHADVANIE ZODPOVEDAJCICH ZTAVORIEK ** Nap % pre vyhadanie prslunho znaku ),], alebo } . ** 1. Premiestni kurzor na hocak zo znakov (, [, alebo { v riadku niie oznaenho znakou --->. 2. Teraz nap znak % . 3. Kurzor sa premiestni na zodpovedajcu ztvorku. 4. Nap % pre presun kurzoru sp na otvrajcu ztvorku. 5. Presu kurzor na in zo znakov (,),[,],{ alebo } a vimni si o % vykonva. ---> Toto ( je testovac riadok s ('s, ['s ] a {'s } v riadku. )) Poznmka: Toto je vemi vhodn pou pri laden programu s chbajcimi uzatvrajcimi ztvorkami! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 4.4: PRKAZ NAHRADENIA ** Nap :s/star/nov/g pre nahradenie slova 'star' za slovo 'nov'. ** 1. Presu kurzor niie na riadok oznaen znakou --->. 2. Nap :s/thee/the . Poznamka, e tento prkaz zmen len prv vskyt "thee" v riadku. 3. Teraz nap :s/thee/the/g o znamen celkov nahradenie v riadku. Toto nahrad vetky vskyty v riadku. ---> Thee best time to see thee flowers in thee spring. 4. Pre zmenu vetkch vskytov danho reazca medzi dvomi ridakami, nap :#,#s/star/nov/g kde #,# s sla dvoch riadkov, v rozsahu ktorch sa nahradenie vykon. nap :%s/star/nov/g pre zmenu vetkch vskytov v celom riadku nap :%s/star/nov/gc njde vetky vskyty v celom sbore, s otzkou i nahradi alebo nie ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCIA 4 ZHRNUTIE 1. CTRL-g vype tvoju pozciu v sbore a status sboru. G a premiestni na koniec riadku. slo G a premiestni na riadok s slom. gg a presunie na prv riadok 2. Napsanie / nasledovan reazcom vyhad reazec smerom DOPREDU. Napsanie ? nasledovan reazcom vyhada reazec smerom DOZADU. Napsanie n po vyhadvan, vyhad nasledujci vskyt reazca v rovnakom smere, priom N vyhad v opanom smere. CTRL-O a vrti sp na stariu pozciu, CTRL-I na noviu pozciu. 3. Napsanie % ke kurzor je na (,),[,],{, alebo } njde zodpovdajcu prnu ztvorku. 4. Pre nahradenie novho za prv star v riadku nap :s/star/nov Pre nahradenie novho za vetky star v riadku nap :s/star/nov/g Pre nahradenie reazcov medzi dvoma riadkami 3 nap :#,#/star/nov/g Pre nahradenie vetkch vskytov v sbore nap :%s/star/nov/g Pre potvrdenie kadho nahradenia pridaj 'c' :%s/star/nov/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 5.1 AKO SPUSTI VONKAJ PRKAZ ** Nap prkaz :! nasledovan vonkajm prkazom pre spustenie prkazu ** 1. Nap obvykl pkaz : ktor nastav kurzor na spodok obrazovky. To umon napsa prkaz. 2. Teraz nap ! (vkrink). To umon spusti hociak vonkaj prkaz z prkazovho riadku. 3. Ako prklad nap ls za ! a stla . Tento prkaz zobraz obsah tvojho adresra rovnako ako na prkazovom riadku. Alebo poui :!dir ak ls nefunguje. Poznmka: Takto je mon spusti hociak vonkaj prkaz s argumentami. Poznmka: Vetky prkazy : musia by dokonen stlaenm ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 5.2: VIAC O UKLADAN SBOROV ** Pre uloenie zmien v sbore, nap :w FILENAME. ** 1. Nap :!dir alebo :!ls pre vpis aktulneho adresra. U vie, e mus za tmto stlai . 2. Vyber nzov sboru, ktor ete neexistuje, ako napr. TEST. 3. Teraz nap: :w TEST (kde TEST je nzov vybratho sboru.) 4. To ulo cel sbor (Vim Tutor) pod nzovm TEST. Pre overenie nap :!dir , m zobraz obsah adresra. Poznmka: e ak ukon prcu s editorom Vim a znovu ho spust prkazom vim TEST, sbor bude kpia vuky, ke si ho uloil. 5. Teraz odstr sbor napsanm (MS-DOS): :!del TEST alebo (Unix): :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 5.3 VBER TEXTU PRE ULOENIE ** Pre uloenie asti sboru, nap v pohyb :w FILENAME ** 1. Presu kurozr na tento riadok. 2. Stla v a presu kurozr na piatu poloku dole. Poznmka, e tento text je vyznaen (highlighted). 3. Stla klvesu : . V spodnej asti okna sa objav :'<,'>. 4. Nap w TEST , kde TEST je meno sboru, ktor zatial neexistuje. Skontroluj, e vid :'<,'>w TEST predtm ne stla Enter. 5. Vim zape oznaen riadky do sboru TEST. Poui :!dir alebo :!ls pre overenie. Zatial ho ete nema! Pouijeme ho v alej lekcii. POZNMKA: Stlaenm klvesy v sa spust vizulne oznaovanie. Me pohybova kurzorom pre upresnenie vyznaenho textu. Potom me poui opertor pre vykonanie nejakej akcie s textom. Naprklad d zmae vyznaen text. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 5.4: VBER A ZLUOVANIE SBOROV ** Pre vloenie obsahu sboru, nap :r FILENAME ** 1. Premiestni kurzor nad tento riadok. POZNMKA: Po vykonan kroku 2 uvid text z lekcie 5.3. Potom sa presu dole, aby si videl tto lekciu. 3. Teraz vlo sbor TEST pouitm prkazu :r TEST kde TEST je nzov sboru. Sbor, ktor si pouil je umiestnen pod riadkom s kurzorom. POZNMKA: Me tie nata vstup vonkajieho prkazu. Naprklad :r !ls nata vstup prkazu ls a umiestni ho za pozciu kurzora. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCIA 5 ZHRNUTIE 1. :!prkaz spust vonkaj prkaz. Niektor vyuiten prklady s: (MS_DOS) (UNIX) :!dir :!ls - zobraz obsah adresra :!del FILENAME :!rm FILENAME - odstrni sbor FILENAME 2. :w FILENAME ulo aktulny sbor na disk pod menom FILENAME. 3. v pohyb :w FILENAME ulo vizulne oznaen riadky do sboru FILENAME. 4. :r FILENAME vyberie z disku sbor FILENAME a vlo ho do aktulneho sboru za pozciou kurzora. 5. :r !dir nata vstup z prkazu dir a vlo ho za pozciu kurzora. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 6.1: PRKAZ OTVORI ** Nap o pre vloenie riadku pod kurzor a prepnutie do vkladacieho mdu ** 1. Presu kurzor niie na riadok oznaen znakou --->. 2. Nap o (mal psmeno) pre vloenie istho riadku pod kurzorm a prepnutie do vkladacieho mdu. 3. Teraz skopruj riadok oznaen ---> a stla pre ukonenie vkladacieho mdu. ---> Po napsan o sa kurzor premiestn na vloen riadok do vkladacieho mdu. 4. Pre otvorenie riadku nad kurzorom, jednotucho nap vek O , namiesto malho o. Vyskaj si to na riadku dole. ---> Vlo riadok nad tmto napsanm O, ke kurzor je na tomto riadku. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 6.2: PRKAZ PRIDA ** Nap a pre vloenie textu ZA kurzor. ** 1. Presu kurzor niie na koniec prvho riadku oznaenho znakou ---> 2. Stla klvesu e dokia kurozr nieje na konci riadku. 3. Nap a (mal psmeno) pre pridanie textu ZA kurzorom. 4. Dokon slovo tak ako je to v druhom riadku. Stla pre opustenie vkladacieho mdu. 5. Poui e na presun na alie nedokonen slovo a zopakuj kroky 3 a 4. ---> Tento ri ti dovouje ncv privan testu na koniec riadku. ---> Tento riadok ti dovouje ncvik pridvania textu na koniec riadku. POZNMKA: a, i, A tartuj rovnak vkladac md, jedin rozidel je, kde sa znaky vkladaj. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 6.3: IN SPOSOB NAHRADZOVANIA ** Nap vek R pre nahradenie viac ako jednho znaku. ** 1. Presu kurzor niie na prv riadok oznaen znakou --->. Premiestni kurzor na zaiatok prvho vskytu xxx. 2. Teraz nap R a nap slo uveden v druhom riadku, take sa nm nahrad pvodn xxx. 3. Stla pre opustenie nahradzovacieho mdu. Poznmka, e zvyok riadku zostane nezmenen. 4. Zopakuj tieto kroky pre nahradenie zvynch xxx. ---> Pridanm 123 ku xxx dostane xxx. ---> Pridanm 123 ku 456 dostane 579. POZNMKA: Nahradzovac md je ako vkladac md, ale kad napsan znak zmae existujci znak. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 6.4: Copy Paste textu ** pou opertor y pre copy textku a p pre jeho paste ** 1. Cho niie na riadok oznaen ---> a umiestni kurozr za "a)". 2. Natartuj vizulny md pouitm v a presu kurozr pred "first". 3. Nap y pre vystrihnutie (copy) oznaenho textu. 4. Presu kurozr na koniec alieho riadku: j$ 5. Nap p pre vlonie (paste) textu. Potom nap: a druha . 6. Poui vizulny md pre oznaenie "poloka.", vystrihni to pouitm y, presu sa na koniec nasledujceho riadku pouitm j$ a vlo sem text pouitm p. ---> a) toto je prv poloka ---> b) POZNMKA: Me poui tie y ako opertor; yw vystrihne jedno slovo. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 6.5: NASTAVENIE MONOST ** Nastav monosti, take vyhadvanie alebo nahradzovanie ignoruje rozliovanie ** 1. Vyhadaj reazec 'ignore' napsanm: /ignore Zopakuj vyhadvanie niekoko krt stlaenm klvesy n . 2. Nastav monos 'ic' (Ignore case) napsanm prkazu: :set ic 3. Teraz vyhadaj reazec 'ingore' znova stlaenm klvesy n Poznmka, e teraz s vyhadan aj Ignore a IGNORE. 4. Nastav monosi 'hlsearch' a 'incsearch': :set hls is 5. Teraz spusti vyhadvac prkaz znovu, a pozri o sa stalo: /ignore 6. Pre opetovn zapnutie rozlyovania vekch a malch psmen nap: :set noic POZNMKA: Na odstrnenie zvraznenia vrazov nap: :nohlsearch POZNMKA: Ak chce nerozlyova vekos psmen len pre jedno pouitie vyhadvacieho prkazu, poui \c: /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCIA 6 ZHRNUTIE 1. Nap o pre otvorenie riadku pod kurzorom a tart vkladacieho mdu. Nap O pre otvorenie riadku nad kurzorom. 2. Nap a pre vkladanie textu ZA kurzor. Nap A pre vkladanie textu za koncom riadku. 3. Prkaz e presunie kurozr na koniec slova 4. Opertor y vystrihne (skopruje) text, p ho vlo. 5. Napsanie vekho R prepne do nahradzovacieho mdu, km nieje stlaen . 6. Napsanie ":set xxx" nastav monos "xxx". Niektor nastavenia s: 'ic' 'ignorecase' ignoruje vek a mal psmen poas vyhadvania. 'is' 'incsearch' zobrazuje iaston reazce vyhadvanho reazca. 'hls' 'hlsearch' vyzna vetky vyhadvan reazce. Me poui hociktor z dlhch a krtkych nzvov monost. 7. Vlo "no" pred nastavenie pre jeho vypnutie: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCIA 7.1: ZSKANIE NPOVEDY ** Pouvaj on-line systm npovedy ** Vim m obsiahly on-line systm npovedy. Pre odtartovanie, vyskaj jeden z tchto troch: - stla klvesu (ak nejak m) - stla klvesu (ak nejak m) - nap :help taj text v okne npovedy pre zskanie predstavy ako npoveda funguje. Nap CTRL-W CTRL-W pre skok z jednho okna do druhho. Nap :q m zatvor okno npovedy. Me njs help ku hociakej tme pridanm argumentu ku prkazu ":help". Vyskaj tieto (nezabudni stlai ): :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCIA 7.2: VYTVORENIE TARTOVACIEHO SKRIPTU ** Zapni funkcie editora Vim ** Vim m omnoho viac funkcii ne Vi, ale veina z nich je implicitne vypnut. Pre pouvanie viac Vim funkcii vytvor "vimrc" sbor. 1. Zani editova "vimrc" sbor, to zvis na pouitom systme: :e ~/.vimrc pre Unix :e $VIM/_vimrc pre MS-Windows 2. Teraz si pretaj text prkladu "vimrc" sboru: :r $VIMRUNTIME/vimrc_example.vim 3. Ulo sbor: :w Pri nasledujcom tarte editora Vim sa pouije zvrazovanie syntaxe. Do "vimrc" sboru me prida vetky svoje uprednostovan nastavenia. Pre viac informcii nap :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCIA 7.3 DOKONENIE ** Dokoni prkaz na prkazovom riadku pouitm CTRL-D a ** 1. Uisti sa, e Vim nieje v kompatibilnom mde: :set nocp 2. Pozri sa ak sbory sa nachdzaj v adresri: :!ls alebo :!dir 3. Nap zaiatok prkazu: :e 4. Stla CTRL-D a Vim zobraz zoznam prkazov zanajcich "e". 5. Stla a Vim dokon meno prkazu na ":edit". 6. Teraz pridaj medzernk a zaiatok mena existujceho sboru: :edit FIL 7. Stla . Vim dokon meno (ak je jedinen). POZNMKA: Dokonovanie funguje pre vea prkazov. Vyskaj stlaenie CTRL-D a . pecilne je to uiton pre prkaz :help. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCIA 7 ZHRNUTIE 1. Nap :help alebo stla alebo pre otvorenie okna npovedy. 2. Nap :help prkaz pre vyhadanie npovedy ku prkazu prkaz. 3. Nap CTRL-W CTRL-W na preskoenie do inho okna. 4. Nap :q pre zatvorenie okna npovedy 5. Vytvor tartovac skript vimrc pre udranie uprednostovanch nastaven. 6. Poas psania prkazu : stla CTRL-D pre zobrazenie dokonen. Stla pre pouitie jednho z dokonen. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Toto vymedzuje vuku Vimu. Toto je uren pre strucn prehad o editore Vim, plne postaujce pre ahk a obstojn pouvanie tohto editora. Tto vuka je aleko od kompletnosti, pretoe Vim m omnoho viacej prkazov. Ako alie si pretaj uvatsk manul: ":help user-manual". Pre alie tanie a tdium je odporan kniha: Vim - Vi Improved - od Steve Oualline Vydavate: New Riders Prv kniha uren pre Vim. pecilne vhodn pre zaiatonkov. Obsahuje mnostvo prkladov a obrzkov. Pozri na http://iccf-holland.org/click5.html Tto kniha je staria a je viac o Vi ako o Vim, ale je tie odporan: Learning the Vi Editor - od Linda Lamb Vydavate: O'Reilly & Associates Inc. Je to dobr kniha pre zskanie vedomost o prci s editorom Vi. ieste vydanie obsahuje tie informcie o editore Vim. Tto vuka bola napsan autormi Michael C. Pierce a Robert K. Ware, Colorado School of Mines s pouitm mylienok dodanmi od Charles Smith, Colorado State University. E-mail: bware@mines.colorado.edu. Modifikovan pre Vim od Bram Moolenaar. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Preklad do Sloveniny: ubo elko e-mail: celbos@inmail.sk Last Change: 2006 Apr 18 encoding: cp1250 vim-7.4.1689/runtime/tutor/tutor.sk.utf-8000066400000000000000000001053061267703067000201200ustar00rootroot00000000000000=============================================================================== = V i t a j t e v o V I M T u t o r i a l i - Verzia 1.7 = =============================================================================== 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. UPOZORNENIE: 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č 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ť. Naozaj! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCIA 1.2: ZATVÁRANIE VIMU !! POZNÁMKA: Pred vykonaním týchto krokov si prečítaj celú túto lekciu !! 1. Stlač klávesu (aby si sa učite nachádzal v normálnom móde) 2. Napíš: :q! . Tým ukončíš prácu s editorom BEZ uloženia zmien, ktoré si vykonal. 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 4. Ak si si tieto kroky spoľahlivo zapamätal, vykonaj kroky 1 až 3, pre ukončenie a znovu spustenie editora. POZNÁMKA: :q! neuloží zmeny, ktoré si vykonal. O niekoľko lekcií sa naučíš ako uložiť zmeny do súboru 5. 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 zapamätať obsah tejto výuky, ale sa uč používaním. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 1.4: EDITÁCIA TEXTU - VKLADANIE ** Stlačenie klávesy i 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č 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. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 1.5: EDITÁCIA TEXTU - PRIDÁVANIE ** Stlačenie klávesy A umožňuje pridávať text. ** 1. Presuň kurozr nižšie na prvý riadok za značkou --->. Nezáleží na tom, na ktorom znaku sa kurzor v tom riadku nachádza. 2. Stlač klávesu A a napíš potrebný text. 3. Po pridaní textu stlač klávesu pre návrat do Normálneho módu. 4. Presuň kurozr na druhý riadok označený ---> a zopakuj kroky 2 a 3 kým nieje veta správna. ---> Tu je nejaký text chýbajúci o Tu je nejaký text chýbajúci od tiaľto. ---> Tu tiež chýba nej Tu tiež chýba nejaký text. 5. Keď sa dostatočne naučíš pridávať text, prejdi na lekciu 1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 1.6: EDITÁCIA SÚBORU ** Napísaním :wq sa súbor uloží a zavrie ** !! POZNÁMKA: Pred vykonaním týchto krokov si prečítaj celú lekciu!! 1. Opusti túto výuku, ako si to urobil v lekcii 1.2: :q! 2. Do príkazového riadku napíš príkaz: vim tutor 'vim' je príkaz, ktorý spustí editor Vim, 'tutor' je meno súboru, ktorý chceš editovať. Použi taký súbor, ktorý môžeš meniť. 3. Vlož a zmaž text tak, ako si sa naučil v predošlých lekciach. 4. Ulož súbor so zmenami a opusti Vim príkazom: :wq 5. Reštartuj vimtutor a presuň sa dole na nasledujúce zhrnutie. 6. Urob tak po prečítaní predošlých krokov a porozumeniu im. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 3. Na ukončenie Vimu napíš: :q! pre zrušenie všetkých zmien alebo napíš: :wq pre uloženie zmien. 4. Na zmazanie znaku na mieste kurzora napíš: x 5. Pre vloženie textu na mieste kurzora v normálnom móde napíš: i napíš vkladaný text vkladanie pred kurzor A napíš pridávaný text vkladanie za riadok POZNÁMKA: Stlačenie ť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č 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ísmeno d sa zobrazí na poslednom riadku obrazovky keď ho napíšeš. Vim na teba počká, aby si mohol napísať písmeno w. Ak vidíš niečo iné ako d , tak si napísal nesprávny znak; stlač 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č 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: OPERÁTORY A POHYBY Veľa príkazov, ktoré menia text sú odvodené od operátorov a pohybov. Formát pre príkaz mazania klávesou d je nasledovný: d pohyb kde: d - je mazací operátor pohyb - je to čo operátor vykonáva (vypísané nižšie) Krátky list pohybov: w - do začiatku ďalšieho slova, okrem jeho prvého písmena. e - do konca terajšieho slova, vrátane posledného znaku. $ - do konca riadku, vrátane posledného znaku Takže napísaním de sa zmaže všetko od kurzora do konca slova. POZNÁMKA: Stlačením iba pohybu v normálnom móde bez operátora sa presunie kurzor tak ako je to špecivikované. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 2.4: Použitie viacnásobného pohybu ** Napísaním čísla pred pohyb ho zopakuje zadný počet krát ** 1. Presuň kurozr nižšie na začiatok riadku označeného --->. 2. Napíš 2w a kurozr sa presunie o dve slová vpred. 3. Napíš 3e a kurozr sa presunie vpred na koniec tretieho slova. 4. Napíš 0 (nula) a kurozr sa presunie na začiatok riadku. 5. Zopakuj kroky 2 a 3 s rôznymi číslami. ---> Toto je riadok so slovami po kotrých sa môžete pohybovať. 6. Prejdi na lekciu 2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 2.5: POUŽITIE VIACNÁSOBNÉHO MAZANIA PRE HROMADNÉ MAZANIE ** Napísanie čísla spolu s operátorom ho zopakuje zadaný počet krát ** V kombinácii operátorov mazania a pohybu spomínaného vyššie vlož počet pred pohyb pre docielenie hromadného mazania: d číslo pohyb 1. Presuň kurzor na prvé slovo písané VEĽKÝMI PÍSMENAMI v riadku označenom --->. 2. Napíš 2dw a zmažeš dve slová písané VEĽKÝMI PÍSMENAMI 3. Zopakuj kroky 1 a 2 s použitím rôzneho čísla tak aby si zmazal slová písané veľkými písmenami jedným príkazom. ---> Tento ABC DE riadok FGHI JK LMN OP so slovamI je Q RS TUV vycisteny. POZNÁMKA: Číslo medzi operátorom d a pohybom funguje podobne ako pri použití s pohybom bez operátora. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 2.6: OPERÁCIE S RIADKAMI ** 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 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.7: 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 (undo z undo). ---> 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. Pre zopakovanie pohybu, napíš pred neho číslo: 2w 5. Formát pre píkaz: operátor [číslo] pohyb kde: operátor - čo treba robiť, napríklad d pre zmazanie [číslo] - je voliteľný počet pre opakovanie pohybu pohyb - pohyb po texte vzhľadom na operátor, napríklad w (slovo), $ (do konca riadku), atď. 6. Pre pohyb na začiatok riadku použi nulu: 0 7. 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 rx sa nahradí znak na mieste kurzora znakom x . ** 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ý tam má byť. 4. Zopakuj kroky 2 a 3, kým prvý riadok nieje zhodný s druhým. ---> 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 do konca slova, napíš ce . ** 1. Presuň kurzor nižšie na prvý riadok označený značkou --->. 2. Umiestni kurzor na písmeno o v slove rosfpl. 3. Napíš ce a oprav slovo (v tomto prípade napíš 'iadok'.) 4. Stlač a prejdi na ďalší 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 ce zmaže slovo a nastaví vkladací mód. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 3.4: VIAC ZMIEN POUŽITÍM c ** Príkaz pre úpravy sa používa s rovnakými pohybmi ako pre mazanie ** 1. Príkaz pre úpravy pracuje rovnako ako pre mazanie. Formát je: c [číslo] pohyb 2. Pohyby sú rovnaké, ako napríklad w (slovo) a $ (koniec riadku). 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č . ---> Koniec tohto riadku potrebuje pomoc, aby bol ako druhy. ---> Koniec tohto riadku potrebuje opraviť použitím príkazu c$ . POZNÁMKA: Môžeš použiť klávesu backspace na úpravu zmien počas písania. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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ť od kurzora až po miesto, ktoré určuje pohyb. napr. Napíš ce čím zmníš text od pozície kurzora do konca slova, c$ zmení text do konca riadku. 4. Formát pre nahradenie je: c [číslo] pohyb 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. Napíš G pre presun 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 . Toto nazývame CTRL-G. Na spodu obrazovky sa zobrazí správa s názvom súboru a pozíciou v súbore. Zapamätajsi si číslo riadku pre použitie v kroku 3. 2. Stlač G čím sa dostaneš na spodok súboru. Napíš gg čím sa dostaneš na začiatok súboru. 3. Napíš číslo riadku na ktorom si sa nachádzal a stlač G. To ťa vráti na riadok, na ktorom si prvý krát stlačil CTRL-G. 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 s : príkazom. 2. Teraz napíš 'errroor' . 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, N. 4. Ak chceš vyhľadať reťazec v spätnom smere, použí príkaz ? miesto príkazu /. 5. Pre návrat na miesto z ktorého si prišiel stlač CTRL-O (drž stlačenú klávesu Ctrl počas stlačenia klávesy o). Zopakuj pre ďalší návrat späť. CTRL-I ide vpred. POZNÁMKA: "errroor" nieje spôsob hláskovania error; errroor je error. POZNÁMKA: Keď vyhľadávanie dosiahne koniec tohto súboru, bude pokračovať na začiatku, dokiaľ nieje resetované nastavenie 'wrapscan' . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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. 5. Presuň kurzor na iný zo znakov (,),[,],{ alebo } a všimni si čo % vykonáva. ---> 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: PRÍKAZ NAHRADENIA ** 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 . Poznamka, že tento príkaz zmení len prvý výskyt "thee" 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, v rozsahu ktorých sa nahradenie vykoná. napíš :%s/starý/nový/g pre zmenu všetkých výskytov v celom riadku napíš :%s/starý/nový/gc nájde všetky výskyty v celom súbore, s otázkou či nahradiť alebo nie ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCIA 4 ZHRNUTIE 1. CTRL-g vypíše tvoju pozíciu v súbore a status súboru. G ťa premiestni na koniec riadku. číslo G ťa premiestni na riadok s číslom. gg ťa presunie na prvý riadok 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 N vyhľadá v opačnom smere. CTRL-O ťa vráti späť na staršiu pozíciu, CTRL-I na novšiu pozíciu. 3. Napísanie % keď kurzor je na (,),[,],{, alebo } nájde zodpovdajúcu párnu zátvorku. 4. Pre nahradenie nového za prvý starý v riadku napíš :s/starý/nový Pre nahradenie nového za všetky staré v riadku napíš :s/starý/nový/g Pre nahradenie reťazcov medzi dvoma riadkami 3 napíš :#,#/starý/nový/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/starý/nový/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č . 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 s argumentami. Poznámka: Všetky príkazy : musia byť dokončené stlačením ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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ť . 2. Vyber názov súboru, ktorý ešte neexistuje, ako napr. TEST. 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íš príkazom vim 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ÝBER TEXTU PRE ULOŽENIE ** Pre uloženie časti súboru, napíš v pohyb :w FILENAME ** 1. Presuň kurozr na tento riadok. 2. Stlač v a presuň kurozr na piatu položku dole. Poznámka, že tento text je vyznačený (highlighted). 3. Stlač klávesu : . V spodnej časti okna sa objaví :'<,'>. 4. Napíš w TEST , kde TEST je meno súboru, ktorý zatial neexistuje. Skontroluj, e vidíš :'<,'>w TEST predtým než stlačíš Enter. 5. Vim zapíše označené riadky do súboru TEST. Použi :!dir alebo :!ls pre overenie. Zatial ho ešte nemaž! Použijeme ho v ďalšej lekcii. POZNÁMKA: Stlačením klávesy v sa spustí vizuálne označovanie. Môžeš pohybovať kurzorom pre upresnenie vyznačeného textu. Potom môžeš použiť operátor pre vykonanie nejakej akcie s textom. Napríklad d zmaže vyznačený text. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 5.4: VÝBER A ZLUČOVANIE SÚBOROV ** Pre vloženie obsahu súboru, napíš :r FILENAME ** 1. Premiestni kurzor nad tento riadok. POZNÁMKA: Po vykonaní kroku 2 uvidíš text z lekcie 5.3. Potom sa presuň dole, aby si videl túto lekciu. 3. Teraz vlož súbor TEST použitím príkazu :r TEST kde TEST je názov súboru. Súbor, ktorý si použil je umiestnený pod riadkom s kurzorom. POZNÁMKA: Môžeš tiež načítať výstup vonkajšieho príkazu. Napríklad :r !ls načíta výstup príkazu ls a umiestni ho za pozíciu kurzora. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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. v pohyb :w FILENAME uloží vizuálne označené riadky 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. 5. :r !dir načíta výstup z príkazu dir a vloží ho za pozíciu 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č 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 riadku dole. ---> Vlož riadok nad týmto napísaním 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 ---> 2. Stlač klávesu e dokiaľ kurozr nieje na konci riadku. 3. Napíš a (malé písmeno) pre pridanie textu ZA kurzorom. 4. Dokončí slovo tak ako je to v druhom riadku. Stlaš pre opustenie vkladacieho módu. 5. Použi e na presun na ďalšie nedokončené slovo a zopakuj kroky 3 a 4. ---> Tento ri ti dovoľuje nácv priávan testu na koniec riadku. ---> Tento riadok ti dovoľuje nácvik pridávania textu na koniec riadku. POZNÁMKA: a, i, A štartujú rovnaký vkladací mód, jediný rozidel je, kde sa znaky vkladajú. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 --->. Premiestni kurzor na začiatok prvého výskytu xxx. 2. Teraz napíš R a napíš číslo uvedené v druhom riadku, takže sa ním nahradí pôvodné xxx. 3. Stlač pre opustenie nahradzovacieho módu. Poznámka, že zvyšok riadku zostane nezmenený. 4. Zopakuj tieto kroky pre nahradenie zvyšných xxx. ---> Pridaním 123 ku xxx dostaneš xxx. ---> Pridaním 123 ku 456 dostaneš 579. POZNÁMKA: Nahradzovací mód je ako vkladací mód, ale každý napísaný znak zmaže existujúci znak. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 6.4: Copy Paste textu ** použí operátor y pre copy textku a p pre jeho paste ** 1. Choď nižšie na riadok označený ---> a umiestni kurozr za "a)". 2. Naštartuj vizuálny mód použitím v a presuň kurozr pred "first". 3. Napíš y pre vystrihnutie (copy) označeného textu. 4. Presuň kurozr na koniec ďalšieho riadku: j$ 5. Napíš p pre vložnie (paste) textu. Potom napíš: a druha . 6. Použi vizuálny mód pre označenie "položka.", vystrihni to použitím y, presuň sa na koniec nasledujúceho riadku použitím j$ a vlož sem text použitím p. ---> a) toto je prvá položka ---> b) POZNÁMKA: Môžeš použiť tiež y ako operátor; yw vystrihne jedno slovo. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 6.5: 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 Poznámka, že teraz sú vyhľadané aj Ignore a IGNORE. 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. Pre opetovné zapnutie rozlyšovania veľkých a malých písmen napíš: :set noic POZNÁMKA: Na odstránenie zvýraznenia výrazov napíš: :nohlsearch POZNÁMKA: Ak chceš nerozlyšovať veľkosť písmen len pre jedno použitie vyhľadávacieho príkazu, použi \c: /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCIA 6 ZHRNUTIE 1. Napíš o pre otvorenie riadku pod kurzorom a štart vkladacieho módu. Napíš O pre otvorenie riadku nad kurzorom. 2. Napíš a pre vkladanie textu ZA kurzor. Napíš A pre vkladanie textu za koncom riadku. 3. Príkaz e presunie kurozr na koniec slova 4. Operátor y vystrihne (skopíruje) text, p ho vloží. 5. Napísanie veľkého R prepne do nahradzovacieho módu, kým nieje stlačené . 6. Napísanie ":set xxx" nastaví možnosť "xxx". Niektoré nastavenia sú: 'ic' 'ignorecase' ignoruje veľké a malé písmená počas vyhľadávania. 'is' 'incsearch' zobrazuje čiastočné reťazce vyhľadávaného reťazca. 'hls' 'hlsearch' vyznačí všetky vyhľadávané reťazce. Môžeš použiť hociktorý z dlhých a krátkych názvov možností. 7. Vlož "no" pred nastavenie pre jeho vypnutie: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCIA 7.1: ZÍSKANIE 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 (ak nejakú máš) - stlač klávesu (ak nejakú máš) - napíš :help Čítaj text v okne nápovedy pre získanie predstavy ako nápoveda funguje. Napíš CTRL-W CTRL-W pre skok z jedného okna do druhého. Napíš :q čí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ť ): :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCIA 7.2: 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: :e ~/.vimrc pre Unix :e $VIM/_vimrc pre MS-Windows 2. Teraz si prečítaj text príkladu "vimrc" súboru: :r $VIMRUNTIME/vimrc_example.vim 3. Ulož súbor: :w 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. Pre viac informácii napíš :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCIA 7.3 DOKONČENIE ** Dokonči príkaz na príkazovom riadku použitím CTRL-D a ** 1. Uisti sa, že Vim nieje v kompatibilnom móde: :set nocp 2. Pozri sa aké súbory sa nachádzajú v adresári: :!ls alebo :!dir 3. Napíš začiatok príkazu: :e 4. Stlač CTRL-D a Vim zobrazí zoznam príkazov začínajúcich "e". 5. Stlač a Vim dokončí meno príkazu na ":edit". 6. Teraz pridaj medzerník a začiatok mena existujúceho súboru: :edit FIL 7. Stlač . Vim dokončí meno (ak je jedinečné). POZNÁMKA: Dokončovanie funguje pre veľa príkazov. Vyskúšaj stlačenie CTRL-D a . Špeciálne je to užitočné pre príkaz :help. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCIA 7 ZHRNUTIE 1. Napíš :help alebo stlač alebo pre otvorenie okna nápovedy. 2. Napíš :help príkaz pre vyhľadanie nápovedy ku príkazu príkaz. 3. Napíš CTRL-W CTRL-W na preskočenie do iného okna. 4. Napíš :q pre zatvorenie okna nápovedy 5. Vytvor štartovací skript vimrc pre udržanie uprednostňovaných nastavení. 6. Počas písania príkazu : stlač CTRL-D pre zobrazenie dokončení. Stlač pre použitie jedného z dokončení. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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: 2006 Apr 18 encoding: iso8859-2 vim-7.4.1689/runtime/tutor/tutor.sr.cp1250000066400000000000000000001004441267703067000200740ustar00rootroot00000000000000=============================================================================== = D o b r o d o l i u VIM p r i r u n i k - Verzija 1.7 = =============================================================================== Vim je moan editor sa mnogo komandi, suvie da bismo ih ovde sve opisali. Prirunik je zamiljen da opie dovoljno komandi da biste mogli lagodno da koristite Vim kao editor opte namene. Priblino vreme potrebno za uspean zavretak prirunika je izmeu 25 i 30 minuta, u zavisnosti od vremena potroenog na vebu. UPOZORENJE: Komande u lekcijama e menjati tekst. Iskopirajte ovaj fajl i vebajte na kopiji (ako ste pokrenuli "vimtutor" ovo je ve kopija). Vano je upamtiti da je ovaj prirunik zamiljen za aktivnu vebu. To znai da morate upotrebljavati komande o kojima itate da biste ih nauili. Ako samo itate tekst, zaboraviete komande! Ako je Caps Lock ukljuen ISKLJUITE ga. Pritisnite taster j dovoljno puta da lekcija 1.1 cela stane na ekran. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1.1: POMERANJE KURSORA ** Za pomeranje kursora, pritiskajte tastere h,j,k,l kako je prikazano ** ^ k Savet: h je s leve strane i pomera kursor u levo. < h l > l je s desne strane i pomera kursor u desno. j j izgleda kao strelica nanie. v 1. Pomerajte kursor po ekranu dok se ne naviknete na komande. 2. Pritisnite taster (j) dok ne pone da se ponavlja. Sada znate kako da doete do naredne lekcije. 3. Koristei taster j preite na lekciju 1.2. NAPOMENA: Ako niste sigurni ta ste zapravo pritisnuli, pritisnite za prelazak u Normal mod i pokuajte ponovo. NAPOMENA: Strelice takoe pomeraju kursor, ali korienje tastera hjkl je znatno bre, kad se jednom naviknete na njih. Zaista! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1.2: IZLAZAK IZ VIM-a !! UPOZORENJE: Pre izvoenja bilo kog koraka, proitajte celu lekciju!! 1. Pritisnite (editor je sada u Normal modu). 2. Otkucajte: :q! . Ovime se izlazi iz editora, sa GUBITKOM svih izmena. 3. Kada se pojavi komandni prompt, unesite komandu koja je pokrenula ovaj prirunik: vimtutor 4. Ako ste upamtili ove korake, izvrite ih redom od 1 do 3 da biste izali iz editora i ponovo ga pokrenuli. NAPOMENA: :q! ponitava sve izmene koje ste napravili. U narednim lekcijama nauiete kako da sauvate izmene. 5. Pomerite kursor na lekciju 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1.3: IZMENA TEKSTA - BRISANJE ** Pritisnite x za brisanje znaka pod kursorom. ** 1. Pomerite kursor na red oznaen sa --->. 2. Da biste ispravili greke, pomerajte kursor dok se ne nae na slovu koje treba izbrisati. 3. Pritisnite taster x da izbriete neeljeno slovo. 4. Ponavljajte korake od 2 do 4 dok ne ispravite sve greke. ---> RRRibaa riibi grizzze rrreepp. 5. Kad ispravite red, preite na lekciju 1.4. NAPOMENA: Dok koristite prirunik, nemojte uiti komande napamet, ve vebajte njihovu primenu. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1.4: IZMENA TEKSTA - UBACIVANJE ** Pritisnite i za ubacivanje teksta ispred kursora. ** 1. Pomerite kursor na prvi sledei red oznaen sa --->. 2. Da biste tekst prvog reda izjednaili s tekstom drugog, namestite kursor na prvi znak POSLE kog ete ubaciti potreban tekst. 3. Pritisnite i pa unesite potrebne dopune. 4. Po ispravci svake greke pritisnite da se vratite u Normal mod. Ponovite korake od 2 do 4 da biste ispravili celu reenicu. ---> Do teka neoje v red. ---> Deo teksta nedostaje iz ovog reda. 5. Preite na sledeu lekciju. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1.5: IZMENA TEKSTA - DODAVANJE ** Pritisnite A za dodavanje teksta. ** 1. Pomerite kursor na prvi sledei red oznaen sa --->. Nije vano gde se nalazi kursor u tom redu. 2. Pritisnite A i unesite dodatni tekst. 3. Poto ste dodali tekst, pritisnite za povratak u Normal mod. 4. Pomerite kursor na drugi red oznaen sa ---> i ponavljajte korake 2 i 3 dok ne ispravite tekst. ---> Deo teksta nedostaje u Deo teksta nedostaje u ovom redu. ---> Deo teksta nedostaje Deo teksta nedostaje i ovde. 5. Preite na lekciju 1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1.6: IZMENA FAJLA ** Upotrebite :wq za snimanje teksta i izlazak iz editora. ** !! UPOZORENJE: Pre izvoenja bilo kog koraka, proitajte celu lekciju!! 1. Izaite iz editora kao u lekciji 1.2: :q! 2. Na komandnom promptu unesite sledeu komandu: vim tutor 'vim' je komanda za pokretanja Vim editora, 'tutor' je ime fajla koji elite da menjate. Koristite fajl koji imate pravo da menjate. 3. Ubacujte i briite tekst kao u prethodnim lekcijama. 4. Snimite izmenjeni tekst i izaite iz Vim-a: :wq 5. Ponovo pokrenite vimtutor i proitajte rezime koji sledi. 6. Poto proitate korake iznad i u potpunosti ih razumete: izvrite ih. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ REZIME lekcije 1 1. Kursor se pomera strelicama ili pomou tastera hjkl . h (levo) j (dole) k (gore) l (desno) 2. Za pokretanje Vim-a iz shell-a: vim IME_FAJLA 3. Izlaz: :q! sve promene su izgubljene. ILI: :wq promene su sauvane. 4. Brisanje znaka na kome se nalazi kursor: x 5. Ubacivanja ili dodavanje teksta: i unesite tekst unos ispred kursora A unesite tekst dodavanje na kraju reda NAPOMENA: Pritiskom na prebacujete Vim u Normal mod i prekidate neeljenu ili delimino izvrenu komandu. Nastavite sa lekcijom 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 2.1: NAREDBE BRISANJA ** Otkucajte dw za brisanje rei. ** 1. Pritisnite da biste bili sigurni da ste u Normal modu. 2. Pomerite kursor na red oznaen sa --->. 3. Pomerite kursor na poetak rei koju treba izbrisati. 4. Otkucajte dw da biste uklonili re. NAPOMENA: Slovo d e se pojaviti na dnu ekrana kad ga otkucate. Vim eka da otkucate w . Ako je prikazano neko drugo slovo, pogreili ste u kucanju; pritisnite i pokuajte ponovo. (Ako se ne pojavi nita, moda je iskljuena opcija 'showcmd': vidi lekciju 6.5.) ---> Neke rei smeno ne pripadaju na papir ovoj reenici. 5. Ponavljajte korake 3 i 4 dok ne ispravite reenicu, pa preite na lekciju 2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 2.2: JO BRISANJA ** Otkucajte d$ za brisanje znakova do kraja reda. ** 1. Pritisnite da biste bili sigurni da ste u Normal modu. 2. Pomerite kursor na red oznaen sa --->. 3. Pomerite kursor do kraja ispravnog dela reenice (POSLE prve . ). 4. Otkucajte d$ za brisanje ostatka reda. ---> Neko je uneo kraj ovog reda dvaput. kraj ovog reda dvaput. 5. Preite na lekciju 2.3 za podrobnije objanjenje. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 2.3: O OPERATORIMA I POKRETIMA Mnoge komande za izmenu teksta sastoje se od operatora i pokreta. Oblik komande brisanja sa d operatorom je sledei: d pokret Pri emu je: d - operator brisanja. pokret - ono na emu e se operacija izvravati (opisano u nastavku). Kratak spisak pokreta: w - sve do poetka sledee rei, NE UKLJUUJUI prvo slovo. e - sve do kraja tekue rei, UKLJUUJUI poslednje slovo. $ - sve do kraje reda, UKLJUUJUI poslednje slovo. Kucanjem de brisae se tekst od kursora do kraja rei. NAPOMENA: Pritiskom samo na taster pokreta dok ste u Normal modu, bez operatora, kursor se pomera kao to je opisano. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 2.4: KORIENJE BROJANJA ZA POKRETE ** Unoenjem nekog broja pre pokreta, pokret se izvrava taj broj puta. ** 1. Pomerite kursor na red oznaen sa --->. 2. Otkucajte 2w da pomerite kursor dve rei napred. 3. Otkucajte 3e da pomerite kursor na kraj tree rei napred. 4. Otkucajte 0 (nulu) da pomerite kursor na poetak reda. 5. Ponovite korake 2 i 3 s nekim drugim brojevima. ---> Reenica sa reima po kojoj moete pomerati kursor. 6. Preite na lekciju 2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 2.5: KORIENJE BROJANJA ZA VEE BRISANJE ** Unoenje nekog broja s operatorom ponavlja operator taj broj puta. ** U kombinaciji operatora brisanja s pokretima spomenutim iznad moete uneti broj pre pokreta da biste izbrisali vie znakova: d broj pokret 1. Pomerite kursor na prvo slovo u rei s VELIKIM SLOVIMA u redu oznaenom sa --->. 2. Otkucajte d2w da izbriete dve rei sa VELIKIM SLOVIMA 3. Ponovite korake 1 i 2 sa razliitim brojevima da izbriete uzastopne rei sa VELIKIM SLOVIMA korienjem samo jedne komande. ---> ovaj ABC DE red FGHI JK LMN OP s reima je RS TUVZ ispravljen. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 2.6: OPERACIJE NAD REDOVIMA ** Otkucajte dd za brisanje celog reda. ** Zbog uestalosti brisanja celih redova, autori Vi-ja odluili su da je lake brisati redove ako se otkuca d dvaput. 1. Pomerite kursor na drugi red u donjoj strofi. 2. Otkucajte dd da ga izbriete. 3. Pomerite kursor na etvrti red. 4. Otkucajte 2dd da biste izbrisali dva reda. ---> 1) Sedlo mi je od marame, ---> 2) blato na sve strane, ---> 3) uzda od kanapa, ---> 4) auto mi je ovde, ---> 5) satovi pokazuju vreme, ---> 6) a bi mi je od oina ---> 7) prebijena tapa. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 2.7: PONITAVANJE PROMENA ** Pritisnite u za ponitavanje poslednje komande, U za ceo red. ** 1. Pomerite kursor na red oznaen sa ---> i postavite ga na mesto prve greke. 2. Otkucajte x da izbriete prvi neeljeni znak. 3. Otkucajte u da ponitite poslednju izvrenu komandu. 4. Sad ispravite sve greke u redu koristei komandu x . 5. Otkucajte veliko U da biste vratili sadraj reda u prvobitno stanje. 6. Onda otkucajte u nekoliko puta da biste ponitili U i prethodne komande. 7. Sad otkucajte CTRL-R (drei CTRL dok pritiskate R) nekoliko puta da biste vratili izmene (ponitili ponitavanja). ---> Iiisspravite greke uu ovvom redu ii poonititeee ih. 8. Ovo su veoma korisne komande. Preite na rezime lekcije 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ REZIME lekcije 2 1. Brisanje od kursora do sledee rei: dw 2. Brisanje od kursora do kraja reda: d$ 3. Brisanje celog reda: dd 4. Za ponavljanje pokreta prethodno unesite broj: 2w 5. Oblik komande za izmenu: operator [broj] pokret gde je: operator - ta uraditi, recimo d za brisanje [broj] - neobavezan broj ponavljanja pokreta pokret - kretanje po tekstu na kome se radi, kao to je: w (re), $ (kraj reda), itd. 6. Pomeranje kursora na poetak reda: 0 7. Za ponitavanje prethodnih izmena, pritisnite: u (malo u) Za ponitavanje svih promena u redu, pritisnite: U (veliko U) Za vraanja promena, otkucajte: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 3.1: KOMANDA POSTAVLJANJA ** Otkucajte p da postavite prethodno izbrisan tekst iza kursora. ** 1. Pomerite kursor na prvi sledei red oznaen sa --->. 2. Otkucajte dd da izbriete red i smestite ga u Vim registar. 3. Pomerite kursor na red c), IZNAD mesta gde treba postaviti izbrisan red. 4. Otkucajte p da postavite red ispod kursora. 5. Ponavljajte korake 2 do 4 da biste postavili sve linije u pravilnom redosledu. ---> d) prebijena tapa. ---> b) uzda od kanapa, ---> c) a bi mi je od oina ---> a) Sedlo mi je od marame, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 3.2: KOMANDA ZAMENE ** Otkucajte rx da zamenite znak ispod kursora slovom x . ** 1. Pomerite kursor na prvi sledei red oznaen sa --->. 2. Pomerite kursor tako da se nalazi na prvoj greci. 3. Otkucajte r i onda znak koji treba da tu stoji. 4. Ponavljajte korake 2 i 3 sve dok prvi red ne bude isti kao drugi. ---> Kedi ju ovej red ugaen, nako je protresao pustane testere! ---> Kada je ovaj red unoen, neko je pritiskao pogrene tastere! 5. Preite na lekciju 3.2. NAPOMENA: Setite se da treba da uite vebanjem, ne pamenjem. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 3.3: OPERATOR IZMENE ** Za izmenu teksta do kraja rei, otkucajte ce .** 1. Pomerite kursor na prvi sledei red oznaen sa --->. 2. Postavite kursor na a u rakdur. 3. Otkucajte ce i ispravite re (u ovom sluaju otkucajte ed ). 4. Pritisnite i pomerite kursor na sledei znak koji treba ispraviti. 5. Ponavljajte korake 3 i 4 sve dok prva reenica ne bude ista kao druga. ---> Ovaj rakdur ima nekoliko rejga koje treflja isprpikati operagrom izmene. ---> Ovaj red ima nekoliko rei koje treba ispraviti operatorom izmene. Uoite da ce brie re i postavlja editor u Insert mod. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 3.4: DALJE IZMENE UPOTREBOM c ** Komanda izmene se koristi sa istim pokretima kao i brisanje. ** 1. Operator izmene se koristi na isti nain kao i operator brisanja: c [broj] pokret 2. Pokreti su isti, recimo: w (re) i $ (kraj reda). 3. Pomerite kursor na prvi sledei red oznaen sa --->. 4. Pomerite kursor na prvu greku. 5. Otkucajte c$ i unesite ostatak reda tako da bude isti kao drugi red, pa pritisnite . ---> Kraj ovog reda treba izmeniti tako da izgleda kao red ispod. ---> Kraj ovog reda treba ispraviti korienjem c$ komande. NAPOMENA: Za ispravljanje greaka moete koristiti Backspace . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ REZIME lekcije 3 1. Za postavljanje teksta koji ste upravo izbrisali, pritisnite p . Ovo postavlja tekst IZA kursora (ako je bio izbrisan jedan ili vie redova sadraj e doi na red ispod kursora). 2. Za zamenu znaka na kome se nalazi kursor, pritisnite r i onda eljeni znak. 3. Operator izmene dozvoljava promenu teksta od kursora do pozicije gde se zavrava pokret. Primera radi, kucajte ce za izmenu od kursora do kraja rei, ili c$ za izmenu od kursora do kraja reda. 4. Oblik operacije izmene je: c [broj] pokret Preite na narednu lekciju. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 4.1: POZICIJA KURSORA I STATUS FAJLA ** Pritisnite CTRL-G za prikaz pozicije kursora u tekstu i status fajla. Pritisnite G za pomeranje kursora na neki red u tekstu. ** NAPOMENA: Proitajte celu lekciju pre izvoenja bilo kog koraka!! 1. Drite taster CTRL i pritisnite g . Ovo zovemo CTRL-G. Editor e na dnu ekrana ispisati poruku sa imenom fajla i pozicijom kursora u tekstu. Zapamtite broj reda za 3. korak. NAPOMENA: U donjem desnom uglu moe se videti poziciju kursora ako je ukljuena opcija 'ruler' (vidi :help ruler ili lekciju 6.5.) 2. Pritisnite G za pomeranje kursora na kraj teksta. Pritisnite 1G ili gg za pomranje kursora na poetak teksta. 3. Otkucajte broj reda na kome ste malopre bili i onda G . Kursor e se vratiti na red na kome je bio kad ste otkucali CTRL-G. 4. Ako ste spremni, izvrite korake od 1 do 3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 4.2: KOMANDE PRETRAIVANJA ** Otkucajte / i onda izraz koji elite da potraite. ** 1. U Normal modu otkucajte znak / . Primietite da se znak pojavio zajedno sa kursorom na dnu ekrana kao i kod komande : . 2. Sada otkucajte 'grrreka' . (Bez razmaka i navodnika.) To je re koju traite. 3. Za ponovno traenje istog izraza, otkucajte n . Za traenje istog izraza u suprotnom smeru, otkucajte N . 4. Za traenje izraza unatrag, koristite ? umesto / . 5. Za povratak na prethodnu poziciju otkucajte CTRL-O (drite CTRL dok pritiskate O ). Ponavljajte za ranije pozicije. CTRL-I ide napred. ---> "grrreka" je pogreno; umesto grrreka treba da stoji greka. NAPOMENA: Ako pretraga doe do kraja teksta traenje e se nastaviti od njegovog poetka osim ako je opcija 'wrapscan' iskljuena. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 4.3: TRAENJE PARA ZAGRADE ** Otkucajte % za nalaenje para ), ] ili } . ** 1. Postavite kursor na bilo koju od ( , [ ili { otvorenih zagrada u redu oznaenom sa --->. 2. Otkucajte znak % . 3. Kursor e se pomeriti na odgovarajuu zatvorenu zagradu. 4. Otkucajte % da pomerite kursor na prvu zagradu u paru. 5. Pomerite kursor na neku od (,),[,],{ ili } i ponovite komandu % . ---> Red ( testiranja obinih ( [ uglastih ] i { vitiastih } zagrada.)) NAPOMENA: Vrlo korisno u ispravljanju koda sa rasparenim zagradama! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 4.4: KOMANDA ZAMENE ** Otkucajte :s/staro/novo/g da zamenite 'staro' za 'novo'. ** 1. Pomerite kursor na red oznaen sa --->. 2. Otkucajte :s/rdi/ri/ . Primetite da ova komanda zamenjuje samo prvo "rdi" u redu. 3. Otkucajte :s/rdi/ri/g . Dodavanje opcije g znai da e se komanda izvriti u celom redu, zamenom svih pojava niza "rdi". ---> rdiba rdibi grdize rep. 4. Za zamenu svih izraza izmeu neka dva reda, otkucajte :#,#s/staro/novo/g gde su #,# krajnji brojevi redova u opsegu u kome e se obaviti zamena. Otkucajte :%s/staro/novo/g za zamenu svih izraza u celom tekstu. Otkucajte :%s/staro/novo/gc za nalaenje svih izraza u tekstu i potvrdu zamene. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ REZIME lekcije 4 1. CTRL-G prikazuje poziciju kursora u tekstu i status fajla. G pomera kursor na kraj teksta. broj G pomera kursor na navedeni red. gg pomera kursor na prvi red teksta. 2. Kucanjem / sa izrazom taj izraz se trai UNAPRED. Kucanjem ? sa izrazom taj izraz se trai UNAZAD. Posle komande traenja koristite n za nalaenje izraza u istom smeru, a N za nalaenje u suprotnom smeru. CTRL-O vraa kursor na prethodnu poziciju, a CTRL-I na narednu. 3. Kucanjem % kad je kursor na zagradi on se pomera na njen par. 4. Za zamenu prvog izraza staro za izraz novo :s/staro/novo/ Za zamenu svih izraza u celom redu :s/staro/novo/g Za zamenu svih izraza u opsegu linija #,# :#,#s/staro/novo/g Za zamenu u celom tekstu :%s/staro/novo/g Za potvrdu svake zamene dodajte 'c' :%s/staro/novo/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 5.1: IZVRAVANJE SPOLJANJIH KOMANDI ** Otkucajte :! pa spoljanju komandu koju elite da izvrite. ** 1. Otkucajte poznatu komandu : da biste namestili kursor na dno ekrana. Time omoguavate unos komande u komandnoj liniji editora. 2. Otkucajte znak ! (uzvinik). Ovime omoguavate izvravanje bilo koje spoljanje komande. 3. Kao primer otkucajte ls posle ! i pritisnite . Ovo e prikazati sadraj direktorijuma, kao da ste na komandnom promptu. Otkucajte :!dir ako :!ls ne radi. NAPOMENA: Na ovaj nain mogue je izvriti bilo koju spoljanju komandu, zajedno sa njenim argumentima. NAPOMENA: Sve : komande se izvravaju poto pritisnete . U daljem tekstu to neemo uvek napominjati. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 5.2: VIE O SNIMANJU FAJLOVA ** Za snimanje promena, otkucajte :w IME_FAJLA . ** 1. Otkucajte :!dir ili :!ls za pregled sadraja direktorijuma. Ve znate da morate pritisnuti posle toga. 2. Izaberite ime fajla koji jo ne postoji, npr. TEST. 3. Otkucajte: :w TEST (gde je TEST ime koje ste izabrali.) 4. Time ete snimiti ceo fajl (Vim Tutor) pod imenom TEST. Za proveru, otkucajte opet :!dir ili :!ls za pregled sadraja direktorijuma. NAPOMENA: Ako biste napustili Vim i ponovo ga pokrenuli sa vim TEST , tekst bi bio tana kopija ovog fajla u trenutku kad ste ga snimili. 5. Izbriite fajl tako to ete otkucati (MS-DOS): :!del TEST ili (Unix): :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 5.3: SNIMANJE OZNAENOG TEKSTA ** Da biste snimili deo teksta, otkucajte v pokret :w IME_FAJLA ** 1. Pomerite kursor na ovu liniju. 2. Pritisnite v i pomerite kursor pet redova ispod. Primetite da je tekst oznaen inverzno. 3. Pritisnite : . Na dnu ekrana pojavie se :'<,'> . 4. Otkucajte w TEST , gde je TEST ime fajla koji jo ne postoji. Proverite da zaista pie :'<,'>w TEST pre nego to pritisnete . 5. Vim e snimiti oznaeni tekst u TEST. Proverite sa :!dir ili !ls . Nemojte jo brisati fajl! Koristiemo ga u narednoj lekciji. NAPOMENA: Komanda v zapoinje vizuelno oznaavanje. Moete pomerati kursor i tako menjati veliinu oznaenog teksta. Onda moete upotrebiti operatore nad tekstom. Na primer, d e izbrisati oznaeni tekst. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 5.4: UITAVANJE FAJLA U TEKST ** Za ubacivanje sadraja fajla, otkucajte :r IME_FAJLA ** 1. Postavite kursor iznad ove linije. NAPOMENA: Poto izvrite 2. korak videete tekst iz lekcije 5.3. Tada pomerite kursor DOLE da biste ponovo videli ovu lekciju. 2. Uitajte fajl TEST koristei komandu :r TEST gde je TEST ime fajla koje ste koristili u prethodnoj lekciji. Sadraj uitanog fajla je ubaen ispod kursora. 3. Da biste proverili da je fajl uitan, vratite kursor unazad i primetite dve kopije lekcije 5.3, originalnu i onu iz fajla. NAPOMENA: Takoe moete uitati izlaz spoljanje komande. Na primer, :r !ls e uitati izlaz komande ls i postaviti ga ispod kursora. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ REZIME lekcije 5 1. :!komanda izvrava spoljanju komandu. Korisni primeri: (MS-DOS) (Unix) :!dir :!ls - pregled sadraja direktorijuma. :!del FAJL :!rm FAJL - brie fajl FAJL. 2. :w FAJL zapisuje trenutni tekst na disk pod imenom FAJL. 3. v pokret :w IME_FAJLA snima vizuelno oznaene redove u fajl IME_FAJLA. 4. :r IME_FAJLA uitava fajl IME_FAJLA sa diska i stavlja njegov sadraj ispod kursora. 5. :r !dir uitava izlaz komande dir i postavlja ga ispod kursora. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 6.1: KOMANDA OTVORI ** Pritisnite o da biste otvorili red ispod kursora i preli u Insert mod. ** 1. Pomerite kursor na sledei red oznaen sa --->. 2. Otkucajte malo o da biste otvorili novi red ISPOD kursora i preli u Insert mod. 3. Otkucajte neki tekst i onda pritisnite da biste izali iz Insert moda. ---> Kad pritisnete o kursor prelazi u novootvoreni red u Insert modu. 4. Za otvaranje reda IZNAD kursora, umesto malog otkucajte veliko O . Isprobajte na donjem redu oznaenom sa --->. ---> Otvorite red iznad ovog kucanjem velikog O dok je kursor u ovom redu. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 6.2: KOMANDA DODAJ ** Otkucajte a za dodavanje teksta IZA kursora. ** 1. Pomerite kursor na poetak sledeeg reda oznaenog sa --->. 2. Kucajte e dok kursor ne doe na kraj rei re . 3. Otkucajte a (malo) da biste dodali tekst IZA kursora. 4. Dopunite re kao to je u redu ispod. Pritisnite za izlazak iz Insert moda. 5. Sa e preite na narednu nepotpunu re i ponovite korake 3 i 4. ---> Ovaj re omoguava ve dodav teksta u nekom redu. ---> Ovaj red omoguava vebanje dodavanja teksta u nekom redu. NAPOMENA: Komande a, i, i A aktiviraju isti Insert mod, jedina razlika je u poziciji od koje e se tekst ubacivati. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 6.3: DRUGI NAIN ZAMENE ** Otkucajte veliko R da biste zamenili vie od jednog znaka. ** 1. Pomerite kursor na prvi sledei red oznaen sa --->. Pomerite kursor na poetak prvog xxx . 2. Pritisnite R i otkucajte broj koji je red ispod, tako da zameni xxx . 3. Pritisnite za izlazak iz Replace moda. Primetite da je ostatak reda ostao nepromenjen. 4. Ponovite korake da biste zamenili drugo xxx. ---> Dodavanje 123 na xxx daje xxx. ---> Dodavanje 123 na 456 daje 579. NAPOMENA: Replace mod je kao Insert mod, s tom razlikom to svaki uneti znak brie ve postojei. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 6.4: KOPIRANJE I LEPLJENJE TEKSTA ** Koristite operator y za kopiranje a p za lepljenje teksta. ** 1. Pomerite kursor na red sa ---> i postavite kursor posle "a)". 2. Aktivirajte Visual mod sa v i pomerite kursor sve do ispred "prvi". 3. Pritisnite y da biste kopirali oznaeni tekst u interni bafer. 4. Pomerite kursor do kraja sledeeg reda: j$ 5. Pritisnite p da biste zalepili tekst. Onda otkucajte: a drugi . 6. Upotrebite Visual mod da oznaite " red.", kopirajte sa y , kursor pomerite na kraj sledeeg reda sa j$ i tamo zalepite tekst sa p . ---> a) ovo je prvi red. b) NAPOMENA: takoe moete koristiti y kao operator; yw kopira jednu re. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 6.5: POSTAVLJANJE OPCIJA ** Postavite opciju tako da traenje i zamena ignoriu veliinu slova ** 1. Potraite re 'razlika': /razlika Ponovite nekoliko puta pritiskom na n . 2. Aktivirajte opciju 'ic' (Ignore case): :set ic 3. Ponovo potraite re 'razlika' pritiskom na n Primetite da su sada pronaeni i RAZLIKA i Razlika. 4. Aktivirajte opcije 'hlsearch' i 'incsearch': :set hls is 5. Ponovo otkucajte komandu traenja i uoite razlike: /razlika 6. Za deaktiviranje opcije ic kucajte: :set noic NAPOMENA: Za neoznaavanje pronaenih izraza otkucajte: :nohlsearch NAPOMENA: Ako elite da ne razlikujete veliinu slova u samo jednoj komandi traenja, dodajte \c u izraz: /razlika\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ REZIME lekcije 6 1. Pritisnite o za otvaranje reda ISPOD kursora i prelazak u Insert mod. Pritisnite O za otvaranje reda IZNAD kursora. 2. Pritisnite a za unos teksta IZA kursora. Pritisnite A za unos teksta na kraju reda. 3. Komanda e pomera kursor na kraj rei. 4. Operator y kopira tekst, p ga lepi. 5. Kucanje velikog R aktivira Replace mod dok ne pritisnete . 6. Kucanje ":set xxx" aktivira opciju "xxx". Neke opcije su: 'ic' 'ignorecase' ne razlikuje velika/mala slova pri traenju 'is' 'incsearch' prikazuje pronaen tekst dok kucate izraz 'hls' 'hlsearch' oznaava inverzno sve pronaene izraze Moete koristite dugo ili kratko ime opcije. 7. Ispred imena opcije stavite "no" da je deaktivirate: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 7.1: DOBIJANJE POMOI ** Koristite on-line sistem za pomo ** Vim ima detaljan on-line sistem za pomo. Za poetak, pokuajte neto od sledeeg: - pritisnite taster (ako ga imate na tastaturi) - pritisnite taster (ako ga imate na tastaturi) - otkucajte :help Proitajte tekst u prozoru pomoi da biste nauili pomo radi. Kucanjem CTRL-W CTRL-W prelazite iz jednog prozora u drugi. Otkucajte :q da zatvorite prozor pomoi. Pomo o praktino bilo kojoj temi moete dobiti dodavanjem argumenta komandi ":help". Pokuajte ovo (ne zaboravite na kraju): :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 7.2: PRAVLJENJE STARTNOG SKRIPTA ** Aktivirajte mogunosti editora ** Vim ima mnogo vie mogunosti nego Vi, ali veina nije automatski aktivirana. Za dodatne mogunosti napravite "vimrc" fajl. 1. Otvorite "vimrc" fajl. Ovo zavisi od vaeg sistema: :e ~/.vimrc za Unix :e $VIM/_vimrc za MS-Windows 2. Onda uitajte primer sadraja "vimrc" fajla: :r $VIMRUNTIME/vimrc_example.vim 3. Snimite fajl sa: :w Sledei put kada pokrenete Vim, bojenje sintakse teksta bie aktivirano. Sva svoja podeavanja moete dodati u "vimrc" fajl. Za vie informacija otkucajte :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 7.3: AUTOMATSKO DOVRAVANJE ** Dovravanje komandne linije sa CTRL-D i ** 1. Podesite Vim da ne bude u Vi-kompatibilnom modu: :set nocp 2. Pogledajte koji fajlovi postoje u direktorijumu: :!ls ili :!dir 3. Otkucajte poetak komande: :e 4. Otkucajte CTRL-D i Vim e prikazati spisak komandi koje poinju sa "e". 5. Pritisnite i Vim e dopuniti ime komande u ":edit". 6. Dodajte razmak i poetak imena postojeeg fajla: :edit FA 7. Pritisnite . Vim e dopuniti ime fajla (ako je jedinstveno). NAPOMENA: Mogue je dopuniti mnoge komande. Samo probajte CTRL-D i . Naroito je korisno za :help komande. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ REZIME lekcije 7 1. Otkucajte :help ili pritisnite ili za pomo. 2. Otkucajte :help komanda biste dobili pomo za tu komandu. 3. Otkucajte CTRL-W CTRL-W za prelazak u drugi prozor. 4. Otkucajte :q da zatvorite prozor pomoi. 5. Napravite vimrc startni skript za aktiviranje podeavanja koja vam odgovaraju. 6. Dok kucate neku od : komandi, pritisnite CTRL-D da biste videli mogue vrednosti. Pritisnite da odaberete jednu od njih. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ovim je prirunik zavren. Njegov cilj je bio kratak pregled Vim editora, koliko da omogui njegovo relativno jednostavno korienje. Prirunik nije potpun, jer Vim ima mnogo vie komandi. Kao sledee, proitajte prirunik: ":help user-manual". Za dalje itanje i uenje, preporuujemo knjigu: Vim - Vi Improved - by Steve Oualline Izdava: New Riders Prva knjiga potpuno posveena Vim-u. Naroito korisna za poetnike. Ima mnotvo primera i slika. Vidite http://iccf-holland.org/click5.html Sledea knjiga je starija i vie govori o Vi-u nego o Vim-u, ali je takoe preporuujemo: Learning the Vi Editor - by Linda Lamb Izdava: O'Reilly & Associates Inc. Dobra knjiga iz koje moete saznati skoro sve to moete raditi u Vi-ju. esto izdanje ima i informacija o Vim-u. Ovaj prirunik su napisali: Michael C. Pierce i Robert K. Ware, Colorado School of Mines koristei ideje Charlesa Smitha, Colorado State University. E-mail: bware@mines.colorado.edu. Prilagoavanje za Vim uradio je Bram Moolenaar. Prevod na srpski: Ivan Nejgebauer Verzija 1.0, maj/juni 2014. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim-7.4.1689/runtime/tutor/tutor.sr.utf-8000066400000000000000000001014251267703067000201250ustar00rootroot00000000000000=============================================================================== = D o b r o d o š l i u VIM p r i r u č n i k - Verzija 1.7 = =============================================================================== Vim je moćan editor sa mnogo komandi, suviše da bismo ih ovde sve opisali. Priručnik je zamišljen da opiše dovoljno komandi da biste mogli lagodno da koristite Vim kao editor opšte namene. Približno vreme potrebno za uspešan završetak priručnika je između 25 i 30 minuta, u zavisnosti od vremena potrošenog na vežbu. UPOZORENJE: Komande u lekcijama će menjati tekst. Iskopirajte ovaj fajl i vežbajte na kopiji (ako ste pokrenuli "vimtutor" ovo je već kopija). Važno je upamtiti da je ovaj priručnik zamišljen za aktivnu vežbu. To znači da morate upotrebljavati komande o kojima čitate da biste ih naučili. Ako samo čitate tekst, zaboravićete komande! Ako je Caps Lock uključen ISKLJUČITE ga. Pritisnite taster j dovoljno puta da lekcija 1.1 cela stane na ekran. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1.1: POMERANJE KURSORA ** Za pomeranje kursora, pritiskajte tastere h,j,k,l kako je prikazano ** ^ k Savet: h je s leve strane i pomera kursor u levo. < h l > l je s desne strane i pomera kursor u desno. j j izgleda kao strelica naniže. v 1. Pomerajte kursor po ekranu dok se ne naviknete na komande. 2. Pritisnite taster (j) dok ne počne da se ponavlja. Sada znate kako da dođete do naredne lekcije. 3. Koristeći taster j pređite na lekciju 1.2. NAPOMENA: Ako niste sigurni šta ste zapravo pritisnuli, pritisnite za prelazak u Normal mod i pokušajte ponovo. NAPOMENA: Strelice takođe pomeraju kursor, ali korišćenje tastera hjkl je znatno brže, kad se jednom naviknete na njih. Zaista! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1.2: IZLAZAK IZ VIM-a !! UPOZORENJE: Pre izvođenja bilo kog koraka, pročitajte celu lekciju!! 1. Pritisnite (editor je sada u Normal modu). 2. Otkucajte: :q! . Ovime se izlazi iz editora, sa GUBITKOM svih izmena. 3. Kada se pojavi komandni prompt, unesite komandu koja je pokrenula ovaj priručnik: vimtutor 4. Ako ste upamtili ove korake, izvršite ih redom od 1 do 3 da biste izašli iz editora i ponovo ga pokrenuli. NAPOMENA: :q! poništava sve izmene koje ste napravili. U narednim lekcijama naučićete kako da sačuvate izmene. 5. Pomerite kursor na lekciju 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1.3: IZMENA TEKSTA - BRISANJE ** Pritisnite x za brisanje znaka pod kursorom. ** 1. Pomerite kursor na red označen sa --->. 2. Da biste ispravili greške, pomerajte kursor dok se ne nađe na slovu koje treba izbrisati. 3. Pritisnite taster x da izbrišete neželjeno slovo. 4. Ponavljajte korake od 2 do 4 dok ne ispravite sve greške. ---> RRRibaa riibi grizzze rrreepp. 5. Kad ispravite red, pređite na lekciju 1.4. NAPOMENA: Dok koristite priručnik, nemojte učiti komande napamet, već vežbajte njihovu primenu. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1.4: IZMENA TEKSTA - UBACIVANJE ** Pritisnite i za ubacivanje teksta ispred kursora. ** 1. Pomerite kursor na prvi sledeći red označen sa --->. 2. Da biste tekst prvog reda izjednačili s tekstom drugog, namestite kursor na prvi znak POSLE kog ćete ubaciti potreban tekst. 3. Pritisnite i pa unesite potrebne dopune. 4. Po ispravci svake greške pritisnite da se vratite u Normal mod. Ponovite korake od 2 do 4 da biste ispravili celu rečenicu. ---> Do teka neoje v red. ---> Deo teksta nedostaje iz ovog reda. 5. Pređite na sledeću lekciju. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1.5: IZMENA TEKSTA - DODAVANJE ** Pritisnite A za dodavanje teksta. ** 1. Pomerite kursor na prvi sledeći red označen sa --->. Nije važno gde se nalazi kursor u tom redu. 2. Pritisnite A i unesite dodatni tekst. 3. Pošto ste dodali tekst, pritisnite za povratak u Normal mod. 4. Pomerite kursor na drugi red označen sa ---> i ponavljajte korake 2 i 3 dok ne ispravite tekst. ---> Deo teksta nedostaje u Deo teksta nedostaje u ovom redu. ---> Deo teksta nedostaje Deo teksta nedostaje i ovde. 5. Pređite na lekciju 1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1.6: IZMENA FAJLA ** Upotrebite :wq za snimanje teksta i izlazak iz editora. ** !! UPOZORENJE: Pre izvođenja bilo kog koraka, pročitajte celu lekciju!! 1. Izađite iz editora kao u lekciji 1.2: :q! 2. Na komandnom promptu unesite sledeću komandu: vim tutor 'vim' je komanda za pokretanja Vim editora, 'tutor' je ime fajla koji želite da menjate. Koristite fajl koji imate pravo da menjate. 3. Ubacujte i brišite tekst kao u prethodnim lekcijama. 4. Snimite izmenjeni tekst i izađite iz Vim-a: :wq 5. Ponovo pokrenite vimtutor i pročitajte rezime koji sledi. 6. Pošto pročitate korake iznad i u potpunosti ih razumete: izvršite ih. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ REZIME lekcije 1 1. Kursor se pomera strelicama ili pomoću tastera hjkl . h (levo) j (dole) k (gore) l (desno) 2. Za pokretanje Vim-a iz shell-a: vim IME_FAJLA 3. Izlaz: :q! sve promene su izgubljene. ILI: :wq promene su sačuvane. 4. Brisanje znaka na kome se nalazi kursor: x 5. Ubacivanja ili dodavanje teksta: i unesite tekst unos ispred kursora A unesite tekst dodavanje na kraju reda NAPOMENA: Pritiskom na prebacujete Vim u Normal mod i prekidate neželjenu ili delimično izvršenu komandu. Nastavite sa lekcijom 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 2.1: NAREDBE BRISANJA ** Otkucajte dw za brisanje reči. ** 1. Pritisnite da biste bili sigurni da ste u Normal modu. 2. Pomerite kursor na red označen sa --->. 3. Pomerite kursor na početak reči koju treba izbrisati. 4. Otkucajte dw da biste uklonili reč. NAPOMENA: Slovo d će se pojaviti na dnu ekrana kad ga otkucate. Vim čeka da otkucate w . Ako je prikazano neko drugo slovo, pogrešili ste u kucanju; pritisnite i pokušajte ponovo. (Ako se ne pojavi ništa, možda je isključena opcija 'showcmd': vidi lekciju 6.5.) ---> Neke reči smešno ne pripadaju na papir ovoj rečenici. 5. Ponavljajte korake 3 i 4 dok ne ispravite rečenicu, pa pređite na lekciju 2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 2.2: JOŠ BRISANJA ** Otkucajte d$ za brisanje znakova do kraja reda. ** 1. Pritisnite da biste bili sigurni da ste u Normal modu. 2. Pomerite kursor na red označen sa --->. 3. Pomerite kursor do kraja ispravnog dela rečenice (POSLE prve . ). 4. Otkucajte d$ za brisanje ostatka reda. ---> Neko je uneo kraj ovog reda dvaput. kraj ovog reda dvaput. 5. Pređite na lekciju 2.3 za podrobnije objašnjenje. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 2.3: O OPERATORIMA I POKRETIMA Mnoge komande za izmenu teksta sastoje se od operatora i pokreta. Oblik komande brisanja sa d operatorom je sledeći: d pokret Pri čemu je: d - operator brisanja. pokret - ono na čemu će se operacija izvršavati (opisano u nastavku). Kratak spisak pokreta: w - sve do početka sledeće reči, NE UKLJUČUJUĆI prvo slovo. e - sve do kraja tekuće reči, UKLJUČUJUĆI poslednje slovo. $ - sve do kraje reda, UKLJUČUJUĆI poslednje slovo. Kucanjem de brisaće se tekst od kursora do kraja reči. NAPOMENA: Pritiskom samo na taster pokreta dok ste u Normal modu, bez operatora, kursor se pomera kao što je opisano. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 2.4: KORIŠĆENJE BROJANJA ZA POKRETE ** Unošenjem nekog broja pre pokreta, pokret se izvršava taj broj puta. ** 1. Pomerite kursor na red označen sa --->. 2. Otkucajte 2w da pomerite kursor dve reči napred. 3. Otkucajte 3e da pomerite kursor na kraj treće reči napred. 4. Otkucajte 0 (nulu) da pomerite kursor na početak reda. 5. Ponovite korake 2 i 3 s nekim drugim brojevima. ---> Rečenica sa rečima po kojoj možete pomerati kursor. 6. Pređite na lekciju 2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 2.5: KORIŠĆENJE BROJANJA ZA VEĆE BRISANJE ** Unošenje nekog broja s operatorom ponavlja operator taj broj puta. ** U kombinaciji operatora brisanja s pokretima spomenutim iznad možete uneti broj pre pokreta da biste izbrisali više znakova: d broj pokret 1. Pomerite kursor na prvo slovo u reči s VELIKIM SLOVIMA u redu označenom sa --->. 2. Otkucajte d2w da izbrišete dve reči sa VELIKIM SLOVIMA 3. Ponovite korake 1 i 2 sa različitim brojevima da izbrišete uzastopne reči sa VELIKIM SLOVIMA korišćenjem samo jedne komande. ---> ovaj ABCČĆ DĐE red FGHI JK LMN OP s rečima je RSŠ TUVZŽ ispravljen. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 2.6: OPERACIJE NAD REDOVIMA ** Otkucajte dd za brisanje celog reda. ** Zbog učestalosti brisanja celih redova, autori Vi-ja odlučili su da je lakše brisati redove ako se otkuca d dvaput. 1. Pomerite kursor na drugi red u donjoj strofi. 2. Otkucajte dd da ga izbrišete. 3. Pomerite kursor na četvrti red. 4. Otkucajte 2dd da biste izbrisali dva reda. ---> 1) Sedlo mi je od marame, ---> 2) blato na sve strane, ---> 3) uzda od kanapa, ---> 4) auto mi je ovde, ---> 5) satovi pokazuju vreme, ---> 6) a bič mi je od očina ---> 7) prebijena štapa. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 2.7: PONIŠTAVANJE PROMENA ** Pritisnite u za poništavanje poslednje komande, U za ceo red. ** 1. Pomerite kursor na red označen sa ---> i postavite ga na mesto prve greške. 2. Otkucajte x da izbrišete prvi neželjeni znak. 3. Otkucajte u da poništite poslednju izvršenu komandu. 4. Sad ispravite sve greške u redu koristeći komandu x . 5. Otkucajte veliko U da biste vratili sadržaj reda u prvobitno stanje. 6. Onda otkucajte u nekoliko puta da biste poništili U i prethodne komande. 7. Sad otkucajte CTRL-R (držeći CTRL dok pritiskate R) nekoliko puta da biste vratili izmene (poništili poništavanja). ---> Iiisspravite greške uu ovvom redu ii pooništiteee ih. 8. Ovo su veoma korisne komande. Pređite na rezime lekcije 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ REZIME lekcije 2 1. Brisanje od kursora do sledeće reči: dw 2. Brisanje od kursora do kraja reda: d$ 3. Brisanje celog reda: dd 4. Za ponavljanje pokreta prethodno unesite broj: 2w 5. Oblik komande za izmenu: operator [broj] pokret gde je: operator - šta uraditi, recimo d za brisanje [broj] - neobavezan broj ponavljanja pokreta pokret - kretanje po tekstu na kome se radi, kao što je: w (reč), $ (kraj reda), itd. 6. Pomeranje kursora na početak reda: 0 7. Za poništavanje prethodnih izmena, pritisnite: u (malo u) Za poništavanje svih promena u redu, pritisnite: U (veliko U) Za vraćanja promena, otkucajte: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 3.1: KOMANDA POSTAVLJANJA ** Otkucajte p da postavite prethodno izbrisan tekst iza kursora. ** 1. Pomerite kursor na prvi sledeći red označen sa --->. 2. Otkucajte dd da izbrišete red i smestite ga u Vim registar. 3. Pomerite kursor na red c), IZNAD mesta gde treba postaviti izbrisan red. 4. Otkucajte p da postavite red ispod kursora. 5. Ponavljajte korake 2 do 4 da biste postavili sve linije u pravilnom redosledu. ---> d) prebijena štapa. ---> b) uzda od kanapa, ---> c) a bič mi je od očina ---> a) Sedlo mi je od marame, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 3.2: KOMANDA ZAMENE ** Otkucajte rx da zamenite znak ispod kursora slovom x . ** 1. Pomerite kursor na prvi sledeći red označen sa --->. 2. Pomerite kursor tako da se nalazi na prvoj grešci. 3. Otkucajte r i onda znak koji treba da tu stoji. 4. Ponavljajte korake 2 i 3 sve dok prvi red ne bude isti kao drugi. ---> Kedi ju ovej red ugašen, nako je protresao pustašne testere! ---> Kada je ovaj red unošen, neko je pritiskao pogrešne tastere! 5. Pređite na lekciju 3.2. NAPOMENA: Setite se da treba da učite vežbanjem, ne pamćenjem. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 3.3: OPERATOR IZMENE ** Za izmenu teksta do kraja reči, otkucajte ce .** 1. Pomerite kursor na prvi sledeći red označen sa --->. 2. Postavite kursor na a u rakdur. 3. Otkucajte ce i ispravite reč (u ovom slučaju otkucajte ed ). 4. Pritisnite i pomerite kursor na sledeći znak koji treba ispraviti. 5. Ponavljajte korake 3 i 4 sve dok prva rečenica ne bude ista kao druga. ---> Ovaj rakdur ima nekoliko rejga koje treflja isprpikati operagrom izmene. ---> Ovaj red ima nekoliko reči koje treba ispraviti operatorom izmene. Uočite da ce briše reč i postavlja editor u Insert mod. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 3.4: DALJE IZMENE UPOTREBOM c ** Komanda izmene se koristi sa istim pokretima kao i brisanje. ** 1. Operator izmene se koristi na isti način kao i operator brisanja: c [broj] pokret 2. Pokreti su isti, recimo: w (reč) i $ (kraj reda). 3. Pomerite kursor na prvi sledeći red označen sa --->. 4. Pomerite kursor na prvu grešku. 5. Otkucajte c$ i unesite ostatak reda tako da bude isti kao drugi red, pa pritisnite . ---> Kraj ovog reda treba izmeniti tako da izgleda kao red ispod. ---> Kraj ovog reda treba ispraviti korišćenjem c$ komande. NAPOMENA: Za ispravljanje grešaka možete koristiti Backspace . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ REZIME lekcije 3 1. Za postavljanje teksta koji ste upravo izbrisali, pritisnite p . Ovo postavlja tekst IZA kursora (ako je bio izbrisan jedan ili više redova sadržaj će doći na red ispod kursora). 2. Za zamenu znaka na kome se nalazi kursor, pritisnite r i onda željeni znak. 3. Operator izmene dozvoljava promenu teksta od kursora do pozicije gde se završava pokret. Primera radi, kucajte ce za izmenu od kursora do kraja reči, ili c$ za izmenu od kursora do kraja reda. 4. Oblik operacije izmene je: c [broj] pokret Pređite na narednu lekciju. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 4.1: POZICIJA KURSORA I STATUS FAJLA ** Pritisnite CTRL-G za prikaz pozicije kursora u tekstu i status fajla. Pritisnite G za pomeranje kursora na neki red u tekstu. ** NAPOMENA: Pročitajte celu lekciju pre izvođenja bilo kog koraka!! 1. Držite taster CTRL i pritisnite g . Ovo zovemo CTRL-G. Editor će na dnu ekrana ispisati poruku sa imenom fajla i pozicijom kursora u tekstu. Zapamtite broj reda za 3. korak. NAPOMENA: U donjem desnom uglu može se videti poziciju kursora ako je uključena opcija 'ruler' (vidi :help ruler ili lekciju 6.5.) 2. Pritisnite G za pomeranje kursora na kraj teksta. Pritisnite 1G ili gg za pomranje kursora na početak teksta. 3. Otkucajte broj reda na kome ste malopre bili i onda G . Kursor će se vratiti na red na kome je bio kad ste otkucali CTRL-G. 4. Ako ste spremni, izvršite korake od 1 do 3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 4.2: KOMANDE PRETRAŽIVANJA ** Otkucajte / i onda izraz koji želite da potražite. ** 1. U Normal modu otkucajte znak / . Primietite da se znak pojavio zajedno sa kursorom na dnu ekrana kao i kod komande : . 2. Sada otkucajte 'grrreška' . (Bez razmaka i navodnika.) To je reč koju tražite. 3. Za ponovno traženje istog izraza, otkucajte n . Za traženje istog izraza u suprotnom smeru, otkucajte N . 4. Za traženje izraza unatrag, koristite ? umesto / . 5. Za povratak na prethodnu poziciju otkucajte CTRL-O (držite CTRL dok pritiskate O ). Ponavljajte za ranije pozicije. CTRL-I ide napred. ---> "grrreška" je pogrešno; umesto grrreška treba da stoji greška. NAPOMENA: Ako pretraga dođe do kraja teksta traženje će se nastaviti od njegovog početka osim ako je opcija 'wrapscan' isključena. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 4.3: TRAŽENJE PARA ZAGRADE ** Otkucajte % za nalaženje para ), ] ili } . ** 1. Postavite kursor na bilo koju od ( , [ ili { otvorenih zagrada u redu označenom sa --->. 2. Otkucajte znak % . 3. Kursor će se pomeriti na odgovarajuću zatvorenu zagradu. 4. Otkucajte % da pomerite kursor na prvu zagradu u paru. 5. Pomerite kursor na neku od (,),[,],{ ili } i ponovite komandu % . ---> Red ( testiranja običnih ( [ uglastih ] i { vitičastih } zagrada.)) NAPOMENA: Vrlo korisno u ispravljanju koda sa rasparenim zagradama! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 4.4: KOMANDA ZAMENE ** Otkucajte :s/staro/novo/g da zamenite 'staro' za 'novo'. ** 1. Pomerite kursor na red označen sa --->. 2. Otkucajte :s/rdi/ri/ . Primetite da ova komanda zamenjuje samo prvo "rdi" u redu. 3. Otkucajte :s/rdi/ri/g . Dodavanje opcije g znači da će se komanda izvršiti u celom redu, zamenom svih pojava niza "rdi". ---> rdiba rdibi grdize rep. 4. Za zamenu svih izraza između neka dva reda, otkucajte :#,#s/staro/novo/g gde su #,# krajnji brojevi redova u opsegu u kome će se obaviti zamena. Otkucajte :%s/staro/novo/g za zamenu svih izraza u celom tekstu. Otkucajte :%s/staro/novo/gc za nalaženje svih izraza u tekstu i potvrdu zamene. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ REZIME lekcije 4 1. CTRL-G prikazuje poziciju kursora u tekstu i status fajla. G pomera kursor na kraj teksta. broj G pomera kursor na navedeni red. gg pomera kursor na prvi red teksta. 2. Kucanjem / sa izrazom taj izraz se traži UNAPRED. Kucanjem ? sa izrazom taj izraz se traži UNAZAD. Posle komande traženja koristite n za nalaženje izraza u istom smeru, a N za nalaženje u suprotnom smeru. CTRL-O vraća kursor na prethodnu poziciju, a CTRL-I na narednu. 3. Kucanjem % kad je kursor na zagradi on se pomera na njen par. 4. Za zamenu prvog izraza staro za izraz novo :s/staro/novo/ Za zamenu svih izraza u celom redu :s/staro/novo/g Za zamenu svih izraza u opsegu linija #,# :#,#s/staro/novo/g Za zamenu u celom tekstu :%s/staro/novo/g Za potvrdu svake zamene dodajte 'c' :%s/staro/novo/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 5.1: IZVRŠAVANJE SPOLJAŠNJIH KOMANDI ** Otkucajte :! pa spoljašnju komandu koju želite da izvršite. ** 1. Otkucajte poznatu komandu : da biste namestili kursor na dno ekrana. Time omogućavate unos komande u komandnoj liniji editora. 2. Otkucajte znak ! (uzvičnik). Ovime omogućavate izvršavanje bilo koje spoljašnje komande. 3. Kao primer otkucajte ls posle ! i pritisnite . Ovo će prikazati sadržaj direktorijuma, kao da ste na komandnom promptu. Otkucajte :!dir ako :!ls ne radi. NAPOMENA: Na ovaj način moguće je izvršiti bilo koju spoljašnju komandu, zajedno sa njenim argumentima. NAPOMENA: Sve : komande se izvršavaju pošto pritisnete . U daljem tekstu to nećemo uvek napominjati. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 5.2: VIŠE O SNIMANJU FAJLOVA ** Za snimanje promena, otkucajte :w IME_FAJLA . ** 1. Otkucajte :!dir ili :!ls za pregled sadržaja direktorijuma. Već znate da morate pritisnuti posle toga. 2. Izaberite ime fajla koji još ne postoji, npr. TEST. 3. Otkucajte: :w TEST (gde je TEST ime koje ste izabrali.) 4. Time ćete snimiti ceo fajl (Vim Tutor) pod imenom TEST. Za proveru, otkucajte opet :!dir ili :!ls za pregled sadržaja direktorijuma. NAPOMENA: Ako biste napustili Vim i ponovo ga pokrenuli sa vim TEST , tekst bi bio tačna kopija ovog fajla u trenutku kad ste ga snimili. 5. Izbrišite fajl tako što ćete otkucati (MS-DOS): :!del TEST ili (Unix): :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 5.3: SNIMANJE OZNAČENOG TEKSTA ** Da biste snimili deo teksta, otkucajte v pokret :w IME_FAJLA ** 1. Pomerite kursor na ovu liniju. 2. Pritisnite v i pomerite kursor pet redova ispod. Primetite da je tekst označen inverzno. 3. Pritisnite : . Na dnu ekrana pojaviće se :'<,'> . 4. Otkucajte w TEST , gde je TEST ime fajla koji još ne postoji. Proverite da zaista piše :'<,'>w TEST pre nego što pritisnete . 5. Vim će snimiti označeni tekst u TEST. Proverite sa :!dir ili !ls . Nemojte još brisati fajl! Koristićemo ga u narednoj lekciji. NAPOMENA: Komanda v započinje vizuelno označavanje. Možete pomerati kursor i tako menjati veličinu označenog teksta. Onda možete upotrebiti operatore nad tekstom. Na primer, d će izbrisati označeni tekst. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 5.4: UČITAVANJE FAJLA U TEKST ** Za ubacivanje sadržaja fajla, otkucajte :r IME_FAJLA ** 1. Postavite kursor iznad ove linije. NAPOMENA: Pošto izvršite 2. korak videćete tekst iz lekcije 5.3. Tada pomerite kursor DOLE da biste ponovo videli ovu lekciju. 2. Učitajte fajl TEST koristeći komandu :r TEST gde je TEST ime fajla koje ste koristili u prethodnoj lekciji. Sadržaj učitanog fajla je ubačen ispod kursora. 3. Da biste proverili da je fajl učitan, vratite kursor unazad i primetite dve kopije lekcije 5.3, originalnu i onu iz fajla. NAPOMENA: Takođe možete učitati izlaz spoljašnje komande. Na primer, :r !ls će učitati izlaz komande ls i postaviti ga ispod kursora. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ REZIME lekcije 5 1. :!komanda izvršava spoljašnju komandu. Korisni primeri: (MS-DOS) (Unix) :!dir :!ls - pregled sadržaja direktorijuma. :!del FAJL :!rm FAJL - briše fajl FAJL. 2. :w FAJL zapisuje trenutni tekst na disk pod imenom FAJL. 3. v pokret :w IME_FAJLA snima vizuelno označene redove u fajl IME_FAJLA. 4. :r IME_FAJLA učitava fajl IME_FAJLA sa diska i stavlja njegov sadržaj ispod kursora. 5. :r !dir učitava izlaz komande dir i postavlja ga ispod kursora. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 6.1: KOMANDA OTVORI ** Pritisnite o da biste otvorili red ispod kursora i prešli u Insert mod. ** 1. Pomerite kursor na sledeći red označen sa --->. 2. Otkucajte malo o da biste otvorili novi red ISPOD kursora i prešli u Insert mod. 3. Otkucajte neki tekst i onda pritisnite da biste izašli iz Insert moda. ---> Kad pritisnete o kursor prelazi u novootvoreni red u Insert modu. 4. Za otvaranje reda IZNAD kursora, umesto malog otkucajte veliko O . Isprobajte na donjem redu označenom sa --->. ---> Otvorite red iznad ovog kucanjem velikog O dok je kursor u ovom redu. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 6.2: KOMANDA DODAJ ** Otkucajte a za dodavanje teksta IZA kursora. ** 1. Pomerite kursor na početak sledećeg reda označenog sa --->. 2. Kucajte e dok kursor ne dođe na kraj reči re . 3. Otkucajte a (malo) da biste dodali tekst IZA kursora. 4. Dopunite reč kao što je u redu ispod. Pritisnite za izlazak iz Insert moda. 5. Sa e pređite na narednu nepotpunu reč i ponovite korake 3 i 4. ---> Ovaj re omogućava ve dodav teksta u nekom redu. ---> Ovaj red omogućava vežbanje dodavanja teksta u nekom redu. NAPOMENA: Komande a, i, i A aktiviraju isti Insert mod, jedina razlika je u poziciji od koje će se tekst ubacivati. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 6.3: DRUGI NAČIN ZAMENE ** Otkucajte veliko R da biste zamenili više od jednog znaka. ** 1. Pomerite kursor na prvi sledeći red označen sa --->. Pomerite kursor na početak prvog xxx . 2. Pritisnite R i otkucajte broj koji je red ispod, tako da zameni xxx . 3. Pritisnite za izlazak iz Replace moda. Primetite da je ostatak reda ostao nepromenjen. 4. Ponovite korake da biste zamenili drugo xxx. ---> Dodavanje 123 na xxx daje xxx. ---> Dodavanje 123 na 456 daje 579. NAPOMENA: Replace mod je kao Insert mod, s tom razlikom što svaki uneti znak briše već postojeći. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 6.4: KOPIRANJE I LEPLJENJE TEKSTA ** Koristite operator y za kopiranje a p za lepljenje teksta. ** 1. Pomerite kursor na red sa ---> i postavite kursor posle "a)". 2. Aktivirajte Visual mod sa v i pomerite kursor sve do ispred "prvi". 3. Pritisnite y da biste kopirali označeni tekst u interni bafer. 4. Pomerite kursor do kraja sledećeg reda: j$ 5. Pritisnite p da biste zalepili tekst. Onda otkucajte: a drugi . 6. Upotrebite Visual mod da označite " red.", kopirajte sa y , kursor pomerite na kraj sledećeg reda sa j$ i tamo zalepite tekst sa p . ---> a) ovo je prvi red. b) NAPOMENA: takođe možete koristiti y kao operator; yw kopira jednu reč. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 6.5: POSTAVLJANJE OPCIJA ** Postavite opciju tako da traženje i zamena ignorišu veličinu slova ** 1. Potražite reč 'razlika': /razlika Ponovite nekoliko puta pritiskom na n . 2. Aktivirajte opciju 'ic' (Ignore case): :set ic 3. Ponovo potražite reč 'razlika' pritiskom na n Primetite da su sada pronađeni i RAZLIKA i Razlika. 4. Aktivirajte opcije 'hlsearch' i 'incsearch': :set hls is 5. Ponovo otkucajte komandu traženja i uočite razlike: /razlika 6. Za deaktiviranje opcije ic kucajte: :set noic NAPOMENA: Za neoznačavanje pronađenih izraza otkucajte: :nohlsearch NAPOMENA: Ako želite da ne razlikujete veličinu slova u samo jednoj komandi traženja, dodajte \c u izraz: /razlika\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ REZIME lekcije 6 1. Pritisnite o za otvaranje reda ISPOD kursora i prelazak u Insert mod. Pritisnite O za otvaranje reda IZNAD kursora. 2. Pritisnite a za unos teksta IZA kursora. Pritisnite A za unos teksta na kraju reda. 3. Komanda e pomera kursor na kraj reči. 4. Operator y kopira tekst, p ga lepi. 5. Kucanje velikog R aktivira Replace mod dok ne pritisnete . 6. Kucanje ":set xxx" aktivira opciju "xxx". Neke opcije su: 'ic' 'ignorecase' ne razlikuje velika/mala slova pri traženju 'is' 'incsearch' prikazuje pronađen tekst dok kucate izraz 'hls' 'hlsearch' označava inverzno sve pronađene izraze Možete koristite dugo ili kratko ime opcije. 7. Ispred imena opcije stavite "no" da je deaktivirate: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 7.1: DOBIJANJE POMOĆI ** Koristite on-line sistem za pomoć ** Vim ima detaljan on-line sistem za pomoć. Za početak, pokušajte nešto od sledećeg: - pritisnite taster (ako ga imate na tastaturi) - pritisnite taster (ako ga imate na tastaturi) - otkucajte :help Pročitajte tekst u prozoru pomoći da biste naučili pomoć radi. Kucanjem CTRL-W CTRL-W prelazite iz jednog prozora u drugi. Otkucajte :q da zatvorite prozor pomoći. Pomoć o praktično bilo kojoj temi možete dobiti dodavanjem argumenta komandi ":help". Pokušajte ovo (ne zaboravite na kraju): :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 7.2: PRAVLJENJE STARTNOG SKRIPTA ** Aktivirajte mogućnosti editora ** Vim ima mnogo više mogućnosti nego Vi, ali većina nije automatski aktivirana. Za dodatne mogućnosti napravite "vimrc" fajl. 1. Otvorite "vimrc" fajl. Ovo zavisi od vašeg sistema: :e ~/.vimrc za Unix :e $VIM/_vimrc za MS-Windows 2. Onda učitajte primer sadržaja "vimrc" fajla: :r $VIMRUNTIME/vimrc_example.vim 3. Snimite fajl sa: :w Sledeći put kada pokrenete Vim, bojenje sintakse teksta biće aktivirano. Sva svoja podešavanja možete dodati u "vimrc" fajl. Za više informacija otkucajte :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 7.3: AUTOMATSKO DOVRŠAVANJE ** Dovršavanje komandne linije sa CTRL-D i ** 1. Podesite Vim da ne bude u Vi-kompatibilnom modu: :set nocp 2. Pogledajte koji fajlovi postoje u direktorijumu: :!ls ili :!dir 3. Otkucajte početak komande: :e 4. Otkucajte CTRL-D i Vim će prikazati spisak komandi koje počinju sa "e". 5. Pritisnite i Vim će dopuniti ime komande u ":edit". 6. Dodajte razmak i početak imena postojećeg fajla: :edit FA 7. Pritisnite . Vim će dopuniti ime fajla (ako je jedinstveno). NAPOMENA: Moguće je dopuniti mnoge komande. Samo probajte CTRL-D i . Naročito je korisno za :help komande. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ REZIME lekcije 7 1. Otkucajte :help ili pritisnite ili za pomoć. 2. Otkucajte :help komanda biste dobili pomoć za tu komandu. 3. Otkucajte CTRL-W CTRL-W za prelazak u drugi prozor. 4. Otkucajte :q da zatvorite prozor pomoći. 5. Napravite vimrc startni skript za aktiviranje podešavanja koja vam odgovaraju. 6. Dok kucate neku od : komandi, pritisnite CTRL-D da biste videli moguće vrednosti. Pritisnite da odaberete jednu od njih. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ovim je priručnik završen. Njegov cilj je bio kratak pregled Vim editora, koliko da omogući njegovo relativno jednostavno korišćenje. Priručnik nije potpun, jer Vim ima mnogo više komandi. Kao sledeće, pročitajte priručnik: ":help user-manual". Za dalje čitanje i učenje, preporučujemo knjigu: Vim - Vi Improved - by Steve Oualline Izdavač: New Riders Prva knjiga potpuno posvećena Vim-u. Naročito korisna za početnike. Ima mnoštvo primera i slika. Vidite http://iccf-holland.org/click5.html Sledeća knjiga je starija i više govori o Vi-u nego o Vim-u, ali je takođe preporučujemo: Learning the Vi Editor - by Linda Lamb Izdavač: O'Reilly & Associates Inc. Dobra knjiga iz koje možete saznati skoro sve što možete raditi u Vi-ju. Šesto izdanje ima i informacija o Vim-u. Ovaj priručnik su napisali: Michael C. Pierce i Robert K. Ware, Colorado School of Mines koristeći ideje Charlesa Smitha, Colorado State University. E-mail: bware@mines.colorado.edu. Prilagođavanje za Vim uradio je Bram Moolenaar. Prevod na srpski: Ivan Nejgebauer Verzija 1.0, maj/juni 2014. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim-7.4.1689/runtime/tutor/tutor.sv000066400000000000000000000662261267703067000172000ustar00rootroot00000000000000=============================================================================== = 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 vldigt kraftfull redigerare som har mnga kommandon, alltfr mnga att frklara i en handledning som denna. Den hr handledningen r gjord fr att frklara tillrckligt mnga kommandon s att du enkelt ska kunna anvnda Vim som en redigerare fr alla ndaml. Den berknade tiden fr att slutfra denna handledning r 25-30 minuter, beroende p hur mycket tid som lggs ned p experimentering. Kommandona i lektionerna kommer att modifiera texten. Gr en kopia av den hr filen att va p (om du startade "vimtutor r det hr redan en kopia). Det r viktigt att komma ihg att den hr handledningen r konstruerad att lra vid anvndning. Det betyder att du mste kra kommandona fr att lra dig dem ordentligt. Om du bara lser texten s kommer du att glmma kommandona! Frskra dig nu om att din Caps-Lock tangent INTE r aktiv och tryck p j-tangenten tillrckligt mnga gnger fr att frflytta markren s att Lektion 1.1 fyller skrmen helt. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 1.1: FLYTTA MARKREN ** Fr att flytta markren, tryck p tangenterna h,j,k,l som indikerat. ** ^ k Tips: < h l > h-tangenten r till vnster och flyttar till vnster. j l-tangenten r till hger och flyttar till hger. v j-tangenten ser ut som en pil ned. 1. Flytta runt markren p skrmen tills du knner dig bekvm. 2. Hll ned tangenten pil ned (j) tills att den repeterar. ---> Nu vet du hur du tar dig till nsta lektion. 3. Flytta till Lektion 1.2, med hjlp av ned tangenten. Notera: Om du r osker p ngonting du skrev, tryck fr att placera dig dig i Normal-lge. Skriv sedan om kommandot. Notera: Piltangenterna borde ocks fungera. Men om du anvnder hjkl s kommer du att kunna flytta omkring mycket snabbare, nr du vl vant dig vid det. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 1.2: STARTA OCH AVSLUTA VIM !! NOTERA: Innan du utfr ngon av punkterna nedan, ls hela lektionen!! 1. Tryck -tangenten (fr att se till att du r i Normal-lge). 2. Skriv: :q! . ---> Detta avslutar redigeraren UTAN att spara ngra ndringar du gjort. Om du vill spara ndringarna och avsluta skriv: :wq 3. Nr du ser skal-prompten, skriv kommandot som tog dig in i den hr handledningen. Det kan vara: vimtutor Normalt vill du anvnda: vim tutor ---> 'vim' betyder ppna redigeraren vim, 'tutor' r filen du vill redigera. 4. Om du har memorerat dessa steg och knner dig sjlvsker, kr d stegen 1 till 3 fr att avsluta och starta om redigeraren. Flytta sedan ned markren till Lektion 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 1.3: TEXT REDIGERING - BORTTAGNING ** Nr du r i Normal-lge tryck x fr att ta bort tecknet under markren. ** 1. Flytta markren till raden nedan med markeringen --->. 2. Fr att rtta felen, flytta markren tills den str p tecknet som ska tas bort. fix the errors, move the cursor until it is on top of the 3. Tryck p x-tangenten fr att ta bort det felaktiga tecknet. 4. Upprepa steg 2 till 4 tills meningen r korrekt. ---> Kkon hoppadee vverr mnen. 5. Nu nr raden r korrekt, g till Lektion 1.4. NOTERA: Nr du gr igenom den hr handledningen, frsk inte att memorera, lr genom anvndning. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 1.4: TEXT REDIGERING - INFOGNING ** Nr du r i Normal-lge tryck i fr att infoga text. ** 1. Flytta markren till den frsta raden nedan med markeringen --->. 2. Fr att gra den frsta raden likadan som den andra, flytta markren till det frsta tecknet EFTER dr text ska infogas. 3. Tryck i och skriv in det som saknas. 4. Nr du rttat ett fel tryck fr att terg till Normal-lge. Upprepa steg 2 till 4 fr att rtta meningen. ---> Det sakns hr . ---> Det saknas lite text frn den hr raden. 5. Nr du knner dig bekvm med att infoga text, g till sammanfattningen nedan. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKTION 1 SAMMANFATTNING 1. Markren flyttas genom att anvnda piltangenterna eller hjkl-tangenterna. h (vnster) j (ned) k (upp) l (hger) 2. Fr att starta Vim (frn %-prompten) skriv: vim FILNAMN 3. Fr att avsluta Vim skriv: :q! fr att kasta ndringar. ELLER skriv: :wq fr att spara ndringar. 4. Fr att ta bort tecknet under markren i Normal-lge skriv: x 5. Fr att infoga text vid markren i Normal-lge skriv: i skriv in text NOTERA: Genom att trycka kommer du att placeras i Normal-lge eller avbryta ett delvis frdigskrivet kommando. Fortstt nu med Lektion 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 2.1: BORTTAGNINGSKOMMANDON ** Skriv dw fr att radera till slutet av ett ord. ** 1. Tryck fr att frskra dig om att du r i Normal-lge. 2. Flytta markren till raden nedan markerad --->. 3. Flytta markren till brjan av ett ord som mste raderas. 4. Skriv dw fr att radera ordet. NOTERA: Bokstverna dw kommer att synas p den sista raden p skrmen nr du skriver dem. Om du skrev ngot fel, tryck och brja om. ---> Det r ett ngra ord roliga att som inte hr hemma i den hr meningen. 5. Upprepa stegen 3 och 4 tills meningen r korrekt och g till Lektion 2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 2.2: FLER BORTTAGNINGSKOMMANDON ** Skriv d$ fr att radera till slutet p raden. ** 1. Tryck fr att frskra dig om att du r i Normal-lge. 2. Flytta markren till raden nedan markerad --->. 3. Flytta markren till slutet p den rtta raden (EFTER den frsta . ). 4. Skriv d$ fr att radera till slutet p raden. ---> Ngon skrev slutet p den hr raden tv gnger. den hr raden tv gnger. 5. G vidare till Lektion 2.3 fr att frst vad det r som hnder. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 2.3: KOMMANDON OCH OBJEKT Syntaxen fr d raderingskommandot r fljande: [nummer] d objekt ELLER d [nummer] objekt Var: nummer - r antalet upprepningar av kommandot (valfritt, standard=1). d - r kommandot fr att radera. objekt - r vad kommandot kommer att operera p (listade nedan). En kort lista ver objekt: w - frn markren till slutet av ordet, inklusive blanksteget. e - frn markren till slutet av ordet, EJ inklusive blanksteget. $ - frn markren till slutet p raden. NOTERA: Fr den ventyrslystne, genom att bara trycka p objektet i Normal-lge (utan kommando) s kommer markren att flyttas som angivet i objektlistan. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 2.4: ETT UNDANTAG TILL 'KOMMANDO-OBJEKT' ** Skriv dd fr 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 gnger i rad fr att ta bort en rad. 1. Flytta markren till den andra raden i frasen nedan. 2. Skriv dd fr att radera raden. 3. Flytta nu till den fjrde raden. 4. Skriv 2dd (kom ihg: nummer-kommando-objekt) fr 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 fr att ngra det senaste kommandona, U fr att fixa en hel rad. ** 1. Flytta markren till slutet av raden nedan markerad ---> och placera den p det frsta felet. 2. Skriv x fr att radera den frsta felaktiga tecknet. 3. Skriv nu u fr att ngra det senaste krda kommandot. 4. Rtta den hr gngen alla felen p raden med x-kommandot. 5. Skriv nu U fr att terstlla raden till dess ursprungliga utseende. 6. Skriv nu u ngra gnger fr att ngra U och tidigare kommandon. 7. Tryck nu CTRL-R (hll inne CTRL samtidigt som du trycker R) ngra gnger fr att upprepa kommandona (ngra ngringarna). ---> Fiixa felen pp deen hr meningen och terskapa dem med ngra. 8. Det hr r vldigt anvndbara kommandon. G nu vidare till Lektion 2 Sammanfattning. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKTION 2 SAMMANFATTNING 1. Fr att radera frn markren till slutet av ett ord skriv: dw 2. Fr att radera frn markren till slutet av en rad skriv: d$ 3. Fr att radera en hel rad skriv: dd 4. Syntaxen fr ett kommando i Normal-lge r: [nummer] kommando objekt ELLER kommando [nummer] objekt dr: nummer - r hur mnga gnger kommandot kommandot ska repeteras kommando - r vad som ska gras, t.ex. d fr att radera objekt - r vad kommandot ska operera p, som t.ex. w (ord), $ (till slutet av raden), etc. 5. Fr att ngra tidigare kommandon, skriv: u (litet u) Fr att ngra alla tidigare ndringar p en rad skriv: U (stort U) Fr att ngra ngringar tryck: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 3.1: KLISTRA IN-KOMMANDOT ** Skriv p fr att klistra in den senaste raderingen efter markren. ** 1. Flytta markren till den frsta raden i listan nedan. 2. Skriv dd fr att radera raden och lagra den i Vims buffert. 3. Flytta markren till raden OVANFR dr den raderade raden borde vara. 4. Nr du r i Normal-lge, skriv p fr att byta ut raden. 5. Repetera stegen 2 till 4 fr att klistra in alla rader i rtt ordning. d) Kan du lra dig ocks? b) Violetter r bl, c) Intelligens fs genom lrdom, a) Rosor r rda, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 3.2: ERSTT-KOMMANDOT ** Skriv r och ett tecken fr att erstta tecknet under markren. ** 1. Flytta markren till den frsta raden nedan markerad --->. 2. Flytta markren s att den str p det frsta felet. 3. Skriv r och sedan det tecken som borde erstta felet. 4. Repetera steg 2 och 3 tills den frsta raden r korrekt. ---> Nr drn hr ruden skrevs, trickte ngon p fil knappar! ---> Nr den hr raden skrevs, tryckte ngon p fel knappar! 5. G nu vidare till Lektion 3.2. NOTERA: Kom ihg att du skall lra dig genom anvndning, inte genom memorering. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 3.3: NDRA-KOMMANDOT ** Fr att ndra en del eller ett helt ord, skriv cw . ** 1. Flytta markren till den frsta redan nedan markerad --->. 2. Placera markren p d i rdrtn. 3. Skriv cw och det rtta ordet (i det hr fallet, skriv "aden".) 4. Tryck och flytta markren till nsta fel (det frsta tecknet som ska ndras.) 5. Repetera steg 3 och 4 tills den frsta raden r likadan som den andra. ---> Den hr rdrtn har ngra otf som brhotrt ndras mrf ndra-komjendit. ---> Den hr raden har ngra ord som behver ndras med ndra-kommandot. Notera att cw inte bara ndrar ordet, utan ven placerar dig i infogningslge. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 3.4: FLER NDRINGAR MED c ** ndra-kommandot anvnds p samma objekt som radera. ** 1. ndra-kommandot fungerar p samma stt 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 frsta raden nedan markerad -->. 4. Flytta markren till det frsta felet. 5. Skriv c$ fr att gra resten av raden likadan som den andra och tryck . ---> Slutet p den hr raden behver hjlp med att f den att likna den andra. ---> Slutet p den hr raden behver rttas till med c$-kommandot. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKTION 3 SAMMANFATTNING 1. Fr att erstta text som redan har blivit raderad, skriv p . Detta klistrar in den raderade texten EFTER markren (om en rad raderades kommer den att hamna p raden under markren. 2. Fr att erstta tecknet under markren, skriv r och sedan tecknet som kommer att erstta orginalet. 3. ndra-kommandot lter dig ndra det angivna objektet frn markren till slutet p objektet. eg. Skriv cw fr att ndra frn markren till slutet p ordet, c$ fr att ndra till slutet p en rad. 4. Syntaxen fr ndra-kommandot r: [nummer] c objekt ELLER c [nummer] objekt G nu till nsta lektion. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 4.1: POSITION OCH FILSTATUS ** Tryck CTRL-g fr att visa din position i filen och filstatusen. Tryck SHIFT-G fr att flytta till en rad i filen. ** Notera: Lsa hela den lektion innan du utfr ngot av stegen!! 1. Hll ned Ctrl-tangenten och tryck g . En statusrad med filnamn och raden du befinner dig p kommer att synas. Kom ihg radnummret till Steg 3. 2. Tryck shift-G fr att flytta markren 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 nr du frst tryckte Ctrl-g. (Nr du skriver in nummren, kommer de INTE att visas p skrmen.) 4. Om du knner dig sker p det hr, utfr steg 1 till 3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 4.2: SK-KOMMANDOT ** Skriv / fljt av en fras fr att ska efter frasen. ** 1. I Normal-lge skriv /-tecknet. Notera att det och markren blir synlig lngst ned p skrmen precis som med :-kommandot. 2. Skriv nu "feeel" . Det hr r ordet du vill ska efter. 3. Fr att ska efter samma fras igen, tryck helt enkelt n . Fr att ska efter samma fras igen i motsatt riktning, tryck Shift-N . 4. Om du vill ska efter en fras bakt i filen, anvnd kommandot ? istllet fr /. ---> "feeel" r inte rtt stt att stava fel: feeel r ett fel. Notera: Nr skningen nr slutet p filen kommer den att fortstta vid brjan. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 4.3: SKNING EFTER MATCHANDE PARENTESER ** Skriv % fr att hitta en matchande ),], or } . ** 1. Placera markren p ngon av (, [, or { p raden nedan markerad --->. 2. Skriv nu %-tecknet. 3. Markren borde vara p den matchande parentesen eller hakparentesen. 4. Skriv % fr att flytta markren tillbaka till den frsta hakparentesen (med matchning). ---> Det ( hr r en testrad med (, [ ] och { } i den. )) Notera: Det hr r vldigt anvndbart vid avlusning av ett program med icke matchande parenteser! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 4.4: ETT STT ATT NDRA FEL ** Skriv :s/gammalt/nytt/g fr att erstta "gammalt" med "nytt". ** 1. Flytta markren till raden nedan markerad --->. 2. Skriv :s/denn/den . Notera att det hr kommandot bara ndrar den frsta frekomsten p raden. 3. Skriv nu :s/denn/den/g vilket betyder erstt globalt p raden. Det ndrar alla frekomster p raden. ---> denn bsta tiden att se blommor blomma r denn p vren. 4. Fr att ndra alla frekomster av en teckenstrng mellan tv rader, skriv :#,#s/gammalt/nytt/g dr #,# r de tv radernas radnummer. Skriv :%s/gammtl/nytt/g fr att ndra varje frekomst 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 fljt Shift-G flyttar till det radnummret. 2. Skriver man / fljt av en fras sks det FRAMMT efter frasen. Skriver man ? fljt av en fras sks det BAKT efter frasen. Efter en skning skriv n fr att hitta nsta frekomst i samma riktning eller Shift-N fr att ska i den motsatta riktningen. 3. Skriver man % nr markren r p ett (,),[,],{, eller } hittas dess matchande par. 4. Fr att erstta den frsta gammalt med nytt p en rad skriv :s/gammlt/nytt Fr att erstta alla gammlt med nytt p en rad skriv :s/gammlt/nytt/g Fr att erstta fraser mellan rad # och rad # skriv :#,#s/gammlt/nytt/g Fr att erstta alla frekomster i filen skriv :%s/gammlt/nytt/g Fr att bekrfta varje gng lgg till "c" :%s/gammlt/nytt/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 5.1: HUR MAN KR ETT EXTERNT KOMMANDO ** Skriv :! fljt av ett externt kommando fr att kra det kommandot. ** 1. Skriv det vlbekanta kommandot : fr att placera markren lngst ned p skrmen p skrmen. Detta lter dig skriva in ett kommando. 2. Skriv nu ! (utropstecken). Detta lter dig kra ett godtyckligt externt skalkommando. 3. Som ett exempel skriv ls efter ! och tryck sedan . Detta kommer att visa dig en listning av din katalog, precis som om du krt det vid skalprompten. Anvnd :!dir om ls inte fungerar. Notera: Det r mjligt att kra vilket externt kommando som helst p det hr sttet. Notera: Alla :-kommandon mste avslutas med att trycka p ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 5.2: MER OM ATT SPARA FILER ** Fr att spara ndringar gjorda i en fil, skriv :w FILNAMN. ** 1. Skriv :!dir eller :!ls fr att f en listning av din katalog. Du vet redan att du mste trycka efter det hr. 2. Vlj ett filnamn som inte redan existerar, som t.ex. TEST. 3. Skriv nu: :w TEST (dr TEST r filnamnet du valt.) 4. Det hr sparar hela filen (Vim handledningen) under namnet TEST. Fr att verifiera detta, skriv :!dir igen fr 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 nr 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 ** Fr att spara en del av en fil, skriv :#,# w FILNAMN ** 1. nnu en gng, skriv :!dir eller :!ls fr att f en listning av din katalog och vlj ett passande filnamn som t.ex. TEST. 2. Flytta markren hgst upp p den hr sidan och tryck Ctrl-g fr att f reda p radnumret p den raden. KOM IHG DET NUMMRET! 3. Flytta nu lngst ned p sidan och skriv Ctrl-g igen. KOM IHG DET RADNUMMRET OCKS! 4. Fr att BARA spara en sektion till en fil, skriv :#,# w TEST dr #,# r de tv nummren du kom ihg (toppen, botten) och TEST r ditt filnamn. 5. nnu en gng, kolla s att filen r dr med :!dir men radera den INTE. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 5.4: TA EMOT OCH FRENA FILER ** Fr att infoga innehllet av en fil, skriv :r FILNAMN ** 1. Skriv :!dir fr att frskra dig om att TEST-filen frn tidigare fortfarande r kvar. 2. Placera markren hgst upp p den hr sidan. NOTERA: Efter att du krt Steg 3 kommer du att se Lektion 5.3. Flytta d NED till den hr lektionen igen. 3. Ta nu emot din TEST-fil med kommandot :r TEST dr TEST r namnet p filen. NOTERA: Filen du tar emot placeras dr markren r placerad. 4. Fr 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 kr ett externt kommando. Ngra anvndbara 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 markren. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 6.1: PPNA-KOMMANDOT ** Skriv o fr att ppna en rad under markren och placera dig i Infoga-lge. ** 1. Flytta markren till raden nedan markerad --->. 2. Skriv o (litet o) fr att ppna upp en rad NEDANFR markren och placera dig i Infoga-mode. 3. Kopiera nu raden markerad ---> och tryck fr att avsluta Infoga-lget. ---> Efter du skrivit o placerad markren p en ppen rad i Infoga-lge. 4. Fr att ppna upp en rad OVANFR markren, skriv ett stort O , istllet fr ett litet o. Prva detta p raden nedan. ppna upp en rad ovanfr denna genom att trycka Shift-O nr markren str hr. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 6.2: LGG TILL-KOMMANDOT ** Skriv a fr att infoga text EFTER markren. ** 1. Flytta markren till slutet av den frsta raden nedan markerad ---> genom att skriv $ i Normal-lge. 2. Skriv ett a (litet a) fr att lgga till text EFTER tecknet under markren. (Stort A lgger till i slutet av raden.) Notera: Detta undviker att behva skriva i , det sista tecknet, texten att infoga, , hgerpil, och slutligen, x, bara fr att lgga till i slutet p en rad! 3. Gr nu frdigt den frsta raden. Notera ocks att lgga till r likadant som Infoga-lge, enda skillnaden r positionen dr texten blir infogad. ---> Hr kan du trna ---> Hr kan du trna p att lgga till text i slutet p en rad. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 6.3: EN ANNAN VERSION AV ERSTT ** Skriv ett stort R fr att erstta fler n ett tecken. ** 1. Flytta markren till den frsta raden nedan markerad --->. 2. Placera markren vid brjan av det frsta ordet som r annorlunda jmfrt med den andra raden markerad ---> (ordet "sista"). 3. Skriv nu R och erstt resten av texten p den frsta raden genom att skriva ver den gamla texten s att den frsta raden blir likadan som den andra. ---> Fr att f den frsta raden lika som den sista, anvnd tangenterna. ---> Fr att f den frsta raden lika som den andra, skriv R och den nya texten. 4. Notera att nr du trycker fr att avsluta, s blir eventuell ofrndrad text kvar. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 6.4: STT FLAGGOR ** Stt en flagga s att en skning eller ersttning ignorerar storlek ** 1. Sk efter "ignore" genom att skriva: /ignore Repetera flera gnger genom att trycka p n-tangenten 2. Stt 'ic' (Ignore Case) flaggan genom att skriva: :set ic 3. Sk nu efter "ignore" igen genom att trycka: n Repeat search several more times by hitting the n key 4. Stt 'hlsearch' and 'incsearch' flaggorna: :set hls is 5. Skriv nu in sk-kommandot igen, och se vad som hnder: /ignore 6. Fr att ta bort framhvningen av trffar, skriv :nohlsearch ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKTION 6 SAMMANFATTNING 1. Genom att skriva o pnnas en rad NEDANFR markren och markren placeras p den ppna raden i Infoga-lge. Genom att skriva ett stort O ppnas raden OVANFR raden som markren r p. 2. Skriv ett a fr att infoga text EFTER tecknet som markren str p. Genom att skriva ett stort A lggs text automatiskt till i slutet p raden. 3. Genom att skriva ett stort R hamnar du i Erstt-lge till trycks fr att avsluta. 4. Genom att skriva ":set xxx" stts flaggan "xxx" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKTION 7: ON-LINE HJLP-KOMMANDON ** Anvnd on-line hjlpsystemet ** Vim har ett omfattande on-line hjlpsystem. Fr att komma igng prva ett av dessa tre: - tryck tangenten (om du har ngon) - tryck tangenten (om du har ngon) - skriv :help Skriv :q fr att strnga hjlpfnstret. Du kan hitta hjlp om nstan allting, genom att ge ett argument till ":help" kommandot. Prva dessa (glm inte att trycka ): :help w :help c_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim-7.4.1689/runtime/tutor/tutor.sv.utf-8000066400000000000000000000700341267703067000201320ustar00rootroot00000000000000=============================================================================== = 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ånger för att förflytta markören så att Lektion 1.1 fyller 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 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 -tangenten (för att se till att du är i Normal-läge). 2. Skriv: :q! . ---> Detta avslutar redigeraren UTAN att spara några ändringar du gjort. Om du vill spara ändringarna och avsluta skriv: :wq 3. När du ser skal-prompten, skriv kommandot som tog dig in i den här handledningen. Det kan vara: vimtutor Normalt vill du använda: vim tutor ---> '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 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 3. För att avsluta Vim skriv: :q! för att kasta ändringar. ELLER skriv: :wq 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 NOTERA: Genom att trycka 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 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 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 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 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 . ---> 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" . 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 . 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 . 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å ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 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 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, , 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 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 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 tangenten (om du har någon) - tryck tangenten (om du har någon) - skriv :help Skriv :q 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 ): :help w :help c_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim-7.4.1689/runtime/tutor/tutor.tr.iso9000066400000000000000000000670321267703067000200530ustar00rootroot00000000000000=============================================================================== = V I M T u t o r'a Ho Geldiniz - Srm 1.5 = =============================================================================== Vim, bu gibi bir eitmen ile aklanmas gereken ok fazla komut barndran, olduka kuvvetli bir metin dzenleyicidir. Bu eitmen Vim'i ok amal bir dzenleyici olarak kolaylkla kullanabileceiniz yeterli sayda komutu aklamak iin tasarlanmtr. Eitmeni tamamlama sresi yapacanz denemelere bal olarak 25-30 dakikadr. Derslerdeki komutlar bu metini deitirecektir. zerinde almak iin bu dosyann bir kopyasn aln (eer "vimtutor" uygulamasn altrdysanz zaten bir kopyasn alm oldunuz). Bu eitmenin, kullanarak retmeye ayarlandn unutmamak nemlidir. Bu u anlama gelir; komutlar renmek iin doru bir ekilde altrmanz gerekir. Eer sadece yazlanlar okursanz komutlar unutursunuz. imdi Shift-Lock tularnzn basl olmadna emin olun ve Ders 1.1'in ekran tamamen doldurmas iin j tuuna yeterli miktarda basn. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 1.1: MLEC HAREKET ETTRMEK .N: Tm derslerde grdnz yerde bu tua basmanz gerekir. ** mleci hareket ettirmek iin, h,j,k,l tularna gsterildii gibi basn. ** ^ k pucu: h tuu soldadr ve sola hareket eder. < h l > l tuu sadadr ve saa hareket eder. j j tuu aa ynl bir ok gibidir. v 1. Yeterli hissedinceye kadar imleci ekranda hareket ettirin. 2. Aa tuunu (j) tekrar edene kadar basl tutun. ---> imdi, bir sonraki derse nasl geeceinizi biliyorsunuz. 3. Aa tuunu kullanarak, Ders 1.2'ye gein. Not: Eer yazdnz bir eyden emin deilseniz, Normal kipe gemek iin tuuna basn. Daha sonra istediiniz komutu yeniden yazn. Not: mle tular da ayn zamanda ie yararlar ancak hjkl tularn kullanmaya altnzda etrafta daha hzl hareket edersiniz. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 1.2: VIM'E GR VE VIM'DEN IKI !! NOT: Aadaki admlar yapmadan nce, bu dersi tamamen okuyun. 1. tuuna basn (Normal kipte olmay garantilemek iin). 2. Yazn: :q! . ---> Bu dzenleyicinin yaptnz deiiklikleri KAYDETMEDEN kapanmasn salar. Eer yaptklarnzn kaydedilmesini istiyorsanz unu yazn: :wq 3. Kabuk istemcisini (shell prompt) grdnzde, sizi bu eitmene getiren komutu yazn. Bu: vimtutor komutudur. Normalde: vim tutor komutu kullanlr. ---> 'vim' vim dzenleyicisine gir anlamna gelir, 'tutor' ise amak istediiniz dosyadr. 4. Eer bu admlar ezberlediyseniz ve kendinizden eminseniz, 1'den 3'e kadar olan admlar, dzenleyiciden kmak ve yeniden girmek iin uygulayn. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 1.3: METN DZENLEME - SLME ** Normal kipteyken imlecin altndaki karakteri silmek iin x 'e basn.** 1. mleci aada iaretlenmi (-->) satra gtrn. 2. Hatalar dzeltmek iin, imleci silinmesi gereken karakterin zerine getirin 3. stenmeyen karakteri silmek iin x tuuna basn. 4. Cmle dzelene kadar 2'den 4'e kadar olan admlar tekrar edin. ---> inek ayyn zzerinden attlad. 5. imdi satr dzeldi, Ders 1.4'e gein. NOT: Bu eitmende ilerledike ezberlemeye almayn, kullanarak renin. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 1.4: METN DZENLEME - EKLEME ** Normal kipteyken metin eklemek iin i 'ye basn. ** 1. mleci aadaki iaretlenmi (-->) ilk satra gtrn. 2. lk satr ikincisinin ayns gibi yapmak iin, imleci eklenmesi gereken metinden sonraki ilk karakterin zerine gtrn. 3. i 'ye basn ve gerekli eklemeleri yapn. 4. Her hata dzeltildiinde tuuna basarak Normal kipe dnn. Cmleyi dzeltmek iin 2'den 4'e kadar olan admlar tekrar edin. ---> Bu metinde eksk. ---> Bu metinde birey eksik. 5. Metin ekleme almalarn yeterli gryorsanz aadaki zete gein. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DERS 1 ZET 1. mle hem ok tular hem de hjkl tular ile hareket ettirilir. h (sol) j (aa) k (yukar) l (sa) 2. (Konsoldan) Vim'e girmek in yazn: vim DOSYASM 3. Tm deiiklikleri gz ard edip vimden kmak iin yazn: :q! veya tm deiiklikleri kaydetmek iin yazn: :wq 4. mlecin altndaki bir karakteri silmek iin Normal kipte x yazn. 5. mlecin altnda metin eklemek iin Normal kipte yazn: i yazlacak metin NOT: tuuna basmak sizi Normal kipe gtrr ya da istenmeyen tamamlanmam bir komutu iptal eder. imdi Ders 2 ile devam edin. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 2.1: SLME KOMUTLARI ** Bir kelimeyi silmek iin dw yazn.** 1. Normal kipte olmakten emin olmak iin tuuna basn. 2. mleci aadaki iaretlenmi (-->) satra gtrn. 3. mleci silinmesi gereken kelimenin bana gtrn. 4. Kelimeyi silmek iin dw yazn. NOT: dw harfleri siz yazdka ekrann son satrnda grlecektir. Eer yanl bir eyler yazarsanz, yeniden balamak iin tuuna basn. ---> Bu satrda erez cmleye ait olmayan leblebi kelimeler var. 5. Cmle dzelene kadar adm 3 ve 4' tekrar edin, daha sonra Ders 2.2'ye gidin. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 2.2: DAHA FAZLA SLME KOMUTU ** Satr sonuna kadar silmek iin d$ yazn.** 1. Normal kipte olmaktan emin olmak iin tuuna basn. 2. mleci aadaki iaretlenmi (-->) satra gtrn. 3. mleci doru olan satrn sonuna gtrn. (Birinciden SONRA. ) 4. Satr sonuna kadar silmek iin d$ yazn. ( d$ yazarken d'den sonra ile beraber $ tuuna basn) ---> Birileri bu satrn sonunu iki defa yazm. Birileri bu satrn sonunu iki defa yazm. 5. Neler olduunu anlamak iin Ders 2.3'e gidin. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 2.3: KOMUTLAR VE NESNELER d silme komutu iin biim aadaki gibidir: [say] d nesne VEYA d [say] nesne Burada: say - komutun ka defa altrlaca (istee bal, varsaylan=1). d - silme komutu nesne - komutun ne ekilde alaca (aada listlendi). Nesnelerin ksa bir listesi. w - Boluu da iererek, imleten itibaren kelimenin sonuna kadar. e - Boluu ERMEDEN, imleten itibaren kelimenin sonuna kadar. $ - imleten satrn sonuna kadar. NOT: Serven sevenler iin, Normal kipte iken, komut olmadan sadece nesnenin kendisine basmak imleci yukardaki listede olduu gibi hareket ettirecektir. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 2.4: 'KOMUT-NESNE'ye BR STSNA ** Btn bir satr silmek iin dd yazn. ** Btn bir satr silme sklndan dolay, Vi tasarmclar bir satr tamamen silmek iin iki d yazmann daha kolay olacana karar verdiler. 1. mleci aadaki tmceciin ikinci satrna gtrn. 2. Satr silmek iin dd yazn. 3. imdi de drdnc satra gidin. 4. ki satr birden silmek iin 2dd (say-komut-nesne'yi hatrlayn) yazn. 1) Gller krmzdr, 2) amur elenceli, 3) Menekeler mavi, 4) Bir arabam var, 5) Saat bana syler, 6) eker tatldr 7) Ve sen de ylesin ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 2.5: GER AL KOMUTU ** Son komutu geri almak iin u , btn bir satr dzeltmek iin U yazn.** 1. mleci aadaki iaretlenmi (-->) satrdaki ilk hatann zerine gtrn. 2. lk istenmeyen karakteri silmek iin x yazn. 3. imdi son altrlan komutu geri almak iin u yazn. 4. Bu sefer x komutunu kullanarak satrdaki tm hatalar dzeltin. 5. imdi satr ilk haline evirmek iin byk U yazn. 6. imdi U ve daha nceki komutlar geri almak iin birka defa u yazn. 7. imdi birka defa CTRL-R (CTRL'yi basl tutarken R ye basn) yazarak geri almalar da geri aln. ---> Buu satrdaki hatalar dzeltinn ve sonra koomutu geri allln. 8. Bunlar son derece kullanl komutlardr. imdi Ders 2 zete gein. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DERS 2 ZET 1. mleten itibaren bir kelimeyi silmek iin yazn: dw 2. mleten itibaren bir satr silmek iin yazn: d$ 3. Btn bir satr silmek iin yazn: dd 4. Normal kipte bir komut biimi yledir: [say] komut nesne VEYA komut [say] nesne burada: say - komutun ka kere tekrar edecei komut - ne yaplaca, silmek iin d olduu gibi nesne - komutun nasl davranaca, w (kelime), $ (satr sonu), vb gibi. 5. nceki hareketleri geri almak iin yazn: u (kk u) Bir satrdaki tm deiiklikleri geri almak iin yazn: U (byk u) Geri almalar geri almak iin yazn: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 3.1: KOY KOMUTU ** Son yaptnz silme ilemini imleten sona geri yerletirmek iin p yazn.** 1. mleci aadaki tmceciin ilk satrna gtrn. 2. Satr silip Vim'in tamponuna yerletirmek iin dd yazn. 3. mleci, silinmi satr nereye yerletirmek istiyorsanz, o satrn ZERNE gtrn. 4. Normal kipteyken, satr yerletirmek iin p yazn. 5. Tm satrlar doru sraya koymak iin 2'den 4'e kadar olan admlar tekrar edin. d) Sen de rendin mi? b) Menekeler mavidir, c) Akl renilir, a) Gller krmzdr, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 3.2: YERLETR KOMUTU ** mlecin altnda bir karakter yerletirmek iin r yazn.** 1. mleci aadaki iaretlenmi(--->) ilk satra gtrn. 2. mleci satrdaki ilk hatann zerine gtrn. 3. Hatay dzeltmek iin nce r ardndan da doru karakteri yazn. 4. lk satr dzelene kadar adm 2 ve 3' tekrar edin. ---> Bu satv yazlvken, bivileri yaml tutara basm. ---> Bu satr yazlrken, birileri yanl tulara basm. 5. Ders 3.2'ye gein. NOT: Unutmayn, ezberleyerek deil kullanarak renin. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 3.3: DETR KOMUTU ** Bir kelimenin tamamn veya parasn deitirmek iin cw yazn. 1. mleci aadaki iaretlenmi(--->) satra gtrn. 2. mleci "sutar" daki u'nun zerine yerletirin. 3. nce cw ardndan doru kelimeyi girin (bu durumda 'atr'.) 4. tuuna basn ve bir sonraki hataya gidin (deimesi gereken ilk karakter.) 5. lk cmle ikincisiyle ayn olana kadar adm 3 ve 4' tekrar edin. ---> Bu sutar deitir komutu ile deineli gereken birka petime ieriyor. ---> Bu satr deitir komutu ile deimesi gereken birka kelime ieriyor. cw'nin sadece kelimeyi deitirmediini, ayn zamanda sizi insert kipine gtrdne de dikkat edin. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 3.4: c'Y KULLANARAK DAHA FAZLA DETRME ** Deitir komutu sil komutu ile ayn nesnelerle kullanlr.** 1. Deitir komutu sil ile ayn yolla alr. Biim yledir: [say] c nesne VEYA c [say] nesne 2. Nesneler de ayn zamanda ayndr. rnein w (word), $ (satr sonu), vb. gibi. 3. Aadaki iaretlenmi(--->) ilk satra gidin. 4. mleci ilk hataya gtrn. 5. Satrn geri kalan ksmn ikincisi gibi yapmak iin c$ yazn ve daha sonra tuuna basn. ---> Bu satrn sonu dzeltilmek iin biraz yardma ihtiya duyuyor. ---> Bu satrn sonu dzeltilmek iin c$ komutu kullanlarak yardma ihtiya duyuyor. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DERS 3 ZET 1. Silinmi olan bir metini geri yerletirmek iin p yazn. Bu silinmi metini imleten hemen SONRA geri yerletirir (eer bir satr silinmise hemen imleten sonra, alta yerletirilecektir) 2. mlecin altndaki karakteri deitirmek iin nce r ardndan da asl karakteri yazn. 3. Deitir komutu belirlenen nesneyi, imleten nesnenin sonuna kadar deitirme imkan verir. rnein, bir kelimeyi imleten sonuna kadar deitirmek iin cw , bir satrn tamamn deitirmek iinse c$ yazn. 4. Deitir iin biim yledir: [say] c nesne VEYA c [say] nesne imdi bir sonraki derse gein. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 4.1: KONUM VE DOSYA DURUMU ** Dosya ierisindeki konumunuzu ve dosyann durumunu grmek iin CTRL-g yazn. ** ** Dosya ierisindeki bir satra gitmek iin SHIFT-g yazn. ** Not: Admlardan herhangi birini yapmadan nce dersin tamamn okuyun!! 1. Ctrl tuunu basl tutun ve g'ye basn. Dosyann sonunda dosya ismini ve bulunduunuz konumu gsteren bir durum satr grnecektir. Adm 3 iin satr numarasn unutmayn. 2. Dosyann sonuna gitmek iin shift-G 'ye basn. 3. Daha nce bulunduunuz satr numarasn yazn ve daha sonra shift-G 'ye basn. Bu sizi daha nce bulunduunuz ve Ctrl-g 'ye bastnz satra geri gtrecektir. (Saylar yazlrken ekranda GRNMEYECEKLERDR.) 4. Yapabileceinizi dndnzde, adm 1'den 3'e kadar yapn. .N: Bu ksm orijinal metinde de biraz eksik anlatlm gibi. Bir satr hakknda bilgi almak iin Ctrl-g'yi kullann. Herhangi bir satra gitmek iinse, nce satr numarasn yazn ve ardnan shift-g'ye basn. Satr numaras girmeden baslan shift-g sizi satr sonuna gtrr. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 4.2: ARAMA KOMUTU ** Bir kelime beini aramak iin / ile beraber kelime beini girin. ** 1. Normal kipteyken / karakterini yazn. Komut blm yerine / karakterinin ve imlecin ekrann sonunda grndne dikkat edin. 2. imdi, 'hatttaa' yazp 'a basn. Bu sizin aramak istediiniz kelime. 3. Ayn kelime beini tekrar aramak iin, basite n yazn. Ayn kelime beini zt ynde aramak iin, Shift-N yazn. 4. Eer zt yne doru bir arama yapmak istiyorsanz, / komutu yerine ? komutunu kullann. ---> "hatttaa" hatay yazmann doru yolu deil; hatttaa bir hata. Not: Arama dosyann sonuna ulatnda, tekrar batan balayacaktr. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 4.3: UYAN PARANTEZ ARAMASI ** Uyan bir ),] veya } bulmak iin % yazn. ** 1. mleci iaretli (--->) satrdaki herhangi bir (, [ veya { karakterinin zerine gtrn. 2. imdi % karakterini yazn. 3. mle uyan parantez veya ayracn zerine gider. 4. Uyan ilk parantezin zerine geri dnmek iin yine % yazn. ---> Bu ( ierisinde ('ler, ['ler ] ve {'ler } bulunan bir satrdr. )) Not: Bu ierisinde uymayan parantezler bulunan bir programn yanln ayklamak iin son derece yararldr. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 4.4: HATALARI DZELTMEK N BR YOL ** 'eski' yerine 'yeni' yerletirmek iin :s/eski/yeni/g yazn. ** 1. mleci aadaki iaretli (--->) satra gtrn. 2. :s/buu/bu yazp 'a basn. Bu komutun sadece satrdaki ilk karlamay dzelttiine dikkat edin. 3. imdi genel olarak satrdaki tm deiiklii yapmak iin :s/buu/bu/g yazn. ---> Buu birinci, buu ikinci, buu nc blm. 4. ki satr arasndaki bir karakter katarnn tmn deitirmek iin, :#,#s/eski/yeni/g yazn, burada #,# iki satrn saylardr. Tm dosyadaki karlalan kelimeleri deitirmek iin :%s/eski/yeni/g yazn. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DERS 4 ZET 1. Ctrl-g sizin dosyadaki konumunuzu ve dosya durumunu gsterir. Shift-G dosyann sonuna gider. Shift-G 'den nce bir say yazlrsa, o satra gidilir. 2. Bir szck beinden nce / yazmak, LER ynde o bei aratr. Bir szck beinden nce ? yazmak, GER ynde o bei aratr. Bir aramadan sonra, ayn yndeki bir sonraki karlamay bulmak iin n , veya zt yndekini bulmak iin Shift-N yazn. 3. mle bir (,),[,],{,} parantezi zerindeyken % yazmak, uyan dier e parantezi bulur. 4. Bir satrdaki ilk 'eski'yi 'yeni' ile deitirmek iin :s/eski/yeni yazn. Bir satrdaki tm 'eski'leri 'yeni' ile deitirmek iin :s/eski/yeni/g yazn. ki satr arasndaki bekleri deitirmek iin :#,#s/eski/yeni/g yazn. (#'lar satr numaralar) Bir dosyadaki tm karlamalar deitirmek iin :%s/eski/yeni/g yazn. Her seferinde onay sormas iin 'c' ekleyin. :%s/eski/yeni/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 5.1: BIR DI KOMUT ALITIRMAK ** Bir d komutu altrmak iin :! ve ardndan istediiniz d komutu yazn. ** 1. mleci ekrann altna gtrmek iin alk olduunuz : komutunu yazn. Bu size bir komut yazma imkan verir. 2. imdi ! (nlem) karakterini yazn. Bu size bir d komut altrma imkan verir. 3. rnek olarak ! karakterini takiben ls yazn ve 'a basn. Bu size o anda bulunduunuz dizindeki dosyalar gsterecektir. Veya ls almazsa :!dir komutunu kullann. Not: Herhangi bir d komutu bu yolla altrmak mmkndr. Not: Tm : komutlarndan sonra tuuna baslmaldr. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 5.2: DOSYA YAZMAYA DEVAM ** Dosyaya yaplan deiiklii kaydetmek iin, :w DOSYASM yazn. ** 1. Bulunduunuz dizini listelemek iin :!dir veya :!ls yazn. Komuttan sonra tuuna bascanz zaten biliyorsunuz. 2. Mevcut olmayan bir dosya ismi sein, rnein DENEME. 3. imdi :w DENEME yazn (DENEME sizin setiiniz dosya ismi). 4. Bu tm dosyay (Vim Tutor) DENEME isminde baka bir dosyaya yazar. Bunu dorulamak iin, :!dir yazn ve yeniden bulunduunuz dizini listeleyin. Not: Eer Vim'den kp kaydettiiniz DENEME dosyasn aarsanz, bunun kaydettiiniz vimtutor'un gerek bir kopyas olduunu grrsnz. 5. imdi dosyay u komutlar vererek silin (MS-DOS) :!del DENEME (veya UNIX) :!rm DENEME ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 5.3: SEMEL YAZ KOMUTU ** Dosyann bir blmn kaydetmek iin, :#,# w DOSYASM yazn. ** 1. Bir kez daha bulunduunuz dizini grmek iin :!dir veya :!ls yazn, ardndan DENEME gibi uygun bir dosya ismi sein. 2. mleci bu sayfann bana gtrn ve ardndan CTRL-g'ye basarak satr numarasn renin. BU NUMARAYI UNUTMAYIN! 3. imdi sayfann sonuna gidib ve yine CTRL-g'ye basarak satr numarasn renin. BU NUMARAYI DA UNUTMAYIN! 4. Bir dosyaya sadece bir blm kaydetmek iin, :#,# w DENEME yazn. #,# sizin baktnz saylar (st,alt) ve DENEME dosyanzn ismidir. 5. Yine, :!dir yazarak dosyann orada olduuna bakn ama SLMEYN. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 5.4: DOSYALARI BRLETRMEK-BLM EKLEMEK ** Bir dosyann ieriini eklemek iin :r DOSYASM yazn. ** 1. DENEME dosyanzn nceden bulunduundan emin olmak iin :!dir yazn. 2. mleci bu sayfann bana yerletirin. NOT: Adm 3' uyguladktan sonra Ders 5.3' gryor olacaksnz. Daha sonra bu derse sayfasna dnn. 3. imdi DENEME sayfasn :r DENEME yazarak aktarn. NOT: Aktardnz dosya imlecinizin hemen altna eklenecektir. 4. Dosyann eklendiini grmek iin, geriye gidin. Ders 5.3'ten iki kopya olduunu greceksiniz; asl ve kopya olan. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DERS 5 ZET 1. :!komut bir d komut altrr. Baz yararl rnekler: (MS-DOS) (Unix) :!dir :!ls - bir dizini listeler. :!del DOSYA :!rm DOSYA - DOSYA'y siler. 2. :w DOSYASM o anki Vim dosyasn diske DOSYASM ile kaydeder. 3. :#,#w DOSYASM # ile # satr arasn DOSYASM ile kaydeder. 4. :r DOSYASM imlecin altndan balayarak DOSYASM isimli dosyann ieriini ekler. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 6.1: A KOMUTU ** mlecin aasna bir satr amak ve Insert kipine gemek iin o yazn. ** 1. mleci aadaki iaretlenmi (--->) satra gtrn. 2. mlecin aasna bir satr amak ve Insert kipine gemek iin o (kk harfle) yazn. 3. imdi iaretlenmi satr kopyalayn ve Insert kipinden kmak iin tuuna basn. ---> o yazdktan sonra imlec alan satra gidicek ve Insert kipine geilecek. 4. mlecin zerinde bir satr amak iin, basite byk O yazn. Bunu aadaki satrda deneyin. Bu satrn zerine bir satr amak iin imle bu satrdayken Shift-o yazn. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 6.2: EKLE KOMUTU ** mleten sonra metin eklemek iin a yazn. ** 1. mleci aadaki iaretlenmi (--->) satrn sonuna gtrmek iin Normal Kipteyken $ yazn. 2. mlecin altndaki karakterden sonra metin eklemek iin a (kk harfle) yazn. (Byk A satrn sonuna ekler). 3. imdi ilk satr tamamlayn. Ekle komutunun Insert kipiyle ayn ii yaptna dikkat edin. Tek fark metinin eklendii yer. .N: Eer a yazarsanz imlecin altndaki karakterden hemen sonra ekleme yapabilirsiniz. Eer Shift-a yazarsanz imle satr sonuna gidecek ve hemen ardna ekleme yapabileceksiniz. Doal olarak bizim rneimizde Shift-A'y kullanmak daha gzel olacaktr. nce $ ardnan a yazmamza gerek kalmaz. ---> Bu satrda alabilirsiniz ---> Bu satrda alabilirsiniz. alrken metin eklemeyi kullann. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 6.3: BR BAKA DETR KOMUTU ** Birden fazla karakter deitirmek iin byk R yazn. ** 1. mleci aadaki iaretli (--->) satrlarn ilkine gtrn. 2. mleci iaretli olan ikinci satrdakinden farkl olan ilk kelimenin bana gtrn. ( "tular" kelimesi ) 3. imdi byk R yazn ve ilk satr ikincisinin ayns yapmak iin eski metinin zerinden yenisini yazn. Siz yazdka metin deiecektir. ---> Bu satr ikincisinin ayns yapmak iin tular kullann. ---> Bu satr ikincisinin ayns yapmak iin R yazn ve metini girin. 4. kmak iin tuuna bastnzda, deimemi metinin aynen kaldna dikkat edin. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 6.4: SET SEENE ** Bir seenek ayarlayn , bylece bir arama veya deitirme ** ** durumu grmezden gelsin. ** 1. 'ignore' kelimesini aramak iin: /ignore yazn. Bunu n tuuna basarak birka kez tekrar edin 2. :set ic yazarak 'ic' (Ignore case) ayarn sein. 3. Tekrar n tuuna basarak 'ignore' kelimseini arayn. n tuuna basarak bu aramay birden ok defa tekrar edin. 4. :set hls is yazarak 'hlsearch' ve 'incsearch' ayarlarn sein. 5. /ignore yazarak arama komutunu tekrar verin ve ne olacan grn. 6. Karlama vurgularn iptal etmek iin, :nohlsearch yazn. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DERS 6 ZET 1. o yazmak imlecin altnda bir satr aar ve imleci bu alm satra Insert kipinde yerletirir. Byk O yazmak imlecin zerinde bir satr aar. 2. mlecin zerindeki karakterden hemen sonra metin eklemek iin a yazn. Byk A yazmak hemen satr sonuna giderek metin eklemeye hazr hale getirir. 3. Byk R yazmak Deitir kipine girer ve kmak iin tuuna baslana kadar sizi bu kipte brakr. 4. ":set xxx" yazmak "xxx" seeneini ayarlar. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 7: EVRM (ON-LINE) YARDIM KOMUTLARI ** evirimii yardm sistemini kullann ** Vim geni bir evirimii yardm sistemine sahiptir. Balamak iin u n deneyebilirsiniz. - (eer sahipseniz) tuuna basn - (eer sahipseniz) tuuna basn - :help yazn ve tuuna basn Yardm penceresini kapatmak iin :q yazp tuuna basn. ":help" komutuna deiken (argman) vererek herhangi bir konu hakknda yardm alabilirsini. unlar deneyin ( tuuna basmay unutmayn) : :help w :help c_ gördüğünüz yerde bu tuşa basmanız gerekir. ** İmleci hareket ettirmek için, h,j,k,l tuşlarına gösterildiği gibi basın. ** ^ k İpucu: h tuşu soldadır ve sola hareket eder. < h l > l tuşu sağdadır ve sağa hareket eder. j j tuşu aşağı yönlü bir ok gibidir. v 1. Yeterli hissedinceye kadar imleci ekranda hareket ettirin. 2. Aşağı tuşunu (j) tekrar edene kadar basılı tutun. ---> Şimdi, bir sonraki derse nasıl geçeceğinizi biliyorsunuz. 3. Aşağı tuşunu kullanarak, Ders 1.2'ye geçin. Not: Eğer yazdığınız bir şeyden emin değilseniz, Normal kipe geçmek için tuşuna basın. Daha sonra istediğiniz komutu yeniden yazın. Not: İmleç tuşları da aynı zamanda işe yararlar ancak hjkl tuşlarını kullanmaya alıştığınızda etrafta daha hızlı hareket edersiniz. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 1.2: VIM'E GİRİŞ VE VIM'DEN ÇIKIŞ !! NOT: Aşağıdaki adımları yapmadan önce, bu dersi tamamen okuyun. 1. tuşuna basın (Normal kipte olmayı garantilemek için). 2. Yazın: :q! . ---> Bu düzenleyicinin yaptığınız değişiklikleri KAYDETMEDEN kapanmasını sağlar. Eğer yaptıklarınızın kaydedilmesini istiyorsanız şunu yazın: :wq 3. Kabuk istemcisini (shell prompt) gördüğünüzde, sizi bu eğitmene getiren komutu yazın. Bu: vimtutor komutudur. Normalde: vim tutor komutu kullanılır. ---> 'vim' vim düzenleyicisine gir anlamına gelir, 'tutor' ise açmak istediğiniz dosyadır. 4. Eğer bu adımları ezberlediyseniz ve kendinizden eminseniz, 1'den 3'e kadar olan adımları, düzenleyiciden çıkmak ve yeniden girmek için uygulayın. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 1.3: METİN DÜZENLEME - SİLME ** Normal kipteyken imlecin altındaki karakteri silmek için x 'e basın.** 1. İmleci aşağıda işaretlenmiş (-->) satıra götürün. 2. Hataları düzeltmek için, imleci silinmesi gereken karakterin üzerine getirin 3. İstenmeyen karakteri silmek için x tuşuna basın. 4. Cümle düzelene kadar 2'den 4'e kadar olan adımları tekrar edin. ---> İinek ayyın üzzerinden attladı. 5. Şimdi satır düzeldi, Ders 1.4'e geçin. NOT: Bu eğitmende ilerledikçe ezberlemeye çalışmayın, kullanarak öğrenin. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 1.4: METİN DÜZENLEME - EKLEME ** Normal kipteyken metin eklemek için i 'ye basın. ** 1. İmleci aşağıdaki işaretlenmiş (-->) ilk satıra götürün. 2. İlk satırı ikincisinin aynısı gibi yapmak için, imleci eklenmesi gereken metinden sonraki ilk karakterin üzerine götürün. 3. i 'ye basın ve gerekli eklemeleri yapın. 4. Her hata düzeltildiğinde tuşuna basarak Normal kipe dönün. Cümleyi düzeltmek için 2'den 4'e kadar olan adımları tekrar edin. ---> Bu metinde eksk. ---> Bu metinde birşey eksik. 5. Metin ekleme çalışmalarını yeterli görüyorsanız aşağıdaki özete geçin. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DERS 1 ÖZET 1. İmleç hem ok tuşları hem de hjkl tuşları ile hareket ettirilir. h (sol) j (aşağı) k (yukarı) l (sağ) 2. (Konsoldan) Vim'e girmek içn yazın: vim DOSYAİSMİ 3. Tüm değişiklikleri göz ardı edip vimden çıkmak için yazın: :q! veya tüm değişiklikleri kaydetmek için yazın: :wq 4. İmlecin altındaki bir karakteri silmek için Normal kipte x yazın. 5. İmlecin altında metin eklemek için Normal kipte yazın: i yazılacak metin NOT: tuşuna basmak sizi Normal kipe götürür ya da istenmeyen tamamlanmamış bir komutu iptal eder. Şimdi Ders 2 ile devam edin. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 2.1: SİLME KOMUTLARI ** Bir kelimeyi silmek için dw yazın.** 1. Normal kipte olmakten emin olmak için tuşuna basın. 2. İmleci aşağıdaki işaretlenmiş (-->) satıra götürün. 3. İmleci silinmesi gereken kelimenin başına götürün. 4. Kelimeyi silmek için dw yazın. NOT: dw harfleri siz yazdıkça ekranın son satırında görülecektir. Eğer yanlış bir şeyler yazarsanız, yeniden başlamak için tuşuna basın. ---> Bu satırda çerez cümleye ait olmayan leblebi kelimeler var. 5. Cümle düzelene kadar adım 3 ve 4'ü tekrar edin, daha sonra Ders 2.2'ye gidin. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 2.2: DAHA FAZLA SİLME KOMUTU ** Satırı sonuna kadar silmek için d$ yazın.** 1. Normal kipte olmaktan emin olmak için tuşuna basın. 2. İmleci aşağıdaki işaretlenmiş (-->) satıra götürün. 3. İmleci doğru olan satırın sonuna götürün. (Birinciden SONRA. ) 4. Satırı sonuna kadar silmek için d$ yazın. ( d$ yazarken d'den sonra ile beraber $ tuşuna basın) ---> Birileri bu satırın sonunu iki defa yazmış. Birileri bu satırın sonunu iki defa yazmış. 5. Neler olduğunu anlamak için Ders 2.3'e gidin. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 2.3: KOMUTLAR VE NESNELER d silme komutu için biçim aşağıdaki gibidir: [sayı] d nesne VEYA d [sayı] nesne Burada: sayı - komutun kaç defa çalıştırlacağı (isteğe bağlı, varsayılan=1). d - silme komutu nesne - komutun ne şekilde çalışacağı (aşağıda listlendi). Nesnelerin kısa bir listesi. w - Boşluğu da içererek, imleçten itibaren kelimenin sonuna kadar. e - Boşluğu İÇERMEDEN, imleçten itibaren kelimenin sonuna kadar. $ - imleçten satırın sonuna kadar. NOT: Serüven sevenler için, Normal kipte iken, komut olmadan sadece nesnenin kendisine basmak imleci yukardaki listede olduğu gibi hareket ettirecektir. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 2.4: 'KOMUT-NESNE'ye BİR İSTİSNA ** Bütün bir satırı silmek için dd yazın. ** Bütün bir satır silme sıklığından dolayı, Vi tasarımcıları bir satırı tamamen silmek için iki d yazmanın daha kolay olacağına karar verdiler. 1. İmleci aşağıdaki tümceciğin ikinci satırına götürün. 2. Satırı silmek için dd yazın. 3. Şimdi de dördüncü satıra gidin. 4. İki satırı birden silmek için 2dd (sayı-komut-nesne'yi hatırlayın) yazın. 1) Güller kırmızıdır, 2) Çamur eğlenceli, 3) Menekşeler mavi, 4) Bir arabam var, 5) Saat bana söyler, 6) Şeker tatlıdır 7) Ve sen de öylesin ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 2.5: GERİ AL KOMUTU ** Son komutu geri almak için u , bütün bir satırı düzeltmek için U yazın.** 1. İmleci aşağıdaki işaretlenmiş (-->) satırdaki ilk hatanın üzerine götürün. 2. İlk istenmeyen karakteri silmek için x yazın. 3. Şimdi son çalıştırılan komutu geri almak için u yazın. 4. Bu sefer x komutunu kullanarak satırdaki tüm hataları düzeltin. 5. Şimdi satırı ilk haline çevirmek için büyük U yazın. 6. Şimdi U ve daha önceki komutları geri almak için birkaç defa u yazın. 7. Şimdi birkaç defa CTRL-R (CTRL'yi basılı tutarken R ye basın) yazarak geri almaları da geri alın. ---> Buu satıırdaki hataları düüzeltinn ve sonra koomutu geri alllın. 8. Bunlar son derece kullanışlı komutlardır. Şimdi Ders 2 Özete geçin. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DERS 2 ÖZET 1. İmleçten itibaren bir kelimeyi silmek için yazın: dw 2. İmleçten itibaren bir satırı silmek için yazın: d$ 3. Bütün bir satırı silmek için yazın: dd 4. Normal kipte bir komut biçimi şöyledir: [sayı] komut nesne VEYA komut [sayı] nesne burada: sayı - komutun kaç kere tekrar edeceği komut - ne yapılacağı, silmek için d olduğu gibi nesne - komutun nasıl davranacağı, w (kelime), $ (satır sonu), vb gibi. 5. Önceki hareketleri geri almak için yazın: u (küçük u) Bir satırdaki tüm değişiklikleri geri almak için yazın: U (büyük u) Geri almaları geri almak için yazın: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 3.1: KOY KOMUTU ** Son yaptığınız silme işlemini imleçten sona geri yerleştirmek için p yazın.** 1. İmleci aşağıdaki tümceciğin ilk satırına götürün. 2. Satırı silip Vim'in tamponuna yerleştirmek için dd yazın. 3. İmleci, silinmiş satırı nereye yerleştirmek istiyorsanız, o satırın ÜZERİNE götürün. 4. Normal kipteyken, satırı yerleştirmek için p yazın. 5. Tüm satırları doğru sıraya koymak için 2'den 4'e kadar olan adımları tekrar edin. d) Sen de öğrendin mi? b) Menekşeler mavidir, c) Akıl öğrenilir, a) Güller kırmızıdır, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 3.2: YERLEŞTİR KOMUTU ** İmlecin altında bir karakter yerleştirmek için r yazın.** 1. İmleci aşağıdaki işaretlenmiş(--->) ilk satıra götürün. 2. İmleci satırdaki ilk hatanın üzerine götürün. 3. Hatayı düzeltmek için önce r ardından da doğru karakteri yazın. 4. İlk satır düzelene kadar adım 2 ve 3'ü tekrar edin. ---> Bu satıv yazılıvken, bivileri yamlış tuştara basmış. ---> Bu satır yazılırken, birileri yanlış tuşlara basmış. 5. Ders 3.2'ye geçin. NOT: Unutmayın, ezberleyerek değil kullanarak öğrenin. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 3.3: DEĞİŞTİR KOMUTU ** Bir kelimenin tamamını veya parçasını değiştirmek için cw yazın. 1. İmleci aşağıdaki işaretlenmiş(--->) satıra götürün. 2. İmleci "sutar" daki u'nun üzerine yerleştirin. 3. Önce cw ardından doğru kelimeyi girin (bu durumda 'atır'.) 4. tuşuna basın ve bir sonraki hataya gidin (değişmesi gereken ilk karakter.) 5. İlk cümle ikincisiyle aynı olana kadar adım 3 ve 4'ü tekrar edin. ---> Bu sutar değiştir komutu ile değişneli gereken birkaç petime içeriyor. ---> Bu satır değiştir komutu ile değişmesi gereken birkaç kelime içeriyor. cw'nin sadece kelimeyi değiştirmediğini, aynı zamanda sizi insert kipine götürdüğüne de dikkat edin. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 3.4: c'Yİ KULLANARAK DAHA FAZLA DEĞİŞTİRME ** Değiştir komutu sil komutu ile aynı nesnelerle kullanılır.** 1. Değiştir komutu sil ile aynı yolla çalışır. Biçim şöyledir: [sayı] c nesne VEYA c [sayı] nesne 2. Nesneler de aynı zamanda aynıdır. Örneğin w (word), $ (satır sonu), vb. gibi. 3. Aşağıdaki işaretlenmiş(--->) ilk satıra gidin. 4. İmleci ilk hataya götürün. 5. Satırın geri kalan kısmını ikincisi gibi yapmak için c$ yazın ve daha sonra tuşuna basın. ---> Bu satırın sonu düzeltilmek için biraz yardıma ihtiyaç duyuyor. ---> Bu satırın sonu düzeltilmek için c$ komutu kullanılarak yardıma ihtiyaç duyuyor. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DERS 3 ÖZET 1. Silinmiş olan bir metini geri yerleştirmek için p yazın. Bu silinmiş metini imleçten hemen SONRA geri yerleştirir (eğer bir satır silinmişse hemen imleçten sonra, alta yerleştirilecektir) 2. İmlecin altındaki karakteri değiştirmek için önce r ardından da asıl karakteri yazın. 3. Değiştir komutu belirlenen nesneyi, imleçten nesnenin sonuna kadar değiştirme imkanı verir. Örneğin, bir kelimeyi imleçten sonuna kadar değiştirmek için cw , bir satırın tamamını değiştirmek içinse c$ yazın. 4. Değiştir için biçim şöyledir: [sayı] c nesne VEYA c [sayı] nesne Şimdi bir sonraki derse geçin. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 4.1: KONUM VE DOSYA DURUMU ** Dosya içerisindeki konumunuzu ve dosyanın durumunu görmek için CTRL-g yazın. ** ** Dosya içerisindeki bir satıra gitmek için SHIFT-g yazın. ** Not: Adımlardan herhangi birini yapmadan önce dersin tamamını okuyun!! 1. Ctrl tuşunu basılı tutun ve g'ye basın. Dosyanın sonunda dosya ismini ve bulunduğunuz konumu gösteren bir durum satırı görünecektir. Adım 3 için satır numarasını unutmayın. 2. Dosyanın sonuna gitmek için shift-G 'ye basın. 3. Daha önce bulunduğunuz satır numarasını yazın ve daha sonra shift-G 'ye basın. Bu sizi daha önce bulunduğunuz ve Ctrl-g 'ye bastığınız satıra geri götürecektir. (Sayılar yazılırken ekranda GÖRÜNMEYECEKLERDİR.) 4. Yapabileceğinizi düşündüğünüzde, adım 1'den 3'e kadar yapın. Ç.N: Bu kısım orijinal metinde de biraz eksik anlatılmış gibi. Bir satır hakkında bilgi almak için Ctrl-g'yi kullanın. Herhangi bir satıra gitmek içinse, önce satır numarasını yazın ve ardınan shift-g'ye basın. Satır numarası girmeden basılan shift-g sizi satır sonuna götürür. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 4.2: ARAMA KOMUTU ** Bir kelime öbeğini aramak için / ile beraber kelime öbeğini girin. ** 1. Normal kipteyken / karakterini yazın. Komut bölümü yerine / karakterinin ve imlecin ekranın sonunda göründüğüne dikkat edin. 2. Şimdi, 'hatttaa' yazıp 'a basın. Bu sizin aramak istediğiniz kelime. 3. Aynı kelime öbeğini tekrar aramak için, basitçe n yazın. Aynı kelime öbeğini zıt yönde aramak için, Shift-N yazın. 4. Eğer zıt yöne doğru bir arama yapmak istiyorsanız, / komutu yerine ? komutunu kullanın. ---> "hatttaa" hatayı yazmanın doğru yolu değil; hatttaa bir hata. Not: Arama dosyanın sonuna ulaştığında, tekrar baştan başlayacaktır. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 4.3: UYAN PARANTEZ ARAMASI ** Uyan bir ),] veya } bulmak için % yazın. ** 1. İmleci işaretli (--->) satırdaki herhangi bir (, [ veya { karakterinin üzerine götürün. 2. Şimdi % karakterini yazın. 3. İmleç uyan parantez veya ayracın üzerine gider. 4. Uyan ilk parantezin üzerine geri dönmek için yine % yazın. ---> Bu ( içerisinde ('ler, ['ler ] ve {'ler } bulunan bir satırdır. )) Not: Bu içerisinde uymayan parantezler bulunan bir programın yanlışını ayıklamak için son derece yararlıdır. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 4.4: HATALARI DÜZELTMEK İÇİN BİR YOL ** 'eski' yerine 'yeni' yerleştirmek için :s/eski/yeni/g yazın. ** 1. İmleci aşağıdaki işaretli (--->) satıra götürün. 2. :s/buu/bu yazıp 'a basın. Bu komutun sadece satırdaki ilk karşılaşmayı düzelttiğine dikkat edin. 3. Şimdi genel olarak satırdaki tüm değişikliği yapmak için :s/buu/bu/g yazın. ---> Buu birinci, buu ikinci, buu üçüncü bölüm. 4. İki satır arasındaki bir karakter katarının tümünü değiştirmek için, :#,#s/eski/yeni/g yazın, burada #,# iki satırın sayılarıdır. Tüm dosyadaki karşılaşılan kelimeleri değiştirmek için :%s/eski/yeni/g yazın. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DERS 4 ÖZET 1. Ctrl-g sizin dosyadaki konumunuzu ve dosya durumunu gösterir. Shift-G dosyanın sonuna gider. Shift-G 'den önce bir sayı yazılırsa, o satıra gidilir. 2. Bir sözcük öbeğinden önce / yazmak, İLERİ yönde o öbeği aratır. Bir sözcük öbeğinden önce ? yazmak, GERİ yönde o öbeği aratır. Bir aramadan sonra, aynı yöndeki bir sonraki karşılaşmayı bulmak için n , veya zıt yöndekini bulmak için Shift-N yazın. 3. İmleç bir (,),[,],{,} parantezi üzerindeyken % yazmak, uyan diğer eş parantezi bulur. 4. Bir satırdaki ilk 'eski'yi 'yeni' ile değiştirmek için :s/eski/yeni yazın. Bir satırdaki tüm 'eski'leri 'yeni' ile değiştirmek için :s/eski/yeni/g yazın. İki satır arasındaki öbekleri değiştirmek için :#,#s/eski/yeni/g yazın. (#'lar satır numaraları) Bir dosyadaki tüm karşılaşmaları değiştirmek için :%s/eski/yeni/g yazın. Her seferinde onay sorması için 'c' ekleyin. :%s/eski/yeni/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 5.1: BIR DIŞ KOMUT ÇALIŞTIRMAK ** Bir dış komutu çalıştırmak için :! ve ardından istediğiniz dış komutu yazın. ** 1. İmleci ekranın altına götürmek için alışık olduğunuz : komutunu yazın. Bu size bir komut yazma imkanı verir. 2. Şimdi ! (ünlem) karakterini yazın. Bu size bir dış komut çalıştırma imkanı verir. 3. Örnek olarak ! karakterini takiben ls yazın ve 'a basın. Bu size o anda bulunduğunuz dizindeki dosyaları gösterecektir. Veya ls çalışmazsa :!dir komutunu kullanın. Not: Herhangi bir dış komutu bu yolla çalıştırmak mümkündür. Not: Tüm : komutlarından sonra tuşuna basılmalıdır. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 5.2: DOSYA YAZMAYA DEVAM ** Dosyaya yapılan değişikliği kaydetmek için, :w DOSYAİSMİ yazın. ** 1. Bulunduğunuz dizini listelemek için :!dir veya :!ls yazın. Komuttan sonra tuşuna basıcağınızı zaten biliyorsunuz. 2. Mevcut olmayan bir dosya ismi seçin, örneğin DENEME. 3. Şimdi :w DENEME yazın (DENEME sizin seçtiğiniz dosya ismi). 4. Bu tüm dosyayı (Vim Tutor) DENEME isminde başka bir dosyaya yazar. Bunu doğrulamak için, :!dir yazın ve yeniden bulunduğunuz dizini listeleyin. Not: Eğer Vim'den çıkıp kaydettiğiniz DENEME dosyasını açarsanız, bunun kaydettiğiniz vimtutor'un gerçek bir kopyası olduğunu görürsünüz. 5. Şimdi dosyayı şu komutları vererek silin (MS-DOS) :!del DENEME (veya UNIX) :!rm DENEME ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 5.3: SEÇMELİ YAZ KOMUTU ** Dosyanın bir bölümünü kaydetmek için, :#,# w DOSYAİSMİ yazın. ** 1. Bir kez daha bulunduğunuz dizini görmek için :!dir veya :!ls yazın, ardından DENEME gibi uygun bir dosya ismi seçin. 2. İmleci bu sayfanın başına götürün ve ardından CTRL-g'ye basarak satır numarasını öğrenin. BU NUMARAYI UNUTMAYIN! 3. Şimdi sayfanın sonuna gidib ve yine CTRL-g'ye basarak satır numarasını öğrenin. BU NUMARAYI DA UNUTMAYIN! 4. Bir dosyaya sadece bir bölümü kaydetmek için, :#,# w DENEME yazın. #,# sizin baktığınız sayılar (üst,alt) ve DENEME dosyanızın ismidir. 5. Yine, :!dir yazarak dosyanın orada olduğuna bakın ama SİLMEYİN. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 5.4: DOSYALARI BİRLEŞTİRMEK-BÖLÜM EKLEMEK ** Bir dosyanın içeriğini eklemek için :r DOSYAİSMİ yazın. ** 1. DENEME dosyanızın önceden bulunduğundan emin olmak için :!dir yazın. 2. İmleci bu sayfanın başına yerleştirin. NOT: Adım 3'ü uyguladıktan sonra Ders 5.3'ü görüyor olacaksınız. Daha sonra bu derse sayfasına dönün. 3. Şimdi DENEME sayfasını :r DENEME yazarak aktarın. NOT: Aktardığınız dosya imlecinizin hemen altına eklenecektir. 4. Dosyanın eklendiğini görmek için, geriye gidin. Ders 5.3'ten iki kopya olduğunu göreceksiniz; asıl ve kopya olanı. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DERS 5 ÖZET 1. :!komut bir dış komut çalıştırır. Bazı yararlı örnekler: (MS-DOS) (Unix) :!dir :!ls - bir dizini listeler. :!del DOSYA :!rm DOSYA - DOSYA'yı siler. 2. :w DOSYAİSMİ o anki Vim dosyasını diske DOSYAİSMİ ile kaydeder. 3. :#,#w DOSYAİSMİ # ile # satır arasını DOSYAİSMİ ile kaydeder. 4. :r DOSYAİSMİ imlecin altından başlayarak DOSYAİSMİ isimli dosyanın içeriğini ekler. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 6.1: AÇ KOMUTU ** İmlecin aşağısına bir satır açmak ve Insert kipine geçmek için o yazın. ** 1. İmleci aşağıdaki işaretlenmiş (--->) satıra götürün. 2. İmlecin aşağısına bir satır açmak ve Insert kipine geçmek için o (küçük harfle) yazın. 3. Şimdi işaretlenmiş satırı kopyalayın ve Insert kipinden çıkmak için tuşuna basın. ---> o yazdıktan sonra imlec açılan satıra gidicek ve Insert kipine geçilecek. 4. İmlecin üzerinde bir satır açmak için, basitçe büyük O yazın. Bunu aşağıdaki satırda deneyin. Bu satırın üzerine bir satır açmak için imleç bu satırdayken Shift-o yazın. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 6.2: EKLE KOMUTU ** İmleçten sonra metin eklemek için a yazın. ** 1. İmleci aşağıdaki işaretlenmiş (--->) satırın sonuna götürmek için Normal Kipteyken $ yazın. 2. İmlecin altındaki karakterden sonra metin eklemek için a (küçük harfle) yazın. (Büyük A satırın sonuna ekler). 3. Şimdi ilk satırı tamamlayın. Ekle komutunun Insert kipiyle aynı işi yaptığına dikkat edin. Tek fark metinin eklendiği yer. Ç.N: Eğer a yazarsanız imlecin altındaki karakterden hemen sonra ekleme yapabilirsiniz. Eğer Shift-a yazarsanız imleç satır sonuna gidecek ve hemen ardına ekleme yapabileceksiniz. Doğal olarak bizim örneğimizde Shift-A'yı kullanmak daha güzel olacaktır. Önce $ ardınan a yazmamıza gerek kalmaz. ---> Bu satırda çalışabilirsiniz ---> Bu satırda çalışabilirsiniz. Çalışırken metin eklemeyi kullanın. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 6.3: BİR BAŞKA DEĞİŞTİR KOMUTU ** Birden fazla karakter değiştirmek için büyük R yazın. ** 1. İmleci aşağıdaki işaretli (--->) satırların ilkine götürün. 2. İmleci işaretli olan ikinci satırdakinden farklı olan ilk kelimenin başına götürün. ( "tuşları" kelimesi ) 3. Şimdi büyük R yazın ve ilk satırı ikincisinin aynısı yapmak için eski metinin üzerinden yenisini yazın. Siz yazdıkça metin değişecektir. ---> Bu satırı ikincisinin aynısı yapmak için tuşları kullanın. ---> Bu satırı ikincisinin aynısı yapmak için R yazın ve metini girin. 4. Çıkmak için tuşuna bastığınızda, değişmemiş metinin aynen kaldığına dikkat edin. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 6.4: SET SEÇENEĞİ ** Bir seçenek ayarlayın , böylece bir arama veya değiştirme ** ** durumu görmezden gelsin. ** 1. 'ignore' kelimesini aramak için: /ignore yazın. Bunu n tuşuna basarak birkaç kez tekrar edin 2. :set ic yazarak 'ic' (Ignore case) ayarını seçin. 3. Tekrar n tuşuna basarak 'ignore' kelimseini arayın. n tuşuna basarak bu aramayı birden çok defa tekrar edin. 4. :set hls is yazarak 'hlsearch' ve 'incsearch' ayarlarını seçin. 5. /ignore yazarak arama komutunu tekrar verin ve ne olacağını görün. 6. Karşılaşma vurgularını iptal etmek için, :nohlsearch yazın. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DERS 6 ÖZET 1. o yazmak imlecin altında bir satır açar ve imleci bu açılmış satıra Insert kipinde yerleştirir. Büyük O yazmak imlecin üzerinde bir satır açar. 2. İmlecin üzerindeki karakterden hemen sonra metin eklemek için a yazın. Büyük A yazmak hemen satır sonuna giderek metin eklemeye hazır hale getirir. 3. Büyük R yazmak Değiştir kipine girer ve çıkmak için tuşuna basılana kadar sizi bu kipte bırakır. 4. ":set xxx" yazmak "xxx" seçeneğini ayarlar. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 7: ÇEVİRİMİÇİ (ON-LINE) YARDIM KOMUTLARI ** Çevirimiçi yardım sistemini kullanın ** Vim geniş bir çevirimiçi yardım sistemine sahiptir. Başlamak için şu üçünü deneyebilirsiniz. - (eğer sahipseniz) tuşuna basın - (eğer sahipseniz) tuşuna basın - :help yazın ve tuşuna basın Yardım penceresini kapatmak için :q yazıp tuşuna basın. ":help" komutuna değişken (argüman) vererek herhangi bir konu hakkında yardım alabilirsini. Şunları deneyin ( tuşuna basmayı unutmayın) : :help w :help c_ [j] v Таке розміщення спочатку може видатись трохи дивним. Як наприклад те, що кнопка [l] переміщує курсор вправо. Але клавіші розміщені так, щоб мінімізувати кількість рухів. Найчастіша дія яку користувач робить з текстовим файлом - це читає його. А при читанні прокручують текст вниз. Тому вниз прокручує [j] - вона знаходиться якраз під вказівним пальцем правої руки. Курсор можна переміщувати і класичним способом (курсорними клавішами), але зручніше буде, якщо ви опануєте спосіб Vim. (Особливо якщо ви вже вмієте набирати всліпу). 1. Попереміщуйте курсор по екрану, поки не призвичаїтесь. 2. Перемістіться до наступного уроку. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 1.2: Вихід з Vim Увага! Перед тим як виконувати цей урок прочитайте його повністю. 1. Натисніть [ESC] (щоб впевнитись що ви в звичайному режимі). 2. Наберіть: :q! [ENTER]. Це завершує роботу, відкидаючи всі зміни які ви здійснили. 3. Коли ви побачите привітання терміналу введіть команду яку ви використали щоб відкрити цей підручник. Скоріш за все це було: vim tutor.txt [ENTER] 4. Якщо ви запам'ятали кроки з 1 по 3, виконайте їх, і переходьте до наступного уроку. Зауваження: Команда :q! [ENTER] завершує роботу і відкидає всі зміни. Через кілька уроків ви навчитесь зберігати зміни в файл. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 1.3:РЕДАГУВАННЯ ТЕКСТУ. ВИДАЛЕННЯ. ** Натисніть [x] щоб видалити символ під курсором. ** 1. Перемістіть курсор до лінії нижче, яка позначена так: --->. 2. Щоб виправити помилки перемістіть курсор так, щоб він став над символом який треба видалити. 3. Натисніть [x] щоб видалити непотрібний символ. 4. Повторіть кроки з другого по четвертий, поки речення не стане правильним. ---> Ккоровва перрестрибнуууууула ччерезз мііісяццць. 5. Тепер, коли речення правильне, можна перейти до уроку 1.4. Зауваження: Протягом навчання не старайтесь запам'ятати все. Вчіться практикою. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 1.4: РЕДАГУВАННЯ ТЕКСТУ. ВСТАВКА ** Натисніть [i] щоб вставити текст. ** 1. Перемістіть курсор на перший рядок позначений: --->. 2. Перемістіть курсор на символ, ПІСЛЯ якого потрібно вставити текст. 3. Натисніть [i] і наберіть необхідні вставки. 4. Коли всі помилки виправлені натисніть [ESC] щоб повернутись в звичайний режим. ---> З прав текст. ---> З цього рядка пропав деякий текст. 5. Коли призвичаїтесь вставляти текст - переходьте до уроку 1.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 1.5: РЕДАГУВАННЯ ТЕКСТУ. ДОДАВАННЯ. ** Натисніть [A] щоб додати текст. ** Увага! Тут і далі, коли мають наувазі клавішу з буквою в верхньому регістрі, то це означає що її натискають з затиснутою [SHIFT]. 1. Перемістіть курсор до першої лінії внизу позначеної --->. Не має значення над яким символом знаходиться курсор. 2. Натисніть [A] і введіть необхідне доповнення. 3. Коли додавання завершене натисніть [ESC] щоб повернутись в звичайний режим. 4. Перемістіть курсор до другої лінії позначеної ---> і повторіть кроки 2 і 3 щоб виправити речення. ---> З цього рядка пропущ З цього рядка пропущений текст. ---> З цього рядка також З цього рядка також пропущений текст. 5. Після виконання вправ, переходьте до наступного уроку. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 1.6: РЕДАГУВАННЯ ФАЙЛУ ** Використайте :wq щоб зберегти файл і вийти.** Увага! Перед виконанням уроку прочитайте його повністю. 1. Вийдіть з цього підручника як ви робили в уроці 1.2: :q![ENTER] Або якщо ви маєте доступ до іншого терміналу виконуйте наступні дії в ньому. 2. В терміналі наберіть команду: vim НазваФайлу [ENTER] 'vim' - команда для запуску редактора, НазваФайлу - файл який будемо редагувати. Якщо ввести неіснуючий файл, то він створиться 3. Відредагуйте текст, як навчились у попередніх уроках. 4. Щоб зберегти зміни у файлі, і вийти з Vim наберіть: :wq [ENTER] 5. Якщо ви вийшли з підручника на першому кроці, то зайдіть в нього знову і переходьте до підсумку. 6. Після прочитання і засвоєння попередніх кроків виконайте їх. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ПІДСУМОК УРОКУ 1 1. Курсор керується курсорними клавішами, або клавішами [h][j][k][l] [h] (вліво) [j] (вниз) [k] (вверх) [l] (вправо) 2. Щоб запустити Vim з терміналу наберіть: vim Назва файлу [ENTER] 3. Щоб вийти з Vim наберіть: [ESC] :q! [ENTER] щоб відкинути всі зміни. або наберіть: [ESC] :wq [ENTER] щоб зберегти всі зміни. 4. Щоб видалити символ під курсором натисніть [x]. 5. Щоб вставити, чи доповнити текст наберіть: [i] текст що вставляєтсья [ESC] вставиться перед курсором [A] текст до додається [ESC] додасть текст до рядка Зауваження: Натискання [ESC] перенесе вас в звичайний режим, чи відмінить не до кінця введену команду. Тепер переходьте до уроку 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 2.1: КОМАНДИ ВИДАЛЕННЯ ** Введіть dw щоб видалити слово. ** 1. Натисніть [ESC], щоб переконатись що ви в звичайному режимі. 2. Перемістіть курсор до лінії нижче позначеної --->. 3. Перемістіть курсор до початку слова що має бути видалене. 4. Введіть dw щоб слово пропало. Зауваження: Буква d з'явиться в останньому рядку екрану, якщо ви її натиснули. Vim чекає введення наступного символа. Якщо з'явилось щось інше значить ви щось не так ввели. Натисніть [ESC] і почніть спочатку. ---> Є деякі слова весело, які не потрібні папір в цьому реченні. 5. Повторюйте кроки 3 і 4 поки речення не стане правильне, а тоді переходьте до уроку 2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 2.2: БІЛЬШЕ КОМАНД ВИДАЛЕННЯ ** Наберіть d$ щоб видалити символи від курсора до кінця рядка. ** 1. Натисніть [ESC] щоб переконатись що ви в звичайному режимі. 2. Перемістіть курсор до лінії нижче, що позначена --->. 3. Перемістіть курсор до кінця правильного рядка (ПІСЛЯ першої крапки). 4. Введіть d$ щоб видалити все до кінця рядка. ---> Хтось надрукував кінець цього рядка двічі. кінець цього рядка двічі. 5. Перейдіть до уроку 2.3 щоб розібратись в цьому детальніше. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 2.3:ОПЕРАТОРИ І ПЕРЕМІЩЕННЯ Багато команд що змінюють текст утворені з оператора і переміщення. Формат команди видалення з оператором d подано нижче: d переміщення Де: d - оператор видалення. переміщення - з чим працює оператор (описано нижче). Короткий список переміщень: w - до початку наступного слова, НЕ ВКЛЮЧАЮЧИ його перший символ. e - до кінця поточного слова, ВКЛЮЧАЮЧИ останній символ. $ - до кінця рядка, ВКЛЮЧАЮЧИ останній символ. Тому введення de видалить символи від курсора, до кінця слова. Зауваження: Натискання тільки переміщення в звичайному режимі відповідно переміщує курсор. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 2.4: ВИКОРИСТАННЯ ЛІЧИЛЬНИКА ДЛЯ ПЕРЕМІЩЕННЯ ** Введення числа перед переміщенням повторює його стільки раз. ** 1. Перемістіть курсор до початку рядка позначеного ---> 2. Введіть 2w щоб перемістити курсор на два слова вперед. 3. Введіть 3e щоб перемістити курсор в кінець третього слова. 4. Введіть 0 (нуль) щоб переміститись на початок рядка. 5. Повторіть кроки 2 і 3 з різними числами. ---> А це просто рядок зі словами, серед яких можна рухати курсором. 6. Переходьте до уроку 2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 2.5: БАГАТОРАЗОВЕ ВИДАЛЕННЯ ** Введення числа з оператором повторює його стільки ж разів. ** В комбінації з оператором видалення, і переміщення з лічильника можна видаляти потрібне число елементів. Для цього введіть d число переміщення 1. Перемістіться до першого слова в ВЕРХНЬОМУ РЕГІСТРІ в рядку позначеному --->. 2. Введіть d2w щоб видалити два слова. 3. Повторіть кроки 1 і 2 з різними числами, щоб видалити все зайве. ---> цей ABC DE рядок FGHI JK LMN OP слів Q RS TUV почищений. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 2.6: ОПЕРАЦІЇ З РЯДКАМИ ** Введіть dd щоб видалити весь рядок. ** Через те, що видалення всього рядка є доволі частою дією розробники Vi вирішили що для цієї операції потрібна проста команда, як dd. 1. Перемістіть курсор до другого рядка в вірші нижче. 2. Введіть dd щоб видалити рядок. 3. Потім перемістіться до четвертого рядка. 4. Введіть 2dd щоб видалити два рядки. ---> 1) Троянди червоні, ---> 2) Багнюка весела, ---> 3) Волошки голубі, ---> 4) В мене є машина, ---> 5) Годинник каже час, ---> 6) Цукерки солодкі, ---> 7) Дарую тобі. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 2.7: ВІДКИНУТИ ЗМІНИ ** Натисніть u щоб скасувати останні команди, U щоб виправити ввесь рядок. ** 1. Перемістіть курсор до рядка нижче позначеного ---> на місце першої помилки. 2. Натисніть x щоб видалити непотрібний символ. 3. Потім натисніть u щоб відмінити виправлення. 4. Цього разу виправте всі помилки в рядку використовуючи команду x . 5. Після цього введіть U, і відкиньте всі зміни в цілому рядку. 6. Натисніть u кілька разів, щоб відмінити U і попередні команди. 7. Тепер натисніть CTRL-R кілька разів, щоб повторити відмінені команди (відмінити відміну). ---> Вииправте помилки наа цьоому рядку і вііідмініть їх. 8. Тепер можна переходити до підсумків другого уроку. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ПІДСУМОК УРОКУ 2 1. Щоб видалити все від курсора аж до початку наступного слова введіть: dw 2. Щоб видалити від курсора до кінця рядка: d$ 3. Щоб видалити увесь рядок: dd 4. Щоб повторити переміщення, поставте перед ним число повторів: 2w 5. Формат команди зміни: оператор [число] переміщення де: оператор - що робити, як наприклад d для видалення [число] - кількість повторів переміщення - куди переміститись перед виконанням оператора, як як наприклад w (слово), $ (кінець рядка), і т.і. 6. Щоб переміститись до початку рядка використовуйте нуль: 0 7. Щоб відмінити попередню дію введіть: u (u в нижньому регістрі) Щоб відмінити всі зміни рядка введіть: U (U в верхньому регістрі) Щоб скасувати відміну натисніть: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 3.1: КОМАНДА PUT ** Введіть p щоб вставити перед тим видалений текст після курсору. ** 1. Перемістіть курсор до першої ---> лінії внизу. 2. Введіть dd щоб видалити рядок і зберегти його в регістрі Vim. 3. Перемістіть курсор до рядка в), НАД тим місцем де має бути видалений рядок. 4. Натисніть p щоб вставити рядок під курсором. 5. Повторіть кроки від 2 до 4 щоб вставити всі рядки в правильному порядку. ---> г) всіх до кузні іззива. ---> б) а в коваля серце тепле, ---> в) а він клепче та й співа, ---> а) А в тій кузні коваль клепле, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 3.2: Команда заміни ** Наберіть rx щоб замінити символ під курсором на x . ** 1. Перемістіть курсор до першого рядка нижче, позначеного --->. 2. Помістіть курсор над першою помилкою. 3. Наберіть r а потім символ який має стояти там. 4. Повторіть кроки з 2 по 3 поки перший рядок не стане еквівалентним другому. ---> Коли ця лігія набираламт. хтось наьтснкв геправмльні унопкм! ---> Коли ця лінія набиралась, хтось натиснув неправильні кнопки! 5. Зараз переходьте до уроку 3.3. Примітка: Ви маєте вчитись діями, а не простим заучуванням, пам'ятаєте? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 3.3: ОПЕРАТОР ЗАМІНИ ** Щоб зробити заміну до кінця слова введіть ce . ** 1. Перемістіть курсор до першого рядка позначеного --->. 2. Помістіть курсор над у в слові рукра. 3. Введіть ce і правильне закінчення слова (ядок в цьому випадку). 4. Натисніть [ESC] і переходьте до наступного символа, який потрібно замінити. 5. Повторюйте кроки 3 і 4 поки перше речення не стане таким самим як і друге. ---> Цей рукра має кілька слів що потретамув заміни за допоцкщшг оператора. ---> Цей рядок має кілька слів що потребують заміни за допомогою оператора. Зауважте що ce видаляє слово, і поміщає вас в режим вставки. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 3.4: БІЛЬШЕ ЗМІН З c ** Оператор заміни використовується з тими ж переміщеннями що і видалення. ** 1. Оператор заміни працює в такий же спосіб що і видалення. Формат: c [число] переміщення 2. Переміщення ті ж самі, такі як w (слово) і $ (кінець рядка). 3. Перемістіться до першого рядка позначеного --->. 4. Перемістіть курсор до першої помилки. 5. Наберіть c$ і решту рядка, щоб він став таким як другий і натисніть [ESC]. ---> Кінець цього рядка потребує якихось дій щоб стати таким як кінець другого. ---> Кінець цього рядка можна виправити за допомогою команди c$. Примітка: Можна використовувати кнопку Backspace щоб виправляти опечатки при наборі. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ПІДСУМОК УРОКУ 3 1. Щоб вставити текст який був видалений наберіть p . Це вставляє видалений текст ПІСЛЯ курсора (якщо був видалений рядок, вставка продовжиться з рядка під курсором). 2. Щоб замінити символ під курсором наберіть r і необхідний символ. 3. Оператор заміни дозволяє робити заміну тексту від курсору, до потрібного переміщення. Наприклад щоб замінити все від курсора до кінця слова вводять ce . Щоб замінити закінчення рядка тиснуть c$ . 4. Формат заміни: c [число] переміщення Почнемо наступний урок. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 4.1: ПОЗИЦІЯ КУРСОРА І СТАТУС ФАЙЛУ ** Введіть CTRL-G щоб побачити вашу позицію в файлі, і його статус. Введіть G щоб переміститись на потрібний рядок файлу. ** ПРИМІТКА: Прочитайте увесь урок перед виконанням будь-яких кроків!! 1. Затисніть кнопку Ctrl і натисніть g . Це називається CTRL-G. Внизу з'явиться повідомлення з назвою файлу, і позицією в файлі. Запам'ятайте номер рядка для кроку 3. ПРИМІТКА: Ви бачите позицію курсора в нижньому правому кутку екрану. Це трапляється коли включена опція 'ruler' (читайте :help 'ruler' ) 2. Натисніть G щоб переміститись до кінця файлу. Наберіть gg щоб переміститись до початку файлу. 3. Наберіть номер рядка де ви були а потім G. Це перенесе вас до потрібного рядка. 4. Якщо ви запам'ятали три попередні кроки, то виконуйте. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 4.2: КОМАНДА ПОШУКУ ** Введіть / (слеш) і фразу, щоб шукати її в тексті. ** 1. В звичайному режимі введіть символ / . Зауважте що він і курсор з'являються в низу екрану, як і з командою : . 2. Тепер введіть 'очепятка' . Це буде словом яке ви шукатимете. 3. Щоб здійснити пошук цієї фрази ще раз введіть n . Щоб шукати в протилежному напрямку введіть N . 4. Щоб шукати фразу в зворотньому напрямку використайте ? замість / . 5. Щоб переміститись назад до того місця звідки прийшли натисніть CTRL-O. Повторіть щоб повернутись ще далі. (Це як кнопка назад в браузері) CTRL-I переміщує вперед. ---> "очепятка" не є способом написати опечатка; очепятка це опечатка. Примітка: Коли пошук досягає кінця файлу він продовжує з початку, хіба що опція 'wrapscan' була виключена. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 4.3: ПОШУК ПАРНИХ ДУЖОК ** Введіть % щоб знайти парну ),], чи } . ** 1. Помістіть курсор над будь-якою (, [, чи { в рядку нижче позначеному --->. 2. Тепер введіть символ % . 3. Курсор переміститься до відповідної дужки. 4. Введіть % щоб перемістити курсор до іншої парної дужки. 5. Спробуйте з іншими дужками, і подивіться що вийде. ---> Це ( тестовий рядок ( з такими [ такими ] і такими { дужками } в ньому. )) Примітка: Це корисно при відлагоджуванні програми з неправильними дужками. І взагалі в кожному тексті дужки мають стояти правильно! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 4.4: КОМАНДА ЗАМІНИ ** Наберіть :s/старе/нове/g щоб замінити 'старе' на 'нове'. ** 1. Перемістіть курсор до лінії нижче позначеної --->. 2. Введіть :s/(біп)/блять [ENTER] . Зауважте що ця команда змінює тільки перше входження (біп) в рядку. 3. Потім наберіть :s/(біп)/блять/g . Додавання g вказує що заміни робляться у всьому рядку глобально. ---> люди не лю(біп), коли в слові "лю(біп)" "(біп)" заміняють на "(бiп)". 4. Щоб замінити кожне входження послідовності символів між двома рядками наберіть :#,#s/старе/нове/g де #,# діапазон рядків в яких робиться заміна. Введіть :%s/старе/нове/g щоб змінити кожне входження у цілому файлі. Введіть :%s/старе/нове/gc щоб замінити, кожне входження у файлі з підтвердженням кожної заміни. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ПІДСУМОК УРОКУ 4 1. CTRL-G виводить вашу позицію в файлі і назву файлу. G переміщує в кінець файлу. число G переміщує до рядка з вказаним номером. gg переміщує до першого рядка. 2. Ввід / і послідовності символів шукає послідовність ПІСЛЯ курсора. Ввід ? і послідовності символів шукає послідовність ПЕРЕД курсором. Після пошуку введіть n щоб знайти наступне входження в тому ж напрямку або N щоб шукати в протилежному напрямку. CTRL-O відносить вас до старішої позиції, CTRL-I до новішої позиції. 3. Ввід % коли курсор знаходиться над дужкою (,),[,],{, чи } переносить курсор до протилежної дужки. 4. Щоб замінити перше входження старого слова на нове :s/старе/нове Щоб замінити всі старі слова рядка на нові :s/старе/нове/g Щоб замінити фрази між двома рядками :#,#s/старе/нове/g Щоб замінити всі входження в файлі :%s/старе/нове/g Щоб щоразу підтверджувати заміну додайте 'c' :%s/старе/нове/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 5.1: ЯК ВИКОНАТИ ЗОВНІШНЮ КОМАНДУ ** Введіть :! і зовнішню команду, щоб виконати ту команду. ** 1. Введіть відому команду : щоб встановити курсор в низу екрану. Це дозволяє вводити команди командного рядка. 2. Тепер введіть ! (символ знаку оклику) . Це дозволить вам виконати будь-яку зовнішню команду. 3. Як приклад введіть :!ls [ENTER]. Це покаже список файлів каталогу, так так ніби ви знаходитесь в оболонці терміналу. Або використайте :!dir якщо ви раптом знаходитесь в Windows. Примітка: Можна запускати будь-яку зовнішню команду таким способом, навіть з аргументами. Примітка: Всі команди що починаються з : мають закінчуватись натисканням [ENTER]. Більше на цьому не наголошуватиметься. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 5.2: ЩЕ ПРО ЗАПИС ФАЙЛІВ ** Щоб зберегти змінений текст, введіть :w НАЗВА_ФАЙЛУ ** 1. Введіть :!dir чи :!ls щоб переглянути вміст вашої директорії. Вам вже казали що після цього тиснуть [ENTER]. 2. Виберіть ім'я файлу яке ще не використовується, наприклад TEST. (Взагалі то це не обов'язково, якщо вміст обраного файлу не є цінним) 3. Тепер введіть: :w TEST (де TEST це назва яку ви обрали.) 4. Це зберігає увесь файл (підручник Vim ) під ім'ям TEST. Щоб перевірити знову наберіть :!ls щоб побачити зміни в каталозі. Примітка: Якщо ви вийдете з Vim і запустите його знову командою vim TEST, файл що ви відкриєте буде точною копією цього, коли ви його зберегли. 5. Зараз видаліть файл ввівши (Unix): :!rm TEST чи (MS-DOS): :!del TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 5.3: ВИБІР ТЕКСТУ ДЛЯ ЗАПИСУ ** Щоб зберегти частину файлу, наберіть v переміщення :w НАЗВА_ФАЙЛУ ** 1. Перемістіть курсор до цього рядка. 2. Натисніть v і перемістіть курсор на п'ять пунктів нижче. Зауважте, що текст виділяється. 3. Натисніть символ : . Внизу екрану з'являються символи :'<,'> . 4. Введіть w TEST , де TEST назва файлу що ще не використовується. Переконайтесь що ви бачите :'<,'>w TEST перед тим як натиснути [ENTER]. 5. Vim запише вибрані рядки в файл TEST. Використайте :!dir чи !ls щоб побачити це. Поки що не видаляйте його! Ми використаємо TEST в наступному уроці. Зауваження: Натискання v починає режим візуального виділення. Ви можете переміщувати курсор щоб змінити розмір вибраної частини. Потім можна використати оператор щоб зробити щось з текстом. Наприклад d видалить текст. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 5.4: ОТРИМАННЯ І ЗЛИТТЯ ФАЙЛІВ ** Щоб вставити вміст файлу введіть :r НАЗВА_ФАЙЛУ ** 1. Помістіть курсор десь над цим рядком. Зауваження: Після виконання кроку 2 ви побачите текст з уроку 5.3. Тоді перемістіться вниз, щоб побачити вміст цього уроку знову. 2. Тоді отримайте вміст вашого файлу TEST використавши команду :r TEST , де TEST назва файлу що ви використали. Файл що ви отримуєте поміщується під рядком курсора. 3. Щоб перевірити що файл вставлено, прокрутіть текст назад, і переконаєтесь що тепер є дві копії урок 5.3, the original and the file version. Примітка: Також ви можете вставляти вивід зовнішньої програми. Наприклад :r !ls читає вивід команди ls і вставляє його під курсором. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Підсумок 5 уроку 1. :!команда виконує зовнішню команду. 2. :w НАЗВА_ФАЙЛУ записує поточний файл на диск під назвою НАЗВА_ФАЙЛУ. 3. v переміщення :w НАЗВА_ФАЙЛУ зберігає візуально виділену частину тексту в файл НАЗВА_ФАЙЛУ. 4. :r НАЗВА_ФАЙЛУ отримує з диску файл НАЗВА_ФАЙЛУ і вставляє його під курсором. 5. :r !ls читає вивід команди ls і вставляє її під поточною позицією курсора ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 6.1: КОМАНДА ВСТАВКИ ** Введіть o щоб вставити новий рядок під курсором. ** 1. Перемістіть курсор на рядок нижче, позначений --->. 2. Натисніть o щоб вставити новий рядок ПІД курсором та перейти в режим вставки. 3. Тепер введіть текст і натисніть [ESC] щоб вийти з режиму вставки. ---> Після натискання o курсор ставиться на наступний рядок в режимі вставки. 4. Щоб вставити рядок НАД ABOVE курсором пишуть O в верхньому регістрі, замість o. Спробуйте на рядку нижче. ---> Щоб вставити рядок над цим введіть O . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 6.2: КОМАНДА ДОПИСУВАННЯ ** Натисніть a щоб вставити текст після курсору. ** 1. Перемістіть курсор до початку рядка внизу позначеного --->. 2. Тисніть e поки курсор не буде в кінці ря . 3. Натисніть a (маленьке) щоб додати текст ПІСЛЯ курсору. 4. Допишіть слова як рядок внизу. Натисніть [ESC] щоб вийти з режиму вставки. 5. Використайте e щоб переміститись до наступного неповного слова та to move to the next incomplete word and repeat steps 3 and 4. ---> Цей ря дозволить вам попрактикува в дописува тексту до рядка. ---> Цей рядок дозволить вам попрактикуватись в дописуванні тексту до рядка. Примітка: a, i і A переходять в один і той же режим вставки, єдиною різницею є тільки те, де вставляються символи. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 6.3: ІНШИЙ СПОСІБ ЗАМІНИ ** Введіть велику R щоб замінити більш ніж один символ. ** 1. Перемістіть курсор до першого рядка внизу позначеного --->. Перемістіть курсор до першого xxx . 2. Тепер натисніть R і введіть номер під ним з другого рядка, так що він замінює xxx . 3. Натисніть [ESC] щоб покинути режим заміни. Зауважте, що решта рядка залишається незмінною. 4. Повторіть кроки від 1 до 3 щоб замінити всі xxx на числа з другого рядка. ---> Додавання 123 до xxx дає xxx. ---> Додавання 123 до 456 дає 579. Зауваження: Режим заміни подібний до режиму вставки, тільки кожен введений символ видаляє символ який стояв на його місці. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 6.4: КОПІЮВАННЯ І ВСТАВКА ** Використайте оператор y щоб копіювати текст і p щоб його вставити ** 1. Перейдіть до рядка нижче позначеного ---> і покладіть курсор після "а)". 2. Перейдіть в візуальний режим за допомогою клавіші v і перемістіть курсор якраз перед словом "один". 3. Введіть y щоб копіювати (yank) виділений текст. 4. Перемістіть курсор до кінця наступного рядка: j$ 5. Натисніть p щоб вставити (put) текст. Тоді введіть : два [ESC] . 6. так само додайте третій рядочок. ---> а) це рядок номер один б) Зауваження: також можна використовувати y як оператор; yw копіює одне слово. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 6.5: ВСТАНОВЛЕННЯ ОПЦІЙ ** Встановити опцію так що пошук чи заміна буде ігнорувати регістр ** 1. Знайдіть слово 'ігнорувати' ввівши : /ігнорувати Повторіть кілька разів натискаючи n . 2. Встановіть опцію ігнорування регістру 'ic' (Ignore case) ввівши: :set ic 3. Тепер пошукайте 'ігнорувати' знову ввівши n Зауважте що Ігнорувати та ІГНОРУВАТИ тепер також знаходяться. 4. Ввімкніть 'hlsearch' (підсвітку пошуку) і 'incsearch' (інтерактивність) командою :set hls is . 5. Тепер пошукайте щось знову і зауважте зміни: /ігнорувати [ENTER] 6. Щоб вимкнути ігнорування регістру напишіть: :set noic Примітка: Щоб вимкнути підсвітку співпадінь введіть: :nohlsearch Примітка: Якщо ви хочете не брати до уваги регістр тільки під час одного пошуку використайте ключ \c. Наприклад: /ігнорувати\c [ENTER] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ПІДСУМОК УРОКУ 6 1. Введіть о щоб додати рядок ПІД курсором і почати режим вставки. Введіть O щоб додати рядок НАД курсором. 2. Введіть a щоб вставити текст ПІСЛЯ курсора. Введіть A щоб додати текст до рядка. 3. Переміщення e переміщує нас до кінця слова. 4. Оператор y копіює текст, p вставляє його. 5. Введення R переносить нас в режим заміни до натискання [ESC]. 6. Набір ":set xxx" встановлює опцію "xxx". Деякі опції: 'ic' 'ignorecase' ігнорувати верхній/нижній регістр при пошуку 'is' 'incsearch' показувати співпадіння пошуку під час введення фрази 'hls' 'hlsearch' пісвічувати всі співпадіння Можна одночасно використовувати і коротку і довгу форму запису опції. 7. Використайте префікс "no" щоб вимкнути опцію: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 7.1: ОТРИМАННЯ ДОПОМОГИ ** Використання вбудованої довідкової системи ** Vim має всеосяжну систему довідки. Щоб ознайомитись з нею спробуйте один з таких способів: - натисніть кнопку [HELP] (якщо така є) - натисніть [F1] - наберіть :help Прочитайте текст в вікні допомоги, щоб вияснити як вона працює. Натисніть CTRL-W двічі щоб змінити вікно Наберіть :q щоб закрити вікно довідки. Можна знайти довідку майже на будь-яку тему додаючи аргумент після команди ":help" . Спробуйте одну з наступних (не забувайте натискати [ENTER]): :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 7.2: СТВОРЕННЯ СКРИПТА АВТОЗАПУСКУ ** Ввімкнення додаткових функцій Vim ** Vim має набагато більше функцій ніж Vi, але більшість з них відключені за замовчуванням. Щоб почати використання додаткових функцій потрібно створити файл "vimrc". 1. Почніть редагування файлу "vimrc" . Це залежить від вашої системи: :e ~/.vimrc для Unix :e $VIM/_vimrc для MS-Windows 2. Тепер прочитайте приклад вмісту "vimrc" : :r $VIMRUNTIME/vimrc_example.vim 3. Збережіть файл: :w Наступного разу коли ви запустите Vim він буде використовувати підсвітку синтаксису. Можна додати всі ваші улюблені налаштування в цей файл. Для більш детальної інформації введіть :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 7.3: АВТОДОПОВНЕННЯ ** Автодоповнення за допомогою CTRL-D і [TAB] ** 1. Переконайтесь що в Vim не включена зворотня сумісність: :set nocp 2. Подивіться що за файли існують в каталозі: :!ls чи :!dir 3. Введіть початок команди: :e 4. Натисніть CTRL-D і Vim покаже список команд що починаються з "e". 5. Натисніть [TAB] і Vim доповнить команду до ":edit". 6. Тепер додайте пропуск і початок існуючого імені файлу: :edit FIL 7. Натисніть [TAB]. Vim доповнить ім'я (якщо воно унікальне). Зауваження: Доповнення працює для багатьох команд. Просто натискайте CTRL-D і [TAB]. Це особливо корисно для команди :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ПІДСУМОК УРОКУ 7 1. Введіть :help або натисніть [F1] щоб відкрити вікно довідки. 2. Введіть :help тема щоб знайти довідку про тему . 3. Введіть CTRL-W CTRL-W щоб змінити вікно. 4. Наберіть :q щоб закрити вікно 5. Створіть скрипт vimrc щоб змінювати ваші налаштування при запуску. 6. При наборі команди що починається з двокрапки : натисніть CTRL-D щоб побачити можливі доповнення. Натисніть [TAB] щоб побачити одне з доповнень. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Це завершує уроки Vim . Вони були націлені щоб дати вам короткий вступ в редактор Vim, достатній для того щоб використовувати редактор комфортно. Ці уроки зовсім далеко від повних, бо Vim має набагато більше команд. Можна прочитати інструкцію користувача : ":help user-manual". Для подальшого читання і вивчення рекомендується така книжка: Vim - Vi Improved - by Steve Oualline Publisher: New Riders Особливо корисна для початківців. Там багато прикладів і ілюстрацій. Дивіться http://iccf-holland.org/click5.html Ці уроки були написані Майклом С. Пірсом та Робертом Уаром. Модифіковано для Vim Бремом Муленаром. Переклад на українську Буник Т. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim-7.4.1689/runtime/tutor/tutor.utf-8000066400000000000000000001007401267703067000175010ustar00rootroot00000000000000=============================================================================== = W e l c o m e t o t h e V I M T u t o r - Version 1.7 = =============================================================================== 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. ATTENTION: 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 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. Really! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 1.2: EXITING VIM !! NOTE: Before executing any of the steps below, read this entire lesson!! 1. Press the key (to make sure you are in Normal mode). 2. Type: :q! . This exits the editor, DISCARDING any changes you have made. 3. Get back here by executing the command that got you into this tutor. That might be: vimtutor 4. If you have these steps memorized and are confident, execute steps 1 through 3 to exit and re-enter the editor. NOTE: :q! discards any changes you made. In a few lessons you will learn how to save the changes to a file. 5. Move the cursor down to Lesson 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 1.3: TEXT EDITING - DELETION ** 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 ** 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 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 lesson 1.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 1.5: TEXT EDITING - APPENDING ** Press A to append text. ** 1. Move the cursor to the first line below marked --->. It does not matter on what character the cursor is in that line. 2. Press A and type in the necessary additions. 3. As the text has been appended press to return to Normal mode. 4. Move the cursor to the second line marked ---> and repeat steps 2 and 3 to correct this sentence. ---> There is some text missing from th There is some text missing from this line. ---> There is also some text miss There is also some text missing here. 5. When you are comfortable appending text move to lesson 1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 1.6: EDITING A FILE ** Use :wq to save a file and exit. ** !! NOTE: Before executing any of the steps below, read this entire lesson!! 1. Exit this tutor as you did in lesson 1.2: :q! Or, if you have access to another terminal, do the following there. 2. At the shell prompt type this command: vim tutor 'vim' is the command to start the Vim editor, 'tutor' is the name of the file you wish to edit. Use a file that may be changed. 3. Insert and delete text as you learned in the previous lessons. 4. Save the file with changes and exit Vim with: :wq 5. If you have quit vimtutor in step 1 restart the vimtutor and move down to the following summary. 6. After reading the above steps and understanding them: do it. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 start Vim from the shell prompt type: vim FILENAME 3. To exit Vim type: :q! to trash all changes. OR type: :wq to save the changes. 4. To delete the character at the cursor type: x 5. To insert or append text type: i type inserted text insert before the cursor A type appended text append after the line NOTE: Pressing 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 a word. ** 1. Press 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 letter d will appear on the last line of the screen as you type it. Vim is waiting for you to type w . If you see another character than d you typed something wrong; press 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 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 OPERATORS AND MOTIONS Many commands that change text are made from an operator and a motion. The format for a delete command with the d delete operator is as follows: d motion Where: d - is the delete operator. motion - is what the operator will operate on (listed below). A short list of motions: w - until the start of the next word, EXCLUDING its first character. e - to the end of the current word, INCLUDING the last character. $ - to the end of the line, INCLUDING the last character. Thus typing de will delete from the cursor to the end of the word. NOTE: Pressing just the motion while in Normal mode without an operator will move the cursor as specified. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 2.4: USING A COUNT FOR A MOTION ** Typing a number before a motion repeats it that many times. ** 1. Move the cursor to the start of the line marked ---> below. 2. Type 2w to move the cursor two words forward. 3. Type 3e to move the cursor to the end of the third word forward. 4. Type 0 (zero) to move to the start of the line. 5. Repeat steps 2 and 3 with different numbers. ---> This is just a line with words you can move around in. 6. Move on to Lesson 2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 2.5: USING A COUNT TO DELETE MORE ** Typing a number with an operator repeats it that many times. ** In the combination of the delete operator and a motion mentioned above you insert a count before the motion to delete more: d number motion 1. Move the cursor to the first UPPER CASE word in the line marked --->. 2. Type d2w to delete the two UPPER CASE words 3. Repeat steps 1 and 2 with a different count to delete the consecutive UPPER CASE words with one command ---> this ABC DE line FGHI JK LMN OP of words is Q RS TUV cleaned up. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 2.6: OPERATING ON LINES ** 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 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 to delete 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.7: 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 up to the next 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. To repeat a motion prepend it with a number: 2w 5. The format for a change command is: operator [number] motion where: operator - is what to do, such as d for delete [number] - is an optional count to repeat the motion motion - moves over the text to operate on, such as w (word), $ (to the end of line), etc. 6. To move to the start of the line use a zero: 0 7. 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 previously deleted text after the cursor. ** 1. Move the cursor to the first ---> line below. 2. Type dd to delete the line and store it in a Vim register. 3. Move the cursor to the c) line, ABOVE where the deleted line should go. 4. Type p to put the line below the cursor. 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 rx to replace the character at the cursor with x . ** 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 be there. 4. Repeat steps 2 and 3 until the first line is equal to the second one. ---> 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.3. NOTE: Remember that you should be learning by doing, not memorization. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 3.3: THE CHANGE OPERATOR ** To change until the end of a word, type ce . ** 1. Move the cursor to the first line below marked --->. 2. Place the cursor on the u in lubw. 3. Type ce and the correct word (in this case, type ine ). 4. Press and move to the next character that needs 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 operator. ---> This line has a few words that need changing using the change operator. Notice that ce deletes the word and places you in Insert mode. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 3.4: MORE CHANGES USING c ** The change operator is used with the same motions as delete. ** 1. The change operator works in the same way as delete. The format is: c [number] motion 2. The motions are the same, such as w (word) and $ (end of line). 3. Move to the first line below marked --->. 4. Move the cursor to the first error. 5. Type c$ and type the rest of the line like the second and press . ---> 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. NOTE: You can use the Backspace key to correct mistakes while typing. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 3 SUMMARY 1. To put back text that has just 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 you want to have there. 3. The change operator allows you to change from the cursor to where the motion takes you. eg. Type ce 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: c [number] motion Now go on to the next lesson. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 4.1: CURSOR LOCATION AND FILE STATUS ** Type CTRL-G to show your location in the file and the file status. Type 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 . We call this CTRL-G. A message will appear at the bottom of the page with the filename and the position in the file. Remember the line number for Step 3. NOTE: You may see the cursor position in the lower right corner of the screen This happens when the 'ruler' option is set (see :help 'ruler' ) 2. Press G to move you to the bottom of the file. Type gg to move you to the start of the file. 3. Type the number of the line you were on and then G . This will return you to the line you were on when you first pressed CTRL-G. 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' . 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 N . 4. To search for a phrase in the backward direction, use ? instead of / . 5. To go back to where you came from press CTRL-O (Keep Ctrl down while pressing the letter o). Repeat to go back further. CTRL-I goes forward. ---> "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, unless the 'wrapscan' option has been reset. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 will move to the matching parenthesis or bracket. 4. Type % to move the cursor to the other matching bracket. 5. Move the cursor to another (,),[,],{ or } and see what % does. ---> 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: THE SUBSTITUTE COMMAND ** Type :s/old/new/g to substitute 'new' for 'old'. ** 1. Move the cursor to the line below marked --->. 2. Type :s/thee/the . Note that this command only changes the first occurrence of "thee" in the line. 3. Now type :s/thee/the/g . Adding the g flag means to substitute globally in the line, change all occurrences of "thee" in 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 line numbers of the range of lines where the substitution is to be done. Type :%s/old/new/g to change every occurrence in the whole file. Type :%s/old/new/gc to find every occurrence in the whole file, with a prompt whether to substitute or not. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 4 SUMMARY 1. CTRL-G displays your location in the file and the file status. G moves to the end of the file. number G moves to that line number. gg moves to the first line. 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 N to search in the opposite direction. CTRL-O takes you back to older positions, CTRL-I to newer positions. 3. Typing % while the cursor is on a (,),[,],{, or } goes to its match. 4. To substitute new for the first old in 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-line 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 . 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, also with arguments. NOTE: All : commands must be finished by hitting From here on we will not always mention it. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 5.2: MORE ON WRITING FILES ** To save the changes made to the text, type :w FILENAME. ** 1. Type :!dir or :!ls to get a listing of your directory. You already know you must hit 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 (the Vim Tutor) under the name TEST. To verify this, type :!dir or :!ls again to see your directory. NOTE: If you were to exit Vim and start it again with vim 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: SELECTING TEXT TO WRITE ** To save part of the file, type v motion :w FILENAME ** 1. Move the cursor to this line. 2. Press v and move the cursor to the fifth item below. Notice that the text is highlighted. 3. Press the : character. At the bottom of the screen :'<,'> will appear. 4. Type w TEST , where TEST is a filename that does not exist yet. Verify that you see :'<,'>w TEST before you press . 5. Vim will write the selected lines to the file TEST. Use :!dir or :!ls to see it. Do not remove it yet! We will use it in the next lesson. NOTE: Pressing v starts Visual selection. You can move the cursor around to make the selection bigger or smaller. Then you can use an operator to do something with the text. For example, d deletes the text. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 5.4: RETRIEVING AND MERGING FILES ** To insert the contents of a file, type :r FILENAME ** 1. Place the cursor just above this line. NOTE: After executing Step 2 you will see text from Lesson 5.3. Then move DOWN to see this lesson again. 2. Now retrieve your TEST file using the command :r TEST where TEST is the name of the file you used. The file you retrieve is placed below the cursor line. 3. 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. NOTE: You can also read the output of an external command. For example, :r !ls reads the output of the ls command and puts it below the cursor. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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. v motion :w FILENAME saves the Visually selected lines in file FILENAME. 4. :r FILENAME retrieves disk file FILENAME and puts it below the cursor position. 5. :r !dir reads the output of the dir command and puts it below 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 the lowercase letter o to open up a line BELOW the cursor and place you in Insert mode. 3. Now type some text and press 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 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 start of the line below marked --->. 2. Press e until the cursor is on the end of li . 3. Type an a (lowercase) to append text AFTER the cursor. 4. Complete the word like the line below it. Press to exit Insert mode. 5. Use e to move to the next incomplete word and repeat steps 3 and 4. ---> This li will allow you to pract appendi text to a line. ---> This line will allow you to practice appending text to a line. NOTE: a, i and A all go to the same Insert mode, the only difference is where the characters are inserted. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 6.3: ANOTHER WAY TO REPLACE ** Type a capital R to replace more than one character. ** 1. Move the cursor to the first line below marked --->. Move the cursor to the beginning of the first xxx . 2. Now press R and type the number below it in the second line, so that it replaces the xxx . 3. Press to leave Replace mode. Notice that the rest of the line remains unmodified. 4. Repeat the steps to replace the remaining xxx. ---> Adding 123 to xxx gives you xxx. ---> Adding 123 to 456 gives you 579. NOTE: Replace mode is like Insert mode, but every typed character deletes an existing character. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 6.4: COPY AND PASTE TEXT ** Use the y operator to copy text and p to paste it ** 1. Go to the line marked with ---> below and place the cursor after "a)". 2. Start Visual mode with v and move the cursor to just before "first". 3. Type y to yank (copy) the highlighted text. 4. Move the cursor to the end of the next line: j$ 5. Type p to put (paste) the text. Then type: a second . 6. Use Visual mode to select " item.", yank it with y , move to the end of the next line with j$ and put the text there with p . ---> a) this is the first item. b) NOTE: you can also use y as an operator; yw yanks one word. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 6.5: SET OPTION ** Set an option so a search or substitute ignores case ** 1. Search for 'ignore' by entering: /ignore Repeat several times by pressing n . 2. Set the 'ic' (Ignore case) option by entering: :set ic 3. Now search for 'ignore' again by pressing n Notice that Ignore and IGNORE are now also found. 4. Set the 'hlsearch' and 'incsearch' options: :set hls is 5. Now type the search command again and see what happens: /ignore 6. To disable ignoring case enter: :set noic NOTE: To remove the highlighting of matches enter: :nohlsearch NOTE: If you want to ignore case for just one search command, use \c in the phrase: /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 6 SUMMARY 1. Type o to open a line BELOW the cursor and start Insert mode. Type O to open a line ABOVE the cursor. 2. Type a to insert text AFTER the cursor. Type A to insert text after the end of the line. 3. The e command moves to the end of a word. 4. The y operator yanks (copies) text, p puts (pastes) it. 5. Typing a capital R enters Replace mode until is pressed. 6. Typing ":set xxx" sets the option "xxx". Some options are: 'ic' 'ignorecase' ignore upper/lower case when searching 'is' 'incsearch' show partial matches for a search phrase 'hls' 'hlsearch' highlight all matching phrases You can either use the long or the short option name. 7. Prepend "no" to switch an option off: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 7.1: GETTING HELP ** Use the on-line help system ** Vim has a comprehensive on-line help system. To get started, try one of these three: - press the key (if you have one) - press the key (if you have one) - type :help Read the text in the help window to find out how the help works. Type CTRL-W CTRL-W to jump from one window to another. Type :q 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 ): :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 7.2: CREATE A STARTUP SCRIPT ** Enable 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: :e ~/.vimrc for Unix :e $VIM/_vimrc for MS-Windows 2. Now read the example "vimrc" file contents: :r $VIMRUNTIME/vimrc_example.vim 3. Write the file with: :w The next time you start Vim it will use syntax highlighting. You can add all your preferred settings to this "vimrc" file. For more information type :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 7.3: COMPLETION ** Command line completion with CTRL-D and ** 1. Make sure Vim is not in compatible mode: :set nocp 2. Look what files exist in the directory: :!ls or :!dir 3. Type the start of a command: :e 4. Press CTRL-D and Vim will show a list of commands that start with "e". 5. Press and Vim will complete the command name to ":edit". 6. Now add a space and the start of an existing file name: :edit FIL 7. Press . Vim will complete the name (if it is unique). NOTE: Completion works for many commands. Just try pressing CTRL-D and . It is especially useful for :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 7 SUMMARY 1. Type :help or press or to open a help window. 2. Type :help cmd to find help on cmd . 3. Type CTRL-W CTRL-W to jump to another window 4. Type :q to close the help window 5. Create a vimrc startup script to keep your preferred settings. 6. When typing a : command, press CTRL-D to see possible completions. Press to use one completion. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim-7.4.1689/runtime/tutor/tutor.vi.utf-8000066400000000000000000000771231267703067000201260ustar00rootroot00000000000000=============================================================================== = Xin chào mừng bạn đến với Hướng dẫn dùng Vim - Phiên bản 1.5 = =============================================================================== Vim là một trình soạn thảo rất mạnh. Vim có rất nhiều câu lệnh, chính vì thế không thể trình bày hết được trong cuốn hướng dẫn này. Cuốn hướng dẫn chỉ đưa ra những câu lệnh để giúp bạn sử dụng Vim được dễ dàng hơn. Đây cũng chính là mục đich của sách Cần khoảng 25-30 phút để hoàn thành bài học, phụ thuộc vào thời gian thực hành. Các câu lệnh trong bài học sẽ thay đổi văn bản này. Vì thế hãy tạo một bản sao của tập tin này để thực hành (nếu bạn dùng "vimtutor" thì đây đã là bản sao). Hãy nhớ rằng hướng dẫn này viết với nguyên tắc "học đi đôi với hành". Có nghĩa là bạn cần chạy các câu lệnh để học chúng. Nếu chỉ đọc, bạn sẽ quên các câu lệnh! Bây giờ, cần chắc chắn là phím Shift KHÔNG bị nhấn và hãy nhấn phím j đủ số lần cần thiết (di chuyển con trỏ) để Bài 1.1 hiện ra đầy đủ trên màn hình. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bài 1.1: DI CHUYỂN CON TRỎ ** Để di chuyển con trỏ, nhấn các phím h,j,k,l như đã chỉ ra. ** ^ k Gợi ý: phím h ở phía trái và di chuyển sang trái. < h l > phím l ở bên phải và di chuyển sang phải. j phím j trong như một mũi tên chỉ xuống v 1. Di chuyển con trỏ quanh màn hình cho đến khi bạn quen dùng. 2. Nhấn và giữ phím (j) cho đến khi nó lặp lại. ---> Bây giờ bạn biết cách chuyển tới bài học thứ hai. 3. Sử dụng phím di chuyển xuống bài 1.2. Chú ý: Nếu bạn không chắc chắn về những gì đã gõ, hãy nhấn để chuyển vào chế độ Câu lệnh, rồi gõ lại những câu lệnh mình muốn. Chú ý: Các phím mũi tên cũng làm việc. Nhưng một khi sử dụng thành thạo hjkl, bạn sẽ di chuyển con trỏ nhanh hơn so với các phím mũi tên. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bài 1.2: VÀO VÀ THOÁT VIM !! CHÚ Ý: Trước khi thực hiện bất kỳ lệnh nào, xin hãy đọc cả bài học này!! 1. Nhấn phím (để chắc chắn là bạn đang ở chế độ Câu lệnh). 2. Gõ: :q! . ---> Lệnh này sẽ thoát trình soạn thảo mà KHÔNG ghi nhớ bất kỳ thay đổi nào mà bạn đã làm. Nếu bạn muốn ghi nhớ những thay đổi đó và thoát thì hãy gõ: :wq 3. Khi thấy dấu nhắc shell, hãy gõ câu lệnh đã đưa bạn tới hướng dẫn này. Có thể là lệnh: vimtutor vi Thông thường bạn dùng: vim tutor.vi ---> 'vim' là trình soạn thảo vim, 'tutor.vi' là tập tin bạn muốn soạn thảo. 4. Nếu bạn đã nhớ và nắm chắc những câu lệnh trên, hãy thực hiện các bước từ 1 tới 3 để thoát và quay vào trình soạn thảo. Sau đó di chuyển con trỏ tới Bài 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bài 1.3: SOẠN THẢO VĂN BẢN - XÓA ** Trong chế độ Câu lệnh nhấn x để xóa ký tự nằm dưới con trỏ. ** 1. Di chuyển con trỏ tới dòng có dấu --->. 2. Để sửa lỗi, di chuyển con trỏ để nó nằm trên ký tự sẽ bị xóa. 3. Nhấn phím x để xóa ký tự không mong muốn. 4. Lặp lại các bước từ 2 tới 4 để sửa lại câu. ---> Emm xiinh em đứnng chỗ nào cũnkg xinh. 5. Câu trên đã sửa xong, hãy chuyển tới Bài 1.4. Chú ý: Khi học theo cuốn hướng dẫn này đừng cố nhớ, mà học từ thực hành. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bài 1.4: SOẠN THẢO VĂN BẢN - CHÈN ** Trong chế độ Câu lệnh nhấn i để chèn văn bản. ** 1. Di chuyển con trỏ tới dòng có dấu ---> đầu tiên. 2. Để dòng thứ nhất giống hệt với dòng thứ hai, di chuyển con trỏ lên ký tự đầu tiên NGAY SAU chỗ muốn chèn văn bản. 3. Nhấn i và gõ văn bản cần thêm. 4. Sau mỗi lần chèn từ còn thiếu nhấn để trở lại chế dộ Câu lệnh. Lặp lại các bước từ 2 tới 4 để sửa câu này. ---> Mot lam chang nen , ba cay chum lai hon cao. ---> Mot cay lam chang nen non, ba cay chum lai nen hon nui cao. 5. Sau khi thấy quen với việc chèn văn bản hãy chuyển tới phần tổng kết ở dưới. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TỔNG KẾT BÀI 1 1. Con trỏ được di chuyển bởi các phím mũi tên hoặc các phím hjkl. h (trái) j (xuống) k (lên) l (phải) 2. Để vào Vim (từ dấu nhắc %) gõ: vim TÊNTẬPTIN 3. Muốn thoát Vim gõ: :q! để vứt bỏ mọi thay đổi. HOẶC gõ: :wq để ghi nhớ thay đổi. 4. Để xóa bỏ ký tự nằm dưới con trỏ trong chế độ Câu lệnh gõ: x 5. Để chèn văn bản tại vị trí con trỏ trong chế độ Câu lệnh gõ: i văn bản sẽ nhập CHÚ Ý: Nhấn sẽ đưa bạn vào chế độ Câu lệnh hoặc sẽ hủy bỏ một câu lệnh hay đoạn câu lệnh không mong muốn. Bây giờ chúng ta tiếp tục với Bài 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bài 2.1: CÁC LỆNH XÓA ** Gõ dw để xóa tới cuối một từ. ** 1. Nhấn để chắc chắn là bạn đang trong chế độ Câu lệnh. 2. Di chuyển con trỏ tới dòng có dấu --->. 3. Di chuyển con trỏ tới ký tự đầu của từ cần xóa. 4. Gõ dw để làm từ đó biến mất. CHÚ Ý: các ký tự dw sẽ xuất hiện trên dòng cuối cùng của màn hình khi bạn gõ chúng. Nếu bạn gõ nhầm, hãy nhấn và làm lại từ đầu. ---> Khi trái tỉm tìm tim ai như mùa đông giá lạnh lanh Anh đâu thành cánh én nhỏ trùng khơi. 5. Lặp lại các bước cho đến khi sửa xong câu thơ rồi chuyển tới Bài 2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bài 2.2: CÁC CÂU LỆNH XÓA KHÁC ** gõ d$ để xóa tới cuối một dòng. ** 1. Nhấn để chắc chắn là bạn đang trong chế độ Câu lệnh. 2. Di chuyển con trỏ tới dòng có dấu --->. 3. Di chuyển con trỏ tới cuối câu đúng (SAU dấu . đầu tiên). 4. Gõ d$ để xóa tới cuối dòng. ---> Đã qua đi những tháng năm khờ dại. thừa thãi. 5. Chuyển tới Bài 2.3 để hiểu cái gì đang xảy ra. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bài 2.3: CÂU LỆNH VÀ ĐỐI TƯỢNG Câu lệnh xóa d có dạng như sau: [số] d đối_tượng HOẶC d [số] đối_tượng Trong đó: số - là số lần thực hiện câu lệnh (không bắt buộc, mặc định=1). d - là câu lệnh xóa. đối_tượng - câu lệnh sẽ thực hiện trên chúng (liệt kê phía dưới). Danh sách ngắn của đối tượng: w - từ con trỏ tới cuối một từ, bao gồm cả khoảng trắng. e - từ con trỏ tới cuối một từ, KHÔNG bao gồm khoảng trắng. $ - từ con trỏ tới cuối một dòng. CHÚ Ý: Dành cho những người ham tìm hiểu, chỉ nhấn đối tượng trong chế độ Câu lệnh mà không có câu lệnh sẽ di chuyển con trỏ như trong danh sách trên. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bài 2.4: TRƯỜNG HỢP NGOẠI LỆ CỦA QUY LUẬT 'CÂU LỆNH-ĐỐI TƯỢNG' ** Gõ dd để xóa cả một dòng. ** Người dùng thường xuyên xóa cả một dòng, vì thế các nhà phát triển Vi đã quyết định dùng hai chữ d để đơn giản hóa thao tác này. 1. Di chuyển con trỏ tới dòng thứ hai trong cụm phía dưới. 2. Gõ dd để xóa dòng này. 3. Bây giờ di chuyển tới dòng thứ tư. 4. Gõ 2dd (hãy nhớ lại bộ ba số-câu lệnh-đối tượng) để xóa hai dòng. 1) Trong tim em khắc sâu bao kỉ niệm 2) Tình yêu chân thành em dành cả cho anh 3) Dẫu cuộc đời như bể dâu thay đổi 4) Anh mãi là ngọn lửa ấm trong đêm 5) Đã qua đi những tháng năm khờ dại 7) Hãy để tự em lau nước mắt của mình 8) Lặng lẽ sống những đêm dài bất tận 9) Bao khổ đau chờ tia nắng bình minh ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bài 2.5: CÂU LỆNH "HỦY THAO TÁC" ** Nhấn u để hủy bỏ những câu lệnh cuối cùng, U để sửa cả một dòng. ** 1. Di chuyển con trỏ tới dòng có dấu ---> và đặt con trỏ trên từ có lỗi đầu tiên 2. Gõ x để xóa chữ cái gây ra lỗi đầu tiên. 3. Bây giờ gõ u để hủy bỏ câu lệnh vừa thự hiện (xóa chữ cái). 4. Dùng câu lệnh x để sửa lỗi cả dòng này. 5. Bây giờ gõ chữ U hoa để phục hồi trạng thái ban đầu của dòng. 6. Bây giờ gõ u vài lần để hủy bỏ câu lệnh U và các câu lệnh trước. 7. Bây giờ gõ CTRL-R (giữ phím CTRL và gõ R) và lầu để thực hiện lại các câu lệnh (hủy bỏ các câu lệnh hủy bỏ). ---> Câyy ccó cộii, nuước csó nguuồn. 8. Đây là những câu lệnh rất hữu ích. Bây giờ chuyển tới Tổng kết Bài 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TỔNG KẾT BÀI 2 1. Để xóa từ con trỏ tới cuối một từ gõ: dw 2. Để xóa từ con trỏ tới cuối một dòng gõ: d$ 3. Để xóa cả một dòng gõ: dd 4. Một câu lệnh trong chế độ Câu lệnh có dạng: [số] câu_lệnh đối_tượng HOẶC câu_lệnh [số] đối_tượng trong đó: số - là số lần thực hiện câu lệnh (không bắt buộc, mặc định=1). câu_lệnh - là những gì thực hiện, ví dụ d dùng để xóa. đối_tượng - câu lệnh sẽ thực hiện trên chúng, ví dụ w (từ), $ (tới cuối một dòng), v.v... 5. Để hủy bỏ thao tác trước, gõ: u (chữ u thường) Để hủy bỏ tất cả các thao tác trên một dòng, gõ: U (chữ U hoa) Để hủy bỏ các câu lệnh hủy bỏ, gõ: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bài 3.1: CÂU LỆNH DÁN ** Gõ p để dán những gì vừa xóa tới sau con trỏ. ** 1. Di chuyển con trỏ tới dòng đầu tiên trong cụm ở dưới. 2. Gõ dd để xóa và ghi lại một dòng trong bộ nhớ đệm của Vim. 3. Di chuyển con trỏ tới dòng Ở TRÊN chỗ cần dán. 4. Trong chế độ Câu lệnh, gõ p để thay thế dòng. 5. Lặp lại các bước từ 2 tới 4 để đặt các dòng theo đúng thứ tự của chúng. d) Niềm vui như gió xưa bay nhè nhẹ b) Em vẫn mong anh sẽ đến với em c) Đừng để em mất đi niềm hy vọng đó a) Ai sẽ giúp em vượt qua sóng gió e) Dễ ra đi khó giữ lại bên mình ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bài 3.2: CÂU LỆNH THAY THẾ ** Gõ r và một ký tự để thay thế ký tự nằm dưới con trỏ. ** 1. Di chuyển con trỏ tới dòng có dấu --->. 2. Di chuyển con trỏ tới ký tự gõ sai đầu tiên. 3. Gõ r và ký tự đúng. 4. Lặp lại các bước từ 2 đến 4 để sửa cả dòng. ---> "Trên đời nài làm gì có đườmg, người to đi mãi rồi thànk đường là tHôi" ---> "Trên đời này làm gì có đường, người ta đi mãi rồi thành đường mà thôi" 5. Bây giờ chuyển sang Bài 3.3. CHÚ Ý: Hãy nhớ rằng bạn cần thực hành, không nên "học vẹt". ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bài 3.3: CÂU LỆNH THAY ĐỔI ** Để thay đổi một phần hay cả một từ, gõ cw . ** 1. Di chuyển con trỏ tới dòng có dấu --->. 2. Đặt con trỏ trên chữ trong. 3. Gõ cw và sửa lại từ (trong trường hợp này, gõ 'ine'.) 4. Gõ và chuyển tới lỗi tiếp theo (chữ cái đầu tiên trong số cần thay.) 5. Lặp lại các bước 3 và 4 cho tới khi thu được dòng như dòng thứ hai. ---> Trên dùgn này có một dầy từ cần tyays đổi, sử dunk câu lệnh thay đổi. ---> Trên dong này có một vai từ cần thay đổi, sử dung câu lệnh thay đổi. Chú ý rằng cw không chỉ thay đổi từ, nhưng còn đưa bạn vào chế độ chèn. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bài 3.4: TIẾP TỤC THAY ĐỔI VỚI c ** Câu lệnh thay đổi được sử dụng với cùng đối tượng như câu lệnh xóa. ** 1. Câu lệnh thay đổi làm việc tương tự như câu lệnh xóa. Định dạng như sau: [số] c đối_tượng HOẶC c [số] đối_tượng 2. Đối tượng cũng giống như ở trên, ví dụ w (từ), $ (cuối dòng), v.v... 3. Di chuyển con trỏ tới dòng có dấu --->. 4. Di chuyển con trỏ tới dòng có lỗi đầu tiên. 5. Gõ c$ để sửa cho giống với dòng thứ hai và gõ . ---> Doan cuoi dong nay can sua de cho giong voi dong thu hai. ---> Doan cuoi dong nay can su dung cau lenh c$ de sua. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TỔNG KẾT BÀI 3 1. Để dán đoạn văn bản vừa xóa, gõ p. Câu lệnh này sẽ đặt đoạn văn bản này PHÍA SAU con trỏ (nếu một dòng vừa bị xóa, dòng này sẽ được đặt vào dòng nằm dưới con trỏ). 2. Để thay thế ký tự dưới con trỏ, gõ r và sau đó gõ ký tự muốn thay vào. 3. Câu lệnh thay đổi cho phép bạn thay đổi đối tượng chỉ ra từ con trỏ tới cuối đối tượng. vd. Gõ cw để thay đổi từ con trỏ tới cuối một từ, c$ để thay đổi tới cuối một dòng. 4. Định dạng để thay đổi: [số] c đối_tượng HOẶC c [số] đối_tượng Bây giờ chúng ta tiếp tục bài học mới. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bài 4.1: THÔNG TIN VỀ TẬP TIN VÀ VỊ TRÍ TRONG TẬP TIN ** Gõ CTRL-g để hiển thị vị trí của bạn trong tập tin và thông tin về tập tin. Gõ SHIFT-G để chuyển tới một dòng trong tập tin. ** Chú ý: Đọc toàn bộ bài học này trước khi thực hiện bất kỳ bước nào!! 1. Giữ phím Ctrl và nhấn g . Một dòng thông tin xuất hiện tại cuối trang với tên tập tin và dòng mà bạn đang nằm trên. Hãy nhớ số dòng này Cho bước số 3. 2. Nhấn shift-G để chuyển tới cuối tập tin. 3. Gõ số dòng mà bạn đã nằm trên và sau đó shift-G. Thao tác này sẽ đưa bạn trở lại dòng mà con trỏ đã ở trước khi nhấn tổ hợp Ctrl-g. (Khi bạn gõ số, chúng sẽ KHÔNG hiển thị trên màn hình.) 4. Nếu bạn cảm thấy đã hiểu rõ, hãy thực hiện các bước từ 1 tới 3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bài 4.2: CÂU LỆNH TÌM KIẾM ** Gõ / và theo sau là cụm từ muốn tìm kiếm. ** 1. Trong chế độ Câu lệnh gõ ký tự / .Chú ý rằng ký tự này và con trỏ sẽ xuất hiện tại cuối màn hình giống như câu lệnh : . 2. Bây giờ gõ 'loiiiii' . Đây là từ bạn muốn tìm. 3. Để tìm kiếm cụm từ đó lần nữa, đơn giản gõ n . Để tìm kiếm cụm từ theo hướng ngược lại, gõ Shift-N . 4. Nếu bạn muối tìm kiếm cụm từ theo hướng ngược lại đầu tập tin, sử dụng câu lệnh ? thay cho /. ---> "loiiiii" là những gì không đúng lắm; loiiiii thường xuyên xảy ra. Chú ý: Khi tìm kiếm đến cuối tập tin, việc tìm kiếm sẽ tiếp tục từ đầu tập tin này. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bài 4.3: TÌM KIẾM CÁC DẤU NGOẶC SÁNH ĐÔI ** Gõ % để tìm kiếm ),], hay } . ** 1. Đặt con trỏ trên bất kỳ một (, [, hay { nào trong dòng có dấu --->. 2. Bây giờ gõ ký tự % . 3. Con trỏ sẽ di chuyển đến dấu ngoặc tạo cặp (dấu đóng ngoặc). 4. Gõ % để chuyển con trỏ trở lại dấu ngoặc đầu tiên (dấu mở ngoặc). ---> Đây là ( một dòng thử nghiệm với các dấu ngoặc (, [ ] và { } . )) Chú ý: Rất có ích khi sửa lỗi chương trình, khi có các lỗi thừa thiếu dấu ngoặc! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bài 4.4: MỘT CÁCH SỬA LỖI ** Gõ :s/cũ/mới/g để thay thế 'mới' vào 'cũ'. ** 1. Di chuyển con trỏ tới dòng có dấu --->. 2. Gõ :s/duou/ruou . Chú ý rằng câu lệnh này chỉ thay đổi từ tìm thấy đầu tiên trên dòng (từ 'duou' đầu dòng). 3. Bây giờ gõ :s/duou/ruou/g để thực hiện thay thế trên toàn bộ dòng. Lệnh này sẽ thay thế tất cả những từ ('duou') tìm thấy trên dòng. ---> duou ngon phai co ban hie. Khong duou cung khong hoa. 4. Để thay thế thực hiện trong đoạn văn bản giữa hai dòng, gõ :#,#s/cũ/mới/g trong đó #,# là số thứ tự của hai dòng. Gõ :%s/cũ/mới/g để thực hiện thay thế trong toàn bộ tập tin. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TỔNG KẾT BÀI 4 1. Ctrl-g vị trí của con trỏ trong tập tin và thông tin về tập tin. Shift-G di chuyển con trỏ tới cuối tập tin. Số dòng và theo sau là Shift-G di chuyển con trỏ tới dòng đó. 2. Gõ / và cụm từ theo sau để tìm kiếm cụm từ VỀ PHÍA TRƯỚC. Gõ ? và cụm từ theo sau để tìm kiếm cụm từ NGƯỢC TRỞ LẠI. Sau một lần tìm kiếm gõ n để tìm kiếm cụm từ lại một lần nữa theo hướng đã tìm hoặc Shift-N để tìm kiếm theo hướng ngược lại. 3. Gõ % khi con trỏ nằm trên một (,),[,],{, hay } sẽ chỉ ra vị trí của dấu ngoặc còn lại trong cặp. 4. Để thay thế 'mới' cho 'cũ' đầu tiên trên dòng, gõ :s/cũ/mới Để thay thế 'mới' cho tất cả 'cũ' trên dòng, gõ :s/cũ/mới/g Để thay thế giữa hai dòng, gõ :#,#s/cũ/mới/g Để thay thế trong toàn bộ tập tin, gõ :%s/cũ/mới/g Để chương trình hỏi lại trước khi thay thế, thêm 'c' :%s/cũ/mới/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 5.1: CÁCH THỰC HIỆN MỘT CÂU LỆNH NGOẠI TRÚ ** Gõ :! theo sau là một câu lệnh ngoại trú để thực hiện câu lệnh đó. ** 1. Gõ câu lệnh quen thuộc : để đặt con trỏ tại cuối màn hình. Thao tác này cho phép bạn nhập một câu lệnh. 2. Bây giờ gõ ký tự ! (chấm than). Ký tự này cho phép bạn thực hiện bất kỳ một câu lệnh shell nào. 3. Ví dụ gõ ls theo sau dấu ! và gõ . Lệnh này sẽ hiển thị nội dung của thư mục hiện thời, hoặc sử dụng lệnh :!dir nếu ls không làm việc. Chú ý: Có thể thực hiện bất kỳ câu lệnh ngoại trú nào theo cách này. Chú ý: Tất cả các câu lệnh : cần kết thúc bởi phím ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bài 5.2: GHI LẠI CÁC TẬP TIN ** Để ghi lại các thay đổi, gõ :w TÊNTỆPTIN. ** 1. Gõ :!dir hoặc :!ls để lấy bảng liệt kê thư mục hiện thời. Như bạn đã biết, bạn cần gõ để thực hiện. 2. Chọn một tên tập tin chưa có, ví dụ TEST. 3. Bây giờ gõ: :w TEST (trong đó TEST là tên tập tin bạn đã chọn.) 4. Thao tác này ghi toàn bộ tập tin (Hướng dẫn dùng Vim) dưới tên TEST. Để kiểm tra lại, gõ :!dir một lần nữa để liệt kê thư mục. Chú ý: Nếu bạn thoát khỏi Vim và quay trở lại với tên tập tin TEST, thì tập tin sẽ là bản sao của hướng dẫn tại thời điểm bạn ghi lại. 5. Bây giờ xóa bỏ tập tin (MS-DOS): :!del TEST hay (Unix): :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bài 5.3: CÂU LỆNH GHI CHỌN LỌC ** Để ghi một phần của tập tin, gõ :#,# w TÊNTẬPTIN ** 1. Gõ lại một lần nữa :!dir hoặc :!ls để liệt kê nội dung thư mục rồi chọn một tên tập tin thích hợp, ví dụ TEST. 2. Di chuyển con trỏ tới đầu trang này, rồi gõ Ctrl-g để tìm ra số thứ tự của dòng đó. HÃY NHỚ SỐ THỨ TỰ NÀY! 3. Bây giờ di chuyển con trỏ tới dòng cuối trang và gõ lại Ctrl-g lần nữa. HÃY NHỚ CẢ SỐ THỨ TỰ NÀY! 4. Để CHỈ ghi lại một phần vào một tập tin, gõ :#,# w TEST trong đó #,# là hai số thứ tự bạn đã nhớ (đầu,cuối) và TEST là tên tập tin. 5. Nhắc lại, xem tập tin của bạn có ở đó không với :!dir nhưng ĐỪNG xóa. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bài 5.4: ĐỌC VÀ KẾT HỢP CÁC TẬP TIN ** Để chèn nội dung của một tập tin, gõ :r TÊNTẬPTIN ** 1. Gõ :!dir để chắc chắn là có tệp tin TEST. 2. Đặt con trỏ tại đầu trang này. CHÚ Ý: Sau khi thực hiện Bước 3 bạn sẽ thấy Bài 5.3. Sau đó cần di chuyển XUỐNG bài học này lần nữa. 3. Bây giờ dùng câu lệnh :r TEST để đọc tập tin TEST, trong đó TEST là tên của tập tin. CHÚ Ý: Tập tin được đọc sẽ đặt bắt đầu từ vị trí của con trỏ. 4. Để kiểm tra lại, di chuyển con trỏ ngược trở lại và thấy rằng bây giờ có hai Bài 5.3, bản gốc và bản vừa chèn. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TỔNG KẾT BÀI 5 1. :!câulệnh thực hiện một câu lệnh ngoại trú Một vài ví dụ hữu ích: (MS-DOS) (Unix) :!dir :!ls - liệt kê nội dung một thư mục. :!del TÊNTẬPTIN :!rm TÊNTẬPTIN - xóa bỏ tập tin TÊNTẬPTIN. 2. :w TÊNTẬPTIN ghi tập tin hiện thời của Vim lên đĩa với tên TÊNTẬPTIN. 3. :#,#w TÊNTẬPTIN ghi các dòng từ # tới # vào tập tin TÊNTẬPTIN. 4. :r TÊNTẬPTIN đọc tập tin trên đĩa TÊNTẬPTIN và chèn nội dung của nó vào tập tin hiện thời sau vị trí của con trỏ. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bài 6.1: CÂU LỆNH TẠO DÒNG ** Gõ o để mở một dòng phía dưới con trỏ và chuyển vào chế độ Soạn thảo. ** 1. Di chuyển con trỏ tới dòng có dấu --->. 2. Gõ o (chữ thường) để mở một dòng BÊN DƯỚI con trỏ và chuyển vào chế độ Soạn thảo. 3. Bây giờ sao chép dòng có dấu ---> và nhấn để thoát khỏi chế độ Soạn thảo. ---> Sau khi gõ o con trỏ sẽ đặt trên dòng vừa mở trong chế độ Soạn thảo. 4. Để mở một dòng Ở TRÊN con trỏ, đơn giản gõ một chữ O hoa, thay cho chữ o thường. Hãy thử thực hiện trên dòng dưới đây. Di chuyển con trỏ tới dòng này, rồi gõ Shift-O sẽ mở một dòng trên nó. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bài 6.2: CÂU LỆNH THÊM VÀO ** Gõ a để chèn văn bản vào SAU con trỏ. ** 1. Di chuyển con trỏ tới cuối dòng đầu tiên có ký hiệu ---> bằng cách gõ $ trong chế độ câu lệnh. 2. Gõ a (chữ thường) để thêm văn bản vào SAU ký tự dưới con trỏ. (Chữ A hoa thêm văn bản vào cuối một dòng.) Chú ý: Lệnh này thay cho việc gõ i , ký tự cuối cùng, văn bản muốn chèn, , mũi tên sang phải, và cuối cùng, x , chỉ để thêm vào cuối dòng! 3. Bây giờ thêm cho đủ dòng thứ nhất. Chú ý rằng việc thêm giống hệt với việc chèn, trừ vị trí chèn văn bản. ---> Dong nay cho phep ban thuc hanh ---> Dong nay cho phep ban thuc hanh viec them van ban vao cuoi dong. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bài 6.3: MỘT CÁCH THAY THẾ KHÁC ** Gõ chữ cái R hoa để thay thế nhiều ký tự. ** 1. Di chuyển con trỏ tới cuối dòng đầu tiên có ký hiệu --->. 2. Đặt con trỏ tại chữ cái đầu của từ đầu tiên khác với dòng có dấu ---> tiếp theo (từ 'tren'). 3. Bây giờ gõ R và thay thế phần còn lại của dòng thứ nhất bằng cách gõ đè lên văn bản cũ để cho hai dòng giống nhau. ---> De cho dong thu nhat giong voi dong thu hai tren trang nay. ---> De cho dong thu nhat giong voi dong thu hai, go R va van ban moi. 4. Chú ý rằng khi bạn nhấn để thoát, đoạn văn bản không sửa đổi sẽ được giữ nguyên. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bài 6.4: THIẾT LẬP CÁC THAM SỐ ** Thiết lập một tùy chọn để việc tìm kiếm hay thay thế lờ đi kiểu chữ ** 1. Tìm kiếm từ 'lodi' bằng cách gõ: /lodi Lặp lại vài lần bằng phím n. 2. Đặt tham số 'ic' (Lodi - ignore case) bằng cách gõ: :set ic 3. Bây giờ thử lại tìm kiếm 'lodi' bằng cách gõ: n Lặp lại vài lần bằng phím n. 4. Đặt các tham số 'hlsearch' và 'incsearch': :set hls is 5. Bây giờ nhập lại câu lệnh tìm kiếm một lần nữa và xem cái gì xảy ra: /lodi 6. Để xóa bỏ việc hiện sáng từ tìm thấy, gõ: :nohlsearch ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TỔNG KẾT BÀI 6 1. Gõ o mở một dòng phía DƯỚI con trỏ và đặt con trỏ trên dòng vừa mở trong chế độ Soạn thảo. Gõ một chữ O hoa để mở dòng phía TRÊN dòng của con trỏ. 2. Gõ a để chèn văn bản vào SAU ký tự nằm dưới con trỏ. Gõ một chữ A hoa tự động thêm văn bản vào cuối một dòng. 3. Gõ một chữ R hoa chuyển vào chế độ Thay thế cho đến khi nhấn . 4. Gõ ":set xxx" sẽ đặt tham số "xxx" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bài 7: CÂU LỆNH TRỢ GIÚP ** Sử dụng hệ thống trợ giúp có sẵn ** Vim có một hệ thống trợ giúp đầy đủ. Để bắt đầu, thử một trong ba lệnh sau: - nhấn phím (nếu bàn phím có) - nhấn phím (nếu bàn phím có) - gõ :help Gõ :q để đóng cửa sổ trợ giúp. Bạn có thể tìm thấy trợ giúp theo một đề tài, bằng cách đưa tham số tới câu lệnh ":help". Hãy thử (đừng quên gõ ): :help w :help c_, 2005 Translator: Phan Vinh Thịnh , 2005 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim-7.4.1689/runtime/tutor/tutor.vim000066400000000000000000000121061267703067000173270ustar00rootroot00000000000000" Vim tutor support file " Author: Eduardo F. Amatria " Maintainer: Bram Moolenaar " Last Change: 2014 Jun 25 " This Vim script 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 = "" " Check that a potential value has at least two letters. " Ignore "1043" and "C". if exists("v:lang") && v:lang =~ '\a\a' let s:lang = v:lang elseif $LC_ALL =~ '\a\a' let s:lang = $LC_ALL elseif $LANG =~ '\a\a' 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" elseif s:lang =~ "Serbian" let s:ext = ".sr" elseif s:lang =~ "Czech" let s:ext = ".cs" elseif s:lang =~ "Dutch" let s:ext = ".nl" else let s:ext = "." . strpart(s:lang, 0, 2) endif endif 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 " 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.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.euc" endif endif " The Chinese tutor is available in three encodings, guess which one to use " This segment is from the above lines and modified by " Mendel L Chan for Chinese vim tutorial " When 'encoding' is utf-8, choose between China (simplified) and Taiwan " (traditional) based on the language, suggested by Alick Zhao. if s:ext =~? '\.zh' if &enc =~ 'big5\|cp950' let s:ext = ".zh.big5" elseif &enc != 'utf-8' let s:ext = ".zh.euc" elseif s:ext =~? 'zh_tw' || (exists("s:lang") && s:lang =~? 'zh_tw') let s:ext = ".zh_tw" else let s:ext = ".zh_cn" endif endif " The Polish tutor is available in two encodings, guess which one to use. if s:ext =~? '\.pl' if &enc =~ 1250 let s:ext = ".pl.cp1250" endif endif " The Turkish tutor is available in two encodings, guess which one to use if s:ext =~? '\.tr' if &enc == "iso-8859-9" let s:ext = ".tr.iso9" endif endif " The Greek tutor is available in three encodings, guess what to use. " We used ".gr" (Greece) instead of ".el" (Greek); accept both. if s:ext =~? '\.gr\|\.el' if &enc == "iso-8859-7" let s:ext = ".el" elseif &enc == "utf-8" let s:ext = ".el.utf-8" elseif &enc =~ 737 let s:ext = ".el.cp737" endif endif " The Slovak tutor is available in three encodings, guess which one to use if s:ext =~? '\.sk' if &enc =~ 1250 let s:ext = ".sk.cp1250" endif endif " The Slovak tutor is available in two encodings, guess which one to use " Note that the utf-8 version is the original, the cp1250 version is created " from it. if s:ext =~? '\.sr' if &enc =~ 1250 let s:ext = ".sr.cp1250" endif endif " The Czech tutor is available in three encodings, guess which one to use if s:ext =~? '\.cs' if &enc =~ 1250 let s:ext = ".cs.cp1250" endif endif " The Russian tutor is available in three encodings, guess which one to use. if s:ext =~? '\.ru' if &enc =~ '1251' let s:ext = '.ru.cp1251' elseif &enc =~ 'koi8' let s:ext = '.ru' endif endif " The Hungarian tutor is available in three encodings, guess which one to use. if s:ext =~? '\.hu' if &enc =~ 1250 let s:ext = ".hu.cp1250" elseif &enc =~ 'iso-8859-2' let s:ext = '.hu' endif endif " The Croatian tutor is available in three encodings, guess which one to use. if s:ext =~? '\.hr' if &enc =~ 1250 let s:ext = ".hr.cp1250" elseif &enc =~ 'iso-8859-2' let s:ext = '.hr' endif endif " Esperanto is only available in utf-8 if s:ext =~? '\.eo' let s:ext = ".eo.utf-8" endif " Vietnamese is only available in utf-8 if s:ext =~? '\.vi' let s:ext = ".vi.utf-8" endif " If 'encoding' is utf-8 s:ext must end in utf-8. if &enc == 'utf-8' && s:ext !~ '\.utf-8' let s:ext .= '.utf-8' 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 vim-7.4.1689/runtime/tutor/tutor.zh.big5000066400000000000000000000574461267703067000200220ustar00rootroot00000000000000=============================================================================== = w \ Ū m V I M { n ww 1.5 = =============================================================================== vim O@Ө㦳ܦhRO\D`jjs边C_gTAbе{ NԲӤФFCе{]pؼЬOz@ǥn򥻩ROAӴxno ǩROAzNܮeNvim@@ӳqΪUs边ӨϥΤFC е{ejݭn25-30AM_zVmɶC C@`ROާ@N|糧C˱z_媺@ӰƥAMbƥW iVm(pGzOqL"vimtutor"ӱҰʱе{A򥻤NwgOƥF)C O@IJе{]pObϥΤiDzߪC]NOAzݭnqL ROӾDzߥ̥TΪkCpGzuO\ŪӤާ@Azi |ܧֿѳoǩROI nFA{bнTwzShift-Lock(jpgw)٨SUAMLW r j hƨӲʥСAĤ@`eR̹C ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ĥ@Ĥ@`Jʥ nʥСAШ̷ӻOU hBjBkBl C ^ k ܡJ h _ACUN|VʡC < h l > l _kACUN|VkʡC j j ݰ_ӫܶH@yݤV¤UbYC v 1. HNb̹ʥСAܱzıoΪAC 2. UU(j)AX{Э_UC ---> {bzӤwgǷ|p󲾰ʨU@aC 3. {bШϥΤUANвʨĤGC ܡJpGzTwzҫUrAЫU^쥿`(Normal)ҦC MAqLJzQnROC ܡJ]ॿ`u@COϥhjklAbߺDzNֳt ab̹|BʥФFC ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ĥ@ĤG`JVIMiJMhX !! SOܡJqо\Ū㥻@`eAM~HUѪROC 1. Ы(oOFTOzBb`Ҧ)C 2. MJJ :q! <^> ---> oؤ覡hXs边|OsziJs边HөҰʡC pGzQOsAhXAпJJ :wq <^> 3. pGzݨFRO洣ܲšAпJaz^쥻е{ROANOJ vimtutor <^> q`pUz]iHγoؤ覡J vim tutor <^> ---> o̪ 'vim' ܶiJvims边A 'tutor'hOzdzƭns誺C 4. pGz۫HwgccOFoǨBJܡAбqBJ1BJ3hXAM AiJs边C۱NвʨĤ@ĤT`~ڭ̪е{ѡC ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ĥ@ĤT`J奻s褧R ** b`(Normal)ҦUAiHU x ӧRЩҦbmršC** 1. бNвʨ쥻`UаO ---> @C 2. FץJ~AбNвܷdzƧRrŪmBC 3. MU x N~rŧRC 4. _BJ2BJ4AylץC ---> The ccow jumpedd ovverr thhe mooon. 5. nFAӦwgץFAU@`eOĤ@ĥ|`C SOܡJbzsе{ɡAnjOСCO@IJbϥΤDzߡC ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ĥ@ĥ|`J奻s褧J ** b`ҦUAiHU i ӴJ奻C** 1. бNвʨ쥻`UаO ---> Ĥ@C 2. FϱoĤ@椺epP_ĤGAбNвܤ奻Ĥ@ӦrŷdzƴJ mC 3. MU i AۿJn奻ršC 4. Ҧ奻ץAЫU ^`ҦC _BJ2ܨBJ4HKץylC ---> There is text misng this . ---> There is some text missing from this line. 5. pGz奻Jާ@wgܺNAб۾\ŪUpC ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ĥ@p 1. Цb̹奻ʬJiHνbYA]iHϥ hjkl rC h () j (U) k (W) l (k) 2. iJvims边(qRO洣ܲ)AпJJvim W <^> 3. hXvims边AпJHUROҦקJ :q! <^> Ϊ̿JHUROOsҦקJ :wq <^> 4. b`ҦURЩҦbmršAЫJ x 5. b`ҦUnbЩҦbm}lJ奻AЫJ i Jn奻 SOܡJU |az^쥿`ҦΪ̨@ӤΪ̳ ROC nFAĤ@즹CUU~ĤGeC ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ĤGĤ@`JRRO ** J dw iHqгBRܤ@ӳr/C** 1. ЫU TOzB_`ҦC 2. бNвʨ쥻`UаO ---> @C 3. бNвܷdzƭnR}lC 4. ۿJ dw RӳC SOܡJzҿJ dw |bzJPɥX{b̹̫@CpGz J~AЫU AM᭫sAӡC ---> There are a some words fun that don't belong paper in this sentence. 5. _BJ3ܨBJ4AܥylץC~ĤGĤG`eC ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ĤGĤG`JLRRO ** J d$ qeЧR楽C** 1. ЫU TOzB_`ҦC 2. бNвʨ쥻`UаO ---> @C 3. бNвʨӦ檺(]NObĤ@I.᭱)C 4. MJ d$ qгBRܷeC ---> Somebody typed the end of this line twice. end of this line twice. 5. ~Dz߲ĤGĤT`NDO^ƤFC ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ĤGĤT`J_ROMH RRO d 榡pUJ [number] d object Ϊ d [number] object NpUJ number - NRO(iﶵAʬٳ]m 1 )C d - NRC object - NROҭnާ@H(U)C @²uHCJ w - qeзemr/A]AŮC e - qeзemr/AO ** ]AŮC $ - qeзeme楽C SOܡJ _i_̡AЦb`ҦUȫNHӤϥΩROAh NݨЪʥpWHCҥN@ˡC ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ĤGĥ|`JHROSp ** J dd iHR@ӷeC ** ų_RWסAVIM ]p̨Mwn²ƾRAȻݭnbP@W ⦸ d NiHRЩҦbFC 1. бNвʨ쥻`UuyqĤGC 2. J dd RӦC 3. MᲾʨĥ|C 4. ۿJ 2dd (ٰOoeL number-command-object ܡH) RC 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Ĥ`JMRO ** J u ӺM̫檺ROAJ U ӭץC** 1. бNвʨ쥻`UаO ---> @AñNm_Ĥ@ӿ~ BC 2. J x RĤ@ӤQOdrC 3. MJ u M̫檺(@)ROC 4. onϥ x ץ檺Ҧ~C 5. {bJ@Ӥjg U A_Ӧ檺lAC 6. ۦhJ u HM U HΧeROC 7. MhJ CTRL-R (U CTRL 䤣}AۿJ R ) Ao˴N iH_ROA]NOMMROC ---> Fiix the errors oon thhis line and reeplace them witth undo. 8. odzOD`ΪROCUOĤGpFC ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ĤGp 1. qeЧRܳr/AпJJdw 2. qeЧRܷe楽AпJJd$ 3. RAпJJdd 4. b`ҦU@өRO榡OJ [number] command object Ϊ command [number] object NOJ number - NORO檺 command - NnƱAp d NR object - Nnާ@HAp w Nr/A$ N楽C $ (to the end of line), etc. 5. MHeާ@AпJJu (pgu) Mb@椤ҰʡAпJJU (jgU) MHeMROA_Heާ@GAпJJCTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ĤTĤ@`JmJRO ** J p N̫@RemJФ ** 1. бNвʨ쥻`UܭSqC 2. J dd NӦRAo˷|NӦOsvimwRϤC 3. ۱NвʨdzƸmJmWCOJOW@C 4. Mb`ҦU(iJ)AJ p NӦ߶KmJC 5. _BJ2ܨBJ4ANҦ̧ǩm쥿TmWC d) Can you learn too? b) Violets are blue, c) Intelligence is learned, a) Roses are red, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ĤTĤG`JRO ** J r M@ӦrŴЩҦbmršC** 1. бNвʨ쥻`UаO ---> Ĥ@C 2. вʥШĤ@ӿ~AmC 3. ۿJ r Ao˴NN~FC 4. _BJ2MBJ3AĤ@wgק粒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 SOܡJOznbϥΤDzߡAӤObOФDzߡC ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ĤTĤT`JRO ** nܤ@ӳr/Ϊ̥AпJ cw ** 1. бNвʨ쥻`UаO ---> Ĥ@C 2. ۧЩb lubw r u m̡C 3. MJ cw NiHץӳF(bҳo̬OJ ine C) 4. ̫ AMЩwU@ӿ~Ĥ@ӷdzƧ諸rBC 5. _BJ3MBJ4AĤ@ӥylpPĤGӥylC ---> 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 ROȶȬOF@ӳA]ziJ奻JAFC ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ĤTĥ|`JϥcOLRO ** OiHϥΦPRROҨϥΪHѼơC** 1. Ou@覡RROO@PCާ@榡OJ [number] c object Ϊ c [number] object 2. HѼƤ]O@˪Ap w Nr/A$N楽C 3. бNвʨ쥻`UаO ---> Ĥ@C 4. ۱NвʨĤ@ӿ~BC 5. MJ c$ ϱoӦѤU󥿱oPĤG@ˡC̫ 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. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ĤTp 1. nsmJwgR奻eAпJpgr pCӾާ@iHNwR 奻em_ФCpG̫@RO@ӾAӦNm _eЩҦb檺U@C 2. nЩҦbmršAпJpg r MnmrŪsr ŧYiC 3. RO\zܫwHAqeЩҦbmHC pJ cw iHeШeFJ c$ iH eШ楽eC 4. RO榡OJ [number] c object Ϊ c [number] object Uڭ~DzߤU@C ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ĥ|Ĥ@`JwΤ󪬺A ** J CTRL-g ܷes󤤷eЩҦbmHΤ󪬺AHC J SHIFT-G h󤤪Y@wC** ܡJOnqŪ`eA~iHHUBJ!!! 1. U CTRL 䤣}M g CMN|ݨ쭶̩X{@ӪAH AܪeOes誺WM`ơCаOBJ3渹C 2. U SHIFT-G iHϱoeЪ̫@C 3. Jzd渹AMU SHIFT-GCo˴NiH^zĤ@U CTRL-g ɩҦbnFC`NJJ渹ɡA渹O|b̹WܥX C 4. pG@NAziH~BJ1ܨBJTC ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ĥ|ĤG`JjRO ** J / HΧHrŦiHΥHbe󤤬dӦrŦC** 1. b`ҦUJ / ršCzɷ|`NӦrũMг|X{b̹ Ao : ROO@˪C 2. ۿJ errroor <^>CerrroorNOznd䪺rŦC 3. ndPW@rŦAuݭn n CnVۤϤVdPW@r ŦAпJ Shift-N YiC 4. pGzQfVdrŦAШϥ ? N / iC ---> 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. ܡJpGdwgF󥽧Ad|۰ʱqY~dC ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ĥ|ĤT`JtAd ** % iHdt諸A )B]B}C** 1. Щb`UаO --> @椤@ (B[ { BC 2. ۫ % ršC 3. ɥЪmObt諸ABC 4. A % NiH^t諸Ĥ@ӬABC ---> This ( is a test line with ('s, ['s ] and {'s } in it. )) ܡJb{ǽոծɡAoӥ\ΨӬd䤣t諸AOܦΪC ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ĥ|ĥ|`Jץ~k@ ** J :s/old/new/g iH old newC** 1. бNвʨ쥻`UаO ---> @C 2. J :s/thee/the <^> CЪ`NөROuܥЩҦb檺Ĥ@Ӥǰt C 3. J :s/thee/the/g hO檺ǰtC ---> the best time to see thee flowers is in thee spring. 4. n椧X{CӤǰtAпJ :#,#s/old/new/g (#,#NO 檺渹)CJ :%s/old/new/g hOӤ󤤪CӤǰtC ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ĥ|p 1. Ctrl-g Τ_ܷeЩҦbmM󪬺AHCShift-G Τ_Nи ܤ̫@CVJ@Ӧ渹M Shift-G hONвʦܸӦ NC 2. J / MH@ӦrŦOhObeҽs誺ɤVdӦrŦC Jݸ ? MH@ӦrŦOhObeҽs誺ɤVedӦr ŦC@d䤧 n hO_W@ROAibP@VWd U@ӦrŦҦbFΪ̫ Shift-N VۤϤVdUӦrŦҦbC 3. pGзemOA(B)B[B]B{B}A % iHNвʨt諸 AWC 4. b@椺Y@ӦrŦ old srŦ newAпJ :s/old/new b@椺ҦrŦ old srŦ newAпJ :s/old/new/g b椺ҦrŦ old srŦ newAпJ :#,#s/old/new/g b󤺴ҦrŦ old srŦ newAпJ :%s/old/new/g iɸ߰ݥΤT{CӴݲK[ c ﶵAпJ :%s/old/new/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ĤĤ@`Jb VIM ~ROk ** J :! MHۿJ@ӥ~ROiHӥ~ROC** 1. Uڭ̩Ҽx : RO]mШ̹Co˴NiHzJROFC 2. ۿJPĸ ! oӦršAo˴N\z~ shell ROFC 3. ڭ̥H ls ROҡCJ !ls <^> CөRON|C|Xzeؿ eANpPzbRO洣ܲŤUJ ls ROG@ˡCpG !ls S_ @ΡAziHո :!dir ݬݡC ---> ܡJ Ҧ~ROiHHoؤ覡C ---> ܡJ Ҧ : ROH <^> iסC ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ĤĤG`J_Os󪺧hH ** nN󪺧ʫOs󤤡AпJ :w FILENAME ** 1. J :!dir Ϊ :!ls 򪾷eؿeCzwD̫ٱoV <^> aC 2. ܤ@ө|sbWAp TEST C 3. ۿJ :w TEST (B TEST OzҿܪWC) 4. өRO|H TEST WOsӤ (VIM е{)CFTOTOsA ЦAJ :!dir dݱzؿCeC ---> Ъ`NJpGzhX VIM MbHW TEST ѼƶiJAӤ eӦPzOsɪ󤺮eO@˪C 5. {bziHqLJ :!rm TEST ӧR TEST FC ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ĤĤT`J@Ө㦳ܩʪOsRO ** nOs󪺳eAпJ :#,# w FILENAME ** 1. AӰ@ :!dir Ϊ :!ls 򪾷eؿeAMܤ@ӦXA WWAp TEST C 2. ۱Nвʦܥ̳ݡAM CTRL-g Ӧ檺渹COѤF 渹@C 3. ۧвʦܥ̩ݡAA@ CTRL-g C]OѤFoӦn@C 4. FuOs峹YӳAпJ :#,# w TEST Co̪ #,# NOW nDzO渹(ݦ渹,ݦ渹)A TEST NOwWC 5. ̫A :!dir T{O_TOsCOoORC ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ĥĥ|`JMXä ** nVe󤤴Jt~󪺤eAпJ :r FILENAME ** 1. J :!dir T{zeЫت TEST ٦bC 2. MNвʦܷeݡC SOܡJ BJ3zNݨĤĤT`AЩɦAUʦ^ǫӡC 3. ۳qL :r TEST NeЫتW TEST 󴣨iӡC SOܡJzҴiӪNqЩҦbmB}lmJC 4. FT{wg\AʥЦ^ӪmNiH`N ĤT`A@O쥻At~@OӦۤ󪺰ƥC ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ĥp 1. :!command Τ_@ӥ~RO commandC Ьݤ@ǹڨҤlJ :!dir - Τ_ܷeؿeC :!rm FILENAME - Τ_RW FILENAME C 2. :w FILENAME iNe VIM bs誺OsW FILENAME 󤤡C 3. :#,#w FILENAME iNes # ܲ # 檺eOs FILENAME C 4. :r FILENAME iϽL FILENAME ñN䴡Je󪺥Цm ᭱C ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ĤĤ@`J}RO ** J o NbЪU襴}s@öiJJҦC** 1. бNвʨ쥻`UаO ---> @C 2. ۿJpg o b *U* }s@öiJJҦC 3. M_аO ---> ë hXJҦӶiJ`ҦC ---> After typing o the cursor is placed on the open line in Insert mode. 4. Fb *W* }s@AuݭnJjg O ӤOpg o NiHFCЦbUդ@UaCгBbbӦWɡA Shift-OiH bӦWs}@C Open up a line above this by typing Shift-O while the cursor is on this line. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ĤĤG`JЫᴡJRO ** J a NibФᴡJ奻C ** 1. Цb`ҦUqLJ $ Nвʨ쥻`UаO ---> Ĥ@ C 2. ۿJpg a hibФᴡJ奻FCjg A hiHb J奻C ܡJJjg A ާ@kiHb楽J奻AקKFJ iAЩw ̫@ӦršAJ奻A ^_`ҦAbYk䲾ʥХH x ReЩҦbmrŵѦhcާ@C 3. ާ@Ĥ@NiHɥRFCЪ`NЫᴡJ奻PJҦO @PAuO奻JmwyP}FC ---> This line will allow you to practice ---> This line will allow you to practice appending text to the end of a line. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ĤĤT`Jt~@ӸmRO ** Jjg R ishӦršC** 1. бNвʨ쥻`UаO ---> Ĥ@C 2. ʥШĤ@椤P_Ц ---> ĤG檺Ĥ@ӳ}lAY last BC 3. MJjg R }lĤ@椤P_ĤG檺ѧErųv@JAN iH즳rŦӨϱoĤ@槹pPĤGFC ---> 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. Ъ`NJpGz hXmҦ^_`ҦA|奻N MO쪬C ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ĥĥ|`J]mROﶵ ** ]miϬdΪ̴ijpgﶵ ** 1. nd ignore ib`ҦUJ /ignore Cn_dӵAiH _ n C 2. M]m ic ﶵ(icNO^婿jpgIgnore CaserYg)AY JJ :set ic 3. {biHqLJ n Ad ignoreC_diH_J n C 4. M]m hlsearch M incsearch oӿﶵAJHUeJ :set hls is 5. {biHAJdROAݬݷ|ĪGJ /ignore ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ĥp 1. Jpg o iHbФU襴}s@ñNиm_s}歺AiJ JҦC Jjg O iHbФW襴}s@ñNиm_s}歺AiJ JҦC 2. Jpg a iHbЩҦbmᴡJ奻C Jjg A iHbЩҦb檺楽ᴡJ奻C 3. Jjg R NiJҦAܫ hXҦӶiJ` ҦC 4. J :set xxx iH]m xxx ﶵC ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ĤCJbuURO ** ϥΦbuUt ** Vim ֦@ӲӭPbuUtΡCnҰʸUtΡAпܦpUTؤ k@J - U (pGLW) - U (pGLW) - J :help <^> J :q <^> iHUfC Ѥ@ӥTѼƵ":help"ROAziH_ӥDDUCиH UѼ(iOѤF^@C:)J :help w <^> :help c_ :help insert-index <^> :help user-manual <^> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ĤKJЫؤ@ӱҰʸ} ** ҥvim\ ** Vim\SʭnvihohAj\ೣSʬٿECFҰʧh \AzoЫؤ@vimrcC 1. }lsvimrcAoM_zҨϥΪާ@tΡJ :edit ~/.vimrc oOUnixtΩҨϥΪRO :edit $VIM/_vimrc oOWindowstΩҨϥΪRO 2. ۾ɤJvimrcSҤJ :read $VIMRUNTIME/vimrc_example.vim 3. OsAROJ :write bUzҰvimɭԡAs边N|FykG\CziH~z w䥦\]mK[ovimrc󤤡C ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim е{즹Cе{uOF²aФ@Uvims边AwHz ܮeǷ|ϥΥs边FCeáAvim٦ܦhܦhROAе{Ҥ Ъٮto۩OCҥHznqܡAٱ~VO@CU@BziH\Ū vimUAϥΪROOJ :help user-manual Fi@BѦҩMDzߡAHUoѭȱoˡJ Vim - Vi Improved - @̡JSteve Oualline XJNew Riders oOĤ@vimyC_Ǫ̯SOΡC䤤٥]tjq MϥܡCԱAгX http://iccf-holland.org/click5.html HUoѤѤFӥBeDnOviӤOvimAO]ȱoˡJ Learning the Vi Editor - @̡JLinda Lamb XJO'Reilly & Associates Inc. oO@ѡAqLzXGFѨvi쪺ƱCѪ Ӫ]]tF@_vimHC е{OѨӦCalorado School of MineseMichael C. PierceBRobert K. Ware ҽsgA䤤ӦColorado State UniversityCharles SmithѤF ܦhзNCs̳qHa}OJ bware@mines.colorado.edu е{wBram MoolenaarMvimi׭qC Ķ̪J =========== ²餤е{½ĶĶ̬ A٦ t~@pta}Jlinuxrat@gnuchina.orgC c餤е{Oq²餤е{½Ķϥ Debian GNU/Linux 嶵ؤp ժ_sͽsg~rX autoconvert ഫӦAù GF@DzӸ`ʡC ܧOJ ========= 2002~0830 P RMS@SMTH ANhB~ץC 2002~0422 P xuandong@sh163.net ANBOrץC 2002~0318 ھBram Moolenaarͦb2002~0316骺ӫHnDANvimtutor1.4Ķ ɯŨvimtutor1.5C 2001~1115 Nvimtutor1.4Ķ浹Bram MoolenaarMSven GuckesC ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim-7.4.1689/runtime/tutor/tutor.zh.euc000066400000000000000000000725331267703067000177420ustar00rootroot00000000000000=============================================================================== = ӭ V I M 汾 1.7 = =============================================================================== Vim һкܶĹܷdzǿı༭ƪڱ̵̳ Ͳϸˡ̵̳ĿǽһЩҪĻպ Щܹ׵ؽ Vim һͨñ༭ʹˡ ɱ̵̳ݴԼҪ25-30ӣȡѵʱ䡣 ע⣺ ÿһڵıġƼƱĵһȻڸ ѵ(ͨ"vimtutor"̵̳ģôľѾǸ) мһ㣺̵̳˼·ʹнѧϰġҲ˵Ҫͨ ִѧϰDZȷ÷ֻĶô ܿЩģ ˣȷShift-Lock(Сд)ûа£Ȼ󰴼 ĸ j 㹻ƶֱ꣬һڵܹȫĻ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ һһڣƶ ** Ҫƶ꣬˵ֱ hjkl ** ^ k ʾ h ļλߣÿΰ¾ͻƶ < h l > l ļλұߣÿΰ¾ͻƶ j j һ֧˷µļͷ v 1. Ļƶֱ꣬Ϊֹ 2. м(j)ֱֹظС ---> ӦѾѧƶһɡ 3. ʹмƶһڶڡ ʾȷµĸ밴ص(Normal)ģʽ ȻٴδӼҪ ʾӦҲġʹhjklϰܹ֮ ĻĴƶꡣ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ һڶڣVIMĽ˳ !! رʾĶһڵݣȻִ 1. (Ϊȷģʽ) 2. Ȼ룺 :q! <س> ַʽ˳༭ᶪ༭ĸĶ 3. ʾܹص̵̳Ǿǣ vimtutor <س> 4. ѾμסЩĻӲ1ִе3˳Ȼ ٴν༭ ʾ :q! <س> ᶪκθĶ֮ѧαĶļ 5. Ƶһڡ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ һڣı༭֮ɾ ** (Normal)ģʽ£԰ x ɾλõַ** 1. 뽫ƶ ---> һС 2. Ϊ뽫׼ɾַλô 3. Ȼ x ַɾ 4. ظ24ֱΪֹ ---> The ccow jumpedd ovverr thhe mooon. 5. ˣѾˣǵһĽڡ رʾ̳ʱҪǿм䡣סһ㣺ʹѧϰ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ һĽڣı༭֮ ** ģʽ£԰ i ı** 1. 뽫ƶ ---> ĵһС 2. ΪʹõһͬڵڶУ뽫ıһ׼ַ λá 3. Ȼ i Ҫıַ 4. ÿϺ밴 ģʽ ظ24Աӡ ---> There is text misng this . ---> There is some text missing from this line. 5. ıѾ⣬Ķĵһڡ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ һڣı༭֮ ** A ı ** 1. ƶ굽һ ---> һС һеĸַϲҪ 2. A Ҫݡ 3. ıϺ󣬰 صģʽ 4. ƶ굽ڶ ---> һСظ2Ͳ3Ըӡ ---> There is some text missing from th There is some text missing from this line. ---> There is also some text miss There is also some text missing here. 5. ıеʱѧϰһڡ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ һڣ༭ļ ** ʹ :wq Աļ˳ ** رʾִ²֮ǰȶСڣ 1. ڵһڶ˳̳̣ :q! ߣԷһնˣִ² 2. shell ʾ vim tutor <س> 'vim' Vim ༭'tutor'ϣ༭ļ֡ ʹһԸĶļ 3. ʹǰĽ̳ѧɾı 4. Ķļ˳ VimЩ :wq <س> 5. ڲ1Ѿ˳ vimtutor vimtutor ƶСһڡ 6. Ķϲ裬Ūǵ壬Ȼʵнϰ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ һС 1. ĻıеƶȿüͷҲʹ hjkl ĸ h () j () k () l () 2. Vim ༭(ʾ)룺vim ļ <س> 3. ˳ Vim ༭ :q! <س> иĶ :wq <س> Ķ 4. ģʽɾλõַ밴 x 5. ı룺 i ı ڹǰı A ı һкı رʾ صģʽ߳һ򲿷  ˣһ˽ڶݡ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ڶһڣɾ ** dw Դӹ괦ɾһʵĩβ** 1. 밴 ȷģʽ 2. 뽫ƶ ---> һС 3. 뽫׼Ҫɾĵʵʼ 4. dw ɾõʡ رʾʱĸ d ͬʱĻһСVim ڵȴ ĸ wdz d ַDZˣ밴 Ȼ ---> There are a some words fun that don't belong paper in this sentence. 5. ظ3Ͳ4ֱϡżڶڶݡ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ڶڶڣɾ ** d$ ӵǰɾĩ** 1. 밴 ȷģʽ 2. 뽫ƶ ---> һС 3. 뽫ƶеβ(Ҳڵһš.) 4. Ȼ d$ ӹ괦ɾǰβ ---> Somebody typed the end of this line twice. end of this line twice. 5. ѧϰڶھ֪ôˡ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ڶڣͶ ııһһɡ ʹɾ d ɾĸʽ£ d motion У d - ɾ motion - IJ(г) һ̵Ķб w - ӵǰ굱ǰλֱһʼĵһַ e - ӵǰ굱ǰλֱĩβһַ $ - ӵǰ굱ǰλֱǰĩ de ӵǰλɾĩβ رʾ ̽ߣģʽӦļʹò ƶĶбһ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ڶĽڣʹüָ ** ڶǰֻʹظôΡ ** 1. ƶ굽 ---> һеĿʼ 2. 2w ʹǰƶʡ 3. 3e ʹǰƶʵĩβ 4. 0 () ƶ굽ס 5. ظ2Ͳ3Բͬ֡ ---> This is just a line with words you can move around in. 6. ѧϰڶڡ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ڶڣʹüɾ ** ʹòʱֿʹظôΡ ** ѾᵽɾͶϣж֮ǰһ ɾࣺ d number() motion 1. ƶ굽 ---> һеһдĸϡ 2. d2w ɾдĸʡ 3. ظ1Ͳ2ʹòͬʹһɾȫڵĴдĸ ---> this ABC DE line FGHI JK LMN OP of words is Q RS TUV cleaned up. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ڶڣ ** 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. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ڶ߽ڣ ** 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. ظһǰһ֣2w 5. ģʽ޸ĸʽǣ operator [number] motion У operator - Ҫ飬 d ɾ [number] - Ըӵ֣ظĴ motion - ıϵƶ w (word) $ ĩȵȡ 6. ƶ굽ף밴00 7. ǰIJ룺u (Сдu) һĸĶ룺U (дU) ǰijָǰIJ룺CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ һڣ ** p һɾ֮ ** 1. 뽫ƶһ ---> һС 2. dd ɾὫб浽 Vim һĴС 3. Žƶ c) һУ׼λõϷסϷŶ 4. Ȼģʽ() p ճ롣 5. ظ24еõȷλϡ ---> 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. ȻǼѧϰڡ رʾмҪʹѧϰڼѧϰ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ڣ ** Ҫııֱһʵĩβ ce ** 1. 뽫ƶ ---> ĵһС 2. Űѹڵ lubw ĸ u λ 3. Ȼ cw Լȷĵ(ڱ ine ) 4. Ȼ궨λһһ׼ĵĸ 5. ظ3Ͳ4ֱһȫͬڶӡ ---> This lubw has a few wptfd that mrrf changing usf the change operator. ---> This line has a few words that need changing using the change operator. ʾע ce ɾһʣҲģʽˡ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ľڣʹcĸ ** ɾʹõͬĶʹá ** 1. Ĺʽɾһµġʽǣ c [number] motion 2. (motion)Ҳһģ w ʣ$ĩȵȡ 3. 뽫ƶ ---> ĵһС 4. Žƶһ󴦡 5. Ȼ c$ ʹøʣµIJָͬڶһ ---> 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. ıӵǰλֱָʾλмı ce 滻ǰ굽ʵĩβݣ c$ 滻 ǰ굽ĩݡ 4. ĸʽǣ c [number] motion Ǽѧϰһ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ľһڣλļ״̬ ** CTRL-G ʾǰ༭ļеǰλԼļ״̬Ϣ д G ֱתļеijһָС** ʾмҪͨݣ֮ſִ²!!! 1. CTRL ſȻ g dzΪ CTRL-G ῴҳײһ״̬ϢУʾǵǰ༭ļ ļйλáסкţڲ3õ ʾҲϽǿλã 'ruler' ѡʱ (μ :help 'ruler') 2. д G ʹõǰֱתļһС gg ʹõǰֱתļһС 3. ͣкţȻд GͿԷصһΰ CTRL-G ʱڵˡ 4. ûĻִв13IJϰ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ľڶڣ ** / һַڵǰļвҸַ** 1. ģʽ / ַʱע⵽ַ͹궼Ļ : һġ 2. errroor <س>ǸerrroorҪҵַ 3. ҪͬһεַֻҪ n Ҫ෴ͬһε д N ɡ 4. ַʹ ? / С 5. Ҫص֮ǰλð CTRL-O (ס Ctrl ͬʱĸ o)ظ ˸ಽCTRL-I תµλá ---> "errroor" is not the way to spell error; errroor is an error. ʾѾļĩβһԶļͷң 'wrapscan' ѡλ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ĽڣŵIJ ** % ԲԵ )]}** 1. ѹڱ --> һеκһ ([ { 2. Ű % ַ 3. ʱλӦԵŴ 4. ٴΰ % ͿԵĵһŴ 5. ƶ굽һ ()[]{ } % 鿴Ϊ ---> 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 滻ȫеƥ䴮е "thee" ᱻ ı䡣 ---> thee best time to see thee flowers is in thee spring. 4. Ҫ滻ֵ֮ÿƥ䴮 :#,#s/old/new/g #,# 滻 βекš :%s/old/new/g 滻ļеÿƥ䴮 :%s/old/new/gc ҵļеÿƥ䴮Ҷÿƥ䴮 ʾǷ滻 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ĽС 1. CTRL-G ʾǰλúļ״̬Ϣ G ڽתļһС һкȻд G ǽƶкŴС gg ڽתļһС 2. / Ȼһַڵǰ༭ĵҸַ ? Ȼһַڵǰ༭ĵзҸַ һβ֮ n ظһεͬһϲ һƥַڣ߰д N ෴һƥַڡ CTRL-O תؽϾɵλãCTRL-I µλá 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 :!ls 鿴Ŀ¼бݡ ע⣺˳ Vim Ȼ vim TEST ٴ Vimôļ Ӧͬʱļȫһġ 5. ɾ TEST ļˡ MS-DOS £룺 :!del TEST Unix £룺 :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 彲ڣһѡԵı ** ҪļIJݣ v motion :w FILENAME ** 1. ƶ굽С 2. Ű v ƶĿϡע⵽֮ıˡ 3. Ȼ : ַĻײ :'<,'> 4. w TEST TEST һδʹõļȷ :'<,'>w TEST ֮ <س> 5. ʱ Vim ѡед뵽 TEST ļȥʹ :!dir :!ls ȷļȷ档ȱɾһлõ ʾ v ʹ Vim ģʽѡȡĴƶʹѡȡ Сʹһѡıв磬 d ɾ ѡеıݡ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 彲Ľڣȡͺϲļ ** Ҫǰļвļݣ :r FILENAME ** 1. ѹƶһС رʾִв2֮彲ڵ֣ʱƶ ٴοݡ 2. ͨ :r TEST ǰ洴Ϊ TEST ļȡ ȡļӹλôʼ롣 3. ΪȷļѾȡɹƶصԭλþͿעݵ 彲ڵݣһԭʼݣһļĸ ʾԶȡⲿ磬 :r !ls Զȡ ls ڹ档 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 彲С 1. :!command ִһⲿ command 뿴һЩʵӣ (MS-DOS) (Unix) :!dir :!ls - ʾǰĿ¼ݡ :!del FILENAME :!rm FILENAME - ɾΪ FILENAME ļ 2. :w FILENAME ɽǰ VIM ڱ༭ļ浽Ϊ FILENAME С 3. v motion :w FILENAME ɽǰ༭ļпģʽѡеݱ浽ļ FILENAME С 4. :r FILENAME ȡļ FILENAME 뵽ǰļĹλ 档 5. :r !dir Զȡ dir õǰļĹλú档 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ һڣ ** o ڹ·µһвģʽ** 1. 뽫ƶ ---> һС 2. Сд o ڹ *·* µһУʹ ģʽ 3. ȻһЩ֣֮ ˳ģʽģʽ ---> 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 O while the cursor is on this line. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ڶڣ ** a ڹ֮ı ** 1. ģʽ½ƶ ---> ĵһеס 2. e ֱλ li ĩβ 3. Сд a ڹ֮ıˡ 4. ʲһе֮ ˳ģʽص ģʽ 5. ʹ e ƶ굽һĵʣظ3Ͳ4 ---> This li will allow you to pract appendi text to a line. ---> This line will allow you to practice appending text to a line. ʾai A ģʽΩһַλá ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ڣһûİ汾 ** д R 滻ַ** 1. 뽫ƶ ---> ĵһСƶ굽һ xxx ʼλá 2. Ȼд R ʼѵһеIJͬڵڶеʣַһ룬 ȫ滻ԭеַʹõһȫͬڶˡ 3. Ű ˳滻ģʽصģʽע⵽δ滻ı Ȼԭ״ 4. ظϲ裬ʣ xxx Ҳ滻 ---> Adding 123 to xxx gives you xxx. ---> Adding 123 to 456 gives you 579. ʾ滻ģʽģʽƣÿַɾһеַ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ľڣճı ** ʹò y ıʹ p ճı ** 1. λ ---> һУƶ "a)" ֮ 2. ʹ v ģʽƶ굽 "first" ǰ档 3. y Գ()ı 4. Ȼƶ굽һеĩβj$ 5. p Է(ճ)˵ıȻ룺a second 6. ʹÿģʽѡ " item." y ƣ j$ ƶһĩβ p ıճ ---> a) this is the first item. b) ʾ԰ y ʹã yw һʡ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ڣѡ ** ÿʹһ滻ɺԴСдѡ ** 1. Ҫҵ ignore ģʽ /ignore <س> ҪظҸôʣظ n 2. Ȼ ic ѡ(Ignore CaseԴСд)룺 :set ic 3. ڿͨ n ٴβҵ ignoreע⵽ Ignore IGNORE Ҳҵˡ 4. Ȼ hlsearch incsearch ѡ룺 :set hls is 5. ڿٴʲôЧ /ignore <س> 6. ҪúԴСд룺 :set noic ʾҪƳƥĸʾ룺 :nohlsearch ʾҪһβʱĸСдʹ \c /ignore\c <س> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ С 1. Сд o ڹ·µһвģʽ д O ڹϷµһС 2. Сд a ڹλ֮ı д A ڹеĩ֮ı 3. e ʹƶĩβ 4. y ıp ճǰƵı 5. д R 滻ģʽֱ صģʽ 6. :set xxx xxx ѡһЩõѡ£ 'ic' 'ignorecase' ʱĸСд 'is' 'incsearch' Ҷʱʾƥ 'hls' 'hlsearch' ʾеƥ ѡ汾Ҳ԰汾 7. ѡǰ no Թرѡ :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ߽һڣȡϢ ** ʹ߰ϵͳ ** Vim ӵһϸȫ߰ϵͳҪðϵͳѡַ ֮һ - (еĻ) - (еĻ) - :help <س> Ķе˽ιġ CTRL-W CTRL-W ʹڴ֮ת :q <س> Թرհڡ ṩһȷIJ":help"ҵڸİ ²(ɱ˰سŶ) :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ߽ڶڣű ** Vim ** Vim ĹҪ Vi ö࣬д󲿷ֶûȱʡáΪʹø ԣôһ vimrc ļ 1. ʼ༭ vimrc ļȡʹõIJϵͳ :edit ~/.vimrc Unix ϵͳʹõ :edit $VIM/_vimrc MS-Windows ϵͳʹõ 2. Ŷȡ vimrc ʾļݣ :r $VIMRUNTIME/vimrc_example.vim 3. ļΪ :write ´ Vim ʱ༭ͻ﷨Ĺܡ ԰ϲĸӵ vimrc ļС Ҫ˽Ϣ :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ߽ڣȫ ** ʹ CTRL-D Խвȫ ** 1. ȷ Vim ԼģʽУ :set nocp 2. 鿴һµǰĿ¼ѾЩļ룺 :!ls :!dir 3. һĿ¼ʼ֣룺 :e 4. Ű CTRL-D Vim ʾ e ʼб 5. Ȼ Vim ᲹȫΪ :edit 6. һոԼһļļʼ֣磺 :edit FIL 7. Ű Vim Ჹȫļ(Ωһƥ) ʾȫЧֻ賢԰ CTRL-D :help dzá ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ߽С 1. :help ߰ Դ򿪰ڡ 2. :help cmd ҵ cmd İ 3. CTRL-W CTRL-W ʹڴ֮ת 4. :q Թرհ 5. Դһ vimrc űļƫõá 6. : ʱ CTRL-D Բ鿴ܵIJȫ ʹһȫ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim ̵̳˾ͽˡֻ̳Ϊ˼ؽһ Vim ༭ ʹ༭ˡӹɣvimкܶܶ̳ ܵľIJúԶҪͨĻŬŶһĶ 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 Mines Michael C. Pierce Robert K. Ware дģкܶഴ Colorado State University Charles Smith ṩߵĵǣbware@mines.colorado.edu ̳ Bram Moolenaar רΪ Vim ޶ ߸ԣ =========== Ľ̷̳֮Ϊ̩ һϵַlinuxrat@gnuchina.org Ľ̳ǴӼĽ̷̳ʹ Debian GNU/Linux ĿС ڹдĺת autoconvert תɵģת ĽһЩϸڵĸĶ ¼ ========= 20121001 vimtutor 1.5 1.7 20020830 ̩ л RMS@SMTH ָദ 20020422 ̩ л xuandong@sh163.net ָ 20020318 ̩ Bram Moolenaar20020316յҪ󣬽vimtutor1.4 vimtutor1.5 20011115 ̩ vimtutor1.4ύBram MoolenaarSven Guckes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim-7.4.1689/runtime/tutor/tutor.zh.utf-8000066400000000000000000000752471267703067000201360ustar00rootroot00000000000000=============================================================================== = 歡 迎 閱 讀 《 V I M 教 程 》 ── 版本 1.5 = =============================================================================== vim 是一個具有很多命令的功能非常強大的編輯器。限于篇幅,在本教程當中 不就詳細介紹了。本教程的設計目標是講述一些必要的基本命令,而掌握好這 些命令,您就能夠很容易將vim當作一個通用的萬能編輯器來使用了。 完成本教程的內容大約需要25-30分鐘,取決于您訓練的時間。 每一節的命令操作將會更改本文。推薦您復制本文的一個副本,然後在副本上 進行訓練(如果您是通過"vimtutor"來啟動教程的,那麼本文就已經是副本了)。 切記一點︰本教程的設計思路是在使用中進行學習的。也就是說,您需要通過 執行命令來學習它們本身的正確用法。如果您只是閱讀而不操作,那麼您可能 會很快遺忘這些命令的! 好了,現在請確定您的Shift-Lock(大小寫鎖定鍵)還沒有按下,然後按鍵盤上 的字母鍵 j 足夠多的次數來移動光標,直到第一節的內容能夠完全充滿屏幕。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第一講第一節︰移動光標 ※※ 要移動光標,請依照說明分別按下 h、j、k、l 鍵。 ※※ ^ k 提示︰ h 的鍵位于左邊,每次按下就會向左移動。 < h l > l 的鍵位于右邊,每次按下就會向右移動。 j j 鍵看起來很象一支尖端方向朝下的箭頭。 v 1. 請隨意在屏幕內移動光標,直至您覺得舒服為止。 2. 按下下行鍵(j),直到出現光標重復下行。 ---> 現在您應該已經學會如何移動到下一講吧。 3. 現在請使用下行鍵,將光標移動到第二講。 提示︰如果您不敢確定您所按下的字母,請按下鍵回到正常(Normal)模式。 然後再次從鍵盤輸入您想要的命令。 提示︰光標鍵應當也能正常工作的。但是使用hjkl鍵,在習慣之後您就能夠快速 地在屏幕內四處移動光標了。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第一講第二節︰VIM的進入和退出 !! 特別提示︰敬請閱讀完整本一節的內容,然後才能執行以下所講解的命令。 1. 請按鍵(這是為了確保您處在正常模式)。 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. 所有文本都修正完畢,請按下 鍵返回正常模式。 重復步驟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編輯器,請輸入以下命令放棄所有修改︰ :q! <回車> 或者輸入以下命令保存所有修改︰ :wq <回車> 4. 在正常模式下刪除光標所在位置的字符,請按︰ x 5. 在正常模式下要在光標所在位置開始插入文本,請按︰ i 輸入必要文本 特別提示︰按下 鍵會帶您回到正常模式或者取消一個不期望或者部分完成 的命令。 好了,第一講到此結束。下面接下來繼續第二講的內容。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第二講第一節︰刪除類命令 ** 輸入 dw 可以從光標處刪除至一個單字/單詞的末尾。** 1. 請按下 鍵確保您處于正常模式。 2. 請將光標移動到本節中下面標記有 ---> 的那一行。 3. 請將光標移至準備要刪除的單詞的開始。 4. 接著輸入 dw 刪除掉該單詞。 特別提示︰您所輸入的 dw 會在您輸入的同時出現在屏幕的最後一行。如果您輸 入有誤,請按下 鍵取消,然後重新再來。 ---> There are a some words fun that don't belong paper in this sentence. 5. 重復步驟3至步驟4,直至句子修正完畢。接著繼續第二講第二節內容。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第二講第二節︰其他刪除類命令 ** 輸入 d$ 從當前光標刪除到行末。** 1. 請按下 鍵確保您處于正常模式。 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 鍵) ,這樣就 可以執行恢復命令,也就是撤消掉撤消命令。 ---> Fiix the errors oon thhis line and reeplace them witth undo. 8. 這些都是非常有用的命令。下面是第二講的小結了。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第二講小結 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. 然後在正常模式下(鍵進入),輸入 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. 最後按 鍵,然後光標定位到下一個錯誤第一個準備更改的字母處。 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$ 使得該行剩下的部分更正得同第二行一樣。最後按 鍵。 ---> 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 則直接跳轉到文件中的某一指定行。** 提示︰切記要先通讀本節內容,之後才可以執行以下步驟!!! 1. 按下 CTRL 鍵不放開然後按 g 鍵。然後就會看到頁面最底部出現一個狀態信 息行,顯示的內容是當前編輯的文件名和文件的總行數。請記住步驟3的行號。 2. 按下 SHIFT-G 鍵可以使得當前光標直接跳轉到文件最後一行。 3. 輸入您曾停留的行號,然後按下 SHIFT-G。這樣就可以返回到您第一次按下 CTRL-g 時所在的行好了。注意︰輸入行號時,行號是不會在屏幕上顯示出來 的。 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. 為了只保存文章的某個部分,請輸入 :#,# 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. 然後復制標記有 ---> 的行並按 鍵退出插入模式而進入正常模式。 ---> 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,光標定位到 最後一個字符,輸入的文本, 回復正常模式,箭頭右鍵移動光標以及 x 刪除當前光標所在位置字符等等諸多繁雜的操作。 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 開始把第一行中的不同于第二行的剩余字符逐一輸入,就 可以全部替換掉原有的字符而使得第一行完全雷同第二行了。 ---> 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. 請注意︰如果您按 退出置換模式回復正常模式,尚未替換的文本將仍 然保持原狀。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第六講第四節︰設置類命令的選項 ** 設置可使查找或者替換可忽略大小寫的選項 ** 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 將進入替換模式,直至按 鍵退出替換模式而進入正常 模式。 4. 輸入 :set xxx 可以設置 xxx 選項。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第七講︰在線幫助命令 ** 使用在線幫助系統 ** Vim 擁有一個細致全面的在線幫助系統。要啟動該幫助系統,請選擇如下三種方 法之一︰ - 按下 鍵 (如果鍵盤上有的話) - 按下 鍵 (如果鍵盤上有的話) - 輸入 :help <回車> 輸入 :q <回車> 可以關閉幫助窗口。 提供一個正確的參數給":help"命令,您可以找到關于該主題的幫助。請試驗以 下參數(可別忘了按回車鍵哦。:)︰ :help w <回車> :help c_ :help insert-index <回車> :help user-manual <回車> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第八講︰創建一個啟動腳本 ** 啟用vim的功能 ** Vim的功能特性要比vi多得多,但大部分功能都沒有缺省激活。為了啟動更多的 功能,您得創建一個vimrc文件。 1. 開始編輯vimrc文件,這取決于您所使用的操作系統︰ :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進行修訂。 譯制者附言︰ =========== 簡體中文教程翻譯版之譯制者為梁昌泰 ,還有 另外一個聯系地址︰linuxrat@gnuchina.org。 繁體中文教程是從簡體中文教程翻譯版使用 Debian GNU/Linux 中文項目小 組的于廣輝先生編寫的中文漢字轉碼器 autoconvert 轉換而成的,並對轉 換的結果做了一些細節的改動。 變更記錄︰ ========= 2002年08月30日 梁昌泰 感謝 RMS@SMTH 的指正,將多處錯誤修正。 2002年04月22日 梁昌泰 感謝 xuandong@sh163.net 的指正,將兩處錯別字修正。 2002年03月18日 梁昌泰 根據Bram Moolenaar先生在2002年03月16日的來信要求,將vimtutor1.4中譯 版升級到vimtutor1.5。 2001年11月15日 梁昌泰 將vimtutor1.4中譯版提交給Bram Moolenaar和Sven Guckes。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim-7.4.1689/runtime/tutor/tutor.zh_cn.utf-8000066400000000000000000001136331267703067000206060ustar00rootroot00000000000000=============================================================================== = 欢 迎 阅 读 《 V I M 教 程 》 —— 版本 1.7 = =============================================================================== Vim 是一个具有很多命令的功能非常强大的编辑器。限于篇幅,在本教程当中 就不详细介绍了。本教程的设计目标是讲述一些必要的基本命令,而掌握好这 些命令,您就能够很容易地将 Vim 当作一个通用编辑器来使用了。 完成本教程的内容大约需要25-30分钟,取决于您训练的时间。 注意: 每一节的命令操作将会更改本文。推荐您复制本文的一个副本,然后在副本上 进行训练(如果您是通过"vimtutor"来启动教程的,那么本文就已经是副本了)。 切记一点:本教程的设计思路是在使用中进行学习的。也就是说,您需要通过 执行命令来学习它们本身的正确用法。如果您只是阅读而不操作,那么您可能 会很快遗忘这些命令的! 好了,现在请确定您的Shift-Lock(大小写锁定键)还没有按下,然后按键盘上 的字母键 j 足够多次来移动光标,直到第一节的内容能够完全充满屏幕。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第一讲第一节:移动光标 ** 要移动光标,请依照说明分别按下 h、j、k、l 键。 ** ^ k 提示: h 的键位于左边,每次按下就会向左移动。 < h l > l 的键位于右边,每次按下就会向右移动。 j j 键看起来很象一支尖端方向朝下的箭头。 v 1. 请随意在屏幕内移动光标,直至您觉得舒服为止。 2. 按下下行键(j),直到出现光标重复下行。 ---> 现在您应该已经学会如何移动到下一讲吧。 3. 现在请使用下行键,将光标移动到第一讲第二节。 提示:如果您不敢确定您所按下的字母,请按下键回到正常(Normal)模式。 然后再次从键盘输入您想要的命令。 提示:光标键应当也能正常工作的。但是使用hjkl键,在习惯之后您就能够更快 地在屏幕内四处移动光标。真的是这样! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第一讲第二节:VIM的进入和退出 !! 特别提示:敬请阅读本一节的完整内容,然后再执行以下所讲解的命令。 1. 按键(这是为了确保您处在正常模式)。 2. 然后输入: :q! <回车> 这种方式的退出编辑器会丢弃您进入编辑器以来所做的改动。 3. 如果您看到了命令行提示符,请输入能够带您回到本教程的命令,那就是: vimtutor <回车> 4. 如果您自信已经牢牢记住了这些步骤的话,请从步骤1执行到步骤3退出,然 后再次进入编辑器。 提示: :q! <回车> 会丢弃您所做的任何改动。几讲之后您将学会如何保存改动到文件。 5. 将光标下移到第一讲第三节。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第一讲第三节:文本编辑之删除 ** 在正常(Normal)模式下,可以按下 x 键来删除光标所在位置的字符。** 1. 请将光标移动到本节中下面标记有 ---> 的那一行。 2. 为了修正输入错误,请将光标移至准备删除的字符的位置处。 3. 然后按下 x 键将错误字符删除掉。 4. 重复步骤2到步骤4,直到句子修正为止。 ---> The ccow jumpedd ovverr thhe mooon. 5. 好了,该行已经修正了,下面是第一讲第四节。 特别提示:在浏览本教程时,不要强行记忆。记住一点:在使用中学习。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第一讲第四节:文本编辑之插入 ** 在正常模式下,可以按下 i 键来插入文本。** 1. 请将光标移动到本节中下面标记有 ---> 的第一行。 2. 为了使得第一行内容雷同于第二行,请将光标移至文本第一个准备插入字符 的位置。 3. 然后按下 i 键,接着输入必要的文本字符。 4. 每个错误修正完毕后,请按下 键返回正常模式。 重复步骤2至步骤4以便修正句子。 ---> There is text misng this . ---> There is some text missing from this line. 5. 如果您对文本插入操作已经很满意,请接着阅读下面的第一讲第五节。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第一讲第五节:文本编辑之添加 ** 按 A 键以添加文本。 ** 1. 移动光标到下面第一个标记有 ---> 的一行。 光标放在那一行的哪个字符上并不重要。 2. 按 A 键输入必要的添加内容。 3. 文本添加完毕后,按 键回到正常模式。 4. 移动光标到下面第二个标记有 ---> 的一行。重复步骤2和步骤3以改正这个句子。 ---> There is some text missing from th There is some text missing from this line. ---> There is also some text miss There is also some text missing here. 5. 当您对添加文本操作感到满意时,请继续学习第一讲第六节。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第一讲第六节:编辑文件 ** 使用 :wq 以保存文件并退出。 ** 特别提示:在执行以下步骤之前,请先读完整个小节! 1. 如您在第一讲第二节中所做的那样退出本教程: :q! 或者,如果您可以访问另一个终端,请在那里执行以下操作。 2. 在 shell 的提示符下输入命令: vim tutor <回车> 'vim'是启动 Vim 编辑器的命令,'tutor'是您希望编辑的文件的名字。 请使用一个可以改动的文件。 3. 使用您在前面的教程中学到的命令插入删除文本。 4. 保存改动过的文件并退出 Vim,按这些键: :wq <回车> 5. 如果您在步骤1中已经退出 vimtutor,请重启 vimtutor 移动到下面的小结一节。 6. 阅读完以上步骤,弄懂它们的意义,然后在实践中进行练习。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第一讲小结 1. 光标在屏幕文本中的移动既可以用箭头键,也可以使用 hjkl 字母键。 h (左移) j (下行) k (上行) l (右移) 2. 欲进入 Vim 编辑器(从命令行提示符),请输入:vim 文件名 <回车> 3. 欲退出 Vim 编辑器,请输入 :q! <回车> 放弃所有改动。 或者输入 :wq <回车> 保存改动。 4. 在正常模式下删除光标所在位置的字符,请按: x 5. 欲插入或添加文本,请输入: i 输入欲插入文本 在光标前插入文本 A 输入欲添加文本 在一行后添加文本 特别提示:按下 键会带您回到正常模式或者撤消一个不想输入或部分完整 的命令。 好了,第一讲到此结束。下面接下来继续第二讲的内容。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第二讲第一节:删除类命令 ** 输入 dw 可以从光标处删除至一个单词的末尾。** 1. 请按下 键确保您处于正常模式。 2. 请将光标移动到本节中下面标记有 ---> 的那一行。 3. 请将光标移至准备要删除的单词的起始处。 4. 接着输入 dw 删除掉该单词。 特别提示:当您输入时,字母 d 会同时出现在屏幕的最后一行。Vim 在等待您输入 字母 w。如果您看到的是除 d 外的其他字符,那表明您按错了;请按下 键, 然后重新再来。 ---> There are a some words fun that don't belong paper in this sentence. 5. 重复步骤3和步骤4,直至句子修正完毕。接着继续第二讲第二节内容。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第二讲第二节:更多删除类命令 ** 输入 d$ 从当前光标删除到行末。** 1. 请按下 键确保您处于正常模式。 2. 请将光标移动到本节中下面标记有 ---> 的那一行。 3. 请将光标移动到该行的尾部(也就是在第一个点号‘.’后面)。 4. 然后输入 d$ 从光标处删至当前行尾部。 ---> Somebody typed the end of this line twice. end of this line twice. 5. 请继续学习第二讲第三节就知道是怎么回事了。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第二讲第三节:关于命令和对象 许多改变文本的命令都由一个操作符和一个动作构成。 使用删除操作符 d 的删除命令的格式如下: d motion 其中: d - 删除操作符。 motion - 操作符的操作对象(在下面列出)。 一个简短的动作列表: w - 从当前光标当前位置直到下一个单词起始处,不包括它的第一个字符。 e - 从当前光标当前位置直到单词末尾,包括最后一个字符。 $ - 从当前光标当前位置直到当前行末。 因此输入 de 会从当前光标位置删除到单词末尾。 特别提示: 对于勇于探索者,请在正常模式下面仅按代表相应动作的键而不使用操作符,您 将看到光标的移动正如上面的对象列表所代表的一样。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第二讲第四节:使用计数指定动作 ** 在动作前输入数字会使它重复那么多次。 ** 1. 移动光标到下面标记有 ---> 的一行的开始。 2. 输入 2w 使光标向前移动两个单词。 3. 输入 3e 使光标向前移动到第三个单词的末尾。 4. 输入 0 (数字零) 移动光标到行首。 5. 重复步骤2和步骤3,尝试不同的数字。 ---> This is just a line with words you can move around in. 6. 请继续学习第二讲第五节。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第二讲第五节:使用计数以删除更多 ** 使用操作符时输入数字可以使它重复那么多次。 ** 上面已经提到过删除操作符和动作的组合,您可以在组合中动作之前插入一个数字以 删除更多: d number(数字) motion 1. 移动光标到下面标记有 ---> 的一行中第一个大写字母单词上。 2. 输入 d2w 以删除两个大写字母单词。 3. 重复步骤1和步骤2,使用不同的数字使得用一个命令就能删除全部相邻的大写字母 单词 ---> this ABC DE line FGHI JK LMN OP of words is Q RS TUV cleaned up. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第二讲第六节:操作整行 ** 输入 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. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第二讲第七节:撤消类命令 ** 输入 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. 这些都是非常有用的命令。下面是第二讲的小结了。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第二讲小结 1. 欲从当前光标删除至下一个单词,请输入:dw 2. 欲从当前光标删除至当前行末尾,请输入:d$ 3. 欲删除整行,请输入:dd 4. 欲重复一个动作,请在它前面加上一个数字:2w 5. 在正常模式下修改命令的格式是: operator [number] motion 其中: operator - 操作符,代表要做的事情,比如 d 代表删除 [number] - 可以附加的数字,代表动作重复的次数 motion - 动作,代表在所操作的文本上的移动,例如 w 代表单词(word), $ 代表行末等等。 6. 欲移动光标到行首,请按数字0键:0 7. 欲撤消以前的操作,请输入:u (小写的u) 欲撤消在一行中所做的改动,请输入:U (大写的U) 欲撤消以前的撤消命令,恢复以前的操作结果,请输入:CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第三讲第一节:置入类命令 ** 输入 p 将最后一次删除的内容置入光标之后。 ** 1. 请将光标移动到本节中下面第一个标记有 ---> 的一行。 2. 输入 dd 将该行删除,这样会将该行保存到 Vim 的一个寄存器中。 3. 接着将光标移动到 c) 一行,即准备置入的位置的上方。记住:是上方哦。 4. 然后在正常模式下(键进入)输入 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. 然后我们继续学习第三讲第三节。 特别提示:切记您要在使用中学习,而不是在记忆中学习。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第三讲第三节:更改类命令 ** 要改变文本直到一个单词的末尾,请输入 ce ** 1. 请将光标移动到本节中下面标记有 ---> 的第一行。 2. 接着把光标放在单词 lubw 的字母 u 的位置那里。 3. 然后输入 cw 以及正确的单词(在本例中是输入 ine )。 4. 最后按 键,然后光标定位到下一个错误第一个准备更改的字母处。 5. 重复步骤3和步骤4,直到第一个句子完全雷同第二个句子。 ---> This lubw has a few wptfd that mrrf changing usf the change operator. ---> This line has a few words that need changing using the change operator. 提示:请注意 ce 命令不仅仅是删除了一个单词,它也让您进入插入模式了。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第三讲第四节:使用c更改更多 ** 更改类操作符可以与删除中使用的同样的动作配合使用。 ** 1. 更改类操作符的工作方式跟删除类是一致的。操作格式是: c [number] motion 2. 动作参数(motion)也是一样的,比如 w 代表单词,$代表行末等等。 3. 请将光标移动到本节中下面标记有 ---> 的第一行。 4. 接着将光标移动到第一个错误处。 5. 然后输入 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. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第三讲小结 1. 要重新置入已经删除的文本内容,请按小写字母 p 键。该操作可以将已删除 的文本内容置于光标之后。如果最后一次删除的是一个整行,那么该行将置 于当前光标所在行的下一行。 2. 要替换光标所在位置的字符,请输入小写的 r 和要替换掉原位置字符的新字 符即可。 3. 更改类命令允许您改变从当前光标所在位置直到动作指示的位置中间的文本。 比如输入 ce 可以替换当前光标到单词的末尾的内容;输入 c$ 可以替换当 前光标到行末的内容。 4. 更改类命令的格式是: c [number] motion 现在我们继续学习下一讲。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第四讲第一节:定位及文件状态 ** 输入 CTRL-G 显示当前编辑文件中当前光标所在行位置以及文件状态信息。 输入大写 G 则直接跳转到文件中的某一指定行。** 提示:切记要先通读本节内容,之后才可以执行以下步骤!!! 1. 按下 CTRL 键不放开然后按 g 键。我们称这个键组合为 CTRL-G。 您会看到页面最底部出现一个状态信息行,显示的内容是当前编辑的文件名 和文件中光标位置。请记住行号,它会在步骤3中用到。 提示:您也许会在屏幕的右下角看到光标位置,这会在 'ruler' 选项设置时发生 (参见 :help 'ruler') 2. 输入大写 G 可以使得当前光标直接跳转到文件最后一行。 输入 gg 可以使得当前光标直接跳转到文件第一行。 3. 输入您曾停留的行号,然后输入大写 G。这样就可以返回到您第一次按下 CTRL-G 时所在的行了。 4. 如果您觉得没问题的话,请执行步骤1至步骤3的操作进行练习。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第四讲第二节:搜索类命令 ** 输入 / 加上一个字符串可以用以在当前文件中查找该字符串。** 1. 在正常模式下输入 / 字符。您此时会注意到该字符和光标都会出现在屏幕底 部,这跟 : 命令是一样的。 2. 接着输入 errroor <回车>。那个errroor就是您要查找的字符串。 3. 要查找同上一次的字符串,只需要按 n 键。要向相反方向查找同上一次的字 符串,请输入大写 N 即可。 4. 如果您想逆向查找字符串,请使用 ? 代替 / 进行。 5. 要回到您之前的位置按 CTRL-O (按住 Ctrl 键不放同时按下字母 o)。重复按可以 回退更多步。CTRL-I 会跳转到较新的位置。 ---> "errroor" is not the way to spell error; errroor is an error. 提示:如果查找已经到达文件末尾,查找会自动从文件头部继续查找,除非 'wrapscan' 选项被复位。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第四讲第三节:配对括号的查找 ** 输入 % 可以查找配对的括号 )、]、}。** 1. 把光标放在本节下面标记有 --> 那一行中的任何一个 (、[ 或 { 处。 2. 接着按 % 字符。 3. 此时光标的位置应当是在配对的括号处。 4. 再次按 % 就可以跳回配对的第一个括号处。 5. 移动光标到另一个 (、)、[、]、{ 或 } 处,按 % 查看其所作所为。 ---> 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 则是替换全行的匹配串,该行中所有的 "thee" 都会被 改变。 ---> thee best time to see thee flowers is in thee spring. 4. 要替换两行之间出现的每个匹配串,请 输入 :#,#s/old/new/g 其中 #,# 代表的是替换操作的若干行中 首尾两行的行号。 输入 :%s/old/new/g 则是替换整个文件中的每个匹配串。 输入 :%s/old/new/gc 会找到整个文件中的每个匹配串,并且对每个匹配串 提示是否进行替换。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第四讲小结 1. CTRL-G 用于显示当前光标所在位置和文件状态信息。 G 用于将光标跳转至文件最后一行。 先敲入一个行号然后输入大写 G 则是将光标移动至该行号代表的行。 gg 用于将光标跳转至文件第一行。 2. 输入 / 然后紧随一个字符串是在当前所编辑的文档中正向查找该字符串。 输入 ? 然后紧随一个字符串则是在当前所编辑的文档中反向查找该字符串。 完成一次查找之后按 n 键是重复上一次的命令,可在同一方向上查 找下一个匹配字符串所在;或者按大写 N 向相反方向查找下一匹配字符串所在。 CTRL-O 带您跳转回较旧的位置,CTRL-I 则带您到较新的位置。 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 或 :!ls 查看您的目录列表内容。 请注意:如果您退出 Vim 然后在以命令 vim TEST 再次启动 Vim,那么该文件内 容应该同您保存时的文件内容是完全一样的。 5. 现在您可以删除 TEST 文件了。在 MS-DOS 下,请输入: :!del TEST 在 Unix 下,请输入: :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第五讲第三节:一个具有选择性的保存命令 ** 要保存文件的部分内容,请输入 v motion :w FILENAME ** 1. 移动光标到本行。 2. 接着按 v 键,将光标移动至下面第五个条目上。您会注意到之间的文本被高亮了。 3. 然后按 : 字符。您将看到屏幕底部会出现 :'<,'> 。 4. 现在请输入 w TEST,其中 TEST 是一个未被使用的文件名。确认您看到了 :'<,'>w TEST 之后按 <回车> 键。 5. 这时 Vim 会把选中的行写入到以 TEST 命名的文件中去。使用 :!dir 或 :!ls 确认文件被正确保存。这次先别删除它!我们在下一讲中会用到它。 提示:按 v 键使 Vim 进入可视模式进行选取。您可以四处移动光标使选取区域变大或 变小。接着您可以使用一个操作符对选中文本进行操作。例如,按 d 键会删除 选中的文本内容。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第五讲第四节:提取和合并文件 ** 要向当前文件中插入另外的文件的内容,请输入 :r FILENAME ** 1. 请把光标移动到本行上面一行。 特别提示:执行步骤2之后您将看到第五讲第三节的文字,请届时往下移动 以再次看到本讲内容。 2. 接着通过命令 :r TEST 将前面创建的名为 TEST 的文件提取进来。 您所提取进来的文件将从光标所在位置处开始置入。 3. 为了确认文件已经提取成功,移动光标回到原来的位置就可以注意有两份第 五讲第三节的内容,一份是原始内容,另外一份是来自文件的副本。 提示:您还可以读取外部命令的输出。例如, :r !ls 可以读取 ls 命令的输出,并 把它放置在光标下面。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第五讲小结 1. :!command 用于执行一个外部命令 command。 请看一些实际例子: (MS-DOS) (Unix) :!dir :!ls - 用于显示当前目录的内容。 :!del FILENAME :!rm FILENAME - 用于删除名为 FILENAME 的文件。 2. :w FILENAME 可将当前 VIM 中正在编辑的文件保存到名为 FILENAME 的文 件中。 3. v motion :w FILENAME 可将当前编辑文件中可视模式下选中的内容保存到文件 FILENAME 中。 4. :r FILENAME 可提取磁盘文件 FILENAME 并将其插入到当前文件的光标位置 后面。 5. :r !dir 可以读取 dir 命令的输出并将其放置到当前文件的光标位置后面。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第六讲第一节:打开类命令 ** 输入 o 将在光标的下方打开新的一行并进入插入模式。** 1. 请将光标移动到本节中下面标记有 ---> 的那一行。 2. 接着输入小写的 o 在光标 *下方* 打开新的一行,这个命令会使您 进入插入模式。 3. 然后输入一些文字,之后按 键退出插入模式而进入正常模式。 ---> 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 O while the cursor is on this line. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第六讲第二节:附加类命令 ** 输入 a 将可在光标之后插入文本。 ** 1. 请在正常模式下将光标移动到本节中下面标记有 ---> 的第一行的行首。 2. 接着输入 e 直到光标位于 li 的末尾。 3. 输入小写的 a 则可在光标之后插入文本了。 4. 将单词补充完整,就像下一行中的那样。之后按 键退出插入模式回到 正常模式。 5. 使用 e 移动光标到下一步不完整的单词,重复步骤3和步骤4。 ---> This li will allow you to pract appendi text to a line. ---> This line will allow you to practice appending text to a line. 提示:a、i 和 A 都会带您进入插入模式,惟一的区别在于字符插入的位置。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第六讲第三节:另外一个置换类命令的版本 ** 输入大写的 R 可连续替换多个字符。** 1. 请将光标移动到本节中下面标记有 ---> 的第一行。移动光标到第一个 xxx 的 起始位置。 2. 然后输入大写的 R 开始把第一行中的不同于第二行的剩余字符逐一输入,就 可以全部替换掉原有的字符而使得第一行完全雷同第二行了。 3. 接着按 键退出替换模式回到正常模式。您可以注意到尚未替换的文本 仍然保持原状。 4. 重复以上步骤,将剩余的 xxx 也替换掉。 ---> Adding 123 to xxx gives you xxx. ---> Adding 123 to 456 gives you 579. 提示:替换模式与插入模式相似,不过每个输入的字符都会删除一个已有的字符。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第六讲第四节:复制粘贴文本 ** 使用操作符 y 复制文本,使用 p 粘贴文本 ** 1. 定位到下面标记有 ---> 的一行,将光标移动到 "a)" 之后。 2. 接着使用 v 进入可视模式,移动光标到 "first" 的前面。 3. 现在输入 y 以抽出(复制)高亮的文本。 4. 然后移动光标到下一行的末尾:j$ 5. 接着输入 p 以放置(粘贴)复制了的文本。然后输入:a second 。 6. 使用可视模式选中 " item.",用 y 复制,再用 j$ 将光标移动到下一行末尾, 用 p 将文本粘贴到那里。 ---> a) this is the first item. b) 提示:您还可以把 y 当作操作符来使用;例如 yw 可以用来复制一个单词。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第六讲第五节:设置类命令的选项 ** 设置可使查找或者替换可忽略大小写的选项 ** 1. 要查找单词 ignore 可在正常模式下输入 /ignore <回车>。 要重复查找该词,可以重复按 n 键。 2. 然后设置 ic 选项(Ignore Case,忽略大小写),请输入: :set ic 3. 现在可以通过键入 n 键再次查找单词 ignore。注意到 Ignore 和 IGNORE 现在 也被找到了。 4. 然后设置 hlsearch 和 incsearch 这两个选项,请输入: :set hls is 5. 现在可以再次输入查找命令,看看会有什么效果: /ignore <回车> 6. 要禁用忽略大小写,请输入: :set noic 提示:要移除匹配项的高亮显示,请输入: :nohlsearch 提示:如果您想要仅在一次查找时忽略字母大小写,您可以使用 \c: /ignore\c <回车> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第六讲小结 1. 输入小写的 o 可以在光标下方打开新的一行并进入插入模式。 输入大写的 O 可以在光标上方打开新的一行。 2. 输入小写的 a 可以在光标所在位置之后插入文本。 输入大写的 A 可以在光标所在行的行末之后插入文本。 3. e 命令可以使光标移动到单词末尾。 4. 操作符 y 复制文本,p 粘贴先前复制的文本。 5. 输入大写的 R 将进入替换模式,直至按 键回到正常模式。 6. 输入 :set xxx 可以设置 xxx 选项。一些有用的选项如下: 'ic' 'ignorecase' 查找时忽略字母大小写 'is' 'incsearch' 查找短语时显示部分匹配 'hls' 'hlsearch' 高亮显示所有的匹配短语 选项名可以用完整版本,也可以用缩略版本。 7. 在选项前加上 no 可以关闭选项: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第七讲第一节:获取帮助信息 ** 使用在线帮助系统 ** Vim 拥有一个细致全面的在线帮助系统。要启动该帮助系统,请选择如下三种方 法之一: - 按下 键 (如果键盘上有的话) - 按下 键 (如果键盘上有的话) - 输入 :help <回车> 请阅读帮助窗口中的文字以了解帮助是如何工作的。 输入 CTRL-W CTRL-W 可以使您在窗口之间跳转。 输入 :q <回车> 可以关闭帮助窗口。 提供一个正确的参数给":help"命令,您可以找到关于该主题的帮助。请试验以 下参数(可别忘了按回车键哦): :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第七讲第二节:创建启动脚本 ** 启用 Vim 的特性 ** Vim 的功能特性要比 Vi 多得多,但其中大部分都没有缺省启用。为了使用更多的 特性,您得创建一个 vimrc 文件。 1. 开始编辑 vimrc 文件,具体命令取决于您所使用的操作系统: :edit ~/.vimrc 这是 Unix 系统所使用的命令 :edit $VIM/_vimrc 这是 MS-Windows 系统所使用的命令 2. 接着读取 vimrc 示例文件的内容: :r $VIMRUNTIME/vimrc_example.vim 3. 保存文件,命令为: :write 下次您启动 Vim 时,编辑器就会有了语法高亮的功能。 您可以把您喜欢的各种设置添加到这个 vimrc 文件中。 要了解更多信息请输入 :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第七讲第三节:补全功能 ** 使用 CTRL-D 和 可以进行命令行补全 ** 1. 请确保 Vim 不是在以兼容模式运行: :set nocp 2. 查看一下当前目录下已经存在哪些文件,输入: :!ls 或者 :!dir 3. 现在输入一个目录的起始部分,例如输入: :e 4. 接着按 CTRL-D 键,Vim 会显示以 e 开始的命令的列表。 5. 然后按 键,Vim 会补全命令为 :edit 。 6. 现在添加一个空格,以及一个已有文件的文件名的起始部分,例如: :edit FIL 7. 接着按 键,Vim 会补全文件名(如果它是惟一匹配的)。 提示:补全对于许多命令都有效。您只需尝试按 CTRL-D 和 。 它对于 :help 命令非常有用。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第七讲小结 1. 输入 :help 或者按 键或 键可以打开帮助窗口。 2. 输入 :help cmd 可以找到关于 cmd 命令的帮助。 3. 输入 CTRL-W CTRL-W 可以使您在窗口之间跳转。 4. 输入 :q 以关闭帮助窗口 5. 您可以创建一个 vimrc 启动脚本文件用来保存您偏好的设置。 6. 当输入 : 命令时,按 CTRL-D 可以查看可能的补全结果。 按 可以使用一个补全。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 Mines 的 Michael C. Pierce 和 Robert K. Ware 所编写的,其中很多创意由来自 Colorado State University 的 Charles Smith 提供。编者的电子邮箱是:bware@mines.colorado.edu 本教程已由 Bram Moolenaar 专为 Vim 进行修订。 译制者附言: =========== 简体中文教程翻译版之译制者为梁昌泰 ,还有 另外一个联系地址:linuxrat@gnuchina.org。 繁体中文教程是从简体中文教程翻译版使用 Debian GNU/Linux 中文项目小 组的于广辉先生编写的中文汉字转码器 autoconvert 转换而成的,并对转 换的结果做了一些细节的改动。 变更记录: ========= 2012年10月01日 赵涛 将 vimtutor 中译版从 1.5 升级到 1.7。 2002年08月30日 梁昌泰 感谢 RMS@SMTH 的指正,将多处错误修正。 2002年04月22日 梁昌泰 感谢 xuandong@sh163.net 的指正,将两处错别字修正。 2002年03月18日 梁昌泰 根据Bram Moolenaar先生在2002年03月16日的来信要求,将vimtutor1.4中译 版升级到vimtutor1.5。 2001年11月15日 梁昌泰 将vimtutor1.4中译版提交给Bram Moolenaar和Sven Guckes。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim-7.4.1689/runtime/tutor/tutor.zh_tw.utf-8000066400000000000000000000752471267703067000206500ustar00rootroot00000000000000=============================================================================== = 歡 迎 閱 讀 《 V I M 教 程 》 ── 版本 1.5 = =============================================================================== vim 是一個具有很多命令的功能非常強大的編輯器。限于篇幅,在本教程當中 不就詳細介紹了。本教程的設計目標是講述一些必要的基本命令,而掌握好這 些命令,您就能夠很容易將vim當作一個通用的萬能編輯器來使用了。 完成本教程的內容大約需要25-30分鐘,取決于您訓練的時間。 每一節的命令操作將會更改本文。推薦您復制本文的一個副本,然後在副本上 進行訓練(如果您是通過"vimtutor"來啟動教程的,那麼本文就已經是副本了)。 切記一點︰本教程的設計思路是在使用中進行學習的。也就是說,您需要通過 執行命令來學習它們本身的正確用法。如果您只是閱讀而不操作,那麼您可能 會很快遺忘這些命令的! 好了,現在請確定您的Shift-Lock(大小寫鎖定鍵)還沒有按下,然後按鍵盤上 的字母鍵 j 足夠多的次數來移動光標,直到第一節的內容能夠完全充滿屏幕。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第一講第一節︰移動光標 ※※ 要移動光標,請依照說明分別按下 h、j、k、l 鍵。 ※※ ^ k 提示︰ h 的鍵位于左邊,每次按下就會向左移動。 < h l > l 的鍵位于右邊,每次按下就會向右移動。 j j 鍵看起來很象一支尖端方向朝下的箭頭。 v 1. 請隨意在屏幕內移動光標,直至您覺得舒服為止。 2. 按下下行鍵(j),直到出現光標重復下行。 ---> 現在您應該已經學會如何移動到下一講吧。 3. 現在請使用下行鍵,將光標移動到第二講。 提示︰如果您不敢確定您所按下的字母,請按下鍵回到正常(Normal)模式。 然後再次從鍵盤輸入您想要的命令。 提示︰光標鍵應當也能正常工作的。但是使用hjkl鍵,在習慣之後您就能夠快速 地在屏幕內四處移動光標了。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第一講第二節︰VIM的進入和退出 !! 特別提示︰敬請閱讀完整本一節的內容,然後才能執行以下所講解的命令。 1. 請按鍵(這是為了確保您處在正常模式)。 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. 所有文本都修正完畢,請按下 鍵返回正常模式。 重復步驟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編輯器,請輸入以下命令放棄所有修改︰ :q! <回車> 或者輸入以下命令保存所有修改︰ :wq <回車> 4. 在正常模式下刪除光標所在位置的字符,請按︰ x 5. 在正常模式下要在光標所在位置開始插入文本,請按︰ i 輸入必要文本 特別提示︰按下 鍵會帶您回到正常模式或者取消一個不期望或者部分完成 的命令。 好了,第一講到此結束。下面接下來繼續第二講的內容。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第二講第一節︰刪除類命令 ** 輸入 dw 可以從光標處刪除至一個單字/單詞的末尾。** 1. 請按下 鍵確保您處于正常模式。 2. 請將光標移動到本節中下面標記有 ---> 的那一行。 3. 請將光標移至準備要刪除的單詞的開始。 4. 接著輸入 dw 刪除掉該單詞。 特別提示︰您所輸入的 dw 會在您輸入的同時出現在屏幕的最後一行。如果您輸 入有誤,請按下 鍵取消,然後重新再來。 ---> There are a some words fun that don't belong paper in this sentence. 5. 重復步驟3至步驟4,直至句子修正完畢。接著繼續第二講第二節內容。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第二講第二節︰其他刪除類命令 ** 輸入 d$ 從當前光標刪除到行末。** 1. 請按下 鍵確保您處于正常模式。 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 鍵) ,這樣就 可以執行恢復命令,也就是撤消掉撤消命令。 ---> Fiix the errors oon thhis line and reeplace them witth undo. 8. 這些都是非常有用的命令。下面是第二講的小結了。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第二講小結 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. 然後在正常模式下(鍵進入),輸入 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. 最後按 鍵,然後光標定位到下一個錯誤第一個準備更改的字母處。 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$ 使得該行剩下的部分更正得同第二行一樣。最後按 鍵。 ---> 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 則直接跳轉到文件中的某一指定行。** 提示︰切記要先通讀本節內容,之後才可以執行以下步驟!!! 1. 按下 CTRL 鍵不放開然後按 g 鍵。然後就會看到頁面最底部出現一個狀態信 息行,顯示的內容是當前編輯的文件名和文件的總行數。請記住步驟3的行號。 2. 按下 SHIFT-G 鍵可以使得當前光標直接跳轉到文件最後一行。 3. 輸入您曾停留的行號,然後按下 SHIFT-G。這樣就可以返回到您第一次按下 CTRL-g 時所在的行好了。注意︰輸入行號時,行號是不會在屏幕上顯示出來 的。 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. 為了只保存文章的某個部分,請輸入 :#,# 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. 然後復制標記有 ---> 的行並按 鍵退出插入模式而進入正常模式。 ---> 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,光標定位到 最後一個字符,輸入的文本, 回復正常模式,箭頭右鍵移動光標以及 x 刪除當前光標所在位置字符等等諸多繁雜的操作。 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 開始把第一行中的不同于第二行的剩余字符逐一輸入,就 可以全部替換掉原有的字符而使得第一行完全雷同第二行了。 ---> 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. 請注意︰如果您按 退出置換模式回復正常模式,尚未替換的文本將仍 然保持原狀。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第六講第四節︰設置類命令的選項 ** 設置可使查找或者替換可忽略大小寫的選項 ** 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 將進入替換模式,直至按 鍵退出替換模式而進入正常 模式。 4. 輸入 :set xxx 可以設置 xxx 選項。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第七講︰在線幫助命令 ** 使用在線幫助系統 ** Vim 擁有一個細致全面的在線幫助系統。要啟動該幫助系統,請選擇如下三種方 法之一︰ - 按下 鍵 (如果鍵盤上有的話) - 按下 鍵 (如果鍵盤上有的話) - 輸入 :help <回車> 輸入 :q <回車> 可以關閉幫助窗口。 提供一個正確的參數給":help"命令,您可以找到關于該主題的幫助。請試驗以 下參數(可別忘了按回車鍵哦。:)︰ :help w <回車> :help c_ :help insert-index <回車> :help user-manual <回車> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 第八講︰創建一個啟動腳本 ** 啟用vim的功能 ** Vim的功能特性要比vi多得多,但大部分功能都沒有缺省激活。為了啟動更多的 功能,您得創建一個vimrc文件。 1. 開始編輯vimrc文件,這取決于您所使用的操作系統︰ :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進行修訂。 譯制者附言︰ =========== 簡體中文教程翻譯版之譯制者為梁昌泰 ,還有 另外一個聯系地址︰linuxrat@gnuchina.org。 繁體中文教程是從簡體中文教程翻譯版使用 Debian GNU/Linux 中文項目小 組的于廣輝先生編寫的中文漢字轉碼器 autoconvert 轉換而成的,並對轉 換的結果做了一些細節的改動。 變更記錄︰ ========= 2002年08月30日 梁昌泰 感謝 RMS@SMTH 的指正,將多處錯誤修正。 2002年04月22日 梁昌泰 感謝 xuandong@sh163.net 的指正,將兩處錯別字修正。 2002年03月18日 梁昌泰 根據Bram Moolenaar先生在2002年03月16日的來信要求,將vimtutor1.4中譯 版升級到vimtutor1.5。 2001年11月15日 梁昌泰 將vimtutor1.4中譯版提交給Bram Moolenaar和Sven Guckes。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim-7.4.1689/runtime/vim.desktop000066400000000000000000000070131267703067000164470ustar00rootroot00000000000000[Desktop Entry] Name=Vim GenericName=Text Editor GenericName[de]=Texteditor Comment=Edit text files Comment[af]=Redigeer tekslêers Comment[am]=የጽሑፍ ፋይሎች ያስተካክሉ Comment[ar]=حرّر ملفات نصية Comment[az]=Mətn fayllarını redaktə edin Comment[be]=Рэдагаваньне тэкставых файлаў Comment[bg]=Редактиране на текстови файлове Comment[bn]=টেক্স্ট ফাইল এডিট করুন Comment[bs]=Izmijeni tekstualne datoteke Comment[ca]=Edita fitxers de text Comment[cs]=Úprava textových souborů Comment[cy]=Golygu ffeiliau testun Comment[da]=Redigér tekstfiler Comment[de]=Textdateien bearbeiten Comment[el]=Επεξεργασία αρχείων κειμένου Comment[en_CA]=Edit text files Comment[en_GB]=Edit text files Comment[es]=Edita archivos de texto Comment[et]=Redigeeri tekstifaile Comment[eu]=Editatu testu-fitxategiak Comment[fa]=ویرایش پرونده‌های متنی Comment[fi]=Muokkaa tekstitiedostoja Comment[fr]=Édite des fichiers texte Comment[ga]=Eagar comhad Téacs Comment[gu]=લખાણ ફાઇલોમાં ફેરફાર કરો Comment[he]=ערוך קבצי טקסט Comment[hi]=पाठ फ़ाइलें संपादित करें Comment[hr]=Uređivanje tekstualne datoteke Comment[hu]=Szövegfájlok szerkesztése Comment[id]=Edit file teks Comment[it]=Modifica file di testo Comment[ja]=テキストファイルを編集します Comment[kn]=ಪಠ್ಯ ಕಡತಗಳನ್ನು ಸಂಪಾದಿಸು Comment[ko]=텍스트 파일을 편집합니다 Comment[lt]=Redaguoti tekstines bylas Comment[lv]=Rediģēt teksta failus Comment[mk]=Уреди текстуални фајлови Comment[ml]=വാചക രചനകള് തിരുത്തുക Comment[mn]=Текст файл боловсруулах Comment[mr]=गद्य फाइल संपादित करा Comment[ms]=Edit fail teks Comment[nb]=Rediger tekstfiler Comment[ne]=पाठ फाइललाई संशोधन गर्नुहोस् Comment[nl]=Tekstbestanden bewerken Comment[nn]=Rediger tekstfiler Comment[no]=Rediger tekstfiler Comment[or]=ପାଠ୍ଯ ଫାଇଲଗୁଡ଼ିକୁ ସମ୍ପାଦନ କରନ୍ତୁ Comment[pa]=ਪਾਠ ਫਾਇਲਾਂ ਸੰਪਾਦਨ Comment[pl]=Edytor plików tekstowych Comment[pt]=Editar ficheiros de texto Comment[pt_BR]=Edite arquivos de texto Comment[ro]=Editare fişiere text Comment[ru]=Редактор текстовых файлов Comment[sk]=Úprava textových súborov Comment[sl]=Urejanje datotek z besedili Comment[sq]=Përpuno files teksti Comment[sr]=Измени текстуалне датотеке Comment[sr@Latn]=Izmeni tekstualne datoteke Comment[sv]=Redigera textfiler Comment[ta]=உரை கோப்புகளை தொகுக்கவும் Comment[th]=แก้ไขแฟ้มข้อความ Comment[tk]=Metin faýllary editle Comment[tr]=Metin dosyalarını düzenle Comment[uk]=Редактор текстових файлів Comment[vi]=Soạn thảo tập tin văn bản Comment[wa]=Asspougnî des fitchîs tecses Comment[zh_CN]=编辑文本文件 Comment[zh_TW]=編輯文字檔 TryExec=vim Exec=vim %F Terminal=true Type=Application Icon=gvim Categories=Utility;TextEditor; StartupNotify=false MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++; vim-7.4.1689/runtime/vim16x16.gif000066400000000000000000000002461267703067000162520ustar00rootroot00000000000000GIF89a!,SxejXWaZ;e\OBv N`P$FQ8!?o,4V*Y;DQRTwEpH;vim-7.4.1689/runtime/vim16x16.png000066400000000000000000000003421267703067000162660ustar00rootroot00000000000000PNG  IHDRRgAMA aPLTE1tRNS@fhIDATx%˱ 1 @*4A630*Z?Ձ ̯gmΏh$ف`!~Ɛ?/x\pkтig8PR Z)t3i.i(#[xej{~DHj!b\OL(r.@v6$H㵉AaX qy/gBԈE F,3_ ($/~F܏p4p邃Sp`d0|TY @$Jk/ZUPA#7ֵ~.e1bqR:ő,nFV<#LJ*iJ_N0pBeULfT10>, ?:ja!VIENDB`vim-7.4.1689/runtime/vim32x32.xpm000066400000000000000000000024521267703067000163060ustar00rootroot00000000000000/* XPM */ static char * vim32x32[] = { "32 32 8 1", " c None", ". c #000000", "+ c #000080", "@ c #008000", "# c #00FF00", "$ c #808080", "% c #C0C0C0", "& c #FFFFFF", " .. ", " .##. ", " ...........#@@#. ......... ", " .&&&&&&&&&&&.@@@#.&&&&&&&&&. ", " .&%%%%%%%%%%%.@@@.&%%%%%%%%%. ", " .%%%%%%%%%%$.@@@@.%%%%%%%%$. ", " .$%%%%%%$$.@@@@@@.$%%%%%$$. ", " .&%%%%%%$.@@@@@@.&%%%%%$$. ", " .&%%%%%%$.@@@@@.&&%%%%$$. ", " .&%%%%%%$.@@@@.&&%%%%$$. ", " .&%%%%%%$.@@@.&&%%%%$$. ", " .&%%%%%%$.@@.&&%%%%$$.#. ", " ..&%%%%%%$.@.&&%%%%$$.@@#. ", " .#.&%%%%%%$..&&%%%%$$.@@@@#. ", " .#@.&%%%%%%$.&&%%%%$$.@@@@@@#. ", ".#@@.&%%%%%%$&&%%%%$$.@@@@@@@@#.", ".+@@.&%%%%%%$&%%%%$$.@@@@@@@@@+.", " .+@.&%%%%%%$%%%%$$.@@@@@@@@@+. ", " .+.&%%%%%%%%%%...@@@@@@@@@+. ", " ..&%%%%%%%%%.%%.@@@@@@@@+. ", " .&%%%%%%%%%.%%.@@@@@@@+. ", " .&%%%%%%%%$...@...@...... ", " .&%%%%%%%$.%%%.%%%.%%%.%%. ", " .&%%%%%%$$..%%..%%%%%%%%%%. ", " .&%%%%%$$..%%...%%++%%..%. ", " .&%%%%$$.@.%%..%%+.%%..%%. ", " .&%%%$$.@@.%%..%%..%%..%%. ", " .&%%$$..+.%%..%%..%%..%%. ", " .%$$. ..%%%.%%..%%..%%%. ", " ... ....+.. .. ... ", " .++. ", " .. "}; vim-7.4.1689/runtime/vim48x48.gif000066400000000000000000000007701267703067000162660ustar00rootroot00000000000000GIF89a00! ,00Iͻàydi e0|Yj{5 l:P|ZQʍ S[5;O׌&m8 vm _vBh{~cuEsd:]kURv|i`3-'PZ4TMC(^_+'ͩ3e՜ޕ6Xc#c36 I@tIG&@9Ѥ[.--E]|hd'Q&յ;3Qrh iҒ1 FQ/N̪GmJʮ`5:\PQny@W-X 47m_t aث^D4GϚYLR!o6x=D;vim-7.4.1689/runtime/vim48x48.png000066400000000000000000000007321267703067000163030ustar00rootroot00000000000000PNG  IHDR00,gAMA aPLTEh,wtRNS@f`IDATxuK @y" `κP I`>X^!Z*cK 1HO)~yaS,*wmu@%x+zH]%_b6ܛ" t@/0 Y8\`"<}SkM4 B ){jBRR@0!M_fpeyBl$VY T*S^1 y4@Xt T8 흷`\6s!dnnݰ@WNxvB*F2lkɢA++![,==1cX!ewlCmk ?v.|]K!_4HIENDB`vim-7.4.1689/runtime/vim48x48.xpm000066400000000000000000000051521267703067000163240ustar00rootroot00000000000000/* XPM */ static char * vim48x48[] = { "48 48 8 1", " c None", ". c #000000", "+ c #000084", "@ c #008200", "# c #00FF00", "$ c #848284", "& c #C6C3C6", "* c #FFFFFF", " .. ", " .##. ", " .#@@#. ", " ...............#@@@@#. ............... ", " .***************.@@@@@#. .***************. ", " .**&&&&&&&&&&&&&&$.@@@@@#.**&&&&&&&&&&&&&&$.", " .*&&&&&&&&&&&&&&&$.@@@@@@.*&&&&&&&&&&&&&&&$.", " .*$&&&&&&&&&&&&&&$.@@@@@@.*$&&&&&&&&&&&&&&$.", " .$$$&&&&&&&&&$$$.@@@@@@@@.$$$&&&&&&&&&&&$$.", " ..*&&&&&&&&&$$.@@@@@@@@@@..*&&&&&&&&&&$$. ", " .*&&&&&&&&&$$.@@@@@@@@@@.**&&&&&&&&&$$. ", " .*&&&&&&&&&$$.@@@@@@@@@.**&&&&&&&&&$$. ", " .*&&&&&&&&&$$.@@@@@@@@.**&&&&&&&&&$$. ", " .*&&&&&&&&&$$.@@@@@@@.**&&&&&&&&&$$. ", " .*&&&&&&&&&$$.@@@@@@.**&&&&&&&&&$$. ", " .*&&&&&&&&&$$.@@@@@.**&&&&&&&&&$$. ", " .*&&&&&&&&&$$.@@@@.**&&&&&&&&&$$.. ", " ..*&&&&&&&&&$$.@@@.**&&&&&&&&&$$.@#. ", " .#.*&&&&&&&&&$$.@@.**&&&&&&&&&$$.@@@#. ", " .#@.*&&&&&&&&&$$.@.**&&&&&&&&&$$.@@@@@#. ", " .#@@.*&&&&&&&&&$$..**&&&&&&&&&$$.@@@@@@@#. ", " .#@@@.*&&&&&&&&&$$.**&&&&&&&&&$$.@@@@@@@@@#. ", " .#@@@@.*&&&&&&&&&$$**&&&&&&&&&$$.@@@@@@@@@@@#. ", ".#+@@@@.*&&&&&&&&&$$*&&&&&&&&&$$.@@@@@@@@@@@@@#.", " .++@@@.*&&&&&&&&&$*&&&&&&&&&$$.@@@@@@@@@@@@@++.", " .++@@.*&&&&&&&&&$&&&&&&&&&$$.@@@@@@@@@@@@@++. ", " .++@.*&&&&&&&&&&&&&&&&&&$$.@@@@@@@@@@@@@++. ", " .++.*&&&&&&&&&&&&&&&&....@@@@@@@@@@@@@++. ", " .+.*&&&&&&&&&&&&&&&.&&&.@@@@@@@@@@@@+++ ", " ..*&&&&&&&&&&&&&&&.&&&.@@@@@@@@@@@++. ", " .*&&&&&&&&&&&&&&&.&&&.@@@@@@@@@@++. ", " .*&&&&&&&&&&&&&&$$...@@@@@@@@@@++. ", " .*&&&&&&&&&&&&&$$...@@....@@....+.... ", " .*&&&&&&&&&&&&$$..&&..&&&&..&&&&..&&&. ", " .*&&&&&&&&&&&$$..&&&.@.&&&&&&&&&&&&&&&. ", " .*&&&&&&&&&&$$.@.&&&.@.&&&&&&&&&&&&&&&. ", " .*&&&&&&&&&$$.@@.&&.@@.&&....&&....&&. ", " .*&&&&&&&&$$.@@.&&&.@.&&&.+.&&&. .&&&. ", " .*&&&&&&&$$.@@@.&&.@@.&&.++.&&. .&&. ", " .*&&&&&&$$.@@@.&&&.@.&&&.+.&&&. .&&&. ", " .*&&&&&$$.++@@.&&.@@.&&.. .&&. .&&. ", " .*&&&&$$. .++.&&&.@.&&&. .&&&. .&&&. ", " .$$$$$. .+.&&&&..&&&&..&&&&..&&&&. ", " ..... .+....@+.... .... .... ", " .++@@++. ", " .++++. ", " .++. ", " .. "}; vim-7.4.1689/runtime/vimlogo.cdr000066400000000000000000000362061267703067000164350ustar00rootroot00000000000000RIFF~<CDR5vrsnDISPT(XX  ||< E?RG?*(u*Ŵ@W0X Tt@No <'8˟$pG_>#ELSZahoeH+}`}`d/oQq[qfbgb&I[/[&& & 7q7qddd8M@maandenLISTstylstyd (<@HJVrt~ oR5   j M  e%+}`}`d/oQq[qfbgb&I[/[&& & 7q7qddd8M@@dagenLISTstylstyd (<@HJVrt~ vM1   l J M 0eZ8}`}`d/oQq[qfbgb&I[/[&& & 7q7qddd8M@o@weeknrsLISTstylstyd (<@HJVrt~ i |pdXL@4!(#%')*,.02468:<>PS/Jd/oQq[qfbgb&I[/[&& & 7q7qddd8M@@hhhLISTstylstyd (1<@HJVrt~  |p/ #ɹL5M:[C@[)oQPS/Jd/oQq[qfbgb&I[/[&& & 7q7qddd0@!7M@Bullet1LISTstylstyd (2<@HJVrt~  |p/ #ɹL5M:[C@[)oQPS/Jd/oQq[qfbgb&I[/[&& & 7q7qddd0@!7M@Bullet2LISTstylstyd (3<@HJVrt~  |p/ #ɹL5M:[C@[)oQPS/Jd/oQq[qfbgb&I[/[&& & 7q7qddd0@!7M@Bullet3LISTstylstyd  (<@HJVrt~9q |p/ #ɹL5M:[C@[)oQPS/Jd/oQq[qfbgb&I[/[&& & 7q7qddd8M@@songlineLISTjpageflgs@LISTRgobjLISTJlayrflgsZLIST2lgobloda%%   %*ddGridLISTLlayrflgsJLIST4lgobloda''   '*ddGuidesLISTLlayrflgsHLIST4lgobloda((  (^dDesktopLISTLlayrflgs@LIST4lgobloda((  (PCdLayer 1LISTpageflgs@LISTgobjLIST@layrflgsZLIST(lgobloda  *ddLIST@layrflgsJLIST(lgobloda  *ddLIST@layrflgsHLIST(lgobloda ^dLISTlayrflgs@LIST(lgobloda PCdLISTobj spndflgsusdn}LISTlgoblodaee "aedq 'A'U '; ' DDDDDDDHLISTNtrfltrfdBB B?@o@?ppLISTobj spndflgsusdn~LISTlgobloda[[ "W[dn Hb;; H DDDDDDDH LISTNtrfltrfdBB B?g@?|LISTobj spndflgsusdnLISTlgobloda`` "\`dB 3a3O;O'' DDDDDDDH DLISTNtrfltrfdBB B?r@?wLISTTobj spndflgsusdnLIST&lgobloda "dm;x00g S 00g S 00Mg%t`M; DDDDDDDDDDDDDDDDDDDDDDDDDDDDHDDDDLISTNtrfltrfdBB B?X@?|LISTobj spndflgsusdn?LIST|lgobloda "ddNbb 'vbb$'B'#'B'# DDDDDDDDDDDDDDDDDDDDDDDDDDDDH'B'(LISTNtrfltrfdBB B?W@?LISTobj spndflgsusdn@LISTlgobloda[[ "W[dj T;;O4HOT; DDDDDDDH LISTNtrfltrfdBB B? g@?`uLISTxobj spnd flgsusdnLISTJlgobloda "dA('<'<;4N<&<a( DDDDDDDDDDDDDDDDDDDDDDH'<;(LISTNtrfltrfdBB B?@?@LISTobj spnd flgsusdn4LISTlgoblodaLL "HLdi( DDDDHDDEDLISTNtrfltrfdBB B?@?@LISTobj spnd flgsusdn5LISTlgobloda[[ "W[df N |''(!( ; N N DDDDDDDH LISTNtrfltrfdBB B??LIST obj spndflgsusdn6LISTlgoblodayy "uyd9 'bb! O DDDDDDDH OLISTNtrfltrfdBB B?v@?\@LISTobj spndflgsusdn7LISTlgoblodaee "aed^ u'NNuu DDDDDDDDDHDDDDLISTNtrfltrfdBB B?{?@LISTobj spndflgsusdn8LISTlgoblodaLL "HLd\( DDDDHDDEDLISTNtrfltrfdBB B? ?@LISTobj spnd flgsusdn9LISTlgoblodajj "fjdZNvq DDDDH/LISTNtrfltrfdBB B?@?@LISTobj spndflgsusdn:LISTlgoblodaGG "CGd DDDHLISTNtrfltrfdBB B?x?LIST obj spndflgsusdn;LISTlgoblodayy "uyd~ ' bc- O DDDDDDDDHOLISTNtrfltrfdBB B?\?\@LISTdobj spndflgsusdn<LIST6lgobloda "d}5:5::V:Vb6b6::"OOHbBb DDDDDDDDDDDDDDDDDDDDDHibLISTNtrfltrfdBB B?q@?@LISTobj spnd flgsusdn~LISTlgoblodaGG "CGdO;<O DDDHLISTNtrfltrfdBB B?c?@LISTobj spnd(flgsusdnLISTlgoblodaGG "CGdb DDDHLISTNtrfltrfdBB B?c?X@LISTobj spndflgsusdnLISTlgoblodaGG "CGdu< DDDHLISTNtrfltrfdBB B?c?@LISTobj spnd)flgs usdnLISTlgoblodaGG "CGdv:;: DDDHLISTNtrfltrfdBB B?H?J@LISTobj spnd"flgsusdnLISTlgoblodaGG "CGdv DDDHLISTNtrfltrfdBB B?P@?W@LISTobj spnd#flgsusdnLISTlgoblodaGG "CGd '\\v ' DDDHLISTNtrfltrfdBB B?0@?J@cmx1X RIFFP CMX1cont{Corel Binary Meta File}Windows 3.12210@MbP?  ccmmH@j4Cn-[`d;= K7 ŏy333333PPpage@ \ Layer 10\h5h\ DDDH0T\\hhpT\ DDDHh\0.55hph.5 DDDH.5h0h!h.55h! DDDH.h50hh!T\\h DDDHh\0hpT\h!5hp DDDH!TpN N   o oHOHO  ;55aH[H DDDDDDDDDDDDDDDDDDDDDHH5J vo''vHH vvo DDDDDDDDH'o0bpbb DDDHb6obb A!o DDDDHAb6}bovov } DDDDHv }oN o!AA H Hoo DDDDDDDDDHAD uo''-4uuo DDDDDDDH'oD bb\-  DDDDDDDHb6|aouou | DDDDHu |o AA HH vvbbv: :~uubb A DDDDDDDDDDDDDDDDDDDDDDHv:D i4U4H DDDDDDDH4\II4.4|44Uu24[15\05\ DDDDDDDDDDDDDDDDDDDDDDDDDDDDH\ Q4oo!!}HiHoo!!}HiHoo!!c}44;4v4c4Q4 DDDDDDDDDDDDDDDDDDDDDDDDDDDDH4!J !04\HH! DDDDDDDH\!D  !oo4p4U!! DDDDDDDH4!D   ;!O 5 DDDDDDDH;DesktopGuidesGridrlst    rotlrottrpen drdotrotarclr7 d<(:<(3<(B<((2rscr<LISTindxixlrD@Layer 1DesktopGuides>Gridixtl6 ixpg6 `ixmrH     LISTTINFOIKEY ICMT vim-7.4.1689/runtime/vimlogo.eps000066400000000000000000000273731267703067000164610ustar00rootroot00000000000000%!PS-Adobe-3.0 EPSF-3.0 %%For: %%Title: %%Creator: Scribus1.4.2 %%Pages: 1 %%BoundingBox: 0 0 282 282 %%HiResBoundingBox: 0 0 282 282 %%LanguageLevel: 3 %%EndComments %%BeginProlog /Scribusdict 100 dict def Scribusdict begin /sp {showpage} bind def /oldsetgray /setgray load def /cmyk {setcmykcolor} def /m {moveto} bind def /l {lineto} bind def /li {lineto} bind def /cu {curveto} bind def /cl {closepath} bind def /gs {gsave} bind def /gr {grestore} bind def /tr {translate} bind def /ro {rotate} bind def /sh {show} bind def /shg {setcmykcolor moveto glyphshow} def /shgsp {moveto glyphshow} def /sc {scale} bind def /se {selectfont} bind def /sf {setfont} bind def /sw {setlinewidth} bind def /f {findfont} bind def /fi {fill} bind def /st {stroke} bind def /shgf {gs dup scale begin cvx exec fill end gr} bind def /shgs {gs dup 1 exch div currentlinewidth mul sw dup scale begin cvx exec st end gr} bind def /bEPS { /b4_Inc_state save def /dict_count countdictstack def /op_count count 1 sub def userdict begin /showpage { } def 0 setgray 0 setlinecap 1 setlinewidth 0 setlinejoin 10 setmiterlimit [ ] 0 setdash newpath /languagelevel where {pop languagelevel 1 ne {false setstrokeadjust false setoverprint } if } if } bind def /eEPS { count op_count sub {pop} repeat countdictstack dict_count sub {end} repeat b4_Inc_state restore } bind def end %%EndProlog %%BeginSetup %%EndSetup %%Page: 1 1 %%PageOrientation: Portrait Scribusdict begin save /DeviceCMYK setcolorspace 0 0 tr 0 0 m 282 0 li 282 282 li 0 282 li cl clip newpath gs 0.708406 281.428 m 281.58 281.428 li 281.58 0.556 li 0.708406 0.556 li 0.708406 281.428 li cl eoclip newpath gs 0.216 sw 0 setlinecap 0 setlinejoin [] 0 setdash 0.816406 281.32 tr 280.656 -138.888 m 138.888 0 li 0 -141.696 li 138.888 -280.656 li 280.656 -138.888 li cl 0 0 0 1 cmyk eofill 280.656 -138.888 m 138.888 0 li 0 -141.696 li 138.888 -280.656 li 280.656 -138.888 li cl 0 0 0 1 cmyk st gr gs 0.216 sw 0 setlinecap 0 setlinejoin [] 0 setdash 139.704 142.432 tr 127.584 0 m 136.08 0 li 0 -136.08 li 0 -127.584 li 127.584 0 li cl 0.6 0 0.4 0.580392 cmyk eofill 127.584 0 m 136.08 0 li 0 -136.08 li 0 -127.584 li 127.584 0 li cl 0 0 0 1 cmyk st gr gs 0.216 sw 0 setlinecap 0 setlinejoin [] 0 setdash 6.50391 139.624 tr 0 0 m 8.49609 0 li 133.2 -124.776 li 133.2 -133.272 li 0 0 li cl 0.6 0 0.4 0.509804 cmyk eofill 0 0 m 8.49609 0 li 133.2 -124.776 li 133.2 -133.272 li 0 0 li cl 0 0 0 1 cmyk st gr gs 0.216 sw 0 setlinecap 0 setlinejoin [] 0 setdash 6.50391 275.632 tr 133.2 -8.42384 m 133.2 0 li 0 -136.008 li 8.49609 -136.008 li 133.2 -8.42384 li cl 0.6 0 0.4 0 cmyk eofill 133.2 -8.42384 m 133.2 0 li 0 -136.008 li 8.49609 -136.008 li 133.2 -8.42384 li cl 0 0 0 1 cmyk st gr gs 0.216 sw 0 setlinecap 0 setlinejoin [] 0 setdash 139.704 275.632 tr 0 0 m 0 -8.42384 li 127.584 -133.2 li 136.08 -133.2 li 0 0 li cl 0.729412 0 0.988235 0 cmyk eofill 0 0 m 0 -8.42384 li 127.584 -133.2 li 136.08 -133.2 li 0 0 li cl 0 0 0 1 cmyk st gr gs 0.216 sw 0 setlinecap 0 setlinejoin [] 0 setdash 15 267.208 tr 124.704 -252.36 m 252.288 -124.776 li 124.704 0 li 0 -127.584 li 124.704 -252.36 li cl 0.6 0 0.4 0.4 cmyk eofill 124.704 -252.36 m 252.288 -124.776 li 124.704 0 li 0 -127.584 li 124.704 -252.36 li cl 0 0 0 1 cmyk st gr gs 0.216 sw 0 setlinecap 0 setlinejoin [] 0 setdash 18.8164 270.016 tr 147.384 -31.1758 m 155.88 -39.7431 li 97.2716 -99.2156 li 97.2716 -39.7431 li 102.96 -39.7431 li 111.456 -31.1758 li 111.456 -8.5674 li 102.96 0 li 8.4951 0 li 0 -8.5674 li 0 -31.1758 li 8.4951 -39.7431 li 15.1191 -39.7431 li 15.1191 -232.488 li 25.4873 -240.984 li 54.792 -240.984 li 257.904 -31.1758 li 257.904 -8.5674 li 249.408 0 li 156.816 0 li 147.384 -8.5674 li 147.384 -31.1758 li cl 0 0 0 1 cmyk eofill 147.384 -31.1758 m 155.88 -39.7431 li 97.2716 -99.2156 li 97.2716 -39.7431 li 102.96 -39.7431 li 111.456 -31.1758 li 111.456 -8.5674 li 102.96 0 li 8.4951 0 li 0 -8.5674 li 0 -31.1758 li 8.4951 -39.7431 li 15.1191 -39.7431 li 15.1191 -232.488 li 25.4873 -240.984 li 54.792 -240.984 li 257.904 -31.1758 li 257.904 -8.5674 li 249.408 0 li 156.816 0 li 147.384 -8.5674 li 147.384 -31.1758 li cl 0 0 0 1 cmyk st gr gs 0.216 sw 0 setlinecap 0 setlinejoin [] 0 setdash 24.4316 264.4 tr 5.6885 -28.4404 m 0 -22.752 li 0 -5.7608 li 5.6885 -0.0723 li 94.5364 0 li 100.152 -5.7608 li 94.5364 -8.4961 li 91.6564 -5.7608 li 5.6885 -19.8721 li 5.6885 -28.4404 li cl 0 0 0 0 cmyk eofill 5.6885 -28.4404 m 0 -22.752 li 0 -5.7608 li 5.6885 -0.0723 li 94.5364 0 li 100.152 -5.7608 li 94.5364 -8.4961 li 91.6564 -5.7608 li 5.6885 -19.8721 li 5.6885 -28.4404 li cl 0 0 0 1 cmyk st gr gs 0.216 sw 0 setlinecap 0 setlinejoin [] 0 setdash 40.4883 241.648 tr 6.624 -206.928 m 0 -201.24 li 0 -5.6162 li 6.624 0 li 6.624 -206.928 li cl 0 0 0 0 cmyk eofill 6.624 -206.928 m 0 -201.24 li 0 -5.6162 li 6.624 0 li 6.624 -206.928 li cl 0 0 0 1 cmyk st gr gs 0.216 sw 0 setlinecap 0 setlinejoin [] 0 setdash 100.032 241.648 tr 88.848 -5.6884 m 94.536 0 li 94.536 -11.3759 li 0 -107.712 li 10.44 -85.0324 li 88.848 -5.6884 li cl 0 0 0 0 cmyk eofill 88.848 -5.6884 m 94.536 0 li 94.536 -11.3759 li 0 -107.712 li 10.44 -85.0324 li 88.848 -5.6884 li cl 0 0 0 1 cmyk st gr gs 0.216 sw 0 setlinecap 0 setlinejoin [] 0 setdash 30.1201 247.336 tr 18.9356 -2.8798 m 16.9922 -5.6875 li 10.3682 -11.3759 li 0 -11.3759 li 0 0 li 18.9356 -2.8798 li cl 0 0 0 0.501961 cmyk eofill 18.9356 -2.8798 m 16.9922 -5.6875 li 10.3682 -11.3759 li 0 -11.3759 li 0 0 li 18.9356 -2.8798 li cl 0 0 0 1 cmyk st gr gs 0.216 sw 0 setlinecap 0 setlinejoin [] 0 setdash 100.032 258.64 tr 10.44 -22.6796 m 10.44 -102.024 li 0 -124.632 li 0 -16.9199 li 16.056 -16.9199 li 18.936 -14.1113 li 16.056 0 li 24.552 0 li 24.552 -16.9912 li 18.936 -22.6796 li 10.44 -22.6796 li cl 0 0 0 0.501961 cmyk eofill 10.44 -22.6796 m 10.44 -102.024 li 0 -124.632 li 0 -16.9199 li 16.056 -16.9199 li 18.936 -14.1113 li 16.056 0 li 24.552 0 li 24.552 -16.9912 li 18.936 -22.6796 li 10.44 -22.6796 li cl 0 0 0 1 cmyk st gr gs 0.216 sw 0 setlinecap 0 setlinejoin [] 0 setdash 171.888 264.328 tr 5.616 -28.3681 m 0 -22.6797 li 0 -5.6885 li 6.552 0 li 92.592 0 li 99.216 -5.6885 li 89.712 -14.1845 li 5.616 -19.7998 li 5.616 -28.3681 li cl 0 0 0 0 cmyk eofill 5.616 -28.3681 m 0 -22.6797 li 0 -5.6885 li 6.552 0 li 92.592 0 li 99.216 -5.6885 li 89.712 -14.1845 li 5.616 -19.7998 li 5.616 -28.3681 li cl 0 0 0 1 cmyk st gr gs 0.216 sw 0 setlinecap 0 setlinejoin [] 0 setdash 47.1123 258.64 tr 223.992 -16.9912 m 24.5518 -223.92 li 0 -223.92 li 0 -215.424 li 18 -215.424 li 217.368 -11.3037 li 214.488 0 li 223.992 0 li 223.992 -16.9912 li cl 0 0 0 0.501961 cmyk eofill 223.992 -16.9912 m 24.5518 -223.92 li 0 -223.92 li 0 -215.424 li 18 -215.424 li 217.368 -11.3037 li 214.488 0 li 223.992 0 li 223.992 -16.9912 li cl 0 0 0 1 cmyk st gr gs 0.216 sw 0 setlinecap 0 setlinejoin [] 0 setdash 177.504 247.336 tr 18.936 -2.8798 m 16.992 -5.6875 li 11.376 -11.3759 li 0 -11.3759 li 0 0 li 18.936 -2.8798 li cl 0 0 0 0.501961 cmyk eofill 18.936 -2.8798 m 16.992 -5.6875 li 11.376 -11.3759 li 0 -11.3759 li 0 0 li 18.936 -2.8798 li cl 0 0 0 1 cmyk st gr gs 0.216 sw 0 setlinecap 0 setlinejoin [] 0 setdash 30.1201 258.712 tr 69.9119 -124.704 m 69.9119 -16.9922 li 85.9679 -16.9922 li 88.8479 -14.1836 li 88.8479 -2.8076 li 85.9679 0 li 2.8076 0 li 0 -2.8076 li 0 -14.1836 li 2.8076 -16.9922 li 16.9922 -16.9922 li 16.9922 -215.496 li 20.6641 -218.304 li 36.8643 -218.304 li 235.296 -11.376 li 235.296 -3.2402 li 232.416 0 li 150.264 0 li 147.384 -2.8076 li 147.384 -14.2558 li 150.264 -17.0635 li 164.448 -17.0635 li 164.448 -28.4394 li 69.9119 -124.704 li cl 0 0 0 0.2 cmyk eofill 69.9119 -124.704 m 69.9119 -16.9922 li 85.9679 -16.9922 li 88.8479 -14.1836 li 88.8479 -2.8076 li 85.9679 0 li 2.8076 0 li 0 -2.8076 li 0 -14.1836 li 2.8076 -16.9922 li 16.9922 -16.9922 li 16.9922 -215.496 li 20.6641 -218.304 li 36.8643 -218.304 li 235.296 -11.376 li 235.296 -3.2402 li 232.416 0 li 150.264 0 li 147.384 -2.8076 li 147.384 -14.2558 li 150.264 -17.0635 li 164.448 -17.0635 li 164.448 -28.4394 li 69.9119 -124.704 li cl 0 0 0 1 cmyk st gr gs 0.216 sw 0 setlinecap 0 setlinejoin [] 0 setdash 145.896 139.552 tr 5.688 -5.688 m 12.312 0 li 29.304 0 li 34.056 -5.688 li 28.368 -22.68 li 21.816 -28.368 li 4.824 -28.368 li 0 -22.68 li 5.688 -5.688 li cl 0 0 0 1 cmyk eofill 5.688 -5.688 m 12.312 0 li 29.304 0 li 34.056 -5.688 li 28.368 -22.68 li 21.816 -28.368 li 4.824 -28.368 li 0 -22.68 li 5.688 -5.688 li cl 0 0 0 1 cmyk st gr gs 0.216 sw 0 setlinecap 0 setlinejoin [] 0 setdash 157.272 108.376 tr 0 -68.04 m 17.064 -17.064 li 11.376 -17.064 li 17.064 0 li 42.48 0 li 48.168 -5.688 li 51.984 -5.688 li 57.6 0 li 76.536 0 li 82.224 -5.688 li 85.968 -5.688 li 91.656 0 li 112.392 0 li 119.952 -11.376 li 107.568 -51.696 li 113.184 -51.696 li 107.712 -68.04 li 73.656 -68.04 li 86.976 -28.368 li 78.48 -28.368 li 70.632 -51.552 li 76.248 -51.552 li 70.92 -68.04 li 36.864 -68.04 li 50.112 -28.368 li 41.616 -28.368 li 33.696 -51.696 li 39.384 -51.696 li 34.056 -68.04 li 0 -68.04 li cl 0 0 0 1 cmyk eofill 0 -68.04 m 17.064 -17.064 li 11.376 -17.064 li 17.064 0 li 42.48 0 li 48.168 -5.688 li 51.984 -5.688 li 57.6 0 li 76.536 0 li 82.224 -5.688 li 85.968 -5.688 li 91.656 0 li 112.392 0 li 119.952 -11.376 li 107.568 -51.696 li 113.184 -51.696 li 107.712 -68.04 li 73.656 -68.04 li 86.976 -28.368 li 78.48 -28.368 li 70.632 -51.552 li 76.248 -51.552 li 70.92 -68.04 li 36.864 -68.04 li 50.112 -28.368 li 41.616 -28.368 li 33.696 -51.696 li 39.384 -51.696 li 34.056 -68.04 li 0 -68.04 li cl 0 0 0 1 cmyk st gr gs 0.216 sw 0 setlinecap 0 setlinejoin [] 0 setdash 164.832 102.688 tr 102.24 0 m 106.632 -6.264 li 92.664 -51.048 li 98.28 -51.048 li 96.408 -56.664 li 73.728 -56.664 li 86.976 -16.992 li 67.104 -16.992 li 55.8 -51.048 li 61.416 -51.048 li 59.544 -56.664 li 36.864 -56.664 li 50.112 -16.992 li 30.24 -16.992 li 18.936 -51.048 li 24.624 -51.048 li 22.68 -56.664 li 0 -56.664 li 17.064 -5.688 li 11.376 -5.688 li 13.248 0 li 34.056 0 li 39.744 -5.688 li 45.36 -5.688 li 51.048 0 li 68.04 0 li 73.728 -5.688 li 79.416 -5.688 li 85.104 0 li 102.24 0 li cl 0 0 0 0.2 cmyk eofill 102.24 0 m 106.632 -6.264 li 92.664 -51.048 li 98.28 -51.048 li 96.408 -56.664 li 73.728 -56.664 li 86.976 -16.992 li 67.104 -16.992 li 55.8 -51.048 li 61.416 -51.048 li 59.544 -56.664 li 36.864 -56.664 li 50.112 -16.992 li 30.24 -16.992 li 18.936 -51.048 li 24.624 -51.048 li 22.68 -56.664 li 0 -56.664 li 17.064 -5.688 li 11.376 -5.688 li 13.248 0 li 34.056 0 li 39.744 -5.688 li 45.36 -5.688 li 51.048 0 li 68.04 0 li 73.728 -5.688 li 79.416 -5.688 li 85.104 0 li 102.24 0 li cl 0 0 0 1 cmyk st gr gs 0.216 sw 0 setlinecap 0 setlinejoin [] 0 setdash 120.408 108.376 tr 51.048 0 m 33.696 -51.624 li 39.6 -51.624 li 33.984 -68.04 li 0 -68.04 li 16.992 -17.064 li 11.304 -17.064 li 51.048 0 li cl 11.304 -17.064 m 16.992 0 li 51.048 0 li 11.304 -17.064 li cl 0 0 0 1 cmyk eofill 51.048 0 m 33.696 -51.624 li 39.6 -51.624 li 33.984 -68.04 li 0 -68.04 li 16.992 -17.064 li 11.304 -17.064 li 51.048 0 li cl 11.304 -17.064 m 16.992 0 li 51.048 0 li 11.304 -17.064 li cl 0 0 0 1 cmyk st gr gs 0.216 sw 0 setlinecap 0 setlinejoin [] 0 setdash 127.968 102.688 tr 22.68 -56.664 m 24.552 -51.048 li 18.864 -51.048 li 35.928 0 li 12.312 0 li 10.368 -5.688 li 16.992 -5.688 li 0 -56.664 li 22.68 -56.664 li cl 0 0 0 0.2 cmyk eofill 22.68 -56.664 m 24.552 -51.048 li 18.864 -51.048 li 35.928 0 li 12.312 0 li 10.368 -5.688 li 16.992 -5.688 li 0 -56.664 li 22.68 -56.664 li cl 0 0 0 1 cmyk st gr gs 0.216 sw 0 setlinecap 0 setlinejoin [] 0 setdash 152.52 133.864 tr 16.992 -14.184 m 20.808 -2.808 li 18.936 0 li 7.56 0 li 3.816 -2.808 li 0 -14.184 li 1.944 -16.992 li 13.32 -16.992 li 16.992 -14.184 li cl 0 0 0 0.2 cmyk eofill 16.992 -14.184 m 20.808 -2.808 li 18.936 0 li 7.56 0 li 3.816 -2.808 li 0 -14.184 li 1.944 -16.992 li 13.32 -16.992 li 16.992 -14.184 li cl 0 0 0 1 cmyk st gr gr %%PageTrailer restore gs gr sp end %%Trailer %%EOF vim-7.4.1689/runtime/vimlogo.gif000066400000000000000000000021031267703067000164170ustar00rootroot00000000000000GIF89a}<! ,}<I`(diN@qp,麶sR :rkRt:%uKE:TaI> Q3.^>>Nc7c{z.s=x}~Gpv{s~w`h~EM@)8$nPPɵȳq"\-Q)شi--A(:p.thA zʐn%c';P'C:N$92jx%F1Nq?)Qiwˏ9Ai~ r% Q^Lf茊zDLЃkuV*F\*tǶT5Y m"kɵ&_-DDWϴ4[¼P-| -I +EH55֭fl_汛w:ߞm+=FҮTIxs(MoΎO^C\Q鷗fBTԇ_vireUWW8Q$Q]g8$Њb!'R1fԀ(>H$E)0$0HsTVYU^U4F%]`b-LfXMR'^QDX$ghhf}UC5hel:9axh@k;MaKHaxM`DE}J|yZڪjюXdS y}uU*KrM"/vx]]tK2DtCև +.A*,gDAے*g@ -J#03&3/-+qŅ`<2fPOwɨzsllws!L9 oE/0rL9̸_s`L6cudn[TzE1\-%B 0rݠ';vim-7.4.1689/runtime/vimlogo.pdf000066400000000000000000000043161267703067000164330ustar00rootroot00000000000000%PDF-1.2 %쏢 6 0 obj <> stream xYn$EWC}O@ M>ZeM[X֌_wDbwp~|?H?vro\t 1P.%$HJg-_;P_ >Q? !A@JY" -b]s (QNZԫR=E/ (R=g3^>P^E4sI%@˚nɜyĈ:̠>x6/Lk2_Ĵps[+lJW?ZJ轞OX\z#+ *]M,t2޶JvyY_s DjBD^{)8IQ[הHWI 'B[\-%ހ\YYdC @ g;V.uHm %G" A,*sCg;e"#qԈ Z&Iˁ{.FI2'⪘O@"i,)ʳ !k>`JS}YocXϞ K^?kg%ٓN,;m0 %@-XD㨉ύڐ~^RIf@'hKh>N$QC2jLg8 †`lt tQB0's)y*8&,\˚&Щ& 9o@ 2`y–Meh]-UgmC++:ُߺ75sd\W\,k۸µ|^|߇&( 6XNLT:h+CZ.Z#^>Yk>ѷJ}K5e uM b6S< endstream endobj 7 0 obj 1428 endobj 5 0 obj <> /Contents 6 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 5 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 4 0 obj <> endobj 8 0 obj <> endobj 2 0 obj <>endobj xref 0 9 0000000000 65535 f 0000001732 00000 n 0000001864 00000 n 0000001673 00000 n 0000001780 00000 n 0000001533 00000 n 0000000015 00000 n 0000001513 00000 n 0000001835 00000 n trailer << /Size 9 /Root 1 0 R /Info 2 0 R >> startxref 1998 %%EOF vim-7.4.1689/runtime/vimlogo.xpm000066400000000000000000000175061267703067000164730ustar00rootroot00000000000000/* 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" }; vim-7.4.1689/runtime/vimrc_example.vim000066400000000000000000000063521267703067000176360ustar00rootroot00000000000000" An example for a vimrc file. " " Maintainer: Bram Moolenaar " Last change: 2016 Mar 25 " " 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 than 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 (restore to previous version) set undofile " keep an undo file (undo changes after closing) 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 " CTRL-U in insert mode deletes a lot. Use CTRL-G u to first break undo, " so that you can undo CTRL-U after inserting a line break. inoremap u " In many terminal emulators the mouse works just fine, thus enable it. if has('mouse') set mouse=a endif " 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("'\"") >= 1 && line("'\"") <= line("$") | \ exe "normal! g`\"" | \ endif augroup END else set autoindent " always set autoindenting on endif " has("autocmd") " Convenient command to see the difference between the current buffer and the " file it was loaded from, thus the changes you made. " Only define it when not defined already. if !exists(":DiffOrig") command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis \ | wincmd p | diffthis endif if has('langmap') && exists('+langnoremap') " Prevent that the langmap option applies to characters that result from a " mapping. If unset (default), this may break plugins (but it's backward " compatible). set langnoremap endif " Add optional packages. " " The matchit plugin makes the % command work better, but it is not backwards " compatible. packadd matchit vim-7.4.1689/src/000077500000000000000000000000001267703067000133645ustar00rootroot00000000000000vim-7.4.1689/src/GvimExt/000077500000000000000000000000001267703067000147475ustar00rootroot00000000000000vim-7.4.1689/src/GvimExt/GvimExt.reg000066400000000000000000000013311267703067000170270ustar00rootroot00000000000000REGEDIT4 [HKEY_CLASSES_ROOT\CLSID\{51EEE242-AD87-11d3-9C1E-0090278BBD99}] @="Vim Shell Extension" [HKEY_CLASSES_ROOT\CLSID\{51EEE242-AD87-11d3-9C1E-0090278BBD99}\InProcServer32] @="gvimext.dll" "ThreadingModel"="Apartment" [HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\gvim] @="{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"="gvim.exe" [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Vim 7.4] "DisplayName"="Vim 7.4: Edit with Vim popup menu entry" "UninstallString"="uninstal.exe" vim-7.4.1689/src/GvimExt/Make_bc5.mak000066400000000000000000000016151267703067000170520ustar00rootroot00000000000000### USEDLL no for statically linked version of run-time, yes for DLL runtime ### BOR path to root of Borland C install (c:\bc5) ### (requires cc3250.dll be available in %PATH%) !if ("$(USEDLL)"=="") USEDLL = no !endif ### BOR: root of the BC installation !if ("$(BOR)"=="") BOR = c:\bc5 !endif CC = $(BOR)\bin\Bcc32 BRC = $(BOR)\bin\brc32 LINK = $(BOR)\BIN\ILink32 INCLUDE = $(BOR)\include;. LIB = $(BOR)\lib !if ("$(USEDLL)"=="yes") RT_DEF = -D_RTLDLL RT_LIB = cw32i.lib !else RT_DEF = RT_LIB = cw32.lib !endif all : gvimext.dll gvimext.obj : gvimext.cpp gvimext.h $(CC) -tWD -I$(INCLUDE) -c -DFEAT_GETTEXT $(RT_DEF) -w- gvimext.cpp gvimext.res : gvimext.rc $(BRC) -r gvimext.rc gvimext.dll : gvimext.obj gvimext.res $(LINK) -L$(LIB) -aa gvimext.obj, gvimext.dll, , c0d32.obj $(RT_LIB) import32.lib, gvimext.def, gvimext.res clean : -@del gvimext.obj -@del gvimext.res -@del gvimext.dll vim-7.4.1689/src/GvimExt/Make_ming.mak000066400000000000000000000042241267703067000173320ustar00rootroot00000000000000# Project: gvimext # Generates gvimext.dll with gcc. # To be used with MingW and Cygwin. # # Originally, the DLL base address was fixed: -Wl,--image-base=0x1C000000 # Now it is allocated dymanically by the linker by evaluating all DLLs # already loaded in memory. The binary image contains as well information # for automatic pseudo-rebasing, if needed by the system. ALV 2004-02-29 # If cross-compiling set this to yes, else set it to no CROSS = no #CROSS = yes # For the old MinGW 2.95 (the one you get e.g. with debian woody) # set the following variable to yes and check if the executables are # really named that way. # If you have a newer MinGW or you are using cygwin set it to no and # check also the executables MINGWOLD = no # Link against the shared versions of libgcc/libstdc++ by default. Set # STATIC_STDCPLUS to "yes" to link against static versions instead. STATIC_STDCPLUS=no #STATIC_STDCPLUS=yes # Note: -static-libstdc++ is not available until gcc 4.5.x. LDFLAGS += -shared ifeq (yes, $(STATIC_STDCPLUS)) LDFLAGS += -static-libgcc -static-libstdc++ endif ifeq ($(CROSS),yes) DEL = rm ifeq ($(MINGWOLD),yes) CXXFLAGS := -O2 -fvtable-thunks else CXXFLAGS := -O2 endif else CXXFLAGS := -O2 ifneq (sh.exe, $(SHELL)) DEL = rm else DEL = del endif endif # Set the default $(WINVER) to make it work with WinXP. ifndef WINVER WINVER = 0x0501 endif CXX := $(CROSS_COMPILE)g++ WINDRES := $(CROSS_COMPILE)windres WINDRES_CXX = $(CXX) WINDRES_FLAGS = --preprocessor="$(WINDRES_CXX) -E -xc" -DRC_INVOKED LIBS := -luuid -lgdi32 RES := gvimext.res DEFFILE = gvimext_ming.def OBJ := gvimext.o DLL := gvimext.dll .PHONY: all all-before all-after clean clean-custom all: all-before $(DLL) all-after $(DLL): $(OBJ) $(RES) $(DEFFILE) $(CXX) $(LDFLAGS) $(CXXFLAGS) -s -o $@ \ -Wl,--enable-auto-image-base \ -Wl,--enable-auto-import \ -Wl,--whole-archive \ $^ \ -Wl,--no-whole-archive \ $(LIBS) gvimext.o: gvimext.cpp $(CXX) $(CXXFLAGS) -DFEAT_GETTEXT -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) -c $? -o $@ $(RES): gvimext_ming.rc $(WINDRES) $(WINDRES_FLAGS) --input-format=rc --output-format=coff -DMING $? -o $@ clean: clean-custom -$(DEL) $(OBJ) $(RES) $(DLL) vim-7.4.1689/src/GvimExt/Makefile000066400000000000000000000031141267703067000164060ustar00rootroot00000000000000# Makefile for GvimExt, using MSVC # Options: # DEBUG=yes Build debug version (for VC7 and maybe later) # TARGETOS=BOTH !ifndef APPVER APPVER=5.0 !endif !if "$(DEBUG)" != "yes" NODEBUG = 1 !endif !ifdef PROCESSOR_ARCHITECTURE # On Windows NT ! ifndef CPU CPU = i386 ! if !defined(PLATFORM) && defined(TARGET_CPU) PLATFORM = $(TARGET_CPU) ! endif ! ifdef PLATFORM ! if ("$(PLATFORM)" == "x64") || ("$(PLATFORM)" == "X64") CPU = AMD64 ! elseif ("$(PLATFORM)" != "x86") && ("$(PLATFORM)" != "X86") ! error *** ERROR Unknown target platform "$(PLATFORM)". Make aborted. ! endif ! endif ! endif !else CPU = i386 !endif !ifdef SDK_INCLUDE_DIR !include $(SDK_INCLUDE_DIR)\Win32.mak !else !include !endif all: gvimext.dll gvimext.dll: gvimext.obj \ gvimext.res # $(implib) /NOLOGO -machine:$(CPU) -def:gvimext.def $** -out:gvimext.lib # $(link) $(dlllflags) -base:0x1C000000 -out:$*.dll $** $(olelibsdll) shell32.lib gvimext.lib comctl32.lib gvimext.exp $(link) $(lflags) -dll -def:gvimext.def -base:0x1C000000 -out:$*.dll $** $(olelibsdll) shell32.lib comctl32.lib if exist $*.dll.manifest mt -nologo -manifest $*.dll.manifest -outputresource:$*.dll;2 gvimext.obj: gvimext.h .cpp.obj: $(cc) $(cflags) -DFEAT_GETTEXT $(cvarsmt) $*.cpp gvimext.res: gvimext.rc $(rc) /nologo $(rcflags) $(rcvars) gvimext.rc clean: - if exist gvimext.dll del gvimext.dll - if exist gvimext.lib del gvimext.lib - if exist gvimext.exp del gvimext.exp - if exist gvimext.obj del gvimext.obj - if exist gvimext.res del gvimext.res - if exist gvimext.dll.manifest del gvimext.dll.manifest vim-7.4.1689/src/GvimExt/README.txt000066400000000000000000000077611267703067000164600ustar00rootroot00000000000000README.txt for the gvimext DLL. Written by Tianmiao Hu. Edited by Bram Moolenaar. INSTALLATION To install the "Edit with Vim" popup menu entry, it is recommended to use the "install.exe" program. It will ask you a few questions and install the needed registry entries. In special situations you might want to make changes by hand. Check these items: - The gvimext.dll, gvim.exe and uninstal.exe either need to be in the search path, or you have to set the full path in the registry entries. You could move the gvimext.dll to the "windows\system" or "windows\system32" directory, where the other DLL files are. - You can find the names of the used registry entries in the file "GvimExt.reg". You can edit this file to add the paths. To install the registry entries, right-click the gvimext.reg file and choose the "merge" menu option. - The registry key [HKEY_LOCAL_MACHINE\Software\Vim\Gvim] is used by the gvimext.dll. The value "path" specifies the location of "gvim.exe". If gvim.exe is in the search path, the path can be omitted. The value "lang" can be used to set the language, for example "de" for German. If "lang" is omitted, the language set for Windows will be used. It is the preferred method to keep gvim.exe with the runtime files, so that Vim will find them (also the translated menu items are there). UNINSTALLATION To uninstall the "Edit with Vim" popup menu entry, it is recommended to use the "uninstal.exe" program. In special situations you might want to uninstall by hand: - Open the registry by running regedit.exe. - Delete all the keys listed in GvimExt.reg, except this one: [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved] For this key, only delete one value: "{51EEE242-AD87-11d3-9C1E-0090278BBD99}"="Vim Shell Extension" - Delete the gvimext.dll, if you want. You might need to reboot the machine in order to remove this file. A quick way is to log off and re-login. Another method is by using the uninst.bat script: uninst gvimext.inf This batch file will remove all the registry keys from the system. Then you can remove the gvimext.dll file. Note: In order for this batch file to work, you must have two system files: rundll32.exe and setupapi.dll. I believe you will have rundll32.exe in your system. I know windows nt 4.0 with the service pack 4 has setupapi.dll. My windows 95 has setupapi.dll. I find that the internet explorer 4.0 comes with the setupapi.dll in file Ie4_5.cab. If you do encounter problems running this script, then probably you need to modify the uninst.bat to suit to your system. Basically, you must find out where are the locations for your rundll32.exe and setupapi.dll files. In windows nt, both files are under c:\winnt\system32 directory. In my windows 95 system, I got setupapi.dll at c:\windows\system and rundll32.exe at c:\windows. So you might want to try something like: rundll32.exe c:\windows\system\setupapi.dll,InstallHinfSection DefaultUninstall 128 %1 where %1 can be substituted by gvimext.inf THE SOURCE CODE I have provided the source code here in hope that gvim users around world can further enhance this little dll. I believe the only thing you need to change is gvimext.cpp file. The important two functions you need to look at are QueryContextMenu and InvokeCommand. You can modify right-click menus in the QueryContextMenu function and invoke gvim in the InvokeCommand function. Note the selected files can be accessed from the DragQueryFile function. I am not familiar with the invoking options for gvim. I believe there are some improvements that can be made on that side. I use MS Visual C++ 6.0's nmake to make the gvimext.dll. I don't have a chance to try earlier versions of MSVC. The files that are required for build are: gvimext.cpp gvimext.h gvimext.def gvimext.rc resource.h Makefile To compile the DLL from the command line: vcvars32 nmake -f Makefile If you did something interesting to this dll, please let me know @ tianmiao@acm.org. Happy vimming!!! vim-7.4.1689/src/GvimExt/gvimext.cpp000066400000000000000000000631711267703067000171460ustar00rootroot00000000000000/* vi:set ts=8 sts=4 sw=4: * * VIM - Vi IMproved gvimext by Tianmiao Hu * * Do ":help uganda" in Vim to read copying and usage conditions. * Do ":help credits" in Vim to see a list of people who contributed. */ /* * gvimext is a DLL which is used for the "Edit with Vim" context menu * extension. It implements a MS defined interface with the Shell. * * If you have any questions or any suggestions concerning gvimext, please * contact Tianmiao Hu: tianmiao@acm.org. */ #include "gvimext.h" #ifdef __BORLANDC__ # include # ifndef _strnicmp # define _strnicmp(a, b, c) strnicmp((a), (b), (c)) # endif #else static char *searchpath(char *name); #endif // Always get an error while putting the following stuff to the // gvimext.h file as class protected variables, give up and // declare them as global stuff FORMATETC fmte = {CF_HDROP, (DVTARGETDEVICE FAR *)NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }; STGMEDIUM medium; HRESULT hres = 0; UINT cbFiles = 0; /* The buffers size used to be MAX_PATH (256 bytes), but that's not always * enough */ #define BUFSIZE 1100 // // Get the name of the Gvim executable to use, with the path. // When "runtime" is non-zero, we were called to find the runtime directory. // Returns the path in name[BUFSIZE]. It's empty when it fails. // static void getGvimName(char *name, int runtime) { HKEY keyhandle; DWORD hlen; // Get the location of gvim from the registry. name[0] = 0; if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\Vim\\Gvim", 0, KEY_READ, &keyhandle) == ERROR_SUCCESS) { hlen = BUFSIZE; if (RegQueryValueEx(keyhandle, "path", 0, NULL, (BYTE *)name, &hlen) != ERROR_SUCCESS) name[0] = 0; else name[hlen] = 0; RegCloseKey(keyhandle); } // Registry didn't work, use the search path. if (name[0] == 0) strcpy(name, searchpath((char *)"gvim.exe")); if (!runtime) { // Only when looking for the executable, not the runtime dir, we can // search for the batch file or a name without a path. if (name[0] == 0) strcpy(name, searchpath((char *)"gvim.bat")); if (name[0] == 0) strcpy(name, "gvim"); // finds gvim.bat or gvim.exe } } static void getGvimInvocation(char *name, int runtime) { getGvimName(name, runtime); // avoid that Vim tries to expand wildcards in the file names strcat(name, " --literal"); } static void getGvimInvocationW(wchar_t *nameW) { char *name; name = (char *)malloc(BUFSIZE); getGvimInvocation(name, 0); mbstowcs(nameW, name, BUFSIZE); free(name); } // // Get the Vim runtime directory into buf[BUFSIZE]. // The result is empty when it failed. // When it works, the path ends in a slash or backslash. // static void getRuntimeDir(char *buf) { int idx; getGvimName(buf, 1); if (buf[0] != 0) { // When no path found, use the search path to expand it. if (strchr(buf, '/') == NULL && strchr(buf, '\\') == NULL) strcpy(buf, searchpath(buf)); // remove "gvim.exe" from the end for (idx = (int)strlen(buf) - 1; idx >= 0; idx--) if (buf[idx] == '\\' || buf[idx] == '/') { buf[idx + 1] = 0; break; } } } HBITMAP IconToBitmap(HICON hIcon, HBRUSH hBackground, int width, int height) { HDC hDC = GetDC(NULL); HDC hMemDC = CreateCompatibleDC(hDC); HBITMAP hMemBmp = CreateCompatibleBitmap(hDC, width, height); HBITMAP hResultBmp = NULL; HGDIOBJ hOrgBMP = SelectObject(hMemDC, hMemBmp); DrawIconEx(hMemDC, 0, 0, hIcon, width, height, 0, hBackground, DI_NORMAL); hResultBmp = hMemBmp; hMemBmp = NULL; SelectObject(hMemDC, hOrgBMP); DeleteDC(hMemDC); ReleaseDC(NULL, hDC); DestroyIcon(hIcon); return hResultBmp; } // // GETTEXT: translated messages and menu entries // #ifndef FEAT_GETTEXT # define _(x) x #else # define _(x) (*dyn_libintl_gettext)(x) # define VIMPACKAGE "vim" # ifndef GETTEXT_DLL # define GETTEXT_DLL "libintl.dll" # define GETTEXT_DLL_ALT "libintl-8.dll" # endif // Dummy functions static char *null_libintl_gettext(const char *); static char *null_libintl_textdomain(const char *); static char *null_libintl_bindtextdomain(const char *, const char *); static int dyn_libintl_init(char *dir); static void dyn_libintl_end(void); static wchar_t *oldenv = NULL; static HINSTANCE hLibintlDLL = 0; static char *(*dyn_libintl_gettext)(const char *) = null_libintl_gettext; static char *(*dyn_libintl_textdomain)(const char *) = null_libintl_textdomain; static char *(*dyn_libintl_bindtextdomain)(const char *, const char *) = null_libintl_bindtextdomain; // // Attempt to load libintl.dll. If it doesn't work, use dummy functions. // "dir" is the directory where the libintl.dll might be. // Return 1 for success, 0 for failure. // static int dyn_libintl_init(char *dir) { int i; static struct { char *name; FARPROC *ptr; } libintl_entry[] = { {(char *)"gettext", (FARPROC*)&dyn_libintl_gettext}, {(char *)"textdomain", (FARPROC*)&dyn_libintl_textdomain}, {(char *)"bindtextdomain", (FARPROC*)&dyn_libintl_bindtextdomain}, {NULL, NULL} }; DWORD len, len2; LPWSTR buf = NULL; LPWSTR buf2 = NULL; // No need to initialize twice. if (hLibintlDLL) return 1; // Load gettext library from the Vim runtime directory. // Add the directory to $PATH temporarily. len = GetEnvironmentVariableW(L"PATH", NULL, 0); len2 = MAX_PATH + 1 + len; buf = (LPWSTR)malloc(len * sizeof(WCHAR)); buf2 = (LPWSTR)malloc(len2 * sizeof(WCHAR)); if (buf != NULL && buf2 != NULL) { GetEnvironmentVariableW(L"PATH", buf, len); _snwprintf(buf2, len2, L"%S;%s", dir, buf); SetEnvironmentVariableW(L"PATH", buf2); hLibintlDLL = LoadLibrary(GETTEXT_DLL); #ifdef GETTEXT_DLL_ALT if (!hLibintlDLL) hLibintlDLL = LoadLibrary(GETTEXT_DLL_ALT); #endif SetEnvironmentVariableW(L"PATH", buf); } free(buf); free(buf2); if (!hLibintlDLL) return 0; // Get the addresses of the functions we need. for (i = 0; libintl_entry[i].name != NULL && libintl_entry[i].ptr != NULL; ++i) { if ((*libintl_entry[i].ptr = GetProcAddress(hLibintlDLL, libintl_entry[i].name)) == NULL) { dyn_libintl_end(); return 0; } } return 1; } static void dyn_libintl_end(void) { 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; } // // Setup for translating strings. // static void dyn_gettext_load(void) { char szBuff[BUFSIZE]; char szLang[BUFSIZE]; DWORD len; HKEY keyhandle; int gotlang = 0; strcpy(szLang, "LANG="); // First try getting the language from the registry, this can be // used to overrule the system language. if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\Vim\\Gvim", 0, KEY_READ, &keyhandle) == ERROR_SUCCESS) { len = BUFSIZE; if (RegQueryValueEx(keyhandle, "lang", 0, NULL, (BYTE*)szBuff, &len) == ERROR_SUCCESS) { szBuff[len] = 0; strcat(szLang, szBuff); gotlang = 1; } RegCloseKey(keyhandle); } if (!gotlang && getenv("LANG") == NULL) { // Get the language from the system. // Could use LOCALE_SISO639LANGNAME, but it's not in Win95. // LOCALE_SABBREVLANGNAME gives us three letters, like "enu", we use // only the first two. len = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SABBREVLANGNAME, (LPTSTR)szBuff, BUFSIZE); if (len >= 2 && _strnicmp(szBuff, "en", 2) != 0) { // There are a few exceptions (probably more) if (_strnicmp(szBuff, "cht", 3) == 0 || _strnicmp(szBuff, "zht", 3) == 0) strcpy(szBuff, "zh_TW"); else if (_strnicmp(szBuff, "chs", 3) == 0 || _strnicmp(szBuff, "zhc", 3) == 0) strcpy(szBuff, "zh_CN"); else if (_strnicmp(szBuff, "jp", 2) == 0) strcpy(szBuff, "ja"); else szBuff[2] = 0; // truncate to two-letter code strcat(szLang, szBuff); gotlang = 1; } } if (gotlang) putenv(szLang); // Try to locate the runtime files. The path is used to find libintl.dll // and the vim.mo files. getRuntimeDir(szBuff); if (szBuff[0] != 0) { len = (DWORD)strlen(szBuff); if (dyn_libintl_init(szBuff)) { strcpy(szBuff + len, "lang"); (*dyn_libintl_bindtextdomain)(VIMPACKAGE, szBuff); (*dyn_libintl_textdomain)(VIMPACKAGE); } } } static void dyn_gettext_free(void) { dyn_libintl_end(); } #endif // FEAT_GETTEXT // // Global variables // UINT g_cRefThisDll = 0; // Reference count of this DLL. HINSTANCE g_hmodThisDll = NULL; // Handle to this DLL itself. //--------------------------------------------------------------------------- // DllMain //--------------------------------------------------------------------------- extern "C" int APIENTRY DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /* lpReserved */) { switch (dwReason) { case DLL_PROCESS_ATTACH: // Extension DLL one-time initialization g_hmodThisDll = hInstance; break; case DLL_PROCESS_DETACH: break; } return 1; // ok } static void inc_cRefThisDLL() { #ifdef FEAT_GETTEXT if (g_cRefThisDll == 0) { dyn_gettext_load(); oldenv = GetEnvironmentStringsW(); } #endif InterlockedIncrement((LPLONG)&g_cRefThisDll); } static void dec_cRefThisDLL() { #ifdef FEAT_GETTEXT if (InterlockedDecrement((LPLONG)&g_cRefThisDll) == 0) { dyn_gettext_free(); if (oldenv != NULL) { FreeEnvironmentStringsW(oldenv); oldenv = NULL; } } #else InterlockedDecrement((LPLONG)&g_cRefThisDll); #endif } //--------------------------------------------------------------------------- // DllCanUnloadNow //--------------------------------------------------------------------------- STDAPI DllCanUnloadNow(void) { return (g_cRefThisDll == 0 ? S_OK : S_FALSE); } STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppvOut) { *ppvOut = NULL; if (IsEqualIID(rclsid, CLSID_ShellExtension)) { CShellExtClassFactory *pcf = new CShellExtClassFactory; return pcf->QueryInterface(riid, ppvOut); } return CLASS_E_CLASSNOTAVAILABLE; } CShellExtClassFactory::CShellExtClassFactory() { m_cRef = 0L; inc_cRefThisDLL(); } CShellExtClassFactory::~CShellExtClassFactory() { dec_cRefThisDLL(); } STDMETHODIMP CShellExtClassFactory::QueryInterface(REFIID riid, LPVOID FAR *ppv) { *ppv = NULL; // any interface on this object is the object pointer if (IsEqualIID(riid, IID_IUnknown) || IsEqualIID(riid, IID_IClassFactory)) { *ppv = (LPCLASSFACTORY)this; AddRef(); return NOERROR; } return E_NOINTERFACE; } STDMETHODIMP_(ULONG) CShellExtClassFactory::AddRef() { return InterlockedIncrement((LPLONG)&m_cRef); } STDMETHODIMP_(ULONG) CShellExtClassFactory::Release() { if (InterlockedDecrement((LPLONG)&m_cRef)) return m_cRef; delete this; return 0L; } STDMETHODIMP CShellExtClassFactory::CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj) { *ppvObj = NULL; // Shell extensions typically don't support aggregation (inheritance) if (pUnkOuter) return CLASS_E_NOAGGREGATION; // Create the main shell extension object. The shell will then call // QueryInterface with IID_IShellExtInit--this is how shell extensions are // initialized. LPCSHELLEXT pShellExt = new CShellExt(); // create the CShellExt object if (NULL == pShellExt) return E_OUTOFMEMORY; return pShellExt->QueryInterface(riid, ppvObj); } STDMETHODIMP CShellExtClassFactory::LockServer(BOOL /* fLock */) { return NOERROR; } // *********************** CShellExt ************************* CShellExt::CShellExt() { m_cRef = 0L; m_pDataObj = NULL; inc_cRefThisDLL(); LoadMenuIcon(); } CShellExt::~CShellExt() { if (m_pDataObj) m_pDataObj->Release(); dec_cRefThisDLL(); if (m_hVimIconBitmap) DeleteObject(m_hVimIconBitmap); } STDMETHODIMP CShellExt::QueryInterface(REFIID riid, LPVOID FAR *ppv) { *ppv = NULL; if (IsEqualIID(riid, IID_IShellExtInit) || IsEqualIID(riid, IID_IUnknown)) { *ppv = (LPSHELLEXTINIT)this; } else if (IsEqualIID(riid, IID_IContextMenu)) { *ppv = (LPCONTEXTMENU)this; } if (*ppv) { AddRef(); return NOERROR; } return E_NOINTERFACE; } STDMETHODIMP_(ULONG) CShellExt::AddRef() { return InterlockedIncrement((LPLONG)&m_cRef); } STDMETHODIMP_(ULONG) CShellExt::Release() { if (InterlockedDecrement((LPLONG)&m_cRef)) return m_cRef; delete this; return 0L; } // // FUNCTION: CShellExt::Initialize(LPCITEMIDLIST, LPDATAOBJECT, HKEY) // // PURPOSE: Called by the shell when initializing a context menu or property // sheet extension. // // PARAMETERS: // pIDFolder - Specifies the parent folder // pDataObj - Specifies the set of items selected in that folder. // hRegKey - Specifies the type of the focused item in the selection. // // RETURN VALUE: // // NOERROR in all cases. // // COMMENTS: Note that at the time this function is called, we don't know // (or care) what type of shell extension is being initialized. // It could be a context menu or a property sheet. // STDMETHODIMP CShellExt::Initialize(LPCITEMIDLIST /* pIDFolder */, LPDATAOBJECT pDataObj, HKEY /* hRegKey */) { // Initialize can be called more than once if (m_pDataObj) m_pDataObj->Release(); // duplicate the object pointer and registry handle if (pDataObj) { m_pDataObj = pDataObj; pDataObj->AddRef(); } return NOERROR; } // // FUNCTION: CShellExt::QueryContextMenu(HMENU, UINT, UINT, UINT, UINT) // // PURPOSE: Called by the shell just before the context menu is displayed. // This is where you add your specific menu items. // // PARAMETERS: // hMenu - Handle to the context menu // indexMenu - Index of where to begin inserting menu items // idCmdFirst - Lowest value for new menu ID's // idCmtLast - Highest value for new menu ID's // uFlags - Specifies the context of the menu event // // RETURN VALUE: // // // COMMENTS: // STDMETHODIMP CShellExt::QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT /* idCmdLast */, UINT /* uFlags */) { UINT idCmd = idCmdFirst; hres = m_pDataObj->GetData(&fmte, &medium); if (medium.hGlobal) cbFiles = DragQueryFile((HDROP)medium.hGlobal, (UINT)-1, 0, 0); // InsertMenu(hMenu, indexMenu++, MF_SEPARATOR|MF_BYPOSITION, 0, NULL); // Initialize m_cntOfHWnd to 0 m_cntOfHWnd = 0; HKEY keyhandle; bool showExisting = true; bool showIcons = true; // Check whether "Edit with existing Vim" entries are disabled. if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\Vim\\Gvim", 0, KEY_READ, &keyhandle) == ERROR_SUCCESS) { if (RegQueryValueEx(keyhandle, "DisableEditWithExisting", 0, NULL, NULL, NULL) == ERROR_SUCCESS) showExisting = false; if (RegQueryValueEx(keyhandle, "DisableContextMenuIcons", 0, NULL, NULL, NULL) == ERROR_SUCCESS) showIcons = false; RegCloseKey(keyhandle); } // Retrieve all the vim instances, unless disabled. if (showExisting) EnumWindows(EnumWindowsProc, (LPARAM)this); MENUITEMINFO mii = { sizeof(MENUITEMINFO) }; mii.fMask = MIIM_STRING | MIIM_ID; if (showIcons) { mii.fMask |= MIIM_BITMAP; mii.hbmpItem = m_hVimIconBitmap; } if (cbFiles > 1) { mii.wID = idCmd++; mii.dwTypeData = _("Edit with &multiple Vims"); mii.cch = lstrlen(mii.dwTypeData); InsertMenuItem(hMenu, indexMenu++, TRUE, &mii); mii.wID = idCmd++; mii.dwTypeData = _("Edit with single &Vim"); mii.cch = lstrlen(mii.dwTypeData); InsertMenuItem(hMenu, indexMenu++, TRUE, &mii); if (cbFiles <= 4) { // Can edit up to 4 files in diff mode mii.wID = idCmd++; mii.dwTypeData = _("Diff with Vim"); mii.cch = lstrlen(mii.dwTypeData); InsertMenuItem(hMenu, indexMenu++, TRUE, &mii); m_edit_existing_off = 3; } else m_edit_existing_off = 2; } else { mii.wID = idCmd++; mii.dwTypeData = _("Edit with &Vim"); mii.cch = lstrlen(mii.dwTypeData); InsertMenuItem(hMenu, indexMenu++, TRUE, &mii); m_edit_existing_off = 1; } // Now display all the vim instances for (int i = 0; i < m_cntOfHWnd; i++) { char title[BUFSIZE]; char temp[BUFSIZE]; // Obtain window title, continue if can not if (GetWindowText(m_hWnd[i], title, BUFSIZE - 1) == 0) continue; // Truncate the title before the path, keep the file name char *pos = strchr(title, '('); if (pos != NULL) { if (pos > title && pos[-1] == ' ') --pos; *pos = 0; } // Now concatenate strncpy(temp, _("Edit with existing Vim - "), BUFSIZE - 1); temp[BUFSIZE - 1] = '\0'; strncat(temp, title, BUFSIZE - 1 - strlen(temp)); temp[BUFSIZE - 1] = '\0'; mii.wID = idCmd++; mii.dwTypeData = temp; mii.cch = lstrlen(mii.dwTypeData); InsertMenuItem(hMenu, indexMenu++, TRUE, &mii); } // InsertMenu(hMenu, indexMenu++, MF_SEPARATOR|MF_BYPOSITION, 0, NULL); // Must return number of menu items we added. return ResultFromShort(idCmd-idCmdFirst); } // // FUNCTION: CShellExt::InvokeCommand(LPCMINVOKECOMMANDINFO) // // PURPOSE: Called by the shell after the user has selected on of the // menu items that was added in QueryContextMenu(). // // PARAMETERS: // lpcmi - Pointer to an CMINVOKECOMMANDINFO structure // // RETURN VALUE: // // // COMMENTS: // STDMETHODIMP CShellExt::InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi) { HRESULT hr = E_INVALIDARG; // If HIWORD(lpcmi->lpVerb) then we have been called programmatically // and lpVerb is a command that should be invoked. Otherwise, the shell // has called us, and LOWORD(lpcmi->lpVerb) is the menu ID the user has // selected. Actually, it's (menu ID - idCmdFirst) from QueryContextMenu(). if (!HIWORD(lpcmi->lpVerb)) { UINT idCmd = LOWORD(lpcmi->lpVerb); if (idCmd >= m_edit_existing_off) { // Existing with vim instance hr = PushToWindow(lpcmi->hwnd, lpcmi->lpDirectory, lpcmi->lpVerb, lpcmi->lpParameters, lpcmi->nShow, idCmd - m_edit_existing_off); } else { switch (idCmd) { case 0: hr = InvokeGvim(lpcmi->hwnd, lpcmi->lpDirectory, lpcmi->lpVerb, lpcmi->lpParameters, lpcmi->nShow); break; case 1: hr = InvokeSingleGvim(lpcmi->hwnd, lpcmi->lpDirectory, lpcmi->lpVerb, lpcmi->lpParameters, lpcmi->nShow, 0); break; case 2: hr = InvokeSingleGvim(lpcmi->hwnd, lpcmi->lpDirectory, lpcmi->lpVerb, lpcmi->lpParameters, lpcmi->nShow, 1); break; } } } return hr; } STDMETHODIMP CShellExt::PushToWindow(HWND /* hParent */, LPCSTR /* pszWorkingDir */, LPCSTR /* pszCmd */, LPCSTR /* pszParam */, int /* iShowCmd */, int idHWnd) { HWND hWnd = m_hWnd[idHWnd]; // Show and bring vim instance to foreground if (IsIconic(hWnd) != 0) ShowWindow(hWnd, SW_RESTORE); else ShowWindow(hWnd, SW_SHOW); SetForegroundWindow(hWnd); // Post the selected files to the vim instance PostMessage(hWnd, WM_DROPFILES, (WPARAM)medium.hGlobal, 0); return NOERROR; } STDMETHODIMP CShellExt::GetCommandString(UINT_PTR /* idCmd */, UINT uFlags, UINT FAR * /* reserved */, LPSTR pszName, UINT cchMax) { if (uFlags == GCS_HELPTEXT && cchMax > 35) lstrcpy(pszName, _("Edits the selected file(s) with Vim")); return NOERROR; } BOOL CALLBACK CShellExt::EnumWindowsProc(HWND hWnd, LPARAM lParam) { char temp[BUFSIZE]; // First do a bunch of check // No invisible window if (!IsWindowVisible(hWnd)) return TRUE; // No child window ??? // if (GetParent(hWnd)) return TRUE; // Class name should be Vim, if failed to get class name, return if (GetClassName(hWnd, temp, sizeof(temp)) == 0) return TRUE; // Compare class name to that of vim, if not, return if (_strnicmp(temp, "vim", sizeof("vim")) != 0) return TRUE; // First check if the number of vim instance exceeds MAX_HWND CShellExt *cs = (CShellExt*) lParam; if (cs->m_cntOfHWnd >= MAX_HWND) return TRUE; // Now we get the vim window, put it into some kind of array cs->m_hWnd[cs->m_cntOfHWnd] = hWnd; cs->m_cntOfHWnd ++; return TRUE; // continue enumeration (otherwise this would be false) } BOOL CShellExt::LoadMenuIcon() { char vimExeFile[BUFSIZE]; getGvimName(vimExeFile, 1); if (vimExeFile[0] == '\0') return FALSE; HICON hVimIcon; if (ExtractIconEx(vimExeFile, 0, NULL, &hVimIcon, 1) == 0) return FALSE; m_hVimIconBitmap = IconToBitmap(hVimIcon, GetSysColorBrush(COLOR_MENU), GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON)); return TRUE; } #ifdef WIN32 // 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; } } # ifndef __BORLANDC__ 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 (char *)""; } # endif #endif STDMETHODIMP CShellExt::InvokeGvim(HWND hParent, LPCSTR /* pszWorkingDir */, LPCSTR /* pszCmd */, LPCSTR /* pszParam */, int /* iShowCmd */) { wchar_t m_szFileUserClickedOn[BUFSIZE]; wchar_t cmdStrW[BUFSIZE]; UINT i; for (i = 0; i < cbFiles; i++) { DragQueryFileW((HDROP)medium.hGlobal, i, m_szFileUserClickedOn, sizeof(m_szFileUserClickedOn)); getGvimInvocationW(cmdStrW); wcscat(cmdStrW, L" \""); if ((wcslen(cmdStrW) + wcslen(m_szFileUserClickedOn) + 2) < BUFSIZE) { wcscat(cmdStrW, m_szFileUserClickedOn); wcscat(cmdStrW, L"\""); STARTUPINFOW si; PROCESS_INFORMATION pi; ZeroMemory(&si, sizeof(si)); si.cb = sizeof(si); // Start the child process. if (!CreateProcessW(NULL, // No module name (use command line). cmdStrW, // Command line. NULL, // Process handle not inheritable. NULL, // Thread handle not inheritable. FALSE, // Set handle inheritance to FALSE. oldenv == NULL ? 0 : CREATE_UNICODE_ENVIRONMENT, oldenv, // Use unmodified environment block. NULL, // Use parent's starting directory. &si, // Pointer to STARTUPINFO structure. &pi) // Pointer to PROCESS_INFORMATION structure. ) { MessageBox( hParent, _("Error creating process: Check if gvim is in your path!"), _("gvimext.dll error"), MB_OK); } else { CloseHandle( pi.hProcess ); CloseHandle( pi.hThread ); } } else { MessageBox( hParent, _("Path length too long!"), _("gvimext.dll error"), MB_OK); } } return NOERROR; } STDMETHODIMP CShellExt::InvokeSingleGvim(HWND hParent, LPCSTR /* pszWorkingDir */, LPCSTR /* pszCmd */, LPCSTR /* pszParam */, int /* iShowCmd */, int useDiff) { wchar_t m_szFileUserClickedOn[BUFSIZE]; wchar_t *cmdStrW; size_t cmdlen; size_t len; UINT i; cmdlen = BUFSIZE; cmdStrW = (wchar_t *) malloc(cmdlen * sizeof(wchar_t)); getGvimInvocationW(cmdStrW); if (useDiff) wcscat(cmdStrW, L" -d"); for (i = 0; i < cbFiles; i++) { DragQueryFileW((HDROP)medium.hGlobal, i, m_szFileUserClickedOn, sizeof(m_szFileUserClickedOn)); len = wcslen(cmdStrW) + wcslen(m_szFileUserClickedOn) + 4; if (len > cmdlen) { cmdlen = len + BUFSIZE; cmdStrW = (wchar_t *)realloc(cmdStrW, cmdlen * sizeof(wchar_t)); } wcscat(cmdStrW, L" \""); wcscat(cmdStrW, m_szFileUserClickedOn); wcscat(cmdStrW, L"\""); } STARTUPINFOW si; PROCESS_INFORMATION pi; ZeroMemory(&si, sizeof(si)); si.cb = sizeof(si); // Start the child process. if (!CreateProcessW(NULL, // No module name (use command line). cmdStrW, // Command line. NULL, // Process handle not inheritable. NULL, // Thread handle not inheritable. FALSE, // Set handle inheritance to FALSE. oldenv == NULL ? 0 : CREATE_UNICODE_ENVIRONMENT, oldenv, // Use unmodified environment block. NULL, // Use parent's starting directory. &si, // Pointer to STARTUPINFO structure. &pi) // Pointer to PROCESS_INFORMATION structure. ) { MessageBox( hParent, _("Error creating process: Check if gvim is in your path!"), _("gvimext.dll error"), MB_OK); } else { CloseHandle(pi.hProcess); CloseHandle(pi.hThread); } free(cmdStrW); return NOERROR; } vim-7.4.1689/src/GvimExt/gvimext.def000066400000000000000000000002711267703067000171120ustar00rootroot00000000000000;gvimdef.def : Declares the module parameters for the DLL. LIBRARY gvimext ; DESCRIPTION 'Vim Shell Extension' EXPORTS DllCanUnloadNow private DllGetClassObject private vim-7.4.1689/src/GvimExt/gvimext.h000066400000000000000000000110331267703067000166010ustar00rootroot00000000000000/* vi:set ts=8 sts=4 sw=4: * * VIM - Vi IMproved gvimext by Tianmiao Hu * * 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 you have any questions or any suggestions concerning gvimext, please * contact Tianmiao Hu: tianmiao@acm.org. */ #if !defined(AFX_STDAFX_H__3389658B_AD83_11D3_9C1E_0090278BBD99__INCLUDED_) #define AFX_STDAFX_H__3389658B_AD83_11D3_9C1E_0090278BBD99__INCLUDED_ #if defined(_MSC_VER) && _MSC_VER > 1000 #pragma once #endif // Insert your headers here // #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers //-------------------------------------------------------------- // common user interface routines // // //-------------------------------------------------------------- #ifndef STRICT # define STRICT #endif #define INC_OLE2 // WIN32, get ole2 from windows.h /* Visual Studio 2005 has 'deprecated' many of the standard CRT functions */ #if defined(_MSC_VER) && _MSC_VER >= 1400 # define _CRT_SECURE_NO_DEPRECATE # define _CRT_NONSTDC_NO_DEPRECATE #endif #include #include #include #include /* Accommodate old versions of VC that don't have a modern Platform SDK */ #if (defined(_MSC_VER) && _MSC_VER < 1300) || !defined(MAXULONG_PTR) # undef UINT_PTR # define UINT_PTR UINT #endif #define ResultFromShort(i) ResultFromScode(MAKE_SCODE(SEVERITY_SUCCESS, 0, (USHORT)(i))) // Initialize GUIDs (should be done only and at-least once per DLL/EXE) // #pragma data_seg(".text") #define INITGUID #include #include // // The class ID of this Shell extension class. // // class id: {51EEE242-AD87-11d3-9C1E-0090278BBD99} // // // NOTE!!! If you use this shell extension as a starting point, // you MUST change the GUID below. Simply run UUIDGEN.EXE // to generate a new GUID. // // {51EEE242-AD87-11d3-9C1E-0090278BBD99} // static const GUID <> = // { 0x51eee242, 0xad87, 0x11d3, { 0x9c, 0x1e, 0x0, 0x90, 0x27, 0x8b, 0xbd, 0x99 } }; // // // {51EEE242-AD87-11d3-9C1E-0090278BBD99} // IMPLEMENT_OLECREATE(<>, <>, // 0x51eee242, 0xad87, 0x11d3, 0x9c, 0x1e, 0x0, 0x90, 0x27, 0x8b, 0xbd, 0x99); // // {51EEE242-AD87-11d3-9C1E-0090278BBD99} -- this is the registry format DEFINE_GUID(CLSID_ShellExtension, 0x51eee242, 0xad87, 0x11d3, 0x9c, 0x1e, 0x0, 0x90, 0x27, 0x8b, 0xbd, 0x99); // this class factory object creates context menu handlers for windows 32 shell class CShellExtClassFactory : public IClassFactory { protected: ULONG m_cRef; public: CShellExtClassFactory(); ~CShellExtClassFactory(); //IUnknown members STDMETHODIMP QueryInterface(REFIID, LPVOID FAR *); STDMETHODIMP_(ULONG) AddRef(); STDMETHODIMP_(ULONG) Release(); //IClassFactory members STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, LPVOID FAR *); STDMETHODIMP LockServer(BOOL); }; typedef CShellExtClassFactory *LPCSHELLEXTCLASSFACTORY; #define MAX_HWND 100 // this is the actual OLE Shell context menu handler class CShellExt : public IContextMenu, IShellExtInit { private: BOOL LoadMenuIcon(); protected: ULONG m_cRef; LPDATAOBJECT m_pDataObj; UINT m_edit_existing_off; HBITMAP m_hVimIconBitmap; // For some reason, this callback must be static static BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM lParam); STDMETHODIMP PushToWindow(HWND hParent, LPCSTR pszWorkingDir, LPCSTR pszCmd, LPCSTR pszParam, int iShowCmd, int idHWnd); STDMETHODIMP InvokeGvim(HWND hParent, LPCSTR pszWorkingDir, LPCSTR pszCmd, LPCSTR pszParam, int iShowCmd); STDMETHODIMP InvokeSingleGvim(HWND hParent, LPCSTR pszWorkingDir, LPCSTR pszCmd, LPCSTR pszParam, int iShowCmd, int useDiff); public: int m_cntOfHWnd; HWND m_hWnd[MAX_HWND]; CShellExt(); ~CShellExt(); //IUnknown members STDMETHODIMP QueryInterface(REFIID, LPVOID FAR *); STDMETHODIMP_(ULONG) AddRef(); STDMETHODIMP_(ULONG) Release(); //IShell members STDMETHODIMP QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags); STDMETHODIMP InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi); STDMETHODIMP GetCommandString(UINT_PTR idCmd, UINT uFlags, UINT FAR *reserved, LPSTR pszName, UINT cchMax); //IShellExtInit methods STDMETHODIMP Initialize(LPCITEMIDLIST pIDFolder, LPDATAOBJECT pDataObj, HKEY hKeyID); }; typedef CShellExt *LPCSHELLEXT; #pragma data_seg() #endif vim-7.4.1689/src/GvimExt/gvimext.inf000066400000000000000000000010661267703067000171330ustar00rootroot00000000000000[Version] Signature="$Windows NT$"" Provider="Tianmiao" [Manufacture] [DefaultInstall] AddReg=ThisDll.Add.Reg [DefaultUninstall] DelReg=ThisDLL.Add.Reg [ThisDll.Add.Reg] HKCR,CLSID\{51EEE242-AD87-11d3-9C1E-0090278BBD99} HKCR,CLSID\{51EEE242-AD87-11d3-9C1E-0090278BBD99}\InProcServer32 HKCR,*\shellex\ContextMenuHandlers\gvim HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved",{51EEE242-AD87-11d3-9C1E-0090278BBD99} HKLM,Software\Vim\Gvim HKLM,"Software\Microsoft\Windows\CurrentVersion\Uninstall\Vim 6.0" [Strings] ThisDll="gvimext.dll" vim-7.4.1689/src/GvimExt/gvimext.rc000066400000000000000000000051761267703067000167710ustar00rootroot00000000000000//Microsoft Developer Studio generated resource script. // #include "resource.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 2 resource. // #ifndef __BORLANDC__ # include "winresrc.h" #endif ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // English (U.S.) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US #pragma code_page(1252) #endif //_WIN32 #ifndef _MAC ///////////////////////////////////////////////////////////////////////////// // // Version // VS_VERSION_INFO VERSIONINFO FILEVERSION 1,0,0,1 PRODUCTVERSION 1,0,0,1 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x3L #else FILEFLAGS 0x2L #endif FILEOS 0x4L FILETYPE 0x2L FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904b0" BEGIN VALUE "Comments", "Developed using COM architecture!\0" VALUE "CompanyName", "Tianmiao Hu's Developer Studio\0" VALUE "FileDescription", "A small project for the context menu of gvim!\0" VALUE "FileVersion", "1, 0, 0, 1\0" VALUE "InternalName", "gvim right-click menu extension\0" VALUE "LegalCopyright", "Copyright 1999 Tianmiao Hu\0" VALUE "LegalTrademarks", "Tianmiao Hu's Gvim Context Menu Extension\0" VALUE "OriginalFilename", "gvimext.dll\0" VALUE "PrivateBuild", "\0" VALUE "ProductName", "Tianmiao Hu's gvimext context menu extension\0" VALUE "ProductVersion", "1, 0, 0, 1\0" VALUE "SpecialBuild", "\0" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 1200 END END #endif // !_MAC #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 "\r\n" "\0" END #endif // APSTUDIO_INVOKED #endif // English (U.S.) resources ///////////////////////////////////////////////////////////////////////////// #ifndef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 3 resource. // ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED vim-7.4.1689/src/GvimExt/gvimext_ming.def000066400000000000000000000005641267703067000201310ustar00rootroot00000000000000;gvimdef_ming.def : Declares the module parameters for the DLL. ;The mingw environment doesn't know anything about private declarations ;Hence this is the same file as gvimext.def with private removed LIBRARY gvimext ; DESCRIPTION 'Vim Shell Extension build with MinGW' EXPORTS DllCanUnloadNow = DllCanUnloadNow@0 DllGetClassObject = DllGetClassObject@12 vim-7.4.1689/src/GvimExt/gvimext_ming.rc000066400000000000000000000025731267703067000200010ustar00rootroot00000000000000#include #define xstr(x) str(x) #define str(x) #x VS_VERSION_INFO VERSIONINFO FILEVERSION 1,0,0,1 PRODUCTVERSION 1,0,0,1 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x3L #else FILEFLAGS 0x2L #endif FILEOS 0x4L FILETYPE VFT_DLL FILESUBTYPE 0x0L { BLOCK "StringFileInfo" { BLOCK "040904b0" { VALUE "Comments", "Developed using COM architecture!\0" VALUE "CompanyName", "Tianmiao Hu's Developer Studio\0" VALUE "FileDescription", "A small project for the context menu of gvim!\0" VALUE "FileVersion", "1, 0, 0, 1\0" VALUE "InternalName", "gvim right-click menu extension\0" VALUE "LegalCopyright", "Copyright 1999 Tianmiao Hu\0" VALUE "LegalTrademarks", "Tianmiao Hu's Gvim Context Menu Extension\0" VALUE "OriginalFilename", "gvimext.dll\0" VALUE "PrivateBuild", "\0" VALUE "ProductName", "Tianmiao Hu's gvimext context menu extension\0" VALUE "ProductVersion", "1, 0, 0, 1\0" #if defined(__GNUC__) VALUE "SpecialBuild", "Build With " "MingW " xstr(__GNUC__) "." xstr(__GNUC_MINOR__) "." xstr(__GNUC_PATCHLEVEL__) " on " __DATE__ " " __TIME__ "\0" #else VALUE "SpecialBuild", "Unknown compiler\0" #endif } } BLOCK "VarFileInfo" { VALUE "Translation", 0x409, 1200 } } vim-7.4.1689/src/GvimExt/resource.h000066400000000000000000000005551267703067000167540ustar00rootroot00000000000000//{{NO_DEPENDENCIES}} // Microsoft Developer Studio generated include file. // Used by gvimext.rc // // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 101 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1000 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif vim-7.4.1689/src/GvimExt/uninst.bat000066400000000000000000000001011267703067000167470ustar00rootroot00000000000000rundll32.exe setupapi,InstallHinfSection DefaultUninstall 128 %1 vim-7.4.1689/src/INSTALL000066400000000000000000000356511267703067000144270ustar00rootroot00000000000000INSTALL - 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. OS/2 (with EMX 0.9b) 4. Atari MiNT See INSTALLami.txt for Amiga See INSTALLmac.txt for Macintosh See INSTALLpc.txt for PC (MS-DOS, Windows 95/98/NT/XP) See INSTALLvms.txt for VMS See INSTALLx.txt for cross-compiling on Unix See ../README_390.txt for OS/390 Unix See ../runtime/doc/os_beos.txt for BeBox 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 GUI libraries 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 systems 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 NOTE: This is incomplete, look in Makefile for more info. These configure arguments can be used to select which GUI to use: --enable-gui=gtk or: gtk2, 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,gtk2,kde,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,gtk2,kde,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,gtk2,kde,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,gtk2,kde,motif,athena}-check options are ignored. On Linux you usually need GUI "-devel" packages. You may already have GTK libraries installed, but that doesn't mean you can compile Vim with GTK, you also need the header files. For compiling with the GTK+ GUI, you need a recent version of glib and gtk+. Configure checks for at least version 1.1.16. An older version is not selected automatically. If you want to use it anyway, run configure with "--disable-gtktest". 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. There used to be a KDE version of Vim, using Qt libraries, but since it didn't work very well and there was no maintainer it was dropped. 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". Unix: LOCAL HEADERS AND LIBRARIES NOT IN /usr/local Sometimes it is necessary to search different path than /usr/local for locally installed headers (/usr/local/include) and libraries (/usr/local/lib). To search /stranger/include and /stranger/lib for locally installed headers and libraries, use: ./configure --with-local-dir=/stranger And to not search for locally installed headers and libraries at all, use: ./configure --without-local-dir 3. OS/2 ======= OS/2 support was removed in patch 7.4.1008 4. Atari MiNT ============= [NOTE: this is quite old, it might not work anymore] To compile Vim for MiNT you may either copy Make_mint.mak 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 support 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. vim-7.4.1689/src/INSTALLami.txt000066400000000000000000000022151267703067000157220ustar00rootroot00000000000000INSTALLami.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 vim-7.4.1689/src/INSTALLmac.txt000066400000000000000000000037561267703067000157270ustar00rootroot00000000000000INSTALLmac.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. First, make sure you've installed Xcode or CommandLineToots. If not, open a terminal and do $ make --version A window pops up instructing you to install the developer tools. ---------------------------------------------------------------------------- Summary ---------------------------------------------------------------------------- 1 MacOS X 1.1. Carbon interface 1.2. X (Athena, GTK, Motif) or plain text. MacOS Classic is no longer supported. If you really want it use Vim 6.4. ---------------------------------------------------------------------------- 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 .../src make make test sudo make install "make" will create a working Vim.app application bundle in the src directory. You can move this bundle (the Vim.app directory) anywhere you want. Or use "make install" to move it to /Applications. You need at least Xcode 1.5 to compile Vim 7.0. Configure will create a universal binary if possible. This requires installing the universal SDK (currently for 10.4). To overrule the architecture do this before running make: ./configure --with-mac-arch=intel or ./configure --with-mac-arch=ppc 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 .../src ./configure --disable-darwin --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 ------------------------------------------------------ vim-7.4.1689/src/INSTALLpc.txt000066400000000000000000000631571267703067000155720ustar00rootroot00000000000000INSTALLpc.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: (Very stale now.) 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. With the exception of two sections (Windows 3.1 and MS-DOS), this document assumes that you are building Vim for Win32 or later. (Windows 95/98/Me/NT/2000/XP/2003/Vista/7/8/10) Contents: 1. Microsoft Visual C++ 2. Using MinGW 3. Cygwin 4. Borland 5. Cross compiling for Win32 from a Linux machine 6. Building with Python support 7. Building with Python3 support 8. Building with MzScheme/Racket support 9. Building with Lua support 10. Building with Perl support 11. Building with Ruby support 12. Building with Tcl support 13. Windows 3.1 14. MS-DOS 15. Installing after building from sources The currently preferred method is using the free Visual C++ Toolkit 2008 |msvc-2008-express|, the produced binary runs on most MS-Windows systems. If you need the executable to run on Windows 98 or ME, use the 2003 one |msvc-2003-toolkit|. 1. Microsoft Visual C++ ======================= Visual Studio ------------- Building with Visual Studio (VS 98, VS .NET, VS .NET 2003, VS 2005, VS 2008, VS2010, VS2012, VS2013 and VS2015) is straightforward. (These instructions should also work for VS 4 and VS 5.) Using VS C++ 2008 Express is recommended, the binaries build with that run on nearly all platforms. Binaries from later versions may not run on Windows 95 or XP. To build Vim from the command line with MSVC, use Make_mvc.mak. Visual Studio installed a batch file called vcvars32.bat, which you must run to set up 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. 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, add IME=yes to the parameters you pass to Make_mvc.mak. To build Vim from within the Visual Studio IDE, open the Make_ivc.mak project. (Note: Make_ivc.mak is not as rich as Make_mvc.mak, which allows for far more configuration.) Make_ivc.mak can also be built with nmake. 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 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. Visual C++ Toolkit 2003 *msvc-2003-toolkit* ----------------------- You could download the Microsoft Visual C++ Toolkit 2003 from http://msdn.microsoft.com/visualc/vctoolkit2003/ Unfortunately this URL is no longer valid. Inofficial downloads appear to be available from links mentioned on these pages (use at your own risk): http://www.filewatcher.com/m/VCToolkitSetup.exe.32952488.0.0.html http://feargame.net/wiki/index.php?title=Building_Source_with_the_VC2003_Toolkit This contains the command-line tools (compiler, linker, CRT headers, and libraries) for Visual Studio .NET 2003, but not the Visual Studio IDE. To compile and debug Vim with the VC2003 Toolkit, you will also need |ms-platform-sdk|, |dotnet-1.1-redist|, |dotnet-1.1-sdk|, and |windbg-download|. It's easier to download Visual C++ 2008 Express Edition, |msvc-2008-express|, which is freely available in perpetuity. The free Code::Blocks IDE works with the VC2003 Toolkit, as described at http://wiki.codeblocks.org/index.php?title=Integrating_Microsoft_Visual_Toolkit_2003_with_Code::Blocks_IDE (This site also takes you through configuring a number of other free C compilers for Win32.) To compile Vim using the VC2003 Toolkit and Make_mvc.mak, you must first execute the following commands in a cmd.exe window (the msvcsetup.bat batch file can be used): set PATH=%SystemRoot%\Microsoft.NET\Framework\v1.1.4322;%PATH% call "%VCToolkitInstallDir%vcvars32.bat" set MSVCVer=7.1 call "%ProgramFiles%\Microsoft Platform SDK\SetEnv.Cmd" set LIB=%ProgramFiles%\Microsoft Visual Studio .NET 2003\Vc7\lib;%LIB% Now you can build Vim with Make_mvc.mak. Getting the Windows Platform SDK *ms-platform-sdk* You will also need a copy of the Windows Platform SDK from http://www.microsoft.com/msdownload/platformsdk/sdkupdate/ Specifically, you need the Windows Core SDK subset of the Platform SDK, which contains the Windows headers and libraries. Getting the .NET Framework 1.1 Runtime *dotnet-1.1-redist* You need the .NET Framework 1.1 Redistributable Package from http://www.microsoft.com/downloads/details.aspx?familyid=262d25e3-f589-4842-8157-034d1e7cf3a3 or from Windows Update: http://windowsupdate.microsoft.com/ This is needed to install |dotnet-1.1-sdk|. It also contains cvtres.exe, which is needed to link Vim. Getting the .NET Framework 1.1 SDK *dotnet-1.1-sdk* You need the .NET Framework 1.1 SDK from http://www.microsoft.com/downloads/details.aspx?familyid=9b3a2ca6-3647-4070-9f41-a333c6b9181d This contains some additional libraries needed to compile Vim, such as msvcrt.lib. You must install |dotnet-1.1-redist| before installing the .NET 1.1 SDK. Getting the WinDbg debugger *windbg-download* The Debugging Tools for Windows can be downloaded from http://www.microsoft.com/whdc/devtools/debugging/default.mspx This includes the WinDbg debugger, which you will want if you ever need to debug Vim itself. An earlier version of the Debugging Tools is also available through the Platform SDK, |ms-platform-sdk|. Visual C++ 2005 Express Edition *msvc-2005-express* ------------------------------- Visual C++ 2005 Express Edition can be downloaded for free from: http://msdn.microsoft.com/vstudio/express/visualC/default.aspx This includes the IDE and the debugger. You will also need |ms-platform-sdk|. You can build Vim with Make_mvc.mak. Instructions for integrating the Platform SDK into VC Express: http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/default.aspx Visual C++ 2008 Express Edition *msvc-2008-express* ------------------------------- Visual C++ 2008 Express Edition can be downloaded for free from: http://www.microsoft.com/express/downloads/ This includes the IDE and the debugger. To set the environment execute the msvc2008.bat script. You can then build Vim with Make_mvc.mak. For building 64 bit binaries you also need to install the SDK: "Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1" You don't need the examples and documentation. Visual C++ 2010 Express Edition *msvc-2010-express* ------------------------------- Visual C++ 2010 Express Edition can be downloaded for free from: http://www.microsoft.com/express/vc/Default.aspx This includes the IDE and the debugger. To set the environment execute the msvc2010.bat script. You can then build Vim with Make_mvc.mak. Targeting Windows XP with new MSVC *new-msvc-windows-xp* ---------------------------------- Beginning with Visual C++ 2012, Microsoft changed the behavior of LINK.EXE so that it targets Windows 6.0 (Vista) by default. In order to override this, the target Windows version number needs to be passed to LINK like follows: LINK ... /subsystem:console,5.01 Make_mvc.mak now supports a macro SUBSYSTEM_VER to pass the Windows version. Use lines like follows to target Windows XP (assuming using Visual C++ 2012 under 64-bit Windows): set WinSdk71=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A set SDK_INCLUDE_DIR=%WinSdk71%\Include set INCLUDE=%WinSdk71%\Include;%INCLUDE% set LIB=%WinSdk71%\Lib;%LIB% set PATH=%WinSdk71%\Bin;%PATH% set CL=/D_USING_V110_SDK71_ nmake -f Make_mvc.mak ... WINVER=0x0501 SUBSYSTEM_VER=5.01 The following Visual C++ team blog can serve as a reference page: http://blogs.msdn.com/b/vcblog/archive/2012/10/08/windows-xp-targeting-with-c-in-visual-studio-2012.aspx 2. MinGW ======== (written by Ron Aaron: ) 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/ or you can use 'MinGW-w64' compiler. http://mingw-w64.sourceforge.net/ Or a compiler provided on msys2: https://msys2.github.io/ 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:\MinGW\bin;%PATH% or on NT/2000/XP, go to the Control Panel, (Performance and Maintenance), System, Advanced, and edit the environment from there. If you use msys2 compilers, set your installed paths: C:\msys2\mingw32\bin for 32bit. And 64bit: C:\msys2\mingw64\bin Test if gcc is on your path. From a CMD (or COMMAND on '95/98) window: C:\> gcc --version gcc (GCC) 4.8.1 C:\> mingw32-make --version GNU Make 3.82.90 (...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: mingw32-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 can use: mingw32-make -f Make_ming.mak GUI=no vim.exe 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://www.upx.org/ As of 2011, UPX still does not support compressing 64-bit EXE's; if you have built a 64-bit vim then an alternative to UPX is 'MPRESS'. MPRESS can be found at: http://www.matcode.com/mpress.htm ADDITION: NLS support with MinGW (by Eduardo F. Amatria ) 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. 3. Cygwin ========= Use Make_cyg.mak with Cygwin's GCC. See http://users.skynet.be/antoine.mechelynck/vim/compile.htm With Cygnus gcc you should use the Unix Makefile instead (you need to get the Unix archive then). Then you get a Cygwin application (feels like Vim is running on Unix), while with Make_cyg.mak you get a Windows application (like with the other makefiles). 4. Borland =========== Use Make_bc5.mak with Borland C++ 5.x. See http://users.skynet.be/antoine.mechelynck/vim/compile.htm 5. Cross compiling for Win32 from a Linux machine ================================================= [Update of 1) needs to be verified] 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. See http://www.mingw.org/wiki/LinuxCrossMinGW http://www.libsdl.org/extras/win32/cross/README.txt 2) Get and unpack both the Unix sources and the extra archive 3) in 'Make_cyg_ming.mak', set 'CROSS' to 'yes' instead of 'no'. Make further changes to 'Make_cyg_ming.mak' and 'Make_ming.mak' as you wish. If your cross-compiler prefix differs from the predefined value, set 'CROSS_COMPILE' corresponding. 4) make -f Make_ming.mak gvim.exe Now you have created the Windows binary from your Linux box! Have fun... 6. Building with Python support =============================== For building with MSVC 2008 the "Windows Installer" from www.python.org works fine. When building, you need to set the following variables at least: PYTHON: Where Python is installed. E.g. C:\Python27 DYNAMIC_PYTHON: Whether dynamic linking is used. Usually, set to yes. PYTHON_VER: Python version. E.g. 27 for Python 2.7.X. E.g. When using MSVC (as one line): nmake -f Make_mvc.mak PYTHON=C:\Python27 DYNAMIC_PYTHON=yes PYTHON_VER=27 (rest written by Ron Aaron: ) Building 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 if you use msys2 to build python support (as one line): mingw32-make -f Make_ming.mak PYTHON=c:/msys64/mingw64 PYTHON_HOME=c:/msys64/mingw64 PYTHONINC=-Ic:/msys64/mingw64/include/python2.7 DYNAMIC_PYTHON=yes PYTHON_VER=27 DYNAMIC_PYTHON_DLL=libpython2.7.dll ARCH=x86-64 STATIC_STDCPLUS=yes You will end up with a Python-enabled, Win32 version. Enjoy! 7. Building with Python3 support ================================ For building with MSVC 2008 the "Windows Installer" from www.python.org works fine. Python 3.4 is recommended. When building, you need to set the following variables at least: PYTHON3: Where Python3 is installed. E.g. C:\Python34 DYNAMIC_PYTHON3: Whether dynamic linking is used. Usually, set to yes. PYTHON3_VER: Python3 version. E.g. 34 for Python 3.4.X. E.g. When using MSVC (as one line): nmake -f Make_mvc.mak PYTHON3=C:\Python34 DYNAMIC_PYTHON3=yes PYTHON3_VER=34 8. Building with MzScheme/Racket support ======================================== 1) Building with MzScheme support (written by Sergey Khorev ) Vim with MzScheme (http://www.plt-scheme.org/software/mzscheme) support can be built with either MSVC, or MinGW, or Cygwin. Supported versions are 205 and above (including 299 and 30x series). The MSVC build is quite straightforward. Simply invoke (in one line) nmake -fMake_mvc.mak MZSCHEME= [MZSCHEME_VER=] [DYNAMIC_MZSCHEME=] where is the last seven characters from MzScheme dll name (libmzschXXXXXXX.dll). If DYNAMIC_MZSCHEME=yes, resulting executable will not depend on MzScheme DLL's, but will load them in runtime on demand. Building dynamic MzScheme support on MinGW and Cygwin is similar. Take into account that should contain slashes rather than backslashes (e.g. d:/Develop/MzScheme) "Static" MzScheme support (Vim executable will depend on MzScheme DLLs explicitly) on MinGW and Cygwin requires additional step. libmzschXXXXXXX.dll and libmzgcXXXXXXX.dll should be copied from %WINDOWS%\System32 to other location (either build directory, some temporary dir or even MzScheme home). Pass that path as MZSCHEME_DLLS parameter for Make. E.g., make -f Make_cyg.mak MZSCHEME=d:/Develop/MzScheme MZSCHEME_VER=209_000 MZSCHEME_DLLS=c:/Temp DYNAMIC_MZSCHEME=no After a successful build, these dlls can be freely removed, leaving them in %WINDOWS%\System32 only. 2) Building with Racket support MzScheme and PLT Scheme names have been rebranded as Racket. Vim with Racket (https://racket-lang.org/) support can be built with either MSVC or MinGW (or Cygwin). You need to set the following variables: MZSCHEME: Where Racket is installed. E.g. C:\Program Files (x86)\Racket DYNAMIC_MZSCHEME: Whether dynamic linking is used. Usually, set to yes. MZSCHEME_VER: Racket DLL version. E.g. 3m_9z0ds0 for Racket 6.3. MZSCHEME_COLLECTS: (Optional) Path of the collects directory used at runtime. Default: $(MZSCHEME)\collects User can override this with the PLTCOLLECTS environment variable. E.g. When using MSVC (as one line): nmake -f Make_mvc.mak MZSCHEME="C:\Program Files (x86)\Racket" DYNAMIC_MZSCHEME=yes MZSCHEME_VER=3m_9z0ds0 Or when using MinGW (as one line): mingw32-make -f Make_ming.mak MZSCHEME='C:/Program\ Files\ (x86)/Racket' DYNAMIC_MZSCHEME=yes MZSCHEME_VER=3m_9z0ds0 Spaces should be escaped with '\'. 9. Building with Lua support ============================ Vim with Lua support can be built with either MSVC or MinGW (or maybe Cygwin). You can use binaries from LuaBinaries: http://luabinaries.sourceforge.net/ This also applies to when you get a Vim executable and don't build yourself, do the part up to "Build". 1) Download and install LuaBinaries Go to the Download page of LuaBinaries: http://luabinaries.sourceforge.net/download.html Download lua-X.Y.Z_Win32_dllw4_lib.zip for x86 or lua-X.Y.Z_Win64_dllw4_lib.zip for x64. You can use them both for MSVC and MinGW. Unpack it to a working directory. E.g. C:\projects\lua53. Lua's header files will be installed under the include directory. Copy luaXY.dll to your Windows system directory. The system directory depends on your Windows bitness and Vim bitness: 32-bit Vim on 32-bit Windows: C:\Windows\System32 32-bit Vim on 64-bit Windows: C:\Windows\SysWOW64 64-bit Vim on 64-bit Windows: C:\Windows\System32 Or another option is copying luaXY.dll to the directory where gvim.exe (or vim.exe) is. 2) Build You need to set LUA, DYNAMIC_LUA and LUA_VER. LUA: Where Lua's header files are installed. E.g. C:\projects\lua53. DYNAMIC_LUA: Whether dynamic linking is used. Set to yes. LUA_VER: Lua version. E.g. 53 for Lua 5.3.X. E.g. When using MSVC (as one line): nmake -f Make_mvc.mak LUA=C:\projects\lua53 DYNAMIC_LUA=yes LUA_VER=53 Or when using MinGW (as one line): mingw32-make -f Make_mingw.mak LUA=C:\projects\lua53 DYNAMIC_LUA=yes LUA_VER=53 Or when using Cygwin (as one line) (untested): make -f Make_cyg.mak LUA=/cygdrive/c/projects/lua53 DYNAMIC_LUA=yes LUA_VER=53 10. Building with Perl support ============================== Vim with Perl support can be built with either MSVC or MinGW (or Cygwin). You can use binaries from ActiveState (ActivePerl) or Strawberry Perl. http://www.activestate.com/activeperl http://strawberryperl.com/ When building, you need to set the following variables: PERL: Where perl is installed. E.g. C:\Perl, C:\Strawberry\perl DYNAMIC_PERL: Whether dynamic linking is used. Usually, set to yes. PERL_VER: Perl version. E.g. 522 for Perl 5.22.X. E.g. When using MSVC (as one line): nmake -f Make_mvc.mak PERL=C:\Perl DYNAMIC_PERL=yes PERL_VER=522 Or when using MinGW (as one line): mingw32-make -f Make_mingw.mak PERL=C:\Perl DYNAMIC_PERL=yes PERL_VER=522 11. Building with Ruby support ============================== Vim with Ruby support can be built with either MSVC or MinGW (or Cygwin). Ruby doesn't provide the official Windows binaries. The most widely used Windows binaries might be RubyInstaller. http://rubyinstaller.org/ If you use MinGW you can easily build with RubyInstaller, but if you use MSVC you need some tricks described below. (Another binary distribution is ActiveScriptRuby: http://www.artonx.org/data/asr/) When building, you need to set the following variables at least: RUBY: Where ruby is installed. E.g. C:\Ruby22 DYNAMIC_RUBY: Whether dynamic linking is used. Usually, set to yes. RUBY_VER: Ruby version. E.g. 22 for Ruby 2.2.X. RUBY_VER_LONG: Ruby API version in a long format. E.g. 2.2.0 for Ruby 2.2.X. Ruby version vs. Ruby API version: Ruby ver. | Ruby API ver. ========================= 1.8.X | 1.8 1.9.[1-3] | 1.9.1 2.0.0 | 2.0.0 2.X.Y | 2.X.0 (Ruby 1.9.0 is excluded from the table because it is an unstable version.) A) Using MSVC If you want to link with ruby, normally you must use the same compiler as which was used to build the ruby binary. RubyInstaller is built with MinGW, so normally you cannot use MSVC for building Vim if you want to link with RubyInstaller. If you use a different complier, there are mainly two problems: config.h and Ruby's DLL name. Here are the steps for working around them: 1) Download and Install RubyInstaller. You can install RubyInstaller with the default options and directory. E.g.: C:\Ruby22 (32-bit) or C:\Ruby22-x64 (64-bit) Ruby 2.2.X is used in this example. 2) Download Ruby 2.2.X's source code and generate config.h: cd C:\projects git clone https://github.com/ruby/ruby.git -b ruby_2_2 cd ruby win32\configure.bat nmake .config.h.time Note that ruby_2_2 is the branch name for Ruby 2.2.X's source code. There is no need to build whole Ruby, just config.h is needed. If you use 32-bit MSVC10, the config.h is generated in the .ext\include\i386-mswin32_100 directory. 3) Install the generated config.h. xcopy /s .ext\include C:\Ruby22\include\ruby-2.2.0 Note that 2.2.0 is Ruby API version of Ruby 2.2.X. 4) Build Vim. Note that you need to adjust some variables (as one line): nmake -f Make_mvc.mak RUBY=C:\Ruby22 DYNAMIC_RUBY=yes RUBY_VER=22 RUBY_VER_LONG=2.2.0 RUBY_MSVCRT_NAME=msvcrt WINVER=0x500 WINVER must be set to >=0x500, when building with Ruby 2.1 or later. When using this trick, you also need to set RUBY_MSVCRT_NAME to msvcrt which is used for the Ruby's DLL name. B) Using MinGW Using MinGW is easier than using MSVC when linking with RubyInstaller. After you install RubyInstaller, just type this (as one line): mingw32-make -f Make_ming.mak RUBY=C:/Ruby22 DYNAMIC_RUBY=yes RUBY_VER=22 RUBY_VER_LONG=2.2.0 WINVER=0x500 WINVER must be set to >=0x500, when building with Ruby 2.1 or later. 12. Building with Tcl support ============================= Vim with Tcl support can be built with either MSVC or MinGW (or Cygwin). You can use binaries from ActiveState (ActiveTcl). http://www.activestate.com/activetcl When building, you need to set the following variables: TCL: Where tcl is installed. E.g. C:\Tcl86 DYNAMIC_TCL: Whether dynamic linking is used. Usually, set to yes. TCL_VER: Tcl version in a short format. E.g. 86 for Tcl 8.6.X. TCL_VER_LONG: Tcl version in a long format. E.g. 8.6 for Tcl 8.6.X. E.g. When using MSVC (as one line): nmake -f Make_mvc.mak TCL=C:\Tcl86 DYNAMIC_TCL=yes TCL_VER=86 TCL_VER_LONG=8.6 Or when using MinGW (as one line): mingw32-make -f Make_mingw.mak TCL=C:\Tcl86 DYNAMIC_TCL=yes TCL_VER=86 TCL_VER_LONG=8.6 13. Windows 3.1x ================ The Windows 3.1x support was removed in patch 7.4.1364. 14. MS-DOS ========== The MS-DOS support was removed in patch 7.4.1399. 15. Installing after building from sources ========================================== [provided by Michael Soyka] After you've built the Vim binaries as described above, you're ready to install Vim on your system. However, if you've obtained the Vim sources using Git, Mercurial or by downloading them as a unix tar file, you must first create a "vim74" directory. If you instead downloaded the sources as zip files, you can skip this setup as the zip archives already have the correct directory structure. A. Create a Vim "runtime" subdirectory named "vim74" ----------------------------------------------------- If you obtained your Vim sources as zip files, you can skip this step. Otherwise, continue reading. Go to the directory that contains the Vim "src" and "runtime" directories and create a new subdirectory named "vim74". Copy the "runtime" files into "vim74": copy runtime\* vim74 B. Copy the new binaries into the "vim74" directory ---------------------------------------------------- Regardless of how you installed the Vim sources, you need to copy the new binaries you created above into "vim74": copy src\*.exe vim74 copy src\GvimExt\gvimext.dll vim74 copy src\xxd\xxd.exe vim74 C. Move the "vim74" directory into the Vim installation subdirectory --------------------------------------------------------------------- Move the "vim74" subdirectory into the subdirectory where you want Vim to be installed. Typically, this subdirectory will be named "vim". If you already have a "vim74" subdirectory in "vim", delete it first by running its uninstal.exe program. D. Install Vim --------------- "cd" to your Vim installation subdirectory "vim\vim74" and 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 or add the directory to PATH using the Windows Control Panel. - Create entries for Vim on the desktop and in the Start menu. Happy Vimming! vim-7.4.1689/src/INSTALLvms.txt000066400000000000000000000302201267703067000157560ustar00rootroot00000000000000INSTALLvms.txt - Installation of Vim on OpenVMS Maintainer: Zoltan Arpadffy Last change: 2008 Jan 06 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 optimized (and tested) source code from: ftp://ftp.polarhome.com/pub/vim/source/vms/ (http://www.polarhome.com/vim/files/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/ (http://www.polarhome.com/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 features 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 : XPM Description : Enable XPM libraries in GUI/Motif mode. It enables features as toolbar etc. Options: : YES - GUI executable Uncommented - without XPM 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 you 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 Alpha and IA64. 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 Source code for GTK and porting library that is used to build VMS executables at polarhome.com are at http://www.polarhome.com/vim/files/source/vms/ Enable GTK in make_vms.mms file with GTK = YES Define GTK_ROOT that points to your GTK root directory. You will need to edit GTKDIR variable in order to point to GTK header files and libraries. GTK_DIR = ALPHA$DKA0:[GTK128.] ".]" at the end is very important. 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 copied 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 compiler 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 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 vim-7.4.1689/src/INSTALLx.txt000066400000000000000000000123521267703067000154260ustar00rootroot00000000000000INSTALLx.txt - cross-compiling Vim on Unix Content: 1. Introduction 2. Necessary arguments for "configure" 3. Necessary environment variables for "configure" 4. Example 1. INTRODUCTION =============== This document discusses cross-compiling VIM on Unix-like systems. We assume you are already familiar with cross-compiling and have a working cross-compile environment with at least the following components: * a cross-compiler * a libc to link against * ncurses library to link against Discussing how to set up a cross-compile environment would go beyond the scope of this document. See http://www.kegel.com/crosstool/ for more information and a script that aids in setting up such an environment. The problem is that "configure" needs to compile and run small test programs to check for certain features. Running these test programs can't be done when cross-compiling so we need to pass the results these checks would produce via environment variables. See the list of variables and the examples at the end of this document. 2. NECESSARY ARGUMENTS FOR "configure" ====================================== You need to set the following "configure" command line switches: --build=... : The build system (i.e. the platform name of the system you compile on right now). For example, "i586-linux". --host=... : The system on which VIM will be run. Quite often this the name of your cross-compiler without the "-gcc". For example, "powerpc-603-linux-gnu". --target=... : Only relevant for compiling compilers. Set this to the same value as --host. --with-tlib=... : Which terminal library to use. For example, "ncurses". 3. NECESSARY ENVIRONMENT VARIABLES FOR "configure" ================================================== Additionally to the variables listed here you might want to set the CPPFLAGS environment variable to enable optimization for your target system (e.g. "CPPFLAGS=-march=arm5te"). The following variables need to be set: ac_cv_sizeof_int: The size of an "int" C type in bytes. Should be "4" on all 32bit machines. vi_cv_path_python_conf: If Python support is enabled, set this variable to the path for Python's library implementation. This is a path like "/usr/lib/pythonX.Y/config" (the directory contains a file "config.c"). vi_cv_var_python_epfx: If Python support is enabled, set this variable to the execution prefix of your Python interpreter (that is, where it thinks it is running). This is the output of the following Python script: import sys; print sys.exec_prefix vi_cv_var_python_pfx: If Python support is enabled, set this variable to the prefix of your Python interpreter (that is, where it was installed). This is the output of the following Python script: import sys; print sys.prefix vi_cv_var_python_version: If Python support is enabled, set this variable to the version of the Python interpreter that will be used. This is the output of the following Python script: import sys; print sys.version[:3] vim_cv_bcopy_handles_overlap: Whether the "memmove" C library call is able to copy overlapping memory regions. Set to "yes" if it does or "no" if it does not. You only need to set this if vim_cv_memmove_handles_overlap is set to "no". vim_cv_getcwd_broken: Whether the "getcwd" C library call is broken. Set to "yes" if you know that "getcwd" is implemented as 'system("sh -c pwd")', set to "no" otherwise. vim_cv_memcpy_handles_overlap: Whether the "memcpy" C library call is able to copy overlapping memory regions. Set to "yes" if it does or "no" if it does not. You only need to set this if both vim_cv_memmove_handles_overlap and vim_cv_bcopy_handles_overlap are set to "no". vim_cv_memmove_handles_overlap: Whether the "memmove" C library call is able to copy overlapping memory regions. Set to "yes" if it does or "no" if it does not. vim_cv_stat_ignores_slash: Whether the "stat" C library call ignores trailing slashes in the path name. Set to "yes" if it ignores them or "no" if it does not ignore them. vim_cv_tgetent: Whether the "tgetent" terminal library call returns a zero or non-zero value when it encounters an unknown terminal. Set to either the string "zero" or "non-zero", corresponding. vim_cv_terminfo: Whether the environment has terminfo support. Set to "yes" if so, otherwise set to "no". vim_cv_toupper_broken: Whether the "toupper" C library function works correctly. Set to "yes" if you know it's broken, otherwise set to "no". vim_cv_tty_group: The default group of pseudo terminals. Either set to the numeric value of your tty group or to "world" if they are world accessible. vim_cv_tty_mode: The default mode of pseudo terminals if they are not world accessible. Most probably the value "0620". 4. EXAMPLE: =========== Assuming the target system string is "armeb-xscale-linux-gnu" (a Intel XScale system) with glibc and ncurses, the call to configure would look like this: ac_cv_sizeof_int=4 \ vim_cv_getcwd_broken=no \ vim_cv_memmove_handles_overlap=yes \ vim_cv_stat_ignores_slash=yes \ vim_cv_tgetent=zero \ vim_cv_terminfo=yes \ vim_cv_toupper_broken=no \ vim_cv_tty_group=world \ ./configure \ --build=i586-linux \ --host=armeb-xscale-linux-gnu \ --target=armeb-xscale-linux-gnu \ --with-tlib=ncurses Written 2007 by Marc Haisenko for the VIM project. vim-7.4.1689/src/Make_bc5.mak000066400000000000000000000620451267703067000154730ustar00rootroot00000000000000# # 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) # # NOTE: THIS IS OLD AND PROBABLY NO LONGER WORKS. # # Contributed by Ben Singer. # Updated 4/1997 by Ron Aaron # 2016: removed support for 16 bit DOS # 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: # \bin\make /f Make_bc5.mak BOR= # # 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\ilink32) # GUI no or yes: set to yes if you want the GUI version (yes) # LUA define to path to Lua dir to get Lua support (not defined) # LUA_VER define to version of Lua being used (51) # DYNAMIC_LUA no or yes: set to yes to load the Lua DLL dynamically (no) # 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) # PYTHON3 define to path to Python3 dir to get PYTHON3 support (not defined) # PYTHON3_VER define to version of Python3 being used (31) # DYNAMIC_PYTHON3 no or yes: use yes to load the Python3 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. # RUBY_VER_LONG same, but in format with dot. (1.6) # 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) # NOTE: multi-byte support is broken in the Borland libraries, # not everything will work properly! Esp. handling multi-byte # file names. # 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) # 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) # 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) # 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; also # requires CHANNEL (yes if GUI # is yes) # NBDEBUG no or yes: include support for debugging Netbeans interface (no) # CHANNEL no or yes: include support for inter process communication (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: ilink32 (this is below) ### 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 ### CHANNEL: yes to enable inter process communication, no to disable it !if ("$(CHANNEL)"=="") && ("$(GUI)"=="yes") CHANNEL = yes !endif ### LUA: uncomment this line if you want lua support in vim # LUA=c:\lua ### 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 ### PYTHON3: uncomment this line if you want python3 support in vim # PYTHON3=c:\python31 ### 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 ### 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) !if ("$(ALIGN)"=="") ALIGN = 4 !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)"=="") && \ ("$(LUA)"=="") && \ ("$(PYTHON)"=="") && \ ("$(PYTHON3)"=="") && \ ("$(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) !if ("$(FEATURES)"=="") FEATURES = BIG !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: # OSTYPE = WIN32 # # 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 # 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 LUA INTERP_DEFINES = $(INTERP_DEFINES) -DFEAT_LUA INCLUDE = $(LUA)\include;$(INCLUDE) ! ifndef LUA_VER LUA_VER = 51 ! endif ! if ("$(DYNAMIC_LUA)" == "yes") INTERP_DEFINES = $(INTERP_DEFINES) -DDYNAMIC_LUA -DDYNAMIC_LUA_DLL=\"lua$(LUA_VER).dll\" LUA_LIB_FLAG = /nodefaultlib: ! endif !endif !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 !ifdef PYTHON3 DYNAMIC_PYTHON=yes DYNAMIC_PYTHON3=yes !endif !endif !ifdef PYTHON INTERP_DEFINES = $(INTERP_DEFINES) -DFEAT_PYTHON !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 PYTHON3 INTERP_DEFINES = $(INTERP_DEFINES) -DFEAT_PYTHON3 !ifndef PYTHON3_VER PYTHON3_VER = 31 !endif !if "$(DYNAMIC_PYTHON3)" == "yes" INTERP_DEFINES = $(INTERP_DEFINES) -DDYNAMIC_PYTHON3 -DDYNAMIC_PYTHON3_DLL=\"python$(PYTHON3_VER).dll\" PYTHON3_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 -D_DEBUG !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 ("$(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 !undef NETBEANS !undef CHANNEL !undef XPM !undef VIMDLL !if ("$(DEBUG)"=="yes") TARGET = vimd.exe !else # for now, anyway: VIMDLL is only for the GUI version TARGET = vim.exe !endif EXETYPE=-WC STARTUPOBJ = c0x32.obj LINK2 = -ap -OS -o -P RESFILE = vim.res !endif !if ("$(NETBEANS)"=="yes") !if ("$(CHANNEL)"!="yes") # cannot use Netbeans without CHANNEL NETBEANS = no !else DEFINES = $(DEFINES) -DFEAT_NETBEANS_INTG !if ("$(NBDEBUG)"=="yes") DEFINES = $(DEFINES) -DNBDEBUG NBDEBUG_DEP = nbdebug.h nbdebug.c !endif !endif !endif !if ("$(CHANNEL)"=="yes") DEFINES = $(DEFINES) -DFEAT_JOB_CHANNEL !endif !ifdef XPM !if ("$(GUI)"=="yes") DEFINES = $(DEFINES) -DFEAT_XPM_W32 INCLUDE = $(XPM)\include;$(INCLUDE) !endif !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) 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- 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 vimmain = \ $(OBJDIR)\os_w32exe.obj !if ("$(VIMDLL)"=="yes") vimwinmain = \ $(OBJDIR)\os_w32dll.obj !else vimwinmain = \ $(OBJDIR)\os_w32exe.obj !endif vimobj = \ $(OBJDIR)\blowfish.obj \ $(OBJDIR)\buffer.obj \ $(OBJDIR)\charset.obj \ $(OBJDIR)\crypt.obj \ $(OBJDIR)\crypt_zip.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)\hardcopy.obj \ $(OBJDIR)\hashtab.obj \ $(OBJDIR)\json.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)\popupmnu.obj \ $(OBJDIR)\quickfix.obj \ $(OBJDIR)\regexp.obj \ $(OBJDIR)\screen.obj \ $(OBJDIR)\search.obj \ $(OBJDIR)\sha256.obj \ $(OBJDIR)\spell.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 LUA vimobj = $(vimobj) \ $(OBJDIR)\if_lua.obj !endif !ifdef PERL vimobj = $(vimobj) \ $(OBJDIR)\if_perl.obj !endif !ifdef PYTHON vimobj = $(vimobj) \ $(OBJDIR)\if_python.obj !endif !ifdef PYTHON3 vimobj = $(vimobj) \ $(OBJDIR)\if_python3.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 !endif !if ("$(CHANNEL)"=="yes") vimobj = $(vimobj) \ $(OBJDIR)\channel.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_beval.obj \ $(OBJDIR)\gui_w32.obj !endif vimobj = $(vimobj) \ $(OBJDIR)\os_win32.obj $(OBJDIR)\os_mswin.obj $(OBJDIR)\winclip.obj # 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 !if ("$(CHANNEL)"=="yes") MSG = $(MSG) CHANNEL !endif !ifdef XPM MSG = $(MSG) XPM !endif !ifdef LUA MSG = $(MSG) LUA ! if "$(DYNAMIC_LUA)" == "yes" MSG = $(MSG)(dynamic) ! endif !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 PYTHON3 MSG = $(MSG) PYTHON3 ! if "$(DYNAMIC_PYTHON3)" == "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 ("$(VIMDLL)"=="yes") TARGETS = $(DLLTARGET) !endif TARGETS = $(TARGETS) $(TARGET) # 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 $(CC) $(CCARG) -WC -DWIN32 -einstall dosinst.c uninstal.exe: uninstal.c $(OBJDIR)\bcc.cfg $(CC) $(CCARG) -WC -DWIN32 -O2 -euninstal uninstal.c 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 LUA -@del lua.lib !endif !ifdef PERL -@del perl.lib !endif !ifdef PYTHON -@del python.lib !endif !ifdef PYTHON3 -@del python3.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 ole2w32.lib + import32.lib+ !ifdef LUA $(LUA_LIB_FLAG)lua.lib+ !endif !ifdef PERL $(PERL_LIB_FLAG)perl.lib+ !endif !ifdef PYTHON $(PYTHON_LIB_FLAG)python.lib+ !endif !ifdef PYTHON3 $(PYTHON3_LIB_FLAG)python3.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 | !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 ("$(CODEGUARD)"=="yes") cg32.lib+ !endif # $(OSTYPE)==WIN32 causes os_mswin.c compilation. FEAT_SHORTCUT in it needs OLE ole2w32.lib + import32.lib+ !ifdef LUA $(LUA_LIB_FLAG)lua.lib+ !endif !ifdef PERL $(PERL_LIB_FLAG)perl.lib+ !endif !ifdef PYTHON $(PYTHON_LIB_FLAG)python.lib+ !endif !ifdef PYTHON3 $(PYTHON3_LIB_FLAG)python3.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) | 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_lua.obj: if_lua.c lua.lib $(CC) $(CCARG) $(CC1) $(CC2)$@ -pc if_lua.c $(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 if_py_both.h python.lib $(CC) -I$(PYTHON)\include $(CCARG) $(CC1) $(CC2)$@ -pc if_python.c $(OBJDIR)\if_python3.obj: if_python3.c if_py_both.h python3.lib $(CC) -I$(PYTHON3)\include $(CCARG) $(CC1) $(CC2)$@ -pc if_python3.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)\channel.obj: channel.c $(CC) $(CCARG) $(CC1) $(CC2)$@ channel.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 lua.lib: $(LUA)\lib\lua$(LUA_VER).lib coff2omf $(LUA)\lib\lua$(LUA_VER).lib $@ 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 $@ python3.lib: $(PYTHON3)\libs\python$(PYTHON3_VER).lib coff2omf $(PYTHON3)\libs\python$(PYTHON3_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: vim-7.4.1689/src/Make_cyg.mak000066400000000000000000000027231267703067000156010ustar00rootroot00000000000000# # Makefile for VIM on Win32, using MinGW cross compiler on Cygwin # # Also read INSTALLpc.txt! # # This compiles Vim as a Windows application. If you want Vim to run as a # Cygwin application use the Makefile (just like on Unix). # # The old Make_cyg.mak (maintained by Dan Sharp et al.) was merged into # Make_cyg_ming.mak. Note: USEDLL option was removed. # This file contains Cygwin specific settings. Common settings are contained # in Make_cyg_ming.mak. # # Last updated by Ken Takata. # Last Change: 2014 Oct 21 # uncomment 'PERL' if you want a perl-enabled version #PERL=/cygdrive/c/perl # uncomment 'LUA' if you want a Lua-enabled version #LUA=/cygdrive/c/lua # uncomment 'MZSCHEME' if you want a MzScheme-enabled version #MZSCHEME=/cygdrive/d/plt # uncomment 'PYTHON' if you want a python-enabled version #PYTHON=/cygdrive/c/python20 # uncomment 'PYTHON3' if you want a python3-enabled version #PYTHON3=/cygdrive/c/python31 # uncomment 'TCL' if you want a Tcl-enabled version #TCL=/cygdrive/c/tcl # uncomment 'RUBY' if you want a Ruby-enabled version #RUBY=/cygdribe/c/ruby # Use MinGW(-w64) cross compiler. # There are three MinGW packages in Cygwin: # 32-bit: mingw-gcc-g++ and mingw64-i686-gcc-g++ # 64-bit: mingw64-x86_64-gcc-g++ # You may also need to set 'ARCH' in Make_cyg_ming.mak. CROSS_COMPILE = i686-pc-mingw32- #CROSS_COMPILE = i686-w64-mingw32- #CROSS_COMPILE = x86_64-w64-mingw32- # Do not change this. UNDER_CYGWIN = yes include Make_cyg_ming.mak vim-7.4.1689/src/Make_cyg_ming.mak000066400000000000000000000562121267703067000166150ustar00rootroot00000000000000# Makefile for VIM on Win32 (Cygwin and MinGW) # # This file contains common part for Cygwin and MinGW and it is included # from Make_cyg.mak and Make_ming.mak. # # Info at http://www.mingw.org # Alternative x86 and 64-builds: http://mingw-w64.sourceforge.net # Also requires GNU make, which you can download from the same sites. # 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 32 bit GUI and console EXEs, # using the excellent UPX compressor: # http://upx.sourceforge.net/ # "make mpress" uses the MPRESS compressor for 32- and 64-bit EXEs: # http://www.matcode.com/mpress.htm # # Maintained by Ron Aaron et al. # Updated 2014 Oct 13. #>>>>> choose options: # set to yes for a debug build DEBUG=no # set to SIZE for size, SPEED for speed, MAXSPEED for maximum optimization OPTIMIZE=MAXSPEED # set to yes to make gvim, no for vim GUI=yes # set to yes if you want to use DirectWrite (DirectX) # MinGW-w64 is needed, and ARCH should be set to i686 or x86-64. DIRECTX=no # FEATURES=[TINY | SMALL | NORMAL | BIG | HUGE] # Set to TINY to make minimal version (few features). FEATURES=HUGE # Set to one of i386, i486, i586, i686 as the minimum target processor. # For amd64/x64 architecture set ARCH=x86-64 . ARCH=i686 # Set to yes to cross-compile from unix; no=native Windows (and Cygwin). 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 WinXP. ifndef WINVER WINVER = 0x0501 endif # Set to yes to enable Cscope support. CSCOPE=yes # Set to yes to enable Netbeans support (requires CHANNEL). NETBEANS=$(GUI) # Set to yes to enable inter process communication. CHANNEL=$(GUI) # Link against the shared version of libstdc++ by default. Set # STATIC_STDCPLUS to "yes" to link against static version instead. ifndef STATIC_STDCPLUS STATIC_STDCPLUS=no endif # If the user doesn't want gettext, undefine it. ifeq (no, $(GETTEXT)) GETTEXT= endif # Added by E.F. Amatria 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 . 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 version with them, ?-(| #GETTEXT=c:/gettext-0.10.37-20010430 #STATIC_GETTEXT=USE_STATIC_GETTEXT #DYNAMIC_GETTEXT=DYNAMIC_GETTEXT #INTLPATH=$(GETTEXT)/lib #INTLLIB=intl # Perl interface: # PERL=[Path to Perl directory] (Set inside Make_cyg.mak or Make_ming.mak) # DYNAMIC_PERL=yes (to load the Perl DLL dynamically) # PERL_VER=[Perl version, eg 56, 58, 510] (default is 56) 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: PERLEXE=$(PERL)/bin/perl PERLLIB=$(PERL)/lib PERLLIBS=$(PERLLIB)/Core ifeq ($(UNDER_CYGWIN),yes) PERLTYPEMAP:=$(shell cygpath -m $(PERLLIB)/ExtUtils/typemap) XSUBPPTRY:=$(shell cygpath -m $(PERLLIB)/ExtUtils/xsubpp) else PERLTYPEMAP=$(PERLLIB)/ExtUtils/typemap XSUBPPTRY=$(PERLLIB)/ExtUtils/xsubpp endif XSUBPP_EXISTS=$(shell $(PERLEXE) -e "print 1 unless -e '$(XSUBPPTRY)'") ifeq "$(XSUBPP_EXISTS)" "" XSUBPP=$(PERLEXE) $(XSUBPPTRY) else XSUBPP=xsubpp endif endif # Lua interface: # LUA=[Path to Lua directory] (Set inside Make_cyg.mak or Make_ming.mak) # DYNAMIC_LUA=yes (to load the Lua DLL dynamically) # LUA_VER=[Lua version, eg 51, 52] (default is 51) ifdef LUA ifndef DYNAMIC_LUA DYNAMIC_LUA=yes endif ifndef LUA_VER LUA_VER=51 endif ifeq (no,$(DYNAMIC_LUA)) LUA_LIB = -L$(LUA)/lib -llua endif endif # MzScheme interface: # MZSCHEME=[Path to MzScheme directory] (Set inside Make_cyg.mak or Make_ming.mak) # DYNAMIC_MZSCHEME=yes (to load the MzScheme DLL dynamically) # MZSCHEME_VER=[MzScheme version] (default is 205_000) # MZSCHEME_DEBUG=no ifdef MZSCHEME ifndef DYNAMIC_MZSCHEME DYNAMIC_MZSCHEME=yes endif ifndef MZSCHEME_VER MZSCHEME_VER=205_000 endif # for version 4.x we need to generate byte-code for Scheme base ifndef MZSCHEME_GENERATE_BASE MZSCHEME_GENERATE_BASE=no endif ifneq ($(wildcard $(MZSCHEME)/lib/msvc/libmzsch$(MZSCHEME_VER).lib),) MZSCHEME_MAIN_LIB=mzsch else MZSCHEME_MAIN_LIB=racket endif ifndef MZSCHEME_PRECISE_GC MZSCHEME_PRECISE_GC=no ifneq ($(wildcard $(MZSCHEME)\lib\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll),) ifeq ($(wildcard $(MZSCHEME)\lib\libmzgc$(MZSCHEME_VER).dll),) MZSCHEME_PRECISE_GC=yes endif else ifneq ($(wildcard $(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib),) ifeq ($(wildcard $(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib),) MZSCHEME_PRECISE_GC=yes endif endif endif endif ifeq (no,$(DYNAMIC_MZSCHEME)) ifeq (yes,$(MZSCHEME_PRECISE_GC)) MZSCHEME_LIB=-l$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER) else MZSCHEME_LIB=-l$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER) -lmzgc$(MZSCHEME_VER) endif # the modern MinGW can dynamically link to dlls directly. # point MZSCHEME_DLLS to where you put libmzschXXXXXXX.dll and libgcXXXXXXX.dll ifndef MZSCHEME_DLLS MZSCHEME_DLLS=$(MZSCHEME) endif MZSCHEME_LIBDIR=-L$(MZSCHEME_DLLS) -L$(MZSCHEME_DLLS)\lib endif endif # Python interface: # PYTHON=[Path to Python directory] (Set inside Make_cyg.mak or Make_ming.mak) # DYNAMIC_PYTHON=yes (to load the Python DLL dynamically) # PYTHON_VER=[Python version, eg 22, 23, ..., 27] (default is 22) ifdef PYTHON ifndef DYNAMIC_PYTHON DYNAMIC_PYTHON=yes endif ifndef PYTHON_VER PYTHON_VER=27 endif ifndef DYNAMIC_PYTHON_DLL DYNAMIC_PYTHON_DLL=python$(PYTHON_VER).dll endif ifdef PYTHON_HOME PYTHON_HOME_DEF=-DPYTHON_HOME=\"$(PYTHON_HOME)\" 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) ifndef PYTHONINC ifeq ($(CROSS),no) PYTHONINC=-I $(PYTHON)/include else PYTHONINC=-I $(PYTHON)/win32inc endif endif endif # Python3 interface: # PYTHON3=[Path to Python3 directory] (Set inside Make_cyg.mak or Make_ming.mak) # DYNAMIC_PYTHON3=yes (to load the Python3 DLL dynamically) # PYTHON3_VER=[Python3 version, eg 31, 32] (default is 31) ifdef PYTHON3 ifndef DYNAMIC_PYTHON3 DYNAMIC_PYTHON3=yes endif ifndef PYTHON3_VER PYTHON3_VER=31 endif ifndef DYNAMIC_PYTHON3_DLL DYNAMIC_PYTHON3_DLL=python$(PYTHON3_VER).dll endif ifdef PYTHON3_HOME PYTHON3_HOME_DEF=-DPYTHON3_HOME=L\"$(PYTHON3_HOME)\" endif ifeq (no,$(DYNAMIC_PYTHON3)) PYTHON3LIB=-L$(PYTHON3)/libs -lpython$(PYTHON3_VER) endif ifndef PYTHON3INC ifeq ($(CROSS),no) PYTHON3INC=-I $(PYTHON3)/include else PYTHON3INC=-I $(PYTHON3)/win32inc endif endif endif # TCL interface: # TCL=[Path to TCL directory] (Set inside Make_cyg.mak or Make_ming.mak) # DYNAMIC_TCL=yes (to load the TCL DLL dynamically) # TCL_VER=[TCL version, eg 83, 84] (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. ifdef TCL ifndef DYNAMIC_TCL DYNAMIC_TCL=yes endif ifndef TCL_VER TCL_VER = 83 endif ifndef TCL_VER_LONG TCL_VER_LONG = 8.3 endif TCLINC += -I$(TCL)/include endif # Ruby interface: # RUBY=[Path to Ruby directory] (Set inside Make_cyg.mak or Make_ming.mak) # DYNAMIC_RUBY=yes (to load the Ruby DLL dynamically) # RUBY_VER=[Ruby version, eg 18, 19, 20] (default is 18) # RUBY_VER_LONG=[Ruby version, eg 1.8, 1.9.1, 2.0.0] (default is 1.8) # You must set RUBY_VER_LONG when changing RUBY_VER. # RUBY_API_VER is derived from RUBY_VER_LONG. # Note: If you use Ruby 1.9.3, set as follows: # RUBY_VER=19 # RUBY_VER_LONG=1.9.1 (not 1.9.3, because the API version is 1.9.1.) ifdef RUBY ifndef DYNAMIC_RUBY DYNAMIC_RUBY=yes endif # Set default value ifndef RUBY_VER RUBY_VER = 18 endif ifndef RUBY_VER_LONG RUBY_VER_LONG = 1.8 endif ifndef RUBY_API_VER RUBY_API_VER = $(subst .,,$(RUBY_VER_LONG)) endif ifndef RUBY_PLATFORM ifeq ($(RUBY_VER), 16) RUBY_PLATFORM = i586-mswin32 else ifneq ($(wildcard $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/i386-mingw32),) RUBY_PLATFORM = i386-mingw32 else ifneq ($(wildcard $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/x64-mingw32),) RUBY_PLATFORM = x64-mingw32 else RUBY_PLATFORM = i386-mswin32 endif endif endif endif ifndef RUBY_INSTALL_NAME ifeq ($(RUBY_VER), 16) RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_API_VER) else ifndef RUBY_MSVCRT_NAME # Base name of msvcrXX.dll which is used by ruby's dll. RUBY_MSVCRT_NAME = msvcrt endif ifeq ($(ARCH),x86-64) RUBY_INSTALL_NAME = x64-$(RUBY_MSVCRT_NAME)-ruby$(RUBY_API_VER) else RUBY_INSTALL_NAME = $(RUBY_MSVCRT_NAME)-ruby$(RUBY_API_VER) endif endif endif ifeq (19, $(word 1,$(sort 19 $(RUBY_VER)))) RUBY_19_OR_LATER = 1 endif RUBYINC = -I $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/$(RUBY_PLATFORM) ifdef RUBY_19_OR_LATER RUBYINC += -I $(RUBY)/include/ruby-$(RUBY_VER_LONG) -I $(RUBY)/include/ruby-$(RUBY_VER_LONG)/$(RUBY_PLATFORM) endif 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 ($(ARCH),x86-64) DEFINES+=-DMS_WIN64 endif ifeq ($(CROSS),yes) # cross-compiler prefix: ifndef CROSS_COMPILE CROSS_COMPILE = i586-pc-mingw32msvc- endif DEL = rm MKDIR = mkdir -p DIRSLASH = / else # normal (Windows) compilation: ifndef CROSS_COMPILE CROSS_COMPILE = endif ifneq (sh.exe, $(SHELL)) DEL = rm MKDIR = mkdir -p DIRSLASH = / else DEL = del MKDIR = mkdir DIRSLASH = \\ endif endif CC := $(CROSS_COMPILE)gcc CXX := $(CROSS_COMPILE)g++ ifeq ($(UNDER_CYGWIN),yes) WINDRES := $(CROSS_COMPILE)windres else WINDRES := windres endif WINDRES_CC = $(CC) #>>>>> end of choices ########################################################################### CFLAGS = -Iproto $(DEFINES) -pipe -march=$(ARCH) -Wall CXXFLAGS = -std=gnu++11 WINDRES_FLAGS = --preprocessor="$(WINDRES_CC) -E -xc" -DRC_INVOKED EXTRA_LIBS = 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 -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS ifeq (yes, $(DYNAMIC_PERL)) CFLAGS += -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl$(PERL_VER).dll\" EXTRA_LIBS += -L$(PERLLIBS) -lperl$(PERL_VER) endif endif ifdef LUA CFLAGS += -I$(LUA)/include -I$(LUA) -DFEAT_LUA ifeq (yes, $(DYNAMIC_LUA)) CFLAGS += -DDYNAMIC_LUA -DDYNAMIC_LUA_DLL=\"lua$(LUA_VER).dll\" endif endif ifdef MZSCHEME ifndef MZSCHEME_COLLECTS MZSCHEME_COLLECTS=$(MZSCHEME)/collects ifeq (yes, $(UNDER_CYGWIN)) MZSCHEME_COLLECTS:=$(shell cygpath -m $(MZSCHEME_COLLECTS) | sed -e 's/ /\\ /g') endif endif CFLAGS += -I$(MZSCHEME)/include -DFEAT_MZSCHEME -DMZSCHEME_COLLECTS=\"$(MZSCHEME_COLLECTS)\" ifeq (yes, $(DYNAMIC_MZSCHEME)) ifeq (yes, $(MZSCHEME_PRECISE_GC)) # Precise GC does not use separate dll CFLAGS += -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" -DDYNAMIC_MZGC_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" else CFLAGS += -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\" endif endif ifeq (yes, "$(MZSCHEME_DEBUG)") CFLAGS += -DMZSCHEME_FORCE_GC 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 ifneq ($(findstring w64-mingw32,$(CC)),) # A workaround for MinGW-w64 CFLAGS += -DHAVE_STRUCT_TIMESPEC -DHAVE_STRUCT_TIMEZONE endif endif ifdef PYTHON CFLAGS += -DFEAT_PYTHON ifeq (yes, $(DYNAMIC_PYTHON)) CFLAGS += -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"$(DYNAMIC_PYTHON_DLL)\" endif endif ifdef PYTHON3 CFLAGS += -DFEAT_PYTHON3 ifeq (yes, $(DYNAMIC_PYTHON3)) CFLAGS += -DDYNAMIC_PYTHON3 -DDYNAMIC_PYTHON3_DLL=\"$(DYNAMIC_PYTHON3_DLL)\" endif endif ifdef TCL CFLAGS += -DFEAT_TCL $(TCLINC) ifeq (yes, $(DYNAMIC_TCL)) CFLAGS += -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl$(TCL_VER).dll\" -DDYNAMIC_TCL_VER=\"$(TCL_VER_LONG)\" 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) # Only allow NETBEANS for a GUI build. ifeq (yes, $(GUI)) DEFINES += -DFEAT_NETBEANS_INTG ifeq ($(NBDEBUG), yes) DEFINES += -DNBDEBUG NBDEBUG_INCL = nbdebug.h NBDEBUG_SRC = nbdebug.c endif endif endif ifeq ($(CHANNEL),yes) DEFINES += -DFEAT_JOB_CHANNEL endif # DirectWrite (DirectX) ifeq ($(DIRECTX),yes) # Only allow DirectWrite for a GUI build. ifeq (yes, $(GUI)) DEFINES += -DFEAT_DIRECTX -DDYNAMIC_DIRECTX endif endif # Only allow XPM for a GUI build. ifeq (yes, $(GUI)) ifndef XPM ifeq ($(ARCH),i386) XPM = xpm/x86 endif ifeq ($(ARCH),i486) XPM = xpm/x86 endif ifeq ($(ARCH),i586) XPM = xpm/x86 endif ifeq ($(ARCH),i686) XPM = xpm/x86 endif ifeq ($(ARCH),x86-64) XPM = xpm/x64 endif endif ifdef XPM ifneq ($(XPM),no) CFLAGS += -DFEAT_XPM_W32 -I $(XPM)/include -I $(XPM)/../include endif endif 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 else # SPEED CFLAGS += -O2 endif endif CFLAGS += -s endif LIB = -lkernel32 -luser32 -lgdi32 -ladvapi32 -lcomdlg32 -lcomctl32 -lversion GUIOBJ = $(OUTDIR)/gui.o $(OUTDIR)/gui_w32.o $(OUTDIR)/gui_beval.o $(OUTDIR)/os_w32exe.o OBJ = \ $(OUTDIR)/blowfish.o \ $(OUTDIR)/buffer.o \ $(OUTDIR)/charset.o \ $(OUTDIR)/crypt.o \ $(OUTDIR)/crypt_zip.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)/hardcopy.o \ $(OUTDIR)/hashtab.o \ $(OUTDIR)/json.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)/winclip.o \ $(OUTDIR)/pathdef.o \ $(OUTDIR)/popupmnu.o \ $(OUTDIR)/quickfix.o \ $(OUTDIR)/regexp.o \ $(OUTDIR)/screen.o \ $(OUTDIR)/search.o \ $(OUTDIR)/sha256.o \ $(OUTDIR)/spell.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 LUA OBJ += $(OUTDIR)/if_lua.o endif ifdef MZSCHEME OBJ += $(OUTDIR)/if_mzsch.o MZSCHEME_INCL = if_mzsch.h ifeq (yes,$(MZSCHEME_GENERATE_BASE)) CFLAGS += -DINCLUDE_MZSCHEME_BASE MZ_EXTRA_DEP += mzscheme_base.c endif ifeq (yes,$(MZSCHEME_PRECISE_GC)) CFLAGS += -DMZ_PRECISE_GC endif endif ifdef PYTHON OBJ += $(OUTDIR)/if_python.o endif ifdef PYTHON3 OBJ += $(OUTDIR)/if_python3.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) ifneq ($(CHANNEL),yes) # Cannot use Netbeans without CHANNEL NETBEANS=no else ifneq (yes, $(GUI)) # Cannot use Netbeans without GUI. NETBEANS=no else OBJ += $(OUTDIR)/netbeans.o endif endif endif ifeq ($(CHANNEL),yes) OBJ += $(OUTDIR)/channel.o LIB += -lwsock32 endif ifeq ($(DIRECTX),yes) # Only allow DIRECTX for a GUI build. ifeq (yes, $(GUI)) OBJ += $(OUTDIR)/gui_dwrite.o LIB += -ld2d1 -ldwrite USE_STDCPLUS = yes endif endif ifneq ($(XPM),no) # Only allow XPM for a GUI build. ifeq (yes, $(GUI)) OBJ += $(OUTDIR)/xpm_w32.o # You'll need libXpm.a from http://gnuwin32.sf.net LIB += -L$(XPM)/lib -lXpm endif endif ifdef MZSCHEME MZSCHEME_SUFFIX = Z endif ifeq ($(GUI),yes) TARGET := gvim$(DEBUG_SUFFIX).exe DEFINES += $(DEF_GUI) OBJ += $(GUIOBJ) LFLAGS += -mwindows OUTDIR = gobj$(DEBUG_SUFFIX)$(MZSCHEME_SUFFIX)$(ARCH) else TARGET := vim$(DEBUG_SUFFIX).exe OUTDIR = obj$(DEBUG_SUFFIX)$(MZSCHEME_SUFFIX)$(ARCH) 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 += -L$(PERLLIBS) -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 OBJ += $(OUTDIR)/if_ole.o USE_STDCPLUS = yes 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 ifeq (yes, $(USE_STDCPLUS)) ifeq (yes, $(STATIC_STDCPLUS)) LIB += -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic else LIB += -lstdc++ endif 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 $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB) upx: exes upx gvim.exe upx vim.exe mpress: exes mpress gvim.exe mpress vim.exe xxd/xxd.exe: xxd/xxd.c $(MAKE) -C xxd -f Make_ming.mak CC='$(CC)' GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h $(MAKE) -C GvimExt -f Make_ming.mak CROSS=$(CROSS) CROSS_COMPILE=$(CROSS_COMPILE) CXX='$(CXX)' STATIC_STDCPLUS=$(STATIC_STDCPLUS) clean: -$(DEL) $(OUTDIR)$(DIRSLASH)*.o -$(DEL) $(OUTDIR)$(DIRSLASH)*.res -rmdir $(OUTDIR) -$(DEL) *.exe -$(DEL) pathdef.c ifdef PERL -$(DEL) if_perl.c endif ifdef MZSCHEME -$(DEL) mzscheme_base.c endif $(MAKE) -C GvimExt -f Make_ming.mak clean $(MAKE) -C xxd -f Make_ming.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)/if_python.o : if_python.c if_py_both.h $(INCL) $(CC) -c $(CFLAGS) $(PYTHONINC) $(PYTHON_HOME_DEF) $< -o $@ $(OUTDIR)/if_python3.o : if_python3.c if_py_both.h $(INCL) $(CC) -c $(CFLAGS) $(PYTHON3INC) $(PYTHON3_HOME_DEF) $< -o $@ $(OUTDIR)/%.o : %.c $(INCL) $(CC) -c $(CFLAGS) $< -o $@ $(OUTDIR)/vimrc.o: vim.rc version.h gui_w32_rc.h $(WINDRES) $(WINDRES_FLAGS) $(DEFINES) \ --input-format=rc --output-format=coff -i vim.rc -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)/gui_w32.o: gui_w32.c $(INCL) $(CC) -c $(CFLAGS) gui_w32.c -o $(OUTDIR)/gui_w32.o $(OUTDIR)/gui_dwrite.o: gui_dwrite.cpp $(INCL) gui_dwrite.h $(CC) -c $(CFLAGS) $(CXXFLAGS) gui_dwrite.cpp -o $(OUTDIR)/gui_dwrite.o $(OUTDIR)/if_cscope.o: if_cscope.c $(INCL) if_cscope.h $(CC) -c $(CFLAGS) if_cscope.c -o $(OUTDIR)/if_cscope.o # Remove -D__IID_DEFINED__ for newer versions of the w32api $(OUTDIR)/if_ole.o: if_ole.cpp $(INCL) $(CC) $(CFLAGS) $(CXXFLAGS) -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 $(XSUBPP) -prototypes -typemap \ $(PERLTYPEMAP) if_perl.xs > $@ $(OUTDIR)/netbeans.o: netbeans.c $(INCL) $(NBDEBUG_INCL) $(NBDEBUG_SRC) $(CC) -c $(CFLAGS) netbeans.c -o $(OUTDIR)/netbeans.o $(OUTDIR)/channel.o: channel.c $(INCL) $(CC) -c $(CFLAGS) channel.c -o $(OUTDIR)/channel.o $(OUTDIR)/regexp.o: regexp.c regexp_nfa.c $(INCL) $(CC) -c $(CFLAGS) regexp.c -o $(OUTDIR)/regexp.o $(OUTDIR)/if_mzsch.o: if_mzsch.c $(INCL) if_mzsch.h $(MZ_EXTRA_DEP) $(CC) -c $(CFLAGS) if_mzsch.c -o $(OUTDIR)/if_mzsch.o mzscheme_base.c: $(MZSCHEME)/mzc --c-mods mzscheme_base.c ++lib scheme/base 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) $(CFLAGS) $(LFLAGS) -o $(TARGET) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(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) $(CFLAGS) $(LFLAGS) -o $(TARGET) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)"; >> pathdef.c @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> pathdef.c @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> pathdef.c endif vim-7.4.1689/src/Make_dice.mak000066400000000000000000000076301267703067000157250ustar00rootroot00000000000000# # 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 = \ blowfish.c \ buffer.c \ charset.c \ crypt.c \ crypt_zip.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 \ hardcopy.c \ hashtab.c \ json.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 \ popupmnu.c \ quickfix.c \ regexp.c \ screen.c \ search.c \ sha256.c \ spell.c \ syntax.c \ tag.c \ term.c \ ui.c \ undo.c \ window.c \ version.c OBJ = o/blowfish.o \ o/buffer.o \ o/charset.o \ o/crypt.o \ o/crypt_zip.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/hardcopy.o \ o/hashtab.o \ o/json.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/popupmnu.o \ o/quickfix.o \ o/regexp.o \ o/screen.o \ o/search.o \ o/sha256.o \ o/spell.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/blowfish.o: blowfish.c $(SYMS) o/buffer.o: buffer.c $(SYMS) o/charset.o: charset.c $(SYMS) o/crypt.o: crypt.c $(SYMS) o/crypt_zip.o: crypt_zip.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/hardcopy.o: hardcopy.c $(SYMS) o/hashtab.o: hashtab.c $(SYMS) o/json.o: json.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/popupmnu.o: popupmnu.c $(SYMS) 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/sha256.o: sha256.c $(SYMS) o/spell.o: spell.c $(SYMS) 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) vim-7.4.1689/src/Make_dvc.mak000066400000000000000000000046771267703067000156050ustar00rootroot00000000000000# 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 ################################################################################ vim-7.4.1689/src/Make_ivc.mak000066400000000000000000000452371267703067000156070ustar00rootroot00000000000000# 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 version.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 version.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)/gui_beval.obj" "$(INTDIR)/os_w32exe.obj" CPP_PROJ=$(CPP_PROJ) /Zi /O2 /D "NDEBUG" /D "FEAT_GUI_W32" /D "DYNAMIC_GETTEXT" /D "FEAT_OLE" /Fd.\oleRel/ /Fo.\oleRel/ # ADD CPP /Zi /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:.\oleRel/gvim.pdb -debug:full -debugtype:cv,fixup /map:.\oleDbg\gvim.map libc.lib oleaut32.lib /subsystem:windows /out:.\gvim.exe # ADD LINK32 /pdb:.\oleRel/gvim.pdb -debug:full -debugtype:cv,fixup /map:.\oleDbg\gvim.map 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)/gui_beval.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 -debug:full -debugtype:cv,fixup /map:.\oleDbg\gvimd.map /out:.\gvimd.exe # ADD LINK32 libcd.lib oleaut32.lib /subsystem:windows /debug /profile /pdb:.\oleDbg/gvimd.pdb -debug:full -debugtype:cv,fixup /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)/gui_beval.obj" "$(INTDIR)/os_w32exe.obj" CPP_PROJ=$(CPP_PROJ) /Zi /O2 /D "NDEBUG" /D "FEAT_GUI_W32" /Fd.\gRel/ /Fo.\gRel/ # ADD CPP /Zi /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:.\gRel/gvim.pdb -debug:full -debugtype:cv,fixup /map:.\oleDbg\gvim.map libc.lib /subsystem:windows /out:.\gvim.exe # ADD LINK32 /pdb:.\gRel/gvim.pdb -debug:full -debugtype:cv,fixup /map:.\oleDbg\gvim.map 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)/gui_beval.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 -debug:full -debugtype:cv,fixup /map:.\gDbg\gvimd.map /out:.\gvimd.exe # ADD LINK32 libcd.lib /subsystem:windows /debug /profile /pdb:.\gDbg/gvimd.pdb -debug:full -debugtype:cv,fixup /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) /Zi /O2 /D "NDEBUG" /Fd.\Rel/ /Fo.\Rel/ # ADD CPP /Zi /O2 /D "NDEBUG" /Fd.\Rel/ /Fo.\Rel/ LINK32_FLAGS=$(LINK32_FLAGS) /pdb:.\Rel/vim.pdb -debug:full -debugtype:cv,fixup /map:.\oleDbg\vim.map libc.lib /subsystem:console /out:.\vim.exe # ADD LINK32 /pdb:.\Rel/vim.pdb -debug:full -debugtype:cv,fixup /map:.\oleDbg\vim.map 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 -debug:full -debugtype:cv,fixup /map:.\Dbg/vimd.map /out:.\vimd.exe # ADD LINK32 libcd.lib /subsystem:console /debug /profile /pdb:.\Dbg/vimd.pdb -debug:full -debugtype:cv,fixup /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)/blowfish.obj" \ "$(INTDIR)/buffer.obj" \ "$(INTDIR)/charset.obj" \ "$(INTDIR)/crypt.obj" \ "$(INTDIR)/crypt_zip.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)/hardcopy.obj" \ "$(INTDIR)/hashtab.obj" \ "$(INTDIR)/json.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)/winclip.obj" \ "$(INTDIR)/os_win32.obj" \ "$(INTDIR)/popupmnu.obj" \ "$(INTDIR)/quickfix.obj" \ "$(INTDIR)/regexp.obj" \ "$(INTDIR)/screen.obj" \ "$(INTDIR)/search.obj" \ "$(INTDIR)/sha256.obj" \ "$(INTDIR)/spell.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 user32.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=.\blowfish.c # End Source File # Begin Source File SOURCE=.\buffer.c # End Source File # Begin Source File SOURCE=.\charset.c # End Source File # Begin Source File SOURCE=.\crypt.c # End Source File # Begin Source File SOURCE=.\crypt_zip.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=.\hardcopy.c # End Source File # Begin Source File SOURCE=.\hashtab.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=.\gui_beval.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 /Zi /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=.\json.c # 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=.\winclip.c # End Source File # Begin Source File SOURCE=.\os_win32.c # End Source File # Begin Source File SOURCE=.\popupmnu.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=.\sha256.c # End Source File # Begin Source File SOURCE=.\spell.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 vim-7.4.1689/src/Make_manx.mak000066400000000000000000000152761267703067000157710ustar00rootroot00000000000000# # Makefile for VIM on the Amiga, using Aztec/Manx C 5.0 or later # # NOTE: THIS IS OLD AND PROBABLY NO LONGER WORKS. # # 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 = blowfish.c \ buffer.c \ charset.c \ crypt.c \ crypt_zip.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 \ hardcopy.c \ hashtab.c \ json.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 \ popupmnu.c \ quickfix.c \ regexp.c \ screen.c \ search.c \ sha256.c \ spell.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/blowfish.o \ obj/buffer.o \ obj/charset.o \ obj/crypt.o \ obj/crypt_zip.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/hardcopy.o \ obj/hashtab.o \ obj/json.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/popupmnu.o \ obj/quickfix.o \ obj/regexp.o \ obj/screen.o \ obj/search.o \ obj/sha256.o \ obj/spell.o \ obj/syntax.o \ obj/tag.o \ obj/term.o \ obj/ui.o \ obj/undo.o \ obj/window.o \ $(TERMLIB) PRO = proto/blowfish.pro \ proto/buffer.pro \ proto/charset.pro \ proto/crypt.pro \ proto/crypt_zip.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/hardcopy.pro \ proto/hashtab.pro \ proto/json.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/popupmnu.pro \ proto/quickfix.pro \ proto/regexp.pro \ proto/screen.pro \ proto/search.pro \ proto/sha256.pro \ proto/spell.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/blowfish.o: blowfish.c $(CCSYM) $@ blowfish.c obj/buffer.o: buffer.c $(CCSYM) $@ buffer.c obj/charset.o: charset.c $(CCSYM) $@ charset.c obj/crypt.o: crypt.c $(CCSYM) $@ crypt.c obj/crypt_zip.o: crypt_zip.c $(CCSYM) $@ crypt_zip.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 obj/hardcopy.o: hardcopy.c $(CCSYM) $@ hardcopy.c obj/hashtab.o: hashtab.c $(CCSYM) $@ hashtab.c obj/json.o: json.c $(CCSYM) $@ json.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/popupmnu.o: popupmnu.c $(CCSYM) $@ popupmnu.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/sha256.o: sha256.c $(CCSYM) $@ sha256.c obj/spell.o: spell.c $(CCSYM) $@ spell.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 vim-7.4.1689/src/Make_ming.mak000066400000000000000000000026151267703067000157510ustar00rootroot00000000000000# # Makefile for VIM on Win32, using MinGW # # Also read INSTALLpc.txt! # # The old Make_ming.mak (maintained by Ron Aaron et al.) was merged into # Make_cyg_ming.mak. # This file contains MinGW specific settings. Common settings are contained # in Make_cyg_ming.mak. # # Last updated by Ken Takata. # Last Change: 2014 Oct 21 # uncomment 'PERL' if you want a perl-enabled version #PERL=c:/perl # uncomment 'LUA' if you want a Lua-enabled version #LUA=c:/lua # uncomment 'MZSCHEME' if you want a MzScheme-enabled version #MZSCHEME=d:/plt # uncomment 'PYTHON' if you want a 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 # uncomment 'PYTHON3' if you want a python3-enabled version #PYTHON3=c:/python31 # uncomment 'TCL' if you want a Tcl-enabled version #TCL=c:/tcl # uncomment 'RUBY' if you want a Ruby-enabled version #RUBY=c:/ruby # Do not change this. UNDER_CYGWIN = no include Make_cyg_ming.mak vim-7.4.1689/src/Make_mint.mak000066400000000000000000000032451267703067000157660ustar00rootroot00000000000000# # 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 successfully 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) vim-7.4.1689/src/Make_morph.mak000066400000000000000000000024751267703067000161500ustar00rootroot00000000000000# # Makefile for VIM, using MorphOS SDK (gcc 2.95.3) # CFLAGS = -c \ -pipe \ -O2 \ -Wall \ \ -DNO_ARP \ -DUSE_TMPNAM \ \ -I proto \ \ -noixemul PRG = Vim LIBS = -noixemul -s CC = gcc LD = gcc OBJDUMP = objdump RM = rm .c.o: ${CC} ${CFLAGS} $< -o $@ SRC = blowfish.c \ buffer.c \ charset.c \ crypt.c \ crypt_zip.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 \ hardcopy.c \ hashtab.c \ json.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 \ popupmnu.c \ quickfix.c \ regexp.c \ screen.c \ search.c \ sha256.c \ spell.c \ syntax.c \ tag.c \ term.c \ ui.c \ undo.c \ version.c \ window.c \ 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 vim-7.4.1689/src/Make_mvc.mak000066400000000000000000001076421267703067000156120ustar00rootroot00000000000000# Makefile for Vim on Win32 (Windows NT/2000/XP/2003 and Windows 95/98/Me) # and Win64, using the Microsoft Visual C++ compilers. Known to work with # VC5, VC6 (VS98), VC7.0 (VS2002), VC7.1 (VS2003), VC8 (VS2005), # VC9 (VS2008), VC10 (VS2010) and VC11 (VS2012) # # To build using other Windows compilers, see INSTALLpc.txt # # This makefile can build the console, GUI, OLE-enable, Perl-enabled and # Python-enabled versions of Vim for Win32 platforms. # # 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 features, define any of the following: # # For MSVC 11 you need to specify where the Win32.mak file is, e.g.: # SDK_INCLUDE_DIR="C:\Program Files\Microsoft SDKs\Windows\v7.1\Include" # # !!!! After changing features do "nmake clean" first !!!! # # Feature Set: FEATURES=[TINY, SMALL, NORMAL, BIG, HUGE] (default is HUGE) # # GUI interface: GUI=yes (default is no) # # GUI with DirectWrite(DirectX): DIRECTX=yes # (default is no, requires GUI=yes) # # OLE interface: OLE=yes (usually with GUI=yes) # # Multibyte support: MBYTE=yes (default is no) # # 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) # # Lua interface: # LUA=[Path to Lua directory] # DYNAMIC_LUA=yes (to load the Lua DLL dynamically) # LUA_VER=[Lua version] (default is 51) # # MzScheme interface: # MZSCHEME=[Path to MzScheme directory] # DYNAMIC_MZSCHEME=yes (to load the MzScheme DLLs dynamically) # MZSCHEME_VER=[version, 205_000, ...] # MZSCHEME_DEBUG=no # # 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), # 510 (5.10.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 22, 23, ..., 27] (default is 22) # # Python3 interface: # PYTHON3=[Path to Python3 directory] # DYNAMIC_PYTHON3=yes (to load the Python3 DLL dynamically) # PYTHON3_VER=[Python3 version, eg 30, 31] (default is 31) # # Ruby interface: # RUBY=[Path to Ruby directory] # DYNAMIC_RUBY=yes (to load the Ruby DLL dynamically) # RUBY_VER=[Ruby version, eg 18, 19, 20] (default is 18) # RUBY_VER_LONG=[Ruby version, eg 1.8, 1.9.1, 2.0.0] (default is 1.8) # You must set RUBY_VER_LONG when change RUBY_VER. # RUBY_API_VER is derived from RUBY_VER_LONG. # Note: If you use Ruby 1.9.3, set as follows: # RUBY_VER=19 # RUBY_VER_LONG=1.9.1 (not 1.9.3, because the API version is 1.9.1.) # # 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. # # 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) # # Netbeans Support: NETBEANS=[yes or no] (default is yes if GUI is yes) # Requires CHANNEL. # # Netbeans Debugging Support: NBDEBUG=[yes or no] (should be no, yes # doesn't work) # # Inter process communication: CHANNEL=[yes or no] (default is yes if GUI # is yes) # # XPM Image Support: XPM=[path to XPM directory] # Default is "xpm", using the files included in the distribution. # Use "no" to disable this feature. # # Optimization: OPTIMIZE=[SPACE, SPEED, MAXSPEED] (default is MAXSPEED) # # Processor Version: CPUNR=[i386, i486, i586, i686, pentium4] (default is # i386) # # Version Support: WINVER=[0x0501, 0x0600] (default is 0x0501) # # 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) # # Static Code Analysis: ANALYZE=yes (works with VS2012 only) # # 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 # # 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. It may be # badly out of date for the Visual C++ you are using... # 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 Make_mvc.mvc "DEFINES=-DEMACS_TAGS" # Build on both Windows NT/XP and Windows 9x TARGETOS = BOTH # Select one of eight object code directories, depends on GUI, OLE, DEBUG and # interfaces. # If you change something else, do "make clean" first! !if "$(GUI)" == "yes" OBJDIR = .\ObjG !else OBJDIR = .\ObjC !endif !if "$(DIRECTX)" == "yes" OBJDIR = $(OBJDIR)X !endif !if "$(OLE)" == "yes" OBJDIR = $(OBJDIR)O !endif !ifdef LUA OBJDIR = $(OBJDIR)U !endif !ifdef PERL OBJDIR = $(OBJDIR)L !endif !ifdef PYTHON OBJDIR = $(OBJDIR)Y !endif !ifdef PYTHON3 OBJDIR = $(OBJDIR)H !endif !ifdef TCL OBJDIR = $(OBJDIR)T !endif !ifdef RUBY OBJDIR = $(OBJDIR)R !endif !ifdef MZSCHEME OBJDIR = $(OBJDIR)Z !endif !if "$(DEBUG)" == "yes" OBJDIR = $(OBJDIR)d !endif # Win32.mak requires that CPU be set appropriately. # To cross-compile for Win64, set CPU=AMD64 or CPU=IA64. !ifdef PROCESSOR_ARCHITECTURE # We're on Windows NT or using VC 6+ ! ifdef CPU ASSEMBLY_ARCHITECTURE=$(CPU) # Using I386 for $ASSEMBLY_ARCHITECTURE doesn't work for VC7. ! if "$(CPU)" == "I386" CPU = i386 ! endif ! else # !CPU CPU = i386 ! if !defined(PLATFORM) && defined(TARGET_CPU) PLATFORM = $(TARGET_CPU) ! endif ! ifdef PLATFORM ! if ("$(PLATFORM)" == "x64") || ("$(PLATFORM)" == "X64") CPU = AMD64 ! elseif ("$(PLATFORM)" != "x86") && ("$(PLATFORM)" != "X86") ! error *** ERROR Unknown target platform "$(PLATFORM)". Make aborted. ! endif ! endif # !PLATFORM ! endif !else # !PROCESSOR_ARCHITECTURE # We're on Windows 95 CPU = i386 !endif # !PROCESSOR_ARCHITECTURE ASSEMBLY_ARCHITECTURE=$(CPU) OBJDIR = $(OBJDIR)$(CPU) # Build a retail version by default !if "$(DEBUG)" != "yes" NODEBUG = 1 !else !undef NODEBUG MAKEFLAGS_GVIMEXT = DEBUG=yes !endif # Get all sorts of useful, standard macros from the Platform SDK. !ifdef SDK_INCLUDE_DIR !include $(SDK_INCLUDE_DIR)\Win32.mak !else !include !endif # Flag to turn on Win64 compatibility warnings for VC7.x and VC8. WP64CHECK = /Wp64 #>>>>> 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 !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 !ifndef CHANNEL CHANNEL = $(GUI) !endif # Only allow NETBEANS and XPM for a GUI build and CHANNEL. !if "$(GUI)" == "yes" !if "$(NETBEANS)" == "yes" && "$(CHANNEL)" == "yes" # NETBEANS - Include support for Netbeans integration NETBEANS_PRO = proto/netbeans.pro NETBEANS_OBJ = $(OBJDIR)/netbeans.obj NETBEANS_DEFS = -DFEAT_NETBEANS_INTG !if "$(NBDEBUG)" == "yes" NBDEBUG_DEFS = -DNBDEBUG NBDEBUG_INCL = nbdebug.h NBDEBUG_SRC = nbdebug.c !endif NETBEANS_LIB = WSock32.lib !endif # DirectWrite(DirectX) !if "$(DIRECTX)" == "yes" DIRECTX_DEFS = -DFEAT_DIRECTX -DDYNAMIC_DIRECTX DIRECTX_INCL = gui_dwrite.h DIRECTX_OBJ = $(OUTDIR)\gui_dwrite.obj !endif !ifndef XPM # XPM is not set, use the included xpm files, depending on the architecture. !if "$(CPU)" == "AMD64" XPM = xpm\x64 !elseif "$(CPU)" == "i386" XPM = xpm\x86 !else XPM = no !endif !endif !if "$(XPM)" != "no" # XPM - Include support for XPM signs # See the xpm directory for more information. XPM_OBJ = $(OBJDIR)/xpm_w32.obj XPM_DEFS = -DFEAT_XPM_W32 XPM_LIB = $(XPM)\lib\libXpm.lib XPM_INC = -I $(XPM)\include -I $(XPM)\..\include !endif !endif !if "$(CHANNEL)" == "yes" CHANNEL_PRO = proto/channel.pro CHANNEL_OBJ = $(OBJDIR)/channel.obj CHANNEL_DEFS = -DFEAT_JOB_CHANNEL NETBEANS_LIB = WSock32.lib !endif # Set which version of the CRT to use !if defined(USE_MSVCRT) # CVARS = $(cvarsdll) # !elseif defined(MULTITHREADED) # CVARS = $(cvarsmt) !else # CVARS = $(cvars) # CVARS = $(cvarsmt) !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 = oldnames.lib kernel32.lib advapi32.lib shell32.lib gdi32.lib \ comdlg32.lib ole32.lib uuid.lib /machine:$(CPU) !if "$(DELAYLOAD)" == "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) !ifndef WINVER WINVER = 0x0501 !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 \ $(CSCOPE_DEFS) $(NETBEANS_DEFS) $(CHANNEL_DEFS) \ $(NBDEBUG_DEFS) $(XPM_DEFS) \ $(DEFINES) -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) \ /Fo$(OUTDIR)/ #>>>>> 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) !if [echo MSVCVER=_MSC_VER> msvcver.c && $(CC) /EP msvcver.c > msvcver.~ 2> nul] !message *** ERROR !message Cannot run Visual C to determine its version. Make sure cl.exe is in your PATH. !message This can usually be done by running "vcvarsall.bat", located in the bin directory where Visual Studio was installed. !error Make aborted. !else !include msvcver.~ !if [del msvcver.c msvcver.~] !endif !endif !if $(MSVCVER) < 1900 MSVC_MAJOR = ($(MSVCVER) / 100 - 6) MSVCRT_VER = ($(MSVCVER) / 10 - 60) !else MSVC_MAJOR = ($(MSVCVER) / 100 - 5) MSVCRT_VER = ($(MSVCVER) / 10 - 50) !endif # Calculate MSVCRT_VER !if [(set /a MSVCRT_VER="$(MSVCRT_VER)" > nul) && set MSVCRT_VER > msvcrtver.~] == 0 !include msvcrtver.~ !if [del msvcrtver.~] !endif !endif # Base name of the msvcrXX.dll !if $(MSVCRT_VER) <= 60 MSVCRT_NAME = msvcrt !else MSVCRT_NAME = msvcr$(MSVCRT_VER) !endif !if $(MSVC_MAJOR) == 6 CPU = ix86 !endif # Convert processor ID to MVC-compatible number !if $(MSVC_MAJOR) < 8 !if "$(CPUNR)" == "i386" CPUARG = /G3 !elseif "$(CPUNR)" == "i486" CPUARG = /G4 !elseif "$(CPUNR)" == "i586" CPUARG = /G5 !elseif "$(CPUNR)" == "i686" CPUARG = /G6 !elseif "$(CPUNR)" == "pentium4" CPUARG = /G7 /arch:SSE2 !else CPUARG = !endif !else # VC8/9/10 only allows specifying SSE architecture but only for 32bit !if "$(ASSEMBLY_ARCHITECTURE)" == "i386" && "$(CPUNR)" == "pentium4" CPUARG = /arch:SSE2 !endif !endif LIBC = DEBUGINFO = /Zi # Don't use /nodefaultlib on MSVC 14 !if $(MSVC_MAJOR) >= 14 NODEFAULTLIB = !else NODEFAULTLIB = /nodefaultlib !endif !ifdef NODEBUG VIM = vim !if "$(OPTIMIZE)" == "SPACE" OPTFLAG = /O1 !elseif "$(OPTIMIZE)" == "SPEED" OPTFLAG = /O2 !else # MAXSPEED OPTFLAG = /Ox !endif !if $(MSVC_MAJOR) >= 8 # Use link time code generation if not worried about size !if "$(OPTIMIZE)" != "SPACE" OPTFLAG = $(OPTFLAG) /GL !endif !endif # (/Wp64 is deprecated in VC9 and generates an obnoxious warning.) !if ($(MSVC_MAJOR) == 7) || ($(MSVC_MAJOR) == 8) CFLAGS=$(CFLAGS) $(WP64CHECK) !endif # Static code analysis generally available starting with VS2012 (VC11) or # Windows SDK 7.1 (VC10) !if ("$(ANALYZE)" == "yes") && ($(MSVC_MAJOR) >= 10) CFLAGS=$(CFLAGS) /analyze !endif CFLAGS = $(CFLAGS) $(OPTFLAG) -DNDEBUG $(CPUARG) RCFLAGS = $(rcflags) $(rcvars) -DNDEBUG ! ifdef USE_MSVCRT CFLAGS = $(CFLAGS) /MD LIBC = msvcrt.lib ! else LIBC = libcmt.lib CFLAGS = $(CFLAGS) /Zl /MT ! endif !else # DEBUG VIM = vimd ! if ("$(CPU)" == "i386") || ("$(CPU)" == "ix86") DEBUGINFO = /ZI ! endif CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /Od RCFLAGS = $(rcflags) $(rcvars) -D_DEBUG -DDEBUG # The /fixed:no is needed for Quantify. Assume not 4.? as unsupported in VC4.0. ! if $(MSVC_MAJOR) == 4 LIBC = ! else LIBC = /fixed:no ! endif ! ifdef USE_MSVCRT CFLAGS = $(CFLAGS) /MDd LIBC = $(LIBC) msvcrtd.lib ! else LIBC = $(LIBC) libcmtd.lib CFLAGS = $(CFLAGS) /Zl /MTd ! 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 $(CSCOPE_INCL) \ $(NBDEBUG_INCL) OBJ = \ $(OUTDIR)\blowfish.obj \ $(OUTDIR)\buffer.obj \ $(OUTDIR)\charset.obj \ $(OUTDIR)\crypt.obj \ $(OUTDIR)\crypt_zip.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)\hardcopy.obj \ $(OUTDIR)\hashtab.obj \ $(OUTDIR)\json.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)\winclip.obj \ $(OUTDIR)\os_win32.obj \ $(OUTDIR)\pathdef.obj \ $(OUTDIR)\popupmnu.obj \ $(OUTDIR)\quickfix.obj \ $(OUTDIR)\regexp.obj \ $(OUTDIR)\screen.obj \ $(OUTDIR)\search.obj \ $(OUTDIR)\sha256.obj \ $(OUTDIR)\spell.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 \ gui_beval.h \ keymap.h \ macros.h \ option.h \ os_dos.h \ os_win32.h GUI_OBJ = \ $(OUTDIR)\gui.obj \ $(OUTDIR)\gui_beval.obj \ $(OUTDIR)\gui_w32.obj \ $(OUTDIR)\os_w32exe.obj GUI_LIB = \ gdi32.lib version.lib $(IME_LIB) \ winspool.lib comctl32.lib advapi32.lib shell32.lib \ /machine:$(CPU) !else SUBSYSTEM = console !endif !if "$(SUBSYSTEM_VER)" != "" SUBSYSTEM = $(SUBSYSTEM),$(SUBSYSTEM_VER) !endif !if "$(GUI)" == "yes" && "$(DIRECTX)" == "yes" CFLAGS = $(CFLAGS) $(DIRECTX_DEFS) GUI_INCL = $(GUI_INCL) $(DIRECTX_INCL) GUI_OBJ = $(GUI_OBJ) $(DIRECTX_OBJ) !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 # Lua interface !ifdef LUA !ifndef LUA_VER LUA_VER = 51 !endif !message Lua requested (version $(LUA_VER)) - root dir is "$(LUA)" !if "$(DYNAMIC_LUA)" == "yes" !message Lua DLL will be loaded dynamically !endif CFLAGS = $(CFLAGS) -DFEAT_LUA LUA_OBJ = $(OUTDIR)\if_lua.obj LUA_INC = /I "$(LUA)\include" /I "$(LUA)" !if "$(DYNAMIC_LUA)" == "yes" CFLAGS = $(CFLAGS) -DDYNAMIC_LUA \ -DDYNAMIC_LUA_DLL=\"lua$(LUA_VER).dll\" LUA_LIB = /nodefaultlib:lua$(LUA_VER).lib !else LUA_LIB = "$(LUA)\lib\lua$(LUA_VER).lib" !endif !endif !ifdef PYTHON !ifdef PYTHON3 DYNAMIC_PYTHON=yes DYNAMIC_PYTHON3=yes !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 # PYTHON3 interface !ifdef PYTHON3 !ifndef PYTHON3_VER PYTHON3_VER = 31 !endif !message Python3 requested (version $(PYTHON3_VER)) - root dir is "$(PYTHON3)" !if "$(DYNAMIC_PYTHON3)" == "yes" !message Python3 DLL will be loaded dynamically !endif CFLAGS = $(CFLAGS) -DFEAT_PYTHON3 PYTHON3_OBJ = $(OUTDIR)\if_python3.obj PYTHON3_INC = /I "$(PYTHON3)\Include" /I "$(PYTHON3)\PC" !if "$(DYNAMIC_PYTHON3)" == "yes" CFLAGS = $(CFLAGS) -DDYNAMIC_PYTHON3 \ -DDYNAMIC_PYTHON3_DLL=\"python$(PYTHON3_VER).dll\" PYTHON3_LIB = /nodefaultlib:python$(PYTHON3_VER).lib !else PYTHON3_LIB = $(PYTHON3)\libs\python$(PYTHON3_VER).lib !endif !endif # MzScheme interface !ifdef MZSCHEME !message MzScheme requested - root dir is "$(MZSCHEME)" !ifndef MZSCHEME_VER MZSCHEME_VER = 205_000 !endif !ifndef MZSCHEME_COLLECTS MZSCHEME_COLLECTS=$(MZSCHEME)\collects !endif CFLAGS = $(CFLAGS) -DFEAT_MZSCHEME -I "$(MZSCHEME)\include" !if EXIST("$(MZSCHEME)\lib\msvc\libmzsch$(MZSCHEME_VER).lib") MZSCHEME_MAIN_LIB=mzsch !else MZSCHEME_MAIN_LIB=racket !endif !if (EXIST("$(MZSCHEME)\lib\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll") \ && !EXIST("$(MZSCHEME)\lib\libmzgc$(MZSCHEME_VER).dll")) \ || (EXIST("$(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib") \ && !EXIST("$(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib")) !message Building with Precise GC MZSCHEME_PRECISE_GC = yes CFLAGS = $(CFLAGS) -DMZ_PRECISE_GC !endif !if "$(DYNAMIC_MZSCHEME)" == "yes" !message MzScheme DLLs will be loaded dynamically CFLAGS = $(CFLAGS) -DDYNAMIC_MZSCHEME !if "$(MZSCHEME_PRECISE_GC)" == "yes" # Precise GC does not use separate dll CFLAGS = $(CFLAGS) \ -DDYNAMIC_MZSCH_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" \ -DDYNAMIC_MZGC_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" !else CFLAGS = $(CFLAGS) \ -DDYNAMIC_MZSCH_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" \ -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\" !endif !else !if "$(MZSCHEME_DEBUG)" == "yes" CFLAGS = $(CFLAGS) -DMZSCHEME_FORCE_GC !endif !if "$(MZSCHEME_PRECISE_GC)" == "yes" # Precise GC does not use separate dll !if EXIST("$(MZSCHEME)\lib\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).def") # create .lib from .def MZSCHEME_LIB = lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib MZSCHEME_EXTRA_DEP = lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib !else MZSCHEME_LIB = "$(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib" !endif !else MZSCHEME_LIB = "$(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib" \ "$(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib" !endif !endif MZSCHEME_OBJ = $(OUTDIR)\if_mzsch.obj # increase stack size MZSCHEME_LIB = $(MZSCHEME_LIB) /STACK:8388608 !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 !if exist($(PERL_INCDIR)\perl$(PERL_VER).lib) PERL_LIB = $(PERL_INCDIR)\perl$(PERL_VER).lib !else # For ActivePerl 5.18 and later PERL_LIB = $(PERL_INCDIR)\libperl$(PERL_VER).a !endif !endif CFLAGS = $(CFLAGS) -DFEAT_PERL -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS # 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) !if $(MSVC_MAJOR) <= 11 # ActivePerl 5.20+ requires stdbool.h but VC2012 or earlier doesn't have it. # Use a stub stdbool.h. PERL_INC = $(PERL_INC) /I if_perl_msvc !endif PERL_OBJ = $(OUTDIR)\if_perl.obj $(OUTDIR)\if_perlsfio.obj XSUBPP = $(PERL)\lib\ExtUtils\xsubpp !if exist($(XSUBPP)) XSUBPP = $(PERL_EXE) $(XSUBPP) !else XSUBPP = xsubpp !endif 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 !ifndef RUBY_API_VER RUBY_API_VER = $(RUBY_VER_LONG:.=) !endif !if $(RUBY_VER) >= 18 !ifndef RUBY_PLATFORM !if "$(CPU)" == "i386" RUBY_PLATFORM = i386-mswin32 !else # CPU RUBY_PLATFORM = x64-mswin64 !endif # CPU !if $(MSVCRT_VER) >= 70 RUBY_PLATFORM = $(RUBY_PLATFORM)_$(MSVCRT_VER) !endif # MSVCRT_VER !endif # RUBY_PLATFORM !ifndef RUBY_INSTALL_NAME !ifndef RUBY_MSVCRT_NAME # Base name of msvcrXX.dll which is used by ruby's dll. RUBY_MSVCRT_NAME = $(MSVCRT_NAME) !endif # RUBY_MSVCRT_NAME !if "$(CPU)" == "i386" RUBY_INSTALL_NAME = $(RUBY_MSVCRT_NAME)-ruby$(RUBY_API_VER) !else # CPU RUBY_INSTALL_NAME = x64-$(RUBY_MSVCRT_NAME)-ruby$(RUBY_API_VER) !endif # CPU !endif # RUBY_INSTALL_NAME !else # $(RUBY_VER) >= 18 !ifndef RUBY_PLATFORM RUBY_PLATFORM = i586-mswin32 !endif !ifndef RUBY_INSTALL_NAME RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_API_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 !if $(RUBY_VER) >= 19 RUBY_INC = /I "$(RUBY)\lib\ruby\$(RUBY_VER_LONG)\$(RUBY_PLATFORM)" /I "$(RUBY)\include\ruby-$(RUBY_VER_LONG)" /I "$(RUBY)\include\ruby-$(RUBY_VER_LONG)\$(RUBY_PLATFORM)" !else RUBY_INC = /I "$(RUBY)\lib\ruby\$(RUBY_VER_LONG)\$(RUBY_PLATFORM)" !endif 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_VER=$(RUBY_VER) \ -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\" !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 = HUGE !endif CFLAGS = $(CFLAGS) -DFEAT_$(FEATURES) # # Always generate the .pdb file, so that we get debug symbols that can be used # on a crash (doesn't add overhead to the executable). # Generate edit-and-continue debug info when no optimization - allows to # debug more conveniently (able to look at variables which are in registers) # CFLAGS = $(CFLAGS) /Fd$(OUTDIR)/ $(DEBUGINFO) LINK_PDB = /PDB:$(VIM).pdb -debug # # End extra feature include # !message conflags = /nologo /subsystem:$(SUBSYSTEM) PATHDEF_SRC = $(OUTDIR)\pathdef.c !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) LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(NODEFAULTLIB) $(LIBC) $(OLE_LIB) user32.lib \ $(LUA_LIB) $(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(PYTHON3_LIB) $(RUBY_LIB) \ $(TCL_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB) # Report link time code generation progress if used. !ifdef NODEBUG !if $(MSVC_MAJOR) >= 8 !if "$(OPTIMIZE)" != "SPACE" LINKARGS1 = $(LINKARGS1) /LTCG:STATUS !endif !endif !endif all: $(VIM).exe \ vimrun.exe \ install.exe \ uninstal.exe \ xxd/xxd.exe \ tee/tee.exe \ GvimExt/gvimext.dll $(VIM).exe: $(OUTDIR) $(OBJ) $(GUI_OBJ) $(OLE_OBJ) $(OLE_IDL) $(MZSCHEME_OBJ) \ $(LUA_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(PYTHON3_OBJ) $(RUBY_OBJ) $(TCL_OBJ) \ $(CSCOPE_OBJ) $(NETBEANS_OBJ) $(CHANNEL_OBJ) $(XPM_OBJ) \ version.c version.h $(CC) $(CFLAGS) version.c $(link) $(LINKARGS1) -out:$(VIM).exe $(OBJ) $(GUI_OBJ) $(OLE_OBJ) \ $(LUA_OBJ) $(MZSCHEME_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(PYTHON3_OBJ) $(RUBY_OBJ) \ $(TCL_OBJ) $(CSCOPE_OBJ) $(NETBEANS_OBJ) $(CHANNEL_OBJ) \ $(XPM_OBJ) $(OUTDIR)\version.obj $(LINKARGS2) if exist $(VIM).exe.manifest mt.exe -nologo -manifest $(VIM).exe.manifest -updateresource:$(VIM).exe;1 $(VIM): $(VIM).exe $(OUTDIR): if not exist $(OUTDIR)/nul mkdir $(OUTDIR) install.exe: dosinst.c $(CC) /nologo -DNDEBUG -DWIN32 dosinst.c kernel32.lib shell32.lib \ user32.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 .. tee/tee.exe: tee/tee.c cd tee $(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: - if exist $(OUTDIR)/nul $(DEL_TREE) $(OUTDIR) - 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 tee $(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 .. testgvim: cd testdir $(MAKE) /NOLOGO -f Make_dos.mak VIMPROG=..\gvim win32 cd .. testclean: cd testdir $(MAKE) /NOLOGO -f Make_dos.mak clean 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) $< # 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) $< $(OUTDIR)/blowfish.obj: $(OUTDIR) blowfish.c $(INCL) $(OUTDIR)/buffer.obj: $(OUTDIR) buffer.c $(INCL) $(OUTDIR)/charset.obj: $(OUTDIR) charset.c $(INCL) $(OUTDIR)/crypt.obj: $(OUTDIR) crypt.c $(INCL) $(OUTDIR)/crypt_zip.obj: $(OUTDIR) crypt_zip.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)/hardcopy.obj: $(OUTDIR) hardcopy.c $(INCL) $(OUTDIR)/hashtab.obj: $(OUTDIR) hashtab.c $(INCL) $(OUTDIR)/gui.obj: $(OUTDIR) gui.c $(INCL) $(GUI_INCL) $(OUTDIR)/gui_beval.obj: $(OUTDIR) gui_beval.c $(INCL) $(GUI_INCL) $(OUTDIR)/gui_w32.obj: $(OUTDIR) gui_w32.c $(INCL) $(GUI_INCL) $(OUTDIR)/gui_dwrite.obj: $(OUTDIR) gui_dwrite.cpp $(INCL) $(GUI_INCL) $(OUTDIR)/if_cscope.obj: $(OUTDIR) if_cscope.c $(INCL) $(OUTDIR)/if_lua.obj: $(OUTDIR) if_lua.c $(INCL) $(CC) $(CFLAGS) $(LUA_INC) if_lua.c if_perl.c : if_perl.xs typemap $(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 $(OUTDIR)/if_perlsfio.obj: $(OUTDIR) if_perlsfio.c $(INCL) $(CC) $(CFLAGS) $(PERL_INC) if_perlsfio.c $(OUTDIR)/if_mzsch.obj: $(OUTDIR) if_mzsch.c if_mzsch.h $(INCL) $(MZSCHEME_EXTRA_DEP) $(CC) $(CFLAGS) if_mzsch.c \ -DMZSCHEME_COLLECTS="\"$(MZSCHEME_COLLECTS:\=\\)\"" lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib: lib /DEF:"$(MZSCHEME)\lib\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).def" $(OUTDIR)/if_python.obj: $(OUTDIR) if_python.c if_py_both.h $(INCL) $(CC) $(CFLAGS) $(PYTHON_INC) if_python.c $(OUTDIR)/if_python3.obj: $(OUTDIR) if_python3.c if_py_both.h $(INCL) $(CC) $(CFLAGS) $(PYTHON3_INC) if_python3.c $(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 $(OUTDIR)/if_tcl.obj: $(OUTDIR) if_tcl.c $(INCL) $(CC) $(CFLAGS) $(TCL_INC) if_tcl.c $(OUTDIR)/json.obj: $(OUTDIR) json.c $(INCL) $(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)/channel.obj: $(OUTDIR) channel.c $(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)/winclip.obj: $(OUTDIR) winclip.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) $(PATHDEF_SRC) $(INCL) $(CC) $(CFLAGS) $(PATHDEF_SRC) $(OUTDIR)/popupmnu.obj: $(OUTDIR) popupmnu.c $(INCL) $(OUTDIR)/quickfix.obj: $(OUTDIR) quickfix.c $(INCL) $(OUTDIR)/regexp.obj: $(OUTDIR) regexp.c regexp_nfa.c $(INCL) $(OUTDIR)/screen.obj: $(OUTDIR) screen.c $(INCL) $(OUTDIR)/search.obj: $(OUTDIR) search.c $(INCL) $(OUTDIR)/sha256.obj: $(OUTDIR) sha256.c $(INCL) $(OUTDIR)/spell.obj: $(OUTDIR) spell.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 $(OUTDIR)/vim.res: $(OUTDIR) vim.rc gvim.exe.mnf version.h tools.bmp \ tearoff.bmp vim.ico vim_error.ico \ vim_alert.ico vim_info.ico vim_quest.ico $(RC) /nologo /l 0x409 /Fo$(OUTDIR)/vim.res $(RCFLAGS) vim.rc iid_ole.c if_ole.h vim.tlb: if_ole.idl midl /nologo /error none /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 /error none /proxy nul dimm.idl $(OUTDIR)/dimm_i.obj: $(OUTDIR) dimm_i.c $(INCL) $(OUTDIR)/glbl_ime.obj: $(OUTDIR) glbl_ime.cpp dimm.h $(INCL) # $CFLAGS may contain backslashes and double quotes, escape them both. E0_CFLAGS = $(CFLAGS:\=\\) E_CFLAGS = $(E0_CFLAGS:"=\") # ") stop the string # $LINKARGS2 may contain backslashes and double quotes, escape them both. E0_LINKARGS2 = $(LINKARGS2:\=\\) E_LINKARGS2 = $(E0_LINKARGS2:"=\") # ") stop the string $(PATHDEF_SRC): auto @echo creating $(PATHDEF_SRC) @echo /* pathdef.c */ > $(PATHDEF_SRC) @echo #include "vim.h" >> $(PATHDEF_SRC) @echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC:\=\\)"; >> $(PATHDEF_SRC) @echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR:\=\\)"; >> $(PATHDEF_SRC) @echo char_u *all_cflags = (char_u *)"$(CC:\=\\) $(E_CFLAGS)"; >> $(PATHDEF_SRC) @echo char_u *all_lflags = (char_u *)"$(link:\=\\) $(LINKARGS1:\=\\) $(E_LINKARGS2)"; >> $(PATHDEF_SRC) @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> $(PATHDEF_SRC) @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> $(PATHDEF_SRC) auto: if not exist auto/nul mkdir auto # End Custom Build proto.h: \ proto/blowfish.pro \ proto/buffer.pro \ proto/charset.pro \ proto/crypt.pro \ proto/crypt_zip.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/hardcopy.pro \ proto/hashtab.pro \ proto/json.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/winclip.pro \ proto/os_win32.pro \ proto/popupmnu.pro \ proto/quickfix.pro \ proto/regexp.pro \ proto/screen.pro \ proto/search.pro \ proto/sha256.pro \ proto/spell.pro \ proto/syntax.pro \ proto/tag.pro \ proto/term.pro \ proto/ui.pro \ proto/undo.pro \ proto/window.pro \ $(NETBEANS_PRO) \ $(CHANNEL_PRO) .SUFFIXES: .cod .i # Generate foo.cod (mixed source and assembly listing) from foo.c via "nmake # foo.cod" .c.cod: $(CC) $(CFLAGS) /FAcs $< # Generate foo.i (preprocessor listing) from foo.c via "nmake foo.i" .c.i: $(CC) $(CFLAGS) /P /C $< # vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0: vim-7.4.1689/src/Make_sas.mak000066400000000000000000000212601267703067000156020ustar00rootroot00000000000000# 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 = \ blowfish.c \ buffer.c \ charset.c \ crypt.c \ crypt_zip.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 \ hardcopy.c \ hashtab.c \ json.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 \ popupmnu.c \ quickfix.c \ regexp.c \ screen.c \ search.c \ sha256.c \ spell.c \ syntax.c \ tag.c \ term.c \ ui.c \ undo.c \ window.c \ version.c OBJ = \ blowfish.o \ buffer.o \ charset.o \ crypt.o \ crypt_zip.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 \ hardcopy.o \ hashtab.o \ json.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 \ popupmnu.o \ quickfix.o \ regexp.o \ screen.o \ search.o \ sha256.o \ spell.o \ syntax.o \ tag.o \ term.o \ ui.o \ undo.o \ window.o \ $(TERMLIB) PRO = \ proto/blowfish.pro \ proto/buffer.pro \ proto/charset.pro \ proto/crypt.pro \ proto/crypt_zip.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/hardcopy.pro \ proto/hashtab.pro \ proto/json.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/popupmnu.pro \ proto/quickfix.pro \ proto/regexp.pro \ proto/screen.pro \ proto/search.pro \ proto/sha256.pro \ proto/spell.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 around a 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 # dependencies blowfish.o: blowfish.c proto/blowfish.pro: blowfish.c buffer.o: buffer.c proto/buffer.pro: buffer.c charset.o: charset.c proto/charset.pro: charset.c crypt.o: crypt.c proto/crypt.pro: crypt.c crypt_zip.o: crypt_zip.c proto/crypt_zip.pro: crypt_zip.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 hardcopy.o: hardcopy.c proto/hardcopy.pro: hardcopy.c hashtab.o: hashtab.c proto/hashtab.pro: hashtab.c json.o: json.c proto/json.pro: json.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 popupmnu.o: popupmnu.c proto/popupmnu.pro: popupmnu.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 sha256.o: sha256.c proto/sha256.pro: sha256.c spell.o: spell.c proto/spell.pro: spell.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 vim-7.4.1689/src/Make_vms.mms000066400000000000000000000760201267703067000156510ustar00rootroot00000000000000# # Makefile for Vim on OpenVMS # # Maintainer: Zoltan Arpadffy # Last change: 2016 Feb 27 # # This has script been tested on VMS 6.2 to 8.2 on DEC Alpha, VAX and IA64 # 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 /ignore=warning # To clean up: mms/descrip=Make_vms.mms clean # # Hints and detailed description could be found in INSTALLVMS.TXT file. # ###################################################################### # Configuration section. ###################################################################### # 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 features enabled. # Please select one of these alternatives above. MODEL = HUGE # GUI or terminal mode executable. # Comment out if you want just the character terminal mode only. # GUI with Motif # GUI = YES # GUI with GTK # If you have GTK installed you might want to enable this option. # NOTE: you will need to properly define GTK_DIR below # GTK = YES # GUI/Motif with XPM # If you have XPM installed you might want to build Motif version with toolbar # XPM = 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 variable 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 # 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 # Allow FEATURE_MZSCHEME # VIM_MZSCHEME = YES # Use ICONV # VIM_ICONV = 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 MMSVAX .IFDEF DECC # VAX with DECC CC_DEF = cc # /decc # some versions require /decc switch but when it is not required /ver might fail PREFIX = /prefix=all OPTIMIZE= /noopt # do not optimize on VAX. The compiler has hard time with crypto functions .ELSE # VAX with VAXC CC_DEF = cc PREFIX = OPTIMIZE= /noopt CCVER = .ENDIF .ELSE # AXP and IA64 with DECC CC_DEF = cc PREFIX = /prefix=all OPTIMIZE= /opt .ENDIF LD_DEF = link C_INC = [.proto] .IFDEF DEBUG DEBUG_DEF = ,"DEBUG" TARGET = dvim.exe CFLAGS = /debug/noopt$(PREFIX) LDFLAGS = /debug .ELSE TARGET = vim.exe CFLAGS = $(OPTIMIZE)$(PREFIX) LDFLAGS = .ENDIF # Predefined VIM directories # Please, use $VIM and $VIMRUNTIME logicals instead VIMLOC = "" VIMRUN = "" CONFIG_H = os_vms_conf.h # GTK or XPM but not both .IFDEF GTK .IFDEF GUI .ELSE GUI = YES .ENDIF .IFDEF XPM XPM = "" .ENDIF .ENDIF .IFDEF XPM .IFDEF GUI .ELSE GUI = YES .ENDIF .IFDEF GTK GTK = "" .ENDIF .ENDIF .IFDEF GUI # X/Motif/GTK executable (also works in terminal mode ) .IFDEF GTK # NOTE: you need to set up your GTK_DIR (GTK root directory), because it is # unique on every system - logicals are not accepted # please note: directory should end with . in order to /trans=conc work # This value for GTK_DIR is an example. GTK_DIR = $1$DGA104:[USERS.ZAY.WORK.GTK1210.] 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 gui_beval.c pty.c GUI_OBJ = gui.obj gui_gtk.obj gui_gtk_f.obj gui_gtk_x11.obj gui_beval.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 .IFDEF XPM DEFS = "HAVE_CONFIG_H","FEAT_GUI_MOTIF","HAVE_XPM" .ELSE DEFS = "HAVE_CONFIG_H","FEAT_GUI_MOTIF" .ENDIF LIBS = ,OS_VMS_MOTIF.OPT/OPT GUI_FLAG = GUI_SRC = gui.c gui_motif.c gui_x11.c gui_beval.c gui_xmdlg.c gui_xmebw.c GUI_OBJ = gui.obj gui_motif.obj gui_x11.obj gui_beval.obj gui_xmdlg.obj gui_xmebw.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_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 .IFDEF VIM_MZSCHEME # MZSCHEME related setup MZSCH_DEF = ,"FEAT_MZSCHEME" MZSCH_SRC = if_mzsch.c MZSCH_OBJ = if_mzsch.obj .ENDIF .IFDEF VIM_ICONV # ICONV related setup ICONV_DEF = ,"USE_ICONV" .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)$(DEBUG_DEF)$(PERL_DEF)$(PYTHON_DEF) - $(TCL_DEF)$(RUBY_DEF)$(XIM_DEF)$(HANGULIN_DEF)$(TAG_DEF)$(MZSCH_DEF)$(ICONV_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)$(DEBUG_DEF)$(PERL_DEF)$(PYTHON_DEF) - $(TCL_DEF)$(RUBY_DEF)$(XIM_DEF)$(HANGULIN_DEF)$(TAG_DEF)$(MZSCH_DEF)$(ICONV_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) $(RUBY_LIB) SRC = blowfish.c buffer.c charset.c crypt.c, crypt_zip.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 \ hardcopy.c hashtab.c json.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 popupmnu.c quickfix.c regexp.c search.c sha256.c\ spell.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) \ $(RUBY_SRC) $(HANGULIN_SRC) $(MZSCH_SRC) OBJ = blowfish.obj buffer.obj charset.obj crypt.obj, crypt_zip.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 hardcopy.obj hashtab.obj json.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 popupmnu.obj quickfix.obj \ regexp.obj search.obj sha256.obj spell.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 if_mzsch.obj\ $(GUI_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(TCL_OBJ) \ $(RUBY_OBJ) $(HANGULIN_OBJ) $(MZSCH_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 overwritten 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)";" -@ write pd "char_u *compiled_arch = (char_u *) ""$(MMSARCH_NAME)"";" -@ 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 !!!" .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 : .IFDEF XPM -@ write sys$output "using DECW/Motif/XPM environment." .ELSE -@ write sys$output "using DECW/Motif environment." .ENDIF -@ 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 overwritten 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 buffer.obj : buffer.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h version.h charset.obj : charset.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h diff.obj : diff.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h gui_beval.h \ [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h farsi.h \ arabic.h digraph.obj : digraph.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h edit.obj : edit.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h gui_beval.h \ [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h farsi.h \ arabic.h eval.obj : eval.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h gui_beval.h \ [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h farsi.h \ arabic.h version.h ex_cmds.obj : ex_cmds.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h version.h ex_cmds2.obj : ex_cmds2.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h version.h ex_docmd.obj : ex_docmd.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h ex_eval.obj : ex_eval.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h ex_getln.obj : ex_getln.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h fileio.obj : fileio.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h fold.obj : fold.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h gui_beval.h \ [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h farsi.h \ arabic.h getchar.obj : getchar.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h hardcopy.obj : hardcopy.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h hashtab.obj : hashtab.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h if_cscope.obj : if_cscope.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h if_cscope.h if_xcmdsrv.obj : if_xcmdsrv.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h version.h if_mzsch.obj : if_mzsch.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h option.h structs.h \ regexp.h gui.h gui_beval.h [.proto]gui_beval.pro ex_cmds.h proto.h \ globals.h farsi.h arabic.h if_mzsch.h json.obj : json.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h gui_beval.h \ [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h farsi.h \ arabic.h version.h main.obj : main.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h gui_beval.h \ [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h farsi.h \ arabic.h farsi.c arabic.c mark.obj : mark.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h gui_beval.h \ [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h farsi.h \ arabic.h memfile.obj : memfile.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h memline.obj : memline.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h menu.obj : menu.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h gui_beval.h \ [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h farsi.h \ arabic.h message.obj : message.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h misc1.obj : misc1.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h gui_beval.h \ [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h farsi.h \ arabic.h version.h misc2.obj : misc2.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h gui_beval.h \ [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h farsi.h \ arabic.h move.obj : move.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h gui_beval.h \ [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h farsi.h \ arabic.h mbyte.obj : mbyte.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h gui_beval.h \ [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h farsi.h \ arabic.h normal.obj : normal.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h ops.obj : ops.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h gui_beval.h \ [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h farsi.h \ arabic.h option.obj : option.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h os_unix.obj : os_unix.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h os_unixx.h os_vms.obj : os_vms.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h os_unixx.h pathdef.obj : pathdef.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h popupmnu.obj : popupmnu.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h quickfix.obj : quickfix.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h regexp.obj : regexp.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h screen.obj : screen.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h search.obj : search.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h spell.obj : spell.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h syntax.obj : syntax.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h tag.obj : tag.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h gui_beval.h \ [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h farsi.h \ arabic.h term.obj : term.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h gui_beval.h \ [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h farsi.h \ arabic.h termlib.obj : termlib.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h gui_beval.h \ [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h farsi.h \ arabic.h ui.obj : ui.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h gui_beval.h \ [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h farsi.h \ arabic.h undo.obj : undo.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h gui_beval.h \ [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h farsi.h \ arabic.h version.obj : version.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h version.h window.obj : window.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h gui.obj : gui.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h gui_beval.h \ [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h farsi.h \ arabic.h gui_gtk.obj : gui_gtk.c gui_gtk_f.h vim.h [.auto]config.h feature.h \ os_unix.h ascii.h keymap.h term.h macros.h structs.h \ regexp.h gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h \ proto.h globals.h farsi.h arabic.h [-.pixmaps]stock_icons.h gui_gtk_f.obj : gui_gtk_f.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h gui_gtk_f.h gui_motif.obj : gui_motif.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h [-.pixmaps]alert.xpm [-.pixmaps]error.xpm \ [-.pixmaps]generic.xpm [-.pixmaps]info.xpm [-.pixmaps]quest.xpm gui_athena.obj : gui_athena.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h gui_at_sb.h gui_gtk_x11.obj : gui_gtk_x11.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h gui_gtk_f.h [-.runtime]vim32x32.xpm \ [-.runtime]vim16x16.xpm [-.runtime]vim48x48.xpm gui_x11.obj : gui_x11.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h [-.runtime]vim32x32.xpm \ [-.runtime]vim16x16.xpm [-.runtime]vim48x48.xpm [-.pixmaps]tb_new.xpm \ [-.pixmaps]tb_open.xpm [-.pixmaps]tb_close.xpm [-.pixmaps]tb_save.xpm \ [-.pixmaps]tb_print.xpm [-.pixmaps]tb_cut.xpm [-.pixmaps]tb_copy.xpm \ [-.pixmaps]tb_paste.xpm [-.pixmaps]tb_find.xpm \ [-.pixmaps]tb_find_next.xpm [-.pixmaps]tb_find_prev.xpm \ [-.pixmaps]tb_find_help.xpm [-.pixmaps]tb_exit.xpm \ [-.pixmaps]tb_undo.xpm [-.pixmaps]tb_redo.xpm [-.pixmaps]tb_help.xpm \ [-.pixmaps]tb_macro.xpm [-.pixmaps]tb_make.xpm \ [-.pixmaps]tb_save_all.xpm [-.pixmaps]tb_jump.xpm \ [-.pixmaps]tb_ctags.xpm [-.pixmaps]tb_load_session.xpm \ [-.pixmaps]tb_save_session.xpm [-.pixmaps]tb_new_session.xpm \ [-.pixmaps]tb_blank.xpm [-.pixmaps]tb_maximize.xpm \ [-.pixmaps]tb_split.xpm [-.pixmaps]tb_minimize.xpm \ [-.pixmaps]tb_shell.xpm [-.pixmaps]tb_replace.xpm \ [-.pixmaps]tb_vsplit.xpm [-.pixmaps]tb_maxwidth.xpm \ [-.pixmaps]tb_minwidth.xpm gui_at_sb.obj : gui_at_sb.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h gui_at_sb.h gui_at_fs.obj : gui_at_fs.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h gui_at_sb.h pty.obj : pty.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h gui_beval.h \ [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h farsi.h \ arabic.h hangulin.obj : hangulin.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h if_perl.obj : [.auto]if_perl.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h if_perlsfio.obj : if_perlsfio.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h if_python.obj : if_python.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h if_tcl.obj : if_tcl.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h if_ruby.obj : if_ruby.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h version.h gui_beval.obj : gui_beval.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h workshop.obj : workshop.c [.auto]config.h integration.h vim.h feature.h \ os_unix.h ascii.h keymap.h term.h macros.h structs.h \ regexp.h gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h \ proto.h globals.h farsi.h arabic.h version.h workshop.h wsdebug.obj : wsdebug.c integration.obj : integration.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h integration.h netbeans.obj : netbeans.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h term.h macros.h structs.h regexp.h \ gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h version.h gui_xmdlg.obj : gui_xmdlg.c gui_xmebw.obj : gui_xmebw.c vim-7.4.1689/src/Makefile000066400000000000000000004037661267703067000150440ustar00rootroot00000000000000# Makefile for Vim on Unix and Unix-like systems vim:ts=8:sw=8:tw=78 # # This Makefile is loosely based on the GNU Makefile conventions found in # standards.info. # # Compiling Vim, summary: # # 3. make # 5. make install # # Compiling Vim, details: # # Edit this file for adjusting to your system. You should not need to edit any # other file for machine specific things! # The name of this file MUST be Makefile (note the uppercase 'M'). # # 1. Edit this Makefile {{{1 # The defaults for Vim should work on most machines, but you may want to # uncomment some lines or make other changes below to tune it to your # system, compiler or preferences. Uncommenting means that the '#' in # the first column of a line is removed. # - If you want a version of Vim that is small and starts up quickly, # you might want to disable the GUI, X11, Perl, Python and Tcl. # - Uncomment the line with --disable-gui if you have Motif, GTK and/or # Athena but don't want to make gvim (the GUI version of Vim with nice # menus and scrollbars, but makes Vim bigger and startup slower). # - Uncomment --disable-darwin if on Mac OS X but you want to compile a # Unix version. # - Uncomment the line "CONF_OPT_X = --without-x" if you have X11 but # want to disable using X11 libraries. This speeds up starting Vim, # but the window title will not be set and the X11 selection can not # be used. # - Uncomment the line "CONF_OPT_XSMP = --disable-xsmp" if you have the # X11 Session Management Protocol (XSMP) library (libSM) but do not # want to use it. # This can speedup Vim startup but Vim loses the ability to catch the # user logging out from session-managers like GNOME and work # could be lost. # - Uncomment one or more of these lines to include an interface; # each makes Vim quite a bit bigger: # --enable-luainterp for Lua interpreter # --enable-mzschemeinterp for MzScheme interpreter # --enable-perlinterp for Perl interpreter # --enable-python3interp for Python3 interpreter # --enable-pythoninterp for Python interpreter # --enable-rubyinterp for Ruby interpreter # --enable-tclinterp for Tcl interpreter # --enable-cscope for Cscope interface # - Uncomment one of the lines with --with-features= to enable a set of # features (but not the interfaces just mentioned). # - Uncomment the line with --disable-acl to disable ACL support even # though your system supports it. # - Uncomment the line with --disable-gpm to disable gpm support # even though you have gpm libraries and includes. # - Uncomment the line with --disable-sysmouse to disable sysmouse # support even though you have /dev/sysmouse and includes. # - Uncomment one of the lines with CFLAGS and/or CC if you have # something very special or want to tune the optimizer. # - Search for the name of your system to see if it needs anything # special. # - A few versions of make use '.include "file"' instead of 'include # file'. Adjust the include line below if yours does. # # 2. Edit feature.h {{{1 # Only if you do not agree with the default compile features, e.g.: # - you want Vim to be as vi compatible as it can be # - you want to use Emacs tags files # - you want right-to-left editing (Hebrew) # - you want 'langmap' support (Greek) # - you want to remove features to make Vim smaller # # 3. "make" {{{1 # Will first run ./configure with the options in this file. Then it will # start make again on this Makefile to do the compiling. You can also do # this in two steps with: # make config # make # The configuration phase creates/overwrites auto/config.h and # auto/config.mk. # The configure script is created with "make autoconf". It can detect # different features of your system and act accordingly. However, it is # not correct for all systems. Check this: # - If you have X windows, but configure could not find it or reported # another include/library directory then you wanted to use, you have # to set CONF_OPT_X below. You might also check the installation of # xmkmf. # - If you have --enable-gui=motif and have Motif on your system, but # configure reports "checking for location of gui... ", you # have to set GUI_INC_LOC and GUI_LIB_LOC below. # If you changed something, do this to run configure again: # make reconfig # # - If you do not trust the automatic configuration code, then inspect # auto/config.h and auto/config.mk, before starting the actual build # phase. If possible edit this Makefile, rather than auto/config.mk -- # especially look at the definition of VIMLOC below. Note that the # configure phase overwrites auto/config.mk and auto/config.h again. # - If you get error messages, find out what is wrong and try to correct # it in this Makefile. You may need to do "make reconfig" when you # change anything that configure uses (e.g. switching from an old C # compiler to an ANSI C compiler). Only when auto/configure does # something wrong you may need to change one of the other files. If # you find a clean way to fix the problem, consider sending a note to # the author of autoconf (bug-gnu-utils@prep.ai.mit.edu) or Vim # (Bram@vim.org). Don't bother to do that when you made a hack # solution for a non-standard system. # # 4. "make test" {{{1 # This is optional. This will run Vim scripts on a number of test # files, and compare the produced output with the expected output. # If all is well, you will get the "ALL DONE" message in the end. If a # test fails you get "TEST FAILURE". See below (search for "/^test"). # # 5. "make install" {{{1 # If the new Vim seems to be working OK you can install it and the # documentation in the appropriate location. The default is # "/usr/local". Change "prefix" below to change the location. # "auto/pathdef.c" will be compiled again after changing this to make # the executable know where the help files are located. # Note that any existing executable is removed or overwritten. If you # want to keep it you will have to make a backup copy first. # The runtime files are in a different directory for each version. You # might want to delete an older version. # If you don't want to install everything, there are other targets: # make installvim only installs Vim, not the tools # make installvimbin only installs the Vim executable # make installruntime installs most of the runtime files # make installrtbase only installs the Vim help and # runtime files # make installlinks only installs the Vim binary links # make installmanlinks only installs the Vim manpage links # make installmacros only installs the Vim macros # make installpack only installs the packages # make installtutorbin only installs the Vim tutor program # make installtutor only installs the Vim tutor files # make installspell only installs the spell files # make installtools only installs xxd # If you install Vim, not to install for real but to prepare a package # or RPM, set DESTDIR to the root of the tree. # # 6. Use Vim until a new version comes out. {{{1 # # 7. "make uninstall_runtime" {{{1 # Will remove the runtime files for the current version. This is safe # to use while another version is being used, only version-specific # files will be deleted. # To remove the runtime files of another version: # make uninstall_runtime VIMRTDIR=/vim54 # If you want to delete all installed files, use: # make uninstall # Note that this will delete files that have the same name for any # version, thus you might need to do a "make install" soon after this. # Be careful not to remove a version of Vim that is still being used! # To find out which files and directories will be deleted, use: # make -n uninstall # }}} # ### This Makefile has been successfully tested on many systems. {{{ ### Only the ones that require special options are mentioned here. ### 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: #------------- ------------------------ ------- - ---------- #AIX 3.2.5 cc (not gcc) - 4.5 (M) Will Fiveash #AIX 4 cc +X11 -GUI 3.27 (4) Axel Kielhorn #AIX 4.1.4 cc +X11 +GUI 4.5 (5) Nico Bakker #AIX 4.2.1 cc 5.2k (C) Will Fiveash #AIX 4.3.3.12 xic 3.6.6 5.6 (5) David R. Favor #A/UX 3.1.1 gcc +X11 4.0 (6) Jim Jagielski #BeOS PR mwcc DR3 5.0n (T) Olaf Seibert #BSDI 2.1 (x86) shlicc2 gcc-2.6.3 -X11 X11R6 4.5 (1) Jos Backus #BSD/OS 3.0 (x86) gcc gcc-2.7.2.1 -X11 X11R6 4.6c (1) Jos Backus #CX/UX 6.2 cc +X11 +GUI_Mofif 5.4 (V) Kipp E. Howard #DG/UX 5.4* gcc 2.5.8 GUI 5.0e (H) Jonas Schlein #DG/UX 5.4R4.20 gcc 2.7.2 GUI 5.0s (H) Rocky Olive #HP-UX (most) c89 cc 5.1 (2) Bram Moolenaar #HP-UX_9.04 cc +X11 +Motif 5.0 (2) Carton Lao #Irix 6.3 (O2) cc ? 4.5 (L) Edouard Poor #Irix 6.4 cc ? 5.0m (S) Rick Sayre #Irix 6.5 cc ? 6.0 (S) David Harrison #Irix 64 bit 4.5 (K) Jon Wright #Linux 2.0 gcc-2.7.2 Infomagic Motif 4.3 (3) Ronald Rietman #Linux 2.0.31 gcc +X11 +GUI Athena 5.0w (U) Darren Hiebert #LynxOS 3.0.1 2.9-gnupro-98r2 +X11 +GUI Athena 5.7.1(O) Lorenz Hahn #LynxOS 3.1.0 2.9-gnupro-98r2 +X11 +GUI Athena 5.7.1(O) Lorenz Hahn #NEC UP4800 UNIX_SV 4.2MP cc +X11R6 Motif,Athena4.6b (Q) Lennart Schultz #NetBSD 1.0A gcc-2.4.5 -X11 -GUI 3.21 (X) Juergen Weigert #QNX 4.2 wcc386-10.6 -X11 4.2 (D) G.F. Desrochers #QNX 4.23 Watcom -X11 4.2 (F) John Oleynick #SCO Unix v3.2.5 cc +X11 Motif 3.27 (C) M. Kuperblum #SCO Open Server 5 gcc 2.7.2.3 +X11 +GUI Motif 5.3 (A) Glauber Ribeiro #SINIX-N 5.43 RM400 R4000 cc +X11 +GUI 5.0l (I) Martin Furter #SINIX-Z 5.42 i386 gcc 2.7.2.3 +X11 +GUI Motif 5.1 (I) Joachim Fehn #SINIX-Y 5.43 RM600 R4000 gcc 2.7.2.3 +X11 +GUI Motif 5.1 (I) Joachim Fehn #Reliant/SINIX 5.44 cc +X11 +GUI 5.5a (I) B. Pruemmer #SNI Targon31 TOS 4.1.11 gcc-2.4.5 +X11 -GUI 4.6c (B) Paul Slootman #Solaris 2.4 (Sparc) cc +X11 +GUI 3.29 (9) Glauber #Solaris 2.4/2.5 clcc +X11 -GUI openwin 3.20 (7) Robert Colon #Solaris 2.5 (sun4m) cc (SC4.0) +X11R6 +GUI (CDE) 4.6b (E) Andrew Large #Solaris 2.5 cc +X11 +GUI Athena 4.2 (9) Sonia Heimann #Solaris 2.5 gcc 2.5.6 +X11 Motif 5.0m (R) Ant. Colombo #Solaris 2.6 gcc 2.8.1 ncurses 5.3 (G) Larry W. Virden #Solaris with -lthread 5.5 (W) K. Nagano #Solaris gcc (b) Riccardo #SunOS 4.1.x +X11 -GUI 5.1b (J) Bram Moolenaar #SunOS 4.1.3_U1 (sun4c) gcc +X11 +GUI Athena 5.0w (J) Darren Hiebert #SUPER-UX 6.2 (NEC SX-4) cc +X11R6 Motif,Athena4.6b (P) Lennart Schultz #Tandem/NSK (c) Matthew Woehlke #Unisys 6035 cc +X11 Motif 5.3 (8) Glauber Ribeiro #ESIX V4.2 cc +X11 6.0 (a) Reinhard Wobst #Mac OS X 10.[23] gcc Carbon 6.2 (x) Bram Moolenaar # }}} # (*) Remarks: {{{ # # (1) Uncomment line below for shlicc2 # (2) HPUX with compile problems or wrong digraphs, uncomment line below # (3) Infomagic Motif needs GUI_LIB_LOC and GUI_INC_LOC set, see below. # And add "-lXpm" to MOTIF_LIBS2. # (4) For cc the optimizer must be disabled (use CFLAGS= after running # configure) (symptom: ":set termcap" output looks weird). # (5) Compiler may need extra argument, see below. # (6) See below for a few lines to uncomment # (7) See below for lines which enable the use of clcc # (8) Needs some EXTRA_LIBS, search for Unisys below # (9) Needs an extra compiler flag to compile gui_at_sb.c, see below. # (A) May need EXTRA_LIBS, see below # (B) Can't compile GUI because there is no waitpid()... Disable GUI below. # (C) Force the use of curses instead of termcap, see below. # (D) Uncomment lines below for QNX # (E) You might want to use termlib instead of termcap, see below. # (F) See below for instructions. # (G) Using ncurses version 4.2 has reported to cause a crash. Use the # Sun curses library instead. # (H) See line for EXTRA_LIBS below. # (I) SINIX-N 5.42 and 5.43 need some EXTRA_LIBS. Also for Reliant-Unix. # (J) If you get undefined symbols, see below for a solution. # (K) See lines to uncomment below for machines with 64 bit pointers. # (L) For Silicon Graphics O2 workstations remove "-lnsl" from auto/config.mk # (M) gcc version cygnus-2.0.1 does NOT work (symptom: "dl" deletes two # characters instead of one). # (N) SCO with decmouse. # (O) LynxOS needs EXTRA_LIBS, see below. # (P) For SuperUX 6.2 on NEC SX-4 see a few lines below to uncomment. # (Q) For UNIXSVR 4.2MP on NEC UP4800 see below for lines to uncomment. # (R) For Solaris 2.5 (or 2.5.1) with gcc > 2.5.6, uncomment line below. # (S) For Irix 6.x with MipsPro compiler, use -OPT:Olimit. See line below. # (T) See ../doc/os_beos.txt. # (U) Must uncomment CONF_OPT_PYTHON option below to disable Python # detection, since the configure script runs into an error when it # detects Python (probably because of the bash shell). # (V) See lines to uncomment below. # (X) Need to use the .include "auto/config.mk" line below # (Y) See line with c89 below # (Z) See lines with cc or c89 below # (a) See line with EXTRA_LIBS below. # (b) When using gcc with the Solaris linker, make sure you don't use GNU # strip, otherwise the binary may not run: "Cannot find ELF". # (c) Add -lfloss to EXTRA_LIBS, see below. # (x) When you get warnings for precompiled header files, run # "sudo fixPrecomps". Also see CONF_OPT_DARWIN below. # }}} #DO NOT CHANGE the next line, we need it for configure to find the compiler #instead of using the default from the "make" program. #Use a line further down to change the value for CC. CC= # Change and use these defines if configure cannot find your Motif stuff. # Unfortunately there is no "standard" location for Motif. {{{ # These defines can contain a single directory (recommended) or a list of # directories (for when you are working with several systems). The LAST # directory that exists is used. # When changed, run "make reconfig" next! #GUI_INC_LOC = -I/usr/include/Motif2.0 -I/usr/include/Motif1.2 #GUI_LIB_LOC = -L/usr/lib/Motif2.0 -L/usr/lib/Motif1.2 ### Use these two lines for Infomagic Motif (3) #GUI_INC_LOC = -I/usr/X11R6/include #GUI_LIB_LOC = -L/usr/X11R6/lib # }}} # Defaults used when auto/config.mk does not exist. srcdir = . VIMNAME = vim EXNAME = ex VIEWNAME = view ######################## auto/config.mk ######################## {{{1 # At this position auto/config.mk is included. When starting from the # toplevel Makefile it is almost empty. After running auto/configure it # contains settings that have been discovered for your system. Settings below # this include override settings in auto/config.mk! # Note: If make fails because auto/config.mk does not exist (it is not # included in the repository), do: # cp config.mk.dist auto/config.mk # (X) How to include auto/config.mk depends on the version of "make" you have, # if the current choice doesn't work, try the other one. include auto/config.mk #.include "auto/config.mk" CClink = $(CC) #}}} # Include the configuration choices first, so we can override everything # below. As shipped, this file contains a target that causes to run # configure. Once configure was run, this file contains a list of # make variables with predefined values instead. Thus any second invocation # of make, will build Vim. # CONFIGURE - configure arguments {{{1 # You can give a lot of options to configure. # Change this to your desire and do 'make config' afterwards # examples (can only use one!): #CONF_ARGS = --exec-prefix=/usr #CONF_ARGS = --with-vim-name=vim7 --with-ex-name=ex7 --with-view-name=view7 #CONF_ARGS = --with-global-runtime=/etc/vim #CONF_ARGS = --with-local-dir=/usr/share #CONF_ARGS = --without-local-dir # Use this one if you distribute a modified version of Vim. #CONF_ARGS = --with-modified-by="John Doe" # GUI - For creating Vim with GUI (gvim) (B) # Uncomment this line when you don't want to get the GUI version, although you # have GTK, Motif and/or Athena. Also use --without-x if you don't want X11 # at all. #CONF_OPT_GUI = --disable-gui # Uncomment one of these lines if you have that GUI but don't want to use it. # The automatic check will use another one that can be found. # Gnome is disabled by default, it may cause trouble. #CONF_OPT_GUI = --disable-gtk2-check #CONF_OPT_GUI = --enable-gnome2-check #CONF_OPT_GUI = --disable-motif-check #CONF_OPT_GUI = --disable-athena-check #CONF_OPT_GUI = --disable-nextaw-check # Uncomment one of these lines to select a specific GUI to use. # When using "yes" or nothing, configure will use the first one found: GTK+, # Motif or Athena. # # GTK versions that are known not to work 100% are rejected. # Use "--disable-gtktest" to accept them anyway. # Only GTK 2 is supported, for GTK 1 use Vim 7.2. # # GNOME means GTK with Gnome support. If using GTK and --enable-gnome-check # is used then GNOME will automatically be used if it is found. If you have # GNOME, but do not want to use it (e.g., want a GTK-only version), then use # --enable-gui=gtk or leave out --enable-gnome-check. # # If the selected GUI isn't found, the GUI is disabled automatically #CONF_OPT_GUI = --enable-gui=gtk2 #CONF_OPT_GUI = --enable-gui=gtk2 --disable-gtktest #CONF_OPT_GUI = --enable-gui=gnome2 #CONF_OPT_GUI = --enable-gui=gnome2 --disable-gtktest #CONF_OPT_GUI = --enable-gui=motif #CONF_OPT_GUI = --enable-gui=motif --with-motif-lib="-static -lXm -shared" #CONF_OPT_GUI = --enable-gui=athena #CONF_OPT_GUI = --enable-gui=nextaw # Carbon GUI for Mac OS X #CONF_OPT_GUI = --enable-gui=carbon # DARWIN - detecting Mac OS X # Uncomment this line when you want to compile a Unix version of Vim on # Darwin. None of the Mac specific options or files will be used. #CONF_OPT_DARWIN = --disable-darwin # Select the architecture supported. Default is to build for the current # platform. Use "both" for a universal binary. That probably doesn't work # when including Perl, Python, etc. #CONF_OPT_DARWIN = --with-mac-arch=i386 #CONF_OPT_DARWIN = --with-mac-arch=ppc #CONF_OPT_DARWIN = --with-mac-arch=both # Uncomment the next line to fail if one of the requested language interfaces # cannot be configured. Without this Vim will be build anyway, without # the failing interfaces. #CONF_OPT_FAIL = --enable-fail-if-missing # LUA # Uncomment one of these when you want to include the Lua interface. # First one is for static linking, second one for dynamic loading. # Use --with-luajit if you want to use LuaJIT instead of Lua. # Set PATH environment variable to find lua or luajit executable. #CONF_OPT_LUA = --enable-luainterp #CONF_OPT_LUA = --enable-luainterp=dynamic #CONF_OPT_LUA = --enable-luainterp --with-luajit #CONF_OPT_LUA = --enable-luainterp=dynamic --with-luajit # Lua installation dir (when not set uses $LUA_PREFIX or defaults to /usr) #CONF_OPT_LUA_PREFIX = --with-lua-prefix=/usr/local # MZSCHEME # Uncomment this when you want to include the MzScheme interface. #CONF_OPT_MZSCHEME = --enable-mzschemeinterp # PLT/mrscheme/drscheme Home dir; the PLTHOME environment variable also works #CONF_OPT_PLTHOME = --with-plthome=/usr/local/plt #CONF_OPT_PLTHOME = --with-plthome=/usr/local/drscheme #CONF_OPT_PLTHOME = --with-plthome=/home/me/mz # PERL # Uncomment one of these when you want to include the Perl interface. # First one is for static linking, second one for dynamic loading. # The Perl option sometimes causes problems, because it adds extra flags # # to the command line. If you see strange flags during compilation, check in # auto/config.mk where they come from. If it's PERL_CFLAGS, try commenting # the next line. # When you get an error for a missing "perl.exp" file, try creating an empty # one: "touch perl.exp". # This requires at least "small" features, "tiny" doesn't work. #CONF_OPT_PERL = --enable-perlinterp #CONF_OPT_PERL = --enable-perlinterp=dynamic # PYTHON # Uncomment this when you want to include the Python interface. # Requires small features or better, fails with tiny features. # NOTE: This may cause threading to be enabled, which has side effects (such # as using different libraries and debugging becomes more difficult). # NOTE: Using this together with Perl may cause a crash in initialization. # For Python3 support make a symbolic link in /usr/local/bin: # ln -s python3 python3.1 # If both python2.x and python3.x are enabled then the linking will be via # dlopen(), dlsym(), dlclose(), i.e. pythonX.Y.so must be available # However, this may still cause problems, such as "import termios" failing. # Build two separate versions of Vim in that case. #CONF_OPT_PYTHON = --enable-pythoninterp #CONF_OPT_PYTHON = --enable-pythoninterp=dynamic #CONF_OPT_PYTHON3 = --enable-python3interp #CONF_OPT_PYTHON3 = --enable-python3interp=dynamic # RUBY # Uncomment this when you want to include the Ruby interface. # First one for static linking, second one for loading when used. # Note: you need the development package (e.g., ruby1.9.1-dev on Ubuntu). #CONF_OPT_RUBY = --enable-rubyinterp #CONF_OPT_RUBY = --enable-rubyinterp=dynamic #CONF_OPT_RUBY = --enable-rubyinterp --with-ruby-command=ruby1.9.1 # TCL # Uncomment this when you want to include the Tcl interface. # First one is for static linking, second one for dynamic loading. #CONF_OPT_TCL = --enable-tclinterp #CONF_OPT_TCL = --enable-tclinterp=dynamic #CONF_OPT_TCL = --enable-tclinterp --with-tclsh=tclsh8.4 # CSCOPE # Uncomment this when you want to include the Cscope interface. #CONF_OPT_CSCOPE = --enable-cscope # WORKSHOP - Sun Visual Workshop interface. Only works with Motif! #CONF_OPT_WORKSHOP = --enable-workshop # NETBEANS - NetBeans interface. Only works with Motif, GTK, and gnome. # Motif version must have XPM libraries (see |workshop-xpm|). # Uncomment this when you do not want the netbeans interface. #CONF_OPT_NETBEANS = --disable-netbeans # CHANNEL - inter process communication. Same conditions as NetBeans. # Uncomment this when you do not want inter process communication. #CONF_OPT_CHANNEL = --disable-channel # MULTIBYTE - To edit multi-byte characters. # Uncomment this when you want to edit a multibyte language. # It's automatically enabled with normal features, GTK or IME support. # Note: Compile on a machine where setlocale() actually works, otherwise the # configure tests may fail. #CONF_OPT_MULTIBYTE = --enable-multibyte # NLS - National Language Support # Uncomment this when you do not want to support translated messages, even # though configure can find support for it. #CONF_OPT_NLS = --disable-nls # XIM - X Input Method. Special character input support for X11 (Chinese, # Japanese, special symbols, etc). Also needed for dead-key support. # When omitted it's automatically enabled for the X-windows GUI. # HANGUL - Input Hangul (Korean) language using internal routines. # Uncomment one of these when you want to input a multibyte language. #CONF_OPT_INPUT = --enable-xim #CONF_OPT_INPUT = --disable-xim #CONF_OPT_INPUT = --enable-hangulinput # FONTSET - X fontset support for output of languages with many characters. # Uncomment this when you want to output a multibyte language. #CONF_OPT_OUTPUT = --enable-fontset # ACL - Uncomment this when you do not want to include ACL support, even # though your system does support it. E.g., when it's buggy. #CONF_OPT_ACL = --disable-acl # gpm - For mouse support on Linux console via gpm # Uncomment this when you do not want to include gpm support, even # though you have gpm libraries and includes. #CONF_OPT_GPM = --disable-gpm # sysmouse - For mouse support on FreeBSD and DragonFly console via sysmouse # Uncomment this when you do not want do include sysmouse support, even # though you have /dev/sysmouse and includes. #CONF_OPT_SYSMOUSE = --disable-sysmouse # FEATURES - For creating Vim with more or less features # Uncomment one of these lines when you want to include few to many features. # The default is "huge" for most systems. #CONF_OPT_FEAT = --with-features=tiny #CONF_OPT_FEAT = --with-features=small #CONF_OPT_FEAT = --with-features=normal #CONF_OPT_FEAT = --with-features=big #CONF_OPT_FEAT = --with-features=huge # COMPILED BY - For including a specific e-mail address for ":version". #CONF_OPT_COMPBY = "--with-compiledby=John Doe " # X WINDOWS DISABLE - For creating a plain Vim without any X11 related fancies # (otherwise Vim configure will try to include xterm titlebar access) # Also disable the GUI above, otherwise it will be included anyway. # When both GUI and X11 have been disabled this may save about 15% of the # code and make Vim startup quicker. #CONF_OPT_X = --without-x # X WINDOWS DIRECTORY - specify X directories # If configure can't find you X stuff, or if you have multiple X11 derivatives # installed, you may wish to specify which one to use. # Select nothing to let configure choose. # This here selects openwin (as found on sun). #XROOT = /usr/openwin #CONF_OPT_X = --x-include=$(XROOT)/include --x-libraries=$(XROOT)/lib # X11 Session Management Protocol support # Vim will try to use XSMP to catch the user logging out if there are unsaved # files. Uncomment this line to disable that (it prevents vim trying to open # communications with the session manager). #CONF_OPT_XSMP = --disable-xsmp # You may wish to include xsmp but use exclude xsmp-interact if the logout # XSMP functionality does not work well with your session-manager (at time of # writing, this would be early GNOME-1 gnome-session: it 'freezes' other # applications after Vim has cancelled a logout (until Vim quits). This # *might* be the Vim code, but is more likely a bug in early GNOME-1. # This disables the dialog that asks you if you want to save files or not. #CONF_OPT_XSMP = --disable-xsmp-interact # COMPILER - Name of the compiler {{{1 # The default from configure will mostly be fine, no need to change this, just # an example. If a compiler is defined here, configure will use it rather than # probing for one. It is dangerous to change this after configure was run. # Make will use your choice then -- but beware: Many things may change with # another compiler. It is wise to run 'make reconfig' to start all over # again. #CC = cc #CC = gcc #CC = clang # COMPILER FLAGS - change as you please. Either before running {{{1 # configure or afterwards. For examples see below. # When using -g with some older versions of Linux you might get a # statically linked executable. # When not defined, configure will try to use -O2 -g for gcc and -O for cc. #CFLAGS = -g #CFLAGS = -O # Optimization limits - depends on the compiler. Automatic check in configure # doesn't work very well, because many compilers only give a warning for # unrecognized arguments. #CFLAGS = -O -OPT:Olimit=2600 #CFLAGS = -O -Olimit 2000 #CFLAGS = -O -FOlimit,2000 # Often used for GCC: mixed optimizing, lot of optimizing, debugging #CFLAGS = -g -O2 -fno-strength-reduce -Wall -Wshadow -Wmissing-prototypes #CFLAGS = -g -O2 -fno-strength-reduce -Wall -Wmissing-prototypes #CFLAGS = -g -Wall -Wmissing-prototypes #CFLAGS = -O6 -fno-strength-reduce -Wall -Wshadow -Wmissing-prototypes #CFLAGS = -g -DDEBUG -Wall -Wshadow -Wmissing-prototypes #CFLAGS = -g -O2 '-DSTARTUPTIME="vimstartup"' -fno-strength-reduce -Wall -Wmissing-prototypes # Use this with GCC to check for mistakes, unused arguments, etc. #CFLAGS = -g -Wall -Wextra -Wmissing-prototypes -Wunreachable-code -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 #CFLAGS = -g -O2 -Wall -Wextra -Wmissing-prototypes -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DU_DEBUG #PYTHON_CFLAGS_EXTRA = -Wno-missing-field-initializers #MZSCHEME_CFLAGS_EXTRA = -Wno-unreachable-code -Wno-unused-parameter # EFENCE - Electric-Fence malloc debugging: catches memory accesses beyond # allocated memory (and makes every malloc()/free() very slow). # Electric Fence is free (search ftp sites). # You may want to set the EF_PROTECT_BELOW environment variable to check the # other side of allocated memory. # On FreeBSD you might need to enlarge the number of mmaps allowed. Do this # as root: sysctl -w vm.max_proc_mmap=30000 #EXTRA_LIBS = /usr/local/lib/libefence.a # Autoconf binary. AUTOCONF = autoconf # PURIFY - remove the # to use the "purify" program (hoi Nia++!) #PURIFY = purify # NBDEBUG - debugging the netbeans interface. #EXTRA_DEFS = -DNBDEBUG # }}} # LINT - for running lint # For standard Unix lint LINT = lint LINT_OPTIONS = -beprxzF # For splint # It doesn't work well, crashes on include files and non-ascii characters. #LINT = splint #LINT_OPTIONS = +unixlib -weak -macrovarprefixexclude -showfunc -linelen 9999 # PROFILING - Uncomment the next two lines to do profiling with gcc and gprof. # Might not work with GUI or Perl. # For unknown reasons adding "-lc" fixes a linking problem with some versions # of GCC. That's probably a bug in the "-pg" implementation. # After running Vim see the profile result with: gprof vim gmon.out | vim - # Need to recompile everything after changing this: "make clean" "make". #PROFILE_CFLAGS = -pg -g -DWE_ARE_PROFILING #PROFILE_LIBS = -pg #PROFILE_LIBS = -pg -lc # TEST COVERAGE - Uncomment the two lines below the explanation to get code # coverage information. (provided by Yegappan Lakshmanan) # 1. make clean, run configure and build Vim as usual. # 2. Generate the baseline code coverage information: # $ lcov -c -i -b . -d objects -o objects/coverage_base.info # 3. Run "make test" to run the unit tests. The code coverage information will # be generated in the src/objects directory. # 4. Generate the code coverage information from the tests: # $ lcov -c -b . -d objects/ -o objects/coverage_test.info # 5. Combine the baseline and test code coverage data: # $ lcov -a objects/coverage_base.info -a objects/coverage_test.info -o objects/coverage_total.info # 6. Process the test coverage data and generate a report in html: # $ genhtml objects/coverage_total.info -o objects # 7. Open the objects/index.html file in a web browser to view the coverage # information. # # PROFILE_CFLAGS=-g -O0 -fprofile-arcs -ftest-coverage # LDFLAGS=--coverage # Uncomment one of the next two lines to compile Vim with the # address sanitizer or with the undefined sanitizer. Works with gcc and # clang. May make Vim twice as slow. Errors reported on stderr. # More at: https://code.google.com/p/address-sanitizer/ #SANITIZER_CFLAGS = -g -O0 -fsanitize=address -fno-omit-frame-pointer #SANITIZER_CFLAGS = -g -O0 -fsanitize=undefined -fno-omit-frame-pointer SANITIZER_LIBS = $(SANITIZER_CFLAGS) # MEMORY LEAK DETECTION # Requires installing the ccmalloc library. # Configuration is in the .ccmalloc or ~/.ccmalloc file. # Doesn't work very well, since memory linked to from global variables # (in libraries) is also marked as leaked memory. #LEAK_CFLAGS = -DEXITFREE #LEAK_LIBS = -lccmalloc ##################################################### ### Specific systems, check if yours is listed! ### {{{ ##################################################### ### Uncomment things here only if the values chosen by configure are wrong. ### It's better to adjust configure.in and "make autoconf", if you can! ### Then send the required changes to configure.in to the bugs list. ### (1) BSD/OS 2.0.1, 2.1 or 3.0 using shared libraries ### #CC = shlicc2 #CFLAGS = -O2 -g -m486 -Wall -Wshadow -Wmissing-prototypes -fno-builtin ### (2) HP-UX with a non-ANSI cc, use the c89 ANSI compiler ### The first probably works on all systems ### The second should work a bit better on newer systems ### The third should work a bit better on HPUX 11.11 ### Information provided by: Richard Allen #CC = c89 -D_HPUX_SOURCE #CC = c89 -O +Onolimit +ESlit -D_HPUX_SOURCE #CC = c89 -O +Onolimit +ESlit +e -D_HPUX_SOURCE ### (2) For HP-UX: Enable the use of a different set of digraphs. Use this ### when the default (ISO) digraphs look completely wrong. ### After changing this do "touch digraph.c; make". #EXTRA_DEFS = -DHPUX_DIGRAPHS ### (2) For HP-UX: 9.04 cpp default macro definition table of 128000 bytes ### is too small to compile many routines. It produces too much defining ### and no space errors. ### Uncomment the following to specify a larger macro definition table. #CFLAGS = -Wp,-H256000 ### (2) For HP-UX 10.20 using the HP cc, with X11R6 and Motif 1.2, with ### libraries in /usr/lib instead of /lib (avoiding transition links). ### Information provided by: David Green #XROOT = /usr #CONF_OPT_X = --x-include=$(XROOT)/include/X11R6 --x-libraries=$(XROOT)/lib/X11R6 #GUI_INC_LOC = -I/usr/include/Motif1.2 #GUI_LIB_LOC = -L/usr/lib/Motif1.2_R6 ### (5) AIX 4.1.4 with cc #CFLAGS = -O -qmaxmem=8192 ### AIX with c89 (Walter Briscoe) #CC = c89 #CPPFLAGS = -D_ALL_SOURCE ### AIX 4.3.3.12 with xic 3.6.6 (David R. Favor) # needed to avoid a problem where strings.h gets included #CFLAGS = -qsrcmsg -O2 -qmaxmem=8192 -D__STR31__ ### (W) Solaris with multi-threaded libraries (-lthread): ### If suspending doesn't work properly, try using this line: #EXTRA_DEFS = -D_REENTRANT ### (7) Solaris 2.4/2.5 with Centerline compiler #CC = clcc #X_LIBS_DIR = -L/usr/openwin/lib -R/usr/openwin/lib #CFLAGS = -O ### (9) Solaris 2.x with cc (SunPro), using Athena. ### Only required for compiling gui_at_sb.c. ### Symptom: "identifier redeclared: vim_XawScrollbarSetThumb" ### Use one of the lines (either Full ANSI or no ANSI at all) #CFLAGS = $(CFLAGS) -Xc #CFLAGS = $(CFLAGS) -Xs ### Solaris 2.3 with X11 and specific cc #CC=/opt/SUNWspro/bin/cc -O -Xa -v -R/usr/openwin/lib ### Solaris with /usr/ucb/cc (it is rejected by autoconf as "cc") #CC = /usr/ucb/cc #EXTRA_LIBS = -R/usr/ucblib ### Solaris with Forte Developer and FEAT_SUN_WORKSHOP # The Xpm library is available from http://koala.ilog.fr/ftp/pub/xpm. #CC = cc #XPM_DIR = /usr/local/xpm/xpm-3.4k-solaris #XPM_LIB = -L$(XPM_DIR)/lib -R$(XPM_DIR)/lib -lXpm #XPM_IPATH = -I$(XPM_DIR)/include #EXTRA_LIBS = $(XPM_LIB) #EXTRA_IPATHS = $(XPM_IPATH) #EXTRA_DEFS = -xCC -DHAVE_X11_XPM_H ### Solaris with workshop compilers: Vim is unstable when compiled with # "-fast". Use this instead. (Shea Martin) #CFLAGS = -x02 -xtarget=ultra ### (R) for Solaris 2.5 (or 2.5.1) with gcc > 2.5.6 you might need this: #LDFLAGS = -lw -ldl -lXmu #GUI_LIB_LOC = -L/usr/local/lib ### (8) Unisys 6035 (Glauber Ribeiro) #EXTRA_LIBS = -lnsl -lsocket -lgen ### When builtin functions cause problems with gcc (for Sun 4.1.x) #CFLAGS = -O2 -Wall -traditional -Wno-implicit ### Apollo DOMAIN (with SYSTYPE = bsd4.3) (TESTED for version 3.0) #EXTRA_DEFS = -DDOMAIN #CFLAGS= -O -A systype,bsd4.3 ### Coherent 4.2.10 on Intel 386 platform #EXTRA_DEFS = -Dvoid=int #EXTRA_LIBS = -lterm -lsocket ### SCO 3.2, with different library name for terminfo #EXTRA_LIBS = -ltinfo ### UTS2 for Amdahl UTS 2.1.x #EXTRA_DEFS = -DUTS2 #EXTRA_LIBS = -lsocket ### UTS4 for Amdahl UTS 4.x #EXTRA_DEFS = -DUTS4 -Xa ### USL for Unix Systems Laboratories (SYSV 4.2) #EXTRA_DEFS = -DUSL ### (6) A/UX 3.1.1 with gcc (Jim Jagielski) #CC= gcc -D_POSIX_SOURCE #CFLAGS= -O2 #EXTRA_LIBS = -lposix -lbsd -ltermcap -lX11 ### (A) Some versions of SCO Open Server 5 (Jan Christiaan van Winkel) ### Also use the CONF_TERM_LIB below! #EXTRA_LIBS = -lgen ### (D) QNX (by G.F. Desrochers) #CFLAGS = -g -O -mf -4 ### (F) QNX (by John Oleynick) # 1. If you don't have an X server: Comment out CONF_OPT_GUI and uncomment # CONF_OPT_X = --without-x. # 2. make config # 3. edit auto/config.mk and remove -ldir and -ltermcap from LIBS. It doesn't # have -ldir (does config find it somewhere?) and -ltermcap has at # least one problem so I use termlib.o instead. The problem with # termcap is that it segfaults if you call it with the name of # a non-existent terminal type. # 4. edit auto/config.h and add #define USE_TMPNAM # 5. add termlib.o to OBJ # 6. make ### (H) for Data general DG/UX 5.4.2 and 5.4R3.10 (Jonas J. Schlein) #EXTRA_LIBS = -lgen ### (I) SINIX-N 5.42 or 5.43 RM400 R4000 (also SINIX-Y and SINIX-Z) #EXTRA_LIBS = -lgen -lnsl ### For SINIX-Y this is needed for the right prototype of gettimeofday() #EXTRA_DEFS = -D_XPG_IV ### (I) Reliant-Unix (aka SINIX) 5.44 with standard cc # Use both "-F O3" lines for optimization or the "-g" line for debugging #EXTRA_LIBS = -lgen -lsocket -lnsl -lSM -lICE #CFLAGS = -F O3 -DSINIXN #LDFLAGS = -F O3 #CFLAGS = -g -DSINIXN ### (P) SCO 3.2.42, with different termcap names for some useful keys DJB #EXTRA_DEFS = -DSCOKEYS -DNETTERM_MOUSE -DDEC_MOUSE -DXTERM_MOUSE -DHAVE_GETTIMEOFDAY #EXTRA_LIBS = -lsocket -ltermcap -lmalloc -lc_s ### (P) SuperUX 6.2 on NEC SX-4 (Lennart Schultz) #GUI_INC_LOC = -I/usr/include #GUI_LIB_LOC = -L/usr/lib #EXTRA_LIBS = -lgen ### (Q) UNIXSVR 4.2MP on NEC UP4800 (Lennart Schultz) #GUI_INC_LOC = -I/usr/necccs/include #GUI_LIB_LOC = -L/usr/necccs/lib/X11R6 #XROOT = /usr/necccs #CONF_OPT_X = --x-include=$(XROOT)/include --x-libraries=$(XROOT)/lib/X11R6 #EXTRA_LIBS = -lsocket -lgen ### Irix 4.0 & 5.2 (Silicon Graphics Machines, __sgi will be defined) # Not needed for Irix 5.3, Ives Aerts reported #EXTRA_LIBS = -lmalloc -lc_s # Irix 4.0, when regexp and regcmp cannot be found when linking: #EXTRA_LIBS = -lmalloc -lc_s -lPW ### (S) Irix 6.x (MipsPro compiler): Uses different Olimit flag: # Note: This newer option style is used with the MipsPro compilers ONLY if # you are compiling an "n32" or "64" ABI binary (use either a -n32 # flag or a -64 flag for CFLAGS). If you explicitly use a -o32 flag, # then the CFLAGS option format will be the typical style (i.e. # -Olimit 3000). #CFLAGS = -OPT:Olimit=3000 -O ### (S) Irix 6.5 with MipsPro C compiler. Try this as a test to see new # compiler features! Beware, the optimization is EXTREMELY thorough # and takes quite a long time. # Note: See the note above. Here, the -mips3 option automatically # enables either the "n32" or "64" ABI, depending on what machine you # are compiling on (n32 is explicitly enabled here, just to make sure). #CFLAGS = -OPT:Olimit=3500 -O -n32 -mips3 -IPA:aggr_cprop=ON -INLINE:dfe=ON:list=ON:must=screen_char,out_char,ui_write,out_flush #LDFLAGS= -OPT:Olimit=3500 -O -n32 -mips3 -IPA:aggr_cprop=ON -INLINE:dfe=ON:list=ON:must=screen_char,out_char,ui_write,out_flush ### (K) for SGI Irix machines with 64 bit pointers ("uname -s" says IRIX64) ### Suggested by Jon Wright . ### Tested on R8000 IRIX6.1 Power Indigo2. ### Check /etc/compiler.defaults for your compiler settings. # either (for 64 bit pointers) uncomment the following line #GUI_LIB_LOC = -L/usr/lib64 # then # 1) make config # 2) edit auto/config.mk and delete the -lelf entry in the LIBS line # 3) make # # or (for 32bit pointers) uncomment the following line #EXTRA_DEFS = -n32 #GUI_LIB_LOC = -L/usr/lib32 # then # 1) make config # 2) edit auto/config.mk, add -n32 to LDFLAGS # 3) make # #Alternatively: use -o32 instead of -n32. ### ### (C) On SCO Unix v3.2.5 (and probably other versions) the termcap library, ### which is found by configure, doesn't work correctly. Symptom is the ### error message "Termcap entry too long". Uncomment the next line. ### On AIX 4.2.1 (and other versions probably), libtermcap is reported ### not to display properly. ### after changing this, you need to do "make reconfig". #CONF_TERM_LIB = --with-tlib=curses ### (E) If you want to use termlib library instead of the automatically found ### one. After changing this, you need to do "make reconfig". #CONF_TERM_LIB = --with-tlib=termlib ### (a) ESIX V4.2 (Reinhard Wobst) #EXTRA_LIBS = -lnsl -lsocket -lgen -lXIM -lXmu -lXext ### (c) Tandem/NSK (Matthew Woehlke) #EXTRA_LIBS = -lfloss ### If you want to use ncurses library instead of the automatically found one ### after changing this, you need to do "make reconfig". #CONF_TERM_LIB = --with-tlib=ncurses ### For GCC on MS-Windows, the ".exe" suffix will be added. #EXEEXT = .exe #LNKEXT = .exe ### (O) For LynxOS 2.5.0, tested on PC. #EXTRA_LIBS = -lXext -lSM -lICE -lbsd ### For LynxOS 3.0.1, tested on PPC #EXTRA_LIBS= -lXext -lSM -lICE -lnetinet -lXmu -liberty -lX11 ### For LynxOS 3.1.0, tested on PC #EXTRA_LIBS= -lXext -lSM -lICE -lnetinet -lXmu ### (V) For CX/UX 6.2 (on Harris/Concurrent NightHawk 4800, 5800). Remove ### -Qtarget if only in a 5800 environment. (Kipp E. Howard) #CFLAGS = -O -Qtarget=m88110compat #EXTRA_LIBS = -lgen # The value of QUOTESED comes from auto/config.mk. # Uncomment the next line to use the default value. # QUOTESED = sed -e 's/[\\"]/\\&/g' -e 's/\\"/"/' -e 's/\\";$$/";/' ##################### end of system specific lines ################### }}} ### Names of the programs and targets {{{1 VIMTARGET = $(VIMNAME)$(EXEEXT) EXTARGET = $(EXNAME)$(LNKEXT) VIEWTARGET = $(VIEWNAME)$(LNKEXT) GVIMNAME = g$(VIMNAME) GVIMTARGET = $(GVIMNAME)$(LNKEXT) GVIEWNAME = g$(VIEWNAME) GVIEWTARGET = $(GVIEWNAME)$(LNKEXT) RVIMNAME = r$(VIMNAME) RVIMTARGET = $(RVIMNAME)$(LNKEXT) RVIEWNAME = r$(VIEWNAME) RVIEWTARGET = $(RVIEWNAME)$(LNKEXT) RGVIMNAME = r$(GVIMNAME) RGVIMTARGET = $(RGVIMNAME)$(LNKEXT) RGVIEWNAME = r$(GVIEWNAME) RGVIEWTARGET = $(RGVIEWNAME)$(LNKEXT) VIMDIFFNAME = $(VIMNAME)diff GVIMDIFFNAME = g$(VIMDIFFNAME) VIMDIFFTARGET = $(VIMDIFFNAME)$(LNKEXT) GVIMDIFFTARGET = $(GVIMDIFFNAME)$(LNKEXT) EVIMNAME = e$(VIMNAME) EVIMTARGET = $(EVIMNAME)$(LNKEXT) EVIEWNAME = e$(VIEWNAME) EVIEWTARGET = $(EVIEWNAME)$(LNKEXT) ### Names of the tools that are also made {{{1 TOOLS = xxd/xxd$(EXEEXT) ### Installation directories. The defaults come from configure. {{{1 # ### prefix the top directory for the data (default "/usr/local") # # Uncomment the next line to install Vim in your home directory. #prefix = $(HOME) ### exec_prefix is the top directory for the executable (default $(prefix)) # # Uncomment the next line to install the Vim executable in "/usr/machine/bin" #exec_prefix = /usr/machine ### BINDIR dir for the executable (default "$(exec_prefix)/bin") ### MANDIR dir for the manual pages (default "$(prefix)/man") ### DATADIR dir for the other files (default "$(prefix)/lib" or # "$(prefix)/share") # They may be different when using different architectures for the # executable and a common directory for the other files. # # Uncomment the next line to install Vim in "/usr/bin" #BINDIR = /usr/bin # Uncomment the next line to install Vim manuals in "/usr/share/man/man1" #MANDIR = /usr/share/man # Uncomment the next line to install Vim help files in "/usr/share/vim" #DATADIR = /usr/share ### DESTDIR root of the installation tree. This is prepended to the other # directories. This directory must exist. #DESTDIR = ~/pkg/vim ### Directory of the man pages MAN1DIR = /man1 ### Vim version (adjusted by a script) VIMMAJOR = 7 VIMMINOR = 4 ### Location of Vim files (should not need to be changed, and {{{1 ### some things might not work when they are changed!) VIMDIR = /vim VIMRTDIR = /vim$(VIMMAJOR)$(VIMMINOR) HELPSUBDIR = /doc COLSUBDIR = /colors SYNSUBDIR = /syntax INDSUBDIR = /indent AUTOSUBDIR = /autoload PLUGSUBDIR = /plugin FTPLUGSUBDIR = /ftplugin LANGSUBDIR = /lang COMPSUBDIR = /compiler KMAPSUBDIR = /keymap MACROSUBDIR = /macros PACKSUBDIR = /pack TOOLSSUBDIR = /tools TUTORSUBDIR = /tutor SPELLSUBDIR = /spell 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 ### AUTOSUBLOC location for standard autoload 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 ### PACKSUBLOC location for packages ### TOOLSSUBLOC location for tools files ### TUTORSUBLOC location for tutor files ### SPELLSUBLOC location for spell files ### PRINTSUBLOC location for PostScript files (prolog, latin1, ..) ### 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) AUTOSUBLOC = $(VIMRTLOC)$(AUTOSUBDIR) PLUGSUBLOC = $(VIMRTLOC)$(PLUGSUBDIR) FTPLUGSUBLOC = $(VIMRTLOC)$(FTPLUGSUBDIR) LANGSUBLOC = $(VIMRTLOC)$(LANGSUBDIR) COMPSUBLOC = $(VIMRTLOC)$(COMPSUBDIR) KMAPSUBLOC = $(VIMRTLOC)$(KMAPSUBDIR) MACROSUBLOC = $(VIMRTLOC)$(MACROSUBDIR) PACKSUBLOC = $(VIMRTLOC)$(PACKSUBDIR) TOOLSSUBLOC = $(VIMRTLOC)$(TOOLSSUBDIR) TUTORSUBLOC = $(VIMRTLOC)$(TUTORSUBDIR) SPELLSUBLOC = $(VIMRTLOC)$(SPELLSUBDIR) 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 # Program to install the program in the target directory. Could also be "mv". INSTALL_PROG = cp # Program to install the data in the target directory. Cannot be "mv"! INSTALL_DATA = cp INSTALL_DATA_R = cp -r ### Program to run on installed binary. Use the second one to disable strip. #STRIP = strip #STRIP = /bin/true ### Permissions for binaries {{{1 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 AUTOSOURCE = ../runtime/autoload # 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 package files from PACKSOURCE = ../runtime/pack # Where to copy the tools files from TOOLSSOURCE = ../runtime/tools # Where to copy the tutor files from TUTORSOURCE = ../runtime/tutor # Where to copy the spell files from SPELLSOURCE = ../runtime/spell # 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 # If you are using Linux, you might want to use this to make vim the # default vi editor, it will create a link from vi to Vim when doing # "make install". An existing file will be overwritten! # When not using it, some make programs can't handle an undefined $(LINKIT). #LINKIT = ln -f -s $(DEST_BIN)/$(VIMTARGET) $(DESTDIR)/usr/bin/vi LINKIT = @echo >/dev/null ### ### GRAPHICAL USER INTERFACE (GUI). {{{1 ### 'configure --enable-gui' can enable one of these for you if you did set ### a corresponding CONF_OPT_GUI above and have X11. ### Override configures choice by uncommenting all the following lines. ### As they are, the GUI is disabled. Replace "NONE" with "ATHENA" or "MOTIF" ### for enabling the Athena or Motif GUI. #GUI_SRC = $(NONE_SRC) #GUI_OBJ = $(NONE_OBJ) #GUI_DEFS = $(NONE_DEFS) #GUI_IPATH = $(NONE_IPATH) #GUI_LIBS_DIR = $(NONE_LIBS_DIR) #GUI_LIBS1 = $(NONE_LIBS1) #GUI_LIBS2 = $(NONE_LIBS2) #GUI_INSTALL = $(NONE_INSTALL) #GUI_TARGETS = $(NONE_TARGETS) #GUI_MAN_TARGETS= $(NONE_MAN_TARGETS) #GUI_TESTTARGET = $(NONE_TESTTARGET) #GUI_BUNDLE = $(NONE_BUNDLE) # Without a GUI install the normal way. NONE_INSTALL = install_normal ### GTK GUI GTK_SRC = gui.c gui_gtk.c gui_gtk_x11.c pty.c gui_gtk_f.c \ gui_beval.c $(GRESOURCE_SRC) GTK_OBJ = objects/gui.o objects/gui_gtk.o objects/gui_gtk_x11.o \ objects/pty.o objects/gui_gtk_f.o \ objects/gui_beval.o $(GRESOURCE_OBJ) GTK_DEFS = -DFEAT_GUI_GTK $(NARROW_PROTO) GTK_IPATH = $(GUI_INC_LOC) GTK_LIBS_DIR = $(GUI_LIB_LOC) GTK_LIBS1 = GTK_LIBS2 = $(GTK_LIBNAME) GTK_INSTALL = install_normal install_gui_extra GTK_TARGETS = installglinks GTK_MAN_TARGETS = yes GTK_TESTTARGET = gui GTK_BUNDLE = ### Motif GUI MOTIF_SRC = gui.c gui_motif.c gui_x11.c pty.c gui_beval.c \ gui_xmdlg.c gui_xmebw.c MOTIF_OBJ = objects/gui.o objects/gui_motif.o objects/gui_x11.o \ objects/pty.o objects/gui_beval.o \ objects/gui_xmdlg.o objects/gui_xmebw.o MOTIF_DEFS = -DFEAT_GUI_MOTIF $(NARROW_PROTO) MOTIF_IPATH = $(GUI_INC_LOC) MOTIF_LIBS_DIR = $(GUI_LIB_LOC) MOTIF_LIBS1 = MOTIF_LIBS2 = $(MOTIF_LIBNAME) -lXt MOTIF_INSTALL = install_normal install_gui_extra MOTIF_TARGETS = installglinks MOTIF_MAN_TARGETS = yes MOTIF_TESTTARGET = gui MOTIF_BUNDLE = ### Athena GUI ### Use Xaw3d to make the menus look a little bit nicer #XAW_LIB = -lXaw3d XAW_LIB = -lXaw ### When using Xaw3d, uncomment/comment the following lines to also get the ### scrollbars from Xaw3d. #ATHENA_SRC = gui.c gui_athena.c gui_x11.c pty.c gui_beval.c gui_at_fs.c #ATHENA_OBJ = objects/gui.o objects/gui_athena.o objects/gui_x11.o \ # objects/pty.o objects/gui_beval.o objects/gui_at_fs.o #ATHENA_DEFS = -DFEAT_GUI_ATHENA $(NARROW_PROTO) \ # -Dvim_scrollbarWidgetClass=scrollbarWidgetClass \ # -Dvim_XawScrollbarSetThumb=XawScrollbarSetThumb ATHENA_SRC = gui.c gui_athena.c gui_x11.c pty.c gui_beval.c \ gui_at_sb.c gui_at_fs.c ATHENA_OBJ = objects/gui.o objects/gui_athena.o objects/gui_x11.o \ objects/pty.o objects/gui_beval.o \ objects/gui_at_sb.o objects/gui_at_fs.o ATHENA_DEFS = -DFEAT_GUI_ATHENA $(NARROW_PROTO) ATHENA_IPATH = $(GUI_INC_LOC) ATHENA_LIBS_DIR = $(GUI_LIB_LOC) ATHENA_LIBS1 = $(XAW_LIB) ATHENA_LIBS2 = -lXt ATHENA_INSTALL = install_normal install_gui_extra ATHENA_TARGETS = installglinks ATHENA_MAN_TARGETS = yes ATHENA_TESTTARGET = gui ATHENA_BUNDLE = ### neXtaw GUI NEXTAW_LIB = -lneXtaw NEXTAW_SRC = gui.c gui_athena.c gui_x11.c pty.c gui_beval.c gui_at_fs.c NEXTAW_OBJ = objects/gui.o objects/gui_athena.o objects/gui_x11.o \ objects/pty.o objects/gui_beval.o objects/gui_at_fs.o NEXTAW_DEFS = -DFEAT_GUI_ATHENA -DFEAT_GUI_NEXTAW $(NARROW_PROTO) NEXTAW_IPATH = $(GUI_INC_LOC) NEXTAW_LIBS_DIR = $(GUI_LIB_LOC) NEXTAW_LIBS1 = $(NEXTAW_LIB) NEXTAW_LIBS2 = -lXt NEXTAW_INSTALL = install_normal install_gui_extra NEXTAW_TARGETS = installglinks NEXTAW_MAN_TARGETS = yes NEXTAW_TESTTARGET = gui NEXTAW_BUNDLE = ### (J) Sun OpenWindows 3.2 (SunOS 4.1.x) or earlier that produce these ld # errors: ld: Undefined symbol # _get_wmShellWidgetClass # _get_applicationShellWidgetClass # then you need to get patches 100512-02 and 100573-03 from Sun. In the # meantime, uncomment the following GUI_X_LIBS definition as a workaround: #GUI_X_LIBS = -Bstatic -lXmu -Bdynamic -lXext # If you also get cos, sin etc. as undefined symbols, try uncommenting this # too: #EXTRA_LIBS = /usr/openwin/lib/libXmu.sa -lm # PHOTON GUI PHOTONGUI_SRC = gui.c gui_photon.c pty.c PHOTONGUI_OBJ = objects/gui.o objects/gui_photon.o objects/pty.o PHOTONGUI_DEFS = -DFEAT_GUI_PHOTON PHOTONGUI_IPATH = PHOTONGUI_LIBS_DIR = PHOTONGUI_LIBS1 = -lph -lphexlib PHOTONGUI_LIBS2 = PHOTONGUI_INSTALL = install_normal install_gui_extra PHOTONGUI_TARGETS = installglinks PHOTONGUI_MAN_TARGETS = yes PHOTONGUI_TESTTARGET = gui PHOTONGUI_BUNDLE = # CARBON GUI CARBONGUI_SRC = gui.c gui_mac.c CARBONGUI_OBJ = objects/gui.o objects/gui_mac.o objects/pty.o CARBONGUI_DEFS = -DFEAT_GUI_MAC -fno-common -fpascal-strings \ -Wall -Wno-unknown-pragmas \ -mdynamic-no-pic -pipe CARBONGUI_IPATH = -I. -Iproto CARBONGUI_LIBS_DIR = CARBONGUI_LIBS1 = -framework Carbon CARBONGUI_LIBS2 = CARBONGUI_INSTALL = install_macosx CARBONGUI_TARGETS = CARBONGUI_MAN_TARGETS = CARBONGUI_TESTTARGET = gui CARBONGUI_BUNDLE = gui_bundle APPDIR = $(VIMNAME).app CARBONGUI_TESTARG = VIMPROG=../$(APPDIR)/Contents/MacOS/$(VIMTARGET) # All GUI files ALL_GUI_SRC = gui.c gui_gtk.c gui_gtk_f.c gui_motif.c gui_xmdlg.c gui_xmebw.c gui_athena.c gui_gtk_x11.c gui_x11.c gui_at_sb.c gui_at_fs.c pty.c ALL_GUI_PRO = gui.pro gui_gtk.pro gui_motif.pro gui_xmdlg.pro gui_athena.pro gui_gtk_x11.pro gui_x11.pro gui_w32.pro gui_photon.pro # }}} ### Command to create dependencies based on #include "..." ### prototype headers are ignored due to -DPROTO, system ### headers #include <...> are ignored if we use the -MM option, as ### e.g. provided by gcc-cpp. ### Include FEAT_GUI to get dependency on gui.h ### Need to change "-I /" to "-isystem /" for GCC 3.x. CPP_DEPEND = $(CC) -I$(srcdir) -M$(CPP_MM) \ `echo "$(DEPEND_CFLAGS)" $(DEPEND_CFLAGS_FILTER)` # flags for cproto # This is for cproto 3 patchlevel 8 or below # __inline, __attribute__ and __extension__ are not recognized by cproto # G_IMPLEMENT_INLINES is to avoid functions defined in glib/gutils.h. #NO_ATTR = -D__inline= -D__inline__= -DG_IMPLEMENT_INLINES \ # -D"__attribute__\\(x\\)=" -D"__asm__\\(x\\)=" \ # -D__extension__= -D__restrict="" \ # -D__gnuc_va_list=char -D__builtin_va_list=char # # This is for cproto 3 patchlevel 9 or above (currently 4.6, 4.7g) # __inline and __attribute__ are now recognized by cproto # -D"foo()=" is not supported by all compilers so do not use it NO_ATTR= # # Use this for cproto 3 patchlevel 6 or below (use "cproto -V" to check): # PROTO_FLAGS = -f4 -d -E"$(CPP)" $(NO_ATTR) # # Use this for cproto 3 patchlevel 7 or above (use "cproto -V" to check): PROTO_FLAGS = -d -E"$(CPP)" $(NO_ATTR) ################################################ ## no changes required below this line ## ################################################ SHELL = /bin/sh .SUFFIXES: .SUFFIXES: .c .o .pro PRE_DEFS = -Iproto $(DEFS) $(GUI_DEFS) $(GUI_IPATH) $(CPPFLAGS) $(EXTRA_IPATHS) POST_DEFS = $(X_CFLAGS) $(MZSCHEME_CFLAGS) $(EXTRA_DEFS) ALL_CFLAGS = $(PRE_DEFS) $(CFLAGS) $(PROFILE_CFLAGS) $(SANITIZER_CFLAGS) $(LEAK_CFLAGS) $(POST_DEFS) # Exclude $CFLAGS for osdef.sh, for Mac 10.4 some flags don't work together # with "-E". OSDEF_CFLAGS = $(PRE_DEFS) $(POST_DEFS) LINT_CFLAGS = -DLINT -I. $(PRE_DEFS) $(POST_DEFS) $(RUBY_CFLAGS) $(LUA_CFLAGS) $(PERL_CFLAGS) $(PYTHON_CFLAGS) $(PYTHON3_CFLAGS) $(TCL_CFLAGS) -Dinline= -D__extension__= -Dalloca=alloca LINT_EXTRA = -DHANGUL_INPUT -D"__attribute__(x)=" DEPEND_CFLAGS = -DPROTO -DDEPEND -DFEAT_GUI $(LINT_CFLAGS) # Note: MZSCHEME_LIBS must come before LIBS, because LIBS adds -lm which is # needed by racket. ALL_LIB_DIRS = $(GUI_LIBS_DIR) $(X_LIBS_DIR) ALL_LIBS = \ $(GUI_LIBS1) \ $(GUI_X_LIBS) \ $(GUI_LIBS2) \ $(X_PRE_LIBS) \ $(X_LIBS) \ $(X_EXTRA_LIBS) \ $(MZSCHEME_LIBS) \ $(LIBS) \ $(EXTRA_LIBS) \ $(LUA_LIBS) \ $(PERL_LIBS) \ $(PYTHON_LIBS) \ $(PYTHON3_LIBS) \ $(TCL_LIBS) \ $(RUBY_LIBS) \ $(PROFILE_LIBS) \ $(SANITIZER_LIBS) \ $(LEAK_LIBS) # 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_AUTO = $(DESTDIR)$(AUTOSUBLOC) 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_PACK = $(DESTDIR)$(PACKSUBLOC) DEST_TOOLS = $(DESTDIR)$(TOOLSSUBLOC) DEST_TUTOR = $(DESTDIR)$(TUTORSUBLOC) DEST_SPELL = $(DESTDIR)$(SPELLSUBLOC) DEST_SCRIPT = $(DESTDIR)$(SCRIPTLOC) DEST_PRINT = $(DESTDIR)$(PRINTSUBLOC) DEST_MAN_TOP = $(DESTDIR)$(MANDIR) # We assume that the ".../man/xx/man1/" directory is for latin1 manual pages. # Some systems use UTF-8, but these should find the ".../man/xx.UTF-8/man1/" # directory first. # FreeBSD uses ".../man/xx.ISO8859-1/man1" for latin1, use that one too. DEST_MAN = $(DEST_MAN_TOP)$(MAN1DIR) DEST_MAN_FR = $(DEST_MAN_TOP)/fr$(MAN1DIR) DEST_MAN_FR_I = $(DEST_MAN_TOP)/fr.ISO8859-1$(MAN1DIR) DEST_MAN_FR_U = $(DEST_MAN_TOP)/fr.UTF-8$(MAN1DIR) DEST_MAN_IT = $(DEST_MAN_TOP)/it$(MAN1DIR) DEST_MAN_IT_I = $(DEST_MAN_TOP)/it.ISO8859-1$(MAN1DIR) DEST_MAN_IT_U = $(DEST_MAN_TOP)/it.UTF-8$(MAN1DIR) DEST_MAN_JA_U = $(DEST_MAN_TOP)/ja$(MAN1DIR) DEST_MAN_PL = $(DEST_MAN_TOP)/pl$(MAN1DIR) DEST_MAN_PL_I = $(DEST_MAN_TOP)/pl.ISO8859-2$(MAN1DIR) DEST_MAN_PL_U = $(DEST_MAN_TOP)/pl.UTF-8$(MAN1DIR) DEST_MAN_RU = $(DEST_MAN_TOP)/ru.KOI8-R$(MAN1DIR) DEST_MAN_RU_U = $(DEST_MAN_TOP)/ru.UTF-8$(MAN1DIR) # BASIC_SRC: files that are always used # GUI_SRC: extra GUI files for current configuration # ALL_GUI_SRC: all GUI files for Unix # # SRC: files used for current configuration # TAGS_SRC: source files used for make tags # TAGS_INCL: include files used for make tags # ALL_SRC: source files used for make depend and make lint TAGS_INCL = *.h BASIC_SRC = \ blowfish.c \ buffer.c \ charset.c \ crypt.c \ crypt_zip.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 \ hardcopy.c \ hashtab.c \ if_cscope.c \ if_xcmdsrv.c \ json.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 \ popupmnu.c \ quickfix.c \ regexp.c \ screen.c \ search.c \ sha256.c \ spell.c \ syntax.c \ tag.c \ term.c \ ui.c \ undo.c \ version.c \ window.c \ $(OS_EXTRA_SRC) SRC = $(BASIC_SRC) \ $(GUI_SRC) \ $(HANGULIN_SRC) \ $(LUA_SRC) \ $(MZSCHEME_SRC) \ $(PERL_SRC) \ $(PYTHON_SRC) $(PYTHON3_SRC) \ $(TCL_SRC) \ $(RUBY_SRC) \ $(WORKSHOP_SRC) \ $(WSDEBUG_SRC) TAGS_SRC = *.c *.cpp if_perl.xs EXTRA_SRC = hangulin.c if_lua.c if_mzsch.c auto/if_perl.c if_perlsfio.c \ if_python.c if_python3.c if_tcl.c if_ruby.c \ gui_beval.c workshop.c wsdebug.c integration.c \ netbeans.c channel.c \ $(GRESOURCE_SRC) # Unittest files JSON_TEST_SRC = json_test.c JSON_TEST_TARGET = json_test$(EXEEXT) MEMFILE_TEST_SRC = memfile_test.c MEMFILE_TEST_TARGET = memfile_test$(EXEEXT) UNITTEST_SRC = $(JSON_TEST_SRC) $(MEMFILE_TEST_SRC) UNITTEST_TARGETS = $(JSON_TEST_TARGET) $(MEMFILE_TEST_TARGET) # All sources, also the ones that are not configured ALL_SRC = $(BASIC_SRC) $(ALL_GUI_SRC) $(UNITTEST_SRC) $(EXTRA_SRC) # Which files to check with lint. Select one of these three lines. ALL_SRC # checks more, but may not work well for checking a GUI that wasn't configured. # The perl sources also don't work well with lint. LINT_SRC = $(BASIC_SRC) $(GUI_SRC) $(HANGULIN_SRC) \ $(PYTHON_SRC) $(PYTHON3_SRC) $(TCL_SRC) \ $(WORKSHOP_SRC) $(WSDEBUG_SRC) \ $(NETBEANS_SRC) $(CHANNEL_SRC) #LINT_SRC = $(SRC) #LINT_SRC = $(ALL_SRC) #LINT_SRC = $(BASIC_SRC) OBJ_COMMON = \ objects/buffer.o \ objects/blowfish.o \ objects/charset.o \ objects/crypt.o \ objects/crypt_zip.o \ objects/diff.o \ objects/digraph.o \ objects/edit.o \ objects/eval.o \ objects/ex_cmds.o \ objects/ex_cmds2.o \ objects/ex_docmd.o \ objects/ex_eval.o \ objects/ex_getln.o \ objects/fileio.o \ objects/fold.o \ objects/getchar.o \ objects/hardcopy.o \ objects/hashtab.o \ $(HANGULIN_OBJ) \ objects/if_cscope.o \ objects/if_xcmdsrv.o \ objects/mark.o \ objects/memline.o \ objects/menu.o \ objects/message.o \ objects/misc1.o \ objects/misc2.o \ objects/move.o \ objects/mbyte.o \ objects/normal.o \ objects/ops.o \ objects/option.o \ objects/os_unix.o \ objects/pathdef.o \ objects/popupmnu.o \ objects/quickfix.o \ objects/regexp.o \ objects/screen.o \ objects/search.o \ objects/sha256.o \ objects/spell.o \ objects/syntax.o \ objects/tag.o \ objects/term.o \ objects/ui.o \ objects/undo.o \ objects/version.o \ objects/window.o \ $(GUI_OBJ) \ $(LUA_OBJ) \ $(MZSCHEME_OBJ) \ $(PERL_OBJ) \ $(PYTHON_OBJ) \ $(PYTHON3_OBJ) \ $(TCL_OBJ) \ $(RUBY_OBJ) \ $(OS_EXTRA_OBJ) \ $(WORKSHOP_OBJ) \ $(NETBEANS_OBJ) \ $(CHANNEL_OBJ) \ $(WSDEBUG_OBJ) OBJ = $(OBJ_COMMON) \ objects/json.o \ objects/main.o \ objects/memfile.o JSON_TEST_OBJ = $(OBJ_COMMON) \ objects/json_test.o \ objects/memfile.o MEMFILE_TEST_OBJ = $(OBJ_COMMON) \ objects/json.o \ objects/memfile_test.o PRO_AUTO = \ blowfish.pro \ buffer.pro \ charset.pro \ crypt.pro \ crypt_zip.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 \ hardcopy.pro \ hashtab.pro \ hangulin.pro \ if_cscope.pro \ if_lua.pro \ if_mzsch.pro \ if_python.pro \ if_python3.pro \ if_ruby.pro \ if_xcmdsrv.pro \ json.pro \ main.pro \ mark.pro \ mbyte.pro \ memfile.pro \ memline.pro \ menu.pro \ message.pro \ misc1.pro \ misc2.pro \ move.pro \ normal.pro \ ops.pro \ option.pro \ os_mac_conv.pro \ os_unix.pro \ popupmnu.pro \ pty.pro \ quickfix.pro \ regexp.pro \ screen.pro \ search.pro \ sha256.pro \ spell.pro \ syntax.pro \ tag.pro \ term.pro \ termlib.pro \ ui.pro \ undo.pro \ version.pro \ window.pro \ gui_beval.pro \ workshop.pro \ netbeans.pro \ channel.pro \ $(ALL_GUI_PRO) \ $(TCL_PRO) # Resources used for the Mac are in one directory. RSRC_DIR = os_mac_rsrc PRO_MANUAL = os_amiga.pro os_win32.pro \ os_mswin.pro winclip.pro os_beos.pro os_vms.pro $(PERL_PRO) # Default target is making the executable and tools all: $(VIMTARGET) $(TOOLS) languages $(GUI_BUNDLE) tools: $(TOOLS) # Run configure with all the setting from above. # # Note: auto/config.h doesn't depend on configure, because running configure # doesn't always update auto/config.h. The timestamp isn't changed if the # file contents didn't change (to avoid recompiling everything). Including a # dependency on auto/config.h would cause running configure each time when # auto/config.h isn't updated. The dependency on auto/config.mk should make # sure configure is run when it's needed. # # Remove the config.cache every time, once in a while it causes problems that # are very hard to figure out. # config auto/config.mk: auto/configure config.mk.in config.h.in -rm -f auto/config.cache if test "X$(MAKECMDGOALS)" != "Xclean" \ -a "X$(MAKECMDGOALS)" != "Xdistclean" \ -a "X$(MAKECMDGOALS)" != "Xautoconf" \ -a "X$(MAKECMDGOALS)" != "Xreconfig"; then \ GUI_INC_LOC="$(GUI_INC_LOC)" GUI_LIB_LOC="$(GUI_LIB_LOC)" \ CC="$(CC)" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" \ LDFLAGS="$(LDFLAGS)" $(CONF_SHELL) srcdir="$(srcdir)" \ ./configure $(CONF_OPT_GUI) $(CONF_OPT_X) $(CONF_OPT_XSMP) \ $(CONF_OPT_DARWIN) $(CONF_OPT_FAIL) \ $(CONF_OPT_PERL) $(CONF_OPT_PYTHON) $(CONF_OPT_PYTHON3) \ $(CONF_OPT_TCL) $(CONF_OPT_RUBY) $(CONF_OPT_NLS) \ $(CONF_OPT_CSCOPE) $(CONF_OPT_MULTIBYTE) $(CONF_OPT_INPUT) \ $(CONF_OPT_OUTPUT) $(CONF_OPT_GPM) $(CONF_OPT_WORKSHOP) \ $(CONF_OPT_FEAT) $(CONF_TERM_LIB) \ $(CONF_OPT_COMPBY) $(CONF_OPT_ACL) $(CONF_OPT_NETBEANS) \ $(CONF_OPT_CHANNEL) \ $(CONF_ARGS) $(CONF_OPT_MZSCHEME) $(CONF_OPT_PLTHOME) \ $(CONF_OPT_LUA) $(CONF_OPT_LUA_PREFIX) \ $(CONF_OPT_SYSMOUSE); \ fi # Use "make reconfig" to rerun configure without cached values. # When config.h changes, most things will be recompiled automatically. # Invoke $(MAKE) to run config with the empty auto/config.mk. # Invoke $(MAKE) to build all with the filled auto/config.mk. reconfig: scratch clean $(MAKE) -f Makefile config $(MAKE) -f Makefile all # Run autoconf to produce auto/configure. # Note: # - DO NOT RUN autoconf MANUALLY! It will overwrite ./configure instead of # producing auto/configure. # - autoconf is not run automatically, because a patch usually changes both # configure.in and auto/configure but can't update the timestamps. People # who do not have (the correct version of) autoconf would run into trouble. # # Two tricks are required to make autoconf put its output in the "auto" dir: # - Temporarily move the ./configure script to ./configure.save. Don't # overwrite it, it's probably the result of an aborted autoconf. # - Use sed to change ./config.log to auto/config.log in the configure script. # Autoconf 2.5x (2.59 at least) produces a few more files that we need to take # care of: # - configure.lineno: has the line numbers replaced with $LINENO. That # improves patches a LOT, thus use it instead (until someone says it doesn't # work on some system). # - autom4te.cache directory is created and not cleaned up. Delete it. # - Uses ">config.log" instead of "./config.log". autoconf: if test ! -f configure.save; then mv configure configure.save; fi $(AUTOCONF) sed -e 's+>config.log+>auto/config.log+' -e 's+\./config.log+auto/config.log+' configure > auto/configure chmod 755 auto/configure mv -f configure.save configure -rm -rf autom4te.cache -rm -f auto/config.status auto/config.cache # Re-execute this Makefile to include the new auto/config.mk produced by # configure Only used when typing "make" with a fresh auto/config.mk. myself: $(MAKE) -f Makefile all # The normal command to compile a .c file to its .o file. CCC = $(CC) -c -I$(srcdir) $(ALL_CFLAGS) # Link the target for normal use or debugging. # A shell script is used to try linking without unnecessary libraries. $(VIMTARGET): auto/config.mk objects $(OBJ) version.c version.h $(CCC) version.c -o objects/version.o @LINK="$(PURIFY) $(SHRPENV) $(CClink) $(ALL_LIB_DIRS) $(LDFLAGS) \ -o $(VIMTARGET) $(OBJ) $(ALL_LIBS)" \ MAKE="$(MAKE)" LINK_AS_NEEDED=$(LINK_AS_NEEDED) \ sh $(srcdir)/link.sh xxd/xxd$(EXEEXT): xxd/xxd.c cd xxd; CC="$(CC)" CFLAGS="$(CPPFLAGS) $(CFLAGS)" LDFLAGS="$(LDFLAGS)" \ $(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: @if test -n "$(MAKEMO)" -a -f $(PODIR)/Makefile; then \ cd $(PODIR); \ CC="$(CC)" $(MAKE) prefix=$(DESTDIR)$(prefix); \ fi -@if test -n "$(MAKEMO)" -a -f $(PODIR)/Makefile; then \ cd $(PODIR); \ CC="$(CC)" $(MAKE) prefix=$(DESTDIR)$(prefix) converted; \ fi # Update the *.po files for changes in the sources. Only run manually. update-po: cd $(PODIR); CC="$(CC)" $(MAKE) prefix=$(DESTDIR)$(prefix) update-po # Generate function prototypes. This is not needed to compile vim, but if # you want to use it, cproto is out there on the net somewhere -- Webb # # When generating os_amiga.pro and os_win32.pro there will be a # few include files that can not be found, that's OK. proto: $(PRO_AUTO) $(PRO_MANUAL) # Filter out arguments that cproto doesn't support. # Don't pass "-pthread", "-fwrapv" and similar arguments to cproto, it sees # them as a list of individual flags. # The -E"gcc -E" argument must be separate to avoid problems with shell # quoting. CPROTO = cproto $(PROTO_FLAGS) -DPROTO \ `echo '$(LINT_CFLAGS)' | sed -e 's/ -[a-z-]\+//g'` ### Would be nice if this would work for "normal" make. ### Currently it only works for (Free)BSD make. #$(PRO_AUTO): $$(*F).c # $(CPROTO) -DFEAT_GUI $(*F).c > $@ # Always define FEAT_GUI. This may generate a few warnings if it's also # defined in auto/config.h, you can ignore that. .c.pro: $(CPROTO) -DFEAT_GUI $< > proto/$@ echo "/* vim: set ft=c : */" >> proto/$@ os_amiga.pro: os_amiga.c $(CPROTO) -DAMIGA -UHAVE_CONFIG_H -DBPTR=char* $< > proto/$@ echo "/* vim: set ft=c : */" >> proto/$@ os_win32.pro: os_win32.c $(CPROTO) -DWIN32 -UHAVE_CONFIG_H $< > proto/$@ echo "/* vim: set ft=c : */" >> proto/$@ os_mswin.pro: os_mswin.c $(CPROTO) -DWIN32 -UHAVE_CONFIG_H $< > proto/$@ echo "/* vim: set ft=c : */" >> proto/$@ winclip.pro: winclip.c $(CPROTO) -DWIN32 -UHAVE_CONFIG_H $< > proto/$@ echo "/* vim: set ft=c : */" >> proto/$@ os_beos.pro: os_beos.c $(CPROTO) -D__BEOS__ -UHAVE_CONFIG_H $< > proto/$@ echo "/* vim: set ft=c : */" >> proto/$@ os_vms.pro: os_vms.c # must use os_vms_conf.h for auto/config.h mv auto/config.h auto/config.h.save cp os_vms_conf.h auto/config.h $(CPROTO) -DVMS -UFEAT_GUI_ATHENA -UFEAT_GUI_NEXTAW -UFEAT_GUI_MOTIF -UFEAT_GUI_GTK $< > proto/$@ echo "/* vim: set ft=c : */" >> proto/$@ rm auto/config.h mv auto/config.h.save auto/config.h # if_perl.pro is special: Use the generated if_perl.c for input and remove # prototypes for local functions. if_perl.pro: auto/if_perl.c $(CPROTO) -DFEAT_GUI auto/if_perl.c | sed "/_VI/d" > proto/$@ gui_gtk_gresources.pro: auto/gui_gtk_gresources.c $(CPROTO) -DFEAT_GUI $< > proto/$@ echo "/* vim: set ft=c : */" >> proto/$@ notags: -rm -f tags # Note: tags is made for the currently configured version, can't include both # Motif and Athena GUI # You can ignore error messages for missing files. tags TAGS: notags $(TAGPRG) $(TAGS_SRC) $(TAGS_INCL) # Make a highlight file for types. Requires Exuberant ctags and awk types: types.vim types.vim: $(TAGS_SRC) $(TAGS_INCL) ctags --c-kinds=gstu -o- $(TAGS_SRC) $(TAGS_INCL) |\ awk 'BEGIN{printf("syntax keyword Type\t")}\ {printf("%s ", $$1)}END{print ""}' > $@ echo "syn keyword Constant OK FAIL TRUE FALSE MAYBE" >> $@ # Execute the test scripts. Run these after compiling Vim, before installing. # This doesn't depend on $(VIMTARGET), because that won't work when configure # wasn't run yet. Restart make to build it instead. # # 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 "testXX.out" and # a "testXX.ok" file. # If everything is alright, the final message will be "ALL DONE". If not you # get "TEST FAILURE". # test check: $(MAKE) -f Makefile $(VIMTARGET) if test -n "$(MAKEMO)" -a -f $(PODIR)/Makefile; then \ cd $(PODIR); $(MAKE) -f Makefile check VIM=../$(VIMTARGET); \ fi -if test $(VIMTARGET) != vim -a ! -r vim; then \ ln -s $(VIMTARGET) vim; \ fi cd testdir; $(MAKE) -f Makefile $(GUI_TESTTARGET) VIMPROG=../$(VIMTARGET) $(GUI_TESTARG) SCRIPTSOURCE=../$(SCRIPTSOURCE) $(MAKE) -f Makefile unittest benchmark: cd testdir; $(MAKE) -f Makefile benchmark VIMPROG=../$(VIMTARGET) SCRIPTSOURCE=../$(SCRIPTSOURCE) unittesttargets: $(MAKE) -f Makefile $(UNITTEST_TARGETS) unittest unittests: $(UNITTEST_TARGETS) @for t in $(UNITTEST_TARGETS); do \ ./$$t || exit 1; echo $$t passed; \ done run_json_test: $(JSON_TEST_TARGET) ./$(JSON_TEST_TARGET) run_memfile_test: $(MEMFILE_TEST_TARGET) ./$(MEMFILE_TEST_TARGET) # Run individual OLD style test, assuming that Vim was already compiled. test1 \ test_autocmd_option \ test_autoformat_join \ test_breakindent \ test_changelist \ test_charsearch \ test_close_count \ test_command_count \ test_comparators \ test_erasebackword \ test_eval \ test_fixeol \ test_getcwd \ test_insertcount \ test_listchars \ test_listlbr \ test_listlbr_utf8 \ test_mapping \ test_marks \ test_match_conceal \ test_nested_function \ test_options \ test_ruby \ test_search_mbyte \ test_signs \ test_tagcase \ test_textobjects \ test_utf8 \ test_wordcount \ test_writefile \ test2 test3 test4 test5 test6 test7 test8 test9 \ test11 test12 test13 test14 test15 test16 test17 test18 test19 \ test20 test21 test22 test23 test24 test25 test26 test27 test28 test29 \ test30 test31 test32 test33 test34 test35 test36 test37 test38 test39 \ test40 test41 test42 test43 test44 test45 test46 test47 test48 test49 \ test50 test51 test52 test53 test54 test55 test56 test57 test58 test59 \ test60 test61 test62 test63 test64 test65 test66 test67 test68 test69 \ test70 test71 test72 test73 test74 test75 test76 test77 test78 test79 \ test80 test81 test82 test83 test84 test85 test86 test87 test88 test89 \ test90 test91 test92 test93 test94 test95 test97 test98 test99 \ test100 test101 test102 test103 test104 test105 test107 test108: cd testdir; rm -f $@.out; $(MAKE) -f Makefile $@.out VIMPROG=../$(VIMTARGET) $(GUI_TESTARG) SCRIPTSOURCE=../$(SCRIPTSOURCE) # Run individual NEW style test, assuming that Vim was already compiled. test_arglist \ test_assert \ test_assign \ test_backspace_opt \ test_cdo \ test_channel \ test_cursor_func \ test_delete \ test_ex_undo \ test_expr \ test_expand \ test_feedkeys \ test_file_perm \ test_glob2regpat \ test_hardcopy \ test_help_tagjump \ test_history \ test_increment \ test_join \ test_json \ test_langmap \ test_lispwords \ test_menu \ test_packadd \ test_partial \ test_perl \ test_quickfix \ test_reltime \ test_searchpos \ test_set \ test_sort \ test_syn_attr \ test_syntax \ test_timers \ test_undolevels \ test_unlet \ test_viminfo \ test_viml \ test_visual \ test_window_id \ test_alot: cd testdir; rm -f $@.res test.log messages; $(MAKE) -f Makefile $@.res VIMPROG=../$(VIMTARGET) $(GUI_TESTARG) SCRIPTSOURCE=../$(SCRIPTSOURCE) @if test -f testdir/test.log; then \ cat testdir/test.log; \ fi cat testdir/messages newtests: cd testdir; rm -f $@.res test.log messages; $(MAKE) -f Makefile newtestssilent VIMPROG=../$(VIMTARGET) $(GUI_TESTARG) SCRIPTSOURCE=../$(SCRIPTSOURCE) @if test -f testdir/test.log; then \ cat testdir/test.log; \ fi cat testdir/messages testclean: cd testdir; $(MAKE) -f Makefile clean if test -d $(PODIR); then \ cd $(PODIR); $(MAKE) checkclean; \ fi # Unittests # It's build just like Vim to satisfy all dependencies. $(JSON_TEST_TARGET): auto/config.mk objects $(JSON_TEST_OBJ) $(CCC) version.c -o objects/version.o @LINK="$(PURIFY) $(SHRPENV) $(CClink) $(ALL_LIB_DIRS) $(LDFLAGS) \ -o $(JSON_TEST_TARGET) $(JSON_TEST_OBJ) $(ALL_LIBS)" \ MAKE="$(MAKE)" LINK_AS_NEEDED=$(LINK_AS_NEEDED) \ sh $(srcdir)/link.sh $(MEMFILE_TEST_TARGET): auto/config.mk objects $(MEMFILE_TEST_OBJ) $(CCC) version.c -o objects/version.o @LINK="$(PURIFY) $(SHRPENV) $(CClink) $(ALL_LIB_DIRS) $(LDFLAGS) \ -o $(MEMFILE_TEST_TARGET) $(MEMFILE_TEST_OBJ) $(ALL_LIBS)" \ MAKE="$(MAKE)" LINK_AS_NEEDED=$(LINK_AS_NEEDED) \ sh $(srcdir)/link.sh # install targets install: $(GUI_INSTALL) install_normal: installvim installtools $(INSTALL_LANGS) install-icons install_gui_extra: installgtutorbin installvim: installvimbin installtutorbin \ installruntime installlinks installmanlinks # # Avoid overwriting an existing executable, somebody might be running it and # overwriting it could cause it to crash. Deleting it is OK, it won't be # really deleted until all running processes for it have exited. It is # renamed first, in case the deleting doesn't work. # # If you want to keep an older version, rename it before running "make # install". # installvimbin: $(VIMTARGET) $(DESTDIR)$(exec_prefix) $(DEST_BIN) -if test -f $(DEST_BIN)/$(VIMTARGET); then \ mv -f $(DEST_BIN)/$(VIMTARGET) $(DEST_BIN)/$(VIMNAME).rm; \ rm -f $(DEST_BIN)/$(VIMNAME).rm; \ fi $(INSTALL_PROG) $(VIMTARGET) $(DEST_BIN) $(STRIP) $(DEST_BIN)/$(VIMTARGET) chmod $(BINMOD) $(DEST_BIN)/$(VIMTARGET) # may create a link to the new executable from /usr/bin/vi -$(LINKIT) # Long list of arguments for the shell script that installs the manual pages # for one language. INSTALLMANARGS = $(VIMLOC) $(SCRIPTLOC) $(VIMRCLOC) $(HELPSOURCE) $(MANMOD) \ $(VIMNAME) $(VIMDIFFNAME) $(EVIMNAME) # Install most of the runtime files installruntime: installrtbase installmacros installpack installtutor installspell # install the help files; first adjust the contents for the final location installrtbase: $(HELPSOURCE)/vim.1 $(DEST_VIM) $(DEST_RT) \ $(DEST_HELP) $(DEST_PRINT) $(DEST_COL) $(DEST_SYN) $(DEST_IND) \ $(DEST_FTP) $(DEST_AUTO) $(DEST_AUTO)/xml $(DEST_PLUG) \ $(DEST_TUTOR) $(DEST_SPELL) $(DEST_COMP) -$(SHELL) ./installman.sh install $(DEST_MAN) "" $(INSTALLMANARGS) # Generate the help tags with ":helptags" to handle all languages. # Move the distributed tags file aside and restore it, to avoid it being # different from the repository. cd $(HELPSOURCE); if test -f tags; then mv -f tags tags.dist; fi @echo generating help tags -@cd $(HELPSOURCE); $(MAKE) VIMEXE=$(DEST_BIN)/$(VIMTARGET) vimtags cd $(HELPSOURCE); \ files=`ls *.txt tags`; \ files="$$files `ls *.??x tags-?? 2>/dev/null || true`"; \ $(INSTALL_DATA) $$files $(DEST_HELP); \ cd $(DEST_HELP); \ chmod $(HELPMOD) $$files $(INSTALL_DATA) $(HELPSOURCE)/*.pl $(DEST_HELP) chmod $(SCRIPTMOD) $(DEST_HELP)/*.pl cd $(HELPSOURCE); if test -f tags.dist; then mv -f tags.dist tags; fi # install the menu files $(INSTALL_DATA) $(SCRIPTSOURCE)/menu.vim $(SYS_MENU_FILE) chmod $(VIMSCRIPTMOD) $(SYS_MENU_FILE) $(INSTALL_DATA) $(SCRIPTSOURCE)/synmenu.vim $(SYS_SYNMENU_FILE) chmod $(VIMSCRIPTMOD) $(SYS_SYNMENU_FILE) $(INSTALL_DATA) $(SCRIPTSOURCE)/delmenu.vim $(SYS_DELMENU_FILE) chmod $(VIMSCRIPTMOD) $(SYS_DELMENU_FILE) # install the evim file $(INSTALL_DATA) $(SCRIPTSOURCE)/mswin.vim $(MSWIN_FILE) chmod $(VIMSCRIPTMOD) $(MSWIN_FILE) $(INSTALL_DATA) $(SCRIPTSOURCE)/evim.vim $(EVIM_FILE) chmod $(VIMSCRIPTMOD) $(EVIM_FILE) # install the bugreport file $(INSTALL_DATA) $(SCRIPTSOURCE)/bugreport.vim $(SYS_BUGR_FILE) chmod $(VIMSCRIPTMOD) $(SYS_BUGR_FILE) # install the example vimrc files $(INSTALL_DATA) $(SCRIPTSOURCE)/vimrc_example.vim $(DEST_SCRIPT) chmod $(VIMSCRIPTMOD) $(DEST_SCRIPT)/vimrc_example.vim $(INSTALL_DATA) $(SCRIPTSOURCE)/gvimrc_example.vim $(DEST_SCRIPT) chmod $(VIMSCRIPTMOD) $(DEST_SCRIPT)/gvimrc_example.vim # install the file type detection files $(INSTALL_DATA) $(SCRIPTSOURCE)/filetype.vim $(SYS_FILETYPE_FILE) chmod $(VIMSCRIPTMOD) $(SYS_FILETYPE_FILE) $(INSTALL_DATA) $(SCRIPTSOURCE)/ftoff.vim $(SYS_FTOFF_FILE) chmod $(VIMSCRIPTMOD) $(SYS_FTOFF_FILE) $(INSTALL_DATA) $(SCRIPTSOURCE)/scripts.vim $(SYS_SCRIPTS_FILE) chmod $(VIMSCRIPTMOD) $(SYS_SCRIPTS_FILE) $(INSTALL_DATA) $(SCRIPTSOURCE)/ftplugin.vim $(SYS_FTPLUGIN_FILE) chmod $(VIMSCRIPTMOD) $(SYS_FTPLUGIN_FILE) $(INSTALL_DATA) $(SCRIPTSOURCE)/ftplugof.vim $(SYS_FTPLUGOF_FILE) chmod $(VIMSCRIPTMOD) $(SYS_FTPLUGOF_FILE) $(INSTALL_DATA) $(SCRIPTSOURCE)/indent.vim $(SYS_INDENT_FILE) chmod $(VIMSCRIPTMOD) $(SYS_INDENT_FILE) $(INSTALL_DATA) $(SCRIPTSOURCE)/indoff.vim $(SYS_INDOFF_FILE) chmod $(VIMSCRIPTMOD) $(SYS_INDOFF_FILE) $(INSTALL_DATA) $(SCRIPTSOURCE)/optwin.vim $(SYS_OPTWIN_FILE) chmod $(VIMSCRIPTMOD) $(SYS_OPTWIN_FILE) # install the print resource files cd $(PRINTSOURCE); $(INSTALL_DATA) *.ps $(DEST_PRINT) cd $(DEST_PRINT); chmod $(FILEMOD) *.ps # install the colorscheme files cd $(COLSOURCE); $(INSTALL_DATA) *.vim README.txt $(DEST_COL) cd $(DEST_COL); chmod $(HELPMOD) *.vim README.txt # install the syntax files cd $(SYNSOURCE); $(INSTALL_DATA) *.vim README.txt $(DEST_SYN) cd $(DEST_SYN); chmod $(HELPMOD) *.vim README.txt # install the indent files cd $(INDSOURCE); $(INSTALL_DATA) *.vim README.txt $(DEST_IND) cd $(DEST_IND); chmod $(HELPMOD) *.vim README.txt # install the standard autoload files cd $(AUTOSOURCE); $(INSTALL_DATA) *.vim README.txt $(DEST_AUTO) cd $(DEST_AUTO); chmod $(HELPMOD) *.vim README.txt cd $(AUTOSOURCE)/xml; $(INSTALL_DATA) *.vim $(DEST_AUTO)/xml cd $(DEST_AUTO)/xml; chmod $(HELPMOD) *.vim # install the standard plugin files cd $(PLUGSOURCE); $(INSTALL_DATA) *.vim README.txt $(DEST_PLUG) cd $(DEST_PLUG); chmod $(HELPMOD) *.vim README.txt # install the ftplugin files cd $(FTPLUGSOURCE); $(INSTALL_DATA) *.vim README.txt logtalk.dict $(DEST_FTP) cd $(DEST_FTP); chmod $(HELPMOD) *.vim README.txt # install the compiler files cd $(COMPSOURCE); $(INSTALL_DATA) *.vim README.txt $(DEST_COMP) cd $(DEST_COMP); chmod $(HELPMOD) *.vim README.txt installmacros: $(DEST_VIM) $(DEST_RT) $(DEST_MACRO) $(INSTALL_DATA_R) $(MACROSOURCE)/* $(DEST_MACRO) chmod $(DIRMOD) `find $(DEST_MACRO) -type d -print` chmod $(FILEMOD) `find $(DEST_MACRO) -type f -print` chmod $(SCRIPTMOD) $(DEST_MACRO)/less.sh # When using CVS some CVS directories might have been copied. # Also delete AAPDIR and *.info files. cvs=`find $(DEST_MACRO) \( -name CVS -o -name AAPDIR -o -name "*.info" \) -print`; \ if test -n "$$cvs"; then \ rm -rf $$cvs; \ fi installpack: $(DEST_VIM) $(DEST_RT) $(DEST_PACK) $(INSTALL_DATA_R) $(PACKSOURCE)/* $(DEST_PACK) chmod $(DIRMOD) `find $(DEST_PACK) -type d -print` chmod $(FILEMOD) `find $(DEST_PACK) -type f -print` # install the tutor files installtutorbin: $(DEST_VIM) $(INSTALL_DATA) vimtutor $(DEST_BIN)/$(VIMNAME)tutor chmod $(SCRIPTMOD) $(DEST_BIN)/$(VIMNAME)tutor installgtutorbin: $(DEST_VIM) $(INSTALL_DATA) gvimtutor $(DEST_BIN)/$(GVIMNAME)tutor chmod $(SCRIPTMOD) $(DEST_BIN)/$(GVIMNAME)tutor installtutor: $(DEST_RT) $(DEST_TUTOR) -$(INSTALL_DATA) $(TUTORSOURCE)/README* $(TUTORSOURCE)/tutor* $(DEST_TUTOR) -rm -f $(DEST_TUTOR)/*.info chmod $(HELPMOD) $(DEST_TUTOR)/* # Install the spell files, if they exist. This assumes at least the English # spell file is there. installspell: $(DEST_VIM) $(DEST_RT) $(DEST_SPELL) if test -f $(SPELLSOURCE)/en.latin1.spl; then \ $(INSTALL_DATA) $(SPELLSOURCE)/*.spl $(SPELLSOURCE)/*.sug $(SPELLSOURCE)/*.vim $(DEST_SPELL); \ chmod $(HELPMOD) $(DEST_SPELL)/*.spl $(DEST_SPELL)/*.sug $(DEST_SPELL)/*.vim; \ fi # install helper program xxd installtools: $(TOOLS) $(DESTDIR)$(exec_prefix) $(DEST_BIN) \ $(TOOLSSOURCE) $(DEST_VIM) $(DEST_RT) $(DEST_TOOLS) \ $(INSTALL_TOOL_LANGS) if test -f $(DEST_BIN)/xxd$(EXEEXT); then \ mv -f $(DEST_BIN)/xxd$(EXEEXT) $(DEST_BIN)/xxd.rm; \ rm -f $(DEST_BIN)/xxd.rm; \ fi $(INSTALL_PROG) xxd/xxd$(EXEEXT) $(DEST_BIN) $(STRIP) $(DEST_BIN)/xxd$(EXEEXT) chmod $(BINMOD) $(DEST_BIN)/xxd$(EXEEXT) -$(SHELL) ./installman.sh xxd $(DEST_MAN) "" $(INSTALLMANARGS) # install the runtime tools $(INSTALL_DATA_R) $(TOOLSSOURCE)/* $(DEST_TOOLS) # When using CVS some CVS directories might have been copied. cvs=`find $(DEST_TOOLS) \( -name CVS -o -name AAPDIR \) -print`; \ if test -n "$$cvs"; then \ rm -rf $$cvs; \ fi -chmod $(FILEMOD) $(DEST_TOOLS)/* # replace the path in some tools perlpath=`./which.sh perl` && sed -e "s+/usr/bin/perl+$$perlpath+" $(TOOLSSOURCE)/efm_perl.pl >$(DEST_TOOLS)/efm_perl.pl awkpath=`./which.sh nawk` && sed -e "s+/usr/bin/nawk+$$awkpath+" $(TOOLSSOURCE)/mve.awk >$(DEST_TOOLS)/mve.awk; if test -z "$$awkpath"; then \ awkpath=`./which.sh gawk` && sed -e "s+/usr/bin/nawk+$$awkpath+" $(TOOLSSOURCE)/mve.awk >$(DEST_TOOLS)/mve.awk; if test -z "$$awkpath"; then \ awkpath=`./which.sh awk` && sed -e "s+/usr/bin/nawk+$$awkpath+" $(TOOLSSOURCE)/mve.awk >$(DEST_TOOLS)/mve.awk; fi; fi -chmod $(SCRIPTMOD) `grep -l "^#!" $(DEST_TOOLS)/*` # install the language specific files for tools, if they were unpacked install-tool-languages: -$(SHELL) ./installman.sh xxd $(DEST_MAN_FR) "-fr" $(INSTALLMANARGS) -$(SHELL) ./installman.sh xxd $(DEST_MAN_FR_I) "-fr" $(INSTALLMANARGS) -$(SHELL) ./installman.sh xxd $(DEST_MAN_FR_U) "-fr.UTF-8" $(INSTALLMANARGS) -$(SHELL) ./installman.sh xxd $(DEST_MAN_IT) "-it" $(INSTALLMANARGS) -$(SHELL) ./installman.sh xxd $(DEST_MAN_IT_I) "-it" $(INSTALLMANARGS) -$(SHELL) ./installman.sh xxd $(DEST_MAN_IT_U) "-it.UTF-8" $(INSTALLMANARGS) -$(SHELL) ./installman.sh xxd $(DEST_MAN_JA_U) "-ja.UTF-8" $(INSTALLMANARGS) -$(SHELL) ./installman.sh xxd $(DEST_MAN_PL) "-pl" $(INSTALLMANARGS) -$(SHELL) ./installman.sh xxd $(DEST_MAN_PL_I) "-pl" $(INSTALLMANARGS) -$(SHELL) ./installman.sh xxd $(DEST_MAN_PL_U) "-pl.UTF-8" $(INSTALLMANARGS) -$(SHELL) ./installman.sh xxd $(DEST_MAN_RU) "-ru" $(INSTALLMANARGS) -$(SHELL) ./installman.sh xxd $(DEST_MAN_RU_U) "-ru.UTF-8" $(INSTALLMANARGS) # install the language specific files, if they were unpacked install-languages: languages $(DEST_LANG) $(DEST_KMAP) -$(SHELL) ./installman.sh install $(DEST_MAN_FR) "-fr" $(INSTALLMANARGS) -$(SHELL) ./installman.sh install $(DEST_MAN_FR_I) "-fr" $(INSTALLMANARGS) -$(SHELL) ./installman.sh install $(DEST_MAN_FR_U) "-fr.UTF-8" $(INSTALLMANARGS) -$(SHELL) ./installman.sh install $(DEST_MAN_IT) "-it" $(INSTALLMANARGS) -$(SHELL) ./installman.sh install $(DEST_MAN_IT_I) "-it" $(INSTALLMANARGS) -$(SHELL) ./installman.sh install $(DEST_MAN_IT_U) "-it.UTF-8" $(INSTALLMANARGS) -$(SHELL) ./installman.sh install $(DEST_MAN_JA_U) "-ja.UTF-8" $(INSTALLMANARGS) -$(SHELL) ./installman.sh install $(DEST_MAN_PL) "-pl" $(INSTALLMANARGS) -$(SHELL) ./installman.sh install $(DEST_MAN_PL_I) "-pl" $(INSTALLMANARGS) -$(SHELL) ./installman.sh install $(DEST_MAN_PL_U) "-pl.UTF-8" $(INSTALLMANARGS) -$(SHELL) ./installman.sh install $(DEST_MAN_RU) "-ru" $(INSTALLMANARGS) -$(SHELL) ./installman.sh install $(DEST_MAN_RU_U) "-ru.UTF-8" $(INSTALLMANARGS) -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_FR) $(INSTALLMLARGS) -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_FR_I) $(INSTALLMLARGS) -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_FR_U) $(INSTALLMLARGS) -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_IT) $(INSTALLMLARGS) -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_IT_I) $(INSTALLMLARGS) -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_IT_U) $(INSTALLMLARGS) -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_JA_U) $(INSTALLMLARGS) -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_PL) $(INSTALLMLARGS) -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_PL_I) $(INSTALLMLARGS) -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_PL_U) $(INSTALLMLARGS) -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_RU) $(INSTALLMLARGS) -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_RU_U) $(INSTALLMLARGS) if test -n "$(MAKEMO)" -a -f $(PODIR)/Makefile; then \ cd $(PODIR); $(MAKE) prefix=$(DESTDIR)$(prefix) LOCALEDIR=$(DEST_LANG) \ INSTALL_DATA=$(INSTALL_DATA) FILEMOD=$(FILEMOD) install; \ fi if test -d $(LANGSOURCE); then \ $(INSTALL_DATA) $(LANGSOURCE)/README.txt $(LANGSOURCE)/*.vim $(DEST_LANG); \ chmod $(FILEMOD) $(DEST_LANG)/README.txt $(DEST_LANG)/*.vim; \ fi if test -d $(KMAPSOURCE); then \ $(INSTALL_DATA) $(KMAPSOURCE)/README.txt $(KMAPSOURCE)/*.vim $(DEST_KMAP); \ chmod $(FILEMOD) $(DEST_KMAP)/README.txt $(DEST_KMAP)/*.vim; \ fi # 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 DESKTOPPATH = $(DESTDIR)$(DATADIR)/applications KDEPATH = $(HOME)/.kde/share/icons install-icons: if test -d $(ICON48PATH) -a -w $(ICON48PATH) \ -a ! -f $(ICON48PATH)/gvim.png; then \ $(INSTALL_DATA) $(SCRIPTSOURCE)/vim48x48.png $(ICON48PATH)/gvim.png; \ fi if test -d $(ICON32PATH) -a -w $(ICON32PATH) \ -a ! -f $(ICON32PATH)/gvim.png; then \ $(INSTALL_DATA) $(SCRIPTSOURCE)/vim32x32.png $(ICON32PATH)/gvim.png; \ fi if test -d $(ICON16PATH) -a -w $(ICON16PATH) \ -a ! -f $(ICON16PATH)/gvim.png; then \ $(INSTALL_DATA) $(SCRIPTSOURCE)/vim16x16.png $(ICON16PATH)/gvim.png; \ fi if test -d $(DESKTOPPATH) -a -w $(DESKTOPPATH); then \ $(INSTALL_DATA) $(SCRIPTSOURCE)/vim.desktop \ $(SCRIPTSOURCE)/gvim.desktop \ $(DESKTOPPATH); \ fi $(HELPSOURCE)/vim.1 $(MACROSOURCE) $(TOOLSSOURCE): @echo Runtime files not found. @echo You need to unpack the runtime archive before running "make install". test -f error $(DESTDIR)$(exec_prefix) $(DEST_BIN) \ $(DEST_VIM) $(DEST_RT) $(DEST_HELP) \ $(DEST_PRINT) $(DEST_COL) $(DEST_SYN) $(DEST_IND) $(DEST_FTP) \ $(DEST_LANG) $(DEST_KMAP) $(DEST_COMP) $(DEST_MACRO) \ $(DEST_PACK) $(DEST_TOOLS) $(DEST_TUTOR) $(DEST_SPELL) \ $(DEST_AUTO) $(DEST_AUTO)/xml $(DEST_PLUG): -$(SHELL) ./mkinstalldirs $@ -chmod $(DIRMOD) $@ # 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: $(GUI_TARGETS) \ $(DEST_BIN)/$(EXTARGET) \ $(DEST_BIN)/$(VIEWTARGET) \ $(DEST_BIN)/$(RVIMTARGET) \ $(DEST_BIN)/$(RVIEWTARGET) \ $(INSTALLVIMDIFF) installglinks: $(DEST_BIN)/$(GVIMTARGET) \ $(DEST_BIN)/$(GVIEWTARGET) \ $(DEST_BIN)/$(RGVIMTARGET) \ $(DEST_BIN)/$(RGVIEWTARGET) \ $(DEST_BIN)/$(EVIMTARGET) \ $(DEST_BIN)/$(EVIEWTARGET) \ $(INSTALLGVIMDIFF) installvimdiff: $(DEST_BIN)/$(VIMDIFFTARGET) installgvimdiff: $(DEST_BIN)/$(GVIMDIFFTARGET) $(DEST_BIN)/$(EXTARGET): cd $(DEST_BIN); ln -s $(VIMTARGET) $(EXTARGET) $(DEST_BIN)/$(VIEWTARGET): cd $(DEST_BIN); ln -s $(VIMTARGET) $(VIEWTARGET) $(DEST_BIN)/$(GVIMTARGET): cd $(DEST_BIN); ln -s $(VIMTARGET) $(GVIMTARGET) $(DEST_BIN)/$(GVIEWTARGET): cd $(DEST_BIN); ln -s $(VIMTARGET) $(GVIEWTARGET) $(DEST_BIN)/$(RVIMTARGET): cd $(DEST_BIN); ln -s $(VIMTARGET) $(RVIMTARGET) $(DEST_BIN)/$(RVIEWTARGET): cd $(DEST_BIN); ln -s $(VIMTARGET) $(RVIEWTARGET) $(DEST_BIN)/$(RGVIMTARGET): cd $(DEST_BIN); ln -s $(VIMTARGET) $(RGVIMTARGET) $(DEST_BIN)/$(RGVIEWTARGET): cd $(DEST_BIN); ln -s $(VIMTARGET) $(RGVIEWTARGET) $(DEST_BIN)/$(VIMDIFFTARGET): cd $(DEST_BIN); ln -s $(VIMTARGET) $(VIMDIFFTARGET) $(DEST_BIN)/$(GVIMDIFFTARGET): cd $(DEST_BIN); ln -s $(VIMTARGET) $(GVIMDIFFTARGET) $(DEST_BIN)/$(EVIMTARGET): cd $(DEST_BIN); ln -s $(VIMTARGET) $(EVIMTARGET) $(DEST_BIN)/$(EVIEWTARGET): 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. INSTALLMLARGS = $(VIMNAME) $(VIMDIFFNAME) $(EVIMNAME) \ $(EXNAME) $(VIEWNAME) $(RVIMNAME) $(RVIEWNAME) \ $(GVIMNAME) $(GVIEWNAME) $(RGVIMNAME) $(RGVIEWNAME) \ $(GVIMDIFFNAME) $(EVIEWNAME) installmanlinks: -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ $(DEST_MAN) $(INSTALLMLARGS) uninstall: uninstall_runtime -rm -f $(DEST_BIN)/$(VIMTARGET) -rm -f $(DEST_BIN)/vimtutor -rm -f $(DEST_BIN)/gvimtutor -rm -f $(DEST_BIN)/$(EXTARGET) $(DEST_BIN)/$(VIEWTARGET) -rm -f $(DEST_BIN)/$(GVIMTARGET) $(DEST_BIN)/$(GVIEWTARGET) -rm -f $(DEST_BIN)/$(RVIMTARGET) $(DEST_BIN)/$(RVIEWTARGET) -rm -f $(DEST_BIN)/$(RGVIMTARGET) $(DEST_BIN)/$(RGVIEWTARGET) -rm -f $(DEST_BIN)/$(VIMDIFFTARGET) $(DEST_BIN)/$(GVIMDIFFTARGET) -rm -f $(DEST_BIN)/$(EVIMTARGET) $(DEST_BIN)/$(EVIEWTARGET) -rm -f $(DEST_BIN)/xxd$(EXEEXT) # Note: the "rmdir" will fail if any files were added after "make install" uninstall_runtime: -$(SHELL) ./installman.sh uninstall $(DEST_MAN) "" $(INSTALLMANARGS) -$(SHELL) ./installman.sh uninstall $(DEST_MAN_FR) "" $(INSTALLMANARGS) -$(SHELL) ./installman.sh uninstall $(DEST_MAN_FR_I) "" $(INSTALLMANARGS) -$(SHELL) ./installman.sh uninstall $(DEST_MAN_FR_U) "" $(INSTALLMANARGS) -$(SHELL) ./installman.sh uninstall $(DEST_MAN_IT) "" $(INSTALLMANARGS) -$(SHELL) ./installman.sh uninstall $(DEST_MAN_IT_I) "" $(INSTALLMANARGS) -$(SHELL) ./installman.sh uninstall $(DEST_MAN_IT_U) "" $(INSTALLMANARGS) -$(SHELL) ./installman.sh uninstall $(DEST_MAN_JA_U) "" $(INSTALLMANARGS) -$(SHELL) ./installman.sh uninstall $(DEST_MAN_PL) "" $(INSTALLMANARGS) -$(SHELL) ./installman.sh uninstall $(DEST_MAN_PL_I) "" $(INSTALLMANARGS) -$(SHELL) ./installman.sh uninstall $(DEST_MAN_PL_U) "" $(INSTALLMANARGS) -$(SHELL) ./installman.sh uninstall $(DEST_MAN_RU) "" $(INSTALLMANARGS) -$(SHELL) ./installman.sh uninstall $(DEST_MAN_RU_U) "" $(INSTALLMANARGS) -$(SHELL) ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ $(DEST_MAN) $(INSTALLMLARGS) -$(SHELL) ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_FR) $(INSTALLMLARGS) -$(SHELL) ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_FR_I) $(INSTALLMLARGS) -$(SHELL) ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_FR_U) $(INSTALLMLARGS) -$(SHELL) ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_IT) $(INSTALLMLARGS) -$(SHELL) ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_IT_I) $(INSTALLMLARGS) -$(SHELL) ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_IT_U) $(INSTALLMLARGS) -$(SHELL) ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_JA_U) $(INSTALLMLARGS) -$(SHELL) ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_PL) $(INSTALLMLARGS) -$(SHELL) ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_PL_I) $(INSTALLMLARGS) -$(SHELL) ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_PL_U) $(INSTALLMLARGS) -$(SHELL) ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_RU) $(INSTALLMLARGS) -$(SHELL) ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_RU_U) $(INSTALLMLARGS) -rm -f $(DEST_MAN)/xxd.1 -rm -f $(DEST_MAN_FR)/xxd.1 $(DEST_MAN_FR_I)/xxd.1 $(DEST_MAN_FR_U)/xxd.1 -rm -f $(DEST_MAN_IT)/xxd.1 $(DEST_MAN_IT_I)/xxd.1 $(DEST_MAN_IT_U)/xxd.1 -rm -f $(DEST_MAN_JA_U)/xxd.1 -rm -f $(DEST_MAN_PL)/xxd.1 $(DEST_MAN_PL_I)/xxd.1 $(DEST_MAN_PL_U)/xxd.1 -rm -f $(DEST_MAN_RU)/xxd.1 $(DEST_MAN_RU_U)/xxd.1 -rm -f $(DEST_HELP)/*.txt $(DEST_HELP)/tags $(DEST_HELP)/*.pl -rm -f $(DEST_HELP)/*.??x $(DEST_HELP)/tags-?? -rm -f $(SYS_MENU_FILE) $(SYS_SYNMENU_FILE) $(SYS_DELMENU_FILE) -rm -f $(SYS_BUGR_FILE) $(EVIM_FILE) $(MSWIN_FILE) -rm -f $(DEST_SCRIPT)/gvimrc_example.vim $(DEST_SCRIPT)/vimrc_example.vim -rm -f $(SYS_FILETYPE_FILE) $(SYS_FTOFF_FILE) $(SYS_SCRIPTS_FILE) -rm -f $(SYS_INDOFF_FILE) $(SYS_INDENT_FILE) -rm -f $(SYS_FTPLUGOF_FILE) $(SYS_FTPLUGIN_FILE) -rm -f $(SYS_OPTWIN_FILE) -rm -f $(DEST_COL)/*.vim $(DEST_COL)/README.txt -rm -f $(DEST_SYN)/*.vim $(DEST_SYN)/README.txt -rm -f $(DEST_IND)/*.vim $(DEST_IND)/README.txt -rm -rf $(DEST_MACRO) -rm -rf $(DEST_PACK) -rm -rf $(DEST_TUTOR) -rm -rf $(DEST_SPELL) -rm -rf $(DEST_TOOLS) -rm -rf $(DEST_LANG) -rm -rf $(DEST_KMAP) -rm -rf $(DEST_COMP) -rm -f $(DEST_PRINT)/*.ps -rmdir $(DEST_HELP) $(DEST_PRINT) $(DEST_COL) $(DEST_SYN) $(DEST_IND) -rm -rf $(DEST_FTP)/*.vim $(DEST_FTP)/README.txt $(DEST_FTP)/logtalk.dict -rm -f $(DEST_AUTO)/*.vim $(DEST_AUTO)/README.txt $(DEST_AUTO)/xml/*.vim -rm -f $(DEST_PLUG)/*.vim $(DEST_PLUG)/README.txt -rmdir $(DEST_FTP) $(DEST_AUTO)/xml $(DEST_AUTO) $(DEST_PLUG) $(DEST_RT) # This will fail when other Vim versions are installed, no worries. -rmdir $(DEST_VIM) # Clean up all the files that have been produced, except configure's. # We support common typing mistakes for Juergen! :-) clean celan: testclean -rm -f *.o objects/* core $(VIMTARGET).core $(VIMTARGET) vim xxd/*.o -rm -f $(TOOLS) auto/osdef.h auto/pathdef.c auto/if_perl.c auto/gui_gtk_gresources.c auto/gui_gtk_gresources.h -rm -f conftest* *~ auto/link.sed -rm -f $(UNITTEST_TARGETS) -rm -f runtime pixmaps -rm -rf $(APPDIR) -rm -rf mzscheme_base.c if test -d $(PODIR); then \ cd $(PODIR); $(MAKE) prefix=$(DESTDIR)$(prefix) clean; \ fi # Make a shadow directory for compilation on another system or with different # features. SHADOWDIR = shadow shadow: runtime pixmaps mkdir $(SHADOWDIR) cd $(SHADOWDIR); ln -s ../*.[ch] ../*.in ../*.sh ../*.xs ../*.xbm ../gui_gtk_res.xml ../toolcheck ../proto ../vimtutor ../gvimtutor ../mkinstalldirs . mkdir $(SHADOWDIR)/auto cd $(SHADOWDIR)/auto; ln -s ../../auto/configure . mkdir $(SHADOWDIR)/po cd $(SHADOWDIR)/po; ln -s ../../po/*.po ../../po/*.mak ../../po/*.vim ../../po/Makefile . cd $(SHADOWDIR); rm -f auto/link.sed cp Makefile configure $(SHADOWDIR) rm -f $(SHADOWDIR)/auto/config.mk $(SHADOWDIR)/config.mk.dist cp config.mk.dist $(SHADOWDIR)/auto/config.mk cp config.mk.dist $(SHADOWDIR) mkdir $(SHADOWDIR)/xxd cd $(SHADOWDIR)/xxd; ln -s ../../xxd/*.[ch] ../../xxd/Make* . if test -d $(RSRC_DIR); then \ cd $(SHADOWDIR); \ ln -s ../infplist.xml .; \ ln -s ../$(RSRC_DIR) ../os_mac.rsr.hqx ../dehqx.py .; \ fi mkdir $(SHADOWDIR)/testdir cd $(SHADOWDIR)/testdir; ln -s ../../testdir/Makefile \ ../../testdir/Make_all.mak \ ../../testdir/*.in \ ../../testdir/*.vim \ ../../testdir/*.py \ ../../testdir/python* \ ../../testdir/sautest \ ../../testdir/test83-tags? \ ../../testdir/*.ok . # Link needed for doing "make install" in a shadow directory. runtime: -ln -s ../runtime . # Link needed for doing "make" using GTK in a shadow directory. pixmaps: -ln -s ../pixmaps . # Update the synmenu.vim file with the latest Syntax menu. # This is only needed when runtime/makemenu.vim was changed. menu: ./vim ../runtime/makemenu.vim ./vim -u ../runtime/makemenu.vim # Start configure from scratch scrub scratch: -rm -f auto/config.status auto/config.cache config.log auto/config.log -rm -f auto/config.h auto/link.log auto/link.sed auto/config.mk touch auto/config.h cp config.mk.dist auto/config.mk distclean: clean scratch -rm -f tags dist: distclean @echo @echo Making the distribution has to be done in the top directory mdepend: -@rm -f Makefile~ cp Makefile Makefile~ sed -e '/\#\#\# Dependencies/q' < Makefile > tmp_make @for i in $(ALL_SRC) ; do \ echo "$$i" ; \ echo `echo "$$i" | sed -e 's/[^ ]*\.c$$/objects\/\1.o/'`": $$i" `\ $(CPP) $$i |\ grep '^# .*"\./.*\.h"' |\ sort -t'"' -u +1 -2 |\ sed -e 's/.*"\.\/\(.*\)".*/\1/'\ ` >> tmp_make ; \ done mv tmp_make Makefile depend: -@rm -f Makefile~ cp Makefile Makefile~ sed -e '/\#\#\# Dependencies/q' < Makefile > tmp_make -for i in $(ALL_SRC); do echo $$i; \ $(CPP_DEPEND) $$i | \ sed -e 's+^\([^ ]*\.o\)+objects/\1+' >> tmp_make; done mv tmp_make Makefile # Run lint. Clean up the *.ln files that are sometimes left behind. lint: $(LINT) $(LINT_OPTIONS) $(LINT_CFLAGS) $(LINT_EXTRA) $(LINT_SRC) -rm -f *.ln # Check dosinst.c with lint. lintinstall: $(LINT) $(LINT_OPTIONS) -DWIN32 -DUNIX_LINT dosinst.c -rm -f dosinst.ln ########################################################################### .c.o: $(CCC) $< auto/if_perl.c: if_perl.xs $(PERL) -e 'unless ( $$] >= 5.005 ) { for (qw(na defgv errgv)) { print "#define PL_$$_ $$_\n" }}' > $@ $(PERL) $(PERL_XSUBPP) -prototypes -typemap \ $(PERLLIB)/ExtUtils/typemap if_perl.xs >> $@ auto/osdef.h: auto/config.h osdef.sh osdef1.h.in osdef2.h.in CC="$(CC) $(OSDEF_CFLAGS)" srcdir=$(srcdir) sh $(srcdir)/osdef.sh auto/pathdef.c: Makefile auto/config.mk -@echo creating $@ -@echo '/* pathdef.c */' > $@ -@echo '/* This file is automatically created by Makefile' >> $@ -@echo ' * DO NOT EDIT! Change Makefile only. */' >> $@ -@echo '#include "vim.h"' >> $@ -@echo 'char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)";' | $(QUOTESED) >> $@ -@echo 'char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)";' | $(QUOTESED) >> $@ -@echo 'char_u *all_cflags = (char_u *)"$(CC) -c -I$(srcdir) $(ALL_CFLAGS)";' | $(QUOTESED) >> $@ -@echo 'char_u *all_lflags = (char_u *)"$(CC) $(ALL_LIB_DIRS) $(LDFLAGS) -o $(VIMTARGET) $(ALL_LIBS) ";' | $(QUOTESED) >> $@ -@echo 'char_u *compiled_user = (char_u *)"' | tr -d $(NL) >> $@ -@if test -n "$(COMPILEDBY)"; then \ echo "$(COMPILEDBY)" | tr -d $(NL) >> $@; \ else ((logname) 2>/dev/null || whoami) | tr -d $(NL) >> $@; fi -@echo '";' >> $@ -@echo 'char_u *compiled_sys = (char_u *)"' | tr -d $(NL) >> $@ -@if test -z "$(COMPILEDBY)"; then hostname | tr -d $(NL) >> $@; fi -@echo '";' >> $@ -@sh $(srcdir)/pathdef.sh GUI_GTK_RES_INPUTS = \ ../pixmaps/stock_vim_build_tags.png \ ../pixmaps/stock_vim_find_help.png \ ../pixmaps/stock_vim_save_all.png \ ../pixmaps/stock_vim_session_load.png \ ../pixmaps/stock_vim_session_new.png \ ../pixmaps/stock_vim_session_save.png \ ../pixmaps/stock_vim_shell.png \ ../pixmaps/stock_vim_window_maximize.png \ ../pixmaps/stock_vim_window_maximize_width.png \ ../pixmaps/stock_vim_window_minimize.png \ ../pixmaps/stock_vim_window_minimize_width.png \ ../pixmaps/stock_vim_window_split.png \ ../pixmaps/stock_vim_window_split_vertical.png auto/gui_gtk_gresources.c: gui_gtk_res.xml $(GUI_GTK_RES_INPUTS) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=../pixmaps --generate --c-name=gui_gtk --manual-register gui_gtk_res.xml auto/gui_gtk_gresources.h: gui_gtk_res.xml $(GUI_GTK_RES_INPUTS) if test -z "$(GLIB_COMPILE_RESOURCES)"; then touch $@; else \ $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=../pixmaps --generate --c-name=gui_gtk --manual-register gui_gtk_res.xml; \ fi # All the object files are put in the "objects" directory. Since not all make # commands understand putting object files in another directory, it must be # specified for each file separately. objects: mkdir objects objects/blowfish.o: blowfish.c $(CCC) -o $@ blowfish.c objects/buffer.o: buffer.c $(CCC) -o $@ buffer.c objects/charset.o: charset.c $(CCC) -o $@ charset.c objects/crypt.o: crypt.c $(CCC) -o $@ crypt.c objects/crypt_zip.o: crypt_zip.c $(CCC) -o $@ crypt_zip.c objects/diff.o: diff.c $(CCC) -o $@ diff.c objects/digraph.o: digraph.c $(CCC) -o $@ digraph.c objects/edit.o: edit.c $(CCC) -o $@ edit.c objects/eval.o: eval.c $(CCC) -o $@ eval.c objects/ex_cmds.o: ex_cmds.c $(CCC) -o $@ ex_cmds.c objects/ex_cmds2.o: ex_cmds2.c $(CCC) -o $@ ex_cmds2.c objects/ex_docmd.o: ex_docmd.c $(CCC) -o $@ ex_docmd.c objects/ex_eval.o: ex_eval.c $(CCC) -o $@ ex_eval.c objects/ex_getln.o: ex_getln.c $(CCC) -o $@ ex_getln.c objects/fileio.o: fileio.c $(CCC) -o $@ fileio.c objects/fold.o: fold.c $(CCC) -o $@ fold.c objects/getchar.o: getchar.c $(CCC) -o $@ getchar.c objects/hardcopy.o: hardcopy.c $(CCC) -o $@ hardcopy.c objects/hashtab.o: hashtab.c $(CCC) -o $@ hashtab.c objects/gui.o: gui.c $(CCC) -o $@ gui.c objects/gui_at_fs.o: gui_at_fs.c $(CCC) -o $@ gui_at_fs.c objects/gui_at_sb.o: gui_at_sb.c $(CCC) -o $@ gui_at_sb.c objects/gui_athena.o: gui_athena.c $(CCC) -o $@ gui_athena.c objects/gui_beval.o: gui_beval.c $(CCC) -o $@ gui_beval.c objects/gui_gtk.o: gui_gtk.c $(CCC) -o $@ gui_gtk.c objects/gui_gtk_f.o: gui_gtk_f.c $(CCC) -o $@ gui_gtk_f.c objects/gui_gtk_gresources.o: auto/gui_gtk_gresources.c $(CCC) $(PERL_CFLAGS) -o $@ auto/gui_gtk_gresources.c objects/gui_gtk_x11.o: gui_gtk_x11.c $(CCC) -o $@ gui_gtk_x11.c objects/gui_motif.o: gui_motif.c $(CCC) -o $@ gui_motif.c objects/gui_xmdlg.o: gui_xmdlg.c $(CCC) -o $@ gui_xmdlg.c objects/gui_xmebw.o: gui_xmebw.c $(CCC) -o $@ gui_xmebw.c objects/gui_x11.o: gui_x11.c $(CCC) -o $@ gui_x11.c objects/gui_photon.o: gui_photon.c $(CCC) -o $@ gui_photon.c objects/gui_mac.o: gui_mac.c $(CCC) -o $@ gui_mac.c objects/hangulin.o: hangulin.c $(CCC) -o $@ hangulin.c objects/if_cscope.o: if_cscope.c $(CCC) -o $@ if_cscope.c objects/if_xcmdsrv.o: if_xcmdsrv.c $(CCC) -o $@ if_xcmdsrv.c objects/if_lua.o: if_lua.c $(CCC) $(LUA_CFLAGS) -o $@ if_lua.c objects/if_mzsch.o: if_mzsch.c $(MZSCHEME_EXTRA) $(CCC) -o $@ $(MZSCHEME_CFLAGS_EXTRA) if_mzsch.c mzscheme_base.c: $(MZSCHEME_MZC) --c-mods mzscheme_base.c ++lib scheme/base objects/if_perl.o: auto/if_perl.c $(CCC) $(PERL_CFLAGS) -o $@ auto/if_perl.c objects/if_perlsfio.o: if_perlsfio.c $(CCC) $(PERL_CFLAGS) -o $@ if_perlsfio.c objects/py_getpath.o: $(PYTHON_CONFDIR)/getpath.c $(CCC) $(PYTHON_CFLAGS) -o $@ $(PYTHON_CONFDIR)/getpath.c \ -I$(PYTHON_CONFDIR) -DHAVE_CONFIG_H -DNO_MAIN \ $(PYTHON_GETPATH_CFLAGS) objects/if_python.o: if_python.c if_py_both.h $(CCC) $(PYTHON_CFLAGS) $(PYTHON_CFLAGS_EXTRA) -o $@ if_python.c objects/if_python3.o: if_python3.c if_py_both.h $(CCC) $(PYTHON3_CFLAGS) $(PYTHON3_CFLAGS_EXTRA) -o $@ if_python3.c objects/if_ruby.o: if_ruby.c $(CCC) $(RUBY_CFLAGS) -o $@ if_ruby.c objects/if_tcl.o: if_tcl.c $(CCC) $(TCL_CFLAGS) -o $@ if_tcl.c objects/integration.o: integration.c $(CCC) -o $@ integration.c objects/json.o: json.c $(CCC) -o $@ json.c objects/json_test.o: json_test.c $(CCC) -o $@ json_test.c objects/main.o: main.c $(CCC) -o $@ main.c objects/mark.o: mark.c $(CCC) -o $@ mark.c objects/memfile.o: memfile.c $(CCC) -o $@ memfile.c objects/memfile_test.o: memfile_test.c $(CCC) -o $@ memfile_test.c objects/memline.o: memline.c $(CCC) -o $@ memline.c objects/menu.o: menu.c $(CCC) -o $@ menu.c objects/message.o: message.c $(CCC) -o $@ message.c objects/misc1.o: misc1.c $(CCC) -o $@ misc1.c objects/misc2.o: misc2.c $(CCC) -o $@ misc2.c objects/move.o: move.c $(CCC) -o $@ move.c objects/mbyte.o: mbyte.c $(CCC) -o $@ mbyte.c objects/normal.o: normal.c $(CCC) -o $@ normal.c objects/ops.o: ops.c $(CCC) -o $@ ops.c objects/option.o: option.c $(CCC) $(LUA_CFLAGS) $(PERL_CFLAGS) $(PYTHON_CFLAGS) $(PYTHON3_CFLAGS) $(RUBY_CFLAGS) $(TCL_CFLAGS) -o $@ option.c objects/os_beos.o: os_beos.c $(CCC) -o $@ os_beos.c objects/os_qnx.o: os_qnx.c $(CCC) -o $@ os_qnx.c objects/os_macosx.o: os_macosx.m $(CCC) -o $@ os_macosx.m objects/os_mac_conv.o: os_mac_conv.c $(CCC) -o $@ os_mac_conv.c objects/os_unix.o: os_unix.c $(CCC) -o $@ os_unix.c objects/os_mswin.o: os_mswin.c $(CCC) -o $@ os_mswin.c objects/winclip.o: winclip.c $(CCC) -o $@ winclip.c objects/pathdef.o: auto/pathdef.c $(CCC) -o $@ auto/pathdef.c objects/pty.o: pty.c $(CCC) -o $@ pty.c objects/popupmnu.o: popupmnu.c $(CCC) -o $@ popupmnu.c objects/quickfix.o: quickfix.c $(CCC) -o $@ quickfix.c objects/regexp.o: regexp.c regexp_nfa.c $(CCC) -o $@ regexp.c objects/screen.o: screen.c $(CCC) -o $@ screen.c objects/search.o: search.c $(CCC) -o $@ search.c objects/sha256.o: sha256.c $(CCC) -o $@ sha256.c objects/spell.o: spell.c $(CCC) -o $@ spell.c objects/syntax.o: syntax.c $(CCC) -o $@ syntax.c objects/tag.o: tag.c $(CCC) -o $@ tag.c objects/term.o: term.c $(CCC) -o $@ term.c objects/ui.o: ui.c $(CCC) -o $@ ui.c objects/undo.o: undo.c $(CCC) -o $@ undo.c objects/window.o: window.c $(CCC) -o $@ window.c objects/workshop.o: workshop.c $(CCC) -o $@ workshop.c objects/wsdebug.o: wsdebug.c $(CCC) -o $@ wsdebug.c objects/netbeans.o: netbeans.c $(CCC) -o $@ netbeans.c objects/channel.o: channel.c $(CCC) -o $@ channel.c Makefile: @echo The name of the makefile MUST be "Makefile" (with capital M)!!!! ############################################################################### ### MacOS X installation ### ### This installs a runnable Vim.app in $(prefix) REZ = /Developer/Tools/Rez RESDIR = $(APPDIR)/Contents/Resources VERSION = $(VIMMAJOR).$(VIMMINOR) ### Common flags M4FLAGSX = $(M4FLAGS) -DAPP_EXE=$(VIMNAME) -DAPP_NAME=$(VIMNAME) \ -DAPP_VER=$(VERSION) install_macosx: gui_bundle # Remove the link to the runtime dir, don't want to copy all of that. -rm $(RESDIR)/vim/runtime $(INSTALL_DATA_R) $(APPDIR) $(DESTDIR)$(prefix) # Generate the help tags file now, it won't work with "make installruntime". -@srcdir=`pwd`; cd $(HELPSOURCE); $(MAKE) VIMEXE=$$srcdir/$(VIMTARGET) vimtags # Install the runtime files. Recursive! -mkdir -p $(DESTDIR)$(prefix)/$(RESDIR)/vim/runtime # -mkdir $(DESTDIR)$(prefix)/$(APPDIR)/bin srcdir=`pwd`; $(MAKE) -f Makefile installruntime \ VIMEXE=$$srcdir/$(VIMTARGET) \ prefix=$(DESTDIR)$(prefix)/$(RESDIR)$(VIMDIR) \ exec_prefix=$(DESTDIR)$(prefix)/$(APPDIR)/Contents \ BINDIR=$(DESTDIR)$(prefix)/$(APPDIR)/Contents/MacOS \ VIMLOC=$(DESTDIR)$(prefix)/$(RESDIR)$(VIMDIR) \ VIMRTLOC=$(DESTDIR)$(prefix)/$(RESDIR)$(VIMDIR)/runtime # Put the link back. ln -s `pwd`/../runtime $(RESDIR)/vim # Copy rgb.txt, Mac doesn't always have X11 $(INSTALL_DATA) $(SCRIPTSOURCE)/rgb.txt $(DESTDIR)$(prefix)/$(RESDIR)/vim/runtime # TODO: Create the vimtutor and/or gvimtutor application. gui_bundle: $(RESDIR) bundle-dir bundle-executable bundle-info bundle-resource \ bundle-language $(RESDIR): mkdir -p $@ bundle-dir: $(APPDIR)/Contents $(VIMTARGET) # Make a link to the runtime directory, so that we can try out the executable # without installing it. mkdir -p $(RESDIR)/vim -ln -s `pwd`/../runtime $(RESDIR)/vim bundle-executable: $(VIMTARGET) mkdir -p $(APPDIR)/Contents/MacOS cp $(VIMTARGET) $(APPDIR)/Contents/MacOS/$(VIMTARGET) bundle-info: bundle-dir @echo "Creating PkgInfo" @echo -n "APPLVIM!" > $(APPDIR)/Contents/PkgInfo @echo "Creating Info.plist" m4 $(M4FLAGSX) infplist.xml > $(APPDIR)/Contents/Info.plist bundle-resource: bundle-dir bundle-rsrc cp -f $(RSRC_DIR)/*.icns $(RESDIR) ### Classic resources # Resource fork (in the form of a .rsrc file) for Classic Vim (Mac OS 9) # This file is also required for OS X Vim. bundle-rsrc: os_mac.rsr.hqx @echo "Creating resource fork" python dehqx.py $< rm -f gui_mac.rsrc mv gui_mac.rsrc.rsrcfork $(RESDIR)/$(VIMNAME).rsrc # po/Make_osx.pl says something about generating a Mac message file # for Ukrainian. Would somebody using Mac OS X in Ukrainian # *really* be upset that Carbon Vim was not localised in # Ukrainian? # #bundle-language: bundle-dir po/Make_osx.pl # cd po && perl Make_osx.pl --outdir ../$(RESDIR) $(MULTILANG) bundle-language: bundle-dir $(APPDIR)/Contents: -$(SHELL) ./mkinstalldirs $(APPDIR)/Contents/MacOS -$(SHELL) ./mkinstalldirs $(RESDIR)/English.lproj ############################################################################### ### (automatically generated by 'make depend') ### Dependencies: objects/blowfish.o: blowfish.c vim.h auto/config.h feature.h os_unix.h \ auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \ regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h objects/buffer.o: buffer.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h version.h objects/charset.o: charset.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h objects/crypt.o: crypt.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h objects/crypt_zip.o: crypt_zip.c vim.h auto/config.h feature.h os_unix.h \ auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \ regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h objects/diff.o: diff.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h objects/digraph.o: digraph.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h objects/edit.o: edit.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h objects/eval.o: eval.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h version.h objects/ex_cmds.o: ex_cmds.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h version.h objects/ex_cmds2.o: ex_cmds2.c vim.h auto/config.h feature.h os_unix.h \ auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \ regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h version.h objects/ex_docmd.o: ex_docmd.c vim.h auto/config.h feature.h os_unix.h \ auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \ regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h objects/ex_eval.o: ex_eval.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h objects/ex_getln.o: ex_getln.c vim.h auto/config.h feature.h os_unix.h \ auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \ regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h objects/fileio.o: fileio.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h objects/fold.o: fold.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h objects/getchar.o: getchar.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h objects/hardcopy.o: hardcopy.c vim.h auto/config.h feature.h os_unix.h \ auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \ regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h version.h objects/hashtab.o: hashtab.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h objects/if_cscope.o: if_cscope.c vim.h auto/config.h feature.h os_unix.h \ auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \ regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h if_cscope.h objects/if_xcmdsrv.o: if_xcmdsrv.c vim.h auto/config.h feature.h os_unix.h \ auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \ regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h version.h objects/json.o: json.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h objects/main.o: main.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h farsi.c arabic.c objects/mark.o: mark.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h objects/memfile.o: memfile.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h objects/memline.o: memline.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h objects/menu.o: menu.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h objects/message.o: message.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h objects/misc1.o: misc1.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h version.h objects/misc2.o: misc2.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h objects/move.o: move.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h objects/mbyte.o: mbyte.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h objects/normal.o: normal.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h objects/ops.o: ops.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h ascii.h \ keymap.h term.h macros.h option.h structs.h regexp.h gui.h gui_beval.h \ proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h farsi.h arabic.h objects/option.o: option.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h objects/os_unix.o: os_unix.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h os_unixx.h objects/pathdef.o: auto/pathdef.c vim.h auto/config.h feature.h os_unix.h \ auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \ regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h objects/popupmnu.o: popupmnu.c vim.h auto/config.h feature.h os_unix.h \ auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \ regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h objects/quickfix.o: quickfix.c vim.h auto/config.h feature.h os_unix.h \ auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \ regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h objects/regexp.o: regexp.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h regexp_nfa.c objects/screen.o: screen.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h objects/search.o: search.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h objects/sha256.o: sha256.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h objects/spell.o: spell.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h objects/syntax.o: syntax.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h objects/tag.o: tag.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h ascii.h \ keymap.h term.h macros.h option.h structs.h regexp.h gui.h gui_beval.h \ proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h farsi.h arabic.h objects/term.o: term.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h objects/ui.o: ui.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h ascii.h \ keymap.h term.h macros.h option.h structs.h regexp.h gui.h gui_beval.h \ proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h farsi.h arabic.h objects/undo.o: undo.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h objects/version.o: version.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h version.h objects/window.o: window.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h objects/gui.o: gui.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h ascii.h \ keymap.h term.h macros.h option.h structs.h regexp.h gui.h gui_beval.h \ proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h farsi.h arabic.h objects/gui_gtk.o: gui_gtk.c gui_gtk_f.h vim.h auto/config.h feature.h os_unix.h \ auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \ regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h objects/gui_gtk_f.o: gui_gtk_f.c vim.h auto/config.h feature.h os_unix.h \ auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \ regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h gui_gtk_f.h objects/gui_motif.o: gui_motif.c vim.h auto/config.h feature.h os_unix.h \ auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \ regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h gui_xmebw.h ../pixmaps/alert.xpm \ ../pixmaps/error.xpm ../pixmaps/generic.xpm ../pixmaps/info.xpm \ ../pixmaps/quest.xpm gui_x11_pm.h ../pixmaps/tb_new.xpm \ ../pixmaps/tb_open.xpm ../pixmaps/tb_close.xpm ../pixmaps/tb_save.xpm \ ../pixmaps/tb_print.xpm ../pixmaps/tb_cut.xpm ../pixmaps/tb_copy.xpm \ ../pixmaps/tb_paste.xpm ../pixmaps/tb_find.xpm \ ../pixmaps/tb_find_next.xpm ../pixmaps/tb_find_prev.xpm \ ../pixmaps/tb_find_help.xpm ../pixmaps/tb_exit.xpm \ ../pixmaps/tb_undo.xpm ../pixmaps/tb_redo.xpm ../pixmaps/tb_help.xpm \ ../pixmaps/tb_macro.xpm ../pixmaps/tb_make.xpm \ ../pixmaps/tb_save_all.xpm ../pixmaps/tb_jump.xpm \ ../pixmaps/tb_ctags.xpm ../pixmaps/tb_load_session.xpm \ ../pixmaps/tb_save_session.xpm ../pixmaps/tb_new_session.xpm \ ../pixmaps/tb_blank.xpm ../pixmaps/tb_maximize.xpm \ ../pixmaps/tb_split.xpm ../pixmaps/tb_minimize.xpm \ ../pixmaps/tb_shell.xpm ../pixmaps/tb_replace.xpm \ ../pixmaps/tb_vsplit.xpm ../pixmaps/tb_maxwidth.xpm \ ../pixmaps/tb_minwidth.xpm objects/gui_xmdlg.o: gui_xmdlg.c vim.h auto/config.h feature.h os_unix.h \ auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \ regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h objects/gui_xmebw.o: gui_xmebw.c vim.h auto/config.h feature.h os_unix.h \ auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \ regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h gui_xmebwp.h gui_xmebw.h objects/gui_athena.o: gui_athena.c vim.h auto/config.h feature.h os_unix.h \ auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \ regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h gui_at_sb.h gui_x11_pm.h \ ../pixmaps/tb_new.xpm ../pixmaps/tb_open.xpm ../pixmaps/tb_close.xpm \ ../pixmaps/tb_save.xpm ../pixmaps/tb_print.xpm ../pixmaps/tb_cut.xpm \ ../pixmaps/tb_copy.xpm ../pixmaps/tb_paste.xpm ../pixmaps/tb_find.xpm \ ../pixmaps/tb_find_next.xpm ../pixmaps/tb_find_prev.xpm \ ../pixmaps/tb_find_help.xpm ../pixmaps/tb_exit.xpm \ ../pixmaps/tb_undo.xpm ../pixmaps/tb_redo.xpm ../pixmaps/tb_help.xpm \ ../pixmaps/tb_macro.xpm ../pixmaps/tb_make.xpm \ ../pixmaps/tb_save_all.xpm ../pixmaps/tb_jump.xpm \ ../pixmaps/tb_ctags.xpm ../pixmaps/tb_load_session.xpm \ ../pixmaps/tb_save_session.xpm ../pixmaps/tb_new_session.xpm \ ../pixmaps/tb_blank.xpm ../pixmaps/tb_maximize.xpm \ ../pixmaps/tb_split.xpm ../pixmaps/tb_minimize.xpm \ ../pixmaps/tb_shell.xpm ../pixmaps/tb_replace.xpm \ ../pixmaps/tb_vsplit.xpm ../pixmaps/tb_maxwidth.xpm \ ../pixmaps/tb_minwidth.xpm objects/gui_gtk_x11.o: gui_gtk_x11.c vim.h auto/config.h feature.h os_unix.h \ auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \ regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h auto/gui_gtk_gresources.h gui_gtk_f.h \ ../runtime/vim32x32.xpm ../runtime/vim16x16.xpm ../runtime/vim48x48.xpm objects/gui_x11.o: gui_x11.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h ../runtime/vim32x32.xpm ../runtime/vim16x16.xpm \ ../runtime/vim48x48.xpm objects/gui_at_sb.o: gui_at_sb.c vim.h auto/config.h feature.h os_unix.h \ auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \ regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h gui_at_sb.h objects/gui_at_fs.o: gui_at_fs.c vim.h auto/config.h feature.h os_unix.h \ auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \ regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h gui_at_sb.h objects/pty.o: pty.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h ascii.h \ keymap.h term.h macros.h option.h structs.h regexp.h gui.h gui_beval.h \ proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h farsi.h arabic.h objects/json_test.o: json_test.c main.c vim.h auto/config.h feature.h os_unix.h \ auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \ regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h farsi.c arabic.c json.c objects/memfile_test.o: memfile_test.c main.c vim.h auto/config.h feature.h \ os_unix.h auto/osdef.h ascii.h keymap.h term.h macros.h option.h \ structs.h regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h \ ex_cmds.h proto.h globals.h farsi.h arabic.h farsi.c arabic.c memfile.c objects/hangulin.o: hangulin.c vim.h auto/config.h feature.h os_unix.h \ auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \ regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h objects/if_lua.o: if_lua.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h objects/if_mzsch.o: if_mzsch.c vim.h auto/config.h feature.h os_unix.h \ auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \ regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h if_mzsch.h objects/if_perl.o: auto/if_perl.c vim.h auto/config.h feature.h os_unix.h \ auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \ regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h objects/if_perlsfio.o: if_perlsfio.c vim.h auto/config.h feature.h os_unix.h \ auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \ regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h objects/if_python.o: if_python.c vim.h auto/config.h feature.h os_unix.h \ auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \ regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h if_py_both.h objects/if_python3.o: if_python3.c vim.h auto/config.h feature.h os_unix.h \ auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \ regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h if_py_both.h objects/if_tcl.o: if_tcl.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h objects/if_ruby.o: if_ruby.c auto/config.h vim.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h version.h objects/gui_beval.o: gui_beval.c vim.h auto/config.h feature.h os_unix.h \ auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \ regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h objects/workshop.o: workshop.c auto/config.h integration.h vim.h feature.h \ os_unix.h auto/osdef.h ascii.h keymap.h term.h macros.h option.h \ structs.h regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h \ ex_cmds.h proto.h globals.h farsi.h arabic.h version.h workshop.h objects/wsdebug.o: wsdebug.c objects/integration.o: integration.c vim.h auto/config.h feature.h os_unix.h \ auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \ regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h integration.h objects/netbeans.o: netbeans.c vim.h auto/config.h feature.h os_unix.h \ auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \ regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h \ globals.h farsi.h arabic.h version.h objects/channel.o: channel.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \ farsi.h arabic.h objects/gui_gtk_gresources.o: auto/gui_gtk_gresources.c vim-7.4.1689/src/README.txt000066400000000000000000000120721267703067000150640ustar00rootroot00000000000000README 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 mbyte.c multi-byte character handling memfile.c storing lines for buffers in a swapfile memline.c storing lines for buffers in memory menu.c menus message.c (error) messages ops.c handling operators ("d", "y", "p") option.c options quickfix.c quickfix commands (":make", ":cn") regexp.c pattern matching screen.c updating the windows search.c pattern searching spell.c spell checking syntax.c syntax and other highlighting 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 or or some other character that ends the command line mode. EX COMMANDS Ex commands are handled by the function do_cmdline(). It does the generic parsing of the ":" command line and calls do_one_cmd() for each separate command. It also takes care of while loops. do_one_cmd() parses the range and generic arguments and puts them in the exarg_t and passes it to the function that handles the command. The ":" commands are listed in ex_cmds.h. The third entry of each item is the name of the function that handles the command. The last entry are the flags that are used for the command. NORMAL MODE COMMANDS The Normal mode commands are handled by the normal_cmd() function. It also handles the optional count and an extra character for some commands. These are passed in a cmdarg_t to the function that handles the command. There is a table nv_cmds in normal.c which lists the first character of every command. The second entry of each item is the name of the function that handles the command. INSERT MODE COMMANDS When doing an "i" or "a" command, normal_cmd() will call the edit() function. It contains a loop that waits for the next character and handles it. It returns when leaving Insert mode. OPTIONS There is a list with all option names in option.c, called options[]. THE GUI Most of the GUI code is implemented like it was a clever terminal. Typing a character, moving a scrollbar, clicking the mouse, etc. are all translated into events which are written in the input buffer. These are read by the main code, just like reading from a terminal. The code for this is scattered through gui.c. For example: gui_send_mouse_event() for a mouse click and gui_menu_cb() for a menu action. Key hits are handled by the system-specific GUI code, which calls add_to_input_buf() to send the key code. Updating the GUI window is done by writing codes in the output buffer, just like writing to a terminal. When the buffer gets full or is flushed, gui_write() will parse the codes and draw the appropriate items. Finally the system-specific GUI code will be called to do the work. DEBUGGING THE GUI Remember to prevent that gvim forks and the debugger thinks Vim has exited, add the "-f" argument. In gdb: "run -f -g". When stepping through display updating code, the focus event is triggered when going from the debugger to Vim and back. To avoid this, recompile with some code in gui_focus_change() disabled. vim-7.4.1689/src/VisVim/000077500000000000000000000000001267703067000146015ustar00rootroot00000000000000vim-7.4.1689/src/VisVim/Commands.cpp000066400000000000000000000422721267703067000170550ustar00rootroot00000000000000#include "stdafx.h" #include // 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 BOOL g_bNewTabs = FALSE; 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 it's 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_bNewTabs = GetRegistryInt(hSectionKey, "NewTabs", g_bNewTabs); 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; BOOL m_bNewTabs; //}}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; m_bNewTabs = 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); DDX_Check(pDX, IDC_NEW_TABS, m_bNewTabs); //}}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_bNewTabs = g_bNewTabs; Dlg.m_ChangeDir = g_ChangeDir; if (Dlg.DoModal() == IDOK) { g_bDevStudioEditor = Dlg.m_bDevStudioEditor; g_bNewTabs = Dlg.m_bNewTabs; 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, "NewTabs", g_bNewTabs); 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 destructor destroys the OLE // connection; // This is important 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. if (g_bNewTabs) { sprintf(VimCmd, ":tab drop "); s = VimCmd + 10; } else { sprintf(VimCmd, ":drop "); s = VimCmd + 6; } sprintf(FileNameTmp, "%S", (char *)FileName); for (p = FileNameTmp; *p != '\0' && s < VimCmd + 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 vim-7.4.1689/src/VisVim/Commands.h000066400000000000000000000070001267703067000165100ustar00rootroot00000000000000// 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) vim-7.4.1689/src/VisVim/DSAddIn.cpp000066400000000000000000000105671267703067000165240ustar00rootroot00000000000000#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 method 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); } vim-7.4.1689/src/VisVim/DSAddIn.h000066400000000000000000000025431267703067000161640ustar00rootroot00000000000000// 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) vim-7.4.1689/src/VisVim/OleAut.cpp000066400000000000000000000501041267703067000164760ustar00rootroot00000000000000// // 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 #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 preferred 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 following 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 occurred:\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 vim-7.4.1689/src/VisVim/OleAut.h000066400000000000000000000036731267703067000161540ustar00rootroot00000000000000#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__ vim-7.4.1689/src/VisVim/README_VisVim.txt000066400000000000000000000273431267703067000176050ustar00rootroot00000000000000=============================== 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 Based upon: VisEmacs by Christopher Payne Version: 1.0 Created: 23 Oct 1997 Date: 23 Oct 1997 VisVim was originally GNU GPL licensed, as stated below. On March 21 2012 Heiko Erhardt declared this work to be relicensed under the Vim license, as stated in ../../runtime/doc/uganda.txt (or ":help uganda" in Vim). 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 interprets 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 -> Customize ->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 and 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' highlight 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@gmx.net vim-7.4.1689/src/VisVim/Reg.cpp000066400000000000000000000027251267703067000160300ustar00rootroot00000000000000#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; } vim-7.4.1689/src/VisVim/Register.bat000066400000000000000000000000301267703067000170460ustar00rootroot00000000000000regsvr32.exe visvim.dll vim-7.4.1689/src/VisVim/Res/000077500000000000000000000000001267703067000153325ustar00rootroot00000000000000vim-7.4.1689/src/VisVim/Res/ToolbarL.bmp000066400000000000000000000051661267703067000175600ustar00rootroot00000000000000BMv v(  wwwwwwwpwwwwwwwwwwwwwwpwpwwwwwwwwwwwpwwwwwwwwwwwwpwwwwwwwwwwwwwwpwwwwwwwwww@wwwwwwwwwwwwww@w wwwwwwwwwww@wpwwpwwwwwww@wpwwpwwwwwwwww@wwwwwwwpwwwwwwwp"$""wwwwwwwp"$pw wwwwp"$wwpwwwwwp"$wwwpxwwpwwwpwwwpxw"""" wwwwwpxw""@w pwwpxw""@wwwpxw""@wwww wwwwwwww"" ""wwwww"""$p wwww""" www"" wwwx"ppppwwwwx"" @w wwwwwx""""@w wwwwx"" wwwx"" wwwwptppwwwww"""$p"wwwww"""$ wwwww"" wwww" wwwwxpwDwpwwwwwx""""@w wwwwwx""""@ wwwwwx"" wwwwwx" wwwwwwwwwwwwwwww"""$wwwwww""" pwwwww""$pwwwwww""$wwwwwxwwwpwwwwwwx""""@wpwwwwwx"" w wwwwwx"" "@pwwwwwwwx"""wwwwww wwwwwww"""$wpwwwwww""$pwwwwww"""$wwwwwwww"""wwwwwwpw"""@wwwwwwwwx""""@wwwwwwwwx""""@wwwwwwwx""""@wwwwwwwwx"""wpwwwwpw"""$wwpwwwww"""$wwpwwwww"""$wwpwwwww"""$wwpwwwww"""$ww wwwww""""@ww wwwwwx""""@ww wwwwwx""""@ww wwwwwx""""@ww wwwwwx""""@wpwwwwx""""$pwwwww"""$pwwwww"""$pwwwww"""$pwwwww"""$ "wwwww""""@ "wwwwwx""""@ "wwwwwx""""@ "wwwwwx""""@ "wwwwwx""""@ "wwwwx""""@ "wwwww"""@ "wwwww"""@ "wwwww"""@ "wwwww"""@pwwwww""$pwwwwwx""$pwwwwwx""$pwwwwwx""$pwwwwwx""$w wwwwx""@ww wwwww"@ww wwwww"@ww wwwww"@ww wwwww"@wwpwww ww$wwpwww wwx$wwpwww wwx$wwpwww wwx$wwpwww wwx$wwwwww"wx@wwwwwww"wwwwwwwww"wwwwwwwww"wwwwwwwww"wwwwwwwww" wwwwwwwww" wwxwwwwwww" wwxwwwwwww" wwxwwwwwww" wwxwwwwwww""wxwwwwwww""wwwwwwww""wwwwwwww""wwwwwwww""wwwwwwww"" wwwwwwww"" wwxwwwwww"" wwxwwwwww"" wwxwwwwww"" wwxwwwwww"""wwxwwwwww"""wwwwwwww"""wwwwwwww"""wwwwwwww"""wwwwwwww"" wwwwwww"" wwwwwww"" wwwwwww"" wwwwwww"" wwwpwwwww""wwwxwpwwwww""wwwxwpwwwww""wwwxwpwwwww""wwwxwpwwwww""wwwxwwwwwwp" wwwwwwwwwwp" wwwxwwwwwwp" wwwxwwwwwwp" wwwxwwwwwwp" wwwxw"ww"ww"ww"ww"wwp*wwp*wwp*wwp*wwp*wwwwwwww wwwwwwwwwwwwww wwwwwwwwwwwwww wwwwwwwwwwwwww wwwwwwwwwwwwww wwwwwwwwwwwwwwpwwwwwwwwwwwwwwpwwwwwwwwwwwwwwpwwwwwwwwwwwwwwpwwwwwwwwwwwwwwpwwwwwwwvim-7.4.1689/src/VisVim/Res/ToolbarM.bmp000066400000000000000000000013661267703067000175570ustar00rootroot00000000000000BMv(Pwwwpwwwpw"'wwwwpwwwwwpw{wwwwpwwwpppppwp""wwpywp {wp ww ppppw""""'w" www"w",wxppppwx"r'wx" wx+{wx wwpwwpww" w"ww"www"{www,wwpwwwx"rwwx"ywwx"wwwx "pwpp wpww" wpww" wpww" wpww"ww""Gwwx"wwx"wwx"wwx"wx" ww" ww" ww" ww" zww"zwwxzwwxzwwxzwwxwwxwwwwwwwwwwwwwwwwwwwwwwwwxwwwxwwwxwwwxww xww www www www wpwwxwwpwwxwwpwwxwwpwwxwwpwwxwwp p p p p w ww ww ww ww wvim-7.4.1689/src/VisVim/Resource.h000066400000000000000000000014541267703067000165450ustar00rootroot00000000000000//{{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 #define IDC_NEW_TABS 1004 // 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 vim-7.4.1689/src/VisVim/StdAfx.cpp000066400000000000000000000003361267703067000165000ustar00rootroot00000000000000// 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" vim-7.4.1689/src/VisVim/StdAfx.h000066400000000000000000000044521267703067000161500ustar00rootroot00000000000000// 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 // MFC core and standard components #include #include //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 // Developer Studio Object Model #include #include #include #include #include #include #include #include #include ///////////////////////////////////////////////////////////////////////////// // 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) vim-7.4.1689/src/VisVim/UnRegist.bat000066400000000000000000000000441267703067000170270ustar00rootroot00000000000000regsvr32.exe -unregister visvim.dll vim-7.4.1689/src/VisVim/VisVim.cpp000066400000000000000000000060741267703067000165310ustar00rootroot00000000000000// VisVim.cpp : Defines the initialization routines for the DLL. // #include "stdafx.h" #include #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 vim-7.4.1689/src/VisVim/VisVim.def000066400000000000000000000004351267703067000165000ustar00rootroot00000000000000; 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 vim-7.4.1689/src/VisVim/VisVim.dll000066400000000000000000001410001267703067000165070ustar00rootroot00000000000000MZ@ !L!This program cannot be run in DOS mode. $(bkl 8l 8l 8 8m 8l 8 88 8Richl 8PEL>!  \zPcp0!$ p.textZ\ `.rdatap`@@.data-z@.rsrc!"@@.reloc@BD$PjjhlhXh8th  Ð,qÐHtÐ 6hvQÐLVjxMht^ÐÐVD$t V3M^VFldPh h$L^ÐVhL^ÐjhddPd%QVNPLD$D$ L$T$PQRhD$ yL$D$LL$d ^ jhddPd%QV#NPNLD$3t$ELu95ԦtL$D$LL$d ^ÐUjhddPd%VWMPKEjjhEu=ЦEh?hhME EPQrEt$Pdptƃ$6OUVRPh?PEMPW u4MAKjME-KMVQhMi ME KURrtuMEr MEJMe؋d _^]Ð; jhedPd%QDLPoJD$jhD$L$D$ @JL$3d Ð3ÐUjhKedPd%Q SVW3ejds W_^ D$=\pNNFD$NFQF F׍V4R׃LV_3^ S\$UVWu W_^][D$ s3u @_^][ttL$;uy;xuy;xuy ;x t FtH؋F~u%LSPp?uF WhyPVSXp?tT$ D$RPWL$ 9u u_^][SW|$ 3;u W_[Vw;t9tF;tPQ^F;u5`pWR֍G4P֍OLQ֋G;tP0p^_3[D$uW WVUSX3;t5t$u Su 3u jS| {uϋD$|L$t jPx[]^_ D$uWWSX;t1VUl$u Su 3ujS{u]^[3_UMSVWQ hPRt"Qf f\t f/tf:uf:u+^tPQÐD$D$PhjhhD$pu#L$ T$QL$RPhPPPD$(PQpD$tPpD$ÐQT$ D$ L$PD$ QjhjjjRPD$$pD$YÐQD$L$ PD$T$ QL$RjPQD$ pD$ tD$YÐL$T$D$ jPjjQRp@ÐjhfdPd%UVW5P3D$ D$4T$RhrfD$0PD$(D$}P0D$uhtt$$D$0~ F$W*uhTPQT$R!O3n$L$?@UhhWPQ}P/|$,D$WjjhDh4PXt|L$Wjjh$hQ9t]T$WjjhhRt>D$WjjhhАPtL$WjjhhQu*L$ D$A2L$d _^]T$4L$ D$f2L$_^3d ]jhfdPd%QV3P1D$t$D$N f F PQL$F D$1L$3d ^jhgdPd%VWL$ s1L$D$(b1D$uV׋D$H҉D$uUrC_^][L$AW뤋T$BfE돋D$@W뀐4n544444w5X55"5X5w5X5n5X5w5n5w5X5a5n5w5VF=XtL $DD$hP h T$hܣR D$hԣPr hģc = ? $DT$hR3 D$hP$ h T$h`R D$h<P h  T$h R D$hP hܢ T$hĢR D$hP h T$hdR D$hDP h0u T$hRk D$hP\ hM =) $|$0~FD$8F RdL$D$,QXrT$R`rD$,D$tPQL$ D$, L$$_3d ^(QYP L$D$q 3YD$VPhZ`wF`Fd^A jPxrÐA jPxrÐVD$t V ^ VW|$ F`PhW dVhW _^pÐvÐjhhdPd%lSWPP{ D$$jDŽ$C PjL$ L$ D$|T$pD$l utL$pT$lh0 tMVUhWR-pt, PhV  QhV VW]^C jPL$ D$| L$D$| L$t_3d [xjhhdPd%Q$ PO D$jD$LL$D$ " L$3d jhhdPd%Q P D$jD$L$D$ L$3d jhhdPd%Qd P D$3PD$L$D$ V L$3d jh idPd%SVW P D$3ۉ\$0\$$\$ \$D$8T$ RD$4@ PQ`3ɋD$ ;t>L$D$0;t QRD$ ;D$0tPQS\$4`rD$03;É|$L$tL$QhhsPD$ L$3;„D$0t1;D$0t QPD$ L$D$0;t QRD$ D$0>D$ PQR }ID$D$0;tPQD$D$0;tPRD$ D$0;tPQS\$4`rD$L$QP|HL$3;ˉD$8tD$8PhxsQD$8;D$0tT$RPQ(D$8;D$0tPQT$D$ RPL$(5`rQD$0D$;tPRD$D$0;tPQD$ D$0;tPRS\$4։|$0L$L$(_^3d [(D$Vh0t.hV(t Qh$P Vp^Ðjh;idPd%VWL$:D$hPDŽ$4$<T$HQRD$PD$QPhD$WP$4tVL$ WQ 5$rRD$LhtP֊L$T ɍD$Ht8\u/H@u$<T$HQRbPhD$WP~tH$8~wPL$LhlQփ $<D$HRPL$PhWQ6u:T$RL$DŽ$,3$$d _^(jD$ h\P u L$dL$DŽ$,@$$_d ^(ÐVt$Fuhxt7hu)=hQthu3^ÐL$yu.D$hP$rL$jhQjlrÐjh[idPd%$QL$L$jT$ jD$ RPQDŽ$(rL$ɍD$t8\u/H@u=u D$ \u,PT$ D$RP$hPQ$r$$RP$$PhQRL$DŽ$%$d ÐFUjhidPd%Q SVWej(}EEuEtJhԦE8xTp3 ZË}ut3EM0_^d []D$3D$L$ T$PQR`WD$L$T$PD$QL$RPQ`MD$$L$ T$PD$QL$RT$PD$QL$RT$PQR`Y$D$PTpVt$WFPLput?VQ_^D$ L$T$PQhxRg jhidPd%QVWt$8x~hԦD$LpD$#V`p`D$L$ _d ^ÐdjhiPd%3;ȉD$tAP`p`D$¼L$d Ð`馼jhidPd%QV`t$yC3D$FFP\pL$xd ^Ð%r%r%q%q%q%q%q%q%q%q%q%q%q%q%q%q%q%q%q%q%q%q%q%q%q%q%q%q%q%q%q%q%q%q%|q%xq%tq%pq%lq%hq%dq%`q%\q%Xq%Tq%Pq%Lq%Hq%Dq%@q%_8_2_,_&_ ______^pQ Q0Q^^^^^^^^^^^^^^^^\[[[ [@[p[P@MP`M@O@O`O@O@OPPPyrpbpbpb[ [@[p[pbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpb8z_zdF FFF4 }Te++xzyyz(zPzhzpz zd zd {ddd @{e h{{0e;eCe{ {`e |(|eee@|( p|e |e |e |f }0f 8}Pf `}pfxf }ff }f }f ~ffggg X~~0g;g~/ ~Pg ~pg g @g hgg hh h(h @hHhPh phxh @h hh h hhiiii 0i 0Pi Xpi{iZ Ёii i (i Pi xijpp<:rHڇ p lr(p rpHrp\L:,̇|fRF0҆z+YX  LI Q 6  ')V"*X: y7 fO\7@ kW q91H  @ q K RZ \ OARc /D\ʅޅ"0FRb ҈MFC42.DLLI__CxxFrameHandler_purecallmalloc[freesprintf_splitpathB_EH_prologU__dllonexit_onexitMSVCRT.dll _initterm_adjust_fdiv??1type_info@@UAE@XZlstrlenWLDeleteCriticalSectionyInitializeCriticalSectionLeaveCriticalSection~InterlockedIncrementXEnterCriticalSection{InterlockedDecrementMultiByteToWideCharnWideCharToMultiBytelstrlenAGetModuleHandleAGetModuleFileNameAlstrcmpiAlstrcpyAlHeapDestroylstrcatAFormatMessageALocalFreeLocalAllocKERNEL32.dllLoadStringA!CharNextAMessageBoxAEnableWindowUSER32.dllRegCloseKeyRegCreateKeyExA.RegOpenKeyExA6RegQueryValueExAARegSetValueExARegDeleteKeyA#RegEnumKeyExAADVAPI32.dllECoTaskMemFreeStringFromCLSID CoCreateInstanceCLSIDFromProgIDDCoTaskMemAllocole32.dllOLEAUT32.dll>Xhx`VISVIM.dllDllCanUnloadNowDllGetClassObjectDllRegisterServerDllUnregisterServerz_0p8t@P0VisVim.DSAddIn.1VisVim Developer Studio Add-inDescriptionCLSID.tlbSoftwareVisVimLoadVisVimLoadCmdVisVimToggleVisVimToggleCmdVisVimDisableVisVimDisableCmdVisVimEnableVisVimEnableCmdVisVimDialogVisVimDialogCmdCCommandsObj::CreateInstanceIApplication::QueryInterfaceIApplication::AddCommandVisVimUnexpected error (Error code: %lx) %sUnexpected error %s failedssOLE ErrorAn OLE error occured: Code = %s Result = %lx.UNKNOWN SCODEMK_S_MONIKERALREADYREGISTEREDMK_S_USMK_S_HIMMK_S_MEMK_S_REDUCED_TO_SELFCACHE_S_SOMECACHES_NOTUPDATEDCACHE_S_SAMECACHECACHE_S_FORMATETC_NOTSUPPORTEDVIEW_S_ALREADY_FROZENDATA_S_SAMEFORMATETCINPLACE_S_TRUNCATEDOLEOBJ_S_INVALIDHWNDOLEOBJ_S_CANNOT_DOVERB_NOWOLEOBJ_S_INVALIDVERBDRAGDROP_S_USEDEFAULTCURSORSDRAGDROP_S_CANCELCONVERT10_S_NO_PRESENTATIONDRAGDROP_S_DROPOLE_S_USEREGOLE_S_STATICOLE_S_MAC_CLIPFORMATSTG_S_CONVERTEDS_FALSES_OKE_INVALIDARGE_OUTOFMEMORYE_HANDLEE_ACCESSDENIEDMK_E_NOPREFIXMK_E_NOSTORAGEMK_E_NOINVERSEMK_E_MUSTBOTHERUSERMK_E_CANTOPENFILEMK_E_NOTBOUNDMK_E_NOTBINDABLEMK_E_INTERMEDIATEINTERFACENOTSUPPORTEDMK_E_INVALIDEXTENSIONMK_E_NOOBJECTMK_E_SYNTAXMK_E_UNAVAILABLEMK_E_NEEDGENERICMK_E_EXCEEDEDDEADLINEMK_E_CONNECTMANUALLYCO_E_APPDIDNTREGCO_E_OBJNOTCONNECTEDCO_E_OBJISREGCO_E_OBJNOTREGCO_E_WRONGOSFORAPPCO_E_ERRORINDLLCO_E_DLLNOTFOUNDCO_E_ERRORINAPPCO_E_APPSINGLEUSECO_E_APPNOTFOUNDCO_E_IIDSTRINGCO_E_CLASSSTRINGCO_E_CANTDETERMINECLASSCO_E_ALREADYINITIALIZEDCO_E_NOTINITIALIZEDCLIPBRD_E_CANT_CLOSECLIPBRD_E_BAD_DATACLIPBRD_E_CANT_SETCLIPBRD_E_CANT_EMPTYCLIPBRD_E_CANT_OPENCONVERT10_E_STG_DIB_TO_BITMAPCONVERT10_E_STG_NO_STD_STREAMCONVERT10_E_STG_FMTCONVERT10_E_OLESTREAM_BITMAP_TO_DIBCONVERT10_E_OLESTREAM_FMTCONVERT10_E_OLESTREAM_PUTCONVERT10_E_OLESTREAM_GETINPLACE_E_NOTOOLSPACEINPLACE_E_NOTUNDOABLEOLEOBJ_E_NOVERBSOLEOBJ_E_INVALIDVERBCACHE_E_NOCACHE_UPDATEDREGDB_E_IIDNOTREGREGDB_E_CLASSNOTREGREGDB_E_INVALIDVALUEREGDB_E_KEYMISSINGREGDB_E_WRITEREGDBREGDB_E_READREGDBVIEW_E_DRAWCLASS_E_CLASSNOTAVAILABLECLASS_E_NOAGGREGATIONDRAGDROP_E_ALREADYREGISTEREDDRAGDROP_E_INVALIDHWNDDRAGDROP_E_NOTREGISTEREDDV_E_NOIVIEWOBJECTDV_E_DVTARGETDEVICE_SIZEDV_E_DVASPECTDV_E_CLIPFORMATDV_E_TYMEDDV_E_LINDEXDV_E_STATDATADV_E_STGMEDIUMDV_E_DVTARGETDEVICEDV_E_FORMATETCOLE_E_NOSTORAGEOLE_E_CANTCONVERTOLE_E_NOT_INPLACEACTIVEOLE_E_INVALIDHWNDOLE_E_WRONGCOMPOBJOLE_E_INVALIDRECTOLE_E_PROMPTSAVECANCELLEDOLE_E_STATICOLE_E_CANT_BINDTOSOURCEOLE_E_CANT_GETMONIKEROLE_E_CLASSDIFFOLE_E_BLANKOLE_E_NOCACHEOLE_E_NOTRUNNINGOLE_E_NOCONNECTIONOLE_E_ADVISENOTSUPPORTEDOLE_E_ENUM_NOMOREOLE_E_ADVFOLE_E_OLEVERBSTG_E_EXTANTMARSHALLINGSSTG_E_NOTFILEBASEDSTORAGESTG_E_SHAREREQUIREDSTG_E_OLDDLLSTG_E_OLDFORMATSTG_E_CANTSAVESTG_E_REVERTEDSTG_E_NOTCURRENTSTG_E_INUSESTG_E_INVALIDFLAGSTG_E_UNIMPLEMENTEDFUNCTIONSTG_E_UNKNOWNSTG_E_INVALIDNAMESTG_E_INVALIDHEADERSTG_E_ABNORMALAPIEXITSTG_E_MEDIUMFULLSTG_E_INVALIDPARAMETERSTG_E_FILEALREADYEXISTSSTG_E_LOCKVIOLATIONSTG_E_SHAREVIOLATIONSTG_E_READFAULTSTG_E_WRITEFAULTSTG_E_SEEKERRORSTG_E_DISKISWRITEPROTECTEDSTG_E_NOMOREFILESSTG_E_INVALIDPOINTERSTG_E_INSUFFICIENTMEMORYSTG_E_INVALIDHANDLESTG_E_ACCESSDENIEDSTG_E_TOOMANYOPENFILESSTG_E_PATHNOTFOUNDSTG_E_FILENOTFOUNDSTG_E_INVALIDFUNCTIONTYPE_E_INCONSISTENTPROPFUNCSTYPE_E_CIRCULARTYPETYPE_E_CANTLOADLIBRARYTYPE_E_OUTOFBOUNDSTYPE_E_IOERRORTYPE_E_CANTCREATETMPFILETYPE_E_TYPEMISMATCHTYPE_E_SIZETOOBIGTYPE_E_DUPLICATEIDTYPE_E_BADMODULEKINDTYPE_E_DLLFUNCTIONNOTFOUNDTYPE_E_UNKNOWNLCIDTYPE_E_NAMECONFLICTTYPE_E_AMBIGUOUSNAMETYPE_E_ELEMENTNOTFOUNDTYPE_E_WRONGTYPEKINDTYPE_E_INVALIDSTATETYPE_E_QUALIFIEDNAMEDISALLOWEDTYPE_E_UNDEFINEDTYPETYPE_E_LIBNOTREGISTEREDTYPE_E_REGISTRYACCESSTYPE_E_UNSUPFORMATTYPE_E_INVDATAREADTYPE_E_BUFFERTOOSMALLDISP_E_NOTACOLLECTIONDISP_E_BADCALLEEDISP_E_PARAMNOTOPTIONALDISP_E_BADPARAMCOUNTDISP_E_ARRAYISLOCKEDDISP_E_UNKNOWNLCIDDISP_E_BADINDEXDISP_E_OVERFLOWDISP_E_EXCEPTIONDISP_E_BADVARTYPEDISP_E_NONAMEDARGSDISP_E_UNKNOWNNAMEDISP_E_TYPEMISMATCHDISP_E_PARAMNOTFOUNDDISP_E_MEMBERNOTFOUNDDISP_E_UNKNOWNINTERFACERPC_E_UNEXPECTEDRPC_E_CANTCALLOUT_AGAINRPC_E_INVALID_PARAMETERRPC_E_INVALID_DATARPC_E_SERVER_CANTUNMARSHAL_DATARPC_E_SERVER_CANTMARSHAL_DATARPC_E_CLIENT_CANTUNMARSHAL_DATARPC_E_CLIENT_CANTMARSHAL_DATARPC_E_CANTTRANSMIT_CALLRPC_E_INVALID_DATAPACKETRPC_E_CLIENT_DIEDRPC_E_SERVER_DIEDRPC_E_CONNECTION_TERMINATEDRPC_E_CANTCALLOUT_INEXTERNALCALLRPC_E_CANTCALLOUT_INASYNCCALLRPC_E_CANTPOST_INSENDCALLRPC_E_CALL_CANCELEDRPC_E_CALL_REJECTEDE_UNEXPECTEDE_FAILE_ABORTE_POINTERE_NOINTERFACEChangeDirDevStudioEditorEnableVimVimXApplicationEventsObj::CreateInstanceSetForeground:%d :drop %S sSendKeysVim.ApplicationThere is no registered OLE automation server named "Vim.Application". Use the OLE-enabled version of Vim with VisVim and make sure to register Vim by running "vim -register".:cd %s%s%s ..rsa\y.?AVCNoTrackObject@@\y.?AVAFX_MODULE_STATE@@\y.?AV_AFX_DLL_MODULE_STATE@@\y.?AVtype_info@@8Pp0 H X h x   h DTYPELIB(Pwwwpwwwpw"'wwwwpwwwwwpw{wwwwpwwwpppppwp""wwpywp {wp ww ppppw""""'w" www"w",wxppppwx"r'wx" wx+{wx wwpwwpww" w"ww"www"{www,wwpwwwx"rwwx"ywwx"wwwx "pwpp wpww" wpww" wpww" wpww"ww""Gwwx"wwx"wwx"wwx"wx" ww" ww" ww" ww" zww"zwwxzwwxzwwxzwwxwwxwwwwwwwwwwwwwwwwwwwwwwwwxwwwxwwwxwwwxww xww www www www wpwwxwwpwwxwwpwwxwwpwwxwwpwwxwwp p p p p w ww ww ww ww w(  wwwwwwwpwwwwwwwwwwwwwwpwpwwwwwwwwwwwpwwwwwwwwwwwwpwwwwwwwwwwwwwwpwwwwwwwwww@wwwwwwwwwwwwww@w wwwwwwwwwww@wpwwpwwwwwww@wpwwpwwwwwwwww@wwwwwwwpwwwwwwwp"$""wwwwwwwp"$pw wwwwp"$wwpwwwwwp"$wwwpxwwpwwwpwwwpxw"""" wwwwwpxw""@w pwwpxw""@wwwpxw""@wwww wwwwwwww"" ""wwwww"""$p wwww""" www"" wwwx"ppppwwwwx"" @w wwwwwx""""@w wwwwx"" wwwx"" wwwwptppwwwww"""$p"wwwww"""$ wwwww"" wwww" wwwwxpwDwpwwwwwx""""@w wwwwwx""""@ wwwwwx"" wwwwwx" wwwwwwwwwwwwwwww"""$wwwwww""" pwwwww""$pwwwwww""$wwwwwxwwwpwwwwwwx""""@wpwwwwwx"" w wwwwwx"" "@pwwwwwwwx"""wwwwww wwwwwww"""$wpwwwwww""$pwwwwww"""$wwwwwwww"""wwwwwwpw"""@wwwwwwwwx""""@wwwwwwwwx""""@wwwwwwwx""""@wwwwwwwwx"""wpwwwwpw"""$wwpwwwww"""$wwpwwwww"""$wwpwwwww"""$wwpwwwww"""$ww wwwww""""@ww wwwwwx""""@ww wwwwwx""""@ww wwwwwx""""@ww wwwwwx""""@wpwwwwx""""$pwwwww"""$pwwwww"""$pwwwww"""$pwwwww"""$ "wwwww""""@ "wwwwwx""""@ "wwwwwx""""@ "wwwwwx""""@ "wwwwwx""""@ "wwwwx""""@ "wwwww"""@ "wwwww"""@ "wwwww"""@ "wwwww"""@pwwwww""$pwwwwwx""$pwwwwwx""$pwwwwwx""$pwwwwwx""$w wwwwx""@ww wwwww"@ww wwwww"@ww wwwww"@ww wwwww"@wwpwww ww$wwpwww wwx$wwpwww wwx$wwpwww wwx$wwpwww wwx$wwwwww"wx@wwwwwww"wwwwwwwww"wwwwwwwww"wwwwwwwww"wwwwwwwww" wwwwwwwww" wwxwwwwwww" wwxwwwwwww" wwxwwwwwww" wwxwwwwwww""wxwwwwwww""wwwwwwww""wwwwwwww""wwwwwwww""wwwwwwww"" wwwwwwww"" wwxwwwwww"" wwxwwwwww"" wwxwwwwww"" wwxwwwwww"""wwxwwwwww"""wwwwwwww"""wwwwwwww"""wwwwwwww"""wwwwwwww"" wwwwwww"" wwwwwww"" wwwwwww"" wwwwwww"" wwwpwwwww""wwwxwpwwwww""wwwxwpwwwww""wwwxwpwwwww""wwwxwpwwwww""wwwxwwwwwwp" wwwwwwwwwwp" wwwxwwwwwwp" wwwxwwwwwwp" wwwxwwwwwwp" wwwxw"ww"ww"ww"ww"wwp*wwp*wwp*wwp*wwp*wwwwwwww wwwwwwwwwwwwww wwwwwwwwwwwwww wwwwwwwwwwwwww wwwwwwwwwwwwww wwwwwwwwwwwwwwpwwwwwwwwwwwwwwpwwwwwwwwwwwwwwpwwwwwwwwwwwwwwpwwwwwwwwwwwwwwpwwwwwww4VS_VERSION_INFO?"StringFileInfo040904b0 CompanyName> FileDescriptionVisVim DLL6 FileVersion1, 1, 0, 1.InternalNameVisVimJLegalCopyrightCopyright (C) 1998> OriginalFilenameVisVim.DLLXProductNameVisVim Dynamic Link Library: ProductVersion1, 1, 0, 1DVarFileInfo$Translation Ȁ|Vim Add-In 1.3aMS Sans SerifP &Open file in DevStudio editor simultaneouslyP#:Current directory P1U Set to &source file path P? Set to &parent directory of source file path PN? Do &not changePfJ&OkPafJ&CancelMSFT A q d,T$Ll0d   4!$H@0%!`%!x%! 0Hgrw)`0FFgrw)`grw)`dgrw)` ϳMBTxJNBT grw)`,04dY604dY` 04-stdole2.tlbWWW )devshl.dll )devdbg.pkgDx,\VisVimWW 8ICommandsWWW UgVisVimDialog !VisVimEnable VisVimDisableWWW VisVimToggle VisVimLoadWWd8Commands80ApplicationEventsWWW,8ADebuggerEventsWWVisVim Developer Studio Add-inx4  4 $4 (4 ,4 ````,D\x0H`Vim Developer Studio Add-InAAllows integration of Vim as the text editor in Developer Studio.V Vim Add-In Dialog Displays the options dialog box of the Vim Add-In Vim Add-In DialogH Enable Vim Add-In Enables Vim as Visual Studio editor Enable Vim Add-InK Disable Vim Add-In Disables Vim as Visual Studio editor Disable Vim Add-In[ Toggle Vim Add-In State Toggles the enable state of the Vim Add-In Toggle Vim Add-In StateT Vim Add-In Load Document Loads the current document in Vim Vim Add-In Load Document 0000Q0a00000(12171=1d1111'2f222222K3i333F44444444?555555556)6<6B6667777)7W7\7p77777#8@8H8\8t8888&9G9e9s9999999999 :0:x:~: ;;;;V<<<<<%=p==========>C>>? ?7?S?q???? 0X000[1p111U2s3334b4 5555N6n677778#8>8E8888h9{9999&:W:s::: ;w;|;;;;;;;;;s<<==4>>>>>>????6??????0 0N0l000000#1A1X1r11111S2h2s222)4q445T55555"6l6p6t6x6|666666666666666666666 77'727]7f7u7777777777788 8.8=8H8s8|8888888888999+969D9S9w9|999999999 ::$:3:>:L:v:::::::;;+;X;_;h;w;;;;;;;;;;;<<"> >/>:>H>W>b>p>>>>>>>>>???C?Q?`??????????@ 000>0M0l0z00000000011!1/1>1I1W1f1q11111111111222.292G2V2a2o2~222222222 3&343S3^3333333333444)454=4H4T4\4g4s4{444444444444444555 55555 5$5(5,5054585<5@5D5H5L5P5T5X5\5`5d5h5l5p5t5x5|555555555555555555555555555555666 6$6(6,6064686<6@6D6H6L6P6T6X6\6`6d6h6l6p6t6x6|666666666666666666666666666666666777 77777 7$7(7,7074787<7@7D7H7L7P7T7X7\7`7d7h7l7p7t7x77777777777777777789%9D9H9L9P9T9X9\9`9d999<:@:D:H:L:P:T:X:\:`:d:h:l:p::(;3;K;U;m;;;;;;&>>>>c???Px 0/0}001(18111122C2I2O2d2p2~22222S333#444x555v6{6666666.7I7l7v7777R8888899-969S9999999%:a:v:::::0;Z;;;;<3>>>> >&>,>2>8>>>D>J>P>V>\>b>h>n>t>z>>>>>>>>>>>>>>>>>>>>>>>? ????"?(?.?4?:?@?F?L?R?X?^?d?j?p?v????????`0060_000,1>1111111222r222222222222233%333<3c333"4(4.444:4@4F4L4R4X4^4d4j4p4v4|44444445L5i55555696\666667D7Y7y777718Y88888!9<9\999999 :pH4L4h4l4p4t4x4|4444444444444444444444444444444445555555 5(5,5054585@5D5H5L5P5X5p5t5x5|55555555X6\6`6d6h6l6p6t6x6|66666666666666666777 77777 7$7(7,7074787<7@7D7H7L7P7T7X7\7`7d7h7l7p7t7x7|777777777777777777777777777777777888 88888 8$8(8,8084888<8@8D8H8L8P8T8X8\8`8d8h8l8p8t8x8|88888888888888888888888999 99999 9$9(9,9094989<9@9D9H9P9T9X9\999::: :4:D:H:P:h:|:::::::: ;;;(;D;P;X;t;|;;;;;;;; <<$<8>$>,>4>@>H>d>l>>>>>>>??(?D?P?l?t???????????T00(0D0P0l0x0000000000 1141@1H1d1l111111122,282T2`2|2200 0 0$0(0,08022`5d5t5x5555vim-7.4.1689/src/VisVim/VisVim.h000066400000000000000000000017611267703067000161740ustar00rootroot00000000000000// 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 #include #include #include #include // // 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) vim-7.4.1689/src/VisVim/VisVim.mak000066400000000000000000000116341267703067000165150ustar00rootroot00000000000000# 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 vim-7.4.1689/src/VisVim/VisVim.odl000066400000000000000000000025661267703067000165270ustar00rootroot00000000000000// 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}} }; vim-7.4.1689/src/VisVim/VisVim.rc000066400000000000000000000132041267703067000163440ustar00rootroot00000000000000//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 CONTROL "Open files in new tabs", IDC_NEW_TABS,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,7,21,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 ¬ 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 vim-7.4.1689/src/VisVim/VsReadMe.txt000066400000000000000000000065551267703067000170230ustar00rootroot00000000000000======================================================================== 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. vim-7.4.1689/src/alloc.h000066400000000000000000000007401267703067000146300ustar00rootroot00000000000000/* 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. */ /* * alloc.h: enumeration of alloc IDs. * Each entry must be on exactly one line, GetAllocId() depends on that. */ typedef enum { aid_none = 0, aid_qf_dirname_start, aid_qf_dirname_now, aid_qf_namebuf, aid_qf_errmsg, aid_qf_pattern, aid_last } alloc_id_T; vim-7.4.1689/src/appveyor.bat000066400000000000000000000041301267703067000157170ustar00rootroot00000000000000@echo off :: Batch file for building/testing Vim on AppVeyor setlocal ENABLEDELAYEDEXPANSION cd %APPVEYOR_BUILD_FOLDER% cd src echo "Building MinGW 32bit console version" set PATH=c:\msys64\mingw32\bin;%PATH% mingw32-make.exe -f Make_ming.mak GUI=no OPTIMIZE=speed IME=yes MBYTE=yes ICONV=yes DEBUG=no FEATURES=%FEATURE% || exit 1 :: Save vim.exe before Make clean, moved back below. copy vim.exe testdir mingw32-make.exe -f Make_ming.mak clean :: Build Mingw huge version with python and channel support, or :: with specified features without python. echo "Building MinGW 32bit GUI version" if "%FEATURE%" == "HUGE" ( mingw32-make.exe -f Make_ming.mak OPTIMIZE=speed CHANNEL=yes GUI=yes IME=yes MBYTE=yes ICONV=yes DEBUG=no PYTHON_VER=27 DYNAMIC_PYTHON=yes PYTHON=C:\Python27 PYTHON3_VER=34 DYNAMIC_PYTHON3=yes PYTHON3=C:\Python34 FEATURES=%FEATURE% || exit 1 ) ELSE ( mingw32-make.exe -f Make_ming.mak OPTIMIZE=speed GUI=yes IME=yes MBYTE=yes ICONV=yes DEBUG=no FEATURES=%FEATURE% || exit 1 ) .\gvim -u NONE -c "redir @a | ver |0put a | wq" ver_ming.txt echo "Building MSVC 64bit console Version" sed -e "s/\$(LINKARGS2)/\$(LINKARGS2) | sed -e 's#.*\\\\r.*##'/" Make_mvc.mak > Make_mvc2.mak nmake -f Make_mvc2.mak CPU=AMD64 OLE=no GUI=no IME=yes MBYTE=yes ICONV=yes DEBUG=no FEATURES=%FEATURE% || exit 1 nmake -f Make_mvc2.mak clean :: build MSVC huge version with python and channel support :: GUI needs to be last, so that testing works echo "Building MSVC 64bit GUI Version" if "%FEATURE%" == "HUGE" ( nmake -f Make_mvc2.mak DIRECTX=yes CPU=AMD64 CHANNEL=yes OLE=no GUI=yes IME=yes MBYTE=yes ICONV=yes DEBUG=no PYTHON_VER=27 DYNAMIC_PYTHON=yes PYTHON=C:\Python27-x64 PYTHON3_VER=34 DYNAMIC_PYTHON3=yes PYTHON3=C:\Python34-x64 FEATURES=%FEATURE% || exit 1 ) ELSE ( nmake -f Make_mvc2.mak CPU=AMD64 OLE=no GUI=yes IME=yes MBYTE=yes ICONV=yes DEBUG=no FEATURES=%FEATURE% || exit 1 ) .\gvim -u NONE -c "redir @a | ver |0put a | wq" ver_msvc.txt :: Restore vim.exe, tests will run with this. move /Y testdir\vim.exe . echo "version output MinGW" type ver_ming.txt echo "version output MVC" type ver_msvc.txt cd .. vim-7.4.1689/src/arabic.c000066400000000000000000000501501267703067000147520ustar00rootroot00000000000000/* 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(int cur_c); static int A_is_s(int cur_c); static int A_is_f(int cur_c); static int chg_c_a2s(int cur_c); static int chg_c_a2i(int cur_c); static int chg_c_a2m(int cur_c); static int chg_c_a2f(int cur_c); static int chg_c_i2m(int cur_c); static int chg_c_f2m(int cur_c); static int chg_c_laa2i(int hid_c); static int chg_c_laa2f(int hid_c); static int half_shape(int c); static int A_firstc_laa(int c1, int c); static int A_is_harakat(int c); static int A_is_iso(int c); static int A_is_formb(int c); static int A_is_ok(int c); static int A_is_valid(int c); static int A_is_special(int c); /* * Returns True if c is an ISO-8859-6 shaped ARABIC letter (user entered) */ static int A_is_a(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(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(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(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(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(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(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(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(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(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(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(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( 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 + 1]; /* 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( 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(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(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(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(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(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(int c) { return (c == a_HAMZA || c == a_s_HAMZA); } vim-7.4.1689/src/arabic.h000066400000000000000000000151211267703067000147560ustar00rootroot00000000000000/* 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 categorized 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) vim-7.4.1689/src/ascii.h000066400000000000000000000112421267703067000146250ustar00rootroot00000000000000/* 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 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_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 /* CTRL- [ Left Square Bracket == ESC*/ #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" #define POUND 0xB1 #define CTRL_F_STR "\056" #define CTRL_H_STR "\026" #define CTRL_V_STR "\062" #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 /* CTRL- [ Left Square Bracket == ESC*/ #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 */ /* TODO: EBCDIC Code page dependent (here 1047) */ #define CSI 0x9b /* Control Sequence Introducer */ #define CSI_STR "\233" #define DCS 0x90 /* Device Control String */ #define OSC 0x9d /* Operating System Command */ #define STERM 0x9c /* String Terminator */ /* * 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 Acorn we use a dot. */ #ifdef BACKSLASH_IN_FILENAME # define PATHSEP psepc # define PATHSEPSTR pseps #else # define PATHSEP '/' # define PATHSEPSTR "/" #endif vim-7.4.1689/src/auto/000077500000000000000000000000001267703067000143345ustar00rootroot00000000000000vim-7.4.1689/src/auto/configure000077500000000000000000015414261267703067000162600ustar00rootroot00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="vim.h" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='LTLIBOBJS LIBOBJS LINK_AS_NEEDED DEPEND_CFLAGS_FILTER MAKEMO MSGFMT INSTALL_TOOL_LANGS INSTALL_LANGS TAGPRG HANGULIN_OBJ HANGULIN_SRC GUI_X_LIBS GUITYPE GUI_LIB_LOC GUI_INC_LOC NARROW_PROTO MOTIF_LIBNAME GRESOURCE_OBJ GRESOURCE_SRC GLIB_COMPILE_RESOURCES GNOME_INCLUDEDIR GNOME_LIBDIR GNOME_LIBS GTK_LIBNAME GTK_LIBS GTK_CFLAGS PKG_CONFIG X_LIB X_EXTRA_LIBS X_LIBS X_PRE_LIBS X_CFLAGS XMKMF xmkmfpath CHANNEL_OBJ CHANNEL_SRC NETBEANS_OBJ NETBEANS_SRC WORKSHOP_OBJ WORKSHOP_SRC RUBY_LIBS RUBY_CFLAGS RUBY_PRO RUBY_OBJ RUBY_SRC vi_cv_path_ruby TCL_LIBS TCL_CFLAGS TCL_PRO TCL_OBJ TCL_SRC vi_cv_path_tcl PYTHON3_OBJ PYTHON3_SRC PYTHON3_CFLAGS PYTHON3_LIBS PYTHON3_CONFDIR vi_cv_path_python3 PYTHON_OBJ PYTHON_SRC PYTHON_CFLAGS PYTHON_GETPATH_CFLAGS PYTHON_LIBS PYTHON_CONFDIR vi_cv_path_python PERL_LIBS PERL_CFLAGS PERL_PRO PERL_OBJ PERL_SRC shrpenv vi_cv_perl_xsubpp vi_cv_perllib vi_cv_path_perl MZSCHEME_MZC MZSCHEME_EXTRA MZSCHEME_CFLAGS MZSCHEME_LIBS MZSCHEME_PRO MZSCHEME_OBJ MZSCHEME_SRC vi_cv_path_mzscheme LUA_CFLAGS LUA_LIBS LUA_PRO LUA_OBJ LUA_SRC vi_cv_path_plain_lua vi_cv_path_luajit vi_cv_path_lua compiledby dogvimdiff dovimdiff QUOTESED line_break VIEWNAME EXNAME VIMNAME OS_EXTRA_OBJ OS_EXTRA_SRC XCODE_SELECT CPP_MM STRIP AWK FGREP EGREP GREP CPP OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC SET_MAKE target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_fail_if_missing enable_darwin with_mac_arch with_developer_dir with_local_dir with_vim_name with_ex_name with_view_name with_global_runtime with_modified_by enable_smack enable_selinux with_features with_compiledby enable_xsmp enable_xsmp_interact enable_luainterp with_lua_prefix with_luajit enable_mzschemeinterp with_plthome enable_perlinterp enable_pythoninterp with_python_config_dir enable_python3interp with_python3_config_dir enable_tclinterp with_tclsh enable_rubyinterp with_ruby_command enable_cscope enable_workshop enable_netbeans enable_channel enable_multibyte enable_hangulinput enable_xim enable_fontset with_x enable_gui enable_gtk2_check enable_gnome_check enable_gtk3_check enable_motif_check enable_athena_check enable_nextaw_check enable_carbon_check enable_gtktest with_gnome_includes with_gnome_libs with_gnome with_motif_lib with_tlib enable_largefile enable_acl enable_gpm enable_sysmouse enable_nls ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP XMKMF' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= 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=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -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_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$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 ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$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 | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$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 ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) 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 | -n) 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 ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$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_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=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 ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # 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 the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` 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 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # 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 <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF X features: --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-fail-if-missing Fail if dependencies on additional features specified on the command line are missing. --disable-darwin Disable Darwin (Mac OS X) support. --disable-smack Do not check for Smack support. --disable-selinux Do not check for SELinux support. --disable-xsmp Disable XSMP session management --disable-xsmp-interact Disable XSMP interaction --enable-luainterp=OPTS Include Lua interpreter. default=no OPTS=no/yes/dynamic --enable-mzschemeinterp Include MzScheme interpreter. --enable-perlinterp=OPTS Include Perl interpreter. default=no OPTS=no/yes/dynamic --enable-pythoninterp=OPTS Include Python interpreter. default=no OPTS=no/yes/dynamic --enable-python3interp=OPTS Include Python3 interpreter. default=no OPTS=no/yes/dynamic --enable-tclinterp=OPTS Include Tcl interpreter. default=no OPTS=no/yes/dynamic --enable-rubyinterp=OPTS Include Ruby interpreter. default=no OPTS=no/yes/dynamic --enable-cscope Include cscope interface. --enable-workshop Include Sun Visual Workshop support. --disable-netbeans Disable NetBeans integration support. --disable-channel Disable process communication support. --enable-multibyte Include multibyte editing support. --enable-hangulinput Include Hangul input support. --enable-xim Include XIM input support. --enable-fontset Include X fontset output support. --enable-gui=OPTS X11 GUI default=auto OPTS=auto/no/gtk2/gnome2/gtk3/motif/athena/neXtaw/photon/carbon --enable-gtk2-check If auto-select GUI, check for GTK+ 2 default=yes --enable-gnome-check If GTK GUI, check for GNOME default=no --enable-gtk3-check If auto-select GUI, check for GTK+ 3 default=yes --enable-motif-check If auto-select GUI, check for Motif default=yes --enable-athena-check If auto-select GUI, check for Athena default=yes --enable-nextaw-check If auto-select GUI, check for neXtaw default=yes --enable-carbon-check If auto-select GUI, check for Carbon default=yes --disable-gtktest Do not try to compile and run a test GTK program --disable-largefile omit support for large files --disable-acl Don't check for ACL support. --disable-gpm Don't use gpm (Linux mouse daemon). --disable-sysmouse Don't use sysmouse (mouse in *BSD console). --disable-nls Don't support NLS (gettext()). Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-mac-arch=ARCH current, intel, ppc or both --with-developer-dir=PATH use PATH as location for Xcode developer tools --with-local-dir=PATH search PATH instead of /usr/local for local libraries. --without-local-dir do not search /usr/local for local libraries. --with-vim-name=NAME what to call the Vim executable --with-ex-name=NAME what to call the Ex executable --with-view-name=NAME what to call the View executable --with-global-runtime=DIR global runtime directory in 'runtimepath' --with-modified-by=NAME name of who modified a release version --with-features=TYPE tiny, small, normal, big or huge (default: normal) --with-compiledby=NAME name to show in :version message --with-lua-prefix=PFX Prefix where Lua is installed. --with-luajit Link with LuaJIT instead of Lua. --with-plthome=PLTHOME Use PLTHOME. --with-python-config-dir=PATH Python's config directory --with-python3-config-dir=PATH Python's config directory --with-tclsh=PATH which tclsh to use (default: tclsh8.0) --with-ruby-command=RUBY name of the Ruby command (default: ruby) --with-x use the X Window System --with-gnome-includes=DIR Specify location of GNOME headers --with-gnome-libs=DIR Specify location of GNOME libs --with-gnome Specify prefix for GNOME files --with-motif-lib=STRING Library for Motif --with-tlib=library terminal library to be used Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor XMKMF Path to xmkmf, Makefile generator for X Window System Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* 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_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_find_uintX_t LINENO BITS VAR # ------------------------------------ # Finds an unsigned integer type with width BITS, setting cache variable VAR # accordingly. ac_fn_c_find_uintX_t () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 $as_echo_n "checking for uint$2_t... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ 'unsigned long long int' 'unsigned short int' 'unsigned char'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : case $ac_type in #( uint$2_t) : eval "$3=yes" ;; #( *) : eval "$3=\$ac_type" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if eval test \"x\$"$3"\" = x"no"; then : else break fi done fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_find_uintX_t # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES # -------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes # INCLUDES, setting VAR accordingly. Returns whether the value could be # computed ac_fn_c_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid; break else as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=$ac_mid; break else as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid else as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; '') ac_retval=1 ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 static long int longval () { return $2; } static unsigned long int ulongval () { return $2; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (($2) < 0) { long int i = longval (); if (i != ($2)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ($2)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : echo >>conftest.val; read $3 auto/config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>auto/config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers auto/config.h:config.h.in" $as_echo "#define UNIX 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_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 $# != 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 ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "" >/dev/null 2>&1; then : fi rm -f conftest* { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5 $as_echo_n "checking for library containing strerror... " >&6; } if ${ac_cv_search_strerror+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char strerror (); int main () { return strerror (); ; return 0; } _ACEOF for ac_lib in '' cposix; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_strerror=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_strerror+:} false; then : break fi done if ${ac_cv_search_strerror+:} false; then : else ac_cv_search_strerror=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_strerror" >&5 $as_echo "$ac_cv_search_strerror" >&6; } ac_res=$ac_cv_search_strerror if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi for ac_prog in gawk mawk 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":" fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #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)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 $as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } if ${ac_cv_header_sys_wait_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned int) (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; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_sys_wait_h=yes else ac_cv_header_sys_wait_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5 $as_echo "$ac_cv_header_sys_wait_h" >&6; } if test $ac_cv_header_sys_wait_h = yes; then $as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-fail-if-missing argument" >&5 $as_echo_n "checking --enable-fail-if-missing argument... " >&6; } # Check whether --enable-fail_if_missing was given. if test "${enable_fail_if_missing+set}" = set; then : enableval=$enable_fail_if_missing; fail_if_missing="yes" else fail_if_missing="no" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fail_if_missing" >&5 $as_echo "$fail_if_missing" >&6; } if test -z "$CFLAGS"; then CFLAGS="-O" test "$GCC" = yes && CFLAGS="-O2 -fno-strength-reduce -Wall" fi if test "$GCC" = yes; then gccversion=`$CC -dumpversion` if test "x$gccversion" = "x"; then gccversion=`$CC --version | sed -e '2,$d' -e 's/darwin.//' -e 's/^[^0-9]*\([0-9]\.[0-9.]*\).*$/\1/g'` fi if test "$gccversion" = "3.0.1" -o "$gccversion" = "3.0.2" -o "$gccversion" = "4.0.1"; then echo 'GCC [34].0.[12] 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for recent clang version" >&5 $as_echo_n "checking for recent clang version... " >&6; } CLANG_VERSION_STRING=`$CC --version 2>/dev/null | sed -n -e 's/^.*clang.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$/\1/p'` if test x"$CLANG_VERSION_STRING" != x"" ; then CLANG_MAJOR=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/\([0-9][0-9]*\)\.[0-9][0-9]*\.[0-9][0-9]*/\1/p'` CLANG_MINOR=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/[0-9][0-9]*\.\([0-9][0-9]*\)\.[0-9][0-9]*/\1/p'` CLANG_REVISION=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\)/\1/p'` CLANG_VERSION=`expr $CLANG_MAJOR '*' 1000000 '+' $CLANG_MINOR '*' 1000 '+' $CLANG_REVISION` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CLANG_VERSION" >&5 $as_echo "$CLANG_VERSION" >&6; } if test "$CLANG_VERSION" -ge 500002075 ; then CFLAGS=`echo "$CFLAGS" | sed -n -e 's/-fno-strength-reduce/ /p'` fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$cross_compiling" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot compile a simple program; if not cross compiling check CC and CFLAGS" >&5 $as_echo "cannot compile a simple program; if not cross compiling check CC and CFLAGS" >&6; } fi test "$GCC" = yes && CPP_MM=M; if test -f ./toolcheck; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for buggy tools..." >&5 $as_echo "$as_me: checking for buggy tools..." >&6;} sh ./toolcheck 1>&6 fi OS_EXTRA_SRC=""; OS_EXTRA_OBJ="" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BeOS" >&5 $as_echo_n "checking for BeOS... " >&6; } case `uname` in BeOS) OS_EXTRA_SRC=os_beos.c; OS_EXTRA_OBJ=objects/os_beos.o BEOS=yes; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; };; *) BEOS=no; { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; };; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for QNX" >&5 $as_echo_n "checking for QNX... " >&6; } 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; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; };; *) QNX=no; { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; };; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Darwin (Mac OS X)" >&5 $as_echo_n "checking for Darwin (Mac OS X)... " >&6; } if test "`(uname) 2>/dev/null`" = Darwin; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking --disable-darwin argument" >&5 $as_echo_n "checking --disable-darwin argument... " >&6; } # Check whether --enable-darwin was given. if test "${enable_darwin+set}" = set; then : enableval=$enable_darwin; else enable_darwin="yes" fi if test "$enable_darwin" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Darwin files are there" >&5 $as_echo_n "checking if Darwin files are there... " >&6; } if test -f os_macosx.m; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, Darwin support disabled" >&5 $as_echo "no, Darwin support disabled" >&6; } enable_darwin=no fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, Darwin support excluded" >&5 $as_echo "yes, Darwin support excluded" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-mac-arch argument" >&5 $as_echo_n "checking --with-mac-arch argument... " >&6; } # Check whether --with-mac-arch was given. if test "${with_mac_arch+set}" = set; then : withval=$with_mac_arch; MACARCH="$withval"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MACARCH" >&5 $as_echo "$MACARCH" >&6; } else MACARCH="current"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: defaulting to $MACARCH" >&5 $as_echo "defaulting to $MACARCH" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-developer-dir argument" >&5 $as_echo_n "checking --with-developer-dir argument... " >&6; } # Check whether --with-developer-dir was given. if test "${with_developer_dir+set}" = set; then : withval=$with_developer_dir; DEVELOPER_DIR="$withval"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DEVELOPER_DIR" >&5 $as_echo "$DEVELOPER_DIR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not present" >&5 $as_echo "not present" >&6; } fi if test "x$DEVELOPER_DIR" = "x"; then # Extract the first word of "xcode-select", so it can be a program name with args. set dummy xcode-select; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_XCODE_SELECT+:} false; then : $as_echo_n "(cached) " >&6 else case $XCODE_SELECT in [\\/]* | ?:[\\/]*) ac_cv_path_XCODE_SELECT="$XCODE_SELECT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_XCODE_SELECT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi XCODE_SELECT=$ac_cv_path_XCODE_SELECT if test -n "$XCODE_SELECT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XCODE_SELECT" >&5 $as_echo "$XCODE_SELECT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$XCODE_SELECT" != "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for developer dir using xcode-select" >&5 $as_echo_n "checking for developer dir using xcode-select... " >&6; } DEVELOPER_DIR=`$XCODE_SELECT -print-path` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DEVELOPER_DIR" >&5 $as_echo "$DEVELOPER_DIR" >&6; } else DEVELOPER_DIR=/Developer fi fi if test "x$MACARCH" = "xboth"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 10.4 universal SDK" >&5 $as_echo_n "checking for 10.4 universal SDK... " >&6; } save_cppflags="$CPPFLAGS" save_cflags="$CFLAGS" save_ldflags="$LDFLAGS" CFLAGS="$CFLAGS -isysroot $DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 $as_echo "found" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } CFLAGS="$save_cflags" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Intel architecture is supported" >&5 $as_echo_n "checking if Intel architecture is supported... " >&6; } CPPFLAGS="$CPPFLAGS -arch i386" LDFLAGS="$save_ldflags -arch i386" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; MACARCH="intel" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } MACARCH="ppc" CPPFLAGS="$save_cppflags -arch ppc" LDFLAGS="$save_ldflags -arch ppc" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext elif test "x$MACARCH" = "xintel"; then CPPFLAGS="$CPPFLAGS -arch intel" LDFLAGS="$LDFLAGS -arch intel" elif test "x$MACARCH" = "xppc"; then CPPFLAGS="$CPPFLAGS -arch ppc" LDFLAGS="$LDFLAGS -arch ppc" fi if test "$enable_darwin" = "yes"; then MACOSX=yes OS_EXTRA_SRC="os_macosx.m os_mac_conv.c"; OS_EXTRA_OBJ="objects/os_macosx.o objects/os_mac_conv.o" CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX" # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_c_check_header_mongrel "$LINENO" "Carbon/Carbon.h" "ac_cv_header_Carbon_Carbon_h" "$ac_includes_default" if test "x$ac_cv_header_Carbon_Carbon_h" = xyes; then : CARBON=yes fi if test "x$CARBON" = "xyes"; then if test -z "$with_x" -a "X$enable_gui" != Xmotif -a "X$enable_gui" != Xathena -a "X$enable_gui" != Xgtk2 -a "X$enable_gui" != Xgtk3; then with_x=no fi fi fi if test "$MACARCH" = "intel" -o "$MACARCH" = "both"; then CFLAGS=`echo "$CFLAGS" | sed 's/-O[23456789]/-Oz/'` fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi for ac_header in AvailabilityMacros.h do : ac_fn_c_check_header_mongrel "$LINENO" "AvailabilityMacros.h" "ac_cv_header_AvailabilityMacros_h" "$ac_includes_default" if test "x$ac_cv_header_AvailabilityMacros_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_AVAILABILITYMACROS_H 1 _ACEOF fi done if test "$cross_compiling" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-local-dir argument" >&5 $as_echo_n "checking --with-local-dir argument... " >&6; } have_local_include='' have_local_lib='' # Check whether --with-local-dir was given. if test "${with_local_dir+set}" = set; then : withval=$with_local_dir; local_dir="$withval" case "$withval" in */*) ;; no) # avoid adding local dir to LDFLAGS and CPPFLAGS have_local_include=yes have_local_lib=yes ;; *) as_fn_error $? "must pass path argument to --with-local-dir" "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $local_dir" >&5 $as_echo "$local_dir" >&6; } else local_dir=/usr/local { $as_echo "$as_me:${as_lineno-$LINENO}: result: Defaulting to $local_dir" >&5 $as_echo "Defaulting to $local_dir" >&6; } fi if test "$GCC" = yes -a "$local_dir" != no; then echo 'void f(){}' > conftest.c have_local_include=`${CC-cc} -c -v conftest.c 2>&1 | grep "${local_dir}/include"` have_local_lib=`${CC-cc} -c -v conftest.c 2>&1 | grep "${local_dir}/lib"` rm -f conftest.c conftest.o fi if test -z "$have_local_lib" -a -d "${local_dir}/lib"; then tt=`echo "$LDFLAGS" | sed -e "s+-L${local_dir}/lib ++g" -e "s+-L${local_dir}/lib$++g"` if test "$tt" = "$LDFLAGS"; then LDFLAGS="$LDFLAGS -L${local_dir}/lib" fi fi if test -z "$have_local_include" -a -d "${local_dir}/include"; then tt=`echo "$CPPFLAGS" | sed -e "s+-I${local_dir}/include ++g" -e "s+-I${local_dir}/include$++g"` if test "$tt" = "$CPPFLAGS"; then CPPFLAGS="$CPPFLAGS -I${local_dir}/include" fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-vim-name argument" >&5 $as_echo_n "checking --with-vim-name argument... " >&6; } # Check whether --with-vim-name was given. if test "${with_vim_name+set}" = set; then : withval=$with_vim_name; VIMNAME="$withval"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $VIMNAME" >&5 $as_echo "$VIMNAME" >&6; } else VIMNAME="vim"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: Defaulting to $VIMNAME" >&5 $as_echo "Defaulting to $VIMNAME" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-ex-name argument" >&5 $as_echo_n "checking --with-ex-name argument... " >&6; } # Check whether --with-ex-name was given. if test "${with_ex_name+set}" = set; then : withval=$with_ex_name; EXNAME="$withval"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $EXNAME" >&5 $as_echo "$EXNAME" >&6; } else EXNAME="ex"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: Defaulting to ex" >&5 $as_echo "Defaulting to ex" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-view-name argument" >&5 $as_echo_n "checking --with-view-name argument... " >&6; } # Check whether --with-view-name was given. if test "${with_view_name+set}" = set; then : withval=$with_view_name; VIEWNAME="$withval"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $VIEWNAME" >&5 $as_echo "$VIEWNAME" >&6; } else VIEWNAME="view"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: Defaulting to view" >&5 $as_echo "Defaulting to view" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-global-runtime argument" >&5 $as_echo_n "checking --with-global-runtime argument... " >&6; } # Check whether --with-global-runtime was given. if test "${with_global_runtime+set}" = set; then : withval=$with_global_runtime; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 $as_echo "$withval" >&6; }; cat >>confdefs.h <<_ACEOF #define RUNTIME_GLOBAL "$withval" _ACEOF else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-modified-by argument" >&5 $as_echo_n "checking --with-modified-by argument... " >&6; } # Check whether --with-modified-by was given. if test "${with_modified_by+set}" = set; then : withval=$with_modified_by; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 $as_echo "$withval" >&6; }; cat >>confdefs.h <<_ACEOF #define MODIFIED_BY "$withval" _ACEOF else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if character set is EBCDIC" >&5 $as_echo_n "checking if character set is EBCDIC... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end 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; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # TryCompile action if true cf_cv_ebcdic=yes else # TryCompile action if false cf_cv_ebcdic=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # end of TryCompile ]) # end of CacheVal CvEbcdic { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cf_cv_ebcdic" >&5 $as_echo "$cf_cv_ebcdic" >&6; } case "$cf_cv_ebcdic" in #(vi yes) $as_echo "#define EBCDIC 1" >>confdefs.h line_break='"\\n"' ;; *) line_break='"\\012"';; esac if test "$cf_cv_ebcdic" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for z/OS Unix" >&5 $as_echo_n "checking for z/OS Unix... " >&6; } case `uname` in OS/390) zOSUnix="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 z/OS 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 # Set CFLAGS for configure process. # This will be reset later for config.mk. # Use haltonmsg to force error for missing H files. CFLAGS="$CFLAGS -D_ALL_SOURCE -Wc,float(ieee),haltonmsg(3296)"; LDFLAGS="$LDFLAGS -Wl,EDIT=NO" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ;; *) zOSUnix="no"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi if test "$zOSUnix" = "yes"; then QUOTESED="sed -e 's/[\\\\\"]/\\\\\\\\&/g' -e 's/\\\\\\\\\"/\"/' -e 's/\\\\\\\\\";\$\$/\";/'" else QUOTESED="sed -e 's/[\\\\\"]/\\\\&/g' -e 's/\\\\\"/\"/' -e 's/\\\\\";\$\$/\";/'" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking --disable-smack argument" >&5 $as_echo_n "checking --disable-smack argument... " >&6; } # Check whether --enable-smack was given. if test "${enable_smack+set}" = set; then : enableval=$enable_smack; else enable_smack="yes" fi if test "$enable_smack" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "linux/xattr.h" "ac_cv_header_linux_xattr_h" "$ac_includes_default" if test "x$ac_cv_header_linux_xattr_h" = xyes; then : true else enable_smack="no" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi if test "$enable_smack" = "yes"; then ac_fn_c_check_header_mongrel "$LINENO" "attr/xattr.h" "ac_cv_header_attr_xattr_h" "$ac_includes_default" if test "x$ac_cv_header_attr_xattr_h" = xyes; then : true else enable_smack="no" fi fi if test "$enable_smack" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XATTR_NAME_SMACKEXEC in linux/xattr.h" >&5 $as_echo_n "checking for XATTR_NAME_SMACKEXEC in linux/xattr.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "XATTR_NAME_SMACKEXEC" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; }; enable_smack="no" fi rm -f conftest* fi if test "$enable_smack" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for setxattr in -lattr" >&5 $as_echo_n "checking for setxattr in -lattr... " >&6; } if ${ac_cv_lib_attr_setxattr+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lattr $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char setxattr (); int main () { return setxattr (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_attr_setxattr=yes else ac_cv_lib_attr_setxattr=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_attr_setxattr" >&5 $as_echo "$ac_cv_lib_attr_setxattr" >&6; } if test "x$ac_cv_lib_attr_setxattr" = xyes; then : LIBS="$LIBS -lattr" found_smack="yes" $as_echo "#define HAVE_SMACK 1" >>confdefs.h fi fi if test "x$found_smack" = "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking --disable-selinux argument" >&5 $as_echo_n "checking --disable-selinux argument... " >&6; } # Check whether --enable-selinux was given. if test "${enable_selinux+set}" = set; then : enableval=$enable_selinux; else enable_selinux="yes" fi if test "$enable_selinux" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for is_selinux_enabled in -lselinux" >&5 $as_echo_n "checking for is_selinux_enabled in -lselinux... " >&6; } if ${ac_cv_lib_selinux_is_selinux_enabled+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lselinux $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char is_selinux_enabled (); int main () { return is_selinux_enabled (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_selinux_is_selinux_enabled=yes else ac_cv_lib_selinux_is_selinux_enabled=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_selinux_is_selinux_enabled" >&5 $as_echo "$ac_cv_lib_selinux_is_selinux_enabled" >&6; } if test "x$ac_cv_lib_selinux_is_selinux_enabled" = xyes; then : LIBS="$LIBS -lselinux" $as_echo "#define HAVE_SELINUX 1" >>confdefs.h fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-features argument" >&5 $as_echo_n "checking --with-features argument... " >&6; } # Check whether --with-features was given. if test "${with_features+set}" = set; then : withval=$with_features; features="$withval"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $features" >&5 $as_echo "$features" >&6; } else features="huge"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: Defaulting to huge" >&5 $as_echo "Defaulting to huge" >&6; } fi dovimdiff="" dogvimdiff="" case "$features" in tiny) $as_echo "#define FEAT_TINY 1" >>confdefs.h ;; small) $as_echo "#define FEAT_SMALL 1" >>confdefs.h ;; normal) $as_echo "#define FEAT_NORMAL 1" >>confdefs.h dovimdiff="installvimdiff"; dogvimdiff="installgvimdiff" ;; big) $as_echo "#define FEAT_BIG 1" >>confdefs.h dovimdiff="installvimdiff"; dogvimdiff="installgvimdiff" ;; huge) $as_echo "#define FEAT_HUGE 1" >>confdefs.h dovimdiff="installvimdiff"; dogvimdiff="installgvimdiff" ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: Sorry, $features is not supported" >&5 $as_echo "Sorry, $features is not supported" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-compiledby argument" >&5 $as_echo_n "checking --with-compiledby argument... " >&6; } # Check whether --with-compiledby was given. if test "${with_compiledby+set}" = set; then : withval=$with_compiledby; compiledby="$withval"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 $as_echo "$withval" >&6; } else compiledby=""; { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking --disable-xsmp argument" >&5 $as_echo_n "checking --disable-xsmp argument... " >&6; } # Check whether --enable-xsmp was given. if test "${enable_xsmp+set}" = set; then : enableval=$enable_xsmp; else enable_xsmp="yes" fi if test "$enable_xsmp" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking --disable-xsmp-interact argument" >&5 $as_echo_n "checking --disable-xsmp-interact argument... " >&6; } # Check whether --enable-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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "#define USE_XSMP_INTERACT 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-luainterp argument" >&5 $as_echo_n "checking --enable-luainterp argument... " >&6; } # Check whether --enable-luainterp was given. if test "${enable_luainterp+set}" = set; then : enableval=$enable_luainterp; else enable_luainterp="no" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_luainterp" >&5 $as_echo "$enable_luainterp" >&6; } if test "$enable_luainterp" = "yes" -o "$enable_luainterp" = "dynamic"; then if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then as_fn_error $? "cannot use Lua with tiny or small features" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-lua-prefix argument" >&5 $as_echo_n "checking --with-lua-prefix argument... " >&6; } # Check whether --with-lua_prefix was given. if test "${with_lua_prefix+set}" = set; then : withval=$with_lua_prefix; with_lua_prefix="$withval"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_lua_prefix" >&5 $as_echo "$with_lua_prefix" >&6; } else with_lua_prefix="";{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "X$with_lua_prefix" != "X"; then vi_cv_path_lua_pfx="$with_lua_prefix" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking LUA_PREFIX environment var" >&5 $as_echo_n "checking LUA_PREFIX environment var... " >&6; } if test "X$LUA_PREFIX" != "X"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$LUA_PREFIX\"" >&5 $as_echo "\"$LUA_PREFIX\"" >&6; } vi_cv_path_lua_pfx="$LUA_PREFIX" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not set, default to /usr" >&5 $as_echo "not set, default to /usr" >&6; } vi_cv_path_lua_pfx="/usr" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-luajit" >&5 $as_echo_n "checking --with-luajit... " >&6; } # Check whether --with-luajit was given. if test "${with_luajit+set}" = set; then : withval=$with_luajit; vi_cv_with_luajit="$withval" else vi_cv_with_luajit="no" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_with_luajit" >&5 $as_echo "$vi_cv_with_luajit" >&6; } LUA_INC= if test "X$vi_cv_path_lua_pfx" != "X"; then if test "x$vi_cv_with_luajit" != "xno"; then # Extract the first word of "luajit", so it can be a program name with args. set dummy luajit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_vi_cv_path_luajit+:} false; then : $as_echo_n "(cached) " >&6 else case $vi_cv_path_luajit in [\\/]* | ?:[\\/]*) ac_cv_path_vi_cv_path_luajit="$vi_cv_path_luajit" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_vi_cv_path_luajit="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi vi_cv_path_luajit=$ac_cv_path_vi_cv_path_luajit if test -n "$vi_cv_path_luajit"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_luajit" >&5 $as_echo "$vi_cv_path_luajit" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "X$vi_cv_path_luajit" != "X"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking LuaJIT version" >&5 $as_echo_n "checking LuaJIT version... " >&6; } if ${vi_cv_version_luajit+:} false; then : $as_echo_n "(cached) " >&6 else vi_cv_version_luajit=`${vi_cv_path_luajit} -v 2>&1 | sed 's/LuaJIT \([0-9.]*\)\.[0-9]\(-[a-z0-9]*\)* .*/\1/'` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_version_luajit" >&5 $as_echo "$vi_cv_version_luajit" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking Lua version of LuaJIT" >&5 $as_echo_n "checking Lua version of LuaJIT... " >&6; } if ${vi_cv_version_lua_luajit+:} false; then : $as_echo_n "(cached) " >&6 else vi_cv_version_lua_luajit=`${vi_cv_path_luajit} -e "print(_VERSION)" | sed 's/.* //'` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_version_lua_luajit" >&5 $as_echo "$vi_cv_version_lua_luajit" >&6; } vi_cv_path_lua="$vi_cv_path_luajit" vi_cv_version_lua="$vi_cv_version_lua_luajit" fi else # Extract the first word of "lua", so it can be a program name with args. set dummy lua; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_vi_cv_path_plain_lua+:} false; then : $as_echo_n "(cached) " >&6 else case $vi_cv_path_plain_lua in [\\/]* | ?:[\\/]*) ac_cv_path_vi_cv_path_plain_lua="$vi_cv_path_plain_lua" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_vi_cv_path_plain_lua="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi vi_cv_path_plain_lua=$ac_cv_path_vi_cv_path_plain_lua if test -n "$vi_cv_path_plain_lua"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_plain_lua" >&5 $as_echo "$vi_cv_path_plain_lua" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "X$vi_cv_path_plain_lua" != "X"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking Lua version" >&5 $as_echo_n "checking Lua version... " >&6; } if ${vi_cv_version_plain_lua+:} false; then : $as_echo_n "(cached) " >&6 else vi_cv_version_plain_lua=`${vi_cv_path_plain_lua} -e "print(_VERSION)" | sed 's/.* //'` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_version_plain_lua" >&5 $as_echo "$vi_cv_version_plain_lua" >&6; } fi vi_cv_path_lua="$vi_cv_path_plain_lua" vi_cv_version_lua="$vi_cv_version_plain_lua" fi if test "x$vi_cv_with_luajit" != "xno" && test "X$vi_cv_version_luajit" != "X"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if lua.h can be found in $vi_cv_path_lua_pfx/include/luajit-$vi_cv_version_luajit" >&5 $as_echo_n "checking if lua.h can be found in $vi_cv_path_lua_pfx/include/luajit-$vi_cv_version_luajit... " >&6; } if test -f "$vi_cv_path_lua_pfx/include/luajit-$vi_cv_version_luajit/lua.h"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } LUA_INC=/luajit-$vi_cv_version_luajit fi fi if test "X$LUA_INC" = "X"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if lua.h can be found in $vi_cv_path_lua_pfx/include" >&5 $as_echo_n "checking if lua.h can be found in $vi_cv_path_lua_pfx/include... " >&6; } if test -f "$vi_cv_path_lua_pfx/include/lua.h"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if lua.h can be found in $vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua" >&5 $as_echo_n "checking if lua.h can be found in $vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua... " >&6; } if test -f "$vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua/lua.h"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } LUA_INC=/lua$vi_cv_version_lua else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } vi_cv_path_lua_pfx= fi fi fi fi if test "X$vi_cv_path_lua_pfx" != "X"; then if test "x$vi_cv_with_luajit" != "xno"; then multiarch=`dpkg-architecture -qDEB_HOST_MULTIARCH 2> /dev/null` if test "X$multiarch" != "X"; then lib_multiarch="lib/${multiarch}" else lib_multiarch="lib" fi if test "X$vi_cv_version_lua" = "X"; then LUA_LIBS="-L${vi_cv_path_lua_pfx}/${lib_multiarch} -lluajit" else LUA_LIBS="-L${vi_cv_path_lua_pfx}/${lib_multiarch} -lluajit-$vi_cv_version_lua" fi else if test "X$LUA_INC" != "X"; then LUA_LIBS="-L${vi_cv_path_lua_pfx}/lib -llua$vi_cv_version_lua" else LUA_LIBS="-L${vi_cv_path_lua_pfx}/lib -llua" fi fi if test "$enable_luainterp" = "dynamic"; then lua_ok="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking if link with ${LUA_LIBS} is sane" >&5 $as_echo_n "checking if link with ${LUA_LIBS} is sane... " >&6; } libs_save=$LIBS LIBS="$LIBS $LUA_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; lua_ok="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; }; lua_ok="no"; LUA_LIBS="" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$libs_save fi if test "x$lua_ok" = "xyes"; then LUA_CFLAGS="-I${vi_cv_path_lua_pfx}/include${LUA_INC}" LUA_SRC="if_lua.c" LUA_OBJ="objects/if_lua.o" LUA_PRO="if_lua.pro" $as_echo "#define FEAT_LUA 1" >>confdefs.h fi if test "$enable_luainterp" = "dynamic"; then if test "x$vi_cv_with_luajit" != "xno"; then luajit="jit" fi if test -f "${vi_cv_path_lua_pfx}/bin/cyglua-${vi_cv_version_lua}.dll"; then vi_cv_dll_name_lua="cyglua-${vi_cv_version_lua}.dll" else if test "x$MACOSX" = "xyes"; then ext="dylib" indexes="" else ext="so" indexes=".0 .1 .2 .3 .4 .5 .6 .7 .8 .9" multiarch=`dpkg-architecture -qDEB_HOST_MULTIARCH 2> /dev/null` if test "X$multiarch" != "X"; then lib_multiarch="lib/${multiarch}" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if liblua${luajit}*.${ext}* can be found in $vi_cv_path_lua_pfx" >&5 $as_echo_n "checking if liblua${luajit}*.${ext}* can be found in $vi_cv_path_lua_pfx... " >&6; } for subdir in "${lib_multiarch}" lib64 lib; do if test -z "$subdir"; then continue fi for sover in "${vi_cv_version_lua}.${ext}" "-${vi_cv_version_lua}.${ext}" \ ".${vi_cv_version_lua}.${ext}" ".${ext}.${vi_cv_version_lua}"; do for i in $indexes ""; do if test -f "${vi_cv_path_lua_pfx}/${subdir}/liblua${luajit}${sover}$i"; then sover2="$i" break 3 fi done done sover="" done if test "X$sover" = "X"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } lua_ok="no" vi_cv_dll_name_lua="liblua${luajit}.${ext}" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } lua_ok="yes" vi_cv_dll_name_lua="liblua${luajit}${sover}$sover2" fi fi $as_echo "#define DYNAMIC_LUA 1" >>confdefs.h LUA_LIBS="" LUA_CFLAGS="-DDYNAMIC_LUA_DLL=\\\"${vi_cv_dll_name_lua}\\\" $LUA_CFLAGS" fi if test "X$LUA_CFLAGS$LUA_LIBS" != "X" && \ test "x$MACOSX" = "xyes" && test "x$vi_cv_with_luajit" != "xno" && \ test "`(uname -m) 2>/dev/null`" = "x86_64"; then LUA_LIBS="-pagezero_size 10000 -image_base 100000000 $LUA_LIBS" fi fi if test "$fail_if_missing" = "yes" -a "$lua_ok" != "yes"; then as_fn_error $? "could not configure lua" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-mzschemeinterp argument" >&5 $as_echo_n "checking --enable-mzschemeinterp argument... " >&6; } # Check whether --enable-mzschemeinterp was given. if test "${enable_mzschemeinterp+set}" = set; then : enableval=$enable_mzschemeinterp; else enable_mzschemeinterp="no" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_mzschemeinterp" >&5 $as_echo "$enable_mzschemeinterp" >&6; } if test "$enable_mzschemeinterp" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-plthome argument" >&5 $as_echo_n "checking --with-plthome argument... " >&6; } # Check whether --with-plthome was given. if test "${with_plthome+set}" = set; then : withval=$with_plthome; with_plthome="$withval"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_plthome" >&5 $as_echo "$with_plthome" >&6; } else with_plthome="";{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"no\"" >&5 $as_echo "\"no\"" >&6; } fi if test "X$with_plthome" != "X"; then vi_cv_path_mzscheme_pfx="$with_plthome" vi_cv_path_mzscheme="${vi_cv_path_mzscheme_pfx}/bin/mzscheme" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking PLTHOME environment var" >&5 $as_echo_n "checking PLTHOME environment var... " >&6; } if test "X$PLTHOME" != "X"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$PLTHOME\"" >&5 $as_echo "\"$PLTHOME\"" >&6; } vi_cv_path_mzscheme_pfx="$PLTHOME" vi_cv_path_mzscheme="${vi_cv_path_mzscheme_pfx}/bin/mzscheme" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not set" >&5 $as_echo "not set" >&6; } # Extract the first word of "mzscheme", so it can be a program name with args. set dummy mzscheme; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_vi_cv_path_mzscheme+:} false; then : $as_echo_n "(cached) " >&6 else case $vi_cv_path_mzscheme in [\\/]* | ?:[\\/]*) ac_cv_path_vi_cv_path_mzscheme="$vi_cv_path_mzscheme" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_vi_cv_path_mzscheme="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi vi_cv_path_mzscheme=$ac_cv_path_vi_cv_path_mzscheme if test -n "$vi_cv_path_mzscheme"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_mzscheme" >&5 $as_echo "$vi_cv_path_mzscheme" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "X$vi_cv_path_mzscheme" != "X"; then lsout=`ls -l $vi_cv_path_mzscheme` if echo "$lsout" | grep -e '->' >/dev/null 2>/dev/null; then vi_cv_path_mzscheme=`echo "$lsout" | sed 's/.*-> \(.*\)/\1/'` fi fi if test "X$vi_cv_path_mzscheme" != "X"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking MzScheme install prefix" >&5 $as_echo_n "checking MzScheme install prefix... " >&6; } if ${vi_cv_path_mzscheme_pfx+:} false; then : $as_echo_n "(cached) " >&6 else echo "(display (simplify-path \ (build-path (call-with-values \ (lambda () (split-path (find-system-path (quote exec-file)))) \ (lambda (base name must-be-dir?) base)) (quote up))))" > mzdirs.scm vi_cv_path_mzscheme_pfx=`${vi_cv_path_mzscheme} -r mzdirs.scm | \ sed -e 's+/$++'` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_mzscheme_pfx" >&5 $as_echo "$vi_cv_path_mzscheme_pfx" >&6; } rm -f mzdirs.scm fi fi fi if test "X$vi_cv_path_mzscheme_pfx" != "X"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for racket include directory" >&5 $as_echo_n "checking for racket include directory... " >&6; } SCHEME_INC=`${vi_cv_path_mzscheme} -e '(require setup/dirs)(let ((p (find-include-dir))) (when (path? p) (display p)))'` if test "X$SCHEME_INC" != "X"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${SCHEME_INC}" >&5 $as_echo "${SCHEME_INC}" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include" >&5 $as_echo_n "checking if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include... " >&6; } if test -f "$vi_cv_path_mzscheme_pfx/include/scheme.h"; then SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/plt" >&5 $as_echo_n "checking if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/plt... " >&6; } if test -f "$vi_cv_path_mzscheme_pfx/include/plt/scheme.h"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include/plt else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/racket" >&5 $as_echo_n "checking if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/racket... " >&6; } if test -f "$vi_cv_path_mzscheme_pfx/include/racket/scheme.h"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include/racket else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if scheme.h can be found in /usr/include/plt/" >&5 $as_echo_n "checking if scheme.h can be found in /usr/include/plt/... " >&6; } if test -f /usr/include/plt/scheme.h; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SCHEME_INC=/usr/include/plt else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if scheme.h can be found in /usr/include/racket/" >&5 $as_echo_n "checking if scheme.h can be found in /usr/include/racket/... " >&6; } if test -f /usr/include/racket/scheme.h; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SCHEME_INC=/usr/include/racket else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } vi_cv_path_mzscheme_pfx= fi fi fi fi fi fi fi if test "X$vi_cv_path_mzscheme_pfx" != "X"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for racket lib directory" >&5 $as_echo_n "checking for racket lib directory... " >&6; } SCHEME_LIB=`${vi_cv_path_mzscheme} -e '(require setup/dirs)(let ((p (find-lib-dir))) (when (path? p) (display p)))'` if test "X$SCHEME_LIB" != "X"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${SCHEME_LIB}" >&5 $as_echo "${SCHEME_LIB}" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } fi for path in "${vi_cv_path_mzscheme_pfx}/lib" "${SCHEME_LIB}"; do if test "X$path" != "X"; then if test "x$MACOSX" = "xyes"; then MZSCHEME_LIBS="-framework Racket" MZSCHEME_CFLAGS="-DMZ_PRECISE_GC" elif test -f "${path}/libmzscheme3m.a"; then MZSCHEME_LIBS="${path}/libmzscheme3m.a" MZSCHEME_CFLAGS="-DMZ_PRECISE_GC" elif test -f "${path}/libracket3m.a"; then MZSCHEME_LIBS="${path}/libracket3m.a" MZSCHEME_CFLAGS="-DMZ_PRECISE_GC" elif test -f "${path}/libracket.a"; then MZSCHEME_LIBS="${path}/libracket.a ${path}/libmzgc.a" elif test -f "${path}/libmzscheme.a"; then MZSCHEME_LIBS="${path}/libmzscheme.a ${path}/libmzgc.a" else if test -f "${path}/libmzscheme3m.so"; then MZSCHEME_LIBS="-L${path} -lmzscheme3m" MZSCHEME_CFLAGS="-DMZ_PRECISE_GC" elif test -f "${path}/libracket3m.so"; then MZSCHEME_LIBS="-L${path} -lracket3m" MZSCHEME_CFLAGS="-DMZ_PRECISE_GC" elif test -f "${path}/libracket.so"; then MZSCHEME_LIBS="-L${path} -lracket -lmzgc" else if test "$path" != "$SCHEME_LIB"; then continue fi MZSCHEME_LIBS="-L${path} -lmzscheme -lmzgc" fi if test "$GCC" = yes; then MZSCHEME_LIBS="${MZSCHEME_LIBS} -Wl,-rpath -Wl,${path}" elif test "`(uname) 2>/dev/null`" = SunOS && uname -r | grep '^5' >/dev/null; then MZSCHEME_LIBS="${MZSCHEME_LIBS} -R ${path}" fi fi fi if test "X$MZSCHEME_LIBS" != "X"; then break fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking if racket requires -pthread" >&5 $as_echo_n "checking if racket requires -pthread... " >&6; } if test "X$SCHEME_LIB" != "X" && $FGREP -e -pthread "$SCHEME_LIB/buildinfo" >/dev/null ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } MZSCHEME_LIBS="${MZSCHEME_LIBS} -pthread" MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -pthread" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for racket config directory" >&5 $as_echo_n "checking for racket config directory... " >&6; } SCHEME_CONFIGDIR=`${vi_cv_path_mzscheme} -e '(require setup/dirs)(let ((p (find-config-dir))) (when (path? p) (display p)))'` if test "X$SCHEME_CONFIGDIR" != "X"; then MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -DMZSCHEME_CONFIGDIR='\"${SCHEME_CONFIGDIR}\"'" { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${SCHEME_CONFIGDIR}" >&5 $as_echo "${SCHEME_CONFIGDIR}" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for racket collects directory" >&5 $as_echo_n "checking for racket collects directory... " >&6; } SCHEME_COLLECTS=`${vi_cv_path_mzscheme} -e '(require setup/dirs)(let ((p (find-collects-dir))) (when (path? p) (let-values (((base _1 _2) (split-path p))) (display base))))'` if test "X$SCHEME_COLLECTS" = "X"; then if test -d "$vi_cv_path_mzscheme_pfx/lib/plt/collects"; then SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/lib/plt/ else if test -d "$vi_cv_path_mzscheme_pfx/lib/racket/collects"; then SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/lib/racket/ else if test -d "$vi_cv_path_mzscheme_pfx/share/racket/collects"; then SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/share/racket/ else if test -d "$vi_cv_path_mzscheme_pfx/collects"; then SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/ fi fi fi fi fi if test "X$SCHEME_COLLECTS" != "X" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${SCHEME_COLLECTS}" >&5 $as_echo "${SCHEME_COLLECTS}" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mzscheme_base.c" >&5 $as_echo_n "checking for mzscheme_base.c... " >&6; } if test -f "${SCHEME_COLLECTS}collects/scheme/base.ss" ; then MZSCHEME_EXTRA="mzscheme_base.c" MZSCHEME_MZC="${vi_cv_path_mzscheme_pfx}/bin/mzc" MZSCHEME_MOD="++lib scheme/base" else if test -f "${SCHEME_COLLECTS}collects/scheme/base.rkt" ; then MZSCHEME_EXTRA="mzscheme_base.c" MZSCHEME_MZC="${vi_cv_path_mzscheme_pfx}/bin/mzc" MZSCHEME_MOD="++lib scheme/base" else if test -f "${SCHEME_COLLECTS}collects/racket/base.rkt" ; then MZSCHEME_EXTRA="mzscheme_base.c" MZSCHEME_MZC="${vi_cv_path_mzscheme_pfx}/bin/raco ctool" MZSCHEME_MOD="" fi fi fi if test "X$MZSCHEME_EXTRA" != "X" ; then MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -DINCLUDE_MZSCHEME_BASE" { $as_echo "$as_me:${as_lineno-$LINENO}: result: needed" >&5 $as_echo "needed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not needed" >&5 $as_echo "not needed" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ffi_type_void in -lffi" >&5 $as_echo_n "checking for ffi_type_void in -lffi... " >&6; } if ${ac_cv_lib_ffi_ffi_type_void+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lffi $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char ffi_type_void (); int main () { return ffi_type_void (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ffi_ffi_type_void=yes else ac_cv_lib_ffi_ffi_type_void=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ffi_ffi_type_void" >&5 $as_echo "$ac_cv_lib_ffi_ffi_type_void" >&6; } if test "x$ac_cv_lib_ffi_ffi_type_void" = xyes; then : MZSCHEME_LIBS="$MZSCHEME_LIBS -lffi" fi MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -I${SCHEME_INC} \ -DMZSCHEME_COLLECTS='\"${SCHEME_COLLECTS}collects\"'" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compile and link flags for MzScheme are sane" >&5 $as_echo_n "checking if compile and link flags for MzScheme are sane... " >&6; } cflags_save=$CFLAGS libs_save=$LIBS CFLAGS="$CFLAGS $MZSCHEME_CFLAGS" LIBS="$LIBS $MZSCHEME_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; mzs_ok=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no: MZSCHEME DISABLED" >&5 $as_echo "no: MZSCHEME DISABLED" >&6; }; mzs_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$cflags_save LIBS=$libs_save if test $mzs_ok = yes; then MZSCHEME_SRC="if_mzsch.c" MZSCHEME_OBJ="objects/if_mzsch.o" MZSCHEME_PRO="if_mzsch.pro" $as_echo "#define FEAT_MZSCHEME 1" >>confdefs.h else MZSCHEME_CFLAGS= MZSCHEME_LIBS= MZSCHEME_EXTRA= MZSCHEME_MZC= fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-perlinterp argument" >&5 $as_echo_n "checking --enable-perlinterp argument... " >&6; } # Check whether --enable-perlinterp was given. if test "${enable_perlinterp+set}" = set; then : enableval=$enable_perlinterp; else enable_perlinterp="no" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_perlinterp" >&5 $as_echo "$enable_perlinterp" >&6; } if test "$enable_perlinterp" = "yes" -o "$enable_perlinterp" = "dynamic"; then if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then as_fn_error $? "cannot use Perl with tiny or small features" "$LINENO" 5 fi # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_vi_cv_path_perl+:} false; then : $as_echo_n "(cached) " >&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. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_vi_cv_path_perl="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi vi_cv_path_perl=$ac_cv_path_vi_cv_path_perl if test -n "$vi_cv_path_perl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_perl" >&5 $as_echo "$vi_cv_path_perl" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "X$vi_cv_path_perl" != "X"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking Perl version" >&5 $as_echo_n "checking Perl version... " >&6; } if $vi_cv_path_perl -e 'require 5.003_01' >/dev/null 2>/dev/null; then eval `$vi_cv_path_perl -V:usethreads` eval `$vi_cv_path_perl -V:libperl` 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: >>> Perl > 5.6 with 5.5 threads cannot be used <<<" >&5 $as_echo ">>> Perl > 5.6 with 5.5 threads cannot be used <<<" >&6; } fi else badthreads=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: >>> Perl 5.5 with threads cannot be used <<<" >&5 $as_echo ">>> Perl 5.5 with threads cannot be used <<<" >&6; } fi fi if test $badthreads = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5 $as_echo "OK" >&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}'` vi_cv_perl_extutils=unknown_perl_extutils_path for extutils_rel_path in ExtUtils vendor_perl/ExtUtils; do xsubpp_path="$vi_cv_perllib/$extutils_rel_path/xsubpp" if test -f "$xsubpp_path"; then vi_cv_perl_xsubpp="$xsubpp_path" fi done perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \ -e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[^ ]*//' \ -e 's/-fdebug-prefix-map[^ ]*//g'` 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//'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compile and link flags for Perl are sane" >&5 $as_echo_n "checking if compile and link flags for Perl are sane... " >&6; } cflags_save=$CFLAGS libs_save=$LIBS ldflags_save=$LDFLAGS CFLAGS="$CFLAGS $perlcppflags" LIBS="$LIBS $perllibs" perlldflags=`echo "$perlldflags" | sed -e 's/^ *//g'` LDFLAGS="$perlldflags $LDFLAGS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; perl_ok=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no: PERL DISABLED" >&5 $as_echo "no: PERL DISABLED" >&6; }; perl_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$cflags_save LIBS=$libs_save LDFLAGS=$ldflags_save if test $perl_ok = yes; then if test "X$perlcppflags" != "X"; then PERL_CFLAGS=`echo "$perlcppflags" | sed -e 's/-pipe //' -e 's/-W[^ ]*//'` fi if test "X$perlldflags" != "X"; then if test "X`echo \"$LDFLAGS\" | $FGREP -e \"$perlldflags\"`" = "X"; then LDFLAGS="$perlldflags $LDFLAGS" fi 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" $as_echo "#define FEAT_PERL 1" >>confdefs.h fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: >>> too old; need Perl version 5.003_01 or later <<<" >&5 $as_echo ">>> too old; need Perl version 5.003_01 or later <<<" >&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 PERL_LIBS=`echo "$PERL_LIBS" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'` PERL_CFLAGS=`echo "$PERL_CFLAGS" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'` fi if test "$enable_perlinterp" = "dynamic"; then if test "$perl_ok" = "yes" -a "X$libperl" != "X"; then $as_echo "#define DYNAMIC_PERL 1" >>confdefs.h PERL_CFLAGS="-DDYNAMIC_PERL_DLL=\\\"$libperl\\\" $PERL_CFLAGS" fi fi if test "$fail_if_missing" = "yes" -a "$perl_ok" != "yes"; then as_fn_error $? "could not configure perl" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-pythoninterp argument" >&5 $as_echo_n "checking --enable-pythoninterp argument... " >&6; } # Check whether --enable-pythoninterp was given. if test "${enable_pythoninterp+set}" = set; then : enableval=$enable_pythoninterp; else enable_pythoninterp="no" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_pythoninterp" >&5 $as_echo "$enable_pythoninterp" >&6; } if test "$enable_pythoninterp" = "yes" -o "$enable_pythoninterp" = "dynamic"; then if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then as_fn_error $? "cannot use Python with tiny or small features" "$LINENO" 5 fi for ac_prog in python2 python do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_vi_cv_path_python+:} false; then : $as_echo_n "(cached) " >&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. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_vi_cv_path_python="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi vi_cv_path_python=$ac_cv_path_vi_cv_path_python if test -n "$vi_cv_path_python"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python" >&5 $as_echo "$vi_cv_path_python" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$vi_cv_path_python" && break done if test "X$vi_cv_path_python" != "X"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python version" >&5 $as_echo_n "checking Python version... " >&6; } if ${vi_cv_var_python_version+:} false; then : $as_echo_n "(cached) " >&6 else vi_cv_var_python_version=` ${vi_cv_path_python} -c 'import sys; print sys.version[:3]'` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_var_python_version" >&5 $as_echo "$vi_cv_var_python_version" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python is 2.3 or better" >&5 $as_echo_n "checking Python is 2.3 or better... " >&6; } if ${vi_cv_path_python} -c \ "import sys; sys.exit(${vi_cv_var_python_version} < 2.3)" then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yep" >&5 $as_echo "yep" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python's install prefix" >&5 $as_echo_n "checking Python's install prefix... " >&6; } if ${vi_cv_path_python_pfx+:} false; then : $as_echo_n "(cached) " >&6 else vi_cv_path_python_pfx=` ${vi_cv_path_python} -c \ "import sys; print sys.prefix"` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python_pfx" >&5 $as_echo "$vi_cv_path_python_pfx" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python's execution prefix" >&5 $as_echo_n "checking Python's execution prefix... " >&6; } if ${vi_cv_path_python_epfx+:} false; then : $as_echo_n "(cached) " >&6 else vi_cv_path_python_epfx=` ${vi_cv_path_python} -c \ "import sys; print sys.exec_prefix"` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python_epfx" >&5 $as_echo "$vi_cv_path_python_epfx" >&6; } if ${vi_cv_path_pythonpath+:} false; then : $as_echo_n "(cached) " >&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 was given. if test "${with_python_config_dir+set}" = set; then : withval=$with_python_config_dir; vi_cv_path_python_conf="${withval}" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python's configuration directory" >&5 $as_echo_n "checking Python's configuration directory... " >&6; } if ${vi_cv_path_python_conf+:} false; then : $as_echo_n "(cached) " >&6 else vi_cv_path_python_conf= d=`${vi_cv_path_python} -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('LIBPL')"` if test -d "$d" && test -f "$d/config.c"; then vi_cv_path_python_conf="$d" else for path in "${vi_cv_path_python_pfx}" "${vi_cv_path_python_epfx}"; do for subdir in lib64 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python_conf" >&5 $as_echo "$vi_cv_path_python_conf" >&6; } PYTHON_CONFDIR="${vi_cv_path_python_conf}" if test "X$PYTHON_CONFDIR" = "X"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: can't find it!" >&5 $as_echo "can't find it!" >&6; } else if ${vi_cv_path_python_plibs+:} false; then : $as_echo_n "(cached) " >&6 else pwd=`pwd` tmp_mkf="$pwd/config-PyMake$$" cat -- "${PYTHON_CONFDIR}/Makefile" - <<'eof' >"${tmp_mkf}" __: @echo "python_BASEMODLIBS='$(BASEMODLIBS)'" @echo "python_LIBS='$(LIBS)'" @echo "python_SYSLIBS='$(SYSLIBS)'" @echo "python_LINKFORSHARED='$(LINKFORSHARED)'" @echo "python_DLLLIBRARY='$(DLLLIBRARY)'" @echo "python_INSTSONAME='$(INSTSONAME)'" @echo "python_PYTHONFRAMEWORK='$(PYTHONFRAMEWORK)'" @echo "python_PYTHONFRAMEWORKPREFIX='$(PYTHONFRAMEWORKPREFIX)'" @echo "python_PYTHONFRAMEWORKINSTALLDIR='$(PYTHONFRAMEWORKINSTALLDIR)'" 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" if test "x${vi_cv_path_python}" != "x/usr/bin/python" && test -n "${python_PYTHONFRAMEWORKPREFIX}"; then vi_cv_path_python_plibs="-F${python_PYTHONFRAMEWORKPREFIX} -framework Python" fi 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 if test -n "${python_LINKFORSHARED}" && test -n "${python_PYTHONFRAMEWORKPREFIX}"; then python_link_symbol=`echo ${python_LINKFORSHARED} | sed 's/\([^ \t][^ \t]*[ \t][ \t]*[^ \t][^ \t]*\)[ \t].*/\1/'` python_link_path=`echo ${python_LINKFORSHARED} | sed 's/\([^ \t][^ \t]*[ \t][ \t]*[^ \t][^ \t]*\)[ \t][ \t]*\(.*\)/\2/'` if test -n "${python_link_path}" && ! test -x "${python_link_path}"; then python_link_path="${python_PYTHONFRAMEWORKPREFIX}/${python_link_path}" if test -n "${python_link_path}" && ! test -x "${python_link_path}"; then python_link_path="${python_PYTHONFRAMEWORKINSTALLDIR}/Versions/${vi_cv_var_python_version}/${python_PYTHONFRAMEWORK}" fi python_LINKFORSHARED="${python_link_symbol} ${python_link_path}" fi fi vi_cv_path_python_plibs="${vi_cv_path_python_plibs} ${python_BASEMODLIBS} ${python_LIBS} ${python_SYSLIBS} ${python_LINKFORSHARED}" vi_cv_path_python_plibs=`echo $vi_cv_path_python_plibs | sed s/-ltermcap//` fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python's dll name" >&5 $as_echo_n "checking Python's dll name... " >&6; } if ${vi_cv_dll_name_python+:} false; then : $as_echo_n "(cached) " >&6 else if test "X$python_DLLLIBRARY" != "X"; then vi_cv_dll_name_python="$python_DLLLIBRARY" else vi_cv_dll_name_python="$python_INSTSONAME" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_dll_name_python" >&5 $as_echo "$vi_cv_dll_name_python" >&6; } 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} -DPYTHON_HOME='\"${vi_cv_path_python_pfx}\"'" 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} -DPYTHON_HOME='\"${vi_cv_path_python_pfx}\"'" fi PYTHON_SRC="if_python.c" PYTHON_OBJ="objects/if_python.o" 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}\"'" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if -pthread should be used" >&5 $as_echo_n "checking if -pthread should be used... " >&6; } threadsafe_flag= thread_lib= if test "`(uname) 2>/dev/null`" != Darwin; then test "$GCC" = yes && threadsafe_flag="-pthread" if test "`(uname) 2>/dev/null`" = FreeBSD; then threadsafe_flag="-D_THREAD_SAFE" thread_lib="-pthread" fi if test "`(uname) 2>/dev/null`" = SunOS; then threadsafe_flag="-pthreads" fi fi libs_save_old=$LIBS if test -n "$threadsafe_flag"; then cflags_save=$CFLAGS CFLAGS="$CFLAGS $threadsafe_flag" LIBS="$LIBS $thread_lib" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; PYTHON_CFLAGS="$PYTHON_CFLAGS $threadsafe_flag" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; }; LIBS=$libs_save_old fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$cflags_save else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compile and link flags for Python are sane" >&5 $as_echo_n "checking if compile and link flags for Python are sane... " >&6; } cflags_save=$CFLAGS libs_save=$LIBS CFLAGS="$CFLAGS $PYTHON_CFLAGS" LIBS="$LIBS $PYTHON_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; python_ok=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no: PYTHON DISABLED" >&5 $as_echo "no: PYTHON DISABLED" >&6; }; python_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$cflags_save LIBS=$libs_save if test $python_ok = yes; then $as_echo "#define FEAT_PYTHON 1" >>confdefs.h else LIBS=$libs_save_old PYTHON_SRC= PYTHON_OBJ= PYTHON_LIBS= PYTHON_CFLAGS= fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: too old" >&5 $as_echo "too old" >&6; } fi fi if test "$fail_if_missing" = "yes" -a "$python_ok" != "yes"; then as_fn_error $? "could not configure python" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-python3interp argument" >&5 $as_echo_n "checking --enable-python3interp argument... " >&6; } # Check whether --enable-python3interp was given. if test "${enable_python3interp+set}" = set; then : enableval=$enable_python3interp; else enable_python3interp="no" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_python3interp" >&5 $as_echo "$enable_python3interp" >&6; } if test "$enable_python3interp" = "yes" -o "$enable_python3interp" = "dynamic"; then if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then as_fn_error $? "cannot use Python with tiny or small features" "$LINENO" 5 fi for ac_prog in python3 python do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_vi_cv_path_python3+:} false; then : $as_echo_n "(cached) " >&6 else case $vi_cv_path_python3 in [\\/]* | ?:[\\/]*) ac_cv_path_vi_cv_path_python3="$vi_cv_path_python3" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_vi_cv_path_python3="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi vi_cv_path_python3=$ac_cv_path_vi_cv_path_python3 if test -n "$vi_cv_path_python3"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python3" >&5 $as_echo "$vi_cv_path_python3" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$vi_cv_path_python3" && break done if test "X$vi_cv_path_python3" != "X"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python version" >&5 $as_echo_n "checking Python version... " >&6; } if ${vi_cv_var_python3_version+:} false; then : $as_echo_n "(cached) " >&6 else vi_cv_var_python3_version=` ${vi_cv_path_python3} -c 'import sys; print(sys.version[:3])'` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_var_python3_version" >&5 $as_echo "$vi_cv_var_python3_version" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python is 3.0 or better" >&5 $as_echo_n "checking Python is 3.0 or better... " >&6; } if ${vi_cv_path_python3} -c \ "import sys; sys.exit(${vi_cv_var_python3_version} < 3.0)" then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yep" >&5 $as_echo "yep" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python's abiflags" >&5 $as_echo_n "checking Python's abiflags... " >&6; } if ${vi_cv_var_python3_abiflags+:} false; then : $as_echo_n "(cached) " >&6 else vi_cv_var_python3_abiflags= if ${vi_cv_path_python3} -c \ "import sys; sys.exit(${vi_cv_var_python3_version} < 3.2)" then vi_cv_var_python3_abiflags=`${vi_cv_path_python3} -c \ "import sys; print(sys.abiflags)"` fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_var_python3_abiflags" >&5 $as_echo "$vi_cv_var_python3_abiflags" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python's install prefix" >&5 $as_echo_n "checking Python's install prefix... " >&6; } if ${vi_cv_path_python3_pfx+:} false; then : $as_echo_n "(cached) " >&6 else vi_cv_path_python3_pfx=` ${vi_cv_path_python3} -c \ "import sys; print(sys.prefix)"` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python3_pfx" >&5 $as_echo "$vi_cv_path_python3_pfx" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python's execution prefix" >&5 $as_echo_n "checking Python's execution prefix... " >&6; } if ${vi_cv_path_python3_epfx+:} false; then : $as_echo_n "(cached) " >&6 else vi_cv_path_python3_epfx=` ${vi_cv_path_python3} -c \ "import sys; print(sys.exec_prefix)"` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python3_epfx" >&5 $as_echo "$vi_cv_path_python3_epfx" >&6; } if ${vi_cv_path_python3path+:} false; then : $as_echo_n "(cached) " >&6 else vi_cv_path_python3path=` unset PYTHONPATH; ${vi_cv_path_python3} -c \ "import sys, string; print(':'.join(sys.path))"` fi # Check whether --with-python3-config-dir was given. if test "${with_python3_config_dir+set}" = set; then : withval=$with_python3_config_dir; vi_cv_path_python3_conf="${withval}" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python's configuration directory" >&5 $as_echo_n "checking Python's configuration directory... " >&6; } if ${vi_cv_path_python3_conf+:} false; then : $as_echo_n "(cached) " >&6 else vi_cv_path_python3_conf= config_dir="config-${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}" d=`${vi_cv_path_python3} -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBPL'))"` if test -d "$d" && test -f "$d/config.c"; then vi_cv_path_python3_conf="$d" else for path in "${vi_cv_path_python3_pfx}" "${vi_cv_path_python3_epfx}"; do for subdir in lib64 lib share; do d="${path}/${subdir}/python${vi_cv_var_python3_version}/${config_dir}" if test -d "$d" && test -f "$d/config.c"; then vi_cv_path_python3_conf="$d" fi done done fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python3_conf" >&5 $as_echo "$vi_cv_path_python3_conf" >&6; } PYTHON3_CONFDIR="${vi_cv_path_python3_conf}" if test "X$PYTHON3_CONFDIR" = "X"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: can't find it!" >&5 $as_echo "can't find it!" >&6; } else if ${vi_cv_path_python3_plibs+:} false; then : $as_echo_n "(cached) " >&6 else pwd=`pwd` tmp_mkf="$pwd/config-PyMake$$" cat -- "${PYTHON3_CONFDIR}/Makefile" - <<'eof' >"${tmp_mkf}" __: @echo "python3_BASEMODLIBS='$(BASEMODLIBS)'" @echo "python3_LIBS='$(LIBS)'" @echo "python3_SYSLIBS='$(SYSLIBS)'" @echo "python3_DLLLIBRARY='$(DLLLIBRARY)'" @echo "python3_INSTSONAME='$(INSTSONAME)'" eof eval "`cd ${PYTHON3_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`" rm -f -- "${tmp_mkf}" vi_cv_path_python3_plibs="-L${PYTHON3_CONFDIR} -lpython${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}" vi_cv_path_python3_plibs="${vi_cv_path_python3_plibs} ${python3_BASEMODLIBS} ${python3_LIBS} ${python3_SYSLIBS}" vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-ltermcap//` vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-lffi//` fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python3's dll name" >&5 $as_echo_n "checking Python3's dll name... " >&6; } if ${vi_cv_dll_name_python3+:} false; then : $as_echo_n "(cached) " >&6 else if test "X$python3_DLLLIBRARY" != "X"; then vi_cv_dll_name_python3="$python3_DLLLIBRARY" else vi_cv_dll_name_python3="$python3_INSTSONAME" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_dll_name_python3" >&5 $as_echo "$vi_cv_dll_name_python3" >&6; } PYTHON3_LIBS="${vi_cv_path_python3_plibs}" if test "${vi_cv_path_python3_pfx}" = "${vi_cv_path_python3_epfx}"; then PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME='L\"${vi_cv_path_python3_pfx}\"'" else PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -I${vi_cv_path_python3_epfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME='L\"${vi_cv_path_python3_pfx}\"'" fi PYTHON3_SRC="if_python3.c" PYTHON3_OBJ="objects/if_python3.o" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if -pthread should be used" >&5 $as_echo_n "checking if -pthread should be used... " >&6; } threadsafe_flag= thread_lib= if test "`(uname) 2>/dev/null`" != Darwin; then test "$GCC" = yes && threadsafe_flag="-pthread" if test "`(uname) 2>/dev/null`" = FreeBSD; then threadsafe_flag="-D_THREAD_SAFE" thread_lib="-pthread" fi if test "`(uname) 2>/dev/null`" = SunOS; then threadsafe_flag="-pthreads" fi fi libs_save_old=$LIBS if test -n "$threadsafe_flag"; then cflags_save=$CFLAGS CFLAGS="$CFLAGS $threadsafe_flag" LIBS="$LIBS $thread_lib" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; PYTHON3_CFLAGS="$PYTHON3_CFLAGS $threadsafe_flag" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; }; LIBS=$libs_save_old fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$cflags_save else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compile and link flags for Python 3 are sane" >&5 $as_echo_n "checking if compile and link flags for Python 3 are sane... " >&6; } cflags_save=$CFLAGS libs_save=$LIBS CFLAGS="$CFLAGS $PYTHON3_CFLAGS" LIBS="$LIBS $PYTHON3_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; python3_ok=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no: PYTHON3 DISABLED" >&5 $as_echo "no: PYTHON3 DISABLED" >&6; }; python3_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$cflags_save LIBS=$libs_save if test "$python3_ok" = yes; then $as_echo "#define FEAT_PYTHON3 1" >>confdefs.h else LIBS=$libs_save_old PYTHON3_SRC= PYTHON3_OBJ= PYTHON3_LIBS= PYTHON3_CFLAGS= fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: too old" >&5 $as_echo "too old" >&6; } fi fi if test "$fail_if_missing" = "yes" -a "$python3_ok" != "yes"; then as_fn_error $? "could not configure python3" "$LINENO" 5 fi fi if test "$python_ok" = yes && test "$python3_ok" = yes; then $as_echo "#define DYNAMIC_PYTHON 1" >>confdefs.h $as_echo "#define DYNAMIC_PYTHON3 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can do without RTLD_GLOBAL for Python" >&5 $as_echo_n "checking whether we can do without RTLD_GLOBAL for Python... " >&6; } cflags_save=$CFLAGS CFLAGS="$CFLAGS $PYTHON_CFLAGS" libs_save=$LIBS LIBS="-ldl $LIBS" if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* If this program fails, then RTLD_GLOBAL is needed. * RTLD_GLOBAL will be used and then it is not possible to * have both python versions enabled in the same vim instance. * Only the first python version used will be switched on. */ int no_rtl_global_needed_for(char *python_instsoname, char *prefix) { int needed = 0; void* pylib = dlopen(python_instsoname, RTLD_LAZY|RTLD_LOCAL); if (pylib != 0) { void (*pfx)(char *home) = dlsym(pylib, "Py_SetPythonHome"); void (*init)(void) = dlsym(pylib, "Py_Initialize"); int (*simple)(char*) = dlsym(pylib, "PyRun_SimpleString"); void (*final)(void) = dlsym(pylib, "Py_Finalize"); (*pfx)(prefix); (*init)(); needed = (*simple)("import termios") == -1; (*final)(); dlclose(pylib); } return !needed; } int main(int argc, char** argv) { int not_needed = 0; if (no_rtl_global_needed_for("${vi_cv_dll_name_python}", "${vi_cv_path_python_pfx}")) not_needed = 1; return !not_needed; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; };$as_echo "#define PY_NO_RTLD_GLOBAL 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi CFLAGS=$cflags_save LIBS=$libs_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can do without RTLD_GLOBAL for Python3" >&5 $as_echo_n "checking whether we can do without RTLD_GLOBAL for Python3... " >&6; } cflags_save=$CFLAGS CFLAGS="$CFLAGS $PYTHON3_CFLAGS" libs_save=$LIBS LIBS="-ldl $LIBS" if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include /* If this program fails, then RTLD_GLOBAL is needed. * RTLD_GLOBAL will be used and then it is not possible to * have both python versions enabled in the same vim instance. * Only the first python version used will be switched on. */ int no_rtl_global_needed_for(char *python_instsoname, wchar_t *prefix) { int needed = 0; void* pylib = dlopen(python_instsoname, RTLD_LAZY|RTLD_LOCAL); if (pylib != 0) { void (*pfx)(wchar_t *home) = dlsym(pylib, "Py_SetPythonHome"); void (*init)(void) = dlsym(pylib, "Py_Initialize"); int (*simple)(char*) = dlsym(pylib, "PyRun_SimpleString"); void (*final)(void) = dlsym(pylib, "Py_Finalize"); (*pfx)(prefix); (*init)(); needed = (*simple)("import termios") == -1; (*final)(); dlclose(pylib); } return !needed; } int main(int argc, char** argv) { int not_needed = 0; if (no_rtl_global_needed_for("${vi_cv_dll_name_python3}", L"${vi_cv_path_python3_pfx}")) not_needed = 1; return !not_needed; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; };$as_echo "#define PY3_NO_RTLD_GLOBAL 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi CFLAGS=$cflags_save LIBS=$libs_save PYTHON_SRC="if_python.c" PYTHON_OBJ="objects/if_python.o" PYTHON_CFLAGS="$PYTHON_CFLAGS -DDYNAMIC_PYTHON_DLL=\\\"${vi_cv_dll_name_python}\\\"" PYTHON_LIBS= PYTHON3_SRC="if_python3.c" PYTHON3_OBJ="objects/if_python3.o" PYTHON3_CFLAGS="$PYTHON3_CFLAGS -DDYNAMIC_PYTHON3_DLL=\\\"${vi_cv_dll_name_python3}\\\"" PYTHON3_LIBS= elif test "$python_ok" = yes && test "$enable_pythoninterp" = "dynamic"; then $as_echo "#define DYNAMIC_PYTHON 1" >>confdefs.h PYTHON_SRC="if_python.c" PYTHON_OBJ="objects/if_python.o" PYTHON_CFLAGS="$PYTHON_CFLAGS -DDYNAMIC_PYTHON_DLL=\\\"${vi_cv_dll_name_python}\\\"" PYTHON_LIBS= elif test "$python_ok" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if -fPIE can be added for Python" >&5 $as_echo_n "checking if -fPIE can be added for Python... " >&6; } cflags_save=$CFLAGS libs_save=$LIBS CFLAGS="$CFLAGS $PYTHON_CFLAGS -fPIE" LIBS="$LIBS $PYTHON_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; fpie_ok=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; }; fpie_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$cflags_save LIBS=$libs_save if test $fpie_ok = yes; then PYTHON_CFLAGS="$PYTHON_CFLAGS -fPIE" fi elif test "$python3_ok" = yes && test "$enable_python3interp" = "dynamic"; then $as_echo "#define DYNAMIC_PYTHON3 1" >>confdefs.h PYTHON3_SRC="if_python3.c" PYTHON3_OBJ="objects/if_python3.o" PYTHON3_CFLAGS="$PYTHON3_CFLAGS -DDYNAMIC_PYTHON3_DLL=\\\"${vi_cv_dll_name_python3}\\\"" PYTHON3_LIBS= elif test "$python3_ok" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if -fPIE can be added for Python3" >&5 $as_echo_n "checking if -fPIE can be added for Python3... " >&6; } cflags_save=$CFLAGS libs_save=$LIBS CFLAGS="$CFLAGS $PYTHON3_CFLAGS -fPIE" LIBS="$LIBS $PYTHON3_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; fpie_ok=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; }; fpie_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$cflags_save LIBS=$libs_save if test $fpie_ok = yes; then PYTHON3_CFLAGS="$PYTHON3_CFLAGS -fPIE" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-tclinterp argument" >&5 $as_echo_n "checking --enable-tclinterp argument... " >&6; } # Check whether --enable-tclinterp was given. if test "${enable_tclinterp+set}" = set; then : enableval=$enable_tclinterp; else enable_tclinterp="no" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_tclinterp" >&5 $as_echo "$enable_tclinterp" >&6; } if test "$enable_tclinterp" = "yes" -o "$enable_tclinterp" = "dynamic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-tclsh argument" >&5 $as_echo_n "checking --with-tclsh argument... " >&6; } # Check whether --with-tclsh was given. if test "${with_tclsh+set}" = set; then : withval=$with_tclsh; tclsh_name="$withval"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tclsh_name" >&5 $as_echo "$tclsh_name" >&6; } else tclsh_name="tclsh8.5"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_vi_cv_path_tcl+:} false; then : $as_echo_n "(cached) " >&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. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_vi_cv_path_tcl="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi vi_cv_path_tcl=$ac_cv_path_vi_cv_path_tcl if test -n "$vi_cv_path_tcl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_tcl" >&5 $as_echo "$vi_cv_path_tcl" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "X$vi_cv_path_tcl" = "X" -a $tclsh_name = "tclsh8.5"; then tclsh_name="tclsh8.4" # Extract the first word of "$tclsh_name", so it can be a program name with args. set dummy $tclsh_name; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_vi_cv_path_tcl+:} false; then : $as_echo_n "(cached) " >&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. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_vi_cv_path_tcl="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi vi_cv_path_tcl=$ac_cv_path_vi_cv_path_tcl if test -n "$vi_cv_path_tcl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_tcl" >&5 $as_echo "$vi_cv_path_tcl" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test "X$vi_cv_path_tcl" = "X" -a $tclsh_name = "tclsh8.4"; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_vi_cv_path_tcl+:} false; then : $as_echo_n "(cached) " >&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. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_vi_cv_path_tcl="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi vi_cv_path_tcl=$ac_cv_path_vi_cv_path_tcl if test -n "$vi_cv_path_tcl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_tcl" >&5 $as_echo "$vi_cv_path_tcl" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test "X$vi_cv_path_tcl" = "X" -a $tclsh_name = "tclsh8.2"; then tclsh_name="tclsh8.0" # Extract the first word of "$tclsh_name", so it can be a program name with args. set dummy $tclsh_name; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_vi_cv_path_tcl+:} false; then : $as_echo_n "(cached) " >&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. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_vi_cv_path_tcl="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi vi_cv_path_tcl=$ac_cv_path_vi_cv_path_tcl if test -n "$vi_cv_path_tcl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_tcl" >&5 $as_echo "$vi_cv_path_tcl" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_vi_cv_path_tcl+:} false; then : $as_echo_n "(cached) " >&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. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_vi_cv_path_tcl="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi vi_cv_path_tcl=$ac_cv_path_vi_cv_path_tcl if test -n "$vi_cv_path_tcl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_tcl" >&5 $as_echo "$vi_cv_path_tcl" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test "X$vi_cv_path_tcl" != "X"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking Tcl version" >&5 $as_echo_n "checking Tcl version... " >&6; } if echo 'exit [expr [info tclversion] < 8.0]' | "$vi_cv_path_tcl" - ; then tclver=`echo 'puts [info tclversion]' | $vi_cv_path_tcl -` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tclver - OK" >&5 $as_echo "$tclver - OK" >&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 -` tcldll=`echo 'puts libtcl[info tclversion][info sharedlibextension]' | $vi_cv_path_tcl -` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of Tcl include" >&5 $as_echo_n "checking for location of Tcl include... " >&6; } if test "x$MACOSX" != "xyes"; then tclinc="$tclloc/include $tclloc/include/tcl $tclloc/include/tcl$tclver /usr/local/include /usr/local/include/tcl$tclver /usr/include /usr/include/tcl$tclver" else tclinc="/System/Library/Frameworks/Tcl.framework/Headers" fi TCL_INC= for try in $tclinc; do if test -f "$try/tcl.h"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $try/tcl.h" >&5 $as_echo "$try/tcl.h" >&6; } TCL_INC=$try break fi done if test -z "$TCL_INC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 $as_echo "" >&6; } SKIP_TCL=YES fi if test -z "$SKIP_TCL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of tclConfig.sh script" >&5 $as_echo_n "checking for location of tclConfig.sh script... " >&6; } if test "x$MACOSX" != "xyes"; then tclcnf=`echo $tclinc | sed s/include/lib/g` tclcnf="$tclcnf `echo $tclinc | sed s/include/lib64/g`" else tclcnf="/System/Library/Frameworks/Tcl.framework" fi for try in $tclcnf; do if test -f "$try/tclConfig.sh"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $try/tclConfig.sh" >&5 $as_echo "$try/tclConfig.sh" >&6; } . "$try/tclConfig.sh" if test "$enable_tclinterp" = "dynamic"; then TCL_LIBS=`eval echo "$TCL_STUB_LIB_SPEC $TCL_LIBS"` else TCL_LIBS=`eval echo "$TCL_LIB_SPEC $TCL_LIBS"` fi TCL_DEFS=`echo $TCL_DEFS | sed -e 's/\\\\ /\\\\X/g' | tr ' ' '\012' | sed -e '/^[^-]/d' -e '/^-[^D]/d' -e '/-D[^_]/d' -e 's/-D_/ -D_/' | tr '\012' ' ' | sed -e 's/\\\\X/\\\\ /g'` break fi done if test -z "$TCL_LIBS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 $as_echo "" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl library by myself" >&5 $as_echo_n "checking for Tcl library by myself... " >&6; } tcllib=`echo $tclinc | sed s/include/lib/g` tcllib="$tcllib `echo $tclinc | sed s/include/lib64/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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $try/lib$trylib" >&5 $as_echo "$try/lib$trylib" >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 $as_echo "" >&6; } SKIP_TCL=YES fi fi if test -z "$SKIP_TCL"; then $as_echo "#define FEAT_TCL 1" >>confdefs.h 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: too old; need Tcl version 8.0 or later" >&5 $as_echo "too old; need Tcl version 8.0 or later" >&6; } fi fi if test "$enable_tclinterp" = "dynamic"; then if test "X$TCL_SRC" != "X" -a "X$tcldll" != "X"; then $as_echo "#define DYNAMIC_TCL 1" >>confdefs.h TCL_CFLAGS="-DDYNAMIC_TCL_DLL=\\\"$tcldll\\\" -DDYNAMIC_TCL_VER=\\\"$tclver\\\" $TCL_CFLAGS" fi fi if test "$fail_if_missing" = "yes" -a -z "$TCL_SRC"; then as_fn_error $? "could not configure Tcl" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-rubyinterp argument" >&5 $as_echo_n "checking --enable-rubyinterp argument... " >&6; } # Check whether --enable-rubyinterp was given. if test "${enable_rubyinterp+set}" = set; then : enableval=$enable_rubyinterp; else enable_rubyinterp="no" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_rubyinterp" >&5 $as_echo "$enable_rubyinterp" >&6; } if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then as_fn_error $? "cannot use Ruby with tiny or small features" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-ruby-command argument" >&5 $as_echo_n "checking --with-ruby-command argument... " >&6; } # Check whether --with-ruby-command was given. if test "${with_ruby_command+set}" = set; then : withval=$with_ruby_command; RUBY_CMD="$withval"; vi_cv_path_ruby="$withval"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RUBY_CMD" >&5 $as_echo "$RUBY_CMD" >&6; } else RUBY_CMD="ruby"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: defaulting to $RUBY_CMD" >&5 $as_echo "defaulting to $RUBY_CMD" >&6; } fi # Extract the first word of "$RUBY_CMD", so it can be a program name with args. set dummy $RUBY_CMD; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_vi_cv_path_ruby+:} false; then : $as_echo_n "(cached) " >&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. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_vi_cv_path_ruby="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi vi_cv_path_ruby=$ac_cv_path_vi_cv_path_ruby if test -n "$vi_cv_path_ruby"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_ruby" >&5 $as_echo "$vi_cv_path_ruby" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "X$vi_cv_path_ruby" != "X"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking Ruby version" >&5 $as_echo_n "checking Ruby version... " >&6; } if $vi_cv_path_ruby -e '(VERSION rescue RUBY_VERSION) >= "1.6.0" or exit 1' >/dev/null 2>/dev/null; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5 $as_echo "OK" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking Ruby rbconfig" >&5 $as_echo_n "checking Ruby rbconfig... " >&6; } ruby_rbconfig="RbConfig" if ! $vi_cv_path_ruby -r rbconfig -e 'RbConfig' >/dev/null 2>/dev/null; then ruby_rbconfig="Config" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ruby_rbconfig" >&5 $as_echo "$ruby_rbconfig" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking Ruby header files" >&5 $as_echo_n "checking Ruby header files... " >&6; } rubyhdrdir=`$vi_cv_path_ruby -r mkmf -e "print $ruby_rbconfig::CONFIG['rubyhdrdir'] || $ruby_rbconfig::CONFIG['archdir'] || \\$hdrdir" 2>/dev/null` if test "X$rubyhdrdir" != "X"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $rubyhdrdir" >&5 $as_echo "$rubyhdrdir" >&6; } RUBY_CFLAGS="-I$rubyhdrdir" rubyarchdir=`$vi_cv_path_ruby -r rbconfig -e "print ($ruby_rbconfig::CONFIG.has_key? 'rubyarchhdrdir') ? $ruby_rbconfig::CONFIG['rubyarchhdrdir'] : '$rubyhdrdir/'+$ruby_rbconfig::CONFIG['arch']"` if test -d "$rubyarchdir"; then RUBY_CFLAGS="$RUBY_CFLAGS -I$rubyarchdir" fi rubyversion=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG['ruby_version'].gsub(/\./, '')[0,2]"` if test "X$rubyversion" = "X"; then rubyversion=`$vi_cv_path_ruby -e "print ((VERSION rescue RUBY_VERSION)).gsub(/\./, '')[0,2]"` fi RUBY_CFLAGS="$RUBY_CFLAGS -DRUBY_VERSION=$rubyversion" rubylibs=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG['LIBS']"` if test "X$rubylibs" != "X"; then RUBY_LIBS="$rubylibs" fi librubyarg=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG['LIBRUBYARG'])"` librubya=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG['LIBRUBY_A'])"` rubylibdir=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG['libdir'])"` if test -f "$rubylibdir/$librubya"; then librubyarg="$librubyarg" RUBY_LIBS="$RUBY_LIBS -L$rubylibdir" elif test "$librubyarg" = "libruby.a"; then librubyarg="-lruby" RUBY_LIBS="$RUBY_LIBS -L$rubylibdir" fi if test "X$librubyarg" != "X"; then RUBY_LIBS="$librubyarg $RUBY_LIBS" fi rubyldflags=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG['LDFLAGS']"` if test "X$rubyldflags" != "X"; then rubyldflags=`echo "$rubyldflags" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'` if test "X$rubyldflags" != "X"; then if test "X`echo \"$LDFLAGS\" | $FGREP -e \"$rubyldflags\"`" = "X"; then LDFLAGS="$rubyldflags $LDFLAGS" fi fi fi RUBY_SRC="if_ruby.c" RUBY_OBJ="objects/if_ruby.o" RUBY_PRO="if_ruby.pro" $as_echo "#define FEAT_RUBY 1" >>confdefs.h if test "$enable_rubyinterp" = "dynamic"; then libruby=`$vi_cv_path_ruby -r rbconfig -e "puts $ruby_rbconfig::CONFIG['LIBRUBY_SO']"` $as_echo "#define DYNAMIC_RUBY 1" >>confdefs.h RUBY_CFLAGS="-DDYNAMIC_RUBY_DLL=\\\"$libruby\\\" -DDYNAMIC_RUBY_VER=$rubyversion $RUBY_CFLAGS" RUBY_LIBS= fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found; disabling Ruby" >&5 $as_echo "not found; disabling Ruby" >&6; } fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: too old; need Ruby version 1.6.0 or later" >&5 $as_echo "too old; need Ruby version 1.6.0 or later" >&6; } fi fi if test "$fail_if_missing" = "yes" -a -z "$RUBY_OBJ"; then as_fn_error $? "could not configure Ruby" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-cscope argument" >&5 $as_echo_n "checking --enable-cscope argument... " >&6; } # Check whether --enable-cscope was given. if test "${enable_cscope+set}" = set; then : enableval=$enable_cscope; else enable_cscope="no" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_cscope" >&5 $as_echo "$enable_cscope" >&6; } if test "$enable_cscope" = "yes"; then $as_echo "#define FEAT_CSCOPE 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-workshop argument" >&5 $as_echo_n "checking --enable-workshop argument... " >&6; } # Check whether --enable-workshop was given. if test "${enable_workshop+set}" = set; then : enableval=$enable_workshop; else enable_workshop="no" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_workshop" >&5 $as_echo "$enable_workshop" >&6; } if test "$enable_workshop" = "yes"; then $as_echo "#define FEAT_SUN_WORKSHOP 1" >>confdefs.h 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking --disable-netbeans argument" >&5 $as_echo_n "checking --disable-netbeans argument... " >&6; } # Check whether --enable-netbeans was given. if test "${enable_netbeans+set}" = set; then : enableval=$enable_netbeans; else enable_netbeans="yes" fi if test "$enable_netbeans" = "yes"; then if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot use NetBeans with tiny or small features" >&5 $as_echo "cannot use NetBeans with tiny or small features" >&6; } enable_netbeans="no" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking --disable-channel argument" >&5 $as_echo_n "checking --disable-channel argument... " >&6; } # Check whether --enable-channel was given. if test "${enable_channel+set}" = set; then : enableval=$enable_channel; else enable_channel="yes" fi if test "$enable_channel" = "yes"; then if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot use channels with tiny or small features" >&5 $as_echo "cannot use channels with tiny or small features" >&6; } enable_channel="no" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else if test "$enable_netbeans" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, netbeans also disabled" >&5 $as_echo "yes, netbeans also disabled" >&6; } enable_netbeans="no" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi if test "$enable_channel" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 $as_echo_n "checking for socket in -lsocket... " >&6; } if ${ac_cv_lib_socket_socket+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char socket (); int main () { return socket (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_socket=yes else ac_cv_lib_socket_socket=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 $as_echo "$ac_cv_lib_socket_socket" >&6; } if test "x$ac_cv_lib_socket_socket" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF LIBS="-lsocket $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 $as_echo_n "checking for gethostbyname in -lnsl... " >&6; } if ${ac_cv_lib_nsl_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nsl_gethostbyname=yes else ac_cv_lib_nsl_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 $as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSL 1 _ACEOF LIBS="-lnsl $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiling with process communication is possible" >&5 $as_echo_n "checking whether compiling with process communication is possible... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include #include #include #include #include #include /* 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; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; }; enable_netbeans="no"; enable_channel="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test "$enable_netbeans" = "yes"; then $as_echo "#define FEAT_NETBEANS_INTG 1" >>confdefs.h NETBEANS_SRC="netbeans.c" NETBEANS_OBJ="objects/netbeans.o" fi if test "$enable_channel" = "yes"; then $as_echo "#define FEAT_JOB_CHANNEL 1" >>confdefs.h CHANNEL_SRC="channel.c" CHANNEL_OBJ="objects/channel.o" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-multibyte argument" >&5 $as_echo_n "checking --enable-multibyte argument... " >&6; } # Check whether --enable-multibyte was given. if test "${enable_multibyte+set}" = set; then : enableval=$enable_multibyte; else enable_multibyte="no" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_multibyte" >&5 $as_echo "$enable_multibyte" >&6; } if test "$enable_multibyte" = "yes"; then $as_echo "#define FEAT_MBYTE 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-hangulinput argument" >&5 $as_echo_n "checking --enable-hangulinput argument... " >&6; } # Check whether --enable-hangulinput was given. if test "${enable_hangulinput+set}" = set; then : enableval=$enable_hangulinput; else enable_hangulinput="no" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_hangulinput" >&5 $as_echo "$enable_hangulinput" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-xim argument" >&5 $as_echo_n "checking --enable-xim argument... " >&6; } # Check whether --enable-xim was given. if test "${enable_xim+set}" = set; then : enableval=$enable_xim; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_xim" >&5 $as_echo "$enable_xim" >&6; } else enable_xim="auto"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: defaulting to auto" >&5 $as_echo "defaulting to auto" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-fontset argument" >&5 $as_echo_n "checking --enable-fontset argument... " >&6; } # Check whether --enable-fontset was given. if test "${enable_fontset+set}" = set; then : enableval=$enable_fontset; else enable_fontset="no" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_fontset" >&5 $as_echo "$enable_fontset" >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: defaulting to: don't HAVE_X11" >&5 $as_echo "defaulting to: don't HAVE_X11" >&6; } else # Extract the first word of "xmkmf", so it can be a program name with args. set dummy xmkmf; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_xmkmfpath+:} false; then : $as_echo_n "(cached) " >&6 else case $xmkmfpath in [\\/]* | ?:[\\/]*) ac_cv_path_xmkmfpath="$xmkmfpath" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_xmkmfpath="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi xmkmfpath=$ac_cv_path_xmkmfpath if test -n "$xmkmfpath"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xmkmfpath" >&5 $as_echo "$xmkmfpath" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5 $as_echo_n "checking for X... " >&6; } # Check whether --with-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 case $x_includes,$x_libraries in #( *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then : $as_echo_n "(cached) " >&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 -f -r conftest.dir if mkdir conftest.dir; then cd conftest.dir cat >Imakefile <<'_ACEOF' incroot: @echo incroot='${INCROOT}' usrlibdir: @echo usrlibdir='${USRLIBDIR}' libdir: @echo libdir='${LIBDIR}' _ACEOF if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. for ac_var in incroot usrlibdir libdir; do eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" done # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. for ac_extension in a so sl dylib la dll; 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) ac_x_includes= ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac case $ac_im_usrlibdir in /usr/lib | /usr/lib64 | /lib | /lib64) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. rm -f -r conftest.dir fi # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include /usr/X11R7/include /usr/X11R6/include /usr/X11R5/include /usr/X11R4/include /usr/include/X11 /usr/include/X11R7 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include /usr/local/X11R7/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 /usr/local/include/X11R7 /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' if test "$ac_x_includes" = no; then # Guess where to find include files, by looking for Xlib.h. # First, try using that file with no special directory specified. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # We can compile using X headers with no special include directory. ac_x_includes= else for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir break fi done fi rm -f conftest.err conftest.i conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS LIBS="-lX11 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { XrmInitialize () ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else LIBS=$ac_save_LIBS for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl dylib la dll; do if test -r "$ac_dir/libX11.$ac_extension"; then ac_x_libraries=$ac_dir break 2 fi done done fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no case $ac_x_includes,$ac_x_libraries in #( no,* | *,no | *\'*) # Didn't find X, or a directory has "'" in its name. ac_cv_have_x="have_x=no";; #( *) # 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'" esac fi ;; #( *) have_x=yes;; esac eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5 $as_echo "$have_x" >&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'" { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5 $as_echo "libraries $x_libraries, headers $x_includes" >&6; } fi if test "$no_x" = yes; then # Not all programs may use this symbol, but it does not hurt to define it. $as_echo "#define X_DISPLAY_MISSING 1" >>confdefs.h 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 . . . . { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -R must be followed by a space" >&5 $as_echo_n "checking whether -R must be followed by a space... " >&6; } ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" ac_xsave_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } X_LIBS="$X_LIBS -R$x_libraries" else LIBS="$ac_xsave_LIBS -R $x_libraries" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } X_LIBS="$X_LIBS -R $x_libraries" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: neither works" >&5 $as_echo "neither works" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_c_werror_flag=$ac_xsave_c_werror_flag LIBS=$ac_xsave_LIBS 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 says this is needed for Ultrix, if the X # libraries were built with DECnet support. And Karl Berry says # the Alpha needs dnet_stub (dnet does not exist). ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XOpenDisplay (); int main () { return XOpenDisplay (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5 $as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; } if ${ac_cv_lib_dnet_dnet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dnet_dnet_ntoa=yes else ac_cv_lib_dnet_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 $as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; } if test "x$ac_cv_lib_dnet_dnet_ntoa" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5 $as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; } if ${ac_cv_lib_dnet_stub_dnet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet_stub $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dnet_stub_dnet_ntoa=yes else ac_cv_lib_dnet_stub_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 $as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" fi fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_xsave_LIBS" # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, # to get the SysV transport functions. # Chad R. Larson 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 T.E. Dickey. # The functions gethostbyname, getservbyname, and inet_addr are # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" if test "x$ac_cv_func_gethostbyname" = xyes; then : fi if test $ac_cv_func_gethostbyname = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 $as_echo_n "checking for gethostbyname in -lnsl... " >&6; } if ${ac_cv_lib_nsl_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nsl_gethostbyname=yes else ac_cv_lib_nsl_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 $as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" fi if test $ac_cv_lib_nsl_gethostbyname = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5 $as_echo_n "checking for gethostbyname in -lbsd... " >&6; } if ${ac_cv_lib_bsd_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bsd_gethostbyname=yes else ac_cv_lib_bsd_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5 $as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; } if test "x$ac_cv_lib_bsd_gethostbyname" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" fi 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 Leinen: it contains gethostby* # variants that don't use the name server (or something). -lsocket # must be given before -lnsl if both are needed. We assume that # if connect needs -lnsl, so does gethostbyname. ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect" if test "x$ac_cv_func_connect" = xyes; then : fi if test $ac_cv_func_connect = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5 $as_echo_n "checking for connect in -lsocket... " >&6; } if ${ac_cv_lib_socket_connect+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char connect (); int main () { return connect (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_connect=yes else ac_cv_lib_socket_connect=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5 $as_echo "$ac_cv_lib_socket_connect" >&6; } if test "x$ac_cv_lib_socket_connect" = xyes; then : X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" fi fi # Guillermo Gomez says -lposix is necessary on A/UX. ac_fn_c_check_func "$LINENO" "remove" "ac_cv_func_remove" if test "x$ac_cv_func_remove" = xyes; then : fi if test $ac_cv_func_remove = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5 $as_echo_n "checking for remove in -lposix... " >&6; } if ${ac_cv_lib_posix_remove+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lposix $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char remove (); int main () { return remove (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_posix_remove=yes else ac_cv_lib_posix_remove=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5 $as_echo "$ac_cv_lib_posix_remove" >&6; } if test "x$ac_cv_lib_posix_remove" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" fi fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. ac_fn_c_check_func "$LINENO" "shmat" "ac_cv_func_shmat" if test "x$ac_cv_func_shmat" = xyes; then : fi if test $ac_cv_func_shmat = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5 $as_echo_n "checking for shmat in -lipc... " >&6; } if ${ac_cv_lib_ipc_shmat+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shmat (); int main () { return shmat (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ipc_shmat=yes else ac_cv_lib_ipc_shmat=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5 $as_echo "$ac_cv_lib_ipc_shmat" >&6; } if test "x$ac_cv_lib_ipc_shmat" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" 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. # John Interrante, Karl Berry { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5 $as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; } if ${ac_cv_lib_ICE_IceConnectionNumber+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char IceConnectionNumber (); int main () { return IceConnectionNumber (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ICE_IceConnectionNumber=yes else ac_cv_lib_ICE_IceConnectionNumber=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 $as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; } if test "x$ac_cv_lib_ICE_IceConnectionNumber" = xyes; then : X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" fi LDFLAGS=$ac_save_LDFLAGS fi if test "$zOSUnix" = "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/` { $as_echo "$as_me:${as_lineno-$LINENO}: result: Corrected X libraries to $x_libraries" >&5 $as_echo "Corrected X libraries to $x_libraries" >&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/` { $as_echo "$as_me:${as_lineno-$LINENO}: result: Corrected X includes to $x_includes" >&5 $as_echo "Corrected X includes to $x_includes" >&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 %%'`" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if X11 header files can be found" >&5 $as_echo_n "checking if X11 header files can be found... " >&6; } cflags_save=$CFLAGS CFLAGS="$CFLAGS $X_CFLAGS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; }; no_x=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$cflags_save if test "${no_x-no}" = yes; then with_x=no else $as_echo "#define HAVE_X11 1" >>confdefs.h X_LIB="-lXt -lX11"; ac_save_LDFLAGS="$LDFLAGS" LDFLAGS="-L$x_libraries $LDFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _XdmcpAuthDoIt in -lXdmcp" >&5 $as_echo_n "checking for _XdmcpAuthDoIt in -lXdmcp... " >&6; } if ${ac_cv_lib_Xdmcp__XdmcpAuthDoIt+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXdmcp -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS -lXdmcp $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char _XdmcpAuthDoIt (); int main () { return _XdmcpAuthDoIt (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xdmcp__XdmcpAuthDoIt=yes else ac_cv_lib_Xdmcp__XdmcpAuthDoIt=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xdmcp__XdmcpAuthDoIt" >&5 $as_echo "$ac_cv_lib_Xdmcp__XdmcpAuthDoIt" >&6; } if test "x$ac_cv_lib_Xdmcp__XdmcpAuthDoIt" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lXdmcp" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IceOpenConnection in -lICE" >&5 $as_echo_n "checking for IceOpenConnection in -lICE... " >&6; } if ${ac_cv_lib_ICE_IceOpenConnection+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char IceOpenConnection (); int main () { return IceOpenConnection (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ICE_IceOpenConnection=yes else ac_cv_lib_ICE_IceOpenConnection=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceOpenConnection" >&5 $as_echo "$ac_cv_lib_ICE_IceOpenConnection" >&6; } if test "x$ac_cv_lib_ICE_IceOpenConnection" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lSM -lICE" fi LDFLAGS="$X_LIBS $ac_save_LDFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XpmCreatePixmapFromData in -lXpm" >&5 $as_echo_n "checking for XpmCreatePixmapFromData in -lXpm... " >&6; } if ${ac_cv_lib_Xpm_XpmCreatePixmapFromData+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXpm -lXt $X_PRE_LIBS -lXpm -lX11 $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XpmCreatePixmapFromData (); int main () { return XpmCreatePixmapFromData (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xpm_XpmCreatePixmapFromData=yes else ac_cv_lib_Xpm_XpmCreatePixmapFromData=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xpm_XpmCreatePixmapFromData" >&5 $as_echo "$ac_cv_lib_Xpm_XpmCreatePixmapFromData" >&6; } if test "x$ac_cv_lib_Xpm_XpmCreatePixmapFromData" = xyes; then : X_PRE_LIBS="$X_PRE_LIBS -lXpm" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if X11 header files implicitly declare return values" >&5 $as_echo_n "checking if X11 header files implicitly declare return values... " >&6; } cflags_save=$CFLAGS if test "$GCC" = yes; then CFLAGS="$CFLAGS $X_CFLAGS -Werror" else CFLAGS="$CFLAGS $X_CFLAGS" fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else CFLAGS="$CFLAGS -Wno-implicit-int" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; cflags_save="$cflags_save -Wno-implicit-int" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: test failed" >&5 $as_echo "test failed" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$cflags_save LDFLAGS="$ac_save_LDFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of wchar_t is 2 bytes" >&5 $as_echo_n "checking size of wchar_t is 2 bytes... " >&6; } if ${ac_cv_small_wchar_t+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : as_fn_error $? "failed to compile test program" "$LINENO" 5 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #if STDC_HEADERS # include # include #endif main() { if (sizeof(wchar_t) <= 2) exit(1); exit(0); } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_small_wchar_t="no" else ac_cv_small_wchar_t="yes" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_small_wchar_t" >&5 $as_echo "$ac_cv_small_wchar_t" >&6; } if test "x$ac_cv_small_wchar_t" = "xyes" ; then $as_echo "#define SMALL_WCHAR_T 1" >>confdefs.h fi fi fi test "x$with_x" = xno -a "x$MACOSX" != "xyes" -a "x$QNX" != "xyes" && enable_gui=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-gui argument" >&5 $as_echo_n "checking --enable-gui argument... " >&6; } # Check whether --enable-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_GTK2=YES SKIP_GTK3=YES SKIP_GNOME=YES SKIP_MOTIF=YES SKIP_ATHENA=YES SKIP_NEXTAW=YES SKIP_PHOTON=YES SKIP_CARBON=YES GUITYPE=NONE if test "x$QNX" = "xyes" -a "x$with_x" = "xno" ; then SKIP_PHOTON= case "$enable_gui_canon" in no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no GUI support" >&5 $as_echo "no GUI support" >&6; } SKIP_PHOTON=YES ;; yes|"") { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes - automatic GUI support" >&5 $as_echo "yes - automatic GUI support" >&6; } ;; auto) { $as_echo "$as_me:${as_lineno-$LINENO}: result: auto - automatic GUI support" >&5 $as_echo "auto - automatic GUI support" >&6; } ;; photon) { $as_echo "$as_me:${as_lineno-$LINENO}: result: Photon GUI support" >&5 $as_echo "Photon GUI support" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: Sorry, $enable_gui GUI is not supported" >&5 $as_echo "Sorry, $enable_gui GUI is not supported" >&6; } SKIP_PHOTON=YES ;; esac elif test "x$MACOSX" = "xyes" -a "x$with_x" = "xno" ; then SKIP_CARBON= case "$enable_gui_canon" in no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no GUI support" >&5 $as_echo "no GUI support" >&6; } SKIP_CARBON=YES ;; yes|"") { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes - automatic GUI support" >&5 $as_echo "yes - automatic GUI support" >&6; } ;; auto) { $as_echo "$as_me:${as_lineno-$LINENO}: result: auto - Carbon GUI is outdated - disable GUI support" >&5 $as_echo "auto - Carbon GUI is outdated - disable GUI support" >&6; } SKIP_CARBON=YES ;; carbon) { $as_echo "$as_me:${as_lineno-$LINENO}: result: Carbon GUI support" >&5 $as_echo "Carbon GUI support" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: Sorry, $enable_gui GUI is not supported" >&5 $as_echo "Sorry, $enable_gui GUI is not supported" >&6; } SKIP_CARBON=YES ;; esac else case "$enable_gui_canon" in no|none) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no GUI support" >&5 $as_echo "no GUI support" >&6; } ;; yes|""|auto) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes/auto - automatic GUI support" >&5 $as_echo "yes/auto - automatic GUI support" >&6; } SKIP_GTK2= SKIP_GNOME= SKIP_MOTIF= SKIP_ATHENA= SKIP_NEXTAW= SKIP_CARBON=;; gtk2) { $as_echo "$as_me:${as_lineno-$LINENO}: result: GTK+ 2.x GUI support" >&5 $as_echo "GTK+ 2.x GUI support" >&6; } SKIP_GTK2=;; gnome2) { $as_echo "$as_me:${as_lineno-$LINENO}: result: GNOME 2.x GUI support" >&5 $as_echo "GNOME 2.x GUI support" >&6; } SKIP_GNOME= SKIP_GTK2=;; gtk3) { $as_echo "$as_me:${as_lineno-$LINENO}: result: GTK+ 3.x GUI support" >&5 $as_echo "GTK+ 3.x GUI support" >&6; } SKIP_GTK3=;; motif) { $as_echo "$as_me:${as_lineno-$LINENO}: result: Motif GUI support" >&5 $as_echo "Motif GUI support" >&6; } SKIP_MOTIF=;; athena) { $as_echo "$as_me:${as_lineno-$LINENO}: result: Athena GUI support" >&5 $as_echo "Athena GUI support" >&6; } SKIP_ATHENA=;; nextaw) { $as_echo "$as_me:${as_lineno-$LINENO}: result: neXtaw GUI support" >&5 $as_echo "neXtaw GUI support" >&6; } SKIP_NEXTAW=;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: Sorry, $enable_gui GUI is not supported" >&5 $as_echo "Sorry, $enable_gui GUI is not supported" >&6; } ;; esac fi if test "x$SKIP_GTK2" != "xYES" -a "$enable_gui_canon" != "gtk2" \ -a "$enable_gui_canon" != "gnome2"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether or not to look for GTK+ 2" >&5 $as_echo_n "checking whether or not to look for GTK+ 2... " >&6; } # Check whether --enable-gtk2-check was given. if test "${enable_gtk2_check+set}" = set; then : enableval=$enable_gtk2_check; else enable_gtk2_check="yes" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_gtk2_check" >&5 $as_echo "$enable_gtk2_check" >&6; } if test "x$enable_gtk2_check" = "xno"; then SKIP_GTK2=YES SKIP_GNOME=YES fi fi if test "x$SKIP_GNOME" != "xYES" -a "$enable_gui_canon" != "gnome2"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether or not to look for GNOME" >&5 $as_echo_n "checking whether or not to look for GNOME... " >&6; } # Check whether --enable-gnome-check was given. if test "${enable_gnome_check+set}" = set; then : enableval=$enable_gnome_check; else enable_gnome_check="no" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_gnome_check" >&5 $as_echo "$enable_gnome_check" >&6; } if test "x$enable_gnome_check" = "xno"; then SKIP_GNOME=YES fi fi if test "x$SKIP_GTK3" != "xYES" -a "$enable_gui_canon" != "gtk3"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether or not to look for GTK+ 3" >&5 $as_echo_n "checking whether or not to look for GTK+ 3... " >&6; } # Check whether --enable-gtk3-check was given. if test "${enable_gtk3_check+set}" = set; then : enableval=$enable_gtk3_check; else enable_gtk3_check="yes" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_gtk3_check" >&5 $as_echo "$enable_gtk3_check" >&6; } if test "x$enable_gtk3_check" = "xno"; then SKIP_GTK3=YES fi fi if test "x$SKIP_MOTIF" != "xYES" -a "$enable_gui_canon" != "motif"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether or not to look for Motif" >&5 $as_echo_n "checking whether or not to look for Motif... " >&6; } # Check whether --enable-motif-check was given. if test "${enable_motif_check+set}" = set; then : enableval=$enable_motif_check; else enable_motif_check="yes" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_motif_check" >&5 $as_echo "$enable_motif_check" >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether or not to look for Athena" >&5 $as_echo_n "checking whether or not to look for Athena... " >&6; } # Check whether --enable-athena-check was given. if test "${enable_athena_check+set}" = set; then : enableval=$enable_athena_check; else enable_athena_check="yes" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_athena_check" >&5 $as_echo "$enable_athena_check" >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether or not to look for neXtaw" >&5 $as_echo_n "checking whether or not to look for neXtaw... " >&6; } # Check whether --enable-nextaw-check was given. if test "${enable_nextaw_check+set}" = set; then : enableval=$enable_nextaw_check; else enable_nextaw_check="yes" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_nextaw_check" >&5 $as_echo "$enable_nextaw_check" >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether or not to look for Carbon" >&5 $as_echo_n "checking whether or not to look for Carbon... " >&6; } # Check whether --enable-carbon-check was given. if test "${enable_carbon_check+set}" = set; then : enableval=$enable_carbon_check; else enable_carbon_check="yes" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_carbon_check" >&5 $as_echo "$enable_carbon_check" >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Carbon GUI" >&5 $as_echo_n "checking for Carbon GUI... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; GUITYPE=CARBONGUI if test "$VIMNAME" = "vim"; then VIMNAME=Vim fi if test "x$MACARCH" = "xboth"; then CPPFLAGS="$CPPFLAGS -I$DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk/Developer/Headers/FlatCarbon" else CPPFLAGS="$CPPFLAGS -I$DEVELOPER_DIR/Headers/FlatCarbon" fi if test x$prefix = xNONE; then prefix=/Applications fi datadir='${prefix}/Vim.app/Contents/Resources' SKIP_GTK2=YES; SKIP_GNOME=YES; SKIP_MOTIF=YES; SKIP_ATHENA=YES; SKIP_NEXTAW=YES; SKIP_PHOTON=YES; SKIP_CARBON=YES fi if test -z "$SKIP_GTK2"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking --disable-gtktest argument" >&5 $as_echo_n "checking --disable-gtktest argument... " >&6; } # Check whether --enable-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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: gtk test enabled" >&5 $as_echo "gtk test enabled" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: gtk test disabled" >&5 $as_echo "gtk test disabled" >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test "x$PKG_CONFIG" != "xno"; then if test "X$GTK_CONFIG" != "Xno" -o "X$PKG_CONFIG" != "Xno"; then { no_gtk="" if (test "X$SKIP_GTK2" != "XYES" -a "X$PKG_CONFIG" != "Xno") \ && $PKG_CONFIG --exists gtk+-2.0; then { min_gtk_version=2.2.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTK - version >= $min_gtk_version" >&5 $as_echo_n "checking for GTK - version >= $min_gtk_version... " >&6; } GTK_CFLAGS=`$PKG_CONFIG --cflags gtk+-2.0` GTK_LIBDIR=`$PKG_CONFIG --libs-only-L 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$SKIP_GTK3" != "XYES" -a "X$PKG_CONFIG" != "Xno") \ && $PKG_CONFIG --exists gtk+-3.0; then { min_gtk_version=2.2.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTK - version >= $min_gtk_version" >&5 $as_echo_n "checking for GTK - version >= $min_gtk_version... " >&6; } GTK_CFLAGS=`$PKG_CONFIG --cflags gtk+-3.0` GTK_LIBDIR=`$PKG_CONFIG --libs-only-L gtk+-3.0` GTK_LIBS=`$PKG_CONFIG --libs gtk+-3.0` gtk_major_version=`$PKG_CONFIG --modversion gtk+-3.0 | \ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\1/'` gtk_minor_version=`$PKG_CONFIG --modversion gtk+-3.0 | \ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\2/'` gtk_micro_version=`$PKG_CONFIG --modversion gtk+-3.0 | \ 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if STDC_HEADERS # include # include #endif 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, µ) != 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; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else no_gtk=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" } fi if test "x$no_gtk" = x ; then if test "x$enable_gtktest" = "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes; found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version" >&5 $as_echo "yes; found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version" >&5 $as_echo "found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version" >&6; } fi GUI_LIB_LOC="$GTK_LIBDIR" GTK_LIBNAME="$GTK_LIBS" GUI_INC_LOC="$GTK_CFLAGS" else { { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } GTK_CFLAGS="" GTK_LIBS="" : } fi } else GTK_CFLAGS="" GTK_LIBS="" : fi rm -f conf.gtktest if test "x$GTK_CFLAGS" != "x"; then SKIP_GTK3=YES SKIP_ATHENA=YES SKIP_NEXTAW=YES SKIP_MOTIF=YES GUITYPE=GTK fi fi if test "x$GUITYPE" = "xGTK"; then if test "$gtk_minor_version" = 1 -a "0$gtk_micro_version" -ge 1 \ || test "0$gtk_minor_version" -ge 2; then $as_echo "#define HAVE_GTK_MULTIHEAD 1" >>confdefs.h fi if test -z "$SKIP_GNOME"; then { # Check whether --with-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 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 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; then { { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libgnomeui-2.0" >&5 $as_echo_n "checking for libgnomeui-2.0... " >&6; } if $PKG_CONFIG --exists libgnomeui-2.0; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&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` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FreeBSD" >&5 $as_echo_n "checking for FreeBSD... " >&6; } if test "`(uname) 2>/dev/null`" = FreeBSD; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } GNOME_INCLUDEDIR="$GNOME_INCLUDEDIR -D_THREAD_SAFE" GNOME_LIBS="$GNOME_LIBS -pthread" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi have_gnome=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } if test "x" = xfail; then as_fn_error $? "Could not find libgnomeui-2.0 via pkg-config" "$LINENO" 5 fi fi } fi if test "x$have_gnome" = xyes ; then $as_echo "#define FEAT_GUI_GNOME 1" >>confdefs.h GUI_INC_LOC="$GUI_INC_LOC $GNOME_INCLUDEDIR" GTK_LIBNAME="$GTK_LIBNAME $GNOME_LIBDIR $GNOME_LIBS" fi } fi fi fi if test -z "$SKIP_GTK3"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking --disable-gtktest argument" >&5 $as_echo_n "checking --disable-gtktest argument... " >&6; } # Check whether --enable-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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: gtk test enabled" >&5 $as_echo "gtk test enabled" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: gtk test disabled" >&5 $as_echo "gtk test disabled" >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test "x$PKG_CONFIG" != "xno"; then if test "X$GTK_CONFIG" != "Xno" -o "X$PKG_CONFIG" != "Xno"; then { no_gtk="" if (test "X$SKIP_GTK2" != "XYES" -a "X$PKG_CONFIG" != "Xno") \ && $PKG_CONFIG --exists gtk+-2.0; then { min_gtk_version=3.0.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTK - version >= $min_gtk_version" >&5 $as_echo_n "checking for GTK - version >= $min_gtk_version... " >&6; } GTK_CFLAGS=`$PKG_CONFIG --cflags gtk+-2.0` GTK_LIBDIR=`$PKG_CONFIG --libs-only-L 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$SKIP_GTK3" != "XYES" -a "X$PKG_CONFIG" != "Xno") \ && $PKG_CONFIG --exists gtk+-3.0; then { min_gtk_version=3.0.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTK - version >= $min_gtk_version" >&5 $as_echo_n "checking for GTK - version >= $min_gtk_version... " >&6; } GTK_CFLAGS=`$PKG_CONFIG --cflags gtk+-3.0` GTK_LIBDIR=`$PKG_CONFIG --libs-only-L gtk+-3.0` GTK_LIBS=`$PKG_CONFIG --libs gtk+-3.0` gtk_major_version=`$PKG_CONFIG --modversion gtk+-3.0 | \ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\1/'` gtk_minor_version=`$PKG_CONFIG --modversion gtk+-3.0 | \ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\2/'` gtk_micro_version=`$PKG_CONFIG --modversion gtk+-3.0 | \ 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if STDC_HEADERS # include # include #endif 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, µ) != 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; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else no_gtk=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" } fi if test "x$no_gtk" = x ; then if test "x$enable_gtktest" = "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes; found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version" >&5 $as_echo "yes; found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version" >&5 $as_echo "found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version" >&6; } fi GUI_LIB_LOC="$GTK_LIBDIR" GTK_LIBNAME="$GTK_LIBS" GUI_INC_LOC="$GTK_CFLAGS" else { { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } GTK_CFLAGS="" GTK_LIBS="" : } fi } else GTK_CFLAGS="" GTK_LIBS="" : fi rm -f conf.gtktest if test "x$GTK_CFLAGS" != "x"; then SKIP_GTK2=YES SKIP_GNOME=YES SKIP_ATHENA=YES SKIP_NEXTAW=YES SKIP_MOTIF=YES GUITYPE=GTK $as_echo "#define HAVE_GTK_MULTIHEAD 1" >>confdefs.h $as_echo "#define USE_GTK3 1" >>confdefs.h fi fi fi if test "x$GUITYPE" = "xGTK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of Gdk-Pixbuf" >&5 $as_echo_n "checking version of Gdk-Pixbuf... " >&6; } gdk_pixbuf_version=`$PKG_CONFIG --modversion gdk-pixbuf-2.0` if test "x$gdk_pixbuf_version" != x ; then gdk_pixbuf_version_minor=`echo $gdk_pixbuf_version | \ sed -e 's/[0-9][0-9]*\.\([0-9][0-9]*\)\.[0-9][0-9]*/\1/'` if test "x$gdk_pixbuf_version_minor" != x -a \ $gdk_pixbuf_version_minor -ge 31 ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK." >&5 $as_echo "OK." >&6; } # Extract the first word of "glib-compile-resources", so it can be a program name with args. set dummy glib-compile-resources; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GLIB_COMPILE_RESOURCES+:} false; then : $as_echo_n "(cached) " >&6 else case $GLIB_COMPILE_RESOURCES in [\\/]* | ?:[\\/]*) ac_cv_path_GLIB_COMPILE_RESOURCES="$GLIB_COMPILE_RESOURCES" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GLIB_COMPILE_RESOURCES="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GLIB_COMPILE_RESOURCES" && ac_cv_path_GLIB_COMPILE_RESOURCES="no" ;; esac fi GLIB_COMPILE_RESOURCES=$ac_cv_path_GLIB_COMPILE_RESOURCES if test -n "$GLIB_COMPILE_RESOURCES"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GLIB_COMPILE_RESOURCES" >&5 $as_echo "$GLIB_COMPILE_RESOURCES" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking glib-compile-resources" >&5 $as_echo_n "checking glib-compile-resources... " >&6; } if test "x$GLIB_COMPILE_RESOURCES" = xno ; then GLIB_COMPILE_RESOURCES="" { $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot be found in PATH." >&5 $as_echo "cannot be found in PATH." >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: usable." >&5 $as_echo "usable." >&6; } $as_echo "#define USE_GRESOURCE 1" >>confdefs.h GRESOURCE_SRC="auto/gui_gtk_gresources.c" GRESOURCE_OBJ="objects/gui_gtk_gresources.o" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not usable." >&5 $as_echo "not usable." >&6; } fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot obtain from pkg_config." >&5 $as_echo "cannot obtain from pkg_config." >&6; } 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'`" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of Motif GUI includes" >&5 $as_echo_n "checking for location of Motif GUI includes... " >&6; } 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= { $as_echo "$as_me:${as_lineno-$LINENO}: result: in default path" >&5 $as_echo "in default path" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GUI_INC_LOC" >&5 $as_echo "$GUI_INC_LOC" >&6; } fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 $as_echo "" >&6; } SKIP_MOTIF=YES fi fi if test -z "$SKIP_MOTIF"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-motif-lib argument" >&5 $as_echo_n "checking --with-motif-lib argument... " >&6; } # Check whether --with-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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOTIF_LIBNAME" >&5 $as_echo "$MOTIF_LIBNAME" >&6; } GUI_LIB_LOC= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } GUI_LIB_LOC="`echo $GUI_LIB_LOC|sed 's%-L%%g'`" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of Motif GUI libs" >&5 $as_echo_n "checking for location of Motif GUI libs... " >&6; } gui_libs="`echo $x_libraries|sed 's%/^/^/*$%%'` `echo "$gui_XXX" | sed s/XXX/lib/g` /usr/lib/i386-linux-gnu /usr/lib/x86_64-linux-gnu `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 "$try"/libXm.dylib; 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 \ -o "$GUI_LIB_LOC" = /usr/lib/i386-linux-gnu \ -o "$GUI_LIB_LOC" = /usr/lib/x86_64-linux-gnu; then GUI_LIB_LOC= { $as_echo "$as_me:${as_lineno-$LINENO}: result: in default path" >&5 $as_echo "in default path" >&6; } else if test -n "$GUI_LIB_LOC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GUI_LIB_LOC" >&5 $as_echo "$GUI_LIB_LOC" >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 $as_echo "" >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Athena header files can be found" >&5 $as_echo_n "checking if Athena header files can be found... " >&6; } cflags_save=$CFLAGS CFLAGS="$CFLAGS $X_CFLAGS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; }; SKIP_ATHENA=YES fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$cflags_save fi if test -z "$SKIP_ATHENA"; then GUITYPE=ATHENA fi if test -z "$SKIP_NEXTAW"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if neXtaw header files can be found" >&5 $as_echo_n "checking if neXtaw header files can be found... " >&6; } cflags_save=$CFLAGS CFLAGS="$CFLAGS $X_CFLAGS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; }; SKIP_NEXTAW=YES fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 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" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XShapeQueryExtension in -lXext" >&5 $as_echo_n "checking for XShapeQueryExtension in -lXext... " >&6; } if ${ac_cv_lib_Xext_XShapeQueryExtension+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXext -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XShapeQueryExtension (); int main () { return XShapeQueryExtension (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xext_XShapeQueryExtension=yes else ac_cv_lib_Xext_XShapeQueryExtension=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xext_XShapeQueryExtension" >&5 $as_echo "$ac_cv_lib_Xext_XShapeQueryExtension" >&6; } if test "x$ac_cv_lib_Xext_XShapeQueryExtension" = xyes; then : GUI_X_LIBS="-lXext" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wslen in -lw" >&5 $as_echo_n "checking for wslen in -lw... " >&6; } if ${ac_cv_lib_w_wslen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lw $GUI_X_LIBS -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char wslen (); int main () { return wslen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_w_wslen=yes else ac_cv_lib_w_wslen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_w_wslen" >&5 $as_echo "$ac_cv_lib_w_wslen" >&6; } if test "x$ac_cv_lib_w_wslen" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lw" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlsym in -ldl" >&5 $as_echo_n "checking for dlsym in -ldl... " >&6; } if ${ac_cv_lib_dl_dlsym+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $GUI_X_LIBS -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlsym (); int main () { return dlsym (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlsym=yes else ac_cv_lib_dl_dlsym=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlsym" >&5 $as_echo "$ac_cv_lib_dl_dlsym" >&6; } if test "x$ac_cv_lib_dl_dlsym" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldl" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XmuCreateStippledPixmap in -lXmu" >&5 $as_echo_n "checking for XmuCreateStippledPixmap in -lXmu... " >&6; } if ${ac_cv_lib_Xmu_XmuCreateStippledPixmap+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXmu $GUI_X_LIBS -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XmuCreateStippledPixmap (); int main () { return XmuCreateStippledPixmap (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xmu_XmuCreateStippledPixmap=yes else ac_cv_lib_Xmu_XmuCreateStippledPixmap=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xmu_XmuCreateStippledPixmap" >&5 $as_echo "$ac_cv_lib_Xmu_XmuCreateStippledPixmap" >&6; } if test "x$ac_cv_lib_Xmu_XmuCreateStippledPixmap" = xyes; then : GUI_X_LIBS="-lXmu $GUI_X_LIBS" fi if test -z "$SKIP_MOTIF"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XpEndJob in -lXp" >&5 $as_echo_n "checking for XpEndJob in -lXp... " >&6; } if ${ac_cv_lib_Xp_XpEndJob+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXp $GUI_X_LIBS -lXm -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XpEndJob (); int main () { return XpEndJob (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xp_XpEndJob=yes else ac_cv_lib_Xp_XpEndJob=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xp_XpEndJob" >&5 $as_echo "$ac_cv_lib_Xp_XpEndJob" >&6; } if test "x$ac_cv_lib_Xp_XpEndJob" = xyes; then : GUI_X_LIBS="-lXp $GUI_X_LIBS" fi fi LDFLAGS=$ldflags_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for extra X11 defines" >&5 $as_echo_n "checking for extra X11 defines... " >&6; } 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NARROW_PROTO" >&5 $as_echo "$NARROW_PROTO" >&6; } fi fi if test "$enable_xsmp" = "yes"; then cppflags_save=$CPPFLAGS CPPFLAGS="$CPPFLAGS $X_CFLAGS" for ac_header in X11/SM/SMlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "X11/SM/SMlib.h" "ac_cv_header_X11_SM_SMlib_h" "$ac_includes_default" if test "x$ac_cv_header_X11_SM_SMlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_X11_SM_SMLIB_H 1 _ACEOF fi done CPPFLAGS=$cppflags_save fi if test -z "$SKIP_ATHENA" -o -z "$SKIP_NEXTAW" -o -z "$SKIP_MOTIF" -o -z "$SKIP_GTK2" -o -z "$SKIP_GTK3"; then cppflags_save=$CPPFLAGS CPPFLAGS="$CPPFLAGS $X_CFLAGS" for ac_header in X11/xpm.h X11/Sunkeysym.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test ! "$enable_xim" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XIMText in X11/Xlib.h" >&5 $as_echo_n "checking for XIMText in X11/Xlib.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "XIMText" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no; xim has been disabled" >&5 $as_echo "no; xim has been disabled" >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: X GUI selected; xim has been enabled" >&5 $as_echo "X GUI selected; xim has been enabled" >&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" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X11/Xmu/Editres.h" >&5 $as_echo_n "checking for X11/Xmu/Editres.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { int i; i = 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_X11_XMU_EDITRES_H 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CPPFLAGS=$cppflags_save fi if test -z "$SKIP_MOTIF"; then cppflags_save=$CPPFLAGS CPPFLAGS="$CPPFLAGS $X_CFLAGS" if test "$zOSUnix" = "yes"; then xmheader="Xm/Xm.h" else xmheader="Xm/Xm.h Xm/XpmP.h Xm/JoinSideT.h Xm/TraitP.h Xm/Manager.h Xm/UnhighlightT.h Xm/Notebook.h" fi for ac_header in $xmheader do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_header_Xm_XpmP_h" = "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XpmAttributes_21 in Xm/XpmP.h" >&5 $as_echo_n "checking for XpmAttributes_21 in Xm/XpmP.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { XpmAttributes_21 attr; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define XPMATTRIBUTES_TYPE XpmAttributes_21" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; }; $as_echo "#define XPMATTRIBUTES_TYPE XpmAttributes" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "#define XPMATTRIBUTES_TYPE XpmAttributes" >>confdefs.h fi CPPFLAGS=$cppflags_save fi if test "x$GUITYPE" = "xNONE" -a "$enable_xim" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no GUI selected; xim has been disabled" >&5 $as_echo "no GUI selected; xim has been disabled" >&6; } enable_xim="no" fi if test "x$GUITYPE" = "xNONE" -a "$enable_fontset" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no GUI selected; fontset has been disabled" >&5 $as_echo "no GUI selected; fontset has been disabled" >&6; } enable_fontset="no" fi if test "x$GUITYPE:$enable_fontset" = "xGTK:yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: GTK+ 2 GUI selected; fontset has been disabled" >&5 $as_echo "GTK+ 2 GUI selected; fontset has been disabled" >&6; } enable_fontset="no" fi if test -z "$SKIP_PHOTON"; then GUITYPE=PHOTONGUI fi if test "$enable_workshop" = "yes" -a -n "$SKIP_MOTIF"; then as_fn_error $? "cannot use workshop without Motif" "$LINENO" 5 fi if test "$enable_xim" = "yes"; then $as_echo "#define FEAT_XIM 1" >>confdefs.h fi if test "$enable_fontset" = "yes"; then $as_echo "#define FEAT_XFONTSET 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CYGWIN or MSYS environment" >&5 $as_echo_n "checking for CYGWIN or MSYS environment... " >&6; } case `uname` in CYGWIN*|MSYS*) CYGWIN=yes; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CYGWIN clipboard support" >&5 $as_echo_n "checking for CYGWIN clipboard support... " >&6; } if test "x$with_x" = "xno" ; then OS_EXTRA_SRC=winclip.c; OS_EXTRA_OBJ=objects/winclip.o { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define FEAT_CYGWIN_WIN32_CLIPBOARD 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - using X11" >&5 $as_echo "no - using X11" >&6; } fi ;; *) CYGWIN=no; { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; };; esac if test "$enable_hangulinput" = "yes"; then if test "x$GUITYPE" = "xNONE"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no GUI selected; hangul input has been disabled" >&5 $as_echo "no GUI selected; hangul input has been disabled" >&6; } enable_hangulinput=no else $as_echo "#define FEAT_HANGULIN 1" >>confdefs.h HANGULIN_SRC=hangulin.c HANGULIN_OBJ=objects/hangulin.o fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether toupper is broken" >&5 $as_echo_n "checking whether toupper is broken... " >&6; } if ${vim_cv_toupper_broken+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : as_fn_error $? "cross-compiling: please set 'vim_cv_toupper_broken'" "$LINENO" 5 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" #include #if STDC_HEADERS # include # include #endif main() { exit(toupper('A') == 'A' && tolower('z') == 'z'); } _ACEOF if ac_fn_c_try_run "$LINENO"; then : vim_cv_toupper_broken=yes else vim_cv_toupper_broken=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vim_cv_toupper_broken" >&5 $as_echo "$vim_cv_toupper_broken" >&6; } if test "x$vim_cv_toupper_broken" = "xyes" ; then $as_echo "#define BROKEN_TOUPPER 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __DATE__ and __TIME__ work" >&5 $as_echo_n "checking whether __DATE__ and __TIME__ work... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { printf("(" __DATE__ " " __TIME__ ")"); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define HAVE_DATE_TIME 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __attribute__((unused)) is allowed" >&5 $as_echo_n "checking whether __attribute__((unused)) is allowed... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int x __attribute__((unused)); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define HAVE_ATTRIBUTE_UNUSED 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_fn_c_check_header_mongrel "$LINENO" "elf.h" "ac_cv_header_elf_h" "$ac_includes_default" if test "x$ac_cv_header_elf_h" = xyes; then : HAS_ELF=1 fi if test "$HAS_ELF" = 1; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lelf" >&5 $as_echo_n "checking for main in -lelf... " >&6; } if ${ac_cv_lib_elf_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lelf $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_elf_main=yes else ac_cv_lib_elf_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_elf_main" >&5 $as_echo "$ac_cv_lib_elf_main" >&6; } if test "x$ac_cv_lib_elf_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBELF 1 _ACEOF LIBS="-lelf $LIBS" fi fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } if eval \${$as_ac_Header+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include <$ac_hdr> int main () { if ((DIR *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$as_ac_Header=yes" else eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$as_ac_Header { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if ${ac_cv_search_opendir+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' dir; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_opendir+:} false; then : break fi done if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if ${ac_cv_search_opendir+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' x; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_opendir+:} false; then : break fi done if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi fi if test $ac_cv_header_sys_wait_h = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that defines union wait" >&5 $as_echo_n "checking for sys/wait.h that defines union wait... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { union wait xx, yy; xx = yy ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h $as_echo "#define HAVE_UNION_WAIT 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi for ac_header in stdint.h stdlib.h string.h \ sys/select.h sys/utsname.h termcap.h fcntl.h \ sgtty.h sys/ioctl.h sys/time.h sys/types.h \ termio.h iconv.h inttypes.h langinfo.h math.h \ unistd.h stropts.h errno.h sys/resource.h \ sys/systeminfo.h locale.h sys/stream.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 sys/acl.h \ sys/access.h sys/sysinfo.h wchar.h wctype.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/ptem.h do : ac_fn_c_check_header_compile "$LINENO" "sys/ptem.h" "ac_cv_header_sys_ptem_h" "#if defined HAVE_SYS_STREAM_H # include #endif " if test "x$ac_cv_header_sys_ptem_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_PTEM_H 1 _ACEOF fi done for ac_header in sys/sysctl.h do : ac_fn_c_check_header_compile "$LINENO" "sys/sysctl.h" "ac_cv_header_sys_sysctl_h" "#if defined HAVE_SYS_PARAM_H # include #endif " if test "x$ac_cv_header_sys_sysctl_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_SYSCTL_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_np.h" >&5 $as_echo_n "checking for pthread_np.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { int i; i = 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_PTHREAD_NP_H 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext for ac_header in strings.h do : ac_fn_c_check_header_mongrel "$LINENO" "strings.h" "ac_cv_header_strings_h" "$ac_includes_default" if test "x$ac_cv_header_strings_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRINGS_H 1 _ACEOF fi done if test "x$MACOSX" = "xyes"; then $as_echo "#define NO_STRINGS_WITH_STRING_H 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strings.h can be included after string.h" >&5 $as_echo_n "checking if strings.h can be included after string.h... " >&6; } cppflags_save=$CPPFLAGS CPPFLAGS="$CPPFLAGS $X_CFLAGS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end 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 /* This breaks it for HP-UX 11 (Squassabia) */ #endif #ifdef HAVE_STRING_H # include #endif #if defined(HAVE_STRINGS_H) # include #endif int main () { int i; i = 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else $as_echo "#define NO_STRINGS_WITH_STRING_H 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CPPFLAGS=$cppflags_save fi if test $ac_cv_c_compiler_gnu = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 $as_echo_n "checking whether $CC needs -traditional... " >&6; } if ${ac_cv_prog_gcc_traditional+:} false; then : $as_echo_n "(cached) " >&6 else ac_pattern="Autoconf.*'x'" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Autoconf TIOCGETP _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then : ac_cv_prog_gcc_traditional=yes else ac_cv_prog_gcc_traditional=no fi rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then : ac_cv_prog_gcc_traditional=yes fi rm -f conftest* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 $as_echo "$ac_cv_prog_gcc_traditional" >&6; } if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* 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"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 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 sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working volatile" >&5 $as_echo_n "checking for working volatile... " >&6; } if ${ac_cv_c_volatile+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { volatile int x; int * volatile y = (int *) 0; return !x && !y; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_volatile=yes else ac_cv_c_volatile=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_volatile" >&5 $as_echo "$ac_cv_c_volatile" >&6; } if test $ac_cv_c_volatile = no; then $as_echo "#define volatile /**/" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" if test "x$ac_cv_type_mode_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define mode_t int _ACEOF fi ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" if test "x$ac_cv_type_off_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define off_t long int _ACEOF fi ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" if test "x$ac_cv_type_pid_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 $as_echo_n "checking for uid_t in sys/types.h... " >&6; } if ${ac_cv_type_uid_t+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "uid_t" >/dev/null 2>&1; then : ac_cv_type_uid_t=yes else ac_cv_type_uid_t=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 $as_echo "$ac_cv_type_uid_t" >&6; } if test $ac_cv_type_uid_t = no; then $as_echo "#define uid_t int" >>confdefs.h $as_echo "#define gid_t int" >>confdefs.h fi ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" case $ac_cv_c_uint32_t in #( no|yes) ;; #( *) $as_echo "#define _UINT32_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF #define uint32_t $ac_cv_c_uint32_t _ACEOF ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "ino_t" "ac_cv_type_ino_t" "$ac_includes_default" if test "x$ac_cv_type_ino_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define ino_t long _ACEOF fi ac_fn_c_check_type "$LINENO" "dev_t" "ac_cv_type_dev_t" "$ac_includes_default" if test "x$ac_cv_type_dev_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define dev_t unsigned _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } if ${ac_cv_c_bigendian+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __APPLE_CC__ not a universal capable compiler #endif typedef int dummy; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. ac_arch= ac_prev= for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do if test -n "$ac_prev"; then case $ac_word in i?86 | x86_64 | ppc | ppc64) if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then ac_arch=$ac_word else ac_cv_c_bigendian=universal break fi ;; esac ac_prev= elif test "x$ac_word" = "x-arch"; then ac_prev=arch fi done fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #ifndef _BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. if test "$cross_compiling" = yes; then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } extern int foo; int main () { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_bigendian=no else ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 $as_echo "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h ;; #( no) ;; #( universal) $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) as_fn_error $? "unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if ${ac_cv_c_inline+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_inline=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 $as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rlim_t" >&5 $as_echo_n "checking for rlim_t... " >&6; } if eval "test \"`echo '$''{'ac_cv_type_rlim_t'+set}'`\" = set"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: (cached) $ac_cv_type_rlim_t" >&5 $as_echo "(cached) $ac_cv_type_rlim_t" >&6; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #if STDC_HEADERS # include # include #endif #ifdef HAVE_SYS_RESOURCE_H # include #endif _ACEOF 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 : ac_cv_type_rlim_t=yes else ac_cv_type_rlim_t=no fi rm -f conftest* { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_rlim_t" >&5 $as_echo "$ac_cv_type_rlim_t" >&6; } fi if test $ac_cv_type_rlim_t = no; then cat >> confdefs.h <<\EOF #define rlim_t unsigned long EOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stack_t" >&5 $as_echo_n "checking for stack_t... " >&6; } if eval "test \"`echo '$''{'ac_cv_type_stack_t'+set}'`\" = set"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: (cached) $ac_cv_type_stack_t" >&5 $as_echo "(cached) $ac_cv_type_stack_t" >&6; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #if STDC_HEADERS # include # include #endif #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "stack_t" >/dev/null 2>&1; then : ac_cv_type_stack_t=yes else ac_cv_type_stack_t=no fi rm -f conftest* { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_stack_t" >&5 $as_echo "$ac_cv_type_stack_t" >&6; } fi if test $ac_cv_type_stack_t = no; then cat >> confdefs.h <<\EOF #define stack_t struct sigaltstack EOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stack_t has an ss_base field" >&5 $as_echo_n "checking whether stack_t has an ss_base field... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #if STDC_HEADERS # include # include #endif #include #include "confdefs.h" int main () { stack_t sigstk; sigstk.ss_base = 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define HAVE_SS_BASE 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext olibs="$LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-tlib argument" >&5 $as_echo_n "checking --with-tlib argument... " >&6; } # Check whether --with-tlib was given. if test "${with_tlib+set}" = set; then : withval=$with_tlib; fi if test -n "$with_tlib"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_tlib" >&5 $as_echo "$with_tlib" >&6; } LIBS="$LIBS -l$with_tlib" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linking with $with_tlib library" >&5 $as_echo_n "checking for linking with $with_tlib library... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5 $as_echo "OK" >&6; } else as_fn_error $? "FAILED" "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext olibs="$LIBS" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: empty: automatic terminal library selection" >&5 $as_echo "empty: automatic terminal library selection" >&6; } case "`uname -s 2>/dev/null`" in OSF1|SCO_SV) tlibs="tinfo ncurses curses termlib termcap";; *) tlibs="tinfo ncurses termlib termcap curses";; esac for libname in $tlibs; do as_ac_Lib=`$as_echo "ac_cv_lib_${libname}''_tgetent" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -l${libname}" >&5 $as_echo_n "checking for tgetent in -l${libname}... " >&6; } if eval \${$as_ac_Lib+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-l${libname} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char tgetent (); int main () { return tgetent (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$as_ac_Lib=yes" else eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_LIB${libname}" | $as_tr_cpp` 1 _ACEOF LIBS="-l${libname} $LIBS" fi if test "x$olibs" != "x$LIBS"; then if test "$cross_compiling" = yes; then : res="FAIL" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_TERMCAP_H # include #endif #if STDC_HEADERS # include # include #endif main() {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(0); } _ACEOF if ac_fn_c_try_run "$LINENO"; then : res="OK" else res="FAIL" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi if test "$res" = "OK"; then break fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libname library is not usable" >&5 $as_echo "$libname library is not usable" >&6; } LIBS="$olibs" fi done if test "x$olibs" = "x$LIBS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no terminal library found" >&5 $as_echo "no terminal library found" >&6; } fi fi if test "x$olibs" = "x$LIBS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent()" >&5 $as_echo_n "checking for tgetent()... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist"); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else as_fn_error $? "NOT FOUND! You need to install a terminal library; for example ncurses. Or specify the name of the library with --with-tlib." "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we talk terminfo" >&5 $as_echo_n "checking whether we talk terminfo... " >&6; } if ${vim_cv_terminfo+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : as_fn_error $? "cross-compiling: please set 'vim_cv_terminfo'" "$LINENO" 5 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" #ifdef HAVE_TERMCAP_H # include #endif #ifdef HAVE_STRING_H # include #endif #if STDC_HEADERS # include # include #endif main() {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(!strcmp(s==0 ? "" : s, "1")); } _ACEOF if ac_fn_c_try_run "$LINENO"; then : vim_cv_terminfo=no else vim_cv_terminfo=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vim_cv_terminfo" >&5 $as_echo "$vim_cv_terminfo" >&6; } if test "x$vim_cv_terminfo" = "xyes" ; then $as_echo "#define TERMINFO 1" >>confdefs.h fi if test "x$olibs" != "x$LIBS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking what tgetent() returns for an unknown terminal" >&5 $as_echo_n "checking what tgetent() returns for an unknown terminal... " >&6; } if ${vim_cv_tgent+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : as_fn_error $? "failed to compile test program." "$LINENO" 5 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" #ifdef HAVE_TERMCAP_H # include #endif #if STDC_HEADERS # include # include #endif main() {char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist"); exit(res != 0); } _ACEOF if ac_fn_c_try_run "$LINENO"; then : vim_cv_tgent=zero else vim_cv_tgent=non-zero fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vim_cv_tgent" >&5 $as_echo "$vim_cv_tgent" >&6; } if test "x$vim_cv_tgent" = "xzero" ; then $as_echo "#define TGETENT_ZERO_ERR 0" >>confdefs.h fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether termcap.h contains ospeed" >&5 $as_echo_n "checking whether termcap.h contains ospeed... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_TERMCAP_H # include #endif int main () { ospeed = 20000 ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define HAVE_OSPEED 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ospeed can be extern" >&5 $as_echo_n "checking whether ospeed can be extern... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_TERMCAP_H # include #endif extern short ospeed; int main () { ospeed = 20000 ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define OSPEED_EXTERN 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether termcap.h contains UP, BC and PC" >&5 $as_echo_n "checking whether termcap.h contains UP, BC and PC... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_TERMCAP_H # include #endif int main () { if (UP == 0 && BC == 0) PC = 1 ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define HAVE_UP_BC_PC 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UP, BC and PC can be extern" >&5 $as_echo_n "checking whether UP, BC and PC can be extern... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_TERMCAP_H # include #endif extern char *UP, *BC, PC; int main () { if (UP == 0 && BC == 0) PC = 1 ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define UP_BC_PC_EXTERN 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether tputs() uses outfuntype" >&5 $as_echo_n "checking whether tputs() uses outfuntype... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_TERMCAP_H # include #endif int main () { extern int xx(); tputs("test", 1, (outfuntype)xx) ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define HAVE_OUTFUNTYPE 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sys/select.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether sys/select.h and sys/time.h may both be included... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define SYS_SELECT_WITH_SYS_TIME 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /dev/ptc" >&5 $as_echo_n "checking for /dev/ptc... " >&6; } if test -r /dev/ptc; then $as_echo "#define HAVE_DEV_PTC 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SVR4 ptys" >&5 $as_echo_n "checking for SVR4 ptys... " >&6; } if test -c /dev/ptmx ; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ptsname(0);grantpt(0);unlockpt(0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define HAVE_SVR4_PTYS 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ptyranges" >&5 $as_echo_n "checking for ptyranges... " >&6; } if test -d /dev/ptym ; then pdir='/dev/ptym' else pdir='/dev' fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef M_UNIX yes; #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then : ptys=`echo /dev/ptyp??` else 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 <<_ACEOF #define PTYRANGE0 "$p0" _ACEOF cat >>confdefs.h <<_ACEOF #define PTYRANGE1 "$p1" _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: result: $p0 / $p1" >&5 $as_echo "$p0 / $p1" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: don't know" >&5 $as_echo "don't know" >&6; } fi rm -f conftest_grp { $as_echo "$as_me:${as_lineno-$LINENO}: checking default tty permissions/group" >&5 $as_echo_n "checking default tty permissions/group... " >&6; } if ${vim_cv_tty_group+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : as_fn_error $? "cross-compiling: please set 'vim_cv_tty_group' and 'vim_cv_tty_mode'" "$LINENO" 5 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" #include #if STDC_HEADERS # include # include #endif #ifdef HAVE_UNISTD_H #include #endif #include #include 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); } _ACEOF if ac_fn_c_try_run "$LINENO"; then : if test -f conftest_grp; then vim_cv_tty_group=`cat conftest_grp` if test "x$vim_cv_tty_mode" = "x" ; then vim_cv_tty_mode=0620 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: pty mode: $vim_cv_tty_mode, group: $vim_cv_tty_group" >&5 $as_echo "pty mode: $vim_cv_tty_mode, group: $vim_cv_tty_group" >&6; } else vim_cv_tty_group=world { $as_echo "$as_me:${as_lineno-$LINENO}: result: ptys are world accessible" >&5 $as_echo "ptys are world accessible" >&6; } fi else vim_cv_tty_group=world { $as_echo "$as_me:${as_lineno-$LINENO}: result: can't determine - assume ptys are world accessible" >&5 $as_echo "can't determine - assume ptys are world accessible" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vim_cv_tty_group" >&5 $as_echo "$vim_cv_tty_group" >&6; } rm -f conftest_grp if test "x$vim_cv_tty_group" != "xworld" ; then cat >>confdefs.h <<_ACEOF #define PTYGROUP $vim_cv_tty_group _ACEOF if test "x$vim_cv_tty_mode" = "x" ; then as_fn_error $? "It seems you're cross compiling and have 'vim_cv_tty_group' set, please also set the environment variable 'vim_cv_tty_mode' to the correct mode (probably 0620)" "$LINENO" 5 else $as_echo "#define PTYMODE 0620" >>confdefs.h fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 $as_echo_n "checking return type of signal handlers... " >&6; } if ${ac_cv_type_signal+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { return *(signal (0, 0)) (0) == 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_signal=int else ac_cv_type_signal=void fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 $as_echo "$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF if test $ac_cv_type_signal = void; then $as_echo "#define SIGRETURN return" >>confdefs.h else $as_echo "#define SIGRETURN return 0" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct sigcontext" >&5 $as_echo_n "checking for struct sigcontext... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include test_sig() { struct sigcontext *scont; scont = (struct sigcontext *)0; return 1; } int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_SIGCONTEXT 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking getcwd implementation is broken" >&5 $as_echo_n "checking getcwd implementation is broken... " >&6; } if ${vim_cv_getcwd_broken+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : as_fn_error $? "cross-compiling: please set 'vim_cv_getcwd_broken'" "$LINENO" 5 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" #ifdef HAVE_UNISTD_H #include #endif char *dagger[] = { "IFS=pwd", 0 }; main() { char buffer[500]; extern char **environ; environ = dagger; return getcwd(buffer, 500) ? 0 : 1; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : vim_cv_getcwd_broken=no else vim_cv_getcwd_broken=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vim_cv_getcwd_broken" >&5 $as_echo "$vim_cv_getcwd_broken" >&6; } if test "x$vim_cv_getcwd_broken" = "xyes" ; then $as_echo "#define BAD_GETCWD 1" >>confdefs.h fi for ac_func in bcmp fchdir fchown fsync getcwd getpseudotty \ getpwent getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \ memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \ setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \ sigvec strcasecmp strerror strftime stricmp strncasecmp \ strnicmp strpbrk strtol tgetent towlower towupper iswupper \ usleep utime utimes do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5 $as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; } if ${ac_cv_sys_largefile_source+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* for off_t */ #include int main () { int (*fp) (FILE *, off_t, int) = fseeko; return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_sys_largefile_source=no; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGEFILE_SOURCE 1 #include /* for off_t */ #include int main () { int (*fp) (FILE *, off_t, int) = fseeko; return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_sys_largefile_source=1; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_cv_sys_largefile_source=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5 $as_echo "$ac_cv_sys_largefile_source" >&6; } case $ac_cv_sys_largefile_source in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source _ACEOF ;; esac rm -rf conftest* # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug # in glibc 2.1.3, but that breaks too many other things. # If you want fseeko and ftello with glibc, upgrade to a fixed glibc. if test $ac_cv_sys_largefile_source != unknown; then $as_echo "#define HAVE_FSEEKO 1" >>confdefs.h fi # Check whether --enable-largefile was given. if test "${enable_largefile+set}" = set; then : enableval=$enable_largefile; fi if test "$enable_largefile" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 $as_echo_n "checking for special C compiler options needed for large files... " >&6; } if ${ac_cv_sys_largefile_CC+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : break fi rm -f core conftest.err conftest.$ac_objext CC="$CC -n32" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_largefile_CC=' -n32'; break fi rm -f core conftest.err conftest.$ac_objext break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 $as_echo "$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } if ${ac_cv_sys_file_offset_bits+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=64; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_file_offset_bits=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 $as_echo "$ac_cv_sys_file_offset_bits" >&6; } case $ac_cv_sys_file_offset_bits in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF ;; esac rm -rf conftest* if test $ac_cv_sys_file_offset_bits = unknown; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } if ${ac_cv_sys_large_files+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_large_files=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGE_FILES 1 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_large_files=1; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_large_files=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 $as_echo "$ac_cv_sys_large_files" >&6; } case $ac_cv_sys_large_files in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _LARGE_FILES $ac_cv_sys_large_files _ACEOF ;; esac rm -rf conftest* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for st_blksize" >&5 $as_echo_n "checking for st_blksize... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct stat st; int n; stat("/", &st); n = (int)st.st_blksize; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define HAVE_ST_BLKSIZE 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat() ignores a trailing slash" >&5 $as_echo_n "checking whether stat() ignores a trailing slash... " >&6; } if ${vim_cv_stat_ignores_slash+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : as_fn_error $? "cross-compiling: please set 'vim_cv_stat_ignores_slash'" "$LINENO" 5 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" #if STDC_HEADERS # include # include #endif #include #include main() {struct stat st; exit(stat("configure/", &st) != 0); } _ACEOF if ac_fn_c_try_run "$LINENO"; then : vim_cv_stat_ignores_slash=yes else vim_cv_stat_ignores_slash=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vim_cv_stat_ignores_slash" >&5 $as_echo "$vim_cv_stat_ignores_slash" >&6; } if test "x$vim_cv_stat_ignores_slash" = "xyes" ; then $as_echo "#define STAT_IGNORES_SLASH 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv_open()" >&5 $as_echo_n "checking for iconv_open()... " >&6; } save_LIBS="$LIBS" LIBS="$LIBS -liconv" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_ICONV_H # include #endif int main () { iconv_open("fr", "to"); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes; with -liconv" >&5 $as_echo "yes; with -liconv" >&6; }; $as_echo "#define HAVE_ICONV 1" >>confdefs.h else LIBS="$save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_ICONV_H # include #endif int main () { iconv_open("fr", "to"); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define HAVE_ICONV 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo(CODESET)" >&5 $as_echo_n "checking for nl_langinfo(CODESET)... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_LANGINFO_H # include #endif int main () { char *cs = nl_langinfo(CODESET); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define HAVE_NL_LANGINFO_CODESET 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strtod in -lm" >&5 $as_echo_n "checking for strtod in -lm... " >&6; } if ${ac_cv_lib_m_strtod+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char strtod (); int main () { return strtod (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_strtod=yes else ac_cv_lib_m_strtod=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_strtod" >&5 $as_echo "$ac_cv_lib_m_strtod" >&6; } if test "x$ac_cv_lib_m_strtod" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF LIBS="-lm $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strtod() and other floating point functions" >&5 $as_echo_n "checking for strtod() and other floating point functions... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_MATH_H # include #endif #if STDC_HEADERS # include # include #endif int main () { char *s; double d; d = strtod("1.1", &s); d = fabs(1.11); d = ceil(1.11); d = floor(1.11); d = log10(1.11); d = pow(1.11, 2.22); d = sqrt(1.11); d = sin(1.11); d = cos(1.11); d = atan(1.11); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define HAVE_FLOAT_FUNCS 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for isinf()" >&5 $as_echo_n "checking for isinf()... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_MATH_H # include #endif #if STDC_HEADERS # include # include #endif int main () { int r = isinf(1.11); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define HAVE_ISINF 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for isnan()" >&5 $as_echo_n "checking for isnan()... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_MATH_H # include #endif #if STDC_HEADERS # include # include #endif int main () { int r = isnan(1.11); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define HAVE_ISNAN 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking --disable-acl argument" >&5 $as_echo_n "checking --disable-acl argument... " >&6; } # Check whether --enable-acl was given. if test "${enable_acl+set}" = set; then : enableval=$enable_acl; else enable_acl="yes" fi if test "$enable_acl" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for acl_get_file in -lposix1e" >&5 $as_echo_n "checking for acl_get_file in -lposix1e... " >&6; } if ${ac_cv_lib_posix1e_acl_get_file+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lposix1e $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char acl_get_file (); int main () { return acl_get_file (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_posix1e_acl_get_file=yes else ac_cv_lib_posix1e_acl_get_file=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix1e_acl_get_file" >&5 $as_echo "$ac_cv_lib_posix1e_acl_get_file" >&6; } if test "x$ac_cv_lib_posix1e_acl_get_file" = xyes; then : LIBS="$LIBS -lposix1e" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for acl_get_file in -lacl" >&5 $as_echo_n "checking for acl_get_file in -lacl... " >&6; } if ${ac_cv_lib_acl_acl_get_file+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lacl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char acl_get_file (); int main () { return acl_get_file (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_acl_acl_get_file=yes else ac_cv_lib_acl_acl_get_file=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_acl_acl_get_file" >&5 $as_echo "$ac_cv_lib_acl_acl_get_file" >&6; } if test "x$ac_cv_lib_acl_acl_get_file" = xyes; then : LIBS="$LIBS -lacl" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgetxattr in -lattr" >&5 $as_echo_n "checking for fgetxattr in -lattr... " >&6; } if ${ac_cv_lib_attr_fgetxattr+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lattr $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char fgetxattr (); int main () { return fgetxattr (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_attr_fgetxattr=yes else ac_cv_lib_attr_fgetxattr=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_attr_fgetxattr" >&5 $as_echo "$ac_cv_lib_attr_fgetxattr" >&6; } if test "x$ac_cv_lib_attr_fgetxattr" = xyes; then : LIBS="$LIBS -lattr" fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for POSIX ACL support" >&5 $as_echo_n "checking for POSIX ACL support... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef HAVE_SYS_ACL_H # include #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; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define HAVE_POSIX_ACL 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for acl_get in -lsec" >&5 $as_echo_n "checking for acl_get in -lsec... " >&6; } if ${ac_cv_lib_sec_acl_get+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsec $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char acl_get (); int main () { return acl_get (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_sec_acl_get=yes else ac_cv_lib_sec_acl_get=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sec_acl_get" >&5 $as_echo "$ac_cv_lib_sec_acl_get" >&6; } if test "x$ac_cv_lib_sec_acl_get" = xyes; then : LIBS="$LIBS -lsec"; $as_echo "#define HAVE_SOLARIS_ZFS_ACL 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Solaris ACL support" >&5 $as_echo_n "checking for Solaris ACL support... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_SYS_ACL_H # include #endif int main () { acl("foo", GETACLCNT, 0, NULL); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define HAVE_SOLARIS_ACL 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AIX ACL support" >&5 $as_echo_n "checking for AIX ACL support... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if STDC_HEADERS # include # include #endif #ifdef HAVE_SYS_ACL_H # include #endif #ifdef HAVE_SYS_ACCESS_H # include #endif #define _ALL_SOURCE #include int aclsize; struct acl *aclent; int main () { aclsize = sizeof(struct acl); aclent = (void *)malloc(aclsize); statacl("foo", STX_NORMAL, aclent, aclsize); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define HAVE_AIX_ACL 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi if test "x$GTK_CFLAGS" != "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pango_shape_full" >&5 $as_echo_n "checking for pango_shape_full... " >&6; } ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { pango_shape_full(NULL, 0, NULL, 0, NULL, NULL); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define HAVE_PANGO_SHAPE_FULL 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking --disable-gpm argument" >&5 $as_echo_n "checking --disable-gpm argument... " >&6; } # Check whether --enable-gpm was given. if test "${enable_gpm+set}" = set; then : enableval=$enable_gpm; else enable_gpm="yes" fi if test "$enable_gpm" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gpm" >&5 $as_echo_n "checking for gpm... " >&6; } if ${vi_cv_have_gpm+:} false; then : $as_echo_n "(cached) " >&6 else olibs="$LIBS" ; LIBS="-lgpm" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { Gpm_GetLibVersion(NULL); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : vi_cv_have_gpm=yes else vi_cv_have_gpm=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$olibs" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_have_gpm" >&5 $as_echo "$vi_cv_have_gpm" >&6; } if test $vi_cv_have_gpm = yes; then LIBS="$LIBS -lgpm" $as_echo "#define HAVE_GPM 1" >>confdefs.h fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking --disable-sysmouse argument" >&5 $as_echo_n "checking --disable-sysmouse argument... " >&6; } # Check whether --enable-sysmouse was given. if test "${enable_sysmouse+set}" = set; then : enableval=$enable_sysmouse; else enable_sysmouse="yes" fi if test "$enable_sysmouse" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysmouse" >&5 $as_echo_n "checking for sysmouse... " >&6; } if ${vi_cv_have_sysmouse+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { struct mouse_info mouse; mouse.operation = MOUSE_MODE; mouse.operation = MOUSE_SHOW; mouse.u.mode.mode = 0; mouse.u.mode.signal = SIGUSR2; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : vi_cv_have_sysmouse=yes else vi_cv_have_sysmouse=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_have_sysmouse" >&5 $as_echo "$vi_cv_have_sysmouse" >&6; } if test $vi_cv_have_sysmouse = yes; then $as_echo "#define HAVE_SYSMOUSE 1" >>confdefs.h fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FD_CLOEXEC" >&5 $as_echo_n "checking for FD_CLOEXEC... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if HAVE_FCNTL_H # include #endif int main () { int flag = FD_CLOEXEC; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define HAVE_FD_CLOEXEC 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 $as_echo "not usable" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rename" >&5 $as_echo_n "checking for rename... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { rename("this", "that") ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define HAVE_RENAME 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysctl" >&5 $as_echo_n "checking for sysctl... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include 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; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define HAVE_SYSCTL 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 $as_echo "not usable" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysinfo" >&5 $as_echo_n "checking for sysinfo... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct sysinfo sinfo; int t; (void)sysinfo(&sinfo); t = sinfo.totalram; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define HAVE_SYSINFO 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 $as_echo "not usable" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysinfo.mem_unit" >&5 $as_echo_n "checking for sysinfo.mem_unit... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct sysinfo sinfo; sinfo.mem_unit = 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define HAVE_SYSINFO_MEM_UNIT 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysconf" >&5 $as_echo_n "checking for sysconf... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { (void)sysconf(_SC_PAGESIZE); (void)sysconf(_SC_PHYS_PAGES); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define HAVE_SYSCONF 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 $as_echo "not usable" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 $as_echo_n "checking size of int... " >&6; } if ${ac_cv_sizeof_int+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : else if test "$ac_cv_type_int" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (int) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_int=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 $as_echo "$ac_cv_sizeof_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 $as_echo_n "checking size of long... " >&6; } if ${ac_cv_sizeof_long+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : else if test "$ac_cv_type_long" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 $as_echo "$ac_cv_sizeof_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of time_t" >&5 $as_echo_n "checking size of time_t... " >&6; } if ${ac_cv_sizeof_time_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (time_t))" "ac_cv_sizeof_time_t" "$ac_includes_default"; then : else if test "$ac_cv_type_time_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (time_t) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_time_t=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_time_t" >&5 $as_echo "$ac_cv_sizeof_time_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_TIME_T $ac_cv_sizeof_time_t _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5 $as_echo_n "checking size of off_t... " >&6; } if ${ac_cv_sizeof_off_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default"; then : else if test "$ac_cv_type_off_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (off_t) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_off_t=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5 $as_echo "$ac_cv_sizeof_off_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_OFF_T $ac_cv_sizeof_off_t _ACEOF cat >>confdefs.h <<_ACEOF #define VIM_SIZEOF_INT $ac_cv_sizeof_int _ACEOF cat >>confdefs.h <<_ACEOF #define VIM_SIZEOF_LONG $ac_cv_sizeof_long _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking uint32_t is 32 bits" >&5 $as_echo_n "checking uint32_t is 32 bits... " >&6; } if test "$cross_compiling" = yes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot check uint32_t when cross-compiling." >&5 $as_echo "$as_me: WARNING: cannot check uint32_t when cross-compiling." >&2;} else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif main() { uint32_t nr1 = (uint32_t)-1; uint32_t nr2 = (uint32_t)0xffffffffUL; if (sizeof(uint32_t) != 4 || nr1 != 0xffffffffUL || nr2 + 1 != 0) exit(1); exit(0); } _ACEOF if ac_fn_c_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } else as_fn_error $? "WRONG! uint32_t not defined correctly." "$LINENO" 5 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi bcopy_test_prog=' #include "confdefs.h" #ifdef HAVE_STRING_H # include #endif #if STDC_HEADERS # include # include #endif 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. */ }' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memmove handles overlaps" >&5 $as_echo_n "checking whether memmove handles overlaps... " >&6; } if ${vim_cv_memmove_handles_overlap+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : as_fn_error $? "cross-compiling: please set 'vim_cv_memmove_handles_overlap'" "$LINENO" 5 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define mch_memmove(s,d,l) memmove(d,s,l) $bcopy_test_prog _ACEOF if ac_fn_c_try_run "$LINENO"; then : vim_cv_memmove_handles_overlap=yes else vim_cv_memmove_handles_overlap=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vim_cv_memmove_handles_overlap" >&5 $as_echo "$vim_cv_memmove_handles_overlap" >&6; } if test "x$vim_cv_memmove_handles_overlap" = "xyes" ; then $as_echo "#define USEMEMMOVE 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether bcopy handles overlaps" >&5 $as_echo_n "checking whether bcopy handles overlaps... " >&6; } if ${vim_cv_bcopy_handles_overlap+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : as_fn_error $? "cross-compiling: please set 'vim_cv_bcopy_handles_overlap'" "$LINENO" 5 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define mch_bcopy(s,d,l) bcopy(d,s,l) $bcopy_test_prog _ACEOF if ac_fn_c_try_run "$LINENO"; then : vim_cv_bcopy_handles_overlap=yes else vim_cv_bcopy_handles_overlap=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vim_cv_bcopy_handles_overlap" >&5 $as_echo "$vim_cv_bcopy_handles_overlap" >&6; } if test "x$vim_cv_bcopy_handles_overlap" = "xyes" ; then $as_echo "#define USEBCOPY 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memcpy handles overlaps" >&5 $as_echo_n "checking whether memcpy handles overlaps... " >&6; } if ${vim_cv_memcpy_handles_overlap+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : as_fn_error $? "cross-compiling: please set 'vim_cv_memcpy_handles_overlap'" "$LINENO" 5 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define mch_memcpy(s,d,l) memcpy(d,s,l) $bcopy_test_prog _ACEOF if ac_fn_c_try_run "$LINENO"; then : vim_cv_memcpy_handles_overlap=yes else vim_cv_memcpy_handles_overlap=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vim_cv_memcpy_handles_overlap" >&5 $as_echo "$vim_cv_memcpy_handles_overlap" >&6; } if test "x$vim_cv_memcpy_handles_overlap" = "xyes" ; then $as_echo "#define USEMEMCPY 1" >>confdefs.h fi fi fi if test "x$with_x" = "xyes"; then cflags_save=$CFLAGS libs_save=$LIBS LIBS="$LIBS $X_LIBS $GUI_LIB_LOC $GUI_X_LIBS $X_PRE_LIBS $X_LIB $X_EXTRA_LIBS" CFLAGS="$CFLAGS $X_CFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether X_LOCALE needed" >&5 $as_echo_n "checking whether X_LOCALE needed... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char _Xsetlocale (); int main () { return _Xsetlocale (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define X_LOCALE 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Xutf8SetWMProperties() can be used" >&5 $as_echo_n "checking whether Xutf8SetWMProperties() can be used... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char Xutf8SetWMProperties (); int main () { return Xutf8SetWMProperties (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_XUTF8SETWMPROPERTIES 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$cflags_save LIBS=$libs_save fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _xpg4_setrunelocale in -lxpg4" >&5 $as_echo_n "checking for _xpg4_setrunelocale in -lxpg4... " >&6; } if ${ac_cv_lib_xpg4__xpg4_setrunelocale+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lxpg4 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char _xpg4_setrunelocale (); int main () { return _xpg4_setrunelocale (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_xpg4__xpg4_setrunelocale=yes else ac_cv_lib_xpg4__xpg4_setrunelocale=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xpg4__xpg4_setrunelocale" >&5 $as_echo "$ac_cv_lib_xpg4__xpg4_setrunelocale" >&6; } if test "x$ac_cv_lib_xpg4__xpg4_setrunelocale" = xyes; then : LIBS="$LIBS -lxpg4" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create tags" >&5 $as_echo_n "checking how to create tags... " >&6; } test -f tags && mv tags tags.save if (eval ctags --version /dev/null | grep Exuberant) < /dev/null 1>&5 2>&1; then TAGPRG="ctags -I INIT+ --fields=+S" elif (eval exctags --version /dev/null | grep Exuberant) < /dev/null 1>&5 2>&1; then TAGPRG="exctags -I INIT+ --fields=+S" elif (eval exuberant-ctags --version /dev/null | grep Exuberant) < /dev/null 1>&5 2>&1; then TAGPRG="exuberant-ctags -I INIT+ --fields=+S" else TAGPRG="ctags" (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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TAGPRG" >&5 $as_echo "$TAGPRG" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run man with a section nr" >&5 $as_echo_n "checking how to run man with a section nr... " >&6; } MANDEF="man" (eval MANPAGER=cat PAGER=cat man -s 2 read) < /dev/null > /dev/null 2>&5 && MANDEF="man -s" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANDEF" >&5 $as_echo "$MANDEF" >&6; } if test "$MANDEF" = "man -s"; then $as_echo "#define USEMAN_S 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking --disable-nls argument" >&5 $as_echo_n "checking --disable-nls argument... " >&6; } # Check whether --enable-nls was given. if test "${enable_nls+set}" = set; then : enableval=$enable_nls; else enable_nls="yes" fi if test "$enable_nls" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } INSTALL_LANGS=install-languages INSTALL_TOOL_LANGS=install-tool-languages # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MSGFMT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MSGFMT"; then ac_cv_prog_MSGFMT="$MSGFMT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MSGFMT="msgfmt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MSGFMT=$ac_cv_prog_MSGFMT if test -n "$MSGFMT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 $as_echo "$MSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NLS" >&5 $as_echo_n "checking for NLS... " >&6; } if test -f po/Makefile; then have_gettext="no" if test -n "$MSGFMT"; then olibs=$LIBS LIBS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { gettext("Test"); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: gettext() works" >&5 $as_echo "gettext() works" >&6; }; have_gettext="yes"; LIBS=$olibs else LIBS="-lintl" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { gettext("Test"); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: gettext() works with -lintl" >&5 $as_echo "gettext() works with -lintl" >&6; }; have_gettext="yes"; LIBS="$olibs -lintl" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: gettext() doesn't work" >&5 $as_echo "gettext() doesn't work" >&6; }; LIBS=$olibs fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext else { $as_echo "$as_me:${as_lineno-$LINENO}: result: msgfmt not found - disabled" >&5 $as_echo "msgfmt not found - disabled" >&6; }; fi if test $have_gettext = "yes" -a "x$features" != "xtiny" -a "x$features" != "xsmall"; then $as_echo "#define HAVE_GETTEXT 1" >>confdefs.h MAKEMO=yes for ac_func in bind_textdomain_codeset do : ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset" if test "x$ac_cv_func_bind_textdomain_codeset" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_BIND_TEXTDOMAIN_CODESET 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _nl_msg_cat_cntr" >&5 $as_echo_n "checking for _nl_msg_cat_cntr... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include extern int _nl_msg_cat_cntr; int main () { ++_nl_msg_cat_cntr; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define HAVE_NL_MSG_CAT_CNTR 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no \"po/Makefile\" - disabled" >&5 $as_echo "no \"po/Makefile\" - disabled" >&6; }; fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi ac_fn_c_check_header_mongrel "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default" if test "x$ac_cv_header_dlfcn_h" = xyes; then : DLL=dlfcn.h else ac_fn_c_check_header_mongrel "$LINENO" "dl.h" "ac_cv_header_dl_h" "$ac_includes_default" if test "x$ac_cv_header_dl_h" = xyes; then : DLL=dl.h fi fi if test x${DLL} = xdlfcn.h; then $as_echo "#define HAVE_DLFCN_H 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen()" >&5 $as_echo_n "checking for dlopen()... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { extern void* dlopen(); dlopen(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define HAVE_DLOPEN 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; }; { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen() in -ldl" >&5 $as_echo_n "checking for dlopen() in -ldl... " >&6; } olibs=$LIBS LIBS="$LIBS -ldl" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { extern void* dlopen(); dlopen(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define HAVE_DLOPEN 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; }; LIBS=$olibs fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlsym()" >&5 $as_echo_n "checking for dlsym()... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { extern void* dlsym(); dlsym(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define HAVE_DLSYM 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; }; { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlsym() in -ldl" >&5 $as_echo_n "checking for dlsym() in -ldl... " >&6; } olibs=$LIBS LIBS="$LIBS -ldl" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { extern void* dlsym(); dlsym(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define HAVE_DLSYM 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; }; LIBS=$olibs fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext elif test x${DLL} = xdl.h; then $as_echo "#define HAVE_DL_H 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load()" >&5 $as_echo_n "checking for shl_load()... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { extern void* shl_load(); shl_load(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define HAVE_SHL_LOAD 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; }; { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load() in -ldld" >&5 $as_echo_n "checking for shl_load() in -ldld... " >&6; } olibs=$LIBS LIBS="$LIBS -ldld" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { extern void* shl_load(); shl_load(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define HAVE_SHL_LOAD 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; }; LIBS=$olibs fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi for ac_header in setjmp.h do : ac_fn_c_check_header_mongrel "$LINENO" "setjmp.h" "ac_cv_header_setjmp_h" "$ac_includes_default" if test "x$ac_cv_header_setjmp_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SETJMP_H 1 _ACEOF 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"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need -framework Cocoa" >&5 $as_echo_n "checking whether we need -framework Cocoa... " >&6; } if test "x$features" != "xtiny" || test "x$enable_multibyte" = "xyes"; then LIBS=$"$LIBS -framework Cocoa" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$features" = "xtiny"; then OS_EXTRA_SRC=`echo "$OS_EXTRA_SRC" | sed -e 's+os_macosx.m++'` OS_EXTRA_OBJ=`echo "$OS_EXTRA_OBJ" | sed -e 's+objects/os_macosx.o++'` fi fi if test "x$MACARCH" = "xboth" && test "x$GUITYPE" = "xCARBONGUI"; then LDFLAGS="$LDFLAGS -isysroot $DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" fi DEPEND_CFLAGS_FILTER= if test "$GCC" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GCC 3 or later" >&5 $as_echo_n "checking for GCC 3 or later... " >&6; } gccmajor=`echo "$gccversion" | sed -e 's/^\([1-9]\)\..*$/\1/g'` if test "$gccmajor" -gt "2"; then DEPEND_CFLAGS_FILTER="| sed 's+-I */+-isystem /+g'" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need -D_FORTIFY_SOURCE=1" >&5 $as_echo_n "checking whether we need -D_FORTIFY_SOURCE=1... " >&6; } if test "$gccmajor" -gt "3"; then CFLAGS=`echo "$CFLAGS" | sed -e 's/ *-Wp,-D_FORTIFY_SOURCE=.//g' -e 's/ *-D_FORTIFY_SOURCE=.//g' -e 's/ *-U_FORTIFY_SOURCE//g' -e 's/$/ -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1/'` { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking linker --as-needed support" >&5 $as_echo_n "checking linker --as-needed support... " >&6; } LINK_AS_NEEDED= # Check if linker supports --as-needed and --no-as-needed options if $CC -Wl,--help 2>/dev/null | grep as-needed > /dev/null; then LDFLAGS=`echo "$LDFLAGS" | sed -e 's/ *-Wl,--as-needed//g' | sed -e 's/$/ -Wl,--as-needed/'` LINK_AS_NEEDED=yes fi if test "$LINK_AS_NEEDED" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # IBM z/OS reset CFLAGS for config.mk if test "$zOSUnix" = "yes"; then CFLAGS="-D_ALL_SOURCE -Wc,float\(ieee\),dll" fi ac_config_files="$ac_config_files auto/config.mk:config.mk.in" cat >confcache <<\_ACEOF # 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, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # 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. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>auto/config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "auto/config.h") CONFIG_HEADERS="$CONFIG_HEADERS auto/config.h:config.h.in" ;; "auto/config.mk") CONFIG_FILES="$CONFIG_FILES auto/config.mk:config.mk.in" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #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. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>auto/config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi vim-7.4.1689/src/bigvim.bat000066400000000000000000000010201267703067000153220ustar00rootroot00000000000000:: command to build big Vim with OLE, Perl, Python, Ruby and Tcl SET VCDIR="C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\" SET TOOLDIR=E:\ %VCDIR%nmake -f Make_mvc.mak GUI=yes OLE=yes PERL=%TOOLDIR%perl522\perl DYNAMIC_PERL=yes PERL_VER=522 PYTHON=%TOOLDIR%python27 DYNAMIC_PYTHON=yes PYTHON_VER=27 PYTHON3=%TOOLDIR%python34 DYNAMIC_PYTHON3=yes PYTHON3_VER=34 RUBY=%TOOLDIR%ruby192 DYNAMIC_RUBY=yes RUBY_VER=19 RUBY_VER_LONG=1.9.2 TCL=%TOOLDIR%tcl TCL_VER=86 TCL_VER_LONG=8.6 DYNAMIC_TCL=yes %1 IME=yes CSCOPE=yes vim-7.4.1689/src/bigvim64.bat000066400000000000000000000007661267703067000155140ustar00rootroot00000000000000:: command to build big Vim 64 bit with OLE, Perl, Python, Ruby and Tcl :: First run: %VCDIR%\vcvarsall.bat x86_amd64 :: Ruby and Tcl are excluded, doesn't seem to work. SET VCDIR="C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\" SET TOOLDIR=E:\ %VCDIR%\bin\nmake -f Make_mvc.mak CPU=AMD64 GUI=yes OLE=yes PERL=E:\perl514 DYNAMIC_PERL=yes PERL_VER=514 PYTHON=%TOOLDIR%python27 DYNAMIC_PYTHON=yes PYTHON_VER=27 PYTHON3=%TOOLDIR%python32 DYNAMIC_PYTHON3=yes PYTHON3_VER=32 %1 IME=yes CSCOPE=yes vim-7.4.1689/src/blowfish.c000066400000000000000000000577501267703067000153630ustar00rootroot00000000000000/* 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. * * Blowfish encryption for Vim; in Blowfish cipher feedback mode. * Contributed by Mohsin Ahmed, http://www.cs.albany.edu/~mosh * Based on http://www.schneier.com/blowfish.html by Bruce Schneier. * * There are two variants: * - The old one "blowfish" has a flaw which makes it much easier to crack the * key. To see this, make a text file with one line of 1000 "x" characters * and write it encrypted. Use "xxd" to inspect the bytes in the file. You * will see that a block of 8 bytes repeats 8 times. * - The new one "blowfish2" is better. It uses an 8 byte CFB to avoid the * repeats. */ #include "vim.h" #if defined(FEAT_CRYPT) || defined(PROTO) #define ARRAY_LENGTH(A) (sizeof(A)/sizeof(A[0])) #define BF_BLOCK 8 #define BF_BLOCK_MASK 7 #define BF_MAX_CFB_LEN (8 * BF_BLOCK) typedef union { UINT32_T ul[2]; char_u uc[8]; } block8; #if defined(WIN3264) /* MS-Windows is always little endian */ #else # ifdef HAVE_CONFIG_H /* in configure.in AC_C_BIGENDIAN() defines WORDS_BIGENDIAN when needed */ # else error! Please change this code to define WORDS_BIGENDIAN for big-endian machines. # endif #endif /* The state of encryption, referenced by cryptstate_T. */ typedef struct { UINT32_T pax[18]; /* P-array */ UINT32_T sbx[4][256]; /* S-boxes */ int randbyte_offset; int update_offset; char_u cfb_buffer[BF_MAX_CFB_LEN]; /* up to 64 bytes used */ int cfb_len; /* size of cfb_buffer actually used */ } bf_state_T; static void bf_e_block(bf_state_T *state, UINT32_T *p_xl, UINT32_T *p_xr); static void bf_e_cblock(bf_state_T *state, char_u *block); static int bf_check_tables(UINT32_T pax[18], UINT32_T sbx[4][256], UINT32_T val); static int bf_self_test(void); static void bf_key_init(bf_state_T *state, char_u *password, char_u *salt, int salt_len); static void bf_cfb_init(bf_state_T *state, char_u *seed, int seed_len); /* Blowfish code */ static UINT32_T pax_init[18] = { 0x243f6a88u, 0x85a308d3u, 0x13198a2eu, 0x03707344u, 0xa4093822u, 0x299f31d0u, 0x082efa98u, 0xec4e6c89u, 0x452821e6u, 0x38d01377u, 0xbe5466cfu, 0x34e90c6cu, 0xc0ac29b7u, 0xc97c50ddu, 0x3f84d5b5u, 0xb5470917u, 0x9216d5d9u, 0x8979fb1bu }; static UINT32_T sbx_init[4][256] = { {0xd1310ba6u, 0x98dfb5acu, 0x2ffd72dbu, 0xd01adfb7u, 0xb8e1afedu, 0x6a267e96u, 0xba7c9045u, 0xf12c7f99u, 0x24a19947u, 0xb3916cf7u, 0x0801f2e2u, 0x858efc16u, 0x636920d8u, 0x71574e69u, 0xa458fea3u, 0xf4933d7eu, 0x0d95748fu, 0x728eb658u, 0x718bcd58u, 0x82154aeeu, 0x7b54a41du, 0xc25a59b5u, 0x9c30d539u, 0x2af26013u, 0xc5d1b023u, 0x286085f0u, 0xca417918u, 0xb8db38efu, 0x8e79dcb0u, 0x603a180eu, 0x6c9e0e8bu, 0xb01e8a3eu, 0xd71577c1u, 0xbd314b27u, 0x78af2fdau, 0x55605c60u, 0xe65525f3u, 0xaa55ab94u, 0x57489862u, 0x63e81440u, 0x55ca396au, 0x2aab10b6u, 0xb4cc5c34u, 0x1141e8ceu, 0xa15486afu, 0x7c72e993u, 0xb3ee1411u, 0x636fbc2au, 0x2ba9c55du, 0x741831f6u, 0xce5c3e16u, 0x9b87931eu, 0xafd6ba33u, 0x6c24cf5cu, 0x7a325381u, 0x28958677u, 0x3b8f4898u, 0x6b4bb9afu, 0xc4bfe81bu, 0x66282193u, 0x61d809ccu, 0xfb21a991u, 0x487cac60u, 0x5dec8032u, 0xef845d5du, 0xe98575b1u, 0xdc262302u, 0xeb651b88u, 0x23893e81u, 0xd396acc5u, 0x0f6d6ff3u, 0x83f44239u, 0x2e0b4482u, 0xa4842004u, 0x69c8f04au, 0x9e1f9b5eu, 0x21c66842u, 0xf6e96c9au, 0x670c9c61u, 0xabd388f0u, 0x6a51a0d2u, 0xd8542f68u, 0x960fa728u, 0xab5133a3u, 0x6eef0b6cu, 0x137a3be4u, 0xba3bf050u, 0x7efb2a98u, 0xa1f1651du, 0x39af0176u, 0x66ca593eu, 0x82430e88u, 0x8cee8619u, 0x456f9fb4u, 0x7d84a5c3u, 0x3b8b5ebeu, 0xe06f75d8u, 0x85c12073u, 0x401a449fu, 0x56c16aa6u, 0x4ed3aa62u, 0x363f7706u, 0x1bfedf72u, 0x429b023du, 0x37d0d724u, 0xd00a1248u, 0xdb0fead3u, 0x49f1c09bu, 0x075372c9u, 0x80991b7bu, 0x25d479d8u, 0xf6e8def7u, 0xe3fe501au, 0xb6794c3bu, 0x976ce0bdu, 0x04c006bau, 0xc1a94fb6u, 0x409f60c4u, 0x5e5c9ec2u, 0x196a2463u, 0x68fb6fafu, 0x3e6c53b5u, 0x1339b2ebu, 0x3b52ec6fu, 0x6dfc511fu, 0x9b30952cu, 0xcc814544u, 0xaf5ebd09u, 0xbee3d004u, 0xde334afdu, 0x660f2807u, 0x192e4bb3u, 0xc0cba857u, 0x45c8740fu, 0xd20b5f39u, 0xb9d3fbdbu, 0x5579c0bdu, 0x1a60320au, 0xd6a100c6u, 0x402c7279u, 0x679f25feu, 0xfb1fa3ccu, 0x8ea5e9f8u, 0xdb3222f8u, 0x3c7516dfu, 0xfd616b15u, 0x2f501ec8u, 0xad0552abu, 0x323db5fau, 0xfd238760u, 0x53317b48u, 0x3e00df82u, 0x9e5c57bbu, 0xca6f8ca0u, 0x1a87562eu, 0xdf1769dbu, 0xd542a8f6u, 0x287effc3u, 0xac6732c6u, 0x8c4f5573u, 0x695b27b0u, 0xbbca58c8u, 0xe1ffa35du, 0xb8f011a0u, 0x10fa3d98u, 0xfd2183b8u, 0x4afcb56cu, 0x2dd1d35bu, 0x9a53e479u, 0xb6f84565u, 0xd28e49bcu, 0x4bfb9790u, 0xe1ddf2dau, 0xa4cb7e33u, 0x62fb1341u, 0xcee4c6e8u, 0xef20cadau, 0x36774c01u, 0xd07e9efeu, 0x2bf11fb4u, 0x95dbda4du, 0xae909198u, 0xeaad8e71u, 0x6b93d5a0u, 0xd08ed1d0u, 0xafc725e0u, 0x8e3c5b2fu, 0x8e7594b7u, 0x8ff6e2fbu, 0xf2122b64u, 0x8888b812u, 0x900df01cu, 0x4fad5ea0u, 0x688fc31cu, 0xd1cff191u, 0xb3a8c1adu, 0x2f2f2218u, 0xbe0e1777u, 0xea752dfeu, 0x8b021fa1u, 0xe5a0cc0fu, 0xb56f74e8u, 0x18acf3d6u, 0xce89e299u, 0xb4a84fe0u, 0xfd13e0b7u, 0x7cc43b81u, 0xd2ada8d9u, 0x165fa266u, 0x80957705u, 0x93cc7314u, 0x211a1477u, 0xe6ad2065u, 0x77b5fa86u, 0xc75442f5u, 0xfb9d35cfu, 0xebcdaf0cu, 0x7b3e89a0u, 0xd6411bd3u, 0xae1e7e49u, 0x00250e2du, 0x2071b35eu, 0x226800bbu, 0x57b8e0afu, 0x2464369bu, 0xf009b91eu, 0x5563911du, 0x59dfa6aau, 0x78c14389u, 0xd95a537fu, 0x207d5ba2u, 0x02e5b9c5u, 0x83260376u, 0x6295cfa9u, 0x11c81968u, 0x4e734a41u, 0xb3472dcau, 0x7b14a94au, 0x1b510052u, 0x9a532915u, 0xd60f573fu, 0xbc9bc6e4u, 0x2b60a476u, 0x81e67400u, 0x08ba6fb5u, 0x571be91fu, 0xf296ec6bu, 0x2a0dd915u, 0xb6636521u, 0xe7b9f9b6u, 0xff34052eu, 0xc5855664u, 0x53b02d5du, 0xa99f8fa1u, 0x08ba4799u, 0x6e85076au}, {0x4b7a70e9u, 0xb5b32944u, 0xdb75092eu, 0xc4192623u, 0xad6ea6b0u, 0x49a7df7du, 0x9cee60b8u, 0x8fedb266u, 0xecaa8c71u, 0x699a17ffu, 0x5664526cu, 0xc2b19ee1u, 0x193602a5u, 0x75094c29u, 0xa0591340u, 0xe4183a3eu, 0x3f54989au, 0x5b429d65u, 0x6b8fe4d6u, 0x99f73fd6u, 0xa1d29c07u, 0xefe830f5u, 0x4d2d38e6u, 0xf0255dc1u, 0x4cdd2086u, 0x8470eb26u, 0x6382e9c6u, 0x021ecc5eu, 0x09686b3fu, 0x3ebaefc9u, 0x3c971814u, 0x6b6a70a1u, 0x687f3584u, 0x52a0e286u, 0xb79c5305u, 0xaa500737u, 0x3e07841cu, 0x7fdeae5cu, 0x8e7d44ecu, 0x5716f2b8u, 0xb03ada37u, 0xf0500c0du, 0xf01c1f04u, 0x0200b3ffu, 0xae0cf51au, 0x3cb574b2u, 0x25837a58u, 0xdc0921bdu, 0xd19113f9u, 0x7ca92ff6u, 0x94324773u, 0x22f54701u, 0x3ae5e581u, 0x37c2dadcu, 0xc8b57634u, 0x9af3dda7u, 0xa9446146u, 0x0fd0030eu, 0xecc8c73eu, 0xa4751e41u, 0xe238cd99u, 0x3bea0e2fu, 0x3280bba1u, 0x183eb331u, 0x4e548b38u, 0x4f6db908u, 0x6f420d03u, 0xf60a04bfu, 0x2cb81290u, 0x24977c79u, 0x5679b072u, 0xbcaf89afu, 0xde9a771fu, 0xd9930810u, 0xb38bae12u, 0xdccf3f2eu, 0x5512721fu, 0x2e6b7124u, 0x501adde6u, 0x9f84cd87u, 0x7a584718u, 0x7408da17u, 0xbc9f9abcu, 0xe94b7d8cu, 0xec7aec3au, 0xdb851dfau, 0x63094366u, 0xc464c3d2u, 0xef1c1847u, 0x3215d908u, 0xdd433b37u, 0x24c2ba16u, 0x12a14d43u, 0x2a65c451u, 0x50940002u, 0x133ae4ddu, 0x71dff89eu, 0x10314e55u, 0x81ac77d6u, 0x5f11199bu, 0x043556f1u, 0xd7a3c76bu, 0x3c11183bu, 0x5924a509u, 0xf28fe6edu, 0x97f1fbfau, 0x9ebabf2cu, 0x1e153c6eu, 0x86e34570u, 0xeae96fb1u, 0x860e5e0au, 0x5a3e2ab3u, 0x771fe71cu, 0x4e3d06fau, 0x2965dcb9u, 0x99e71d0fu, 0x803e89d6u, 0x5266c825u, 0x2e4cc978u, 0x9c10b36au, 0xc6150ebau, 0x94e2ea78u, 0xa5fc3c53u, 0x1e0a2df4u, 0xf2f74ea7u, 0x361d2b3du, 0x1939260fu, 0x19c27960u, 0x5223a708u, 0xf71312b6u, 0xebadfe6eu, 0xeac31f66u, 0xe3bc4595u, 0xa67bc883u, 0xb17f37d1u, 0x018cff28u, 0xc332ddefu, 0xbe6c5aa5u, 0x65582185u, 0x68ab9802u, 0xeecea50fu, 0xdb2f953bu, 0x2aef7dadu, 0x5b6e2f84u, 0x1521b628u, 0x29076170u, 0xecdd4775u, 0x619f1510u, 0x13cca830u, 0xeb61bd96u, 0x0334fe1eu, 0xaa0363cfu, 0xb5735c90u, 0x4c70a239u, 0xd59e9e0bu, 0xcbaade14u, 0xeecc86bcu, 0x60622ca7u, 0x9cab5cabu, 0xb2f3846eu, 0x648b1eafu, 0x19bdf0cau, 0xa02369b9u, 0x655abb50u, 0x40685a32u, 0x3c2ab4b3u, 0x319ee9d5u, 0xc021b8f7u, 0x9b540b19u, 0x875fa099u, 0x95f7997eu, 0x623d7da8u, 0xf837889au, 0x97e32d77u, 0x11ed935fu, 0x16681281u, 0x0e358829u, 0xc7e61fd6u, 0x96dedfa1u, 0x7858ba99u, 0x57f584a5u, 0x1b227263u, 0x9b83c3ffu, 0x1ac24696u, 0xcdb30aebu, 0x532e3054u, 0x8fd948e4u, 0x6dbc3128u, 0x58ebf2efu, 0x34c6ffeau, 0xfe28ed61u, 0xee7c3c73u, 0x5d4a14d9u, 0xe864b7e3u, 0x42105d14u, 0x203e13e0u, 0x45eee2b6u, 0xa3aaabeau, 0xdb6c4f15u, 0xfacb4fd0u, 0xc742f442u, 0xef6abbb5u, 0x654f3b1du, 0x41cd2105u, 0xd81e799eu, 0x86854dc7u, 0xe44b476au, 0x3d816250u, 0xcf62a1f2u, 0x5b8d2646u, 0xfc8883a0u, 0xc1c7b6a3u, 0x7f1524c3u, 0x69cb7492u, 0x47848a0bu, 0x5692b285u, 0x095bbf00u, 0xad19489du, 0x1462b174u, 0x23820e00u, 0x58428d2au, 0x0c55f5eau, 0x1dadf43eu, 0x233f7061u, 0x3372f092u, 0x8d937e41u, 0xd65fecf1u, 0x6c223bdbu, 0x7cde3759u, 0xcbee7460u, 0x4085f2a7u, 0xce77326eu, 0xa6078084u, 0x19f8509eu, 0xe8efd855u, 0x61d99735u, 0xa969a7aau, 0xc50c06c2u, 0x5a04abfcu, 0x800bcadcu, 0x9e447a2eu, 0xc3453484u, 0xfdd56705u, 0x0e1e9ec9u, 0xdb73dbd3u, 0x105588cdu, 0x675fda79u, 0xe3674340u, 0xc5c43465u, 0x713e38d8u, 0x3d28f89eu, 0xf16dff20u, 0x153e21e7u, 0x8fb03d4au, 0xe6e39f2bu, 0xdb83adf7u}, {0xe93d5a68u, 0x948140f7u, 0xf64c261cu, 0x94692934u, 0x411520f7u, 0x7602d4f7u, 0xbcf46b2eu, 0xd4a20068u, 0xd4082471u, 0x3320f46au, 0x43b7d4b7u, 0x500061afu, 0x1e39f62eu, 0x97244546u, 0x14214f74u, 0xbf8b8840u, 0x4d95fc1du, 0x96b591afu, 0x70f4ddd3u, 0x66a02f45u, 0xbfbc09ecu, 0x03bd9785u, 0x7fac6dd0u, 0x31cb8504u, 0x96eb27b3u, 0x55fd3941u, 0xda2547e6u, 0xabca0a9au, 0x28507825u, 0x530429f4u, 0x0a2c86dau, 0xe9b66dfbu, 0x68dc1462u, 0xd7486900u, 0x680ec0a4u, 0x27a18deeu, 0x4f3ffea2u, 0xe887ad8cu, 0xb58ce006u, 0x7af4d6b6u, 0xaace1e7cu, 0xd3375fecu, 0xce78a399u, 0x406b2a42u, 0x20fe9e35u, 0xd9f385b9u, 0xee39d7abu, 0x3b124e8bu, 0x1dc9faf7u, 0x4b6d1856u, 0x26a36631u, 0xeae397b2u, 0x3a6efa74u, 0xdd5b4332u, 0x6841e7f7u, 0xca7820fbu, 0xfb0af54eu, 0xd8feb397u, 0x454056acu, 0xba489527u, 0x55533a3au, 0x20838d87u, 0xfe6ba9b7u, 0xd096954bu, 0x55a867bcu, 0xa1159a58u, 0xcca92963u, 0x99e1db33u, 0xa62a4a56u, 0x3f3125f9u, 0x5ef47e1cu, 0x9029317cu, 0xfdf8e802u, 0x04272f70u, 0x80bb155cu, 0x05282ce3u, 0x95c11548u, 0xe4c66d22u, 0x48c1133fu, 0xc70f86dcu, 0x07f9c9eeu, 0x41041f0fu, 0x404779a4u, 0x5d886e17u, 0x325f51ebu, 0xd59bc0d1u, 0xf2bcc18fu, 0x41113564u, 0x257b7834u, 0x602a9c60u, 0xdff8e8a3u, 0x1f636c1bu, 0x0e12b4c2u, 0x02e1329eu, 0xaf664fd1u, 0xcad18115u, 0x6b2395e0u, 0x333e92e1u, 0x3b240b62u, 0xeebeb922u, 0x85b2a20eu, 0xe6ba0d99u, 0xde720c8cu, 0x2da2f728u, 0xd0127845u, 0x95b794fdu, 0x647d0862u, 0xe7ccf5f0u, 0x5449a36fu, 0x877d48fau, 0xc39dfd27u, 0xf33e8d1eu, 0x0a476341u, 0x992eff74u, 0x3a6f6eabu, 0xf4f8fd37u, 0xa812dc60u, 0xa1ebddf8u, 0x991be14cu, 0xdb6e6b0du, 0xc67b5510u, 0x6d672c37u, 0x2765d43bu, 0xdcd0e804u, 0xf1290dc7u, 0xcc00ffa3u, 0xb5390f92u, 0x690fed0bu, 0x667b9ffbu, 0xcedb7d9cu, 0xa091cf0bu, 0xd9155ea3u, 0xbb132f88u, 0x515bad24u, 0x7b9479bfu, 0x763bd6ebu, 0x37392eb3u, 0xcc115979u, 0x8026e297u, 0xf42e312du, 0x6842ada7u, 0xc66a2b3bu, 0x12754cccu, 0x782ef11cu, 0x6a124237u, 0xb79251e7u, 0x06a1bbe6u, 0x4bfb6350u, 0x1a6b1018u, 0x11caedfau, 0x3d25bdd8u, 0xe2e1c3c9u, 0x44421659u, 0x0a121386u, 0xd90cec6eu, 0xd5abea2au, 0x64af674eu, 0xda86a85fu, 0xbebfe988u, 0x64e4c3feu, 0x9dbc8057u, 0xf0f7c086u, 0x60787bf8u, 0x6003604du, 0xd1fd8346u, 0xf6381fb0u, 0x7745ae04u, 0xd736fcccu, 0x83426b33u, 0xf01eab71u, 0xb0804187u, 0x3c005e5fu, 0x77a057beu, 0xbde8ae24u, 0x55464299u, 0xbf582e61u, 0x4e58f48fu, 0xf2ddfda2u, 0xf474ef38u, 0x8789bdc2u, 0x5366f9c3u, 0xc8b38e74u, 0xb475f255u, 0x46fcd9b9u, 0x7aeb2661u, 0x8b1ddf84u, 0x846a0e79u, 0x915f95e2u, 0x466e598eu, 0x20b45770u, 0x8cd55591u, 0xc902de4cu, 0xb90bace1u, 0xbb8205d0u, 0x11a86248u, 0x7574a99eu, 0xb77f19b6u, 0xe0a9dc09u, 0x662d09a1u, 0xc4324633u, 0xe85a1f02u, 0x09f0be8cu, 0x4a99a025u, 0x1d6efe10u, 0x1ab93d1du, 0x0ba5a4dfu, 0xa186f20fu, 0x2868f169u, 0xdcb7da83u, 0x573906feu, 0xa1e2ce9bu, 0x4fcd7f52u, 0x50115e01u, 0xa70683fau, 0xa002b5c4u, 0x0de6d027u, 0x9af88c27u, 0x773f8641u, 0xc3604c06u, 0x61a806b5u, 0xf0177a28u, 0xc0f586e0u, 0x006058aau, 0x30dc7d62u, 0x11e69ed7u, 0x2338ea63u, 0x53c2dd94u, 0xc2c21634u, 0xbbcbee56u, 0x90bcb6deu, 0xebfc7da1u, 0xce591d76u, 0x6f05e409u, 0x4b7c0188u, 0x39720a3du, 0x7c927c24u, 0x86e3725fu, 0x724d9db9u, 0x1ac15bb4u, 0xd39eb8fcu, 0xed545578u, 0x08fca5b5u, 0xd83d7cd3u, 0x4dad0fc4u, 0x1e50ef5eu, 0xb161e6f8u, 0xa28514d9u, 0x6c51133cu, 0x6fd5c7e7u, 0x56e14ec4u, 0x362abfceu, 0xddc6c837u, 0xd79a3234u, 0x92638212u, 0x670efa8eu, 0x406000e0u}, {0x3a39ce37u, 0xd3faf5cfu, 0xabc27737u, 0x5ac52d1bu, 0x5cb0679eu, 0x4fa33742u, 0xd3822740u, 0x99bc9bbeu, 0xd5118e9du, 0xbf0f7315u, 0xd62d1c7eu, 0xc700c47bu, 0xb78c1b6bu, 0x21a19045u, 0xb26eb1beu, 0x6a366eb4u, 0x5748ab2fu, 0xbc946e79u, 0xc6a376d2u, 0x6549c2c8u, 0x530ff8eeu, 0x468dde7du, 0xd5730a1du, 0x4cd04dc6u, 0x2939bbdbu, 0xa9ba4650u, 0xac9526e8u, 0xbe5ee304u, 0xa1fad5f0u, 0x6a2d519au, 0x63ef8ce2u, 0x9a86ee22u, 0xc089c2b8u, 0x43242ef6u, 0xa51e03aau, 0x9cf2d0a4u, 0x83c061bau, 0x9be96a4du, 0x8fe51550u, 0xba645bd6u, 0x2826a2f9u, 0xa73a3ae1u, 0x4ba99586u, 0xef5562e9u, 0xc72fefd3u, 0xf752f7dau, 0x3f046f69u, 0x77fa0a59u, 0x80e4a915u, 0x87b08601u, 0x9b09e6adu, 0x3b3ee593u, 0xe990fd5au, 0x9e34d797u, 0x2cf0b7d9u, 0x022b8b51u, 0x96d5ac3au, 0x017da67du, 0xd1cf3ed6u, 0x7c7d2d28u, 0x1f9f25cfu, 0xadf2b89bu, 0x5ad6b472u, 0x5a88f54cu, 0xe029ac71u, 0xe019a5e6u, 0x47b0acfdu, 0xed93fa9bu, 0xe8d3c48du, 0x283b57ccu, 0xf8d56629u, 0x79132e28u, 0x785f0191u, 0xed756055u, 0xf7960e44u, 0xe3d35e8cu, 0x15056dd4u, 0x88f46dbau, 0x03a16125u, 0x0564f0bdu, 0xc3eb9e15u, 0x3c9057a2u, 0x97271aecu, 0xa93a072au, 0x1b3f6d9bu, 0x1e6321f5u, 0xf59c66fbu, 0x26dcf319u, 0x7533d928u, 0xb155fdf5u, 0x03563482u, 0x8aba3cbbu, 0x28517711u, 0xc20ad9f8u, 0xabcc5167u, 0xccad925fu, 0x4de81751u, 0x3830dc8eu, 0x379d5862u, 0x9320f991u, 0xea7a90c2u, 0xfb3e7bceu, 0x5121ce64u, 0x774fbe32u, 0xa8b6e37eu, 0xc3293d46u, 0x48de5369u, 0x6413e680u, 0xa2ae0810u, 0xdd6db224u, 0x69852dfdu, 0x09072166u, 0xb39a460au, 0x6445c0ddu, 0x586cdecfu, 0x1c20c8aeu, 0x5bbef7ddu, 0x1b588d40u, 0xccd2017fu, 0x6bb4e3bbu, 0xdda26a7eu, 0x3a59ff45u, 0x3e350a44u, 0xbcb4cdd5u, 0x72eacea8u, 0xfa6484bbu, 0x8d6612aeu, 0xbf3c6f47u, 0xd29be463u, 0x542f5d9eu, 0xaec2771bu, 0xf64e6370u, 0x740e0d8du, 0xe75b1357u, 0xf8721671u, 0xaf537d5du, 0x4040cb08u, 0x4eb4e2ccu, 0x34d2466au, 0x0115af84u, 0xe1b00428u, 0x95983a1du, 0x06b89fb4u, 0xce6ea048u, 0x6f3f3b82u, 0x3520ab82u, 0x011a1d4bu, 0x277227f8u, 0x611560b1u, 0xe7933fdcu, 0xbb3a792bu, 0x344525bdu, 0xa08839e1u, 0x51ce794bu, 0x2f32c9b7u, 0xa01fbac9u, 0xe01cc87eu, 0xbcc7d1f6u, 0xcf0111c3u, 0xa1e8aac7u, 0x1a908749u, 0xd44fbd9au, 0xd0dadecbu, 0xd50ada38u, 0x0339c32au, 0xc6913667u, 0x8df9317cu, 0xe0b12b4fu, 0xf79e59b7u, 0x43f5bb3au, 0xf2d519ffu, 0x27d9459cu, 0xbf97222cu, 0x15e6fc2au, 0x0f91fc71u, 0x9b941525u, 0xfae59361u, 0xceb69cebu, 0xc2a86459u, 0x12baa8d1u, 0xb6c1075eu, 0xe3056a0cu, 0x10d25065u, 0xcb03a442u, 0xe0ec6e0eu, 0x1698db3bu, 0x4c98a0beu, 0x3278e964u, 0x9f1f9532u, 0xe0d392dfu, 0xd3a0342bu, 0x8971f21eu, 0x1b0a7441u, 0x4ba3348cu, 0xc5be7120u, 0xc37632d8u, 0xdf359f8du, 0x9b992f2eu, 0xe60b6f47u, 0x0fe3f11du, 0xe54cda54u, 0x1edad891u, 0xce6279cfu, 0xcd3e7e6fu, 0x1618b166u, 0xfd2c1d05u, 0x848fd2c5u, 0xf6fb2299u, 0xf523f357u, 0xa6327623u, 0x93a83531u, 0x56cccd02u, 0xacf08162u, 0x5a75ebb5u, 0x6e163697u, 0x88d273ccu, 0xde966292u, 0x81b949d0u, 0x4c50901bu, 0x71c65614u, 0xe6c6c7bdu, 0x327a140au, 0x45e1d006u, 0xc3f27b9au, 0xc9aa53fdu, 0x62a80f00u, 0xbb25bfe2u, 0x35bdd2f6u, 0x71126905u, 0xb2040222u, 0xb6cbcf7cu, 0xcd769c2bu, 0x53113ec0u, 0x1640e3d3u, 0x38abbd60u, 0x2547adf0u, 0xba38209cu, 0xf746ce76u, 0x77afa1c5u, 0x20756060u, 0x85cbfe4eu, 0x8ae88dd8u, 0x7aaaf9b0u, 0x4cf9aa7eu, 0x1948c25cu, 0x02fb8a8cu, 0x01c36ae4u, 0xd6ebe1f9u, 0x90d4f869u, 0xa65cdea0u, 0x3f09252du, 0xc208e69fu, 0xb74e6132u, 0xce77e25bu, 0x578fdfe3u, 0x3ac372e6u } }; #define F1(i) \ xl ^= bfs->pax[i]; \ xr ^= ((bfs->sbx[0][xl >> 24] + \ bfs->sbx[1][(xl & 0xFF0000) >> 16]) ^ \ bfs->sbx[2][(xl & 0xFF00) >> 8]) + \ bfs->sbx[3][xl & 0xFF]; #define F2(i) \ xr ^= bfs->pax[i]; \ xl ^= ((bfs->sbx[0][xr >> 24] + \ bfs->sbx[1][(xr & 0xFF0000) >> 16]) ^ \ bfs->sbx[2][(xr & 0xFF00) >> 8]) + \ bfs->sbx[3][xr & 0xFF]; static void bf_e_block( bf_state_T *bfs, UINT32_T *p_xl, UINT32_T *p_xr) { UINT32_T temp; UINT32_T xl = *p_xl; UINT32_T xr = *p_xr; F1(0) F2(1) F1(2) F2(3) F1(4) F2(5) F1(6) F2(7) F1(8) F2(9) F1(10) F2(11) F1(12) F2(13) F1(14) F2(15) xl ^= bfs->pax[16]; xr ^= bfs->pax[17]; temp = xl; xl = xr; xr = temp; *p_xl = xl; *p_xr = xr; } #ifdef WORDS_BIGENDIAN # define htonl2(x) \ x = ((((x) & 0xffL) << 24) | (((x) & 0xff00L) << 8) | \ (((x) & 0xff0000L) >> 8) | (((x) & 0xff000000L) >> 24)) #else # define htonl2(x) #endif static void bf_e_cblock( bf_state_T *bfs, char_u *block) { block8 bk; memcpy(bk.uc, block, 8); htonl2(bk.ul[0]); htonl2(bk.ul[1]); bf_e_block(bfs, &bk.ul[0], &bk.ul[1]); htonl2(bk.ul[0]); htonl2(bk.ul[1]); memcpy(block, bk.uc, 8); } /* * Initialize the crypt method using "password" as the encryption key and * "salt[salt_len]" as the salt. */ static void bf_key_init( bf_state_T *bfs, char_u *password, char_u *salt, int salt_len) { int i, j, keypos = 0; unsigned u; UINT32_T val, data_l, data_r; char_u *key; int keylen; /* Process the key 1001 times. * See http://en.wikipedia.org/wiki/Key_strengthening. */ key = sha256_key(password, salt, salt_len); for (i = 0; i < 1000; i++) key = sha256_key(key, salt, salt_len); /* Convert the key from 64 hex chars to 32 binary chars. */ keylen = (int)STRLEN(key) / 2; if (keylen == 0) { EMSG(_("E831: bf_key_init() called with empty password")); return; } for (i = 0; i < keylen; i++) { sscanf((char *)&key[i * 2], "%2x", &u); key[i] = u; } /* Use "key" to initialize the P-array ("pax") and S-boxes ("sbx") of * Blowfish. */ mch_memmove(bfs->sbx, sbx_init, 4 * 4 * 256); for (i = 0; i < 18; ++i) { val = 0; for (j = 0; j < 4; ++j) val = (val << 8) | key[keypos++ % keylen]; bfs->pax[i] = pax_init[i] ^ val; } data_l = data_r = 0; for (i = 0; i < 18; i += 2) { bf_e_block(bfs, &data_l, &data_r); bfs->pax[i + 0] = data_l; bfs->pax[i + 1] = data_r; } for (i = 0; i < 4; ++i) { for (j = 0; j < 256; j += 2) { bf_e_block(bfs, &data_l, &data_r); bfs->sbx[i][j + 0] = data_l; bfs->sbx[i][j + 1] = data_r; } } } /* * Blowfish self-test for corrupted tables or instructions. */ static int bf_check_tables( UINT32_T pax[18], UINT32_T sbx[4][256], UINT32_T val) { int i, j; UINT32_T c = 0; for (i = 0; i < 18; i++) c ^= pax[i]; for (i = 0; i < 4; i++) for (j = 0; j < 256; j++) c ^= sbx[i][j]; return c == val; } typedef struct { char_u password[64]; char_u salt[9]; char_u plaintxt[9]; char_u cryptxt[9]; char_u badcryptxt[9]; /* cryptxt when big/little endian is wrong */ UINT32_T keysum; } struct_bf_test_data; /* * Assert bf(password, plaintxt) is cryptxt. * Assert csum(pax sbx(password)) is keysum. */ static struct_bf_test_data bf_test_data[] = { { "password", "salt", "plaintxt", "\xad\x3d\xfa\x7f\xe8\xea\x40\xf6", /* cryptxt */ "\x72\x50\x3b\x38\x10\x60\x22\xa7", /* badcryptxt */ 0x56701b5du /* keysum */ }, }; /* * Return FAIL when there is something wrong with blowfish encryption. */ static int bf_self_test(void) { int i, bn; int err = 0; block8 bk; UINT32_T ui = 0xffffffffUL; bf_state_T state; vim_memset(&state, 0, sizeof(bf_state_T)); state.cfb_len = BF_MAX_CFB_LEN; /* We can't simply use sizeof(UINT32_T), it would generate a compiler * warning. */ if (ui != 0xffffffffUL || ui + 1 != 0) { err++; EMSG(_("E820: sizeof(uint32_t) != 4")); } if (!bf_check_tables(pax_init, sbx_init, 0x6ffa520a)) err++; bn = ARRAY_LENGTH(bf_test_data); for (i = 0; i < bn; i++) { bf_key_init(&state, (char_u *)(bf_test_data[i].password), bf_test_data[i].salt, (int)STRLEN(bf_test_data[i].salt)); if (!bf_check_tables(state.pax, state.sbx, bf_test_data[i].keysum)) err++; /* Don't modify bf_test_data[i].plaintxt, self test is idempotent. */ memcpy(bk.uc, bf_test_data[i].plaintxt, 8); bf_e_cblock(&state, bk.uc); if (memcmp(bk.uc, bf_test_data[i].cryptxt, 8) != 0) { if (err == 0 && memcmp(bk.uc, bf_test_data[i].badcryptxt, 8) == 0) EMSG(_("E817: Blowfish big/little endian use wrong")); err++; } } return err > 0 ? FAIL : OK; } /* * CFB: Cipher Feedback Mode. */ /* * Initialize with seed "seed[seed_len]". */ static void bf_cfb_init( bf_state_T *bfs, char_u *seed, int seed_len) { int i, mi; bfs->randbyte_offset = bfs->update_offset = 0; vim_memset(bfs->cfb_buffer, 0, bfs->cfb_len); if (seed_len > 0) { mi = seed_len > bfs->cfb_len ? seed_len : bfs->cfb_len; for (i = 0; i < mi; i++) bfs->cfb_buffer[i % bfs->cfb_len] ^= seed[i % seed_len]; } } #define BF_CFB_UPDATE(bfs, c) { \ bfs->cfb_buffer[bfs->update_offset] ^= (char_u)c; \ if (++bfs->update_offset == bfs->cfb_len) \ bfs->update_offset = 0; \ } #define BF_RANBYTE(bfs, t) { \ if ((bfs->randbyte_offset & BF_BLOCK_MASK) == 0) \ bf_e_cblock(bfs, &(bfs->cfb_buffer[bfs->randbyte_offset])); \ t = bfs->cfb_buffer[bfs->randbyte_offset]; \ if (++bfs->randbyte_offset == bfs->cfb_len) \ bfs->randbyte_offset = 0; \ } /* * Encrypt "from[len]" into "to[len]". * "from" and "to" can be equal to encrypt in place. */ void crypt_blowfish_encode( cryptstate_T *state, char_u *from, size_t len, char_u *to) { bf_state_T *bfs = state->method_state; size_t i; int ztemp, t; for (i = 0; i < len; ++i) { ztemp = from[i]; BF_RANBYTE(bfs, t); BF_CFB_UPDATE(bfs, ztemp); to[i] = t ^ ztemp; } } /* * Decrypt "from[len]" into "to[len]". */ void crypt_blowfish_decode( cryptstate_T *state, char_u *from, size_t len, char_u *to) { bf_state_T *bfs = state->method_state; size_t i; int t; for (i = 0; i < len; ++i) { BF_RANBYTE(bfs, t); to[i] = from[i] ^ t; BF_CFB_UPDATE(bfs, to[i]); } } void crypt_blowfish_init( cryptstate_T *state, char_u* key, char_u* salt, int salt_len, char_u* seed, int seed_len) { bf_state_T *bfs = (bf_state_T *)alloc_clear(sizeof(bf_state_T)); state->method_state = bfs; /* "blowfish" uses a 64 byte buffer, causing it to repeat 8 byte groups 8 * times. "blowfish2" uses a 8 byte buffer to avoid repeating. */ bfs->cfb_len = state->method_nr == CRYPT_M_BF ? BF_MAX_CFB_LEN : BF_BLOCK; if (blowfish_self_test() == FAIL) return; bf_key_init(bfs, key, salt, salt_len); bf_cfb_init(bfs, seed, seed_len); } /* * Run a test to check if the encryption works as expected. * Give an error and return FAIL when not. */ int blowfish_self_test(void) { if (sha256_self_test() == FAIL) { EMSG(_("E818: sha256 test failed")); return FAIL; } if (bf_self_test() == FAIL) { EMSG(_("E819: Blowfish test failed")); return FAIL; } return OK; } #endif /* FEAT_CRYPT */ vim-7.4.1689/src/buffer.c000066400000000000000000004272731267703067000150200ustar00rootroot00000000000000/* 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(regmatch_T *rmp, buf_T *buf, int ignore_case); # define HAVE_BUFLIST_MATCH static char_u *fname_match(regmatch_T *rmp, char_u *name, int ignore_case); #endif static void buflist_setfpos(buf_T *buf, win_T *win, linenr_T lnum, colnr_T col, int copy_options); static wininfo_T *find_wininfo(buf_T *buf, int skip_diff_buffer); #ifdef UNIX static buf_T *buflist_findname_stat(char_u *ffname, struct stat *st); static int otherfile_buf(buf_T *buf, char_u *ffname, struct stat *stp); static int buf_same_ino(buf_T *buf, struct stat *stp); #else static int otherfile_buf(buf_T *buf, char_u *ffname); #endif #ifdef FEAT_TITLE static int ti_change(char_u *str, char_u **last); #endif static int append_arg_number(win_T *wp, char_u *buf, int buflen, int add_file); static void free_buffer(buf_T *); static void free_buffer_stuff(buf_T *buf, int free_options); static void clear_wininfo(buf_T *buf); #ifdef UNIX # define dev_T dev_t #else # define dev_T unsigned #endif #if defined(FEAT_SIGNS) static void insert_sign(buf_T *buf, signlist_T *prev, signlist_T *next, int id, linenr_T lnum, int typenr); #endif #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX) static char *msg_loclist = N_("[Location List]"); static char *msg_qflist = N_("[Quickfix List]"); #endif #ifdef FEAT_AUTOCMD static char *e_auabort = N_("E855: Autocommands caused command to abort"); #endif /* * Open current buffer, that is: open the memfile and read the file into * memory. * Return FAIL for failure, OK otherwise. */ int open_buffer( int read_stdin, /* read file from stdin */ exarg_T *eap, /* for forced 'ff' and 'fenc' or NULL */ int flags) /* extra flags for readfile() */ { int retval = OK; #ifdef FEAT_AUTOCMD buf_T *old_curbuf; #endif #ifdef FEAT_SYN_HL long old_tw = curbuf->b_p_tw; #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(curbuf) == 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, FALSE); 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 lose. */ if (curbuf == NULL) { EMSG(_("E82: Cannot allocate any buffer, exiting...")); getout(2); } EMSG(_("E83: Cannot allocate buffer, using other one...")); enter_buffer(curbuf); #ifdef FEAT_SYN_HL if (old_tw != curbuf->b_p_tw) check_colorcolumn(curwin); #endif 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 */ curwin->w_valid = 0; if (curbuf->b_ffname != NULL #ifdef FEAT_NETBEANS_INTG && netbeansReadFile #endif ) { int old_msg_silent = msg_silent; #ifdef FEAT_NETBEANS_INTG int oldFire = netbeansFireChanges; netbeansFireChanges = 0; #endif if (shortmess(SHM_FILEINFO)) msg_silent = 1; retval = readfile(curbuf->b_ffname, curbuf->b_fname, (linenr_T)0, (linenr_T)0, (linenr_T)MAXLNUM, eap, flags | READ_NEW); msg_silent = old_msg_silent; #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, flags | (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, flags | 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; /* Set or reset 'modified' before executing autocommands, so that * it can be changed there. */ if (!readonlymode && !bufempty()) changed(); else if (retval != FAIL) unchanged(curbuf, FALSE); #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); #ifdef FEAT_CINDENT parse_cino(curbuf); #endif } /* * 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 ((got_int && vim_strchr(p_cpo, CPO_INTMOD) != NULL) #ifdef FEAT_AUTOCMD || modified_was_set /* ":set modified" used in autocmd */ # ifdef FEAT_EVAL || (aborting() && vim_strchr(p_cpo, CPO_INTMOD) != NULL) # endif #endif ) changed(); else if (retval != FAIL && !read_stdin) 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_FOLDING /* Need to update automatic folding. Do this before the autocommands, * they may use the fold info. */ foldUpdateAll(curwin); #endif #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(0); 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 } return retval; } /* * Return TRUE if "buf" points to a valid buffer (in the buffer list). */ int buf_valid(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. * * When "abort_if_last" is TRUE then do not close the buffer if autocommands * cause there to be only one window with this buffer. e.g. when ":quit" is * supposed to close the window but autocommands close all other windows. */ void close_buffer( win_T *win, /* if not NULL, set b_last_cursor */ buf_T *buf, int action, int abort_if_last UNUSED) { #ifdef FEAT_AUTOCMD int is_curbuf; int 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 #ifdef FEAT_WINDOWS && win_valid(win) /* in case autocommands closed the window */ #endif ) { /* 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) { buf->b_closing = TRUE; apply_autocmds(EVENT_BUFWINLEAVE, buf->b_fname, buf->b_fname, FALSE, buf); if (!buf_valid(buf)) { /* Autocommands deleted the buffer. */ aucmd_abort: EMSG(_(e_auabort)); return; } buf->b_closing = FALSE; if (abort_if_last && one_window()) /* Autocommands made this the only window. */ goto aucmd_abort; /* When the buffer becomes hidden, but is not unloaded, trigger * BufHidden */ if (!unload_buf) { buf->b_closing = TRUE; apply_autocmds(EVENT_BUFHIDDEN, buf->b_fname, buf->b_fname, FALSE, buf); if (!buf_valid(buf)) /* Autocommands deleted the buffer. */ goto aucmd_abort; buf->b_closing = FALSE; if (abort_if_last && one_window()) /* Autocommands made this the only window. */ goto aucmd_abort; } # 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) 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 ? BFA_DEL : 0) + (wipe_buf ? BFA_WIPE : 0)); if ( #ifdef FEAT_WINDOWS win_valid(win) && #else win != NULL && #endif win->w_buffer == buf) win->w_buffer = NULL; /* make sure we don't use the buffer now */ #ifdef FEAT_AUTOCMD /* Autocommands may have deleted the buffer. */ if (!buf_valid(buf)) return; # ifdef FEAT_EVAL if (aborting()) /* autocmds may abort script processing */ 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 /* Change directories when the 'acd' option is set. */ DO_AUTOCHDIR /* * 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_T *buf) { buf->b_ml.ml_line_count = 1; unchanged(buf, TRUE); buf->b_shortname = FALSE; buf->b_p_eol = TRUE; buf->b_start_eol = TRUE; #ifdef FEAT_MBYTE buf->b_p_bomb = FALSE; buf->b_start_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); #endif } /* * buf_freeall() - free all things allocated for a buffer that are related to * the file. flags: * BFA_DEL buffer is going to be deleted * BFA_WIPE buffer is going to be wiped out * BFA_KEEP_UNDO do not free undo information */ void buf_freeall(buf_T *buf, int flags) { #ifdef FEAT_AUTOCMD int is_curbuf = (buf == curbuf); buf->b_closing = TRUE; apply_autocmds(EVENT_BUFUNLOAD, buf->b_fname, buf->b_fname, FALSE, buf); if (!buf_valid(buf)) /* autocommands may delete the buffer */ return; if ((flags & BFA_DEL) && 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 (flags & BFA_WIPE) { apply_autocmds(EVENT_BUFWIPEOUT, buf->b_fname, buf->b_fname, FALSE, buf); if (!buf_valid(buf)) /* autocommands may delete the buffer */ return; } buf->b_closing = FALSE; # 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_SYN_HL /* Remove any ownsyntax, unless exiting. */ if (firstwin != NULL && curwin->w_buffer == buf) reset_synblock(curwin); #endif #ifdef FEAT_FOLDING /* No folds in an empty buffer. */ # ifdef FEAT_WINDOWS { win_T *win; tabpage_T *tp; FOR_ALL_TAB_WINDOWS(tp, win) if (win->w_buffer == buf) clearFolding(win); } # else if (curwin->w_buffer == buf) clearFolding(curwin); # endif #endif #ifdef FEAT_TCL tcl_buffer_free(buf); #endif ml_close(buf, TRUE); /* close and delete the memline/memfile */ buf->b_ml.ml_line_count = 0; /* no lines in buffer */ if ((flags & BFA_KEEP_UNDO) == 0) { u_blockfree(buf); /* free the memory allocated for undo */ u_clearall(buf); /* reset all undo information */ } #ifdef FEAT_SYN_HL syntax_clear(&buf->b_s); /* reset syntax info */ #endif buf->b_flags &= ~BF_READERR; /* a read error is no longer relevant */ } /* * 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_T *buf) { free_buffer_stuff(buf, TRUE); #ifdef FEAT_EVAL unref_var_dict(buf->b_vars); #endif #ifdef FEAT_LUA lua_buffer_free(buf); #endif #ifdef FEAT_MZSCHEME mzscheme_buffer_free(buf); #endif #ifdef FEAT_PERL perl_buf_free(buf); #endif #ifdef FEAT_PYTHON python_buffer_free(buf); #endif #ifdef FEAT_PYTHON3 python3_buffer_free(buf); #endif #ifdef FEAT_RUBY ruby_buffer_free(buf); #endif #ifdef FEAT_AUTOCMD aubuflocal_remove(buf); if (autocmd_busy) { /* Do not free the buffer structure while autocommands are executing, * it's still needed. Free it when autocmd_busy is reset. */ buf->b_next = au_pending_free_buf; au_pending_free_buf = buf; } else #endif vim_free(buf); } /* * Free stuff in the buffer for ":bdel" and when wiping out the buffer. */ static void free_buffer_stuff( 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_SPELL ga_clear(&buf->b_s.b_langp); #endif } #ifdef FEAT_EVAL vars_clear(&buf->b_vars->dv_hashtab); /* free all internal variables */ hash_init(&buf->b_vars->dv_hashtab); #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_NETBEANS_INTG netbeans_file_killed(buf); #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_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( exarg_T *eap, int start, int dir, int count) { # if defined(FEAT_WINDOWS) && defined(HAS_SWAP_EXISTS_ACTION) 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(HAS_SWAP_EXISTS_ACTION) if (swap_exists_action == SEA_QUIT && *eap->cmd == 's') { # if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL) cleanup_T cs; /* Reset the error/interrupt/exception state here so that * aborting() returns FALSE when closing a window. */ enter_cleanup(&cs); # endif /* Quitting means closing the split window, nothing else. */ win_close(curwin, TRUE); swap_exists_action = SEA_NONE; swap_exists_did_quit = TRUE; # if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL) /* Restore the error/interrupt/exception state if not discarded by a * new aborting error, interrupt, or uncaught exception. */ leave_cleanup(&cs); # endif } else handle_swap_exists(old_curbuf); # endif } #endif #if defined(HAS_SWAP_EXISTS_ACTION) || 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(buf_T *old_curbuf) { # if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL) cleanup_T cs; # endif #ifdef FEAT_SYN_HL long old_tw = curbuf->b_p_tw; #endif if (swap_exists_action == SEA_QUIT) { # if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL) /* Reset the error/interrupt/exception state here so that * aborting() returns FALSE when closing a buffer. */ enter_cleanup(&cs); # endif /* 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 */ swap_exists_did_quit = TRUE; close_buffer(curwin, curbuf, DOBUF_UNLOAD, FALSE); if (!buf_valid(old_curbuf) || old_curbuf == curbuf) old_curbuf = buflist_new(NULL, NULL, 1L, BLN_CURBUF | BLN_LISTED); if (old_curbuf != NULL) { enter_buffer(old_curbuf); #ifdef FEAT_SYN_HL if (old_tw != curbuf->b_p_tw) check_colorcolumn(curwin); #endif } /* If "old_curbuf" is NULL we are in big trouble here... */ # if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL) /* Restore the error/interrupt/exception state if not discarded by a * new aborting error, interrupt, or uncaught exception. */ leave_cleanup(&cs); # endif } else if (swap_exists_action == SEA_RECOVER) { # if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL) /* Reset the error/interrupt/exception state here so that * aborting() returns FALSE when closing a buffer. */ enter_cleanup(&cs); # endif /* 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(0); # if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL) /* Restore the error/interrupt/exception state if not discarded by a * new aborting error, interrupt, or uncaught exception. */ leave_cleanup(&cs); # endif } 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( 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; 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, 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) STRCPY(IObuff, _("E515: No buffers were unloaded")); else if (command == DOBUF_DEL) STRCPY(IObuff, _("E516: No buffers were deleted")); else STRCPY(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); } } } return errormsg; } #endif /* FEAT_LISTCMDS */ #if defined(FEAT_LISTCMDS) || defined(FEAT_PYTHON) \ || defined(FEAT_PYTHON3) || defined(PROTO) static int empty_curbuf(int close_others, int forceit, int action); /* * Make the current buffer empty. * Used when it is wiped out and it's the last buffer. */ static int empty_curbuf( int close_others, int forceit, int action) { int retval; buf_T *buf = curbuf; if (action == DOBUF_UNLOAD) { EMSG(_("E90: Cannot unload last buffer")); return FAIL; } if (close_others) { /* Close any other windows on this buffer, then make it empty. */ #ifdef FEAT_WINDOWS close_windows(buf, TRUE); #endif } setpcmark(); retval = do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, forceit ? ECMD_FORCEIT : 0, curwin); /* * 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, FALSE); if (!close_others) need_fileinfo = FALSE; return retval; } /* * 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( 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(_(e_nobufnr), 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; /* 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 it's still changed fail silently, the dialog already * mentioned why it fails. */ if (bufIsChanged(buf)) return FAIL; } else #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) return empty_curbuf(TRUE, forceit, action); #ifdef FEAT_WINDOWS /* * If the deleted buffer is the current one, close the current window * (unless it's the only window). Repeat this so long as we end up in * a window with this buffer. */ while (buf == curbuf # ifdef FEAT_AUTOCMD && !(curwin->w_closing || curwin->w_buffer->b_closing) # endif && (firstwin != lastwin || first_tabpage->tp_next != NULL)) { if (win_close(curwin, FALSE) == FAIL) break; } #endif /* * If the buffer to be deleted is not the current one, delete it here. */ if (buf != curbuf) { #ifdef FEAT_WINDOWS close_windows(buf, FALSE); #endif if (buf != curbuf && buf_valid(buf) && buf->b_nwindows <= 0) close_buffer(NULL, buf, action, FALSE); return OK; } /* * Deleting the current buffer: Need to find another buffer to go to. * There should be another, otherwise it would have been handled * above. However, autocommands may have deleted all buffers. * 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; } } if (buf == NULL) { /* Autocommands must have wiped out all other buffers. Only option * now is to make the current buffer empty. */ return empty_curbuf(FALSE, forceit, action); } /* * make buf current buffer */ if (action == DOBUF_SPLIT) /* split window first */ { # ifdef FEAT_WINDOWS /* If 'switchbuf' contains "useopen": jump to first window containing * "buf" if one exists */ if ((swb_flags & SWB_USEOPEN) && buf_jump_open_win(buf)) return OK; /* If 'switchbuf' contains "usetab": jump to first window in any tab * page containing "buf" if one exists */ if ((swb_flags & SWB_USETAB) && buf_jump_open_tab(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) || defined(FEAT_CURSORBIND)) if (action == DOBUF_SPLIT) { RESET_BINDING(curwin); /* reset 'scrollbind' and 'cursorbind' */ } #endif #if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL) if (aborting()) /* autocmds may abort script processing */ return FAIL; #endif return OK; } #endif /* * 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_T *buf, int action) { buf_T *prevbuf; int unload = (action == DOBUF_UNLOAD || action == DOBUF_DEL || action == DOBUF_WIPE); #ifdef FEAT_SYN_HL long old_tw = curbuf->b_p_tw; #endif setpcmark(); if (!cmdmod.keepalt) curwin->w_alt_fnum = curbuf->b_fnum; /* remember alternate file */ buflist_altfpos(curwin); /* remember curpos */ /* Don't restart Select mode after switching to another buffer. */ VIsual_reselect = FALSE; /* 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_SYN_HL if (prevbuf == curwin->w_buffer) reset_synblock(curwin); #endif #ifdef FEAT_WINDOWS if (unload) close_windows(prevbuf, FALSE); #endif #if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL) if (buf_valid(prevbuf) && !aborting()) #else if (buf_valid(prevbuf)) #endif { #ifdef FEAT_WINDOWS win_T *previouswin = curwin; #endif if (prevbuf == curbuf) u_sync(FALSE); close_buffer(prevbuf == curwin->w_buffer ? curwin : NULL, prevbuf, unload ? action : (action == DOBUF_GOTO && !P_HID(prevbuf) && !bufIsChanged(prevbuf)) ? DOBUF_UNLOAD : 0, FALSE); #ifdef FEAT_WINDOWS if (curwin != previouswin && win_valid(previouswin)) /* autocommands changed curwin, Grr! */ curwin = previouswin; #endif } } #ifdef FEAT_AUTOCMD /* An autocommand may have deleted "buf", already entered it (e.g., when * it did ":bunload") or aborted the script processing! * If curwin->w_buffer is null, enter_buffer() will make it valid again */ if ((buf_valid(buf) && buf != curbuf # ifdef FEAT_EVAL && !aborting() # endif # ifdef FEAT_WINDOWS ) || curwin->w_buffer == NULL # endif ) #endif { enter_buffer(buf); #ifdef FEAT_SYN_HL if (old_tw != curbuf->b_p_tw) check_colorcolumn(curwin); #endif } } /* * Enter a new current buffer. * Old curbuf must have been abandoned already! This also means "curbuf" may * be pointing to freed memory. */ void enter_buffer(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 if (curwin->w_p_diff) diff_buf_add(curbuf); #endif #ifdef FEAT_SYN_HL curwin->w_s = &(buf->b_s); #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; #ifdef FEAT_AUTOCMD curwin->w_topline_was_set = FALSE; #endif /* mark cursor position as being invalid */ curwin->w_valid = 0; /* Make sure the buffer is loaded. */ if (curbuf->b_ml.ml_mfp == NULL) /* need to load the file */ { #ifdef FEAT_AUTOCMD /* If there is no filetype, allow for detecting one. Esp. useful for * ":ball" used in a autocommand. If there already is a filetype we * might prefer to keep it. */ if (*curbuf->b_p_ft == NUL) did_filetype = FALSE; #endif open_buffer(FALSE, NULL, 0); } else { if (!msg_silent) 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 /* when autocmds didn't change it */ if (curwin->w_topline == 1 && !curwin->w_topline_was_set) #endif scroll_cursor_halfway(FALSE); /* redisplay at correct position */ #ifdef FEAT_NETBEANS_INTG /* Send fileOpened event because we've changed buffers. */ netbeans_file_activated(curbuf); #endif /* Change directories when the 'acd' option is set. */ DO_AUTOCHDIR #ifdef FEAT_KEYMAP if (curbuf->b_kmap_state & KEYMAP_INIT) (void)keymap_init(); #endif #ifdef FEAT_SPELL /* May need to set the spell language. Can only do this after the buffer * has been properly setup. */ if (!curbuf->b_help && curwin->w_p_spell && *curwin->w_s->b_p_spl != NUL) (void)did_set_spelllang(curwin); #endif redraw_later(NOT_VALID); } #if defined(FEAT_AUTOCHDIR) || defined(PROTO) /* * Change to the directory of the current buffer. * Don't do this while still starting up. */ void do_autochdir(void) { if (starting == 0 && curbuf->b_ffname != NULL && vim_chdirfile(curbuf->b_ffname) == OK) shorten_fnames(TRUE); } #endif /* * 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. * This is the ONLY way to create a new buffer. */ static int top_file_num = 1; /* highest file number */ buf_T * buflist_new( 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); if (!buf_valid(buf)) return NULL; } #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! * (A spell file buffer is allocated in spell.c, but that's not a normal * buffer.) */ 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 if (aborting()) /* autocmds may abort script processing */ 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; } #ifdef FEAT_EVAL /* init b: variables */ buf->b_vars = dict_alloc(); if (buf->b_vars == NULL) { vim_free(ffname); vim_free(buf); return NULL; } init_var_dict(buf->b_vars, &buf->b_bufvar, VAR_SCOPE); #endif } 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, 0); if (buf != curbuf) /* autocommands deleted the buffer! */ return NULL; #if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL) if (aborting()) /* autocmds may abort script processing */ return NULL; #endif free_buffer_stuff(buf, FALSE); /* delete local variables et al. */ /* Init the options. */ buf->b_p_initialized = FALSE; buf_copy_options(buf, BCO_ENTER); #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_SYN_HL hash_init(&buf->b_s.b_keywtab); hash_init(&buf->b_s.b_keywtab_ic); #endif buf->b_fname = buf->b_sfname; #ifdef UNIX if (st.st_dev == (dev_T)-1) buf->b_dev_valid = FALSE; else { buf->b_dev_valid = TRUE; 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; if (flags & BLN_DUMMY) buf->b_flags |= BF_DUMMY; 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)) { /* Tricky: these autocommands may change the buffer list. They could * also split the window with re-using the one empty buffer. This may * result in unexpectedly losing the empty buffer. */ apply_autocmds(EVENT_BUFNEW, NULL, NULL, FALSE, buf); if (!buf_valid(buf)) return NULL; if (flags & BLN_LISTED) { apply_autocmds(EVENT_BUFADD, NULL, NULL, FALSE, buf); if (!buf_valid(buf)) return NULL; } # ifdef FEAT_EVAL if (aborting()) /* autocmds may abort script processing */ 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_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 #if defined(FEAT_BEVAL) && defined(FEAT_EVAL) clear_string_option(&buf->b_p_bexpr); #endif #if defined(FEAT_CRYPT) clear_string_option(&buf->b_p_cm); #endif #if defined(FEAT_EVAL) clear_string_option(&buf->b_p_fex); #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_flp); 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); clear_string_option(&buf->b_s.b_syn_isk); #endif #ifdef FEAT_SPELL clear_string_option(&buf->b_s.b_p_spc); clear_string_option(&buf->b_s.b_p_spf); vim_regfree(buf->b_s.b_cap_prog); buf->b_s.b_cap_prog = NULL; clear_string_option(&buf->b_s.b_p_spl); #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_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_COMPL_FUNC clear_string_option(&buf->b_p_cfu); clear_string_option(&buf->b_p_ofu); #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); clear_string_option(&buf->b_p_tc); #ifdef FEAT_INS_EXPAND clear_string_option(&buf->b_p_dict); clear_string_option(&buf->b_p_tsr); #endif #ifdef FEAT_TEXTOBJ clear_string_option(&buf->b_p_qe); #endif buf->b_p_ar = -1; buf->b_p_ul = NO_LOCAL_UNDOLEVEL; #ifdef FEAT_LISP clear_string_option(&buf->b_p_lw); #endif clear_string_option(&buf->b_p_bkc); } /* * 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( 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; if (text_locked()) { text_locked_msg(); return FAIL; } #ifdef FEAT_AUTOCMD if (curbuf_locked()) 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) { /* If 'switchbuf' contains "useopen": jump to first window containing * "buf" if one exists */ if (swb_flags & SWB_USEOPEN) wp = buf_jump_open_win(buf); /* If 'switchbuf' contains "usetab": jump to first window in any tab * page containing "buf" if one exists */ if (wp == NULL && (swb_flags & SWB_USETAB)) wp = buf_jump_open_tab(buf); /* If 'switchbuf' contains "split", "vsplit" or "newtab" and the * current buffer isn't empty: open new tab or window */ if (wp == NULL && (swb_flags & (SWB_VSPLIT | SWB_SPLIT | SWB_NEWTAB)) && !bufempty()) { if (swb_flags & SWB_NEWTAB) tabpage_new(); else if (win_split(0, (swb_flags & SWB_VSPLIT) ? WSP_VERT : 0) == FAIL) return FAIL; RESET_BINDING(curwin); } } #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(void) { 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; } } #if defined(FEAT_QUICKFIX) || defined(FEAT_EVAL) || defined(PROTO) /* * Find file in buffer list by name (it has to be for the current window). * Returns NULL if not found. */ buf_T * buflist_findname_exp(char_u *fname) { char_u *ffname; buf_T *buf = NULL; /* First make the name into a full path name */ ffname = FullName_save(fname, #ifdef UNIX TRUE /* force expansion, get rid of symbolic links */ #else FALSE #endif ); if (ffname != NULL) { buf = buflist_findname(ffname); vim_free(ffname); } return buf; } #endif /* * Find file in buffer list by name (it has to be for the current window). * "ffname" must have a full path. * Skips dummy buffers. * Returns NULL if not found. */ buf_T * buflist_findname(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. * Returns NULL if not found. */ static buf_T * buflist_findname_stat( char_u *ffname, struct stat *stp) { #endif buf_T *buf; for (buf = firstbuf; buf != NULL; buf = buf->b_next) if ((buf->b_flags & BF_DUMMY) == 0 && !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. */ int buflist_findpat( char_u *pattern, char_u *pattern_end, /* pointer to first char after pattern */ int unlisted, /* find unlisted buffers */ int diffmode UNUSED, /* find diff-mode buffers only */ int curtab_only) /* find buffers in current tab only */ { buf_T *buf; 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 position 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) { regmatch_T regmatch; /* may add '^' and '$' */ if (toggledollar) *patend = (attempt < 2) ? NUL : '$'; /* add/remove '$' */ p = pat; if (*p == '^' && !(attempt & 1)) /* add/remove '^' */ ++p; regmatch.regprog = vim_regcomp(p, p_magic ? RE_MAGIC : 0); if (regmatch.regprog == 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(®match, buf, FALSE) != NULL) { if (curtab_only) { /* Ignore the match if the buffer is not open in * the current tab. */ #ifdef FEAT_WINDOWS win_T *wp; for (wp = firstwin; wp != NULL; wp = wp->w_next) if (wp->w_buffer == buf) break; if (wp == NULL) continue; #else if (curwin->w_buffer != buf) continue; #endif } if (match >= 0) /* already found a match */ { match = -2; break; } match = buf->b_fnum; /* remember first match */ } vim_regfree(regmatch.regprog); 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( char_u *pat, int *num_file, char_u ***file, int options) { int count = 0; buf_T *buf; int round; char_u *p; int attempt; char_u *patc; *num_file = 0; /* return values in case of FAIL */ *file = NULL; /* Make a copy of "pat" and change "^" to "\(^\|[\/]\)". */ if (*pat == '^') { patc = alloc((unsigned)STRLEN(pat) + 11); if (patc == NULL) return FAIL; STRCPY(patc, "\\(^\\|[\\/]\\)"); STRCPY(patc + 11, pat + 1); } else patc = pat; /* * attempt == 0: try match with '\<', match at start of word * attempt == 1: try match without '\<', match anywhere */ for (attempt = 0; attempt <= 1; ++attempt) { regmatch_T regmatch; if (attempt > 0 && patc == pat) break; /* there was no anchor, no need to try again */ regmatch.regprog = vim_regcomp(patc + attempt * 11, RE_MAGIC); if (regmatch.regprog == NULL) { if (patc != pat) vim_free(patc); 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(®match, buf, p_wic); 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_regfree(regmatch.regprog); if (patc != pat) vim_free(patc); return FAIL; } } } vim_regfree(regmatch.regprog); if (count) /* match(es) found, break here */ break; } if (patc != pat) vim_free(patc); *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( regmatch_T *rmp, buf_T *buf, int ignore_case) /* when TRUE ignore case, when FALSE use 'fic' */ { char_u *match; /* First try the short file name, then the long file name. */ match = fname_match(rmp, buf->b_sfname, ignore_case); if (match == NULL) match = fname_match(rmp, buf->b_ffname, ignore_case); 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( regmatch_T *rmp, char_u *name, int ignore_case) /* when TRUE ignore case, when FALSE use 'fic' */ { char_u *match = NULL; char_u *p; if (name != NULL) { /* Ignore case when 'fileignorecase' or the argument is set. */ rmp->rm_ic = p_fic || ignore_case; if (vim_regexec(rmp, 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(rmp, p, (colnr_T)0)) match = name; vim_free(p); } } return match; } #endif /* * find file in buffer list by number */ buf_T * buflist_findnr(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( 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_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; } #ifdef FEAT_DIFF static int wininfo_other_tab_diff(wininfo_T *wip); /* * Return TRUE when "wip" has 'diff' set and the diff is only for another tab * page. That's because a diff is local to a tab page. */ static int wininfo_other_tab_diff(wininfo_T *wip) { win_T *wp; if (wip->wi_opt.wo_diff) { for (wp = firstwin; wp != NULL; wp = wp->w_next) /* return FALSE when it's a window in the current tab page, thus * the buffer was in diff mode here */ if (wip->wi_win == wp) return FALSE; return TRUE; } return FALSE; } #endif /* * Find info for the current window in buffer "buf". * If not found, return the info for the most recently used window. * When "skip_diff_buffer" is TRUE avoid windows with 'diff' set that is in * another tab page. * Returns NULL when there isn't any info. */ static wininfo_T * find_wininfo( buf_T *buf, int skip_diff_buffer UNUSED) { wininfo_T *wip; for (wip = buf->b_wininfo; wip != NULL; wip = wip->wi_next) if (wip->wi_win == curwin #ifdef FEAT_DIFF && (!skip_diff_buffer || !wininfo_other_tab_diff(wip)) #endif ) break; /* If no wininfo for curwin, use the first in the list (that doesn't have * 'diff' set and is in another tab page). */ if (wip == NULL) { #ifdef FEAT_DIFF if (skip_diff_buffer) { for (wip = buf->b_wininfo; wip != NULL; wip = wip->wi_next) if (!wininfo_other_tab_diff(wip)) break; } else #endif 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_T *buf) { wininfo_T *wip; clear_winopt(&curwin->w_onebuf_opt); #ifdef FEAT_FOLDING clearFolding(curwin); #endif wip = find_wininfo(buf, TRUE); 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 #ifdef FEAT_SYN_HL check_colorcolumn(curwin); #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_T *buf) { wininfo_T *wip; static pos_T no_position = INIT_POS_T(1, 0, 0); wip = find_wininfo(buf, FALSE); 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_T *buf) { return buflist_findfpos(buf)->lnum; } #if defined(FEAT_LISTCMDS) || defined(PROTO) /* * List all know file names (for :files and :buffers command). */ void buflist_list(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 && !vim_strchr(eap->arg, 'u')) || (vim_strchr(eap->arg, 'u') && buf->b_p_bl) || (vim_strchr(eap->arg, '+') && ((buf->b_flags & BF_READERR) || !bufIsChanged(buf))) || (vim_strchr(eap->arg, 'a') && (buf->b_ml.ml_mfp == NULL || buf->b_nwindows == 0)) || (vim_strchr(eap->arg, 'h') && (buf->b_ml.ml_mfp == NULL || buf->b_nwindows != 0)) || (vim_strchr(eap->arg, '-') && buf->b_p_ma) || (vim_strchr(eap->arg, '=') && !buf->b_p_ro) || (vim_strchr(eap->arg, 'x') && !(buf->b_flags & BF_READERR)) || (vim_strchr(eap->arg, '%') && buf != curbuf) || (vim_strchr(eap->arg, '#') && (buf == curbuf || curwin->w_alt_fnum != buf->b_fnum))) continue; msg_putchar('\n'); if (buf_spname(buf) != NULL) vim_strncpy(NameBuff, buf_spname(buf), MAXPATHL - 1); else home_replace(buf, buf->b_fname, NameBuff, MAXPATHL, TRUE); len = vim_snprintf((char *)IObuff, IOSIZE - 20, "%3d%c%c%c%c%c \"%s\"", 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) ? '+' : ' '), NameBuff); if (len > IOSIZE - 20) len = IOSIZE - 20; /* put "line 999" in column 40 or after the file name */ i = 40 - vim_strsize(IObuff); do { IObuff[len++] = ' '; } while (--i > 0 && len < IOSIZE - 18); vim_snprintf((char *)IObuff + len, (size_t)(IOSIZE - 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( 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_T *buf, char_u *ffname, char_u *sfname, int message) /* give message when buffer already exists */ { buf_T *obuf = NULL; #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; #endif if (!(buf->b_flags & BF_DUMMY)) #ifdef UNIX 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; } /* delete from the list */ close_buffer(NULL, obuf, DOBUF_WIPE, FALSE); } 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_valid = FALSE; else { buf->b_dev_valid = TRUE; buf->b_dev = st.st_dev; buf->b_ino = st.st_ino; } #endif buf->b_shortname = FALSE; buf_name_changed(buf); return OK; } /* * Crude way of changing the name of a buffer. Use with care! * The name should be relative to the current directory. */ void buf_set_name(int fnum, char_u *name) { buf_T *buf; buf = buflist_findnr(fnum); if (buf != NULL) { vim_free(buf->b_sfname); vim_free(buf->b_ffname); buf->b_ffname = vim_strsave(name); buf->b_sfname = NULL; /* Allocate ffname and expand into full path. Also resolves .lnk * files on Win32. */ fname_expand(buf, &buf->b_ffname, &buf->b_sfname); buf->b_fname = buf->b_sfname; } } /* * Take care of what needs to be done when the name of buffer "buf" has * changed. */ void buf_name_changed(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( 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 && !cmdmod.keepalt) 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( 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(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(void) { 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 the current buffer and window "win". * Also save the local window option values. */ void buflist_altfpos(win_T *win) { buflist_setfpos(curbuf, win, win->w_cursor.lnum, win->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(char_u *ffname) { return otherfile_buf(curbuf, ffname #ifdef UNIX , NULL #endif ); } static int otherfile_buf( 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_valid || 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_T *buf) { struct stat st; if (buf->b_fname != NULL && mch_stat((char *)buf->b_fname, &st) >= 0) { buf->b_dev_valid = TRUE; buf->b_dev = st.st_dev; buf->b_ino = st.st_ino; } else buf->b_dev_valid = FALSE; } /* * Return TRUE if dev/ino in buffer "buf" matches with "stp". */ static int buf_same_ino( buf_T *buf, struct stat *stp) { return (buf->b_dev_valid && stp->st_dev == buf->b_dev && stp->st_ino == buf->b_ino); } #endif /* * Print info about the current buffer. */ void fileinfo( int fullname, /* when non-zero print full path */ int shorthelp, int dont_truncate) { char_u *name; int n; char_u *p; char_u *buffer; size_t len; buffer = alloc(IOSIZE); if (buffer == NULL) return; if (fullname > 1) /* 2 CTRL-G: include buffer number */ { vim_snprintf((char *)buffer, IOSIZE, "buf %d: ", curbuf->b_fnum); p = buffer + STRLEN(buffer); } else p = buffer; *p++ = '"'; if (buf_spname(curbuf) != NULL) vim_strncpy(p, buf_spname(curbuf), IOSIZE - (p - buffer) - 1); 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); } vim_snprintf_add((char *)buffer, IOSIZE, "\"%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) { vim_snprintf_add((char *)buffer, IOSIZE, "%s", _(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) vim_snprintf_add((char *)buffer, IOSIZE, _("1 line --%d%%--"), n); else vim_snprintf_add((char *)buffer, IOSIZE, _("%ld lines --%d%%--"), (long)curbuf->b_ml.ml_line_count, n); } #endif else { vim_snprintf_add((char *)buffer, IOSIZE, _("line %ld of %ld --%d%%-- col "), (long)curwin->w_cursor.lnum, (long)curbuf->b_ml.ml_line_count, n); validate_virtcol(); len = STRLEN(buffer); col_print(buffer + len, IOSIZE - len, (int)curwin->w_cursor.col + 1, (int)curwin->w_virtcol + 1); } (void)append_arg_number(curwin, buffer, IOSIZE, !shortmess(SHM_FILE)); 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, 0); } vim_free(buffer); } void col_print( char_u *buf, size_t buflen, int col, int vcol) { if (col == vcol) vim_snprintf((char *)buf, buflen, "%d", col); else vim_snprintf((char *)buf, buflen, "%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(void) { 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 && lasttitle == NULL && lasticon == NULL) 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) { int use_sandbox = FALSE; int save_called_emsg = called_emsg; # ifdef FEAT_EVAL use_sandbox = was_set_insecurely((char_u *)"titlestring", 0); # endif called_emsg = FALSE; build_stl_str_hl(curwin, t_str, sizeof(buf), p_titlestring, use_sandbox, 0, maxlen, NULL, NULL); if (called_emsg) set_string_option_direct((char_u *)"titlestring", -1, (char_u *)"", OPT_FREE, SID_ERROR); called_emsg |= save_called_emsg; } else #endif t_str = p_titlestring; } else { /* format: "fname + (path) (1 of 2) - VIM" */ #define SPACE_FOR_FNAME (IOSIZE - 100) #define SPACE_FOR_DIR (IOSIZE - 20) #define SPACE_FOR_ARGNR (IOSIZE - 10) /* at least room for " - VIM" */ if (curbuf->b_fname == NULL) vim_strncpy(buf, (char_u *)_("[No Name]"), SPACE_FOR_FNAME); else { p = transstr(gettail(curbuf->b_fname)); vim_strncpy(buf, p, SPACE_FOR_FNAME); vim_free(p); } 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, SPACE_FOR_DIR - 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_sep(buf + off); if (p == buf + off) /* must be a help buffer */ vim_strncpy(buf + off, (char_u *)_("help"), (size_t)(SPACE_FOR_DIR - off - 1)); else *p = NUL; /* Translate unprintable chars and concatenate. Keep some * room for the server name. When there is no room (very long * file name) use (...). */ if (off < SPACE_FOR_DIR) { p = transstr(buf + off); vim_strncpy(buf + off, p, (size_t)(SPACE_FOR_DIR - off)); vim_free(p); } else { vim_strncpy(buf + off, (char_u *)"...", (size_t)(SPACE_FOR_ARGNR - off)); } STRCAT(buf, ")"); } append_arg_number(curwin, buf, SPACE_FOR_ARGNR, FALSE); #if defined(FEAT_CLIENTSERVER) if (serverName != NULL) { STRCAT(buf, " - "); vim_strcat(buf, serverName, IOSIZE); } else #endif STRCAT(buf, " - VIM"); if (maxlen > 0) { /* make it shorter by removing a bit in the middle */ if (vim_strsize(buf) > maxlen) trunc_string(buf, buf, maxlen, IOSIZE); } } } 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) { int use_sandbox = FALSE; int save_called_emsg = called_emsg; # ifdef FEAT_EVAL use_sandbox = was_set_insecurely((char_u *)"iconstring", 0); # endif called_emsg = FALSE; build_stl_str_hl(curwin, i_str, sizeof(buf), p_iconstring, use_sandbox, 0, 0, NULL, NULL); if (called_emsg) set_string_option_direct((char_u *)"iconstring", -1, (char_u *)"", OPT_FREE, SID_ERROR); called_emsg |= save_called_emsg; } else #endif i_str = p_iconstring; } else { if (buf_spname(curbuf) != NULL) i_name = 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 = (int)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(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(void) { mch_settitle(lasttitle, lasticon); } # if defined(EXITFREE) || defined(PROTO) void free_titles(void) { vim_free(lasttitle); vim_free(lasticon); } # endif #endif /* FEAT_TITLE */ #if defined(FEAT_STL_OPT) || defined(FEAT_GUI_TABLINE) || defined(PROTO) /* * Build a string from the status line items in "fmt". * Return length of string in screen cells. * * Normally works for window "wp", except when working for 'tabline' then it * is "curwin". * * Items are drawn interspersed with the text that surrounds it * Specials: %-(xxx%) => group, %= => middle marker, %< => truncation * Item: %-. All but 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( win_T *wp, char_u *out, /* buffer to write into != NameBuff */ size_t outlen, /* length of out[] */ char_u *fmt, int use_sandbox UNUSED, /* "fmt" was set insecurely, use sandbox */ int fillchar, int maxwidth, struct stl_hlrec *hltab, /* return: HL attributes (can be NULL) */ struct stl_hlrec *tabtab) /* return: tab page nrs (can be NULL) */ { char_u *p; char_u *s; char_u *t; int byteval; #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, TabPage, 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]; char_u *usefmt = fmt; struct stl_hlrec *sp; #ifdef FEAT_EVAL /* * When the format starts with "%!" then evaluate it as an expression and * use the result as the actual format string. */ if (fmt[0] == '%' && fmt[1] == '!') { usefmt = eval_to_string_safe(fmt + 2, NULL, use_sandbox); if (usefmt == NULL) usefmt = fmt; } #endif if (fillchar == 0) fillchar = ' '; #ifdef FEAT_MBYTE /* Can't handle a multi-byte fill character yet. */ else if (mb_char2len(fillchar) > 1) fillchar = '-'; #endif /* Get line & check if empty (cursorpos will show "0-1"). Note that * p will become invalid when getting another buffer line. */ p = ml_get_buf(wp->w_buffer, wp->w_cursor.lnum, FALSE); empty_line = (*p == NUL); /* Get the byte value now, in case we need it below. This is more * efficient than making a copy of the line. */ if (wp->w_cursor.col > (colnr_T)STRLEN(p)) byteval = 0; else #ifdef FEAT_MBYTE byteval = (*mb_ptr2char)(p + wp->w_cursor.col); #else byteval = p[wp->w_cursor.col]; #endif groupdepth = 0; p = out; curitem = 0; prevchar_isflag = TRUE; prevchar_isitem = FALSE; for (s = usefmt; *s; ) { if (curitem == STL_MAX_ITEM) { /* There are too many items. Add the error code to the statusline * to give the user a hint about what went wrong. */ if (p + 6 < out + outlen) { mch_memmove(p, " E541", (size_t)5); p += 5; } break; } 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 == NUL) /* ignore trailing % */ break; 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 || item[n].type == Highlight) 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)(t + n); } } else #endif n = (long)(p - t) - item[groupitem[groupdepth]].maxwid + 1; *t = '<'; mch_memmove(t + 1, t + n, (size_t)(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, (size_t)(p - t)); l = n - l; if (p + l >= out + outlen) l = (long)((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_USER_HL) { item[curitem].type = Highlight; item[curitem].start = p; item[curitem].minwid = minwid > 9 ? 1 : minwid; s++; curitem++; continue; } if (*s == STL_TABPAGENR || *s == STL_TABCLOSENR) { if (*s == STL_TABCLOSENR) { if (minwid == 0) { /* %X ends the close label, go back to the previously * define tab label nr. */ for (n = curitem - 1; n >= 0; --n) if (item[n].type == TabPage && item[n].minwid >= 0) { minwid = item[n].minwid; break; } } else /* close nrs are stored as negative values */ minwid = - minwid; } item[curitem].type = TabPage; item[curitem].start = p; item[curitem].minwid = 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) vim_strncpy(NameBuff, buf_spname(wp->w_buffer), MAXPATHL - 1); 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 vim_snprintf((char *)tmp, sizeof(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, use_sandbox); curwin = o_curwin; curbuf = o_curbuf; do_unlet((char_u *)"g:actual_curbuf", TRUE); 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, TMPLEN); break; case STL_ARGLISTSTAT: fillable = FALSE; tmp[0] = 0; if (append_arg_number(wp, tmp, (int)sizeof(tmp), FALSE)) str = tmp; break; case STL_KEYMAP: fillable = FALSE; if (get_keymap_str(wp, tmp, TMPLEN)) str = tmp; break; case STL_PAGENUM: #if defined(FEAT_PRINTER) || defined(FEAT_GUI_TABLINE) num = 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: num = byteval; 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) { vim_snprintf((char *)tmp, sizeof(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) { vim_snprintf((char *)tmp, sizeof(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; case STL_QUICKFIX: if (bt_quickfix(wp->w_buffer)) str = (char_u *)(wp->w_llist_ref ? _(msg_loclist) : _(msg_qflist)); 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; case STL_HIGHLIGHT: t = s; while (*s != '#' && *s != NUL) ++s; if (*s == '#') { item[curitem].type = Highlight; item[curitem].start = p; item[curitem].minwid = -syn_namen2id(t, (int)(s - t)); curitem++; } if (*s != NUL) ++s; continue; } 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)(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 : (char_u)(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; vim_snprintf((char *)p, outlen - (p - out), (char *)nstr, 0, num, n); } else vim_snprintf((char *)p, outlen - (p - out), (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; #ifdef FEAT_EVAL if (usefmt != fmt) vim_free(usefmt); #endif width = vim_strsize(out); if (maxwidth > 0 && width > maxwidth) { /* Result is too long, must truncate 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)(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)(s + n); } } else #endif n = width - maxwidth + 1; p = s + n; STRMOVE(s + 1, p); *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; STRMOVE(p, item[l].start); for (s = item[l].start; s < p; s++) *s = fillchar; for (l++; l < itemcnt; l++) item[l].start += maxwidth - width; width = maxwidth; } } /* Store the info about highlighting. */ if (hltab != NULL) { sp = hltab; for (l = 0; l < itemcnt; l++) { if (item[l].type == Highlight) { sp->start = item[l].start; sp->userhl = item[l].minwid; sp++; } } sp->start = NULL; sp->userhl = 0; } /* Store the info about tab pages labels. */ if (tabtab != NULL) { sp = tabtab; for (l = 0; l < itemcnt; l++) { if (item[l].type == TabPage) { sp->start = item[l].start; sp->userhl = item[l].minwid; sp++; } } sp->start = NULL; sp->userhl = 0; } return width; } #endif /* FEAT_STL_OPT */ #if defined(FEAT_STL_OPT) || defined(FEAT_CMDL_INFO) \ || defined(FEAT_GUI_TABLINE) || defined(PROTO) /* * Get relative cursor position in window into "buf[buflen]", in the form 99%, * using "Top", "Bot" or "All" when appropriate. */ void get_rel_pos( win_T *wp, char_u *buf, int buflen) { long above; /* number of lines above window */ long below; /* number of lines below window */ if (buflen < 3) /* need at least 3 chars for writing */ return; above = wp->w_topline - 1; #ifdef FEAT_DIFF above += diff_check_fill(wp, wp->w_topline) - wp->w_topfill; if (wp->w_topline == 1 && wp->w_topfill >= 1) above = 0; /* All buffer lines are displayed and there is an * indication of filler lines, that can be considered * seeing all lines. */ #endif below = wp->w_buffer->b_ml.ml_line_count - wp->w_botline + 1; if (below <= 0) vim_strncpy(buf, (char_u *)(above == 0 ? _("All") : _("Bot")), (size_t)(buflen - 1)); else if (above <= 0) vim_strncpy(buf, (char_u *)_("Top"), (size_t)(buflen - 1)); else vim_snprintf((char *)buf, (size_t)buflen, "%2d%%", above > 1000000L ? (int)(above / ((above + below) / 100L)) : (int)(above * 100L / (above + below))); } #endif /* * Append (file 2 of 8) to "buf[buflen]", if editing more than one file. * Return TRUE if it was appended. */ static int append_arg_number( win_T *wp, char_u *buf, int buflen, int add_file) /* Add "file" before the arg number */ { char_u *p; if (ARGCOUNT <= 1) /* nothing to do */ return FALSE; p = buf + STRLEN(buf); /* go to the end of the buffer */ if (p - buf + 35 >= buflen) /* getting too long */ return FALSE; *p++ = ' '; *p++ = '('; if (add_file) { STRCPY(p, "file "); p += 5; } vim_snprintf((char *)p, (size_t)(buflen - (p - buf)), 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(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". * Similarly "c:/src//file" is equal to "c:/src/file". * 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 || strstr((char *)fname, "//") != NULL # ifdef BACKSLASH_IN_FILENAME || strstr((char *)fname, "\\\\") != NULL # endif # if defined(MSWIN) || 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). */ void fname_expand( buf_T *buf UNUSED, 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; /* If the file name is a shortcut file, use the file it links to. */ rfname = mch_resolve_shortcut(*ffname); if (rfname != NULL) { vim_free(*ffname); *ffname = rfname; *sfname = rfname; } } #endif } /* * Get the file name for an argument list entry. */ char_u * alist_name(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 || bp->b_fname == 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( int count, int forceit, /* hide buffers in current windows */ int keep_tabs) /* keep current tabs, for ":tab drop file" */ { int i; win_T *wp, *wpnext; char_u *opened; /* Array of weight for which args are open: * 0: not opened * 1: opened in other tab * 2: opened in curtab * 3: opened in curtab and curwin */ int opened_len; /* length 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; tabpage_T *tpnext; int had_tab = cmdmod.tab; win_T *old_curwin, *last_curwin; tabpage_T *old_curtab, *last_curtab; win_T *new_curwin = NULL; tabpage_T *new_curtab = NULL; 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; /* 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; old_curwin = curwin; old_curtab = curtab; # 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. * When the ":tab" modifier was used do this for all tab pages. */ if (had_tab > 0) goto_tabpage_tp(first_tabpage, TRUE, TRUE); for (;;) { tpnext = curtab->tp_next; for (wp = firstwin; wp != NULL; wp = wpnext) { wpnext = wp->w_next; buf = wp->w_buffer; if (buf->b_ffname == NULL || (!keep_tabs && buf->b_nwindows > 1) || wp->w_width != Columns) i = opened_len; else { /* check if the buffer in this window is in the arglist */ for (i = 0; i < opened_len; ++i) { if (i < alist->al_ga.ga_len && (AARGLIST(alist)[i].ae_fnum == buf->b_fnum || fullpathcmp(alist_name(&AARGLIST(alist)[i]), buf->b_ffname, TRUE) & FPC_SAME)) { int weight = 1; if (old_curtab == curtab) { ++weight; if (old_curwin == wp) ++weight; } if (weight > (int)opened[i]) { opened[i] = (char_u)weight; if (i == 0) { if (new_curwin != NULL) new_curwin->w_arg_idx = opened_len; new_curwin = wp; new_curtab = curtab; } } else if (keep_tabs) i = opened_len; if (wp->w_alist != alist) { /* Use the current argument list for all windows * containing a file from it. */ alist_unlink(wp->w_alist); wp->w_alist = alist; ++wp->w_alist->al_refcount; } break; } } } wp->w_arg_idx = i; if (i == opened_len && !keep_tabs)/* 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 /* don't close last window */ if (firstwin == lastwin && (first_tabpage->tp_next == NULL || !had_tab)) #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 } } } /* Without the ":tab" modifier only do the current tab page. */ if (had_tab == 0 || tpnext == NULL) break; # ifdef FEAT_AUTOCMD /* check if autocommands removed the next tab page */ if (!valid_tabpage(tpnext)) tpnext = first_tabpage; /* start all over...*/ # endif goto_tabpage_tp(tpnext, TRUE, TRUE); } /* * 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 > opened_len || count <= 0) count = opened_len; #ifdef FEAT_AUTOCMD /* Don't execute Win/Buf Enter/Leave autocommands here. */ ++autocmd_no_enter; ++autocmd_no_leave; #endif last_curwin = curwin; last_curtab = curtab; win_enter(lastwin, FALSE); #ifdef FEAT_WINDOWS /* ":drop all" should re-use an empty window to avoid "--remote-tab" * leaving an empty tab page when executed locally. */ if (keep_tabs && bufempty() && curbuf->b_nwindows == 1 && curbuf->b_ffname == NULL && !curbuf->b_changed) use_firstwin = TRUE; #endif for (i = 0; i < count && i < opened_len && !got_int; ++i) { if (alist == &global_alist && i == global_alist.al_ga.ga_len - 1) arg_had_last = TRUE; if (opened[i] > 0) { /* 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) { if (keep_tabs) { new_curwin = wpnext; new_curtab = curtab; } else 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; if (i == 0) { new_curwin = curwin; new_curtab = curtab; } (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, curwin); #ifdef FEAT_AUTOCMD if (use_firstwin) ++autocmd_no_leave; #endif use_firstwin = FALSE; } ui_breakcheck(); /* When ":tab" was used open a new tab for a new window repeatedly. */ if (had_tab > 0 && tabpage_index(NULL) <= p_tpm) cmdmod.tab = 9999; } /* Remove the "lock" on the argument list. */ alist_unlink(alist); #ifdef FEAT_AUTOCMD --autocmd_no_enter; #endif /* restore last referenced tabpage's curwin */ if (last_curtab != new_curtab) { if (valid_tabpage(last_curtab)) goto_tabpage_tp(last_curtab, TRUE, TRUE); if (win_valid(last_curwin)) win_enter(last_curwin, FALSE); } /* to window with first arg */ if (valid_tabpage(new_curtab)) goto_tabpage_tp(new_curtab, TRUE, TRUE); if (win_valid(new_curwin)) win_enter(new_curwin, FALSE); #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(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. */ #ifdef FEAT_WINDOWS int had_tab = cmdmod.tab; tabpage_T *tpnext; #endif 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. */ #ifdef FEAT_WINDOWS if (had_tab > 0) goto_tabpage_tp(first_tabpage, TRUE, TRUE); for (;;) { #endif tpnext = curtab->tp_next; for (wp = firstwin; wp != NULL; wp = wpnext) { wpnext = wp->w_next; if ((wp->w_buffer->b_nwindows > 1 #ifdef FEAT_WINDOWS || ((cmdmod.split & WSP_VERT) ? wp->w_height + wp->w_status_height < Rows - p_ch - tabline_height() : wp->w_width != Columns) || (had_tab > 0 && wp != firstwin) #endif ) && firstwin != lastwin #ifdef FEAT_AUTOCMD && !(wp->w_closing || wp->w_buffer->b_closing) #endif ) { win_close(wp, FALSE); #ifdef FEAT_AUTOCMD wpnext = firstwin; /* just in case an autocommand does something strange with windows */ tpnext = first_tabpage; /* start all over...*/ open_wins = 0; #endif } else ++open_wins; } #ifdef FEAT_WINDOWS /* Without the ":tab" modifier only do the current tab page. */ if (had_tab == 0 || tpnext == NULL) break; goto_tabpage_tp(tpnext, TRUE, TRUE); } #endif /* * 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; #ifdef FEAT_WINDOWS if (had_tab != 0) { /* With the ":tab" modifier don't move the window. */ if (buf->b_nwindows > 0) wp = lastwin; /* buffer has a window, skip it */ else wp = NULL; } else #endif { /* 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); } if (wp == NULL && 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(HAS_SWAP_EXISTS_ACTION) swap_exists_action = SEA_DIALOG; #endif set_curbuf(buf, DOBUF_GOTO); #ifdef FEAT_AUTOCMD if (!buf_valid(buf)) /* autocommands deleted the buffer!!! */ { #if defined(HAS_SWAP_EXISTS_ACTION) swap_exists_action = SEA_NONE; # endif break; } #endif #if defined(HAS_SWAP_EXISTS_ACTION) if (swap_exists_action == SEA_QUIT) { # if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL) cleanup_T cs; /* Reset the error/interrupt/exception state here so that * aborting() returns FALSE when closing a window. */ enter_cleanup(&cs); # endif /* User selected Quit at ATTENTION prompt; close this window. */ win_close(curwin, TRUE); --open_wins; swap_exists_action = SEA_NONE; swap_exists_did_quit = TRUE; # if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL) /* Restore the error/interrupt/exception state if not * discarded by a new aborting error, interrupt, or uncaught * exception. */ leave_cleanup(&cs); # endif } else handle_swap_exists(NULL); #endif } ui_breakcheck(); if (got_int) { (void)vgetc(); /* only break the file loading, not the rest */ break; } #ifdef FEAT_EVAL /* Autocommands deleted the buffer or aborted script processing!!! */ if (aborting()) break; #endif #ifdef FEAT_WINDOWS /* When ":tab" was used open a new tab for a new window repeatedly. */ if (had_tab > 0 && tabpage_index(NULL) <= p_tpm) cmdmod.tab = 9999; #endif } #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 */ static int chk_modeline(linenr_T, int); /* * do_modelines() - process mode lines for the current file * * "flags" can be: * OPT_WINONLY only set options local to window * OPT_NOWIN don't set options local to window * * Returns immediately if the "ml" option isn't set. */ void do_modelines(int flags) { 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, flags) == 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, flags) == 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( linenr_T lnum, int flags) /* Same as for do_modelines(). */ { 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; /* Accept both "vim" and "Vim". */ if ((s[0] == 'v' || s[0] == 'V') && s[1] == 'i' && s[2] == 'm') { if (s[3] == '<' || s[3] == '=' || s[3] == '>') e = s + 4; else e = s + 3; vers = getdigits(&e); if (*e == ':' && (s[0] != 'V' || STRNCMP(skipwhite(e + 1), "set", 3) == 0) && (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] == ':') STRMOVE(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 | flags); #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; } #if defined(FEAT_VIMINFO) || defined(PROTO) int read_viminfo_bufferlist( 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: Tab Tab . * 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 = (colnr_T)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); sfname = shorten_fname1(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(FILE *fp) { buf_T *buf; #ifdef FEAT_WINDOWS win_T *win; tabpage_T *tp; #endif char_u *line; int max_buffers; if (find_viminfo_parameter('%') == NULL) return; /* Without a number -1 is returned: do all buffers. */ max_buffers = get_viminfo_parameter('%'); /* Allocate room for the file name, lnum and col. */ #define LINE_BUF_LEN (MAXPATHL + 40) line = alloc(LINE_BUF_LEN); if (line == NULL) return; #ifdef FEAT_WINDOWS FOR_ALL_TAB_WINDOWS(tp, win) set_last_cursor(win); #else set_last_cursor(curwin); #endif fputs(_("\n# Buffer list:\n"), fp); 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; if (max_buffers-- == 0) break; putc('%', fp); home_replace(NULL, buf->b_ffname, line, MAXPATHL, TRUE); vim_snprintf_add((char *)line, LINE_BUF_LEN, "\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_u * buf_spname(buf_T *buf) { #if defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS) if (bt_quickfix(buf)) { win_T *win; tabpage_T *tp; /* * For location list window, w_llist_ref points to the location list. * For quickfix window, w_llist_ref is NULL. */ if (find_win_for_buf(buf, &win, &tp) == OK && win->w_llist_ref != NULL) return (char_u *)_(msg_loclist); else return (char_u *)_(msg_qflist); } #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 buf->b_sfname; return (char_u *)_("[Scratch]"); } #endif if (buf->b_fname == NULL) return (char_u *)_("[No Name]"); return NULL; } #if (defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)) \ || defined(FEAT_PYTHON) || defined(FEAT_PYTHON3) \ || defined(PROTO) /* * Find a window for buffer "buf". * If found OK is returned and "wp" and "tp" are set to the window and tabpage. * If not found FAIL is returned. */ int find_win_for_buf( buf_T *buf, win_T **wp, tabpage_T **tp) { FOR_ALL_TAB_WINDOWS(*tp, *wp) if ((*wp)->w_buffer == buf) goto win_found; return FAIL; win_found: return OK; } #endif #if defined(FEAT_SIGNS) || defined(PROTO) /* * Insert the sign into the signlist. */ static void insert_sign( 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; #ifdef FEAT_NETBEANS_INTG if (netbeans_active()) buf->b_has_sign_column = TRUE; #endif } else prev->next = newsign; } } /* * Add the sign into the signlist. Find the right spot to do it though. */ void buf_addsign( 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; } /* * For an existing, placed sign "markId" change the type to "typenr". * Returns the line number of the sign, or zero if the sign is not found. */ linenr_T buf_change_sign_type( 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 (linenr_T)0; } int buf_getsigntype( 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_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_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_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_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_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". */ void buf_delete_signs(buf_T *buf) { signlist_T *next; /* When deleting the last sign need to redraw the windows to remove the * sign column. Not when curwin is NULL (this means we're exiting). */ if (buf->b_signlist != NULL && curwin != NULL) { redraw_buf_later(buf, NOT_VALID); changed_cline_bef_curs(); } 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(void) { buf_T *buf; /* buffer we are checking for signs */ for (buf = firstbuf; buf != NULL; buf = buf->b_next) if (buf->b_signlist != NULL) buf_delete_signs(buf); } /* * List placed signs for "rbuf". If "rbuf" is NULL do it for all buffers. */ void sign_list_placed(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 && !got_int) { if (buf->b_signlist != NULL) { vim_snprintf(lbuf, BUFSIZ, _("Signs for %s:"), buf->b_fname); MSG_PUTS_ATTR(lbuf, hl_attr(HLF_D)); msg_putchar('\n'); } for (p = buf->b_signlist; p != NULL && !got_int; p = p->next) { vim_snprintf(lbuf, BUFSIZ, _(" 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( 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(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_T *buf) { buf_T *newbuf; int differ = TRUE; linenr_T lnum; aco_save_T aco; 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; } /* set curwin/curbuf to buf and save a few things */ aucmd_prepbuf(&aco, newbuf); if (ml_open(curbuf) == 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); /* restore curwin/curbuf and a few other things */ aucmd_restbuf(&aco); 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. */ void wipe_buffer( buf_T *buf, int aucmd UNUSED) /* 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. */ block_autocmds(); #endif close_buffer(NULL, buf, DOBUF_WIPE, FALSE); #ifdef FEAT_AUTOCMD if (!aucmd) unblock_autocmds(); #endif } vim-7.4.1689/src/channel.c000066400000000000000000003130441267703067000151450ustar00rootroot00000000000000/* 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. */ /* * Implements communication through a socket or any file handle. */ #include "vim.h" #if defined(FEAT_JOB_CHANNEL) || defined(PROTO) /* TRUE when netbeans is running with a GUI. */ #ifdef FEAT_GUI # define CH_HAS_GUI (gui.in_use || gui.starting) #endif /* Note: when making changes here also adjust configure.in. */ #ifdef WIN32 /* WinSock API is separated from C API, thus we can't use read(), write(), * errno... */ # define SOCK_ERRNO errno = WSAGetLastError() # undef ECONNREFUSED # define ECONNREFUSED WSAECONNREFUSED # undef EWOULDBLOCK # define EWOULDBLOCK WSAEWOULDBLOCK # undef EINPROGRESS # define EINPROGRESS WSAEINPROGRESS # ifdef EINTR # undef EINTR # endif # define EINTR WSAEINTR # define sock_write(sd, buf, len) send((SOCKET)sd, buf, len, 0) # define sock_read(sd, buf, len) recv((SOCKET)sd, buf, len, 0) # define sock_close(sd) closesocket((SOCKET)sd) #else # include # include # include # ifdef HAVE_LIBGEN_H # include # endif # define SOCK_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) # define fd_read(fd, buf, len) read(fd, buf, len) # define fd_write(sd, buf, len) write(sd, buf, len) # define fd_close(sd) close(sd) #endif /* Whether a redraw is needed for appending a line to a buffer. */ static int channel_need_redraw = FALSE; #ifdef WIN32 static int fd_read(sock_T fd, char *buf, size_t len) { HANDLE h = (HANDLE)fd; DWORD nread; if (!ReadFile(h, buf, (DWORD)len, &nread, NULL)) return -1; return (int)nread; } static int fd_write(sock_T fd, char *buf, size_t len) { HANDLE h = (HANDLE)fd; DWORD nwrite; if (!WriteFile(h, buf, (DWORD)len, &nwrite, NULL)) return -1; return (int)nwrite; } static void fd_close(sock_T fd) { HANDLE h = (HANDLE)fd; CloseHandle(h); } #endif /* Log file opened with ch_logfile(). */ static FILE *log_fd = NULL; #ifdef FEAT_RELTIME static proftime_T log_start; #endif void ch_logfile(char_u *fname, char_u *opt) { FILE *file = NULL; if (log_fd != NULL) fclose(log_fd); if (*fname != NUL) { file = fopen((char *)fname, *opt == 'w' ? "w" : "a"); if (file == NULL) { EMSG2(_(e_notopen), fname); return; } } log_fd = file; if (log_fd != NULL) { fprintf(log_fd, "==== start log session ====\n"); #ifdef FEAT_RELTIME profile_start(&log_start); #endif } } int ch_log_active() { return log_fd != NULL; } static void ch_log_lead(char *what, channel_T *ch) { if (log_fd != NULL) { #ifdef FEAT_RELTIME proftime_T log_now; profile_start(&log_now); profile_sub(&log_now, &log_start); fprintf(log_fd, "%s ", profile_msg(&log_now)); #endif if (ch != NULL) fprintf(log_fd, "%son %d: ", what, ch->ch_id); else fprintf(log_fd, "%s: ", what); } } static int did_log_msg = TRUE; void ch_log(channel_T *ch, char *msg) { if (log_fd != NULL) { ch_log_lead("", ch); fputs(msg, log_fd); fputc('\n', log_fd); fflush(log_fd); did_log_msg = TRUE; } } static void ch_logn(channel_T *ch, char *msg, int nr) { if (log_fd != NULL) { ch_log_lead("", ch); fprintf(log_fd, msg, nr); fputc('\n', log_fd); fflush(log_fd); did_log_msg = TRUE; } } void ch_logs(channel_T *ch, char *msg, char *name) { if (log_fd != NULL) { ch_log_lead("", ch); fprintf(log_fd, msg, name); fputc('\n', log_fd); fflush(log_fd); did_log_msg = TRUE; } } static void ch_logsn(channel_T *ch, char *msg, char *name, int nr) { if (log_fd != NULL) { ch_log_lead("", ch); fprintf(log_fd, msg, name, nr); fputc('\n', log_fd); fflush(log_fd); did_log_msg = TRUE; } } static void ch_error(channel_T *ch, char *msg) { if (log_fd != NULL) { ch_log_lead("ERR ", ch); fputs(msg, log_fd); fputc('\n', log_fd); fflush(log_fd); did_log_msg = TRUE; } } static void ch_errorn(channel_T *ch, char *msg, int nr) { if (log_fd != NULL) { ch_log_lead("ERR ", ch); fprintf(log_fd, msg, nr); fputc('\n', log_fd); fflush(log_fd); did_log_msg = TRUE; } } static void ch_errors(channel_T *ch, char *msg, char *arg) { if (log_fd != NULL) { ch_log_lead("ERR ", ch); fprintf(log_fd, msg, arg); fputc('\n', log_fd); fflush(log_fd); did_log_msg = TRUE; } } #ifdef _WIN32 # undef PERROR # define PERROR(msg) (void)emsg3((char_u *)"%s: %s", \ (char_u *)msg, (char_u *)strerror_win32(errno)) static char * strerror_win32(int eno) { static LPVOID msgbuf = NULL; char_u *ptr; if (msgbuf) LocalFree(msgbuf); FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, eno, MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT), (LPTSTR) &msgbuf, 0, NULL); /* chomp \r or \n */ for (ptr = (char_u *)msgbuf; *ptr; ptr++) switch (*ptr) { case '\r': STRMOVE(ptr, ptr + 1); ptr--; break; case '\n': if (*(ptr + 1) == '\0') *ptr = '\0'; else *ptr = ' '; break; } return msgbuf; } #endif /* * The list of all allocated channels. */ static channel_T *first_channel = NULL; static int next_ch_id = 0; /* * Allocate a new channel. The refcount is set to 1. * The channel isn't actually used until it is opened. * Returns NULL if out of memory. */ channel_T * add_channel(void) { int part; channel_T *channel = (channel_T *)alloc_clear((int)sizeof(channel_T)); if (channel == NULL) return NULL; channel->ch_id = next_ch_id++; ch_log(channel, "Created channel"); for (part = PART_SOCK; part <= PART_IN; ++part) { channel->ch_part[part].ch_fd = INVALID_FD; #ifdef FEAT_GUI_X11 channel->ch_part[part].ch_inputHandler = (XtInputId)NULL; #endif #ifdef FEAT_GUI_GTK channel->ch_part[part].ch_inputHandler = 0; #endif channel->ch_part[part].ch_timeout = 2000; } if (first_channel != NULL) { first_channel->ch_prev = channel; channel->ch_next = first_channel; } first_channel = channel; channel->ch_refcount = 1; return channel; } /* * Called when the refcount of a channel is zero. * Return TRUE if "channel" has a callback and the associated job wasn't * killed. */ static int channel_still_useful(channel_T *channel) { int has_sock_msg; int has_out_msg; int has_err_msg; /* If the job was killed the channel is not expected to work anymore. */ if (channel->ch_job_killed && channel->ch_job == NULL) return FALSE; /* If there is a close callback it may still need to be invoked. */ if (channel->ch_close_cb != NULL) return TRUE; /* If there is no callback then nobody can get readahead. If the fd is * closed and there is no readahead then the callback won't be called. */ has_sock_msg = channel->ch_part[PART_SOCK].ch_fd != INVALID_FD || channel->ch_part[PART_SOCK].ch_head.rq_next != NULL || channel->ch_part[PART_SOCK].ch_json_head.jq_next != NULL; has_out_msg = channel->ch_part[PART_OUT].ch_fd != INVALID_FD || channel->ch_part[PART_OUT].ch_head.rq_next != NULL || channel->ch_part[PART_OUT].ch_json_head.jq_next != NULL; has_err_msg = channel->ch_part[PART_ERR].ch_fd != INVALID_FD || channel->ch_part[PART_ERR].ch_head.rq_next != NULL || channel->ch_part[PART_ERR].ch_json_head.jq_next != NULL; return (channel->ch_callback != NULL && (has_sock_msg || has_out_msg || has_err_msg)) || (channel->ch_part[PART_OUT].ch_callback != NULL && has_out_msg) || (channel->ch_part[PART_ERR].ch_callback != NULL && has_err_msg); } /* * Close a channel and free all its resources if there is no further action * possible, there is no callback to be invoked or the associated job was * killed. * Return TRUE if the channel was freed. */ static int channel_may_free(channel_T *channel) { if (!channel_still_useful(channel)) { channel_free(channel); return TRUE; } return FALSE; } /* * Decrement the reference count on "channel" and maybe free it when it goes * down to zero. Don't free it if there is a pending action. * Returns TRUE when the channel is no longer referenced. */ int channel_unref(channel_T *channel) { if (channel != NULL && --channel->ch_refcount <= 0) return channel_may_free(channel); return FALSE; } /* * Close a channel and free all its resources. */ void channel_free(channel_T *channel) { channel_close(channel, TRUE); channel_clear(channel); ch_log(channel, "Freeing channel"); if (channel->ch_next != NULL) channel->ch_next->ch_prev = channel->ch_prev; if (channel->ch_prev == NULL) first_channel = channel->ch_next; else channel->ch_prev->ch_next = channel->ch_next; vim_free(channel); } #if defined(FEAT_GUI) || defined(PROTO) #if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK) static void channel_read_fd(int fd) { channel_T *channel; int part; channel = channel_fd2channel(fd, &part); if (channel == NULL) ch_errorn(NULL, "Channel for fd %d not found", fd); else channel_read(channel, part, "messageFromNetbeans"); } #endif /* * Read a command from netbeans. */ #ifdef FEAT_GUI_X11 static void messageFromNetbeans(XtPointer clientData, int *unused1 UNUSED, XtInputId *unused2 UNUSED) { channel_read_fd((int)(long)clientData); } #endif #ifdef FEAT_GUI_GTK # if GTK_CHECK_VERSION(3,0,0) static gboolean messageFromNetbeans(GIOChannel *unused1 UNUSED, GIOCondition unused2 UNUSED, gpointer clientData) { channel_read_fd(GPOINTER_TO_INT(clientData)); return TRUE; /* Return FALSE instead in case the event source is to * be removed after this function returns. */ } # else static void messageFromNetbeans(gpointer clientData, gint unused1 UNUSED, GdkInputCondition unused2 UNUSED) { channel_read_fd((int)(long)clientData); } # endif #endif static void channel_gui_register_one(channel_T *channel, int part) { if (!CH_HAS_GUI) return; # ifdef FEAT_GUI_X11 /* Tell notifier we are interested in being called * when there is input on the editor connection socket. */ if (channel->ch_part[part].ch_inputHandler == (XtInputId)NULL) channel->ch_part[part].ch_inputHandler = XtAppAddInput( (XtAppContext)app_context, channel->ch_part[part].ch_fd, (XtPointer)(XtInputReadMask + XtInputExceptMask), messageFromNetbeans, (XtPointer)(long)channel->ch_part[part].ch_fd); # else # ifdef FEAT_GUI_GTK /* Tell gdk we are interested in being called when there * is input on the editor connection socket. */ if (channel->ch_part[part].ch_inputHandler == 0) # if GTK_CHECK_VERSION(3,0,0) { GIOChannel *chnnl = g_io_channel_unix_new( (gint)channel->ch_part[part].ch_fd); channel->ch_part[part].ch_inputHandler = g_io_add_watch( chnnl, G_IO_IN|G_IO_HUP|G_IO_ERR|G_IO_PRI, messageFromNetbeans, GINT_TO_POINTER(channel->ch_part[part].ch_fd)); g_io_channel_unref(chnnl); } # else channel->ch_part[part].ch_inputHandler = gdk_input_add( (gint)channel->ch_part[part].ch_fd, (GdkInputCondition) ((int)GDK_INPUT_READ + (int)GDK_INPUT_EXCEPTION), messageFromNetbeans, (gpointer)(long)channel->ch_part[part].ch_fd); # endif # endif # endif } static void channel_gui_register(channel_T *channel) { if (channel->CH_SOCK_FD != INVALID_FD) channel_gui_register_one(channel, PART_SOCK); if (channel->CH_OUT_FD != INVALID_FD) channel_gui_register_one(channel, PART_OUT); if (channel->CH_ERR_FD != INVALID_FD) channel_gui_register_one(channel, PART_ERR); } /* * Register any of our file descriptors with the GUI event handling system. * Called when the GUI has started. */ void channel_gui_register_all(void) { channel_T *channel; for (channel = first_channel; channel != NULL; channel = channel->ch_next) channel_gui_register(channel); } static void channel_gui_unregister_one(channel_T *channel, int part) { # ifdef FEAT_GUI_X11 if (channel->ch_part[part].ch_inputHandler != (XtInputId)NULL) { XtRemoveInput(channel->ch_part[part].ch_inputHandler); channel->ch_part[part].ch_inputHandler = (XtInputId)NULL; } # else # ifdef FEAT_GUI_GTK if (channel->ch_part[part].ch_inputHandler != 0) { # if GTK_CHECK_VERSION(3,0,0) g_source_remove(channel->ch_part[part].ch_inputHandler); # else gdk_input_remove(channel->ch_part[part].ch_inputHandler); # endif channel->ch_part[part].ch_inputHandler = 0; } # endif # endif } static void channel_gui_unregister(channel_T *channel) { int part; for (part = PART_SOCK; part < PART_IN; ++part) channel_gui_unregister_one(channel, part); } #endif static char *e_cannot_connect = N_("E902: Cannot connect to port"); /* * Open a socket channel to "hostname":"port". * "waittime" is the time in msec to wait for the connection. * When negative wait forever. * Returns the channel for success. * Returns NULL for failure. */ channel_T * channel_open( char *hostname, int port_in, int waittime, void (*nb_close_cb)(void)) { int sd = -1; struct sockaddr_in server; struct hostent *host; #ifdef WIN32 u_short port = port_in; u_long val = 1; #else int port = port_in; #endif channel_T *channel; int ret; #ifdef WIN32 channel_init_winsock(); #endif channel = add_channel(); if (channel == NULL) { ch_error(NULL, "Cannot allocate channel."); return NULL; } /* Get the server internet address and put into addr structure */ /* fill in the socket address structure and connect to server */ vim_memset((char *)&server, 0, sizeof(server)); server.sin_family = AF_INET; server.sin_port = htons(port); if ((host = gethostbyname(hostname)) == NULL) { ch_error(channel, "in gethostbyname() in channel_open()"); PERROR("E901: gethostbyname() in channel_open()"); channel_free(channel); return NULL; } memcpy((char *)&server.sin_addr, host->h_addr, host->h_length); /* On Mac and Solaris a zero timeout almost never works. At least wait * one millisecond. Let's do it for all systems, because we don't know why * this is needed. */ if (waittime == 0) waittime = 1; /* * For Unix we need to call connect() again after connect() failed. * On Win32 one time is sufficient. */ while (TRUE) { long elapsed_msec = 0; int waitnow; if (sd >= 0) sock_close(sd); sd = socket(AF_INET, SOCK_STREAM, 0); if (sd == -1) { ch_error(channel, "in socket() in channel_open()."); PERROR("E898: socket() in channel_open()"); channel_free(channel); return NULL; } if (waittime >= 0) { /* Make connect() non-blocking. */ if ( #ifdef _WIN32 ioctlsocket(sd, FIONBIO, &val) < 0 #else fcntl(sd, F_SETFL, O_NONBLOCK) < 0 #endif ) { SOCK_ERRNO; ch_errorn(channel, "channel_open: Connect failed with errno %d", errno); sock_close(sd); channel_free(channel); return NULL; } } /* Try connecting to the server. */ ch_logsn(channel, "Connecting to %s port %d", hostname, port); ret = connect(sd, (struct sockaddr *)&server, sizeof(server)); if (ret == 0) /* The connection could be established. */ break; SOCK_ERRNO; if (waittime < 0 || (errno != EWOULDBLOCK && errno != ECONNREFUSED #ifdef EINPROGRESS && errno != EINPROGRESS #endif )) { ch_errorn(channel, "channel_open: Connect failed with errno %d", errno); PERROR(_(e_cannot_connect)); sock_close(sd); channel_free(channel); return NULL; } /* Limit the waittime to 50 msec. If it doesn't work within this * time we close the socket and try creating it again. */ waitnow = waittime > 50 ? 50 : waittime; /* If connect() didn't finish then try using select() to wait for the * connection to be made. For Win32 always use select() to wait. */ #ifndef WIN32 if (errno != ECONNREFUSED) #endif { struct timeval tv; fd_set rfds; fd_set wfds; #ifndef WIN32 int so_error = 0; socklen_t so_error_len = sizeof(so_error); struct timeval start_tv; struct timeval end_tv; #endif FD_ZERO(&rfds); FD_SET(sd, &rfds); FD_ZERO(&wfds); FD_SET(sd, &wfds); tv.tv_sec = waitnow / 1000; tv.tv_usec = (waitnow % 1000) * 1000; #ifndef WIN32 gettimeofday(&start_tv, NULL); #endif ch_logn(channel, "Waiting for connection (waiting %d msec)...", waitnow); ret = select((int)sd + 1, &rfds, &wfds, NULL, &tv); if (ret < 0) { SOCK_ERRNO; ch_errorn(channel, "channel_open: Connect failed with errno %d", errno); PERROR(_(e_cannot_connect)); sock_close(sd); channel_free(channel); return NULL; } #ifdef WIN32 /* On Win32: select() is expected to work and wait for up to * "waitnow" msec for the socket to be open. */ if (FD_ISSET(sd, &wfds)) break; elapsed_msec = waitnow; if (waittime > 1 && elapsed_msec < waittime) { waittime -= elapsed_msec; continue; } #else /* On Linux-like systems: See socket(7) for the behavior * After putting the socket in non-blocking mode, connect() will * return EINPROGRESS, select() will not wait (as if writing is * possible), need to use getsockopt() to check if the socket is * actually able to connect. * We detect a failure to connect when either read and write fds * are set. Use getsockopt() to find out what kind of failure. */ if (FD_ISSET(sd, &rfds) || FD_ISSET(sd, &wfds)) { ret = getsockopt(sd, SOL_SOCKET, SO_ERROR, &so_error, &so_error_len); if (ret < 0 || (so_error != 0 && so_error != EWOULDBLOCK && so_error != ECONNREFUSED # ifdef EINPROGRESS && so_error != EINPROGRESS # endif )) { ch_errorn(channel, "channel_open: Connect failed with errno %d", so_error); PERROR(_(e_cannot_connect)); sock_close(sd); channel_free(channel); return NULL; } } if (FD_ISSET(sd, &wfds) && so_error == 0) /* Did not detect an error, connection is established. */ break; gettimeofday(&end_tv, NULL); elapsed_msec = (end_tv.tv_sec - start_tv.tv_sec) * 1000 + (end_tv.tv_usec - start_tv.tv_usec) / 1000; #endif } #ifndef WIN32 if (waittime > 1 && elapsed_msec < waittime) { /* The port isn't ready but we also didn't get an error. * This happens when the server didn't open the socket * yet. Select() may return early, wait until the remaining * "waitnow" and try again. */ waitnow -= elapsed_msec; waittime -= elapsed_msec; if (waitnow > 0) { mch_delay((long)waitnow, TRUE); ui_breakcheck(); waittime -= waitnow; } if (!got_int) { if (waittime <= 0) /* give it one more try */ waittime = 1; continue; } /* we were interrupted, behave as if timed out */ } #endif /* We timed out. */ ch_error(channel, "Connection timed out"); sock_close(sd); channel_free(channel); return NULL; } ch_log(channel, "Connection made"); if (waittime >= 0) { #ifdef _WIN32 val = 0; ioctlsocket(sd, FIONBIO, &val); #else (void)fcntl(sd, F_SETFL, 0); #endif } channel->CH_SOCK_FD = (sock_T)sd; channel->ch_nb_close_cb = nb_close_cb; channel->ch_hostname = (char *)vim_strsave((char_u *)hostname); channel->ch_port = port_in; #ifdef FEAT_GUI channel_gui_register_one(channel, PART_SOCK); #endif return channel; } /* * Implements ch_open(). */ channel_T * channel_open_func(typval_T *argvars) { char_u *address; char_u *p; char *rest; int port; jobopt_T opt; channel_T *channel; address = get_tv_string(&argvars[0]); if (argvars[1].v_type != VAR_UNKNOWN && (argvars[1].v_type != VAR_DICT || argvars[1].vval.v_dict == NULL)) { EMSG(_(e_invarg)); return NULL; } /* parse address */ p = vim_strchr(address, ':'); if (p == NULL) { EMSG2(_(e_invarg2), address); return NULL; } *p++ = NUL; port = strtol((char *)p, &rest, 10); if (*address == NUL || port <= 0 || *rest != NUL) { p[-1] = ':'; EMSG2(_(e_invarg2), address); return NULL; } /* parse options */ clear_job_options(&opt); opt.jo_mode = MODE_JSON; opt.jo_timeout = 2000; if (get_job_options(&argvars[1], &opt, JO_MODE_ALL + JO_CB_ALL + JO_WAITTIME + JO_TIMEOUT_ALL) == FAIL) return NULL; if (opt.jo_timeout < 0) { EMSG(_(e_invarg)); return NULL; } channel = channel_open((char *)address, port, opt.jo_waittime, NULL); if (channel != NULL) { opt.jo_set = JO_ALL; channel_set_options(channel, &opt); } return channel; } static void may_close_part(sock_T *fd) { if (*fd != INVALID_FD) { fd_close(*fd); *fd = INVALID_FD; } } void channel_set_pipes(channel_T *channel, sock_T in, sock_T out, sock_T err) { if (in != INVALID_FD) { may_close_part(&channel->CH_IN_FD); channel->CH_IN_FD = in; } if (out != INVALID_FD) { # if defined(FEAT_GUI) channel_gui_unregister_one(channel, PART_OUT); # endif may_close_part(&channel->CH_OUT_FD); channel->CH_OUT_FD = out; # if defined(FEAT_GUI) channel_gui_register_one(channel, PART_OUT); # endif } if (err != INVALID_FD) { # if defined(FEAT_GUI) channel_gui_unregister_one(channel, PART_ERR); # endif may_close_part(&channel->CH_ERR_FD); channel->CH_ERR_FD = err; # if defined(FEAT_GUI) channel_gui_register_one(channel, PART_ERR); # endif } } /* * Sets the job the channel is associated with and associated options. * This does not keep a refcount, when the job is freed ch_job is cleared. */ void channel_set_job(channel_T *channel, job_T *job, jobopt_T *options) { channel->ch_job = job; channel_set_options(channel, options); if (job->jv_in_buf != NULL) { chanpart_T *in_part = &channel->ch_part[PART_IN]; in_part->ch_buffer = job->jv_in_buf; ch_logs(channel, "reading from buffer '%s'", (char *)in_part->ch_buffer->b_ffname); if (options->jo_set & JO_IN_TOP) { if (options->jo_in_top == 0 && !(options->jo_set & JO_IN_BOT)) { /* Special mode: send last-but-one line when appending a line * to the buffer. */ in_part->ch_buffer->b_write_to_channel = TRUE; in_part->ch_buf_append = TRUE; in_part->ch_buf_top = in_part->ch_buffer->b_ml.ml_line_count + 1; } else in_part->ch_buf_top = options->jo_in_top; } else in_part->ch_buf_top = 1; if (options->jo_set & JO_IN_BOT) in_part->ch_buf_bot = options->jo_in_bot; else in_part->ch_buf_bot = in_part->ch_buffer->b_ml.ml_line_count; } } /* * Find a buffer matching "name" or create a new one. */ static buf_T * find_buffer(char_u *name, int err) { buf_T *buf = NULL; buf_T *save_curbuf = curbuf; if (name != NULL && *name != NUL) buf = buflist_findname(name); if (buf == NULL) { buf = buflist_new(name == NULL || *name == NUL ? NULL : name, NULL, (linenr_T)0, BLN_LISTED); buf_copy_options(buf, BCO_ENTER); curbuf = buf; #ifdef FEAT_QUICKFIX set_option_value((char_u *)"bt", 0L, (char_u *)"nofile", OPT_LOCAL); set_option_value((char_u *)"bh", 0L, (char_u *)"hide", OPT_LOCAL); #endif if (curbuf->b_ml.ml_mfp == NULL) ml_open(curbuf); ml_replace(1, (char_u *)(err ? "Reading from channel error..." : "Reading from channel output..."), TRUE); changed_bytes(1, 0); curbuf = save_curbuf; } return buf; } /* * Set various properties from an "opt" argument. */ void channel_set_options(channel_T *channel, jobopt_T *opt) { int part; char_u **cbp; partial_T **pp; if (opt->jo_set & JO_MODE) for (part = PART_SOCK; part <= PART_IN; ++part) channel->ch_part[part].ch_mode = opt->jo_mode; if (opt->jo_set & JO_IN_MODE) channel->ch_part[PART_IN].ch_mode = opt->jo_in_mode; if (opt->jo_set & JO_OUT_MODE) channel->ch_part[PART_OUT].ch_mode = opt->jo_out_mode; if (opt->jo_set & JO_ERR_MODE) channel->ch_part[PART_ERR].ch_mode = opt->jo_err_mode; if (opt->jo_set & JO_TIMEOUT) for (part = PART_SOCK; part <= PART_IN; ++part) channel->ch_part[part].ch_timeout = opt->jo_timeout; if (opt->jo_set & JO_OUT_TIMEOUT) channel->ch_part[PART_OUT].ch_timeout = opt->jo_out_timeout; if (opt->jo_set & JO_ERR_TIMEOUT) channel->ch_part[PART_ERR].ch_timeout = opt->jo_err_timeout; if (opt->jo_set & JO_BLOCK_WRITE) channel->ch_part[PART_IN].ch_block_write = 1; if (opt->jo_set & JO_CALLBACK) { cbp = &channel->ch_callback; pp = &channel->ch_partial; vim_free(*cbp); partial_unref(*pp); if (opt->jo_callback != NULL && *opt->jo_callback != NUL) *cbp = vim_strsave(opt->jo_callback); else *cbp = NULL; *pp = opt->jo_partial; if (*pp != NULL) ++(*pp)->pt_refcount; } if (opt->jo_set & JO_OUT_CALLBACK) { cbp = &channel->ch_part[PART_OUT].ch_callback; pp = &channel->ch_part[PART_OUT].ch_partial; vim_free(*cbp); partial_unref(*pp); if (opt->jo_out_cb != NULL && *opt->jo_out_cb != NUL) *cbp = vim_strsave(opt->jo_out_cb); else *cbp = NULL; *pp = opt->jo_out_partial; if (*pp != NULL) ++(*pp)->pt_refcount; } if (opt->jo_set & JO_ERR_CALLBACK) { cbp = &channel->ch_part[PART_ERR].ch_callback; pp = &channel->ch_part[PART_ERR].ch_partial; vim_free(*cbp); partial_unref(*pp); if (opt->jo_err_cb != NULL && *opt->jo_err_cb != NUL) *cbp = vim_strsave(opt->jo_err_cb); else *cbp = NULL; *pp = opt->jo_err_partial; if (*pp != NULL) ++(*pp)->pt_refcount; } if (opt->jo_set & JO_CLOSE_CALLBACK) { cbp = &channel->ch_close_cb; pp = &channel->ch_close_partial; vim_free(*cbp); partial_unref(*pp); if (opt->jo_close_cb != NULL && *opt->jo_close_cb != NUL) *cbp = vim_strsave(opt->jo_close_cb); else *cbp = NULL; *pp = opt->jo_close_partial; if (*pp != NULL) ++(*pp)->pt_refcount; } if ((opt->jo_set & JO_OUT_IO) && opt->jo_io[PART_OUT] == JIO_BUFFER) { /* writing output to a buffer. Default mode is NL. */ if (!(opt->jo_set & JO_OUT_MODE)) channel->ch_part[PART_OUT].ch_mode = MODE_NL; if (opt->jo_set & JO_OUT_BUF) channel->ch_part[PART_OUT].ch_buffer = buflist_findnr(opt->jo_io_buf[PART_OUT]); else channel->ch_part[PART_OUT].ch_buffer = find_buffer(opt->jo_io_name[PART_OUT], FALSE); ch_logs(channel, "writing out to buffer '%s'", (char *)channel->ch_part[PART_OUT].ch_buffer->b_ffname); } if ((opt->jo_set & JO_ERR_IO) && (opt->jo_io[PART_ERR] == JIO_BUFFER || (opt->jo_io[PART_ERR] == JIO_OUT && (opt->jo_set & JO_OUT_IO) && opt->jo_io[PART_OUT] == JIO_BUFFER))) { /* writing err to a buffer. Default mode is NL. */ if (!(opt->jo_set & JO_ERR_MODE)) channel->ch_part[PART_ERR].ch_mode = MODE_NL; if (opt->jo_io[PART_ERR] == JIO_OUT) channel->ch_part[PART_ERR].ch_buffer = channel->ch_part[PART_OUT].ch_buffer; else if (opt->jo_set & JO_ERR_BUF) channel->ch_part[PART_ERR].ch_buffer = buflist_findnr(opt->jo_io_buf[PART_ERR]); else channel->ch_part[PART_ERR].ch_buffer = find_buffer(opt->jo_io_name[PART_ERR], TRUE); ch_logs(channel, "writing err to buffer '%s'", (char *)channel->ch_part[PART_ERR].ch_buffer->b_ffname); } channel->ch_part[PART_OUT].ch_io = opt->jo_io[PART_OUT]; channel->ch_part[PART_ERR].ch_io = opt->jo_io[PART_ERR]; channel->ch_part[PART_IN].ch_io = opt->jo_io[PART_IN]; } /* * Set the callback for "channel"/"part" for the response with "id". */ void channel_set_req_callback( channel_T *channel, int part, char_u *callback, partial_T *partial, int id) { cbq_T *head = &channel->ch_part[part].ch_cb_head; cbq_T *item = (cbq_T *)alloc((int)sizeof(cbq_T)); if (item != NULL) { item->cq_callback = vim_strsave(callback); item->cq_partial = partial; if (partial != NULL) ++partial->pt_refcount; item->cq_seq_nr = id; item->cq_prev = head->cq_prev; head->cq_prev = item; item->cq_next = NULL; if (item->cq_prev == NULL) head->cq_next = item; else item->cq_prev->cq_next = item; } } static void write_buf_line(buf_T *buf, linenr_T lnum, channel_T *channel) { char_u *line = ml_get_buf(buf, lnum, FALSE); int len = (int)STRLEN(line); char_u *p; if ((p = alloc(len + 2)) == NULL) return; STRCPY(p, line); p[len] = NL; p[len + 1] = NUL; channel_send(channel, PART_IN, p, "write_buf_line()"); vim_free(p); } /* * Return TRUE if "channel" can be written to. * Returns FALSE if the input is closed or the write would block. */ static int can_write_buf_line(channel_T *channel) { chanpart_T *in_part = &channel->ch_part[PART_IN]; if (in_part->ch_fd == INVALID_FD) return FALSE; /* pipe was closed */ /* for testing: block every other attempt to write */ if (in_part->ch_block_write == 1) in_part->ch_block_write = -1; else if (in_part->ch_block_write == -1) in_part->ch_block_write = 1; /* TODO: Win32 implementation, probably using WaitForMultipleObjects() */ #ifndef WIN32 { # if defined(HAVE_SELECT) struct timeval tval; fd_set wfds; int ret; FD_ZERO(&wfds); FD_SET((int)in_part->ch_fd, &wfds); tval.tv_sec = 0; tval.tv_usec = 0; for (;;) { ret = select((int)in_part->ch_fd + 1, NULL, &wfds, NULL, &tval); # ifdef EINTR SOCK_ERRNO; if (ret == -1 && errno == EINTR) continue; # endif if (ret <= 0 || in_part->ch_block_write == 1) { if (ret > 0) ch_log(channel, "FAKED Input not ready for writing"); else ch_log(channel, "Input not ready for writing"); return FALSE; } break; } # else struct pollfd fds; fds.fd = in_part->ch_fd; fds.events = POLLOUT; if (poll(&fds, 1, 0) <= 0) { ch_log(channel, "Input not ready for writing"); return FALSE; } if (in_part->ch_block_write == 1) { ch_log(channel, "FAKED Input not ready for writing"); return FALSE; } # endif } #endif return TRUE; } /* * Write any lines to the input channel. */ static void channel_write_in(channel_T *channel) { chanpart_T *in_part = &channel->ch_part[PART_IN]; linenr_T lnum; buf_T *buf = in_part->ch_buffer; int written = 0; if (buf == NULL || in_part->ch_buf_append) return; /* no buffer or using appending */ if (!buf_valid(buf) || buf->b_ml.ml_mfp == NULL) { /* buffer was wiped out or unloaded */ in_part->ch_buffer = NULL; return; } for (lnum = in_part->ch_buf_top; lnum <= in_part->ch_buf_bot && lnum <= buf->b_ml.ml_line_count; ++lnum) { if (!can_write_buf_line(channel)) break; write_buf_line(buf, lnum, channel); ++written; } if (written == 1) ch_logn(channel, "written line %d to channel", (int)lnum - 1); else if (written > 1) ch_logn(channel, "written %d lines to channel", written); in_part->ch_buf_top = lnum; if (lnum > buf->b_ml.ml_line_count) { /* Writing is done, no longer need the buffer. */ in_part->ch_buffer = NULL; ch_log(channel, "Finished writing all lines to channel"); } else ch_logn(channel, "Still %d more lines to write", buf->b_ml.ml_line_count - lnum + 1); } /* * Write any lines waiting to be written to a channel. */ void channel_write_any_lines() { channel_T *channel; for (channel = first_channel; channel != NULL; channel = channel->ch_next) { chanpart_T *in_part = &channel->ch_part[PART_IN]; if (in_part->ch_buffer != NULL) { if (in_part->ch_buf_append) channel_write_new_lines(in_part->ch_buffer); else channel_write_in(channel); } } } /* * Write appended lines above the last one in "buf" to the channel. */ void channel_write_new_lines(buf_T *buf) { channel_T *channel; int found_one = FALSE; /* There could be more than one channel for the buffer, loop over all of * them. */ for (channel = first_channel; channel != NULL; channel = channel->ch_next) { chanpart_T *in_part = &channel->ch_part[PART_IN]; linenr_T lnum; int written = 0; if (in_part->ch_buffer == buf && in_part->ch_buf_append) { if (in_part->ch_fd == INVALID_FD) continue; /* pipe was closed */ found_one = TRUE; for (lnum = in_part->ch_buf_bot; lnum < buf->b_ml.ml_line_count; ++lnum) { if (!can_write_buf_line(channel)) break; write_buf_line(buf, lnum, channel); ++written; } if (written == 1) ch_logn(channel, "written line %d to channel", (int)lnum - 1); else if (written > 1) ch_logn(channel, "written %d lines to channel", written); if (lnum < buf->b_ml.ml_line_count) ch_logn(channel, "Still %d more lines to write", buf->b_ml.ml_line_count - lnum); in_part->ch_buf_bot = lnum; } } if (!found_one) buf->b_write_to_channel = FALSE; } /* * Invoke the "callback" on channel "channel". */ static void invoke_callback(channel_T *channel, char_u *callback, partial_T *partial, typval_T *argv) { typval_T rettv; int dummy; argv[0].v_type = VAR_CHANNEL; argv[0].vval.v_channel = channel; call_func(callback, (int)STRLEN(callback), &rettv, 2, argv, 0L, 0L, &dummy, TRUE, partial, NULL); clear_tv(&rettv); redraw_after_callback(); } /* * Return the first buffer from channel "channel"/"part" and remove it. * The caller must free it. * Returns NULL if there is nothing. */ char_u * channel_get(channel_T *channel, int part) { readq_T *head = &channel->ch_part[part].ch_head; readq_T *node = head->rq_next; char_u *p; if (node == NULL) return NULL; /* dispose of the node but keep the buffer */ p = node->rq_buffer; head->rq_next = node->rq_next; if (node->rq_next == NULL) head->rq_prev = NULL; else node->rq_next->rq_prev = NULL; vim_free(node); return p; } /* * Returns the whole buffer contents concatenated for "channel"/"part". */ static char_u * channel_get_all(channel_T *channel, int part) { readq_T *head = &channel->ch_part[part].ch_head; readq_T *node = head->rq_next; long_u len = 1; char_u *res; char_u *p; /* If there is only one buffer just get that one. */ if (head->rq_next == NULL || head->rq_next->rq_next == NULL) return channel_get(channel, part); /* Concatenate everything into one buffer. */ for (node = head->rq_next; node != NULL; node = node->rq_next) len += (long_u)STRLEN(node->rq_buffer); res = lalloc(len, TRUE); if (res == NULL) return NULL; *res = NUL; for (node = head->rq_next; node != NULL; node = node->rq_next) STRCAT(res, node->rq_buffer); /* Free all buffers */ do { p = channel_get(channel, part); vim_free(p); } while (p != NULL); return res; } /* * Collapses the first and second buffer for "channel"/"part". * Returns FAIL if that is not possible. */ int channel_collapse(channel_T *channel, int part) { readq_T *head = &channel->ch_part[part].ch_head; readq_T *node = head->rq_next; char_u *p; if (node == NULL || node->rq_next == NULL) return FAIL; p = alloc((unsigned)(STRLEN(node->rq_buffer) + STRLEN(node->rq_next->rq_buffer) + 1)); if (p == NULL) return FAIL; /* out of memory */ STRCPY(p, node->rq_buffer); STRCAT(p, node->rq_next->rq_buffer); vim_free(node->rq_next->rq_buffer); node->rq_next->rq_buffer = p; /* dispose of the node and its buffer */ head->rq_next = node->rq_next; head->rq_next->rq_prev = NULL; vim_free(node->rq_buffer); vim_free(node); return OK; } /* * Store "buf[len]" on "channel"/"part". * When "prepend" is TRUE put in front, otherwise append at the end. * Returns OK or FAIL. */ static int channel_save(channel_T *channel, int part, char_u *buf, int len, int prepend, char *lead) { readq_T *node; readq_T *head = &channel->ch_part[part].ch_head; char_u *p; int i; node = (readq_T *)alloc(sizeof(readq_T)); if (node == NULL) return FAIL; /* out of memory */ node->rq_buffer = alloc(len + 1); if (node->rq_buffer == NULL) { vim_free(node); return FAIL; /* out of memory */ } if (channel->ch_part[part].ch_mode == MODE_NL) { /* Drop any CR before a NL. */ p = node->rq_buffer; for (i = 0; i < len; ++i) if (buf[i] != CAR || i + 1 >= len || buf[i + 1] != NL) *p++ = buf[i]; *p = NUL; } else { mch_memmove(node->rq_buffer, buf, len); node->rq_buffer[len] = NUL; } if (prepend) { /* preend node to the head of the queue */ node->rq_next = head->rq_next; node->rq_prev = NULL; if (head->rq_next == NULL) head->rq_prev = node; else head->rq_next->rq_prev = node; head->rq_next = node; } else { /* append node to the tail of the queue */ node->rq_next = NULL; node->rq_prev = head->rq_prev; if (head->rq_prev == NULL) head->rq_next = node; else head->rq_prev->rq_next = node; head->rq_prev = node; } if (log_fd != NULL && lead != NULL) { ch_log_lead(lead, channel); fprintf(log_fd, "'"); if (fwrite(buf, len, 1, log_fd) != 1) return FAIL; fprintf(log_fd, "'\n"); } return OK; } static int channel_fill(js_read_T *reader) { channel_T *channel = (channel_T *)reader->js_cookie; int part = reader->js_cookie_arg; char_u *next = channel_get(channel, part); int unused; int len; char_u *p; if (next == NULL) return FALSE; unused = reader->js_end - reader->js_buf - reader->js_used; if (unused > 0) { /* Prepend unused text. */ len = (int)STRLEN(next); p = alloc(unused + len + 1); if (p == NULL) { vim_free(next); return FALSE; } mch_memmove(p, reader->js_buf + reader->js_used, unused); mch_memmove(p + unused, next, len + 1); vim_free(next); next = p; } vim_free(reader->js_buf); reader->js_buf = next; reader->js_used = 0; return TRUE; } /* * Use the read buffer of "channel"/"part" and parse a JSON message that is * complete. The messages are added to the queue. * Return TRUE if there is more to read. */ static int channel_parse_json(channel_T *channel, int part) { js_read_T reader; typval_T listtv; jsonq_T *item; chanpart_T *chanpart = &channel->ch_part[part]; jsonq_T *head = &chanpart->ch_json_head; int status; int ret; if (channel_peek(channel, part) == NULL) return FALSE; reader.js_buf = channel_get(channel, part); reader.js_used = 0; reader.js_fill = channel_fill; reader.js_cookie = channel; reader.js_cookie_arg = part; /* When a message is incomplete we wait for a short while for more to * arrive. After the delay drop the input, otherwise a truncated string * or list will make us hang. */ status = json_decode(&reader, &listtv, chanpart->ch_mode == MODE_JS ? JSON_JS : 0); if (status == OK) { /* Only accept the response when it is a list with at least two * items. */ if (listtv.v_type != VAR_LIST || listtv.vval.v_list->lv_len < 2) { if (listtv.v_type != VAR_LIST) ch_error(channel, "Did not receive a list, discarding"); else ch_errorn(channel, "Expected list with two items, got %d", listtv.vval.v_list->lv_len); clear_tv(&listtv); } else { item = (jsonq_T *)alloc((unsigned)sizeof(jsonq_T)); if (item == NULL) clear_tv(&listtv); else { item->jq_value = alloc_tv(); if (item->jq_value == NULL) { vim_free(item); clear_tv(&listtv); } else { *item->jq_value = listtv; item->jq_prev = head->jq_prev; head->jq_prev = item; item->jq_next = NULL; if (item->jq_prev == NULL) head->jq_next = item; else item->jq_prev->jq_next = item; } } } } if (status == OK) chanpart->ch_waiting = FALSE; else if (status == MAYBE) { if (!chanpart->ch_waiting) { /* First time encountering incomplete message, set a deadline of * 100 msec. */ ch_log(channel, "Incomplete message - wait for more"); reader.js_used = 0; chanpart->ch_waiting = TRUE; #ifdef WIN32 chanpart->ch_deadline = GetTickCount() + 100L; #else gettimeofday(&chanpart->ch_deadline, NULL); chanpart->ch_deadline.tv_usec += 100 * 1000; if (chanpart->ch_deadline.tv_usec > 1000 * 1000) { chanpart->ch_deadline.tv_usec -= 1000 * 1000; ++chanpart->ch_deadline.tv_sec; } #endif } else { int timeout; #ifdef WIN32 timeout = GetTickCount() > chanpart->ch_deadline; #else { struct timeval now_tv; gettimeofday(&now_tv, NULL); timeout = now_tv.tv_sec > chanpart->ch_deadline.tv_sec || (now_tv.tv_sec == chanpart->ch_deadline.tv_sec && now_tv.tv_usec > chanpart->ch_deadline.tv_usec); } #endif if (timeout) { status = FAIL; chanpart->ch_waiting = FALSE; } else { reader.js_used = 0; ch_log(channel, "still waiting on incomplete message"); } } } if (status == FAIL) { ch_error(channel, "Decoding failed - discarding input"); ret = FALSE; chanpart->ch_waiting = FALSE; } else if (reader.js_buf[reader.js_used] != NUL) { /* Put the unread part back into the channel. */ channel_save(channel, part, reader.js_buf + reader.js_used, (int)(reader.js_end - reader.js_buf) - reader.js_used, TRUE, NULL); ret = status == MAYBE ? FALSE: TRUE; } else ret = FALSE; vim_free(reader.js_buf); return ret; } /* * Remove "node" from the queue that it is in. Does not free it. */ static void remove_cb_node(cbq_T *head, cbq_T *node) { if (node->cq_prev == NULL) head->cq_next = node->cq_next; else node->cq_prev->cq_next = node->cq_next; if (node->cq_next == NULL) head->cq_prev = node->cq_prev; else node->cq_next->cq_prev = node->cq_prev; } /* * Remove "node" from the queue that it is in and free it. * Caller should have freed or used node->jq_value. */ static void remove_json_node(jsonq_T *head, jsonq_T *node) { if (node->jq_prev == NULL) head->jq_next = node->jq_next; else node->jq_prev->jq_next = node->jq_next; if (node->jq_next == NULL) head->jq_prev = node->jq_prev; else node->jq_next->jq_prev = node->jq_prev; vim_free(node); } /* * Get a message from the JSON queue for channel "channel". * When "id" is positive it must match the first number in the list. * When "id" is zero or negative jut get the first message. But not the one * with id ch_block_id. * Return OK when found and return the value in "rettv". * Return FAIL otherwise. */ static int channel_get_json(channel_T *channel, int part, int id, typval_T **rettv) { jsonq_T *head = &channel->ch_part[part].ch_json_head; jsonq_T *item = head->jq_next; while (item != NULL) { list_T *l = item->jq_value->vval.v_list; typval_T *tv = &l->lv_first->li_tv; if ((id > 0 && tv->v_type == VAR_NUMBER && tv->vval.v_number == id) || (id <= 0 && (tv->v_type != VAR_NUMBER || tv->vval.v_number == 0 || tv->vval.v_number != channel->ch_part[part].ch_block_id))) { *rettv = item->jq_value; if (tv->v_type == VAR_NUMBER) ch_logn(channel, "Getting JSON message %d", tv->vval.v_number); remove_json_node(head, item); return OK; } item = item->jq_next; } return FAIL; } #define CH_JSON_MAX_ARGS 4 /* * Execute a command received over "channel"/"part" * "argv[0]" is the command string. * "argv[1]" etc. have further arguments, type is VAR_UNKNOWN if missing. */ static void channel_exe_cmd(channel_T *channel, int part, typval_T *argv) { char_u *cmd = argv[0].vval.v_string; char_u *arg; int options = channel->ch_part[part].ch_mode == MODE_JS ? JSON_JS : 0; if (argv[1].v_type != VAR_STRING) { ch_error(channel, "received command with non-string argument"); if (p_verbose > 2) EMSG("E903: received command with non-string argument"); return; } arg = argv[1].vval.v_string; if (arg == NULL) arg = (char_u *)""; if (STRCMP(cmd, "ex") == 0) { int save_called_emsg = called_emsg; called_emsg = FALSE; ch_logs(channel, "Executing ex command '%s'", (char *)arg); ++emsg_silent; do_cmdline_cmd(arg); --emsg_silent; if (called_emsg) ch_logs(channel, "Ex command error: '%s'", (char *)get_vim_var_str(VV_ERRMSG)); called_emsg = save_called_emsg; } else if (STRCMP(cmd, "normal") == 0) { exarg_T ea; ch_logs(channel, "Executing normal command '%s'", (char *)arg); ea.arg = arg; ea.addr_count = 0; ea.forceit = TRUE; /* no mapping */ ex_normal(&ea); } else if (STRCMP(cmd, "redraw") == 0) { exarg_T ea; ch_log(channel, "redraw"); ea.forceit = *arg != NUL; ex_redraw(&ea); showruler(FALSE); setcursor(); out_flush(); #ifdef FEAT_GUI if (gui.in_use) { gui_update_cursor(FALSE, FALSE); gui_mch_flush(); } #endif } else if (STRCMP(cmd, "expr") == 0 || STRCMP(cmd, "call") == 0) { int is_call = cmd[0] == 'c'; int id_idx = is_call ? 3 : 2; if (argv[id_idx].v_type != VAR_UNKNOWN && argv[id_idx].v_type != VAR_NUMBER) { ch_error(channel, "last argument for expr/call must be a number"); if (p_verbose > 2) EMSG("E904: last argument for expr/call must be a number"); } else if (is_call && argv[2].v_type != VAR_LIST) { ch_error(channel, "third argument for call must be a list"); if (p_verbose > 2) EMSG("E904: third argument for call must be a list"); } else { typval_T *tv; typval_T res_tv; typval_T err_tv; char_u *json = NULL; /* Don't pollute the display with errors. */ ++emsg_skip; if (!is_call) { ch_logs(channel, "Evaluating expression '%s'", (char *)arg); tv = eval_expr(arg, NULL); } else { ch_logs(channel, "Calling '%s'", (char *)arg); if (func_call(arg, &argv[2], NULL, NULL, &res_tv) == OK) tv = &res_tv; else tv = NULL; } if (argv[id_idx].v_type == VAR_NUMBER) { int id = argv[id_idx].vval.v_number; if (tv != NULL) json = json_encode_nr_expr(id, tv, options); if (tv == NULL || (json != NULL && *json == NUL)) { /* If evaluation failed or the result can't be encoded * then return the string "ERROR". */ vim_free(json); free_tv(tv); err_tv.v_type = VAR_STRING; err_tv.vval.v_string = (char_u *)"ERROR"; tv = &err_tv; json = json_encode_nr_expr(id, tv, options); } if (json != NULL) { channel_send(channel, part == PART_SOCK ? PART_SOCK : PART_IN, json, (char *)cmd); vim_free(json); } } --emsg_skip; if (tv == &res_tv) clear_tv(tv); else if (tv != &err_tv) free_tv(tv); } } else if (p_verbose > 2) { ch_errors(channel, "Receved unknown command: %s", (char *)cmd); EMSG2("E905: received unknown command: %s", cmd); } } static void invoke_one_time_callback( channel_T *channel, cbq_T *cbhead, cbq_T *item, typval_T *argv) { ch_logs(channel, "Invoking one-time callback %s", (char *)item->cq_callback); /* Remove the item from the list first, if the callback * invokes ch_close() the list will be cleared. */ remove_cb_node(cbhead, item); invoke_callback(channel, item->cq_callback, item->cq_partial, argv); vim_free(item->cq_callback); partial_unref(item->cq_partial); vim_free(item); } static void append_to_buffer(buf_T *buffer, char_u *msg, channel_T *channel) { buf_T *save_curbuf = curbuf; linenr_T lnum = buffer->b_ml.ml_line_count; int save_write_to = buffer->b_write_to_channel; /* If the buffer is also used as input insert above the last * line. Don't write these lines. */ if (save_write_to) { --lnum; buffer->b_write_to_channel = FALSE; } /* Append to the buffer */ ch_logn(channel, "appending line %d to buffer", (int)lnum + 1); curbuf = buffer; u_sync(TRUE); /* ignore undo failure, undo is not very useful here */ ignored = u_save(lnum, lnum + 1); ml_append(lnum, msg, 0, FALSE); appended_lines_mark(lnum, 1L); curbuf = save_curbuf; if (buffer->b_nwindows > 0) { win_T *wp; win_T *save_curwin; FOR_ALL_WINDOWS(wp) { if (wp->w_buffer == buffer && (save_write_to ? wp->w_cursor.lnum == lnum + 1 : (wp->w_cursor.lnum == lnum && wp->w_cursor.col == 0))) { ++wp->w_cursor.lnum; save_curwin = curwin; curwin = wp; curbuf = curwin->w_buffer; scroll_cursor_bot(0, FALSE); curwin = save_curwin; curbuf = curwin->w_buffer; } } redraw_buf_later(buffer, VALID); channel_need_redraw = TRUE; } if (save_write_to) { channel_T *ch; /* Find channels reading from this buffer and adjust their * next-to-read line number. */ buffer->b_write_to_channel = TRUE; for (ch = first_channel; ch != NULL; ch = ch->ch_next) { chanpart_T *in_part = &ch->ch_part[PART_IN]; if (in_part->ch_buffer == buffer) in_part->ch_buf_bot = buffer->b_ml.ml_line_count; } } } /* * Invoke a callback for "channel"/"part" if needed. * Return TRUE when a message was handled, there might be another one. */ static int may_invoke_callback(channel_T *channel, int part) { char_u *msg = NULL; typval_T *listtv = NULL; typval_T argv[CH_JSON_MAX_ARGS]; int seq_nr = -1; ch_mode_T ch_mode = channel->ch_part[part].ch_mode; cbq_T *cbhead = &channel->ch_part[part].ch_cb_head; cbq_T *cbitem; char_u *callback = NULL; partial_T *partial = NULL; buf_T *buffer = NULL; if (channel->ch_nb_close_cb != NULL) /* this channel is handled elsewhere (netbeans) */ return FALSE; /* Use a message-specific callback, part callback or channel callback */ for (cbitem = cbhead->cq_next; cbitem != NULL; cbitem = cbitem->cq_next) if (cbitem->cq_seq_nr == 0) break; if (cbitem != NULL) { callback = cbitem->cq_callback; partial = cbitem->cq_partial; } else if (channel->ch_part[part].ch_callback != NULL) { callback = channel->ch_part[part].ch_callback; partial = channel->ch_part[part].ch_partial; } else { callback = channel->ch_callback; partial = channel->ch_partial; } buffer = channel->ch_part[part].ch_buffer; if (buffer != NULL && !buf_valid(buffer)) { /* buffer was wiped out */ channel->ch_part[part].ch_buffer = NULL; buffer = NULL; } if (ch_mode == MODE_JSON || ch_mode == MODE_JS) { listitem_T *item; int argc = 0; /* Get any json message in the queue. */ if (channel_get_json(channel, part, -1, &listtv) == FAIL) { /* Parse readahead, return when there is still no message. */ channel_parse_json(channel, part); if (channel_get_json(channel, part, -1, &listtv) == FAIL) return FALSE; } for (item = listtv->vval.v_list->lv_first; item != NULL && argc < CH_JSON_MAX_ARGS; item = item->li_next) argv[argc++] = item->li_tv; while (argc < CH_JSON_MAX_ARGS) argv[argc++].v_type = VAR_UNKNOWN; if (argv[0].v_type == VAR_STRING) { /* ["cmd", arg] or ["cmd", arg, arg] or ["cmd", arg, arg, arg] */ channel_exe_cmd(channel, part, argv); free_tv(listtv); return TRUE; } if (argv[0].v_type != VAR_NUMBER) { ch_error(channel, "Dropping message with invalid sequence number type"); free_tv(listtv); return FALSE; } seq_nr = argv[0].vval.v_number; } else if (channel_peek(channel, part) == NULL) { /* nothing to read on RAW or NL channel */ return FALSE; } else { /* If there is no callback or buffer drop the message. */ if (callback == NULL && buffer == NULL) { while ((msg = channel_get(channel, part)) != NULL) { ch_logs(channel, "Dropping message '%s'", (char *)msg); vim_free(msg); } return FALSE; } if (ch_mode == MODE_NL) { char_u *nl; char_u *buf; /* See if we have a message ending in NL in the first buffer. If * not try to concatenate the first and the second buffer. */ while (TRUE) { buf = channel_peek(channel, part); nl = vim_strchr(buf, NL); if (nl != NULL) break; if (channel_collapse(channel, part) == FAIL) return FALSE; /* incomplete message */ } if (nl[1] == NUL) { /* get the whole buffer, drop the NL */ msg = channel_get(channel, part); *nl = NUL; } else { /* Copy the message into allocated memory and remove it from * the buffer. */ msg = vim_strnsave(buf, (int)(nl - buf)); mch_memmove(buf, nl + 1, STRLEN(nl + 1) + 1); } } else /* For a raw channel we don't know where the message ends, just * get everything we have. */ msg = channel_get_all(channel, part); if (msg == NULL) return FALSE; /* out of memory (and avoids Coverity warning) */ argv[1].v_type = VAR_STRING; argv[1].vval.v_string = msg; } if (seq_nr > 0) { int done = FALSE; /* invoke the one-time callback with the matching nr */ for (cbitem = cbhead->cq_next; cbitem != NULL; cbitem = cbitem->cq_next) if (cbitem->cq_seq_nr == seq_nr) { invoke_one_time_callback(channel, cbhead, cbitem, argv); done = TRUE; break; } if (!done) ch_logn(channel, "Dropping message %d without callback", seq_nr); } else if (callback != NULL || buffer != NULL) { if (buffer != NULL) { if (msg == NULL) /* JSON or JS mode: re-encode the message. */ msg = json_encode(listtv, ch_mode); if (msg != NULL) append_to_buffer(buffer, msg, channel); } if (callback != NULL) { if (cbitem != NULL) invoke_one_time_callback(channel, cbhead, cbitem, argv); else { /* invoke the channel callback */ ch_logs(channel, "Invoking channel callback %s", (char *)callback); invoke_callback(channel, callback, partial, argv); } } } else ch_log(channel, "Dropping message"); if (listtv != NULL) free_tv(listtv); vim_free(msg); return TRUE; } /* * Return TRUE when channel "channel" is open for writing to. * Also returns FALSE or invalid "channel". */ int channel_can_write_to(channel_T *channel) { return channel != NULL && (channel->CH_SOCK_FD != INVALID_FD || channel->CH_IN_FD != INVALID_FD); } /* * Return TRUE when channel "channel" is open for reading or writing. * Also returns FALSE for invalid "channel". */ int channel_is_open(channel_T *channel) { return channel != NULL && (channel->CH_SOCK_FD != INVALID_FD || channel->CH_IN_FD != INVALID_FD || channel->CH_OUT_FD != INVALID_FD || channel->CH_ERR_FD != INVALID_FD); } /* * Return a string indicating the status of the channel. */ char * channel_status(channel_T *channel) { if (channel == NULL) return "fail"; if (channel_is_open(channel)) return "open"; return "closed"; } static void channel_part_info(channel_T *channel, dict_T *dict, char *name, int part) { chanpart_T *chanpart = &channel->ch_part[part]; char namebuf[20]; /* longest is "sock_timeout" */ size_t tail; char *s = ""; vim_strncpy((char_u *)namebuf, (char_u *)name, 4); STRCAT(namebuf, "_"); tail = STRLEN(namebuf); STRCPY(namebuf + tail, "status"); dict_add_nr_str(dict, namebuf, 0, (char_u *)(chanpart->ch_fd == INVALID_FD ? "closed" : "open")); STRCPY(namebuf + tail, "mode"); switch (chanpart->ch_mode) { case MODE_NL: s = "NL"; break; case MODE_RAW: s = "RAW"; break; case MODE_JSON: s = "JSON"; break; case MODE_JS: s = "JS"; break; } dict_add_nr_str(dict, namebuf, 0, (char_u *)s); STRCPY(namebuf + tail, "io"); if (part == PART_SOCK) s = "socket"; else switch (chanpart->ch_io) { case JIO_NULL: s = "null"; break; case JIO_PIPE: s = "pipe"; break; case JIO_FILE: s = "file"; break; case JIO_BUFFER: s = "buffer"; break; case JIO_OUT: s = "out"; break; } dict_add_nr_str(dict, namebuf, 0, (char_u *)s); STRCPY(namebuf + tail, "timeout"); dict_add_nr_str(dict, namebuf, chanpart->ch_timeout, NULL); } void channel_info(channel_T *channel, dict_T *dict) { dict_add_nr_str(dict, "id", channel->ch_id, NULL); dict_add_nr_str(dict, "status", 0, (char_u *)channel_status(channel)); if (channel->ch_hostname != NULL) { dict_add_nr_str(dict, "hostname", 0, (char_u *)channel->ch_hostname); dict_add_nr_str(dict, "port", channel->ch_port, NULL); channel_part_info(channel, dict, "sock", PART_SOCK); } else { channel_part_info(channel, dict, "out", PART_OUT); channel_part_info(channel, dict, "err", PART_ERR); channel_part_info(channel, dict, "in", PART_IN); } } /* * Close channel "channel". * Trigger the close callback if "invoke_close_cb" is TRUE. * Does not clear the buffers. */ void channel_close(channel_T *channel, int invoke_close_cb) { ch_log(channel, "Closing channel"); #ifdef FEAT_GUI channel_gui_unregister(channel); #endif if (channel->CH_SOCK_FD != INVALID_FD) { sock_close(channel->CH_SOCK_FD); channel->CH_SOCK_FD = INVALID_FD; } may_close_part(&channel->CH_IN_FD); may_close_part(&channel->CH_OUT_FD); may_close_part(&channel->CH_ERR_FD); if (invoke_close_cb && channel->ch_close_cb != NULL) { typval_T argv[1]; typval_T rettv; int dummy; /* invoke the close callback; increment the refcount to avoid it * being freed halfway */ ch_logs(channel, "Invoking close callback %s", (char *)channel->ch_close_cb); argv[0].v_type = VAR_CHANNEL; argv[0].vval.v_channel = channel; ++channel->ch_refcount; call_func(channel->ch_close_cb, (int)STRLEN(channel->ch_close_cb), &rettv, 1, argv, 0L, 0L, &dummy, TRUE, channel->ch_close_partial, NULL); clear_tv(&rettv); --channel->ch_refcount; /* the callback is only called once */ vim_free(channel->ch_close_cb); channel->ch_close_cb = NULL; partial_unref(channel->ch_close_partial); channel->ch_close_partial = NULL; } channel->ch_nb_close_cb = NULL; } /* * Return the first buffer from "channel"/"part" without removing it. * Returns NULL if there is nothing. */ char_u * channel_peek(channel_T *channel, int part) { readq_T *head = &channel->ch_part[part].ch_head; if (head->rq_next == NULL) return NULL; return head->rq_next->rq_buffer; } /* * Clear the read buffer on "channel"/"part". */ static void channel_clear_one(channel_T *channel, int part) { jsonq_T *json_head = &channel->ch_part[part].ch_json_head; cbq_T *cb_head = &channel->ch_part[part].ch_cb_head; while (channel_peek(channel, part) != NULL) vim_free(channel_get(channel, part)); while (cb_head->cq_next != NULL) { cbq_T *node = cb_head->cq_next; remove_cb_node(cb_head, node); vim_free(node->cq_callback); partial_unref(node->cq_partial); vim_free(node); } while (json_head->jq_next != NULL) { free_tv(json_head->jq_next->jq_value); remove_json_node(json_head, json_head->jq_next); } vim_free(channel->ch_part[part].ch_callback); channel->ch_part[part].ch_callback = NULL; partial_unref(channel->ch_part[part].ch_partial); channel->ch_part[part].ch_partial = NULL; } /* * Clear all the read buffers on "channel". */ void channel_clear(channel_T *channel) { ch_log(channel, "Clearing channel"); vim_free(channel->ch_hostname); channel->ch_hostname = NULL; channel_clear_one(channel, PART_SOCK); channel_clear_one(channel, PART_OUT); channel_clear_one(channel, PART_ERR); vim_free(channel->ch_callback); channel->ch_callback = NULL; partial_unref(channel->ch_partial); channel->ch_partial = NULL; vim_free(channel->ch_close_cb); channel->ch_close_cb = NULL; partial_unref(channel->ch_close_partial); channel->ch_close_partial = NULL; } #if defined(EXITFREE) || defined(PROTO) void channel_free_all(void) { channel_T *channel; ch_log(NULL, "channel_free_all()"); for (channel = first_channel; channel != NULL; channel = channel->ch_next) channel_clear(channel); } #endif /* Sent when the channel is found closed when reading. */ #define DETACH_MSG_RAW "DETACH\n" /* Buffer size for reading incoming messages. */ #define MAXMSGSIZE 4096 #if defined(HAVE_SELECT) /* * Add write fds where we are waiting for writing to be possible. */ static int channel_fill_wfds(int maxfd_arg, fd_set *wfds) { int maxfd = maxfd_arg; channel_T *ch; for (ch = first_channel; ch != NULL; ch = ch->ch_next) { chanpart_T *in_part = &ch->ch_part[PART_IN]; if (in_part->ch_fd != INVALID_FD && in_part->ch_buffer != NULL) { FD_SET((int)in_part->ch_fd, wfds); if ((int)in_part->ch_fd >= maxfd) maxfd = (int)in_part->ch_fd + 1; } } return maxfd; } #else /* * Add write fds where we are waiting for writing to be possible. */ static int channel_fill_poll_write(int nfd_in, struct pollfd *fds) { int nfd = nfd_in; channel_T *ch; for (ch = first_channel; ch != NULL; ch = ch->ch_next) { chanpart_T *in_part = &ch->ch_part[PART_IN]; if (in_part->ch_fd != INVALID_FD && in_part->ch_buffer != NULL) { in_part->ch_poll_idx = nfd; fds[nfd].fd = in_part->ch_fd; fds[nfd].events = POLLOUT; ++nfd; } else in_part->ch_poll_idx = -1; } return nfd; } #endif /* * Check for reading from "fd" with "timeout" msec. * Return FAIL when there is nothing to read. */ static int channel_wait(channel_T *channel, sock_T fd, int timeout) { if (timeout > 0) ch_logn(channel, "Waiting for up to %d msec", timeout); # ifdef WIN32 if (fd != channel->CH_SOCK_FD) { DWORD nread; int sleep_time; DWORD deadline = GetTickCount() + timeout; int delay = 1; /* reading from a pipe, not a socket */ while (TRUE) { if (PeekNamedPipe((HANDLE)fd, NULL, 0, NULL, &nread, NULL) && nread > 0) return OK; /* perhaps write some buffer lines */ channel_write_any_lines(); sleep_time = deadline - GetTickCount(); if (sleep_time <= 0) break; /* Wait for a little while. Very short at first, up to 10 msec * after looping a few times. */ if (sleep_time > delay) sleep_time = delay; Sleep(sleep_time); delay = delay * 2; if (delay > 10) delay = 10; } } else #endif { #if defined(HAVE_SELECT) struct timeval tval; fd_set rfds; fd_set wfds; int ret; int maxfd; tval.tv_sec = timeout / 1000; tval.tv_usec = (timeout % 1000) * 1000; for (;;) { FD_ZERO(&rfds); FD_SET((int)fd, &rfds); /* Write lines to a pipe when a pipe can be written to. Need to * set this every time, some buffers may be done. */ maxfd = (int)fd + 1; FD_ZERO(&wfds); maxfd = channel_fill_wfds(maxfd, &wfds); ret = select(maxfd, &rfds, &wfds, NULL, &tval); # ifdef EINTR SOCK_ERRNO; if (ret == -1 && errno == EINTR) continue; # endif if (ret > 0) { if (FD_ISSET(fd, &rfds)) return OK; channel_write_any_lines(); continue; } break; } #else for (;;) { struct pollfd fds[MAX_OPEN_CHANNELS + 1]; int nfd = 1; fds[0].fd = fd; fds[0].events = POLLIN; nfd = channel_fill_poll_write(nfd, fds); if (poll(fds, nfd, timeout) > 0) { if (fds[0].revents & POLLIN) return OK; channel_write_any_lines(); continue; } break; } #endif } return FAIL; } /* * Read from channel "channel" for as long as there is something to read. * "part" is PART_SOCK, PART_OUT or PART_ERR. * The data is put in the read queue. */ void channel_read(channel_T *channel, int part, char *func) { static char_u *buf = NULL; int len = 0; int readlen = 0; sock_T fd; int use_socket = FALSE; fd = channel->ch_part[part].ch_fd; if (fd == INVALID_FD) { ch_error(channel, "channel_read() called while socket is closed"); return; } use_socket = fd == channel->CH_SOCK_FD; /* 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. * Use select() or poll() to avoid blocking on a message that is exactly * MAXMSGSIZE long. */ for (;;) { if (channel_wait(channel, fd, 0) == FAIL) break; if (use_socket) len = sock_read(fd, (char *)buf, MAXMSGSIZE); else len = fd_read(fd, (char *)buf, MAXMSGSIZE); if (len <= 0) break; /* error or nothing more to read */ /* Store the read message in the queue. */ channel_save(channel, part, buf, len, FALSE, "RECV "); readlen += len; if (len < MAXMSGSIZE) break; /* did read everything that's available */ } /* Reading a disconnection (readlen == 0), or an error. */ if (readlen <= 0) { /* Do not give an error message, most likely the other end just * exited. */ ch_errors(channel, "%s(): Cannot read from channel", func); /* Queue a "DETACH" netbeans message in the command queue in order to * terminate the netbeans session later. Do not end the session here * directly as we may be running in the context of a call to * netbeans_parse_messages(): * netbeans_parse_messages * -> autocmd triggered while processing the netbeans cmd * -> ui_breakcheck * -> gui event loop or select loop * -> channel_read() * Don't send "DETACH" for a JS or JSON channel. */ if (channel->ch_part[part].ch_mode == MODE_RAW || channel->ch_part[part].ch_mode == MODE_NL) channel_save(channel, part, (char_u *)DETACH_MSG_RAW, (int)STRLEN(DETACH_MSG_RAW), FALSE, "PUT "); /* When reading from stdout is not possible, assume the other side has * died. */ channel_close(channel, TRUE); if (channel->ch_nb_close_cb != NULL) (*channel->ch_nb_close_cb)(); } #if defined(CH_HAS_GUI) && defined(FEAT_GUI_GTK) /* signal the main loop that there is something to read */ if (CH_HAS_GUI && gtk_main_level() > 0) gtk_main_quit(); #endif } /* * Read from RAW or NL "channel"/"part". Blocks until there is something to * read or the timeout expires. * Returns what was read in allocated memory. * Returns NULL in case of error or timeout. */ char_u * channel_read_block(channel_T *channel, int part, int timeout) { char_u *buf; char_u *msg; ch_mode_T mode = channel->ch_part[part].ch_mode; sock_T fd = channel->ch_part[part].ch_fd; char_u *nl; ch_logsn(channel, "Blocking %s read, timeout: %d msec", mode == MODE_RAW ? "RAW" : "NL", timeout); while (TRUE) { buf = channel_peek(channel, part); if (buf != NULL && (mode == MODE_RAW || (mode == MODE_NL && vim_strchr(buf, NL) != NULL))) break; if (buf != NULL && channel_collapse(channel, part) == OK) continue; /* Wait for up to the channel timeout. */ if (fd == INVALID_FD) return NULL; if (channel_wait(channel, fd, timeout) == FAIL) { ch_log(channel, "Timed out"); return NULL; } channel_read(channel, part, "channel_read_block"); } if (mode == MODE_RAW) { msg = channel_get_all(channel, part); } else { nl = vim_strchr(buf, NL); if (nl[1] == NUL) { /* get the whole buffer */ msg = channel_get(channel, part); *nl = NUL; } else { /* Copy the message into allocated memory and remove it from the * buffer. */ msg = vim_strnsave(buf, (int)(nl - buf)); mch_memmove(buf, nl + 1, STRLEN(nl + 1) + 1); } } if (log_fd != NULL) ch_logn(channel, "Returning %d bytes", (int)STRLEN(msg)); return msg; } /* * Read one JSON message with ID "id" from "channel"/"part" and store the * result in "rettv". * When "id" is -1 accept any message; * Blocks until the message is received or the timeout is reached. */ int channel_read_json_block( channel_T *channel, int part, int timeout_arg, int id, typval_T **rettv) { int more; sock_T fd; int timeout; chanpart_T *chanpart = &channel->ch_part[part]; ch_log(channel, "Reading JSON"); if (id != -1) chanpart->ch_block_id = id; for (;;) { more = channel_parse_json(channel, part); /* search for messsage "id" */ if (channel_get_json(channel, part, id, rettv) == OK) { chanpart->ch_block_id = 0; return OK; } if (!more) { /* Handle any other messages in the queue. If done some more * messages may have arrived. */ if (channel_parse_messages()) continue; /* Wait for up to the timeout. If there was an incomplete message * use the deadline for that. */ timeout = timeout_arg; if (chanpart->ch_waiting) { #ifdef WIN32 timeout = chanpart->ch_deadline - GetTickCount() + 1; #else { struct timeval now_tv; gettimeofday(&now_tv, NULL); timeout = (chanpart->ch_deadline.tv_sec - now_tv.tv_sec) * 1000 + (chanpart->ch_deadline.tv_usec - now_tv.tv_usec) / 1000 + 1; } #endif if (timeout < 0) { /* Something went wrong, channel_parse_json() didn't * discard message. Cancel waiting. */ chanpart->ch_waiting = FALSE; timeout = timeout_arg; } else if (timeout > timeout_arg) timeout = timeout_arg; } fd = chanpart->ch_fd; if (fd == INVALID_FD || channel_wait(channel, fd, timeout) == FAIL) { if (timeout == timeout_arg) { if (fd != INVALID_FD) ch_log(channel, "Timed out"); break; } } else channel_read(channel, part, "channel_read_json_block"); } } chanpart->ch_block_id = 0; return FAIL; } /* * Common for ch_read() and ch_readraw(). */ void common_channel_read(typval_T *argvars, typval_T *rettv, int raw) { channel_T *channel; int part; jobopt_T opt; int mode; int timeout; int id = -1; typval_T *listtv = NULL; /* return an empty string by default */ rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; clear_job_options(&opt); if (get_job_options(&argvars[1], &opt, JO_TIMEOUT + JO_PART + JO_ID) == FAIL) return; channel = get_channel_arg(&argvars[0], TRUE); if (channel != NULL) { if (opt.jo_set & JO_PART) part = opt.jo_part; else part = channel_part_read(channel); mode = channel_get_mode(channel, part); timeout = channel_get_timeout(channel, part); if (opt.jo_set & JO_TIMEOUT) timeout = opt.jo_timeout; if (raw || mode == MODE_RAW || mode == MODE_NL) rettv->vval.v_string = channel_read_block(channel, part, timeout); else { if (opt.jo_set & JO_ID) id = opt.jo_id; channel_read_json_block(channel, part, timeout, id, &listtv); if (listtv != NULL) { *rettv = *listtv; vim_free(listtv); } else { rettv->v_type = VAR_SPECIAL; rettv->vval.v_number = VVAL_NONE; } } } } # if defined(WIN32) || defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK) \ || defined(PROTO) /* * Lookup the channel from the socket. Set "partp" to the fd index. * Returns NULL when the socket isn't found. */ channel_T * channel_fd2channel(sock_T fd, int *partp) { channel_T *channel; int part; if (fd != INVALID_FD) for (channel = first_channel; channel != NULL; channel = channel->ch_next) { for (part = PART_SOCK; part < PART_IN; ++part) if (channel->ch_part[part].ch_fd == fd) { *partp = part; return channel; } } return NULL; } # endif # if defined(WIN32) || defined(PROTO) /* * Check the channels for anything that is ready to be read. * The data is put in the read queue. */ void channel_handle_events(void) { channel_T *channel; int part; sock_T fd; for (channel = first_channel; channel != NULL; channel = channel->ch_next) { /* check the socket and pipes */ for (part = PART_SOCK; part <= PART_ERR; ++part) { fd = channel->ch_part[part].ch_fd; if (fd != INVALID_FD && channel_wait(channel, fd, 0) == OK) channel_read(channel, part, "channel_handle_events"); } } } # endif /* * Write "buf" (NUL terminated string) to "channel"/"part". * When "fun" is not NULL an error message might be given. * Return FAIL or OK. */ int channel_send(channel_T *channel, int part, char_u *buf, char *fun) { int len = (int)STRLEN(buf); int res; sock_T fd; fd = channel->ch_part[part].ch_fd; if (fd == INVALID_FD) { if (!channel->ch_error && fun != NULL) { ch_errors(channel, "%s(): write while not connected", fun); EMSG2("E630: %s(): write while not connected", fun); } channel->ch_error = TRUE; return FAIL; } if (log_fd != NULL) { ch_log_lead("SEND ", channel); fprintf(log_fd, "'"); ignored = (int)fwrite(buf, len, 1, log_fd); fprintf(log_fd, "'\n"); fflush(log_fd); did_log_msg = TRUE; } if (part == PART_SOCK) res = sock_write(fd, (char *)buf, len); else res = fd_write(fd, (char *)buf, len); if (res != len) { if (!channel->ch_error && fun != NULL) { ch_errors(channel, "%s(): write failed", fun); EMSG2("E631: %s(): write failed", fun); } channel->ch_error = TRUE; return FAIL; } channel->ch_error = FALSE; return OK; } /* * Common for "ch_sendexpr()" and "ch_sendraw()". * Returns the channel if the caller should read the response. * Sets "part_read" to the the read fd. * Otherwise returns NULL. */ channel_T * send_common( typval_T *argvars, char_u *text, int id, int eval, jobopt_T *opt, char *fun, int *part_read) { channel_T *channel; int part_send; channel = get_channel_arg(&argvars[0], TRUE); if (channel == NULL) return NULL; part_send = channel_part_send(channel); *part_read = channel_part_read(channel); clear_job_options(opt); if (get_job_options(&argvars[2], opt, JO_CALLBACK + JO_TIMEOUT) == FAIL) return NULL; /* Set the callback. An empty callback means no callback and not reading * the response. With "ch_evalexpr()" and "ch_evalraw()" a callback is not * allowed. */ if (opt->jo_callback != NULL && *opt->jo_callback != NUL) { if (eval) { EMSG2(_("E917: Cannot use a callback with %s()"), fun); return NULL; } channel_set_req_callback(channel, part_send, opt->jo_callback, opt->jo_partial, id); } if (channel_send(channel, part_send, text, fun) == OK && opt->jo_callback == NULL) return channel; return NULL; } /* * common for "ch_evalexpr()" and "ch_sendexpr()" */ void ch_expr_common(typval_T *argvars, typval_T *rettv, int eval) { char_u *text; typval_T *listtv; channel_T *channel; int id; ch_mode_T ch_mode; int part_send; int part_read; jobopt_T opt; int timeout; /* return an empty string by default */ rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; channel = get_channel_arg(&argvars[0], TRUE); if (channel == NULL) return; part_send = channel_part_send(channel); ch_mode = channel_get_mode(channel, part_send); if (ch_mode == MODE_RAW || ch_mode == MODE_NL) { EMSG(_("E912: cannot use ch_evalexpr()/ch_sendexpr() with a raw or nl channel")); return; } id = ++channel->ch_last_msg_id; text = json_encode_nr_expr(id, &argvars[1], ch_mode == MODE_JS ? JSON_JS : 0); if (text == NULL) return; channel = send_common(argvars, text, id, eval, &opt, eval ? "ch_evalexpr" : "ch_sendexpr", &part_read); vim_free(text); if (channel != NULL && eval) { if (opt.jo_set & JO_TIMEOUT) timeout = opt.jo_timeout; else timeout = channel_get_timeout(channel, part_read); if (channel_read_json_block(channel, part_read, timeout, id, &listtv) == OK) { list_T *list = listtv->vval.v_list; /* Move the item from the list and then change the type to * avoid the value being freed. */ *rettv = list->lv_last->li_tv; list->lv_last->li_tv.v_type = VAR_NUMBER; free_tv(listtv); } } } /* * common for "ch_evalraw()" and "ch_sendraw()" */ void ch_raw_common(typval_T *argvars, typval_T *rettv, int eval) { char_u buf[NUMBUFLEN]; char_u *text; channel_T *channel; int part_read; jobopt_T opt; int timeout; /* return an empty string by default */ rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; text = get_tv_string_buf(&argvars[1], buf); channel = send_common(argvars, text, 0, eval, &opt, eval ? "ch_evalraw" : "ch_sendraw", &part_read); if (channel != NULL && eval) { if (opt.jo_set & JO_TIMEOUT) timeout = opt.jo_timeout; else timeout = channel_get_timeout(channel, part_read); rettv->vval.v_string = channel_read_block(channel, part_read, timeout); } } # if (defined(UNIX) && !defined(HAVE_SELECT)) || defined(PROTO) /* * Add open channels to the poll struct. * Return the adjusted struct index. * The type of "fds" is hidden to avoid problems with the function proto. */ int channel_poll_setup(int nfd_in, void *fds_in) { int nfd = nfd_in; channel_T *channel; struct pollfd *fds = fds_in; int part; for (channel = first_channel; channel != NULL; channel = channel->ch_next) { for (part = PART_SOCK; part < PART_IN; ++part) { chanpart_T *ch_part = &channel->ch_part[part]; if (ch_part->ch_fd != INVALID_FD) { ch_part->ch_poll_idx = nfd; fds[nfd].fd = ch_part->ch_fd; fds[nfd].events = POLLIN; nfd++; } else channel->ch_part[part].ch_poll_idx = -1; } } nfd = channel_fill_poll_write(nfd, fds); return nfd; } /* * The type of "fds" is hidden to avoid problems with the function proto. */ int channel_poll_check(int ret_in, void *fds_in) { int ret = ret_in; channel_T *channel; struct pollfd *fds = fds_in; int part; int idx; chanpart_T *in_part; for (channel = first_channel; channel != NULL; channel = channel->ch_next) { for (part = PART_SOCK; part < PART_IN; ++part) { idx = channel->ch_part[part].ch_poll_idx; if (ret > 0 && idx != -1 && (fds[idx].revents & POLLIN)) { channel_read(channel, part, "channel_poll_check"); --ret; } } in_part = &channel->ch_part[PART_IN]; idx = in_part->ch_poll_idx; if (ret > 0 && idx != -1 && (fds[idx].revents & POLLOUT)) { if (in_part->ch_buf_append) { if (in_part->ch_buffer != NULL) channel_write_new_lines(in_part->ch_buffer); } else channel_write_in(channel); --ret; } } return ret; } # endif /* UNIX && !HAVE_SELECT */ # if (!defined(WIN32) && defined(HAVE_SELECT)) || defined(PROTO) /* * The "fd_set" type is hidden to avoid problems with the function proto. */ int channel_select_setup(int maxfd_in, void *rfds_in, void *wfds_in) { int maxfd = maxfd_in; channel_T *channel; fd_set *rfds = rfds_in; fd_set *wfds = wfds_in; int part; for (channel = first_channel; channel != NULL; channel = channel->ch_next) { for (part = PART_SOCK; part < PART_IN; ++part) { sock_T fd = channel->ch_part[part].ch_fd; if (fd != INVALID_FD) { FD_SET((int)fd, rfds); if (maxfd < (int)fd) maxfd = (int)fd; } } } maxfd = channel_fill_wfds(maxfd, wfds); return maxfd; } /* * The "fd_set" type is hidden to avoid problems with the function proto. */ int channel_select_check(int ret_in, void *rfds_in, void *wfds_in) { int ret = ret_in; channel_T *channel; fd_set *rfds = rfds_in; fd_set *wfds = wfds_in; int part; chanpart_T *in_part; for (channel = first_channel; channel != NULL; channel = channel->ch_next) { for (part = PART_SOCK; part < PART_IN; ++part) { sock_T fd = channel->ch_part[part].ch_fd; if (ret > 0 && fd != INVALID_FD && FD_ISSET(fd, rfds)) { channel_read(channel, part, "channel_select_check"); --ret; } } in_part = &channel->ch_part[PART_IN]; if (ret > 0 && in_part->ch_fd != INVALID_FD && FD_ISSET(in_part->ch_fd, wfds)) { if (in_part->ch_buf_append) { if (in_part->ch_buffer != NULL) channel_write_new_lines(in_part->ch_buffer); } else channel_write_in(channel); --ret; } } return ret; } # endif /* !WIN32 && HAVE_SELECT */ /* * Return TRUE if "channel" has JSON or other typeahead. */ static int channel_has_readahead(channel_T *channel, int part) { ch_mode_T ch_mode = channel->ch_part[part].ch_mode; if (ch_mode == MODE_JSON || ch_mode == MODE_JS) { jsonq_T *head = &channel->ch_part[part].ch_json_head; jsonq_T *item = head->jq_next; return item != NULL; } return channel_peek(channel, part) != NULL; } /* * Execute queued up commands. * Invoked from the main loop when it's safe to execute received commands. * Return TRUE when something was done. */ int channel_parse_messages(void) { channel_T *channel = first_channel; int ret = FALSE; int r; int part = PART_SOCK; /* Only do this message when another message was given, otherwise we get * lots of them. */ if (did_log_msg) { ch_log(NULL, "looking for messages on channels"); did_log_msg = FALSE; } while (channel != NULL) { if (channel->ch_refcount == 0 && !channel_still_useful(channel)) { /* channel is no longer useful, free it */ channel_free(channel); channel = first_channel; part = PART_SOCK; continue; } if (channel->ch_part[part].ch_fd != INVALID_FD || channel_has_readahead(channel, part)) { /* Increase the refcount, in case the handler causes the channel * to be unreferenced or closed. */ ++channel->ch_refcount; r = may_invoke_callback(channel, part); if (r == OK) ret = TRUE; if (channel_unref(channel) || r == OK) { /* channel was freed or something was done, start over */ channel = first_channel; part = PART_SOCK; continue; } } if (part < PART_ERR) ++part; else { channel = channel->ch_next; part = PART_SOCK; } } if (channel_need_redraw && must_redraw) { channel_need_redraw = FALSE; update_screen(0); setcursor(); cursor_on(); out_flush(); } return ret; } /* * Mark references to lists used in channels. */ int set_ref_in_channel(int copyID) { int abort = FALSE; channel_T *channel; int part; for (channel = first_channel; channel != NULL; channel = channel->ch_next) { for (part = PART_SOCK; part < PART_IN; ++part) { jsonq_T *head = &channel->ch_part[part].ch_json_head; jsonq_T *item = head->jq_next; while (item != NULL) { list_T *l = item->jq_value->vval.v_list; if (l->lv_copyID != copyID) { l->lv_copyID = copyID; abort = abort || set_ref_in_list(l, copyID, NULL); } item = item->jq_next; } } } return abort; } /* * Return the "part" to write to for "channel". */ int channel_part_send(channel_T *channel) { if (channel->CH_SOCK_FD == INVALID_FD) return PART_IN; return PART_SOCK; } /* * Return the default "part" to read from for "channel". */ int channel_part_read(channel_T *channel) { if (channel->CH_SOCK_FD == INVALID_FD) return PART_OUT; return PART_SOCK; } /* * Return the mode of "channel"/"part" * If "channel" is invalid returns MODE_JSON. */ ch_mode_T channel_get_mode(channel_T *channel, int part) { if (channel == NULL) return MODE_JSON; return channel->ch_part[part].ch_mode; } /* * Return the timeout of "channel"/"part" */ int channel_get_timeout(channel_T *channel, int part) { return channel->ch_part[part].ch_timeout; } static int handle_mode(typval_T *item, jobopt_T *opt, ch_mode_T *modep, int jo) { char_u *val = get_tv_string(item); opt->jo_set |= jo; if (STRCMP(val, "nl") == 0) *modep = MODE_NL; else if (STRCMP(val, "raw") == 0) *modep = MODE_RAW; else if (STRCMP(val, "js") == 0) *modep = MODE_JS; else if (STRCMP(val, "json") == 0) *modep = MODE_JSON; else { EMSG2(_(e_invarg2), val); return FAIL; } return OK; } static int handle_io(typval_T *item, int part, jobopt_T *opt) { char_u *val = get_tv_string(item); opt->jo_set |= JO_OUT_IO << (part - PART_OUT); if (STRCMP(val, "null") == 0) opt->jo_io[part] = JIO_NULL; else if (STRCMP(val, "pipe") == 0) opt->jo_io[part] = JIO_PIPE; else if (STRCMP(val, "file") == 0) opt->jo_io[part] = JIO_FILE; else if (STRCMP(val, "buffer") == 0) opt->jo_io[part] = JIO_BUFFER; else if (STRCMP(val, "out") == 0 && part == PART_ERR) opt->jo_io[part] = JIO_OUT; else { EMSG2(_(e_invarg2), val); return FAIL; } return OK; } void clear_job_options(jobopt_T *opt) { vim_memset(opt, 0, sizeof(jobopt_T)); } /* * Get the PART_ number from the first character of an option name. */ static int part_from_char(int c) { return c == 'i' ? PART_IN : c == 'o' ? PART_OUT: PART_ERR; } /* * Get the option entries from the dict in "tv", parse them and put the result * in "opt". * Only accept options in "supported". * If an option value is invalid return FAIL. */ int get_job_options(typval_T *tv, jobopt_T *opt, int supported) { typval_T *item; char_u *val; dict_T *dict; int todo; hashitem_T *hi; int part; opt->jo_set = 0; if (tv->v_type == VAR_UNKNOWN) return OK; if (tv->v_type != VAR_DICT) { EMSG(_(e_invarg)); return FAIL; } dict = tv->vval.v_dict; if (dict == NULL) return OK; todo = (int)dict->dv_hashtab.ht_used; for (hi = dict->dv_hashtab.ht_array; todo > 0; ++hi) if (!HASHITEM_EMPTY(hi)) { item = &dict_lookup(hi)->di_tv; if (STRCMP(hi->hi_key, "mode") == 0) { if (!(supported & JO_MODE)) break; if (handle_mode(item, opt, &opt->jo_mode, JO_MODE) == FAIL) return FAIL; } else if (STRCMP(hi->hi_key, "in_mode") == 0) { if (!(supported & JO_IN_MODE)) break; if (handle_mode(item, opt, &opt->jo_in_mode, JO_IN_MODE) == FAIL) return FAIL; } else if (STRCMP(hi->hi_key, "out_mode") == 0) { if (!(supported & JO_OUT_MODE)) break; if (handle_mode(item, opt, &opt->jo_out_mode, JO_OUT_MODE) == FAIL) return FAIL; } else if (STRCMP(hi->hi_key, "err_mode") == 0) { if (!(supported & JO_ERR_MODE)) break; if (handle_mode(item, opt, &opt->jo_err_mode, JO_ERR_MODE) == FAIL) return FAIL; } else if (STRCMP(hi->hi_key, "in_io") == 0 || STRCMP(hi->hi_key, "out_io") == 0 || STRCMP(hi->hi_key, "err_io") == 0) { if (!(supported & JO_OUT_IO)) break; if (handle_io(item, part_from_char(*hi->hi_key), opt) == FAIL) return FAIL; } else if (STRCMP(hi->hi_key, "in_name") == 0 || STRCMP(hi->hi_key, "out_name") == 0 || STRCMP(hi->hi_key, "err_name") == 0) { part = part_from_char(*hi->hi_key); if (!(supported & JO_OUT_IO)) break; opt->jo_set |= JO_OUT_NAME << (part - PART_OUT); opt->jo_io_name[part] = get_tv_string_buf_chk(item, opt->jo_io_name_buf[part]); } else if (STRCMP(hi->hi_key, "in_buf") == 0 || STRCMP(hi->hi_key, "out_buf") == 0 || STRCMP(hi->hi_key, "err_buf") == 0) { part = part_from_char(*hi->hi_key); if (!(supported & JO_OUT_IO)) break; opt->jo_set |= JO_OUT_BUF << (part - PART_OUT); opt->jo_io_buf[part] = get_tv_number(item); if (opt->jo_io_buf[part] <= 0) { EMSG2(_(e_invarg2), get_tv_string(item)); return FAIL; } if (buflist_findnr(opt->jo_io_buf[part]) == NULL) { EMSGN(_(e_nobufnr), (long)opt->jo_io_buf[part]); return FAIL; } } else if (STRCMP(hi->hi_key, "in_top") == 0 || STRCMP(hi->hi_key, "in_bot") == 0) { linenr_T *lp; if (!(supported & JO_OUT_IO)) break; if (hi->hi_key[3] == 't') { lp = &opt->jo_in_top; opt->jo_set |= JO_IN_TOP; } else { lp = &opt->jo_in_bot; opt->jo_set |= JO_IN_BOT; } *lp = get_tv_number(item); if (*lp < 0) { EMSG2(_(e_invarg2), get_tv_string(item)); return FAIL; } } else if (STRCMP(hi->hi_key, "channel") == 0) { if (!(supported & JO_OUT_IO)) break; opt->jo_set |= JO_CHANNEL; if (item->v_type != VAR_CHANNEL) { EMSG2(_(e_invarg2), "channel"); return FAIL; } opt->jo_channel = item->vval.v_channel; } else if (STRCMP(hi->hi_key, "callback") == 0) { if (!(supported & JO_CALLBACK)) break; opt->jo_set |= JO_CALLBACK; opt->jo_callback = get_callback(item, &opt->jo_partial); if (opt->jo_callback == NULL) { EMSG2(_(e_invarg2), "callback"); return FAIL; } } else if (STRCMP(hi->hi_key, "out_cb") == 0) { if (!(supported & JO_OUT_CALLBACK)) break; opt->jo_set |= JO_OUT_CALLBACK; opt->jo_out_cb = get_callback(item, &opt->jo_out_partial); if (opt->jo_out_cb == NULL) { EMSG2(_(e_invarg2), "out_cb"); return FAIL; } } else if (STRCMP(hi->hi_key, "err_cb") == 0) { if (!(supported & JO_ERR_CALLBACK)) break; opt->jo_set |= JO_ERR_CALLBACK; opt->jo_err_cb = get_callback(item, &opt->jo_err_partial); if (opt->jo_err_cb == NULL) { EMSG2(_(e_invarg2), "err_cb"); return FAIL; } } else if (STRCMP(hi->hi_key, "close_cb") == 0) { if (!(supported & JO_CLOSE_CALLBACK)) break; opt->jo_set |= JO_CLOSE_CALLBACK; opt->jo_close_cb = get_callback(item, &opt->jo_close_partial); if (opt->jo_close_cb == NULL) { EMSG2(_(e_invarg2), "close_cb"); return FAIL; } } else if (STRCMP(hi->hi_key, "waittime") == 0) { if (!(supported & JO_WAITTIME)) break; opt->jo_set |= JO_WAITTIME; opt->jo_waittime = get_tv_number(item); } else if (STRCMP(hi->hi_key, "timeout") == 0) { if (!(supported & JO_TIMEOUT)) break; opt->jo_set |= JO_TIMEOUT; opt->jo_timeout = get_tv_number(item); } else if (STRCMP(hi->hi_key, "out_timeout") == 0) { if (!(supported & JO_OUT_TIMEOUT)) break; opt->jo_set |= JO_OUT_TIMEOUT; opt->jo_out_timeout = get_tv_number(item); } else if (STRCMP(hi->hi_key, "err_timeout") == 0) { if (!(supported & JO_ERR_TIMEOUT)) break; opt->jo_set |= JO_ERR_TIMEOUT; opt->jo_err_timeout = get_tv_number(item); } else if (STRCMP(hi->hi_key, "part") == 0) { if (!(supported & JO_PART)) break; opt->jo_set |= JO_PART; val = get_tv_string(item); if (STRCMP(val, "err") == 0) opt->jo_part = PART_ERR; else { EMSG2(_(e_invarg2), val); return FAIL; } } else if (STRCMP(hi->hi_key, "id") == 0) { if (!(supported & JO_ID)) break; opt->jo_set |= JO_ID; opt->jo_id = get_tv_number(item); } else if (STRCMP(hi->hi_key, "stoponexit") == 0) { if (!(supported & JO_STOPONEXIT)) break; opt->jo_set |= JO_STOPONEXIT; opt->jo_stoponexit = get_tv_string_buf_chk(item, opt->jo_soe_buf); if (opt->jo_stoponexit == NULL) { EMSG2(_(e_invarg2), "stoponexit"); return FAIL; } } else if (STRCMP(hi->hi_key, "exit_cb") == 0) { if (!(supported & JO_EXIT_CB)) break; opt->jo_set |= JO_EXIT_CB; if (item->v_type == VAR_PARTIAL && item->vval.v_partial != NULL) { opt->jo_exit_partial = item->vval.v_partial; opt->jo_exit_cb = item->vval.v_partial->pt_name; } else opt->jo_exit_cb = get_tv_string_buf_chk( item, opt->jo_ecb_buf); if (opt->jo_exit_cb == NULL) { EMSG2(_(e_invarg2), "exit_cb"); return FAIL; } } else if (STRCMP(hi->hi_key, "block_write") == 0) { if (!(supported & JO_BLOCK_WRITE)) break; opt->jo_set |= JO_BLOCK_WRITE; opt->jo_block_write = get_tv_number(item); } else break; --todo; } if (todo > 0) { EMSG2(_(e_invarg2), hi->hi_key); return FAIL; } return OK; } /* * Get the channel from the argument. * Returns NULL if the handle is invalid. */ channel_T * get_channel_arg(typval_T *tv, int check_open) { channel_T *channel = NULL; if (tv->v_type == VAR_JOB) { if (tv->vval.v_job != NULL) channel = tv->vval.v_job->jv_channel; } else if (tv->v_type == VAR_CHANNEL) { channel = tv->vval.v_channel; } else { EMSG2(_(e_invarg2), get_tv_string(tv)); return NULL; } if (check_open && (channel == NULL || !channel_is_open(channel))) { EMSG(_("E906: not an open channel")); return NULL; } return channel; } static job_T *first_job = NULL; static void job_free(job_T *job) { ch_log(job->jv_channel, "Freeing job"); if (job->jv_channel != NULL) { /* The link from the channel to the job doesn't count as a reference, * thus don't decrement the refcount of the job. The reference from * the job to the channel does count the refrence, decrement it and * NULL the reference. We don't set ch_job_killed, unreferencing the * job doesn't mean it stops running. */ job->jv_channel->ch_job = NULL; channel_unref(job->jv_channel); } mch_clear_job(job); if (job->jv_next != NULL) job->jv_next->jv_prev = job->jv_prev; if (job->jv_prev == NULL) first_job = job->jv_next; else job->jv_prev->jv_next = job->jv_next; vim_free(job->jv_stoponexit); vim_free(job->jv_exit_cb); partial_unref(job->jv_exit_partial); vim_free(job); } void job_unref(job_T *job) { if (job != NULL && --job->jv_refcount <= 0) { /* Do not free the job when it has not ended yet and there is a * "stoponexit" flag or an exit callback. */ if (job->jv_status != JOB_STARTED || (job->jv_stoponexit == NULL && job->jv_exit_cb == NULL)) { job_free(job); } else if (job->jv_channel != NULL) { /* Do remove the link to the channel, otherwise it hangs * around until Vim exits. See job_free() for refcount. */ job->jv_channel->ch_job = NULL; channel_unref(job->jv_channel); job->jv_channel = NULL; } } } /* * Allocate a job. Sets the refcount to one and sets options default. */ static job_T * job_alloc(void) { job_T *job; job = (job_T *)alloc_clear(sizeof(job_T)); if (job != NULL) { job->jv_refcount = 1; job->jv_stoponexit = vim_strsave((char_u *)"term"); if (first_job != NULL) { first_job->jv_prev = job; job->jv_next = first_job; } first_job = job; } return job; } void job_set_options(job_T *job, jobopt_T *opt) { if (opt->jo_set & JO_STOPONEXIT) { vim_free(job->jv_stoponexit); if (opt->jo_stoponexit == NULL || *opt->jo_stoponexit == NUL) job->jv_stoponexit = NULL; else job->jv_stoponexit = vim_strsave(opt->jo_stoponexit); } if (opt->jo_set & JO_EXIT_CB) { vim_free(job->jv_exit_cb); partial_unref(job->jv_exit_partial); if (opt->jo_exit_cb == NULL || *opt->jo_exit_cb == NUL) { job->jv_exit_cb = NULL; job->jv_exit_partial = NULL; } else { job->jv_exit_cb = vim_strsave(opt->jo_exit_cb); job->jv_exit_partial = opt->jo_exit_partial; if (job->jv_exit_partial != NULL) ++job->jv_exit_partial->pt_refcount; } } } /* * Called when Vim is exiting: kill all jobs that have the "stoponexit" flag. */ void job_stop_on_exit() { job_T *job; for (job = first_job; job != NULL; job = job->jv_next) if (job->jv_status == JOB_STARTED && job->jv_stoponexit != NULL) mch_stop_job(job, job->jv_stoponexit); } /* * Called once in a while: check if any jobs with an "exit_cb" have ended. */ void job_check_ended(void) { static time_t last_check = 0; time_t now; job_T *job; job_T *next; /* Only do this once in 10 seconds. */ now = time(NULL); if (last_check + 10 < now) { last_check = now; for (job = first_job; job != NULL; job = next) { next = job->jv_next; if (job->jv_status == JOB_STARTED && job->jv_exit_cb != NULL) job_status(job); /* may free "job" */ } } } /* * "job_start()" function */ job_T * job_start(typval_T *argvars) { job_T *job; char_u *cmd = NULL; #if defined(UNIX) # define USE_ARGV char **argv = NULL; int argc = 0; #else garray_T ga; #endif jobopt_T opt; int part; job = job_alloc(); if (job == NULL) return NULL; job->jv_status = JOB_FAILED; /* Default mode is NL. */ clear_job_options(&opt); opt.jo_mode = MODE_NL; if (get_job_options(&argvars[1], &opt, JO_MODE_ALL + JO_CB_ALL + JO_TIMEOUT_ALL + JO_STOPONEXIT + JO_EXIT_CB + JO_OUT_IO + JO_BLOCK_WRITE) == FAIL) return job; /* Check that when io is "file" that there is a file name. */ for (part = PART_OUT; part <= PART_IN; ++part) if ((opt.jo_set & (JO_OUT_IO << (part - PART_OUT))) && opt.jo_io[part] == JIO_FILE && (!(opt.jo_set & (JO_OUT_NAME << (part - PART_OUT))) || *opt.jo_io_name[part] == NUL)) { EMSG(_("E920: _io file requires _name to be set")); return job; } if ((opt.jo_set & JO_IN_IO) && opt.jo_io[PART_IN] == JIO_BUFFER) { buf_T *buf = NULL; /* check that we can find the buffer before starting the job */ if (opt.jo_set & JO_IN_BUF) { buf = buflist_findnr(opt.jo_io_buf[PART_IN]); if (buf == NULL) EMSGN(_(e_nobufnr), (long)opt.jo_io_buf[PART_IN]); } else if (!(opt.jo_set & JO_IN_NAME)) { EMSG(_("E915: in_io buffer requires in_buf or in_name to be set")); } else buf = buflist_find_by_name(opt.jo_io_name[PART_IN], FALSE); if (buf == NULL) return job; if (buf->b_ml.ml_mfp == NULL) { char_u numbuf[NUMBUFLEN]; char_u *s; if (opt.jo_set & JO_IN_BUF) { sprintf((char *)numbuf, "%d", opt.jo_io_buf[PART_IN]); s = numbuf; } else s = opt.jo_io_name[PART_IN]; EMSG2(_("E918: buffer must be loaded: %s"), s); return job; } job->jv_in_buf = buf; } job_set_options(job, &opt); #ifndef USE_ARGV ga_init2(&ga, (int)sizeof(char*), 20); #endif if (argvars[0].v_type == VAR_STRING) { /* Command is a string. */ cmd = argvars[0].vval.v_string; if (cmd == NULL || *cmd == NUL) { EMSG(_(e_invarg)); return job; } #ifdef USE_ARGV if (mch_parse_cmd(cmd, FALSE, &argv, &argc) == FAIL) return job; argv[argc] = NULL; #endif } else if (argvars[0].v_type != VAR_LIST || argvars[0].vval.v_list == NULL || argvars[0].vval.v_list->lv_len < 1) { EMSG(_(e_invarg)); return job; } else { list_T *l = argvars[0].vval.v_list; listitem_T *li; char_u *s; #ifdef USE_ARGV /* Pass argv[] to mch_call_shell(). */ argv = (char **)alloc(sizeof(char *) * (l->lv_len + 1)); if (argv == NULL) return job; #endif for (li = l->lv_first; li != NULL; li = li->li_next) { s = get_tv_string_chk(&li->li_tv); if (s == NULL) goto theend; #ifdef USE_ARGV argv[argc++] = (char *)s; #else /* Only escape when needed, double quotes are not always allowed. */ if (li != l->lv_first && vim_strpbrk(s, (char_u *)" \t\"") != NULL) { # ifdef WIN32 int old_ssl = p_ssl; /* This is using CreateProcess, not cmd.exe. Always use * double quote and backslashes. */ p_ssl = 0; # endif s = vim_strsave_shellescape(s, FALSE, TRUE); # ifdef WIN32 p_ssl = old_ssl; # endif if (s == NULL) goto theend; ga_concat(&ga, s); vim_free(s); } else ga_concat(&ga, s); if (li->li_next != NULL) ga_append(&ga, ' '); #endif } #ifdef USE_ARGV argv[argc] = NULL; #else cmd = ga.ga_data; #endif } #ifdef USE_ARGV if (ch_log_active()) { garray_T ga; int i; ga_init2(&ga, (int)sizeof(char), 200); for (i = 0; i < argc; ++i) { if (i > 0) ga_concat(&ga, (char_u *)" "); ga_concat(&ga, (char_u *)argv[i]); } ch_logs(NULL, "Starting job: %s", (char *)ga.ga_data); ga_clear(&ga); } mch_start_job(argv, job, &opt); #else ch_logs(NULL, "Starting job: %s", (char *)cmd); mch_start_job((char *)cmd, job, &opt); #endif /* If the channel is reading from a buffer, write lines now. */ if (job->jv_channel != NULL) channel_write_in(job->jv_channel); theend: #ifdef USE_ARGV vim_free(argv); #else vim_free(ga.ga_data); #endif return job; } /* * Get the status of "job" and invoke the exit callback when needed. * The returned string is not allocated. */ char * job_status(job_T *job) { char *result; if (job->jv_status == JOB_ENDED) /* No need to check, dead is dead. */ result = "dead"; else if (job->jv_status == JOB_FAILED) result = "fail"; else { result = mch_job_status(job); if (job->jv_status == JOB_ENDED) ch_log(job->jv_channel, "Job ended"); if (job->jv_status == JOB_ENDED && job->jv_exit_cb != NULL) { typval_T argv[3]; typval_T rettv; int dummy; /* invoke the exit callback; make sure the refcount is > 0 */ ++job->jv_refcount; argv[0].v_type = VAR_JOB; argv[0].vval.v_job = job; argv[1].v_type = VAR_NUMBER; argv[1].vval.v_number = job->jv_exitval; call_func(job->jv_exit_cb, (int)STRLEN(job->jv_exit_cb), &rettv, 2, argv, 0L, 0L, &dummy, TRUE, job->jv_exit_partial, NULL); clear_tv(&rettv); --job->jv_refcount; } if (job->jv_status == JOB_ENDED && job->jv_refcount == 0) { /* The job was already unreferenced, now that it ended it can be * freed. Careful: caller must not use "job" after this! */ job_free(job); } } return result; } /* * Implementation of job_info(). */ void job_info(job_T *job, dict_T *dict) { dictitem_T *item; varnumber_T nr; dict_add_nr_str(dict, "status", 0L, (char_u *)job_status(job)); item = dictitem_alloc((char_u *)"channel"); if (item == NULL) return; item->di_tv.v_lock = 0; item->di_tv.v_type = VAR_CHANNEL; item->di_tv.vval.v_channel = job->jv_channel; if (job->jv_channel != NULL) ++job->jv_channel->ch_refcount; if (dict_add(dict, item) == FAIL) dictitem_free(item); #ifdef UNIX nr = job->jv_pid; #else nr = job->jv_proc_info.dwProcessId; #endif dict_add_nr_str(dict, "process", nr, NULL); dict_add_nr_str(dict, "exitval", job->jv_exitval, NULL); dict_add_nr_str(dict, "exit_cb", 0L, job->jv_exit_cb); dict_add_nr_str(dict, "stoponexit", 0L, job->jv_stoponexit); } int job_stop(job_T *job, typval_T *argvars) { char_u *arg; if (argvars[1].v_type == VAR_UNKNOWN) arg = (char_u *)""; else { arg = get_tv_string_chk(&argvars[1]); if (arg == NULL) { EMSG(_(e_invarg)); return 0; } } ch_logs(job->jv_channel, "Stopping job with '%s'", (char *)arg); if (mch_stop_job(job, arg) == FAIL) return 0; /* Assume that "hup" does not kill the job. */ if (job->jv_channel != NULL && STRCMP(arg, "hup") != 0) job->jv_channel->ch_job_killed = TRUE; /* We don't try freeing the job, obviously the caller still has a * reference to it. */ return 1; } #endif /* FEAT_JOB_CHANNEL */ vim-7.4.1689/src/charset.c000066400000000000000000001404321267703067000151650ustar00rootroot00000000000000/* 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(win_T *wp, char_u *p, colnr_T col); #endif #ifdef FEAT_MBYTE # if defined(HAVE_WCHAR_H) # include /* for towupper() and towlower() */ # endif static int win_nolbr_chartabsize(win_T *wp, char_u *s, colnr_T col, int *headp); #endif static unsigned nr2hex(unsigned 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))) /* table used below, see init_chartab() for an explanation */ static char_u g_chartab[256]; /* * Flags for g_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 */ /* * Fill g_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 g_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 g_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(void) { return buf_init_chartab(curbuf, TRUE); } int buf_init_chartab( 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 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 < ' ') g_chartab[c++] = (dy_flags & DY_UHEX) ? 4 : 2; #ifdef EBCDIC while (c < 255) #else while (c <= '~') #endif g_chartab[c++] = 1 + CT_PRINT_CHAR; #ifdef FEAT_FKMAP if (p_altkeymap) { while (c < YE) g_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) g_chartab[c++] = CT_PRINT_CHAR + 1; /* euc-jp characters starting with 0x8e are single width */ else if (enc_dbcs == DBCS_JPNU && c == 0x8e) g_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) g_chartab[c++] = CT_PRINT_CHAR + 2; else #endif /* the rest is unprintable by default */ g_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)) g_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 if (enc_dbcs != 0) for (c = 0; c < 256; ++c) { /* double-byte characters are probably word characters */ if (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 #ifdef FEAT_MBYTE if (has_mbyte) c = mb_ptr2char_adv(&p); else #endif c = *p++; c2 = -1; if (*p == '-' && p[1] != NUL) { ++p; if (VIM_ISDIGIT(*p)) c2 = getdigits(&p); else #ifdef FEAT_MBYTE if (has_mbyte) c2 = mb_ptr2char_adv(&p); else #endif c2 = *p++; } if (c <= 0 || c >= 256 || (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) { /* Use the MB_ functions here, because isalpha() doesn't * work properly when 'encoding' is "latin1" and the locale is * "C". */ if (!do_isalpha || MB_ISLOWER(c) || MB_ISUPPER(c) #ifdef FEAT_FKMAP || (p_altkeymap && (F_isalpha(c) || F_isdigit(c))) #endif ) { if (i == 0) /* (re)set ID flag */ { if (tilde) g_chartab[c] &= ~CT_ID_CHAR; else g_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) { g_chartab[c] = (g_chartab[c] & ~CT_CELL_MASK) + ((dy_flags & DY_UHEX) ? 4 : 2); g_chartab[c] &= ~CT_PRINT_CHAR; } else { g_chartab[c] = (g_chartab[c] & ~CT_CELL_MASK) + 1; g_chartab[c] |= CT_PRINT_CHAR; } } } else if (i == 2) /* (re)set fname flag */ { if (tilde) g_chartab[c] &= ~CT_FNAME_CHAR; else g_chartab[c] |= CT_FNAME_CHAR; } else /* i == 3 */ /* (re)set keyword flag */ { if (tilde) RESET_CHARTAB(buf, c); else SET_CHARTAB(buf, c); } } ++c; } c = *p; p = skip_to_option_part(p); if (c == ',' && *p == NUL) /* Trailing comma is not allowed. */ return FAIL; } } 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( 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)(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(FEAT_INS_EXPAND) \ || defined(PROTO) /* * Translate a string into allocated memory, replacing special chars with * printable chars. Returns NULL when out of memory. */ char_u * transstr(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)(p)) > 1) { c = (*mb_ptr2char)(p); p += l; if (vim_isprintc(c)) len += l; else { transchar_hex(hexbuf, c); len += (int)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)(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 "str[orglen]" to do ignore-case comparing. Uses the * current locale. * When "buf" is NULL returns an allocated string (NULL for out-of-memory). * Otherwise puts the result in "buf[buflen]". */ char_u * str_foldcase( char_u *str, int orglen, char_u *buf, int buflen) { garray_T ga; int i; int len = orglen; #define GA_CHAR(i) ((char_u *)ga.ga_data)[i] #define GA_PTR(i) ((char_u *)ga.ga_data + i) #define STR_CHAR(i) (buf == NULL ? GA_CHAR(i) : buf[i]) #define STR_PTR(i) (buf == NULL ? GA_PTR(i) : buf + i) /* Copy "str" into "buf" or allocated memory, unmodified. */ if (buf == NULL) { ga_init2(&ga, 1, 10); if (ga_grow(&ga, len + 1) == FAIL) return NULL; mch_memmove(ga.ga_data, str, (size_t)len); ga.ga_len = len; } else { if (len >= buflen) /* Ugly! */ len = buflen - 1; mch_memmove(buf, str, (size_t)len); } if (buf == NULL) GA_CHAR(len) = NUL; else buf[len] = NUL; /* Make each character lower case. */ i = 0; while (STR_CHAR(i) != NUL) { #ifdef FEAT_MBYTE if (enc_utf8 || (has_mbyte && MB_BYTE2LEN(STR_CHAR(i)) > 1)) { if (enc_utf8) { int c = utf_ptr2char(STR_PTR(i)); int olen = utf_ptr2len(STR_PTR(i)); int lc = utf_tolower(c); /* Only replace the character when it is not an invalid * sequence (ASCII character or more than one byte) and * utf_tolower() doesn't return the original character. */ if ((c < 0x80 || olen > 1) && c != lc) { int nlen = utf_char2len(lc); /* If the byte length changes need to shift the following * characters forward or backward. */ if (olen != nlen) { if (nlen > olen) { if (buf == NULL ? ga_grow(&ga, nlen - olen + 1) == FAIL : len + nlen - olen >= buflen) { /* out of memory, keep old char */ lc = c; nlen = olen; } } if (olen != nlen) { if (buf == NULL) { STRMOVE(GA_PTR(i) + nlen, GA_PTR(i) + olen); ga.ga_len += nlen - olen; } else { STRMOVE(buf + i + nlen, buf + i + olen); len += nlen - olen; } } } (void)utf_char2bytes(lc, STR_PTR(i)); } } /* skip to next multi-byte char */ i += (*mb_ptr2len)(STR_PTR(i)); } else #endif { if (buf == NULL) GA_CHAR(i) = TOLOWER_LOC(GA_CHAR(i)); else buf[i] = TOLOWER_LOC(buf[i]); ++i; } } if (buf == NULL) return (char_u *)ga.ga_data; return buf; } #endif /* * Catch 22: g_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 g_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(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(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(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(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((unsigned)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 being 0xf1 or * function key 1. */ static unsigned nr2hex(unsigned 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(int b) { #ifdef FEAT_MBYTE if (enc_utf8 && b >= 0x80) return 0; #endif return (g_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(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 (g_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(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 (g_chartab[*p] & CT_CELL_MASK); } /* * Return the number of character cells string "s" will take on the screen, * counting TABs as two characters: "^I". */ int vim_strsize(char_u *s) { return vim_strnsize(s, (int)MAXCOL); } /* * Return the number of character cells string "s[len]" will take on the * screen, counting TABs as two characters: "^I". */ int vim_strnsize(char_u *s, int len) { int size = 0; while (*s != NUL && --len >= 0) { #ifdef FEAT_MBYTE if (has_mbyte) { int l = (*mb_ptr2len)(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); int chartabsize(char_u *p, colnr_T col) { RET_WIN_BUF_CHARTABSIZE(curwin, curbuf, p, col) } #ifdef FEAT_LINEBREAK static int win_chartabsize(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(char_u *s) { return linetabsize_col(0, s); } /* * Like linetabsize(), but starting at column "startcol". */ int linetabsize_col(int startcol, char_u *s) { colnr_T col = startcol; char_u *line = s; /* pointer to start of line, for breakindent */ while (*s != NUL) col += lbr_chartabsize_adv(line, &s, col); return (int)col; } /* * Like linetabsize(), but for a given window instead of the current one. */ int win_linetabsize(win_T *wp, char_u *line, colnr_T len) { colnr_T col = 0; char_u *s; for (s = line; *s != NUL && (len == MAXCOL || s < line + len); mb_ptr_adv(s)) col += win_lbr_chartabsize(wp, line, s, col, NULL); return (int)col; } /* * Return TRUE if 'c' is a normal identifier character: * Letters and characters from the 'isident' option. */ int vim_isIDc(int c) { return (c > 0 && c < 0x100 && (g_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(int c) { return vim_iswordc_buf(c, curbuf); } int vim_iswordc_buf(int c, buf_T *buf) { #ifdef FEAT_MBYTE if (c >= 0x100) { if (enc_dbcs != 0) return dbcs_class((unsigned)c >> 8, (unsigned)(c & 0xff)) >= 2; if (enc_utf8) return utf_class(c) >= 2; } #endif return (c > 0 && c < 0x100 && GET_CHARTAB(buf, c) != 0); } /* * Just like vim_iswordc() but uses a pointer to the (multi-byte) character. */ int vim_iswordp(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; } int vim_iswordp_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); } /* * return TRUE if 'c' is a valid file-name character * Assume characters above 0x100 are valid (multi-byte). */ int vim_isfilec(int c) { return (c >= 0x100 || (c > 0 && (g_chartab[c] & CT_FNAME_CHAR))); } /* * return TRUE if 'c' is a valid file-name character or a wildcard character * Assume characters above 0x100 are valid (multi-byte). * Explicitly interpret ']' as a wildcard character as mch_has_wildcard("]") * returns false. */ int vim_isfilec_or_wc(int c) { char_u buf[2]; buf[0] = (char_u)c; buf[1] = NUL; return vim_isfilec(c) || c == ']' || mch_has_wildcard(buf); } /* * return TRUE if 'c' is a printable character * Assume characters above 0x100 are printable (multi-byte), except for * Unicode. */ int vim_isprintc(int c) { #ifdef FEAT_MBYTE if (enc_utf8 && c >= 0x100) return utf_printable(c); #endif return (c >= 0x100 || (c > 0 && (g_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(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 && (g_chartab[c] & CT_PRINT_CHAR))); } /* * like chartabsize(), but also check for line breaks on the screen */ int lbr_chartabsize( char_u *line UNUSED, /* start of the line */ unsigned char *s, colnr_T col) { #ifdef FEAT_LINEBREAK if (!curwin->w_p_lbr && *p_sbr == NUL && !curwin->w_p_bri) { #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, line == NULL ? s : line, s, col, NULL); #endif } /* * Call lbr_chartabsize() and advance the pointer. */ int lbr_chartabsize_adv( char_u *line, /* start of the line */ char_u **s, colnr_T col) { int retval; retval = lbr_chartabsize(line, *s, col); mb_ptr_adv(*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. */ int win_lbr_chartabsize( win_T *wp, char_u *line UNUSED, /* start of the line */ char_u *s, colnr_T col, int *headp UNUSED) { #ifdef FEAT_LINEBREAK int c; int size; colnr_T col2; colnr_T col_adj = 0; /* col + screen size of tab */ 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); int n; /* * No 'linebreak', 'showbreak' and 'breakindent': return quickly. */ if (!wp->w_p_lbr && !wp->w_p_bri && *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 (tab_corr) col_adj = size - 1; /* * 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_wrap # ifdef FEAT_WINDOWS && 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 = (colnr_T)(W_WIDTH(wp) - numberextra - col_adj); if (col >= colmax) { colmax += col_adj; n = colmax + win_col_off2(wp); if (n > 0) colmax += (((col - colmax) / n) + 1) * n - col_adj; } for (;;) { ps = s; mb_ptr_adv(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 + col_adj; 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 'breakindent' and/or 'showbreak' * string at start of line. * Set *headp to the size of what we add. */ added = 0; if ((*p_sbr != NUL || wp->w_p_bri) && wp->w_p_wrap && col != 0) { colnr_T sbrlen = 0; int numberwidth = win_col_off(wp); numberextra = numberwidth; 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 (col >= numberextra && numberextra > 0) col %= numberextra; if (*p_sbr != NUL) { sbrlen = (colnr_T)MB_CHARLEN(p_sbr); if (col >= sbrlen) col -= sbrlen; } if (col >= numberextra && numberextra > 0) col = col % numberextra; else if (col > 0 && numberextra > 0) col += numberwidth - win_col_off2(wp); numberwidth -= win_col_off2(wp); } if (col == 0 || col + size + sbrlen > (colnr_T)W_WIDTH(wp)) { added = 0; if (*p_sbr != NUL) { if (size + sbrlen + numberwidth > (colnr_T)W_WIDTH(wp)) { /* calculate effective window width */ int width = (colnr_T)W_WIDTH(wp) - sbrlen - numberwidth; int prev_width = col ? ((colnr_T)W_WIDTH(wp) - (sbrlen + col)) : 0; if (width == 0) width = (colnr_T)W_WIDTH(wp); added += ((size - prev_width) / width) * vim_strsize(p_sbr); if ((size - prev_width) % width) /* wrapped, add another length of 'sbr' */ added += vim_strsize(p_sbr); } else added += vim_strsize(p_sbr); } if (wp->w_p_bri) added += get_breakindent_win(wp, line); 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( 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(win_T *wp, colnr_T vcol) { int width1; /* width of first line (after line number) */ int width2; /* width of further lines */ # ifdef FEAT_WINDOWS if (wp->w_width == 0) /* there is no border */ return FALSE; # endif width1 = W_WIDTH(wp) - win_col_off(wp); if ((int)vcol < width1 - 1) return FALSE; if ((int)vcol == width1 - 1) return TRUE; width2 = width1 + win_col_off2(wp); if (width2 <= 0) return FALSE; 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( 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 */ char_u *line; /* start of the line */ int incr; int head; int ts = wp->w_buffer->b_p_ts; int c; vcol = 0; line = ptr = ml_get_buf(wp->w_buffer, pos->lnum, FALSE); if (pos->col == MAXCOL) posptr = NULL; /* continue until the NUL */ else posptr = ptr + pos->col; /* * This function is used very often, do some speed optimizations. * When 'list', 'linebreak', 'showbreak' and 'breakindent' 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 && !wp->w_p_bri #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 = g_chartab[c] & CT_CELL_MASK; /* 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 && MB_BYTE2LEN(*ptr) > 1 && in_win_border(wp, vcol)) { ++incr; head = 1; } } else #endif incr = g_chartab[c] & CT_CELL_MASK; } if (posptr != NULL && ptr >= posptr) /* character at pos->col */ break; vcol += incr; mb_ptr_adv(ptr); } } else { for (;;) { /* A tab gets expanded, depending on the current column */ head = 0; incr = win_lbr_chartabsize(wp, line, 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 (posptr != NULL && ptr >= posptr) /* character at pos->col */ break; vcol += incr; mb_ptr_adv(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() && !(VIsual_active && (*p_sel == 'e' || ltoreq(*pos, VIsual))) ) *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(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( 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 < (colnr_T)STRLEN(ptr)) { int c = (*mb_ptr2char)(ptr + pos->col); if (c != TAB && vim_isprintc(c)) { endadd = (colnr_T)(char2cells(c) - 1); if (coladd > endadd) /* past end of line */ endadd = 0; 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 /* * Get the leftmost and rightmost virtual column of pos1 and pos2. * Used for Visual block mode. */ void getvcols( win_T *wp, pos_T *pos1, pos_T *pos2, colnr_T *left, colnr_T *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; } /* * skipwhite: skip over ' ' and '\t'. */ char_u * skipwhite(char_u *q) { char_u *p = q; while (vim_iswhite(*p)) /* skip to next non-white */ ++p; return p; } /* * skip over digits */ char_u * skipdigits(char_u *q) { char_u *p = q; while (VIM_ISDIGIT(*p)) /* skip to next non-digit */ ++p; return p; } #if defined(FEAT_SYN_HL) || defined(FEAT_SPELL) || defined(PROTO) /* * skip over binary digits */ char_u * skipbin(char_u *q) { char_u *p = q; while (vim_isbdigit(*p)) /* skip to next non-digit */ ++p; return p; } /* * skip over digits and hex characters */ char_u * skiphex(char_u *q) { char_u *p = q; while (vim_isxdigit(*p)) /* skip to next non-digit */ ++p; return p; } #endif /* * skip to bin digit (or NUL after the string) */ char_u * skiptobin(char_u *q) { char_u *p = q; while (*p != NUL && !vim_isbdigit(*p)) /* skip to next digit */ ++p; return p; } /* * skip to digit (or NUL after the string) */ char_u * skiptodigit(char_u *q) { char_u *p = q; while (*p != NUL && !VIM_ISDIGIT(*p)) /* skip to next digit */ ++p; return p; } /* * skip to hex character (or NUL after the string) */ char_u * skiptohex(char_u *q) { char_u *p = q; while (*p != NUL && !vim_isxdigit(*p)) /* skip to next 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(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(int c) { return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'); } /* * Corollary of vim_isdigit and vim_isxdigit() that can handle * characters > 0x100. */ int vim_isbdigit(int c) { return (c == '0' || c == '1'); } #if defined(FEAT_MBYTE) || defined(PROTO) /* * Vim's own character class functions. These exist because many library * islower()/toupper() etc. do not work properly: they crash when used with * invalid values or can't handle latin1 when the locale is C. * Speed is most important here. */ #define LATIN1LOWER 'l' #define LATIN1UPPER 'U' static char_u latin1flags[257] = " UUUUUUUUUUUUUUUUUUUUUUUUUU llllllllllllllllllllllllll UUUUUUUUUUUUUUUUUUUUUUU UUUUUUUllllllllllllllllllllllll llllllll"; static char_u latin1upper[257] = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xf7\xd8\xd9\xda\xdb\xdc\xdd\xde\xff"; static char_u latin1lower[257] = " !\"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xd7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"; int vim_islower(int c) { if (c <= '@') return FALSE; if (c >= 0x80) { if (enc_utf8) return utf_islower(c); if (c >= 0x100) { #ifdef HAVE_ISWLOWER if (has_mbyte) return iswlower(c); #endif /* islower() can't handle these chars and may crash */ return FALSE; } if (enc_latin1like) return (latin1flags[c] & LATIN1LOWER) == LATIN1LOWER; } return islower(c); } int vim_isupper(int c) { if (c <= '@') return FALSE; if (c >= 0x80) { if (enc_utf8) return utf_isupper(c); if (c >= 0x100) { #ifdef HAVE_ISWUPPER if (has_mbyte) return iswupper(c); #endif /* islower() can't handle these chars and may crash */ return FALSE; } if (enc_latin1like) return (latin1flags[c] & LATIN1UPPER) == LATIN1UPPER; } return isupper(c); } int vim_toupper(int c) { if (c <= '@') return c; if (c >= 0x80) { if (enc_utf8) return utf_toupper(c); if (c >= 0x100) { #ifdef HAVE_TOWUPPER if (has_mbyte) return towupper(c); #endif /* toupper() can't handle these chars and may crash */ return c; } if (enc_latin1like) return latin1upper[c]; } return TOUPPER_LOC(c); } int vim_tolower(int c) { if (c <= '@') return c; if (c >= 0x80) { if (enc_utf8) return utf_tolower(c); if (c >= 0x100) { #ifdef HAVE_TOWLOWER if (has_mbyte) return towlower(c); #endif /* tolower() can't handle these chars and may crash */ return c; } if (enc_latin1like) return latin1lower[c]; } return TOLOWER_LOC(c); } #endif /* * skiptowhite: skip over text until ' ' or '\t' or NUL. */ char_u * skiptowhite(char_u *p) { while (*p != ' ' && *p != '\t' && *p != NUL) ++p; return p; } #if defined(FEAT_LISTCMDS) || defined(FEAT_SIGNS) || defined(PROTO) /* * skiptowhite_esc: Like skiptowhite(), but also skip escaped chars */ char_u * skiptowhite_esc(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(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(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, octal, and binary numbers. Accepts a '-' sign. * If "prep" is not NULL, returns a flag to indicate the type of the number: * 0 decimal * '0' octal * 'B' bin * 'b' bin * '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. * If "what" contains STR2NR_BIN recognize binary numbers * If "what" contains STR2NR_OCT recognize octal numbers * If "what" contains STR2NR_HEX recognize hex numbers * If "what" contains STR2NR_FORCE always assume bin/oct/hex. * If maxlen > 0, check at a maximum maxlen chars */ void vim_str2nr( char_u *start, int *prep, /* return: type of number 0 = decimal, 'x' or 'X' is hex, '0' = octal, 'b' or 'B' is bin */ int *len, /* return: detected length of number */ int what, /* what numbers to recognize */ long *nptr, /* return: signed result */ unsigned long *unptr, /* return: unsigned result */ int maxlen) /* max length of string to check */ { char_u *ptr = start; int pre = 0; /* default is decimal */ int negative = FALSE; unsigned long un = 0; int n; if (ptr[0] == '-') { negative = TRUE; ++ptr; } /* Recognize hex, octal, and bin. */ if (ptr[0] == '0' && ptr[1] != '8' && ptr[1] != '9' && (maxlen == 0 || maxlen > 1)) { pre = ptr[1]; if ((what & STR2NR_HEX) && (pre == 'X' || pre == 'x') && vim_isxdigit(ptr[2]) && (maxlen == 0 || maxlen > 2)) /* hexadecimal */ ptr += 2; else if ((what & STR2NR_BIN) && (pre == 'B' || pre == 'b') && vim_isbdigit(ptr[2]) && (maxlen == 0 || maxlen > 2)) /* binary */ ptr += 2; else { /* decimal or octal, default is decimal */ pre = 0; if (what & STR2NR_OCT) { /* Don't interpret "0", "08" or "0129" as octal. */ for (n = 1; VIM_ISDIGIT(ptr[n]); ++n) { if (ptr[n] > '7') { pre = 0; /* can't be octal */ break; } if (ptr[n] >= '0') pre = '0'; /* assume octal */ if (n == maxlen) break; } } } } /* * Do the string-to-numeric conversion "manually" to avoid sscanf quirks. */ n = 1; if (pre == 'B' || pre == 'b' || what == STR2NR_BIN + STR2NR_FORCE) { /* bin */ if (pre != 0) n += 2; /* skip over "0b" */ while ('0' <= *ptr && *ptr <= '1') { un = 2 * un + (unsigned long)(*ptr - '0'); ++ptr; if (n++ == maxlen) break; } } else if (pre == '0' || what == STR2NR_OCT + STR2NR_FORCE) { /* octal */ while ('0' <= *ptr && *ptr <= '7') { un = 8 * un + (unsigned long)(*ptr - '0'); ++ptr; if (n++ == maxlen) break; } } else if (pre != 0 || what == STR2NR_HEX + STR2NR_FORCE) { /* hex */ if (pre != 0) n += 2; /* skip over "0x" */ while (vim_isxdigit(*ptr)) { un = 16 * un + (unsigned long)hex2nr(*ptr); ++ptr; if (n++ == maxlen) break; } } else { /* decimal */ while (VIM_ISDIGIT(*ptr)) { un = 10 * un + (unsigned long)(*ptr - '0'); ++ptr; if (n++ == maxlen) break; } } if (prep != NULL) *prep = pre; if (len != NULL) *len = (int)(ptr - start); if (nptr != NULL) { if (negative) /* account for leading '-' for decimal numbers */ *nptr = -(long)un; else *nptr = (long)un; } 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(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(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(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(char_u *p) { for ( ; *p; ++p) if (rem_backslash(p)) STRMOVE(p, p + 1); } /* * backslash_halve() plus save the result in allocated memory. */ char_u * backslash_halve_save(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(char_u *buffer, int len) { int i; for (i = 0; i < len; i++) buffer[i] = ebcdic2ascii_tab[buffer[i]]; } #endif vim-7.4.1689/src/config.aap.in000066400000000000000000000056241267703067000157300ustar00rootroot00000000000000# 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@ LUA_LIBS = @LUA_LIBS@ LUA_SRC = @LUA_SRC@ LUA_OBJ = @LUA_OBJ@ LUA_CFLAGS = @LUA_CFLAGS@ LUA_PRO = @LUA_PRO@ MZSCHEME_LIBS = @MZSCHEME_LIBS@ MZSCHEME_SRC = @MZSCHEME_SRC@ MZSCHEME_OBJ = @MZSCHEME_OBJ@ MZSCHEME_CFLAGS = @MZSCHEME_CFLAGS@ MZSCHEME_PRO = @MZSCHEME_PRO@ 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@ CHANNEL_SRC = @CHANNEL_SRC@ CHANNEL_OBJ = @CHANNEL_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@ INSTALL_LANGS = @INSTALL_LANGS@ INSTALL_TOOL_LANGS = @INSTALL_TOOL_LANGS@ ### 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@ ### For autoconf 2.60 and later (avoid a warning) datarootdir $= @datarootdir@ ### 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 vim-7.4.1689/src/config.h.in000066400000000000000000000257321267703067000154200ustar00rootroot00000000000000/* * 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 /* Define when __attribute__((unused)) can be used */ #undef HAVE_ATTRIBUTE_UNUSED /* defined always when using configure */ #undef UNIX /* Defined to the size of an int */ #undef VIM_SIZEOF_INT /* Defined to the size of a long */ #undef VIM_SIZEOF_LONG /* Defined to the size of off_t */ #undef SIZEOF_OFF_T /* Defined to the size of time_t */ #undef SIZEOF_TIME_T /* Define when wchar_t is only 2 bytes. */ #undef SMALL_WCHAR_T /* * 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 empty if the keyword does not work. */ #undef volatile /* Define to `int' if doesn't define. */ #undef mode_t /* Define to `long' if doesn't define. */ #undef off_t /* Define to `long' if doesn't define. */ #undef pid_t /* Define to `unsigned' if doesn't define. */ #undef size_t /* Define to `int' if doesn't define. */ #undef uid_t /* Define to `unsigned int' or other type that is 32 bit. */ #undef uint32_t /* Define to `int' if doesn't define. */ #undef gid_t /* Define to `long' if doesn't define. */ #undef ino_t /* Define to `unsigned' if doesn't define. */ #undef dev_t /* Define on big-endian machines */ #undef WORDS_BIGENDIAN /* Define to `unsigned long' if doesn't define. */ #undef rlim_t /* Define to `struct sigaltstack' if 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 and . */ #undef TIME_WITH_SYS_TIME /* Define if you can safely include both and . */ #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_GETCWD #undef HAVE_GETPSEUDOTTY #undef HAVE_GETPWENT #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_MKDTEMP #undef HAVE_NANOSLEEP #undef HAVE_OPENDIR #undef HAVE_FLOAT_FUNCS #undef HAVE_PUTENV #undef HAVE_QSORT #undef HAVE_READLINK #undef HAVE_RENAME #undef HAVE_SELECT #undef HAVE_SELINUX #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_SMACK #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_SYSINFO_MEM_UNIT #undef HAVE_TGETENT #undef HAVE_TOWLOWER #undef HAVE_TOWUPPER #undef HAVE_ISWUPPER #undef HAVE_USLEEP #undef HAVE_UTIME #undef HAVE_BIND_TEXTDOMAIN_CODESET /* Define, if needed, for accessing large files. */ #undef _LARGE_FILES #undef _FILE_OFFSET_BITS #undef _LARGEFILE_SOURCE /* 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_INTTYPES_H #undef HAVE_LANGINFO_H #undef HAVE_LIBC_H #undef HAVE_LIBGEN_H #undef HAVE_LIBINTL_H #undef HAVE_LOCALE_H #undef HAVE_MATH_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_STDINT_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_TYPES_H #undef HAVE_SYS_UTSNAME_H #undef HAVE_TERMCAP_H #undef HAVE_TERMIOS_H #undef HAVE_TERMIO_H #undef HAVE_WCHAR_H #undef HAVE_WCTYPE_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_XM_TRAITP_H #undef HAVE_XM_MANAGER_H #undef HAVE_XM_UNHIGHLIGHTT_H #undef HAVE_XM_JOINSIDET_H #undef HAVE_XM_NOTEBOOK_H #undef HAVE_X11_XPM_H #undef HAVE_X11_XMU_EDITRES_H #undef HAVE_X11_SM_SMLIB_H /* Define to the type of the XpmAttributes type. */ #undef XPMATTRIBUTES_TYPE /* Define if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H /* Define if you have a 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_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 Lua interpreter. */ #undef FEAT_LUA /* Define for linking via dlopen() or LoadLibrary() */ #undef DYNAMIC_LUA /* Define if you want to include the MzScheme interpreter. */ #undef FEAT_MZSCHEME /* Define if you want to include the Perl interpreter. */ #undef FEAT_PERL /* Define for linking via dlopen() or LoadLibrary() */ #undef DYNAMIC_PERL /* Define if you want to include the Python interpreter. */ #undef FEAT_PYTHON /* Define if you want to include the Python3 interpreter. */ #undef FEAT_PYTHON3 /* Define for linking via dlopen() or LoadLibrary() */ #undef DYNAMIC_PYTHON /* Define for linking via dlopen() or LoadLibrary() */ #undef DYNAMIC_PYTHON3 /* Define if dynamic python does not require RTLD_GLOBAL */ #undef PY_NO_RTLD_GLOBAL /* Define if dynamic python3 does not require RTLD_GLOBAL */ #undef PY3_NO_RTLD_GLOBAL /* Define if you want to include the Ruby interpreter. */ #undef FEAT_RUBY /* Define for linking via dlopen() or LoadLibrary() */ #undef DYNAMIC_RUBY /* Define if you want to include the Tcl interpreter. */ #undef FEAT_TCL /* Define for linking via dlopen() or LoadLibrary() */ #undef DYNAMIC_TCL /* Define if you want to add support for ACL */ #undef HAVE_POSIX_ACL #undef HAVE_SOLARIS_ZFS_ACL #undef HAVE_SOLARIS_ACL #undef HAVE_AIX_ACL /* Define if pango_shape_full() is available. */ #undef HAVE_PANGO_SHAPE_FULL /* Define if you want to add support of GPM (Linux console mouse daemon) */ #undef HAVE_GPM /* Define if you want to add support of sysmouse (*BSD console mouse) */ #undef HAVE_SYSMOUSE /* 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 you use KDE and want KDE Toolbar support. */ #undef FEAT_KDETOOLBAR /* 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 if you want to include process communication. */ #undef FEAT_JOB_CHANNEL /* 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 fcntl()'s F_SETFD command knows about FD_CLOEXEC */ #undef HAVE_FD_CLOEXEC /* Define if you want Cygwin to use the WIN32 clipboard, not compatible with X11*/ #undef FEAT_CYGWIN_WIN32_CLIPBOARD /* Define if we have AvailabilityMacros.h on Mac OS X */ #undef HAVE_AVAILABILITYMACROS_H /* Define if Xutf8SetWMProperties() is in an X library. */ #undef HAVE_XUTF8SETWMPROPERTIES /* Define if GResource is used to load icons */ #undef USE_GRESOURCE /* Define if GTK+ GUI is to be linked against GTK+ 3 */ #undef USE_GTK3 /* Define if we have isinf() */ #undef HAVE_ISINF /* Define if we have isnan() */ #undef HAVE_ISNAN /* Define to inline symbol or empty */ #undef inline vim-7.4.1689/src/config.mk.dist000066400000000000000000000001561267703067000161260ustar00rootroot00000000000000the first targets to make vim are: scratch config myself srcdir = . VIMNAME = vim EXNAME = ex VIEWNAME = view vim-7.4.1689/src/config.mk.in000066400000000000000000000102641267703067000155720ustar00rootroot00000000000000# # 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@ DEPEND_CFLAGS_FILTER = @DEPEND_CFLAGS_FILTER@ LINK_AS_NEEDED = @LINK_AS_NEEDED@ 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@ LUA_LIBS = @LUA_LIBS@ LUA_SRC = @LUA_SRC@ LUA_OBJ = @LUA_OBJ@ LUA_CFLAGS = @LUA_CFLAGS@ LUA_PRO = @LUA_PRO@ MZSCHEME_LIBS = @MZSCHEME_LIBS@ MZSCHEME_SRC = @MZSCHEME_SRC@ MZSCHEME_OBJ = @MZSCHEME_OBJ@ MZSCHEME_CFLAGS = @MZSCHEME_CFLAGS@ MZSCHEME_PRO = @MZSCHEME_PRO@ MZSCHEME_EXTRA = @MZSCHEME_EXTRA@ MZSCHEME_MZC = @MZSCHEME_MZC@ PERL = @vi_cv_path_perl@ PERLLIB = @vi_cv_perllib@ PERL_XSUBPP = @vi_cv_perl_xsubpp@ 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@ PYTHON3_SRC = @PYTHON3_SRC@ PYTHON3_OBJ = @PYTHON3_OBJ@ PYTHON3_CFLAGS = @PYTHON3_CFLAGS@ PYTHON3_LIBS = @PYTHON3_LIBS@ PYTHON3_CONFDIR = @PYTHON3_CONFDIR@ 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@ CHANNEL_SRC = @CHANNEL_SRC@ CHANNEL_OBJ = @CHANNEL_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@ AWK = @AWK@ STRIP = @STRIP@ EXEEXT = @EXEEXT@ COMPILEDBY = @compiledby@ INSTALLVIMDIFF = @dovimdiff@ INSTALLGVIMDIFF = @dogvimdiff@ INSTALL_LANGS = @INSTALL_LANGS@ INSTALL_TOOL_LANGS = @INSTALL_TOOL_LANGS@ ### sed command to fix quotes while creating pathdef.c QUOTESED = @QUOTESED@ ### 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@ ### For autoconf 2.60 and later (avoid a warning) datarootdir = @datarootdir@ ### 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) GUI_TESTARG = $(@GUITYPE@_TESTARG) GUI_BUNDLE = $(@GUITYPE@_BUNDLE) NARROW_PROTO = @NARROW_PROTO@ GUI_X_LIBS = @GUI_X_LIBS@ MOTIF_LIBNAME = @MOTIF_LIBNAME@ GTK_LIBNAME = @GTK_LIBNAME@ GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@ GRESOURCE_SRC = @GRESOURCE_SRC@ GRESOURCE_OBJ = @GRESOURCE_OBJ@ ### 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@ MSGFMT = @MSGFMT@ # 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 vim-7.4.1689/src/configure000077500000000000000000000004761267703067000153020ustar00rootroot00000000000000#! /bin/sh # run the automatically generated configure script CONFIG_STATUS=auto/config.status \ auto/configure "$@" --srcdir="${srcdir:-.}" --cache-file=auto/config.cache result=$? # Stupid autoconf 2.5x causes this file to be left behind. if test -f configure.lineno; then rm -f configure.lineno; fi exit $result vim-7.4.1689/src/configure.in000066400000000000000000004220111267703067000156750ustar00rootroot00000000000000dnl 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_PROG_FGREP dnl finds working grep -F 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 extension of executables AC_EXEEXT dnl Check for standard headers. We don't use this in Vim but other stuff dnl in autoconf needs it, where it uses STDC_HEADERS. AC_HEADER_STDC AC_HEADER_SYS_WAIT dnl Check for the flag that fails if stuff are missing. AC_MSG_CHECKING(--enable-fail-if-missing argument) AC_ARG_ENABLE(fail_if_missing, [ --enable-fail-if-missing Fail if dependencies on additional features specified on the command line are missing.], [fail_if_missing="yes"], [fail_if_missing="no"]) AC_MSG_RESULT($fail_if_missing) 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 dnl method that should work for nearly all versions gccversion=`$CC -dumpversion` if test "x$gccversion" = "x"; then dnl old method; fall-back for when -dumpversion doesn't work gccversion=`$CC --version | sed -e '2,$d' -e 's/darwin.//' -e 's/^[[^0-9]]*\([[0-9]]\.[[0-9.]]*\).*$/\1/g'` fi dnl version 4.0.1 was reported to cause trouble on Macintosh by Marcin Dalecki if test "$gccversion" = "3.0.1" -o "$gccversion" = "3.0.2" -o "$gccversion" = "4.0.1"; then echo 'GCC [[34]].0.[[12]] 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 clang-500.2.75 or around has abandoned -f[no-]strength-reduce and issues a dnl warning when that flag is passed to. Accordingly, adjust CFLAGS based on dnl the version number of the clang in use. dnl Note that this does not work to get the version of clang 3.1 or 3.2. AC_MSG_CHECKING(for recent clang version) CLANG_VERSION_STRING=`$CC --version 2>/dev/null | sed -n -e 's/^.*clang.*\([[0-9]][[0-9]]*\.[[0-9]][[0-9]]*\.[[0-9]][[0-9]]*\).*$/\1/p'` if test x"$CLANG_VERSION_STRING" != x"" ; then CLANG_MAJOR=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/\([[0-9]][[0-9]]*\)\.[[0-9]][[0-9]]*\.[[0-9]][[0-9]]*/\1/p'` CLANG_MINOR=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/[[0-9]][[0-9]]*\.\([[0-9]][[0-9]]*\)\.[[0-9]][[0-9]]*/\1/p'` CLANG_REVISION=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/[[0-9]][[0-9]]*\.[[0-9]][[0-9]]*\.\([[0-9]][[0-9]]*\)/\1/p'` CLANG_VERSION=`expr $CLANG_MAJOR '*' 1000000 '+' $CLANG_MINOR '*' 1000 '+' $CLANG_REVISION` AC_MSG_RESULT($CLANG_VERSION) dnl If you find the same issue with versions earlier than 500.2.75, dnl change the constant 500002075 below appropriately. To get the dnl integer corresponding to a version number, refer to the dnl definition of CLANG_VERSION above. if test "$CLANG_VERSION" -ge 500002075 ; then CFLAGS=`echo "$CFLAGS" | sed -n -e 's/-fno-strength-reduce/ /p'` fi else AC_MSG_RESULT(no) fi dnl If configure thinks we are cross compiling, there might be something dnl wrong with the CC or CFLAGS settings, give a useful warning message if test "$cross_compiling" = yes; then AC_MSG_RESULT([cannot compile a simple program; if not cross compiling check CC and CFLAGS]) fi dnl gcc-cpp has the wonderful -MM option to produce nicer dependencies. dnl But gcc 3.1 changed the meaning! See near the end. 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 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.m; 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 AC_MSG_CHECKING(--with-mac-arch argument) AC_ARG_WITH(mac-arch, [ --with-mac-arch=ARCH current, intel, ppc or both], MACARCH="$withval"; AC_MSG_RESULT($MACARCH), MACARCH="current"; AC_MSG_RESULT(defaulting to $MACARCH)) AC_MSG_CHECKING(--with-developer-dir argument) AC_ARG_WITH(developer-dir, [ --with-developer-dir=PATH use PATH as location for Xcode developer tools], DEVELOPER_DIR="$withval"; AC_MSG_RESULT($DEVELOPER_DIR), AC_MSG_RESULT(not present)) if test "x$DEVELOPER_DIR" = "x"; then AC_PATH_PROG(XCODE_SELECT, xcode-select) if test "x$XCODE_SELECT" != "x"; then AC_MSG_CHECKING(for developer dir using xcode-select) DEVELOPER_DIR=`$XCODE_SELECT -print-path` AC_MSG_RESULT([$DEVELOPER_DIR]) else DEVELOPER_DIR=/Developer fi fi if test "x$MACARCH" = "xboth"; then AC_MSG_CHECKING(for 10.4 universal SDK) dnl There is a terrible inconsistency (but we appear to get away with it): dnl $CFLAGS uses the 10.4u SDK library for the headers, while $CPPFLAGS dnl doesn't, because "gcc -E" doesn't grok it. That means the configure dnl tests using the preprocessor are actually done with the wrong header dnl files. $LDFLAGS is set at the end, because configure uses it together dnl with $CFLAGS and we can only have one -sysroot argument. save_cppflags="$CPPFLAGS" save_cflags="$CFLAGS" save_ldflags="$LDFLAGS" CFLAGS="$CFLAGS -isysroot $DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" AC_TRY_LINK([ ], [ ], AC_MSG_RESULT(found, will make universal binary), AC_MSG_RESULT(not found) CFLAGS="$save_cflags" AC_MSG_CHECKING(if Intel architecture is supported) CPPFLAGS="$CPPFLAGS -arch i386" LDFLAGS="$save_ldflags -arch i386" AC_TRY_LINK([ ], [ ], AC_MSG_RESULT(yes); MACARCH="intel", AC_MSG_RESULT(no, using PowerPC) MACARCH="ppc" CPPFLAGS="$save_cppflags -arch ppc" LDFLAGS="$save_ldflags -arch ppc")) elif test "x$MACARCH" = "xintel"; then CPPFLAGS="$CPPFLAGS -arch intel" LDFLAGS="$LDFLAGS -arch intel" elif test "x$MACARCH" = "xppc"; then CPPFLAGS="$CPPFLAGS -arch ppc" LDFLAGS="$LDFLAGS -arch ppc" fi if test "$enable_darwin" = "yes"; then MACOSX=yes OS_EXTRA_SRC="os_macosx.m os_mac_conv.c"; OS_EXTRA_OBJ="objects/os_macosx.o objects/os_mac_conv.o" dnl TODO: use -arch i386 on Intel machines dnl Removed -no-cpp-precomp, only for very old compilers. CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX" dnl If Carbon is found, assume we don't want X11 dnl unless it was specifically asked for (--with-x) dnl or Motif, Athena or GTK GUI is used. AC_CHECK_HEADER(Carbon/Carbon.h, CARBON=yes) if test "x$CARBON" = "xyes"; then if test -z "$with_x" -a "X$enable_gui" != Xmotif -a "X$enable_gui" != Xathena -a "X$enable_gui" != Xgtk2 -a "X$enable_gui" != Xgtk3; then with_x=no fi fi fi dnl Avoid a bug with -O2 with gcc 4.0.1. Symptom: malloc() reports double dnl free. This happens in expand_filename(), because the optimizer swaps dnl two blocks of code, both using "repl", that can't be swapped. if test "$MACARCH" = "intel" -o "$MACARCH" = "both"; then CFLAGS=`echo "$CFLAGS" | sed 's/-O[[23456789]]/-Oz/'` fi else AC_MSG_RESULT(no) fi dnl Mac OS X 10.9+ no longer include AvailabilityMacros.h in Carbon dnl so we need to include it to have access to version macros. AC_CHECK_HEADERS(AvailabilityMacros.h) 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. dnl Skip all of this when cross-compiling. if test "$cross_compiling" = no; then AC_MSG_CHECKING(--with-local-dir argument) have_local_include='' have_local_lib='' AC_ARG_WITH([local-dir], [ --with-local-dir=PATH search PATH instead of /usr/local for local libraries. --without-local-dir do not search /usr/local for local libraries.], [ local_dir="$withval" case "$withval" in */*) ;; no) # avoid adding local dir to LDFLAGS and CPPFLAGS have_local_include=yes have_local_lib=yes ;; *) AC_MSG_ERROR(must pass path argument to --with-local-dir) ;; esac AC_MSG_RESULT($local_dir) ], [ local_dir=/usr/local AC_MSG_RESULT(Defaulting to $local_dir) ]) if test "$GCC" = yes -a "$local_dir" != no; then echo 'void f(){}' > conftest.c dnl Removed -no-cpp-precomp, only needed for OS X 10.2 (Ben Fowler) have_local_include=`${CC-cc} -c -v conftest.c 2>&1 | grep "${local_dir}/include"` have_local_lib=`${CC-cc} -c -v conftest.c 2>&1 | grep "${local_dir}/lib"` rm -f conftest.c conftest.o fi if test -z "$have_local_lib" -a -d "${local_dir}/lib"; then tt=`echo "$LDFLAGS" | sed -e "s+-L${local_dir}/lib ++g" -e "s+-L${local_dir}/lib$++g"` if test "$tt" = "$LDFLAGS"; then LDFLAGS="$LDFLAGS -L${local_dir}/lib" fi fi if test -z "$have_local_include" -a -d "${local_dir}/include"; then tt=`echo "$CPPFLAGS" | sed -e "s+-I${local_dir}/include ++g" -e "s+-I${local_dir}/include$++g"` if test "$tt" = "$CPPFLAGS"; then CPPFLAGS="$CPPFLAGS -I${local_dir}/include" fi 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="vim"; 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 z/OS 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 likely have z/OS Unix, let's test it! AC_MSG_CHECKING(for z/OS Unix) case `uname` in OS/390) zOSUnix="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 z/OS 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 # Set CFLAGS for configure process. # This will be reset later for config.mk. # Use haltonmsg to force error for missing H files. CFLAGS="$CFLAGS -D_ALL_SOURCE -Wc,float(ieee),haltonmsg(3296)"; LDFLAGS="$LDFLAGS -Wl,EDIT=NO" AC_MSG_RESULT(yes) ;; *) zOSUnix="no"; AC_MSG_RESULT(no) ;; esac fi dnl Set QUOTESED. Needs additional backslashes on zOS if test "$zOSUnix" = "yes"; then QUOTESED="sed -e 's/[[\\\\\"]]/\\\\\\\\&/g' -e 's/\\\\\\\\\"/\"/' -e 's/\\\\\\\\\";\$\$/\";/'" else QUOTESED="sed -e 's/[[\\\\\"]]/\\\\&/g' -e 's/\\\\\"/\"/' -e 's/\\\\\";\$\$/\";/'" fi AC_SUBST(QUOTESED) dnl Link with -lsmack for Smack stuff; if not found AC_MSG_CHECKING(--disable-smack argument) AC_ARG_ENABLE(smack, [ --disable-smack Do not check for Smack support.], , enable_smack="yes") if test "$enable_smack" = "yes"; then AC_MSG_RESULT(no) AC_CHECK_HEADER([linux/xattr.h], true, enable_smack="no") else AC_MSG_RESULT(yes) fi if test "$enable_smack" = "yes"; then AC_CHECK_HEADER([attr/xattr.h], true, enable_smack="no") fi if test "$enable_smack" = "yes"; then AC_MSG_CHECKING(for XATTR_NAME_SMACKEXEC in linux/xattr.h) AC_EGREP_CPP(XATTR_NAME_SMACKEXEC, [#include ], AC_MSG_RESULT(yes), AC_MSG_RESULT(no); enable_smack="no") fi if test "$enable_smack" = "yes"; then AC_CHECK_LIB(attr, setxattr, [LIBS="$LIBS -lattr" found_smack="yes" AC_DEFINE(HAVE_SMACK)]) fi dnl When smack was found don't search for SELinux if test "x$found_smack" = "x"; then dnl Link with -lselinux for SELinux stuff; if not found AC_MSG_CHECKING(--disable-selinux argument) AC_ARG_ENABLE(selinux, [ --disable-selinux Do not check for SELinux support.], , enable_selinux="yes") if test "$enable_selinux" = "yes"; then AC_MSG_RESULT(no) AC_CHECK_LIB(selinux, is_selinux_enabled, [LIBS="$LIBS -lselinux" AC_DEFINE(HAVE_SELINUX)]) else AC_MSG_RESULT(yes) fi 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="huge"; AC_MSG_RESULT(Defaulting to huge)) 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 dnl Check for Lua feature. AC_MSG_CHECKING(--enable-luainterp argument) AC_ARG_ENABLE(luainterp, [ --enable-luainterp[=OPTS] Include Lua interpreter. [default=no] [OPTS=no/yes/dynamic]], , [enable_luainterp="no"]) AC_MSG_RESULT($enable_luainterp) if test "$enable_luainterp" = "yes" -o "$enable_luainterp" = "dynamic"; then if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then AC_MSG_ERROR([cannot use Lua with tiny or small features]) fi dnl -- find the lua executable AC_SUBST(vi_cv_path_lua) AC_MSG_CHECKING(--with-lua-prefix argument) AC_ARG_WITH(lua_prefix, [ --with-lua-prefix=PFX Prefix where Lua is installed.], with_lua_prefix="$withval"; AC_MSG_RESULT($with_lua_prefix), with_lua_prefix="";AC_MSG_RESULT(no)) if test "X$with_lua_prefix" != "X"; then vi_cv_path_lua_pfx="$with_lua_prefix" else AC_MSG_CHECKING(LUA_PREFIX environment var) if test "X$LUA_PREFIX" != "X"; then AC_MSG_RESULT("$LUA_PREFIX") vi_cv_path_lua_pfx="$LUA_PREFIX" else AC_MSG_RESULT([not set, default to /usr]) vi_cv_path_lua_pfx="/usr" fi fi AC_MSG_CHECKING(--with-luajit) AC_ARG_WITH(luajit, [ --with-luajit Link with LuaJIT instead of Lua.], [vi_cv_with_luajit="$withval"], [vi_cv_with_luajit="no"]) AC_MSG_RESULT($vi_cv_with_luajit) LUA_INC= if test "X$vi_cv_path_lua_pfx" != "X"; then if test "x$vi_cv_with_luajit" != "xno"; then dnl -- try to find LuaJIT executable AC_PATH_PROG(vi_cv_path_luajit, luajit) if test "X$vi_cv_path_luajit" != "X"; then dnl -- find LuaJIT version AC_CACHE_CHECK(LuaJIT version, vi_cv_version_luajit, [ vi_cv_version_luajit=`${vi_cv_path_luajit} -v 2>&1 | sed 's/LuaJIT \([[0-9.]]*\)\.[[0-9]]\(-[[a-z0-9]]*\)* .*/\1/'` ]) AC_CACHE_CHECK(Lua version of LuaJIT, vi_cv_version_lua_luajit, [ vi_cv_version_lua_luajit=`${vi_cv_path_luajit} -e "print(_VERSION)" | sed 's/.* //'` ]) vi_cv_path_lua="$vi_cv_path_luajit" vi_cv_version_lua="$vi_cv_version_lua_luajit" fi else dnl -- try to find Lua executable AC_PATH_PROG(vi_cv_path_plain_lua, lua) if test "X$vi_cv_path_plain_lua" != "X"; then dnl -- find Lua version AC_CACHE_CHECK(Lua version, vi_cv_version_plain_lua, [ vi_cv_version_plain_lua=`${vi_cv_path_plain_lua} -e "print(_VERSION)" | sed 's/.* //'` ]) fi vi_cv_path_lua="$vi_cv_path_plain_lua" vi_cv_version_lua="$vi_cv_version_plain_lua" fi if test "x$vi_cv_with_luajit" != "xno" && test "X$vi_cv_version_luajit" != "X"; then AC_MSG_CHECKING(if lua.h can be found in $vi_cv_path_lua_pfx/include/luajit-$vi_cv_version_luajit) if test -f "$vi_cv_path_lua_pfx/include/luajit-$vi_cv_version_luajit/lua.h"; then AC_MSG_RESULT(yes) LUA_INC=/luajit-$vi_cv_version_luajit fi fi if test "X$LUA_INC" = "X"; then AC_MSG_CHECKING(if lua.h can be found in $vi_cv_path_lua_pfx/include) if test -f "$vi_cv_path_lua_pfx/include/lua.h"; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) AC_MSG_CHECKING(if lua.h can be found in $vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua) if test -f "$vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua/lua.h"; then AC_MSG_RESULT(yes) LUA_INC=/lua$vi_cv_version_lua else AC_MSG_RESULT(no) vi_cv_path_lua_pfx= fi fi fi fi if test "X$vi_cv_path_lua_pfx" != "X"; then if test "x$vi_cv_with_luajit" != "xno"; then multiarch=`dpkg-architecture -qDEB_HOST_MULTIARCH 2> /dev/null` if test "X$multiarch" != "X"; then lib_multiarch="lib/${multiarch}" else lib_multiarch="lib" fi if test "X$vi_cv_version_lua" = "X"; then LUA_LIBS="-L${vi_cv_path_lua_pfx}/${lib_multiarch} -lluajit" else LUA_LIBS="-L${vi_cv_path_lua_pfx}/${lib_multiarch} -lluajit-$vi_cv_version_lua" fi else if test "X$LUA_INC" != "X"; then dnl Test alternate location using version LUA_LIBS="-L${vi_cv_path_lua_pfx}/lib -llua$vi_cv_version_lua" else LUA_LIBS="-L${vi_cv_path_lua_pfx}/lib -llua" fi fi if test "$enable_luainterp" = "dynamic"; then lua_ok="yes" else AC_MSG_CHECKING([if link with ${LUA_LIBS} is sane]) libs_save=$LIBS LIBS="$LIBS $LUA_LIBS" AC_TRY_LINK(,[ ], AC_MSG_RESULT(yes); lua_ok="yes", AC_MSG_RESULT(no); lua_ok="no"; LUA_LIBS="") LIBS=$libs_save fi if test "x$lua_ok" = "xyes"; then LUA_CFLAGS="-I${vi_cv_path_lua_pfx}/include${LUA_INC}" LUA_SRC="if_lua.c" LUA_OBJ="objects/if_lua.o" LUA_PRO="if_lua.pro" AC_DEFINE(FEAT_LUA) fi if test "$enable_luainterp" = "dynamic"; then if test "x$vi_cv_with_luajit" != "xno"; then luajit="jit" fi if test -f "${vi_cv_path_lua_pfx}/bin/cyglua-${vi_cv_version_lua}.dll"; then vi_cv_dll_name_lua="cyglua-${vi_cv_version_lua}.dll" else if test "x$MACOSX" = "xyes"; then ext="dylib" indexes="" else ext="so" indexes=".0 .1 .2 .3 .4 .5 .6 .7 .8 .9" multiarch=`dpkg-architecture -qDEB_HOST_MULTIARCH 2> /dev/null` if test "X$multiarch" != "X"; then lib_multiarch="lib/${multiarch}" fi fi dnl Determine the sover for the current version, but fallback to dnl liblua${vi_cv_version_lua}.so if no sover-versioned file is found. AC_MSG_CHECKING(if liblua${luajit}*.${ext}* can be found in $vi_cv_path_lua_pfx) for subdir in "${lib_multiarch}" lib64 lib; do if test -z "$subdir"; then continue fi for sover in "${vi_cv_version_lua}.${ext}" "-${vi_cv_version_lua}.${ext}" \ ".${vi_cv_version_lua}.${ext}" ".${ext}.${vi_cv_version_lua}"; do for i in $indexes ""; do if test -f "${vi_cv_path_lua_pfx}/${subdir}/liblua${luajit}${sover}$i"; then sover2="$i" break 3 fi done done sover="" done if test "X$sover" = "X"; then AC_MSG_RESULT(no) lua_ok="no" vi_cv_dll_name_lua="liblua${luajit}.${ext}" else AC_MSG_RESULT(yes) lua_ok="yes" vi_cv_dll_name_lua="liblua${luajit}${sover}$sover2" fi fi AC_DEFINE(DYNAMIC_LUA) LUA_LIBS="" LUA_CFLAGS="-DDYNAMIC_LUA_DLL=\\\"${vi_cv_dll_name_lua}\\\" $LUA_CFLAGS" fi if test "X$LUA_CFLAGS$LUA_LIBS" != "X" && \ test "x$MACOSX" = "xyes" && test "x$vi_cv_with_luajit" != "xno" && \ test "`(uname -m) 2>/dev/null`" = "x86_64"; then dnl OSX/x64 requires these flags. See http://luajit.org/install.html LUA_LIBS="-pagezero_size 10000 -image_base 100000000 $LUA_LIBS" fi fi if test "$fail_if_missing" = "yes" -a "$lua_ok" != "yes"; then AC_MSG_ERROR([could not configure lua]) fi AC_SUBST(LUA_SRC) AC_SUBST(LUA_OBJ) AC_SUBST(LUA_PRO) AC_SUBST(LUA_LIBS) AC_SUBST(LUA_CFLAGS) fi dnl Check for MzScheme feature. AC_MSG_CHECKING(--enable-mzschemeinterp argument) AC_ARG_ENABLE(mzschemeinterp, [ --enable-mzschemeinterp Include MzScheme interpreter.], , [enable_mzschemeinterp="no"]) AC_MSG_RESULT($enable_mzschemeinterp) if test "$enable_mzschemeinterp" = "yes"; then dnl -- find the mzscheme executable AC_SUBST(vi_cv_path_mzscheme) AC_MSG_CHECKING(--with-plthome argument) AC_ARG_WITH(plthome, [ --with-plthome=PLTHOME Use PLTHOME.], with_plthome="$withval"; AC_MSG_RESULT($with_plthome), with_plthome="";AC_MSG_RESULT("no")) if test "X$with_plthome" != "X"; then vi_cv_path_mzscheme_pfx="$with_plthome" vi_cv_path_mzscheme="${vi_cv_path_mzscheme_pfx}/bin/mzscheme" else AC_MSG_CHECKING(PLTHOME environment var) if test "X$PLTHOME" != "X"; then AC_MSG_RESULT("$PLTHOME") vi_cv_path_mzscheme_pfx="$PLTHOME" vi_cv_path_mzscheme="${vi_cv_path_mzscheme_pfx}/bin/mzscheme" else AC_MSG_RESULT(not set) dnl -- try to find MzScheme executable AC_PATH_PROG(vi_cv_path_mzscheme, mzscheme) dnl resolve symbolic link, the executable is often elsewhere and there dnl are no links for the include files. if test "X$vi_cv_path_mzscheme" != "X"; then lsout=`ls -l $vi_cv_path_mzscheme` if echo "$lsout" | grep -e '->' >/dev/null 2>/dev/null; then vi_cv_path_mzscheme=`echo "$lsout" | sed 's/.*-> \(.*\)/\1/'` fi fi if test "X$vi_cv_path_mzscheme" != "X"; then dnl -- find where MzScheme thinks it was installed AC_CACHE_CHECK(MzScheme install prefix,vi_cv_path_mzscheme_pfx, dnl different versions of MzScheme differ in command line processing dnl use universal approach echo "(display (simplify-path \ (build-path (call-with-values \ (lambda () (split-path (find-system-path (quote exec-file)))) \ (lambda (base name must-be-dir?) base)) (quote up))))" > mzdirs.scm dnl Remove a trailing slash [ vi_cv_path_mzscheme_pfx=`${vi_cv_path_mzscheme} -r mzdirs.scm | \ sed -e 's+/$++'` ]) rm -f mzdirs.scm fi fi fi if test "X$vi_cv_path_mzscheme_pfx" != "X"; then AC_MSG_CHECKING(for racket include directory) SCHEME_INC=`${vi_cv_path_mzscheme} -e '(require setup/dirs)(let ((p (find-include-dir))) (when (path? p) (display p)))'` if test "X$SCHEME_INC" != "X"; then AC_MSG_RESULT(${SCHEME_INC}) else AC_MSG_RESULT(not found) AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include) if test -f "$vi_cv_path_mzscheme_pfx/include/scheme.h"; then SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/plt) if test -f "$vi_cv_path_mzscheme_pfx/include/plt/scheme.h"; then AC_MSG_RESULT(yes) SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include/plt else AC_MSG_RESULT(no) AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/racket) if test -f "$vi_cv_path_mzscheme_pfx/include/racket/scheme.h"; then AC_MSG_RESULT(yes) SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include/racket else AC_MSG_RESULT(no) AC_MSG_CHECKING(if scheme.h can be found in /usr/include/plt/) if test -f /usr/include/plt/scheme.h; then AC_MSG_RESULT(yes) SCHEME_INC=/usr/include/plt else AC_MSG_RESULT(no) AC_MSG_CHECKING(if scheme.h can be found in /usr/include/racket/) if test -f /usr/include/racket/scheme.h; then AC_MSG_RESULT(yes) SCHEME_INC=/usr/include/racket else AC_MSG_RESULT(no) vi_cv_path_mzscheme_pfx= fi fi fi fi fi fi fi if test "X$vi_cv_path_mzscheme_pfx" != "X"; then AC_MSG_CHECKING(for racket lib directory) SCHEME_LIB=`${vi_cv_path_mzscheme} -e '(require setup/dirs)(let ((p (find-lib-dir))) (when (path? p) (display p)))'` if test "X$SCHEME_LIB" != "X"; then AC_MSG_RESULT(${SCHEME_LIB}) else AC_MSG_RESULT(not found) fi for path in "${vi_cv_path_mzscheme_pfx}/lib" "${SCHEME_LIB}"; do if test "X$path" != "X"; then if test "x$MACOSX" = "xyes"; then MZSCHEME_LIBS="-framework Racket" MZSCHEME_CFLAGS="-DMZ_PRECISE_GC" elif test -f "${path}/libmzscheme3m.a"; then MZSCHEME_LIBS="${path}/libmzscheme3m.a" MZSCHEME_CFLAGS="-DMZ_PRECISE_GC" elif test -f "${path}/libracket3m.a"; then MZSCHEME_LIBS="${path}/libracket3m.a" MZSCHEME_CFLAGS="-DMZ_PRECISE_GC" elif test -f "${path}/libracket.a"; then MZSCHEME_LIBS="${path}/libracket.a ${path}/libmzgc.a" elif test -f "${path}/libmzscheme.a"; then MZSCHEME_LIBS="${path}/libmzscheme.a ${path}/libmzgc.a" else dnl Using shared objects if test -f "${path}/libmzscheme3m.so"; then MZSCHEME_LIBS="-L${path} -lmzscheme3m" MZSCHEME_CFLAGS="-DMZ_PRECISE_GC" elif test -f "${path}/libracket3m.so"; then MZSCHEME_LIBS="-L${path} -lracket3m" MZSCHEME_CFLAGS="-DMZ_PRECISE_GC" elif test -f "${path}/libracket.so"; then MZSCHEME_LIBS="-L${path} -lracket -lmzgc" else dnl try next until last if test "$path" != "$SCHEME_LIB"; then continue fi MZSCHEME_LIBS="-L${path} -lmzscheme -lmzgc" fi if test "$GCC" = yes; then dnl Make Vim remember the path to the library. For when it's not in dnl $LD_LIBRARY_PATH. MZSCHEME_LIBS="${MZSCHEME_LIBS} -Wl,-rpath -Wl,${path}" elif test "`(uname) 2>/dev/null`" = SunOS && uname -r | grep '^5' >/dev/null; then MZSCHEME_LIBS="${MZSCHEME_LIBS} -R ${path}" fi fi fi if test "X$MZSCHEME_LIBS" != "X"; then break fi done AC_MSG_CHECKING([if racket requires -pthread]) if test "X$SCHEME_LIB" != "X" && $FGREP -e -pthread "$SCHEME_LIB/buildinfo" >/dev/null ; then AC_MSG_RESULT(yes) MZSCHEME_LIBS="${MZSCHEME_LIBS} -pthread" MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -pthread" else AC_MSG_RESULT(no) fi AC_MSG_CHECKING(for racket config directory) SCHEME_CONFIGDIR=`${vi_cv_path_mzscheme} -e '(require setup/dirs)(let ((p (find-config-dir))) (when (path? p) (display p)))'` if test "X$SCHEME_CONFIGDIR" != "X"; then MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -DMZSCHEME_CONFIGDIR='\"${SCHEME_CONFIGDIR}\"'" AC_MSG_RESULT(${SCHEME_CONFIGDIR}) else AC_MSG_RESULT(not found) fi AC_MSG_CHECKING(for racket collects directory) SCHEME_COLLECTS=`${vi_cv_path_mzscheme} -e '(require setup/dirs)(let ((p (find-collects-dir))) (when (path? p) (let-values (((base _1 _2) (split-path p))) (display base))))'` if test "X$SCHEME_COLLECTS" = "X"; then if test -d "$vi_cv_path_mzscheme_pfx/lib/plt/collects"; then SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/lib/plt/ else if test -d "$vi_cv_path_mzscheme_pfx/lib/racket/collects"; then SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/lib/racket/ else if test -d "$vi_cv_path_mzscheme_pfx/share/racket/collects"; then SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/share/racket/ else if test -d "$vi_cv_path_mzscheme_pfx/collects"; then SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/ fi fi fi fi fi if test "X$SCHEME_COLLECTS" != "X" ; then AC_MSG_RESULT(${SCHEME_COLLECTS}) else AC_MSG_RESULT(not found) fi AC_MSG_CHECKING(for mzscheme_base.c) if test -f "${SCHEME_COLLECTS}collects/scheme/base.ss" ; then MZSCHEME_EXTRA="mzscheme_base.c" MZSCHEME_MZC="${vi_cv_path_mzscheme_pfx}/bin/mzc" MZSCHEME_MOD="++lib scheme/base" else if test -f "${SCHEME_COLLECTS}collects/scheme/base.rkt" ; then MZSCHEME_EXTRA="mzscheme_base.c" MZSCHEME_MZC="${vi_cv_path_mzscheme_pfx}/bin/mzc" MZSCHEME_MOD="++lib scheme/base" else if test -f "${SCHEME_COLLECTS}collects/racket/base.rkt" ; then MZSCHEME_EXTRA="mzscheme_base.c" MZSCHEME_MZC="${vi_cv_path_mzscheme_pfx}/bin/raco ctool" MZSCHEME_MOD="" fi fi fi if test "X$MZSCHEME_EXTRA" != "X" ; then dnl need to generate bytecode for MzScheme base MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -DINCLUDE_MZSCHEME_BASE" AC_MSG_RESULT(needed) else AC_MSG_RESULT(not needed) fi dnl On Ubuntu this fixes "undefined reference to symbol 'ffi_type_void'". AC_CHECK_LIB(ffi, ffi_type_void, [MZSCHEME_LIBS="$MZSCHEME_LIBS -lffi"]) MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -I${SCHEME_INC} \ -DMZSCHEME_COLLECTS='\"${SCHEME_COLLECTS}collects\"'" dnl Test that we can compile a simple program with these CFLAGS and LIBS. AC_MSG_CHECKING([if compile and link flags for MzScheme are sane]) cflags_save=$CFLAGS libs_save=$LIBS CFLAGS="$CFLAGS $MZSCHEME_CFLAGS" LIBS="$LIBS $MZSCHEME_LIBS" AC_TRY_LINK(,[ ], AC_MSG_RESULT(yes); mzs_ok=yes, AC_MSG_RESULT(no: MZSCHEME DISABLED); mzs_ok=no) CFLAGS=$cflags_save LIBS=$libs_save if test $mzs_ok = yes; then MZSCHEME_SRC="if_mzsch.c" MZSCHEME_OBJ="objects/if_mzsch.o" MZSCHEME_PRO="if_mzsch.pro" AC_DEFINE(FEAT_MZSCHEME) else MZSCHEME_CFLAGS= MZSCHEME_LIBS= MZSCHEME_EXTRA= MZSCHEME_MZC= fi fi AC_SUBST(MZSCHEME_SRC) AC_SUBST(MZSCHEME_OBJ) AC_SUBST(MZSCHEME_PRO) AC_SUBST(MZSCHEME_LIBS) AC_SUBST(MZSCHEME_CFLAGS) AC_SUBST(MZSCHEME_EXTRA) AC_SUBST(MZSCHEME_MZC) fi AC_MSG_CHECKING(--enable-perlinterp argument) AC_ARG_ENABLE(perlinterp, [ --enable-perlinterp[=OPTS] Include Perl interpreter. [default=no] [OPTS=no/yes/dynamic]], , [enable_perlinterp="no"]) AC_MSG_RESULT($enable_perlinterp) if test "$enable_perlinterp" = "yes" -o "$enable_perlinterp" = "dynamic"; then if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then AC_MSG_ERROR([cannot use Perl with tiny or small features]) fi 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` eval `$vi_cv_path_perl -V:libperl` 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) vi_cv_perl_extutils=unknown_perl_extutils_path for extutils_rel_path in ExtUtils vendor_perl/ExtUtils; do xsubpp_path="$vi_cv_perllib/$extutils_rel_path/xsubpp" if test -f "$xsubpp_path"; then vi_cv_perl_xsubpp="$xsubpp_path" fi done AC_SUBST(vi_cv_perl_xsubpp) dnl Remove "-fno-something", it breaks using cproto. dnl Remove "-fdebug-prefix-map", it isn't supported by clang. perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \ -e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[[^ ]]*//' \ -e 's/-fdebug-prefix-map[[^ ]]*//g'` 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" perlldflags=`echo "$perlldflags" | sed -e 's/^ *//g'` 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 dnl remove -pipe and -Wxxx, it confuses cproto PERL_CFLAGS=`echo "$perlcppflags" | sed -e 's/-pipe //' -e 's/-W[[^ ]]*//'` fi if test "X$perlldflags" != "X"; then if test "X`echo \"$LDFLAGS\" | $FGREP -e \"$perlldflags\"`" = "X"; then LDFLAGS="$perlldflags $LDFLAGS" fi 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 later 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 dnl Perl on Mac OS X 10.5 adds "-arch" flags but these should only dnl be included if requested by passing --with-mac-arch to dnl configure, so strip these flags first (if present) PERL_LIBS=`echo "$PERL_LIBS" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'` PERL_CFLAGS=`echo "$PERL_CFLAGS" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'` fi if test "$enable_perlinterp" = "dynamic"; then if test "$perl_ok" = "yes" -a "X$libperl" != "X"; then AC_DEFINE(DYNAMIC_PERL) PERL_CFLAGS="-DDYNAMIC_PERL_DLL=\\\"$libperl\\\" $PERL_CFLAGS" fi fi if test "$fail_if_missing" = "yes" -a "$perl_ok" != "yes"; then AC_MSG_ERROR([could not configure perl]) 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[=OPTS] Include Python interpreter. [default=no] [OPTS=no/yes/dynamic]], , [enable_pythoninterp="no"]) AC_MSG_RESULT($enable_pythoninterp) if test "$enable_pythoninterp" = "yes" -o "$enable_pythoninterp" = "dynamic"; then if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then AC_MSG_ERROR([cannot use Python with tiny or small features]) fi dnl -- find the python executable AC_PATH_PROGS(vi_cv_path_python, python2 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 2.3 AC_MSG_CHECKING(Python is 2.3 or better) if ${vi_cv_path_python} -c \ "import sys; sys.exit(${vi_cv_var_python_version} < 2.3)" 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= d=`${vi_cv_path_python} -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('LIBPL')"` if test -d "$d" && test -f "$d/config.c"; then vi_cv_path_python_conf="$d" else for path in "${vi_cv_path_python_pfx}" "${vi_cv_path_python_epfx}"; do for subdir in lib64 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 ]) 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, [ pwd=`pwd` tmp_mkf="$pwd/config-PyMake$$" cat -- "${PYTHON_CONFDIR}/Makefile" - <<'eof' >"${tmp_mkf}" __: @echo "python_BASEMODLIBS='$(BASEMODLIBS)'" @echo "python_LIBS='$(LIBS)'" @echo "python_SYSLIBS='$(SYSLIBS)'" @echo "python_LINKFORSHARED='$(LINKFORSHARED)'" @echo "python_DLLLIBRARY='$(DLLLIBRARY)'" @echo "python_INSTSONAME='$(INSTSONAME)'" @echo "python_PYTHONFRAMEWORK='$(PYTHONFRAMEWORK)'" @echo "python_PYTHONFRAMEWORKPREFIX='$(PYTHONFRAMEWORKPREFIX)'" @echo "python_PYTHONFRAMEWORKINSTALLDIR='$(PYTHONFRAMEWORKINSTALLDIR)'" 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" if test "x${vi_cv_path_python}" != "x/usr/bin/python" && test -n "${python_PYTHONFRAMEWORKPREFIX}"; then vi_cv_path_python_plibs="-F${python_PYTHONFRAMEWORKPREFIX} -framework Python" fi 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 dnl -- Check if the path contained in python_LINKFORSHARED is dnl usable for vim build. If not, make and try other dnl candidates. if test -n "${python_LINKFORSHARED}" && test -n "${python_PYTHONFRAMEWORKPREFIX}"; then python_link_symbol=`echo ${python_LINKFORSHARED} | sed 's/\([[^ \t]][[^ \t]]*[[ \t]][[ \t]]*[[^ \t]][[^ \t]]*\)[[ \t]].*/\1/'` python_link_path=`echo ${python_LINKFORSHARED} | sed 's/\([[^ \t]][[^ \t]]*[[ \t]][[ \t]]*[[^ \t]][[^ \t]]*\)[[ \t]][[ \t]]*\(.*\)/\2/'` if test -n "${python_link_path}" && ! test -x "${python_link_path}"; then dnl -- The path looks relative. Guess the absolute one using dnl the prefix and try that. python_link_path="${python_PYTHONFRAMEWORKPREFIX}/${python_link_path}" if test -n "${python_link_path}" && ! test -x "${python_link_path}"; then dnl -- A last resort. python_link_path="${python_PYTHONFRAMEWORKINSTALLDIR}/Versions/${vi_cv_var_python_version}/${python_PYTHONFRAMEWORK}" dnl -- No check is done. The last word is left to the dnl "sanity" test on link flags that follows shortly. fi python_LINKFORSHARED="${python_link_symbol} ${python_link_path}" fi fi vi_cv_path_python_plibs="${vi_cv_path_python_plibs} ${python_BASEMODLIBS} ${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 ]) AC_CACHE_CHECK(Python's dll name,vi_cv_dll_name_python, [ if test "X$python_DLLLIBRARY" != "X"; then vi_cv_dll_name_python="$python_DLLLIBRARY" else vi_cv_dll_name_python="$python_INSTSONAME" 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} -DPYTHON_HOME='\"${vi_cv_path_python_pfx}\"'" 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} -DPYTHON_HOME='\"${vi_cv_path_python_pfx}\"'" fi PYTHON_SRC="if_python.c" PYTHON_OBJ="objects/if_python.o" 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= dnl if test "x$MACOSX" != "xyes"; then if test "`(uname) 2>/dev/null`" != Darwin; then test "$GCC" = yes && threadsafe_flag="-pthread" if test "`(uname) 2>/dev/null`" = FreeBSD; then threadsafe_flag="-D_THREAD_SAFE" thread_lib="-pthread" fi if test "`(uname) 2>/dev/null`" = SunOS; then threadsafe_flag="-pthreads" 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 if test "$fail_if_missing" = "yes" -a "$python_ok" != "yes"; then AC_MSG_ERROR([could not configure python]) 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-python3interp argument) AC_ARG_ENABLE(python3interp, [ --enable-python3interp[=OPTS] Include Python3 interpreter. [default=no] [OPTS=no/yes/dynamic]], , [enable_python3interp="no"]) AC_MSG_RESULT($enable_python3interp) if test "$enable_python3interp" = "yes" -o "$enable_python3interp" = "dynamic"; then if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then AC_MSG_ERROR([cannot use Python with tiny or small features]) fi dnl -- find the python3 executable AC_PATH_PROGS(vi_cv_path_python3, python3 python) if test "X$vi_cv_path_python3" != "X"; then dnl -- get its version number AC_CACHE_CHECK(Python version,vi_cv_var_python3_version, [[vi_cv_var_python3_version=` ${vi_cv_path_python3} -c 'import sys; print(sys.version[:3])'` ]]) dnl -- it must be at least version 3 AC_MSG_CHECKING(Python is 3.0 or better) if ${vi_cv_path_python3} -c \ "import sys; sys.exit(${vi_cv_var_python3_version} < 3.0)" then AC_MSG_RESULT(yep) dnl -- get abiflags for python 3.2 or higher (PEP 3149) AC_CACHE_CHECK(Python's abiflags,vi_cv_var_python3_abiflags, [ vi_cv_var_python3_abiflags= if ${vi_cv_path_python3} -c \ "import sys; sys.exit(${vi_cv_var_python3_version} < 3.2)" then vi_cv_var_python3_abiflags=`${vi_cv_path_python3} -c \ "import sys; print(sys.abiflags)"` fi ]) dnl -- find where python3 thinks it was installed AC_CACHE_CHECK(Python's install prefix,vi_cv_path_python3_pfx, [ vi_cv_path_python3_pfx=` ${vi_cv_path_python3} -c \ "import sys; print(sys.prefix)"` ]) dnl -- and where it thinks it runs AC_CACHE_CHECK(Python's execution prefix,vi_cv_path_python3_epfx, [ vi_cv_path_python3_epfx=` ${vi_cv_path_python3} -c \ "import sys; print(sys.exec_prefix)"` ]) dnl -- python3's internal library path AC_CACHE_VAL(vi_cv_path_python3path, [ vi_cv_path_python3path=` unset PYTHONPATH; ${vi_cv_path_python3} -c \ "import sys, string; print(':'.join(sys.path))"` ]) dnl -- where the Python implementation library archives are AC_ARG_WITH(python3-config-dir, [ --with-python3-config-dir=PATH Python's config directory], [ vi_cv_path_python3_conf="${withval}" ] ) AC_CACHE_CHECK(Python's configuration directory,vi_cv_path_python3_conf, [ vi_cv_path_python3_conf= config_dir="config-${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}" d=`${vi_cv_path_python3} -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBPL'))"` if test -d "$d" && test -f "$d/config.c"; then vi_cv_path_python3_conf="$d" else for path in "${vi_cv_path_python3_pfx}" "${vi_cv_path_python3_epfx}"; do for subdir in lib64 lib share; do d="${path}/${subdir}/python${vi_cv_var_python3_version}/${config_dir}" if test -d "$d" && test -f "$d/config.c"; then vi_cv_path_python3_conf="$d" fi done done fi ]) PYTHON3_CONFDIR="${vi_cv_path_python3_conf}" if test "X$PYTHON3_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_python3_plibs, [ pwd=`pwd` tmp_mkf="$pwd/config-PyMake$$" cat -- "${PYTHON3_CONFDIR}/Makefile" - <<'eof' >"${tmp_mkf}" __: @echo "python3_BASEMODLIBS='$(BASEMODLIBS)'" @echo "python3_LIBS='$(LIBS)'" @echo "python3_SYSLIBS='$(SYSLIBS)'" @echo "python3_DLLLIBRARY='$(DLLLIBRARY)'" @echo "python3_INSTSONAME='$(INSTSONAME)'" eof dnl -- delete the lines from make about Entering/Leaving directory eval "`cd ${PYTHON3_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`" rm -f -- "${tmp_mkf}" vi_cv_path_python3_plibs="-L${PYTHON3_CONFDIR} -lpython${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}" vi_cv_path_python3_plibs="${vi_cv_path_python3_plibs} ${python3_BASEMODLIBS} ${python3_LIBS} ${python3_SYSLIBS}" dnl remove -ltermcap, it can conflict with an earlier -lncurses vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-ltermcap//` vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-lffi//` ]) AC_CACHE_CHECK(Python3's dll name,vi_cv_dll_name_python3, [ if test "X$python3_DLLLIBRARY" != "X"; then vi_cv_dll_name_python3="$python3_DLLLIBRARY" else vi_cv_dll_name_python3="$python3_INSTSONAME" fi ]) PYTHON3_LIBS="${vi_cv_path_python3_plibs}" if test "${vi_cv_path_python3_pfx}" = "${vi_cv_path_python3_epfx}"; then PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME='L\"${vi_cv_path_python3_pfx}\"'" else PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -I${vi_cv_path_python3_epfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME='L\"${vi_cv_path_python3_pfx}\"'" fi PYTHON3_SRC="if_python3.c" PYTHON3_OBJ="objects/if_python3.o" 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= dnl if test "x$MACOSX" != "xyes"; then if test "`(uname) 2>/dev/null`" != Darwin; then test "$GCC" = yes && threadsafe_flag="-pthread" if test "`(uname) 2>/dev/null`" = FreeBSD; then threadsafe_flag="-D_THREAD_SAFE" thread_lib="-pthread" fi if test "`(uname) 2>/dev/null`" = SunOS; then threadsafe_flag="-pthreads" 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); PYTHON3_CFLAGS="$PYTHON3_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 3 are sane]) cflags_save=$CFLAGS libs_save=$LIBS CFLAGS="$CFLAGS $PYTHON3_CFLAGS" LIBS="$LIBS $PYTHON3_LIBS" AC_TRY_LINK(,[ ], AC_MSG_RESULT(yes); python3_ok=yes, AC_MSG_RESULT(no: PYTHON3 DISABLED); python3_ok=no) CFLAGS=$cflags_save LIBS=$libs_save if test "$python3_ok" = yes; then AC_DEFINE(FEAT_PYTHON3) else LIBS=$libs_save_old PYTHON3_SRC= PYTHON3_OBJ= PYTHON3_LIBS= PYTHON3_CFLAGS= fi fi else AC_MSG_RESULT(too old) fi fi if test "$fail_if_missing" = "yes" -a "$python3_ok" != "yes"; then AC_MSG_ERROR([could not configure python3]) fi fi AC_SUBST(PYTHON3_CONFDIR) AC_SUBST(PYTHON3_LIBS) AC_SUBST(PYTHON3_CFLAGS) AC_SUBST(PYTHON3_SRC) AC_SUBST(PYTHON3_OBJ) dnl if python2.x and python3.x are enabled one can only link in code dnl with dlopen(), dlsym(), dlclose() if test "$python_ok" = yes && test "$python3_ok" = yes; then AC_DEFINE(DYNAMIC_PYTHON) AC_DEFINE(DYNAMIC_PYTHON3) AC_MSG_CHECKING(whether we can do without RTLD_GLOBAL for Python) cflags_save=$CFLAGS CFLAGS="$CFLAGS $PYTHON_CFLAGS" libs_save=$LIBS dnl -ldl must go first to make this work on Archlinux (Roland Puntaier) LIBS="-ldl $LIBS" AC_RUN_IFELSE([AC_LANG_SOURCE([ #include /* If this program fails, then RTLD_GLOBAL is needed. * RTLD_GLOBAL will be used and then it is not possible to * have both python versions enabled in the same vim instance. * Only the first python version used will be switched on. */ int no_rtl_global_needed_for(char *python_instsoname, char *prefix) { int needed = 0; void* pylib = dlopen(python_instsoname, RTLD_LAZY|RTLD_LOCAL); if (pylib != 0) { void (*pfx)(char *home) = dlsym(pylib, "Py_SetPythonHome"); void (*init)(void) = dlsym(pylib, "Py_Initialize"); int (*simple)(char*) = dlsym(pylib, "PyRun_SimpleString"); void (*final)(void) = dlsym(pylib, "Py_Finalize"); (*pfx)(prefix); (*init)(); needed = (*simple)("import termios") == -1; (*final)(); dlclose(pylib); } return !needed; } int main(int argc, char** argv) { int not_needed = 0; if (no_rtl_global_needed_for("${vi_cv_dll_name_python}", "${vi_cv_path_python_pfx}")) not_needed = 1; return !not_needed; }])], [AC_MSG_RESULT(yes);AC_DEFINE(PY_NO_RTLD_GLOBAL)], [AC_MSG_RESULT(no)]) CFLAGS=$cflags_save LIBS=$libs_save AC_MSG_CHECKING(whether we can do without RTLD_GLOBAL for Python3) cflags_save=$CFLAGS CFLAGS="$CFLAGS $PYTHON3_CFLAGS" libs_save=$LIBS dnl -ldl must go first to make this work on Archlinux (Roland Puntaier) LIBS="-ldl $LIBS" AC_RUN_IFELSE([AC_LANG_SOURCE([ #include #include /* If this program fails, then RTLD_GLOBAL is needed. * RTLD_GLOBAL will be used and then it is not possible to * have both python versions enabled in the same vim instance. * Only the first python version used will be switched on. */ int no_rtl_global_needed_for(char *python_instsoname, wchar_t *prefix) { int needed = 0; void* pylib = dlopen(python_instsoname, RTLD_LAZY|RTLD_LOCAL); if (pylib != 0) { void (*pfx)(wchar_t *home) = dlsym(pylib, "Py_SetPythonHome"); void (*init)(void) = dlsym(pylib, "Py_Initialize"); int (*simple)(char*) = dlsym(pylib, "PyRun_SimpleString"); void (*final)(void) = dlsym(pylib, "Py_Finalize"); (*pfx)(prefix); (*init)(); needed = (*simple)("import termios") == -1; (*final)(); dlclose(pylib); } return !needed; } int main(int argc, char** argv) { int not_needed = 0; if (no_rtl_global_needed_for("${vi_cv_dll_name_python3}", L"${vi_cv_path_python3_pfx}")) not_needed = 1; return !not_needed; }])], [AC_MSG_RESULT(yes);AC_DEFINE(PY3_NO_RTLD_GLOBAL)], [AC_MSG_RESULT(no)]) CFLAGS=$cflags_save LIBS=$libs_save PYTHON_SRC="if_python.c" PYTHON_OBJ="objects/if_python.o" PYTHON_CFLAGS="$PYTHON_CFLAGS -DDYNAMIC_PYTHON_DLL=\\\"${vi_cv_dll_name_python}\\\"" PYTHON_LIBS= PYTHON3_SRC="if_python3.c" PYTHON3_OBJ="objects/if_python3.o" PYTHON3_CFLAGS="$PYTHON3_CFLAGS -DDYNAMIC_PYTHON3_DLL=\\\"${vi_cv_dll_name_python3}\\\"" PYTHON3_LIBS= elif test "$python_ok" = yes && test "$enable_pythoninterp" = "dynamic"; then AC_DEFINE(DYNAMIC_PYTHON) PYTHON_SRC="if_python.c" PYTHON_OBJ="objects/if_python.o" PYTHON_CFLAGS="$PYTHON_CFLAGS -DDYNAMIC_PYTHON_DLL=\\\"${vi_cv_dll_name_python}\\\"" PYTHON_LIBS= elif test "$python_ok" = yes; then dnl Check that adding -fPIE works. It may be needed when using a static dnl Python library. AC_MSG_CHECKING([if -fPIE can be added for Python]) cflags_save=$CFLAGS libs_save=$LIBS CFLAGS="$CFLAGS $PYTHON_CFLAGS -fPIE" LIBS="$LIBS $PYTHON_LIBS" AC_TRY_LINK(,[ ], AC_MSG_RESULT(yes); fpie_ok=yes, AC_MSG_RESULT(no); fpie_ok=no) CFLAGS=$cflags_save LIBS=$libs_save if test $fpie_ok = yes; then PYTHON_CFLAGS="$PYTHON_CFLAGS -fPIE" fi elif test "$python3_ok" = yes && test "$enable_python3interp" = "dynamic"; then AC_DEFINE(DYNAMIC_PYTHON3) PYTHON3_SRC="if_python3.c" PYTHON3_OBJ="objects/if_python3.o" PYTHON3_CFLAGS="$PYTHON3_CFLAGS -DDYNAMIC_PYTHON3_DLL=\\\"${vi_cv_dll_name_python3}\\\"" PYTHON3_LIBS= elif test "$python3_ok" = yes; then dnl Check that adding -fPIE works. It may be needed when using a static dnl Python library. AC_MSG_CHECKING([if -fPIE can be added for Python3]) cflags_save=$CFLAGS libs_save=$LIBS CFLAGS="$CFLAGS $PYTHON3_CFLAGS -fPIE" LIBS="$LIBS $PYTHON3_LIBS" AC_TRY_LINK(,[ ], AC_MSG_RESULT(yes); fpie_ok=yes, AC_MSG_RESULT(no); fpie_ok=no) CFLAGS=$cflags_save LIBS=$libs_save if test $fpie_ok = yes; then PYTHON3_CFLAGS="$PYTHON3_CFLAGS -fPIE" fi fi AC_MSG_CHECKING(--enable-tclinterp argument) AC_ARG_ENABLE(tclinterp, [ --enable-tclinterp[=OPTS] Include Tcl interpreter. [default=no] [OPTS=no/yes/dynamic]], , [enable_tclinterp="no"]) AC_MSG_RESULT($enable_tclinterp) if test "$enable_tclinterp" = "yes" -o "$enable_tclinterp" = "dynamic"; then dnl on FreeBSD tclsh is a silly script, look for tclsh8.[5420] 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.5"; 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.4, 8.2 and 8.0 if test "X$vi_cv_path_tcl" = "X" -a $tclsh_name = "tclsh8.5"; then tclsh_name="tclsh8.4" AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name) fi if test "X$vi_cv_path_tcl" = "X" -a $tclsh_name = "tclsh8.4"; then tclsh_name="tclsh8.2" AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name) fi if test "X$vi_cv_path_tcl" = "X" -a $tclsh_name = "tclsh8.2"; then tclsh_name="tclsh8.0" 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 -` tcldll=`echo 'puts libtcl[[info tclversion]][[info sharedlibextension]]' | $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 /usr/local/include/tcl$tclver /usr/include /usr/include/tcl$tclver" else dnl For Mac OS X 10.3, use the OS-provided framework location tclinc="/System/Library/Frameworks/Tcl.framework/Headers" fi TCL_INC= 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() 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` tclcnf="$tclcnf `echo $tclinc | sed s/include/lib64/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} if test "$enable_tclinterp" = "dynamic"; then TCL_LIBS=`eval echo "$TCL_STUB_LIB_SPEC $TCL_LIBS"` else TCL_LIBS=`eval echo "$TCL_LIB_SPEC $TCL_LIBS"` fi dnl Use $TCL_DEFS for -D_THREAD_SAFE et al. But only use the dnl "-D_ABC" items. Watch out for -DFOO=long\ long. TCL_DEFS=`echo $TCL_DEFS | sed -e 's/\\\\ /\\\\X/g' | tr ' ' '\012' | sed -e '/^[[^-]]/d' -e '/^-[[^D]]/d' -e '/-D[[^_]]/d' -e 's/-D_/ -D_/' | tr '\012' ' ' | sed -e 's/\\\\X/\\\\ /g'` break fi done if test -z "$TCL_LIBS"; then AC_MSG_RESULT() AC_MSG_CHECKING(for Tcl library by myself) tcllib=`echo $tclinc | sed s/include/lib/g` tcllib="$tcllib `echo $tclinc | sed s/include/lib64/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() 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 if test "$enable_tclinterp" = "dynamic"; then if test "X$TCL_SRC" != "X" -a "X$tcldll" != "X"; then AC_DEFINE(DYNAMIC_TCL) TCL_CFLAGS="-DDYNAMIC_TCL_DLL=\\\"$tcldll\\\" -DDYNAMIC_TCL_VER=\\\"$tclver\\\" $TCL_CFLAGS" fi fi if test "$fail_if_missing" = "yes" -a -z "$TCL_SRC"; then AC_MSG_ERROR([could not configure Tcl]) 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[=OPTS] Include Ruby interpreter. [default=no] [OPTS=no/yes/dynamic]], , [enable_rubyinterp="no"]) AC_MSG_RESULT($enable_rubyinterp) if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then AC_MSG_ERROR([cannot use Ruby with tiny or small features]) fi AC_MSG_CHECKING(--with-ruby-command argument) AC_SUBST(vi_cv_path_ruby) AC_ARG_WITH(ruby-command, [ --with-ruby-command=RUBY name of the Ruby command (default: ruby)], RUBY_CMD="$withval"; vi_cv_path_ruby="$withval"; AC_MSG_RESULT($RUBY_CMD), RUBY_CMD="ruby"; AC_MSG_RESULT(defaulting to $RUBY_CMD)) AC_PATH_PROG(vi_cv_path_ruby, $RUBY_CMD) if test "X$vi_cv_path_ruby" != "X"; then AC_MSG_CHECKING(Ruby version) if $vi_cv_path_ruby -e '(VERSION rescue RUBY_VERSION) >= "1.6.0" or exit 1' >/dev/null 2>/dev/null; then AC_MSG_RESULT(OK) AC_MSG_CHECKING(Ruby rbconfig) ruby_rbconfig="RbConfig" if ! $vi_cv_path_ruby -r rbconfig -e 'RbConfig' >/dev/null 2>/dev/null; then ruby_rbconfig="Config" fi AC_MSG_RESULT($ruby_rbconfig) AC_MSG_CHECKING(Ruby header files) rubyhdrdir=`$vi_cv_path_ruby -r mkmf -e "print $ruby_rbconfig::CONFIG[['rubyhdrdir']] || $ruby_rbconfig::CONFIG[['archdir']] || \\$hdrdir" 2>/dev/null` if test "X$rubyhdrdir" != "X"; then AC_MSG_RESULT($rubyhdrdir) RUBY_CFLAGS="-I$rubyhdrdir" rubyarchdir=`$vi_cv_path_ruby -r rbconfig -e "print ($ruby_rbconfig::CONFIG.has_key? 'rubyarchhdrdir') ? $ruby_rbconfig::CONFIG[['rubyarchhdrdir']] : '$rubyhdrdir/'+$ruby_rbconfig::CONFIG[['arch']]"` if test -d "$rubyarchdir"; then RUBY_CFLAGS="$RUBY_CFLAGS -I$rubyarchdir" fi rubyversion=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG[['ruby_version']].gsub(/\./, '')[[0,2]]"` if test "X$rubyversion" = "X"; then rubyversion=`$vi_cv_path_ruby -e "print ((VERSION rescue RUBY_VERSION)).gsub(/\./, '')[[0,2]]"` fi RUBY_CFLAGS="$RUBY_CFLAGS -DRUBY_VERSION=$rubyversion" rubylibs=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG[['LIBS']]"` if test "X$rubylibs" != "X"; then RUBY_LIBS="$rubylibs" fi librubyarg=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG[['LIBRUBYARG']])"` librubya=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG[['LIBRUBY_A']])"` rubylibdir=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG[['libdir']])"` if test -f "$rubylibdir/$librubya"; then librubyarg="$librubyarg" RUBY_LIBS="$RUBY_LIBS -L$rubylibdir" elif test "$librubyarg" = "libruby.a"; then dnl required on Mac OS 10.3 where libruby.a doesn't exist librubyarg="-lruby" RUBY_LIBS="$RUBY_LIBS -L$rubylibdir" fi if test "X$librubyarg" != "X"; then RUBY_LIBS="$librubyarg $RUBY_LIBS" fi rubyldflags=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG[['LDFLAGS']]"` if test "X$rubyldflags" != "X"; then dnl Ruby on Mac OS X 10.5 adds "-arch" flags but these should only dnl be included if requested by passing --with-mac-arch to dnl configure, so strip these flags first (if present) rubyldflags=`echo "$rubyldflags" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'` if test "X$rubyldflags" != "X"; then if test "X`echo \"$LDFLAGS\" | $FGREP -e \"$rubyldflags\"`" = "X"; then LDFLAGS="$rubyldflags $LDFLAGS" fi fi fi RUBY_SRC="if_ruby.c" RUBY_OBJ="objects/if_ruby.o" RUBY_PRO="if_ruby.pro" AC_DEFINE(FEAT_RUBY) if test "$enable_rubyinterp" = "dynamic"; then libruby=`$vi_cv_path_ruby -r rbconfig -e "puts $ruby_rbconfig::CONFIG[['LIBRUBY_SO']]"` AC_DEFINE(DYNAMIC_RUBY) RUBY_CFLAGS="-DDYNAMIC_RUBY_DLL=\\\"$libruby\\\" -DDYNAMIC_RUBY_VER=$rubyversion $RUBY_CFLAGS" RUBY_LIBS= fi 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 if test "$fail_if_missing" = "yes" -a -z "$RUBY_OBJ"; then AC_MSG_ERROR([could not configure Ruby]) 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 if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then AC_MSG_RESULT([cannot use NetBeans with tiny or small features]) enable_netbeans="no" else AC_MSG_RESULT(no) fi else AC_MSG_RESULT(yes) fi AC_MSG_CHECKING(--disable-channel argument) AC_ARG_ENABLE(channel, [ --disable-channel Disable process communication support.], , [enable_channel="yes"]) if test "$enable_channel" = "yes"; then if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then AC_MSG_RESULT([cannot use channels with tiny or small features]) enable_channel="no" else AC_MSG_RESULT(no) fi else if test "$enable_netbeans" = "yes"; then AC_MSG_RESULT([yes, netbeans also disabled]) enable_netbeans="no" else AC_MSG_RESULT(yes) fi fi if test "$enable_channel" = "yes"; then 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 with process communication is possible) AC_TRY_LINK([ #include #include #include #include #include #include #include #include #include /* 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"; enable_channel="no") 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 if test "$enable_channel" = "yes"; then AC_DEFINE(FEAT_JOB_CHANNEL) CHANNEL_SRC="channel.c" AC_SUBST(CHANNEL_SRC) CHANNEL_OBJ="objects/channel.o" AC_SUBST(CHANNEL_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)]) 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 z/OS Unix 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 "$zOSUnix" = "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. On some systems X11/Intrinsic.h dnl is missing. AC_MSG_CHECKING(if X11 header files can be found) cflags_save=$CFLAGS CFLAGS="$CFLAGS $X_CFLAGS" AC_TRY_COMPILE([#include #include ], , 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 dnl -Werror is GCC only, others like Solaris Studio might not like it if test "$GCC" = yes; then CFLAGS="$CFLAGS $X_CFLAGS -Werror" else CFLAGS="$CFLAGS $X_CFLAGS" fi AC_TRY_COMPILE([#include ], , AC_MSG_RESULT(no), CFLAGS="$CFLAGS -Wno-implicit-int" AC_TRY_COMPILE([#include ], , AC_MSG_RESULT(yes); cflags_save="$cflags_save -Wno-implicit-int", AC_MSG_RESULT(test failed) ) ) CFLAGS=$cflags_save LDFLAGS="$ac_save_LDFLAGS" AC_MSG_CHECKING(size of wchar_t is 2 bytes) AC_CACHE_VAL(ac_cv_small_wchar_t, [AC_TRY_RUN([ #include #if STDC_HEADERS # include # include #endif main() { if (sizeof(wchar_t) <= 2) exit(1); exit(0); }], ac_cv_small_wchar_t="no", ac_cv_small_wchar_t="yes", AC_MSG_ERROR(failed to compile test program))]) AC_MSG_RESULT($ac_cv_small_wchar_t) if test "x$ac_cv_small_wchar_t" = "xyes" ; then AC_DEFINE(SMALL_WCHAR_T) fi fi fi test "x$with_x" = xno -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/gtk2/gnome2/gtk3/motif/athena/neXtaw/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_GTK2=YES SKIP_GTK3=YES SKIP_GNOME=YES SKIP_MOTIF=YES SKIP_ATHENA=YES SKIP_NEXTAW=YES SKIP_PHOTON=YES SKIP_CARBON=YES GUITYPE=NONE if 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 - Carbon GUI is outdated - disable GUI support) SKIP_CARBON=YES ;; 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_GTK2= SKIP_GNOME= SKIP_MOTIF= SKIP_ATHENA= SKIP_NEXTAW= SKIP_CARBON=;; gtk2) AC_MSG_RESULT(GTK+ 2.x GUI support) SKIP_GTK2=;; gnome2) AC_MSG_RESULT(GNOME 2.x GUI support) SKIP_GNOME= SKIP_GTK2=;; gtk3) AC_MSG_RESULT(GTK+ 3.x GUI support) SKIP_GTK3=;; 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_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 auto-select 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 SKIP_GNOME=YES fi fi if test "x$SKIP_GNOME" != "xYES" -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_GTK3" != "xYES" -a "$enable_gui_canon" != "gtk3"; then AC_MSG_CHECKING(whether or not to look for GTK+ 3) AC_ARG_ENABLE(gtk3-check, [ --enable-gtk3-check If auto-select GUI, check for GTK+ 3 [default=yes]], , enable_gtk3_check="yes") AC_MSG_RESULT($enable_gtk3_check) if test "x$enable_gtk3_check" = "xno"; then SKIP_GTK3=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 the check, just give the message AC_MSG_RESULT(yes); GUITYPE=CARBONGUI if test "$VIMNAME" = "vim"; then VIMNAME=Vim fi if test "x$MACARCH" = "xboth"; then CPPFLAGS="$CPPFLAGS -I$DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk/Developer/Headers/FlatCarbon" else CPPFLAGS="$CPPFLAGS -I$DEVELOPER_DIR/Headers/FlatCarbon" fi dnl Default install directory is not /usr/local if test x$prefix = xNONE; then prefix=/Applications fi dnl Sorry for the hard coded default datadir='${prefix}/Vim.app/Contents/Resources' dnl skip everything else SKIP_GTK2=YES; SKIP_GNOME=YES; SKIP_MOTIF=YES; SKIP_ATHENA=YES; SKIP_NEXTAW=YES; SKIP_PHOTON=YES; SKIP_CARBON=YES fi dnl define an autoconf function to check for a specified version of GTK, and dnl try to compile/link a GTK program. dnl dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for GTK, and define GTK_CFLAGS, GTK_LIBDIR and GTK_LIBS dnl AC_DEFUN(AM_PATH_GTK, [ if test "X$GTK_CONFIG" != "Xno" -o "X$PKG_CONFIG" != "Xno"; then { no_gtk="" if (test "X$SKIP_GTK2" != "XYES" -a "X$PKG_CONFIG" != "Xno") \ && $PKG_CONFIG --exists gtk+-2.0; then { min_gtk_version=ifelse([$1], ,2.2.0,$1) AC_MSG_CHECKING(for GTK - version >= $min_gtk_version) 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_LIBDIR=`$PKG_CONFIG --libs-only-L 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$SKIP_GTK3" != "XYES" -a "X$PKG_CONFIG" != "Xno") \ && $PKG_CONFIG --exists gtk+-3.0; then { min_gtk_version=ifelse([$1], ,3.0.0,$1) AC_MSG_CHECKING(for GTK - version >= $min_gtk_version) GTK_CFLAGS=`$PKG_CONFIG --cflags gtk+-3.0` GTK_LIBDIR=`$PKG_CONFIG --libs-only-L gtk+-3.0` GTK_LIBS=`$PKG_CONFIG --libs gtk+-3.0` gtk_major_version=`$PKG_CONFIG --modversion gtk+-3.0 | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` gtk_minor_version=`$PKG_CONFIG --modversion gtk+-3.0 | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` gtk_micro_version=`$PKG_CONFIG --modversion gtk+-3.0 | \ 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. dnl rm -f conf.gtktest AC_TRY_RUN([ #include #include #if STDC_HEADERS # include # include #endif 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, µ) != 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; 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` dnl On FreeBSD we need -pthread but pkg-config doesn't include it. dnl This might not be the right way but it works for me... AC_MSG_CHECKING(for FreeBSD) if test "`(uname) 2>/dev/null`" = FreeBSD; then AC_MSG_RESULT(yes, adding -pthread) GNOME_INCLUDEDIR="$GNOME_INCLUDEDIR -D_THREAD_SAFE" GNOME_LIBS="$GNOME_LIBS -pthread" else AC_MSG_RESULT(no) fi $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 } fi ]) AC_DEFUN([GNOME_INIT],[ GNOME_INIT_HOOK([],fail) ]) dnl --------------------------------------------------------------------------- dnl Check for GTK2. If it fails, then continue on for Motif as before... dnl --------------------------------------------------------------------------- if test -z "$SKIP_GTK2"; then 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$PKG_CONFIG" = "X"; then AC_PATH_PROG(PKG_CONFIG, pkg-config, no) fi if test "x$PKG_CONFIG" != "xno"; 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). AM_PATH_GTK(2.2.0, [GUI_LIB_LOC="$GTK_LIBDIR" GTK_LIBNAME="$GTK_LIBS" GUI_INC_LOC="$GTK_CFLAGS"], ) if test "x$GTK_CFLAGS" != "x"; then SKIP_GTK3=YES SKIP_ATHENA=YES SKIP_NEXTAW=YES SKIP_MOTIF=YES GUITYPE=GTK AC_SUBST(GTK_LIBNAME) fi fi if test "x$GUITYPE" = "xGTK"; then if test "$gtk_minor_version" = 1 -a "0$gtk_micro_version" -ge 1 \ || test "0$gtk_minor_version" -ge 2; then AC_DEFINE(HAVE_GTK_MULTIHEAD) fi dnl dnl if GTK exists, 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 dnl --------------------------------------------------------------------------- dnl Check for GTK3. dnl --------------------------------------------------------------------------- if test -z "$SKIP_GTK3"; then 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$PKG_CONFIG" = "X"; then AC_PATH_PROG(PKG_CONFIG, pkg-config, no) fi if test "x$PKG_CONFIG" != "xno"; then AM_PATH_GTK(3.0.0, [GUI_LIB_LOC="$GTK_LIBDIR" GTK_LIBNAME="$GTK_LIBS" GUI_INC_LOC="$GTK_CFLAGS"], ) if test "x$GTK_CFLAGS" != "x"; then SKIP_GTK2=YES SKIP_GNOME=YES SKIP_ATHENA=YES SKIP_NEXTAW=YES SKIP_MOTIF=YES GUITYPE=GTK AC_SUBST(GTK_LIBNAME) AC_DEFINE(HAVE_GTK_MULTIHEAD) AC_DEFINE(USE_GTK3) fi fi fi dnl Check the version of Gdk-Pixbuf. If the version is 2.31 or later and dnl glib-compile-resources is found in PATH, use GResource. if test "x$GUITYPE" = "xGTK"; then AC_MSG_CHECKING([version of Gdk-Pixbuf]) gdk_pixbuf_version=`$PKG_CONFIG --modversion gdk-pixbuf-2.0` if test "x$gdk_pixbuf_version" != x ; then gdk_pixbuf_version_minor=`echo $gdk_pixbuf_version | \ sed -e 's/[[0-9]][[0-9]]*\.\([[0-9]][[0-9]]*\)\.[[0-9]][[0-9]]*/\1/'` if test "x$gdk_pixbuf_version_minor" != x -a \ $gdk_pixbuf_version_minor -ge 31 ; then AC_MSG_RESULT([OK.]) AC_PATH_PROG(GLIB_COMPILE_RESOURCES,[glib-compile-resources],no) AC_MSG_CHECKING([glib-compile-resources]) if test "x$GLIB_COMPILE_RESOURCES" = xno ; then GLIB_COMPILE_RESOURCES="" AC_MSG_RESULT([cannot be found in PATH.]) else AC_MSG_RESULT([usable.]) AC_DEFINE(USE_GRESOURCE) GRESOURCE_SRC="auto/gui_gtk_gresources.c" GRESOURCE_OBJ="objects/gui_gtk_gresources.o" fi else AC_MSG_RESULT([not usable.]) fi else AC_MSG_RESULT([cannot obtain from pkg_config.]) fi fi AC_SUBST(GLIB_COMPILE_RESOURCES) AC_SUBST(GRESOURCE_SRC) AC_SUBST(GRESOURCE_OBJ) 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() 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'`" dnl Ubuntu has libXm.so in /usr/lib/i386-linux-gnu and elsewhere. The dnl linker will figure out which one to use, we only check if one exists. AC_MSG_CHECKING(for location of Motif GUI libs) gui_libs="`echo $x_libraries|sed 's%/[^/][^/]*$%%'` `echo "$gui_XXX" | sed s/XXX/lib/g` /usr/lib/i386-linux-gnu /usr/lib/x86_64-linux-gnu `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 "$try"/libXm.dylib; 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 \ -o "$GUI_LIB_LOC" = /usr/lib/i386-linux-gnu \ -o "$GUI_LIB_LOC" = /usr/lib/x86_64-linux-gnu; 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() 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 #include ], , 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 #include ], , 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_GTK2" -o -z "$SKIP_GTK3"; 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 ], 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" dnl Xmu/Editres.h may exist but can only be used after including Intrinsic.h AC_MSG_CHECKING([for X11/Xmu/Editres.h]) AC_TRY_COMPILE([ #include #include ], [int i; i = 0;], AC_MSG_RESULT(yes) AC_DEFINE(HAVE_X11_XMU_EDITRES_H), AC_MSG_RESULT(no)) 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" if test "$zOSUnix" = "yes"; then xmheader="Xm/Xm.h" else xmheader="Xm/Xm.h Xm/XpmP.h Xm/JoinSideT.h Xm/TraitP.h Xm/Manager.h Xm/UnhighlightT.h Xm/Notebook.h" fi AC_CHECK_HEADERS($xmheader) if test "x$ac_cv_header_Xm_XpmP_h" = "xyes"; then dnl Solaris uses XpmAttributes_21, very annoying. AC_MSG_CHECKING([for XpmAttributes_21 in Xm/XpmP.h]) AC_TRY_COMPILE([#include ], [XpmAttributes_21 attr;], AC_MSG_RESULT(yes); AC_DEFINE(XPMATTRIBUTES_TYPE, XpmAttributes_21), AC_MSG_RESULT(no); AC_DEFINE(XPMATTRIBUTES_TYPE, XpmAttributes) ) else AC_DEFINE(XPMATTRIBUTES_TYPE, XpmAttributes) fi 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"; then AC_MSG_RESULT(GTK+ 2 GUI selected; fontset has been disabled) enable_fontset="no" 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 Check for Cygwin, which needs an extra source file if not using X11 AC_MSG_CHECKING(for CYGWIN or MSYS environment) case `uname` in CYGWIN*|MSYS*) CYGWIN=yes; AC_MSG_RESULT(yes) AC_MSG_CHECKING(for CYGWIN clipboard support) if test "x$with_x" = "xno" ; then OS_EXTRA_SRC=winclip.c; OS_EXTRA_OBJ=objects/winclip.o AC_MSG_RESULT(yes) AC_DEFINE(FEAT_CYGWIN_WIN32_CLIPBOARD) else AC_MSG_RESULT(no - using X11) fi ;; *) CYGWIN=no; AC_MSG_RESULT(no);; esac 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_CACHE_CHECK([whether toupper is broken], [vim_cv_toupper_broken], [ AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include "confdefs.h" #include #if STDC_HEADERS # include # include #endif main() { exit(toupper('A') == 'A' && tolower('z') == 'z'); } ]])],[ vim_cv_toupper_broken=yes ],[ vim_cv_toupper_broken=no ],[ AC_MSG_ERROR(cross-compiling: please set 'vim_cv_toupper_broken') ])]) if test "x$vim_cv_toupper_broken" = "xyes" ; then AC_DEFINE(BROKEN_TOUPPER) fi AC_MSG_CHECKING(whether __DATE__ and __TIME__ work) AC_TRY_COMPILE([#include ], [printf("(" __DATE__ " " __TIME__ ")");], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_DATE_TIME), AC_MSG_RESULT(no)) AC_MSG_CHECKING(whether __attribute__((unused)) is allowed) AC_TRY_COMPILE([#include ], [int x __attribute__((unused));], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ATTRIBUTE_UNUSED), 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 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 ], [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(stdint.h stdlib.h string.h \ sys/select.h sys/utsname.h termcap.h fcntl.h \ sgtty.h sys/ioctl.h sys/time.h sys/types.h \ termio.h iconv.h inttypes.h langinfo.h math.h \ unistd.h stropts.h errno.h sys/resource.h \ sys/systeminfo.h locale.h sys/stream.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 sys/acl.h \ sys/access.h sys/sysinfo.h wchar.h wctype.h) dnl sys/ptem.h depends on sys/stream.h on Solaris AC_CHECK_HEADERS(sys/ptem.h, [], [], [#if defined HAVE_SYS_STREAM_H # include #endif]) dnl sys/sysctl.h depends on sys/param.h on OpenBSD AC_CHECK_HEADERS(sys/sysctl.h, [], [], [#if defined HAVE_SYS_PARAM_H # include #endif]) dnl pthread_np.h may exist but can only be used after including pthread.h AC_MSG_CHECKING([for pthread_np.h]) AC_TRY_COMPILE([ #include #include ], [int i; i = 0;], AC_MSG_RESULT(yes) AC_DEFINE(HAVE_PTHREAD_NP_H), AC_MSG_RESULT(no)) AC_CHECK_HEADERS(strings.h) if test "x$MACOSX" = "xyes"; then dnl The strings.h file on OS/X contains a warning and nothing useful. AC_DEFINE(NO_STRINGS_WITH_STRING_H) else 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 /* This breaks it for HP-UX 11 (Squassabia) */ #endif #ifdef HAVE_STRING_H # include #endif #if defined(HAVE_STRINGS_H) # include #endif ], [int i; i = 0;], AC_MSG_RESULT(yes), AC_DEFINE(NO_STRINGS_WITH_STRING_H) AC_MSG_RESULT(no)) CPPFLAGS=$cppflags_save fi dnl Checks for typedefs, structures, and compiler characteristics. AC_PROG_GCC_TRADITIONAL AC_C_CONST AC_C_VOLATILE AC_TYPE_MODE_T AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_TYPE_UID_T AC_TYPE_UINT32_T AC_HEADER_TIME AC_CHECK_TYPE(ino_t, long) AC_CHECK_TYPE(dev_t, unsigned) AC_C_BIGENDIAN(,,,) AC_C_INLINE 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 #if STDC_HEADERS # include # include #endif #ifdef HAVE_SYS_RESOURCE_H # include #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 #if STDC_HEADERS # include # include #endif #include ], 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 #if STDC_HEADERS # include # include #endif #include #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" AC_MSG_CHECKING(for linking with $with_tlib library) AC_TRY_LINK([], [], AC_MSG_RESULT(OK), AC_MSG_ERROR(FAILED)) dnl Need to check for tgetent() below. olibs="$LIBS" else AC_MSG_RESULT([empty: 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, except dnl when tinfo has been split off, it contains all we need. dnl Older versions of ncurses have bugs, get a new one! dnl Digital Unix (OSF1) should use curses (Ronald Schild). dnl On SCO Openserver should prefer termlib (Roger Cornelius). case "`uname -s 2>/dev/null`" in OSF1|SCO_SV) tlibs="tinfo ncurses curses termlib termcap";; *) tlibs="tinfo 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 #endif #if STDC_HEADERS # include # include #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 if test "x$olibs" = "x$LIBS"; then AC_MSG_RESULT(no terminal library found) fi fi if test "x$olibs" = "x$LIBS"; then AC_MSG_CHECKING([for tgetent()]) AC_TRY_LINK([], [char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist");], AC_MSG_RESULT(yes), AC_MSG_ERROR([NOT FOUND! You need to install a terminal library; for example ncurses. Or specify the name of the library with --with-tlib.])) fi AC_CACHE_CHECK([whether we talk terminfo], [vim_cv_terminfo], [ AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include "confdefs.h" #ifdef HAVE_TERMCAP_H # include #endif #ifdef HAVE_STRING_H # include #endif #if STDC_HEADERS # include # include #endif main() {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(!strcmp(s==0 ? "" : s, "1")); } ]])],[ vim_cv_terminfo=no ],[ vim_cv_terminfo=yes ],[ AC_MSG_ERROR(cross-compiling: please set 'vim_cv_terminfo') ]) ]) if test "x$vim_cv_terminfo" = "xyes" ; then AC_DEFINE(TERMINFO) fi if test "x$olibs" != "x$LIBS"; then AC_CACHE_CHECK([what tgetent() returns for an unknown terminal], [vim_cv_tgent], [ AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include "confdefs.h" #ifdef HAVE_TERMCAP_H # include #endif #if STDC_HEADERS # include # include #endif main() {char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist"); exit(res != 0); } ]])],[ vim_cv_tgent=zero ],[ vim_cv_tgent=non-zero ],[ AC_MSG_ERROR(failed to compile test program.) ]) ]) if test "x$vim_cv_tgent" = "xzero" ; then AC_DEFINE(TGETENT_ZERO_ERR, 0) fi fi AC_MSG_CHECKING(whether termcap.h contains ospeed) AC_TRY_LINK([ #ifdef HAVE_TERMCAP_H # include #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 #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 #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 #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 #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 #include #include ], , 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 , 931222 rm -f conftest_grp AC_CACHE_CHECK([default tty permissions/group], [vim_cv_tty_group], [ AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include "confdefs.h" #include #if STDC_HEADERS # include # include #endif #ifdef HAVE_UNISTD_H #include #endif #include #include 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 vim_cv_tty_group=`cat conftest_grp` if test "x$vim_cv_tty_mode" = "x" ; then vim_cv_tty_mode=0620 fi AC_MSG_RESULT([pty mode: $vim_cv_tty_mode, group: $vim_cv_tty_group]) else vim_cv_tty_group=world AC_MSG_RESULT([ptys are world accessible]) fi ],[ vim_cv_tty_group=world AC_MSG_RESULT([can't determine - assume ptys are world accessible]) ],[ AC_MSG_ERROR(cross-compiling: please set 'vim_cv_tty_group' and 'vim_cv_tty_mode') ]) ]) rm -f conftest_grp if test "x$vim_cv_tty_group" != "xworld" ; then AC_DEFINE_UNQUOTED(PTYGROUP,$vim_cv_tty_group) if test "x$vim_cv_tty_mode" = "x" ; then AC_MSG_ERROR([It seems you're cross compiling and have 'vim_cv_tty_group' set, please also set the environment variable 'vim_cv_tty_mode' to the correct mode (probably 0620)]) else AC_DEFINE(PTYMODE, 0620) fi fi 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 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_CACHE_CHECK([getcwd implementation is broken], [vim_cv_getcwd_broken], [ AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include "confdefs.h" #ifdef HAVE_UNISTD_H #include #endif char *dagger[] = { "IFS=pwd", 0 }; main() { char buffer[500]; extern char **environ; environ = dagger; return getcwd(buffer, 500) ? 0 : 1; } ]])],[ vim_cv_getcwd_broken=no ],[ vim_cv_getcwd_broken=yes ],[ AC_MSG_ERROR(cross-compiling: please set 'vim_cv_getcwd_broken') ]) ]) if test "x$vim_cv_getcwd_broken" = "xyes" ; then AC_DEFINE(BAD_GETCWD) fi dnl Check for functions in one big call, to reduce the size of configure. dnl Can only be used for functions that do not require any include. AC_CHECK_FUNCS(bcmp fchdir fchown fsync getcwd getpseudotty \ getpwent getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \ memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \ setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \ sigvec strcasecmp strerror strftime stricmp strncasecmp \ strnicmp strpbrk strtol tgetent towlower towupper iswupper \ usleep utime utimes) AC_FUNC_FSEEKO dnl define _LARGE_FILES, _FILE_OFFSET_BITS and _LARGEFILE_SOURCE when dnl appropriate, so that off_t is 64 bits when needed. AC_SYS_LARGEFILE 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 #include ], [ 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_CACHE_CHECK([whether stat() ignores a trailing slash], [vim_cv_stat_ignores_slash], [ AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include "confdefs.h" #if STDC_HEADERS # include # include #endif #include #include main() {struct stat st; exit(stat("configure/", &st) != 0); } ]])],[ vim_cv_stat_ignores_slash=yes ],[ vim_cv_stat_ignores_slash=no ],[ AC_MSG_ERROR(cross-compiling: please set 'vim_cv_stat_ignores_slash') ]) ]) if test "x$vim_cv_stat_ignores_slash" = "xyes" ; then AC_DEFINE(STAT_IGNORES_SLASH) fi 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 #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 #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 #endif ], [char *cs = nl_langinfo(CODESET);], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_NL_LANGINFO_CODESET), AC_MSG_RESULT(no)) dnl Need various functions for floating point support. Only enable dnl floating point when they are all present. AC_CHECK_LIB(m, strtod) AC_MSG_CHECKING([for strtod() and other floating point functions]) AC_TRY_LINK([ #ifdef HAVE_MATH_H # include #endif #if STDC_HEADERS # include # include #endif ], [char *s; double d; d = strtod("1.1", &s); d = fabs(1.11); d = ceil(1.11); d = floor(1.11); d = log10(1.11); d = pow(1.11, 2.22); d = sqrt(1.11); d = sin(1.11); d = cos(1.11); d = atan(1.11); ], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FLOAT_FUNCS), AC_MSG_RESULT(no)) dnl isinf() and isnan() need to include header files and may need -lm. AC_MSG_CHECKING([for isinf()]) AC_TRY_LINK([ #ifdef HAVE_MATH_H # include #endif #if STDC_HEADERS # include # include #endif ], [int r = isinf(1.11); ], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ISINF), AC_MSG_RESULT(no)) AC_MSG_CHECKING([for isnan()]) AC_TRY_LINK([ #ifdef HAVE_MATH_H # include #endif #if STDC_HEADERS # include # include #endif ], [int r = isnan(1.11); ], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ISNAN), 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). dnl On Solaris, use the acl_get/set functions in libsec, if present. 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 #ifdef HAVE_SYS_ACL_H # include #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_CHECK_LIB(sec, acl_get, [LIBS="$LIBS -lsec"; AC_DEFINE(HAVE_SOLARIS_ZFS_ACL)], AC_MSG_CHECKING(for Solaris ACL support) AC_TRY_LINK([ #ifdef HAVE_SYS_ACL_H # include #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([ #if STDC_HEADERS # include # include #endif #ifdef HAVE_SYS_ACL_H # include #endif #ifdef HAVE_SYS_ACCESS_H # include #endif #define _ALL_SOURCE #include 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 if test "x$GTK_CFLAGS" != "x"; then dnl pango_shape_full() is new, fall back to pango_shape(). AC_MSG_CHECKING(for pango_shape_full) ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" AC_TRY_LINK( [#include ], [ pango_shape_full(NULL, 0, NULL, 0, NULL, NULL); ], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_PANGO_SHAPE_FULL), AC_MSG_RESULT(no)) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" 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 #include ], [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(--disable-sysmouse argument) AC_ARG_ENABLE(sysmouse, [ --disable-sysmouse Don't use sysmouse (mouse in *BSD console).], , [enable_sysmouse="yes"]) if test "$enable_sysmouse" = "yes"; then AC_MSG_RESULT(no) dnl Checking if sysmouse support can be compiled dnl Configure defines HAVE_SYSMOUSE, if it is defined feature.h dnl defines FEAT_SYSMOUSE if mouse support is included AC_CACHE_CHECK([for sysmouse], vi_cv_have_sysmouse, AC_TRY_LINK( [#include #include #include ], [struct mouse_info mouse; mouse.operation = MOUSE_MODE; mouse.operation = MOUSE_SHOW; mouse.u.mode.mode = 0; mouse.u.mode.signal = SIGUSR2;], [vi_cv_have_sysmouse=yes], [vi_cv_have_sysmouse=no]) ) if test $vi_cv_have_sysmouse = yes; then AC_DEFINE(HAVE_SYSMOUSE) fi else AC_MSG_RESULT(yes) fi dnl make sure the FD_CLOEXEC flag for fcntl()'s F_SETFD command is known AC_MSG_CHECKING(for FD_CLOEXEC) AC_TRY_COMPILE( [#if HAVE_FCNTL_H # include #endif], [ int flag = FD_CLOEXEC;], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FD_CLOEXEC), AC_MSG_RESULT(not usable)) dnl rename needs to be checked separately to work on Nextstep with cc AC_MSG_CHECKING(for rename) AC_TRY_LINK([#include ], [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 #include ], [ 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 #include ], [ 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 struct sysinfo may have the mem_unit field or not AC_MSG_CHECKING(for sysinfo.mem_unit) AC_TRY_COMPILE( [#include #include ], [ struct sysinfo sinfo; sinfo.mem_unit = 1; ], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSINFO_MEM_UNIT), AC_MSG_RESULT(no)) dnl sysconf() may exist but not support what we want to use AC_MSG_CHECKING(for sysconf) AC_TRY_COMPILE( [#include ], [ (void)sysconf(_SC_PAGESIZE); (void)sysconf(_SC_PHYS_PAGES); ], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSCONF), AC_MSG_RESULT(not usable)) AC_CHECK_SIZEOF([int]) AC_CHECK_SIZEOF([long]) AC_CHECK_SIZEOF([time_t]) AC_CHECK_SIZEOF([off_t]) dnl Use different names to avoid clashing with other header files. AC_DEFINE_UNQUOTED(VIM_SIZEOF_INT, [$ac_cv_sizeof_int]) AC_DEFINE_UNQUOTED(VIM_SIZEOF_LONG, [$ac_cv_sizeof_long]) dnl Make sure that uint32_t is really 32 bits unsigned. AC_MSG_CHECKING([uint32_t is 32 bits]) AC_TRY_RUN([ #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif main() { uint32_t nr1 = (uint32_t)-1; uint32_t nr2 = (uint32_t)0xffffffffUL; if (sizeof(uint32_t) != 4 || nr1 != 0xffffffffUL || nr2 + 1 != 0) exit(1); exit(0); }], AC_MSG_RESULT(ok), AC_MSG_ERROR([WRONG! uint32_t not defined correctly.]), AC_MSG_WARN([cannot check uint32_t when cross-compiling.])) 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. [bcopy_test_prog=' #include "confdefs.h" #ifdef HAVE_STRING_H # include #endif #if STDC_HEADERS # include # include #endif 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. */ }'] AC_CACHE_CHECK([whether memmove handles overlaps],[vim_cv_memmove_handles_overlap], [ AC_RUN_IFELSE([AC_LANG_SOURCE([[#define mch_memmove(s,d,l) memmove(d,s,l) $bcopy_test_prog]])], [ vim_cv_memmove_handles_overlap=yes ],[ vim_cv_memmove_handles_overlap=no ],[ AC_MSG_ERROR(cross-compiling: please set 'vim_cv_memmove_handles_overlap') ]) ]) if test "x$vim_cv_memmove_handles_overlap" = "xyes" ; then AC_DEFINE(USEMEMMOVE) else AC_CACHE_CHECK([whether bcopy handles overlaps],[vim_cv_bcopy_handles_overlap], [ AC_RUN_IFELSE([AC_LANG_SOURCE([[#define mch_bcopy(s,d,l) bcopy(d,s,l) $bcopy_test_prog]])], [ vim_cv_bcopy_handles_overlap=yes ],[ vim_cv_bcopy_handles_overlap=no ],[ AC_MSG_ERROR(cross-compiling: please set 'vim_cv_bcopy_handles_overlap') ]) ]) if test "x$vim_cv_bcopy_handles_overlap" = "xyes" ; then AC_DEFINE(USEBCOPY) else AC_CACHE_CHECK([whether memcpy handles overlaps],[vim_cv_memcpy_handles_overlap], [ AC_RUN_IFELSE([AC_LANG_SOURCE([[#define mch_memcpy(s,d,l) memcpy(d,s,l) $bcopy_test_prog]])], [ vim_cv_memcpy_handles_overlap=yes ],[ vim_cv_memcpy_handles_overlap=no ],[ AC_MSG_ERROR(cross-compiling: please set 'vim_cv_memcpy_handles_overlap') ]) ]) if test "x$vim_cv_memcpy_handles_overlap" = "xyes" ; then AC_DEFINE(USEMEMCPY) fi fi fi 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 "x$with_x" = "xyes"; then cflags_save=$CFLAGS libs_save=$LIBS LIBS="$LIBS $X_LIBS $GUI_LIB_LOC $GUI_X_LIBS $X_PRE_LIBS $X_LIB $X_EXTRA_LIBS" CFLAGS="$CFLAGS $X_CFLAGS" AC_MSG_CHECKING(whether X_LOCALE needed) AC_TRY_COMPILE([#include ],, AC_TRY_LINK_FUNC([_Xsetlocale], [AC_MSG_RESULT(yes) AC_DEFINE(X_LOCALE)], AC_MSG_RESULT(no)), AC_MSG_RESULT(no)) AC_MSG_CHECKING(whether Xutf8SetWMProperties() can be used) AC_TRY_LINK_FUNC([Xutf8SetWMProperties], [AC_MSG_RESULT(yes) AC_DEFINE(HAVE_XUTF8SETWMPROPERTIES)], AC_MSG_RESULT(no)) CFLAGS=$cflags_save LIBS=$libs_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. Default to "ctags" when nothing works. dnl Use --version to detect Exuberant ctags (preferred) dnl Add --fields=+S to get function signatures for omni completion. 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 -I INIT+ --fields=+S" elif (eval exctags --version /dev/null | grep Exuberant) < /dev/null 1>&AC_FD_CC 2>&1; then TAGPRG="exctags -I INIT+ --fields=+S" elif (eval exuberant-ctags --version /dev/null | grep Exuberant) < /dev/null 1>&AC_FD_CC 2>&1; then TAGPRG="exuberant-ctags -I INIT+ --fields=+S" else TAGPRG="ctags" (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 MANPAGER=cat PAGER=cat 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 dnl We take care to base this on an empty LIBS: on some systems libelf would be dnl in LIBS and implicitly take along libintl. The final LIBS would then not dnl contain libintl, and the link step would fail due to -Wl,--as-needed. 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) INSTALL_LANGS=install-languages AC_SUBST(INSTALL_LANGS) INSTALL_TOOL_LANGS=install-tool-languages AC_SUBST(INSTALL_TOOL_LANGS) 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 olibs=$LIBS LIBS="" AC_TRY_LINK( [#include ], [gettext("Test");], AC_MSG_RESULT([gettext() works]); have_gettext="yes"; LIBS=$olibs, LIBS="-lintl" AC_TRY_LINK( [#include ], [gettext("Test");], AC_MSG_RESULT([gettext() works with -lintl]); have_gettext="yes"; LIBS="$olibs -lintl", AC_MSG_RESULT([gettext() doesn't work]); LIBS=$olibs)) else AC_MSG_RESULT([msgfmt not found - disabled]); fi if test $have_gettext = "yes" -a "x$features" != "xtiny" -a "x$features" != "xsmall"; 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 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"; then AC_MSG_CHECKING(whether we need -framework Cocoa) dnl Cocoa is needed with FEAT_CLIPBOARD or FEAT_MBYTE (the former is dnl disabled during tiny build) if test "x$features" != "xtiny" || test "x$enable_multibyte" = "xyes"; then LIBS=$"$LIBS -framework Cocoa" AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi dnl As mentioned above, tiny build implies os_macosx.m isn't needed. dnl Exclude it from OS_EXTRA_SRC so that linker won't complain about dnl missing Objective-C symbols. if test "x$features" = "xtiny"; then OS_EXTRA_SRC=`echo "$OS_EXTRA_SRC" | sed -e 's+os_macosx.m++'` OS_EXTRA_OBJ=`echo "$OS_EXTRA_OBJ" | sed -e 's+objects/os_macosx.o++'` fi fi if test "x$MACARCH" = "xboth" && test "x$GUITYPE" = "xCARBONGUI"; then LDFLAGS="$LDFLAGS -isysroot $DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" fi dnl gcc 3.1 changed the meaning of -MM. The only solution appears to be to dnl use "-isystem" instead of "-I" for all non-Vim include dirs. dnl But only when making dependencies, cproto and lint don't take "-isystem". dnl Mac gcc returns "powerpc-apple-darwin8-gcc-4.0.1 (GCC)...", need to allow dnl the number before the version number. DEPEND_CFLAGS_FILTER= if test "$GCC" = yes; then AC_MSG_CHECKING(for GCC 3 or later) gccmajor=`echo "$gccversion" | sed -e 's/^\([[1-9]]\)\..*$/\1/g'` if test "$gccmajor" -gt "2"; then DEPEND_CFLAGS_FILTER="| sed 's+-I */+-isystem /+g'" AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi dnl -D_FORTIFY_SOURCE=2 crashes Vim on strcpy(buf, "000") when buf is dnl declared as char x[1] but actually longer. Introduced in gcc 4.0. dnl Also remove duplicate _FORTIFY_SOURCE arguments. dnl And undefine it first to avoid a warning. AC_MSG_CHECKING(whether we need -D_FORTIFY_SOURCE=1) if test "$gccmajor" -gt "3"; then CFLAGS=`echo "$CFLAGS" | sed -e 's/ *-Wp,-D_FORTIFY_SOURCE=.//g' -e 's/ *-D_FORTIFY_SOURCE=.//g' -e 's/ *-U_FORTIFY_SOURCE//g' -e 's/$/ -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1/'` AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi fi AC_SUBST(DEPEND_CFLAGS_FILTER) dnl link.sh tries to avoid overlinking in a hackish way. dnl At least GNU ld supports --as-needed which provides the same functionality dnl at linker level. Let's use it. AC_MSG_CHECKING(linker --as-needed support) LINK_AS_NEEDED= # Check if linker supports --as-needed and --no-as-needed options if $CC -Wl,--help 2>/dev/null | grep as-needed > /dev/null; then LDFLAGS=`echo "$LDFLAGS" | sed -e 's/ *-Wl,--as-needed//g' | sed -e 's/$/ -Wl,--as-needed/'` LINK_AS_NEEDED=yes fi if test "$LINK_AS_NEEDED" = yes; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi AC_SUBST(LINK_AS_NEEDED) # IBM z/OS reset CFLAGS for config.mk if test "$zOSUnix" = "yes"; then CFLAGS="-D_ALL_SOURCE -Wc,float\(ieee\),dll" fi dnl write output files AC_OUTPUT(auto/config.mk:config.mk.in) dnl vim: set sw=2 tw=78 fo+=l: vim-7.4.1689/src/crypt.c000066400000000000000000000342441267703067000147000ustar00rootroot00000000000000/* 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. */ /* * crypt.c: Generic encryption support. */ #include "vim.h" #if defined(FEAT_CRYPT) || defined(PROTO) /* * Optional encryption support. * Mohsin Ahmed, mosh@sasi.com, 1998-09-24 * Based on zip/crypt sources. * Refactored by David Leadbeater, 2014. * * 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. * * Blowfish addition originally made by Mohsin Ahmed, * http://www.cs.albany.edu/~mosh 2010-03-14 * Based on blowfish by Bruce Schneier (http://www.schneier.com/blowfish.html) * and sha256 by Christophe Devine. */ typedef struct { char *name; /* encryption name as used in 'cryptmethod' */ char *magic; /* magic bytes stored in file header */ int salt_len; /* length of salt, or 0 when not using salt */ int seed_len; /* length of seed, or 0 when not using salt */ int works_inplace; /* encryption/decryption can be done in-place */ int whole_undofile; /* whole undo file is encrypted */ /* Optional function pointer for a self-test. */ int (* self_test_fn)(); /* Function pointer for initializing encryption/decription. */ void (* init_fn)(cryptstate_T *state, char_u *key, char_u *salt, int salt_len, char_u *seed, int seed_len); /* Function pointers for encoding/decoding from one buffer into another. * Optional, however, these or the _buffer ones should be configured. */ void (*encode_fn)(cryptstate_T *state, char_u *from, size_t len, char_u *to); void (*decode_fn)(cryptstate_T *state, char_u *from, size_t len, char_u *to); /* Function pointers for encoding and decoding, can buffer data if needed. * Optional (however, these or the above should be configured). */ long (*encode_buffer_fn)(cryptstate_T *state, char_u *from, size_t len, char_u **newptr); long (*decode_buffer_fn)(cryptstate_T *state, char_u *from, size_t len, char_u **newptr); /* Function pointers for in-place encoding and decoding, used for * crypt_*_inplace(). "from" and "to" arguments will be equal. * These may be the same as decode_fn and encode_fn above, however an * algorithm may implement them in a way that is not interchangeable with * the crypt_(en|de)code() interface (for example because it wishes to add * padding to files). * This method is used for swap and undo files which have a rigid format. */ void (*encode_inplace_fn)(cryptstate_T *state, char_u *p1, size_t len, char_u *p2); void (*decode_inplace_fn)(cryptstate_T *state, char_u *p1, size_t len, char_u *p2); } cryptmethod_T; /* index is method_nr of cryptstate_T, CRYPT_M_* */ static cryptmethod_T cryptmethods[CRYPT_M_COUNT] = { /* PK_Zip; very weak */ { "zip", "VimCrypt~01!", 0, 0, TRUE, FALSE, NULL, crypt_zip_init, crypt_zip_encode, crypt_zip_decode, NULL, NULL, crypt_zip_encode, crypt_zip_decode, }, /* Blowfish/CFB + SHA-256 custom key derivation; implementation issues. */ { "blowfish", "VimCrypt~02!", 8, 8, TRUE, FALSE, blowfish_self_test, crypt_blowfish_init, crypt_blowfish_encode, crypt_blowfish_decode, NULL, NULL, crypt_blowfish_encode, crypt_blowfish_decode, }, /* Blowfish/CFB + SHA-256 custom key derivation; fixed. */ { "blowfish2", "VimCrypt~03!", 8, 8, TRUE, TRUE, blowfish_self_test, crypt_blowfish_init, crypt_blowfish_encode, crypt_blowfish_decode, NULL, NULL, crypt_blowfish_encode, crypt_blowfish_decode, }, }; #define CRYPT_MAGIC_LEN 12 /* cannot change */ static char crypt_magic_head[] = "VimCrypt~"; /* * Return int value for crypt method name. * 0 for "zip", the old method. Also for any non-valid value. * 1 for "blowfish". * 2 for "blowfish2". */ int crypt_method_nr_from_name(char_u *name) { int i; for (i = 0; i < CRYPT_M_COUNT; ++i) if (STRCMP(name, cryptmethods[i].name) == 0) return i; return 0; } /* * Get the crypt method used for a file from "ptr[len]", the magic text at the * start of the file. * Returns -1 when no encryption used. */ int crypt_method_nr_from_magic(char *ptr, int len) { int i; if (len < CRYPT_MAGIC_LEN) return -1; for (i = 0; i < CRYPT_M_COUNT; i++) if (memcmp(ptr, cryptmethods[i].magic, CRYPT_MAGIC_LEN) == 0) return i; i = (int)STRLEN(crypt_magic_head); if (len >= i && memcmp(ptr, crypt_magic_head, i) == 0) EMSG(_("E821: File is encrypted with unknown method")); return -1; } /* * Return TRUE if the crypt method for "method_nr" can be done in-place. */ int crypt_works_inplace(cryptstate_T *state) { return cryptmethods[state->method_nr].works_inplace; } /* * Get the crypt method for buffer "buf" as a number. */ int crypt_get_method_nr(buf_T *buf) { return crypt_method_nr_from_name(*buf->b_p_cm == NUL ? p_cm : buf->b_p_cm); } /* * Return TRUE when the buffer uses an encryption method that encrypts the * whole undo file, not only the text. */ int crypt_whole_undofile(int method_nr) { return cryptmethods[method_nr].whole_undofile; } /* * Get crypt method specifc length of the file header in bytes. */ int crypt_get_header_len(int method_nr) { return CRYPT_MAGIC_LEN + cryptmethods[method_nr].salt_len + cryptmethods[method_nr].seed_len; } /* * Set the crypt method for buffer "buf" to "method_nr" using the int value as * returned by crypt_method_nr_from_name(). */ void crypt_set_cm_option(buf_T *buf, int method_nr) { free_string_option(buf->b_p_cm); buf->b_p_cm = vim_strsave((char_u *)cryptmethods[method_nr].name); } /* * If the crypt method for the current buffer has a self-test, run it and * return OK/FAIL. */ int crypt_self_test(void) { int method_nr = crypt_get_method_nr(curbuf); if (cryptmethods[method_nr].self_test_fn == NULL) return OK; return cryptmethods[method_nr].self_test_fn(); } /* * Allocate a crypt state and initialize it. */ cryptstate_T * crypt_create( int method_nr, char_u *key, char_u *salt, int salt_len, char_u *seed, int seed_len) { cryptstate_T *state = (cryptstate_T *)alloc((int)sizeof(cryptstate_T)); state->method_nr = method_nr; cryptmethods[method_nr].init_fn(state, key, salt, salt_len, seed, seed_len); return state; } /* * Allocate a crypt state from a file header and initialize it. * Assumes that header contains at least the number of bytes that * crypt_get_header_len() returns for "method_nr". */ cryptstate_T * crypt_create_from_header( int method_nr, char_u *key, char_u *header) { char_u *salt = NULL; char_u *seed = NULL; int salt_len = cryptmethods[method_nr].salt_len; int seed_len = cryptmethods[method_nr].seed_len; if (salt_len > 0) salt = header + CRYPT_MAGIC_LEN; if (seed_len > 0) seed = header + CRYPT_MAGIC_LEN + salt_len; return crypt_create(method_nr, key, salt, salt_len, seed, seed_len); } /* * Read the crypt method specific header data from "fp". * Return an allocated cryptstate_T or NULL on error. */ cryptstate_T * crypt_create_from_file(FILE *fp, char_u *key) { int method_nr; int header_len; char magic_buffer[CRYPT_MAGIC_LEN]; char_u *buffer; cryptstate_T *state; if (fread(magic_buffer, CRYPT_MAGIC_LEN, 1, fp) != 1) return NULL; method_nr = crypt_method_nr_from_magic(magic_buffer, CRYPT_MAGIC_LEN); if (method_nr < 0) return NULL; header_len = crypt_get_header_len(method_nr); if ((buffer = alloc(header_len)) == NULL) return NULL; mch_memmove(buffer, magic_buffer, CRYPT_MAGIC_LEN); if (header_len > CRYPT_MAGIC_LEN && fread(buffer + CRYPT_MAGIC_LEN, header_len - CRYPT_MAGIC_LEN, 1, fp) != 1) { vim_free(buffer); return NULL; } state = crypt_create_from_header(method_nr, key, buffer); vim_free(buffer); return state; } /* * Allocate a cryptstate_T for writing and initialize it with "key". * Allocates and fills in the header and stores it in "header", setting * "header_len". The header may include salt and seed, depending on * cryptmethod. Caller must free header. * Returns the state or NULL on failure. */ cryptstate_T * crypt_create_for_writing( int method_nr, char_u *key, char_u **header, int *header_len) { int len = crypt_get_header_len(method_nr); char_u *salt = NULL; char_u *seed = NULL; int salt_len = cryptmethods[method_nr].salt_len; int seed_len = cryptmethods[method_nr].seed_len; cryptstate_T *state; *header_len = len; *header = alloc(len); if (*header == NULL) return NULL; mch_memmove(*header, cryptmethods[method_nr].magic, CRYPT_MAGIC_LEN); if (salt_len > 0 || seed_len > 0) { if (salt_len > 0) salt = *header + CRYPT_MAGIC_LEN; if (seed_len > 0) seed = *header + CRYPT_MAGIC_LEN + salt_len; /* TODO: Should this be crypt method specific? (Probably not worth * it). sha2_seed is pretty bad for large amounts of entropy, so make * that into something which is suitable for anything. */ sha2_seed(salt, salt_len, seed, seed_len); } state = crypt_create(method_nr, key, salt, salt_len, seed, seed_len); if (state == NULL) { vim_free(*header); *header = NULL; } return state; } /* * Free the crypt state. */ void crypt_free_state(cryptstate_T *state) { vim_free(state->method_state); vim_free(state); } /* * Encode "from[len]" and store the result in a newly allocated buffer, which * is stored in "newptr". * Return number of bytes in "newptr", 0 for need more or -1 on error. */ long crypt_encode_alloc( cryptstate_T *state, char_u *from, size_t len, char_u **newptr) { cryptmethod_T *method = &cryptmethods[state->method_nr]; if (method->encode_buffer_fn != NULL) /* Has buffer function, pass through. */ return method->encode_buffer_fn(state, from, len, newptr); if (len == 0) /* Not buffering, just return EOF. */ return (long)len; *newptr = alloc((long)len); if (*newptr == NULL) return -1; method->encode_fn(state, from, len, *newptr); return (long)len; } /* * Decrypt "ptr[len]" and store the result in a newly allocated buffer, which * is stored in "newptr". * Return number of bytes in "newptr", 0 for need more or -1 on error. */ long crypt_decode_alloc( cryptstate_T *state, char_u *ptr, long len, char_u **newptr) { cryptmethod_T *method = &cryptmethods[state->method_nr]; if (method->decode_buffer_fn != NULL) /* Has buffer function, pass through. */ return method->decode_buffer_fn(state, ptr, len, newptr); if (len == 0) /* Not buffering, just return EOF. */ return len; *newptr = alloc(len); if (*newptr == NULL) return -1; method->decode_fn(state, ptr, len, *newptr); return len; } /* * Encrypting "from[len]" into "to[len]". */ void crypt_encode( cryptstate_T *state, char_u *from, size_t len, char_u *to) { cryptmethods[state->method_nr].encode_fn(state, from, len, to); } /* * decrypting "from[len]" into "to[len]". */ void crypt_decode( cryptstate_T *state, char_u *from, size_t len, char_u *to) { cryptmethods[state->method_nr].decode_fn(state, from, len, to); } /* * Simple inplace encryption, modifies "buf[len]" in place. */ void crypt_encode_inplace( cryptstate_T *state, char_u *buf, size_t len) { cryptmethods[state->method_nr].encode_inplace_fn(state, buf, len, buf); } /* * Simple inplace decryption, modifies "buf[len]" in place. */ void crypt_decode_inplace( cryptstate_T *state, char_u *buf, size_t len) { cryptmethods[state->method_nr].decode_inplace_fn(state, buf, len, buf); } /* * Free an allocated crypt key. Clear the text to make sure it doesn't stay * in memory anywhere. */ void crypt_free_key(char_u *key) { char_u *p; if (key != NULL) { for (p = key; *p != NUL; ++p) *p = 0; vim_free(key); } } /* * Check the crypt method and give a warning if it's outdated. */ void crypt_check_method(int method) { if (method < CRYPT_M_BF2) { msg_scroll = TRUE; MSG(_("Warning: Using a weak encryption method; see :help 'cm'")); } } void crypt_check_current_method(void) { crypt_check_method(crypt_get_method_nr(curbuf)); } /* * Ask the user for a crypt key. * When "store" is TRUE, the new key is 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 * crypt_get_key( 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, EXPAND_NOTHING, NULL); cmdline_star = FALSE; if (p1 == NULL) break; if (round == twice) { if (p2 != NULL && STRCMP(p1, p2) != 0) { MSG(_("Keys don't match!")); crypt_free_key(p1); crypt_free_key(p2); p2 = NULL; round = -1; /* do it again */ continue; } if (store) { set_option_value((char_u *)"key", 0L, p1, OPT_LOCAL); crypt_free_key(p1); p1 = curbuf->b_p_key; } break; } p2 = p1; } /* since the user typed this, no need to wait for return */ if (msg_didout) msg_putchar('\n'); need_wait_return = FALSE; msg_didout = FALSE; crypt_free_key(p2); return p1; } /* * Append a message to IObuff for the encryption/decryption method being used. */ void crypt_append_msg( buf_T *buf) { if (crypt_get_method_nr(buf) == 0) STRCAT(IObuff, _("[crypted]")); else { STRCAT(IObuff, "["); STRCAT(IObuff, *buf->b_p_cm == NUL ? p_cm : buf->b_p_cm); STRCAT(IObuff, "]"); } } #endif /* FEAT_CRYPT */ vim-7.4.1689/src/crypt_zip.c000066400000000000000000000065771267703067000155720ustar00rootroot00000000000000/* 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. */ /* * crypt_zip.c: Zip encryption support. */ #include "vim.h" #if defined(FEAT_CRYPT) || defined(PROTO) /* * Optional encryption support. * 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. */ /* Need a type that should be 32 bits. 64 also works but wastes space. */ # if VIM_SIZEOF_INT >= 4 typedef unsigned int u32_T; /* int is at least 32 bits */ # else typedef unsigned long u32_T; /* long should be 32 bits or more */ # endif /* The state of encryption, referenced by cryptstate_T. */ typedef struct { u32_T keys[3]; } zip_state_T; static void make_crc_tab(void); static u32_T crc_32_table[256]; /* * Fill the CRC table, if not done already. */ static void make_crc_tab(void) { u32_T 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) * (u32_T)0xedb88320L); crc_32_table[t] = v; } done = TRUE; } #define CRC32(c, b) (crc_32_table[((int)(c) ^ (b)) & 0xff] ^ ((c) >> 8)) /* * Return the next byte in the pseudo-random sequence. */ #define DECRYPT_BYTE_ZIP(keys, t) { \ short_u temp = (short_u)keys[2] | 2; \ t = (int)(((unsigned)(temp * (temp ^ 1U)) >> 8) & 0xff); \ } /* * Update the encryption keys with the next byte of plain text. */ #define UPDATE_KEYS_ZIP(keys, c) { \ 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)); \ } /* * Initialize for encryption/decryption. */ void crypt_zip_init( cryptstate_T *state, char_u *key, char_u *salt UNUSED, int salt_len UNUSED, char_u *seed UNUSED, int seed_len UNUSED) { char_u *p; zip_state_T *zs; zs = (zip_state_T *)alloc(sizeof(zip_state_T)); state->method_state = zs; make_crc_tab(); zs->keys[0] = 305419896L; zs->keys[1] = 591751049L; zs->keys[2] = 878082192L; for (p = key; *p != NUL; ++p) { UPDATE_KEYS_ZIP(zs->keys, (int)*p); } } /* * Encrypt "from[len]" into "to[len]". * "from" and "to" can be equal to encrypt in place. */ void crypt_zip_encode( cryptstate_T *state, char_u *from, size_t len, char_u *to) { zip_state_T *zs = state->method_state; size_t i; int ztemp, t; for (i = 0; i < len; ++i) { ztemp = from[i]; DECRYPT_BYTE_ZIP(zs->keys, t); UPDATE_KEYS_ZIP(zs->keys, ztemp); to[i] = t ^ ztemp; } } /* * Decrypt "from[len]" into "to[len]". */ void crypt_zip_decode( cryptstate_T *state, char_u *from, size_t len, char_u *to) { zip_state_T *zs = state->method_state; size_t i; short_u temp; for (i = 0; i < len; ++i) { temp = (short_u)zs->keys[2] | 2; temp = (int)(((unsigned)(temp * (temp ^ 1U)) >> 8) & 0xff); UPDATE_KEYS_ZIP(zs->keys, to[i] = from[i] ^ temp); } } #endif /* FEAT_CRYPT */ vim-7.4.1689/src/dehqx.py000066400000000000000000000016761267703067000150610ustar00rootroot00000000000000# Python script to get both the data and resource fork from a BinHex encoded # file. # Author: MURAOKA Taro # Last Change: 2012 Jun 29 # # Copyright (C) 2003,12 MURAOKA Taro # THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE. 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: vim-7.4.1689/src/diff.c000066400000000000000000002005641267703067000144470ustar00rootroot00000000000000/* 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, three or four buffers. */ #include "vim.h" #if defined(FEAT_DIFF) || defined(PROTO) 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 */ #define DIFF_HORIZONTAL 8 /* horizontal splits */ #define DIFF_VERTICAL 16 /* vertical splits */ 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) 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(buf_T *buf); static int diff_buf_idx_tp(buf_T *buf, tabpage_T *tp); static void diff_mark_adjust_tp(tabpage_T *tp, int idx, linenr_T line1, linenr_T line2, long amount, long amount_after); static void diff_check_unchanged(tabpage_T *tp, diff_T *dp); static int diff_check_sanity(tabpage_T *tp, diff_T *dp); static void diff_redraw(int dofold); static int diff_write(buf_T *buf, char_u *fname); static void diff_file(char_u *tmp_orig, char_u *tmp_new, char_u *tmp_diff); static int diff_equal_entry(diff_T *dp, int idx1, int idx2); static int diff_cmp(char_u *s1, char_u *s2); #ifdef FEAT_FOLDING static void diff_fold_update(diff_T *dp, int skip_idx); #endif static void diff_read(int idx_orig, int idx_new, char_u *fname); static void diff_copy_entry(diff_T *dprev, diff_T *dp, int idx_orig, int idx_new); static diff_T *diff_alloc_new(tabpage_T *tp, diff_T *dprev, diff_T *dp); #ifndef USE_CR # define tag_fgets vim_fgets #endif /* * Called when deleting or unloading a buffer: No longer make a diff with it. */ void diff_buf_delete(buf_T *buf) { int i; tabpage_T *tp; for (tp = first_tabpage; tp != NULL; tp = tp->tp_next) { i = diff_buf_idx_tp(buf, tp); if (i != DB_COUNT) { tp->tp_diffbuf[i] = NULL; tp->tp_diff_invalid = TRUE; if (tp == curtab) diff_redraw(TRUE); } } } /* * Check if the current buffer should be added to or removed from the list of * diff buffers. */ void diff_buf_adjust(win_T *win) { win_T *wp; int i; if (!win->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 == win->w_buffer && wp->w_p_diff) break; if (wp == NULL) { i = diff_buf_idx(win->w_buffer); if (i != DB_COUNT) { curtab->tp_diffbuf[i] = NULL; curtab->tp_diff_invalid = TRUE; diff_redraw(TRUE); } } } else diff_buf_add(win->w_buffer); } /* * Add a buffer to make diffs for. * Call this when a new buffer is being edited in the current window where * 'diff' is set. * Marks the current buffer as being part of the diff and requiring updating. * This must be done before any autocmd, because a command may use info * about the screen contents. */ void diff_buf_add(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 (curtab->tp_diffbuf[i] == NULL) { curtab->tp_diffbuf[i] = buf; curtab->tp_diff_invalid = TRUE; diff_redraw(TRUE); return; } EMSGN(_("E96: Can not diff more than %ld buffers"), DB_COUNT); } /* * Find buffer "buf" in the list of diff buffers for the current tab page. * Return its index or DB_COUNT if not found. */ static int diff_buf_idx(buf_T *buf) { int idx; for (idx = 0; idx < DB_COUNT; ++idx) if (curtab->tp_diffbuf[idx] == buf) break; return idx; } /* * Find buffer "buf" in the list of diff buffers for tab page "tp". * Return its index or DB_COUNT if not found. */ static int diff_buf_idx_tp(buf_T *buf, tabpage_T *tp) { int idx; for (idx = 0; idx < DB_COUNT; ++idx) if (tp->tp_diffbuf[idx] == buf) break; return idx; } /* * Mark the diff info involving buffer "buf" as invalid, it will be updated * when info is requested. */ void diff_invalidate(buf_T *buf) { tabpage_T *tp; int i; for (tp = first_tabpage; tp != NULL; tp = tp->tp_next) { i = diff_buf_idx_tp(buf, tp); if (i != DB_COUNT) { tp->tp_diff_invalid = TRUE; if (tp == curtab) diff_redraw(TRUE); } } } /* * Called by mark_adjust(): update line numbers in "curbuf". */ void diff_mark_adjust( linenr_T line1, linenr_T line2, long amount, long amount_after) { int idx; tabpage_T *tp; /* Handle all tab pages that use the current buffer in a diff. */ for (tp = first_tabpage; tp != NULL; tp = tp->tp_next) { idx = diff_buf_idx_tp(curbuf, tp); if (idx != DB_COUNT) diff_mark_adjust_tp(tp, idx, line1, line2, amount, amount_after); } } /* * Update line numbers in tab page "tp" for "curbuf" with index "idx". * 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. */ static void diff_mark_adjust_tp( tabpage_T *tp, int idx, linenr_T line1, linenr_T line2, long amount, long amount_after) { diff_T *dp; diff_T *dprev; diff_T *dnext; int i; int inserted, deleted; int n, off; linenr_T last; linenr_T lnum_deleted = line1; /* lnum of remaining deletion */ int check_unchanged; 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 = tp->tp_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(tp, dprev, dp); if (dnext == NULL) return; dnext->df_lnum[idx] = line1; dnext->df_count[idx] = inserted; for (i = 0; i < DB_COUNT; ++i) if (tp->tp_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 (tp->tp_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(tp, 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 (tp->tp_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 = tp->tp_first_diff; while (dp != NULL) { /* All counts are zero, remove this entry. */ for (i = 0; i < DB_COUNT; ++i) if (tp->tp_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) tp->tp_first_diff = dnext; else dprev->df_next = dnext; } else { /* Advance to next entry. */ dprev = dp; dp = dp->df_next; } } if (tp == curtab) { diff_redraw(TRUE); /* Need to recompute the scroll binding, may remove or add filler * lines (e.g., when adding lines above w_topline). But it's slow when * making many changes, postpone until redrawing. */ diff_need_scrollbind = TRUE; } } /* * Allocate a new diff block and link it between "dprev" and "dp". */ static diff_T * diff_alloc_new(tabpage_T *tp, 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) tp->tp_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(tabpage_T *tp, 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 (tp->tp_diffbuf[i_org] != NULL) break; if (i_org == DB_COUNT) /* safety check */ return; if (diff_check_sanity(tp, 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(tp->tp_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 (tp->tp_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(tp->tp_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 (tp->tp_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(tabpage_T *tp, diff_T *dp) { int i; for (i = 0; i < DB_COUNT; ++i) if (tp->tp_diffbuf[i] != NULL) if (dp->df_lnum[i] + dp->df_count[i] - 1 > tp->tp_diffbuf[i]->b_ml.ml_line_count) return FAIL; return OK; } /* * Mark all diff buffers in the current tab page for redraw. */ static void diff_redraw( 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, SOME_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. */ n = diff_check(wp, wp->w_topline); if ((wp != curwin && wp->w_topfill > 0) || n > 0) { if (wp->w_topfill > n) wp->w_topfill = (n < 0 ? 0 : n); else if (n > 0 && n > wp->w_topfill) wp->w_topfill = n; check_topfill(wp, FALSE); } } } /* * Write buffer "buf" to file "name". * Always use 'fileformat' set to "unix". * Return FAIL for failure */ static int diff_write(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). */ void ex_diffupdate( exarg_T *eap) /* can be NULL */ { 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; int io_error = FALSE; /* Delete all diffblocks. */ diff_clear(curtab); curtab->tp_diff_invalid = FALSE; /* Use the first buffer as the original text. */ for (idx_orig = 0; idx_orig < DB_COUNT; ++idx_orig) if (curtab->tp_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 (curtab->tp_diffbuf[idx_new] != NULL) break; if (idx_new == DB_COUNT) return; /* We need three temp file names. */ tmp_orig = vim_tempname('o', TRUE); tmp_new = vim_tempname('n', TRUE); tmp_diff = vim_tempname('d', TRUE); 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 = mch_fopen((char *)tmp_orig, "w"); if (fd == NULL) io_error = TRUE; else { if (fwrite("line1\n", (size_t)6, (size_t)1, fd) != 1) io_error = TRUE; fclose(fd); fd = mch_fopen((char *)tmp_new, "w"); if (fd == NULL) io_error = TRUE; else { if (fwrite("line2\n", (size_t)6, (size_t)1, fd) != 1) io_error = TRUE; fclose(fd); diff_file(tmp_orig, tmp_new, tmp_diff); fd = mch_fopen((char *)tmp_diff, "r"); if (fd == NULL) io_error = TRUE; else { 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) /* 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) { if (io_error) EMSG(_("E810: Cannot read or write temp files")); EMSG(_("E97: Cannot create diffs")); diff_a_works = MAYBE; #if defined(MSWIN) diff_bin_works = MAYBE; #endif goto theend; } /* :diffupdate! */ if (eap != NULL && eap->forceit) for (idx_new = idx_orig; idx_new < DB_COUNT; ++idx_new) { buf = curtab->tp_diffbuf[idx_new]; if (buf_valid(buf)) buf_check_timestamp(buf, FALSE); } /* Write the first buffer to a tempfile. */ buf = curtab->tp_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 = curtab->tp_diffbuf[idx_new]; if (buf == NULL || buf->b_ml.ml_mfp == NULL) continue; /* skip buffer that isn't loaded */ 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); /* force updating cursor position on screen */ curwin->w_valid_cursor.lnum = 0; 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( char_u *tmp_orig, char_u *tmp_new, char_u *tmp_diff) { char_u *cmd; size_t len; #ifdef FEAT_EVAL if (*p_dex != NUL) /* Use 'diffexpr' to generate the diff file. */ eval_diff(tmp_orig, tmp_new, tmp_diff); else #endif { len = STRLEN(tmp_orig) + STRLEN(tmp_new) + STRLEN(tmp_diff) + STRLEN(p_srr) + 27; cmd = alloc((unsigned)len); if (cmd != NULL) { /* We don't want $DIFF_OPTIONS to get in the way. */ if (getenv("DIFF_OPTIONS")) vim_setenv((char_u *)"DIFF_OPTIONS", (char_u *)""); /* 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. */ vim_snprintf((char *)cmd, len, "diff %s%s%s%s%s %s", diff_a_works == FALSE ? "" : "-a ", #if defined(MSWIN) diff_bin_works == TRUE ? "--binary " : "", #else "", #endif (diff_flags & DIFF_IWHITE) ? "-b " : "", (diff_flags & DIFF_ICASE) ? "-i " : "", tmp_orig, tmp_new); append_redir(cmd, (int)len, p_srr, tmp_diff); #ifdef FEAT_AUTOCMD block_autocmds(); /* Avoid ShellCmdPost stuff */ #endif (void)call_shell(cmd, SHELL_FILTER|SHELL_SILENT|SHELL_DOOUT); #ifdef FEAT_AUTOCMD unblock_autocmds(); #endif 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(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; size_t buflen; 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 struct stat st; #ifdef FEAT_BROWSE if (cmdmod.browse) { browseFile = do_browse(0, (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', FALSE); tmp_new = vim_tempname('n', FALSE); 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 buflen = STRLEN(tmp_orig) + ( # ifdef UNIX fullname != NULL ? STRLEN(fullname) : # endif STRLEN(eap->arg)) + STRLEN(tmp_new) + 16; buf = alloc((unsigned)buflen); if (buf == NULL) goto theend; #ifdef UNIX /* Temporarily 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) ignored = mch_chdir((char *)vim_tempdir); else # endif ignored = 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. */ vim_snprintf((char *)buf, buflen, "patch -o %s %s < \"%s\"", tmp_new, tmp_orig, # ifdef UNIX fullname != NULL ? fullname : # endif eap->arg); #ifdef FEAT_AUTOCMD block_autocmds(); /* Avoid ShellCmdPost stuff */ #endif (void)call_shell(buf, SHELL_FILTER | SHELL_COOKED); #ifdef FEAT_AUTOCMD unblock_autocmds(); #endif } #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); /* Only continue if the output file was created. */ if (mch_stat((char *)tmp_new, &st) < 0 || st.st_size == 0) EMSG(_("E816: Cannot read patch output")); else { 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 /* don't use a new tab page, each tab page has its own diffs */ cmdmod.tab = 0; if (win_split(0, (diff_flags & DIFF_VERTICAL) ? WSP_VERT : 0) != FAIL) { /* Pretend it was a ":split fname" command */ eap->cmdidx = CMD_split; eap->arg = tmp_new; do_exedit(eap, old_curwin); /* check that split worked and editing tmp_new */ if (curwin != old_curwin && win_valid(old_curwin)) { /* 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. */ if (au_has_group((char_u *)"filetypedetect")) 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(exarg_T *eap) { win_T *old_curwin = curwin; buf_T *old_curbuf = curbuf; #ifdef FEAT_GUI need_mouse_correct = TRUE; #endif /* don't use a new tab page, each tab page has its own diffs */ cmdmod.tab = 0; if (win_split(0, (diff_flags & DIFF_VERTICAL) ? WSP_VERT : 0) != FAIL) { /* Pretend it was a ":split fname" command */ eap->cmdidx = CMD_split; curwin->w_p_diff = TRUE; 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); if (win_valid(old_curwin)) { diff_win_options(old_curwin, TRUE); if (buf_valid(old_curbuf)) /* Move the cursor position to that of the old window. */ curwin->w_cursor.lnum = diff_get_corresponding_line( old_curbuf, old_curwin->w_cursor.lnum, curbuf, curwin->w_cursor.lnum); } } } } /* * Set options to show diffs for the current window. */ void ex_diffthis(exarg_T *eap UNUSED) { /* Set 'diff', 'scrollbind' on and 'wrap' off. */ diff_win_options(curwin, TRUE); } /* * Set options in window "wp" for diff mode. */ void diff_win_options( win_T *wp, int addbuf) /* Add buffer to diff. */ { # ifdef FEAT_FOLDING win_T *old_curwin = curwin; /* close the manually opened folds */ curwin = wp; newFoldLevel(); curwin = old_curwin; # endif /* Use 'scrollbind' and 'cursorbind' when available */ #ifdef FEAT_SCROLLBIND if (!wp->w_p_diff) wp->w_p_scb_save = wp->w_p_scb; wp->w_p_scb = TRUE; #endif #ifdef FEAT_CURSORBIND if (!wp->w_p_diff) wp->w_p_crb_save = wp->w_p_crb; wp->w_p_crb = TRUE; #endif if (!wp->w_p_diff) wp->w_p_wrap_save = wp->w_p_wrap; wp->w_p_wrap = FALSE; # ifdef FEAT_FOLDING curwin = wp; curbuf = curwin->w_buffer; if (!wp->w_p_diff) { if (wp->w_p_diff_saved) free_string_option(wp->w_p_fdm_save); wp->w_p_fdm_save = vim_strsave(wp->w_p_fdm); } set_string_option_direct((char_u *)"fdm", -1, (char_u *)"diff", OPT_LOCAL|OPT_FREE, 0); curwin = old_curwin; curbuf = curwin->w_buffer; if (!wp->w_p_diff) { wp->w_p_fdc_save = wp->w_p_fdc; wp->w_p_fen_save = wp->w_p_fen; wp->w_p_fdl_save = wp->w_p_fdl; } wp->w_p_fdc = diff_foldcolumn; wp->w_p_fen = TRUE; wp->w_p_fdl = 0; foldUpdateAll(wp); /* make sure topline is not halfway a fold */ changed_window_setting_win(wp); # endif #ifdef FEAT_SCROLLBIND if (vim_strchr(p_sbo, 'h') == NULL) do_cmdline_cmd((char_u *)"set sbo+=hor"); #endif /* Saved the current values, to be restored in ex_diffoff(). */ wp->w_p_diff_saved = TRUE; wp->w_p_diff = TRUE; if (addbuf) diff_buf_add(wp->w_buffer); redraw_win_later(wp, NOT_VALID); } /* * Set options not to show diffs. For the current window or all windows. * Only in the current tab page. */ void ex_diffoff(exarg_T *eap) { win_T *wp; #ifdef FEAT_SCROLLBIND int diffwin = FALSE; #endif for (wp = firstwin; wp != NULL; wp = wp->w_next) { if (eap->forceit ? wp->w_p_diff : wp == curwin) { /* Set 'diff' off. If option values were saved in * diff_win_options(), restore the ones whose settings seem to have * been left over from diff mode. */ wp->w_p_diff = FALSE; if (wp->w_p_diff_saved) { #ifdef FEAT_SCROLLBIND if (wp->w_p_scb) wp->w_p_scb = wp->w_p_scb_save; #endif #ifdef FEAT_CURSORBIND if (wp->w_p_crb) wp->w_p_crb = wp->w_p_crb_save; #endif if (!wp->w_p_wrap) wp->w_p_wrap = wp->w_p_wrap_save; #ifdef FEAT_FOLDING free_string_option(wp->w_p_fdm); wp->w_p_fdm = vim_strsave(wp->w_p_fdm_save); if (wp->w_p_fdc == diff_foldcolumn) wp->w_p_fdc = wp->w_p_fdc_save; if (wp->w_p_fdl == 0) wp->w_p_fdl = wp->w_p_fdl_save; /* Only restore 'foldenable' when 'foldmethod' is not * "manual", otherwise we continue to show the diff folds. */ if (wp->w_p_fen) wp->w_p_fen = foldmethodIsManual(wp) ? FALSE : wp->w_p_fen_save; foldUpdateAll(wp); /* make sure topline is not halfway a fold */ changed_window_setting_win(wp); #endif } /* Note: 'sbo' is not restored, it's a global option. */ diff_buf_adjust(wp); } #ifdef FEAT_SCROLLBIND diffwin |= wp->w_p_diff; #endif } #ifdef FEAT_SCROLLBIND /* Remove "hor" from from 'scrollopt' if there are no diff windows left. */ if (!diffwin && vim_strchr(p_sbo, 'h') != NULL) do_cmdline_cmd((char_u *)"set sbo-=hor"); #endif } /* * Read the diff output and add each entry to the diff list. */ static void diff_read( 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 = curtab->tp_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 = mch_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 (curtab->tp_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 + dpl->df_lnum[idx_orig] + dpl->df_count[idx_orig] - (dp->df_lnum[idx_orig] + dp->df_count[idx_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; ++i) if (curtab->tp_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(curtab, dprev, dp); if (dp == NULL) goto done; 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 (curtab->tp_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; } done: fclose(fd); } /* * Copy an entry at "dp" from "idx_orig" to "idx_new". */ static void diff_copy_entry( 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 for tab page "tp". */ void diff_clear(tabpage_T *tp) { diff_T *p, *next_p; for (p = tp->tp_first_diff; p != NULL; p = next_p) { next_p = p->df_next; vim_free(p); } tp->tp_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(win_T *wp, linenr_T lnum) { int idx; /* index in tp_diffbuf[] for this buffer */ diff_T *dp; int maxcount; int i; buf_T *buf = wp->w_buffer; int cmp; if (curtab->tp_diff_invalid) ex_diffupdate(NULL); /* update after a big change */ if (curtab->tp_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 = curtab->tp_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 && curtab->tp_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 && curtab->tp_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 (curtab->tp_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(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(curtab, dp) == FAIL) return FALSE; for (i = 0; i < dp->df_count[idx1]; ++i) { line = vim_strsave(ml_get_buf(curtab->tp_diffbuf[idx1], dp->df_lnum[idx1] + i, FALSE)); if (line == NULL) return FALSE; cmp = diff_cmp(line, ml_get_buf(curtab->tp_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(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)(p1); if (l != (*mb_ptr2len)(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(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(win_T *fromwin, win_T *towin) { buf_T *frombuf = fromwin->w_buffer; linenr_T lnum = fromwin->w_topline; int fromidx; int toidx; diff_T *dp; int max_count; int i; fromidx = diff_buf_idx(frombuf); if (fromidx == DB_COUNT) return; /* safety check */ if (curtab->tp_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 = curtab->tp_first_diff; dp != NULL; dp = dp->df_next) if (lnum <= dp->df_lnum[fromidx] + dp->df_count[fromidx]) 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 - (frombuf->b_ml.ml_line_count - lnum); } else { /* Find index for "towin". */ toidx = diff_buf_idx(towin->w_buffer); if (toidx == DB_COUNT) return; /* safety check */ towin->w_topline = lnum + (dp->df_lnum[toidx] - dp->df_lnum[fromidx]); if (lnum >= dp->df_lnum[fromidx]) { /* Inside a change: compute filler lines. With three or more * buffers we need to know the largest count. */ max_count = 0; for (i = 0; i < DB_COUNT; ++i) if (curtab->tp_diffbuf[i] != NULL && max_count < dp->df_count[i]) max_count = dp->df_count[i]; if (dp->df_count[toidx] == dp->df_count[fromidx]) { /* same number of lines: use same filler count */ towin->w_topfill = fromwin->w_topfill; } else if (dp->df_count[toidx] > dp->df_count[fromidx]) { if (lnum == dp->df_lnum[fromidx] + dp->df_count[fromidx]) { /* more lines in towin and fromwin doesn't show diff * lines, only filler lines */ if (max_count - fromwin->w_topfill >= dp->df_count[toidx]) { /* towin also only shows filler lines */ towin->w_topline = dp->df_lnum[toidx] + dp->df_count[toidx]; towin->w_topfill = fromwin->w_topfill; } else /* towin still has some diff lines to show */ towin->w_topline = dp->df_lnum[toidx] + max_count - fromwin->w_topfill; } } else if (towin->w_topline >= dp->df_lnum[toidx] + dp->df_count[toidx]) { /* less lines in towin and no diff lines to show: compute * filler lines */ towin->w_topline = dp->df_lnum[toidx] + dp->df_count[toidx]; if (diff_flags & DIFF_FILLER) { if (lnum == dp->df_lnum[fromidx] + dp->df_count[fromidx]) /* fromwin is also out of diff lines */ towin->w_topfill = fromwin->w_topfill; else /* fromwin has some diff lines */ towin->w_topfill = dp->df_lnum[fromidx] + max_count - lnum; } } } } /* 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(void) { char_u *p; int diff_context_new = 6; int diff_flags_new = 0; int diff_foldcolumn_new = 2; tabpage_T *tp; 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; } else if (STRNCMP(p, "horizontal", 10) == 0) { p += 10; diff_flags_new |= DIFF_HORIZONTAL; } else if (STRNCMP(p, "vertical", 8) == 0) { p += 8; diff_flags_new |= DIFF_VERTICAL; } else if (STRNCMP(p, "foldcolumn:", 11) == 0 && VIM_ISDIGIT(p[11])) { p += 11; diff_foldcolumn_new = getdigits(&p); } if (*p != ',' && *p != NUL) return FAIL; if (*p == ',') ++p; } /* Can't have both "horizontal" and "vertical". */ if ((diff_flags_new & DIFF_HORIZONTAL) && (diff_flags_new & DIFF_VERTICAL)) return FAIL; /* If "icase" or "iwhite" was added or removed, need to update the diff. */ if (diff_flags != diff_flags_new) for (tp = first_tabpage; tp != NULL; tp = tp->tp_next) tp->tp_diff_invalid = TRUE; diff_flags = diff_flags_new; diff_context = diff_context_new; diff_foldcolumn = diff_foldcolumn_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; } /* * Return TRUE if 'diffopt' contains "horizontal". */ int diffopt_horizontal(void) { return (diff_flags & DIFF_HORIZONTAL) != 0; } /* * Find the difference within a changed line. * Returns TRUE if the line was added, no other buffer has it. */ int diff_find_change( 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_org, si_new; int 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 */ { vim_free(line_org); return FALSE; } /* search for a change that includes "lnum" in the list of diffblocks. */ for (dp = curtab->tp_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(curtab, dp) == FAIL) { vim_free(line_org); return FALSE; } off = lnum - dp->df_lnum[idx]; for (i = 0; i < DB_COUNT; ++i) if (curtab->tp_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(curtab->tp_diffbuf[i], dp->df_lnum[i] + off, FALSE); /* Search for start of difference */ si_org = si_new = 0; while (line_org[si_org] != NUL) { if ((diff_flags & DIFF_IWHITE) && vim_iswhite(line_org[si_org]) && vim_iswhite(line_new[si_new])) { si_org = (int)(skipwhite(line_org + si_org) - line_org); si_new = (int)(skipwhite(line_new + si_new) - line_new); } else { if (line_org[si_org] != line_new[si_new]) break; ++si_org; ++si_new; } } #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_org -= (*mb_head_off)(line_org, line_org + si_org); si_new -= (*mb_head_off)(line_new, line_new + si_new); } #endif if (*startp > si_org) *startp = si_org; /* Search for end of difference, if any. */ if (line_org[si_org] != NUL || line_new[si_new] != NUL) { ei_org = (int)STRLEN(line_org); ei_new = (int)STRLEN(line_new); while (ei_org >= *startp && ei_new >= si_new && ei_org >= 0 && ei_new >= 0) { if ((diff_flags & DIFF_IWHITE) && vim_iswhite(line_org[ei_org]) && vim_iswhite(line_new[ei_new])) { while (ei_org >= *startp && vim_iswhite(line_org[ei_org])) --ei_org; while (ei_new >= si_new && vim_iswhite(line_new[ei_new])) --ei_new; } else { if (line_org[ei_org] != line_new[ei_new]) break; --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(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 (curtab->tp_diffbuf[i] == wp->w_buffer) idx = i; else if (curtab->tp_diffbuf[i] != NULL) other = TRUE; } /* return here if there are no diffs in the window */ if (idx == -1 || !other) return FALSE; if (curtab->tp_diff_invalid) ex_diffupdate(NULL); /* update after a big change */ /* Return if there are no diff blocks. All lines will be folded. */ if (curtab->tp_first_diff == NULL) return TRUE; for (dp = curtab->tp_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(int put, long count) { exarg_T ea; char_u buf[30]; if (count == 0) ea.arg = (char_u *)""; else { vim_snprintf((char *)buf, 30, "%ld", count); ea.arg = buf; } 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(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; int buf_empty; int found_not_ma = FALSE; /* 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 (curtab->tp_diffbuf[idx_other] != curbuf && curtab->tp_diffbuf[idx_other] != NULL) { if (eap->cmdidx != CMD_diffput || curtab->tp_diffbuf[idx_other]->b_p_ma) break; found_not_ma = TRUE; } if (idx_other == DB_COUNT) { if (found_not_ma) EMSG(_("E793: No other buffer in diff mode is modifiable")); else 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 (curtab->tp_diffbuf[i] != curbuf && curtab->tp_diffbuf[i] != NULL && (eap->cmdidx != CMD_diffput || curtab->tp_diffbuf[i]->b_p_ma)) { 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, FALSE); 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; } if (buf == curbuf) return; /* nothing to do */ 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, curtab->tp_diffbuf[idx_other]); } /* May give the warning for a changed buffer here, which can trigger the * FileChangedRO autocommand, which may do nasty things and mess * everything up. */ if (!curbuf->b_changed) { change_warning(0); if (diff_buf_idx(curbuf) != idx_to) { EMSG(_("E787: Buffer changed unexpectedly")); return; } } dprev = NULL; for (dp = curtab->tp_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; } buf_empty = bufempty(); added = 0; for (i = 0; i < count; ++i) { /* remember deleting the last line of the buffer */ buf_empty = curbuf->b_ml.ml_line_count == 1; 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 > curtab->tp_diffbuf[idx_from]->b_ml.ml_line_count) break; p = vim_strsave(ml_get_buf(curtab->tp_diffbuf[idx_from], nr, FALSE)); if (p != NULL) { ml_append(lnum + i - 1, p, 0, FALSE); vim_free(p); ++added; if (buf_empty && curbuf->b_ml.ml_line_count == 2) { /* Added the first line into an empty buffer, need to * delete the dummy empty line. */ buf_empty = FALSE; ml_delete((linenr_T)2, FALSE); } } } 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 (curtab->tp_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) curtab->tp_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 (eap->cmdidx != CMD_diffget) { /* 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(FALSE); 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(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 (curtab->tp_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_T *buf) { tabpage_T *tp; for (tp = first_tabpage; tp != NULL; tp = tp->tp_next) if (diff_buf_idx_tp(buf, tp) != DB_COUNT) return TRUE; return FALSE; } /* * 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(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 || curtab->tp_first_diff == NULL) return FAIL; if (curtab->tp_diff_invalid) ex_diffupdate(NULL); /* update after a big change */ if (curtab->tp_first_diff == NULL) /* no diffs today */ return FAIL; while (--count >= 0) { /* Check if already before first diff. */ if (dir == BACKWARD && lnum <= curtab->tp_first_diff->df_lnum[idx]) break; for (dp = curtab->tp_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; } linenr_T diff_get_corresponding_line( buf_T *buf1, linenr_T lnum1, buf_T *buf2, linenr_T lnum3) { int idx1; int idx2; diff_T *dp; int baseline = 0; linenr_T lnum2; idx1 = diff_buf_idx(buf1); idx2 = diff_buf_idx(buf2); if (idx1 == DB_COUNT || idx2 == DB_COUNT || curtab->tp_first_diff == NULL) return lnum1; if (curtab->tp_diff_invalid) ex_diffupdate(NULL); /* update after a big change */ if (curtab->tp_first_diff == NULL) /* no diffs today */ return lnum1; for (dp = curtab->tp_first_diff; dp != NULL; dp = dp->df_next) { if (dp->df_lnum[idx1] > lnum1) { lnum2 = lnum1 - baseline; /* don't end up past the end of the file */ if (lnum2 > buf2->b_ml.ml_line_count) lnum2 = buf2->b_ml.ml_line_count; return lnum2; } else if ((dp->df_lnum[idx1] + dp->df_count[idx1]) > lnum1) { /* Inside the diffblock */ baseline = lnum1 - dp->df_lnum[idx1]; if (baseline > dp->df_count[idx2]) baseline = dp->df_count[idx2]; return dp->df_lnum[idx2] + baseline; } else if ( (dp->df_lnum[idx1] == lnum1) && (dp->df_count[idx1] == 0) && (dp->df_lnum[idx2] <= lnum3) && ((dp->df_lnum[idx2] + dp->df_count[idx2]) > lnum3)) /* * Special case: if the cursor is just after a zero-count * block (i.e. all filler) and the target cursor is already * inside the corresponding block, leave the target cursor * unmoved. This makes repeated CTRL-W W operations work * as expected. */ return lnum3; baseline = (dp->df_lnum[idx1] + dp->df_count[idx1]) - (dp->df_lnum[idx2] + dp->df_count[idx2]); } /* If we get here then the cursor is after the last diff */ lnum2 = lnum1 - baseline; /* don't end up past the end of the file */ if (lnum2 > buf2->b_ml.ml_line_count) lnum2 = buf2->b_ml.ml_line_count; return lnum2; } #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(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 (curtab->tp_diff_invalid) ex_diffupdate(NULL); /* update after a big change */ /* search for a change that includes "lnum" in the list of diffblocks. */ for (dp = curtab->tp_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 */ vim-7.4.1689/src/digraph.c000066400000000000000000001525151267703067000151570ustar00rootroot00000000000000/* 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(int, int, int); static void printdigraph(digr_T *); /* digraphs added by the user */ static garray_T user_digraphs = {0, 0, (int)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). */ static digr_T digraphdefault[] = #ifdef __MINT__ /* * ATARI digraphs */ {{'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 */ {{'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 */ {{'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 */ {'E', 'u', 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 */ {{'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 */ {{'~', '!', 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) */ { {'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}, {'=', 'e', 0x20ac}, /* euro */ {'E', 'u', 0x20ac}, /* euro */ {'=', 'R', 0x20bd}, /* rouble */ {'=', 'P', 0x20bd}, /* rouble */ {'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}, /* code points 0xe000 - 0xefff excluded, they have no assigned * characters, only used in proposals. */ {'f', 'f', 0xfb00}, {'f', 'i', 0xfb01}, {'f', 'l', 0xfb02}, {'f', 't', 0xfb05}, {'s', 't', 0xfb06}, # endif /* FEAT_MBYTE */ /* Vim 5.x compatible digraphs that don't conflict with the above */ {'~', '!', 161}, /* */ {'c', '|', 162}, /* */ {'$', '$', 163}, /* */ {'o', 'x', 164}, /* - currency symbol in ISO 8859-1 */ {'Y', '-', 165}, /* */ {'|', '|', 166}, /* */ {'c', 'O', 169}, /* */ {'-', ',', 172}, /* */ {'-', '=', 175}, /* */ {'~', 'o', 176}, /* */ {'2', '2', 178}, /* */ {'3', '3', 179}, /* */ {'p', 'p', 182}, /* */ {'~', '.', 183}, /* */ {'1', '1', 185}, /* */ {'~', '?', 191}, /* */ {'A', '`', 192}, /* */ {'A', '^', 194}, /* */ {'A', '~', 195}, /* */ {'A', '"', 196}, /* */ {'A', '@', 197}, /* */ {'E', '`', 200}, /* */ {'E', '^', 202}, /* */ {'E', '"', 203}, /* */ {'I', '`', 204}, /* */ {'I', '^', 206}, /* */ {'I', '"', 207}, /* */ {'N', '~', 209}, /* */ {'O', '`', 210}, /* */ {'O', '^', 212}, /* */ {'O', '~', 213}, /* */ {'/', '\\', 215}, /* - multiplication symbol in ISO 8859-1 */ {'U', '`', 217}, /* */ {'U', '^', 219}, /* */ {'I', 'p', 222}, /* */ {'a', '`', 224}, /* */ {'a', '^', 226}, /* */ {'a', '~', 227}, /* */ {'a', '"', 228}, /* */ {'a', '@', 229}, /* */ {'e', '`', 232}, /* */ {'e', '^', 234}, /* */ {'e', '"', 235}, /* */ {'i', '`', 236}, /* */ {'i', '^', 238}, /* */ {'n', '~', 241}, /* */ {'o', '`', 242}, /* */ {'o', '^', 244}, /* */ {'o', '~', 245}, /* */ {'u', '`', 249}, /* */ {'u', '^', 251}, /* */ {'y', '"', 255}, /* x XX */ {NUL, NUL, NUL} }; # endif /* OLD_DIGRAPHS */ # endif /* Macintosh */ # endif /* EBCDIC */ # endif /* !HPUX_DIGRAPHS */ #endif /* !__MINT__ */ /* * handle digraphs after typing a character */ int do_digraph(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( int cmdline) /* TRUE when called from the cmdline */ { int c, cc; ++no_mapping; ++allow_keys; c = plain_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 = plain_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_char" is TRUE and "char1" is a space, return "char2" | 0x80. */ static int getexactdigraph(int char1, int char2, int meta_char) { 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_char) /* --> meta-char */ return (char2 | 0x80); return char2; } return retval; } /* * Get digraph. * Allow for both char1-char2 and char2-char1 */ int getdigraph(int char1, int char2, int meta_char) { int retval; if (((retval = getexactdigraph(char1, char2, meta_char)) == char2) && (char1 != char2) && ((retval = getexactdigraph(char2, char1, meta_char)) == char1)) return char2; return retval; } /* * Add the digraphs in the argument to the digraph table. * format: {c1}{c2} char {c1}{c2} char ... */ void putdigraph(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; } } } } void listdigraphs(void) { 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(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++ = (char_u)dp->result; if (char2cells(dp->result) == 1) *p++ = ' '; vim_snprintf((char *)p, sizeof(buf) - (p - buf), " %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(void); /* * Set up key mapping tables for the 'keymap' option. * Returns NULL if OK, an error message for failure. This only needs to be * used when setting the option, not later when the value has already been * checked. */ char_u * keymap_init(void) { curbuf->b_kmap_state &= ~KEYMAP_INIT; if (*curbuf->b_p_keymap == NUL) { /* Stop any active keymap and clear the table. Also remove * b:keymap_name, as no keymap is active now. */ keymap_unload(); do_cmdline_cmd((char_u *)"unlet! b:keymap_name"); } else { char_u *buf; size_t buflen; /* Source the keymap file. It will contain a ":loadkeymap" command * which will call ex_loadkeymap() below. */ buflen = STRLEN(curbuf->b_p_keymap) # ifdef FEAT_MBYTE + STRLEN(p_enc) # endif + 14; buf = alloc((unsigned)buflen); if (buf == NULL) return e_outofmem; # ifdef FEAT_MBYTE /* try finding "keymap/'keymap'_'encoding'.vim" in 'runtimepath' */ vim_snprintf((char *)buf, buflen, "keymap/%s_%s.vim", curbuf->b_p_keymap, p_enc); if (source_runtime(buf, 0) == FAIL) # endif { /* try finding "keymap/'keymap'.vim" in 'runtimepath' */ vim_snprintf((char *)buf, buflen, "keymap/%s.vim", curbuf->b_p_keymap); if (source_runtime(buf, 0) == 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(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 || *kp->from == NUL || *kp->to == NUL) { if (kp->to != NULL && *kp->to == NUL) EMSG(_("E791: Empty keymap entry")); vim_free(kp->from); vim_free(kp->to); } else ++curbuf->b_kmap_ga.ga_len; } vim_free(line); } /* * setup ":lnoremap" to map the keys */ for (i = 0; i < curbuf->b_kmap_ga.ga_len; ++i) { vim_snprintf((char *)buf, sizeof(buf), " %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(void) { char_u buf[KMAP_MAXLEN + 10]; int i; char_u *save_cpo = p_cpo; kmap_T *kp; 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 */ kp = (kmap_T *)curbuf->b_kmap_ga.ga_data; for (i = 0; i < curbuf->b_kmap_ga.ga_len; ++i) { vim_snprintf((char *)buf, sizeof(buf), " %s", kp[i].from); (void)do_map(1, buf, LANGMAP, FALSE); vim_free(kp[i].from); vim_free(kp[i].to); } 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 */ vim-7.4.1689/src/dimm.idl000066400000000000000000000637371267703067000150240ustar00rootroot00000000000000//+------------------------------------------------------------------------- // // 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 ") 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; }; } vim-7.4.1689/src/dlldata.c000066400000000000000000000014231267703067000151350ustar00rootroot00000000000000/********************************************************* 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 #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 */ vim-7.4.1689/src/dosinst.c000066400000000000000000002101471267703067000152200ustar00rootroot00000000000000/* 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 */ /* * 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 enhancements", "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 (, , 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", }; /* * 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; /* avoid looking in the "installdir" by chdir to system root */ mch_chdir(sysdrive); mch_chdir("\\"); 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); targets[i].oldbat = NULL; } } 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 && strlen(vim) < BUFSIZE) { 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(2); } } static int num_windows; /* * Callback used for EnumWindows(): * Count the window if the title looks like it is for the uninstaller. */ /*ARGSUSED*/ static BOOL CALLBACK window_cb(HWND hwnd, LPARAM lparam) { char title[256]; title[0] = 0; GetWindowText(hwnd, title, 256); if (strstr(title, "Vim ") != NULL && strstr(title, "Uninstall:") != NULL) ++num_windows; return TRUE; } /* * Check for already installed Vims. * Return non-zero when found one. */ static int uninstall_check(int skip_question) { 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_WOW64_64KEY | 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_WOW64_64KEY | 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"); if (skip_question) printf("\nRunning uninstall program for \"%s\"\n", temp_string_buffer); else 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); if (skip_question) input = 'y'; else { 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); /* 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. */ { char buf[BUFSIZE]; if (strchr(temp_string_buffer, ' ') != NULL) sprintf(buf, "\"%s\"", temp_string_buffer); else strcpy(buf, temp_string_buffer); run_command(buf); } /* Count the number of windows with a title that match * the installer, so that we can check when it's done. * The uninstaller copies itself, executes the copy * and exits, thus we can't wait for the process to * finish. */ sleep(1); /* wait for uninstaller to start up */ num_windows = 0; EnumWindows(window_cb, 0); sleep(1); /* wait for windows to be counted */ if (num_windows == 0) { /* Did not find the uninstaller, ask user to press * Enter when done. Just in case. */ printf("Press Enter when the uninstaller is finished\n"); rewind(stdin); (void)getchar(); } else { printf("Waiting for the uninstaller to finish (press CTRL-C to abort)."); do { printf("."); fflush(stdout); num_windows = 0; EnumWindows(window_cb, 0); sleep(1); /* wait for windows to be counted */ } while (num_windows > 0); } printf("\nDone!\n"); /* Check if an uninstall 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; } /* * 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; 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"); fprintf(fd, "\n"); fprintf(fd, "setlocal\n"); /* Don't use double quotes for the "set" argument, also when it * contains a space. The quotes would be included in the value * for MSDOS and NT. * The order of preference is: * 1. $VIMRUNTIME/vim.exe (user preference) * 2. $VIM/vim70/vim.exe (hard coded version) * 3. installdir/vim.exe (hard coded install directory) */ fprintf(fd, "set VIM_EXE_DIR=%s\n", installdir); fprintf(fd, "if exist \"%%VIM%%\\%s\\%s\" set VIM_EXE_DIR=%%VIM%%\\%s\n", VIM_VERSION_NODOT, exename, VIM_VERSION_NODOT); fprintf(fd, "if exist \"%%VIMRUNTIME%%\\%s\" set VIM_EXE_DIR=%%VIMRUNTIME%%\n", exename); fprintf(fd, "\n"); /* Give an error message when the executable could not be found. */ fprintf(fd, "if exist \"%%VIM_EXE_DIR%%\\%s\" goto havevim\n", exename); fprintf(fd, "echo \"%%VIM_EXE_DIR%%\\%s\" not found\n", exename); fprintf(fd, "goto eof\n"); fprintf(fd, "\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==.--nofork goto noforklongarg\n"); fprintf(fd, "set VIMNOFORK=1\n"); fprintf(fd, ":noforklongarg\n"); 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"); fprintf(fd, ":loopend\n"); fprintf(fd, "\n"); fprintf(fd, "if .%%OS%%==.Windows_NT goto ntaction\n"); fprintf(fd, "\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 "); } /* Always use quotes, $VIM or $VIMRUNTIME might have a space. */ fprintf(fd, "\"%%VIM_EXE_DIR%%\\%s\" %s %%VIMARGS%%\n", exename, vimarg); fprintf(fd, "goto eof\n"); fprintf(fd, "\n"); if (*exename == 'g') { fprintf(fd, ":nofork\n"); fprintf(fd, "start /w "); /* Always use quotes, $VIM or $VIMRUNTIME might have a space. */ fprintf(fd, "\"%%VIM_EXE_DIR%%\\%s\" %s %%VIMARGS%%\n", exename, vimarg); fprintf(fd, "goto eof\n"); fprintf(fd, "\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 "); } /* Always use quotes, $VIM or $VIMRUNTIME might have a space. */ fprintf(fd, "\"%%VIM_EXE_DIR%%\\%s\" %s %%*\n", exename, vimarg); fprintf(fd, "goto eof\n"); fprintf(fd, "\n"); if (*exename == 'g') { fprintf(fd, ":noforknt\n"); fprintf(fd, "start \"dummy\" /b /wait "); /* Always use quotes, $VIM or $VIMRUNTIME might have a space. */ fprintf(fd, "\"%%VIM_EXE_DIR%%\\%s\" %s %%*\n", exename, 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. */ static void install_vimrc(int idx) { FILE *fd, *tfd; char *fname; /* 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"); /* If the path has a space: When using cmd.exe (Win NT/2000/XP) put * quotes around the diff command and rely on the default value of * shellxquote to solve the quoting problem for the whole 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 $VIMRUNTIME =~ ' '\n"); fprintf(fd, " if &sh =~ '\\ ' . arg3\n"); fprintf(fd, " if exists('l:shxq_sav')\n"); fprintf(fd, " let &shellxquote=l:shxq_sav\n"); fprintf(fd, " endif\n"); 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; } #if defined(WIN3264) static LONG reg_create_key( HKEY root, const char *subkey, PHKEY phKey) { DWORD disp; *phKey = NULL; return RegCreateKeyEx( root, subkey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WOW64_64KEY | KEY_WRITE, NULL, phKey, &disp); } static LONG reg_set_string_value( HKEY hKey, const char *value_name, const char *data) { return RegSetValueEx(hKey, value_name, 0, REG_SZ, (LPBYTE)data, (DWORD)(1 + strlen(data))); } static LONG reg_create_key_and_value( HKEY hRootKey, const char *subkey, const char *value_name, const char *data) { HKEY hKey; LONG lRet = reg_create_key(hRootKey, subkey, &hKey); if (ERROR_SUCCESS == lRet) { lRet = reg_set_string_value(hKey, value_name, data); RegCloseKey(hKey); } return lRet; } static LONG register_inproc_server( HKEY hRootKey, const char *clsid, const char *extname, const char *module, const char *threading_model) { CHAR subkey[BUFSIZE]; LONG lRet; sprintf(subkey, "CLSID\\%s", clsid); lRet = reg_create_key_and_value(hRootKey, subkey, NULL, extname); if (ERROR_SUCCESS == lRet) { sprintf(subkey, "CLSID\\%s\\InProcServer32", clsid); lRet = reg_create_key_and_value(hRootKey, subkey, NULL, module); if (ERROR_SUCCESS == lRet) { lRet = reg_create_key_and_value(hRootKey, subkey, "ThreadingModel", threading_model); } } return lRet; } static LONG register_shellex( HKEY hRootKey, const char *clsid, const char *name, const char *exe_path) { LONG lRet = reg_create_key_and_value( hRootKey, "*\\shellex\\ContextMenuHandlers\\gvim", NULL, clsid); if (ERROR_SUCCESS == lRet) { lRet = reg_create_key_and_value( HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved", clsid, name); if (ERROR_SUCCESS == lRet) { lRet = reg_create_key_and_value( HKEY_LOCAL_MACHINE, "Software\\Vim\\Gvim", "path", exe_path); } } return lRet; } static LONG register_openwith( HKEY hRootKey, const char *exe_path) { char exe_cmd[BUFSIZE]; LONG lRet; sprintf(exe_cmd, "\"%s\" \"%%1\"", exe_path); lRet = reg_create_key_and_value( hRootKey, "Applications\\gvim.exe\\shell\\edit\\command", NULL, exe_cmd); if (ERROR_SUCCESS == lRet) { int i; static const char *openwith[] = { ".htm\\OpenWithList\\gvim.exe", ".vim\\OpenWithList\\gvim.exe", "*\\OpenWithList\\gvim.exe", }; for (i = 0; ERROR_SUCCESS == lRet && i < sizeof(openwith) / sizeof(openwith[0]); i++) { lRet = reg_create_key_and_value(hRootKey, openwith[i], NULL, ""); } } return lRet; } static LONG register_uninstall( HKEY hRootKey, const char *appname, const char *display_name, const char *uninstall_string) { LONG lRet = reg_create_key_and_value(hRootKey, appname, "DisplayName", display_name); if (ERROR_SUCCESS == lRet) lRet = reg_create_key_and_value(hRootKey, appname, "UninstallString", uninstall_string); return lRet; } #endif /* WIN3264 */ /* * 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 int install_registry(void) { #ifdef WIN3264 LONG lRet = ERROR_SUCCESS; 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 vim_exe_path[BUFSIZE]; char display_name[BUFSIZE]; char uninstall_string[BUFSIZE]; sprintf(vim_exe_path, "%s\\gvim.exe", installdir); if (install_popup) { char bufg[BUFSIZE]; struct stat st; if (stat("gvimext.dll", &st) >= 0) sprintf(bufg, "%s\\gvimext.dll", installdir); else /* gvimext.dll is in gvimext subdir */ sprintf(bufg, "%s\\gvimext\\gvimext.dll", installdir); printf("Creating \"Edit with Vim\" popup menu entry\n"); lRet = register_inproc_server( HKEY_CLASSES_ROOT, vim_ext_clsid, vim_ext_name, bufg, vim_ext_ThreadingModel); if (ERROR_SUCCESS != lRet) return FAIL; lRet = register_shellex( HKEY_CLASSES_ROOT, vim_ext_clsid, vim_ext_name, vim_exe_path); if (ERROR_SUCCESS != lRet) return FAIL; } if (install_openwith) { printf("Creating \"Open with ...\" list entry\n"); lRet = register_openwith(HKEY_CLASSES_ROOT, vim_exe_path); if (ERROR_SUCCESS != lRet) return FAIL; } printf("Creating an uninstall entry\n"); /* For the NSIS installer use the generated uninstaller. */ if (interactive) { sprintf(display_name, "Vim " VIM_VERSION_SHORT); sprintf(uninstall_string, "%s\\uninstal.exe", installdir); } else { sprintf(display_name, "Vim " VIM_VERSION_SHORT " (self-installing)"); sprintf(uninstall_string, "%s\\uninstall-gui.exe", installdir); } lRet = register_uninstall( HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Vim " VIM_VERSION_SHORT, display_name, uninstall_string); if (ERROR_SUCCESS != lRet) return FAIL; #endif /* WIN3264 */ return OK; } 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 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. However, not specifying a directory results in the * current directory to be c:\Windows\system32 on Windows 7. Use environment * variables instead. */ #define WORKDIR "%HOMEDRIVE%%HOMEPATH%" /* * 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(" Ignored\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(1); /* 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 * a little while, so that the user can read the messages. */ if (i) sleep(3); 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(0); #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"); myexit(0); } else { /* * Run non-interactive - setup according to the command line switches */ command_line_setup_choices(argc, argv); install(); /* Avoid that the user has to hit Enter, just wait a little bit to * allow reading the messages. */ sleep(2); } return 0; } vim-7.4.1689/src/dosinst.h000066400000000000000000000356361267703067000152350ustar00rootroot00000000000000/* 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 */ /* Visual Studio 2005 has 'deprecated' many of the standard CRT functions */ #if _MSC_VER >= 1400 # define _CRT_SECURE_NO_DEPRECATE # define _CRT_NONSTDC_NO_DEPRECATE #endif #include #include #include #include #include #ifndef UNIX_LINT # include "vimio.h" # include # ifndef __CYGWIN__ # include # endif # if defined(_WIN64) || defined(WIN32) # define WIN3264 # include # include # else # include # include # include # endif #endif #ifdef UNIX_LINT /* Running lint on Unix: Some things are missing. */ char *searchpath(char *name); #endif #if defined(UNIX_LINT) # include # include #endif #include "version.h" #if 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 sleep(n) Sleep((n) * 1000) /* ---------------------------------------- */ #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 /* * Modern way of creating registry entries, also works on 64 bit windows when * compiled as a 32 bit program. */ # ifndef KEY_WOW64_64KEY # define KEY_WOW64_64KEY 0x0100 # 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 # 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 #ifndef CSIDL_COMMON_PROGRAMS # define CSIDL_COMMON_PROGRAMS 0x0017 #endif #ifndef CSIDL_COMMON_DESKTOPDIRECTORY # define CSIDL_COMMON_DESKTOPDIRECTORY 0x0019 #endif /* * 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; csidl = CSIDL_COMMON_DESKTOPDIRECTORY; alt_csidl = CSIDL_DESKTOP; } else if (strncmp(shell_folder_name, "Programs", 8) == 0) { pcsidl = &programs_csidl; csidl = CSIDL_COMMON_PROGRAMS; alt_csidl = CSIDL_PROGRAMS; } 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 9 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"}, {"vimtutor","vimtutor.bat", "Vim tutor.lnk", "vimtutor.bat", "vimtutor.bat", ""}, }; #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 when WIN3264 is defined and for uninstal.c * when not being able to directly access registry entries. */ #if (defined(DOSINST) && defined(WIN3264)) \ || (!defined(DOSINST) && !defined(WIN3264)) /* * 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. */ 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, "start" 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\" /wait %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. */ 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(®s, ®s); /* set default drive */ regs.h.ah = 0x19; intdos(®s, ®s); /* 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) /* already 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) { /* 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:\\"; } vim-7.4.1689/src/edit.c000066400000000000000000007741451267703067000144770ustar00rootroot00000000000000/* 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 CTRL_X_FUNCTION 12 #define CTRL_X_OMNI 13 #define CTRL_X_SPELL 14 #define CTRL_X_LOCAL_MSG 15 /* only used in "ctrl_x_msgs" */ #define CTRL_X_EVAL 16 /* for builtin function complete() */ #define CTRL_X_MSG(i) ctrl_x_msgs[(i) & ~CTRL_X_WANT_IDENT] #define CTRL_X_MODE_LINE_OR_EVAL(m) (m == CTRL_X_WHOLE_LINE || m == CTRL_X_EVAL) static char *ctrl_x_msgs[] = { N_(" Keyword completion (^N^P)"), /* ctrl_x_mode == 0, ^P/^N compl. */ N_(" ^X mode (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y)"), NULL, 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)"), N_(" User defined completion (^U^N^P)"), N_(" Omni completion (^O^N^P)"), N_(" Spelling suggestion (s^N^P)"), N_(" Keyword Local completion (^N^P)"), NULL, /* CTRL_X_EVAL doesn't use msg. */ }; static char e_hitend[] = N_("Hit end of paragraph"); #ifdef FEAT_COMPL_FUNC static char e_complwin[] = N_("E839: Completion function changed window"); static char e_compldel[] = N_("E840: Completion function deleted text"); #endif /* * Structure used to store one match for insert completion. */ typedef struct compl_S compl_T; struct compl_S { compl_T *cp_next; compl_T *cp_prev; char_u *cp_str; /* matched text */ char cp_icase; /* TRUE or FALSE: ignore case */ char_u *(cp_text[CPT_COUNT]); /* text for the menu */ char_u *cp_fname; /* file containing the match, allocated when * cp_flags has FREE_FNAME */ int cp_flags; /* ORIGINAL_TEXT, CONT_S_IPOS or FREE_FNAME */ int cp_number; /* sequence number */ }; #define ORIGINAL_TEXT (1) /* the original text when the expansion begun */ #define FREE_FNAME (2) /* * All the current matches are stored in a list. * "compl_first_match" points to the start of the list. * "compl_curr_match" points to the currently selected entry. * "compl_shown_match" is different from compl_curr_match during * ins_compl_get_exp(). */ static compl_T *compl_first_match = NULL; static compl_T *compl_curr_match = NULL; static compl_T *compl_shown_match = NULL; /* After using a cursor key selects a match in the popup menu, * otherwise it inserts a line break. */ static int compl_enter_selects = FALSE; /* When "compl_leader" is not NULL only matches that start with this string * are used. */ static char_u *compl_leader = NULL; static int compl_get_longest = FALSE; /* put longest common string in compl_leader */ static int compl_no_insert = FALSE; /* FALSE: select & insert TRUE: noinsert */ static int compl_no_select = FALSE; /* FALSE: select & insert TRUE: noselect */ static int compl_used_match; /* Selected one of the matches. When FALSE the match was edited or using the longest common string. */ static int compl_was_interrupted = FALSE; /* didn't finish finding completions. */ static int compl_restarting = FALSE; /* don't insert match */ /* When the first completion is done "compl_started" is set. When it's * FALSE the word to be completed must be located. */ static int compl_started = FALSE; /* Set when doing something for completion that may call edit() recursively, * which is not allowed. */ static int compl_busy = FALSE; static int compl_matches = 0; static char_u *compl_pattern = NULL; static int compl_direction = FORWARD; static int compl_shows_dir = FORWARD; static int compl_pending = 0; /* > 1 for postponed CTRL-N */ static pos_T compl_startpos; static colnr_T compl_col = 0; /* column where the text starts * that is being completed */ static char_u *compl_orig_text = NULL; /* text as it was before * completion started */ static int compl_cont_mode = 0; static expand_T compl_xp; static int compl_opt_refresh_always = FALSE; static void ins_ctrl_x(void); static int has_compl_option(int dict_opt); static int ins_compl_accept_char(int c); static int ins_compl_add(char_u *str, int len, int icase, char_u *fname, char_u **cptext, int cdir, int flags, int adup); static int ins_compl_equal(compl_T *match, char_u *str, int len); static void ins_compl_longest_match(compl_T *match); static void ins_compl_add_matches(int num_matches, char_u **matches, int icase); static int ins_compl_make_cyclic(void); static void ins_compl_upd_pum(void); static void ins_compl_del_pum(void); static int pum_wanted(void); static int pum_enough_matches(void); static void ins_compl_dictionaries(char_u *dict, char_u *pat, int flags, int thesaurus); static void ins_compl_files(int count, char_u **files, int thesaurus, int flags, regmatch_T *regmatch, char_u *buf, int *dir); static char_u *find_line_end(char_u *ptr); static void ins_compl_free(void); static void ins_compl_clear(void); static int ins_compl_bs(void); static int ins_compl_need_restart(void); static void ins_compl_new_leader(void); static void ins_compl_addleader(int c); static int ins_compl_len(void); static void ins_compl_restart(void); static void ins_compl_set_original_text(char_u *str); static void ins_compl_addfrommatch(void); static int ins_compl_prep(int c); static void ins_compl_fixRedoBufForLeader(char_u *ptr_arg); static buf_T *ins_compl_next_buf(buf_T *buf, int flag); #if defined(FEAT_COMPL_FUNC) || defined(FEAT_EVAL) static void ins_compl_add_list(list_T *list); static void ins_compl_add_dict(dict_T *dict); #endif static int ins_compl_get_exp(pos_T *ini); static void ins_compl_delete(void); static void ins_compl_insert(void); static int ins_compl_next(int allow_get_expansion, int count, int insert_match); static int ins_compl_key2dir(int c); static int ins_compl_pum_key(int c); static int ins_compl_key2count(int c); static int ins_compl_use_match(int c); static int ins_complete(int c, int enable_pum); static void show_pum(int save_w_wrow); static unsigned quote_meta(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(int ready); static void ins_ctrl_v(void); static void undisplay_dollar(void); static void insert_special(int, int, int); static void internal_format(int textwidth, int second_indent, int flags, int format_only, int c); static void check_auto_format(int); static void redo_literal(int c); static void start_arrow(pos_T *end_insert_pos); static void start_arrow_with_change(pos_T *end_insert_pos, int change); static void start_arrow_common(pos_T *end_insert_pos, int change); #ifdef FEAT_SPELL static void check_spell_redraw(void); static void spell_back_to_badword(void); static int spell_bad_len = 0; /* length of located bad word */ #endif static void stop_insert(pos_T *end_insert_pos, int esc, int nomove); static int echeck_abbr(int); static int replace_pop(void); static void replace_join(int off); static void replace_pop_ins(void); #ifdef FEAT_MBYTE static void mb_replace_pop_ins(int cc); #endif static void replace_flush(void); static void replace_do_bs(int limit_col); static int del_char_after_col(int limit_col); #ifdef FEAT_CINDENT static int cindent_on(void); #endif static void ins_reg(void); static void ins_ctrl_g(void); static void ins_ctrl_hat(void); static int ins_esc(long *count, int cmdchar, int nomove); #ifdef FEAT_RIGHTLEFT static void ins_ctrl_(void); #endif static int ins_start_select(int c); static void ins_insert(int replaceState); static void ins_ctrl_o(void); static void ins_shift(int c, int lastc); static void ins_del(void); static int ins_bs(int c, int mode, int *inserted_space_p); #ifdef FEAT_MOUSE static void ins_mouse(int c); static void ins_mousescroll(int dir); #endif #if defined(FEAT_GUI_TABLINE) || defined(PROTO) static void ins_tabline(int c); #endif static void ins_left(int end_change); static void ins_home(int c); static void ins_end(int c); static void ins_s_left(void); static void ins_right(int end_change); static void ins_s_right(void); static void ins_up(int startcol); static void ins_pageup(void); static void ins_down(int startcol); static void ins_pagedown(void); #ifdef FEAT_DND static void ins_drop(void); #endif static int ins_tab(void); static int ins_eol(int c); #ifdef FEAT_DIGRAPHS static int ins_digraph(void); #endif static int ins_ctrl_ey(int tc); #ifdef FEAT_SMARTINDENT static void ins_try_si(int c); #endif static colnr_T get_nolist_virtcol(void); #ifdef FEAT_AUTOCMD static char_u *do_insert_char_pre(int c); #endif static colnr_T Insstart_textlen; /* length of line when insert started */ static colnr_T Insstart_blank_vcol; /* vcol for first inserted blank */ static int update_Insstart_orig = TRUE; /* set Insstart_orig to Insstart */ 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 */ static int did_restart_edit; /* "restart_edit" when calling edit() */ #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 static int revins_on; /* reverse insert mode on */ static int revins_chars; /* how much to skip after edit */ static int revins_legal; /* was the last char 'legal'? */ static int revins_scol; /* start column of revins session */ #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 */ static int dont_sync_undo = FALSE; /* CTRL-G U prevents syncing undo for the next left/right cursor */ /* * edit(): Start inserting text. * * "cmdchar" can be: * 'i' normal insert command * 'a' normal append command * 'R' replace command * 'r' "r" command: insert one . Note: count can be > 1, for redo, * but still only one is inserted. The 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( int cmdchar, int startln, /* if set, insert at start of line */ long count) { int c = 0; char_u *ptr; int lastc = 0; int mincol; static linenr_T o_lnum = 0; 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 nomove = FALSE; /* don't move cursor on return */ /* Remember whether editing was restarted after CTRL-O. */ did_restart_edit = restart_edit; /* sleep before redrawing, needed for "CTRL-O :" that results in an * error message */ check_for_delay(TRUE); /* set Insstart_orig to Insstart */ update_Insstart_orig = TRUE; #ifdef HAVE_SANDBOX /* Don't allow inserting in the sandbox. */ if (sandbox != 0) { EMSG(_(e_sandbox)); return FALSE; } #endif /* Don't allow changes in the buffer while editing the cmdline. The * caller of getcmdline() may get confused. */ if (textlock != 0) { EMSG(_(e_secure)); return FALSE; } #ifdef FEAT_INS_EXPAND /* Don't allow recursive insert mode when busy with completion. */ if (compl_started || compl_busy || pum_visible()) { EMSG(_(e_secure)); return FALSE; } ins_compl_clear(); /* clear stuff for CTRL-X mode */ #endif #ifdef FEAT_AUTOCMD /* * Trigger InsertEnter autocommands. Do not do this for "r" or "grx". */ if (cmdchar != 'r' && cmdchar != 'v') { pos_T save_cursor = curwin->w_cursor; # ifdef FEAT_EVAL if (cmdchar == 'R') ptr = (char_u *)"r"; else if (cmdchar == 'V') ptr = (char_u *)"v"; else ptr = (char_u *)"i"; set_vim_var_string(VV_INSERTMODE, ptr, 1); set_vim_var_string(VV_CHAR, NULL, -1); /* clear v:char */ # endif apply_autocmds(EVENT_INSERTENTER, NULL, NULL, FALSE, curbuf); /* Make sure the cursor didn't move. Do call check_cursor_col() in * case the text was modified. Since Insert mode was not started yet * a call to check_cursor_col() may move the cursor, especially with * the "A" command, thus set State to avoid that. Also check that the * line number is still valid (lines may have been deleted). * Do not restore if v:char was set to a non-empty string. */ if (!equalpos(curwin->w_cursor, save_cursor) # ifdef FEAT_EVAL && *get_vim_var_str(VV_CHAR) == NUL # endif && save_cursor.lnum <= curbuf->b_ml.ml_line_count) { int save_state = State; curwin->w_cursor = save_cursor; State = INSERT; check_cursor_col(); State = save_state; } } #endif #ifdef FEAT_CONCEAL /* Check if the cursor line needs redrawing before changing State. If * 'concealcursor' is "n" it needs to be redrawn without concealing. */ conceal_check_cursur_line(); #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 = (colnr_T)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" command */ count = 1; /* insert only one */ } } 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 . */ 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 #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 (((ins_at_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)(ptr); if (ptr[i] == NUL) curwin->w_cursor.col += i; } #endif } ins_at_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 && msg_silent == 0) i = showmode(); if (!p_im && did_restart_edit == 0) change_warning(i == 0 ? 0 : 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 (update_Insstart_orig) Insstart_orig = Insstart; 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 < 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(TRUE); #ifdef FEAT_SCROLLBIND if (curwin->w_p_scb) do_check_scrollbind(TRUE); #endif #ifdef FEAT_CURSORBIND if (curwin->w_p_crb) do_check_cursorbind(); #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. Ignore K_IGNORE. */ if (c != K_CURSORHOLD) lastc = c; /* remember the previous char for CTRL-D */ /* After using CTRL-G U the next cursor key will not break undo. */ if (dont_sync_undo == MAYBE) dont_sync_undo = TRUE; else dont_sync_undo = FALSE; do { c = safe_vgetc(); } while (c == K_IGNORE); #ifdef FEAT_AUTOCMD /* Don't want K_CURSORHOLD for the second key, e.g., after CTRL-V. */ did_cursorhold = TRUE; #endif #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 /* * Special handling of keys while the popup menu is visible or wanted * and the cursor is still in the completed word. Only when there is * a match, skip this when no matches were found. */ if (compl_started && pum_wanted() && curwin->w_cursor.col >= compl_col && (compl_shown_match == NULL || compl_shown_match != compl_shown_match->cp_next)) { /* BS: Delete one character from "compl_leader". */ if ((c == K_BS || c == Ctrl_H) && curwin->w_cursor.col > compl_col && (c = ins_compl_bs()) == NUL) continue; /* When no match was selected or it was edited. */ if (!compl_used_match) { /* CTRL-L: Add one character from the current match to * "compl_leader". Except when at the original match and * there is nothing to add, CTRL-L works like CTRL-P then. */ if (c == Ctrl_L && (!CTRL_X_MODE_LINE_OR_EVAL(ctrl_x_mode) || (int)STRLEN(compl_shown_match->cp_str) > curwin->w_cursor.col - compl_col)) { ins_compl_addfrommatch(); continue; } /* A non-white character that fits in with the current * completion: Add to "compl_leader". */ if (ins_compl_accept_char(c)) { #ifdef FEAT_AUTOCMD /* Trigger InsertCharPre. */ char_u *str = do_insert_char_pre(c); char_u *p; if (str != NULL) { for (p = str; *p != NUL; mb_ptr_adv(p)) ins_compl_addleader(PTR2CHAR(p)); vim_free(str); } else #endif ins_compl_addleader(c); continue; } /* Pressing CTRL-Y selects the current match. When * compl_enter_selects is set the Enter key does the same. */ if (c == Ctrl_Y || (compl_enter_selects && (c == CAR || c == K_KENTER || c == NL))) { ins_compl_delete(); ins_compl_insert(); } } } /* Prepare for or stop CTRL-X mode. This doesn't do completion, but * it does fix up the text when finishing completion. */ compl_get_longest = FALSE; if (ins_compl_prep(c)) continue; #endif /* CTRL-\ CTRL-N goes to Normal mode, * CTRL-\ CTRL-G goes to mode selected with 'insertmode', * CTRL-\ CTRL-O is like CTRL-O but without moving the cursor. */ if (c == Ctrl_BSL) { /* may need to redraw when no more chars available now */ ins_redraw(FALSE); ++no_mapping; ++allow_keys; c = plain_vgetc(); --no_mapping; --allow_keys; if (c != Ctrl_N && c != Ctrl_G && c != Ctrl_O) { /* it's something else */ vungetc(c); c = Ctrl_BSL; } else if (c == Ctrl_G && p_im) continue; else { if (c == Ctrl_O) { ins_ctrl_o(); ins_at_eol = FALSE; /* cursor keeps its column */ nomove = TRUE; } 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 /* * 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; /* * The big switch to handle a character in insert mode. */ switch (c) { case ESC: /* End input mode */ if (echeck_abbr(ESC + ABBR_OFF)) break; /*FALLTHROUGH*/ case Ctrl_C: /* End input mode */ #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. */ nomove = TRUE; 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(BO_IM); 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 (ins_at_eol && gchar_cursor() == NUL) o_lnum = curwin->w_cursor.lnum; if (ins_esc(&count, cmdchar, nomove)) { #ifdef FEAT_AUTOCMD if (cmdchar != 'r' && cmdchar != 'v') apply_autocmds(EVENT_INSERTLEAVE, NULL, NULL, FALSE, curbuf); did_cursorhold = FALSE; #endif return (c == Ctrl_O); } continue; case Ctrl_Z: /* suspend when 'insertmode' set */ if (!p_im) goto normalchar; /* insert CTRL-Z as normal char */ stuffReadbuff((char_u *)":st\r"); c = Ctrl_O; /*FALLTHROUGH*/ case Ctrl_O: /* execute one command */ #ifdef FEAT_COMPL_FUNC if (ctrl_x_mode == CTRL_X_OMNI) goto docomplete; #endif if (echeck_abbr(Ctrl_O + ABBR_OFF)) break; ins_ctrl_o(); #ifdef FEAT_VIRTUALEDIT /* don't move the cursor left when 'virtualedit' has "onemore". */ if (ve_flags & VE_ONEMORE) { ins_at_eol = FALSE; nomove = TRUE; } #endif count = 0; goto doESCkey; case K_INS: /* toggle insert/replace mode */ case K_KINS: ins_insert(replaceState); break; case K_SELECT: /* end of Select mode mapping - ignore */ break; case K_HELP: /* Help key works like */ 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: /* NetBeans command */ ++no_mapping; /* don't map the next key hits */ i = plain_vgetc(); --no_mapping; netbeans_keycommand(i); break; #endif case K_ZERO: /* Insert the previously inserted text. */ case NUL: case Ctrl_A: /* For ^@ the trailing ESC will end the insert, unless there is an * error. */ if (stuff_inserted(NUL, 1L, (c == Ctrl_A)) == FAIL && c != Ctrl_A && !p_im) goto doESCkey; /* quit insert mode */ inserted_space = FALSE; break; case Ctrl_R: /* insert the contents of a register */ ins_reg(); auto_format(FALSE, TRUE); inserted_space = FALSE; break; case Ctrl_G: /* commands starting with CTRL-G */ ins_ctrl_g(); break; case Ctrl_HAT: /* switch input mode and/or langmap */ ins_ctrl_hat(); break; #ifdef FEAT_RIGHTLEFT case Ctrl__: /* switch between languages */ if (!p_ari) goto normalchar; ins_ctrl_(); break; #endif case Ctrl_D: /* Make indent one shiftwidth smaller. */ #if defined(FEAT_INS_EXPAND) && defined(FEAT_FIND_ID) if (ctrl_x_mode == CTRL_X_PATH_DEFINES) goto docomplete; #endif /* FALLTHROUGH */ case Ctrl_T: /* Make indent one shiftwidth greater. */ # ifdef FEAT_INS_EXPAND if (c == Ctrl_T && ctrl_x_mode == CTRL_X_THESAURUS) { if (has_compl_option(FALSE)) goto docomplete; break; } # endif ins_shift(c, lastc); auto_format(FALSE, TRUE); inserted_space = FALSE; break; case K_DEL: /* delete character under the cursor */ case K_KDEL: ins_del(); auto_format(FALSE, TRUE); break; case K_BS: /* delete character before the cursor */ case Ctrl_H: did_backspace = ins_bs(c, BACKSPACE_CHAR, &inserted_space); auto_format(FALSE, TRUE); break; case Ctrl_W: /* delete word before the cursor */ did_backspace = ins_bs(c, BACKSPACE_WORD, &inserted_space); auto_format(FALSE, TRUE); break; case Ctrl_U: /* delete all inserted text in current line */ # ifdef FEAT_COMPL_FUNC /* CTRL-X CTRL-U completes with 'completefunc'. */ if (ctrl_x_mode == CTRL_X_FUNCTION) goto docomplete; # endif did_backspace = ins_bs(c, BACKSPACE_LINE, &inserted_space); auto_format(FALSE, TRUE); inserted_space = FALSE; break; #ifdef FEAT_MOUSE case K_LEFTMOUSE: /* mouse keys */ 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; case K_MOUSEDOWN: /* Default action for scroll wheel up: scroll up */ ins_mousescroll(MSCR_DOWN); break; case K_MOUSEUP: /* Default action for scroll wheel down: scroll down */ ins_mousescroll(MSCR_UP); break; case K_MOUSELEFT: /* Scroll wheel left */ ins_mousescroll(MSCR_LEFT); break; case K_MOUSERIGHT: /* Scroll wheel right */ ins_mousescroll(MSCR_RIGHT); break; #endif #ifdef FEAT_GUI_TABLINE case K_TABLINE: case K_TABMENU: ins_tabline(c); break; #endif case K_IGNORE: /* Something mapped to nothing */ break; #ifdef FEAT_AUTOCMD case K_CURSORHOLD: /* Didn't type something for a while. */ apply_autocmds(EVENT_CURSORHOLDI, NULL, NULL, FALSE, curbuf); did_cursorhold = TRUE; break; #endif #ifdef FEAT_GUI_W32 /* On Win32 ignore , we get it when closing the window was * cancelled. */ case K_F4: if (mod_mask != MOD_MASK_ALT) goto normalchar; break; #endif #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_S_HOME: case K_C_HOME: ins_home(c); break; case K_END: /* */ case K_KEND: case K_S_END: case K_C_END: ins_end(c); break; case K_LEFT: /* */ if (mod_mask & (MOD_MASK_SHIFT|MOD_MASK_CTRL)) ins_s_left(); else ins_left(dont_sync_undo == FALSE); break; case K_S_LEFT: /* */ case K_C_LEFT: ins_s_left(); break; case K_RIGHT: /* */ if (mod_mask & (MOD_MASK_SHIFT|MOD_MASK_CTRL)) ins_s_right(); else ins_right(dont_sync_undo == FALSE); break; case K_S_RIGHT: /* */ case K_C_RIGHT: ins_s_right(); break; case K_UP: /* */ #ifdef FEAT_INS_EXPAND if (pum_visible()) goto docomplete; #endif if (mod_mask & MOD_MASK_SHIFT) ins_pageup(); else ins_up(FALSE); break; case K_S_UP: /* */ case K_PAGEUP: case K_KPAGEUP: #ifdef FEAT_INS_EXPAND if (pum_visible()) goto docomplete; #endif ins_pageup(); break; case K_DOWN: /* */ #ifdef FEAT_INS_EXPAND if (pum_visible()) goto docomplete; #endif if (mod_mask & MOD_MASK_SHIFT) ins_pagedown(); else ins_down(FALSE); break; case K_S_DOWN: /* */ case K_PAGEDOWN: case K_KPAGEDOWN: #ifdef FEAT_INS_EXPAND if (pum_visible()) goto docomplete; #endif ins_pagedown(); break; #ifdef FEAT_DND case K_DROP: /* drag-n-drop event */ ins_drop(); break; #endif case K_S_TAB: /* When not mapped, use like a normal TAB */ c = TAB; /* FALLTHROUGH */ case TAB: /* TAB or Complete patterns along path */ #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 jumps to the error under the * cursor. */ if (bt_quickfix(curbuf) && c == CAR) { if (curwin->w_llist_ref == NULL) /* quickfix window */ do_cmdline_cmd((char_u *)".cc"); else /* location list window */ do_cmdline_cmd((char_u *)".ll"); 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: /* digraph or keyword completion */ # ifdef FEAT_INS_EXPAND if (ctrl_x_mode == CTRL_X_DICTIONARY) { if (has_compl_option(TRUE)) goto docomplete; break; } # endif # ifdef FEAT_DIGRAPHS c = ins_digraph(); if (c == NUL) break; # endif goto normalchar; #endif #ifdef FEAT_INS_EXPAND case Ctrl_X: /* Enter CTRL-X mode */ ins_ctrl_x(); break; 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; case 's': /* Spelling completion after ^X */ case Ctrl_S: if (ctrl_x_mode != CTRL_X_SPELL) 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 */ case Ctrl_P: /* Do previous/next pattern completion */ 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 && !(compl_cont_status & CONT_LOCAL)) goto normalchar; docomplete: compl_busy = TRUE; if (ins_complete(c, TRUE) == FAIL) compl_cont_status = 0; compl_busy = FALSE; 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 */ c = ins_ctrl_ey(c); break; default: #ifdef UNIX if (c == intr_char) /* special interrupt char */ goto do_intr; #endif normalchar: /* * Insert a normal character. */ #ifdef FEAT_AUTOCMD if (!p_paste) { /* Trigger InsertCharPre. */ char_u *str = do_insert_char_pre(c); char_u *p; if (str != NULL) { if (*str != NUL && stop_arrow() != FAIL) { /* Insert the new value of v:char literally. */ for (p = str; *p != NUL; mb_ptr_adv(p)) { c = PTR2CHAR(p); if (c == CAR || c == K_KENTER || c == NL) ins_eol(c); else ins_char(c); } AppendToRedobuffLit(str, -1); } vim_free(str); c = NUL; } /* If the new value is already inserted or an empty string * then don't insert any character. */ if (c == NUL) break; } #endif #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(); } /* Insert a normal character and check for abbreviations on a * special character. Let CTRL-] expand abbreviations without * inserting it. */ 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) && c != Ctrl_RSB)) { 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) */ #ifdef FEAT_AUTOCMD /* If typed something may trigger CursorHoldI again. */ if (c != K_CURSORHOLD) did_cursorhold = FALSE; #endif /* 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( int ready UNUSED) /* not busy with something */ { #ifdef FEAT_CONCEAL linenr_T conceal_old_cursor_line = 0; linenr_T conceal_new_cursor_line = 0; int conceal_update_lines = FALSE; #endif if (char_avail()) return; #if defined(FEAT_AUTOCMD) || defined(FEAT_CONCEAL) /* Trigger CursorMoved if the cursor moved. Not when the popup menu is * visible, the command might delete it. */ if (ready && ( # ifdef FEAT_AUTOCMD has_cursormovedI() # endif # if defined(FEAT_AUTOCMD) && defined(FEAT_CONCEAL) || # endif # ifdef FEAT_CONCEAL curwin->w_p_cole > 0 # endif ) # ifdef FEAT_AUTOCMD && !equalpos(last_cursormoved, curwin->w_cursor) # endif # ifdef FEAT_INS_EXPAND && !pum_visible() # endif ) { # ifdef FEAT_SYN_HL /* Need to update the screen first, to make sure syntax * highlighting is correct after making a change (e.g., inserting * a "(". The autocommand may also require a redraw, so it's done * again below, unfortunately. */ if (syntax_present(curwin) && must_redraw) update_screen(0); # endif # ifdef FEAT_AUTOCMD if (has_cursormovedI()) { /* Make sure curswant is correct, an autocommand may call * getcurpos(). */ update_curswant(); apply_autocmds(EVENT_CURSORMOVEDI, NULL, NULL, FALSE, curbuf); } # endif # ifdef FEAT_CONCEAL if (curwin->w_p_cole > 0) { # ifdef FEAT_AUTOCMD conceal_old_cursor_line = last_cursormoved.lnum; # endif conceal_new_cursor_line = curwin->w_cursor.lnum; conceal_update_lines = TRUE; } # endif # ifdef FEAT_AUTOCMD last_cursormoved = curwin->w_cursor; # endif } #endif #ifdef FEAT_AUTOCMD /* Trigger TextChangedI if b_changedtick differs. */ if (ready && has_textchangedI() && last_changedtick != curbuf->b_changedtick # ifdef FEAT_INS_EXPAND && !pum_visible() # endif ) { if (last_changedtick_buf == curbuf) apply_autocmds(EVENT_TEXTCHANGEDI, NULL, NULL, FALSE, curbuf); last_changedtick_buf = curbuf; last_changedtick = curbuf->b_changedtick; } #endif if (must_redraw) update_screen(0); else if (clear_cmdline || redraw_cmdline) showmode(); /* clear cmdline and show mode */ # if defined(FEAT_CONCEAL) if ((conceal_update_lines && (conceal_old_cursor_line != conceal_new_cursor_line || conceal_cursor_line(curwin))) || need_cursor_line_redraw) { if (conceal_old_cursor_line != conceal_new_cursor_line) update_single_line(curwin, conceal_old_cursor_line); update_single_line(curwin, conceal_new_cursor_line == 0 ? curwin->w_cursor.lnum : conceal_new_cursor_line); curwin->w_valid &= ~VALID_CROW; } # endif 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(void) { int c; int did_putchar = FALSE; /* may need to redraw when no more chars available now */ ins_redraw(FALSE); if (redrawing() && !char_avail()) { edit_putchar('^', TRUE); did_putchar = TRUE; } AppendToRedobuff((char_u *)CTRL_V_STR); /* CTRL-V */ #ifdef FEAT_CMDL_INFO add_to_showcmd_c(Ctrl_V); #endif c = get_literal(); if (did_putchar) /* when the line fits in 'columns' the '^' is at the start of the next * line and will not removed by the redraw */ edit_unputchar(); #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 */ static char_u pc_bytes[MB_MAXBYTES + 1]; /* saved bytes */ static int pc_attr; static int pc_row; static int pc_col; void edit_putchar(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(void) { 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(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(void) { if (dollar_vcol >= 0) { dollar_vcol = -1; redrawWinline(curwin->w_cursor.lnum, FALSE); } } /* * Insert an indent (for 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 ) * 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( int type, int amount, int round, int replaced, /* replaced character, put on replace stack */ int call_changed_bytes) /* call changed_bytes() */ { 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, call_changed_bytes ? SIN_CHANGED : 0); 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, call_changed_bytes); #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 = (colnr_T)((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)(ptr + new_cursor_col); else #endif ++new_cursor_col; vcol += lbr_chartabsize(ptr, 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 = (colnr_T)new_cursor_col; i = (int)curwin->w_virtcol - vcol; ptr = alloc((unsigned)(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 = (colnr_T)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(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. * Will attempt not to go before "col" even when there is a composing * character. */ void backspace_until_column(int col) { while ((int)curwin->w_cursor.col > col) { curwin->w_cursor.col--; if (State & REPLACE_FLAG) replace_do_bs(col); else if (!del_char_after_col(col)) break; } } #endif /* * Like del_char(), but make sure not to go before column "limit_col". * Only matters when there are composing characters. * Return TRUE when something was deleted. */ static int del_char_after_col(int limit_col UNUSED) { #ifdef FEAT_MBYTE if (enc_utf8 && limit_col >= 0) { colnr_T ecol = curwin->w_cursor.col + 1; /* Make sure the cursor is at the start of a character, but * skip forward again when going too far back because of a * composing character. */ mb_adjust_cursor(); while (curwin->w_cursor.col < (colnr_T)limit_col) { int l = utf_ptr2len(ml_get_cursor()); if (l == 0) /* end of line */ break; curwin->w_cursor.col += l; } if (*ml_get_cursor() == NUL || curwin->w_cursor.col == ecol) return FALSE; del_bytes((long)((int)ecol - curwin->w_cursor.col), FALSE, TRUE); } else #endif (void)del_char(FALSE); return TRUE; } #if defined(FEAT_INS_EXPAND) || defined(PROTO) /* * CTRL-X pressed in Insert mode. */ static void ins_ctrl_x(void) { /* CTRL-X after CTRL-X CTRL-V 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 * compl_cont_status */ if (compl_cont_status & CONT_N_ADDS) compl_cont_status |= CONT_INTRPT; else compl_cont_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(); } } /* * Return TRUE if the 'dict' or 'tsr' option can be used. */ static int has_compl_option(int dict_opt) { if (dict_opt ? (*curbuf->b_p_dict == NUL && *p_dict == NUL # ifdef FEAT_SPELL && !curwin->w_p_spell # endif ) : (*curbuf->b_p_tsr == NUL && *p_tsr == NUL)) { ctrl_x_mode = 0; edit_submode = NULL; msg_attr(dict_opt ? (char_u *)_("'dictionary' option is empty") : (char_u *)_("'thesaurus' option is empty"), hl_attr(HLF_E)); if (emsg_silent == 0) { vim_beep(BO_COMPL); setcursor(); out_flush(); ui_delay(2000L, FALSE); } return FALSE; } return TRUE; } /* * 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(int c) { /* Always allow ^R - let it's results then be checked */ if (c == Ctrl_R) return TRUE; /* Accept and if the popup menu is visible. */ if (ins_compl_pum_key(c)) 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 || c == Ctrl_U || c == Ctrl_O || c == Ctrl_S || c == Ctrl_K || c == 's'); 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); #ifdef FEAT_COMPL_FUNC case CTRL_X_FUNCTION: return (c == Ctrl_U || c == Ctrl_P || c == Ctrl_N); case CTRL_X_OMNI: return (c == Ctrl_O || c == Ctrl_P || c == Ctrl_N); #endif case CTRL_X_SPELL: return (c == Ctrl_S || c == Ctrl_P || c == Ctrl_N); case CTRL_X_EVAL: return (c == Ctrl_P || c == Ctrl_N); } EMSG(_(e_internal)); return FALSE; } /* * Return TRUE when character "c" is part of the item currently being * completed. Used to decide whether to abandon complete mode when the menu * is visible. */ static int ins_compl_accept_char(int c) { if (ctrl_x_mode & CTRL_X_WANT_IDENT) /* When expanding an identifier only accept identifier chars. */ return vim_isIDc(c); switch (ctrl_x_mode) { case CTRL_X_FILES: /* When expanding file name only accept file name chars. But not * path separators, so that "proto/" expands files in * "proto", not "proto/" as a whole */ return vim_isfilec(c) && !vim_ispathsep(c); case CTRL_X_CMDLINE: case CTRL_X_OMNI: /* Command line and Omni completion can work with just about any * printable character, but do stop at white space. */ return vim_isprintc(c) && !vim_iswhite(c); case CTRL_X_WHOLE_LINE: /* For while line completion a space can be part of the line. */ return vim_isprintc(c); } return vim_iswordc(c); } /* * 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 inferred, 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( char_u *str, int len, int icase, char_u *fname, int dir, int flags) { char_u *p; int i, c; int actual_len; /* Take multi-byte characters */ int actual_compl_length; /* into account. */ int min_len; int *wca; /* Wide character array. */ int has_lower = FALSE; int was_letter = FALSE; if (p_ic && curbuf->b_p_inf && len > 0) { /* Infer case of completed part. */ /* Find actual length of completion. */ #ifdef FEAT_MBYTE if (has_mbyte) { p = str; actual_len = 0; while (*p != NUL) { mb_ptr_adv(p); ++actual_len; } } else #endif actual_len = len; /* Find actual length of original text. */ #ifdef FEAT_MBYTE if (has_mbyte) { p = compl_orig_text; actual_compl_length = 0; while (*p != NUL) { mb_ptr_adv(p); ++actual_compl_length; } } else #endif actual_compl_length = compl_length; /* "actual_len" may be smaller than "actual_compl_length" when using * thesaurus, only use the minimum when comparing. */ min_len = actual_len < actual_compl_length ? actual_len : actual_compl_length; /* Allocate wide character array for the completion and fill it. */ wca = (int *)alloc((unsigned)(actual_len * sizeof(int))); if (wca != NULL) { p = str; for (i = 0; i < actual_len; ++i) #ifdef FEAT_MBYTE if (has_mbyte) wca[i] = mb_ptr2char_adv(&p); else #endif wca[i] = *(p++); /* Rule 1: Were any chars converted to lower? */ p = compl_orig_text; for (i = 0; i < min_len; ++i) { #ifdef FEAT_MBYTE if (has_mbyte) c = mb_ptr2char_adv(&p); else #endif c = *(p++); if (MB_ISLOWER(c)) { has_lower = TRUE; if (MB_ISUPPER(wca[i])) { /* Rule 1 is satisfied. */ for (i = actual_compl_length; i < actual_len; ++i) wca[i] = MB_TOLOWER(wca[i]); break; } } } /* * Rule 2: No lower case, 2nd consecutive letter converted to * upper case. */ if (!has_lower) { p = compl_orig_text; for (i = 0; i < min_len; ++i) { #ifdef FEAT_MBYTE if (has_mbyte) c = mb_ptr2char_adv(&p); else #endif c = *(p++); if (was_letter && MB_ISUPPER(c) && MB_ISLOWER(wca[i])) { /* Rule 2 is satisfied. */ for (i = actual_compl_length; i < actual_len; ++i) wca[i] = MB_TOUPPER(wca[i]); break; } was_letter = MB_ISLOWER(c) || MB_ISUPPER(c); } } /* Copy the original case of the part we typed. */ p = compl_orig_text; for (i = 0; i < min_len; ++i) { #ifdef FEAT_MBYTE if (has_mbyte) c = mb_ptr2char_adv(&p); else #endif c = *(p++); if (MB_ISLOWER(c)) wca[i] = MB_TOLOWER(wca[i]); else if (MB_ISUPPER(c)) wca[i] = MB_TOUPPER(wca[i]); } /* * Generate encoding specific output from wide character array. * Multi-byte characters can occupy up to five bytes more than * ASCII characters, and we also need one byte for NUL, so stay * six bytes away from the edge of IObuff. */ p = IObuff; i = 0; while (i < actual_len && (p - IObuff + 6) < IOSIZE) #ifdef FEAT_MBYTE if (has_mbyte) p += (*mb_char2bytes)(wca[i++], p); else #endif *(p++) = wca[i++]; *p = NUL; vim_free(wca); } return ins_compl_add(IObuff, len, icase, fname, NULL, dir, flags, FALSE); } return ins_compl_add(str, len, icase, fname, NULL, dir, flags, FALSE); } /* * Add a match to the list of matches. * If the given string is already in the list of completions, then return * NOTDONE, otherwise add it to the list and return OK. If there is an error, * maybe because alloc() returns NULL, then FAIL is returned. */ static int ins_compl_add( char_u *str, int len, int icase, char_u *fname, char_u **cptext, /* extra text for popup menu or NULL */ int cdir, int flags, int adup) /* accept duplicate match */ { compl_T *match; int dir = (cdir == 0 ? compl_direction : cdir); ui_breakcheck(); if (got_int) return FAIL; if (len < 0) len = (int)STRLEN(str); /* * If the same match is already present, don't add it. */ if (compl_first_match != NULL && !adup) { match = compl_first_match; do { if ( !(match->cp_flags & ORIGINAL_TEXT) && STRNCMP(match->cp_str, str, len) == 0 && match->cp_str[len] == NUL) return NOTDONE; match = match->cp_next; } while (match != NULL && match != compl_first_match); } /* Remove any popup menu before changing the list of matches. */ ins_compl_del_pum(); /* * Allocate a new match structure. * Copy the values to the new match structure. */ match = (compl_T *)alloc_clear((unsigned)sizeof(compl_T)); if (match == NULL) return FAIL; match->cp_number = -1; if (flags & ORIGINAL_TEXT) match->cp_number = 0; if ((match->cp_str = vim_strnsave(str, len)) == NULL) { vim_free(match); return FAIL; } match->cp_icase = icase; /* match-fname is: * - compl_curr_match->cp_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 != NULL && compl_curr_match != NULL && compl_curr_match->cp_fname != NULL && STRCMP(fname, compl_curr_match->cp_fname) == 0) match->cp_fname = compl_curr_match->cp_fname; else if (fname != NULL) { match->cp_fname = vim_strsave(fname); flags |= FREE_FNAME; } else match->cp_fname = NULL; match->cp_flags = flags; if (cptext != NULL) { int i; for (i = 0; i < CPT_COUNT; ++i) if (cptext[i] != NULL && *cptext[i] != NUL) match->cp_text[i] = vim_strsave(cptext[i]); } /* * Link the new match structure in the list of matches. */ if (compl_first_match == NULL) match->cp_next = match->cp_prev = NULL; else if (dir == FORWARD) { match->cp_next = compl_curr_match->cp_next; match->cp_prev = compl_curr_match; } else /* BACKWARD */ { match->cp_next = compl_curr_match; match->cp_prev = compl_curr_match->cp_prev; } if (match->cp_next) match->cp_next->cp_prev = match; if (match->cp_prev) match->cp_prev->cp_next = match; else /* if there's nothing before, it is the first match */ compl_first_match = match; compl_curr_match = match; /* * Find the longest common string if still doing that. */ if (compl_get_longest && (flags & ORIGINAL_TEXT) == 0) ins_compl_longest_match(match); return OK; } /* * Return TRUE if "str[len]" matches with match->cp_str, considering * match->cp_icase. */ static int ins_compl_equal(compl_T *match, char_u *str, int len) { if (match->cp_icase) return STRNICMP(match->cp_str, str, (size_t)len) == 0; return STRNCMP(match->cp_str, str, (size_t)len) == 0; } /* * Reduce the longest common string for match "match". */ static void ins_compl_longest_match(compl_T *match) { char_u *p, *s; int c1, c2; int had_match; if (compl_leader == NULL) { /* First match, use it as a whole. */ compl_leader = vim_strsave(match->cp_str); if (compl_leader != NULL) { had_match = (curwin->w_cursor.col > compl_col); ins_compl_delete(); ins_bytes(compl_leader + ins_compl_len()); ins_redraw(FALSE); /* When the match isn't there (to avoid matching itself) remove it * again after redrawing. */ if (!had_match) ins_compl_delete(); compl_used_match = FALSE; } } else { /* Reduce the text if this match differs from compl_leader. */ p = compl_leader; s = match->cp_str; while (*p != NUL) { #ifdef FEAT_MBYTE if (has_mbyte) { c1 = mb_ptr2char(p); c2 = mb_ptr2char(s); } else #endif { c1 = *p; c2 = *s; } if (match->cp_icase ? (MB_TOLOWER(c1) != MB_TOLOWER(c2)) : (c1 != c2)) break; #ifdef FEAT_MBYTE if (has_mbyte) { mb_ptr_adv(p); mb_ptr_adv(s); } else #endif { ++p; ++s; } } if (*p != NUL) { /* Leader was shortened, need to change the inserted text. */ *p = NUL; had_match = (curwin->w_cursor.col > compl_col); ins_compl_delete(); ins_bytes(compl_leader + ins_compl_len()); ins_redraw(FALSE); /* When the match isn't there (to avoid matching itself) remove it * again after redrawing. */ if (!had_match) ins_compl_delete(); } compl_used_match = FALSE; } } /* * Add an array of matches to the list of matches. * Frees matches[]. */ static void ins_compl_add_matches( int num_matches, char_u **matches, int icase) { int i; int add_r = OK; int dir = compl_direction; for (i = 0; i < num_matches && add_r != FAIL; i++) if ((add_r = ins_compl_add(matches[i], -1, icase, NULL, NULL, dir, 0, FALSE)) == OK) /* if dir was BACKWARD then honor it just once */ dir = FORWARD; FreeWild(num_matches, matches); } /* Make the completion list cyclic. * Return the number of matches (excluding the original). */ static int ins_compl_make_cyclic(void) { compl_T *match; int count = 0; if (compl_first_match != NULL) { /* * Find the end of the list. */ match = compl_first_match; /* there's always an entry for the compl_orig_text, it doesn't count. */ while (match->cp_next != NULL && match->cp_next != compl_first_match) { match = match->cp_next; ++count; } match->cp_next = compl_first_match; compl_first_match->cp_prev = match; } return count; } /* * Start completion for the complete() function. * "startcol" is where the matched text starts (1 is first column). * "list" is the list of matches. */ void set_completion(colnr_T startcol, list_T *list) { int save_w_wrow = curwin->w_wrow; /* If already doing completions stop it. */ if (ctrl_x_mode != 0) ins_compl_prep(' '); ins_compl_clear(); if (stop_arrow() == FAIL) return; compl_direction = FORWARD; if (startcol > curwin->w_cursor.col) startcol = curwin->w_cursor.col; compl_col = startcol; compl_length = (int)curwin->w_cursor.col - (int)startcol; /* compl_pattern doesn't need to be set */ compl_orig_text = vim_strnsave(ml_get_curline() + compl_col, compl_length); if (compl_orig_text == NULL || ins_compl_add(compl_orig_text, -1, p_ic, NULL, NULL, 0, ORIGINAL_TEXT, FALSE) != OK) return; ctrl_x_mode = CTRL_X_EVAL; ins_compl_add_list(list); compl_matches = ins_compl_make_cyclic(); compl_started = TRUE; compl_used_match = TRUE; compl_cont_status = 0; compl_curr_match = compl_first_match; if (compl_no_insert) ins_complete(K_DOWN, FALSE); else ins_complete(Ctrl_N, FALSE); if (compl_no_select) ins_complete(Ctrl_P, FALSE); /* Lazily show the popup menu, unless we got interrupted. */ if (!compl_interrupted) show_pum(save_w_wrow); out_flush(); } /* "compl_match_array" points the currently displayed list of entries in the * popup menu. It is NULL when there is no popup menu. */ static pumitem_T *compl_match_array = NULL; static int compl_match_arraysize; /* * Update the screen and when there is any scrolling remove the popup menu. */ static void ins_compl_upd_pum(void) { int h; if (compl_match_array != NULL) { h = curwin->w_cline_height; update_screen(0); if (h != curwin->w_cline_height) ins_compl_del_pum(); } } /* * Remove any popup menu. */ static void ins_compl_del_pum(void) { if (compl_match_array != NULL) { pum_undisplay(); vim_free(compl_match_array); compl_match_array = NULL; } } /* * Return TRUE if the popup menu should be displayed. */ static int pum_wanted(void) { /* 'completeopt' must contain "menu" or "menuone" */ if (vim_strchr(p_cot, 'm') == NULL) return FALSE; /* The display looks bad on a B&W display. */ if (t_colors < 8 #ifdef FEAT_GUI && !gui.in_use #endif ) return FALSE; return TRUE; } /* * Return TRUE if there are two or more matches to be shown in the popup menu. * One if 'completopt' contains "menuone". */ static int pum_enough_matches(void) { compl_T *compl; int i; /* Don't display the popup menu if there are no matches or there is only * one (ignoring the original text). */ compl = compl_first_match; i = 0; do { if (compl == NULL || ((compl->cp_flags & ORIGINAL_TEXT) == 0 && ++i == 2)) break; compl = compl->cp_next; } while (compl != compl_first_match); if (strstr((char *)p_cot, "menuone") != NULL) return (i >= 1); return (i >= 2); } /* * Show the popup menu for the list of matches. * Also adjusts "compl_shown_match" to an entry that is actually displayed. */ void ins_compl_show_pum(void) { compl_T *compl; compl_T *shown_compl = NULL; int did_find_shown_match = FALSE; int shown_match_ok = FALSE; int i; int cur = -1; colnr_T col; int lead_len = 0; if (!pum_wanted() || !pum_enough_matches()) return; #if defined(FEAT_EVAL) /* Dirty hard-coded hack: remove any matchparen highlighting. */ do_cmdline_cmd((char_u *)"if exists('g:loaded_matchparen')|3match none|endif"); #endif /* Update the screen before drawing the popup menu over it. */ update_screen(0); if (compl_match_array == NULL) { /* Need to build the popup menu list. */ compl_match_arraysize = 0; compl = compl_first_match; if (compl_leader != NULL) lead_len = (int)STRLEN(compl_leader); do { if ((compl->cp_flags & ORIGINAL_TEXT) == 0 && (compl_leader == NULL || ins_compl_equal(compl, compl_leader, lead_len))) ++compl_match_arraysize; compl = compl->cp_next; } while (compl != NULL && compl != compl_first_match); if (compl_match_arraysize == 0) return; compl_match_array = (pumitem_T *)alloc_clear( (unsigned)(sizeof(pumitem_T) * compl_match_arraysize)); if (compl_match_array != NULL) { /* If the current match is the original text don't find the first * match after it, don't highlight anything. */ if (compl_shown_match->cp_flags & ORIGINAL_TEXT) shown_match_ok = TRUE; i = 0; compl = compl_first_match; do { if ((compl->cp_flags & ORIGINAL_TEXT) == 0 && (compl_leader == NULL || ins_compl_equal(compl, compl_leader, lead_len))) { if (!shown_match_ok) { if (compl == compl_shown_match || did_find_shown_match) { /* This item is the shown match or this is the * first displayed item after the shown match. */ compl_shown_match = compl; did_find_shown_match = TRUE; shown_match_ok = TRUE; } else /* Remember this displayed match for when the * shown match is just below it. */ shown_compl = compl; cur = i; } if (compl->cp_text[CPT_ABBR] != NULL) compl_match_array[i].pum_text = compl->cp_text[CPT_ABBR]; else compl_match_array[i].pum_text = compl->cp_str; compl_match_array[i].pum_kind = compl->cp_text[CPT_KIND]; compl_match_array[i].pum_info = compl->cp_text[CPT_INFO]; if (compl->cp_text[CPT_MENU] != NULL) compl_match_array[i++].pum_extra = compl->cp_text[CPT_MENU]; else compl_match_array[i++].pum_extra = compl->cp_fname; } if (compl == compl_shown_match) { did_find_shown_match = TRUE; /* When the original text is the shown match don't set * compl_shown_match. */ if (compl->cp_flags & ORIGINAL_TEXT) shown_match_ok = TRUE; if (!shown_match_ok && shown_compl != NULL) { /* The shown match isn't displayed, set it to the * previously displayed match. */ compl_shown_match = shown_compl; shown_match_ok = TRUE; } } compl = compl->cp_next; } while (compl != NULL && compl != compl_first_match); if (!shown_match_ok) /* no displayed match at all */ cur = -1; } } else { /* popup menu already exists, only need to find the current item.*/ for (i = 0; i < compl_match_arraysize; ++i) if (compl_match_array[i].pum_text == compl_shown_match->cp_str || compl_match_array[i].pum_text == compl_shown_match->cp_text[CPT_ABBR]) { cur = i; break; } } if (compl_match_array != NULL) { /* In Replace mode when a $ is displayed at the end of the line only * part of the screen would be updated. We do need to redraw here. */ dollar_vcol = -1; /* Compute the screen column of the start of the completed text. * Use the cursor to get all wrapping and other settings right. */ col = curwin->w_cursor.col; curwin->w_cursor.col = compl_col; pum_display(compl_match_array, compl_match_arraysize, cur); curwin->w_cursor.col = col; } } #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 in the list of dictionary * files "dict_start" to the list of completions. */ static void ins_compl_dictionaries( char_u *dict_start, char_u *pat, int flags, /* DICT_FIRST and/or DICT_EXACT */ int thesaurus) /* Thesaurus completion */ { char_u *dict = dict_start; char_u *ptr; char_u *buf; regmatch_T regmatch; char_u **files; int count; int save_p_scs; int dir = compl_direction; if (*dict == NUL) { #ifdef FEAT_SPELL /* When 'dictionary' is empty and spell checking is enabled use * "spell". */ if (!thesaurus && curwin->w_p_spell) dict = (char_u *)"spell"; else #endif return; } buf = alloc(LSIZE); if (buf == NULL) return; regmatch.regprog = NULL; /* so that we can goto theend */ /* If 'infercase' is set, don't use 'smartcase' here */ save_p_scs = p_scs; if (curbuf->b_p_inf) p_scs = FALSE; /* When invoked to match whole lines for CTRL-X CTRL-L adjust the pattern * to only match at the start of a line. Otherwise just match the * pattern. Also need to double backslashes. */ if (CTRL_X_MODE_LINE_OR_EVAL(ctrl_x_mode)) { char_u *pat_esc = vim_strsave_escaped(pat, (char_u *)"\\"); size_t len; if (pat_esc == NULL) goto theend; len = STRLEN(pat_esc) + 10; ptr = alloc((unsigned)len); if (ptr == NULL) { vim_free(pat_esc); goto theend; } vim_snprintf((char *)ptr, len, "^\\s*\\zs\\V%s", pat_esc); regmatch.regprog = vim_regcomp(ptr, RE_MAGIC); vim_free(pat_esc); vim_free(ptr); } else { regmatch.regprog = vim_regcomp(pat, p_magic ? RE_MAGIC : 0); if (regmatch.regprog == NULL) goto theend; } /* ignore case depends on 'ignorecase', 'smartcase' and "pat" */ regmatch.rm_ic = ignorecase(pat); while (*dict != NUL && !got_int && !compl_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, ","); # ifdef FEAT_SPELL if (!thesaurus && STRCMP(buf, "spell") == 0) count = -1; else # endif if (vim_strchr(buf, '`') != NULL || expand_wildcards(1, &buf, &count, &files, EW_FILE|EW_SILENT) != OK) count = 0; } # ifdef FEAT_SPELL if (count == -1) { /* Complete from active spelling. Skip "\<" in the pattern, we * don't use it as a RE. */ if (pat[0] == '\\' && pat[1] == '<') ptr = pat + 2; else ptr = pat; spell_dump_compl(ptr, regmatch.rm_ic, &dir, 0); } else # endif if (count > 0) /* avoid warning for using "files" uninit */ { ins_compl_files(count, files, thesaurus, flags, ®match, buf, &dir); if (flags != DICT_EXACT) FreeWild(count, files); } if (flags != 0) break; } theend: p_scs = save_p_scs; vim_regfree(regmatch.regprog); vim_free(buf); } static void ins_compl_files( int count, char_u **files, int thesaurus, int flags, regmatch_T *regmatch, char_u *buf, int *dir) { char_u *ptr; int i; FILE *fp; int add_r; for (i = 0; i < count && !got_int && !compl_interrupted; i++) { fp = mch_fopen((char *)files[i], "r"); /* open dictionary file */ if (flags != DICT_EXACT) { vim_snprintf((char *)IObuff, IOSIZE, _("Scanning dictionary: %s"), (char *)files[i]); (void)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 && !compl_interrupted && !vim_fgets(buf, LSIZE, fp)) { ptr = buf; while (vim_regexec(regmatch, buf, (colnr_T)(ptr - buf))) { ptr = regmatch->startp[0]; if (CTRL_X_MODE_LINE_OR_EVAL(ctrl_x_mode)) ptr = find_line_end(ptr); else ptr = find_word_end(ptr); add_r = ins_compl_add_infercase(regmatch->startp[0], (int)(ptr - regmatch->startp[0]), p_ic, files[i], *dir, 0); if (thesaurus) { char_u *wstart; /* * Add the other matches on the line */ ptr = buf; 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. */ #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)(ptr); if (l < 2 && !vim_iswordc(*ptr)) break; ptr += l; } else #endif ptr = find_word_end(ptr); /* Add the word. Skip the regexp match. */ if (wstart != regmatch->startp[0]) add_r = ins_compl_add_infercase(wstart, (int)(ptr - wstart), p_ic, files[i], *dir, 0); } } if (add_r == OK) /* if dir was BACKWARD then honor it just once */ *dir = FORWARD; else if (add_r == FAIL) break; /* avoid expensive call to vim_regexec() when at end * of line */ if (*ptr == '\n' || got_int) break; } line_breakcheck(); ins_compl_check_keys(50); } fclose(fp); } } } /* * 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(char_u *ptr) { #ifdef FEAT_MBYTE if (has_mbyte) while (*ptr != NUL && *ptr != '\n' && mb_get_class(ptr) <= 1) ptr += (*mb_ptr2len)(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(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)(ptr); if (mb_get_class(ptr) != start_class) break; } } else #endif while (vim_iswordc(*ptr)) ++ptr; return ptr; } /* * Find the end of the line, omitting CR and NL at the end. * Returns a pointer to just after the line. */ static char_u * find_line_end(char_u *ptr) { char_u *s; s = ptr + STRLEN(ptr); while (s > ptr && (s[-1] == CAR || s[-1] == NL)) --s; return s; } /* * Free the list of completions */ static void ins_compl_free(void) { compl_T *match; int i; vim_free(compl_pattern); compl_pattern = NULL; vim_free(compl_leader); compl_leader = NULL; if (compl_first_match == NULL) return; ins_compl_del_pum(); pum_clear(); compl_curr_match = compl_first_match; do { match = compl_curr_match; compl_curr_match = compl_curr_match->cp_next; vim_free(match->cp_str); /* several entries may use the same fname, free it just once. */ if (match->cp_flags & FREE_FNAME) vim_free(match->cp_fname); for (i = 0; i < CPT_COUNT; ++i) vim_free(match->cp_text[i]); vim_free(match); } while (compl_curr_match != NULL && compl_curr_match != compl_first_match); compl_first_match = compl_curr_match = NULL; compl_shown_match = NULL; } static void ins_compl_clear(void) { compl_cont_status = 0; compl_started = FALSE; compl_matches = 0; vim_free(compl_pattern); compl_pattern = NULL; vim_free(compl_leader); compl_leader = NULL; edit_submode_extra = NULL; vim_free(compl_orig_text); compl_orig_text = NULL; compl_enter_selects = FALSE; /* clear v:completed_item */ set_vim_var_dict(VV_COMPLETED_ITEM, dict_alloc()); } /* * Return TRUE when Insert completion is active. */ int ins_compl_active(void) { return compl_started; } /* * Delete one character before the cursor and show the subset of the matches * that match the word that is now before the cursor. * Returns the character to be used, NUL if the work is done and another char * to be got from the user. */ static int ins_compl_bs(void) { char_u *line; char_u *p; line = ml_get_curline(); p = line + curwin->w_cursor.col; mb_ptr_back(line, p); /* Stop completion when the whole word was deleted. For Omni completion * allow the word to be deleted, we won't match everything. */ if ((int)(p - line) - (int)compl_col < 0 || ((int)(p - line) - (int)compl_col == 0 && ctrl_x_mode != CTRL_X_OMNI) || ctrl_x_mode == CTRL_X_EVAL) return K_BS; /* Deleted more than what was used to find matches or didn't finish * finding all matches: need to look for matches all over again. */ if (curwin->w_cursor.col <= compl_col + compl_length || ins_compl_need_restart()) ins_compl_restart(); vim_free(compl_leader); compl_leader = vim_strnsave(line + compl_col, (int)(p - line) - compl_col); if (compl_leader != NULL) { ins_compl_new_leader(); if (compl_shown_match != NULL) /* Make sure current match is not a hidden item. */ compl_curr_match = compl_shown_match; return NUL; } return K_BS; } /* * Return TRUE when we need to find matches again, ins_compl_restart() is to * be called. */ static int ins_compl_need_restart(void) { /* Return TRUE if we didn't complete finding matches or when the * 'completefunc' returned "always" in the "refresh" dictionary item. */ return compl_was_interrupted || ((ctrl_x_mode == CTRL_X_FUNCTION || ctrl_x_mode == CTRL_X_OMNI) && compl_opt_refresh_always); } /* * Called after changing "compl_leader". * Show the popup menu with a different set of matches. * May also search for matches again if the previous search was interrupted. */ static void ins_compl_new_leader(void) { ins_compl_del_pum(); ins_compl_delete(); ins_bytes(compl_leader + ins_compl_len()); compl_used_match = FALSE; if (compl_started) ins_compl_set_original_text(compl_leader); else { #ifdef FEAT_SPELL spell_bad_len = 0; /* need to redetect bad word */ #endif /* * Matches were cleared, need to search for them now. First display * the changed text before the cursor. Set "compl_restarting" to * avoid that the first match is inserted. */ update_screen(0); #ifdef FEAT_GUI if (gui.in_use) { /* Show the cursor after the match, not after the redrawn text. */ setcursor(); out_flush(); gui_update_cursor(FALSE, FALSE); } #endif compl_restarting = TRUE; if (ins_complete(Ctrl_N, TRUE) == FAIL) compl_cont_status = 0; compl_restarting = FALSE; } compl_enter_selects = !compl_used_match; /* Show the popup menu with a different set of matches. */ ins_compl_show_pum(); /* Don't let Enter select the original text when there is no popup menu. */ if (compl_match_array == NULL) compl_enter_selects = FALSE; } /* * Return the length of the completion, from the completion start column to * the cursor column. Making sure it never goes below zero. */ static int ins_compl_len(void) { int off = (int)curwin->w_cursor.col - (int)compl_col; if (off < 0) return 0; return off; } /* * Append one character to the match leader. May reduce the number of * matches. */ static void ins_compl_addleader(int c) { #ifdef FEAT_MBYTE int cc; 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); if (compl_opt_refresh_always) AppendToRedobuff(buf); } else #endif { ins_char(c); if (compl_opt_refresh_always) AppendCharToRedobuff(c); } /* If we didn't complete finding matches we must search again. */ if (ins_compl_need_restart()) ins_compl_restart(); /* When 'always' is set, don't reset compl_leader. While completing, * cursor doesn't point original position, changing compl_leader would * break redo. */ if (!compl_opt_refresh_always) { vim_free(compl_leader); compl_leader = vim_strnsave(ml_get_curline() + compl_col, (int)(curwin->w_cursor.col - compl_col)); if (compl_leader != NULL) ins_compl_new_leader(); } } /* * Setup for finding completions again without leaving CTRL-X mode. Used when * BS or a key was typed while still searching for matches. */ static void ins_compl_restart(void) { ins_compl_free(); compl_started = FALSE; compl_matches = 0; compl_cont_status = 0; compl_cont_mode = 0; } /* * Set the first match, the original text. */ static void ins_compl_set_original_text(char_u *str) { char_u *p; /* Replace the original text entry. */ if (compl_first_match->cp_flags & ORIGINAL_TEXT) /* safety check */ { p = vim_strsave(str); if (p != NULL) { vim_free(compl_first_match->cp_str); compl_first_match->cp_str = p; } } } /* * Append one character to the match leader. May reduce the number of * matches. */ static void ins_compl_addfrommatch(void) { char_u *p; int len = (int)curwin->w_cursor.col - (int)compl_col; int c; compl_T *cp; p = compl_shown_match->cp_str; if ((int)STRLEN(p) <= len) /* the match is too short */ { /* When still at the original match use the first entry that matches * the leader. */ if (compl_shown_match->cp_flags & ORIGINAL_TEXT) { p = NULL; for (cp = compl_shown_match->cp_next; cp != NULL && cp != compl_first_match; cp = cp->cp_next) { if (compl_leader == NULL || ins_compl_equal(cp, compl_leader, (int)STRLEN(compl_leader))) { p = cp->cp_str; break; } } if (p == NULL || (int)STRLEN(p) <= len) return; } else return; } p += len; c = PTR2CHAR(p); ins_compl_addleader(c); } /* * Prepare for Insert mode completion, or stop it. * Called just after typing a character in Insert mode. * Returns TRUE when the character is not to be inserted; */ static int ins_compl_prep(int c) { char_u *ptr; int want_cindent; int retval = FALSE; /* 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 and mouse scroll buttons. */ if (c == K_SELECT || c == K_MOUSEDOWN || c == K_MOUSEUP || c == K_MOUSELEFT || c == K_MOUSERIGHT) return retval; /* Set "compl_get_longest" when finding the first matches. */ if (ctrl_x_mode == CTRL_X_NOT_DEFINED_YET || (ctrl_x_mode == 0 && !compl_started)) { compl_get_longest = (strstr((char *)p_cot, "longest") != NULL); compl_used_match = TRUE; } compl_no_insert = FALSE; compl_no_select = FALSE; if (strstr((char *)p_cot, "noselect") != NULL) compl_no_select = TRUE; if (strstr((char *)p_cot, "noinsert") != NULL) compl_no_insert = TRUE; 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; #ifdef FEAT_COMPL_FUNC case Ctrl_U: ctrl_x_mode = CTRL_X_FUNCTION; break; case Ctrl_O: ctrl_x_mode = CTRL_X_OMNI; break; #endif case 's': case Ctrl_S: ctrl_x_mode = CTRL_X_SPELL; #ifdef FEAT_SPELL ++emsg_off; /* Avoid getting the E756 error twice. */ spell_back_to_badword(); --emsg_off; #endif 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 (!(compl_cont_status & CONT_INTRPT)) compl_cont_status |= CONT_LOCAL; else if (compl_cont_mode != 0) compl_cont_status &= ~CONT_LOCAL; /* FALLTHROUGH */ default: /* If we have typed at least 2 ^X's... for modes != 0, we set * compl_cont_status = 0 (eg, as if we had just started ^X * mode). * For mode 0, we set "compl_cont_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 (compl_cont_mode != 0) compl_cont_status = 0; else compl_cont_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 (compl_started || 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 && !ins_compl_pum_key(c)) || 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 (compl_curr_match != NULL || compl_leader != NULL || c == Ctrl_E) { /* * 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. * When using the longest match, edited the match or used * CTRL-E then don't use the current match. */ if (compl_curr_match != NULL && compl_used_match && c != Ctrl_E) ptr = compl_curr_match->cp_str; else ptr = NULL; ins_compl_fixRedoBufForLeader(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 (compl_cont_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 { int prev_col = curwin->w_cursor.col; /* put the cursor on the last char, for 'tw' formatting */ if (prev_col > 0) dec_cursor(); if (stop_arrow() == OK) insertchar(NUL, 0, -1); if (prev_col > 0 && ml_get_curline()[curwin->w_cursor.col] != NUL) inc_cursor(); } /* If the popup menu is displayed pressing CTRL-Y means accepting * the selection without inserting anything. When * compl_enter_selects is set the Enter key does the same. */ if ((c == Ctrl_Y || (compl_enter_selects && (c == CAR || c == K_KENTER || c == NL))) && pum_visible()) retval = TRUE; /* CTRL-E means completion is Ended, go back to the typed text. */ if (c == Ctrl_E) { ins_compl_delete(); if (compl_leader != NULL) ins_bytes(compl_leader + ins_compl_len()); else if (compl_first_match != NULL) ins_bytes(compl_orig_text + ins_compl_len()); retval = TRUE; } auto_format(FALSE, TRUE); ins_compl_free(); compl_started = FALSE; compl_matches = 0; if (!shortmess(SHM_COMPLETIONMENU)) msg_clr_cmdline(); /* necessary for "noshowmode" */ ctrl_x_mode = 0; compl_enter_selects = FALSE; if (edit_submode != NULL) { edit_submode = NULL; showmode(); } #ifdef FEAT_CMDWIN if (c == Ctrl_C && cmdwin_type != 0) /* Avoid the popup menu remains displayed when leaving the * command line window. */ update_screen(0); #endif #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 #ifdef FEAT_AUTOCMD /* Trigger the CompleteDone event to give scripts a chance to act * upon the completion. */ apply_autocmds(EVENT_COMPLETEDONE, NULL, NULL, FALSE, curbuf); #endif } } #ifdef FEAT_AUTOCMD else if (ctrl_x_mode == CTRL_X_LOCAL_MSG) /* Trigger the CompleteDone event to give scripts a chance to act * upon the (possibly failed) completion. */ apply_autocmds(EVENT_COMPLETEDONE, NULL, NULL, FALSE, curbuf); #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)) { compl_cont_status = 0; compl_cont_mode = 0; } return retval; } /* * Fix the redo buffer for the completion leader replacing some of the typed * text. This inserts backspaces and appends the changed text. * "ptr" is the known leader text or NUL. */ static void ins_compl_fixRedoBufForLeader(char_u *ptr_arg) { int len; char_u *p; char_u *ptr = ptr_arg; if (ptr == NULL) { if (compl_leader != NULL) ptr = compl_leader; else return; /* nothing to do */ } if (compl_orig_text != NULL) { p = compl_orig_text; for (len = 0; p[len] != NUL && p[len] == ptr[len]; ++len) ; #ifdef FEAT_MBYTE if (len > 0) len -= (*mb_head_off)(p, p + len); #endif for (p += len; *p != NUL; mb_ptr_adv(p)) AppendCharToRedobuff(K_BS); } else len = 0; if (ptr != NULL) AppendToRedobuffLit(ptr + len, -1); } /* * 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_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)) ; return buf; } #ifdef FEAT_COMPL_FUNC static void expand_by_function(int type, char_u *base); /* * Execute user defined complete function 'completefunc' or 'omnifunc', and * get matches in "matches". */ static void expand_by_function( int type, /* CTRL_X_OMNI or CTRL_X_FUNCTION */ char_u *base) { list_T *matchlist = NULL; dict_T *matchdict = NULL; char_u *args[2]; char_u *funcname; pos_T pos; win_T *curwin_save; buf_T *curbuf_save; typval_T rettv; funcname = (type == CTRL_X_FUNCTION) ? curbuf->b_p_cfu : curbuf->b_p_ofu; if (*funcname == NUL) return; /* Call 'completefunc' to obtain the list of matches. */ args[0] = (char_u *)"0"; args[1] = base; pos = curwin->w_cursor; curwin_save = curwin; curbuf_save = curbuf; /* Call a function, which returns a list or dict. */ if (call_vim_function(funcname, 2, args, FALSE, FALSE, &rettv) == OK) { switch (rettv.v_type) { case VAR_LIST: matchlist = rettv.vval.v_list; break; case VAR_DICT: matchdict = rettv.vval.v_dict; break; default: /* TODO: Give error message? */ clear_tv(&rettv); break; } } if (curwin_save != curwin || curbuf_save != curbuf) { EMSG(_(e_complwin)); goto theend; } curwin->w_cursor = pos; /* restore the cursor position */ validate_cursor(); if (!equalpos(curwin->w_cursor, pos)) { EMSG(_(e_compldel)); goto theend; } if (matchlist != NULL) ins_compl_add_list(matchlist); else if (matchdict != NULL) ins_compl_add_dict(matchdict); theend: if (matchdict != NULL) dict_unref(matchdict); if (matchlist != NULL) list_unref(matchlist); } #endif /* FEAT_COMPL_FUNC */ #if defined(FEAT_COMPL_FUNC) || defined(FEAT_EVAL) || defined(PROTO) /* * Add completions from a list. */ static void ins_compl_add_list(list_T *list) { listitem_T *li; int dir = compl_direction; /* Go through the List with matches and add each of them. */ for (li = list->lv_first; li != NULL; li = li->li_next) { if (ins_compl_add_tv(&li->li_tv, dir) == OK) /* if dir was BACKWARD then honor it just once */ dir = FORWARD; else if (did_emsg) break; } } /* * Add completions from a dict. */ static void ins_compl_add_dict(dict_T *dict) { dictitem_T *di_refresh; dictitem_T *di_words; /* Check for optional "refresh" item. */ compl_opt_refresh_always = FALSE; di_refresh = dict_find(dict, (char_u *)"refresh", 7); if (di_refresh != NULL && di_refresh->di_tv.v_type == VAR_STRING) { char_u *v = di_refresh->di_tv.vval.v_string; if (v != NULL && STRCMP(v, (char_u *)"always") == 0) compl_opt_refresh_always = TRUE; } /* Add completions from a "words" list. */ di_words = dict_find(dict, (char_u *)"words", 5); if (di_words != NULL && di_words->di_tv.v_type == VAR_LIST) ins_compl_add_list(di_words->di_tv.vval.v_list); } /* * Add a match to the list of matches from a typeval_T. * If the given string is already in the list of completions, then return * NOTDONE, otherwise add it to the list and return OK. If there is an error, * maybe because alloc() returns NULL, then FAIL is returned. */ int ins_compl_add_tv(typval_T *tv, int dir) { char_u *word; int icase = FALSE; int adup = FALSE; int aempty = FALSE; char_u *(cptext[CPT_COUNT]); if (tv->v_type == VAR_DICT && tv->vval.v_dict != NULL) { word = get_dict_string(tv->vval.v_dict, (char_u *)"word", FALSE); cptext[CPT_ABBR] = get_dict_string(tv->vval.v_dict, (char_u *)"abbr", FALSE); cptext[CPT_MENU] = get_dict_string(tv->vval.v_dict, (char_u *)"menu", FALSE); cptext[CPT_KIND] = get_dict_string(tv->vval.v_dict, (char_u *)"kind", FALSE); cptext[CPT_INFO] = get_dict_string(tv->vval.v_dict, (char_u *)"info", FALSE); if (get_dict_string(tv->vval.v_dict, (char_u *)"icase", FALSE) != NULL) icase = get_dict_number(tv->vval.v_dict, (char_u *)"icase"); if (get_dict_string(tv->vval.v_dict, (char_u *)"dup", FALSE) != NULL) adup = get_dict_number(tv->vval.v_dict, (char_u *)"dup"); if (get_dict_string(tv->vval.v_dict, (char_u *)"empty", FALSE) != NULL) aempty = get_dict_number(tv->vval.v_dict, (char_u *)"empty"); } else { word = get_tv_string_chk(tv); vim_memset(cptext, 0, sizeof(cptext)); } if (word == NULL || (!aempty && *word == NUL)) return FAIL; return ins_compl_add(word, -1, icase, NULL, cptext, dir, 0, adup); } #endif /* * Get the next expansion(s), using "compl_pattern". * The search starts at position "ini" in curbuf and in the direction * compl_direction. * When "compl_started" is FALSE start at that position, otherwise continue * where we stopped searching before. * This may return before finding all the matches. * Return the total number of matches or -1 if still unknown -- Acevedo */ static int ins_compl_get_exp(pos_T *ini) { 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 of a certain type. */ static buf_T *ins_buf = NULL; /* buffer being scanned */ 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 *dict = NULL; int dict_f = 0; compl_T *old_match; int set_match_pos; if (!compl_started) { 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 = (compl_cont_status & CONT_LOCAL) ? (char_u *)"." : curbuf->b_p_cpt; last_match_pos = first_match_pos = *ini; } old_match = compl_curr_match; /* remember the last current match */ pos = (compl_direction == FORWARD) ? &last_match_pos : &first_match_pos; /* For ^N/^P loop over all the flags/windows/buffers in 'complete' */ for (;;) { found_new_match = FAIL; set_match_pos = FALSE; /* For ^N/^P pick a new entry from e_cpt if compl_started 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_LINE_OR_EVAL(ctrl_x_mode)) && (!compl_started || 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; /* Remember the first match so that the loop stops when we * wrap and come back there a second time. */ set_match_pos = TRUE; } 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 */ { compl_started = 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; } vim_snprintf((char *)IObuff, IOSIZE, _("Scanning: %s"), ins_buf->b_fname == NULL ? buf_spname(ins_buf) : ins_buf->b_sfname == NULL ? ins_buf->b_fname : ins_buf->b_sfname); (void)msg_trunc_attr(IObuff, TRUE, hl_attr(HLF_R)); } else if (*e_cpt == NUL) break; else { if (CTRL_X_MODE_LINE_OR_EVAL(ctrl_x_mode)) 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; vim_snprintf((char *)IObuff, IOSIZE, _("Scanning tags.")); (void)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(compl_pattern, compl_direction, (int)STRLEN(compl_pattern), FALSE, FALSE, (type == CTRL_X_PATH_DEFINES && !(compl_cont_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 != NULL ? 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)), compl_pattern, dict != NULL ? 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(compl_pattern); /* Find up to TAG_MANY matches. Avoids that an enormous number * of matches is found when compl_pattern is empty */ if (find_tags(compl_pattern, &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, p_ic); } p_ic = save_p_ic; break; case CTRL_X_FILES: if (expand_wildcards(1, &compl_pattern, &num_matches, &matches, EW_FILE|EW_DIR|EW_ADDSLASH|EW_SILENT) == OK) { /* May change home directory back to "~". */ tilde_replace(compl_pattern, num_matches, matches); ins_compl_add_matches(num_matches, matches, p_fic || p_wic); } break; case CTRL_X_CMDLINE: if (expand_cmdline(&compl_xp, compl_pattern, (int)STRLEN(compl_pattern), &num_matches, &matches) == EXPAND_OK) ins_compl_add_matches(num_matches, matches, FALSE); break; #ifdef FEAT_COMPL_FUNC case CTRL_X_FUNCTION: case CTRL_X_OMNI: expand_by_function(type, compl_pattern); break; #endif case CTRL_X_SPELL: #ifdef FEAT_SPELL num_matches = expand_spelling(first_match_pos.lnum, compl_pattern, &matches); if (num_matches > 0) ins_compl_add_matches(num_matches, matches, p_ic); #endif 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 flags = 0; ++msg_silent; /* Don't want messages for wrapscan. */ /* CTRL_X_MODE_LINE_OR_EVAL(ctrl_x_mode) * || word-wise search that * has added a word that was at the beginning of the line */ if (CTRL_X_MODE_LINE_OR_EVAL(ctrl_x_mode) || (compl_cont_status & CONT_SOL)) found_new_match = search_for_exact_line(ins_buf, pos, compl_direction, compl_pattern); else found_new_match = searchit(NULL, ins_buf, pos, compl_direction, compl_pattern, 1L, SEARCH_KEEP + SEARCH_NFMSG, RE_LAST, (linenr_T)0, NULL); --msg_silent; if (!compl_started || set_match_pos) { /* set "compl_started" even on fail */ compl_started = TRUE; first_match_pos = *pos; last_match_pos = *pos; set_match_pos = FALSE; } 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 ( (compl_cont_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_LINE_OR_EVAL(ctrl_x_mode)) { if (compl_cont_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 { char_u *tmp_ptr = ptr; if (compl_cont_status & CONT_ADDING) { tmp_ptr += compl_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 ((compl_cont_status & CONT_ADDING) && len == compl_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 * compl_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 possible 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); flags |= CONT_S_IPOS; } IObuff[len] = NUL; ptr = IObuff; } if (len == compl_length) continue; } } if (ins_compl_add_infercase(ptr, len, p_ic, ins_buf == curbuf ? NULL : ins_buf->b_sfname, 0, flags) != NOTDONE) { found_new_match = OK; break; } } p_scs = save_p_scs; p_ws = save_p_ws; } /* check if compl_curr_match has changed, (e.g. other type of * expansion added something) */ if (type != 0 && compl_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_LINE_OR_EVAL(ctrl_x_mode)) || found_new_match != FAIL) { if (got_int) break; /* Fill the popup menu as soon as possible. */ if (type != -1) ins_compl_check_keys(0); if ((ctrl_x_mode != 0 && !CTRL_X_MODE_LINE_OR_EVAL(ctrl_x_mode)) || compl_interrupted) break; compl_started = TRUE; } else { /* Mark a buffer scanned when it has been scanned completely */ if (type == 0 || type == CTRL_X_PATH_PATTERNS) ins_buf->b_scanned = TRUE; compl_started = FALSE; } } compl_started = TRUE; if ((ctrl_x_mode == 0 || CTRL_X_MODE_LINE_OR_EVAL(ctrl_x_mode)) && *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_LINE_OR_EVAL(ctrl_x_mode))) 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 compl_curr_match to the next * or previous entry (if any) -- Acevedo */ compl_curr_match = compl_direction == FORWARD ? old_match->cp_next : old_match->cp_prev; if (compl_curr_match == NULL) compl_curr_match = old_match; return i; } /* Delete the old text being completed. */ static void ins_compl_delete(void) { int i; /* * In insert mode: Delete the typed part. * In replace mode: Put the old characters back, if any. */ i = compl_col + (compl_cont_status & CONT_ADDING ? compl_length : 0); backspace_until_column(i); /* TODO: is this sufficient for redrawing? Redrawing everything causes * flicker, thus we can't do that. */ changed_cline_bef_curs(); /* clear v:completed_item */ set_vim_var_dict(VV_COMPLETED_ITEM, dict_alloc()); } /* Insert the new text being completed. */ static void ins_compl_insert(void) { dict_T *dict; ins_bytes(compl_shown_match->cp_str + ins_compl_len()); if (compl_shown_match->cp_flags & ORIGINAL_TEXT) compl_used_match = FALSE; else compl_used_match = TRUE; /* Set completed item. */ /* { word, abbr, menu, kind, info } */ dict = dict_alloc(); if (dict != NULL) { dict_add_nr_str(dict, "word", 0L, EMPTY_IF_NULL(compl_shown_match->cp_str)); dict_add_nr_str(dict, "abbr", 0L, EMPTY_IF_NULL(compl_shown_match->cp_text[CPT_ABBR])); dict_add_nr_str(dict, "menu", 0L, EMPTY_IF_NULL(compl_shown_match->cp_text[CPT_MENU])); dict_add_nr_str(dict, "kind", 0L, EMPTY_IF_NULL(compl_shown_match->cp_text[CPT_KIND])); dict_add_nr_str(dict, "info", 0L, EMPTY_IF_NULL(compl_shown_match->cp_text[CPT_INFO])); } set_vim_var_dict(VV_COMPLETED_ITEM, dict); } /* * 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. * * compl_curr_match is currently being used by ins_compl_get_exp(), so we use * compl_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( int allow_get_expansion, int count, /* repeat completion this many times; should be at least 1 */ int insert_match) /* Insert the newly selected match */ { int num_matches = -1; int i; int todo = count; compl_T *found_compl = NULL; int found_end = FALSE; int advance; int started = compl_started; /* When user complete function return -1 for findstart which is next * time of 'always', compl_shown_match become NULL. */ if (compl_shown_match == NULL) return -1; if (compl_leader != NULL && (compl_shown_match->cp_flags & ORIGINAL_TEXT) == 0) { /* Set "compl_shown_match" to the actually shown match, it may differ * when "compl_leader" is used to omit some of the matches. */ while (!ins_compl_equal(compl_shown_match, compl_leader, (int)STRLEN(compl_leader)) && compl_shown_match->cp_next != NULL && compl_shown_match->cp_next != compl_first_match) compl_shown_match = compl_shown_match->cp_next; /* If we didn't find it searching forward, and compl_shows_dir is * backward, find the last match. */ if (compl_shows_dir == BACKWARD && !ins_compl_equal(compl_shown_match, compl_leader, (int)STRLEN(compl_leader)) && (compl_shown_match->cp_next == NULL || compl_shown_match->cp_next == compl_first_match)) { while (!ins_compl_equal(compl_shown_match, compl_leader, (int)STRLEN(compl_leader)) && compl_shown_match->cp_prev != NULL && compl_shown_match->cp_prev != compl_first_match) compl_shown_match = compl_shown_match->cp_prev; } } if (allow_get_expansion && insert_match && (!(compl_get_longest || compl_restarting) || compl_used_match)) /* Delete old text to be replaced */ ins_compl_delete(); /* When finding the longest common text we stick at the original text, * don't let CTRL-N or CTRL-P move to the first match. */ advance = count != 1 || !allow_get_expansion || !compl_get_longest; /* When restarting the search don't insert the first match either. */ if (compl_restarting) { advance = FALSE; compl_restarting = FALSE; } /* Repeat this for when or is typed. But don't wrap * around. */ while (--todo >= 0) { if (compl_shows_dir == FORWARD && compl_shown_match->cp_next != NULL) { compl_shown_match = compl_shown_match->cp_next; found_end = (compl_first_match != NULL && (compl_shown_match->cp_next == compl_first_match || compl_shown_match == compl_first_match)); } else if (compl_shows_dir == BACKWARD && compl_shown_match->cp_prev != NULL) { found_end = (compl_shown_match == compl_first_match); compl_shown_match = compl_shown_match->cp_prev; found_end |= (compl_shown_match == compl_first_match); } else { if (!allow_get_expansion) { if (advance) { if (compl_shows_dir == BACKWARD) compl_pending -= todo + 1; else compl_pending += todo + 1; } return -1; } if (!compl_no_select && advance) { if (compl_shows_dir == BACKWARD) --compl_pending; else ++compl_pending; } /* Find matches. */ num_matches = ins_compl_get_exp(&compl_startpos); /* handle any pending completions */ while (compl_pending != 0 && compl_direction == compl_shows_dir && advance) { if (compl_pending > 0 && compl_shown_match->cp_next != NULL) { compl_shown_match = compl_shown_match->cp_next; --compl_pending; } if (compl_pending < 0 && compl_shown_match->cp_prev != NULL) { compl_shown_match = compl_shown_match->cp_prev; ++compl_pending; } else break; } found_end = FALSE; } if ((compl_shown_match->cp_flags & ORIGINAL_TEXT) == 0 && compl_leader != NULL && !ins_compl_equal(compl_shown_match, compl_leader, (int)STRLEN(compl_leader))) ++todo; else /* Remember a matching item. */ found_compl = compl_shown_match; /* Stop at the end of the list when we found a usable match. */ if (found_end) { if (found_compl != NULL) { compl_shown_match = found_compl; break; } todo = 1; /* use first usable match after wrapping around */ } } /* Insert the text of the new completion, or the compl_leader. */ if (compl_no_insert && !started) { ins_bytes(compl_orig_text + ins_compl_len()); compl_used_match = FALSE; } else if (insert_match) { if (!compl_get_longest || compl_used_match) ins_compl_insert(); else ins_bytes(compl_leader + ins_compl_len()); } else compl_used_match = FALSE; if (!allow_get_expansion) { /* may undisplay the popup menu first */ ins_compl_upd_pum(); /* redraw to show the user what was inserted */ update_screen(0); /* display the updated popup menu */ ins_compl_show_pum(); #ifdef FEAT_GUI if (gui.in_use) { /* Show the cursor after the match, not after the redrawn text. */ setcursor(); out_flush(); gui_update_cursor(FALSE, FALSE); } #endif /* Delete old text to be replaced, since we're still searching and * don't want to match ourselves! */ ins_compl_delete(); } /* Enter will select a match when the match wasn't inserted and the popup * menu is visible. */ if (compl_no_insert && !started) compl_enter_selects = TRUE; else compl_enter_selects = !insert_match && compl_match_array != NULL; /* * Show the file name for the match (if any) * Truncate the file name to avoid a wait for return. */ if (compl_shown_match->cp_fname != NULL) { STRCPY(IObuff, "match in file "); i = (vim_strsize(compl_shown_match->cp_fname) + 16) - sc_col; if (i <= 0) i = 0; else STRCAT(IObuff, "<"); STRCAT(IObuff, compl_shown_match->cp_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 compl_pending is not zero, show a completion as soon as * possible. -- webb * "frequency" specifies out of how many calls we actually check. */ void ins_compl_check_keys(int frequency) { 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 < frequency) return; count = 0; /* Check for a typed key. Do use mappings, otherwise vim_is_ctrl_x_key() * can't do its work correctly. */ c = vpeekc_any(); if (c != NUL) { if (vim_is_ctrl_x_key(c) && c != Ctrl_X && c != Ctrl_R) { c = safe_vgetc(); /* Eat the character */ compl_shows_dir = ins_compl_key2dir(c); (void)ins_compl_next(FALSE, ins_compl_key2count(c), c != K_UP && c != K_DOWN); } else { /* Need to get the character to have KeyTyped set. We'll put it * back with vungetc() below. But skip K_IGNORE. */ c = safe_vgetc(); if (c != K_IGNORE) { /* Don't interrupt completion when the character wasn't typed, * e.g., when doing @q to replay keys. */ if (c != Ctrl_R && KeyTyped) compl_interrupted = TRUE; vungetc(c); } } } if (compl_pending != 0 && !got_int && !compl_no_insert) { int todo = compl_pending > 0 ? compl_pending : -compl_pending; compl_pending = 0; (void)ins_compl_next(FALSE, todo, TRUE); } } /* * Decide the direction of Insert mode complete from the key typed. * Returns BACKWARD or FORWARD. */ static int ins_compl_key2dir(int c) { if (c == Ctrl_P || c == Ctrl_L || (pum_visible() && (c == K_PAGEUP || c == K_KPAGEUP || c == K_S_UP || c == K_UP))) return BACKWARD; return FORWARD; } /* * Return TRUE for keys that are used for completion only when the popup menu * is visible. */ static int ins_compl_pum_key(int c) { return pum_visible() && (c == K_PAGEUP || c == K_KPAGEUP || c == K_S_UP || c == K_PAGEDOWN || c == K_KPAGEDOWN || c == K_S_DOWN || c == K_UP || c == K_DOWN); } /* * Decide the number of completions to move forward. * Returns 1 for most keys, height of the popup menu for page-up/down keys. */ static int ins_compl_key2count(int c) { int h; if (ins_compl_pum_key(c) && c != K_UP && c != K_DOWN) { h = pum_get_height(); if (h > 3) h -= 2; /* keep some context */ return h; } return 1; } /* * Return TRUE if completion with "c" should insert the match, FALSE if only * to change the currently selected completion. */ static int ins_compl_use_match(int c) { switch (c) { case K_UP: case K_DOWN: case K_PAGEDOWN: case K_KPAGEDOWN: case K_S_DOWN: case K_PAGEUP: case K_KPAGEUP: case K_S_UP: return FALSE; } return TRUE; } /* * 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(int c, int enable_pum) { char_u *line; int startcol = 0; /* column where searched text starts */ colnr_T curs_col; /* cursor column */ int n; int save_w_wrow; compl_direction = ins_compl_key2dir(c); if (!compl_started) { /* First time we hit ^N or ^P (in a row, I mean) */ 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); curs_col = curwin->w_cursor.col; compl_pending = 0; /* If this same ctrl_x_mode has been interrupted use the text from * "compl_startpos" to the cursor as a pattern to add a new word * instead of expand the one before the cursor, in word-wise if * "compl_startpos" 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 ((compl_cont_status & CONT_INTRPT) == CONT_INTRPT && compl_cont_mode == ctrl_x_mode) { /* * it is a continued search */ compl_cont_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 (compl_startpos.lnum != curwin->w_cursor.lnum) { /* line (probably) wrapped, set compl_startpos 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 */ compl_col = (colnr_T)(skipwhite(line) - line); compl_startpos.col = compl_col; compl_startpos.lnum = curwin->w_cursor.lnum; compl_cont_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 compl_startpos */ if (compl_cont_status & CONT_S_IPOS) { compl_cont_status |= CONT_SOL; compl_startpos.col = (colnr_T)(skipwhite( line + compl_length + compl_startpos.col) - line); } compl_col = compl_startpos.col; } compl_length = curwin->w_cursor.col - (int)compl_col; /* IObuff is used to add a "word from the next line" would we * have enough space? just being paranoid */ #define MIN_SPACE 75 if (compl_length > (IOSIZE - MIN_SPACE)) { compl_cont_status &= ~CONT_SOL; compl_length = (IOSIZE - MIN_SPACE); compl_col = curwin->w_cursor.col - compl_length; } compl_cont_status |= CONT_ADDING | CONT_N_ADDS; if (compl_length < 1) compl_cont_status &= CONT_LOCAL; } else if (CTRL_X_MODE_LINE_OR_EVAL(ctrl_x_mode)) compl_cont_status = CONT_ADDING | CONT_N_ADDS; else compl_cont_status = 0; } else compl_cont_status &= CONT_LOCAL; if (!(compl_cont_status & CONT_ADDING)) /* normal expansion */ { compl_cont_mode = ctrl_x_mode; if (ctrl_x_mode != 0) /* Remove LOCAL if ctrl_x_mode != 0 */ compl_cont_status = 0; compl_cont_status |= CONT_N_ADDS; compl_startpos = curwin->w_cursor; startcol = (int)curs_col; compl_col = 0; } /* Work out completion pattern and original text -- webb */ if (ctrl_x_mode == 0 || (ctrl_x_mode & CTRL_X_WANT_IDENT)) { if ((compl_cont_status & CONT_SOL) || ctrl_x_mode == CTRL_X_PATH_DEFINES) { if (!(compl_cont_status & CONT_ADDING)) { while (--startcol >= 0 && vim_isIDc(line[startcol])) ; compl_col += ++startcol; compl_length = curs_col - startcol; } if (p_ic) compl_pattern = str_foldcase(line + compl_col, compl_length, NULL, 0); else compl_pattern = vim_strnsave(line + compl_col, compl_length); if (compl_pattern == NULL) return FAIL; } else if (compl_cont_status & CONT_ADDING) { char_u *prefix = (char_u *)"\\<"; /* we need up to 2 extra chars for the prefix */ compl_pattern = alloc(quote_meta(NULL, line + compl_col, compl_length) + 2); if (compl_pattern == NULL) return FAIL; if (!vim_iswordp(line + compl_col) || (compl_col > 0 && ( #ifdef FEAT_MBYTE vim_iswordp(mb_prevptr(line, line + compl_col)) #else vim_iswordc(line[compl_col - 1]) #endif ))) prefix = (char_u *)""; STRCPY((char *)compl_pattern, prefix); (void)quote_meta(compl_pattern + STRLEN(prefix), line + compl_col, compl_length); } else if (--startcol < 0 || #ifdef FEAT_MBYTE !vim_iswordp(mb_prevptr(line, line + startcol + 1)) #else !vim_iswordc(line[startcol]) #endif ) { /* Match any word of at least two chars */ compl_pattern = vim_strsave((char_u *)"\\<\\k\\k"); if (compl_pattern == NULL) return FAIL; compl_col += curs_col; compl_length = 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; startcol -= (*mb_head_off)(line, line + startcol); base_class = mb_get_class(line + startcol); while (--startcol >= 0) { head_off = (*mb_head_off)(line, line + startcol); if (base_class != mb_get_class(line + startcol - head_off)) break; startcol -= head_off; } } else #endif while (--startcol >= 0 && vim_iswordc(line[startcol])) ; compl_col += ++startcol; compl_length = (int)curs_col - startcol; if (compl_length == 1) { /* Only match word with at least two chars -- webb * there's no need to call quote_meta, * alloc(7) is enough -- Acevedo */ compl_pattern = alloc(7); if (compl_pattern == NULL) return FAIL; STRCPY((char *)compl_pattern, "\\<"); (void)quote_meta(compl_pattern + 2, line + compl_col, 1); STRCAT((char *)compl_pattern, "\\k"); } else { compl_pattern = alloc(quote_meta(NULL, line + compl_col, compl_length) + 2); if (compl_pattern == NULL) return FAIL; STRCPY((char *)compl_pattern, "\\<"); (void)quote_meta(compl_pattern + 2, line + compl_col, compl_length); } } } else if (CTRL_X_MODE_LINE_OR_EVAL(ctrl_x_mode)) { compl_col = (colnr_T)(skipwhite(line) - line); compl_length = (int)curs_col - (int)compl_col; if (compl_length < 0) /* cursor in indent: empty pattern */ compl_length = 0; if (p_ic) compl_pattern = str_foldcase(line + compl_col, compl_length, NULL, 0); else compl_pattern = vim_strnsave(line + compl_col, compl_length); if (compl_pattern == NULL) return FAIL; } else if (ctrl_x_mode == CTRL_X_FILES) { /* Go back to just before the first filename character. */ if (startcol > 0) { char_u *p = line + startcol; mb_ptr_back(line, p); while (p > line && vim_isfilec(PTR2CHAR(p))) mb_ptr_back(line, p); if (p == line && vim_isfilec(PTR2CHAR(p))) startcol = 0; else startcol = (int)(p - line) + 1; } compl_col += startcol; compl_length = (int)curs_col - startcol; compl_pattern = addstar(line + compl_col, compl_length, EXPAND_FILES); if (compl_pattern == NULL) return FAIL; } else if (ctrl_x_mode == CTRL_X_CMDLINE) { compl_pattern = vim_strnsave(line, curs_col); if (compl_pattern == NULL) return FAIL; set_cmd_context(&compl_xp, compl_pattern, (int)STRLEN(compl_pattern), curs_col); if (compl_xp.xp_context == EXPAND_UNSUCCESSFUL || compl_xp.xp_context == EXPAND_NOTHING) /* No completion possible, use an empty pattern to get a * "pattern not found" message. */ compl_col = curs_col; else compl_col = (int)(compl_xp.xp_pattern - compl_pattern); compl_length = curs_col - compl_col; } else if (ctrl_x_mode == CTRL_X_FUNCTION || ctrl_x_mode == CTRL_X_OMNI) { #ifdef FEAT_COMPL_FUNC /* * Call user defined function 'completefunc' with "a:findstart" * set to 1 to obtain the length of text to use for completion. */ char_u *args[2]; int col; char_u *funcname; pos_T pos; win_T *curwin_save; buf_T *curbuf_save; /* Call 'completefunc' or 'omnifunc' and get pattern length as a * string */ funcname = ctrl_x_mode == CTRL_X_FUNCTION ? curbuf->b_p_cfu : curbuf->b_p_ofu; if (*funcname == NUL) { EMSG2(_(e_notset), ctrl_x_mode == CTRL_X_FUNCTION ? "completefunc" : "omnifunc"); return FAIL; } args[0] = (char_u *)"1"; args[1] = NULL; pos = curwin->w_cursor; curwin_save = curwin; curbuf_save = curbuf; col = call_func_retnr(funcname, 2, args, FALSE); if (curwin_save != curwin || curbuf_save != curbuf) { EMSG(_(e_complwin)); return FAIL; } curwin->w_cursor = pos; /* restore the cursor position */ validate_cursor(); if (!equalpos(curwin->w_cursor, pos)) { EMSG(_(e_compldel)); return FAIL; } /* Return value -2 means the user complete function wants to * cancel the complete without an error. * Return value -3 does the same as -2 and leaves CTRL-X mode.*/ if (col == -2) return FAIL; if (col == -3) { ctrl_x_mode = 0; edit_submode = NULL; if (!shortmess(SHM_COMPLETIONMENU)) msg_clr_cmdline(); return FAIL; } /* * Reset extended parameters of completion, when start new * completion. */ compl_opt_refresh_always = FALSE; if (col < 0) col = curs_col; compl_col = col; if (compl_col > curs_col) compl_col = curs_col; /* Setup variables for completion. Need to obtain "line" again, * it may have become invalid. */ line = ml_get(curwin->w_cursor.lnum); compl_length = curs_col - compl_col; compl_pattern = vim_strnsave(line + compl_col, compl_length); if (compl_pattern == NULL) #endif return FAIL; } else if (ctrl_x_mode == CTRL_X_SPELL) { #ifdef FEAT_SPELL if (spell_bad_len > 0) compl_col = curs_col - spell_bad_len; else compl_col = spell_word_start(startcol); if (compl_col >= (colnr_T)startcol) { compl_length = 0; compl_col = curs_col; } else { spell_expand_check_cap(compl_col); compl_length = (int)curs_col - compl_col; } /* Need to obtain "line" again, it may have become invalid. */ line = ml_get(curwin->w_cursor.lnum); compl_pattern = vim_strnsave(line + compl_col, compl_length); if (compl_pattern == NULL) #endif return FAIL; } else { EMSG2(_(e_intern2), "ins_complete()"); return FAIL; } if (compl_cont_status & CONT_ADDING) { edit_submode_pre = (char_u *)_(" Adding"); if (CTRL_X_MODE_LINE_OR_EVAL(ctrl_x_mode)) { /* 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 compl_startpos.lnum = curwin->w_cursor.lnum; compl_startpos.col = compl_col; ins_eol('\r'); #ifdef FEAT_COMMENTS curbuf->b_p_com = old; #endif compl_length = 0; compl_col = curwin->w_cursor.col; } } else { edit_submode_pre = NULL; compl_startpos.col = compl_col; } if (compl_cont_status & CONT_LOCAL) edit_submode = (char_u *)_(ctrl_x_msgs[CTRL_X_LOCAL_MSG]); else edit_submode = (char_u *)_(CTRL_X_MSG(ctrl_x_mode)); /* If any of the original typed text has been changed we need to fix * the redo buffer. */ ins_compl_fixRedoBufForLeader(NULL); /* Always add completion for the original text. */ vim_free(compl_orig_text); compl_orig_text = vim_strnsave(line + compl_col, compl_length); if (compl_orig_text == NULL || ins_compl_add(compl_orig_text, -1, p_ic, NULL, NULL, 0, ORIGINAL_TEXT, FALSE) != OK) { vim_free(compl_pattern); compl_pattern = NULL; vim_free(compl_orig_text); compl_orig_text = NULL; 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(); } compl_shown_match = compl_curr_match; compl_shows_dir = compl_direction; /* * Find next match (and following matches). */ save_w_wrow = curwin->w_wrow; n = ins_compl_next(TRUE, ins_compl_key2count(c), ins_compl_use_match(c)); /* may undisplay the popup menu */ ins_compl_upd_pum(); if (n > 1) /* all matches have been found */ compl_matches = n; compl_curr_match = compl_shown_match; compl_direction = compl_shows_dir; /* Eat the ESC that vgetc() returns after a CTRL-C 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 "compl_orig_text"-entry */ if (compl_first_match == compl_first_match->cp_next) { edit_submode_extra = (compl_cont_status & CONT_ADDING) && compl_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 ( compl_length > 1 || (compl_cont_status & CONT_ADDING) || (ctrl_x_mode != 0 && ctrl_x_mode != CTRL_X_PATH_PATTERNS && ctrl_x_mode != CTRL_X_PATH_DEFINES)) compl_cont_status &= ~CONT_N_ADDS; } if (compl_curr_match->cp_flags & CONT_S_IPOS) compl_cont_status |= CONT_S_IPOS; else compl_cont_status &= ~CONT_S_IPOS; if (edit_submode_extra == NULL) { if (compl_curr_match->cp_flags & ORIGINAL_TEXT) { edit_submode_extra = (char_u *)_("Back at original"); edit_submode_highl = HLF_W; } else if (compl_cont_status & CONT_S_IPOS) { edit_submode_extra = (char_u *)_("Word from other line"); edit_submode_highl = HLF_COUNT; } else if (compl_curr_match->cp_next == compl_curr_match->cp_prev) { edit_submode_extra = (char_u *)_("The only match"); edit_submode_highl = HLF_COUNT; } else { /* Update completion sequence number when needed. */ if (compl_curr_match->cp_number == -1) { int number = 0; compl_T *match; if (compl_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 = compl_curr_match->cp_prev; match != NULL && match != compl_first_match; match = match->cp_prev) if (match->cp_number != -1) { number = match->cp_number; break; } if (match != NULL) /* go up and assign all numbers which are not assigned * yet */ for (match = match->cp_next; match != NULL && match->cp_number == -1; match = match->cp_next) match->cp_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 = compl_curr_match->cp_next; match != NULL && match != compl_first_match; match = match->cp_next) if (match->cp_number != -1) { number = match->cp_number; break; } if (match != NULL) /* go down and assign all numbers which are not * assigned yet */ for (match = match->cp_prev; match && match->cp_number == -1; match = match->cp_prev) match->cp_number = ++number; } } /* The match should always have a sequence number now, this is * just a safety check. */ if (compl_curr_match->cp_number != -1) { /* Space for 10 text chars. + 2x10-digit no.s = 31. * Translations may need more than twice that. */ static char_u match_ref[81]; if (compl_matches > 0) vim_snprintf((char *)match_ref, sizeof(match_ref), _("match %d of %d"), compl_curr_match->cp_number, compl_matches); else vim_snprintf((char *)match_ref, sizeof(match_ref), _("match %d"), compl_curr_match->cp_number); edit_submode_extra = match_ref; edit_submode_highl = HLF_R; if (dollar_vcol >= 0) curs_columns(FALSE); } } } /* Show a message about what (completion) mode we're in. */ showmode(); if (!shortmess(SHM_COMPLETIONMENU)) { 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" */ } /* Show the popup menu, unless we got interrupted. */ if (enable_pum && !compl_interrupted) { show_pum(save_w_wrow); } compl_was_interrupted = compl_interrupted; compl_interrupted = FALSE; return OK; } static void show_pum(int save_w_wrow) { /* RedrawingDisabled may be set when invoked through complete(). */ int n = RedrawingDisabled; RedrawingDisabled = 0; /* If the cursor moved we need to remove the pum first. */ setcursor(); if (save_w_wrow != curwin->w_wrow) ins_compl_del_pum(); ins_compl_show_pum(); setcursor(); RedrawingDisabled = n; } /* * 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 unsigned quote_meta(char_u *dest, char_u *src, int len) { unsigned m = (unsigned)len + 1; /* one extra for the NUL */ for ( ; --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)(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(void) { 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 "" 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 (;;) { nc = plain_vgetc(); #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'; #ifdef FEAT_MBYTE if (enc_dbcs && (cc & 0xff) == 0) cc = '?'; /* don't accept an illegal DBCS char, the NUL in the second byte will cause trouble! */ #endif --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( int c, int allow_modmask, int ctrlv) /* c was typed after CTRL-V */ { char_u *p; int len; /* * Special function key, translate into "". 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 , * 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, -1); 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 /* * "flags": INSCHAR_FORMAT - force formatting * INSCHAR_CTRLV - char typed just after CTRL-V * INSCHAR_NO_FEX - don't use 'formatexpr' * * NOTE: passes the flags value straight through to internal_format() which, * beside INSCHAR_FORMAT (above), is also looking for these: * INSCHAR_DO_COM - format comments * INSCHAR_COM_LIST - format comments with num list or 2nd line indent */ void insertchar( int c, /* character to insert or NUL */ int flags, /* INSCHAR_FORMAT, etc. */ int second_indent) /* indent for second line if >= 0 */ { int textwidth; #ifdef FEAT_COMMENTS char_u *p; #endif int fo_ins_blank; int force_format = flags & INSCHAR_FORMAT; textwidth = comp_textwidth(force_format); fo_ins_blank = has_format_option(FO_INS_BLANK); /* * 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 > 0 && (force_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 )))))) { /* Format with 'formatexpr' when it's set. Use internal formatting * when 'formatexpr' isn't set or it returns non-zero. */ #if defined(FEAT_EVAL) int do_internal = TRUE; colnr_T virtcol = get_nolist_virtcol() + char2cells(c != NUL ? c : gchar_cursor()); if (*curbuf->b_p_fex != NUL && (flags & INSCHAR_NO_FEX) == 0 && (force_format || virtcol > (colnr_T)textwidth)) { do_internal = (fex_format(curwin->w_cursor.lnum, 1L, c) != 0); /* It may be required to save for undo again, e.g. when setline() * was called. */ ins_need_undo = TRUE; } if (do_internal) #endif internal_format(textwidth, second_indent, flags, c == NUL, c); } 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, TRUE); 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).. * Don't do this when there an InsertCharPre autocommand is defined, * because we need to fire the event for every character. */ #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 #ifdef FEAT_AUTOCMD && !has_insertcharpre() #endif ) { #define INPUT_BUFLEN 100 char_u buf[INPUT_BUFLEN + 1]; int i; colnr_T virtcol = 0; buf[0] = c; i = 1; if (textwidth > 0) 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, -1); } else { #ifdef FEAT_MBYTE int cc; 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); } } } /* * Format text at the current insert position. * * If the INSCHAR_COM_LIST flag is present, then the value of second_indent * will be the comment leader length sent to open_line(). */ static void internal_format( int textwidth, int second_indent, int flags, int format_only, int c) /* character to be inserted (can be NUL) */ { int cc; int save_char = NUL; int haveto_redraw = FALSE; int fo_ins_blank = has_format_option(FO_INS_BLANK); #ifdef FEAT_MBYTE int fo_multibyte = has_format_option(FO_MBYTE_BREAK); #endif int fo_white_par = has_format_option(FO_WHITE_PAR); int first_line = TRUE; #ifdef FEAT_COMMENTS colnr_T leader_len; int no_leader = FALSE; int do_comments = (flags & INSCHAR_DO_COM); #endif #ifdef FEAT_LINEBREAK int has_lbr = curwin->w_p_lbr; /* make sure win_lbr_chartabsize() counts correctly */ curwin->w_p_lbr = FALSE; #endif /* * 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 #ifdef FEAT_VREPLACE && !(State & VREPLACE_FLAG) #endif ) { 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; colnr_T end_col; virtcol = get_nolist_virtcol() + char2cells(c != NUL ? c : gchar_cursor()); 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, TRUE); 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)) 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; 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)) || (flags & INSCHAR_FORMAT) || curwin->w_cursor.lnum != Insstart.lnum || curwin->w_cursor.col >= Insstart.col) { if (curwin->w_cursor.col == startcol && c != NUL) cc = c; else cc = gchar_cursor(); if (WHITECHAR(cc)) { /* remember position of blank just before text */ end_col = 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 */ #ifdef FEAT_COMMENTS /* do not break "#a b" when 'tw' is 2 */ if (curwin->w_cursor.col <= leader_len) break; #endif col = curwin->w_cursor.col; dec_cursor(); cc = gchar_cursor(); if (WHITECHAR(cc)) continue; /* one-letter, continue */ curwin->w_cursor.col = col; } inc_cursor(); end_foundcol = end_col + 1; foundcol = curwin->w_cursor.col; if (curwin->w_cursor.col <= (colnr_T)wantcol) break; } #ifdef FEAT_MBYTE else if (cc >= 0x100 && fo_multibyte) { /* Break after or before a multi-byte character. */ if (curwin->w_cursor.col != startcol) { #ifdef FEAT_COMMENTS /* Don't break until after the comment leader */ if (curwin->w_cursor.col < leader_len) break; #endif col = curwin->w_cursor.col; inc_cursor(); /* Don't change end_foundcol if already set. */ if (foundcol != curwin->w_cursor.col) { foundcol = curwin->w_cursor.col; end_foundcol = foundcol; if (curwin->w_cursor.col <= (colnr_T)wantcol) break; } curwin->w_cursor.col = col; } if (curwin->w_cursor.col == 0) break; col = curwin->w_cursor.col; dec_cursor(); cc = gchar_cursor(); if (WHITECHAR(cc)) continue; /* break with space */ #ifdef FEAT_COMMENTS /* Don't break until after the comment leader */ if (curwin->w_cursor.col < leader_len) break; #endif curwin->w_cursor.col = col; foundcol = curwin->w_cursor.col; end_foundcol = foundcol; if (curwin->w_cursor.col <= (colnr_T)wantcol) 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; /* * 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)) && (!fo_white_par || curwin->w_cursor.col < startcol)) 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) + ((flags & INSCHAR_COM_LIST) ? OPENLINE_COM_LIST : 0) #endif , ((flags & INSCHAR_COM_LIST) ? second_indent : old_indent)); if (!(flags & INSCHAR_COM_LIST)) old_indent = 0; replace_offset = 0; if (first_line) { if (!(flags & INSCHAR_COM_LIST)) { /* * This section is for auto-wrap of numeric lists. When not * in insert mode (i.e. format_lines()), the INSCHAR_COM_LIST * flag will be set and open_line() will handle it (as seen * above). The code here (and in get_number_indent()) will * recognize comments if needed... */ 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, TRUE); else #endif #ifdef FEAT_COMMENTS if (leader_len > 0 && second_indent - leader_len > 0) { int i; int padding = second_indent - leader_len; /* We started at the first_line of a numbered list * that has a comment. the open_line() function has * inserted the proper comment leader and positioned * the cursor at the end of the split line. Now we * add the additional whitespace needed after the * comment leader for the numbered list. */ for (i = 0; i < padding; i++) ins_str((char_u *)" "); changed_bytes(curwin->w_cursor.lnum, leader_len); } else { #endif (void)set_indent(second_indent, SIN_CHANGED); #ifdef FEAT_COMMENTS } #endif } } 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 != NUL) /* put back space after cursor */ pchar_cursor(save_char); #ifdef FEAT_LINEBREAK curwin->w_p_lbr = has_lbr; #endif if (!format_only && haveto_redraw) { update_topline(); redraw_curbuf_later(VALID); } } /* * 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( 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; int cc; 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 == (colnr_T)STRLEN(old)); if (*old != NUL && !trailblank && wasatend) { dec_cursor(); cc = gchar_cursor(); if (!WHITECHAR(cc) && curwin->w_cursor.col > 0 && has_format_option(FO_ONE_LETTER)) dec_cursor(); cc = gchar_cursor(); if (WHITECHAR(cc)) { 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, TRUE) == 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, FALSE); 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 = (colnr_T)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( int end_insert) /* TRUE when ending Insert mode */ { int c = ' '; int cc; if (did_add_space) { cc = gchar_cursor(); if (!WHITECHAR(cc)) /* 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( int ff) /* force formatting (for "gq" 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 || curwin->w_buffer->b_has_sign_column # endif ) textwidth -= 1; #endif if (curwin->w_p_nu || curwin->w_p_rnu) 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(int c) { char_u buf[10]; /* Only digits need special treatment. Translate them into a string of * three digits. */ if (VIM_ISDIGIT(c)) { vim_snprintf((char *)buf, sizeof(buf), "%03d", c); AppendToRedobuff(buf); } else AppendCharToRedobuff(c); } /* * start_arrow() is called when an arrow key is used in insert mode. * For undo/redo it resembles hitting the key. */ static void start_arrow( pos_T *end_insert_pos) /* can be NULL */ { start_arrow_common(end_insert_pos, TRUE); } /* * Like start_arrow() but with end_change argument. * Will prepare for redo of CTRL-G U if "end_change" is FALSE. */ static void start_arrow_with_change( pos_T *end_insert_pos, /* can be NULL */ int end_change) /* end undoable change */ { start_arrow_common(end_insert_pos, end_change); if (!end_change) { AppendCharToRedobuff(Ctrl_G); AppendCharToRedobuff('U'); } } static void start_arrow_common( pos_T *end_insert_pos, /* can be NULL */ int end_change) /* end undoable change */ { if (!arrow_used && end_change) /* something has been inserted */ { AppendToRedobuff(ESC_STR); stop_insert(end_insert_pos, FALSE, FALSE); arrow_used = TRUE; /* this means we stopped the current insert */ } #ifdef FEAT_SPELL check_spell_redraw(); #endif } #ifdef FEAT_SPELL /* * If we skipped highlighting word at cursor, do it now. * It may be skipped again, thus reset spell_redraw_lnum first. */ static void check_spell_redraw(void) { if (spell_redraw_lnum != 0) { linenr_T lnum = spell_redraw_lnum; spell_redraw_lnum = 0; redrawWinline(lnum, FALSE); } } /* * Called when starting CTRL_X_SPELL mode: Move backwards to a previous badly * spelled word, if there is one. */ static void spell_back_to_badword(void) { pos_T tpos = curwin->w_cursor; spell_bad_len = spell_move_to(curwin, BACKWARD, TRUE, TRUE, NULL); if (curwin->w_cursor.col != tpos.col) start_arrow(&tpos); } #endif /* * 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(void) { if (arrow_used) { Insstart = curwin->w_cursor; /* new insertion starts here */ if (Insstart.col > Insstart_orig.col && !ins_need_undo) /* Don't update the original insert position when moved to the * right, except when nothing was inserted yet. */ update_Insstart_orig = FALSE; Insstart_textlen = (colnr_T)linetabsize(ml_get_curline()); if (u_save_cursor() == OK) { arrow_used = FALSE; ins_need_undo = FALSE; } 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 */ new_insert_skip = 2; } 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. * "end_insert_pos" is where insert ended. It is NULL when we already jumped * to another window/buffer. */ static void stop_insert( pos_T *end_insert_pos, int esc, /* called by ins_esc() */ int nomove) /* , don't move cursor */ { int cc; char_u *ptr; stop_redo_ins(); replace_flush(); /* abandon replace stack */ /* * Save the inserted text for later redo with ^@ and CTRL-A. * Don't do it when "restart_edit" was set and nothing was inserted, * otherwise CTRL-O w and then will clear "last_insert". */ ptr = get_inserted(); if (did_restart_edit == 0 || (ptr != NULL && (int)STRLEN(ptr) > new_insert_skip)) { vim_free(last_insert); last_insert = ptr; last_insert_skip = new_insert_skip; } else vim_free(ptr); if (!arrow_used && end_insert_pos != NULL) { /* 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 && has_format_option(FO_AUTO)) { pos_T tpos = curwin->w_cursor; /* 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)) curwin->w_cursor = tpos; } auto_format(TRUE, FALSE); if (vim_iswhite(cc)) { if (gchar_cursor() != NUL) inc_cursor(); #ifdef FEAT_VIRTUALEDIT /* If the cursor is still at the same character, also keep * the "coladd". */ if (gchar_cursor() == NUL && curwin->w_cursor.lnum == tpos.lnum && curwin->w_cursor.col == tpos.col) curwin->w_cursor.coladd = tpos.coladd; #endif } } /* 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. * Do this when ESC was used or moving the cursor up/down. * Check for the old position still being valid, just in case the text * got changed unexpectedly. */ if (!nomove && did_ai && (esc || (vim_strchr(p_cpo, CPO_INDENT) == NULL && curwin->w_cursor.lnum != end_insert_pos->lnum)) && end_insert_pos->lnum <= curbuf->b_ml.ml_line_count) { pos_T tpos = curwin->w_cursor; curwin->w_cursor = *end_insert_pos; check_cursor_col(); /* make sure it is not past the line */ for (;;) { if (gchar_cursor() == NUL && curwin->w_cursor.col > 0) --curwin->w_cursor.col; cc = gchar_cursor(); if (!vim_iswhite(cc)) break; if (del_char(TRUE) == FAIL) break; /* should not happen */ } if (curwin->w_cursor.lnum != tpos.lnum) curwin->w_cursor = tpos; else { /* reset tpos, could have been invalidated in the loop above */ tpos = curwin->w_cursor; tpos.col++; if (cc != NUL && gchar_pos(&tpos) == NUL) ++curwin->w_cursor.col; /* put cursor back on the NUL */ } /* may have started Visual mode, adjust the position for * deleted characters. */ if (VIsual_active && VIsual.lnum == curwin->w_cursor.lnum) { int len = (int)STRLEN(ml_get_curline()); if (VIsual.col > len) { VIsual.col = len; #ifdef FEAT_VIRTUALEDIT VIsual.coladd = 0; #endif } } } } did_ai = FALSE; #ifdef FEAT_SMARTINDENT did_si = FALSE; can_si = FALSE; can_si_back = FALSE; #endif /* Set '[ and '] to the inserted text. When end_insert_pos is NULL we are * now in a different buffer. */ if (end_insert_pos != NULL) { curbuf->b_op_start = Insstart; curbuf->b_op_start_orig = Insstart_orig; 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(int c) { char_u *s; vim_free(last_insert); last_insert = alloc(MB_MAXBYTES * 3 + 5); 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; } } #if defined(EXITFREE) || defined(PROTO) void free_last_insert(void) { vim_free(last_insert); last_insert = NULL; # ifdef FEAT_INS_EXPAND vim_free(compl_orig_text); compl_orig_text = NULL; # endif } #endif /* * 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(int c, char_u *s) { #ifdef FEAT_MBYTE char_u temp[MB_MAXBYTES + 1]; 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(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, unless it is allowed. * Return OK when successful, FAIL when we hit a line of file boundary. */ int oneright(void) { char_u *ptr; int l; #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(); if (*ptr == NUL) return FAIL; /* already at the very end */ #ifdef FEAT_MBYTE if (has_mbyte) l = (*mb_ptr2len)(ptr); else #endif l = 1; /* move "l" bytes right, but don't end up on the NUL, unless 'virtualedit' * contains "onemore". */ if (ptr[l] == NUL #ifdef FEAT_VIRTUALEDIT && (ve_flags & VE_ONEMORE) == 0 #endif ) return FAIL; curwin->w_cursor.col += l; curwin->w_set_curswant = TRUE; return OK; } int oneleft(void) { #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, * 'breakindent' is not set and there are no multi-byte * characters */ if ((*p_sbr == NUL && !curwin->w_p_bri # 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( long n, int upd_topline) /* When TRUE: update topline */ { linenr_T lnum; if (n > 0) { lnum = curwin->w_cursor.lnum; /* This fails if the cursor is already in the first line or the count * is larger than the line number and '-' is in 'cpoptions' */ if (lnum <= 1 || (n >= lnum && vim_strchr(p_cpo, CPO_MINUS) != NULL)) 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 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( 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 /* This fails if the cursor is already in the last line or would move * beyond the last line and '-' is in 'cpoptions' */ if (lnum >= curbuf->b_ml.ml_line_count || (lnum + n > curbuf->b_ml.ml_line_count && vim_strchr(p_cpo, CPO_MINUS) != NULL)) 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( 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 "048", "^" as "^" */ 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(void) { if (last_insert == NULL) return NULL; return last_insert + last_insert_skip; } /* * Get last inserted string, and remove trailing . * Returns pointer to allocated memory (must be freed) or NULL. */ char_u * get_last_insert_save(void) { 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(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. */ static char_u *replace_stack = NULL; static long replace_stack_nr = 0; /* next entry in replace stack */ static long replace_stack_len = 0; /* max. number of entries */ void replace_push( 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; } #if defined(FEAT_MBYTE) || defined(PROTO) /* * Push a character onto the replace stack. Handles a multi-byte character in * reverse byte order, so that the first byte is popped off first. * Return the number of bytes done (includes composing characters). */ int replace_push_mb(char_u *p) { int l = (*mb_ptr2len)(p); int j; for (j = l - 1; j >= 0; --j) replace_push(p[j]); return l; } #endif /* * Pop one item from the replace stack. * return -1 if stack empty * return replaced character or NUL otherwise */ static int replace_pop(void) { 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( 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(void) { 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(int cc) { int n; char_u buf[MB_MAXBYTES + 1]; 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(void) { 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 * When "limit_col" is >= 0, don't delete before this column. Matters when * using composing characters, use del_char_after_col() instead of del_char(). */ static void replace_do_bs(int limit_col) { 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) { (void)del_char_after_col(limit_col); # ifdef FEAT_VREPLACE if (State & VREPLACE_FLAG) orig_len = (int)STRLEN(ml_get_cursor()); # endif replace_push(cc); } else #endif { pchar_cursor(cc); #ifdef FEAT_VREPLACE if (State & VREPLACE_FLAG) orig_len = (int)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 = (int)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)(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_after_col(limit_col); } #ifdef FEAT_CINDENT /* * Return TRUE if C-indenting is on. */ static int cindent_on(void) { 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(int (*get_the_indent)(void)) { int amount = get_the_indent(); if (amount >= 0) { change_indent(INDENT_SET, amount, FALSE, 0, TRUE); if (linewhite(curwin->w_cursor.lnum)) did_ai = TRUE; /* delete the indent if the line stays empty */ } } void fix_indent(void) { 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 preceded 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( 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; if (keytyped == NUL) /* Can happen with CTRL-Y and CTRL-E on a short line. */ return FALSE; #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, FALSE) || cin_isscopedecl(p) || cin_islabel()) return TRUE; /* Need to get the line again after cin_islabel(). */ p = ml_get_curline(); 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, FALSE) || cin_isscopedecl(p) || cin_islabel()); 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 , , , <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(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(void) { int need_redraw = FALSE; int regname; int literally = 0; int vis_active = VIsual_active; /* * 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(FALSE); 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 = plain_vgetc(); LANGMAP_ADJUST(regname, TRUE); 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 = plain_vgetc(); LANGMAP_ADJUST(regname, TRUE); } --no_mapping; #ifdef FEAT_EVAL /* Don't call u_sync() while typing the expression or giving an error * message for it. Only call it explicitly. */ ++no_u_sync; if (regname == '=') { # ifdef USE_IM_CONTROL int im_on = im_get_status(); # endif /* Sync undo when evaluating the expression calls setline() or * append(), so that it can be undone separately. */ u_sync_once = 2; regname = get_expr_register(); # ifdef USE_IM_CONTROL /* Restore the Input Method. */ if (im_on) im_set_active(TRUE); # endif } if (regname == NUL || !valid_yank_reg(regname, FALSE)) { vim_beep(BO_REG); 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(BO_REG); need_redraw = TRUE; /* remove the '"' */ } else if (stop_insert_mode) /* When the '=' register was used and a function was invoked that * did ":stopinsert" then stuff_empty() returns FALSE but we won't * insert anything, need to remove the '"' */ need_redraw = TRUE; #ifdef FEAT_EVAL } --no_u_sync; if (u_sync_once == 1) ins_need_undo = TRUE; u_sync_once = 0; #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(); /* Disallow starting Visual mode here, would get a weird mode. */ if (!vis_active && VIsual_active) end_visual_mode(); } /* * CTRL-G commands in Insert mode. */ static void ins_ctrl_g(void) { 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 = plain_vgetc(); --no_mapping; switch (c) { /* CTRL-G k and CTRL-G : cursor up to Insstart.col */ case K_UP: case Ctrl_K: case 'k': ins_up(TRUE); break; /* CTRL-G j and CTRL-G : 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(TRUE); ins_need_undo = TRUE; /* Need to reset Insstart, esp. because a BS that joins * a line to the previous one must save for undo. */ update_Insstart_orig = FALSE; Insstart = curwin->w_cursor; break; /* CTRL-G U: do not break undo with the next char */ case 'U': /* Allow one left/right cursor movement with the next char, * without breaking undo. */ dont_sync_undo = MAYBE; break; /* Unknown CTRL-G command, reserved for future expansion. */ default: vim_beep(BO_CTRLG); } } /* * CTRL-^ in Insert mode. */ static void ins_ctrl_hat(void) { if (map_to_exists_mode((char_u *)"", LANGMAP, FALSE)) { /* ":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 } /* * Handle ESC in insert mode. * Returns TRUE when leaving insert mode, FALSE when going to repeat the * insert. */ static int ins_esc( long *count, int cmdchar, int nomove) /* don't move cursor */ { int temp; static int disabled_redraw = FALSE; #ifdef FEAT_SPELL check_spell_redraw(); #endif #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 temp = curwin->w_cursor.col; if (disabled_redraw) { --RedrawingDisabled; disabled_redraw = FALSE; } if (!arrow_used) { /* * Don't append the ESC for "r" and "grx". * When 'insertmode' is set only CTRL-L stops Insert mode. Needed for * when "count" is non-zero. */ if (cmdchar != 'r' && cmdchar != 'v') AppendToRedobuff(p_im ? (char_u *)"\014" : 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 */ { /* Vi repeats the insert without replacing characters. */ if (vim_strchr(p_cpo, CPO_REPLCNT) != NULL) State &= ~REPLACE_FLAG; (void)start_redo_ins(); if (cmdchar == 'r' || cmdchar == 'v') stuffRedoReadbuff(ESC_STR); /* no ESC in redo buffer */ ++RedrawingDisabled; disabled_redraw = TRUE; return FALSE; /* repeat the insert */ } stop_insert(&curwin->w_cursor, TRUE, nomove); 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. * Don't do it for CTRL-O, unless past the end of the line. */ if (!nomove && (curwin->w_cursor.col != 0 #ifdef FEAT_VIRTUALEDIT || curwin->w_cursor.coladd > 0 #endif ) && (restart_edit == NUL || (gchar_cursor() == NUL && !VIsual_active)) #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_(void) { 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 /* * If 'keymodel' contains "startsel", may start selection. * Returns TRUE when a CTRL-O and other keys stuffed. */ static int ins_start_select(int c) { if (km_startsel) switch (c) { case K_KHOME: case K_KEND: 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; } /* * key in Insert mode: toggle insert/replace mode. */ static void ins_insert(int replaceState) { #ifdef FEAT_FKMAP if (p_fkmap && p_ri) { beep_flush(); EMSG(farsi_text_3); /* encoded in Farsi */ return; } #endif #ifdef FEAT_AUTOCMD # ifdef FEAT_EVAL set_vim_var_string(VV_INSERTMODE, (char_u *)((State & REPLACE_FLAG) ? "i" : # ifdef FEAT_VREPLACE replaceState == VREPLACE ? "v" : # endif "r"), 1); # endif apply_autocmds(EVENT_INSERTCHANGE, NULL, NULL, FALSE, curbuf); #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 } /* * Pressed CTRL-O in Insert mode. */ static void ins_ctrl_o(void) { #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()) ins_at_eol = FALSE; /* cursor always keeps its column */ else #endif ins_at_eol = (gchar_cursor() == NUL); } /* * 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 'shiftwidth', this is compatible * with vi. But vi only supports ^T and ^D after an * autoindent, we support it everywhere. */ static void ins_shift(int c, int lastc) { if (stop_arrow() == FAIL) return; AppendCharToRedobuff(c); /* * 0^D and ^^D: remove all indent. */ if (c == Ctrl_D && (lastc == '0' || lastc == '^') && curwin->w_cursor.col > 0) { --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, TRUE); } else change_indent(c == Ctrl_D ? INDENT_DEC : INDENT_INC, 0, TRUE, 0, TRUE); 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(void) { 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 */ || do_join(2, FALSE, TRUE, FALSE, FALSE) == FAIL) vim_beep(BO_BS); else curwin->w_cursor.col = temp; } else if (del_char(FALSE) == FAIL) /* delete char under cursor */ vim_beep(BO_BS); did_ai = FALSE; #ifdef FEAT_SMARTINDENT did_si = FALSE; can_si = FALSE; can_si_back = FALSE; #endif AppendCharToRedobuff(K_DEL); } static void ins_bs_one(colnr_T *vcolp); /* * Delete one character for ins_bs(). */ static void ins_bs_one(colnr_T *vcolp) { dec_cursor(); getvcol(curwin, &curwin->w_cursor, vcolp, 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) replace_do_bs(-1); } else (void)del_char(FALSE); } /* * Handle Backspace, delete-word and delete-line in Insert mode. * Return TRUE when backspace was actually used. */ static int ins_bs( int c, int mode, int *inserted_space_p) { linenr_T lnum; int cc; int temp = 0; /* init for GCC */ colnr_T save_col; colnr_T mincol; int did_backspace = FALSE; int in_indent; int oldState; #ifdef FEAT_MBYTE int cpc[MAX_MCO]; /* composing characters */ #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_orig.lnum && curwin->w_cursor.col <= Insstart_orig.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(BO_BS); 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 == 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; /* When "aw" is in 'formatoptions' we must delete the space at * the end of the line, otherwise the line will be broken * again when auto-formatting. */ if (has_format_option(FO_AUTO) && has_format_option(FO_WHITE_PAR)) { char_u *ptr = ml_get_buf(curbuf, curwin->w_cursor.lnum, TRUE); int len; len = (int)STRLEN(ptr); if (len > 0 && ptr[len - 1] == ' ') ptr[len - 1] = NUL; } (void)do_join(2, FALSE, FALSE, FALSE, 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) { save_col = curwin->w_cursor.col; #ifdef FEAT_MBYTE mb_replace_pop_ins(cc); #else ins_char(cc); #endif curwin->w_cursor.col = save_col; 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_CINDENT || cindent_on() #endif ) #ifdef FEAT_RIGHTLEFT && !revins_on #endif ) { save_col = curwin->w_cursor.col; beginline(BL_WHITE); if (curwin->w_cursor.col < save_col) mincol = curwin->w_cursor.col; curwin->w_cursor.col = save_col; } /* * Handle deleting one 'shiftwidth' or 'softtabstop'. */ if ( mode == BACKSPACE_CHAR && ((p_sta && in_indent) || (get_sts_value() != 0 && curwin->w_cursor.col > 0 && (*(ml_get_cursor() - 1) == TAB || (*(ml_get_cursor() - 1) == ' ' && (!*inserted_space_p || arrow_used)))))) { int ts; colnr_T vcol; colnr_T want_vcol; colnr_T start_vcol; *inserted_space_p = FALSE; if (p_sta && in_indent) ts = (int)get_sw_value(curbuf); else ts = (int)get_sts_value(); /* 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); start_vcol = vcol; 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))) ins_bs_one(&vcol); /* 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_orig.lnum && curwin->w_cursor.col < Insstart_orig.col) Insstart_orig.col = curwin->w_cursor.col; #ifdef FEAT_VREPLACE if (State & VREPLACE_FLAG) ins_char(' '); else #endif { ins_str((char_u *)" "); if ((State & REPLACE_FLAG)) replace_push(NUL); } getvcol(curwin, &curwin->w_cursor, &vcol, NULL, NULL); } /* If we are now back where we started delete one character. Can * happen when using 'sts' and 'linebreak'. */ if (vcol >= start_vcol) ins_bs_one(&vcol); } /* * Delete upto starting point, start of line or previous word. */ else { #ifdef FEAT_MBYTE int cclass = 0, prev_cclass = 0; if (has_mbyte) cclass = mb_get_class(ml_get_cursor()); #endif do { #ifdef FEAT_RIGHTLEFT if (!revins_on) /* put cursor on char to be deleted */ #endif dec_cursor(); cc = gchar_cursor(); #ifdef FEAT_MBYTE /* look multi-byte character class */ if (has_mbyte) { prev_cclass = cclass; cclass = mb_get_class(ml_get_cursor()); } #endif /* start of word? */ if (mode == BACKSPACE_WORD && !vim_isspace(cc)) { mode = BACKSPACE_WORD_NOT_SPACE; temp = vim_iswordc(cc); } /* end of word? */ else if (mode == BACKSPACE_WORD_NOT_SPACE && ((vim_isspace(cc) || vim_iswordc(cc) != temp) #ifdef FEAT_MBYTE || prev_cclass != cclass #endif )) { #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(-1); else { #ifdef FEAT_MBYTE if (enc_utf8 && p_deco) (void)utfc_ptr2char(ml_get_cursor(), cpc); #endif (void)del_char(FALSE); #ifdef FEAT_MBYTE /* * If there are combining characters and 'delcombine' is set * move the cursor back. Don't back up before the base * character. */ if (enc_utf8 && p_deco && cpc[0] != 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_orig.lnum || curwin->w_cursor.col != Insstart_orig.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_orig.lnum && curwin->w_cursor.col < Insstart_orig.col) Insstart_orig.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 == -1) dollar_vcol = curwin->w_virtcol; #ifdef FEAT_FOLDING /* When deleting a char the cursor line must never be in a closed fold. * E.g., when 'foldmethod' is indent and deleting the first non-white * char before a Tab. */ if (did_backspace) foldOpenCursor(); #endif return did_backspace; } #ifdef FEAT_MOUSE static void ins_mouse(int c) { pos_T tpos; win_T *old_curwin = curwin; # 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)) { #ifdef FEAT_WINDOWS win_T *new_curwin = curwin; if (curwin != old_curwin && win_valid(old_curwin)) { /* Mouse took us to another window. We need to go back to the * previous one to stop insert there properly. */ curwin = old_curwin; curbuf = curwin->w_buffer; } #endif start_arrow(curwin == old_curwin ? &tpos : NULL); #ifdef FEAT_WINDOWS if (curwin != new_curwin && win_valid(new_curwin)) { curwin = new_curwin; curbuf = curwin->w_buffer; } #endif # 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(int dir) { pos_T tpos; # if defined(FEAT_WINDOWS) win_T *old_curwin = curwin; # endif # ifdef FEAT_INS_EXPAND int did_scroll = FALSE; # endif tpos = curwin->w_cursor; # ifdef FEAT_WINDOWS if (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(); # ifdef FEAT_INS_EXPAND /* Don't scroll the window in which completion is being done. */ if (!pum_visible() # if defined(FEAT_WINDOWS) || curwin != old_curwin # endif ) # endif { if (dir == MSCR_DOWN || dir == MSCR_UP) { if (mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL)) scroll_redraw(dir, (long)(curwin->w_botline - curwin->w_topline)); else scroll_redraw(dir, 3L); } #ifdef FEAT_GUI else { int val, step = 6; if (mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL)) step = W_WIDTH(curwin); val = curwin->w_leftcol + (dir == MSCR_RIGHT ? -step : step); if (val < 0) val = 0; gui_do_horiz_scroll(val, TRUE); } #endif # ifdef FEAT_INS_EXPAND did_scroll = TRUE; # endif } # ifdef FEAT_WINDOWS curwin->w_redr_status = TRUE; curwin = old_curwin; curbuf = curwin->w_buffer; # endif # ifdef FEAT_INS_EXPAND /* The popup menu may overlay the window, need to redraw it. * TODO: Would be more efficient to only redraw the windows that are * overlapped by the popup menu. */ if (pum_visible() && did_scroll) { redraw_all_later(NOT_VALID); ins_compl_show_pum(); } # endif if (!equalpos(curwin->w_cursor, tpos)) { start_arrow(&tpos); # ifdef FEAT_CINDENT can_cindent = TRUE; # endif } } #endif #if defined(FEAT_GUI_TABLINE) || defined(PROTO) static void ins_tabline(int c) { /* We will be leaving the current window, unless closing another tab. */ if (c != K_TABMENU || current_tabmenu != TABLINE_MENU_CLOSE || (current_tab != 0 && current_tab != tabpage_index(curtab))) { undisplay_dollar(); start_arrow(&curwin->w_cursor); # ifdef FEAT_CINDENT can_cindent = TRUE; # endif } if (c == K_TABLINE) goto_tabpage(current_tab); else { handle_tabmenu(); redraw_statuslines(); /* will redraw the tabline when needed */ } } #endif #if defined(FEAT_GUI) || defined(PROTO) void ins_scroll(void) { 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(void) { pos_T tpos; undisplay_dollar(); tpos = curwin->w_cursor; if (gui_do_horiz_scroll(scrollbar_value, FALSE)) { start_arrow(&tpos); # ifdef FEAT_CINDENT can_cindent = TRUE; # endif } } #endif static void ins_left( int end_change) /* end undoable change */ { pos_T tpos; #ifdef FEAT_FOLDING if ((fdo_flags & FDO_HOR) && KeyTyped) foldOpenCursor(); #endif undisplay_dollar(); tpos = curwin->w_cursor; if (oneleft() == OK) { #if defined(FEAT_XIM) && defined(FEAT_GUI_GTK) /* Only call start_arrow() when not busy with preediting, it will * break undo. K_LEFT is inserted in im_correct_cursor(). */ if (!im_is_preediting()) #endif { start_arrow_with_change(&tpos, end_change); if (!end_change) AppendCharToRedobuff(K_LEFT); } #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) { /* always break undo when moving upwards/downwards, else undo may break */ 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(BO_CRSR); dont_sync_undo = FALSE; } static void ins_home(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(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(void) { #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(BO_CRSR); } static void ins_right( int end_change) /* end undoable change */ { #ifdef FEAT_FOLDING if ((fdo_flags & FDO_HOR) && KeyTyped) foldOpenCursor(); #endif undisplay_dollar(); if (gchar_cursor() != NUL #ifdef FEAT_VIRTUALEDIT || virtual_active() #endif ) { start_arrow_with_change(&curwin->w_cursor, end_change); if (!end_change) AppendCharToRedobuff(K_RIGHT); 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)(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(BO_CRSR); dont_sync_undo = FALSE; } static void ins_s_right(void) { #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(BO_CRSR); } static void ins_up( 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(BO_CRSR); } static void ins_pageup(void) { pos_T tpos; undisplay_dollar(); #ifdef FEAT_WINDOWS if (mod_mask & MOD_MASK_CTRL) { /* : tab page back */ if (first_tabpage->tp_next != NULL) { start_arrow(&curwin->w_cursor); goto_tabpage(-1); } return; } #endif tpos = curwin->w_cursor; if (onepage(BACKWARD, 1L) == OK) { start_arrow(&tpos); #ifdef FEAT_CINDENT can_cindent = TRUE; #endif } else vim_beep(BO_CRSR); } static void ins_down( 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(BO_CRSR); } static void ins_pagedown(void) { pos_T tpos; undisplay_dollar(); #ifdef FEAT_WINDOWS if (mod_mask & MOD_MASK_CTRL) { /* : tab page forward */ if (first_tabpage->tp_next != NULL) { start_arrow(&curwin->w_cursor); goto_tabpage(0); } return; } #endif tpos = curwin->w_cursor; if (onepage(FORWARD, 1L) == OK) { start_arrow(&tpos); #ifdef FEAT_CINDENT can_cindent = TRUE; #endif } else vim_beep(BO_CRSR); } #ifdef FEAT_DND static void ins_drop(void) { 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(void) { 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 != get_sw_value(curbuf)) && get_sts_value() == 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)get_sw_value(curbuf); else if (curbuf->b_p_sts != 0) /* use 'softtabstop' when set */ temp = (int)get_sts_value(); 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 && (get_sts_value() || (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 'breakindent', 'showbreak' * and 'linebreak' adding extra virtual columns. */ while (vim_iswhite(*ptr)) { i = lbr_chartabsize(NULL, (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; char_u *line = ptr; /* Skip over the spaces we need. */ while (vcol < want_vcol && *ptr == ' ') { vcol += lbr_chartabsize(line, 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) { STRMOVE(ptr, ptr + i); /* correct replace stack. */ if ((State & REPLACE_FLAG) #ifdef FEAT_VREPLACE && !(State & VREPLACE_FLAG) #endif ) for (temp = i; --temp >= 0; ) replace_join(repl_off); } #ifdef FEAT_NETBEANS_INTG if (netbeans_active()) { netbeans_removed(curbuf, fpos.lnum, cursor->col, (long)(i + 1)); netbeans_inserted(curbuf, fpos.lnum, cursor->col, (char_u *)"\t", 1); } #endif 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(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_VIRTUALEDIT /* Put cursor on NUL if on the last char and coladd is 1 (happens after * CTRL-O). */ if (virtual_active() && curwin->w_cursor.coladd > 0) coladvance(getviscol()); #endif #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 #ifdef FEAT_FOLDING /* When inserting a line the cursor line must never be in a closed fold. */ foldOpenCursor(); #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(void) { int c; int cc; int did_putchar = FALSE; pc_status = PC_STATUS_UNSET; if (redrawing() && !char_avail()) { /* may need to redraw when no more chars available now */ ins_redraw(FALSE); edit_putchar('?', TRUE); did_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 = plain_vgetc(); --no_mapping; --allow_keys; if (did_putchar) /* when the line fits in 'columns' the '?' is at the start of the next * line and will not be removed by the redraw */ edit_unputchar(); 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) { did_putchar = FALSE; if (redrawing() && !char_avail()) { /* may need to redraw when no more chars available now */ ins_redraw(FALSE); if (char2cells(c) == 1) { ins_redraw(FALSE); edit_putchar(c, TRUE); did_putchar = TRUE; } #ifdef FEAT_CMDL_INFO add_to_showcmd_c(c); #endif } ++no_mapping; ++allow_keys; cc = plain_vgetc(); --no_mapping; --allow_keys; if (did_putchar) /* when the line fits in 'columns' the '?' is at the start of the * next line and will not be removed by a redraw */ edit_unputchar(); if (cc != ESC) { AppendToRedobuff((char_u *)CTRL_V_STR); c = getdigraph(c, cc, TRUE); #ifdef FEAT_CMDL_INFO clear_showcmd(); #endif return c; } } #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. */ int ins_copychar(linenr_T lnum) { int c; int temp; char_u *ptr, *prev_ptr; char_u *line; if (lnum < 1 || lnum > curbuf->b_ml.ml_line_count) { vim_beep(BO_COPY); return NUL; } /* try to advance to the cursor column */ temp = 0; line = 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(line, &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(BO_COPY); return c; } /* * CTRL-Y or CTRL-E typed in Insert mode. */ static int ins_ctrl_ey(int tc) { int c = tc; #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); } } return c; } #ifdef FEAT_SMARTINDENT /* * Try to do some very smart auto-indenting. * Used when inserting a "normal" character. */ static void ins_try_si(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, TRUE); 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, TRUE); } } /* * 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(void) { if (curwin->w_p_list && vim_strchr(p_cpo, CPO_LISTWM) == NULL) return getvcol_nolist(&curwin->w_cursor); validate_virtcol(); return curwin->w_virtcol; } #ifdef FEAT_AUTOCMD /* * Handle the InsertCharPre autocommand. * "c" is the character that was typed. * Return a pointer to allocated memory with the replacement string. * Return NULL to continue inserting "c". */ static char_u * do_insert_char_pre(int c) { char_u *res; char_u buf[MB_MAXBYTES + 1]; /* Return quickly when there is nothing to do. */ if (!has_insertcharpre()) return NULL; #ifdef FEAT_MBYTE if (has_mbyte) buf[(*mb_char2bytes)(c, buf)] = NUL; else #endif { buf[0] = c; buf[1] = NUL; } /* Lock the text to avoid weird things from happening. */ ++textlock; set_vim_var_string(VV_CHAR, buf, -1); /* set v:char */ res = NULL; if (apply_autocmds(EVENT_INSERTCHARPRE, NULL, NULL, FALSE, curbuf)) { /* Get the value of v:char. It may be empty or more than one * character. Only use it when changed, otherwise continue with the * original character to avoid breaking autoindent. */ if (STRCMP(buf, get_vim_var_str(VV_CHAR)) != 0) res = vim_strsave(get_vim_var_str(VV_CHAR)); } set_vim_var_string(VV_CHAR, NULL, -1); /* clear v:char */ --textlock; return res; } #endif vim-7.4.1689/src/eval.c000066400000000000000000022552761267703067000145020ustar00rootroot00000000000000/* 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. */ #define USING_FLOAT_STUFF #include "vim.h" #if defined(FEAT_EVAL) || defined(PROTO) #ifdef AMIGA # include /* for strftime() */ #endif #ifdef VMS # include #endif #ifdef MACOS # include /* for time_t */ #endif #define DICT_MAXNEST 100 /* maximum nesting of lists and dicts */ #define DO_NOT_FREE_CNT 99999 /* refcount for dict or list that should not be freed. */ /* * In a hashtab item "hi_key" points to "di_key" in a dictitem. * This avoids adding a pointer to the hashtab item. * DI2HIKEY() converts a dictitem pointer to a hashitem key pointer. * HIKEY2DI() converts a hashitem key pointer to a dictitem pointer. * HI2DI() converts a hashitem pointer to a dictitem pointer. */ static dictitem_T dumdi; #define DI2HIKEY(di) ((di)->di_key) #define HIKEY2DI(p) ((dictitem_T *)(p - (dumdi.di_key - (char_u *)&dumdi))) #define HI2DI(hi) HIKEY2DI((hi)->hi_key) /* * Structure returned by get_lval() and used by set_var_lval(). * For a plain name: * "name" points to the variable name. * "exp_name" is NULL. * "tv" is NULL * For a magic braces name: * "name" points to the expanded variable name. * "exp_name" is non-NULL, to be freed later. * "tv" is NULL * For an index in a list: * "name" points to the (expanded) variable name. * "exp_name" NULL or non-NULL, to be freed later. * "tv" points to the (first) list item value * "li" points to the (first) list item * "range", "n1", "n2" and "empty2" indicate what items are used. * For an existing Dict item: * "name" points to the (expanded) variable name. * "exp_name" NULL or non-NULL, to be freed later. * "tv" points to the dict item value * "newkey" is NULL * For a non-existing Dict item: * "name" points to the (expanded) variable name. * "exp_name" NULL or non-NULL, to be freed later. * "tv" points to the Dictionary typval_T * "newkey" is the key for the new item. */ typedef struct lval_S { char_u *ll_name; /* start of variable name (can be NULL) */ char_u *ll_exp_name; /* NULL or expanded name in allocated memory. */ typval_T *ll_tv; /* Typeval of item being used. If "newkey" isn't NULL it's the Dict to which to add the item. */ listitem_T *ll_li; /* The list item or NULL. */ list_T *ll_list; /* The list or NULL. */ int ll_range; /* TRUE when a [i:j] range was used */ long ll_n1; /* First index for list */ long ll_n2; /* Second index for list range */ int ll_empty2; /* Second index is empty: [i:] */ dict_T *ll_dict; /* The Dictionary or NULL */ dictitem_T *ll_di; /* The dictitem or NULL */ char_u *ll_newkey; /* New key for Dict in alloc. mem or NULL. */ } lval_T; static char *e_letunexp = N_("E18: Unexpected characters in :let"); static char *e_listidx = N_("E684: list index out of range: %ld"); static char *e_undefvar = N_("E121: Undefined variable: %s"); static char *e_missbrac = N_("E111: Missing ']'"); static char *e_listarg = N_("E686: Argument of %s must be a List"); static char *e_listdictarg = N_("E712: Argument of %s must be a List or Dictionary"); static char *e_listreq = N_("E714: List required"); static char *e_dictreq = N_("E715: Dictionary required"); static char *e_toomanyarg = N_("E118: Too many arguments for function: %s"); static char *e_dictkey = N_("E716: Key not present in Dictionary: %s"); static char *e_funcexts = N_("E122: Function %s already exists, add ! to replace it"); static char *e_funcdict = N_("E717: Dictionary entry already exists"); static char *e_funcref = N_("E718: Funcref required"); static char *e_dictrange = N_("E719: Cannot use [:] with a Dictionary"); static char *e_letwrong = N_("E734: Wrong variable type for %s="); static char *e_nofunc = N_("E130: Unknown function: %s"); static char *e_illvar = N_("E461: Illegal variable name: %s"); #ifdef FEAT_FLOAT static char *e_float_as_string = N_("E806: using Float as a String"); #endif #define NAMESPACE_CHAR (char_u *)"abglstvw" static dictitem_T globvars_var; /* variable used for g: */ #define globvarht globvardict.dv_hashtab /* * Old Vim variables such as "v:version" are also available without the "v:". * Also in functions. We need a special hashtable for them. */ static hashtab_T compat_hashtab; /* * When recursively copying lists and dicts we need to remember which ones we * have done to avoid endless recursiveness. This unique ID is used for that. * The last bit is used for previous_funccal, ignored when comparing. */ static int current_copyID = 0; #define COPYID_INC 2 #define COPYID_MASK (~0x1) /* Abort conversion to string after a recursion error. */ static int did_echo_string_emsg = FALSE; /* * Array to hold the hashtab with variables local to each sourced script. * Each item holds a variable (nameless) that points to the dict_T. */ typedef struct { dictitem_T sv_var; dict_T sv_dict; } scriptvar_T; static garray_T ga_scripts = {0, 0, sizeof(scriptvar_T *), 4, NULL}; #define SCRIPT_SV(id) (((scriptvar_T **)ga_scripts.ga_data)[(id) - 1]) #define SCRIPT_VARS(id) (SCRIPT_SV(id)->sv_dict.dv_hashtab) static int echo_attr = 0; /* attributes used for ":echo" */ /* Values for trans_function_name() argument: */ #define TFN_INT 1 /* internal function name OK */ #define TFN_QUIET 2 /* no error messages */ #define TFN_NO_AUTOLOAD 4 /* do not use script autoloading */ /* Values for get_lval() flags argument: */ #define GLV_QUIET TFN_QUIET /* no error messages */ #define GLV_NO_AUTOLOAD TFN_NO_AUTOLOAD /* do not use script autoloading */ /* * Structure to hold info for a user function. */ typedef struct ufunc ufunc_T; struct ufunc { int uf_varargs; /* variable nr of arguments */ int uf_flags; int uf_calls; /* nr of active calls */ garray_T uf_args; /* arguments */ garray_T uf_lines; /* function lines */ #ifdef FEAT_PROFILE int uf_profiling; /* TRUE when func is being profiled */ /* profiling the function as a whole */ int uf_tm_count; /* nr of calls */ proftime_T uf_tm_total; /* time spent in function + children */ proftime_T uf_tm_self; /* time spent in function itself */ proftime_T uf_tm_children; /* time spent in children this call */ /* profiling the function per line */ int *uf_tml_count; /* nr of times line was executed */ proftime_T *uf_tml_total; /* time spent in a line + children */ proftime_T *uf_tml_self; /* time spent in a line itself */ proftime_T uf_tml_start; /* start time for current line */ proftime_T uf_tml_children; /* time spent in children for this line */ proftime_T uf_tml_wait; /* start wait time for current line */ int uf_tml_idx; /* index of line being timed; -1 if none */ int uf_tml_execed; /* line being timed was executed */ #endif scid_T uf_script_ID; /* ID of script where function was defined, used for s: variables */ int uf_refcount; /* for numbered function: reference count */ char_u uf_name[1]; /* name of function (actually longer); can start with 123_ ( is K_SPECIAL KS_EXTRA KE_SNR) */ }; /* function flags */ #define FC_ABORT 1 /* abort function on error */ #define FC_RANGE 2 /* function accepts range */ #define FC_DICT 4 /* Dict function, uses "self" */ /* * All user-defined functions are found in this hashtable. */ static hashtab_T func_hashtab; /* The names of packages that once were loaded are remembered. */ static garray_T ga_loaded = {0, 0, sizeof(char_u *), 4, NULL}; /* List heads for garbage collection. Although there can be a reference loop * from partial to dict to partial, we don't need to keep track of the partial, * since it will get freed when the dict is unused and gets freed. */ static dict_T *first_dict = NULL; /* list of all dicts */ static list_T *first_list = NULL; /* list of all lists */ /* From user function to hashitem and back. */ static ufunc_T dumuf; #define UF2HIKEY(fp) ((fp)->uf_name) #define HIKEY2UF(p) ((ufunc_T *)(p - (dumuf.uf_name - (char_u *)&dumuf))) #define HI2UF(hi) HIKEY2UF((hi)->hi_key) #define FUNCARG(fp, j) ((char_u **)(fp->uf_args.ga_data))[j] #define FUNCLINE(fp, j) ((char_u **)(fp->uf_lines.ga_data))[j] #define MAX_FUNC_ARGS 20 /* maximum number of function arguments */ #define VAR_SHORT_LEN 20 /* short variable name length */ #define FIXVAR_CNT 12 /* number of fixed variables */ /* structure to hold info for a function that is currently being executed. */ typedef struct funccall_S funccall_T; struct funccall_S { ufunc_T *func; /* function being called */ int linenr; /* next line to be executed */ int returned; /* ":return" used */ struct /* fixed variables for arguments */ { dictitem_T var; /* variable (without room for name) */ char_u room[VAR_SHORT_LEN]; /* room for the name */ } fixvar[FIXVAR_CNT]; dict_T l_vars; /* l: local function variables */ dictitem_T l_vars_var; /* variable for l: scope */ dict_T l_avars; /* a: argument variables */ dictitem_T l_avars_var; /* variable for a: scope */ list_T l_varlist; /* list for a:000 */ listitem_T l_listitems[MAX_FUNC_ARGS]; /* listitems for a:000 */ typval_T *rettv; /* return value */ 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 */ #ifdef FEAT_PROFILE proftime_T prof_child; /* time spent in a child */ #endif funccall_T *caller; /* calling function or NULL */ }; /* * Info used by a ":for" loop. */ typedef struct { int fi_semicolon; /* TRUE if ending in '; var]' */ int fi_varcount; /* nr of variables in the list */ listwatch_T fi_lw; /* keep an eye on the item used. */ list_T *fi_list; /* list being used */ } forinfo_T; /* * Struct used by trans_function_name() */ typedef struct { dict_T *fd_dict; /* Dictionary used */ char_u *fd_newkey; /* new key in "dict" in allocated memory */ dictitem_T *fd_di; /* Dictionary item used */ } funcdict_T; /* * Array to hold the value of v: variables. * The value is in a dictitem, so that it can also be used in the v: scope. * The reason to use this table anyway is for very quick access to the * variables with the VV_ defines. */ #include "version.h" /* values for vv_flags: */ #define VV_COMPAT 1 /* compatible, also used without "v:" */ #define VV_RO 2 /* read-only */ #define VV_RO_SBX 4 /* read-only in the sandbox */ #define VV_NAME(s, t) s, {{t, 0, {0}}, 0, {0}} static struct vimvar { char *vv_name; /* name of variable, without v: */ dictitem16_T vv_di; /* value and name for key (max 16 chars!) */ char vv_flags; /* VV_COMPAT, VV_RO, VV_RO_SBX */ } vimvars[VV_LEN] = { /* * The order here must match the VV_ defines in vim.h! * Initializing a union does not work, leave tv.vval empty to get zero's. */ {VV_NAME("count", VAR_NUMBER), VV_COMPAT+VV_RO}, {VV_NAME("count1", VAR_NUMBER), VV_RO}, {VV_NAME("prevcount", VAR_NUMBER), VV_RO}, {VV_NAME("errmsg", VAR_STRING), VV_COMPAT}, {VV_NAME("warningmsg", VAR_STRING), 0}, {VV_NAME("statusmsg", VAR_STRING), 0}, {VV_NAME("shell_error", VAR_NUMBER), VV_COMPAT+VV_RO}, {VV_NAME("this_session", VAR_STRING), VV_COMPAT}, {VV_NAME("version", VAR_NUMBER), VV_COMPAT+VV_RO}, {VV_NAME("lnum", VAR_NUMBER), VV_RO_SBX}, {VV_NAME("termresponse", VAR_STRING), VV_RO}, {VV_NAME("fname", VAR_STRING), VV_RO}, {VV_NAME("lang", VAR_STRING), VV_RO}, {VV_NAME("lc_time", VAR_STRING), VV_RO}, {VV_NAME("ctype", VAR_STRING), VV_RO}, {VV_NAME("charconvert_from", VAR_STRING), VV_RO}, {VV_NAME("charconvert_to", VAR_STRING), VV_RO}, {VV_NAME("fname_in", VAR_STRING), VV_RO}, {VV_NAME("fname_out", VAR_STRING), VV_RO}, {VV_NAME("fname_new", VAR_STRING), VV_RO}, {VV_NAME("fname_diff", VAR_STRING), VV_RO}, {VV_NAME("cmdarg", VAR_STRING), VV_RO}, {VV_NAME("foldstart", VAR_NUMBER), VV_RO_SBX}, {VV_NAME("foldend", VAR_NUMBER), VV_RO_SBX}, {VV_NAME("folddashes", VAR_STRING), VV_RO_SBX}, {VV_NAME("foldlevel", VAR_NUMBER), VV_RO_SBX}, {VV_NAME("progname", VAR_STRING), VV_RO}, {VV_NAME("servername", VAR_STRING), VV_RO}, {VV_NAME("dying", VAR_NUMBER), VV_RO}, {VV_NAME("exception", VAR_STRING), VV_RO}, {VV_NAME("throwpoint", VAR_STRING), VV_RO}, {VV_NAME("register", VAR_STRING), VV_RO}, {VV_NAME("cmdbang", VAR_NUMBER), VV_RO}, {VV_NAME("insertmode", VAR_STRING), VV_RO}, {VV_NAME("val", VAR_UNKNOWN), VV_RO}, {VV_NAME("key", VAR_UNKNOWN), VV_RO}, {VV_NAME("profiling", VAR_NUMBER), VV_RO}, {VV_NAME("fcs_reason", VAR_STRING), VV_RO}, {VV_NAME("fcs_choice", VAR_STRING), 0}, {VV_NAME("beval_bufnr", VAR_NUMBER), VV_RO}, {VV_NAME("beval_winnr", VAR_NUMBER), VV_RO}, {VV_NAME("beval_lnum", VAR_NUMBER), VV_RO}, {VV_NAME("beval_col", VAR_NUMBER), VV_RO}, {VV_NAME("beval_text", VAR_STRING), VV_RO}, {VV_NAME("scrollstart", VAR_STRING), 0}, {VV_NAME("swapname", VAR_STRING), VV_RO}, {VV_NAME("swapchoice", VAR_STRING), 0}, {VV_NAME("swapcommand", VAR_STRING), VV_RO}, {VV_NAME("char", VAR_STRING), 0}, {VV_NAME("mouse_win", VAR_NUMBER), 0}, {VV_NAME("mouse_lnum", VAR_NUMBER), 0}, {VV_NAME("mouse_col", VAR_NUMBER), 0}, {VV_NAME("operator", VAR_STRING), VV_RO}, {VV_NAME("searchforward", VAR_NUMBER), 0}, {VV_NAME("hlsearch", VAR_NUMBER), 0}, {VV_NAME("oldfiles", VAR_LIST), 0}, {VV_NAME("windowid", VAR_NUMBER), VV_RO}, {VV_NAME("progpath", VAR_STRING), VV_RO}, {VV_NAME("completed_item", VAR_DICT), VV_RO}, {VV_NAME("option_new", VAR_STRING), VV_RO}, {VV_NAME("option_old", VAR_STRING), VV_RO}, {VV_NAME("option_type", VAR_STRING), VV_RO}, {VV_NAME("errors", VAR_LIST), 0}, {VV_NAME("false", VAR_SPECIAL), VV_RO}, {VV_NAME("true", VAR_SPECIAL), VV_RO}, {VV_NAME("null", VAR_SPECIAL), VV_RO}, {VV_NAME("none", VAR_SPECIAL), VV_RO}, {VV_NAME("vim_did_enter", VAR_NUMBER), VV_RO}, }; /* shorthand */ #define vv_type vv_di.di_tv.v_type #define vv_nr vv_di.di_tv.vval.v_number #define vv_float vv_di.di_tv.vval.v_float #define vv_str vv_di.di_tv.vval.v_string #define vv_list vv_di.di_tv.vval.v_list #define vv_dict vv_di.di_tv.vval.v_dict #define vv_tv vv_di.di_tv static dictitem_T vimvars_var; /* variable used for v: */ #define vimvarht vimvardict.dv_hashtab static void prepare_vimvar(int idx, typval_T *save_tv); static void restore_vimvar(int idx, typval_T *save_tv); static int ex_let_vars(char_u *arg, typval_T *tv, int copy, int semicolon, int var_count, char_u *nextchars); static char_u *skip_var_list(char_u *arg, int *var_count, int *semicolon); static char_u *skip_var_one(char_u *arg); static void list_hashtable_vars(hashtab_T *ht, char_u *prefix, int empty, int *first); static void list_glob_vars(int *first); static void list_buf_vars(int *first); static void list_win_vars(int *first); #ifdef FEAT_WINDOWS static void list_tab_vars(int *first); #endif static void list_vim_vars(int *first); static void list_script_vars(int *first); static void list_func_vars(int *first); static char_u *list_arg_vars(exarg_T *eap, char_u *arg, int *first); static char_u *ex_let_one(char_u *arg, typval_T *tv, int copy, char_u *endchars, char_u *op); static int check_changedtick(char_u *arg); static char_u *get_lval(char_u *name, typval_T *rettv, lval_T *lp, int unlet, int skip, int flags, int fne_flags); static void clear_lval(lval_T *lp); static void set_var_lval(lval_T *lp, char_u *endp, typval_T *rettv, int copy, char_u *op); static int tv_op(typval_T *tv1, typval_T *tv2, char_u *op); static void list_fix_watch(list_T *l, listitem_T *item); static void ex_unletlock(exarg_T *eap, char_u *argstart, int deep); static int do_unlet_var(lval_T *lp, char_u *name_end, int forceit); static int do_lock_var(lval_T *lp, char_u *name_end, int deep, int lock); static void item_lock(typval_T *tv, int deep, int lock); static int tv_islocked(typval_T *tv); static int eval0(char_u *arg, typval_T *rettv, char_u **nextcmd, int evaluate); static int eval1(char_u **arg, typval_T *rettv, int evaluate); static int eval2(char_u **arg, typval_T *rettv, int evaluate); static int eval3(char_u **arg, typval_T *rettv, int evaluate); static int eval4(char_u **arg, typval_T *rettv, int evaluate); static int eval5(char_u **arg, typval_T *rettv, int evaluate); static int eval6(char_u **arg, typval_T *rettv, int evaluate, int want_string); static int eval7(char_u **arg, typval_T *rettv, int evaluate, int want_string); static int eval_index(char_u **arg, typval_T *rettv, int evaluate, int verbose); static int get_option_tv(char_u **arg, typval_T *rettv, int evaluate); static int get_string_tv(char_u **arg, typval_T *rettv, int evaluate); static int get_lit_string_tv(char_u **arg, typval_T *rettv, int evaluate); static int get_list_tv(char_u **arg, typval_T *rettv, int evaluate); static long list_len(list_T *l); static int list_equal(list_T *l1, list_T *l2, int ic, int recursive); static int dict_equal(dict_T *d1, dict_T *d2, int ic, int recursive); static int tv_equal(typval_T *tv1, typval_T *tv2, int ic, int recursive); static long list_find_nr(list_T *l, long idx, int *errorp); static long list_idx_of_item(list_T *l, listitem_T *item); static int list_extend(list_T *l1, list_T *l2, listitem_T *bef); static int list_concat(list_T *l1, list_T *l2, typval_T *tv); static list_T *list_copy(list_T *orig, int deep, int copyID); static char_u *list2string(typval_T *tv, int copyID); static int list_join_inner(garray_T *gap, list_T *l, char_u *sep, int echo_style, int copyID, garray_T *join_gap); static int list_join(garray_T *gap, list_T *l, char_u *sep, int echo, int copyID); static int free_unref_items(int copyID); static dictitem_T *dictitem_copy(dictitem_T *org); static void dictitem_remove(dict_T *dict, dictitem_T *item); static dict_T *dict_copy(dict_T *orig, int deep, int copyID); static long dict_len(dict_T *d); static char_u *dict2string(typval_T *tv, int copyID); static int get_dict_tv(char_u **arg, typval_T *rettv, int evaluate); static char_u *echo_string(typval_T *tv, char_u **tofree, char_u *numbuf, int copyID); static char_u *tv2string(typval_T *tv, char_u **tofree, char_u *numbuf, int copyID); static char_u *string_quote(char_u *str, int function); static int get_env_tv(char_u **arg, typval_T *rettv, int evaluate); static int find_internal_func(char_u *name); static char_u *deref_func_name(char_u *name, int *lenp, partial_T **partial, int no_autoload); static int get_func_tv(char_u *name, int len, typval_T *rettv, char_u **arg, linenr_T firstline, linenr_T lastline, int *doesrange, int evaluate, partial_T *partial, dict_T *selfdict); static void emsg_funcname(char *ermsg, char_u *name); static int non_zero_arg(typval_T *argvars); #ifdef FEAT_FLOAT static void f_abs(typval_T *argvars, typval_T *rettv); static void f_acos(typval_T *argvars, typval_T *rettv); #endif static void f_add(typval_T *argvars, typval_T *rettv); static void f_alloc_fail(typval_T *argvars, typval_T *rettv); static void f_and(typval_T *argvars, typval_T *rettv); static void f_append(typval_T *argvars, typval_T *rettv); static void f_argc(typval_T *argvars, typval_T *rettv); static void f_argidx(typval_T *argvars, typval_T *rettv); static void f_arglistid(typval_T *argvars, typval_T *rettv); static void f_argv(typval_T *argvars, typval_T *rettv); static void f_assert_equal(typval_T *argvars, typval_T *rettv); static void f_assert_exception(typval_T *argvars, typval_T *rettv); static void f_assert_fails(typval_T *argvars, typval_T *rettv); static void f_assert_false(typval_T *argvars, typval_T *rettv); static void f_assert_match(typval_T *argvars, typval_T *rettv); static void f_assert_true(typval_T *argvars, typval_T *rettv); #ifdef FEAT_FLOAT static void f_asin(typval_T *argvars, typval_T *rettv); static void f_atan(typval_T *argvars, typval_T *rettv); static void f_atan2(typval_T *argvars, typval_T *rettv); #endif static void f_browse(typval_T *argvars, typval_T *rettv); static void f_browsedir(typval_T *argvars, typval_T *rettv); static void f_bufexists(typval_T *argvars, typval_T *rettv); static void f_buflisted(typval_T *argvars, typval_T *rettv); static void f_bufloaded(typval_T *argvars, typval_T *rettv); static void f_bufname(typval_T *argvars, typval_T *rettv); static void f_bufnr(typval_T *argvars, typval_T *rettv); static void f_bufwinnr(typval_T *argvars, typval_T *rettv); static void f_byte2line(typval_T *argvars, typval_T *rettv); static void byteidx(typval_T *argvars, typval_T *rettv, int comp); static void f_byteidx(typval_T *argvars, typval_T *rettv); static void f_byteidxcomp(typval_T *argvars, typval_T *rettv); static void f_call(typval_T *argvars, typval_T *rettv); #ifdef FEAT_FLOAT static void f_ceil(typval_T *argvars, typval_T *rettv); #endif #ifdef FEAT_JOB_CHANNEL static void f_ch_close(typval_T *argvars, typval_T *rettv); static void f_ch_evalexpr(typval_T *argvars, typval_T *rettv); static void f_ch_evalraw(typval_T *argvars, typval_T *rettv); static void f_ch_getbufnr(typval_T *argvars, typval_T *rettv); static void f_ch_getjob(typval_T *argvars, typval_T *rettv); static void f_ch_info(typval_T *argvars, typval_T *rettv); static void f_ch_log(typval_T *argvars, typval_T *rettv); static void f_ch_logfile(typval_T *argvars, typval_T *rettv); static void f_ch_open(typval_T *argvars, typval_T *rettv); static void f_ch_read(typval_T *argvars, typval_T *rettv); static void f_ch_readraw(typval_T *argvars, typval_T *rettv); static void f_ch_sendexpr(typval_T *argvars, typval_T *rettv); static void f_ch_sendraw(typval_T *argvars, typval_T *rettv); static void f_ch_setoptions(typval_T *argvars, typval_T *rettv); static void f_ch_status(typval_T *argvars, typval_T *rettv); #endif static void f_changenr(typval_T *argvars, typval_T *rettv); static void f_char2nr(typval_T *argvars, typval_T *rettv); static void f_cindent(typval_T *argvars, typval_T *rettv); static void f_clearmatches(typval_T *argvars, typval_T *rettv); static void f_col(typval_T *argvars, typval_T *rettv); #if defined(FEAT_INS_EXPAND) static void f_complete(typval_T *argvars, typval_T *rettv); static void f_complete_add(typval_T *argvars, typval_T *rettv); static void f_complete_check(typval_T *argvars, typval_T *rettv); #endif static void f_confirm(typval_T *argvars, typval_T *rettv); static void f_copy(typval_T *argvars, typval_T *rettv); #ifdef FEAT_FLOAT static void f_cos(typval_T *argvars, typval_T *rettv); static void f_cosh(typval_T *argvars, typval_T *rettv); #endif static void f_count(typval_T *argvars, typval_T *rettv); static void f_cscope_connection(typval_T *argvars, typval_T *rettv); static void f_cursor(typval_T *argsvars, typval_T *rettv); static void f_deepcopy(typval_T *argvars, typval_T *rettv); static void f_delete(typval_T *argvars, typval_T *rettv); static void f_did_filetype(typval_T *argvars, typval_T *rettv); static void f_diff_filler(typval_T *argvars, typval_T *rettv); static void f_diff_hlID(typval_T *argvars, typval_T *rettv); static void f_disable_char_avail_for_testing(typval_T *argvars, typval_T *rettv); static void f_empty(typval_T *argvars, typval_T *rettv); static void f_escape(typval_T *argvars, typval_T *rettv); static void f_eval(typval_T *argvars, typval_T *rettv); static void f_eventhandler(typval_T *argvars, typval_T *rettv); static void f_executable(typval_T *argvars, typval_T *rettv); static void f_exepath(typval_T *argvars, typval_T *rettv); static void f_exists(typval_T *argvars, typval_T *rettv); #ifdef FEAT_FLOAT static void f_exp(typval_T *argvars, typval_T *rettv); #endif static void f_expand(typval_T *argvars, typval_T *rettv); static void f_extend(typval_T *argvars, typval_T *rettv); static void f_feedkeys(typval_T *argvars, typval_T *rettv); static void f_filereadable(typval_T *argvars, typval_T *rettv); static void f_filewritable(typval_T *argvars, typval_T *rettv); static void f_filter(typval_T *argvars, typval_T *rettv); static void f_finddir(typval_T *argvars, typval_T *rettv); static void f_findfile(typval_T *argvars, typval_T *rettv); #ifdef FEAT_FLOAT static void f_float2nr(typval_T *argvars, typval_T *rettv); static void f_floor(typval_T *argvars, typval_T *rettv); static void f_fmod(typval_T *argvars, typval_T *rettv); #endif static void f_fnameescape(typval_T *argvars, typval_T *rettv); static void f_fnamemodify(typval_T *argvars, typval_T *rettv); static void f_foldclosed(typval_T *argvars, typval_T *rettv); static void f_foldclosedend(typval_T *argvars, typval_T *rettv); static void f_foldlevel(typval_T *argvars, typval_T *rettv); static void f_foldtext(typval_T *argvars, typval_T *rettv); static void f_foldtextresult(typval_T *argvars, typval_T *rettv); static void f_foreground(typval_T *argvars, typval_T *rettv); static void f_function(typval_T *argvars, typval_T *rettv); static void f_garbagecollect(typval_T *argvars, typval_T *rettv); static void f_get(typval_T *argvars, typval_T *rettv); static void f_getbufline(typval_T *argvars, typval_T *rettv); static void f_getbufvar(typval_T *argvars, typval_T *rettv); static void f_getchar(typval_T *argvars, typval_T *rettv); static void f_getcharmod(typval_T *argvars, typval_T *rettv); static void f_getcharsearch(typval_T *argvars, typval_T *rettv); static void f_getcmdline(typval_T *argvars, typval_T *rettv); static void f_getcmdpos(typval_T *argvars, typval_T *rettv); static void f_getcmdtype(typval_T *argvars, typval_T *rettv); static void f_getcmdwintype(typval_T *argvars, typval_T *rettv); static void f_getcwd(typval_T *argvars, typval_T *rettv); static void f_getfontname(typval_T *argvars, typval_T *rettv); static void f_getfperm(typval_T *argvars, typval_T *rettv); static void f_getfsize(typval_T *argvars, typval_T *rettv); static void f_getftime(typval_T *argvars, typval_T *rettv); static void f_getftype(typval_T *argvars, typval_T *rettv); static void f_getline(typval_T *argvars, typval_T *rettv); static void f_getmatches(typval_T *argvars, typval_T *rettv); static void f_getpid(typval_T *argvars, typval_T *rettv); static void f_getcurpos(typval_T *argvars, typval_T *rettv); static void f_getpos(typval_T *argvars, typval_T *rettv); static void f_getqflist(typval_T *argvars, typval_T *rettv); static void f_getreg(typval_T *argvars, typval_T *rettv); static void f_getregtype(typval_T *argvars, typval_T *rettv); static void f_gettabvar(typval_T *argvars, typval_T *rettv); static void f_gettabwinvar(typval_T *argvars, typval_T *rettv); static void f_getwinposx(typval_T *argvars, typval_T *rettv); static void f_getwinposy(typval_T *argvars, typval_T *rettv); static void f_getwinvar(typval_T *argvars, typval_T *rettv); static void f_glob(typval_T *argvars, typval_T *rettv); static void f_globpath(typval_T *argvars, typval_T *rettv); static void f_glob2regpat(typval_T *argvars, typval_T *rettv); static void f_has(typval_T *argvars, typval_T *rettv); static void f_has_key(typval_T *argvars, typval_T *rettv); static void f_haslocaldir(typval_T *argvars, typval_T *rettv); static void f_hasmapto(typval_T *argvars, typval_T *rettv); static void f_histadd(typval_T *argvars, typval_T *rettv); static void f_histdel(typval_T *argvars, typval_T *rettv); static void f_histget(typval_T *argvars, typval_T *rettv); static void f_histnr(typval_T *argvars, typval_T *rettv); static void f_hlID(typval_T *argvars, typval_T *rettv); static void f_hlexists(typval_T *argvars, typval_T *rettv); static void f_hostname(typval_T *argvars, typval_T *rettv); static void f_iconv(typval_T *argvars, typval_T *rettv); static void f_indent(typval_T *argvars, typval_T *rettv); static void f_index(typval_T *argvars, typval_T *rettv); static void f_input(typval_T *argvars, typval_T *rettv); static void f_inputdialog(typval_T *argvars, typval_T *rettv); static void f_inputlist(typval_T *argvars, typval_T *rettv); static void f_inputrestore(typval_T *argvars, typval_T *rettv); static void f_inputsave(typval_T *argvars, typval_T *rettv); static void f_inputsecret(typval_T *argvars, typval_T *rettv); static void f_insert(typval_T *argvars, typval_T *rettv); static void f_invert(typval_T *argvars, typval_T *rettv); static void f_isdirectory(typval_T *argvars, typval_T *rettv); static void f_islocked(typval_T *argvars, typval_T *rettv); #if defined(FEAT_FLOAT) && defined(HAVE_MATH_H) static void f_isnan(typval_T *argvars, typval_T *rettv); #endif static void f_items(typval_T *argvars, typval_T *rettv); #ifdef FEAT_JOB_CHANNEL static void f_job_getchannel(typval_T *argvars, typval_T *rettv); static void f_job_info(typval_T *argvars, typval_T *rettv); static void f_job_setoptions(typval_T *argvars, typval_T *rettv); static void f_job_start(typval_T *argvars, typval_T *rettv); static void f_job_stop(typval_T *argvars, typval_T *rettv); static void f_job_status(typval_T *argvars, typval_T *rettv); #endif static void f_join(typval_T *argvars, typval_T *rettv); static void f_js_decode(typval_T *argvars, typval_T *rettv); static void f_js_encode(typval_T *argvars, typval_T *rettv); static void f_json_decode(typval_T *argvars, typval_T *rettv); static void f_json_encode(typval_T *argvars, typval_T *rettv); static void f_keys(typval_T *argvars, typval_T *rettv); static void f_last_buffer_nr(typval_T *argvars, typval_T *rettv); static void f_len(typval_T *argvars, typval_T *rettv); static void f_libcall(typval_T *argvars, typval_T *rettv); static void f_libcallnr(typval_T *argvars, typval_T *rettv); static void f_line(typval_T *argvars, typval_T *rettv); static void f_line2byte(typval_T *argvars, typval_T *rettv); static void f_lispindent(typval_T *argvars, typval_T *rettv); static void f_localtime(typval_T *argvars, typval_T *rettv); #ifdef FEAT_FLOAT static void f_log(typval_T *argvars, typval_T *rettv); static void f_log10(typval_T *argvars, typval_T *rettv); #endif #ifdef FEAT_LUA static void f_luaeval(typval_T *argvars, typval_T *rettv); #endif static void f_map(typval_T *argvars, typval_T *rettv); static void f_maparg(typval_T *argvars, typval_T *rettv); static void f_mapcheck(typval_T *argvars, typval_T *rettv); static void f_match(typval_T *argvars, typval_T *rettv); static void f_matchadd(typval_T *argvars, typval_T *rettv); static void f_matchaddpos(typval_T *argvars, typval_T *rettv); static void f_matcharg(typval_T *argvars, typval_T *rettv); static void f_matchdelete(typval_T *argvars, typval_T *rettv); static void f_matchend(typval_T *argvars, typval_T *rettv); static void f_matchlist(typval_T *argvars, typval_T *rettv); static void f_matchstr(typval_T *argvars, typval_T *rettv); static void f_matchstrpos(typval_T *argvars, typval_T *rettv); static void f_max(typval_T *argvars, typval_T *rettv); static void f_min(typval_T *argvars, typval_T *rettv); #ifdef vim_mkdir static void f_mkdir(typval_T *argvars, typval_T *rettv); #endif static void f_mode(typval_T *argvars, typval_T *rettv); #ifdef FEAT_MZSCHEME static void f_mzeval(typval_T *argvars, typval_T *rettv); #endif static void f_nextnonblank(typval_T *argvars, typval_T *rettv); static void f_nr2char(typval_T *argvars, typval_T *rettv); static void f_or(typval_T *argvars, typval_T *rettv); static void f_pathshorten(typval_T *argvars, typval_T *rettv); #ifdef FEAT_PERL static void f_perleval(typval_T *argvars, typval_T *rettv); #endif #ifdef FEAT_FLOAT static void f_pow(typval_T *argvars, typval_T *rettv); #endif static void f_prevnonblank(typval_T *argvars, typval_T *rettv); static void f_printf(typval_T *argvars, typval_T *rettv); static void f_pumvisible(typval_T *argvars, typval_T *rettv); #ifdef FEAT_PYTHON3 static void f_py3eval(typval_T *argvars, typval_T *rettv); #endif #ifdef FEAT_PYTHON static void f_pyeval(typval_T *argvars, typval_T *rettv); #endif static void f_range(typval_T *argvars, typval_T *rettv); static void f_readfile(typval_T *argvars, typval_T *rettv); static void f_reltime(typval_T *argvars, typval_T *rettv); #ifdef FEAT_FLOAT static void f_reltimefloat(typval_T *argvars, typval_T *rettv); #endif static void f_reltimestr(typval_T *argvars, typval_T *rettv); static void f_remote_expr(typval_T *argvars, typval_T *rettv); static void f_remote_foreground(typval_T *argvars, typval_T *rettv); static void f_remote_peek(typval_T *argvars, typval_T *rettv); static void f_remote_read(typval_T *argvars, typval_T *rettv); static void f_remote_send(typval_T *argvars, typval_T *rettv); static void f_remove(typval_T *argvars, typval_T *rettv); static void f_rename(typval_T *argvars, typval_T *rettv); static void f_repeat(typval_T *argvars, typval_T *rettv); static void f_resolve(typval_T *argvars, typval_T *rettv); static void f_reverse(typval_T *argvars, typval_T *rettv); #ifdef FEAT_FLOAT static void f_round(typval_T *argvars, typval_T *rettv); #endif static void f_screenattr(typval_T *argvars, typval_T *rettv); static void f_screenchar(typval_T *argvars, typval_T *rettv); static void f_screencol(typval_T *argvars, typval_T *rettv); static void f_screenrow(typval_T *argvars, typval_T *rettv); static void f_search(typval_T *argvars, typval_T *rettv); static void f_searchdecl(typval_T *argvars, typval_T *rettv); static void f_searchpair(typval_T *argvars, typval_T *rettv); static void f_searchpairpos(typval_T *argvars, typval_T *rettv); static void f_searchpos(typval_T *argvars, typval_T *rettv); static void f_server2client(typval_T *argvars, typval_T *rettv); static void f_serverlist(typval_T *argvars, typval_T *rettv); static void f_setbufvar(typval_T *argvars, typval_T *rettv); static void f_setcharsearch(typval_T *argvars, typval_T *rettv); static void f_setcmdpos(typval_T *argvars, typval_T *rettv); static void f_setfperm(typval_T *argvars, typval_T *rettv); static void f_setline(typval_T *argvars, typval_T *rettv); static void f_setloclist(typval_T *argvars, typval_T *rettv); static void f_setmatches(typval_T *argvars, typval_T *rettv); static void f_setpos(typval_T *argvars, typval_T *rettv); static void f_setqflist(typval_T *argvars, typval_T *rettv); static void f_setreg(typval_T *argvars, typval_T *rettv); static void f_settabvar(typval_T *argvars, typval_T *rettv); static void f_settabwinvar(typval_T *argvars, typval_T *rettv); static void f_setwinvar(typval_T *argvars, typval_T *rettv); #ifdef FEAT_CRYPT static void f_sha256(typval_T *argvars, typval_T *rettv); #endif /* FEAT_CRYPT */ static void f_shellescape(typval_T *argvars, typval_T *rettv); static void f_shiftwidth(typval_T *argvars, typval_T *rettv); static void f_simplify(typval_T *argvars, typval_T *rettv); #ifdef FEAT_FLOAT static void f_sin(typval_T *argvars, typval_T *rettv); static void f_sinh(typval_T *argvars, typval_T *rettv); #endif static void f_sort(typval_T *argvars, typval_T *rettv); static void f_soundfold(typval_T *argvars, typval_T *rettv); static void f_spellbadword(typval_T *argvars, typval_T *rettv); static void f_spellsuggest(typval_T *argvars, typval_T *rettv); static void f_split(typval_T *argvars, typval_T *rettv); #ifdef FEAT_FLOAT static void f_sqrt(typval_T *argvars, typval_T *rettv); static void f_str2float(typval_T *argvars, typval_T *rettv); #endif static void f_str2nr(typval_T *argvars, typval_T *rettv); static void f_strchars(typval_T *argvars, typval_T *rettv); #ifdef HAVE_STRFTIME static void f_strftime(typval_T *argvars, typval_T *rettv); #endif static void f_stridx(typval_T *argvars, typval_T *rettv); static void f_string(typval_T *argvars, typval_T *rettv); static void f_strlen(typval_T *argvars, typval_T *rettv); static void f_strpart(typval_T *argvars, typval_T *rettv); static void f_strridx(typval_T *argvars, typval_T *rettv); static void f_strtrans(typval_T *argvars, typval_T *rettv); static void f_strdisplaywidth(typval_T *argvars, typval_T *rettv); static void f_strwidth(typval_T *argvars, typval_T *rettv); static void f_submatch(typval_T *argvars, typval_T *rettv); static void f_substitute(typval_T *argvars, typval_T *rettv); static void f_synID(typval_T *argvars, typval_T *rettv); static void f_synIDattr(typval_T *argvars, typval_T *rettv); static void f_synIDtrans(typval_T *argvars, typval_T *rettv); static void f_synstack(typval_T *argvars, typval_T *rettv); static void f_synconcealed(typval_T *argvars, typval_T *rettv); static void f_system(typval_T *argvars, typval_T *rettv); static void f_systemlist(typval_T *argvars, typval_T *rettv); static void f_tabpagebuflist(typval_T *argvars, typval_T *rettv); static void f_tabpagenr(typval_T *argvars, typval_T *rettv); static void f_tabpagewinnr(typval_T *argvars, typval_T *rettv); static void f_taglist(typval_T *argvars, typval_T *rettv); static void f_tagfiles(typval_T *argvars, typval_T *rettv); static void f_tempname(typval_T *argvars, typval_T *rettv); static void f_test(typval_T *argvars, typval_T *rettv); #ifdef FEAT_FLOAT static void f_tan(typval_T *argvars, typval_T *rettv); static void f_tanh(typval_T *argvars, typval_T *rettv); #endif #ifdef FEAT_TIMERS static void f_timer_start(typval_T *argvars, typval_T *rettv); static void f_timer_stop(typval_T *argvars, typval_T *rettv); #endif static void f_tolower(typval_T *argvars, typval_T *rettv); static void f_toupper(typval_T *argvars, typval_T *rettv); static void f_tr(typval_T *argvars, typval_T *rettv); #ifdef FEAT_FLOAT static void f_trunc(typval_T *argvars, typval_T *rettv); #endif static void f_type(typval_T *argvars, typval_T *rettv); static void f_undofile(typval_T *argvars, typval_T *rettv); static void f_undotree(typval_T *argvars, typval_T *rettv); static void f_uniq(typval_T *argvars, typval_T *rettv); static void f_values(typval_T *argvars, typval_T *rettv); static void f_virtcol(typval_T *argvars, typval_T *rettv); static void f_visualmode(typval_T *argvars, typval_T *rettv); static void f_wildmenumode(typval_T *argvars, typval_T *rettv); static void f_win_findbuf(typval_T *argvars, typval_T *rettv); static void f_win_getid(typval_T *argvars, typval_T *rettv); static void f_win_gotoid(typval_T *argvars, typval_T *rettv); static void f_win_id2tabwin(typval_T *argvars, typval_T *rettv); static void f_win_id2win(typval_T *argvars, typval_T *rettv); static void f_winbufnr(typval_T *argvars, typval_T *rettv); static void f_wincol(typval_T *argvars, typval_T *rettv); static void f_winheight(typval_T *argvars, typval_T *rettv); static void f_winline(typval_T *argvars, typval_T *rettv); static void f_winnr(typval_T *argvars, typval_T *rettv); static void f_winrestcmd(typval_T *argvars, typval_T *rettv); static void f_winrestview(typval_T *argvars, typval_T *rettv); static void f_winsaveview(typval_T *argvars, typval_T *rettv); static void f_winwidth(typval_T *argvars, typval_T *rettv); static void f_writefile(typval_T *argvars, typval_T *rettv); static void f_wordcount(typval_T *argvars, typval_T *rettv); static void f_xor(typval_T *argvars, typval_T *rettv); static int list2fpos(typval_T *arg, pos_T *posp, int *fnump, colnr_T *curswantp); static pos_T *var2fpos(typval_T *varp, int dollar_lnum, int *fnum); static int get_env_len(char_u **arg); static int get_id_len(char_u **arg); static int get_name_len(char_u **arg, char_u **alias, int evaluate, int verbose); static char_u *find_name_end(char_u *arg, char_u **expr_start, char_u **expr_end, int flags); #define FNE_INCL_BR 1 /* find_name_end(): include [] in name */ #define FNE_CHECK_START 2 /* find_name_end(): check name starts with valid character */ static char_u * make_expanded_name(char_u *in_start, char_u *expr_start, char_u *expr_end, char_u *in_end); static int eval_isnamec(int c); static int eval_isnamec1(int c); static int get_var_tv(char_u *name, int len, typval_T *rettv, dictitem_T **dip, int verbose, int no_autoload); static int handle_subscript(char_u **arg, typval_T *rettv, int evaluate, int verbose); static typval_T *alloc_string_tv(char_u *string); static void init_tv(typval_T *varp); #ifdef FEAT_FLOAT static float_T get_tv_float(typval_T *varp); #endif static linenr_T get_tv_lnum(typval_T *argvars); static linenr_T get_tv_lnum_buf(typval_T *argvars, buf_T *buf); static dictitem_T *find_var(char_u *name, hashtab_T **htp, int no_autoload); static dictitem_T *find_var_in_ht(hashtab_T *ht, int htname, char_u *varname, int no_autoload); static hashtab_T *find_var_ht(char_u *name, char_u **varname); static funccall_T *get_funccal(void); static void vars_clear_ext(hashtab_T *ht, int free_val); static void delete_var(hashtab_T *ht, hashitem_T *hi); static void list_one_var(dictitem_T *v, char_u *prefix, int *first); static void list_one_var_a(char_u *prefix, char_u *name, int type, char_u *string, int *first); static void set_var(char_u *name, typval_T *varp, int copy); static int var_check_ro(int flags, char_u *name, int use_gettext); static int var_check_fixed(int flags, char_u *name, int use_gettext); static int var_check_func_name(char_u *name, int new_var); static int valid_varname(char_u *varname); static int tv_check_lock(int lock, char_u *name, int use_gettext); static int item_copy(typval_T *from, typval_T *to, int deep, int copyID); static char_u *find_option_end(char_u **arg, int *opt_flags); static char_u *trans_function_name(char_u **pp, int skip, int flags, funcdict_T *fd, partial_T **partial); static int eval_fname_script(char_u *p); static int eval_fname_sid(char_u *p); static void list_func_head(ufunc_T *fp, int indent); static ufunc_T *find_func(char_u *name); static int function_exists(char_u *name); static int builtin_function(char_u *name, int len); #ifdef FEAT_PROFILE static void func_do_profile(ufunc_T *fp); static void prof_sort_list(FILE *fd, ufunc_T **sorttab, int st_len, char *title, int prefer_self); static void prof_func_line(FILE *fd, int count, proftime_T *total, proftime_T *self, int prefer_self); static int # ifdef __BORLANDC__ _RTLENTRYF # endif prof_total_cmp(const void *s1, const void *s2); static int # ifdef __BORLANDC__ _RTLENTRYF # endif prof_self_cmp(const void *s1, const void *s2); #endif static int script_autoload(char_u *name, int reload); static char_u *autoload_name(char_u *name); static void cat_func_name(char_u *buf, ufunc_T *fp); static void func_free(ufunc_T *fp); static void call_user_func(ufunc_T *fp, int argcount, typval_T *argvars, typval_T *rettv, linenr_T firstline, linenr_T lastline, dict_T *selfdict); static int can_free_funccal(funccall_T *fc, int copyID) ; static void free_funccal(funccall_T *fc, int free_val); static void add_nr_var(dict_T *dp, dictitem_T *v, char *name, varnumber_T nr); static win_T *find_win_by_nr(typval_T *vp, tabpage_T *tp); static win_T *find_tabwin(typval_T *wvp, typval_T *tvp); static void getwinvar(typval_T *argvars, typval_T *rettv, int off); static int searchpair_cmn(typval_T *argvars, pos_T *match_pos); static int search_cmn(typval_T *argvars, pos_T *match_pos, int *flagsp); static void setwinvar(typval_T *argvars, typval_T *rettv, int off); static int write_list(FILE *fd, list_T *list, int binary); static void get_cmd_output_as_rettv(typval_T *argvars, typval_T *rettv, int retlist); #ifdef EBCDIC static int compare_func_name(const void *s1, const void *s2); static void sortFunctions(); #endif /* * Initialize the global and v: variables. */ void eval_init(void) { int i; struct vimvar *p; init_var_dict(&globvardict, &globvars_var, VAR_DEF_SCOPE); init_var_dict(&vimvardict, &vimvars_var, VAR_SCOPE); vimvardict.dv_lock = VAR_FIXED; hash_init(&compat_hashtab); hash_init(&func_hashtab); for (i = 0; i < VV_LEN; ++i) { p = &vimvars[i]; if (STRLEN(p->vv_name) > 16) { EMSG("INTERNAL: name too long, increase size of dictitem16_T"); getout(1); } STRCPY(p->vv_di.di_key, p->vv_name); if (p->vv_flags & VV_RO) p->vv_di.di_flags = DI_FLAGS_RO | DI_FLAGS_FIX; else if (p->vv_flags & VV_RO_SBX) p->vv_di.di_flags = DI_FLAGS_RO_SBX | DI_FLAGS_FIX; else p->vv_di.di_flags = DI_FLAGS_FIX; /* add to v: scope dict, unless the value is not always available */ if (p->vv_type != VAR_UNKNOWN) hash_add(&vimvarht, p->vv_di.di_key); if (p->vv_flags & VV_COMPAT) /* add to compat scope dict */ hash_add(&compat_hashtab, p->vv_di.di_key); } vimvars[VV_VERSION].vv_nr = VIM_VERSION_100; set_vim_var_nr(VV_SEARCHFORWARD, 1L); set_vim_var_nr(VV_HLSEARCH, 1L); set_vim_var_dict(VV_COMPLETED_ITEM, dict_alloc()); set_vim_var_list(VV_ERRORS, list_alloc()); set_vim_var_nr(VV_FALSE, VVAL_FALSE); set_vim_var_nr(VV_TRUE, VVAL_TRUE); set_vim_var_nr(VV_NONE, VVAL_NONE); set_vim_var_nr(VV_NULL, VVAL_NULL); set_reg_var(0); /* default for v:register is not 0 but '"' */ #ifdef EBCDIC /* * Sort the function table, to enable binary search. */ sortFunctions(); #endif } #if defined(EXITFREE) || defined(PROTO) void eval_clear(void) { int i; struct vimvar *p; for (i = 0; i < VV_LEN; ++i) { p = &vimvars[i]; if (p->vv_di.di_tv.v_type == VAR_STRING) { vim_free(p->vv_str); p->vv_str = NULL; } else if (p->vv_di.di_tv.v_type == VAR_LIST) { list_unref(p->vv_list); p->vv_list = NULL; } } hash_clear(&vimvarht); hash_init(&vimvarht); /* garbage_collect() will access it */ hash_clear(&compat_hashtab); free_scriptnames(); # if defined(FEAT_CMDL_COMPL) free_locales(); # endif /* global variables */ vars_clear(&globvarht); /* autoloaded script names */ ga_clear_strings(&ga_loaded); /* Script-local variables. First clear all the variables and in a second * loop free the scriptvar_T, because a variable in one script might hold * a reference to the whole scope of another script. */ for (i = 1; i <= ga_scripts.ga_len; ++i) vars_clear(&SCRIPT_VARS(i)); for (i = 1; i <= ga_scripts.ga_len; ++i) vim_free(SCRIPT_SV(i)); ga_clear(&ga_scripts); /* unreferenced lists and dicts */ (void)garbage_collect(); /* functions */ free_all_functions(); hash_clear(&func_hashtab); } #endif /* * Return the name of the executed function. */ char_u * func_name(void *cookie) { return ((funccall_T *)cookie)->func->uf_name; } /* * Return the address holding the next breakpoint line for a funccall cookie. */ linenr_T * func_breakpoint(void *cookie) { return &((funccall_T *)cookie)->breakpoint; } /* * Return the address holding the debug tick for a funccall cookie. */ int * func_dbg_tick(void *cookie) { return &((funccall_T *)cookie)->dbg_tick; } /* * Return the nesting level for a funccall cookie. */ int func_level(void *cookie) { return ((funccall_T *)cookie)->level; } /* pointer to funccal for currently active function */ funccall_T *current_funccal = NULL; /* pointer to list of previously used funccal, still around because some * item in it is still being used. */ funccall_T *previous_funccal = NULL; /* * Return TRUE when a function was ended by a ":return" command. */ int current_func_returned(void) { return current_funccal->returned; } /* * Set an internal variable to a string value. Creates the variable if it does * not already exist. */ void set_internal_string_var(char_u *name, char_u *value) { char_u *val; typval_T *tvp; val = vim_strsave(value); if (val != NULL) { tvp = alloc_string_tv(val); if (tvp != NULL) { set_var(name, tvp, FALSE); free_tv(tvp); } } } static lval_T *redir_lval = NULL; static garray_T redir_ga; /* only valid when redir_lval is not NULL */ static char_u *redir_endp = NULL; static char_u *redir_varname = NULL; /* * Start recording command output to a variable * When "append" is TRUE append to an existing variable. * Returns OK if successfully completed the setup. FAIL otherwise. */ int var_redir_start(char_u *name, int append) { int save_emsg; int err; typval_T tv; /* Catch a bad name early. */ if (!eval_isnamec1(*name)) { EMSG(_(e_invarg)); return FAIL; } /* Make a copy of the name, it is used in redir_lval until redir ends. */ redir_varname = vim_strsave(name); if (redir_varname == NULL) return FAIL; redir_lval = (lval_T *)alloc_clear((unsigned)sizeof(lval_T)); if (redir_lval == NULL) { var_redir_stop(); return FAIL; } /* The output is stored in growarray "redir_ga" until redirection ends. */ ga_init2(&redir_ga, (int)sizeof(char), 500); /* Parse the variable name (can be a dict or list entry). */ redir_endp = get_lval(redir_varname, NULL, redir_lval, FALSE, FALSE, 0, FNE_CHECK_START); if (redir_endp == NULL || redir_lval->ll_name == NULL || *redir_endp != NUL) { clear_lval(redir_lval); if (redir_endp != NULL && *redir_endp != NUL) /* Trailing characters are present after the variable name */ EMSG(_(e_trailing)); else EMSG(_(e_invarg)); redir_endp = NULL; /* don't store a value, only cleanup */ var_redir_stop(); return FAIL; } /* check if we can write to the variable: set it to or append an empty * string */ save_emsg = did_emsg; did_emsg = FALSE; tv.v_type = VAR_STRING; tv.vval.v_string = (char_u *)""; if (append) set_var_lval(redir_lval, redir_endp, &tv, TRUE, (char_u *)"."); else set_var_lval(redir_lval, redir_endp, &tv, TRUE, (char_u *)"="); clear_lval(redir_lval); err = did_emsg; did_emsg |= save_emsg; if (err) { redir_endp = NULL; /* don't store a value, only cleanup */ var_redir_stop(); return FAIL; } return OK; } /* * Append "value[value_len]" to the variable set by var_redir_start(). * The actual appending is postponed until redirection ends, because the value * appended may in fact be the string we write to, changing it may cause freed * memory to be used: * :redir => foo * :let foo * :redir END */ void var_redir_str(char_u *value, int value_len) { int len; if (redir_lval == NULL) return; if (value_len == -1) len = (int)STRLEN(value); /* Append the entire string */ else len = value_len; /* Append only "value_len" characters */ if (ga_grow(&redir_ga, len) == OK) { mch_memmove((char *)redir_ga.ga_data + redir_ga.ga_len, value, len); redir_ga.ga_len += len; } else var_redir_stop(); } /* * Stop redirecting command output to a variable. * Frees the allocated memory. */ void var_redir_stop(void) { typval_T tv; if (redir_lval != NULL) { /* If there was no error: assign the text to the variable. */ if (redir_endp != NULL) { ga_append(&redir_ga, NUL); /* Append the trailing NUL. */ tv.v_type = VAR_STRING; tv.vval.v_string = redir_ga.ga_data; /* Call get_lval() again, if it's inside a Dict or List it may * have changed. */ redir_endp = get_lval(redir_varname, NULL, redir_lval, FALSE, FALSE, 0, FNE_CHECK_START); if (redir_endp != NULL && redir_lval->ll_name != NULL) set_var_lval(redir_lval, redir_endp, &tv, FALSE, (char_u *)"."); clear_lval(redir_lval); } /* free the collected output */ vim_free(redir_ga.ga_data); redir_ga.ga_data = NULL; vim_free(redir_lval); redir_lval = NULL; } vim_free(redir_varname); redir_varname = NULL; } # if defined(FEAT_MBYTE) || defined(PROTO) int eval_charconvert( 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(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( 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( 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( char_u *arg, int *error, char_u **nextcmd, int skip) /* only parse, don't execute */ { typval_T tv; int retval = FALSE; if (skip) ++emsg_skip; if (eval0(arg, &tv, nextcmd, !skip) == FAIL) *error = TRUE; else { *error = FALSE; if (!skip) { retval = (get_tv_number_chk(&tv, error) != 0); clear_tv(&tv); } } 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( char_u *arg, char_u **nextcmd, int skip) /* only parse, don't execute */ { typval_T tv; char_u *retval; if (skip) ++emsg_skip; if (eval0(arg, &tv, nextcmd, !skip) == FAIL || skip) retval = NULL; else { retval = vim_strsave(get_tv_string(&tv)); clear_tv(&tv); } if (skip) --emsg_skip; return retval; } /* * Skip over an expression at "*pp". * Return FAIL for an error, OK otherwise. */ int skip_expr(char_u **pp) { typval_T rettv; *pp = skipwhite(*pp); return eval1(pp, &rettv, FALSE); } /* * Top level evaluation function, returning a string. * When "convert" is TRUE convert a List into a sequence of lines and convert * a Float to a String. * Return pointer to allocated memory, or NULL for failure. */ char_u * eval_to_string( char_u *arg, char_u **nextcmd, int convert) { typval_T tv; char_u *retval; garray_T ga; #ifdef FEAT_FLOAT char_u numbuf[NUMBUFLEN]; #endif if (eval0(arg, &tv, nextcmd, TRUE) == FAIL) retval = NULL; else { if (convert && tv.v_type == VAR_LIST) { ga_init2(&ga, (int)sizeof(char), 80); if (tv.vval.v_list != NULL) { list_join(&ga, tv.vval.v_list, (char_u *)"\n", TRUE, 0); if (tv.vval.v_list->lv_len > 0) ga_append(&ga, NL); } ga_append(&ga, NUL); retval = (char_u *)ga.ga_data; } #ifdef FEAT_FLOAT else if (convert && tv.v_type == VAR_FLOAT) { vim_snprintf((char *)numbuf, NUMBUFLEN, "%g", tv.vval.v_float); retval = vim_strsave(numbuf); } #endif else retval = vim_strsave(get_tv_string(&tv)); clear_tv(&tv); } return retval; } /* * Call eval_to_string() without using current local variables and using * textlock. When "use_sandbox" is TRUE use the sandbox. */ char_u * eval_to_string_safe( char_u *arg, char_u **nextcmd, int use_sandbox) { char_u *retval; void *save_funccalp; save_funccalp = save_funccal(); if (use_sandbox) ++sandbox; ++textlock; retval = eval_to_string(arg, nextcmd, FALSE); if (use_sandbox) --sandbox; --textlock; restore_funccal(save_funccalp); return retval; } /* * Top level evaluation function, returning a number. * Evaluates "expr" silently. * Returns -1 for an error. */ int eval_to_number(char_u *expr) { typval_T rettv; int retval; char_u *p = skipwhite(expr); ++emsg_off; if (eval1(&p, &rettv, TRUE) == FAIL) retval = -1; else { retval = get_tv_number_chk(&rettv, NULL); clear_tv(&rettv); } --emsg_off; return retval; } /* * Prepare v: variable "idx" to be used. * Save the current typeval in "save_tv". * When not used yet add the variable to the v: hashtable. */ static void prepare_vimvar(int idx, typval_T *save_tv) { *save_tv = vimvars[idx].vv_tv; if (vimvars[idx].vv_type == VAR_UNKNOWN) hash_add(&vimvarht, vimvars[idx].vv_di.di_key); } /* * Restore v: variable "idx" to typeval "save_tv". * When no longer defined, remove the variable from the v: hashtable. */ static void restore_vimvar(int idx, typval_T *save_tv) { hashitem_T *hi; vimvars[idx].vv_tv = *save_tv; if (vimvars[idx].vv_type == VAR_UNKNOWN) { hi = hash_find(&vimvarht, vimvars[idx].vv_di.di_key); if (HASHITEM_EMPTY(hi)) EMSG2(_(e_intern2), "restore_vimvar()"); else hash_remove(&vimvarht, hi); } } #if defined(FEAT_SPELL) || defined(PROTO) /* * Evaluate an expression to a list with suggestions. * For the "expr:" part of 'spellsuggest'. * Returns NULL when there is an error. */ list_T * eval_spell_expr(char_u *badword, char_u *expr) { typval_T save_val; typval_T rettv; list_T *list = NULL; char_u *p = skipwhite(expr); /* Set "v:val" to the bad word. */ prepare_vimvar(VV_VAL, &save_val); vimvars[VV_VAL].vv_type = VAR_STRING; vimvars[VV_VAL].vv_str = badword; if (p_verbose == 0) ++emsg_off; if (eval1(&p, &rettv, TRUE) == OK) { if (rettv.v_type != VAR_LIST) clear_tv(&rettv); else list = rettv.vval.v_list; } if (p_verbose == 0) --emsg_off; restore_vimvar(VV_VAL, &save_val); return list; } /* * "list" is supposed to contain two items: a word and a number. Return the * word in "pp" and the number as the return value. * Return -1 if anything isn't right. * Used to get the good word and score from the eval_spell_expr() result. */ int get_spellword(list_T *list, char_u **pp) { listitem_T *li; li = list->lv_first; if (li == NULL) return -1; *pp = get_tv_string(&li->li_tv); li = li->li_next; if (li == NULL) return -1; return get_tv_number(&li->li_tv); } #endif /* * Top level evaluation function. * Returns an allocated typval_T with the result. * Returns NULL when there is an error. */ typval_T * eval_expr(char_u *arg, char_u **nextcmd) { typval_T *tv; tv = (typval_T *)alloc(sizeof(typval_T)); if (tv != NULL && eval0(arg, tv, nextcmd, TRUE) == FAIL) { vim_free(tv); tv = NULL; } return tv; } /* * Call some vimL function and return the result in "*rettv". * Uses argv[argc] for the function arguments. Only Number and String * arguments are currently supported. * Returns OK or FAIL. */ int call_vim_function( char_u *func, int argc, char_u **argv, int safe, /* use the sandbox */ int str_arg_only, /* all arguments are strings */ typval_T *rettv) { typval_T *argvars; long n; int len; int i; int doesrange; void *save_funccalp = NULL; int ret; argvars = (typval_T *)alloc((unsigned)((argc + 1) * sizeof(typval_T))); if (argvars == NULL) return FAIL; for (i = 0; i < argc; i++) { /* Pass a NULL or empty argument as an empty string */ if (argv[i] == NULL || *argv[i] == NUL) { argvars[i].v_type = VAR_STRING; argvars[i].vval.v_string = (char_u *)""; continue; } if (str_arg_only) len = 0; else /* Recognize a number argument, the others must be strings. */ vim_str2nr(argv[i], NULL, &len, STR2NR_ALL, &n, NULL, 0); if (len != 0 && len == (int)STRLEN(argv[i])) { argvars[i].v_type = VAR_NUMBER; argvars[i].vval.v_number = n; } else { argvars[i].v_type = VAR_STRING; argvars[i].vval.v_string = argv[i]; } } if (safe) { save_funccalp = save_funccal(); ++sandbox; } rettv->v_type = VAR_UNKNOWN; /* clear_tv() uses this */ ret = call_func(func, (int)STRLEN(func), rettv, argc, argvars, curwin->w_cursor.lnum, curwin->w_cursor.lnum, &doesrange, TRUE, NULL, NULL); if (safe) { --sandbox; restore_funccal(save_funccalp); } vim_free(argvars); if (ret == FAIL) clear_tv(rettv); return ret; } /* * Call vimL function "func" and return the result as a number. * Returns -1 when calling the function fails. * Uses argv[argc] for the function arguments. */ long call_func_retnr( char_u *func, int argc, char_u **argv, int safe) /* use the sandbox */ { typval_T rettv; long retval; /* All arguments are passed as strings, no conversion to number. */ if (call_vim_function(func, argc, argv, safe, TRUE, &rettv) == FAIL) return -1; retval = get_tv_number_chk(&rettv, NULL); clear_tv(&rettv); return retval; } #if (defined(FEAT_USR_CMDS) && defined(FEAT_CMDL_COMPL)) \ || defined(FEAT_COMPL_FUNC) || defined(PROTO) # if (defined(FEAT_USR_CMDS) && defined(FEAT_CMDL_COMPL)) || defined(PROTO) /* * Call vimL function "func" and return the result as a string. * Returns NULL when calling the function fails. * Uses argv[argc] for the function arguments. */ void * call_func_retstr( char_u *func, int argc, char_u **argv, int safe) /* use the sandbox */ { typval_T rettv; char_u *retval; /* All arguments are passed as strings, no conversion to number. */ if (call_vim_function(func, argc, argv, safe, TRUE, &rettv) == FAIL) return NULL; retval = vim_strsave(get_tv_string(&rettv)); clear_tv(&rettv); return retval; } # endif /* * Call vimL function "func" and return the result as a List. * Uses argv[argc] for the function arguments. * Returns NULL when there is something wrong. */ void * call_func_retlist( char_u *func, int argc, char_u **argv, int safe) /* use the sandbox */ { typval_T rettv; /* All arguments are passed as strings, no conversion to number. */ if (call_vim_function(func, argc, argv, safe, TRUE, &rettv) == FAIL) return NULL; if (rettv.v_type != VAR_LIST) { clear_tv(&rettv); return NULL; } return rettv.vval.v_list; } #endif /* * Save the current function call pointer, and set it to NULL. * Used when executing autocommands and for ":source". */ void * save_funccal(void) { funccall_T *fc = current_funccal; current_funccal = NULL; return (void *)fc; } void restore_funccal(void *vfc) { funccall_T *fc = (funccall_T *)vfc; current_funccal = fc; } #if defined(FEAT_PROFILE) || defined(PROTO) /* * Prepare profiling for entering a child or something else that is not * counted for the script/function itself. * Should always be called in pair with prof_child_exit(). */ void prof_child_enter( proftime_T *tm) /* place to store waittime */ { funccall_T *fc = current_funccal; if (fc != NULL && fc->func->uf_profiling) profile_start(&fc->prof_child); script_prof_save(tm); } /* * Take care of time spent in a child. * Should always be called after prof_child_enter(). */ void prof_child_exit( proftime_T *tm) /* where waittime was stored */ { funccall_T *fc = current_funccal; if (fc != NULL && fc->func->uf_profiling) { profile_end(&fc->prof_child); profile_sub_wait(tm, &fc->prof_child); /* don't count waiting time */ profile_add(&fc->func->uf_tm_children, &fc->prof_child); profile_add(&fc->func->uf_tml_children, &fc->prof_child); } script_prof_restore(tm); } #endif #ifdef FEAT_FOLDING /* * Evaluate 'foldexpr'. Returns the foldlevel, and any character preceding * it in "*cp". Doesn't give error messages. */ int eval_foldexpr(char_u *arg, int *cp) { typval_T tv; int retval; char_u *s; int use_sandbox = was_set_insecurely((char_u *)"foldexpr", OPT_LOCAL); ++emsg_off; if (use_sandbox) ++sandbox; ++textlock; *cp = NUL; if (eval0(arg, &tv, NULL, TRUE) == FAIL) retval = 0; else { /* If the result is a number, just return the number. */ if (tv.v_type == VAR_NUMBER) retval = tv.vval.v_number; else if (tv.v_type != VAR_STRING || tv.vval.v_string == NULL) retval = 0; else { /* If the result is a string, check if there is a non-digit before * the number. */ s = tv.vval.v_string; if (!VIM_ISDIGIT(*s) && *s != '-') *cp = *s++; retval = atol((char *)s); } clear_tv(&tv); } --emsg_off; if (use_sandbox) --sandbox; --textlock; return retval; } #endif /* * ":let" list all variable values * ":let var1 var2" list variable values * ":let var = expr" assignment command. * ":let var += expr" assignment command. * ":let var -= expr" assignment command. * ":let var .= expr" assignment command. * ":let [var1, var2] = expr" unpack list. */ void ex_let(exarg_T *eap) { char_u *arg = eap->arg; char_u *expr = NULL; typval_T rettv; int i; int var_count = 0; int semicolon = 0; char_u op[2]; char_u *argend; int first = TRUE; argend = skip_var_list(arg, &var_count, &semicolon); if (argend == NULL) return; if (argend > arg && argend[-1] == '.') /* for var.='str' */ --argend; expr = skipwhite(argend); if (*expr != '=' && !(vim_strchr((char_u *)"+-.", *expr) != NULL && expr[1] == '=')) { /* * ":let" without "=": list variables */ if (*arg == '[') EMSG(_(e_invarg)); else if (!ends_excmd(*arg)) /* ":let var1 var2" */ arg = list_arg_vars(eap, arg, &first); else if (!eap->skip) { /* ":let" */ list_glob_vars(&first); list_buf_vars(&first); list_win_vars(&first); #ifdef FEAT_WINDOWS list_tab_vars(&first); #endif list_script_vars(&first); list_func_vars(&first); list_vim_vars(&first); } eap->nextcmd = check_nextcmd(arg); } else { op[0] = '='; op[1] = NUL; if (*expr != '=') { if (vim_strchr((char_u *)"+-.", *expr) != NULL) op[0] = *expr; /* +=, -= or .= */ expr = skipwhite(expr + 2); } else expr = skipwhite(expr + 1); if (eap->skip) ++emsg_skip; i = eval0(expr, &rettv, &eap->nextcmd, !eap->skip); if (eap->skip) { if (i != FAIL) clear_tv(&rettv); --emsg_skip; } else if (i != FAIL) { (void)ex_let_vars(eap->arg, &rettv, FALSE, semicolon, var_count, op); clear_tv(&rettv); } } } /* * Assign the typevalue "tv" to the variable or variables at "arg_start". * Handles both "var" with any type and "[var, var; var]" with a list type. * When "nextchars" is not NULL it points to a string with characters that * must appear after the variable(s). Use "+", "-" or "." for add, subtract * or concatenate. * Returns OK or FAIL; */ static int ex_let_vars( char_u *arg_start, typval_T *tv, int copy, /* copy values from "tv", don't move */ int semicolon, /* from skip_var_list() */ int var_count, /* from skip_var_list() */ char_u *nextchars) { char_u *arg = arg_start; list_T *l; int i; listitem_T *item; typval_T ltv; if (*arg != '[') { /* * ":let var = expr" or ":for var in list" */ if (ex_let_one(arg, tv, copy, nextchars, nextchars) == NULL) return FAIL; return OK; } /* * ":let [v1, v2] = list" or ":for [v1, v2] in listlist" */ if (tv->v_type != VAR_LIST || (l = tv->vval.v_list) == NULL) { EMSG(_(e_listreq)); return FAIL; } i = list_len(l); if (semicolon == 0 && var_count < i) { EMSG(_("E687: Less targets than List items")); return FAIL; } if (var_count - semicolon > i) { EMSG(_("E688: More targets than List items")); return FAIL; } item = l->lv_first; while (*arg != ']') { arg = skipwhite(arg + 1); arg = ex_let_one(arg, &item->li_tv, TRUE, (char_u *)",;]", nextchars); item = item->li_next; if (arg == NULL) return FAIL; arg = skipwhite(arg); if (*arg == ';') { /* Put the rest of the list (may be empty) in the var after ';'. * Create a new list for this. */ l = list_alloc(); if (l == NULL) return FAIL; while (item != NULL) { list_append_tv(l, &item->li_tv); item = item->li_next; } ltv.v_type = VAR_LIST; ltv.v_lock = 0; ltv.vval.v_list = l; l->lv_refcount = 1; arg = ex_let_one(skipwhite(arg + 1), <v, FALSE, (char_u *)"]", nextchars); clear_tv(<v); if (arg == NULL) return FAIL; break; } else if (*arg != ',' && *arg != ']') { EMSG2(_(e_intern2), "ex_let_vars()"); return FAIL; } } return OK; } /* * Skip over assignable variable "var" or list of variables "[var, var]". * Used for ":let varvar = expr" and ":for varvar in expr". * For "[var, var]" increment "*var_count" for each variable. * for "[var, var; var]" set "semicolon". * Return NULL for an error. */ static char_u * skip_var_list( char_u *arg, int *var_count, int *semicolon) { char_u *p, *s; if (*arg == '[') { /* "[var, var]": find the matching ']'. */ p = arg; for (;;) { p = skipwhite(p + 1); /* skip whites after '[', ';' or ',' */ s = skip_var_one(p); if (s == p) { EMSG2(_(e_invarg2), p); return NULL; } ++*var_count; p = skipwhite(s); if (*p == ']') break; else if (*p == ';') { if (*semicolon == 1) { EMSG(_("Double ; in list of variables")); return NULL; } *semicolon = 1; } else if (*p != ',') { EMSG2(_(e_invarg2), p); return NULL; } } return p + 1; } else return skip_var_one(arg); } /* * Skip one (assignable) variable name, including @r, $VAR, &option, d.key, * l[idx]. */ static char_u * skip_var_one(char_u *arg) { if (*arg == '@' && arg[1] != NUL) return arg + 2; return find_name_end(*arg == '$' || *arg == '&' ? arg + 1 : arg, NULL, NULL, FNE_INCL_BR | FNE_CHECK_START); } /* * List variables for hashtab "ht" with prefix "prefix". * If "empty" is TRUE also list NULL strings as empty strings. */ static void list_hashtable_vars( hashtab_T *ht, char_u *prefix, int empty, int *first) { hashitem_T *hi; dictitem_T *di; int todo; todo = (int)ht->ht_used; for (hi = ht->ht_array; todo > 0 && !got_int; ++hi) { if (!HASHITEM_EMPTY(hi)) { --todo; di = HI2DI(hi); if (empty || di->di_tv.v_type != VAR_STRING || di->di_tv.vval.v_string != NULL) list_one_var(di, prefix, first); } } } /* * List global variables. */ static void list_glob_vars(int *first) { list_hashtable_vars(&globvarht, (char_u *)"", TRUE, first); } /* * List buffer variables. */ static void list_buf_vars(int *first) { char_u numbuf[NUMBUFLEN]; list_hashtable_vars(&curbuf->b_vars->dv_hashtab, (char_u *)"b:", TRUE, first); sprintf((char *)numbuf, "%ld", (long)curbuf->b_changedtick); list_one_var_a((char_u *)"b:", (char_u *)"changedtick", VAR_NUMBER, numbuf, first); } /* * List window variables. */ static void list_win_vars(int *first) { list_hashtable_vars(&curwin->w_vars->dv_hashtab, (char_u *)"w:", TRUE, first); } #ifdef FEAT_WINDOWS /* * List tab page variables. */ static void list_tab_vars(int *first) { list_hashtable_vars(&curtab->tp_vars->dv_hashtab, (char_u *)"t:", TRUE, first); } #endif /* * List Vim variables. */ static void list_vim_vars(int *first) { list_hashtable_vars(&vimvarht, (char_u *)"v:", FALSE, first); } /* * List script-local variables, if there is a script. */ static void list_script_vars(int *first) { if (current_SID > 0 && current_SID <= ga_scripts.ga_len) list_hashtable_vars(&SCRIPT_VARS(current_SID), (char_u *)"s:", FALSE, first); } /* * List function variables, if there is a function. */ static void list_func_vars(int *first) { if (current_funccal != NULL) list_hashtable_vars(¤t_funccal->l_vars.dv_hashtab, (char_u *)"l:", FALSE, first); } /* * List variables in "arg". */ static char_u * list_arg_vars(exarg_T *eap, char_u *arg, int *first) { int error = FALSE; int len; char_u *name; char_u *name_start; char_u *arg_subsc; char_u *tofree; typval_T tv; while (!ends_excmd(*arg) && !got_int) { if (error || eap->skip) { arg = find_name_end(arg, NULL, NULL, FNE_INCL_BR | FNE_CHECK_START); if (!vim_iswhite(*arg) && !ends_excmd(*arg)) { emsg_severe = TRUE; EMSG(_(e_trailing)); break; } } else { /* get_name_len() takes care of expanding curly braces */ name_start = name = arg; len = get_name_len(&arg, &tofree, TRUE, TRUE); if (len <= 0) { /* This is mainly to keep test 49 working: when expanding * curly braces fails overrule the exception error message. */ if (len < 0 && !aborting()) { emsg_severe = TRUE; EMSG2(_(e_invarg2), arg); break; } error = TRUE; } else { if (tofree != NULL) name = tofree; if (get_var_tv(name, len, &tv, NULL, TRUE, FALSE) == FAIL) error = TRUE; else { /* handle d.key, l[idx], f(expr) */ arg_subsc = arg; if (handle_subscript(&arg, &tv, TRUE, TRUE) == FAIL) error = TRUE; else { if (arg == arg_subsc && len == 2 && name[1] == ':') { switch (*name) { case 'g': list_glob_vars(first); break; case 'b': list_buf_vars(first); break; case 'w': list_win_vars(first); break; #ifdef FEAT_WINDOWS case 't': list_tab_vars(first); break; #endif case 'v': list_vim_vars(first); break; case 's': list_script_vars(first); break; case 'l': list_func_vars(first); break; default: EMSG2(_("E738: Can't list variables for %s"), name); } } else { char_u numbuf[NUMBUFLEN]; char_u *tf; int c; char_u *s; s = echo_string(&tv, &tf, numbuf, 0); c = *arg; *arg = NUL; list_one_var_a((char_u *)"", arg == arg_subsc ? name : name_start, tv.v_type, s == NULL ? (char_u *)"" : s, first); *arg = c; vim_free(tf); } clear_tv(&tv); } } } vim_free(tofree); } arg = skipwhite(arg); } return arg; } /* * Set one item of ":let var = expr" or ":let [v1, v2] = list" to its value. * Returns a pointer to the char just after the var name. * Returns NULL if there is an error. */ static char_u * ex_let_one( char_u *arg, /* points to variable name */ typval_T *tv, /* value to assign to variable */ int copy, /* copy value from "tv" */ char_u *endchars, /* valid chars after variable name or NULL */ char_u *op) /* "+", "-", "." or NULL*/ { int c1; char_u *name; char_u *p; char_u *arg_end = NULL; int len; int opt_flags; char_u *tofree = NULL; /* * ":let $VAR = expr": Set environment variable. */ if (*arg == '$') { /* Find the end of the name. */ ++arg; name = arg; len = get_env_len(&arg); if (len == 0) EMSG2(_(e_invarg2), name - 1); else { if (op != NULL && (*op == '+' || *op == '-')) EMSG2(_(e_letwrong), op); else if (endchars != NULL && vim_strchr(endchars, *skipwhite(arg)) == NULL) EMSG(_(e_letunexp)); else if (!check_secure()) { c1 = name[len]; name[len] = NUL; p = get_tv_string_chk(tv); if (p != NULL && op != NULL && *op == '.') { int mustfree = FALSE; char_u *s = vim_getenv(name, &mustfree); if (s != NULL) { p = tofree = concat_str(s, p); if (mustfree) vim_free(s); } } if (p != NULL) { 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; arg_end = arg; } name[len] = c1; vim_free(tofree); } } } /* * ":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 == '&') { /* Find the end of the name. */ p = find_option_end(&arg, &opt_flags); if (p == NULL || (endchars != NULL && vim_strchr(endchars, *skipwhite(p)) == NULL)) EMSG(_(e_letunexp)); else { long n; int opt_type; long numval; char_u *stringval = NULL; char_u *s; c1 = *p; *p = NUL; n = get_tv_number(tv); s = get_tv_string_chk(tv); /* != NULL if number or string */ if (s != NULL && op != NULL && *op != '=') { opt_type = get_option_value(arg, &numval, &stringval, opt_flags); if ((opt_type == 1 && *op == '.') || (opt_type == 0 && *op != '.')) EMSG2(_(e_letwrong), op); else { if (opt_type == 1) /* number */ { if (*op == '+') n = numval + n; else n = numval - n; } else if (opt_type == 0 && stringval != NULL) /* string */ { s = concat_str(stringval, s); vim_free(stringval); stringval = s; } } } if (s != NULL) { set_option_value(arg, n, s, opt_flags); arg_end = p; } *p = c1; vim_free(stringval); } } /* * ":let @r = expr": Set register contents. */ else if (*arg == '@') { ++arg; if (op != NULL && (*op == '+' || *op == '-')) EMSG2(_(e_letwrong), op); else if (endchars != NULL && vim_strchr(endchars, *skipwhite(arg + 1)) == NULL) EMSG(_(e_letunexp)); else { char_u *ptofree = NULL; char_u *s; p = get_tv_string_chk(tv); if (p != NULL && op != NULL && *op == '.') { s = get_reg_contents(*arg == '@' ? '"' : *arg, GREG_EXPR_SRC); if (s != NULL) { p = ptofree = concat_str(s, p); vim_free(s); } } if (p != NULL) { write_reg_contents(*arg == '@' ? '"' : *arg, p, -1, FALSE); arg_end = arg + 1; } vim_free(ptofree); } } /* * ":let var = expr": Set internal variable. * ":let {expr} = expr": Idem, name made with curly braces */ else if (eval_isnamec1(*arg) || *arg == '{') { lval_T lv; p = get_lval(arg, tv, &lv, FALSE, FALSE, 0, FNE_CHECK_START); if (p != NULL && lv.ll_name != NULL) { if (endchars != NULL && vim_strchr(endchars, *skipwhite(p)) == NULL) EMSG(_(e_letunexp)); else { set_var_lval(&lv, p, tv, copy, op); arg_end = p; } } clear_lval(&lv); } else EMSG2(_(e_invarg2), arg); return arg_end; } /* * If "arg" is equal to "b:changedtick" give an error and return TRUE. */ static int check_changedtick(char_u *arg) { if (STRNCMP(arg, "b:changedtick", 13) == 0 && !eval_isnamec(arg[13])) { EMSG2(_(e_readonlyvar), arg); return TRUE; } return FALSE; } /* * Get an lval: variable, Dict item or List item that can be assigned a value * to: "name", "na{me}", "name[expr]", "name[expr:expr]", "name[expr][expr]", * "name.key", "name.key[expr]" etc. * Indexing only works if "name" is an existing List or Dictionary. * "name" points to the start of the name. * If "rettv" is not NULL it points to the value to be assigned. * "unlet" is TRUE for ":unlet": slightly different behavior when something is * wrong; must end in space or cmd separator. * * flags: * GLV_QUIET: do not give error messages * GLV_NO_AUTOLOAD: do not use script autoloading * * Returns a pointer to just after the name, including indexes. * When an evaluation error occurs "lp->ll_name" is NULL; * Returns NULL for a parsing error. Still need to free items in "lp"! */ static char_u * get_lval( char_u *name, typval_T *rettv, lval_T *lp, int unlet, int skip, int flags, /* GLV_ values */ int fne_flags) /* flags for find_name_end() */ { char_u *p; char_u *expr_start, *expr_end; int cc; dictitem_T *v; typval_T var1; typval_T var2; int empty1 = FALSE; listitem_T *ni; char_u *key = NULL; int len; hashtab_T *ht; int quiet = flags & GLV_QUIET; /* Clear everything in "lp". */ vim_memset(lp, 0, sizeof(lval_T)); if (skip) { /* When skipping just find the end of the name. */ lp->ll_name = name; return find_name_end(name, NULL, NULL, FNE_INCL_BR | fne_flags); } /* Find the end of the name. */ p = find_name_end(name, &expr_start, &expr_end, fne_flags); if (expr_start != NULL) { /* Don't expand the name when we already know there is an error. */ if (unlet && !vim_iswhite(*p) && !ends_excmd(*p) && *p != '[' && *p != '.') { EMSG(_(e_trailing)); return NULL; } lp->ll_exp_name = make_expanded_name(name, expr_start, expr_end, p); if (lp->ll_exp_name == 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() && !quiet) { emsg_severe = TRUE; EMSG2(_(e_invarg2), name); return NULL; } } lp->ll_name = lp->ll_exp_name; } else lp->ll_name = name; /* Without [idx] or .key we are done. */ if ((*p != '[' && *p != '.') || lp->ll_name == NULL) return p; cc = *p; *p = NUL; v = find_var(lp->ll_name, &ht, flags & GLV_NO_AUTOLOAD); if (v == NULL && !quiet) EMSG2(_(e_undefvar), lp->ll_name); *p = cc; if (v == NULL) return NULL; /* * Loop until no more [idx] or .key is following. */ lp->ll_tv = &v->di_tv; while (*p == '[' || (*p == '.' && lp->ll_tv->v_type == VAR_DICT)) { if (!(lp->ll_tv->v_type == VAR_LIST && lp->ll_tv->vval.v_list != NULL) && !(lp->ll_tv->v_type == VAR_DICT && lp->ll_tv->vval.v_dict != NULL)) { if (!quiet) EMSG(_("E689: Can only index a List or Dictionary")); return NULL; } if (lp->ll_range) { if (!quiet) EMSG(_("E708: [:] must come last")); return NULL; } len = -1; if (*p == '.') { key = p + 1; for (len = 0; ASCII_ISALNUM(key[len]) || key[len] == '_'; ++len) ; if (len == 0) { if (!quiet) EMSG(_(e_emptykey)); return NULL; } p = key + len; } else { /* Get the index [expr] or the first index [expr: ]. */ p = skipwhite(p + 1); if (*p == ':') empty1 = TRUE; else { empty1 = FALSE; if (eval1(&p, &var1, TRUE) == FAIL) /* recursive! */ return NULL; if (get_tv_string_chk(&var1) == NULL) { /* not a number or string */ clear_tv(&var1); return NULL; } } /* Optionally get the second index [ :expr]. */ if (*p == ':') { if (lp->ll_tv->v_type == VAR_DICT) { if (!quiet) EMSG(_(e_dictrange)); if (!empty1) clear_tv(&var1); return NULL; } if (rettv != NULL && (rettv->v_type != VAR_LIST || rettv->vval.v_list == NULL)) { if (!quiet) EMSG(_("E709: [:] requires a List value")); if (!empty1) clear_tv(&var1); return NULL; } p = skipwhite(p + 1); if (*p == ']') lp->ll_empty2 = TRUE; else { lp->ll_empty2 = FALSE; if (eval1(&p, &var2, TRUE) == FAIL) /* recursive! */ { if (!empty1) clear_tv(&var1); return NULL; } if (get_tv_string_chk(&var2) == NULL) { /* not a number or string */ if (!empty1) clear_tv(&var1); clear_tv(&var2); return NULL; } } lp->ll_range = TRUE; } else lp->ll_range = FALSE; if (*p != ']') { if (!quiet) EMSG(_(e_missbrac)); if (!empty1) clear_tv(&var1); if (lp->ll_range && !lp->ll_empty2) clear_tv(&var2); return NULL; } /* Skip to past ']'. */ ++p; } if (lp->ll_tv->v_type == VAR_DICT) { if (len == -1) { /* "[key]": get key from "var1" */ key = get_tv_string(&var1); /* is number or string */ if (*key == NUL) { if (!quiet) EMSG(_(e_emptykey)); clear_tv(&var1); return NULL; } } lp->ll_list = NULL; lp->ll_dict = lp->ll_tv->vval.v_dict; lp->ll_di = dict_find(lp->ll_dict, key, len); /* When assigning to a scope dictionary check that a function and * variable name is valid (only variable name unless it is l: or * g: dictionary). Disallow overwriting a builtin function. */ if (rettv != NULL && lp->ll_dict->dv_scope != 0) { int prevval; int wrong; if (len != -1) { prevval = key[len]; key[len] = NUL; } else prevval = 0; /* avoid compiler warning */ wrong = (lp->ll_dict->dv_scope == VAR_DEF_SCOPE && rettv->v_type == VAR_FUNC && var_check_func_name(key, lp->ll_di == NULL)) || !valid_varname(key); if (len != -1) key[len] = prevval; if (wrong) return NULL; } if (lp->ll_di == NULL) { /* Can't add "v:" variable. */ if (lp->ll_dict == &vimvardict) { EMSG2(_(e_illvar), name); return NULL; } /* Key does not exist in dict: may need to add it. */ if (*p == '[' || *p == '.' || unlet) { if (!quiet) EMSG2(_(e_dictkey), key); if (len == -1) clear_tv(&var1); return NULL; } if (len == -1) lp->ll_newkey = vim_strsave(key); else lp->ll_newkey = vim_strnsave(key, len); if (len == -1) clear_tv(&var1); if (lp->ll_newkey == NULL) p = NULL; break; } /* existing variable, need to check if it can be changed */ else if (var_check_ro(lp->ll_di->di_flags, name, FALSE)) return NULL; if (len == -1) clear_tv(&var1); lp->ll_tv = &lp->ll_di->di_tv; } else { /* * Get the number and item for the only or first index of the List. */ if (empty1) lp->ll_n1 = 0; else { lp->ll_n1 = get_tv_number(&var1); /* is number or string */ clear_tv(&var1); } lp->ll_dict = NULL; lp->ll_list = lp->ll_tv->vval.v_list; lp->ll_li = list_find(lp->ll_list, lp->ll_n1); if (lp->ll_li == NULL) { if (lp->ll_n1 < 0) { lp->ll_n1 = 0; lp->ll_li = list_find(lp->ll_list, lp->ll_n1); } } if (lp->ll_li == NULL) { if (lp->ll_range && !lp->ll_empty2) clear_tv(&var2); if (!quiet) EMSGN(_(e_listidx), lp->ll_n1); return NULL; } /* * May need to find the item or absolute index for the second * index of a range. * When no index given: "lp->ll_empty2" is TRUE. * Otherwise "lp->ll_n2" is set to the second index. */ if (lp->ll_range && !lp->ll_empty2) { lp->ll_n2 = get_tv_number(&var2); /* is number or string */ clear_tv(&var2); if (lp->ll_n2 < 0) { ni = list_find(lp->ll_list, lp->ll_n2); if (ni == NULL) { if (!quiet) EMSGN(_(e_listidx), lp->ll_n2); return NULL; } lp->ll_n2 = list_idx_of_item(lp->ll_list, ni); } /* Check that lp->ll_n2 isn't before lp->ll_n1. */ if (lp->ll_n1 < 0) lp->ll_n1 = list_idx_of_item(lp->ll_list, lp->ll_li); if (lp->ll_n2 < lp->ll_n1) { if (!quiet) EMSGN(_(e_listidx), lp->ll_n2); return NULL; } } lp->ll_tv = &lp->ll_li->li_tv; } } return p; } /* * Clear lval "lp" that was filled by get_lval(). */ static void clear_lval(lval_T *lp) { vim_free(lp->ll_exp_name); vim_free(lp->ll_newkey); } /* * Set a variable that was parsed by get_lval() to "rettv". * "endp" points to just after the parsed name. * "op" is NULL, "+" for "+=", "-" for "-=", "." for ".=" or "=" for "=". */ static void set_var_lval( lval_T *lp, char_u *endp, typval_T *rettv, int copy, char_u *op) { int cc; listitem_T *ri; dictitem_T *di; if (lp->ll_tv == NULL) { if (!check_changedtick(lp->ll_name)) { cc = *endp; *endp = NUL; if (op != NULL && *op != '=') { typval_T tv; /* handle +=, -= and .= */ di = NULL; if (get_var_tv(lp->ll_name, (int)STRLEN(lp->ll_name), &tv, &di, TRUE, FALSE) == OK) { if ((di == NULL || (!var_check_ro(di->di_flags, lp->ll_name, FALSE) && !tv_check_lock(di->di_tv.v_lock, lp->ll_name, FALSE))) && tv_op(&tv, rettv, op) == OK) set_var(lp->ll_name, &tv, FALSE); clear_tv(&tv); } } else set_var(lp->ll_name, rettv, copy); *endp = cc; } } else if (tv_check_lock(lp->ll_newkey == NULL ? lp->ll_tv->v_lock : lp->ll_tv->vval.v_dict->dv_lock, lp->ll_name, FALSE)) ; else if (lp->ll_range) { listitem_T *ll_li = lp->ll_li; int ll_n1 = lp->ll_n1; /* * Check whether any of the list items is locked */ for (ri = rettv->vval.v_list->lv_first; ri != NULL && ll_li != NULL; ) { if (tv_check_lock(ll_li->li_tv.v_lock, lp->ll_name, FALSE)) return; ri = ri->li_next; if (ri == NULL || (!lp->ll_empty2 && lp->ll_n2 == ll_n1)) break; ll_li = ll_li->li_next; ++ll_n1; } /* * Assign the List values to the list items. */ for (ri = rettv->vval.v_list->lv_first; ri != NULL; ) { if (op != NULL && *op != '=') tv_op(&lp->ll_li->li_tv, &ri->li_tv, op); else { clear_tv(&lp->ll_li->li_tv); copy_tv(&ri->li_tv, &lp->ll_li->li_tv); } ri = ri->li_next; if (ri == NULL || (!lp->ll_empty2 && lp->ll_n2 == lp->ll_n1)) break; if (lp->ll_li->li_next == NULL) { /* Need to add an empty item. */ if (list_append_number(lp->ll_list, 0) == FAIL) { ri = NULL; break; } } lp->ll_li = lp->ll_li->li_next; ++lp->ll_n1; } if (ri != NULL) EMSG(_("E710: List value has more items than target")); else if (lp->ll_empty2 ? (lp->ll_li != NULL && lp->ll_li->li_next != NULL) : lp->ll_n1 != lp->ll_n2) EMSG(_("E711: List value has not enough items")); } else { /* * Assign to a List or Dictionary item. */ if (lp->ll_newkey != NULL) { if (op != NULL && *op != '=') { EMSG2(_(e_letwrong), op); return; } /* Need to add an item to the Dictionary. */ di = dictitem_alloc(lp->ll_newkey); if (di == NULL) return; if (dict_add(lp->ll_tv->vval.v_dict, di) == FAIL) { vim_free(di); return; } lp->ll_tv = &di->di_tv; } else if (op != NULL && *op != '=') { tv_op(lp->ll_tv, rettv, op); return; } else clear_tv(lp->ll_tv); /* * Assign the value to the variable or list item. */ if (copy) copy_tv(rettv, lp->ll_tv); else { *lp->ll_tv = *rettv; lp->ll_tv->v_lock = 0; init_tv(rettv); } } } /* * Handle "tv1 += tv2", "tv1 -= tv2" and "tv1 .= tv2" * Returns OK or FAIL. */ static int tv_op(typval_T *tv1, typval_T *tv2, char_u *op) { long n; char_u numbuf[NUMBUFLEN]; char_u *s; /* Can't do anything with a Funcref, Dict, v:true on the right. */ if (tv2->v_type != VAR_FUNC && tv2->v_type != VAR_DICT && tv2->v_type != VAR_SPECIAL) { switch (tv1->v_type) { case VAR_UNKNOWN: case VAR_DICT: case VAR_FUNC: case VAR_PARTIAL: case VAR_SPECIAL: case VAR_JOB: case VAR_CHANNEL: break; case VAR_LIST: if (*op != '+' || tv2->v_type != VAR_LIST) break; /* List += List */ if (tv1->vval.v_list != NULL && tv2->vval.v_list != NULL) list_extend(tv1->vval.v_list, tv2->vval.v_list, NULL); return OK; case VAR_NUMBER: case VAR_STRING: if (tv2->v_type == VAR_LIST) break; if (*op == '+' || *op == '-') { /* nr += nr or nr -= nr*/ n = get_tv_number(tv1); #ifdef FEAT_FLOAT if (tv2->v_type == VAR_FLOAT) { float_T f = n; if (*op == '+') f += tv2->vval.v_float; else f -= tv2->vval.v_float; clear_tv(tv1); tv1->v_type = VAR_FLOAT; tv1->vval.v_float = f; } else #endif { if (*op == '+') n += get_tv_number(tv2); else n -= get_tv_number(tv2); clear_tv(tv1); tv1->v_type = VAR_NUMBER; tv1->vval.v_number = n; } } else { if (tv2->v_type == VAR_FLOAT) break; /* str .= str */ s = get_tv_string(tv1); s = concat_str(s, get_tv_string_buf(tv2, numbuf)); clear_tv(tv1); tv1->v_type = VAR_STRING; tv1->vval.v_string = s; } return OK; case VAR_FLOAT: #ifdef FEAT_FLOAT { float_T f; if (*op == '.' || (tv2->v_type != VAR_FLOAT && tv2->v_type != VAR_NUMBER && tv2->v_type != VAR_STRING)) break; if (tv2->v_type == VAR_FLOAT) f = tv2->vval.v_float; else f = get_tv_number(tv2); if (*op == '+') tv1->vval.v_float += f; else tv1->vval.v_float -= f; } #endif return OK; } } EMSG2(_(e_letwrong), op); return FAIL; } /* * Add a watcher to a list. */ void list_add_watch(list_T *l, listwatch_T *lw) { lw->lw_next = l->lv_watch; l->lv_watch = lw; } /* * Remove a watcher from a list. * No warning when it isn't found... */ void list_rem_watch(list_T *l, listwatch_T *lwrem) { listwatch_T *lw, **lwp; lwp = &l->lv_watch; for (lw = l->lv_watch; lw != NULL; lw = lw->lw_next) { if (lw == lwrem) { *lwp = lw->lw_next; break; } lwp = &lw->lw_next; } } /* * Just before removing an item from a list: advance watchers to the next * item. */ static void list_fix_watch(list_T *l, listitem_T *item) { listwatch_T *lw; for (lw = l->lv_watch; lw != NULL; lw = lw->lw_next) if (lw->lw_item == item) lw->lw_item = item->li_next; } /* * Evaluate the expression used in a ":for var in expr" command. * "arg" points to "var". * Set "*errp" to TRUE for an error, FALSE otherwise; * Return a pointer that holds the info. Null when there is an error. */ void * eval_for_line( char_u *arg, int *errp, char_u **nextcmdp, int skip) { forinfo_T *fi; char_u *expr; typval_T tv; list_T *l; *errp = TRUE; /* default: there is an error */ fi = (forinfo_T *)alloc_clear(sizeof(forinfo_T)); if (fi == NULL) return NULL; expr = skip_var_list(arg, &fi->fi_varcount, &fi->fi_semicolon); if (expr == NULL) return fi; expr = skipwhite(expr); if (expr[0] != 'i' || expr[1] != 'n' || !vim_iswhite(expr[2])) { EMSG(_("E690: Missing \"in\" after :for")); return fi; } if (skip) ++emsg_skip; if (eval0(skipwhite(expr + 2), &tv, nextcmdp, !skip) == OK) { *errp = FALSE; if (!skip) { l = tv.vval.v_list; if (tv.v_type != VAR_LIST || l == NULL) { EMSG(_(e_listreq)); clear_tv(&tv); } else { /* No need to increment the refcount, it's already set for the * list being used in "tv". */ fi->fi_list = l; list_add_watch(l, &fi->fi_lw); fi->fi_lw.lw_item = l->lv_first; } } } if (skip) --emsg_skip; return fi; } /* * Use the first item in a ":for" list. Advance to the next. * Assign the values to the variable (list). "arg" points to the first one. * Return TRUE when a valid item was found, FALSE when at end of list or * something wrong. */ int next_for_item(void *fi_void, char_u *arg) { forinfo_T *fi = (forinfo_T *)fi_void; int result; listitem_T *item; item = fi->fi_lw.lw_item; if (item == NULL) result = FALSE; else { fi->fi_lw.lw_item = item->li_next; result = (ex_let_vars(arg, &item->li_tv, TRUE, fi->fi_semicolon, fi->fi_varcount, NULL) == OK); } return result; } /* * Free the structure used to store info used by ":for". */ void free_for_info(void *fi_void) { forinfo_T *fi = (forinfo_T *)fi_void; if (fi != NULL && fi->fi_list != NULL) { list_rem_watch(fi->fi_list, &fi->fi_lw); list_unref(fi->fi_list); } vim_free(fi); } #if defined(FEAT_CMDL_COMPL) || defined(PROTO) void set_context_for_expression( expand_T *xp, char_u *arg, cmdidx_T cmdidx) { int got_eq = FALSE; int c; char_u *p; if (cmdidx == CMD_let) { xp->xp_context = EXPAND_USER_VARS; if (vim_strpbrk(arg, (char_u *)"\"'+-*/%.=!?~|&$([<>,#") == NULL) { /* ":let var1 var2 ...": find last space. */ for (p = arg + STRLEN(arg); p >= arg; ) { xp->xp_pattern = p; mb_ptr_back(arg, p); if (vim_iswhite(*p)) break; } return; } } else xp->xp_context = 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; if ((c == 'l' || c == 'g') && xp->xp_pattern[2] == ':') xp->xp_pattern += 2; } } 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_EXPRESSION) { /* Autoload function/variable contains '#'. */ break; } else if ((c == '<' || c == '#') && xp->xp_context == EXPAND_FUNCTIONS && vim_strchr(xp->xp_pattern, '(') == NULL) { /* Function name can start with "" and contain '#'. */ 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 */ { /* Trick: '' is like stopping and starting a 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 /* Doesn't look like something valid, expand as an expression * anyway. */ xp->xp_context = EXPAND_EXPRESSION; 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(exarg_T *eap) { char_u *arg = eap->arg; char_u *startarg; char_u *name; char_u *tofree; int len; typval_T rettv; linenr_T lnum; int doesrange; int failed = FALSE; funcdict_T fudi; partial_T *partial = NULL; if (eap->skip) { /* trans_function_name() doesn't work well when skipping, use eval0() * instead to skip to any following command, e.g. for: * :if 0 | call dict.foo().bar() | endif */ ++emsg_skip; if (eval0(eap->arg, &rettv, &eap->nextcmd, FALSE) != FAIL) clear_tv(&rettv); --emsg_skip; return; } tofree = trans_function_name(&arg, eap->skip, TFN_INT, &fudi, &partial); if (fudi.fd_newkey != NULL) { /* Still need to give an error message for missing key. */ EMSG2(_(e_dictkey), fudi.fd_newkey); vim_free(fudi.fd_newkey); } if (tofree == NULL) return; /* Increase refcount on dictionary, it could get deleted when evaluating * the arguments. */ if (fudi.fd_dict != NULL) ++fudi.fd_dict->dv_refcount; /* If it is the name of a variable of type VAR_FUNC or VAR_PARTIAL use its * contents. For VAR_PARTIAL get its partial, unless we already have one * from trans_function_name(). */ len = (int)STRLEN(tofree); name = deref_func_name(tofree, &len, partial != NULL ? NULL : &partial, FALSE); /* Skip white space to allow ":call func ()". Not good, but required for * backward compatibility. */ startarg = skipwhite(arg); rettv.v_type = VAR_UNKNOWN; /* clear_tv() uses this */ if (*startarg != '(') { EMSG2(_("E107: Missing parentheses: %s"), eap->arg); 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; #ifdef FEAT_VIRTUALEDIT curwin->w_cursor.coladd = 0; #endif } arg = startarg; if (get_func_tv(name, (int)STRLEN(name), &rettv, &arg, eap->line1, eap->line2, &doesrange, !eap->skip, partial, fudi.fd_dict) == FAIL) { failed = TRUE; break; } /* Handle a function returning a Funcref, Dictionary or List. */ if (handle_subscript(&arg, &rettv, !eap->skip, TRUE) == FAIL) { failed = TRUE; break; } clear_tv(&rettv); 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_tv() 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: dict_unref(fudi.fd_dict); vim_free(tofree); } /* * ":unlet[!] var1 ... " command. */ void ex_unlet(exarg_T *eap) { ex_unletlock(eap, eap->arg, 0); } /* * ":lockvar" and ":unlockvar" commands */ void ex_lockvar(exarg_T *eap) { char_u *arg = eap->arg; int deep = 2; if (eap->forceit) deep = -1; else if (vim_isdigit(*arg)) { deep = getdigits(&arg); arg = skipwhite(arg); } ex_unletlock(eap, arg, deep); } /* * ":unlet", ":lockvar" and ":unlockvar" are quite similar. */ static void ex_unletlock( exarg_T *eap, char_u *argstart, int deep) { char_u *arg = argstart; char_u *name_end; int error = FALSE; lval_T lv; do { /* Parse the name and find the end. */ name_end = get_lval(arg, NULL, &lv, TRUE, eap->skip || error, 0, FNE_CHECK_START); if (lv.ll_name == NULL) error = TRUE; /* error but continue parsing */ if (name_end == NULL || (!vim_iswhite(*name_end) && !ends_excmd(*name_end))) { if (name_end != NULL) { emsg_severe = TRUE; EMSG(_(e_trailing)); } if (!(eap->skip || error)) clear_lval(&lv); break; } if (!error && !eap->skip) { if (eap->cmdidx == CMD_unlet) { if (do_unlet_var(&lv, name_end, eap->forceit) == FAIL) error = TRUE; } else { if (do_lock_var(&lv, name_end, deep, eap->cmdidx == CMD_lockvar) == FAIL) error = TRUE; } } if (!eap->skip) clear_lval(&lv); arg = skipwhite(name_end); } while (!ends_excmd(*arg)); eap->nextcmd = check_nextcmd(arg); } static int do_unlet_var( lval_T *lp, char_u *name_end, int forceit) { int ret = OK; int cc; if (lp->ll_tv == NULL) { cc = *name_end; *name_end = NUL; /* Normal name or expanded name. */ if (check_changedtick(lp->ll_name)) ret = FAIL; else if (do_unlet(lp->ll_name, forceit) == FAIL) ret = FAIL; *name_end = cc; } else if ((lp->ll_list != NULL && tv_check_lock(lp->ll_list->lv_lock, lp->ll_name, FALSE)) || (lp->ll_dict != NULL && tv_check_lock(lp->ll_dict->dv_lock, lp->ll_name, FALSE))) return FAIL; else if (lp->ll_range) { listitem_T *li; listitem_T *ll_li = lp->ll_li; int ll_n1 = lp->ll_n1; while (ll_li != NULL && (lp->ll_empty2 || lp->ll_n2 >= ll_n1)) { li = ll_li->li_next; if (tv_check_lock(ll_li->li_tv.v_lock, lp->ll_name, FALSE)) return FAIL; ll_li = li; ++ll_n1; } /* Delete a range of List items. */ while (lp->ll_li != NULL && (lp->ll_empty2 || lp->ll_n2 >= lp->ll_n1)) { li = lp->ll_li->li_next; listitem_remove(lp->ll_list, lp->ll_li); lp->ll_li = li; ++lp->ll_n1; } } else { if (lp->ll_list != NULL) /* unlet a List item. */ listitem_remove(lp->ll_list, lp->ll_li); else /* unlet a Dictionary item. */ dictitem_remove(lp->ll_dict, lp->ll_di); } return ret; } /* * "unlet" a variable. Return OK if it existed, FAIL if not. * When "forceit" is TRUE don't complain if the variable doesn't exist. */ int do_unlet(char_u *name, int forceit) { hashtab_T *ht; hashitem_T *hi; char_u *varname; dict_T *d; dictitem_T *di; ht = find_var_ht(name, &varname); if (ht != NULL && *varname != NUL) { if (ht == &globvarht) d = &globvardict; else if (current_funccal != NULL && ht == ¤t_funccal->l_vars.dv_hashtab) d = ¤t_funccal->l_vars; else if (ht == &compat_hashtab) d = &vimvardict; else { di = find_var_in_ht(ht, *name, (char_u *)"", FALSE); d = di == NULL ? NULL : di->di_tv.vval.v_dict; } if (d == NULL) { EMSG2(_(e_intern2), "do_unlet()"); return FAIL; } hi = hash_find(ht, varname); if (!HASHITEM_EMPTY(hi)) { di = HI2DI(hi); if (var_check_fixed(di->di_flags, name, FALSE) || var_check_ro(di->di_flags, name, FALSE) || tv_check_lock(d->dv_lock, name, FALSE)) return FAIL; delete_var(ht, hi); return OK; } } if (forceit) return OK; EMSG2(_("E108: No such variable: \"%s\""), name); return FAIL; } /* * Lock or unlock variable indicated by "lp". * "deep" is the levels to go (-1 for unlimited); * "lock" is TRUE for ":lockvar", FALSE for ":unlockvar". */ static int do_lock_var( lval_T *lp, char_u *name_end, int deep, int lock) { int ret = OK; int cc; dictitem_T *di; if (deep == 0) /* nothing to do */ return OK; if (lp->ll_tv == NULL) { cc = *name_end; *name_end = NUL; /* Normal name or expanded name. */ if (check_changedtick(lp->ll_name)) ret = FAIL; else { di = find_var(lp->ll_name, NULL, TRUE); if (di == NULL) ret = FAIL; else { if (lock) di->di_flags |= DI_FLAGS_LOCK; else di->di_flags &= ~DI_FLAGS_LOCK; item_lock(&di->di_tv, deep, lock); } } *name_end = cc; } else if (lp->ll_range) { listitem_T *li = lp->ll_li; /* (un)lock a range of List items. */ while (li != NULL && (lp->ll_empty2 || lp->ll_n2 >= lp->ll_n1)) { item_lock(&li->li_tv, deep, lock); li = li->li_next; ++lp->ll_n1; } } else if (lp->ll_list != NULL) /* (un)lock a List item. */ item_lock(&lp->ll_li->li_tv, deep, lock); else /* (un)lock a Dictionary item. */ item_lock(&lp->ll_di->di_tv, deep, lock); return ret; } /* * Lock or unlock an item. "deep" is nr of levels to go. */ static void item_lock(typval_T *tv, int deep, int lock) { static int recurse = 0; list_T *l; listitem_T *li; dict_T *d; hashitem_T *hi; int todo; if (recurse >= DICT_MAXNEST) { EMSG(_("E743: variable nested too deep for (un)lock")); return; } if (deep == 0) return; ++recurse; /* lock/unlock the item itself */ if (lock) tv->v_lock |= VAR_LOCKED; else tv->v_lock &= ~VAR_LOCKED; switch (tv->v_type) { case VAR_UNKNOWN: case VAR_NUMBER: case VAR_STRING: case VAR_FUNC: case VAR_PARTIAL: case VAR_FLOAT: case VAR_SPECIAL: case VAR_JOB: case VAR_CHANNEL: break; case VAR_LIST: if ((l = tv->vval.v_list) != NULL) { if (lock) l->lv_lock |= VAR_LOCKED; else l->lv_lock &= ~VAR_LOCKED; if (deep < 0 || deep > 1) /* recursive: lock/unlock the items the List contains */ for (li = l->lv_first; li != NULL; li = li->li_next) item_lock(&li->li_tv, deep - 1, lock); } break; case VAR_DICT: if ((d = tv->vval.v_dict) != NULL) { if (lock) d->dv_lock |= VAR_LOCKED; else d->dv_lock &= ~VAR_LOCKED; if (deep < 0 || deep > 1) { /* recursive: lock/unlock the items the List contains */ todo = (int)d->dv_hashtab.ht_used; for (hi = d->dv_hashtab.ht_array; todo > 0; ++hi) { if (!HASHITEM_EMPTY(hi)) { --todo; item_lock(&HI2DI(hi)->di_tv, deep - 1, lock); } } } } } --recurse; } /* * Return TRUE if typeval "tv" is locked: Either that value is locked itself * or it refers to a List or Dictionary that is locked. */ static int tv_islocked(typval_T *tv) { return (tv->v_lock & VAR_LOCKED) || (tv->v_type == VAR_LIST && tv->vval.v_list != NULL && (tv->vval.v_list->lv_lock & VAR_LOCKED)) || (tv->v_type == VAR_DICT && tv->vval.v_dict != NULL && (tv->vval.v_dict->dv_lock & VAR_LOCKED)); } #if (defined(FEAT_MENU) && defined(FEAT_MULTI_LANG)) || defined(PROTO) /* * Delete all "menutrans_" variables. */ void del_menutrans_vars(void) { hashitem_T *hi; int todo; hash_lock(&globvarht); todo = (int)globvarht.ht_used; for (hi = globvarht.ht_array; todo > 0 && !got_int; ++hi) { if (!HASHITEM_EMPTY(hi)) { --todo; if (STRNCMP(HI2DI(hi)->di_key, "menutrans_", 10) == 0) delete_var(&globvarht, hi); } } hash_unlock(&globvarht); } #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(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(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. */ char_u * get_user_var_name(expand_T *xp, int idx) { static long_u gdone; static long_u bdone; static long_u wdone; #ifdef FEAT_WINDOWS static long_u tdone; #endif static int vidx; static hashitem_T *hi; hashtab_T *ht; if (idx == 0) { gdone = bdone = wdone = vidx = 0; #ifdef FEAT_WINDOWS tdone = 0; #endif } /* Global variables */ if (gdone < globvarht.ht_used) { if (gdone++ == 0) hi = globvarht.ht_array; else ++hi; while (HASHITEM_EMPTY(hi)) ++hi; if (STRNCMP("g:", xp->xp_pattern, 2) == 0) return cat_prefix_varname('g', hi->hi_key); return hi->hi_key; } /* b: variables */ ht = &curbuf->b_vars->dv_hashtab; if (bdone < ht->ht_used) { if (bdone++ == 0) hi = ht->ht_array; else ++hi; while (HASHITEM_EMPTY(hi)) ++hi; return cat_prefix_varname('b', hi->hi_key); } if (bdone == ht->ht_used) { ++bdone; return (char_u *)"b:changedtick"; } /* w: variables */ ht = &curwin->w_vars->dv_hashtab; if (wdone < ht->ht_used) { if (wdone++ == 0) hi = ht->ht_array; else ++hi; while (HASHITEM_EMPTY(hi)) ++hi; return cat_prefix_varname('w', hi->hi_key); } #ifdef FEAT_WINDOWS /* t: variables */ ht = &curtab->tp_vars->dv_hashtab; if (tdone < ht->ht_used) { if (tdone++ == 0) hi = ht->ht_array; else ++hi; while (HASHITEM_EMPTY(hi)) ++hi; return cat_prefix_varname('t', hi->hi_key); } #endif /* v: variables */ if (vidx < VV_LEN) return cat_prefix_varname('v', (char_u *)vimvars[vidx++].vv_name); vim_free(varnamebuf); varnamebuf = NULL; varnamebuflen = 0; return NULL; } #endif /* FEAT_CMDL_COMPL */ /* * Return TRUE if "pat" matches "text". * Does not use 'cpo' and always uses 'magic'. */ static int pattern_match(char_u *pat, char_u *text, int ic) { int matches = FALSE; char_u *save_cpo; regmatch_T regmatch; /* avoid 'l' flag in 'cpoptions' */ save_cpo = p_cpo; p_cpo = (char_u *)""; regmatch.regprog = vim_regcomp(pat, RE_MAGIC + RE_STRING); if (regmatch.regprog != NULL) { regmatch.rm_ic = ic; matches = vim_regexec_nl(®match, text, (colnr_T)0); vim_regfree(regmatch.regprog); } p_cpo = save_cpo; return matches; } /* * 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 rettv 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. * Put the result in "rettv" when returning OK and "evaluate" is TRUE. * Note: "rettv.v_lock" is not set. * Return OK or FAIL. */ static int eval0( char_u *arg, typval_T *rettv, char_u **nextcmd, int evaluate) { int ret; char_u *p; p = skipwhite(arg); ret = eval1(&p, rettv, evaluate); if (ret == FAIL || !ends_excmd(*p)) { if (ret != FAIL) clear_tv(rettv); /* * 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: * expr2 ? expr1 : expr1 * * "arg" must point to the first non-white of the expression. * "arg" is advanced to the next non-white after the recognized expression. * * Note: "rettv.v_lock" is not set. * * Return OK or FAIL. */ static int eval1(char_u **arg, typval_T *rettv, int evaluate) { int result; typval_T var2; /* * Get the first variable. */ if (eval2(arg, rettv, evaluate) == FAIL) return FAIL; if ((*arg)[0] == '?') { result = FALSE; if (evaluate) { int error = FALSE; if (get_tv_number_chk(rettv, &error) != 0) result = TRUE; clear_tv(rettv); if (error) return FAIL; } /* * Get the second variable. */ *arg = skipwhite(*arg + 1); if (eval1(arg, rettv, evaluate && result) == FAIL) /* recursive! */ return FAIL; /* * Check for the ":". */ if ((*arg)[0] != ':') { EMSG(_("E109: Missing ':' after '?'")); if (evaluate && result) clear_tv(rettv); return FAIL; } /* * Get the third variable. */ *arg = skipwhite(*arg + 1); if (eval1(arg, &var2, evaluate && !result) == FAIL) /* recursive! */ { if (evaluate && result) clear_tv(rettv); return FAIL; } if (evaluate && !result) *rettv = 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(char_u **arg, typval_T *rettv, int evaluate) { typval_T var2; long result; int first; int error = FALSE; /* * Get the first variable. */ if (eval3(arg, rettv, evaluate) == FAIL) return FAIL; /* * Repeat until there is no following "||". */ first = TRUE; result = FALSE; while ((*arg)[0] == '|' && (*arg)[1] == '|') { if (evaluate && first) { if (get_tv_number_chk(rettv, &error) != 0) result = TRUE; clear_tv(rettv); if (error) return FAIL; 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_tv_number_chk(&var2, &error) != 0) result = TRUE; clear_tv(&var2); if (error) return FAIL; } if (evaluate) { rettv->v_type = VAR_NUMBER; rettv->vval.v_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(char_u **arg, typval_T *rettv, int evaluate) { typval_T var2; long result; int first; int error = FALSE; /* * Get the first variable. */ if (eval4(arg, rettv, evaluate) == FAIL) return FAIL; /* * Repeat until there is no following "&&". */ first = TRUE; result = TRUE; while ((*arg)[0] == '&' && (*arg)[1] == '&') { if (evaluate && first) { if (get_tv_number_chk(rettv, &error) == 0) result = FALSE; clear_tv(rettv); if (error) return FAIL; 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_tv_number_chk(&var2, &error) == 0) result = FALSE; clear_tv(&var2); if (error) return FAIL; } if (evaluate) { rettv->v_type = VAR_NUMBER; rettv->vval.v_number = result; } } return OK; } /* * Handle third level expression: * var1 == var2 * var1 =~ var2 * var1 != var2 * var1 !~ var2 * var1 > var2 * var1 >= var2 * var1 < var2 * var1 <= var2 * var1 is var2 * var1 isnot 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(char_u **arg, typval_T *rettv, int evaluate) { typval_T var2; char_u *p; int i; exptype_T type = TYPE_UNKNOWN; int type_is = FALSE; /* TRUE for "is" and "isnot" */ int len = 2; long n1, n2; char_u *s1, *s2; char_u buf1[NUMBUFLEN], buf2[NUMBUFLEN]; int ic; /* * Get the first variable. */ if (eval5(arg, rettv, 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; case 'i': if (p[1] == 's') { if (p[2] == 'n' && p[3] == 'o' && p[4] == 't') len = 5; i = p[len]; if (!isalnum(i) && i != '_') { type = len == 2 ? TYPE_EQUAL : TYPE_NEQUAL; type_is = TRUE; } } break; } /* * If there is a comparative 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 appended: use 'ignorecase' */ else ic = p_ic; /* * Get the second variable. */ *arg = skipwhite(p + len); if (eval5(arg, &var2, evaluate) == FAIL) { clear_tv(rettv); return FAIL; } if (evaluate) { if (type_is && rettv->v_type != var2.v_type) { /* For "is" a different type always means FALSE, for "notis" * it means TRUE. */ n1 = (type == TYPE_NEQUAL); } else if (rettv->v_type == VAR_LIST || var2.v_type == VAR_LIST) { if (type_is) { n1 = (rettv->v_type == var2.v_type && rettv->vval.v_list == var2.vval.v_list); if (type == TYPE_NEQUAL) n1 = !n1; } else if (rettv->v_type != var2.v_type || (type != TYPE_EQUAL && type != TYPE_NEQUAL)) { if (rettv->v_type != var2.v_type) EMSG(_("E691: Can only compare List with List")); else EMSG(_("E692: Invalid operation for List")); clear_tv(rettv); clear_tv(&var2); return FAIL; } else { /* Compare two Lists for being equal or unequal. */ n1 = list_equal(rettv->vval.v_list, var2.vval.v_list, ic, FALSE); if (type == TYPE_NEQUAL) n1 = !n1; } } else if (rettv->v_type == VAR_DICT || var2.v_type == VAR_DICT) { if (type_is) { n1 = (rettv->v_type == var2.v_type && rettv->vval.v_dict == var2.vval.v_dict); if (type == TYPE_NEQUAL) n1 = !n1; } else if (rettv->v_type != var2.v_type || (type != TYPE_EQUAL && type != TYPE_NEQUAL)) { if (rettv->v_type != var2.v_type) EMSG(_("E735: Can only compare Dictionary with Dictionary")); else EMSG(_("E736: Invalid operation for Dictionary")); clear_tv(rettv); clear_tv(&var2); return FAIL; } else { /* Compare two Dictionaries for being equal or unequal. */ n1 = dict_equal(rettv->vval.v_dict, var2.vval.v_dict, ic, FALSE); if (type == TYPE_NEQUAL) n1 = !n1; } } else if (rettv->v_type == VAR_FUNC || var2.v_type == VAR_FUNC || rettv->v_type == VAR_PARTIAL || var2.v_type == VAR_PARTIAL) { if (type != TYPE_EQUAL && type != TYPE_NEQUAL) { EMSG(_("E694: Invalid operation for Funcrefs")); clear_tv(rettv); clear_tv(&var2); return FAIL; } n1 = tv_equal(rettv, &var2, FALSE, FALSE); if (type == TYPE_NEQUAL) n1 = !n1; } #ifdef FEAT_FLOAT /* * If one of the two variables is a float, compare as a float. * When using "=~" or "!~", always compare as string. */ else if ((rettv->v_type == VAR_FLOAT || var2.v_type == VAR_FLOAT) && type != TYPE_MATCH && type != TYPE_NOMATCH) { float_T f1, f2; if (rettv->v_type == VAR_FLOAT) f1 = rettv->vval.v_float; else f1 = get_tv_number(rettv); if (var2.v_type == VAR_FLOAT) f2 = var2.vval.v_float; else f2 = get_tv_number(&var2); n1 = FALSE; switch (type) { case TYPE_EQUAL: n1 = (f1 == f2); break; case TYPE_NEQUAL: n1 = (f1 != f2); break; case TYPE_GREATER: n1 = (f1 > f2); break; case TYPE_GEQUAL: n1 = (f1 >= f2); break; case TYPE_SMALLER: n1 = (f1 < f2); break; case TYPE_SEQUAL: n1 = (f1 <= f2); break; case TYPE_UNKNOWN: case TYPE_MATCH: case TYPE_NOMATCH: break; /* avoid gcc warning */ } } #endif /* * If one of the two variables is a number, compare as a number. * When using "=~" or "!~", always compare as string. */ else if ((rettv->v_type == VAR_NUMBER || var2.v_type == VAR_NUMBER) && type != TYPE_MATCH && type != TYPE_NOMATCH) { n1 = get_tv_number(rettv); n2 = get_tv_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_tv_string_buf(rettv, buf1); s2 = get_tv_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: n1 = pattern_match(s2, s1, ic); if (type == TYPE_NOMATCH) n1 = !n1; break; case TYPE_UNKNOWN: break; /* avoid gcc warning */ } } clear_tv(rettv); clear_tv(&var2); rettv->v_type = VAR_NUMBER; rettv->vval.v_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(char_u **arg, typval_T *rettv, int evaluate) { typval_T var2; typval_T var3; int op; long n1, n2; #ifdef FEAT_FLOAT float_T f1 = 0, f2 = 0; #endif char_u *s1, *s2; char_u buf1[NUMBUFLEN], buf2[NUMBUFLEN]; char_u *p; /* * Get the first variable. */ if (eval6(arg, rettv, evaluate, FALSE) == FAIL) return FAIL; /* * Repeat computing, until no '+', '-' or '.' is following. */ for (;;) { op = **arg; if (op != '+' && op != '-' && op != '.') break; if ((op != '+' || rettv->v_type != VAR_LIST) #ifdef FEAT_FLOAT && (op == '.' || rettv->v_type != VAR_FLOAT) #endif ) { /* For "list + ...", an illegal use of the first operand as * a number cannot be determined before evaluating the 2nd * operand: if this is also a list, all is ok. * For "something . ...", "something - ..." or "non-list + ...", * we know that the first operand needs to be a string or number * without evaluating the 2nd operand. So check before to avoid * side effects after an error. */ if (evaluate && get_tv_string_chk(rettv) == NULL) { clear_tv(rettv); return FAIL; } } /* * Get the second variable. */ *arg = skipwhite(*arg + 1); if (eval6(arg, &var2, evaluate, op == '.') == FAIL) { clear_tv(rettv); return FAIL; } if (evaluate) { /* * Compute the result. */ if (op == '.') { s1 = get_tv_string_buf(rettv, buf1); /* already checked */ s2 = get_tv_string_buf_chk(&var2, buf2); if (s2 == NULL) /* type error ? */ { clear_tv(rettv); clear_tv(&var2); return FAIL; } p = concat_str(s1, s2); clear_tv(rettv); rettv->v_type = VAR_STRING; rettv->vval.v_string = p; } else if (op == '+' && rettv->v_type == VAR_LIST && var2.v_type == VAR_LIST) { /* concatenate Lists */ if (list_concat(rettv->vval.v_list, var2.vval.v_list, &var3) == FAIL) { clear_tv(rettv); clear_tv(&var2); return FAIL; } clear_tv(rettv); *rettv = var3; } else { int error = FALSE; #ifdef FEAT_FLOAT if (rettv->v_type == VAR_FLOAT) { f1 = rettv->vval.v_float; n1 = 0; } else #endif { n1 = get_tv_number_chk(rettv, &error); if (error) { /* This can only happen for "list + non-list". For * "non-list + ..." or "something - ...", we returned * before evaluating the 2nd operand. */ clear_tv(rettv); return FAIL; } #ifdef FEAT_FLOAT if (var2.v_type == VAR_FLOAT) f1 = n1; #endif } #ifdef FEAT_FLOAT if (var2.v_type == VAR_FLOAT) { f2 = var2.vval.v_float; n2 = 0; } else #endif { n2 = get_tv_number_chk(&var2, &error); if (error) { clear_tv(rettv); clear_tv(&var2); return FAIL; } #ifdef FEAT_FLOAT if (rettv->v_type == VAR_FLOAT) f2 = n2; #endif } clear_tv(rettv); #ifdef FEAT_FLOAT /* If there is a float on either side the result is a float. */ if (rettv->v_type == VAR_FLOAT || var2.v_type == VAR_FLOAT) { if (op == '+') f1 = f1 + f2; else f1 = f1 - f2; rettv->v_type = VAR_FLOAT; rettv->vval.v_float = f1; } else #endif { if (op == '+') n1 = n1 + n2; else n1 = n1 - n2; rettv->v_type = VAR_NUMBER; rettv->vval.v_number = n1; } } clear_tv(&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( char_u **arg, typval_T *rettv, int evaluate, int want_string) /* after "." operator */ { typval_T var2; int op; long n1, n2; #ifdef FEAT_FLOAT int use_float = FALSE; float_T f1 = 0, f2; #endif int error = FALSE; /* * Get the first variable. */ if (eval7(arg, rettv, evaluate, want_string) == FAIL) return FAIL; /* * Repeat computing, until no '*', '/' or '%' is following. */ for (;;) { op = **arg; if (op != '*' && op != '/' && op != '%') break; if (evaluate) { #ifdef FEAT_FLOAT if (rettv->v_type == VAR_FLOAT) { f1 = rettv->vval.v_float; use_float = TRUE; n1 = 0; } else #endif n1 = get_tv_number_chk(rettv, &error); clear_tv(rettv); if (error) return FAIL; } else n1 = 0; /* * Get the second variable. */ *arg = skipwhite(*arg + 1); if (eval7(arg, &var2, evaluate, FALSE) == FAIL) return FAIL; if (evaluate) { #ifdef FEAT_FLOAT if (var2.v_type == VAR_FLOAT) { if (!use_float) { f1 = n1; use_float = TRUE; } f2 = var2.vval.v_float; n2 = 0; } else #endif { n2 = get_tv_number_chk(&var2, &error); clear_tv(&var2); if (error) return FAIL; #ifdef FEAT_FLOAT if (use_float) f2 = n2; #endif } /* * Compute the result. * When either side is a float the result is a float. */ #ifdef FEAT_FLOAT if (use_float) { if (op == '*') f1 = f1 * f2; else if (op == '/') { # ifdef VMS /* VMS crashes on divide by zero, work around it */ if (f2 == 0.0) { if (f1 == 0) f1 = -1 * __F_FLT_MAX - 1L; /* similar to NaN */ else if (f1 < 0) f1 = -1 * __F_FLT_MAX; else f1 = __F_FLT_MAX; } else f1 = f1 / f2; # else /* We rely on the floating point library to handle divide * by zero to result in "inf" and not a crash. */ f1 = f1 / f2; # endif } else { EMSG(_("E804: Cannot use '%' with Float")); return FAIL; } rettv->v_type = VAR_FLOAT; rettv->vval.v_float = f1; } else #endif { if (op == '*') n1 = n1 * n2; else if (op == '/') { if (n2 == 0) /* give an error message? */ { if (n1 == 0) n1 = -0x7fffffffL - 1L; /* similar to NaN */ else if (n1 < 0) n1 = -0x7fffffffL; else n1 = 0x7fffffffL; } else n1 = n1 / n2; } else { if (n2 == 0) /* give an error message? */ n1 = 0; else n1 = n1 % n2; } rettv->v_type = VAR_NUMBER; rettv->vval.v_number = n1; } } } return OK; } /* * Handle sixth level expression: * number number constant * "string" string constant * 'string' literal string constant * &option-name option value * @r register contents * identifier variable value * function() function call * $VAR environment variable * (expression) nested expression * [expr, expr] List * {key: val, key: val} Dictionary * * Also handle: * ! in front logical NOT * - in front unary minus * + in front unary plus (ignored) * trailing [] subscript in String or List * trailing .name entry in Dictionary * * "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( char_u **arg, typval_T *rettv, int evaluate, int want_string UNUSED) /* after "." operator */ { long n; int len; char_u *s; char_u *start_leader, *end_leader; int ret = OK; char_u *alias; /* * Initialise variable so that clear_tv() can't mistake this for a * string and free a string that isn't there. */ rettv->v_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': { #ifdef FEAT_FLOAT char_u *p = skipdigits(*arg + 1); int get_float = FALSE; /* We accept a float when the format matches * "[0-9]\+\.[0-9]\+\([eE][+-]\?[0-9]\+\)\?". This is very * strict to avoid backwards compatibility problems. * Don't look for a float after the "." operator, so that * ":let vers = 1.2.3" doesn't fail. */ if (!want_string && p[0] == '.' && vim_isdigit(p[1])) { get_float = TRUE; p = skipdigits(p + 2); if (*p == 'e' || *p == 'E') { ++p; if (*p == '-' || *p == '+') ++p; if (!vim_isdigit(*p)) get_float = FALSE; else p = skipdigits(p + 1); } if (ASCII_ISALPHA(*p) || *p == '.') get_float = FALSE; } if (get_float) { float_T f; *arg += string2float(*arg, &f); if (evaluate) { rettv->v_type = VAR_FLOAT; rettv->vval.v_float = f; } } else #endif { vim_str2nr(*arg, NULL, &len, STR2NR_ALL, &n, NULL, 0); *arg += len; if (evaluate) { rettv->v_type = VAR_NUMBER; rettv->vval.v_number = n; } } break; } /* * String constant: "string". */ case '"': ret = get_string_tv(arg, rettv, evaluate); break; /* * Literal string constant: 'str''ing'. */ case '\'': ret = get_lit_string_tv(arg, rettv, evaluate); break; /* * List: [expr, expr] */ case '[': ret = get_list_tv(arg, rettv, evaluate); break; /* * Dictionary: {key: val, key: val} */ case '{': ret = get_dict_tv(arg, rettv, evaluate); break; /* * Option value: &name */ case '&': ret = get_option_tv(arg, rettv, evaluate); break; /* * Environment variable: $VAR. */ case '$': ret = get_env_tv(arg, rettv, evaluate); break; /* * Register contents: @r. */ case '@': ++*arg; if (evaluate) { rettv->v_type = VAR_STRING; rettv->vval.v_string = get_reg_contents(**arg, GREG_EXPR_SRC); } if (**arg != NUL) ++*arg; break; /* * nested expression: (expression). */ case '(': *arg = skipwhite(*arg + 1); ret = eval1(arg, rettv, evaluate); /* recursive! */ if (**arg == ')') ++*arg; else if (ret == OK) { EMSG(_("E110: Missing ')'")); clear_tv(rettv); ret = FAIL; } break; default: ret = NOTDONE; break; } if (ret == NOTDONE) { /* * Must be a variable or function name. * Can also be a curly-braces kind of name: {expr}. */ s = *arg; len = get_name_len(arg, &alias, evaluate, TRUE); if (alias != NULL) s = alias; if (len <= 0) ret = FAIL; else { if (**arg == '(') /* recursive! */ { partial_T *partial; /* If "s" is the name of a variable of type VAR_FUNC * use its contents. */ s = deref_func_name(s, &len, &partial, !evaluate); /* Invoke the function. */ ret = get_func_tv(s, len, rettv, arg, curwin->w_cursor.lnum, curwin->w_cursor.lnum, &len, evaluate, partial, NULL); /* If evaluate is FALSE rettv->v_type was not set in * get_func_tv, but it's needed in handle_subscript() to parse * what follows. So set it here. */ if (rettv->v_type == VAR_UNKNOWN && !evaluate && **arg == '(') { rettv->vval.v_string = vim_strsave((char_u *)""); rettv->v_type = VAR_FUNC; } /* 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_tv(rettv); ret = FAIL; } } else if (evaluate) ret = get_var_tv(s, len, rettv, NULL, TRUE, FALSE); else ret = OK; } vim_free(alias); } *arg = skipwhite(*arg); /* Handle following '[', '(' and '.' for expr[expr], expr.name, * expr(expr). */ if (ret == OK) ret = handle_subscript(arg, rettv, evaluate, TRUE); /* * Apply logical NOT and unary '-', from right to left, ignore '+'. */ if (ret == OK && evaluate && end_leader > start_leader) { int error = FALSE; int val = 0; #ifdef FEAT_FLOAT float_T f = 0.0; if (rettv->v_type == VAR_FLOAT) f = rettv->vval.v_float; else #endif val = get_tv_number_chk(rettv, &error); if (error) { clear_tv(rettv); ret = FAIL; } else { while (end_leader > start_leader) { --end_leader; if (*end_leader == '!') { #ifdef FEAT_FLOAT if (rettv->v_type == VAR_FLOAT) f = !f; else #endif val = !val; } else if (*end_leader == '-') { #ifdef FEAT_FLOAT if (rettv->v_type == VAR_FLOAT) f = -f; else #endif val = -val; } } #ifdef FEAT_FLOAT if (rettv->v_type == VAR_FLOAT) { clear_tv(rettv); rettv->vval.v_float = f; } else #endif { clear_tv(rettv); rettv->v_type = VAR_NUMBER; rettv->vval.v_number = val; } } } return ret; } /* * Evaluate an "[expr]" or "[expr:expr]" index. Also "dict.key". * "*arg" points to the '[' or '.'. * Returns FAIL or OK. "*arg" is advanced to after the ']'. */ static int eval_index( char_u **arg, typval_T *rettv, int evaluate, int verbose) /* give error messages */ { int empty1 = FALSE, empty2 = FALSE; typval_T var1, var2; long n1, n2 = 0; long len = -1; int range = FALSE; char_u *s; char_u *key = NULL; switch (rettv->v_type) { case VAR_FUNC: case VAR_PARTIAL: if (verbose) EMSG(_("E695: Cannot index a Funcref")); return FAIL; case VAR_FLOAT: #ifdef FEAT_FLOAT if (verbose) EMSG(_(e_float_as_string)); return FAIL; #endif case VAR_SPECIAL: case VAR_JOB: case VAR_CHANNEL: if (verbose) EMSG(_("E909: Cannot index a special variable")); return FAIL; case VAR_UNKNOWN: if (evaluate) return FAIL; /* FALLTHROUGH */ case VAR_STRING: case VAR_NUMBER: case VAR_LIST: case VAR_DICT: break; } init_tv(&var1); init_tv(&var2); if (**arg == '.') { /* * dict.name */ key = *arg + 1; for (len = 0; ASCII_ISALNUM(key[len]) || key[len] == '_'; ++len) ; if (len == 0) return FAIL; *arg = skipwhite(key + len); } else { /* * something[idx] * * Get the (first) variable from inside the []. */ *arg = skipwhite(*arg + 1); if (**arg == ':') empty1 = TRUE; else if (eval1(arg, &var1, evaluate) == FAIL) /* recursive! */ return FAIL; else if (evaluate && get_tv_string_chk(&var1) == NULL) { /* not a number or string */ clear_tv(&var1); return FAIL; } /* * Get the second variable from inside the [:]. */ if (**arg == ':') { range = TRUE; *arg = skipwhite(*arg + 1); if (**arg == ']') empty2 = TRUE; else if (eval1(arg, &var2, evaluate) == FAIL) /* recursive! */ { if (!empty1) clear_tv(&var1); return FAIL; } else if (evaluate && get_tv_string_chk(&var2) == NULL) { /* not a number or string */ if (!empty1) clear_tv(&var1); clear_tv(&var2); return FAIL; } } /* Check for the ']'. */ if (**arg != ']') { if (verbose) EMSG(_(e_missbrac)); clear_tv(&var1); if (range) clear_tv(&var2); return FAIL; } *arg = skipwhite(*arg + 1); /* skip the ']' */ } if (evaluate) { n1 = 0; if (!empty1 && rettv->v_type != VAR_DICT) { n1 = get_tv_number(&var1); clear_tv(&var1); } if (range) { if (empty2) n2 = -1; else { n2 = get_tv_number(&var2); clear_tv(&var2); } } switch (rettv->v_type) { case VAR_UNKNOWN: case VAR_FUNC: case VAR_PARTIAL: case VAR_FLOAT: case VAR_SPECIAL: case VAR_JOB: case VAR_CHANNEL: break; /* not evaluating, skipping over subscript */ case VAR_NUMBER: case VAR_STRING: s = get_tv_string(rettv); len = (long)STRLEN(s); if (range) { /* The resulting variable is a substring. If the indexes * are out of range the result is empty. */ if (n1 < 0) { n1 = len + n1; if (n1 < 0) n1 = 0; } if (n2 < 0) n2 = len + n2; else if (n2 >= len) n2 = len; if (n1 >= len || n2 < 0 || n1 > n2) s = NULL; else s = vim_strnsave(s + n1, (int)(n2 - n1 + 1)); } else { /* The resulting variable is a string of a single * character. If the index is too big or negative the * result is empty. */ if (n1 >= len || n1 < 0) s = NULL; else s = vim_strnsave(s + n1, 1); } clear_tv(rettv); rettv->v_type = VAR_STRING; rettv->vval.v_string = s; break; case VAR_LIST: len = list_len(rettv->vval.v_list); if (n1 < 0) n1 = len + n1; if (!empty1 && (n1 < 0 || n1 >= len)) { /* For a range we allow invalid values and return an empty * list. A list index out of range is an error. */ if (!range) { if (verbose) EMSGN(_(e_listidx), n1); return FAIL; } n1 = len; } if (range) { list_T *l; listitem_T *item; if (n2 < 0) n2 = len + n2; else if (n2 >= len) n2 = len - 1; if (!empty2 && (n2 < 0 || n2 + 1 < n1)) n2 = -1; l = list_alloc(); if (l == NULL) return FAIL; for (item = list_find(rettv->vval.v_list, n1); n1 <= n2; ++n1) { if (list_append_tv(l, &item->li_tv) == FAIL) { list_free(l, TRUE); return FAIL; } item = item->li_next; } clear_tv(rettv); rettv->v_type = VAR_LIST; rettv->vval.v_list = l; ++l->lv_refcount; } else { copy_tv(&list_find(rettv->vval.v_list, n1)->li_tv, &var1); clear_tv(rettv); *rettv = var1; } break; case VAR_DICT: if (range) { if (verbose) EMSG(_(e_dictrange)); if (len == -1) clear_tv(&var1); return FAIL; } { dictitem_T *item; if (len == -1) { key = get_tv_string(&var1); if (*key == NUL) { if (verbose) EMSG(_(e_emptykey)); clear_tv(&var1); return FAIL; } } item = dict_find(rettv->vval.v_dict, key, (int)len); if (item == NULL && verbose) EMSG2(_(e_dictkey), key); if (len == -1) clear_tv(&var1); if (item == NULL) return FAIL; copy_tv(&item->di_tv, &var1); clear_tv(rettv); *rettv = var1; } break; } } return OK; } /* * 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_tv( char_u **arg, typval_T *rettv, /* 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 (rettv != 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, rettv == NULL ? NULL : &stringval, opt_flags); if (opt_type == -3) /* invalid name */ { if (rettv != NULL) EMSG2(_("E113: Unknown option: %s"), *arg); ret = FAIL; } else if (rettv != NULL) { if (opt_type == -2) /* hidden string option */ { rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; } else if (opt_type == -1) /* hidden number option */ { rettv->v_type = VAR_NUMBER; rettv->vval.v_number = 0; } else if (opt_type == 1) /* number option */ { rettv->v_type = VAR_NUMBER; rettv->vval.v_number = numval; } else /* string option */ { rettv->v_type = VAR_STRING; rettv->vval.v_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_tv(char_u **arg, typval_T *rettv, int evaluate) { char_u *p; char_u *name; int extra = 0; /* * Find the end of the string, skipping backslashed characters. */ for (p = *arg + 1; *p != NUL && *p != '"'; mb_ptr_adv(p)) { if (*p == '\\' && p[1] != NUL) { ++p; /* A "\" form occupies at least 4 characters, and produces up * to 6 characters: reserve space for 2 extra */ if (*p == '<') extra += 2; } } 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; rettv->v_type = VAR_STRING; rettv->vval.v_string = name; for (p = *arg + 1; *p != NUL && *p != '"'; ) { if (*p == '\\') { switch (*++p) { case 'b': *name++ = BS; ++p; break; case 'e': *name++ = ESC; ++p; break; case 'f': *name++ = FF; ++p; break; case 'n': *name++ = NL; ++p; break; case 'r': *name++ = CAR; ++p; break; case 't': *name++ = TAB; ++p; 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 if (*p == 'u') n = 4; else n = 8; nr = 0; while (--n >= 0 && vim_isxdigit(p[1])) { ++p; nr = (nr << 4) + hex2nr(*p); } ++p; #ifdef FEAT_MBYTE /* For "\u" store the number according to * 'encoding'. */ if (c != 'X') name += (*mb_char2bytes)(nr, name); else #endif *name++ = nr; } break; /* octal: "\1", "\12", "\123" */ case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': *name = *p++ - '0'; if (*p >= '0' && *p <= '7') { *name = (*name << 3) + *p++ - '0'; if (*p >= '0' && *p <= '7') *name = (*name << 3) + *p++ - '0'; } ++name; break; /* Special key, e.g.: "\" */ case '<': extra = trans_special(&p, name, TRUE); if (extra != 0) { name += extra; break; } /* FALLTHROUGH */ default: MB_COPY_CHAR(p, name); break; } } else MB_COPY_CHAR(p, name); } *name = NUL; *arg = p + 1; return OK; } /* * Allocate a variable for a 'str''ing' constant. * Return OK or FAIL. */ static int get_lit_string_tv(char_u **arg, typval_T *rettv, int evaluate) { char_u *p; char_u *str; int reduce = 0; /* * Find the end of the string, skipping ''. */ for (p = *arg + 1; *p != NUL; mb_ptr_adv(p)) { if (*p == '\'') { if (p[1] != '\'') break; ++reduce; ++p; } } if (*p != '\'') { EMSG2(_("E115: Missing quote: %s"), *arg); return FAIL; } /* If only parsing return after setting "*arg" */ if (!evaluate) { *arg = p + 1; return OK; } /* * Copy the string into allocated memory, handling '' to ' reduction. */ str = alloc((unsigned)((p - *arg) - reduce)); if (str == NULL) return FAIL; rettv->v_type = VAR_STRING; rettv->vval.v_string = str; for (p = *arg + 1; *p != NUL; ) { if (*p == '\'') { if (p[1] != '\'') break; ++p; } MB_COPY_CHAR(p, str); } *str = NUL; *arg = p + 1; return OK; } /* * Allocate a variable for a List and fill it from "*arg". * Return OK or FAIL. */ static int get_list_tv(char_u **arg, typval_T *rettv, int evaluate) { list_T *l = NULL; typval_T tv; listitem_T *item; if (evaluate) { l = list_alloc(); if (l == NULL) return FAIL; } *arg = skipwhite(*arg + 1); while (**arg != ']' && **arg != NUL) { if (eval1(arg, &tv, evaluate) == FAIL) /* recursive! */ goto failret; if (evaluate) { item = listitem_alloc(); if (item != NULL) { item->li_tv = tv; item->li_tv.v_lock = 0; list_append(l, item); } else clear_tv(&tv); } if (**arg == ']') break; if (**arg != ',') { EMSG2(_("E696: Missing comma in List: %s"), *arg); goto failret; } *arg = skipwhite(*arg + 1); } if (**arg != ']') { EMSG2(_("E697: Missing end of List ']': %s"), *arg); failret: if (evaluate) list_free(l, TRUE); return FAIL; } *arg = skipwhite(*arg + 1); if (evaluate) { rettv->v_type = VAR_LIST; rettv->vval.v_list = l; ++l->lv_refcount; } return OK; } /* * Allocate an empty header for a list. * Caller should take care of the reference count. */ list_T * list_alloc(void) { list_T *l; l = (list_T *)alloc_clear(sizeof(list_T)); if (l != NULL) { /* Prepend the list to the list of lists for garbage collection. */ if (first_list != NULL) first_list->lv_used_prev = l; l->lv_used_prev = NULL; l->lv_used_next = first_list; first_list = l; } return l; } /* * Allocate an empty list for a return value. * Returns OK or FAIL. */ int rettv_list_alloc(typval_T *rettv) { list_T *l = list_alloc(); if (l == NULL) return FAIL; rettv->vval.v_list = l; rettv->v_type = VAR_LIST; rettv->v_lock = 0; ++l->lv_refcount; return OK; } /* * Unreference a list: decrement the reference count and free it when it * becomes zero. */ void list_unref(list_T *l) { if (l != NULL && --l->lv_refcount <= 0) list_free(l, TRUE); } /* * Free a list, including all non-container items it points to. * Ignores the reference count. */ void list_free( list_T *l, int recurse) /* Free Lists and Dictionaries recursively. */ { listitem_T *item; /* Remove the list from the list of lists for garbage collection. */ if (l->lv_used_prev == NULL) first_list = l->lv_used_next; else l->lv_used_prev->lv_used_next = l->lv_used_next; if (l->lv_used_next != NULL) l->lv_used_next->lv_used_prev = l->lv_used_prev; for (item = l->lv_first; item != NULL; item = l->lv_first) { /* Remove the item before deleting it. */ l->lv_first = item->li_next; if (recurse || (item->li_tv.v_type != VAR_LIST && item->li_tv.v_type != VAR_DICT)) clear_tv(&item->li_tv); vim_free(item); } vim_free(l); } /* * Allocate a list item. * It is not initialized, don't forget to set v_lock. */ listitem_T * listitem_alloc(void) { return (listitem_T *)alloc(sizeof(listitem_T)); } /* * Free a list item. Also clears the value. Does not notify watchers. */ void listitem_free(listitem_T *item) { clear_tv(&item->li_tv); vim_free(item); } /* * Remove a list item from a List and free it. Also clears the value. */ void listitem_remove(list_T *l, listitem_T *item) { vimlist_remove(l, item, item); listitem_free(item); } /* * Get the number of items in a list. */ static long list_len(list_T *l) { if (l == NULL) return 0L; return l->lv_len; } /* * Return TRUE when two lists have exactly the same values. */ static int list_equal( list_T *l1, list_T *l2, int ic, /* ignore case for strings */ int recursive) /* TRUE when used recursively */ { listitem_T *item1, *item2; if (l1 == NULL || l2 == NULL) return FALSE; if (l1 == l2) return TRUE; if (list_len(l1) != list_len(l2)) return FALSE; for (item1 = l1->lv_first, item2 = l2->lv_first; item1 != NULL && item2 != NULL; item1 = item1->li_next, item2 = item2->li_next) if (!tv_equal(&item1->li_tv, &item2->li_tv, ic, recursive)) return FALSE; return item1 == NULL && item2 == NULL; } /* * Return the dictitem that an entry in a hashtable points to. */ dictitem_T * dict_lookup(hashitem_T *hi) { return HI2DI(hi); } /* * Return TRUE when two dictionaries have exactly the same key/values. */ static int dict_equal( dict_T *d1, dict_T *d2, int ic, /* ignore case for strings */ int recursive) /* TRUE when used recursively */ { hashitem_T *hi; dictitem_T *item2; int todo; if (d1 == NULL || d2 == NULL) return FALSE; if (d1 == d2) return TRUE; if (dict_len(d1) != dict_len(d2)) return FALSE; todo = (int)d1->dv_hashtab.ht_used; for (hi = d1->dv_hashtab.ht_array; todo > 0; ++hi) { if (!HASHITEM_EMPTY(hi)) { item2 = dict_find(d2, hi->hi_key, -1); if (item2 == NULL) return FALSE; if (!tv_equal(&HI2DI(hi)->di_tv, &item2->di_tv, ic, recursive)) return FALSE; --todo; } } return TRUE; } static int tv_equal_recurse_limit; /* * Return TRUE if "tv1" and "tv2" have the same value. * Compares the items just like "==" would compare them, but strings and * numbers are different. Floats and numbers are also different. */ static int tv_equal( typval_T *tv1, typval_T *tv2, int ic, /* ignore case */ int recursive) /* TRUE when used recursively */ { char_u buf1[NUMBUFLEN], buf2[NUMBUFLEN]; char_u *s1, *s2; static int recursive_cnt = 0; /* catch recursive loops */ int r; /* For VAR_FUNC and VAR_PARTIAL only compare the function name. */ if ((tv1->v_type == VAR_FUNC || (tv1->v_type == VAR_PARTIAL && tv1->vval.v_partial != NULL)) && (tv2->v_type == VAR_FUNC || (tv2->v_type == VAR_PARTIAL && tv2->vval.v_partial != NULL))) { s1 = tv1->v_type == VAR_FUNC ? tv1->vval.v_string : tv1->vval.v_partial->pt_name; s2 = tv2->v_type == VAR_FUNC ? tv2->vval.v_string : tv2->vval.v_partial->pt_name; return (s1 != NULL && s2 != NULL && STRCMP(s1, s2) == 0); } if (tv1->v_type != tv2->v_type) return FALSE; /* Catch lists and dicts that have an endless loop by limiting * recursiveness to a limit. We guess they are equal then. * A fixed limit has the problem of still taking an awful long time. * Reduce the limit every time running into it. That should work fine for * deeply linked structures that are not recursively linked and catch * recursiveness quickly. */ if (!recursive) tv_equal_recurse_limit = 1000; if (recursive_cnt >= tv_equal_recurse_limit) { --tv_equal_recurse_limit; return TRUE; } switch (tv1->v_type) { case VAR_LIST: ++recursive_cnt; r = list_equal(tv1->vval.v_list, tv2->vval.v_list, ic, TRUE); --recursive_cnt; return r; case VAR_DICT: ++recursive_cnt; r = dict_equal(tv1->vval.v_dict, tv2->vval.v_dict, ic, TRUE); --recursive_cnt; return r; case VAR_NUMBER: return tv1->vval.v_number == tv2->vval.v_number; case VAR_STRING: s1 = get_tv_string_buf(tv1, buf1); s2 = get_tv_string_buf(tv2, buf2); return ((ic ? MB_STRICMP(s1, s2) : STRCMP(s1, s2)) == 0); case VAR_SPECIAL: return tv1->vval.v_number == tv2->vval.v_number; case VAR_FLOAT: #ifdef FEAT_FLOAT return tv1->vval.v_float == tv2->vval.v_float; #endif case VAR_JOB: #ifdef FEAT_JOB_CHANNEL return tv1->vval.v_job == tv2->vval.v_job; #endif case VAR_CHANNEL: #ifdef FEAT_JOB_CHANNEL return tv1->vval.v_channel == tv2->vval.v_channel; #endif case VAR_FUNC: case VAR_PARTIAL: case VAR_UNKNOWN: break; } /* VAR_UNKNOWN can be the result of a invalid expression, let's say it * does not equal anything, not even itself. */ return FALSE; } /* * Locate item with index "n" in list "l" and return it. * A negative index is counted from the end; -1 is the last item. * Returns NULL when "n" is out of range. */ listitem_T * list_find(list_T *l, long n) { listitem_T *item; long idx; if (l == NULL) return NULL; /* Negative index is relative to the end. */ if (n < 0) n = l->lv_len + n; /* Check for index out of range. */ if (n < 0 || n >= l->lv_len) return NULL; /* When there is a cached index may start search from there. */ if (l->lv_idx_item != NULL) { if (n < l->lv_idx / 2) { /* closest to the start of the list */ item = l->lv_first; idx = 0; } else if (n > (l->lv_idx + l->lv_len) / 2) { /* closest to the end of the list */ item = l->lv_last; idx = l->lv_len - 1; } else { /* closest to the cached index */ item = l->lv_idx_item; idx = l->lv_idx; } } else { if (n < l->lv_len / 2) { /* closest to the start of the list */ item = l->lv_first; idx = 0; } else { /* closest to the end of the list */ item = l->lv_last; idx = l->lv_len - 1; } } while (n > idx) { /* search forward */ item = item->li_next; ++idx; } while (n < idx) { /* search backward */ item = item->li_prev; --idx; } /* cache the used index */ l->lv_idx = idx; l->lv_idx_item = item; return item; } /* * Get list item "l[idx]" as a number. */ static long list_find_nr( list_T *l, long idx, int *errorp) /* set to TRUE when something wrong */ { listitem_T *li; li = list_find(l, idx); if (li == NULL) { if (errorp != NULL) *errorp = TRUE; return -1L; } return get_tv_number_chk(&li->li_tv, errorp); } /* * Get list item "l[idx - 1]" as a string. Returns NULL for failure. */ char_u * list_find_str(list_T *l, long idx) { listitem_T *li; li = list_find(l, idx - 1); if (li == NULL) { EMSGN(_(e_listidx), idx); return NULL; } return get_tv_string(&li->li_tv); } /* * Locate "item" list "l" and return its index. * Returns -1 when "item" is not in the list. */ static long list_idx_of_item(list_T *l, listitem_T *item) { long idx = 0; listitem_T *li; if (l == NULL) return -1; idx = 0; for (li = l->lv_first; li != NULL && li != item; li = li->li_next) ++idx; if (li == NULL) return -1; return idx; } /* * Append item "item" to the end of list "l". */ void list_append(list_T *l, listitem_T *item) { if (l->lv_last == NULL) { /* empty list */ l->lv_first = item; l->lv_last = item; item->li_prev = NULL; } else { l->lv_last->li_next = item; item->li_prev = l->lv_last; l->lv_last = item; } ++l->lv_len; item->li_next = NULL; } /* * Append typval_T "tv" to the end of list "l". * Return FAIL when out of memory. */ int list_append_tv(list_T *l, typval_T *tv) { listitem_T *li = listitem_alloc(); if (li == NULL) return FAIL; copy_tv(tv, &li->li_tv); list_append(l, li); return OK; } /* * Add a dictionary to a list. Used by getqflist(). * Return FAIL when out of memory. */ int list_append_dict(list_T *list, dict_T *dict) { listitem_T *li = listitem_alloc(); if (li == NULL) return FAIL; li->li_tv.v_type = VAR_DICT; li->li_tv.v_lock = 0; li->li_tv.vval.v_dict = dict; list_append(list, li); ++dict->dv_refcount; return OK; } /* * Make a copy of "str" and append it as an item to list "l". * When "len" >= 0 use "str[len]". * Returns FAIL when out of memory. */ int list_append_string(list_T *l, char_u *str, int len) { listitem_T *li = listitem_alloc(); if (li == NULL) return FAIL; list_append(l, li); li->li_tv.v_type = VAR_STRING; li->li_tv.v_lock = 0; if (str == NULL) li->li_tv.vval.v_string = NULL; else if ((li->li_tv.vval.v_string = (len >= 0 ? vim_strnsave(str, len) : vim_strsave(str))) == NULL) return FAIL; return OK; } /* * Append "n" to list "l". * Returns FAIL when out of memory. */ int list_append_number(list_T *l, varnumber_T n) { listitem_T *li; li = listitem_alloc(); if (li == NULL) return FAIL; li->li_tv.v_type = VAR_NUMBER; li->li_tv.v_lock = 0; li->li_tv.vval.v_number = n; list_append(l, li); return OK; } /* * Insert typval_T "tv" in list "l" before "item". * If "item" is NULL append at the end. * Return FAIL when out of memory. */ int list_insert_tv(list_T *l, typval_T *tv, listitem_T *item) { listitem_T *ni = listitem_alloc(); if (ni == NULL) return FAIL; copy_tv(tv, &ni->li_tv); list_insert(l, ni, item); return OK; } void list_insert(list_T *l, listitem_T *ni, listitem_T *item) { if (item == NULL) /* Append new item at end of list. */ list_append(l, ni); else { /* Insert new item before existing item. */ ni->li_prev = item->li_prev; ni->li_next = item; if (item->li_prev == NULL) { l->lv_first = ni; ++l->lv_idx; } else { item->li_prev->li_next = ni; l->lv_idx_item = NULL; } item->li_prev = ni; ++l->lv_len; } } /* * Extend "l1" with "l2". * If "bef" is NULL append at the end, otherwise insert before this item. * Returns FAIL when out of memory. */ static int list_extend(list_T *l1, list_T *l2, listitem_T *bef) { listitem_T *item; int todo = l2->lv_len; /* We also quit the loop when we have inserted the original item count of * the list, avoid a hang when we extend a list with itself. */ for (item = l2->lv_first; item != NULL && --todo >= 0; item = item->li_next) if (list_insert_tv(l1, &item->li_tv, bef) == FAIL) return FAIL; return OK; } /* * Concatenate lists "l1" and "l2" into a new list, stored in "tv". * Return FAIL when out of memory. */ static int list_concat(list_T *l1, list_T *l2, typval_T *tv) { list_T *l; if (l1 == NULL || l2 == NULL) return FAIL; /* make a copy of the first list. */ l = list_copy(l1, FALSE, 0); if (l == NULL) return FAIL; tv->v_type = VAR_LIST; tv->vval.v_list = l; /* append all items from the second list */ return list_extend(l, l2, NULL); } /* * Make a copy of list "orig". Shallow if "deep" is FALSE. * The refcount of the new list is set to 1. * See item_copy() for "copyID". * Returns NULL when out of memory. */ static list_T * list_copy(list_T *orig, int deep, int copyID) { list_T *copy; listitem_T *item; listitem_T *ni; if (orig == NULL) return NULL; copy = list_alloc(); if (copy != NULL) { if (copyID != 0) { /* Do this before adding the items, because one of the items may * refer back to this list. */ orig->lv_copyID = copyID; orig->lv_copylist = copy; } for (item = orig->lv_first; item != NULL && !got_int; item = item->li_next) { ni = listitem_alloc(); if (ni == NULL) break; if (deep) { if (item_copy(&item->li_tv, &ni->li_tv, deep, copyID) == FAIL) { vim_free(ni); break; } } else copy_tv(&item->li_tv, &ni->li_tv); list_append(copy, ni); } ++copy->lv_refcount; if (item != NULL) { list_unref(copy); copy = NULL; } } return copy; } /* * Remove items "item" to "item2" from list "l". * Does not free the listitem or the value! * This used to be called list_remove, but that conflicts with a Sun header * file. */ void vimlist_remove(list_T *l, listitem_T *item, listitem_T *item2) { listitem_T *ip; /* notify watchers */ for (ip = item; ip != NULL; ip = ip->li_next) { --l->lv_len; list_fix_watch(l, ip); if (ip == item2) break; } if (item2->li_next == NULL) l->lv_last = item->li_prev; else item2->li_next->li_prev = item->li_prev; if (item->li_prev == NULL) l->lv_first = item2->li_next; else item->li_prev->li_next = item2->li_next; l->lv_idx_item = NULL; } /* * Return an allocated string with the string representation of a list. * May return NULL. */ static char_u * list2string(typval_T *tv, int copyID) { garray_T ga; if (tv->vval.v_list == NULL) return NULL; ga_init2(&ga, (int)sizeof(char), 80); ga_append(&ga, '['); if (list_join(&ga, tv->vval.v_list, (char_u *)", ", FALSE, copyID) == FAIL) { vim_free(ga.ga_data); return NULL; } ga_append(&ga, ']'); ga_append(&ga, NUL); return (char_u *)ga.ga_data; } typedef struct join_S { char_u *s; char_u *tofree; } join_T; static int list_join_inner( garray_T *gap, /* to store the result in */ list_T *l, char_u *sep, int echo_style, int copyID, garray_T *join_gap) /* to keep each list item string */ { int i; join_T *p; int len; int sumlen = 0; int first = TRUE; char_u *tofree; char_u numbuf[NUMBUFLEN]; listitem_T *item; char_u *s; /* Stringify each item in the list. */ for (item = l->lv_first; item != NULL && !got_int; item = item->li_next) { if (echo_style) s = echo_string(&item->li_tv, &tofree, numbuf, copyID); else s = tv2string(&item->li_tv, &tofree, numbuf, copyID); if (s == NULL) return FAIL; len = (int)STRLEN(s); sumlen += len; (void)ga_grow(join_gap, 1); p = ((join_T *)join_gap->ga_data) + (join_gap->ga_len++); if (tofree != NULL || s != numbuf) { p->s = s; p->tofree = tofree; } else { p->s = vim_strnsave(s, len); p->tofree = p->s; } line_breakcheck(); if (did_echo_string_emsg) /* recursion error, bail out */ break; } /* Allocate result buffer with its total size, avoid re-allocation and * multiple copy operations. Add 2 for a tailing ']' and NUL. */ if (join_gap->ga_len >= 2) sumlen += (int)STRLEN(sep) * (join_gap->ga_len - 1); if (ga_grow(gap, sumlen + 2) == FAIL) return FAIL; for (i = 0; i < join_gap->ga_len && !got_int; ++i) { if (first) first = FALSE; else ga_concat(gap, sep); p = ((join_T *)join_gap->ga_data) + i; if (p->s != NULL) ga_concat(gap, p->s); line_breakcheck(); } return OK; } /* * Join list "l" into a string in "*gap", using separator "sep". * When "echo_style" is TRUE use String as echoed, otherwise as inside a List. * Return FAIL or OK. */ static int list_join( garray_T *gap, list_T *l, char_u *sep, int echo_style, int copyID) { garray_T join_ga; int retval; join_T *p; int i; if (l->lv_len < 1) return OK; /* nothing to do */ ga_init2(&join_ga, (int)sizeof(join_T), l->lv_len); retval = list_join_inner(gap, l, sep, echo_style, copyID, &join_ga); /* Dispose each item in join_ga. */ if (join_ga.ga_data != NULL) { p = (join_T *)join_ga.ga_data; for (i = 0; i < join_ga.ga_len; ++i) { vim_free(p->tofree); ++p; } ga_clear(&join_ga); } return retval; } /* * Return the next (unique) copy ID. * Used for serializing nested structures. */ int get_copyID(void) { current_copyID += COPYID_INC; return current_copyID; } /* * Garbage collection for lists and dictionaries. * * We use reference counts to be able to free most items right away when they * are no longer used. But for composite items it's possible that it becomes * unused while the reference count is > 0: When there is a recursive * reference. Example: * :let l = [1, 2, 3] * :let d = {9: l} * :let l[1] = d * * Since this is quite unusual we handle this with garbage collection: every * once in a while find out which lists and dicts are not referenced from any * variable. * * Here is a good reference text about garbage collection (refers to Python * but it applies to all reference-counting mechanisms): * http://python.ca/nas/python/gc/ */ /* * Do garbage collection for lists and dicts. * Return TRUE if some memory was freed. */ int garbage_collect(void) { int copyID; int abort = FALSE; buf_T *buf; win_T *wp; int i; funccall_T *fc, **pfc; int did_free = FALSE; int did_free_funccal = FALSE; #ifdef FEAT_WINDOWS tabpage_T *tp; #endif /* Only do this once. */ want_garbage_collect = FALSE; may_garbage_collect = FALSE; garbage_collect_at_exit = FALSE; /* We advance by two because we add one for items referenced through * previous_funccal. */ copyID = get_copyID(); /* * 1. Go through all accessible variables and mark all lists and dicts * with copyID. */ /* Don't free variables in the previous_funccal list unless they are only * referenced through previous_funccal. This must be first, because if * the item is referenced elsewhere the funccal must not be freed. */ for (fc = previous_funccal; fc != NULL; fc = fc->caller) { abort = abort || set_ref_in_ht(&fc->l_vars.dv_hashtab, copyID + 1, NULL); abort = abort || set_ref_in_ht(&fc->l_avars.dv_hashtab, copyID + 1, NULL); } /* script-local variables */ for (i = 1; i <= ga_scripts.ga_len; ++i) abort = abort || set_ref_in_ht(&SCRIPT_VARS(i), copyID, NULL); /* buffer-local variables */ for (buf = firstbuf; buf != NULL; buf = buf->b_next) abort = abort || set_ref_in_item(&buf->b_bufvar.di_tv, copyID, NULL, NULL); /* window-local variables */ FOR_ALL_TAB_WINDOWS(tp, wp) abort = abort || set_ref_in_item(&wp->w_winvar.di_tv, copyID, NULL, NULL); #ifdef FEAT_AUTOCMD if (aucmd_win != NULL) abort = abort || set_ref_in_item(&aucmd_win->w_winvar.di_tv, copyID, NULL, NULL); #endif #ifdef FEAT_WINDOWS /* tabpage-local variables */ for (tp = first_tabpage; tp != NULL; tp = tp->tp_next) abort = abort || set_ref_in_item(&tp->tp_winvar.di_tv, copyID, NULL, NULL); #endif /* global variables */ abort = abort || set_ref_in_ht(&globvarht, copyID, NULL); /* function-local variables */ for (fc = current_funccal; fc != NULL; fc = fc->caller) { abort = abort || set_ref_in_ht(&fc->l_vars.dv_hashtab, copyID, NULL); abort = abort || set_ref_in_ht(&fc->l_avars.dv_hashtab, copyID, NULL); } /* v: vars */ abort = abort || set_ref_in_ht(&vimvarht, copyID, NULL); #ifdef FEAT_LUA abort = abort || set_ref_in_lua(copyID); #endif #ifdef FEAT_PYTHON abort = abort || set_ref_in_python(copyID); #endif #ifdef FEAT_PYTHON3 abort = abort || set_ref_in_python3(copyID); #endif #ifdef FEAT_JOB_CHANNEL abort = abort || set_ref_in_channel(copyID); #endif if (!abort) { /* * 2. Free lists and dictionaries that are not referenced. */ did_free = free_unref_items(copyID); /* * 3. Check if any funccal can be freed now. */ for (pfc = &previous_funccal; *pfc != NULL; ) { if (can_free_funccal(*pfc, copyID)) { fc = *pfc; *pfc = fc->caller; free_funccal(fc, TRUE); did_free = TRUE; did_free_funccal = TRUE; } else pfc = &(*pfc)->caller; } if (did_free_funccal) /* When a funccal was freed some more items might be garbage * collected, so run again. */ (void)garbage_collect(); } else if (p_verbose > 0) { verb_msg((char_u *)_("Not enough memory to set references, garbage collection aborted!")); } return did_free; } /* * Free lists, dictionaries and jobs that are no longer referenced. */ static int free_unref_items(int copyID) { dict_T *dd, *dd_next; list_T *ll, *ll_next; int did_free = FALSE; /* * Go through the list of dicts and free items without the copyID. */ for (dd = first_dict; dd != NULL; ) { dd_next = dd->dv_used_next; if ((dd->dv_copyID & COPYID_MASK) != (copyID & COPYID_MASK)) { /* Free the Dictionary and ordinary items it contains, but don't * recurse into Lists and Dictionaries, they will be in the list * of dicts or list of lists. */ dict_free(dd, FALSE); did_free = TRUE; } dd = dd_next; } /* * Go through the list of lists and free items without the copyID. * But don't free a list that has a watcher (used in a for loop), these * are not referenced anywhere. */ for (ll = first_list; ll != NULL; ) { ll_next = ll->lv_used_next; if ((ll->lv_copyID & COPYID_MASK) != (copyID & COPYID_MASK) && ll->lv_watch == NULL) { /* Free the List and ordinary items it contains, but don't recurse * into Lists and Dictionaries, they will be in the list of dicts * or list of lists. */ list_free(ll, FALSE); did_free = TRUE; } ll = ll_next; } return did_free; } /* * Mark all lists and dicts referenced through hashtab "ht" with "copyID". * "list_stack" is used to add lists to be marked. Can be NULL. * * Returns TRUE if setting references failed somehow. */ int set_ref_in_ht(hashtab_T *ht, int copyID, list_stack_T **list_stack) { int todo; int abort = FALSE; hashitem_T *hi; hashtab_T *cur_ht; ht_stack_T *ht_stack = NULL; ht_stack_T *tempitem; cur_ht = ht; for (;;) { if (!abort) { /* Mark each item in the hashtab. If the item contains a hashtab * it is added to ht_stack, if it contains a list it is added to * list_stack. */ todo = (int)cur_ht->ht_used; for (hi = cur_ht->ht_array; todo > 0; ++hi) if (!HASHITEM_EMPTY(hi)) { --todo; abort = abort || set_ref_in_item(&HI2DI(hi)->di_tv, copyID, &ht_stack, list_stack); } } if (ht_stack == NULL) break; /* take an item from the stack */ cur_ht = ht_stack->ht; tempitem = ht_stack; ht_stack = ht_stack->prev; free(tempitem); } return abort; } /* * Mark all lists and dicts referenced through list "l" with "copyID". * "ht_stack" is used to add hashtabs to be marked. Can be NULL. * * Returns TRUE if setting references failed somehow. */ int set_ref_in_list(list_T *l, int copyID, ht_stack_T **ht_stack) { listitem_T *li; int abort = FALSE; list_T *cur_l; list_stack_T *list_stack = NULL; list_stack_T *tempitem; cur_l = l; for (;;) { if (!abort) /* Mark each item in the list. If the item contains a hashtab * it is added to ht_stack, if it contains a list it is added to * list_stack. */ for (li = cur_l->lv_first; !abort && li != NULL; li = li->li_next) abort = abort || set_ref_in_item(&li->li_tv, copyID, ht_stack, &list_stack); if (list_stack == NULL) break; /* take an item from the stack */ cur_l = list_stack->list; tempitem = list_stack; list_stack = list_stack->prev; free(tempitem); } return abort; } /* * Mark all lists and dicts referenced through typval "tv" with "copyID". * "list_stack" is used to add lists to be marked. Can be NULL. * "ht_stack" is used to add hashtabs to be marked. Can be NULL. * * Returns TRUE if setting references failed somehow. */ int set_ref_in_item( typval_T *tv, int copyID, ht_stack_T **ht_stack, list_stack_T **list_stack) { dict_T *dd; list_T *ll; int abort = FALSE; if (tv->v_type == VAR_DICT || tv->v_type == VAR_PARTIAL) { if (tv->v_type == VAR_DICT) dd = tv->vval.v_dict; else if (tv->vval.v_partial != NULL) dd = tv->vval.v_partial->pt_dict; else dd = NULL; if (dd != NULL && dd->dv_copyID != copyID) { /* Didn't see this dict yet. */ dd->dv_copyID = copyID; if (ht_stack == NULL) { abort = set_ref_in_ht(&dd->dv_hashtab, copyID, list_stack); } else { ht_stack_T *newitem = (ht_stack_T*)malloc(sizeof(ht_stack_T)); if (newitem == NULL) abort = TRUE; else { newitem->ht = &dd->dv_hashtab; newitem->prev = *ht_stack; *ht_stack = newitem; } } } } else if (tv->v_type == VAR_LIST) { ll = tv->vval.v_list; if (ll != NULL && ll->lv_copyID != copyID) { /* Didn't see this list yet. */ ll->lv_copyID = copyID; if (list_stack == NULL) { abort = set_ref_in_list(ll, copyID, ht_stack); } else { list_stack_T *newitem = (list_stack_T*)malloc( sizeof(list_stack_T)); if (newitem == NULL) abort = TRUE; else { newitem->list = ll; newitem->prev = *list_stack; *list_stack = newitem; } } } } return abort; } static void partial_free(partial_T *pt, int free_dict) { int i; for (i = 0; i < pt->pt_argc; ++i) clear_tv(&pt->pt_argv[i]); vim_free(pt->pt_argv); if (free_dict) dict_unref(pt->pt_dict); func_unref(pt->pt_name); vim_free(pt->pt_name); vim_free(pt); } /* * Unreference a closure: decrement the reference count and free it when it * becomes zero. */ void partial_unref(partial_T *pt) { if (pt != NULL && --pt->pt_refcount <= 0) partial_free(pt, TRUE); } /* * Allocate an empty header for a dictionary. */ dict_T * dict_alloc(void) { dict_T *d; d = (dict_T *)alloc(sizeof(dict_T)); if (d != NULL) { /* Add the dict to the list of dicts for garbage collection. */ if (first_dict != NULL) first_dict->dv_used_prev = d; d->dv_used_next = first_dict; d->dv_used_prev = NULL; first_dict = d; hash_init(&d->dv_hashtab); d->dv_lock = 0; d->dv_scope = 0; d->dv_refcount = 0; d->dv_copyID = 0; } return d; } /* * Allocate an empty dict for a return value. * Returns OK or FAIL. */ int rettv_dict_alloc(typval_T *rettv) { dict_T *d = dict_alloc(); if (d == NULL) return FAIL; rettv->vval.v_dict = d; rettv->v_type = VAR_DICT; rettv->v_lock = 0; ++d->dv_refcount; return OK; } /* * Unreference a Dictionary: decrement the reference count and free it when it * becomes zero. */ void dict_unref(dict_T *d) { if (d != NULL && --d->dv_refcount <= 0) dict_free(d, TRUE); } /* * Free a Dictionary, including all non-container items it contains. * Ignores the reference count. */ void dict_free( dict_T *d, int recurse) /* Free Lists and Dictionaries recursively. */ { int todo; hashitem_T *hi; dictitem_T *di; /* Remove the dict from the list of dicts for garbage collection. */ if (d->dv_used_prev == NULL) first_dict = d->dv_used_next; else d->dv_used_prev->dv_used_next = d->dv_used_next; if (d->dv_used_next != NULL) d->dv_used_next->dv_used_prev = d->dv_used_prev; /* Lock the hashtab, we don't want it to resize while freeing items. */ hash_lock(&d->dv_hashtab); todo = (int)d->dv_hashtab.ht_used; for (hi = d->dv_hashtab.ht_array; todo > 0; ++hi) { if (!HASHITEM_EMPTY(hi)) { /* Remove the item before deleting it, just in case there is * something recursive causing trouble. */ di = HI2DI(hi); hash_remove(&d->dv_hashtab, hi); if (recurse || (di->di_tv.v_type != VAR_LIST && di->di_tv.v_type != VAR_DICT)) { if (!recurse && di->di_tv.v_type == VAR_PARTIAL) { partial_T *pt = di->di_tv.vval.v_partial; /* We unref the partial but not the dict it refers to. */ if (pt != NULL && --pt->pt_refcount == 0) partial_free(pt, FALSE); } else clear_tv(&di->di_tv); } vim_free(di); --todo; } } hash_clear(&d->dv_hashtab); vim_free(d); } /* * Allocate a Dictionary item. * The "key" is copied to the new item. * Note that the value of the item "di_tv" still needs to be initialized! * Returns NULL when out of memory. */ dictitem_T * dictitem_alloc(char_u *key) { dictitem_T *di; di = (dictitem_T *)alloc((unsigned)(sizeof(dictitem_T) + STRLEN(key))); if (di != NULL) { STRCPY(di->di_key, key); di->di_flags = DI_FLAGS_ALLOC; } return di; } /* * Make a copy of a Dictionary item. */ static dictitem_T * dictitem_copy(dictitem_T *org) { dictitem_T *di; di = (dictitem_T *)alloc((unsigned)(sizeof(dictitem_T) + STRLEN(org->di_key))); if (di != NULL) { STRCPY(di->di_key, org->di_key); di->di_flags = DI_FLAGS_ALLOC; copy_tv(&org->di_tv, &di->di_tv); } return di; } /* * Remove item "item" from Dictionary "dict" and free it. */ static void dictitem_remove(dict_T *dict, dictitem_T *item) { hashitem_T *hi; hi = hash_find(&dict->dv_hashtab, item->di_key); if (HASHITEM_EMPTY(hi)) EMSG2(_(e_intern2), "dictitem_remove()"); else hash_remove(&dict->dv_hashtab, hi); dictitem_free(item); } /* * Free a dict item. Also clears the value. */ void dictitem_free(dictitem_T *item) { clear_tv(&item->di_tv); if (item->di_flags & DI_FLAGS_ALLOC) vim_free(item); } /* * Make a copy of dict "d". Shallow if "deep" is FALSE. * The refcount of the new dict is set to 1. * See item_copy() for "copyID". * Returns NULL when out of memory. */ static dict_T * dict_copy(dict_T *orig, int deep, int copyID) { dict_T *copy; dictitem_T *di; int todo; hashitem_T *hi; if (orig == NULL) return NULL; copy = dict_alloc(); if (copy != NULL) { if (copyID != 0) { orig->dv_copyID = copyID; orig->dv_copydict = copy; } todo = (int)orig->dv_hashtab.ht_used; for (hi = orig->dv_hashtab.ht_array; todo > 0 && !got_int; ++hi) { if (!HASHITEM_EMPTY(hi)) { --todo; di = dictitem_alloc(hi->hi_key); if (di == NULL) break; if (deep) { if (item_copy(&HI2DI(hi)->di_tv, &di->di_tv, deep, copyID) == FAIL) { vim_free(di); break; } } else copy_tv(&HI2DI(hi)->di_tv, &di->di_tv); if (dict_add(copy, di) == FAIL) { dictitem_free(di); break; } } } ++copy->dv_refcount; if (todo > 0) { dict_unref(copy); copy = NULL; } } return copy; } /* * Add item "item" to Dictionary "d". * Returns FAIL when out of memory and when key already exists. */ int dict_add(dict_T *d, dictitem_T *item) { return hash_add(&d->dv_hashtab, item->di_key); } /* * Add a number or string entry to dictionary "d". * When "str" is NULL use number "nr", otherwise use "str". * Returns FAIL when out of memory and when key already exists. */ int dict_add_nr_str( dict_T *d, char *key, long nr, char_u *str) { dictitem_T *item; item = dictitem_alloc((char_u *)key); if (item == NULL) return FAIL; item->di_tv.v_lock = 0; if (str == NULL) { item->di_tv.v_type = VAR_NUMBER; item->di_tv.vval.v_number = nr; } else { item->di_tv.v_type = VAR_STRING; item->di_tv.vval.v_string = vim_strsave(str); } if (dict_add(d, item) == FAIL) { dictitem_free(item); return FAIL; } return OK; } /* * Add a list entry to dictionary "d". * Returns FAIL when out of memory and when key already exists. */ int dict_add_list(dict_T *d, char *key, list_T *list) { dictitem_T *item; item = dictitem_alloc((char_u *)key); if (item == NULL) return FAIL; item->di_tv.v_lock = 0; item->di_tv.v_type = VAR_LIST; item->di_tv.vval.v_list = list; if (dict_add(d, item) == FAIL) { dictitem_free(item); return FAIL; } ++list->lv_refcount; return OK; } /* * Get the number of items in a Dictionary. */ static long dict_len(dict_T *d) { if (d == NULL) return 0L; return (long)d->dv_hashtab.ht_used; } /* * Find item "key[len]" in Dictionary "d". * If "len" is negative use strlen(key). * Returns NULL when not found. */ dictitem_T * dict_find(dict_T *d, char_u *key, int len) { #define AKEYLEN 200 char_u buf[AKEYLEN]; char_u *akey; char_u *tofree = NULL; hashitem_T *hi; if (len < 0) akey = key; else if (len >= AKEYLEN) { tofree = akey = vim_strnsave(key, len); if (akey == NULL) return NULL; } else { /* Avoid a malloc/free by using buf[]. */ vim_strncpy(buf, key, len); akey = buf; } hi = hash_find(&d->dv_hashtab, akey); vim_free(tofree); if (HASHITEM_EMPTY(hi)) return NULL; return HI2DI(hi); } /* * Get a string item from a dictionary. * When "save" is TRUE allocate memory for it. * Returns NULL if the entry doesn't exist or out of memory. */ char_u * get_dict_string(dict_T *d, char_u *key, int save) { dictitem_T *di; char_u *s; di = dict_find(d, key, -1); if (di == NULL) return NULL; s = get_tv_string(&di->di_tv); if (save && s != NULL) s = vim_strsave(s); return s; } /* * Get a number item from a dictionary. * Returns 0 if the entry doesn't exist. */ long get_dict_number(dict_T *d, char_u *key) { dictitem_T *di; di = dict_find(d, key, -1); if (di == NULL) return 0; return get_tv_number(&di->di_tv); } /* * Return an allocated string with the string representation of a Dictionary. * May return NULL. */ static char_u * dict2string(typval_T *tv, int copyID) { garray_T ga; int first = TRUE; char_u *tofree; char_u numbuf[NUMBUFLEN]; hashitem_T *hi; char_u *s; dict_T *d; int todo; if ((d = tv->vval.v_dict) == NULL) return NULL; ga_init2(&ga, (int)sizeof(char), 80); ga_append(&ga, '{'); todo = (int)d->dv_hashtab.ht_used; for (hi = d->dv_hashtab.ht_array; todo > 0 && !got_int; ++hi) { if (!HASHITEM_EMPTY(hi)) { --todo; if (first) first = FALSE; else ga_concat(&ga, (char_u *)", "); tofree = string_quote(hi->hi_key, FALSE); if (tofree != NULL) { ga_concat(&ga, tofree); vim_free(tofree); } ga_concat(&ga, (char_u *)": "); s = tv2string(&HI2DI(hi)->di_tv, &tofree, numbuf, copyID); if (s != NULL) ga_concat(&ga, s); vim_free(tofree); if (s == NULL || did_echo_string_emsg) break; line_breakcheck(); } } if (todo > 0) { vim_free(ga.ga_data); return NULL; } ga_append(&ga, '}'); ga_append(&ga, NUL); return (char_u *)ga.ga_data; } /* * Allocate a variable for a Dictionary and fill it from "*arg". * Return OK or FAIL. Returns NOTDONE for {expr}. */ static int get_dict_tv(char_u **arg, typval_T *rettv, int evaluate) { dict_T *d = NULL; typval_T tvkey; typval_T tv; char_u *key = NULL; dictitem_T *item; char_u *start = skipwhite(*arg + 1); char_u buf[NUMBUFLEN]; /* * First check if it's not a curly-braces thing: {expr}. * Must do this without evaluating, otherwise a function may be called * twice. Unfortunately this means we need to call eval1() twice for the * first item. * But {} is an empty Dictionary. */ if (*start != '}') { if (eval1(&start, &tv, FALSE) == FAIL) /* recursive! */ return FAIL; if (*start == '}') return NOTDONE; } if (evaluate) { d = dict_alloc(); if (d == NULL) return FAIL; } tvkey.v_type = VAR_UNKNOWN; tv.v_type = VAR_UNKNOWN; *arg = skipwhite(*arg + 1); while (**arg != '}' && **arg != NUL) { if (eval1(arg, &tvkey, evaluate) == FAIL) /* recursive! */ goto failret; if (**arg != ':') { EMSG2(_("E720: Missing colon in Dictionary: %s"), *arg); clear_tv(&tvkey); goto failret; } if (evaluate) { key = get_tv_string_buf_chk(&tvkey, buf); if (key == NULL || *key == NUL) { /* "key" is NULL when get_tv_string_buf_chk() gave an errmsg */ if (key != NULL) EMSG(_(e_emptykey)); clear_tv(&tvkey); goto failret; } } *arg = skipwhite(*arg + 1); if (eval1(arg, &tv, evaluate) == FAIL) /* recursive! */ { if (evaluate) clear_tv(&tvkey); goto failret; } if (evaluate) { item = dict_find(d, key, -1); if (item != NULL) { EMSG2(_("E721: Duplicate key in Dictionary: \"%s\""), key); clear_tv(&tvkey); clear_tv(&tv); goto failret; } item = dictitem_alloc(key); clear_tv(&tvkey); if (item != NULL) { item->di_tv = tv; item->di_tv.v_lock = 0; if (dict_add(d, item) == FAIL) dictitem_free(item); } } if (**arg == '}') break; if (**arg != ',') { EMSG2(_("E722: Missing comma in Dictionary: %s"), *arg); goto failret; } *arg = skipwhite(*arg + 1); } if (**arg != '}') { EMSG2(_("E723: Missing end of Dictionary '}': %s"), *arg); failret: if (evaluate) dict_free(d, TRUE); return FAIL; } *arg = skipwhite(*arg + 1); if (evaluate) { rettv->v_type = VAR_DICT; rettv->vval.v_dict = d; ++d->dv_refcount; } return OK; } #if defined(FEAT_JOB_CHANNEL) || defined(PROTO) #endif static char * get_var_special_name(int nr) { switch (nr) { case VVAL_FALSE: return "v:false"; case VVAL_TRUE: return "v:true"; case VVAL_NONE: return "v:none"; case VVAL_NULL: return "v:null"; } EMSG2(_(e_intern2), "get_var_special_name()"); return "42"; } /* * Return a string with the string representation of a variable. * If the memory is allocated "tofree" is set to it, otherwise NULL. * "numbuf" is used for a number. * Does not put quotes around strings, as ":echo" displays values. * When "copyID" is not NULL replace recursive lists and dicts with "...". * May return NULL. */ static char_u * echo_string( typval_T *tv, char_u **tofree, char_u *numbuf, int copyID) { static int recurse = 0; char_u *r = NULL; if (recurse >= DICT_MAXNEST) { if (!did_echo_string_emsg) { /* Only give this message once for a recursive call to avoid * flooding the user with errors. And stop iterating over lists * and dicts. */ did_echo_string_emsg = TRUE; EMSG(_("E724: variable nested too deep for displaying")); } *tofree = NULL; return (char_u *)"{E724}"; } ++recurse; switch (tv->v_type) { case VAR_FUNC: *tofree = NULL; r = tv->vval.v_string; break; case VAR_PARTIAL: { partial_T *pt = tv->vval.v_partial; char_u *fname = string_quote(pt == NULL ? NULL : pt->pt_name, FALSE); garray_T ga; int i; char_u *tf; ga_init2(&ga, 1, 100); ga_concat(&ga, (char_u *)"function("); if (fname != NULL) { ga_concat(&ga, fname); vim_free(fname); } if (pt != NULL && pt->pt_argc > 0) { ga_concat(&ga, (char_u *)", ["); for (i = 0; i < pt->pt_argc; ++i) { if (i > 0) ga_concat(&ga, (char_u *)", "); ga_concat(&ga, tv2string(&pt->pt_argv[i], &tf, numbuf, copyID)); vim_free(tf); } ga_concat(&ga, (char_u *)"]"); } if (pt != NULL && pt->pt_dict != NULL) { typval_T dtv; ga_concat(&ga, (char_u *)", "); dtv.v_type = VAR_DICT; dtv.vval.v_dict = pt->pt_dict; ga_concat(&ga, tv2string(&dtv, &tf, numbuf, copyID)); vim_free(tf); } ga_concat(&ga, (char_u *)")"); *tofree = ga.ga_data; r = *tofree; break; } case VAR_LIST: if (tv->vval.v_list == NULL) { *tofree = NULL; r = NULL; } else if (copyID != 0 && tv->vval.v_list->lv_copyID == copyID) { *tofree = NULL; r = (char_u *)"[...]"; } else { tv->vval.v_list->lv_copyID = copyID; *tofree = list2string(tv, copyID); r = *tofree; } break; case VAR_DICT: if (tv->vval.v_dict == NULL) { *tofree = NULL; r = NULL; } else if (copyID != 0 && tv->vval.v_dict->dv_copyID == copyID) { *tofree = NULL; r = (char_u *)"{...}"; } else { tv->vval.v_dict->dv_copyID = copyID; *tofree = dict2string(tv, copyID); r = *tofree; } break; case VAR_STRING: case VAR_NUMBER: case VAR_UNKNOWN: case VAR_JOB: case VAR_CHANNEL: *tofree = NULL; r = get_tv_string_buf(tv, numbuf); break; case VAR_FLOAT: #ifdef FEAT_FLOAT *tofree = NULL; vim_snprintf((char *)numbuf, NUMBUFLEN, "%g", tv->vval.v_float); r = numbuf; break; #endif case VAR_SPECIAL: *tofree = NULL; r = (char_u *)get_var_special_name(tv->vval.v_number); break; } if (--recurse == 0) did_echo_string_emsg = FALSE; return r; } /* * Return a string with the string representation of a variable. * If the memory is allocated "tofree" is set to it, otherwise NULL. * "numbuf" is used for a number. * Puts quotes around strings, so that they can be parsed back by eval(). * May return NULL. */ static char_u * tv2string( typval_T *tv, char_u **tofree, char_u *numbuf, int copyID) { switch (tv->v_type) { case VAR_FUNC: *tofree = string_quote(tv->vval.v_string, TRUE); return *tofree; case VAR_STRING: *tofree = string_quote(tv->vval.v_string, FALSE); return *tofree; case VAR_FLOAT: #ifdef FEAT_FLOAT *tofree = NULL; vim_snprintf((char *)numbuf, NUMBUFLEN - 1, "%g", tv->vval.v_float); return numbuf; #endif case VAR_NUMBER: case VAR_LIST: case VAR_DICT: case VAR_PARTIAL: case VAR_SPECIAL: case VAR_JOB: case VAR_CHANNEL: case VAR_UNKNOWN: break; } return echo_string(tv, tofree, numbuf, copyID); } /* * Return string "str" in ' quotes, doubling ' characters. * If "str" is NULL an empty string is assumed. * If "function" is TRUE make it function('string'). */ static char_u * string_quote(char_u *str, int function) { unsigned len; char_u *p, *r, *s; len = (function ? 13 : 3); if (str != NULL) { len += (unsigned)STRLEN(str); for (p = str; *p != NUL; mb_ptr_adv(p)) if (*p == '\'') ++len; } s = r = alloc(len); if (r != NULL) { if (function) { STRCPY(r, "function('"); r += 10; } else *r++ = '\''; if (str != NULL) for (p = str; *p != NUL; ) { if (*p == '\'') *r++ = '\''; MB_COPY_CHAR(p, r); } *r++ = '\''; if (function) *r++ = ')'; *r++ = NUL; } return s; } #if defined(FEAT_FLOAT) || defined(PROTO) /* * Convert the string "text" to a floating point number. * This uses strtod(). setlocale(LC_NUMERIC, "C") has been used to make sure * this always uses a decimal point. * Returns the length of the text that was consumed. */ int string2float( char_u *text, float_T *value) /* result stored here */ { char *s = (char *)text; float_T f; f = strtod(s, &s); *value = f; return (int)((char_u *)s - text); } #endif /* * 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. * Return FAIL if the name is invalid. */ static int get_env_tv(char_u **arg, typval_T *rettv, int evaluate) { char_u *string = NULL; int len; int cc; char_u *name; int mustfree = FALSE; ++*arg; name = *arg; len = get_env_len(arg); if (evaluate) { if (len == 0) return FAIL; /* invalid empty name */ cc = name[len]; name[len] = NUL; /* first try vim_getenv(), fast for normal environment vars */ string = vim_getenv(name, &mustfree); if (string != NULL && *string != NUL) { if (!mustfree) string = vim_strsave(string); } else { if (mustfree) vim_free(string); /* 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; rettv->v_type = VAR_STRING; rettv->vval.v_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)(typval_T *args, typval_T *rvar); /* implementation of function */ } functions[] = { #ifdef FEAT_FLOAT {"abs", 1, 1, f_abs}, {"acos", 1, 1, f_acos}, /* WJMc */ #endif {"add", 2, 2, f_add}, {"alloc_fail", 3, 3, f_alloc_fail}, {"and", 2, 2, f_and}, {"append", 2, 2, f_append}, {"argc", 0, 0, f_argc}, {"argidx", 0, 0, f_argidx}, {"arglistid", 0, 2, f_arglistid}, {"argv", 0, 1, f_argv}, #ifdef FEAT_FLOAT {"asin", 1, 1, f_asin}, /* WJMc */ #endif {"assert_equal", 2, 3, f_assert_equal}, {"assert_exception", 1, 2, f_assert_exception}, {"assert_fails", 1, 2, f_assert_fails}, {"assert_false", 1, 2, f_assert_false}, {"assert_match", 2, 3, f_assert_match}, {"assert_true", 1, 2, f_assert_true}, #ifdef FEAT_FLOAT {"atan", 1, 1, f_atan}, {"atan2", 2, 2, f_atan2}, #endif {"browse", 4, 4, f_browse}, {"browsedir", 2, 2, f_browsedir}, {"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, 2, f_bufnr}, {"bufwinnr", 1, 1, f_bufwinnr}, {"byte2line", 1, 1, f_byte2line}, {"byteidx", 2, 2, f_byteidx}, {"byteidxcomp", 2, 2, f_byteidxcomp}, {"call", 2, 3, f_call}, #ifdef FEAT_FLOAT {"ceil", 1, 1, f_ceil}, #endif #ifdef FEAT_JOB_CHANNEL {"ch_close", 1, 1, f_ch_close}, {"ch_evalexpr", 2, 3, f_ch_evalexpr}, {"ch_evalraw", 2, 3, f_ch_evalraw}, {"ch_getbufnr", 2, 2, f_ch_getbufnr}, {"ch_getjob", 1, 1, f_ch_getjob}, {"ch_info", 1, 1, f_ch_info}, {"ch_log", 1, 2, f_ch_log}, {"ch_logfile", 1, 2, f_ch_logfile}, {"ch_open", 1, 2, f_ch_open}, {"ch_read", 1, 2, f_ch_read}, {"ch_readraw", 1, 2, f_ch_readraw}, {"ch_sendexpr", 2, 3, f_ch_sendexpr}, {"ch_sendraw", 2, 3, f_ch_sendraw}, {"ch_setoptions", 2, 2, f_ch_setoptions}, {"ch_status", 1, 1, f_ch_status}, #endif {"changenr", 0, 0, f_changenr}, {"char2nr", 1, 2, f_char2nr}, {"cindent", 1, 1, f_cindent}, {"clearmatches", 0, 0, f_clearmatches}, {"col", 1, 1, f_col}, #if defined(FEAT_INS_EXPAND) {"complete", 2, 2, f_complete}, {"complete_add", 1, 1, f_complete_add}, {"complete_check", 0, 0, f_complete_check}, #endif {"confirm", 1, 4, f_confirm}, {"copy", 1, 1, f_copy}, #ifdef FEAT_FLOAT {"cos", 1, 1, f_cos}, {"cosh", 1, 1, f_cosh}, #endif {"count", 2, 4, f_count}, {"cscope_connection",0,3, f_cscope_connection}, {"cursor", 1, 3, f_cursor}, {"deepcopy", 1, 2, f_deepcopy}, {"delete", 1, 2, f_delete}, {"did_filetype", 0, 0, f_did_filetype}, {"diff_filler", 1, 1, f_diff_filler}, {"diff_hlID", 2, 2, f_diff_hlID}, {"disable_char_avail_for_testing", 1, 1, f_disable_char_avail_for_testing}, {"empty", 1, 1, f_empty}, {"escape", 2, 2, f_escape}, {"eval", 1, 1, f_eval}, {"eventhandler", 0, 0, f_eventhandler}, {"executable", 1, 1, f_executable}, {"exepath", 1, 1, f_exepath}, {"exists", 1, 1, f_exists}, #ifdef FEAT_FLOAT {"exp", 1, 1, f_exp}, #endif {"expand", 1, 3, f_expand}, {"extend", 2, 3, f_extend}, {"feedkeys", 1, 2, f_feedkeys}, {"file_readable", 1, 1, f_filereadable}, /* obsolete */ {"filereadable", 1, 1, f_filereadable}, {"filewritable", 1, 1, f_filewritable}, {"filter", 2, 2, f_filter}, {"finddir", 1, 3, f_finddir}, {"findfile", 1, 3, f_findfile}, #ifdef FEAT_FLOAT {"float2nr", 1, 1, f_float2nr}, {"floor", 1, 1, f_floor}, {"fmod", 2, 2, f_fmod}, #endif {"fnameescape", 1, 1, f_fnameescape}, {"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}, {"foldtextresult", 1, 1, f_foldtextresult}, {"foreground", 0, 0, f_foreground}, {"function", 1, 3, f_function}, {"garbagecollect", 0, 1, f_garbagecollect}, {"get", 2, 3, f_get}, {"getbufline", 2, 3, f_getbufline}, {"getbufvar", 2, 3, f_getbufvar}, {"getchar", 0, 1, f_getchar}, {"getcharmod", 0, 0, f_getcharmod}, {"getcharsearch", 0, 0, f_getcharsearch}, {"getcmdline", 0, 0, f_getcmdline}, {"getcmdpos", 0, 0, f_getcmdpos}, {"getcmdtype", 0, 0, f_getcmdtype}, {"getcmdwintype", 0, 0, f_getcmdwintype}, {"getcurpos", 0, 0, f_getcurpos}, {"getcwd", 0, 2, f_getcwd}, {"getfontname", 0, 1, f_getfontname}, {"getfperm", 1, 1, f_getfperm}, {"getfsize", 1, 1, f_getfsize}, {"getftime", 1, 1, f_getftime}, {"getftype", 1, 1, f_getftype}, {"getline", 1, 2, f_getline}, {"getloclist", 1, 1, f_getqflist}, {"getmatches", 0, 0, f_getmatches}, {"getpid", 0, 0, f_getpid}, {"getpos", 1, 1, f_getpos}, {"getqflist", 0, 0, f_getqflist}, {"getreg", 0, 3, f_getreg}, {"getregtype", 0, 1, f_getregtype}, {"gettabvar", 2, 3, f_gettabvar}, {"gettabwinvar", 3, 4, f_gettabwinvar}, {"getwinposx", 0, 0, f_getwinposx}, {"getwinposy", 0, 0, f_getwinposy}, {"getwinvar", 2, 3, f_getwinvar}, {"glob", 1, 4, f_glob}, {"glob2regpat", 1, 1, f_glob2regpat}, {"globpath", 2, 5, f_globpath}, {"has", 1, 1, f_has}, {"has_key", 2, 2, f_has_key}, {"haslocaldir", 0, 2, f_haslocaldir}, {"hasmapto", 1, 3, 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}, {"index", 2, 4, f_index}, {"input", 1, 3, f_input}, {"inputdialog", 1, 3, f_inputdialog}, {"inputlist", 1, 1, f_inputlist}, {"inputrestore", 0, 0, f_inputrestore}, {"inputsave", 0, 0, f_inputsave}, {"inputsecret", 1, 2, f_inputsecret}, {"insert", 2, 3, f_insert}, {"invert", 1, 1, f_invert}, {"isdirectory", 1, 1, f_isdirectory}, {"islocked", 1, 1, f_islocked}, #if defined(FEAT_FLOAT) && defined(HAVE_MATH_H) {"isnan", 1, 1, f_isnan}, #endif {"items", 1, 1, f_items}, #ifdef FEAT_JOB_CHANNEL {"job_getchannel", 1, 1, f_job_getchannel}, {"job_info", 1, 1, f_job_info}, {"job_setoptions", 2, 2, f_job_setoptions}, {"job_start", 1, 2, f_job_start}, {"job_status", 1, 1, f_job_status}, {"job_stop", 1, 2, f_job_stop}, #endif {"join", 1, 2, f_join}, {"js_decode", 1, 1, f_js_decode}, {"js_encode", 1, 1, f_js_encode}, {"json_decode", 1, 1, f_json_decode}, {"json_encode", 1, 1, f_json_encode}, {"keys", 1, 1, f_keys}, {"last_buffer_nr", 0, 0, f_last_buffer_nr},/* obsolete */ {"len", 1, 1, f_len}, {"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}, #ifdef FEAT_FLOAT {"log", 1, 1, f_log}, {"log10", 1, 1, f_log10}, #endif #ifdef FEAT_LUA {"luaeval", 1, 2, f_luaeval}, #endif {"map", 2, 2, f_map}, {"maparg", 1, 4, f_maparg}, {"mapcheck", 1, 3, f_mapcheck}, {"match", 2, 4, f_match}, {"matchadd", 2, 5, f_matchadd}, {"matchaddpos", 2, 5, f_matchaddpos}, {"matcharg", 1, 1, f_matcharg}, {"matchdelete", 1, 1, f_matchdelete}, {"matchend", 2, 4, f_matchend}, {"matchlist", 2, 4, f_matchlist}, {"matchstr", 2, 4, f_matchstr}, {"matchstrpos", 2, 4, f_matchstrpos}, {"max", 1, 1, f_max}, {"min", 1, 1, f_min}, #ifdef vim_mkdir {"mkdir", 1, 3, f_mkdir}, #endif {"mode", 0, 1, f_mode}, #ifdef FEAT_MZSCHEME {"mzeval", 1, 1, f_mzeval}, #endif {"nextnonblank", 1, 1, f_nextnonblank}, {"nr2char", 1, 2, f_nr2char}, {"or", 2, 2, f_or}, {"pathshorten", 1, 1, f_pathshorten}, #ifdef FEAT_PERL {"perleval", 1, 1, f_perleval}, #endif #ifdef FEAT_FLOAT {"pow", 2, 2, f_pow}, #endif {"prevnonblank", 1, 1, f_prevnonblank}, {"printf", 2, 19, f_printf}, {"pumvisible", 0, 0, f_pumvisible}, #ifdef FEAT_PYTHON3 {"py3eval", 1, 1, f_py3eval}, #endif #ifdef FEAT_PYTHON {"pyeval", 1, 1, f_pyeval}, #endif {"range", 1, 3, f_range}, {"readfile", 1, 3, f_readfile}, {"reltime", 0, 2, f_reltime}, #ifdef FEAT_FLOAT {"reltimefloat", 1, 1, f_reltimefloat}, #endif {"reltimestr", 1, 1, f_reltimestr}, {"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}, {"remove", 2, 3, f_remove}, {"rename", 2, 2, f_rename}, {"repeat", 2, 2, f_repeat}, {"resolve", 1, 1, f_resolve}, {"reverse", 1, 1, f_reverse}, #ifdef FEAT_FLOAT {"round", 1, 1, f_round}, #endif {"screenattr", 2, 2, f_screenattr}, {"screenchar", 2, 2, f_screenchar}, {"screencol", 0, 0, f_screencol}, {"screenrow", 0, 0, f_screenrow}, {"search", 1, 4, f_search}, {"searchdecl", 1, 3, f_searchdecl}, {"searchpair", 3, 7, f_searchpair}, {"searchpairpos", 3, 7, f_searchpairpos}, {"searchpos", 1, 4, f_searchpos}, {"server2client", 2, 2, f_server2client}, {"serverlist", 0, 0, f_serverlist}, {"setbufvar", 3, 3, f_setbufvar}, {"setcharsearch", 1, 1, f_setcharsearch}, {"setcmdpos", 1, 1, f_setcmdpos}, {"setfperm", 2, 2, f_setfperm}, {"setline", 2, 2, f_setline}, {"setloclist", 2, 3, f_setloclist}, {"setmatches", 1, 1, f_setmatches}, {"setpos", 2, 2, f_setpos}, {"setqflist", 1, 2, f_setqflist}, {"setreg", 2, 3, f_setreg}, {"settabvar", 3, 3, f_settabvar}, {"settabwinvar", 4, 4, f_settabwinvar}, {"setwinvar", 3, 3, f_setwinvar}, #ifdef FEAT_CRYPT {"sha256", 1, 1, f_sha256}, #endif {"shellescape", 1, 2, f_shellescape}, {"shiftwidth", 0, 0, f_shiftwidth}, {"simplify", 1, 1, f_simplify}, #ifdef FEAT_FLOAT {"sin", 1, 1, f_sin}, {"sinh", 1, 1, f_sinh}, #endif {"sort", 1, 3, f_sort}, {"soundfold", 1, 1, f_soundfold}, {"spellbadword", 0, 1, f_spellbadword}, {"spellsuggest", 1, 3, f_spellsuggest}, {"split", 1, 3, f_split}, #ifdef FEAT_FLOAT {"sqrt", 1, 1, f_sqrt}, {"str2float", 1, 1, f_str2float}, #endif {"str2nr", 1, 2, f_str2nr}, {"strchars", 1, 2, f_strchars}, {"strdisplaywidth", 1, 2, f_strdisplaywidth}, #ifdef HAVE_STRFTIME {"strftime", 1, 2, f_strftime}, #endif {"stridx", 2, 3, f_stridx}, {"string", 1, 1, f_string}, {"strlen", 1, 1, f_strlen}, {"strpart", 2, 3, f_strpart}, {"strridx", 2, 3, f_strridx}, {"strtrans", 1, 1, f_strtrans}, {"strwidth", 1, 1, f_strwidth}, {"submatch", 1, 2, f_submatch}, {"substitute", 4, 4, f_substitute}, {"synID", 3, 3, f_synID}, {"synIDattr", 2, 3, f_synIDattr}, {"synIDtrans", 1, 1, f_synIDtrans}, {"synconcealed", 2, 2, f_synconcealed}, {"synstack", 2, 2, f_synstack}, {"system", 1, 2, f_system}, {"systemlist", 1, 2, f_systemlist}, {"tabpagebuflist", 0, 1, f_tabpagebuflist}, {"tabpagenr", 0, 1, f_tabpagenr}, {"tabpagewinnr", 1, 2, f_tabpagewinnr}, {"tagfiles", 0, 0, f_tagfiles}, {"taglist", 1, 1, f_taglist}, #ifdef FEAT_FLOAT {"tan", 1, 1, f_tan}, {"tanh", 1, 1, f_tanh}, #endif {"tempname", 0, 0, f_tempname}, {"test", 1, 1, f_test}, #ifdef FEAT_TIMERS {"timer_start", 2, 3, f_timer_start}, {"timer_stop", 1, 1, f_timer_stop}, #endif {"tolower", 1, 1, f_tolower}, {"toupper", 1, 1, f_toupper}, {"tr", 3, 3, f_tr}, #ifdef FEAT_FLOAT {"trunc", 1, 1, f_trunc}, #endif {"type", 1, 1, f_type}, {"undofile", 1, 1, f_undofile}, {"undotree", 0, 0, f_undotree}, {"uniq", 1, 3, f_uniq}, {"values", 1, 1, f_values}, {"virtcol", 1, 1, f_virtcol}, {"visualmode", 0, 1, f_visualmode}, {"wildmenumode", 0, 0, f_wildmenumode}, {"win_findbuf", 1, 1, f_win_findbuf}, {"win_getid", 0, 2, f_win_getid}, {"win_gotoid", 1, 1, f_win_gotoid}, {"win_id2tabwin", 1, 1, f_win_id2tabwin}, {"win_id2win", 1, 1, f_win_id2win}, {"winbufnr", 1, 1, f_winbufnr}, {"wincol", 0, 0, f_wincol}, {"winheight", 1, 1, f_winheight}, {"winline", 0, 0, f_winline}, {"winnr", 0, 1, f_winnr}, {"winrestcmd", 0, 0, f_winrestcmd}, {"winrestview", 1, 1, f_winrestview}, {"winsaveview", 0, 0, f_winsaveview}, {"winwidth", 1, 1, f_winwidth}, {"wordcount", 0, 0, f_wordcount}, {"writefile", 2, 3, f_writefile}, {"xor", 2, 2, f_xor}, }; #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(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. */ char_u * get_expr_name(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 */ #if defined(EBCDIC) || defined(PROTO) /* * Compare struct fst by function name. */ static int compare_func_name(const void *s1, const void *s2) { struct fst *p1 = (struct fst *)s1; struct fst *p2 = (struct fst *)s2; return STRCMP(p1->f_name, p2->f_name); } /* * Sort the function table by function name. * The sorting of the table above is ASCII dependant. * On machines using EBCDIC we have to sort it. */ static void sortFunctions(void) { int funcCnt = (int)(sizeof(functions) / sizeof(struct fst)) - 1; qsort(functions, (size_t)funcCnt, sizeof(struct fst), compare_func_name); } #endif /* * Find internal function in table above. * Return index, or -1 if not found */ static int find_internal_func( 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; } /* * Check if "name" is a variable of type VAR_FUNC. If so, return the function * name it contains, otherwise return "name". * If "partialp" is not NULL, and "name" is of type VAR_PARTIAL also set * "partialp". */ static char_u * deref_func_name(char_u *name, int *lenp, partial_T **partialp, int no_autoload) { dictitem_T *v; int cc; if (partialp != NULL) *partialp = NULL; cc = name[*lenp]; name[*lenp] = NUL; v = find_var(name, NULL, no_autoload); name[*lenp] = cc; if (v != NULL && v->di_tv.v_type == VAR_FUNC) { if (v->di_tv.vval.v_string == NULL) { *lenp = 0; return (char_u *)""; /* just in case */ } *lenp = (int)STRLEN(v->di_tv.vval.v_string); return v->di_tv.vval.v_string; } if (v != NULL && v->di_tv.v_type == VAR_PARTIAL) { partial_T *pt = v->di_tv.vval.v_partial; if (pt == NULL) { *lenp = 0; return (char_u *)""; /* just in case */ } if (partialp != NULL) *partialp = pt; *lenp = (int)STRLEN(pt->pt_name); return pt->pt_name; } return name; } /* * Allocate a variable for the result of a function. * Return OK or FAIL. */ static int get_func_tv( char_u *name, /* name of the function */ int len, /* length of "name" */ typval_T *rettv, 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, partial_T *partial, /* for extra arguments */ dict_T *selfdict) /* Dictionary for "self" */ { char_u *argp; int ret = OK; typval_T argvars[MAX_FUNC_ARGS + 1]; /* vars for arguments */ int argcount = 0; /* number of arguments found */ /* * Get the arguments. */ argp = *arg; while (argcount < MAX_FUNC_ARGS - (partial == NULL ? 0 : partial->pt_argc)) { argp = skipwhite(argp + 1); /* skip the '(' or ',' */ if (*argp == ')' || *argp == ',' || *argp == NUL) break; 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, rettv, argcount, argvars, firstline, lastline, doesrange, evaluate, partial, selfdict); else if (!aborting()) { if (argcount == MAX_FUNC_ARGS) emsg_funcname(N_("E740: Too many arguments for function %s"), name); else emsg_funcname(N_("E116: Invalid arguments for function %s"), name); } while (--argcount >= 0) clear_tv(&argvars[argcount]); *arg = skipwhite(argp); return ret; } #define ERROR_UNKNOWN 0 #define ERROR_TOOMANY 1 #define ERROR_TOOFEW 2 #define ERROR_SCRIPT 3 #define ERROR_DICT 4 #define ERROR_NONE 5 #define ERROR_OTHER 6 #define FLEN_FIXED 40 /* * In a script change name() and s:name() to K_SNR 123_name(). * Change 123_name() to K_SNR 123_name(). * Use "fname_buf[FLEN_FIXED + 1]" when it fits, otherwise allocate memory * (slow). */ static char_u * fname_trans_sid(char_u *name, char_u *fname_buf, char_u **tofree, int *error) { int llen; char_u *fname; int i; 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)) /* "" 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 { *tofree = fname; mch_memmove(fname, fname_buf, (size_t)i); STRCPY(fname + i, name + llen); } } } else fname = name; return fname; } /* * Call a function with its resolved parameters * Return FAIL when the function can't be called, OK otherwise. * Also returns OK when an error was encountered while executing the function. */ int call_func( char_u *funcname, /* name of the function */ int len, /* length of "name" */ typval_T *rettv, /* return value goes here */ int argcount_in, /* number of "argvars" */ typval_T *argvars_in, /* vars for arguments, must have "argcount" PLUS ONE elements! */ linenr_T firstline, /* first line of range */ linenr_T lastline, /* last line of range */ int *doesrange, /* return: function handled range */ int evaluate, partial_T *partial, /* optional, can be NULL */ dict_T *selfdict_in) /* Dictionary for "self" */ { int ret = FAIL; int error = ERROR_NONE; int i; ufunc_T *fp; char_u fname_buf[FLEN_FIXED + 1]; char_u *tofree = NULL; char_u *fname; char_u *name; int argcount = argcount_in; typval_T *argvars = argvars_in; dict_T *selfdict = selfdict_in; typval_T argv[MAX_FUNC_ARGS + 1]; /* used when "partial" is not NULL */ int argv_clear = 0; /* Make a copy of the name, if it comes from a funcref variable it could * be changed or deleted in the called function. */ name = vim_strnsave(funcname, len); if (name == NULL) return ret; fname = fname_trans_sid(name, fname_buf, &tofree, &error); *doesrange = FALSE; if (partial != NULL) { if (partial->pt_dict != NULL) { /* When the function has a partial with a dict and there is a dict * argument, use the dict argument. That is backwards compatible. */ if (selfdict_in == NULL) selfdict = partial->pt_dict; } if (error == ERROR_NONE && partial->pt_argc > 0) { for (argv_clear = 0; argv_clear < partial->pt_argc; ++argv_clear) copy_tv(&partial->pt_argv[argv_clear], &argv[argv_clear]); for (i = 0; i < argcount_in; ++i) argv[i + argv_clear] = argvars_in[i]; argvars = argv; argcount = partial->pt_argc + argcount_in; } } /* execute the function if no errors detected and executing */ if (evaluate && error == ERROR_NONE) { char_u *rfname = fname; /* Ignore "g:" before a function name. */ if (fname[0] == 'g' && fname[1] == ':') rfname = fname + 2; rettv->v_type = VAR_NUMBER; /* default rettv is number zero */ rettv->vval.v_number = 0; error = ERROR_UNKNOWN; if (!builtin_function(rfname, -1)) { /* * User defined function. */ fp = find_func(rfname); #ifdef FEAT_AUTOCMD /* Trigger FuncUndefined event, may load the function. */ if (fp == NULL && apply_autocmds(EVENT_FUNCUNDEFINED, rfname, rfname, TRUE, NULL) && !aborting()) { /* executed an autocommand, search for the function again */ fp = find_func(rfname); } #endif /* Try loading a package. */ if (fp == NULL && script_autoload(rfname, TRUE) && !aborting()) { /* loaded a package, search for the function again */ fp = find_func(rfname); } if (fp != NULL) { if (fp->uf_flags & FC_RANGE) *doesrange = TRUE; if (argcount < fp->uf_args.ga_len) error = ERROR_TOOFEW; else if (!fp->uf_varargs && argcount > fp->uf_args.ga_len) error = ERROR_TOOMANY; else if ((fp->uf_flags & FC_DICT) && selfdict == NULL) error = ERROR_DICT; else { int did_save_redo = FALSE; /* * Call the user function. * Save and restore search patterns, script variables and * redo buffer. */ save_search_patterns(); #ifdef FEAT_INS_EXPAND if (!ins_compl_active()) #endif { saveRedobuff(); did_save_redo = TRUE; } ++fp->uf_calls; call_user_func(fp, argcount, argvars, rettv, firstline, lastline, (fp->uf_flags & FC_DICT) ? selfdict : NULL); if (--fp->uf_calls <= 0 && isdigit(*fp->uf_name) && fp->uf_refcount <= 0) /* Function was unreferenced while being used, free it * now. */ func_free(fp); if (did_save_redo) 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].v_type = VAR_UNKNOWN; functions[i].f_func(argvars, rettv); 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 (!aborting()) { switch (error) { case ERROR_UNKNOWN: emsg_funcname(N_("E117: Unknown function: %s"), name); break; case ERROR_TOOMANY: emsg_funcname(e_toomanyarg, name); break; case ERROR_TOOFEW: emsg_funcname(N_("E119: Not enough arguments for function: %s"), name); break; case ERROR_SCRIPT: emsg_funcname(N_("E120: Using not in a script context: %s"), name); break; case ERROR_DICT: emsg_funcname(N_("E725: Calling dict function without Dictionary: %s"), name); break; } } while (argv_clear > 0) clear_tv(&argv[--argv_clear]); vim_free(tofree); vim_free(name); return ret; } /* * Give an error message with a function name. Handle things. * "ermsg" is to be passed without translation, use N_() instead of _(). */ static void emsg_funcname(char *ermsg, char_u *name) { char_u *p; if (*name == K_SPECIAL) p = concat_str((char_u *)"", name + 3); else p = name; EMSG2(_(ermsg), p); if (p != name) vim_free(p); } /* * Return TRUE for a non-zero Number and a non-empty String. */ static int non_zero_arg(typval_T *argvars) { return ((argvars[0].v_type == VAR_NUMBER && argvars[0].vval.v_number != 0) || (argvars[0].v_type == VAR_STRING && argvars[0].vval.v_string != NULL && *argvars[0].vval.v_string != NUL)); } /********************************************* * Implementation of the built-in functions */ #ifdef FEAT_FLOAT static int get_float_arg(typval_T *argvars, float_T *f); /* * Get the float value of "argvars[0]" into "f". * Returns FAIL when the argument is not a Number or Float. */ static int get_float_arg(typval_T *argvars, float_T *f) { if (argvars[0].v_type == VAR_FLOAT) { *f = argvars[0].vval.v_float; return OK; } if (argvars[0].v_type == VAR_NUMBER) { *f = (float_T)argvars[0].vval.v_number; return OK; } EMSG(_("E808: Number or Float required")); return FAIL; } /* * "abs(expr)" function */ static void f_abs(typval_T *argvars, typval_T *rettv) { if (argvars[0].v_type == VAR_FLOAT) { rettv->v_type = VAR_FLOAT; rettv->vval.v_float = fabs(argvars[0].vval.v_float); } else { varnumber_T n; int error = FALSE; n = get_tv_number_chk(&argvars[0], &error); if (error) rettv->vval.v_number = -1; else if (n > 0) rettv->vval.v_number = n; else rettv->vval.v_number = -n; } } /* * "acos()" function */ static void f_acos(typval_T *argvars, typval_T *rettv) { float_T f = 0.0; rettv->v_type = VAR_FLOAT; if (get_float_arg(argvars, &f) == OK) rettv->vval.v_float = acos(f); else rettv->vval.v_float = 0.0; } #endif /* * "add(list, item)" function */ static void f_add(typval_T *argvars, typval_T *rettv) { list_T *l; rettv->vval.v_number = 1; /* Default: Failed */ if (argvars[0].v_type == VAR_LIST) { if ((l = argvars[0].vval.v_list) != NULL && !tv_check_lock(l->lv_lock, (char_u *)N_("add() argument"), TRUE) && list_append_tv(l, &argvars[1]) == OK) copy_tv(&argvars[0], rettv); } else EMSG(_(e_listreq)); } /* * "alloc_fail(id, countdown, repeat)" function */ static void f_alloc_fail(typval_T *argvars, typval_T *rettv UNUSED) { if (argvars[0].v_type != VAR_NUMBER || argvars[0].vval.v_number <= 0 || argvars[1].v_type != VAR_NUMBER || argvars[1].vval.v_number < 0 || argvars[2].v_type != VAR_NUMBER) EMSG(_(e_invarg)); else { alloc_fail_id = argvars[0].vval.v_number; if (alloc_fail_id >= aid_last) EMSG(_(e_invarg)); alloc_fail_countdown = argvars[1].vval.v_number; alloc_fail_repeat = argvars[2].vval.v_number; did_outofmem_msg = FALSE; } } /* * "and(expr, expr)" function */ static void f_and(typval_T *argvars, typval_T *rettv) { rettv->vval.v_number = get_tv_number_chk(&argvars[0], NULL) & get_tv_number_chk(&argvars[1], NULL); } /* * "append(lnum, string/list)" function */ static void f_append(typval_T *argvars, typval_T *rettv) { long lnum; char_u *line; list_T *l = NULL; listitem_T *li = NULL; typval_T *tv; long added = 0; /* When coming here from Insert mode, sync undo, so that this can be * undone separately from what was previously inserted. */ if (u_sync_once == 2) { u_sync_once = 1; /* notify that u_sync() was called */ u_sync(TRUE); } lnum = get_tv_lnum(argvars); if (lnum >= 0 && lnum <= curbuf->b_ml.ml_line_count && u_save(lnum, lnum + 1) == OK) { if (argvars[1].v_type == VAR_LIST) { l = argvars[1].vval.v_list; if (l == NULL) return; li = l->lv_first; } for (;;) { if (l == NULL) tv = &argvars[1]; /* append a string */ else if (li == NULL) break; /* end of list */ else tv = &li->li_tv; /* append item from list */ line = get_tv_string_chk(tv); if (line == NULL) /* type error */ { rettv->vval.v_number = 1; /* Failed */ break; } ml_append(lnum + added, line, (colnr_T)0, FALSE); ++added; if (l == NULL) break; li = li->li_next; } appended_lines_mark(lnum, added); if (curwin->w_cursor.lnum > lnum) curwin->w_cursor.lnum += added; } else rettv->vval.v_number = 1; /* Failed */ } /* * "argc()" function */ static void f_argc(typval_T *argvars UNUSED, typval_T *rettv) { rettv->vval.v_number = ARGCOUNT; } /* * "argidx()" function */ static void f_argidx(typval_T *argvars UNUSED, typval_T *rettv) { rettv->vval.v_number = curwin->w_arg_idx; } /* * "arglistid()" function */ static void f_arglistid(typval_T *argvars, typval_T *rettv) { win_T *wp; rettv->vval.v_number = -1; wp = find_tabwin(&argvars[0], &argvars[1]); if (wp != NULL) rettv->vval.v_number = wp->w_alist->id; } /* * "argv(nr)" function */ static void f_argv(typval_T *argvars, typval_T *rettv) { int idx; if (argvars[0].v_type != VAR_UNKNOWN) { idx = get_tv_number_chk(&argvars[0], NULL); if (idx >= 0 && idx < ARGCOUNT) rettv->vval.v_string = vim_strsave(alist_name(&ARGLIST[idx])); else rettv->vval.v_string = NULL; rettv->v_type = VAR_STRING; } else if (rettv_list_alloc(rettv) == OK) for (idx = 0; idx < ARGCOUNT; ++idx) list_append_string(rettv->vval.v_list, alist_name(&ARGLIST[idx]), -1); } static void prepare_assert_error(garray_T*gap); static void fill_assert_error(garray_T *gap, typval_T *opt_msg_tv, char_u *exp_str, typval_T *exp_tv, typval_T *got_tv, int is_match); static void assert_error(garray_T *gap); static void assert_bool(typval_T *argvars, int isTrue); /* * Prepare "gap" for an assert error and add the sourcing position. */ static void prepare_assert_error(garray_T *gap) { char buf[NUMBUFLEN]; ga_init2(gap, 1, 100); if (sourcing_name != NULL) { ga_concat(gap, sourcing_name); if (sourcing_lnum > 0) ga_concat(gap, (char_u *)" "); } if (sourcing_lnum > 0) { sprintf(buf, "line %ld", (long)sourcing_lnum); ga_concat(gap, (char_u *)buf); } if (sourcing_name != NULL || sourcing_lnum > 0) ga_concat(gap, (char_u *)": "); } /* * Append "str" to "gap", escaping unprintable characters. * Changes NL to \n, CR to \r, etc. */ static void ga_concat_esc(garray_T *gap, char_u *str) { char_u *p; char_u buf[NUMBUFLEN]; if (str == NULL) { ga_concat(gap, (char_u *)"NULL"); return; } for (p = str; *p != NUL; ++p) switch (*p) { case BS: ga_concat(gap, (char_u *)"\\b"); break; case ESC: ga_concat(gap, (char_u *)"\\e"); break; case FF: ga_concat(gap, (char_u *)"\\f"); break; case NL: ga_concat(gap, (char_u *)"\\n"); break; case TAB: ga_concat(gap, (char_u *)"\\t"); break; case CAR: ga_concat(gap, (char_u *)"\\r"); break; case '\\': ga_concat(gap, (char_u *)"\\\\"); break; default: if (*p < ' ') { vim_snprintf((char *)buf, NUMBUFLEN, "\\x%02x", *p); ga_concat(gap, buf); } else ga_append(gap, *p); break; } } /* * Fill "gap" with information about an assert error. */ static void fill_assert_error( garray_T *gap, typval_T *opt_msg_tv, char_u *exp_str, typval_T *exp_tv, typval_T *got_tv, int is_match) { char_u numbuf[NUMBUFLEN]; char_u *tofree; if (opt_msg_tv->v_type != VAR_UNKNOWN) { ga_concat(gap, tv2string(opt_msg_tv, &tofree, numbuf, 0)); vim_free(tofree); } else { if (is_match) ga_concat(gap, (char_u *)"Pattern "); else ga_concat(gap, (char_u *)"Expected "); if (exp_str == NULL) { ga_concat_esc(gap, tv2string(exp_tv, &tofree, numbuf, 0)); vim_free(tofree); } else ga_concat_esc(gap, exp_str); if (is_match) ga_concat(gap, (char_u *)" does not match "); else ga_concat(gap, (char_u *)" but got "); ga_concat_esc(gap, tv2string(got_tv, &tofree, numbuf, 0)); vim_free(tofree); } } /* * Add an assert error to v:errors. */ static void assert_error(garray_T *gap) { struct vimvar *vp = &vimvars[VV_ERRORS]; if (vp->vv_type != VAR_LIST || vimvars[VV_ERRORS].vv_list == NULL) /* Make sure v:errors is a list. */ set_vim_var_list(VV_ERRORS, list_alloc()); list_append_string(vimvars[VV_ERRORS].vv_list, gap->ga_data, gap->ga_len); } /* * "assert_equal(expected, actual[, msg])" function */ static void f_assert_equal(typval_T *argvars, typval_T *rettv UNUSED) { garray_T ga; if (!tv_equal(&argvars[0], &argvars[1], FALSE, FALSE)) { prepare_assert_error(&ga); fill_assert_error(&ga, &argvars[2], NULL, &argvars[0], &argvars[1], FALSE); assert_error(&ga); ga_clear(&ga); } } /* * "assert_exception(string[, msg])" function */ static void f_assert_exception(typval_T *argvars, typval_T *rettv UNUSED) { garray_T ga; char *error; error = (char *)get_tv_string_chk(&argvars[0]); if (vimvars[VV_EXCEPTION].vv_str == NULL) { prepare_assert_error(&ga); ga_concat(&ga, (char_u *)"v:exception is not set"); assert_error(&ga); ga_clear(&ga); } else if (error != NULL && strstr((char *)vimvars[VV_EXCEPTION].vv_str, error) == NULL) { prepare_assert_error(&ga); fill_assert_error(&ga, &argvars[1], NULL, &argvars[0], &vimvars[VV_EXCEPTION].vv_tv, FALSE); assert_error(&ga); ga_clear(&ga); } } /* * "assert_fails(cmd [, error])" function */ static void f_assert_fails(typval_T *argvars, typval_T *rettv UNUSED) { char_u *cmd = get_tv_string_chk(&argvars[0]); garray_T ga; called_emsg = FALSE; suppress_errthrow = TRUE; emsg_silent = TRUE; do_cmdline_cmd(cmd); if (!called_emsg) { prepare_assert_error(&ga); ga_concat(&ga, (char_u *)"command did not fail: "); ga_concat(&ga, cmd); assert_error(&ga); ga_clear(&ga); } else if (argvars[1].v_type != VAR_UNKNOWN) { char_u buf[NUMBUFLEN]; char *error = (char *)get_tv_string_buf_chk(&argvars[1], buf); if (error == NULL || strstr((char *)vimvars[VV_ERRMSG].vv_str, error) == NULL) { prepare_assert_error(&ga); fill_assert_error(&ga, &argvars[2], NULL, &argvars[1], &vimvars[VV_ERRMSG].vv_tv, FALSE); assert_error(&ga); ga_clear(&ga); } } called_emsg = FALSE; suppress_errthrow = FALSE; emsg_silent = FALSE; emsg_on_display = FALSE; set_vim_var_string(VV_ERRMSG, NULL, 0); } /* * Common for assert_true() and assert_false(). */ static void assert_bool(typval_T *argvars, int isTrue) { int error = FALSE; garray_T ga; if (argvars[0].v_type == VAR_SPECIAL && argvars[0].vval.v_number == (isTrue ? VVAL_TRUE : VVAL_FALSE)) return; if (argvars[0].v_type != VAR_NUMBER || (get_tv_number_chk(&argvars[0], &error) == 0) == isTrue || error) { prepare_assert_error(&ga); fill_assert_error(&ga, &argvars[1], (char_u *)(isTrue ? "True" : "False"), NULL, &argvars[0], FALSE); assert_error(&ga); ga_clear(&ga); } } /* * "assert_false(actual[, msg])" function */ static void f_assert_false(typval_T *argvars, typval_T *rettv UNUSED) { assert_bool(argvars, FALSE); } /* * "assert_match(pattern, actual[, msg])" function */ static void f_assert_match(typval_T *argvars, typval_T *rettv UNUSED) { garray_T ga; char_u buf1[NUMBUFLEN]; char_u buf2[NUMBUFLEN]; char_u *pat = get_tv_string_buf_chk(&argvars[0], buf1); char_u *text = get_tv_string_buf_chk(&argvars[1], buf2); if (pat == NULL || text == NULL) EMSG(_(e_invarg)); else if (!pattern_match(pat, text, FALSE)) { prepare_assert_error(&ga); fill_assert_error(&ga, &argvars[2], NULL, &argvars[0], &argvars[1], TRUE); assert_error(&ga); ga_clear(&ga); } } /* * "assert_true(actual[, msg])" function */ static void f_assert_true(typval_T *argvars, typval_T *rettv UNUSED) { assert_bool(argvars, TRUE); } #ifdef FEAT_FLOAT /* * "asin()" function */ static void f_asin(typval_T *argvars, typval_T *rettv) { float_T f = 0.0; rettv->v_type = VAR_FLOAT; if (get_float_arg(argvars, &f) == OK) rettv->vval.v_float = asin(f); else rettv->vval.v_float = 0.0; } /* * "atan()" function */ static void f_atan(typval_T *argvars, typval_T *rettv) { float_T f = 0.0; rettv->v_type = VAR_FLOAT; if (get_float_arg(argvars, &f) == OK) rettv->vval.v_float = atan(f); else rettv->vval.v_float = 0.0; } /* * "atan2()" function */ static void f_atan2(typval_T *argvars, typval_T *rettv) { float_T fx = 0.0, fy = 0.0; rettv->v_type = VAR_FLOAT; if (get_float_arg(argvars, &fx) == OK && get_float_arg(&argvars[1], &fy) == OK) rettv->vval.v_float = atan2(fx, fy); else rettv->vval.v_float = 0.0; } #endif /* * "browse(save, title, initdir, default)" function */ static void f_browse(typval_T *argvars UNUSED, typval_T *rettv) { #ifdef FEAT_BROWSE int save; char_u *title; char_u *initdir; char_u *defname; char_u buf[NUMBUFLEN]; char_u buf2[NUMBUFLEN]; int error = FALSE; save = get_tv_number_chk(&argvars[0], &error); title = get_tv_string_chk(&argvars[1]); initdir = get_tv_string_buf_chk(&argvars[2], buf); defname = get_tv_string_buf_chk(&argvars[3], buf2); if (error || title == NULL || initdir == NULL || defname == NULL) rettv->vval.v_string = NULL; else rettv->vval.v_string = do_browse(save ? BROWSE_SAVE : 0, title, defname, NULL, initdir, NULL, curbuf); #else rettv->vval.v_string = NULL; #endif rettv->v_type = VAR_STRING; } /* * "browsedir(title, initdir)" function */ static void f_browsedir(typval_T *argvars UNUSED, typval_T *rettv) { #ifdef FEAT_BROWSE char_u *title; char_u *initdir; char_u buf[NUMBUFLEN]; title = get_tv_string_chk(&argvars[0]); initdir = get_tv_string_buf_chk(&argvars[1], buf); if (title == NULL || initdir == NULL) rettv->vval.v_string = NULL; else rettv->vval.v_string = do_browse(BROWSE_DIR, title, NULL, NULL, initdir, NULL, curbuf); #else rettv->vval.v_string = NULL; #endif rettv->v_type = VAR_STRING; } static buf_T *find_buffer(typval_T *avar); /* * Find a buffer by number or exact name. */ static buf_T * find_buffer(typval_T *avar) { buf_T *buf = NULL; if (avar->v_type == VAR_NUMBER) buf = buflist_findnr((int)avar->vval.v_number); else if (avar->v_type == VAR_STRING && avar->vval.v_string != NULL) { buf = buflist_findname_exp(avar->vval.v_string); if (buf == NULL) { /* No full path name match, try a match with a URL or a "nofile" * buffer, these don't use the full path. */ for (buf = firstbuf; buf != NULL; buf = buf->b_next) if (buf->b_fname != NULL && (path_with_url(buf->b_fname) #ifdef FEAT_QUICKFIX || bt_nofile(buf) #endif ) && STRCMP(buf->b_fname, avar->vval.v_string) == 0) break; } } return buf; } /* * "bufexists(expr)" function */ static void f_bufexists(typval_T *argvars, typval_T *rettv) { rettv->vval.v_number = (find_buffer(&argvars[0]) != NULL); } /* * "buflisted(expr)" function */ static void f_buflisted(typval_T *argvars, typval_T *rettv) { buf_T *buf; buf = find_buffer(&argvars[0]); rettv->vval.v_number = (buf != NULL && buf->b_p_bl); } /* * "bufloaded(expr)" function */ static void f_bufloaded(typval_T *argvars, typval_T *rettv) { buf_T *buf; buf = find_buffer(&argvars[0]); rettv->vval.v_number = (buf != NULL && buf->b_ml.ml_mfp != NULL); } buf_T * buflist_find_by_name(char_u *name, int curtab_only) { int save_magic; char_u *save_cpo; buf_T *buf; /* 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, curtab_only)); p_magic = save_magic; p_cpo = save_cpo; return buf; } /* * Get buffer by number or pattern. */ static buf_T * get_buf_tv(typval_T *tv, int curtab_only) { char_u *name = tv->vval.v_string; buf_T *buf; if (tv->v_type == VAR_NUMBER) return buflist_findnr((int)tv->vval.v_number); if (tv->v_type != VAR_STRING) return NULL; if (name == NULL || *name == NUL) return curbuf; if (name[0] == '$' && name[1] == NUL) return lastbuf; buf = buflist_find_by_name(name, curtab_only); /* If not found, try expanding the name, like done for bufexists(). */ if (buf == NULL) buf = find_buffer(tv); return buf; } /* * "bufname(expr)" function */ static void f_bufname(typval_T *argvars, typval_T *rettv) { buf_T *buf; (void)get_tv_number(&argvars[0]); /* issue errmsg if type error */ ++emsg_off; buf = get_buf_tv(&argvars[0], FALSE); rettv->v_type = VAR_STRING; if (buf != NULL && buf->b_fname != NULL) rettv->vval.v_string = vim_strsave(buf->b_fname); else rettv->vval.v_string = NULL; --emsg_off; } /* * "bufnr(expr)" function */ static void f_bufnr(typval_T *argvars, typval_T *rettv) { buf_T *buf; int error = FALSE; char_u *name; (void)get_tv_number(&argvars[0]); /* issue errmsg if type error */ ++emsg_off; buf = get_buf_tv(&argvars[0], FALSE); --emsg_off; /* If the buffer isn't found and the second argument is not zero create a * new buffer. */ if (buf == NULL && argvars[1].v_type != VAR_UNKNOWN && get_tv_number_chk(&argvars[1], &error) != 0 && !error && (name = get_tv_string_chk(&argvars[0])) != NULL && !error) buf = buflist_new(name, NULL, (linenr_T)1, 0); if (buf != NULL) rettv->vval.v_number = buf->b_fnum; else rettv->vval.v_number = -1; } /* * "bufwinnr(nr)" function */ static void f_bufwinnr(typval_T *argvars, typval_T *rettv) { #ifdef FEAT_WINDOWS win_T *wp; int winnr = 0; #endif buf_T *buf; (void)get_tv_number(&argvars[0]); /* issue errmsg if type error */ ++emsg_off; buf = get_buf_tv(&argvars[0], TRUE); #ifdef FEAT_WINDOWS for (wp = firstwin; wp; wp = wp->w_next) { ++winnr; if (wp->w_buffer == buf) break; } rettv->vval.v_number = (wp != NULL ? winnr : -1); #else rettv->vval.v_number = (curwin->w_buffer == buf ? 1 : -1); #endif --emsg_off; } /* * "byte2line(byte)" function */ static void f_byte2line(typval_T *argvars UNUSED, typval_T *rettv) { #ifndef FEAT_BYTEOFF rettv->vval.v_number = -1; #else long boff = 0; boff = get_tv_number(&argvars[0]) - 1; /* boff gets -1 on type error */ if (boff < 0) rettv->vval.v_number = -1; else rettv->vval.v_number = ml_find_line_or_offset(curbuf, (linenr_T)0, &boff); #endif } static void byteidx(typval_T *argvars, typval_T *rettv, int comp UNUSED) { #ifdef FEAT_MBYTE char_u *t; #endif char_u *str; long idx; str = get_tv_string_chk(&argvars[0]); idx = get_tv_number_chk(&argvars[1], NULL); rettv->vval.v_number = -1; if (str == NULL || idx < 0) return; #ifdef FEAT_MBYTE t = str; for ( ; idx > 0; idx--) { if (*t == NUL) /* EOL reached */ return; if (enc_utf8 && comp) t += utf_ptr2len(t); else t += (*mb_ptr2len)(t); } rettv->vval.v_number = (varnumber_T)(t - str); #else if ((size_t)idx <= STRLEN(str)) rettv->vval.v_number = idx; #endif } /* * "byteidx()" function */ static void f_byteidx(typval_T *argvars, typval_T *rettv) { byteidx(argvars, rettv, FALSE); } /* * "byteidxcomp()" function */ static void f_byteidxcomp(typval_T *argvars, typval_T *rettv) { byteidx(argvars, rettv, TRUE); } int func_call( char_u *name, typval_T *args, partial_T *partial, dict_T *selfdict, typval_T *rettv) { listitem_T *item; typval_T argv[MAX_FUNC_ARGS + 1]; int argc = 0; int dummy; int r = 0; for (item = args->vval.v_list->lv_first; item != NULL; item = item->li_next) { if (argc == MAX_FUNC_ARGS - (partial == NULL ? 0 : partial->pt_argc)) { EMSG(_("E699: Too many arguments")); break; } /* Make a copy of each argument. This is needed to be able to set * v_lock to VAR_FIXED in the copy without changing the original list. */ copy_tv(&item->li_tv, &argv[argc++]); } if (item == NULL) r = call_func(name, (int)STRLEN(name), rettv, argc, argv, curwin->w_cursor.lnum, curwin->w_cursor.lnum, &dummy, TRUE, partial, selfdict); /* Free the arguments. */ while (argc > 0) clear_tv(&argv[--argc]); return r; } /* * "call(func, arglist [, dict])" function */ static void f_call(typval_T *argvars, typval_T *rettv) { char_u *func; partial_T *partial = NULL; dict_T *selfdict = NULL; if (argvars[1].v_type != VAR_LIST) { EMSG(_(e_listreq)); return; } if (argvars[1].vval.v_list == NULL) return; if (argvars[0].v_type == VAR_FUNC) func = argvars[0].vval.v_string; else if (argvars[0].v_type == VAR_PARTIAL) { partial = argvars[0].vval.v_partial; func = partial->pt_name; } else func = get_tv_string(&argvars[0]); if (*func == NUL) return; /* type error or empty name */ if (argvars[2].v_type != VAR_UNKNOWN) { if (argvars[2].v_type != VAR_DICT) { EMSG(_(e_dictreq)); return; } selfdict = argvars[2].vval.v_dict; } (void)func_call(func, &argvars[1], partial, selfdict, rettv); } #ifdef FEAT_FLOAT /* * "ceil({float})" function */ static void f_ceil(typval_T *argvars, typval_T *rettv) { float_T f = 0.0; rettv->v_type = VAR_FLOAT; if (get_float_arg(argvars, &f) == OK) rettv->vval.v_float = ceil(f); else rettv->vval.v_float = 0.0; } #endif #ifdef FEAT_JOB_CHANNEL /* * "ch_close()" function */ static void f_ch_close(typval_T *argvars, typval_T *rettv UNUSED) { channel_T *channel = get_channel_arg(&argvars[0], TRUE); if (channel != NULL) { channel_close(channel, FALSE); channel_clear(channel); } } /* * "ch_getbufnr()" function */ static void f_ch_getbufnr(typval_T *argvars, typval_T *rettv) { channel_T *channel = get_channel_arg(&argvars[0], TRUE); rettv->vval.v_number = -1; if (channel != NULL) { char_u *what = get_tv_string(&argvars[1]); int part; if (STRCMP(what, "err") == 0) part = PART_ERR; else if (STRCMP(what, "out") == 0) part = PART_OUT; else if (STRCMP(what, "in") == 0) part = PART_IN; else part = PART_SOCK; if (channel->ch_part[part].ch_buffer != NULL) rettv->vval.v_number = channel->ch_part[part].ch_buffer->b_fnum; } } /* * "ch_getjob()" function */ static void f_ch_getjob(typval_T *argvars, typval_T *rettv) { channel_T *channel = get_channel_arg(&argvars[0], TRUE); if (channel != NULL) { rettv->v_type = VAR_JOB; rettv->vval.v_job = channel->ch_job; if (channel->ch_job != NULL) ++channel->ch_job->jv_refcount; } } /* * "ch_info()" function */ static void f_ch_info(typval_T *argvars, typval_T *rettv UNUSED) { channel_T *channel = get_channel_arg(&argvars[0], TRUE); if (channel != NULL && rettv_dict_alloc(rettv) != FAIL) channel_info(channel, rettv->vval.v_dict); } /* * "ch_log()" function */ static void f_ch_log(typval_T *argvars, typval_T *rettv UNUSED) { char_u *msg = get_tv_string(&argvars[0]); channel_T *channel = NULL; if (argvars[1].v_type != VAR_UNKNOWN) channel = get_channel_arg(&argvars[1], TRUE); ch_log(channel, (char *)msg); } /* * "ch_logfile()" function */ static void f_ch_logfile(typval_T *argvars, typval_T *rettv UNUSED) { char_u *fname; char_u *opt = (char_u *)""; char_u buf[NUMBUFLEN]; fname = get_tv_string(&argvars[0]); if (argvars[1].v_type == VAR_STRING) opt = get_tv_string_buf(&argvars[1], buf); ch_logfile(fname, opt); } /* * "ch_open()" function */ static void f_ch_open(typval_T *argvars, typval_T *rettv) { rettv->v_type = VAR_CHANNEL; rettv->vval.v_channel = channel_open_func(argvars); } /* * "ch_read()" function */ static void f_ch_read(typval_T *argvars, typval_T *rettv) { common_channel_read(argvars, rettv, FALSE); } /* * "ch_readraw()" function */ static void f_ch_readraw(typval_T *argvars, typval_T *rettv) { common_channel_read(argvars, rettv, TRUE); } /* * "ch_evalexpr()" function */ static void f_ch_evalexpr(typval_T *argvars, typval_T *rettv) { ch_expr_common(argvars, rettv, TRUE); } /* * "ch_sendexpr()" function */ static void f_ch_sendexpr(typval_T *argvars, typval_T *rettv) { ch_expr_common(argvars, rettv, FALSE); } /* * "ch_evalraw()" function */ static void f_ch_evalraw(typval_T *argvars, typval_T *rettv) { ch_raw_common(argvars, rettv, TRUE); } /* * "ch_sendraw()" function */ static void f_ch_sendraw(typval_T *argvars, typval_T *rettv) { ch_raw_common(argvars, rettv, FALSE); } /* * "ch_setoptions()" function */ static void f_ch_setoptions(typval_T *argvars, typval_T *rettv UNUSED) { channel_T *channel; jobopt_T opt; channel = get_channel_arg(&argvars[0], TRUE); if (channel == NULL) return; clear_job_options(&opt); if (get_job_options(&argvars[1], &opt, JO_CB_ALL + JO_TIMEOUT_ALL + JO_MODE_ALL) == FAIL) return; channel_set_options(channel, &opt); } /* * "ch_status()" function */ static void f_ch_status(typval_T *argvars, typval_T *rettv) { channel_T *channel; /* return an empty string by default */ rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; channel = get_channel_arg(&argvars[0], FALSE); rettv->vval.v_string = vim_strsave((char_u *)channel_status(channel)); } #endif /* * "changenr()" function */ static void f_changenr(typval_T *argvars UNUSED, typval_T *rettv) { rettv->vval.v_number = curbuf->b_u_seq_cur; } /* * "char2nr(string)" function */ static void f_char2nr(typval_T *argvars, typval_T *rettv) { #ifdef FEAT_MBYTE if (has_mbyte) { int utf8 = 0; if (argvars[1].v_type != VAR_UNKNOWN) utf8 = get_tv_number_chk(&argvars[1], NULL); if (utf8) rettv->vval.v_number = (*utf_ptr2char)(get_tv_string(&argvars[0])); else rettv->vval.v_number = (*mb_ptr2char)(get_tv_string(&argvars[0])); } else #endif rettv->vval.v_number = get_tv_string(&argvars[0])[0]; } /* * "cindent(lnum)" function */ static void f_cindent(typval_T *argvars UNUSED, typval_T *rettv) { #ifdef FEAT_CINDENT pos_T pos; linenr_T lnum; pos = curwin->w_cursor; lnum = get_tv_lnum(argvars); if (lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count) { curwin->w_cursor.lnum = lnum; rettv->vval.v_number = get_c_indent(); curwin->w_cursor = pos; } else #endif rettv->vval.v_number = -1; } /* * "clearmatches()" function */ static void f_clearmatches(typval_T *argvars UNUSED, typval_T *rettv UNUSED) { #ifdef FEAT_SEARCH_EXTRA clear_matches(curwin); #endif } /* * "col(string)" function */ static void f_col(typval_T *argvars, typval_T *rettv) { colnr_T col = 0; pos_T *fp; int fnum = curbuf->b_fnum; fp = var2fpos(&argvars[0], FALSE, &fnum); if (fp != NULL && fnum == curbuf->b_fnum) { if (fp->col == MAXCOL) { /* '> can be MAXCOL, get the length of the line then */ if (fp->lnum <= curbuf->b_ml.ml_line_count) col = (colnr_T)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)(p))] == NUL) col += l; # else if (*p != NUL && p[1] == NUL) ++col; # endif } } #endif } } rettv->vval.v_number = col; } #if defined(FEAT_INS_EXPAND) /* * "complete()" function */ static void f_complete(typval_T *argvars, typval_T *rettv UNUSED) { int startcol; if ((State & INSERT) == 0) { EMSG(_("E785: complete() can only be used in Insert mode")); return; } /* Check for undo allowed here, because if something was already inserted * the line was already saved for undo and this check isn't done. */ if (!undo_allowed()) return; if (argvars[1].v_type != VAR_LIST || argvars[1].vval.v_list == NULL) { EMSG(_(e_invarg)); return; } startcol = get_tv_number_chk(&argvars[0], NULL); if (startcol <= 0) return; set_completion(startcol - 1, argvars[1].vval.v_list); } /* * "complete_add()" function */ static void f_complete_add(typval_T *argvars, typval_T *rettv) { rettv->vval.v_number = ins_compl_add_tv(&argvars[0], 0); } /* * "complete_check()" function */ static void f_complete_check(typval_T *argvars UNUSED, typval_T *rettv) { int saved = RedrawingDisabled; RedrawingDisabled = 0; ins_compl_check_keys(0); rettv->vval.v_number = compl_interrupted; RedrawingDisabled = saved; } #endif /* * "confirm(message, buttons[, default [, type]])" function */ static void f_confirm(typval_T *argvars UNUSED, typval_T *rettv UNUSED) { #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; char_u *typestr; int error = FALSE; message = get_tv_string_chk(&argvars[0]); if (message == NULL) error = TRUE; if (argvars[1].v_type != VAR_UNKNOWN) { buttons = get_tv_string_buf_chk(&argvars[1], buf); if (buttons == NULL) error = TRUE; if (argvars[2].v_type != VAR_UNKNOWN) { def = get_tv_number_chk(&argvars[2], &error); if (argvars[3].v_type != VAR_UNKNOWN) { typestr = get_tv_string_buf_chk(&argvars[3], buf2); if (typestr == NULL) error = TRUE; else { switch (TOUPPER_ASC(*typestr)) { 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"); if (!error) rettv->vval.v_number = do_dialog(type, NULL, message, buttons, def, NULL, FALSE); #endif } /* * "copy()" function */ static void f_copy(typval_T *argvars, typval_T *rettv) { item_copy(&argvars[0], rettv, FALSE, 0); } #ifdef FEAT_FLOAT /* * "cos()" function */ static void f_cos(typval_T *argvars, typval_T *rettv) { float_T f = 0.0; rettv->v_type = VAR_FLOAT; if (get_float_arg(argvars, &f) == OK) rettv->vval.v_float = cos(f); else rettv->vval.v_float = 0.0; } /* * "cosh()" function */ static void f_cosh(typval_T *argvars, typval_T *rettv) { float_T f = 0.0; rettv->v_type = VAR_FLOAT; if (get_float_arg(argvars, &f) == OK) rettv->vval.v_float = cosh(f); else rettv->vval.v_float = 0.0; } #endif /* * "count()" function */ static void f_count(typval_T *argvars, typval_T *rettv) { long n = 0; int ic = FALSE; if (argvars[0].v_type == VAR_LIST) { listitem_T *li; list_T *l; long idx; if ((l = argvars[0].vval.v_list) != NULL) { li = l->lv_first; if (argvars[2].v_type != VAR_UNKNOWN) { int error = FALSE; ic = get_tv_number_chk(&argvars[2], &error); if (argvars[3].v_type != VAR_UNKNOWN) { idx = get_tv_number_chk(&argvars[3], &error); if (!error) { li = list_find(l, idx); if (li == NULL) EMSGN(_(e_listidx), idx); } } if (error) li = NULL; } for ( ; li != NULL; li = li->li_next) if (tv_equal(&li->li_tv, &argvars[1], ic, FALSE)) ++n; } } else if (argvars[0].v_type == VAR_DICT) { int todo; dict_T *d; hashitem_T *hi; if ((d = argvars[0].vval.v_dict) != NULL) { int error = FALSE; if (argvars[2].v_type != VAR_UNKNOWN) { ic = get_tv_number_chk(&argvars[2], &error); if (argvars[3].v_type != VAR_UNKNOWN) EMSG(_(e_invarg)); } todo = error ? 0 : (int)d->dv_hashtab.ht_used; for (hi = d->dv_hashtab.ht_array; todo > 0; ++hi) { if (!HASHITEM_EMPTY(hi)) { --todo; if (tv_equal(&HI2DI(hi)->di_tv, &argvars[1], ic, FALSE)) ++n; } } } } else EMSG2(_(e_listdictarg), "count()"); rettv->vval.v_number = n; } /* * "cscope_connection([{num} , {dbpath} [, {prepend}]])" function * * Checks the existence of a cscope connection. */ static void f_cscope_connection(typval_T *argvars UNUSED, typval_T *rettv UNUSED) { #ifdef FEAT_CSCOPE int num = 0; char_u *dbpath = NULL; char_u *prepend = NULL; char_u buf[NUMBUFLEN]; if (argvars[0].v_type != VAR_UNKNOWN && argvars[1].v_type != VAR_UNKNOWN) { num = (int)get_tv_number(&argvars[0]); dbpath = get_tv_string(&argvars[1]); if (argvars[2].v_type != VAR_UNKNOWN) prepend = get_tv_string_buf(&argvars[2], buf); } rettv->vval.v_number = cs_connection(num, dbpath, prepend); #endif } /* * "cursor(lnum, col)" function, or * "cursor(list)" * * Moves the cursor to the specified line and column. * Returns 0 when the position could be set, -1 otherwise. */ static void f_cursor(typval_T *argvars, typval_T *rettv) { long line, col; #ifdef FEAT_VIRTUALEDIT long coladd = 0; #endif int set_curswant = TRUE; rettv->vval.v_number = -1; if (argvars[1].v_type == VAR_UNKNOWN) { pos_T pos; colnr_T curswant = -1; if (list2fpos(argvars, &pos, NULL, &curswant) == FAIL) { EMSG(_(e_invarg)); return; } line = pos.lnum; col = pos.col; #ifdef FEAT_VIRTUALEDIT coladd = pos.coladd; #endif if (curswant >= 0) { curwin->w_curswant = curswant - 1; set_curswant = FALSE; } } else { line = get_tv_lnum(argvars); col = get_tv_number_chk(&argvars[1], NULL); #ifdef FEAT_VIRTUALEDIT if (argvars[2].v_type != VAR_UNKNOWN) coladd = get_tv_number_chk(&argvars[2], NULL); #endif } if (line < 0 || col < 0 #ifdef FEAT_VIRTUALEDIT || coladd < 0 #endif ) return; /* type error; errmsg already given */ if (line > 0) curwin->w_cursor.lnum = line; if (col > 0) curwin->w_cursor.col = col - 1; #ifdef FEAT_VIRTUALEDIT curwin->w_cursor.coladd = coladd; #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 curwin->w_set_curswant = set_curswant; rettv->vval.v_number = 0; } /* * "deepcopy()" function */ static void f_deepcopy(typval_T *argvars, typval_T *rettv) { int noref = 0; if (argvars[1].v_type != VAR_UNKNOWN) noref = get_tv_number_chk(&argvars[1], NULL); if (noref < 0 || noref > 1) EMSG(_(e_invarg)); else { current_copyID += COPYID_INC; item_copy(&argvars[0], rettv, TRUE, noref == 0 ? current_copyID : 0); } } /* * "delete()" function */ static void f_delete(typval_T *argvars, typval_T *rettv) { char_u nbuf[NUMBUFLEN]; char_u *name; char_u *flags; rettv->vval.v_number = -1; if (check_restricted() || check_secure()) return; name = get_tv_string(&argvars[0]); if (name == NULL || *name == NUL) { EMSG(_(e_invarg)); return; } if (argvars[1].v_type != VAR_UNKNOWN) flags = get_tv_string_buf(&argvars[1], nbuf); else flags = (char_u *)""; if (*flags == NUL) /* delete a file */ rettv->vval.v_number = mch_remove(name) == 0 ? 0 : -1; else if (STRCMP(flags, "d") == 0) /* delete an empty directory */ rettv->vval.v_number = mch_rmdir(name) == 0 ? 0 : -1; else if (STRCMP(flags, "rf") == 0) /* delete a directory recursively */ rettv->vval.v_number = delete_recursive(name); else EMSG2(_(e_invexpr2), flags); } /* * "did_filetype()" function */ static void f_did_filetype(typval_T *argvars UNUSED, typval_T *rettv UNUSED) { #ifdef FEAT_AUTOCMD rettv->vval.v_number = did_filetype; #endif } /* * "diff_filler()" function */ static void f_diff_filler(typval_T *argvars UNUSED, typval_T *rettv UNUSED) { #ifdef FEAT_DIFF rettv->vval.v_number = diff_check_fill(curwin, get_tv_lnum(argvars)); #endif } /* * "diff_hlID()" function */ static void f_diff_hlID(typval_T *argvars UNUSED, typval_T *rettv UNUSED) { #ifdef FEAT_DIFF linenr_T lnum = get_tv_lnum(argvars); static linenr_T prev_lnum = 0; static int changedtick = 0; static int fnum = 0; static int change_start = 0; static int change_end = 0; static hlf_T hlID = (hlf_T)0; int filler_lines; int col; if (lnum < 0) /* ignore type error in {lnum} arg */ lnum = 0; if (lnum != prev_lnum || changedtick != curbuf->b_changedtick || fnum != curbuf->b_fnum) { /* New line, buffer, change: need to get the values. */ filler_lines = diff_check(curwin, lnum); if (filler_lines < 0) { if (filler_lines == -1) { change_start = MAXCOL; change_end = -1; if (diff_find_change(curwin, lnum, &change_start, &change_end)) hlID = HLF_ADD; /* added line */ else hlID = HLF_CHD; /* changed line */ } else hlID = HLF_ADD; /* added line */ } else hlID = (hlf_T)0; prev_lnum = lnum; changedtick = curbuf->b_changedtick; fnum = curbuf->b_fnum; } if (hlID == HLF_CHD || hlID == HLF_TXD) { col = get_tv_number(&argvars[1]) - 1; /* ignore type error in {col} */ if (col >= change_start && col <= change_end) hlID = HLF_TXD; /* changed text */ else hlID = HLF_CHD; /* changed line */ } rettv->vval.v_number = hlID == (hlf_T)0 ? 0 : (int)hlID; #endif } /* * "disable_char_avail_for_testing({expr})" function */ static void f_disable_char_avail_for_testing(typval_T *argvars, typval_T *rettv UNUSED) { disable_char_avail_for_testing = get_tv_number(&argvars[0]); } /* * "empty({expr})" function */ static void f_empty(typval_T *argvars, typval_T *rettv) { int n = FALSE; switch (argvars[0].v_type) { case VAR_STRING: case VAR_FUNC: n = argvars[0].vval.v_string == NULL || *argvars[0].vval.v_string == NUL; break; case VAR_PARTIAL: n = FALSE; break; case VAR_NUMBER: n = argvars[0].vval.v_number == 0; break; case VAR_FLOAT: #ifdef FEAT_FLOAT n = argvars[0].vval.v_float == 0.0; break; #endif case VAR_LIST: n = argvars[0].vval.v_list == NULL || argvars[0].vval.v_list->lv_first == NULL; break; case VAR_DICT: n = argvars[0].vval.v_dict == NULL || argvars[0].vval.v_dict->dv_hashtab.ht_used == 0; break; case VAR_SPECIAL: n = argvars[0].vval.v_number != VVAL_TRUE; break; case VAR_JOB: #ifdef FEAT_JOB_CHANNEL n = argvars[0].vval.v_job == NULL || argvars[0].vval.v_job->jv_status != JOB_STARTED; break; #endif case VAR_CHANNEL: #ifdef FEAT_JOB_CHANNEL n = argvars[0].vval.v_channel == NULL || !channel_is_open(argvars[0].vval.v_channel); break; #endif case VAR_UNKNOWN: EMSG2(_(e_intern2), "f_empty(UNKNOWN)"); n = TRUE; break; } rettv->vval.v_number = n; } /* * "escape({string}, {chars})" function */ static void f_escape(typval_T *argvars, typval_T *rettv) { char_u buf[NUMBUFLEN]; rettv->vval.v_string = vim_strsave_escaped(get_tv_string(&argvars[0]), get_tv_string_buf(&argvars[1], buf)); rettv->v_type = VAR_STRING; } /* * "eval()" function */ static void f_eval(typval_T *argvars, typval_T *rettv) { char_u *s, *p; s = get_tv_string_chk(&argvars[0]); if (s != NULL) s = skipwhite(s); p = s; if (s == NULL || eval1(&s, rettv, TRUE) == FAIL) { if (p != NULL && !aborting()) EMSG2(_(e_invexpr2), p); need_clr_eos = FALSE; rettv->v_type = VAR_NUMBER; rettv->vval.v_number = 0; } else if (*s != NUL) EMSG(_(e_trailing)); } /* * "eventhandler()" function */ static void f_eventhandler(typval_T *argvars UNUSED, typval_T *rettv) { rettv->vval.v_number = vgetc_busy; } /* * "executable()" function */ static void f_executable(typval_T *argvars, typval_T *rettv) { char_u *name = get_tv_string(&argvars[0]); /* Check in $PATH and also check directly if there is a directory name. */ rettv->vval.v_number = mch_can_exe(name, NULL, TRUE) || (gettail(name) != name && mch_can_exe(name, NULL, FALSE)); } /* * "exepath()" function */ static void f_exepath(typval_T *argvars, typval_T *rettv) { char_u *p = NULL; (void)mch_can_exe(get_tv_string(&argvars[0]), &p, TRUE); rettv->v_type = VAR_STRING; rettv->vval.v_string = p; } /* * "exists()" function */ static void f_exists(typval_T *argvars, typval_T *rettv) { char_u *p; char_u *name; int n = FALSE; int len = 0; p = get_tv_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_tv(&p, NULL, TRUE) == OK); if (*skipwhite(p) != NUL) n = FALSE; /* trailing garbage */ } else if (*p == '*') /* internal or user defined function */ { n = function_exists(p + 1); } else if (*p == ':') { n = cmd_exists(p + 1); } else if (*p == '#') { #ifdef FEAT_AUTOCMD if (p[1] == '#') n = autocmd_supported(p + 2); else n = au_exists(p + 1); #endif } else /* internal variable */ { char_u *tofree; typval_T tv; /* get_name_len() takes care of expanding curly braces */ name = p; len = get_name_len(&p, &tofree, TRUE, FALSE); if (len > 0) { if (tofree != NULL) name = tofree; n = (get_var_tv(name, len, &tv, NULL, FALSE, TRUE) == OK); if (n) { /* handle d.key, l[idx], f(expr) */ n = (handle_subscript(&p, &tv, TRUE, FALSE) == OK); if (n) clear_tv(&tv); } } if (*p != NUL) n = FALSE; vim_free(tofree); } rettv->vval.v_number = n; } #ifdef FEAT_FLOAT /* * "exp()" function */ static void f_exp(typval_T *argvars, typval_T *rettv) { float_T f = 0.0; rettv->v_type = VAR_FLOAT; if (get_float_arg(argvars, &f) == OK) rettv->vval.v_float = exp(f); else rettv->vval.v_float = 0.0; } #endif /* * "expand()" function */ static void f_expand(typval_T *argvars, typval_T *rettv) { char_u *s; int len; char_u *errormsg; int options = WILD_SILENT|WILD_USE_NL|WILD_LIST_NOTFOUND; expand_T xpc; int error = FALSE; char_u *result; rettv->v_type = VAR_STRING; if (argvars[1].v_type != VAR_UNKNOWN && argvars[2].v_type != VAR_UNKNOWN && get_tv_number_chk(&argvars[2], &error) && !error) { rettv->v_type = VAR_LIST; rettv->vval.v_list = NULL; } s = get_tv_string(&argvars[0]); if (*s == '%' || *s == '#' || *s == '<') { ++emsg_off; result = eval_vars(s, s, &len, NULL, &errormsg, NULL); --emsg_off; if (rettv->v_type == VAR_LIST) { if (rettv_list_alloc(rettv) != FAIL && result != NULL) list_append_string(rettv->vval.v_list, result, -1); else vim_free(result); } else rettv->vval.v_string = result; } else { /* When the optional second argument is non-zero, don't remove matches * for 'wildignore' and don't put matches for 'suffixes' at the end. */ if (argvars[1].v_type != VAR_UNKNOWN && get_tv_number_chk(&argvars[1], &error)) options |= WILD_KEEP_ALL; if (!error) { ExpandInit(&xpc); xpc.xp_context = EXPAND_FILES; if (p_wic) options += WILD_ICASE; if (rettv->v_type == VAR_STRING) rettv->vval.v_string = ExpandOne(&xpc, s, NULL, options, WILD_ALL); else if (rettv_list_alloc(rettv) != FAIL) { int i; ExpandOne(&xpc, s, NULL, options, WILD_ALL_KEEP); for (i = 0; i < xpc.xp_numfiles; i++) list_append_string(rettv->vval.v_list, xpc.xp_files[i], -1); ExpandCleanup(&xpc); } } else rettv->vval.v_string = NULL; } } /* * Go over all entries in "d2" and add them to "d1". * When "action" is "error" then a duplicate key is an error. * When "action" is "force" then a duplicate key is overwritten. * Otherwise duplicate keys are ignored ("action" is "keep"). */ void dict_extend(dict_T *d1, dict_T *d2, char_u *action) { dictitem_T *di1; hashitem_T *hi2; int todo; char_u *arg_errmsg = (char_u *)N_("extend() argument"); todo = (int)d2->dv_hashtab.ht_used; for (hi2 = d2->dv_hashtab.ht_array; todo > 0; ++hi2) { if (!HASHITEM_EMPTY(hi2)) { --todo; di1 = dict_find(d1, hi2->hi_key, -1); if (d1->dv_scope != 0) { /* Disallow replacing a builtin function in l: and g:. * Check the key to be valid when adding to any * scope. */ if (d1->dv_scope == VAR_DEF_SCOPE && HI2DI(hi2)->di_tv.v_type == VAR_FUNC && var_check_func_name(hi2->hi_key, di1 == NULL)) break; if (!valid_varname(hi2->hi_key)) break; } if (di1 == NULL) { di1 = dictitem_copy(HI2DI(hi2)); if (di1 != NULL && dict_add(d1, di1) == FAIL) dictitem_free(di1); } else if (*action == 'e') { EMSG2(_("E737: Key already exists: %s"), hi2->hi_key); break; } else if (*action == 'f' && HI2DI(hi2) != di1) { if (tv_check_lock(di1->di_tv.v_lock, arg_errmsg, TRUE) || var_check_ro(di1->di_flags, arg_errmsg, TRUE)) break; clear_tv(&di1->di_tv); copy_tv(&HI2DI(hi2)->di_tv, &di1->di_tv); } } } } /* * "extend(list, list [, idx])" function * "extend(dict, dict [, action])" function */ static void f_extend(typval_T *argvars, typval_T *rettv) { char_u *arg_errmsg = (char_u *)N_("extend() argument"); if (argvars[0].v_type == VAR_LIST && argvars[1].v_type == VAR_LIST) { list_T *l1, *l2; listitem_T *item; long before; int error = FALSE; l1 = argvars[0].vval.v_list; l2 = argvars[1].vval.v_list; if (l1 != NULL && !tv_check_lock(l1->lv_lock, arg_errmsg, TRUE) && l2 != NULL) { if (argvars[2].v_type != VAR_UNKNOWN) { before = get_tv_number_chk(&argvars[2], &error); if (error) return; /* type error; errmsg already given */ if (before == l1->lv_len) item = NULL; else { item = list_find(l1, before); if (item == NULL) { EMSGN(_(e_listidx), before); return; } } } else item = NULL; list_extend(l1, l2, item); copy_tv(&argvars[0], rettv); } } else if (argvars[0].v_type == VAR_DICT && argvars[1].v_type == VAR_DICT) { dict_T *d1, *d2; char_u *action; int i; d1 = argvars[0].vval.v_dict; d2 = argvars[1].vval.v_dict; if (d1 != NULL && !tv_check_lock(d1->dv_lock, arg_errmsg, TRUE) && d2 != NULL) { /* Check the third argument. */ if (argvars[2].v_type != VAR_UNKNOWN) { static char *(av[]) = {"keep", "force", "error"}; action = get_tv_string_chk(&argvars[2]); if (action == NULL) return; /* type error; errmsg already given */ for (i = 0; i < 3; ++i) if (STRCMP(action, av[i]) == 0) break; if (i == 3) { EMSG2(_(e_invarg2), action); return; } } else action = (char_u *)"force"; dict_extend(d1, d2, action); copy_tv(&argvars[0], rettv); } } else EMSG2(_(e_listdictarg), "extend()"); } /* * "feedkeys()" function */ static void f_feedkeys(typval_T *argvars, typval_T *rettv UNUSED) { int remap = TRUE; int insert = FALSE; char_u *keys, *flags; char_u nbuf[NUMBUFLEN]; int typed = FALSE; int execute = FALSE; char_u *keys_esc; /* This is not allowed in the sandbox. If the commands would still be * executed in the sandbox it would be OK, but it probably happens later, * when "sandbox" is no longer set. */ if (check_secure()) return; keys = get_tv_string(&argvars[0]); if (argvars[1].v_type != VAR_UNKNOWN) { flags = get_tv_string_buf(&argvars[1], nbuf); for ( ; *flags != NUL; ++flags) { switch (*flags) { case 'n': remap = FALSE; break; case 'm': remap = TRUE; break; case 't': typed = TRUE; break; case 'i': insert = TRUE; break; case 'x': execute = TRUE; break; } } } if (*keys != NUL || execute) { /* Need to escape K_SPECIAL and CSI before putting the string in the * typeahead buffer. */ keys_esc = vim_strsave_escape_csi(keys); if (keys_esc != NULL) { ins_typebuf(keys_esc, (remap ? REMAP_YES : REMAP_NONE), insert ? 0 : typebuf.tb_len, !typed, FALSE); vim_free(keys_esc); if (vgetc_busy) typebuf_was_filled = TRUE; if (execute) { int save_msg_scroll = msg_scroll; /* Avoid a 1 second delay when the keys start Insert mode. */ msg_scroll = FALSE; exec_normal(TRUE); msg_scroll |= save_msg_scroll; } } } } /* * "filereadable()" function */ static void f_filereadable(typval_T *argvars, typval_T *rettv) { int fd; char_u *p; int n; #ifndef O_NONBLOCK # define O_NONBLOCK 0 #endif p = get_tv_string(&argvars[0]); if (*p && !mch_isdir(p) && (fd = mch_open((char *)p, O_RDONLY | O_NONBLOCK, 0)) >= 0) { n = TRUE; close(fd); } else n = FALSE; rettv->vval.v_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(typval_T *argvars, typval_T *rettv) { rettv->vval.v_number = filewritable(get_tv_string(&argvars[0])); } static void findfilendir( typval_T *argvars UNUSED, typval_T *rettv, int find_what UNUSED) { #ifdef FEAT_SEARCHPATH char_u *fname; char_u *fresult = NULL; char_u *path = *curbuf->b_p_path == NUL ? p_path : curbuf->b_p_path; char_u *p; char_u pathbuf[NUMBUFLEN]; int count = 1; int first = TRUE; int error = FALSE; #endif rettv->vval.v_string = NULL; rettv->v_type = VAR_STRING; #ifdef FEAT_SEARCHPATH fname = get_tv_string(&argvars[0]); if (argvars[1].v_type != VAR_UNKNOWN) { p = get_tv_string_buf_chk(&argvars[1], pathbuf); if (p == NULL) error = TRUE; else { if (*p != NUL) path = p; if (argvars[2].v_type != VAR_UNKNOWN) count = get_tv_number_chk(&argvars[2], &error); } } if (count < 0 && rettv_list_alloc(rettv) == FAIL) error = TRUE; if (*fname != NUL && !error) { do { if (rettv->v_type == VAR_STRING || rettv->v_type == VAR_LIST) vim_free(fresult); fresult = find_file_in_path_option(first ? fname : NULL, first ? (int)STRLEN(fname) : 0, 0, first, path, find_what, curbuf->b_ffname, find_what == FINDFILE_DIR ? (char_u *)"" : curbuf->b_p_sua); first = FALSE; if (fresult != NULL && rettv->v_type == VAR_LIST) list_append_string(rettv->vval.v_list, fresult, -1); } while ((rettv->v_type == VAR_LIST || --count > 0) && fresult != NULL); } if (rettv->v_type == VAR_STRING) rettv->vval.v_string = fresult; #endif } static void filter_map(typval_T *argvars, typval_T *rettv, int map); static int filter_map_one(typval_T *tv, char_u *expr, int map, int *remp); /* * Implementation of map() and filter(). */ static void filter_map(typval_T *argvars, typval_T *rettv, int map) { char_u buf[NUMBUFLEN]; char_u *expr; listitem_T *li, *nli; list_T *l = NULL; dictitem_T *di; hashtab_T *ht; hashitem_T *hi; dict_T *d = NULL; typval_T save_val; typval_T save_key; int rem; int todo; char_u *ermsg = (char_u *)(map ? "map()" : "filter()"); char_u *arg_errmsg = (char_u *)(map ? N_("map() argument") : N_("filter() argument")); int save_did_emsg; int idx = 0; if (argvars[0].v_type == VAR_LIST) { if ((l = argvars[0].vval.v_list) == NULL || (!map && tv_check_lock(l->lv_lock, arg_errmsg, TRUE))) return; } else if (argvars[0].v_type == VAR_DICT) { if ((d = argvars[0].vval.v_dict) == NULL || (!map && tv_check_lock(d->dv_lock, arg_errmsg, TRUE))) return; } else { EMSG2(_(e_listdictarg), ermsg); return; } expr = get_tv_string_buf_chk(&argvars[1], buf); /* On type errors, the preceding call has already displayed an error * message. Avoid a misleading error message for an empty string that * was not passed as argument. */ if (expr != NULL) { prepare_vimvar(VV_VAL, &save_val); expr = skipwhite(expr); /* We reset "did_emsg" to be able to detect whether an error * occurred during evaluation of the expression. */ save_did_emsg = did_emsg; did_emsg = FALSE; prepare_vimvar(VV_KEY, &save_key); if (argvars[0].v_type == VAR_DICT) { vimvars[VV_KEY].vv_type = VAR_STRING; ht = &d->dv_hashtab; hash_lock(ht); todo = (int)ht->ht_used; for (hi = ht->ht_array; todo > 0; ++hi) { if (!HASHITEM_EMPTY(hi)) { int r; --todo; di = HI2DI(hi); if (map && (tv_check_lock(di->di_tv.v_lock, arg_errmsg, TRUE) || var_check_ro(di->di_flags, arg_errmsg, TRUE))) break; vimvars[VV_KEY].vv_str = vim_strsave(di->di_key); r = filter_map_one(&di->di_tv, expr, map, &rem); clear_tv(&vimvars[VV_KEY].vv_tv); if (r == FAIL || did_emsg) break; if (!map && rem) { if (var_check_fixed(di->di_flags, arg_errmsg, TRUE) || var_check_ro(di->di_flags, arg_errmsg, TRUE)) break; dictitem_remove(d, di); } } } hash_unlock(ht); } else { vimvars[VV_KEY].vv_type = VAR_NUMBER; for (li = l->lv_first; li != NULL; li = nli) { if (map && tv_check_lock(li->li_tv.v_lock, arg_errmsg, TRUE)) break; nli = li->li_next; vimvars[VV_KEY].vv_nr = idx; if (filter_map_one(&li->li_tv, expr, map, &rem) == FAIL || did_emsg) break; if (!map && rem) listitem_remove(l, li); ++idx; } } restore_vimvar(VV_KEY, &save_key); restore_vimvar(VV_VAL, &save_val); did_emsg |= save_did_emsg; } copy_tv(&argvars[0], rettv); } static int filter_map_one(typval_T *tv, char_u *expr, int map, int *remp) { typval_T rettv; char_u *s; int retval = FAIL; copy_tv(tv, &vimvars[VV_VAL].vv_tv); s = expr; if (eval1(&s, &rettv, TRUE) == FAIL) goto theend; if (*s != NUL) /* check for trailing chars after expr */ { EMSG2(_(e_invexpr2), s); clear_tv(&rettv); goto theend; } if (map) { /* map(): replace the list item value */ clear_tv(tv); rettv.v_lock = 0; *tv = rettv; } else { int error = FALSE; /* filter(): when expr is zero remove the item */ *remp = (get_tv_number_chk(&rettv, &error) == 0); clear_tv(&rettv); /* On type error, nothing has been removed; return FAIL to stop the * loop. The error message was given by get_tv_number_chk(). */ if (error) goto theend; } retval = OK; theend: clear_tv(&vimvars[VV_VAL].vv_tv); return retval; } /* * "filter()" function */ static void f_filter(typval_T *argvars, typval_T *rettv) { filter_map(argvars, rettv, FALSE); } /* * "finddir({fname}[, {path}[, {count}]])" function */ static void f_finddir(typval_T *argvars, typval_T *rettv) { findfilendir(argvars, rettv, FINDFILE_DIR); } /* * "findfile({fname}[, {path}[, {count}]])" function */ static void f_findfile(typval_T *argvars, typval_T *rettv) { findfilendir(argvars, rettv, FINDFILE_FILE); } #ifdef FEAT_FLOAT /* * "float2nr({float})" function */ static void f_float2nr(typval_T *argvars, typval_T *rettv) { float_T f = 0.0; if (get_float_arg(argvars, &f) == OK) { if (f < -0x7fffffff) rettv->vval.v_number = -0x7fffffff; else if (f > 0x7fffffff) rettv->vval.v_number = 0x7fffffff; else rettv->vval.v_number = (varnumber_T)f; } } /* * "floor({float})" function */ static void f_floor(typval_T *argvars, typval_T *rettv) { float_T f = 0.0; rettv->v_type = VAR_FLOAT; if (get_float_arg(argvars, &f) == OK) rettv->vval.v_float = floor(f); else rettv->vval.v_float = 0.0; } /* * "fmod()" function */ static void f_fmod(typval_T *argvars, typval_T *rettv) { float_T fx = 0.0, fy = 0.0; rettv->v_type = VAR_FLOAT; if (get_float_arg(argvars, &fx) == OK && get_float_arg(&argvars[1], &fy) == OK) rettv->vval.v_float = fmod(fx, fy); else rettv->vval.v_float = 0.0; } #endif /* * "fnameescape({string})" function */ static void f_fnameescape(typval_T *argvars, typval_T *rettv) { rettv->vval.v_string = vim_strsave_fnameescape( get_tv_string(&argvars[0]), FALSE); rettv->v_type = VAR_STRING; } /* * "fnamemodify({fname}, {mods})" function */ static void f_fnamemodify(typval_T *argvars, typval_T *rettv) { char_u *fname; char_u *mods; int usedlen = 0; int len; char_u *fbuf = NULL; char_u buf[NUMBUFLEN]; fname = get_tv_string_chk(&argvars[0]); mods = get_tv_string_buf_chk(&argvars[1], buf); if (fname == NULL || mods == NULL) fname = NULL; else { len = (int)STRLEN(fname); (void)modify_fname(mods, &usedlen, &fname, &fbuf, &len); } rettv->v_type = VAR_STRING; if (fname == NULL) rettv->vval.v_string = NULL; else rettv->vval.v_string = vim_strnsave(fname, len); vim_free(fbuf); } static void foldclosed_both(typval_T *argvars, typval_T *rettv, int end); /* * "foldclosed()" function */ static void foldclosed_both( typval_T *argvars UNUSED, typval_T *rettv, int end UNUSED) { #ifdef FEAT_FOLDING linenr_T lnum; linenr_T first, last; lnum = get_tv_lnum(argvars); if (lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count) { if (hasFoldingWin(curwin, lnum, &first, &last, FALSE, NULL)) { if (end) rettv->vval.v_number = (varnumber_T)last; else rettv->vval.v_number = (varnumber_T)first; return; } } #endif rettv->vval.v_number = -1; } /* * "foldclosed()" function */ static void f_foldclosed(typval_T *argvars, typval_T *rettv) { foldclosed_both(argvars, rettv, FALSE); } /* * "foldclosedend()" function */ static void f_foldclosedend(typval_T *argvars, typval_T *rettv) { foldclosed_both(argvars, rettv, TRUE); } /* * "foldlevel()" function */ static void f_foldlevel(typval_T *argvars UNUSED, typval_T *rettv UNUSED) { #ifdef FEAT_FOLDING linenr_T lnum; lnum = get_tv_lnum(argvars); if (lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count) rettv->vval.v_number = foldLevel(lnum); #endif } /* * "foldtext()" function */ static void f_foldtext(typval_T *argvars UNUSED, typval_T *rettv) { #ifdef FEAT_FOLDING linenr_T lnum; char_u *s; char_u *r; int len; char *txt; #endif rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; #ifdef FEAT_FOLDING if ((linenr_T)vimvars[VV_FOLDSTART].vv_nr > 0 && (linenr_T)vimvars[VV_FOLDEND].vv_nr <= curbuf->b_ml.ml_line_count && vimvars[VV_FOLDDASHES].vv_str != NULL) { /* Find first non-empty line in the fold. */ lnum = (linenr_T)vimvars[VV_FOLDSTART].vv_nr; while (lnum < (linenr_T)vimvars[VV_FOLDEND].vv_nr) { 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); if (*skipwhite(s) == NUL && lnum + 1 < (linenr_T)vimvars[VV_FOLDEND].vv_nr) { s = skipwhite(ml_get(lnum + 1)); if (*s == '*') s = skipwhite(s + 1); } } txt = _("+-%s%3ld lines: "); r = alloc((unsigned)(STRLEN(txt) + STRLEN(vimvars[VV_FOLDDASHES].vv_str) /* for %s */ + 20 /* for %3ld */ + STRLEN(s))); /* concatenated */ if (r != NULL) { sprintf((char *)r, txt, vimvars[VV_FOLDDASHES].vv_str, (long)((linenr_T)vimvars[VV_FOLDEND].vv_nr - (linenr_T)vimvars[VV_FOLDSTART].vv_nr + 1)); len = (int)STRLEN(r); STRCAT(r, s); /* remove 'foldmarker' and 'commentstring' */ foldtext_cleanup(r + len); rettv->vval.v_string = r; } } #endif } /* * "foldtextresult(lnum)" function */ static void f_foldtextresult(typval_T *argvars UNUSED, typval_T *rettv) { #ifdef FEAT_FOLDING linenr_T lnum; char_u *text; char_u buf[51]; foldinfo_T foldinfo; int fold_count; #endif rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; #ifdef FEAT_FOLDING lnum = get_tv_lnum(argvars); /* treat illegal types and illegal string values for {lnum} the same */ if (lnum < 0) lnum = 0; fold_count = foldedCount(curwin, lnum, &foldinfo); if (fold_count > 0) { text = get_foldtext(curwin, lnum, lnum + fold_count - 1, &foldinfo, buf); if (text == buf) text = vim_strsave(text); rettv->vval.v_string = text; } #endif } /* * "foreground()" function */ static void f_foreground(typval_T *argvars UNUSED, typval_T *rettv UNUSED) { #ifdef FEAT_GUI if (gui.in_use) gui_mch_set_foreground(); #else # ifdef WIN32 win32_set_foreground(); # endif #endif } /* * "function()" function */ static void f_function(typval_T *argvars, typval_T *rettv) { char_u *s; char_u *name; int use_string = FALSE; partial_T *arg_pt = NULL; if (argvars[0].v_type == VAR_FUNC) { /* function(MyFunc, [arg], dict) */ s = argvars[0].vval.v_string; } else if (argvars[0].v_type == VAR_PARTIAL && argvars[0].vval.v_partial != NULL) { /* function(dict.MyFunc, [arg]) */ arg_pt = argvars[0].vval.v_partial; s = arg_pt->pt_name; } else { /* function('MyFunc', [arg], dict) */ s = get_tv_string(&argvars[0]); use_string = TRUE; } if (s == NULL || *s == NUL || (use_string && VIM_ISDIGIT(*s))) EMSG2(_(e_invarg2), s); /* Don't check an autoload name for existence here. */ else if (use_string && vim_strchr(s, AUTOLOAD_CHAR) == NULL && !function_exists(s)) EMSG2(_("E700: Unknown function: %s"), s); else { int dict_idx = 0; int arg_idx = 0; list_T *list = NULL; if (STRNCMP(s, "s:", 2) == 0 || STRNCMP(s, "", 5) == 0) { char sid_buf[25]; int off = *s == 's' ? 2 : 5; /* Expand s: and into nr_, so that the function can * also be called from another script. Using trans_function_name() * would also work, but some plugins depend on the name being * printable text. */ sprintf(sid_buf, "%ld_", (long)current_SID); name = alloc((int)(STRLEN(sid_buf) + STRLEN(s + off) + 1)); if (name != NULL) { STRCPY(name, sid_buf); STRCAT(name, s + off); } } else name = vim_strsave(s); if (argvars[1].v_type != VAR_UNKNOWN) { if (argvars[2].v_type != VAR_UNKNOWN) { /* function(name, [args], dict) */ arg_idx = 1; dict_idx = 2; } else if (argvars[1].v_type == VAR_DICT) /* function(name, dict) */ dict_idx = 1; else /* function(name, [args]) */ arg_idx = 1; if (dict_idx > 0) { if (argvars[dict_idx].v_type != VAR_DICT) { EMSG(_("E922: expected a dict")); vim_free(name); return; } if (argvars[dict_idx].vval.v_dict == NULL) dict_idx = 0; } if (arg_idx > 0) { if (argvars[arg_idx].v_type != VAR_LIST) { EMSG(_("E923: Second argument of function() must be a list or a dict")); vim_free(name); return; } list = argvars[arg_idx].vval.v_list; if (list == NULL || list->lv_len == 0) arg_idx = 0; } } if (dict_idx > 0 || arg_idx > 0 || arg_pt != NULL) { partial_T *pt = (partial_T *)alloc_clear(sizeof(partial_T)); /* result is a VAR_PARTIAL */ if (pt == NULL) vim_free(name); else { if (arg_idx > 0 || (arg_pt != NULL && arg_pt->pt_argc > 0)) { listitem_T *li; int i = 0; int arg_len = 0; int lv_len = 0; if (arg_pt != NULL) arg_len = arg_pt->pt_argc; if (list != NULL) lv_len = list->lv_len; pt->pt_argc = arg_len + lv_len; pt->pt_argv = (typval_T *)alloc( sizeof(typval_T) * pt->pt_argc); if (pt->pt_argv == NULL) { vim_free(pt); vim_free(name); return; } else { for (i = 0; i < arg_len; i++) copy_tv(&arg_pt->pt_argv[i], &pt->pt_argv[i]); if (lv_len > 0) for (li = list->lv_first; li != NULL; li = li->li_next) copy_tv(&li->li_tv, &pt->pt_argv[i++]); } } /* For "function(dict.func, [], dict)" and "func" is a partial * use "dict". That is backwards compatible. */ if (dict_idx > 0) { pt->pt_dict = argvars[dict_idx].vval.v_dict; ++pt->pt_dict->dv_refcount; } else if (arg_pt != NULL) { pt->pt_dict = arg_pt->pt_dict; if (pt->pt_dict != NULL) ++pt->pt_dict->dv_refcount; } pt->pt_refcount = 1; pt->pt_name = name; func_ref(pt->pt_name); } rettv->v_type = VAR_PARTIAL; rettv->vval.v_partial = pt; } else { /* result is a VAR_FUNC */ rettv->v_type = VAR_FUNC; rettv->vval.v_string = name; func_ref(name); } } } /* * "garbagecollect()" function */ static void f_garbagecollect(typval_T *argvars, typval_T *rettv UNUSED) { /* This is postponed until we are back at the toplevel, because we may be * using Lists and Dicts internally. E.g.: ":echo [garbagecollect()]". */ want_garbage_collect = TRUE; if (argvars[0].v_type != VAR_UNKNOWN && get_tv_number(&argvars[0]) == 1) garbage_collect_at_exit = TRUE; } /* * "get()" function */ static void f_get(typval_T *argvars, typval_T *rettv) { listitem_T *li; list_T *l; dictitem_T *di; dict_T *d; typval_T *tv = NULL; if (argvars[0].v_type == VAR_LIST) { if ((l = argvars[0].vval.v_list) != NULL) { int error = FALSE; li = list_find(l, get_tv_number_chk(&argvars[1], &error)); if (!error && li != NULL) tv = &li->li_tv; } } else if (argvars[0].v_type == VAR_DICT) { if ((d = argvars[0].vval.v_dict) != NULL) { di = dict_find(d, get_tv_string(&argvars[1]), -1); if (di != NULL) tv = &di->di_tv; } } else EMSG2(_(e_listdictarg), "get()"); if (tv == NULL) { if (argvars[2].v_type != VAR_UNKNOWN) copy_tv(&argvars[2], rettv); } else copy_tv(tv, rettv); } static void get_buffer_lines(buf_T *buf, linenr_T start, linenr_T end, int retlist, typval_T *rettv); /* * Get line or list of lines from buffer "buf" into "rettv". * Return a range (from start to end) of lines in rettv from the specified * buffer. * If 'retlist' is TRUE, then the lines are returned as a Vim List. */ static void get_buffer_lines( buf_T *buf, linenr_T start, linenr_T end, int retlist, typval_T *rettv) { char_u *p; rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; if (retlist && rettv_list_alloc(rettv) == FAIL) return; if (buf == NULL || buf->b_ml.ml_mfp == NULL || start < 0) return; if (!retlist) { if (start >= 1 && start <= buf->b_ml.ml_line_count) p = ml_get_buf(buf, start, FALSE); else p = (char_u *)""; rettv->vval.v_string = vim_strsave(p); } else { if (end < start) return; if (start < 1) start = 1; if (end > buf->b_ml.ml_line_count) end = buf->b_ml.ml_line_count; while (start <= end) if (list_append_string(rettv->vval.v_list, ml_get_buf(buf, start++, FALSE), -1) == FAIL) break; } } /* * "getbufline()" function */ static void f_getbufline(typval_T *argvars, typval_T *rettv) { linenr_T lnum; linenr_T end; buf_T *buf; (void)get_tv_number(&argvars[0]); /* issue errmsg if type error */ ++emsg_off; buf = get_buf_tv(&argvars[0], FALSE); --emsg_off; lnum = get_tv_lnum_buf(&argvars[1], buf); if (argvars[2].v_type == VAR_UNKNOWN) end = lnum; else end = get_tv_lnum_buf(&argvars[2], buf); get_buffer_lines(buf, lnum, end, TRUE, rettv); } /* * "getbufvar()" function */ static void f_getbufvar(typval_T *argvars, typval_T *rettv) { buf_T *buf; buf_T *save_curbuf; char_u *varname; dictitem_T *v; int done = FALSE; (void)get_tv_number(&argvars[0]); /* issue errmsg if type error */ varname = get_tv_string_chk(&argvars[1]); ++emsg_off; buf = get_buf_tv(&argvars[0], FALSE); rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; if (buf != NULL && varname != NULL) { /* set curbuf to be our buf, temporarily */ save_curbuf = curbuf; curbuf = buf; if (*varname == '&') /* buffer-local-option */ { if (get_option_tv(&varname, rettv, TRUE) == OK) done = TRUE; } else if (STRCMP(varname, "changedtick") == 0) { rettv->v_type = VAR_NUMBER; rettv->vval.v_number = curbuf->b_changedtick; done = TRUE; } else { /* Look up the variable. */ /* Let getbufvar({nr}, "") return the "b:" dictionary. */ v = find_var_in_ht(&curbuf->b_vars->dv_hashtab, 'b', varname, FALSE); if (v != NULL) { copy_tv(&v->di_tv, rettv); done = TRUE; } } /* restore previous notion of curbuf */ curbuf = save_curbuf; } if (!done && argvars[2].v_type != VAR_UNKNOWN) /* use the default value */ copy_tv(&argvars[2], rettv); --emsg_off; } /* * "getchar()" function */ static void f_getchar(typval_T *argvars, typval_T *rettv) { varnumber_T n; int error = FALSE; /* Position the cursor. Needed after a message that ends in a space. */ windgoto(msg_row, msg_col); ++no_mapping; ++allow_keys; for (;;) { if (argvars[0].v_type == VAR_UNKNOWN) /* getchar(): blocking wait. */ n = safe_vgetc(); else if (get_tv_number_chk(&argvars[0], &error) == 1) /* getchar(1): only check if char avail */ n = vpeekc_any(); else if (error || vpeekc_any() == NUL) /* illegal argument or getchar(0) and no char avail: return zero */ n = 0; else /* getchar(0) and char avail: return char */ n = safe_vgetc(); if (n == K_IGNORE) continue; break; } --no_mapping; --allow_keys; vimvars[VV_MOUSE_WIN].vv_nr = 0; vimvars[VV_MOUSE_LNUM].vv_nr = 0; vimvars[VV_MOUSE_COL].vv_nr = 0; rettv->vval.v_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; rettv->v_type = VAR_STRING; rettv->vval.v_string = vim_strsave(temp); #ifdef FEAT_MOUSE if (is_mouse_key(n)) { int row = mouse_row; int col = mouse_col; win_T *win; linenr_T lnum; # ifdef FEAT_WINDOWS win_T *wp; # endif int winnr = 1; if (row >= 0 && col >= 0) { /* Find the window at the mouse coordinates and compute the * text position. */ win = mouse_find_win(&row, &col); (void)mouse_comp_pos(win, &row, &col, &lnum); # ifdef FEAT_WINDOWS for (wp = firstwin; wp != win; wp = wp->w_next) ++winnr; # endif vimvars[VV_MOUSE_WIN].vv_nr = winnr; vimvars[VV_MOUSE_LNUM].vv_nr = lnum; vimvars[VV_MOUSE_COL].vv_nr = col + 1; } } #endif } } /* * "getcharmod()" function */ static void f_getcharmod(typval_T *argvars UNUSED, typval_T *rettv) { rettv->vval.v_number = mod_mask; } /* * "getcharsearch()" function */ static void f_getcharsearch(typval_T *argvars UNUSED, typval_T *rettv) { if (rettv_dict_alloc(rettv) != FAIL) { dict_T *dict = rettv->vval.v_dict; dict_add_nr_str(dict, "char", 0L, last_csearch()); dict_add_nr_str(dict, "forward", last_csearch_forward(), NULL); dict_add_nr_str(dict, "until", last_csearch_until(), NULL); } } /* * "getcmdline()" function */ static void f_getcmdline(typval_T *argvars UNUSED, typval_T *rettv) { rettv->v_type = VAR_STRING; rettv->vval.v_string = get_cmdline_str(); } /* * "getcmdpos()" function */ static void f_getcmdpos(typval_T *argvars UNUSED, typval_T *rettv) { rettv->vval.v_number = get_cmdline_pos() + 1; } /* * "getcmdtype()" function */ static void f_getcmdtype(typval_T *argvars UNUSED, typval_T *rettv) { rettv->v_type = VAR_STRING; rettv->vval.v_string = alloc(2); if (rettv->vval.v_string != NULL) { rettv->vval.v_string[0] = get_cmdline_type(); rettv->vval.v_string[1] = NUL; } } /* * "getcmdwintype()" function */ static void f_getcmdwintype(typval_T *argvars UNUSED, typval_T *rettv) { rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; #ifdef FEAT_CMDWIN rettv->vval.v_string = alloc(2); if (rettv->vval.v_string != NULL) { rettv->vval.v_string[0] = cmdwin_type; rettv->vval.v_string[1] = NUL; } #endif } /* * "getcwd()" function */ static void f_getcwd(typval_T *argvars, typval_T *rettv) { win_T *wp = NULL; char_u *cwd; rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; wp = find_tabwin(&argvars[0], &argvars[1]); if (wp != NULL) { if (wp->w_localdir != NULL) rettv->vval.v_string = vim_strsave(wp->w_localdir); else if(globaldir != NULL) rettv->vval.v_string = vim_strsave(globaldir); else { cwd = alloc(MAXPATHL); if (cwd != NULL) { if (mch_dirname(cwd, MAXPATHL) != FAIL) rettv->vval.v_string = vim_strsave(cwd); vim_free(cwd); } } #ifdef BACKSLASH_IN_FILENAME if (rettv->vval.v_string != NULL) slash_adjust(rettv->vval.v_string); #endif } } /* * "getfontname()" function */ static void f_getfontname(typval_T *argvars UNUSED, typval_T *rettv) { rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; #ifdef FEAT_GUI if (gui.in_use) { GuiFont font; char_u *name = NULL; if (argvars[0].v_type == VAR_UNKNOWN) { /* Get the "Normal" font. Either the name saved by * hl_set_font_name() or from the font ID. */ font = gui.norm_font; name = hl_get_font_name(); } else { name = get_tv_string(&argvars[0]); if (STRCMP(name, "*") == 0) /* don't use font dialog */ return; font = gui_mch_get_font(name, FALSE); if (font == NOFONT) return; /* Invalid font name, return empty string. */ } rettv->vval.v_string = gui_mch_get_fontname(font, name); if (argvars[0].v_type != VAR_UNKNOWN) gui_mch_free_font(font); } #endif } /* * "getfperm({fname})" function */ static void f_getfperm(typval_T *argvars, typval_T *rettv) { char_u *fname; struct stat st; char_u *perm = NULL; char_u flags[] = "rwx"; int i; fname = get_tv_string(&argvars[0]); rettv->v_type = VAR_STRING; if (mch_stat((char *)fname, &st) >= 0) { perm = vim_strsave((char_u *)"---------"); if (perm != NULL) { for (i = 0; i < 9; i++) { if (st.st_mode & (1 << (8 - i))) perm[i] = flags[i % 3]; } } } rettv->vval.v_string = perm; } /* * "getfsize({fname})" function */ static void f_getfsize(typval_T *argvars, typval_T *rettv) { char_u *fname; struct stat st; fname = get_tv_string(&argvars[0]); rettv->v_type = VAR_NUMBER; if (mch_stat((char *)fname, &st) >= 0) { if (mch_isdir(fname)) rettv->vval.v_number = 0; else { rettv->vval.v_number = (varnumber_T)st.st_size; /* non-perfect check for overflow */ if ((off_t)rettv->vval.v_number != (off_t)st.st_size) rettv->vval.v_number = -2; } } else rettv->vval.v_number = -1; } /* * "getftime({fname})" function */ static void f_getftime(typval_T *argvars, typval_T *rettv) { char_u *fname; struct stat st; fname = get_tv_string(&argvars[0]); if (mch_stat((char *)fname, &st) >= 0) rettv->vval.v_number = (varnumber_T)st.st_mtime; else rettv->vval.v_number = -1; } /* * "getftype({fname})" function */ static void f_getftype(typval_T *argvars, typval_T *rettv) { char_u *fname; struct stat st; char_u *type = NULL; char *t; fname = get_tv_string(&argvars[0]); rettv->v_type = VAR_STRING; if (mch_lstat((char *)fname, &st) >= 0) { #ifdef S_ISREG if (S_ISREG(st.st_mode)) t = "file"; else if (S_ISDIR(st.st_mode)) t = "dir"; # ifdef S_ISLNK else if (S_ISLNK(st.st_mode)) t = "link"; # endif # ifdef S_ISBLK else if (S_ISBLK(st.st_mode)) t = "bdev"; # endif # ifdef S_ISCHR else if (S_ISCHR(st.st_mode)) t = "cdev"; # endif # ifdef S_ISFIFO else if (S_ISFIFO(st.st_mode)) t = "fifo"; # endif # ifdef S_ISSOCK else if (S_ISSOCK(st.st_mode)) t = "fifo"; # endif else t = "other"; #else # ifdef S_IFMT switch (st.st_mode & S_IFMT) { case S_IFREG: t = "file"; break; case S_IFDIR: t = "dir"; break; # ifdef S_IFLNK case S_IFLNK: t = "link"; break; # endif # ifdef S_IFBLK case S_IFBLK: t = "bdev"; break; # endif # ifdef S_IFCHR case S_IFCHR: t = "cdev"; break; # endif # ifdef S_IFIFO case S_IFIFO: t = "fifo"; break; # endif # ifdef S_IFSOCK case S_IFSOCK: t = "socket"; break; # endif default: t = "other"; } # else if (mch_isdir(fname)) t = "dir"; else t = "file"; # endif #endif type = vim_strsave((char_u *)t); } rettv->vval.v_string = type; } /* * "getline(lnum, [end])" function */ static void f_getline(typval_T *argvars, typval_T *rettv) { linenr_T lnum; linenr_T end; int retlist; lnum = get_tv_lnum(argvars); if (argvars[1].v_type == VAR_UNKNOWN) { end = 0; retlist = FALSE; } else { end = get_tv_lnum(&argvars[1]); retlist = TRUE; } get_buffer_lines(curbuf, lnum, end, retlist, rettv); } /* * "getmatches()" function */ static void f_getmatches(typval_T *argvars UNUSED, typval_T *rettv UNUSED) { #ifdef FEAT_SEARCH_EXTRA dict_T *dict; matchitem_T *cur = curwin->w_match_head; int i; if (rettv_list_alloc(rettv) == OK) { while (cur != NULL) { dict = dict_alloc(); if (dict == NULL) return; if (cur->match.regprog == NULL) { /* match added with matchaddpos() */ for (i = 0; i < MAXPOSMATCH; ++i) { llpos_T *llpos; char buf[6]; list_T *l; llpos = &cur->pos.pos[i]; if (llpos->lnum == 0) break; l = list_alloc(); if (l == NULL) break; list_append_number(l, (varnumber_T)llpos->lnum); if (llpos->col > 0) { list_append_number(l, (varnumber_T)llpos->col); list_append_number(l, (varnumber_T)llpos->len); } sprintf(buf, "pos%d", i + 1); dict_add_list(dict, buf, l); } } else { dict_add_nr_str(dict, "pattern", 0L, cur->pattern); } dict_add_nr_str(dict, "group", 0L, syn_id2name(cur->hlg_id)); dict_add_nr_str(dict, "priority", (long)cur->priority, NULL); dict_add_nr_str(dict, "id", (long)cur->id, NULL); # ifdef FEAT_CONCEAL if (cur->conceal_char) { char_u buf[MB_MAXBYTES + 1]; buf[(*mb_char2bytes)((int)cur->conceal_char, buf)] = NUL; dict_add_nr_str(dict, "conceal", 0L, (char_u *)&buf); } # endif list_append_dict(rettv->vval.v_list, dict); cur = cur->next; } } #endif } /* * "getpid()" function */ static void f_getpid(typval_T *argvars UNUSED, typval_T *rettv) { rettv->vval.v_number = mch_get_pid(); } static void getpos_both(typval_T *argvars, typval_T *rettv, int getcurpos); /* * "getcurpos()" function */ static void f_getcurpos(typval_T *argvars, typval_T *rettv) { getpos_both(argvars, rettv, TRUE); } /* * "getpos(string)" function */ static void f_getpos(typval_T *argvars, typval_T *rettv) { getpos_both(argvars, rettv, FALSE); } static void getpos_both( typval_T *argvars, typval_T *rettv, int getcurpos) { pos_T *fp; list_T *l; int fnum = -1; if (rettv_list_alloc(rettv) == OK) { l = rettv->vval.v_list; if (getcurpos) fp = &curwin->w_cursor; else fp = var2fpos(&argvars[0], TRUE, &fnum); if (fnum != -1) list_append_number(l, (varnumber_T)fnum); else list_append_number(l, (varnumber_T)0); list_append_number(l, (fp != NULL) ? (varnumber_T)fp->lnum : (varnumber_T)0); list_append_number(l, (fp != NULL) ? (varnumber_T)(fp->col == MAXCOL ? MAXCOL : fp->col + 1) : (varnumber_T)0); list_append_number(l, #ifdef FEAT_VIRTUALEDIT (fp != NULL) ? (varnumber_T)fp->coladd : #endif (varnumber_T)0); if (getcurpos) { update_curswant(); list_append_number(l, curwin->w_curswant == MAXCOL ? (varnumber_T)MAXCOL : (varnumber_T)curwin->w_curswant + 1); } } else rettv->vval.v_number = FALSE; } /* * "getqflist()" and "getloclist()" functions */ static void f_getqflist(typval_T *argvars UNUSED, typval_T *rettv UNUSED) { #ifdef FEAT_QUICKFIX win_T *wp; #endif #ifdef FEAT_QUICKFIX if (rettv_list_alloc(rettv) == OK) { wp = NULL; if (argvars[0].v_type != VAR_UNKNOWN) /* getloclist() */ { wp = find_win_by_nr(&argvars[0], NULL); if (wp == NULL) return; } (void)get_errorlist(wp, rettv->vval.v_list); } #endif } /* * "getreg()" function */ static void f_getreg(typval_T *argvars, typval_T *rettv) { char_u *strregname; int regname; int arg2 = FALSE; int return_list = FALSE; int error = FALSE; if (argvars[0].v_type != VAR_UNKNOWN) { strregname = get_tv_string_chk(&argvars[0]); error = strregname == NULL; if (argvars[1].v_type != VAR_UNKNOWN) { arg2 = get_tv_number_chk(&argvars[1], &error); if (!error && argvars[2].v_type != VAR_UNKNOWN) return_list = get_tv_number_chk(&argvars[2], &error); } } else strregname = vimvars[VV_REG].vv_str; if (error) return; regname = (strregname == NULL ? '"' : *strregname); if (regname == 0) regname = '"'; if (return_list) { rettv->v_type = VAR_LIST; rettv->vval.v_list = (list_T *)get_reg_contents(regname, (arg2 ? GREG_EXPR_SRC : 0) | GREG_LIST); if (rettv->vval.v_list != NULL) ++rettv->vval.v_list->lv_refcount; } else { rettv->v_type = VAR_STRING; rettv->vval.v_string = get_reg_contents(regname, arg2 ? GREG_EXPR_SRC : 0); } } /* * "getregtype()" function */ static void f_getregtype(typval_T *argvars, typval_T *rettv) { char_u *strregname; int regname; char_u buf[NUMBUFLEN + 2]; long reglen = 0; if (argvars[0].v_type != VAR_UNKNOWN) { strregname = get_tv_string_chk(&argvars[0]); if (strregname == NULL) /* type error; errmsg already given */ { rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; return; } } else /* Default to v:register */ strregname = vimvars[VV_REG].vv_str; regname = (strregname == NULL ? '"' : *strregname); if (regname == 0) regname = '"'; buf[0] = NUL; buf[1] = NUL; switch (get_reg_type(regname, ®len)) { case MLINE: buf[0] = 'V'; break; case MCHAR: buf[0] = 'v'; break; case MBLOCK: buf[0] = Ctrl_V; sprintf((char *)buf + 1, "%ld", reglen + 1); break; } rettv->v_type = VAR_STRING; rettv->vval.v_string = vim_strsave(buf); } /* * "gettabvar()" function */ static void f_gettabvar(typval_T *argvars, typval_T *rettv) { win_T *oldcurwin; tabpage_T *tp, *oldtabpage; dictitem_T *v; char_u *varname; int done = FALSE; rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; varname = get_tv_string_chk(&argvars[1]); tp = find_tabpage((int)get_tv_number_chk(&argvars[0], NULL)); if (tp != NULL && varname != NULL) { /* Set tp to be our tabpage, temporarily. Also set the window to the * first window in the tabpage, otherwise the window is not valid. */ if (switch_win(&oldcurwin, &oldtabpage, tp->tp_firstwin == NULL ? firstwin : tp->tp_firstwin, tp, TRUE) == OK) { /* look up the variable */ /* Let gettabvar({nr}, "") return the "t:" dictionary. */ v = find_var_in_ht(&tp->tp_vars->dv_hashtab, 't', varname, FALSE); if (v != NULL) { copy_tv(&v->di_tv, rettv); done = TRUE; } } /* restore previous notion of curwin */ restore_win(oldcurwin, oldtabpage, TRUE); } if (!done && argvars[2].v_type != VAR_UNKNOWN) copy_tv(&argvars[2], rettv); } /* * "gettabwinvar()" function */ static void f_gettabwinvar(typval_T *argvars, typval_T *rettv) { getwinvar(argvars, rettv, 1); } /* * "getwinposx()" function */ static void f_getwinposx(typval_T *argvars UNUSED, typval_T *rettv) { rettv->vval.v_number = -1; #ifdef FEAT_GUI if (gui.in_use) { int x, y; if (gui_mch_get_winpos(&x, &y) == OK) rettv->vval.v_number = x; } #endif } /* * "win_findbuf()" function */ static void f_win_findbuf(typval_T *argvars, typval_T *rettv) { if (rettv_list_alloc(rettv) != FAIL) win_findbuf(argvars, rettv->vval.v_list); } /* * "win_getid()" function */ static void f_win_getid(typval_T *argvars, typval_T *rettv) { rettv->vval.v_number = win_getid(argvars); } /* * "win_gotoid()" function */ static void f_win_gotoid(typval_T *argvars, typval_T *rettv) { rettv->vval.v_number = win_gotoid(argvars); } /* * "win_id2tabwin()" function */ static void f_win_id2tabwin(typval_T *argvars, typval_T *rettv) { if (rettv_list_alloc(rettv) != FAIL) win_id2tabwin(argvars, rettv->vval.v_list); } /* * "win_id2win()" function */ static void f_win_id2win(typval_T *argvars, typval_T *rettv) { rettv->vval.v_number = win_id2win(argvars); } /* * "getwinposy()" function */ static void f_getwinposy(typval_T *argvars UNUSED, typval_T *rettv) { rettv->vval.v_number = -1; #ifdef FEAT_GUI if (gui.in_use) { int x, y; if (gui_mch_get_winpos(&x, &y) == OK) rettv->vval.v_number = y; } #endif } /* * Find window specified by "vp" in tabpage "tp". */ static win_T * find_win_by_nr( typval_T *vp, tabpage_T *tp UNUSED) /* NULL for current tab page */ { #ifdef FEAT_WINDOWS win_T *wp; #endif int nr; nr = get_tv_number_chk(vp, NULL); #ifdef FEAT_WINDOWS if (nr < 0) return NULL; if (nr == 0) return curwin; for (wp = (tp == NULL || tp == curtab) ? firstwin : tp->tp_firstwin; wp != NULL; wp = wp->w_next) if (--nr <= 0) break; return wp; #else if (nr == 0 || nr == 1) return curwin; return NULL; #endif } /* * Find window specified by "wvp" in tabpage "tvp". */ static win_T * find_tabwin( typval_T *wvp, /* VAR_UNKNOWN for current window */ typval_T *tvp) /* VAR_UNKNOWN for current tab page */ { win_T *wp = NULL; tabpage_T *tp = NULL; long n; if (wvp->v_type != VAR_UNKNOWN) { if (tvp->v_type != VAR_UNKNOWN) { n = get_tv_number(tvp); if (n >= 0) tp = find_tabpage(n); } else tp = curtab; if (tp != NULL) wp = find_win_by_nr(wvp, tp); } else wp = curwin; return wp; } /* * "getwinvar()" function */ static void f_getwinvar(typval_T *argvars, typval_T *rettv) { getwinvar(argvars, rettv, 0); } /* * getwinvar() and gettabwinvar() */ static void getwinvar( typval_T *argvars, typval_T *rettv, int off) /* 1 for gettabwinvar() */ { win_T *win; char_u *varname; dictitem_T *v; tabpage_T *tp = NULL; int done = FALSE; #ifdef FEAT_WINDOWS win_T *oldcurwin; tabpage_T *oldtabpage; int need_switch_win; #endif #ifdef FEAT_WINDOWS if (off == 1) tp = find_tabpage((int)get_tv_number_chk(&argvars[0], NULL)); else tp = curtab; #endif win = find_win_by_nr(&argvars[off], tp); varname = get_tv_string_chk(&argvars[off + 1]); ++emsg_off; rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; if (win != NULL && varname != NULL) { #ifdef FEAT_WINDOWS /* Set curwin to be our win, temporarily. Also set the tabpage, * otherwise the window is not valid. Only do this when needed, * autocommands get blocked. */ need_switch_win = !(tp == curtab && win == curwin); if (!need_switch_win || switch_win(&oldcurwin, &oldtabpage, win, tp, TRUE) == OK) #endif { if (*varname == '&') /* window-local-option */ { if (get_option_tv(&varname, rettv, 1) == OK) done = TRUE; } else { /* Look up the variable. */ /* Let getwinvar({nr}, "") return the "w:" dictionary. */ v = find_var_in_ht(&win->w_vars->dv_hashtab, 'w', varname, FALSE); if (v != NULL) { copy_tv(&v->di_tv, rettv); done = TRUE; } } } #ifdef FEAT_WINDOWS if (need_switch_win) /* restore previous notion of curwin */ restore_win(oldcurwin, oldtabpage, TRUE); #endif } if (!done && argvars[off + 2].v_type != VAR_UNKNOWN) /* use the default return value */ copy_tv(&argvars[off + 2], rettv); --emsg_off; } /* * "glob()" function */ static void f_glob(typval_T *argvars, typval_T *rettv) { int options = WILD_SILENT|WILD_USE_NL; expand_T xpc; int error = FALSE; /* When the optional second argument is non-zero, don't remove matches * for 'wildignore' and don't put matches for 'suffixes' at the end. */ rettv->v_type = VAR_STRING; if (argvars[1].v_type != VAR_UNKNOWN) { if (get_tv_number_chk(&argvars[1], &error)) options |= WILD_KEEP_ALL; if (argvars[2].v_type != VAR_UNKNOWN) { if (get_tv_number_chk(&argvars[2], &error)) { rettv->v_type = VAR_LIST; rettv->vval.v_list = NULL; } if (argvars[3].v_type != VAR_UNKNOWN && get_tv_number_chk(&argvars[3], &error)) options |= WILD_ALLLINKS; } } if (!error) { ExpandInit(&xpc); xpc.xp_context = EXPAND_FILES; if (p_wic) options += WILD_ICASE; if (rettv->v_type == VAR_STRING) rettv->vval.v_string = ExpandOne(&xpc, get_tv_string(&argvars[0]), NULL, options, WILD_ALL); else if (rettv_list_alloc(rettv) != FAIL) { int i; ExpandOne(&xpc, get_tv_string(&argvars[0]), NULL, options, WILD_ALL_KEEP); for (i = 0; i < xpc.xp_numfiles; i++) list_append_string(rettv->vval.v_list, xpc.xp_files[i], -1); ExpandCleanup(&xpc); } } else rettv->vval.v_string = NULL; } /* * "globpath()" function */ static void f_globpath(typval_T *argvars, typval_T *rettv) { int flags = 0; char_u buf1[NUMBUFLEN]; char_u *file = get_tv_string_buf_chk(&argvars[1], buf1); int error = FALSE; garray_T ga; int i; /* When the optional second argument is non-zero, don't remove matches * for 'wildignore' and don't put matches for 'suffixes' at the end. */ rettv->v_type = VAR_STRING; if (argvars[2].v_type != VAR_UNKNOWN) { if (get_tv_number_chk(&argvars[2], &error)) flags |= WILD_KEEP_ALL; if (argvars[3].v_type != VAR_UNKNOWN) { if (get_tv_number_chk(&argvars[3], &error)) { rettv->v_type = VAR_LIST; rettv->vval.v_list = NULL; } if (argvars[4].v_type != VAR_UNKNOWN && get_tv_number_chk(&argvars[4], &error)) flags |= WILD_ALLLINKS; } } if (file != NULL && !error) { ga_init2(&ga, (int)sizeof(char_u *), 10); globpath(get_tv_string(&argvars[0]), file, &ga, flags); if (rettv->v_type == VAR_STRING) rettv->vval.v_string = ga_concat_strings(&ga, "\n"); else if (rettv_list_alloc(rettv) != FAIL) for (i = 0; i < ga.ga_len; ++i) list_append_string(rettv->vval.v_list, ((char_u **)(ga.ga_data))[i], -1); ga_clear_strings(&ga); } else rettv->vval.v_string = NULL; } /* * "glob2regpat()" function */ static void f_glob2regpat(typval_T *argvars, typval_T *rettv) { char_u *pat = get_tv_string_chk(&argvars[0]); rettv->v_type = VAR_STRING; rettv->vval.v_string = (pat == NULL) ? NULL : file_pat_to_reg_pat(pat, NULL, NULL, FALSE); } /* * "has()" function */ static void f_has(typval_T *argvars, typval_T *rettv) { 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 MACOS "mac", #endif #if defined(MACOS_X_UNIX) "macunix", /* built with 'darwin' enabled */ #endif #if defined(__APPLE__) && __APPLE__ == 1 "osx", /* built with or without 'darwin' enabled */ #endif #ifdef __QNX__ "qnx", #endif #ifdef UNIX "unix", #endif #ifdef VMS "vms", #endif #ifdef WIN32 "win32", #endif #if defined(UNIX) && (defined(__CYGWIN32__) || defined(__CYGWIN__)) "win32unix", #endif #if defined(WIN64) || defined(_WIN64) "win64", #endif #ifdef EBCDIC "ebcdic", #endif #ifndef CASE_INSENSITIVE_FILENAME "fname_case", #endif #ifdef HAVE_ACL "acl", #endif #ifdef FEAT_ARABIC "arabic", #endif #ifdef FEAT_AUTOCMD "autocmd", #endif #ifdef FEAT_BEVAL "balloon_eval", # ifndef FEAT_GUI_W32 /* other GUIs always have multiline balloons */ "balloon_multiline", # endif #endif #if defined(SOME_BUILTIN_TCAPS) || defined(ALL_BUILTIN_TCAPS) "builtin_terms", # ifdef ALL_BUILTIN_TCAPS "all_builtin_terms", # endif #endif #if defined(FEAT_BROWSE) && (defined(USE_FILE_CHOOSER) \ || defined(FEAT_GUI_W32) \ || defined(FEAT_GUI_MOTIF)) "browsefilter", #endif #ifdef FEAT_BYTEOFF "byte_offset", #endif #ifdef FEAT_JOB_CHANNEL "channel", #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_CONCEAL "conceal", #endif #ifdef FEAT_CRYPT "cryptv", "crypt-blowfish", "crypt-blowfish2", #endif #ifdef FEAT_CSCOPE "cscope", #endif #ifdef FEAT_CURSORBIND "cursorbind", #endif #ifdef CURSOR_SHAPE "cursorshape", #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_DIRECTX "directx", #endif #ifdef FEAT_DND "dnd", #endif #ifdef FEAT_EMACS_TAGS "emacs_tags", #endif "eval", /* always present, of course! */ "ex_extra", /* graduated feature */ #ifdef FEAT_SEARCH_EXTRA "extra_search", #endif #ifdef FEAT_FKMAP "farsi", #endif #ifdef FEAT_SEARCHPATH "file_in_path", #endif #ifdef FEAT_FILTERPIPE "filterpipe", #endif #ifdef FEAT_FIND_ID "find_in_path", #endif #ifdef FEAT_FLOAT "float", #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_GTK "gui_gtk", # ifdef USE_GTK3 "gui_gtk3", # else "gui_gtk2", # endif #endif #ifdef FEAT_GUI_GNOME "gui_gnome", #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_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_JOB_CHANNEL "job", #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_LUA # ifndef DYNAMIC_LUA "lua", # endif #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_SGR "mouse_sgr", # endif # ifdef FEAT_SYSMOUSE "mouse_sysmouse", # endif # ifdef FEAT_MOUSE_URXVT "mouse_urxvt", # 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_MZSCHEME #ifndef DYNAMIC_MZSCHEME "mzscheme", #endif #endif #ifdef FEAT_OLE "ole", #endif "packages", #ifdef FEAT_PATH_EXTRA "path_extra", #endif #ifdef FEAT_PERL #ifndef DYNAMIC_PERL "perl", #endif #endif #ifdef FEAT_PERSISTENT_UNDO "persistent_undo", #endif #ifdef FEAT_PYTHON #ifndef DYNAMIC_PYTHON "python", #endif #endif #ifdef FEAT_PYTHON3 #ifndef DYNAMIC_PYTHON3 "python3", #endif #endif #ifdef FEAT_POSTSCRIPT "postscript", #endif #ifdef FEAT_PRINTER "printer", #endif #ifdef FEAT_PROFILE "profile", #endif #ifdef FEAT_RELTIME "reltime", #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 STARTUPTIME "startuptime", #endif #ifdef FEAT_STL_OPT "statusline", #endif #ifdef FEAT_SUN_WORKSHOP "sun_workshop", #endif #ifdef FEAT_NETBEANS_INTG "netbeans_intg", #endif #ifdef FEAT_SPELL "spell", #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_TIMERS "timers", #endif #ifdef FEAT_TITLE "title", #endif #ifdef FEAT_TOOLBAR "toolbar", #endif #if defined(FEAT_CLIPBOARD) && defined(FEAT_X11) "unnamedplus", #endif #ifdef FEAT_USR_CMDS "user-commands", /* was accidentally included in 5.4 */ "user_commands", #endif #ifdef FEAT_VIMINFO "viminfo", #endif #ifdef FEAT_WINDOWS "vertsplit", #endif #ifdef FEAT_VIRTUALEDIT "virtualedit", #endif "visual", #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 FEAT_XPM_W32 "xpm", "xpm_w32", /* for backward compatibility */ #else # if defined(HAVE_XPM) "xpm", # endif #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_tv_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) { if (name[5] == '-' && STRLEN(name) >= 11 && vim_isdigit(name[6]) && vim_isdigit(name[8]) && vim_isdigit(name[10])) { int major = atoi((char *)name + 6); int minor = atoi((char *)name + 8); /* Expect "patch-9.9.01234". */ n = (major < VIM_VERSION_MAJOR || (major == VIM_VERSION_MAJOR && (minor < VIM_VERSION_MINOR || (minor == VIM_VERSION_MINOR && has_patch(atoi((char *)name + 10)))))); } else n = has_patch(atoi((char *)name + 5)); } else if (STRICMP(name, "vim_starting") == 0) n = (starting != 0); #ifdef FEAT_MBYTE else if (STRICMP(name, "multi_byte_encoding") == 0) n = has_mbyte; #endif #if defined(FEAT_BEVAL) && defined(FEAT_GUI_W32) else if (STRICMP(name, "balloon_multiline") == 0) n = multiline_balloon_available(); #endif #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_LUA else if (STRICMP(name, "lua") == 0) n = lua_enabled(FALSE); #endif #ifdef DYNAMIC_MZSCHEME else if (STRICMP(name, "mzscheme") == 0) n = mzscheme_enabled(FALSE); #endif #ifdef DYNAMIC_RUBY else if (STRICMP(name, "ruby") == 0) n = ruby_enabled(FALSE); #endif #ifdef FEAT_PYTHON #ifdef DYNAMIC_PYTHON else if (STRICMP(name, "python") == 0) n = python_enabled(FALSE); #endif #endif #ifdef FEAT_PYTHON3 #ifdef DYNAMIC_PYTHON3 else if (STRICMP(name, "python3") == 0) n = python3_enabled(FALSE); #endif #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(curwin); #endif #if defined(WIN3264) else if (STRICMP(name, "win95") == 0) n = mch_windows95(); #endif #ifdef FEAT_NETBEANS_INTG else if (STRICMP(name, "netbeans_enabled") == 0) n = netbeans_active(); #endif } rettv->vval.v_number = n; } /* * "has_key()" function */ static void f_has_key(typval_T *argvars, typval_T *rettv) { if (argvars[0].v_type != VAR_DICT) { EMSG(_(e_dictreq)); return; } if (argvars[0].vval.v_dict == NULL) return; rettv->vval.v_number = dict_find(argvars[0].vval.v_dict, get_tv_string(&argvars[1]), -1) != NULL; } /* * "haslocaldir()" function */ static void f_haslocaldir(typval_T *argvars, typval_T *rettv) { win_T *wp = NULL; wp = find_tabwin(&argvars[0], &argvars[1]); rettv->vval.v_number = (wp != NULL && wp->w_localdir != NULL); } /* * "hasmapto()" function */ static void f_hasmapto(typval_T *argvars, typval_T *rettv) { char_u *name; char_u *mode; char_u buf[NUMBUFLEN]; int abbr = FALSE; name = get_tv_string(&argvars[0]); if (argvars[1].v_type == VAR_UNKNOWN) mode = (char_u *)"nvo"; else { mode = get_tv_string_buf(&argvars[1], buf); if (argvars[2].v_type != VAR_UNKNOWN) abbr = get_tv_number(&argvars[2]); } if (map_to_exists(name, mode, abbr)) rettv->vval.v_number = TRUE; else rettv->vval.v_number = FALSE; } /* * "histadd()" function */ static void f_histadd(typval_T *argvars UNUSED, typval_T *rettv) { #ifdef FEAT_CMDHIST int histype; char_u *str; char_u buf[NUMBUFLEN]; #endif rettv->vval.v_number = FALSE; if (check_restricted() || check_secure()) return; #ifdef FEAT_CMDHIST str = get_tv_string_chk(&argvars[0]); /* NULL on type error */ histype = str != NULL ? get_histtype(str) : -1; if (histype >= 0) { str = get_tv_string_buf(&argvars[1], buf); if (*str != NUL) { init_history(); add_to_history(histype, str, FALSE, NUL); rettv->vval.v_number = TRUE; return; } } #endif } /* * "histdel()" function */ static void f_histdel(typval_T *argvars UNUSED, typval_T *rettv UNUSED) { #ifdef FEAT_CMDHIST int n; char_u buf[NUMBUFLEN]; char_u *str; str = get_tv_string_chk(&argvars[0]); /* NULL on type error */ if (str == NULL) n = 0; else if (argvars[1].v_type == VAR_UNKNOWN) /* only one argument: clear entire history */ n = clr_history(get_histtype(str)); else if (argvars[1].v_type == VAR_NUMBER) /* index given: remove that entry */ n = del_history_idx(get_histtype(str), (int)get_tv_number(&argvars[1])); else /* string given: remove all matching entries */ n = del_history_entry(get_histtype(str), get_tv_string_buf(&argvars[1], buf)); rettv->vval.v_number = n; #endif } /* * "histget()" function */ static void f_histget(typval_T *argvars UNUSED, typval_T *rettv) { #ifdef FEAT_CMDHIST int type; int idx; char_u *str; str = get_tv_string_chk(&argvars[0]); /* NULL on type error */ if (str == NULL) rettv->vval.v_string = NULL; else { type = get_histtype(str); if (argvars[1].v_type == VAR_UNKNOWN) idx = get_history_idx(type); else idx = (int)get_tv_number_chk(&argvars[1], NULL); /* -1 on type error */ rettv->vval.v_string = vim_strsave(get_history_entry(type, idx)); } #else rettv->vval.v_string = NULL; #endif rettv->v_type = VAR_STRING; } /* * "histnr()" function */ static void f_histnr(typval_T *argvars UNUSED, typval_T *rettv) { int i; #ifdef FEAT_CMDHIST char_u *history = get_tv_string_chk(&argvars[0]); i = history == NULL ? HIST_CMD - 1 : get_histtype(history); if (i >= HIST_CMD && i < HIST_COUNT) i = get_history_idx(i); else #endif i = -1; rettv->vval.v_number = i; } /* * "highlightID(name)" function */ static void f_hlID(typval_T *argvars, typval_T *rettv) { rettv->vval.v_number = syn_name2id(get_tv_string(&argvars[0])); } /* * "highlight_exists()" function */ static void f_hlexists(typval_T *argvars, typval_T *rettv) { rettv->vval.v_number = highlight_exists(get_tv_string(&argvars[0])); } /* * "hostname()" function */ static void f_hostname(typval_T *argvars UNUSED, typval_T *rettv) { char_u hostname[256]; mch_get_host_name(hostname, 256); rettv->v_type = VAR_STRING; rettv->vval.v_string = vim_strsave(hostname); } /* * iconv() function */ static void f_iconv(typval_T *argvars UNUSED, typval_T *rettv) { #ifdef FEAT_MBYTE char_u buf1[NUMBUFLEN]; char_u buf2[NUMBUFLEN]; char_u *from, *to, *str; vimconv_T vimconv; #endif rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; #ifdef FEAT_MBYTE str = get_tv_string(&argvars[0]); from = enc_canonize(enc_skip(get_tv_string_buf(&argvars[1], buf1))); to = enc_canonize(enc_skip(get_tv_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) rettv->vval.v_string = vim_strsave(str); else rettv->vval.v_string = string_convert(&vimconv, str, NULL); convert_setup(&vimconv, NULL, NULL); vim_free(from); vim_free(to); #endif } /* * "indent()" function */ static void f_indent(typval_T *argvars, typval_T *rettv) { linenr_T lnum; lnum = get_tv_lnum(argvars); if (lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count) rettv->vval.v_number = get_indent_lnum(lnum); else rettv->vval.v_number = -1; } /* * "index()" function */ static void f_index(typval_T *argvars, typval_T *rettv) { list_T *l; listitem_T *item; long idx = 0; int ic = FALSE; rettv->vval.v_number = -1; if (argvars[0].v_type != VAR_LIST) { EMSG(_(e_listreq)); return; } l = argvars[0].vval.v_list; if (l != NULL) { item = l->lv_first; if (argvars[2].v_type != VAR_UNKNOWN) { int error = FALSE; /* Start at specified item. Use the cached index that list_find() * sets, so that a negative number also works. */ item = list_find(l, get_tv_number_chk(&argvars[2], &error)); idx = l->lv_idx; if (argvars[3].v_type != VAR_UNKNOWN) ic = get_tv_number_chk(&argvars[3], &error); if (error) item = NULL; } for ( ; item != NULL; item = item->li_next, ++idx) if (tv_equal(&item->li_tv, &argvars[1], ic, FALSE)) { rettv->vval.v_number = idx; break; } } } static int inputsecret_flag = 0; static void get_user_input(typval_T *argvars, typval_T *rettv, int inputdialog); /* * This function is used by f_input() and f_inputdialog() functions. The third * argument to f_input() specifies the type of completion to use at the * prompt. The third argument to f_inputdialog() specifies the value to return * when the user cancels the prompt. */ static void get_user_input( typval_T *argvars, typval_T *rettv, int inputdialog) { char_u *prompt = get_tv_string_chk(&argvars[0]); char_u *p = NULL; int c; char_u buf[NUMBUFLEN]; int cmd_silent_save = cmd_silent; char_u *defstr = (char_u *)""; int xp_type = EXPAND_NOTHING; char_u *xp_arg = NULL; rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; #ifdef NO_CONSOLE_INPUT /* While starting up, there is no place to enter text. */ if (no_console_input()) 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].v_type != VAR_UNKNOWN) { defstr = get_tv_string_buf_chk(&argvars[1], buf); if (defstr != NULL) stuffReadbuffSpec(defstr); if (!inputdialog && argvars[2].v_type != VAR_UNKNOWN) { char_u *xp_name; int xp_namelen; long argt; /* input() with a third argument: completion */ rettv->vval.v_string = NULL; xp_name = get_tv_string_buf_chk(&argvars[2], buf); if (xp_name == NULL) return; xp_namelen = (int)STRLEN(xp_name); if (parse_compl_arg(xp_name, xp_namelen, &xp_type, &argt, &xp_arg) == FAIL) return; } } if (defstr != NULL) { int save_ex_normal_busy = ex_normal_busy; ex_normal_busy = 0; rettv->vval.v_string = getcmdline_prompt(inputsecret_flag ? NUL : '@', p, echo_attr, xp_type, xp_arg); ex_normal_busy = save_ex_normal_busy; } if (inputdialog && rettv->vval.v_string == NULL && argvars[1].v_type != VAR_UNKNOWN && argvars[2].v_type != VAR_UNKNOWN) rettv->vval.v_string = vim_strsave(get_tv_string_buf( &argvars[2], buf)); vim_free(xp_arg); /* since the user typed this, no need to wait for return */ need_wait_return = FALSE; msg_didout = FALSE; } cmd_silent = cmd_silent_save; } /* * "input()" function * Also handles inputsecret() when inputsecret is set. */ static void f_input(typval_T *argvars, typval_T *rettv) { get_user_input(argvars, rettv, FALSE); } /* * "inputdialog()" function */ static void f_inputdialog(typval_T *argvars, typval_T *rettv) { #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]; char_u *defstr = (char_u *)""; message = get_tv_string_chk(&argvars[0]); if (argvars[1].v_type != VAR_UNKNOWN && (defstr = get_tv_string_buf_chk(&argvars[1], buf)) != NULL) vim_strncpy(IObuff, defstr, IOSIZE - 1); else IObuff[0] = NUL; if (message != NULL && defstr != NULL && do_dialog(VIM_QUESTION, NULL, message, (char_u *)_("&OK\n&Cancel"), 1, IObuff, FALSE) == 1) rettv->vval.v_string = vim_strsave(IObuff); else { if (message != NULL && defstr != NULL && argvars[1].v_type != VAR_UNKNOWN && argvars[2].v_type != VAR_UNKNOWN) rettv->vval.v_string = vim_strsave( get_tv_string_buf(&argvars[2], buf)); else rettv->vval.v_string = NULL; } rettv->v_type = VAR_STRING; } else #endif get_user_input(argvars, rettv, TRUE); } /* * "inputlist()" function */ static void f_inputlist(typval_T *argvars, typval_T *rettv) { listitem_T *li; int selected; int mouse_used; #ifdef NO_CONSOLE_INPUT /* While starting up, there is no place to enter text. */ if (no_console_input()) return; #endif if (argvars[0].v_type != VAR_LIST || argvars[0].vval.v_list == NULL) { EMSG2(_(e_listarg), "inputlist()"); return; } msg_start(); msg_row = Rows - 1; /* for when 'cmdheight' > 1 */ lines_left = Rows; /* avoid more prompt */ msg_scroll = TRUE; msg_clr_eos(); for (li = argvars[0].vval.v_list->lv_first; li != NULL; li = li->li_next) { msg_puts(get_tv_string(&li->li_tv)); msg_putchar('\n'); } /* Ask for choice. */ selected = prompt_for_number(&mouse_used); if (mouse_used) selected -= lines_left; rettv->vval.v_number = selected; } static garray_T ga_userinput = {0, 0, sizeof(tasave_T), 4, NULL}; /* * "inputrestore()" function */ static void f_inputrestore(typval_T *argvars UNUSED, typval_T *rettv) { if (ga_userinput.ga_len > 0) { --ga_userinput.ga_len; restore_typeahead((tasave_T *)(ga_userinput.ga_data) + ga_userinput.ga_len); /* default return is zero == OK */ } else if (p_verbose > 1) { verb_msg((char_u *)_("called inputrestore() more often than inputsave()")); rettv->vval.v_number = 1; /* Failed */ } } /* * "inputsave()" function */ static void f_inputsave(typval_T *argvars UNUSED, typval_T *rettv) { /* Add an entry to the stack of typeahead storage. */ if (ga_grow(&ga_userinput, 1) == OK) { save_typeahead((tasave_T *)(ga_userinput.ga_data) + ga_userinput.ga_len); ++ga_userinput.ga_len; /* default return is zero == OK */ } else rettv->vval.v_number = 1; /* Failed */ } /* * "inputsecret()" function */ static void f_inputsecret(typval_T *argvars, typval_T *rettv) { ++cmdline_star; ++inputsecret_flag; f_input(argvars, rettv); --cmdline_star; --inputsecret_flag; } /* * "insert()" function */ static void f_insert(typval_T *argvars, typval_T *rettv) { long before = 0; listitem_T *item; list_T *l; int error = FALSE; if (argvars[0].v_type != VAR_LIST) EMSG2(_(e_listarg), "insert()"); else if ((l = argvars[0].vval.v_list) != NULL && !tv_check_lock(l->lv_lock, (char_u *)N_("insert() argument"), TRUE)) { if (argvars[2].v_type != VAR_UNKNOWN) before = get_tv_number_chk(&argvars[2], &error); if (error) return; /* type error; errmsg already given */ if (before == l->lv_len) item = NULL; else { item = list_find(l, before); if (item == NULL) { EMSGN(_(e_listidx), before); l = NULL; } } if (l != NULL) { list_insert_tv(l, &argvars[1], item); copy_tv(&argvars[0], rettv); } } } /* * "invert(expr)" function */ static void f_invert(typval_T *argvars, typval_T *rettv) { rettv->vval.v_number = ~get_tv_number_chk(&argvars[0], NULL); } /* * "isdirectory()" function */ static void f_isdirectory(typval_T *argvars, typval_T *rettv) { rettv->vval.v_number = mch_isdir(get_tv_string(&argvars[0])); } /* * "islocked()" function */ static void f_islocked(typval_T *argvars, typval_T *rettv) { lval_T lv; char_u *end; dictitem_T *di; rettv->vval.v_number = -1; end = get_lval(get_tv_string(&argvars[0]), NULL, &lv, FALSE, FALSE, GLV_NO_AUTOLOAD, FNE_CHECK_START); if (end != NULL && lv.ll_name != NULL) { if (*end != NUL) EMSG(_(e_trailing)); else { if (lv.ll_tv == NULL) { if (check_changedtick(lv.ll_name)) rettv->vval.v_number = 1; /* always locked */ else { di = find_var(lv.ll_name, NULL, TRUE); if (di != NULL) { /* Consider a variable locked when: * 1. the variable itself is locked * 2. the value of the variable is locked. * 3. the List or Dict value is locked. */ rettv->vval.v_number = ((di->di_flags & DI_FLAGS_LOCK) || tv_islocked(&di->di_tv)); } } } else if (lv.ll_range) EMSG(_("E786: Range not allowed")); else if (lv.ll_newkey != NULL) EMSG2(_(e_dictkey), lv.ll_newkey); else if (lv.ll_list != NULL) /* List item. */ rettv->vval.v_number = tv_islocked(&lv.ll_li->li_tv); else /* Dictionary item. */ rettv->vval.v_number = tv_islocked(&lv.ll_di->di_tv); } } clear_lval(&lv); } #if defined(FEAT_FLOAT) && defined(HAVE_MATH_H) /* * "isnan()" function */ static void f_isnan(typval_T *argvars, typval_T *rettv) { rettv->vval.v_number = argvars[0].v_type == VAR_FLOAT && isnan(argvars[0].vval.v_float); } #endif static void dict_list(typval_T *argvars, typval_T *rettv, int what); /* * Turn a dict into a list: * "what" == 0: list of keys * "what" == 1: list of values * "what" == 2: list of items */ static void dict_list(typval_T *argvars, typval_T *rettv, int what) { list_T *l2; dictitem_T *di; hashitem_T *hi; listitem_T *li; listitem_T *li2; dict_T *d; int todo; if (argvars[0].v_type != VAR_DICT) { EMSG(_(e_dictreq)); return; } if ((d = argvars[0].vval.v_dict) == NULL) return; if (rettv_list_alloc(rettv) == FAIL) return; todo = (int)d->dv_hashtab.ht_used; for (hi = d->dv_hashtab.ht_array; todo > 0; ++hi) { if (!HASHITEM_EMPTY(hi)) { --todo; di = HI2DI(hi); li = listitem_alloc(); if (li == NULL) break; list_append(rettv->vval.v_list, li); if (what == 0) { /* keys() */ li->li_tv.v_type = VAR_STRING; li->li_tv.v_lock = 0; li->li_tv.vval.v_string = vim_strsave(di->di_key); } else if (what == 1) { /* values() */ copy_tv(&di->di_tv, &li->li_tv); } else { /* items() */ l2 = list_alloc(); li->li_tv.v_type = VAR_LIST; li->li_tv.v_lock = 0; li->li_tv.vval.v_list = l2; if (l2 == NULL) break; ++l2->lv_refcount; li2 = listitem_alloc(); if (li2 == NULL) break; list_append(l2, li2); li2->li_tv.v_type = VAR_STRING; li2->li_tv.v_lock = 0; li2->li_tv.vval.v_string = vim_strsave(di->di_key); li2 = listitem_alloc(); if (li2 == NULL) break; list_append(l2, li2); copy_tv(&di->di_tv, &li2->li_tv); } } } } /* * "items(dict)" function */ static void f_items(typval_T *argvars, typval_T *rettv) { dict_list(argvars, rettv, 2); } #if defined(FEAT_JOB_CHANNEL) || defined(PROTO) /* * Get the job from the argument. * Returns NULL if the job is invalid. */ static job_T * get_job_arg(typval_T *tv) { job_T *job; if (tv->v_type != VAR_JOB) { EMSG2(_(e_invarg2), get_tv_string(tv)); return NULL; } job = tv->vval.v_job; if (job == NULL) EMSG(_("E916: not a valid job")); return job; } /* * "job_getchannel()" function */ static void f_job_getchannel(typval_T *argvars, typval_T *rettv) { job_T *job = get_job_arg(&argvars[0]); if (job != NULL) { rettv->v_type = VAR_CHANNEL; rettv->vval.v_channel = job->jv_channel; if (job->jv_channel != NULL) ++job->jv_channel->ch_refcount; } } /* * "job_info()" function */ static void f_job_info(typval_T *argvars, typval_T *rettv) { job_T *job = get_job_arg(&argvars[0]); if (job != NULL && rettv_dict_alloc(rettv) != FAIL) job_info(job, rettv->vval.v_dict); } /* * "job_setoptions()" function */ static void f_job_setoptions(typval_T *argvars, typval_T *rettv UNUSED) { job_T *job = get_job_arg(&argvars[0]); jobopt_T opt; if (job == NULL) return; clear_job_options(&opt); if (get_job_options(&argvars[1], &opt, JO_STOPONEXIT + JO_EXIT_CB) == FAIL) return; job_set_options(job, &opt); } /* * "job_start()" function */ static void f_job_start(typval_T *argvars, typval_T *rettv) { rettv->v_type = VAR_JOB; rettv->vval.v_job = job_start(argvars); } /* * "job_status()" function */ static void f_job_status(typval_T *argvars, typval_T *rettv) { job_T *job = get_job_arg(&argvars[0]); if (job != NULL) { rettv->v_type = VAR_STRING; rettv->vval.v_string = vim_strsave((char_u *)job_status(job)); } } /* * "job_stop()" function */ static void f_job_stop(typval_T *argvars, typval_T *rettv) { job_T *job = get_job_arg(&argvars[0]); if (job != NULL) rettv->vval.v_number = job_stop(job, argvars); } #endif /* * "join()" function */ static void f_join(typval_T *argvars, typval_T *rettv) { garray_T ga; char_u *sep; if (argvars[0].v_type != VAR_LIST) { EMSG(_(e_listreq)); return; } if (argvars[0].vval.v_list == NULL) return; if (argvars[1].v_type == VAR_UNKNOWN) sep = (char_u *)" "; else sep = get_tv_string_chk(&argvars[1]); rettv->v_type = VAR_STRING; if (sep != NULL) { ga_init2(&ga, (int)sizeof(char), 80); list_join(&ga, argvars[0].vval.v_list, sep, TRUE, 0); ga_append(&ga, NUL); rettv->vval.v_string = (char_u *)ga.ga_data; } else rettv->vval.v_string = NULL; } /* * "js_decode()" function */ static void f_js_decode(typval_T *argvars, typval_T *rettv) { js_read_T reader; reader.js_buf = get_tv_string(&argvars[0]); reader.js_fill = NULL; reader.js_used = 0; if (json_decode_all(&reader, rettv, JSON_JS) != OK) EMSG(_(e_invarg)); } /* * "js_encode()" function */ static void f_js_encode(typval_T *argvars, typval_T *rettv) { rettv->v_type = VAR_STRING; rettv->vval.v_string = json_encode(&argvars[0], JSON_JS); } /* * "json_decode()" function */ static void f_json_decode(typval_T *argvars, typval_T *rettv) { js_read_T reader; reader.js_buf = get_tv_string(&argvars[0]); reader.js_fill = NULL; reader.js_used = 0; if (json_decode_all(&reader, rettv, 0) != OK) EMSG(_(e_invarg)); } /* * "json_encode()" function */ static void f_json_encode(typval_T *argvars, typval_T *rettv) { rettv->v_type = VAR_STRING; rettv->vval.v_string = json_encode(&argvars[0], 0); } /* * "keys()" function */ static void f_keys(typval_T *argvars, typval_T *rettv) { dict_list(argvars, rettv, 0); } /* * "last_buffer_nr()" function. */ static void f_last_buffer_nr(typval_T *argvars UNUSED, typval_T *rettv) { int n = 0; buf_T *buf; for (buf = firstbuf; buf != NULL; buf = buf->b_next) if (n < buf->b_fnum) n = buf->b_fnum; rettv->vval.v_number = n; } /* * "len()" function */ static void f_len(typval_T *argvars, typval_T *rettv) { switch (argvars[0].v_type) { case VAR_STRING: case VAR_NUMBER: rettv->vval.v_number = (varnumber_T)STRLEN( get_tv_string(&argvars[0])); break; case VAR_LIST: rettv->vval.v_number = list_len(argvars[0].vval.v_list); break; case VAR_DICT: rettv->vval.v_number = dict_len(argvars[0].vval.v_dict); break; case VAR_UNKNOWN: case VAR_SPECIAL: case VAR_FLOAT: case VAR_FUNC: case VAR_PARTIAL: case VAR_JOB: case VAR_CHANNEL: EMSG(_("E701: Invalid type for len()")); break; } } static void libcall_common(typval_T *argvars, typval_T *rettv, int type); static void libcall_common(typval_T *argvars, typval_T *rettv, int type) { #ifdef FEAT_LIBCALL char_u *string_in; char_u **string_result; int nr_result; #endif rettv->v_type = type; if (type != VAR_NUMBER) rettv->vval.v_string = NULL; if (check_restricted() || check_secure()) return; #ifdef FEAT_LIBCALL /* The first two args must be strings, otherwise its meaningless */ if (argvars[0].v_type == VAR_STRING && argvars[1].v_type == VAR_STRING) { string_in = NULL; if (argvars[2].v_type == VAR_STRING) string_in = argvars[2].vval.v_string; if (type == VAR_NUMBER) string_result = NULL; else string_result = &rettv->vval.v_string; if (mch_libcall(argvars[0].vval.v_string, argvars[1].vval.v_string, string_in, argvars[2].vval.v_number, string_result, &nr_result) == OK && type == VAR_NUMBER) rettv->vval.v_number = nr_result; } #endif } /* * "libcall()" function */ static void f_libcall(typval_T *argvars, typval_T *rettv) { libcall_common(argvars, rettv, VAR_STRING); } /* * "libcallnr()" function */ static void f_libcallnr(typval_T *argvars, typval_T *rettv) { libcall_common(argvars, rettv, VAR_NUMBER); } /* * "line(string)" function */ static void f_line(typval_T *argvars, typval_T *rettv) { linenr_T lnum = 0; pos_T *fp; int fnum; fp = var2fpos(&argvars[0], TRUE, &fnum); if (fp != NULL) lnum = fp->lnum; rettv->vval.v_number = lnum; } /* * "line2byte(lnum)" function */ static void f_line2byte(typval_T *argvars UNUSED, typval_T *rettv) { #ifndef FEAT_BYTEOFF rettv->vval.v_number = -1; #else linenr_T lnum; lnum = get_tv_lnum(argvars); if (lnum < 1 || lnum > curbuf->b_ml.ml_line_count + 1) rettv->vval.v_number = -1; else rettv->vval.v_number = ml_find_line_or_offset(curbuf, lnum, NULL); if (rettv->vval.v_number >= 0) ++rettv->vval.v_number; #endif } /* * "lispindent(lnum)" function */ static void f_lispindent(typval_T *argvars UNUSED, typval_T *rettv) { #ifdef FEAT_LISP pos_T pos; linenr_T lnum; pos = curwin->w_cursor; lnum = get_tv_lnum(argvars); if (lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count) { curwin->w_cursor.lnum = lnum; rettv->vval.v_number = get_lisp_indent(); curwin->w_cursor = pos; } else #endif rettv->vval.v_number = -1; } /* * "localtime()" function */ static void f_localtime(typval_T *argvars UNUSED, typval_T *rettv) { rettv->vval.v_number = (varnumber_T)time(NULL); } static void get_maparg(typval_T *argvars, typval_T *rettv, int exact); static void get_maparg(typval_T *argvars, typval_T *rettv, int exact) { char_u *keys; char_u *which; char_u buf[NUMBUFLEN]; char_u *keys_buf = NULL; char_u *rhs; int mode; int abbr = FALSE; int get_dict = FALSE; mapblock_T *mp; int buffer_local; /* return empty string for failure */ rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; keys = get_tv_string(&argvars[0]); if (*keys == NUL) return; if (argvars[1].v_type != VAR_UNKNOWN) { which = get_tv_string_buf_chk(&argvars[1], buf); if (argvars[2].v_type != VAR_UNKNOWN) { abbr = get_tv_number(&argvars[2]); if (argvars[3].v_type != VAR_UNKNOWN) get_dict = get_tv_number(&argvars[3]); } } else which = (char_u *)""; if (which == NULL) return; mode = get_map_mode(&which, 0); keys = replace_termcodes(keys, &keys_buf, TRUE, TRUE, FALSE); rhs = check_map(keys, mode, exact, FALSE, abbr, &mp, &buffer_local); vim_free(keys_buf); if (!get_dict) { /* Return a string. */ if (rhs != NULL) rettv->vval.v_string = str2special_save(rhs, FALSE); } else if (rettv_dict_alloc(rettv) != FAIL && rhs != NULL) { /* Return a dictionary. */ char_u *lhs = str2special_save(mp->m_keys, TRUE); char_u *mapmode = map_mode_to_chars(mp->m_mode); dict_T *dict = rettv->vval.v_dict; dict_add_nr_str(dict, "lhs", 0L, lhs); dict_add_nr_str(dict, "rhs", 0L, mp->m_orig_str); dict_add_nr_str(dict, "noremap", mp->m_noremap ? 1L : 0L , NULL); dict_add_nr_str(dict, "expr", mp->m_expr ? 1L : 0L, NULL); dict_add_nr_str(dict, "silent", mp->m_silent ? 1L : 0L, NULL); dict_add_nr_str(dict, "sid", (long)mp->m_script_ID, NULL); dict_add_nr_str(dict, "buffer", (long)buffer_local, NULL); dict_add_nr_str(dict, "nowait", mp->m_nowait ? 1L : 0L, NULL); dict_add_nr_str(dict, "mode", 0L, mapmode); vim_free(lhs); vim_free(mapmode); } } #ifdef FEAT_FLOAT /* * "log()" function */ static void f_log(typval_T *argvars, typval_T *rettv) { float_T f = 0.0; rettv->v_type = VAR_FLOAT; if (get_float_arg(argvars, &f) == OK) rettv->vval.v_float = log(f); else rettv->vval.v_float = 0.0; } /* * "log10()" function */ static void f_log10(typval_T *argvars, typval_T *rettv) { float_T f = 0.0; rettv->v_type = VAR_FLOAT; if (get_float_arg(argvars, &f) == OK) rettv->vval.v_float = log10(f); else rettv->vval.v_float = 0.0; } #endif #ifdef FEAT_LUA /* * "luaeval()" function */ static void f_luaeval(typval_T *argvars, typval_T *rettv) { char_u *str; char_u buf[NUMBUFLEN]; str = get_tv_string_buf(&argvars[0], buf); do_luaeval(str, argvars + 1, rettv); } #endif /* * "map()" function */ static void f_map(typval_T *argvars, typval_T *rettv) { filter_map(argvars, rettv, TRUE); } /* * "maparg()" function */ static void f_maparg(typval_T *argvars, typval_T *rettv) { get_maparg(argvars, rettv, TRUE); } /* * "mapcheck()" function */ static void f_mapcheck(typval_T *argvars, typval_T *rettv) { get_maparg(argvars, rettv, FALSE); } static void find_some_match(typval_T *argvars, typval_T *rettv, int start); static void find_some_match(typval_T *argvars, typval_T *rettv, int type) { char_u *str = NULL; long len = 0; char_u *expr = NULL; char_u *pat; regmatch_T regmatch; char_u patbuf[NUMBUFLEN]; char_u strbuf[NUMBUFLEN]; char_u *save_cpo; long start = 0; long nth = 1; colnr_T startcol = 0; int match = 0; list_T *l = NULL; listitem_T *li = NULL; long idx = 0; char_u *tofree = NULL; /* Make 'cpoptions' empty, the 'l' flag should not be used here. */ save_cpo = p_cpo; p_cpo = (char_u *)""; rettv->vval.v_number = -1; if (type == 3 || type == 4) { /* type 3: return empty list when there are no matches. * type 4: return ["", -1, -1, -1] */ if (rettv_list_alloc(rettv) == FAIL) goto theend; if (type == 4 && (list_append_string(rettv->vval.v_list, (char_u *)"", 0) == FAIL || list_append_number(rettv->vval.v_list, (varnumber_T)-1) == FAIL || list_append_number(rettv->vval.v_list, (varnumber_T)-1) == FAIL || list_append_number(rettv->vval.v_list, (varnumber_T)-1) == FAIL)) { list_free(rettv->vval.v_list, TRUE); rettv->vval.v_list = NULL; goto theend; } } else if (type == 2) { rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; } if (argvars[0].v_type == VAR_LIST) { if ((l = argvars[0].vval.v_list) == NULL) goto theend; li = l->lv_first; } else { expr = str = get_tv_string(&argvars[0]); len = (long)STRLEN(str); } pat = get_tv_string_buf_chk(&argvars[1], patbuf); if (pat == NULL) goto theend; if (argvars[2].v_type != VAR_UNKNOWN) { int error = FALSE; start = get_tv_number_chk(&argvars[2], &error); if (error) goto theend; if (l != NULL) { li = list_find(l, start); if (li == NULL) goto theend; idx = l->lv_idx; /* use the cached index */ } else { if (start < 0) start = 0; if (start > len) goto theend; /* When "count" argument is there ignore matches before "start", * otherwise skip part of the string. Differs when pattern is "^" * or "\<". */ if (argvars[3].v_type != VAR_UNKNOWN) startcol = start; else { str += start; len -= start; } } if (argvars[3].v_type != VAR_UNKNOWN) nth = get_tv_number_chk(&argvars[3], &error); if (error) goto theend; } regmatch.regprog = vim_regcomp(pat, RE_MAGIC + RE_STRING); if (regmatch.regprog != NULL) { regmatch.rm_ic = p_ic; for (;;) { if (l != NULL) { if (li == NULL) { match = FALSE; break; } vim_free(tofree); expr = str = echo_string(&li->li_tv, &tofree, strbuf, 0); if (str == NULL) break; } match = vim_regexec_nl(®match, str, (colnr_T)startcol); if (match && --nth <= 0) break; if (l == NULL && !match) break; /* Advance to just after the match. */ if (l != NULL) { li = li->li_next; ++idx; } else { #ifdef FEAT_MBYTE startcol = (colnr_T)(regmatch.startp[0] + (*mb_ptr2len)(regmatch.startp[0]) - str); #else startcol = (colnr_T)(regmatch.startp[0] + 1 - str); #endif if (startcol > (colnr_T)len || str + startcol <= regmatch.startp[0]) { match = FALSE; break; } } } if (match) { if (type == 4) { listitem_T *li1 = rettv->vval.v_list->lv_first; listitem_T *li2 = li1->li_next; listitem_T *li3 = li2->li_next; listitem_T *li4 = li3->li_next; li1->li_tv.vval.v_string = vim_strnsave(regmatch.startp[0], (int)(regmatch.endp[0] - regmatch.startp[0])); li3->li_tv.vval.v_number = (varnumber_T)(regmatch.startp[0] - expr); li4->li_tv.vval.v_number = (varnumber_T)(regmatch.endp[0] - expr); if (l != NULL) li2->li_tv.vval.v_number = (varnumber_T)idx; } else if (type == 3) { int i; /* return list with matched string and submatches */ for (i = 0; i < NSUBEXP; ++i) { if (regmatch.endp[i] == NULL) { if (list_append_string(rettv->vval.v_list, (char_u *)"", 0) == FAIL) break; } else if (list_append_string(rettv->vval.v_list, regmatch.startp[i], (int)(regmatch.endp[i] - regmatch.startp[i])) == FAIL) break; } } else if (type == 2) { /* return matched string */ if (l != NULL) copy_tv(&li->li_tv, rettv); else rettv->vval.v_string = vim_strnsave(regmatch.startp[0], (int)(regmatch.endp[0] - regmatch.startp[0])); } else if (l != NULL) rettv->vval.v_number = idx; else { if (type != 0) rettv->vval.v_number = (varnumber_T)(regmatch.startp[0] - str); else rettv->vval.v_number = (varnumber_T)(regmatch.endp[0] - str); rettv->vval.v_number += (varnumber_T)(str - expr); } } vim_regfree(regmatch.regprog); } if (type == 4 && l == NULL) /* matchstrpos() without a list: drop the second item. */ listitem_remove(rettv->vval.v_list, rettv->vval.v_list->lv_first->li_next); theend: vim_free(tofree); p_cpo = save_cpo; } /* * "match()" function */ static void f_match(typval_T *argvars, typval_T *rettv) { find_some_match(argvars, rettv, 1); } /* * "matchadd()" function */ static void f_matchadd(typval_T *argvars UNUSED, typval_T *rettv UNUSED) { #ifdef FEAT_SEARCH_EXTRA char_u buf[NUMBUFLEN]; char_u *grp = get_tv_string_buf_chk(&argvars[0], buf); /* group */ char_u *pat = get_tv_string_buf_chk(&argvars[1], buf); /* pattern */ int prio = 10; /* default priority */ int id = -1; int error = FALSE; char_u *conceal_char = NULL; rettv->vval.v_number = -1; if (grp == NULL || pat == NULL) return; if (argvars[2].v_type != VAR_UNKNOWN) { prio = get_tv_number_chk(&argvars[2], &error); if (argvars[3].v_type != VAR_UNKNOWN) { id = get_tv_number_chk(&argvars[3], &error); if (argvars[4].v_type != VAR_UNKNOWN) { if (argvars[4].v_type != VAR_DICT) { EMSG(_(e_dictreq)); return; } if (dict_find(argvars[4].vval.v_dict, (char_u *)"conceal", -1) != NULL) conceal_char = get_dict_string(argvars[4].vval.v_dict, (char_u *)"conceal", FALSE); } } } if (error == TRUE) return; if (id >= 1 && id <= 3) { EMSGN("E798: ID is reserved for \":match\": %ld", id); return; } rettv->vval.v_number = match_add(curwin, grp, pat, prio, id, NULL, conceal_char); #endif } /* * "matchaddpos()" function */ static void f_matchaddpos(typval_T *argvars UNUSED, typval_T *rettv UNUSED) { #ifdef FEAT_SEARCH_EXTRA char_u buf[NUMBUFLEN]; char_u *group; int prio = 10; int id = -1; int error = FALSE; list_T *l; char_u *conceal_char = NULL; rettv->vval.v_number = -1; group = get_tv_string_buf_chk(&argvars[0], buf); if (group == NULL) return; if (argvars[1].v_type != VAR_LIST) { EMSG2(_(e_listarg), "matchaddpos()"); return; } l = argvars[1].vval.v_list; if (l == NULL) return; if (argvars[2].v_type != VAR_UNKNOWN) { prio = get_tv_number_chk(&argvars[2], &error); if (argvars[3].v_type != VAR_UNKNOWN) { id = get_tv_number_chk(&argvars[3], &error); if (argvars[4].v_type != VAR_UNKNOWN) { if (argvars[4].v_type != VAR_DICT) { EMSG(_(e_dictreq)); return; } if (dict_find(argvars[4].vval.v_dict, (char_u *)"conceal", -1) != NULL) conceal_char = get_dict_string(argvars[4].vval.v_dict, (char_u *)"conceal", FALSE); } } } if (error == TRUE) return; /* id == 3 is ok because matchaddpos() is supposed to substitute :3match */ if (id == 1 || id == 2) { EMSGN("E798: ID is reserved for \":match\": %ld", id); return; } rettv->vval.v_number = match_add(curwin, group, NULL, prio, id, l, conceal_char); #endif } /* * "matcharg()" function */ static void f_matcharg(typval_T *argvars UNUSED, typval_T *rettv) { if (rettv_list_alloc(rettv) == OK) { #ifdef FEAT_SEARCH_EXTRA int id = get_tv_number(&argvars[0]); matchitem_T *m; if (id >= 1 && id <= 3) { if ((m = (matchitem_T *)get_match(curwin, id)) != NULL) { list_append_string(rettv->vval.v_list, syn_id2name(m->hlg_id), -1); list_append_string(rettv->vval.v_list, m->pattern, -1); } else { list_append_string(rettv->vval.v_list, NULL, -1); list_append_string(rettv->vval.v_list, NULL, -1); } } #endif } } /* * "matchdelete()" function */ static void f_matchdelete(typval_T *argvars UNUSED, typval_T *rettv UNUSED) { #ifdef FEAT_SEARCH_EXTRA rettv->vval.v_number = match_delete(curwin, (int)get_tv_number(&argvars[0]), TRUE); #endif } /* * "matchend()" function */ static void f_matchend(typval_T *argvars, typval_T *rettv) { find_some_match(argvars, rettv, 0); } /* * "matchlist()" function */ static void f_matchlist(typval_T *argvars, typval_T *rettv) { find_some_match(argvars, rettv, 3); } /* * "matchstr()" function */ static void f_matchstr(typval_T *argvars, typval_T *rettv) { find_some_match(argvars, rettv, 2); } /* * "matchstrpos()" function */ static void f_matchstrpos(typval_T *argvars, typval_T *rettv) { find_some_match(argvars, rettv, 4); } static void max_min(typval_T *argvars, typval_T *rettv, int domax); static void max_min(typval_T *argvars, typval_T *rettv, int domax) { long n = 0; long i; int error = FALSE; if (argvars[0].v_type == VAR_LIST) { list_T *l; listitem_T *li; l = argvars[0].vval.v_list; if (l != NULL) { li = l->lv_first; if (li != NULL) { n = get_tv_number_chk(&li->li_tv, &error); for (;;) { li = li->li_next; if (li == NULL) break; i = get_tv_number_chk(&li->li_tv, &error); if (domax ? i > n : i < n) n = i; } } } } else if (argvars[0].v_type == VAR_DICT) { dict_T *d; int first = TRUE; hashitem_T *hi; int todo; d = argvars[0].vval.v_dict; if (d != NULL) { todo = (int)d->dv_hashtab.ht_used; for (hi = d->dv_hashtab.ht_array; todo > 0; ++hi) { if (!HASHITEM_EMPTY(hi)) { --todo; i = get_tv_number_chk(&HI2DI(hi)->di_tv, &error); if (first) { n = i; first = FALSE; } else if (domax ? i > n : i < n) n = i; } } } } else EMSG(_(e_listdictarg)); rettv->vval.v_number = error ? 0 : n; } /* * "max()" function */ static void f_max(typval_T *argvars, typval_T *rettv) { max_min(argvars, rettv, TRUE); } /* * "min()" function */ static void f_min(typval_T *argvars, typval_T *rettv) { max_min(argvars, rettv, FALSE); } static int mkdir_recurse(char_u *dir, int prot); /* * Create the directory in which "dir" is located, and higher levels when * needed. */ static int mkdir_recurse(char_u *dir, int prot) { char_u *p; char_u *updir; int r = FAIL; /* Get end of directory name in "dir". * We're done when it's "/" or "c:/". */ p = gettail_sep(dir); if (p <= get_past_head(dir)) return OK; /* If the directory exists we're done. Otherwise: create it.*/ updir = vim_strnsave(dir, (int)(p - dir)); if (updir == NULL) return FAIL; if (mch_isdir(updir)) r = OK; else if (mkdir_recurse(updir, prot) == OK) r = vim_mkdir_emsg(updir, prot); vim_free(updir); return r; } #ifdef vim_mkdir /* * "mkdir()" function */ static void f_mkdir(typval_T *argvars, typval_T *rettv) { char_u *dir; char_u buf[NUMBUFLEN]; int prot = 0755; rettv->vval.v_number = FAIL; if (check_restricted() || check_secure()) return; dir = get_tv_string_buf(&argvars[0], buf); if (*dir == NUL) rettv->vval.v_number = FAIL; else { if (*gettail(dir) == NUL) /* remove trailing slashes */ *gettail_sep(dir) = NUL; if (argvars[1].v_type != VAR_UNKNOWN) { if (argvars[2].v_type != VAR_UNKNOWN) prot = get_tv_number_chk(&argvars[2], NULL); if (prot != -1 && STRCMP(get_tv_string(&argvars[1]), "p") == 0) mkdir_recurse(dir, prot); } rettv->vval.v_number = prot == -1 ? FAIL : vim_mkdir_emsg(dir, prot); } } #endif /* * "mode()" function */ static void f_mode(typval_T *argvars, typval_T *rettv) { char_u buf[3]; buf[1] = NUL; buf[2] = NUL; if (VIsual_active) { if (VIsual_select) buf[0] = VIsual_mode + 's' - 'v'; else buf[0] = VIsual_mode; } else if (State == HITRETURN || State == ASKMORE || State == SETWSIZE || State == CONFIRM) { buf[0] = 'r'; if (State == ASKMORE) buf[1] = 'm'; else if (State == CONFIRM) buf[1] = '?'; } else if (State == EXTERNCMD) buf[0] = '!'; else if (State & INSERT) { #ifdef FEAT_VREPLACE if (State & VREPLACE_FLAG) { buf[0] = 'R'; buf[1] = 'v'; } else #endif if (State & REPLACE_FLAG) buf[0] = 'R'; else buf[0] = 'i'; } else if (State & CMDLINE) { buf[0] = 'c'; if (exmode_active) buf[1] = 'v'; } else if (exmode_active) { buf[0] = 'c'; buf[1] = 'e'; } else { buf[0] = 'n'; if (finish_op) buf[1] = 'o'; } /* Clear out the minor mode when the argument is not a non-zero number or * non-empty string. */ if (!non_zero_arg(&argvars[0])) buf[1] = NUL; rettv->vval.v_string = vim_strsave(buf); rettv->v_type = VAR_STRING; } #if defined(FEAT_MZSCHEME) || defined(PROTO) /* * "mzeval()" function */ static void f_mzeval(typval_T *argvars, typval_T *rettv) { char_u *str; char_u buf[NUMBUFLEN]; str = get_tv_string_buf(&argvars[0], buf); do_mzeval(str, rettv); } void mzscheme_call_vim(char_u *name, typval_T *args, typval_T *rettv) { typval_T argvars[3]; argvars[0].v_type = VAR_STRING; argvars[0].vval.v_string = name; copy_tv(args, &argvars[1]); argvars[2].v_type = VAR_UNKNOWN; f_call(argvars, rettv); clear_tv(&argvars[1]); } #endif /* * "nextnonblank()" function */ static void f_nextnonblank(typval_T *argvars, typval_T *rettv) { linenr_T lnum; for (lnum = get_tv_lnum(argvars); ; ++lnum) { if (lnum < 0 || lnum > curbuf->b_ml.ml_line_count) { lnum = 0; break; } if (*skipwhite(ml_get(lnum)) != NUL) break; } rettv->vval.v_number = lnum; } /* * "nr2char()" function */ static void f_nr2char(typval_T *argvars, typval_T *rettv) { char_u buf[NUMBUFLEN]; #ifdef FEAT_MBYTE if (has_mbyte) { int utf8 = 0; if (argvars[1].v_type != VAR_UNKNOWN) utf8 = get_tv_number_chk(&argvars[1], NULL); if (utf8) buf[(*utf_char2bytes)((int)get_tv_number(&argvars[0]), buf)] = NUL; else buf[(*mb_char2bytes)((int)get_tv_number(&argvars[0]), buf)] = NUL; } else #endif { buf[0] = (char_u)get_tv_number(&argvars[0]); buf[1] = NUL; } rettv->v_type = VAR_STRING; rettv->vval.v_string = vim_strsave(buf); } /* * "or(expr, expr)" function */ static void f_or(typval_T *argvars, typval_T *rettv) { rettv->vval.v_number = get_tv_number_chk(&argvars[0], NULL) | get_tv_number_chk(&argvars[1], NULL); } /* * "pathshorten()" function */ static void f_pathshorten(typval_T *argvars, typval_T *rettv) { char_u *p; rettv->v_type = VAR_STRING; p = get_tv_string_chk(&argvars[0]); if (p == NULL) rettv->vval.v_string = NULL; else { p = vim_strsave(p); rettv->vval.v_string = p; if (p != NULL) shorten_dir(p); } } #ifdef FEAT_PERL /* * "perleval()" function */ static void f_perleval(typval_T *argvars, typval_T *rettv) { char_u *str; char_u buf[NUMBUFLEN]; str = get_tv_string_buf(&argvars[0], buf); do_perleval(str, rettv); } #endif #ifdef FEAT_FLOAT /* * "pow()" function */ static void f_pow(typval_T *argvars, typval_T *rettv) { float_T fx = 0.0, fy = 0.0; rettv->v_type = VAR_FLOAT; if (get_float_arg(argvars, &fx) == OK && get_float_arg(&argvars[1], &fy) == OK) rettv->vval.v_float = pow(fx, fy); else rettv->vval.v_float = 0.0; } #endif /* * "prevnonblank()" function */ static void f_prevnonblank(typval_T *argvars, typval_T *rettv) { linenr_T lnum; lnum = get_tv_lnum(argvars); if (lnum < 1 || lnum > curbuf->b_ml.ml_line_count) lnum = 0; else while (lnum >= 1 && *skipwhite(ml_get(lnum)) == NUL) --lnum; rettv->vval.v_number = lnum; } /* This dummy va_list is here because: * - passing a NULL pointer doesn't work when va_list isn't a pointer * - locally in the function results in a "used before set" warning * - using va_start() to initialize it gives "function with fixed args" error */ static va_list ap; /* * "printf()" function */ static void f_printf(typval_T *argvars, typval_T *rettv) { char_u buf[NUMBUFLEN]; int len; char_u *s; int saved_did_emsg = did_emsg; char *fmt; rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; /* Get the required length, allocate the buffer and do it for real. */ did_emsg = FALSE; fmt = (char *)get_tv_string_buf(&argvars[0], buf); len = vim_vsnprintf(NULL, 0, fmt, ap, argvars + 1); if (!did_emsg) { s = alloc(len + 1); if (s != NULL) { rettv->vval.v_string = s; (void)vim_vsnprintf((char *)s, len + 1, fmt, ap, argvars + 1); } } did_emsg |= saved_did_emsg; } /* * "pumvisible()" function */ static void f_pumvisible(typval_T *argvars UNUSED, typval_T *rettv UNUSED) { #ifdef FEAT_INS_EXPAND if (pum_visible()) rettv->vval.v_number = 1; #endif } #ifdef FEAT_PYTHON3 /* * "py3eval()" function */ static void f_py3eval(typval_T *argvars, typval_T *rettv) { char_u *str; char_u buf[NUMBUFLEN]; str = get_tv_string_buf(&argvars[0], buf); do_py3eval(str, rettv); } #endif #ifdef FEAT_PYTHON /* * "pyeval()" function */ static void f_pyeval(typval_T *argvars, typval_T *rettv) { char_u *str; char_u buf[NUMBUFLEN]; str = get_tv_string_buf(&argvars[0], buf); do_pyeval(str, rettv); } #endif /* * "range()" function */ static void f_range(typval_T *argvars, typval_T *rettv) { long start; long end; long stride = 1; long i; int error = FALSE; start = get_tv_number_chk(&argvars[0], &error); if (argvars[1].v_type == VAR_UNKNOWN) { end = start - 1; start = 0; } else { end = get_tv_number_chk(&argvars[1], &error); if (argvars[2].v_type != VAR_UNKNOWN) stride = get_tv_number_chk(&argvars[2], &error); } if (error) return; /* type error; errmsg already given */ if (stride == 0) EMSG(_("E726: Stride is zero")); else if (stride > 0 ? end + 1 < start : end - 1 > start) EMSG(_("E727: Start past end")); else { if (rettv_list_alloc(rettv) == OK) for (i = start; stride > 0 ? i <= end : i >= end; i += stride) if (list_append_number(rettv->vval.v_list, (varnumber_T)i) == FAIL) break; } } /* * "readfile()" function */ static void f_readfile(typval_T *argvars, typval_T *rettv) { int binary = FALSE; int failed = FALSE; char_u *fname; FILE *fd; char_u buf[(IOSIZE/256)*256]; /* rounded to avoid odd + 1 */ int io_size = sizeof(buf); int readlen; /* size of last fread() */ char_u *prev = NULL; /* previously read bytes, if any */ long prevlen = 0; /* length of data in prev */ long prevsize = 0; /* size of prev buffer */ long maxline = MAXLNUM; long cnt = 0; char_u *p; /* position in buf */ char_u *start; /* start of current line */ if (argvars[1].v_type != VAR_UNKNOWN) { if (STRCMP(get_tv_string(&argvars[1]), "b") == 0) binary = TRUE; if (argvars[2].v_type != VAR_UNKNOWN) maxline = get_tv_number(&argvars[2]); } if (rettv_list_alloc(rettv) == FAIL) return; /* Always open the file in binary mode, library functions have a mind of * their own about CR-LF conversion. */ fname = get_tv_string(&argvars[0]); if (*fname == NUL || (fd = mch_fopen((char *)fname, READBIN)) == NULL) { EMSG2(_(e_notopen), *fname == NUL ? (char_u *)_("") : fname); return; } while (cnt < maxline || maxline < 0) { readlen = (int)fread(buf, 1, io_size, fd); /* This for loop processes what was read, but is also entered at end * of file so that either: * - an incomplete line gets written * - a "binary" file gets an empty line at the end if it ends in a * newline. */ for (p = buf, start = buf; p < buf + readlen || (readlen <= 0 && (prevlen > 0 || binary)); ++p) { if (*p == '\n' || readlen <= 0) { listitem_T *li; char_u *s = NULL; long_u len = p - start; /* Finished a line. Remove CRs before NL. */ if (readlen > 0 && !binary) { while (len > 0 && start[len - 1] == '\r') --len; /* removal may cross back to the "prev" string */ if (len == 0) while (prevlen > 0 && prev[prevlen - 1] == '\r') --prevlen; } if (prevlen == 0) s = vim_strnsave(start, (int)len); else { /* Change "prev" buffer to be the right size. This way * the bytes are only copied once, and very long lines are * allocated only once. */ if ((s = vim_realloc(prev, prevlen + len + 1)) != NULL) { mch_memmove(s + prevlen, start, len); s[prevlen + len] = NUL; prev = NULL; /* the list will own the string */ prevlen = prevsize = 0; } } if (s == NULL) { do_outofmem_msg((long_u) prevlen + len + 1); failed = TRUE; break; } if ((li = listitem_alloc()) == NULL) { vim_free(s); failed = TRUE; break; } li->li_tv.v_type = VAR_STRING; li->li_tv.v_lock = 0; li->li_tv.vval.v_string = s; list_append(rettv->vval.v_list, li); start = p + 1; /* step over newline */ if ((++cnt >= maxline && maxline >= 0) || readlen <= 0) break; } else if (*p == NUL) *p = '\n'; #ifdef FEAT_MBYTE /* Check for utf8 "bom"; U+FEFF is encoded as EF BB BF. Do this * when finding the BF and check the previous two bytes. */ else if (*p == 0xbf && enc_utf8 && !binary) { /* Find the two bytes before the 0xbf. If p is at buf, or buf * + 1, these may be in the "prev" string. */ char_u back1 = p >= buf + 1 ? p[-1] : prevlen >= 1 ? prev[prevlen - 1] : NUL; char_u back2 = p >= buf + 2 ? p[-2] : p == buf + 1 && prevlen >= 1 ? prev[prevlen - 1] : prevlen >= 2 ? prev[prevlen - 2] : NUL; if (back2 == 0xef && back1 == 0xbb) { char_u *dest = p - 2; /* Usually a BOM is at the beginning of a file, and so at * the beginning of a line; then we can just step over it. */ if (start == dest) start = p + 1; else { /* have to shuffle buf to close gap */ int adjust_prevlen = 0; if (dest < buf) { adjust_prevlen = (int)(buf - dest); /* must be 1 or 2 */ dest = buf; } if (readlen > p - buf + 1) mch_memmove(dest, p + 1, readlen - (p - buf) - 1); readlen -= 3 - adjust_prevlen; prevlen -= adjust_prevlen; p = dest - 1; } } } #endif } /* for */ if (failed || (cnt >= maxline && maxline >= 0) || readlen <= 0) break; if (start < p) { /* There's part of a line in buf, store it in "prev". */ if (p - start + prevlen >= prevsize) { /* need bigger "prev" buffer */ char_u *newprev; /* A common use case is ordinary text files and "prev" gets a * fragment of a line, so the first allocation is made * small, to avoid repeatedly 'allocing' large and * 'reallocing' small. */ if (prevsize == 0) prevsize = (long)(p - start); else { long grow50pc = (prevsize * 3) / 2; long growmin = (long)((p - start) * 2 + prevlen); prevsize = grow50pc > growmin ? grow50pc : growmin; } newprev = prev == NULL ? alloc(prevsize) : vim_realloc(prev, prevsize); if (newprev == NULL) { do_outofmem_msg((long_u)prevsize); failed = TRUE; break; } prev = newprev; } /* Add the line part to end of "prev". */ mch_memmove(prev + prevlen, start, p - start); prevlen += (long)(p - start); } } /* while */ /* * For a negative line count use only the lines at the end of the file, * free the rest. */ if (!failed && maxline < 0) while (cnt > -maxline) { listitem_remove(rettv->vval.v_list, rettv->vval.v_list->lv_first); --cnt; } if (failed) { list_free(rettv->vval.v_list, TRUE); /* readfile doc says an empty list is returned on error */ rettv->vval.v_list = list_alloc(); } vim_free(prev); fclose(fd); } #if defined(FEAT_RELTIME) static int list2proftime(typval_T *arg, proftime_T *tm); /* * Convert a List to proftime_T. * Return FAIL when there is something wrong. */ static int list2proftime(typval_T *arg, proftime_T *tm) { long n1, n2; int error = FALSE; if (arg->v_type != VAR_LIST || arg->vval.v_list == NULL || arg->vval.v_list->lv_len != 2) return FAIL; n1 = list_find_nr(arg->vval.v_list, 0L, &error); n2 = list_find_nr(arg->vval.v_list, 1L, &error); # ifdef WIN3264 tm->HighPart = n1; tm->LowPart = n2; # else tm->tv_sec = n1; tm->tv_usec = n2; # endif return error ? FAIL : OK; } #endif /* FEAT_RELTIME */ /* * "reltime()" function */ static void f_reltime(typval_T *argvars UNUSED, typval_T *rettv UNUSED) { #ifdef FEAT_RELTIME proftime_T res; proftime_T start; if (argvars[0].v_type == VAR_UNKNOWN) { /* No arguments: get current time. */ profile_start(&res); } else if (argvars[1].v_type == VAR_UNKNOWN) { if (list2proftime(&argvars[0], &res) == FAIL) return; profile_end(&res); } else { /* Two arguments: compute the difference. */ if (list2proftime(&argvars[0], &start) == FAIL || list2proftime(&argvars[1], &res) == FAIL) return; profile_sub(&res, &start); } if (rettv_list_alloc(rettv) == OK) { long n1, n2; # ifdef WIN3264 n1 = res.HighPart; n2 = res.LowPart; # else n1 = res.tv_sec; n2 = res.tv_usec; # endif list_append_number(rettv->vval.v_list, (varnumber_T)n1); list_append_number(rettv->vval.v_list, (varnumber_T)n2); } #endif } #ifdef FEAT_FLOAT /* * "reltimefloat()" function */ static void f_reltimefloat(typval_T *argvars UNUSED, typval_T *rettv) { # ifdef FEAT_RELTIME proftime_T tm; # endif rettv->v_type = VAR_FLOAT; rettv->vval.v_float = 0; # ifdef FEAT_RELTIME if (list2proftime(&argvars[0], &tm) == OK) rettv->vval.v_float = profile_float(&tm); # endif } #endif /* * "reltimestr()" function */ static void f_reltimestr(typval_T *argvars UNUSED, typval_T *rettv) { #ifdef FEAT_RELTIME proftime_T tm; #endif rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; #ifdef FEAT_RELTIME if (list2proftime(&argvars[0], &tm) == OK) rettv->vval.v_string = vim_strsave((char_u *)profile_msg(&tm)); #endif } #if defined(FEAT_CLIENTSERVER) && defined(FEAT_X11) static void make_connection(void); static int check_connection(void); static void make_connection(void) { 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(void) { make_connection(); if (X_DISPLAY == NULL) { EMSG(_("E240: No connection to Vim server")); return FAIL; } return OK; } #endif #ifdef FEAT_CLIENTSERVER static void remote_common(typval_T *argvars, typval_T *rettv, int expr); static void remote_common(typval_T *argvars, typval_T *rettv, 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_tv_string_chk(&argvars[0]); if (server_name == NULL) return; /* type error; errmsg already given */ keys = get_tv_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; } rettv->vval.v_string = r; if (argvars[2].v_type != VAR_UNKNOWN) { dictitem_T v; char_u str[30]; char_u *idvar; sprintf((char *)str, PRINTF_HEX_LONG_U, (long_u)w); v.di_tv.v_type = VAR_STRING; v.di_tv.vval.v_string = vim_strsave(str); idvar = get_tv_string_chk(&argvars[2]); if (idvar != NULL) set_var(idvar, &v.di_tv, FALSE); vim_free(v.di_tv.vval.v_string); } } #endif /* * "remote_expr()" function */ static void f_remote_expr(typval_T *argvars UNUSED, typval_T *rettv) { rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; #ifdef FEAT_CLIENTSERVER remote_common(argvars, rettv, TRUE); #endif } /* * "remote_foreground()" function */ static void f_remote_foreground(typval_T *argvars UNUSED, typval_T *rettv UNUSED) { #ifdef FEAT_CLIENTSERVER # ifdef WIN32 /* On Win32 it's done in this application. */ { char_u *server_name = get_tv_string_chk(&argvars[0]); if (server_name != NULL) serverForeground(server_name); } # else /* Send a foreground() expression to the server. */ argvars[1].v_type = VAR_STRING; argvars[1].vval.v_string = vim_strsave((char_u *)"foreground()"); argvars[2].v_type = VAR_UNKNOWN; remote_common(argvars, rettv, TRUE); vim_free(argvars[1].vval.v_string); # endif #endif } static void f_remote_peek(typval_T *argvars UNUSED, typval_T *rettv) { #ifdef FEAT_CLIENTSERVER dictitem_T v; char_u *s = NULL; # ifdef WIN32 long_u n = 0; # endif char_u *serverid; if (check_restricted() || check_secure()) { rettv->vval.v_number = -1; return; } serverid = get_tv_string_chk(&argvars[0]); if (serverid == NULL) { rettv->vval.v_number = -1; return; /* type error; errmsg already given */ } # ifdef WIN32 sscanf((const char *)serverid, SCANF_HEX_LONG_U, &n); if (n == 0) rettv->vval.v_number = -1; else { s = serverGetReply((HWND)n, FALSE, FALSE, FALSE); rettv->vval.v_number = (s != NULL); } # else if (check_connection() == FAIL) return; rettv->vval.v_number = serverPeekReply(X_DISPLAY, serverStrToWin(serverid), &s); # endif if (argvars[1].v_type != VAR_UNKNOWN && rettv->vval.v_number > 0) { char_u *retvar; v.di_tv.v_type = VAR_STRING; v.di_tv.vval.v_string = vim_strsave(s); retvar = get_tv_string_chk(&argvars[1]); if (retvar != NULL) set_var(retvar, &v.di_tv, FALSE); vim_free(v.di_tv.vval.v_string); } #else rettv->vval.v_number = -1; #endif } static void f_remote_read(typval_T *argvars UNUSED, typval_T *rettv) { char_u *r = NULL; #ifdef FEAT_CLIENTSERVER char_u *serverid = get_tv_string_chk(&argvars[0]); if (serverid != NULL && !check_restricted() && !check_secure()) { # ifdef WIN32 /* The server's HWND is encoded in the 'id' parameter */ long_u n = 0; sscanf((char *)serverid, SCANF_HEX_LONG_U, &n); if (n != 0) r = serverGetReply((HWND)n, FALSE, TRUE, TRUE); if (r == NULL) # else if (check_connection() == FAIL || serverReadReply(X_DISPLAY, serverStrToWin(serverid), &r, FALSE) < 0) # endif EMSG(_("E277: Unable to read a server reply")); } #endif rettv->v_type = VAR_STRING; rettv->vval.v_string = r; } /* * "remote_send()" function */ static void f_remote_send(typval_T *argvars UNUSED, typval_T *rettv) { rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; #ifdef FEAT_CLIENTSERVER remote_common(argvars, rettv, FALSE); #endif } /* * "remove()" function */ static void f_remove(typval_T *argvars, typval_T *rettv) { list_T *l; listitem_T *item, *item2; listitem_T *li; long idx; long end; char_u *key; dict_T *d; dictitem_T *di; char_u *arg_errmsg = (char_u *)N_("remove() argument"); if (argvars[0].v_type == VAR_DICT) { if (argvars[2].v_type != VAR_UNKNOWN) EMSG2(_(e_toomanyarg), "remove()"); else if ((d = argvars[0].vval.v_dict) != NULL && !tv_check_lock(d->dv_lock, arg_errmsg, TRUE)) { key = get_tv_string_chk(&argvars[1]); if (key != NULL) { di = dict_find(d, key, -1); if (di == NULL) EMSG2(_(e_dictkey), key); else if (!var_check_fixed(di->di_flags, arg_errmsg, TRUE) && !var_check_ro(di->di_flags, arg_errmsg, TRUE)) { *rettv = di->di_tv; init_tv(&di->di_tv); dictitem_remove(d, di); } } } } else if (argvars[0].v_type != VAR_LIST) EMSG2(_(e_listdictarg), "remove()"); else if ((l = argvars[0].vval.v_list) != NULL && !tv_check_lock(l->lv_lock, arg_errmsg, TRUE)) { int error = FALSE; idx = get_tv_number_chk(&argvars[1], &error); if (error) ; /* type error: do nothing, errmsg already given */ else if ((item = list_find(l, idx)) == NULL) EMSGN(_(e_listidx), idx); else { if (argvars[2].v_type == VAR_UNKNOWN) { /* Remove one item, return its value. */ vimlist_remove(l, item, item); *rettv = item->li_tv; vim_free(item); } else { /* Remove range of items, return list with values. */ end = get_tv_number_chk(&argvars[2], &error); if (error) ; /* type error: do nothing */ else if ((item2 = list_find(l, end)) == NULL) EMSGN(_(e_listidx), end); else { int cnt = 0; for (li = item; li != NULL; li = li->li_next) { ++cnt; if (li == item2) break; } if (li == NULL) /* didn't find "item2" after "item" */ EMSG(_(e_invrange)); else { vimlist_remove(l, item, item2); if (rettv_list_alloc(rettv) == OK) { l = rettv->vval.v_list; l->lv_first = item; l->lv_last = item2; item->li_prev = NULL; item2->li_next = NULL; l->lv_len = cnt; } } } } } } } /* * "rename({from}, {to})" function */ static void f_rename(typval_T *argvars, typval_T *rettv) { char_u buf[NUMBUFLEN]; if (check_restricted() || check_secure()) rettv->vval.v_number = -1; else rettv->vval.v_number = vim_rename(get_tv_string(&argvars[0]), get_tv_string_buf(&argvars[1], buf)); } /* * "repeat()" function */ static void f_repeat(typval_T *argvars, typval_T *rettv) { char_u *p; int n; int slen; int len; char_u *r; int i; n = get_tv_number(&argvars[1]); if (argvars[0].v_type == VAR_LIST) { if (rettv_list_alloc(rettv) == OK && argvars[0].vval.v_list != NULL) while (n-- > 0) if (list_extend(rettv->vval.v_list, argvars[0].vval.v_list, NULL) == FAIL) break; } else { p = get_tv_string(&argvars[0]); rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; slen = (int)STRLEN(p); len = slen * n; if (len <= 0) return; r = alloc(len + 1); if (r != NULL) { for (i = 0; i < n; i++) mch_memmove(r + i * slen, p, (size_t)slen); r[len] = NUL; } rettv->vval.v_string = r; } } /* * "resolve()" function */ static void f_resolve(typval_T *argvars, typval_T *rettv) { char_u *p; #ifdef HAVE_READLINK char_u *buf = NULL; #endif p = get_tv_string(&argvars[0]); #ifdef FEAT_SHORTCUT { char_u *v = NULL; v = mch_resolve_shortcut(p); if (v != NULL) rettv->vval.v_string = v; else rettv->vval.v_string = vim_strsave(p); } #else # ifdef HAVE_READLINK { 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 && after_pathsep(p, p + len)) { has_trailing_pathsep = TRUE; p[len - 1] = NUL; /* the trailing slash breaks readlink() */ } 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; } buf = alloc(MAXPATHL + 1); if (buf == NULL) goto fail; 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?)")); rettv->vval.v_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 = concat_str(q - 1, remain); if (cpy != NULL) { 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) STRMOVE(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 = concat_str((char_u *)"./", p); if (cpy != NULL) { 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) STRMOVE(p, p + 2); } } /* 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); if (after_pathsep(p, q)) *gettail_sep(p) = NUL; } rettv->vval.v_string = p; } # else rettv->vval.v_string = vim_strsave(p); # endif #endif simplify_filename(rettv->vval.v_string); #ifdef HAVE_READLINK fail: vim_free(buf); #endif rettv->v_type = VAR_STRING; } /* * "reverse({list})" function */ static void f_reverse(typval_T *argvars, typval_T *rettv) { list_T *l; listitem_T *li, *ni; if (argvars[0].v_type != VAR_LIST) EMSG2(_(e_listarg), "reverse()"); else if ((l = argvars[0].vval.v_list) != NULL && !tv_check_lock(l->lv_lock, (char_u *)N_("reverse() argument"), TRUE)) { li = l->lv_last; l->lv_first = l->lv_last = NULL; l->lv_len = 0; while (li != NULL) { ni = li->li_prev; list_append(l, li); li = ni; } rettv->vval.v_list = l; rettv->v_type = VAR_LIST; ++l->lv_refcount; l->lv_idx = l->lv_len - l->lv_idx - 1; } } #define SP_NOMOVE 0x01 /* don't move cursor */ #define SP_REPEAT 0x02 /* repeat to find outer pair */ #define SP_RETCOUNT 0x04 /* return matchcount */ #define SP_SETPCMARK 0x08 /* set previous context mark */ #define SP_START 0x10 /* accept match at start position */ #define SP_SUBPAT 0x20 /* return nr of matching sub-pattern */ #define SP_END 0x40 /* leave cursor at end of match */ #define SP_COLUMN 0x80 /* start at cursor column */ static int get_search_arg(typval_T *varp, int *flagsp); /* * Get flags for a search function. * Possibly sets "p_ws". * Returns BACKWARD, FORWARD or zero (for an error). */ static int get_search_arg(typval_T *varp, int *flagsp) { int dir = FORWARD; char_u *flags; char_u nbuf[NUMBUFLEN]; int mask; if (varp->v_type != VAR_UNKNOWN) { flags = get_tv_string_buf_chk(varp, nbuf); if (flags == NULL) return 0; /* type error; errmsg already given */ while (*flags != NUL) { switch (*flags) { case 'b': dir = BACKWARD; break; case 'w': p_ws = TRUE; break; case 'W': p_ws = FALSE; break; default: mask = 0; if (flagsp != NULL) switch (*flags) { case 'c': mask = SP_START; break; case 'e': mask = SP_END; break; case 'm': mask = SP_RETCOUNT; break; case 'n': mask = SP_NOMOVE; break; case 'p': mask = SP_SUBPAT; break; case 'r': mask = SP_REPEAT; break; case 's': mask = SP_SETPCMARK; break; case 'z': mask = SP_COLUMN; break; } if (mask == 0) { EMSG2(_(e_invarg2), flags); dir = 0; } else *flagsp |= mask; } if (dir == 0) break; ++flags; } } return dir; } /* * Shared by search() and searchpos() functions. */ static int search_cmn(typval_T *argvars, pos_T *match_pos, int *flagsp) { int flags; char_u *pat; pos_T pos; pos_T save_cursor; int save_p_ws = p_ws; int dir; int retval = 0; /* default: FAIL */ long lnum_stop = 0; proftime_T tm; #ifdef FEAT_RELTIME long time_limit = 0; #endif int options = SEARCH_KEEP; int subpatnum; pat = get_tv_string(&argvars[0]); dir = get_search_arg(&argvars[1], flagsp); /* may set p_ws */ if (dir == 0) goto theend; flags = *flagsp; if (flags & SP_START) options |= SEARCH_START; if (flags & SP_END) options |= SEARCH_END; if (flags & SP_COLUMN) options |= SEARCH_COL; /* Optional arguments: line number to stop searching and timeout. */ if (argvars[1].v_type != VAR_UNKNOWN && argvars[2].v_type != VAR_UNKNOWN) { lnum_stop = get_tv_number_chk(&argvars[2], NULL); if (lnum_stop < 0) goto theend; #ifdef FEAT_RELTIME if (argvars[3].v_type != VAR_UNKNOWN) { time_limit = get_tv_number_chk(&argvars[3], NULL); if (time_limit < 0) goto theend; } #endif } #ifdef FEAT_RELTIME /* Set the time limit, if there is one. */ profile_setlimit(time_limit, &tm); #endif /* * This function does not accept SP_REPEAT and SP_RETCOUNT flags. * Check to make sure only those flags are set. * Also, Only the SP_NOMOVE or the SP_SETPCMARK flag can be set. Both * flags cannot be set. Check for that condition also. */ if (((flags & (SP_REPEAT | SP_RETCOUNT)) != 0) || ((flags & SP_NOMOVE) && (flags & SP_SETPCMARK))) { EMSG2(_(e_invarg2), get_tv_string(&argvars[1])); goto theend; } pos = save_cursor = curwin->w_cursor; subpatnum = searchit(curwin, curbuf, &pos, dir, pat, 1L, options, RE_SEARCH, (linenr_T)lnum_stop, &tm); if (subpatnum != FAIL) { if (flags & SP_SUBPAT) retval = subpatnum; else retval = pos.lnum; if (flags & SP_SETPCMARK) setpcmark(); curwin->w_cursor = pos; if (match_pos != NULL) { /* Store the match cursor position */ match_pos->lnum = pos.lnum; match_pos->col = pos.col + 1; } /* "/$" will put the cursor after the end of the line, may need to * correct that here */ check_cursor(); } /* If 'n' flag is used: restore cursor position. */ if (flags & SP_NOMOVE) curwin->w_cursor = save_cursor; else curwin->w_set_curswant = TRUE; theend: p_ws = save_p_ws; return retval; } #ifdef FEAT_FLOAT /* * round() is not in C90, use ceil() or floor() instead. */ float_T vim_round(float_T f) { return f > 0 ? floor(f + 0.5) : ceil(f - 0.5); } /* * "round({float})" function */ static void f_round(typval_T *argvars, typval_T *rettv) { float_T f = 0.0; rettv->v_type = VAR_FLOAT; if (get_float_arg(argvars, &f) == OK) rettv->vval.v_float = vim_round(f); else rettv->vval.v_float = 0.0; } #endif /* * "screenattr()" function */ static void f_screenattr(typval_T *argvars, typval_T *rettv) { int row; int col; int c; row = get_tv_number_chk(&argvars[0], NULL) - 1; col = get_tv_number_chk(&argvars[1], NULL) - 1; if (row < 0 || row >= screen_Rows || col < 0 || col >= screen_Columns) c = -1; else c = ScreenAttrs[LineOffset[row] + col]; rettv->vval.v_number = c; } /* * "screenchar()" function */ static void f_screenchar(typval_T *argvars, typval_T *rettv) { int row; int col; int off; int c; row = get_tv_number_chk(&argvars[0], NULL) - 1; col = get_tv_number_chk(&argvars[1], NULL) - 1; if (row < 0 || row >= screen_Rows || col < 0 || col >= screen_Columns) c = -1; else { off = LineOffset[row] + col; #ifdef FEAT_MBYTE if (enc_utf8 && ScreenLinesUC[off] != 0) c = ScreenLinesUC[off]; else #endif c = ScreenLines[off]; } rettv->vval.v_number = c; } /* * "screencol()" function * * First column is 1 to be consistent with virtcol(). */ static void f_screencol(typval_T *argvars UNUSED, typval_T *rettv) { rettv->vval.v_number = screen_screencol() + 1; } /* * "screenrow()" function */ static void f_screenrow(typval_T *argvars UNUSED, typval_T *rettv) { rettv->vval.v_number = screen_screenrow() + 1; } /* * "search()" function */ static void f_search(typval_T *argvars, typval_T *rettv) { int flags = 0; rettv->vval.v_number = search_cmn(argvars, NULL, &flags); } /* * "searchdecl()" function */ static void f_searchdecl(typval_T *argvars, typval_T *rettv) { int locally = 1; int thisblock = 0; int error = FALSE; char_u *name; rettv->vval.v_number = 1; /* default: FAIL */ name = get_tv_string_chk(&argvars[0]); if (argvars[1].v_type != VAR_UNKNOWN) { locally = get_tv_number_chk(&argvars[1], &error) == 0; if (!error && argvars[2].v_type != VAR_UNKNOWN) thisblock = get_tv_number_chk(&argvars[2], &error) != 0; } if (!error && name != NULL) rettv->vval.v_number = find_decl(name, (int)STRLEN(name), locally, thisblock, SEARCH_KEEP) == FAIL; } /* * Used by searchpair() and searchpairpos() */ static int searchpair_cmn(typval_T *argvars, pos_T *match_pos) { char_u *spat, *mpat, *epat; char_u *skip; int save_p_ws = p_ws; int dir; int flags = 0; char_u nbuf1[NUMBUFLEN]; char_u nbuf2[NUMBUFLEN]; char_u nbuf3[NUMBUFLEN]; int retval = 0; /* default: FAIL */ long lnum_stop = 0; long time_limit = 0; /* Get the three pattern arguments: start, middle, end. */ spat = get_tv_string_chk(&argvars[0]); mpat = get_tv_string_buf_chk(&argvars[1], nbuf1); epat = get_tv_string_buf_chk(&argvars[2], nbuf2); if (spat == NULL || mpat == NULL || epat == NULL) goto theend; /* type error */ /* Handle the optional fourth argument: flags */ dir = get_search_arg(&argvars[3], &flags); /* may set p_ws */ if (dir == 0) goto theend; /* Don't accept SP_END or SP_SUBPAT. * Only one of the SP_NOMOVE or SP_SETPCMARK flags can be set. */ if ((flags & (SP_END | SP_SUBPAT)) != 0 || ((flags & SP_NOMOVE) && (flags & SP_SETPCMARK))) { EMSG2(_(e_invarg2), get_tv_string(&argvars[3])); goto theend; } /* Using 'r' implies 'W', otherwise it doesn't work. */ if (flags & SP_REPEAT) p_ws = FALSE; /* Optional fifth argument: skip expression */ if (argvars[3].v_type == VAR_UNKNOWN || argvars[4].v_type == VAR_UNKNOWN) skip = (char_u *)""; else { skip = get_tv_string_buf_chk(&argvars[4], nbuf3); if (argvars[5].v_type != VAR_UNKNOWN) { lnum_stop = get_tv_number_chk(&argvars[5], NULL); if (lnum_stop < 0) goto theend; #ifdef FEAT_RELTIME if (argvars[6].v_type != VAR_UNKNOWN) { time_limit = get_tv_number_chk(&argvars[6], NULL); if (time_limit < 0) goto theend; } #endif } } if (skip == NULL) goto theend; /* type error */ retval = do_searchpair(spat, mpat, epat, dir, skip, flags, match_pos, lnum_stop, time_limit); theend: p_ws = save_p_ws; return retval; } /* * "searchpair()" function */ static void f_searchpair(typval_T *argvars, typval_T *rettv) { rettv->vval.v_number = searchpair_cmn(argvars, NULL); } /* * "searchpairpos()" function */ static void f_searchpairpos(typval_T *argvars, typval_T *rettv) { pos_T match_pos; int lnum = 0; int col = 0; if (rettv_list_alloc(rettv) == FAIL) return; if (searchpair_cmn(argvars, &match_pos) > 0) { lnum = match_pos.lnum; col = match_pos.col; } list_append_number(rettv->vval.v_list, (varnumber_T)lnum); list_append_number(rettv->vval.v_list, (varnumber_T)col); } /* * Search for a start/middle/end thing. * Used by searchpair(), see its documentation for the details. * Returns 0 or -1 for no match, */ long do_searchpair( char_u *spat, /* start pattern */ char_u *mpat, /* middle pattern */ char_u *epat, /* end pattern */ int dir, /* BACKWARD or FORWARD */ char_u *skip, /* skip expression */ int flags, /* SP_SETPCMARK and other SP_ values */ pos_T *match_pos, linenr_T lnum_stop, /* stop at this line if not zero */ long time_limit UNUSED) /* stop after this many msec */ { char_u *save_cpo; char_u *pat, *pat2 = NULL, *pat3 = NULL; long retval = 0; pos_T pos; pos_T firstpos; pos_T foundpos; pos_T save_cursor; pos_T save_pos; int n; int r; int nest = 1; int err; int options = SEARCH_KEEP; proftime_T tm; /* Make 'cpoptions' empty, the 'l' flag should not be used here. */ save_cpo = p_cpo; p_cpo = empty_option; #ifdef FEAT_RELTIME /* Set the time limit, if there is one. */ profile_setlimit(time_limit, &tm); #endif /* 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); if (flags & SP_START) options |= SEARCH_START; save_cursor = curwin->w_cursor; pos = curwin->w_cursor; clearpos(&firstpos); clearpos(&foundpos); pat = pat3; for (;;) { n = searchit(curwin, curbuf, &pos, dir, pat, 1L, options, RE_SEARCH, lnum_stop, &tm); 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 (equalpos(pos, foundpos)) { /* Found the same position again. Can happen with a pattern that * has "\zs" at the end and searching backwards. Advance one * character and try again. */ if (dir == BACKWARD) decl(&pos); else incl(&pos); } foundpos = pos; /* clear the start flag to avoid getting stuck here */ options &= ~SEARCH_START; /* 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; retval = -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) ++retval; else retval = pos.lnum; if (flags & SP_SETPCMARK) setpcmark(); curwin->w_cursor = pos; if (!(flags & SP_REPEAT)) break; nest = 1; /* search for next unmatched */ } } if (match_pos != NULL) { /* Store the match cursor position */ match_pos->lnum = curwin->w_cursor.lnum; match_pos->col = curwin->w_cursor.col + 1; } /* If 'n' flag is used or search failed: restore cursor position. */ if ((flags & SP_NOMOVE) || retval == 0) curwin->w_cursor = save_cursor; theend: vim_free(pat2); vim_free(pat3); if (p_cpo == empty_option) p_cpo = save_cpo; else /* Darn, evaluating the {skip} expression changed the value. */ free_string_option(save_cpo); return retval; } /* * "searchpos()" function */ static void f_searchpos(typval_T *argvars, typval_T *rettv) { pos_T match_pos; int lnum = 0; int col = 0; int n; int flags = 0; if (rettv_list_alloc(rettv) == FAIL) return; n = search_cmn(argvars, &match_pos, &flags); if (n > 0) { lnum = match_pos.lnum; col = match_pos.col; } list_append_number(rettv->vval.v_list, (varnumber_T)lnum); list_append_number(rettv->vval.v_list, (varnumber_T)col); if (flags & SP_SUBPAT) list_append_number(rettv->vval.v_list, (varnumber_T)n); } static void f_server2client(typval_T *argvars UNUSED, typval_T *rettv) { #ifdef FEAT_CLIENTSERVER char_u buf[NUMBUFLEN]; char_u *server = get_tv_string_chk(&argvars[0]); char_u *reply = get_tv_string_buf_chk(&argvars[1], buf); rettv->vval.v_number = -1; if (server == NULL || reply == NULL) return; 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; } rettv->vval.v_number = 0; #else rettv->vval.v_number = -1; #endif } static void f_serverlist(typval_T *argvars UNUSED, typval_T *rettv) { char_u *r = NULL; #ifdef FEAT_CLIENTSERVER # ifdef WIN32 r = serverGetVimNames(); # else make_connection(); if (X_DISPLAY != NULL) r = serverGetVimNames(X_DISPLAY); # endif #endif rettv->v_type = VAR_STRING; rettv->vval.v_string = r; } /* * "setbufvar()" function */ static void f_setbufvar(typval_T *argvars, typval_T *rettv UNUSED) { buf_T *buf; aco_save_T aco; char_u *varname, *bufvarname; typval_T *varp; char_u nbuf[NUMBUFLEN]; if (check_restricted() || check_secure()) return; (void)get_tv_number(&argvars[0]); /* issue errmsg if type error */ varname = get_tv_string_chk(&argvars[1]); buf = get_buf_tv(&argvars[0], FALSE); varp = &argvars[2]; if (buf != NULL && varname != NULL && varp != NULL) { /* set curbuf to be our buf, temporarily */ aucmd_prepbuf(&aco, buf); if (*varname == '&') { long numval; char_u *strval; int error = FALSE; ++varname; numval = get_tv_number_chk(varp, &error); strval = get_tv_string_buf_chk(varp, nbuf); if (!error && strval != NULL) set_option_value(varname, numval, strval, OPT_LOCAL); } else { bufvarname = alloc((unsigned)STRLEN(varname) + 3); if (bufvarname != NULL) { STRCPY(bufvarname, "b:"); STRCPY(bufvarname + 2, varname); set_var(bufvarname, varp, TRUE); vim_free(bufvarname); } } /* reset notion of buffer */ aucmd_restbuf(&aco); } } static void f_setcharsearch(typval_T *argvars, typval_T *rettv UNUSED) { dict_T *d; dictitem_T *di; char_u *csearch; if (argvars[0].v_type != VAR_DICT) { EMSG(_(e_dictreq)); return; } if ((d = argvars[0].vval.v_dict) != NULL) { csearch = get_dict_string(d, (char_u *)"char", FALSE); if (csearch != NULL) { #ifdef FEAT_MBYTE if (enc_utf8) { int pcc[MAX_MCO]; int c = utfc_ptr2char(csearch, pcc); set_last_csearch(c, csearch, utfc_ptr2len(csearch)); } else #endif set_last_csearch(PTR2CHAR(csearch), csearch, MB_PTR2LEN(csearch)); } di = dict_find(d, (char_u *)"forward", -1); if (di != NULL) set_csearch_direction(get_tv_number(&di->di_tv) ? FORWARD : BACKWARD); di = dict_find(d, (char_u *)"until", -1); if (di != NULL) set_csearch_until(!!get_tv_number(&di->di_tv)); } } /* * "setcmdpos()" function */ static void f_setcmdpos(typval_T *argvars, typval_T *rettv) { int pos = (int)get_tv_number(&argvars[0]) - 1; if (pos >= 0) rettv->vval.v_number = set_cmdline_pos(pos); } /* * "setfperm({fname}, {mode})" function */ static void f_setfperm(typval_T *argvars, typval_T *rettv) { char_u *fname; char_u modebuf[NUMBUFLEN]; char_u *mode_str; int i; int mask; int mode = 0; rettv->vval.v_number = 0; fname = get_tv_string_chk(&argvars[0]); if (fname == NULL) return; mode_str = get_tv_string_buf_chk(&argvars[1], modebuf); if (mode_str == NULL) return; if (STRLEN(mode_str) != 9) { EMSG2(_(e_invarg2), mode_str); return; } mask = 1; for (i = 8; i >= 0; --i) { if (mode_str[i] != '-') mode |= mask; mask = mask << 1; } rettv->vval.v_number = mch_setperm(fname, mode) == OK; } /* * "setline()" function */ static void f_setline(typval_T *argvars, typval_T *rettv) { linenr_T lnum; char_u *line = NULL; list_T *l = NULL; listitem_T *li = NULL; long added = 0; linenr_T lcount = curbuf->b_ml.ml_line_count; lnum = get_tv_lnum(&argvars[0]); if (argvars[1].v_type == VAR_LIST) { l = argvars[1].vval.v_list; li = l->lv_first; } else line = get_tv_string_chk(&argvars[1]); /* default result is zero == OK */ for (;;) { if (l != NULL) { /* list argument, get next string */ if (li == NULL) break; line = get_tv_string_chk(&li->li_tv); li = li->li_next; } rettv->vval.v_number = 1; /* FAIL */ if (line == NULL || lnum < 1 || lnum > curbuf->b_ml.ml_line_count + 1) break; /* When coming here from Insert mode, sync undo, so that this can be * undone separately from what was previously inserted. */ if (u_sync_once == 2) { u_sync_once = 1; /* notify that u_sync() was called */ u_sync(TRUE); } if (lnum <= curbuf->b_ml.ml_line_count) { /* existing line, replace it */ if (u_savesub(lnum) == OK && ml_replace(lnum, line, TRUE) == OK) { changed_bytes(lnum, 0); if (lnum == curwin->w_cursor.lnum) check_cursor_col(); rettv->vval.v_number = 0; /* OK */ } } else if (added > 0 || u_save(lnum - 1, lnum) == OK) { /* lnum is one past the last line, append the line */ ++added; if (ml_append(lnum - 1, line, (colnr_T)0, FALSE) == OK) rettv->vval.v_number = 0; /* OK */ } if (l == NULL) /* only one string argument */ break; ++lnum; } if (added > 0) appended_lines_mark(lcount, added); } static void set_qf_ll_list(win_T *wp, typval_T *list_arg, typval_T *action_arg, typval_T *rettv); /* * Used by "setqflist()" and "setloclist()" functions */ static void set_qf_ll_list( win_T *wp UNUSED, typval_T *list_arg UNUSED, typval_T *action_arg UNUSED, typval_T *rettv) { #ifdef FEAT_QUICKFIX char_u *act; int action = ' '; #endif rettv->vval.v_number = -1; #ifdef FEAT_QUICKFIX if (list_arg->v_type != VAR_LIST) EMSG(_(e_listreq)); else { list_T *l = list_arg->vval.v_list; if (action_arg->v_type == VAR_STRING) { act = get_tv_string_chk(action_arg); if (act == NULL) return; /* type error; errmsg already given */ if (*act == 'a' || *act == 'r') action = *act; } if (l != NULL && set_errorlist(wp, l, action, (char_u *)(wp == NULL ? "setqflist()" : "setloclist()")) == OK) rettv->vval.v_number = 0; } #endif } /* * "setloclist()" function */ static void f_setloclist(typval_T *argvars, typval_T *rettv) { win_T *win; rettv->vval.v_number = -1; win = find_win_by_nr(&argvars[0], NULL); if (win != NULL) set_qf_ll_list(win, &argvars[1], &argvars[2], rettv); } /* * "setmatches()" function */ static void f_setmatches(typval_T *argvars UNUSED, typval_T *rettv UNUSED) { #ifdef FEAT_SEARCH_EXTRA list_T *l; listitem_T *li; dict_T *d; list_T *s = NULL; rettv->vval.v_number = -1; if (argvars[0].v_type != VAR_LIST) { EMSG(_(e_listreq)); return; } if ((l = argvars[0].vval.v_list) != NULL) { /* To some extent make sure that we are dealing with a list from * "getmatches()". */ li = l->lv_first; while (li != NULL) { if (li->li_tv.v_type != VAR_DICT || (d = li->li_tv.vval.v_dict) == NULL) { EMSG(_(e_invarg)); return; } if (!(dict_find(d, (char_u *)"group", -1) != NULL && (dict_find(d, (char_u *)"pattern", -1) != NULL || dict_find(d, (char_u *)"pos1", -1) != NULL) && dict_find(d, (char_u *)"priority", -1) != NULL && dict_find(d, (char_u *)"id", -1) != NULL)) { EMSG(_(e_invarg)); return; } li = li->li_next; } clear_matches(curwin); li = l->lv_first; while (li != NULL) { int i = 0; char_u buf[5]; dictitem_T *di; char_u *group; int priority; int id; char_u *conceal; d = li->li_tv.vval.v_dict; if (dict_find(d, (char_u *)"pattern", -1) == NULL) { if (s == NULL) { s = list_alloc(); if (s == NULL) return; } /* match from matchaddpos() */ for (i = 1; i < 9; i++) { sprintf((char *)buf, (char *)"pos%d", i); if ((di = dict_find(d, (char_u *)buf, -1)) != NULL) { if (di->di_tv.v_type != VAR_LIST) return; list_append_tv(s, &di->di_tv); s->lv_refcount++; } else break; } } group = get_dict_string(d, (char_u *)"group", FALSE); priority = (int)get_dict_number(d, (char_u *)"priority"); id = (int)get_dict_number(d, (char_u *)"id"); conceal = dict_find(d, (char_u *)"conceal", -1) != NULL ? get_dict_string(d, (char_u *)"conceal", FALSE) : NULL; if (i == 0) { match_add(curwin, group, get_dict_string(d, (char_u *)"pattern", FALSE), priority, id, NULL, conceal); } else { match_add(curwin, group, NULL, priority, id, s, conceal); list_unref(s); s = NULL; } li = li->li_next; } rettv->vval.v_number = 0; } #endif } /* * "setpos()" function */ static void f_setpos(typval_T *argvars, typval_T *rettv) { pos_T pos; int fnum; char_u *name; colnr_T curswant = -1; rettv->vval.v_number = -1; name = get_tv_string_chk(argvars); if (name != NULL) { if (list2fpos(&argvars[1], &pos, &fnum, &curswant) == OK) { if (--pos.col < 0) pos.col = 0; if (name[0] == '.' && name[1] == NUL) { /* set cursor */ if (fnum == curbuf->b_fnum) { curwin->w_cursor = pos; if (curswant >= 0) { curwin->w_curswant = curswant - 1; curwin->w_set_curswant = FALSE; } check_cursor(); rettv->vval.v_number = 0; } else EMSG(_(e_invarg)); } else if (name[0] == '\'' && name[1] != NUL && name[2] == NUL) { /* set mark */ if (setmark_pos(name[1], &pos, fnum) == OK) rettv->vval.v_number = 0; } else EMSG(_(e_invarg)); } } } /* * "setqflist()" function */ static void f_setqflist(typval_T *argvars, typval_T *rettv) { set_qf_ll_list(NULL, &argvars[0], &argvars[1], rettv); } /* * "setreg()" function */ static void f_setreg(typval_T *argvars, typval_T *rettv) { int regname; char_u *strregname; char_u *stropt; char_u *strval; int append; char_u yank_type; long block_len; block_len = -1; yank_type = MAUTO; append = FALSE; strregname = get_tv_string_chk(argvars); rettv->vval.v_number = 1; /* FAIL is default */ if (strregname == NULL) return; /* type error; errmsg already given */ regname = *strregname; if (regname == 0 || regname == '@') regname = '"'; if (argvars[2].v_type != VAR_UNKNOWN) { stropt = get_tv_string_chk(&argvars[2]); if (stropt == NULL) return; /* type error */ for (; *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; case 'b': case Ctrl_V: /* block-wise selection */ yank_type = MBLOCK; if (VIM_ISDIGIT(stropt[1])) { ++stropt; block_len = getdigits(&stropt) - 1; --stropt; } break; } } if (argvars[1].v_type == VAR_LIST) { char_u **lstval; char_u **allocval; char_u buf[NUMBUFLEN]; char_u **curval; char_u **curallocval; int len = argvars[1].vval.v_list->lv_len; listitem_T *li; /* First half: use for pointers to result lines; second half: use for * pointers to allocated copies. */ lstval = (char_u **)alloc(sizeof(char_u *) * ((len + 1) * 2)); if (lstval == NULL) return; curval = lstval; allocval = lstval + len + 2; curallocval = allocval; for (li = argvars[1].vval.v_list->lv_first; li != NULL; li = li->li_next) { strval = get_tv_string_buf_chk(&li->li_tv, buf); if (strval == NULL) goto free_lstval; if (strval == buf) { /* Need to make a copy, next get_tv_string_buf_chk() will * overwrite the string. */ strval = vim_strsave(buf); if (strval == NULL) goto free_lstval; *curallocval++ = strval; } *curval++ = strval; } *curval++ = NULL; write_reg_contents_lst(regname, lstval, -1, append, yank_type, block_len); free_lstval: while (curallocval > allocval) vim_free(*--curallocval); vim_free(lstval); } else { strval = get_tv_string_chk(&argvars[1]); if (strval == NULL) return; write_reg_contents_ex(regname, strval, -1, append, yank_type, block_len); } rettv->vval.v_number = 0; } /* * "settabvar()" function */ static void f_settabvar(typval_T *argvars, typval_T *rettv) { #ifdef FEAT_WINDOWS tabpage_T *save_curtab; tabpage_T *tp; #endif char_u *varname, *tabvarname; typval_T *varp; rettv->vval.v_number = 0; if (check_restricted() || check_secure()) return; #ifdef FEAT_WINDOWS tp = find_tabpage((int)get_tv_number_chk(&argvars[0], NULL)); #endif varname = get_tv_string_chk(&argvars[1]); varp = &argvars[2]; if (varname != NULL && varp != NULL #ifdef FEAT_WINDOWS && tp != NULL #endif ) { #ifdef FEAT_WINDOWS save_curtab = curtab; goto_tabpage_tp(tp, FALSE, FALSE); #endif tabvarname = alloc((unsigned)STRLEN(varname) + 3); if (tabvarname != NULL) { STRCPY(tabvarname, "t:"); STRCPY(tabvarname + 2, varname); set_var(tabvarname, varp, TRUE); vim_free(tabvarname); } #ifdef FEAT_WINDOWS /* Restore current tabpage */ if (valid_tabpage(save_curtab)) goto_tabpage_tp(save_curtab, FALSE, FALSE); #endif } } /* * "settabwinvar()" function */ static void f_settabwinvar(typval_T *argvars, typval_T *rettv) { setwinvar(argvars, rettv, 1); } /* * "setwinvar()" function */ static void f_setwinvar(typval_T *argvars, typval_T *rettv) { setwinvar(argvars, rettv, 0); } /* * "setwinvar()" and "settabwinvar()" functions */ static void setwinvar(typval_T *argvars, typval_T *rettv UNUSED, int off) { win_T *win; #ifdef FEAT_WINDOWS win_T *save_curwin; tabpage_T *save_curtab; int need_switch_win; #endif char_u *varname, *winvarname; typval_T *varp; char_u nbuf[NUMBUFLEN]; tabpage_T *tp = NULL; if (check_restricted() || check_secure()) return; #ifdef FEAT_WINDOWS if (off == 1) tp = find_tabpage((int)get_tv_number_chk(&argvars[0], NULL)); else tp = curtab; #endif win = find_win_by_nr(&argvars[off], tp); varname = get_tv_string_chk(&argvars[off + 1]); varp = &argvars[off + 2]; if (win != NULL && varname != NULL && varp != NULL) { #ifdef FEAT_WINDOWS need_switch_win = !(tp == curtab && win == curwin); if (!need_switch_win || switch_win(&save_curwin, &save_curtab, win, tp, TRUE) == OK) #endif { if (*varname == '&') { long numval; char_u *strval; int error = FALSE; ++varname; numval = get_tv_number_chk(varp, &error); strval = get_tv_string_buf_chk(varp, nbuf); if (!error && strval != NULL) set_option_value(varname, numval, strval, OPT_LOCAL); } else { winvarname = alloc((unsigned)STRLEN(varname) + 3); if (winvarname != NULL) { STRCPY(winvarname, "w:"); STRCPY(winvarname + 2, varname); set_var(winvarname, varp, TRUE); vim_free(winvarname); } } } #ifdef FEAT_WINDOWS if (need_switch_win) restore_win(save_curwin, save_curtab, TRUE); #endif } } #ifdef FEAT_CRYPT /* * "sha256({string})" function */ static void f_sha256(typval_T *argvars, typval_T *rettv) { char_u *p; p = get_tv_string(&argvars[0]); rettv->vval.v_string = vim_strsave( sha256_bytes(p, (int)STRLEN(p), NULL, 0)); rettv->v_type = VAR_STRING; } #endif /* FEAT_CRYPT */ /* * "shellescape({string})" function */ static void f_shellescape(typval_T *argvars, typval_T *rettv) { rettv->vval.v_string = vim_strsave_shellescape( get_tv_string(&argvars[0]), non_zero_arg(&argvars[1]), TRUE); rettv->v_type = VAR_STRING; } /* * shiftwidth() function */ static void f_shiftwidth(typval_T *argvars UNUSED, typval_T *rettv) { rettv->vval.v_number = get_sw_value(curbuf); } /* * "simplify()" function */ static void f_simplify(typval_T *argvars, typval_T *rettv) { char_u *p; p = get_tv_string(&argvars[0]); rettv->vval.v_string = vim_strsave(p); simplify_filename(rettv->vval.v_string); /* simplify in place */ rettv->v_type = VAR_STRING; } #ifdef FEAT_FLOAT /* * "sin()" function */ static void f_sin(typval_T *argvars, typval_T *rettv) { float_T f = 0.0; rettv->v_type = VAR_FLOAT; if (get_float_arg(argvars, &f) == OK) rettv->vval.v_float = sin(f); else rettv->vval.v_float = 0.0; } /* * "sinh()" function */ static void f_sinh(typval_T *argvars, typval_T *rettv) { float_T f = 0.0; rettv->v_type = VAR_FLOAT; if (get_float_arg(argvars, &f) == OK) rettv->vval.v_float = sinh(f); else rettv->vval.v_float = 0.0; } #endif static int #ifdef __BORLANDC__ _RTLENTRYF #endif item_compare(const void *s1, const void *s2); static int #ifdef __BORLANDC__ _RTLENTRYF #endif item_compare2(const void *s1, const void *s2); /* struct used in the array that's given to qsort() */ typedef struct { listitem_T *item; int idx; } sortItem_T; /* struct storing information about current sort */ typedef struct { int item_compare_ic; int item_compare_numeric; int item_compare_numbers; #ifdef FEAT_FLOAT int item_compare_float; #endif char_u *item_compare_func; partial_T *item_compare_partial; dict_T *item_compare_selfdict; int item_compare_func_err; int item_compare_keep_zero; } sortinfo_T; static sortinfo_T *sortinfo = NULL; static void do_sort_uniq(typval_T *argvars, typval_T *rettv, int sort); #define ITEM_COMPARE_FAIL 999 /* * Compare functions for f_sort() and f_uniq() below. */ static int #ifdef __BORLANDC__ _RTLENTRYF #endif item_compare(const void *s1, const void *s2) { sortItem_T *si1, *si2; typval_T *tv1, *tv2; char_u *p1, *p2; char_u *tofree1 = NULL, *tofree2 = NULL; int res; char_u numbuf1[NUMBUFLEN]; char_u numbuf2[NUMBUFLEN]; si1 = (sortItem_T *)s1; si2 = (sortItem_T *)s2; tv1 = &si1->item->li_tv; tv2 = &si2->item->li_tv; if (sortinfo->item_compare_numbers) { long v1 = get_tv_number(tv1); long v2 = get_tv_number(tv2); return v1 == v2 ? 0 : v1 > v2 ? 1 : -1; } #ifdef FEAT_FLOAT if (sortinfo->item_compare_float) { float_T v1 = get_tv_float(tv1); float_T v2 = get_tv_float(tv2); return v1 == v2 ? 0 : v1 > v2 ? 1 : -1; } #endif /* tv2string() puts quotes around a string and allocates memory. Don't do * that for string variables. Use a single quote when comparing with a * non-string to do what the docs promise. */ if (tv1->v_type == VAR_STRING) { if (tv2->v_type != VAR_STRING || sortinfo->item_compare_numeric) p1 = (char_u *)"'"; else p1 = tv1->vval.v_string; } else p1 = tv2string(tv1, &tofree1, numbuf1, 0); if (tv2->v_type == VAR_STRING) { if (tv1->v_type != VAR_STRING || sortinfo->item_compare_numeric) p2 = (char_u *)"'"; else p2 = tv2->vval.v_string; } else p2 = tv2string(tv2, &tofree2, numbuf2, 0); if (p1 == NULL) p1 = (char_u *)""; if (p2 == NULL) p2 = (char_u *)""; if (!sortinfo->item_compare_numeric) { if (sortinfo->item_compare_ic) res = STRICMP(p1, p2); else res = STRCMP(p1, p2); } else { double n1, n2; n1 = strtod((char *)p1, (char **)&p1); n2 = strtod((char *)p2, (char **)&p2); res = n1 == n2 ? 0 : n1 > n2 ? 1 : -1; } /* When the result would be zero, compare the item indexes. Makes the * sort stable. */ if (res == 0 && !sortinfo->item_compare_keep_zero) res = si1->idx > si2->idx ? 1 : -1; vim_free(tofree1); vim_free(tofree2); return res; } static int #ifdef __BORLANDC__ _RTLENTRYF #endif item_compare2(const void *s1, const void *s2) { sortItem_T *si1, *si2; int res; typval_T rettv; typval_T argv[3]; int dummy; char_u *func_name; partial_T *partial = sortinfo->item_compare_partial; /* shortcut after failure in previous call; compare all items equal */ if (sortinfo->item_compare_func_err) return 0; si1 = (sortItem_T *)s1; si2 = (sortItem_T *)s2; if (partial == NULL) func_name = sortinfo->item_compare_func; else func_name = partial->pt_name; /* Copy the values. This is needed to be able to set v_lock to VAR_FIXED * in the copy without changing the original list items. */ copy_tv(&si1->item->li_tv, &argv[0]); copy_tv(&si2->item->li_tv, &argv[1]); rettv.v_type = VAR_UNKNOWN; /* clear_tv() uses this */ res = call_func(func_name, (int)STRLEN(func_name), &rettv, 2, argv, 0L, 0L, &dummy, TRUE, partial, sortinfo->item_compare_selfdict); clear_tv(&argv[0]); clear_tv(&argv[1]); if (res == FAIL) res = ITEM_COMPARE_FAIL; else res = get_tv_number_chk(&rettv, &sortinfo->item_compare_func_err); if (sortinfo->item_compare_func_err) res = ITEM_COMPARE_FAIL; /* return value has wrong type */ clear_tv(&rettv); /* When the result would be zero, compare the pointers themselves. Makes * the sort stable. */ if (res == 0 && !sortinfo->item_compare_keep_zero) res = si1->idx > si2->idx ? 1 : -1; return res; } /* * "sort({list})" function */ static void do_sort_uniq(typval_T *argvars, typval_T *rettv, int sort) { list_T *l; listitem_T *li; sortItem_T *ptrs; sortinfo_T *old_sortinfo; sortinfo_T info; long len; long i; /* Pointer to current info struct used in compare function. Save and * restore the current one for nested calls. */ old_sortinfo = sortinfo; sortinfo = &info; if (argvars[0].v_type != VAR_LIST) EMSG2(_(e_listarg), sort ? "sort()" : "uniq()"); else { l = argvars[0].vval.v_list; if (l == NULL || tv_check_lock(l->lv_lock, (char_u *)(sort ? N_("sort() argument") : N_("uniq() argument")), TRUE)) goto theend; rettv->vval.v_list = l; rettv->v_type = VAR_LIST; ++l->lv_refcount; len = list_len(l); if (len <= 1) goto theend; /* short list sorts pretty quickly */ info.item_compare_ic = FALSE; info.item_compare_numeric = FALSE; info.item_compare_numbers = FALSE; #ifdef FEAT_FLOAT info.item_compare_float = FALSE; #endif info.item_compare_func = NULL; info.item_compare_partial = NULL; info.item_compare_selfdict = NULL; if (argvars[1].v_type != VAR_UNKNOWN) { /* optional second argument: {func} */ if (argvars[1].v_type == VAR_FUNC) info.item_compare_func = argvars[1].vval.v_string; else if (argvars[1].v_type == VAR_PARTIAL) info.item_compare_partial = argvars[1].vval.v_partial; else { int error = FALSE; i = get_tv_number_chk(&argvars[1], &error); if (error) goto theend; /* type error; errmsg already given */ if (i == 1) info.item_compare_ic = TRUE; else if (argvars[1].v_type != VAR_NUMBER) info.item_compare_func = get_tv_string(&argvars[1]); else if (i != 0) { EMSG(_(e_invarg)); goto theend; } if (info.item_compare_func != NULL) { if (*info.item_compare_func == NUL) { /* empty string means default sort */ info.item_compare_func = NULL; } else if (STRCMP(info.item_compare_func, "n") == 0) { info.item_compare_func = NULL; info.item_compare_numeric = TRUE; } else if (STRCMP(info.item_compare_func, "N") == 0) { info.item_compare_func = NULL; info.item_compare_numbers = TRUE; } #ifdef FEAT_FLOAT else if (STRCMP(info.item_compare_func, "f") == 0) { info.item_compare_func = NULL; info.item_compare_float = TRUE; } #endif else if (STRCMP(info.item_compare_func, "i") == 0) { info.item_compare_func = NULL; info.item_compare_ic = TRUE; } } } if (argvars[2].v_type != VAR_UNKNOWN) { /* optional third argument: {dict} */ if (argvars[2].v_type != VAR_DICT) { EMSG(_(e_dictreq)); goto theend; } info.item_compare_selfdict = argvars[2].vval.v_dict; } } /* Make an array with each entry pointing to an item in the List. */ ptrs = (sortItem_T *)alloc((int)(len * sizeof(sortItem_T))); if (ptrs == NULL) goto theend; i = 0; if (sort) { /* sort(): ptrs will be the list to sort */ for (li = l->lv_first; li != NULL; li = li->li_next) { ptrs[i].item = li; ptrs[i].idx = i; ++i; } info.item_compare_func_err = FALSE; info.item_compare_keep_zero = FALSE; /* test the compare function */ if ((info.item_compare_func != NULL || info.item_compare_partial != NULL) && item_compare2((void *)&ptrs[0], (void *)&ptrs[1]) == ITEM_COMPARE_FAIL) EMSG(_("E702: Sort compare function failed")); else { /* Sort the array with item pointers. */ qsort((void *)ptrs, (size_t)len, sizeof(sortItem_T), info.item_compare_func == NULL && info.item_compare_partial == NULL ? item_compare : item_compare2); if (!info.item_compare_func_err) { /* Clear the List and append the items in sorted order. */ l->lv_first = l->lv_last = l->lv_idx_item = NULL; l->lv_len = 0; for (i = 0; i < len; ++i) list_append(l, ptrs[i].item); } } } else { int (*item_compare_func_ptr)(const void *, const void *); /* f_uniq(): ptrs will be a stack of items to remove */ info.item_compare_func_err = FALSE; info.item_compare_keep_zero = TRUE; item_compare_func_ptr = info.item_compare_func != NULL || info.item_compare_partial != NULL ? item_compare2 : item_compare; for (li = l->lv_first; li != NULL && li->li_next != NULL; li = li->li_next) { if (item_compare_func_ptr((void *)&li, (void *)&li->li_next) == 0) ptrs[i++].item = li; if (info.item_compare_func_err) { EMSG(_("E882: Uniq compare function failed")); break; } } if (!info.item_compare_func_err) { while (--i >= 0) { li = ptrs[i].item->li_next; ptrs[i].item->li_next = li->li_next; if (li->li_next != NULL) li->li_next->li_prev = ptrs[i].item; else l->lv_last = ptrs[i].item; list_fix_watch(l, li); listitem_free(li); l->lv_len--; } } } vim_free(ptrs); } theend: sortinfo = old_sortinfo; } /* * "sort({list})" function */ static void f_sort(typval_T *argvars, typval_T *rettv) { do_sort_uniq(argvars, rettv, TRUE); } /* * "uniq({list})" function */ static void f_uniq(typval_T *argvars, typval_T *rettv) { do_sort_uniq(argvars, rettv, FALSE); } /* * "soundfold({word})" function */ static void f_soundfold(typval_T *argvars, typval_T *rettv) { char_u *s; rettv->v_type = VAR_STRING; s = get_tv_string(&argvars[0]); #ifdef FEAT_SPELL rettv->vval.v_string = eval_soundfold(s); #else rettv->vval.v_string = vim_strsave(s); #endif } /* * "spellbadword()" function */ static void f_spellbadword(typval_T *argvars UNUSED, typval_T *rettv) { char_u *word = (char_u *)""; hlf_T attr = HLF_COUNT; int len = 0; if (rettv_list_alloc(rettv) == FAIL) return; #ifdef FEAT_SPELL if (argvars[0].v_type == VAR_UNKNOWN) { /* Find the start and length of the badly spelled word. */ len = spell_move_to(curwin, FORWARD, TRUE, TRUE, &attr); if (len != 0) word = ml_get_cursor(); } else if (curwin->w_p_spell && *curbuf->b_s.b_p_spl != NUL) { char_u *str = get_tv_string_chk(&argvars[0]); int capcol = -1; if (str != NULL) { /* Check the argument for spelling. */ while (*str != NUL) { len = spell_check(curwin, str, &attr, &capcol, FALSE); if (attr != HLF_COUNT) { word = str; break; } str += len; } } } #endif list_append_string(rettv->vval.v_list, word, len); list_append_string(rettv->vval.v_list, (char_u *)( attr == HLF_SPB ? "bad" : attr == HLF_SPR ? "rare" : attr == HLF_SPL ? "local" : attr == HLF_SPC ? "caps" : ""), -1); } /* * "spellsuggest()" function */ static void f_spellsuggest(typval_T *argvars UNUSED, typval_T *rettv) { #ifdef FEAT_SPELL char_u *str; int typeerr = FALSE; int maxcount; garray_T ga; int i; listitem_T *li; int need_capital = FALSE; #endif if (rettv_list_alloc(rettv) == FAIL) return; #ifdef FEAT_SPELL if (curwin->w_p_spell && *curwin->w_s->b_p_spl != NUL) { str = get_tv_string(&argvars[0]); if (argvars[1].v_type != VAR_UNKNOWN) { maxcount = get_tv_number_chk(&argvars[1], &typeerr); if (maxcount <= 0) return; if (argvars[2].v_type != VAR_UNKNOWN) { need_capital = get_tv_number_chk(&argvars[2], &typeerr); if (typeerr) return; } } else maxcount = 25; spell_suggest_list(&ga, str, maxcount, need_capital, FALSE); for (i = 0; i < ga.ga_len; ++i) { str = ((char_u **)ga.ga_data)[i]; li = listitem_alloc(); if (li == NULL) vim_free(str); else { li->li_tv.v_type = VAR_STRING; li->li_tv.v_lock = 0; li->li_tv.vval.v_string = str; list_append(rettv->vval.v_list, li); } } ga_clear(&ga); } #endif } static void f_split(typval_T *argvars, typval_T *rettv) { char_u *str; char_u *end; char_u *pat = NULL; regmatch_T regmatch; char_u patbuf[NUMBUFLEN]; char_u *save_cpo; int match; colnr_T col = 0; int keepempty = FALSE; int typeerr = FALSE; /* Make 'cpoptions' empty, the 'l' flag should not be used here. */ save_cpo = p_cpo; p_cpo = (char_u *)""; str = get_tv_string(&argvars[0]); if (argvars[1].v_type != VAR_UNKNOWN) { pat = get_tv_string_buf_chk(&argvars[1], patbuf); if (pat == NULL) typeerr = TRUE; if (argvars[2].v_type != VAR_UNKNOWN) keepempty = get_tv_number_chk(&argvars[2], &typeerr); } if (pat == NULL || *pat == NUL) pat = (char_u *)"[\\x01- ]\\+"; if (rettv_list_alloc(rettv) == FAIL) return; if (typeerr) return; regmatch.regprog = vim_regcomp(pat, RE_MAGIC + RE_STRING); if (regmatch.regprog != NULL) { regmatch.rm_ic = FALSE; while (*str != NUL || keepempty) { if (*str == NUL) match = FALSE; /* empty item at the end */ else match = vim_regexec_nl(®match, str, col); if (match) end = regmatch.startp[0]; else end = str + STRLEN(str); if (keepempty || end > str || (rettv->vval.v_list->lv_len > 0 && *str != NUL && match && end < regmatch.endp[0])) { if (list_append_string(rettv->vval.v_list, str, (int)(end - str)) == FAIL) break; } if (!match) break; /* Advance to just after the match. */ if (regmatch.endp[0] > str) col = 0; else { /* Don't get stuck at the same match. */ #ifdef FEAT_MBYTE col = (*mb_ptr2len)(regmatch.endp[0]); #else col = 1; #endif } str = regmatch.endp[0]; } vim_regfree(regmatch.regprog); } p_cpo = save_cpo; } #ifdef FEAT_FLOAT /* * "sqrt()" function */ static void f_sqrt(typval_T *argvars, typval_T *rettv) { float_T f = 0.0; rettv->v_type = VAR_FLOAT; if (get_float_arg(argvars, &f) == OK) rettv->vval.v_float = sqrt(f); else rettv->vval.v_float = 0.0; } /* * "str2float()" function */ static void f_str2float(typval_T *argvars, typval_T *rettv) { char_u *p = skipwhite(get_tv_string(&argvars[0])); if (*p == '+') p = skipwhite(p + 1); (void)string2float(p, &rettv->vval.v_float); rettv->v_type = VAR_FLOAT; } #endif /* * "str2nr()" function */ static void f_str2nr(typval_T *argvars, typval_T *rettv) { int base = 10; char_u *p; long n; int what; if (argvars[1].v_type != VAR_UNKNOWN) { base = get_tv_number(&argvars[1]); if (base != 2 && base != 8 && base != 10 && base != 16) { EMSG(_(e_invarg)); return; } } p = skipwhite(get_tv_string(&argvars[0])); if (*p == '+') p = skipwhite(p + 1); switch (base) { case 2: what = STR2NR_BIN + STR2NR_FORCE; break; case 8: what = STR2NR_OCT + STR2NR_FORCE; break; case 16: what = STR2NR_HEX + STR2NR_FORCE; break; default: what = 0; } vim_str2nr(p, NULL, NULL, what, &n, NULL, 0); rettv->vval.v_number = n; } #ifdef HAVE_STRFTIME /* * "strftime({format}[, {time}])" function */ static void f_strftime(typval_T *argvars, typval_T *rettv) { char_u result_buf[256]; struct tm *curtime; time_t seconds; char_u *p; rettv->v_type = VAR_STRING; p = get_tv_string(&argvars[0]); if (argvars[1].v_type == VAR_UNKNOWN) seconds = time(NULL); else seconds = (time_t)get_tv_number(&argvars[1]); curtime = localtime(&seconds); /* MSVC returns NULL for an invalid value of seconds. */ if (curtime == NULL) rettv->vval.v_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) rettv->vval.v_string = string_convert(&conv, result_buf, NULL); else # endif rettv->vval.v_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(typval_T *argvars, typval_T *rettv) { char_u buf[NUMBUFLEN]; char_u *needle; char_u *haystack; char_u *save_haystack; char_u *pos; int start_idx; needle = get_tv_string_chk(&argvars[1]); save_haystack = haystack = get_tv_string_buf_chk(&argvars[0], buf); rettv->vval.v_number = -1; if (needle == NULL || haystack == NULL) return; /* type error; errmsg already given */ if (argvars[2].v_type != VAR_UNKNOWN) { int error = FALSE; start_idx = get_tv_number_chk(&argvars[2], &error); if (error || start_idx >= (int)STRLEN(haystack)) return; if (start_idx >= 0) haystack += start_idx; } pos = (char_u *)strstr((char *)haystack, (char *)needle); if (pos != NULL) rettv->vval.v_number = (varnumber_T)(pos - save_haystack); } /* * "string()" function */ static void f_string(typval_T *argvars, typval_T *rettv) { char_u *tofree; char_u numbuf[NUMBUFLEN]; rettv->v_type = VAR_STRING; rettv->vval.v_string = tv2string(&argvars[0], &tofree, numbuf, get_copyID()); /* Make a copy if we have a value but it's not in allocated memory. */ if (rettv->vval.v_string != NULL && tofree == NULL) rettv->vval.v_string = vim_strsave(rettv->vval.v_string); } /* * "strlen()" function */ static void f_strlen(typval_T *argvars, typval_T *rettv) { rettv->vval.v_number = (varnumber_T)(STRLEN( get_tv_string(&argvars[0]))); } /* * "strchars()" function */ static void f_strchars(typval_T *argvars, typval_T *rettv) { char_u *s = get_tv_string(&argvars[0]); int skipcc = 0; #ifdef FEAT_MBYTE varnumber_T len = 0; int (*func_mb_ptr2char_adv)(char_u **pp); #endif if (argvars[1].v_type != VAR_UNKNOWN) skipcc = get_tv_number_chk(&argvars[1], NULL); if (skipcc < 0 || skipcc > 1) EMSG(_(e_invarg)); else { #ifdef FEAT_MBYTE func_mb_ptr2char_adv = skipcc ? mb_ptr2char_adv : mb_cptr2char_adv; while (*s != NUL) { func_mb_ptr2char_adv(&s); ++len; } rettv->vval.v_number = len; #else rettv->vval.v_number = (varnumber_T)(STRLEN(s)); #endif } } /* * "strdisplaywidth()" function */ static void f_strdisplaywidth(typval_T *argvars, typval_T *rettv) { char_u *s = get_tv_string(&argvars[0]); int col = 0; if (argvars[1].v_type != VAR_UNKNOWN) col = get_tv_number(&argvars[1]); rettv->vval.v_number = (varnumber_T)(linetabsize_col(col, s) - col); } /* * "strwidth()" function */ static void f_strwidth(typval_T *argvars, typval_T *rettv) { char_u *s = get_tv_string(&argvars[0]); rettv->vval.v_number = (varnumber_T)( #ifdef FEAT_MBYTE mb_string2cells(s, -1) #else STRLEN(s) #endif ); } /* * "strpart()" function */ static void f_strpart(typval_T *argvars, typval_T *rettv) { char_u *p; int n; int len; int slen; int error = FALSE; p = get_tv_string(&argvars[0]); slen = (int)STRLEN(p); n = get_tv_number_chk(&argvars[1], &error); if (error) len = 0; else if (argvars[2].v_type != VAR_UNKNOWN) len = get_tv_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; rettv->v_type = VAR_STRING; rettv->vval.v_string = vim_strnsave(p + n, len); } /* * "strridx()" function */ static void f_strridx(typval_T *argvars, typval_T *rettv) { char_u buf[NUMBUFLEN]; char_u *needle; char_u *haystack; char_u *rest; char_u *lastmatch = NULL; int haystack_len, end_idx; needle = get_tv_string_chk(&argvars[1]); haystack = get_tv_string_buf_chk(&argvars[0], buf); rettv->vval.v_number = -1; if (needle == NULL || haystack == NULL) return; /* type error; errmsg already given */ haystack_len = (int)STRLEN(haystack); if (argvars[2].v_type != VAR_UNKNOWN) { /* Third argument: upper limit for index */ end_idx = get_tv_number_chk(&argvars[2], NULL); if (end_idx < 0) return; /* can never find a match */ } else end_idx = haystack_len; if (*needle == NUL) { /* Empty string matches past the end. */ lastmatch = haystack + end_idx; } else { for (rest = haystack; *rest != '\0'; ++rest) { rest = (char_u *)strstr((char *)rest, (char *)needle); if (rest == NULL || rest > haystack + end_idx) break; lastmatch = rest; } } if (lastmatch == NULL) rettv->vval.v_number = -1; else rettv->vval.v_number = (varnumber_T)(lastmatch - haystack); } /* * "strtrans()" function */ static void f_strtrans(typval_T *argvars, typval_T *rettv) { rettv->v_type = VAR_STRING; rettv->vval.v_string = transstr(get_tv_string(&argvars[0])); } /* * "submatch()" function */ static void f_submatch(typval_T *argvars, typval_T *rettv) { int error = FALSE; int no; int retList = 0; no = (int)get_tv_number_chk(&argvars[0], &error); if (error) return; error = FALSE; if (argvars[1].v_type != VAR_UNKNOWN) retList = get_tv_number_chk(&argvars[1], &error); if (error) return; if (retList == 0) { rettv->v_type = VAR_STRING; rettv->vval.v_string = reg_submatch(no); } else { rettv->v_type = VAR_LIST; rettv->vval.v_list = reg_submatch_list(no); } } /* * "substitute()" function */ static void f_substitute(typval_T *argvars, typval_T *rettv) { char_u patbuf[NUMBUFLEN]; char_u subbuf[NUMBUFLEN]; char_u flagsbuf[NUMBUFLEN]; char_u *str = get_tv_string_chk(&argvars[0]); char_u *pat = get_tv_string_buf_chk(&argvars[1], patbuf); char_u *sub = get_tv_string_buf_chk(&argvars[2], subbuf); char_u *flg = get_tv_string_buf_chk(&argvars[3], flagsbuf); rettv->v_type = VAR_STRING; if (str == NULL || pat == NULL || sub == NULL || flg == NULL) rettv->vval.v_string = NULL; else rettv->vval.v_string = do_string_sub(str, pat, sub, flg); } /* * "synID(lnum, col, trans)" function */ static void f_synID(typval_T *argvars UNUSED, typval_T *rettv) { int id = 0; #ifdef FEAT_SYN_HL long lnum; long col; int trans; int transerr = FALSE; lnum = get_tv_lnum(argvars); /* -1 on type error */ col = get_tv_number(&argvars[1]) - 1; /* -1 on type error */ trans = get_tv_number_chk(&argvars[2], &transerr); if (!transerr && lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count && col >= 0 && col < (long)STRLEN(ml_get(lnum))) id = syn_get_id(curwin, lnum, (colnr_T)col, trans, NULL, FALSE); #endif rettv->vval.v_number = id; } /* * "synIDattr(id, what [, mode])" function */ static void f_synIDattr(typval_T *argvars UNUSED, typval_T *rettv) { char_u *p = NULL; #ifdef FEAT_SYN_HL int id; char_u *what; char_u *mode; char_u modebuf[NUMBUFLEN]; int modec; id = get_tv_number(&argvars[0]); what = get_tv_string(&argvars[1]); if (argvars[2].v_type != VAR_UNKNOWN) { mode = get_tv_string_buf(&argvars[2], modebuf); modec = TOLOWER_ASC(mode[0]); if (modec != 't' && modec != 'c' && modec != 'g') 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[#] or font */ 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': if (TOLOWER_ASC(what[1]) == 'p') /* sp[#] */ p = highlight_color(id, what, modec); else /* standout */ p = highlight_has_attr(id, HL_STANDOUT, modec); break; case 'u': if (STRLEN(what) <= 5 || TOLOWER_ASC(what[5]) != 'c') /* underline */ p = highlight_has_attr(id, HL_UNDERLINE, modec); else /* undercurl */ p = highlight_has_attr(id, HL_UNDERCURL, modec); break; } if (p != NULL) p = vim_strsave(p); #endif rettv->v_type = VAR_STRING; rettv->vval.v_string = p; } /* * "synIDtrans(id)" function */ static void f_synIDtrans(typval_T *argvars UNUSED, typval_T *rettv) { int id; #ifdef FEAT_SYN_HL id = get_tv_number(&argvars[0]); if (id > 0) id = syn_get_final_id(id); else #endif id = 0; rettv->vval.v_number = id; } /* * "synconcealed(lnum, col)" function */ static void f_synconcealed(typval_T *argvars UNUSED, typval_T *rettv) { #if defined(FEAT_SYN_HL) && defined(FEAT_CONCEAL) long lnum; long col; int syntax_flags = 0; int cchar; int matchid = 0; char_u str[NUMBUFLEN]; #endif rettv->v_type = VAR_LIST; rettv->vval.v_list = NULL; #if defined(FEAT_SYN_HL) && defined(FEAT_CONCEAL) lnum = get_tv_lnum(argvars); /* -1 on type error */ col = get_tv_number(&argvars[1]) - 1; /* -1 on type error */ vim_memset(str, NUL, sizeof(str)); if (rettv_list_alloc(rettv) != FAIL) { if (lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count && col >= 0 && col <= (long)STRLEN(ml_get(lnum)) && curwin->w_p_cole > 0) { (void)syn_get_id(curwin, lnum, col, FALSE, NULL, FALSE); syntax_flags = get_syntax_info(&matchid); /* get the conceal character */ if ((syntax_flags & HL_CONCEAL) && curwin->w_p_cole < 3) { cchar = syn_get_sub_char(); if (cchar == NUL && curwin->w_p_cole == 1 && lcs_conceal != NUL) cchar = lcs_conceal; if (cchar != NUL) { # ifdef FEAT_MBYTE if (has_mbyte) (*mb_char2bytes)(cchar, str); else # endif str[0] = cchar; } } } list_append_number(rettv->vval.v_list, (syntax_flags & HL_CONCEAL) != 0); /* -1 to auto-determine strlen */ list_append_string(rettv->vval.v_list, str, -1); list_append_number(rettv->vval.v_list, matchid); } #endif } /* * "synstack(lnum, col)" function */ static void f_synstack(typval_T *argvars UNUSED, typval_T *rettv) { #ifdef FEAT_SYN_HL long lnum; long col; int i; int id; #endif rettv->v_type = VAR_LIST; rettv->vval.v_list = NULL; #ifdef FEAT_SYN_HL lnum = get_tv_lnum(argvars); /* -1 on type error */ col = get_tv_number(&argvars[1]) - 1; /* -1 on type error */ if (lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count && col >= 0 && col <= (long)STRLEN(ml_get(lnum)) && rettv_list_alloc(rettv) != FAIL) { (void)syn_get_id(curwin, lnum, (colnr_T)col, FALSE, NULL, TRUE); for (i = 0; ; ++i) { id = syn_get_stack_item(i); if (id < 0) break; if (list_append_number(rettv->vval.v_list, id) == FAIL) break; } } #endif } static void get_cmd_output_as_rettv( typval_T *argvars, typval_T *rettv, int retlist) { char_u *res = NULL; char_u *p; char_u *infile = NULL; char_u buf[NUMBUFLEN]; int err = FALSE; FILE *fd; list_T *list = NULL; int flags = SHELL_SILENT; rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; if (check_restricted() || check_secure()) goto errret; if (argvars[1].v_type != VAR_UNKNOWN) { /* * Write the string to a temp file, to be used for input of the shell * command. */ if ((infile = vim_tempname('i', TRUE)) == NULL) { EMSG(_(e_notmp)); goto errret; } fd = mch_fopen((char *)infile, WRITEBIN); if (fd == NULL) { EMSG2(_(e_notopen), infile); goto errret; } if (argvars[1].v_type == VAR_LIST) { if (write_list(fd, argvars[1].vval.v_list, TRUE) == FAIL) err = TRUE; } else { size_t len; p = get_tv_string_buf_chk(&argvars[1], buf); if (p == NULL) { fclose(fd); goto errret; /* type error; errmsg already given */ } len = STRLEN(p); if (len > 0 && fwrite(p, len, 1, fd) != 1) err = TRUE; } if (fclose(fd) != 0) err = TRUE; if (err) { EMSG(_("E677: Error writing temp file")); goto errret; } } /* Omit SHELL_COOKED when invoked with ":silent". Avoids that the shell * echoes typeahead, that messes up the display. */ if (!msg_silent) flags += SHELL_COOKED; if (retlist) { int len; listitem_T *li; char_u *s = NULL; char_u *start; char_u *end; int i; res = get_cmd_output(get_tv_string(&argvars[0]), infile, flags, &len); if (res == NULL) goto errret; list = list_alloc(); if (list == NULL) goto errret; for (i = 0; i < len; ++i) { start = res + i; while (i < len && res[i] != NL) ++i; end = res + i; s = alloc((unsigned)(end - start + 1)); if (s == NULL) goto errret; for (p = s; start < end; ++p, ++start) *p = *start == NUL ? NL : *start; *p = NUL; li = listitem_alloc(); if (li == NULL) { vim_free(s); goto errret; } li->li_tv.v_type = VAR_STRING; li->li_tv.v_lock = 0; li->li_tv.vval.v_string = s; list_append(list, li); } ++list->lv_refcount; rettv->v_type = VAR_LIST; rettv->vval.v_list = list; list = NULL; } else { res = get_cmd_output(get_tv_string(&argvars[0]), infile, flags, NULL); #ifdef USE_CR /* translate into */ if (res != NULL) { char_u *s; for (s = res; *s; ++s) { if (*s == CAR) *s = NL; } } #else # ifdef USE_CRNL /* translate into */ if (res != NULL) { char_u *s, *d; d = res; for (s = res; *s; ++s) { if (s[0] == CAR && s[1] == NL) ++s; *d++ = *s; } *d = NUL; } # endif #endif rettv->vval.v_string = res; res = NULL; } errret: if (infile != NULL) { mch_remove(infile); vim_free(infile); } if (res != NULL) vim_free(res); if (list != NULL) list_free(list, TRUE); } /* * "system()" function */ static void f_system(typval_T *argvars, typval_T *rettv) { get_cmd_output_as_rettv(argvars, rettv, FALSE); } /* * "systemlist()" function */ static void f_systemlist(typval_T *argvars, typval_T *rettv) { get_cmd_output_as_rettv(argvars, rettv, TRUE); } /* * "tabpagebuflist()" function */ static void f_tabpagebuflist(typval_T *argvars UNUSED, typval_T *rettv UNUSED) { #ifdef FEAT_WINDOWS tabpage_T *tp; win_T *wp = NULL; if (argvars[0].v_type == VAR_UNKNOWN) wp = firstwin; else { tp = find_tabpage((int)get_tv_number(&argvars[0])); if (tp != NULL) wp = (tp == curtab) ? firstwin : tp->tp_firstwin; } if (wp != NULL && rettv_list_alloc(rettv) != FAIL) { for (; wp != NULL; wp = wp->w_next) if (list_append_number(rettv->vval.v_list, wp->w_buffer->b_fnum) == FAIL) break; } #endif } /* * "tabpagenr()" function */ static void f_tabpagenr(typval_T *argvars UNUSED, typval_T *rettv) { int nr = 1; #ifdef FEAT_WINDOWS char_u *arg; if (argvars[0].v_type != VAR_UNKNOWN) { arg = get_tv_string_chk(&argvars[0]); nr = 0; if (arg != NULL) { if (STRCMP(arg, "$") == 0) nr = tabpage_index(NULL) - 1; else EMSG2(_(e_invexpr2), arg); } } else nr = tabpage_index(curtab); #endif rettv->vval.v_number = nr; } #ifdef FEAT_WINDOWS static int get_winnr(tabpage_T *tp, typval_T *argvar); /* * Common code for tabpagewinnr() and winnr(). */ static int get_winnr(tabpage_T *tp, typval_T *argvar) { win_T *twin; int nr = 1; win_T *wp; char_u *arg; twin = (tp == curtab) ? curwin : tp->tp_curwin; if (argvar->v_type != VAR_UNKNOWN) { arg = get_tv_string_chk(argvar); if (arg == NULL) nr = 0; /* type error; errmsg already given */ else if (STRCMP(arg, "$") == 0) twin = (tp == curtab) ? lastwin : tp->tp_lastwin; else if (STRCMP(arg, "#") == 0) { twin = (tp == curtab) ? prevwin : tp->tp_prevwin; if (twin == NULL) nr = 0; } else { EMSG2(_(e_invexpr2), arg); nr = 0; } } if (nr > 0) for (wp = (tp == curtab) ? firstwin : tp->tp_firstwin; wp != twin; wp = wp->w_next) { if (wp == NULL) { /* didn't find it in this tabpage */ nr = 0; break; } ++nr; } return nr; } #endif /* * "tabpagewinnr()" function */ static void f_tabpagewinnr(typval_T *argvars UNUSED, typval_T *rettv) { int nr = 1; #ifdef FEAT_WINDOWS tabpage_T *tp; tp = find_tabpage((int)get_tv_number(&argvars[0])); if (tp == NULL) nr = 0; else nr = get_winnr(tp, &argvars[1]); #endif rettv->vval.v_number = nr; } /* * "tagfiles()" function */ static void f_tagfiles(typval_T *argvars UNUSED, typval_T *rettv) { char_u *fname; tagname_T tn; int first; if (rettv_list_alloc(rettv) == FAIL) return; fname = alloc(MAXPATHL); if (fname == NULL) return; for (first = TRUE; ; first = FALSE) if (get_tagfname(&tn, first, fname) == FAIL || list_append_string(rettv->vval.v_list, fname, -1) == FAIL) break; tagname_free(&tn); vim_free(fname); } /* * "taglist()" function */ static void f_taglist(typval_T *argvars, typval_T *rettv) { char_u *tag_pattern; tag_pattern = get_tv_string(&argvars[0]); rettv->vval.v_number = FALSE; if (*tag_pattern == NUL) return; if (rettv_list_alloc(rettv) == OK) (void)get_tags(rettv->vval.v_list, tag_pattern); } /* * "tempname()" function */ static void f_tempname(typval_T *argvars UNUSED, typval_T *rettv) { static int x = 'A'; rettv->v_type = VAR_STRING; rettv->vval.v_string = vim_tempname(x, FALSE); /* 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'); } /* * "test(list)" function: Just checking the walls... */ static void f_test(typval_T *argvars UNUSED, typval_T *rettv UNUSED) { /* Used for unit testing. Change the code below to your liking. */ #if 0 listitem_T *li; list_T *l; char_u *bad, *good; if (argvars[0].v_type != VAR_LIST) return; l = argvars[0].vval.v_list; if (l == NULL) return; li = l->lv_first; if (li == NULL) return; bad = get_tv_string(&li->li_tv); li = li->li_next; if (li == NULL) return; good = get_tv_string(&li->li_tv); rettv->vval.v_number = test_edit_score(bad, good); #endif } #ifdef FEAT_FLOAT /* * "tan()" function */ static void f_tan(typval_T *argvars, typval_T *rettv) { float_T f = 0.0; rettv->v_type = VAR_FLOAT; if (get_float_arg(argvars, &f) == OK) rettv->vval.v_float = tan(f); else rettv->vval.v_float = 0.0; } /* * "tanh()" function */ static void f_tanh(typval_T *argvars, typval_T *rettv) { float_T f = 0.0; rettv->v_type = VAR_FLOAT; if (get_float_arg(argvars, &f) == OK) rettv->vval.v_float = tanh(f); else rettv->vval.v_float = 0.0; } #endif #if defined(FEAT_JOB_CHANNEL) || defined(FEAT_TIMERS) || defined(PROTO) /* * Get a callback from "arg". It can be a Funcref or a function name. * When "arg" is zero return an empty string. * Return NULL for an invalid argument. */ char_u * get_callback(typval_T *arg, partial_T **pp) { if (arg->v_type == VAR_PARTIAL && arg->vval.v_partial != NULL) { *pp = arg->vval.v_partial; ++(*pp)->pt_refcount; return (*pp)->pt_name; } *pp = NULL; if (arg->v_type == VAR_FUNC || arg->v_type == VAR_STRING) return arg->vval.v_string; if (arg->v_type == VAR_NUMBER && arg->vval.v_number == 0) return (char_u *)""; EMSG(_("E921: Invalid callback argument")); return NULL; } #endif #ifdef FEAT_TIMERS /* * "timer_start(time, callback [, options])" function */ static void f_timer_start(typval_T *argvars, typval_T *rettv) { long msec = get_tv_number(&argvars[0]); timer_T *timer; int repeat = 0; char_u *callback; dict_T *dict; if (argvars[2].v_type != VAR_UNKNOWN) { if (argvars[2].v_type != VAR_DICT || (dict = argvars[2].vval.v_dict) == NULL) { EMSG2(_(e_invarg2), get_tv_string(&argvars[2])); return; } if (dict_find(dict, (char_u *)"repeat", -1) != NULL) repeat = get_dict_number(dict, (char_u *)"repeat"); } timer = create_timer(msec, repeat); callback = get_callback(&argvars[1], &timer->tr_partial); if (callback == NULL) { stop_timer(timer); rettv->vval.v_number = -1; } else { timer->tr_callback = vim_strsave(callback); rettv->vval.v_number = timer->tr_id; } } /* * "timer_stop(timer)" function */ static void f_timer_stop(typval_T *argvars, typval_T *rettv UNUSED) { timer_T *timer = find_timer(get_tv_number(&argvars[0])); if (timer != NULL) stop_timer(timer); } #endif /* * "tolower(string)" function */ static void f_tolower(typval_T *argvars, typval_T *rettv) { char_u *p; p = vim_strsave(get_tv_string(&argvars[0])); rettv->v_type = VAR_STRING; rettv->vval.v_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(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)(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(typval_T *argvars, typval_T *rettv) { rettv->v_type = VAR_STRING; rettv->vval.v_string = strup_save(get_tv_string(&argvars[0])); } /* * "tr(string, fromstr, tostr)" function */ static void f_tr(typval_T *argvars, typval_T *rettv) { char_u *in_str; char_u *fromstr; char_u *tostr; char_u *p; #ifdef FEAT_MBYTE int inlen; int fromlen; int tolen; int idx; char_u *cpstr; int cplen; int first = TRUE; #endif char_u buf[NUMBUFLEN]; char_u buf2[NUMBUFLEN]; garray_T ga; in_str = get_tv_string(&argvars[0]); fromstr = get_tv_string_buf_chk(&argvars[1], buf); tostr = get_tv_string_buf_chk(&argvars[2], buf2); /* Default return value: empty string. */ rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; if (fromstr == NULL || tostr == NULL) return; /* type error; errmsg already given */ ga_init2(&ga, (int)sizeof(char), 80); #ifdef FEAT_MBYTE if (!has_mbyte) #endif /* not multi-byte: fromstr and tostr must be the same length */ if (STRLEN(fromstr) != STRLEN(tostr)) { #ifdef FEAT_MBYTE error: #endif EMSG2(_(e_invarg2), fromstr); ga_clear(&ga); return; } /* fromstr and tostr have to contain the same number of chars */ while (*in_str != NUL) { #ifdef FEAT_MBYTE if (has_mbyte) { inlen = (*mb_ptr2len)(in_str); cpstr = in_str; cplen = inlen; idx = 0; for (p = fromstr; *p != NUL; p += fromlen) { fromlen = (*mb_ptr2len)(p); if (fromlen == inlen && STRNCMP(in_str, p, inlen) == 0) { for (p = tostr; *p != NUL; p += tolen) { tolen = (*mb_ptr2len)(p); if (idx-- == 0) { cplen = tolen; cpstr = p; break; } } if (*p == NUL) /* tostr is shorter than fromstr */ goto error; break; } ++idx; } if (first && cpstr == in_str) { /* Check that fromstr and tostr have the same number of * (multi-byte) characters. Done only once when a character * of in_str doesn't appear in fromstr. */ first = FALSE; for (p = tostr; *p != NUL; p += tolen) { tolen = (*mb_ptr2len)(p); --idx; } if (idx != 0) goto error; } (void)ga_grow(&ga, cplen); mch_memmove((char *)ga.ga_data + ga.ga_len, cpstr, (size_t)cplen); ga.ga_len += cplen; in_str += inlen; } else #endif { /* When not using multi-byte chars we can do it faster. */ p = vim_strchr(fromstr, *in_str); if (p != NULL) ga_append(&ga, tostr[p - fromstr]); else ga_append(&ga, *in_str); ++in_str; } } /* add a terminating NUL */ (void)ga_grow(&ga, 1); ga_append(&ga, NUL); rettv->vval.v_string = ga.ga_data; } #ifdef FEAT_FLOAT /* * "trunc({float})" function */ static void f_trunc(typval_T *argvars, typval_T *rettv) { float_T f = 0.0; rettv->v_type = VAR_FLOAT; if (get_float_arg(argvars, &f) == OK) /* trunc() is not in C90, use floor() or ceil() instead. */ rettv->vval.v_float = f > 0 ? floor(f) : ceil(f); else rettv->vval.v_float = 0.0; } #endif /* * "type(expr)" function */ static void f_type(typval_T *argvars, typval_T *rettv) { int n = -1; switch (argvars[0].v_type) { case VAR_NUMBER: n = 0; break; case VAR_STRING: n = 1; break; case VAR_PARTIAL: case VAR_FUNC: n = 2; break; case VAR_LIST: n = 3; break; case VAR_DICT: n = 4; break; case VAR_FLOAT: n = 5; break; case VAR_SPECIAL: if (argvars[0].vval.v_number == VVAL_FALSE || argvars[0].vval.v_number == VVAL_TRUE) n = 6; else n = 7; break; case VAR_JOB: n = 8; break; case VAR_CHANNEL: n = 9; break; case VAR_UNKNOWN: EMSG2(_(e_intern2), "f_type(UNKNOWN)"); n = -1; break; } rettv->vval.v_number = n; } /* * "undofile(name)" function */ static void f_undofile(typval_T *argvars UNUSED, typval_T *rettv) { rettv->v_type = VAR_STRING; #ifdef FEAT_PERSISTENT_UNDO { char_u *fname = get_tv_string(&argvars[0]); if (*fname == NUL) { /* If there is no file name there will be no undo file. */ rettv->vval.v_string = NULL; } else { char_u *ffname = FullName_save(fname, FALSE); if (ffname != NULL) rettv->vval.v_string = u_get_undo_file_name(ffname, FALSE); vim_free(ffname); } } #else rettv->vval.v_string = NULL; #endif } /* * "undotree()" function */ static void f_undotree(typval_T *argvars UNUSED, typval_T *rettv) { if (rettv_dict_alloc(rettv) == OK) { dict_T *dict = rettv->vval.v_dict; list_T *list; dict_add_nr_str(dict, "synced", (long)curbuf->b_u_synced, NULL); dict_add_nr_str(dict, "seq_last", curbuf->b_u_seq_last, NULL); dict_add_nr_str(dict, "save_last", (long)curbuf->b_u_save_nr_last, NULL); dict_add_nr_str(dict, "seq_cur", curbuf->b_u_seq_cur, NULL); dict_add_nr_str(dict, "time_cur", (long)curbuf->b_u_time_cur, NULL); dict_add_nr_str(dict, "save_cur", (long)curbuf->b_u_save_nr_cur, NULL); list = list_alloc(); if (list != NULL) { u_eval_tree(curbuf->b_u_oldhead, list); dict_add_list(dict, "entries", list); } } } /* * "values(dict)" function */ static void f_values(typval_T *argvars, typval_T *rettv) { dict_list(argvars, rettv, 1); } /* * "virtcol(string)" function */ static void f_virtcol(typval_T *argvars, typval_T *rettv) { colnr_T vcol = 0; pos_T *fp; int fnum = curbuf->b_fnum; fp = var2fpos(&argvars[0], FALSE, &fnum); if (fp != NULL && fp->lnum <= curbuf->b_ml.ml_line_count && fnum == curbuf->b_fnum) { getvvcol(curwin, fp, NULL, NULL, &vcol); ++vcol; } rettv->vval.v_number = vcol; } /* * "visualmode()" function */ static void f_visualmode(typval_T *argvars, typval_T *rettv) { char_u str[2]; rettv->v_type = VAR_STRING; str[0] = curbuf->b_visual_mode_eval; str[1] = NUL; rettv->vval.v_string = vim_strsave(str); /* A non-zero number or non-empty string argument: reset mode. */ if (non_zero_arg(&argvars[0])) curbuf->b_visual_mode_eval = NUL; } /* * "wildmenumode()" function */ static void f_wildmenumode(typval_T *argvars UNUSED, typval_T *rettv UNUSED) { #ifdef FEAT_WILDMENU if (wild_menu_showing) rettv->vval.v_number = 1; #endif } /* * "winbufnr(nr)" function */ static void f_winbufnr(typval_T *argvars, typval_T *rettv) { win_T *wp; wp = find_win_by_nr(&argvars[0], NULL); if (wp == NULL) rettv->vval.v_number = -1; else rettv->vval.v_number = wp->w_buffer->b_fnum; } /* * "wincol()" function */ static void f_wincol(typval_T *argvars UNUSED, typval_T *rettv) { validate_cursor(); rettv->vval.v_number = curwin->w_wcol + 1; } /* * "winheight(nr)" function */ static void f_winheight(typval_T *argvars, typval_T *rettv) { win_T *wp; wp = find_win_by_nr(&argvars[0], NULL); if (wp == NULL) rettv->vval.v_number = -1; else rettv->vval.v_number = wp->w_height; } /* * "winline()" function */ static void f_winline(typval_T *argvars UNUSED, typval_T *rettv) { validate_cursor(); rettv->vval.v_number = curwin->w_wrow + 1; } /* * "winnr()" function */ static void f_winnr(typval_T *argvars UNUSED, typval_T *rettv) { int nr = 1; #ifdef FEAT_WINDOWS nr = get_winnr(curtab, &argvars[0]); #endif rettv->vval.v_number = nr; } /* * "winrestcmd()" function */ static void f_winrestcmd(typval_T *argvars UNUSED, typval_T *rettv) { #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); sprintf((char *)buf, "vert %dresize %d|", winnr, wp->w_width); ga_concat(&ga, buf); ++winnr; } ga_append(&ga, NUL); rettv->vval.v_string = ga.ga_data; #else rettv->vval.v_string = NULL; #endif rettv->v_type = VAR_STRING; } /* * "winrestview()" function */ static void f_winrestview(typval_T *argvars, typval_T *rettv UNUSED) { dict_T *dict; if (argvars[0].v_type != VAR_DICT || (dict = argvars[0].vval.v_dict) == NULL) EMSG(_(e_invarg)); else { if (dict_find(dict, (char_u *)"lnum", -1) != NULL) curwin->w_cursor.lnum = get_dict_number(dict, (char_u *)"lnum"); if (dict_find(dict, (char_u *)"col", -1) != NULL) curwin->w_cursor.col = get_dict_number(dict, (char_u *)"col"); #ifdef FEAT_VIRTUALEDIT if (dict_find(dict, (char_u *)"coladd", -1) != NULL) curwin->w_cursor.coladd = get_dict_number(dict, (char_u *)"coladd"); #endif if (dict_find(dict, (char_u *)"curswant", -1) != NULL) { curwin->w_curswant = get_dict_number(dict, (char_u *)"curswant"); curwin->w_set_curswant = FALSE; } if (dict_find(dict, (char_u *)"topline", -1) != NULL) set_topline(curwin, get_dict_number(dict, (char_u *)"topline")); #ifdef FEAT_DIFF if (dict_find(dict, (char_u *)"topfill", -1) != NULL) curwin->w_topfill = get_dict_number(dict, (char_u *)"topfill"); #endif if (dict_find(dict, (char_u *)"leftcol", -1) != NULL) curwin->w_leftcol = get_dict_number(dict, (char_u *)"leftcol"); if (dict_find(dict, (char_u *)"skipcol", -1) != NULL) curwin->w_skipcol = get_dict_number(dict, (char_u *)"skipcol"); check_cursor(); win_new_height(curwin, curwin->w_height); # ifdef FEAT_WINDOWS win_new_width(curwin, W_WIDTH(curwin)); # endif changed_window_setting(); if (curwin->w_topline <= 0) curwin->w_topline = 1; if (curwin->w_topline > curbuf->b_ml.ml_line_count) curwin->w_topline = curbuf->b_ml.ml_line_count; #ifdef FEAT_DIFF check_topfill(curwin, TRUE); #endif } } /* * "winsaveview()" function */ static void f_winsaveview(typval_T *argvars UNUSED, typval_T *rettv) { dict_T *dict; if (rettv_dict_alloc(rettv) == FAIL) return; dict = rettv->vval.v_dict; dict_add_nr_str(dict, "lnum", (long)curwin->w_cursor.lnum, NULL); dict_add_nr_str(dict, "col", (long)curwin->w_cursor.col, NULL); #ifdef FEAT_VIRTUALEDIT dict_add_nr_str(dict, "coladd", (long)curwin->w_cursor.coladd, NULL); #endif update_curswant(); dict_add_nr_str(dict, "curswant", (long)curwin->w_curswant, NULL); dict_add_nr_str(dict, "topline", (long)curwin->w_topline, NULL); #ifdef FEAT_DIFF dict_add_nr_str(dict, "topfill", (long)curwin->w_topfill, NULL); #endif dict_add_nr_str(dict, "leftcol", (long)curwin->w_leftcol, NULL); dict_add_nr_str(dict, "skipcol", (long)curwin->w_skipcol, NULL); } /* * "winwidth(nr)" function */ static void f_winwidth(typval_T *argvars, typval_T *rettv) { win_T *wp; wp = find_win_by_nr(&argvars[0], NULL); if (wp == NULL) rettv->vval.v_number = -1; else #ifdef FEAT_WINDOWS rettv->vval.v_number = wp->w_width; #else rettv->vval.v_number = Columns; #endif } /* * "wordcount()" function */ static void f_wordcount(typval_T *argvars UNUSED, typval_T *rettv) { if (rettv_dict_alloc(rettv) == FAIL) return; cursor_pos_info(rettv->vval.v_dict); } /* * Write list of strings to file */ static int write_list(FILE *fd, list_T *list, int binary) { listitem_T *li; int c; int ret = OK; char_u *s; for (li = list->lv_first; li != NULL; li = li->li_next) { for (s = get_tv_string(&li->li_tv); *s != NUL; ++s) { if (*s == '\n') c = putc(NUL, fd); else c = putc(*s, fd); if (c == EOF) { ret = FAIL; break; } } if (!binary || li->li_next != NULL) if (putc('\n', fd) == EOF) { ret = FAIL; break; } if (ret == FAIL) { EMSG(_(e_write)); break; } } return ret; } /* * "writefile()" function */ static void f_writefile(typval_T *argvars, typval_T *rettv) { int binary = FALSE; int append = FALSE; char_u *fname; FILE *fd; int ret = 0; if (check_restricted() || check_secure()) return; if (argvars[0].v_type != VAR_LIST) { EMSG2(_(e_listarg), "writefile()"); return; } if (argvars[0].vval.v_list == NULL) return; if (argvars[2].v_type != VAR_UNKNOWN) { if (vim_strchr(get_tv_string(&argvars[2]), 'b') != NULL) binary = TRUE; if (vim_strchr(get_tv_string(&argvars[2]), 'a') != NULL) append = TRUE; } /* Always open the file in binary mode, library functions have a mind of * their own about CR-LF conversion. */ fname = get_tv_string(&argvars[1]); if (*fname == NUL || (fd = mch_fopen((char *)fname, append ? APPENDBIN : WRITEBIN)) == NULL) { EMSG2(_(e_notcreate), *fname == NUL ? (char_u *)_("") : fname); ret = -1; } else { if (write_list(fd, argvars[0].vval.v_list, binary) == FAIL) ret = -1; fclose(fd); } rettv->vval.v_number = ret; } /* * "xor(expr, expr)" function */ static void f_xor(typval_T *argvars, typval_T *rettv) { rettv->vval.v_number = get_tv_number_chk(&argvars[0], NULL) ^ get_tv_number_chk(&argvars[1], NULL); } /* * Translate a String variable into a position. * Returns NULL when there is an error. */ static pos_T * var2fpos( typval_T *varp, int dollar_lnum, /* TRUE when $ is last line */ int *fnum) /* set to fnum for '0, 'A, etc. */ { char_u *name; static pos_T pos; pos_T *pp; /* Argument can be [lnum, col, coladd]. */ if (varp->v_type == VAR_LIST) { list_T *l; int len; int error = FALSE; listitem_T *li; l = varp->vval.v_list; if (l == NULL) return NULL; /* Get the line number */ pos.lnum = list_find_nr(l, 0L, &error); if (error || pos.lnum <= 0 || pos.lnum > curbuf->b_ml.ml_line_count) return NULL; /* invalid line number */ /* Get the column number */ pos.col = list_find_nr(l, 1L, &error); if (error) return NULL; len = (long)STRLEN(ml_get(pos.lnum)); /* We accept "$" for the column number: last column. */ li = list_find(l, 1L); if (li != NULL && li->li_tv.v_type == VAR_STRING && li->li_tv.vval.v_string != NULL && STRCMP(li->li_tv.vval.v_string, "$") == 0) pos.col = len + 1; /* Accept a position up to the NUL after the line. */ if (pos.col == 0 || (int)pos.col > len + 1) return NULL; /* invalid column number */ --pos.col; #ifdef FEAT_VIRTUALEDIT /* Get the virtual offset. Defaults to zero. */ pos.coladd = list_find_nr(l, 2L, &error); if (error) pos.coladd = 0; #endif return &pos; } name = get_tv_string_chk(varp); if (name == NULL) return NULL; if (name[0] == '.') /* cursor */ return &curwin->w_cursor; if (name[0] == 'v' && name[1] == NUL) /* Visual start */ { if (VIsual_active) return &VIsual; return &curwin->w_cursor; } if (name[0] == '\'') /* mark */ { pp = getmark_buf_fnum(curbuf, name[1], FALSE, fnum); if (pp == NULL || pp == (pos_T *)-1 || pp->lnum <= 0) return NULL; return pp; } #ifdef FEAT_VIRTUALEDIT pos.coladd = 0; #endif if (name[0] == 'w' && dollar_lnum) { pos.col = 0; if (name[1] == '0') /* "w0": first visible line */ { update_topline(); pos.lnum = curwin->w_topline; return &pos; } else if (name[1] == '$') /* "w$": last visible line */ { validate_botline(); pos.lnum = curwin->w_botline - 1; return &pos; } } else if (name[0] == '$') /* last column or line */ { if (dollar_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; } /* * Convert list in "arg" into a position and optional file number. * When "fnump" is NULL there is no file number, only 3 items. * Note that the column is passed on as-is, the caller may want to decrement * it to use 1 for the first column. * Return FAIL when conversion is not possible, doesn't check the position for * validity. */ static int list2fpos( typval_T *arg, pos_T *posp, int *fnump, colnr_T *curswantp) { list_T *l = arg->vval.v_list; long i = 0; long n; /* List must be: [fnum, lnum, col, coladd, curswant], where "fnum" is only * there when "fnump" isn't NULL; "coladd" and "curswant" are optional. */ if (arg->v_type != VAR_LIST || l == NULL || l->lv_len < (fnump == NULL ? 2 : 3) || l->lv_len > (fnump == NULL ? 4 : 5)) return FAIL; if (fnump != NULL) { n = list_find_nr(l, i++, NULL); /* fnum */ if (n < 0) return FAIL; if (n == 0) n = curbuf->b_fnum; /* current buffer */ *fnump = n; } n = list_find_nr(l, i++, NULL); /* lnum */ if (n < 0) return FAIL; posp->lnum = n; n = list_find_nr(l, i++, NULL); /* col */ if (n < 0) return FAIL; posp->col = n; #ifdef FEAT_VIRTUALEDIT n = list_find_nr(l, i, NULL); /* off */ if (n < 0) posp->coladd = 0; else posp->coladd = n; #endif if (curswantp != NULL) *curswantp = list_find_nr(l, i + 1, NULL); /* curswant */ return OK; } /* * 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(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(char_u **arg) { char_u *p; int len; /* Find the end of the name. */ for (p = *arg; eval_isnamec(*p); ++p) { if (*p == ':') { /* "s:" is start of "s:var", but "n:" is not and can be used in * slice "[n:]". Also "xx:" is not a namespace. */ len = (int)(p - *arg); if ((len == 1 && vim_strchr(NAMESPACE_CHAR, **arg) == NULL) || len > 1) break; } } 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 variable or function. * Only the name is recognized, does not handle ".key" or "[idx]". * "arg" is advanced to the first non-white character after the name. * Return -1 if curly braces expansion failed. * Return 0 if something else 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_name_len( char_u **arg, char_u **alias, int evaluate, int verbose) { int len; char_u *p; char_u *expr_start; char_u *expr_end; *alias = NULL; /* default to no alias */ if ((*arg)[0] == K_SPECIAL && (*arg)[1] == KS_EXTRA && (*arg)[2] == (int)KE_SNR) { /* hard coded , already translated */ *arg += 3; return get_id_len(arg) + 3; } len = eval_fname_script(*arg); if (len > 0) { /* literal "", "s:" or "" */ *arg += len; } /* * Find the end of the name; check for {} construction. */ p = find_name_end(*arg, &expr_start, &expr_end, len > 0 ? 0 : FNE_CHECK_START); if (expr_start != NULL) { char_u *temp_string; if (!evaluate) { len += (int)(p - *arg); *arg = skipwhite(p); return len; } /* * Include any 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 -1; *alias = temp_string; *arg = skipwhite(p); return (int)STRLEN(temp_string); } len += get_id_len(arg); if (len == 0 && verbose) EMSG2(_(e_invexpr2), *arg); return len; } /* * Find the end of a variable or function name, taking care of magic braces. * If "expr_start" is not NULL then "expr_start" and "expr_end" are set to the * start and end of the first magic braces item. * "flags" can have FNE_INCL_BR and FNE_CHECK_START. * Return a pointer to just after the name. Equal to "arg" if there is no * valid name. */ static char_u * find_name_end( char_u *arg, char_u **expr_start, char_u **expr_end, int flags) { int mb_nest = 0; int br_nest = 0; char_u *p; int len; if (expr_start != NULL) { *expr_start = NULL; *expr_end = NULL; } /* Quick check for valid starting character. */ if ((flags & FNE_CHECK_START) && !eval_isnamec1(*arg) && *arg != '{') return arg; for (p = arg; *p != NUL && (eval_isnamec(*p) || *p == '{' || ((flags & FNE_INCL_BR) && (*p == '[' || *p == '.')) || mb_nest != 0 || br_nest != 0); mb_ptr_adv(p)) { if (*p == '\'') { /* skip over 'string' to avoid counting [ and ] inside it. */ for (p = p + 1; *p != NUL && *p != '\''; mb_ptr_adv(p)) ; if (*p == NUL) break; } else if (*p == '"') { /* skip over "str\"ing" to avoid counting [ and ] inside it. */ for (p = p + 1; *p != NUL && *p != '"'; mb_ptr_adv(p)) if (*p == '\\' && p[1] != NUL) ++p; if (*p == NUL) break; } else if (br_nest == 0 && mb_nest == 0 && *p == ':') { /* "s:" is start of "s:var", but "n:" is not and can be used in * slice "[n:]". Also "xx:" is not a namespace. But {ns}: is. */ len = (int)(p - arg); if ((len == 1 && vim_strchr(NAMESPACE_CHAR, *arg) == NULL) || (len > 1 && p[-1] != '}')) break; } if (mb_nest == 0) { if (*p == '[') ++br_nest; else if (*p == ']') --br_nest; } if (br_nest == 0) { if (*p == '{') { mb_nest++; if (expr_start != NULL && *expr_start == NULL) *expr_start = p; } else if (*p == '}') { mb_nest--; if (expr_start != NULL && mb_nest == 0 && *expr_end == NULL) *expr_end = p; } } } return p; } /* * 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( 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, FALSE); 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, 0); 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; } /* * Return TRUE if character "c" can be used in a variable or function name. * Does not include '{' or '}' for magic braces. */ static int eval_isnamec(int c) { return (ASCII_ISALNUM(c) || c == '_' || c == ':' || c == AUTOLOAD_CHAR); } /* * Return TRUE if character "c" can be used as the first character in a * variable or function name (excluding '{' and '}'). */ static int eval_isnamec1(int c) { return (ASCII_ISALPHA(c) || c == '_'); } /* * Set number v: variable to "val". */ void set_vim_var_nr(int idx, long val) { vimvars[idx].vv_nr = val; } /* * Get number v: variable value. */ long get_vim_var_nr(int idx) { return vimvars[idx].vv_nr; } /* * Get string v: variable value. Uses a static buffer, can only be used once. */ char_u * get_vim_var_str(int idx) { return get_tv_string(&vimvars[idx].vv_tv); } /* * Get List v: variable value. Caller must take care of reference count when * needed. */ list_T * get_vim_var_list(int idx) { return vimvars[idx].vv_list; } /* * Set v:char to character "c". */ void set_vim_var_char(int c) { char_u buf[MB_MAXBYTES + 1]; #ifdef FEAT_MBYTE if (has_mbyte) buf[(*mb_char2bytes)(c, buf)] = NUL; else #endif { buf[0] = c; buf[1] = NUL; } set_vim_var_string(VV_CHAR, buf, -1); } /* * Set v:count to "count" and v:count1 to "count1". * When "set_prevcount" is TRUE first set v:prevcount from v:count. */ void set_vcount( long count, long count1, int set_prevcount) { if (set_prevcount) vimvars[VV_PREVCOUNT].vv_nr = vimvars[VV_COUNT].vv_nr; vimvars[VV_COUNT].vv_nr = count; vimvars[VV_COUNT1].vv_nr = count1; } /* * Set string v: variable to a copy of "val". */ void set_vim_var_string( int idx, char_u *val, int len) /* length of "val" to use or -1 (whole string) */ { clear_tv(&vimvars[idx].vv_di.di_tv); vimvars[idx].vv_type = VAR_STRING; if (val == NULL) vimvars[idx].vv_str = NULL; else if (len == -1) vimvars[idx].vv_str = vim_strsave(val); else vimvars[idx].vv_str = vim_strnsave(val, len); } /* * Set List v: variable to "val". */ void set_vim_var_list(int idx, list_T *val) { clear_tv(&vimvars[idx].vv_di.di_tv); vimvars[idx].vv_type = VAR_LIST; vimvars[idx].vv_list = val; if (val != NULL) ++val->lv_refcount; } /* * Set Dictionary v: variable to "val". */ void set_vim_var_dict(int idx, dict_T *val) { int todo; hashitem_T *hi; clear_tv(&vimvars[idx].vv_di.di_tv); vimvars[idx].vv_type = VAR_DICT; vimvars[idx].vv_dict = val; if (val != NULL) { ++val->dv_refcount; /* Set readonly */ todo = (int)val->dv_hashtab.ht_used; for (hi = val->dv_hashtab.ht_array; todo > 0 ; ++hi) { if (HASHITEM_EMPTY(hi)) continue; --todo; HI2DI(hi)->di_flags = DI_FLAGS_RO | DI_FLAGS_FIX; } } } /* * Set v:register if needed. */ void set_reg_var(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].vv_str == NULL || vimvars[VV_REG].vv_str[0] != c) set_vim_var_string(VV_REG, ®name, 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(char_u *oldval) { if (oldval == NULL) return vimvars[VV_EXCEPTION].vv_str; vimvars[VV_EXCEPTION].vv_str = 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(char_u *oldval) { if (oldval == NULL) return vimvars[VV_THROWPOINT].vv_str; vimvars[VV_THROWPOINT].vv_str = 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(exarg_T *eap, char_u *oldarg) { char_u *oldval; char_u *newval; unsigned len; oldval = vimvars[VV_CMDARG].vv_str; if (eap == NULL) { vim_free(oldval); vimvars[VV_CMDARG].vv_str = oldarg; return NULL; } if (eap->force_bin == FORCE_BIN) len = 6; else if (eap->force_bin == FORCE_NOBIN) len = 8; else len = 0; if (eap->read_edit) len += 7; 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; if (eap->bad_char != 0) len += 7 + 4; /* " ++bad=" + "keep" or "drop" */ # 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->read_edit) STRCAT(newval, " ++edit"); 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); if (eap->bad_char == BAD_KEEP) STRCPY(newval + STRLEN(newval), " ++bad=keep"); else if (eap->bad_char == BAD_DROP) STRCPY(newval + STRLEN(newval), " ++bad=drop"); else if (eap->bad_char != 0) sprintf((char *)newval + STRLEN(newval), " ++bad=%c", eap->bad_char); # endif vimvars[VV_CMDARG].vv_str = newval; return oldval; } #endif /* * Get the value of internal variable "name". * Return OK or FAIL. */ static int get_var_tv( char_u *name, int len, /* length of "name" */ typval_T *rettv, /* NULL when only checking existence */ dictitem_T **dip, /* non-NULL when typval's dict item is needed */ int verbose, /* may give error message */ int no_autoload) /* do not use script autoloading */ { int ret = OK; typval_T *tv = NULL; typval_T atv; dictitem_T *v; int cc; /* 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) { atv.v_type = VAR_NUMBER; atv.vval.v_number = curbuf->b_changedtick; tv = &atv; } /* * Check for user-defined variables. */ else { v = find_var(name, NULL, no_autoload); if (v != NULL) { tv = &v->di_tv; if (dip != NULL) *dip = v; } } if (tv == NULL) { if (rettv != NULL && verbose) EMSG2(_(e_undefvar), name); ret = FAIL; } else if (rettv != NULL) copy_tv(tv, rettv); name[len] = cc; return ret; } /* * Handle expr[expr], expr[expr:expr] subscript and .name lookup. * Also handle function call with Funcref variable: func(expr) * Can all be combined: dict.func(expr)[idx]['func'](expr) */ static int handle_subscript( char_u **arg, typval_T *rettv, int evaluate, /* do more than finding the end */ int verbose) /* give error messages */ { int ret = OK; dict_T *selfdict = NULL; char_u *s; int len; typval_T functv; while (ret == OK && (**arg == '[' || (**arg == '.' && rettv->v_type == VAR_DICT) || (**arg == '(' && (!evaluate || rettv->v_type == VAR_FUNC || rettv->v_type == VAR_PARTIAL))) && !vim_iswhite(*(*arg - 1))) { if (**arg == '(') { partial_T *pt = NULL; /* need to copy the funcref so that we can clear rettv */ if (evaluate) { functv = *rettv; rettv->v_type = VAR_UNKNOWN; /* Invoke the function. Recursive! */ if (functv.v_type == VAR_PARTIAL) { pt = functv.vval.v_partial; s = pt->pt_name; } else s = functv.vval.v_string; } else s = (char_u *)""; ret = get_func_tv(s, (int)STRLEN(s), rettv, arg, curwin->w_cursor.lnum, curwin->w_cursor.lnum, &len, evaluate, pt, selfdict); /* Clear the funcref afterwards, so that deleting it while * evaluating the arguments is possible (see test55). */ if (evaluate) clear_tv(&functv); /* 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_tv(rettv); ret = FAIL; } dict_unref(selfdict); selfdict = NULL; } else /* **arg == '[' || **arg == '.' */ { dict_unref(selfdict); if (rettv->v_type == VAR_DICT) { selfdict = rettv->vval.v_dict; if (selfdict != NULL) ++selfdict->dv_refcount; } else selfdict = NULL; if (eval_index(arg, rettv, evaluate, verbose) == FAIL) { clear_tv(rettv); ret = FAIL; } } } if ((rettv->v_type == VAR_FUNC || rettv->v_type == VAR_PARTIAL) && selfdict != NULL) { char_u *fname = rettv->v_type == VAR_FUNC ? rettv->vval.v_string : rettv->vval.v_partial->pt_name; char_u *tofree = NULL; ufunc_T *fp; char_u fname_buf[FLEN_FIXED + 1]; int error; /* Translate "s:func" to the stored function name. */ fname = fname_trans_sid(fname, fname_buf, &tofree, &error); fp = find_func(fname); vim_free(tofree); /* Turn "dict.Func" into a partial for "Func" with "dict". */ if (fp != NULL && (fp->uf_flags & FC_DICT)) { partial_T *pt = (partial_T *)alloc_clear(sizeof(partial_T)); if (pt != NULL) { pt->pt_refcount = 1; pt->pt_dict = selfdict; selfdict = NULL; if (rettv->v_type == VAR_FUNC) { /* Just a function: Take over the function name and use * selfdict. */ pt->pt_name = rettv->vval.v_string; } else { partial_T *ret_pt = rettv->vval.v_partial; int i; /* Partial: copy the function name, use selfdict and copy * args. Can't take over name or args, the partial might * be referenced elsewhere. */ pt->pt_name = vim_strsave(ret_pt->pt_name); func_ref(pt->pt_name); if (ret_pt->pt_argc > 0) { pt->pt_argv = (typval_T *)alloc( sizeof(typval_T) * ret_pt->pt_argc); if (pt->pt_argv == NULL) /* out of memory: drop the arguments */ pt->pt_argc = 0; else { pt->pt_argc = ret_pt->pt_argc; for (i = 0; i < pt->pt_argc; i++) copy_tv(&ret_pt->pt_argv[i], &pt->pt_argv[i]); } } partial_unref(ret_pt); } rettv->v_type = VAR_PARTIAL; rettv->vval.v_partial = pt; } } } dict_unref(selfdict); return ret; } /* * Allocate memory for a variable type-value, and make it empty (0 or NULL * value). */ typval_T * alloc_tv(void) { return (typval_T *)alloc_clear((unsigned)sizeof(typval_T)); } /* * Allocate memory for a variable type-value, 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 typval_T * alloc_string_tv(char_u *s) { typval_T *rettv; rettv = alloc_tv(); if (rettv != NULL) { rettv->v_type = VAR_STRING; rettv->vval.v_string = s; } else vim_free(s); return rettv; } /* * Free the memory for a variable type-value. */ void free_tv(typval_T *varp) { if (varp != NULL) { switch (varp->v_type) { case VAR_FUNC: func_unref(varp->vval.v_string); /*FALLTHROUGH*/ case VAR_STRING: vim_free(varp->vval.v_string); break; case VAR_PARTIAL: partial_unref(varp->vval.v_partial); break; case VAR_LIST: list_unref(varp->vval.v_list); break; case VAR_DICT: dict_unref(varp->vval.v_dict); break; case VAR_JOB: #ifdef FEAT_JOB_CHANNEL job_unref(varp->vval.v_job); break; #endif case VAR_CHANNEL: #ifdef FEAT_JOB_CHANNEL channel_unref(varp->vval.v_channel); break; #endif case VAR_NUMBER: case VAR_FLOAT: case VAR_UNKNOWN: case VAR_SPECIAL: break; } vim_free(varp); } } /* * Free the memory for a variable value and set the value to NULL or 0. */ void clear_tv(typval_T *varp) { if (varp != NULL) { switch (varp->v_type) { case VAR_FUNC: func_unref(varp->vval.v_string); /*FALLTHROUGH*/ case VAR_STRING: vim_free(varp->vval.v_string); varp->vval.v_string = NULL; break; case VAR_PARTIAL: partial_unref(varp->vval.v_partial); varp->vval.v_partial = NULL; break; case VAR_LIST: list_unref(varp->vval.v_list); varp->vval.v_list = NULL; break; case VAR_DICT: dict_unref(varp->vval.v_dict); varp->vval.v_dict = NULL; break; case VAR_NUMBER: case VAR_SPECIAL: varp->vval.v_number = 0; break; case VAR_FLOAT: #ifdef FEAT_FLOAT varp->vval.v_float = 0.0; break; #endif case VAR_JOB: #ifdef FEAT_JOB_CHANNEL job_unref(varp->vval.v_job); varp->vval.v_job = NULL; #endif break; case VAR_CHANNEL: #ifdef FEAT_JOB_CHANNEL channel_unref(varp->vval.v_channel); varp->vval.v_channel = NULL; #endif case VAR_UNKNOWN: break; } varp->v_lock = 0; } } /* * Set the value of a variable to NULL without freeing items. */ static void init_tv(typval_T *varp) { if (varp != NULL) vim_memset(varp, 0, sizeof(typval_T)); } /* * Get the number value of a variable. * If it is a String variable, uses vim_str2nr(). * For incompatible types, return 0. * get_tv_number_chk() is similar to get_tv_number(), but informs the * caller of incompatible types: it sets *denote to TRUE if "denote" * is not NULL or returns -1 otherwise. */ long get_tv_number(typval_T *varp) { int error = FALSE; return get_tv_number_chk(varp, &error); /* return 0L on error */ } long get_tv_number_chk(typval_T *varp, int *denote) { long n = 0L; switch (varp->v_type) { case VAR_NUMBER: return (long)(varp->vval.v_number); case VAR_FLOAT: #ifdef FEAT_FLOAT EMSG(_("E805: Using a Float as a Number")); break; #endif case VAR_FUNC: case VAR_PARTIAL: EMSG(_("E703: Using a Funcref as a Number")); break; case VAR_STRING: if (varp->vval.v_string != NULL) vim_str2nr(varp->vval.v_string, NULL, NULL, STR2NR_ALL, &n, NULL, 0); return n; case VAR_LIST: EMSG(_("E745: Using a List as a Number")); break; case VAR_DICT: EMSG(_("E728: Using a Dictionary as a Number")); break; case VAR_SPECIAL: return varp->vval.v_number == VVAL_TRUE ? 1 : 0; break; case VAR_JOB: #ifdef FEAT_JOB_CHANNEL EMSG(_("E910: Using a Job as a Number")); break; #endif case VAR_CHANNEL: #ifdef FEAT_JOB_CHANNEL EMSG(_("E913: Using a Channel as a Number")); break; #endif case VAR_UNKNOWN: EMSG2(_(e_intern2), "get_tv_number(UNKNOWN)"); break; } if (denote == NULL) /* useful for values that must be unsigned */ n = -1; else *denote = TRUE; return n; } #ifdef FEAT_FLOAT static float_T get_tv_float(typval_T *varp) { switch (varp->v_type) { case VAR_NUMBER: return (float_T)(varp->vval.v_number); case VAR_FLOAT: return varp->vval.v_float; case VAR_FUNC: case VAR_PARTIAL: EMSG(_("E891: Using a Funcref as a Float")); break; case VAR_STRING: EMSG(_("E892: Using a String as a Float")); break; case VAR_LIST: EMSG(_("E893: Using a List as a Float")); break; case VAR_DICT: EMSG(_("E894: Using a Dictionary as a Float")); break; case VAR_SPECIAL: EMSG(_("E907: Using a special value as a Float")); break; case VAR_JOB: # ifdef FEAT_JOB_CHANNEL EMSG(_("E911: Using a Job as a Float")); break; # endif case VAR_CHANNEL: # ifdef FEAT_JOB_CHANNEL EMSG(_("E914: Using a Channel as a Float")); break; # endif case VAR_UNKNOWN: EMSG2(_(e_intern2), "get_tv_float(UNKNOWN)"); break; } return 0; } #endif /* * Get the lnum from the first argument. * Also accepts ".", "$", etc., but that only works for the current buffer. * Returns -1 on error. */ static linenr_T get_tv_lnum(typval_T *argvars) { typval_T rettv; linenr_T lnum; lnum = get_tv_number_chk(&argvars[0], NULL); if (lnum == 0) /* no valid number, try using line() */ { rettv.v_type = VAR_NUMBER; f_line(argvars, &rettv); lnum = rettv.vval.v_number; clear_tv(&rettv); } return lnum; } /* * Get the lnum from the first argument. * Also accepts "$", then "buf" is used. * Returns 0 on error. */ static linenr_T get_tv_lnum_buf(typval_T *argvars, buf_T *buf) { if (argvars[0].v_type == VAR_STRING && argvars[0].vval.v_string != NULL && argvars[0].vval.v_string[0] == '$' && buf != NULL) return buf->b_ml.ml_line_count; return get_tv_number_chk(&argvars[0], NULL); } /* * Get the string value of a variable. * If it is a Number variable, the number is converted into a string. * get_tv_string() uses a single, static buffer. YOU CAN ONLY USE IT ONCE! * get_tv_string_buf() uses a given buffer. * If the String variable has never been set, return an empty string. * Never returns NULL; * get_tv_string_chk() and get_tv_string_buf_chk() are similar, but return * NULL on error. */ char_u * get_tv_string(typval_T *varp) { static char_u mybuf[NUMBUFLEN]; return get_tv_string_buf(varp, mybuf); } char_u * get_tv_string_buf(typval_T *varp, char_u *buf) { char_u *res = get_tv_string_buf_chk(varp, buf); return res != NULL ? res : (char_u *)""; } /* * Careful: This uses a single, static buffer. YOU CAN ONLY USE IT ONCE! */ char_u * get_tv_string_chk(typval_T *varp) { static char_u mybuf[NUMBUFLEN]; return get_tv_string_buf_chk(varp, mybuf); } char_u * get_tv_string_buf_chk(typval_T *varp, char_u *buf) { switch (varp->v_type) { case VAR_NUMBER: sprintf((char *)buf, "%ld", (long)varp->vval.v_number); return buf; case VAR_FUNC: case VAR_PARTIAL: EMSG(_("E729: using Funcref as a String")); break; case VAR_LIST: EMSG(_("E730: using List as a String")); break; case VAR_DICT: EMSG(_("E731: using Dictionary as a String")); break; case VAR_FLOAT: #ifdef FEAT_FLOAT EMSG(_(e_float_as_string)); break; #endif case VAR_STRING: if (varp->vval.v_string != NULL) return varp->vval.v_string; return (char_u *)""; case VAR_SPECIAL: STRCPY(buf, get_var_special_name(varp->vval.v_number)); return buf; case VAR_JOB: #ifdef FEAT_JOB_CHANNEL { job_T *job = varp->vval.v_job; char *status; if (job == NULL) return (char_u *)"no process"; status = job->jv_status == JOB_FAILED ? "fail" : job->jv_status == JOB_ENDED ? "dead" : "run"; # ifdef UNIX vim_snprintf((char *)buf, NUMBUFLEN, "process %ld %s", (long)job->jv_pid, status); # elif defined(WIN32) vim_snprintf((char *)buf, NUMBUFLEN, "process %ld %s", (long)job->jv_proc_info.dwProcessId, status); # else /* fall-back */ vim_snprintf((char *)buf, NUMBUFLEN, "process ? %s", status); # endif return buf; } #endif break; case VAR_CHANNEL: #ifdef FEAT_JOB_CHANNEL { channel_T *channel = varp->vval.v_channel; char *status = channel_status(channel); if (channel == NULL) vim_snprintf((char *)buf, NUMBUFLEN, "channel %s", status); else vim_snprintf((char *)buf, NUMBUFLEN, "channel %d %s", channel->ch_id, status); return buf; } #endif break; case VAR_UNKNOWN: EMSG(_("E908: using an invalid value as a String")); break; } return NULL; } /* * Find variable "name" in the list of variables. * Return a pointer to it if found, NULL if not found. * Careful: "a:0" variables don't have a name. * When "htp" is not NULL we are writing to the variable, set "htp" to the * hashtab_T used. */ static dictitem_T * find_var(char_u *name, hashtab_T **htp, int no_autoload) { char_u *varname; hashtab_T *ht; ht = find_var_ht(name, &varname); if (htp != NULL) *htp = ht; if (ht == NULL) return NULL; return find_var_in_ht(ht, *name, varname, no_autoload || htp != NULL); } /* * Find variable "varname" in hashtab "ht" with name "htname". * Returns NULL if not found. */ static dictitem_T * find_var_in_ht( hashtab_T *ht, int htname, char_u *varname, int no_autoload) { hashitem_T *hi; if (*varname == NUL) { /* Must be something like "s:", otherwise "ht" would be NULL. */ switch (htname) { case 's': return &SCRIPT_SV(current_SID)->sv_var; case 'g': return &globvars_var; case 'v': return &vimvars_var; case 'b': return &curbuf->b_bufvar; case 'w': return &curwin->w_winvar; #ifdef FEAT_WINDOWS case 't': return &curtab->tp_winvar; #endif case 'l': return current_funccal == NULL ? NULL : ¤t_funccal->l_vars_var; case 'a': return current_funccal == NULL ? NULL : ¤t_funccal->l_avars_var; } return NULL; } hi = hash_find(ht, varname); if (HASHITEM_EMPTY(hi)) { /* For global variables we may try auto-loading the script. If it * worked find the variable again. Don't auto-load a script if it was * loaded already, otherwise it would be loaded every time when * checking if a function name is a Funcref variable. */ if (ht == &globvarht && !no_autoload) { /* Note: script_autoload() may make "hi" invalid. It must either * be obtained again or not used. */ if (!script_autoload(varname, FALSE) || aborting()) return NULL; hi = hash_find(ht, varname); } if (HASHITEM_EMPTY(hi)) return NULL; } return HI2DI(hi); } /* * Find the hashtab used for a variable name. * Return NULL if the name is not valid. * Set "varname" to the start of name without ':'. */ static hashtab_T * find_var_ht(char_u *name, char_u **varname) { hashitem_T *hi; if (name[0] == NUL) return NULL; if (name[1] != ':') { /* The name must not start with a colon or #. */ if (name[0] == ':' || name[0] == AUTOLOAD_CHAR) return NULL; *varname = name; /* "version" is "v:version" in all scopes */ hi = hash_find(&compat_hashtab, name); if (!HASHITEM_EMPTY(hi)) return &compat_hashtab; if (current_funccal == NULL) return &globvarht; /* global variable */ return &get_funccal()->l_vars.dv_hashtab; /* l: variable */ } *varname = name + 2; if (*name == 'g') /* global variable */ return &globvarht; /* There must be no ':' or '#' in the rest of the name, unless g: is used */ if (vim_strchr(name + 2, ':') != NULL || vim_strchr(name + 2, AUTOLOAD_CHAR) != NULL) return NULL; if (*name == 'b') /* buffer variable */ return &curbuf->b_vars->dv_hashtab; if (*name == 'w') /* window variable */ return &curwin->w_vars->dv_hashtab; #ifdef FEAT_WINDOWS if (*name == 't') /* tab page variable */ return &curtab->tp_vars->dv_hashtab; #endif if (*name == 'v') /* v: variable */ return &vimvarht; if (*name == 'a' && current_funccal != NULL) /* function argument */ return &get_funccal()->l_avars.dv_hashtab; if (*name == 'l' && current_funccal != NULL) /* local function variable */ return &get_funccal()->l_vars.dv_hashtab; if (*name == 's' /* script variable */ && current_SID > 0 && current_SID <= ga_scripts.ga_len) return &SCRIPT_VARS(current_SID); return NULL; } /* * Get function call environment based on bactrace debug level */ static funccall_T * get_funccal(void) { int i; funccall_T *funccal; funccall_T *temp_funccal; funccal = current_funccal; if (debug_backtrace_level > 0) { for (i = 0; i < debug_backtrace_level; i++) { temp_funccal = funccal->caller; if (temp_funccal) funccal = temp_funccal; else /* backtrace level overflow. reset to max */ debug_backtrace_level = i; } } return funccal; } /* * Get the string value of a (global/local) variable. * Note: see get_tv_string() for how long the pointer remains valid. * Returns NULL when it doesn't exist. */ char_u * get_var_value(char_u *name) { dictitem_T *v; v = find_var(name, NULL, FALSE); if (v == NULL) return NULL; return get_tv_string(&v->di_tv); } /* * Allocate a new hashtab for a sourced script. It will be used while * sourcing this script and when executing functions defined in the script. */ void new_script_vars(scid_T id) { int i; hashtab_T *ht; scriptvar_T *sv; if (ga_grow(&ga_scripts, (int)(id - ga_scripts.ga_len)) == OK) { /* Re-allocating ga_data means that an ht_array pointing to * ht_smallarray becomes invalid. We can recognize this: ht_mask is * at its init value. Also reset "v_dict", it's always the same. */ for (i = 1; i <= ga_scripts.ga_len; ++i) { ht = &SCRIPT_VARS(i); if (ht->ht_mask == HT_INIT_SIZE - 1) ht->ht_array = ht->ht_smallarray; sv = SCRIPT_SV(i); sv->sv_var.di_tv.vval.v_dict = &sv->sv_dict; } while (ga_scripts.ga_len < id) { sv = SCRIPT_SV(ga_scripts.ga_len + 1) = (scriptvar_T *)alloc_clear(sizeof(scriptvar_T)); init_var_dict(&sv->sv_dict, &sv->sv_var, VAR_SCOPE); ++ga_scripts.ga_len; } } } /* * Initialize dictionary "dict" as a scope and set variable "dict_var" to * point to it. */ void init_var_dict(dict_T *dict, dictitem_T *dict_var, int scope) { hash_init(&dict->dv_hashtab); dict->dv_lock = 0; dict->dv_scope = scope; dict->dv_refcount = DO_NOT_FREE_CNT; dict->dv_copyID = 0; dict_var->di_tv.vval.v_dict = dict; dict_var->di_tv.v_type = VAR_DICT; dict_var->di_tv.v_lock = VAR_FIXED; dict_var->di_flags = DI_FLAGS_RO | DI_FLAGS_FIX; dict_var->di_key[0] = NUL; } /* * Unreference a dictionary initialized by init_var_dict(). */ void unref_var_dict(dict_T *dict) { /* Now the dict needs to be freed if no one else is using it, go back to * normal reference counting. */ dict->dv_refcount -= DO_NOT_FREE_CNT - 1; dict_unref(dict); } /* * Clean up a list of internal variables. * Frees all allocated variables and the value they contain. * Clears hashtab "ht", does not free it. */ void vars_clear(hashtab_T *ht) { vars_clear_ext(ht, TRUE); } /* * Like vars_clear(), but only free the value if "free_val" is TRUE. */ static void vars_clear_ext(hashtab_T *ht, int free_val) { int todo; hashitem_T *hi; dictitem_T *v; hash_lock(ht); todo = (int)ht->ht_used; for (hi = ht->ht_array; todo > 0; ++hi) { if (!HASHITEM_EMPTY(hi)) { --todo; /* Free the variable. Don't remove it from the hashtab, * ht_array might change then. hash_clear() takes care of it * later. */ v = HI2DI(hi); if (free_val) clear_tv(&v->di_tv); if (v->di_flags & DI_FLAGS_ALLOC) vim_free(v); } } hash_clear(ht); ht->ht_used = 0; } /* * Delete a variable from hashtab "ht" at item "hi". * Clear the variable value and free the dictitem. */ static void delete_var(hashtab_T *ht, hashitem_T *hi) { dictitem_T *di = HI2DI(hi); hash_remove(ht, hi); clear_tv(&di->di_tv); vim_free(di); } /* * List the value of one internal variable. */ static void list_one_var(dictitem_T *v, char_u *prefix, int *first) { char_u *tofree; char_u *s; char_u numbuf[NUMBUFLEN]; s = echo_string(&v->di_tv, &tofree, numbuf, get_copyID()); list_one_var_a(prefix, v->di_key, v->di_tv.v_type, s == NULL ? (char_u *)"" : s, first); vim_free(tofree); } static void list_one_var_a( char_u *prefix, char_u *name, int type, char_u *string, int *first) /* when TRUE clear rest of screen and set to FALSE */ { /* don't use msg() or msg_attr() to avoid overwriting "v:statusmsg" */ msg_start(); msg_puts(prefix); 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 if (type == VAR_FUNC || type == VAR_PARTIAL) msg_putchar('*'); else if (type == VAR_LIST) { msg_putchar('['); if (*string == '[') ++string; } else if (type == VAR_DICT) { msg_putchar('{'); if (*string == '{') ++string; } else msg_putchar(' '); msg_outtrans(string); if (type == VAR_FUNC || type == VAR_PARTIAL) msg_puts((char_u *)"()"); if (*first) { msg_clr_eos(); *first = FALSE; } } /* * Set variable "name" to value in "tv". * If the variable already exists, the value is updated. * Otherwise the variable is created. */ static void set_var( char_u *name, typval_T *tv, int copy) /* make copy of value in "tv" */ { dictitem_T *v; char_u *varname; hashtab_T *ht; ht = find_var_ht(name, &varname); if (ht == NULL || *varname == NUL) { EMSG2(_(e_illvar), name); return; } v = find_var_in_ht(ht, 0, varname, TRUE); if ((tv->v_type == VAR_FUNC || tv->v_type == VAR_PARTIAL) && var_check_func_name(name, v == NULL)) return; if (v != NULL) { /* existing variable, need to clear the value */ if (var_check_ro(v->di_flags, name, FALSE) || tv_check_lock(v->di_tv.v_lock, name, FALSE)) return; /* * Handle setting internal v: variables separately where needed to * prevent changing the type. */ if (ht == &vimvarht) { if (v->di_tv.v_type == VAR_STRING) { vim_free(v->di_tv.vval.v_string); if (copy || tv->v_type != VAR_STRING) v->di_tv.vval.v_string = vim_strsave(get_tv_string(tv)); else { /* Take over the string to avoid an extra alloc/free. */ v->di_tv.vval.v_string = tv->vval.v_string; tv->vval.v_string = NULL; } return; } else if (v->di_tv.v_type == VAR_NUMBER) { v->di_tv.vval.v_number = get_tv_number(tv); if (STRCMP(varname, "searchforward") == 0) set_search_direction(v->di_tv.vval.v_number ? '/' : '?'); #ifdef FEAT_SEARCH_EXTRA else if (STRCMP(varname, "hlsearch") == 0) { no_hlsearch = !v->di_tv.vval.v_number; redraw_all_later(SOME_VALID); } #endif return; } else if (v->di_tv.v_type != tv->v_type) EMSG2(_(e_intern2), "set_var()"); } clear_tv(&v->di_tv); } else /* add a new variable */ { /* Can't add "v:" variable. */ if (ht == &vimvarht) { EMSG2(_(e_illvar), name); return; } /* Make sure the variable name is valid. */ if (!valid_varname(varname)) return; v = (dictitem_T *)alloc((unsigned)(sizeof(dictitem_T) + STRLEN(varname))); if (v == NULL) return; STRCPY(v->di_key, varname); if (hash_add(ht, DI2HIKEY(v)) == FAIL) { vim_free(v); return; } v->di_flags = DI_FLAGS_ALLOC; } if (copy || tv->v_type == VAR_NUMBER || tv->v_type == VAR_FLOAT) copy_tv(tv, &v->di_tv); else { v->di_tv = *tv; v->di_tv.v_lock = 0; init_tv(tv); } } /* * Return TRUE if di_flags "flags" indicates variable "name" is read-only. * Also give an error message. */ static int var_check_ro(int flags, char_u *name, int use_gettext) { if (flags & DI_FLAGS_RO) { EMSG2(_(e_readonlyvar), use_gettext ? (char_u *)_(name) : name); return TRUE; } if ((flags & DI_FLAGS_RO_SBX) && sandbox) { EMSG2(_(e_readonlysbx), use_gettext ? (char_u *)_(name) : name); return TRUE; } return FALSE; } /* * Return TRUE if di_flags "flags" indicates variable "name" is fixed. * Also give an error message. */ static int var_check_fixed(int flags, char_u *name, int use_gettext) { if (flags & DI_FLAGS_FIX) { EMSG2(_("E795: Cannot delete variable %s"), use_gettext ? (char_u *)_(name) : name); return TRUE; } return FALSE; } /* * Check if a funcref is assigned to a valid variable name. * Return TRUE and give an error if not. */ static int var_check_func_name( char_u *name, /* points to start of variable name */ int new_var) /* TRUE when creating the variable */ { /* Allow for w: b: s: and t:. */ if (!(vim_strchr((char_u *)"wbst", name[0]) != NULL && name[1] == ':') && !ASCII_ISUPPER((name[0] != NUL && name[1] == ':') ? name[2] : name[0])) { EMSG2(_("E704: Funcref variable name must start with a capital: %s"), name); return TRUE; } /* Don't allow hiding a function. When "v" is not NULL we might be * assigning another function to the same var, the type is checked * below. */ if (new_var && function_exists(name)) { EMSG2(_("E705: Variable name conflicts with existing function: %s"), name); return TRUE; } return FALSE; } /* * Check if a variable name is valid. * Return FALSE and give an error if not. */ static int valid_varname(char_u *varname) { char_u *p; for (p = varname; *p != NUL; ++p) if (!eval_isnamec1(*p) && (p == varname || !VIM_ISDIGIT(*p)) && *p != AUTOLOAD_CHAR) { EMSG2(_(e_illvar), varname); return FALSE; } return TRUE; } /* * Return TRUE if typeval "tv" is set to be locked (immutable). * Also give an error message, using "name" or _("name") when use_gettext is * TRUE. */ static int tv_check_lock(int lock, char_u *name, int use_gettext) { if (lock & VAR_LOCKED) { EMSG2(_("E741: Value is locked: %s"), name == NULL ? (char_u *)_("Unknown") : use_gettext ? (char_u *)_(name) : name); return TRUE; } if (lock & VAR_FIXED) { EMSG2(_("E742: Cannot change value of %s"), name == NULL ? (char_u *)_("Unknown") : use_gettext ? (char_u *)_(name) : name); return TRUE; } return FALSE; } /* * Copy the values from typval_T "from" to typval_T "to". * When needed allocates string or increases reference count. * Does not make a copy of a list or dict but copies the reference! * It is OK for "from" and "to" to point to the same item. This is used to * make a copy later. */ void copy_tv(typval_T *from, typval_T *to) { to->v_type = from->v_type; to->v_lock = 0; switch (from->v_type) { case VAR_NUMBER: case VAR_SPECIAL: to->vval.v_number = from->vval.v_number; break; case VAR_FLOAT: #ifdef FEAT_FLOAT to->vval.v_float = from->vval.v_float; break; #endif case VAR_JOB: #ifdef FEAT_JOB_CHANNEL to->vval.v_job = from->vval.v_job; if (to->vval.v_job != NULL) ++to->vval.v_job->jv_refcount; break; #endif case VAR_CHANNEL: #ifdef FEAT_JOB_CHANNEL to->vval.v_channel = from->vval.v_channel; if (to->vval.v_channel != NULL) ++to->vval.v_channel->ch_refcount; break; #endif case VAR_STRING: case VAR_FUNC: if (from->vval.v_string == NULL) to->vval.v_string = NULL; else { to->vval.v_string = vim_strsave(from->vval.v_string); if (from->v_type == VAR_FUNC) func_ref(to->vval.v_string); } break; case VAR_PARTIAL: if (from->vval.v_partial == NULL) to->vval.v_partial = NULL; else { to->vval.v_partial = from->vval.v_partial; ++to->vval.v_partial->pt_refcount; } break; case VAR_LIST: if (from->vval.v_list == NULL) to->vval.v_list = NULL; else { to->vval.v_list = from->vval.v_list; ++to->vval.v_list->lv_refcount; } break; case VAR_DICT: if (from->vval.v_dict == NULL) to->vval.v_dict = NULL; else { to->vval.v_dict = from->vval.v_dict; ++to->vval.v_dict->dv_refcount; } break; case VAR_UNKNOWN: EMSG2(_(e_intern2), "copy_tv(UNKNOWN)"); break; } } /* * Make a copy of an item. * Lists and Dictionaries are also copied. A deep copy if "deep" is set. * For deepcopy() "copyID" is zero for a full copy or the ID for when a * reference to an already copied list/dict can be used. * Returns FAIL or OK. */ static int item_copy( typval_T *from, typval_T *to, int deep, int copyID) { static int recurse = 0; int ret = OK; if (recurse >= DICT_MAXNEST) { EMSG(_("E698: variable nested too deep for making a copy")); return FAIL; } ++recurse; switch (from->v_type) { case VAR_NUMBER: case VAR_FLOAT: case VAR_STRING: case VAR_FUNC: case VAR_PARTIAL: case VAR_SPECIAL: case VAR_JOB: case VAR_CHANNEL: copy_tv(from, to); break; case VAR_LIST: to->v_type = VAR_LIST; to->v_lock = 0; if (from->vval.v_list == NULL) to->vval.v_list = NULL; else if (copyID != 0 && from->vval.v_list->lv_copyID == copyID) { /* use the copy made earlier */ to->vval.v_list = from->vval.v_list->lv_copylist; ++to->vval.v_list->lv_refcount; } else to->vval.v_list = list_copy(from->vval.v_list, deep, copyID); if (to->vval.v_list == NULL) ret = FAIL; break; case VAR_DICT: to->v_type = VAR_DICT; to->v_lock = 0; if (from->vval.v_dict == NULL) to->vval.v_dict = NULL; else if (copyID != 0 && from->vval.v_dict->dv_copyID == copyID) { /* use the copy made earlier */ to->vval.v_dict = from->vval.v_dict->dv_copydict; ++to->vval.v_dict->dv_refcount; } else to->vval.v_dict = dict_copy(from->vval.v_dict, deep, copyID); if (to->vval.v_dict == NULL) ret = FAIL; break; case VAR_UNKNOWN: EMSG2(_(e_intern2), "item_copy(UNKNOWN)"); ret = FAIL; } --recurse; return ret; } /* * ":echo expr1 ..." print each argument separated with a space, add a * newline at the end. * ":echon expr1 ..." print each argument plain. */ void ex_echo(exarg_T *eap) { char_u *arg = eap->arg; typval_T rettv; char_u *tofree; char_u *p; int needclr = TRUE; int atstart = TRUE; char_u numbuf[NUMBUFLEN]; if (eap->skip) ++emsg_skip; while (*arg != NUL && *arg != '|' && *arg != '\n' && !got_int) { /* If eval1() causes an error message the text from the command may * still need to be cleared. E.g., "echo 22,44". */ need_clr_eos = needclr; p = arg; if (eval1(&arg, &rettv, !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); need_clr_eos = FALSE; break; } need_clr_eos = FALSE; 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) { /* Mark the saved text as finishing the line, so that what * follows is displayed on a new line when scrolling back * at the more prompt. */ msg_sb_eol(); msg_start(); } } else if (eap->cmdidx == CMD_echo) msg_puts_attr((char_u *)" ", echo_attr); p = echo_string(&rettv, &tofree, numbuf, get_copyID()); if (p != NULL) for ( ; *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)(p); (void)msg_outtrans_len_attr(p, i, echo_attr); p += i - 1; } else #endif (void)msg_outtrans_len_attr(p, 1, echo_attr); } } vim_free(tofree); } clear_tv(&rettv); 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(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(exarg_T *eap) { char_u *arg = eap->arg; typval_T rettv; 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, &rettv, !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_tv_string(&rettv); len = (int)STRLEN(p); if (ga_grow(&ga, len + 2) == FAIL) { clear_tv(&rettv); ret = FAIL; break; } if (ga.ga_len) ((char_u *)(ga.ga_data))[ga.ga_len++] = ' '; STRCPY((char_u *)(ga.ga_data) + ga.ga_len, p); ga.ga_len += len; } clear_tv(&rettv); arg = skipwhite(arg); } if (ret != FAIL && ga.ga_data != NULL) { if (eap->cmdidx == CMD_echomsg) { MSG_ATTR(ga.ga_data, echo_attr); out_flush(); } 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(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(exarg_T *eap) { char_u *theline; int i; int j; int c; int saved_did_emsg; int saved_wait_return = need_wait_return; char_u *name = NULL; char_u *p; char_u *arg; char_u *line_arg = NULL; 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; dictitem_T *v; funcdict_T fudi; static int func_nr = 0; /* number for nameless function */ int paren; hashtab_T *ht; int todo; hashitem_T *hi; int sourcing_lnum_off; /* * ":function" without argument: list functions. */ if (ends_excmd(*eap->arg)) { if (!eap->skip) { todo = (int)func_hashtab.ht_used; for (hi = func_hashtab.ht_array; todo > 0 && !got_int; ++hi) { if (!HASHITEM_EMPTY(hi)) { --todo; fp = HI2UF(hi); if (!isdigit(*fp->uf_name)) list_func_head(fp, FALSE); } } } eap->nextcmd = check_nextcmd(eap->arg); return; } /* * ":function /pat": list functions matching pattern. */ if (*eap->arg == '/') { p = skip_regexp(eap->arg + 1, '/', TRUE, NULL); if (!eap->skip) { regmatch_T regmatch; c = *p; *p = NUL; regmatch.regprog = vim_regcomp(eap->arg + 1, RE_MAGIC); *p = c; if (regmatch.regprog != NULL) { regmatch.rm_ic = p_ic; todo = (int)func_hashtab.ht_used; for (hi = func_hashtab.ht_array; todo > 0 && !got_int; ++hi) { if (!HASHITEM_EMPTY(hi)) { --todo; fp = HI2UF(hi); if (!isdigit(*fp->uf_name) && vim_regexec(®match, fp->uf_name, 0)) list_func_head(fp, FALSE); } } vim_regfree(regmatch.regprog); } } if (*p == '/') ++p; eap->nextcmd = check_nextcmd(p); return; } /* * Get the function name. There are these situations: * func normal function name * "name" == func, "fudi.fd_dict" == NULL * dict.func new dictionary entry * "name" == NULL, "fudi.fd_dict" set, * "fudi.fd_di" == NULL, "fudi.fd_newkey" == func * dict.func existing dict entry with a Funcref * "name" == func, "fudi.fd_dict" set, * "fudi.fd_di" set, "fudi.fd_newkey" == NULL * dict.func existing dict entry that's not a Funcref * "name" == NULL, "fudi.fd_dict" set, * "fudi.fd_di" set, "fudi.fd_newkey" == NULL * s:func script-local function name * g:func global function name, same as "func" */ p = eap->arg; name = trans_function_name(&p, eap->skip, 0, &fudi, NULL); paren = (vim_strchr(p, '(') != NULL); if (name == NULL && (fudi.fd_dict == NULL || !paren) && !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()) { if (!eap->skip && fudi.fd_newkey != NULL) EMSG2(_(e_dictkey), fudi.fd_newkey); vim_free(fudi.fd_newkey); return; } else eap->skip = TRUE; } /* 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; /* * ":function func" with only function name: list function. */ if (!paren) { if (!ends_excmd(*skipwhite(p))) { EMSG(_(e_trailing)); goto ret_free; } 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->uf_lines.ga_len && !got_int; ++j) { if (FUNCLINE(fp, j) == NULL) continue; msg_putchar('\n'); msg_outnum((long)(j + 1)); if (j < 9) msg_putchar(' '); if (j < 99) msg_putchar(' '); msg_prt_line(FUNCLINE(fp, j), FALSE); out_flush(); /* show a line at a time */ ui_breakcheck(); } if (!got_int) { msg_putchar('\n'); msg_puts((char_u *)" endfunction"); } } else emsg_funcname(N_("E123: Undefined function: %s"), name); } goto ret_free; } /* * ":function name(arg1, arg2)" Define function. */ p = skipwhite(p); if (*p != '(') { if (!eap->skip) { EMSG2(_("E124: Missing '(': %s"), eap->arg); goto ret_free; } /* 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); if (!eap->skip) { /* Check the name of the function. Unless it's a dictionary function * (that we are overwriting). */ if (name != NULL) arg = name; else arg = fudi.fd_newkey; if (arg != NULL && (fudi.fd_di == NULL || (fudi.fd_di->di_tv.v_type != VAR_FUNC && fudi.fd_di->di_tv.v_type != VAR_PARTIAL))) { if (*arg == K_SPECIAL) j = 3; else j = 0; while (arg[j] != NUL && (j == 0 ? eval_isnamec1(arg[j]) : eval_isnamec(arg[j]))) ++j; if (arg[j] != NUL) emsg_funcname((char *)e_invarg2, arg); } /* Disallow using the g: dict. */ if (fudi.fd_dict != NULL && fudi.fd_dict->dv_scope == VAR_DEF_SCOPE) EMSG(_("E862: Cannot use g: here")); } /* * 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; /* Check for duplicate argument name. */ for (i = 0; i < newargs.ga_len; ++i) if (STRCMP(((char_u **)(newargs.ga_data))[i], arg) == 0) { EMSG2(_("E853: Duplicate argument name: %s"), arg); vim_free(arg); goto erret; } ((char_u **)(newargs.ga_data))[newargs.ga_len] = arg; *p = c; newargs.ga_len++; if (*p == ',') ++p; else mustend = TRUE; } p = skipwhite(p); if (mustend && *p != ')') { if (!eap->skip) EMSG2(_(e_invarg2), eap->arg); break; } } if (*p != ')') goto erret; ++p; /* skip the ')' */ /* find extra arguments "range", "dict" and "abort" */ for (;;) { p = skipwhite(p); if (STRNCMP(p, "range", 5) == 0) { flags |= FC_RANGE; p += 5; } else if (STRNCMP(p, "dict", 4) == 0) { flags |= FC_DICT; p += 4; } else if (STRNCMP(p, "abort", 5) == 0) { flags |= FC_ABORT; p += 5; } else break; } /* When there is a line break use what follows for the function body. * Makes 'exe "func Test()\n...\nendfunc"' work. */ if (*p == '\n') line_arg = p + 1; else if (*p != NUL && *p != '"' && !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) { if (fudi.fd_dict != NULL && fudi.fd_newkey == NULL) EMSG(_(e_funcdict)); else if (name != NULL && find_func(name) != NULL) emsg_funcname(e_funcexts, name); } if (!eap->skip && did_emsg) goto erret; msg_putchar('\n'); /* don't overwrite the function name */ cmdline_row = msg_row; } indent = 2; nesting = 0; for (;;) { if (KeyTyped) { msg_scroll = TRUE; saved_wait_return = FALSE; } need_wait_return = FALSE; sourcing_lnum_off = sourcing_lnum; if (line_arg != NULL) { /* Use eap->arg, split up in parts by line breaks. */ theline = line_arg; p = vim_strchr(theline, '\n'); if (p == NULL) line_arg += STRLEN(line_arg); else { *p = NUL; line_arg = p + 1; } } else 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; } /* Detect line continuation: sourcing_lnum increased more than one. */ if (sourcing_lnum > sourcing_lnum_off + 1) sourcing_lnum_off = sourcing_lnum - sourcing_lnum_off - 1; else sourcing_lnum_off = 0; if (skip_until != NULL) { /* between ":append" and "." and between ":python < 2 && STRNCMP(p, "end", 3) == 0) indent -= 2; else if (STRNCMP(p, "if", 2) == 0 || STRNCMP(p, "wh", 2) == 0 || STRNCMP(p, "for", 3) == 0 || STRNCMP(p, "try", 3) == 0) indent += 2; /* Check for defining a function inside this function. */ if (checkforcmd(&p, "function", 2)) { if (*p == '!') p = skipwhite(p + 1); p += eval_fname_script(p); vim_free(trans_function_name(&p, TRUE, 0, NULL, NULL)); 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 < 0) ((char_u **)(newlines.ga_data))[newlines.ga_len++] = NULL; /* Check for end of eap->arg. */ if (line_arg != NULL && *line_arg == NUL) line_arg = NULL; } /* 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 */ if (fudi.fd_dict == NULL) { v = find_var(name, &ht, FALSE); if (v != NULL && v->di_tv.v_type == VAR_FUNC) { emsg_funcname(N_("E707: Function name conflicts with variable: %s"), name); goto erret; } fp = find_func(name); if (fp != NULL) { if (!eap->forceit) { emsg_funcname(e_funcexts, name); goto erret; } if (fp->uf_calls > 0) { emsg_funcname(N_("E127: Cannot redefine function %s: It is in use"), name); goto erret; } /* redefine existing function */ ga_clear_strings(&(fp->uf_args)); ga_clear_strings(&(fp->uf_lines)); vim_free(name); name = NULL; } } else { char numbuf[20]; fp = NULL; if (fudi.fd_newkey == NULL && !eap->forceit) { EMSG(_(e_funcdict)); goto erret; } if (fudi.fd_di == NULL) { /* Can't add a function to a locked dictionary */ if (tv_check_lock(fudi.fd_dict->dv_lock, eap->arg, FALSE)) goto erret; } /* Can't change an existing function if it is locked */ else if (tv_check_lock(fudi.fd_di->di_tv.v_lock, eap->arg, FALSE)) goto erret; /* Give the function a sequential number. Can only be used with a * Funcref! */ vim_free(name); sprintf(numbuf, "%d", ++func_nr); name = vim_strsave((char_u *)numbuf); if (name == NULL) goto erret; } if (fp == NULL) { if (fudi.fd_dict == NULL && vim_strchr(name, AUTOLOAD_CHAR) != NULL) { int slen, plen; char_u *scriptname; /* Check that the autoload name matches the script name. */ j = FAIL; if (sourcing_name != NULL) { scriptname = autoload_name(name); if (scriptname != NULL) { p = vim_strchr(scriptname, '/'); plen = (int)STRLEN(p); slen = (int)STRLEN(sourcing_name); if (slen > plen && fnamecmp(p, sourcing_name + slen - plen) == 0) j = OK; vim_free(scriptname); } } if (j == FAIL) { EMSG2(_("E746: Function name does not match script file name: %s"), name); goto erret; } } fp = (ufunc_T *)alloc((unsigned)(sizeof(ufunc_T) + STRLEN(name))); if (fp == NULL) goto erret; if (fudi.fd_dict != NULL) { if (fudi.fd_di == NULL) { /* add new dict entry */ fudi.fd_di = dictitem_alloc(fudi.fd_newkey); if (fudi.fd_di == NULL) { vim_free(fp); goto erret; } if (dict_add(fudi.fd_dict, fudi.fd_di) == FAIL) { vim_free(fudi.fd_di); vim_free(fp); goto erret; } } else /* overwrite existing dict entry */ clear_tv(&fudi.fd_di->di_tv); fudi.fd_di->di_tv.v_type = VAR_FUNC; fudi.fd_di->di_tv.v_lock = 0; fudi.fd_di->di_tv.vval.v_string = vim_strsave(name); fp->uf_refcount = 1; /* behave like "dict" was used */ flags |= FC_DICT; } /* insert the new function in the function list */ STRCPY(fp->uf_name, name); if (hash_add(&func_hashtab, UF2HIKEY(fp)) == FAIL) { vim_free(fp); goto erret; } } fp->uf_args = newargs; fp->uf_lines = newlines; #ifdef FEAT_PROFILE fp->uf_tml_count = NULL; fp->uf_tml_total = NULL; fp->uf_tml_self = NULL; fp->uf_profiling = FALSE; if (prof_def_func()) func_do_profile(fp); #endif fp->uf_varargs = varargs; fp->uf_flags = flags; fp->uf_calls = 0; fp->uf_script_ID = current_SID; goto ret_free; erret: ga_clear_strings(&newargs); ga_clear_strings(&newlines); ret_free: vim_free(skip_until); vim_free(fudi.fd_newkey); vim_free(name); did_emsg |= saved_did_emsg; need_wait_return |= saved_wait_return; } /* * Get a function name, translating "" and "". * Also handles a Funcref in a List or Dictionary. * Returns the function name in allocated memory, or NULL for failure. * flags: * TFN_INT: internal function name OK * TFN_QUIET: be quiet * TFN_NO_AUTOLOAD: do not use script autoloading * Advances "pp" to just after the function name (if no error). */ static char_u * trans_function_name( char_u **pp, int skip, /* only find the end, don't evaluate */ int flags, funcdict_T *fdp, /* return: info about dictionary used */ partial_T **partial) /* return: partial of a FuncRef */ { char_u *name = NULL; char_u *start; char_u *end; int lead; char_u sid_buf[20]; int len; lval_T lv; if (fdp != NULL) vim_memset(fdp, 0, sizeof(funcdict_T)); start = *pp; /* Check for hard coded : already translated function ID (from a user * command). */ if ((*pp)[0] == K_SPECIAL && (*pp)[1] == KS_EXTRA && (*pp)[2] == (int)KE_SNR) { *pp += 3; len = get_id_len(pp) + 3; return vim_strnsave(start, len); } /* A name starting with "" or "" is local to a script. But * don't skip over "s:", get_lval() needs it for "s:dict.func". */ lead = eval_fname_script(start); if (lead > 2) start += lead; /* Note that TFN_ flags use the same values as GLV_ flags. */ end = get_lval(start, NULL, &lv, FALSE, skip, flags, lead > 2 ? 0 : FNE_CHECK_START); if (end == start) { if (!skip) EMSG(_("E129: Function name required")); goto theend; } if (end == NULL || (lv.ll_tv != NULL && (lead > 2 || lv.ll_range))) { /* * 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()) { if (end != NULL) EMSG2(_(e_invarg2), start); } else *pp = find_name_end(start, NULL, NULL, FNE_INCL_BR); goto theend; } if (lv.ll_tv != NULL) { if (fdp != NULL) { fdp->fd_dict = lv.ll_dict; fdp->fd_newkey = lv.ll_newkey; lv.ll_newkey = NULL; fdp->fd_di = lv.ll_di; } if (lv.ll_tv->v_type == VAR_FUNC && lv.ll_tv->vval.v_string != NULL) { name = vim_strsave(lv.ll_tv->vval.v_string); *pp = end; } else if (lv.ll_tv->v_type == VAR_PARTIAL && lv.ll_tv->vval.v_partial != NULL) { name = vim_strsave(lv.ll_tv->vval.v_partial->pt_name); *pp = end; if (partial != NULL) *partial = lv.ll_tv->vval.v_partial; } else { if (!skip && !(flags & TFN_QUIET) && (fdp == NULL || lv.ll_dict == NULL || fdp->fd_newkey == NULL)) EMSG(_(e_funcref)); else *pp = end; name = NULL; } goto theend; } if (lv.ll_name == NULL) { /* Error found, but continue after the function name. */ *pp = end; goto theend; } /* Check if the name is a Funcref. If so, use the value. */ if (lv.ll_exp_name != NULL) { len = (int)STRLEN(lv.ll_exp_name); name = deref_func_name(lv.ll_exp_name, &len, partial, flags & TFN_NO_AUTOLOAD); if (name == lv.ll_exp_name) name = NULL; } else { len = (int)(end - *pp); name = deref_func_name(*pp, &len, partial, flags & TFN_NO_AUTOLOAD); if (name == *pp) name = NULL; } if (name != NULL) { name = vim_strsave(name); *pp = end; if (STRNCMP(name, "", 5) == 0) { /* Change "" to the byte sequence. */ name[0] = K_SPECIAL; name[1] = KS_EXTRA; name[2] = (int)KE_SNR; mch_memmove(name + 3, name + 5, STRLEN(name + 5) + 1); } goto theend; } if (lv.ll_exp_name != NULL) { len = (int)STRLEN(lv.ll_exp_name); if (lead <= 2 && lv.ll_name == lv.ll_exp_name && STRNCMP(lv.ll_name, "s:", 2) == 0) { /* When there was "s:" already or the name expanded to get a * leading "s:" then remove it. */ lv.ll_name += 2; len -= 2; lead = 2; } } else { /* skip over "s:" and "g:" */ if (lead == 2 || (lv.ll_name[0] == 'g' && lv.ll_name[1] == ':')) lv.ll_name += 2; len = (int)(end - lv.ll_name); } /* * Copy the function name to allocated memory. * Accept name() inside a script, translate into 123_name(). * Accept 123_name() outside a script. */ if (skip) lead = 0; /* do nothing */ else if (lead > 0) { lead = 3; if ((lv.ll_exp_name != NULL && eval_fname_sid(lv.ll_exp_name)) || eval_fname_sid(*pp)) { /* It's "s:" or "" */ if (current_SID <= 0) { EMSG(_(e_usingsid)); goto theend; } sprintf((char *)sid_buf, "%ld_", (long)current_SID); lead += (int)STRLEN(sid_buf); } } else if (!(flags & TFN_INT) && builtin_function(lv.ll_name, len)) { EMSG2(_("E128: Function name must start with a capital or \"s:\": %s"), start); goto theend; } if (!skip && !(flags & TFN_QUIET)) { char_u *cp = vim_strchr(lv.ll_name, ':'); if (cp != NULL && cp < end) { EMSG2(_("E884: Function name cannot contain a colon: %s"), start); goto theend; } } 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 (lead > 3) /* If it's "" */ STRCPY(name + 3, sid_buf); } mch_memmove(name + lead, lv.ll_name, (size_t)len); name[lead + len] = NUL; } *pp = end; theend: clear_lval(&lv); return name; } /* * Return 5 if "p" starts with "" or "" (ignoring case). * Return 2 if "p" starts with "s:". * Return 0 otherwise. */ static int eval_fname_script(char_u *p) { /* Use MB_STRICMP() because in Turkish comparing the "I" may not work with * the standard library function. */ if (p[0] == '<' && (MB_STRNICMP(p + 1, "SID>", 4) == 0 || MB_STRNICMP(p + 1, "SNR>", 4) == 0)) return 5; if (p[0] == 's' && p[1] == ':') return 2; return 0; } /* * Return TRUE if "p" starts with "" or "s:". * Only works if eval_fname_script() returned non-zero for "p"! */ static int eval_fname_sid(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(ufunc_T *fp, int indent) { int j; msg_start(); if (indent) MSG_PUTS(" "); MSG_PUTS("function "); if (fp->uf_name[0] == K_SPECIAL) { MSG_PUTS_ATTR("", hl_attr(HLF_8)); msg_puts(fp->uf_name + 3); } else msg_puts(fp->uf_name); msg_putchar('('); for (j = 0; j < fp->uf_args.ga_len; ++j) { if (j) MSG_PUTS(", "); msg_puts(FUNCARG(fp, j)); } if (fp->uf_varargs) { if (j) MSG_PUTS(", "); MSG_PUTS("..."); } msg_putchar(')'); if (fp->uf_flags & FC_ABORT) MSG_PUTS(" abort"); if (fp->uf_flags & FC_RANGE) MSG_PUTS(" range"); if (fp->uf_flags & FC_DICT) MSG_PUTS(" dict"); msg_clr_eos(); if (p_verbose > 0) last_set_msg(fp->uf_script_ID); } /* * Find a function by name, return pointer to it in ufuncs. * Return NULL for unknown function. */ static ufunc_T * find_func(char_u *name) { hashitem_T *hi; hi = hash_find(&func_hashtab, name); if (!HASHITEM_EMPTY(hi)) return HI2UF(hi); return NULL; } #if defined(EXITFREE) || defined(PROTO) void free_all_functions(void) { hashitem_T *hi; /* Need to start all over every time, because func_free() may change the * hash table. */ while (func_hashtab.ht_used > 0) for (hi = func_hashtab.ht_array; ; ++hi) if (!HASHITEM_EMPTY(hi)) { func_free(HI2UF(hi)); break; } } #endif int translated_function_exists(char_u *name) { if (builtin_function(name, -1)) return find_internal_func(name) >= 0; return find_func(name) != NULL; } /* * Return TRUE if a function "name" exists. */ static int function_exists(char_u *name) { char_u *nm = name; char_u *p; int n = FALSE; p = trans_function_name(&nm, FALSE, TFN_INT|TFN_QUIET|TFN_NO_AUTOLOAD, NULL, NULL); nm = skipwhite(nm); /* Only accept "funcname", "funcname ", "funcname (..." and * "funcname(...", not "funcname!...". */ if (p != NULL && (*nm == NUL || *nm == '(')) n = translated_function_exists(p); vim_free(p); return n; } char_u * get_expanded_name(char_u *name, int check) { char_u *nm = name; char_u *p; p = trans_function_name(&nm, FALSE, TFN_INT|TFN_QUIET, NULL, NULL); if (p != NULL && *nm == NUL) if (!check || translated_function_exists(p)) return p; vim_free(p); return NULL; } /* * Return TRUE if "name" looks like a builtin function name: starts with a * lower case letter and doesn't contain AUTOLOAD_CHAR. * "len" is the length of "name", or -1 for NUL terminated. */ static int builtin_function(char_u *name, int len) { char_u *p; if (!ASCII_ISLOWER(name[0])) return FALSE; p = vim_strchr(name, AUTOLOAD_CHAR); return p == NULL || (len > 0 && p > name + len); } #if defined(FEAT_PROFILE) || defined(PROTO) /* * Start profiling function "fp". */ static void func_do_profile(ufunc_T *fp) { int len = fp->uf_lines.ga_len; if (len == 0) len = 1; /* avoid getting error for allocating zero bytes */ fp->uf_tm_count = 0; profile_zero(&fp->uf_tm_self); profile_zero(&fp->uf_tm_total); if (fp->uf_tml_count == NULL) fp->uf_tml_count = (int *)alloc_clear((unsigned) (sizeof(int) * len)); if (fp->uf_tml_total == NULL) fp->uf_tml_total = (proftime_T *)alloc_clear((unsigned) (sizeof(proftime_T) * len)); if (fp->uf_tml_self == NULL) fp->uf_tml_self = (proftime_T *)alloc_clear((unsigned) (sizeof(proftime_T) * len)); fp->uf_tml_idx = -1; if (fp->uf_tml_count == NULL || fp->uf_tml_total == NULL || fp->uf_tml_self == NULL) return; /* out of memory */ fp->uf_profiling = TRUE; } /* * Dump the profiling results for all functions in file "fd". */ void func_dump_profile(FILE *fd) { hashitem_T *hi; int todo; ufunc_T *fp; int i; ufunc_T **sorttab; int st_len = 0; todo = (int)func_hashtab.ht_used; if (todo == 0) return; /* nothing to dump */ sorttab = (ufunc_T **)alloc((unsigned)(sizeof(ufunc_T *) * todo)); for (hi = func_hashtab.ht_array; todo > 0; ++hi) { if (!HASHITEM_EMPTY(hi)) { --todo; fp = HI2UF(hi); if (fp->uf_profiling) { if (sorttab != NULL) sorttab[st_len++] = fp; if (fp->uf_name[0] == K_SPECIAL) fprintf(fd, "FUNCTION %s()\n", fp->uf_name + 3); else fprintf(fd, "FUNCTION %s()\n", fp->uf_name); if (fp->uf_tm_count == 1) fprintf(fd, "Called 1 time\n"); else fprintf(fd, "Called %d times\n", fp->uf_tm_count); fprintf(fd, "Total time: %s\n", profile_msg(&fp->uf_tm_total)); fprintf(fd, " Self time: %s\n", profile_msg(&fp->uf_tm_self)); fprintf(fd, "\n"); fprintf(fd, "count total (s) self (s)\n"); for (i = 0; i < fp->uf_lines.ga_len; ++i) { if (FUNCLINE(fp, i) == NULL) continue; prof_func_line(fd, fp->uf_tml_count[i], &fp->uf_tml_total[i], &fp->uf_tml_self[i], TRUE); fprintf(fd, "%s\n", FUNCLINE(fp, i)); } fprintf(fd, "\n"); } } } if (sorttab != NULL && st_len > 0) { qsort((void *)sorttab, (size_t)st_len, sizeof(ufunc_T *), prof_total_cmp); prof_sort_list(fd, sorttab, st_len, "TOTAL", FALSE); qsort((void *)sorttab, (size_t)st_len, sizeof(ufunc_T *), prof_self_cmp); prof_sort_list(fd, sorttab, st_len, "SELF", TRUE); } vim_free(sorttab); } static void prof_sort_list( FILE *fd, ufunc_T **sorttab, int st_len, char *title, int prefer_self) /* when equal print only self time */ { int i; ufunc_T *fp; fprintf(fd, "FUNCTIONS SORTED ON %s TIME\n", title); fprintf(fd, "count total (s) self (s) function\n"); for (i = 0; i < 20 && i < st_len; ++i) { fp = sorttab[i]; prof_func_line(fd, fp->uf_tm_count, &fp->uf_tm_total, &fp->uf_tm_self, prefer_self); if (fp->uf_name[0] == K_SPECIAL) fprintf(fd, " %s()\n", fp->uf_name + 3); else fprintf(fd, " %s()\n", fp->uf_name); } fprintf(fd, "\n"); } /* * Print the count and times for one function or function line. */ static void prof_func_line( FILE *fd, int count, proftime_T *total, proftime_T *self, int prefer_self) /* when equal print only self time */ { if (count > 0) { fprintf(fd, "%5d ", count); if (prefer_self && profile_equal(total, self)) fprintf(fd, " "); else fprintf(fd, "%s ", profile_msg(total)); if (!prefer_self && profile_equal(total, self)) fprintf(fd, " "); else fprintf(fd, "%s ", profile_msg(self)); } else fprintf(fd, " "); } /* * Compare function for total time sorting. */ static int #ifdef __BORLANDC__ _RTLENTRYF #endif prof_total_cmp(const void *s1, const void *s2) { ufunc_T *p1, *p2; p1 = *(ufunc_T **)s1; p2 = *(ufunc_T **)s2; return profile_cmp(&p1->uf_tm_total, &p2->uf_tm_total); } /* * Compare function for self time sorting. */ static int #ifdef __BORLANDC__ _RTLENTRYF #endif prof_self_cmp(const void *s1, const void *s2) { ufunc_T *p1, *p2; p1 = *(ufunc_T **)s1; p2 = *(ufunc_T **)s2; return profile_cmp(&p1->uf_tm_self, &p2->uf_tm_self); } #endif /* * If "name" has a package name try autoloading the script for it. * Return TRUE if a package was loaded. */ static int script_autoload( char_u *name, int reload) /* load script again when already loaded */ { char_u *p; char_u *scriptname, *tofree; int ret = FALSE; int i; /* If there is no '#' after name[0] there is no package name. */ p = vim_strchr(name, AUTOLOAD_CHAR); if (p == NULL || p == name) return FALSE; tofree = scriptname = autoload_name(name); /* Find the name in the list of previously loaded package names. Skip * "autoload/", it's always the same. */ for (i = 0; i < ga_loaded.ga_len; ++i) if (STRCMP(((char_u **)ga_loaded.ga_data)[i] + 9, scriptname + 9) == 0) break; if (!reload && i < ga_loaded.ga_len) ret = FALSE; /* was loaded already */ else { /* Remember the name if it wasn't loaded already. */ if (i == ga_loaded.ga_len && ga_grow(&ga_loaded, 1) == OK) { ((char_u **)ga_loaded.ga_data)[ga_loaded.ga_len++] = scriptname; tofree = NULL; } /* Try loading the package from $VIMRUNTIME/autoload/.vim */ if (source_runtime(scriptname, 0) == OK) ret = TRUE; } vim_free(tofree); return ret; } /* * Return the autoload script name for a function or variable name. * Returns NULL when out of memory. */ static char_u * autoload_name(char_u *name) { char_u *p; char_u *scriptname; /* Get the script file name: replace '#' with '/', append ".vim". */ scriptname = alloc((unsigned)(STRLEN(name) + 14)); if (scriptname == NULL) return FALSE; STRCPY(scriptname, "autoload/"); STRCAT(scriptname, name); *vim_strrchr(scriptname, AUTOLOAD_CHAR) = NUL; STRCAT(scriptname, ".vim"); while ((p = vim_strchr(scriptname, AUTOLOAD_CHAR)) != NULL) *p = '/'; return scriptname; } #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(expand_T *xp, int idx) { static long_u done; static hashitem_T *hi; ufunc_T *fp; if (idx == 0) { done = 0; hi = func_hashtab.ht_array; } if (done < func_hashtab.ht_used) { if (done++ > 0) ++hi; while (HASHITEM_EMPTY(hi)) ++hi; fp = HI2UF(hi); if (fp->uf_flags & FC_DICT) return (char_u *)""; /* don't show dict functions */ if (STRLEN(fp->uf_name) + 4 >= IOSIZE) return fp->uf_name; /* prevents overflow */ cat_func_name(IObuff, fp); if (xp->xp_context != EXPAND_USER_FUNC) { STRCAT(IObuff, "("); if (!fp->uf_varargs && fp->uf_args.ga_len == 0) STRCAT(IObuff, ")"); } 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(char_u *buf, ufunc_T *fp) { if (fp->uf_name[0] == K_SPECIAL) { STRCPY(buf, ""); STRCAT(buf, fp->uf_name + 3); } else STRCPY(buf, fp->uf_name); } /* * ":delfunction {name}" */ void ex_delfunction(exarg_T *eap) { ufunc_T *fp = NULL; char_u *p; char_u *name; funcdict_T fudi; p = eap->arg; name = trans_function_name(&p, eap->skip, 0, &fudi, NULL); vim_free(fudi.fd_newkey); if (name == NULL) { if (fudi.fd_dict != NULL && !eap->skip) EMSG(_(e_funcref)); 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(_(e_nofunc), eap->arg); return; } if (fp->uf_calls > 0) { EMSG2(_("E131: Cannot delete function %s: It is in use"), eap->arg); return; } if (fudi.fd_dict != NULL) { /* Delete the dict item that refers to the function, it will * invoke func_unref() and possibly delete the function. */ dictitem_remove(fudi.fd_dict, fudi.fd_di); } else func_free(fp); } } /* * Free a function and remove it from the list of functions. */ static void func_free(ufunc_T *fp) { hashitem_T *hi; /* clear this function */ ga_clear_strings(&(fp->uf_args)); ga_clear_strings(&(fp->uf_lines)); #ifdef FEAT_PROFILE vim_free(fp->uf_tml_count); vim_free(fp->uf_tml_total); vim_free(fp->uf_tml_self); #endif /* remove the function from the function hashtable */ hi = hash_find(&func_hashtab, UF2HIKEY(fp)); if (HASHITEM_EMPTY(hi)) EMSG2(_(e_intern2), "func_free()"); else hash_remove(&func_hashtab, hi); vim_free(fp); } /* * Unreference a Function: decrement the reference count and free it when it * becomes zero. Only for numbered functions. */ void func_unref(char_u *name) { ufunc_T *fp; if (name != NULL && isdigit(*name)) { fp = find_func(name); if (fp == NULL) EMSG2(_(e_intern2), "func_unref()"); else if (--fp->uf_refcount <= 0) { /* Only delete it when it's not being used. Otherwise it's done * when "uf_calls" becomes zero. */ if (fp->uf_calls == 0) func_free(fp); } } } /* * Count a reference to a Function. */ void func_ref(char_u *name) { ufunc_T *fp; if (name != NULL && isdigit(*name)) { fp = find_func(name); if (fp == NULL) EMSG2(_(e_intern2), "func_ref()"); else ++fp->uf_refcount; } } /* * Call a user function. */ static void call_user_func( ufunc_T *fp, /* pointer to function */ int argcount, /* nr of args */ typval_T *argvars, /* arguments */ typval_T *rettv, /* return value */ linenr_T firstline, /* first line of range */ linenr_T lastline, /* last line of range */ dict_T *selfdict) /* Dictionary for "self" */ { char_u *save_sourcing_name; linenr_T save_sourcing_lnum; scid_T save_current_SID; funccall_T *fc; int save_did_emsg; static int depth = 0; dictitem_T *v; int fixvar_idx = 0; /* index in fixvar[] */ int i; int ai; char_u numbuf[NUMBUFLEN]; char_u *name; size_t len; #ifdef FEAT_PROFILE proftime_T wait_start; proftime_T call_start; #endif /* 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'")); rettv->v_type = VAR_NUMBER; rettv->vval.v_number = -1; return; } ++depth; line_breakcheck(); /* check for CTRL-C hit */ fc = (funccall_T *)alloc(sizeof(funccall_T)); fc->caller = current_funccal; current_funccal = fc; fc->func = fp; fc->rettv = rettv; rettv->vval.v_number = 0; fc->linenr = 0; fc->returned = FALSE; fc->level = ex_nesting_level; /* Check if this function has a breakpoint. */ fc->breakpoint = dbg_find_breakpoint(FALSE, fp->uf_name, (linenr_T)0); fc->dbg_tick = debug_tick; /* * Note about using fc->fixvar[]: This is an array of FIXVAR_CNT variables * with names up to VAR_SHORT_LEN long. This avoids having to alloc/free * each argument variable and saves a lot of time. */ /* * Init l: variables. */ init_var_dict(&fc->l_vars, &fc->l_vars_var, VAR_DEF_SCOPE); if (selfdict != NULL) { /* Set l:self to "selfdict". Use "name" to avoid a warning from * some compiler that checks the destination size. */ v = &fc->fixvar[fixvar_idx++].var; name = v->di_key; STRCPY(name, "self"); v->di_flags = DI_FLAGS_RO + DI_FLAGS_FIX; hash_add(&fc->l_vars.dv_hashtab, DI2HIKEY(v)); v->di_tv.v_type = VAR_DICT; v->di_tv.v_lock = 0; v->di_tv.vval.v_dict = selfdict; ++selfdict->dv_refcount; } /* * Init a: variables. * Set a:0 to "argcount". * Set a:000 to a list with room for the "..." arguments. */ init_var_dict(&fc->l_avars, &fc->l_avars_var, VAR_SCOPE); add_nr_var(&fc->l_avars, &fc->fixvar[fixvar_idx++].var, "0", (varnumber_T)(argcount - fp->uf_args.ga_len)); /* Use "name" to avoid a warning from some compiler that checks the * destination size. */ v = &fc->fixvar[fixvar_idx++].var; name = v->di_key; STRCPY(name, "000"); v->di_flags = DI_FLAGS_RO | DI_FLAGS_FIX; hash_add(&fc->l_avars.dv_hashtab, DI2HIKEY(v)); v->di_tv.v_type = VAR_LIST; v->di_tv.v_lock = VAR_FIXED; v->di_tv.vval.v_list = &fc->l_varlist; vim_memset(&fc->l_varlist, 0, sizeof(list_T)); fc->l_varlist.lv_refcount = DO_NOT_FREE_CNT; fc->l_varlist.lv_lock = VAR_FIXED; /* * Set a:firstline to "firstline" and a:lastline to "lastline". * Set a:name to named arguments. * Set a:N to the "..." arguments. */ add_nr_var(&fc->l_avars, &fc->fixvar[fixvar_idx++].var, "firstline", (varnumber_T)firstline); add_nr_var(&fc->l_avars, &fc->fixvar[fixvar_idx++].var, "lastline", (varnumber_T)lastline); for (i = 0; i < argcount; ++i) { ai = i - fp->uf_args.ga_len; if (ai < 0) /* named argument a:name */ name = FUNCARG(fp, i); else { /* "..." argument a:1, a:2, etc. */ sprintf((char *)numbuf, "%d", ai + 1); name = numbuf; } if (fixvar_idx < FIXVAR_CNT && STRLEN(name) <= VAR_SHORT_LEN) { v = &fc->fixvar[fixvar_idx++].var; v->di_flags = DI_FLAGS_RO | DI_FLAGS_FIX; } else { v = (dictitem_T *)alloc((unsigned)(sizeof(dictitem_T) + STRLEN(name))); if (v == NULL) break; v->di_flags = DI_FLAGS_RO | DI_FLAGS_FIX | DI_FLAGS_ALLOC; } STRCPY(v->di_key, name); hash_add(&fc->l_avars.dv_hashtab, DI2HIKEY(v)); /* Note: the values are copied directly to avoid alloc/free. * "argvars" must have VAR_FIXED for v_lock. */ v->di_tv = argvars[i]; v->di_tv.v_lock = VAR_FIXED; if (ai >= 0 && ai < MAX_FUNC_ARGS) { list_append(&fc->l_varlist, &fc->l_listitems[ai]); fc->l_listitems[ai].li_tv = argvars[i]; fc->l_listitems[ai].li_tv.v_lock = VAR_FIXED; } } /* Don't redraw while executing the function. */ ++RedrawingDisabled; save_sourcing_name = sourcing_name; save_sourcing_lnum = sourcing_lnum; sourcing_lnum = 1; /* need space for function name + ("function " + 3) or "[number]" */ len = (save_sourcing_name == NULL ? 0 : STRLEN(save_sourcing_name)) + STRLEN(fp->uf_name) + 20; sourcing_name = alloc((unsigned)len); if (sourcing_name != NULL) { if (save_sourcing_name != NULL && STRNCMP(save_sourcing_name, "function ", 9) == 0) sprintf((char *)sourcing_name, "%s[%d]..", save_sourcing_name, (int)save_sourcing_lnum); else STRCPY(sourcing_name, "function "); cat_func_name(sourcing_name + STRLEN(sourcing_name), fp); if (p_verbose >= 12) { ++no_wait_return; verbose_enter_scroll(); smsg((char_u *)_("calling %s"), sourcing_name); if (p_verbose >= 14) { char_u buf[MSG_BUF_LEN]; char_u numbuf2[NUMBUFLEN]; char_u *tofree; char_u *s; msg_puts((char_u *)"("); for (i = 0; i < argcount; ++i) { if (i > 0) msg_puts((char_u *)", "); if (argvars[i].v_type == VAR_NUMBER) msg_outnum((long)argvars[i].vval.v_number); else { /* Do not want errors such as E724 here. */ ++emsg_off; s = tv2string(&argvars[i], &tofree, numbuf2, 0); --emsg_off; if (s != NULL) { if (vim_strsize(s) > MSG_BUF_CLEN) { trunc_string(s, buf, MSG_BUF_CLEN, MSG_BUF_LEN); s = buf; } msg_puts(s); vim_free(tofree); } } } msg_puts((char_u *)")"); } msg_puts((char_u *)"\n"); /* don't overwrite this either */ verbose_leave_scroll(); --no_wait_return; } } #ifdef FEAT_PROFILE if (do_profiling == PROF_YES) { if (!fp->uf_profiling && has_profiling(FALSE, fp->uf_name, NULL)) func_do_profile(fp); if (fp->uf_profiling || (fc->caller != NULL && fc->caller->func->uf_profiling)) { ++fp->uf_tm_count; profile_start(&call_start); profile_zero(&fp->uf_tm_children); } script_prof_save(&wait_start); } #endif save_current_SID = current_SID; current_SID = fp->uf_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->uf_flags & FC_ABORT)) || rettv->v_type == VAR_UNKNOWN) { clear_tv(rettv); rettv->v_type = VAR_NUMBER; rettv->vval.v_number = -1; } #ifdef FEAT_PROFILE if (do_profiling == PROF_YES && (fp->uf_profiling || (fc->caller != NULL && fc->caller->func->uf_profiling))) { profile_end(&call_start); profile_sub_wait(&wait_start, &call_start); profile_add(&fp->uf_tm_total, &call_start); profile_self(&fp->uf_tm_self, &call_start, &fp->uf_tm_children); if (fc->caller != NULL && fc->caller->func->uf_profiling) { profile_add(&fc->caller->func->uf_tm_children, &call_start); profile_add(&fc->caller->func->uf_tml_children, &call_start); } } #endif /* when being verbose, mention the return value */ if (p_verbose >= 12) { ++no_wait_return; verbose_enter_scroll(); if (aborting()) smsg((char_u *)_("%s aborted"), sourcing_name); else if (fc->rettv->v_type == VAR_NUMBER) smsg((char_u *)_("%s returning #%ld"), sourcing_name, (long)fc->rettv->vval.v_number); else { char_u buf[MSG_BUF_LEN]; char_u numbuf2[NUMBUFLEN]; char_u *tofree; char_u *s; /* The value may be very long. Skip the middle part, so that we * have some idea how it starts and ends. smsg() would always * truncate it at the end. Don't want errors such as E724 here. */ ++emsg_off; s = tv2string(fc->rettv, &tofree, numbuf2, 0); --emsg_off; if (s != NULL) { if (vim_strsize(s) > MSG_BUF_CLEN) { trunc_string(s, buf, MSG_BUF_CLEN, MSG_BUF_LEN); s = buf; } smsg((char_u *)_("%s returning %s"), sourcing_name, s); vim_free(tofree); } } msg_puts((char_u *)"\n"); /* don't overwrite this either */ verbose_leave_scroll(); --no_wait_return; } vim_free(sourcing_name); sourcing_name = save_sourcing_name; sourcing_lnum = save_sourcing_lnum; current_SID = save_current_SID; #ifdef FEAT_PROFILE if (do_profiling == PROF_YES) script_prof_restore(&wait_start); #endif if (p_verbose >= 12 && sourcing_name != NULL) { ++no_wait_return; verbose_enter_scroll(); smsg((char_u *)_("continuing in %s"), sourcing_name); msg_puts((char_u *)"\n"); /* don't overwrite this either */ verbose_leave_scroll(); --no_wait_return; } did_emsg |= save_did_emsg; current_funccal = fc->caller; --depth; /* If the a:000 list and the l: and a: dicts are not referenced we can * free the funccall_T and what's in it. */ if (fc->l_varlist.lv_refcount == DO_NOT_FREE_CNT && fc->l_vars.dv_refcount == DO_NOT_FREE_CNT && fc->l_avars.dv_refcount == DO_NOT_FREE_CNT) { free_funccal(fc, FALSE); } else { hashitem_T *hi; listitem_T *li; int todo; /* "fc" is still in use. This can happen when returning "a:000" or * assigning "l:" to a global variable. * Link "fc" in the list for garbage collection later. */ fc->caller = previous_funccal; previous_funccal = fc; /* Make a copy of the a: variables, since we didn't do that above. */ todo = (int)fc->l_avars.dv_hashtab.ht_used; for (hi = fc->l_avars.dv_hashtab.ht_array; todo > 0; ++hi) { if (!HASHITEM_EMPTY(hi)) { --todo; v = HI2DI(hi); copy_tv(&v->di_tv, &v->di_tv); } } /* Make a copy of the a:000 items, since we didn't do that above. */ for (li = fc->l_varlist.lv_first; li != NULL; li = li->li_next) copy_tv(&li->li_tv, &li->li_tv); } } /* * Return TRUE if items in "fc" do not have "copyID". That means they are not * referenced from anywhere that is in use. */ static int can_free_funccal(funccall_T *fc, int copyID) { return (fc->l_varlist.lv_copyID != copyID && fc->l_vars.dv_copyID != copyID && fc->l_avars.dv_copyID != copyID); } /* * Free "fc" and what it contains. */ static void free_funccal( funccall_T *fc, int free_val) /* a: vars were allocated */ { listitem_T *li; /* The a: variables typevals may not have been allocated, only free the * allocated variables. */ vars_clear_ext(&fc->l_avars.dv_hashtab, free_val); /* free all l: variables */ vars_clear(&fc->l_vars.dv_hashtab); /* Free the a:000 variables if they were allocated. */ if (free_val) for (li = fc->l_varlist.lv_first; li != NULL; li = li->li_next) clear_tv(&li->li_tv); vim_free(fc); } /* * Add a number variable "name" to dict "dp" with value "nr". */ static void add_nr_var( dict_T *dp, dictitem_T *v, char *name, varnumber_T nr) { STRCPY(v->di_key, name); v->di_flags = DI_FLAGS_RO | DI_FLAGS_FIX; hash_add(&dp->dv_hashtab, DI2HIKEY(v)); v->di_tv.v_type = VAR_NUMBER; v->di_tv.v_lock = VAR_FIXED; v->di_tv.vval.v_number = nr; } /* * ":return [expr]" */ void ex_return(exarg_T *eap) { char_u *arg = eap->arg; typval_T rettv; 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, &rettv, &eap->nextcmd, !eap->skip) != FAIL) { if (!eap->skip) returning = do_return(eap, FALSE, TRUE, &rettv); else clear_tv(&rettv); } /* 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. "rettv" may point to a typval_T * with the return rettv. Returns TRUE when the return can be carried out, * FALSE when the return gets pending. */ int do_return( exarg_T *eap, int reanimate, int is_cmd, void *rettv) { 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. "rettv" points to an * allocated variable with the rettv of the original ":return"'s * argument if present or is NULL else. */ cstack->cs_rettv[idx] = rettv; else { /* When undoing a return in order to make it pending, get the stored * return rettv. */ if (reanimate) rettv = current_funccal->rettv; if (rettv != NULL) { /* Store the value of the pending return. */ if ((cstack->cs_rettv[idx] = alloc_tv()) != NULL) *(typval_T *)cstack->cs_rettv[idx] = *(typval_T *)rettv; else EMSG(_(e_outofmem)); } else cstack->cs_rettv[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->rettv->v_type = VAR_NUMBER; current_funccal->rettv->vval.v_number = 0; } } report_make_pending(CSTP_RETURN, rettv); } 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 && rettv != NULL) { clear_tv(current_funccal->rettv); *current_funccal->rettv = *(typval_T *)rettv; if (!is_cmd) vim_free(rettv); } } return idx < 0; } /* * Free the variable with a pending return value. */ void discard_pending_return(void *rettv) { free_tv((typval_T *)rettv); } /* * Generate a return command for producing the value of "rettv". The result * is an allocated string. Used by report_pending() for verbose messages. */ char_u * get_return_cmd(void *rettv) { char_u *s = NULL; char_u *tofree = NULL; char_u numbuf[NUMBUFLEN]; if (rettv != NULL) s = echo_string((typval_T *)rettv, &tofree, numbuf, 0); if (s == NULL) s = (char_u *)""; STRCPY(IObuff, ":return "); STRNCPY(IObuff + 8, s, IOSIZE - 8); if (STRLEN(s) + 8 >= IOSIZE) STRCPY(IObuff + IOSIZE - 4, "..."); vim_free(tofree); return vim_strsave(IObuff); } /* * Get next function line. * Called by do_cmdline() to get the next line. * Returns allocated string, or NULL for end of function. */ char_u * get_func_line( int c UNUSED, void *cookie, int indent UNUSED) { funccall_T *fcp = (funccall_T *)cookie; ufunc_T *fp = fcp->func; 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, fp->uf_name, sourcing_lnum); fcp->dbg_tick = debug_tick; } #ifdef FEAT_PROFILE if (do_profiling == PROF_YES) func_line_end(cookie); #endif gap = &fp->uf_lines; if (((fp->uf_flags & FC_ABORT) && did_emsg && !aborted_in_try()) || fcp->returned) retval = NULL; else { /* Skip NULL lines (continuation lines). */ while (fcp->linenr < gap->ga_len && ((char_u **)(gap->ga_data))[fcp->linenr] == NULL) ++fcp->linenr; if (fcp->linenr >= gap->ga_len) retval = NULL; else { retval = vim_strsave(((char_u **)(gap->ga_data))[fcp->linenr++]); sourcing_lnum = fcp->linenr; #ifdef FEAT_PROFILE if (do_profiling == PROF_YES) func_line_start(cookie); #endif } } /* Did we encounter a breakpoint? */ if (fcp->breakpoint != 0 && fcp->breakpoint <= sourcing_lnum) { dbg_breakpoint(fp->uf_name, sourcing_lnum); /* Find next breakpoint. */ fcp->breakpoint = dbg_find_breakpoint(FALSE, fp->uf_name, sourcing_lnum); fcp->dbg_tick = debug_tick; } return retval; } #if defined(FEAT_PROFILE) || defined(PROTO) /* * Called when starting to read a function line. * "sourcing_lnum" must be correct! * When skipping lines it may not actually be executed, but we won't find out * until later and we need to store the time now. */ void func_line_start(void *cookie) { funccall_T *fcp = (funccall_T *)cookie; ufunc_T *fp = fcp->func; if (fp->uf_profiling && sourcing_lnum >= 1 && sourcing_lnum <= fp->uf_lines.ga_len) { fp->uf_tml_idx = sourcing_lnum - 1; /* Skip continuation lines. */ while (fp->uf_tml_idx > 0 && FUNCLINE(fp, fp->uf_tml_idx) == NULL) --fp->uf_tml_idx; fp->uf_tml_execed = FALSE; profile_start(&fp->uf_tml_start); profile_zero(&fp->uf_tml_children); profile_get_wait(&fp->uf_tml_wait); } } /* * Called when actually executing a function line. */ void func_line_exec(void *cookie) { funccall_T *fcp = (funccall_T *)cookie; ufunc_T *fp = fcp->func; if (fp->uf_profiling && fp->uf_tml_idx >= 0) fp->uf_tml_execed = TRUE; } /* * Called when done with a function line. */ void func_line_end(void *cookie) { funccall_T *fcp = (funccall_T *)cookie; ufunc_T *fp = fcp->func; if (fp->uf_profiling && fp->uf_tml_idx >= 0) { if (fp->uf_tml_execed) { ++fp->uf_tml_count[fp->uf_tml_idx]; profile_end(&fp->uf_tml_start); profile_sub_wait(&fp->uf_tml_wait, &fp->uf_tml_start); profile_add(&fp->uf_tml_total[fp->uf_tml_idx], &fp->uf_tml_start); profile_self(&fp->uf_tml_self[fp->uf_tml_idx], &fp->uf_tml_start, &fp->uf_tml_children); } fp->uf_tml_idx = -1; } } #endif /* * Return TRUE if the currently active function should be ended, because a * return was encountered or an error occurred. Used inside a ":while". */ int func_has_ended(void *cookie) { funccall_T *fcp = (funccall_T *)cookie; /* Ignore the "abort" flag if the abortion behavior has been changed due to * an error inside a try conditional. */ return (((fcp->func->uf_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( void *cookie) { return ((funccall_T *)cookie)->func->uf_flags & FC_ABORT; } #if defined(FEAT_VIMINFO) || defined(FEAT_SESSION) typedef enum { VAR_FLAVOUR_DEFAULT, /* doesn't start with uppercase */ VAR_FLAVOUR_SESSION, /* starts with uppercase, some lower */ VAR_FLAVOUR_VIMINFO /* all uppercase */ } var_flavour_T; static var_flavour_T var_flavour(char_u *varname); static var_flavour_T var_flavour(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(vir_T *virp, int writing) { char_u *tab; int type = VAR_NUMBER; typval_T tv; funccall_T *save_funccal; if (!writing && (find_viminfo_parameter('!') != NULL)) { tab = vim_strchr(virp->vir_line + 1, '\t'); if (tab != NULL) { *tab++ = '\0'; /* isolate the variable name */ switch (*tab) { case 'S': type = VAR_STRING; break; #ifdef FEAT_FLOAT case 'F': type = VAR_FLOAT; break; #endif case 'D': type = VAR_DICT; break; case 'L': type = VAR_LIST; break; case 'X': type = VAR_SPECIAL; break; } tab = vim_strchr(tab, '\t'); if (tab != NULL) { tv.v_type = type; if (type == VAR_STRING || type == VAR_DICT || type == VAR_LIST) tv.vval.v_string = viminfo_readstring(virp, (int)(tab - virp->vir_line + 1), TRUE); #ifdef FEAT_FLOAT else if (type == VAR_FLOAT) (void)string2float(tab + 1, &tv.vval.v_float); #endif else tv.vval.v_number = atol((char *)tab + 1); if (type == VAR_DICT || type == VAR_LIST) { typval_T *etv = eval_expr(tv.vval.v_string, NULL); if (etv == NULL) /* Failed to parse back the dict or list, use it as a * string. */ tv.v_type = VAR_STRING; else { vim_free(tv.vval.v_string); tv = *etv; vim_free(etv); } } /* when in a function use global variables */ save_funccal = current_funccal; current_funccal = NULL; set_var(virp->vir_line + 1, &tv, FALSE); current_funccal = save_funccal; if (tv.v_type == VAR_STRING) vim_free(tv.vval.v_string); else if (tv.v_type == VAR_DICT || tv.v_type == VAR_LIST) clear_tv(&tv); } } } return viminfo_readline(virp); } /* * Write global vars that start with a capital to the viminfo file */ void write_viminfo_varlist(FILE *fp) { hashitem_T *hi; dictitem_T *this_var; int todo; char *s = ""; char_u *p; char_u *tofree; char_u numbuf[NUMBUFLEN]; if (find_viminfo_parameter('!') == NULL) return; fputs(_("\n# global variables:\n"), fp); todo = (int)globvarht.ht_used; for (hi = globvarht.ht_array; todo > 0; ++hi) { if (!HASHITEM_EMPTY(hi)) { --todo; this_var = HI2DI(hi); if (var_flavour(this_var->di_key) == VAR_FLAVOUR_VIMINFO) { switch (this_var->di_tv.v_type) { case VAR_STRING: s = "STR"; break; case VAR_NUMBER: s = "NUM"; break; case VAR_FLOAT: s = "FLO"; break; case VAR_DICT: s = "DIC"; break; case VAR_LIST: s = "LIS"; break; case VAR_SPECIAL: s = "XPL"; break; case VAR_UNKNOWN: case VAR_FUNC: case VAR_PARTIAL: case VAR_JOB: case VAR_CHANNEL: continue; } fprintf(fp, "!%s\t%s\t", this_var->di_key, s); p = echo_string(&this_var->di_tv, &tofree, numbuf, 0); if (p != NULL) viminfo_writestring(fp, p); vim_free(tofree); } } } } #endif #if defined(FEAT_SESSION) || defined(PROTO) int store_session_globals(FILE *fd) { hashitem_T *hi; dictitem_T *this_var; int todo; char_u *p, *t; todo = (int)globvarht.ht_used; for (hi = globvarht.ht_array; todo > 0; ++hi) { if (!HASHITEM_EMPTY(hi)) { --todo; this_var = HI2DI(hi); if ((this_var->di_tv.v_type == VAR_NUMBER || this_var->di_tv.v_type == VAR_STRING) && var_flavour(this_var->di_key) == VAR_FLAVOUR_SESSION) { /* Escape special characters with a backslash. Turn a LF and * CR into \n and \r. */ p = vim_strsave_escaped(get_tv_string(&this_var->di_tv), (char_u *)"\\\"\n\r"); if (p == NULL) /* out of memory */ break; 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->di_key, (this_var->di_tv.v_type == VAR_STRING) ? '"' : ' ', p, (this_var->di_tv.v_type == VAR_STRING) ? '"' : ' ') < 0) || put_eol(fd) == FAIL) { vim_free(p); return FAIL; } vim_free(p); } #ifdef FEAT_FLOAT else if (this_var->di_tv.v_type == VAR_FLOAT && var_flavour(this_var->di_key) == VAR_FLAVOUR_SESSION) { float_T f = this_var->di_tv.vval.v_float; int sign = ' '; if (f < 0) { f = -f; sign = '-'; } if ((fprintf(fd, "let %s = %c%f", this_var->di_key, sign, f) < 0) || put_eol(fd) == FAIL) return FAIL; } #endif } } return OK; } #endif /* * Display script name where an item was last set. * Should only be invoked when 'verbose' is non-zero. */ void last_set_msg(scid_T scriptID) { char_u *p; if (scriptID != 0) { p = home_replace_save(NULL, get_scriptname(scriptID)); if (p != NULL) { verbose_enter(); MSG_PUTS(_("\n\tLast set from ")); MSG_PUTS(p); vim_free(p); verbose_leave(); } } } /* * List v:oldfiles in a nice way. */ void ex_oldfiles(exarg_T *eap UNUSED) { list_T *l = vimvars[VV_OLDFILES].vv_list; listitem_T *li; int nr = 0; if (l == NULL) msg((char_u *)_("No old files")); else { msg_start(); msg_scroll = TRUE; for (li = l->lv_first; li != NULL && !got_int; li = li->li_next) { msg_outnum((long)++nr); MSG_PUTS(": "); msg_outtrans(get_tv_string(&li->li_tv)); msg_putchar('\n'); out_flush(); /* output one line at a time */ ui_breakcheck(); } /* Assume "got_int" was set to truncate the listing. */ got_int = FALSE; #ifdef FEAT_BROWSE_CMD if (cmdmod.browse) { quit_more = FALSE; nr = prompt_for_number(FALSE); msg_starthere(); if (nr > 0) { char_u *p = list_find_str(get_vim_var_list(VV_OLDFILES), (long)nr); if (p != NULL) { p = expand_env_save(p); eap->arg = p; eap->cmdidx = CMD_edit; cmdmod.browse = FALSE; do_exedit(eap, NULL); vim_free(p); } } } #endif } } /* reset v:option_new, v:option_old and v:option_type */ void reset_v_option_vars(void) { set_vim_var_string(VV_OPTION_NEW, NULL, -1); set_vim_var_string(VV_OPTION_OLD, NULL, -1); set_vim_var_string(VV_OPTION_TYPE, NULL, -1); } #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(char_u **fnamep, char_u **bufp, int *fnamelen); static int shortpath_for_invalid_fname(char_u **fname, char_u **bufp, int *fnamelen); static int shortpath_for_partial(char_u **fnamep, char_u **bufp, int *fnamelen); /* * Get the short path (8.3) for the filename in "fnamep". * Only works for a valid file name. * When the path gets longer "fnamep" is changed and the allocated buffer * is put in "bufp". * *fnamelen is the length of "fnamep" and set to 0 for a nonexistent path. * Returns OK on success, FAIL on failure. */ static int get_short_pathname(char_u **fnamep, char_u **bufp, int *fnamelen) { int l, len; char_u *newbuf; len = *fnamelen; l = GetShortPathName((LPSTR)*fnamep, (LPSTR)*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 FAIL; vim_free(*bufp); *fnamep = *bufp = newbuf; /* Really should always succeed, as the buffer is big enough. */ l = GetShortPathName((LPSTR)*fnamep, (LPSTR)*fnamep, l+1); } *fnamelen = l; return OK; } /* * Get the short path (8.3) for the filename in "fname". The converted * path is returned in "bufp". * * Some of the directories specified in "fname" may not exist. This function * will shorten the existing directories at the beginning of the path and then * append the remaining non-existing path. * * fname - Pointer to the filename to shorten. On return, contains the * pointer to the shortened pathname * bufp - Pointer to an allocated buffer for the filename. * fnamelen - Length of the filename pointed to by fname * * Returns OK on success (or nothing done) and FAIL on failure (out of memory). */ static int shortpath_for_invalid_fname( char_u **fname, char_u **bufp, int *fnamelen) { char_u *short_fname, *save_fname, *pbuf_unused; char_u *endp, *save_endp; char_u ch; int old_len, len; int new_len, sfx_len; int retval = OK; /* Make a copy */ old_len = *fnamelen; save_fname = vim_strnsave(*fname, old_len); pbuf_unused = NULL; short_fname = NULL; endp = save_fname + old_len - 1; /* Find the end of the copy */ save_endp = endp; /* * Try shortening the supplied path till it succeeds by removing one * directory at a time from the tail of the path. */ len = 0; for (;;) { /* go back one path-separator */ while (endp > save_fname && !after_pathsep(save_fname, endp + 1)) --endp; if (endp <= save_fname) break; /* processed the complete path */ /* * Replace the path separator with a NUL and try to shorten the * resulting path. */ ch = *endp; *endp = 0; short_fname = save_fname; len = (int)STRLEN(short_fname) + 1; if (get_short_pathname(&short_fname, &pbuf_unused, &len) == FAIL) { retval = FAIL; goto theend; } *endp = ch; /* preserve the string */ if (len > 0) break; /* successfully shortened the path */ /* failed to shorten the path. Skip the path separator */ --endp; } if (len > 0) { /* * Succeeded in shortening the path. Now concatenate the shortened * path with the remaining path at the tail. */ /* Compute the length of the new path. */ sfx_len = (int)(save_endp - endp) + 1; new_len = len + sfx_len; *fnamelen = new_len; vim_free(*bufp); if (new_len > old_len) { /* There is not enough space in the currently allocated string, * copy it to a buffer big enough. */ *fname = *bufp = vim_strnsave(short_fname, new_len); if (*fname == NULL) { retval = FAIL; goto theend; } } else { /* Transfer short_fname to the main buffer (it's big enough), * unless get_short_pathname() did its work in-place. */ *fname = *bufp = save_fname; if (short_fname != save_fname) vim_strncpy(save_fname, short_fname, len); save_fname = NULL; } /* concat the not-shortened part of the path */ vim_strncpy(*fname + len, endp, sfx_len); (*fname)[new_len] = NUL; } theend: vim_free(pbuf_unused); vim_free(save_fname); return retval; } /* * Get a pathname for a partial path. * Returns OK for success, FAIL for failure. */ static int shortpath_for_partial( 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 separators from the RHS.. so we know which part * of the path to return. */ sepcount = 0; for (p = *fnamep; p < *fnamep + *fnamelen; mb_ptr_adv(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 = (int)STRLEN(tfname); if (get_short_pathname(&tfname, &pbuf, &len) == FAIL) return FAIL; 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) == FAIL) return FAIL; } /* Count the paths backward to find the beginning of the desired string. */ for (p = tfname + len - 1; p >= tfname; --p) { #ifdef FEAT_MBYTE if (has_mbyte) p -= mb_head_off(tfname, p); #endif if (vim_ispathsep(*p)) { if (sepcount == 0 || (hasTilde && sepcount == 1)) break; else sepcount --; } } if (hasTilde) { --p; if (p >= tfname) *p = '~'; else return FAIL; } 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 OK; } #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 or -1 for failure. * When there is an error, *fnamep is set to NULL. */ int modify_fname( 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 char_u *fname_start = *fnamep; 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; mb_ptr_adv(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; } #ifdef WIN3264 # if _WIN32_WINNT >= 0x0500 if (vim_strchr(*fnamep, '~') != NULL) { /* Expand 8.3 filename to full path. Needed to make sure the same * file does not have two different names. * Note: problem does not occur if _WIN32_WINNT < 0x0500. */ p = alloc(_MAX_PATH + 1); if (p != NULL) { if (GetLongPathName((LPSTR)*fnamep, (LPSTR)p, _MAX_PATH)) { vim_free(*bufp); *bufp = *fnamep = p; } else vim_free(p); } } # endif #endif /* 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 && after_pathsep(s, tail)) mb_ptr_back(*fnamep, tail); *fnamelen = (int)(tail - *fnamep); #ifdef VMS if (*fnamelen > 0) *fnamelen += 1; /* the path separator is part of the path */ #endif if (*fnamelen == 0) { /* Result is empty. Turn it into "." to make ":cd %:h" work. */ p = vim_strsave((char_u *)"."); if (p == NULL) return -1; vim_free(*bufp); *bufp = *fnamep = tail = p; *fnamelen = 1; } else { while (tail > s && !after_pathsep(s, tail)) mb_ptr_back(*fnamep, tail); } } /* ":8" - shortname */ if (src[*usedlen] == ':' && src[*usedlen + 1] == '8') { *usedlen += 2; #ifdef WIN3264 has_shortname = 1; #endif } #ifdef WIN3264 /* * Handle ":8" after we have done 'heads' and before we do 'tails'. */ if (has_shortname) { /* Copy the string if it is shortened by :h and when it wasn't copied * yet, because we are going to change it in place. Avoids changing * the buffer name for "%:8". */ if (*fnamelen < (int)STRLEN(*fnamep) || *fnamep == fname_start) { p = vim_strnsave(*fnamep, *fnamelen); if (p == NULL) 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) == FAIL) return -1; } else { int l = *fnamelen; /* Simple case, already have the full-name. * Nearly always shorter, so try first time. */ if (get_short_pathname(fnamep, bufp, &l) == FAIL) return -1; if (l == 0) { /* Couldn't find the filename, search the paths. */ l = *fnamelen; if (shortpath_for_invalid_fname(fnamep, bufp, &l) == FAIL) 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; } } if (src[*usedlen] == ':' && src[*usedlen + 1] == 'S') { /* vim_strsave_shellescape() needs a NUL terminated string. */ c = (*fnamep)[*fnamelen]; if (c != NUL) (*fnamep)[*fnamelen] = NUL; p = vim_strsave_shellescape(*fnamep, FALSE, FALSE); if (c != NUL) (*fnamep)[*fnamelen] = c; if (p == NULL) return -1; vim_free(*bufp); *bufp = *fnamep = p; *fnamelen = (int)STRLEN(p); *usedlen += 2; } 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( 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; char_u *end; garray_T ga; char_u *ret; char_u *save_cpo; char_u *zero_width = NULL; /* Make 'cpoptions' empty, so that the 'l' flag doesn't work here */ save_cpo = p_cpo; p_cpo = empty_option; 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; end = str + STRLEN(str); while (vim_regexec_nl(®match, str, (colnr_T)(tail - str))) { /* Skip empty match except for first match. */ if (regmatch.startp[0] == regmatch.endp[0]) { if (zero_width == regmatch.startp[0]) { /* avoid getting stuck on a match with an empty string */ i = MB_PTR2LEN(tail); mch_memmove((char_u *)ga.ga_data + ga.ga_len, tail, (size_t)i); ga.ga_len += i; tail += i; continue; } zero_width = regmatch.startp[0]; } /* * 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(®match, sub, tail, FALSE, TRUE, FALSE); if (ga_grow(&ga, (int)((end - 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(®match, sub, (char_u *)ga.ga_data + ga.ga_len + i, TRUE, TRUE, FALSE); ga.ga_len += i + sublen - 1; 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_regfree(regmatch.regprog); } ret = vim_strsave(ga.ga_data == NULL ? str : (char_u *)ga.ga_data); ga_clear(&ga); if (p_cpo == empty_option) p_cpo = save_cpo; else /* Darn, evaluating {sub} expression changed the value. */ free_string_option(save_cpo); return ret; } #endif /* defined(FEAT_MODIFY_FNAME) || defined(FEAT_EVAL) */ vim-7.4.1689/src/ex_cmds.c000066400000000000000000005761621267703067000151730ustar00rootroot00000000000000/* 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_FLOAT # include #endif static int linelen(int *has_tab); static void do_filter(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(char_u *); static void do_viminfo(FILE *fp_in, FILE *fp_out, int flags); static int viminfo_encoding(vir_T *virp); static int read_viminfo_up_to_marks(vir_T *virp, int forceit, int writing); #endif static int check_readonly(int *forceit, buf_T *buf); #ifdef FEAT_AUTOCMD static void delbuf_msg(char_u *name); #endif static int #ifdef __BORLANDC__ _RTLENTRYF #endif help_compare(const void *s1, const void *s2); static void prepare_help_buffer(void); /* * ":ascii" and "ga". */ void do_ascii(exarg_T *eap UNUSED) { int c; int cval; char buf1[20]; char buf2[20]; char_u buf3[7]; #ifdef FEAT_MBYTE int cc[MAX_MCO]; int ci = 0; int len; if (enc_utf8) c = utfc_ptr2char(ml_get_cursor(), cc); 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 (c == CAR && get_fileformat(curbuf) == EOL_MAC) cval = NL; /* NL is stored as CR */ else cval = c; if (vim_isprintc_strict(c) && (c < ' ' #ifndef EBCDIC || c > '~' #endif )) { transchar_nonprint(buf3, c); vim_snprintf(buf1, sizeof(buf1), " <%s>", (char *)buf3); } else buf1[0] = NUL; #ifndef EBCDIC if (c >= 0x80) vim_snprintf(buf2, sizeof(buf2), " ", (char *)transchar(c & 0x7f)); else #endif buf2[0] = NUL; vim_snprintf((char *)IObuff, IOSIZE, _("<%s>%s%s %d, Hex %02x, Octal %03o"), transchar(c), buf1, buf2, cval, cval, cval); #ifdef FEAT_MBYTE if (enc_utf8) c = cc[ci++]; else c = 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 (enc_utf8 && utf_iscomposing(c) # ifdef USE_GUI && !gui.in_use # endif ) IObuff[len++] = ' '; /* draw composing char on top of a space */ len += (*mb_char2bytes)(c, IObuff + len); vim_snprintf((char *)IObuff + len, IOSIZE - len, c < 0x10000 ? _("> %d, Hex %04x, Octal %o") : _("> %d, Hex %08x, Octal %o"), c, c, c); if (ci == MAX_MCO) break; if (enc_utf8) c = cc[ci++]; else c = 0; } #endif msg(IObuff); } /* * ":left", ":center" and ":right": align text. */ void ex_align(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 { has_tab = FALSE; /* avoid uninit warnings */ 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(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; } /* Buffer for two lines used during sorting. They are allocated to * contain the longest line being sorted. */ static char_u *sortbuf1; static char_u *sortbuf2; static int sort_ic; /* ignore case */ static int sort_nr; /* sort on number */ static int sort_rx; /* sort on regex instead of skipping it */ #ifdef FEAT_FLOAT static int sort_flt; /* sort on floating number */ #endif static int sort_abort; /* flag to indicate if sorting has been interrupted */ /* Struct to store info to be sorted. */ typedef struct { linenr_T lnum; /* line number */ union { struct { long start_col_nr; /* starting column number */ long end_col_nr; /* ending column number */ } line; long value; /* value if sorting by integer */ #ifdef FEAT_FLOAT float_T value_flt; /* value if sorting by float */ #endif } st_u; } sorti_T; static int #ifdef __BORLANDC__ _RTLENTRYF #endif sort_compare(const void *s1, const void *s2); static int #ifdef __BORLANDC__ _RTLENTRYF #endif sort_compare(const void *s1, const void *s2) { sorti_T l1 = *(sorti_T *)s1; sorti_T l2 = *(sorti_T *)s2; int result = 0; /* If the user interrupts, there's no way to stop qsort() immediately, but * if we return 0 every time, qsort will assume it's done sorting and * exit. */ if (sort_abort) return 0; fast_breakcheck(); if (got_int) sort_abort = TRUE; /* When sorting numbers "start_col_nr" is the number, not the column * number. */ if (sort_nr) result = l1.st_u.value == l2.st_u.value ? 0 : l1.st_u.value > l2.st_u.value ? 1 : -1; #ifdef FEAT_FLOAT else if (sort_flt) result = l1.st_u.value_flt == l2.st_u.value_flt ? 0 : l1.st_u.value_flt > l2.st_u.value_flt ? 1 : -1; #endif else { /* We need to copy one line into "sortbuf1", because there is no * guarantee that the first pointer becomes invalid when obtaining the * second one. */ STRNCPY(sortbuf1, ml_get(l1.lnum) + l1.st_u.line.start_col_nr, l1.st_u.line.end_col_nr - l1.st_u.line.start_col_nr + 1); sortbuf1[l1.st_u.line.end_col_nr - l1.st_u.line.start_col_nr] = 0; STRNCPY(sortbuf2, ml_get(l2.lnum) + l2.st_u.line.start_col_nr, l2.st_u.line.end_col_nr - l2.st_u.line.start_col_nr + 1); sortbuf2[l2.st_u.line.end_col_nr - l2.st_u.line.start_col_nr] = 0; result = sort_ic ? STRICMP(sortbuf1, sortbuf2) : STRCMP(sortbuf1, sortbuf2); } /* If two lines have the same value, preserve the original line order. */ if (result == 0) return (int)(l1.lnum - l2.lnum); return result; } /* * ":sort". */ void ex_sort(exarg_T *eap) { regmatch_T regmatch; int len; linenr_T lnum; long maxlen = 0; sorti_T *nrs; size_t count = (size_t)(eap->line2 - eap->line1 + 1); size_t i; char_u *p; char_u *s; char_u *s2; char_u c; /* temporary character storage */ int unique = FALSE; long deleted; colnr_T start_col; colnr_T end_col; int sort_what = 0; int format_found = 0; /* Sorting one line is really quick! */ if (count <= 1) return; if (u_save((linenr_T)(eap->line1 - 1), (linenr_T)(eap->line2 + 1)) == FAIL) return; sortbuf1 = NULL; sortbuf2 = NULL; regmatch.regprog = NULL; nrs = (sorti_T *)lalloc((long_u)(count * sizeof(sorti_T)), TRUE); if (nrs == NULL) goto sortend; sort_abort = sort_ic = sort_rx = sort_nr = 0; #ifdef FEAT_FLOAT sort_flt = 0; #endif for (p = eap->arg; *p != NUL; ++p) { if (vim_iswhite(*p)) ; else if (*p == 'i') sort_ic = TRUE; else if (*p == 'r') sort_rx = TRUE; else if (*p == 'n') { sort_nr = 1; ++format_found; } #ifdef FEAT_FLOAT else if (*p == 'f') { sort_flt = 1; ++format_found; } #endif else if (*p == 'b') { sort_what = STR2NR_BIN + STR2NR_FORCE; ++format_found; } else if (*p == 'o') { sort_what = STR2NR_OCT + STR2NR_FORCE; ++format_found; } else if (*p == 'x') { sort_what = STR2NR_HEX + STR2NR_FORCE; ++format_found; } else if (*p == 'u') unique = TRUE; else if (*p == '"') /* comment start */ break; else if (check_nextcmd(p) != NULL) { eap->nextcmd = check_nextcmd(p); break; } else if (!ASCII_ISALPHA(*p) && regmatch.regprog == NULL) { s = skip_regexp(p + 1, *p, TRUE, NULL); if (*s != *p) { EMSG(_(e_invalpat)); goto sortend; } *s = NUL; /* Use last search pattern if sort pattern is empty. */ if (s == p + 1) { if (last_search_pat() == NULL) { EMSG(_(e_noprevre)); goto sortend; } regmatch.regprog = vim_regcomp(last_search_pat(), RE_MAGIC); } else regmatch.regprog = vim_regcomp(p + 1, RE_MAGIC); if (regmatch.regprog == NULL) goto sortend; p = s; /* continue after the regexp */ regmatch.rm_ic = p_ic; } else { EMSG2(_(e_invarg2), p); goto sortend; } } /* Can only have one of 'n', 'b', 'o' and 'x'. */ if (format_found > 1) { EMSG(_(e_invarg)); goto sortend; } /* From here on "sort_nr" is used as a flag for any integer number * sorting. */ sort_nr += sort_what; /* * Make an array with all line numbers. This avoids having to copy all * the lines into allocated memory. * When sorting on strings "start_col_nr" is the offset in the line, for * numbers sorting it's the number to sort on. This means the pattern * matching and number conversion only has to be done once per line. * Also get the longest line length for allocating "sortbuf". */ for (lnum = eap->line1; lnum <= eap->line2; ++lnum) { s = ml_get(lnum); len = (int)STRLEN(s); if (maxlen < len) maxlen = len; start_col = 0; end_col = len; if (regmatch.regprog != NULL && vim_regexec(®match, s, 0)) { if (sort_rx) { start_col = (colnr_T)(regmatch.startp[0] - s); end_col = (colnr_T)(regmatch.endp[0] - s); } else start_col = (colnr_T)(regmatch.endp[0] - s); } else if (regmatch.regprog != NULL) end_col = 0; if (sort_nr #ifdef FEAT_FLOAT || sort_flt #endif ) { /* Make sure vim_str2nr doesn't read any digits past the end * of the match, by temporarily terminating the string there */ s2 = s + end_col; c = *s2; *s2 = NUL; /* Sorting on number: Store the number itself. */ p = s + start_col; if (sort_nr) { if (sort_what & STR2NR_HEX) s = skiptohex(p); else if (sort_what & STR2NR_BIN) s = skiptobin(p); else s = skiptodigit(p); if (s > p && s[-1] == '-') --s; /* include preceding negative sign */ if (*s == NUL) /* empty line should sort before any number */ nrs[lnum - eap->line1].st_u.value = -MAXLNUM; else vim_str2nr(s, NULL, NULL, sort_what, &nrs[lnum - eap->line1].st_u.value, NULL, 0); } #ifdef FEAT_FLOAT else { s = skipwhite(p); if (*s == '+') s = skipwhite(s + 1); if (*s == NUL) /* empty line should sort before any number */ nrs[lnum - eap->line1].st_u.value_flt = -DBL_MAX; else nrs[lnum - eap->line1].st_u.value_flt = strtod((char *)s, NULL); } #endif *s2 = c; } else { /* Store the column to sort at. */ nrs[lnum - eap->line1].st_u.line.start_col_nr = start_col; nrs[lnum - eap->line1].st_u.line.end_col_nr = end_col; } nrs[lnum - eap->line1].lnum = lnum; if (regmatch.regprog != NULL) fast_breakcheck(); if (got_int) goto sortend; } /* Allocate a buffer that can hold the longest line. */ sortbuf1 = alloc((unsigned)maxlen + 1); if (sortbuf1 == NULL) goto sortend; sortbuf2 = alloc((unsigned)maxlen + 1); if (sortbuf2 == NULL) goto sortend; /* Sort the array of line numbers. Note: can't be interrupted! */ qsort((void *)nrs, count, sizeof(sorti_T), sort_compare); if (sort_abort) goto sortend; /* Insert the lines in the sorted order below the last one. */ lnum = eap->line2; for (i = 0; i < count; ++i) { s = ml_get(nrs[eap->forceit ? count - i - 1 : i].lnum); if (!unique || i == 0 || (sort_ic ? STRICMP(s, sortbuf1) : STRCMP(s, sortbuf1)) != 0) { /* Copy the line into a buffer, it may become invalid in * ml_append(). And it's needed for "unique". */ STRCPY(sortbuf1, s); if (ml_append(lnum++, sortbuf1, (colnr_T)0, FALSE) == FAIL) break; } fast_breakcheck(); if (got_int) goto sortend; } /* delete the original lines if appending worked */ if (i == count) for (i = 0; i < count; ++i) ml_delete(eap->line1, FALSE); else count = 0; /* Adjust marks for deleted (or added) lines and prepare for displaying. */ deleted = (long)(count - (lnum - eap->line2)); if (deleted > 0) mark_adjust(eap->line2 - deleted, eap->line2, (long)MAXLNUM, -deleted); else if (deleted < 0) mark_adjust(eap->line2, MAXLNUM, -deleted, 0L); changed_lines(eap->line1, 0, eap->line2 + 1, -deleted); curwin->w_cursor.lnum = eap->line1; beginline(BL_WHITE | BL_FIX); sortend: vim_free(nrs); vim_free(sortbuf1); vim_free(sortbuf2); vim_regfree(regmatch.regprog); if (got_int) EMSG(_(e_interr)); } /* * ":retab". */ void ex_retab(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)(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(); } /* * :move command - move lines line1-line2 to line dest * * return FAIL for failure, OK otherwise */ int do_move(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 */ #ifdef FEAT_FOLDING int isFolded; /* Moving lines seems to corrupt the folds, delete folding info now * and recreate it when finished. Don't do this for manual folding, it * would delete all folds. */ isFolded = hasAnyFolding(curwin) && !foldmethodIsManual(curwin); if (isFolded) deleteFoldRecurse(&curwin->w_folds); #endif 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); changed_lines(last_line - num_lines + 1, 0, last_line + 1, num_lines); 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); changed_lines(last_line - num_lines + 1, 0, last_line + 1, -extra); /* * 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) { dest += num_lines + 1; last_line = curbuf->b_ml.ml_line_count; if (dest > last_line + 1) dest = last_line + 1; changed_lines(line1, 0, dest, 0L); } else changed_lines(dest + 1, 0, line1 + num_lines, 0L); #ifdef FEAT_FOLDING /* recreate folds */ if (isFolded) foldUpdateAll(curwin); #endif return OK; } /* * ":copy" */ void ex_copy(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); } static char_u *prevcmd = NULL; /* the previous command */ #if defined(EXITFREE) || defined(PROTO) void free_prev_shellcmd(void) { vim_free(prevcmd); } #endif /* * 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. */ void do_bang( int addr_count, exarg_T *eap, int forceit, int do_in, int do_out) { char_u *arg = eap->arg; /* command */ linenr_T line1 = eap->line1; /* start of range */ linenr_T line2 = eap->line2; /* end of range */ 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 :! ! [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((unsigned)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 == '!') { if (p > newcmd && p[-1] == '\\') STRMOVE(p - 1, p); 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 */ { /* If % or # appears in the command, it must have been escaped. * Reescape them, so that redoing them does not substitute them by the * buffername. */ char_u *cmd = vim_strsave_escaped(prevcmd, (char_u *)"%#"); if (cmd != NULL) { AppendToRedobuffLit(cmd, -1); vim_free(cmd); } else AppendToRedobuffLit(prevcmd, -1); 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); #ifdef FEAT_AUTOCMD apply_autocmds(EVENT_SHELLFILTERPOST, NULL, NULL, FALSE, curbuf); #endif } if (free_newcmd) vim_free(newcmd); } /* * do_filter: filter lines through a command given by the user * * We mostly 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. * Alternatively, if on Unix and redirecting input or output, but not both, * and the 'shelltemp' option isn't set, use pipes. * We use input redirection if do_in is TRUE. * We use output redirection if do_out is TRUE. */ static void do_filter( linenr_T line1, linenr_T line2, exarg_T *eap, /* for forced 'ff' and 'fenc' */ char_u *cmd, int do_in, int 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 int shell_flags = 0; 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(); /* * When using temp files: * 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 * * When writing the input with a pipe or when catching the output with a * pipe only need to do 3. */ if (do_out) shell_flags |= SHELL_DOOUT; #ifdef FEAT_FILTERPIPE if (!do_in && do_out && !p_stmp) { /* Use a pipe to fetch stdout of the command, do not use a temp file. */ shell_flags |= SHELL_READ; curwin->w_cursor.lnum = line2; } else if (do_in && !do_out && !p_stmp) { /* Use a pipe to write stdin of the command, do not use a temp file. */ shell_flags |= SHELL_WRITE; curbuf->b_op_start.lnum = line1; curbuf->b_op_end.lnum = line2; } else if (do_in && do_out && !p_stmp) { /* Use a pipe to write stdin and fetch stdout of the command, do not * use a temp file. */ shell_flags |= SHELL_READ|SHELL_WRITE; curbuf->b_op_start.lnum = line1; curbuf->b_op_end.lnum = line2; curwin->w_cursor.lnum = line2; } else #endif if ((do_in && (itmp = vim_tempname('i', FALSE)) == NULL) || (do_out && (otmp = vim_tempname('o', FALSE)) == 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 (itmp != NULL && 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'); /* Create the shell command in allocated memory. */ 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(); if (do_out) { if (u_save((linenr_T)(line2), (linenr_T)(line2 + 1)) == FAIL) { vim_free(cmd_buf); goto error; } redraw_curbuf_later(VALID); } read_linecount = curbuf->b_ml.ml_line_count; /* * 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 | shell_flags)) { 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 (otmp != NULL) { 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 } read_linecount = curbuf->b_ml.ml_line_count - read_linecount; if (shell_flags & SHELL_READ) { curbuf->b_op_start.lnum = line2 + 1; curbuf->b_op_end.lnum = curwin->w_cursor.lnum; appended_lines_mark(line2, read_linecount); } if (do_in) { if (cmdmod.keepmarks || vim_strchr(p_cpo, CPO_REMMARK) == NULL) { 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 */ #ifdef FEAT_FOLDING foldUpdate(curwin, curbuf->b_op_start.lnum, curbuf->b_op_end.lnum); #endif } else { /* * Put cursor on last new line for ":r !cmd". */ linecount = curbuf->b_op_end.lnum - curbuf->b_op_start.lnum + 1; curwin->w_cursor.lnum = curbuf->b_op_end.lnum; } beginline(BL_WHITE | BL_FIX); /* cursor on first non-blank */ --no_wait_return; if (linecount > p_report) { if (do_in) { vim_snprintf((char *)msg_buf, sizeof(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, 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( 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(); #ifdef FEAT_AUTOCMD apply_autocmds(EVENT_SHELLCMDPOST, NULL, NULL, FALSE, curbuf); #endif } /* * 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( 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; #if defined(UNIX) int is_fish_shell; char_u *shell_name = get_isolated_shell_name(); /* Account for fish's different syntax for subshells */ is_fish_shell = (fnamecmp(shell_name, "fish") == 0); vim_free(shell_name); if (is_fish_shell) len = (long_u)STRLEN(cmd) + 13; /* "begin; " + "; end" + NUL */ else #endif 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) /* * Put braces around the command (for concatenated commands) when * redirecting input and/or output. */ if (itmp != NULL || otmp != NULL) { if (is_fish_shell) vim_snprintf((char *)buf, len, "begin; %s; end", (char *)cmd); else vim_snprintf((char *)buf, len, "(%s)", (char *)cmd); } else STRCPY(buf, 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; } STRCAT(buf, " <"); /* " < " causes problems on Amiga */ STRCAT(buf, itmp); 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, (int)len, p_srr, otmp); return buf; } /* * Append output redirection for file "fname" to the end of string buffer * "buf[buflen]" * 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( char_u *buf, int buflen, char_u *opt, char_u *fname) { char_u *p; char_u *end; end = buf + STRLEN(buf); /* find "%s" */ for (p = opt; (p = vim_strchr(p, '%')) != NULL; ++p) { if (p[1] == 's') /* found %s */ break; if (p[1] == '%') /* skip %% */ ++p; } if (p != NULL) { *end = ' '; /* not really needed? Not with sh, ksh or bash */ vim_snprintf((char *)end + 1, (size_t)(buflen - (end + 1 - buf)), (char *)opt, (char *)fname); } else vim_snprintf((char *)end, (size_t)(buflen - (end - buf)), #ifdef FEAT_QUICKFIX " %s %s", #else " %s%s", /* " > %s" causes problems on Amiga */ #endif (char *)opt, (char *)fname); } #if defined(FEAT_VIMINFO) || defined(PROTO) static int no_viminfo(void); static void write_viminfo_barlines(vir_T *virp, FILE *fp_out); static int viminfo_errcnt; static int no_viminfo(void) { /* "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(char *errnum, char *message, char_u *line) { vim_snprintf((char *)IObuff, IOSIZE, _("%sviminfo: %s in line: "), errnum, message); STRNCAT(IObuff, line, IOSIZE - STRLEN(IObuff) - 1); if (IObuff[STRLEN(IObuff) - 1] == '\n') IObuff[STRLEN(IObuff) - 1] = NUL; 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 "flags" includes VIF_FORCEIT. -- webb */ int read_viminfo( char_u *file, /* file name or NULL to use default name */ int flags) /* VIF_WANT_INFO et al. */ { FILE *fp; char_u *fname; if (no_viminfo()) return FAIL; fname = viminfo_filename(file); /* get file name in allocated buffer */ if (fname == NULL) return FAIL; fp = mch_fopen((char *)fname, READBIN); if (p_verbose > 0) { verbose_enter(); smsg((char_u *)_("Reading viminfo file \"%s\"%s%s%s"), fname, (flags & VIF_WANT_INFO) ? _(" info") : "", (flags & VIF_WANT_MARKS) ? _(" marks") : "", (flags & VIF_GET_OLDFILES) ? _(" oldfiles") : "", fp == NULL ? _(" FAILED") : ""); verbose_leave(); } vim_free(fname); if (fp == NULL) return FAIL; viminfo_errcnt = 0; do_viminfo(fp, NULL, flags); fclose(fp); return OK; } /* * 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. */ void write_viminfo(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 #ifdef WIN3264 int hidden = FALSE; #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 = (dev_t)0; st_old.st_ino = 0; st_old.st_mode = 0600; if (mch_stat((char *)fname, &st_old) == 0 && getuid() != ROOT_UID && !(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 = msg_didany; /* avoid a wait_return for this message, it's annoying */ EMSG2(_("E137: Viminfo file is not writable: %s"), fname); msg_didany = tt; fclose(fp_in); goto end; } #endif #ifdef WIN3264 /* Get the file attributes of the existing viminfo file. */ hidden = mch_ishidden(fname); #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 FEAT_GUI_W32 gui_is_win32s(), # else FALSE, # endif #endif fname, #ifdef VMS (char_u *)"-tmp", #else (char_u *)".tmp", #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) { #ifdef VMS /* fdopen() fails for some reason */ umask_save = umask(077); fp_out = mch_fopen((char *)tempname, WRITEBIN); (void)umask(umask_save); #else int fd; /* Use mch_open() to be able to use O_NOFOLLOW and set file * protection: * Unix: same as original file, but strip s-bit. Reset umask to * avoid it getting in the way. * Others: r&w for user only. */ # ifdef UNIX umask_save = umask(0); fd = mch_open((char *)tempname, O_CREAT|O_EXTRA|O_EXCL|O_WRONLY|O_NOFOLLOW, (int)((st_old.st_mode & 0777) | 0600)); (void)umask(umask_save); # else fd = mch_open((char *)tempname, O_CREAT|O_EXTRA|O_EXCL|O_WRONLY|O_NOFOLLOW, 0600); # endif if (fd < 0) fp_out = NULL; else fp_out = fdopen(fd, WRITEBIN); #endif /* VMS */ /* * 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', TRUE)) != NULL) fp_out = mch_fopen((char *)tempname, WRITEBIN); } #if defined(UNIX) && defined(HAVE_FCHOWN) /* * Make sure the owner can read/write it. This only works for * root. */ if (fp_out != NULL) ignored = fchown(fileno(fp_out), 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 == NULL) ? fname : tempname); if (fp_in != NULL) fclose(fp_in); goto end; } if (p_verbose > 0) { verbose_enter(); smsg((char_u *)_("Writing viminfo file \"%s\""), fname); verbose_leave(); } viminfo_errcnt = 0; do_viminfo(fp_in, fp_out, forceit ? 0 : (VIF_WANT_INFO | VIF_WANT_MARKS)); if (fclose(fp_out) == EOF) ++viminfo_errcnt; if (fp_in != NULL) { fclose(fp_in); /* In case of an error keep the original viminfo file. Otherwise * rename the newly written file. Give an error if that fails. */ if (viminfo_errcnt == 0) { if (vim_rename(tempname, fname) == -1) { ++viminfo_errcnt; EMSG2(_("E886: Can't rename viminfo file to %s!"), fname); } # ifdef WIN3264 /* If the viminfo file was hidden then also hide the new file. */ else if (hidden) mch_hide(fname); # endif } if (viminfo_errcnt > 0) 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(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(FILE *fp_in, FILE *fp_out, int flags) { int count = 0; int eof = FALSE; vir_T vir; int merge = FALSE; if ((vir.vir_line = alloc(LSIZE)) == NULL) return; vir.vir_fd = fp_in; #ifdef FEAT_MBYTE vir.vir_conv.vc_type = CONV_NONE; #endif ga_init2(&vir.vir_barlines, (int)sizeof(char_u *), 100); if (fp_in != NULL) { if (flags & VIF_WANT_INFO) { eof = read_viminfo_up_to_marks(&vir, flags & VIF_FORCEIT, fp_out != NULL); merge = TRUE; } else if (flags != 0) /* 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); fputs(_("# You may edit it if you're careful!\n\n"), fp_out); #ifdef FEAT_MBYTE fputs(_("# Value of 'encoding' when this file was written\n"), fp_out); 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, merge); #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); write_viminfo_barlines(&vir, fp_out); count = write_viminfo_marks(fp_out); } if (fp_in != NULL && (flags & (VIF_WANT_MARKS | VIF_GET_OLDFILES | VIF_FORCEIT))) copy_viminfo_marks(&vir, fp_out, count, eof, flags); vim_free(vir.vir_line); #ifdef FEAT_MBYTE if (vir.vir_conv.vc_type != CONV_NONE) convert_setup(&vir.vir_conv, NULL, NULL); #endif ga_clear_strings(&vir.vir_barlines); } /* * 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( vir_T *virp, int forceit, int writing) { int eof; buf_T *buf; #ifdef FEAT_CMDHIST prepare_viminfo_history(forceit ? 9999 : 0, writing); #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 '<': /* long line - ignored */ /* A comment or empty line. */ case NUL: case '\r': case '\n': case '#': eof = viminfo_readline(virp); break; case '|': /* copy line (for future use) */ if (writing) ga_add_string(&virp->vir_barlines, virp->vir_line); 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, writing); #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. */ if (!writing) 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(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(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). */ char_u * viminfo_readstring( vir_T *virp, int off, /* offset for virp->vir_line */ int convert UNUSED) /* 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 \n " in first line * - write " < \n " in second line */ void viminfo_writestring(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); } static void write_viminfo_barlines(vir_T *virp, FILE *fp_out) { int i; garray_T *gap = &virp->vir_barlines; if (gap->ga_len > 0) { fputs(_("\n# Bar lines, copied verbatim:\n"), fp_out); for (i = 0; i < gap->ga_len; ++i) fputs(((char **)(gap->ga_data))[i], fp_out); } } #endif /* FEAT_VIMINFO */ /* * Implementation of ":fixdel", also used by get_stty(). * resulting * ^? ^H * not ^? ^? */ void do_fixdel(exarg_T *eap UNUSED) { 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( linenr_T lnum, int use_number, int list) { char_u numbuf[30]; if (curwin->w_p_nu || use_number) { vim_snprintf((char *)numbuf, sizeof(numbuf), "%*ld ", number_width(curwin), (long)lnum); msg_puts_attr(numbuf, hl_attr(HLF_N)); /* Highlight line nrs */ } msg_prt_line(ml_get(lnum), list); } /* * Print a text line. Also in silent mode ("ex -s"). */ void print_line(linenr_T lnum, int use_number, int list) { int save_silent = silent_mode; msg_start(); silent_mode = FALSE; info_message = TRUE; /* use mch_msg(), not mch_errmsg() */ print_line_no_prefix(lnum, use_number, list); if (save_silent) { msg_putchar('\n'); cursor_on(); /* msg_start() switches it off */ out_flush(); silent_mode = save_silent; } info_message = FALSE; } int rename_buffer(char_u *new_fname) { char_u *fname, *sfname, *xfname; buf_T *buf; #ifdef FEAT_AUTOCMD buf = curbuf; apply_autocmds(EVENT_BUFFILEPRE, NULL, NULL, FALSE, curbuf); /* buffer changed, don't change name now */ if (buf != curbuf) return FAIL; # ifdef FEAT_EVAL if (aborting()) /* autocmds may abort script processing */ return FAIL; # 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. * But don't set the alternate file name if the buffer didn't have a * name. */ fname = curbuf->b_ffname; sfname = curbuf->b_sfname; xfname = curbuf->b_fname; curbuf->b_ffname = NULL; curbuf->b_sfname = NULL; if (setfname(curbuf, new_fname, NULL, TRUE) == FAIL) { curbuf->b_ffname = fname; curbuf->b_sfname = sfname; return FAIL; } curbuf->b_flags |= BF_NOTEDITED; if (xfname != NULL && *xfname != NUL) { buf = buflist_new(fname, xfname, curwin->w_cursor.lnum, 0); if (buf != NULL && !cmdmod.keepalt) 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 /* Change directories when the 'acd' option is set. */ DO_AUTOCHDIR return OK; } /* * ":file[!] [fname]". */ void ex_file(exarg_T *eap) { /* ":0file" removes the file name. Check for illegal uses ":3file", * "0file name", etc. */ if (eap->addr_count > 0 && (*eap->arg != NUL || eap->line2 > 0 || eap->addr_count > 1)) { EMSG(_(e_invarg)); return; } if (*eap->arg != NUL || eap->addr_count == 1) { if (rename_buffer(eap->arg) == FAIL) return; } /* print full file name if :cd used */ if (!shortmess(SHM_FILEINFO)) fileinfo(FALSE, FALSE, eap->forceit); } /* * ":update". */ void ex_update(exarg_T *eap) { if (curbufIsChanged()) (void)do_write(eap); } /* * ":write" and ":saveas". */ void ex_write(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(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(BROWSE_SAVE, (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(_(e_bufloaded)); 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); apply_autocmds(EVENT_BUFFILEPRE, NULL, NULL, FALSE, alt_buf); # 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); apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, FALSE, alt_buf); 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; } /* If 'filetype' was empty try detecting it now. */ if (*curbuf->b_p_ft == NUL) { if (au_has_group((char_u *)"filetypedetect")) (void)do_doautocmd((char_u *)"filetypedetect BufRead", TRUE); do_modelines(0); } /* Autocommands may have changed buffer names, esp. when * 'autochdir' is set. */ fname = curbuf->b_sfname; #endif } retval = buf_write(curbuf, ffname, fname, eap->line1, eap->line2, eap, eap->append, eap->forceit, TRUE, FALSE); /* After ":saveas fname" reset 'readonly'. */ if (eap->cmdidx == CMD_saveas) { if (retval == OK) { curbuf->b_p_ro = FALSE; #ifdef FEAT_WINDOWS redraw_tabline = TRUE; #endif } /* Change directories when the 'acd' option is set. */ DO_AUTOCHDIR } } 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. */ int check_overwrite( 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)) && !p_wa #ifdef FEAT_QUICKFIX && !bt_nofile(buf) #endif && vim_fexists(ffname)) { if (!eap->forceit && !eap->append) { #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[DIALOG_MSG_SIZE]; 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; } } /* For ":w! filename" check that no swap file exists for "filename". */ if (other && !emsg_silent) { char_u *dir; char_u *p; int r; char_u *swapname; /* We only try the first entry in 'directory', without checking if * it's writable. If the "." directory is not writable the write * will probably fail anyway. * Use 'shortname' of the current buffer, since there is no buffer * for the written file. */ if (*p_dir == NUL) { dir = alloc(5); if (dir == NULL) return FAIL; STRCPY(dir, "."); } else { dir = alloc(MAXPATHL); if (dir == NULL) return FAIL; p = p_dir; copy_option_part(&p, dir, MAXPATHL, ","); } swapname = makeswapname(fname, ffname, curbuf, dir); vim_free(dir); r = vim_fexists(swapname); if (r) { #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) if (p_confirm || cmdmod.confirm) { char_u buff[DIALOG_MSG_SIZE]; dialog_msg(buff, _("Swap file \"%s\" exists, overwrite anyway?"), swapname); if (vim_dialog_yesno(VIM_QUESTION, NULL, buff, 2) != VIM_YES) { vim_free(swapname); return FAIL; } eap->forceit = TRUE; } else #endif { EMSG2(_("E768: Swap file exists: %s (:silent! overrides)"), swapname); vim_free(swapname); return FAIL; } } vim_free(swapname); } } return OK; } /* * Handle ":wnext", ":wNext" and ":wprevious" commands. */ void ex_wnext(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(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(void) { 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 (either 'readonly' option is set or file 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(int *forceit, buf_T *buf) { struct stat st; /* Handle a file being readonly when the 'readonly' option is set or when * the file exists and permissions are read-only. * We will send 0777 to check_file_readonly(), as the "perm" variable is * important for device checks but not here. */ if (!*forceit && (buf->b_p_ro || (mch_stat((char *)buf->b_ffname, &st) >= 0 && check_file_readonly(buf->b_ffname, 0777)))) { #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) if ((p_confirm || cmdmod.confirm) && buf->b_fname != NULL) { char_u buff[DIALOG_MSG_SIZE]; if (buf->b_p_ro) dialog_msg(buff, _("'readonly' option is set for \"%s\".\nDo you wish to write anyway?"), buf->b_fname); else dialog_msg(buff, _("File permissions of \"%s\" are read-only.\nIt may still be possible to write it.\nDo you wish to try?"), 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 if (buf->b_p_ro) EMSG(_(e_readonly)); else EMSG2(_("E505: \"%s\" is read-only (add ! to override)"), buf->b_fname); 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 successfully opening another file. * 'lnum' is the line number for the cursor in the new file (if non-zero). */ int getfile( int fnum, char_u *ffname, char_u *sfname, int setpm, linenr_T lnum, int forceit) { int other; int retval; char_u *free_me = NULL; if (text_locked()) return 1; #ifdef FEAT_AUTOCMD if (curbuf_locked()) 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), curwin) == 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 * oldwin: Should be "curwin" when editing a new buffer in the current * window, NULL when splitting the window first. When not NULL info * of the previous buffer for "oldwin" is stored. * * return FAIL for failure, OK otherwise */ int do_ecmd( int fnum, char_u *ffname, char_u *sfname, exarg_T *eap, /* can be NULL! */ linenr_T newlnum, int flags, win_T *oldwin) { 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; int did_set_swapcommand = FALSE; #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; pos_T orig_pos; 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; #ifdef FEAT_SPELL int did_get_winopts = FALSE; #endif int readfile_flags = 0; int did_inc_redrawing_disabled = FALSE; 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) { # ifdef FEAT_AUTOCMD if ( # ifdef FEAT_GUI !gui.in_use && # endif au_has_group((char_u *)"FileExplorer")) { /* No browsing supported but we do have the file explorer: * Edit the directory. */ if (ffname == NULL || !mch_isdir(ffname)) ffname = (char_u *)"."; } else # endif { browse_file = do_browse(0, (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 if (sfname != NULL) fname_case(sfname, 0); /* set correct case for sfname */ #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 ? CCGD_AW : 0) | (other_file ? 0 : CCGD_MULTWIN) | ((flags & ECMD_FORCEIT) ? CCGD_FORCEIT : 0) | (eap == NULL ? 0 : CCGD_EXCMD))) { if (fnum == 0 && other_file && ffname != NULL) (void)setaltfname(ffname, sfname, newlnum < 0 ? 0 : newlnum); goto theend; } /* * End Visual mode before switching to another buffer, so the text can be * copied into the GUI selection buffer. */ reset_VIsual(); #ifdef FEAT_AUTOCMD if ((command != NULL || newlnum > (linenr_T)0) && *get_vim_var_str(VV_SWAPCOMMAND) == NUL) { int len; char_u *p; /* Set v:swapcommand for the SwapExists autocommands. */ if (command != NULL) len = (int)STRLEN(command) + 3; else len = 30; p = alloc((unsigned)len); if (p != NULL) { if (command != NULL) vim_snprintf((char *)p, len, ":%s\r", command); else vim_snprintf((char *)p, len, "%ldG", (long)newlnum); set_vim_var_string(VV_SWAPCOMMAND, p, -1); did_set_swapcommand = TRUE; vim_free(p); } } #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 { if (!cmdmod.keepalt) curwin->w_alt_fnum = curbuf->b_fnum; if (oldwin != NULL) buflist_altfpos(oldwin); } 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)); #ifdef FEAT_AUTOCMD /* autocommands may change curwin and curbuf */ if (oldwin != NULL) oldwin = curwin; old_curbuf = curbuf; #endif } if (buf == NULL) goto theend; if (buf->b_ml.ml_mfp == NULL) /* no memfile yet */ { oldbuf = FALSE; } 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(), nothing to do here. */ 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 */ u_sync(FALSE); close_buffer(oldwin, curbuf, (flags & ECMD_HIDE) ? 0 : DOBUF_UNLOAD, FALSE); #ifdef FEAT_AUTOCMD /* Autocommands may open a new window and leave oldwin open * which leads to crashes since the above call sets * oldwin->w_buffer to NULL. */ if (curwin != oldwin && oldwin != aucmd_win && win_valid(oldwin) && oldwin->w_buffer == NULL) win_close(oldwin, FALSE); # 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 { #ifdef FEAT_SYN_HL /* * We could instead free the synblock * and re-attach to buffer, perhaps. */ if (curwin->w_s == &(curwin->w_buffer->b_s)) curwin->w_s = &(buf->b_s); #endif curwin->w_buffer = buf; curbuf = buf; ++curbuf->b_nwindows; /* Set 'fileformat', 'binary' and 'fenc' when forced. */ if (!oldbuf && eap != NULL) { set_file_options(TRUE, eap); #ifdef FEAT_MBYTE set_forced_fenc(eap); #endif } } /* 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(curbuf); #ifdef FEAT_SPELL did_get_winopts = TRUE; #endif #ifdef FEAT_AUTOCMD } vim_free(new_name); au_new_curbuf = NULL; #endif } 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); } /* Don't redraw until the cursor is in the right line, otherwise * autocommands may cause ml_get errors. */ ++RedrawingDisabled; did_inc_redrawing_disabled = TRUE; #ifdef FEAT_AUTOCMD buf = curbuf; #endif if ((flags & ECMD_SET_HELP) || keep_help_flag) { prepare_help_buffer(); } else { /* 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 if (p_ur < 0 || curbuf->b_ml.ml_line_count <= p_ur) { /* Save all the text, so that the reload can be undone. * Sync first so that this is a separate undo-able action. */ u_sync(FALSE); if (u_savecommon(0, curbuf->b_ml.ml_line_count + 1, 0, TRUE) == FAIL) goto theend; u_unchanged(curbuf); buf_freeall(curbuf, BFA_KEEP_UNDO); /* tell readfile() not to clear or reload undo info */ readfile_flags = READ_KEEP_UNDO; } else buf_freeall(curbuf, 0); /* 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 */ /* 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. */ curwin_init(); #ifdef FEAT_FOLDING /* It's possible that all lines in the buffer changed. Need to update * automatic folding for all windows where it's used. */ # ifdef FEAT_WINDOWS { win_T *win; tabpage_T *tp; FOR_ALL_TAB_WINDOWS(tp, win) if (win->w_buffer == curbuf) foldUpdateAll(win); } # else foldUpdateAll(curwin); # endif #endif /* Change directories when the 'acd' option is set. */ DO_AUTOCHDIR /* * Careful: open_buffer() and apply_autocmds() may change the current * buffer and window. */ orig_pos = curwin->w_cursor; topline = curwin->w_topline; if (!oldbuf) /* need to read the file */ { #if defined(HAS_SWAP_EXISTS_ACTION) 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, readfile_flags))) retval = FAIL; #else (void)open_buffer(FALSE, eap, readfile_flags); #endif #if defined(HAS_SWAP_EXISTS_ACTION) if (swap_exists_action == SEA_QUIT) retval = FAIL; handle_swap_exists(old_curbuf); #endif } #ifdef FEAT_AUTOCMD else { /* Read the modelines, but only to set window-local options. Any * buffer-local options have already been set and may have been * changed by the user. */ do_modelines(OPT_WINONLY); 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. Also when it moves within a line. */ if (!equalpos(curwin->w_cursor, orig_pos)) { 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. */ if (curwin->w_p_diff) { diff_buf_add(curbuf); diff_invalidate(curbuf); } #endif #ifdef FEAT_SPELL /* If the window options were changed may need to set the spell language. * Can only do this after the buffer has been properly setup. */ if (did_get_winopts && curwin->w_p_spell && *curwin->w_s->b_p_spl != NUL) (void)did_set_spelllang(curwin); #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; if (!shortmess(SHM_FILEINFO)) 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) (void)keymap_init(); #endif --RedrawingDisabled; did_inc_redrawing_disabled = FALSE; 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; /* Change directories when the 'acd' option is set. */ DO_AUTOCHDIR #if defined(FEAT_SUN_WORKSHOP) || defined(FEAT_NETBEANS_INTG) if (curbuf->b_ffname != NULL) { # ifdef FEAT_SUN_WORKSHOP if (gui.in_use && usingSunWorkShop) workshop_file_opened((char *)curbuf->b_ffname, curbuf->b_p_ro); # endif # ifdef FEAT_NETBEANS_INTG if ((flags & ECMD_SET_HELP) != ECMD_SET_HELP) netbeans_file_opened(curbuf); # endif } #endif theend: if (did_inc_redrawing_disabled) --RedrawingDisabled; #ifdef FEAT_AUTOCMD if (did_set_swapcommand) set_vim_var_string(VV_SWAPCOMMAND, NULL, -1); #endif #ifdef FEAT_BROWSE vim_free(browse_file); #endif vim_free(free_fname); return retval; } #ifdef FEAT_AUTOCMD static void delbuf_msg(char_u *name) { EMSG2(_("E143: Autocommands unexpectedly deleted new buffer %s"), name == NULL ? (char_u *)"" : name); vim_free(name); au_new_curbuf = NULL; } #endif static int append_indent = 0; /* autoindent for first line */ /* * ":insert" and ":append", also used by ":change" */ void ex_append(exarg_T *eap) { char_u *theline; int did_undo = FALSE; linenr_T lnum = eap->line2; int indent = 0; char_u *p; int vcol; int empty = (curbuf->b_ml.ml_flags & ML_EMPTY); /* the ! flag toggles autoindent */ if (eap->forceit) curbuf->b_p_ai = !curbuf->b_p_ai; /* First autoindent comes from the line we start on */ if (eap->cmdidx != CMD_change && curbuf->b_p_ai && lnum > 0) append_indent = get_indent_lnum(lnum); if (eap->cmdidx != CMD_append) --lnum; /* when the buffer is empty append to line 0 and delete the dummy line */ if (empty && lnum == 1) lnum = 0; State = INSERT; /* behave like in Insert mode */ if (curbuf->b_p_iminsert == B_IMODE_LMAP) State |= LANGMAP; for (;;) { msg_scroll = TRUE; need_wait_return = FALSE; if (curbuf->b_p_ai) { if (append_indent >= 0) { indent = append_indent; append_indent = -1; } else if (lnum > 0) indent = get_indent_lnum(lnum); } ex_keep_indent = FALSE; if (eap->getline == NULL) { /* No getline() function, use the lines that follow. This ends * when there is no more. */ if (eap->nextcmd == NULL || *eap->nextcmd == NUL) break; p = vim_strchr(eap->nextcmd, NL); if (p == NULL) p = eap->nextcmd + STRLEN(eap->nextcmd); theline = vim_strnsave(eap->nextcmd, (int)(p - eap->nextcmd)); if (*p != NUL) ++p; eap->nextcmd = p; } else { int save_State = State; /* Set State to avoid the cursor shape to be set to INSERT mode * when getline() returns. */ State = CMDLINE; theline = eap->getline( #ifdef FEAT_EVAL eap->cstack->cs_looplevel > 0 ? -1 : #endif NUL, eap->cookie, indent); State = save_State; } lines_left = Rows - 1; if (theline == NULL) break; /* Using ^ CTRL-D in getexmodeline() makes us repeat the indent. */ if (ex_keep_indent) append_indent = indent; /* Look for the "." after automatic indent. */ vcol = 0; for (p = theline; indent > vcol; ++p) { if (*p == ' ') ++vcol; else if (*p == TAB) vcol += 8 - vcol % 8; else break; } if ((p[0] == '.' && p[1] == NUL) || (!did_undo && u_save(lnum, lnum + 1 + (empty ? 1 : 0)) == FAIL)) { vim_free(theline); break; } /* don't use autoindent if nothing was typed. */ if (p[0] == NUL) theline[0] = NUL; did_undo = TRUE; ml_append(lnum, theline, (colnr_T)0, FALSE); appended_lines_mark(lnum, 1L); vim_free(theline); ++lnum; if (empty) { ml_delete(2L, FALSE); empty = FALSE; } } State = NORMAL; if (eap->forceit) curbuf->b_p_ai = !curbuf->b_p_ai; /* "start" is set to eap->line2+1 unless that position is invalid (when * eap->line2 pointed to the end of the buffer and nothing 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(exarg_T *eap) { linenr_T lnum; if (eap->line2 >= eap->line1 && u_save(eap->line1 - 1, eap->line2 + 1) == FAIL) return; /* the ! flag toggles autoindent */ if (eap->forceit ? !curbuf->b_p_ai : curbuf->b_p_ai) append_indent = get_indent_lnum(eap->line1); 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); } /* make sure the cursor is not beyond the end of the file now */ check_cursor_lnum(); 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(exarg_T *eap) { char_u *x; int bigness; char_u *kind; int minus = 0; linenr_T start, end, curs, i; int j; linenr_T lnum = eap->line2; /* Vi compatible: ":z!" uses display height, without a count uses * 'scroll' */ if (eap->forceit) bigness = curwin->w_height; #ifdef FEAT_WINDOWS else if (firstwin != lastwin) bigness = curwin->w_height - 3; #endif else bigness = curwin->w_p_scr * 2; if (bigness < 1) bigness = 1; x = eap->arg; kind = x; if (*kind == '-' || *kind == '+' || *kind == '=' || *kind == '^' || *kind == '.') ++x; while (*x == '-' || *x == '+') ++x; if (*x != 0) { if (!VIM_ISDIGIT(*x)) { EMSG(_("E144: non-numeric argument to :z")); return; } else { bigness = atoi((char *)x); p_window = bigness; if (*kind == '=') bigness += 2; } } /* the number of '-' and '+' multiplies the distance */ if (*kind == '-' || *kind == '+') for (x = kind + 1; *x == *kind; ++x) ; switch (*kind) { case '-': start = lnum - bigness * (linenr_T)(x - kind) + 1; end = start + bigness - 1; curs = end; break; case '=': start = lnum - (bigness + 1) / 2 + 1; end = lnum + (bigness + 1) / 2 - 1; curs = lnum; minus = 1; break; case '^': start = lnum - bigness * 2; end = lnum - bigness; curs = lnum - bigness; break; case '.': start = lnum - (bigness + 1) / 2 + 1; end = lnum + (bigness + 1) / 2 - 1; curs = end; break; default: /* '+' */ start = lnum; if (*kind == '+') start += bigness * (linenr_T)(x - kind - 1) + 1; else if (eap->addr_count == 0) ++start; end = start + bigness - 1; 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, eap->flags & EXFLAG_NR, eap->flags & EXFLAG_LIST); 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(void) { 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(void) { 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" */ /* 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(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_count = FALSE; /* count only */ static int do_error = TRUE; /* if false, ignore errors */ static int do_print = FALSE; /* print last line with subs. */ static int do_list = FALSE; /* list last line with subs. */ static int do_number = FALSE; /* list last line with line nr*/ static int do_ic = 0; /* ignore case flag */ int save_do_all; /* remember user specified 'g' flag */ int save_do_ask; /* remember user specified 'c' 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 */ char_u *sub_firstline; /* allocated copy of first sub line */ int endcolumn = FALSE; /* cursor in last column when done */ pos_T old_cursor = curwin->w_cursor; int start_nsubs; #ifdef FEAT_EVAL int save_ma = 0; #endif cmd = eap->arg; if (!global_busy) { sub_nsubs = 0; sub_nlines = 0; } start_nsubs = sub_nsubs; 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 */ { #ifdef FEAT_FKMAP /* reverse the flow of the Farsi characters */ if (p_altkeymap && curwin->w_p_rl) lrF_sub(cmd); #endif 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; mb_ptr_adv(cmd); } if (!eap->skip) { /* In POSIX vi ":s/pat/%/" uses the previous subst. string. */ if (STRCMP(sub, "%") == 0 && vim_strchr(p_cpo, CPO_SUBPERCENT) != NULL) { if (old_sub == NULL) /* there is no previous command */ { EMSG(_(e_nopresub)); return; } sub = old_sub; } else { 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; /* Vi compatibility quirk: repeating with ":s" keeps the cursor in the * last column after using "$". */ endcolumn = (curwin->w_curswant == MAXCOL); } /* Recognize ":%s/\n//" and turn it into a join command, which is much * more efficient. * TODO: find a generic solution to make line-joining operations more * efficient, avoid allocating a string that grows in size. */ if (pat != NULL && STRCMP(pat, "\\n") == 0 && *sub == NUL && (*cmd == NUL || (cmd[1] == NUL && (*cmd == 'g' || *cmd == 'l' || *cmd == 'p' || *cmd == '#')))) { linenr_T joined_lines_count; curwin->w_cursor.lnum = eap->line1; if (*cmd == 'l') eap->flags = EXFLAG_LIST; else if (*cmd == '#') eap->flags = EXFLAG_NR; else if (*cmd == 'p') eap->flags = EXFLAG_PRINT; /* The number of lines joined is the number of lines in the range plus * one. One less when the last line is included. */ joined_lines_count = eap->line2 - eap->line1 + 1; if (eap->line2 < curbuf->b_ml.ml_line_count) ++joined_lines_count; if (joined_lines_count > 1) { (void)do_join(joined_lines_count, FALSE, TRUE, FALSE, TRUE); sub_nsubs = joined_lines_count - 1; sub_nlines = 1; (void)do_sub_msg(FALSE); ex_may_print(eap); } if (!cmdmod.keeppatterns) save_re_pat(RE_SUBST, pat, p_magic); #ifdef FEAT_CMDHIST /* put pattern in history */ add_to_history(HIST_SEARCH, pat, TRUE, NUL); #endif return; } /* * 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_count = FALSE; do_number = 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 == 'n') do_count = TRUE; 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 == '#') { do_print = TRUE; do_number = TRUE; } else if (*cmd == 'l') { do_print = TRUE; do_list = TRUE; } else if (*cmd == 'i') /* ignore case */ do_ic = 'i'; else if (*cmd == 'I') /* don't ignore case */ do_ic = 'I'; else break; ++cmd; } if (do_count) do_ask = FALSE; save_do_all = do_all; save_do_ask = do_ask; /* * 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 (!do_count && !curbuf->b_p_ma) { /* Substitution is not allowed in non-'modifiable' buffer */ EMSG(_(e_modifiable)); return; } if (search_regcomp(pat, RE_SUBST, which_pat, SEARCH_HIS, ®match) == 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) { nmatch = vim_regexec_multi(®match, curwin, curbuf, lnum, (colnr_T)0, NULL); 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; int len, copy_len, needed_len; long nmatch_tl = 0; /* nr of lines matched below lnum */ int do_again; /* do it again after joining lines */ int skip_match = FALSE; linenr_T sub_firstlnum; /* nr of first sub line */ /* * The new text is build up step by step, to avoid too much * copying. There are these pieces: * sub_firstline The old text, unmodified. * 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 found the start of * the match. Can be below the line we searched * when there is a \n before a \zs in the * pattern. * 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 length 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_firstlnum = lnum; 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 (;;) { /* Advance "lnum" to the line where the match starts. The * match does not start in the first line when there is a line * break before \zs. */ if (regmatch.startpos[0].lnum > 0) { lnum += regmatch.startpos[0].lnum; sub_firstlnum += regmatch.startpos[0].lnum; nmatch -= regmatch.startpos[0].lnum; vim_free(sub_firstline); sub_firstline = NULL; } if (sub_firstline == NULL) { sub_firstline = vim_strsave(ml_get(sub_firstlnum)); if (sub_firstline == NULL) { vim_free(new_start); goto outofmem; } } /* 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) { if (sub_firstline[matchcol] == NUL) /* We already were at the end of the line. Don't look * for a match in this line again. */ skip_match = TRUE; else { /* search for a match at next column */ #ifdef FEAT_MBYTE if (has_mbyte) matchcol += mb_ptr2len(sub_firstline + matchcol); else #endif ++matchcol; } 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_count is set only increase the counter. * If do_ask is set, ask for confirmation. */ if (do_count) { /* 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 = (colnr_T)STRLEN(sub_firstline); nmatch = 1; skip_match = TRUE; } sub_nsubs++; did_sub = TRUE; #ifdef FEAT_EVAL /* Skip the substitution, unless an expression is used, * then it is evaluated in the sandbox. */ if (!(sub[0] == '\\' && sub[1] == '=')) #endif goto skip; } if (do_ask) { int typed = 0; /* 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) { if (exmode_active) { char_u *resp; colnr_T sc, ec; print_line_no_prefix(lnum, do_number, do_list); getvcol(curwin, &curwin->w_cursor, &sc, NULL, NULL); curwin->w_cursor.col = regmatch.endpos[0].col - 1; getvcol(curwin, &curwin->w_cursor, NULL, NULL, &ec); if (do_number || curwin->w_p_nu) { int numw = number_width(curwin) + 1; sc += numw; ec += numw; } msg_start(); for (i = 0; i < (long)sc; ++i) msg_putchar(' '); for ( ; i <= (long)ec; ++i) msg_putchar('^'); resp = getexmodeline('?', NULL, 0); if (resp != NULL) { typed = *resp; vim_free(resp); } } else { char_u *orig_line = NULL; int len_change = 0; #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; if (new_start != NULL) { /* There already was a substitution, we would * like to show this to the user. We cannot * really update the line, it would change * what matches. Temporarily replace the line * and change it back afterwards. */ orig_line = vim_strsave(ml_get(lnum)); if (orig_line != NULL) { char_u *new_line = concat_str(new_start, sub_firstline + copycol); if (new_line == NULL) { vim_free(orig_line); orig_line = NULL; } else { /* Position the cursor relative to the * end of the line, the previous * substitute may have inserted or * deleted characters before the * cursor. */ len_change = (int)STRLEN(new_line) - (int)STRLEN(orig_line); curwin->w_cursor.col += len_change; ml_replace(lnum, new_line, FALSE); } } } search_match_lines = regmatch.endpos[0].lnum - regmatch.startpos[0].lnum; search_match_endcol = regmatch.endpos[0].col + len_change; highlight_match = TRUE; update_topline(); validate_cursor(); update_screen(SOME_VALID); highlight_match = FALSE; redraw_later(SOME_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 */ typed = plain_vgetc(); --allow_keys; --no_mapping; /* clear the question */ msg_didout = FALSE; /* don't scroll up */ msg_col = 0; gotocmdline(TRUE); /* restore the line */ if (orig_line != NULL) ml_replace(lnum, orig_line, FALSE); } need_wait_return = FALSE; /* no hit-return prompt */ if (typed == 'q' || typed == ESC || typed == Ctrl_C #ifdef UNIX || typed == intr_char #endif ) { got_quit = TRUE; break; } if (typed == 'n') break; if (typed == 'y') break; if (typed == 'l') { /* last: replace and then stop */ do_all = FALSE; line2 = lnum; break; } if (typed == 'a') { do_ask = FALSE; break; } #ifdef FEAT_INS_EXPAND if (typed == Ctrl_E) scrollup_clamp(); else if (typed == 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 (typed == '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" and ":%s/\n/,\r/gc" * get stuck when pressing 'n'. */ if (nmatch > 1) { matchcol = (colnr_T)STRLEN(sub_firstline); skip_match = TRUE; } goto skip; } if (got_quit) goto skip; } /* 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. */ #ifdef FEAT_EVAL if (do_count) { /* prevent accidentally changing the buffer by a function */ save_ma = curbuf->b_p_ma; curbuf->b_p_ma = FALSE; sandbox++; } #endif /* get length of substitution part */ sublen = vim_regsub_multi(®match, sub_firstlnum - regmatch.startpos[0].lnum, sub, sub_firstline, FALSE, p_magic, TRUE); #ifdef FEAT_EVAL if (do_count) { curbuf->b_p_ma = save_ma; sandbox--; goto skip; } #endif /* When the match included the "$" of the last line it may * go beyond the last line of the buffer. */ if (nmatch > curbuf->b_ml.ml_line_count - sub_firstlnum + 1) { nmatch = curbuf->b_ml.ml_line_count - sub_firstlnum + 1; skip_match = 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; } copy_len = regmatch.startpos[0].col - copycol; needed_len = copy_len + ((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 > (int)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)copy_len); new_end += copy_len; (void)vim_regsub_multi(®match, sub_firstlnum - regmatch.startpos[0].lnum, 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; if (skip_match) { /* Already hit end of the buffer, sub_firstlnum is one * less than what it ought to be. */ vim_free(sub_firstline); sub_firstline = vim_strsave((char_u *)""); copycol = 0; } /* * 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 */ STRMOVE(p1, p1 + 1); 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; /* copy the rest */ STRMOVE(new_start, p1 + 1); p1 = new_start - 1; } } #ifdef FEAT_MBYTE else if (has_mbyte) p1 += (*mb_ptr2len)(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. "lnum" can be below * "line2" when there is a \zs in the pattern after a line * break. */ lastone = (skip_match || got_int || got_quit || lnum > line2 || !(do_all || do_again) || (sub_firstline[matchcol] == NUL && nmatch <= 1 && !re_multiline(regmatch.regprog))); 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 the match starts below where we start searching also * need to replace the line first (using \zs after \n). */ if (lastone || nmatch_tl > 0 || (nmatch = vim_regexec_multi(®match, curwin, curbuf, sub_firstlnum, matchcol, NULL)) == 0 || regmatch.startpos[0].lnum > 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(®match, curwin, curbuf, sub_firstlnum, matchcol, NULL); /* * 5. break if there isn't another match in this line */ if (nmatch <= 0) { /* If the match found didn't start where we were * searching, do the next search in the line where we * found the match. */ if (nmatch == -1) lnum -= regmatch.startpos[0].lnum; break; } } line_breakcheck(); } if (did_sub) ++sub_nlines; vim_free(new_start); /* for when substitute was cancelled */ 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 */ /* ":s/pat//n" doesn't move the cursor */ if (do_count) curwin->w_cursor = old_cursor; if (sub_nsubs > start_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) { if (!do_ask) /* when interactive leave cursor on the match */ { if (endcolumn) coladvance((colnr_T)MAXCOL); else beginline(BL_WHITE | BL_FIX); } if (!do_sub_msg(do_count) && do_ask) MSG(""); } else global_need_beginline = TRUE; if (do_print) print_line(curwin->w_cursor.lnum, do_number, do_list); } 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()); } #ifdef FEAT_FOLDING if (do_ask && hasAnyFolding(curwin)) /* Cursor position may require updating */ changed_window_setting(); #endif vim_regfree(regmatch.regprog); /* Restore the flag values, they can be used for ":&&". */ do_all = save_do_all; do_ask = save_do_ask; } /* * Give message for number of substitutions. * Can also be used after a ":global" command. * Return TRUE if a message was given. */ int do_sub_msg( int count_only) /* used 'n' flag for ":s" */ { /* * 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)) || count_only) && messaging()) { if (got_int) STRCPY(msg_buf, _("(Interrupted) ")); else *msg_buf = NUL; if (sub_nsubs == 1) vim_snprintf_add((char *)msg_buf, sizeof(msg_buf), "%s", count_only ? _("1 match") : _("1 substitution")); else vim_snprintf_add((char *)msg_buf, sizeof(msg_buf), count_only ? _("%ld matches") : _("%ld substitutions"), sub_nsubs); if (sub_nlines == 1) vim_snprintf_add((char *)msg_buf, sizeof(msg_buf), "%s", _(" on 1 line")); else vim_snprintf_add((char *)msg_buf, sizeof(msg_buf), _(" on %ld lines"), (long)sub_nlines); if (msg(msg_buf)) /* save message to display it after redraw */ set_keep_msg(msg_buf, 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(exarg_T *eap) { linenr_T lnum; /* line number according to old situation */ int ndone = 0; 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 */ /* * 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, ®match) == FAIL) { EMSG(_(e_invcmd)); return; } /* * pass 1: set marks for each (not) matching line */ for (lnum = eap->line1; lnum <= eap->line2 && !got_int; ++lnum) { /* a match on this line? */ match = vim_regexec_multi(®match, curwin, curbuf, lnum, (colnr_T)0, NULL); 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') smsg((char_u *)_("Pattern found in every line: %s"), pat); else smsg((char_u *)_("Pattern not found: %s"), pat); } else { #ifdef FEAT_CLIPBOARD start_global_changes(); #endif global_exe(cmd); #ifdef FEAT_CLIPBOARD end_global_changes(); #endif } ml_clearmarked(); /* clear rest of the marks */ vim_regfree(regmatch.regprog); } /* * Execute "cmd" on lines marked with ml_setmarked(). */ void global_exe(char_u *cmd) { linenr_T old_lcount; /* b_ml.ml_line_count before the command */ buf_T *old_buf = curbuf; /* remember what buffer we started in */ 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; sub_nsubs = 0; sub_nlines = 0; 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 */ /* the cursor may not have moved in the text but a change in a previous * line may move it on the screen */ changed_line_abv_curs(); /* 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 substitutes done, report number of substitutes, otherwise report * number of extra or deleted lines. * Don't report extra or deleted lines in the edge case where the buffer * we are in after execution is different from the buffer we started in. */ if (!do_sub_msg(FALSE) && curbuf == old_buf) msgmore(curbuf->b_ml.ml_line_count - old_lcount); } #ifdef FEAT_VIMINFO int read_viminfo_sub_string(vir_T *virp, int force) { if (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(FILE *fp) { if (get_viminfo_parameter('/') != 0 && old_sub != NULL) { fputs(_("\n# Last Substitute String:\n$"), fp); viminfo_writestring(fp, old_sub); } } #endif /* FEAT_VIMINFO */ #if defined(EXITFREE) || defined(PROTO) void free_old_sub(void) { vim_free(old_sub); } #endif #if (defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)) || defined(PROTO) /* * Set up for a tagpreview. * Return TRUE when it was created. */ int prepare_tagpreview( int undo_sync) /* sync undo when leaving the window */ { 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, undo_sync); else { /* * There is no preview window open yet. Create one. */ if (win_split(g_do_tagpreview > 0 ? g_do_tagpreview : 0, 0) == FAIL) return FALSE; curwin->w_p_pvw = TRUE; curwin->w_p_wfh = TRUE; RESET_BINDING(curwin); /* don't take over 'scrollbind' and 'cursorbind' */ # ifdef FEAT_DIFF curwin->w_p_diff = FALSE; /* no 'diff' */ # endif # ifdef FEAT_FOLDING curwin->w_p_fdc = 0; /* no 'foldcolumn' */ # endif return TRUE; } } return FALSE; } #endif /* * ":help": open a read-only window on a help file */ void ex_help(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; #endif #ifdef FEAT_FOLDING int old_KeyTyped = KeyTyped; #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 && !curbuf->b_help) { 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 */ lang = check_help_lang(arg); #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 = (int)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. * Always open a new one for ":tab help". */ if (!curwin->w_buffer->b_help #ifdef FEAT_WINDOWS || cmdmod.tab != 0 #endif ) { #ifdef FEAT_WINDOWS if (cmdmod.tab != 0) wp = NULL; else 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) { smsg((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; if (cmdmod.split == 0 && curwin->w_width != Columns && curwin->w_width < 80) n |= WSP_TOP; if (win_split(0, n) == FAIL) goto erret; #else /* use current window */ if (!can_abandon(curbuf, FALSE)) goto erret; #endif #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, #ifdef FEAT_WINDOWS NULL /* buffer is still open, don't store info */ #else curwin #endif ); if (!cmdmod.keepalt) 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 */ #ifdef FEAT_FOLDING /* Restore KeyTyped, setting 'filetype=help' may reset it. * It is needed for do_tag top open folds under the cursor. */ KeyTyped = old_KeyTyped; #endif if (tag != NULL) do_tag(tag, DT_HELP, 1, FALSE, TRUE); /* Delete the empty buffer if we're not using it. Careful: autocommands * may have jumped to another window, check that the buffer is not in a * window. */ if (empty_fnum != 0 && curbuf->b_fnum != empty_fnum) { buf = buflist_findnr(empty_fnum); if (buf != NULL && buf->b_nwindows == 0) wipe_buffer(buf, TRUE); } /* keep the previous alternate file */ if (alt_fnum != 0 && curwin->w_alt_fnum == empty_fnum && !cmdmod.keepalt) curwin->w_alt_fnum = alt_fnum; erret: vim_free(tag); } /* * ":helpclose": Close one help window */ void ex_helpclose(exarg_T *eap UNUSED) { #if defined(FEAT_WINDOWS) win_T *win; FOR_ALL_WINDOWS(win) { if (win->w_buffer->b_help) { win_close(win, FALSE); return; } } #endif } #if defined(FEAT_MULTI_LANG) || defined(PROTO) /* * In an argument search for a language specifiers in the form "@xx". * Changes the "@" to NUL if found, and returns a pointer to "xx". * Returns NULL if not found. */ char_u * check_help_lang(char_u *arg) { int len = (int)STRLEN(arg); if (len >= 3 && arg[len - 3] == '@' && ASCII_ISALPHA(arg[len - 2]) && ASCII_ISALPHA(arg[len - 1])) { arg[len - 3] = NUL; /* remove the '@' */ return arg + len - 2; } return NULL; } #endif /* * 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( 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(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( char_u *arg, int *num_matches, char_u ***matches, int keep_lang) { char_u *s, *d; int i; static char *(mtable[]) = {"*", "g*", "[*", "]*", ":*", "/*", "/\\*", "\"*", "**", "cpo-*", "/\\(\\)", "/\\%(\\)", "?", ":?", "?", "g?", "g?g?", "g??", "z?", "/\\?", "/\\z(\\)", "\\=", ":s\\=", "[count]", "[quotex]", "[range]", "[pattern]", "\\|", "\\%$", "s/\\~", "s/\\U", "s/\\L", "s/\\1", "s/\\2", "s/\\3", "s/\\9"}; static char *(rtable[]) = {"star", "gstar", "[star", "]star", ":star", "/star", "/\\\\star", "quotestar", "starstar", "cpo-star", "/\\\\(\\\\)", "/\\\\%(\\\\)", "?", ":?", "?", "g?", "g?g?", "g??", "z?", "/\\\\?", "/\\\\z(\\\\)", "\\\\=", ":s\\\\=", "\\[count]", "\\[quotex]", "\\[range]", "\\[pattern]", "\\\\bar", "/\\\\%\\$", "s/\\\\\\~", "s/\\\\U", "s/\\\\L", "s/\\\\1", "s/\\\\2", "s/\\\\3", "s/\\\\9"}; 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 = (int)(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 "\[++...]" * "\{" with "\\{" -- matching "} \}" */ if ((arg[0] == '[' && (arg[1] == ':' || (arg[1] == '+' && arg[2] == '+'))) || (arg[0] == '\\' && arg[1] == '{')) *d++ = '\\'; /* * If tag starts with "('", skip the "(". Fixes CTRL-] on ('option'. */ if (*arg == '(' && arg[1] == '\'') arg++; 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[-1] != '\\') *d++ = '_'; /* prepend a '_' to make x_CTRL-x */ 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; if (*IObuff == '`') { if (d > IObuff + 2 && d[-1] == '`') { /* remove the backticks from `command` */ mch_memmove(IObuff, IObuff + 1, STRLEN(IObuff)); d[-2] = NUL; } else if (d > IObuff + 3 && d[-2] == '`' && d[-1] == ',') { /* remove the backticks and comma from `command`, */ mch_memmove(IObuff, IObuff + 1, STRLEN(IObuff)); d[-3] = NUL; } else if (d > IObuff + 4 && d[-3] == '`' && d[-2] == '\\' && d[-1] == '.') { /* remove the backticks and dot from `command`\. */ mch_memmove(IObuff, IObuff + 1, STRLEN(IObuff)); d[-4] = 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); /* Delete more than TAG_MANY to reduce the size of the listing. */ while (*num_matches > TAG_MANY) vim_free((*matches)[--*num_matches]); } return OK; } /* * Called when starting to edit a buffer for a help file. */ static void prepare_help_buffer(void) { 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, 0); #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, 0); check_buf_options(curbuf); (void)buf_init_chartab(curbuf, FALSE); } #ifdef FEAT_FOLDING /* Don't use the global foldmethod.*/ set_string_option_direct((char_u *)"fdm", -1, (char_u *)"manual", OPT_FREE|OPT_LOCAL, 0); #endif 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 */ curwin->w_p_rnu = 0; /* no relative line numbers */ RESET_BINDING(curwin); /* no scroll or cursor binding */ #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_SPELL curwin->w_p_spell = FALSE; /* No spell checking */ #endif set_buflisted(FALSE); } /* * After reading a help file: May cleanup a help buffer when syntax * highlighting is not used. */ void fix_help_buffer(void) { linenr_T lnum; char_u *line; int in_example = FALSE; int len; char_u *fname; 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(curwin)) #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" and "help.abx" file, add the locally added help * files. This uses the very first line in the help file. */ fname = gettail(curbuf->b_fname); if (fnamecmp(fname, "help.txt") == 0 #ifdef FEAT_MULTI_LANG || (fnamencmp(fname, "help.", 5) == 0 && ASCII_ISALPHA(fname[5]) && ASCII_ISALPHA(fname[6]) && TOLOWER_ASC(fname[7]) == 'x' && fname[8] == NUL) #endif ) { 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) continue; /* 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); #ifdef FEAT_MULTI_LANG STRCAT(NameBuff, "doc/*.??[tx]"); #else STRCAT(NameBuff, "doc/*.txt"); #endif if (gen_expand_wildcards(1, &NameBuff, &fcount, &fnames, EW_FILE|EW_SILENT) == OK && fcount > 0) { #ifdef FEAT_MULTI_LANG int i1; int i2; char_u *f1; char_u *f2; char_u *t1; char_u *e1; char_u *e2; /* If foo.abx is found use it instead of foo.txt in * the same directory. */ for (i1 = 0; i1 < fcount; ++i1) { for (i2 = 0; i2 < fcount; ++i2) { if (i1 == i2) continue; if (fnames[i1] == NULL || fnames[i2] == NULL) continue; f1 = fnames[i1]; f2 = fnames[i2]; t1 = gettail(f1); if (fnamencmp(f1, f2, t1 - f1) != 0) continue; e1 = vim_strrchr(t1, '.'); e2 = vim_strrchr(gettail(f2), '.'); if (e1 == NUL || e2 == NUL) continue; if (fnamecmp(e1, ".txt") != 0 && fnamecmp(e1, fname + 4) != 0) { /* Not .txt and not .abx, remove it. */ vim_free(fnames[i1]); fnames[i1] = NULL; continue; } if (fnamencmp(f1, f2, e1 - f1) != 0) continue; if (fnamecmp(e1, ".txt") == 0 && fnamecmp(e2, fname + 4) == 0) { /* use .abx instead of .txt */ vim_free(fnames[i1]); fnames[i1] = NULL; } } } #endif for (fi = 0; fi < fcount; ++fi) { if (fnames[fi] == NULL) continue; fd = mch_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 /. */ 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(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; } } } /* * ":exusage" */ void ex_exusage(exarg_T *eap UNUSED) { do_cmdline_cmd((char_u *)"help ex-cmd-index"); } /* * ":viusage" */ void ex_viusage(exarg_T *eap UNUSED) { do_cmdline_cmd((char_u *)"help normal-index"); } /* * Generate tags in one help directory. */ static void helptags_one( char_u *dir, /* doc directory */ char_u *ext, /* suffix, ".txt", ".itx", ".frx", etc. */ char_u *tagfname, /* "tags" for English, "tags-fr" for French. */ int add_help_tags) /* add "help-tags" tag */ { 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; int dirlen; # ifdef FEAT_MBYTE int utf8 = MAYBE; int this_utf8; int firstline; int mix = FALSE; /* detected mixed encodings */ # endif /* * Find all *.txt files. */ dirlen = (int)STRLEN(dir); STRCPY(NameBuff, dir); 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 = mch_fopen((char *)NameBuff, "w"); if (fd_tags == NULL) { EMSG2(_("E152: Cannot open %s for writing"), NameBuff); FreeWild(filecount, files); return; } /* * If using the "++t" argument or generating tags for "$VIMRUNTIME/doc" * add the "help-tags" tag. */ ga_init2(&ga, (int)sizeof(char_u *), 100); if (add_help_tags || fullpathcmp((char_u *)"$VIMRUNTIME/doc", dir, FALSE) == FPC_SAME) { if (ga_grow(&ga, 1) == FAIL) got_int = TRUE; else { s = alloc(18 + (unsigned)STRLEN(tagfname)); 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; } } } /* * Go over all the files and extract the tags. */ for (fi = 0; fi < filecount && !got_int; ++fi) { fd = mch_fopen((char *)files[fi], "r"); if (fd == NULL) { EMSG2(_("E153: Unable to open %s for reading"), files[fi]); continue; } fname = files[fi] + dirlen + 1; # 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(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) { /* Use vim_strbyte() instead of vim_strchr() so that when * 'encoding' is dbcs it still works, don't find '*' in the * second byte. */ p2 = vim_strbyte(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; 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. */ if (ga.ga_data != NULL) 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; vim_snprintf((char *)NameBuff, MAXPATHL, _("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\t", 10) == 0) /* help-tags entry was added in formatted form */ fputs((char *)s, fd_tags); 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... */ } /* * Generate tags in one help directory, taking care of translations. */ static void do_helptags(char_u *dirname, int add_help_tags) { #ifdef FEAT_MULTI_LANG int len; int i, j; garray_T ga; char_u lang[2]; char_u ext[5]; char_u fname[8]; int filecount; char_u **files; /* Get a list of all files in the help directory and in subdirectories. */ STRCPY(NameBuff, dirname); 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 = (int)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]; } } } /* * 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(dirname, ext, fname, add_help_tags); } ga_clear(&ga); FreeWild(filecount, files); #else /* No language support, just use "*.txt" and "tags". */ helptags_one(dirname, (char_u *)".txt", (char_u *)"tags", add_help_tags); #endif } static void helptags_cb(char_u *fname, void *cookie) { do_helptags(fname, *(int *)cookie); } /* * ":helptags" */ void ex_helptags(exarg_T *eap) { expand_T xpc; char_u *dirname; int add_help_tags = FALSE; /* Check for ":helptags ++t {dir}". */ if (STRNCMP(eap->arg, "++t", 3) == 0 && vim_iswhite(eap->arg[3])) { add_help_tags = TRUE; eap->arg = skipwhite(eap->arg + 3); } if (STRCMP(eap->arg, "ALL") == 0) { do_in_path(p_rtp, (char_u *)"doc", DIP_ALL + DIP_DIR, helptags_cb, &add_help_tags); } else { ExpandInit(&xpc); xpc.xp_context = EXPAND_DIRECTORIES; dirname = ExpandOne(&xpc, eap->arg, NULL, WILD_LIST_NOTFOUND|WILD_SILENT, WILD_EXPAND_FREE); if (dirname == NULL || !mch_isdir(dirname)) EMSG2(_("E150: Not a directory: %s"), eap->arg); else do_helptags(dirname, add_help_tags); vim_free(dirname); } } #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 */ 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 */ }; static sign_T *first_sign = NULL; static int next_sign_typenr = 1; static int sign_cmd_idx(char_u *begin_cmd, char_u *end_cmd); static void sign_list_defined(sign_T *sp); static void sign_undefine(sign_T *sp, sign_T *sp_prev); 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 NULL # define SIGNCMD_LAST 6 }; /* * Find index of a ":sign" subcmd from its name. * "*end_cmd" must be writable. */ static int sign_cmd_idx( char_u *begin_cmd, /* begin of sign subcmd */ char_u *end_cmd) /* just after sign subcmd */ { int idx; char save = *end_cmd; *end_cmd = NUL; for (idx = 0; ; ++idx) if (cmds[idx] == NULL || STRCMP(begin_cmd, cmds[idx]) == 0) break; *end_cmd = save; return idx; } /* * ":sign" command */ void ex_sign(exarg_T *eap) { char_u *arg = eap->arg; char_u *p; int idx; sign_T *sp; sign_T *sp_prev; buf_T *buf; /* Parse the subcommand. */ p = skiptowhite(arg); idx = sign_cmd_idx(arg, p); if (idx == SIGNCMD_LAST) { EMSG2(_("E160: Unknown sign command: %s"), arg); return; } 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 && !got_int; sp = sp->sn_next) sign_list_defined(sp); } else if (*arg == NUL) EMSG(_("E156: Missing sign name")); else { /* Isolate the sign name. If it's a number skip leading zeroes, * so that "099" and "99" are the same sign. But keep "0". */ p = skiptowhite(arg); if (*p != NUL) *p++ = NUL; while (arg[0] == '0' && arg[1] != NUL) ++arg; 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) { sign_T *lp; int start = next_sign_typenr; /* Allocate a new sign. */ sp = (sign_T *)alloc_clear((unsigned)sizeof(sign_T)); if (sp == NULL) return; /* Check that next_sign_typenr is not already being used. * This only happens after wrapping around. Hopefully * another one got deleted and we can use its number. */ for (lp = first_sign; lp != NULL; ) { if (lp->sn_typenr == next_sign_typenr) { ++next_sign_typenr; if (next_sign_typenr == MAX_TYPENR) next_sign_typenr = 1; if (next_sign_typenr == start) { vim_free(sp); EMSG(_("E612: Too many signs defined")); return; } lp = first_sign; /* start all over */ continue; } lp = lp->sn_next; } sp->sn_typenr = next_sign_typenr; if (++next_sign_typenr == MAX_TYPENR) next_sign_typenr = 1; /* wrap around */ sp->sn_name = vim_strsave(arg); if (sp->sn_name == NULL) /* out of memory */ { vim_free(sp); return; } /* add the new sign to the list of signs */ if (sp_prev == NULL) first_sign = sp; else sp_prev->sn_next = sp; } /* 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)(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 = (int)(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 = (int)(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}" */ sign_undefine(sp, sp_prev); } } 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, "*", 1) == 0 && idx == SIGNCMD_UNPLACE) { if (id != -1) { EMSG(_(e_invarg)); return; } id = -2; arg = skiptowhite(arg + 1); } else if (STRNCMP(arg, "name=", 5) == 0) { arg += 5; sign_name = arg; arg = skiptowhite(arg); if (*arg != NUL) *arg++ = NUL; while (sign_name[0] == '0' && sign_name[1] != NUL) ++sign_name; } 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 && !(idx == SIGNCMD_UNPLACE && id == -2)) { 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) { if (lnum >= 0 || sign_name != NULL) EMSG(_(e_invarg)); else if (id == -2) { /* ":sign unplace * file={fname}" */ redraw_buf_later(buf, NOT_VALID); buf_delete_signs(buf); } else { /* ":sign unplace {id} file={fname}" */ 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); if (lnum > 0) update_debug_sign(buf, lnum); else EMSG2(_("E885: Not possible to change sign %s"), sign_name); } 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(void) { 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(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); } } /* * Undefine a sign and free its memory. */ static void sign_undefine(sign_T *sp, sign_T *sp_prev) { 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); } /* * Get highlighting attribute for sign "typenr". * If "line" is TRUE: line highl, if FALSE: text highl. */ int sign_get_attr(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(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( 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(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]"); } # if defined(EXITFREE) || defined(PROTO) /* * Undefine/free all signs. */ void free_signs(void) { while (first_sign != NULL) sign_undefine(first_sign, NULL); } # endif # if defined(FEAT_CMDL_COMPL) || defined(PROTO) static enum { EXP_SUBCMD, /* expand :sign sub-commands */ EXP_DEFINE, /* expand :sign define {name} args */ EXP_PLACE, /* expand :sign place {id} args */ EXP_UNPLACE, /* expand :sign unplace" */ EXP_SIGN_NAMES /* expand with name of placed signs */ } expand_what; /* * Function given to ExpandGeneric() to obtain the sign command * expansion. */ char_u * get_sign_name(expand_T *xp UNUSED, int idx) { sign_T *sp; int current_idx; switch (expand_what) { case EXP_SUBCMD: return (char_u *)cmds[idx]; case EXP_DEFINE: { char *define_arg[] = { "icon=", "linehl=", "text=", "texthl=", NULL }; return (char_u *)define_arg[idx]; } case EXP_PLACE: { char *place_arg[] = { "line=", "name=", "file=", "buffer=", NULL }; return (char_u *)place_arg[idx]; } case EXP_UNPLACE: { char *unplace_arg[] = { "file=", "buffer=", NULL }; return (char_u *)unplace_arg[idx]; } case EXP_SIGN_NAMES: /* Complete with name of signs already defined */ current_idx = 0; for (sp = first_sign; sp != NULL; sp = sp->sn_next) if (current_idx++ == idx) return sp->sn_name; return NULL; default: return NULL; } } /* * Handle command line completion for :sign command. */ void set_context_in_sign_cmd(expand_T *xp, char_u *arg) { char_u *p; char_u *end_subcmd; char_u *last; int cmd_idx; char_u *begin_subcmd_args; /* Default: expand subcommands. */ xp->xp_context = EXPAND_SIGN; expand_what = EXP_SUBCMD; xp->xp_pattern = arg; end_subcmd = skiptowhite(arg); if (*end_subcmd == NUL) /* expand subcmd name * :sign {subcmd}*/ return; cmd_idx = sign_cmd_idx(arg, end_subcmd); /* :sign {subcmd} {subcmd_args} * | * begin_subcmd_args */ begin_subcmd_args = skipwhite(end_subcmd); p = skiptowhite(begin_subcmd_args); if (*p == NUL) { /* * Expand first argument of subcmd when possible. * For ":jump {id}" and ":unplace {id}", we could * possibly expand the ids of all signs already placed. */ xp->xp_pattern = begin_subcmd_args; switch (cmd_idx) { case SIGNCMD_LIST: case SIGNCMD_UNDEFINE: /* :sign list * :sign undefine */ expand_what = EXP_SIGN_NAMES; break; default: xp->xp_context = EXPAND_NOTHING; } return; } /* expand last argument of subcmd */ /* :sign define {name} {args}... * | * p */ /* Loop until reaching last argument. */ do { p = skipwhite(p); last = p; p = skiptowhite(p); } while (*p != NUL); p = vim_strchr(last, '='); /* :sign define {name} {args}... {last}= * | | * last p */ if (p == NUL) { /* Expand last argument name (before equal sign). */ xp->xp_pattern = last; switch (cmd_idx) { case SIGNCMD_DEFINE: expand_what = EXP_DEFINE; break; case SIGNCMD_PLACE: expand_what = EXP_PLACE; break; case SIGNCMD_JUMP: case SIGNCMD_UNPLACE: expand_what = EXP_UNPLACE; break; default: xp->xp_context = EXPAND_NOTHING; } } else { /* Expand last argument value (after equal sign). */ xp->xp_pattern = p + 1; switch (cmd_idx) { case SIGNCMD_DEFINE: if (STRNCMP(last, "texthl", p - last) == 0 || STRNCMP(last, "linehl", p - last) == 0) xp->xp_context = EXPAND_HIGHLIGHT; else if (STRNCMP(last, "icon", p - last) == 0) xp->xp_context = EXPAND_FILES; else xp->xp_context = EXPAND_NOTHING; break; case SIGNCMD_PLACE: if (STRNCMP(last, "name", p - last) == 0) expand_what = EXP_SIGN_NAMES; else xp->xp_context = EXPAND_NOTHING; break; default: xp->xp_context = EXPAND_NOTHING; } } } # endif #endif /* * Make the user happy. */ void ex_smile(exarg_T *eap UNUSED) { static char *code = "\34 \4o\14$\4ox\30 \2o\30$\1ox\25 \2o\36$\1o\11 \1o\1$\3 \2$\1 \1o\1$x\5 \1o\1 \1$\1 \2o\10 \1o\44$\1o\7 \2$\1 \2$\1 \2$\1o\1$x\2 \2o\1 \1$\1 \1$\1 \1\"\1$\6 \1o\11$\4 \15$\4 \11$\1o\7 \3$\1o\2$\1o\1$x\2 \1\"\6$\1o\1$\5 \1o\11$\6 \13$\6 \12$\1o\4 \10$x\4 \7$\4 \13$\6 \13$\6 \27$x\4 \27$\4 \15$\4 \16$\2 \3\"\3$x\5 \1\"\3$\4\"\61$\5 \1\"\3$x\6 \3$\3 \1o\62$\5 \1\"\3$\1ox\5 \1o\2$\1\"\3 \63$\7 \3$\1ox\5 \3$\4 \55$\1\"\1 \1\"\6$\5o\4$\1ox\4 \1o\3$\4o\5$\2 \45$\3 \1o\21$x\4 \10$\1\"\4$\3 \42$\5 \4$\10\"x\3 \4\"\7 \4$\4 \1\"\34$\1\"\6 \1o\3$x\16 \1\"\3$\1o\5 \3\"\22$\1\"\2$\1\"\11 \3$x\20 \3$\1o\12 \1\"\2$\2\"\6$\4\"\13 \1o\3$x\21 \4$\1o\40 \1o\3$\1\"x\22 \1\"\4$\1o\6 \1o\6$\1o\1\"\4$\1o\10 \1o\4$x\24 \1\"\5$\2o\5 \2\"\4$\1o\5$\1o\3 \1o\4$\2\"x\27 \2\"\5$\4o\2 \1\"\3$\1o\11$\3\"x\32 \2\"\7$\2o\1 \12$x\42 \4\"\13$x\46 \14$x\47 \12$\1\"x\50 \1\"\3$\4\"x"; char *p; int n; msg_start(); msg_putchar('\n'); for (p = code; *p != NUL; ++p) if (*p == 'x') msg_putchar('\n'); else for (n = *p++; n > 0; --n) if (*p == 'o' || *p == '$') msg_putchar_attr(*p, hl_attr(HLF_L)); else msg_putchar(*p); msg_clr_eos(); } #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(exarg_T *eap) { int split = FALSE; win_T *wp; buf_T *buf; # ifdef FEAT_WINDOWS tabpage_T *tp; # endif /* * 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. */ set_arglist(eap->arg); /* * Expanding wildcards may result in an empty argument list. E.g. when * editing "foo.pyc" and ".pyc" is in 'wildignore'. Assume that we * already did an error message for this. */ if (ARGCOUNT == 0) return; # ifdef FEAT_WINDOWS if (cmdmod.tab) { /* ":tab drop file ...": open a tab for each argument that isn't * edited in a window yet. It's like ":tab all" but without closing * windows or tabs. */ ex_all(eap); } else # endif { /* ":drop file ...": Edit the first argument. Jump to an existing * window if possible, edit in current window if the current buffer * can be abandoned, otherwise open a new window. */ buf = buflist_findnr(ARGLIST[0].ae_fnum); FOR_ALL_TAB_WINDOWS(tp, wp) { if (wp->w_buffer == buf) { # ifdef FEAT_WINDOWS goto_tabpage_win(tp, wp); # endif curwin->w_arg_idx = 0; return; } } /* * 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, CCGD_AW | CCGD_EXCMD); # ifdef FEAT_WINDOWS --emsg_off; # else if (split) return; # endif } /* Fake a ":sfirst" or ":first" command edit the first argument. */ if (split) { eap->cmdidx = CMD_sfirst; eap->cmd[0] = 's'; } else eap->cmdidx = CMD_first; ex_rewind(eap); } } #endif vim-7.4.1689/src/ex_cmds.h000066400000000000000000001506721267703067000151720ustar00rootroot00000000000000/* 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 EXFLAGS 0x400000L /* allow flags after count in argument */ #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 */ /* values for cmd_addr_type */ #define ADDR_LINES 0 #define ADDR_WINDOWS 1 #define ADDR_ARGUMENTS 2 #define ADDR_LOADED_BUFFERS 3 #define ADDR_BUFFERS 4 #define ADDR_TABS 5 #define ADDR_QUICKFIX 6 #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, e) {(char_u *)b, c, (long_u)(d), e} typedef void (*ex_func_T) (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 */ int cmd_addr_type; /* flag for address type */ } cmdnames[] = #else # define EX(a, b, c, d, e) a enum CMD_index #endif { EX(CMD_append, "append", ex_append, BANG|RANGE|ZEROR|TRLBAR|CMDWIN|MODIFY, ADDR_LINES), EX(CMD_abbreviate, "abbreviate", ex_abbreviate, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_abclear, "abclear", ex_abclear, EXTRA|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_aboveleft, "aboveleft", ex_wrongmodifier, NEEDARG|EXTRA|NOTRLCOM, ADDR_LINES), EX(CMD_all, "all", ex_all, BANG|RANGE|NOTADR|COUNT|TRLBAR, ADDR_LINES), EX(CMD_amenu, "amenu", ex_menu, RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_anoremenu, "anoremenu", ex_menu, RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_args, "args", ex_args, BANG|FILES|EDITCMD|ARGOPT|TRLBAR, ADDR_LINES), EX(CMD_argadd, "argadd", ex_argadd, BANG|RANGE|NOTADR|ZEROR|FILES|TRLBAR, ADDR_ARGUMENTS), EX(CMD_argdelete, "argdelete", ex_argdelete, BANG|RANGE|NOTADR|FILES|TRLBAR, ADDR_ARGUMENTS), EX(CMD_argdo, "argdo", ex_listdo, BANG|NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL, ADDR_ARGUMENTS), EX(CMD_argedit, "argedit", ex_argedit, BANG|NEEDARG|RANGE|NOTADR|ZEROR|FILE1|EDITCMD|ARGOPT|TRLBAR, ADDR_ARGUMENTS), EX(CMD_argglobal, "argglobal", ex_args, BANG|FILES|EDITCMD|ARGOPT|TRLBAR, ADDR_LINES), EX(CMD_arglocal, "arglocal", ex_args, BANG|FILES|EDITCMD|ARGOPT|TRLBAR, ADDR_LINES), EX(CMD_argument, "argument", ex_argument, BANG|RANGE|NOTADR|COUNT|EXTRA|EDITCMD|ARGOPT|TRLBAR, ADDR_ARGUMENTS), EX(CMD_ascii, "ascii", do_ascii, TRLBAR|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_autocmd, "autocmd", ex_autocmd, BANG|EXTRA|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_augroup, "augroup", ex_autocmd, BANG|WORD1|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_aunmenu, "aunmenu", ex_menu, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_buffer, "buffer", ex_buffer, BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|EDITCMD|TRLBAR, ADDR_BUFFERS), EX(CMD_bNext, "bNext", ex_bprevious, BANG|RANGE|NOTADR|COUNT|EDITCMD|TRLBAR, ADDR_LINES), EX(CMD_ball, "ball", ex_buffer_all, RANGE|NOTADR|COUNT|TRLBAR, ADDR_LINES), EX(CMD_badd, "badd", ex_edit, NEEDARG|FILE1|EDITCMD|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_bdelete, "bdelete", ex_bunload, BANG|RANGE|NOTADR|BUFNAME|COUNT|EXTRA|TRLBAR, ADDR_BUFFERS), EX(CMD_behave, "behave", ex_behave, NEEDARG|WORD1|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_belowright, "belowright", ex_wrongmodifier, NEEDARG|EXTRA|NOTRLCOM, ADDR_LINES), EX(CMD_bfirst, "bfirst", ex_brewind, BANG|RANGE|NOTADR|EDITCMD|TRLBAR, ADDR_LINES), EX(CMD_blast, "blast", ex_blast, BANG|RANGE|NOTADR|EDITCMD|TRLBAR, ADDR_LINES), EX(CMD_bmodified, "bmodified", ex_bmodified, BANG|RANGE|NOTADR|COUNT|EDITCMD|TRLBAR, ADDR_LINES), EX(CMD_bnext, "bnext", ex_bnext, BANG|RANGE|NOTADR|COUNT|EDITCMD|TRLBAR, ADDR_LINES), EX(CMD_botright, "botright", ex_wrongmodifier, NEEDARG|EXTRA|NOTRLCOM, ADDR_LINES), EX(CMD_bprevious, "bprevious", ex_bprevious, BANG|RANGE|NOTADR|COUNT|EDITCMD|TRLBAR, ADDR_LINES), EX(CMD_brewind, "brewind", ex_brewind, BANG|RANGE|NOTADR|EDITCMD|TRLBAR, ADDR_LINES), EX(CMD_break, "break", ex_break, TRLBAR|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_breakadd, "breakadd", ex_breakadd, EXTRA|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_breakdel, "breakdel", ex_breakdel, EXTRA|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_breaklist, "breaklist", ex_breaklist, EXTRA|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_browse, "browse", ex_wrongmodifier, NEEDARG|EXTRA|NOTRLCOM|CMDWIN, ADDR_LINES), EX(CMD_buffers, "buffers", buflist_list, BANG|EXTRA|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_bufdo, "bufdo", ex_listdo, BANG|NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL, ADDR_BUFFERS), EX(CMD_bunload, "bunload", ex_bunload, BANG|RANGE|NOTADR|BUFNAME|COUNT|EXTRA|TRLBAR, ADDR_LOADED_BUFFERS), EX(CMD_bwipeout, "bwipeout", ex_bunload, BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|TRLBAR, ADDR_BUFFERS), EX(CMD_change, "change", ex_change, BANG|WHOLEFOLD|RANGE|COUNT|TRLBAR|CMDWIN|MODIFY, ADDR_LINES), EX(CMD_cNext, "cNext", ex_cnext, RANGE|NOTADR|COUNT|TRLBAR|BANG, ADDR_LINES), EX(CMD_cNfile, "cNfile", ex_cnext, RANGE|NOTADR|COUNT|TRLBAR|BANG, ADDR_LINES), EX(CMD_cabbrev, "cabbrev", ex_abbreviate, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_cabclear, "cabclear", ex_abclear, EXTRA|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_caddbuffer, "caddbuffer", ex_cbuffer, RANGE|NOTADR|WORD1|TRLBAR, ADDR_LINES), EX(CMD_caddexpr, "caddexpr", ex_cexpr, NEEDARG|WORD1|NOTRLCOM|TRLBAR, ADDR_LINES), EX(CMD_caddfile, "caddfile", ex_cfile, TRLBAR|FILE1, ADDR_LINES), EX(CMD_call, "call", ex_call, RANGE|NEEDARG|EXTRA|NOTRLCOM|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_catch, "catch", ex_catch, EXTRA|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_cbuffer, "cbuffer", ex_cbuffer, BANG|RANGE|NOTADR|WORD1|TRLBAR, ADDR_LINES), EX(CMD_cc, "cc", ex_cc, RANGE|NOTADR|COUNT|TRLBAR|BANG, ADDR_LINES), EX(CMD_cclose, "cclose", ex_cclose, RANGE|NOTADR|COUNT|TRLBAR, ADDR_LINES), EX(CMD_cd, "cd", ex_cd, BANG|FILE1|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_cdo, "cdo", ex_listdo, BANG|NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL, ADDR_QUICKFIX), EX(CMD_center, "center", ex_align, TRLBAR|RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY, ADDR_LINES), EX(CMD_cexpr, "cexpr", ex_cexpr, NEEDARG|WORD1|NOTRLCOM|TRLBAR|BANG, ADDR_LINES), EX(CMD_cfile, "cfile", ex_cfile, TRLBAR|FILE1|BANG, ADDR_LINES), EX(CMD_cfdo, "cfdo", ex_listdo, BANG|NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL, ADDR_QUICKFIX), EX(CMD_cfirst, "cfirst", ex_cc, RANGE|NOTADR|COUNT|TRLBAR|BANG, ADDR_LINES), EX(CMD_cgetfile, "cgetfile", ex_cfile, TRLBAR|FILE1, ADDR_LINES), EX(CMD_cgetbuffer, "cgetbuffer", ex_cbuffer, RANGE|NOTADR|WORD1|TRLBAR, ADDR_LINES), EX(CMD_cgetexpr, "cgetexpr", ex_cexpr, NEEDARG|WORD1|NOTRLCOM|TRLBAR, ADDR_LINES), EX(CMD_chdir, "chdir", ex_cd, BANG|FILE1|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_changes, "changes", ex_changes, TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_checkpath, "checkpath", ex_checkpath, TRLBAR|BANG|CMDWIN, ADDR_LINES), EX(CMD_checktime, "checktime", ex_checktime, RANGE|NOTADR|BUFNAME|COUNT|EXTRA|TRLBAR, ADDR_LINES), EX(CMD_clist, "clist", qf_list, BANG|EXTRA|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_clast, "clast", ex_cc, RANGE|NOTADR|COUNT|TRLBAR|BANG, ADDR_LINES), EX(CMD_close, "close", ex_close, BANG|RANGE|NOTADR|COUNT|TRLBAR|CMDWIN, ADDR_WINDOWS), EX(CMD_cmap, "cmap", ex_map, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_cmapclear, "cmapclear", ex_mapclear, EXTRA|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_cmenu, "cmenu", ex_menu, RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_cnext, "cnext", ex_cnext, RANGE|NOTADR|COUNT|TRLBAR|BANG, ADDR_LINES), EX(CMD_cnewer, "cnewer", qf_age, RANGE|NOTADR|COUNT|TRLBAR, ADDR_LINES), EX(CMD_cnfile, "cnfile", ex_cnext, RANGE|NOTADR|COUNT|TRLBAR|BANG, ADDR_LINES), EX(CMD_cnoremap, "cnoremap", ex_map, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_cnoreabbrev, "cnoreabbrev", ex_abbreviate, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_cnoremenu, "cnoremenu", ex_menu, RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_copy, "copy", ex_copymove, RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN|MODIFY, ADDR_LINES), EX(CMD_colder, "colder", qf_age, RANGE|NOTADR|COUNT|TRLBAR, ADDR_LINES), EX(CMD_colorscheme, "colorscheme", ex_colorscheme, WORD1|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_command, "command", ex_command, EXTRA|BANG|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_comclear, "comclear", ex_comclear, TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_compiler, "compiler", ex_compiler, BANG|TRLBAR|WORD1|CMDWIN, ADDR_LINES), EX(CMD_continue, "continue", ex_continue, TRLBAR|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_confirm, "confirm", ex_wrongmodifier, NEEDARG|EXTRA|NOTRLCOM|CMDWIN, ADDR_LINES), EX(CMD_copen, "copen", ex_copen, RANGE|NOTADR|COUNT|TRLBAR, ADDR_LINES), EX(CMD_cprevious, "cprevious", ex_cnext, RANGE|NOTADR|COUNT|TRLBAR|BANG, ADDR_LINES), EX(CMD_cpfile, "cpfile", ex_cnext, RANGE|NOTADR|COUNT|TRLBAR|BANG, ADDR_LINES), EX(CMD_cquit, "cquit", ex_cquit, TRLBAR|BANG, ADDR_LINES), EX(CMD_crewind, "crewind", ex_cc, RANGE|NOTADR|COUNT|TRLBAR|BANG, ADDR_LINES), EX(CMD_cscope, "cscope", do_cscope, EXTRA|NOTRLCOM|XFILE, ADDR_LINES), EX(CMD_cstag, "cstag", do_cstag, BANG|TRLBAR|WORD1, ADDR_LINES), EX(CMD_cunmap, "cunmap", ex_unmap, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_cunabbrev, "cunabbrev", ex_abbreviate, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_cunmenu, "cunmenu", ex_menu, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_cwindow, "cwindow", ex_cwindow, RANGE|NOTADR|COUNT|TRLBAR, ADDR_LINES), EX(CMD_delete, "delete", ex_operators, RANGE|WHOLEFOLD|REGSTR|COUNT|TRLBAR|CMDWIN|MODIFY, ADDR_LINES), EX(CMD_delmarks, "delmarks", ex_delmarks, BANG|EXTRA|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_debug, "debug", ex_debug, NEEDARG|EXTRA|NOTRLCOM|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_debuggreedy, "debuggreedy", ex_debuggreedy, RANGE|NOTADR|ZEROR|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_delcommand, "delcommand", ex_delcommand, NEEDARG|WORD1|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_delfunction, "delfunction", ex_delfunction, NEEDARG|WORD1|CMDWIN, ADDR_LINES), EX(CMD_display, "display", ex_display, EXTRA|NOTRLCOM|TRLBAR|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_diffupdate, "diffupdate", ex_diffupdate, BANG|TRLBAR, ADDR_LINES), EX(CMD_diffget, "diffget", ex_diffgetput, RANGE|EXTRA|TRLBAR|MODIFY, ADDR_LINES), EX(CMD_diffoff, "diffoff", ex_diffoff, BANG|TRLBAR, ADDR_LINES), EX(CMD_diffpatch, "diffpatch", ex_diffpatch, EXTRA|FILE1|TRLBAR|MODIFY, ADDR_LINES), EX(CMD_diffput, "diffput", ex_diffgetput, RANGE|EXTRA|TRLBAR, ADDR_LINES), EX(CMD_diffsplit, "diffsplit", ex_diffsplit, EXTRA|FILE1|TRLBAR, ADDR_LINES), EX(CMD_diffthis, "diffthis", ex_diffthis, TRLBAR, ADDR_LINES), EX(CMD_digraphs, "digraphs", ex_digraphs, EXTRA|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_djump, "djump", ex_findpat, BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA, ADDR_LINES), EX(CMD_dlist, "dlist", ex_findpat, BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA|CMDWIN, ADDR_LINES), EX(CMD_doautocmd, "doautocmd", ex_doautocmd, EXTRA|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_doautoall, "doautoall", ex_doautoall, EXTRA|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_drop, "drop", ex_drop, FILES|EDITCMD|NEEDARG|ARGOPT|TRLBAR, ADDR_LINES), EX(CMD_dsearch, "dsearch", ex_findpat, BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA|CMDWIN, ADDR_LINES), EX(CMD_dsplit, "dsplit", ex_findpat, BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA, ADDR_LINES), EX(CMD_edit, "edit", ex_edit, BANG|FILE1|EDITCMD|ARGOPT|TRLBAR, ADDR_LINES), EX(CMD_earlier, "earlier", ex_later, TRLBAR|EXTRA|NOSPC|CMDWIN, ADDR_LINES), EX(CMD_echo, "echo", ex_echo, EXTRA|NOTRLCOM|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_echoerr, "echoerr", ex_execute, EXTRA|NOTRLCOM|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_echohl, "echohl", ex_echohl, EXTRA|TRLBAR|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_echomsg, "echomsg", ex_execute, EXTRA|NOTRLCOM|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_echon, "echon", ex_echo, EXTRA|NOTRLCOM|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_else, "else", ex_else, TRLBAR|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_elseif, "elseif", ex_else, EXTRA|NOTRLCOM|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_emenu, "emenu", ex_emenu, NEEDARG|EXTRA|TRLBAR|NOTRLCOM|RANGE|NOTADR|CMDWIN, ADDR_LINES), EX(CMD_endif, "endif", ex_endif, TRLBAR|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_endfunction, "endfunction", ex_endfunction, TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_endfor, "endfor", ex_endwhile, TRLBAR|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_endtry, "endtry", ex_endtry, TRLBAR|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_endwhile, "endwhile", ex_endwhile, TRLBAR|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_enew, "enew", ex_edit, BANG|TRLBAR, ADDR_LINES), EX(CMD_ex, "ex", ex_edit, BANG|FILE1|EDITCMD|ARGOPT|TRLBAR, ADDR_LINES), EX(CMD_execute, "execute", ex_execute, EXTRA|NOTRLCOM|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_exit, "exit", ex_exit, RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_exusage, "exusage", ex_exusage, TRLBAR, ADDR_LINES), EX(CMD_file, "file", ex_file, RANGE|NOTADR|ZEROR|BANG|FILE1|TRLBAR, ADDR_LINES), EX(CMD_files, "files", buflist_list, BANG|EXTRA|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_filetype, "filetype", ex_filetype, EXTRA|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_find, "find", ex_find, RANGE|NOTADR|BANG|FILE1|EDITCMD|ARGOPT|TRLBAR, ADDR_LINES), EX(CMD_finally, "finally", ex_finally, TRLBAR|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_finish, "finish", ex_finish, TRLBAR|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_first, "first", ex_rewind, EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR, ADDR_LINES), EX(CMD_fixdel, "fixdel", do_fixdel, TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_fold, "fold", ex_fold, RANGE|WHOLEFOLD|TRLBAR|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_foldclose, "foldclose", ex_foldopen, RANGE|BANG|WHOLEFOLD|TRLBAR|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_folddoopen, "folddoopen", ex_folddo, RANGE|DFLALL|NEEDARG|EXTRA|NOTRLCOM, ADDR_LINES), EX(CMD_folddoclosed, "folddoclosed", ex_folddo, RANGE|DFLALL|NEEDARG|EXTRA|NOTRLCOM, ADDR_LINES), EX(CMD_foldopen, "foldopen", ex_foldopen, RANGE|BANG|WHOLEFOLD|TRLBAR|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_for, "for", ex_while, EXTRA|NOTRLCOM|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_function, "function", ex_function, EXTRA|BANG|CMDWIN, ADDR_LINES), EX(CMD_global, "global", ex_global, RANGE|WHOLEFOLD|BANG|EXTRA|DFLALL|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_goto, "goto", ex_goto, RANGE|NOTADR|COUNT|TRLBAR|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_grep, "grep", ex_make, RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE, ADDR_LINES), EX(CMD_grepadd, "grepadd", ex_make, RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE, ADDR_LINES), EX(CMD_gui, "gui", ex_gui, BANG|FILES|EDITCMD|ARGOPT|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_gvim, "gvim", ex_gui, BANG|FILES|EDITCMD|ARGOPT|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_help, "help", ex_help, BANG|EXTRA|NOTRLCOM, ADDR_LINES), EX(CMD_helpclose, "helpclose", ex_helpclose, RANGE|NOTADR|COUNT|TRLBAR, ADDR_LINES), EX(CMD_helpfind, "helpfind", ex_helpfind, EXTRA|NOTRLCOM, ADDR_LINES), EX(CMD_helpgrep, "helpgrep", ex_helpgrep, EXTRA|NOTRLCOM|NEEDARG, ADDR_LINES), EX(CMD_helptags, "helptags", ex_helptags, NEEDARG|FILES|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_hardcopy, "hardcopy", ex_hardcopy, RANGE|COUNT|EXTRA|TRLBAR|DFLALL|BANG, ADDR_LINES), EX(CMD_highlight, "highlight", ex_highlight, BANG|EXTRA|TRLBAR|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_hide, "hide", ex_hide, BANG|RANGE|NOTADR|COUNT|EXTRA|NOTRLCOM, ADDR_WINDOWS), EX(CMD_history, "history", ex_history, EXTRA|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_insert, "insert", ex_append, BANG|RANGE|TRLBAR|CMDWIN|MODIFY, ADDR_LINES), EX(CMD_iabbrev, "iabbrev", ex_abbreviate, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_iabclear, "iabclear", ex_abclear, EXTRA|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_if, "if", ex_if, EXTRA|NOTRLCOM|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_ijump, "ijump", ex_findpat, BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA, ADDR_LINES), EX(CMD_ilist, "ilist", ex_findpat, BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA|CMDWIN, ADDR_LINES), EX(CMD_imap, "imap", ex_map, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_imapclear, "imapclear", ex_mapclear, EXTRA|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_imenu, "imenu", ex_menu, RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_inoremap, "inoremap", ex_map, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_inoreabbrev, "inoreabbrev", ex_abbreviate, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_inoremenu, "inoremenu", ex_menu, RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_intro, "intro", ex_intro, TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_isearch, "isearch", ex_findpat, BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA|CMDWIN, ADDR_LINES), EX(CMD_isplit, "isplit", ex_findpat, BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA, ADDR_LINES), EX(CMD_iunmap, "iunmap", ex_unmap, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_iunabbrev, "iunabbrev", ex_abbreviate, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_iunmenu, "iunmenu", ex_menu, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_join, "join", ex_join, BANG|RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN|MODIFY, ADDR_LINES), EX(CMD_jumps, "jumps", ex_jumps, TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_k, "k", ex_mark, RANGE|WORD1|TRLBAR|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_keepmarks, "keepmarks", ex_wrongmodifier, NEEDARG|EXTRA|NOTRLCOM, ADDR_LINES), EX(CMD_keepjumps, "keepjumps", ex_wrongmodifier, NEEDARG|EXTRA|NOTRLCOM, ADDR_LINES), EX(CMD_keeppatterns, "keeppatterns", ex_wrongmodifier, NEEDARG|EXTRA|NOTRLCOM, ADDR_LINES), EX(CMD_keepalt, "keepalt", ex_wrongmodifier, NEEDARG|EXTRA|NOTRLCOM, ADDR_LINES), EX(CMD_list, "list", ex_print, RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_lNext, "lNext", ex_cnext, RANGE|NOTADR|COUNT|TRLBAR|BANG, ADDR_LINES), EX(CMD_lNfile, "lNfile", ex_cnext, RANGE|NOTADR|COUNT|TRLBAR|BANG, ADDR_LINES), EX(CMD_last, "last", ex_last, EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR, ADDR_LINES), EX(CMD_language, "language", ex_language, EXTRA|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_laddexpr, "laddexpr", ex_cexpr, NEEDARG|WORD1|NOTRLCOM|TRLBAR, ADDR_LINES), EX(CMD_laddbuffer, "laddbuffer", ex_cbuffer, RANGE|NOTADR|WORD1|TRLBAR, ADDR_LINES), EX(CMD_laddfile, "laddfile", ex_cfile, TRLBAR|FILE1, ADDR_LINES), EX(CMD_later, "later", ex_later, TRLBAR|EXTRA|NOSPC|CMDWIN, ADDR_LINES), EX(CMD_lbuffer, "lbuffer", ex_cbuffer, BANG|RANGE|NOTADR|WORD1|TRLBAR, ADDR_LINES), EX(CMD_lcd, "lcd", ex_cd, BANG|FILE1|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_lchdir, "lchdir", ex_cd, BANG|FILE1|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_lclose, "lclose", ex_cclose, RANGE|NOTADR|COUNT|TRLBAR, ADDR_LINES), EX(CMD_lcscope, "lcscope", do_cscope, EXTRA|NOTRLCOM|XFILE, ADDR_LINES), EX(CMD_ldo, "ldo", ex_listdo, BANG|NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL, ADDR_QUICKFIX), EX(CMD_left, "left", ex_align, TRLBAR|RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY, ADDR_LINES), EX(CMD_leftabove, "leftabove", ex_wrongmodifier, NEEDARG|EXTRA|NOTRLCOM, ADDR_LINES), EX(CMD_let, "let", ex_let, EXTRA|NOTRLCOM|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_lexpr, "lexpr", ex_cexpr, NEEDARG|WORD1|NOTRLCOM|TRLBAR|BANG, ADDR_LINES), EX(CMD_lfile, "lfile", ex_cfile, TRLBAR|FILE1|BANG, ADDR_LINES), EX(CMD_lfdo, "lfdo", ex_listdo, BANG|NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL, ADDR_QUICKFIX), EX(CMD_lfirst, "lfirst", ex_cc, RANGE|NOTADR|COUNT|TRLBAR|BANG, ADDR_LINES), EX(CMD_lgetfile, "lgetfile", ex_cfile, TRLBAR|FILE1, ADDR_LINES), EX(CMD_lgetbuffer, "lgetbuffer", ex_cbuffer, RANGE|NOTADR|WORD1|TRLBAR, ADDR_LINES), EX(CMD_lgetexpr, "lgetexpr", ex_cexpr, NEEDARG|WORD1|NOTRLCOM|TRLBAR, ADDR_LINES), EX(CMD_lgrep, "lgrep", ex_make, RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE, ADDR_LINES), EX(CMD_lgrepadd, "lgrepadd", ex_make, RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE, ADDR_LINES), EX(CMD_lhelpgrep, "lhelpgrep", ex_helpgrep, EXTRA|NOTRLCOM|NEEDARG, ADDR_LINES), EX(CMD_ll, "ll", ex_cc, RANGE|NOTADR|COUNT|TRLBAR|BANG, ADDR_LINES), EX(CMD_llast, "llast", ex_cc, RANGE|NOTADR|COUNT|TRLBAR|BANG, ADDR_LINES), EX(CMD_llist, "llist", qf_list, BANG|EXTRA|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_lmap, "lmap", ex_map, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_lmapclear, "lmapclear", ex_mapclear, EXTRA|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_lmake, "lmake", ex_make, BANG|EXTRA|NOTRLCOM|TRLBAR|XFILE, ADDR_LINES), EX(CMD_lnoremap, "lnoremap", ex_map, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_lnext, "lnext", ex_cnext, RANGE|NOTADR|COUNT|TRLBAR|BANG, ADDR_LINES), EX(CMD_lnewer, "lnewer", qf_age, RANGE|NOTADR|COUNT|TRLBAR, ADDR_LINES), EX(CMD_lnfile, "lnfile", ex_cnext, RANGE|NOTADR|COUNT|TRLBAR|BANG, ADDR_LINES), EX(CMD_loadview, "loadview", ex_loadview, FILE1|TRLBAR, ADDR_LINES), EX(CMD_loadkeymap, "loadkeymap", ex_loadkeymap, CMDWIN, ADDR_LINES), EX(CMD_lockmarks, "lockmarks", ex_wrongmodifier, NEEDARG|EXTRA|NOTRLCOM, ADDR_LINES), EX(CMD_lockvar, "lockvar", ex_lockvar, BANG|EXTRA|NEEDARG|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_lolder, "lolder", qf_age, RANGE|NOTADR|COUNT|TRLBAR, ADDR_LINES), EX(CMD_lopen, "lopen", ex_copen, RANGE|NOTADR|COUNT|TRLBAR, ADDR_LINES), EX(CMD_lprevious, "lprevious", ex_cnext, RANGE|NOTADR|COUNT|TRLBAR|BANG, ADDR_LINES), EX(CMD_lpfile, "lpfile", ex_cnext, RANGE|NOTADR|COUNT|TRLBAR|BANG, ADDR_LINES), EX(CMD_lrewind, "lrewind", ex_cc, RANGE|NOTADR|COUNT|TRLBAR|BANG, ADDR_LINES), EX(CMD_ltag, "ltag", ex_tag, NOTADR|TRLBAR|BANG|WORD1, ADDR_LINES), EX(CMD_lunmap, "lunmap", ex_unmap, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_lua, "lua", ex_lua, RANGE|EXTRA|NEEDARG|CMDWIN, ADDR_LINES), EX(CMD_luado, "luado", ex_luado, RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN, ADDR_LINES), EX(CMD_luafile, "luafile", ex_luafile, RANGE|FILE1|NEEDARG|CMDWIN, ADDR_LINES), EX(CMD_lvimgrep, "lvimgrep", ex_vimgrep, RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE, ADDR_LINES), EX(CMD_lvimgrepadd, "lvimgrepadd", ex_vimgrep, RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE, ADDR_LINES), EX(CMD_lwindow, "lwindow", ex_cwindow, RANGE|NOTADR|COUNT|TRLBAR, ADDR_LINES), EX(CMD_ls, "ls", buflist_list, BANG|EXTRA|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_move, "move", ex_copymove, RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN|MODIFY, ADDR_LINES), EX(CMD_mark, "mark", ex_mark, RANGE|WORD1|TRLBAR|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_make, "make", ex_make, BANG|EXTRA|NOTRLCOM|TRLBAR|XFILE, ADDR_LINES), EX(CMD_map, "map", ex_map, BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_mapclear, "mapclear", ex_mapclear, EXTRA|BANG|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_marks, "marks", do_marks, EXTRA|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_match, "match", ex_match, RANGE|NOTADR|EXTRA|CMDWIN, ADDR_LINES), EX(CMD_menu, "menu", ex_menu, RANGE|NOTADR|ZEROR|BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_menutranslate, "menutranslate", ex_menutranslate, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_messages, "messages", ex_messages, TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_mkexrc, "mkexrc", ex_mkrc, BANG|FILE1|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_mksession, "mksession", ex_mkrc, BANG|FILE1|TRLBAR, ADDR_LINES), EX(CMD_mkspell, "mkspell", ex_mkspell, BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE, ADDR_LINES), EX(CMD_mkvimrc, "mkvimrc", ex_mkrc, BANG|FILE1|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_mkview, "mkview", ex_mkrc, BANG|FILE1|TRLBAR, ADDR_LINES), EX(CMD_mode, "mode", ex_mode, WORD1|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_mzscheme, "mzscheme", ex_mzscheme, RANGE|EXTRA|DFLALL|NEEDARG|CMDWIN|SBOXOK, ADDR_LINES), EX(CMD_mzfile, "mzfile", ex_mzfile, RANGE|FILE1|NEEDARG|CMDWIN, ADDR_LINES), EX(CMD_next, "next", ex_next, RANGE|NOTADR|BANG|FILES|EDITCMD|ARGOPT|TRLBAR, ADDR_LINES), EX(CMD_nbkey, "nbkey", ex_nbkey, EXTRA|NOTADR|NEEDARG, ADDR_LINES), EX(CMD_nbclose, "nbclose", ex_nbclose, TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_nbstart, "nbstart", ex_nbstart, WORD1|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_new, "new", ex_splitview, BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR, ADDR_LINES), EX(CMD_nmap, "nmap", ex_map, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_nmapclear, "nmapclear", ex_mapclear, EXTRA|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_nmenu, "nmenu", ex_menu, RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_nnoremap, "nnoremap", ex_map, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_nnoremenu, "nnoremenu", ex_menu, RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_noremap, "noremap", ex_map, BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_noautocmd, "noautocmd", ex_wrongmodifier, NEEDARG|EXTRA|NOTRLCOM, ADDR_LINES), EX(CMD_nohlsearch, "nohlsearch", ex_nohlsearch, TRLBAR|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_noreabbrev, "noreabbrev", ex_abbreviate, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_noremenu, "noremenu", ex_menu, RANGE|NOTADR|ZEROR|BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_noswapfile, "noswapfile", ex_wrongmodifier, NEEDARG|EXTRA|NOTRLCOM, ADDR_LINES), EX(CMD_normal, "normal", ex_normal, RANGE|BANG|EXTRA|NEEDARG|NOTRLCOM|USECTRLV|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_number, "number", ex_print, RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_nunmap, "nunmap", ex_unmap, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_nunmenu, "nunmenu", ex_menu, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_open, "open", ex_open, RANGE|BANG|EXTRA, ADDR_LINES), EX(CMD_oldfiles, "oldfiles", ex_oldfiles, BANG|TRLBAR|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_omap, "omap", ex_map, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_omapclear, "omapclear", ex_mapclear, EXTRA|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_omenu, "omenu", ex_menu, RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_only, "only", ex_only, BANG|NOTADR|RANGE|COUNT|TRLBAR, ADDR_WINDOWS), EX(CMD_onoremap, "onoremap", ex_map, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_onoremenu, "onoremenu", ex_menu, RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_options, "options", ex_options, TRLBAR, ADDR_LINES), EX(CMD_ounmap, "ounmap", ex_unmap, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_ounmenu, "ounmenu", ex_menu, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_ownsyntax, "ownsyntax", ex_ownsyntax, EXTRA|NOTRLCOM|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_print, "print", ex_print, RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN|SBOXOK, ADDR_LINES), EX(CMD_packadd, "packadd", ex_packadd, BANG|FILE1|NEEDARG|TRLBAR|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_packloadall, "packloadall", ex_packloadall, BANG|TRLBAR|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_pclose, "pclose", ex_pclose, BANG|TRLBAR, ADDR_LINES), EX(CMD_perl, "perl", ex_perl, RANGE|EXTRA|DFLALL|NEEDARG|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_perldo, "perldo", ex_perldo, RANGE|EXTRA|DFLALL|NEEDARG|CMDWIN, ADDR_LINES), EX(CMD_pedit, "pedit", ex_pedit, BANG|FILE1|EDITCMD|ARGOPT|TRLBAR, ADDR_LINES), EX(CMD_pop, "pop", ex_tag, RANGE|NOTADR|BANG|COUNT|TRLBAR|ZEROR, ADDR_LINES), EX(CMD_popup, "popup", ex_popup, NEEDARG|EXTRA|BANG|TRLBAR|NOTRLCOM|CMDWIN, ADDR_LINES), EX(CMD_ppop, "ppop", ex_ptag, RANGE|NOTADR|BANG|COUNT|TRLBAR|ZEROR, ADDR_LINES), EX(CMD_preserve, "preserve", ex_preserve, TRLBAR, ADDR_LINES), EX(CMD_previous, "previous", ex_previous, EXTRA|RANGE|NOTADR|COUNT|BANG|EDITCMD|ARGOPT|TRLBAR, ADDR_LINES), EX(CMD_promptfind, "promptfind", gui_mch_find_dialog, EXTRA|NOTRLCOM|CMDWIN, ADDR_LINES), EX(CMD_promptrepl, "promptrepl", gui_mch_replace_dialog, EXTRA|NOTRLCOM|CMDWIN, ADDR_LINES), EX(CMD_profile, "profile", ex_profile, BANG|EXTRA|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_profdel, "profdel", ex_breakdel, EXTRA|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_psearch, "psearch", ex_psearch, BANG|RANGE|WHOLEFOLD|DFLALL|EXTRA, ADDR_LINES), EX(CMD_ptag, "ptag", ex_ptag, RANGE|NOTADR|BANG|WORD1|TRLBAR|ZEROR, ADDR_LINES), EX(CMD_ptNext, "ptNext", ex_ptag, RANGE|NOTADR|BANG|TRLBAR|ZEROR, ADDR_LINES), EX(CMD_ptfirst, "ptfirst", ex_ptag, RANGE|NOTADR|BANG|TRLBAR|ZEROR, ADDR_LINES), EX(CMD_ptjump, "ptjump", ex_ptag, BANG|TRLBAR|WORD1, ADDR_LINES), EX(CMD_ptlast, "ptlast", ex_ptag, BANG|TRLBAR, ADDR_LINES), EX(CMD_ptnext, "ptnext", ex_ptag, RANGE|NOTADR|BANG|TRLBAR|ZEROR, ADDR_LINES), EX(CMD_ptprevious, "ptprevious", ex_ptag, RANGE|NOTADR|BANG|TRLBAR|ZEROR, ADDR_LINES), EX(CMD_ptrewind, "ptrewind", ex_ptag, RANGE|NOTADR|BANG|TRLBAR|ZEROR, ADDR_LINES), EX(CMD_ptselect, "ptselect", ex_ptag, BANG|TRLBAR|WORD1, ADDR_LINES), EX(CMD_put, "put", ex_put, RANGE|WHOLEFOLD|BANG|REGSTR|TRLBAR|ZEROR|CMDWIN|MODIFY, ADDR_LINES), EX(CMD_pwd, "pwd", ex_pwd, TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_python, "python", ex_python, RANGE|EXTRA|NEEDARG|CMDWIN, ADDR_LINES), EX(CMD_pydo, "pydo", ex_pydo, RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN, ADDR_LINES), EX(CMD_pyfile, "pyfile", ex_pyfile, RANGE|FILE1|NEEDARG|CMDWIN, ADDR_LINES), EX(CMD_py3, "py3", ex_py3, RANGE|EXTRA|NEEDARG|CMDWIN, ADDR_LINES), EX(CMD_py3do, "py3do", ex_py3do, RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN, ADDR_LINES), EX(CMD_python3, "python3", ex_py3, RANGE|EXTRA|NEEDARG|CMDWIN, ADDR_LINES), EX(CMD_py3file, "py3file", ex_py3file, RANGE|FILE1|NEEDARG|CMDWIN, ADDR_LINES), EX(CMD_quit, "quit", ex_quit, BANG|RANGE|COUNT|NOTADR|TRLBAR|CMDWIN, ADDR_WINDOWS), EX(CMD_quitall, "quitall", ex_quit_all, BANG|TRLBAR, ADDR_LINES), EX(CMD_qall, "qall", ex_quit_all, BANG|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_read, "read", ex_read, BANG|RANGE|WHOLEFOLD|FILE1|ARGOPT|TRLBAR|ZEROR|CMDWIN|MODIFY, ADDR_LINES), EX(CMD_recover, "recover", ex_recover, BANG|FILE1|TRLBAR, ADDR_LINES), EX(CMD_redo, "redo", ex_redo, TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_redir, "redir", ex_redir, BANG|FILES|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_redraw, "redraw", ex_redraw, BANG|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_redrawstatus, "redrawstatus", ex_redrawstatus, BANG|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_registers, "registers", ex_display, EXTRA|NOTRLCOM|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_resize, "resize", ex_resize, RANGE|NOTADR|TRLBAR|WORD1, ADDR_LINES), EX(CMD_retab, "retab", ex_retab, TRLBAR|RANGE|WHOLEFOLD|DFLALL|BANG|WORD1|CMDWIN|MODIFY, ADDR_LINES), EX(CMD_return, "return", ex_return, EXTRA|NOTRLCOM|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_rewind, "rewind", ex_rewind, EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR, ADDR_LINES), EX(CMD_right, "right", ex_align, TRLBAR|RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY, ADDR_LINES), EX(CMD_rightbelow, "rightbelow", ex_wrongmodifier, NEEDARG|EXTRA|NOTRLCOM, ADDR_LINES), EX(CMD_runtime, "runtime", ex_runtime, BANG|NEEDARG|FILES|TRLBAR|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_ruby, "ruby", ex_ruby, RANGE|EXTRA|NEEDARG|CMDWIN, ADDR_LINES), EX(CMD_rubydo, "rubydo", ex_rubydo, RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN, ADDR_LINES), EX(CMD_rubyfile, "rubyfile", ex_rubyfile, RANGE|FILE1|NEEDARG|CMDWIN, ADDR_LINES), EX(CMD_rundo, "rundo", ex_rundo, NEEDARG|FILE1, ADDR_LINES), EX(CMD_rviminfo, "rviminfo", ex_viminfo, BANG|FILE1|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_substitute, "substitute", do_sub, RANGE|WHOLEFOLD|EXTRA|CMDWIN, ADDR_LINES), EX(CMD_sNext, "sNext", ex_previous, EXTRA|RANGE|NOTADR|COUNT|BANG|EDITCMD|ARGOPT|TRLBAR, ADDR_LINES), EX(CMD_sargument, "sargument", ex_argument, BANG|RANGE|NOTADR|COUNT|EXTRA|EDITCMD|ARGOPT|TRLBAR, ADDR_ARGUMENTS), EX(CMD_sall, "sall", ex_all, BANG|RANGE|NOTADR|COUNT|TRLBAR, ADDR_LINES), EX(CMD_sandbox, "sandbox", ex_wrongmodifier, NEEDARG|EXTRA|NOTRLCOM, ADDR_LINES), EX(CMD_saveas, "saveas", ex_write, BANG|DFLALL|FILE1|ARGOPT|CMDWIN|TRLBAR, ADDR_LINES), EX(CMD_sbuffer, "sbuffer", ex_buffer, BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|EDITCMD|TRLBAR, ADDR_BUFFERS), EX(CMD_sbNext, "sbNext", ex_bprevious, RANGE|NOTADR|COUNT|EDITCMD|TRLBAR, ADDR_LINES), EX(CMD_sball, "sball", ex_buffer_all, RANGE|NOTADR|COUNT|EDITCMD|TRLBAR, ADDR_LINES), EX(CMD_sbfirst, "sbfirst", ex_brewind, EDITCMD|TRLBAR, ADDR_LINES), EX(CMD_sblast, "sblast", ex_blast, EDITCMD|TRLBAR, ADDR_LINES), EX(CMD_sbmodified, "sbmodified", ex_bmodified, RANGE|NOTADR|COUNT|EDITCMD|TRLBAR, ADDR_LINES), EX(CMD_sbnext, "sbnext", ex_bnext, RANGE|NOTADR|COUNT|EDITCMD|TRLBAR, ADDR_LINES), EX(CMD_sbprevious, "sbprevious", ex_bprevious, RANGE|NOTADR|COUNT|EDITCMD|TRLBAR, ADDR_LINES), EX(CMD_sbrewind, "sbrewind", ex_brewind, EDITCMD|TRLBAR, ADDR_LINES), EX(CMD_scriptnames, "scriptnames", ex_scriptnames, TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_scriptencoding, "scriptencoding", ex_scriptencoding, WORD1|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_scscope, "scscope", do_scscope, EXTRA|NOTRLCOM, ADDR_LINES), EX(CMD_set, "set", ex_set, TRLBAR|EXTRA|CMDWIN|SBOXOK, ADDR_LINES), EX(CMD_setfiletype, "setfiletype", ex_setfiletype, TRLBAR|EXTRA|NEEDARG|CMDWIN, ADDR_LINES), EX(CMD_setglobal, "setglobal", ex_set, TRLBAR|EXTRA|CMDWIN|SBOXOK, ADDR_LINES), EX(CMD_setlocal, "setlocal", ex_set, TRLBAR|EXTRA|CMDWIN|SBOXOK, ADDR_LINES), EX(CMD_sfind, "sfind", ex_splitview, BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR, ADDR_LINES), EX(CMD_sfirst, "sfirst", ex_rewind, EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR, ADDR_LINES), EX(CMD_shell, "shell", ex_shell, TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_simalt, "simalt", ex_simalt, NEEDARG|WORD1|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_sign, "sign", ex_sign, NEEDARG|RANGE|NOTADR|EXTRA|CMDWIN, ADDR_LINES), EX(CMD_silent, "silent", ex_wrongmodifier, NEEDARG|EXTRA|BANG|NOTRLCOM|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_sleep, "sleep", ex_sleep, RANGE|NOTADR|COUNT|EXTRA|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_slast, "slast", ex_last, EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR, ADDR_LINES), EX(CMD_smagic, "smagic", ex_submagic, RANGE|WHOLEFOLD|EXTRA|CMDWIN, ADDR_LINES), EX(CMD_smap, "smap", ex_map, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_smapclear, "smapclear", ex_mapclear, EXTRA|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_smenu, "smenu", ex_menu, RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_snext, "snext", ex_next, RANGE|NOTADR|BANG|FILES|EDITCMD|ARGOPT|TRLBAR, ADDR_LINES), EX(CMD_snomagic, "snomagic", ex_submagic, RANGE|WHOLEFOLD|EXTRA|CMDWIN, ADDR_LINES), EX(CMD_snoremap, "snoremap", ex_map, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_snoremenu, "snoremenu", ex_menu, RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_source, "source", ex_source, BANG|FILE1|TRLBAR|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_sort, "sort", ex_sort, RANGE|DFLALL|WHOLEFOLD|BANG|EXTRA|NOTRLCOM|MODIFY, ADDR_LINES), EX(CMD_split, "split", ex_splitview, BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR, ADDR_LINES), EX(CMD_spellgood, "spellgood", ex_spell, BANG|RANGE|NOTADR|NEEDARG|EXTRA|TRLBAR, ADDR_LINES), EX(CMD_spelldump, "spelldump", ex_spelldump, BANG|TRLBAR, ADDR_LINES), EX(CMD_spellinfo, "spellinfo", ex_spellinfo, TRLBAR, ADDR_LINES), EX(CMD_spellrepall, "spellrepall", ex_spellrepall, TRLBAR, ADDR_LINES), EX(CMD_spellundo, "spellundo", ex_spell, BANG|RANGE|NOTADR|NEEDARG|EXTRA|TRLBAR, ADDR_LINES), EX(CMD_spellwrong, "spellwrong", ex_spell, BANG|RANGE|NOTADR|NEEDARG|EXTRA|TRLBAR, ADDR_LINES), EX(CMD_sprevious, "sprevious", ex_previous, EXTRA|RANGE|NOTADR|COUNT|BANG|EDITCMD|ARGOPT|TRLBAR, ADDR_LINES), EX(CMD_srewind, "srewind", ex_rewind, EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR, ADDR_LINES), EX(CMD_stop, "stop", ex_stop, TRLBAR|BANG|CMDWIN, ADDR_LINES), EX(CMD_stag, "stag", ex_stag, RANGE|NOTADR|BANG|WORD1|TRLBAR|ZEROR, ADDR_LINES), EX(CMD_startinsert, "startinsert", ex_startinsert, BANG|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_startgreplace, "startgreplace", ex_startinsert, BANG|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_startreplace, "startreplace", ex_startinsert, BANG|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_stopinsert, "stopinsert", ex_stopinsert, BANG|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_stjump, "stjump", ex_stag, BANG|TRLBAR|WORD1, ADDR_LINES), EX(CMD_stselect, "stselect", ex_stag, BANG|TRLBAR|WORD1, ADDR_LINES), EX(CMD_sunhide, "sunhide", ex_buffer_all, RANGE|NOTADR|COUNT|TRLBAR, ADDR_LINES), EX(CMD_sunmap, "sunmap", ex_unmap, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_sunmenu, "sunmenu", ex_menu, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_suspend, "suspend", ex_stop, TRLBAR|BANG|CMDWIN, ADDR_LINES), EX(CMD_sview, "sview", ex_splitview, BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR, ADDR_LINES), EX(CMD_swapname, "swapname", ex_swapname, TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_syntax, "syntax", ex_syntax, EXTRA|NOTRLCOM|CMDWIN, ADDR_LINES), EX(CMD_syntime, "syntime", ex_syntime, NEEDARG|WORD1|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_syncbind, "syncbind", ex_syncbind, TRLBAR, ADDR_LINES), EX(CMD_smile, "smile", ex_smile, TRLBAR|CMDWIN|SBOXOK, ADDR_LINES), EX(CMD_t, "t", ex_copymove, RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN|MODIFY, ADDR_LINES), EX(CMD_tNext, "tNext", ex_tag, RANGE|NOTADR|BANG|TRLBAR|ZEROR, ADDR_LINES), EX(CMD_tag, "tag", ex_tag, RANGE|NOTADR|BANG|WORD1|TRLBAR|ZEROR, ADDR_LINES), EX(CMD_tags, "tags", do_tags, TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_tab, "tab", ex_wrongmodifier, NEEDARG|EXTRA|NOTRLCOM, ADDR_LINES), EX(CMD_tabclose, "tabclose", ex_tabclose, RANGE|NOTADR|COUNT|BANG|TRLBAR|CMDWIN, ADDR_TABS), EX(CMD_tabdo, "tabdo", ex_listdo, NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL, ADDR_TABS), EX(CMD_tabedit, "tabedit", ex_splitview, BANG|FILE1|RANGE|NOTADR|ZEROR|EDITCMD|ARGOPT|TRLBAR, ADDR_TABS), EX(CMD_tabfind, "tabfind", ex_splitview, BANG|FILE1|RANGE|NOTADR|ZEROR|EDITCMD|ARGOPT|NEEDARG|TRLBAR, ADDR_TABS), EX(CMD_tabfirst, "tabfirst", ex_tabnext, TRLBAR, ADDR_LINES), EX(CMD_tabmove, "tabmove", ex_tabmove, RANGE|NOTADR|ZEROR|EXTRA|NOSPC|TRLBAR, ADDR_TABS), EX(CMD_tablast, "tablast", ex_tabnext, TRLBAR, ADDR_LINES), EX(CMD_tabnext, "tabnext", ex_tabnext, RANGE|NOTADR|COUNT|TRLBAR, ADDR_LINES), EX(CMD_tabnew, "tabnew", ex_splitview, BANG|FILE1|RANGE|NOTADR|ZEROR|EDITCMD|ARGOPT|TRLBAR, ADDR_TABS), EX(CMD_tabonly, "tabonly", ex_tabonly, BANG|RANGE|NOTADR|TRLBAR|CMDWIN, ADDR_TABS), EX(CMD_tabprevious, "tabprevious", ex_tabnext, RANGE|NOTADR|COUNT|TRLBAR, ADDR_LINES), EX(CMD_tabNext, "tabNext", ex_tabnext, RANGE|NOTADR|COUNT|TRLBAR, ADDR_LINES), EX(CMD_tabrewind, "tabrewind", ex_tabnext, TRLBAR, ADDR_LINES), EX(CMD_tabs, "tabs", ex_tabs, TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_tcl, "tcl", ex_tcl, RANGE|EXTRA|NEEDARG|CMDWIN, ADDR_LINES), EX(CMD_tcldo, "tcldo", ex_tcldo, RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN, ADDR_LINES), EX(CMD_tclfile, "tclfile", ex_tclfile, RANGE|FILE1|NEEDARG|CMDWIN, ADDR_LINES), EX(CMD_tearoff, "tearoff", ex_tearoff, NEEDARG|EXTRA|TRLBAR|NOTRLCOM|CMDWIN, ADDR_LINES), EX(CMD_tfirst, "tfirst", ex_tag, RANGE|NOTADR|BANG|TRLBAR|ZEROR, ADDR_LINES), EX(CMD_throw, "throw", ex_throw, EXTRA|NEEDARG|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_tjump, "tjump", ex_tag, BANG|TRLBAR|WORD1, ADDR_LINES), EX(CMD_tlast, "tlast", ex_tag, BANG|TRLBAR, ADDR_LINES), EX(CMD_tmenu, "tmenu", ex_menu, RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_tnext, "tnext", ex_tag, RANGE|NOTADR|BANG|TRLBAR|ZEROR, ADDR_LINES), EX(CMD_topleft, "topleft", ex_wrongmodifier, NEEDARG|EXTRA|NOTRLCOM, ADDR_LINES), EX(CMD_tprevious, "tprevious", ex_tag, RANGE|NOTADR|BANG|TRLBAR|ZEROR, ADDR_LINES), EX(CMD_trewind, "trewind", ex_tag, RANGE|NOTADR|BANG|TRLBAR|ZEROR, ADDR_LINES), EX(CMD_try, "try", ex_try, TRLBAR|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_tselect, "tselect", ex_tag, BANG|TRLBAR|WORD1, ADDR_LINES), EX(CMD_tunmenu, "tunmenu", ex_menu, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_undo, "undo", ex_undo, RANGE|NOTADR|COUNT|ZEROR|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_undojoin, "undojoin", ex_undojoin, TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_undolist, "undolist", ex_undolist, TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_unabbreviate, "unabbreviate", ex_abbreviate, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_unhide, "unhide", ex_buffer_all, RANGE|NOTADR|COUNT|TRLBAR, ADDR_LINES), EX(CMD_unlet, "unlet", ex_unlet, BANG|EXTRA|NEEDARG|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_unlockvar, "unlockvar", ex_lockvar, BANG|EXTRA|NEEDARG|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_unmap, "unmap", ex_unmap, BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_unmenu, "unmenu", ex_menu, BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_unsilent, "unsilent", ex_wrongmodifier, NEEDARG|EXTRA|NOTRLCOM|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_update, "update", ex_update, RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR, ADDR_LINES), EX(CMD_vglobal, "vglobal", ex_global, RANGE|WHOLEFOLD|EXTRA|DFLALL|CMDWIN, ADDR_LINES), EX(CMD_version, "version", ex_version, EXTRA|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_verbose, "verbose", ex_wrongmodifier, NEEDARG|RANGE|NOTADR|EXTRA|NOTRLCOM|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_vertical, "vertical", ex_wrongmodifier, NEEDARG|EXTRA|NOTRLCOM, ADDR_LINES), EX(CMD_visual, "visual", ex_edit, BANG|FILE1|EDITCMD|ARGOPT|TRLBAR, ADDR_LINES), EX(CMD_view, "view", ex_edit, BANG|FILE1|EDITCMD|ARGOPT|TRLBAR, ADDR_LINES), EX(CMD_vimgrep, "vimgrep", ex_vimgrep, RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE, ADDR_LINES), EX(CMD_vimgrepadd, "vimgrepadd", ex_vimgrep, RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE, ADDR_LINES), EX(CMD_viusage, "viusage", ex_viusage, TRLBAR, ADDR_LINES), EX(CMD_vmap, "vmap", ex_map, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_vmapclear, "vmapclear", ex_mapclear, EXTRA|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_vmenu, "vmenu", ex_menu, RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_vnoremap, "vnoremap", ex_map, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_vnew, "vnew", ex_splitview, BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR, ADDR_LINES), EX(CMD_vnoremenu, "vnoremenu", ex_menu, RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_vsplit, "vsplit", ex_splitview, BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR, ADDR_LINES), EX(CMD_vunmap, "vunmap", ex_unmap, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_vunmenu, "vunmenu", ex_menu, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_write, "write", ex_write, RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_wNext, "wNext", ex_wnext, RANGE|WHOLEFOLD|NOTADR|BANG|FILE1|ARGOPT|TRLBAR, ADDR_LINES), EX(CMD_wall, "wall", do_wqall, BANG|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_while, "while", ex_while, EXTRA|NOTRLCOM|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_winsize, "winsize", ex_winsize, EXTRA|NEEDARG|TRLBAR, ADDR_LINES), EX(CMD_wincmd, "wincmd", ex_wincmd, NEEDARG|WORD1|RANGE|NOTADR, ADDR_WINDOWS), EX(CMD_windo, "windo", ex_listdo, BANG|NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL, ADDR_WINDOWS), EX(CMD_winpos, "winpos", ex_winpos, EXTRA|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_wnext, "wnext", ex_wnext, RANGE|NOTADR|BANG|FILE1|ARGOPT|TRLBAR, ADDR_LINES), EX(CMD_wprevious, "wprevious", ex_wnext, RANGE|NOTADR|BANG|FILE1|ARGOPT|TRLBAR, ADDR_LINES), EX(CMD_wq, "wq", ex_exit, RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR, ADDR_LINES), EX(CMD_wqall, "wqall", do_wqall, BANG|FILE1|ARGOPT|DFLALL|TRLBAR, ADDR_LINES), EX(CMD_wsverb, "wsverb", ex_wsverb, EXTRA|NOTADR|NEEDARG, ADDR_LINES), EX(CMD_wundo, "wundo", ex_wundo, BANG|NEEDARG|FILE1, ADDR_LINES), EX(CMD_wviminfo, "wviminfo", ex_viminfo, BANG|FILE1|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_xit, "xit", ex_exit, RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_xall, "xall", do_wqall, BANG|TRLBAR, ADDR_LINES), EX(CMD_xmap, "xmap", ex_map, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_xmapclear, "xmapclear", ex_mapclear, EXTRA|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_xmenu, "xmenu", ex_menu, RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_xnoremap, "xnoremap", ex_map, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_xnoremenu, "xnoremenu", ex_menu, RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_xunmap, "xunmap", ex_unmap, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_xunmenu, "xunmenu", ex_menu, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN, ADDR_LINES), EX(CMD_yank, "yank", ex_operators, RANGE|WHOLEFOLD|REGSTR|COUNT|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_z, "z", ex_z, RANGE|WHOLEFOLD|EXTRA|EXFLAGS|TRLBAR|CMDWIN, ADDR_LINES), /* commands that don't start with a lowercase letter */ EX(CMD_bang, "!", ex_bang, RANGE|WHOLEFOLD|BANG|FILES|CMDWIN, ADDR_LINES), EX(CMD_pound, "#", ex_print, RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_and, "&", do_sub, RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY, ADDR_LINES), EX(CMD_star, "*", ex_at, RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_lshift, "<", ex_operators, RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN|MODIFY, ADDR_LINES), EX(CMD_equal, "=", ex_equal, RANGE|TRLBAR|DFLALL|EXFLAGS|CMDWIN, ADDR_LINES), EX(CMD_rshift, ">", ex_operators, RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN|MODIFY, ADDR_LINES), EX(CMD_at, "@", ex_at, RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_Next, "Next", ex_previous, EXTRA|RANGE|NOTADR|COUNT|BANG|EDITCMD|ARGOPT|TRLBAR, ADDR_LINES), EX(CMD_Print, "Print", ex_print, RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN, ADDR_LINES), EX(CMD_X, "X", ex_X, TRLBAR, ADDR_LINES), EX(CMD_tilde, "~", do_sub, RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY, ADDR_LINES), #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 }; #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 */ int addr_type; /* type of the count/range */ int flags; /* extra flags after count: EXFLAG_ */ 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 read_edit; /* ++edit argument */ int force_ff; /* ++ff= argument (index in cmd[]) */ #ifdef FEAT_MBYTE int force_enc; /* ++enc= argument (index in cmd[]) */ int bad_char; /* BAD_KEEP, BAD_DROP or replacement byte */ #endif #ifdef FEAT_USR_CMDS int useridx; /* user command index */ #endif char_u *errmsg; /* returned error message */ char_u *(*getline)(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" */ /* Values for "flags" */ #define EXFLAG_LIST 0x01 /* 'l': list */ #define EXFLAG_NR 0x02 /* '#': number */ #define EXFLAG_PRINT 0x04 /* 'p': print */ #endif vim-7.4.1689/src/ex_cmds2.c000066400000000000000000003404051267703067000152420ustar00rootroot00000000000000/* 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 */ #include "vim.h" #include "version.h" static void cmd_source(char_u *fname, exarg_T *eap); #ifdef FEAT_EVAL /* Growarray to store info about already sourced scripts. * For Unix also store the dev/ino, so that we don't have to stat() each * script when going through the list. */ typedef struct scriptitem_S { char_u *sn_name; # ifdef UNIX int sn_dev_valid; dev_t sn_dev; ino_t sn_ino; # endif # ifdef FEAT_PROFILE int sn_prof_on; /* TRUE when script is/was profiled */ int sn_pr_force; /* forceit: profile functions in this script */ proftime_T sn_pr_child; /* time set when going into first child */ int sn_pr_nest; /* nesting for sn_pr_child */ /* profiling the script as a whole */ int sn_pr_count; /* nr of times sourced */ proftime_T sn_pr_total; /* time spent in script + children */ proftime_T sn_pr_self; /* time spent in script itself */ proftime_T sn_pr_start; /* time at script start */ proftime_T sn_pr_children; /* time in children after script start */ /* profiling the script per line */ garray_T sn_prl_ga; /* things stored for every line */ proftime_T sn_prl_start; /* start time for current line */ proftime_T sn_prl_children; /* time spent in children for this line */ proftime_T sn_prl_wait; /* wait start time for current line */ int sn_prl_idx; /* index of line being timed; -1 if none */ int sn_prl_execed; /* line being timed was executed */ # endif } scriptitem_T; static garray_T script_items = {0, 0, sizeof(scriptitem_T), 4, NULL}; #define SCRIPT_ITEM(id) (((scriptitem_T *)script_items.ga_data)[(id) - 1]) # ifdef FEAT_PROFILE /* Struct used in sn_prl_ga for every line of a script. */ typedef struct sn_prl_S { int snp_count; /* nr of times line was executed */ proftime_T sn_prl_total; /* time spent in a line + children */ proftime_T sn_prl_self; /* time spent in a line itself */ } sn_prl_T; # define PRL_ITEM(si, idx) (((sn_prl_T *)(si)->sn_prl_ga.ga_data)[(idx)]) # endif #endif #if defined(FEAT_EVAL) || defined(PROTO) static int debug_greedy = FALSE; /* batch mode debugging: don't save and restore typeahead. */ static int get_maxbacktrace_level(void); static void do_setdebugtracelevel(char_u *arg); static void do_checkbacktracelevel(void); static void do_showbacktrace(char_u *cmd); /* * do_debug(): Debug mode. * Repeatedly get Ex commands, until told to continue normal execution. */ void do_debug(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; int typeahead_saved = FALSE; int save_ignore_script = 0; int save_ex_normal_busy; 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 #define CMD_BACKTRACE 7 #define CMD_FRAME 8 #define CMD_UP 9 #define CMD_DOWN 10 #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; 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 smsg((char_u *)_("cmd: %s"), cmd); /* * Repeat getting a command and executing it. */ for (;;) { msg_scroll = TRUE; need_wait_return = FALSE; /* 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. Set ignore_script to avoid reading from script input. */ save_ex_normal_busy = ex_normal_busy; ex_normal_busy = 0; if (!debug_greedy) { save_typeahead(&typeaheadbuf); typeahead_saved = TRUE; save_ignore_script = ignore_script; ignore_script = TRUE; } cmdline = getcmdline_prompt('>', NULL, 0, EXPAND_NOTHING, NULL); if (typeahead_saved) { restore_typeahead(&typeaheadbuf); ignore_script = save_ignore_script; } ex_normal_busy = save_ex_normal_busy; cmdline_row = msg_row; msg_starthere(); 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 = 0; if (p[1] == 'r') { last_cmd = CMD_FRAME; tail = "rame"; } else { 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; case 'b': last_cmd = CMD_BACKTRACE; if (p[1] == 't') tail = "t"; else tail = "acktrace"; break; case 'w': last_cmd = CMD_BACKTRACE; tail = "here"; break; case 'u': last_cmd = CMD_UP; tail = "p"; break; case 'd': last_cmd = CMD_DOWN; tail = "own"; 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 != CMD_FRAME) 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; case CMD_BACKTRACE: do_showbacktrace(cmd); continue; case CMD_FRAME: if (*p == NUL) { do_showbacktrace(cmd); } else { p = skipwhite(p); do_setdebugtracelevel(p); } continue; case CMD_UP: debug_backtrace_level++; do_checkbacktracelevel(); continue; case CMD_DOWN: debug_backtrace_level--; do_checkbacktracelevel(); continue; } /* Going out reset backtrace_level */ debug_backtrace_level = 0; 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; } static int get_maxbacktrace_level(void) { char *p, *q; int maxbacktrace = 1; maxbacktrace = 0; if (sourcing_name != NULL) { p = (char *)sourcing_name; while ((q = strstr(p, "..")) != NULL) { p = q + 2; maxbacktrace++; } } return maxbacktrace; } static void do_setdebugtracelevel(char_u *arg) { int level; level = atoi((char *)arg); if (*arg == '+' || level < 0) debug_backtrace_level += level; else debug_backtrace_level = level; do_checkbacktracelevel(); } static void do_checkbacktracelevel(void) { if (debug_backtrace_level < 0) { debug_backtrace_level = 0; MSG(_("frame is zero")); } else { int max = get_maxbacktrace_level(); if (debug_backtrace_level > max) { debug_backtrace_level = max; smsg((char_u *)_("frame at highest level: %d"), max); } } } static void do_showbacktrace(char_u *cmd) { char *cur; char *next; int i = 0; int max = get_maxbacktrace_level(); if (sourcing_name != NULL) { cur = (char *)sourcing_name; while (!got_int) { next = strstr(cur, ".."); if (next != NULL) *next = NUL; if (i == max - debug_backtrace_level) smsg((char_u *)"->%d %s", max - i, cur); else smsg((char_u *)" %d %s", max - i, cur); ++i; if (next == NULL) break; *next = '.'; cur = next + 2; } } if (sourcing_lnum != 0) smsg((char_u *)_("line %ld: %s"), (long)sourcing_lnum, cmd); else smsg((char_u *)_("cmd: %s"), cmd); } /* * ":debug". */ void ex_debug(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(exarg_T *eap) { char_u *p; debug_skipped = FALSE; if (debug_breakpoint_name != NULL) { if (!eap->skip) { /* replace K_SNR with "" */ if (debug_breakpoint_name[0] == K_SPECIAL && debug_breakpoint_name[1] == KS_EXTRA && debug_breakpoint_name[2] == (int)KE_SNR) p = (char_u *)""; 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(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 */ int dbg_forceit; /* ! used */ }; static garray_T dbg_breakp = {0, 0, sizeof(struct debuggy), 4, NULL}; #define BREAKP(idx) (((struct debuggy *)dbg_breakp.ga_data)[idx]) #define DEBUGGY(gap, idx) (((struct debuggy *)gap->ga_data)[idx]) static int last_breakp = 0; /* nr of last defined breakpoint */ #ifdef FEAT_PROFILE /* Profiling uses file and func names similar to breakpoints. */ static garray_T prof_ga = {0, 0, sizeof(struct debuggy), 4, NULL}; #endif #define DBG_FUNC 1 #define DBG_FILE 2 static int dbg_parsearg(char_u *arg, garray_T *gap); static linenr_T debuggy_find(int file,char_u *fname, linenr_T after, garray_T *gap, int *fp); /* * Parse the arguments of ":profile", ":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( char_u *arg, garray_T *gap) /* either &dbg_breakp or &prof_ga */ { char_u *p = arg; char_u *q; struct debuggy *bp; int here = FALSE; if (ga_grow(gap, 1) == FAIL) return FAIL; bp = &DEBUGGY(gap, gap->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 if ( #ifdef FEAT_PROFILE gap != &prof_ga && #endif STRNCMP(p, "here", 4) == 0) { if (curbuf->b_ffname == NULL) { EMSG(_(e_noname)); return FAIL; } bp->dbg_type = DBG_FILE; here = TRUE; } else { EMSG2(_(e_invarg2), p); return FAIL; } p = skipwhite(p + 4); /* Find optional line number. */ if (here) bp->dbg_lnum = curwin->w_cursor.lnum; else if ( #ifdef FEAT_PROFILE gap != &prof_ga && #endif 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 ((!here && *p == NUL) || (here && *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 if (here) bp->dbg_name = vim_strsave(curbuf->b_ffname); 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". */ q = expand_env_save(p); if (q == NULL) return FAIL; p = expand_env_save(q); vim_free(q); if (p == NULL) return FAIL; if (*p != '*') { bp->dbg_name = fix_fname(p); vim_free(p); } else bp->dbg_name = p; } if (bp->dbg_name == NULL) return FAIL; return OK; } /* * ":breakadd". */ void ex_breakadd(exarg_T *eap) { struct debuggy *bp; char_u *pat; garray_T *gap; gap = &dbg_breakp; #ifdef FEAT_PROFILE if (eap->cmdidx == CMD_profile) gap = &prof_ga; #endif if (dbg_parsearg(eap->arg, gap) == OK) { bp = &DEBUGGY(gap, gap->ga_len); bp->dbg_forceit = eap->forceit; 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; #ifdef FEAT_PROFILE if (eap->cmdidx != CMD_profile) #endif { DEBUGGY(gap, gap->ga_len).dbg_nr = ++last_breakp; ++debug_tick; } ++gap->ga_len; } } } /* * ":debuggreedy". */ void ex_debuggreedy(exarg_T *eap) { if (eap->addr_count == 0 || eap->line2 != 0) debug_greedy = TRUE; else debug_greedy = FALSE; } /* * ":breakdel" and ":profdel". */ void ex_breakdel(exarg_T *eap) { struct debuggy *bp, *bpi; int nr; int todel = -1; int del_all = FALSE; int i; linenr_T best_lnum = 0; garray_T *gap; gap = &dbg_breakp; if (eap->cmdidx == CMD_profdel) { #ifdef FEAT_PROFILE gap = &prof_ga; #else ex_ni(eap); return; #endif } if (vim_isdigit(*eap->arg)) { /* ":breakdel {nr}" */ nr = atol((char *)eap->arg); for (i = 0; i < gap->ga_len; ++i) if (DEBUGGY(gap, i).dbg_nr == nr) { todel = i; break; } } else if (*eap->arg == '*') { todel = 0; del_all = TRUE; } else { /* ":breakdel {func|file} [lnum] {name}" */ if (dbg_parsearg(eap->arg, gap) == FAIL) return; bp = &DEBUGGY(gap, gap->ga_len); for (i = 0; i < gap->ga_len; ++i) { bpi = &DEBUGGY(gap, 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 { while (gap->ga_len > 0) { vim_free(DEBUGGY(gap, todel).dbg_name); vim_regfree(DEBUGGY(gap, todel).dbg_prog); --gap->ga_len; if (todel < gap->ga_len) mch_memmove(&DEBUGGY(gap, todel), &DEBUGGY(gap, todel + 1), (gap->ga_len - todel) * sizeof(struct debuggy)); #ifdef FEAT_PROFILE if (eap->cmdidx == CMD_breakdel) #endif ++debug_tick; if (!del_all) break; } /* If all breakpoints were removed clear the array. */ if (gap->ga_len == 0) ga_clear(gap); } } /* * ":breaklist". */ void ex_breaklist(exarg_T *eap UNUSED) { 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); if (bp->dbg_type == DBG_FILE) home_replace(NULL, bp->dbg_name, NameBuff, MAXPATHL, TRUE); smsg((char_u *)_("%3d %s %s line %ld"), bp->dbg_nr, bp->dbg_type == DBG_FUNC ? "func" : "file", bp->dbg_type == DBG_FUNC ? bp->dbg_name : NameBuff, (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( int file, /* TRUE for a file, FALSE for a function */ char_u *fname, /* file or function name */ linenr_T after) /* after this line number */ { return debuggy_find(file, fname, after, &dbg_breakp, NULL); } #if defined(FEAT_PROFILE) || defined(PROTO) /* * Return TRUE if profiling is on for a function or sourced file. */ int has_profiling( int file, /* TRUE for a file, FALSE for a function */ char_u *fname, /* file or function name */ int *fp) /* return: forceit */ { return (debuggy_find(file, fname, (linenr_T)0, &prof_ga, fp) != (linenr_T)0); } #endif /* * Common code for dbg_find_breakpoint() and has_profiling(). */ static linenr_T debuggy_find( int file, /* TRUE for a file, FALSE for a function */ char_u *fname, /* file or function name */ linenr_T after, /* after this line number */ garray_T *gap, /* either &dbg_breakp or &prof_ga */ int *fp) /* if not NULL: return forceit */ { struct debuggy *bp; int i; linenr_T lnum = 0; char_u *name = fname; int prev_got_int; /* Return quickly when there are no breakpoints. */ if (gap->ga_len == 0) return (linenr_T)0; /* Replace K_SNR in function name with "". */ if (!file && fname[0] == K_SPECIAL) { name = alloc((unsigned)STRLEN(fname) + 3); if (name == NULL) name = fname; else { STRCPY(name, ""); STRCPY(name + 5, fname + 3); } } for (i = 0; i < gap->ga_len; ++i) { /* Skip entries that are not useful or are for a line that is beyond * an already found breakpoint. */ bp = &DEBUGGY(gap, i); if (((bp->dbg_type == DBG_FILE) == file && ( #ifdef FEAT_PROFILE gap == &prof_ga || #endif (bp->dbg_lnum > after && (lnum == 0 || bp->dbg_lnum < lnum))))) { /* * 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_prog(&bp->dbg_prog, FALSE, name, (colnr_T)0)) { lnum = bp->dbg_lnum; if (fp != NULL) *fp = bp->dbg_forceit; } got_int |= prev_got_int; } } if (name != fname) vim_free(name); return lnum; } /* * Called when a breakpoint was encountered. */ void dbg_breakpoint(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; } # if defined(FEAT_PROFILE) || defined(FEAT_RELTIME) || defined(PROTO) /* * Store the current time in "tm". */ void profile_start(proftime_T *tm) { # ifdef WIN3264 QueryPerformanceCounter(tm); # else gettimeofday(tm, NULL); # endif } /* * Compute the elapsed time from "tm" till now and store in "tm". */ void profile_end(proftime_T *tm) { proftime_T now; # ifdef WIN3264 QueryPerformanceCounter(&now); tm->QuadPart = now.QuadPart - tm->QuadPart; # else gettimeofday(&now, NULL); tm->tv_usec = now.tv_usec - tm->tv_usec; tm->tv_sec = now.tv_sec - tm->tv_sec; if (tm->tv_usec < 0) { tm->tv_usec += 1000000; --tm->tv_sec; } # endif } /* * Subtract the time "tm2" from "tm". */ void profile_sub(proftime_T *tm, proftime_T *tm2) { # ifdef WIN3264 tm->QuadPart -= tm2->QuadPart; # else tm->tv_usec -= tm2->tv_usec; tm->tv_sec -= tm2->tv_sec; if (tm->tv_usec < 0) { tm->tv_usec += 1000000; --tm->tv_sec; } # endif } /* * Return a string that represents the time in "tm". * Uses a static buffer! */ char * profile_msg(proftime_T *tm) { static char buf[50]; # ifdef WIN3264 LARGE_INTEGER fr; QueryPerformanceFrequency(&fr); sprintf(buf, "%10.6lf", (double)tm->QuadPart / (double)fr.QuadPart); # else sprintf(buf, "%3ld.%06ld", (long)tm->tv_sec, (long)tm->tv_usec); # endif return buf; } # if defined(FEAT_FLOAT) || defined(PROTO) /* * Return a float that represents the time in "tm". */ float_T profile_float(proftime_T *tm) { # ifdef WIN3264 LARGE_INTEGER fr; QueryPerformanceFrequency(&fr); return (float_T)tm->QuadPart / (float_T)fr.QuadPart; # else return (float_T)tm->tv_sec + (float_T)tm->tv_usec / 1000000.0; # endif } # endif /* * Put the time "msec" past now in "tm". */ void profile_setlimit(long msec, proftime_T *tm) { if (msec <= 0) /* no limit */ profile_zero(tm); else { # ifdef WIN3264 LARGE_INTEGER fr; QueryPerformanceCounter(tm); QueryPerformanceFrequency(&fr); tm->QuadPart += (LONGLONG)((double)msec / 1000.0 * (double)fr.QuadPart); # else long usec; gettimeofday(tm, NULL); usec = (long)tm->tv_usec + (long)msec * 1000; tm->tv_usec = usec % 1000000L; tm->tv_sec += usec / 1000000L; # endif } } /* * Return TRUE if the current time is past "tm". */ int profile_passed_limit(proftime_T *tm) { proftime_T now; # ifdef WIN3264 if (tm->QuadPart == 0) /* timer was not set */ return FALSE; QueryPerformanceCounter(&now); return (now.QuadPart > tm->QuadPart); # else if (tm->tv_sec == 0) /* timer was not set */ return FALSE; gettimeofday(&now, NULL); return (now.tv_sec > tm->tv_sec || (now.tv_sec == tm->tv_sec && now.tv_usec > tm->tv_usec)); # endif } /* * Set the time in "tm" to zero. */ void profile_zero(proftime_T *tm) { # ifdef WIN3264 tm->QuadPart = 0; # else tm->tv_usec = 0; tm->tv_sec = 0; # endif } # endif /* FEAT_PROFILE || FEAT_RELTIME */ # if defined(FEAT_TIMERS) || defined(PROTO) static timer_T *first_timer = NULL; static int last_timer_id = 0; /* * Insert a timer in the list of timers. */ static void insert_timer(timer_T *timer) { timer->tr_next = first_timer; timer->tr_prev = NULL; if (first_timer != NULL) first_timer->tr_prev = timer; first_timer = timer; } /* * Take a timer out of the list of timers. */ static void remove_timer(timer_T *timer) { if (timer->tr_prev == NULL) first_timer = timer->tr_next; else timer->tr_prev->tr_next = timer->tr_next; if (timer->tr_next != NULL) timer->tr_next->tr_prev = timer->tr_prev; } static void free_timer(timer_T *timer) { vim_free(timer->tr_callback); partial_unref(timer->tr_partial); vim_free(timer); } /* * Create a timer and return it. NULL if out of memory. * Caller should set the callback. */ timer_T * create_timer(long msec, int repeat) { timer_T *timer = (timer_T *)alloc_clear(sizeof(timer_T)); if (timer == NULL) return NULL; timer->tr_id = ++last_timer_id; insert_timer(timer); if (repeat != 0) { timer->tr_repeat = repeat - 1; timer->tr_interval = msec; } profile_setlimit(msec, &timer->tr_due); return timer; } /* * Invoke the callback of "timer". */ static void timer_callback(timer_T *timer) { typval_T rettv; int dummy; typval_T argv[2]; argv[0].v_type = VAR_NUMBER; argv[0].vval.v_number = timer->tr_id; argv[1].v_type = VAR_UNKNOWN; call_func(timer->tr_callback, (int)STRLEN(timer->tr_callback), &rettv, 1, argv, 0L, 0L, &dummy, TRUE, timer->tr_partial, NULL); clear_tv(&rettv); } /* * Call timers that are due. * Return the time in msec until the next timer is due. */ long check_due_timer() { timer_T *timer; long this_due; long next_due = -1; proftime_T now; int did_one = FALSE; # ifdef WIN3264 LARGE_INTEGER fr; QueryPerformanceFrequency(&fr); # endif while (!got_int) { profile_start(&now); next_due = -1; for (timer = first_timer; timer != NULL; timer = timer->tr_next) { # ifdef WIN3264 this_due = (long)(((double)(timer->tr_due.QuadPart - now.QuadPart) / (double)fr.QuadPart) * 1000); # else this_due = (timer->tr_due.tv_sec - now.tv_sec) * 1000 + (timer->tr_due.tv_usec - now.tv_usec) / 1000; # endif if (this_due <= 1) { remove_timer(timer); timer_callback(timer); did_one = TRUE; if (timer->tr_repeat != 0) { profile_setlimit(timer->tr_interval, &timer->tr_due); if (timer->tr_repeat > 0) --timer->tr_repeat; insert_timer(timer); } else free_timer(timer); /* the callback may do anything, start all over */ break; } if (next_due == -1 || next_due > this_due) next_due = this_due; } if (timer == NULL) break; } if (did_one) redraw_after_callback(); return next_due; } /* * Find a timer by ID. Returns NULL if not found; */ timer_T * find_timer(int id) { timer_T *timer; for (timer = first_timer; timer != NULL; timer = timer->tr_next) if (timer->tr_id == id) break; return timer; } /* * Stop a timer and delete it. */ void stop_timer(timer_T *timer) { remove_timer(timer); free_timer(timer); } # endif #if defined(FEAT_SYN_HL) && defined(FEAT_RELTIME) && defined(FEAT_FLOAT) # if defined(HAVE_MATH_H) # include # endif /* * Divide the time "tm" by "count" and store in "tm2". */ void profile_divide(proftime_T *tm, int count, proftime_T *tm2) { if (count == 0) profile_zero(tm2); else { # ifdef WIN3264 tm2->QuadPart = tm->QuadPart / count; # else double usec = (tm->tv_sec * 1000000.0 + tm->tv_usec) / count; tm2->tv_sec = floor(usec / 1000000.0); tm2->tv_usec = vim_round(usec - (tm2->tv_sec * 1000000.0)); # endif } } #endif # if defined(FEAT_PROFILE) || defined(PROTO) /* * Functions for profiling. */ static void script_do_profile(scriptitem_T *si); static void script_dump_profile(FILE *fd); static proftime_T prof_wait_time; /* * Add the time "tm2" to "tm". */ void profile_add(proftime_T *tm, proftime_T *tm2) { # ifdef WIN3264 tm->QuadPart += tm2->QuadPart; # else tm->tv_usec += tm2->tv_usec; tm->tv_sec += tm2->tv_sec; if (tm->tv_usec >= 1000000) { tm->tv_usec -= 1000000; ++tm->tv_sec; } # endif } /* * Add the "self" time from the total time and the children's time. */ void profile_self(proftime_T *self, proftime_T *total, proftime_T *children) { /* Check that the result won't be negative. Can happen with recursive * calls. */ #ifdef WIN3264 if (total->QuadPart <= children->QuadPart) return; #else if (total->tv_sec < children->tv_sec || (total->tv_sec == children->tv_sec && total->tv_usec <= children->tv_usec)) return; #endif profile_add(self, total); profile_sub(self, children); } /* * Get the current waittime. */ void profile_get_wait(proftime_T *tm) { *tm = prof_wait_time; } /* * Subtract the passed waittime since "tm" from "tma". */ void profile_sub_wait(proftime_T *tm, proftime_T *tma) { proftime_T tm3 = prof_wait_time; profile_sub(&tm3, tm); profile_sub(tma, &tm3); } /* * Return TRUE if "tm1" and "tm2" are equal. */ int profile_equal(proftime_T *tm1, proftime_T *tm2) { # ifdef WIN3264 return (tm1->QuadPart == tm2->QuadPart); # else return (tm1->tv_usec == tm2->tv_usec && tm1->tv_sec == tm2->tv_sec); # endif } /* * Return <0, 0 or >0 if "tm1" < "tm2", "tm1" == "tm2" or "tm1" > "tm2" */ int profile_cmp(const proftime_T *tm1, const proftime_T *tm2) { # ifdef WIN3264 return (int)(tm2->QuadPart - tm1->QuadPart); # else if (tm1->tv_sec == tm2->tv_sec) return tm2->tv_usec - tm1->tv_usec; return tm2->tv_sec - tm1->tv_sec; # endif } static char_u *profile_fname = NULL; static proftime_T pause_time; /* * ":profile cmd args" */ void ex_profile(exarg_T *eap) { char_u *e; int len; e = skiptowhite(eap->arg); len = (int)(e - eap->arg); e = skipwhite(e); if (len == 5 && STRNCMP(eap->arg, "start", 5) == 0 && *e != NUL) { vim_free(profile_fname); profile_fname = expand_env_save_opt(e, TRUE); do_profiling = PROF_YES; profile_zero(&prof_wait_time); set_vim_var_nr(VV_PROFILING, 1L); } else if (do_profiling == PROF_NONE) EMSG(_("E750: First use \":profile start {fname}\"")); else if (STRCMP(eap->arg, "pause") == 0) { if (do_profiling == PROF_YES) profile_start(&pause_time); do_profiling = PROF_PAUSED; } else if (STRCMP(eap->arg, "continue") == 0) { if (do_profiling == PROF_PAUSED) { profile_end(&pause_time); profile_add(&prof_wait_time, &pause_time); } do_profiling = PROF_YES; } else { /* The rest is similar to ":breakadd". */ ex_breakadd(eap); } } /* Command line expansion for :profile. */ static enum { PEXP_SUBCMD, /* expand :profile sub-commands */ PEXP_FUNC /* expand :profile func {funcname} */ } pexpand_what; static char *pexpand_cmds[] = { "start", #define PROFCMD_START 0 "pause", #define PROFCMD_PAUSE 1 "continue", #define PROFCMD_CONTINUE 2 "func", #define PROFCMD_FUNC 3 "file", #define PROFCMD_FILE 4 NULL #define PROFCMD_LAST 5 }; /* * Function given to ExpandGeneric() to obtain the profile command * specific expansion. */ char_u * get_profile_name(expand_T *xp UNUSED, int idx) { switch (pexpand_what) { case PEXP_SUBCMD: return (char_u *)pexpand_cmds[idx]; /* case PEXP_FUNC: TODO */ default: return NULL; } } /* * Handle command line completion for :profile command. */ void set_context_in_profile_cmd(expand_T *xp, char_u *arg) { char_u *end_subcmd; /* Default: expand subcommands. */ xp->xp_context = EXPAND_PROFILE; pexpand_what = PEXP_SUBCMD; xp->xp_pattern = arg; end_subcmd = skiptowhite(arg); if (*end_subcmd == NUL) return; if (end_subcmd - arg == 5 && STRNCMP(arg, "start", 5) == 0) { xp->xp_context = EXPAND_FILES; xp->xp_pattern = skipwhite(end_subcmd); return; } /* TODO: expand function names after "func" */ xp->xp_context = EXPAND_NOTHING; } /* * Dump the profiling info. */ void profile_dump(void) { FILE *fd; if (profile_fname != NULL) { fd = mch_fopen((char *)profile_fname, "w"); if (fd == NULL) EMSG2(_(e_notopen), profile_fname); else { script_dump_profile(fd); func_dump_profile(fd); fclose(fd); } } } /* * Start profiling script "fp". */ static void script_do_profile(scriptitem_T *si) { si->sn_pr_count = 0; profile_zero(&si->sn_pr_total); profile_zero(&si->sn_pr_self); ga_init2(&si->sn_prl_ga, sizeof(sn_prl_T), 100); si->sn_prl_idx = -1; si->sn_prof_on = TRUE; si->sn_pr_nest = 0; } /* * save time when starting to invoke another script or function. */ void script_prof_save( proftime_T *tm) /* place to store wait time */ { scriptitem_T *si; if (current_SID > 0 && current_SID <= script_items.ga_len) { si = &SCRIPT_ITEM(current_SID); if (si->sn_prof_on && si->sn_pr_nest++ == 0) profile_start(&si->sn_pr_child); } profile_get_wait(tm); } /* * Count time spent in children after invoking another script or function. */ void script_prof_restore(proftime_T *tm) { scriptitem_T *si; if (current_SID > 0 && current_SID <= script_items.ga_len) { si = &SCRIPT_ITEM(current_SID); if (si->sn_prof_on && --si->sn_pr_nest == 0) { profile_end(&si->sn_pr_child); profile_sub_wait(tm, &si->sn_pr_child); /* don't count wait time */ profile_add(&si->sn_pr_children, &si->sn_pr_child); profile_add(&si->sn_prl_children, &si->sn_pr_child); } } } static proftime_T inchar_time; /* * Called when starting to wait for the user to type a character. */ void prof_inchar_enter(void) { profile_start(&inchar_time); } /* * Called when finished waiting for the user to type a character. */ void prof_inchar_exit(void) { profile_end(&inchar_time); profile_add(&prof_wait_time, &inchar_time); } /* * Dump the profiling results for all scripts in file "fd". */ static void script_dump_profile(FILE *fd) { int id; scriptitem_T *si; int i; FILE *sfd; sn_prl_T *pp; for (id = 1; id <= script_items.ga_len; ++id) { si = &SCRIPT_ITEM(id); if (si->sn_prof_on) { fprintf(fd, "SCRIPT %s\n", si->sn_name); if (si->sn_pr_count == 1) fprintf(fd, "Sourced 1 time\n"); else fprintf(fd, "Sourced %d times\n", si->sn_pr_count); fprintf(fd, "Total time: %s\n", profile_msg(&si->sn_pr_total)); fprintf(fd, " Self time: %s\n", profile_msg(&si->sn_pr_self)); fprintf(fd, "\n"); fprintf(fd, "count total (s) self (s)\n"); sfd = mch_fopen((char *)si->sn_name, "r"); if (sfd == NULL) fprintf(fd, "Cannot open file!\n"); else { for (i = 0; i < si->sn_prl_ga.ga_len; ++i) { if (vim_fgets(IObuff, IOSIZE, sfd)) break; pp = &PRL_ITEM(si, i); if (pp->snp_count > 0) { fprintf(fd, "%5d ", pp->snp_count); if (profile_equal(&pp->sn_prl_total, &pp->sn_prl_self)) fprintf(fd, " "); else fprintf(fd, "%s ", profile_msg(&pp->sn_prl_total)); fprintf(fd, "%s ", profile_msg(&pp->sn_prl_self)); } else fprintf(fd, " "); fprintf(fd, "%s", IObuff); } fclose(sfd); } fprintf(fd, "\n"); } } } /* * Return TRUE when a function defined in the current script should be * profiled. */ int prof_def_func(void) { if (current_SID > 0) return SCRIPT_ITEM(current_SID).sn_pr_force; return FALSE; } # endif #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_T *buf, int forceit) { int r; 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; r = buf_write_all(buf, forceit); /* Writing may succeed but the buffer still changed, e.g., when there is a * conversion error. We do want to return FAIL then. */ if (buf_valid(buf) && bufIsChanged(buf)) r = FAIL; return r; } /* * flush all buffers, except the ones that are readonly */ void autowrite_all(void) { 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. * For flags use the CCGD_ values. */ int check_changed(buf_T *buf, int flags) { int forceit = (flags & CCGD_FORCEIT); if ( !forceit && bufIsChanged(buf) && ((flags & CCGD_MULTWIN) || buf->b_nwindows <= 1) && (!(flags & CCGD_AW) || 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 (flags & CCGD_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 if (flags & CCGD_EXCMD) EMSG(_(e_nowrtmsg)); else EMSG(_(e_nowrtmsg_nobang)); 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_T *buf) { if (buf->b_fname == NULL) { char_u *fname; fname = do_browse(BROWSE_SAVE, (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 abandoning a changed buffer. * Must check 'write' option first! */ void dialog_changed( buf_T *buf, int checkall) /* may abandon all changed buffers */ { char_u buff[DIALOG_MSG_SIZE]; int ret; buf_T *buf2; exarg_T ea; 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); /* Init ea pseudo-structure, this is needed for the check_overwrite() * function. */ ea.append = ea.forceit = FALSE; 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 && check_overwrite(&ea, buf, buf->b_fname, buf->b_ffname, FALSE) == OK) /* 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 && check_overwrite(&ea, buf2, buf2->b_fname, buf2->b_ffname, FALSE) == OK) /* 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_T *buf, int forceit) { return ( P_HID(buf) || !bufIsChanged(buf) || buf->b_nwindows > 1 || autowrite(buf, forceit) == OK || forceit); } static void add_bufnum(int *bufnrs, int *bufnump, int nr); /* * Add a buffer number to "bufnrs", unless it's already there. */ static void add_bufnum(int *bufnrs, int *bufnump, int nr) { int i; for (i = 0; i < *bufnump; ++i) if (bufnrs[i] == nr) return; bufnrs[*bufnump] = nr; *bufnump = *bufnump + 1; } /* * Return TRUE if any buffer was changed and cannot be abandoned. * That changed buffer becomes the current buffer. * When "unload" is true the current buffer is unloaded instead of making it * hidden. This is used for ":q!". */ int check_changed_any( int hidden, /* Only check hidden buffers */ int unload) { int ret = FALSE; buf_T *buf; int save; int i; int bufnum = 0; int bufcount = 0; int *bufnrs; #ifdef FEAT_WINDOWS tabpage_T *tp; win_T *wp; #endif for (buf = firstbuf; buf != NULL; buf = buf->b_next) ++bufcount; if (bufcount == 0) return FALSE; bufnrs = (int *)alloc(sizeof(int) * bufcount); if (bufnrs == NULL) return FALSE; /* curbuf */ bufnrs[bufnum++] = curbuf->b_fnum; #ifdef FEAT_WINDOWS /* buf in curtab */ FOR_ALL_WINDOWS(wp) if (wp->w_buffer != curbuf) add_bufnum(bufnrs, &bufnum, wp->w_buffer->b_fnum); /* buf in other tab */ for (tp = first_tabpage; tp != NULL; tp = tp->tp_next) if (tp != curtab) for (wp = tp->tp_firstwin; wp != NULL; wp = wp->w_next) add_bufnum(bufnrs, &bufnum, wp->w_buffer->b_fnum); #endif /* any other buf */ for (buf = firstbuf; buf != NULL; buf = buf->b_next) add_bufnum(bufnrs, &bufnum, buf->b_fnum); for (i = 0; i < bufnum; ++i) { buf = buflist_findnr(bufnrs[i]); if (buf == NULL) continue; if ((!hidden || buf->b_nwindows == 0) && bufIsChanged(buf)) { /* Try auto-writing the buffer. If this fails but the buffer no * longer exists it's not changed, that's OK. */ if (check_changed(buf, (p_awa ? CCGD_AW : 0) | CCGD_MULTWIN | CCGD_ALLBUF) && buf_valid(buf)) break; /* didn't save - still changes */ } } if (i >= bufnum) goto theend; ret = TRUE; 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 > 0) { 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 ? 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_ALL_TAB_WINDOWS(tp, wp) if (wp->w_buffer == buf) { goto_tabpage_win(tp, wp); # ifdef FEAT_AUTOCMD /* Paranoia: did autocms wipe out the buffer with changes? */ if (!buf_valid(buf)) { goto theend; } # endif goto buf_found; } buf_found: #endif /* Open the changed buffer in the current window. */ if (buf != curbuf) set_curbuf(buf, unload ? DOBUF_UNLOAD : DOBUF_GOTO); theend: vim_free(bufnrs); return ret; } /* * return FAIL if there is no file name, OK if there is one * give error message for FAIL */ int check_fname(void) { 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_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_source(hl_attr(HLF_W)); MSG(_("Warning: Entered other buffer unexpectedly (check autocommands)")); } #endif return retval; } /* * Code to handle the argument list. */ static char_u *do_one_arg(char_u *str); static int do_arglist(char_u *str, int what, int after); static void alist_check_arg_idx(void); static int editing_arg_idx(win_T *win); #ifdef FEAT_LISTCMDS static int alist_add_list(int count, char_u **files, int after); #endif #define AL_SET 1 #define AL_ADD 2 #define AL_DEL 3 /* * Isolate one argument, taking backticks. * Changes the argument in-place, puts a NUL after it. Backticks remain. * Return a pointer to the start of the next argument. */ static char_u * do_one_arg(char_u *str) { char_u *p; int inbacktick; inbacktick = FALSE; for (p = str; *str; ++str) { /* When the backslash is used for escaping the special meaning of a * character we need to keep it until wildcard expansion. */ if (rem_backslash(str)) { *p++ = *str++; *p++ = *str; } else { /* An item ends at a space not in backticks */ if (!inbacktick && vim_isspace(*str)) break; if (*str == '`') inbacktick ^= TRUE; *p++ = *str; } } str = skipwhite(str); *p = NUL; return str; } /* * Separate the arguments in "str" and return a list of pointers in the * growarray "gap". */ int get_arglist(garray_T *gap, char_u *str) { ga_init2(gap, (int)sizeof(char_u *), 20); while (*str != NUL) { if (ga_grow(gap, 1) == FAIL) { ga_clear(gap); return FAIL; } ((char_u **)gap->ga_data)[gap->ga_len++] = str; /* Isolate one argument, change it in-place, put a NUL after it. */ str = do_one_arg(str); } return OK; } #if defined(FEAT_QUICKFIX) || defined(FEAT_SYN_HL) || defined(PROTO) /* * Parse a list of arguments (file names), expand them and return in * "fnames[fcountp]". When "wig" is TRUE, removes files matching 'wildignore'. * Return FAIL or OK. */ int get_arglist_exp( char_u *str, int *fcountp, char_u ***fnamesp, int wig) { garray_T ga; int i; if (get_arglist(&ga, str) == FAIL) return FAIL; if (wig == TRUE) i = expand_wildcards(ga.ga_len, (char_u **)ga.ga_data, fcountp, fnamesp, EW_FILE|EW_NOTFOUND); else i = gen_expand_wildcards(ga.ga_len, (char_u **)ga.ga_data, fcountp, fnamesp, EW_FILE|EW_NOTFOUND); ga_clear(&ga); return i; } #endif #if defined(FEAT_GUI) || defined(FEAT_CLIENTSERVER) || defined(PROTO) /* * Redefine the argument list. */ void set_arglist(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. */ static int do_arglist( char_u *str, int what, int after UNUSED) /* 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 /* * Set default argument for ":argadd" command. */ if (what == AL_ADD && *str == NUL) { if (curbuf->b_ffname == NULL) return FAIL; str = curbuf->b_fname; } /* * Collect all file name arguments in "new_ga". */ if (get_arglist(&new_ga, str) == FAIL) return FAIL; #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. */ regmatch.rm_ic = p_fic; /* ignore case when 'fileignorecase' is set */ 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(®match, 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; if (curwin->w_arg_idx > match) --curwin->w_arg_idx; --match; } vim_regfree(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 || 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, NULL, 0); } alist_check_arg_idx(); return OK; } /* * Check the validity of the arg_idx for each other window. */ static void alist_check_arg_idx(void) { #ifdef FEAT_WINDOWS win_T *win; tabpage_T *tp; FOR_ALL_TAB_WINDOWS(tp, win) if (win->w_alist == curwin->w_alist) check_arg_idx(win); #else check_arg_idx(curwin); #endif } /* * Return TRUE if window "win" is editing the file at the current argument * index. */ static int editing_arg_idx(win_T *win) { return !(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)))); } /* * Check if window "win" is editing the w_arg_idx file in its argument list. */ void check_arg_idx(win_T *win) { if (WARGCOUNT(win) > 1 && !editing_arg_idx(win)) { /* 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(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; } } #endif } /* * ":previous", ":sprevious", ":Next" and ":sNext". */ void ex_previous(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(exarg_T *eap) { do_argfile(eap, 0); } /* * ":last" and ":slast". */ void ex_last(exarg_T *eap) { do_argfile(eap, ARGCOUNT - 1); } /* * ":argument" and ":sargument". */ void ex_argument(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(exarg_T *eap, int argn) { int other; char_u *p; int old_arg_idx = curwin->w_arg_idx; 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 /* split window or create new tab page first */ if (*eap->cmd == 's' || cmdmod.tab != 0) { if (win_split(0, 0) == FAIL) return; RESET_BINDING(curwin); } 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, CCGD_AW | (other ? 0 : CCGD_MULTWIN) | (eap->forceit ? CCGD_FORCEIT : 0) | CCGD_EXCMD)) 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. * When it fails (e.g. Abort for already edited file) restore the * argument index. */ if (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), curwin) == FAIL) curwin->w_arg_idx = old_arg_idx; /* like Vi: set the mark where the cursor is in the file. */ else if (eap->cmdidx != CMD_argdo) setmark('\''); } } /* * ":next", and commands that behave like it. */ void ex_next(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, CCGD_AW | (eap->forceit ? CCGD_FORCEIT : 0) | CCGD_EXCMD)) { 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); } } #if defined(FEAT_LISTCMDS) || defined(PROTO) /* * ":argedit" */ void ex_argedit(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(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(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; 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; if (ARGCOUNT == 0) curwin->w_arg_idx = 0; else if (curwin->w_arg_idx >= ARGCOUNT) curwin->w_arg_idx = ARGCOUNT - 1; } } else if (*eap->arg == NUL) EMSG(_(e_argreq)); else do_arglist(eap->arg, AL_DEL, 0); #ifdef FEAT_TITLE maketitle(); #endif } /* * ":argdo", ":windo", ":bufdo", ":tabdo", ":cdo", ":ldo", ":cfdo" and ":lfdo" */ void ex_listdo(exarg_T *eap) { int i; #ifdef FEAT_WINDOWS win_T *wp; tabpage_T *tp; #endif buf_T *buf = curbuf; int next_fnum = 0; #if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL) char_u *save_ei = NULL; #endif char_u *p_shm_save; #ifdef FEAT_QUICKFIX int qf_size = 0; int qf_idx; #endif #ifndef FEAT_WINDOWS if (eap->cmdidx == CMD_windo) { ex_ni(eap); return; } #endif #ifndef FEAT_QUICKFIX if (eap->cmdidx == CMD_cdo || eap->cmdidx == CMD_ldo || eap->cmdidx == CMD_cfdo || eap->cmdidx == CMD_lfdo) { ex_ni(eap); return; } #endif #if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL) if (eap->cmdidx != CMD_windo && eap->cmdidx != CMD_tabdo) /* Don't do syntax HL autocommands. Skipping the syntax file is a * great speed improvement. */ save_ei = au_event_disable(",Syntax"); #endif #ifdef FEAT_CLIPBOARD start_global_changes(); #endif if (eap->cmdidx == CMD_windo || eap->cmdidx == CMD_tabdo || P_HID(curbuf) || !check_changed(curbuf, CCGD_AW | (eap->forceit ? CCGD_FORCEIT : 0) | CCGD_EXCMD)) { i = 0; /* start at the eap->line1 argument/window/buffer */ #ifdef FEAT_WINDOWS wp = firstwin; tp = first_tabpage; #endif switch (eap->cmdidx) { #ifdef FEAT_WINDOWS case CMD_windo: for ( ; wp != NULL && i + 1 < eap->line1; wp = wp->w_next) i++; break; case CMD_tabdo: for( ; tp != NULL && i + 1 < eap->line1; tp = tp->tp_next) i++; break; #endif case CMD_argdo: i = eap->line1 - 1; break; default: break; } /* set pcmark now */ if (eap->cmdidx == CMD_bufdo) { /* Advance to the first listed buffer after "eap->line1". */ for (buf = firstbuf; buf != NULL && (buf->b_fnum < eap->line1 || !buf->b_p_bl); buf = buf->b_next) if (buf->b_fnum > eap->line2) { buf = NULL; break; } if (buf != NULL) goto_buffer(eap, DOBUF_FIRST, FORWARD, buf->b_fnum); } #ifdef FEAT_QUICKFIX else if (eap->cmdidx == CMD_cdo || eap->cmdidx == CMD_ldo || eap->cmdidx == CMD_cfdo || eap->cmdidx == CMD_lfdo) { qf_size = qf_get_size(eap); if (qf_size <= 0 || eap->line1 > qf_size) buf = NULL; else { ex_cc(eap); buf = curbuf; i = eap->line1 - 1; if (eap->addr_count <= 0) /* default is all the quickfix/location list entries */ eap->line2 = qf_size; } } #endif else setpcmark(); listcmd_busy = TRUE; /* avoids setting pcmark below */ while (!got_int && buf != NULL) { 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 || !editing_arg_idx(curwin)) { /* Clear 'shm' to avoid that the file message overwrites * any output from the command. */ p_shm_save = vim_strsave(p_shm); set_option_value((char_u *)"shm", 0L, (char_u *)"", 0); do_argfile(eap, i); set_option_value((char_u *)"shm", 0L, p_shm_save, 0); vim_free(p_shm_save); } if (curwin->w_arg_idx != i) break; } #ifdef FEAT_WINDOWS else if (eap->cmdidx == CMD_windo) { /* go to window "wp" */ if (!win_valid(wp)) break; win_goto(wp); if (curwin != wp) break; /* something must be wrong */ wp = curwin->w_next; } else if (eap->cmdidx == CMD_tabdo) { /* go to window "tp" */ if (!valid_tabpage(tp)) break; goto_tabpage_tp(tp, TRUE, TRUE); tp = tp->tp_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; } } ++i; /* 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 || next_fnum > eap->line2) 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; /* Go to the next buffer. Clear 'shm' to avoid that the file * message overwrites any output from the command. */ p_shm_save = vim_strsave(p_shm); set_option_value((char_u *)"shm", 0L, (char_u *)"", 0); goto_buffer(eap, DOBUF_FIRST, FORWARD, next_fnum); set_option_value((char_u *)"shm", 0L, p_shm_save, 0); vim_free(p_shm_save); /* If autocommands took us elsewhere, quit here. */ if (curbuf->b_fnum != next_fnum) break; } #ifdef FEAT_QUICKFIX if (eap->cmdidx == CMD_cdo || eap->cmdidx == CMD_ldo || eap->cmdidx == CMD_cfdo || eap->cmdidx == CMD_lfdo) { if (i >= qf_size || i >= eap->line2) break; qf_idx = qf_get_cur_idx(eap); ex_cnext(eap); /* If jumping to the next quickfix entry fails, quit here */ if (qf_get_cur_idx(eap) == qf_idx) break; } #endif 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 } #ifdef FEAT_WINDOWS if (eap->cmdidx == CMD_windo || eap->cmdidx == CMD_tabdo) if (i+1 > eap->line2) break; #endif if (eap->cmdidx == CMD_argdo && i >= eap->line2) break; } listcmd_busy = FALSE; } #if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL) if (save_ei != NULL) { au_event_restore(save_ei); apply_autocmds(EVENT_SYNTAX, curbuf->b_p_syn, curbuf->b_fname, TRUE, curbuf); } #endif #ifdef FEAT_CLIPBOARD end_global_changes(); #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( int count, char_u **files, int after) /* where to add: 0 = before first one */ { int i; int old_argcount = ARGCOUNT; 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; if (old_argcount > 0 && curwin->w_arg_idx >= after) curwin->w_arg_idx += count; 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(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 "); } 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". * Explicitly prepend "g:" to make it work in a function. */ old_cur_comp = get_var_value((char_u *)"g:current_compiler"); if (old_cur_comp != NULL) old_cur_comp = vim_strsave(old_cur_comp); do_cmdline_cmd((char_u *) "command -nargs=* CompilerSet setlocal "); } do_unlet((char_u *)"g:current_compiler", TRUE); do_unlet((char_u *)"b:current_compiler", TRUE); sprintf((char *)buf, "compiler/%s.vim", eap->arg); if (source_runtime(buf, DIP_ALL) == 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 *)"g: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 *)"g:current_compiler", old_cur_comp); vim_free(old_cur_comp); } else do_unlet((char_u *)"g:current_compiler", TRUE); } } } } #endif /* * ":runtime [what] {name}" */ void ex_runtime(exarg_T *eap) { char_u *arg = eap->arg; char_u *p = skiptowhite(arg); int len = (int)(p - arg); int flags = eap->forceit ? DIP_ALL : 0; if (STRNCMP(arg, "START", len) == 0) { flags += DIP_START + DIP_NORTP; arg = skipwhite(arg + len); } else if (STRNCMP(arg, "OPT", len) == 0) { flags += DIP_OPT + DIP_NORTP; arg = skipwhite(arg + len); } else if (STRNCMP(arg, "PACK", len) == 0) { flags += DIP_START + DIP_OPT + DIP_NORTP; arg = skipwhite(arg + len); } else if (STRNCMP(arg, "ALL", len) == 0) { flags += DIP_START + DIP_OPT; arg = skipwhite(arg + len); } source_runtime(arg, flags); } static void source_callback(char_u *fname, void *cookie UNUSED) { (void)do_source(fname, FALSE, DOSO_NONE); } /* * Source the file "name" from all directories in 'runtimepath'. * "name" can contain wildcards. * When "flags" has DIP_ALL: source all files, otherwise only the first one. * * return FAIL when no file could be sourced, OK otherwise. */ int source_runtime(char_u *name, int flags) { return do_in_runtimepath(name, flags, source_callback, NULL); } /* * Find the file "name" in all directories in "path" and invoke * "callback(fname, cookie)". * "name" can contain wildcards. * When "flags" has DIP_ALL: source all files, otherwise only the first one. * When "flags" has DIP_DIR: find directories instead of files. * When "flags" has DIP_ERR: give an error message if there is no match. * * return FAIL when no file could be sourced, OK otherwise. */ int do_in_path( char_u *path, char_u *name, int flags, void (*callback)(char_u *fname, void *ck), void *cookie) { 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(path); buf = alloc(MAXPATHL); if (buf != NULL && rtp_copy != NULL) { if (p_verbose > 1 && name != NULL) { verbose_enter(); smsg((char_u *)_("Searching for \"%s\" in \"%s\""), (char *)name, (char *)path); verbose_leave(); } /* Loop over all entries in 'runtimepath'. */ rtp = rtp_copy; while (*rtp != NUL && ((flags & DIP_ALL) || !did_one)) { /* Copy the path from 'runtimepath' to buf[]. */ copy_option_part(&rtp, buf, MAXPATHL, ","); if (name == NULL) { (*callback)(buf, (void *) &cookie); if (!did_one) did_one = (cookie == NULL); } else 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 && ((flags & DIP_ALL) || !did_one)) { /* Append the pattern from "name" to buf[]. */ copy_option_part(&np, tail, (int)(MAXPATHL - (tail - buf)), "\t "); if (p_verbose > 2) { verbose_enter(); smsg((char_u *)_("Searching for \"%s\""), buf); verbose_leave(); } /* Expand wildcards, invoke the callback for each match. */ if (gen_expand_wildcards(1, &buf, &num_files, &files, (flags & DIP_DIR) ? EW_DIR : EW_FILE) == OK) { for (i = 0; i < num_files; ++i) { (*callback)(files[i], cookie); did_one = TRUE; if (!(flags & DIP_ALL)) break; } FreeWild(num_files, files); } } } } } vim_free(buf); vim_free(rtp_copy); if (!did_one && name != NULL) { char *basepath = path == p_rtp ? "runtimepath" : "packpath"; if (flags & DIP_ERR) EMSG3(_(e_dirnotf), basepath, name); else if (p_verbose > 0) { verbose_enter(); smsg((char_u *)_("not found in '%s': \"%s\""), basepath, name); verbose_leave(); } } #ifdef AMIGA proc->pr_WindowPtr = save_winptr; #endif return did_one ? OK : FAIL; } /* * Find "name" in 'runtimepath'. When found, invoke the callback function for * it: callback(fname, "cookie") * When "flags" has DIP_ALL repeat for all matches, otherwise only the first * one is used. * Returns OK when at least one match found, FAIL otherwise. * * If "name" is NULL calls callback for each entry in runtimepath. Cookie is * passed by reference in this case, setting it to NULL indicates that callback * has done its job. */ int do_in_runtimepath( char_u *name, int flags, void (*callback)(char_u *fname, void *ck), void *cookie) { int done = FAIL; char_u *s; int len; char *start_dir = "pack/*/start/*/%s"; char *opt_dir = "pack/*/opt/*/%s"; if ((flags & DIP_NORTP) == 0) done = do_in_path(p_rtp, name, flags, callback, cookie); if ((done == FAIL || (flags & DIP_ALL)) && (flags & DIP_START)) { len = (int)(STRLEN(start_dir) + STRLEN(name)); s = alloc(len); if (s == NULL) return FAIL; vim_snprintf((char *)s, len, start_dir, name); done = do_in_path(p_pp, s, flags, callback, cookie); vim_free(s); } if ((done == FAIL || (flags & DIP_ALL)) && (flags & DIP_OPT)) { len = (int)(STRLEN(opt_dir) + STRLEN(name)); s = alloc(len); if (s == NULL) return FAIL; vim_snprintf((char *)s, len, opt_dir, name); done = do_in_path(p_pp, s, flags, callback, cookie); vim_free(s); } return done; } /* * Expand wildcards in "pat" and invoke do_source() for each match. */ static void source_all_matches(char_u *pat) { int num_files; char_u **files; int i; if (gen_expand_wildcards(1, &pat, &num_files, &files, EW_FILE) == OK) { for (i = 0; i < num_files; ++i) (void)do_source(files[i], FALSE, DOSO_NONE); FreeWild(num_files, files); } } static void add_pack_plugin(char_u *fname, void *cookie) { char_u *p4, *p3, *p2, *p1, *p; char_u *insp; int c; char_u *new_rtp; int keep; int oldlen; int addlen; char_u *ffname = fix_fname(fname); int load_files = cookie != NULL; if (ffname == NULL) return; if (strstr((char *)p_rtp, (char *)ffname) == NULL) { /* directory not in 'runtimepath', add it */ p4 = p3 = p2 = p1 = get_past_head(ffname); for (p = p1; *p; mb_ptr_adv(p)) if (vim_ispathsep_nocolon(*p)) { p4 = p3; p3 = p2; p2 = p1; p1 = p; } /* now we have: * rtp/pack/name/start/name * p4 p3 p2 p1 * * find the part up to "pack" in 'runtimepath' */ c = *p4; *p4 = NUL; insp = (char_u *)strstr((char *)p_rtp, (char *)ffname); if (insp == NULL) /* not found, append at the end */ insp = p_rtp + STRLEN(p_rtp); else { /* append after the matching directory. */ insp += STRLEN(ffname); while (*insp != NUL && *insp != ',') ++insp; } *p4 = c; oldlen = (int)STRLEN(p_rtp); addlen = (int)STRLEN(ffname); new_rtp = alloc(oldlen + addlen + 2); if (new_rtp == NULL) goto theend; keep = (int)(insp - p_rtp); mch_memmove(new_rtp, p_rtp, keep); new_rtp[keep] = ','; mch_memmove(new_rtp + keep + 1, ffname, addlen + 1); if (p_rtp[keep] != NUL) mch_memmove(new_rtp + keep + 1 + addlen, p_rtp + keep, oldlen - keep + 1); set_option_value((char_u *)"rtp", 0L, new_rtp, 0); vim_free(new_rtp); } if (load_files) { static char *plugpat = "%s/plugin/*.vim"; static char *ftpat = "%s/ftdetect/*.vim"; int len; char_u *pat; len = (int)STRLEN(ffname) + (int)STRLEN(ftpat); pat = alloc(len); if (pat == NULL) goto theend; vim_snprintf((char *)pat, len, plugpat, ffname); source_all_matches(pat); #ifdef FEAT_AUTOCMD { char_u *cmd = vim_strsave((char_u *)"g:did_load_filetypes"); /* If runtime/filetype.vim wasn't loaded yet, the scripts will be * found when it loads. */ if (cmd != NULL && eval_to_number(cmd) > 0) { do_cmdline_cmd((char_u *)"augroup filetypedetect"); vim_snprintf((char *)pat, len, ftpat, ffname); source_all_matches(pat); do_cmdline_cmd((char_u *)"augroup END"); } vim_free(cmd); } #endif vim_free(pat); } theend: vim_free(ffname); } static int did_source_packages = FALSE; /* * ":packloadall" * Find plugins in the package directories and source them. */ void ex_packloadall(exarg_T *eap) { if (!did_source_packages || (eap != NULL && eap->forceit)) { did_source_packages = TRUE; do_in_path(p_pp, (char_u *)"pack/*/start/*", DIP_ALL + DIP_DIR, add_pack_plugin, p_pp); } } /* * ":packadd[!] {name}" */ void ex_packadd(exarg_T *eap) { static char *plugpat = "pack/*/opt/%s"; int len; char *pat; len = (int)STRLEN(plugpat) + (int)STRLEN(eap->arg); pat = (char *)alloc(len); if (pat == NULL) return; vim_snprintf(pat, len, plugpat, eap->arg); do_in_path(p_pp, (char_u *)pat, DIP_ALL + DIP_DIR + DIP_ERR, add_pack_plugin, eap->forceit ? NULL : p_pp); vim_free(pat); } #if defined(FEAT_EVAL) && defined(FEAT_AUTOCMD) /* * ":options" */ void ex_options( exarg_T *eap UNUSED) { cmd_source((char_u *)SYS_OPTWIN_FILE, NULL); } #endif /* * ":source {fname}" */ void ex_source(exarg_T *eap) { #ifdef FEAT_BROWSE if (cmdmod.browse) { char_u *fname = NULL; fname = do_browse(0, (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(char_u *fname, exarg_T *eap) { if (*fname == NUL) EMSG(_(e_argreq)); else if (eap != NULL && eap->forceit) /* ":source!": read Normal mode commands * Need to execute the commands directly. This is required at least * for: * - ":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, DOSO_NONE) == 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(void *cookie) { return &((struct source_cookie *)cookie)->breakpoint; } /* * Return the address holding the debug tick for a source cookie. */ int * source_dbg_tick(void *cookie) { return &((struct source_cookie *)cookie)->dbg_tick; } /* * Return the nesting level for a source cookie. */ int source_level(void *cookie) { return ((struct source_cookie *)cookie)->level; } #endif static char_u *get_one_sourceline(struct source_cookie *sp); #if (defined(WIN32) && defined(FEAT_CSCOPE)) || defined(HAVE_FD_CLOEXEC) # define USE_FOPEN_NOINH static FILE *fopen_noinh_readbin(char *filename); /* * Special function to open a file without handle inheritance. * When possible the handle is closed on exec(). */ static FILE * fopen_noinh_readbin(char *filename) { # ifdef WIN32 int fd_tmp = mch_open(filename, O_RDONLY | O_BINARY | O_NOINHERIT, 0); # else int fd_tmp = mch_open(filename, O_RDONLY, 0); # endif if (fd_tmp == -1) return NULL; # ifdef HAVE_FD_CLOEXEC { int fdflags = fcntl(fd_tmp, F_GETFD); if (fdflags >= 0 && (fdflags & FD_CLOEXEC) == 0) (void)fcntl(fd_tmp, F_SETFD, fdflags | FD_CLOEXEC); } # endif 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( char_u *fname, int check_other, /* check for .vimrc and _vimrc */ int is_vimrc) /* DOSO_ value */ { struct source_cookie cookie; char_u *save_sourcing_name; linenr_T save_sourcing_lnum; char_u *p; char_u *fname_exp; char_u *firstline = NULL; 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; scriptitem_T *si = NULL; # ifdef UNIX struct stat st; int stat_ok; # endif #endif #ifdef STARTUPTIME struct timeval tv_rel; struct timeval tv_start; #endif #ifdef FEAT_PROFILE proftime_T wait_start; #endif p = expand_env_save(fname); if (p == NULL) return retval; fname_exp = fix_fname(p); vim_free(p); if (fname_exp == NULL) return retval; if (mch_isdir(fname_exp)) { smsg((char_u *)_("Cannot source a directory: \"%s\""), fname); goto theend; } #ifdef FEAT_AUTOCMD /* Apply SourceCmd autocommands, they should get the file and source it. */ if (has_autocmd(EVENT_SOURCECMD, fname_exp, NULL) && apply_autocmds(EVENT_SOURCECMD, fname_exp, fname_exp, FALSE, curbuf)) { # ifdef FEAT_EVAL retval = aborting() ? FAIL : OK; # else retval = OK; # endif goto theend; } /* Apply SourcePre autocommands, they may get the file. */ apply_autocmds(EVENT_SOURCEPRE, fname_exp, fname_exp, FALSE, curbuf); #endif #ifdef USE_FOPEN_NOINH 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 = '_'; #ifdef USE_FOPEN_NOINH 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) { verbose_enter(); if (sourcing_name == NULL) smsg((char_u *)_("could not source \"%s\""), fname); else smsg((char_u *)_("line %ld: could not source \"%s\""), sourcing_lnum, fname); verbose_leave(); } 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) { verbose_enter(); if (sourcing_name == NULL) smsg((char_u *)_("sourcing \"%s\""), fname); else smsg((char_u *)_("line %ld: sourcing \"%s\""), sourcing_lnum, fname); verbose_leave(); } if (is_vimrc == DOSO_VIMRC) vimrc_found(fname_exp, (char_u *)"MYVIMRC"); else if (is_vimrc == DOSO_GVIMRC) vimrc_found(fname_exp, (char_u *)"MYGVIMRC"); #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 /* * 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 FEAT_MBYTE cookie.conv.vc_type = CONV_NONE; /* no conversion */ /* Read the first line so we can check for a UTF-8 BOM. */ firstline = getsourceline(0, (void *)&cookie, 0); if (firstline != NULL && STRLEN(firstline) >= 3 && firstline[0] == 0xef && firstline[1] == 0xbb && firstline[2] == 0xbf) { /* Found BOM; setup conversion, skip over BOM and recode the line. */ convert_setup(&cookie.conv, (char_u *)"utf-8", p_enc); p = string_convert(&cookie.conv, firstline + 3, NULL); if (p == NULL) p = vim_strsave(firstline + 3); if (p != NULL) { vim_free(firstline); firstline = p; } } #endif #ifdef STARTUPTIME if (time_fd != NULL) time_push(&tv_rel, &tv_start); #endif #ifdef FEAT_EVAL # ifdef FEAT_PROFILE if (do_profiling == PROF_YES) prof_child_enter(&wait_start); /* entering a child now */ # endif /* Don't use local function variables, if called from a function. * Also starts profiling timer for nested script. */ save_funccalp = save_funccal(); /* * 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_items.ga_len; current_SID > 0; --current_SID) { si = &SCRIPT_ITEM(current_SID); if (si->sn_name != NULL && ( # ifdef UNIX /* Compare dev/ino when possible, it catches symbolic * links. Also compare file names, the inode may change * when the file was edited. */ ((stat_ok && si->sn_dev_valid) && (si->sn_dev == st.st_dev && si->sn_ino == st.st_ino)) || # endif fnamecmp(si->sn_name, fname_exp) == 0)) break; } if (current_SID == 0) { current_SID = ++last_current_SID; if (ga_grow(&script_items, (int)(current_SID - script_items.ga_len)) == FAIL) goto almosttheend; while (script_items.ga_len < current_SID) { ++script_items.ga_len; SCRIPT_ITEM(script_items.ga_len).sn_name = NULL; # ifdef FEAT_PROFILE SCRIPT_ITEM(script_items.ga_len).sn_prof_on = FALSE; # endif } si = &SCRIPT_ITEM(current_SID); si->sn_name = fname_exp; fname_exp = NULL; # ifdef UNIX if (stat_ok) { si->sn_dev_valid = TRUE; si->sn_dev = st.st_dev; si->sn_ino = st.st_ino; } else si->sn_dev_valid = FALSE; # endif /* Allocate the local script variables to use for this script. */ new_script_vars(current_SID); } # ifdef FEAT_PROFILE if (do_profiling == PROF_YES) { int forceit; /* Check if we do profiling for this script. */ if (!si->sn_prof_on && has_profiling(TRUE, si->sn_name, &forceit)) { script_do_profile(si); si->sn_pr_force = forceit; } if (si->sn_prof_on) { ++si->sn_pr_count; profile_start(&si->sn_pr_start); profile_zero(&si->sn_pr_children); } } # endif #endif /* * Call do_cmdline, which will call getsourceline() to get the lines. */ do_cmdline(firstline, getsourceline, (void *)&cookie, DOCMD_VERBOSE|DOCMD_NOWAIT|DOCMD_REPEAT); retval = OK; #ifdef FEAT_PROFILE if (do_profiling == PROF_YES) { /* Get "si" again, "script_items" may have been reallocated. */ si = &SCRIPT_ITEM(current_SID); if (si->sn_prof_on) { profile_end(&si->sn_pr_start); profile_sub_wait(&wait_start, &si->sn_pr_start); profile_add(&si->sn_pr_total, &si->sn_pr_start); profile_self(&si->sn_pr_self, &si->sn_pr_start, &si->sn_pr_children); } } #endif if (got_int) EMSG(_(e_interr)); sourcing_name = save_sourcing_name; sourcing_lnum = save_sourcing_lnum; if (p_verbose > 1) { verbose_enter(); smsg((char_u *)_("finished sourcing %s"), fname); if (sourcing_name != NULL) smsg((char_u *)_("continuing in %s"), sourcing_name); verbose_leave(); } #ifdef STARTUPTIME if (time_fd != NULL) { vim_snprintf((char *)IObuff, IOSIZE, "sourcing %s", fname); time_msg((char *)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 #ifdef FEAT_EVAL almosttheend: current_SID = save_current_SID; restore_funccal(save_funccalp); # ifdef FEAT_PROFILE if (do_profiling == PROF_YES) prof_child_exit(&wait_start); /* leaving a child now */ # endif #endif fclose(cookie.fp); vim_free(cookie.nextline); vim_free(firstline); #ifdef FEAT_MBYTE convert_setup(&cookie.conv, NULL, NULL); #endif theend: vim_free(fname_exp); return retval; } #if defined(FEAT_EVAL) || defined(PROTO) /* * ":scriptnames" */ void ex_scriptnames(exarg_T *eap UNUSED) { int i; for (i = 1; i <= script_items.ga_len && !got_int; ++i) if (SCRIPT_ITEM(i).sn_name != NULL) { home_replace(NULL, SCRIPT_ITEM(i).sn_name, NameBuff, MAXPATHL, TRUE); smsg((char_u *)"%3d: %s", i, NameBuff); } } # if defined(BACKSLASH_IN_FILENAME) || defined(PROTO) /* * Fix slashes in the list of script names for 'shellslash'. */ void scriptnames_slash_adjust(void) { int i; for (i = 1; i <= script_items.ga_len; ++i) if (SCRIPT_ITEM(i).sn_name != NULL) slash_adjust(SCRIPT_ITEM(i).sn_name); } # endif /* * Get a pointer to a script name. Used for ":verbose set". */ char_u * get_scriptname(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"); if (id == SID_ERROR) return (char_u *)_("error handler"); return SCRIPT_ITEM(id).sn_name; } # if defined(EXITFREE) || defined(PROTO) void free_scriptnames(void) { int i; for (i = script_items.ga_len; i > 0; --i) vim_free(SCRIPT_ITEM(i).sn_name); ga_clear(&script_items); } # endif #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(char *s, int n, FILE *stream) { return fgets(s, n, stream); } # else /* * Version of fgets() which also works for lines ending in a only * (Macintosh format). * For older versions of the Metrowerks library. * At least CodeWarrior 9 needed this code. */ char * fgets_cr(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. */ char_u * getsourceline(int c UNUSED, void *cookie, int indent UNUSED) { struct source_cookie *sp = (struct source_cookie *)cookie; char_u *line; char_u *p; #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; } # ifdef FEAT_PROFILE if (do_profiling == PROF_YES) script_line_end(); # endif #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; } #ifdef FEAT_PROFILE if (line != NULL && do_profiling == PROF_YES) script_line_start(); #endif /* 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; /* Get the next line and concatenate it when it starts with a * backslash. We always need to read the next line, keep it in * sp->nextline. */ sp->nextline = get_one_sourceline(sp); if (sp->nextline != NULL && *(p = skipwhite(sp->nextline)) == '\\') { garray_T ga; ga_init2(&ga, (int)sizeof(char_u), 400); ga_concat(&ga, line); ga_concat(&ga, p + 1); for (;;) { vim_free(sp->nextline); sp->nextline = get_one_sourceline(sp); if (sp->nextline == NULL) break; p = skipwhite(sp->nextline); if (*p != '\\') break; /* Adjust the growsize to the current length to speed up * concatenating many lines. */ if (ga.ga_len > 400) { if (ga.ga_len > 8000) ga.ga_growsize = 8000; else ga.ga_growsize = ga.ga_len; } ga_concat(&ga, p + 1); } ga_append(&ga, NUL); vim_free(line); line = ga.ga_data; } } #ifdef FEAT_MBYTE if (line != NULL && sp->conv.vc_type != CONV_NONE) { char_u *s; /* 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(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, 250); /* * Loop until there is a finished line (or end-of-file). */ sourcing_lnum++; for (;;) { /* make room to read at least 120 (more) characters */ if (ga_grow(&ga, 120) == 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_maxlen - ga.ga_len, sp->fp) == NULL) break; } else #endif if (fgets((char *)buf + ga.ga_len, ga.ga_maxlen - ga.ga_len, sp->fp) == NULL) break; len = ga.ga_len + (int)STRLEN(buf + ga.ga_len); #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_len = len; /* If the line was longer than the buffer, read more. */ if (ga.ga_maxlen - ga.ga_len == 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; } else /* lines like ":map xx yy^M" will have failed */ { if (!sp->error) { msg_source(hl_attr(HLF_W)); 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; } #if defined(FEAT_PROFILE) || defined(PROTO) /* * Called when starting to read a script line. * "sourcing_lnum" must be correct! * When skipping lines it may not actually be executed, but we won't find out * until later and we need to store the time now. */ void script_line_start(void) { scriptitem_T *si; sn_prl_T *pp; if (current_SID <= 0 || current_SID > script_items.ga_len) return; si = &SCRIPT_ITEM(current_SID); if (si->sn_prof_on && sourcing_lnum >= 1) { /* Grow the array before starting the timer, so that the time spent * here isn't counted. */ (void)ga_grow(&si->sn_prl_ga, (int)(sourcing_lnum - si->sn_prl_ga.ga_len)); si->sn_prl_idx = sourcing_lnum - 1; while (si->sn_prl_ga.ga_len <= si->sn_prl_idx && si->sn_prl_ga.ga_len < si->sn_prl_ga.ga_maxlen) { /* Zero counters for a line that was not used before. */ pp = &PRL_ITEM(si, si->sn_prl_ga.ga_len); pp->snp_count = 0; profile_zero(&pp->sn_prl_total); profile_zero(&pp->sn_prl_self); ++si->sn_prl_ga.ga_len; } si->sn_prl_execed = FALSE; profile_start(&si->sn_prl_start); profile_zero(&si->sn_prl_children); profile_get_wait(&si->sn_prl_wait); } } /* * Called when actually executing a function line. */ void script_line_exec(void) { scriptitem_T *si; if (current_SID <= 0 || current_SID > script_items.ga_len) return; si = &SCRIPT_ITEM(current_SID); if (si->sn_prof_on && si->sn_prl_idx >= 0) si->sn_prl_execed = TRUE; } /* * Called when done with a function line. */ void script_line_end(void) { scriptitem_T *si; sn_prl_T *pp; if (current_SID <= 0 || current_SID > script_items.ga_len) return; si = &SCRIPT_ITEM(current_SID); if (si->sn_prof_on && si->sn_prl_idx >= 0 && si->sn_prl_idx < si->sn_prl_ga.ga_len) { if (si->sn_prl_execed) { pp = &PRL_ITEM(si, si->sn_prl_idx); ++pp->snp_count; profile_end(&si->sn_prl_start); profile_sub_wait(&si->sn_prl_wait, &si->sn_prl_start); profile_add(&pp->sn_prl_total, &si->sn_prl_start); profile_self(&pp->sn_prl_self, &si->sn_prl_start, &si->sn_prl_children); } si->sn_prl_idx = -1; } } #endif /* * ":scriptencoding": Set encoding conversion for a sourced script. * Without the multi-byte feature it's simply ignored. */ void ex_scriptencoding(exarg_T *eap UNUSED) { #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(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(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( char_u *(*fgetline)(int, void *, int), void *cookie) { return (getline_equal(fgetline, cookie, getsourceline) && ((struct source_cookie *)getline_cookie( fgetline, cookie))->finished); } #endif #if defined(FEAT_LISTCMDS) || defined(PROTO) /* * ":checktime [buffer]" */ void ex_checktime(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(HAVE_LOCALE_H) || defined(X_LOCALE)) \ && (defined(FEAT_EVAL) || defined(FEAT_MULTI_LANG)) # define HAVE_GET_LOCALE_VAL static char_u *get_locale_val(int what); static char_u * get_locale_val(int what) { char_u *loc; /* Obtain the locale value from the libraries. */ loc = (char_u *)setlocale(what, NULL); # ifdef WIN32 if (loc != NULL) { char_u *p; /* setocale() returns something like "LC_COLLATE=;LC_..." when * one of the values (e.g., LC_CTYPE) differs. */ p = vim_strchr(loc, '='); if (p != NULL) { loc = ++p; while (*p != NUL) /* remove trailing newline */ { if (*p < ' ' || *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 (char_u *)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(void) { char_u *p; # ifdef HAVE_GET_LOCALE_VAL # if defined(LC_MESSAGES) p = 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. LC_COLLATE is the best guess, LC_TIME * and LC_MONETARY may be set differently for a Japanese working in the * US. */ p = get_locale_val(LC_COLLATE); # 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 /* Complicated #if; matches with where get_mess_env() is used below. */ #if (defined(FEAT_EVAL) && !((defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \ && defined(LC_MESSAGES))) \ || ((defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \ && (defined(FEAT_GETTEXT) || defined(FEAT_MBYTE)) \ && !defined(LC_MESSAGES)) static char_u *get_mess_env(void); /* * Get the language used for messages from the environment. */ static char_u * get_mess_env(void) { 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" */ # ifdef HAVE_GET_LOCALE_VAL if (p == NULL || *p == NUL) p = 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(void) { char_u *loc; # ifdef HAVE_GET_LOCALE_VAL loc = 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_GET_LOCALE_VAL) && defined(LC_MESSAGES) loc = get_locale_val(LC_MESSAGES); # else loc = get_mess_env(); # endif set_vim_var_string(VV_LANG, loc, -1); # ifdef HAVE_GET_LOCALE_VAL loc = 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(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 defined(FEAT_FLOAT) && defined(LC_NUMERIC) /* Make sure strtod() uses a decimal point, not a comma. */ setlocale(LC_NUMERIC, "C"); #endif } 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 everything. */ 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); /* Clear $LANGUAGE because GNU gettext uses it. */ vim_setenv((char_u *)"LANGUAGE", (char_u *)""); # ifdef WIN32 /* Apparently MS-Windows printf() may cause a crash when * we give it 8-bit text while it's expecting text in the * current locale. This call avoids that. */ setlocale(LC_CTYPE, "C"); # endif } 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 } } # ifdef FEAT_EVAL /* Set v:lang, v:lc_time and v:ctype to the final result. */ set_lang_var(); # endif # ifdef FEAT_TITLE maketitle(); # endif } } } # if defined(FEAT_CMDL_COMPL) || defined(PROTO) static char_u **locales = NULL; /* Array of all available locales */ static int did_init_locales = FALSE; static void init_locales(void); static char_u **find_locales(void); /* * Lazy initialization of all available locales. */ static void init_locales(void) { if (!did_init_locales) { did_init_locales = TRUE; locales = find_locales(); } } /* Return an array of strings for all available locales + NULL for the * last element. Return NULL in case of error. */ static char_u ** find_locales(void) { garray_T locales_ga; char_u *loc; /* Find all available locales by running command "locale -a". If this * doesn't work we won't have completion. */ char_u *locale_a = get_cmd_output((char_u *)"locale -a", NULL, SHELL_SILENT, NULL); if (locale_a == NULL) return NULL; ga_init2(&locales_ga, sizeof(char_u *), 20); /* Transform locale_a string where each locale is separated by "\n" * into an array of locale strings. */ loc = (char_u *)strtok((char *)locale_a, "\n"); while (loc != NULL) { if (ga_grow(&locales_ga, 1) == FAIL) break; loc = vim_strsave(loc); if (loc == NULL) break; ((char_u **)locales_ga.ga_data)[locales_ga.ga_len++] = loc; loc = (char_u *)strtok(NULL, "\n"); } vim_free(locale_a); if (ga_grow(&locales_ga, 1) == FAIL) { ga_clear(&locales_ga); return NULL; } ((char_u **)locales_ga.ga_data)[locales_ga.ga_len] = NULL; return (char_u **)locales_ga.ga_data; } # if defined(EXITFREE) || defined(PROTO) void free_locales(void) { int i; if (locales != NULL) { for (i = 0; locales[i] != NULL; i++) vim_free(locales[i]); vim_free(locales); locales = NULL; } } # endif /* * Function given to ExpandGeneric() to obtain the possible arguments of the * ":language" command. */ char_u * get_lang_arg(expand_T *xp UNUSED, int idx) { if (idx == 0) return (char_u *)"messages"; if (idx == 1) return (char_u *)"ctype"; if (idx == 2) return (char_u *)"time"; init_locales(); if (locales == NULL) return NULL; return locales[idx - 3]; } /* * Function given to ExpandGeneric() to obtain the available locales. */ char_u * get_locales(expand_T *xp UNUSED, int idx) { init_locales(); if (locales == NULL) return NULL; return locales[idx]; } # endif #endif vim-7.4.1689/src/ex_docmd.c000066400000000000000000010366401267703067000153240ustar00rootroot00000000000000/* 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" 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 */ int uc_compl; /* completion type */ int uc_addr_type; /* The command's address type */ # ifdef FEAT_EVAL scid_T uc_scriptID; /* SID where the command was defined */ # ifdef FEAT_CMDL_COMPL char_u *uc_compl_arg; /* completion argument if any */ # endif # endif } ucmd_T; #define UC_BUFFER 1 /* -buffer: local to current buffer */ static 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(exarg_T *eap); static void ex_command(exarg_T *eap); static void ex_delcommand(exarg_T *eap); # ifdef FEAT_CMDL_COMPL static char_u *get_user_command_name(int idx); # endif /* Wether a command index indicates a user command. */ # define IS_USER_CMDIDX(idx) ((int)(idx) < 0) #else # define ex_command ex_ni # define ex_comclear ex_ni # define ex_delcommand ex_ni /* Wether a command index indicates a user command. */ # define IS_USER_CMDIDX(idx) (FALSE) #endif static int compute_buffer_local_count(int addr_type, int lnum, int local); #ifdef FEAT_EVAL static char_u *do_one_cmd(char_u **, int, struct condstack *, char_u *(*fgetline)(int, void *, int), void *cookie); #else static char_u *do_one_cmd(char_u **, int, char_u *(*fgetline)(int, void *, int), void *cookie); static int if_level = 0; /* depth in :if */ #endif static void append_command(char_u *cmd); static char_u *find_command(exarg_T *eap, int *full); static void ex_abbreviate(exarg_T *eap); static void ex_map(exarg_T *eap); static void ex_unmap(exarg_T *eap); static void ex_mapclear(exarg_T *eap); static void ex_abclear(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(exarg_T *eap); static void ex_doautocmd(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(exarg_T *eap); static void ex_buffer(exarg_T *eap); static void ex_bmodified(exarg_T *eap); static void ex_bnext(exarg_T *eap); static void ex_bprevious(exarg_T *eap); static void ex_brewind(exarg_T *eap); static void ex_blast(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(char_u **); static char_u *skip_cmd_arg(char_u *p, int rembs); static int getargopt(exarg_T *eap); #ifndef FEAT_QUICKFIX # define ex_make ex_ni # define ex_cbuffer 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 # define ex_vimgrep 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 #if !defined(FEAT_QUICKFIX) || !defined(FEAT_EVAL) # define ex_cexpr ex_ni #endif static int check_more(int, int); static linenr_T get_address(exarg_T *, char_u **, int addr_type, int skip, int to_other_file); static void get_flags(exarg_T *eap); #if !defined(FEAT_PERL) \ || !defined(FEAT_PYTHON) || !defined(FEAT_PYTHON3) \ || !defined(FEAT_TCL) \ || !defined(FEAT_RUBY) \ || !defined(FEAT_LUA) \ || !defined(FEAT_MZSCHEME) # define HAVE_EX_SCRIPT_NI static void ex_script_ni(exarg_T *eap); #endif static char_u *invalid_range(exarg_T *eap); static void correct_range(exarg_T *eap); #ifdef FEAT_QUICKFIX static char_u *replace_makeprg(exarg_T *eap, char_u *p, char_u **cmdlinep); #endif static char_u *repl_cmdline(exarg_T *eap, char_u *src, int srclen, char_u *repl, char_u **cmdlinep); static void ex_highlight(exarg_T *eap); static void ex_colorscheme(exarg_T *eap); static void ex_quit(exarg_T *eap); static void ex_cquit(exarg_T *eap); static void ex_quit_all(exarg_T *eap); #ifdef FEAT_WINDOWS static void ex_close(exarg_T *eap); static void ex_win_close(int forceit, win_T *win, tabpage_T *tp); static void ex_only(exarg_T *eap); static void ex_resize(exarg_T *eap); static void ex_stag(exarg_T *eap); static void ex_tabclose(exarg_T *eap); static void ex_tabonly(exarg_T *eap); static void ex_tabnext(exarg_T *eap); static void ex_tabmove(exarg_T *eap); static void ex_tabs(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 # define ex_tabnext ex_ni # define ex_tabmove ex_ni # define ex_tabs ex_ni # define ex_tabclose ex_ni # define ex_tabonly ex_ni #endif #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX) static void ex_pclose(exarg_T *eap); static void ex_ptag(exarg_T *eap); static void ex_pedit(exarg_T *eap); #else # define ex_pclose ex_ni # define ex_ptag ex_ni # define ex_pedit ex_ni #endif static void ex_hide(exarg_T *eap); static void ex_stop(exarg_T *eap); static void ex_exit(exarg_T *eap); static void ex_print(exarg_T *eap); #ifdef FEAT_BYTEOFF static void ex_goto(exarg_T *eap); #else # define ex_goto ex_ni #endif static void ex_shell(exarg_T *eap); static void ex_preserve(exarg_T *eap); static void ex_recover(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(exarg_T *eap); static void ex_wrongmodifier(exarg_T *eap); static void ex_find(exarg_T *eap); static void ex_open(exarg_T *eap); static void ex_edit(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(exarg_T *eap); #endif #if defined(FEAT_GUI_W32) && defined(FEAT_MENU) && defined(FEAT_TEAROFF) static void ex_tearoff(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(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 #if !defined(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 # define ex_ownsyntax ex_ni #endif #if !defined(FEAT_SYN_HL) || !defined(FEAT_PROFILE) # define ex_syntime ex_ni #endif #ifndef FEAT_SPELL # define ex_spell ex_ni # define ex_mkspell ex_ni # define ex_spelldump ex_ni # define ex_spellinfo ex_ni # define ex_spellrepall ex_ni #endif #ifndef FEAT_PERSISTENT_UNDO # define ex_rundo ex_ni # define ex_wundo ex_ni #endif #ifndef FEAT_LUA # define ex_lua ex_script_ni # define ex_luado ex_ni # define ex_luafile ex_ni #endif #ifndef FEAT_MZSCHEME # define ex_mzscheme ex_script_ni # define ex_mzfile 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_pydo ex_ni # define ex_pyfile ex_ni #endif #ifndef FEAT_PYTHON3 # define ex_py3 ex_script_ni # define ex_py3do ex_ni # define ex_py3file 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_KEYMAP # define ex_loadkeymap ex_ni #endif static void ex_swapname(exarg_T *eap); static void ex_syncbind(exarg_T *eap); static void ex_read(exarg_T *eap); static void ex_pwd(exarg_T *eap); static void ex_equal(exarg_T *eap); static void ex_sleep(exarg_T *eap); static void do_exmap(exarg_T *eap, int isabbrev); static void ex_winsize(exarg_T *eap); #ifdef FEAT_WINDOWS static void ex_wincmd(exarg_T *eap); #else # define ex_wincmd ex_ni #endif #if defined(FEAT_GUI) || defined(UNIX) || defined(VMS) || defined(MSWIN) static void ex_winpos(exarg_T *eap); #else # define ex_winpos ex_ni #endif static void ex_operators(exarg_T *eap); static void ex_put(exarg_T *eap); static void ex_copymove(exarg_T *eap); static void ex_submagic(exarg_T *eap); static void ex_join(exarg_T *eap); static void ex_at(exarg_T *eap); static void ex_bang(exarg_T *eap); static void ex_undo(exarg_T *eap); #ifdef FEAT_PERSISTENT_UNDO static void ex_wundo(exarg_T *eap); static void ex_rundo(exarg_T *eap); #endif static void ex_redo(exarg_T *eap); static void ex_later(exarg_T *eap); static void ex_redir(exarg_T *eap); static void ex_redrawstatus(exarg_T *eap); static void close_redir(void); static void ex_mkrc(exarg_T *eap); static void ex_mark(exarg_T *eap); #ifdef FEAT_USR_CMDS static char_u *uc_fun_cmd(void); static char_u *find_ucmd(exarg_T *eap, char_u *p, int *full, expand_T *xp, int *compl); #endif static void ex_startinsert(exarg_T *eap); static void ex_stopinsert(exarg_T *eap); #ifdef FEAT_FIND_ID static void ex_checkpath(exarg_T *eap); static void ex_findpat(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(exarg_T *eap); #else # define ex_psearch ex_ni #endif static void ex_tag(exarg_T *eap); static void ex_tag_cmd(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_lockvar ex_ni # define ex_unlockvar ex_ni # define ex_function ex_ni # define ex_delfunction ex_ni # define ex_return ex_ni # define ex_oldfiles ex_ni #endif static char_u *arg_all(void); #ifdef FEAT_SESSION static int makeopens(FILE *fd, char_u *dirnow); static int put_view(FILE *fd, win_T *wp, int add_edit, unsigned *flagp, int current_arg_idx); static void ex_loadview(exarg_T *eap); static char_u *get_view_file(int c); static int did_lcd; /* whether ":lcd" was produced for a session */ #else # define ex_loadview ex_ni #endif #ifndef FEAT_EVAL # define ex_compiler ex_ni #endif #ifdef FEAT_VIMINFO static void ex_viminfo(exarg_T *eap); #else # define ex_viminfo ex_ni #endif static void ex_behave(exarg_T *eap); #ifdef FEAT_AUTOCMD static void ex_filetype(exarg_T *eap); static void ex_setfiletype(exarg_T *eap); #else # define ex_filetype ex_ni # define ex_setfiletype ex_ni #endif #ifndef FEAT_DIFF # define ex_diffoff ex_ni # 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(exarg_T *eap); static void ex_set(exarg_T *eap); #if !defined(FEAT_EVAL) || !defined(FEAT_AUTOCMD) # define ex_options ex_ni #endif #ifdef FEAT_SEARCH_EXTRA static void ex_nohlsearch(exarg_T *eap); static void ex_match(exarg_T *eap); #else # define ex_nohlsearch ex_ni # define ex_match ex_ni #endif #ifdef FEAT_CRYPT static void ex_X(exarg_T *eap); #else # define ex_X ex_ni #endif #ifdef FEAT_FOLDING static void ex_fold(exarg_T *eap); static void ex_foldopen(exarg_T *eap); static void ex_folddo(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_NETBEANS_INTG # define ex_nbclose ex_ni # define ex_nbkey ex_ni # define ex_nbstart 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 #ifndef FEAT_PROFILE # define ex_profile 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. */ static 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/for 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 or for loop. * This is required, because do_one_cmd() may invoke ex_function(), which * reads more lines that may come from the while/for loop. */ struct loop_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)(int, void *, int); void *cookie; }; static char_u *get_loop_line(int c, void *cookie, int indent); static int store_loop_line(garray_T *gap, char_u *line); static void free_cmdlines(garray_T *gap); /* Struct to save a few things while debugging. Used in do_cmdline() only. */ struct dbg_stuff { int trylevel; int force_abort; except_T *caught_stack; char_u *vv_exception; char_u *vv_throwpoint; int did_emsg; int got_int; int did_throw; int need_rethrow; int check_cstack; except_T *current_exception; }; static void save_dbg_stuff(struct dbg_stuff *dsp); static void restore_dbg_stuff(struct dbg_stuff *dsp); static void save_dbg_stuff(struct dbg_stuff *dsp) { dsp->trylevel = trylevel; trylevel = 0; dsp->force_abort = force_abort; force_abort = FALSE; dsp->caught_stack = caught_stack; caught_stack = NULL; dsp->vv_exception = v_exception(NULL); dsp->vv_throwpoint = v_throwpoint(NULL); /* Necessary for debugging an inactive ":catch", ":finally", ":endtry" */ dsp->did_emsg = did_emsg; did_emsg = FALSE; dsp->got_int = got_int; got_int = FALSE; dsp->did_throw = did_throw; did_throw = FALSE; dsp->need_rethrow = need_rethrow; need_rethrow = FALSE; dsp->check_cstack = check_cstack; check_cstack = FALSE; dsp->current_exception = current_exception; current_exception = NULL; } static void restore_dbg_stuff(struct dbg_stuff *dsp) { suppress_errthrow = FALSE; trylevel = dsp->trylevel; force_abort = dsp->force_abort; caught_stack = dsp->caught_stack; (void)v_exception(dsp->vv_exception); (void)v_throwpoint(dsp->vv_throwpoint); did_emsg = dsp->did_emsg; got_int = dsp->got_int; did_throw = dsp->did_throw; need_rethrow = dsp->need_rethrow; check_cstack = dsp->check_cstack; current_exception = dsp->current_exception; } #endif /* * do_exmode(): Repeatedly get commands for the "Ex" mode, until the ":vi" * command is given. */ void do_exmode( int improved) /* TRUE for "improved Ex" mode */ { int save_msg_scroll; int prev_msg_row; linenr_T prev_line; int changedtick; if (improved) exmode_active = EXMODE_VIM; else exmode_active = EXMODE_NORMAL; State = NORMAL; /* When using ":global /pat/ visual" and then "Q" we return to continue * the :global command. */ if (global_busy) return; save_msg_scroll = msg_scroll; ++RedrawingDisabled; /* don't redisplay the window */ ++no_wait_return; /* don't wait for return */ #ifdef FEAT_GUI /* Ignore scrollbar and mouse events in Ex mode */ ++hold_gui_events; #endif MSG(_("Entering Ex mode. Type \"visual\" to go to Normal mode.")); while (exmode_active) { /* Check for a ":normal" command and no more characters left. */ if (ex_normal_busy > 0 && typebuf.tb_len == 0) { exmode_active = FALSE; break; } msg_scroll = TRUE; need_wait_return = FALSE; ex_pressedreturn = FALSE; ex_no_reprint = FALSE; changedtick = curbuf->b_changedtick; prev_msg_row = msg_row; prev_line = curwin->w_cursor.lnum; 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 || changedtick != curbuf->b_changedtick) && !ex_no_reprint) { if (curbuf->b_ml.ml_flags & ML_EMPTY) EMSG(_(e_emptybuf)); else { if (ex_pressedreturn) { /* go up one line, to overwrite the ":" line, so the * output doesn'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, FALSE); msg_clr_eos(); } } else if (ex_pressedreturn && !ex_no_reprint) /* must be at EOF */ { if (curbuf->b_ml.ml_flags & ML_EMPTY) EMSG(_(e_emptybuf)); else EMSG(_("E501: At end-of-file")); } } #ifdef FEAT_GUI --hold_gui_events; #endif --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(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, fgetline() 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 fgetline() 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( char_u *cmdline, char_u *(*fgetline)(int, void *, int), void *cookie, /* argument for fgetline() */ int flags) { char_u *next_cmdline; /* next cmd to execute */ char_u *cmdline_copy = NULL; /* copy of cmd line */ int used_getline = FALSE; /* used "fgetline" 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"/":for" */ 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 */ struct dbg_stuff debug_saved; /* saved things for debug mode */ int initial_trylevel; struct msglist **saved_msg_list = NULL; struct msglist *private_msg_list; /* "fgetline" and "cookie" passed to do_one_cmd() */ char_u *(*cmd_getline)(int, void *, int); void *cmd_cookie; struct loop_cookie cmd_loop_cookie; void *real_cookie; int getline_is_func; #else # define cmd_getline fgetline # 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_looplevel = 0; cstack.cs_trylevel = 0; cstack.cs_emsg_silent_list = NULL; cstack.cs_lflags = 0; ga_init2(&lines_ga, (int)sizeof(wcmd_T), 10); real_cookie = getline_cookie(fgetline, cookie); /* Inside a function use a higher nesting level. */ getline_is_func = getline_equal(fgetline, cookie, get_func_line); if (getline_is_func && 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_is_func) { fname = func_name(real_cookie); breakpoint = func_breakpoint(real_cookie); dbg_tick = func_dbg_tick(real_cookie); } else if (getline_equal(fgetline, 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). Otherwise clear it to avoid * a bogus compiler warning when the optimizer uses inline functions... */ if (flags & DOCMD_EXCRESET) save_dbg_stuff(&debug_saved); else vim_memset(&debug_saved, 0, sizeof(debug_saved)); 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 or 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(fgetline, cookie, getexline)) KeyTyped = FALSE; /* * Continue executing command lines: * - when inside an ":if", ":while" or ":for" * - for multiple commands on one line, separated with '|' * - when repeating until there are no more lines (for ":source") */ next_cmdline = cmdline; do { #ifdef FEAT_EVAL getline_is_func = getline_equal(fgetline, cookie, get_func_line); #endif /* stop skipping cmds for an error msg after all endif/while/for */ if (next_cmdline == NULL #ifdef FEAT_EVAL && !force_abort && cstack.cs_idx < 0 && !(getline_is_func && func_has_abort(real_cookie)) #endif ) did_emsg = FALSE; /* * 1. If repeating a line in a loop, get a line from lines_ga. * 2. If no line given: Get an allocated line with fgetline(). * 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_looplevel > 0 && 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_is_func) { # ifdef FEAT_PROFILE if (do_profiling == PROF_YES) func_line_end(real_cookie); # endif if (func_has_ended(real_cookie)) { retval = FAIL; break; } } #ifdef FEAT_PROFILE else if (do_profiling == PROF_YES && getline_equal(fgetline, cookie, getsourceline)) script_line_end(); #endif /* Check if a sourced file hit a ":finish" command. */ if (source_finished(fgetline, 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(fgetline, 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(fgetline, cookie, getsourceline), fname, sourcing_lnum); *dbg_tick = debug_tick; } # ifdef FEAT_PROFILE if (do_profiling == PROF_YES) { if (getline_is_func) func_line_start(real_cookie); else if (getline_equal(fgetline, cookie, getsourceline)) script_line_start(); } # endif } if (cstack.cs_looplevel > 0) { /* Inside a while/for loop we need to store the lines and use them * again. Pass a different "fgetline" 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/for loop. */ cmd_getline = get_loop_line; cmd_cookie = (void *)&cmd_loop_cookie; cmd_loop_cookie.lines_gap = &lines_ga; cmd_loop_cookie.current_line = current_line; cmd_loop_cookie.getline = fgetline; cmd_loop_cookie.cookie = cookie; cmd_loop_cookie.repeating = (current_line < lines_ga.ga_len); } else { cmd_getline = fgetline; cmd_cookie = cookie; } #endif /* 2. If no line given, get an allocated line with fgetline(). */ 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(fgetline, cookie, getexline)) msg_didout = TRUE; if (fgetline == NULL || (next_cmdline = fgetline(':', 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" or ":for", and when * the command looks like a ":while" or ":for", 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/:endfor. */ if (current_line == lines_ga.ga_len && (cstack.cs_looplevel || has_loop_cmd(next_cmdline))) { if (store_loop_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; /* don't wait for return until finished */ ++RedrawingDisabled; did_inc = TRUE; } } if (p_verbose >= 15 && sourcing_name != NULL) { ++no_wait_return; verbose_enter_scroll(); smsg((char_u *)_("line %ld: %s"), (long)sourcing_lnum, cmdline_copy); if (msg_silent == 0) msg_puts((char_u *)"\n"); /* don't overwrite this */ verbose_leave_scroll(); --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_loop_cookie) /* Use "current_line" from "cmd_loop_cookie", it may have been * incremented when defining a function. */ current_line = cmd_loop_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(fgetline, 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() */ STRMOVE(cmdline_copy, next_cmdline); 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(fgetline, cookie, get_func_line) && !func_has_abort(real_cookie)) did_emsg = FALSE; if (cstack.cs_looplevel > 0) { ++current_line; /* * An ":endwhile", ":endfor" and ":continue" is handled here. * If we were executing commands, jump back to the ":while" or * ":for". * If we were not executing commands, decrement cs_looplevel. */ if (cstack.cs_lflags & (CSL_HAD_CONT | CSL_HAD_ENDLOOP)) { cstack.cs_lflags &= ~(CSL_HAD_CONT | CSL_HAD_ENDLOOP); /* Jump back to the matching ":while" or ":for". Be careful * not to use a cs_line[] from an entry that isn't a ":while" * or ":for": 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 | CSF_FOR)) && cstack.cs_line[cstack.cs_idx] >= 0 && (cstack.cs_flags[cstack.cs_idx] & CSF_ACTIVE)) { current_line = cstack.cs_line[cstack.cs_idx]; /* remember we jumped there */ cstack.cs_lflags |= CSL_HAD_LOOP; line_breakcheck(); /* check if CTRL-C typed */ /* Check for the next breakpoint at or after the ":while" * or ":for". */ if (breakpoint != NULL) { *breakpoint = dbg_find_breakpoint( getline_equal(fgetline, cookie, getsourceline), fname, ((wcmd_T *)lines_ga.ga_data)[current_line].lnum-1); *dbg_tick = debug_tick; } } else { /* can only get here with ":endwhile" or ":endfor" */ if (cstack.cs_idx >= 0) rewind_conditionals(&cstack, cstack.cs_idx - 1, CSF_WHILE | CSF_FOR, &cstack.cs_looplevel); } } /* * For a ":while" or ":for" we need to remember the line number. */ else if (cstack.cs_lflags & CSL_HAD_LOOP) { cstack.cs_lflags &= ~CSL_HAD_LOOP; cstack.cs_line[cstack.cs_idx] = current_line - 1; } } /* * When not inside any ":while" loop, clear remembered lines. */ if (cstack.cs_looplevel == 0) { 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", ":endwhile" or * ":endfor" was detected by the ":finally" itself. */ if (cstack.cs_lflags & CSL_HAD_FINA) { cstack.cs_lflags &= ~CSL_HAD_FINA; 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 (across 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, :for 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 #ifdef FEAT_EVAL /* Keep going when inside try/catch, so that the error can be * deal with, except when it is a syntax error, it may cause * the :endtry to be missed. */ && (cstack.cs_trylevel == 0 || did_emsg_syntax) #endif && used_getline && (getline_equal(fgetline, cookie, getexmodeline) || getline_equal(fgetline, cookie, getexline))) && (next_cmdline != NULL #ifdef FEAT_EVAL || cstack.cs_idx >= 0 #endif || (flags & DOCMD_REPEAT))); vim_free(cmdline_copy); did_emsg_syntax = FALSE; #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(fgetline, cookie, getsourceline) && !source_finished(fgetline, cookie)) || (getline_equal(fgetline, 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 if (cstack.cs_flags[cstack.cs_idx] & CSF_FOR) EMSG(_(e_endfor)); 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. * Also cleanup any "cs_forinfo" structures. */ do { int idx = cleanup_conditionals(&cstack, 0, TRUE); if (idx >= 0) --idx; /* remove try block not in its finally clause */ rewind_conditionals(&cstack, idx, CSF_WHILE | CSF_FOR, &cstack.cs_looplevel); } while (cstack.cs_idx >= 0); trylevel = initial_trylevel; } /* If a missing ":endtry", ":endwhile", ":endfor", 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(fgetline, 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: vim_snprintf((char *)IObuff, IOSIZE, _("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(fgetline, cookie, getsourceline) && ex_nesting_level > source_level(real_cookie)) || (getline_equal(fgetline, 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(fgetline, 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(fgetline, cookie, getsourceline) || getline_equal(fgetline, cookie, get_func_line)) && ex_nesting_level + 1 <= debug_break_level) do_debug(getline_equal(fgetline, 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) restore_dbg_stuff(&debug_saved); 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); } } #ifdef FEAT_EVAL did_endif = FALSE; /* in case do_cmdline used recursively */ #else /* * 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" or ":for" loop. */ static char_u * get_loop_line(int c, void *cookie, int indent) { struct loop_cookie *cp = (struct loop_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 ":endwhile"/":endfor" */ /* First time inside the ":while"/":for": get line normally. */ if (cp->getline == NULL) line = getcmdline(c, 0L, indent); else line = cp->getline(c, cp->cookie, indent); if (line != NULL && store_loop_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_loop_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; return OK; } /* * Free the lines stored for a ":while" or ":for" loop. */ static void free_cmdlines(garray_T *gap) { while (gap->ga_len > 0) { vim_free(((wcmd_T *)(gap->ga_data))[gap->ga_len - 1].line); --gap->ga_len; } } #endif /* * If "fgetline" is get_loop_line(), return TRUE if the getline it uses equals * "func". * Otherwise return TRUE when "fgetline" equals "func". */ int getline_equal( char_u *(*fgetline)(int, void *, int), void *cookie UNUSED, /* argument for fgetline() */ char_u *(*func)(int, void *, int)) { #ifdef FEAT_EVAL char_u *(*gp)(int, void *, int); struct loop_cookie *cp; /* When "fgetline" is "get_loop_line()" use the "cookie" to find the * function that's originally used to obtain the lines. This may be * nested several levels. */ gp = fgetline; cp = (struct loop_cookie *)cookie; while (gp == get_loop_line) { gp = cp->getline; cp = cp->cookie; } return gp == func; #else return fgetline == func; #endif } #if defined(FEAT_EVAL) || defined(FEAT_MBYTE) || defined(PROTO) /* * If "fgetline" is get_loop_line(), return the cookie used by the original * getline function. Otherwise return "cookie". */ void * getline_cookie( char_u *(*fgetline)(int, void *, int) UNUSED, void *cookie) /* argument for fgetline() */ { # ifdef FEAT_EVAL char_u *(*gp)(int, void *, int); struct loop_cookie *cp; /* When "fgetline" is "get_loop_line()" use the "cookie" to find the * cookie that's originally used to obtain the lines. This may be nested * several levels. */ gp = fgetline; cp = (struct loop_cookie *)cookie; while (gp == get_loop_line) { gp = cp->getline; cp = cp->cookie; } return cp; # else return cookie; # endif } #endif /* * Helper function to apply an offset for buffer commands, i.e. ":bdelete", * ":bwipeout", etc. * Returns the buffer number. */ static int compute_buffer_local_count(int addr_type, int lnum, int offset) { buf_T *buf; buf_T *nextbuf; int count = offset; buf = firstbuf; while (buf->b_next != NULL && buf->b_fnum < lnum) buf = buf->b_next; while (count != 0) { count += (offset < 0) ? 1 : -1; nextbuf = (offset < 0) ? buf->b_prev : buf->b_next; if (nextbuf == NULL) break; buf = nextbuf; if (addr_type == ADDR_LOADED_BUFFERS) /* skip over unloaded buffers */ while (buf->b_ml.ml_mfp == NULL) { nextbuf = (offset < 0) ? buf->b_prev : buf->b_next; if (nextbuf == NULL) break; buf = nextbuf; } } /* we might have gone too far, last buffer is not loadedd */ if (addr_type == ADDR_LOADED_BUFFERS) while (buf->b_ml.ml_mfp == NULL) { nextbuf = (offset >= 0) ? buf->b_prev : buf->b_next; if (nextbuf == NULL) break; buf = nextbuf; } return buf->b_fnum; } #ifdef FEAT_WINDOWS static int current_win_nr(win_T *win); static int current_tab_nr(tabpage_T *tab); static int current_win_nr(win_T *win) { win_T *wp; int nr = 0; for (wp = firstwin; wp != NULL; wp = wp->w_next) { ++nr; if (wp == win) break; } return nr; } static int current_tab_nr(tabpage_T *tab) { tabpage_T *tp; int nr = 0; for (tp = first_tabpage; tp != NULL; tp = tp->tp_next) { ++nr; if (tp == tab) break; } return nr; } # define CURRENT_WIN_NR current_win_nr(curwin) # define LAST_WIN_NR current_win_nr(NULL) # define CURRENT_TAB_NR current_tab_nr(curtab) # define LAST_TAB_NR current_tab_nr(NULL) #else # define CURRENT_WIN_NR 1 # define LAST_WIN_NR 1 # define CURRENT_TAB_NR 1 # define LAST_TAB_NR 1 #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. find the command * 4. parse range * 5. Parse the command. * 6. parse arguments * 7. switch on command name * * Note: "fgetline" can be NULL. * * This function may be called recursively! */ #if (_MSC_VER == 1200) /* * Avoid optimisation bug in VC++ version 6.0 */ #pragma optimize( "g", off ) #endif static char_u * do_one_cmd( char_u **cmdlinep, int sourcing, #ifdef FEAT_EVAL struct condstack *cstack, #endif char_u *(*fgetline)(int, void *, int), void *cookie) /* argument for fgetline() */ { 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 = msg_scroll; int save_msg_silent = -1; int did_esilent = 0; #ifdef HAVE_SANDBOX int did_sandbox = FALSE; #endif cmdmod_T save_cmdmod; int ni; /* set when Not Implemented */ char_u *cmd; vim_memset(&ea, 0, sizeof(ea)); ea.line1 = 1; ea.line2 = 1; #ifdef FEAT_EVAL ++ex_nesting_level; #endif /* When the last file has not been edited :q has to be typed twice. */ if (quitmore #ifdef FEAT_EVAL /* avoid that a function call in 'statusline' does this */ && !getline_equal(fgetline, cookie, get_func_line) #endif #ifdef FEAT_AUTOCMD /* avoid that an autocommand, e.g. QuitPre, does this */ && !getline_equal(fgetline, cookie, getnextac) #endif ) --quitmore; /* * Reset browse, confirm, etc.. They are restored when returning, for * recursive calls. */ save_cmdmod = cmdmod; vim_memset(&cmdmod, 0, sizeof(cmdmod)); /* "#!anything" is handled like a comment. */ if ((*cmdlinep)[0] == '#' && (*cmdlinep)[1] == '!') goto doend; /* * 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(fgetline, cookie, getexmodeline) || getline_equal(fgetline, cookie, getexline)) && curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count) { ea.cmd = (char_u *)"+"; ex_pressedreturn = TRUE; } /* ignore comment and empty lines */ if (*ea.cmd == '"') goto doend; if (*ea.cmd == NUL) { ex_pressedreturn = TRUE; 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_CMD 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, "keepalt", 5)) { cmdmod.keepalt = TRUE; continue; } if (checkforcmd(&ea.cmd, "keeppatterns", 5)) { cmdmod.keeppatterns = 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 'n': if (checkforcmd(&ea.cmd, "noautocmd", 3)) { #ifdef FEAT_AUTOCMD if (cmdmod.save_ei == NULL) { /* Set 'eventignore' to "all". Restore the * existing option value later. */ cmdmod.save_ei = vim_strsave(p_ei); set_string_option_direct((char_u *)"ei", -1, (char_u *)"all", OPT_FREE, SID_NONE); } #endif continue; } if (!checkforcmd(&ea.cmd, "noswapfile", 6)) break; cmdmod.noswapfile = TRUE; 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, "sandbox", 3)) { #ifdef HAVE_SANDBOX if (!did_sandbox) ++sandbox; did_sandbox = TRUE; #endif continue; } if (!checkforcmd(&ea.cmd, "silent", 3)) break; if (save_msg_silent == -1) save_msg_silent = msg_silent; ++msg_silent; 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(&p, "tab", 3)) { #ifdef FEAT_WINDOWS if (vim_isdigit(*ea.cmd)) cmdmod.tab = atoi((char *)ea.cmd) + 1; else cmdmod.tab = tabpage_index(curtab) + 1; ea.cmd = p; #endif continue; } if (!checkforcmd(&ea.cmd, "topleft", 2)) break; #ifdef FEAT_WINDOWS cmdmod.split |= WSP_TOP; #endif continue; case 'u': if (!checkforcmd(&ea.cmd, "unsilent", 3)) break; if (save_msg_silent == -1) save_msg_silent = msg_silent; msg_silent = 0; continue; case 'v': if (checkforcmd(&ea.cmd, "vertical", 4)) { #ifdef FEAT_WINDOWS cmdmod.split |= WSP_VERT; #endif continue; } if (!checkforcmd(&p, "verbose", 4)) break; if (verbose_save < 0) verbose_save = p_verbose; if (vim_isdigit(*ea.cmd)) p_verbose = atoi((char *)ea.cmd); else 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 # ifdef FEAT_PROFILE /* Count this line for profiling if ea.skip is FALSE. */ if (do_profiling == PROF_YES && !ea.skip) { if (getline_equal(fgetline, cookie, get_func_line)) func_line_exec(getline_cookie(fgetline, cookie)); else if (getline_equal(fgetline, cookie, getsourceline)) script_line_exec(); } #endif /* 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. Skip over the range to find the command. Let "p" point to after it. * * We need the command to know what kind of range it uses. */ cmd = ea.cmd; ea.cmd = skip_range(ea.cmd, NULL); if (*ea.cmd == '*' && vim_strchr(p_cpo, CPO_STAR) == NULL) ea.cmd = skipwhite(ea.cmd + 1); p = find_command(&ea, NULL); /* * 4. 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. */ /* ea.addr_type for user commands is set by find_ucmd */ if (!IS_USER_CMDIDX(ea.cmdidx)) { if (ea.cmdidx != CMD_SIZE) ea.addr_type = cmdnames[(int)ea.cmdidx].cmd_addr_type; else ea.addr_type = ADDR_LINES; #ifdef FEAT_WINDOWS /* :wincmd range depends on the argument. */ if (ea.cmdidx == CMD_wincmd && p != NULL) get_wincmd_addr_type(skipwhite(p), &ea); #endif } /* repeat for all ',' or ';' separated addresses */ ea.cmd = cmd; for (;;) { ea.line1 = ea.line2; switch (ea.addr_type) { case ADDR_LINES: /* default is current line number */ ea.line2 = curwin->w_cursor.lnum; break; case ADDR_WINDOWS: lnum = CURRENT_WIN_NR; ea.line2 = lnum; break; case ADDR_ARGUMENTS: ea.line2 = curwin->w_arg_idx + 1; if (ea.line2 > ARGCOUNT) ea.line2 = ARGCOUNT; break; case ADDR_LOADED_BUFFERS: case ADDR_BUFFERS: ea.line2 = curbuf->b_fnum; break; case ADDR_TABS: lnum = CURRENT_TAB_NR; ea.line2 = lnum; break; #ifdef FEAT_QUICKFIX case ADDR_QUICKFIX: ea.line2 = qf_get_cur_valid_idx(&ea); break; #endif } ea.cmd = skipwhite(ea.cmd); lnum = get_address(&ea, &ea.cmd, ea.addr_type, ea.skip, ea.addr_count == 0); if (ea.cmd == NULL) /* error detected */ goto doend; if (lnum == MAXLNUM) { if (*ea.cmd == '%') /* '%' - all lines */ { ++ea.cmd; switch (ea.addr_type) { case ADDR_LINES: ea.line1 = 1; ea.line2 = curbuf->b_ml.ml_line_count; break; case ADDR_LOADED_BUFFERS: { buf_T *buf = firstbuf; while (buf->b_next != NULL && buf->b_ml.ml_mfp == NULL) buf = buf->b_next; ea.line1 = buf->b_fnum; buf = lastbuf; while (buf->b_prev != NULL && buf->b_ml.ml_mfp == NULL) buf = buf->b_prev; ea.line2 = buf->b_fnum; break; } case ADDR_BUFFERS: ea.line1 = firstbuf->b_fnum; ea.line2 = lastbuf->b_fnum; break; case ADDR_WINDOWS: case ADDR_TABS: if (IS_USER_CMDIDX(ea.cmdidx)) { ea.line1 = 1; ea.line2 = ea.addr_type == ADDR_WINDOWS ? LAST_WIN_NR : LAST_TAB_NR; } else { /* there is no Vim command which uses '%' and * ADDR_WINDOWS or ADDR_TABS */ errormsg = (char_u *)_(e_invrange); goto doend; } break; case ADDR_ARGUMENTS: if (ARGCOUNT == 0) ea.line1 = ea.line2 = 0; else { ea.line1 = 1; ea.line2 = ARGCOUNT; } break; #ifdef FEAT_QUICKFIX case ADDR_QUICKFIX: ea.line1 = 1; ea.line2 = qf_get_size(&ea); if (ea.line2 == 0) ea.line2 = 1; break; #endif } ++ea.addr_count; } /* '*' - visual area */ else if (*ea.cmd == '*' && vim_strchr(p_cpo, CPO_STAR) == NULL) { pos_T *fp; if (ea.addr_type != ADDR_LINES) { errormsg = (char_u *)_(e_invrange); goto doend; } ++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(); /* * 5. Parse the 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 == '|' || (exmode_active && ea.line1 != ea.line2)) { 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 > curbuf->b_ml.ml_line_count) { /* With '-' in 'cpoptions' a line number past the file is an * error, otherwise put it at the end of the file. */ if (vim_strchr(p_cpo, CPO_MINUS) != NULL) ea.line2 = -1; else ea.line2 = curbuf->b_ml.ml_line_count; } if (ea.line2 < 0) errormsg = (char_u *)_(e_invrange); else { if (ea.line2 == 0) curwin->w_cursor.lnum = 1; else curwin->w_cursor.lnum = ea.line2; beginline(BL_SOL | BL_FIX); } } goto doend; } #ifdef FEAT_AUTOCMD /* If this looks like an undefined user command and there are CmdUndefined * autocommands defined, trigger the matching autocommands. */ if (p != NULL && ea.cmdidx == CMD_SIZE && !ea.skip && ASCII_ISUPPER(*ea.cmd) && has_cmdundefined()) { int ret; p = ea.cmd; while (ASCII_ISALNUM(*p)) ++p; p = vim_strnsave(ea.cmd, (int)(p - ea.cmd)); ret = apply_autocmds(EVENT_CMDUNDEFINED, p, p, TRUE, NULL); vim_free(p); /* If the autocommands did something and didn't cause an error, try * finding the command again. */ p = (ret && !aborting()) ? find_command(&ea, NULL) : NULL; } #endif #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) append_command(*cmdlinep); errormsg = IObuff; did_emsg_syntax = TRUE; } goto doend; } ni = (!IS_USER_CMDIDX(ea.cmdidx) && (cmdnames[ea.cmdidx].cmd_func == ex_ni #ifdef HAVE_EX_SCRIPT_NI || cmdnames[ea.cmdidx].cmd_func == ex_script_ni #endif )); #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 /* forced commands */ if (*p == '!' && ea.cmdidx != CMD_substitute && ea.cmdidx != CMD_smagic && ea.cmdidx != CMD_snomagic) { ++p; ea.forceit = TRUE; } else ea.forceit = FALSE; /* * 6. Parse arguments. */ if (!IS_USER_CMDIDX(ea.cmdidx)) ea.argt = (long)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; } if (text_locked() && !(ea.argt & CMDWIN) && !IS_USER_CMDIDX(ea.cmdidx)) { /* Command not allowed when editing the command line. */ #ifdef FEAT_CMDWIN if (cmdwin_type != 0) errormsg = (char_u *)_(e_cmdwin); else #endif errormsg = (char_u *)_(e_secure); goto doend; } #ifdef FEAT_AUTOCMD /* Disallow editing another buffer when "curbuf_lock" is set. * Do allow ":edit" (check for argument later). * Do allow ":checktime" (it's postponed). */ if (!(ea.argt & CMDWIN) && ea.cmdidx != CMD_edit && ea.cmdidx != CMD_checktime && !IS_USER_CMDIDX(ea.cmdidx) && curbuf_locked()) 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 (msg_silent == 0) { if (sourcing || exmode_active) { errormsg = (char_u *)_("E493: Backwards range given"); goto doend; } if (ask_yesno((char_u *) _("Backwards range given, OK to swap"), FALSE) != 'y') goto doend; } 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 && ea.addr_type == ADDR_LINES) { /* 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. */ p = replace_makeprg(&ea, p, cmdlinep); if (p == NULL) goto doend; #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 to end a shell command. * Also do this for ":read !cmd", ":write !cmd" and ":global". * Any others? */ else if (ea.cmdidx == CMD_bang || ea.cmdidx == CMD_global || ea.cmdidx == CMD_vglobal || 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') STRMOVE(p, p + 1); else if (*p == '\n') { ea.nextcmd = p + 1; *p = NUL; break; } } } if ((ea.argt & DFLALL) && ea.addr_count == 0) { buf_T *buf; ea.line1 = 1; switch (ea.addr_type) { case ADDR_LINES: ea.line2 = curbuf->b_ml.ml_line_count; break; case ADDR_LOADED_BUFFERS: buf = firstbuf; while (buf->b_next != NULL && buf->b_ml.ml_mfp == NULL) buf = buf->b_next; ea.line1 = buf->b_fnum; buf = lastbuf; while (buf->b_prev != NULL && buf->b_ml.ml_mfp == NULL) buf = buf->b_prev; ea.line2 = buf->b_fnum; break; case ADDR_BUFFERS: ea.line1 = firstbuf->b_fnum; ea.line2 = lastbuf->b_fnum; break; case ADDR_WINDOWS: ea.line2 = LAST_WIN_NR; break; case ADDR_TABS: ea.line2 = LAST_TAB_NR; break; case ADDR_ARGUMENTS: if (ARGCOUNT == 0) ea.line1 = ea.line2 = 0; else ea.line2 = ARGCOUNT; break; #ifdef FEAT_QUICKFIX case ADDR_QUICKFIX: ea.line2 = qf_get_size(&ea); if (ea.line2 == 0) ea.line2 = 1; break; #endif } } /* accept numbered register only when no count allowed (:put) */ if ( (ea.argt & REGSTR) && *ea.arg != NUL /* Do not allow register = for user commands */ && (!IS_USER_CMDIDX(ea.cmdidx) || *ea.arg != '=') && !((ea.argt & COUNT) && VIM_ISDIGIT(*ea.arg))) { #ifndef FEAT_CLIPBOARD /* check these explicitly for a more specific error message */ if (*ea.arg == '*' || *ea.arg == '+') { errormsg = (char_u *)_(e_invalidreg); goto doend; } #endif if (valid_yank_reg(*ea.arg, (ea.cmdidx != CMD_put && !IS_USER_CMDIDX(ea.cmdidx)))) { 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 && (ea.argt & ZEROR) == 0) { 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; } } /* * Check for flags: 'l', 'p' and '#'. */ if (ea.argt & EXFLAGS) get_flags(&ea); /* no arguments allowed */ if (!ni && !(ea.argt & EXTRA) && *ea.arg != NUL && *ea.arg != '"' && (*ea.arg != '|' || (ea.argt & TRLBAR) == 0)) { 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_for: case CMD_endfor: 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_keepalt: case CMD_keepjumps: case CMD_keepmarks: case CMD_keeppatterns: case CMD_leftabove: case CMD_let: case CMD_lockmarks: case CMD_lua: case CMD_match: case CMD_mzscheme: case CMD_noautocmd: case CMD_noswapfile: case CMD_perl: case CMD_psearch: case CMD_python: case CMD_py3: case CMD_python3: 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_tab: case CMD_tcl: case CMD_throw: case CMD_tilde: case CMD_topleft: case CMD_unlet: case CMD_verbose: case CMD_vertical: case CMD_wincmd: 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 && !IS_USER_CMDIDX(ea.cmdidx)) { /* * :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, FALSE); if (ea.line2 < 0) /* failed */ goto doend; ea.addr_count = 1; ea.arg = skipwhite(p); } #endif /* * 7. Switch on command name. * * The "ea" structure holds the arguments that can be used. */ ea.cmdlinep = cmdlinep; ea.getline = fgetline; ea.cookie = cookie; #ifdef FEAT_EVAL ea.cstack = cstack; #endif #ifdef FEAT_USR_CMDS if (IS_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(fgetline, cookie)) do_finish(&ea, TRUE); else if (getline_equal(fgetline, 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; } append_command(*cmdlinep); } emsg(errormsg); } #ifdef FEAT_EVAL do_errthrow(cstack, (ea.cmdidx != CMD_SIZE && !IS_USER_CMDIDX(ea.cmdidx)) ? cmdnames[(int)ea.cmdidx].cmd_name : (char_u *)NULL); #endif if (verbose_save >= 0) p_verbose = verbose_save; #ifdef FEAT_AUTOCMD if (cmdmod.save_ei != NULL) { /* Restore 'eventignore' to the value before ":noautocmd". */ set_string_option_direct((char_u *)"ei", -1, cmdmod.save_ei, OPT_FREE, SID_NONE); free_string_option(cmdmod.save_ei); } #endif cmdmod = save_cmdmod; if (save_msg_silent != -1) { /* messages could be enabled for a serious error, need to check if the * counters don't become negative */ if (!did_emsg || msg_silent > save_msg_silent) msg_silent = save_msg_silent; 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; /* "silent reg" or "silent echo x" inside "redir" leaves msg_col * somewhere in the line. Put it back in the first column. */ if (redirecting()) msg_col = 0; } #ifdef HAVE_SANDBOX if (did_sandbox) --sandbox; #endif 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 an Ex command with optional tail. * If there is a match advance "pp" to the argument and return TRUE. */ int checkforcmd( char_u **pp, /* start of command */ char *cmd, /* name of command */ int len) /* required length */ { int i; for (i = 0; cmd[i] != NUL; ++i) if (((char_u *)cmd)[i] != (*pp)[i]) break; if (i >= len && !isalpha((*pp)[i])) { *pp = skipwhite(*pp + i); return TRUE; } return FALSE; } /* * Append "cmd" to the error message in IObuff. * Takes care of limiting the length and handling 0xa0, which would be * invisible otherwise. */ static void append_command(char_u *cmd) { char_u *s = cmd; char_u *d; STRCAT(IObuff, ": "); d = IObuff + STRLEN(IObuff); while (*s != NUL && d - IObuff < IOSIZE - 7) { if ( #ifdef FEAT_MBYTE enc_utf8 ? (s[0] == 0xc2 && s[1] == 0xa0) : #endif *s == 0xa0) { s += #ifdef FEAT_MBYTE enc_utf8 ? 2 : #endif 1; STRCPY(d, ""); d += 4; } else MB_COPY_CHAR(s, d); } *d = NUL; } /* * Find an Ex command by its name, either built-in or user. * Start of the name can be found at eap->cmd. * Returns pointer to char after the command name. * "full" is set to TRUE if the whole command name matched. * Returns NULL for an ambiguous user command. */ static char_u * find_command(exarg_T *eap, int *full UNUSED) { int len; char_u *p; int i; /* * Isolate the command and search for it in the command table. * Exceptions: * - 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 :scr[iptnames], * :scs[cope], :sim[alt], :sig[ns] and :sil[ent]. * - the "d" command can directly be followed by 'l' or 'p' flag. */ p = eap->cmd; if (*p == 'k') { eap->cmdidx = CMD_k; ++p; } else if (p[0] == 's' && ((p[1] == 'c' && (p[2] == NUL || (p[2] != 's' && p[2] != 'r' && (p[3] == NUL || (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; /* for python 3.x support ":py3", ":python3", ":py3file", etc. */ if (eap->cmd[0] == 'p' && eap->cmd[1] == 'y') while (ASCII_ISALNUM(*p)) ++p; /* check for non-alpha command */ if (p == eap->cmd && vim_strchr((char_u *)"@*!=><&~#", *p) != NULL) ++p; len = (int)(p - eap->cmd); if (*eap->cmd == 'd' && (p[-1] == 'l' || p[-1] == 'p')) { /* Check for ":dl", ":dell", etc. to ":deletel": that's * :delete with the 'l' flag. Same for 'p'. */ for (i = 0; i < len; ++i) if (eap->cmd[i] != ((char_u *)"delete")[i]) break; if (i == len - 1) { --len; if (p[-1] == 'l') eap->flags |= EXFLAG_LIST; else eap->flags |= EXFLAG_PRINT; } } 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. Let ":Print" be * overruled by a user defined command. */ if ((eap->cmdidx == CMD_SIZE || eap->cmdidx == CMD_Print) && *eap->cmd >= 'A' && *eap->cmd <= 'Z') { /* User defined commands may contain digits. */ while (ASCII_ISALNUM(*p)) ++p; p = find_ucmd(eap, p, full, NULL, NULL); } #endif if (p == eap->cmd) eap->cmdidx = CMD_SIZE; } return p; } #ifdef FEAT_USR_CMDS /* * Search for a user command that matches "eap->cmd". * Return cmdidx in "eap->cmdidx", flags in "eap->argt", idx in "eap->useridx". * Return a pointer to just after the command. * Return NULL if there is no matching command. */ static char_u * find_ucmd( exarg_T *eap, char_u *p, /* end of the command (possibly including count) */ int *full, /* set to TRUE for a full match */ expand_T *xp, /* used for completion, NULL otherwise */ int *compl) /* completion flags or NULL */ { int len = (int)(p - eap->cmd); int j, k, matchlen = 0; ucmd_T *uc; int found = FALSE; int 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. */ /* * Look for buffer-local user commands first, then global ones. */ gap = &curbuf->b_ucmds; for (;;) { for (j = 0; j < gap->ga_len; ++j) { uc = USER_CMD_GA(gap, j); cp = eap->cmd; np = uc->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 = (long)uc->uc_argt; eap->useridx = j; eap->addr_type = uc->uc_addr_type; # ifdef FEAT_CMDL_COMPL if (compl != NULL) *compl = uc->uc_compl; # ifdef FEAT_EVAL if (xp != NULL) { 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 == 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) { if (xp != NULL) xp->xp_context = EXPAND_UNSUCCESSFUL; return NULL; } /* The match we found may be followed immediately by a number. Move "p" * back to point to it. */ if (found || possible) return p + (matchlen - len); return p; } #endif #if defined(FEAT_EVAL) || defined(PROTO) static struct cmdmod { char *name; int minlen; int has_count; /* :123verbose :3tab */ } cmdmods[] = { {"aboveleft", 3, FALSE}, {"belowright", 3, FALSE}, {"botright", 2, FALSE}, {"browse", 3, FALSE}, {"confirm", 4, FALSE}, {"hide", 3, FALSE}, {"keepalt", 5, FALSE}, {"keepjumps", 5, FALSE}, {"keepmarks", 3, FALSE}, {"keeppatterns", 5, FALSE}, {"leftabove", 5, FALSE}, {"lockmarks", 3, FALSE}, {"noautocmd", 3, FALSE}, {"noswapfile", 3, FALSE}, {"rightbelow", 6, FALSE}, {"sandbox", 3, FALSE}, {"silent", 3, FALSE}, {"tab", 3, TRUE}, {"topleft", 2, FALSE}, {"unsilent", 3, FALSE}, {"verbose", 4, TRUE}, {"vertical", 4, FALSE}, }; /* * Return length of a command modifier (including optional count). * Return zero when it's not a modifier. */ int modifier_len(char_u *cmd) { int i, j; char_u *p = cmd; if (VIM_ISDIGIT(*cmd)) p = skipwhite(skipdigits(cmd)); for (i = 0; i < (int)(sizeof(cmdmods) / sizeof(struct cmdmod)); ++i) { for (j = 0; p[j] != NUL; ++j) if (p[j] != cmdmods[i].name[j]) break; if (!ASCII_ISALPHA(p[j]) && j >= cmdmods[i].minlen && (p == cmd || cmdmods[i].has_count)) return j + (int)(p - cmd); } return 0; } /* * 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(char_u *name) { exarg_T ea; int full = FALSE; int i; int j; char_u *p; /* Check command modifiers. */ for (i = 0; i < (int)(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. * For ":2match" and ":3match" we need to skip the number. */ ea.cmd = (*name == '2' || *name == '3') ? name + 1 : name; ea.cmdidx = (cmdidx_T)0; p = find_command(&ea, &full); if (p == NULL) return 3; if (vim_isdigit(*name) && ea.cmdidx != CMD_match) return 0; if (*skipwhite(p) != NUL) return 0; /* trailing garbage */ 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( expand_T *xp, char_u *buff) /* buffer for command string */ { char_u *p; char_u *cmd, *arg; int len = 0; exarg_T ea; #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 */ ExpandInit(xp); xp->xp_pattern = buff; xp->xp_context = EXPAND_COMMANDS; /* Default until we get past command */ ea.argt = 0; /* * 1. 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. Skip over the range to find the command. */ cmd = skip_range(cmd, &xp->xp_context); 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", "keepalt" and "keepjumps". * - the 's' command can be followed directly by 'c', 'g', 'i', 'I' or 'r' */ if (*cmd == 'k' && cmd[1] != 'e') { ea.cmdidx = CMD_k; p = cmd + 1; } else { p = cmd; while (ASCII_ISALPHA(*p) || *p == '*') /* Allow * wild card */ ++p; /* a user command may contain digits */ if (ASCII_ISUPPER(cmd[0])) while (ASCII_ISALNUM(*p) || *p == '*') ++p; /* for python 3.x: ":py3*" commands completion */ if (cmd[0] == 'p' && cmd[1] == 'y' && p == cmd + 2 && *p == '3') { ++p; while (ASCII_ISALPHA(*p) || *p == '*') ++p; } /* check for non-alpha command */ if (p == cmd && vim_strchr((char_u *)"@*!=><&~#", *p) != NULL) ++p; len = (int)(p - cmd); if (len == 0) { xp->xp_context = EXPAND_UNSUCCESSFUL; return NULL; } for (ea.cmdidx = (cmdidx_T)0; (int)ea.cmdidx < (int)CMD_SIZE; ea.cmdidx = (cmdidx_T)((int)ea.cmdidx + 1)) if (STRNCMP(cmdnames[(int)ea.cmdidx].cmd_name, cmd, (size_t)len) == 0) break; #ifdef FEAT_USR_CMDS if (cmd[0] >= 'A' && cmd[0] <= 'Z') while (ASCII_ISALNUM(*p) || *p == '*') /* Allow * wild card */ ++p; #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 (ea.cmdidx == CMD_SIZE) { if (*cmd == 's' && vim_strchr((char_u *)"cgriI", cmd[1]) != NULL) { ea.cmdidx = CMD_substitute; p = cmd + 1; } #ifdef FEAT_USR_CMDS else if (cmd[0] >= 'A' && cmd[0] <= 'Z') { ea.cmd = cmd; p = find_ucmd(&ea, p, NULL, xp, # if defined(FEAT_CMDL_COMPL) &compl # else NULL # endif ); if (p == NULL) ea.cmdidx = CMD_SIZE; /* ambiguous user command */ } #endif } if (ea.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; } /* * 6. parse arguments */ if (!IS_USER_CMDIDX(ea.cmdidx)) ea.argt = (long)cmdnames[(int)ea.cmdidx].cmd_argt; arg = skipwhite(p); if (ea.cmdidx == CMD_write || ea.cmdidx == CMD_update) { if (*arg == '>') /* append */ { if (*++arg == '>') ++arg; arg = skipwhite(arg); } else if (*arg == '!' && ea.cmdidx == CMD_write) /* :w !filter */ { ++arg; usefilter = TRUE; } } if (ea.cmdidx == CMD_read) { usefilter = forceit; /* :r! filter if forced */ if (*arg == '!') /* :r !filter */ { ++arg; usefilter = TRUE; } } if (ea.cmdidx == CMD_lshift || ea.cmdidx == CMD_rshift) { while (*arg == *cmd) /* allow any number of '>' or '<' */ ++arg; arg = skipwhite(arg); } /* Does command allow "+command"? */ if ((ea.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 ((ea.argt & TRLBAR) && !usefilter) { p = arg; /* ":redir @" is not the start of a comment */ if (ea.cmdidx == CMD_redir && p[0] == '@' && p[1] == '"') p += 2; while (*p) { if (*p == Ctrl_V) { if (p[1] != NUL) ++p; } else if ( (*p == '"' && !(ea.argt & NOTRLCOM)) || *p == '|' || *p == '\n') { if (*(p - 1) != '\\') { if (*p == '|' || *p == '\n') return p + 1; return NULL; /* It's a comment */ } } mb_ptr_adv(p); } } /* no arguments allowed */ if (!(ea.argt & EXTRA) && *arg != NUL && vim_strchr((char_u *)"|\"", *arg) == NULL) return NULL; /* Find start of last argument (argument just before cursor): */ p = buff; xp->xp_pattern = p; len = (int)STRLEN(buff); while (*p && p < buff + len) { if (*p == ' ' || *p == TAB) { /* argument starts after a space */ xp->xp_pattern = ++p; } else { if (*p == '\\' && *(p + 1) != NUL) ++p; /* skip over escaped character */ mb_ptr_adv(p); } } if (ea.argt & XFILE) { int c; 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); p = xp->xp_pattern; while (*p != NUL) { #ifdef FEAT_MBYTE if (has_mbyte) c = mb_ptr2char(p); else #endif c = *p; if (c == '\\' && p[1] != NUL) ++p; else if (c == '`') { if (!in_quote) { xp->xp_pattern = p; bow = p + 1; } in_quote = !in_quote; } /* An argument can contain just about everything, except * characters that end the command and white space. */ else if (c == '|' || c == '\n' || c == '"' || (vim_iswhite(c) #ifdef SPACE_IN_FILENAME && (!(ea.argt & NOSPC) || usefilter) #endif )) { len = 0; /* avoid getting stuck when space is in 'isfname' */ while (*p != NUL) { #ifdef FEAT_MBYTE if (has_mbyte) c = mb_ptr2char(p); else #endif c = *p; if (c == '`' || vim_isfilec_or_wc(c)) break; #ifdef FEAT_MBYTE if (has_mbyte) len = (*mb_ptr2len)(p); else #endif len = 1; mb_ptr_adv(p); } if (in_quote) bow = p; else xp->xp_pattern = p; p -= len; } mb_ptr_adv(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; /* For a shell command more chars need to be escaped. */ if (usefilter || ea.cmdidx == CMD_bang) { #ifndef BACKSLASH_IN_FILENAME xp->xp_shell = TRUE; #endif /* When still after the command name expand executables. */ if (xp->xp_pattern == skipwhite(arg)) xp->xp_context = EXPAND_SHELLCMD; } /* Check for environment variable */ if (*xp->xp_pattern == '$' #if defined(MSWIN) || *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; #if defined(FEAT_USR_CMDS) && defined(FEAT_CMDL_COMPL) /* Avoid that the assignment uses EXPAND_FILES again. */ if (compl != EXPAND_USER_DEFINED && compl != EXPAND_USER_LIST) compl = EXPAND_ENV_VARS; #endif } } #if defined(FEAT_CMDL_COMPL) /* Check for user names */ if (*xp->xp_pattern == '~') { for (p = xp->xp_pattern + 1; *p != NUL && *p != '/'; ++p) ; /* Complete ~user only if it partially matches a user name. * A full match ~user will be replaced by user's home * directory i.e. something like ~user -> /home/user/ */ if (*p == NUL && p > xp->xp_pattern + 1 && match_user(xp->xp_pattern + 1) == 1) { xp->xp_context = EXPAND_USER; ++xp->xp_pattern; } } #endif } /* * 6. Switch on command name. */ switch (ea.cmdidx) { case CMD_find: case CMD_sfind: case CMD_tabfind: if (xp->xp_context == EXPAND_FILES) xp->xp_context = EXPAND_FILES_IN_PATH; break; 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. * Also for commands with an argument that is a command. */ case CMD_aboveleft: case CMD_argdo: case CMD_belowright: case CMD_botright: case CMD_browse: case CMD_bufdo: case CMD_cdo: case CMD_cfdo: case CMD_confirm: case CMD_debug: case CMD_folddoclosed: case CMD_folddoopen: case CMD_hide: case CMD_keepalt: case CMD_keepjumps: case CMD_keepmarks: case CMD_keeppatterns: case CMD_ldo: case CMD_leftabove: case CMD_lfdo: case CMD_lockmarks: case CMD_noautocmd: case CMD_noswapfile: case CMD_rightbelow: case CMD_sandbox: case CMD_silent: case CMD_tab: case CMD_tabdo: case CMD_topleft: case CMD_verbose: case CMD_vertical: case CMD_windo: return arg; #ifdef FEAT_CMDL_COMPL # ifdef FEAT_SEARCH_EXTRA case CMD_match: if (*arg == NUL || !ends_excmd(*arg)) { /* also complete "None" */ set_context_in_echohl_cmd(xp, 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 /* * 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, -nargs and -addr 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; } else if (STRNICMP(arg, "addr", p - arg) == 0) { xp->xp_context = EXPAND_USER_ADDR_TYPE; 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: case CMD_doautoall: 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_ltag: case CMD_tselect: case CMD_stselect: case CMD_ptselect: case CMD_tjump: case CMD_stjump: case CMD_ptjump: if (*p_wop != NUL) xp->xp_context = EXPAND_TAGS_LISTFILES; else 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_for: 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, ea.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: set_context_in_echohl_cmd(xp, arg); break; #endif case CMD_highlight: set_context_in_highlight_cmd(xp, arg); break; #ifdef FEAT_CSCOPE case CMD_cscope: case CMD_lcscope: case CMD_scscope: set_context_in_cscope_cmd(xp, arg, ea.cmdidx); break; #endif #ifdef FEAT_SIGNS case CMD_sign: set_context_in_sign_cmd(xp, arg); break; #endif #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 (!(ea.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); /* Find start of last argument. */ p = arg; while (*p) { if (*p == ' ') /* argument starts after a space */ arg = p + 1; else if (*p == '\\' && *(p + 1) != NUL) ++p; /* skip over escaped character */ mb_ptr_adv(p); } 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: case CMD_lmap: case CMD_lnoremap: case CMD_smap: case CMD_snoremap: case CMD_xmap: case CMD_xnoremap: return set_context_in_map_cmd(xp, cmd, arg, forceit, FALSE, FALSE, ea.cmdidx); case CMD_unmap: case CMD_nunmap: case CMD_vunmap: case CMD_ounmap: case CMD_iunmap: case CMD_cunmap: case CMD_lunmap: case CMD_sunmap: case CMD_xunmap: return set_context_in_map_cmd(xp, cmd, arg, forceit, FALSE, TRUE, ea.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, ea.cmdidx); case CMD_unabbreviate: case CMD_cunabbrev: case CMD_iunabbrev: return set_context_in_map_cmd(xp, cmd, arg, forceit, TRUE, TRUE, ea.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; case CMD_ownsyntax: xp->xp_context = EXPAND_OWNSYNTAX; xp->xp_pattern = arg; break; case CMD_setfiletype: xp->xp_context = EXPAND_FILETYPE; xp->xp_pattern = arg; break; case CMD_packadd: xp->xp_context = EXPAND_PACKADD; xp->xp_pattern = arg; break; #if (defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \ && (defined(FEAT_GETTEXT) || defined(FEAT_MBYTE)) case CMD_language: p = skiptowhite(arg); if (*p == NUL) { xp->xp_context = EXPAND_LANGUAGE; xp->xp_pattern = arg; } else { if ( STRNCMP(arg, "messages", p - arg) == 0 || STRNCMP(arg, "ctype", p - arg) == 0 || STRNCMP(arg, "time", p - arg) == 0) { xp->xp_context = EXPAND_LOCALES; xp->xp_pattern = skipwhite(p); } else xp->xp_context = EXPAND_NOTHING; } break; #endif #if defined(FEAT_PROFILE) case CMD_profile: set_context_in_profile_cmd(xp, arg); break; #endif case CMD_behave: xp->xp_context = EXPAND_BEHAVE; xp->xp_pattern = arg; break; #if defined(FEAT_CMDHIST) case CMD_history: xp->xp_context = EXPAND_HISTORY; xp->xp_pattern = arg; break; #endif #if defined(FEAT_PROFILE) case CMD_syntime: xp->xp_context = EXPAND_SYNTIME; xp->xp_pattern = arg; 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 "'". * * Also skip white space and ":" characters. * Returns the "cmd" pointer advanced to beyond the range. */ char_u * skip_range( char_u *cmd, int *ctx) /* pointer to xp_context or NULL */ { unsigned delim; while (vim_strchr((char_u *)" \t0123456789.$%'/?-+,;", *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; } /* Skip ":" and white space. */ while (*cmd == ':') cmd = skipwhite(cmd + 1); 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( exarg_T *eap UNUSED, char_u **ptr, int addr_type, /* flag: one of ADDR_LINES, ... */ 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; buf_T *buf; cmd = skipwhite(*ptr); lnum = MAXLNUM; do { switch (*cmd) { case '.': /* '.' - Cursor position */ ++cmd; switch (addr_type) { case ADDR_LINES: lnum = curwin->w_cursor.lnum; break; case ADDR_WINDOWS: lnum = CURRENT_WIN_NR; break; case ADDR_ARGUMENTS: lnum = curwin->w_arg_idx + 1; break; case ADDR_LOADED_BUFFERS: case ADDR_BUFFERS: lnum = curbuf->b_fnum; break; case ADDR_TABS: lnum = CURRENT_TAB_NR; break; #ifdef FEAT_QUICKFIX case ADDR_QUICKFIX: lnum = qf_get_cur_valid_idx(eap); break; #endif } break; case '$': /* '$' - last line */ ++cmd; switch (addr_type) { case ADDR_LINES: lnum = curbuf->b_ml.ml_line_count; break; case ADDR_WINDOWS: lnum = LAST_WIN_NR; break; case ADDR_ARGUMENTS: lnum = ARGCOUNT; break; case ADDR_LOADED_BUFFERS: buf = lastbuf; while (buf->b_ml.ml_mfp == NULL) { if (buf->b_prev == NULL) break; buf = buf->b_prev; } lnum = buf->b_fnum; break; case ADDR_BUFFERS: lnum = lastbuf->b_fnum; break; case ADDR_TABS: lnum = LAST_TAB_NR; break; #ifdef FEAT_QUICKFIX case ADDR_QUICKFIX: lnum = qf_get_size(eap); if (lnum == 0) lnum = 1; break; #endif } break; case '\'': /* ''' - mark */ if (*++cmd == NUL) { cmd = NULL; goto error; } if (addr_type != ADDR_LINES) { EMSG(_(e_invaddr)); 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 (addr_type != ADDR_LINES) { EMSG(_(e_invaddr)); cmd = NULL; goto error; } 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, NULL)) { 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 (addr_type != ADDR_LINES) { EMSG(_(e_invaddr)); cmd = NULL; goto error; } 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; #ifdef FEAT_VIRTUALEDIT pos.coladd = 0; #endif if (searchit(curwin, curbuf, &pos, *cmd == '?' ? BACKWARD : FORWARD, (char_u *)"", 1L, SEARCH_MSG, i, (linenr_T)0, NULL) != 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) { switch (addr_type) { case ADDR_LINES: /* "+1" is same as ".+1" */ lnum = curwin->w_cursor.lnum; break; case ADDR_WINDOWS: lnum = CURRENT_WIN_NR; break; case ADDR_ARGUMENTS: lnum = curwin->w_arg_idx + 1; break; case ADDR_LOADED_BUFFERS: case ADDR_BUFFERS: lnum = curbuf->b_fnum; break; case ADDR_TABS: lnum = CURRENT_TAB_NR; break; #ifdef FEAT_QUICKFIX case ADDR_QUICKFIX: lnum = qf_get_cur_valid_idx(eap); break; #endif } } 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 (addr_type == ADDR_LOADED_BUFFERS || addr_type == ADDR_BUFFERS) lnum = compute_buffer_local_count( addr_type, lnum, (i == '-') ? -1 * n : n); else if (i == '-') lnum -= n; else lnum += n; } } while (*cmd == '/' || *cmd == '?'); error: *ptr = cmd; return lnum; } /* * Get flags from an Ex command argument. */ static void get_flags(exarg_T *eap) { while (vim_strchr((char_u *)"lp#", *eap->arg) != NULL) { if (*eap->arg == 'l') eap->flags |= EXFLAG_LIST; else if (*eap->arg == 'p') eap->flags |= EXFLAG_PRINT; else eap->flags |= EXFLAG_NR; eap->arg = skipwhite(eap->arg + 1); } } /* * Function called for command which is Not Implemented. NI! */ void ex_ni(exarg_T *eap) { if (!eap->skip) eap->errmsg = (char_u *)N_("E319: Sorry, the command is not available in this version"); } #ifdef HAVE_EX_SCRIPT_NI /* * Function called for script command which is Not Implemented. NI! * Skips over ":perl <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(exarg_T *eap) { buf_T *buf; if ( eap->line1 < 0 || eap->line2 < 0 || eap->line1 > eap->line2) return (char_u *)_(e_invrange); if (eap->argt & RANGE) { switch(eap->addr_type) { case ADDR_LINES: if (!(eap->argt & NOTADR) && eap->line2 > curbuf->b_ml.ml_line_count #ifdef FEAT_DIFF + (eap->cmdidx == CMD_diffget) #endif ) return (char_u *)_(e_invrange); break; case ADDR_ARGUMENTS: /* add 1 if ARGCOUNT is 0 */ if (eap->line2 > ARGCOUNT + (!ARGCOUNT)) return (char_u *)_(e_invrange); break; case ADDR_BUFFERS: if (eap->line1 < firstbuf->b_fnum || eap->line2 > lastbuf->b_fnum) return (char_u *)_(e_invrange); break; case ADDR_LOADED_BUFFERS: buf = firstbuf; while (buf->b_ml.ml_mfp == NULL) { if (buf->b_next == NULL) return (char_u *)_(e_invrange); buf = buf->b_next; } if (eap->line1 < buf->b_fnum) return (char_u *)_(e_invrange); buf = lastbuf; while (buf->b_ml.ml_mfp == NULL) { if (buf->b_prev == NULL) return (char_u *)_(e_invrange); buf = buf->b_prev; } if (eap->line2 > buf->b_fnum) return (char_u *)_(e_invrange); break; case ADDR_WINDOWS: if (eap->line2 > LAST_WIN_NR) return (char_u *)_(e_invrange); break; case ADDR_TABS: if (eap->line2 > LAST_TAB_NR) return (char_u *)_(e_invrange); break; #ifdef FEAT_QUICKFIX case ADDR_QUICKFIX: if (eap->line2 != 1 && eap->line2 > qf_get_size(eap)) return (char_u *)_(e_invrange); break; #endif } } return NULL; } /* * Correct the range for zero line number, if required. */ static void correct_range(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; } } #ifdef FEAT_QUICKFIX static char_u *skip_grep_pat(exarg_T *eap); /* * For a ":vimgrep" or ":vimgrepadd" command return a pointer past the * pattern. Otherwise return eap->arg. */ static char_u * skip_grep_pat(exarg_T *eap) { char_u *p = eap->arg; if (*p != NUL && (eap->cmdidx == CMD_vimgrep || eap->cmdidx == CMD_lvimgrep || eap->cmdidx == CMD_vimgrepadd || eap->cmdidx == CMD_lvimgrepadd || grep_internal(eap->cmdidx))) { p = skip_vimgrep_pat(p, NULL, NULL); if (p == NULL) p = eap->arg; } return p; } /* * For the ":make" and ":grep" commands insert the 'makeprg'/'grepprg' option * in the command line, so that things like % get expanded. */ static char_u * replace_makeprg(exarg_T *eap, char_u *p, char_u **cmdlinep) { char_u *new_cmdline; char_u *program; char_u *pos; char_u *ptr; int len; int i; /* * Don't do it when ":vimgrep" is used for ":grep". */ if ((eap->cmdidx == CMD_make || eap->cmdidx == CMD_lmake || eap->cmdidx == CMD_grep || eap->cmdidx == CMD_lgrep || eap->cmdidx == CMD_grepadd || eap->cmdidx == CMD_lgrepadd) && !grep_internal(eap->cmdidx)) { if (eap->cmdidx == CMD_grep || eap->cmdidx == CMD_lgrep || eap->cmdidx == CMD_grepadd || eap->cmdidx == CMD_lgrepadd) { 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) return NULL; /* 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) return NULL; /* out of memory */ STRCPY(new_cmdline, program); STRCAT(new_cmdline, " "); STRCAT(new_cmdline, p); } msg_make(p); /* 'eap->cmd' is not set here, because it is not used at CMD_make */ vim_free(*cmdlinep); *cmdlinep = new_cmdline; p = new_cmdline; } return p; } #endif /* * Expand file name in Ex command argument. * Return FAIL for failure, OK otherwise. */ int expand_filename( 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; int escaped; #ifdef FEAT_QUICKFIX /* Skip a regexp pattern for ":vimgrep[add] pat file..." */ p = skip_grep_pat(eap); #else p = eap->arg; #endif /* * 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(p); while (*p != NUL) { #ifdef FEAT_EVAL /* Skip over `=expr`, wildcards in it are not expanded. */ if (p[0] == '`' && p[1] == '=') { p += 2; (void)skip_expr(&p); if (*p == '`') ++p; continue; } #endif /* * 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, eap->arg, &srclen, &(eap->do_ecmd_lnum), errormsgp, &escaped); if (*errormsgp != NULL) /* error detected */ return FAIL; if (repl == NULL) /* no match found */ { p += srclen; continue; } /* Wildcards won't be expanded below, the replacement is taken * literally. But do expand "~/file", "~user/file" and "$HOME/file". */ if (vim_strchr(repl, '$') != NULL || vim_strchr(repl, '~') != NULL) { char_u *l = repl; repl = expand_env_save(repl); vim_free(l); } /* Need to escape white space et al. with a backslash. * Don't do this for: * - replacement that already has been escaped: "##" * - shell commands (may have to use quotes instead). * - non-unix systems when there is a single argument (spaces don't * separate arguments then). */ if (!eap->usefilter && !escaped && eap->cmdidx != CMD_bang && eap->cmdidx != CMD_make && eap->cmdidx != CMD_lmake && eap->cmdidx != CMD_grep && eap->cmdidx != CMD_lgrep && eap->cmdidx != CMD_grepadd && eap->cmdidx != CMD_lgrepadd #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_strpbrk(repl, (char_u *)"!") != NULL) { char_u *l; 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) if (!has_wildcards) #endif backslash_halve(eap->arg); } 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, TRUE, NULL); has_wildcards = mch_has_wildcard(NameBuff); p = NameBuff; } else p = NULL; } else /* n == 2 */ { expand_T xpc; int options = WILD_LIST_NOTFOUND|WILD_ADD_SLASH; ExpandInit(&xpc); xpc.xp_context = EXPAND_FILES; if (p_wic) options += WILD_ICASE; p = ExpandOne(&xpc, eap->arg, NULL, options, WILD_EXPAND_FREE); 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( 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 != NULL) 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 != NULL) /* 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(exarg_T *eap) { char_u *p; #ifdef FEAT_QUICKFIX p = skip_grep_pat(eap); #else p = eap->arg; #endif for ( ; *p; mb_ptr_adv(p)) { if (*p == Ctrl_V) { if (eap->argt & (USECTRLV | XFILE)) ++p; /* skip CTRL-V and next char */ else /* remove CTRL-V and skip next char */ STRMOVE(p, p + 1); if (*p == NUL) /* stop at NUL after CTRL-V */ break; } #ifdef FEAT_EVAL /* Skip over `=expr` when wildcards are expanded. */ else if (p[0] == '`' && p[1] == '=' && (eap->argt & XFILE)) { p += 2; (void)skip_expr(&p); } #endif /* 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) == '\\') { STRMOVE(p - 1, p); /* remove the '\' */ --p; } else { eap->nextcmd = check_nextcmd(p); *p = NUL; break; } } } if (!(eap->argt & NOTRLCOM)) /* remove trailing spaces */ del_trailing_spaces(eap->arg); } /* * get + command from ex argument */ static char_u * getargcmd(char_u **argp) { char_u *arg = *argp; char_u *command = NULL; if (*arg == '+') /* +[command] */ { ++arg; if (vim_isspace(*arg) || *arg == NUL) 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( char_u *p, int rembs) /* TRUE to halve the number of backslashes */ { while (*p && !vim_isspace(*p)) { if (*p == '\\' && p[1] != NUL) { if (rembs) STRMOVE(p, p + 1); else ++p; } mb_ptr_adv(p); } return p; } /* * Get "++opt=arg" argument. * Return FAIL or OK. */ static int getargopt(exarg_T *eap) { char_u *arg = eap->arg + 2; int *pp = NULL; #ifdef FEAT_MBYTE int bad_char_idx; 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; } /* ":read ++edit file" */ if (STRNCMP(arg, "edit", 4) == 0) { eap->read_edit = TRUE; eap->arg = skipwhite(arg + 4); 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) { if (STRNCMP(arg, "encoding", 8) == 0) arg += 8; else arg += 3; pp = &eap->force_enc; } else if (STRNCMP(arg, "bad", 3) == 0) { arg += 3; pp = &bad_char_idx; } #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 if (pp == &eap->force_enc) { /* Make 'fileencoding' lower case. */ for (p = eap->cmd + eap->force_enc; *p != NUL; ++p) *p = TOLOWER_ASC(*p); } else { /* Check ++bad= argument. Must be a single-byte character, "keep" or * "drop". */ p = eap->cmd + bad_char_idx; if (STRICMP(p, "keep") == 0) eap->bad_char = BAD_KEEP; else if (STRICMP(p, "drop") == 0) eap->bad_char = BAD_DROP; else if (MB_BYTE2LEN(*p) == 1 && p[1] == NUL) eap->bad_char = *p; else return FAIL; } #endif return OK; } /* * ":abbreviate" and friends. */ static void ex_abbreviate(exarg_T *eap) { do_exmap(eap, TRUE); /* almost the same as mapping */ } /* * ":map" and friends. */ static void ex_map(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(exarg_T *eap) { do_exmap(eap, FALSE); } /* * ":mapclear" and friends. */ static void ex_mapclear(exarg_T *eap) { map_clear(eap->cmd, eap->arg, eap->forceit, FALSE); } /* * ":abclear" and friends. */ static void ex_abclear(exarg_T *eap) { map_clear(eap->cmd, eap->arg, TRUE, TRUE); } #if defined(FEAT_AUTOCMD) || defined(PROTO) static void ex_autocmd(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(exarg_T *eap) { char_u *arg = eap->arg; int call_do_modelines = check_nomodeline(&arg); (void)do_doautocmd(arg, TRUE); if (call_do_modelines) /* Only when there is no . */ do_modelines(0); } #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(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(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); if (eap->do_ecmd_cmd != NULL) do_cmdline_cmd(eap->do_ecmd_cmd); } } /* * :[N]bmodified [N] to next mod. buffer * :[N]sbmodified [N] to next mod. buffer */ static void ex_bmodified(exarg_T *eap) { goto_buffer(eap, DOBUF_MOD, FORWARD, (int)eap->line2); if (eap->do_ecmd_cmd != NULL) do_cmdline_cmd(eap->do_ecmd_cmd); } /* * :[N]bnext [N] to next buffer * :[N]sbnext [N] split and to next buffer */ static void ex_bnext(exarg_T *eap) { goto_buffer(eap, DOBUF_CURRENT, FORWARD, (int)eap->line2); if (eap->do_ecmd_cmd != NULL) do_cmdline_cmd(eap->do_ecmd_cmd); } /* * :[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(exarg_T *eap) { goto_buffer(eap, DOBUF_CURRENT, BACKWARD, (int)eap->line2); if (eap->do_ecmd_cmd != NULL) do_cmdline_cmd(eap->do_ecmd_cmd); } /* * :brewind to first buffer * :bfirst to first buffer * :sbrewind split and to first buffer * :sbfirst split and to first buffer */ static void ex_brewind(exarg_T *eap) { goto_buffer(eap, DOBUF_FIRST, FORWARD, 0); if (eap->do_ecmd_cmd != NULL) do_cmdline_cmd(eap->do_ecmd_cmd); } /* * :blast to last buffer * :sblast split and to last buffer */ static void ex_blast(exarg_T *eap) { goto_buffer(eap, DOBUF_LAST, BACKWARD, 0); if (eap->do_ecmd_cmd != NULL) do_cmdline_cmd(eap->do_ecmd_cmd); } #endif int ends_excmd(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(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(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( 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[DIALOG_MSG_SIZE]; if (n == 1) vim_strncpy(buff, (char_u *)_("1 more file to edit. Quit anyway?"), DIALOG_MSG_SIZE - 1); else vim_snprintf((char *)buff, DIALOG_MSG_SIZE, _("%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. */ char_u * get_command_name(expand_T *xp UNUSED, 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(char_u *name, size_t name_len, char_u *rep, long argt, long def, int flags, int compl, char_u *compl_arg, int addr_type, int force); static void uc_list(char_u *name, size_t name_len); static int uc_scan_attr(char_u *attr, size_t len, long *argt, long *def, int *flags, int *compl, char_u **compl_arg, int* attr_type_arg); static char_u *uc_split_args(char_u *arg, size_t *lenp); static size_t uc_check_code(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( char_u *name, size_t name_len, char_u *rep, long argt, long def, int flags, int compl, char_u *compl_arg, int addr_type, 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, 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 = NULL; #if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL) vim_free(cmd->uc_compl_arg); cmd->uc_compl_arg = NULL; #endif 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; 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 cmd->uc_addr_type = addr_type; return OK; fail: vim_free(rep_buf); #if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL) vim_free(compl_arg); #endif return FAIL; } #endif #if defined(FEAT_USR_CMDS) static struct { int expand; char *name; } addr_type_complete[] = { {ADDR_ARGUMENTS, "arguments"}, {ADDR_LINES, "lines"}, {ADDR_LOADED_BUFFERS, "loaded_buffers"}, {ADDR_TABS, "tabs"}, {ADDR_BUFFERS, "buffers"}, {ADDR_WINDOWS, "windows"}, {ADDR_QUICKFIX, "quickfix"}, {-1, NULL} }; #endif #if defined(FEAT_USR_CMDS) || defined(FEAT_EVAL) || defined(PROTO) /* * 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_BEHAVE, "behave"}, {EXPAND_BUFFERS, "buffer"}, {EXPAND_COLORS, "color"}, {EXPAND_COMMANDS, "command"}, {EXPAND_COMPILER, "compiler"}, #if defined(FEAT_CSCOPE) {EXPAND_CSCOPE, "cscope"}, #endif #if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL) {EXPAND_USER_DEFINED, "custom"}, {EXPAND_USER_LIST, "customlist"}, #endif {EXPAND_DIRECTORIES, "dir"}, {EXPAND_ENV_VARS, "environment"}, {EXPAND_EVENTS, "event"}, {EXPAND_EXPRESSION, "expression"}, {EXPAND_FILES, "file"}, {EXPAND_FILES_IN_PATH, "file_in_path"}, {EXPAND_FILETYPE, "filetype"}, {EXPAND_FUNCTIONS, "function"}, {EXPAND_HELP, "help"}, {EXPAND_HIGHLIGHT, "highlight"}, #if defined(FEAT_CMDHIST) {EXPAND_HISTORY, "history"}, #endif #if (defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \ && (defined(FEAT_GETTEXT) || defined(FEAT_MBYTE)) {EXPAND_LOCALES, "locale"}, #endif {EXPAND_MAPPINGS, "mapping"}, {EXPAND_MENUS, "menu"}, {EXPAND_OWNSYNTAX, "syntax"}, #if defined(FEAT_PROFILE) {EXPAND_SYNTIME, "syntime"}, #endif {EXPAND_SETTINGS, "option"}, {EXPAND_PACKADD, "packadd"}, {EXPAND_SHELLCMD, "shellcmd"}, #if defined(FEAT_SIGNS) {EXPAND_SIGN, "sign"}, #endif {EXPAND_TAGS, "tag"}, {EXPAND_TAGS_LISTFILES, "tag_listfiles"}, {EXPAND_USER, "user"}, {EXPAND_USER_VARS, "var"}, {0, NULL} }; #endif #if defined(FEAT_USR_CMDS) || defined(PROTO) static void uc_list(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 = (long)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 Address 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); /* Address Type */ for (j = 0; addr_type_complete[j].expand != -1; ++j) if (addr_type_complete[j].expand != ADDR_LINES && addr_type_complete[j].expand == cmd->uc_addr_type) { STRCPY(IObuff + len, addr_type_complete[j].name); len += (int)STRLEN(IObuff + len); break; } do { IObuff[len++] = ' '; } while (len < 21); /* 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 < 35); IObuff[len] = '\0'; msg_outtrans(IObuff); msg_outtrans_special(cmd->uc_rep, FALSE); #ifdef FEAT_EVAL if (p_verbose > 0) last_set_msg(cmd->uc_scriptID); #endif 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(void) { 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( char_u *attr, size_t len, long *argt, long *def, int *flags, int *compl, char_u **compl_arg, int *addr_type_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 | RANGE | 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) { if (val == NULL) { EMSG(_("E179: argument required for -complete")); return FAIL; } if (parse_compl_arg(val, (int)vallen, compl, argt, compl_arg) == FAIL) return FAIL; } else if (STRNICMP(attr, "addr", attrlen) == 0) { *argt |= RANGE; if (val == NULL) { EMSG(_("E179: argument required for -addr")); return FAIL; } if (parse_addr_type_arg(val, (int)vallen, argt, addr_type_arg) == FAIL) return FAIL; if (addr_type_arg != ADDR_LINES) *argt |= (ZEROR | NOTADR) ; } else { char_u ch = attr[len]; attr[len] = '\0'; EMSG2(_("E181: Invalid attribute: %s"), attr); attr[len] = ch; return FAIL; } } return OK; } /* * ":command ..." */ static void ex_command(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 addr_type_arg = ADDR_LINES; int has_attr = (eap->arg[0] == '-'); int name_len; 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, &addr_type_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; name_len = (int)(end - name); /* 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 if ((name_len == 1 && *name == 'X') || (name_len <= 4 && STRNCMP(name, "Next", name_len > 4 ? 4 : name_len) == 0)) { EMSG(_("E841: Reserved name, cannot be used for user defined command")); return; } else uc_add_command(name, end - name, p, argt, def, flags, compl, compl_arg, addr_type_arg, eap->forceit); } /* * ":comclear" * Clear all user commands, global and for current buffer. */ void ex_comclear(exarg_T *eap UNUSED) { uc_clear(&ucmds); uc_clear(&curbuf->b_ucmds); } /* * Clear all user commands for "gap". */ void uc_clear(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(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; if (i < gap->ga_len) mch_memmove(cmd, cmd + 1, (gap->ga_len - i) * sizeof(ucmd_T)); } /* * split and quote args for */ static char_u * uc_split_args(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] == '\\' && p[1] == '\\') { len += 2; p += 2; } else 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 { #ifdef FEAT_MBYTE int charlen = (*mb_ptr2len)(p); len += charlen; p += charlen; #else ++len; ++p; #endif } } buf = alloc(len + 1); if (buf == NULL) { *lenp = 0; return buf; } p = arg; q = buf; *q++ = '"'; while (*p) { if (p[0] == '\\' && p[1] == '\\') { *q++ = '\\'; *q++ = '\\'; p += 2; } else 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 { MB_COPY_CHAR(p, q); } } *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( 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; } ++l; 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, "reg>", l) == 0 || 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) { #ifdef FEAT_MBYTE if (enc_dbcs != 0 && (*mb_ptr2len)(p) == 2) /* DBCS can contain \ in a trail byte, skip the * double-byte character. */ ++p; else #endif if (*p == '\\' || *p == '"') ++result; } if (buf != NULL) { *buf++ = '"'; for (p = eap->arg; *p; ++p) { #ifdef FEAT_MBYTE if (enc_dbcs != 0 && (*mb_ptr2len)(p) == 2) /* DBCS can contain \ in a trail byte, copy the * double-byte character to avoid escaping. */ *buf++ = *p++; else #endif 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(exarg_T *eap) { char_u *buf; char_u *p; char_u *q; char_u *start; char_u *end = NULL; char_u *ksp; 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. * First round: "buf" is NULL, compute length, allocate "buf". * Second round: copy result into "buf". */ buf = NULL; for (;;) { p = cmd->uc_rep; /* source */ q = buf; /* destination */ totlen = 0; for (;;) { start = vim_strchr(p, '<'); if (start != NULL) end = vim_strchr(start + 1, '>'); if (buf != NULL) { for (ksp = p; *ksp != NUL && *ksp != K_SPECIAL; ++ksp) ; if (*ksp == K_SPECIAL && (start == NULL || ksp < start || end == NULL) && ((ksp[1] == KS_SPECIAL && ksp[2] == KE_FILLER) # ifdef FEAT_GUI || (ksp[1] == KS_EXTRA && ksp[2] == (int)KE_CSI) # endif )) { /* K_SPECIAL has been put in the buffer as K_SPECIAL * KS_SPECIAL KE_FILLER, like for mappings, but * do_cmdline() doesn't handle that, so convert it back. * Also change K_SPECIAL KS_EXTRA KE_CSI into CSI. */ len = ksp - p; if (len > 0) { mch_memmove(q, p, len); q += len; } *q++ = ksp[1] == KS_SPECIAL ? K_SPECIAL : CSI; p = ksp + 3; continue; } } /* break if there no is found */ if (start == NULL || end == NULL) break; /* 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(int idx) { return get_user_commands(NULL, idx - (int)CMD_SIZE); } /* * Function given to ExpandGeneric() to obtain the list of user command names. */ char_u * get_user_commands(expand_T *xp UNUSED, 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 address type names. */ char_u * get_user_cmd_addr_type(expand_T *xp UNUSED, int idx) { return (char_u *)addr_type_complete[idx].name; } /* * Function given to ExpandGeneric() to obtain the list of user command * attributes. */ char_u * get_user_cmd_flags(expand_T *xp UNUSED, int idx) { static char *user_cmd_flags[] = {"addr", "bang", "bar", "buffer", "complete", "count", "nargs", "range", "register"}; if (idx >= (int)(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. */ char_u * get_user_cmd_nargs(expand_T *xp UNUSED, int idx) { static char *user_cmd_nargs[] = {"0", "1", "*", "?", "+"}; if (idx >= (int)(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. */ char_u * get_user_cmd_complete(expand_T *xp UNUSED, int idx) { return (char_u *)command_complete[idx].name; } # endif /* FEAT_CMDL_COMPL */ /* * Parse address type argument */ int parse_addr_type_arg( char_u *value, int vallen, long *argt, int *addr_type_arg) { int i, a, b; for (i = 0; addr_type_complete[i].expand != -1; ++i) { a = (int)STRLEN(addr_type_complete[i].name) == vallen; b = STRNCMP(value, addr_type_complete[i].name, vallen) == 0; if (a && b) { *addr_type_arg = addr_type_complete[i].expand; break; } } if (addr_type_complete[i].expand == -1) { char_u *err = value; for (i = 0; err[i] != NUL && !vim_iswhite(err[i]); i++) ; err[i] = NUL; EMSG2(_("E180: Invalid address type value: %s"), err); return FAIL; } if (*addr_type_arg != ADDR_LINES) *argt |= NOTADR; return OK; } #endif /* FEAT_USR_CMDS */ #if defined(FEAT_USR_CMDS) || defined(FEAT_EVAL) || defined(PROTO) /* * Parse a completion argument "value[vallen]". * The detected completion goes in "*complp", argument type in "*argt". * When there is an argument, for function and user defined completion, it's * copied to allocated memory and stored in "*compl_arg". * Returns FAIL if something is wrong. */ int parse_compl_arg( char_u *value, int vallen, int *complp, long *argt, char_u **compl_arg UNUSED) { char_u *arg = NULL; # if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL) size_t arglen = 0; # endif int i; int valend = vallen; /* Look for any argument part - which is the part after any ',' */ for (i = 0; i < vallen; ++i) { if (value[i] == ',') { arg = &value[i + 1]; # if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL) arglen = vallen - i - 1; # endif valend = i; break; } } for (i = 0; command_complete[i].expand != 0; ++i) { if ((int)STRLEN(command_complete[i].name) == valend && STRNCMP(value, command_complete[i].name, valend) == 0) { *complp = 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"), value); return FAIL; } # if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL) if (*complp != EXPAND_USER_DEFINED && *complp != EXPAND_USER_LIST && 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 ((*complp == EXPAND_USER_DEFINED || *complp == EXPAND_USER_LIST) && arg == NULL) { EMSG(_("E467: Custom completion requires a function argument")); return FAIL; } if (arg != NULL) *compl_arg = vim_strnsave(arg, (int)arglen); # endif return OK; } #endif static void ex_colorscheme(exarg_T *eap) { if (*eap->arg == NUL) { #ifdef FEAT_EVAL char_u *expr = vim_strsave((char_u *)"g:colors_name"); char_u *p = NULL; if (expr != NULL) { ++emsg_off; p = eval_to_string(expr, NULL, FALSE); --emsg_off; vim_free(expr); } if (p != NULL) { MSG(p); vim_free(p); } else MSG("default"); #else MSG(_("unknown")); #endif } else if (load_colors(eap->arg) == FAIL) EMSG2(_("E185: Cannot find color scheme '%s'"), eap->arg); } static void ex_highlight(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(void) { exiting = FALSE; settmode(TMODE_RAW); } /* * ":quit": quit current window, quit Vim if the last window is closed. */ static void ex_quit(exarg_T *eap) { #if defined(FEAT_WINDOWS) || defined(FEAT_AUTOCMD) win_T *wp; #endif #ifdef FEAT_CMDWIN if (cmdwin_type != 0) { cmdwin_result = Ctrl_C; return; } #endif /* Don't quit while editing the command line. */ if (text_locked()) { text_locked_msg(); return; } #ifdef FEAT_WINDOWS if (eap->addr_count > 0) { int wnr = eap->line2; for (wp = firstwin; wp->w_next != NULL; wp = wp->w_next) if (--wnr <= 0) break; } else #endif #if defined(FEAT_WINDOWS) || defined(FEAT_AUTOCMD) wp = curwin; #endif #ifdef FEAT_AUTOCMD apply_autocmds(EVENT_QUITPRE, NULL, NULL, FALSE, curbuf); /* Refuse to quit when locked or when the buffer in the last window is * being closed (can only happen in autocommands). */ if (curbuf_locked() || (wp->w_buffer->b_nwindows == 1 && wp->w_buffer->b_closing)) 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 ? CCGD_AW : 0) | (eap->forceit ? CCGD_FORCEIT : 0) | CCGD_EXCMD)) || check_more(TRUE, eap->forceit) == FAIL || (only_one_window() && check_changed_any(eap->forceit, TRUE))) { not_exiting(); } else { #ifdef FEAT_WINDOWS /* quit last window * Note: only_one_window() returns true, even so a help window is * still open. In that case only quit, if no address has been * specified. Example: * :h|wincmd w|1q - don't quit * :h|wincmd w|q - quit */ if (only_one_window() && (firstwin == lastwin || eap->addr_count == 0)) #endif getout(0); #ifdef FEAT_WINDOWS # ifdef FEAT_GUI need_mouse_correct = TRUE; # endif /* close window; may free buffer */ win_close(wp, !P_HID(wp->w_buffer) || eap->forceit); #endif } } /* * ":cquit". */ static void ex_cquit(exarg_T *eap UNUSED) { 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(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 /* Don't quit while editing the command line. */ if (text_locked()) { text_locked_msg(); return; } #ifdef FEAT_AUTOCMD apply_autocmds(EVENT_QUITPRE, NULL, NULL, FALSE, curbuf); /* Refuse to quit when locked or when the buffer in the last window is * being closed (can only happen in autocommands). */ if (curbuf_locked() || (curbuf->b_nwindows == 1 && curbuf->b_closing)) return; #endif exiting = TRUE; if (eap->forceit || !check_changed_any(FALSE, FALSE)) getout(0); not_exiting(); } #if defined(FEAT_WINDOWS) || defined(PROTO) /* * ":close": close current window, unless it is the last one */ static void ex_close(exarg_T *eap) { win_T *win; int winnr = 0; # ifdef FEAT_CMDWIN if (cmdwin_type != 0) cmdwin_result = Ctrl_C; else # endif if (!text_locked() #ifdef FEAT_AUTOCMD && !curbuf_locked() #endif ) { if (eap->addr_count == 0) ex_win_close(eap->forceit, curwin, NULL); else { for (win = firstwin; win != NULL; win = win->w_next) { winnr++; if (winnr == eap->line2) break; } if (win == NULL) win = lastwin; ex_win_close(eap->forceit, win, NULL); } } } # ifdef FEAT_QUICKFIX /* * ":pclose": Close any preview window. */ static void ex_pclose(exarg_T *eap) { win_T *win; for (win = firstwin; win != NULL; win = win->w_next) if (win->w_p_pvw) { ex_win_close(eap->forceit, win, NULL); break; } } # endif /* * Close window "win" and take care of handling closing the last window for a * modified buffer. */ static void ex_win_close( int forceit, win_T *win, tabpage_T *tp) /* NULL or the tab page "win" is in */ { int need_hide; buf_T *buf = win->w_buffer; need_hide = (bufIsChanged(buf) && buf->b_nwindows <= 1); if (need_hide && !P_HID(buf) && !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 */ if (tp == NULL) win_close(win, !need_hide && !P_HID(buf)); else win_close_othertab(win, !need_hide && !P_HID(buf), tp); } /* * ":tabclose": close current tab page, unless it is the last one. * ":tabclose N": close tab page N. */ static void ex_tabclose(exarg_T *eap) { tabpage_T *tp; # ifdef FEAT_CMDWIN if (cmdwin_type != 0) cmdwin_result = K_IGNORE; else # endif if (first_tabpage->tp_next == NULL) EMSG(_("E784: Cannot close last tab page")); else { if (eap->addr_count > 0) { tp = find_tabpage((int)eap->line2); if (tp == NULL) { beep_flush(); return; } if (tp != curtab) { tabpage_close_other(tp, eap->forceit); return; } } if (!text_locked() #ifdef FEAT_AUTOCMD && !curbuf_locked() #endif ) tabpage_close(eap->forceit); } } /* * ":tabonly": close all tab pages except the current one */ static void ex_tabonly(exarg_T *eap) { tabpage_T *tp; int done; # ifdef FEAT_CMDWIN if (cmdwin_type != 0) cmdwin_result = K_IGNORE; else # endif if (first_tabpage->tp_next == NULL) MSG(_("Already only one tab page")); else { if (eap->addr_count > 0) goto_tabpage(eap->line2); /* Repeat this up to a 1000 times, because autocommands may mess * up the lists. */ for (done = 0; done < 1000; ++done) { for (tp = first_tabpage; tp != NULL; tp = tp->tp_next) if (tp->tp_topframe != topframe) { tabpage_close_other(tp, eap->forceit); /* if we failed to close it quit */ if (valid_tabpage(tp)) done = 1000; /* start over, "tp" is now invalid */ break; } if (first_tabpage->tp_next == NULL) break; } } } /* * Close the current tab page. */ void tabpage_close(int forceit) { /* First close all the windows but the current one. If that worked then * close the last window in this tab, that will close it. */ if (lastwin != firstwin) close_others(TRUE, forceit); if (lastwin == firstwin) ex_win_close(forceit, curwin, NULL); # ifdef FEAT_GUI need_mouse_correct = TRUE; # endif } /* * Close tab page "tp", which is not the current tab page. * Note that autocommands may make "tp" invalid. * Also takes care of the tab pages line disappearing when closing the * last-but-one tab page. */ void tabpage_close_other(tabpage_T *tp, int forceit) { int done = 0; win_T *wp; int h = tabline_height(); /* Limit to 1000 windows, autocommands may add a window while we close * one. OK, so I'm paranoid... */ while (++done < 1000) { wp = tp->tp_firstwin; ex_win_close(forceit, wp, tp); /* Autocommands may delete the tab page under our fingers and we may * fail to close a window with a modified buffer. */ if (!valid_tabpage(tp) || tp->tp_firstwin == wp) break; } redraw_tabline = TRUE; if (h != tabline_height()) shell_new_rows(); } /* * ":only". */ static void ex_only(exarg_T *eap) { win_T *wp; int wnr; # ifdef FEAT_GUI need_mouse_correct = TRUE; # endif if (eap->addr_count > 0) { wnr = eap->line2; for (wp = firstwin; --wnr > 0; ) { if (wp->w_next == NULL) break; else wp = wp->w_next; } win_goto(wp); } close_others(TRUE, eap->forceit); } /* * ":all" and ":sall". * Also used for ":tab drop file ..." after setting the argument list. */ void ex_all(exarg_T *eap) { if (eap->addr_count == 0) eap->line2 = 9999; do_arg_all((int)eap->line2, eap->forceit, eap->cmdidx == CMD_drop); } #endif /* FEAT_WINDOWS */ static void ex_hide(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 if (eap->addr_count == 0) win_close(curwin, FALSE); /* don't free buffer */ else { int winnr = 0; win_T *win; for (win = firstwin; win != NULL; win = win->w_next) { winnr++; if (winnr == eap->line2) break; } if (win == NULL) win = lastwin; win_close(win, FALSE); } } #endif } } /* * ":stop" and ":suspend": Suspend Vim. */ static void ex_stop(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(exarg_T *eap) { #ifdef FEAT_CMDWIN if (cmdwin_type != 0) { cmdwin_result = Ctrl_C; return; } #endif /* Don't quit while editing the command line. */ if (text_locked()) { text_locked_msg(); return; } #ifdef FEAT_AUTOCMD apply_autocmds(EVENT_QUITPRE, NULL, NULL, FALSE, curbuf); /* Refuse to quit when locked or when the buffer in the last window is * being closed (can only happen in autocommands). */ if (curbuf_locked() || (curbuf->b_nwindows == 1 && curbuf->b_closing)) 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, FALSE))) { 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 the buffer. */ win_close(curwin, !P_HID(curwin->w_buffer)); #endif } } /* * ":print", ":list", ":number". */ static void ex_print(exarg_T *eap) { if (curbuf->b_ml.ml_flags & ML_EMPTY) EMSG(_(e_emptybuf)); else { for ( ;!got_int; ui_breakcheck()) { print_line(eap->line1, (eap->cmdidx == CMD_number || eap->cmdidx == CMD_pound || (eap->flags & EXFLAG_NR)), eap->cmdidx == CMD_list || (eap->flags & EXFLAG_LIST)); 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; } #ifdef FEAT_BYTEOFF static void ex_goto(exarg_T *eap) { goto_byte(eap->line2); } #endif /* * ":shell". */ static void ex_shell(exarg_T *eap UNUSED) { do_shell(NULL, 0); } #if (defined(FEAT_WINDOWS) && defined(HAVE_DROP_FILE)) \ || (defined(FEAT_GUI_GTK) && defined(FEAT_DND)) \ || defined(FEAT_GUI_MSWIN) \ || defined(FEAT_GUI_MAC) \ || 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 argument 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( 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; /* Postpone this while editing the command line. */ if (text_locked()) return; #ifdef FEAT_AUTOCMD if (curbuf_locked()) return; #endif /* When the screen is being updated we should not change buffers and * windows structures, it may cause freed memory to be used. */ if (updating_screen) return; /* 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, CCGD_AW); --emsg_off; } if (split) { # ifdef FEAT_WINDOWS if (win_split(0, 0) == FAIL) return; RESET_BINDING(curwin); /* 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, NULL, 0); /* * 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 /* * Clear an argument list: free all file names and reset it to zero entries. */ void alist_clear(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(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(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(void) { 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; curwin->w_alist->id = ++max_alist_id; alist_init(curwin->w_alist); } } # endif #endif #if (!defined(UNIX) && !defined(__EMX__)) || defined(PROTO) /* * Expand the file names in the global argument list. * If "fnum_list" is not NULL, use "fnum_list[fnum_len]" as a list of buffer * numbers to be re-used. */ void alist_expand(int *fnum_list, int fnum_len) { char_u **old_arg_files; int old_arg_count; 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] = vim_strsave(GARGLIST[i].ae_fname); old_arg_count = GARGCOUNT; if (expand_wildcards(old_arg_count, old_arg_files, &new_arg_file_count, &new_arg_files, EW_FILE|EW_NOTFOUND|EW_ADDSLASH|EW_NOERROR) == OK && new_arg_file_count > 0) { alist_set(&global_alist, new_arg_file_count, new_arg_files, TRUE, fnum_list, fnum_len); FreeWild(old_arg_count, 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( alist_T *al, int count, char_u **files, int use_curbuf, int *fnum_list, int fnum_len) { int i; alist_clear(al); if (ga_grow(&al->al_ga, count) == OK) { for (i = 0; i < count; ++i) { if (got_int) { /* When adding many buffers this can take a long time. Allow * interrupting here. */ while (i < count) vim_free(files[i++]); break; } /* May set buffer name of a buffer previously used for the * argument list, so that it's re-used by alist_add. */ if (fnum_list != NULL && i < fnum_len) buf_set_name(fnum_list[i], files[i]); alist_add(al, files[i], use_curbuf ? 2 : 1); ui_breakcheck(); } 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( 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; } #if defined(BACKSLASH_IN_FILENAME) || defined(PROTO) /* * Adjust slashes in file names. Called after 'shellslash' was set. */ void alist_slash_adjust(void) { int i; # ifdef FEAT_WINDOWS win_T *wp; tabpage_T *tp; # endif for (i = 0; i < GARGCOUNT; ++i) if (GARGLIST[i].ae_fname != NULL) slash_adjust(GARGLIST[i].ae_fname); # ifdef FEAT_WINDOWS FOR_ALL_TAB_WINDOWS(tp, wp) 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". */ static void ex_preserve(exarg_T *eap UNUSED) { curbuf->b_flags |= BF_PRESERVED; ml_preserve(curbuf, TRUE); } /* * ":recover". */ static void ex_recover(exarg_T *eap) { /* Set recoverymode right away to avoid the ATTENTION prompt. */ recoverymode = TRUE; if (!check_changed(curbuf, (p_awa ? CCGD_AW : 0) | CCGD_MULTWIN | (eap->forceit ? CCGD_FORCEIT : 0) | CCGD_EXCMD) && (*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(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' * * :tabedit open new Tab page with empty window * :tabedit [+command] file open new Tab page and edit "file" * :tabnew [[+command] file] just like :tabedit * :tabfind [+command] file open new Tab page and find "file" */ void ex_splitview(exarg_T *eap) { win_T *old_curwin = curwin; # if defined(FEAT_SEARCHPATH) || defined(FEAT_BROWSE) char_u *fname = NULL; # endif # ifdef FEAT_BROWSE int browse_flag = cmdmod.browse; # endif # 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. But it's OK when doing ":tab split". */ if (bt_quickfix(curbuf) && cmdmod.tab == 0) { if (eap->cmdidx == CMD_split) eap->cmdidx = CMD_new; if (eap->cmdidx == CMD_vsplit) eap->cmdidx = CMD_vnew; } # endif # ifdef FEAT_SEARCHPATH if (eap->cmdidx == CMD_sfind || eap->cmdidx == CMD_tabfind) { 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 && eap->cmdidx != CMD_vnew && eap->cmdidx != CMD_new) { # ifdef FEAT_AUTOCMD if ( # ifdef FEAT_GUI !gui.in_use && # endif au_has_group((char_u *)"FileExplorer")) { /* No browsing supported but we do have the file explorer: * Edit the directory. */ if (*eap->arg == NUL || !mch_isdir(eap->arg)) eap->arg = (char_u *)"."; } else # endif { fname = do_browse(0, (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 /* * Either open new tab page or split the window. */ if (eap->cmdidx == CMD_tabedit || eap->cmdidx == CMD_tabfind || eap->cmdidx == CMD_tabnew) { if (win_new_tabpage(cmdmod.tab != 0 ? cmdmod.tab : eap->addr_count == 0 ? 0 : (int)eap->line2 + 1) != FAIL) { do_exedit(eap, old_curwin); /* set the alternate buffer for the window we came from */ if (curwin != old_curwin && win_valid(old_curwin) && old_curwin->w_buffer != curbuf && !cmdmod.keepalt) old_curwin->w_alt_fnum = curbuf->b_fnum; } } else 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 ) { RESET_BINDING(curwin); } 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 } /* * Open a new tab page. */ void tabpage_new(void) { exarg_T ea; vim_memset(&ea, 0, sizeof(ea)); ea.cmdidx = CMD_tabnew; ea.cmd = (char_u *)"tabn"; ea.arg = (char_u *)""; ex_splitview(&ea); } /* * :tabnext command */ static void ex_tabnext(exarg_T *eap) { switch (eap->cmdidx) { case CMD_tabfirst: case CMD_tabrewind: goto_tabpage(1); break; case CMD_tablast: goto_tabpage(9999); break; case CMD_tabprevious: case CMD_tabNext: goto_tabpage(eap->addr_count == 0 ? -1 : -(int)eap->line2); break; default: /* CMD_tabnext */ goto_tabpage(eap->addr_count == 0 ? 0 : (int)eap->line2); break; } } /* * :tabmove command */ static void ex_tabmove(exarg_T *eap) { int tab_number; if (eap->arg && *eap->arg != NUL) { char_u *p = eap->arg; int relative = 0; /* argument +N/-N means: move N places to the * right/left relative to the current position. */ if (*eap->arg == '-') { relative = -1; p = eap->arg + 1; } else if (*eap->arg == '+') { relative = 1; p = eap->arg + 1; } else p = eap->arg; if (relative == 0) { if (STRCMP(p, "$") == 0) tab_number = LAST_TAB_NR; else if (p == skipdigits(p)) { /* No numbers as argument. */ eap->errmsg = e_invarg; return; } else tab_number = getdigits(&p); } else { if (*p != NUL) tab_number = getdigits(&p); else tab_number = 1; tab_number = tab_number * relative + tabpage_index(curtab); if (relative == -1) --tab_number; } } else if (eap->addr_count != 0) { tab_number = eap->line2; if (**eap->cmdlinep == '-') --tab_number; } else tab_number = LAST_TAB_NR; tabpage_move(tab_number); } /* * :tabs command: List tabs and their contents. */ static void ex_tabs(exarg_T *eap UNUSED) { tabpage_T *tp; win_T *wp; int tabcount = 1; msg_start(); msg_scroll = TRUE; for (tp = first_tabpage; tp != NULL && !got_int; tp = tp->tp_next) { msg_putchar('\n'); vim_snprintf((char *)IObuff, IOSIZE, _("Tab page %d"), tabcount++); msg_outtrans_attr(IObuff, hl_attr(HLF_T)); out_flush(); /* output one line at a time */ ui_breakcheck(); if (tp == curtab) wp = firstwin; else wp = tp->tp_firstwin; for ( ; wp != NULL && !got_int; wp = wp->w_next) { msg_putchar('\n'); msg_putchar(wp == curwin ? '>' : ' '); msg_putchar(' '); msg_putchar(bufIsChanged(wp->w_buffer) ? '+' : ' '); msg_putchar(' '); if (buf_spname(wp->w_buffer) != NULL) vim_strncpy(IObuff, buf_spname(wp->w_buffer), IOSIZE - 1); else home_replace(wp->w_buffer, wp->w_buffer->b_fname, IObuff, IOSIZE, TRUE); msg_outtrans(IObuff); out_flush(); /* output one line at a time */ ui_breakcheck(); } } } #endif /* FEAT_WINDOWS */ /* * ":mode": Set screen mode. * If no argument given, just get the screen size and redraw. */ static void ex_mode(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(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); 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 { 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] " command. */ static void ex_find(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 } /* * ":open" simulation: for now just work like ":visual". */ static void ex_open(exarg_T *eap) { regmatch_T regmatch; char_u *p; curwin->w_cursor.lnum = eap->line2; beginline(BL_SOL | BL_FIX); if (*eap->arg == '/') { /* ":open /pattern/": put cursor in column found with pattern */ ++eap->arg; p = skip_regexp(eap->arg, '/', p_magic, NULL); *p = NUL; regmatch.regprog = vim_regcomp(eap->arg, p_magic ? RE_MAGIC : 0); if (regmatch.regprog != NULL) { regmatch.rm_ic = p_ic; p = ml_get_curline(); if (vim_regexec(®match, p, (colnr_T)0)) curwin->w_cursor.col = (colnr_T)(regmatch.startp[0] - p); else EMSG(_(e_nomatch)); vim_regfree(regmatch.regprog); } /* Move to the NUL, ignore any other arguments. */ eap->arg += STRLEN(eap->arg); } check_cursor(); eap->cmdidx = CMD_visual; do_exedit(eap, NULL); } /* * ":edit", ":badd", ":visual". */ static void ex_edit(exarg_T *eap) { do_exedit(eap, NULL); } /* * ":edit " command and alikes. */ void do_exedit( exarg_T *eap, win_T *old_curwin) /* curwin before doing a split or NULL */ { int n; #ifdef FEAT_WINDOWS int need_hide; #endif int exmode_was = exmode_active; /* * ":vi" command ends Ex mode. */ if (exmode_active && (eap->cmdidx == CMD_visual || eap->cmdidx == CMD_view)) { exmode_active = FALSE; if (*eap->arg == NUL) { /* Special case: ":global/pat/visual\NLvi-commands" */ if (global_busy) { int rd = RedrawingDisabled; int nwr = no_wait_return; int ms = msg_scroll; #ifdef FEAT_GUI int he = hold_gui_events; #endif if (eap->nextcmd != NULL) { stuffReadbuff(eap->nextcmd); eap->nextcmd = NULL; } if (exmode_was != EXMODE_VIM) settmode(TMODE_RAW); RedrawingDisabled = 0; no_wait_return = 0; need_wait_return = FALSE; msg_scroll = 0; #ifdef FEAT_GUI hold_gui_events = 0; #endif must_redraw = CLEAR; main_loop(FALSE, TRUE); RedrawingDisabled = rd; no_wait_return = nwr; msg_scroll = ms; #ifdef FEAT_GUI hold_gui_events = he; #endif } return; } } if ((eap->cmdidx == CMD_new || eap->cmdidx == CMD_tabnew || eap->cmdidx == CMD_tabedit #ifdef FEAT_WINDOWS || eap->cmdidx == CMD_vnew #endif ) && *eap->arg == NUL) { /* ":new" or ":tabnew" without argument: edit an new empty buffer */ setpcmark(); (void)do_ecmd(0, NULL, NULL, eap, ECMD_ONE, ECMD_HIDE + (eap->forceit ? ECMD_FORCEIT : 0), old_curwin == NULL ? curwin : NULL); } else if ((eap->cmdidx != CMD_split #ifdef FEAT_WINDOWS && eap->cmdidx != CMD_vsplit #endif ) || *eap->arg != NUL #ifdef FEAT_BROWSE || cmdmod.browse #endif ) { #ifdef FEAT_AUTOCMD /* Can't edit another file when "curbuf_lock" is set. Only ":edit" * can bring us here, others are stopped earlier. */ if (*eap->arg != NUL && curbuf_locked()) return; #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) /* after a split we can use an existing buffer */ + (old_curwin != NULL ? ECMD_OLDBUF : 0) #ifdef FEAT_LISTCMDS + (eap->cmdidx == CMD_badd ? ECMD_ADDBUF : 0 ) #endif , old_curwin == NULL ? curwin : NULL) == 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)) { # if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL) cleanup_T cs; /* Reset the error/interrupt/exception state here so that * aborting() returns FALSE when closing a window. */ enter_cleanup(&cs); # endif # ifdef FEAT_GUI need_mouse_correct = TRUE; # endif win_close(curwin, !need_hide && !P_HID(curbuf)); # if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL) /* Restore the error/interrupt/exception state if not * discarded by a new aborting error, interrupt, or * uncaught exception. */ leave_cleanup(&cs); # endif } } #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 && !cmdmod.keepalt) 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(exarg_T *eap) { eap->errmsg = e_nogvim; } #endif #if defined(FEAT_GUI_W32) && defined(FEAT_MENU) && defined(FEAT_TEAROFF) static void ex_tearoff(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(exarg_T *eap) { gui_make_popup(eap->arg, eap->forceit); } #endif static void ex_swapname(exarg_T *eap UNUSED) { 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 ) */ static void ex_syncbind(exarg_T *eap UNUSED) { #ifdef FEAT_SCROLLBIND win_T *wp; win_T *save_curwin = curwin; buf_T *save_curbuf = curbuf; 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. */ for (curwin = firstwin; curwin; curwin = curwin->w_next) { if (curwin->w_p_scb) { curbuf = curwin->w_buffer; 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 = save_curwin; curbuf = save_curbuf; 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(exarg_T *eap) { int i; int empty = (curbuf->b_ml.ml_flags & ML_EMPTY); linenr_T lnum; 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(0, (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 { if (empty && exmode_active) { /* Delete the empty line that remains. Historically ex does * this but vi doesn't. */ if (eap->line2 == 0) lnum = curbuf->b_ml.ml_line_count; else lnum = 1; if (*ml_get(lnum) == NUL && u_savedel(lnum, 1L) == OK) { ml_delete(lnum, FALSE); if (curwin->w_cursor.lnum > 1 && curwin->w_cursor.lnum >= lnum) --curwin->w_cursor.lnum; deleted_lines_mark(lnum, 1L); } } redraw_curbuf_later(VALID); } } } static char_u *prev_dir = NULL; #if defined(EXITFREE) || defined(PROTO) void free_cd_dir(void) { vim_free(prev_dir); prev_dir = NULL; vim_free(globaldir); globaldir = NULL; } #endif /* * Deal with the side effects of changing the current directory. * When "local" is TRUE then this was after an ":lcd" command. */ void post_chdir(int local) { vim_free(curwin->w_localdir); curwin->w_localdir = NULL; if (local) { /* 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; } shorten_fnames(TRUE); } /* * ":cd", ":lcd", ":chdir" and ":lchdir". */ void ex_cd(exarg_T *eap) { 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 { #ifdef FEAT_AUTOCMD if (allbuf_locked()) return; #endif if (vim_strchr(p_cpo, CPO_CHDIR) != NULL && curbufIsChanged() && !eap->forceit) { EMSG(_("E747: Cannot change directory, buffer is modified (add ! to override)")); return; } /* ":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 vim_strncpy(NameBuff, p, MAXPATHL - 1); # 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 { post_chdir(eap->cmdidx == CMD_lcd || eap->cmdidx == CMD_lchdir); /* Echo the new current directory if the command was typed. */ if (KeyTyped || p_verbose >= 5) ex_pwd(eap); } vim_free(tofree); } } /* * ":pwd". */ static void ex_pwd(exarg_T *eap UNUSED) { if (mch_dirname(NameBuff, MAXPATHL) == OK) { #ifdef BACKSLASH_IN_FILENAME slash_adjust(NameBuff); #endif msg(NameBuff); } else EMSG(_("E187: Unknown")); } /* * ":=". */ static void ex_equal(exarg_T *eap) { smsg((char_u *)"%ld", (long)eap->line2); ex_may_print(eap); } static void ex_sleep(exarg_T *eap) { int n; long len; if (cursor_valid()) { n = W_WINROW(curwin) + curwin->w_wrow - msg_scrolled; if (n >= 0) windgoto((int)n, W_WINCOL(curwin) + curwin->w_wcol); } len = eap->line2; switch (*eap->arg) { case 'm': break; case NUL: len *= 1000L; break; default: EMSG2(_(e_invarg2), eap->arg); return; } do_sleep(len); } /* * Sleep for "msec" milliseconds, but keep checking for a CTRL-C every second. */ void do_sleep(long msec) { long done; long wait_now; cursor_on(); out_flush(); for (done = 0; !got_int && done < msec; done += wait_now) { wait_now = msec - done > 1000L ? 1000L : msec - done; #ifdef FEAT_TIMERS { long due_time = check_due_timer(); if (due_time > 0 && due_time < wait_now) wait_now = due_time; } #endif ui_delay(wait_now, TRUE); ui_breakcheck(); #ifdef MESSAGE_QUEUE /* Process the netbeans and clientserver messages that may have been * received in the call to ui_breakcheck() when the GUI is in use. This * may occur when running a test case. */ parse_queued_messages(); #endif } } static void do_exmap(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(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(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 if (!eap->skip) { /* Pass flags on for ":vertical wincmd ]". */ postponed_split_flags = cmdmod.split; postponed_split_tab = cmdmod.tab; do_window(*eap->arg, eap->addr_count > 0 ? eap->line2 : 0L, xchar); postponed_split_flags = 0; postponed_split_tab = 0; } } #endif #if defined(FEAT_GUI) || defined(UNIX) || defined(VMS) || defined(MSWIN) /* * ":winpos". */ static void ex_winpos(exarg_T *eap) { int x, y; char_u *arg = eap->arg; char_u *p; if (*arg == NUL) { # if defined(FEAT_GUI) || defined(MSWIN) # ifdef FEAT_GUI if (gui.in_use && gui_mch_get_winpos(&x, &y) != FAIL) # else if (mch_get_winpos(&x, &y) != FAIL) # endif { 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 # else # ifdef MSWIN mch_set_winpos(x, y); # 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(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); } if (VIsual_active) end_visual_mode(); 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 ( #ifdef FEAT_RIGHTLEFT (eap->cmdidx == CMD_rshift) ^ curwin->w_p_rl #else eap->cmdidx == CMD_rshift #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 ex_may_print(eap); } /* * ":put". */ static void ex_put(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|PUT_CURSLINE); } /* * Handle ":copy" and ":move". */ static void ex_copymove(exarg_T *eap) { long n; n = get_address(eap, &eap->arg, eap->addr_type, FALSE, FALSE); if (eap->arg == NULL) /* error detected */ { eap->nextcmd = NULL; return; } get_flags(eap); /* * 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); ex_may_print(eap); } /* * Print the current line if flags were given to the Ex command. */ void ex_may_print(exarg_T *eap) { if (eap->flags != 0) { print_line(curwin->w_cursor.lnum, (eap->flags & EXFLAG_NR), (eap->flags & EXFLAG_LIST)); ex_no_reprint = TRUE; } } /* * ":smagic" and ":snomagic". */ static void ex_submagic(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(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; } (void)do_join(eap->line2 - eap->line1 + 1, !eap->forceit, TRUE, TRUE, TRUE); beginline(BL_WHITE | BL_FIX); ex_may_print(eap); } /* * ":[addr]@r" or ":[addr]*r": execute register */ static void ex_at(exarg_T *eap) { int c; int prev_len = typebuf.tb_len; 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 the typeahead buffer with the "silent" flag. */ if (do_execreg(c, TRUE, vim_strchr(p_cpo, CPO_EXECBUF) != NULL, TRUE) == FAIL) { beep_flush(); } else { int save_efr = exec_from_reg; exec_from_reg = TRUE; /* * Execute from the typeahead buffer. * Continue until the stuff buffer is empty and all added characters * have been consumed. */ while (!stuff_empty() || typebuf.tb_len > prev_len) (void)do_cmdline(NULL, getexline, NULL, DOCMD_NOWAIT|DOCMD_VERBOSE); exec_from_reg = save_efr; } } /* * ":!". */ static void ex_bang(exarg_T *eap) { do_bang(eap->addr_count, eap, eap->forceit, TRUE, TRUE); } /* * ":undo". */ static void ex_undo(exarg_T *eap) { if (eap->addr_count == 1) /* :undo 123 */ undo_time(eap->line2, FALSE, FALSE, TRUE); else u_undo(1); } #ifdef FEAT_PERSISTENT_UNDO static void ex_wundo(exarg_T *eap) { char_u hash[UNDO_HASH_SIZE]; u_compute_hash(hash); u_write_undo(eap->arg, eap->forceit, curbuf, hash); } static void ex_rundo(exarg_T *eap) { char_u hash[UNDO_HASH_SIZE]; u_compute_hash(hash); u_read_undo(eap->arg, hash, NULL); } #endif /* * ":redo". */ static void ex_redo(exarg_T *eap UNUSED) { u_redo(1); } /* * ":earlier" and ":later". */ static void ex_later(exarg_T *eap) { long count = 0; int sec = FALSE; int file = FALSE; char_u *p = eap->arg; if (*p == NUL) count = 1; else if (isdigit(*p)) { count = getdigits(&p); switch (*p) { case 's': ++p; sec = TRUE; break; case 'm': ++p; sec = TRUE; count *= 60; break; case 'h': ++p; sec = TRUE; count *= 60 * 60; break; case 'd': ++p; sec = TRUE; count *= 24 * 60 * 60; break; case 'f': ++p; file = TRUE; break; } } if (*p != NUL) EMSG2(_(e_invarg2), eap->arg); else undo_time(eap->cmdidx == CMD_earlier ? -count : count, sec, file, FALSE); } /* * ":redir": start/stop redirection. */ static void ex_redir(exarg_T *eap) { char *mode; char_u *fname; char_u *arg = eap->arg; if (STRICMP(eap->arg, "END") == 0) close_redir(); else { if (*arg == '>') { ++arg; if (*arg == '>') { ++arg; mode = "a"; } else mode = "w"; arg = skipwhite(arg); close_redir(); /* Expand environment variables and "~/". */ fname = expand_env_save(arg); if (fname == NULL) return; #ifdef FEAT_BROWSE if (cmdmod.browse) { char_u *browseFile; browseFile = do_browse(BROWSE_SAVE, (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 (*arg == '@') { /* redirect to a register a-z (resp. A-Z for appending) */ close_redir(); ++arg; if (ASCII_ISALPHA(*arg) # ifdef FEAT_CLIPBOARD || *arg == '*' || *arg == '+' # endif || *arg == '"') { redir_reg = *arg++; if (*arg == '>' && arg[1] == '>') /* append */ arg += 2; else { /* Can use both "@a" and "@a>". */ if (*arg == '>') arg++; /* Make register empty when not using @A-@Z and the * command is valid. */ if (*arg == NUL && !isupper(redir_reg)) write_reg_contents(redir_reg, (char_u *)"", -1, FALSE); } } if (*arg != NUL) { redir_reg = 0; EMSG2(_(e_invarg2), eap->arg); } } else if (*arg == '=' && arg[1] == '>') { int append; /* redirect to a variable */ close_redir(); arg += 2; if (*arg == '>') { ++arg; append = TRUE; } else append = FALSE; if (var_redir_start(skipwhite(arg), append) == OK) redir_vname = 1; } #endif /* TODO: redirect to a buffer */ else EMSG2(_(e_invarg2), eap->arg); } /* Make sure redirection is not off. Can happen for cmdline completion * that indirectly invokes a command to catch its output. */ if (redir_fd != NULL #ifdef FEAT_EVAL || redir_reg || redir_vname #endif ) redir_off = FALSE; } /* * ":redraw": force redraw */ void ex_redraw(exarg_T *eap) { int r = RedrawingDisabled; int p = p_lz; RedrawingDisabled = 0; p_lz = FALSE; update_topline(); update_screen(eap->forceit ? CLEAR : VIsual_active ? INVERTED : 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; /* No need to wait after an intentional redraw. */ need_wait_return = FALSE; out_flush(); } /* * ":redrawstatus": force redraw of status line(s) */ static void ex_redrawstatus(exarg_T *eap UNUSED) { #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(VIsual_active ? INVERTED : 0); RedrawingDisabled = r; p_lz = p; out_flush(); #endif } static void close_redir(void) { if (redir_fd != NULL) { fclose(redir_fd); redir_fd = NULL; } #ifdef FEAT_EVAL redir_reg = 0; if (redir_vname) { var_redir_stop(); redir_vname = 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( 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 /* Use the short file name until ":lcd" is used. We also don't use the * short file name when 'acd' is set, that is checked later. */ did_lcd = FALSE; /* ":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(BROWSE_SAVE, # 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_emsg(p_vdir, 0755); #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_mksession) { if (put_line(fd, "let SessionLoad = 1") == FAIL) failed = TRUE; } 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; /* current directory */ dirnow = alloc(MAXPATHL); if (dirnow == NULL) failed = TRUE; else { /* * 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) { if (mch_chdir((char *)globaldir) == 0) 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); } vim_free(dirnow); } } else { failed |= (put_view(fd, curwin, !using_vdir, flagp, -1) == FAIL); } if (put_line(fd, "let &so = s:so_save | let &siso = s:siso_save") == FAIL) failed = TRUE; if (put_line(fd, "doautoall SessionLoadPost") == FAIL) failed = TRUE; if (eap->cmdidx == CMD_mksession) { if (put_line(fd, "unlet SessionLoad") == FAIL) failed = TRUE; } } #endif if (put_line(fd, "\" vim: set ft=vim :") == FAIL) failed = TRUE; 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; tbuf = alloc(MAXPATHL); if (tbuf != NULL) { if (vim_FullName(fname, tbuf, MAXPATHL, FALSE) == OK) set_vim_var_string(VV_THIS_SESSION, tbuf, -1); vim_free(tbuf); } } #endif #ifdef MKSESSION_NL mksession_nl = FALSE; #endif } #ifdef FEAT_BROWSE theend: vim_free(browseFile); #endif #ifdef FEAT_SESSION vim_free(viewFile); #endif } #if ((defined(FEAT_SESSION) || defined(FEAT_EVAL)) && defined(vim_mkdir)) \ || defined(PROTO) int vim_mkdir_emsg(char_u *name, int prot) { if (vim_mkdir(name, prot) != 0) { EMSG2(_("E739: Cannot create directory: %s"), name); return FAIL; } return OK; } #endif /* * Open a file for writing for an Ex command, with some checks. * Return file descriptor, or NULL on failure. */ FILE * open_exfile( 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(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(void) { check_cursor(); /* put cursor on valid line */ update_topline(); if (!curwin->w_p_wrap) validate_cursor(); update_curswant(); } /* * ":normal[!] {commands}": Execute normal mode commands. */ void ex_normal(exarg_T *eap) { 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; int save_opcount = opcount; #ifdef FEAT_MBYTE char_u *arg = NULL; int l; char_u *p; #endif if (ex_normal_lock > 0) { EMSG(_(e_secure)); return; } 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)(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)(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 { if (eap->addr_count != 0) { curwin->w_cursor.lnum = eap->line1++; curwin->w_cursor.col = 0; } exec_normal_cmd( #ifdef FEAT_MBYTE arg != NULL ? arg : #endif eap->arg, eap->forceit ? REMAP_NONE : REMAP_YES, FALSE); } 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; opcount = save_opcount; msg_didout |= save_msg_didout; /* don't reset msg_didout now */ /* Restore the state (needed when called from a function executed for * 'indentexpr'). Update the mouse and cursor, they may have changed. */ State = save_State; #ifdef FEAT_MOUSE setmouse(); #endif #ifdef CURSOR_SHAPE ui_cursor_shape(); /* may show different cursor shape */ #endif #ifdef FEAT_MBYTE vim_free(arg); #endif } /* * ":startinsert", ":startreplace" and ":startgreplace" */ static void ex_startinsert(exarg_T *eap) { if (eap->forceit) { coladvance((colnr_T)MAXCOL); curwin->w_curswant = MAXCOL; curwin->w_set_curswant = FALSE; } /* Ignore the command when already in Insert mode. Inserting an * expression register that invokes a function can do this. */ if (State & INSERT) return; if (eap->cmdidx == CMD_startinsert) restart_edit = 'a'; else if (eap->cmdidx == CMD_startreplace) restart_edit = 'R'; else restart_edit = 'V'; if (!eap->forceit) { if (eap->cmdidx == CMD_startinsert) restart_edit = 'i'; curwin->w_curswant = 0; /* avoid MAXCOL */ } } /* * ":stopinsert" */ static void ex_stopinsert(exarg_T *eap UNUSED) { restart_edit = 0; stop_insert_mode = TRUE; } /* * Execute normal mode command "cmd". * "remap" can be REMAP_NONE or REMAP_YES. */ void exec_normal_cmd(char_u *cmd, int remap, int silent) { /* Stuff the argument into the typeahead buffer. */ ins_typebuf(cmd, remap, 0, TRUE, silent); exec_normal(FALSE); } /* * Execute normal_cmd() until there is no typeahead left. */ void exec_normal(int was_typed) { oparg_T oa; clear_oparg(&oa); finish_op = FALSE; while ((!stuff_empty() || ((was_typed || !typebuf_typed()) && typebuf.tb_len > 0)) && !got_int) { update_topline_cursor(); normal_cmd(&oa, TRUE); /* execute a Normal mode cmd */ } } #ifdef FEAT_FIND_ID static void ex_checkpath(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(exarg_T *eap) { g_do_tagpreview = p_pvh; ex_findpat(eap); g_do_tagpreview = 0; } #endif static void ex_findpat(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(exarg_T *eap) { g_do_tagpreview = p_pvh; /* will be reset to 0 in ex_tag_cmd() */ ex_tag_cmd(eap, cmdnames[eap->cmdidx].cmd_name + 1); } /* * ":pedit" */ static void ex_pedit(exarg_T *eap) { win_T *curwin_save = curwin; g_do_tagpreview = p_pvh; prepare_tagpreview(TRUE); 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(exarg_T *eap) { postponed_split = -1; postponed_split_flags = cmdmod.split; postponed_split_tab = cmdmod.tab; ex_tag_cmd(eap, cmdnames[eap->cmdidx].cmd_name + 1); postponed_split_flags = 0; postponed_split_tab = 0; } #endif /* * ":tag", ":tselect", ":tjump", ":tnext", etc. */ static void ex_tag(exarg_T *eap) { ex_tag_cmd(eap, cmdnames[eap->cmdidx].cmd_name); } static void ex_tag_cmd(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 && *eap->arg != NUL) { do_cstag(eap); return; } #endif cmd = DT_TAG; break; } if (name[0] == 'l') { #ifndef FEAT_QUICKFIX ex_ni(eap); return; #else cmd = DT_LTAG; #endif } do_tag(eap->arg, cmd, eap->addr_count > 0 ? (int)eap->line2 : 1, eap->forceit, TRUE); } /* * Check "str" for starting with a special cmdline variable. * If found return one of the SPEC_ values and set "*usedlen" to the length of * the variable. Otherwise return -1 and "*usedlen" is unchanged. */ int find_cmdline_var(char_u *src, int *usedlen) { int len; int i; static char *(spec_str[]) = { "%", #define SPEC_PERC 0 "#", #define SPEC_HASH 1 "", /* cursor word */ #define SPEC_CWORD 2 "", /* cursor WORD */ #define SPEC_CCWORD 3 "", /* cursor path name */ #define SPEC_CFILE 4 "", /* ":so" file name */ #define SPEC_SFILE 5 "", /* ":so" file line number */ #define SPEC_SLNUM 6 #ifdef FEAT_AUTOCMD "", /* autocommand file name */ # define SPEC_AFILE 7 "", /* autocommand buffer number */ # define SPEC_ABUF 8 "", /* autocommand match name */ # define SPEC_AMATCH 9 #endif #ifdef FEAT_CLIENTSERVER "" # ifdef FEAT_AUTOCMD # define SPEC_CLIENT 10 # else # define SPEC_CLIENT 7 # endif #endif }; for (i = 0; i < (int)(sizeof(spec_str) / sizeof(char *)); ++i) { len = (int)STRLEN(spec_str[i]); if (STRNCMP(src, spec_str[i], len) == 0) { *usedlen = len; return i; } } return -1; } /* * Evaluate cmdline variables. * * change '%' to curbuf->b_ffname * '#' to curwin->w_altfile * '' to word under the cursor * '' to WORD under the cursor * '' to path name under the cursor * '' to sourced file name * '' to sourced file line number * '' to file name for autocommand * '' to buffer number for autocommand * '' 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( char_u *src, /* pointer into commandline */ char_u *srcstart, /* beginning of valid memory for src */ 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 */ int *escaped) /* return value has escaped white space (can * be NULL) */ { 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 char_u strbuf[30]; *errormsg = NULL; if (escaped != NULL) *escaped = FALSE; /* * Check if there is something to do. */ spec_idx = find_cmdline_var(src, usedlen); if (spec_idx < 0) /* 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; STRMOVE(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 result = curbuf->b_fname; break; case SPEC_HASH: /* '#' or "#99": alternate file */ if (src[1] == '#') /* "##": the argument list */ { result = arg_all(); resultbuf = result; *usedlen = 2; if (escaped != NULL) *escaped = TRUE; #ifdef FEAT_MODIFY_FNAME skip_mod = TRUE; #endif break; } s = src + 1; if (*s == '<') /* "#<99" uses v:oldfiles */ ++s; i = (int)getdigits(&s); *usedlen = (int)(s - src); /* length of what we expand */ if (src[1] == '<') { if (*usedlen < 2) { /* Should we give an error message for #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, NULL); 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 && !autocmd_fname_full) { /* Still need to turn the fname into a full path. It is * postponed to avoid a delay when is not used. */ autocmd_fname_full = TRUE; result = FullName_save(autocmd_fname, FALSE); vim_free(autocmd_fname); autocmd_fname = result; } if (result == NULL) { *errormsg = (char_u *)_("E495: no autocommand file name to substitute for \"\""); return NULL; } result = shorten_fname1(result); break; case SPEC_ABUF: /* buffer number for autocommand */ if (autocmd_bufnr <= 0) { *errormsg = (char_u *)_("E496: no autocommand buffer number to substitute for \"\""); 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 \"\""); 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 \"\""); return NULL; } break; case SPEC_SLNUM: /* line in file for ":so" command */ if (sourcing_name == NULL || sourcing_lnum == 0) { *errormsg = (char_u *)_("E842: no line number to use for \"\""); return NULL; } sprintf((char *)strbuf, "%ld", (long)sourcing_lnum); result = strbuf; break; #if defined(FEAT_CLIENTSERVER) case SPEC_CLIENT: /* Source of last submitted input */ sprintf((char *)strbuf, PRINTF_HEX_LONG_U, (long_u)clientWindow); result = strbuf; break; #endif } resultlen = (int)STRLEN(result); /* length of new string */ if (src[*usedlen] == '<') /* remove the file name extension */ { ++*usedlen; if ((s = vim_strrchr(result, '.')) != NULL && s >= gettail(result)) 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(void) { 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 == ' ' #ifndef BACKSLASH_IN_FILENAME || *p == '\\' #endif ) { /* 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((unsigned)len + 1); if (retval == NULL) break; } return retval; } #if defined(FEAT_AUTOCMD) || defined(PROTO) /* * Expand the string in "arg". * * Returns an allocated string, or NULL for any error. */ char_u * expand_sfile(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, "", 7) != 0) ++p; else { /* replace "" with the sourced file name, and do ":" stuff */ repl = eval_vars(p, result, &srclen, NULL, &errormsg, NULL); 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(FILE *fd, int restore_size, win_T *tab_firstwin); static int ses_win_rec(FILE *fd, frame_T *fr); static frame_T *ses_skipframe(frame_T *fr); static int ses_do_frame(frame_T *fr); static int ses_do_win(win_T *wp); static int ses_arglist(FILE *fd, char *cmd, garray_T *gap, int fullname, unsigned *flagp); static int ses_put_fname(FILE *fd, char_u *name, unsigned *flagp); static int ses_fname(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( FILE *fd, char_u *dirnow) /* Current directory name */ { buf_T *buf; int only_save_windows = TRUE; int nr; int restore_size = TRUE; win_T *wp; char_u *sname; win_T *edited_win = NULL; int tabnr; int restore_stal = FALSE; win_T *tab_firstwin; frame_T *tab_topframe; int cur_arg_idx = 0; int next_arg_idx = 0; 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(\":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 \" . escape(expand(\":p:h\"), ' ')") == FAIL) return FAIL; } else if (ssop_flags & SSOP_CURDIR) { sname = home_replace_save(NULL, globaldir != NULL ? globaldir : dirnow); if (sname == NULL || fputs("cd ", fd) < 0 || ses_put_fname(fd, sname, &ssop_flags) == FAIL || put_eol(fd) == FAIL) { vim_free(sname); return FAIL; } vim_free(sname); } /* * If there is an empty, unnamed buffer we will wipe it out later. * Remember the buffer number. */ if (put_line(fd, "if expand('%') == '' && !&modified && line('$') <= 1 && getline(1) == ''") == FAIL) return FAIL; if (put_line(fd, " let s:wipebuf = bufnr('%')") == FAIL) return FAIL; if (put_line(fd, "endif") == FAIL) return FAIL; /* * 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, "argglobal", &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 /* * When there are two or more tabpages and 'showtabline' is 1 the tabline * will be displayed when creating the next tab. That resizes the windows * in the first tab, which may cause problems. Set 'showtabline' to 2 * temporarily to avoid that. */ if (p_stal == 1 && first_tabpage->tp_next != NULL) { if (put_line(fd, "set stal=2") == FAIL) return FAIL; restore_stal = TRUE; } /* * May repeat putting Windows for each tab, when "tabpages" is in * 'sessionoptions'. * Don't use goto_tabpage(), it may change directory and trigger * autocommands. */ tab_firstwin = firstwin; /* first window in tab page "tabnr" */ tab_topframe = topframe; for (tabnr = 1; ; ++tabnr) { int need_tabnew = FALSE; int cnr = 1; if ((ssop_flags & SSOP_TABPAGES)) { tabpage_T *tp = find_tabpage(tabnr); if (tp == NULL) break; /* done all tab pages */ if (tp == curtab) { tab_firstwin = firstwin; tab_topframe = topframe; } else { tab_firstwin = tp->tp_firstwin; tab_topframe = tp->tp_topframe; } if (tabnr > 1) need_tabnew = TRUE; } /* * 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 = tab_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(need_tabnew ? "tabedit " : "edit ", fd) < 0 || ses_fname(fd, wp->w_buffer, &ssop_flags) == FAIL) return FAIL; need_tabnew = FALSE; if (!wp->w_arg_idx_invalid) edited_win = wp; break; } } /* If no file got edited create an empty tab page. */ if (need_tabnew && put_line(fd, "tabnew") == FAIL) return FAIL; /* * Save current window layout. */ if (put_line(fd, "set splitbelow splitright") == FAIL) return FAIL; if (ses_win_rec(fd, tab_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 = tab_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, tab_firstwin) == FAIL) return FAIL; /* * Restore the view of the window (options, file, cursor, etc.). */ for (wp = tab_firstwin; wp != NULL; wp = wp->w_next) { if (!ses_do_win(wp)) continue; if (put_view(fd, wp, wp != edited_win, &ssop_flags, cur_arg_idx) == FAIL) return FAIL; if (nr > 1 && put_line(fd, "wincmd w") == FAIL) return FAIL; next_arg_idx = wp->w_arg_idx; } /* The argument index in the first tab page is zero, need to set it in * each window. For further tab pages it's the window where we do * "tabedit". */ cur_arg_idx = next_arg_idx; /* * 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, tab_firstwin) == FAIL) return FAIL; /* Don't continue in another tab page when doing only the current one * or when at the last tab page. */ if (!(ssop_flags & SSOP_TABPAGES)) break; } if (ssop_flags & SSOP_TABPAGES) { if (fprintf(fd, "tabnext %d", tabpage_index(curtab)) < 0 || put_eol(fd) == FAIL) return FAIL; } if (restore_stal && put_line(fd, "set stal=1") == FAIL) return FAIL; /* * Wipe out an empty unnamed buffer we started in. */ if (put_line(fd, "if exists('s:wipebuf')") == FAIL) return FAIL; if (put_line(fd, " silent exe 'bwipe ' . s:wipebuf") == FAIL) return FAIL; if (put_line(fd, "endif") == FAIL) return FAIL; if (put_line(fd, "unlet! s:wipebuf") == 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(\":p:r\").\"x.vim\"") == FAIL || put_line(fd, "if file_readable(s:sx)") == FAIL || put_line(fd, " exe \"source \" . fnameescape(s:sx)") == FAIL || put_line(fd, "endif") == FAIL) return FAIL; return OK; } static int ses_winsizes( FILE *fd, int restore_size, win_T *tab_firstwin) { int n = 0; win_T *wp; if (restore_size && (ssop_flags & SSOP_WINSIZE)) { for (wp = tab_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(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(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(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(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( FILE *fd, win_T *wp, int add_edit, /* add ":edit" command to view */ unsigned *flagp, /* vop_flags or ssop_flags */ int current_arg_idx) /* current argument index of the window, use * -1 if unknown */ { win_T *save_curwin; int f; int do_cursor; int did_next = FALSE; /* 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. Some * arguments may have been deleted, check if the index is valid. */ if (wp->w_arg_idx != current_arg_idx && wp->w_arg_idx < WARGCOUNT(wp) && flagp == &ssop_flags) { if (fprintf(fd, "%ldargu", (long)wp->w_arg_idx + 1) < 0 || put_eol(fd) == FAIL) return FAIL; did_next = TRUE; } /* Edit the file. Skip this when ":next" already did it. */ if (add_edit && (!did_next || 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 # ifdef FEAT_QUICKFIX && (*wp->w_buffer->b_p_bt == NUL || wp->w_buffer->b_help) # endif ) { 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_virtcol + 1, (long)(wp->w_virtcol - 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! ' . s:c . '|zs' . %ld . '|'", (long)wp->w_virtcol + 1) < 0 || put_eol(fd) == FAIL || put_line(fd, "else") == FAIL || fprintf(fd, " normal! 0%d|", wp->w_virtcol + 1) < 0 || put_eol(fd) == FAIL || put_line(fd, "endif") == FAIL) return FAIL; } else { if (fprintf(fd, "normal! 0%d|", wp->w_virtcol + 1) < 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; did_lcd = TRUE; } return OK; } /* * Write an argument list to the session file. * Returns FAIL if writing fails. */ static int ses_arglist( FILE *fd, char *cmd, garray_T *gap, int fullname, /* TRUE: use full path name */ unsigned *flagp) { int i; char_u *buf = NULL; char_u *s; if (fputs(cmd, fd) < 0 || put_eol(fd) == FAIL) return FAIL; if (put_line(fd, "silent! argdel *") == FAIL) 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) { buf = alloc(MAXPATHL); if (buf != NULL) { (void)vim_FullName(s, buf, MAXPATHL, FALSE); s = buf; } } if (fputs("argadd ", fd) < 0 || ses_put_fname(fd, s, flagp) == FAIL || put_eol(fd) == FAIL) { vim_free(buf); return FAIL; } vim_free(buf); } } return OK; } /* * Write a buffer name to the session file. * Also ends the line. * Returns FAIL if writing fails. */ static int ses_fname(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. * Don't do this after ":lcd", we don't keep track of what the current * directory is. */ if (buf->b_sfname != NULL && flagp == &ssop_flags && (ssop_flags & (SSOP_CURDIR | SSOP_SESDIR)) #ifdef FEAT_AUTOCHDIR && !p_acd #endif && !did_lcd) 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 or out of memory. */ static int ses_put_fname(FILE *fd, char_u *name, unsigned *flagp) { char_u *sname; char_u *p; int retval = OK; sname = home_replace_save(NULL, name); if (sname == NULL) return FAIL; if (*flagp & SSOP_SLASH) { /* change all backslashes to forward slashes */ for (p = sname; *p != NUL; mb_ptr_adv(p)) if (*p == '\\') *p = '/'; } /* escape special characters */ p = vim_strsave_fnameescape(sname, FALSE); vim_free(sname); if (p == NULL) return FAIL; /* write the result */ if (fputs((char *)p, fd) < 0) retval = FAIL; vim_free(p); return retval; } /* * ":loadview [nr]" */ static void ex_loadview(exarg_T *eap) { char_u *fname; fname = get_view_file(*eap->arg); if (fname != NULL) { do_source(fname, FALSE, DOSO_NONE); vim_free(fname); } } /* * Get the name of the view file for the current buffer. */ static char_u * get_view_file(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++ = '='; #if defined(BACKSLASH_IN_FILENAME) || defined(AMIGA) || defined(VMS) if (*p == ':') *s++ = '-'; else #endif *s++ = '+'; } 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(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(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( 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, VIF_WANT_INFO | VIF_WANT_MARKS | (eap->forceit ? VIF_FORCEIT : 0)) == 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) /* * Make a dialog message in "buff[DIALOG_MSG_SIZE]". * "format" must contain "%s". */ void dialog_msg(char_u *buff, char *format, char_u *fname) { if (fname == NULL) fname = (char_u *)_("Untitled"); vim_snprintf((char *)buff, DIALOG_MSG_SIZE, format, fname); } #endif /* * ":behave {mswin,xterm}" */ static void ex_behave(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); } #if defined(FEAT_CMDL_COMPL) || defined(PROTO) /* * Function given to ExpandGeneric() to obtain the possible arguments of the * ":behave {mswin,xterm}" command. */ char_u * get_behave_arg(expand_T *xp UNUSED, int idx) { if (idx == 0) return (char_u *)"mswin"; if (idx == 1) return (char_u *)"xterm"; return NULL; } #endif #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(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) { source_runtime((char_u *)FILETYPE_FILE, DIP_ALL); filetype_detect = TRUE; if (plugin) { source_runtime((char_u *)FTPLUGIN_FILE, DIP_ALL); filetype_plugin = TRUE; } if (indent) { source_runtime((char_u *)INDENT_FILE, DIP_ALL); filetype_indent = TRUE; } } if (*arg == 'd') { (void)do_doautocmd((char_u *)"filetypedetect BufRead", TRUE); do_modelines(0); } } else if (STRCMP(arg, "off") == 0) { if (plugin || indent) { if (plugin) { source_runtime((char_u *)FTPLUGOF_FILE, DIP_ALL); filetype_plugin = FALSE; } if (indent) { source_runtime((char_u *)INDOFF_FILE, DIP_ALL); filetype_indent = FALSE; } } else { source_runtime((char_u *)FTOFF_FILE, DIP_ALL); filetype_detect = FALSE; } } else EMSG2(_(e_invarg2), arg); } /* * ":setfiletype {name}" */ static void ex_setfiletype(exarg_T *eap) { if (!did_filetype) set_option_value((char_u *)"filetype", 0L, eap->arg, OPT_LOCAL); } #endif static void ex_digraphs(exarg_T *eap UNUSED) { #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(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" */ static void ex_nohlsearch(exarg_T *eap UNUSED) { SET_NO_HLSEARCH(TRUE); redraw_all_later(SOME_VALID); } /* * ":[N]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(exarg_T *eap) { char_u *p; char_u *g = NULL; char_u *end; int c; int id; if (eap->line2 <= 3) id = eap->line2; else { EMSG(e_invcmd); return; } /* First clear any old pattern. */ if (!eap->skip) match_delete(curwin, id, FALSE); 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) g = vim_strnsave(eap->arg, (int)(p - eap->arg)); p = skipwhite(p); if (*p == NUL) { /* There must be two arguments. */ vim_free(g); 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))) { vim_free(g); eap->errmsg = e_trailing; return; } if (*end != *p) { vim_free(g); EMSG2(_(e_invarg2), p); return; } c = *end; *end = NUL; match_add(curwin, g, p + 1, 10, id, NULL, NULL); vim_free(g); *end = c; } } eap->nextcmd = find_nextcmd(end); } #endif #ifdef FEAT_CRYPT /* * ":X": Get crypt key */ static void ex_X(exarg_T *eap UNUSED) { crypt_check_current_method(); (void)crypt_get_key(TRUE, TRUE); } #endif #ifdef FEAT_FOLDING static void ex_fold(exarg_T *eap) { if (foldManualAllowed(TRUE)) foldCreate(eap->line1, eap->line2); } static void ex_foldopen(exarg_T *eap) { opFoldRange(eap->line1, eap->line2, eap->cmdidx == CMD_foldopen, eap->forceit, FALSE); } static void ex_folddo(exarg_T *eap) { linenr_T lnum; #ifdef FEAT_CLIPBOARD start_global_changes(); #endif /* 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 */ #ifdef FEAT_CLIPBOARD end_global_changes(); #endif } #endif vim-7.4.1689/src/ex_eval.c000066400000000000000000002066571267703067000151730ustar00rootroot00000000000000/* 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(struct msglist *l); static int throw_exception(void *, int, char_u *); static char_u *get_end_emsg(struct condstack *cstack); /* * 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 asynchronously 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_ERROR_TRUE # define THROW_ON_INTERRUPT TRUE # define THROW_ON_INTERRUPT_TRUE #endif static void catch_exception(except_T *excp); static void finish_exception(except_T *excp); static void discard_exception(except_T *excp, int was_finished); static void report_pending(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 immediately 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(void) { 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(void) { 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(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(void) { /* 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( 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(struct msglist *l) { struct msglist *messages, *next; messages = l; while (messages != NULL) { next = messages->next; vim_free(messages->msg); vim_free(messages); messages = next; } } /* * Free global "*msg_list" and the messages it contains, then set "*msg_list" * to NULL. */ void free_global_msglist(void) { free_msglist(*msg_list); *msg_list = NULL; } /* * 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(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 || *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(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; } /* * Get an exception message that is to be stored in current_exception->value. */ char_u * get_exception_string( void *value, int type, char_u *cmdname, int *should_free) { char_u *ret, *mesg; int cmdlen; char_u *p, *val; if (type == ET_ERROR) { *should_free = TRUE; mesg = ((struct msglist *)value)->throw_msg; if (cmdname != NULL && *cmdname != NUL) { cmdlen = (int)STRLEN(cmdname); ret = vim_strnsave((char_u *)"Vim(", 4 + cmdlen + 2 + (int)STRLEN(mesg)); if (ret == NULL) return ret; STRCPY(&ret[4], cmdname); STRCPY(&ret[4 + cmdlen], "):"); val = ret + 4 + cmdlen + 2; } else { ret = vim_strnsave((char_u *)"Vim:", 4 + (int)STRLEN(mesg)); if (ret == NULL) return ret; val = ret + 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) STRCAT(val, mesg); /* 'E123' missing or at beginning */ 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 { *should_free = FALSE; ret = (char_u *)value; } return ret; } /* * 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(void *value, int type, char_u *cmdname) { except_T *excp; int should_free; /* * 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; excp->value = get_exception_string(value, type, cmdname, &should_free); if (excp->value == NULL && should_free) goto nomem; excp->type = type; excp->throw_name = vim_strsave(sourcing_name == NULL ? (char_u *)"" : sourcing_name); if (excp->throw_name == NULL) { if (should_free) 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 */ else verbose_enter(); ++no_wait_return; if (debug_break_level > 0 || *p_vfile == NUL) msg_scroll = TRUE; /* always scroll up, don't overwrite */ smsg((char_u *)_("Exception thrown: %s"), excp->value); msg_puts((char_u *)"\n"); /* don't overwrite this either */ if (debug_break_level > 0 || *p_vfile == NUL) cmdline_row = msg_row; --no_wait_return; if (debug_break_level > 0) msg_silent = save_msg_silent; else verbose_leave(); } 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(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 */ else verbose_enter(); ++no_wait_return; if (debug_break_level > 0 || *p_vfile == NUL) msg_scroll = TRUE; /* always scroll up, don't overwrite */ smsg(was_finished ? (char_u *)_("Exception finished: %s") : (char_u *)_("Exception discarded: %s"), excp->value); msg_puts((char_u *)"\n"); /* don't overwrite this either */ if (debug_break_level > 0 || *p_vfile == NUL) cmdline_row = msg_row; --no_wait_return; if (debug_break_level > 0) msg_silent = save_msg_silent; else verbose_leave(); 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(void) { 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(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) vim_snprintf((char *)IObuff, IOSIZE, _("%s, line %ld"), excp->throw_name, (long)excp->throw_lnum); else vim_snprintf((char *)IObuff, IOSIZE, "%s", 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 */ else verbose_enter(); ++no_wait_return; if (debug_break_level > 0 || *p_vfile == NUL) msg_scroll = TRUE; /* always scroll up, don't overwrite */ smsg((char_u *)_("Exception caught: %s"), excp->value); msg_puts((char_u *)"\n"); /* don't overwrite this either */ if (debug_break_level > 0 || *p_vfile == NUL) cmdline_row = msg_row; --no_wait_return; if (debug_break_level > 0) msg_silent = save_msg_silent; else verbose_leave(); } } /* * Remove an exception from the caught stack. */ static void finish_exception(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) vim_snprintf((char *)IObuff, IOSIZE, _("%s, line %ld"), caught_stack->throw_name, (long)caught_stack->throw_lnum); else vim_snprintf((char *)IObuff, IOSIZE, "%s", 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(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) { vim_snprintf((char *)IObuff, IOSIZE, (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 */ smsg(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(int pending, void *value) { if (p_verbose >= 14 || debug_break_level > 0) { if (debug_break_level <= 0) verbose_enter(); report_pending(RP_MAKE, pending, value); if (debug_break_level <= 0) verbose_leave(); } } /* * 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(int pending, void *value) { if (p_verbose >= 14 || debug_break_level > 0) { if (debug_break_level <= 0) verbose_enter(); report_pending(RP_RESUME, pending, value); if (debug_break_level <= 0) verbose_leave(); } } /* * If something pending in a finally clause is discarded, report it if required * by the 'verbose' option or when debugging. */ void report_discard_pending(int pending, void *value) { if (p_verbose >= 14 || debug_break_level > 0) { if (debug_break_level <= 0) verbose_enter(); report_pending(RP_DISCARD, pending, value); if (debug_break_level <= 0) verbose_leave(); } } /* * ":if". */ void ex_if(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(exarg_T *eap) { did_endif = TRUE; if (eap->cstack->cs_idx < 0 || (eap->cstack->cs_flags[eap->cstack->cs_idx] & (CSF_WHILE | CSF_FOR | 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(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_FOR | 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" and ":for". */ void ex_while(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/:for nesting too deep"); else { /* * The loop flag is set when we have jumped back from the matching * ":endwhile" or ":endfor". When not set, need to initialise this * cstack entry. */ if ((cstack->cs_lflags & CSL_HAD_LOOP) == 0) { ++cstack->cs_idx; ++cstack->cs_looplevel; cstack->cs_line[cstack->cs_idx] = -1; } cstack->cs_flags[cstack->cs_idx] = eap->cmdidx == CMD_while ? CSF_WHILE : CSF_FOR; /* * 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 (eap->cmdidx == CMD_while) { /* * ":while bool-expr" */ result = eval_to_bool(eap->arg, &error, &eap->nextcmd, skip); } else { void *fi; /* * ":for var in list-expr" */ if ((cstack->cs_lflags & CSL_HAD_LOOP) != 0) { /* Jumping here from a ":continue" or ":endfor": use the * previously evaluated list. */ fi = cstack->cs_forinfo[cstack->cs_idx]; error = FALSE; } else { /* Evaluate the argument and get the info in a structure. */ fi = eval_for_line(eap->arg, &error, &eap->nextcmd, skip); cstack->cs_forinfo[cstack->cs_idx] = fi; } /* use the element at the start of the list and advance */ if (!error && fi != NULL && !skip) result = next_for_item(fi, eap->arg); else result = FALSE; if (!result) { free_for_info(fi); cstack->cs_forinfo[cstack->cs_idx] = NULL; } } /* * If this cstack entry was just initialised and is active, set the * loop flag, so do_cmdline() will set the line number in cs_line[]. * If executing the command a second time, clear the loop flag. */ if (!skip && !error && result) { cstack->cs_flags[cstack->cs_idx] |= (CSF_ACTIVE | CSF_TRUE); cstack->cs_lflags ^= CSL_HAD_LOOP; } else { cstack->cs_lflags &= ~CSL_HAD_LOOP; /* If the ":while" evaluates to FALSE or ":for" is past the end of * the list, show the debug prompt at the ":endwhile"/":endfor" as * if there was a ":break" in a ":while"/":for" evaluating to * TRUE. */ if (!skip && !error) cstack->cs_flags[cstack->cs_idx] |= CSF_TRUE; } } } /* * ":continue" */ void ex_continue(exarg_T *eap) { int idx; struct condstack *cstack = eap->cstack; if (cstack->cs_looplevel <= 0 || cstack->cs_idx < 0) eap->errmsg = (char_u *)N_("E586: :continue without :while or :for"); 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 | CSF_FOR, FALSE); if (idx >= 0 && (cstack->cs_flags[idx] & (CSF_WHILE | CSF_FOR))) { rewind_conditionals(cstack, idx, CSF_TRY, &cstack->cs_trylevel); /* * Set CSL_HAD_CONT, so do_cmdline() will jump back to the * matching ":while". */ cstack->cs_lflags |= CSL_HAD_CONT; /* 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(exarg_T *eap) { int idx; struct condstack *cstack = eap->cstack; if (cstack->cs_looplevel <= 0 || cstack->cs_idx < 0) eap->errmsg = (char_u *)N_("E587: :break without :while or :for"); 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 | CSF_FOR, TRUE); if (idx >= 0 && !(cstack->cs_flags[idx] & (CSF_WHILE | CSF_FOR))) { cstack->cs_pending[idx] = CSTP_BREAK; report_make_pending(CSTP_BREAK, NULL); } } } /* * ":endwhile" and ":endfor" */ void ex_endwhile(exarg_T *eap) { struct condstack *cstack = eap->cstack; int idx; char_u *err; int csf; int fl; if (eap->cmdidx == CMD_endwhile) { err = e_while; csf = CSF_WHILE; } else { err = e_for; csf = CSF_FOR; } if (cstack->cs_looplevel <= 0 || cstack->cs_idx < 0) eap->errmsg = err; else { fl = cstack->cs_flags[cstack->cs_idx]; if (!(fl & csf)) { /* If we are in a ":while" or ":for" but used the wrong endloop * command, do not rewind to the next enclosing ":for"/":while". */ if (fl & CSF_WHILE) eap->errmsg = (char_u *)_("E732: Using :endfor with :while"); else if (fl & CSF_FOR) eap->errmsg = (char_u *)_("E733: Using :endwhile with :for"); } if (!(fl & (CSF_WHILE | CSF_FOR))) { if (!(fl & CSF_TRY)) eap->errmsg = e_endif; else if (fl & CSF_FINALLY) eap->errmsg = e_endtry; /* Try to find the matching ":while" and report what's missing. */ for (idx = cstack->cs_idx; idx > 0; --idx) { fl = cstack->cs_flags[idx]; if ((fl & CSF_TRY) && !(fl & CSF_FINALLY)) { /* Give up at a try conditional not in its finally clause. * Ignore the ":endwhile"/":endfor". */ eap->errmsg = err; return; } if (fl & csf) break; } /* Cleanup and rewind all contained (and unclosed) conditionals. */ (void)cleanup_conditionals(cstack, CSF_WHILE | CSF_FOR, 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 * ":endwhile"/":endfor" 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"/":endfor". 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 loop flag, so do_cmdline() will jump back to the matching * ":while" or ":for". */ cstack->cs_lflags |= CSL_HAD_ENDLOOP; } } /* * ":throw expr" */ void ex_throw(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(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. */ #ifndef THROW_ON_ERROR_TRUE if (did_emsg && !THROW_ON_ERROR) { inactivate_try = TRUE; did_emsg = FALSE; } #endif #ifndef THROW_ON_INTERRUPT_TRUE if (got_int && !THROW_ON_INTERRUPT) { inactivate_try = TRUE; got_int = FALSE; } #endif 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(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(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. */ eap->errmsg = get_end_emsg(cstack); 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 rewind_conditionals(cstack, idx, CSF_WHILE | CSF_FOR, &cstack->cs_looplevel); } 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 *)""; /* Disable error messages, it will make current_exception * invalid. */ ++emsg_off; regmatch.regprog = vim_regcomp(pat, RE_MAGIC + RE_STRING); --emsg_off; 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(®match, current_exception->value, (colnr_T)0); got_int |= prev_got_int; vim_regfree(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(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)) { eap->errmsg = get_end_emsg(cstack); 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; } rewind_conditionals(cstack, idx, CSF_WHILE | CSF_FOR, &cstack->cs_looplevel); /* * 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", ":endfor" 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_rettv[cstack->cs_idx]); discard_pending_return(cstack->cs_rettv[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"/":endfor" detected here, the * exception will be discarded. */ if (did_throw && cstack->cs_exception[cstack->cs_idx] != current_exception) EMSG(_(e_internal)); } /* * Set CSL_HAD_FINA, 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"/":endfor" detected here, so * that the following finally clause will be executed even then. */ cstack->cs_lflags |= CSL_HAD_FINA; } } } /* * ":endtry" */ void ex_endtry(exarg_T *eap) { int idx; int skip; int rethrow = FALSE; int pending = CSTP_NONE; void *rettv = 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)) { eap->errmsg = get_end_emsg(cstack); /* Find the matching ":try" and report what's missing. */ idx = cstack->cs_idx; do --idx; while (idx > 0 && !(cstack->cs_flags[idx] & CSF_TRY)); rewind_conditionals(cstack, idx, CSF_WHILE | CSF_FOR, &cstack->cs_looplevel); 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) rettv = cstack->cs_rettv[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. */ (void)cleanup_conditionals(cstack, CSF_TRY | CSF_SILENT, TRUE); --cstack->cs_idx; --cstack->cs_trylevel; if (!skip) { report_resume_pending(pending, (pending == CSTP_RETURN) ? rettv : (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, rettv); 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); } } /* * enter_cleanup() and leave_cleanup() * * Functions to be called before/after invoking a sequence of autocommands for * cleanup for a failed command. (Failure means here that a call to emsg() * has been made, an interrupt occurred, or there is an uncaught exception * from a previous autocommand execution of the same command.) * * Call enter_cleanup() with a pointer to a cleanup_T and pass the same * pointer to leave_cleanup(). The cleanup_T structure stores the pending * error/interrupt/exception state. */ /* * This function works a bit like ex_finally() except that there was not * actually an extra try block around the part that failed and an error or * interrupt has not (yet) been converted to an exception. This function * saves the error/interrupt/ exception state and prepares for the call to * do_cmdline() that is going to be made for the cleanup autocommand * execution. */ void enter_cleanup(cleanup_T *csp) { int pending = CSTP_NONE; /* * Postpone did_emsg, got_int, did_throw. The pending values will be * restored by leave_cleanup() except if there was an aborting error, * interrupt, or uncaught exception after this function ends. */ if (did_emsg || got_int || did_throw || need_rethrow) { csp->pending = (did_emsg ? CSTP_ERROR : 0) | (got_int ? CSTP_INTERRUPT : 0) | (did_throw ? CSTP_THROW : 0) | (need_rethrow ? CSTP_THROW : 0); /* If we are currently throwing an exception (did_throw), save it as * well. On an error not yet converted to an exception, update * "force_abort" and reset "cause_abort" (as do_errthrow() would do). * This is needed for the do_cmdline() call that is going to be made * for autocommand execution. We need not save *msg_list because * there is an extra instance for every call of do_cmdline(), anyway. */ if (did_throw || need_rethrow) csp->exception = current_exception; else { csp->exception = NULL; if (did_emsg) { force_abort |= cause_abort; cause_abort = FALSE; } } did_emsg = got_int = did_throw = need_rethrow = FALSE; /* Report if required by the 'verbose' option or when debugging. */ report_make_pending(pending, csp->exception); } else { csp->pending = CSTP_NONE; csp->exception = NULL; } } /* * See comment above enter_cleanup() for how this function is used. * * This function is a bit like ex_endtry() except that there was not actually * an extra try block around the part that failed and an error or interrupt * had not (yet) been converted to an exception when the cleanup autocommand * sequence was invoked. * * This function has to be called with the address of the cleanup_T structure * filled by enter_cleanup() as an argument; it restores the error/interrupt/ * exception state saved by that function - except there was an aborting * error, an interrupt or an uncaught exception during execution of the * cleanup autocommands. In the latter case, the saved error/interrupt/ * exception state is discarded. */ void leave_cleanup(cleanup_T *csp) { int pending = csp->pending; if (pending == CSTP_NONE) /* nothing to do */ return; /* If there was an aborting error, an interrupt, or an uncaught exception * after the corresponding call to enter_cleanup(), discard what has been * made pending by it. Report this to the user if required by the * 'verbose' option or when debugging. */ if (aborting() || need_rethrow) { if (pending & CSTP_THROW) /* Cancel the pending exception (includes report). */ discard_exception((except_T *)csp->exception, FALSE); else report_discard_pending(pending, NULL); /* If an error was about to be converted to an exception when * enter_cleanup() was called, free the message list. */ if (msg_list != NULL) free_global_msglist(); } /* * If there was no new error, interrupt, or throw between the calls * to enter_cleanup() and leave_cleanup(), restore the pending * error/interrupt/exception state. */ else { /* * If there was an exception being thrown when enter_cleanup() was * called, we need to rethrow it. Make it the exception currently * being thrown. */ if (pending & CSTP_THROW) current_exception = csp->exception; /* * If an error was about to be converted to an exception when * enter_cleanup() was called, let "cause_abort" take the part of * "force_abort" (as done by cause_errthrow()). */ else if (pending & CSTP_ERROR) { cause_abort = force_abort; force_abort = FALSE; } /* * Restore the pending values of did_emsg, got_int, and did_throw. */ if (pending & CSTP_ERROR) did_emsg = TRUE; if (pending & CSTP_INTERRUPT) got_int = TRUE; if (pending & CSTP_THROW) need_rethrow = TRUE; /* did_throw will be set by do_one_cmd() */ /* Report if required by the 'verbose' option or when debugging. */ report_resume_pending(pending, (pending & CSTP_THROW) ? (void *)current_exception : NULL); } } /* * 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 | CSF_FOR) 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 clause 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 (used by ex_endtry()). This is normally done only * when such a try conditional is left. */ int cleanup_conditionals( 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_rettv[idx]); discard_pending_return(cstack->cs_rettv[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 conditional 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; } /* * Return an appropriate error message for a missing endwhile/endfor/endif. */ static char_u * get_end_emsg(struct condstack *cstack) { if (cstack->cs_flags[cstack->cs_idx] & CSF_WHILE) return e_endwhile; if (cstack->cs_flags[cstack->cs_idx] & CSF_FOR) return e_endfor; return e_endif; } /* * 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. * Also free "for info" structures where needed. */ void rewind_conditionals( 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; if (cstack->cs_flags[cstack->cs_idx] & CSF_FOR) free_for_info(cstack->cs_forinfo[cstack->cs_idx]); --cstack->cs_idx; } } /* * ":endfunction" when not after a ":function" */ void ex_endfunction(exarg_T *eap UNUSED) { EMSG(_("E193: :endfunction not inside a function")); } /* * Return TRUE if the string "p" looks like a ":while" or ":for" command. */ int has_loop_cmd(char_u *p) { int len; /* skip modifiers, white space and ':' */ for (;;) { while (*p == ' ' || *p == '\t' || *p == ':') ++p; len = modifier_len(p); if (len == 0) break; p += len; } if ((p[0] == 'w' && p[1] == 'h') || (p[0] == 'f' && p[1] == 'o' && p[2] == 'r')) return TRUE; return FALSE; } #endif /* FEAT_EVAL */ vim-7.4.1689/src/ex_getln.c000066400000000000000000005006201267703067000153400ustar00rootroot00000000000000/* 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(). */ expand_T *xpc; /* struct being used for expansion, xp_pattern may point into cmdbuff */ int xp_context; /* type of expansion */ # ifdef FEAT_EVAL char_u *xp_arg; /* user-defined expansion arg */ int input_fn; /* when TRUE Invoked for input() function */ # endif }; /* The current cmdline_info. It is initialized in getcmdline() and after that * used by other functions. When invoking getcmdline() recursively it needs * to be saved with save_cmdline() and restored with restore_cmdline(). * TODO: make it local to getcmdline() and pass it around. */ static struct cmdline_info ccline; 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 */ int viminfo; /* when TRUE hisstr comes from viminfo */ 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(int c); static int in_history(int, char_u *, int, int, int); # ifdef FEAT_EVAL static int calc_hist_idx(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(int idx); static void set_cmdspos(void); static void set_cmdspos_cursor(void); #ifdef FEAT_MBYTE static void correct_cmdspos(int idx, int cells); #endif static void alloc_cmdbuff(int len); static int realloc_cmdbuff(int len); static void draw_cmdline(int start, int len); static void save_cmdline(struct cmdline_info *ccp); static void restore_cmdline(struct cmdline_info *ccp); static int cmdline_paste(int regname, int literally, int remcr); #if defined(FEAT_XIM) && defined(FEAT_GUI_GTK) static void redrawcmd_preedit(void); #endif #ifdef FEAT_WILDMENU static void cmdline_del(int from); #endif static void redrawcmdprompt(void); static void cursorcmd(void); static int ccheck_abbr(int); static int nextwild(expand_T *xp, int type, int options, int escape); static void escape_fname(char_u **pp); static int showmatches(expand_T *xp, int wildmenu); static void set_expand_context(expand_T *xp); static int ExpandFromContext(expand_T *xp, char_u *, int *, char_u ***, int); static int expand_showtail(expand_T *xp); #ifdef FEAT_CMDL_COMPL static int expand_shellcmd(char_u *filepat, int *num_file, char_u ***file, int flagsarg); static int ExpandRTDir(char_u *pat, int flags, int *num_file, char_u ***file, char *dirname[]); static int ExpandPackAddDir(char_u *pat, int *num_file, char_u ***file); # ifdef FEAT_CMDHIST static char_u *get_history_arg(expand_T *xp, int idx); # endif # if defined(FEAT_USR_CMDS) && defined(FEAT_EVAL) static int ExpandUserDefined(expand_T *xp, regmatch_T *regmatch, int *num_file, char_u ***file); static int ExpandUserList(expand_T *xp, int *num_file, char_u ***file); # endif #endif #ifdef FEAT_CMDHIST static void clear_hist_entry(histentry_T *hisptr); #endif #ifdef FEAT_CMDWIN static int ex_window(void); #endif #if defined(FEAT_CMDL_COMPL) || defined(PROTO) static int #ifdef __BORLANDC__ _RTLENTRYF #endif sort_func_compare(const void *s1, const void *s2); #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. */ char_u * getcmdline( int firstc, long count UNUSED, /* only used for incremental search */ int indent) /* indent for inside conditionals */ { int c; int i; int j; int gotesc = FALSE; /* TRUE when 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; #if defined(FEAT_WILDMENU) || defined(FEAT_EVAL) || defined(FEAT_SEARCH_EXTRA) /* Everything that may work recursively should save and restore the * current command line in save_ccline. That includes update_screen(), a * custom status line may invoke ":normal". */ struct cmdline_info save_ccline; #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 = (firstc > 0 ? indent : 0); /* alloc initial ccline.cmdbuff */ alloc_cmdbuff(exmode_active ? 250 : indent + 1); if (ccline.cmdbuff == NULL) return NULL; /* out of memory */ ccline.cmdlen = ccline.cmdpos = 0; ccline.cmdbuff[0] = NUL; /* autoindent for :insert and :append */ if (firstc <= 0) { vim_memset(ccline.cmdbuff, ' ', indent); ccline.cmdbuff[indent] = NUL; ccline.cmdpos = indent; ccline.cmdspos = indent; ccline.cmdlen = indent; } ExpandInit(&xpc); ccline.xpc = &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; #ifndef BACKSLASH_IN_FILENAME xpc.xp_shell = FALSE; #endif #if defined(FEAT_EVAL) if (ccline.input_fn) { xpc.xp_context = ccline.xp_context; xpc.xp_pattern = ccline.cmdbuff; # if defined(FEAT_USR_CMDS) && defined(FEAT_CMDL_COMPL) xpc.xp_arg = ccline.xp_arg; # endif } #endif /* * 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 /* When inside an autocommand for writing "exiting" may be set and * terminal mode set to cooked. Need to set raw mode here then. */ settmode(TMODE_RAW); #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 typeahead */ #endif /* If something above caused an error, reset the flags, we do want to type * and execute commands. Display may be messed up a bit. */ if (did_emsg) redrawcmd(); did_emsg = FALSE; got_int = FALSE; /* * Collect the command string, handling editing keys. */ for (;;) { redir_off = TRUE; /* Don't redirect the typed command. Repeated, because a ":redir" inside completion may switch it on. */ #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 */ /* Get a character. Ignore K_IGNORE, it should not do anything, such * as stop completion. */ do { c = safe_vgetc(); } while (c == K_IGNORE); 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 ). * 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 /* * When there are matching completions to select works like * CTRL-P (unless 'wc' is ). */ if (c != p_wc && c == K_S_TAB && xpc.xp_numfiles > 0) 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; int old_RedrawingDisabled = RedrawingDisabled; if (ccline.input_fn) RedrawingDisabled = 0; 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); save_cmdline(&save_ccline); update_screen(VALID); /* redraw the screen NOW */ restore_cmdline(&save_ccline); redrawcmd(); save_p_ls = -1; } else { win_redraw_last_status(topframe); redraw_statuslines(); } KeyTyped = skt; wild_menu_showing = 0; if (ccline.input_fn) RedrawingDisabled = old_RedrawingDisabled; } #endif } #ifdef FEAT_WILDMENU /* Special translations for 'wildmenu' */ if (xpc.xp_context == EXPAND_MENUNAMES && p_wmnu) { /* Hitting after "emenu Name.": complete submenu */ if (c == K_DOWN && ccline.cmdpos > 0 && ccline.cmdbuff[ccline.cmdpos - 1] == '.') c = p_wc; else if (c == K_UP) { /* Hitting : 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 || xpc.xp_context == EXPAND_DIRECTORIES || xpc.xp_context == EXPAND_SHELLCMD) && p_wmnu) { char_u upseg[5]; upseg[0] = PATHSEP; upseg[1] = '.'; upseg[2] = '.'; upseg[3] = PATHSEP; upseg[4] = NUL; if (c == K_DOWN && ccline.cmdpos > 0 && ccline.cmdbuff[ccline.cmdpos - 1] == PATHSEP && (ccline.cmdpos < 3 || 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) { #ifdef FEAT_MBYTE if (has_mbyte) j -= (*mb_head_off)(ccline.cmdbuff, ccline.cmdbuff + j); #endif 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((char_u *)" *?[{`$%#", 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); /* Now complete in the new directory. Set KeyTyped in case the * Up key came from a mapping. */ c = p_wc; KeyTyped = TRUE; } } #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 = plain_vgetc(); --no_mapping; --allow_keys; /* CTRL-\ e doesn't work when obtaining an expression, unless it * is in a mapping. */ if (c != Ctrl_N && c != Ctrl_G && (c != 'e' || (ccline.cmdfirstc == '=' && KeyTyped))) { vungetc(c); c = Ctrl_BSL; } #ifdef FEAT_EVAL else if (c == 'e') { char_u *p = NULL; int len; /* * Replace the command line with the result of an expression. * Need to save and restore 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_cmdline(&save_ccline); c = get_expr_register(); restore_cmdline(&save_ccline); if (c == '=') { /* Need to save and restore ccline. And set "textlock" * to avoid nasty things like going to another buffer when * evaluating an expression. */ save_cmdline(&save_ccline); ++textlock; p = get_expr_line(); --textlock; restore_cmdline(&save_ccline); if (p != NULL) { len = (int)STRLEN(p); if (realloc_cmdbuff(len + 1) == OK) { ccline.cmdlen = len; 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(); got_int = FALSE; /* don't abandon the command line */ did_emsg = FALSE; emsg_on_display = FALSE; redrawcmd(); goto cmdline_not_changed; } #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) { if (ex_normal_busy == 0 && got_int == FALSE) { /* * 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))) { /* In Ex mode a backslash escapes a newline. */ if (exmode_active && c != ESC && ccline.cmdpos == ccline.cmdlen && ccline.cmdpos > 0 && ccline.cmdbuff[ccline.cmdpos - 1] == '\\') { if (c == K_KENTER) c = '\n'; } else { 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 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, firstc != '@'); else if (wim_flags[wim_index] & WIM_FULL) res = nextwild(&xpc, WILD_NEXT, WILD_NO_BEEP, firstc != '@'); 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, firstc != '@'); else res = nextwild(&xpc, WILD_EXPAND_KEEP, WILD_NO_BEEP, firstc != '@'); /* if interrupted while completing, behave like it failed */ if (got_int) { (void)vpeekc(); /* remove 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 /* remove match */ nextwild(&xpc, WILD_PREV, 0, firstc != '@'); #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, firstc != '@'); else if (wim_flags[wim_index] & WIM_FULL) nextwild(&xpc, WILD_NEXT, WILD_NO_BEEP, firstc != '@'); } else vim_beep(BO_WILD); } #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; /* goes to last match, in a clumsy way */ if (c == K_S_TAB && KeyTyped) { if (nextwild(&xpc, WILD_EXPAND_KEEP, 0, firstc != '@') == OK && nextwild(&xpc, WILD_PREV, 0, firstc != '@') == OK && nextwild(&xpc, WILD_PREV, 0, firstc != '@') == 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)(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, FALSE)) { /* ":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. Except when * ":normal" runs out of characters. */ if (exmode_active && (ex_normal_busy == 0 || typebuf.tb_len > 0)) 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 = plain_vgetc(); /* CTRL-R */ if (i == Ctrl_O) i = Ctrl_R; /* CTRL-R CTRL-O == CTRL-R CTRL-R */ if (i == Ctrl_R) c = plain_vgetc(); /* CTRL-R CTRL-R */ --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 == '=') { if (ccline.cmdfirstc == '=')/* can't do this recursively */ { beep_flush(); c = ESC; } else { save_cmdline(&save_ccline); c = get_expr_register(); restore_cmdline(&save_ccline); } } #endif if (c != ESC) /* use ESC to cancel inserting register */ { cmdline_paste(c, i == Ctrl_R, FALSE); #ifdef FEAT_EVAL /* When there was a serious error abort getting the * command line. */ if (aborting()) { gotesc = TRUE; /* will free ccline.cmdbuff after putting it in history */ goto returncmd; /* back to cmd mode */ } #endif 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)(ccline.cmdbuff + ccline.cmdpos); else #endif ++ccline.cmdpos; } while ((c == K_S_RIGHT || c == K_C_RIGHT || (mod_mask & (MOD_MASK_SHIFT|MOD_MASK_CTRL))) && 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: if (ccline.cmdpos == 0) goto cmdline_not_changed; do { --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 (ccline.cmdpos > 0 && (c == K_S_LEFT || c == K_C_LEFT || (mod_mask & (MOD_MASK_SHIFT|MOD_MASK_CTRL))) && ccline.cmdbuff[ccline.cmdpos - 1] != ' '); #ifdef FEAT_MBYTE if (has_mbyte) set_cmdspos_cursor(); #endif goto cmdline_not_changed; case K_IGNORE: /* Ignore mouse event or ex_window() result. */ goto cmdline_not_changed; #ifdef FEAT_GUI_W32 /* On Win32 ignore , we get it when closing the window was * cancelled. */ case K_F4: if (mod_mask == MOD_MASK_ALT) { redrawcmd(); /* somehow the cmdline is cleared */ goto cmdline_not_changed; } break; #endif #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, TRUE); else # endif cmdline_paste(0, TRUE, TRUE); redrawcmd(); goto cmdline_changed; # ifdef FEAT_DND case K_DROP: cmdline_paste('~', TRUE, FALSE); 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)(ccline.cmdbuff + ccline.cmdpos) - 1; } # endif ccline.cmdspos += i; } goto cmdline_not_changed; /* Mouse scroll wheel: ignored here */ case K_MOUSEDOWN: case K_MOUSEUP: case K_MOUSELEFT: case K_MOUSERIGHT: /* 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 == 0) { gui_do_scroll(); redrawcmd(); } goto cmdline_not_changed; case K_HOR_SCROLLBAR: if (msg_scrolled == 0) { gui_do_horiz_scroll(scrollbar_value, FALSE); redrawcmd(); } goto cmdline_not_changed; #endif #ifdef FEAT_GUI_TABLINE case K_TABLINE: case K_TABMENU: /* Don't want to change any tabs here. Make sure the same tab * is still selected. */ if (gui_use_tabline()) gui_mch_set_curtab(tabpage_index(curtab)); 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_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_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, firstc != '@') == FAIL) break; goto cmdline_changed; case Ctrl_L: #ifdef FEAT_SEARCH_EXTRA if (p_is && !cmd_silent && (firstc == '/' || firstc == '?')) { /* Add a character from under the cursor for 'incsearch' */ if (did_incsearch && !equalpos(curwin->w_cursor, old_cursor)) { c = gchar_cursor(); /* If 'ignorecase' and 'smartcase' are set and the * command line has no uppercase characters, convert * the character to lowercase */ if (p_ic && p_scs && !pat_has_uppercase(ccline.cmdbuff)) c = MB_TOLOWER(c); if (c != NUL) { if (c == firstc || vim_strchr((char_u *)( p_magic ? "\\^$.*[" : "\\^$"), c) != NULL) { /* put a backslash before special characters */ stuffcharReadbuff(c); c = '\\'; } break; } } goto cmdline_not_changed; } #endif /* completion: longest common part */ if (nextwild(&xpc, WILD_LONGEST, 0, firstc != '@') == 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, firstc != '@') == 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); xpc.xp_context = EXPAND_NOTHING; 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 . 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) || c == Ctrl_RSB)) 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 == '?')) { pos_T end_pos; #ifdef FEAT_RELTIME proftime_T tm; #endif /* 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 */ #ifdef FEAT_RELTIME /* Set the time limit to half a second. */ profile_setlimit(500L, &tm); #endif i = do_search(NULL, firstc, ccline.cmdbuff, count, SEARCH_KEEP + SEARCH_OPT + SEARCH_NOOF + SEARCH_PEEK, #ifdef FEAT_RELTIME &tm #else NULL #endif ); --emsg_off; /* if interrupted while searching, behave like it failed */ if (got_int) { (void)vpeekc(); /* remove 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 != 0) 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) { pos_T save_pos = curwin->w_cursor; /* * First move cursor to end of match, then to the start. This * moves the whole match onto the screen when 'nowrap' is set. */ curwin->w_cursor.lnum += search_match_lines; curwin->w_cursor.col = search_match_endcol; if (curwin->w_cursor.lnum > curbuf->b_ml.ml_line_count) { curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count; coladvance((colnr_T)MAXCOL); } validate_cursor(); end_pos = curwin->w_cursor; curwin->w_cursor = save_pos; } else end_pos = curwin->w_cursor; /* shutup gcc 4 */ validate_cursor(); # ifdef FEAT_WINDOWS /* May redraw the status line to show the cursor position. */ if (p_ru && curwin->w_status_height > 0) curwin->w_redr_status = TRUE; # endif save_cmdline(&save_ccline); update_screen(SOME_VALID); restore_cmdline(&save_ccline); /* Leave it at the end to make CTRL-R CTRL-W work. */ if (i != 0) curwin->w_cursor = end_pos; msg_starthere(); redrawcmdline(); did_incsearch = TRUE; } #else /* FEAT_SEARCH_EXTRA */ ; #endif #ifdef FEAT_RIGHTLEFT if (cmdmsg_rl # ifdef FEAT_ARABIC || (p_arshape && !p_tbidi && enc_utf8) # endif ) /* Always redraw the whole command line to fix shaping and * right-left typing. Not efficient, but it works. * Do it only when there are no characters left to read * to avoid useless intermediate redraws. */ if (vpeekc() == NUL) redrawcmd(); #endif } returncmd: #ifdef FEAT_RIGHTLEFT cmdmsg_rl = FALSE; #endif #ifdef FEAT_FKMAP cmd_fkmap = 0; #endif ExpandCleanup(&xpc); ccline.xpc = NULL; #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(SOME_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 { char_u *p = ccline.cmdbuff; /* Make ccline empty, getcmdline() may try to use it. */ ccline.cmdbuff = NULL; return p; } } #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( int firstc, char_u *prompt, /* command line prompt */ int attr, /* attributes for prompt */ int xp_context, /* type of expansion */ char_u *xp_arg) /* user-defined expansion argument */ { char_u *s; struct cmdline_info save_ccline; int msg_col_save = msg_col; int msg_silent_save = msg_silent; save_cmdline(&save_ccline); ccline.cmdprompt = prompt; ccline.cmdattr = attr; # ifdef FEAT_EVAL ccline.xp_context = xp_context; ccline.xp_arg = xp_arg; ccline.input_fn = (firstc == '@'); # endif msg_silent = 0; s = getcmdline(firstc, 1L, 0); restore_cmdline(&save_ccline); msg_silent = msg_silent_save; /* Restore msg_col, the prompt from input() may have changed it. * But only if called recursively and the commandline is therefore being * restored to an old one; if not, the input() prompt stays on the screen, * so we need its modified msg_col left intact. */ if (ccline.cmdbuff != NULL) msg_col = msg_col_save; return s; } #endif /* * Return TRUE when the text must not be changed and we can't switch to * another window or buffer. Used when editing the command line, evaluating * 'balloonexpr', etc. */ int text_locked(void) { #ifdef FEAT_CMDWIN if (cmdwin_type != 0) return TRUE; #endif return textlock != 0; } /* * Give an error message for a command that isn't allowed while the cmdline * window is open or editing the cmdline in another way. */ void text_locked_msg(void) { #ifdef FEAT_CMDWIN if (cmdwin_type != 0) EMSG(_(e_cmdwin)); else #endif EMSG(_(e_secure)); } #if defined(FEAT_AUTOCMD) || defined(PROTO) /* * Check if "curbuf_lock" or "allbuf_lock" is set and return TRUE when it is * and give an error message. */ int curbuf_locked(void) { if (curbuf_lock > 0) { EMSG(_("E788: Not allowed to edit another buffer now")); return TRUE; } return allbuf_locked(); } /* * Check if "allbuf_lock" is set and return TRUE when it is and give an error * message. */ int allbuf_locked(void) { if (allbuf_lock > 0) { EMSG(_("E811: Not allowed to change buffer information now")); return TRUE; } return FALSE; } #endif static int cmdline_charsize(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(void) { if (ccline.cmdfirstc != NUL) 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(void) { int i, m, c; set_cmdspos(); if (KeyTyped) { m = Columns * Rows; if (m < 0) /* overflow, Columns or Rows at weird value */ m = MAXCOL; } 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, show cursor on last visible char. * Don't move the cursor itself, so we can still append. */ if ((ccline.cmdspos += c) >= m) { ccline.cmdspos -= c; break; } #ifdef FEAT_MBYTE if (has_mbyte) i += (*mb_ptr2len)(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(int idx, int cells) { if ((*mb_ptr2len)(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. */ char_u * getexline( int c, /* normally ':', NUL for ":append" */ void *cookie UNUSED, 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. * Returns a string in allocated memory or NULL. */ char_u * getexmodeline( int promptc, /* normally ':', NUL for ":append" and '?' for :s prompt */ void *cookie UNUSED, int indent) /* indent for inside conditionals */ { garray_T line_ga; char_u *pend; int startcol = 0; int c1 = 0; int escaped = FALSE; /* CTRL-V typed */ int vcol = 0; char_u *p; int prev_char; int len; /* 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_didout) && promptc != '?') msg_putchar('\n'); if (promptc == ':') { /* indent that is only displayed, not in the line itself */ if (p_prompt) msg_putchar(':'); while (indent-- > 0) msg_putchar(' '); startcol = msg_col; } ga_init2(&line_ga, 1, 30); /* autoindent for :insert and :append is in the line itself */ if (promptc <= 0) { vcol = indent; while (indent >= 8) { ga_append(&line_ga, TAB); msg_puts((char_u *)" "); indent -= 8; } while (indent-- > 0) { ga_append(&line_ga, ' '); msg_putchar(' '); } } ++no_mapping; ++allow_keys; /* * Get the line, one character at a time. */ got_int = FALSE; while (!got_int) { long sw; char_u *s; if (ga_grow(&line_ga, 40) == FAIL) break; /* Get one character at a time. Don't use inchar(), it can't handle * special characters. */ prev_char = c1; c1 = vgetc(); /* * Handle line editing. * Previously this was left to the system, putting the terminal in * cooked mode, but then CTRL-D and CTRL-T can't be used properly. */ if (got_int) { msg_putchar('\n'); break; } 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) { #ifdef FEAT_MBYTE if (has_mbyte) { p = (char_u *)line_ga.ga_data; p[line_ga.ga_len] = NUL; len = (*mb_head_off)(p, p + line_ga.ga_len - 1) + 1; line_ga.ga_len -= len; } else #endif --line_ga.ga_len; goto redraw; } continue; } if (c1 == Ctrl_U) { msg_col = startcol; msg_clr_eos(); line_ga.ga_len = 0; goto redraw; } if (c1 == Ctrl_T) { sw = get_sw_value(curbuf); p = (char_u *)line_ga.ga_data; p[line_ga.ga_len] = NUL; indent = get_indent_str(p, 8, FALSE); indent += sw - indent % sw; add_indent: while (get_indent_str(p, 8, FALSE) < indent) { (void)ga_grow(&line_ga, 2); /* one more for the NUL */ p = (char_u *)line_ga.ga_data; s = skipwhite(p); mch_memmove(s + 1, s, line_ga.ga_len - (s - p) + 1); *s = ' '; ++line_ga.ga_len; } redraw: /* redraw the line */ msg_col = startcol; vcol = 0; p = (char_u *)line_ga.ga_data; p[line_ga.ga_len] = NUL; while (p < (char_u *)line_ga.ga_data + line_ga.ga_len) { if (*p == TAB) { do { msg_putchar(' '); } while (++vcol % 8); ++p; } else { len = MB_PTR2LEN(p); msg_outtrans_len(p, len); vcol += ptr2cells(p); p += len; } } msg_clr_eos(); windgoto(msg_row, msg_col); continue; } if (c1 == Ctrl_D) { /* Delete one shiftwidth. */ p = (char_u *)line_ga.ga_data; if (prev_char == '0' || prev_char == '^') { if (prev_char == '^') ex_keep_indent = TRUE; indent = 0; p[--line_ga.ga_len] = NUL; } else { p[line_ga.ga_len] = NUL; indent = get_indent_str(p, 8, FALSE); if (indent > 0) { --indent; indent -= indent % get_sw_value(curbuf); } } while (get_indent_str(p, 8, FALSE) > indent) { s = skipwhite(p); mch_memmove(s - 1, s, line_ga.ga_len - (s - p) + 1); --line_ga.ga_len; } goto add_indent; } if (c1 == Ctrl_V || c1 == Ctrl_Q) { escaped = TRUE; continue; } /* Ignore special key codes: mouse movement, K_IGNORE, etc. */ if (IS_SPECIAL(c1)) continue; } if (IS_SPECIAL(c1)) c1 = '?'; #ifdef FEAT_MBYTE if (has_mbyte) len = (*mb_char2bytes)(c1, (char_u *)line_ga.ga_data + line_ga.ga_len); else #endif { len = 1; ((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, len); vcol += char2cells(c1); } line_ga.ga_len += len; escaped = FALSE; windgoto(msg_row, msg_col); pend = (char_u *)(line_ga.ga_data) + line_ga.ga_len; /* We are done when a NL is entered, but not when it comes after an * odd number of backslashes, that results in a NUL. */ if (line_ga.ga_len > 0 && pend[-1] == '\n') { int bcount = 0; while (line_ga.ga_len - 2 >= bcount && pend[-2 - bcount] == '\\') ++bcount; if (bcount > 0) { /* Halve the number of backslashes: "\NL" -> "NUL", "\\NL" -> * "\NL", etc. */ line_ga.ga_len -= (bcount + 1) / 2; pend -= (bcount + 1) / 2; pend[-1] = '\n'; } if ((bcount & 1) == 0) { --line_ga.ga_len; --pend; *pend = NUL; break; } } } --no_mapping; --allow_keys; /* 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; } # if defined(MCH_CURSOR_SHAPE) || defined(FEAT_GUI) \ || defined(FEAT_MOUSESHAPE) || defined(PROTO) /* * Return TRUE if ccline.overstrike is on. */ int cmdline_overstrike(void) { return ccline.overstrike; } /* * Return TRUE if the cursor is at the end of the cmdline. */ int cmdline_at_end(void) { 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(void) { 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)(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(void) { if ((State & CMDLINE) && xic != NULL /* && im_get_status() doesn't work when using SCIM */ && !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 != NUL) ? 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)(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)(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(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(int len) { char_u *p; if (len < ccline.cmdbufflen) return OK; /* no need to resize */ 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; } /* There isn't always a NUL after the command, but it may need to be * there, thus copy up to the NUL and add a NUL. */ mch_memmove(ccline.cmdbuff, p, (size_t)ccline.cmdlen); ccline.cmdbuff[ccline.cmdlen] = NUL; vim_free(p); if (ccline.xpc != NULL && ccline.xpc->xp_pattern != NULL && ccline.xpc->xp_context != EXPAND_NOTHING && ccline.xpc->xp_context != EXPAND_UNSUCCESSFUL) { int i = (int)(ccline.xpc->xp_pattern - p); /* If xp_pattern points inside the old cmdbuff it needs to be adjusted * to point into the newly allocated memory. */ if (i >= 0 && i <= ccline.cmdlen) ccline.xpc->xp_pattern = ccline.cmdbuff + i; } return OK; } #if defined(FEAT_ARABIC) || defined(PROTO) static char_u *arshape_buf = NULL; # if defined(EXITFREE) || defined(PROTO) void free_cmdline_buf(void) { vim_free(arshape_buf); } # endif #endif /* * Draw part of the cmdline at the current cursor position. But draw stars * when cmdline_star is TRUE. */ static void draw_cmdline(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)(ccline.cmdbuff + start + i) - 1; # endif } else #endif #ifdef FEAT_ARABIC if (p_arshape && !p_tbidi && enc_utf8 && len > 0) { static int buflen = 0; char_u *p; int j; int newlen = 0; int mb_l; int pc, pc1 = 0; int prev_c = 0; int prev_c1 = 0; int u8c; int u8cc[MAX_MCO]; int nc = 0; /* * Do arabic shaping into a temporary buffer. This is very * inefficient! */ if (len * 2 + 2 > buflen) { /* Re-allocate the buffer. We keep it around to avoid a lot of * alloc()/free() calls. */ vim_free(arshape_buf); buflen = len * 2 + 2; arshape_buf = alloc(buflen); if (arshape_buf == NULL) return; /* out of memory */ } if (utf_iscomposing(utf_ptr2char(ccline.cmdbuff + start))) { /* Prepend a space to draw the leading composing char on. */ arshape_buf[0] = ' '; newlen = 1; } for (j = start; j < start + len; j += mb_l) { p = ccline.cmdbuff + j; u8c = utfc_ptr2char_len(p, u8cc, start + len - j); mb_l = utfc_ptr2len_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 = u8cc[0]; 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 { int pcc[MAX_MCO]; pc = utfc_ptr2char_len(p + mb_l, pcc, start + len - j - mb_l); pc1 = pcc[0]; } nc = prev_c; } prev_c = u8c; u8c = arabic_shape(u8c, NULL, &u8cc[0], pc, pc1, nc); newlen += (*mb_char2bytes)(u8c, arshape_buf + newlen); if (u8cc[0] != 0) { newlen += (*mb_char2bytes)(u8cc[0], arshape_buf + newlen); if (u8cc[1] != 0) newlen += (*mb_char2bytes)(u8cc[1], arshape_buf + newlen); } } else { prev_c = u8c; mch_memmove(arshape_buf + newlen, p, mb_l); newlen += mb_l; } } msg_outtrans_len(arshape_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(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(void) { if (cmd_silent) return; msg_no_more = TRUE; if (ccline.cmdlen == ccline.cmdpos) msg_putchar(' '); #ifdef FEAT_MBYTE else if (has_mbyte) draw_cmdline(ccline.cmdpos, (*mb_ptr2len)(ccline.cmdbuff + ccline.cmdpos)); #endif 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(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 + 1); 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)(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)(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; cursorcmd(); 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; if (m < 0) /* overflow, Columns or Rows at weird value */ m = MAXCOL; } 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, but do increment the * insert position, so that entering a very long command * works, even though you can't see it. */ if (ccline.cmdspos + c < m) ccline.cmdspos += c; #ifdef FEAT_MBYTE if (has_mbyte) { c = (*mb_ptr2len)(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; } static struct cmdline_info prev_ccline; static int prev_ccline_used = FALSE; /* * Save ccline, because obtaining the "=" register may execute "normal :cmd" * and overwrite it. But get_cmdline_str() may need it, thus make it * available globally in prev_ccline. */ static void save_cmdline(struct cmdline_info *ccp) { if (!prev_ccline_used) { vim_memset(&prev_ccline, 0, sizeof(struct cmdline_info)); prev_ccline_used = TRUE; } *ccp = prev_ccline; prev_ccline = ccline; ccline.cmdbuff = NULL; ccline.cmdprompt = NULL; ccline.xpc = NULL; } /* * Restore ccline after it has been saved with save_cmdline(). */ static void restore_cmdline(struct cmdline_info *ccp) { ccline = prev_ccline; prev_ccline = *ccp; } #if defined(FEAT_EVAL) || defined(PROTO) /* * Save the command line into allocated memory. Returns a pointer to be * passed to restore_cmdline_alloc() later. * Returns NULL when failed. */ char_u * save_cmdline_alloc(void) { struct cmdline_info *p; p = (struct cmdline_info *)alloc((unsigned)sizeof(struct cmdline_info)); if (p != NULL) save_cmdline(p); return (char_u *)p; } /* * Restore the command line from the return value of save_cmdline_alloc(). */ void restore_cmdline_alloc(char_u *p) { if (p != NULL) { restore_cmdline((struct cmdline_info *)p); vim_free(p); } } #endif /* * 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. */ static int cmdline_paste( int regname, int literally, /* Insert text literally instead of "as typed" */ int remcr) /* remove trailing CR */ { long i; char_u *arg; char_u *p; int allocated; struct cmdline_info save_ccline; /* 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 /* Need to save and restore ccline. And set "textlock" to avoid nasty * things like going to another buffer when evaluating an expression. */ save_cmdline(&save_ccline); ++textlock; i = get_spec_reg(regname, &arg, &allocated, TRUE); --textlock; restore_cmdline(&save_ccline); if (i) { /* Got the value of a special register in "arg". */ if (arg == NULL) return FAIL; /* When 'incsearch' is set and CTRL-R CTRL-W used: skip the duplicate * part of the word. */ p = arg; if (p_is && regname == Ctrl_W) { char_u *w; int len; /* Locate start of last word in the cmd buffer. */ for (w = ccline.cmdbuff + ccline.cmdpos; w > ccline.cmdbuff; ) { #ifdef FEAT_MBYTE if (has_mbyte) { len = (*mb_head_off)(ccline.cmdbuff, w - 1) + 1; if (!vim_iswordc(mb_ptr2char(w - len))) break; w -= len; } else #endif { if (!vim_iswordc(w[-1])) break; --w; } } len = (int)((ccline.cmdbuff + ccline.cmdpos) - w); if (p_ic ? STRNICMP(w, arg, len) == 0 : STRNCMP(w, arg, len) == 0) p += len; } cmdline_paste_str(p, literally); if (allocated) vim_free(arg); return OK; } return cmdline_paste_reg(regname, literally, remcr); } /* * 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. */ void cmdline_paste_str(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_cptr2char_adv(&s); else #endif c = *s++; if (cv == Ctrl_V || c == ESC || c == Ctrl_C || c == CAR || c == NL || c == Ctrl_L #ifdef UNIX || c == intr_char #endif || (c == Ctrl_BSL && *s == Ctrl_N)) stuffcharReadbuff(Ctrl_V); stuffcharReadbuff(c); } } #ifdef FEAT_WILDMENU /* * Delete characters on the command line, from "from" to the current * position. */ static void cmdline_del(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 function is called when the screen size changes and with incremental * search */ void redrawcmdline(void) { if (cmd_silent) return; need_wait_return = FALSE; compute_cmdrow(); redrawcmd(); cursorcmd(); } static void redrawcmdprompt(void) { int i; if (cmd_silent) return; if (ccline.cmdfirstc != NUL) 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 != NUL) --ccline.cmdindent; } else for (i = ccline.cmdindent; i > 0; --i) msg_putchar(' '); } /* * Redraw what is currently on the command line. */ void redrawcmd(void) { if (cmd_silent) return; /* when 'incsearch' is set there may be no command line while redrawing */ if (ccline.cmdbuff == NULL) { windgoto(cmdline_row, 0); msg_clr_eos(); 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(void) { if (exmode_active || msg_scrolled != 0) cmdline_row = Rows - 1; else cmdline_row = W_WINROW(lastwin) + lastwin->w_height + W_STATUS_HEIGHT(lastwin); } static void cursorcmd(void) { 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(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(int c) { if (p_paste || no_abbr) /* no abbreviations or in paste mode */ return FALSE; return check_abbr(c, ccline.cmdbuff, ccline.cmdpos, 0); } #if defined(FEAT_CMDL_COMPL) || defined(PROTO) static int #ifdef __BORLANDC__ _RTLENTRYF #endif sort_func_compare(const void *s1, const void *s2) { char_u *p1 = *(char_u **)s1; char_u *p2 = *(char_u **)s2; if (*p1 != '<' && *p2 == '<') return -1; if (*p1 == '<' && *p2 != '<') return 1; return STRCMP(p1, p2); } #endif /* * 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( expand_T *xp, int type, int options, /* extra options for ExpandOne() */ int escape) /* if TRUE, escape the returned matches */ { int i, j; char_u *p1; char_u *p2; 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); xp->xp_pattern_len = 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(xp->xp_pattern, xp->xp_pattern_len, xp->xp_context)) == NULL) p2 = NULL; else { int use_options = options | WILD_HOME_REPLACE|WILD_ADD_SLASH|WILD_SILENT; if (escape) use_options |= WILD_ESCAPE; if (p_wic) use_options += WILD_ICASE; p2 = ExpandOne(xp, p1, vim_strnsave(&ccline.cmdbuff[i], xp->xp_pattern_len), use_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 < xp->xp_pattern_len; ++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) - xp->xp_pattern_len; if (ccline.cmdlen + difflen + 4 > ccline.cmdbufflen) { v = realloc_cmdbuff(ccline.cmdlen + difflen + 4); xp->xp_pattern = ccline.cmdbuff + i; } else v = OK; if (v == OK) { mch_memmove(&ccline.cmdbuff[ccline.cmdpos + difflen], &ccline.cmdbuff[ccline.cmdpos], (size_t)(ccline.cmdlen - ccline.cmdpos + 1)); mch_memmove(&ccline.cmdbuff[i], p2, STRLEN(p2)); ccline.cmdlen += difflen; ccline.cmdpos += difflen; } } vim_free(p2); redrawcmd(); cursorcmd(); /* 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 allocated memory containing the new string. * Return NULL for failure. * * "orig" is the originally expanded string, copied to allocated memory. It * should either be kept in orig_save or freed. When "mode" is WILD_NEXT or * WILD_PREV "orig" should be NULL. * * Results are cached in xp->xp_files and xp->xp_numfiles, except when "mode" * is WILD_EXPAND_FREE or WILD_ALL. * * 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 * mode = WILD_ALL_KEEP: get all matches, keep matches * * 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 * options = WILD_ICASE: ignore case for files * * The variables xp->xp_context and xp->xp_backslash must have been set! */ char_u * ExpandOne( 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 orig_saved = FALSE; 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; orig_saved = TRUE; /* * 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_ALL_KEEP && 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) { int mb_len = 1; int c0, ci; for (len = 0; xp->xp_files[0][len]; len += mb_len) { #ifdef FEAT_MBYTE if (has_mbyte) { mb_len = (*mb_ptr2len)(&xp->xp_files[0][len]); c0 =(* mb_ptr2char)(&xp->xp_files[0][len]); } else #endif c0 = xp->xp_files[0][len]; for (i = 1; i < xp->xp_numfiles; ++i) { #ifdef FEAT_MBYTE if (has_mbyte) ci =(* mb_ptr2char)(&xp->xp_files[i][len]); else #endif ci = xp->xp_files[i][len]; if (p_fic && (xp->xp_context == EXPAND_DIRECTORIES || xp->xp_context == EXPAND_FILES || xp->xp_context == EXPAND_SHELLCMD || xp->xp_context == EXPAND_BUFFERS)) { if (MB_TOLOWER(c0) != MB_TOLOWER(ci)) break; } else if (c0 != ci) break; } if (i < xp->xp_numfiles) { if (!(options & WILD_NO_BEEP)) vim_beep(BO_WILD); break; } } ss = alloc((unsigned)len + 1); if (ss) vim_strncpy(ss, xp->xp_files[0], (size_t)len); 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); /* Free "orig" if it wasn't stored in "orig_save". */ if (!orig_saved) vim_free(orig); return ss; } /* * Prepare an expand structure for use. */ void ExpandInit(expand_T *xp) { xp->xp_pattern = NULL; xp->xp_pattern_len = 0; xp->xp_backslash = XP_BS_NONE; #ifndef BACKSLASH_IN_FILENAME xp->xp_shell = FALSE; #endif xp->xp_numfiles = -1; xp->xp_files = NULL; #if defined(FEAT_USR_CMDS) && defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL) xp->xp_arg = NULL; #endif xp->xp_line = NULL; } /* * Cleanup an expand structure after use. */ void ExpandCleanup(expand_T *xp) { if (xp->xp_numfiles >= 0) { FreeWild(xp->xp_numfiles, xp->xp_files); xp->xp_numfiles = -1; } } void ExpandEscape( 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_FILES_IN_PATH || xp->xp_context == EXPAND_SHELLCMD || 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) p = vim_strsave_escaped(files[i], (char_u *)" "); if (p != NULL) { vim_free(files[i]); files[i] = p; } #endif } } #ifdef BACKSLASH_IN_FILENAME p = vim_strsave_fnameescape(files[i], FALSE); #else p = vim_strsave_fnameescape(files[i], xp->xp_shell); #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] == '~') escape_fname(&files[i]); } xp->xp_backslash = XP_BS_NONE; /* If the first file starts with a '+' escape it. Otherwise it * could be seen as "+cmd". */ if (*files[0] == '+') escape_fname(&files[0]); } 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; } } } } } /* * Escape special characters in "fname" for when used as a file name argument * after a Vim command, or, when "shell" is non-zero, a shell command. * Returns the result in allocated memory. */ char_u * vim_strsave_fnameescape(char_u *fname, int shell) { char_u *p; #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 != '{' && *p != '!') || !vim_isfilec(*p)) buf[j++] = *p; buf[j] = NUL; p = vim_strsave_escaped(fname, buf); #else p = vim_strsave_escaped(fname, shell ? SHELL_ESC_CHARS : PATH_ESC_CHARS); if (shell && csh_like_shell() && p != NULL) { char_u *s; /* For csh and similar shells need to put two backslashes before '!'. * One is taken by Vim, one by the shell. */ s = vim_strsave_escaped(p, (char_u *)"!"); vim_free(p); p = s; } #endif /* '>' and '+' are special at the start of some commands, e.g. ":edit" and * ":write". "cd -" has a special meaning. */ if (p != NULL && (*p == '>' || *p == '+' || (*p == '-' && p[1] == NUL))) escape_fname(&p); return p; } /* * Put a backslash before the file name in "pp", which is in allocated memory. */ static void escape_fname(char_u **pp) { char_u *p; p = alloc((unsigned)(STRLEN(*pp) + 2)); if (p != NULL) { p[0] = '\\'; STRCPY(p + 1, *pp); vim_free(*pp); *pp = p; } } /* * For each file name in files[num_files]: * If 'orig_pat' starts with "~/", replace the home directory with "~". */ void tilde_replace( 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. */ static int showmatches(expand_T *xp, int wildmenu UNUSED) { #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_SHELLCMD || 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_SHELLCMD || xp->xp_context == EXPAND_BUFFERS) { /* highlight directories */ if (xp->xp_numfiles != -1) { char_u *halved_slash; char_u *exp_path; /* Expansion was done before and special characters * were escaped, need to halve backslashes. Also * $HOME has been replaced with ~/. */ exp_path = expand_env_save_opt(files_found[k], TRUE); halved_slash = backslash_halve_save( exp_path != NULL ? exp_path : files_found[k]); j = mch_isdir(halved_slash != NULL ? halved_slash : files_found[k]); vim_free(exp_path); vim_free(halved_slash); } else /* Expansion was done here, file names are literal. */ 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(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; } mb_ptr_adv(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(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_SHELLCMD && 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 "fname[len]" 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( char_u *fname, int len, int context) /* EXPAND_FILES etc. */ { char_u *retval; int i, j; int new_len; char_u *tail; int ends_in_star; if (context != EXPAND_FILES && context != EXPAND_FILES_IN_PATH && context != EXPAND_SHELLCMD && 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_OWNSYNTAX || context == EXPAND_FILETYPE || context == EXPAND_PACKADD || (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 || context == EXPAND_USER_LIST) && 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 && context != EXPAND_USER_LIST && 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 || context == EXPAND_USER_LIST) retval[j++] = '\\'; break; } retval[j] = fname[i]; } retval[j] = NUL; } } } else { retval = alloc(len + 4); if (retval != NULL) { vim_strncpy(retval, fname, len); /* * Don't add a star to *, ~, ~user, $var or `cmd`. * * would become **, which walks the whole tree. * ~ 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. * When the name ends in '$' don't add a star, remove the '$'. */ tail = gettail(retval); ends_in_star = (len > 0 && retval[len - 1] == '*'); #ifndef BACKSLASH_IN_FILENAME for (i = len - 2; i >= 0; --i) { if (retval[i] != '\\') break; ends_in_star = !ends_in_star; } #endif if ((*retval != '~' || tail != retval) && !ends_in_star && vim_strchr(tail, '$') == NULL && vim_strchr(retval, '`') == NULL) retval[len++] = '*'; else if (len > 0 && retval[len - 1] == '$') --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_SHELLCMD After ":!cmd", ":r !cmd" or ":w !cmd". * 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 * EXPAND_USER Complete user names */ static void set_expand_context(expand_T *xp) { /* only expansion for ':', '>' and '=' command-lines */ if (ccline.cmdfirstc != ':' #ifdef FEAT_EVAL && ccline.cmdfirstc != '>' && ccline.cmdfirstc != '=' && !ccline.input_fn #endif ) { xp->xp_context = EXPAND_NOTHING; return; } set_cmd_context(xp, ccline.cmdbuff, ccline.cmdlen, ccline.cmdpos); } void set_cmd_context( 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; #ifdef FEAT_EVAL if (ccline.cmdfirstc == '=') { # ifdef FEAT_CMDL_COMPL /* pass CMD_SIZE because there is no real command */ set_context_for_expression(xp, str, CMD_SIZE); # endif } else if (ccline.input_fn) { xp->xp_context = ccline.xp_context; xp->xp_pattern = ccline.cmdbuff; # if defined(FEAT_USR_CMDS) && defined(FEAT_CMDL_COMPL) xp->xp_arg = ccline.xp_arg; # endif } else #endif while (nextcomm != NULL) nextcomm = set_one_cmd_context(xp, nextcomm); /* Store the string here so that call_user_expand_func() can get to them * easily. */ xp->xp_line = str; xp->xp_col = col; 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( 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; int options = WILD_ADD_SLASH|WILD_SILENT; 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. */ xp->xp_pattern_len = (int)(str + col - xp->xp_pattern); file_str = addstar(xp->xp_pattern, xp->xp_pattern_len, xp->xp_context); if (file_str == NULL) return EXPAND_UNSUCCESSFUL; if (p_wic) options += WILD_ICASE; /* find all files that match the description */ if (ExpandFromContext(xp, file_str, matchcount, matches, options) == FAIL) { *matchcount = 0; *matches = NULL; } vim_free(file_str); return EXPAND_OK; } #ifdef FEAT_MULTI_LANG /* * Cleanup matches for help tags: * Remove "@ab" if the top of 'helplang' is "ab" and the language of the first * tag matches it. Otherwise remove "@en" if "en" is the only language. */ static void cleanup_help_tags(int num_file, char_u **file); static void cleanup_help_tags(int num_file, char_u **file) { int i, j; int len; char_u buf[4]; char_u *p = buf; if (p_hlg[0] != NUL) { *p++ = '@'; *p++ = p_hlg[0]; *p++ = p_hlg[1]; } *p = NUL; for (i = 0; i < num_file; ++i) { len = (int)STRLEN(file[i]) - 3; if (len <= 0) continue; if (i == 0 && STRCMP(file[i] + len, buf) == 0) { file[i][len] = NUL; break; } else if (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; break; } } } } #endif /* * Do the expansion based on xp->xp_context and "pat". */ static int ExpandFromContext( expand_T *xp, char_u *pat, int *num_file, char_u ***file, int options) /* EW_ flags */ { #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 (options & WILD_ALLLINKS) flags |= EW_ALLLINKS; if (xp->xp_context == EXPAND_FILES || xp->xp_context == EXPAND_DIRECTORIES || xp->xp_context == EXPAND_FILES_IN_PATH) { /* * 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] == ' ') STRMOVE(pat + i, pat + i + 3); if (xp->xp_backslash == XP_BS_ONE && pat[i + 1] == ' ') STRMOVE(pat + i, pat + i + 1); } } if (xp->xp_context == EXPAND_FILES) flags |= EW_FILE; else if (xp->xp_context == EXPAND_FILES_IN_PATH) flags |= (EW_FILE | EW_PATH); else flags = (flags | EW_DIR) & ~EW_FILE; if (options & WILD_ICASE) flags |= EW_ICASE; /* Expand wildcards, supporting %:h and the like. */ ret = expand_wildcards_eval(&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) { /* With an empty argument we would get all the help tags, which is * very slow. Get matches for "help" instead. */ if (find_help_tags(*pat == NUL ? (char_u *)"help" : 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_SHELLCMD) return expand_shellcmd(pat, num_file, file, flags); 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) { char *directories[] = {"colors", NULL}; return ExpandRTDir(pat, DIP_START + DIP_OPT, num_file, file, directories); } if (xp->xp_context == EXPAND_COMPILER) { char *directories[] = {"compiler", NULL}; return ExpandRTDir(pat, 0, num_file, file, directories); } if (xp->xp_context == EXPAND_OWNSYNTAX) { char *directories[] = {"syntax", NULL}; return ExpandRTDir(pat, 0, num_file, file, directories); } if (xp->xp_context == EXPAND_FILETYPE) { char *directories[] = {"syntax", "indent", "ftplugin", NULL}; return ExpandRTDir(pat, 0, num_file, file, directories); } # if defined(FEAT_USR_CMDS) && defined(FEAT_EVAL) if (xp->xp_context == EXPAND_USER_LIST) return ExpandUserList(xp, num_file, file); # endif if (xp->xp_context == EXPAND_PACKADD) return ExpandPackAddDir(pat, num_file, file); 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, ®match, num_file, file); else if (xp->xp_context == EXPAND_MAPPINGS) ret = ExpandMappings(®match, num_file, file); # if defined(FEAT_USR_CMDS) && defined(FEAT_EVAL) else if (xp->xp_context == EXPAND_USER_DEFINED) ret = ExpandUserDefined(xp, ®match, num_file, file); # endif else { static struct expgen { int context; char_u *((*func)(expand_T *, int)); int ic; int escaped; } tab[] = { {EXPAND_COMMANDS, get_command_name, FALSE, TRUE}, {EXPAND_BEHAVE, get_behave_arg, TRUE, TRUE}, #ifdef FEAT_CMDHIST {EXPAND_HISTORY, get_history_arg, TRUE, TRUE}, #endif #ifdef FEAT_USR_CMDS {EXPAND_USER_COMMANDS, get_user_commands, FALSE, TRUE}, {EXPAND_USER_ADDR_TYPE, get_user_cmd_addr_type, FALSE, TRUE}, {EXPAND_USER_CMD_FLAGS, get_user_cmd_flags, FALSE, TRUE}, {EXPAND_USER_NARGS, get_user_cmd_nargs, FALSE, TRUE}, {EXPAND_USER_COMPLETE, get_user_cmd_complete, FALSE, TRUE}, #endif #ifdef FEAT_EVAL {EXPAND_USER_VARS, get_user_var_name, FALSE, TRUE}, {EXPAND_FUNCTIONS, get_function_name, FALSE, TRUE}, {EXPAND_USER_FUNC, get_user_func_name, FALSE, TRUE}, {EXPAND_EXPRESSION, get_expr_name, FALSE, TRUE}, #endif #ifdef FEAT_MENU {EXPAND_MENUS, get_menu_name, FALSE, TRUE}, {EXPAND_MENUNAMES, get_menu_names, FALSE, TRUE}, #endif #ifdef FEAT_SYN_HL {EXPAND_SYNTAX, get_syntax_name, TRUE, TRUE}, #endif #ifdef FEAT_PROFILE {EXPAND_SYNTIME, get_syntime_arg, TRUE, TRUE}, #endif {EXPAND_HIGHLIGHT, get_highlight_name, TRUE, TRUE}, #ifdef FEAT_AUTOCMD {EXPAND_EVENTS, get_event_name, TRUE, TRUE}, {EXPAND_AUGROUP, get_augroup_name, TRUE, TRUE}, #endif #ifdef FEAT_CSCOPE {EXPAND_CSCOPE, get_cscope_name, TRUE, TRUE}, #endif #ifdef FEAT_SIGNS {EXPAND_SIGN, get_sign_name, TRUE, TRUE}, #endif #ifdef FEAT_PROFILE {EXPAND_PROFILE, get_profile_name, TRUE, TRUE}, #endif #if (defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \ && (defined(FEAT_GETTEXT) || defined(FEAT_MBYTE)) {EXPAND_LANGUAGE, get_lang_arg, TRUE, FALSE}, {EXPAND_LOCALES, get_locales, TRUE, FALSE}, #endif {EXPAND_ENV_VARS, get_env_name, TRUE, TRUE}, {EXPAND_USER, get_users, TRUE, FALSE}, }; 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 < (int)(sizeof(tab) / sizeof(struct expgen)); ++i) if (xp->xp_context == tab[i].context) { if (tab[i].ic) regmatch.rm_ic = TRUE; ret = ExpandGeneric(xp, ®match, num_file, file, tab[i].func, tab[i].escaped); break; } } vim_regfree(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( expand_T *xp, regmatch_T *regmatch, int *num_file, char_u ***file, char_u *((*func)(expand_T *, int)), /* returns a string from the list */ int escaped) { int i; int count = 0; int round; char_u *str; /* do this loop twice: * round == 0: count the number of matching names * round == 1: copy the matching names into allocated memory */ for (round = 0; round <= 1; ++round) { 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 (round) { if (escaped) str = vim_strsave_escaped(str, (char_u *)" \t\\."); else str = vim_strsave(str); (*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 (round == 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; } } /* Sort the results. Keep menu's in the specified order. */ if (xp->xp_context != EXPAND_MENUNAMES && xp->xp_context != EXPAND_MENUS) { if (xp->xp_context == EXPAND_EXPRESSION || xp->xp_context == EXPAND_FUNCTIONS || xp->xp_context == EXPAND_USER_FUNC) /* functions should be sorted to the end. */ qsort((void *)*file, (size_t)*num_file, sizeof(char_u *), sort_func_compare); else sort_strings(*file, *num_file); } #ifdef FEAT_CMDL_COMPL /* Reset the variables used for special highlight names expansion, so that * they don't show up when getting normal highlight names by ID. */ reset_expand_highlight(); #endif return OK; } /* * Complete a shell command. * Returns FAIL or OK; */ static int expand_shellcmd( char_u *filepat, /* pattern to match with command names */ int *num_file, /* return: number of matches */ char_u ***file, /* return: array with matches */ int flagsarg) /* EW_ flags */ { char_u *pat; int i; char_u *path; int mustfree = FALSE; garray_T ga; char_u *buf = alloc(MAXPATHL); size_t l; char_u *s, *e; int flags = flagsarg; int ret; int did_curdir = FALSE; if (buf == NULL) return FAIL; /* for ":set path=" and ":set tags=" halve backslashes for escaped * space */ pat = vim_strsave(filepat); for (i = 0; pat[i]; ++i) if (pat[i] == '\\' && pat[i + 1] == ' ') STRMOVE(pat + i, pat + i + 1); flags |= EW_FILE | EW_EXEC | EW_SHELLCMD; /* For an absolute name we don't use $PATH. */ if (mch_isFullName(pat)) path = (char_u *)" "; else if ((pat[0] == '.' && (vim_ispathsep(pat[1]) || (pat[1] == '.' && vim_ispathsep(pat[2]))))) path = (char_u *)"."; else { path = vim_getenv((char_u *)"PATH", &mustfree); if (path == NULL) path = (char_u *)""; } /* * Go over all directories in $PATH. Expand matches in that directory and * collect them in "ga". When "." is not in $PATH also expand for the * current directory, to find "subdir/cmd". */ ga_init2(&ga, (int)sizeof(char *), 10); for (s = path; ; s = e) { if (*s == NUL) { if (did_curdir) break; /* Find directories in the current directory, path is empty. */ did_curdir = TRUE; } else if (*s == '.') did_curdir = TRUE; if (*s == ' ') ++s; /* Skip space used for absolute path name. */ #if defined(MSWIN) e = vim_strchr(s, ';'); #else e = vim_strchr(s, ':'); #endif if (e == NULL) e = s + STRLEN(s); l = e - s; if (l > MAXPATHL - 5) break; vim_strncpy(buf, s, l); add_pathsep(buf); l = STRLEN(buf); vim_strncpy(buf + l, pat, MAXPATHL - 1 - l); /* Expand matches in one directory of $PATH. */ ret = expand_wildcards(1, &buf, num_file, file, flags); if (ret == OK) { if (ga_grow(&ga, *num_file) == FAIL) FreeWild(*num_file, *file); else { for (i = 0; i < *num_file; ++i) { s = (*file)[i]; if (STRLEN(s) > l) { /* Remove the path again. */ STRMOVE(s, s + l); ((char_u **)ga.ga_data)[ga.ga_len++] = s; } else vim_free(s); } vim_free(*file); } } if (*e != NUL) ++e; } *file = ga.ga_data; *num_file = ga.ga_len; vim_free(buf); vim_free(pat); if (mustfree) vim_free(path); return OK; } # if defined(FEAT_USR_CMDS) && defined(FEAT_EVAL) static void * call_user_expand_func(void *(*user_expand_func)(char_u *, int, char_u **, int), expand_T *xp, int *num_file, char_u ***file); /* * Call "user_expand_func()" to invoke a user defined VimL function and return * the result (either a string or a List). */ static void * call_user_expand_func( void *(*user_expand_func)(char_u *, int, char_u **, int), expand_T *xp, int *num_file, char_u ***file) { int keep = 0; char_u num[50]; char_u *args[3]; int save_current_SID = current_SID; void *ret; struct cmdline_info save_ccline; if (xp->xp_arg == NULL || xp->xp_arg[0] == '\0' || xp->xp_line == NULL) return NULL; *num_file = 0; *file = NULL; if (ccline.cmdbuff != NULL) { keep = ccline.cmdbuff[ccline.cmdlen]; ccline.cmdbuff[ccline.cmdlen] = 0; } args[0] = vim_strnsave(xp->xp_pattern, xp->xp_pattern_len); args[1] = xp->xp_line; sprintf((char *)num, "%d", xp->xp_col); args[2] = num; /* Save the cmdline, we don't know what the function may do. */ save_ccline = ccline; ccline.cmdbuff = NULL; ccline.cmdprompt = NULL; current_SID = xp->xp_scriptID; ret = user_expand_func(xp->xp_arg, 3, args, FALSE); ccline = save_ccline; current_SID = save_current_SID; if (ccline.cmdbuff != NULL) ccline.cmdbuff[ccline.cmdlen] = keep; vim_free(args[0]); return ret; } /* * Expand names with a function defined by the user. */ static int ExpandUserDefined( expand_T *xp, regmatch_T *regmatch, int *num_file, char_u ***file) { char_u *retstr; char_u *s; char_u *e; char_u keep; garray_T ga; retstr = call_user_expand_func(call_func_retstr, xp, num_file, file); if (retstr == NULL) return FAIL; ga_init2(&ga, (int)sizeof(char *), 3); for (s = retstr; *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; *e = keep; if (*e != NUL) ++e; } vim_free(retstr); *file = ga.ga_data; *num_file = ga.ga_len; return OK; } /* * Expand names with a list returned by a function defined by the user. */ static int ExpandUserList( expand_T *xp, int *num_file, char_u ***file) { list_T *retlist; listitem_T *li; garray_T ga; retlist = call_user_expand_func(call_func_retlist, xp, num_file, file); if (retlist == NULL) return FAIL; ga_init2(&ga, (int)sizeof(char *), 3); /* Loop over the items in the list. */ for (li = retlist->lv_first; li != NULL; li = li->li_next) { if (li->li_tv.v_type != VAR_STRING || li->li_tv.vval.v_string == NULL) continue; /* Skip non-string items and empty strings */ if (ga_grow(&ga, 1) == FAIL) break; ((char_u **)ga.ga_data)[ga.ga_len] = vim_strsave(li->li_tv.vval.v_string); ++ga.ga_len; } list_unref(retlist); *file = ga.ga_data; *num_file = ga.ga_len; return OK; } #endif /* * Expand color scheme, compiler or filetype names. * Search from 'runtimepath': * 'runtimepath'/{dirnames}/{pat}.vim * When "flags" has DIP_START: search also from 'start' of 'packpath': * 'packpath'/pack/ * /start/ * /{dirnames}/{pat}.vim * When "flags" has DIP_OPT: search also from 'opt' of 'packpath': * 'packpath'/pack/ * /opt/ * /{dirnames}/{pat}.vim * "dirnames" is an array with one or more directory names. */ static int ExpandRTDir( char_u *pat, int flags, int *num_file, char_u ***file, char *dirnames[]) { char_u *s; char_u *e; char_u *match; garray_T ga; int i; int pat_len; *num_file = 0; *file = NULL; pat_len = (int)STRLEN(pat); ga_init2(&ga, (int)sizeof(char *), 10); for (i = 0; dirnames[i] != NULL; ++i) { s = alloc((unsigned)(STRLEN(dirnames[i]) + pat_len + 7)); if (s == NULL) { ga_clear_strings(&ga); return FAIL; } sprintf((char *)s, "%s/%s*.vim", dirnames[i], pat); globpath(p_rtp, s, &ga, 0); vim_free(s); } if (flags & DIP_START) { for (i = 0; dirnames[i] != NULL; ++i) { s = alloc((unsigned)(STRLEN(dirnames[i]) + pat_len + 22)); if (s == NULL) { ga_clear_strings(&ga); return FAIL; } sprintf((char *)s, "pack/*/start/*/%s/%s*.vim", dirnames[i], pat); globpath(p_pp, s, &ga, 0); vim_free(s); } } if (flags & DIP_OPT) { for (i = 0; dirnames[i] != NULL; ++i) { s = alloc((unsigned)(STRLEN(dirnames[i]) + pat_len + 20)); if (s == NULL) { ga_clear_strings(&ga); return FAIL; } sprintf((char *)s, "pack/*/opt/*/%s/%s*.vim", dirnames[i], pat); globpath(p_pp, s, &ga, 0); vim_free(s); } } for (i = 0; i < ga.ga_len; ++i) { match = ((char_u **)ga.ga_data)[i]; s = match; e = s + STRLEN(s); if (e - 4 > s && STRNICMP(e - 4, ".vim", 4) == 0) { e -= 4; for (s = e; s > match; mb_ptr_back(match, s)) if (s < match || vim_ispathsep(*s)) break; ++s; *e = NUL; mch_memmove(match, s, e - s + 1); } } if (ga.ga_len == 0) return FAIL; /* Sort and remove duplicates which can happen when specifying multiple * directories in dirnames. */ remove_duplicates(&ga); *file = ga.ga_data; *num_file = ga.ga_len; return OK; } /* * Expand loadplugin names: * 'packpath'/pack/ * /opt/{pat} */ static int ExpandPackAddDir( char_u *pat, int *num_file, char_u ***file) { char_u *s; char_u *e; char_u *match; garray_T ga; int i; int pat_len; *num_file = 0; *file = NULL; pat_len = (int)STRLEN(pat); ga_init2(&ga, (int)sizeof(char *), 10); s = alloc((unsigned)(pat_len + 26)); if (s == NULL) { ga_clear_strings(&ga); return FAIL; } sprintf((char *)s, "pack/*/opt/%s*", pat); globpath(p_pp, s, &ga, 0); vim_free(s); for (i = 0; i < ga.ga_len; ++i) { match = ((char_u **)ga.ga_data)[i]; s = gettail(match); e = s + STRLEN(s); mch_memmove(match, s, e - s + 1); } if (ga.ga_len == 0) return FAIL; /* Sort and remove duplicates which can happen when specifying multiple * directories in dirnames. */ remove_duplicates(&ga); *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". * Adds the matches to "ga". Caller must init "ga". */ void globpath( char_u *path, char_u *file, garray_T *ga, int expand_options) { expand_T xpc; char_u *buf; int i; int num_p; char_u **p; buf = alloc(MAXPATHL); if (buf == NULL) return; ExpandInit(&xpc); xpc.xp_context = EXPAND_FILES; /* 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) { # if defined(MSWIN) /* Using the platform's path separator (\) makes vim incorrectly * treat it as an escape character, use '/' instead. */ if (*buf != NUL && !after_pathsep(buf, buf + STRLEN(buf))) STRCAT(buf, "/"); # else add_pathsep(buf); # endif STRCAT(buf, file); if (ExpandFromContext(&xpc, buf, &num_p, &p, WILD_SILENT|expand_options) != FAIL && num_p > 0) { ExpandEscape(&xpc, buf, num_p, p, WILD_SILENT|expand_options); if (ga_grow(ga, num_p) == OK) { for (i = 0; i < num_p; ++i) { ((char_u **)ga->ga_data)[ga->ga_len] = vim_strnsave(p[i], (int)STRLEN(p[i])); ++ga->ga_len; } } FreeWild(num_p, p); } } } vim_free(buf); } #endif #if defined(FEAT_CMDHIST) || defined(PROTO) /********************************* * Command line history stuff * *********************************/ /* * Translate a history character to the associated type number. */ static int hist_char2type(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 }; #if defined(FEAT_CMDL_COMPL) || defined(PROTO) /* * Function given to ExpandGeneric() to obtain the possible first * arguments of the ":history command. */ static char_u * get_history_arg(expand_T *xp UNUSED, int idx) { static char_u compl[2] = { NUL, NUL }; char *short_names = ":=@>?/"; int short_names_count = (int)STRLEN(short_names); int history_name_count = sizeof(history_names) / sizeof(char *) - 1; if (idx < short_names_count) { compl[0] = (char_u)short_names[idx]; return compl; } if (idx < short_names_count + history_name_count) return (char_u *)history_names[idx - short_names_count]; if (idx == short_names_count + history_name_count) return (char_u *)"all"; return NULL; } #endif /* * init_history() - Initialize the command line history. * Also used to re-allocate the history when the size changes. */ void init_history(void) { 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) clear_hist_entry(&temp[i]); } 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) clear_hist_entry(&temp[i]); 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; } } static void clear_hist_entry(histentry_T *hisptr) { hisptr->hisnum = 0; hisptr->viminfo = FALSE; hisptr->hisstr = NULL; } /* * 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( int type, char_u *str, int move_to_front, /* Move the entry to the front if it exists */ int sep, int writing) /* ignore entries read from viminfo */ { int i; int last_i = -1; char_u *p; if (hisidx[type] < 0) return FALSE; i = hisidx[type]; do { if (history[type][i].hisstr == NULL) return FALSE; /* For search history, check that the separator character matches as * well. */ p = history[type][i].hisstr; if (STRCMP(str, p) == 0 && !(writing && history[type][i].viminfo) && (type != HIST_SEARCH || sep == p[STRLEN(p) + 1])) { 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].hisnum = ++hisnum[type]; history[type][i].viminfo = FALSE; history[type][i].hisstr = str; 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(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( 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; if (cmdmod.keeppatterns && histype == HIST_SEARCH) 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); clear_hist_entry(hisptr); --hisnum[histype]; if (--hisidx[HIST_SEARCH] < 0) hisidx[HIST_SEARCH] = hislen - 1; } last_maptick = -1; } if (!in_history(histype, new_entry, TRUE, sep, FALSE)) { 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 = (int)STRLEN(new_entry); hisptr->hisstr = vim_strnsave(new_entry, len + 2); if (hisptr->hisstr != NULL) hisptr->hisstr[len + 1] = sep; hisptr->hisnum = ++hisnum[histype]; hisptr->viminfo = FALSE; 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(int histype) { if (hislen == 0 || histype < 0 || histype >= HIST_COUNT || hisidx[histype] < 0) return -1; return history[histype][hisidx[histype]].hisnum; } /* * 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(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(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(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); clear_hist_entry(hisptr); hisptr++; } 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(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(®match, hisptr->hisstr, (colnr_T)0)) { found = TRUE; vim_free(hisptr->hisstr); clear_hist_entry(hisptr); } else { if (i != last) { history[histype][last] = *hisptr; clear_hist_entry(hisptr); } if (--last < 0) last += hislen; } if (--i < 0) i += hislen; } while (i != idx); if (history[histype][idx].hisstr == NULL) hisidx[histype] = -1; } vim_regfree(regmatch.regprog); return found; } /* * Remove an indexed entry from a history. * "histype" may be one of the HIST_ values. */ int del_history_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; } clear_hist_entry(&history[histype][i]); 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(void) { 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; STRMOVE(p, p + i); --p; } } #endif #endif /* FEAT_CMDHIST */ #if defined(FEAT_EVAL) || defined(FEAT_CMDWIN) || defined(PROTO) /* * Get pointer to the command line info to use. cmdline_paste() may clear * ccline and put the previous value in prev_ccline. */ static struct cmdline_info * get_ccline_ptr(void) { if ((State & CMDLINE) == 0) return NULL; if (ccline.cmdbuff != NULL) return &ccline; if (prev_ccline_used && prev_ccline.cmdbuff != NULL) return &prev_ccline; return NULL; } #endif #if defined(FEAT_EVAL) || defined(PROTO) /* * 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(void) { struct cmdline_info *p = get_ccline_ptr(); if (p == NULL) return NULL; return vim_strnsave(p->cmdbuff, p->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(void) { struct cmdline_info *p = get_ccline_ptr(); if (p == NULL) return -1; return p->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( int pos) { struct cmdline_info *p = get_ccline_ptr(); if (p == NULL) 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; } #endif #if defined(FEAT_EVAL) || defined(FEAT_CMDWIN) || defined(PROTO) /* * Get the current command-line type. * Returns ':' or '/' or '?' or '@' or '>' or '-' * Only works when the command line is being edited. * Returns NUL when something is wrong. */ int get_cmdline_type(void) { struct cmdline_info *p = get_ccline_ptr(); if (p == NULL) return NUL; if (p->cmdfirstc == NUL) return # ifdef FEAT_EVAL (p->input_fn) ? '@' : # endif '-'; return p->cmdfirstc; } #endif #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(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, 0, &num, NULL, 0); *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, 0, &num, NULL, 0); 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(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 (STRNICMP(arg, "all", STRLEN(arg)) == 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, IOSIZE - (int)STRLEN(IObuff)); 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) /* * Buffers for history read from a viminfo file. Only valid while reading. */ 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(int type, int use_question); /* * Translate a history type number to the associated character. */ static int hist_type2char( 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(int asklen, int writing) { int i; int num; int type; int len; init_history(); viminfo_add_at_front = (asklen != 0 && !writing); if (asklen > hislen) asklen = hislen; for (type = 0; type < HIST_COUNT; ++type) { /* Count the number of empty spaces in the history list. Entries read * from viminfo previously are also considered empty. 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 || history[type][i].viminfo) 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(vir_T *virp, int writing) { 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) { int sep = (*val == ' ' ? NUL : *val); if (!in_history(type, val + (type == HIST_SEARCH), viminfo_add_at_front, sep, writing)) { /* 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] = sep; } 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); } /* * Finish reading history lines from viminfo. Not used when writing viminfo. */ void finish_viminfo_history(void) { int idx; int i; int type; for (type = 0; type < HIST_COUNT; ++type) { if (history[type] == NULL) continue; 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 || history[type][idx].viminfo) 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]; history[type][idx].viminfo = TRUE; 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; viminfo_hisidx[type] = 0; } } /* * Write history to viminfo file in "fp". * When "merge" is TRUE merge history lines with a previously read viminfo * file, data is in viminfo_history[]. * When "merge" is FALSE just write all history lines. Used for ":wviminfo!". */ void write_viminfo_history( FILE *fp, int merge) { int i; int type; int num_saved; char_u *p; int c; int round; 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; /* * Merge typed and viminfo history: * round 1: history of typed commands. * round 2: history from recently read viminfo. */ for (round = 1; round <= 2; ++round) { if (round == 1) /* start at newest entry, somewhere in the list */ i = hisidx[type]; else if (viminfo_hisidx[type] > 0) /* start at newest entry, first in the list */ i = 0; else /* empty list */ i = -1; if (i >= 0) while (num_saved > 0 && !(round == 2 && i >= viminfo_hisidx[type])) { p = round == 1 ? history[type][i].hisstr : viminfo_history[type] == NULL ? NULL : viminfo_history[type][i]; if (p != NULL && (round == 2 || !merge || !history[type][i].viminfo)) { --num_saved; fputc(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 (round == 1) { /* Decrement index, loop around and stop when back at * the start. */ if (--i < 0) i = hislen - 1; if (i == hisidx[type]) break; } else { /* Increment index. Stop at the end in the while. */ ++i; } } } for (i = 0; i < viminfo_hisidx[type]; ++i) if (viminfo_history[type] != NULL) vim_free(viminfo_history[type][i]); vim_free(viminfo_history[type]); viminfo_history[type] = NULL; viminfo_hisidx[type] = 0; } } #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(int c, int 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(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(void) { 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; #ifdef FEAT_AUTOCMD char_u typestr[2]; #endif int save_restart_edit = restart_edit; int save_State = State; int save_exmode = exmode_active; #ifdef FEAT_RIGHTLEFT int save_cmdmsg_rl = cmdmsg_rl; #endif #ifdef FEAT_FOLDING int save_KeyTyped; #endif /* 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. */ block_autocmds(); # endif /* don't use a new tab page */ cmdmod.tab = 0; /* Create a window for the command-line buffer. */ if (win_split((int)p_cwh, WSP_BOT) == FAIL) { beep_flush(); # ifdef FEAT_AUTOCMD unblock_autocmds(); # endif return K_IGNORE; } cmdwin_type = get_cmdline_type(); /* Create the command-line buffer empty. */ (void)do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, ECMD_HIDE, NULL); (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_FOLDING curwin->w_p_fen = FALSE; #endif # ifdef FEAT_RIGHTLEFT curwin->w_p_rl = cmdmsg_rl; cmdmsg_rl = FALSE; # endif RESET_BINDING(curwin); # ifdef FEAT_AUTOCMD /* Do execute autocommands for setting the filetype (load syntax). */ unblock_autocmds(); # endif /* Showing the prompt may have set need_wait_return, reset it. */ need_wait_return = FALSE; histtype = hist_char2type(cmdwin_type); if (histtype == HIST_CMD || histtype == HIST_DEBUG) { if (p_wc == TAB) { add_map((char_u *)" ", INSERT); add_map((char_u *)" a", NORMAL); } set_option_value((char_u *)"ft", 0L, (char_u *)"vim", OPT_LOCAL); } /* Reset 'textwidth' after setting 'filetype' (the Vim filetype plugin * sets 'textwidth' to 78). */ curbuf->b_p_tw = 0; /* 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; changed_line_abv_curs(); invalidate_botline(); redraw_later(SOME_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); if (restart_edit != 0) /* autocmd with ":startinsert" */ stuffcharReadbuff(K_NOP); # endif i = RedrawingDisabled; RedrawingDisabled = 0; /* * Call the main loop until or CTRL-C is typed. */ cmdwin_result = 0; main_loop(TRUE, FALSE); RedrawingDisabled = i; # ifdef FEAT_AUTOCMD # ifdef FEAT_FOLDING save_KeyTyped = KeyTyped; # endif /* Trigger CmdwinLeave autocommands. */ apply_autocmds(EVENT_CMDWINLEAVE, typestr, typestr, FALSE, curbuf); # ifdef FEAT_FOLDING /* Restore KeyTyped in case it is modified by autocommands */ KeyTyped = save_KeyTyped; # endif # endif /* Restore the command line info. */ ccline = save_ccline; cmdwin_type = 0; exmode_active = save_exmode; /* Safety check: The old window or buffer was deleted: It's 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 || cmdwin_result == K_XF2) /* :qa[!] typed */ { char *p = (cmdwin_result == K_XF2) ? "qa" : "qa!"; if (histtype == HIST_CMD) { /* Execute the command directly. */ ccline.cmdbuff = vim_strsave((char_u *)p); cmdwin_result = CAR; } else { /* First need to cancel what we were doing. */ ccline.cmdbuff = NULL; stuffcharReadbuff(':'); stuffReadbuff((char_u *)p); stuffcharReadbuff(CAR); } } else if (cmdwin_result == K_XF2) /* :qa typed */ { ccline.cmdbuff = vim_strsave((char_u *)"qa"); cmdwin_result = CAR; } else if (cmdwin_result == Ctrl_C) { /* :q or :close, don't execute any command * and don't modify the cmd window. */ ccline.cmdbuff = NULL; } 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. */ block_autocmds(); # endif # ifdef FEAT_CONCEAL /* Avoid command-line window first character being concealed. */ curwin->w_p_cole = 0; # endif wp = curwin; bp = curbuf; win_goto(old_curwin); win_close(wp, TRUE); /* win_close() may have already wiped the buffer when 'bh' is * set to 'wipe' */ if (buf_valid(bp)) close_buffer(NULL, bp, DOBUF_WIPE, FALSE); /* Restore window sizes. */ win_size_restore(&winsizes); # ifdef FEAT_AUTOCMD unblock_autocmds(); # endif } ga_clear(&winsizes); restart_edit = save_restart_edit; # ifdef FEAT_RIGHTLEFT cmdmsg_rl = save_cmdmsg_rl; # endif 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(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_looplevel > 0 ? -1 : #endif NUL, eap->cookie, 0); if (theline == NULL || STRCMP(end_pattern, theline) == 0) { vim_free(theline); break; } ga_concat(&ga, theline); ga_append(&ga, '\n'); vim_free(theline); } ga_append(&ga, NUL); return (char_u *)ga.ga_data; } vim-7.4.1689/src/farsi.c000066400000000000000000001107521267703067000146420ustar00rootroot00000000000000/* 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_(int c); static int F_is_TyE(int c); static int F_is_TyC_TyD(int c); static int F_is_TyB_TyC_TyD(int src, int offset); static int toF_TyB(int c); static void put_curr_and_l_to_X(int c); static void put_and_redo(int c); static void chg_c_toX_orX(void); static void chg_c_to_X_orX_(void); static void chg_c_to_X_or_X(void); static void chg_l_to_X_orX_(void); static void chg_l_toXor_X(void); static void chg_r_to_Xor_X_(void); static int toF_leading(int c); static int toF_Rjoin(int c); static int canF_Ljoin(int c); static int canF_Rjoin(int c); static int F_isterm(int c); static int toF_ending(int c); static void lrswapbuf(char_u *buf, int len); /* ** Convert the given Farsi character into a _X or _X_ type */ static int toF_Xor_X_(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 < (colnr_T)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(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(int src, int 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(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(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(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(int c) { int tempc; if (curwin->w_p_rl && p_ri) return; if ((curwin->w_cursor.col < (colnr_T)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(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(void) { 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_(void) { 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 (void) { int tempc; tempc = gchar_cursor(); if (curwin->w_cursor.col + 1 < (colnr_T)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_ (void) { int tempc; if (curwin->w_cursor.col != 0 && (curwin->w_cursor.col + 1 == (colnr_T)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 character left to the cursor to a X or _X type */ static void chg_l_toXor_X (void) { int tempc; if (curwin->w_cursor.col != 0 && (curwin->w_cursor.col + 1 == (colnr_T)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 character right to the cursor to a _X or _X_ type */ static void chg_r_to_Xor_X_(void) { 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(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(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(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(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(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(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(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(void) { 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 standard. */ void conv_to_pstd(void) { 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(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(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(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 search path and substitute section * accordingly. * TODO: handle different separator characters. Use skip_regexp(). */ char_u * lrF_sub(char_u *ibuf) { char_u *p, *ep; int i, cnt; p = ibuf; /* Find the boundary of the search path */ while (((p = vim_strchr(p + 1, '/')) != NULL) && p[-1] == '\\') ; if (p == NULL) return ibuf; /* Reverse the Farsi characters in the search path. */ lrFswap(ibuf, (int)(p-ibuf)); /* Now find the boundary 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(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(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(int c) { return (c >= FARSI_0 && c <= FARSI_9); } /* * F_ischar returns TRUE if 'c' is a Farsi character. */ int F_ischar(int c) { return (c >= TEE_ && c <= YE_); } void farsi_fkey( 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(); } } } vim-7.4.1689/src/farsi.h000066400000000000000000000133321267703067000146430ustar00rootroot00000000000000/* 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 categorized 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 ; vim-7.4.1689/src/feature.h000066400000000000000000001010431267703067000151670ustar00rootroot00000000000000/* 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. */ /* * 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 features 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 /* * For Unix, Mac and Win32 use +huge by default. These days CPUs are fast and * Memory is cheap. * Use +big for older systems: Other MS-Windows, dos32, OS/2 and VMS. * The dos16 version has very little RAM available, use +small. * Otherwise use +normal */ #if !defined(FEAT_TINY) && !defined(FEAT_SMALL) && !defined(FEAT_NORMAL) \ && !defined(FEAT_BIG) && !defined(FEAT_HUGE) # if defined(UNIX) || defined(WIN3264) || defined(MACOS) # define FEAT_HUGE # else # if defined(MSWIN) || defined(VMS) || defined(MACOS) || defined(AMIGA) # define FEAT_BIG # 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. * +vertsplit Vertically split windows. */ #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 /* * +cmdhist Command line history. */ #ifdef FEAT_SMALL # define FEAT_CMDHIST #endif /* * Message history is fixed at 200 message, 20 for the tiny version. */ #ifdef FEAT_SMALL # define MAX_MSG_HIST_LEN 200 #else # define MAX_MSG_HIST_LEN 20 #endif /* * +jumplist Jumplist, CTRL-O and CTRL-I commands. */ #ifdef FEAT_SMALL # define FEAT_JUMPLIST #endif /* the cmdline-window requires FEAT_WINDOWS and FEAT_CMDHIST */ #if defined(FEAT_WINDOWS) && 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 /* * +visual Visual mode - now always included. * +visualextra Extra features for Visual mode (mostly block operators). */ #ifdef FEAT_NORMAL # define FEAT_VISUALEXTRA #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. * Also 'numberwidth'. */ #ifdef FEAT_NORMAL # define FEAT_LINEBREAK #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 "" 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. * * Disabled for EBCDIC as it requires multibyte. */ #if defined(FEAT_BIG) && !defined(EBCDIC) # define FEAT_RIGHTLEFT #endif /* * +farsi Farsi (Persian language) Keymap support. * Requires FEAT_RIGHTLEFT. * * Disabled for EBCDIC as it requires multibyte. */ #if defined(FEAT_BIG) && !defined(EBCDIC) # 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. * * Disabled for EBCDIC as it requires multibyte. */ #if defined(FEAT_BIG) && VIM_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 z/OS 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. * +float Floating point variables. */ #ifdef FEAT_NORMAL # define FEAT_EVAL # if defined(HAVE_FLOAT_FUNCS) || defined(WIN3264) || defined(MACOS) # define FEAT_FLOAT # endif #endif /* * +profile Profiling for functions and scripts. */ #if defined(FEAT_HUGE) \ && defined(FEAT_EVAL) \ && ((defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)) \ || defined(WIN3264)) # define FEAT_PROFILE #endif /* * +reltime reltime() function */ #if defined(FEAT_NORMAL) \ && defined(FEAT_EVAL) \ && ((defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)) \ || defined(WIN3264)) # define FEAT_RELTIME #endif /* * +timers timer_start() */ #if defined(FEAT_RELTIME) && (defined(UNIX) || defined(WIN32)) # define FEAT_TIMERS #endif /* * +textobjects Text objects: "vaw", "das", etc. */ #if defined(FEAT_NORMAL) && defined(FEAT_EVAL) # define FEAT_TEXTOBJ #endif /* * Insert mode completion with 'completefunc'. */ #if defined(FEAT_INS_EXPAND) && defined(FEAT_EVAL) # define FEAT_COMPL_FUNC #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) # 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 /* * +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 /* * +conceal 'conceal' option. Needs syntax highlighting * as this is how the concealed text is defined. */ #if defined(FEAT_BIG) && defined(FEAT_SYN_HL) # define FEAT_CONCEAL #endif /* * +spell spell checking * * Disabled for EBCDIC: * Doesn't work (SIGSEGV). */ #if (defined(FEAT_NORMAL) || defined(PROTO)) && !defined(EBCDIC) # define FEAT_SPELL #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. * * 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) # 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 ). */ #if defined(FEAT_NORMAL) && !defined(FEAT_CRYPT) || defined(PROTO) # define FEAT_CRYPT #endif /* * +mksession ":mksession" command. * Requires +windows and +vertsplit. */ #if defined(FEAT_NORMAL) && defined(FEAT_WINDOWS) # 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 z/OS Unix currently. */ #if (defined(FEAT_NORMAL) || defined(FEAT_GUI_GTK) || defined(FEAT_ARABIC)) \ && !defined(FEAT_MBYTE) && VIM_SIZEOF_INT >= 4 && !defined(EBCDIC) # define FEAT_MBYTE #endif /* Define this if you want to use 16 bit Unicode only, reduces memory used for * the screen structures. */ /* #define UNICODE16 */ /* * +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) && VIM_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_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. */ #endif /* * +xfontset X fontset support. For outputting wide characters. */ #ifndef FEAT_XFONTSET # if defined(FEAT_MBYTE) && defined(HAVE_X11) && !defined(FEAT_GUI_GTK) # 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 /* * +cursorbind synchronization of split windows */ #if defined(FEAT_NORMAL) && defined(FEAT_WINDOWS) # define FEAT_CURSORBIND #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 /* * GUI tabline */ #if defined(FEAT_WINDOWS) && defined(FEAT_NORMAL) \ && (defined(FEAT_GUI_GTK) \ || (defined(FEAT_GUI_MOTIF) && defined(HAVE_XM_NOTEBOOK_H)) \ || defined(FEAT_GUI_MAC) \ || (defined(FEAT_GUI_MSWIN) \ && (!defined(_MSC_VER) || _MSC_VER > 1020))) # define FEAT_GUI_TABLINE #endif /* * +browse ":browse" command. * or just the ":browse" command modifier */ #if defined(FEAT_NORMAL) # define FEAT_BROWSE_CMD # if 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 #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 /* * +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) \ || defined(FEAT_GUI_W32)) /* 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 # ifndef ALWAYS_USE_GUI # define FEAT_CON_DIALOG # endif #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 lose 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 file with * timestamps. */ #if defined(FEAT_NORMAL) \ && ((defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)) \ || defined(WIN3264)) # define STARTUPTIME 1 #endif /* * 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" */ /* * 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 modified 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_sgr Unix only: Include code for for SGR-styled mouse. * +mouse_sysmouse Unix only: Include code for FreeBSD and DragonFly * console mouse handling. * +mouse_urxvt Unix only: Include code for for urxvt mosue handling. * +mouse Any mouse support (any of the above enabled). */ /* OS/2 and Amiga console have no mouse support */ #if !defined(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 # ifdef FEAT_BIG # define FEAT_MOUSE_URXVT # endif # ifdef FEAT_BIG # define FEAT_MOUSE_SGR # endif # if defined(FEAT_NORMAL) && defined(WIN3264) # define DOS_MOUSE # endif # if defined(FEAT_NORMAL) && defined(__QNX__) # define FEAT_MOUSE_PTERM # endif #endif /* * Note: Only one of the following may be defined: * FEAT_MOUSE_GPM * FEAT_SYSMOUSE * FEAT_MOUSE_JSB * FEAT_MOUSE_PTERM */ #if defined(FEAT_NORMAL) && defined(HAVE_GPM) # define FEAT_MOUSE_GPM #endif #if defined(FEAT_NORMAL) && defined(HAVE_SYSMOUSE) # define FEAT_SYSMOUSE #endif /* urxvt is a small variation of mouse_xterm, and shares its code */ #if defined(FEAT_MOUSE_URXVT) && !defined(FEAT_MOUSE_XTERM) # define FEAT_MOUSE_XTERM #endif /* sgr is a small variation of mouse_xterm, and shares its code */ #if defined(FEAT_MOUSE_SGR) && !defined(FEAT_MOUSE_XTERM) # define FEAT_MOUSE_XTERM #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) \ || defined(FEAT_SYSMOUSE) \ || defined(FEAT_MOUSE_URXVT) \ || defined(FEAT_MOUSE_SGR)) # 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_CYGWIN_WIN32_CLIPBOARD # define FEAT_CLIPBOARD #endif #ifdef FEAT_GUI # ifndef FEAT_CLIPBOARD # define FEAT_CLIPBOARD # endif #endif #if defined(FEAT_NORMAL) \ && (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 #if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MOTIF) \ || defined(MSWIN_FIND_REPLACE) # define FIND_REPLACE_DIALOG 1 #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 obtained. */ #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(WIN3264) && !defined(FEAT_GUI_W32) # define MCH_CURSOR_SHAPE # endif # if defined(FEAT_GUI_W32) || 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' and 'concealcursor' options. */ #if defined(FEAT_GUI) \ || defined(MCH_CURSOR_SHAPE) \ || defined(FEAT_MOUSESHAPE) \ || defined(FEAT_CONCEAL) \ || (defined(UNIX) && defined(FEAT_NORMAL)) # define CURSOR_SHAPE #endif #if defined(FEAT_MZSCHEME) && (defined(FEAT_GUI_W32) || defined(FEAT_GUI_GTK) \ || defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA) \ || defined(FEAT_GUI_MAC)) # define MZSCHEME_GUI_THREADS #endif /* * +ARP Amiga only. Use arp.library, DOS 2.0 is not required. */ #if !defined(NO_ARP) && !defined(__amigaos4__) # define FEAT_ARP #endif /* * +GUI_Athena To compile Vim with or without the GUI (gvim) you have * +GUI_Motif to edit the Makefile. */ /* * +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. * +lua Lua interface: "--enable-luainterp" * +mzscheme MzScheme interface: "--enable-mzscheme" * +perl Perl interface: "--enable-perlinterp" * +python Python interface: "--enable-pythoninterp" * +tcl TCL interface: "--enable-tclinterp" * +sun_workshop Sun Workshop integration * +netbeans_intg Netbeans integration * +channel Inter process communication */ /* * 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 feature requires +listcmds and +eval. */ #if (!defined(FEAT_LISTCMDS) || !defined(FEAT_EVAL)) \ && defined(FEAT_NETBEANS_INTG) # undef FEAT_NETBEANS_INTG #endif /* * The +channel feature requires +eval. */ #if !defined(FEAT_EVAL) && defined(FEAT_JOB_CHANNEL) # undef FEAT_JOB_CHANNEL #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_TABLINE)) \ && !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_W32)) \ || defined(FEAT_SUN_WORKSHOP) \ || defined(FEAT_NETBEANS_INTG) || defined(FEAT_EVAL)) # 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 /* both Motif and Athena are X11 and share some code */ #if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA) # define FEAT_GUI_X11 #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 /* * +autochdir 'autochdir' option. */ #if defined(FEAT_SUN_WORKSHOP) || defined(FEAT_NETBEANS_INTG) \ || defined(FEAT_BIG) # define FEAT_AUTOCHDIR #endif /* * +persistent_undo 'undofile', 'undodir' options, :wundo and :rundo, and * implementation. */ #ifdef FEAT_NORMAL # define FEAT_PERSISTENT_UNDO #endif /* * +filterpipe */ #if (defined(UNIX) && !defined(USE_SYSTEM)) \ || (defined(WIN3264) && defined(FEAT_GUI_W32)) # define FEAT_FILTERPIPE #endif vim-7.4.1689/src/fileio.c000066400000000000000000007771141267703067000150200ustar00rootroot00000000000000/* 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 */ #include "vim.h" #if defined(__TANDEM) || defined(__MINT__) # include /* for SSIZE_MAX */ #endif #if defined(HAVE_UTIME) && defined(HAVE_UTIME_H) # include /* for struct utimbuf */ #endif #define BUFSIZE 8192 /* size of normal write buffer */ #define SMBUFSIZE 256 /* size of emergency write buffer */ /* Is there any system that doesn't have access()? */ #define USE_MCH_ACCESS #if (defined(sun) || defined(__FreeBSD__)) && defined(S_ISCHR) # define OPEN_CHR_FILES static int is_dev_fd_file(char_u *fname); #endif #ifdef FEAT_MBYTE static char_u *next_fenc(char_u **pp); # ifdef FEAT_EVAL static char_u *readfile_charconvert(char_u *fname, char_u *fenc, int *fdp); # endif #endif #ifdef FEAT_VIMINFO static void check_marks_read(void); #endif #ifdef FEAT_CRYPT static char_u *check_for_cryptkey(char_u *cryptkey, char_u *ptr, long *sizep, off_t *filesizep, int newfile, char_u *fname, int *did_ask); #endif #ifdef UNIX static void set_file_time(char_u *fname, time_t atime, time_t mtime); #endif static int set_rw_fname(char_u *fname, char_u *sfname); static int msg_add_fileformat(int eol_type); static void msg_add_eol(void); static int check_mtime(buf_T *buf, struct stat *s); static int time_differs(long t1, long t2); #ifdef FEAT_AUTOCMD static int apply_autocmds_exarg(event_T event, char_u *fname, char_u *fname_io, int force, buf_T *buf, exarg_T *eap); static int au_find_group(char_u *name); # define AUGROUP_DEFAULT -1 /* default autocmd group */ # define AUGROUP_ERROR -2 /* erroneous autocmd group */ # define AUGROUP_ALL -3 /* all autocmd groups */ #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; /* length of data */ #ifdef HAS_BW_FLAGS int bw_flags; /* FIO_ flags */ #endif #ifdef FEAT_CRYPT buf_T *bw_buffer; /* buffer being written */ #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 */ linenr_T bw_conv_error_lnum; /* first line with error or zero */ linenr_T bw_start_lnum; /* line number at start of buffer */ # ifdef USE_ICONV iconv_t bw_iconv_fd; /* descriptor for iconv() or -1 */ # endif #endif }; static int buf_write_bytes(struct bw_info *ip); #ifdef FEAT_MBYTE static linenr_T readfile_linenr(linenr_T linecnt, char_u *p, char_u *endp); static int ucs2bytes(unsigned c, char_u **pp, int flags); static int need_conversion(char_u *fenc); static int get_fio_flags(char_u *ptr); static char_u *check_for_bom(char_u *p, long size, int *lenp, int flags); static int make_bom(char_u *buf, char_u *name); # ifdef WIN3264 static int get_win_fio_flags(char_u *ptr); # endif # ifdef MACOS_X static int get_mac_fio_flags(char_u *ptr); # endif #endif static int move_lines(buf_T *frombuf, buf_T *tobuf); #ifdef TEMPDIRNAMES static void vim_settempdir(char_u *tempdir); #endif #ifdef FEAT_AUTOCMD static char *e_auchangedbuf = N_("E812: Autocommands changed buffer or buffer name"); #endif void filemess( 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) * READ_KEEP_UNDO don't clear undo info or read it from a file * * return FAIL for failure, OK otherwise */ int readfile( 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); int set_options = newfile || read_buffer || (eap != NULL && eap->read_edit); 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; off_t filesize = 0; int skip_read = FALSE; #ifdef FEAT_CRYPT char_u *cryptkey = NULL; int did_ask_for_key = FALSE; #endif #ifdef FEAT_PERSISTENT_UNDO context_sha256_T sha_ctx; int read_undo_file = FALSE; #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; linenr_T conv_error = 0; /* line nr with conversion error */ linenr_T illegal_byte = 0; /* line nr with illegal byte */ int keep_dest_enc = FALSE; /* don't retry when char doesn't fit in destination encoding */ int bad_char_behavior = BAD_REPLACE; /* BAD_KEEP, BAD_DROP or character to * replace with */ 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 buf_T *old_curbuf; char_u *old_b_ffname; char_u *old_b_fname; int using_b_ffname; int using_b_fname; #endif curbuf->b_no_eol_lnum = 0; /* in case it was set by the previous read */ /* * 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 (set_rw_fname(fname, sfname) == FAIL) return FAIL; } #ifdef FEAT_AUTOCMD /* Remember the initial values of curbuf, curbuf->b_ffname and * curbuf->b_fname to detect whether they are altered as a result of * executing nasty autocommands. Also check if "fname" and "sfname" * point to one of these values. */ old_curbuf = curbuf; old_b_ffname = curbuf->b_ffname; old_b_fname = curbuf->b_fname; using_b_ffname = (fname == curbuf->b_ffname) || (sfname == curbuf->b_ffname); using_b_fname = (fname == curbuf->b_fname) || (sfname == curbuf->b_fname); #endif /* After reading a file the cursor line changes but we don't want to * display the line. */ ex_no_reprint = TRUE; /* don't display the file info for another buffer now */ need_fileinfo = FALSE; /* * 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) { p = fname + STRLEN(fname); if (after_pathsep(fname, p) || STRLEN(fname) >= MAXPATHL) { filemess(curbuf, fname, (char_u *)_("Illegal file name"), 0); msg_end(); msg_scroll = msg_save; return FAIL; } } if (!read_stdin && !read_buffer) { #ifdef UNIX /* * On Unix it is possible to read a directory, so we have to * check for it before the mch_open(). */ 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 # ifdef OPEN_CHR_FILES && !(S_ISCHR(perm) && is_dev_fd_file(fname)) /* ... or a character special file named /dev/fd/ */ # 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 #if defined(MSWIN) /* * MS-Windows allows opening a device, but we will probably get stuck * trying to read it. */ if (!p_odev && mch_nodetype(fname) == NODE_WRITABLE) { filemess(curbuf, fname, (char_u *)_("is a device (disabled with 'opendevice' option)"), 0); msg_end(); msg_scroll = msg_save; return FAIL; } #endif } /* Set default or forced 'fileformat' and 'binary'. */ set_file_options(set_options, eap); /* * 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) curbuf->b_p_ro = FALSE; if (newfile && !read_stdin && !read_buffer) { /* Remember time of file. */ if (mch_stat((char *)fname, &st) >= 0) { buf_store_time(curbuf, &st, fname); curbuf->b_mtime_read = curbuf->b_mtime; #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; curbuf->b_fab_rat = st.st_fab_rat; curbuf->b_fab_mrs = st.st_fab_mrs; #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 Amiga: check readonly by trying to open the file for writing */ file_readonly = FALSE; if (read_stdin) { #if defined(MSWIN) /* 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 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 #ifdef ENOENT && errno == ENOENT #endif ) { /* * 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); #ifdef FEAT_AUTOCMD /* SwapExists autocommand may mess things up */ if (curbuf != old_curbuf || (using_b_ffname && (old_b_ffname != curbuf->b_ffname)) || (using_b_fname && (old_b_fname != curbuf->b_fname))) { EMSG(_(e_auchangedbuf)); return FAIL; } #endif } if (dir_of_file_exists(fname)) filemess(curbuf, sfname, (char_u *)_("[New File]"), 0); else filemess(curbuf, sfname, (char_u *)_("[New DIRECTORY]"), 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 /* Set forced 'fileencoding'. */ if (eap != NULL) set_forced_fenc(eap); #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 *)( # ifdef EFBIG (errno == EFBIG) ? _("[File too big]") : # endif # ifdef EOVERFLOW (errno == EOVERFLOW) ? _("[File too big]") : # endif _("[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 (set_options) { /* Don't change 'eol' if reading from buffer as it will already be * correctly set when reading stdin. */ if (!read_buffer) { curbuf->b_p_eol = TRUE; curbuf->b_start_eol = TRUE; } #ifdef FEAT_MBYTE curbuf->b_p_bomb = FALSE; curbuf->b_start_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 FEAT_AUTOCMD if (!read_stdin && (curbuf != old_curbuf || (using_b_ffname && (old_b_ffname != curbuf->b_ffname)) || (using_b_fname && (old_b_fname != curbuf->b_fname)))) { EMSG(_(e_auchangedbuf)); if (!read_buffer) close(fd); return FAIL; } #endif #ifdef UNIX /* Set swap file protection bits after creating it. */ if (swap_mode > 0 && curbuf->b_ml.ml_mfp != NULL && curbuf->b_ml.ml_mfp->mf_fname != NULL) (void)mch_setperm(curbuf->b_ml.ml_mfp->mf_fname, (long)swap_mode); #endif } #if defined(HAS_SWAP_EXISTS_ACTION) /* 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; /* * 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. * * Don't allow the autocommands to change the buffer name either * (cd for example) if it invalidates fname or sfname. */ if (!read_stdin && (curbuf != old_curbuf || (using_b_ffname && (old_b_ffname != curbuf->b_ffname)) || (using_b_fname && (old_b_fname != curbuf->b_fname)) || (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 /* "++bad=" argument. */ if (eap != NULL && eap->bad_char != 0) { bad_char_behavior = eap->bad_char; if (set_options) curbuf->b_bad_char = eap->bad_char; } else curbuf->b_bad_char = 0; /* * Decide which 'encoding' to use or use first. */ if (eap != NULL && eap->force_enc != 0) { fenc = enc_canonize(eap->cmd + eap->force_enc); fenc_alloced = TRUE; keep_dest_enc = 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]; int fc; /* 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) { fc = fname[STRLEN(fname) - 1]; if (TOLOWER_ASC(fc) == '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 = read_eintr(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. */ if (!enc_utf8) 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 (set_options) { curbuf->b_p_bomb = FALSE; curbuf->b_start_bomb = FALSE; } conv_error = 0; #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); try_unix = try_dos = try_mac = FALSE; } 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 = 0; 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 may be required when the encoding of the file is different * from 'encoding' or 'encoding' is UTF-16, UCS-2 or UCS-4. */ fio_flags = 0; converted = need_conversion(fenc); if (converted) { /* "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 fixed at a specific encoding. */ can_retry = (*fenc != NUL && !read_stdin && !keep_dest_enc); #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 #ifdef FEAT_PERSISTENT_UNDO read_undo_file = (newfile && (flags & READ_KEEP_UNDO) == 0 && curbuf->b_ffname != NULL && curbuf->b_p_udf && !filtering && !read_stdin && !read_buffer); if (read_undo_file) sha256_start(&sha_ctx); #endif #ifdef FEAT_CRYPT if (curbuf->b_cryptstate != NULL) { /* Need to free the state, but keep the key, don't want to ask for * it again. */ crypt_free_state(curbuf->b_cryptstate); curbuf->b_cryptstate = NULL; } #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 VIM_SIZEOF_INT <= 2 if (linerest >= 0x7ff0) { ++split; *ptr = NL; /* split line by inserting a NL */ size = 1; } else #endif { if (!skip_read) { #if VIM_SIZEOF_INT > 2 # if defined(SSIZE_MAX) && (SSIZE_MAX < 0x10000L) 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)((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 = (int)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 = (int)(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 = read_eintr(fd, ptr, size); } #ifdef FEAT_CRYPT /* * At start of file: Check for magic number of encryption. */ if (filesize == 0 && size > 0) cryptkey = check_for_cryptkey(cryptkey, ptr, &size, &filesize, newfile, sfname, &did_ask_for_key); /* * Decrypt the read bytes. This is done before checking for * EOF because the crypt layer may be buffering. */ if (cryptkey != NULL && size > 0) { if (crypt_works_inplace(curbuf->b_cryptstate)) { crypt_decode_inplace(curbuf->b_cryptstate, ptr, size); } else { char_u *newptr = NULL; int decrypted_size; decrypted_size = crypt_decode_alloc( curbuf->b_cryptstate, ptr, size, &newptr); /* If the crypt layer is buffering, not producing * anything yet, need to read more. */ if (size > 0 && decrypted_size == 0) continue; if (linerest == 0) { /* Simple case: reuse returned buffer (may be * NULL, checked later). */ new_buffer = newptr; } else { long_u new_size; /* Need new buffer to add bytes carried over. */ new_size = (long_u)(decrypted_size + linerest + 1); new_buffer = lalloc(new_size, FALSE); if (new_buffer == NULL) { do_outofmem_msg(new_size); error = TRUE; break; } mch_memmove(new_buffer, buffer, linerest); if (newptr != NULL) mch_memmove(new_buffer + linerest, newptr, decrypted_size); } if (new_buffer != NULL) { vim_free(buffer); buffer = new_buffer; new_buffer = NULL; line_start = buffer; ptr = buffer + linerest; } size = decrypted_size; } } #endif if (size <= 0) { if (size < 0) /* read error */ error = TRUE; #ifdef FEAT_MBYTE else if (conv_restlen > 0) { /* * Reached end-of-file but some trailing bytes could * not be converted. Truncated file? */ /* When we did a conversion report an error. */ if (fio_flags != 0 # ifdef USE_ICONV || iconv_fd != (iconv_t)-1 # endif ) { if (can_retry) goto rewind_retry; if (conv_error == 0) conv_error = curbuf->b_ml.ml_line_count - linecnt + 1; } /* Remember the first linenr with an illegal byte */ else if (illegal_byte == 0) illegal_byte = curbuf->b_ml.ml_line_count - linecnt + 1; if (bad_char_behavior == BAD_DROP) { *(ptr - conv_restlen) = NUL; conv_restlen = 0; } else { /* Replace the trailing bytes with the replacement * character if we were converting; if we weren't, * leave the UTF8 checking code to do it, as it * works slightly differently. */ if (bad_char_behavior != BAD_KEEP && (fio_flags != 0 # ifdef USE_ICONV || iconv_fd != (iconv_t)-1 # endif )) { while (conv_restlen > 0) { *(--ptr) = bad_char_behavior; --conv_restlen; } } fio_flags = 0; /* don't convert this */ # ifdef USE_ICONV if (iconv_fd != (iconv_t)-1) { iconv_close(iconv_fd); iconv_fd = (iconv_t)-1; } # endif } } #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 || (cryptkey != NULL && filesize == crypt_get_header_len( crypt_get_method_nr(curbuf))) # 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 (set_options) { curbuf->b_p_bomb = TRUE; curbuf->b_start_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; } } /* Include not converted bytes. */ ptr -= conv_restlen; size += conv_restlen; conv_restlen = 0; #endif /* * Break here for a read error or end-of-file. */ if (size <= 0) break; #ifdef FEAT_MBYTE # 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. Except for when there is no * alternative (help files). */ while ((iconv(iconv_fd, (void *)&fromp, &from_size, &top, &to_size) == (size_t)-1 && ICONV_ERRNO != ICONV_EINVAL) || from_size > CONV_RESTLEN) { if (can_retry) goto rewind_retry; if (conv_error == 0) conv_error = readfile_linenr(linecnt, ptr, (char_u *)top); /* Deal with a bad byte and continue with the next. */ ++fromp; --from_size; if (bad_char_behavior == BAD_KEEP) { *top++ = *(fromp - 1); --to_size; } else if (bad_char_behavior != BAD_DROP) { *top++ = bad_char_behavior; --to_size; } } 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) { char_u *src, *dst; WCHAR ucs2buf[3]; int ucs2len; int codepage = FIO_GET_CP(fio_flags); int bytelen; int found_bad; char replstr[2]; /* * Conversion from an MS-Windows codepage or UTF-8 to UTF-8 or * a codepage, using standard MS-Windows functions. This * requires two steps: * 1. convert from 'fileencoding' to ucs-2 * 2. convert from ucs-2 to 'encoding' * * Because there may be illegal bytes AND an incomplete byte * sequence at the end, we may have to do the conversion one * character at a time to get it right. */ /* Replacement string for WideCharToMultiByte(). */ if (bad_char_behavior > 0) replstr[0] = bad_char_behavior; else replstr[0] = '?'; replstr[1] = NUL; /* * Move the bytes to the end of the buffer, so that we have * room to put the result at the start. */ src = ptr + real_size - size; mch_memmove(src, ptr, size); /* * Do the conversion. */ dst = ptr; size = size; while (size > 0) { found_bad = FALSE; # ifdef CP_UTF8 /* VC 4.1 doesn't define CP_UTF8 */ if (codepage == CP_UTF8) { /* Handle CP_UTF8 input ourselves to be able to handle * trailing bytes properly. * Get one UTF-8 character from src. */ bytelen = (int)utf_ptr2len_len(src, size); if (bytelen > size) { /* Only got some bytes of a character. Normally * it's put in "conv_rest", but if it's too long * deal with it as if they were illegal bytes. */ if (bytelen <= CONV_RESTLEN) break; /* weird overlong byte sequence */ bytelen = size; found_bad = TRUE; } else { int u8c = utf_ptr2char(src); if (u8c > 0xffff || (*src >= 0x80 && bytelen == 1)) found_bad = TRUE; ucs2buf[0] = u8c; ucs2len = 1; } } else # endif { /* We don't know how long the byte sequence is, try * from one to three bytes. */ for (bytelen = 1; bytelen <= size && bytelen <= 3; ++bytelen) { ucs2len = MultiByteToWideChar(codepage, MB_ERR_INVALID_CHARS, (LPCSTR)src, bytelen, ucs2buf, 3); if (ucs2len > 0) break; } if (ucs2len == 0) { /* If we have only one byte then it's probably an * incomplete byte sequence. Otherwise discard * one byte as a bad character. */ if (size == 1) break; found_bad = TRUE; bytelen = 1; } } if (!found_bad) { int i; /* Convert "ucs2buf[ucs2len]" to 'enc' in "dst". */ if (enc_utf8) { /* From UCS-2 to UTF-8. Cannot fail. */ for (i = 0; i < ucs2len; ++i) dst += utf_char2bytes(ucs2buf[i], dst); } else { BOOL bad = FALSE; int dstlen; /* From UCS-2 to "enc_codepage". If the * conversion uses the default character "?", * the data doesn't fit in this encoding. */ dstlen = WideCharToMultiByte(enc_codepage, 0, (LPCWSTR)ucs2buf, ucs2len, (LPSTR)dst, (int)(src - dst), replstr, &bad); if (bad) found_bad = TRUE; else dst += dstlen; } } if (found_bad) { /* Deal with bytes we can't convert. */ if (can_retry) goto rewind_retry; if (conv_error == 0) conv_error = readfile_linenr(linecnt, ptr, dst); if (bad_char_behavior != BAD_DROP) { if (bad_char_behavior == BAD_KEEP) { mch_memmove(dst, src, bytelen); dst += bytelen; } else *dst++ = bad_char_behavior; } } src += bytelen; size -= bytelen; } if (size > 0) { /* An incomplete byte sequence remaining. */ mch_memmove(conv_rest, src, size); conv_restlen = size; } /* The new size is equal to how much "dst" was advanced. */ size = (long)(dst - ptr); } else # endif # ifdef MACOS_CONVERT if (fio_flags & FIO_MACROMAN) { /* * Conversion from Apple MacRoman char encoding to UTF-8 or * latin1. This is in os_mac_conv.c. */ if (macroman2enc(ptr, &size, real_size) == FAIL) goto rewind_retry; } 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; if (conv_error == 0) conv_error = readfile_linenr(linecnt, ptr, p); if (bad_char_behavior == BAD_DROP) continue; if (bad_char_behavior != BAD_KEEP) u8c = bad_char_behavior; } /* 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); } u8c = 0x10000 + ((u16c & 0x3ff) << 10) + (u8c & 0x3ff); /* Check if the word is indeed a leading word. */ if (u16c < 0xd800 || u16c > 0xdbff) { if (can_retry) goto rewind_retry; if (conv_error == 0) conv_error = readfile_linenr(linecnt, ptr, p); if (bad_char_behavior == BAD_DROP) continue; if (bad_char_behavior != BAD_KEEP) u8c = bad_char_behavior; } } } 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); p -= len; u8c = utf_ptr2char(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; if (conv_error == 0) conv_error = readfile_linenr(linecnt, ptr, p); if (bad_char_behavior == BAD_DROP) continue; if (bad_char_behavior != BAD_KEEP) u8c = bad_char_behavior; } } } 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) goto rewind_retry; if (conv_error == 0) conv_error = readfile_linenr(linecnt, ptr, p); if (bad_char_behavior == BAD_DROP) ++dest; else if (bad_char_behavior == BAD_KEEP) *dest = u8c; else if (eap != NULL && eap->bad_char != 0) *dest = bad_char_behavior; else *dest = 0xBF; } 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 && !curbuf->b_p_bin) { int incomplete_tail = FALSE; /* Reading UTF-8: Check if the bytes are valid UTF-8. */ for (p = ptr; ; ++p) { int todo = (int)((ptr + size) - p); int l; if (todo <= 0) break; if (*p >= 0x80) { /* 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. */ l = utf_ptr2len_len(p, todo); if (l > todo && !incomplete_tail) { /* Avoid retrying with a different encoding when * a truncated file is more likely, or attempting * to read the rest of an incomplete sequence when * we have already done so. */ if (p > ptr || filesize > 0) incomplete_tail = TRUE; /* Incomplete byte sequence, move it to conv_rest[] * and try to read the rest of it, unless we've * already done so. */ if (p > ptr) { conv_restlen = todo; mch_memmove(conv_rest, p, conv_restlen); size -= conv_restlen; break; } } if (l == 1 || l > todo) { /* Illegal byte. If we can try another encoding * do that, unless at EOF where a truncated * file is more likely than a conversion error. */ if (can_retry && !incomplete_tail) break; # ifdef USE_ICONV /* When we did a conversion report an error. */ if (iconv_fd != (iconv_t)-1 && conv_error == 0) conv_error = readfile_linenr(linecnt, ptr, p); # endif /* Remember the first linenr with an illegal byte */ if (conv_error == 0 && illegal_byte == 0) illegal_byte = readfile_linenr(linecnt, ptr, p); /* Drop, keep or replace the bad byte. */ if (bad_char_behavior == BAD_DROP) { mch_memmove(p, p + 1, todo - 1); --p; --size; } else if (bad_char_behavior != BAD_KEEP) *p = bad_char_behavior; } else p += l - 1; } } if (p < ptr + size && !incomplete_tail) { /* Detected a UTF-8 error. */ 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; } } #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) { /* Reset the carriage return counter. */ if (try_mac) try_mac = 1; 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; } else if (*p == CAR && try_mac) try_mac++; } /* 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; } } else if (fileformat == EOL_UNKNOWN && try_mac == 1) /* Looking for CR but found no end-of-line markers at * all: use the default format. */ fileformat = default_fileformat(); } /* 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 (set_options) 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; } #ifdef FEAT_PERSISTENT_UNDO if (read_undo_file) sha256_update(&sha_ctx, line_start, len); #endif ++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 (set_options) 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; } #ifdef FEAT_PERSISTENT_UNDO if (read_undo_file) sha256_update(&sha_ctx, line_start, len); #endif ++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)) { /* remember for when writing */ if (set_options) curbuf->b_p_eol = FALSE; *ptr = NUL; len = (colnr_T)(ptr - line_start + 1); if (ml_append(lnum, line_start, len, newfile) == FAIL) error = TRUE; else { #ifdef FEAT_PERSISTENT_UNDO if (read_undo_file) sha256_update(&sha_ctx, line_start, len); #endif read_no_eol_lnum = ++lnum; } } if (set_options) save_file_ff(curbuf); /* remember the current file format */ #ifdef FEAT_CRYPT if (curbuf->b_cryptstate != NULL) { crypt_free_state(curbuf->b_cryptstate); curbuf->b_cryptstate = NULL; } if (cryptkey != NULL && cryptkey != curbuf->b_p_key) crypt_free_key(cryptkey); /* Don't set cryptkey to NULL, it's used below as a flag that * encryption was used. */ #endif #ifdef FEAT_MBYTE /* If editing a new file: set 'fenc' for the current buffer. * Also for ":read ++edit file". */ if (set_options) set_string_option_direct((char_u *)"fenc", -1, fenc, OPT_FREE|OPT_LOCAL, 0); 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 */ #ifdef HAVE_FD_CLOEXEC else { int fdflags = fcntl(fd, F_GETFD); if (fdflags >= 0 && (fdflags & FD_CLOEXEC) == 0) (void)fcntl(fd, F_SETFD, fdflags | FD_CLOEXEC); } #endif vim_free(buffer); #ifdef HAVE_DUP if (read_stdin) { /* Use stderr for stdin, makes shell commands work. */ close(0); ignored = 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); #ifdef FEAT_DIFF /* After reading the text into the buffer the diff info needs to * be updated. */ diff_invalidate(curbuf); #endif #ifdef FEAT_FOLDING /* All folds in the window are invalid now. Mark them for update * before triggering autocommands. */ foldUpdateAll(curwin); #endif } else if (linecnt) /* appended at least one line */ appended_lines_mark(from, linecnt); #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 # ifdef OPEN_CHR_FILES if (S_ISCHR(perm)) /* or character special */ { STRCAT(IObuff, _("[character special]")); c = TRUE; } # 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 (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) { crypt_append_msg(curbuf); c = TRUE; } #endif #ifdef FEAT_MBYTE if (conv_error != 0) { sprintf((char *)IObuff + STRLEN(IObuff), _("[CONVERSION ERROR in line %ld]"), (long)conv_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_get_header_len(crypt_get_method_nr(curbuf))); 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 != 0 && !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, 0); msg_scrolled_ign = FALSE; } /* with errors writing the file requires ":w!" */ if (newfile && (error #ifdef FEAT_MBYTE || conv_error != 0 || (illegal_byte > 0 && bad_char_behavior != BAD_KEEP) #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; #ifdef WIN32 /* * Work around a weird problem: When a file has two links (only * possible on NTFS) and we write through one link, then stat() it * through the other link, the timestamp information may be wrong. * It's correct again after reading the file, thus reset the timestamp * here. */ if (newfile && !read_stdin && !read_buffer && mch_stat((char *)fname, &st) >= 0) { buf_store_time(curbuf, &st, fname); curbuf->b_mtime_read = curbuf->b_mtime; } #endif } msg_scroll = msg_save; #ifdef FEAT_VIMINFO /* * Get the marks before executing autocommands, so they can be used there. */ check_marks_read(); #endif /* * We remember if the last line of the read didn't have * an eol even when 'binary' is off, to support turning 'fixeol' off, * or writing the read again with 'binary' on. The latter is required * for ":autocmd FileReadPost *.gz set bin|'[,']!gunzip" to work. */ curbuf->b_no_eol_lnum = read_no_eol_lnum; /* When reloading a buffer put the cursor at the first line that is * different. */ if (flags & READ_KEEP_UNDO) u_find_first_changed(); #ifdef FEAT_PERSISTENT_UNDO /* * When opening a new file locate undo info and read it. */ if (read_undo_file) { char_u hash[UNDO_HASH_SIZE]; sha256_finish(&sha_ctx, hash); u_read_undo(NULL, hash, fname); } #endif #ifdef FEAT_AUTOCMD 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 (set_options) 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; } #ifdef OPEN_CHR_FILES /* * Returns TRUE if the file name argument is of the form "/dev/fd/\d\+", * which is the name of files used for process substitution output by * some shells on some operating systems, e.g., bash on SunOS. * Do not accept "/dev/fd/[012]", opening these may hang Vim. */ static int is_dev_fd_file(char_u *fname) { return (STRNCMP(fname, "/dev/fd/", 8) == 0 && VIM_ISDIGIT(fname[8]) && *skipdigits(fname + 9) == NUL && (fname[9] != NUL || (fname[8] != '0' && fname[8] != '1' && fname[8] != '2'))); } #endif #ifdef FEAT_MBYTE /* * From the current line count and characters read after that, estimate the * line number where we are now. * Used for error messages that include a line number. */ static linenr_T readfile_linenr( linenr_T linecnt, /* line count before reading more bytes */ char_u *p, /* start of more bytes read */ char_u *endp) /* end of more bytes read */ { char_u *s; linenr_T lnum; lnum = curbuf->b_ml.ml_line_count - linecnt + 1; for (s = p; s < endp; ++s) if (*s == '\n') ++lnum; return lnum; } #endif /* * Fill "*eap" to force the 'fileencoding', 'fileformat' and 'binary to be * equal to the buffer "buf". Used for calling readfile(). * Returns OK or FAIL. */ int prep_exarg(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); eap->bad_char = buf->b_bad_char; #else sprintf((char *)eap->cmd, "e ++ff=%s", buf->b_p_ff); #endif eap->force_ff = 7; eap->force_bin = buf->b_p_bin ? FORCE_BIN : FORCE_NOBIN; eap->read_edit = FALSE; eap->forceit = FALSE; return OK; } /* * Set default or forced 'fileformat' and 'binary'. */ void set_file_options(int set_options, exarg_T *eap) { /* set default 'fileformat' */ if (set_options) { 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); } } #if defined(FEAT_MBYTE) || defined(PROTO) /* * Set forced 'fileencoding'. */ void set_forced_fenc(exarg_T *eap) { if (eap->force_enc != 0) { char_u *fenc = enc_canonize(eap->cmd + eap->force_enc); if (fenc != NULL) set_string_option_direct((char_u *)"fenc", -1, fenc, OPT_FREE|OPT_LOCAL, 0); vim_free(fenc); } } /* * 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(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( 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', FALSE); 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(void) { if (!curbuf->b_marks_read && get_viminfo_parameter('\'') > 0 && curbuf->b_ffname != NULL) read_viminfo(NULL, VIF_WANT_MARKS); /* Always set b_marks_read; needed when 'viminfo' is changed to include * the ' parameter after opening a buffer. */ curbuf->b_marks_read = TRUE; } #endif #if defined(FEAT_CRYPT) || defined(PROTO) /* * Check for magic number used for encryption. Applies to the current buffer. * 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( char_u *cryptkey, /* previous encryption key or NULL */ char_u *ptr, /* pointer to read bytes */ long *sizep, /* length of read bytes */ off_t *filesizep, /* nr of bytes used from file */ int newfile, /* editing a new buffer */ char_u *fname, /* file name to display */ int *did_ask) /* flag: whether already asked for key */ { int method = crypt_method_nr_from_magic((char *)ptr, *sizep); int b_p_ro = curbuf->b_p_ro; if (method >= 0) { /* Mark the buffer as read-only until the decryption has taken place. * Avoids accidentally overwriting the file with garbage. */ curbuf->b_p_ro = TRUE; /* Set the cryptmethod local to the buffer. */ crypt_set_cm_option(curbuf, method); if (cryptkey == NULL && !*did_ask) { 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. bf needs hash of the key saved. * Don't ask for the key again when first time Enter was hit. * Happens when retrying to detect encoding. */ smsg((char_u *)_(need_key_msg), fname); msg_scroll = TRUE; crypt_check_method(method); cryptkey = crypt_get_key(newfile, FALSE); *did_ask = TRUE; /* check if empty key entered */ if (cryptkey != NULL && *cryptkey == NUL) { if (cryptkey != curbuf->b_p_key) vim_free(cryptkey); cryptkey = NULL; } } } if (cryptkey != NULL) { int header_len; curbuf->b_cryptstate = crypt_create_from_header( method, cryptkey, ptr); crypt_set_cm_option(curbuf, method); /* Remove cryptmethod specific header from the text. */ header_len = crypt_get_header_len(method); *filesizep += header_len; *sizep -= header_len; mch_memmove(ptr, ptr + header_len, (size_t)*sizep); /* Restore the read-only flag. */ curbuf->b_p_ro = b_p_ro; } } /* 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 != NUL && !starting) set_option_value((char_u *)"key", 0L, (char_u *)"", OPT_LOCAL); return cryptkey; } #endif /* FEAT_CRYPT */ #ifdef UNIX static void set_file_time( 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 */ #if defined(VMS) && !defined(MIN) /* Older DECC compiler for VAX doesn't define MIN() */ # define MIN(a, b) ((a) < (b) ? (a) : (b)) #endif /* * Return TRUE if a file appears to be read-only from the file permissions. */ int check_file_readonly( char_u *fname, /* full path to file */ int perm) /* known permissions on file */ { #ifndef USE_MCH_ACCESS int fd = 0; #endif return ( #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 ); } /* * 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. * In case of an error everything possible is done to restore the original * file. But when "forceit" is TRUE, we risk losing it. * * When "reset_changed" is TRUE and "append" == FALSE 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_T *buf, char_u *fname, char_u *sfname, linenr_T start, linenr_T end, exarg_T *eap, /* for forced 'ff' and 'fenc', can be NULL! */ int append, /* append to the file */ 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; int errmsg_allocated = FALSE; 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 #ifdef FEAT_PERSISTENT_UNDO int write_undo_file = FALSE; context_sha256_T sha_ctx; #endif unsigned int bkc = get_bkc_value(buf); if (fname == NULL || *fname == NUL) /* safety check */ return FAIL; if (buf->b_ml.ml_mfp == NULL) { /* This can happen during startup when there is a stray "w" in the * vimrc file. */ EMSG(_(e_emptybuf)); 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_conv_error_lnum = 0; write_info.bw_restlen = 0; # ifdef USE_ICONV write_info.bw_iconv_fd = (iconv_t)-1; # endif #endif #ifdef FEAT_CRYPT write_info.bw_buffer = buf; #endif /* After writing a file changedtick changes but we don't want to display * the line. */ ex_no_reprint = TRUE; /* * 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. * Don't do this when appending. * Only do this when 'cpoptions' contains the 'F' flag. */ if (buf->b_ffname == NULL && reset_changed && whole && buf == curbuf #ifdef FEAT_QUICKFIX && !bt_nofile(buf) #endif && !filtering && (!append || vim_strchr(p_cpo, CPO_FNAMEAPP) != NULL) && vim_strchr(p_cpo, CPO_FNAMEW) != NULL) { if (set_rw_fname(fname, sfname) == FAIL) return FAIL; buf = curbuf; /* just in case autocmds made "buf" invalid */ } 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 typeahead 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; int nofile_err = FALSE; int empty_memline = (buf->b_ml.ml_mfp == NULL); /* * Apply PRE autocommands. * 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))) { #ifdef FEAT_QUICKFIX if (overwriting && bt_nofile(curbuf)) nofile_err = TRUE; else #endif 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) { int was_changed = curbufIsChanged(); did_cmd = apply_autocmds_exarg(EVENT_BUFWRITECMD, sfname, sfname, FALSE, curbuf, eap); if (did_cmd) { if (was_changed && !curbufIsChanged()) { /* Written everything correctly and BufWriteCmd has reset * 'modified': Correct the undo information so that an * undo now sets 'modified'. */ u_unchanged(curbuf); u_update_save_nr(curbuf); } } else { #ifdef FEAT_QUICKFIX if (overwriting && bt_nofile(curbuf)) nofile_err = TRUE; else #endif apply_autocmds_exarg(EVENT_BUFWRITEPRE, sfname, sfname, FALSE, curbuf, eap); } } else { if (!(did_cmd = apply_autocmds_exarg(EVENT_FILEWRITECMD, sfname, sfname, FALSE, curbuf, eap))) { #ifdef FEAT_QUICKFIX if (overwriting && bt_nofile(curbuf)) nofile_err = TRUE; else #endif 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 && !empty_memline) || did_cmd || nofile_err #ifdef FEAT_EVAL || aborting() #endif ) { --no_wait_return; msg_scroll = msg_save; if (nofile_err) EMSG(_("E676: No matching autocommands for acwrite buffer")); if (nofile_err #ifdef FEAT_EVAL || aborting() #endif ) /* 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); if (append) buf->b_flags &= ~BF_NEW; else buf->b_flags &= ~BF_WRITE_MASK; } if (reset_changed && buf->b_changed && !append && (overwriting || vim_strchr(p_cpo, CPO_PLUS) != NULL)) /* 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 (netbeans_active() && 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)) { --no_wait_return; /* may wait for return now */ msg_scroll = msg_save; netbeans_save_buffer(buf); /* no error checking... */ return retval; } else { errnum = (char_u *)"E656: "; errmsg = (char_u *)_("NetBeans disallows 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) st_old.st_dev = 0; 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) { # if defined(MSWIN) /* MS-Windows allows opening a device, but we will probably get stuck * trying to write to it. */ if (!p_odev) { errnum = (char_u *)"E796: "; errmsg = (char_u *)_("writing to device disabled with 'opendevice' option"); goto fail; } # endif 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 = check_file_readonly(fname, (int)perm); 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 & BKC_YES) || append) /* "yes" */ backup_copy = TRUE; #if defined(UNIX) || defined(WIN32) else if ((bkc & 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 # ifndef HAVE_FCHOWN || st.st_uid != st_old.st_uid || st.st_gid != st_old.st_gid # endif ) backup_copy = TRUE; else # else # ifdef WIN32 /* On NTFS file systems hard links are possible. */ if (mch_is_linked(fname)) backup_copy = TRUE; else # endif # 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_lstat((char *)IObuff, &st) < 0) break; } fd = mch_open((char *)IObuff, O_CREAT|O_WRONLY|O_EXCL|O_NOFOLLOW, perm); if (fd < 0) /* can't write in directory */ backup_copy = TRUE; else { # ifdef UNIX # ifdef HAVE_FCHOWN ignored = fchown(fd, st_old.st_uid, st_old.st_gid); # endif if (mch_stat((char *)IObuff, &st) < 0 || st.st_uid != st_old.st_uid || st.st_gid != st_old.st_gid || (long)st.st_mode != perm) backup_copy = TRUE; # endif /* Close the file before removing it, on MS-Windows we * can't delete an open file. */ close(fd); mch_remove(IObuff); # ifdef MSWIN /* MS-Windows may trigger a virus scanner to open the * file, we can't delete it then. Keep trying for half a * second. */ { int try; for (try = 0; try < 10; ++try) { if (mch_lstat((char *)IObuff, &st) < 0) break; ui_delay(50L, TRUE); /* wait 50 msec */ mch_remove(IObuff); } } # endif } } } /* * Break symlinks and/or hardlinks if we've been asked to. */ if ((bkc & BKC_BREAKSYMLINK) || (bkc & BKC_BREAKHARDLINK)) { # ifdef UNIX int lstat_res; lstat_res = mch_lstat((char *)fname, &st); /* Symlinks. */ if ((bkc & BKC_BREAKSYMLINK) && lstat_res == 0 && st.st_ino != st_old.st_ino) backup_copy = FALSE; /* Hardlinks. */ if ((bkc & BKC_BREAKHARDLINK) && st_old.st_nlink > 1 && (lstat_res != 0 || st.st_ino == st_old.st_ino)) backup_copy = FALSE; # else # if defined(WIN32) /* Symlinks. */ if ((bkc & BKC_BREAKSYMLINK) && mch_is_symbolic_link(fname)) backup_copy = FALSE; /* Hardlinks. */ if ((bkc & BKC_BREAKHARDLINK) && mch_is_hard_link(fname)) backup_copy = FALSE; # endif # endif } #endif /* make sure we have a valid backup extension to use */ if (*p_bex == NUL) backup_ext = (char_u *)".bak"; 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; #if defined(UNIX) 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; } #if defined(UNIX) did_set_shortname = FALSE; #endif /* * May try twice if 'shortname' not set. */ for (;;) { /* * Make backup file name. */ backup = buf_modname((buf->b_p_sn || buf->b_shortname), 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 */ /* * 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; 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|O_NOFOLLOW, perm & 0777); 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 # endif ) mch_setperm(backup, (perm & 0707) | ((perm & 07) << 3)); # if defined(HAVE_SELINUX) || defined(HAVE_SMACK) mch_copy_sec(fname, backup); # endif #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 = read_eintr(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 #if defined(HAVE_SELINUX) || defined(HAVE_SMACK) mch_copy_sec(fname, backup); #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((buf->b_p_sn || buf->b_shortname), 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) /* 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, unless 'Z' appears in 'cpoptions'. */ if (forceit && overwriting && vim_strchr(p_cpo, CPO_KEEPRO) == NULL) { 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 && overwriting && !(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 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; /* * Check if the file needs to be converted. */ converted = need_conversion(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', FALSE); 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)) , perm < 0 ? 0666 : (perm & 0777))) < 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 resource fork and the * Finder attribute (label, comments, custom icons, file creator) */ 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 resource fork */ } #endif write_info.bw_fd = fd; #ifdef FEAT_CRYPT if (*buf->b_p_key != NUL && !filtering) { char_u *header; int header_len; buf->b_cryptstate = crypt_create_for_writing(crypt_get_method_nr(buf), buf->b_p_key, &header, &header_len); if (buf->b_cryptstate == NULL || header == NULL) end = 0; else { /* Write magic number, so that Vim knows how this file is * encrypted when reading it back. */ write_info.bw_buf = header; write_info.bw_len = header_len; write_info.bw_flags = FIO_NOCONVERT; if (buf_write_bytes(&write_info) == FAIL) end = 0; wb_flags |= FIO_ENCRYPTED; vim_free(header); } } #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. * Skip it when appending and the file already existed, the BOM only makes * sense at the start of the file. */ if (buf->b_p_bomb && !write_bin && (!append || perm < 0)) { 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; } } write_info.bw_start_lnum = start; #endif #ifdef FEAT_PERSISTENT_UNDO write_undo_file = (buf->b_p_udf && overwriting && !append && !filtering && reset_changed); if (write_undo_file) /* Prepare for computing the hash value of the text. */ sha256_start(&sha_ctx); #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; #ifdef FEAT_PERSISTENT_UNDO if (write_undo_file) sha256_update(&sha_ctx, ptr + 1, (UINT32_T)(STRLEN(ptr + 1) + 1)); #endif 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; #ifdef FEAT_MBYTE write_info.bw_start_lnum = lnum; #endif } /* write failed or last line has no EOL: stop here */ if (end == 0 || (lnum == end && (write_bin || !buf->b_p_fixeol) && (lnum == buf->b_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: VAX/DECC RTL insists that records in some RMS * structures end with a newline (carriage return) character, and if * they don't it adds one. * With other RMS structures it works perfect without this fix. */ if (buf->b_fab_rfm == FAB$C_VFC || ((buf->b_fab_rat & (FAB$M_FTN | FAB$M_CR)) != 0)) { int b2write; buf->b_fab_mrs = (buf->b_fab_mrs == 0 ? MIN(4096, bufsize) : MIN(buf->b_fab_mrs, bufsize)); b2write = len; while (b2write > 0) { write_info.bw_len = MIN(b2write, buf->b_fab_mrs); if (buf_write_bytes(&write_info) == FAIL) { end = 0; break; } b2write -= MIN(b2write, buf->b_fab_mrs); } 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. * For a device do try the fsync() but don't complain if it does not work * (could be a pipe). * If the 'fsync' option is FALSE, don't fsync(). Useful for laptops. */ if (p_fs && fsync(fd) != 0 && !device) { errmsg = (char_u *)_("E667: Fsync failed"); end = 0; } #endif #if defined(HAVE_SELINUX) || defined(HAVE_SMACK) /* Probably need to set the security context. */ if (!backup_copy) mch_copy_sec(backup, wfname); #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) { # ifdef HAVE_FCHOWN 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) { ignored = fchown(fd, st_old.st_uid, st_old.st_gid); if (perm >= 0) /* set permission again, may have changed */ (void)mch_setperm(wfname, perm); } # endif buf_setino(buf); } else if (!buf->b_dev_valid) /* Set the inode when creating a new file. */ buf_setino(buf); #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 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 FEAT_CRYPT if (buf->b_cryptstate != NULL) { crypt_free_state(buf->b_cryptstate); buf->b_cryptstate = NULL; } #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) { if (write_info.bw_conv_error_lnum == 0) errmsg = (char_u *)_("E513: write error, conversion failed (make 'fenc' empty to override)"); else { errmsg_allocated = TRUE; errmsg = alloc(300); vim_snprintf((char *)errmsg, 300, _("E513: write error, conversion failed in line %ld (make 'fenc' empty to override)"), (long)write_info.bw_conv_error_lnum); } } 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 losing 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, perm & 0777)) >= 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 = read_eintr(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; if (write_info.bw_conv_error_lnum != 0) vim_snprintf_add((char *)IObuff, IOSIZE, _(" in line %ld;"), (long)write_info.bw_conv_error_lnum); } 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) { crypt_append_msg(buf); 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), 0); } /* When written everything correctly: reset 'modified'. Unless not * writing to the original file and '+' is not in 'cpoptions'. */ if (reset_changed && whole && !append #ifdef FEAT_MBYTE && !write_info.bw_conv_error #endif && (overwriting || vim_strchr(p_cpo, CPO_PLUS) != NULL) ) { unchanged(buf, TRUE); #ifdef FEAT_AUTOCMD /* buf->b_changedtick is always incremented in unchanged() but that * should not trigger a TextChanged event. */ if (last_changedtick + 1 == buf->b_changedtick && last_changedtick_buf == buf) last_changedtick = buf->b_changedtick; #endif u_unchanged(buf); u_update_save_nr(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); if (append) buf->b_flags &= ~BF_NEW; else 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((buf->b_p_sn || buf->b_shortname), 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 | O_NOFOLLOW, perm < 0 ? 0666 : (perm & 0777))) < 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 ? (int)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) { STRMOVE(IObuff + numlen, IObuff); mch_memmove(IObuff, errnum, (size_t)numlen); } STRCAT(IObuff, errmsg); emsg(IObuff); if (errmsg_allocated) vim_free(errmsg); 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_PERSISTENT_UNDO /* * When writing the whole file and 'undofile' is set, also write the undo * file. */ if (retval == OK && write_undo_file) { char_u hash[UNDO_HASH_SIZE]; sha256_finish(&sha_ctx, hash); u_write_undo(NULL, FALSE, buf, hash); } #endif #ifdef FEAT_AUTOCMD #ifdef FEAT_EVAL if (!should_abort(retval)) #else if (!got_int) #endif { aco_save_T aco; curbuf->b_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; } /* * Set the name of the current buffer. Use when the buffer doesn't have a * name and a ":r" or ":w" command with a file name is used. */ static int set_rw_fname(char_u *fname, char_u *sfname) { #ifdef FEAT_AUTOCMD buf_T *buf = curbuf; /* 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 if (curbuf != buf) { /* We are in another buffer now, don't do the renaming. */ EMSG(_(e_auchangedbuf)); return FAIL; } #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); # ifdef FEAT_EVAL if (aborting()) /* autocmds may abort script processing */ return FAIL; # endif /* Do filetype detection now if 'filetype' is empty. */ if (*curbuf->b_p_ft == NUL) { if (au_has_group((char_u *)"filetypedetect")) (void)do_doautocmd((char_u *)"filetypedetect BufRead", FALSE); do_modelines(0); } #endif return OK; } /* * Put file name into IObuff with quotes. */ void msg_add_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(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. */ void msg_add_lines( int insert_space, long lnum, off_t nchars) { char_u *p; p = IObuff + STRLEN(IObuff); if (insert_space) *p++ = ' '; if (shortmess(SHM_LINES)) sprintf((char *)p, #ifdef LONG_LONG_OFF_T "%ldL, %lldC", lnum, (long long)nchars #else /* Explicit typecast avoids warning on Mac OS X 10.6 */ "%ldL, %ldC", lnum, (long)nchars #endif ); 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, #ifdef LONG_LONG_OFF_T _("%lld characters"), (long long)nchars #else /* Explicit typecast avoids warning on Mac OS X 10.6 */ _("%ld characters"), (long)nchars #endif ); } } /* * Append message for missing line separator to IObuff. */ static void msg_add_eol(void) { 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_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(long t1, long t2) { #if defined(__linux__) || 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. * Handles encryption and 'encoding' conversion. * * Return FAIL for failure, OK otherwise. */ static int buf_write_bytes(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_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_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]; } if (ucs2bytes(c, &p, flags) && !ip->bw_conv_error) { ip->bw_conv_error = TRUE; ip->bw_conv_error_lnum = ip->bw_start_lnum; } if (c == NL) ++ip->bw_start_lnum; } 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 = (int)utf_ptr2len_len(from, (int)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 = (int)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, (int)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, (int)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, (int)(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 = (int)(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, (int)(ip->bw_conv_buflen - fromlen), 0, &bad); if (bad) { ip->bw_conv_error = TRUE; return FAIL; } } } # endif # ifdef MACOS_CONVERT else if (flags & FIO_MACROMAN) { /* * Convert UTF-8 or latin1 to Apple MacRoman. */ 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; } if (enc2macroman(from, fromlen, ip->bw_conv_buf, &len, ip->bw_conv_buflen, ip->bw_rest, &ip->bw_restlen) == FAIL) { ip->bw_conv_error = TRUE; return FAIL; } buf = ip->bw_conv_buf; } # 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) { char *fp; /* 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; fp = (char *)ip->bw_conv_buf + ip->bw_conv_buflen - fromlen; mch_memmove(fp, ip->bw_rest, (size_t)ip->bw_restlen); mch_memmove(fp + ip->bw_restlen, buf, (size_t)len); from = fp; 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. Do it in-place if possible, otherwise use an * allocated buffer. */ if (crypt_works_inplace(ip->bw_buffer->b_cryptstate)) { crypt_encode_inplace(ip->bw_buffer->b_cryptstate, buf, len); } else { char_u *outbuf; len = crypt_encode_alloc(curbuf->b_cryptstate, buf, len, &outbuf); if (len == 0) return OK; /* Crypt layer is buffering, will flush later. */ wlen = write_eintr(ip->bw_fd, outbuf, len); vim_free(outbuf); return (wlen < len) ? FAIL : OK; } } #endif wlen = write_eintr(ip->bw_fd, buf, len); return (wlen < len) ? FAIL : OK; } #ifdef FEAT_MBYTE /* * Convert a Unicode character to bytes. * Return TRUE for an error, FALSE when it's OK. */ static int ucs2bytes( 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 file encoding "fenc" requires conversion from or to * 'encoding'. */ static int need_conversion(char_u *fenc) { int same_encoding; int enc_flags; int fenc_flags; if (*fenc == NUL || STRCMP(p_enc, fenc) == 0) { same_encoding = TRUE; fenc_flags = 0; } else { /* Ignore difference between "ansi" and "latin1", "ucs-4" and * "ucs-4be", etc. */ enc_flags = get_fio_flags(p_enc); fenc_flags = get_fio_flags(fenc); same_encoding = (enc_flags != 0 && fenc_flags == enc_flags); } if (same_encoding) { /* Specified encoding matches with 'encoding'. This requires * conversion when 'encoding' is Unicode but not UTF-8. */ return enc_unicode != 0; } /* Encodings differ. However, conversion is not needed when 'enc' is any * Unicode encoding and the file is UTF-8. */ return !(enc_utf8 && fenc_flags == FIO_UTF8); } /* * 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(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(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(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( 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 == FIO_UTF8 || 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_UCS2 | FIO_ENDIAN_L)) name = "ucs-2le"; /* FF FE */ else if (flags == FIO_ALL || flags == (FIO_UTF16 | FIO_ENDIAN_L)) /* utf-16le is preferred, it also works for ucs-2le text */ name = "utf-16le"; /* FF FE */ } else if (p[0] == 0xfe && p[1] == 0xff && (flags == FIO_ALL || flags == FIO_UCS2 || flags == FIO_UTF16)) { /* Default to utf-16, it works also for ucs-2 text. */ if (flags == FIO_UCS2) name = "ucs-2"; /* FE FF */ else name = "utf-16"; /* 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(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 #if defined(FEAT_VIMINFO) || defined(FEAT_BROWSE) || \ defined(FEAT_QUICKFIX) || defined(FEAT_AUTOCMD) || defined(PROTO) /* * Try to find a shortname by comparing the fullname with the current * directory. * Returns "full_path" or pointer into "full_path" if shortened. */ char_u * shorten_fname1(char_u *full_path) { char_u *dirname; char_u *p = full_path; dirname = alloc(MAXPATHL); if (dirname == NULL) return full_path; if (mch_dirname(dirname, MAXPATHL) == OK) { p = shorten_fname(full_path, dirname); if (p == NULL || *p == NUL) p = full_path; } vim_free(dirname); return p; } #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(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(MSWIN) /* * MSWIN: 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. */ 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(MSWIN) /* * 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(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; } /* Always make the swap file name a full path, a "nofile" buffer may * also have a swap file. */ mf_fullname(buf->b_ml.ml_mfp); } #ifdef FEAT_WINDOWS status_redraw_all(); redraw_tabline = TRUE; #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(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 extension 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( char_u *fname, char_u *ext, int prepend_dot) /* may prepend a '.' to file name */ { return buf_modname((curbuf->b_p_sn || curbuf->b_shortname), fname, ext, prepend_dot); } char_u * buf_modname( int shortname, /* use 8.3 file name */ char_u *fname, char_u *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 (!after_pathsep(retval, retval + fnamelen)) { retval[fnamelen++] = PATHSEP; retval[fnamelen] = NUL; } prepend_dot = FALSE; /* nothing to prepend a dot to */ } 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; mb_ptr_back(retval, ptr)) { if (*ext == '.' #ifdef USE_LONG_FNAME && (!USE_LONG_FNAME || shortname) #else && shortname #endif ) if (*ptr == '.') /* replace '.' by '_' */ *ptr = '_'; if (vim_ispathsep(*ptr)) { ++ptr; break; } } /* the file name has at most BASENAMELEN characters. */ if (STRLEN(ptr) > (unsigned)BASENAMELEN) ptr[BASENAMELEN] = '\0'; 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 if (shortname) #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])) { if (*ext == '.') *s++ = '_'; } /* * If the extension starts with '.', truncate the base name at 8 * characters */ else if (*ext == '.') { if ((size_t)(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 '.' */ else if ((e = vim_strchr(ptr, '.')) == NULL) *s++ = '.'; /* * If the extension doesn't start with '.', and there already is an * extension, it may need to be truncated */ else if ((int)STRLEN(e) + extlen > 4) s = e + 4 - extlen; } #if 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 extension. * ext can start with '.' and cannot exceed 3 more characters. */ STRCPY(s, ext); /* * Prepend the dot. */ if (prepend_dot && !shortname && *(e = gettail(retval)) != '.' #ifdef USE_LONG_FNAME && USE_LONG_FNAME #endif ) { STRMOVE(e + 1, e); *e = '.'; } /* * 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 "________.", 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(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 ignoredp = fgets_cr((char *)tbuf, FGETS_SIZE, fp); #else ignoredp = 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(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(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; long perm; #ifdef HAVE_ACL vim_acl_T acl; /* ACL from original file */ #endif int use_tmp_file = FALSE; /* * When the names are identical, there is nothing to do. When they refer * to the same file (ignoring case and slash/backslash differences) but * the file name differs we need to go through a temp file. */ if (fnamecmp(from, to) == 0) { if (p_fic && STRCMP(gettail(from), gettail(to)) != 0) use_tmp_file = TRUE; else return 0; } /* * Fail if the "from" file doesn't exist. Avoids that "to" is deleted. */ if (mch_stat((char *)from, &st) < 0) return -1; #ifdef UNIX { struct stat st_to; /* It's possible for the source and destination to be the same file. * This happens when "from" and "to" differ in case and are on a FAT32 * filesystem. In that case go through a temp file name. */ if (mch_stat((char *)to, &st_to) >= 0 && st.st_dev == st_to.st_dev && st.st_ino == st_to.st_ino) use_tmp_file = TRUE; } #endif #ifdef WIN3264 { BY_HANDLE_FILE_INFORMATION info1, info2; /* It's possible for the source and destination to be the same file. * In that case go through a temp file name. This makes rename("foo", * "./foo") a no-op (in a complicated way). */ if (win32_fileinfo(from, &info1) == FILEINFO_OK && win32_fileinfo(to, &info2) == FILEINFO_OK && info1.dwVolumeSerialNumber == info2.dwVolumeSerialNumber && info1.nFileIndexHigh == info2.nFileIndexHigh && info1.nFileIndexLow == info2.nFileIndexLow) use_tmp_file = TRUE; } #endif if (use_tmp_file) { char tempname[MAXPATHL + 1]; /* * Find a name that doesn't exist and is in the same directory. * Rename "from" to "tempname" and then rename "tempname" to "to". */ if (STRLEN(from) >= MAXPATHL - 5) return -1; STRCPY(tempname, from); for (n = 123; n < 99999; ++n) { sprintf((char *)gettail((char_u *)tempname), "%d", n); if (mch_stat(tempname, &st) < 0) { if (mch_rename((char *)from, tempname) == 0) { if (mch_rename(tempname, (char *)to) == 0) return 0; /* Strange, the second step failed. Try moving the * file back and return failure. */ mch_rename(tempname, (char *)from); return -1; } /* If it fails for one temp name it will most likely fail * for any temp name, give up. */ return -1; } } 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 accidentally * 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. */ perm = mch_getperm(from); #ifdef HAVE_ACL /* For systems that support ACL: get the ACL from the original file. */ acl = mch_get_acl(from); #endif fd_in = mch_open((char *)from, O_RDONLY|O_EXTRA, 0); if (fd_in == -1) { #ifdef HAVE_ACL mch_free_acl(acl); #endif return -1; } /* Create the new file with same permissions as the original. */ fd_out = mch_open((char *)to, O_CREAT|O_EXCL|O_WRONLY|O_EXTRA|O_NOFOLLOW, (int)perm); if (fd_out == -1) { close(fd_in); #ifdef HAVE_ACL mch_free_acl(acl); #endif return -1; } buffer = (char *)alloc(BUFSIZE); if (buffer == NULL) { close(fd_out); close(fd_in); #ifdef HAVE_ACL mch_free_acl(acl); #endif return -1; } while ((n = read_eintr(fd_in, buffer, BUFSIZE)) > 0) if (write_eintr(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; } #ifndef UNIX /* for Unix mch_open() already set the permission */ mch_setperm(to, perm); #endif #ifdef HAVE_ACL mch_set_acl(to, acl); mch_free_acl(acl); #endif #if defined(HAVE_SELINUX) || defined(HAVE_SMACK) mch_copy_sec(from, to); #endif 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( 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 || curbuf_lock > 0 || allbuf_lock > 0 #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(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; for (lnum = curbuf->b_ml.ml_line_count; lnum > 0; --lnum) if (ml_delete(lnum, 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. */ int buf_check_timestamp( buf_T *buf, int focus UNUSED) /* 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 off_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; int n; char_u *s; #endif char *reason; /* 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 #ifdef FEAT_NETBEANS_INTG || isNetbeansBuffer(buf) #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) || st.st_size != buf->b_orig_size #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 (e.g., when executing * FileChangedShell autocmd) */ 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 { if (stat_res < 0) reason = "deleted"; else if (bufIsChanged(buf)) reason = "conflict"; else if (orig_size != buf->b_orig_size || buf_contents_changed(buf)) reason = "changed"; else if (orig_mode != buf->b_orig_mode) reason = "mode"; else reason = "time"; #ifdef FEAT_AUTOCMD /* * Only give the warning if there are no FileChangedShell * autocommands. * Avoid being called recursively by setting "busy". */ busy = TRUE; # ifdef FEAT_EVAL set_vim_var_string(VV_FCS_REASON, (char_u *)reason, -1); set_vim_var_string(VV_FCS_CHOICE, (char_u *)"", -1); # endif ++allbuf_lock; n = apply_autocmds(EVENT_FILECHANGEDSHELL, buf->b_fname, buf->b_fname, FALSE, buf); --allbuf_lock; busy = FALSE; if (n) { if (!buf_valid(buf)) EMSG(_("E246: FileChangedShell autocommand deleted buffer")); # ifdef FEAT_EVAL s = get_vim_var_str(VV_FCS_CHOICE); if (STRCMP(s, "reload") == 0 && *reason != 'd') reload = TRUE; else if (STRCMP(s, "ask") == 0) n = FALSE; else # endif return 2; } if (!n) #endif { if (*reason == 'd') mesg = _("E211: 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 (reason[2] == 'n') { mesg = _("W12: Warning: File \"%s\" has changed and the buffer was changed in Vim as well"); mesg2 = _("See \":help W12\" for more info."); } else if (reason[1] == 'h') { mesg = _("W11: Warning: File \"%s\" has changed since editing started"); mesg2 = _("See \":help W11\" for more info."); } else if (*reason == 'm') { mesg = _("W16: Warning: Mode of file \"%s\" has changed since editing started"); mesg2 = _("See \":help W16\" for more info."); } else /* Only timestamp changed, store it to avoid a warning * in check_mtime() later. */ buf->b_mtime_read = buf->b_mtime; } } } } 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 = ""; tbuf = alloc((unsigned)(STRLEN(path) + STRLEN(mesg) + STRLEN(mesg2) + 2)); sprintf((char *)tbuf, mesg, path); #ifdef FEAT_EVAL /* Set warningmsg here, before the unimportant and output-specific * mesg2 has been appended. */ set_vim_var_string(VV_WARNINGMSG, tbuf, -1); #endif #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, TRUE) == 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 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; } vim_free(path); vim_free(tbuf); } } if (reload) { /* Reload the buffer. */ buf_reload(buf, orig_mode); #ifdef FEAT_PERSISTENT_UNDO if (buf->b_p_udf && buf->b_ffname != NULL) { char_u hash[UNDO_HASH_SIZE]; buf_T *save_curbuf = curbuf; /* Any existing undo file is unusable, write it now. */ curbuf = buf; u_compute_hash(hash); u_write_undo(NULL, FALSE, buf, hash); curbuf = save_curbuf; } #endif } #ifdef FEAT_AUTOCMD /* Trigger FileChangedShell when the file was changed in any way. */ if (buf_valid(buf) && retval != 0) (void)apply_autocmds(EVENT_FILECHANGEDSHELLPOST, buf->b_fname, buf->b_fname, FALSE, buf); #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; } /* * Reload a buffer that is already loaded. * Used when the file was changed outside of Vim. * "orig_mode" is buf->b_orig_mode before the need for reloading was detected. * buf->b_orig_mode may have been reset already. */ void buf_reload(buf_T *buf, int orig_mode) { exarg_T ea; pos_T old_cursor; linenr_T old_topline; int old_ro = buf->b_p_ro; buf_T *savebuf; int saved = OK; aco_save_T aco; int flags = READ_NEW; /* set curwin/curbuf for "buf" and save some things */ aucmd_prepbuf(&aco, buf); /* 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; if (p_ur < 0 || curbuf->b_ml.ml_line_count <= p_ur) { /* Save all the text, so that the reload can be undone. * Sync first so that this is a separate undo-able action. */ u_sync(FALSE); saved = u_savecommon(0, curbuf->b_ml.ml_line_count + 1, 0, TRUE); flags |= READ_KEEP_UNDO; } /* * 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() || saved == FAIL) 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 && buf == curbuf) { /* Open the memline. */ curbuf = savebuf; curwin->w_buffer = savebuf; saved = ml_open(curbuf); curbuf = buf; curwin->w_buffer = buf; } if (savebuf == NULL || saved == FAIL || buf != curbuf || 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, flags) == FAIL) { #if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL) if (!aborting()) #endif EMSG2(_("E321: Could not reload \"%s\""), buf->b_fname); if (savebuf != NULL && buf_valid(savebuf) && buf == curbuf) { /* Put the text back from the save buffer. First * delete any lines that readfile() added. */ while (!bufempty()) if (ml_delete(buf->b_ml.ml_line_count, FALSE) == FAIL) break; (void)move_lines(savebuf, buf); } } else if (buf == curbuf) /* "buf" still valid */ { /* Mark the buffer as unmodified and free undo info. */ unchanged(buf, TRUE); if ((flags & READ_KEEP_UNDO) == 0) { u_blockfree(buf); u_clearall(buf); } else { /* Mark all undo states as changed. */ u_unchanged(curbuf); } } } vim_free(ea.cmd); if (savebuf != NULL && buf_valid(savebuf)) wipe_buffer(savebuf, FALSE); #ifdef FEAT_DIFF /* Invalidate diff info if necessary. */ diff_invalidate(curbuf); #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; tabpage_T *tp; /* Update folds unless they are defined manually. */ FOR_ALL_TAB_WINDOWS(tp, 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; /* Modelines must override settings done by autocommands. */ do_modelines(0); } /* restore curwin/curbuf and a few other things */ aucmd_restbuf(&aco); /* Careful: autocommands may have made "buf" invalid! */ } void buf_store_time(buf_T *buf, struct stat *st, char_u *fname UNUSED) { buf->b_mtime = (long)st->st_mtime; buf->b_orig_size = 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(linenr_T offset) { if (curbuf->b_no_eol_lnum != 0) /* only if there is a missing eol */ curbuf->b_no_eol_lnum += offset; } #if defined(TEMPDIRNAMES) || defined(FEAT_EVAL) || defined(PROTO) /* * Delete "name" and everything in it, recursively. * return 0 for succes, -1 if some file was not deleted. */ int delete_recursive(char_u *name) { int result = 0; char_u **files; int file_count; int i; char_u *exp; /* A symbolic link to a directory itself is deleted, not the directory it * points to. */ if ( # if defined(UNIX) || defined(WIN32) mch_isrealdir(name) # else mch_isdir(name) # endif ) { vim_snprintf((char *)NameBuff, MAXPATHL, "%s/*", name); exp = vim_strsave(NameBuff); if (exp == NULL) return -1; if (gen_expand_wildcards(1, &exp, &file_count, &files, EW_DIR|EW_FILE|EW_SILENT|EW_ALLLINKS|EW_DODOT|EW_EMPTYOK) == OK) { for (i = 0; i < file_count; ++i) if (delete_recursive(files[i]) != 0) result = -1; FreeWild(file_count, files); } else result = -1; vim_free(exp); (void)mch_rmdir(name); } else result = mch_remove(name) == 0 ? 0 : -1; return result; } #endif #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(void) { if (vim_tempdir != NULL) { /* remove the trailing path separator */ gettail(vim_tempdir)[-1] = NUL; delete_recursive(vim_tempdir); vim_free(vim_tempdir); vim_tempdir = NULL; } } /* * Directory "tempdir" was created. Expand this name to a full path and put * it in "vim_tempdir". This avoids that using ":cd" would confuse us. * "tempdir" must be no longer than MAXPATHL. */ static void vim_settempdir(char_u *tempdir) { char_u *buf; buf = alloc((unsigned)MAXPATHL + 2); if (buf != NULL) { if (vim_FullName(tempdir, buf, MAXPATHL, FALSE) == FAIL) STRCPY(buf, tempdir); # ifdef __EMX__ if (vim_strchr(buf, '/') != NULL) STRCAT(buf, "/"); else # endif add_pathsep(buf); vim_tempdir = vim_strsave(buf); vim_free(buf); } } #endif /* * vim_tempname(): Return a unique name that can be used for a temp file. * * The temp file is NOT garanteed to be created. If "keep" is FALSE it is * garanteed to NOT be created. * * The returned pointer is to allocated memory. * The returned pointer is NULL if no valid name was found. */ char_u * vim_tempname( int extra_char UNUSED, /* char to use in the name instead of '?' */ int keep UNUSED) { #ifdef USE_TMPNAM char_u itmp[L_tmpnam]; /* use tmpnam() */ #else char_u itmp[TEMPNAMELEN]; #endif #ifdef TEMPDIRNAMES static char *(tempdirs[]) = {TEMPDIRNAMES}; int i; # 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 < (int)(sizeof(tempdirs) / sizeof(char *)); ++i) { # ifndef HAVE_MKDTEMP size_t itmplen; long nr; long off; # endif /* Expand $TMP, leave room for "/v1100000/999999999". * Skip the directory check if the expansion fails. */ expand_env((char_u *)tempdirs[i], itmp, TEMPNAMELEN - 20); if (itmp[0] != '$' && 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); # ifdef HAVE_MKDTEMP /* Leave room for filename */ STRCAT(itmp, "vXXXXXX"); if (mkdtemp((char *)itmp) != NULL) vim_settempdir(itmp); # else /* 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; itmplen = STRLEN(itmp); /* 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 + itmplen, "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) { vim_settempdir(itmp); 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; } # endif /* HAVE_MKDTEMP */ 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] = '.'; /* GetTempPath() failed, use current dir */ szTempFile[1] = NUL; } strcpy(buf4, "VIM"); buf4[2] = extra_char; /* make it "VIa", "VIb", etc. */ if (GetTempFileName(szTempFile, buf4, 0, (LPSTR)itmp) == 0) return NULL; if (!keep) /* GetTempFileName() will create the file, we don't want that */ (void)DeleteFile((LPSTR)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 char_u *p; /* tmpnam() will make its own name */ p = tmpnam((char *)itmp); if (p == NULL || *p == 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 '.LIS' 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, unless when * it looks like a URL. */ void forward_slash(char_u *fname) { char_u *p; if (path_with_url(fname)) return; for (p = fname; *p != NUL; ++p) # ifdef FEAT_MBYTE /* The Big5 encoding can have '\' in the trail byte. */ if (enc_dbcs != 0 && (*mb_ptr2len)(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 { char_u *pat; /* pattern as typed (NULL when pattern has been removed) */ regprog_T *reg_prog; /* compiled regprog for pattern */ AutoCmd *cmds; /* list of commands to do */ struct AutoPat *next; /* next AutoPat in AutoPat list */ int group; /* group ID */ int patlen; /* strlen() of pat */ int buflocal_nr; /* !=0 for buffer-local AutoPat */ char allow_dirs; /* Pattern may match whole path */ char last; /* last pattern for apply_autocmds() */ } 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}, {"CmdUndefined", EVENT_CMDUNDEFINED}, {"ColorScheme", EVENT_COLORSCHEME}, {"CompleteDone", EVENT_COMPLETEDONE}, {"CursorHold", EVENT_CURSORHOLD}, {"CursorHoldI", EVENT_CURSORHOLDI}, {"CursorMoved", EVENT_CURSORMOVED}, {"CursorMovedI", EVENT_CURSORMOVEDI}, {"EncodingChanged", EVENT_ENCODINGCHANGED}, {"FileEncoding", EVENT_ENCODINGCHANGED}, {"FileAppendPost", EVENT_FILEAPPENDPOST}, {"FileAppendPre", EVENT_FILEAPPENDPRE}, {"FileAppendCmd", EVENT_FILEAPPENDCMD}, {"FileChangedShell",EVENT_FILECHANGEDSHELL}, {"FileChangedShellPost",EVENT_FILECHANGEDSHELLPOST}, {"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}, {"GUIFailed", EVENT_GUIFAILED}, {"InsertChange", EVENT_INSERTCHANGE}, {"InsertEnter", EVENT_INSERTENTER}, {"InsertLeave", EVENT_INSERTLEAVE}, {"InsertCharPre", EVENT_INSERTCHARPRE}, {"MenuPopup", EVENT_MENUPOPUP}, {"OptionSet", EVENT_OPTIONSET}, {"QuickFixCmdPost", EVENT_QUICKFIXCMDPOST}, {"QuickFixCmdPre", EVENT_QUICKFIXCMDPRE}, {"QuitPre", EVENT_QUITPRE}, {"RemoteReply", EVENT_REMOTEREPLY}, {"SessionLoadPost", EVENT_SESSIONLOADPOST}, {"ShellCmdPost", EVENT_SHELLCMDPOST}, {"ShellFilterPost", EVENT_SHELLFILTERPOST}, {"SourcePre", EVENT_SOURCEPRE}, {"SourceCmd", EVENT_SOURCECMD}, {"SpellFileMissing",EVENT_SPELLFILEMISSING}, {"StdinReadPost", EVENT_STDINREADPOST}, {"StdinReadPre", EVENT_STDINREADPRE}, {"SwapExists", EVENT_SWAPEXISTS}, {"Syntax", EVENT_SYNTAX}, {"TabEnter", EVENT_TABENTER}, {"TabLeave", EVENT_TABLEAVE}, {"TermChanged", EVENT_TERMCHANGED}, {"TermResponse", EVENT_TERMRESPONSE}, {"TextChanged", EVENT_TEXTCHANGED}, {"TextChangedI", EVENT_TEXTCHANGEDI}, {"User", EVENT_USER}, {"VimEnter", EVENT_VIMENTER}, {"VimLeave", EVENT_VIMLEAVE}, {"VimLeavePre", EVENT_VIMLEAVEPRE}, {"WinEnter", EVENT_WINENTER}, {"WinLeave", EVENT_WINLEAVE}, {"VimResized", EVENT_VIMRESIZED}, {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, 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 */ int arg_bufnr; /* initially equal to , set to zero when buf is deleted */ struct AutoPatCmd *next; /* chain of active apc-s for auto-invalidation*/ } AutoPatCmd; static AutoPatCmd *active_apc_list = NULL; /* stack of active autocommands */ /* * augroups stores a list of autocmd group names. */ static 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. */ static int current_augroup = AUGROUP_DEFAULT; static int au_need_clean = FALSE; /* need to delete marked patterns */ static void show_autocmd(AutoPat *ap, event_T event); static void au_remove_pat(AutoPat *ap); static void au_remove_cmds(AutoPat *ap); static void au_cleanup(void); static int au_new_group(char_u *name); static void au_del_group(char_u *name); static event_T event_name2nr(char_u *start, char_u **end); static char_u *event_nr2name(event_T event); static char_u *find_end_event(char_u *arg, int have_group); static int event_ignored(event_T event); static int au_get_grouparg(char_u **argp); static int do_autocmd_event(event_T event, char_u *pat, int nested, char_u *cmd, int forceit, int group); static int apply_autocmds_group(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(AutoPatCmd *apc, int stop_at_last); #if defined(FEAT_AUTOCMD) || defined(FEAT_WILDIGN) static int match_file_pat(char_u *pattern, regprog_T **prog, char_u *fname, char_u *sfname, char_u *tail, int allow_dirs); #endif static event_T last_event; static int last_group; static int autocmd_blocked = 0; /* block all autocmds */ /* * Show the autocommands for one AutoPat. */ static void show_autocmd(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); #ifdef FEAT_EVAL if (p_verbose > 0) last_set_msg(ac->scriptID); #endif 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(AutoPat *ap) { vim_free(ap->pat); ap->pat = NULL; ap->buflocal_nr = -1; au_need_clean = TRUE; } /* * Mark all commands for a pattern for deletion. */ static void au_remove_cmds(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(void) { 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_regfree(ap->reg_prog); vim_free(ap); } else prev_ap = &(ap->next); } } au_need_clean = FALSE; } /* * Called when buffer is freed, to remove/invalidate related buffer-local * autocmds. */ void aubuflocal_remove(buf_T *buf) { AutoPat *ap; event_T event; AutoPatCmd *apc; /* invalidate currently executing autocommands */ for (apc = active_apc_list; apc; apc = apc->next) if (buf->b_fnum == apc->arg_bufnr) apc->arg_bufnr = 0; /* invalidate buflocals looping through events */ for (event = (event_T)0; (int)event < (int)NUM_EVENTS; event = (event_T)((int)event + 1)) /* loop over all autocommand patterns */ for (ap = first_autopat[(int)event]; ap != NULL; ap = ap->next) if (ap->buflocal_nr == buf->b_fnum) { au_remove_pat(ap); if (p_verbose >= 6) { verbose_enter(); smsg((char_u *) _("auto-removing autocommand: %s "), event_nr2name(event), buf->b_fnum); verbose_leave(); } } au_cleanup(); } /* * Add an autocmd group name. * Return it's ID. Returns AUGROUP_ERROR (< 0) for error. */ static int au_new_group(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; } return i; } static void au_del_group(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(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; } /* * Return TRUE if augroup "name" exists. */ int au_has_group(char_u *name) { return au_find_group(name) != AUGROUP_ERROR; } /* * ":augroup {name}". */ void do_augroup(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(); } } #if defined(EXITFREE) || defined(PROTO) void free_all_autocmds(void) { for (current_augroup = -1; current_augroup < augroups.ga_len; ++current_augroup) do_autocmd((char_u *)"", TRUE); ga_clear_strings(&augroups); } #endif /* * 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(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_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( 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_T event) { char_u *p = p_ei; while (*p != NUL) { if (STRNICMP(p, "all", 3) == 0 && (p[3] == NUL || p[3] == ',')) return TRUE; 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(void) { char_u *p = p_ei; while (*p) { if (STRNICMP(p, "all", 3) == 0 && (p[3] == NUL || p[3] == ',')) { p += 3; if (*p == ',') ++p; } else if (event_name2nr(p, &p) == NUM_EVENTS) return FAIL; } return OK; } # if defined(FEAT_SYN_HL) || defined(PROTO) /* * Add "what" to 'eventignore' to skip loading syntax highlighting for every * buffer loaded into the window. "what" must start with a comma. * Returns the old value of 'eventignore' in allocated memory. */ char_u * au_event_disable(char *what) { char_u *new_ei; char_u *save_ei; save_ei = vim_strsave(p_ei); if (save_ei != NULL) { new_ei = vim_strnsave(p_ei, (int)(STRLEN(p_ei) + STRLEN(what))); if (new_ei != NULL) { if (*what == ',' && *p_ei == NUL) STRCPY(new_ei, what + 1); else STRCAT(new_ei, what); set_string_option_direct((char_u *)"ei", -1, new_ei, OPT_FREE, SID_NONE); vim_free(new_ei); } } return save_ei; } void au_event_restore(char_u *old_ei) { if (old_ei != NULL) { set_string_option_direct((char_u *)"ei", -1, old_ei, OPT_FREE, SID_NONE); vim_free(old_ei); } } # endif /* FEAT_SYN_HL */ /* * do_autocmd() -- implements the :autocmd command. Can be used in the * following ways: * * :autocmd Add to the list of commands that * will be automatically executed for * when editing a file matching , in * the current group. * :autocmd Show the auto-commands associated with * and . * :autocmd Show the auto-commands associated with * . * :autocmd Show all auto-commands. * :autocmd! Remove all auto-commands associated with * and , and add the command * , for the current group. * :autocmd! Remove all auto-commands associated with * and for the current group. * :autocmd! Remove all auto-commands associated with * 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. * * Mostly a {group} argument can optionally appear before . */ void do_autocmd(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 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(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_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; int is_buflocal; int buflocal_nr; char_u buflocal_pat[25]; /* for "" */ 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 > pat && endpat[-1] == '\\')); ++endpat) { if (*endpat == '{') brace_level++; else if (*endpat == '}') brace_level--; } if (pat == endpat) /* ignore single comma */ continue; patlen = (int)(endpat - pat); /* * detect special buffer-local patterns */ is_buflocal = FALSE; buflocal_nr = 0; if (patlen >= 8 && STRNCMP(pat, "') { /* "": Error will be printed only for addition. * printing and removing will proceed silently. */ is_buflocal = TRUE; if (patlen == 8) /* "" */ buflocal_nr = curbuf->b_fnum; else if (patlen > 9 && pat[7] == '=') { if (patlen == 13 && STRNICMP(pat, "", 13) == 0) /* "" */ buflocal_nr = autocmd_bufnr; else if (skipdigits(pat + 8) == pat + patlen - 1) /* "" */ buflocal_nr = atoi((char *)pat + 8); } } if (is_buflocal) { /* normalize pat into standard "#N" form */ sprintf((char *)buflocal_pat, "", buflocal_nr); pat = buflocal_pat; /* can modify pat and patlen */ patlen = (int)STRLEN(buflocal_pat); /* but not endpat */ } /* * 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. * For , this condition works because we normalize * all buffer-local patterns. */ 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, or buflocals */ 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) { /* refuse to add buffer-local ap if buffer number is invalid */ if (is_buflocal && (buflocal_nr == 0 || buflist_findnr(buflocal_nr) == NULL)) { EMSGN(_("E680: : invalid buffer number "), buflocal_nr); return FAIL; } 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; } if (is_buflocal) { ap->buflocal_nr = buflocal_nr; ap->reg_prog = NULL; } else { char_u *reg_pat; ap->buflocal_nr = 0; reg_pat = file_pat_to_reg_pat(pat, endpat, &ap->allow_dirs, TRUE); if (reg_pat != NULL) ap->reg_prog = vim_regcomp(reg_pat, RE_MAGIC); vim_free(reg_pat); if (reg_pat == NULL || ap->reg_prog == 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( 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(exarg_T *eap) { int retval; aco_save_T aco; buf_T *buf; char_u *arg = eap->arg; int call_do_modelines = check_nomodeline(&arg); /* * 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 (buf->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(arg, FALSE); if (call_do_modelines) { /* Execute the modeline settings, but don't set window-local * options if we are using the current window for another * buffer. */ do_modelines(curwin == aucmd_win ? OPT_NOWIN : 0); } /* 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 */ } /* * Check *argp for . When it is present return FALSE, otherwise * return TRUE and advance *argp to after it. * Thus return TRUE when do_modelines() should be called. */ int check_nomodeline(char_u **argp) { if (STRNCMP(*argp, "", 12) == 0) { *argp = skipwhite(*argp + 12); return FALSE; } return TRUE; } /* * Prepare for executing autocommands for (hidden) buffer "buf". * Search for a visible window containing the current buffer. If there isn't * one then use "aucmd_win". * Set "curbuf" and "curwin" to match "buf". * When FEAT_AUTOCMD is not defined another version is used, see below. */ void aucmd_prepbuf( aco_save_T *aco, /* structure to save values in */ buf_T *buf) /* new curbuf */ { win_T *win; #ifdef FEAT_WINDOWS int save_ea; #endif #ifdef FEAT_AUTOCHDIR int save_acd; #endif /* 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 /* Allocate "aucmd_win" when needed. If this fails (out of memory) fall * back to using the current window. */ if (win == NULL && aucmd_win == NULL) { win_alloc_aucmd_win(); if (aucmd_win == NULL) win = curwin; } if (win == NULL && aucmd_win_used) /* Strange recursive autocommand, fall back to using the current * window. Expect a few side effects... */ win = curwin; aco->save_curwin = curwin; aco->save_curbuf = curbuf; if (win != NULL) { /* There is a window for "buf" in the current tab page, make it the * curwin. This is preferred, it has the least side effects (esp. if * "buf" is curbuf). */ aco->use_aucmd_win = FALSE; curwin = win; } else { /* There is no window for "buf", use "aucmd_win". To minimize the side * effects, insert it in the current tab page. * Anything related to a window (e.g., setting folds) may have * unexpected results. */ aco->use_aucmd_win = TRUE; aucmd_win_used = TRUE; aucmd_win->w_buffer = buf; aucmd_win->w_s = &buf->b_s; ++buf->b_nwindows; win_init_empty(aucmd_win); /* set cursor and topline to safe values */ /* Make sure w_localdir and globaldir are NULL to avoid a chdir() in * win_enter_ext(). */ vim_free(aucmd_win->w_localdir); aucmd_win->w_localdir = NULL; aco->globaldir = globaldir; globaldir = NULL; #ifdef FEAT_WINDOWS /* Split the current window, put the aucmd_win in the upper half. * We don't want the BufEnter or WinEnter autocommands. */ block_autocmds(); make_snapshot(SNAP_AUCMD_IDX); save_ea = p_ea; p_ea = FALSE; # ifdef FEAT_AUTOCHDIR /* Prevent chdir() call in win_enter_ext(), through do_autochdir(). */ save_acd = p_acd; p_acd = FALSE; # endif (void)win_split_ins(0, WSP_TOP, aucmd_win, 0); (void)win_comp_pos(); /* recompute window positions */ p_ea = save_ea; # ifdef FEAT_AUTOCHDIR p_acd = save_acd; # endif unblock_autocmds(); #endif curwin = aucmd_win; } curbuf = buf; aco->new_curwin = curwin; aco->new_curbuf = curbuf; } /* * Cleanup after executing autocommands for a (hidden) buffer. * Restore the window as it was (if possible). * When FEAT_AUTOCMD is not defined another version is used, see below. */ void aucmd_restbuf( aco_save_T *aco) /* structure holding saved values */ { #ifdef FEAT_WINDOWS int dummy; #endif if (aco->use_aucmd_win) { --curbuf->b_nwindows; #ifdef FEAT_WINDOWS /* Find "aucmd_win", it can't be closed, but it may be in another tab * page. Do not trigger autocommands here. */ block_autocmds(); if (curwin != aucmd_win) { tabpage_T *tp; win_T *wp; FOR_ALL_TAB_WINDOWS(tp, wp) { if (wp == aucmd_win) { if (tp != curtab) goto_tabpage_tp(tp, TRUE, TRUE); win_goto(aucmd_win); goto win_found; } } } win_found: /* Remove the window and frame from the tree of frames. */ (void)winframe_remove(curwin, &dummy, NULL); win_remove(curwin, NULL); aucmd_win_used = FALSE; last_status(FALSE); /* may need to remove last status line */ restore_snapshot(SNAP_AUCMD_IDX, FALSE); (void)win_comp_pos(); /* recompute window positions */ unblock_autocmds(); if (win_valid(aco->save_curwin)) curwin = aco->save_curwin; else /* Hmm, original window disappeared. Just use the first one. */ curwin = firstwin; # ifdef FEAT_EVAL vars_clear(&aucmd_win->w_vars->dv_hashtab); /* free all w: variables */ hash_init(&aucmd_win->w_vars->dv_hashtab); /* re-use the hashtab */ # endif #else curwin = aco->save_curwin; #endif curbuf = curwin->w_buffer; vim_free(globaldir); globaldir = aco->globaldir; /* the buffer contents may have changed */ check_cursor(); if (curwin->w_topline > curbuf->b_ml.ml_line_count) { curwin->w_topline = curbuf->b_ml.ml_line_count; #ifdef FEAT_DIFF curwin->w_topfill = 0; #endif } #if defined(FEAT_GUI) /* Hide the scrollbars from the aucmd_win and update. */ gui_mch_enable_scrollbar(&aucmd_win->w_scrollbars[SBAR_LEFT], FALSE); gui_mch_enable_scrollbar(&aucmd_win->w_scrollbars[SBAR_RIGHT], FALSE); gui_may_update_scrollbars(); #endif } else { /* restore curwin */ #ifdef FEAT_WINDOWS if (win_valid(aco->save_curwin)) #endif { /* Restore the buffer which was previously edited by curwin, if * it was changed, we are still the same window and the buffer is * valid. */ if (curwin == aco->new_curwin && curbuf != aco->new_curbuf && buf_valid(aco->new_curbuf) && aco->new_curbuf->b_ml.ml_mfp != NULL) { # if defined(FEAT_SYN_HL) || defined(FEAT_SPELL) if (curwin->w_s == &curbuf->b_s) curwin->w_s = &aco->new_curbuf->b_s; # endif --curbuf->b_nwindows; curbuf = aco->new_curbuf; curwin->w_buffer = curbuf; ++curbuf->b_nwindows; } curwin = aco->save_curwin; curbuf = curwin->w_buffer; /* In case the autocommand move the cursor to a position that that * not exist in curbuf. */ check_cursor(); } } } static int autocmd_nested = FALSE; /* * Execute autocommands for "event" and file name "fname". * Return TRUE if some commands were executed. */ int apply_autocmds( event_T event, char_u *fname, /* NULL or empty means use actual file name */ char_u *fname_io, /* fname to use for on cmdline */ int force, /* when TRUE, ignore autocmd_busy */ buf_T *buf) /* buffer for */ { 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_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_T event, char_u *fname, /* NULL or empty means use actual file name */ char_u *fname_io, /* fname to use for on cmdline */ int force, /* when TRUE, ignore autocmd_busy */ buf_T *buf, /* buffer for */ int *retval) /* pointer to caller's retval */ { int did_cmd; #ifdef FEAT_EVAL if (should_abort(*retval)) return FALSE; #endif did_cmd = apply_autocmds_group(event, fname, fname_io, force, AUGROUP_ALL, buf, NULL); if (did_cmd #ifdef FEAT_EVAL && aborting() #endif ) *retval = FAIL; return did_cmd; } /* * Return TRUE when there is a CursorHold autocommand defined. */ int has_cursorhold(void) { return (first_autopat[(int)(get_real_state() == NORMAL_BUSY ? EVENT_CURSORHOLD : EVENT_CURSORHOLDI)] != NULL); } /* * Return TRUE if the CursorHold event can be triggered. */ int trigger_cursorhold(void) { int state; if (!did_cursorhold && has_cursorhold() && !Recording && typebuf.tb_len == 0 #ifdef FEAT_INS_EXPAND && !ins_compl_active() #endif ) { state = get_real_state(); if (state == NORMAL_BUSY || (state & INSERT) != 0) return TRUE; } return FALSE; } /* * Return TRUE when there is a CursorMoved autocommand defined. */ int has_cursormoved(void) { return (first_autopat[(int)EVENT_CURSORMOVED] != NULL); } /* * Return TRUE when there is a CursorMovedI autocommand defined. */ int has_cursormovedI(void) { return (first_autopat[(int)EVENT_CURSORMOVEDI] != NULL); } /* * Return TRUE when there is a TextChanged autocommand defined. */ int has_textchanged(void) { return (first_autopat[(int)EVENT_TEXTCHANGED] != NULL); } /* * Return TRUE when there is a TextChangedI autocommand defined. */ int has_textchangedI(void) { return (first_autopat[(int)EVENT_TEXTCHANGEDI] != NULL); } /* * Return TRUE when there is an InsertCharPre autocommand defined. */ int has_insertcharpre(void) { return (first_autopat[(int)EVENT_INSERTCHARPRE] != NULL); } /* * Return TRUE when there is an CmdUndefined autocommand defined. */ int has_cmdundefined(void) { return (first_autopat[(int)EVENT_CMDUNDEFINED] != NULL); } /* * Return TRUE when there is an FuncUndefined autocommand defined. */ int has_funcundefined(void) { return (first_autopat[(int)EVENT_FUNCUNDEFINED] != NULL); } static int apply_autocmds_group( event_T event, char_u *fname, /* NULL or empty means use actual file name */ char_u *fname_io, /* fname to use for 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 */ 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_fname_full; 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; #ifdef FEAT_PROFILE proftime_T wait_time; #endif int did_save_redobuff = FALSE; /* * Quickly return if there are no autocommands for this event or * autocommands are blocked. */ if (first_autopat[(int)event] == NULL || autocmd_blocked > 0) goto BYPASS_AU; /* * When autocommands are busy, new autocommands are only executed when * explicitly enabled with the "nested" flag. */ if (autocmd_busy && !(force || autocmd_nested)) goto BYPASS_AU; #ifdef FEAT_EVAL /* * Quickly return when immediately aborting on error, or when an interrupt * occurred or an exception was thrown but not caught. */ if (aborting()) goto BYPASS_AU; #endif /* * FileChangedShell never nests, because it can create an endless loop. */ if (filechangeshell_busy && (event == EVENT_FILECHANGEDSHELL || event == EVENT_FILECHANGEDSHELLPOST)) goto BYPASS_AU; /* * Ignore events in 'eventignore'. */ if (event_ignored(event)) goto BYPASS_AU; /* * 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")); goto BYPASS_AU; } /* * 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))) goto BYPASS_AU; /* * Save the autocmd_* variables and info about the current buffer. */ save_autocmd_fname = autocmd_fname; save_autocmd_fname_full = autocmd_fname_full; 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 . * Make a copy to avoid that changing a buffer name or directory makes it * invalid. */ if (fname_io == NULL) { if (event == EVENT_COLORSCHEME || event == EVENT_OPTIONSET) autocmd_fname = NULL; else if (fname != NULL && *fname != NUL) autocmd_fname = fname; else if (buf != NULL) autocmd_fname = buf->b_ffname; else autocmd_fname = NULL; } else autocmd_fname = fname_io; if (autocmd_fname != NULL) autocmd_fname = vim_strsave(autocmd_fname); autocmd_fname_full = FALSE; /* call FullName_save() later */ /* * Set the buffer number to be used for . */ 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, FuncUndefined, WindowID, * ColorScheme or QuickFixCmd* */ if (event == EVENT_FILETYPE || event == EVENT_SYNTAX || event == EVENT_FUNCUNDEFINED || event == EVENT_REMOTEREPLY || event == EVENT_SPELLFILEMISSING || event == EVENT_QUICKFIXCMDPRE || event == EVENT_COLORSCHEME || event == EVENT_OPTIONSET || event == EVENT_QUICKFIXCMDPOST) fname = vim_strsave(fname); else fname = FullName_save(fname, FALSE); } if (fname == NULL) /* out of memory */ { vim_free(sfname); retval = FALSE; goto BYPASS_AU; } #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 . */ 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; # ifdef FEAT_PROFILE if (do_profiling == PROF_YES) prof_child_enter(&wait_time); /* doesn't count for the caller itself */ # endif /* 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(); #ifdef FEAT_INS_EXPAND if (!ins_compl_active()) #endif { saveRedobuff(); did_save_redobuff = TRUE; } 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; patcmd.arg_bufnr = autocmd_bufnr; patcmd.next = NULL; auto_next_pat(&patcmd, FALSE); /* found one, start executing the autocommands */ if (patcmd.curpat != NULL) { /* add to active_apc_list */ patcmd.next = active_apc_list; active_apc_list = &patcmd; #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 /* delete from active_apc_list */ if (active_apc_list == &patcmd) /* just in case */ active_apc_list = patcmd.next; } --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; vim_free(autocmd_fname); autocmd_fname = save_autocmd_fname; autocmd_fname_full = save_autocmd_fname_full; autocmd_bufnr = save_autocmd_bufnr; autocmd_match = save_autocmd_match; #ifdef FEAT_EVAL current_SID = save_current_SID; restore_funccal(save_funccalp); # ifdef FEAT_PROFILE if (do_profiling == PROF_YES) prof_child_exit(&wait_time); # endif #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. Free any buffers in the au_pending_free_buf list and * free any windows in the au_pending_free_win list. */ if (!autocmd_busy) { restore_search_patterns(); if (did_save_redobuff) restoreRedobuff(); did_filetype = FALSE; while (au_pending_free_buf != NULL) { buf_T *b = au_pending_free_buf->b_next; vim_free(au_pending_free_buf); au_pending_free_buf = b; } while (au_pending_free_win != NULL) { win_T *w = au_pending_free_win->w_next; vim_free(au_pending_free_win); au_pending_free_win = w; } } /* * 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 */ BYPASS_AU: /* When wiping out a buffer make sure all its buffer-local autocommands * are deleted. */ if (event == EVENT_BUFWIPEOUT && buf != NULL) aubuflocal_remove(buf); return retval; } # ifdef FEAT_EVAL static char_u *old_termresponse = NULL; # endif /* * Block triggering autocommands until unblock_autocmd() is called. * Can be used recursively, so long as it's symmetric. */ void block_autocmds(void) { # ifdef FEAT_EVAL /* Remember the value of v:termresponse. */ if (autocmd_blocked == 0) old_termresponse = get_vim_var_str(VV_TERMRESPONSE); # endif ++autocmd_blocked; } void unblock_autocmds(void) { --autocmd_blocked; # ifdef FEAT_EVAL /* When v:termresponse was set while autocommands were blocked, trigger * the autocommands now. Esp. useful when executing a shell command * during startup (vimdiff). */ if (autocmd_blocked == 0 && get_vim_var_str(VV_TERMRESPONSE) != old_termresponse) apply_autocmds(EVENT_TERMRESPONSE, NULL, NULL, FALSE, curbuf); # endif } int is_autocmd_blocked(void) { return autocmd_blocked != 0; } /* * Find next autocommand pattern that matches. */ static void auto_next_pat( 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. For buffer-local autocommands only check the * buffer number. */ if (ap->pat != NULL && ap->cmds != NULL && (apc->group == AUGROUP_ALL || apc->group == ap->group)) { /* execution-condition */ if (ap->buflocal_nr == 0 ? (match_file_pat(NULL, &ap->reg_prog, apc->fname, apc->sfname, apc->tail, ap->allow_dirs)) : ap->buflocal_nr == apc->arg_bufnr) { 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) { verbose_enter(); smsg((char_u *)_("Executing %s"), sourcing_name); verbose_leave(); } } 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. */ char_u * getnextac(int c UNUSED, void *cookie, int indent UNUSED) { 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) { verbose_enter_scroll(); smsg((char_u *)_("autocommand %s"), ac->cmd); msg_puts((char_u *)"\n"); /* don't overwrite this either */ verbose_leave_scroll(); } 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". * To account for buffer-local autocommands, function needs to know * in which buffer the file will be opened. */ int has_autocmd(event_T event, char_u *sfname, buf_T *buf) { 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 && (ap->buflocal_nr == 0 ? match_file_pat(NULL, &ap->reg_prog, fname, sfname, tail, ap->allow_dirs) : buf != NULL && ap->buflocal_nr == buf->b_fnum )) { 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. */ char_u * get_augroup_name(expand_T *xp UNUSED, 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( expand_T *xp, char_u *arg, int doautocmd) /* TRUE for :doauto*, 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. */ char_u * get_event_name(expand_T *xp UNUSED, 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 autocmd is supported. */ int autocmd_supported(char_u *name) { char_u *p; return (event_name2nr(name, &p) != NUM_EVENTS); } /* * Return TRUE if an autocommand is defined for a group, event and * pattern: The group can be omitted to accept any group. "event" and "pattern" * can be NULL to accept any event and pattern. "pattern" can be NULL to accept * any pattern. Buffer-local patterns or are accepted. * Used for: * exists("#Group") or * exists("#Group#Event") or * exists("#Group#Event#pat") or * exists("#Event") or * exists("#Event#pat") */ int au_exists(char_u *arg) { char_u *arg_save; char_u *pattern = NULL; char_u *event_name; char_u *p; event_T event; AutoPat *ap; buf_T *buflocal_buf = NULL; int group; int retval = FALSE; /* Make a copy so that we can change the '#' chars to a NUL. */ arg_save = vim_strsave(arg); if (arg_save == NULL) return FALSE; p = vim_strchr(arg_save, '#'); if (p != NULL) *p++ = NUL; /* First, look for an autocmd group name */ group = au_find_group(arg_save); if (group == AUGROUP_ERROR) { /* Didn't match a group name, assume the first argument is an event. */ group = AUGROUP_ALL; event_name = arg_save; } else { if (p == NULL) { /* "Group": group name is present and it's recognized */ retval = TRUE; goto theend; } /* Must be "Group#Event" or "Group#Event#pat". */ event_name = p; p = vim_strchr(event_name, '#'); if (p != NULL) *p++ = NUL; /* "Group#Event#pat" */ } pattern = p; /* "pattern" is NULL when there is no pattern */ /* find the index (enum) for the event name */ event = event_name2nr(event_name, &p); /* return FALSE if the event name is not recognized */ if (event == NUM_EVENTS) goto theend; /* 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) goto theend; /* if pattern is "", special handling is needed which uses curbuf */ /* for pattern ", fnamecmp() will work fine */ if (pattern != NULL && STRICMP(pattern, "") == 0) buflocal_buf = curbuf; /* 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. */ /* For buffer-local autocommands, fnamecmp() works fine. */ if (ap->pat != NULL && ap->cmds != NULL && (group == AUGROUP_ALL || ap->group == group) && (pattern == NULL || (buflocal_buf == NULL ? fnamecmp(ap->pat, pattern) == 0 : ap->buflocal_nr == buflocal_buf->b_fnum))) { retval = TRUE; break; } theend: vim_free(arg_save); return retval; } #else /* FEAT_AUTOCMD */ /* * Prepare for executing commands for (hidden) buffer "buf". * This is the non-autocommand version, it simply saves "curbuf" and sets * "curbuf" and "curwin" to match "buf". */ void aucmd_prepbuf( aco_save_T *aco, /* structure to save values in */ buf_T *buf) /* new curbuf */ { aco->save_curbuf = curbuf; --curbuf->b_nwindows; curbuf = buf; curwin->w_buffer = buf; ++curbuf->b_nwindows; } /* * Restore after executing commands for a (hidden) buffer. * This is the non-autocommand version. */ void aucmd_restbuf( aco_save_T *aco) /* structure holding saved values */ { --curbuf->b_nwindows; curbuf = aco->save_curbuf; curwin->w_buffer = curbuf; ++curbuf->b_nwindows; } #endif /* FEAT_AUTOCMD */ #if defined(FEAT_AUTOCMD) || defined(FEAT_WILDIGN) || defined(PROTO) /* * Try matching a filename with a "pattern" ("prog" is NULL), or use the * precompiled regprog "prog" ("pattern" is NULL). That avoids calling * vim_regcomp() often. * Used for autocommands and 'wildignore'. * Returns TRUE if there is a match, FALSE otherwise. */ static int match_file_pat( char_u *pattern, /* pattern to match with */ regprog_T **prog, /* pre-compiled regprog or NULL */ 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; regmatch.rm_ic = p_fic; /* ignore case if 'fileignorecase' is set */ if (prog != NULL) regmatch.regprog = *prog; else 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 (regmatch.regprog != NULL && ((allow_dirs && (vim_regexec(®match, fname, (colnr_T)0) || (sfname != NULL && vim_regexec(®match, sfname, (colnr_T)0)))) || (!allow_dirs && vim_regexec(®match, tail, (colnr_T)0)))) result = TRUE; if (prog != NULL) *prog = regmatch.regprog; else vim_regfree(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(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, NULL, 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 "\ ". * * Returns NULL when out of memory. */ char_u * file_pat_to_reg_pat( 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 UNUSED) /* Don't use a backward slash as pathsep */ { int size = 2; /* '^' at start, '$' at end */ char_u *endp; char_u *reg_pat; char_u *p; int i; int nested = 0; int add_dollar = TRUE; if (allow_dirs != NULL) *allow_dirs = FALSE; if (pat_end == NULL) pat_end = pat + STRLEN(pat); 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)(p) > 1) { ++p; ++size; } # endif break; } } reg_pat = alloc(size + 1); if (reg_pat == NULL) return NULL; i = 0; if (pat[0] == '*') while (pat[0] == '*' && pat < pat_end - 1) pat++; else reg_pat[i++] = '^'; endp = pat_end - 1; if (endp >= pat && *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++] = '*'; while (p[1] == '*') /* "**" matches like "*" */ ++p; break; case '.': case '~': reg_pat[i++] = '\\'; reg_pat[i++] = *p; break; case '?': 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 /* Undo escaping from ExpandEscape(): * foo\?bar -> foo?bar * foo\%bar -> foo%bar * foo\,bar -> foo,bar * foo\ bar -> foo bar * Don't unescape \, * and others that are also special in a * regexp. * An escaped { must be unescaped since we use magic not * verymagic. Use "\\\{n,m\}"" to get "\{n,m}". */ if (*++p == '?' #ifdef BACKSLASH_IN_FILENAME && no_bslash #endif ) reg_pat[i++] = '?'; else if (*p == ',' || *p == '%' || *p == '#' || vim_isspace(*p) || *p == '{' || *p == '}') reg_pat[i++] = *p; else if (*p == '\\' && p[1] == '\\' && p[2] == '{') { reg_pat[i++] = '\\'; reg_pat[i++] = '{'; p += 2; } 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)(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; } #if defined(EINTR) || defined(PROTO) /* * Version of read() that retries when interrupted by EINTR (possibly * by a SIGWINCH). */ long read_eintr(int fd, void *buf, size_t bufsize) { long ret; for (;;) { ret = vim_read(fd, buf, bufsize); if (ret >= 0 || errno != EINTR) break; } return ret; } /* * Version of write() that retries when interrupted by EINTR (possibly * by a SIGWINCH). */ long write_eintr(int fd, void *buf, size_t bufsize) { long ret = 0; long wlen; /* Repeat the write() so long it didn't fail, other than being interrupted * by a signal. */ while (ret < (long)bufsize) { wlen = vim_write(fd, (char *)buf + ret, bufsize - ret); if (wlen < 0) { if (errno != EINTR) break; } else ret += wlen; } return ret; } #endif vim-7.4.1689/src/fold.c000066400000000000000000002467171267703067000144750ustar00rootroot00000000000000/* 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(win_T *wp); static int checkCloseRec(garray_T *gap, linenr_T lnum, int level); static int foldFind(garray_T *gap, linenr_T lnum, fold_T **fpp); static int foldLevelWin(win_T *wp, linenr_T lnum); static void checkupdate(win_T *wp); static void setFoldRepeat(linenr_T lnum, long count, int do_open); static linenr_T setManualFold(linenr_T lnum, int opening, int recurse, int *donep); static linenr_T setManualFoldWin(win_T *wp, linenr_T lnum, int opening, int recurse, int *donep); static void foldOpenNested(fold_T *fpr); static void deleteFoldEntry(garray_T *gap, int idx, int recursive); static void foldMarkAdjustRecurse(garray_T *gap, linenr_T line1, linenr_T line2, long amount, long amount_after); static int getDeepestNestingRecurse(garray_T *gap); static int check_closed(win_T *win, fold_T *fp, int *use_levelp, int level, int *maybe_smallp, linenr_T lnum_off); static void checkSmall(win_T *wp, fold_T *fp, linenr_T lnum_off); static void setSmallMaybe(garray_T *gap); static void foldCreateMarkers(linenr_T start, linenr_T end); static void foldAddMarker(linenr_T lnum, char_u *marker, int markerlen); static void deleteFoldMarkers(fold_T *fp, int recursive, linenr_T lnum_off); static void foldDelMarker(linenr_T lnum, char_u *marker, int markerlen); static void foldUpdateIEMS(win_T *wp, linenr_T top, linenr_T bot); static void parseMarker(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(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_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(linenr_T lnum, linenr_T *firstp, linenr_T *lastp) { return hasFoldingWin(curwin, lnum, firstp, lastp, TRUE, NULL); } /* hasFoldingWin() {{{2 */ int hasFoldingWin( 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 (last > win->w_buffer->b_ml.ml_line_count) last = win->w_buffer->b_ml.ml_line_count; 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(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_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_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(win_T *wp) { return (wp->w_p_fdm[3] == 'u'); } /* foldmethodIsIndent() {{{2 */ /* * Return TRUE if 'foldmethod' is "indent" */ int foldmethodIsIndent(win_T *wp) { return (wp->w_p_fdm[0] == 'i'); } /* foldmethodIsExpr() {{{2 */ /* * Return TRUE if 'foldmethod' is "expr" */ int foldmethodIsExpr(win_T *wp) { return (wp->w_p_fdm[1] == 'x'); } /* foldmethodIsMarker() {{{2 */ /* * Return TRUE if 'foldmethod' is "marker" */ int foldmethodIsMarker(win_T *wp) { return (wp->w_p_fdm[2] == 'r'); } /* foldmethodIsSyntax() {{{2 */ /* * Return TRUE if 'foldmethod' is "syntax" */ int foldmethodIsSyntax(win_T *wp) { return (wp->w_p_fdm[0] == 's'); } /* foldmethodIsDiff() {{{2 */ /* * Return TRUE if 'foldmethod' is "diff" */ int foldmethodIsDiff(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(linenr_T lnum, long count) { setFoldRepeat(lnum, count, FALSE); } /* closeFoldRecurse() {{{2 */ /* * Close fold for current window at line "lnum" recursively. */ void closeFoldRecurse(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( 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)); /* Force a redraw to remove the Visual highlighting. */ if (had_visual) redraw_curbuf_later(INVERTED); } /* openFold() {{{2 */ /* * Open fold for current window at line "lnum". * Repeat "count" times. */ void openFold(linenr_T lnum, long count) { setFoldRepeat(lnum, count, TRUE); } /* openFoldRecurse() {{{2 */ /* * Open fold for current window at line "lnum" recursively. */ void openFoldRecurse(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(void) { 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(void) { 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(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(void) { 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(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(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(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; 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; /* 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( 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; 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; use_level = FALSE; 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; if (foldmethodIsManual(curwin)) deleteFoldEntry(found_ga, (int)(found_fp - (fold_T *)found_ga->ga_data), recursive); else { if (first_lnum > found_fp->fd_top + found_off) first_lnum = found_fp->fd_top + found_off; if (last_lnum < lnum) last_lnum = lnum; if (!did_one) parseMarker(curwin); deleteFoldMarkers(found_fp, recursive, found_off); } did_one = TRUE; /* redraw window */ changed_window_setting(); } } if (!did_one) { EMSG(_(e_nofold)); /* Force a redraw to remove the Visual highlighting. */ if (had_visual) redraw_curbuf_later(INVERTED); } else /* Deleting markers may make cursor column invalid. */ check_cursor_col(); 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_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(win_T *wp, linenr_T top, linenr_T bot) { fold_T *fp; /* Mark all folds from top to bot as maybe-small. */ (void)foldFind(&wp->w_folds, top, &fp); while (fp < (fold_T *)wp->w_folds.ga_data + wp->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)) { int save_got_int = got_int; /* reset got_int here, otherwise it won't work */ got_int = FALSE; foldUpdateIEMS(wp, top, bot); got_int |= save_got_int; } } /* 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_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( 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; checkupdate(curwin); /* 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(win_T *new_win) { ga_init2(&new_win->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_T *win, linenr_T lnum) { int i; 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 */ /* * Adjust the Visual area to include any fold at the start or end completely. */ void foldAdjustVisual(void) { 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 } } /* cursor_foldstart() {{{2 */ /* * Move the cursor to the first line of a closed fold. */ void foldAdjustCursor(void) { (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(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; ++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(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(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(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(linenr_T lnum, long count, int do_open) { int done; long n; for (n = 0; n < count; ++n) { done = DONE_NOTHING; (void)setManualFold(lnum, do_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( 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( 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(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(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; 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) { /* Get "fp" again, the array may have been reallocated. */ fp = (fold_T *)gap->ga_data + idx; /* 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 + 1 < gap->ga_len) mch_memmove(fp + moved, fp + 1, sizeof(fold_T) * (gap->ga_len - (idx + 1))); /* 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; } } } /* deleteFoldRecurse() {{{2 */ /* * Delete nested folds in a fold. */ void deleteFoldRecurse(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( 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( 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 { if (fp->fd_top < top) { /* 2 or 3: need to correct nested folds too */ foldMarkAdjustRecurse(&fp->fd_nested, line1 - fp->fd_top, line2 - fp->fd_top, amount, amount_after); 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; need to * correct nested folds too */ foldMarkAdjustRecurse(&fp->fd_nested, line1 - fp->fd_top, line2 - fp->fd_top, amount, amount_after + (fp->fd_top - top)); 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(void) { checkupdate(curwin); return getDeepestNestingRecurse(&curwin->w_folds); } static int getDeepestNestingRecurse(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_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( 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(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(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(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) vim_strncpy(newline + line_len, marker, markerlen); 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( 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(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; } } /* get_foldtext() {{{2 */ /* * Return the text for a closed fold at line "lnum", with last line "lnume". * When 'foldtext' isn't set puts the result in "buf[51]". Otherwise the * result is in allocated memory. */ char_u * get_foldtext( win_T *wp, linenr_T lnum, linenr_T lnume, foldinfo_T *foldinfo, char_u *buf) { char_u *text = NULL; #ifdef FEAT_EVAL /* an error occurred when evaluating 'fdt' setting */ static int got_fdt_error = FALSE; int save_did_emsg = did_emsg; static win_T *last_wp = NULL; static linenr_T last_lnum = 0; if (last_wp != wp || last_wp == NULL || last_lnum > lnum || last_lnum == 0) /* window changed, try evaluating foldtext setting once again */ got_fdt_error = FALSE; if (!got_fdt_error) /* a previous error should not abort evaluating 'foldexpr' */ did_emsg = FALSE; if (*wp->w_p_fdt != NUL) { char_u dashes[MAX_LEVEL + 2]; win_T *save_curwin; int level; char_u *p; /* 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 > (int)sizeof(dashes) - 1) level = (int)sizeof(dashes) - 1; 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); /* skip evaluating foldtext on errors */ if (!got_fdt_error) { save_curwin = curwin; curwin = wp; curbuf = wp->w_buffer; ++emsg_silent; /* handle exceptions, but don't display errors */ text = eval_to_string_safe(wp->w_p_fdt, NULL, was_set_insecurely((char_u *)"foldtext", OPT_LOCAL)); --emsg_silent; if (text == NULL || did_emsg) got_fdt_error = TRUE; curwin = save_curwin; curbuf = curwin->w_buffer; } last_lnum = lnum; last_wp = wp; set_vim_var_string(VV_FOLDDASHES, NULL, -1); if (!did_emsg && save_did_emsg) did_emsg = save_did_emsg; 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 int len; if (has_mbyte && (len = (*mb_ptr2len)(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 "), (long)(lnume - lnum + 1)); text = buf; } return text; } /* foldtext_cleanup() {{{2 */ /* * Remove 'foldmarker' and 'commentstring' from "str" (in-place). */ void foldtext_cleanup(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; char_u *p; 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 = (int)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 - (int)(cms_end - cms_start); cms_slen = (int)(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 -= (int)(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; else if (STRNCMP(s, foldendmarker, foldendmarkerlen) == 0) len = foldendmarkerlen; if (len > 0) { if (VIM_ISDIGIT(s[len])) ++len; /* May remove 'commentstring' start. Useful when it's a double * quote and we already removed a double quote. */ for (p = s; p > str && vim_iswhite(p[-1]); --p) ; if (p >= str + cms_slen && STRNCMP(p - cms_slen, cms_start, cms_slen) == 0) { len += (int)(s - p) + cms_slen; s = p - cms_slen; } } else if (cms_end != NULL) { if (!did1 && cms_slen > 0 && STRNCMP(s, cms_start, cms_slen) == 0) { len = cms_slen; did1 = TRUE; } else if (!did2 && cms_elen > 0 && STRNCMP(s, cms_end, cms_elen) == 0) { len = cms_elen; did2 = TRUE; } } if (len != 0) { while (vim_iswhite(s[len])) ++len; STRMOVE(s, s + len); } else { mb_ptr_adv(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(garray_T *gap, int level, linenr_T startlnum, fline_T *flp, void (*getlevel)(fline_T *), linenr_T bot, int topflags); static int foldInsert(garray_T *gap, int i); static void foldSplit(garray_T *gap, int i, linenr_T top, linenr_T bot); static void foldRemove(garray_T *gap, linenr_T top, linenr_T bot); static void foldMerge(fold_T *fp1, garray_T *gap, fold_T *fp2); static void foldlevelIndent(fline_T *flp); #ifdef FEAT_DIFF static void foldlevelDiff(fline_T *flp); #endif static void foldlevelExpr(fline_T *flp); static void foldlevelMarker(fline_T *flp); static void foldlevelSyntax(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(win_T *wp, linenr_T top, linenr_T bot) { linenr_T start; linenr_T end; fline_T fline; void (*getlevel)(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; } } /* * If folding is defined by the syntax, it is possible that a change in * one line will cause all sub-folds of the current fold to change (e.g., * closing a C-style comment can cause folds in the subsequent lines to * appear). To take that into account we should adjust the value of "bot" * to point to the end of the current fold: */ if (foldlevelSyntax == getlevel) { garray_T *gap = &wp->w_folds; fold_T *fpn = NULL; int current_fdl = 0; linenr_T fold_start_lnum = 0; linenr_T lnum_rel = fline.lnum; while (current_fdl < fline.lvl) { if (!foldFind(gap, lnum_rel, &fpn)) break; ++current_fdl; fold_start_lnum += fpn->fd_top; gap = &fpn->fd_nested; lnum_rel -= fpn->fd_top; } if (fpn != NULL && current_fdl == fline.lvl) { linenr_T fold_end_lnum = fold_start_lnum + fpn->fd_len; if (fold_end_lnum > bot) bot = fold_end_lnum; } } 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_win(wp); /* 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 lose 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( garray_T *gap, int level, linenr_T startlnum, fline_T *flp, void (*getlevel)(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) { (void)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) { (void)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". * Check "fp" for safety. */ if (lvl > level && fp != NULL) { /* * 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; fp->fd_small = MAYBE; 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 continued 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(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; 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( 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; fp[1].fd_small = MAYBE; fp->fd_small = MAYBE; /* 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; gap1->ga_len -= 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: truncate 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(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 - 1 > 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 adjacent folds (and the nested ones in them). * This only works correctly when the folds are really adjacent! 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(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; } gap2->ga_len = 0; } 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(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) / get_sw_value(curbuf); if (flp->lvl > flp->wp->w_p_fdn) { flp->lvl = flp->wp->w_p_fdn; if (flp->lvl < 0) flp->lvl = 0; } } /* foldlevelDiff() {{{2 */ #ifdef FEAT_DIFF /* * Low level function to get the foldlevel for the "diff" method. * Doesn't use any caching. */ static void foldlevelDiff(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(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(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(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 > start_lvl) flp->lvl_next = start_lvl; } } else --flp->lvl_next; } else mb_ptr_adv(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(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(FILE *fd, garray_T *gap, linenr_T off); static int put_foldopen_recurse(FILE *fd, win_T *wp, garray_T *gap, linenr_T off); static int put_fold_open_close(FILE *fd, fold_T *fp, linenr_T off); /* * Write commands to "fd" to restore the manual folds in window "wp". * Return FAIL if writing fails. */ int put_folds(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, &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(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( FILE *fd, win_T *wp, garray_T *gap, linenr_T off) { int i; int level; 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 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, wp, &fp->fd_nested, off + fp->fd_top) == FAIL) return FAIL; /* close the parent when needed */ if (fp->fd_flags == FD_CLOSED) { if (put_fold_open_close(fd, fp, off) == FAIL) return FAIL; } } else { /* Open or close the leaf according to the window foldlevel. * Do not close a leaf that is already closed, as it will close * the parent. */ level = foldLevelWin(wp, off + fp->fd_top); if ((fp->fd_flags == FD_CLOSED && wp->w_p_fdl >= level) || (fp->fd_flags != FD_CLOSED && wp->w_p_fdl < level)) if (put_fold_open_close(fd, fp, off) == FAIL) return FAIL; } } ++fp; } return OK; } /* put_fold_open_close() {{{2 */ /* * Write the open or close command to "fd". * Returns FAIL when writing failed. */ static int put_fold_open_close(FILE *fd, fold_T *fp, linenr_T off) { 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; return OK; } #endif /* FEAT_SESSION */ /* }}}1 */ #endif /* defined(FEAT_FOLDING) || defined(PROTO) */ vim-7.4.1689/src/getchar.c000066400000000000000000003707101267703067000151550ustar00rootroot00000000000000/* 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 characters: 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 buffheader_T redobuff = {{NULL, {NUL}}, NULL, 0, 0}; static buffheader_T old_redobuff = {{NULL, {NUL}}, NULL, 0, 0}; #if defined(FEAT_AUTOCMD) || defined(FEAT_EVAL) || defined(PROTO) static buffheader_T save_redobuff = {{NULL, {NUL}}, NULL, 0, 0}; static buffheader_T save_old_redobuff = {{NULL, {NUL}}, NULL, 0, 0}; #endif static buffheader_T 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 + SELECTMODE + 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 = 0; /* remapping flags */ /* * 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 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 */ #define RM_ABBR 4 /* tb_noremap: don't remap, do abbrev. */ /* 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(buffheader_T *, int); static void add_buff(buffheader_T *, char_u *, long n); static void add_num_buff(buffheader_T *, long); static void add_char_buff(buffheader_T *, int); static int read_readbuffers(int advance); static int read_readbuf(buffheader_T *buf, int advance); static void start_stuff(void); static int read_redo(int, int); static void copy_redo(int); static void init_typebuf(void); static void gotchars(char_u *, int); static void may_sync_undo(void); static void closescript(void); static int vgetorpeek(int); static void map_free(mapblock_T **); static void validate_maphash(void); static void showmap(mapblock_T *mp, int local); #ifdef FEAT_EVAL static char_u *eval_map_expr(char_u *str, int c); #endif /* * Free and clear a buffer. */ void free_buff(buffheader_T *buf) { buffblock_T *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( buffheader_T *buffer, int dozero) /* count == zero is not an error */ { long_u count = 0; char_u *p = NULL; char_u *p2; char_u *str; buffblock_T *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(void) { 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(void) { 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( buffheader_T *buf, char_u *s, long slen) /* length of "s" or -1 */ { buffblock_T *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) mch_memmove(buf->bh_first.b_next->b_str, buf->bh_first.b_next->b_str + buf->bh_index, STRLEN(buf->bh_first.b_next->b_str + buf->bh_index) + 1); buf->bh_index = 0; if (buf->bh_space >= (int)slen) { len = (long_u)STRLEN(buf->bh_curr->b_str); vim_strncpy(buf->bh_curr->b_str + len, s, (size_t)slen); buf->bh_space -= slen; } else { if (slen < MINIMAL_SIZE) len = MINIMAL_SIZE; else len = slen; p = (buffblock_T *)lalloc((long_u)(sizeof(buffblock_T) + len), TRUE); if (p == NULL) return; /* no space, just forget it */ buf->bh_space = (int)(len - slen); vim_strncpy(p->b_str, s, (size_t)slen); 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(buffheader_T *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(buffheader_T *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 } /* First read ahead buffer. Used for translated commands. */ static buffheader_T readbuf1 = {{NULL, {NUL}}, NULL, 0, 0}; /* Second read ahead buffer. Used for redo. */ static buffheader_T readbuf2 = {{NULL, {NUL}}, NULL, 0, 0}; /* * Get one byte from the read buffers. Use readbuf1 one first, use readbuf2 * if that one is empty. * If advance == TRUE go to the next char. * No translation is done K_SPECIAL and CSI are escaped. */ static int read_readbuffers(int advance) { int c; c = read_readbuf(&readbuf1, advance); if (c == NUL) c = read_readbuf(&readbuf2, advance); return c; } static int read_readbuf(buffheader_T *buf, int advance) { char_u c; buffblock_T *curr; if (buf->bh_first.b_next == NULL) /* buffer is empty */ return NUL; curr = buf->bh_first.b_next; c = curr->b_str[buf->bh_index]; if (advance) { if (curr->b_str[++buf->bh_index] == NUL) { buf->bh_first.b_next = curr->b_next; vim_free(curr); buf->bh_index = 0; } } return c; } /* * Prepare the read buffers for reading (if they contain something). */ static void start_stuff(void) { if (readbuf1.bh_first.b_next != NULL) { readbuf1.bh_curr = &(readbuf1.bh_first); readbuf1.bh_space = 0; } if (readbuf2.bh_first.b_next != NULL) { readbuf2.bh_curr = &(readbuf2.bh_first); readbuf2.bh_space = 0; } } /* * Return TRUE if the stuff buffer is empty. */ int stuff_empty(void) { return (readbuf1.bh_first.b_next == NULL && readbuf2.bh_first.b_next == NULL); } /* * Return TRUE if readbuf1 is empty. There may still be redo characters in * redbuf2. */ int readbuf1_empty(void) { return (readbuf1.bh_first.b_next == NULL); } /* * Set a typeahead character that won't be flushed. */ void typeahead_noflush(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 "flush_typeahead" is true, * flush all typeahead characters (used when interrupted by a CTRL-C). */ void flush_buffers(int flush_typeahead) { init_typebuf(); start_stuff(); while (read_readbuffers(TRUE) != NUL) ; if (flush_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 at the start 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(void) { if (!block_redo) { free_buff(&old_redobuff); old_redobuff = redobuff; redobuff.bh_first.b_next = NULL; } } /* * Discard the contents of the redo buffer and restore the previous redo * buffer. */ void CancelRedo(void) { if (!block_redo) { free_buff(&redobuff); redobuff = old_redobuff; old_redobuff.bh_first.b_next = NULL; start_stuff(); while (read_readbuffers(TRUE) != NUL) ; } } #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(void) { 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(void) { 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(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( char_u *str, int len) /* length of "str" or -1 for up to the NUL */ { char_u *s = str; int c; char_u *start; if (block_redo) return; while (len < 0 ? *s != NUL : s - str < len) { /* 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 && (len < 0 || s - str < len)) ++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 || (len >= 0 && s - str >= len)) break; /* Handle a special or multibyte character. */ #ifdef FEAT_MBYTE if (has_mbyte) /* Handle composing chars separately. */ c = mb_cptr2char_adv(&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(int c) { if (!block_redo) add_char_buff(&redobuff, c); } /* * Append a number to the redo buffer. */ void AppendNumberToRedobuff(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(char_u *s) { add_buff(&readbuf1, s, -1L); } /* * Append string "s" to the redo stuff buffer. * CSI and K_SPECIAL must already have been escaped. */ void stuffRedoReadbuff(char_u *s) { add_buff(&readbuf2, s, -1L); } void stuffReadbuffLen(char_u *s, long len) { add_buff(&readbuf1, 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. * Change CR, LF and ESC into a space. */ void stuffReadbuffSpec(char_u *s) { int c; 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 c = mb_ptr2char_adv(&s); #else c = *s++; #endif if (c == CAR || c == NL || c == ESC) c = ' '; stuffcharReadbuff(c); } } } #endif /* * Append a character to the stuff buffer. * Translates special keys, NUL, CSI, K_SPECIAL and multibyte characters. */ void stuffcharReadbuff(int c) { add_char_buff(&readbuf1, c); } /* * Append a number to the stuff buffer. */ void stuffnumReadbuff(long n) { add_num_buff(&readbuf1, 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(int init, int old_redo) { static buffblock_T *bp; static char_u *p; int c; #ifdef FEAT_MBYTE int n; char_u buf[MB_MAXBYTES + 1]; 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(int old_redo) { int c; while ((c = read_redo(FALSE, old_redo)) != NUL) add_char_buff(&readbuf2, c); } /* * Stuff the redo buffer into readbuf2. * 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(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(&readbuf2, (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(&readbuf2, c); c = read_redo(FALSE, old_redo); } 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); } /* 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(&readbuf2, count); } /* copy from the redo buffer into the stuff buffer */ add_char_buff(&readbuf2, 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 readbuf2. * return FAIL for failure, OK otherwise */ int start_redo_ins(void) { 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') add_buff(&readbuf2, NL_STR, -1L); 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(void) { 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(void) { 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_SKIP, fist char of new string cannot be mapped again, * but abbreviations are allowed. * 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( 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 a 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 if (noremap == REMAP_SKIP) val = RM_ABBR; 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 == REMAP_SKIP) nrm = 1; else 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; } /* * Put character "c" back into the typeahead buffer. * Can be used for a character obtained by vgetc() that needs to be put back. * Uses cmd_silent, KeyTyped and KeyNoremap to restore the flags belonging to * the char. */ void ins_char_typebuf(int c) { #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 } (void)ins_typebuf(buf, KeyNoremap, 0, !KeyTyped, cmd_silent); } /* * Return TRUE if the typeahead buffer was changed (while waiting for a * character to arrive). Happens when a message was received from a client or * from feedkeys(). * 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( int tb_change_cnt) /* old value of typebuf.tb_change_cnt */ { return (tb_change_cnt != 0 && (typebuf.tb_change_cnt != tb_change_cnt #if defined(FEAT_CLIENTSERVER) || defined(FEAT_EVAL) || typebuf_was_filled #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(void) { return typebuf.tb_maplen == 0; } /* * Return the number of characters that are mapped (or not typed). */ int typebuf_maplen(void) { return typebuf.tb_maplen; } /* * remove "len" characters from typebuf.tb_buf[typebuf.tb_off + offset] */ void del_typebuf(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; } #if defined(FEAT_CLIENTSERVER) || defined(FEAT_EVAL) /* Reset the flag that text received from a client or from feedkeys() * was inserted in the typeahead buffer. */ typebuf_was_filled = 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(char_u *chars, int len) { char_u *s = chars; int c; char_u buf[2]; int todo = len; /* remember how many chars were last recorded */ if (Recording) last_recorded_len += len; buf[1] = NUL; while (todo--) { /* 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(void) { if ((!(State & (INSERT + CMDLINE)) || arrow_used) && scriptin[curscript] == NULL) u_sync(FALSE); } /* * Make "typebuf" empty and allocate new buffers. * Returns FAIL when out of memory. */ int alloc_typebuf(void) { 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(void) { if (typebuf.tb_buf == typebuf_init) EMSG2(_(e_intern2), "Free typebuf 1"); else vim_free(typebuf.tb_buf); if (typebuf.tb_noremap == noremapbuf_init) EMSG2(_(e_intern2), "Free typebuf 2"); else 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(void) { init_typebuf(); saved_typebuf[curscript] = typebuf; /* If out of memory: restore typebuf and close file. */ if (alloc_typebuf() == FAIL) { closescript(); return FAIL; } return OK; } static int old_char = -1; /* character put back by vungetc() */ static int old_mod_mask; /* mod_mask for ungotten character */ #ifdef FEAT_MOUSE static int old_mouse_row; /* mouse_row related to old_char */ static int old_mouse_col; /* mouse_col related to old_char */ #endif /* * Save all three kinds of typeahead, so that the user must type at a prompt. */ void save_typeahead(tasave_T *tp) { tp->save_typebuf = typebuf; tp->typebuf_valid = (alloc_typebuf() == OK); if (!tp->typebuf_valid) typebuf = tp->save_typebuf; tp->old_char = old_char; tp->old_mod_mask = old_mod_mask; old_char = -1; tp->save_readbuf1 = readbuf1; readbuf1.bh_first.b_next = NULL; tp->save_readbuf2 = readbuf2; readbuf2.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(tasave_T *tp) { if (tp->typebuf_valid) { free_typebuf(); typebuf = tp->save_typebuf; } old_char = tp->old_char; old_mod_mask = tp->old_mod_mask; free_buff(&readbuf1); readbuf1 = tp->save_readbuf1; free_buff(&readbuf2); readbuf2 = tp->save_readbuf2; # ifdef USE_INPUT_BUF set_input_buf(tp->save_inputbuf); # endif } /* * Open a new script file for the ":source!" command. */ void openscript( char_u *name, int directly) /* when TRUE execute directly */ { if (curscript + 1 == NSCRIPT) { EMSG(_(e_nesting)); return; } #ifdef FEAT_EVAL if (ignore_script) /* Not reading from script, also don't open one. Warning message? */ return; #endif 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(void) { free_typebuf(); typebuf = saved_typebuf[curscript]; fclose(scriptin[curscript]); scriptin[curscript] = NULL; if (curscript > 0) --curscript; } #if defined(EXITFREE) || defined(PROTO) void close_all_scripts(void) { while (scriptin[0] != NULL) closescript(); } #endif #if defined(FEAT_INS_EXPAND) || defined(PROTO) /* * Return TRUE when reading keys from a script file. */ int using_script(void) { return scriptin[curscript] != NULL; } #endif /* * This function is called just before doing a blocking wait. Thus after * waiting 'updatetime' for a character to arrive. */ void before_blocking(void) { updatescript(0); #ifdef FEAT_EVAL if (may_garbage_collect) garbage_collect(); #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(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; } } /* * 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 modifiers in the global "mod_mask". */ int vgetc(void) { int c, c2; #ifdef FEAT_MBYTE int n; char_u buf[MB_MAXBYTES + 1]; int i; #endif #ifdef FEAT_EVAL /* Do garbage collection when garbagecollect() was called previously and * we are now at the toplevel. */ if (may_garbage_collect && want_garbage_collect) garbage_collect(); #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; #ifdef FEAT_MOUSE mouse_row = old_mouse_row; mouse_col = old_mouse_col; #endif } else { mod_mask = 0x0; last_recorded_len = 0; for (;;) /* this is done twice if there are modifiers */ { int did_inc = FALSE; if (mod_mask) /* no mapping after modifier has been read */ { ++no_mapping; ++allow_keys; did_inc = TRUE; /* mod_mask may change value */ } c = vgetorpeek(TRUE); if (did_inc) { --no_mapping; --allow_keys; } /* Get two extra bytes for special keys */ if (c == K_SPECIAL #ifdef FEAT_GUI || c == CSI #endif ) { int save_allow_keys = allow_keys; ++no_mapping; allow_keys = 0; /* make sure BS is not found */ c2 = vgetorpeek(TRUE); /* no mapping for these chars */ c = vgetorpeek(TRUE); --no_mapping; allow_keys = save_allow_keys; 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 */ for (i = 0; (c = vgetorpeek(TRUE)) != '\r'; ) { name[i] = c; if (i < 199) ++i; } name[i] = NUL; gui_make_tearoff(name); continue; } #endif #if defined(FEAT_GUI) && defined(FEAT_GUI_GTK) && defined(FEAT_MENU) /* GTK: normally selects the menu, but it's passed until * here to allow mapping it. Intercept and invoke the GTK * behavior if it's not mapped. */ if (c == K_F10 && gui.menubar != NULL) { gtk_menu_shell_select_first(GTK_MENU_SHELL(gui.menubar), FALSE); continue; } #endif #ifdef FEAT_GUI /* Handle focus event here, so that the caller doesn't need to * know about it. Return K_IGNORE so that we loop once (needed if * 'lazyredraw' is set). */ if (c == K_FOCUSGAINED || c == K_FOCUSLOST) { ui_focus_change(c == K_FOCUSGAINED); c = K_IGNORE; } /* 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 } /* a keypad or special function 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: #ifdef WIN32 /* Can be either '.' or a ',', * * depending on the type of keypad. */ c = MapVirtualKey(VK_DECIMAL, 2); break; #else c = '.'; break; #endif 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; case K_XHOME: case K_ZHOME: if (mod_mask == MOD_MASK_SHIFT) { c = K_S_HOME; mod_mask = 0; } else if (mod_mask == MOD_MASK_CTRL) { c = K_C_HOME; mod_mask = 0; } else c = K_HOME; break; case K_XEND: case K_ZEND: if (mod_mask == MOD_MASK_SHIFT) { c = K_S_END; mod_mask = 0; } else if (mod_mask == MOD_MASK_CTRL) { c = K_C_END; mod_mask = 0; } else c = K_END; break; case K_XUP: c = K_UP; break; case K_XDOWN: c = K_DOWN; break; case K_XLEFT: c = K_LEFT; break; case K_XRIGHT: c = K_RIGHT; 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 break; } } #ifdef FEAT_EVAL /* * In the main loop "may_garbage_collect" can be set to do garbage * collection in the first next vgetc(). It's disabled after that to * avoid internally used Lists and Dicts to be freed. */ may_garbage_collect = FALSE; #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(void) { int c; c = vgetc(); if (c == NUL) c = get_keystroke(); return c; } /* * Like safe_vgetc(), but loop to handle K_IGNORE. * Also ignore scrollbar events. */ int plain_vgetc(void) { int c; do { c = safe_vgetc(); } while (c == K_IGNORE || c == K_VER_SCROLLBAR || c == K_HOR_SCROLLBAR); 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(void) { 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(void) { int c; ++no_mapping; ++allow_keys; c = vpeekc(); --no_mapping; --allow_keys; return c; } #endif #if defined(FEAT_INS_EXPAND) || defined(FEAT_EVAL) || 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(void) { 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(void) { int retval; #ifdef FEAT_EVAL /* When disable_char_avail_for_testing(1) was called pretend there is no * typeahead. */ if (disable_char_avail_for_testing) return FALSE; #endif ++no_mapping; retval = vpeekc(); --no_mapping; return (retval != NUL); } /* * unget one character (can only be done once!) */ void vungetc(int c) { old_char = c; old_mod_mask = mod_mask; #ifdef FEAT_MOUSE old_mouse_row = mouse_row; old_mouse_col = mouse_col; #endif } /* * 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(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; int i; #ifdef FEAT_CMDL_INFO 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; int wait_tb_len; /* * 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 > 0 && ex_normal_busy == 0) return NUL; local_State = get_real_state(); ++vgetc_busy; 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_readbuffers(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 */ if (advance) { /* 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|RM_ABBR)) == 0)) && !(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)) || ((compl_cont_status & CONT_LOCAL) && (c1 == Ctrl_N || c1 == Ctrl_P))) #endif ) { #ifdef FEAT_LANGMAP if (c1 == K_SPECIAL) nolmaplen = 2; else { LANGMAP_ADJUST(c1, (State & (CMDLINE | INSERT)) == 0 && get_real_state() != SELECTMODE); 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) { /* There are no buffer-local mappings. */ 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 * and then changing 'encoding'. Beware * that 0x80 is escaped. */ { char_u *p1 = mp->m_keys; char_u *p2 = mb_unescape(&p1); if (has_mbyte && p2 != NULL && MB_BYTE2LEN(c1) > MB_PTR2LEN(p2)) 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|RM_ABBR)) break; if (n >= 0) continue; if (keylen > typebuf.tb_len) { if (!timedout && !(mp_match != NULL && mp_match->m_nowait)) { /* break at a partly match */ keylen = KEYLEN_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 != KEYLEN_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 */ } #ifdef FEAT_WINDOWS status_redraw_all(); redraw_statuslines(); #endif showmode(); setcursor(); continue; } /* Need more chars for partly match. */ if (mlen == typebuf.tb_len) keylen = KEYLEN_PART_KEY; 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 != KEYLEN_PART_MAP) { int save_keylen = keylen; /* * 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, NULL); /* If no termcode matched but 'pastetoggle' * matched partially it's like an incomplete key * sequence. */ if (keylen == 0 && save_keylen == KEYLEN_PART_KEY) keylen = KEYLEN_PART_KEY; /* * 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 = KEYLEN_PART_KEY; } if (keylen >= 0) #endif /* When there was a matching mapping and no * termcode could be replaced after another one, * use that mapping (loop around). If there was * no mapping use the character from the * typeahead buffer right here. */ 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]; 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_len >= 2 && 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) { /* * In Select mode and 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 && (current_menu->modes & VISUAL)) { VIsual_select = FALSE; (void)ins_typebuf(K_SELECT_STRING, REMAP_NONE, 0, TRUE, FALSE); } ins_typebuf(current_menu->strings[idx], current_menu->noremap[idx], 0, TRUE, current_menu->silent[idx]); } } #endif /* FEAT_GUI && FEAT_MENU */ 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 = KEYLEN_PART_KEY; else keylen = mp_match_len; } /* complete match */ if (keylen >= 0 && keylen <= typebuf.tb_len) { #ifdef FEAT_EVAL int save_m_expr; int save_m_noremap; int save_m_silent; char_u *save_m_keys; char_u *save_m_str; #else # define save_m_noremap mp->m_noremap # define save_m_silent mp->m_silent #endif /* 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; } /* * In Select mode and 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 && (mp->m_mode & VISUAL)) { VIsual_select = FALSE; (void)ins_typebuf(K_SELECT_STRING, REMAP_NONE, 0, TRUE, FALSE); } #ifdef FEAT_EVAL /* Copy the values from *mp that are used, because * evaluating the expression may invoke a function * that redefines the mapping, thereby making *mp * invalid. */ save_m_expr = mp->m_expr; save_m_noremap = mp->m_noremap; save_m_silent = mp->m_silent; save_m_keys = NULL; /* only saved when needed */ save_m_str = NULL; /* only saved when needed */ /* * Handle ":map ": evaluate the {rhs} as an * expression. Also save and restore the command line * for "normal :". */ if (mp->m_expr) { int save_vgetc_busy = vgetc_busy; vgetc_busy = 0; save_m_keys = vim_strsave(mp->m_keys); save_m_str = vim_strsave(mp->m_str); s = eval_map_expr(save_m_str, NUL); vgetc_busy = save_vgetc_busy; } else #endif s = mp->m_str; /* * 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 (but do * allow abbreviations). * If m_noremap is set, don't remap the whole 'to' * part. */ if (s == NULL) i = FAIL; else { int noremap; if (save_m_noremap != REMAP_YES) noremap = save_m_noremap; else if ( #ifdef FEAT_EVAL STRNCMP(s, save_m_keys != NULL ? save_m_keys : mp->m_keys, (size_t)keylen) #else STRNCMP(s, mp->m_keys, (size_t)keylen) #endif != 0) noremap = REMAP_YES; else noremap = REMAP_SKIP; i = ins_typebuf(s, noremap, 0, TRUE, cmd_silent || save_m_silent); #ifdef FEAT_EVAL if (save_m_expr) vim_free(s); #endif } #ifdef FEAT_EVAL vim_free(save_m_keys); vim_free(save_m_str); #endif if (i == FAIL) { c = -1; break; } continue; } } /* * get a character: 3. from the user - handle in Insert mode */ /* * special case: if we get an 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 . 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 && ex_normal_busy == 0 && typebuf.tb_maplen == 0 && (State & INSERT) && (p_timeout || (keylen == KEYLEN_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 (mode_displayed) { 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, ptr + col, (colnr_T)vcol); #ifdef FEAT_MBYTE if (has_mbyte) col += (*mb_ptr2len)(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 */ /* Allow mapping for just typed characters. When we get here c * is the number of extra bytes and typebuf.tb_len is 1. */ for (n = 1; n <= c; ++n) typebuf.tb_noremap[typebuf.tb_off + n] = RM_YES; typebuf.tb_len += c; /* buffer full, don't map */ if (typebuf.tb_len >= typebuf.tb_maplen + MAXMAPLEN) { timedout = TRUE; continue; } 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; } /* * 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. Also for when 'lazyredraw' is set and * redrawing was postponed because there was something in the * input buffer (e.g., termresponse). */ if (((State & INSERT) != 0 || p_lz) && (State & CMDLINE) == 0 && advance && must_redraw != 0 && !need_wait_return) { 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 */ wait_tb_len = typebuf.tb_len; 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 == KEYLEN_PART_KEY))) ? -1L : ((keylen == KEYLEN_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(); else 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 (wait_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 && msg_silent == 0 && (State & INSERT)) { if (c == ESC && !mode_deleted && !no_mapping && mode_displayed) { 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; 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( 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 */ /* * Get a character from a script file if there is one. * If interrupted: Stop reading script files, close them all. */ script_char = -1; while (scriptin[curscript] != NULL && script_char < 0 #ifdef FEAT_EVAL && !ignore_script #endif ) { #ifdef MESSAGE_QUEUE parse_queued_messages(); #endif 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( 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 #ifdef FEAT_AUTOCMD /* timeout may generate K_CURSORHOLD */ && (i < 2 || p[1] != KS_EXTRA || p[2] != (int)KE_CURSORHOLD) #endif #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() * or feedkeys() may insert characters in the typeahead buffer while we are * waiting for input to arrive. */ int input_available(void) { return (!vim_is_input_buf_empty() # if defined(FEAT_CLIENTSERVER) || defined(FEAT_EVAL) || typebuf_was_filled # 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 + SELECTMODE + 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 + SELECTMODE * for :xmap mode is VISUAL * for :smap mode is SELECTMODE * 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( 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 nowait = FALSE; int silent = FALSE; int special = FALSE; #ifdef FEAT_EVAL int expr = FALSE; #endif int noremap; char_u *orig_rhs; 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 , , ,