My Journey of Using Vim for Java Development

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Hi, it's me again (under another username). It's my second video and I thought it was better than my first. Anyway, I want to apologize because despite the fact that it's my second video, it's still not as good as I would like it to be. Unfortunately, I have a lot of work, and I wanted to just finish this video (before my birthday - tomorrow). I hope you guys can enjoy. It took me about 3 weeks to plan it, record, and edit it. I know I made it it and all, but I think it's an ok video that can help people. In the video's description there will be a pinned comment detailing everything.

If I said anything wrong, then please criticize me and correct me.

👍︎︎ 10 👤︎︎ u/SeniorMars 📅︎︎ Jun 03 2020 🗫︎ replies

I'm sorry that you have to use Java

👍︎︎ 28 👤︎︎ u/FriendsNoTalkPolitic 📅︎︎ Jun 03 2020 🗫︎ replies
Captions
my journey of using them for Java or more like the summary this video is gonna consist of how I use them for a Java development it's gonna be split into five parts the first part is I'm gonna talk about how and why you shouldn't actually use for him for Java the second part is gonna be been a point to you and it's just gonna be how them it by itself it's really powerful the third part I'm going to talk about steal them and how I added plugins to actually increase events functionality the fourth part is gonna be about workflows I'm gonna actually give examples throughout the whole video but in case I want to add more things I will add this section here the last part it's my summary or my after thoughts of actually using them and how my experience has been throughout this video I'm gonna add timestamps in somewhere in this video so if you guys want to see that if you guys want to see a specific part you guys can click on it it's also can be in the description if I don't forget I'm gonna actually add my resources in the in the description bar and I hope you guys enjoy this video so what shouldn't you actually use theme for Java development I think there's a lot of reasons the first reason most important reason is the Java definition of an object-oriented language you're gonna have to go through multiple files just change one single thing and to go through a code implementation you're gonna have to know where the file is located yes it's definitely possible to do this in vim you're gonna have some solutions and you're gonna have some built-in tools that actually complete the functions or help you in editing java code but a tenth of a you're just gonna have a bunch of random parts working together and if you don't know what you're doing you're just gonna spend time just setting them something them identifing it might not work for you I think you should use what you're most comfortable with seriously I'm not trying to gate block anyone but I see people setting up them to be exactly like something it's not or something it wants or people want to replicate some features enough them and some of that it's really fine but if you're just trying to have vim act exactly like another tool I don't think that's right like you can be spending that time just to be editing code I think also that Java pretty much once an ide vim is in text editor Bisset etc and by itself it just can't be as good as other ID ease like what i des offer II's offer so much that the reason that's the reason why they're calling environment and then can act that way you know but it won't I don't think it will be ever asked Adam I think you should just be using the best tool for the job for examples while I'm taking notes or right here the program using its doom Emacs in org-mode and I found it really pretty and fam honestly could never do this much like look at all these Unicode symbols ah also there are various vim plug-ins for your IDE or text editor that you might want to consider and they might work for you if you're gonna go and if you're gonna go this way I suggest learning some sort of build tool so you don't have to compile classes over and over again just a warning I am a junior in high school my workflow works for me but honestly I have not had a real life experience to validate my er setup so it works for me it might work for you it might not so why am I making this video if I'm so like like against the concept honestly I kind of want to help people like if you're gonna do it anyway you might as well have a reference to it and that's where I come from that's part one so I want to show you guys the power of them without any configuration because I'm pretty sure that people just skip it without knowing how powerful phim is so I'm gonna make a pretty simple link list class I'm choosing this because I'm pretty sure that a lot of people know how to make a link list class in any language and again it's pretty simple so the first variable I want to make in my linked list class its size because I think it's a good thing to have and now I'm gonna show you one of the first things that people don't really know about it has its own autocomplete well I'm not necessarily talking about autocomplete in the sense that I bees give you but I'm talking about like completing words in or lines that were typed before so you can use this insert mode with control X and control L to complete a line of course we don't really wanna we don't really want to have to two variables or two fields with size so we're gonna create our head now and then once we're done with that we can again autocomplete the line save us some time and make it tail in set because if you don't I want to make it extremely simple linked list and having a tail it's gonna make it faster or some more simpler now we want to make a constructor for our linked list and that's again it's pretty simple I'm not really using any of them features but you can see this how you can you can still write code Java code in them without any configuration and we're just putting serial because of course I'd start when you create the linked list object you don't really have any nodes and in here you're some another thing show control X control L autocompletes a line and then control X control n completes autocompletes a of a word so here we go private static man we're now gonna create a a node class because I used it in the fields but I haven't defined it and that's not the correct syntax and this is just gonna be a pretty simple node class that has a field data and another field that it's a pointer to the next node so so instead of doing control x control and you can just do control N and autocomplete the word the different is a control X control and looks at the whole context of the line and in control and just autocompletes it based on the first term in your path so again we're just going to create a simple linked list and hopefully I remember how to and this is just a really this dot theta it's equal data again not not very difficult and then ctrl n and then we're gonna make a string a two string method public return and since this is a generic class we don't actually want to like worried that much about our to string method because if you don't know what kind of object objects are gonna be in this link list and that's how we created a simple node class but now let's actually insert some nodes so let's make um let's see let's make a an insert method to insert those nodes so it's a lowly parameter is gonna be data and then let's actually do this so we want to create a new node because you have to creative and let's just call it a new node because good variable names are the key to life and since the constructor of a node only takes one parameter we're gonna call that and let's check it if if it's the first node then the heads gonna be yeah it's gonna not point to anything so let's just update the head and then do it's equal to new node else if it's not empty that means we have to update the tail and we're gonna do work you know and then finally we had a update the tail itself instead of just putting at the end and that should be it and then size plus plus because we have to deal with though it's nice variable let me um scroll a bit down and then we want to make a two string method but since we already we already um created a two string method before we can just you control X control L yeah then could go do control P to go back to the previous entry or control end and control piece how you move to do a complete list menu and we're just gonna of course make a variable a variable result to actually return our the the the two string or whatever our two string method gives and we're just gonna again make a new node current because we have to move through the whole list I'm gonna we're just going to point it to the head this is simple while statement so if so a linked list ends once the last node is equal node it's equal no because that means it's just a pointer or it's not pointing to anything so we're just gonna have to check it until it's equal to no and again we just want to append our since we're you made a node to string method we can just use that so we're just going to use current plus and just gonna do an empty white space just to make it more clear and update our current node am i doing current done X and that should be it and of course we want to return our result whatever that is and then do that and we just completed our linked list here's a tip so a lot IDs how pretty fire and all of them doesn't really have that if you wanna like if you have like really messy and indentation you can do G G is equal to G you know indent your arm file it works really nice in Java another thing people don't really know about them is that if you do ctrl left bracket and then M you go down your methods or go through your methods this is really useful it's not I don't think it's in every language but it's definitely in Java with um since it has a curly braces and you can just do that to navigate through your file instead of like doing a hundred Jase or something of course I think the most efficient method for own just class sonication is just curly brackets just skip through whitespace so let's actually test is um class you know because that's a smart thing to do so we're just going to do it and we're gonna do link this or you know what let's just call it chain runner kids link this kind of like a chain and here we go well since we have a method um signature for a linked list we can just kind of reuse the same thing and here's the tip like a lot of people only use olifants functionality but i think i think people should at least learn about the expression retro cern because it's extremely useful and so I feel like my my screencast isn't working so let me um turn it up again I guess here we go there we go we got to working again so this pression register is again control R and in the equal sign and then you can expand whatever you want I use expression register a lot just to get the file name of the name of the class because you know if you're working in Java you know that you have extremely long file names and you don't I don't know who remembers them so I just used the expression right sure and just get the the name of the file without the v extension dot java just do like that except that didn't work because I probably misspelled it or something and let's try it again there we go chain runner so using that expression right there it allows us to get the file name and it's pretty simple so you don't have to like I'll she type in the file name and we're just gonna do public control and static void see this is just gets really simple like once you've not learned how to do it and of course want to make that array and let's see [Music] and then we want to make a linked list object if I know how to spell integer correctly I'd never learn or you know what let's make this a string that's yours great very one name by the way equals new link this string and there we go now let's add some strengths to our linked list by doing insert and then we can do control X control I know control X control nope so let's just add whatever string is just hello and then control X control and let's just change it a bit and ant world because why not why not and of course when I do system and we haven't defined that I forgot print Ln St ours okay so now we're done with that so how would we test is I think a lot of people would use a well if your amp in point eight or if your m8 and above you can do like four term which will launch a new terminal and then we can do Java C dot whatever if my thing works and there you go you can do that I guess and be compiled your whole project but that does that seems like a lot of work you know you're opening up a new terminal you're doing so much and I don't really like that I don't know who does I really don't know who does but I think here's another feature that people don't really know about vamp ass make and it was originally intended to use Ford make files so you know if you know like if you ever use a make file you would just type and make on your terminal you know and if you have a make file it will do the instructions in the make file but here's the fun part well yeah again here's the fun part them what events make was intended to work with make files but you can also make it work with other with other tools as such as Java C to compile your project and you do it by doing set make PRG is equal to Java C whenever you're making whenever you're setting make PRG you actually have to escape your your spaces and I'm gonna do the slash the G flag because I kind of like that every time I I liked that flag just in case and again that's it that should be it and then our file name and % just stands for the file name if you don't really know space and then we can do make now it will launch the terminal and it will make our project anak okay and this is really useful because um because if you do hold up I know this can be really shitty but for term and then this is just I'm just gonna show you that a she works so I'm just gonna do RM dad classes and delete that and then we're gonna do make and then I delete it before right but now if we do a simple LS you can see that the the classes files were generated and that's become a quirks and again make its really useful it compiles it can be used to compile a project but there's no different part the make she goes along with um with the bim's a quick fix list which is another thing the most people don't about know about and it can be used to check your Earth's in a compiler for example say I for some reason forgot to write this semicolon and if we do make we're gonna get some errors right and we can get a lot of errors you know like let's just you make you have two errors now we can use to Vince quick fix menu to get those errors so if you run make and then you're running to see open you can see the error so you've got you know let me expand it and as you can see here um I telling us we have two errors at the end and we can just you can enter to bring us directly there of course these are pretty simple errors then you can fix easily without I hope a compiler having to tell you but sometimes you do make stupid mistakes but the quick fix money or can be really useful give you of like um large amount errors and you can you can also like say I also had those errors before and I need a quick fix menu there are some ways to navigate the quick fix errors you can do see first to go to the first error see last to go to the last error and then this is not that useful since we only really have two errors but you can do seen X and then see preview yes go back to the next error okay again this is really useful if you have a lot of errors and really just want to work within them and then vim gives you all these options to um I'm sorry to just compile your project it's really useful first of all sorry for the noise background I just noticed how loud it is I'm really sorry I can't really record somewhere else but we have um compiled using make this file but what if you really want to run your code well you can do the filter and I'm gonna explain a better way to do this later on the video but you can just do filters to run the external command and you can do Java your file name I mean I like again expression register is really nice for this because um you don't really have to remember your file name and then their you'll in hello world that's pretty simple a really stupid use a really stupid use of a linked list but you know it works and then what if you really really really want to rename a whole bunch of variables a whole bunch of variables you can use ah vim okay so there's another way to populate the quick fix lists and that is by using vim grep bim grep and then here vim grups just takes a search so I'm just gonna search insert because I know that I I've used it in both classes and I'm just gonna do so vim grep searches for a term and it you have to tell it what files you want to search it in so I'm just gonna search up old Java files because I only really have two files but you can just do linked lists that Java and then a chain not runner not Java and now if we open our quick fix menu again we can see that it has subtly it has all the locations where insert was used and now if like I know that some people really like the function of an IDE where you can just rename a variable you can do that in vim to using quick effects menu and doing C do C do is just for every it just tells them for every change or like for every item in the quick fix meant list you want to do two specific change in order for let's do this we need to actually set hidden um if you don't know what it says I'm gonna explain it later on the video so now we can just do C do and then whatever command we want to do for every item in the quick fix menu and I think it's pretty simple we want to replace insert with I don't know and there we go just global see I like doing GC just to check that every that were actually gonna replace what we want to replace so we're gonna change this insert with AD and it's in certain that and then this insert with odd and there you go this how you can rapidly change a variable name and the last thing I want to show you guys with just traditional fam is how to navigate files without really using C tags or some other tool so here's a three this was for a school project I had to do I didn't really like it but um if we just do predator well this is one of the classes I have to do as you can see here we have for extending another class but I don't really know where that is like if we do X and then here we can like we know that are so many files I don't really want to check through all these files so what we can do here is set its work with gf so right now if we do gf which searches for the the name of the searches for the file with the name under a cursor throughout our directory we don't and it doesn't really work right now because we haven't specified our path and gf it's really useful if you want to navigate without C tags so here if we do set path well we have if we do set path plus eco or current directory and then everything below it I know this is a terrible thing to do but stick with me if you said our set path you can now navigate some things but the next but that still doesn't really give you the option to go to the files especially in Java but here's the next thing you can do to make this work alongside path so you can do set suffixes suffix and I smell mixing I misspelled suffixes you can do sets officers add and then we're gonna do the dot Java and now with this we can do gf and it brings us to our critter class and then we can do if we do set hidden of course because honestly I like set hitting and then we do ctrl shift and then tear it we can go back to your old class or you can do control control and then so we have a bug runner I think he really and this is really useful because if you have like a lot of classes you can do G of and just go through that hole just go to that file directly with GF you can also do this but fine but I like GF since whenever you you have to like to clear the name of the of the Java of the class when you're working with Java and again GF just goes to that it goes to that class this is just this just works by setting suffix add and set path and you can do more with it if you want to want if you really want to and that's the last thing I really want to show you what traditional them so if you're working with them and Java I would really recommend some tools the first two I will really recommend is gene you make I showed you how to use it within them but you can aam with within them to change make PRG and change make but again you can just do and them you can just do make and if it defaults to your make file it will run your make file and then here's the make file I have for some of my class but like some of my classes it's kind of a template I use there are obviously better solutions such as you know specific build tools that were made specifically with use for Java and it works for me but I feel like there's some things I'm doing wrong and I feel like there's some things I can't proof so if anyone wants to actually correct me you can you can comment below I also in the description added a link to where I got the inspiration from but yeah it works the next tool I would really recommend for Java develop and using them is knowing how to use the GED Java debugger that is including the job at the following kit so yep you might have used seen me use the G flag with the java c or java compiler and the reason for that is because it's needed to be bug so if we look at the childhood see come man page you can see that G flag is it's used to generate all sort of information you Spidey debugger so just use it whatever wherever your um the main function for your project is run it and then run the JDP by using jdb and then the name of your main class and then what you do is just create a stop point so you do stop at a chain runner and then : and this just represents that line number so I'm just gonna do it up to line number six so you do it six and then that you have to clear a breakpoint now you do run and then you can do locals to like look at what your variables are you can do like print STRs print and then you can do like list and then print STRs there you go print ser that way and it'll print your variables this way there are so many things you can do like step in like it's just a debugger how do you expect an ID just in the terminal which I really like and I feel like a lot of people they don't don't know about this at least I didn't and it's really useful to learn how to at least debug in the terminal using this if you really want to learn how to use it more in dev I put a description I put a link in the description so if you want to look at that it'll be great the laughs - I would recommend is using C tags I feel like if you really want to like go through your code efficiently you need to use some sort of tool to do that how you see tags personally I use a universal C tags and the cool thing about universal T tags is that you can define some settings I know you can do this in other version C tags so if you look at our my config and then tags we got people and I've set the default speed recursion you know to exclude or get get the rectory and if you ever create if you ever use fee s code whatever fee is called the directory that BS code makes I also excluded node modules because why would I ever use what I I don't know and then finally tag relative these are just some basic headings I like to use and once you do that you can either run on your terminal C tags and then whatever directory you want to generate the tax war I do it in my current a brother to current directory do that and then you can see that if we do an LS we have a new tax file because that's what see tax generates and I we go to we look at her tag funnels just create it just has all the information on where certain certain really important signatures or feels are located and if we go to our our buffer that has to our file or a class we can do and let me um just I feel like yep let me just start up screen tags screen keys again and then once you if you do ctrl left bracket you can see where that is generated of course this is ideally with a set hidden and then you can on just navigate this way so except for example you want to know where I'll note or notice defined you can do control LeFrak and it brings you to location node what about like this data it goes to that data you can also do like uh G left bracket which lets you choose or to go instead of like automatically jumping there for example if I want to go to two and that's where we first use along with gf and ctags is it an optimum way to like just go to recode now that we have looked at ways we can use them without any configuration to you to write java code and we have looked at some tools we can use alongside them to write to a java java I think it's time to actually look at our of MRC or vim our seats where most configurations gonna happen and as you can see by my notes right here I have five lines that I really like to use on my vim RC I'm gonna try explaining them to so let's just go to them again this is a new version of them I haven't really said any configurations except basically that hit it because I mean I'm gonna explain what this does if you don't know what it's about so first if you really want to edit your Vemma receive from anywhere you can just use this environmental variable that Pham gives you can just do my the merci and you're gonna be put into your vimar see it has to be created I think but as long as you have created you can just use that and ill culture of MRC like it's Napa so I'm just gonna um copy these lines but there you go and then I'm gonna I'm probably can out set peace there we go and these are the five lines that I always have to have whenever I like whenever I'm writing basically Java code file type plug-in intent on turns on the indent file in from the vim runtime directory wherever your system vim files are located and it sets your file type on so if you ever want to like recognize like if you ever want them to recognize thick file that it knows automatically set file type on and it allowed you to do that syntax on its for syntax highlighting syntax on turns out the highlight groups for depending on what file type it is and using this we can get syntax highlighting you know you know you can I think some people have no syntax highlighting but personally I use it I find it really useful set hidden so if you're ever writing a a file and it does and you haven't saved the changes and you try to edit another file with like edit chain runner in this case if you do this without having saved your buffer and don't have set head and on you're not going to be able to edit that file because the VM is gonna give you an error you haven't saved so set hitting allows you to earth with multiple unsafe buffers which I think that if you're editing a Java code you're gonna have to look at so many files and set hidden it's probably one of one of your must to do lights options set up on set backspace indent and of line start just fixes a lot of instances cease I found with a pimp's backspace or like how the default it's set on and then the last one is set army function this allows you so if you don't know sometimes when you do control X control you get this error army function is not set up and if you write this code it allows you to auto clike if right before I talked about how you can do control X control n to complete a word or phrase data has been using your fall before control X control all is army function and that search like completion in this case for syntax and I'm gonna show you what this does once I reload the file so now they'll be a reloaded file wait I should show you a example of Nova Marcy because I think that so you know RC and then we want to go chain Runner dot Java if you don't know what this does that the u flag allows you to choose a specific file you want to source at your vet Marcy so again doing this you can see there's no syntax highlighting if we go to like a linked list linked list at Java you can see that um oh my bad oh so I wanna I just want to mention that if you do know or see it's actually gonna set up the defaults for a fee I like so so whatever you do nor see vim is gonna be in compatible mode with VI and if you create your vim are seeing your home directory it's gonna automatically set no compatible mode it's honestly all you need to know is that uh if you set up your MRC it's gonna have some defaults and no RC setups with the compatible mode with the I but anyway my point is that um you're not gonna have any syntax highlighting and you're not really gonna have a lot of options as you can see here but now that we set up our veil our seat with those options if we do the same thing you're gonna get something tax highlighting and it's gonna be nice like and now if we do it like glitter Java you're gonna get more syntax out and you can see here how useful it is and then I think the part a lot of people have this completion or and again I want to introduce Ollie function so if you do control X control oh now you're gonna get some syntax Auto completion again you can do control and control I'm gonna turn it away hold up I'm gonna turn on my screen keys and tell you again control control X control o then you can go control and to search something specifically and again this is just a simple Java syntax like Wow or incidence of but it's really useful those are the most basic things I would suggest per and then I'm gonna suggest more things well these are just personal because again of MRC's there's a person confession and you shouldn't really copy the vehm are see I'm showing but it's good to have examples the next one is set suffix so fix is odd is equal to dot Java because again I'm telling you that if you want them if you wanna use GF like the way I showed you before you need to do suffix add that job the next thing is you might have seen me in this video repeatedly hit JK that's because I had in my confirmation JK said as another way to escape them and honestly I can't live without it but you do you so I just if you don't know how to map a leader you just do nor and map or just a map and then that stands for you know a non recursive mapping and then you just do your whatever you want to rebind it and what you want it to equal to in this case I just wanted to escape uh-huh and also for the purpose of this video I'm gonna just you I'm gonna do a map I'm gonna I'm gonna map my leader keep its equal to and this how you map your leader key if you don't know I expect people know this but just in case you don't know this and then I'm gonna make this binding to leader s and it's gonna be source my fit Marci as your because um just for the purpose of video I want to source continually my own I've MRC without having a lot of problems and it just allows me to do that easily my members and I can't spell million Marcy and then the next thing I would like to add is I think a lot of people have notices but we don't really have a status bar in this more simple way to set this is set last status yeah last that is equal to two so last status or your many or your status bar is automatically set when you have more than one window so if you create a new window right here you can see that our status bar right here it's created uh to have them automatically set your status bar you just do last that's at last Titus you go see your bit mercy and every time you reload or likes our new buffer you're always gonna have a a status border and then next thing is show CMD I think this is not part of M default but um show CMD just basically it should set like whatever you're writing a normal command it should help you see what command you're writing it's just something I find helpful like you see here I see Jian like DP it shows you welcome in your writing and I think that's pretty helpful the next thing I like to do is set relative number it's at RN you and and you and if we source it again we have relative numbers this is just preference again but I really like it I'm not gonna continue that much with this because this is just confirm just preference but I do want to get on where like you can actually use your MRC to help you so when I was starting vim I really really like wanted a way to have this you can workflow where I can have this workflow where I cannot press a button and have my called compile I think a lot of people miss so I found this on like a long time ago I found this stack overflow pulse I kind of described what I wanted to do here's this person use this um a Auto command to make some key binds or set some hits make PRG automatically depending on if the file type he is in or the buffer he's in is a file type Java and when I saw this I was like yeah hell yeah so I copied it and this is a pretty bad idea don't really copy what you see on the internet because if you don't know what it is it might um you know not make sense it's for this example I am Cano copy it but I'm gonna tell you what it does because I want you guys to know what exactly it what exactly is happening and if you just wondering what it space it's just a way to make sure that whatever I'm pacing is gonna be pasted the way I want it I'm gonna explain what this is so first you have a nautical man and the person the reason why it makes it all commands because you can set make RPG to whatever you want and the easiest way to set a RPG just do something like that to whatever you want depending on file type is making an auto command the next thing is he said eight error format oh sorry I'm assuming she said he said an order for my and if you look at um hope error format format Java Java C disk I think he took it automatically he took it sorry let me turn on my TV he took um error format directly off this because you can see it the bottom one so an air format is as I showed you when you have quick fix some like things in your quick fix lists so again if we went through them just set that's probably gonna be the easiest one G and then like here let's just do it buffer and then we do um C open right you can see that our error like our are the items in the quick fix menu lists quickly list are up here like this and I'm pretty sure that some people don't really like this way like some people really want to customize it and if you do you set the option a set to error format or EFM for sure you can customize away these items appear in your a quick fix list and that's basically what you did and this is a recommended um Java Java error format if you really want to read about it I suggest you looking up what I did because it's free it's pretty long and it just kind of like it deals with them like some D symbols are exclusive for them but I'm just gonna like run it so basically whenever you run a sorry for that so whenever you um run something like Java or let me just edit and make a quick air so whenever you do this right you do Chavez see you see that there's a tiny carrot symbol so and let's go back of course so when we great make right and then see open um this just like the air format we introduce air makes it so whenever we see the a carrot sign it's gonna really just get rid of that and just format it in this nice way so without that I'm too used to my plugins I'm sorry so if we do that and without our air format indeed we see open it gives us it gives us like this really expansive quick fix error that I really don't like like it tells us this whole thing which before we if we had our error format it wouldn't and that's just a simple way to format the quick fix um airs well he made um these bindings f9 and f10 and f11 he probably wanted like the creator of the pulse wanted to to make key binds that resume assemble and ID um well first of all the reason one of the reasons why you shouldn't really copy code from the internet or myself is because some people might not know what they're doing and you know so map is fine but if if you really want to make it safe you should um do it the way I did it and you don't specify that this is not like a non recursive um mapping and you should um you should like honestly cater your key binds to yourself like these are pretty specific and if you know how to use the quick fix list you don't really need to know how to I believe you don't really need these key binds but you do you I think these are to be more important three more important bindings however there's one thing I do want to mention and that's the fact that when I started on using them and I saw this configuration like and I saw it this I was like I could really use um like at the time I was working with Python and Java and I wanted to wait like use PI lint to farm at my code which was like using make so I thought it was a good idea to like onyx basically use the same key bindings for a different farm for specific file types and I wanted to change what they meant so for example here I was basically doing Python like if I auto command pipe file type Python set make RPG and then so like something like Python something like that it's something really stupid and I was basically using file types and auto commands in my vim RC to do this so first of all I would really recommend against this be like just having random out of commands anger if MRC if you really want to do that I would recommend a auto group and then whatever you want to call your I'm just gonna call this Java and then going to N and then ending the auto group because whenever you run your vim RC or whenever you source your vim RC I don't and if you have so many auto commands they're just gonna stack up and you're just gonna reuse them reuse them so a good way to um a good way to to make sure your MRC is runs properly is to make put your auto command sonam auto group and do auto command Auto CMD exclamation mark which kind of resets all your auto commands before this and that's just a good way to make sure that your ven Marcie runs properly and fast if you really want to use the auto command fall type but honestly there's a better way to do this this person I think wanted to make a quick solution or maybe he didn't but because he kind of specified you see that I should have MRC but if you are planning to like use make and make PRG and error format I would really recommend you searching for how to use the way that vim is structure to your advantage for example let's look at let's take a look out them is them defaults and the VAM files and it's on our system or our um our formatted so if we if we're arch of your arch linux you can go to user share of them FM 8.2 and as you can see that we have a lot of directories autoload colors compiler ft plugin and spell and if we go to compiler you can see that there's a lot of um a lot of files here that Anand op them these are these are files that them sources well not specifically pilar because you have to set that up but on for example if you're going to syntax these are the file said um when you have file type plug-in and bent on that are vim sources when you run it so if you go to that fin here is where you actually get your syntax and this is really useful to learn to know how to use or to look at because as you can see here we're setting like specific auto commands just for a file but vim has eight option to automatically do that or to ematic lee just some settings for specific file and so in this video I also want to cover a compiler and after Ft plugin so if we go to UM go to our top them or our home directory that femme directory and here you go he don't take a look at but basically you're gonna have um if you create your top film directory in your home directory you're gonna have something like that and mimicking the file structure of this of this um of the standard feminists or how the system is set up we can actually use this to our advantage so the first thing you might want to do is if you're actually planning to use make with Java is create a compiler directory you can just or a compiler and then oopsie-doopsie compiler and then just make a file I'm gonna name this javac G because Java yeah Javed G not them because I used a G flag so much that I'm just gonna name my compiler a compiler file after it so let's take a look at the Java C file which is a standard compiled so it's a standard file and imp 8.2 so um honestly the only thing you really have to set is compiler set I think it's compilers it let me take a look at it it's compiler set it's just this line it's just this line and I realized that I'm not using my sander of mmm I was I was using my theater of incorporation and I'm apologized for that so but only line you really have to say it's a compiler set make RPG Java C and if you if you wanna and I suggested you actually look at what this does because um or the way this file structure because it it just it just hopes to make sure your compiler we're excited this I'm not I think I'm not explaining this properly but so I'm just going to give you a summary again whenever you make a file in the compiler directory in your dot them directory and then you do compiler compiler lower case you can see that vim has some compiler options you can use already and basically your compiles in the compiler directory tell them how you want to set your make RPG and error format in this case if we do my MRC and then yank this and then go back and then you do compiler set error format every time you do compiler Java or Java C Java and G my bad it's gonna vim it's gonna source this file and it's gonna tell them that you want your make RPG to set to Java C what we actually want to set it to Java C dot G not turn file that's how I like it and it's kind of automatically sources file so now that we have looked at ways we can use a compiler directory to say specific make a PR gene error format for our file type and how to handle make I think it's time to actually look out how to put specific file type or for example Java specific Java settings we want from so now that I we have looked at ways we can use a compiler directory to say specific make a PR gene error format for our file type and how to handle make I think it's time to actually look out how to put specific file type or for example Java specific Java settings we want from for our buffers when writing Java code and so continue offering last point a person might think that this might be is more idea to write auto command for Java and set like and set your compiler in this and your of MRC however this is a really bad idea um it's not about idea but there's better ways you can do this so I'm just gonna comment itself because I'm telling you it's not a really good it's not a good idea to do this and I'm gonna show you where you can actually write specific or where you should write specific file type settings home directory and I am kinda make a new directory and I'm gonna call this after your and then once I'm and after I'm gonna make in another directory and after just stands firm when okay so when them is sourcing your your film director your dot film directory it's gonna look at that after after sources everything else once you're in your ft plug-in directory you can simply create a so the way you actually make a file to have the specific file type settings it's just named your file the name of the file type you're gonna use in this case Java and then vendor without them and here we can actually set our compiler settings and every time that we open a buffer that is dot Java or any Java files basically we aren't actually gonna source this um file because that's the way that you know them sources this file because we have a file type plugging in that Don so just doing the compiler java's G will make our compiler whenever we're using Java files we're writing Java files Java was seeing G and then the next thing I like to do is just map just map my leader 8 to control W enter control or just : W enter and then run make make and then TR again and then finally I like doing um see window you might be asking what see window is and basically it's C open so whenever you like run make you can run out C open and C open will display the items in the quick fix list however see open opens either way like no matter if you have no errors or anything else what I'm trying to say it's a sea open it's sometimes gonna give you a blank information and sometimes you don't really need it so what I like to do is see window and see window wholly open slate the change fix window in case there's any errors and since there's no errors it's not gonna be open the next thing I like to do is map leader 9 to actually running my code so if we're if you know how to use an IDE right there's gonna be like a runs function and this is pretty similar there's always see some limitations but it's kind of works for me so I used to filter go man and I'm sorry if I didn't explain this before but the filter is just exclamation mark and you can run an external command on this I use it right first you clear and then semicolon and Linux it's just you like indicate that you're running another command and I like to do here's what I like to do control control our expression register and then yeah expand and in the current file this is important in file and then we're just gonna get up to the root it's the same thing I showed you guys before and I'm gonna pipe it well you have to actually escape the pipe because yeah you have to escape the pipe just want to make sure it works and we're gonna pipe this into X are X and X are basically a program that um that's useful for piping to actually redirect your arguments into your command and we're gonna redirect it to Java it's gonna be oh I'm hunter except I forgot probably to write easy answer here there we go so what this is gonna do is gonna take the the name our file and it's gonna run it in the job it's gonna run it in the JVM and the reason I like to again take the dodge stop the dot Java and it's just to make it meter and now we're almost done I just forgot you one thing here you have to actually I call it also another thing to do smart is we all you want to apply this to like the curve over in case we have like we're working multiple file types and we don't want to use this in other other with other file types that's it if we're working with the Python and Java sometimes you don't want to like you definitely don't want to type the name of the file into it into Java did Joplin she gave him so let's took let's take a look at or set up with the files we made so we do film that child chain runner and we do comma eight it's gonna run our code see window a socket open because we don't have any errors of course if we took off the semicolon and we save it and then we do call an eight see windows can open because there's an error stupid error but there's an error and then running again right we have comp our program in the back and then we knew comma nine it's gonna run a program easy as that and that's the way I have basically my embassy of MRC set up there's more things that I like to set up and I'm gonna show you quickly because I do want to get into new of M next so let's take a look at what other of MRC plug things I have in my boudoir see the first thing I like to talk about is split below and flit right so whenever you make it like a nice split it goes to the left or usually goes to left when it over your arm whenever you make a new split and if you do ass beat it's gonna open to up but what using these two commands I can I don't know why the lien the buffer but using these few commands I can make sure the splits go the way I like it the next thing is set Lacey treat redraw and this just allows them to not redraw the screen so whenever you're like go down the screen or whenever you're going up the screen of them is redrawing that but if you don't really wanna like if you want to save more space when you're doing macros I really recommend this so if M just automatically turns redrawing the screen off temporarily and it makes your macros faster undo an undo d/dr I'm gonna talk about later the next thing I want to talk about its leader C or this command I I map too so whenever you're working with a compiler or java decompiler we made I you really need to make sure that you are in the main you're in the directory that your or your main file is main Java file is if you don't if you're not in the same directory the compiler might like a queerly or my NOC compiler code and to do that I just have the simple keep mine that could turn sick Vince current directory to the the rest of you of the file we're working with here is just something else I just like doing control a lot like making new lines while even while in insert mode or a normal mode these four commands right here for more commands let me turn off my string cheese off allow me to like work with um buffers and resize them whenever I need them and then right here right here this just allows me to quickly go through go to whatever split I want using like them like keys instead of like doing ctrl W ctrl H finally I told you guys should not really do this and I I think I explained why you shouldn't do this I hope you um listen I'm gonna paste this MRC in the description as well if you want to follow along and finally I want to talk about grep PRG I'm gonna talk about this really quickly cuz I did talk about them crap so vim crap uses Finn's internal grep it's a different kind of graph compared to gene you crap and the good thing about FEM crap is that it uses them regular expressions the way you way you use them in other parts of them so if you if you really get at them crap like vents regular expression you might want to consider using a bankrupt however there's a downside it's kind of slow so if you want to use like an external tool I use a rip grep you can download it like just search up grip wrap github and you can probably find it there if you're an arch you can just like literally do arch or pack my pseudo pac-man pseudo pack I can't spell I'm sorry that is a rip crap and that should install your rip crap for you I already have installed but yeah a set grep PRG is just gonna set the tool grep use this whenever use grep and the vim grep flag just allows allows me make sure that whatever you're searching with rip crap that it's it can be interpreted by a vinaigrette or them itself grep format it's just a way to format the output I think you can take the hint from error format in compiler and again I use rip grab because it's faster so you just instead of like doing vim crap like the search you want to do like add or something and then you just do like them or crap and then whatever term you want to do I think it's a more similar because I it's more simpler because I use some replica rim rip grep a lot and that's it that's basically settings I haven't my vehm are seen whenever I'm working a job again you shouldn't really copy but take you can take suggestions off this and now let's move on to me of M so when I started using them I was really just into using them at all without really using any plugins and that was the case until I really found out about neo femme it wasn't that van was any bad or it was worse in the U of M but neo van specifically had one thing that I liked you see whenever I go to my home directory I and I do la you would see that there's multiple hidden files or hidden directories and I really dislike that because I really like my home directory to be um empty or clear one of the things that kneel them does that I really liked was that um it uses xyg config which is just a configuration that hosts developers to put your configuration files in this specific directory I have it set to a default so as you can see here and each of my not files and this is how I really started using me of em and from Neil them I started using plugins again plugins are just basically scripts written in a VIN script or Python or something another language that are used to enhance event functionality there are some plugins that really just make things way simpler and here's what I'm gonna talk about so if you don't know how I'm still knew of them that's how you do it in Arch Linux but I really recommend install so stalling no GS because what some of the plugins I am going to talk about required no js' and here's my um and also I think it's important to note that neova muses an it not them instead of your MRC and it's located wherever your um doc config neova m location is and that depends on your um that depends on your warrior xdg configured a config home is located and it's basically what I have so far it's nothing it's not really any it's just basically the same thing but for an it not them if you're wondering when I don't have like file type plugging in dent on the reason for this is that I don't need it because um because basically new of them has some defaults on and by default file type plug-in the dentist on it and also it's never on compatible moto VI there's also some things you might want to read here and it's worth reading as I said when I got into new of them I actually started looking at plugins plugins that would help me edit Java code faster and that in ways and I could never have done using vim script and them alone so to install plugins I use a plug-in manager called them um a plugin manager called vim plug it's probably the most famous for plugin manager out there and what vim plug allows me to do is it allows me to keep all my plugins in one place and manage them in my bin Marcy it allows me to update them quickly and also it allows me to lazy load a plugins based on file type and that's basically all requirements I need if you're not comfortable using like a plug-in manager if you're in a point 0 and above I think there's something there's an included plug-in manager with them that works as well you just have to look at the directories and as if you can get it working it works so if you're Neil them or oh by the way all the plugins I'm gonna suggest are all they all work in the ovum /femme for this reason I'm just gonna refer Neil them to a vim because honestly at this point they're not varied that they're not that different so if you're a new event or depending on what version of em you are November 4 new oven or yeah them or new of him you can um you're gonna download you're gonna type this into your command line and so you can download vim plug once you do that the most important thing to start then plug it's this call method you're calling the the begin method in the plug file a follow script and then all you have to do is all you have to do is end it and all your plugins going between these two lines by the way this some this quotation marks or this their this file path is where your plugins are gonna be installed and once you have properly installed everything and you and we wrote these lines you can start installing plugins so the first thing I'm the first plug-in I'm gonna recommend is concur completion it allows me to synchronize with alien language server and it's a language server it's really useful it's honestly one of the best things that had happened that allows us fin users to still use them and still get the benefit tonight II it's one of the reasons why I think that it's viable to work with them and not have to use an ID if you're not familiar with this let's look at a visual studio called facial studio code uses a lane also uses the language support protocol in fact Microsoft was the one who came up with the idea so if we go to Java expands your pack and then you go to language support or Java I don't you see how slow it is I don't like it so it provides Java language support via the ellipse Eclipse Eclipse language server and if we look at this this is a language server that it provides completion code completion some snippets I believe and some code formatting and this is and we're gonna use this same server that vs code uses in them in the way we're gonna use it they were do this is by using conquer completion so what you want to do is just it's used this line right here and once you have this line you can start installing and plug-in so what you want to do it's wood once you fully install then plug there's going to be some commands you can use in the command line mode so in VIMS command line mode so here you want to run fin inst a plug-in stall if we sources which I don't think we have their real plug install so I already install this but if you did it the first time it's gonna take maybe like it's two like three seconds and with this oh like this is the first part for a conquered completion the second part of conquer completion is you want to have some you want to look at this example code of a Marcy they cave and see what they have this is example of a Marcy's just to make everything work with um conquer completion you can remap a lot of things yourself and I I've um I'm gonna tell you pretty much what's kind of happening here so I am you can I like to keep stuff separately because I pretty much copy and paste this so I source it using run time and we look at all this this is basically this whole text and I'm gonna try and go through it so people can know what's happening so I think the most important part is basically this it allows allow some conquer completion to remap top do trigger completion and success here the other thing that's important is that it it creates a you can rename variables quick control key well I don't think it's ctrl K out automatically but I I renamed it with yeah it was leader RN but I changed it to control time control K you can also format your code using the language server if your language server supports it view copies um configuration file and then it half plug-in and then you put this line you can start using conquer completion without any language support so every example I can do set and you're gonna see that you get some some you get some completion for the file it's kind of like of em's insert yeah insert completion but he's tabbing so instead of control and control P you can also change the tap to whatever you want but that's enough of just see icon honker completion you actually want to use a language server and again we are gonna use so we want to work with Java right so there's eight an extension so unfortunately you actually have to install extensions to use comprar no completion and the intention we're gonna use is COC Java conquer completion Java and you install it by using conga COC or no COC install COC Java and once you've done that you can ask if you start editing a Java if you start editing a jawbone file you're gonna get some completion and the way it does this is by use again using the same language server SV is called Java let's take an example let's go to our chain Runner class and as you can see here at the bottom it says language server is starting at our current directory and this is my conquered completion so now if we do system it's gonna try to complete that hitting tab or shift tab you can you can go through the entries this is exactly how it works in a vs code in addition to that yeah you can um there's some if you do CSE command you can look at commands that the language server COC Java comes with you have um like some mavin mavin um build you can actually make it with like you can use COC Java to make it more things you can do that's just completion using you know the land was sure where I talked about but if you want to use snippets like if you're not if you're not familiar with snippets do it's basically um you write like some text and then you write like you press a keyboard shortcut and expands this the text into like this cold walk and it's really useful to show you what you show you what it is we have to install another extension for for a COC for a conqueror completion this is called COC Snippets this you also have to install another plugin on top of that if we go back to your net not fin and we go to we load the snippets so COC snippets load snippets from from a database sometimes the language sure burr you're using has these snippets but if it doesn't you could there's a great like database you can use called of em snippets and where can I install it so all you have to do like if you're not sure like the readme for a agent and plugin doesn't say how to install it would vim plate went plug all you have to do is copy the URL from the user and then the name of the repo and all you have to do is do plug then you can do home sir and um them snippets with uh us after every time you want to install your plugin you have to do plug install so way I'm gonna sources you update it and then there we go again I've already installed these plugins so it might take a bit for you but it should be fine now if we go back to chain runner and we type it correctly and now we do print Ln you can see that there's an S from snippet it doesn't come that way but I'm gonna show you how to get that like the s so now that we I've set it up so if I have to control J expands snippet this is really useful because if we do them let's see random dot Java I can do COC and in control J and expands to the name of the class in a constructor and let me do that again because I want to show you something so if I press ctrl J again it goes to encase there's like no arguments or fields that I want to put it to the constructor I can just go to constructor body and I can go out of the constructor and keep on typing snippets are just really useful for this and again println boom expands to system dot out dot println and again here's another benefit of language server a language server allows you to analyze your code so in case there's an error or there's something wrong about it the language server is gonna tell you or using language over by conquer completion it's gonna tell you if there's an error and it's gonna like highlight it red you don't need me of them for this but it's it's um thanks to Neil Neos films developers that are focused on making asynchronous I'm making me of Emily synchronous it's kind of a bit better than using just them the next thing you can do or the next thing I recommend to do is sometimes um if we go back to hunger completion there's some supported like you and when you're using an IDE or a texture like vs code with Java expansion pack you might like see some suggestions that you might want to apply like sometimes it says do you mean this or do you want to put the getters and setters or the two string method for each class and you want to do that right in an easy way to UM to do that it's a vehicle if we call to our in it not fam and then do you don't actually go cheering you don't have to go cheering it that vamp but I I just like doing it let me go to install there's another extension that helps you that I really really would recommend it's called COC Douglas and then once you do I think once you do COC Liss you can see that there it just gives you a bunch of things that deal with conquer completion and then have you go actions you can see that there's a come there convert to snippet but sometimes if we go to like our linked lists not Java class we made and we go we do see you'll see list and then actions in it might give you some actions you can do with our code here for example if change modifiers to final one possible sometimes you like these are the suggestions that IDE or texted or like vs code gives you and all you have to do is install coz list actions and then generate to string or generate getters and headers I don't know why you would do that for a link less on asleep but yeah and here you see here it generates a it generates comments and the getters and headers one more thing about um but there's an easy way to bridge one more there's one extension I would recommend when doing it and it's called COC I think COC install actions and once you do that you can do control or I have mapped this to control a and it just directs me directly brings me to you the actions using a plugin and let's take a look at that here I have this um it's right here right here control 8 so it just called CLC actions using CLC lists so I don't actually think you need to you'll see actions but I recommend stoney just in case and this is a way you can make custom key vines for short keyboard shortcuts for Concord completion so the next thing I want to talk about is how to configure our Congress like how do you configure Concord completions because like I said before we do private I get this like fancy-ass that tells me that snip that represents us to snippet or like a in the way you do this and other configurations is you want to go to your dock on fake that's new of em or whatever or configuration for them is and whenever you use Conqueror completion you're gonna use there's gonna be a file that you can edit calls Concord completion settings and these are the labels these are labels for that for what I have so when it's a string I mean when it's a snippet rate it gives us the s and these are just ways I'd like it this is just extra and I just want to mention in case I won't wanted to know the important part is probably that using concur completion settings you can um there's some supported settings that the language server might have for example um sometimes we're not you're not in a project you might get an error called incomplete cos path and here using conquer of completion settings so you can just ignore it it choose to ignore it there's other settings like whenever you generate code it generates comment and I like true and if you want to see more settings here's your language server and you can see to support settings and you just put the settings here I'm sorry um I don't want I don't want to overwhelm you guys but that's pretty much conquered completion using snippets language server and more the next plug-in it's gonna deal with aha debugging and it's called Fink Specter you should really I would really recommend reading the readme for this because I've recently just thought it working and I've been testing it out and it works for me but I don't know everything about it like I can't explain everything in depth about it so I would really recommend reading to read me but I'm gonna show you how I use it so again so you want to read the readme and you want to follow an installation guide install some gadgets I know I'm mentioning a lot but I just recommend reading the readme so you understand what I'm saying because I'm still not fully a hundred percent sure how it works but I know it works so if you installed it using vim plug it works and then but this is not the only thing I'm gonna use it with so I long this I use another concur completion extension so once you um again hit the plug install and install the link Specter and I'm sorry if I mention this but then Specter is used for debugging using like um using I think PS code like keybinds and you can see this keep I um screenshot you can debug using using it so here along with this a plug-in I use another file conquer completion intention this is called conquer completion Java debug and once you install it uh it does wonders you might want to read the readme and I'm gonna pull it up just in case Java debug and again you really want to read the readme because I recently just got it working so once it's supposed to work with of inspector and it uses um like remote for most sessions from my Java it's pretty much like the Java debugger but it way better because you don't really have to like do a lot and in case I just want to mention s but in case you wanna how you have like a lot of extensions you want to download and you want to let other people you want to download you can do this format at then and this is the format to let conquer completion which know which extensions you always want to download so in case you want to move your like in it not fit to somewhere else and you want to copy it to another machine you can just use this it's like cold block here or array to let a congregation know which extensions it's a download every time I'm gonna put at the top once you have installed those plugins and extensions to make it everything work I'm gonna just show you life you want to create eight dot inspector JSON so it's just right there and then inside that vent not being Specter dot JSON you want to copy those lines it's basically just telling like these tools what port we're gonna attach the the debugger to and now that we have done that let's just go to a let's go to our chain Runner and I want to show you guys what you can do so here right so first thing again you still want to do the dash G flag because it's pretty important because you want half the full you want a compiler code and you want to have a debugger running so you want to do if he knew and in term any Creek this creates a terminal meal them and then you know Java G chain Runner and then you're good and that's the first thing you have to do and also um when you're using um neo vamps terminal you want it you you can exit by control backslash control in and that's how you exit once you have compiler code you can actually start using the tools properly so the first thing you want to look at it is that the inspector has these mappings that are really useful that you can use to create breakpoints and continue and start and you know what you would typically expect from a debugger like I showed you before so I have um I have um put these specific file changes I have in my Java dot them in my FT plug-in directory like I showed you before and using these bindings I am gonna make breakpoints so the first rate point I have for some reason I make the break point to leader oh oh I thought was like or something so i i've binded them to Lear oh oh and once you do that you can see like this red arrow and he saw this is how you make breakpoints in um of inspector once you um did once you have done that you could go back to your um your terminal and you like following this read on me you want to actually run this come in what it does it just pretty sickly start the JVM at this specific port the specific poor it correlates to the port we assigned it to and inspector JSON so Aria this is again just falling to read me except you want to replace your class name with the class you want out a debug so you run this and it's just starts say listening for port basically it's gonna listen for a debugger at this sport and this is where we're gonna start I've inspected and to start being Specter if you read the readme you can start it with um Java like COC command Java thing Specter start and now we aren't at one breakpoint and if we do COC and we can finally use the inspector and COC like you would use for a debugger an example of this is like using um I think it's thanks Specter its evaluate and then we have STRs it's gonna evaluate here it's going to print out the result except that right now we've initialized it and it's at this breakpoint I'm so sorry for a noise but if we want to continue we want to use a Lear's pulse l6 or that's what I'm apt to do you can map it to whatever you want I'm gonna just set the mouse equals Jace okay so that's prenatally so um again you want to do liter old six and it's gonna go no go into the next breakpoint and you can wash and do some things you expect from a debugger and again if we'd like to do the same thing it's gonna evaluate differently because we're at this breakpoint now and that's how you can debug you can step into like you can do stuff well yeah stepped into its leader all six leader all seven except not to make it and then we got worse or you can see that it's starting to go to the println and with this with this setup you can have a lot of things happening and it just creates it's important to know that it creates five windows here but it's separate from your original workflow workspace so you can go back to your original workspace which is a different tab by GT and you have your original risks and then you can just go on continued debugging and well we have to get off at first because there we go and then here we can see that the debug debugging ended once we actually ran through our whole program and that's how we'd bug using CLC Java debug and Bing Specter it kind of works and it well it does work for me currently but I'm sure that some people are gonna be mad about it because it's kind of complicated to set up and I had some trouble setting this up until I realize how it worked and the thing is if you're running vim it creates like a bar you can press which is really nice but any of em unfortunately you don't have that should you ask you do have to create the plugins the key binds I showed you and that's I think it all right this is part 4 I guess so I'm gonna talk about workflows or like my specific workflow and some other plugins I like to use so I'm gonna delete this because I have another thing I want to show you guys so here's some plugins I would recommend you know I I added here the three plugins I thought were important and here are and I want to talk about these plugins I recommend the first plug-in I would really recommend is undo tree alongside with a set on do file if you're a member you have to also set your undo drdr undo directory and but if you are new of them the the the if you are new of them then the undo dir is located I think in like local share something somewhere around there but if you don't know what a new file does or the option does it basically allows you to undo even when you close a file so if you're like me um you sometimes just great open a file right and then since because like you open a file and I'm your type thing you're typing and then for some reason you'd like to quit or you save and quit but that doesn't really save any history right so like when you do you write when you do you it you can undo a specific change if you set undo file even when you close the file like well even when you close a buffer you're still gonna get some um you're still going to be able to undo before you close it and that's where undo undo undo tree comes in a new tree a new tree allows you to visualize your undo s-- and I just like it because um I just like it because it laughs like say I have specific change I want to go back like a thousand undos I can see exactly I'm just going to show you I can see exactly what has what has changed so I I have this I have this keep mine and then when I do control you control you except I have to source it so let me just read log when I do control you and then plug install because apparently I forgot to do that I think control you you can see these changes here at all you can it tells you like Drake here it tells you like you know what you change and it highlights it I'm just really useful went um with undo file and that was undo file undo tree so again control you I just have that plug-in in and I can see the changes to whatever I want to like see it's pretty util I think Giselle and then the next one is gutten vim ku in tags so then guten tag allows you to generate generate tag files so right now as I said before I have control arch like just adamak like manually do you know manually generate my tanks but I don't think that's pretty sometimes you just want to generate tag space on uh like a file pattern in this case like you found pattern I have set it you get doc package saachi's under like it has a tags in the file direction in the relative file reduction and it's again really useful because you just have um your tags are just being regenerated as you write you don't have to really worry about it and it's just set up which for me the next thing I like to do is thin commentary so I'm just gonna sources and what them commentary does it's made my temple first of all so you know it's good so the first thing thin commentary does it gives you the divine or the key binding GCC and when you press GCC GZ and um paragraph you cannot you cannot comment thinks I'll come in and comment out things and it's really useful like any language honestly the next thing is of them repeat so sometimes you have plugins and you really want to repeat the same action and if you have if them repeats works works for the works with it you can repeat the same action for example I I cannot comment and comment on things really fast and these few things just work really well the next thing I like to do is um them surround because it allows me to change like this around like surrounding text object so like if I do change as single single single quotes to double quotes it changes the quotes a single close to double quotes really useful now these are all made by Tim Pope and if you want to see them I really recommend them and then the next one I recommend or you might want to use them I don't really recommend it because these are not that necessary is so it before I do that all right source it I want to show you what it looks like without the before and after so the first plugin it's a syntax highlight group plug-in and it just gives you better syntax Kournikova it's not better syntax just gives you more colors so if we look at our linked list class right we've been working like there's colors right there's definitely colors and there is for example if you have a number a highlights number that's specific color but some people like really color like pretty colors and with this plugin you had you get more colors and with a good color scheme these colors might look good and it just like highlights based on the property like if it's a lorry keys it just gives you like leave this like darker green compared to like if it's uppercase and some people might like it some people might my not so it I just kind of recommend it and that's when it's targets so if we source this right so we do this and then we source it you might have noticed that sometimes you can do like control I control in single quotes and it changes everything in the single quotes and you would you would think that you can do like change in curly braces and you can't elysian normal van you can and I just want to prove this so in like I'm just gonna reload this so in normal of them you can't do change in curly braces it won't work but um them like this plugin just adds more targets that I really like that allow me to like do that like I can do if I saw this I can do change in braces or curly braces and as you can see this would be really useful for Java because like you can be like change in curly braces I mean of course you can do like change in body but sometimes you just want a snap and you know you're like you know you're looking for curly braces and sometimes you just wanna know that's possible it adds more targets like um like parentheses it's pretty nice plugin and the last one is Auto pairs well it's very um like II left parentheses it's gonna type in the right parentheses and I like it because it's just something that makes my life easier if you didn't have this plug-in you would probably do something like Maps curly braces it's your CR and then like have CR like control and then do this and then left probably something like that which will let you do the same thing as this but I think that sometimes just having an easy option is fine and those are all the plugins I really recommend the last thing I want to talk off from part four is how to use sessions so say you want to have like say you want to keep the same layout and you want to reload it that's what sessions are for so say I have like multiple windows like I'm editing a chain runner and not that one again Sam editing this file in a vertical split and then saying I have a terminal open in a in a horizontal split and let's say I have a new tab with some random gibberish rate what if I want to like save to slay out and so I can save it to next time and so uh next time I just like loaded and then have them keep the sale I think it's pretty useful because when you're working with like Java you might want to have the same Forks place every time and you can do that what I'm Kay sessions you just do like a name of the file and you name it with thought them and then and now we can quit and if we go back you're not gonna have this I think you just opened them you're not gonna have the same layout but if you do of m dot s op capital S and then hello about them it's there everything's there and this is really useful because just have a same layout just get it back into work that's it okay my afterthoughts after using them with java for about six months so I've been using them for about a year now and I've been learning how to use Java for about six months now and honestly it's one of the worst languages to work with them you just have to have so many components just to be able to get an efficiency I would say that I could have before like for example when I'm working with Python I can just write code because I know I know like pythons just such an easy language to work with and I can easily write code and I don't have to like look at so many files I can just look at documentation and if I just want to change one thing I just really have to change it one place but with Java that really isn't the case I spent so many hours just researching how to do some things like this and as you can see my video wait I certainly did it I certainly have a workflow and I was able to do so many so much with both these tools like all these tools I was able to like have them work together and at the end of the day I'm just like a happy person but I did waste so many hours and honestly I'm not gonna lie to you when I started learning like Java I heard so many people just use an IDE and or just use like yeah just use an IDE and I did try to use an IDE and but one of the things that just kind of like became apparent to me is that I des have so many things that that's a beginner you don't really understand like it has to be bugger but you don't really know how to use the P bugger it has these build tools but yeah I I don't even know what built-ins were six months ago and now I'm like but like using by using them I was able to discover what all these tools were and my own pace something like Visual Studio called with the Java expansion packs just like so many tools that I don't know how how I would use all of them like a debugger yes that's great but I didn't want to use to be put honestly I had to teach myself how to use it and and for IntelliJ alright you just had so many options yet to like set the class path and unfortunately my teacher didn't really teach me everything I needed to know for proper Java development he just taught me how to do like you know basic Java code like writing Java code or just writing computer science called just writing programming clothes sorry but I was able to learn this by myself using the terminal and using them I was able to understand how most things in Java kind of worked at least the superficial stuff you know I'm not that I'm deaf to Java yet but yeah I was able to understand in my own pace but honestly again these are old things just working together and I have so many bugs or sometimes I just have to use so much research just get something else working so yes I made it work but at what cost I think what I'm gonna do after this video though I'm planning to do two things I plan to learn how to use in until IDE I turn I to trial IntelliJ and see what the hype is about that because no they know how to write Java code I think I can use it and like ease it to its advantage and then I'm gonna and then the second thing is you have seen me explain so many things but the one thing I've missing about them is how to use film script so this summer I'm gonna spend time learning how to use film script and also learning Lua for me love him because I heard that's the new the new fashion and those are my goals did I enjoy using them for Java not really but did I enjoy using them definitely honestly I'm still gonna use them like either way like if we just take a look at this this is um this is how much I can't quit have from them I named this file : : W uh it's kind of silly like I'm so famous just embed into me and I can't quit thank you for watching this video
Info
Channel: SeniorMars
Views: 23,674
Rating: 4.8419752 out of 5
Keywords: vim, java, neovim, linux, ctags, jdb, make, lsp, coc, vimrc, ide
Id: ssmFzoZS2G8
Channel Id: undefined
Length: 118min 40sec (7120 seconds)
Published: Wed Jun 03 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.