Harpoon : Vim Conference 2021

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hacker man he's the most powerful hacker of all time follow me [Music] [Laughter] it's just me i know so now things are going to move at a little a little different pace you know before uh you know a lot less screaming happened today than normally happens on this channel so today you're gonna hear at least one or two screams normally my mic's a little bit more conveniently located so i can do a professional but i don't think i can do that today because you know it's been conference we got to be we got to be up you know i got to be like doing the right thing here okay okay thank you so much for all the claps this makes me feel very very special and uh today i just wanted to talk to you yes by the way this is not dirt my wife did bleach this sweater okay this is my favorite sweater of all time it's just thin enough that i can wear it any season all right so anyways i just wanted to talk about harpoon because harpoon is the something i get all the time hey what is harpoon why do you do that why is there a chair in your scene i don't know why there's a chair in my scene what chair uh the cake is not a lie um did we get over 200 chatters no we did not but let's let's stay focused here okay so harpoon i'm going to tell you kind of the backstory because i feel like if i just say hey here's harpoon you're going to be like i don't really care right it's just how it goes so i started off life uh in netbeans you may have heard of netbeans i remember the first time i opened up bim vi back when i was playing around with it i literally was the meme i produced a hash sequence pressed all the buttons and i just physically held down the power button and turned off my computer uh this was me in college this was me 17 years ago yes i was that guy feels good you know we all start off as that person but then as time went on i i moved from netbeans to intellij and i learned about control n now control n was the fuzzy finder it was fantastic i could open up any file quickly which you know it was pretty neat but i had this habit of going up and using my mouse and going up and selecting which file and doing that but eventually that all kind of stopped and i moved on and i got really into fuzzy finding i really liked it and so as i went through when i switched to doom max yes i did use do max for a while and space max you know leader pv boom project view like i could just do it so quickly and then i kept going and kept going i had all these different ways or a pt i think would be the fuzzy fact i can't remember what it was i'm not not an emacs guy uh and then i went to vim and then i went back to do max and i went to space fam and i did neo vim and new of them sucked back in the day and then i was just like i hate neil bam it's probably just me and how i set it up and then you know i went all over the place and uh yeah i lit literally this is the line out of my uh vim rc i i really used to do max for a while and it affected me okay it just hurt me i had i used it okay and it just stuck with me forever but then one day i learned about this right alternate file if you don't know i don't read the friendly manual very often but i did learn about alternate file and that was awesome right that was that moment where you're just like oh my goodness this is the greatest thing ever i was actually talking with one of my co-workers and he's like well in in emacs we have this thing called alternate five and i was like hold your tongue winch i already know about this right and like oh we are already there and we discussed it was fantastic i loved it it was fantastic but you know started making this weird pattern i started doing right i started going from main file to other file back to main file to the next file back to main file to the next file back to main file you know i just i kept doing this and then every now and then i would go like this go like that and go oh my [Music] why and then it's just like now i got a fuzzy find my way back to me it was just like it's emotionally painful right i just hated that i hear right like i just i couldn't handle it and so then uh god invented the lsp and that ruined everything in my entire lifetime right because now my navigation went accidentally like this and then turned into that right like just like i just oh what's that all about hey what's that all about hey what's that all about it's just like now i'm just like i'm just constantly having to fuzzy find everything right i have these like i have 5 000 memorized three sequence types that i would do and i would get the exact file i want to get right everybody knows this right you do like the capital t the end and the capital s and you got you got that one specific pattern to get to whatever file you need to like i hate having that type of information and doing that yeah it's just like ah right uh and then of course i uh also started using co and ci a bunch and this also became progressively more terrible to use you know why because i started navigating with the squirrely braces right and oh my god i was holding jay and i was like you know i gotta level up my skills here and so now i'm using uh contiguous code jumping but it pollutes the jump list and then control o is even more terrible it's just like i was in this i know it sounds funny everyone's like well fuzzy file findings the greatest thing that has ever existed what are you talking about i find it it emotionally hurts me okay when i have to do it over and over again it really does hurt me so i i set out i'm gonna fix some things okay i'm gonna fix some things so i invented a game called vim be good so i could literally practice relative movements all these other games were invented by other people i just wanted relative move i just wanted to practice relative jumps just so i could become good at relative jumps which would alleviate a part of that little uh you know squirrely brace jumping and so what happened it helped not much so then i thought that's it i'm gonna get even better so i learned control d and control u and yes now that's the only way i vertically navigate is ctrl d ctrl u and relative jumps and guess what guess what happened it helped but not much i still just i can't my alternate file's almost exclusively wrecked on top of it i have to fuzzy find constantly right so i'm just like okay i'm not liking this right so i had to go back to the drawing board okay and by drawing board i do mean i'm going to actually jump over here and to where i'm going to draw the straightest line that anybody has ever seen in their lifetime okay so i hope you're ready so this is kind of like how i imagine most people really do projects as by the way first line out the gate look at that that's beautiful somebody should make an nft out of this all right so anyways so now that we have that fun little joke out of the way this is how i uh effectively assume that everyone does things right you have all these like files that you're going to but really what's actually happening here is that you have four main files or maybe three main files maybe two main files yes straight lines everywhere okay these are beautiful and then you have like a whole bunch of these like little other ones over here right it doesn't really matter what you're doing these are lsp jumping things but really when you're focusing on a feature when you're focusing on something you have a round four finger of four or four files which also happened to map the four fingers so i started like thinking okay i want this i want this how can i achieve this right like this i want that i think i could do this i think i could do it so try number zero bp be next i was like okay well let me see maybe i can like kind of you know maybe i'll buffer delete a little bit trying to do as it was awful it was awful no no i was an emotional turmoil using this eventually just we went like this next next next next next next stack like i could not do that that is that is somehow the worst form of navigation ever created uh except on the server i think it's fantastic for a server right because you know you're on a server you have to only have like three things open fantastic but so next try marks i'm like oh yeah this is ex i mean look at this that's exactly it mark a mark b mark c mark d and you're like yeah this is perfect this is exactly it this is what i've always wanted and then you switch projects and then uh your marks are all gone because they're global or local and it's just like don't worry what are you doing like just it's all gone every part about it it's gone and this hurts you know because you really you spend some time thinking about how you know things should be done and now it's gone and and then you know and and they're also where they are now i know this is kind of a weird sentence right they are where they are meaning that if you don't update them they're not moving right but you moved on you've moved in you've moved on in the file right you were once here now you're there and then you navigate back and you're from whence you came okay i don't want to go from whence i came okay i'm not the ring that needs to go back to the fiery chasm i want to stay where i am so i got i tried i was terrible at it i kept doing it i kept forgetting it's just like everything else in my life i could not remember it once again nice time to serve that it's really nice you know it's a good habit to get into i should probably make sure i'm doing that you know what i mean i should probably make sure i'm doing that but i just couldn't get into it so of course i was lost at this point i didn't i didn't know what to do i just i just felt like i felt like my life was falling apart i just and then i had an idea what if i just write my own plugin what if what if what if i just tried to solve this myself okay so i like i could do this i can do this i can do this and i did i'm gonna do it try number three remember three for two everybody knows this because we started zero so i started with af plus which is named after mike tyson because it's a knockout it turns out it was it was uh i mean i thought why not two alternative files right i mean why not by the way this image provided by asborne it was fantastic and uh it sucked it was awful it was awful it's the exact same reason why doing like you know like how people on macs that you know you know mac users it's like 80 percent of the people that spoke today i'm insulting everybody anyways it's like when you press a command tab right and you're like tabbing through your programs it's really great when you have two because it's just like command tab command tab command tab and you're just flipping and flopping back and forth but the moment you go to number three your whole order screwed up and if you don't have it in your head you're constantly having to actually read it with your eyes and go through it right it's just the worst it's just the worst and i couldn't do it right uh so i scrapped it i got out of it i said get out get out so then i tried a jump list navigation plug-in that would read your jump list and try to give you more intelligent kind of fixed positions that you could just jump back i don't want to talk about that one [Music] so finally at some point i came up with an idea i said you know what i really did like marks and i was listening to a song called harpoon by uh pegboard nerds and i thought ah perfect already have the named project for it okay i already have named the project and i really liked the concept of marx and then somebody made me really great you know picture for it so at this point i knew for a fact i had a winner here okay even before i wrote the first line of code this was a winner okay i could really feel it i could really you know i could really feel this one and so i was like all right we're gonna just do marks we're doing marks but we're gonna make it per project all right not only we're gonna make it per project it's gonna it's gonna save its column and line uh position when you quit or change right so if you change buffer i better remember that one spot you were just at oh you quit vim i better better remember that position right so i was like okay okay this is we're getting somewhere now like i really feel like this is actually pretty good and then of course uh uh we need a ui to swap positions and stuff right because sometimes your marks become a little bit stale so you kind of want to like delete things or move them around maybe that mark is was not important now it's super important so you want it on your most powerful finger or your most used shortcut right so it kind of had to have all these things put into and i felt like okay this this feels good like i can really feel myself getting getting really excited i mean i can just feel it i can feel it i can feel it and you know when you can feel it nothing is better like it's just you just know for a fact that things are gonna become amazing and so we started programming started programming as much as possible a lot of you were there on twitch when we were doing that and of course what happened we were successful and it was awesome and i became more and more excited i don't think anything in my life has been that awesome and then i just i just felt like i just felt like there's only one way to express it which of course is through interpretive dance so and that's it all right that's that's how i felt ruffin does not dance better okay he does not so anyway so i was like all right all right all right all right we're gonna do that we're gonna do that we're going to definitely do that but that's it so that's that's really how i came up with harpoon i was i'm i'm not technically done yet oh okay i thought you were done i thought you were saying we were done i i'm out of breath from dancing i was too bad to twitch delay was too long i was going to come in and sneaky dance right behind you that's ridiculous all right no i'm actually okay i'm out of here bye i gotta keep going okay so let me just give you like a little quick you know little quick demo okay so say uh here we go so i can open up my menu i have nothing harpooned okay you don't want to see tj dance okay you don't want to see that so here we go so say i like this file i like this file a lot right i'm going to add it i'm gonna quickly just call harpoon at it and as you can see it's right here huh that's pretty nice it's pretty nice it's pretty nice so now i can just jump to it as you can see it says file navigation one i'm jumping to it i'm gonna go down a couple pages and i'm gonna quit i'm going to reopen up them and now i forgot i'm actually using git work trees i don't remember what was i on this is well this is embarrassing there we go so i just jumped back to my position right so i'm still here i'm still right there i still have the exact same things now since i'm using get work trees it means that i have a bunch of different paths for different commits so i can now create a new one master two do that master two it'll go here we are now we are now in master two there's no harpoons in this one because the path has changed right i'm able to have features have their own set of important files so let's actually go back to this one let's go here let me just open up 106. i'm going to add this one i'm going to go right here it doesn't really matter where i go right so now i have two items so now i can simply go back to the first one or go back to this single finger just jump to it like that's kind of what i wanted right this is this whole notion that there's four primary things i'm usually always working on or maybe it's two maybe it's three but the rest i can just use my lsp to you know jump to or maybe a fuzzy finder to jump to but in like in general my my primary thing i need to go to i should want that right i should want to jump there so when i actually go somewhere else let's say i go to 123 i can do that i can be in here and go i got to go back to my main file i can open up this window i can change it i can make the positions different and now when i go to my primary file it's the previous one i just moved this position upwards i can go in here and i can just delete it out i don't even want anymore now it's not even there anymore like that is really great to me this is exactly what i wanted for navigation and so this is kind of what i wanted to show you okay hopefully enjoy it i'm still a little out of breath from that dance that dance move okay i was really really into it okay so hopefully that kind of helps everybody understand kind of my thought on what i think is great navigation i've i've thought about it for some time now and i've really tried lots of different ways to be able to navigate and i feel like it just wasn't good enough right someone says it feels like tabs but with extra steps the hard part about that of course is that when you do tabs you have to look at like i don't want to have to look at them and remember those things i don't want to have to adjust my tabs i don't want to have to move my tabs just simply highlighting and moving at some some line down just seems so much easier right i could have three the same thing like it just it just feels like a you know all right that file doesn't exist right it just feels like it's something that can just really dig right into my head it also has some other things with terminal jumping and all that but we don't care about that thing okay so there you go that is it that is harpoon i hope you enjoyed it what about harpoon terminals we're not going to talk about that i'm trying to move to tmux i'm trying to figure out how to make harpoon terminals into harpoon t-mux terminals terminals to memorials cameras terminals dang it
Info
Channel: ThePrimeagen
Views: 106,785
Rating: undefined out of 5
Keywords:
Id: Qnos8aApa9g
Channel Id: undefined
Length: 17min 8sec (1028 seconds)
Published: Tue Nov 02 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.