aboutsummaryrefslogtreecommitdiffstats
path: root/autoload
diff options
context:
space:
mode:
authorTeddy Wing2015-07-26 12:05:12 -0400
committerTeddy Wing2015-07-26 12:05:12 -0400
commite2c581348cb66dc1446877e335ba4c3ccc17bd39 (patch)
tree7539f8b10b10563c578896710740c76245693e70 /autoload
parent8dc2441f00eff079dc7a62147f84ec40ad73c75d (diff)
downloadauditory.vim-e2c581348cb66dc1446877e335ba4c3ccc17bd39.tar.bz2
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.
Diffstat (limited to 'autoload')
-rw-r--r--autoload/auditory.vim11
1 files changed, 11 insertions, 0 deletions
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