Vim Macro Magic

Ғылым және технология

LIVE ON TWITCH: / theprimeagen
Get in on Discord: / discord
Get in on Twitter: / theprimeagen
Got Something For Me to Read or Watch??:
/ theprimeagenreact

Пікірлер: 106

  • @NickyTheRook
    @NickyTheRook Жыл бұрын

    The best part is how he did this macro live first try. Very impressive.

  • @STatic4009
    @STatic400911 ай бұрын

    Name another IDE that you can be that happy while using it.

  • @NorgGrimm

    @NorgGrimm

    5 ай бұрын

    It's not an IDE.

  • @ew2430

    @ew2430

    5 ай бұрын

    @@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

    5 ай бұрын

    Emacs (not an IDE, neither is Vim)

  • @greyshopleskin2315

    @greyshopleskin2315

    4 ай бұрын

    @@TheBustthebossemacs is not an IDE, it is a good operating system that lacks a good editor

  • @reed6514

    @reed6514

    4 ай бұрын

    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

    17 күн бұрын

    It's true, I was the macro

  • @alexhiatt3374
    @alexhiatt337411 ай бұрын

    incomprehensible, thank you king

  • @lazycoder_9
    @lazycoder_94 ай бұрын

    Whenever I have a bad mood, I watch this for 3-4 times, laugh my ass off and everything is good again

  • @spicywe1ner
    @spicywe1ner Жыл бұрын

    And literally the next day. A better macro. This man is unstoppable

  • @zheil9152
    @zheil91522 ай бұрын

    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

    Ай бұрын

    You wouldn't say you are wasting time when you have an orgasm, would you? Yeah pretty much the same applies here

  • @joelmassara5087
    @joelmassara5087Ай бұрын

    Pov: you just discovered fire and are sharing it with the world

  • @sexyeur
    @sexyeur11 ай бұрын

    Those people who *make* things happen, those that *watch* what happened, and those that *wonder* what happened... Hahaha

  • @Axlefublr

    @Axlefublr

    17 күн бұрын

    and here's me, thinking if there's some combination of :norm &| :s I could instead abuse to be this macro

  • @paulsanchez5030
    @paulsanchez5030 Жыл бұрын

    Is this the doc. disrispect of coding? He celebrate matching patterns as a 360 no scope

  • @mattmmilli8287

    @mattmmilli8287

    14 күн бұрын

    not far off 😂

  • @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

    11 ай бұрын

    :h macro

  • @fincali197

    @fincali197

    10 ай бұрын

    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

    10 ай бұрын

    To do the macro, just [count](it's optional)@name_of_the_macro(aka "w" in the example I provided)

  • @luvjeetsingh9487

    @luvjeetsingh9487

    10 ай бұрын

    @@fincali197 thanx very much but i got it after googling and chatgipty explained it to me

  • @mathewmorris
    @mathewmorris4 ай бұрын

    Prime lookin like a one-eyed fightin Kirby over here \(*\)

  • @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

    5 ай бұрын

    You don't need to redo it just edit it.

  • @Axlefublr

    @Axlefublr

    17 күн бұрын

    ​@@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

    17 күн бұрын

    @@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

    17 күн бұрын

    ​@@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

    17 күн бұрын

    @@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.

  • @Zzznmop
    @Zzznmop Жыл бұрын

    Pass me the macro and give it to me raw

  • @jaralara6429
    @jaralara64292 ай бұрын

    Did I just witness a vim trickshot

  • @jonopens
    @jonopensАй бұрын

    The mic pops to the exaltations are the artifacts of joy

  • @nekoill
    @nekoill4 ай бұрын

    I love this short so much 😹

  • @sp3ctum
    @sp3ctum5 ай бұрын

    The best part is the expressions on my coworkers' faces when I do this

  • @maxoumimaro
    @maxoumimaro7 ай бұрын

    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.

  • @vikingthedude
    @vikingthedude8 ай бұрын

    I watched this two months ago thinking this looks too cryptic. Now after using macros for a while i am enlightened

  • @SoKyrylo
    @SoKyryloАй бұрын

    the edit is skippy and jittery and hides the action

  • @francp
    @francp11 ай бұрын

    It's happening!🎉

  • @ObsidianJai
    @ObsidianJai26 күн бұрын

    This short singlehandedly made me learn neovim. I had no idea wtf he was talking about and i dont like that lol.

  • @Mihaugoku
    @Mihaugoku4 ай бұрын

    that's a Vimgasm if I've ever seen one.

  • @no_name4796

    @no_name4796

    Ай бұрын

    *neovimgasm Neovim > vim

  • @user-fu4ps9eb2v

    @user-fu4ps9eb2v

    15 күн бұрын

    vimgasm from macrobation

  • @sunyfilip
    @sunyfilipАй бұрын

    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

  • @azaleacolburn
    @azaleacolburn7 ай бұрын

    Holy fuck he did it

  • @ajzack983
    @ajzack983Ай бұрын

    So quick even the editor couldn't catch it yayayayayaya

  • @ohmyv3gatron
    @ohmyv3gatron11 ай бұрын

    What theme is that? =P

  • @Temulgeh
    @Temulgeh Жыл бұрын

    oh i should have thought about that a few days ago when i was doing something similar

  • @mascit
    @mascit8 ай бұрын

    theprimeablackmagic

  • @adityakiran2956
    @adityakiran29564 ай бұрын

    Which language is this and what’s going on in here? Can anybody explain?

  • @TokyoXtreme

    @TokyoXtreme

    Ай бұрын

    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?

  • @RamkrishanYT
    @RamkrishanYT Жыл бұрын

    What happened?

  • @sexyeur

    @sexyeur

    11 ай бұрын

    😂

  • @reed6514
    @reed65144 ай бұрын

    I'm not sure i save time with macros like these, but i sure do enjoy using them.

  • @manoharsingh6050
    @manoharsingh60506 ай бұрын

    The truth is if I cannot understand what just happened I probably won’t need it

  • @ivanheffner2587

    @ivanheffner2587

    24 күн бұрын

    … said the caveman to the fighter pilot.

  • @manoharsingh6050

    @manoharsingh6050

    24 күн бұрын

    @@ivanheffner2587yea exactly 😂

  • @aBradAbroad
    @aBradAbroad11 ай бұрын

    !brother

  • @balatries
    @balatries Жыл бұрын

    I saw this live

  • @mo.G_2020

    @mo.G_2020

    Ай бұрын

    A legend here

  • @crides0
    @crides0 Жыл бұрын

    or given the existing enum items, just do a regular expression like :'

  • @user-fu4ps9eb2v
    @user-fu4ps9eb2v15 күн бұрын

    macroburtion

  • @spikespaz
    @spikespaz11 ай бұрын

    I can do the same thing with a regex replace in VS Code :)

  • @igorvlasiuk6432

    @igorvlasiuk6432

    5 ай бұрын

    If you are so happy by VSCode why are you you spying on the guy who promotes vim?

  • @olbluelips

    @olbluelips

    4 ай бұрын

    But then you have to learn regex

  • @brandonfernandez194
    @brandonfernandez1944 ай бұрын

    xD

  • @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)

  • @Jason_Kang
    @Jason_Kang Жыл бұрын

    First try

  • @marcialabrahantes3369
    @marcialabrahantes33694 ай бұрын

    how's this different than multiple cursors in Sublime/VSC

  • @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.

  • @darthcabs
    @darthcabs7 ай бұрын

    I don't see anything happening

  • @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

    10 ай бұрын

    @@_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Ай бұрын

    i did a better macro today. for reals bro. that one was alright.

  • @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

    11 ай бұрын

    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

    6 ай бұрын

    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

    11 ай бұрын

    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

    6 ай бұрын

    Wait, vim doesn't have built-in multicursor?

  • @darianmorat

    @darianmorat

    5 ай бұрын

    ​​@@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_doctor11 ай бұрын

    Nano -- migraine Emacs -- heading pain Vim -- kill me no need to the pain . Vscode ❤❤❤❤❤❤❤❤❤❤❤

Келесі