On Sun, Apr 17, 2011 at 10:19:57AM -0400, Benjamin R. Haskell wrote: > >- It sounds like changing the internal Vim byte-stream > >representation for keypresses to actually be CSI could be a good > >idea. By making careful use of the private area we could ensure > >Vim can represent everything it needs to, plus almost by > >definition it can represent all the keys/modifiers required, plus > >it is somewhat future-proof. Does anyone have any objection to > >this? > > That sounds reasonable to me. I use rxvt-unicode, though, which is > (apparently) the only major holdout from the xterm-keycodes > monoculture. So, I have a particular interest in making sure the > conversion to/from CSI works right. (Volunteering services, here. > Not complaining.)
Ofcourse, it could be simpler just to get rxvt-unicode to use the way standard that every other terminal is now using to encode these keys. I'm not aware of any written -standard- setting these key sequences in concrete, short of my own webpage: http://www.leonerd.org.uk/hacks/fixterms/ however, if every terminal adopted the same way to do things, it would become a de-facto standard. :) > >For backward compatibility reasons, existing <>-notation should be > >considered ambiguous, but we should come up with an extension of > >this notation to be considered specific. Perhaps just adding an > >extra character after the opening '<'--for instance <!Enter> could > >mean Enter, specifically. When interpreting keypresses, specific > >keypresses would trigger specific mappings, or ambiguous mappings > >if no corresponding specific one exists; ambiguous keypresses > >would never trigger a specific mapping. This means you could map > ><Enter> and it would work in dumb terminals and the GUI, and > >existing plugins would keep working in both, too, including when > >you actually press Ctrl-M. However, in the GUI/smart terminal, you > >could override that default/ambiguous map, by mapping <!C-M> which > >would take precedence, but only be active when we are sure Ctrl-M > >was pressed and not Enter. Do others think this approach would > >work? > > This is where I diverge. I really, really think that this needs to > be a break from backwards compatibility. The other portion of my > apparently-confusing response was that there are only two reasons > that people expect the key sequences <Ctrl>+<M> and <Enter> to be > equivalent: > > One: they know a lot about terminals and hysterical raisins. > > Two: they've been bitten in the past where either: they were > required to input <Ctrl>+<M> when they wanted to be inputting > <Enter>, or their Vim mapping for <Ctrl>+<M> was "mysteriously" also > triggered upon hitting <Enter>. > > I argue that users in *both* categories actually want mappings to > <Ctrl>+<M> and <Enter> to be distinct. And, that they want <C-M> to > mean <Ctrl>+<M> and <Enter> to mean <Enter>. Anyone writing a > mapping where the opposite is true is only working around a > limitation of the current implementation. Thus, a > backwards-incompatible change is beneficial. I agree entirely. I can't think of anyone in any use case who would actively -want- Enter and Ctrl-M to be synonymous like this, who couldn't trivially just map <Enter> <Ctrl-M> in their own .vimrc as a workaround. This vanishingly-small set of users must not be allowed to hold the rest of the userbase back to 1970s semantics. > What I think is a horrible idea is to introduce more notation to > keymappings that only serves the purpose of indicating "Yes, I > really mean it" (Though, to that end, I do like your use of '!' as > the indicator). I think there is some room for considering this approach. In an ideal world, the lexical notation of mappings would exactly correspond to the physical set of pieces of plastic the user presses to obtain them. The world is not that ideal, yet. At the present time, we have to accept that there will be significant sets of user code, mappings, and so on, conflating the ideas of "the Tab key" vs "ctrl I". I think introducting a new notation which, in all honesty is not very intrusive, to break this piecewise; declaring for a single map alone "Yes, I'm aware of the new model"; is a good thing. It allows users to, on a per-key basis, map say Ctrl-C vs Ctrl-Shift-C individually, without applying mass breakage to their existing mapping files, plugins, etc... some of which may be well beyond their control or understanding. How many plugins long-abandonded by their original authors, do you suppose vim users have sitting about, all of which would require updating to the "new world" if applied en masse? -- Paul "LeoNerd" Evans [email protected] ICQ# 4135350 | Registered Linux# 179460 http://www.leonerd.org.uk/
signature.asc
Description: Digital signature
