Neovim - Exploring files with coc-explorer

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up guys in this video we're gonna be adding a file explorer to neo them if you know about file explorers neo them then you know that there's like one main one that pretty much everybody uses and that's nerd tree we're not going to be using their tree because I think there's a better option out there we're also not going to go the super minimalist approach and use net RW because that thing that thing sucks so what we're gonna do is we're gonna use a Explorer that's built into COC since we're already using COC so as always you can find all the commands that I'm going to run in this video over on my blog so let's get started so installing COC explorer is going to be a little bit different than the way we've installed plugins before because this isn't really a plug-in this is an extension to COC so what we'll do is open up just open up them and we will run COC and you got to make sure you have COC installed first and I have a video on that if you look at my intellisense video for vs code then what you'll do is you'll run COC install and then COC X or I guess build that right alright I'm gonna give that a minute all right so once you see this you're good to go now what we'll do so we'll get out of there and we'll open up the the COC Settings JSON so COC settings dot JSON and this is where if you remember from the last one we keep our COC preferences like format and save and all that kind of stuff what I actually learned recently was that you can come in here and it'll want to complete things for you so it already knows all of its settings built in once you install the COC JSON extension this COC settings JSON knows about all the things that it can do so you can start to see if we start typing Explorer now okay well we have all the options that we can change for our Explorer and there are a lot of them so if you want to see some of those options and I bet this is small so I mean zoom in a lot I don't know why it changes anyway so all of these options are on the COC Explorer page and so there's a bunch of them right you probably don't want to change a lot of them I've only changed like a couple so let me go back I'll probably leave a link to this page in the description but the way that you get to this thing is or you get to the COC explorer pages you can just look it up and find it on github but it's also one of the extensions in COC so if you remember from the last video you can just go through all the extensions and you could find this so let's get back to this so I'm just gonna copy and paste this in but you can explore different things that you can add oops I forgot I put it in my buffer let's go here all right we'll just didn't done this it's like that actually I think what was wrong was it should be like this there we go I will save that and so what did I add so default the explorer width when you open it opens at 40 I changed it to 30 to make it a little bit smaller I'm also enabling nerd font if you have nerd font installed then I'm pretty sure all this will just work for you out of the box and essentially that's just going to give us nice icons on the side and preview action on hover you know what I'll do is I'll set this to true first you can see what it gives you so maybe you want that right honestly I think it just kind of gets in my way and then I'd like to be able to toggle it with like a key but I don't think thinking of that option yet and then just a couple sane defaults that I just think make using the tool it'll be easier so vie for be split and enter the CR stands for enter will just open it like normal instead of seeding into into it alright the next thing that we'll do is we'll open up our plug config for COC we're just going to add any COC extension that we add we're just gonna add it to this file alright so if we ever want to get rid of COC we can just like nuke this file and call it a day although I don't foresee myself getting rid of this anytime soon so actually instead of typing that out we'll just copy and paste this into there and then I'll explain what these commands do the first two are very simple to understand so now this first one when you press space and then e what it'll do is open the Explorer when you press space F it'll open the Explorer and floating mode and I'll show you what that looks like and then this last command is just so okay when you close all of your buffers and all of your windows and all that good stuff and when COC explorers the last thing that's left closed it automatically so that's what that does all right so let's save that and now everything should just work so let's have been up on the note and it dove in now we can type specie and here we go so you can see this thing here this little like preview this is why I set the true a second ago and by default it's true and it gives you some interesting things like time access and modifying subject I just find that it gets in my way though so it's just I don't know I'd like to see it but I'd like to just press a button to see it or something like that every now and then so I end up disabling that so I'm gonna go in here really fast and the preview action on hover we're gonna just set it to false all right now so next time when we come in here that'll be false now also you'll notice these guys over here this MMD whatever what this is is it's get integration so M stands for modified d stands for deleted so I deleted something out of here since my last push a will be for added a question mark I think will be a pro unstaged you can find all of that in the in the docs so if you go down here and you look for like get icon and you can set your own get icons right like get icon added is a capital a deleted is that capital D renamed you'll see an R so if like I rename a file copy done merge so on so forth right untracked was the question mark so so those will all be there and I like that it just has automatic data Gration and I just think it looks decent it makes sense it's pneumonic so that's cool also the icon is that nerd font is what got us the cool icons so that's something I like trying to think what else oh yeah what's cool about this too is the buffers here at the top so like you can see your buffers you can open them up so we can already move between wall I'll get to that in a second but we can already move in between our buffers like when we're in here we can just press tab and move between our buffers right but an easy way to delete like a buffer that's open and you see it anymore is you just press deal on it and then it got rid of it now it takes a second to refresh but yes it's going I think it also that for definitely stands for something I think it maybe is the amount of lines that I added or something I don't really know what that for stands for now something else that this thing does cuz this thing does a lot of things is you can press tab and get all of the options to do things like you can add a directory at a file CD into one of the directories to make it the route collapse one do all these things right so just press tab and it'll open up a fuzzy finder for things that you want to do so I can start typing like add file alright and then it'll ask me for a file name and then I can just enter the file name and you know put a file and if I wanted to what else yes so here's another one because this thing really does a lot of things so we'll go into acting stuff and why not right and let's add some nonsense in here and save all right now it's letting me know that there's an error in here and so that's pretty useful in my opinion because now you can just like kind of see throughout all your things like okay there's there's an error in there right we can close the directory and still see that there's an error in the directory so you can see all through your code like if something is not working or whatever it's debugging it for you which is nice right and I'm getting this because I have mlsp installed so if you remember from the intellisense video alright so we got rid of that trying to think what else oh yeah the floating thing so we'll press we'll press space e to get rid of it and then we'll press space F wait I may have mapped them by accident to the same thing let's jump to the bottom here or let's go to general settings I mean I was in a COC settings it should actually be opening and preset floating not found okay so I think that's what that other thing was then so then the other option is to if you want to add floating mode is you can come up here and it looks like they give you this this thing here right so if we take this and we add it under the Explorer section all right I will just save and quit and we reopen this now if I press shift F I get a floating window and that's pretty interesting too so I'll also update the blog so that you can copy and paste this into your COC settings I think this is cool but I don't think I'll use it so maybe actually won't put that in the blog if you want it you can go grab it I just I have better things that I'd rather float in the middle of my screen and yeah so also I find it every now and then when I was using it before was a little bit buggy but actually it seems you forget now so I don't know it's kind of cool right but it's like if I open this up I guess it'll just close itself immediately that's pretty neat I guess it's it's cool but I don't know you can I guess you can let me know what you think about this loading window other than that I think that's mainly it for this video that kind of shows off all the things you can do or at least a lot of the basics at least probably most of what you want to do with a file explorer a simple file explorer so you can also follow my development on this thing over here on my github it'll be under nvm I'm open to pull requests if anyone wants to make one let's see and yeah so you can kind of follow it in real time as I'm working on this thing and I think we're getting pretty close to like a V s code like text editor so there's probably like four or five more plugins that I want to install before I really feel at home in this thing so as always you should like and subscribe and I'll see you in the next video
Info
Channel: ChrisAtMachine
Views: 33,255
Rating: 4.9575033 out of 5
Keywords: coc, neovim, vim, ide, explorer, files, vim file, nerdtree, defx, netrw, neoovim files, vim files, vim explorer
Id: vrEJ6NopAGo
Channel Id: undefined
Length: 12min 13sec (733 seconds)
Published: Sun Apr 26 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.