On Sat, 26 Oct 2013 18:46:22 -0700
"/#!/JoePea" <[email protected]> wrote:

> I've given this some thought. The backwards compatibility that users
> should experience should be as simple as possible.
> 
> For example, let's suppose someone has the following in their vimrc.
> 
> map <tab> :echo "hello"<cr>
> 
> Let me describe how the current behavior works and two possible ways
> the future behavior would work.
> 
> Currently, pressing <tab> or pressing <c-i> will echo "hello".
> 
> 
> 
> *1) The first way this could work in the future*, when vim
> differentiates ever key combination, is that pressing <tab> or
> pressing <c-i> would continue to echo "hello". However, the user
> could override the default <c-i> behavior by adding a new map in
> which case <c-i> would take on an all-new behavior:
> 
> map <tab> :echo "hello"<cr>
> map <c-i> :echo "world"<cr>
> 
> <c-i> would no longer echo "hello", it would echo "world". The same
> would apply to other aliases.

I feel this would be best. The /vast/ majority of vim users (at least,
if #vim on Freenode is anything to go by) would find that more
intuitive and correct; most aren't even aware of the Tab == C-i
identity anyway. Those few people who do rely on C-i actually meaning
the same as Tab will know enough to double-map them anyway.

> Most new users to vim are
> also new to terminals, and therefore they (like me) won't know that
> pressing <tab> is the same as pressing <c-i>. They'll discover this
> after having pulled their hair out over a <c-i> mapping in their
> vimrc.

Indeed.

> > How to detect the modifiers for many terminals in a portable way,
> > without requiring installing an obscure library (at least Ubuntu
> > must have it), I don't know.
> 
> I agree this might be tricky and not fully supported in terminals at
> first, but we should at least have this new functionality fully
> supported in graphical Vim. As Paul said, it's likely that if vim
> implements this new functionality, many terminal developers will
> incorporate support for the new key sequences within due time. If at
> least one terminal emulator supports it, I'll be extremely happy!

Hell, if all else fails, you can just copy-paste my libtermkey sources
directly into the vim tree - I specifically allow that sort of thing by
it having the MIT licence. In case that isn't sufficient I will
specifically state that now: I will allow you to copy the libtermkey
sources into vim, alter or modify them, and use them in any way you see
fit in order to make this feature work.


Initial research on a new blank vim looks promising. While it won't
recognise the keys you press, it does at least allow storing of 'map's
for them:

   <C-S-i>       "Again"
   <C-i>         "World"
   <Tab>         "Hello"

   <C-m>         "Again"
   <C-j>         "World"
   <Enter>       "Hello"

Curiously, while it can handle é vs <M-C> and <A-C>, it does seem to
consider M- and A- distinct:

   <M-C>         "World"
   <A-C>         "Hello"
   é             "Again"

-- 
Paul "LeoNerd" Evans

[email protected]
ICQ# 4135350       |  Registered Linux# 179460
http://www.leonerd.org.uk/

Attachment: signature.asc
Description: PGP signature

Raspunde prin e-mail lui