Skip to content

Instantly share code, notes, and snippets.

@thomaswilburn
Last active December 31, 2015 10:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomaswilburn/7974814 to your computer and use it in GitHub Desktop.
Save thomaswilburn/7974814 to your computer and use it in GitHub Desktop.
[...]
var loadEmmet = true;
//one-time startup
var init = function() {
aceConfig.themes.forEach(function(theme) {
var option = document.createElement("option");
option.innerHTML = theme.label;
option.setAttribute("value", theme.name);
themes.append(option);
});
if(loadEmmet) {
//we need ace.lib.net to call loadScript, we can't just require Emmet and ask it to load itself
//remember that ace.require is basically a sync version of RequireJS.
ace.require("ace/lib/net").loadScript("js/ace/ext-emmet.js", function() {
editor.session.setMode("ace/mode/html");
editor.setOption("enableEmmet", true);
});
}
if (userConfig.emulateVim) {
ace.require("ace/lib/net").loadScript("js/ace/keybinding-vim.js", function() {
editor.setKeyboardHandler(ace.require("ace/keyboard/vim").handler);
});
}
reset();
};
[...]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment