 Okay, so what is now months and months ago? I did a video on this thing here ranger the file manager And it was pretty well received But I've it's gone to the point where my channel has gotten so big that no one sees those old videos And I guess it's worthwhile to do a video on this again Not just because you know a lot of people haven't seen it and I get questions about this thing all the time But also because I've added a bunch of stuff to my configs and stuff like that So it's worth sort of going over But anyway, so this is rangel ranger. It is a terminal file browser. It is very convenient very customizable Just generally nice. I use it all the time Especially when I'm moving files I don't actually even rely on the command line a lot for doing file manipulation because in a lot of ways It's easier to optimize in ranger than anything else. So anyway, let's let's get into it Let me make it a little bigger here And so it's vim-based by default. So J goes down K goes up H goes into the previous directory or you know up a directory level and L goes in etc, etc So generally it it's supposed to be vim-based. So GG goes to the top capital G goes to the bottom, etc Pretty much how you'd expect or whatever So let me actually go into let me go into this directory here so we can play around with it Renaming files is CW change word, you know just sort of like in VIM So I can go to one of these files. Let's say I want to change this one, you know this one or something like that I'll change it to ice JPG and now it's been renamed. There are also other ways to rename files So sort of like in VIM, you know how VIM has like capital a to go to an end it go to the end of a line You can actually press capital a to rename a file And it'll allow you to go to the end of the filename and add something if you want or if you do capital I just like in VIM it goes to the beginning of that line and lets you add stuff or something like that Now I also have a binding AA which goes right before I think there's a binding for this in default Inranger, but I'm remapping to AA because there's some conflict that I wanted to map But it allows you to add stuff right before the extension, right? So those are all very convenient for basic, you know file manipulation and stuff like that So in addition, there are it's very easy to add console commands even ones you use all the time So I add MKD for make a directory. So we'll call this new Deer or something like that And I also have bindings like capital V which allows me to just create You know, it runs a VIM command. So if I want to run something like a new I can go ahead and make a file in VIM save that and that's that Now I have remapped some of these but anyway, I'll get into that in a bit So basically it's easy to make directories make folders stuff like that other things I have Let's say I can I have an external script that extracts or compresses files So I have this map to ranger. So if I want to let's say take I Should say To highlight things in ranger You just press space and you can run certain commands on all those things space to highlight or unhighlight So let's take these last two files and I have mapped capital Z to zip these up in a tar GZ file So that's what this thing is here very convenient Or I can extract that with X again This is just something I've mapped and I have an extract script that automatically detects what file extension It is and zips it out wherever Now you can delete stuff in ranger with D capital D I actually think that's too many key presses for something so basic is deleted So I just have it mapped to capital D and press enter to actually run it And if it's a directory or multiple files It is going to prompt you with a yes or no if you actually want to delete it just to be extra careful So that's extracting moving things around. Well, I should say how do you actually move things from one directory to another? Now you can highlight things as I said with space. I'm gonna get rid of this thing though Let's say I want to copy these two files into this directory You can highlight things and to yank them just like in Vim Y Y So I can go to this directory and just like in Vim you paste them in with P. Well, it's actually two P's But you know that will map them in here now. I should say if I If these things are if I still have these copied and I press P P again to Paste them in you'll notice that it automatically detects that there's a replicant file here and you know renames it You know when you paste it in you can overwrite things. So if double P is paste something in you can You can press P and then oh and that is going to overwrite any files that are already named that just to be clear So you can paste things in pretty easily a Y Y is yank copy DD is cut or you know Cop or yeah cut basically So all of those things are pretty sensible If you notice that these things are highlighted right now if I want to un-highlight them you can just press U V Notice that they're still blacked out and that's because they're actually yanked if I want to un-yank them I can press you why nice and simple Now I also should say that Ranger has something sort of like a visual mode So I can do something like V s and that allows me to sort of scroll up and down and you'll notice that it's going to Highlight everything I scroll over and when I'm done with that. I'm gonna press V s again Then I can yank them in somewhere else now. I think by default That's not V s it might just be capital V But I remapped it because you know there are some things I wanted to there are just a lot of things I actually remapped but I think it makes more sense But also you can as I said before UV to un Visual unselect and UI to unpaste in case it annoys you the way they look But you can also do things like VA to highlight all or toggle all from being highlighted or stuff like that So that's visual selection Now I should say in addition to this stuff. This is basically the basics of Copying and pasting and you know making files moving around Now I should say that there are a lot of settings you can set I'll go ahead and pull up the config files and or at least explain them So if I go to oops, let's say I go to well, maybe I'll CD and they're just because why not So if you go to the ranger configs, there are a couple different files here. The important ones are commands Commands full and commands. That's where you can put Python scripts that you can run as commands in ranger That's nice for adding things There is RC comp is the main Config file. So if I open RC comp, this is where you can set all the settings all the visual settings And if you go down to the bottom, you'll see that I actually have a bunch of different like you know Here are some things that I added in capital V to open Vim MKD to make a directory all that kind of stuff I've I've mapped in here So this is where you do all the main modification and I've thrown a whole bunch of stuff in there Oh, I didn't talk about bolt bulk rename, but so I said CW is rename a file Ranger has this nice built-in thing called bulk rename. So if I highlight multiple files and press C capital W That's what I've remap to to it opens all the file names in Vim And I can you know make some kind of changes to all of them You know run some kind of Vim command on them that makes editing them easel easy and then save and exit There's actually a previous video when I when I I think I did a video on something like that But you can check it out So anyway, that's all the basics of the RC conf you can pretty much just do whatever any kind of script You can run in you know the shell you can run here You can feed files the file that you have selected into one of these commands as colon or percentage sign f and Everything that you have selected is percentage sign s just so you know Now the other important files you will there are is rifle So rifle comf you might not be doing as much changing in this file, but It basically determines what files Ranger is going to use to open Some kind of file type by default so you can see oh well if it's a video file it uses MPV and all of the There's basically all these different programs that you can throw into You know if there's some program that You use that's very irregular all you have to do is throw it in here And it will look for it by default And I think all of these are ordered in terms of what Ranger is going to run first So for example, if we're talking about these PDF doc open, you know, excuse me PDF Programs, that's the word I'm looking for It's gonna run the one it's gonna look for the one that is here first first And if you don't have any of these installed it's going to go with this by default for example the one that's lower So that is the rifle config and the only other thing is scope SSH, which is a very interesting file as well because you'll notice when I scroll over things They will appear as previews and I can also if I go over this You know file I have here that I made in VAM You can see the preview of the text and the scope file is what determines What kind of preview you're going to see when you're actually running something or you sort of mouse over Something in Ranger so that's what that is for so you can do stuff like view PDFs and stuff like this You can probably just I'll put a link to my dot files and it has all I guess all the bells and whistles But two other things the two other little notes additions to my ranger config One is a fuzzy finder now got blood who did a video on this a while ago It's an extremely useful command to integrate into ranger and that is I have control f map to fuzzy finder Now in this directory, there's not much stuff But you know if you're working with your documents directory and you have hundreds and hundreds of files It's very nice because you can pretty much you have a fuzzy finder You can just type in some letters and it's gonna try and find what fits best with that now That's not in ranger by default. It's an extra command you can put in but you can check my dot files or look for Got blood is original video on that. I don't think I don't know if he made the ranger thing Maybe he got it from someone else, but check out his video on that for that The only other thing that I use all the time and is a an addition to ranger is Shortcut sync which is something I forgot to pull it up before I started the video But on my github I have this nice little script that will auto generate Basically shortcuts in ranger for example when you're often using a whole bunch of different directories all the time like I have Dozens and dozens of directories that I keep my files in and they're all meticulously sorted because I have so much stuff It's nice having shortcuts to each of those individual Directories so what I did is I made a nice little script and what this script does is It uses a file that looks like this Where you have you know basically? directory names and then key sequences that correspond to them and what the script does is it takes this and Generates basically ranger Your ranger shortcuts for them automatically so notice that you know H is my home directory Or B is books or you know a is articles or something like that And I can use those key sequences to actually jump to different directories So if I want to go to my articles directory I press G and then a for articles or GH for home or if I want to let's Let me actually go back to this file. Let's say I want to move this file to my home directory I can just press M and then H and you'll see if I GH to go to home. You'll see that it is now there So I have G for go Y for yank like copy like capital Y In for move and T for create a tab in the other directory So if I do like T capital D that creates a tab in my downloads folder and you can see the tabs up here You can go back and forth with like tab or whatever So yeah, that's pretty much it Now as I said ranger is it's a kind of program that is arguably for many tasks. It's actually just as good as like knowing You know using console commands and stuff We're doing pretty advanced stuff and there are a lot of advantages since you can use like rifle and scope to like automatically decide what kind of Programs you want to open or how you want to preview preview files or something like that So I find it very very easy to use and it's very manipulatable So again, if you want my conflict files, they are on my github You can get them. I'll put a link all to that and check out got blood who's video on the fuzzy finder But anyway, that that should be all about it. That was a lot, but I'll see you guys next time