diff --git a/lib/ace/ext/textarea.js b/lib/ace/ext/textarea.js index a8f6317f..85db6ef0 100644 --- a/lib/ace/ext/textarea.js +++ b/lib/ace/ext/textarea.js @@ -324,6 +324,19 @@ function setupApi(editor, editorDiv, settingDiv, ace, options, loader) { editorDiv.style.fontSize = value; break; + case "keybindings": + switch (value) { + case "vim": + editor.setKeyboardHandler(require("ace/keyboard/vim").handler); + break; + case "emacs": + editor.setKeyboardHandler(require("ace/keyboard/emacs").handler); + break; + default: + editor.setKeyboardHandler(null); + } + break; + case "softWrap": switch (value) { case "off": @@ -391,6 +404,7 @@ function setupSettingPanel(settingDiv, settingOpener, editor, options) { theme: "Theme:", fontSize: "Font Size:", softWrap: "Soft Wrap:", + keybindings: "Keyboard", showPrintMargin: "Show Print Margin:", useSoftTabs: "Use Soft Tabs:", showInvisibles: "Show Invisibles" @@ -456,6 +470,11 @@ function setupSettingPanel(settingDiv, settingOpener, editor, options) { 80: "80", free: "Free" }, + keybindings: { + ace: "ace", + vim: "vim", + emacs: "emacs" + }, showPrintMargin: BOOL, useSoftTabs: BOOL, showInvisibles: BOOL @@ -518,6 +537,7 @@ exports.options = { gutter: "false", fontSize: "12px", softWrap: "off", + keybindings: "ace", showPrintMargin: "false", useSoftTabs: "true", showInvisibles: "true"