How to disable ACE Editor's Find Dialog

It's better to use 'removeCommand' instead of use 'addCommand' with fake handler

editor.commands.removeCommand('find');

Andrei Andrushkevich's answer is now a better and simpler solution.


You can redefine the command associated with the shortcut by using editor.commands.addCommand, and then just supply an empty function. This custom definition will take precedence over the built-in one. In this case:

editor.commands.addCommand({
    name: "unfind",
    bindKey: {
        win: "Ctrl-F",
        mac: "Command-F"
    },
    exec: function(editor, line) {
        return false;
    },
    readOnly: true
})

Here's the updated JSFiddle. I didn't find clear documentation, but here's the editor.commands definition and here's where .addCommands() is. (Note: code may have changed since this answer was written.)

Edited as per jcubic's comment