I use a happy hacking keyboard and vim a lot.
Since there is no dedicated media key on my keyboard, I started using Karabiner.
I finally got around to looking through Karabiner docs and created HJKL key bindings for the media keys, enjoy!
- Install Karabiner
- Edit your private.xml file, typically located at /Users/your_user_name/Library/Application Support/Karabiner/private.xml
- Copy the private.xml file in this repo or just the parts you need
- Open up Karabiner and go to the Change Key tab. Reload XML & Select VIM Style Media Keys!
- If you found this repo helpful, star it!
- Feel free to open issues for suggestions if you'd like me to add more or want to contribute, thanks!
- (Option + H) Play Previous
- (Option + J) Volume Down
- (Option + K) Volume Up
- (Option + L) Play Next
Let's take a look at one of the key binding definitions:
<item>
<name>VIM Style Volume Down Mapping</name>
<appendix>Remaps Left OPTION + J to Media Key Volume Down</appendix>
<identifier>private-music-remap-volume-down</identifier>
<autogen>
__KeyToKey__
KeyCode::J, ModifierFlag::OPTION_L | ModifierFlag::NONE,
ConsumerKeyCode::VOLUME_DOWN
</autogen>
</item>
Just change ModifierFlag::OPTION_L
to any of these:
- ModifierFlag::ZERO
- ModifierFlag::CAPSLOCK
- ModifierFlag::SHIFT_L
- ModifierFlag::SHIFT_R
- ModifierFlag::CONTROL_L
- ModifierFlag::CONTROL_R
- ModifierFlag::OPTION_L
- ModifierFlag::OPTION_R
- ModifierFlag::COMMAND_L
- ModifierFlag::COMMAND_R
- ModifierFlag::NUMPAD
- ModifierFlag::FN
- ModifierFlag::NONE
Open an issue and I'll help you out.