Beehaw
  • Communities
  • Create Post
  • search
    Search
  • Login
  • Sign Up
 paequ2   ( @paequ2@lemmy.today )  to VIM - Vi IMproved@lemmy.sdf.org · 7 个月前

PSA: How to paste large amounts of text in Vim

message-square
message-square
6
link
fedilink
17
message-square

PSA: How to paste large amounts of text in Vim

 paequ2   ( @paequ2@lemmy.today )  to VIM - Vi IMproved@lemmy.sdf.org · 7 个月前
message-square
6
link
fedilink

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!

  •  PenguinCoder   ( @Penguincoder@beehaw.org ) A
    link
    fedilink
    arrow-up
    1
    ·
    7 个月前

    Just a habit, because you can run any command and get the stdout into vim in that method. Like for getting your shebang or an ls listing.

    •  Korthrun   ( @korthrun@lemmy.sdf.org ) 
      link
      fedilink
      arrow-up
      2
      ·
      7 个月前

      Then for the casual reader: don’t pick this habit up. There’s no reason to fork/exec a shell, invoke cat for the purpose of printing to stdout, then move the data into your buffer. You can just do :r somefile.txt.

VIM - Vi IMproved@lemmy.sdf.org

vim@lemmy.sdf.org

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !vim@lemmy.sdf.org

For Vim enthusiasts and anyone interested in Vim/Neovim!

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

#HJKL

Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 1 user / day
  • 1 user / week
  • 1 user / month
  • 7 users / 6 months
  • 11 local subscribers
  • 1.24K subscribers
  • 32 Posts
  • 99 Comments
  • Modlog
  • mods:
  •  Max Ficco   ( @maxficco@lemmy.sdf.org ) 
  •  Max Ficco   ( @maxficco@lemmy.world ) 
  • BE: 0.19.13
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code