> The improved approach is to use s:SetAltMaps() functions (instead of > SetAltMaps()) with the local maps you mentioned earlier: > > map <buffer> <F12> :call <SID>SetAltMaps()<CR> > map <buffer> <C-F12> :call <SID>ResetMaps()<CR> > > with those maps also residing in .vim/ftplugin/FILETYPE.vim files. > That way neither the functions nor the maps occupy global namespace.
Absolutely. One thing to note with this approach though, is that you can't (well, you can, but it's difficult) call the function from outside the scope of the script. It's unclear to me whether the OP wants to do this. Obviously if just using maps like above it's fine; likewise you can make it work with autocommands defined in the script. Ben. --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
