mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-14 10:09:48 +00:00
20d6e5fe6e
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?)
62 lines
2.4 KiB
Plaintext
62 lines
2.4 KiB
Plaintext
#
|
||
# 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... :-)
|