Post B4iFKIjd3pAplkdiNs by justine@snac.smithies.me.uk
(DIR) More posts by justine@snac.smithies.me.uk
(DIR) Post #B4iFKIjd3pAplkdiNs by justine@snac.smithies.me.uk
0 likes, 0 repeats
Thanks Russ ! ;)CC: @r1w1s1@snac.bsd.cafe
(DIR) Post #B4j4lcJ3UwNPwwzasa by mischa@exquisite.social
0 likes, 0 repeats
@RussSharek @justine you beat me to it. :))
(DIR) Post #B4j4lcYeYwqyjKI3Bw by thorstenzoeller@exquisite.social
0 likes, 0 repeats
@mischa @RussSharek @justine To quote from my wishlist[^1] of things I would like to have:"A minimal vi(1)-like editor. What I have in mind is pretty much plain vi/nvi, just a little less minimal – something like vi + Unicode support + multiple undo + syntax highlighting (the last one is debatable). In particular, it should be a lot more lightweight than Neovim or even Vim; I don’t care about extensibility, for instance."I have used nvi more or less exclusively for a couple of years; it is just a little (though really not much) too minimal for my taste.[^1]: https://thorstenzoeller.com/wishlist/
(DIR) Post #B4j4lcoFcxKXVhaVVI by gumnos@bsd.cafe
0 likes, 0 repeats
@thorstenzoeller modern vi/nvi ticks most of those boxes (more minimal, something like vi, Unicode support) just missing the syntax-highlighting. That said, if you want ephemeral colorization, you can pipe your buffer to bat(1) or pygmentize(1) to display particular regions like:'a,'bw !bat -l awk:'a,'bw !pygmentize -l py@mischa @RussSharek @justine
(DIR) Post #B4j4ld3UiHWWGyigGO by r1w1s1@snac.bsd.cafe
0 likes, 0 repeats
@gumnos@snac.bsd.cafe Thanks for the tip! I always appreciate your approach of reaching for small, focused Unix tools before anything else — very much in the spirit of the Unix philosophy.I tested it with nvi on Slackware using source-highlight from SlackBuilds.org::'a,'bw !source-highlight -s sh -f escHowever nvi doesn't render ANSI escape codes in its output pane out of the box. The issue is in filter_ldisplay() in ex/ex_filter.c — it sanitizes output through KEY_NAME() which converts ESC to ^[.I'm working on a small patch that detects ANSI sequences and switches nvi to ex screen mode before writing, so the terminal renders colors correctly. Early results look promising!#nviCC: @thorstenzoeller@exquisite.social @mischa@exquisite.social @RussSharek@mastodon.art @justine@snac.smithies.me.uk
(DIR) Post #B4j4ldJnjeZF5YLhgG by gumnos@bsd.cafe
0 likes, 0 repeats
@r1w1s1 Hah, I was just in the middle of composing a reply to similar effect.I just discovered that vi/nvi seem to consume ANSI-sequence output from executed programs.I usually use bat/pygmentize from within ed(1) and assumed they'd work the same, but testing them just now, it was an exercise in frustration watching bat/pygmentize emit the right things (I could colorized pipe output to hexdump and see the right output data, but when vi/nvi received it, it stripped the ANSI sequences off).Sorry for the minor boondoggle! (at least until your patch is in place ☺)@thorstenzoeller @mischa @RussSharek @justine
(DIR) Post #B4j4ldVV29vPfpp2um by justine@snac.smithies.me.uk
0 likes, 0 repeats
Haha ! There was me thinking that I was doing something wrong trying your bat example.CC: @r1w1s1@snac.bsd.cafe @thorstenzoeller@exquisite.social @mischa@exquisite.social @RussSharek@mastodon.art