Vim shortcuts with commas not working

workspace

#1

I’ve got a set of vim shortcuts that are ingrained in muscle memory and I’d love to use them on C9. In vim I’ve mapped my <Leader> key to , (comma) but it won’t work for me on C9. Other vim keybindings work fine, but not the ones starting with ,.

    vim.map(",w", "c9:save", "normal")

This shortcut will just move left one character and left one word, instead of saving the file. Tried it in different browsers, but no luck. Any help would be much appreciated.


#2

, is being blocked by the default binding for it https://github.com/c9/core/blob/f7c79da0917c4f90346de16002d04675df2c7abc/node_modules/ace/lib/ace/keyboard/vim.js#L912
To what do you map repeatLastCharacterSearch in vim?


#3

Thanks for taking the time. I don’t use the repeatLastCharacterSearch. Reading the file you’ve linked, I’ve tried adding

vim.unmap(',');

to my initfile, but to no avail.


#4

Took a while but I fixed it. Replying for other people.

Turns out you can debug your initscript using the regular ol’ Chrome Inspector (Simply place a debugger; line in your init.js and have the inspector open while loading your workspace.) It’ll allow you to inspect and manipulate the default keymap.

   var leaderIndex = vim.aceKeyboardHandler.defaultKeymap.findIndex(function(m) {
        return m.keys === ',';
    });
    vim.aceKeyboardHandler.defaultKeymap.splice(leaderIndex, 1);