mirror of
https://github.com/chinchang/web-maker.git
synced 2025-07-14 10:36:19 +02:00
add basic support for vim. commands dont show right now. fixes #83
This commit is contained in:
@ -392,6 +392,12 @@
|
|||||||
Theme
|
Theme
|
||||||
<select style="flex:1;margin:0 20px" data-setting="editorTheme" d-change="updateSetting"></select>
|
<select style="flex:1;margin:0 20px" data-setting="editorTheme" d-change="updateSetting"></select>
|
||||||
</label>
|
</label>
|
||||||
|
<label class="line">
|
||||||
|
<input type="radio" checked="true" name="keymap" value="sublime" d-change="updateSetting" data-setting="keymap"> Sublime key bindings
|
||||||
|
</label>
|
||||||
|
<label class="line">
|
||||||
|
<input type="radio" name="keymap" value="vim" d-change="updateSetting" data-setting="keymap"> Vim key bindings
|
||||||
|
</label>
|
||||||
<label class="line">
|
<label class="line">
|
||||||
<input type="checkbox" d-change="updateSetting" data-setting="preserveLastCode"> Preserve last written code
|
<input type="checkbox" d-change="updateSetting" data-setting="preserveLastCode"> Preserve last written code
|
||||||
</label>
|
</label>
|
||||||
@ -581,6 +587,7 @@ Import
|
|||||||
<script src="lib/codemirror/mode/css/css.js"></script>
|
<script src="lib/codemirror/mode/css/css.js"></script>
|
||||||
<script src="lib/codemirror/mode/htmlmixed/htmlmixed.js"></script>
|
<script src="lib/codemirror/mode/htmlmixed/htmlmixed.js"></script>
|
||||||
<script src="lib/codemirror/keymap/sublime.js"></script>
|
<script src="lib/codemirror/keymap/sublime.js"></script>
|
||||||
|
<script src="lib/codemirror/keymap/vim.js"></script>
|
||||||
<script src="lib/emmet.js"></script>
|
<script src="lib/emmet.js"></script>
|
||||||
<script src="lib/code-blast.js"></script>
|
<script src="lib/code-blast.js"></script>
|
||||||
|
|
||||||
|
5117
src/lib/codemirror/keymap/vim.js
vendored
Normal file
5117
src/lib/codemirror/keymap/vim.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@ -1143,6 +1143,7 @@ onboardDontShowInTabOptionBtn, TextareaAutoComplete */
|
|||||||
$('[data-setting=indentWith][value=' + (prefs.indentWith || 'spaces') + ']').checked = true;
|
$('[data-setting=indentWith][value=' + (prefs.indentWith || 'spaces') + ']').checked = true;
|
||||||
$('[data-setting=isCodeBlastOn]').checked = prefs.isCodeBlastOn;
|
$('[data-setting=isCodeBlastOn]').checked = prefs.isCodeBlastOn;
|
||||||
$('[data-setting=editorTheme]').value = prefs.editorTheme;
|
$('[data-setting=editorTheme]').value = prefs.editorTheme;
|
||||||
|
$('[data-setting=keymap]').value = prefs.keymap;
|
||||||
}
|
}
|
||||||
|
|
||||||
scope.updateSetting = function updateSetting(e) {
|
scope.updateSetting = function updateSetting(e) {
|
||||||
@ -1168,6 +1169,7 @@ onboardDontShowInTabOptionBtn, TextareaAutoComplete */
|
|||||||
scope.cm[type].setOption('indentUnit', $('[data-setting=indentSize]').value);
|
scope.cm[type].setOption('indentUnit', $('[data-setting=indentSize]').value);
|
||||||
scope.cm[type].setOption('tabSize', $('[data-setting=indentSize]').value);
|
scope.cm[type].setOption('tabSize', $('[data-setting=indentSize]').value);
|
||||||
scope.cm[type].setOption('theme', $('[data-setting=editorTheme]').value);
|
scope.cm[type].setOption('theme', $('[data-setting=editorTheme]').value);
|
||||||
|
scope.cm[type].setOption('keyMap', $('[data-setting=keymap]').value);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1435,7 +1437,8 @@ onboardDontShowInTabOptionBtn, TextareaAutoComplete */
|
|||||||
isCodeBlastOn: false,
|
isCodeBlastOn: false,
|
||||||
indentWith: 'spaces',
|
indentWith: 'spaces',
|
||||||
indentSize: 2,
|
indentSize: 2,
|
||||||
editorTheme: 'monokai'
|
editorTheme: 'monokai',
|
||||||
|
keymap: 'sublime'
|
||||||
}, function syncGetCallback(result) {
|
}, function syncGetCallback(result) {
|
||||||
if (result.preserveLastCode && lastCode) {
|
if (result.preserveLastCode && lastCode) {
|
||||||
unsavedEditCount = 0;
|
unsavedEditCount = 0;
|
||||||
@ -1462,6 +1465,7 @@ onboardDontShowInTabOptionBtn, TextareaAutoComplete */
|
|||||||
prefs.indentSize = result.indentSize;
|
prefs.indentSize = result.indentSize;
|
||||||
prefs.indentWith = result.indentWith;
|
prefs.indentWith = result.indentWith;
|
||||||
prefs.editorTheme = result.editorTheme;
|
prefs.editorTheme = result.editorTheme;
|
||||||
|
prefs.keymap = result.keymap;
|
||||||
|
|
||||||
updateSettingsInUi();
|
updateSettingsInUi();
|
||||||
scope.updateSetting();
|
scope.updateSetting();
|
||||||
|
Reference in New Issue
Block a user