How to center search results in Less, instead of moving matched line to top of terminal
You can use the -j
option. From within less
, type - then j then enter a number of lines below the top of the screen for the target line to be displayed (e.g. 12).
You can start less
using this option:
less -j12
or set the LESS
environment variable to include it:
export LESS=-j12
My $LESS
is:
-iMFXRj4a#1
You can include setting the environment variable in your ~/.bashrc
file to make it persistent.