On GNU/Linux is it possible to change the default pager for info command? I would like to use less as the pager (similar to man pages). I have customized less to use colors to make navigation of man pages much easier.
2 Answers
info doesn’t use a separate pager, because it handles navigation — it doesn’t produce a text document to be viewed with another tool. It doesn’t support paging to less.
You might find Pinfo interesting, it’s a replacement for info (and man) with configurable colours etc.
I was just wondering this myself, and I didn't want to install a replacement program for info.
For less, you can just pipe the output:
$ info coreutils | less This only works for pagers/editors that will accept stdin. E.g., vim will let you read stdin:
$ info coreutils | vim -R - The - is what tells it to read from stdin (this is just a convention, not all commands recognize this), and -R says to open read-only. It still works without -R, but complains about modified buffers.
You can then condense it by putting a function in your shell profile; e.g.:
linfo() { info $@ | less } - Please don't offer answers to questions that were answered and accepted nearly half a decade ago.Shadur-don't-feed-the-AI– Shadur-don't-feed-the-AI2025-01-22 15:43:56 +00:00Commented Jan 22 at 15:43
- And yet, this post was the first relevant one that came up when I searched for this exact issue, and the accepted answer does not actually answer the poster's question. I am not trying to take away anyone's green check. It's enough if another user with the same question saves a few minutes of their time.N. Kern– N. Kern2025-01-23 16:06:55 +00:00Commented Jan 23 at 16:06