<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: aadenboy</title>
    <description>The latest articles on DEV Community by aadenboy (@aadenboy).</description>
    <link>https://dev.to/aadenboy</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2481970%2Ffc6958e1-9005-4ac8-9539-aa88b0ed0435.png</url>
      <title>DEV Community: aadenboy</title>
      <link>https://dev.to/aadenboy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aadenboy"/>
    <language>en</language>
    <item>
      <title>Turning VSCode Into an Art Program (sorta)</title>
      <dc:creator>aadenboy</dc:creator>
      <pubDate>Sun, 01 Dec 2024 21:09:18 +0000</pubDate>
      <link>https://dev.to/aadenboy/turning-vscode-into-an-art-program-sorta-43o0</link>
      <guid>https://dev.to/aadenboy/turning-vscode-into-an-art-program-sorta-43o0</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;If you just want to try out the plugin, go to &lt;a href="https://marketplace.visualstudio.com/items?itemName=aadenboy.box-art-draw&amp;amp;ssr=false#overview" rel="noopener noreferrer"&gt;aadenboy.box-art-draw&lt;/a&gt; on the VSCode Marketplace. Feedback would be appreciated!&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Brief introduction
&lt;/h2&gt;

&lt;p&gt;I'm sure that if you've ever used any form of textual interface, you'll be familiar with Unicode's box drawing characters. Back when we didn't have fancy GUIs and were limited to the text that was on the screen, we made do with the various characters that when put together could be formed into boxes, menus and tables.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F08xop5zx5gic0zs7px78.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F08xop5zx5gic0zs7px78.png" alt="Unicode characters U+2500 to U+257F, or the Box Drawing block" width="680" height="322"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Even today, they're still in extensive use, most commonly for command line programs such as btop, tmux, tig and various others. Take a look at btop:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp6mpzvdd65rccstugm4m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp6mpzvdd65rccstugm4m.png" alt="I really like this image of btop's interface" width="800" height="386"&gt;&lt;/a&gt;&lt;sup&gt;&lt;a href="https://commons.wikimedia.org/w/index.php?curid=136037450" rel="noopener noreferrer"&gt;By Konung yaropolk - Own work, CC0&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;

&lt;p&gt;Despite their significance, there doesn't seem to be a reliable way to actually &lt;em&gt;draw&lt;/em&gt; with these characters. The only example of this I could find was &lt;a href="https://github.com/MarkLodato/js-boxdrawing" rel="noopener noreferrer"&gt;Mark Lodato's &lt;em&gt;js-boxdrawing&lt;/em&gt; repo&lt;/a&gt; and its &lt;a href="https://marklodato.github.io/js-boxdrawing/" rel="noopener noreferrer"&gt;live demo&lt;/a&gt;, which is surprising. The demo itself is actually fine as-is for getting quick diagrams and such done, but it still has its fair share of menial quirks.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fix92fvv0h8l8q2ox4i3e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fix92fvv0h8l8q2ox4i3e.png" alt="What the hell happened to my line?" width="473" height="273"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, out of spite and boredom, I took it upon myself to recreate Mark Lodato's work. In VSCode. I'm not going to use the web for this, no workflow would ever be happy about that.&lt;/p&gt;




&lt;h2&gt;
  
  
  Making the Extension
&lt;/h2&gt;

&lt;p&gt;The first goal was just getting the cursor to even draw. Hooking up all the keybinds was simple enough, no issues there. But then came to &lt;em&gt;how&lt;/em&gt; it'd draw the lines. A simple solution would be to check both the starting and ending location, then using the current character and a lookup table to find the end result.&lt;/p&gt;

&lt;p&gt;A lookup table.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;For all &lt;b&gt;1.7 THOUSAND POSSIBLE COMBINATIONS&lt;/b&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I spent probably three hours wasting my time manually copying and pasting all of that.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foj0njzg5qkmclhjwg9nl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foj0njzg5qkmclhjwg9nl.png" alt="Just a glimpse" width="767" height="446"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With wasted time and life out of the way, the rest of the extension simply slotted into place, allowing me to publish v0.0.1 of the extension on November 10th. The only existing footage of the extension then was the animated title, which itself is sped up.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj4w1m21jdi22ht8f2ncq.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj4w1m21jdi22ht8f2ncq.gif" alt="Spelling " width="654" height="296"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Afterwards, I was able to then implement painting over lines and fix some minor bug fixes within a day. Hyperfixation is one hell of a motivator.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2a80r1hphj2x6htqxhke.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2a80r1hphj2x6htqxhke.png" alt="One day difference between v0.0.1 and v0.0.2" width="353" height="98"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It was in the middle of implementing v1.0.0 that the motivation had worn off and I procrastinated working on it because I had some issue implementing procedural drawing. There was a sense of dread as well, which wasn't fun. Anywho, I eventually succumbed and finished with that I worked out a better solution to my problem and released v1.0.0.&lt;/p&gt;

&lt;p&gt;Quick anecdote: Somewhere whilst adding transformations for v1.0.0, I realized that I could use the extension itself to build the lookup table. That was quite fulfilling!&lt;/p&gt;




&lt;h2&gt;
  
  
  Okay... What About the Extension Itself?
&lt;/h2&gt;

&lt;p&gt;The extension is mainly hotkey-based, you don't often use your mouse for much. Pressing Ctrl+Alt+Insert toggles between drawing and typing, and your keyboard changes functionality when drawing.&lt;/p&gt;

&lt;p&gt;N, B, K and Delete all switch between the different line styles, those being Normal, Bold, Double and Erase respectively. The arrow keys allow you to actually draw lines, and by holding Shift and or Alt, you can draw in-place and or paint over lines.&lt;/p&gt;

&lt;p&gt;That's about as much as you would really need, but I also allowed support for multi-cursor editing, and pressing P with Shift, Alt or Ctrl to paint entire lines in one click.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjffhv7lejz5dslvcqnmf.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjffhv7lejz5dslvcqnmf.gif" alt="Example" width="322" height="324"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Faadenboy%2Fvscode-unicode-box-art%2Fraw%2FHEAD%2Fgallery%2Ftable.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Faadenboy%2Fvscode-unicode-box-art%2Fraw%2FHEAD%2Fgallery%2Ftable.gif" alt="Drawing a table with the extension" width="364" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have more features and gestures planned for the extension, namely more QoL and additional ways to draw shapes.&lt;/p&gt;




&lt;h2&gt;
  
  
  Your Turn
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Download or install at &lt;a href="https://marketplace.visualstudio.com/items?itemName=aadenboy.box-art-draw&amp;amp;ssr=false#overview" rel="noopener noreferrer"&gt;aadenboy.box-art-draw&lt;/a&gt; on the VSCode Marketplace. Feedback would be appreciated!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Obviously, I wouldn't be telling you this if it hadn't already been out yet, so this is the part where YOU try it for yourself and give your personal feedback!&lt;/p&gt;

&lt;p&gt;The extension has gathered 9 installs and 14 downloads, yet no reviews, something that isn't very helpful. I want to know what people think! Again, if you can, try the extension in VSCode and give your thoughts and suggestions. I love any feedback I can get!&lt;/p&gt;

&lt;p&gt;If you feel inclined, the source code is also available &lt;a href="https://github.com/aadenboy/vscode-unicode-box-art" rel="noopener noreferrer"&gt;on GitHub&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;wow! first blogpost! cool! hello dev.to community&lt;/p&gt;

</description>
      <category>vscode</category>
      <category>devlog</category>
      <category>productivity</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
