; Hit TAB to complete the current input buffer word from the world history. ; TAB at the beginning of the line still does MORE paging... ; ; removed `@' and `-' for commands /set complete_wordseps=][ !?#$%^&*(),.><\"'`:;=+}{ /def dabbrev_complete = \ /let prefix=$(/last $[kbhead()])%;\ /internal_dabbrev_complete /def dabbrev_continue = \ /let prefix=$(/last $[kbhead()])%;\ /let prefix=$[strcat({prefix}, " ")] /def internal_dabbrev_complete = \ /test regmatch(strcat("([^", complete_wordseps, "]*)\$"), prefix)%;\ /let prefix=%{P1}%;\ /let pattern=$[strcat("(^|[", complete_wordseps, "])", prefix, "([^", complete_wordseps, "]*)")]%;\ /let line=$(/recall -mregexp /1 %{pattern})%;\ /if (regmatch(pattern, line)) \ /test input({P2})%;\ /else \ /echo % couldn't match %{prefix}%;\ /endif /def -b'^I' = \ /if (kbpoint() = 0) \ /dokey page %;\ /else \ /test kbgoto(kbwordleft())%;\ /test kbgoto(kbwordright())%;\ /dabbrev_complete %;\ /endif