ajaxorg / ace

Ace (Ajax.org Cloud9 Editor)
https://ace.c9.io
Other
26.76k stars 5.29k forks source link

Add support for vim digraphs #4498

Open alecjacobson opened 3 years ago

alecjacobson commented 3 years ago

With vim bindings in insert mode, CRTL+K currently deletes all subsequent characters on the current line. I don't believe this is the default vim behavior.

In vim locally, pressing CTRL+K then two letters will insert a unicode character based on its digraph. This is a very handy way of typing unicode characters with a standard keyboard.

If there's an existing way to use vim digraphs in ACE, what is it?

If not, I would like to request supporting vim digraphs as a new feature.

nightwing commented 3 years ago

Insert mode uses general editor key bindings for keys that are not overridden by vim mode. Behavior of Ctrl-K is present in all textareas on mac. Currently there is no way to use digraphs in ace.

Is there a simple rule by which digraphs are defined or would we need to include the whole list of digraphs in the editor?

alecjacobson commented 3 years ago

Some of the digraphs have patterns: e.g., f → φ, s → σ, but most are two letter abbreviations intended to be easy to remember .p → ⋅ ("dot" P-roduct).

Probably best to just take the full digraphs table. In vim, this will show up if you type :help digraphs. If you type :digraphs you sees the full screen table with just codes and symbols.

github-actions[bot] commented 2 years ago

This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

reelbeelveel commented 1 year ago

bump

GTcreyon commented 9 months ago

Bump. Example use case: I'm currently studying Computer Science at university. When covering the order of algorithms, I often need to type symbols such as Θ, Ω, ω etc. into my notes. Searching these in a search engine in order to copy them across is tedious, and by the time I have done so, I have fallen behind.

Using digraphs would simplify this process, as I would be able to easily remember and recall the digraphs for the relevant symbols without having to search them up. This would keep me synchronized with lecture content.

dkretz commented 6 months ago

By far the best option for providing access to unicode. And the effort shouldn't be large. Trap the key-bksp-key sequence and emit from a mapping table.

GTcreyon commented 6 months ago

Bump. Example use case: I'm currently studying Computer Science at university. When covering the order of algorithms, I often need to type symbols such as Θ, Ω, ω etc. into my notes. Searching these in a search engine in order to copy them across is tedious, and by the time I have done so, I have fallen behind.

Using digraphs would simplify this process, as I would be able to easily remember and recall the digraphs for the relevant symbols without having to search them up. This would keep me synchronized with lecture content.

I've found that embedding LaTeX works well for my particular use case. $\Omega(n^2)$, for example. Still, digraphs remain useful for inserting unicode directly.