Very often happens that I do
$ man someprogram
to inspect the manual for some program. Often I also want to search for something in there, and I simply hit / and write whatever I want to search for.
Unfortunately, whatever the match is, it is brought to the top line of the screen, therefore most of the times I need to scroll up manually a few times to actually see some context for that matching line.
How can I set less
such that it leaves some offset lines between the top line and the matching line?
Best Answer
You want the
-j
option. See under "OPTIONS" in the man page:Note: you can configure the option using
lesskey
, use an environment variable likeLESS=-j5 man someprogram
or just type-j5
while in less.