Upgrade to current release of CodeMirror; now able to elegantly accomplish colon<->semicolon remap.

This commit is contained in:
jkaplon 2017-03-16 15:04:22 -04:00
parent 4df8bb5d12
commit 7cff1443aa

View File

@ -17,6 +17,7 @@
<script src="addon/edit/matchbrackets.js"></script>
<script src="keymap/vim.js"></script>
<script src="https://cdn.socket.io/socket.io-1.4.5.js"></script>
<script src="//cdn.jsdelivr.net/pouchdb/6.0.7/pouchdb.min.js"></script>
<style type="text/css">
html, body { height: 100%; margin: 0; padding: 0; }
.wrap {
@ -62,8 +63,8 @@
autofocus: true
});
// Add my .vimrc stuff.
CodeMirror.Vim.map('jj', '<Esc>', 'insert')
// Hacked semi-colon/colon swap remap into /assets/keymap/vim.js...a heavy-handed fix.
CodeMirror.Vim.map('jj', '<Esc>', 'insert');
CodeMirror.Vim.map(';', ':', 'normal');
// Note, ~/notes.kaplon.us/CodeMirror is symlinked it into /assets!
// These 2 mappings don't work, there's no concept of <leader> in CodeMirror, but i was hoping this would work-around it.
//CodeMirror.Vim.map(' c', '<Esc>o- [ ] ', 'normal')
@ -97,7 +98,7 @@
);
});
socket.on('conflict', alert(msg));
socket.on('conflict', function(msg){ alert(msg) });
</script>
</body>
</html>