this post was submitted on 28 Jun 2023
5 points (85.7% liked)

Linux

8185 readers
416 users here now

Welcome to c/linux!

Welcome to our thriving Linux community! Whether you're a seasoned Linux enthusiast or just starting your journey, we're excited to have you here. Explore, learn, and collaborate with like-minded individuals who share a passion for open-source software and the endless possibilities it offers. Together, let's dive into the world of Linux and embrace the power of freedom, customization, and innovation. Enjoy your stay and feel free to join the vibrant discussions that await you!

Rules:

  1. Stay on topic: Posts and discussions should be related to Linux, open source software, and related technologies.

  2. Be respectful: Treat fellow community members with respect and courtesy.

  3. Quality over quantity: Share informative and thought-provoking content.

  4. No spam or self-promotion: Avoid excessive self-promotion or spamming.

  5. No NSFW adult content

  6. Follow general lemmy guidelines.

founded 1 year ago
MODERATORS
 

I know not everyone likes using vim but I thought those who do could share a good reason to get into it. For me its the repetition of the last change with the push of the dot key. Replace the current word with another and move the cursor to the next word you wish to replace. It makes the editor so versatile and feels very satisfying.

you are viewing a single comment's thread
view the rest of the comments
[โ€“] mekkagodzilla 6 points 1 year ago (1 children)

I use vim macros all the time. For example, you have a bunch of lines that need the same 3 operations done:

  • insert " at the beginning of the line
  • insert ", at the end on the line
  • indent

Press qa, do what you need to do on one line and go one line below, press q again to stop recording the macro, then you can do it 50 times with 50@a.

[โ€“] valen 3 points 1 year ago

I've done this a lot too. It's the kind of thing where someone watching says "what is this black magic and how do I got to make the text said what I want?".