jQuery取得CodeMirror实例对象 [前端开发]
//Get a reference to the CodeMirror editor
var editor = $('.CodeMirror')[0].CodeMirror;
//You can then use it as you wish 
editor.setValue('lorem ipsum yada yada'); 
editor.replaceSelection('this is a test');
参考:http://wisercoder.com/get-reference-codemirror-instance/