"=========================================================================== " $Id: menu-map.vim 520 2012-03-19 18:09:15Z luc.hermitte $ " File: macros/menu-map.vim " Author: Luc Hermitte " " " Purpose: Define functions to build mappings and menus at the same time " " License: GPLv3 with exceptions " " Version: 3.0.0 " Last Update: $Date: 2012-03-19 19:09:15 +0100 (Mon, 19 Mar 2012) $ (02nd Dec 2006) " " Last Changes: {{{ " Version 3.0.0: " GPLv3 " Version 2.0.0: " Moved to vim7, " Functions moved to {rtp}/autoload/ " Version 1.6.2: " (*) Silent mappings and menus " Version 1.6. : " (*) Uses has('gui_running') instead of has('gui') to check if " we can generate the menu. " Version 1.5. : " (*) visual mappings launched from select-mode don't end with " text still selected -- applied to :VCalls " Version 1.4. : " (*) address obfuscated for spammers " (*) support the local option " b:want_buffermenu_or_global_disable if we don't want " buffermenu to be used systematically. " 0 -> buffer menu not used " 1 -> buffer menu used " 2 -> the VimL developper will use a global disable. " cf.: tex-maps.vim:: s:SimpleMenu() " and texmenus.vim " Version 1.3. : " (*) add continuation lines support ; cf 'cpoptions' " Version 1.2. : " (*) Code folded. " (*) Take advantage of buffermenu.vim if present for local " menus. " (*) If non gui is available, the menus won't be defined " Version 1.1. : " (*) Bug corrected : " vnore(map\|menu) does not imply v+n(map\|menu) any more " }}} " " Inspired By: A function from Benji Fisher " " TODO: (*) no menu if no gui. " "=========================================================================== if exists("g:loaded_menu_map") | finish | endif let g:loaded_menu_map = 1 "" line continuation used here ?? let s:cpo_save = &cpo set cpo&vim "========================================================================= " Commands {{{ command! -nargs=+ -bang MAP map command! -nargs=+ IMAP imap command! -nargs=+ NMAP nmap command! -nargs=+ CMAP cmap command! -nargs=+ VMAP vmap command! -nargs=+ AMAP \ call lh#menu#map_all('amap', ) command! -nargs=+ -bang NOREMAP noremap command! -nargs=+ INOREMAP inoremap command! -nargs=+ NNOREMAP nnoremap command! -nargs=+ CNOREMAP cnoremap command! -nargs=+ VNOREMAP vnoremap command! -nargs=+ ANOREMAP \ call lh#menu#map_all('anoremap', ) " }}} " End ! let &cpo = s:cpo_save finish "========================================================================= " vim600: set fdm=marker: