Maybe one day I'll learn how to use Vim

3 years ago by StV2 to c/programmerhumor

I tried a couple of times and it's still magic to see anyone able to use it properly

I'll just stick to VScode for now I guess

datendefekt 9 points 3 years ago

path: 0 131954, hotness: undefined, score: 9, children: 0
pete 9 points 3 years ago

If you are actually interested in learning, it's not too hard, you'll be slow for a little bit but it pays off in the end.

First, understanding there are actions and objects and quantifiers. Actions are what you do to objects, so when you want to (d) delete, that is the action, then you'd want to specify a object. ($) being the end of the line, (^) start, (w) is word, (j), (g) is top of file and so on, these are already the words you'll use to move along as well.

Then, for many of these we can add quantifiers, i.e. repeat x number of times.

So 3dw is delete three words and 3dj is three lines down and so on. If you want to select, it's just swap v for d and off to the races.

Once you learn the basic concept, you really only need a few actions and a few objects to be functional.

Print/find/make a cheat sheet and put it up by your monitor or keyboard and give yourself a week.

Also, checkout the vimtudor or vim golf and play the game for a few minutes.

path: 0 117102, hotness: undefined, score: 9, children: 2
StV2 2 points 3 years ago

Honestly that ability to edit stuff sounds really cool to be able to do

Maybe I should start out by making a cheet sheet with your comment in it and just try doing some basic editing with it

path: 0 117102 124089, hotness: undefined, score: 2, children: 1
pete 2 points 3 years ago path: 0 117102 124089 140778, hotness: undefined, score: 2, children: 0
OsrsNeedsF2P 7 points 3 years ago

PSA: run vimtutor in the terminal

path: 0 134398, hotness: undefined, score: 7, children: 2
SemioticStandard 3 points 3 years ago

This is exactly how I learned all those years ago, and to this day, I still use vim regularly. As in, literally, I was using it on a server this morning to make some changes. It's just become natural to me now.

path: 0 134398 139802, hotness: undefined, score: 3, children: 0
StV2 2 points 3 years ago

Oooh that's a handy feature I didn't know about

path: 0 134398 157308, hotness: undefined, score: 2, children: 0
jmsw22 7 points 3 years ago

I have about 30 years of my career left. That's not enough time for the return on investment of learning VIM to payout.

path: 0 130901, hotness: undefined, score: 7, children: 3
taj 4 points 3 years ago

Eh. I know the basics. I can open, do some very basic editng, save and close. That's about as much as is really needed, right?

path: 0 130901 131144, hotness: undefined, score: 4, children: 2
MoreIronOre 12 points 3 years ago

You can close VIM? Fucking legend.

path: 0 130901 131144 134288, hotness: undefined, score: 12, children: 1
AlwynEvokedHippest 1 point 3 years ago

I can do it, too.

But I learned a few key steps in the process are: hit Ctrl Q, hit Ctrl C, hit Escape a few times, swear, take a breather, remember you’re in VIM and are now (accidentally rather then due to any correct move) out of INSERT mode, type :q.

Then you go to the sofa and put yourself in the fetal position.

path: 0 130901 131144 134288 161668, hotness: undefined, score: 1, children: 0
degrix 6 points 3 years ago

I've tried for years to master vim, but still fall back to old habits. I have gotten to the point where single file editing is faster in vim than in IntelliJ, but still haven't figured out the mysteries of vim buffers and multi-file editing.

path: 0 116730, hotness: undefined, score: 6, children: 3
pete 2 points 3 years ago

Buffers are great, but I mostly go for tabs. :tabnew :tabnext :tabmove and so on.

path: 0 116730 118809, hotness: undefined, score: 2, children: 0
SeeMinusMinus 1 point 3 years ago

I use tabs and windows in vim. Mix this with telescope.nvim and a few keybinds and multi-file editing can get really fast.

path: 0 116730 120551, hotness: undefined, score: 1, children: 1
axtualdave 1 point 3 years ago

Ctrl-p also works with buffers, making it almost trivial.

path: 0 116730 120551 122292, hotness: undefined, score: 1, children: 0
branchial 6 points 3 years ago

Emacs is my favourite IDE. I switched to it from vim and never looked back.

path: 0 134632, hotness: undefined, score: 6, children: 0
Davel23 6 points 3 years ago

35 years ago (give or take) I used vi (no "m") for email and Usenet. I doubt I could remember how to do anything useful with it now.

path: 0 131173, hotness: undefined, score: 6, children: 0
priapus 5 points 3 years ago

Helix > Vim (and neovim)

path: 0 133694, hotness: undefined, score: 5, children: 1
L0Wigh 1 point 3 years ago

Nah... Helix is great, but the mouvement first philosophy is clearly something that I don't want to learn

path: 0 133694 211850, hotness: undefined, score: 1, children: 0
alokir 5 points 3 years ago

VSCode has a vim plugin, you should try it

