this post was submitted on 22 May 2025
17 points (100.0% liked)

VIM - Vi IMproved

1172 readers
1 users here now

For Vim enthusiasts and anyone interested in Vim/Neovim!

"VIM is the greatest editor since the stone chisel." - Dr. Jose Unpingco

#HJKL

founded 2 years ago
MODERATORS
 

https://stackoverflow.com/questions/18258561/pasting-a-huge-amount-of-text-into-vim-is-slow/79633075

I recently ran into this. I didn't realize that the swpfile slowed down pastes.

I was trying to paste 50kb of text in Vim, but it kept getting stuck and I had to kill -9 it.

But, then I ran :set noswapfile and the paste was instant! TIL!

you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 6 points 1 week ago* (last edited 1 week ago) (4 children)

Save it in a text file in the same directory. Then open the file you want put it in with vim. Move the cursor to the spot in the file you want to paste the text. Hit Esc then : and type r!cat (the file name you saved and want to paste the data from) , press enter.

This will read in the other file and put the contents into the one you have open in vim.

[โ€“] zygo_histo_morpheus 7 points 1 week ago

you can just do :r path/to/file directly

load more comments (3 replies)