Thursday, June 2, 2016

Re: subscripts and superscripts

2016-06-02 17:31 GMT+03:00 Charles E Campbell <drchip@campbellfamily.biz>:
> kamaraju kusumanchi wrote:
>> For normal editing purposes, I use vim and it works great. But once in
>> a while, I want to use subscripts and superscripts. For example, while
>> writing chemical equations I would like to see O with a subscript 2 to
>> represent the Oxygen molecule. Without using heavy weight stuff such
>> as Latex, could I somehow make vim/gvim show subscripts and
>> superscripts?
>>
>
> With my math plugin (see
> http://www.drchip.org/astronaut/vim/index.html#MATH), one may use visual
> mode on a digit and press "_" to make it into a subscript and press
> "^" to make it into a superscript. Use visual mode to select a
> alphameric character and press "&amp;" to make it into a corresponding
> Greek character. Use visual mode on a "->" or "<-" and transform it
> into a nice Utf-8 arrow.
>
> 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 vim_use+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

My [translit3][1] plugin contains transsymb-math transliteration
table, so you may use

:Tr3Command tof start transsymb-math
:" or
:let g:tr3_DefaultTranssymb = 'transsymb-math' | " Better put this
in the vimrc
\ts
:"`\ts` is normal-mode command that runs `:Tr3Command tof start`

to make `^3` automatically transformed into `³` as typed. Arrows `<-`
and `->` are also transformed into `←` and `→`. Greek letters are also
supported: e.g. `|a` is `α`. `:Tr3Command add -> → to transsymb-math`
can add what is missing.

With default settings though `%` temporary disables/enables
transliteration as you type and `@` breaks sequence (`^@3` results in
`^3`, this is needed to prevent some transformations like "shema" →
"шема" (error), while needed "s@hema" → "схема" ("scheme" in
Russian)), so you may need to choose another key or disable these
features.

[1]: https://bitbucket.org/ZyX_I/translit3

--
--
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 vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: