Thursday, June 18, 2020

Re: Input continuous stream of digraphs

Tony Mechelynck wrote:
On Wed, Jun 10, 2020 at 12:06 PM Manas <manas18244@iiitd.ac.in> wrote:

Hi guys, I want to know if it is possible to input digraphs continuously.

For example, when writing some math related assignment, often I have to write many symbols which I do using digraphs. But using <C-k> every time seems tedious. Is there a way I can make <C-k> (or anything else) work for infinite digraphs, until I manually end it.

Thanks
--
Manas
CSAM Undergraduate 2022

Rather than digraphs, maybe use a keymap (see :help mbyte-keymap)? I use that (rather than strings of digraphs) when writing Russian, or mixed Cyrillic and Latin as in my Russian-French dictionary; and I have a different one for Arabic, where there even aren't any digraphs (both of them own-coded because the keybord layouts, if any, distributed with Vim for these scripts don't suit me). It works quite well.

For math, Dr. Charles "Chip" Campbell wrote a "math keymap and menu". The following links are from his Vim page, http://www.drchip.org/astronaut/vim/ :
• latest "beta" version: http://www.drchip.org/astronaut/vim/#MATH
Since you mentioned it, Tony -- I decided to update my website with a new version of the "math keymap and menu" vimball.  Mostly just the "mathify" has been updated.  With it, one could type 12345678, then visually select the digits, and hit ^ to cause them all to become superscripts.  Do the same thing with "abcdef" and hitting &, result would be αβψδϵφ (ie. Greek variants).  Not quite the same as a "digraph mode", but one does get a lot of conversion with but a few keypresses.  Here's an example:

┌─────────┐
│  dilog  │
│  Li₂(x) │
│         │
│  ∞  xᵏ  │
│  ∑  ――  │
│ k=1 k²  │
└─────────┘

(I used DrawIt to do the box, btw, also available at my website: http://www.drchip.org/astronaut/vim/index.html#DRAWIT )

Regards,
Chip Campbell

No comments: