aboutsummaryrefslogtreecommitdiffstats
path: root/plugin
diff options
context:
space:
mode:
authorTeddy Wing2014-11-09 06:42:35 -0500
committerTeddy Wing2014-11-09 06:42:35 -0500
commit5e115698dbeee222327ccd6407a0b18816bfbb86 (patch)
tree7cae51a622dbbe690a5a4766c05709b300a15d3c /plugin
parent2a9fff5b8bd5dd5928e0dd066ab2887e294b4efd (diff)
downloadauditory.vim-5e115698dbeee222327ccd6407a0b18816bfbb86.tar.bz2
plugin/auditory.vim: Add Galaxy Far Far Away toggle command
Add a command-mode command to toggle insert mode sounds between normal and Galaxy Far Far Away versions.
Diffstat (limited to 'plugin')
-rw-r--r--plugin/auditory.vim25
1 files changed, 23 insertions, 2 deletions
diff --git a/plugin/auditory.vim b/plugin/auditory.vim
index 7f2904a..e15f42e 100644
--- a/plugin/auditory.vim
+++ b/plugin/auditory.vim
@@ -169,13 +169,34 @@ call s:NormalModeMappings()
+let s:galaxy_far_far_away = 0
+function! auditory#ToggleGalaxyFarFarAway()
+ if s:galaxy_far_far_away
+ augroup auditory#insert_mode
+ autocmd!
+ autocmd CursorMovedI * call <SID>PlayScale()
+ augroup END
+ let s:galaxy_far_far_away = 0
+ else
+ augroup auditory#insert_mode
+ autocmd!
+ autocmd CursorMovedI * call <SID>GalaxyFarFarAway()
+ augroup END
+ let s:galaxy_far_far_away = 1
+ endif
+endfunction
+
+
+
augroup auditory#insert_mode
autocmd!
" autocmd InsertEnter * call s:PlayInsertEnter()
" autocmd InsertLeave * call s:PlayInsertLeave()
- " autocmd CursorMovedI * call s:PlayScale()
- autocmd CursorMovedI * call <SID>GalaxyFarFarAway()
+ autocmd CursorMovedI * call <SID>PlayScale()
augroup END
+command! AuditoryToggleGalaxyFarFarAway call auditory#ToggleGalaxyFarFarAway()
+
+
nnoremap <leader>so :source %<cr>