typst / webapp-issues

Issue tracker for Typst's web app.
https://typst.app
9 stars 0 forks source link

Vimrc and Langmaps #366

Open Opisek opened 1 month ago

Opisek commented 1 month ago

Description

I would love to see the following implemented:

I believe the webapp to be using CodeMirror from what I read before. Is that the case?

If so, the newest version of CodeMirror-Vim already implements langmaps. Additionally, if I recally correctly, we have recently also fixed something similar to this (or are in the process of fixing it):

All that would need to happen is for the dependency to be updated and a per-user .vimrc configuration to be added. This is of course, if and only if you really do use CodeMirror-Vim under the hood.

Use Case

A .vimrc-like file for bindings would allow users to tailor your editor's Vim mode to their own liking. This is especially important for people who already have their long-running bindings that they're used to.

Langmaps can be seen as "supercharged" bindings. They allow the user to tell Vim what keyboard layout they use, so that it can be interpreted correctly in normal and visual modes. This is crucial for users of layouts other than QWERTY, in particular Colemak, Dvorak, or keyboards for other scripts entirely like Greek or Cyrillic. What it essentially does, is for example interpret α or β as a or b respectively, unless in insert or replace mode so that you can type in your preferred layout, but still use Vim as normal.

laurmaedje commented 1 month ago

We use @replit/codemirror-vim, so nice to hear that support is already there upstream!