Live data from Hacker News

ASCII art for semantic code commenting

asciiflow.com

81–82 of 82 posts

Re: ASCII art for semantic code commenting

#81

For what it's worth, I keep a file in my home folder containing some box drawing characters. It's not super fast to draw by copy-paste but the result usually looks quite nice. ─ │ ┌ ┬ ┐ ┄ ┆ ├ ┼ ┤ ╲ ╱ ┈ ┊ └ ┴ ┘ ━ ┃ ┏ ┳ ┓ ┏ ┯ ┓ ┏ ┳ ┓ ┏ ┯ ┓ ┅ ┇ ┣ ╋ ┫ ┣ ┿ ┫ ┠ ╂ ┨ ┠ ┼ ┨ ┉ ┋ ┗ ┻ ┛ ┗ ┷ ┛ ┗ ┻ ┛ ┗ ┷ ┛

Vim has digraphs for all of these characters, which I like to use. e.g. you can get ┌ with dr (d = down, r = right), and ┨ with Vl (V = heavy vertical, l = left). To find the mappings, :digraphs shows the whole list, or copy this block of text and put the cursor over any of the characters in normal mode and type ga and it’ll echo things like “ 9504, Hex 2520, Oct 22440, Digr Vr”. (I use a Compose key for almost all c…

I know, I've used them in the past. However, I get annoyed by having to remember the exact sequence for the character I want. And often, when drawing a line, I'll just copy some characters that are already there anyway.

Also, I tend to jump a lot between editors/IDEs nowadays so I prefer workflows that don't depend on a specific tool.

Post reply on HN