 If you've watched the channel for any amount of time, you know that I have a thing for file managers. It's probably my favorite type of application. It's a weird thing. And it just goes to prove that I'm, you know, a nerd, but I like file managers. And my all time favorite application on Linux is actually a file manager. I've talked about it several times before on the channel. Crusader is amazing. And if someone took it away from me, I would cry like a baby. So you get the point. I like file managers. And I always like exploring new file managers are ones at least that I've never tried before. So what I thought I would do today is take a look at a terminal file manager that I've never actually used before called LF now LF is a terminal file manager that has been around for a very long time. But I've never actually taken a look at it. So I thought I'd go ahead and do that today. So before we jump in, let's talk a little bit about what LF is. It's a terminal file manager. It is written in go. So if you have something against the go language, you probably won't want to use this. But outside of that, it seems to be fairly speedy and it's well developed. And it has a ton of features, or at least it has the capability to add a ton of features. And we'll talk about that later. So in terms of installation, it's available on pretty much every single district out there. If you want to install it, it's probably in your repositories. And because it is written in go, it's actually fairly easy to build to. So if it's not in your district repositories, which is going to be fairly rare, you should be able to build it fairly easily. Now, like I said, because it's available in pretty much every repo, you probably will never have to encounter a situation where you have to build it. So just go to your favorite package manager, install it using the package name LF and you'll probably find it just fine. I know I had that experience on both Fedora and on Arch. So installing it is fairly easy. So once you have it installed, you'll see something like this. So you'll have to use the command LF to actually use LF. And then you're going to be presented with what is a fairly standard terminal interface for file manager. It looks somewhat like Ranger. If you've ever used Ranger before, it's very simple and your navigation is just as predictable as you'd expected to be. So you'll be able to go up and down using J and K. If you want to go into a folder, you'd use L if you want to go back or up a folder you'd H. So all of the them keys here work, you can use GD to go to the top capital G to go to the bottom. So the standard them keys work. Same thing with searching so you can do slash and then type in a word. So in this case, music would work and it would take you to that particular folder. If you wanted to yank a file into your copy buffer, you could do YY that would yank that particular directory and then you could go into another directory and do P to paste if you wanted to do that. If you wanted to delete that you could do colon delete and it would ask you if you wanted to delete it, you just do that. If you wanted to take multiple directories, you could use the spacebar to select those directories. You can also cut and paste instead of copy and paste like I was doing with yank and he for paste, you can actually cut by using D or DD. Both of those seem to work. And then if you go into another directory and press P, it would actually cut from the other place and paste it into the new directory. So let me show you that again D and then paste again with P. So the standard them key bindings work just fine. And if all you ever wanted to do was move around certain things so you can basically CP and MV documents and files wherever you want. Those things seem to be fairly standard out of the box. It's when you move past those things that things get a little bit weird and that's where we're going to talk about the configuration of LF. So out of the box, there is no configuration on your computer, so you actually have to create this. So first let me show you where it's at. So in order to get hidden files, you do ZH. So that's going to show you all of your hidden files and you can then go up to one of your dot files. In this case, config, you're going to need to create a directory called LF this directory will not exist out of the box. And then you're going to need to create a file called LF RC. Now I've already obviously done this. So this is what the LF RC looks like. Now, before we jump into it, let me show you where you can get this. So if you go to the GitHub page for LF, you'll go to the Etsy directory. And then you'll scroll down here to the LF RC dot example. And that's where you'll find this particular file. Now there are other examples here for different shells and different platforms that you may need if you are not using ZSH or bash or whatever. So take a look here in this Etsy directory on their GitHub page if something in this configuration file doesn't particularly work for you. So that's where you find the example LF RC. So what's actually in this? Let me let me first zoom in here just a little bit so you can actually see. So so there seems to be three different ways of configuring things inside of the LF RC file. So the first one is set set basically sets different options for how LF interacts with the shell. I believe these are probably some form of variable. And there are certain ones that you can use. And these are ones that come with the standard or the example LF RC file. The other way of configuring LF that has to do with key bindings is map. Now you use map to as you would expect map to different key bindings. So if you wanted to change any of the key bindings to do certain things like move around, if you wanted to change away from the BIM keys, you could do that. You'd use the map command inside of the LF RC in order to do that. The other way that LF is configured is with the command option. Now basically what the command option is is a way for you to do shell scripts inside of LF. And this is where the complexity and power of LF come in. So out of the box LF comes with the basic features and not even all of them really. You get to move around, you can move files around using yank and delete and stuff like that. You can do all that stuff, but there aren't any other features. So like you can't easily out of the box make a directory. MKDIR doesn't have a key binding or anything associated with that. In order for that to happen, you have to create one of these commands. So you would do something like that with a command function that looks something like this here. Now I will link to this particular LF RC in the video description. This is from a gentleman called Eric Murphy. He's made a whole video on LF. I will also link to this. But basically what this does here is you use the command operator and then you've this is the name of that command. So you would then use that command inside of LF to do this particular thing. So basically what it does is it asks you for a directory name. It reads the answer of that assigns it to this particular variable and then it makes the directory of your answer. That's basically what it does. So if we actually were to copy and paste this into our LF RC, so we'll copy that and we'll go to the bottom. It doesn't really matter where you put this and we'll paste that just like so and then we'll write and quit this. Now if I were to let's just I'm actually have to quit LF and I'll restart it again so that it pulls in the changed configuration file. And now let's just say I wanted to make a directory. I could do that by pressing colon and then mkdir and then I'm going to enter the directory name. So this is going to be test and enter. And now I have a directory called test. That's as simple as it is. Now, obviously the downside of doing things like this is that you have to know some bash or at least some kind of shell scripting in order for this to work. And not everyone knows that. So because there are certain features that are missing like making a directory, you're going to have or at least you're going to leave some people out of the ease of use of this particular program. Some people are not going to have the knowledge or know how or whatever to create these particular functions in order to get the features that are pretty standard in every other file manager. Now that being said, it doesn't really take a lot of effort to learn some of this stuff. So basically, most of the commands that you're going to want to create are three or four lines. You know, there's it's going to ask you for, you know, an input of some kind, it's going to read that input and then it's going to do some kind of bash command or something like that. Now, obviously, because this is a basically a shell script or the ability to do a shell script, you can do pretty much whatever you want. If you wanted to do like a case statement like he's done here in order to do unzipping the files, you can do something like that using case statement. There's also the ability to do a while loops if you wanted to do a while loop or an if statement, whatever you can. If you know bash, the sky is the limit in terms of what commands you can actually do. Now, like I said, that's where the power of LF comes in. If you know bash, you can basically script whatever you want. So you can take one of these commands once you've created it and then rebind it to a key binding like he's done down here. So he has map md to mkdir if you wanted to do something like that. So every single function or command that you create can then be mapped to a key binding and you'll be able to use that with just a key binding if you want. So that's really nice. Like I said, the power of LF comes from your ability to basically do whatever you want with these commands. Now, obviously, as I said, that's going to depend a lot on your knowledge of actually writing these commands. So what I've been doing because I'm garbage at bash scripting is finding people who have done it for me and stealing them. So I found this guy who has all of these things here and I can use those if I wanted to. Now, like the unarchive here that he has, that's actually unnecessary. So if we go back into the LF RC, we can actually see that the example LF RC has something for actually unzipping and extracting the current files already built in. Probably when he created that this wasn't here, but you can kind of see the power of these commands. If you take a look and see what's not only already built into the LF RC, but what other people have done, that's what I've been doing. So that's the very basics of LF. Now, the question then becomes, how do I compare this to Ranger? So if we actually take a look at Ranger, Ranger looks somewhat similar. This particular Ranger has some customization. So there's lines in between the columns, but out of the box, it basically looks the exact same as LF. You do the same type of navigation with them keys. The difference between Ranger and LF, however, is that Ranger is full featured out of the box. So the Ranger RC file, which looks like this, you can see that it has a ton of different options already in here. And you don't have to spend your time creating commands in order to get rudimentary features. That being said, of course, the Ranger RC file is much bigger and there are a ton of features here that you may never use. So if you're into the whole bloat versus non bloat argument, LF would be less bloated than Ranger is. Also, Ranger's written in Python. So if you have a thing against Python, Ranger is probably not going to be for you. Personally, I still prefer Ranger simply because I've been using it for a long time. I know everything that needs to go into configuring it and it's just better for me. I don't want to have to basically start over and have to find all the commands that I want from other people because I don't know really how to use, you know, create those things on my own. I mean, I know some of the stuff, but actually doing it would require quite a bit of effort. And while that's not necessarily a bad thing, I still prefer the thing that I know over the thing that I'd have to put effort into, you know, actually learning. So if that sounds ultra lazy, it is. But at the end of the day, I still prefer Ranger has all of my stuff in it. And it just works for me just a little bit better simply because already has all the features that I'm looking for. So that is a very brief look at LF. Now, I could have gone much more in depth when it comes to creating the commands and actually doing key bindings and stuff like that. But this was not meant to be a tutorial. So I will link to that video that I showed you earlier where that is a much a much more in depth look at how to configure LF. So if you are interested in learning how to configure LF, go check that out. And especially if you're interested in learning how to do two things. First, using icons by default, LF does not have icons. You have to set that up by yourself. And the way that does it is really weird. So you have to have an icon file that basically lists out each type of file and director you might have and then associates it with an icon. It's kind of messy. You know, you can do that in an icon file, like I said, or you can actually do it in your like your bash RC or your ZSH and file and that's even more messy. When I saw that's how it was done. It was a little weird. That's why I didn't show it to you on here because I wouldn't have anything good to say about that particular way of assigning icons. I don't like it. It's not great. The other thing that you might want to check out is the image previews because you can actually get image previews working in LF. I was unable to do so again. That's the reason why this was not a tutorial. But apparently it is possible to do so. That's another reason why I prefer Ranger because actually getting image preview on Ranger working is fairly easy. You just download a program, set one line in the configuration file and you're ready to go with LF. I it's not really much harder than that. It just didn't work for me. Maybe it's because I was working in a VM. I don't know. But that's kind of beside the point. Yeah, you can get both icons and image preview in LF if that's what you want to do. So I will link that video in the video description below. And yeah, that's LF. Like I said, personally, I still prefer Ranger, but I can see why people would like LF. If you are into total control, then LF gives you a lot more of the ability to do basically whatever you want from the ground up than Ranger does. Because Ranger has all of the functions that it has, but that's what it has. In order to do anything more, you could still use bash scripts and assign those things to, you know, a command if you wanted to. But it's not quite the same as having it built right into the configuration file. So if you have comments on LF, you can leave those in the comment section below. I'd love to hear from you. You can follow me on Twitter at the Linuxcast. You can follow me on Mastin and Odyssey. Those links will be in the video description. You can support me on Patreon at patreon.com slash the Linuxcast. Just like all these fine people. Thanks to everybody who does support me on Patreon and YouTube. You guys are all absolutely amazing. Seriously, just without you the channel would not be where it is right now. So thank you so very, very much. Thanks everybody for watching. I'll see you next time.