Mercurial: pager extension

Sometimes when you are using Mercurial you want to paginate the output results. With paginate I mean use someting like bash more or less commands. Trying to focus yourself in a long list display is nearly imposible without a pager, so you can do it old-school-style:

$ hg st | more
$ hg st | less

Or you can activate the Mercurial PagerExtension, easy peasy:

[extensions]
pager=

[pager]
pager = LESS='FRX' less
attend =
ignore = help

Once you have saved theese lines on your ~/.hgrc, all the Mercurial commands will be paged. Remember that, by default, PagerExtension only works with annotate, cat, diff, export, glog, log and qdiff commands. If you want it to be run with all the commands you have to add the "attend=" line. On the other hand, if you want to ignore some commands you can specify that with the "ignore" option as you can see in the above sample.

Mercurial Pager

More information about the PagerExtension and Mercurial in general:

About the author

Óscar
has doubledaddy super powers, father of Hugo and Nico, husband of Marta, *nix user, Djangonaut and open source passionate.
blog comments powered by Disqus