Gary Johnson
unread,Oct 27, 2021, 4:20:03 PM10/27/21Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to reply+ACY5DGGL33BYYDEFYX...@reply.github.com, vim...@googlegroups.com, vim...@googlegroups.com
On 2021-10-27, Julio Guerrero wrote:
> Hi Gary, I have applied those changes in my vimrc but the problem remains,
> after I ran the verbose command maps are pointing to my vimrc (same lines I
> added). I'm sorry I did not know this is the dev repo, will move my question to
> the other repo.
>
> Hi lacygoill, as per your questions:
>
> • $TERM: screen-256color
> • E846: Key code not set:
> • Ctrl-V then Ctrl-Right, delete lines
> • I use tmux
> • TERM out multiplexer: same as inside VIM - screen-256color
I'm using a different terminal now than I was this morning. Running
vim within tmux, I now see the problem.
In insert mode Ctrl-V Ctrl-Left inserts:
^[[1;5D
Ctrl-V Ctrl-Right inserts:
^[[1;5C
See
:help i_CTRL-V
Pressing Ctrl-Left in either normal or insert modes deletes the next
5 lines. Pressing Ctrl-Right also deletes 5 lines but goes to
insert mode.
That makes sense. Vim doesn't recognize those escape sequences so
it processes them as normal keystrokes. In normal mode, Vim ignores
that first <Esc> (^[). In insert mode, that first <Esc> puts Vim
into normal mode. Vim does not recognize the sequence [1 and
appears to ignore it. The ; will repeat the latest f, t, F or
T command. That may or may not move the cursor and affect the next
command. 5D deletes 5 lines. 5C deletes from the cursor to the end
of the line 4 more lines and starts insert mode.
I don't know the right solution at the moment, but a workaround
would be to put this in your vimrc.
if &term == "screen-256color"
nnoremap <Esc>[1;5C <C-Right>
nnoremap <Esc>[1;5D <C-Left>
inoremap <Esc>[1;5C <C-Right>
inoremap <Esc>[1;5D <C-Left>
endif
Regards,
Gary