Sunday, February 5, 2017

Re: Sed substitution did not go as planned...

On 2017-02-05 18:09, Shawn H Corey wrote:
> On Sun, 5 Feb 2017 16:14:41 -0600 Tim Chase wrote:
>> On 2017-02-05 16:30, Shawn H Corey wrote:
>>> On Sun, 5 Feb 2017 21:41:34 +0100
>>> Christian Brabandt <cblists@256bit.org> wrote:
>>>> That is known to confuse the Vim parser. I would not
>>>> recommend to map esc.
>>>>
>>>> http://vi.stackexchange.com/q/2614/71
>>>
>>> You're kidding right? The escape used to communicate should be
>>> separate from the Escape key mapping.
>>
>> As is mentioned in that thread, it may be possible within gvim,
>> but in terminal vim, the escape key already has a meta-level
>> meaning as a prefix for certain extended-key sequences (such as
>> arrows, function keys, alt+{key}, and the six-pack).
>
> THe key mapping should be internal to ViM and shouldn't interfere
> with xterm communication.

Right, but

1) vim sends escape sequences to ask the terminal for its
capabilities, and the terminal responds with escape-prefixed answers,
potentially triggering <esc> mappings unintendedly.

2) using the aforementioned extended-key sequences within your
terminal causes the terminal to send escape-prefixed commands to vim.
Vim usually uses the 'timeoutlen'/'ttimeoutlen' options to discern
them from a stand-alone <esc> key, but it can cause issues depending
on the connection speed.

This is how terminals have worked for decades, and it's highly
unlikely to change any time in the near future. Using gvim bypasses
the terminal, allowing the <esc> to be more reliable there.

-tim



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