[IPython-dev] Emacs/Vim keybindings in the notebook
Brian Granger
ellisonbg at gmail.com
Thu Jan 26 12:37:21 EST 2012
Fernando,
I am working on the client side configuration stuff. But a temporary
fix would be to allow these things to be configured using the
Javascript API. Something like:
IPython.notebook.enable_vim_kb()
IPython.notebook.enable_emacs_kb()
IPython.notebook.enable_default_kb()
That is much better than forcing a user to edit the source code. That
is currently how I am handling things that need configuration. A JS
API until we get the config UI done. I wouldn't even mind merging
this type of thing into master so users can start to play with it.
How does that sound?
Cheers,
Brian
On Wed, Jan 25, 2012 at 11:35 PM, Fernando Perez <fperez.net at gmail.com> wrote:
> Hi all,
>
> here's a branch:
>
> https://github.com/fperez/ipython/tree/cm-keymaps
>
> for some enterprising user who wants to add support for the new
> emacs/vim keybinding modes in the notebook. The reason I'm not making
> a PR out of it is that it would require client-side configuration, so
> that users can choose which keymap to use (or none at all, which is
> the default today and leaves the text area to be managed by the
> browser bindings-wise). Since the problem of client-side
> configuration isn't trivial and I don't have time to work on it right
> now, this can't really be merged.
>
> In the meantime, anyone who wants to keep this in their local tree can
> just pull this branch in, right now it's set for emacs mode, but you
> just need to replace 'emacs' with 'vim' in two places:
>
> https://github.com/fperez/ipython/commit/b5a09444a8e6963d6fbde9db168d0c37e6949cc3
>
> to get vim keybindings.
>
> The emacs bindings are pretty limited, with lots of imoprtant ones
> missing. But the vim.js file looks a lot larger, so it may be that
> one is more solid. You can play with the bindings in the CodeMirror
> demos right away without having to patch IPython:
>
> http://codemirror.net/demo/emacs.html
> http://codemirror.net/demo/vim.html
>
> My real hope with this is that someone will want this bad enough that
> they'll do the work of building the config system to get there. Think
> of this branch as a fishing hook, I'm just hoping it will go deep
> enough into someone's belly to reel them all the way into a config
> system ;)
>
> Cheers,
>
> f
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
--
Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger at calpoly.edu and ellisonbg at gmail.com
More information about the IPython-dev
mailing list