-
Notifications
You must be signed in to change notification settings - Fork 423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vim/emacs modes with settings #2173
Conversation
Uffizzi Preview |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
@josevalim feel free to merge if this works for you :)
💚 💙 💜 💛 ❤️ |
(Sorry to bump an already merged PR, but I'm not sure that this deserves a separate issue.) |
That's a regression from migrating to esbuild, fixed in ad562b8. As for exposing |
@jonatanklosko Thanks for the fix! // ==UserScript==
// @name Overleaf Editor Custom VIM Keybindings
// @version 0.1
// @match https://www.overleaf.com/project/*
// @grant none
// ==/UserScript==
window.addEventListener("UNSTABLE_editor:extensions", (event) => {
const { CodeMirrorVim } = event.detail;
CodeMirrorVim.Vim.map("jk", "<Esc>", "insert");
});; |
Thank you! For posterity, here is a modified version of the @isti115's UserScript that works in Livebook: // ==UserScript==
// @name Livebook VIM mappings
// @version 0.1
// @match https://YOUR_URL_HERE/*
// @grant none
// ==/UserScript==
const {VimMode} = window.unstable_monacoExtensions;
if (!VimMode) {
return;
}
VimMode.Vim.map("jk", "<Esc>", "insert"); (Don't forget to update the |
adds user settings (default: false) and support for both vim and emacs keybindings in monaco editors, via
monaco-vim
andmonaco-emacs
packagesnotes:
data-vim-mode
attr to the parent element and checking for "insert" value during handlingdoes this seem like a valid approach that is in line with livebook requirements/direction?