[vim/vim] Slow vim paste (showing character 'P' temporarily) (Issue #13003)

40 views
Skip to first unread message

Daniel Torres

unread,
Sep 1, 2023, 11:58:14 AM9/1/23
to vim/vim, Subscribed

Steps to reproduce

  1. Open a file with at least one word inside.
  2. Put cursor under the first letter in the word
  3. Now, do this sequence quickly - Change word (cw) , exit insert mode (ESC) and paste (P).
  4. Observe that paste is slightly slow and 'P' shows up for a split second before it disappears and the word from the buffer is actually pasted.

Expected behaviour

I expect paste that follows this sequence to be immediate and to not see the 'P' being displayed for a split second.
I tried to load vim without .vimrc and the issue persists.

vim -N -u NONE test

Version of Vim

VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Jul 2 2023 20:24:33) macOS version - arm64 Included patches: 1-1544

Environment

macOS
TERM = xterm-256color
shell = bash

Logs and stack traces

No response


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/13003@github.com>

lacygoill

unread,
Sep 1, 2023, 12:15:46 PM9/1/23
to vim/vim, Subscribed

ESC P is the Device Control String (aka DCS), which is used as a prefix in various sequences to call Device-Control functions. Vim is waiting to give such a possible sequence enough time to complete. This waiting time is controlled by 'ttimeoutlen' whose default value is -1. It means that Vim actually uses 'timeoutlen', whose default value is 1000 (i.e. 1 second).

You can delay the waiting time by setting 'ttimeoutlen' in your vimrc:

set ttimeoutlen=100

In this example, Vim will only wait 100 ms. Note that this value is set in defaults.vim, which is read when you start Vim with --clean instead of -u NONE.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/13003/1702997841@github.com>

Daniel Torres

unread,
Sep 1, 2023, 2:19:32 PM9/1/23
to vim/vim, Subscribed

Closed #13003 as completed.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/13003/issue_event/10259905005@github.com>

Daniel Torres

unread,
Sep 1, 2023, 2:19:32 PM9/1/23
to vim/vim, Subscribed

Thanks for the explanation @lacygoill .

The issue does go away by reducing ttimeoutlen.

I'm closing the issue.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/13003/1703158231@github.com>

Reply all
Reply to author
Forward
0 new messages