Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// add this to <profile>/static/custom/custom.js to load vim keybindings:
$.getScript("/static/components/codemirror/keymap/vim.js", function() {
if (! IPython.Cell) return;
IPython.Cell.options_default.cm_config.keyMap = "vim";
});
@minrk

This comment has been minimized.

Copy link
Owner Author

@minrk minrk commented Jul 6, 2013

requires IPython 1.0-dev

@asmeurer

This comment has been minimized.

Copy link

@asmeurer asmeurer commented Jul 17, 2013

Will it break older versions of IPython, or just not do anything?

@asmeurer

This comment has been minimized.

Copy link

@asmeurer asmeurer commented Jul 18, 2013

I tried replacing vim with emacs and it doesn't seem to work, though I'm not sure how to tell for sure.

@asmeurer

This comment has been minimized.

Copy link

@asmeurer asmeurer commented Jul 18, 2013

It definitely works with vim, though...

@nicolasfauchereau

This comment has been minimized.

Copy link

@nicolasfauchereau nicolasfauchereau commented Jul 18, 2013

thanks for that !
To get out of insert mode for me CTRL - [ or COMMAND - [ on macs works

@apleonhardt

This comment has been minimized.

Copy link

@apleonhardt apleonhardt commented Jul 31, 2013

Just to confirm, it works equally well for the included emacs keybindings:

$.getScript("/static/components/codemirror/keymap/emacs.js", function() {
if (! IPython.Cell) return;
IPython.Cell.options_default.cm_config.keyMap = "emacs";
});
@minrk

This comment has been minimized.

Copy link
Owner Author

@minrk minrk commented Jul 10, 2014

For a better snippet that more reliably affects all your cells, see @ivanov's vimception presentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.