Amazing Vim Macro

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

Recorded live on twitch, GET IN
/ theprimeagen
MY MAIN YT CHANNEL: Has well edited engineering videos
/ theprimeagen
Discord
/ discord
Have something for me to read or react to?: / theprimeagenreact
Kinesis Advantage 360: bit.ly/Prime-Kinesis
Hey I am sponsored by Turso, an edge database. I think they are pretty neet. Give them a try for free and if you want you can get a decent amount off (the free tier is the best (better than planetscale or any other))
turso.tech/deeznuts

Пікірлер: 193

  • @Downicon3
    @Downicon37 ай бұрын

    The fuck is going on

  • @ThePrimeTimeagen

    @ThePrimeTimeagen

    7 ай бұрын

    blood magic, just not the shitty witcher tv kind

  • @sakib123321

    @sakib123321

    7 ай бұрын

    If ur being serious, I believe he made a reusable macro that searches for like the header of a section and makes it into a link at the top for a table of contents.

  • @paultapping9510

    @paultapping9510

    7 ай бұрын

    living that hashtag vimLife.

  • @sakib123321

    @sakib123321

    7 ай бұрын

    @@jacobthomas1344 Happy to help :) vim also looked very strange to me until I had a course unit dedicated to it.

  • @steamer2k319

    @steamer2k319

    6 ай бұрын

    Vim

  • @ms4k_
    @ms4k_7 ай бұрын

    Spellcasting in vim

  • @technologykid7041
    @technologykid70417 ай бұрын

    This is exactly what I feel a senior engineer does thanks prime

  • @SoHawful

    @SoHawful

    7 ай бұрын

    Senior engineer is just a title and there is a lot of variance in skill (source: I also have that title and I can't do this 😭)

  • @cruxae

    @cruxae

    7 ай бұрын

    Senior engineers don't waste their time with this. Instead they spend their time on bringing business value.

  • @Mordewolt

    @Mordewolt

    7 ай бұрын

    @@cruxae this kind of meaningless gibberish is exactly the kind of thing i expect to hear from a guy that tells everyone that he's a senior engineer

  • @jewhunterbiden

    @jewhunterbiden

    7 ай бұрын

    @@Mordewolt the pretentiousness is hilarious

  • @csaratakij6339

    @csaratakij6339

    7 ай бұрын

    ​@@cruxaeskills issues

  • @connorskudlarek8598
    @connorskudlarek85987 ай бұрын

    I can't wait to have a software job and be a wizard, too.

  • @ThePrimeTimeagen

    @ThePrimeTimeagen

    7 ай бұрын

    time and practice

  • @connorskudlarek8598

    @connorskudlarek8598

    7 ай бұрын

    ​@ThePrimeTimeagen oh it'll happen. I'm sufficiently motivated. My github has never been so green, thanks in part to you.

  • @mehdiyahiacherif2326

    @mehdiyahiacherif2326

    7 ай бұрын

    ​@@connorskudlarek8598 no one will notice what you do, but it is still satisfying!!

  • @vaibhavnayak909

    @vaibhavnayak909

    7 ай бұрын

    ​@@connorskudlarek8598ikr.

  • @svenmify

    @svenmify

    6 ай бұрын

    Don’t need a job for that. Become good on your own.

  • @DeltaNachos
    @DeltaNachos7 ай бұрын

    TLDR: The macro finds markdown headings and formats/copies them into TOC format.

  • @wh7988

    @wh7988

    6 ай бұрын

    why tf are u giving a summary to 30 second clip

  • @DeltaNachos

    @DeltaNachos

    6 ай бұрын

    @@wh7988 a lot of other comments were confused people

  • @superchillh3o
    @superchillh3o7 ай бұрын

    He’s beginning to believe

  • @Omikronik
    @Omikronik7 ай бұрын

    Holy fuck... whenever i see Mr. Prime do his magic I am reminded that I've still only scratched the surface of vim motions

  • @mr14hsoj
    @mr14hsoj7 ай бұрын

    I might need to learn Vim

  • @ThePrimeTimeagen

    @ThePrimeTimeagen

    7 ай бұрын

    the macros are sooooo good

  • @vikingthedude

    @vikingthedude

    7 ай бұрын

    I did it last May and it’s been worth the investment

  • @cesarromerop

    @cesarromerop

    6 ай бұрын

    I do this in emacs regularly. /me docks and covers

  • @fave1201
    @fave12017 ай бұрын

    The two time is clearly very talented

  • @pummelhead
    @pummelhead7 ай бұрын

    *Me barely knowing how to print Hello World in python.* Yeah, of course, who would do it any other way?

  • @imichaeli
    @imichaeli7 ай бұрын

    Must say, kept up with the keys and understood it all, such a pleasure to be at this point, trying to utilize macros as much as possible.

  • @rewrose2838

    @rewrose2838

    6 ай бұрын

    Where do you start with this, whatever this is? Does vim have some official docs I could refer?

  • @xavi8780
    @xavi87807 ай бұрын

    'replay' is my safe word too 😏

  • @pelegsap
    @pelegsap5 ай бұрын

    I love vim macros so much that I don't even use an OS anymore, I just write vim macros directly to memory and cpu. Seriously though, a non-techy friend of mine once had a summer student job which required repeatedly editing text files for some archiving project. So I recorded a vim macro which did his entire work automatically in seconds, saving him the summer. Go vim

  • @kaustubhpatange
    @kaustubhpatange7 ай бұрын

    The trick with macro replaying with marker is so good, never thought of it.

  • @trossbin8108
    @trossbin81086 ай бұрын

    I’m not even a software dev (cyber) and I watch you religiously. Seeing what in-depth knowledge you have in your profession is mesmerizing. Thank you for existing brother

  • @M0fasa47
    @M0fasa477 ай бұрын

    That was smooth, like coconut oil.

  • @nobleradical2158

    @nobleradical2158

    7 ай бұрын

    I slipped and fell down on the coconut oil

  • @SamarKhan-qr3qy
    @SamarKhan-qr3qy7 ай бұрын

    I started using Vim all because i watched your damn video. Now i can't escape 😭

  • @HansMartinSchleier

    @HansMartinSchleier

    7 ай бұрын

    :q! 😉

  • @realhumanbean7915

    @realhumanbean7915

    6 ай бұрын

    Why does everyone who seems to get into vim develop a Stockholm syndrome

  • @CollinWilliams-by5cs
    @CollinWilliams-by5cs11 күн бұрын

    These videos feel so good. Almost enough to switch me from Helix back to Nvim

  • @jong.4864
    @jong.48647 ай бұрын

    Appreciate the grind!

  • @haiffy
    @haiffy12 күн бұрын

    I can now put expert markdown developer on my resume

  • @sagidana912
    @sagidana912Күн бұрын

    the fuck is that speed, are u feeling well? crazy nice the marks fang shui

  • @emmafountain2059
    @emmafountain20597 ай бұрын

    I need to figure out markers cause I can’t understand how just replaying the macro goes to the next heading

  • @marinus86

    @marinus86

    6 ай бұрын

    With a default config you create a mark with the prefix m and then the key you want to assign the mark to (Prime uses i at the table of contents and o at the last heading he found). You navigate to a marker by hitting ` and then the key assigned to it. The macro includes moving the o marker so each time it is repeated it searches further through the buffer.

  • @codeman99-dev
    @codeman99-dev7 ай бұрын

    That's pretty darn good. Would prefer to just use multiple cursors though.

  • @moshi8577
    @moshi857710 күн бұрын

    Bro channeled his American past life😂😂

  • @BooBaddyBig
    @BooBaddyBig19 күн бұрын

    Peak software engineering right there /s

  • @desmondwilson3416
    @desmondwilson34165 ай бұрын

    I needed to watch this like four times to understand what he's using the macro to scrape the headings into a table of contents

  • @Humble_Electronic_Musician
    @Humble_Electronic_Musician6 ай бұрын

    Man, I feel installing VIM equals a bachelors degree and learning it a masters degree

  • @Qaos2
    @Qaos26 ай бұрын

    How in the KZread algorithm did I end up here…..is this where life ceases to exist?

  • @svenmify
    @svenmify6 ай бұрын

    You’re right, greatest vim macro I’ve ever seen. Only one too, so there’s that.

  • @yc699bk
    @yc699bk7 ай бұрын

    How you replaced spaces with dashes? some regex replacement that was saved in command history?

  • @sharon2250

    @sharon2250

    7 ай бұрын

    Wondering the same thing…

  • @alsmnn

    @alsmnn

    6 ай бұрын

    Mark the whole line with V then hit ":" to enter a command and enter the following: s/\%V /-/g So he played at least with the regex before recording.

  • @mjaysmileofficial
    @mjaysmileofficial7 ай бұрын

    marksman code action - > create table of contents

  • @spectro742
    @spectro7427 ай бұрын

    This is the first vim macro I've seen so you're right.

  • @EbbeCee
    @EbbeCee7 ай бұрын

    As a newb, I'm missing how the marker keeps travelling down instead of always doing the first entry. Can someone explain? Edit: Ok I got it. I kept missing the navigation to O before the search.

  • @M4XFUTURE
    @M4XFUTURE7 ай бұрын

    Ive been *actually* using vim for about 6 months now and Im only starting to use macros. Now this is gold but even for like small things, say like removing special characters from the line or incrementing lines numbets is very simple.

  • @ThePrimeTimeagen

    @ThePrimeTimeagen

    7 ай бұрын

    if you are new... wait until you try g on a visually selected set of numbers 0, 0, 0, 0, 0, -> 1, 2, 3, 4, 5,

  • @xhivo97

    @xhivo97

    7 ай бұрын

    @@ThePrimeTimeagen repeat for 2, 4, 6, 8, 10,

  • @ibrahim3690
    @ibrahim36907 ай бұрын

    I have no idea what happened but looks fun and satisfying 😮

  • @sadunozer2241
    @sadunozer22417 ай бұрын

    Best ending ever recorded on camera

  • @slobrat3556
    @slobrat355612 күн бұрын

    He cant keep getting away with it!

  • @DKLHensen
    @DKLHensen4 ай бұрын

    Nice gonna try it later

  • @tamaskovacs-ajtai7489
    @tamaskovacs-ajtai74897 ай бұрын

    Jesus fkn christ! I need to learn vim, you convinced me. Teach me Master!

  • @migdadmohammedali1504
    @migdadmohammedali15047 ай бұрын

    That does feel good, I'm trying to make a Lua script for flutter in neovim to create clean architecture files and folders in flutter with bloc and cubit, hope one day I'll be a real wizard with time and practice

  • @Aegisfromashes
    @Aegisfromashes7 ай бұрын

    Can always appreciate a good macro

  • @ragectl
    @ragectl7 ай бұрын

    OK, only question is why the star, when each line has the - in it? Having the anchor start with - seems an odd choice

  • @Warpgatez
    @Warpgatez7 ай бұрын

    I have no idea what the frick just happened

  • @Jack-lr3dn
    @Jack-lr3dn6 ай бұрын

    Feral vim guy

  • @anandmahamuni5442
    @anandmahamuni54427 ай бұрын

    Fucking genius, god of vim himself

  • @Mozartenhimer
    @Mozartenhimer6 ай бұрын

    Oh that's hot.

  • @half-duckprince3995
    @half-duckprince39957 ай бұрын

    woah, woah, woah, hey, hey, hey

  • @MohsinBukhari17091991
    @MohsinBukhari170919919 күн бұрын

    That's a vim god level macro

  • @what1heh3ck
    @what1heh3ck7 ай бұрын

    Is the search command able to find next ## based on the last time we use it?

  • @renefernandez360

    @renefernandez360

    7 ай бұрын

    I think that is because of the jump back he keeps jumping to the first and the last that he was at then he search the next one

  • @what1heh3ck

    @what1heh3ck

    7 ай бұрын

    @@renefernandez360thanks, I just notice he used “mo” again to mark the line with ##. Not sure if you could seach for the next ## after jump back to that marker (cursor place at the last ##) but I will try it later 😮

  • @vasileceteras
    @vasileceteras7 ай бұрын

    I watched this four times

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

    That could be a really good rap. In my mind am going boob-chick-chick-boob

  • @DimasPangestu-dx7hn
    @DimasPangestu-dx7hn6 ай бұрын

    Yo, replay replay replay replay

  • @lukafireman
    @lukafireman2 ай бұрын

    Hey, this isn't done automagically? :OO

  • @Marshblocker
    @Marshblocker7 ай бұрын

    Bro does everything except programming 😭

  • @richcaputo2929
    @richcaputo29296 ай бұрын

    That’s cool

  • @andnekon
    @andnekon7 ай бұрын

    I'll have to learn markers now

  • @maxjenkins6193
    @maxjenkins61937 ай бұрын

    I'm pretty sure i know what happened and it's still some dark magic

  • @daltonyon
    @daltonyon7 ай бұрын

    Table of Contenta blazying fast!!!!! Only available in vim

  • @lenickramone
    @lenickramone7 ай бұрын

    How does hé change with dashes?

  • @VanStabHolme
    @VanStabHolme7 ай бұрын

    Wait, doesn't the link have to be all lowercase?

  • @user-tv4fu9wd7u
    @user-tv4fu9wd7u13 күн бұрын

    I just typed the first line and let copilot do the rest

  • @mcspud
    @mcspud6 ай бұрын

    long term vimmer and can confirm greatest macro ever

  • @wl4dymir

    @wl4dymir

    6 ай бұрын

    long term vimmer and can confirm I understood absolutely nothing

  • @BlueTac1992
    @BlueTac19927 ай бұрын

    Is that Tom?

  • @connorskudlarek8598

    @connorskudlarek8598

    7 ай бұрын

    Nah, Tom's a genius. This guy just worked very hard. Tom can invent JDSL. Prime would never ever do that.

  • @IsaacShoebottom
    @IsaacShoebottom7 ай бұрын

    Smooth but this is something copilot would do for me faster

  • @elrohirgt8366
    @elrohirgt83667 ай бұрын

    Nice

  • @DudethatGross
    @DudethatGross6 ай бұрын

    It’s kind of uncanny how much you sound like Jay3 from overwatch

  • @50_foot_punch99
    @50_foot_punch997 ай бұрын

    Fucking beautiful

  • @ShnizzleBedizzle
    @ShnizzleBedizzle7 ай бұрын

    Oh wow that's what a 180 IQ points must feel like everyday huh?

  • @gauthamdinesh
    @gauthamdinesh6 ай бұрын

    Do you use vim at work?

  • @biggusdickus9128
    @biggusdickus91287 ай бұрын

    Amazing! Love you big moustache man

  • @ewarrin
    @ewarrin7 ай бұрын

    What in the hell just happened? Am I still on planet earth??

  • @steamer2k319

    @steamer2k319

    6 ай бұрын

    Vim macros. Vim has two modes: command mode and edit mode. In edit mode whatever you type just goes into the text document. When you switch to command mode, though, every letter on the keyboard becomes a one-button command for e.g., seeking to new cursor positions, cutting, pasting, find/replace, etc. You can chain a series of commands into a 'macro' and replay it in different times/places. If the macro is abstract enough, it'll work in different contexts. Here, Prime builds a macro to find header lines (that start with '##') in the document. The macro copy/pastes them to a marked area of the document where he wants to build a table of contents. In addition to pasting the title text, the macro also creates a second duplicate and reformats it as an href/anchor so that readers can click the link when loading the document in a browser. Prime verbally calls out the descriptive name for each command he adds to the chain. The one- letter/key binding for each command is also shown as a screen overlay for the video. It's very impressive that he was able to chain together the right sequence in one pass with no mistakes in his logic and no fat-fingering the wrong key 😅. It's apparent he's gotten a lot of practice with Vim.

  • @jamesjenkins9480
    @jamesjenkins94807 ай бұрын

    I vim, but this... Holy shit.

  • @joegote
    @joegote7 ай бұрын

    What magic is this

  • @Jiyoon02
    @Jiyoon026 ай бұрын

    "This is the greatest vi" skip

  • @llayered
    @llayered7 ай бұрын

    im gonna stick to nano

  • @prawnydagrate
    @prawnydagrate7 ай бұрын

    help my neovim sucks, can someone recommend something that could replace vscode?

  • @derodomtommy3716
    @derodomtommy37167 ай бұрын

    lol org-mode just has table of content autogen

  • @pepsitoly
    @pepsitoly7 ай бұрын

    I love you you are great

  • @fallegapyro
    @fallegapyro7 ай бұрын

    Finally, someone who can vim

  • @furballphillip
    @furballphillip7 ай бұрын

    For those of you who don't understand, I'm a junior CS Major so let me explain... I have no clue either.

  • @orbatos

    @orbatos

    7 ай бұрын

    Even if it isn't trivial it's straightforward, pull up a document written in Markdown and follow along.

  • @dwolrdcojp
    @dwolrdcojp7 ай бұрын

    More vim content

  • @microcolonel
    @microcolonel7 ай бұрын

    Vim users use macros like they are magic spells, Emacs users use macros like paper towels. 😂

  • @sf1tzp
    @sf1tzp7 ай бұрын

    Damn

  • @ThePrimeTimeagen

    @ThePrimeTimeagen

    7 ай бұрын

    its a gooden

  • @Naeem2460
    @Naeem24606 ай бұрын

    i use vs code in my arch btw 😂 (jk i use nvchad)

  • @getoutoftheway419
    @getoutoftheway4197 ай бұрын

    Does it matter if i learn vim if i am a beginner in programming.

  • @bhavyakukkar

    @bhavyakukkar

    7 ай бұрын

    awk, vimscript & lua are the only languages you'll be using on (not in) vim/neovim, and you can go pretty far without having to. prime also has a nice video where he configures neovim live

  • @ragectl

    @ragectl

    7 ай бұрын

    You can, then you have two programming languages to learn 😂

  • @jorgegomezabrante8780
    @jorgegomezabrante87807 ай бұрын

    Emacs Lisp TOC macro DSL for these type of macros.

  • @narutosimas
    @narutosimas6 ай бұрын

    The time I would waste thinking how to do it, it would be more efficient jost do it manually

  • @cooltune
    @cooltune7 ай бұрын

    Sorry bro. My brain uses neurons to operate not transistors. Let you know when I upgrade.

  • @jose6491
    @jose64916 ай бұрын

    I think i'll stick to Obsidian

  • @secretzpt176

    @secretzpt176

    Ай бұрын

    Why would you edit your repo's readme using obsidian...

  • @zildeos9858
    @zildeos98587 ай бұрын

    I just came

  • @nguyenhoangminhtrung2779
    @nguyenhoangminhtrung27797 ай бұрын

    I have been using with Vim for 4 years now but seeing someone using and saying it out loud like this made me progasm

  • @dongct2504

    @dongct2504

    7 ай бұрын

    fr 🤣🤣🤣

  • @simonfarre4907
    @simonfarre49077 ай бұрын

    I know this is going to hurt Prime's soul but... in vscode, all you have to do is (# and and VSCode will figure it out and provide auto fill. Thus, making the process even shorter ;) Well, if you have 40 headings, vim motions will certainly be faster. VSCode, the harry potter of blood magicks. The greatest back handed compliment ever lol

  • @sacredgeometry

    @sacredgeometry

    6 ай бұрын

    Let the caveman get excited about his wooden stick.

  • @latertheidiot
    @latertheidiot7 ай бұрын

    VIM wizard can't deny it.

  • @lpbigfish3730
    @lpbigfish37307 ай бұрын

    That's nice, but can it Microsoft?

  • @Nafana
    @Nafana7 ай бұрын

    1) what

  • @superitgel1
    @superitgel17 ай бұрын

    wtf what that

  • @denizkirbiyik9221
    @denizkirbiyik92216 ай бұрын

    VSCode Supremacy starts because of things like this.

  • @davidpsmith77
    @davidpsmith777 ай бұрын

    Its double @ to replay a macro.

  • @thunderdeer6073
    @thunderdeer60737 ай бұрын

    Oh Yeah? I could’ve easily done that 5x slower

  • @curtisharwood6626
    @curtisharwood66267 ай бұрын

    ....what?

Келесі