💾 Archived View for midnight.pub › posts › 1028 captured on 2023-11-14 at 09:58:53. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2022-07-16)

-=-=-=-=-=-=-

Midnight Pub

Learning Vim, what am i doing?

~the_bebop_cowboy

I've been using Linux and the Linux terminal for a long time. I dabble in programming, web development, server management, and all sorts of fun open-source stuff. I've always got by with using nano for everything. I think I used to do stuff before nano, but I can't for the life of me remember what I used then. Maybe just a bunch of 'cat' and gui text editors? Anyway, I've always heard that Vi/Vim is "powerful" and can speed up your coding. I've heard that wars have been fought over emacs vs vi (I've used neither very much). But I've decided to take the plunge. I'm working my way through vimtutor, taking notes, working on mnemonics. It really seems like a lot, but I'm starting to get the benefit. Jumping around words and lines, searching for keywords, inserting files, running terminal commands in the editor, all without touching the mouse. I can definitely see how it could make things a little smoother.

So, can anyone else relate to this struggle? Any long time Vim users with some words of wisdom for me? Or just wish me luck if you don't mind. ~bartender, pour me a coffee would you? Think its gonna be a long day.

Write a reply

Replies

~benj wrote:

Welcome to the club! I can’t I’m an exclusive vim user since for work I just need to get stuff done and jetbrains is fantastic for that…

But, as ~yretek said, just learn what you need and go from there. I’d sometime google “how to do x in vim” and be blown away by how crazy powerful vim can be! Something like registers or macros or inserting text from the output of a command!

So, I guess, enjoy the ride and take a look at the manual to get an idea of what it can do and dig deeper only when you need it.

Good luck!

~yretek wrote:

My tip: learn just what you need to get the job done, then build from that. That has the added bonus that you can use vi style commands in many GUI applications.

One of my favorite web apps is Overleaf, which is a handy front end for LaTeX, which I use on a daily basis at work. Simply because it's much faster than Libre Office and that kind of thing.

Now, Overleaf accepts a range of VIM commands. Now I can do 150dd and the following 150 lines are deleted, but I still have my mouse available if it's more practical.

~tatterdemalion wrote:

I first used vi over 30 years ago. I learned how to enter and leave insert mode, how to move around without arrow keys, and how to do inserts/deletes/replaces by word or by line, in the first couple of weeks. I have learned nothing since then, though I still use it once in a while for config file edits.

To be fair... I started using Emacs a few months later, and never looked back.

~lufte wrote (thread):

It is with great pleasure that I welcome you to the club of Vim users. I've been using Vim for a few years now, I just got into it when I was already an experienced Linux user and software developer.

I forced myself to use only Vim to edit any file when I was starting to learn it to really go through the pain. If you keep $YOUR_PREFERRED_EDITOR open "just in case" you need to edit a file really quickly, it will take longer to get used to it.

Also, I use mostly vanilla Vim (I try to keep my customizations to a minimum) and I can't really say that I know *a lot* of Vim commands. Just enough to move myself comfortably within the buffer, and between buffers. I've been using qutebrowser for a while too because once you "get it", you kind of miss the Vim mindset in other apps.