Tuesday, May 19, 2020

Re: issue subtituting new lines

On Di, 19 Mai 2020, Eli the Bearded wrote:

> I use several versions of vim throughout the day, all inside xterms, and
> some inside tmux running in an xterm. Some versions of vim I have
> noticed break my long standing way of adding newlines in a :s///
> substitute command.
>
> To make all %% sequences turn into a new line, what I'd type is:
>
> colon percent s slash percent percent slash ctrl-v ctrl-m slash g enter
>
> And that would look like this in vi, nvi, and vim up until recently:
>
> :%s/%%/^M/g
>
> On the versions that break that, it instead looks like this:
>
> :%s/%%/^[[27;5;109~/g
>
> Which will not (does not) provide the subtitution I want.
>
> I have found the vim I'm using on NetBSD inside xterms without tmux
> do this, but that same vim on NetBSD inside xterms with tmux does not
> do that.
>
> :version
> VIM - Vi IMproved 8.1 (2018 May 18, compiled Jan 7 2020 09:55:54)
> Included patches: 1-2200
> [...]
>
> :r! uname -sr
> NetBSD 8.1
>
> Inside tmux, $TERM is "screen", outside tmux $TERM is "xterm",
> $XTERM_VERSION is "XTerm(330)". Figuring out the exact differences
> between the screen and xterm terminal definitions is not something I
> want to dive into.
>
> If I use vim.old on that same system, the substitute works inside and
> outside of tmux. On vim.old:
>
> :version
> VIM - Vi IMproved 8.1 (2018 May 18, compiled Jun 11 2019 15:16:00)
> Included patches: 1-1517
>
> Is this a known bug that has been fixed in a patch after 2200? If so,
> I'll request the vim here be updated. If not, can this be fixed? (And
> then I'll request the update.)

A feature or a bug i suppose. What you are seeing are the effects of the
modifyOtherKeys feature of Vim and xterm (see :h modifyOtherKeys).

I am not sure why it happens for you when pressing CTRL-V in command
line mode, it does work for me as expected, unless you accidentally
pressed Shift-Ctrl-V instead of Ctrl-V

To disable it, set the t_TI and t_TE terminal settings to the empty
string:

let &t_TI=""
let &t_TE=""


Best,
Christian
--
Das Beste in einem Menschen ist das, was er selber nicht kennt.
-- Jean Paul

--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20200519175846.GB16708%40256bit.org.

No comments: