 One of the most important things in the Linux operating system is man pages. Man pages are your manual pages They're the instruction manuals for all your programs available on the system Almost every program that you can run has a man page and because we as Linux users spend so much time reading man pages The choice of what to use as a man pager is a pretty important choice A man pager is the program that you actually use to read your man pages by default That's typically the less command, but you do have other choices such as bat vim Neo vim and today I wanted to show you how to change your man pager from less to one of these other programs If you so desire, so I'm gonna switch over to my desktop and open a terminal and let me zoom in here a little bit This is the fish shell, but I'm gonna show you how to change your man pager on bash Zsh and fish all three shells because many of you have more than one shell installed on the system and Probably, you know use more than one shell on a regular basis. I use all three bash Zsh and fish So I want to change my man pager in all three shells. I'm gonna switch over to bash Let's start with bash first. I'm gonna clear the screen and if I did a man on The man command, so let's read the man page for the man command. This is typically what you get This is actually the less program less is reading the man page for us If you hit enter or return on the keyboard, you can scroll down q to quit out of less There's really nothing fancy about less. There's really no syntax highlighting or anything It's a very functional man pager. There's nothing wrong with less you could use less Now if you wanted to change the man pager in the bash shell You could do it in the shell itself. You could do something like export man pager equals and Then in quotes a command to you know what you want to set as a man pager, whether it be bad or Neo Vim with various options Vim with various options But this is typically not what you want to do because it's not permanent What you want to do is actually set this in your bash or see So let me open up the bash RC here in Vim and in my bash RC I have this section here exports and then under exports I have set man pager and I say uncomment only one of these Because I have the ability to set bat as a man pager Vim as a man pager and Neo Vim as a man pager right now. I have all of them commented out So we're just using the standard good new less command as the man pager But if I wanted to I could go in here and I could uncomment that line right there and that line export Man pager equals and then the shell command which is going to pipe into bat the man page is what it's going to do So let me write that and then I'm going to open up a another terminal here And let's switch over to bash again And let me zoom in clear the screen and this time Let's run a man page on the LS command and we are no longer looking at less Right. This is now the man page piped into bat rather than less and you can see we get nice syntax highlighting Bat works very similar to less if I hit return on the keyboard We can scroll down again Q would quit H get you the help and it actually gives you the help page for less Because bat uses all the less commands So they're just Repurposing the less help menu here in bat Q to quit out of bat as your man pager Other than using bat as your man pager we could set Vim as the man pager So let me comment out the bat line again and let's uncomment the line here for setting Vim as the man pager I found this line here on stack overflow a couple of years back and I've just kept it around It basically is piping your man pages into Vim with various Vim settings such as no relative number and things like that So if I do a right here and then let me relaunch the bash shell And what I'm gonna do is I'm just gonna source the bash RC our new bash RC that we just saved and now I get a new bash shell that now when I run the man command on I don't know find Let's run the man page for find And it's gonna give me some errors because I don't actually use Vim as my Editor of choice. I actually use Neo Vim. So my Vim config is broken. It's just telling me my Vim config is broken But if I just hit continue, it will actually launch Vim my broken Vim config This is actually Vim and you can tell it's Vim because all your Vim commands work For example, if I do capital G I go to the bottom of the document GG goes to the top of the document 5g goes to the fifth line if I do the Slash for a search, you know typical way to search in Vim I could search for something such as find and then you know I could in for next and and all of that and then queue to quit out of Vim and not colon Queue when you use Vim as the man pager just queue the same as in less the same as in bet now You guys that use Vim as your text editor of choice You're not gonna see those errors again Those errors are just because I use Neo Vim and my Vim RC has some some errors in it because I don't really use Vim I again, I use Neo Vim, but I can set Neo Vim as my man pager So let me go back in here and I'm gonna comment out the line for setting Vim as the man pager I'm gonna uncomment this line here which sets Neo Vim as my man pager So let me do a colon W here in Vim to write my new bash RC once again We need to source the bash RC. So let me source our new bash RC and now let me run the man command on CD let's read the man page for the CD command and this is my Neo Vim config You can tell because I didn't get any errors because my Neo Vim config actually works and Again, it's very Vim like if I do capital G I'd go to the bottom of the document GG to the top and everything you'd expect as far as Vim commands the slash again to search If I wanted to I could even do command mode I mean I could do a colon VS and do a vertical split and get two different man pages here in this If I really wanted to do that Let me quit out of one of the splits and then just a single cue to quit out of Neo Vim as the man pager Now I mentioned I would show you how to do this in all three shills. So this is obviously was my bash RC So How would we do this in ZSH? Well in ZSH ZSH and bash they pretty much accept the exact same syntax. You could actually Take these lines here that I have in my bash RC and put these exact same lines in your ZSH RC And it would work just fine. Matter of fact, let me show you this I'm gonna do a vertical split here and in this vertical split. Let me go ahead and open my ZSH RC I can type correctly and you can see there is this man pager section in my bash RC Here is this man pager section in my ZSH RC They're exactly the same matter of fact if I opened up a terminal right now, let me open up a terminal I'm gonna switch over to ZSH if I did a man on man This is less but again because we can actually change this let me go in here and let's try bat So let me go ahead and just uncomment out that line right there Now let me open up a new terminal ZSH again And this time when I do a man on man here in ZSH You can see that it's actually piping it through bat Q to quit now setting this in fish is a little differently So let me do colon e to edit and I'm gonna do dot config Slash fish slash config dot fish because that's my fish config and instead of using the export command The way you would in the bash shell and the Z shell instead of using export you use the set command So instead of export man pager equals and then the command you do set space dash X space man pager No equals and then the command of the syntax is a little different for these They're essentially the same command You just have to replace export with set dash X and there's no equals in the command And if I wanted to show you this in action, let's try this with neofium So let me uncomment that and now let me open up the fish shell And if I did a man on LS it would open this in neofium This is my neofium here and quit out of that So that is how you change your man pager from less to bat to Veeam to neofium You could also set your man pager if you wanted to I mean if I really wanted to I could set it to emacs But there's no reason to ever set a man pager to emacs because emacs has man built into it So if I just open emacs and I do a meta X man, you know, this is the man Program here inside emacs. What man do I want to read? I want to read the d-menu man page And there is the d-menu man page right here in emacs. So I really wouldn't want to set that in my shell I would much prefer using something like Veeam or bat in the shell rather than Switching emacs as my man pager now before I go. I want to thank the producers of the show I want to thank abseed Dallas Devon Fran Gabe Luke or Benny and Mitchell Allen Akami arch 55 30 Chris Chuck David the other David Donnie Dylan Gregory Lewis Paul pick Veeam Scott Wesson Willie They are my highest tier patrons over on patreon without these guys this episode about your various choices for a man pager This episode wouldn't have been possible The show is also brought to you by each and every one of these ladies and gentlemen as well These are all these names you're seeing on the screen right now These are all my supporters over on patreon because the channel is supported by you guys the community without you guys I couldn't do what I do you'd like to support my work look for distro tube over on patreon. All right guys Peace I Wonder if you can set cocoon as your man pager