aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--autoload/auditory.vim5
1 files 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