Status = ALPHA i.e api may change/improve
Orchestra.nvim is a plugin for neovim that lets you bind sound effects to different actions. The motivation was mostly for fun but it seems useful for training good vim habits. You can literally hear unproductivity and when/where you could improve.
I use dein.vim
call dein#add('timeyyy/orchestra.nvim')
Then run
call dein#install()
UpdateRemotePlugins
- python3
- the neovim client for python -
pip install neovim
- pyaudio - install instructions
We have some rudimentary theme (tune) support
call dein#add('timeyyy/clacklack.symphony')
call orchestra#prelude()
call orchestra#set_tune('clackclack')
Themes are just normal vim plugins with a few requirements.
e.g theme "bumblebee_flight":
autoload/
bumblebee_flight.vim - the main file
buzz.wav - audio file
flap.wav
flap_1.wav
flap_2.wav
bublebee_flight.vim:
" Absolute path of script file with symbolic links resolved:
let s:current_file = resolve(expand('<sfile>:p'))
call OrchestraAddPath(s:current_file)
We can now customize the behavior of our script. For the moment we only have Ostinato
which is just autocmds.
call Ostinato('CursorMovedI', 'flap.wav')
call Ostinato('CursorMoved', 'buzz.wav')
If you just don't want to install a theme you can call Ostinato
from within your vimrc as long as it is after orchestra#prelude()
The Ostinato can handle multiple audio files. Multiple parts suffixed with : _# will automatically be discovered and played back at random.
Note audio files must be saved as 16bit wav, 32bit will NOT work
- Allow binding to specific keys
- Custom Events, i.e bind to a range of chars being deleted/inserted
- More themes
- Figure out why 80% Autcommands are not procing..
- Ability to squelch/prioritize simultaneous events
- Introspection functions i.e see what is registerd
- Unregister Function