On Fri, Jul 2, 2021, at 7:54 PM, Silas McCroskey wrote: > > In any case, Plan 9's ed has a nice "browse" command which sam can't match. > > I used to issue "0bn", then just "b" once per page. Or, if you don't want > > line numbers, leave out the "n". > > "+,+20p" does it. Doesn't work near the end of the file, though; not > sure if that can be improved within the same expression or you just > have to know to "+,$p" instead.
Good point, I'd forgotten about that. I used to do it or something like it, but hated having to change the expression for the last page, especially when I didn't know the last page was next. > I agree with the camp that considers using line numbers (other than 0) > in sam (and ed, for that matter) to be something of an anti-pattern, > so I stopped letting the lack of 'n' bother me a long time ago. I'm > sure that's not much help for someone who's admitted to giving up on > regex though; you've got me curious how difficult it'd be to add it. Yup. If I was entirely comfortable with regexes, I would never have mentioned line numbers. ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/T716c5aa0e2aa8a27-M169fdcccbdad2b6c481dfa4b Delivery options: https://9fans.topicbox.com/groups/9fans/subscription