Friday, February 2, 2018

Re: Neither Emacs nor Vim nor Nano handle ligature literal insertion well

On 02.02.18 16:31, Andrew Pennebaker wrote:
> I would really like convenient access to ligatures in my word processing
> software. Unfortunately, none of the major text editing applications
> appears to handle ligatures intelligently: Each of Emacs, Vim, Nano, MS
> Word, Google Drive, Libre Office, and InDesign type a dumb "ae" when the
> user presses the a and e keyboard keys, whereas historically this sequence
> is typically rendered with the ash æ rune.

OK, but Vim handles all sorts of ligatures quite elegantly.
(See :h digraphs , and to list them :digraphs)
Granted, when I write emails in Danish, it quickly becomes tedious to
type ^Kae for æ, so I have the following mappings:

" Mapping Style:
:let mapleader = ";"

" Mapping åæø and «» is handier than digraphs:
inoremap <expr> <Leader>a "\uE5"
inoremap <expr> <Leader>e "\uE6"
inoremap <expr> <Leader>o "\uF8"
inoremap <expr> <A-<> "\uAB"
inoremap <expr> <A->> "\uBB"

Now ;e gives æ, ;a gives å, and ;o gives ø. While it's only one double
keystroke less, the typing style is much more natural and fully
mnemonic. Using <A-e> instead of <Leader>e would reduce it to one double
keystroke, but I find it mnemonically convenient to reserve the alt key
for more broadly transformative actions. If you need a literal ;e, as
in these examples, then ^V;e makes the semicolon literal.

If you need thorn, it's ^Kth, giving þ. Also useful is ^K2S when needing
e.g. m², and ^K+- for ±.

So it's all there, and has been for at least one decade, probably
two. And with mappings, convenience can be amplified.

Erik

--
When printing with movable type was invented around 1450, typefaces included
many ligatures and additional letters, such as the letter þ (thorn) which was
first substituted in English with y (e.g. ye olde shoppe), but later written as
th. - http://en.wikipedia.org/wiki/Ligature_%28typography%29

--
--
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: