Re: Input continuous stream of digraphs

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Input continuous stream of digraphs

Manas Gupta

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

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/87bddb5f-af1b-e92e-9346-c111c64e6579%40iiitd.ac.in.
Reply | Threaded
Open this post in threaded view
|

Re: Input continuous stream of digraphs

John Passaro
you could write a function with a while 1 loop that calls getchar() twice and calls exec 'normal i<C-K>' . char1 . char2, then calls itself recursively. Then ctrl-C would get you out.

On Wed, Jun 10, 2020, 06:06 Manas <[hidden email]> 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

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/87bddb5f-af1b-e92e-9346-c111c64e6579%40iiitd.ac.in.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAJdN7KgxoixauWiafQqz3QorWXCSQrU7SmQrDfoTfgyH4asZcw%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Input continuous stream of digraphs

Manas Gupta

Hi, thanks for your reply.

On 11/06/20 1:47 am, John Passaro wrote:
you could write a function with a while 1 loop that calls getchar() twice and calls exec 'normal i<C-K>' . char1 . char2, then calls itself recursively. Then ctrl-C would get you out.

I ran into a some issues while doing this. I could not make <C-k> work under execute. For e.g.:

> function! TestFunc()

>    execute "normal! i<C-k>aa"

> endfunction

The above snippet is printing `<C-k>aa` as it is. How can I make it consider `<C-k>` as the control character rather than a string.

--
Manas
CSAM Undergraduate 2022

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/91165bd7-7ecc-90cd-582b-2196d6d8bb1e%40iiitd.ac.in.
Reply | Threaded
Open this post in threaded view
|

Re: Input continuous stream of digraphs

duvall
On Thu, Jun 11, 2020 at 09:43:44AM +0530, Manas wrote:

> Hi, thanks for your reply.
>
> On 11/06/20 1:47 am, John Passaro wrote:
> > you could write a function with a while 1 loop that calls getchar()
> > twice and calls exec 'normal i<C-K>' . char1 . char2, then calls itself
> > recursively. Then ctrl-C would get you out.
>
> I ran into a some issues while doing this. I could not make <C-k> work under
> execute. For e.g.:
>
> > function! TestFunc()
>
> >    execute "normal! i<C-k>aa"
>
> > endfunction
>
> The above snippet is printing `<C-k>aa` as it is. How can I make it consider
> `<C-k>` as the control character rather than a string.

This might also be of interest:

    https://github.com/DrCracket/painless-digraph

Haven't used it myself, but it's been on my list to take a look at.

Danek

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20200611050921.GB3812%40comfychair.org.
Reply | Threaded
Open this post in threaded view
|

Re: Input continuous stream of digraphs

Tony Mechelynck
In reply to this post by Manas Gupta
On Wed, Jun 10, 2020 at 12:06 PM Manas <[hidden email]> 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/ :
Or if you prefer writing your own, here is a short HowTo page: https://vim.fandom.com/wiki/How_to_make_a_keymap

Best regards,
Tony.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAJkCKXt1k1cYusbh%2B%2BJODdwbJemmVqcGBM%3D3cDC-CuQOu_qXuA%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Input continuous stream of digraphs

Tony Mechelynck
On Thu, Jun 11, 2020 at 8:31 AM Tony Mechelynck
<[hidden email]> wrote:

>
> On Wed, Jun 10, 2020 at 12:06 PM Manas <[hidden email]> 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.

Oops! For Arabic there also are digraphs. But for more than two or
three consecutive letters, a keymap is much less "tedious" as you call
it.

>
> 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/ :
> • stable version: http://vim.sourceforge.net/scripts/script.php?script_id=2723
> • latest "beta" version: http://www.drchip.org/astronaut/vim/#MATH
>
> Or if you prefer writing your own, here is a short HowTo page: https://vim.fandom.com/wiki/How_to_make_a_keymap
>
> Best regards,
> Tony.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAJkCKXusGpPpdXFX5cv8H1JhKdmfdo3q%3DywJWsTmPhdUg8r3sg%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Input continuous stream of digraphs

Andy Wokula
In reply to this post by Manas Gupta
Am 10.06.2020 um 12:05 schrieb Manas:
> Hi guys, I want to know if it is possible to input digraphs
> continuously.

To some extent, everything is possible.

> 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

Sticky digraphs
https://gist.github.com/Houl/31d1340c2de566de071bd02e6049382e


--
Andy

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/5EE281A8.4010503%40yahoo.de.
Reply | Threaded
Open this post in threaded view
|

Re: Input continuous stream of digraphs

trialero
In reply to this post by Manas Gupta
On Wed, Jun 10, 2020 at 03:35:48PM +0530, Manas 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.

Use LaTeX for writing math stuff, or use a logic combination of regular
characters and substitute them after writing. you could also use aliases
for direct substitution.

//meine

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20200618132811.GD1820%40trackstand.
Reply | Threaded
Open this post in threaded view
|

Re: Input continuous stream of digraphs

Charles Campbell-2
In reply to this post by Tony Mechelynck
Tony Mechelynck wrote:
On Wed, Jun 10, 2020 at 12:06 PM Manas <[hidden email]> 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

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/29534d5e-2490-4fdb-d958-7db140c9f4b8%40drchip.org.