From e2c581348cb66dc1446877e335ba4c3ccc17bd39 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 26 Jul 2015 12:05:12 -0400 Subject: autoload/auditory.vim: Initial Unmap function Unmaps all normal mode commands. This will be used to turn Auditory off. We'll want to also turn custom user mappings back on in the process but that's for a later commit. --- autoload/auditory.vim | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/autoload/auditory.vim b/autoload/auditory.vim index 4bfac77..c590aad 100644 --- a/autoload/auditory.vim +++ b/autoload/auditory.vim @@ -479,3 +479,14 @@ function! auditory#StoreUserMapping(map_from) endif endif endfunction + + +function! auditory#Unmap() + for [key, value] in items(s:mappings) + let l:cmd = has_key(value, 'map_command') ? value.map_command : 'nnoremap' + + if l:cmd ==# 'nnoremap' + execute 'nunmap ' . key + endif + endfor +endfunction -- cgit v1.2.3