path: 0 129434, hotness: undefined, score: 5, children: 1
petriborg 2 points 3 years ago

I would never use an IDE that didn't have a Vi/Vim mode or plugin :-)

path: 0 129434 133231, hotness: undefined, score: 2, children: 0
NettoHikari 4 points 3 years ago

I still remember first opening vim many years ago ...

... I still haven't figured out how to close it.

path: 0 123253, hotness: undefined, score: 4, children: 1
StV2 1 point 3 years ago

I'd tell you to Google it but that'd involve closing it in the first place

path: 0 123253 124038, hotness: undefined, score: 1, children: 0
TheInsane42 4 points 3 years ago

Drat, I've been working with vi for 35y now... (feeling old) I'm glad I now know how to kill the mouse functions in vim so X clipboard works. ;)

Tried emacs once (in '94)... opened an extra xterm and killed it as I couldn't figure out how to save and exit. (it's just what you're used to ;) )

path: 0 131941, hotness: undefined, score: 4, children: 2
Tovervlag 1 point 3 years ago

so.. how does one kill the mouse functions?

path: 0 131941 147678, hotness: undefined, score: 1, children: 1
TheInsane42 1 point 3 years ago

With a stick ;)

From my .vimrc:

" disable mouse
set mouse-=a
path: 0 131941 147678 169626, hotness: undefined, score: 1, children: 0
Fiech 4 points 3 years ago

As a long time vim user with many macros and plugins, etc. and I love using it. But I have to say, it's hard for me to actually suggest vim to anyone new, because of how long it takes until you actually start using it comfortably...

path: 0 135141, hotness: undefined, score: 4, children: 0
adthrawn 2 points 3 years ago

I mean, get it. VIM is great, but I'll stick with VSCode because I always forget little syntax shit all the time lol

path: 0 117460, hotness: undefined, score: 2, children: 0
nobloat 2 points 3 years ago

I am weird in that I never used VScode before. I started with Vim and just kept using it. It's like second nature now. I sometimes end up using the keybindings somewhere else and realize what I'm doing

path: 0 144565, hotness: undefined, score: 2, children: 0
skookumasfrig 2 points 3 years ago

The only way to learn to use it is to use it. It's OK if you don't but using it will get you there. I've been a vi & vim user since the 90's and I'm still learning new things.

path: 0 127120, hotness: undefined, score: 2, children: 2
taj 2 points 3 years ago

I can use it. I just... I would rather not. Nano is soo much nicer...

path: 0 127120 131166, hotness: undefined, score: 2, children: 1
OsrsNeedsF2P 1 point 3 years ago

You remind me of a guy in University who "used vim for a year" but didn't know anything outside Insert mode

path: 0 127120 131166 134306, hotness: undefined, score: 1, children: 0
BrownPolarBear 2 points 3 years ago

somehow I read the last frame as "stop tinkering with your setup, use the bloody mouse and get the job done"

path: 0 134675, hotness: undefined, score: 2, children: 0
quzyp 2 points 3 years ago

i, x, r, dd, :wq are good enough for me. Everything more than that is for nerds.

path: 0 121345, hotness: undefined, score: 2, children: 1
OsrsNeedsF2P 1 point 3 years ago

dd and p are probably the most commonly used keys

path: 0 121345 134376, hotness: undefined, score: 1, children: 0
cleareyes 1 point 3 years ago

I mean I use the vim plugin in IntelliJ lmao.

I’m no expert but it’s much more enjoyable writing code when you don’t have to go handle your mouse every 1 second.

path: 0 134349, hotness: undefined, score: 1, children: 0
Ansis100 1 point 3 years ago

I fell in love with Vim a while ago, but it's missing a lot of the core features of VSCode. However, the Neovim-VSCode integration has been a saviour. All the cool features of VSCode combined with the text editing speed of Vim.

path: 0 124144, hotness: undefined, score: 1, children: 0
jakoma02 1 point 3 years ago

By the way, the vim extension for VScode is great, so why not combine both.

path: 0 1083986, hotness: undefined, score: 1, children: 0
SinJab0n 1 point 3 years ago

VSCodium

path: 0 891388, hotness: undefined, score: 1, children: 0
zibat 1 point 3 years ago

We have a mixed marriage. I use vi(m) and he uses emacs

path: 0 159186, hotness: undefined, score: 1, children: 0
polskilumalo 1 point 3 years ago

Perfect moment to present myself as the stacking window manager chad programming rust in mousepad and you as a lowly tiling window manager soyjack "programming" javascript in vim. 😎😎😎

path: 0 123984, hotness: undefined, score: 1, children: 0
JoYo 1 point 3 years ago

I get the feeling that every developer with this midnset still uses a tenkey.

path: 0 133209, hotness: undefined, score: 1, children: 0
programmerhumor
programmerhumor

@lemmy.ml

login for more options
43787
1628
1567

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.

go to feed...