home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / mac / vim54rt.sit / runtime / menu.vim < prev    next >
Encoding:
Text File  |  1999-08-14  |  20.3 KB  |  662 lines  |  [TEXT/ALFA]

  1. " These menu commands create the default Vim menus.
  2. " You can also use this as a start for your own set of menus.
  3. " Note that ":amenu" is often used to make a menu work in all modes.
  4. "
  5. " Maintainer:    Bram Moolenaar <Bram@vim.org>
  6. " Last change:    1999 Jul 27
  7.  
  8. " Make sure the '<' flag is not included in 'cpoptions', otherwise <CR> would
  9. " not be recognized.  See ":help 'cpoptions'".
  10. let menu_cpo_save = &cpo
  11. let &cpo = ""
  12.  
  13. " Avoid installing the menus twice
  14. if !exists("did_install_default_menus")
  15. let did_install_default_menus = 1
  16.  
  17. " Help menu
  18. amenu 9999.10 &Help.&Overview<Tab><F1>        :help<CR>
  19. amenu 9999.20 &Help.&How-to\ links        :help how-to<CR>
  20. amenu 9999.30 &Help.&GUI            :help gui<CR>
  21. amenu 9999.40 &Help.&Credits            :help credits<CR>
  22. amenu 9999.50 &Help.Co&pying            :help uganda<CR>
  23. amenu 9999.55 &Help.-sep-            <nul>
  24. amenu 9999.60 &Help.&Version            :version<CR>
  25. amenu 9999.70 &Help.&About            :intro<CR>
  26.  
  27. " File menu
  28. amenu 10.310 &File.&Open\.\.\.<Tab>:e        :browse confirm e<CR>
  29. amenu 10.320 &File.Sp&lit-Open\.\.\.<Tab>:sp    :browse sp<CR>
  30. amenu 10.330 &File.&Close<Tab>:q        :confirm q<CR>
  31. amenu 10.335 &File.-SEP1-            :
  32. amenu 10.340 &File.&Save<Tab>:w            :confirm w<CR>
  33. amenu 10.350 &File.Save\ &As\.\.\.<Tab>:w    :browse confirm w<CR>
  34. amenu 10.355 &File.-SEP2-            :
  35. if has("win32")
  36. " Use Notepad for printing. ":w >> prn" doesn't work for PostScript printers.
  37.   amenu 10.360 &File.&Print :let smod=&mod<Bar>:let ttt=tempname()<Bar>
  38.     \exec ":w! ".ttt<Bar>let &mod=smod<Bar>exec "!notepad /p ".ttt<Bar>
  39.     \exec "!del ".ttt<CR>
  40.   vunmenu &File.&Print
  41.   vmenu &File.&Print <Esc>:let smod=&mod<Bar>:let ttt=tempname()<Bar>
  42.     \exec ":'<,'>w! ".ttt<Bar>let &mod=smod<Bar>exec "!notepad /p ".ttt<Bar>
  43.     \exec "!del ".ttt<CR>
  44. elseif has("unix")
  45.   amenu 10.360 &File.&Print            :w !lpr<CR>
  46.   vunmenu &File.&Print
  47.   vmenu &File.&Print                :w !lpr<CR>
  48. endif
  49. amenu 10.365 &File.-SEP3-            :
  50. amenu 10.370 &File.Sa&ve-Exit<Tab>:wqa        :confirm wqa<CR>
  51. amenu 10.380 &File.E&xit<Tab>:qa        :confirm qa<CR>
  52.  
  53.  
  54. " Edit menu
  55. amenu 20.310 &Edit.&Undo<Tab>u            u
  56. amenu 20.320 &Edit.&Redo<Tab>Ctrl+R        <C-R>
  57. amenu 20.330 &Edit.Repea&t<Tab>\.        .
  58. amenu 20.335 &Edit.-SEP1-            :
  59. vmenu 20.340 &Edit.Cu&t<Tab>"*x            "*x
  60. vmenu 20.350 &Edit.&Copy<Tab>"*y        "*y
  61. nmenu 20.360 &Edit.&Paste<Tab>"*p        "*p
  62. vmenu         &Edit.&Paste<Tab>"*p        "*P`]:if col(".")!=1<Bar>exe "norm l"<Bar>endif<CR>
  63. imenu         &Edit.&Paste<Tab>"*p        <Esc>:if col(".")!=1<Bar>exe 'norm "*p'<Bar>else<Bar>exe 'norm "*P'<Bar>endif<CR>`]a
  64. cmenu         &Edit.&Paste<Tab>"*p        <C-R>*
  65. nmenu 20.370 &Edit.Put\ &Before<Tab>[p        [p
  66. imenu         &Edit.Put\ &Before<Tab>[p        <C-O>[p
  67. nmenu 20.380 &Edit.Put\ &After<Tab>]p        ]p
  68. imenu         &Edit.Put\ &After<Tab>]p        <C-O>]p
  69. if has("win32")
  70.   vmenu 20.390 &Edit.&Delete<Tab>x        x
  71. endif
  72. amenu 20.400 &Edit.&Select\ all<Tab>ggvG    :if &slm != ""<Bar>exe ":norm gggH<C-O>G"<Bar>else<Bar>exe ":norm ggVG"<Bar>endif<CR>
  73. amenu 20.405 &Edit.-SEP2-            :
  74. if has("win32") || has("gui_gtk")
  75.   amenu 20.410 &Edit.&Find\.\.\.        :promptfind<CR>
  76.   amenu 20.420 &Edit.Find\ and\ R&eplace\.\.\.    :promptrepl<CR>
  77.   vunmenu      &Edit.Find\ and\ R&eplace\.\.\.
  78.   vmenu           &Edit.Find\ and\ R&eplace\.\.\.    y:promptrepl <C-R>"<CR>
  79. else
  80.   amenu 20.410 &Edit.&Find<Tab>/            /
  81.   amenu 20.420 &Edit.Find\ and\ R&eplace<Tab>:%s    :%s/
  82.   vunmenu      &Edit.Find\ and\ R&eplace
  83.   vmenu           &Edit.Find\ and\ R&eplace<Tab>:s        :s/
  84. endif
  85. amenu 20.425 &Edit.-SEP3-            :
  86. amenu 20.430 &Edit.Options\.\.\.        :options<CR>
  87.  
  88. " Programming menu
  89. amenu 40.300 &Tools.&Jump\ to\ this\ tag    g<C-]>
  90. vunmenu &Tools.&Jump\ to\ this\ tag
  91. vmenu &Tools.&Jump\ to\ this\ tag    g<C-]>
  92. amenu 40.310 &Tools.Jump\ &back            <C-T>
  93. amenu 40.320 &Tools.Build\ &Tags\ File        :!ctags -R .<CR>
  94. amenu 40.330 &Tools.-SEP1-            :
  95. amenu 40.340 &Tools.&Make            :make<CR>
  96. amenu 40.350 &Tools.&List\ Errors        :cl<CR>
  97. amenu 40.360 &Tools.L&ist\ Messages        :cl!<CR>
  98. amenu 40.370 &Tools.&Next\ Error        :cn<CR>
  99. amenu 40.380 &Tools.&Previous\ Error        :cp<CR>
  100. amenu 40.390 &Tools.&Older\ List        :colder<CR>
  101. amenu 40.400 &Tools.N&ewer\ List        :cnewer<CR>
  102.  
  103.  
  104. " Can't delete a menu in Athena version
  105. if has("gui_athena")
  106.   let no_buffers_menu = 1
  107. endif
  108.  
  109. if !exists("no_buffers_menu")
  110.  
  111. " Buffer list menu -- Setup functions & actions
  112.  
  113. " wait with building the menu until after loading 'session' files. Makes
  114. " startup faster.
  115. let bmenu_wait = 1
  116.  
  117. if !exists("bmenu_priority")
  118.     let bmenu_priority = 60
  119. endif
  120.  
  121. func! Bmenu_add()
  122.     if g:bmenu_wait == 0
  123.     call Menufilename(expand("<afile>"), expand("<abuf>"))
  124.     endif
  125. endfunc
  126.  
  127. func! Bmenu_remove()
  128.     if g:bmenu_wait == 0
  129.     let munge = Mungename(expand("<afile>"), expand("<abuf>"))
  130.  
  131.     if g:bmenu_short == 0
  132.         exe 'aun &Buffers.' . munge
  133.     else
  134.         exe 'aun &Buffers.' . Hash2(munge) . munge
  135.     endif
  136.     let g:bmenu_count = g:bmenu_count - 1
  137.     endif
  138. endfunc
  139.  
  140. " buffer menu stuff
  141. func! Bmenu(...)
  142.     let g:bmenu_wait = 1
  143.     let g:bmenu_short = 1
  144.     let g:bmenu_count = 0
  145.     if !exists('g:bmenu_cutoff')
  146.     let g:bmenu_cutoff = &lines / 2
  147.     endif
  148.     " remove old menu, if exists
  149.     exe g:bmenu_priority . 'am &Buffers.x x'
  150.     aun &Buffers
  151.  
  152.     " get new priority, if exists
  153.     if a:0 == 1
  154.     let g:bmenu_priority = a:1
  155.     endif
  156.  
  157.     " create new menu; make 'cpo' empty to include the <CR>
  158.     let cpo_save = &cpo
  159.     let &cpo = ""
  160.     exe 'am ' . g:bmenu_priority . ".2 &Buffers.Refresh :call Bmenu()<CR>"
  161.     exe 'am ' . g:bmenu_priority . ".4 &Buffers.Delete :bd<CR>"
  162.     exe 'am ' . g:bmenu_priority . ".6 &Buffers.Alternate :b #<CR>"
  163.     exe 'am ' . g:bmenu_priority . ".8 &Buffers.-SEP- :"
  164.     let &cpo = cpo_save
  165.  
  166.     " figure out how many buffers there are
  167.     let buf = 1
  168.     while buf <= bufnr('$')
  169.     if bufexists(buf)
  170.         let g:bmenu_count = g:bmenu_count + 1
  171.     endif
  172.     let buf = buf + 1
  173.     endwhile
  174.     if g:bmenu_count < g:bmenu_cutoff
  175.     let g:bmenu_short = 0
  176.     endif
  177.  
  178.     " iterate through buffer list, adding each buffer to the menu:
  179.     let buf = 1
  180.     while buf <= bufnr('$')
  181.     if bufexists(buf)
  182.         call Menufilename(bufname(buf), buf)
  183.     endif
  184.     let buf = buf + 1
  185.     endwhile
  186.     let g:bmenu_wait = 0
  187.     aug buffer_list
  188.     au!
  189.     au BufCreate,BufFilePost * call Bmenu_add()
  190.     au BufDelete,BufFilePre * call Bmenu_remove()
  191.     aug END
  192. endfunc
  193.  
  194. func! Hash(name)
  195.     " Make name all upper case, so that chars are between 32 and 96
  196.     let nm = substitute(a:name, ".*", '\U\0', "")
  197.     " convert first six chars into a number for sorting:
  198.     return (char2nr(nm[0]) - 32) * 0x1000000 + (char2nr(nm[1]) - 32) * 0x40000 + (char2nr(nm[2]) - 32) * 0x1000 + (char2nr(nm[3]) - 32) * 0x40 + (char2nr(nm[4]) - 32) * 0x40 + (char2nr(nm[5]) - 32)
  199. endfunc
  200.  
  201. func! Hash2(name)
  202.     let nm = substitute(a:name, ".", '\L\0', "")
  203.     if nm[0] >= 'a' && nm[0] <= 'd'
  204.     return '&abcd.'
  205.     elseif nm[0] >= 'e' && nm[0] <= 'h'
  206.     return '&efgh.'
  207.     elseif nm[0] >= 'i' && nm[0] <= 'l'
  208.     return '&ijkl.'
  209.     elseif nm[0] >= 'm' && nm[0] <= 'p'
  210.     return '&mnop.'
  211.     elseif nm[0] >= 'q' && nm[0] <= 't'
  212.     return '&qrst.'
  213.     elseif nm[0] >= 'u' && nm[0] <= 'z'
  214.     return '&u-z.'
  215.     else
  216.     return '&others.'
  217. endfunc
  218.  
  219. " take a buffer number, return a name to insert into a menu:
  220. func! Menufilename(name, num)
  221.     let munge = Mungename(a:name, a:num)
  222.     let hash = Hash(munge)
  223.     if g:bmenu_short == 0
  224.     let name = 'am ' . g:bmenu_priority . '.' . hash .' &Buffers.' . munge
  225.     else
  226.     let name = 'am ' . g:bmenu_priority . '.' . hash . '.' . hash .' &Buffers.' . Hash2(munge) . munge
  227.     endif
  228.     " make 'cpo' empty to include the <CR>
  229.     let cpo_save = &cpo
  230.     let &cpo = ""
  231.     exe name . ' :b' . a:num . '<CR>'
  232.     let &cpo = cpo_save
  233. endfunc
  234.  
  235. func! Mungename(fname, bnum)
  236.     let name = a:fname
  237.     if name == ''
  238.     let name = '[No File]'
  239.     endif
  240.     let name = fnamemodify(name, ':~')
  241.     if !isdirectory(a:fname)
  242.     " detach file name and separate it out:
  243.     let name2 = fnamemodify(name, ':t')
  244.     if a:bnum >= 0
  245.         let name2 = name2 . ' (' . a:bnum . ')'
  246.     endif
  247.     let name = name2 . "\t" . fnamemodify(name,':h')
  248.     endif
  249.     let name = escape(name, '\\.     |')
  250.     return name
  251. endfunc
  252.  
  253. " When just starting Vim, load the buffer menu later
  254. if has("vim_starting")
  255.     augroup LoadBufferMenu
  256.         au! VimEnter * if !exists("no_buffers_menu") | call Bmenu() | endif
  257.     au  VimEnter * au! LoadBufferMenu
  258.     augroup END
  259. else
  260.     call Bmenu()
  261. endif
  262.  
  263. endif " !exists("no_buffers_menu")
  264.  
  265. " Window menu
  266. amenu 70.300 &Window.&New        <C-W>n
  267. amenu 70.310 &Window.S&plit        <C-W>s
  268. amenu 70.320 &Window.Sp&lit\ To\ #    <C-W><C-^>
  269. amenu 70.325 &Window.-SEP1-        :
  270. amenu 70.330 &Window.&Close        :confirm close<CR>
  271. amenu 70.340 &Window.Close\ &Other(s)    :confirm only<CR>
  272. amenu 70.345 &Window.-SEP2-        :
  273. amenu 70.350 &Window.Ne&xt        <C-W>w
  274. amenu 70.360 &Window.P&revious        <C-W>W
  275. amenu 70.365 &Window.-SEP3-        :
  276. amenu 70.370 &Window.&Equal\ Height    <C-W>=
  277. amenu 70.380 &Window.&Max\ Height    <C-W>_
  278. amenu 70.390 &Window.M&in\ Height    <C-W>1_
  279. amenu 70.400 &Window.Rotate\ &Up    <C-W>R
  280. amenu 70.410 &Window.Rotate\ &Down    <C-W>r
  281. if has("win32") || has("gui_gtk")
  282.   amenu 70.420 &Window.-SEP4-        :
  283.   amenu 70.430 &Window.Select\ &Font\.\.\.    :set guifont=*<CR>
  284. endif
  285.  
  286. " The popup menu
  287. amenu 1.10 PopUp.&Undo        u
  288. amenu 1.15 PopUp.-SEP1-        :
  289. vmenu 1.20 PopUp.Cu&t        "*x
  290. vmenu 1.30 PopUp.&Copy        "*y
  291. nmenu 1.40 PopUp.&Paste        "*P`]:if col(".")!=1<Bar>exe "norm l"<Bar>endif<CR>
  292. vmenu      PopUp.&Paste        "-x"*P`]
  293. imenu      PopUp.&Paste        <Esc>:if col(".")!=1<Bar>exe 'norm "*p'<Bar>else<Bar>exe 'norm "*P'<Bar>endif<CR>`]a
  294. cmenu      PopUp.&Paste        <C-R>*
  295. vmenu 1.50 PopUp.&Delete    x
  296. amenu 1.55 PopUp.-SEP2-        :
  297. amenu 1.60 PopUp.Select\ &Word    vaw
  298. amenu 1.70 PopUp.Select\ &Line    V
  299. amenu 1.80 PopUp.Select\ &All    ggVG
  300.  
  301. " The GUI toolbar (for Win32 or GTK)
  302. if has("win32") || has("gui_gtk")
  303.   amenu 1.10 ToolBar.Open    :browse e<CR>
  304.   tmenu ToolBar.Open        Open file
  305.   amenu 1.20 ToolBar.Save    :w<CR>
  306.   tmenu ToolBar.Save        Save current file
  307.   amenu 1.30 ToolBar.SaveAll    :wa<CR>
  308.   tmenu ToolBar.SaveAll        Save all files
  309.  
  310.   if has("win32")
  311.     amenu 1.40 ToolBar.Print    :let smod=&mod<Bar>:let ttt=tempname()<Bar>exec ":w! ".ttt<Bar>let &mod=smod<Bar>exec "!notepad /p ".ttt<Bar>exec "!del ".ttt<CR>
  312.     vunmenu ToolBar.Print
  313.     vmenu ToolBar.Print        <Esc>:let smod=&mod<Bar>:let ttt=tempname()<Bar>exec ":'<,'>w! ".ttt<Bar>let &mod=smod<Bar>exec "!notepad /p ".ttt<Bar>exec "!del ".ttt<CR>
  314.   else
  315.     amenu 1.40 ToolBar.Print    :w !lpr<CR>
  316.     vunmenu ToolBar.Print
  317.     vmenu ToolBar.Print        <Esc>:w !lpr<CR>
  318.   endif
  319.   tmenu ToolBar.Print        Print
  320.  
  321.   amenu 1.45 ToolBar.-sep1-    <nul>
  322.   amenu 1.50 ToolBar.Undo    u
  323.   tmenu ToolBar.Undo        Undo
  324.   amenu 1.60 ToolBar.Redo    <C-R>
  325.   tmenu ToolBar.Redo        Redo
  326.  
  327.   amenu 1.65 ToolBar.-sep2-    <nul>
  328.   vmenu 1.70 ToolBar.Cut    "*x
  329.   tmenu ToolBar.Cut        Cut to clipboard
  330.   vmenu 1.80 ToolBar.Copy    "*y
  331.   tmenu ToolBar.Copy        Copy to clipboard
  332.   nmenu 1.90 ToolBar.Paste    i<C-R>*<Esc>
  333.   vmenu ToolBar.Paste        "-xi<C-R>*<Esc>
  334.   menu! ToolBar.Paste        <C-R>*
  335.   tmenu ToolBar.Paste        Paste from Clipboard
  336.  
  337.   amenu 1.95 ToolBar.-sep3-    <nul>
  338.   amenu 1.100 ToolBar.Find    :promptfind<CR>
  339.   tmenu ToolBar.Find        Find...
  340.   amenu 1.110 ToolBar.FindNext    n
  341.   tmenu ToolBar.FindNext    Find Next
  342.   amenu 1.120 ToolBar.FindPrev    N
  343.   tmenu ToolBar.FindPrev    Find Previous
  344.   amenu 1.130 ToolBar.Replace    :promptrepl<CR>
  345.   vunmenu ToolBar.Replace
  346.   vmenu ToolBar.Replace        y:promptrepl <C-R>"<CR>
  347.   tmenu ToolBar.Replace        Find && Replace...
  348.  
  349. if 0    " disabled; These are in the Windows menu
  350.   amenu 1.135 ToolBar.-sep4-    <nul>
  351.   amenu 1.140 ToolBar.New    <C-W>n
  352.   tmenu ToolBar.New        New Window
  353.   amenu 1.150 ToolBar.WinSplit    <C-W>s
  354.   tmenu ToolBar.WinSplit    Split Window
  355.   amenu 1.160 ToolBar.WinMax    :resize 200<CR>
  356.   tmenu ToolBar.WinMax        Maximise Window
  357.   amenu 1.170 ToolBar.WinMin    :resize 1<CR>
  358.   tmenu ToolBar.WinMin        Minimise Window
  359.   amenu 1.180 ToolBar.WinClose    :close<CR>
  360.   tmenu ToolBar.WinClose    Close Window
  361. endif
  362.  
  363.   amenu 1.185 ToolBar.-sep5-    <nul>
  364.   amenu 1.190 ToolBar.LoadSesn    :call LoadVimSesn()<CR>
  365.   tmenu ToolBar.LoadSesn    Load session
  366.   amenu 1.200 ToolBar.SaveSesn    :call SaveVimSesn()<CR>
  367.   tmenu ToolBar.SaveSesn    Save current session
  368.   amenu 1.210 ToolBar.RunScript    :browse so<CR>
  369.   tmenu ToolBar.RunScript    Run a Vim Script
  370.  
  371.   amenu 1.215 ToolBar.-sep6-    <nul>
  372.   amenu 1.220 ToolBar.Make    :make<CR>
  373.   tmenu ToolBar.Make        Make current project
  374.   amenu 1.230 ToolBar.Shell    :sh<CR>
  375.   tmenu ToolBar.Shell        Open a command shell
  376.   amenu 1.240 ToolBar.RunCtags    :!ctags -R .<CR>
  377.   tmenu ToolBar.RunCtags    Build tags in current directory tree
  378.   amenu 1.250 ToolBar.TagJump    g]
  379.   tmenu ToolBar.TagJump        Jump to tag under cursor
  380.  
  381.   amenu 1.265 ToolBar.-sep7-    <nul>
  382.   amenu 1.270 ToolBar.Help    :help<CR>
  383.   tmenu ToolBar.Help        Vim Help
  384.   if has("gui_gtk")
  385.     amenu 1.280 ToolBar.FindHelp :helpfind<CR>
  386.   else
  387.     amenu 1.280 ToolBar.FindHelp :help 
  388.   endif
  389.   tmenu ToolBar.FindHelp    Search Vim Help
  390.  
  391. " Select a session to load; default to current session name if present
  392. fun LoadVimSesn()
  393.   if exists("this_session")
  394.     let name = this_session
  395.   else
  396.     let name = "session.vim"
  397.   endif
  398.   execute "browse so " . name
  399. endfun
  400.  
  401. " Select a session to save; default to current session name if present
  402. fun SaveVimSesn()
  403.   if !exists("this_session")
  404.     let this_session = "session.vim"
  405.   endif
  406.   execute "browse mksession! " . this_session
  407. endfun
  408.  
  409. endif " has("win32") || has("gui_gtk")
  410.  
  411. endif " !exists("did_install_default_menus")
  412.  
  413. " Install the Syntax menu only when filetype.vim has been loaded or when
  414. " manual syntax highlighting is enabled.
  415. " Avoid installing the Syntax menu twice.
  416. if (exists("did_load_filetypes") || exists("syntax_on"))
  417.     \ && !exists("did_install_syntax_menu")
  418. let did_install_syntax_menu = 1
  419.  
  420. " Define the SetSyn function, used for the Syntax menu entries.
  421. " Set 'filetype' and also 'syntax' if it is manually selected.
  422. fun! SetSyn(name)
  423.   if !exists("g:syntax_menu_synonly")
  424.     exe "set ft=" . a:name
  425.     if exists("g:syntax_manual")
  426.       exe "set syn=" . a:name
  427.     endif
  428.   else
  429.     exe "set syn=" . a:name
  430.   endif
  431. endfun
  432.  
  433. " Use the SynMenu command and function to define all menu entries
  434. command -nargs=* SynMenu call SynMenu(<q-args>)
  435.  
  436. let current_menu_name = ""
  437. let current_menu_nr = 0
  438. let current_menu_item = 0
  439. let current_menu_char = ""
  440.  
  441. fun SynMenu(arg)
  442.   " isolate menu name: until the first dot
  443.   let i = match(a:arg, '\.')
  444.   let menu_name = strpart(a:arg, 0, i)
  445.   let r = strpart(a:arg, i + 1, 999)
  446.   " isolate submenu name: until the colon
  447.   let i = match(r, ":")
  448.   let submenu_name = strpart(r, 0, i)
  449.   " after the colon is the syntax name
  450.   let syntax_name = strpart(r, i + 1, 999)
  451.  
  452.   if g:current_menu_name != menu_name
  453.     let g:current_menu_name = menu_name
  454.     let g:current_menu_nr = g:current_menu_nr + 10
  455.     let g:current_menu_item = 100
  456.     let g:current_menu_char = submenu_name[0]
  457.   else
  458.     " When starting a new letter, insert a menu separator.
  459.     " Make an exception for "4DOS", which is after "MS-DOS".
  460.     let c = submenu_name[0]
  461.     if c != g:current_menu_char && c != "4"
  462.       exe 'am 50.' . g:current_menu_nr . '.' . g:current_menu_item . ' &Syntax.' . menu_name . ".-" . c . '- <nul>'
  463.       let g:current_menu_item = g:current_menu_item + 10
  464.       let g:current_menu_char = c
  465.     endif
  466.   endif
  467.   exe 'am 50.' . g:current_menu_nr . '.' . g:current_menu_item . ' &Syntax.' . menu_name . "." . submenu_name . ' :cal SetSyn("' . syntax_name . '")<CR>'
  468.   let g:current_menu_item = g:current_menu_item + 10
  469. endfun
  470.  
  471. SynMenu &ABCD.ABC:abc
  472. SynMenu &ABCD.Ada:ada
  473. SynMenu &ABCD.AHDL:ahdl
  474. SynMenu &ABCD.Amiga\ DOS:amiga
  475. SynMenu &ABCD.Applix\ ELF:elf
  476. SynMenu &ABCD.Assembly\ (GNU):asm
  477. SynMenu &ABCD.Assembly\ (H8300):asmh8300
  478. SynMenu &ABCD.ASN\.1:asn
  479. SynMenu &ABCD.Atlas:atlas
  480. SynMenu &ABCD.Avenue:ave
  481. SynMenu &ABCD.Awk:awk
  482. SynMenu &ABCD.BASIC:basic
  483. SynMenu &ABCD.BibFile:bib
  484. SynMenu &ABCD.C:c
  485. SynMenu &ABCD.C++:cpp
  486. SynMenu &ABCD.Cascading\ Style\ Sheets:css
  487. SynMenu &ABCD.Century\ Term:cterm
  488. SynMenu &ABCD.Clean:clean
  489. SynMenu &ABCD.Clipper:clipper
  490. SynMenu &ABCD.Configure\ script:config
  491. SynMenu &ABCD.Csh\ shell\ script:csh
  492. SynMenu &ABCD.Cobol:cobol
  493. SynMenu &ABCD.Diff:diff
  494. SynMenu &ABCD.Digital\ Command\ Lang:dcl
  495. SynMenu &ABCD.Diva\ (with\ SKILL):diva
  496. SynMenu &ABCD.Dracula:dracula
  497. SynMenu &ABCD.DTD:dtd
  498.  
  499. SynMenu &EFGHIJ.Eiffel:eiffel
  500. SynMenu &EFGHIJ.Elm\ Filter:elmfilt
  501. SynMenu &EFGHIJ.ESQL-C:esqlc
  502. SynMenu &EFGHIJ.Expect:expect
  503. SynMenu &EFGHIJ.Exports:exports
  504. SynMenu &EFGHIJ.Focus\ Executable:focexec
  505. SynMenu &EFGHIJ.Focus\ Master:master
  506. SynMenu &EFGHIJ.Forth:forth
  507. SynMenu &EFGHIJ.Fortran:fortran
  508. SynMenu &EFGHIJ.Fvwm\ configuration:fvwm
  509. SynMenu &EFGHIJ.GDB\ command\ file:gdb
  510. SynMenu &EFGHIJ.GDMO:gdmo
  511. SynMenu &EFGHIJ.GP:gp
  512. SynMenu &EFGHIJ.GNUplot:gnuplot
  513. SynMenu &EFGHIJ.Haskell:haskell
  514. SynMenu &EFGHIJ.Haskell-literal:lhaskell
  515. SynMenu &EFGHIJ.HTML:html
  516. SynMenu &EFGHIJ.HTML\ with\ M4:htmlm4
  517. SynMenu &EFGHIJ.IDL:idl
  518. SynMenu &EFGHIJ.Interactive\ Data\ Lang:idlang
  519. SynMenu &EFGHIJ.Inform:inform
  520. SynMenu &EFGHIJ.InstallShield\ Rules:ishd
  521. SynMenu &EFGHIJ.Java:java
  522. SynMenu &EFGHIJ.JavaCC:javacc
  523. SynMenu &EFGHIJ.JavaScript:javascript
  524. SynMenu &EFGHIJ.Jgraph:jgraph
  525.  
  526. SynMenu &KLM.Kimwitu:kwt
  527. SynMenu &KLM.Lace:lace
  528. SynMenu &KLM.Lex:lex
  529. SynMenu &KLM.Lilo:lilo
  530. SynMenu &KLM.Lisp:lisp
  531. SynMenu &KLM.Lite:lite
  532. SynMenu &KLM.LOTOS:lotos
  533. SynMenu &KLM.Lout:lout
  534. SynMenu &KLM.Lua:lua
  535. SynMenu &KLM.Lynx\ Style:lss
  536. SynMenu &KLM.M4:m4
  537. SynMenu &KLM.Mail:mail
  538. SynMenu &KLM.Makefile:make
  539. SynMenu &KLM.Man\ page:man
  540. SynMenu &KLM.Maple:maple
  541. SynMenu &KLM.Matlab:matlab
  542. SynMenu &KLM.Metafont:mf
  543. SynMenu &KLM.MetaPost:mp
  544. SynMenu &KLM.Model:model
  545. SynMenu &KLM.Modsim\ III:modsim3
  546. SynMenu &KLM.Modula\ 2:modula2
  547. SynMenu &KLM.Modula\ 3:modula3
  548. SynMenu &KLM.Msql:msql
  549. SynMenu &KLM.MS-DOS\ \.bat\ file:dosbatch
  550. SynMenu &KLM.4DOS\ \.bat\ file:btm
  551. SynMenu &KLM.MS-DOS\ \.ini\ file:dosini
  552. SynMenu &KLM.MS\ Resource\ file:rc
  553. SynMenu &KLM.Muttrc:muttrc
  554.  
  555. SynMenu &NOPQ.NASM:nasm
  556. SynMenu &NOPQ.Novell\ batch:ncf
  557. SynMenu &NOPQ.Nroff:nroff
  558. SynMenu &NOPQ.Objective\ C:objc
  559. SynMenu &NOPQ.OCAML:ocaml
  560. SynMenu &NOPQ.Open\ Psion\ Lang:opl
  561. SynMenu &NOPQ.Pascal:pascal
  562. SynMenu &NOPQ.PCCTS:pccts
  563. SynMenu &NOPQ.Perl:perl
  564. SynMenu &NOPQ.Perl\ POD:pod
  565. SynMenu &NOPQ.Perl\ XS:xs
  566. SynMenu &NOPQ.PHP\ 3:php3
  567. SynMenu &NOPQ.Phtml:phtml
  568. SynMenu &NOPQ.Pike:pike
  569. SynMenu &NOPQ.Pine\ RC:pine
  570. SynMenu &NOPQ.PL/SQL:plsql
  571. SynMenu &NOPQ.PO\ (GNU\ gettext):po
  572. SynMenu &NOPQ.PostScript:postscr
  573. SynMenu &NOPQ.Povray:pov
  574. SynMenu &NOPQ.Printcap:pcap
  575. SynMenu &NOPQ.Procmail:procmail
  576. SynMenu &NOPQ.Prolog:prolog
  577. SynMenu &NOPQ.Purify\ log:purifylog
  578. SynMenu &NOPQ.Python:python
  579.  
  580. SynMenu &RS.Radiance:radiance
  581. SynMenu &RS.Rebol:rebol
  582. SynMenu &RS.Renderman\ Shader\ Lang:sl
  583. SynMenu &RS.Rexx:rexx
  584. SynMenu &RS.Rpcgen:rpcgen
  585. SynMenu &RS.S-lang:slang
  586. SynMenu &RS.SAS:sas
  587. SynMenu &RS.Sather:sather
  588. SynMenu &RS.Scheme:scheme
  589. SynMenu &RS.SDL:sdl
  590. SynMenu &RS.Sed:sed
  591. SynMenu &RS.Sendmail\.cf:sm
  592. SynMenu &RS.SGML:sgml
  593. SynMenu &RS.Sh\ shell\ script:sh
  594. SynMenu &RS.SiCAD:sicad
  595. SynMenu &RS.Simula:simula
  596. SynMenu &RS.SKILL:skill
  597. SynMenu &RS.SLRN\ rc:slrnrc
  598. SynMenu &RS.SLRN\ score:slrnsc
  599. SynMenu &RS.SmallTalk:st
  600. SynMenu &RS.SMIL:smil
  601. SynMenu &RS.SNMP\ MIB:mib
  602. SynMenu &RS.SPEC\ (Linux\ RPM):spec
  603. SynMenu &RS.Speedup:spup
  604. SynMenu &RS.Squid:squid
  605. SynMenu &RS.SQL:sql
  606.  
  607. SynMenu &TU.Tags:tags
  608. SynMenu &TU.Tcl/Tk:tcl
  609. SynMenu &TU.Telix\ Salt:tsalt
  610. SynMenu &TU.Termcap:ptcap
  611. SynMenu &TU.Tex:tex
  612. SynMenu &TU.TF\ mud\ client:tf
  613. SynMenu &TU.UIT/UIL:uil
  614.  
  615. SynMenu &VWXYZ.Verilog\ HDL:verilog
  616. SynMenu &VWXYZ.Vgrindefs:vgrindefs
  617. SynMenu &VWXYZ.VHDL:vhdl
  618. SynMenu &VWXYZ.Vim\ help\ file:help
  619. SynMenu &VWXYZ.Vim\ script:vim
  620. SynMenu &VWXYZ.Viminfo\ file:viminfo
  621. SynMenu &VWXYZ.Visual\ Basic:vb
  622. SynMenu &VWXYZ.VRML:vrml
  623. SynMenu &VWXYZ.Whitespace\ (add):whitespace
  624. SynMenu &VWXYZ.X\ Pixmap:xpm
  625. SynMenu &VWXYZ.X\ resources:xdefaults
  626. SynMenu &VWXYZ.Xmath:xmath
  627. SynMenu &VWXYZ.XML:xml
  628. SynMenu &VWXYZ.XXD\ hex\ dump:xxd
  629. SynMenu &VWXYZ.Yacc:yacc
  630. SynMenu &VWXYZ.Z-80\ assembler:z8a
  631. SynMenu &VWXYZ.Zsh\ shell\ script:zsh
  632.  
  633. unlet current_menu_name
  634. unlet current_menu_nr
  635. unlet current_menu_item
  636. unlet current_menu_char
  637. delcommand SynMenu
  638. delfun SynMenu
  639.  
  640. am 50.75 &Syntax.-SEP1-                :
  641.  
  642. am 50.80 &Syntax.Set\ 'syntax'\ only        :let syntax_menu_synonly=1<CR>
  643. am 50.81 &Syntax.Set\ 'filetype'\ too        :if exists("syntax_menu_synonly")<Bar>unlet syntax_menu_synonly<Bar>endif<CR>
  644.  
  645. am 50.90 &Syntax.&Off            :syn off<CR>
  646. am 50.92 &Syntax.&Manual        :syn manual<CR>
  647. am 50.94 &Syntax.A&utomatic        :syn on<CR>
  648.  
  649. am 50.96 &Syntax.&on\ (this\ file)    :if !exists("syntax_on")<Bar>syn manual<Bar>endif<Bar>set syn=ON<CR>
  650. am 50.98 &Syntax.o&ff\ (this\ file)    :syn clear<CR>
  651.  
  652. am 50.700 &Syntax.-SEP3-        :
  653. am 50.710 &Syntax.Co&lor\ test        :sp $VIMRUNTIME/syntax/colortest.vim<Bar>so %<CR>
  654. am 50.720 &Syntax.&Highlight\ test    :so $VIMRUNTIME/syntax/hitest.vim<CR>
  655. am 50.730 &Syntax.&Convert\ to\ HTML    :so $VIMRUNTIME/syntax/2html.vim<CR>
  656.  
  657. endif " !exists("did_install_syntax_menu")
  658.  
  659. " Restore the previous value of 'cpoptions'.
  660. let &cpo = menu_cpo_save
  661. unlet menu_cpo_save
  662.