From 9f51ffd1400c256f1a6d20c3f5da1df759d4892d Mon Sep 17 00:00:00 2001 From: Mathieu Maret Date: Wed, 8 Jul 2015 15:53:26 +0200 Subject: [PATCH] First version of menu --- .vim/plugin/menu.vim | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .vim/plugin/menu.vim diff --git a/.vim/plugin/menu.vim b/.vim/plugin/menu.vim new file mode 100644 index 0000000..0b9c28e --- /dev/null +++ b/.vim/plugin/menu.vim @@ -0,0 +1,40 @@ +" Enjoy the right click button! +" Custom right click menu to call cscope functions +" + +if exists("loaded_menu") + finish +endif +let loaded_menu = 1 +set mousemodel=popup + + +function! PopulateMenu() + exe "amenu PopUp.-Sep- :" + exe "amenu PopUp.Help\\ ! :call Help()" + exe "amenu PopUp.-Sep1- :" + exe "amenu PopUp.Find\\ File :cscope find f =expand('')" + exe "amenu PopUp.Find\\ Symbol :cscope find s =expand('')" + exe "amenu PopUp.Find\\ Definition :cscope find g =expand('')" + exe "amenu PopUp.Find\\ Call :cscope find c =expand('')" + exe "amenu PopUp.Find\\ Text :cscope find t =expand('')" + exe "amenu PopUp.Find\\ Egrep :cscope find e =expand('')" + exe "amenu PopUp.Go\\ Back " + exe "amenu PopUp.-Sep2- :" + exe "amenu PopUp.Create\\ local\\ code\\ reference :CtagsKernelBuild:CscopeKernelBuild:cscope reset:cscope add cscope.out" + exe "amenu PopUp.Create\\ local\\ code\\ reference\\ with\\ system\\ headers :CtagsBuild:CscopeBuild:cscope reset:cscope add cscope.out" + exe "amenu PopUp.Create\\ global\\ code\\ reference :call AutotagsUpdate()" + exe "amenu PopUp.Create\\ global\\ code\\ reference\\ for\\ path :call AutotagsAdd()" + exe "amenu PopUp.-Sep3- :" + exe "amenu PopUp.Toggle\\ show\\ function :TlistToggle" +endfunc + + +if has("vim_starting") + augroup LoadBufferPopup + au! VimEnter * call PopulateMenu() + au VimEnter * au! LoadBufferPopup + augroup END +else + call PopulateMenu() +endif