Keyboard Maestro is the easiest option but it does not allow you to specify right option as it does not distinguish right and left versions of buttons. To do this you must use the Karabiner solution.
Keyboard Maestro
Create a new macro in Keyboard Maestro. Trigger the macro by the option This hot key:
and input ⌥Delete. Add a new action of type Type a Keystroke
. Input fndelete for the keystroke.
DefaultKeyBinding.dict
Navigate to ~/Library/KeyBindings
(Open finder then Press shift⌘G and paste that path). Add a folder named DefaultKeyBinding.dict
with the code:
{
"~\UF728" = deleteForward:;
}
If you want more information check out this great explanation of the DefaultKeyBinding.dict feature and the cocoa text system and the apple developer page for a list of commands that should work on any Cocoa text application. You may have to restart the application you are using to get this working.
For the most comprehensive list of possible commands for this feature check out osxnotes.net on the wayback machine.
Karabiner/Goku
You actually can create your own multi key stroke commands as shortcuts with Karabiner. They can be created by manually editing the karabiner configuration file.
However the configuration file is both difficult to read (written in JSON) and arguably very verbose. Goku provides a simpler [edn format] configuration option that it then compiles into karabiner-readable JSON.
karabiner.json
karabiner.edn
Karabiner actually captures and modifies input events at a low level, before they are interpreted by the operating system. It is a very powerful tool, allowing switchable modes, variables, application specific behavior, and triggering/reading output of system scripts among other things.