Problem with some vim keybindings

editor

#1

Hi,
Where I made a mistake in my init.js?

// You can access plugins via the 'services' global variable
/*global services, plugin*/
require(["plugins/c9.ide.ace.keymaps/vim/keymap"], function(vim) {
    vim.map("jj", "<Esc>", "insert");              // ok
    vim.map("<C-k>", "10k", "normal");             // ok
    vim.map("<C-k>", "<Up>", "insert");            // it doesn't work
    vim.map("<C-j>", "10j", "normal");             // ok
    vim.map("<C-j>", "<Down>", "insert");          // it doesn't work
    vim.map("<C-h>", "<Left>", "normal");          // ok
    vim.map("<C-h>", "<Left>", "insert");          // it doesn't work
    vim.map("<C-l>", "<Right>", "normal");         // ok
    vim.map("<C-l>", "<Right>", "insert");         // it doesn't work
});

Thank you for any ideas :slight_smile:


#2

looks like map only invokes only commands defined by vim mode, so doesn’t work for insert mode.
Thanks for the bug report!


#3

but, it did work for

and isn’t that insert mode??


#4

right, it worked because <Esc> is implemented by the vim mode itself, almost all others fall back to ace defaults.