Saturday, May 31, 2014

Re: Filetype specificity for menus

Hello,


> Make a menu item coded for a specific filetype *not* be present in a
> buffer of a different filetype.
>
> Example : with python.vim, a menu for python-specific actions is
> installed. Switching to a javascript buffer, the python menu
> remains. It would be great if it were to go away.

Years ago I have patched Michaels Gedes's buffer-menu plugin.
The end result is there: https://code.google.com/p/lh-vim/source/browse/misc/trunk/plugin/buffermenu.vim

Just use :Bmenu, :Binoremenu, etc to define a new menu entry.


If you want to define a menu entry and a mapping in one go, I have defined several functions in lh-vim-lib that exploit buffermenu if installed: https://code.google.com/p/lh-vim/wiki/lhVimLib#Menus_related_functions

See the test file: https://code.google.com/p/lh-vim/source/browse/vim-lib/trunk/tests/lh/test-menu-map.vim

I also provide a way to define cyclic options (like: Build in {Debug, Release, ReleaseWithInfo}). See the test file: https://code.google.com/p/lh-vim/source/browse/vim-lib/trunk/tests/lh/test-toggle-menu.vim

HTH,

--
Luc Hermitte
http://lh-vim.googlecode.com/

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment