💾 Archived View for bbs.geminispace.org › u › stack › 13098 captured on 2023-12-28 at 16:09:19. Gemini links have been rewritten to link to archived content
-=-=-=-=-=-=-
@oldernow: many thanks. I can't believe there are no simple linux utils to do that! FreeBSD has fmt -c, but it does not work in linux to center...
vim does have a %center command...
There is a linux utility called 'boxes', should be in most repos. It comes with simple ones, and a bunch of ridiculous ASCII-art boxes too...
20 hours ago
@stack Oh wow, didn't know about vim's "center", although needing to specify a width or go with an ugly default seems a bit more work than my script, which bases the centering on length of the longest line in a set. But I could easily be not completely understanding vim's "center"
After a more careful RTFMing, the boxes utility will actually center text too. It comes with dozens of stupid presets, and you can make your own desings. And it integrates into vim's visual mode nicely. Not to poo-poo your code - I have tons of utilities I wrote that later turn out to be unnecessary as someone already did it in 1982...
— https://boxes.thomasjensen.com/editors-vim.html
Thin and to the point — [preformatted]