head 1.1; access; symbols RELENG_4_0_0_RELEASE:1.1 RELENG_4:1.1.0.2 RELENG_4_BP:1.1; locks; comment @# @; 1.1 date 99.09.03.22.31.17; author hoek; state Exp; branches; next ; desc @@ 1.1 log @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?) @ text @# # This sample .morerc causes more to emulate the default most(1) # keys, in so far as more(1) is capable (which is not very far at the # moment). # # $FreeBSD$ # # BUGS: It's extremely unlikely that more(1) will ever support multiple # windows as most(1) does. Multiple windows is an editor function, # isn't it? # macro 1 "" 'forw (${_sc_height} * ${number})' macro 1 v 'forw ${number}' macro 1 V 'forw ${number}' macro 1 "" 'forw ${number}' macro 1 "" 'back ${number}' macro 1 ^ 'back ${number}' macro 0 T 'goline 1' macro 0 "\e<" 'goline 1' macro 0 B 'goend' macro 0 "\e>" 'goend' # Doesn't match most(1) documentation macro 1 "\e[C" 'rscroll ${number}' macro 1 "\t" 'rscroll (60 * ${number})' macro 1 > 'rscroll (60 * ${number})' # Doesn't match most(1) documentation macro 1 "\e[D" 'lscroll ${number}' # Doesn't really do much, being ^B and all... macro 1 "" 'lscroll (60 * ${number})' macro 1 < 'lscroll (60 * ${number})' macro 1 u 'back (${_sc_height} * ${number})' macro 1 U 'back (${_sc_height} * ${number})' macro 1 "" 'back (${_sc_height} * ${number})' macro 1 "" 'back (${_sc_height} * ${number})' macro 0 R 'repaint' macro 0 r 'repaint' macro 0 "" 'repaint' macro 0 j 'condition (${number} == 0); \ error "prompt for line-number not supported"; \ condition (${number} != 0); \ goline ${number}; \ condition true;' macro 0 J 'condition (${number} == 0); \ error "prompt for line-number not supported"; \ condition (${number} != 0); \ goline ${number}; \ condition true;' macro 0 g 'condition (${number} == 0); \ error "prompt for line-number not supported"; \ condition (${number} != 0); \ goline ${number}; \ condition true;' macro 0 G 'condition (${number} == 0); \ error "prompt for line-number not supported"; \ condition (${number} != 0); \ goline ${number}; \ condition true;' macro 0 % 'condition (${number} == 0); \ error "prompt for percent not supported"; \ condition_toggle; \ gopercent ${number}; \ condition true;' macro 0 q 'quit' macro 0 Q 'quit' macro 0 " E" 'quit' macro 0 h 'help' macro 0 H 'help' macro 0 "" 'help' macro 0 "\e[N" 'help' macro 1 f 'magicasksearch forw ${number}' macro 1 / 'magicasksearch forw ${number}' macro 1 "" 'magicasksearch forw ${number}' macro 1 ? 'magicasksearch back ${number}' macro 1 n 'research ${_ls_direction_n} ${number}' macro 1 N 'research ${_ls_direction_n} ${number}' # The mark stuff could be more effeciently done with a temp var, of course... :) # These are nice enough that I'm tempted to bring them into default.morerc macro 0 m 'setmark z' macro 0 " M" 'setmark z' macro 0 "." 'setmark z' macro 0 "" 'setmark y; gomark z; setmark x; gomark y; setmark z; gomark x;' macro 0 "," 'setmark y; gomark z; setmark x; gomark y; setmark z; gomark x;' macro 0 e 'edit' macro 0 E 'edit' macro 0 :n 'file next ${number}' @