Add matchBrackets, hack a better solution to semi-colon/colon remap. It's all working a bit better!

This commit is contained in:
jkaplon 2016-09-28 19:24:47 -04:00
parent 1792ebd08e
commit 17d9f6f736

View File

@ -8,6 +8,7 @@
<script src="addon/dialog/dialog.js"></script>
<script src="addon/search/searchcursor.js"></script>
<script src="mode/markdown/markdown.js"></script>
<script src="addon/edit/matchbrackets.js"></script>
<script src="keymap/vim.js"></script>
<style type="text/css">
.CodeMirror {
@ -28,13 +29,13 @@
mode: "markdown",
lineNumbers: "true",
keyMap: "vim",
matchBrackets: true,
showCursorWhenSelecting: true,
viewportMargin: Infinity
});
// Add my .vimrc stuff.
CodeMirror.Vim.map('jj', '<Esc>', 'insert')
CodeMirror.Vim.map(';', ':')
CodeMirror.Vim.map(':', ';')
// Hacked semi-colon/colon swap remap into /assets/keymap/vim.js...kind of a heavy hammer might bite me later.
// This no worky, there's no concept of <leader> in CodeMirror, but i was hoping this would work-around it.
//CodeMirror.Vim.map(' c', '<Esc>o- [ ] ', 'normal')
//CodeMirror.Vim.map(' x', '<ESC>;s/\[\s\]/[x]/g<CR>;noh<CR>', 'normal')
@ -43,12 +44,12 @@
var keys = ''
CodeMirror.on(editor, 'vim-keypress', function(key) {
keys = keys + key
commandDisplay.innerHTML = keys
})
commandDisplay.innerHTML = keys;
});
CodeMirror.on(editor, 'vim-command-done', function(e) {
keys = ''
commandDisplay.innerHTML = keys
})
keys = '';
commandDisplay.innerHTML = keys;
});
var typingTimer;
editor.on("changes", function() {