After hours of searching, I’m relieved that I finally found the solution. I couldn’t understand why there was a delay when I pasted something before the cursor with <Shift + P>
in Vim. What frustrated me was that even an empty .vimrc
file would create a ~1 second delay, while there was no delay if I had no .vimrc
file at all.
The solution
The issue is related to the set ttimeoutlen
option, which is set to -1
by default. This causes a delay of one second whenever a special key, such as <Shift>
, is pressed. Vim uses this waiting period to see if any additional keys will be pressed to complete a mapping sequence.
When there is no .vimrc
file in the user’s /home
folder, Vim loads the default configuration located in /usr/share/vim/vim*/default.vim
(where *
is the version number of Vim installed on your system). In this file, the ttimeoutlen
option is set to 100 ms, which is why I didn’t encounter any delay when testing without a .vimrc
file.