diff options
author | Bram Moolenaar <Bram@vim.org> | 2008-06-24 21:56:24 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2008-06-24 21:56:24 +0000 |
commit | 446cb837a017fc1c1b144cb5c2a35cb90abfbbcf (patch) | |
tree | 6c1fe56f2db8d4adbeee792b181b0659c4d1f216 /runtime/tutor | |
parent | 3577c6fafb77da5419cd1001dac56f204d480bdc (diff) |
updated for version 7.2a
Diffstat (limited to 'runtime/tutor')
-rw-r--r-- | runtime/tutor/README.el.cp737.txt | 24 | ||||
-rw-r--r-- | runtime/tutor/README.el.txt | 24 | ||||
-rwxr-xr-x | runtime/tutor/README.txt.info | bin | 738 -> 582 bytes | |||
-rw-r--r-- | runtime/tutor/README_amibin.txt | 12 | ||||
-rw-r--r-- | runtime/tutor/README_extra.txt | 61 | ||||
-rw-r--r-- | runtime/tutor/README_ole.txt | 20 | ||||
-rwxr-xr-x | runtime/tutor/runtime/doc.info | bin | 0 -> 624 bytes | |||
-rw-r--r-- | runtime/tutor/runtime/ftplugin.vim | 35 | ||||
-rw-r--r-- | runtime/tutor/runtime/ftplugof.vim | 11 | ||||
-rw-r--r-- | runtime/tutor/runtime/hi16-action-make.png | bin | 0 -> 454 bytes | |||
-rw-r--r-- | runtime/tutor/runtime/menu.vim | 1105 | ||||
-rw-r--r-- | runtime/tutor/runtime/rgb.txt | 753 | ||||
-rwxr-xr-x | runtime/tutor/runtime/tutor.info | bin | 0 -> 624 bytes | |||
-rw-r--r-- | runtime/tutor/runtime/vim16x16.gif | bin | 0 -> 166 bytes | |||
-rw-r--r-- | runtime/tutor/runtime/vim32x32.gif | bin | 0 -> 298 bytes | |||
-rw-r--r-- | runtime/tutor/tutor.no.utf-8 | 973 | ||||
-rw-r--r-- | runtime/tutor/tutor.vim | 75 |
17 files changed, 3060 insertions, 33 deletions
diff --git a/runtime/tutor/README.el.cp737.txt b/runtime/tutor/README.el.cp737.txt new file mode 100644 index 0000000000..426f929c6f --- /dev/null +++ b/runtime/tutor/README.el.cp737.txt @@ -0,0 +1,24 @@ + Tutor 夘 "" 㚞 ⦬ 㩫 +ᡫ Vim. + + 櫜 ⦠ 㩫 驦 櫜 + 騘. ⢜ 夘 櫠 嫜 ᤜ +嘪 ⤦ 餫 ᡫ Vim. + + Tutor 夘 ⤘ ⮜ 㣘 . +嫜 ⩜ "vim tutor" 㩜 +圪 㣘. 㣘 礜 㩜 + , . + + 穫 Unix 嫜 婞 㩜 暨 "vimtutor". + 㩜 高 ⤘ 殜 嚨 tutor. + + 櫜 ਞ⤘ 㣘 + 嫞 椦. 驫 ⢘ 墜 + 㧦 驜 ᤜ. + +Bob Ware, Colorado School of Mines, Golden, Co 80401, USA +(303) 273-3987 +bware@mines.colorado.edu bware@slate.mines.colorado.edu bware@mines.bitnet + +[ 㟞 Vim Bram Moolenaar] diff --git a/runtime/tutor/README.el.txt b/runtime/tutor/README.el.txt new file mode 100644 index 0000000000..b2f5e07466 --- /dev/null +++ b/runtime/tutor/README.el.txt @@ -0,0 +1,24 @@ + Tutor "" + Vim. + + + . + Vim. + + Tutor . + "vim tutor" + . + , . + + Unix "vimtutor". + tutor. + + + . + . + +Bob Ware, Colorado School of Mines, Golden, Co 80401, USA +(303) 273-3987 +bware@mines.colorado.edu bware@slate.mines.colorado.edu bware@mines.bitnet + +[ Vim Bram Moolenaar] diff --git a/runtime/tutor/README.txt.info b/runtime/tutor/README.txt.info Binary files differindex 238b11fa95..e7fa114944 100755 --- a/runtime/tutor/README.txt.info +++ b/runtime/tutor/README.txt.info diff --git a/runtime/tutor/README_amibin.txt b/runtime/tutor/README_amibin.txt new file mode 100644 index 0000000000..24b9ef2e1c --- /dev/null +++ b/runtime/tutor/README_amibin.txt @@ -0,0 +1,12 @@ +README_amibin.txt for version 7.2a of Vim: Vi IMproved. + +See "README.txt" for general information about Vim. +See "README_ami.txt" for installation instructions for the Amiga. +These files are in the runtime archive (vim60rt.tgz). + + +The Amiga "bin" archive contains the Vim executable for the Amiga. It was +compiled with "big" features. + +Postscript printing is not included to avoid requiring floating point +computations. diff --git a/runtime/tutor/README_extra.txt b/runtime/tutor/README_extra.txt new file mode 100644 index 0000000000..660b502daf --- /dev/null +++ b/runtime/tutor/README_extra.txt @@ -0,0 +1,61 @@ +README_extra.txt for version 7.2a of Vim: Vi IMproved. + +The extra archive of Vim is to be used in combination with the source archive +(vim-7.0-src.tar.gz). The extra archive is useless without it. + +For more information, see the "README.txt" file that comes with the runtime +archive (vim-7.0-rt.tar.gz). To be able to run Vim you MUST get the runtime +archive too! + +The extra archive plus the source and runtime achives make up the complete +sources of Vim for all systems. + + +Some of the things that the extra archive contains: + +Farsi Files for the Farsi (persian) language. If you don't know + what Farsi is, this is not for you. + +if_sniff Interface to SNiFF. If you don't know what SNiFF is, this is + not for you. + +os_amiga Files for the Amiga port. + +gui_riscos +os_riscos Files for the RISC OS port. + +gui_beos +os_beos Files for the BeOS port. + +os_msdos +os_dos Files for the MS-DOS port. + +gui_mac +os_mac Files for the Mac port. + +os_mint Files for the Atari Mint port. + +os_os2 Files for the OS/2 port. +tee Extra program for OS/2. + +os_vms Files for the VMS port. + +os_w32 +os_win32 Files for the Win32 port. + +gui_w32 Files for the Win32 GUI. +gui_w48 Files for the Win32 and Win16 GUI. +Make_mvc.mak MS Visual C++ makefile for the Win32 GUI. +rgb.txt File with color definitions for the Win32 GUI. + +if_ole OLE automation interface, for MS Windows 95 and NT. + +VisVim Integration of Win32 GUI with MS Visual Developer Studio. + +GvimExt DLL for the "Edit with Vim" context menu entry + +nsis NSIS script to build the self-installing MS-Windows exe + +*.man Preprocessed manual pages. + +file_select.vim Vim script to browse directories (Unix only). diff --git a/runtime/tutor/README_ole.txt b/runtime/tutor/README_ole.txt new file mode 100644 index 0000000000..8112136c5b --- /dev/null +++ b/runtime/tutor/README_ole.txt @@ -0,0 +1,20 @@ +README_ole.txt for version 7.2a of Vim: Vi IMproved. + +This archive contains gvim.exe with OLE interface and VisVim. +This version of gvim.exe can also load a number of interface dynamically (you +can optionally install the .dll files for each interface). +It is only for MS-Windows 95/98/ME/NT/2000/XP. + +Also see the README_bindos.txt, README_dos.txt and README.txt files. + +Be careful not to overwrite the OLE gvim.exe with the non-OLE gvim.exe when +unpacking another binary archive! Check the output of ":version": + Win32s - "MS-Windows 16/32 bit GUI version" + Win32 - "MS-Windows 32 bit GUI version" +Win32 with OLE - "MS-Windows 32 bit GUI version with OLE support" + +For further information, type this inside Vim: + :help if_ole + +Futhermore, this archive contains VISVIM.DLL. It can be used to integrate +the OLE gvim with Microsoft Visual Developer Studio. See VisVim/README.txt. diff --git a/runtime/tutor/runtime/doc.info b/runtime/tutor/runtime/doc.info Binary files differnew file mode 100755 index 0000000000..a836031ee0 --- /dev/null +++ b/runtime/tutor/runtime/doc.info diff --git a/runtime/tutor/runtime/ftplugin.vim b/runtime/tutor/runtime/ftplugin.vim new file mode 100644 index 0000000000..a434b9372b --- /dev/null +++ b/runtime/tutor/runtime/ftplugin.vim @@ -0,0 +1,35 @@ +" Vim support file to switch on loading plugins for file types +" +" Maintainer: Bram Moolenaar <Bram@vim.org> +" 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("<amatch>") + 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 diff --git a/runtime/tutor/runtime/ftplugof.vim b/runtime/tutor/runtime/ftplugof.vim new file mode 100644 index 0000000000..cd99ce05a2 --- /dev/null +++ b/runtime/tutor/runtime/ftplugof.vim @@ -0,0 +1,11 @@ +" Vim support file to switch off loading plugins for file types +" +" Maintainer: Bram Moolenaar <Bram@vim.org> +" Last Change: 2002 Apr 04 + +if exists("did_load_ftplugin") + unlet did_load_ftplugin +endif + +" Remove all autocommands in the filetypeplugin group +silent! au! filetypeplugin * diff --git a/runtime/tutor/runtime/hi16-action-make.png b/runtime/tutor/runtime/hi16-action-make.png Binary files differnew file mode 100644 index 0000000000..824c7580e4 --- /dev/null +++ b/runtime/tutor/runtime/hi16-action-make.png diff --git a/runtime/tutor/runtime/menu.vim b/runtime/tutor/runtime/menu.vim new file mode 100644 index 0000000000..d120ce293b --- /dev/null +++ b/runtime/tutor/runtime/menu.vim @@ -0,0 +1,1105 @@ +" Vim support file to define the default menus +" You can also use this as a start for your own set of menus. +" +" Maintainer: Bram Moolenaar <Bram@vim.org> +" Last Change: 2008 Jun 16 + +" Note that ":an" (short for ":anoremenu") is often used to make a menu work +" in all modes and avoid side effects from mappings defined by the user. + +" Make sure the '<' and 'C' flags are not included in 'cpoptions', otherwise +" <CR> would not be recognized. See ":help 'cpoptions'". +let s:cpo_save = &cpo +set cpo&vim + +" Avoid installing the menus twice +if !exists("did_install_default_menus") +let did_install_default_menus = 1 + + +if exists("v:lang") || &langmenu != "" + " Try to find a menu translation file for the current language. + if &langmenu != "" + if &langmenu =~ "none" + let s:lang = "" + else + let s:lang = &langmenu + endif + else + let s:lang = v:lang + endif + " A language name must be at least two characters, don't accept "C" + if strlen(s:lang) > 1 + " When the language does not include the charset add 'encoding' + if s:lang =~ '^\a\a$\|^\a\a_\a\a$' + let s:lang = s:lang . '.' . &enc + endif + + " We always use a lowercase name. + " Change "iso-8859" to "iso_8859" and "iso8859" to "iso_8859", some + " systems appear to use this. + " Change spaces to underscores. + let s:lang = substitute(tolower(s:lang), '\.iso-', ".iso_", "") + let s:lang = substitute(s:lang, '\.iso8859', ".iso_8859", "") + let s:lang = substitute(s:lang, " ", "_", "g") + " Remove "@euro", otherwise "LC_ALL=de_DE@euro gvim" will show English menus + let s:lang = substitute(s:lang, "@euro", "", "") + " Change "iso_8859-1" and "iso_8859-15" to "latin1", we always use the + " same menu file for them. + let s:lang = substitute(s:lang, 'iso_8859-15\=$', "latin1", "") + menutrans clear + exe "runtime! lang/menu_" . s:lang . ".vim" + + if !exists("did_menu_trans") + " There is no exact match, try matching with a wildcard added + " (e.g. find menu_de_de.iso_8859-1.vim if s:lang == de_DE). + let s:lang = substitute(s:lang, '\.[^.]*', "", "") + exe "runtime! lang/menu_" . s:lang . "[^a-z]*vim" + + if !exists("did_menu_trans") && strlen($LANG) > 1 && s:lang !~ '^en_us' + " On windows locale names are complicated, try using $LANG, it might + " have been set by set_init_1(). But don't do this for "en" or "en_us". + " But don't match "slovak" when $LANG is "sl". + exe "runtime! lang/menu_" . tolower($LANG) . "[^a-z]*vim" + endif + endif + endif +endif + + +" Help menu +an 9999.10 &Help.&Overview<Tab><F1> :help<CR> +an 9999.20 &Help.&User\ Manual :help usr_toc<CR> +an 9999.30 &Help.&How-to\ links :help how-to<CR> +an <silent> 9999.40 &Help.&Find\.\.\. :call <SID>Helpfind()<CR> +an 9999.45 &Help.-sep1- <Nop> +an 9999.50 &Help.&Credits :help credits<CR> +an 9999.60 &Help.Co&pying :help copying<CR> +an 9999.70 &Help.&Sponsor/Register :help sponsor<CR> +an 9999.70 &Help.O&rphans :help kcc<CR> +an 9999.75 &Help.-sep2- <Nop> +an 9999.80 &Help.&Version :version<CR> +an 9999.90 &Help.&About :intro<CR> + +fun! s:Helpfind() + if !exists("g:menutrans_help_dialog") + let g:menutrans_help_dialog = "Enter a command or word to find help on:\n\nPrepend i_ for Input mode commands (e.g.: i_CTRL-X)\nPrepend c_ for command-line editing commands (e.g.: c_<Del>)\nPrepend ' for an option name (e.g.: 'shiftwidth')" + endif + let h = inputdialog(g:menutrans_help_dialog) + if h != "" + let v:errmsg = "" + silent! exe "help " . h + if v:errmsg != "" + echo v:errmsg + endif + endif +endfun + +" File menu +an 10.310 &File.&Open\.\.\.<Tab>:e :browse confirm e<CR> +an 10.320 &File.Sp&lit-Open\.\.\.<Tab>:sp :browse sp<CR> +an 10.320 &File.Open\ Tab\.\.\.<Tab>:tabnew :browse tabnew<CR> +an 10.325 &File.&New<Tab>:enew :confirm enew<CR> +an <silent> 10.330 &File.&Close<Tab>:close + \ :if winheight(2) < 0 <Bar> + \ confirm enew <Bar> + \ else <Bar> + \ confirm close <Bar> + \ endif<CR> +an 10.335 &File.-SEP1- <Nop> +an <silent> 10.340 &File.&Save<Tab>:w :if expand("%") == ""<Bar>browse confirm w<Bar>else<Bar>confirm w<Bar>endif<CR> +an 10.350 &File.Save\ &As\.\.\.<Tab>:sav :browse confirm saveas<CR> + +if has("diff") + an 10.400 &File.-SEP2- <Nop> + an 10.410 &File.Split\ &Diff\ with\.\.\. :browse vert diffsplit<CR> + an 10.420 &File.Split\ Patched\ &By\.\.\. :browse vert diffpatch<CR> +endif + +if has("printer") + an 10.500 &File.-SEP3- <Nop> + an 10.510 &File.&Print :hardcopy<CR> + vunmenu &File.&Print + vnoremenu &File.&Print :hardcopy<CR> +elseif has("unix") + an 10.500 &File.-SEP3- <Nop> + an 10.510 &File.&Print :w !lpr<CR> + vunmenu &File.&Print + vnoremenu &File.&Print :w !lpr<CR> +endif +an 10.600 &File.-SEP4- <Nop> +an 10.610 &File.Sa&ve-Exit<Tab>:wqa :confirm wqa<CR> +an 10.620 &File.E&xit<Tab>:qa :confirm qa<CR> + +func! <SID>SelectAll() + exe "norm gg" . (&slm == "" ? "VG" : "gH\<C-O>G") +endfunc + +func! s:FnameEscape(fname) + if exists('*fnameescape') + return fnameescape(a:fname) + return escape(a:fname, " \t\n*?[{`$\\%#'\"|!<") +endfunc + +" Edit menu +an 20.310 &Edit.&Undo<Tab>u u +an 20.320 &Edit.&Redo<Tab>^R <C-R> +an 20.330 &Edit.Rep&eat<Tab>\. . + +an 20.335 &Edit.-SEP1- <Nop> +vnoremenu 20.340 &Edit.Cu&t<Tab>"+x "+x +vnoremenu 20.350 &Edit.&Copy<Tab>"+y "+y +cnoremenu 20.350 &Edit.&Copy<Tab>"+y <C-Y> +nnoremenu 20.360 &Edit.&Paste<Tab>"+gP "+gP +cnoremenu &Edit.&Paste<Tab>"+gP <C-R>+ +exe 'vnoremenu <script> &Edit.&Paste<Tab>"+gP ' . paste#paste_cmd['v'] +exe 'inoremenu <script> &Edit.&Paste<Tab>"+gP ' . paste#paste_cmd['i'] +nnoremenu 20.370 &Edit.Put\ &Before<Tab>[p [p +inoremenu &Edit.Put\ &Before<Tab>[p <C-O>[p +nnoremenu 20.380 &Edit.Put\ &After<Tab>]p ]p +inoremenu &Edit.Put\ &After<Tab>]p <C-O>]p +if has("win32") || has("win16") + vnoremenu 20.390 &Edit.&Delete<Tab>x x +endif +noremenu <script> <silent> 20.400 &Edit.&Select\ All<Tab>ggVG :<C-U>call <SID>SelectAll()<CR> +inoremenu <script> <silent> 20.400 &Edit.&Select\ All<Tab>ggVG <C-O>:call <SID>SelectAll()<CR> +cnoremenu <script> <silent> 20.400 &Edit.&Select\ All<Tab>ggVG <C-U>call <SID>SelectAll()<CR> + +an 20.405 &Edit.-SEP2- <Nop> +if has("win32") || has("win16") || has("gui_gtk") || has("gui_kde") || has("gui_motif") + an 20.410 &Edit.&Find\.\.\. :promptfind<CR> + vunmenu &Edit.&Find\.\.\. + vnoremenu <silent> &Edit.&Find\.\.\. y:promptfind <C-R>=<SID>FixFText()<CR><CR> + an 20.420 &Edit.Find\ and\ Rep&lace\.\.\. :promptrepl<CR> + vunmenu &Edit.Find\ and\ Rep&lace\.\.\. + vnoremenu <silent> &Edit.Find\ and\ Rep&lace\.\.\. y:promptrepl <C-R>=<SID>FixFText()<CR><CR> +else + an 20.410 &Edit.&Find<Tab>/ / + an 20.420 &Edit.Find\ and\ Rep&lace<Tab>:%s :%s/ + vunmenu &Edit.Find\ and\ Rep&lace<Tab>:%s + vnoremenu &Edit.Find\ and\ Rep&lace<Tab>:s :s/ +endif + +an 20.425 &Edit.-SEP3- <Nop> +an 20.430 &Edit.Settings\ &Window :options<CR> +an 20.435 &Edit.Startup\ &Settings :call <SID>EditVimrc()<CR> + +fun! s:EditVimrc() + if $MYVIMRC != '' + let fname = "$MYVIMRC" + elseif has("win32") || has("dos32") || has("dos16") || has("os2") + if $HOME != '' + let fname = "$HOME/_vimrc" + else + let fname = "$VIM/_vimrc" + endif + elseif has("amiga") + let fname = "s:.vimrc" + else + let fname = "$HOME/.vimrc" + endif + let fname = s:FnameEscape(fname) + if &mod + exe "split " . fname + else + exe "edit " . fname + endif +endfun + +fun! s:FixFText() + " Fix text in nameless register to be used with :promptfind. + return substitute(@", "[\r\n]", '\\n', 'g') +endfun + +" Edit/Global Settings +an 20.440.100 &Edit.&Global\ Settings.Toggle\ Pattern\ &Highlight<Tab>:set\ hls! :set hls! hls?<CR> +an 20.440.110 &Edit.&Global\ Settings.Toggle\ &Ignore-case<Tab>:set\ ic! :set ic! ic?<CR> +an 20.440.110 &Edit.&Global\ Settings.Toggle\ &Showmatch<Tab>:set\ sm! :set sm! sm?<CR> + +an 20.440.120 &Edit.&Global\ Settings.&Context\ lines.\ 1\ :set so=1<CR> +an 20.440.120 &Edit.&Global\ Settings.&Context\ lines.\ 2\ :set so=2<CR> +an 20.440.120 &Edit.&Global\ Settings.&Context\ lines.\ 3\ :set so=3<CR> +an 20.440.120 &Edit.&Global\ Settings.&Context\ lines.\ 4\ :set so=4<CR> +an 20.440.120 &Edit.&Global\ Settings.&Context\ lines.\ 5\ :set so=5<CR> +an 20.440.120 &Edit.&Global\ Settings.&Context\ lines.\ 7\ :set so=7<CR> +an 20.440.120 &Edit.&Global\ Settings.&Context\ lines.\ 10\ :set so=10<CR> +an 20.440.120 &Edit.&Global\ Settings.&Context\ lines.\ 100\ :set so=100<CR> + +an 20.440.130.40 &Edit.&Global\ Settings.&Virtual\ Edit.Never :set ve=<CR> +an 20.440.130.50 &Edit.&Global\ Settings.&Virtual\ Edit.Block\ Selection :set ve=block<CR> +an 20.440.130.60 &Edit.&Global\ Settings.&Virtual\ Edit.Insert\ mode :set ve=insert<CR> +an 20.440.130.70 &Edit.&Global\ Settings.&Virtual\ Edit.Block\ and\ Insert :set ve=block,insert<CR> +an 20.440.130.80 &Edit.&Global\ Settings.&Virtual\ Edit.Always :set ve=all<CR> +an 20.440.140 &Edit.&Global\ Settings.Toggle\ Insert\ &Mode<Tab>:set\ im! :set im!<CR> +an 20.440.145 &Edit.&Global\ Settings.Toggle\ Vi\ C&ompatible<Tab>:set\ cp! :set cp!<CR> +an <silent> 20.440.150 &Edit.&Global\ Settings.Search\ &Path\.\.\. :call <SID>SearchP()<CR> +an <silent> 20.440.160 &Edit.&Global\ Settings.Ta&g\ Files\.\.\. :call <SID>TagFiles()<CR> +" +" GUI options +an 20.440.300 &Edit.&Global\ Settings.-SEP1- <Nop> +an <silent> 20.440.310 &Edit.&Global\ Settings.Toggle\ &Toolbar :call <SID>ToggleGuiOption("T")<CR> +an <silent> 20.440.320 &Edit.&Global\ Settings.Toggle\ &Bottom\ Scrollbar :call <SID>ToggleGuiOption("b")<CR> +an <silent> 20.440.330 &Edit.&Global\ Settings.Toggle\ &Left\ Scrollbar :call <SID>ToggleGuiOption("l")<CR> +an <silent> 20.440.340 &Edit.&Global\ Settings.Toggle\ &Right\ Scrollbar :call <SID>ToggleGuiOption("r")<CR> + +fun! s:SearchP() + if !exists("g:menutrans_path_dialog") + let g:menutrans_path_dialog = "Enter search path for files.\nSeparate directory names with a comma." + endif + let n = inputdialog(g:menutrans_path_dialog, substitute(&path, '\\ ', ' ', 'g')) + if n != "" + let &path = substitute(n, ' ', '\\ ', 'g') + endif +endfun + +fun! s:TagFiles() + if !exists("g:menutrans_tags_dialog") + let g:menutrans_tags_dialog = "Enter names of tag files.\nSeparate the names with a comma." + endif + let n = inputdialog(g:menutrans_tags_dialog, substitute(&tags, '\\ ', ' ', 'g')) + if n != "" + let &tags = substitute(n, ' ', '\\ ', 'g') + endif +endfun + +fun! s:ToggleGuiOption(option) + " If a:option is already set in guioptions, then we want to remove it + if match(&guioptions, "\\C" . a:option) > -1 + exec "set go-=" . a:option + else + exec "set go+=" . a:option + endif +endfun + +" Edit/File Settings + +" Boolean options +an 20.440.100 &Edit.F&ile\ Settings.Toggle\ Line\ &Numbering<Tab>:set\ nu! :set nu! nu?<CR> +an 20.440.110 &Edit.F&ile\ Settings.Toggle\ &List\ Mode<Tab>:set\ list! :set list! list?<CR> +an 20.440.120 &Edit.F&ile\ Settings.Toggle\ Line\ &Wrap<Tab>:set\ wrap! :set wrap! wrap?<CR> +an 20.440.130 &Edit.F&ile\ Settings.Toggle\ W&rap\ at\ word<Tab>:set\ lbr! :set lbr! lbr?<CR> +an 20.440.160 &Edit.F&ile\ Settings.Toggle\ &expand-tab<Tab>:set\ et! :set et! et?<CR> +an 20.440.170 &Edit.F&ile\ Settings.Toggle\ &auto-indent<Tab>:set\ ai! :set ai! ai?<CR> +an 20.440.180 &Edit.F&ile\ Settings.Toggle\ &C-indenting<Tab>:set\ cin! :set cin! cin?<CR> + +" other options +an 20.440.600 &Edit.F&ile\ Settings.-SEP2- <Nop> +an 20.440.610.20 &Edit.F&ile\ Settings.&Shiftwidth.2 :set sw=2 sw?<CR> +an 20.440.610.30 &Edit.F&ile\ Settings.&Shiftwidth.3 :set sw=3 sw?<CR> +an 20.440.610.40 &Edit.F&ile\ Settings.&Shiftwidth.4 :set sw=4 sw?<CR> +an 20.440.610.50 &Edit.F&ile\ Settings.&Shiftwidth.5 :set sw=5 sw?<CR> +an 20.440.610.60 &Edit.F&ile\ Settings.&Shiftwidth.6 :set sw=6 sw?<CR> +an 20.440.610.80 &Edit.F&ile\ Settings.&Shiftwidth.8 :set sw=8 sw?<CR> + +an 20.440.620.20 &Edit.F&ile\ Settings.Soft\ &Tabstop.2 :set sts=2 sts?<CR> +an 20.440.620.30 &Edit.F&ile\ Settings.Soft\ &Tabstop.3 :set sts=3 sts?<CR> +an 20.440.620.40 &Edit.F&ile\ Settings.Soft\ &Tabstop.4 :set sts=4 sts?<CR> +an 20.440.620.50 &Edit.F&ile\ Settings.Soft\ &Tabstop.5 :set sts=5 sts?<CR> +an 20.440.620.60 &Edit.F&ile\ Settings.Soft\ &Tabstop.6 :set sts=6 sts?<CR> +an 20.440.620.80 &Edit.F&ile\ Settings.Soft\ &Tabstop.8 :set sts=8 sts?<CR> + +an <silent> 20.440.630 &Edit.F&ile\ Settings.Te&xt\ Width\.\.\. :call <SID>TextWidth()<CR> +an <silent> 20.440.640 &Edit.F&ile\ Settings.&File\ Format\.\.\. :call <SID>FileFormat()<CR> +fun! s:TextWidth() + if !exists("g:menutrans_textwidth_dialog") + let g:menutrans_textwidth_dialog = "Enter new text width (0 to disable formatting): " + endif + let n = inputdialog(g:menutrans_textwidth_dialog, &tw) + if n != "" + " remove leading zeros to avoid it being used as an octal number + let &tw = substitute(n, "^0*", "", "") + endif +endfun + +fun! s:FileFormat() + if !exists("g:menutrans_fileformat_dialog") + let g:menutrans_fileformat_dialog = "Select format for writing the file" + endif + if !exists("g:menutrans_fileformat_choices") + let g:menutrans_fileformat_choices = "&Unix\n&Dos\n&Mac\n&Cancel" + endif + if &ff == "dos" + let def = 2 + elseif &ff == "mac" + let def = 3 + else + let def = 1 + endif + let n = confirm(g:menutrans_fileformat_dialog, g:menutrans_fileformat_choices, def, "Question") + if n == 1 + set ff=unix + elseif n == 2 + set ff=dos + elseif n == 3 + set ff=mac + endif +endfun + +" Setup the Edit.Color Scheme submenu +let s:n = globpath(&runtimepath, "colors/*.vim") +let s:idx = 100 +while strlen(s:n) > 0 + let s:i = stridx(s:n, "\n") + if s:i < 0 + let s:name = s:n + let s:n = "" + else + let s:name = strpart(s:n, 0, s:i) + let s:n = strpart(s:n, s:i + 1, 19999) + endif + " Ignore case for VMS and windows + let s:name = substitute(s:name, '\c.*[/\\:\]]\([^/\\:]*\)\.vim', '\1', '') + exe "an 20.450." . s:idx . ' &Edit.C&olor\ Scheme.' . s:name . " :colors " . s:name . "<CR>" + unlet s:name + unlet s:i + let s:idx = s:idx + 10 +endwhile +unlet s:n +unlet s:idx + +" Setup the Edit.Keymap submenu +if has("keymap") + let s:n = globpath(&runtimepath, "keymap/*.vim") + if s:n != "" + let s:idx = 100 + an 20.460.90 &Edit.&Keymap.None :set keymap=<CR> + while strlen(s:n) > 0 + let s:i = stridx(s:n, "\n") + if s:i < 0 + let s:name = s:n + let s:n = "" + else + let s:name = strpart(s:n, 0, s:i) + let s:n = strpart(s:n, s:i + 1, 19999) + endif + " Ignore case for VMS and windows + let s:name = substitute(s:name, '\c.*[/\\:\]]\([^/\\:_]*\)\(_[0-9a-zA-Z-]*\)\=\.vim', '\1', '') + exe "an 20.460." . s:idx . ' &Edit.&Keymap.' . s:name . " :set keymap=" . s:name . "<CR>" + unlet s:name + unlet s:i + let s:idx = s:idx + 10 + endwhile + unlet s:idx + endif + unlet s:n +endif +if has("win32") || has("win16") || has("gui_motif") || has("gui_gtk") || has("gui_kde") || has("gui_photon") || has("gui_mac") + an 20.470 &Edit.Select\ Fo&nt\.\.\. :set guifont=*<CR> +endif + +" Programming menu +if !exists("g:ctags_command") + if has("vms") + let g:ctags_command = "mc vim:ctags *.*" + else + let g:ctags_command = "ctags -R ." + endif +endif + +an 40.300 &Tools.&Jump\ to\ this\ tag<Tab>g^] g<C-]> +vunmenu &Tools.&Jump\ to\ this\ tag<Tab>g^] +vnoremenu &Tools.&Jump\ to\ this\ tag<Tab>g^] g<C-]> +an 40.310 &Tools.Jump\ &back<Tab>^T <C-T> +an 40.320 &Tools.Build\ &Tags\ File :exe "!" . g:ctags_command<CR> + +if has("folding") || has("spell") + an 40.330 &Tools.-SEP1- <Nop> +endif + +" Tools.Spelling Menu +if has("spell") + an 40.335.110 &Tools.&Spelling.&Spell\ Check\ On :set spell<CR> + an 40.335.120 &Tools.&Spelling.Spell\ Check\ &Off :set nospell<CR> + an 40.335.130 &Tools.&Spelling.To\ &Next\ error<Tab>]s ]s + an 40.335.130 &Tools.&Spelling.To\ &Previous\ error<Tab>[s [s + an 40.335.140 &Tools.&Spelling.Suggest\ &Corrections<Tab>z= z= + an 40.335.150 &Tools.&Spelling.&Repeat\ correction<Tab>:spellrepall :spellrepall<CR> + an 40.335.200 &Tools.&Spelling.-SEP1- <Nop> + an 40.335.210 &Tools.&Spelling.Set\ language\ to\ "en" :set spl=en spell<CR> + an 40.335.220 &Tools.&Spelling.Set\ language\ to\ "en_au" :set spl=en_au spell<CR> + an 40.335.230 &Tools.&Spelling.Set\ language\ to\ "en_ca" :set spl=en_ca spell<CR> + an 40.335.240 &Tools.&Spelling.Set\ language\ to\ "en_gb" :set spl=en_gb spell<CR> + an 40.335.250 &Tools.&Spelling.Set\ language\ to\ "en_nz" :set spl=en_nz spell<CR> + an 40.335.260 &Tools.&Spelling.Set\ language\ to\ "en_us" :set spl=en_us spell<CR> + an <silent> 40.335.270 &Tools.&Spelling.&Find\ More\ Languages :call <SID>SpellLang()<CR> + + let s:undo_spellang = ['aun &Tools.&Spelling.&Find\ More\ Languages'] + func! s:SpellLang() + for cmd in s:undo_spellang + exe "silent! " . cmd + endfor + let s:undo_spellang = [] + + if &enc == "iso-8859-15" + let enc = "latin1" + else + let enc = &enc + endif + + let found = 0 + let s = globpath(&rtp, "spell/*." . enc . ".spl") + if s != "" + let n = 300 + for f in split(s, "\n") + let nm = substitute(f, '.*spell[/\\]\(..\)\.[^/\\]*\.spl', '\1', "") + if nm != "en" && nm !~ '/' + let found += 1 + let menuname = '&Tools.&Spelling.Set\ language\ to\ "' . nm . '"' + exe 'an 40.335.' . n . ' ' . menuname . ' :set spl=' . nm . ' spell<CR>' + let s:undo_spellang += ['aun ' . menuname] + endif + let n += 10 + endfor + endif + if found == 0 + echomsg "Could not find other spell files" + elseif found == 1 + echomsg "Found spell file " . nm + else + echomsg "Found " . found . " more spell files" + endif + " Need to redo this when 'encoding' is changed. + augroup spellmenu + au! EncodingChanged * call <SID>SpellLang() + augroup END + endfun + +endif + +" Tools.Fold Menu +if has("folding") + " open close folds + an 40.340.110 &Tools.&Folding.&Enable/Disable\ folds<Tab>zi zi + an 40.340.120 &Tools.&Folding.&View\ Cursor\ Line<Tab>zv zv + an 40.340.120 &Tools.&Folding.Vie&w\ Cursor\ Line\ only<Tab>zMzx zMzx + an 40.340.130 &Tools.&Folding.C&lose\ more\ folds<Tab>zm zm + an 40.340.140 &Tools.&Folding.&Close\ all\ folds<Tab>zM zM + an 40.340.150 &Tools.&Folding.O&pen\ more\ folds<Tab>zr zr + an 40.340.160 &Tools.&Folding.&Open\ all\ folds<Tab>zR zR + " fold method + an 40.340.200 &Tools.&Folding.-SEP1- <Nop> + an 40.340.210 &Tools.&Folding.Fold\ Met&hod.M&anual :set fdm=manual<CR> + an 40.340.210 &Tools.&Folding.Fold\ Met&hod.I&ndent :set fdm=indent<CR> + an 40.340.210 &Tools.&Folding.Fold\ Met&hod.E&xpression :set fdm=expr<CR> + an 40.340.210 &Tools.&Folding.Fold\ Met&hod.S&yntax :set fdm=syntax<CR> + an 40.340.210 &Tools.&Folding.Fold\ Met&hod.&Diff :set fdm=diff<CR> + an 40.340.210 &Tools.&Folding.Fold\ Met&hod.Ma&rker :set fdm=marker<CR> + " create and delete folds + vnoremenu 40.340.220 &Tools.&Folding.Create\ &Fold<Tab>zf zf + an 40.340.230 &Tools.&Folding.&Delete\ Fold<Tab>zd zd + an 40.340.240 &Tools.&Folding.Delete\ &All\ Folds<Tab>zD zD + " moving around in folds + an 40.340.300 &Tools.&Folding.-SEP2- <Nop> + an 40.340.310.10 &Tools.&Folding.Fold\ col&umn\ width.\ &0\ :set fdc=0<CR> + an 40.340.310.20 &Tools.&Folding.Fold\ col&umn\ width.\ &2\ :set fdc=2<CR> + an 40.340.310.30 &Tools.&Folding.Fold\ col&umn\ width.\ &3\ :set fdc=3<CR> + an 40.340.310.40 &Tools.&Folding.Fold\ col&umn\ width.\ &4\ :set fdc=4<CR> + an 40.340.310.50 &Tools.&Folding.Fold\ col&umn\ width.\ &5\ :set fdc=5<CR> + an 40.340.310.60 &Tools.&Folding.Fold\ col&umn\ width.\ &6\ :set fdc=6<CR> + an 40.340.310.70 &Tools.&Folding.Fold\ col&umn\ width.\ &7\ :set fdc=7<CR> + an 40.340.310.80 &Tools.&Folding.Fold\ col&umn\ width.\ &8\ :set fdc=8<CR> +endif " has folding + +if has("diff") + an 40.350.100 &Tools.&Diff.&Update :diffupdate<CR> + an 40.350.110 &Tools.&Diff.&Get\ Block :diffget<CR> + vunmenu &Tools.&Diff.&Get\ Block + vnoremenu &Tools.&Diff.&Get\ Block :diffget<CR> + an 40.350.120 &Tools.&Diff.&Put\ Block :diffput<CR> + vunmenu &Tools.&Diff.&Put\ Block + vnoremenu &Tools.&Diff.&Put\ Block :diffput<CR> +endif + +an 40.358 &Tools.-SEP2- <Nop> +an 40.360 &Tools.&Make<Tab>:make :make<CR> +an 40.370 &Tools.&List\ Errors<Tab>:cl :cl<CR> +an 40.380 &Tools.L&ist\ Messages<Tab>:cl! :cl!<CR> +an 40.390 &Tools.&Next\ Error<Tab>:cn :cn<CR> +an 40.400 &Tools.&Previous\ Error<Tab>:cp :cp<CR> +an 40.410 &Tools.&Older\ List<Tab>:cold :colder<CR> +an 40.420 &Tools.N&ewer\ List<Tab>:cnew :cnewer<CR> +an 40.430.50 &Tools.Error\ &Window.&Update<Tab>:cwin :cwin<CR> +an 40.430.60 &Tools.Error\ &Window.&Open<Tab>:copen :copen<CR> +an 40.430.70 &Tools.Error\ &Window.&Close<Tab>:cclose :cclose<CR> + +an 40.520 &Tools.-SEP3- <Nop> +an <silent> 40.530 &Tools.&Convert\ to\ HEX<Tab>:%!xxd + \ :call <SID>XxdConv()<CR> +an <silent> 40.540 &Tools.Conve&rt\ back<Tab>:%!xxd\ -r + \ :call <SID>XxdBack()<CR> + +" Use a function to do the conversion, so that it also works with 'insertmode' +" set. +func! s:XxdConv() + let mod = &mod + if has("vms") + %!mc vim:xxd + else + call s:XxdFind() + exe '%!"' . g:xxdprogram . '"' + endif + if getline(1) =~ "^0000000:" " only if it worked + set ft=xxd + endif + let &mod = mod +endfun + +func! s:XxdBack() + let mod = &mod + if has("vms") + %!mc vim:xxd -r + else + call s:XxdFind() + exe '%!"' . g:xxdprogram . '" -r' + endif + set ft= + doautocmd filetypedetect BufReadPost + let &mod = mod +endfun + +func! s:XxdFind() + if !exists("g:xxdprogram") + " On the PC xxd may not be in the path but in the install directory + if (has("win32") || has("dos32")) && !executable("xxd") |