diff options
| author | Teddy Wing | 2015-08-16 02:19:58 -0400 | 
|---|---|---|
| committer | Teddy Wing | 2015-08-16 02:26:31 -0400 | 
| commit | a612f8fb835df92648401606dec6c2d07fa3ae4b (patch) | |
| tree | df9acd2ee66fe72fd8eda0f9ac220740c28cc73b | |
| parent | d5b7bd6857e82fd2b164d41b929426394dcbf10e (diff) | |
| download | auditory.vim-a612f8fb835df92648401606dec6c2d07fa3ae4b.tar.bz2 | |
Unmap insert mode sounds from `auditory#Unmap()`
* Move the insert mode autocommand definition into a new function that
  turns on insert mode sounds
* Create a function to turn off insert mode sounds
* Call these from our normal `AssignMappings` and `Unmap` functions so
  we can turn all our sounds on and off in one fell swoop
| -rw-r--r-- | autoload/auditory.vim | 19 | ||||
| -rw-r--r-- | plugin/auditory.vim | 6 | 
2 files changed, 19 insertions, 6 deletions
| diff --git a/autoload/auditory.vim b/autoload/auditory.vim index 042c48b..ffa2b1e 100644 --- a/autoload/auditory.vim +++ b/autoload/auditory.vim @@ -76,6 +76,21 @@ function! auditory#PlayScale()  endfunction +function! auditory#AssignInsertMappings() +	augroup auditory#insert_mode +		autocmd! +		autocmd CursorMovedI * call auditory#PlayScale() +	augroup END +endfunction + + +function! auditory#UnmapInsert() +	augroup auditory#insert_mode +		autocmd! +	augroup END +endfunction + +  let s:galaxy_far_far_away_index = 0  let s:cantina = [  	\ 'Cantina_1.1.wav', @@ -485,6 +500,8 @@ function! auditory#AssignMappings()  			\ l:pipe .  			\ l:map_to_with_count  	endfor +	 +	call auditory#AssignInsertMappings()  endfunction @@ -518,4 +535,6 @@ function! auditory#Unmap()  			execute l:cmd . ' ' . get(value, 'map_from', key) . ' ' . value.user_mapping  		endif  	endfor +	 +	call auditory#UnmapInsert()  endfunction diff --git a/plugin/auditory.vim b/plugin/auditory.vim index 21082f0..e8ceeba 100644 --- a/plugin/auditory.vim +++ b/plugin/auditory.vim @@ -11,12 +11,6 @@ if !executable('mplayer')  endif -augroup auditory#insert_mode -	autocmd! -	autocmd CursorMovedI * call auditory#PlayScale() -augroup END - -  command! AuditoryToggleGalaxyFarFarAway call auditory#ToggleGalaxyFarFarAway()  command! AuditoryOff call auditory#Unmap() | 
