Vim Macro Magic

  Рет қаралды 49,123

TheVimeagen

Жыл бұрын

LIVE ON TWITCH: twitch.tv/ThePrimeagen
Get in on Discord: discord.gg/ThePrimeagen
Get in on Twitter: ThePrimeagen
### Got Something For Me to Read or Watch??:
www.reddit.com/r/ThePrimeagenReact/

Пікірлер: 112
@NickyTheRook
@NickyTheRook Жыл бұрын
The best part is how he did this macro live first try. Very impressive.
@STatic4009
@STatic4009 Жыл бұрын
Name another IDE that you can be that happy while using it.
@NorgGrimm
@NorgGrimm 6 ай бұрын
It's not an IDE.
@ew2430
@ew2430 6 ай бұрын
@@NorgGrimmcorrect, but the way most people use it, it definitely is. the same way vscode isn’t an IDE but after 20 plugins and config, you have JetBrains Rider.
@TheBusttheboss
@TheBusttheboss 6 ай бұрын
Emacs (not an IDE, neither is Vim)
@greyshopleskin2315
@greyshopleskin2315 5 ай бұрын
@@TheBustthebossemacs is not an IDE, it is a good operating system that lacks a good editor
@reed6514
@reed6514 5 ай бұрын
Sledge hammer is the best editor, but it can only delete.
@NathanHedglin
@NathanHedglin Жыл бұрын
I was there. He did it first try. Blazingly Fast
@feschber
@feschber Ай бұрын
It's true, I was the macro
@bob_kazamakis
@bob_kazamakis 3 ай бұрын
welcome to vim, where you save so much time with your macros, you immediately lose all that gained time explaining or marveling at your own macro
@no_name4796
@no_name4796 2 ай бұрын
You wouldn't say you are wasting time when you have an orgasm, would you? Yeah pretty much the same applies here
@lazycoder_9
@lazycoder_9 5 ай бұрын
Whenever I have a bad mood, I watch this for 3-4 times, laugh my ass off and everything is good again
@joelmassara5087
@joelmassara5087 2 ай бұрын
Pov: you just discovered fire and are sharing it with the world
@spicywe1ner
@spicywe1ner Жыл бұрын
And literally the next day. A better macro. This man is unstoppable
@alexhiatt3374
@alexhiatt3374 Жыл бұрын
incomprehensible, thank you king
@sexyeur
@sexyeur Жыл бұрын
Those people who *make* things happen, those that *watch* what happened, and those that *wonder* what happened... Hahaha
@Axlefublr
@Axlefublr Ай бұрын
and here's me, thinking if there's some combination of :norm &| :s I could instead abuse to be this macro
@mathewmorris
@mathewmorris 5 ай бұрын
Prime lookin like a one-eyed fightin Kirby over here \(*\)
@luvjeetsingh9487
@luvjeetsingh9487 Жыл бұрын
Please make a video to explain macros in vim
@Tekay37
@Tekay37 Жыл бұрын
qq (do the macro) q then 5@q to repeat your macro 5 times.
@ItzAnameOk
@ItzAnameOk Жыл бұрын
:h macro
@fincali197
@fincali197 11 ай бұрын
q to say that you're gonna record a macro, then a key(like w or q) to say that this macro should be named "w"(or "q"), then you record the macro, and when you're done, press q again.
@fincali197
@fincali197 11 ай бұрын
To do the macro, just [count](it's optional)@name_of_the_macro(aka "w" in the example I provided)
@luvjeetsingh9487
@luvjeetsingh9487 11 ай бұрын
@@fincali197 thanx very much but i got it after googling and chatgipty explained it to me
@tannerted
@tannerted Жыл бұрын
Love the feeling of my macros working first time. Usually with complex macros like this, I make some stupid mistake and have to do it over a couple times
@ykhatat
@ykhatat 6 ай бұрын
You don't need to redo it just edit it.
@Axlefublr
@Axlefublr Ай бұрын
​@@ykhatathow would you edit a macro? I know of multiple ways, and none of them feel good enough to use. Maybe I'm missing something
@ZantierTasa
@ZantierTasa Ай бұрын
@@Axlefublr The only way I know of is to manually edit the string of keystrokes, which is only good for small, easy fixes. If the macro is in register a, on a new line type "ap to paste the keystrokes, make the edit, then yank it all back into register a with e.g. "ayiW
@Axlefublr
@Axlefublr Ай бұрын
​@@ZantierTasa yeahhh this is one of the methods I tried using and disliked. The issue with it is that I need to, on the spot, occupy some sort of space in the file to edit my macro in, probably freaking out the syntax highlighting, lsp, and diagnostics in the process. it feels really messy to do. I could use :new to go edit it in a blank buffer and then close it, but at that point, what am I even doing, right? it feels like a bit more effort than it's usually worth. macros are definitely still really really important, but if I fuck up, the solution is generally messy, which is why I try to solve problems with :norm and :s when I can
@ZantierTasa
@ZantierTasa Ай бұрын
@@Axlefublr Yeah, I don't think it's usually worth editing macros like this. I usually just go "oops" and start the macro from the beginning.
@paulsanchez5030
@paulsanchez5030 Жыл бұрын
Is this the doc. disrispect of coding? He celebrate matching patterns as a 360 no scope
@mattmmilli8287
@mattmmilli8287 Ай бұрын
not far off 😂
@tiktalk4573
@tiktalk4573 16 күн бұрын
this one aint a pedo
@Zzznmop
@Zzznmop Жыл бұрын
Pass me the macro and give it to me raw
@jaralara6429
@jaralara6429 3 ай бұрын
Did I just witness a vim trickshot
@sp3ctum
@sp3ctum 6 ай бұрын
The best part is the expressions on my coworkers' faces when I do this
@maxoumimaro
@maxoumimaro 8 ай бұрын
The next step is to do this using two bookmarks so vim in one macro will go back and forth between the pattern matching and the symbol definition and move both bookmarks down one line each time.
@jonopens
@jonopens 2 ай бұрын
The mic pops to the exaltations are the artifacts of joy
@vikingthedude
@vikingthedude 9 ай бұрын
I watched this two months ago thinking this looks too cryptic. Now after using macros for a while i am enlightened
@nekoill
@nekoill 5 ай бұрын
I love this short so much 😹
@ObsidianJai
@ObsidianJai Ай бұрын
This short singlehandedly made me learn neovim. I had no idea wtf he was talking about and i dont like that lol.
@sunyfilip
@sunyfilip 2 ай бұрын
Sometimes is macro really faster but sometimes it would be much faster with simple multicursor (for example like in vscode)....but hey, I am trying similar macros in vim and every time I finish it correctly it is really satisfying ^_^ so I agree it is more fun to do macros :D
@francp
@francp Жыл бұрын
It's happening!🎉
@octavioavila6548
@octavioavila6548 Ай бұрын
You miss it if you blink
@azaleacolburn
@azaleacolburn 8 ай бұрын
Holy fuck he did it
@ajzack983
@ajzack983 2 ай бұрын
So quick even the editor couldn't catch it yayayayayaya
@Mihaugoku
@Mihaugoku 5 ай бұрын
that's a Vimgasm if I've ever seen one.
@no_name4796
@no_name4796 2 ай бұрын
*neovimgasm Neovim > vim
@user-fu4ps9eb2v
@user-fu4ps9eb2v Ай бұрын
vimgasm from macrobation
@SoKyrylo
@SoKyrylo 2 ай бұрын
the edit is skippy and jittery and hides the action
@Temulgeh
@Temulgeh Жыл бұрын
oh i should have thought about that a few days ago when i was doing something similar
@ohmyv3gatron
@ohmyv3gatron Жыл бұрын
What theme is that? =P
@mascit
@mascit 9 ай бұрын
theprimeablackmagic
@reed6514
@reed6514 5 ай бұрын
I'm not sure i save time with macros like these, but i sure do enjoy using them.
@adityakiran2956
@adityakiran2956 6 ай бұрын
Which language is this and what’s going on in here? Can anybody explain?
@TokyoXtreme
@TokyoXtreme 2 ай бұрын
I'm guessing it makes sense when you're able to see more of the screen. Don't people preview their own shorts before uploading?
@linusdannull1247
@linusdannull1247 13 күн бұрын
Do you use the arrows to move vertically?!?!
@manoharsingh6050
@manoharsingh6050 7 ай бұрын
The truth is if I cannot understand what just happened I probably won’t need it
@ivanheffner2587
@ivanheffner2587 Ай бұрын
… said the caveman to the fighter pilot.
@manoharsingh6050
@manoharsingh6050 Ай бұрын
@@ivanheffner2587yea exactly 😂
@aBradAbroad
@aBradAbroad Жыл бұрын
!brother
@user-fu4ps9eb2v
@user-fu4ps9eb2v Ай бұрын
macroburtion
@crides0
@crides0 Жыл бұрын
or given the existing enum items, just do a regular expression like :'
@farkore
@farkore 9 күн бұрын
yyyyeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeees
@balatries
@balatries Жыл бұрын
I saw this live
@mo.G_2020
@mo.G_2020 2 ай бұрын
A legend here
@RamkrishanYT
@RamkrishanYT Жыл бұрын
What happened?
@sexyeur
@sexyeur Жыл бұрын
😂
@spikespaz
@spikespaz Жыл бұрын
I can do the same thing with a regex replace in VS Code :)
@igorvlasiuk6432
@igorvlasiuk6432 6 ай бұрын
If you are so happy by VSCode why are you you spying on the guy who promotes vim?
@olbluelips
@olbluelips 5 ай бұрын
But then you have to learn regex
@JaredVititoe
@JaredVititoe 26 күн бұрын
I just had a seizure
@Jason_Kang
@Jason_Kang Жыл бұрын
First try
@brandonfernandez194
@brandonfernandez194 5 ай бұрын
xD
@marcialabrahantes3369
@marcialabrahantes3369 5 ай бұрын
how's this different than multiple cursors in Sublime/VSC
@Trokkin
@Trokkin Жыл бұрын
That got me thinking. I'm just learning vim motions, so I constantly compare them to usual vscode "motions". I did such transformations on daily basis with multiple cursors and toUppercase / toLowercase commands. Vim is powerful with moving around, sure, but is that really the greatest macro? 😮
@justpatrick_
@justpatrick_ Жыл бұрын
Yeah multi cursors are better
@bursthooverbag10
@bursthooverbag10 Жыл бұрын
You can replicate anyrhing you can do with vsc multi cursor in vim. Vsc motions are but a pale imitation
@Trokkin
@Trokkin Жыл бұрын
@@bursthooverbag10 sure except what replicates multi cursor in vim requires 1-2-4 buttons to press per occurrence, which is not zero, which is an W for vsc. And hear me out, moving around is better in vim, that's a bigger W and I'm sticking with it. Just saying, this macro usage is not really impressive as prim makes it sound for me. I want something even juicier to represent vim advantage on text transformation front.
@ardnys35
@ardnys35 Жыл бұрын
do you mean the highlighting a word and pressing ctrl+D for creating multiple cursors? that's so nice in VSC. that saved me a TON of time when i was editing plotting functions.
@Trokkin
@Trokkin Жыл бұрын
@@ardnys35 also to select all in a file. And to add one cursor up or down (C and A are short for Ctrl and Alt. Vim's already rubbed into me)
@vaisakhkm783
@vaisakhkm783 Жыл бұрын
Actually, i didn't understand what he done there... How word 'return' comes there? okey understand, video cutoff at right, so didn't saw the pasted text and diw
@JMIK1991
@JMIK1991 Жыл бұрын
He made a makro, chained each event: - Start makro at the text - Copy, Paste, Find "If", new line - pastes aboven line again - replace to copied value, upcases first letter - replaces to copied value - removes extra line - Ends makro Then he pointed at the text return, ran the macro he just made.
@Spongman
@Spongman Жыл бұрын
vim is great! it takes something that would be trivial and intuitive to do in vscode, obfuscates it entirely and makes you feel really smart, witness!
@dima1478
@dima1478 Жыл бұрын
And also do it in a fraction of the time
@_bradleystrider
@_bradleystrider Жыл бұрын
wait you think recording the exact steps you would normally do is unintuitive in vim?
@kuhluhOG
@kuhluhOG 11 ай бұрын
@@_bradleystrider I think that OP is more saying that 1. vim motions are unintuitive and 2. having basically no visual feedback about what you are recording is unintuitive (tbf, they way this is recorded thanks to YT Shorts limitations is far from ideal here; e.g. where do the word he pastes in come from? ah, outside the screen...)
@webmandman
@webmandman 3 ай бұрын
i did a better macro today. for reals bro. that one was alright.
@darthcabs
@darthcabs 8 ай бұрын
I don't see anything happening
@sayChristIsKing
@sayChristIsKing Жыл бұрын
people convincing me to keep using vim be like that sometimes, but all I really want is easy debug and an outline tab on my sidebar out of the box, debug is the only thing that gatekeeps me from using vim fr, pure insanity that how many hoops you need to jump thorugh for the only tool that every new programmer actually need, a fucking debugger
@alexhiatt3374
@alexhiatt3374 Жыл бұрын
agreed. I love NeoVim for everything else, but I could never get a debugger working. I just jump to CLion with the IdeaVim plugin when I need the debugger.
@smjonas8616
@smjonas8616 7 ай бұрын
You dont need to use Vim for every programming-related task. Just use the best tool for the job (you dont need to turn Vim into an IDE to benefit from it).
@AgainPsychoX
@AgainPsychoX Жыл бұрын
Each time I see Primegen using Neovim I want to learn the thing, but then I realize I do the same thing daily with multi-cursors on VS Code, all with keyboard (of course custom keybindings)
@QckSGaming
@QckSGaming Жыл бұрын
Multi-cursor is light-years away from macros but you can get basic stuff done for sure. I was so used to it that I made my own multi-cursor for vim but now never use it
@hil449
@hil449 7 ай бұрын
Wait, vim doesn't have built-in multicursor?
@darianmorat
@darianmorat 7 ай бұрын
​​@@QckSGaming what are u talking about? To be more specific
@aichrist
@aichrist Жыл бұрын
Honestly, i just prefer typing all that. I can type very fast.
@insertoyouroemail
@insertoyouroemail Жыл бұрын
meh... VS Code multicursor editing is much faster.
@evgen4681
@evgen4681 Жыл бұрын
randomly generated words with ChatGPT does not called macros (Kappa)
@just_A_doctor
@just_A_doctor Жыл бұрын
Nano -- migraine Emacs -- heading pain Vim -- kill me no need to the pain . Vscode ❤❤❤❤❤❤❤❤❤❤❤
Fast and Furious: New Zealand 🚗
00:29
How Ridiculous
Рет қаралды 41 МЛН
Heartwarming Unity at School Event #shorts
00:19
Fabiosa Stories
Рет қаралды 23 МЛН
Spot The Fake Animal For $10,000
00:40
MrBeast
Рет қаралды 180 МЛН
Kumanda İle Bilgisayarı Yönetmek #shorts
0:29
Osman Kabadayı
Рет қаралды 2,2 МЛН
Xiaomi SU-7 Max 2024 - Самый быстрый мобильник
32:11
Клубный сервис
Рет қаралды 529 М.
Rate This Smartphone Cooler Set-up ⭐
0:10
Shakeuptech
Рет қаралды 6 МЛН
Копия iPhone с WildBerries
1:00
Wylsacom
Рет қаралды 8 МЛН