Wednesday, August 22, 2012

Re: Using Alt in my keymaps and utf-8

On 21.08.12 08:19, Ben Fritz wrote:
> Even though Vim sees the keys as a Unicode character, pressing the
> keys should still execute the mapping.
>
> I don't think Vim can reliably do CTRL+Alt mappings, but I believe
> Alt-{key} mappings normally work fine.

Mostly. Over here, with:

VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Apr 18 2012 19:32:03)
Included patches: 1-496

these Alt mappings work for me in more cases than not:

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

They work fine in insert mode, and for single character replacement,
using "cl", but fail when using "r". e.g.

Applying "cl<A-a>" to "x" gives å, which is correct.
Applying "r<A-a>" to "x" gives á, which is wrong.

Maybe that has been fixed since patch 496. I've just learnt to use "cl"
instead of "r" - it's more flexible, anyway.

Erik

--
"The Southern Ocean occupies about 22 per cent of the area of the total ocean,
and yet it absorbs about 40 per cent of the carbon dioxide that's stored by the
ocean and about half the heat that's stored by the ocean," climate scientist
Steve Rintoul says.
- http://abc.com.au/news/2011-11-29/southern-ocean-waters-warming/3700532

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

No comments:

Post a Comment