diff options
Diffstat (limited to 'runtime/tutor')
-rw-r--r-- | runtime/tutor/README.txt | 148 | ||||
-rwxr-xr-x | runtime/tutor/README_ami.txt.info | bin | 0 -> 582 bytes | |||
-rwxr-xr-x | runtime/tutor/README_amibin.txt.info | bin | 0 -> 582 bytes | |||
-rw-r--r-- | runtime/tutor/README_dos.txt | 154 | ||||
-rw-r--r-- | runtime/tutor/README_mac.txt | 8 | ||||
-rwxr-xr-x | runtime/tutor/runtime.info | bin | 0 -> 624 bytes | |||
-rw-r--r-- | runtime/tutor/runtime/evim.vim | 66 | ||||
-rw-r--r-- | runtime/tutor/runtime/gvimrc_example.vim | 59 | ||||
-rw-r--r-- | runtime/tutor/runtime/icons.info | bin | 0 -> 624 bytes | |||
-rw-r--r-- | runtime/tutor/runtime/scripts.vim | 351 | ||||
-rw-r--r-- | runtime/tutor/runtime/synmenu.vim | 569 | ||||
-rw-r--r-- | runtime/tutor/runtime/vim48x48.png | bin | 0 -> 474 bytes | |||
-rw-r--r-- | runtime/tutor/tutor.de.utf-8 | 980 | ||||
-rw-r--r-- | runtime/tutor/tutor.el.cp737 | 815 | ||||
-rw-r--r-- | runtime/tutor/tutor.hr | 972 | ||||
-rw-r--r-- | runtime/tutor/uninstal.txt | 80 |
16 files changed, 4186 insertions, 16 deletions
diff --git a/runtime/tutor/README.txt b/runtime/tutor/README.txt index 77097c1990..6eece41973 100644 --- a/runtime/tutor/README.txt +++ b/runtime/tutor/README.txt @@ -1,22 +1,138 @@ -Tutor is a "hands on" tutorial for new users of the Vim editor. +README.txt for version 7.2a of Vim: Vi IMproved. -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. +WHAT IS VIM -On Unix you can also use the "vimtutor" program. It will make a -scratch copy of the tutor first. +Vim is an almost compatible version of the 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, etc. +There is also a Graphical User Interface (GUI) available. See +"runtime/doc/vi_diff.txt" for differences with Vi. -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. +This editor is very useful for editing programs and other plain ASCII 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 +defined by the user, and the mouse can be used. -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 currently runs under Amiga DOS, MS-DOS, MS-Windows 95/98/Me/NT/2000/XP, +Atari MiNT, Macintosh, BeOS, VMS, RISC OS, OS/2 and almost all flavours of +UNIX. Porting to other systems should not be very difficult. -[This file was modified for Vim by Bram Moolenaar] + +DISTRIBUTION + +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. + + +DOCUMENTATION + +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". + +The vim tutor is a one hour training course for beginners. Mostly it can be +started as "vimtutor". See ":help tutor" for more information. + + +COPYING + +Vim is Charityware. You can use and copy it as much as you like, but you are +encouraged to make a donation to 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/ + + +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: +README_ami.txt Amiga +README_unix.txt Unix +README_dos.txt MS-DOS and MS-Windows +README_os2.txt OS/2 +README_mac.txt Macintosh +README_vms.txt VMS + + +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 FAQ: + http://vimdoc.sf.net/vimfaq.html + +Send bug reports to: + Bram Moolenaar <Bram@vim.org> + +There are five mailing lists for Vim: +<vim@vim.org> + For discussions about using existing versions of Vim: Useful mappings, + questions, answers, where to get a specific version, etc. +<vim-dev@vim.org> + For discussions about changing Vim: New features, porting, beta-test + versions, etc. +<vim-announce@vim.org> + Announcements about new versions of Vim; also beta-test versions and + ports to different systems. +<vim-multibyte@vim.org> + For discussions about using and improving the multi-byte aspects of + Vim: XIM, Hangul, fontset, etc. +<vim-mac@vim.org> + For discussions about using and improving Vim on the Macintosh. + +For more info and URLs of the archives see "http://www.vim.org/maillist.php". + +NOTE: +- You can only send messages to these lists if you have subscribed! +- You need to send the messages from the same location as where you subscribed + from (to avoid spam mail). +- Maximum message size is 40000 characters. + +If you want to join a maillist, send a message to + <vim-help@vim.org> +Make sure that your "From:" address is correct. Then the list server will +send you a help message. + + +MAIN AUTHOR + +Send any other comments, patches, pizza and suggestions to: + + Bram Moolenaar E-mail: Bram@vim.org + Finsterruetihof 1 + 8134 Adliswil + Switzerland diff --git a/runtime/tutor/README_ami.txt.info b/runtime/tutor/README_ami.txt.info Binary files differnew file mode 100755 index 0000000000..912436d6a4 --- /dev/null +++ b/runtime/tutor/README_ami.txt.info diff --git a/runtime/tutor/README_amibin.txt.info b/runtime/tutor/README_amibin.txt.info Binary files differnew file mode 100755 index 0000000000..bdc3f028e2 --- /dev/null +++ b/runtime/tutor/README_amibin.txt.info diff --git a/runtime/tutor/README_dos.txt b/runtime/tutor/README_dos.txt new file mode 100644 index 0000000000..f4818b8a21 --- /dev/null +++ b/runtime/tutor/README_dos.txt @@ -0,0 +1,154 @@ +README_dos.txt for version 7.2a 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\vim70", + 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 gvim70.zip + unzip vim70w32.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\vim70 + 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\vim70 + set path=%path%;D:\editors\vim\vim70 + - Create entries for Vim on the desktop and in the Start menu. + +That's it! + + +Remarks: + +- If Vim can't find the runtime files, ":help" won't work and the GUI version + won't show a menubar. Then you need to set the $VIM environment variable to + point to the top directory of your Vim files. Example: + set VIM=C:\editors\vim + Vim version 6.0 will look for your vimrc file in $VIM, and for the runtime + files in $VIM/vim70. 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\vim70\vim.exe The Vim version 6.0 executable. + C:\vim\vim70\doc\*.txt The version 6.0 documentation files. + C:\vim\vim70\bugreport.vim A Vim version 6.0 script. + C:\vim\vim70\... Other version 6.0 distributed files. + In this case the $VIM environment variable would be set like this: + set VIM=C:\vim + Then $VIMRUNTIME will automatically be set to "$VIM\vim70". Don't add + "vim70" 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\vim70\vim.exe + C:\command.com /c D:\editors\vim\vim70\vim.exe + 6. Select the font, window size, etc. that you like. If this isn't + possible, select "Advanced" in the Program tab, and deselect "MS-DOS + mode". + 7. Click OK. + + For gvim, you can use a normal shortcut on the desktop, and set the size of + the Window in your $VIM/_gvimrc: + set lines=30 columns=90 + + +For further information, type one of these inside Vim: + :help dos + :help msdos + :help win32 diff --git a/runtime/tutor/README_mac.txt b/runtime/tutor/README_mac.txt new file mode 100644 index 0000000000..796ad01622 --- /dev/null +++ b/runtime/tutor/README_mac.txt @@ -0,0 +1,8 @@ +README_mac.txt for version 7.2a of Vim: Vi IMproved. + +This file explains the installation of Vim on Macintosh systems. +See "README.txt" for general information about Vim. + + +Sorry, this text still needs to be written! + diff --git a/runtime/tutor/runtime.info b/runtime/tutor/runtime.info Binary files differnew file mode 100755 index 0000000000..6ff0468eab --- /dev/null +++ b/runtime/tutor/runtime.info diff --git a/runtime/tutor/runtime/evim.vim b/runtime/tutor/runtime/evim.vim new file mode 100644 index 0000000000..754729048e --- /dev/null +++ b/runtime/tutor/runtime/evim.vim @@ -0,0 +1,66 @@ +" Vim script for Evim key bindings +" Maintainer: Bram Moolenaar <Bram@vim.org> +" Last Change: 2006 Mar 29 + +" Don't use Vi-compatible mode. +set nocompatible + +" Use the mswin.vim script for most mappings +source <sfile>:p:h/mswin.vim + +" Vim is in Insert mode by default +set insertmode + +" Make a buffer hidden when editing another one +set hidden + +" Make cursor keys ignore wrapping +inoremap <Down> <C-R>=pumvisible() ? "\<lt>Down>" : "\<lt>C-O>gj"<CR> +inoremap <Up> <C-R>=pumvisible() ? "\<lt>Up>" : "\<lt>C-O>gk"<CR> + +" CTRL-F does Find dialog instead of page forward +noremap <C-F> :promptfind<CR> +vnoremap <C-F> y:promptfind <C-R>"<CR> +onoremap <C-F> <C-C>:promptfind<CR> +inoremap <C-F> <C-O>:promptfind<CR> +cnoremap <C-F> <C-C>:promptfind<CR> + + +set backspace=2 " allow backspacing over everything in insert mode +set autoindent " always set autoindenting on +if has("vms") + set nobackup " do not keep a backup file, use versions instead +else + set backup " keep a backup file +endif +set history=50 " keep 50 lines of command line history +set ruler " show the cursor position all the time +set incsearch " do incremental searching +set mouse=a " always use the mouse + +" Don't use Ex mode, use Q for formatting +map Q gq + +" Switch syntax highlighting on, when the terminal has colors +" Highlight the last used search pattern on the next search command. +if &t_Co > 2 || has("gui_running") + syntax on + set hlsearch + nohlsearch +endif + +" Only do this part when compiled with support for autocommands. +if has("autocmd") + + " Enable file type detection. + " Use the default filetype settings, so that mail gets 'tw' set to 72, + " 'cindent' is on in C files, etc. + " Also load indent files, to automatically do language-dependent indenting. + filetype plugin indent on + + " For all text files set 'textwidth' to 78 characters. + au FileType text setlocal tw=78 + +endif " has("autocmd") + +" vim: set sw=2 : diff --git a/runtime/tutor/runtime/gvimrc_example.vim b/runtime/tutor/runtime/gvimrc_example.vim new file mode 100644 index 0000000000..5a5197e99a --- /dev/null +++ b/runtime/tutor/runtime/gvimrc_example.vim @@ -0,0 +1,59 @@ +" An example for a gvimrc file. +" The commands in this are executed when the GUI is started. +" +" Maintainer: Bram Moolenaar <Bram@vim.org> +" Last change: 2001 Sep 02 +" +" To use it, copy it to +" for Unix and OS/2: ~/.gvimrc +" for Amiga: s:.gvimrc +" for MS-DOS and Win32: $VIM\_gvimrc +" for OpenVMS: sys$login:.gvimrc + +" Make external commands work through a pipe instead of a pseudo-tty +"set noguipty + +" set the X11 font to use +" set guifont=-misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-1 + +set ch=2 " Make command line two lines high + +set mousehide " Hide the mouse when typing text + +" Make shift-insert work like in Xterm +map <S-Insert> <MiddleMouse> +map! <S-Insert> <MiddleMouse> + +" Only do this for Vim version 5.0 and later. +if version >= 500 + + " I like highlighting strings inside C comments + let c_comment_strings=1 + + " Switch on syntax highlighting if it wasn't on yet. + if !exists("syntax_on") + syntax on + endif + + " Switch on search pattern highlighting. + set hlsearch + + " For Win32 version, have "K" lookup the keyword in a help file + "if has("win32") + " let winhelpfile='windows.hlp' + " map K :execute "!start winhlp32 -k <cword> " . winhelpfile <CR> + "endif + + " Set nice colors + " background for normal text is light grey + " Text below the last line is darker grey + " Cursor is green, Cyan when ":lmap" mappings are active + " Constants are not underlined but have a slightly lighter background + highlight Normal guibg=grey90 + highlight Cursor guibg=Green guifg=NONE + highlight lCursor guibg=Cyan guifg=NONE + highlight NonText guibg=grey80 + highlight Constant gui=NONE guibg=grey95 + highlight Special gui=NONE guibg=grey95 + +endif diff --git a/runtime/tutor/runtime/icons.info b/runtime/tutor/runtime/icons.info Binary files differnew file mode 100644 index 0000000000..566bc5663d --- /dev/null +++ b/runtime/tutor/runtime/icons.info diff --git a/runtime/tutor/runtime/scripts.vim b/runtime/tutor/runtime/scripts.vim new file mode 100644 index 0000000000..936f508e79 --- /dev/null +++ b/runtime/tutor/runtime/scripts.vim @@ -0,0 +1,351 @@ +" Vim support file to detect file types in scripts +" +" Maintainer: Bram Moolenaar <Bram@vim.org> +" Last change: 2008 Apr 28 + +" This file is called by an autocommand for every file that has just been +" loaded into a buffer. It checks if the type of file can be recognized by +" the file contents. The autocommand is in $VIMRUNTIME/filetype.vim. + + +" Only do the rest when the FileType autocommand has not been triggered yet. +if did_filetype() + finish +endif + +" Load the user defined scripts file first +" Only do this when the FileType autocommand has not been triggered yet +if exists("myscriptsfile") && filereadable(expand(myscriptsfile)) + execute "source " . myscriptsfile + if did_filetype() + finish + endif +endif + +" Line continuation is used here, remove 'C' from 'cpoptions' +let s:cpo_save = &cpo +set cpo&vim + +let s:line1 = getline(1) + +if s:line1 =~ "^#!" + " A script that starts with "#!". + + " Check for a line like "#!/usr/bin/env VAR=val bash". Turn it into + " "#!/usr/bin/bash" to make matching easier. + if s:line1 =~ '^#!\s*\S*\<env\s' + let s:line1 = substitute(s:line1, '\S\+=\S\+', '', 'g') + let s:line1 = substitute(s:line1, '\<env\s\+', '', '') + endif + + " Get the program name. + " Only accept spaces in PC style paths: "#!c:/program files/perl [args]". + " If the word env is used, use the first word after the space: + " "#!/usr/bin/env perl [path/args]" + " If there is no path use the first word: "#!perl [path/args]". + " Otherwise get the last word after a slash: "#!/usr/bin/perl [path/args]". + if s:line1 =~ '^#!\s*\a:[/\\]' + let s:name = substitute(s:line1, '^#!.*[/\\]\(\i\+\).*', '\1', '') + elseif s:line1 =~ '^#!.*\<env\>' + let s:name = substitute(s:line1, '^#!.*\<env\>\s\+\(\i\+\).*', '\1', '') + elseif s:line1 =~ '^#!\s*[^/\\ ]*\>\([^/\\]\|$\)' + let s:name = substitute(s:line1, '^#!\s*\([^/\\ ]*\>\).*', '\1', '') + else + let s:name = substitute(s:line1, '^#!\s*\S*[/\\]\(\i\+\).*', '\1', '') + endif + + " tcl scripts may have #!/bin/sh in the first line and "exec wish" in the + " third line. Suggested by Steven Atkinson. + if getline(3) =~ '^exec wish' + let s:name = 'wish' + endif + + " Bourne-like shell scripts: bash bash2 ksh ksh93 sh + if s:name =~ '^\(bash\d*\|\|ksh\d*\|sh\)\>' + call SetFileTypeSH(s:line1) " defined in filetype.vim + + " csh scripts + elseif s:name =~ '^csh\>' + if exists("g:filetype_csh") + call SetFileTypeShell(g:filetype_csh) + else + call SetFileTypeShell("csh") + endif + + " tcsh scripts + elseif s:name =~ '^tcsh\>' + call SetFileTypeShell("tcsh") + + " Z shell scripts + elseif s:name =~ '^zsh\>' + set ft=zsh + + " TCL scripts + elseif s:name =~ '^\(tclsh\|wish\|expectk\|itclsh\|itkwish\)\>' + set ft=tcl + + " Expect scripts + elseif s:name =~ '^expect\>' + set ft=expect + + " Gnuplot scripts + elseif s:name =~ '^gnuplot\>' + set ft=gnuplot + + " Makefiles + elseif s:name =~ 'make\>' + set ft=make + + " Lua + elseif s:name =~ 'lua' + set ft=lua + + " Perl + elseif s:name =~ 'perl' + set ft=perl + + " PHP + elseif s:name =~ 'php' + set ft=php + + " Python + elseif s:name =~ 'python' + set ft=python + + " Groovy + elseif s:name =~ '^groovy\>' + set ft=groovy + + " Ruby + elseif s:name =~ 'ruby' + set ft=ruby + + " BC calculator + elseif s:name =~ '^bc\>' + set ft=bc + + " sed + elseif s:name =~ 'sed\>' + set ft=sed + + " OCaml-scripts + elseif s:name =~ 'ocaml' + set ft=ocaml + + " Awk scripts + elseif s:name =~ 'awk\>' + set ft=awk + + " Website MetaLanguage + elseif s:name =~ 'wml' + set ft=wml + + " Scheme scripts + elseif s:name =~ 'scheme' + set ft=scheme + + " CFEngine scripts + elseif s:name =~ 'cfengine' + set ft=cfengine + + endif + unlet s:name + +else + " File does not start with "#!". + + let s:line2 = getline(2) + let s:line3 = getline(3) + let s:line4 = getline(4) + let s:line5 = getline(5) + + " Bourne-like shell scripts: sh ksh bash bash2 + if s:line1 =~ '^:$' + call SetFileTypeSH(s:line1) " defined in filetype.vim + + " Z shell scripts + elseif s:line1 =~ '^#compdef\>' || s:line1 =~ '^#autoload\>' + set ft=zsh + + " ELM Mail files + elseif s:line1 =~ '^From [a-zA-Z][a-zA-Z_0-9\.=-]*\(@[^ ]*\)\= .*[12][09]\d\d$' + set ft=mail + + " Mason + elseif s:line1 =~ '^<[%&].*>' + set ft=mason + + " Vim scripts (must have '" vim' as the first line to trigger this) + elseif s:line1 =~ '^" *[vV]im$' + set ft=vim + + " MOO + elseif s:line1 =~ '^\*\* LambdaMOO Database, Format Version \%([1-3]\>\)\@!\d\+ \*\*$' + set ft=moo + + " Diff file: + " - "diff" in first line (context diff) + " - "Only in " in first line + " - "--- " in first line and "+++ " in second line (unified diff). + " - "*** " in first line and "--- " in second line (context diff). + " - "# It was generated by makepatch " in the second line (makepatch diff). + " - "Index: <filename>" in the first line (CVS file) + " - "=== ", line of "=", "---", "+++ " (SVK diff) + " - "=== ", "--- ", "+++ " (bzr diff, common case) + " - "=== (removed|added|renamed|modified)" (bzr diff, alternative) + elseif s:line1 =~ '^\(diff\>\|Only in \|\d\+\(,\d\+\)\=[cda]\d\+\>\|# It was generated by makepatch \|Index:\s\+\f\+\r\=$\|===== \f\+ \d\+\.\d\+ vs edited\|==== //\f\+#\d\+\)' + \ || (s:line1 =~ '^--- ' && s:line2 =~ '^+++ ') + \ || (s:line1 =~ '^\* looking for ' && s:line2 =~ '^\* comparing to ') + \ || (s:line1 =~ '^\*\*\* ' && s:line2 =~ '^--- ') + \ || (s:line1 =~ '^=== ' && ((s:line2 =~ '^=\{66\}' && s:line3 =~ '^--- ' && s:line4 =~ '^+++') || (s:line2 =~ '^--- ' && s:line3 =~ '^+++ '))) + \ || (s:line1 =~ '^=== \(removed\|added\|renamed\|modified\)') + set ft=diff + + " PostScript Files (must have %!PS as the first line, like a2ps output) + elseif s:line1 =~ '^%![ \t]*PS' + set ft=postscr + + " M4 scripts: Guess there is a line that starts with "dnl". + elseif s:line1 =~ '^\s*dnl\>' + \ || s:line2 =~ '^\s*dnl\>' + \ || s:line3 =~ '^\s*dnl\>' + \ || s:line4 =~ '^\s*dnl\>' + \ || s:line5 =~ '^\s*dnl\>' + set ft=m4 + + " AmigaDos scripts + elseif $TERM == "amiga" + \ && (s:line1 =~ "^;" || s:line1 =~ '^\.[bB][rR][aA]') + set ft=amiga + + " SiCAD scripts (must have procn or procd as the first line to trigger this) + elseif s:line1 =~? '^ *proc[nd] *$' + set ft=sicad + + " Purify log files start with "**** Purify" + elseif s:line1 =~ '^\*\*\*\* Purify' + set ft=purifylog + + " XML + elseif s:line1 =~ '<?\s*xml.*?>' + set ft=xml + + " XHTML (e.g.: PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN") + elseif s:line1 =~ '\<DTD\s\+XHTML\s' + set ft=xhtml + + " PDF + elseif s:line1 =~ '^%PDF-' + set ft=pdf + + " XXD output + elseif s:line1 =~ '^\x\{7}: \x\{2} \=\x\{2} \=\x\{2} \=\x\{2} ' + set ft=xxd + + " RCS/CVS log output + elseif s:line1 =~ '^RCS file:' || s:line2 =~ '^RCS file:' + set ft=rcslog + + " CVS commit + elseif s:line2 =~ '^CVS:' || getline("$") =~ '^CVS: ' + set ft=cvs + + " Prescribe + elseif s:line1 =~ '^!R!' + set ft=prescribe + + " Send-pr + elseif s:line1 =~ '^SEND-PR:' + set ft=sendpr + + " SNNS files + elseif s:line1 =~ '^SNNS network definition file' + set ft=snnsnet + elseif s:line1 =~ '^SNNS pattern definition file' + set ft=snnspat + elseif s:line1 =~ '^SNNS result file' + set ft=snnsres + + " Virata + elseif s:line1 =~ '^%.\{-}[Vv]irata' + \ || s:line2 =~ '^%.\{-}[Vv]irata' + \ || s:line3 =~ '^%.\{-}[Vv]irata' + \ || s:line4 =~ '^%.\{-}[Vv]irata' + \ || s:line5 =~ '^%.\{-}[Vv]irata' + set ft=virata + + " Strace + elseif s:line1 =~ '^[0-9]* *execve(' + set ft=strace + + " VSE JCL + elseif s:line1 =~ '^\* $$ JOB\>' || s:line1 =~ '^// *JOB\>' + set ft=vsejcl + + " TAK and SINDA + elseif s:line4 =~ 'K & K Associates' || s:line2 =~ 'TAK 2000' + set ft=takout + elseif s:line3 =~ 'S Y S T E M S I M P R O V E D ' + set ft=sindaout + elseif getline(6) =~ 'Run Date: ' + set ft=takcmp + elseif getline(9) =~ 'Node File 1' + set ft=sindacmp + + " DNS zone files + elseif s:line1.s:line2.s:line3.s:line4 =~ '^; <<>> DiG [0-9.]\+ <<>>\|BIND.*named\|$ORIGIN\|$TTL\|IN\s\+SOA' + set ft=bindzone + + " BAAN + elseif s:line1 =~ '|\*\{1,80}' && s:line2 =~ 'VRC ' + \ || s:line2 =~ '|\*\{1,80}' && s:line3 =~ 'VRC ' + set ft=baan + + " Valgrind + elseif s:line1 =~ '^==\d\+== valgrind' || s:line3 =~ '^==\d\+== Using valgrind' + set ft=valgrind + + " Renderman Interface Bytestream + elseif s:line1 =~ '^##RenderMan' + set ft=rib + + " Scheme scripts + elseif s:line1 =~ 'exec\s\+\S*scheme' || s:line2 =~ 'exec\s\+\S*scheme' + set ft=scheme + + " Git output + elseif s:line1 =~ '^\(commit\|tree\|object\) \x\{40\}$\|^tag \S\+$' + set ft=git + + " CVS diff + else + let lnum = 1 + while getline(lnum) =~ "^? " && lnum < line("$") + let lnum = lnum + 1 + endwhile + if getline(lnum) =~ '^Index:\s\+\f\+$' + set ft=diff + + " locale input files: Formal Definitions of Cultural Conventions + " filename must be like en_US, fr_FR@euro or en_US.UTF-8 + elseif expand("%") =~ '\a\a_\a\a\($\|[.@]\)\|i18n$\|POSIX$\|translit_' + let lnum = 1 + while lnum < 100 && lnum < line("$") + if getline(lnum) =~ '^LC_\(IDENTIFICATION\|CTYPE\|COLLATE\|MONETARY\|NUMERIC\|TIME\|MESSAGES\|PAPER\|TELEPHONE\|MEASUREMENT\|NAME\|ADDRESS\)$' + setf fdcc + break + endif + let lnum = lnum + 1 + endwhile + endif + + endif + + unlet s:line2 s:line3 s:line4 s:line5 + +endif + +" Restore 'cpoptions' +let &cpo = s:cpo_save + +unlet s:cpo_save s:line1 diff --git a/runtime/tutor/runtime/synmenu.vim b/runtime/tutor/runtime/synmenu.vim new file mode 100644 index 0000000000..68a841e25d --- /dev/null +++ b/runtime/tutor/runtime/synmenu.vim @@ -0,0 +1,569 @@ +" Vim support file to define the syntax selection menu +" This file is normally sourced from menu.vim. +" +" Maintainer: Bram Moolenaar <Bram@vim.org> +" Last Change: 2006 Apr 27 + +" Define the SetSyn function, used for the Syntax menu entries. +" Set 'filetype' and also 'syntax' if it is manually selected. +fun! SetSyn(name) + if a:name == "fvwm1" + let use_fvwm_1 = 1 + let use_fvwm_2 = 0 + let name = "fvwm" + elseif a:name == "fvwm2" + let use_fvwm_2 = 1 + let use_fvwm_1 = 0 + let name = "fvwm" + else + let name = a:name + endif + if !exists("s:syntax_menu_synonly") + exe "set ft=" . name + if exists("g:syntax_manual") + exe "set syn=" . name + endif + else + exe "set syn=" . name + endif +endfun + +" <> notation is used here, remove '<' from 'cpoptions' +let s:cpo_save = &cpo +set cpo&vim + +" The following menu items are generated by makemenu.vim. +" The Start Of The Syntax Menu + +an 50.10.100 &Syntax.AB.A2ps\ config :cal SetSyn("a2ps")<CR> +an 50.10.110 &Syntax.AB.Aap :cal SetSyn("aap")<CR> +an 50.10.120 &Syntax.AB.ABAP/4 :cal SetSyn("abap")<CR> +an 50.10.130 &Syntax.AB.Abaqus :cal SetSyn("abaqus")<CR> +an 50.10.140 &Syntax.AB.ABC\ music\ notation :cal SetSyn("abc")<CR> +an 50.10.150 &Syntax.AB.ABEL :cal SetSyn("abel")<CR> +an 50.10.160 &Syntax.AB.AceDB\ model :cal SetSyn("acedb")<CR> +an 50.10.170 &Syntax.AB.Ada :cal SetSyn("ada")<CR> +an 50.10.180 &Syntax.AB.AfLex :cal SetSyn("aflex")<CR> +an 50.10.190 &Syntax.AB.ALSA\ config :cal SetSyn("alsaconf")<CR> +an 50.10.200 &Syntax.AB.Altera\ AHDL :cal SetSyn("ahdl")<CR> +an 50.10.210 &Syntax.AB.Amiga\ DOS :cal SetSyn("amiga")<CR> +an 50.10.220 &Syntax.AB.AMPL :cal SetSyn("ampl")<CR> +an 50.10.230 &Syntax.AB.Ant\ build\ file :cal SetSyn("ant")<CR> +an 50.10.240 &Syntax.AB.ANTLR :cal SetSyn("antlr")<CR> +an 50.10.250 &Syntax.AB.Apache\ config :cal SetSyn("apache")<CR> +an 50.10.260 &Syntax.AB.Apache-style\ config :cal SetSyn("apachestyle")<CR> +an 50.10.270 &Syntax.AB.Applix\ ELF :cal SetSyn("elf")<CR> +an 50.10.280 &Syntax.AB.Arc\ Macro\ Language :cal SetSyn("aml")<CR> +an 50.10.290 &Syntax.AB.Arch\ inventory :cal SetSyn("arch")<CR> +an 50.10.300 &Syntax.AB.ART :cal SetSyn("art")<CR> +an 50.10.310 &Syntax.AB.ASP\ with\ VBScript :cal SetSyn("aspvbs")<CR> +an 50.10.320 &Syntax.AB.ASP\ with\ Perl :cal SetSyn("aspperl")<CR> +an 50.10.330 &Syntax.AB.Assembly.680x0 :cal SetSyn("asm68k")<CR> +an 50.10.340 &Syntax.AB.Assembly.Flat :cal SetSyn("fasm")<CR> +an 50.10.350 &Syntax.AB.Assembly.GNU :cal SetSyn("asm")<CR> +an 50.10.360 &Syntax.AB.Assembly.GNU\ H-8300 :cal SetSyn("asmh8300")<CR> +an 50.10.370 &Syntax.AB.Assembly.Intel\ IA-64 :cal SetSyn("ia64")<CR> +an 50.10.380 &Syntax.AB.Assembly.Microsoft :cal SetSyn("masm")<CR> +an 50.10.390 &Syntax.AB.Assembly.Netwide :cal SetSyn("nasm")<CR> +an 50.10.400 &Syntax.AB.Assembly.PIC :cal SetSyn("pic")<CR> +an 50.10.410 &Syntax.AB.Assembly.Turbo :cal SetSyn("tasm")<CR> +an 50.10.420 &Syntax.AB.Assembly.VAX\ Macro\ Assembly :cal SetSyn("vmasm")<CR> +an 50.10.430 &Syntax.AB.Assembly.Z-80 :cal SetSyn("z8a")<CR> +an 50.10.440 &Syntax.AB.Assembly.xa\ 6502\ cross\ assember :cal SetSyn("a65")<CR> +an 50.10.450 &Syntax.AB.ASN\.1 :cal SetSyn("asn")<CR> +an 50.10.460 &Syntax.AB.Asterisk\ config :cal SetSyn("asterisk")<CR> +an 50.10.470 &Syntax.AB.Asterisk\ voicemail\ config :cal SetSyn("asteriskvm")<CR> +an 50.10.480 &Syntax.AB.Atlas :cal SetSyn("atlas")<CR> +an 50.10.490 &Syntax.AB.AutoHotKey :cal SetSyn("autohotkey")<CR> +an 50.10.500 &Syntax.AB.AutoIt :cal SetSyn("autoit")<CR> +an 50.10.510 &Syntax.AB.Automake :cal SetSyn("automake")<CR> +an 50.10.520 &Syntax.AB.Avenue :cal SetSyn("ave")<CR> +an 50.10.530 &Syntax.AB.Awk :cal SetSyn("awk")<CR> +an 50.10.540 &Syntax.AB.AYacc :cal SetSyn("ayacc")<CR> +an 50.10.560 &Syntax.AB.B :cal SetSyn("b")<CR> +an 50.10.570 &Syntax.AB.Baan :cal SetSyn("baan")<CR> +an 50.10.580 &Syntax.AB.Basic.FreeBasic :cal SetSyn("freebasic")<CR> +an 50.10.590 &Syntax.AB.Basic.IBasic :cal SetSyn("ibasic")<CR> +an |