Sha256: 0179d0c6898c37a524c3c4e4fb847e8ba2853eb8a9878cb62eba937484abfdb4

Contents?: true

Size: 1.39 KB

Versions: 15

Compression:

Stored size: 1.39 KB

Contents

// 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", "Alt-V": "goPageUp",
    "Ctrl-J": "newlineAndIndent", "Enter": false, "Tab": "indentAuto",
    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
  };
})();

Version data entries

15 entries across 13 versions & 4 rubygems

Version Path
mdbe-0.1.0 public/libs/codemirror/keymap/emacs.js
maglev-database-explorer-0.0.5 public/libs/codemirror/keymap/emacs.js
maglev-database-explorer-0.0.4 public/libs/codemirror/keymap/emacs.js
maglev-database-explorer-0.0.3 public/libs/codemirror/keymap/emacs.js
maglev-database-explorer-0.0.2 public/libs/codemirror/keymap/emacs.js
maglev-database-explorer-0.0.1 public/libs/codemirror/keymap/emacs.js
codemirror-rails-3.13 vendor/assets/javascripts/codemirror/keymaps/emacs.js
codemirror-rails-3.12 vendor/assets/javascripts/codemirror/keymaps/emacs.js
codemirror-rails-3.02 vendor/assets/javascripts/codemirror/keymaps/emacs.js
swagr-0.0.10 examples/examples01/static/js/codemirror/keymap/emacs.js
swagr-0.0.10 templates/static/js/codemirror/keymap/emacs.js
swagr-0.0.8 examples/examples01/static/js/codemirror/keymap/emacs.js
swagr-0.0.8 templates/static/js/codemirror/keymap/emacs.js
codemirror-rails-3.00 vendor/assets/javascripts/codemirror/keymaps/emacs.js
codemirror-rails-2.36 vendor/assets/javascripts/codemirror/keymaps/emacs.js