Vim Life Ep 2 - Macros, Motivation for getting good!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Valuable information, delivered in the most annoying way possible. Gaah…

👍︎︎ 8 👤︎︎ u/-romainl- 📅︎︎ Mar 08 2020 🗫︎ replies

Love his twitch channel! I go to watch him use vim not to actually program anything

👍︎︎ 2 👤︎︎ u/easylifeforme 📅︎︎ Mar 08 2020 🗫︎ replies

Who are the clowns downvoting every post on this subreddit?

👍︎︎ 6 👤︎︎ u/pwnedary 📅︎︎ Mar 08 2020 🗫︎ replies
Captions
you today at work I had the merchants change in from a future branch and back into the past this was for automation for testing and all that when I did it there was no way to simply just let it do that and I'm sure we've all ran into this place and it's just like it's it's so hard to do this because it is monotonous and there's literally like hundreds of lines and I just find myself slowing down just and so I could feel that same thing happening again today and when I was doing it I've near twenty twenties been the year of the macro for me I'm gonna get very good Advan macros and this was a great experience that I had it genuinely made it just feel like it goes much faster so I just want to kind of share this with with everyone that macros are incredible they're awesome and you can just execute them so fast if you do them right so I thought I'd kind of walk through what I did but name's the prime gen I stream on Twitch a few nights a week and I work at Netflix as a senior performance engineer on the television platform which means that I I'm going to try to make your television experience even better ooh baby I would make a real Buddha all right so let me show you kind of what I was doing in general what I had to do is I had to go to stash I had to cut a piece of code I had to place it into a certain spot and then I had to make this change where I had to remove the Oh change the name call it a function come down here rename this record heap allocation and then take the name of the first item and do that that's effectively it I just had to do this hundreds of time find the file it sometimes was renamed it was just everything was wrong in spacing was wrong everything was wrong luckily when I pasted in it out of formats were good but nonetheless well and mostly auto format it mostly out of formatted so instead what I did is that I forced formatting I deleted why I need the deleted I renamed where I need the rename and I added those extra parameters and I did this all with a macro and it felt good so let me show you what I did and hopefully make a good case why you should be getting better at macros you know like I said I'm not the best at macros I I rarely use them but 2020 is the year it's the year crush them let me show you what I did but before I show you what I did I I do need to tell you how a macro works it's actually not too hard there's three general steps to a macro one you start the macro to get do what you got to do do it and then of course three let's just jump into here and go stop right that's it and then of course I mean technically there's a hidden step four which is play right oh why is that rock now that you know how macro works let's jump into actually doing it let's unform at this one as if it wasn't correctly formatted and then have two of them so I can both do the macro and play the macro so first the first thing that I did is that I put my cursor somewhere on the line with the if death we start a macro by doing Q and the letter you want to press so you'll notice down low way way down low says recording a so I'm gonna go shift a or shift V highlight the whole line search for and if hit enter so now we're here now I'm gonna press equal sign equal sign will will format everything according to whatever formatting rules you have and then put your cursor back at the beginning of the place that you highlighted from fantastic right because now we're right back at the top so the next thing I did is searched for JSC hit enter I need to remove this DT capital o removed it I need to go forward twice turn that into log allocations exit then I had to look for week four to heap sample remove that record keep a location exit that jump to the opening parentheses step one more in delete the word and then paste paste and now that we're good to go I'm gonna repress Q to stop the macro boom notice that the little recording sign went away now that we've done that we are good to go I'm gonna save it first okay we saved it then I'm gonna press the outside to play so to play it you do at and then the letter that you selected for the your macro name so I just selected a so we're gonna go like this at sign a it'll highlight it format it search for the if statement remove the JSE rename that search for record rename that copy paste copy paste which is fantastic because there's a to make that workout so before if I were to do that with searching and replacing not only would I have to manually highlight it hit the equal sign I then have to do that search across to do the search and replace my search and replace to be rather complicated likely two of them I'd have to first do one here and then do a second search and replace for that one it would not have been trivial to do this is a great case for macros where you have to do a set of actions that's pretty monotonous but slightly different each time but in the end you have a uniform way in which you can operate over everything and produce the same results if you give them the same key sequences I hope you really appreciate this I hopefully that just it just inspires you to do this I absolutely love them I cannot stand it I started off not knowing what editor like I started off as an intelligible or actually technically a NetBeans I was on NetBeans you know flapping my little hands all over the keyboard press and everything and then later on started using IntelliJ man that was fast I don't what who didn't like it when you know you try to autocomplete and wait for like 15 minutes before it auto-completed then finally I saw the light I became a Viviane and I just was able to just crush code it's been a fantastic experience ever thanks so much for watching my name's the prime mission I stream on Twitch I have links down below please comment if you have any questions on twitch we do a lot of projects either in C C++ or Java Script slash typescript making ridiculous things such as vim royale the greatest battle royale ever created stay classy San Diego I don't want to be stay classy guy
Info
Channel: ThePrimeagen
Views: 21,551
Rating: 4.9847326 out of 5
Keywords: software, vim, programming, javascript, typescript, software engineering, web developing, web developer, software developer, developer, cpp, programmer humor, humor, reactjs, js, ecmascript, tc39, Netflix, Engineering, Engineer, Facebook, Amazon, Interviews, Software Interviews, vimrc, neovim, spacevim, vim c++, vim editor, text editor, vscode, vscode vim, vim plugins, coc.nvim, autocomplete, vim autocomplete, nodejs, twitch, stream, emacs, YouCompleteMe, You Complete Me, bash, vim macros, macros, vim macro
Id: Wf5cMON6vS4
Channel Id: undefined
Length: 6min 29sec (389 seconds)
Published: Fri Mar 06 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.