Pager or text viewer on eInk?


λ the β-Redex Reducer

β-Redex Reducing Member
Joined
Sep 13, 2016
Messages
1,516
Age
54
Location
Lambda Centre
What do you guys use as pager or text viewer? I used to use less but now I find that more is quite effective too, so I changed my PAGER environment variable to more and also changed my ~/.config/mimeapps.list to use more for text files which I want to view using my pager. I do not understand why people insist on using less if they can also have more.

BTW, kudos to ed for having such an elinks friendly forum.
 
I've incorporated 2 things in my listing:

1. I clear the screen and the screen buffer with:
Code:
alias cls='clear && echo -en "\e[3J"'
This allows me to go up/down cleanly over one logfile with SHIFT+PGUP/PGDN

2. I've added colouring to certain keywords (highlight)
Code:
$ cat ~/bin/highlight
#!/usr/bin/perl
use Term::ANSIColor;
@C = ('black on_yellow','black on_green','black on_cyan','black on_red', 'red on_white', 'black on_magenta', 'white on_red', 'white on_blue', 'blue on_white', 'yellow on_cyan' );
while(<STDIN>){
        for $i (0..$#C){
                s/($ARGV[$i])/&colored($1,$C[$i])/gexi if($ARGV[$i]);
        }
        print;
}

I shorten it with:
Code:
alias hl=highlight

This allows me to:
Code:
cls;cat $file |hl text1 thing2 otherthing
and then go up and down the xterm buffer. I can not find other things, but can type or paste anything because the prompt is waiting already (instead of having to quit first)

Not sure about e-ink displays.
 
I use less. It's especially useful since you can navigate around the file in a kind of vi-ish fashion; at the very least 1G takes you to the head of the file and G takes you to the end, although in just testing it now I've notices that lower case G (g) takes you to the head of the file as well. Also you can search for things with regexp by typing forward slash (/). Using those together can be especially useful over a slow ssh link, if you know what to search for at the very least can be a much better way to navigate a big file, because if you just page down lots you're likely to enter too many and buffer up a load and overshoot wherever you want to go even on a relatively quick connection.
 
Back
Top