132
submitted 1 month ago by GnuLinuxDude@lemmy.ml to c/linux@lemmy.ml

For many, many years now when I want to browse a man page about something I'll type man X into my terminal, substituting X for whatever it is I wish to learn about. Depending on the manual, it's short and therefore easy to find what I want, or I am deep in the woods because I'm trying to find a specific flag that appears many times in a very long document. Woe is me if the flag switch is a bare letter, like x.

And let's say it is x. Now I am searching with /x followed by n n n n n n n n N n n n n n. Obviously I'm not finding the information I want, the search is literal (not fuzzy, nor "whole word"), and even if I find something the manual pager might overshoot me because finding text will move the found line to the top of the terminal, and maybe the information I really want comes one or two lines above.

So... there HAS to be a better way, right? There has to be a modern, fast, easily greppable version to go through a man page. Does it exist?

P.S. I am not talking about summaries like tldr because I typically don't need summaries but actual technical descriptions.

you are viewing a single comment's thread
view the rest of the comments
[-] OneCardboardBox 7 points 1 month ago

As an emacs user, I use M-x man. All my standard keybindings make finding what I need very easy.

Of course, it's not so fast if you aren't already in emacs.

[-] thingsiplay@beehaw.org 15 points 1 month ago* (last edited 1 month ago)

I want to mention that one can set the pager for man to be Vim too. Then it would load the document in Vim instead in less for display and navigation. This can be set with option man -P pager or with the environmental variable $MANPAGER or $PAGER . I had set this up in the past with original Vim, but it required some special options for Vim as well. It was nice, but ultimately not needed; so I went back to less. Sometimes less is more.

Edit: Here is how one can use Neovim as the pager:

export MANPAGER='nvim +Man!'

I kind of missed it and will set it to this now. Put this line in the Bash configuration .bashrc and every man document is loaded in Neovim now.

[-] amanneedsamaid@sopuli.xyz 1 points 1 month ago

+1, displaying in a Emacs buffer solves any issues I could have. If you're already 'in' Emacs, this will be more frictionless than shell scripts around man

this post was submitted on 10 Jul 2024
132 points (97.8% liked)

Linux

46620 readers
926 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS