acode / copenhagen

Free, lightweight and hackable open source code editor for the web
MIT License
498 stars 29 forks source link

VIM keybindings #3

Open cviejo opened 3 years ago

cviejo commented 3 years ago

Looks fantastic. I'm going to go ahead and be that guy: VIM mode?

keithwhor commented 3 years ago

Do you want to give me the key mappings?

https://github.com/acode/copenhagen/blob/87bbb475881dc99ebbfeca500a51a1924839d4b5/src/Controls/CPHEditor/CPHEditor.js#L302

If you can create them for me in a gist I can add them as an option and refactor how hotkey mappings work. :)

cviejo commented 3 years ago

Basic vim motions would not be difficult to implement but also very limited. A better approach might be to use something similar to monaco-vim. It takes the keybindings and vim mode from codemirror and maps them to the monaco api. I'll take a look at it on the weekend.

keithwhor commented 3 years ago

Great. Let me know what you come up with and I can think about the best way to integrate it into the codebase!

calebeaires commented 3 years ago

Happy to see this being done. This is a good one!

keithwhor commented 3 years ago

Hey @cviejo just wondering if you found the hotkey mappings? I can integrate support for the VIM key mappings on our next major release as long as somebody gives them to me in JSON format.