This userscript enables Vim and Emacs keybindings for Udacity's embedded
CodeMirror editor. No longer will your code be littered
with stray i
s and dd
s!
Firefox: click here to install.
Chrome: click here
to download the script, packaged as a Chrome extension. Open your extension settings
(chrome://extensions/). Drag the .crx
file over the window and drop to install.
This script is also available on userscripts.org.
Once the script is installed, you'll see a 'Keybindings' button next to the "Reset" and "Test Run"
buttons underneath the embedded code editor. Click to rotate through the included keyboard
configurations: default, Vim, and Emacs. When Vim normal mode is enabled, you'll see
a fat blue cursor. Most of your favorite Vim commands will now work. (Try ci(
or 5dd
!)
To get a feel for what's available without messing up your own code, check out the
Vim and Emacs
demos from the CodeMirror site. I've only tested a few Emacs commands, but many of your
favorite inscrutable pinky contortions should be available too.
If you run into a bug, please open an issue here and I'll check it out. If you'd like to add a feature, feel free to fork and pull.
This code is released under an MIT license.