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
On Wednesday, August 22, 2012 9:28:47 AM UTC-5, pabl...@gmail.com wrote:Why do our examples indicate you're doing it wrong?
>
> As you can see in my first post I a mtryin to map <M-t> to <C-W>v,
> So Alt+t will make a vertical split.
> But looking at your mapping examples seems I am doing the map wrong.
>
Looks like it should work to me. In fact, entering exactly that command into my gvim allows me to press ALT+t to open a new vertical split window, just as intended.
> Probably is because Vim sends the unicode keymao rather than the keymap I expect.
> What would be way to, let's say make my Alt-t keymap:
> nmap <M-t> <C-W>v
What happens if you open gvim with gvim -N -u NONE -i NONE and then execute your map command? Does it work then?
> But using unicode?
You should need absolutely zero knowledge of how Vim internally represents an ALT+t keystroke, nor how the keyboard sends it, in order to map it in gvim.
You can try using <Esc> as Chris suggests, but this should only work in some terminals, and it's a hack, not the "correct" solution. It WON'T work in gvim. I don't use the terminal enough to know off-hand what that "correct" solution is, but I'd get it working in gvim first and then figure out why it's not working in your terminal. See :help :map-alt-keys, which says (among many other things) that using the Alt keys in gvim "should always work".
--
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
On Wed, Aug 22, 2012 at 10:28:47AM EDT, Pablo Giménez wrote:[..]
> I am using Vim with terminals Mrxvt in Linux and iTerm2 in the Mac.
> I have the same problem in Gvim as well.
Don't have access to either..
What happens if you use <Esc> instead of <M- or <A-
i.e.
map <Esc>a :echo 'You hit Alt+A'<CR>
CJ
--
Mooo Canada!!!!
--
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
And remember that <Esc>t probably won't work in gvim, although ALT+t works out-of-the-box.
--
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