aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2015-07-27TODO: Add some tasks related to the new mapping systemTeddy Wing
2015-07-26autoload/auditory.vim: Initial Unmap functionTeddy Wing
Unmaps all normal mode commands. This will be used to turn Auditory off. We'll want to also turn custom user mappings back on in the process but that's for a later commit.
2015-07-19auditory#StoreUserMapping: Operate on a single mappingTeddy Wing
Refactor to operate on one mapping passed in as an argument instead of the whole `s:mappings` dictionary. This will allow me to call the function inside `auditory#AssignMappings` and avoid having 2 `for` loops when 1 will suffice.
2015-07-19autoload/auditory.vim: Add function to store user mappingsTeddy Wing
Get any mappings users have defined for the keys/commands that we use for playing audio and store them in our `mappings` dictionary. This will allow us to be friendly and have the keys do what users have defined them to do instead of using the stock Vim actions for everything. Storing these mappings will also allow us to easily restore user mappings when we make a way to turn the plugin's sounds off by unmapping our custom sound maps.
2015-07-19auditory.vim: `AssignNormalModeMappings` -> `AssignMappings`Teddy Wing
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.
2015-07-19autoload/auditory.vim: Unsilence search commandsTeddy Wing
The search commands, as I has specified previously in the verbose mappings from before, should not be silenced, otherwise you can't see the useful output that they provide in the command line area. Add a way to make a mapping silent or not using a new field in the mappings dictionary.
2015-07-19autoload/auditory.vim: Reenable visual mode 'x' mappingTeddy Wing
Needed to come up with a way to add it to the `mappings` dictionary without overriding the existing normal mode 'x' mapping. Prefixed it with `v_` for the dictionary key so that it doesn't conflict, but that could easily be the start of a mapping (for whatever reason), so added a `map_from` field to make it explicit what we're mapping from in cases where the dict key is unclear. Also added another field to the dict to specify a custom mapping command. It will default to `nnoremap` as that's the one we use for most of our commands, but you can change it if you need another mode as we do for this visual 'x' mapping.
2015-07-18autoload/auditory.vim: Ensure we `<cr>` if we're not pipingTeddy Wing
If we're not piping to an `execute` command in the mapping, we need to `<cr>` to execute the sound player and type the normal mode command. Otherwise the normal mode command gets typed in command mode which is not what we want and messes things up greatly. Figured I would just tack the `<cr>` on to the pipe variable rather than create a new one since it's the inverse of what we need in that situation. Hopefully the intention is clear enough but I'll grant that this doesn't expose the most clarity. Edit: Added a comment for better explanation of the <cr>.
2015-07-18autoload/autoload.vim: Use `nnoremap` instead of `nmap`Teddy Wing
I wanted to use `nmap` so that user-defined commands would come through, but that caused the sounds to play recursively, a problem I now remember from when I originally wrote this. Change it to `nnoremap` by default to get around this. We'll look into whether it's possible to get user-defined mappings attached somehow. Maybe in the save-and-restore process.
2015-07-18autoload/auditory.vim: Always map with <silent>Teddy Wing
Turns out my assumption that we didn't need <silent> when `execute`ing in 83449bf7e30d45f91eccbcdffd56abb126be56c1 was incorrect. When performing <C-d>, the audio play command appears in the command line, which is not the behaviour we want. Let's just revert to always using `<silent>` and figure that should work for us. Figured out between the last commit and this one that my manual testing wasn't with the latest code. I was using a037e921a4b9b0539c93450fe3df1f6c8175ceab this whole time because I didn't have my development setup configured correctly. Now I can actually see what's going on as I make changes (what a concept!). Also bring back the ternary since we're not setting any more variables for this condition any more.
2015-07-18autoload/auditory.vim: Only map with `<silent>` if using `execute`Teddy Wing
We don't need to use `<silent>` in our mappings if we're going back to a regular non-command mode command, so listen for commands where we `execute` in the mapping and don't `<silent>` them. Reverted the ternary I had added previously to make this workable with the now 2 variables that need to listen for `execute`. Also add some line wrapping to the map creation for better readability.
2015-07-18autoload/auditory.vim: Delete auditory#NormalModeMappings()Teddy Wing
Now that we're assigning our mappings using the mapping dictionary, we can remove the old function that applied the mappings manually. It definitely less clear an readable I'll admit, but this allows us more flexibility and hopefully customisability. The original plan with the mapping dictionary was to allow toggling of the mappings on and off, so hopefully it will help with that.
2015-07-18auditory.vim: Assign mappings with AssignNormalModeMappings()Teddy Wing
Assign our normal mode mappings with our new function that uses the mapping dictionary.
2015-07-18auditory#AssignNormalModeMappings: Use ternary for pipe variableTeddy Wing
Assign the pipe variable with a ternary operator to make the function more concise.
2015-07-18autoload/auditory.vim: Change format of mapping dictionaryTeddy Wing
Convert it from a dictionary literal to successive appends to the mapping dictionary to allow me to keep the various comments and FIXMEs.
2015-07-18autoload/auditory.vim: Make dictionary of mappingsTeddy Wing
Create a dictionary with all our mappings. We'll use this to activate them programmatically. I think it might also be interesting to provide this as a configurable variable within the plugin so that users can change the built-in mappings if they so choose. Note that this doesn't currently work because you can't have comments in dictionary literals in Vimscript. Thanks to Raimondi on #vim for confirming that for me after I played around with this. Also thanks to bairui/dahu for his suggestion for emulating comments in dict literals: https://gist.github.com/dahu/18b48c70444d8078f7d7 " Barry Arthur, July 2015 " Kludge emulating comments in dict literals " :-0 surprised?! function! StripComments(comment_leader, dict) return filter(a:dict, 'v:key !~ "^" . escape(a:comment_leader, "\"")') endfunction let x = StripComments('REM', { \ 'a' : 1 \, 'REM This is a nasty workaround mimicking comments in dict literals' :-0 \, 'b' : 2 \, 'REM Duplicate keys are not tolerated within dict literals, hence the numbered comment keys' :-0 \, 'c' : 3 \, 'REM For the younger audience members, REM stands for "remark" and was the comment leader in BASIC' :-0 \, 'd' : 4 \})
2015-07-14TODO: Add task for toggling the plugin on and offTeddy Wing
Found the `maparg()` function over the weekend which I can now use to toggle Auditory mappings and sounds on and off.
2014-11-27plugin/auditory.vim: Don't reload the plugin if loadedv0.0.5Teddy Wing
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.
2014-11-22Update TODOv0.0.4Teddy Wing
Forgot to add a date completed entry to the mplayer task.
2014-11-22Merge branch 'error-message-if-no-mplayer'Teddy Wing
2014-11-22Update TODOTeddy Wing
Check off adding an error message when mplayer is missing.
2014-11-22plugin/auditory.vim: Decrease warning level of mplayer errorTeddy Wing
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.
2014-11-22plugin/auditory.vim: Show warning if mplayer not installedTeddy Wing
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.
2014-11-15Update TODOv0.0.3Teddy Wing
Check off adding pathogen installation instructions.
2014-11-15README: Add installation instructionsTeddy Wing
Provide basic instructions. I'm only familiar with pathogen, so that's what the example uses. You're free to use Vundle, NeoBundle, etc. if you prefer.
2014-11-15autoload/auditory.vim: Fix `d` not saving to register bugTeddy Wing
Previously my custom `d` and `dd` operators wouldn't save their deletions to the unnamed register. For normal custom operators this is exactly what you want, but not when you're making your own delete operator. When you notice this it becomes _extremely_ annoying. Fixing it here so now deleted text goes into the unnamed register.
2014-11-15Update TODOTeddy Wing
Check off new sound file updating.
2014-11-15Merge branch 'New-Sounds'Teddy Wing
2014-11-15autoload/auditory.vim: Update Cantina pathNew-SoundsTeddy Wing
Cantina sound files are now in the Resources/Songs/ directory.
2014-11-15autoload/auditory.vim: Update insert mode file listingTeddy Wing
Use the new C# scale files in insert mode for a wider range of notes.
2014-11-15Update TODOTeddy Wing
Add a few new TODOs from earlier this week.
2014-11-12Add new Directory "songs"Spencer Bateman
Move Cantina to songs
2014-11-12Add 3 Octave Notes for typingSpencer Bateman
Delete old notes
2014-11-10Update TODOv0.0.2Teddy Wing
Mark `dd` task complete.
2014-11-10Update TODOTeddy Wing
Add a note to map 'D' for deleting to the end of a line.
2014-11-10autoload/auditory.vim: Add `dd` supportTeddy Wing
Add support for deleting a line using `dd`. Previously this didn't work because I created a custom operator for the `d` command.
2014-11-10Update TODOTeddy Wing
Add some issues and ideas I thought about post-hackathon.
2014-11-09README: Add requirements sectionv0.0.1Teddy Wing
Let people know that this plugin requires mplayer. Note that we don't currently check for it in the plugin, but we should.
2014-11-09README: Add a section on contributingTeddy Wing
2014-11-09autoload/auditory.vim: Add custom `d` operatorTeddy Wing
Create a custom delete operator that plays the delete sound. NOTES: * Doesn't do `dd` * I just looked at the tcomment plugin source and realised that I should be using plugin mappings so these can be more easily overridden. Make a note to look into that.
2014-11-09Update TODOTeddy Wing
2014-11-09autoload/auditory.vim: Add new Cantina audio filesTeddy Wing
Add Spencer's new Cantina audio files to the cantina list. The new audio files are shorter individually (that's why there are more of them). This makes it easier to play the Cantina song at faster or slower ranges of tempos.
2014-11-09Add README & LICENSETeddy Wing
2014-11-09Add higher resolution cantina song.Spencer Bateman
Each audio file is an 8th note.
2014-11-09autoload/auditory.vim: Enable <space> & <backspace> mappings with FIXMETeddy Wing
Uncomment the space and delete mappings. Note that I had to remove count support on the delete key because it's another one of those that was giving me errors for that.
2014-11-09autoload/auditory.vim: Enable scrolling mappings with FIXMEsTeddy Wing
This way the sounds on scoll commands acutally work. They no longer support counts :( and the <c-b> command for some reason needs to be entered twice in order for it to work. Enable these for now just so we can get the sounds but add FIXMEs so we know that these are borked.
2014-11-09autoload/auditory.vim: Add undo & redo mappingsTeddy Wing
Again had an issue with adding a count to one of the mappings, in this case with redo. Leaving the mapping active except not supporting a count. Hopefully we can figure out how to fix that.
2014-11-09Undo and Redo soundsMackenzie Denker
2014-11-09autoload/auditory.vim: Move sound file arrays outside functionsTeddy Wing
Make arrays that store audio filenames script-local variables instead of function-local variables. Doing this because I have a hunch that it will be good for performance, so the arrays don't have to be reinitialised on every execution of the insert mode play functions.
2014-11-09autoload/auditory.vim: Add HML jump mappingsTeddy Wing