Skip to content

Commit

Permalink
Unmap insert mode sounds from auditory#Unmap()
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
teddywing committed Aug 16, 2015
1 parent d5b7bd6 commit a612f8f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
19 changes: 19 additions & 0 deletions autoload/auditory.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -485,6 +500,8 @@ function! auditory#AssignMappings()
\ l:pipe .
\ l:map_to_with_count
endfor

call auditory#AssignInsertMappings()
endfunction


Expand Down Expand Up @@ -518,4 +535,6 @@ function! auditory#Unmap()
execute l:cmd . ' ' . get(value, 'map_from', key) . ' ' . value.user_mapping
endif
endfor

call auditory#UnmapInsert()
endfunction
6 changes: 0 additions & 6 deletions plugin/auditory.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit a612f8f

Please sign in to comment.