Skip to content

Instantly share code, notes, and snippets.

@buremba
Created February 15, 2016 23:40
Show Gist options
  • Save buremba/4e7a90209884819497bb to your computer and use it in GitHub Desktop.
Save buremba/4e7a90209884819497bb to your computer and use it in GitHub Desktop.
var plugins = ['codemirror', 'codemirror/addon/display/fullscreen'];
if(opts.lang === 'html') {
plugins = plugins.concat(['mode/javascript/javascript', 'mode/css/css',
'mode/vbscript/vbscript', 'mode/htmlmixed/htmlmixed',
'mode/xml/xml', 'addon/hint/show-hint', 'addon/hint/xml-hint', 'addon/hint/html-hint']);
} else
if(opts.lang === 'javascript') {
plugins.push('mode/javascript/javascript');
} else
if(opts.lang === 'css') {
plugins.push('mode/css/css');
} else
if(opts.lang === 'yaml') {
plugins.push('../../static/components/codemirror/mode/yaml/yaml');
} else
if(opts.lang === 'sql') {
plugins.push('../js/directives/graph/sql');
}
return require(plugins, function (CodeMirror) {
// Use CodeMirror here
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment