From def9f0f29cb4d9b8020506ccb078da91c03b5f94 Mon Sep 17 00:00:00 2001 From: pydave Date: Mon, 30 Jul 2012 12:45:40 -0700 Subject: [PATCH] Allow the user to disable the menu Add g:org_enable_menu The menu may override a map that uses Alt, or users may not like having many menus. Still defaults to enabling menus. --- ftplugin/org.vim | 203 ++++++++++++++++++++++++----------------------- 1 file changed, 104 insertions(+), 99 deletions(-) mode change 100644 => 100755 ftplugin/org.vim diff --git a/ftplugin/org.vim b/ftplugin/org.vim old mode 100644 new mode 100755 index 017dfb1..e214e26 --- a/ftplugin/org.vim +++ b/ftplugin/org.vim @@ -165,6 +165,9 @@ endif if !exists('g:org_agenda_window_position') let g:org_agenda_window_position = 'bottom' endif +if !exists('g:org_enable_menu') + let g:org_enable_menu = 1 +endif if has('win32') || has('win64') let s:cmd_line_quote_fix = '^' else @@ -8238,105 +8241,107 @@ function! NarrowCodeBlock(line) endif endfunction " Org Menu Entries -amenu &Org.&View.Entire\ &Document.To\ Level\ &1,1 :set foldlevel=1 -amenu &Org.&View.Entire\ &Document.To\ Level\ &2,2 :set foldlevel=2 -amenu &Org.&View.Entire\ &Document.To\ Level\ &3,3 :set foldlevel=3 -amenu &Org.&View.Entire\ &Document.To\ Level\ &4,4 :set foldlevel=4 -amenu &Org.&View.Entire\ &Document.To\ Level\ &5,5 :set foldlevel=5 -amenu &Org.&View.Entire\ &Document.To\ Level\ &6,6 :set foldlevel=6 -amenu &Org.&View.Entire\ &Document.To\ Level\ &7,7 :set foldlevel=7 -amenu &Org.&View.Entire\ &Document.To\ Level\ &8,8 :set foldlevel=8 -amenu &Org.&View.Entire\ &Document.To\ Level\ &9,9 :set foldlevel=9 -amenu &Org.&View.Entire\ &Document.Expand\ Level\ &All :set foldlevel=99999 -amenu &Org.&View.&Subtree.To\ Level\ &1,,1 :silent call OrgShowSubs(1,0) -amenu &Org.&View.&Subtree.To\ Level\ &2,,2 :silent call OrgShowSubs(2,0) -amenu &Org.&View.&Subtree.To\ Level\ &3,,3 :silent call OrgShowSubs(3,0) -amenu &Org.&View.&Subtree.To\ Level\ &4,,4 :silent call OrgShowSubs(4,0) -amenu &Org.&View.&Subtree.To\ Level\ &5,,5 :silent call OrgShowSubs(5,0) -amenu &Org.&View.&Subtree.To\ Level\ &6,,6 :silent call OrgShowSubs(6,0) -amenu &Org.&View.&Subtree.To\ Level\ &7,,7 :silent call OrgShowSubs(7,0) -amenu &Org.&View.&Subtree.To\ Level\ &8,,8 :silent call OrgShowSubs(8,0) -amenu &Org.&View.&Subtree.To\ Level\ &9\ \ \ \ \ \ ,,9 :silent call OrgShowSubs(9,0)cr> -amenu &Org.-Sep1- : -amenu &Org.&New\ Heading.New\ Head\ Same\ Level(or\ ) :call OrgNewHead('same') -amenu &Org.&New\ Heading.New\ Subhead :call OrgNewHead('leveldown') -amenu &Org.&New\ Heading.New\ Head\ Parent\ Level :call OrgNewHead('levelup') -amenu &Org.&Navigate\ Headings.&Up\ to\ Parent\ Heading :exec OrgParentHead() -amenu &Org.&Navigate\ Headings.&First\ Child\ Heading :exec OrgFirstChildHead() -amenu &Org.&Navigate\ Headings.&Last\ Child\ Heading :exec OrgLastChildHead() -amenu &Org.&Navigate\ Headings.&Next\ Heading :exec OrgNextHead() -amenu &Org.&Navigate\ Headings.&Previous\ Heading :exec OrgPrevHead() -amenu &Org.&Navigate\ Headings.Next\ &Same\ Level :exec OrgNextHeadSameLevel() -amenu &Org.&Navigate\ Headings.Previous\ Same\ Level :exec OrgPrevHeadSameLevel() -amenu &Org.&Navigate\ Headings.Next\ &Sibling :exec OrgNextSiblingHead() -amenu &Org.&Navigate\ Headings.Previous\ Sibling :exec OrgPrevSiblingHead() -amenu &Org.Edit\ &Structure.Move\ Subtree\ &Up :call OrgMoveLevel(line('.'),'up') -amenu &Org.Edit\ &Structure.Move\ Subtree\ &Down :call OrgMoveLevel(line('.'),'down') -amenu &Org.Edit\ &Structure.&Promote\ Subtree :call OrgMoveLevel(line('.'),'left') -amenu &Org.Edit\ &Structure.&Demote\ Subtree :call OrgMoveLevel(line('.'),'right') -vmenu &Org.&Editing.&Bold\ (*),cb "zdi*z*l -vmenu &Org.&Editing.&Italic\ (/),ci "zdi/z/l -vmenu &Org.&Editing.&Underline\ (_),cu "zdi_z_l -vmenu &Org.&Editing.&Code\ (=),cc "zdi=z=l -amenu &Org.&Editing.-Sep22- : -amenu &Org.&Editing.&Narrow,na :silent call NarrowCodeBlock(line('.')) -"amenu &Org.&Editing.Narrow\ &Codeblock,nc :silent call NarrowCodeBlock(line('.')) -"amenu &Org.&Editing.Narrow\ Outline\ &Subtree,ns :silent call NarrowOutline(line('.')) -amenu &Org.&Refile.&Refile\ to\ Point,rh :call OrgRefile(line('.')) -amenu &Org.&Refile.&Jump\ to\ Point,rj :call OrgJumpToRefilePoint() -amenu &Org.&Refile.&Jump\ to\ Persistent\ Point,rx :call OrgJumpToRefilePointPersistent() -amenu &Org.&Refile.&Jump\ to\ Point,rj :call OrgJumpToRefilePoint() -amenu &Org.&Refile.&Set\ Persistent\ Refile\ Point,rs :call OrgSetRefilePoint() -amenu &Org.&Refile.Refile\ to\ Persistent\ Point,rp :call OrgRefileToPermPoint(line('.')) -amenu &Org.Open\ Capture\ File :call org#OpenCaptureFile() -amenu &Org.&Mark/Gather/Sort.&Mark/Unmark\ Heading, :call ToggleHeadingMark(line('.')) -amenu &Org.&Mark/Gather/Sort.&Unmark\ all, :call DeleteHeadingMarks() -amenu &Org.&Mark/Gather/Sort.&Gather\ to\ current\ heading,gh :call GatherMarks() -amenu &Org.&Mark/Gather/Sort.&Sort\ subheads,gs :call OrgSortSubheads() -amenu &Org.-Sep2- : -amenu &Org.&Columns\ Menu :call OrgColumnsDashboard() -amenu &Org.&Hyperlinks.Add/&edit\ link,le :call EditLink() -amenu &Org.&Hyperlinks.&Follow\ link,lf :call FollowLink(OrgGetLink()) -amenu &Org.&Hyperlinks.&Next\ link,ln :/]] -amenu &Org.&Hyperlinks.&Previous\ link,lp :?]] -amenu &Org.&Hyperlinks.Perma-compre&ss\ links,lc :set conceallevel=3\|set concealcursor=nc -amenu &Org.&Hyperlinks.&Autocompress\ links,la :set conceallevel=3\|set concealcursor=c -amenu &Org.&Hyperlinks.No\ auto&compress\ links,lx :set conceallevel=0 -amenu &Org.&Table.$Table\ Dashboard,b :call OrgTableDashboard() -amenu &Org.&Table.E$valuate\ Table,v :call OrgTableDashboard() -amenu &Org.-Sep3- : -amenu &Org.TODO\ &Dashboard,t :call OrgTodoDashboard() -amenu &Org.TODO\ &Cycle :call ReplaceTodo() -"amenu &Org.TODO\ Cycle\ &Backward :call ReplaceTodo('todo-bkwd') -amenu &Org.Edit\ TA&GS,et :call OrgTagsEdit() -amenu &Org.&Dates\ and\ Scheduling.Add/Edit\ &Deadline,dd :call OrgDateEdit('DEADLINE') -amenu &Org.&Dates\ and\ Scheduling.Add/Edit\ &Scheduled,ds :call OrgDateEdit('SCHEDULED') -amenu &Org.&Dates\ and\ Scheduling.Add/Edit\ &Closed,dc :call OrgDateEdit('CLOSED') -amenu &Org.&Dates\ and\ Scheduling.Add/Edit\ &Timestamp,dt :call OrgDateEdit('TIMESTAMP') -amenu &Org.&Dates\ and\ Scheduling.Add/Edit\ &GenericDate,dg :call OrgDateEdit('ATCURSOR') -amenu &Org.&Logging\ work.Clock\ in,ci :call OrgClockIn(line('.')) -amenu &Org.&Logging\ work.Clock\ out,co :call OrgClockOut() -amenu &Org.-Sep4- : -amenu &Org.Agenda\ command,ag :call OrgAgendaDashboard() -amenu &Org.Special\ &views\ current\ file :call OrgCustomSearchMenu() -amenu &Org.Agenda\ &files,af.&Edit\ Agenda\ Files :EditAgendaFiles -amenu &Org.Agenda\ &files,af.Current\ file\ to\ &top :call {sid}CurrentToAgendaFiles('top') -amenu &Org.Agenda\ &files,af.Current\ file\ to\ &bottom :call {sid}CurrentToAgendaFiles('bottom') -amenu &Org.Agenda\ &files,af.Current\ file\ &remove :call {sid}CurrentRemoveFromAgendaFiles() -amenu &Org.Agenda\ &files,af.Cycle\ to\ &next :call {sid}CycleAgendaFiles('forward') -amenu &Org.Agenda\ &files,af.Cycle\ to\ &previous :call {sid}CycleAgendaFiles('backward') -amenu &Org.Agenda\ &files,af.&Choose\ file\ to\ goto :call {sid}OrgGotoChosenFile() -amenu &Org.-Sep45- : -amenu &Org.&Do\ Emacs\ Eval,v :call OrgEval() -amenu &Org.-Sep5- : -amenu &Org.Narro&w.Outline\ &Subtree,ns :call NarrowCodeBlock(line('.')) -amenu &Org.Narro&w.&Code\ Block,nc :call NarrowCodeBlock(line('.')) -amenu &Org.-Sep6- : -amenu &Org.Open\ Capture\ Buffer :call org#CaptureBuffer() -amenu &Org.-Sep7- : -amenu &Org.Export/Publish\ w/Emacs :call OrgExportDashboard() -amenu &Org.-Sep8- : -amenu &Org.R&e-read\ Config\ Lines :call OrgProcessConfigLines() +if g:org_enable_menu + amenu &Org.&View.Entire\ &Document.To\ Level\ &1,1 :set foldlevel=1 + amenu &Org.&View.Entire\ &Document.To\ Level\ &2,2 :set foldlevel=2 + amenu &Org.&View.Entire\ &Document.To\ Level\ &3,3 :set foldlevel=3 + amenu &Org.&View.Entire\ &Document.To\ Level\ &4,4 :set foldlevel=4 + amenu &Org.&View.Entire\ &Document.To\ Level\ &5,5 :set foldlevel=5 + amenu &Org.&View.Entire\ &Document.To\ Level\ &6,6 :set foldlevel=6 + amenu &Org.&View.Entire\ &Document.To\ Level\ &7,7 :set foldlevel=7 + amenu &Org.&View.Entire\ &Document.To\ Level\ &8,8 :set foldlevel=8 + amenu &Org.&View.Entire\ &Document.To\ Level\ &9,9 :set foldlevel=9 + amenu &Org.&View.Entire\ &Document.Expand\ Level\ &All :set foldlevel=99999 + amenu &Org.&View.&Subtree.To\ Level\ &1,,1 :silent call OrgShowSubs(1,0) + amenu &Org.&View.&Subtree.To\ Level\ &2,,2 :silent call OrgShowSubs(2,0) + amenu &Org.&View.&Subtree.To\ Level\ &3,,3 :silent call OrgShowSubs(3,0) + amenu &Org.&View.&Subtree.To\ Level\ &4,,4 :silent call OrgShowSubs(4,0) + amenu &Org.&View.&Subtree.To\ Level\ &5,,5 :silent call OrgShowSubs(5,0) + amenu &Org.&View.&Subtree.To\ Level\ &6,,6 :silent call OrgShowSubs(6,0) + amenu &Org.&View.&Subtree.To\ Level\ &7,,7 :silent call OrgShowSubs(7,0) + amenu &Org.&View.&Subtree.To\ Level\ &8,,8 :silent call OrgShowSubs(8,0) + amenu &Org.&View.&Subtree.To\ Level\ &9\ \ \ \ \ \ ,,9 :silent call OrgShowSubs(9,0)cr> + amenu &Org.-Sep1- : + amenu &Org.&New\ Heading.New\ Head\ Same\ Level(or\ ) :call OrgNewHead('same') + amenu &Org.&New\ Heading.New\ Subhead :call OrgNewHead('leveldown') + amenu &Org.&New\ Heading.New\ Head\ Parent\ Level :call OrgNewHead('levelup') + amenu &Org.&Navigate\ Headings.&Up\ to\ Parent\ Heading :exec OrgParentHead() + amenu &Org.&Navigate\ Headings.&First\ Child\ Heading :exec OrgFirstChildHead() + amenu &Org.&Navigate\ Headings.&Last\ Child\ Heading :exec OrgLastChildHead() + amenu &Org.&Navigate\ Headings.&Next\ Heading :exec OrgNextHead() + amenu &Org.&Navigate\ Headings.&Previous\ Heading :exec OrgPrevHead() + amenu &Org.&Navigate\ Headings.Next\ &Same\ Level :exec OrgNextHeadSameLevel() + amenu &Org.&Navigate\ Headings.Previous\ Same\ Level :exec OrgPrevHeadSameLevel() + amenu &Org.&Navigate\ Headings.Next\ &Sibling :exec OrgNextSiblingHead() + amenu &Org.&Navigate\ Headings.Previous\ Sibling :exec OrgPrevSiblingHead() + amenu &Org.Edit\ &Structure.Move\ Subtree\ &Up :call OrgMoveLevel(line('.'),'up') + amenu &Org.Edit\ &Structure.Move\ Subtree\ &Down :call OrgMoveLevel(line('.'),'down') + amenu &Org.Edit\ &Structure.&Promote\ Subtree :call OrgMoveLevel(line('.'),'left') + amenu &Org.Edit\ &Structure.&Demote\ Subtree :call OrgMoveLevel(line('.'),'right') + vmenu &Org.&Editing.&Bold\ (*),cb "zdi*z*l + vmenu &Org.&Editing.&Italic\ (/),ci "zdi/z/l + vmenu &Org.&Editing.&Underline\ (_),cu "zdi_z_l + vmenu &Org.&Editing.&Code\ (=),cc "zdi=z=l + amenu &Org.&Editing.-Sep22- : + amenu &Org.&Editing.&Narrow,na :silent call NarrowCodeBlock(line('.')) + "amenu &Org.&Editing.Narrow\ &Codeblock,nc :silent call NarrowCodeBlock(line('.')) + "amenu &Org.&Editing.Narrow\ Outline\ &Subtree,ns :silent call NarrowOutline(line('.')) + amenu &Org.&Refile.&Refile\ to\ Point,rh :call OrgRefile(line('.')) + amenu &Org.&Refile.&Jump\ to\ Point,rj :call OrgJumpToRefilePoint() + amenu &Org.&Refile.&Jump\ to\ Persistent\ Point,rx :call OrgJumpToRefilePointPersistent() + amenu &Org.&Refile.&Jump\ to\ Point,rj :call OrgJumpToRefilePoint() + amenu &Org.&Refile.&Set\ Persistent\ Refile\ Point,rs :call OrgSetRefilePoint() + amenu &Org.&Refile.Refile\ to\ Persistent\ Point,rp :call OrgRefileToPermPoint(line('.')) + amenu &Org.Open\ Capture\ File :call org#OpenCaptureFile() + amenu &Org.&Mark/Gather/Sort.&Mark/Unmark\ Heading, :call ToggleHeadingMark(line('.')) + amenu &Org.&Mark/Gather/Sort.&Unmark\ all, :call DeleteHeadingMarks() + amenu &Org.&Mark/Gather/Sort.&Gather\ to\ current\ heading,gh :call GatherMarks() + amenu &Org.&Mark/Gather/Sort.&Sort\ subheads,gs :call OrgSortSubheads() + amenu &Org.-Sep2- : + amenu &Org.&Columns\ Menu :call OrgColumnsDashboard() + amenu &Org.&Hyperlinks.Add/&edit\ link,le :call EditLink() + amenu &Org.&Hyperlinks.&Follow\ link,lf :call FollowLink(OrgGetLink()) + amenu &Org.&Hyperlinks.&Next\ link,ln :/]] + amenu &Org.&Hyperlinks.&Previous\ link,lp :?]] + amenu &Org.&Hyperlinks.Perma-compre&ss\ links,lc :set conceallevel=3\|set concealcursor=nc + amenu &Org.&Hyperlinks.&Autocompress\ links,la :set conceallevel=3\|set concealcursor=c + amenu &Org.&Hyperlinks.No\ auto&compress\ links,lx :set conceallevel=0 + amenu &Org.&Table.$Table\ Dashboard,b :call OrgTableDashboard() + amenu &Org.&Table.E$valuate\ Table,v :call OrgTableDashboard() + amenu &Org.-Sep3- : + amenu &Org.TODO\ &Dashboard,t :call OrgTodoDashboard() + amenu &Org.TODO\ &Cycle :call ReplaceTodo() + "amenu &Org.TODO\ Cycle\ &Backward :call ReplaceTodo('todo-bkwd') + amenu &Org.Edit\ TA&GS,et :call OrgTagsEdit() + amenu &Org.&Dates\ and\ Scheduling.Add/Edit\ &Deadline,dd :call OrgDateEdit('DEADLINE') + amenu &Org.&Dates\ and\ Scheduling.Add/Edit\ &Scheduled,ds :call OrgDateEdit('SCHEDULED') + amenu &Org.&Dates\ and\ Scheduling.Add/Edit\ &Closed,dc :call OrgDateEdit('CLOSED') + amenu &Org.&Dates\ and\ Scheduling.Add/Edit\ &Timestamp,dt :call OrgDateEdit('TIMESTAMP') + amenu &Org.&Dates\ and\ Scheduling.Add/Edit\ &GenericDate,dg :call OrgDateEdit('ATCURSOR') + amenu &Org.&Logging\ work.Clock\ in,ci :call OrgClockIn(line('.')) + amenu &Org.&Logging\ work.Clock\ out,co :call OrgClockOut() + amenu &Org.-Sep4- : + amenu &Org.Agenda\ command,ag :call OrgAgendaDashboard() + amenu &Org.Special\ &views\ current\ file :call OrgCustomSearchMenu() + amenu &Org.Agenda\ &files,af.&Edit\ Agenda\ Files :EditAgendaFiles + amenu &Org.Agenda\ &files,af.Current\ file\ to\ &top :call {sid}CurrentToAgendaFiles('top') + amenu &Org.Agenda\ &files,af.Current\ file\ to\ &bottom :call {sid}CurrentToAgendaFiles('bottom') + amenu &Org.Agenda\ &files,af.Current\ file\ &remove :call {sid}CurrentRemoveFromAgendaFiles() + amenu &Org.Agenda\ &files,af.Cycle\ to\ &next :call {sid}CycleAgendaFiles('forward') + amenu &Org.Agenda\ &files,af.Cycle\ to\ &previous :call {sid}CycleAgendaFiles('backward') + amenu &Org.Agenda\ &files,af.&Choose\ file\ to\ goto :call {sid}OrgGotoChosenFile() + amenu &Org.-Sep45- : + amenu &Org.&Do\ Emacs\ Eval,v :call OrgEval() + amenu &Org.-Sep5- : + amenu &Org.Narro&w.Outline\ &Subtree,ns :call NarrowCodeBlock(line('.')) + amenu &Org.Narro&w.&Code\ Block,nc :call NarrowCodeBlock(line('.')) + amenu &Org.-Sep6- : + amenu &Org.Open\ Capture\ Buffer :call org#CaptureBuffer() + amenu &Org.-Sep7- : + amenu &Org.Export/Publish\ w/Emacs :call OrgExportDashboard() + amenu &Org.-Sep8- : + amenu &Org.R&e-read\ Config\ Lines :call OrgProcessConfigLines() +endif "********************************************************************* "*********************************************************************