-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c549c33
commit 611304a
Showing
3 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"dependencies": { | ||
"monaco-vim": "^0.4.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
//To use this extension: | ||
// copy this file to the userData dir as in https://dyalog.github.io/ride/4.5/customising_your_session: | ||
// (package.json and package-lock.json are there for reference) | ||
// - Linux: `$HOME/.config/Ride-<version>` | ||
// - macOS: `$HOME/Library/Application Support/Ride-<version>` (hidden directory – access from the command line) | ||
// - Microsoft Windows: `%APPDATA%\Ride-<version>` | ||
// npm install --prefix /dir/to/this/file monaco-vim | ||
// export RIDE_JS=/path/to/this/file.js | ||
//before starting RIDE. | ||
$.extend(D.commands, { | ||
VIM(me) { | ||
amdRequire( | ||
[ "vs/editor/editor.main", | ||
D.el.app.getPath("userData") + "/node_modules/monaco-vim/dist/monaco-vim", ], | ||
function (a, MonacoVim) { vimMode = MonacoVim.initVimMode(me, document.createElement("div")); }, | ||
); | ||
me.updateOptions({ lineNumbers: "relative" }); | ||
}, | ||
MIV() { vimMode.dispose(); }, | ||
}); | ||
D.remDefaultMap = (me) => { // hijack to run additional code on startup | ||
const kbs = me._standaloneKeybindingService; | ||
kbs.addDynamicKeybinding( "-editor.action.insertCursorAtEndOfEachLineSelected", null, () => {}, ); | ||
kbs.addDynamicKeybinding("-editor.action.blockComment", null, () => {}); | ||
kbs.addDynamicKeybinding("-editor.action.formatDocument", null, () => {}); | ||
D.commands.VIM(me); | ||
}; | ||
$.extend(D.Ed.prototype, { | ||
setLN(x) { // update the display of line numbers and the state of the "[...]" button | ||
const ed = this; | ||
ed.me.updateOptions({ lineNumbers: "relative" }); | ||
ed.dom.querySelector(".tb_LN").classList.toggle("pressed", !!x); | ||
}, | ||
}); |