Only works on OS X (uses Core.Framework)
Add to vim
au InsertEnter * silent !/Users/mguindin/led_control
au InsertLeave * silent !/Users/mguindin/led_control 0
Modified from original Apple code: Apple HID LED test tool
Build using XCode or just use the compiled binary, led_control, which will work on OS X 10.10 and 10.11