mirror of
https://github.com/GoogleChrome/chrome-extensions-samples.git
synced 2026-04-04 14:49:44 +07:00
* Remove docs folder. This was a redirect from a GitHub pages site that does not appear to be in use. * Rename api folder to api-samples. * Move examples to functional-samples folder. * Move cookbook sample to functional-samples. * Move tutorials to functional-samples folder. * Move mv2 and apps folders to _archive. * Rename tools folder to .repo. * Move reference folder to functional-samples. * Update README. Update README with new relative links for reorg. * Update README.md Co-authored-by: amysteamdev <37001393+AmySteam@users.noreply.github.com> --------- Co-authored-by: amysteamdev <37001393+AmySteam@users.noreply.github.com>
30 lines
1.3 KiB
JavaScript
30 lines
1.3 KiB
JavaScript
// TODO number prefixes
|
|
(function() {
|
|
// Really primitive kill-ring implementation.
|
|
var killRing = [];
|
|
function addToRing(str) {
|
|
killRing.push(str);
|
|
if (killRing.length > 50) killRing.shift();
|
|
}
|
|
function getFromRing() { return killRing[killRing.length - 1] || ""; }
|
|
function popFromRing() { if (killRing.length > 1) killRing.pop(); return getFromRing(); }
|
|
|
|
CodeMirror.keyMap.emacs = {
|
|
"Ctrl-X": function(cm) {cm.setOption("keyMap", "emacs-Ctrl-X");},
|
|
"Ctrl-W": function(cm) {addToRing(cm.getSelection()); cm.replaceSelection("");},
|
|
"Ctrl-Alt-W": function(cm) {addToRing(cm.getSelection()); cm.replaceSelection("");},
|
|
"Alt-W": function(cm) {addToRing(cm.getSelection());},
|
|
"Ctrl-Y": function(cm) {cm.replaceSelection(getFromRing());},
|
|
"Alt-Y": function(cm) {cm.replaceSelection(popFromRing());},
|
|
"Ctrl-/": "undo", "Shift-Ctrl--": "undo", "Shift-Alt-,": "goDocStart", "Shift-Alt-.": "goDocEnd",
|
|
"Ctrl-S": "findNext", "Ctrl-R": "findPrev", "Ctrl-G": "clearSearch", "Shift-Alt-5": "replace",
|
|
"Ctrl-Z": "undo", "Cmd-Z": "undo", "Alt-/": "autocomplete",
|
|
fallthrough: ["basic", "emacsy"]
|
|
};
|
|
|
|
CodeMirror.keyMap["emacs-Ctrl-X"] = {
|
|
"Ctrl-S": "save", "Ctrl-W": "save", "S": "saveAll", "F": "open", "U": "undo", "K": "close",
|
|
auto: "emacs", nofallthrough: true
|
|
};
|
|
})();
|