코드미러 (Codemirror)

CodeMirror는 각종 컴퓨터 프로그램 코드를 웹상에서 쾌적한 환경으로 편집할 수 있도록 구축하는데 도움주는 자바스크립트 라이브러리이다. 전문 코드 편집기에 상응하는 문법 강조 및 코드 편집기능들을 제공한다. 특히 다중 편집 모드를 지원하여 HTML + CSS + JavaScript 또는 HTML + PHP처럼 여러 언어를 복합적으로 편집할 때에도 문법을 강조할 수 있다. 사용할 수 있는 언어로는 JavaScript, XML/HTML, CSS, SPARQL, PHP, Python, Lua, Ruby, SQL 이 있으며, 크로스-브라우저를 지원한다. 구글의 API 놀이터와 어스 KML 셈플러, 파이어버그 플러그인인 FireRainbow 등에서 CodeMirror를 이용한 편집기를 제공하거나 문법 강조기능을 활용하고 있다. 보다 자세한 사용법은 API 문서를 참조하라.

도쿠위키 (Dokuwiki) 편집시에도 사용할 수 있도록 해주는 플러긴이 있다. 다른 위지윅 플러긴 보다 완성도가 높다.

단축키

selectAllCtrl-A (PC), Cmd-A (Mac) Select the whole content of the editor.
singleSelectionEscWhen multiple selections are present, this deselects all but the primary selection.
killLineCtrl-K (Mac)Emacs-style line killing. Deletes the part of the line after the cursor. If that consists only of whitespace, the newline at the end of the line is also deleted.
deleteLineCtrl-D (PC), Cmd-D (Mac)Deletes the whole line under the cursor, including newline at the end.
delLineLeftDelete the part of the line before the cursor.
delWrappedLineLeftCmd-Backspace (Mac)Delete the part of the line from the left side of the visual line the cursor is on to the cursor.
delWrappedLineRightCmd-Delete (Mac)Delete the part of the line from the cursor to the right side of the visual line the cursor is on.
undoCtrl-Z (PC), Cmd-Z (Mac)Undo the last change.
redoCtrl-Y (PC), Shift-Cmd-Z (Mac), Cmd-Y (Mac)Redo the last undone change.
undoSelectionCtrl-U (PC), Cmd-U (Mac)Undo the last change to the selection, or if there are no selection-only changes at the top of the history, undo the last change.
redoSelectionAlt-U (PC), Shift-Cmd-U (Mac)Redo the last change to the selection, or the last text change if no selection changes remain.
goDocStartCtrl-Up (PC), Cmd-Up (Mac), Cmd-Home (Mac)Move the cursor to the start of the document.
goDocEndCtrl-Down (PC), Cmd-End (Mac), Cmd-Down (Mac)Move the cursor to the end of the document.
goLineStartAlt-Left (PC), Ctrl-A (Mac)Move the cursor to the start of the line.
goLineStartSmartHomeMove to the start of the text on the line, or if we are already there, to the actual start of the line (including whitespace).
goLineEndAlt-Right (PC), Ctrl-E (Mac)Move the cursor to the end of the line.
goLineRightCmd-Right (Mac)Move the cursor to the right side of the visual line it is on.
goLineLeftCmd-Left (Mac)Move the cursor to the left side of the visual line it is on. If this line is wrapped, that may not be the start of the line.
goLineLeftSmartMove the cursor to the left side of the visual line it is on. If that takes it to the start of the line, behave like goLineStartSmart.
goLineUpUp, Ctrl-P (Mac)Move the cursor up one line.
goLineDownDown, Ctrl-N (Mac)Move down one line.
goPageUpPageUp, Shift-Ctrl-V (Mac)Move the cursor up one screen, and scroll up by the same distance.
goPageDownPageDown, Ctrl-V (Mac)Move the cursor down one screen, and scroll down by the same distance.
goCharLeftLeft, Ctrl-B (Mac)Move the cursor one character left, going to the previous line when hitting the start of line.
goCharRightRight, Ctrl-F (Mac)Move the cursor one character right, going to the next line when hitting the end of line.
goColumnLeftMove the cursor one character left, but don't cross line boundaries.
goColumnRightMove the cursor one character right, don't cross line boundaries.
goWordLeftAlt-B (Mac)Move the cursor to the start of the previous word.
goWordRightAlt-F (Mac)Move the cursor to the end of the next word.
goGroupLeftCtrl-Left (PC), Alt-Left (Mac)Move to the left of the group before the cursor. A group is a stretch of word characters, a stretch of punctuation characters, a newline, or a stretch of more than one whitespace character.
goGroupRightCtrl-Right (PC), Alt-Right (Mac)Move to the right of the group after the cursor (see above).
delCharBeforeShift-Backspace, Ctrl-H (Mac)Delete the character before the cursor.
delCharAfterDelete, Ctrl-D (Mac)Delete the character after the cursor.
delWordBeforeAlt-Backspace (Mac)Delete up to the start of the word before the cursor.
delWordAfterAlt-D (Mac)Delete up to the end of the word after the cursor.
delGroupBeforeCtrl-Backspace (PC), Alt-Backspace (Mac)Delete to the left of the group before the cursor.
delGroupAfterCtrl-Delete (PC), Ctrl-Alt-Backspace (Mac), Alt-Delete (Mac)Delete to the start of the group after the cursor.
indentAutoShift-TabAuto-indent the current line or selection.
indentMoreCtrl-] (PC), Cmd-] (Mac)Indent the current line or selection by one indent unit.
indentLessCtrl-[ (PC), Cmd-[ (Mac)Dedent the current line or selection by one indent unit.
insertTabInsert a tab character at the cursor.
insertSoftTabInsert the amount of spaces that match the width a tab at the cursor position would have.
defaultTabTabIf something is selected, indent it by one indent unit. If nothing is selected, insert a tab character.
transposeCharsCtrl-T (Mac)Swap the characters before and after the cursor.
newlineAndIndentEnterInsert a newline and auto-indent the new line.
toggleOverwriteInsertFlip the overwrite flag.
saveCtrl-S (PC), Cmd-S (Mac)Not defined by the core library, only referred to in key maps. Intended to provide an easy way for user code to define a save command.
findCtrl-F (PC), Cmd-F (Mac)
findNextCtrl-G (PC), Cmd-G (Mac)
findPrevShift-Ctrl-G (PC), Shift-Cmd-G (Mac)
replaceShift-Ctrl-F (PC), Cmd-Alt-F (Mac)
replaceAllShift-Ctrl-R (PC), Shift-Cmd-Alt-F (Mac)Not defined by the core library, but defined in the search addon (or custom client addons).