diff options
| author | Teddy Wing | 2015-08-16 02:08:13 -0400 | 
|---|---|---|
| committer | Teddy Wing | 2015-08-16 02:17:54 -0400 | 
| commit | d5b7bd6857e82fd2b164d41b929426394dcbf10e (patch) | |
| tree | 00328234065e367ca5e4a53af6d0a7a72eaaff01 | |
| parent | 099eb5c4209c7db737e3cf76b616fea98ca78a3e (diff) | |
| download | auditory.vim-d5b7bd6857e82fd2b164d41b929426394dcbf10e.tar.bz2 | |
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()`.
| -rw-r--r-- | autoload/auditory.vim | 5 | 
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 | 
