-2

New to the command line here

My title may be a case of classic x/y problem where it describes the attempted solution instead of the problem itself.

Nevertheless, my issue is with git log where it prints directly into the command line instead of moving into the pager(?) and clearing the screen afterwards with q.

instead of typing this:

git log

I have to type this:

git log | less

I've tried all of the following:

git config --global core.pager less
git config --global core.pager "less"
git config --global --replace-all core.pager "less R"

to no avail.

I tried this as well

export LESS=R

and it worked but only for the current session and did not persist into the next.

Any pointers?

Thank you for your time

2 Answers2

0

You want a universal variable: https://fishshell.com/docs/current/language.html#shell-variables

set -Ux LESS R

Just do that once at a command line, do not add it to config.fish.

glenn jackman
  • 238,783
  • 38
  • 220
  • 352
-1

So it looks like all I needed to do was add export LESS=R to my ~/.config/fish/config.fish

I added this line per Brian’s comment on my question above. They link to a “site duplicate” here

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jul 25 '23 at 21:00