| Age | Commit message (Collapse) | Author |
|
My change from 71ec214cdb8814ecb71c837bf947583fda54d37e caused Galaxy
Far Far Away sounds to be turned on any time you had
`g:auditory_galaxy_far_far_away` turned on, regardless of whether
`g:auditory_on` was also turned on.
Fix this because we never want sounds to play when `g:auditory_on` is
off.
We now rely on `auditory#AssignInsertMappings()` to know whether to use
Galaxy Far Far Away or default insert mode sounds.
Need to toggle `g:auditory_galaxy_far_far_away` in that function because
we're calling the toggle function so we need to set it to the opposite
of what we want.
In the future if we add more insert mode sounds we'll have to change
this structure around but it should work for now.
|
|
Adding a configuration variable for these sounds allows them to be
turned on by default without having to
`:AuditoryToggleGalaxyFarFarAway`, so if you prefer these sounds you can
enable them at the outset.
|
|
* Create `auditory#ToggleMappings()` that turns sounds on if they're off
and off if they're on
* Create an `:AuditoryToggle` command that runs the toggle function in a
more user-friendly callable way
With a toggle command, turning Auditory on or off can be as simple as
hitting 1 custom mapping. With our previous `AuditoryOn` and
`AuditoryOff`, you would have to use 2 mappings: 1 for on and another
for off.
|
|
Realised that I don't need to explicitly check for 1, I can check
against true or false. Get rid of the explicit check to make this more
concise.
|
|
Don't heedlessly turn on sounds when the plugin is loaded. Instead, give
users a choice of whether or not sounds should be loaded when starting
Vim with a configuration variable that can be set in a user vimrc. By
default sounds are now off.
|
|
Create a new command to match `:AuditoryOff` that turns on mappings and
sounds. We'll need this because I'm going to make the plugin not enable
sounds by default. That will be controlled by a global variable. You'll
be able to turn the sounds on and off as you wish.
|
|
* 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
|
|
New command that turns the plugin off by removing its mappings.
|
|
Rename the function because we're not only assigning normal mode
mappings here, we're also assigning visual mode mappings. And we might
be assigning mappings for other modes here too in the future, so this
name doesn't make sense.
I had originally called it this to distinguish it from the insert mode
set defined in plugin/auditory.vim with the `CursorMovedI` autocommand,
but I think this should be more clear about what it's doing.
Edit: Also modify the comment above this section for similar reasons.
|
|
Assign our normal mode mappings with our new function that uses the
mapping dictionary.
|
|
I see this in the sources of all the plugins I look at. Figure I should
be a good Vim plugin citizen and do this too. This should also provide a
convenient way to turn off the plugin when starting Vim.
|
|
Instead of echoing and error, just echo a message about mplayer not
being installed. Errors look pretty annoying on initial load, and I
don't think this is worth the red background colour. It could be that a
user has two machines, one with mplayer installed and one without. In
that case, I don't want people to have to disable the plugin on one
machine. That seems like too much to ask.
I think this is a nice middle-ground between alerting users that
something is needed by the plugin and not barfing if it's not there.
|
|
On plugin load, if mplayer isn't installed then fail ungracefully. Since
we depend on mplayer in order to play any sounds, my thinking now is
that I want to fail immediately.
Still trying to decide if this is be best course of action. Maybe I just
want an informative message instead of a complete failure.
|
|
Clean up functions, move everything into autoload/, move code around a
little bit.
|
|
Add a command-mode command to toggle insert mode sounds between normal
and Galaxy Far Far Away versions.
|
|
Add commented mappings that I've been trying to get working but that for
one reason or another haven't been able to figure out how to do so.
|
|
Without this, the audio files wouldn't be able to play unless you were
cd'ed into the script's root directory. We want them to play no matter
where your pwd is.
|
|
Use the Jump sound for sentence & paragraph movement.
|
|
|
|
Add Jump sound mappings for:
* gg
* G
* <C-i>
* <C-o>
|
|
In addition to the regular search commands, add the search by word ones.
|
|
Use the Delete sound.
|
|
Use the Jump sound for these comands.
|
|
Map the search sounds to /nN.
|
|
|
|
Version of insert mode binding that maps to the Cantina song. Bits of
the song are in wav files. They get played in order on keypress in
insert mode.
|
|
Add mappings for beginning and end of line that play the left and right
sounds.
|
|
Map to up and down sounds.
|
|
Add mappings to the 'w', 'e', 'b' keys and their uppercase equivalents.
These map to the Left and Right sounds.
|
|
Add mappings for single-character movement using a pass-through that
plays the appropriate movement audio file.
|
|
The random note chosen should not be the same as the last note played in
insert mode.
|
|
When in insert mode, play a random note from the Scale on every
keypress.
|
|
Make the `Play()` function take an argument of the filename/path string.
|
|
These mappings were just to test functionality. The functions they
called are now being called in more appropriate places.
|
|
Intended to use a '#' but replaced it without realising at some point.
|
|
|
|
* Move test .vim file into the plugin/ directory. Some of the functions
added in this commit should be moved to autoload/ when this is more
together
* Add functions:
* Get & kill pids for mplayer
* Play audio
* Insert autocmd handlers
* Add InsertEnter & InsertLeave autocmds that start playing the test
song when entering insert mode and stop playing when you leave insert
mode.
|