14
2
I'm trying to run less
in Linux, and I want it to search for something immediately after launch.
It's basically like doing this:
$ less
Then press '/'
, type a search pattern like "^commit \w+$"
, then press enter, and press 'n'
to find each subsequent result.
I'd like less to be launched, and then search for a pattern. There doesn't seem to be anything in the man page about starting with a pattern, but perhaps you can send it commands like Vim.
1Awesome, put this in your git config:
core.pager = less -cFRX --pattern='^commit'
and you'll be able to go to the next commit with the 'n' key right away. – Neil – 2010-08-19T02:37:35.240