Change navigation bindings in vim mode


I use the Dvorak Keyboard Layout and would like to change vim default navigation bindings (hjkl). It doesn’t really work with standard in the init file, because when I remap this way'h', '<Down>'), <Left> (the Left Arrow) gets also remapped to <Down>.

I think it’s because of

exports.treeKeyboardHandler = new HashHandler();
    "k": "goUp",
    "j": "goDown",
    "h": "levelUp",
    "l": "levelDown"

Is it possible to change treeKeyboardHandler.bindKeys in my init file?


I’ve figured it it out. It’s not because of the treeKeyboardHandler. The treeKeyboardHandler is just a handler for the directory tree, obviously. The problem is in the way the remapping in C9 works. It’s not possible to remap some default keys, only assign additional key to the same command, for instance motion.

I’ve figured out a work around in the init file, but should be improved.

Here is a dirty workaround if somebody needs it:

require(['plugins/c9.ide.ace.keymaps/vim/keymap'], function(vim) {
    var handler = require('ace/keyboard/vim').handler;
    var newDefaultKeymap = [
        {'lhs': 'd', 'rhs': 'h'},
        {'lhs': 'h', 'rhs': 'j'},
        {'lhs': 't', 'rhs': 'k'},
        {'lhs': 'n', 'rhs': 'l'},
        {'lhs': 'l', 'rhs': 't'},
        {'lhs': 'L', 'rhs': 'T'},
        {'lhs': 'k', 'rhs': 'n'},
        {'lhs': 'K', 'rhs': 'N'},
        {'lhs': 'j', 'rhs': 'd'},

    for (let key of handler.defaultKeymap) {
        // two loops are used because of break (for more readability)
        // consider to pack to one loop
        for (let keymap of newDefaultKeymap) {
            if (key.keys == keymap.rhs) {
                key.keys = keymap.lhs;
        for (let keymap of newDefaultKeymap) {
            if (key.toKeys == keymap.rhs) {
                key.toKeys = keymap.lhs;
    }'qq', '<Esc>', 'insert');
        't': 'goUp',
        'h': 'goDown',
        'd': 'levelUp',
        'n': 'levelDown'


what command do you use in vim to remap keys in this way?


There is a command :noremap in vim.

:noremap d h