Back to Community
Enabling vim mode in the IDE

Is there currently a way to enable vim mode in the IDE? Since the in-browser editor is based on CodeMirror, in theory it should be able to support a vim based keymap (e.g. http://codemirror.net/demo/vim.html). That would really make it a much more friendly editor for some users.

4 responses

+1

+1

+1

Sad to see this opened for 3+ years and still no official reply

Well here is a way to hackily do it, open your web console and paste in highlighted content from
https://github.com/codemirror/CodeMirror/blob/ab25dd7582f4954fc05892c3a85f592fad509925/keymap/vim.js#L47-L5499

after that, also execute

quanto.editor.doc.cm.options['keyMap'] = 'vim'  

to retroactively set the keymap. And now you should have a editor that is in insert mode.

I also think you can automate this process via some browser plugin, but I just want to get started with the platform first :)

EDIT: If you have a blank document, it's not going to exit insert mode correctly, type something first!

EDIT 2: I have added some keybindnigs that I use for CodeMirror + a fix to handle the vim keymap initialisation better - you can find it here https://github.com/ryantam626/quantopian-vim-hack

EDIT 3: Looks like : in visual mode behaves weirdly, that's a bit annoying..