-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Monaco VIM Support #125
Comments
Hi, this is Peng from VSCode team. I was thinking about adding Vim support for Monaco as well (very likely as an extension). I'm maintaining VSCodeVim (Vim emulator for VSCode) at the same time, considering VSCode API and Monaco API share the same semantics, we may be able to reuse most of the code logic in VSCodeVim. BTW, your work is insanely awesome (especially when you need to tweak Monaco to make it running smoothly with other components). |
Hey @rebornix, thank you so much for your work on vscode! I want to thank you and your team for making Monaco standalone, it's really valuable for the online editor progression. VIM support for Monaco would be really valuable. I'd like to help in any possible way. I know that I'm getting ahead of myself, but If you need any kind of access to CodeSandbox for the extension I can add it. There already is a package called |
@CompuIves thanks for all your kind words ;) I dig into our monaco interface and try to see how easy it is to build similar Vim extensions on top of it but unluckily it's not as powerful as VSCode one (which we did some undocumented change to unlock Vim). However due to Monaco's AMD nature, we can easily require necessary module and make the API ourselves. For example, the API we need to implement Vim is changing the behavior of require(['vs/platform/commands/common/commands'], function(command) {
var oldTypeCmd = command.CommandsRegistry.getCommand('type');
var oldHandler = oldTypeCmd.handler
command.CommandsRegistry.registerCommand('type', function(accessor, args) {
console.log(args);
oldHandler(accessor, args);
});
}); The rest of the work is just implementing the handler (but it is not as simple as it sounds like). I'm not sure how far you have gone with BTW, I saw you mentioned a react wrapper for Monaco in babel/website#1287 (comment) . It's another interesting topic as it's not intuitive to adopt Monaco within React, it would be awesome that there is mature React component which helps ppl out (especially webpack configuration). Lastly it's my first time seeing ppl make really good grammar/theming for React in Monaco, considering there is no code to reuse (unless we move to TextMate syntax one day), well done! |
I've been using this library as a React wrapper for monaco-editor |
@rebornix Thank you very much for this info, this is incredibly valuable! Yep, I'm using a custom version of the library @Arthelon mentioned, but it took me quite some time to support eg. JSX syntax highlighting (I'm currently adding classnames based on AST nodes, very inefficient but works atm) and ATA. Planning to make this an 'official' library with good support. |
I'd like to share more of my investigation with Vim in Monaco. The fastest way is always converting one existing Vim extension for VSCode to Monaco one. If you take a look at VSCodeVim's code, you'll know that following changes need to be done when porting it to Monaco
This can be a hackathon project within 1 or 2 day, I can help anyways if someone wants to play with it. |
Just published monaco-vim. It is inspired by how |
Wow! Thanks so much @brijeshb42! Will give it a try. |
That is awesome @brijeshb42! Thank you so much! I will also play with it. |
@brijeshb42 we're now using it on https://snack.expo.io/ and it's been working great! thanks again :) |
@satya164 Yeah, I saw your blog post |
Issue closed as we dropped the monaco editor in the latest release |
Create VIM support for the Monaco editor, allows us to drop codemirror.
The text was updated successfully, but these errors were encountered: