6 ms·
Show HN: Vixl44 – Create pixel art inside your terminal using vim movements
- flanbiscuit 9y agoNice. Reminds of the ANSI Art I would see on a BBS back in the day. Is there a way to export the art so that it could be printed in the Terminal. Would love to add some art to some scripts
- fenwick67 9y agoI have worked on libraries for images in terminals [https://github.com/fenwick67/term-px https://github.com/fenwick67/term-px] but I never thought to make a simple image import / export tool so you could just `cat` the file to show it in a terminal. Now you gave me a weekend project.
- laumars 9y agoThere's already a few out there that does this. I use pixterm in one of my own projects: http://github.com/eliukblau/pixterm http://github.com/eliukblau/pixterm
- sebashwa 9y agoWow, cool project! If you want to collaborate on vixl44 for the feature to export something terminal-printable, feel free to do so
- fenwick67 9y agoFor those playing at home, I just made this work: https://codepen.io/fenwick/full/oGVQNX/ https://codepen.io/fenwick/full/oGVQNX/
- sebashwa 9y agoThis is great! I will go ahead and write a similar export function for vixl44.
- laumars 9y agoIt might be worth using the none standard but we'll supported true colour ANSI escape sequences. You'll get much better output that way (I've done lots of experimenting with images in the terminal and I found that gave me the best output and more reliably then the other ANSI hacks that are limited to only supporting one specific terminal emulator)
- jessemillar 9y agoYou should totally make a GitHub issue for that feature suggestion.
- sebashwa 9y agoThanks! Beautifying scripts is a usecase that didn't come to my mind so far. Awesome idea, I don't know why I didn't think about it! So far it is only possible to write your image to a file (which is just some json) or to export to svg, but it shouldn't be much trouble to get something which can be printed to terminal!
- sebashwa 9y agoHey just FYI: This is now possible with :exp FILENAME.ansi which dumps the corresponding ANSI escape sequences to a file
- twoquestions 9y agoThis looks pretty cool! Pens/mice are great for analog style art (digital painting and the like), but for highly discrete art like pixel art a keyboard looks to be a much better interface at first blush.
- v-yadli 9y agoBrainstorm: what if we really make a vim plugin for pixel art? I see this to be hugely practical. It will enable rapid charting in source code documentation, and also, solve the table formatting problem once and for all. Edit: shapes? Patterns? Gradients? Dithering? (Think about cacao) lasso tool? Semantic movement? Like, w moves over all reddish blocks
- sebashwa 9y agoWow, I never of this being practical in vim. That's an awesome idea! Although I'm not sure it would be 'high res' enough to work for inline code documentation.. If that is what you meant? Also I love the idea of semantic movement, I'll definitely put it on my feature-list!
- nameless912 9y agoActually, I've been looking for something forever that will do block diagrams in a sane way in vim. If you could get that to work I would literally organize a parade in your honor.
- v-yadli 9y agoYes, for example if we can do tables with color-background text, it would save columns to draw the column boarders. :) Even if we go with monochrome charts, it will be super useful for describing data structures and visualizing algorithms. Also, looking forward to the semantic movement implementation!
- abhirag 9y agoNice. 'Course there's an Emacs mode to do that. Good ol' M-x artist-mode. Relevant xkcd -- [https://xkcd.com/378/ https://xkcd.com/378/] Jokes aside, maybe you can use that for inspiration :)
- v-yadli 9y agoHere we go again butterfly! Thanks for bringing this up, indeed we may get the goodbits from "the other side". I'm wondering if artist-mode can be used as a minor mode? Charts everywhere :)
- ramses0 9y agoIt would be great to have some buttons in C-v mode to "y, p, x" ... and maybe you could (ab)-use %/* while in visual mode to allow rotation or flipping? Love it!
- sebashwa 9y agoThanks for your comment! Yanking is one of the features I want to implement next! Something I already missed when drawing the first pictures or so! Cool idea to use %/* (or similar) to rotate/flip stuff! I only thought about replacing a certain color with another using %s/
- ramses0 9y agoAlso if you every played "adom" using "w<motion.hjkl>" could "word-ish" to the next color in that direction. I don't know how much you're still messing with it, but it's a fun problem to think about... transferring useful Vi motions and commands into a new problem domain.
- manbearpigg 9y agoThis is a clever idea. Good job! I would love to see a real vim plugin as v-yadli suggested.
- skocznymroczny 9y agoNext up: tell inexperienced people to try to exit Vim and use it as entropy source for random number generation
- kmnt 9y agoI think gvim already supports colour rendering of x pixmaps which double as C source code.