Just a few tips for people who may not know: - You can clear your screen with Ctrl + L. - Less has most of the same commands that you would use for a man page as vi(m), same navigation, searching with / and ?, etc. - You can reload your shell with just ". ~/.bashrc" (or whatever your shell's configuration file is called). P.S: I never looked into the performance of less vs. some text editor, my gut feeling is that less would be faster because most people don't really configure it much, but that might be an interesting topic to explore.
If you want a nice GUI-style viewer, KDE Konqueror recognizes “man://” and “info://” URLs. Those particular URLs give you browseable lists of what’s available.
I would love nvim as my man pager. Bat doesn't look too bad either 🙂 Guess I will just steal these aliases with your permission. I never actually knew this was possible. I have invented some new aliases recently. You contribute to the growth of my list of aliases with this video. Keep up the good work!
I don't use Vim/Nvim as a pager because I have a fairly hefty config for those, and while they still load up in a second I just feel weird running an app that has all the syntax highlighting, code snippets and all that jazz baked in, while less is still as barebones as it was when I installed (GNU/)Linux, so it feels way less organic, I guess. But I can see the use for this advice tbh.
Actually all of the shortcuts you showed, like /, gg, G, etc, are also there by default in less (and bat, which uses less). Honestly the main feature that would make me want to use neovim for my man pager (idk if vim does this too) is the gO command. It gives you a location list with all the different headings and also the option to directly jump to them. This is something that is not really possible in less. You would have to rely on the search and your memory
@@thallium54 Loool. It's funny, but it works. XD ("q" is just faster) Now, I've checked, you can do "jk" to scroll in man too. And you can Ctrl+N, Ctrl+P (Emacs style) to scroll and Ctrl/Alt+V - PageUp, PageDown. So less looks like some combination of Vim and Emacs. XD
Unfortunately, under Linux manpages are of varying quality. I prefer reading manpages over the newer and often more thorough infopages, which I regret that the whole story often isn't told in the manpages anymore these days, and I am fine with less as my default manpage pager. I think to remember that the BSD or later FreeBSD had the most comprehensive manpages (almost similar to the Arch Wiki, but long before there were any Wikis, let alone Arch). I cannot tell if this still holds since it's been two decades I last fiddled with FreeBSD and I am sure I have forgotten all from BSD including their ancient BSD boot system compared to SysV init or even systemd. In the video when DT was editing his .bashrc I could see the definition of lots of environment variables therein. Though there is no major issue with putting them into .bashrc I think to recall from man bash that the "correct" place for environment variable definitions would be the user's .bash_profile wheras alias and function definitions would go into .bashrc. As I am writing this in bed on my smartphone I cannot check man bash right now in case I'm wrong.
@@armynyus9123 ha, ha, autocompletion was the first setting I switched off when I was given this mobile for mainly work related purposes from my employer (n.b. I don't even posess a private mobile), because the autocompletion virtually drove me insane.
Hey Distrohuggers, The developmental version of Fedora 34 now has all Beta packages of Gnome 40. Meaning you can download an unofficial copy of Fedora 34 and it will update to Gnome 40 Beta. However, at this early stage, getting a clean install is unlikely. The good news, is that by the time Fedora 35 ships around Thanksgiving, Gnome 40 will be in tip-top shape, with lots of improvements to xwayland, wayland, mesa, wine, kernel 5.12, rust packages, sound and Bluetooth improvements via pipewire. I will finally be able to claim Fedora is better than Windows XP.
OFF TOPIC: I don't mean to jump in here with off topic subject but I just discovered 'QTerminal'.... I've been using terminator for a while because of the multiple windows you can have but qterminal does it too... I just looked to compare sizes and wow, what a difference. In fact QTerminal is small than all thee main stream variants I looked at... Come on DT, check into it... OK?
why use *less* when you can just use *more* ;) Also protip you can customize the default less using the LESS_TERMCAP.. environment variables and can slap full colors onto it. More details probably are in manpage of less. I've pimped less and it looks pretty neat.
I get that its possible to export a fullscreen value for MANWIDTH but it mangles the header if the pager is not fullscreen, maybe the answer is to just remove it, but imo if neovim could reload the manpage if I change the terminal size it would be preferable.
Imo as long as it has vi keybindings is good for me. Highlighting would be nice, yes, but KISS Not saying this video is bad, tho, don't misunderstand me
Turn a man page into a pdf with a function using ghostscript. pdfify() # convert man pages to pdf and open the pdf file { man -t $1 | ps2pdf - $1.pdf && setsid xdg-open $1.pdf &> /dev/null }
Last time I was that early DT was still explaining the difference between bald and shaved
Just a few tips for people who may not know:
- You can clear your screen with Ctrl + L.
- Less has most of the same commands that you would use for a man page as vi(m), same navigation, searching with / and ?, etc.
- You can reload your shell with just ". ~/.bashrc" (or whatever your shell's configuration file is called).
P.S: I never looked into the performance of less vs. some text editor, my gut feeling is that less would be faster because most people don't really configure it much, but that might be an interesting topic to explore.
@Learn Linux Yeah, mine is assuming to be in the home directory, I'll edit my comment above to avoid confusion.
also you can add syntax highlighting to less by changing it in .bashrc
My command history has been about 90% 'clear' up until now. Thanks for the shortcut - can't believe I never knew that.
@@CrazyMineCuber I don't see what you would need from a man page that less can't do anyway.
@@tgda904 you know that you can configure the history to not have duplicates? just dont ask me how i dont know of top. but its possible.
I really like your videos Derek, both the technical ones and the more dialogue oriented kind of videos. Keep up the good work!
Glad you like them!
The "vim" option works for me. Thank you sir!
Very cool, have set vim as my manpager now as I'm viminizing everything at the moment. Thanks man!!
The vim keybinds are just too good not to use
If you want a nice GUI-style viewer, KDE Konqueror recognizes “man://” and “info://” URLs. Those particular URLs give you browseable lists of what’s available.
euuhh gui… gross! jk lol
I was just trying to use vim for something like this at work last week. Thanks DT!
I would love nvim as my man pager. Bat doesn't look too bad either 🙂
Guess I will just steal these aliases with your permission. I never actually knew this was possible.
I have invented some new aliases recently. You contribute to the growth of my list of aliases with this video. Keep up the good work!
I love bat! It's amazing for inspecting code.
Good video with good information! Personally I like less more.
You should check out most, pretty much just adds highlighting
@@andrewgrasman8951 You can do highlighting in less as well.
Exactly what I need thanks dt.
I don't use Vim/Nvim as a pager because I have a fairly hefty config for those, and while they still load up in a second I just feel weird running an app that has all the syntax highlighting, code snippets and all that jazz baked in, while less is still as barebones as it was when I installed (GNU/)Linux, so it feels way less organic, I guess. But I can see the use for this advice tbh.
Finally got this working! Had trouble locating I'd found and installed the correct version of bat (actually batcat) in Ubuntu 20.04 ;-)
Actually all of the shortcuts you showed, like /, gg, G, etc, are also there by default in less (and bat, which uses less). Honestly the main feature that would make me want to use neovim for my man pager (idk if vim does this too) is the gO command. It gives you a location list with all the different headings and also the option to directly jump to them. This is something that is not really possible in less. You would have to rely on the search and your memory
But I can't type :q to quit in less which is really annoying😂
But you can? Even ZZ works
@@thallium54 You can, you don't even need to type a colon.
@@matt92hun lol maybe my memory went wrong😂 I only know q is quit
@@thallium54 Loool. It's funny, but it works. XD ("q" is just faster)
Now, I've checked, you can do "jk" to scroll in man too. And you can Ctrl+N, Ctrl+P (Emacs style) to scroll and Ctrl/Alt+V - PageUp, PageDown.
So less looks like some combination of Vim and Emacs. XD
Unfortunately, under Linux manpages are of varying quality.
I prefer reading manpages over the newer and often more thorough infopages, which I regret that the whole story often isn't told in the manpages anymore these days, and I am fine with less as my default manpage pager.
I think to remember that the BSD or later FreeBSD had the most comprehensive manpages (almost similar to the Arch Wiki, but long before there were any Wikis, let alone Arch).
I cannot tell if this still holds since it's been two decades I last fiddled with FreeBSD and I am sure I have forgotten all from BSD including their ancient BSD boot system compared to SysV init or even systemd.
In the video when DT was editing his .bashrc I could see the definition of lots of environment variables therein.
Though there is no major issue with putting them into .bashrc I think to recall from man bash that the "correct" place for environment variable definitions would be the user's .bash_profile wheras alias and function definitions would go into .bashrc.
As I am writing this in bed on my smartphone I cannot check man bash right now in case I'm wrong.
You typed this on a smartphone? I want your autocompleter...
@@armynyus9123 ha, ha, autocompletion was the first setting I switched off when I was given this mobile for mainly work related purposes from my employer (n.b. I don't even posess a private mobile),
because the autocompletion virtually drove me insane.
export PAGER=“nvim +’set ft=man’ +’set number relativenumber’ +’set scrolloff=999’ +’norm 32j’”
Best pager IMHO
Hey Distrohuggers,
The developmental version of Fedora 34 now has all Beta packages of Gnome 40.
Meaning you can download an unofficial copy of Fedora 34 and it will update to Gnome 40 Beta.
However, at this early stage, getting a clean install is unlikely.
The good news, is that by the time Fedora 35 ships around Thanksgiving, Gnome 40 will be in tip-top shape, with lots of improvements to xwayland, wayland, mesa, wine, kernel 5.12, rust packages, sound and Bluetooth improvements via pipewire.
I will finally be able to claim Fedora is better than Windows XP.
awesome!
Wow, learnt something new today. Can this be done for `info` as well?
For neovim as a manpager, this might be simpler:
```
export MANPAGER='nvim +Man!'
```
thank you!
Yeap, works pretty good. Thanks.
the method in the video wasn't working for me but this one works perfectly tysm!
How did you do the thing in your terminal with the randomized ASCII art?
OFF TOPIC: I don't mean to jump in here with off topic subject but I just discovered 'QTerminal'.... I've been using terminator for a while because of the multiple windows you can have but qterminal does it too... I just looked to compare sizes and wow, what a difference. In fact QTerminal is small than all thee main stream variants I looked at... Come on DT, check into it... OK?
why use *less* when you can just use *more* ;)
Also protip you can customize the default less using the LESS_TERMCAP.. environment variables and can slap full colors onto it.
More details probably are in manpage of less.
I've pimped less and it looks pretty neat.
you know, in this case , less really is more… good.
I like most better then more or less
How you find vifm ?
YEAH! DON'T SETTLE FOR LESS!
Just curious, why use vim as a pager when less/bat also allows search, g and G, hjkl etc?
To follow “See also: “ links and quickly switch between pages in vim buffers
@@billeterk Really good point, hadn't thought of the See Also links!
I don't get why nmap is being used to launch man pages on vim. (?!)
less actually has syntax highlighting ability, they are set by LESS_TERMCAP variables and I find it better for minimalism
I've always heard less is more but ok
nvim is morer
damn, my head hurts
Each of the vim commands you used are available in less (gg, G, /)
i find reading man pages posted on linux related websites a lot more user friendly and easier on the eyes. no special commands needed. LOL
Also, don't settle for 'more' or 'most' (pun intented).
You can do this for neovim:
export MANPAGER='nvim +Man!'
export MANWIDTH=999
See :help :Man for more info.
what about macho!?
You can have syntax highlights on man very easily
For bash and zsh users, reload your shell with exec $SHELL.
That doesn't reload your shell. That executes your user's default shell...which may or may not be the one that you are currently in.
@@DistroTubewell . also does not “reload” it just reads in your config
All I want is a man pager that is dynamically resizable
I get that its possible to export a fullscreen value for MANWIDTH but it mangles the header if the pager is not fullscreen, maybe the answer is to just remove it, but imo if neovim could reload the manpage if I change the terminal size it would be preferable.
Imo as long as it has vi keybindings is good for me. Highlighting would be nice, yes, but KISS
Not saying this video is bad, tho, don't misunderstand me
00:02 why are u saying linux it is gnu + linux
Imma use that and call man "batman"
I like to use batman
emacs?
Silly me. I thought Less was More...
Wth is a Cacune :D
You forgot emacs
But less is more....
First
Turn a man page into a pdf with a function using ghostscript.
pdfify() # convert man pages to pdf and open the pdf file
{
man -t $1 | ps2pdf - $1.pdf && setsid xdg-open $1.pdf &> /dev/null
}
imagine using man pages, i use -h or --help 😎
I use tldr
Man page is more comprehensive.
@Learn Linux it was meant to be a joke lol
In bashrc or bash_alias can I just alias man=/usr/bin/batman
Seems to work ok.
Joe