I've been using less
forever now, and there's one thing I wish it was doing differently.
When I do git log --pretty=oneline --abbrev-commit
it switches to full-screen immediately (as the output is very long), while 99% of the time I only care about first 5 commits or so. Sure I can do git log --pretty=oneline --abbrev-commit | head -n 5
, but that's extra work that I would like to avoid.
Ideally, I'd like the pager to display N first lines first without clearing the screen and taking over. If I press q
, it should just exit and leave that 5 lines there. If I press space
(or whatever) only then it should switch to full-screen, like it normally does. less -F
works a little it like that, but not exactly. I would like avoid jumping to full-screen on long output.
I don't see any way to script this-out. Is there any alternative pager that can or a way to achieve it with less
?