Post B6s5ryAJYjw0p4uxOa by mwl@io.mwl.io
 (DIR) More posts by mwl@io.mwl.io
 (DIR) Post #B6rZtuTp2FdjRGvKfg by rl_dane@polymaths.social
       0 likes, 1 repeats
       
       I came across a problem in #ed where I couldn't change a url, because it was full of slashes, which made the substitution command fail. I popped into vi to make that change, but then thought about how I might do it in ed in the future.What I realized is that I could split the lines where the URL stops and ends, replace the line that had just the URL itself (pasting in the new URL without having to backslash-escape the slashes), and then re-join the lines.Of course, NOW I just realized I could've done s,([^)]*),(new_url), instead, but whatevs, lolrld@Intrepid:~$ edaHere is some text    I need to change [this link](https://example.com/some/stuff/here), ok?some more text.,n1Here is some text2I need to change [this link](https://example.com/some/stuff/here), ok?3some more text2s/(/(\/,n1Here is some text2I need to change [this link](3https://example.com/some/stuff/here), ok?4some more text3s/)/\ )/,n1Here is some text2I need to change [this link](3https://example.com/some/stuff/here4), ok?5some more text2ahttps://archive.org/details/plan9designintro/mode/2up.,n1Here is some text2I need to change [this link](3https://archive.org/details/plan9designintro/mode/2up4https://example.com/some/stuff/here5), ok?6some more text4d,n1Here is some text2I need to change [this link](3https://archive.org/details/plan9designintro/mode/2up4), ok?5some more text2,4j,n1Here is some text2I need to change [this link](https://archive.org/details/plan9designintro/mode/2up), ok?3some more text
       
 (DIR) Post #B6rfF62rjN1L9yEkUK by ed1conf@bsd.network
       0 likes, 0 repeats
       
       @rl_dane In case you need it, the s command also takes a count as a flag, allowing you to do the Nth replacement without touching the other matches:$ ed  a  xxxxx  .  s/x/X/4p  xxxXx
       
 (DIR) Post #B6rzeWaw9hSNpBZm1A by rl_dane@polymaths.social
       0 likes, 0 repeats
       
       @ed1confWHAAAAAT.rld@Intrepid:~$ echo hello |sed 's/l/7/2'hel7orld@Intrepid:~$ DAAAAAANG! XD
       
 (DIR) Post #B6rzeWmdSCoYPT37Fg by ed1conf@bsd.network
       0 likes, 0 repeats
       
       @rl_dane Yep, one of the ed(1)/sed(1) features that unfortunately didn't get carried over to vi/vim
       
 (DIR) Post #B6s4dPAsl2nwIBfsjQ by jbowen@mast.hpc.social
       0 likes, 0 repeats
       
       @rl_dane @ed1confIt makes me so excited that you've been genuinely using ed(1) lately! The better you understand it, the better you'll understand it's descendents and relatives.I'd like to plug @mwl's "Ed Mastery" if you aren't aware of it: https://www.tiltedwindmillpress.com/product/ed/Even if you're already an ed(1) master, it's a fun, quick read and supports one of the greatest Unix authors around.
       
 (DIR) Post #B6s4dPRBmPqf6lIu9I by mwl@io.mwl.io
       0 likes, 0 repeats
       
       @jbowen @rl_dane @ed1conf :flan_blush: awww, thank you!
       
 (DIR) Post #B6s5rxbvcaQf6QpUnY by rl_dane@polymaths.social
       0 likes, 0 repeats
       
       @mwl @jbowen @ed1confJust FYI, I can't seem to do any highlighting on the .kepub version of the book on my Kobo Clara Color. It lets me select text, even pick a color, and then it just goes *poof*Even when trying to create a note, the same thing happens. Nothing listed in the annotations section, either.I don't know if that's something you can look into, might be an issue with the conversion pipeline? :BlobCatBlush:The regular epub version does, but for some reason, the font is abnormally large on that. Don't know if that's just a Kobo thing.
       
 (DIR) Post #B6s5ryAJYjw0p4uxOa by mwl@io.mwl.io
       0 likes, 0 repeats
       
       @rl_dane @jbowen @ed1conf that's really odd!I have not heard of such a problem before, and I don't have a kobo to reproduce.Did you buy it from kobo or elsewhere?
       
 (DIR) Post #B6s6RVW7YBMUOf3yjo by rl_dane@polymaths.social
       0 likes, 0 repeats
       
       @mwl @jbowen @ed1confNo, I got it from tiltedwindmillpress.com
       
 (DIR) Post #B6s6RVkeg8zJ7jraOO by mwl@io.mwl.io
       0 likes, 0 repeats
       
       @rl_dane @jbowen @ed1conf thank you for buying direct, first of all.and that eliminates my ability to blame it on the kobo store, dang it. :flan_wink: Truth is, I have no idea what's wrong? Annotation should be a function of the device, not the file? The books are DRM-free and as unlocked as I know how to make them.
       
 (DIR) Post #B6s6VlN2Y6xiiwqSEi by jbowen@mast.hpc.social
       0 likes, 0 repeats
       
       @mwlTangential question: what's the preferred outlet for getting a hardcover version of Ed Mastery? I was a bit surprised it wasn't on Tilted Windmill (unless I missed something).@rl_dane @ed1conf
       
 (DIR) Post #B6s6ynDMlwkiqCA93o by rl_dane@polymaths.social
       0 likes, 0 repeats
       
       @mwl @jbowen @ed1confYou're welcome!Yeah, I'm guessing it's some kobo EPUB (not DRM) black magick... some kind of metadata their reader doesn't like or something. Not a big deal. ;)I wish I knew why the Kobo was interpreting the font size of the regular .EPUB as so huge. It looks fine when I view it in zathura (uses mupdf to render epubs) :D
       
 (DIR) Post #B6s6ynOM75XjOHIvBo by mwl@io.mwl.io
       0 likes, 0 repeats
       
       @rl_dane @jbowen @ed1conf The first lessons of this business:- epub standards aren't standard.- every reader developer makes their own idiosyncratic choices for reasons that seemed perfectly good at the time.- we are all doomed.
       
 (DIR) Post #B6s7EW10UFC68CsXey by rl_dane@polymaths.social
       0 likes, 0 repeats
       
       @jbowen @mwl @ed1confIt is on there, and they even have a print/epub combo. ;)https://www.tiltedwindmillpress.com/product/ed/P.S. love the snark on the Manly McManface edition, Michael. XD(I almost bought that version ;)
       
 (DIR) Post #B6s7EWFtat6UsNqQro by mwl@io.mwl.io
       0 likes, 0 repeats
       
       @rl_dane @jbowen @ed1conf that's the print version, but it's paperback.I haven't got around to doing a hardcover version in that store yet, sadly. Every printer requires unique versions of the book files. I'm working through the backlist as time permits.
       
 (DIR) Post #B6s7L3YKhxUnsqaNKi by rl_dane@polymaths.social
       0 likes, 0 repeats
       
       @ed1confIn both nvi and vim, the number at the end seems to be interpreted as a repeatIn both programs, I typed in "this is some text", then issued yy5p, went back to line 1,and issued :s/s/5/3The result was:thi5 is some textthi5 is some textthi5 is some textthis is some textthis is some textthis is some textBTW, r !command always seems to append the output to the end of the file. Is there not a way to insert it above/below the current line, instead?a !command would be nice. ;)
       
 (DIR) Post #B6s7L3nDobPCd1YGXY by ed1conf@bsd.network
       0 likes, 0 repeats
       
       @rl_dane Yes, using the numeric flag in vi/vim does the weird multi-line thing (which could just as easily have been done with a proper range at the front).As for reading in a file, it defaults to reading at the end of the file, but you can prefix the r with the line you want it to read after:5r !date?put calendar below here? r !cal  'b r !whoamiYou can even abuse it likeg/pattern/. r !dateto read in the date after every line matching /pattern/ :flan_evil:
       
 (DIR) Post #B6s7bLm4jCc31wmbya by jbowen@mast.hpc.social
       0 likes, 0 repeats
       
       @mwl @rl_dane @ed1confAh, thank you for the background. Are the versions on Strand and Amazon "official?"
       
 (DIR) Post #B6s7lVaV65gmMUDGOu by mwl@io.mwl.io
       0 likes, 0 repeats
       
       @jbowen @rl_dane @ed1conf yep! I sell through any channel that'll have me, unless they offer a bad deal.
       
 (DIR) Post #B6s8HUJjM9XRgicN4S by jbowen@mast.hpc.social
       0 likes, 0 repeats
       
       @mwl @rl_dane @ed1confI have a dream of getting to meet you at BSDCan or something and asking if you would sign it :) I was in a phase of just getting electronic copies when it first came out, and also for whatever quirk of my firmware I prefer hardbacks for signing over paperback.
       
 (DIR) Post #B6s8YyH3ENUNWJhXOK by mwl@io.mwl.io
       0 likes, 0 repeats
       
       @jbowen @rl_dane @ed1conf Bring it, I'll sign it!
       
 (DIR) Post #B6s8neTx6CVyTqjgq8 by jbowen@mast.hpc.social
       0 likes, 0 repeats
       
       @mwl @rl_dane @ed1confI shall!