" These menu commands create the default Vim menus. " You can use this as a start for your own set of menus. " Make sure the '<' flag is not included in 'cpoptions', otherwise would " not be recognized. See ":help 'cpoptions'". let cpo_save = &cpo let &cpo = "" " Help menu " Note that "amenu" is used to make it work in all modes 9999amenu &Help.&Overview :help amenu &Help.&How-to\ links :help how-to amenu &Help.&GUI :help gui amenu &Help.&Version :version amenu &Help.&Credits :help credits amenu &Help.Co&pying :help uganda amenu &Help.&About :intro " File menu amenu 10.310 &File.&Open\.\.\.:e :browse confirm e amenu 10.320 &File.Sp&lit-Open\.\.\.:sp :browse sp amenu 10.330 &File.&Save:w :confirm w amenu 10.340 &File.Save\ &As\.\.\.:w :browse w amenu 10.350 &File.&Close:q :confirm q if has("win32") " Use Notepad for printing. amenu 10.360 &File.&Print :let smod=&mod:let ttt=tempname()exec ":w! ".tttlet &mod=smodexec "!notepad /p ".tttexec "!del ".ttt vmenu &File.&Print :let smod=&mod:let ttt=tempname()exec ":'<,'>w! ".tttlet &mod=smodexec "!notepad /p ".tttexec "!del ".ttt elseif has("unix") amenu 10.360 &File.&Print :w !lpr vmenu &File.&Print :w !lpr endif amenu 10.370 &File.Sa&ve-Exit:wqa :confirm wqa amenu 10.380 &File.E&xit:qa :confirm qa " Edit menu amenu 20.310 &Edit.&Undou u amenu 20.320 &Edit.&RedoCtrl+R amenu 20.330 &Edit.&Repeat\. . vmenu 20.340 &Edit.Cu&t"*x "*x vmenu 20.350 &Edit.&Copy"*y "*y nmenu 20.360 &Edit.&Paste"*p "*p vmenu &Edit.&Paste"*p "*P`]:if col(".")!=1exe "norm l"endif imenu &Edit.&Paste"*p :if col(".")!=1exe 'norm "*p'elseexe 'norm "*P'endif`]a cmenu &Edit.&Paste"*p * nmenu 20.370 &Edit.Put\ &Before[p [p imenu &Edit.Put\ &Before[p [p nmenu 20.380 &Edit.Put\ &After]p ]p imenu &Edit.Put\ &After]p ]p if has("win32") vmenu 20.390 &Edit.&Deletex x endif amenu 20.400 &Edit.&Select\ allggvG :if &slm != ""exe ":norm gggHG"elseexe ":norm ggVG"endif if has("win32") amenu 20.410 &Edit.&Find\.\.\. :promptfind amenu 20.420 &Edit.Find\ and\ R&eplace\.\.\. :promptrepl vmenu &Edit.Find\ and\ R&eplace\.\.\. y:promptrepl " else amenu 20.410 &Edit.&Find/ / amenu 20.420 &Edit.Find\ and\ R&eplace:%s :%s/ vmenu &Edit.Find\ and\ R&eplace:s :s/ endif " Window menu amenu 30.300 &Window.&New n amenu 30.310 &Window.S&plit s amenu 30.320 &Window.Sp&lit\ To\ # amenu 30.330 &Window.&Close c amenu 30.340 &Window.Close\ &Other(s) o amenu 30.350 &Window.Ne&xt w amenu 30.360 &Window.P&revious W amenu 30.370 &Window.&Equal\ Height = amenu 30.380 &Window.Rotate\ &Up R amenu 30.390 &Window.Rotate\ &Down r if has("gui_win32") amenu 30.400 &Window.Select\ &Font :set guifont=* endif " Programming menu amenu 40.300 &Tools.&Jump\ to\ this\ tag g vmenu 40.300 &Tools.&Jump\ to\ this\ tag g amenu 40.310 &Tools.Jump\ &back amenu 40.320 &Tools.Build\ &Tags\ File :!ctags -R . amenu 40.330 &Tools.&Make :make amenu 40.340 &Tools.&List\ Errors :cl amenu 40.350 &Tools.L&ist\ Messages :cl! amenu 40.360 &Tools.&Next\ Error :cn amenu 40.370 &Tools.&Previous\ Error :cp amenu 40.380 &Tools.&Older\ List :colder amenu 40.390 &Tools.N&ewer\ List :cnewer " The popup menu amenu 1.10 PopUp.&Undo u vmenu 1.20 PopUp.Cu&t "*x vmenu 1.30 PopUp.&Copy "*y nmenu 1.40 PopUp.&Paste "*P`]:if col(".")!=1exe "norm l"endif vmenu PopUp.&Paste "-x"*P`] imenu PopUp.&Paste :if col(".")!=1exe 'norm "*p'elseexe 'norm "*P'endif`]a cmenu PopUp.&Paste * vmenu 1.50 PopUp.&Delete x amenu 1.60 PopUp.Select\ &Word vaw amenu 1.70 PopUp.Select\ &Line V amenu 1.80 PopUp.Select\ &All ggVG " The Motif GUI toolbar if has("gui_toolbar") nbutton Open open.xpm "Open a File for editing" :browse e nbutton Save save.xpm "Save the current file" :w button vbutton Cut cut.xpm "Cut selection to Cut Buffer" "*x vbutton Copy copy.xpm "Copy selection to Cut Buffer" "*y nbutton Paste paste.xpm "Paste from Cut Burrer" "*p button nbutton Undo undo.xpm "Undo last change" u button nbutton Print print.xpm "Print current file" :w !lpr endif " The Win32 GUI toolbar if has("win32") amenu ToolBar.Open :browse e tmenu ToolBar.Open Open file amenu ToolBar.Save :w tmenu ToolBar.Save Save current file amenu ToolBar.SaveAll :wa tmenu ToolBar.SaveAll Save all files amenu ToolBar.Print :let ttt=tempname()exec ":w! ".tttexec "!start notepad /p ".tttexec "!del ".ttt vmenu ToolBar.Print :let ttt=tempname()exec ":'<,'>w! ".tttexec "!start notepad /p ".tttexec "!del ".ttt tmenu ToolBar.Print Print amenu ToolBar.Undo u tmenu ToolBar.Undo Undo amenu ToolBar.Redo tmenu ToolBar.Redo Redo vmenu ToolBar.Cut "*x tmenu ToolBar.Cut Cut to clipboard vmenu ToolBar.Copy "*y tmenu ToolBar.Copy Copy to clipboard nmenu ToolBar.Paste i* vmenu ToolBar.Paste "-xi* menu! ToolBar.Paste * tmenu ToolBar.Paste Paste from Clipboard amenu ToolBar.Find / tmenu ToolBar.Find Find amenu ToolBar.FindNext n tmenu ToolBar.FindNext Find Next amenu ToolBar.FindPrev N tmenu ToolBar.FindPrev Find Previous amenu ToolBar.Replace :%s/ vmenu ToolBar.Replace :s/ tmenu ToolBar.Replace Find && Replace amenu ToolBar.New n tmenu ToolBar.New New Window amenu ToolBar.WinSplit s tmenu ToolBar.WinSplit Split Window amenu ToolBar.WinZoom :resize 100 tmenu ToolBar.WinZoom Maximise Window amenu ToolBar.WinMin :resize 1 tmenu ToolBar.WinMin Minimise Window amenu ToolBar.WinClose :close tmenu ToolBar.WinClose Close Window amenu ToolBar.LoadSession :browse so $vim\\session tmenu ToolBar.LoadSession Load session amenu ToolBar.SaveSession :execute ("mksession " . this_session) tmenu ToolBar.SaveSession Save current session amenu ToolBar.RunMacro :browse so tmenu ToolBar.RunMacro Run a Macro amenu ToolBar.Make :make tmenu ToolBar.Make Make current project amenu ToolBar.Shell :sh tmenu ToolBar.Shell Open a command shell amenu ToolBar.TagsBuild :!ctags -R . tmenu ToolBar.TagsBuild Build tags in current directory tree amenu ToolBar.TagsJump g] tmenu ToolBar.TagsJump Jump to tag under cursor amenu ToolBar.Help :help tmenu ToolBar.Help Vim Help amenu ToolBar.FindHelp :help tmenu ToolBar.FindHelp Search Vim Help endif " Restore the previous value of 'cpoptions'. let &cpo = cpo_save unlet cpo_save