freebsd-skq/usr.bin/more/less.morerc
Tim Vanderhoek 20d6e5fe6e Thorough revamp of how input commands are processed. This allows customization
of user keys (documentation pending).  The only key whose semantics have
changed is the capital 'N' key, which now performs a repeat-search in the
opposite direction (just like in vi).

This commit is a little bulkier than what I had originally planned.  I'm not
completely happy with the direction it went, but it's definately an
improvement, and the alternative is to continue becoming irrelevant compared
to GNU less.  (Does anyone even _use_ /usr/bin/more these days?)
1999-09-03 22:31:21 +00:00

62 lines
2.4 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#
# This sample .morerc causes more to emulate the default GNU less(1)
# keys, in so far as more(1) is capable (which is not very far at the
# moment).
#
# Some of this will/should/may be eventually merged into default.morerc.
#
# $FreeBSD$
#
# magic value indicating we should use ${sc_height}
set window 2424989898
macro 0 H 'help'
set com_getscr 'condition (${number} == 0); \
condition (${window} == 2424989898); \
set scr_scroll ${sc_height}; \
condition_toggle; \
set scr_scroll ${window}; \
condition (${number} != 0); \
set scr_scroll ${number}; \
condition true;'
macro 0 "" 'eval ${com_getscr}; forw ${scr_scroll};'
macro 0 z 'condition (${number} == 0); \
eval ${com_getscr}; forw ${scr_scroll}; \
condition (${number} != 0); \
set window ${number}; forw ${number}; \
condition true;'
macro 0 w 'condition (${number} == 0); \
eval ${com_getscr}; back ${scr_scroll}; \
condition (${number} != 0); \
set window ${number}; back ${number}; \
condition true;'
macro 0 "\ev" 'eval ${com_getscr}; back ${scr_scroll};'
macro 1 "" 'forw_scroll ${number};'
macro 1 e 'forw_scroll ${number};'
macro 1 "" 'forw_scroll ${number};'
macro 1 y 'back_scroll ${number};'
macro 1 "" 'back_scroll ${number};'
macro 1 "" 'back_scroll ${number};'
macro 1 " " 'back_scroll ${number};'
macro 8 \e) 'rscroll ${number};'
macro 8 \e[C 'rscroll ${number};'
macro 8 \e( 'lscroll ${number};'
macro 8 \e[D 'lscroll ${number};'
macro 1 "<" 'goline ${number};'
macro 1 "\e<" 'goline ${number};
macro 0 ">" 'condition (${number} == 0); goend; \
condition (${number} != 0); goline ${number}; \
condition true;'
macro 0 "\e>" 'condition (${number} == 0); goend; \
condition (${number} != 0); goline ${number}; \
condition true;'
macro 0 "" 'gomark ?;'
macro 0 "" 'askfile;'
macro 0 :f 'stat (${_stat_n} + 1);'
macro 0 V 'error "Less is not being run!"
macro 0 Q 'quit;'
macro 0 :Q 'quit;'
# It might be possible to match the brace/bracket-pairing feature of
# less using some complex regexps... Project for a rain weekend... :-)