From d5b7bd6857e82fd2b164d41b929426394dcbf10e Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 16 Aug 2015 02:08:13 -0400 Subject: autoload/auditory.vim: Allow unmapping of non-normal mode commands Add support for unmapping a map from any mode where it was defined, not just normal mode mappings from `auditory#Unmap()`. --- autoload/auditory.vim | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/autoload/auditory.vim b/autoload/auditory.vim index 3e09a90..042c48b 100644 --- a/autoload/auditory.vim +++ b/autoload/auditory.vim @@ -509,11 +509,10 @@ endfunction function! auditory#Unmap() for [key, value] in items(s:mappings) let l:cmd = has_key(value, 'map_command') ? value.map_command : 'nnoremap' + let l:key = has_key(value, 'map_from') ? value.map_from : key let l:user_mapping = get(value, 'user_mapping', '') - if l:cmd ==# 'nnoremap' - execute 'nunmap ' . key - endif + execute l:cmd[0] . 'unmap ' . l:key if l:user_mapping !=# '' execute l:cmd . ' ' . get(value, 'map_from', key) . ' ' . value.user_mapping -- cgit v1.2.3