ACE插件实现web编辑器

ace.require("ace/ext/language_tools");
var editor = ace.edit("editor");
editor.session.setMode("ace/mode/java");
editor.setTheme("ace/theme/tomorrow");
// enable autocompletion and snippets
editor.setOptions({
	enableBasicAutocompletion: true,
	enableSnippets: true,
	enableLiveAutocompletion: false
});
var code = editor.getValue();
editor.setTheme("ace/theme/"+$(this).text());
editor.setKeyboardHandler("ace/keyboard/"+$(this).text());
editor.setValue(code);
http://www.poorren.com/ace-editor-code-editor-guide/

你可能感兴趣的:(前端插件)