6 ms·
Show HN: Tome, aka Tom's Editor – a new command-line text editor
- Avshalom 3y agoI know this isn't an original nit-pick but a cli editor is like ed, this sounds like a screen editor.
- deleted 3y ago[deleted]
- boutell 3y agoI seem to recall people calling ed a "line editor" back in the dino days, but yeah I erred on the side of comprehensibility over historical accuracy.
- Avshalom 3y agoed is a line editor in the sense that all of it's commands act on a \n delimited line at a time (compare to say sam/acme's commands that act on a selection and treat \n as just any other character, I can't say much about teco). I completely understand the conflation of cli and "uses a terminal" of course it is the goddamned year our our lord two thousand dickity twenty three after all, can't fight the jargon drift forever; I just think there is still room in the world for a new text editing command language that exists independent of a particular visual representation.
- dllthomas 3y ago> can't fight the jargon drift forever Within reason, yeah. But it's obnoxious to have the ambiguity, and what term do we use now for an editor that you interact with from the shell's command line (eg. sed, I guess?), or principally from its own command line (eg. ed)? While we're at it, if we're coining new terms, ideally we could distinguish those two. sed in particular is "the streaming editor" but "streaming" isn't the category I'm looking for, which would also include something like nmh for mail (vs the traditional mail client behaving like ed, or things like mutt/pine that run in the terminal but provide more of a GUI that happens to be rendered in text).
- Someone 3y ago> ed is a line editor in the sense that all of it's commands act on a \n delimited line at a time I don't think that’s fully correct. https://en.wikipedia.org/wiki/Line_editor https://en.wikipedia.org/wiki/Line_editor (emphasis added): “a line editor is a text editor in which each editing command applies to _one_or_more_ complete lines of text designated by the user” Also, ed commands all can work on multiple lines by prefixing them with an address range. For example, 1,4l will output the first four lines of the file to the output device. I also think a defining feature is that line editors don’t automatically show a full screen of the document because they’re designed to be usable on a teletype, where printing a line took about 10 seconds. In fact, even just outputting the current line after each command was considered wasteful.
- PH95VuimJjqBqy 3y ago> of course it is the goddamned year our our lord two thousand dickity twenty three after all please stop ... my sides ... I'm in stitches.
- nerdponx 3y agoI think people call this a "TUI" now.
- ThouYS 3y ago"written in node.js" - insert squidward packing his chair meme
- deleted 3y ago[deleted]
- disintegore 3y agoThat's a 40mb runtime that's probably already on your system
- deleted 3y ago[deleted]
- boutell 3y agoHey, your mileage will vary! My workday includes Node.js being present on basically everything, so it's not overhead for me. (As others have pointed out it's also not that heavy a thing to have around, especially compared to Electron)
- 3836293648 3y agoIt's absolutely overhead on your poor cpu though
- 3y ago
- danielvaughn 3y agoHonestly I really want to make one. Mostly because I want to stay in my terminal as much as possible, but I'm super fast with VSCode's keybindings and I can't handle the velocity drop during the learning curve. Alternatively, if it's possible to emulate VSCode's keybindings in an existing editor, I'd be happy to go that route. I just don't know the space very well.
- mplanchard 3y agoemacs and vim work well in the terminal and are almost certainly customizable enough to mimic the VSCode keybindings, /but/ definitely not without a velocity drop while you get everything set up as you like it
- boutell 3y agoYes, you're in for some disappointment there alas: many terminal applications, especially macOS terminal, will devour most cool combinations of the "meta" keys (shift, control, alt, command...) for themselves. This is why I had to make a slightly modal "select mode" entered with the escape key. I'm still trying to make it mostly familiar but 100% vscode keybindings isn't possible.
- hmry 3y agoThat just means you'll need to write a terminal emulator as well :)
- LispSporks22 3y ago> const tabSpaces = 2; Shots fired. Building your own editor is a fun project for sure. Curious with node whether you can build it into a single executable that you can, for example, conveniently scp around to host:.local/bin/
- deleted 3y ago[deleted]
- boutell 3y agoYou probably noticed that ".editorconfig" support is in the plan, so this won't be forced forever, but it's good for proving out various indentation features. There are ways to make a binary/flatpack/etc., but since Node.js is used by many things it probably makes more sense not to. Notably debian 12 ships with Node.js 18, which will probably be supported by tome for as long as it's supported by debian e.g. quite a while.
- deleted 3y ago[deleted]
- thisismyhna 3y agoMade my own CLI text editor as well this year using rust following this: https://www.flenker.blog/hecto/ https://www.flenker.blog/hecto/ Building tools like this is great practice for learning new languages.
- deleted 3y ago[deleted]
- bajsejohannes 3y agoI haven't read about hecto (yet), but I can thoroughly recommend the one about kilo, which is linked in the first paragraph of that article http://antirez.com/news/108 http://antirez.com/news/108 . Or even just reading the C code. It's achieving a lot with few lines and no dependencies (outside of the OS, that is)
- btown 3y agoJust wanted to share that this is one of the best tutorials that I've read in quite a while! Super clear writing style, the use of diffs for each stage (as well as showing the progression via different tags in the repository) is incredible (and something I may borrow in the future!), and you do a great job walking the reader through the complexities of Rust in an approachable way. Really, really cool.
- lagniappe 3y agoYes! We need more "because I can" and "because I wanted to" in this. More art, less ... idk what to say here ... less formality. Some of the most fun projects I've done were ones that I knew already existed but I just had to -know- what it'd be like to write one. Good work Tom :) I'll give it a shot BECAUSE I CAN!
- deleted 3y ago[deleted]
- deleted 3y ago[deleted]
- kesava 3y agoThat’s awesome! Can someone point me to a similar minimal web/editableContent implementation? Would love to learn from it.
- alexbezhan 3y agoCRM from scratch - https://www.youtube.com/watch?v=l4QjeBEkNLc https://www.youtube.com/watch?v=l4QjeBEkNLc (Shameless plug)
- boutell 3y agoThe heavy part is contenteditable is usually a million workarounds for weird browser specific stuff, which is why DIY is very risky there… or it was. I haven’t explored contenteditable from scratch since the final death of IE11. Might not be as crazy today.
- tuatoru 3y ago> Maybe should be THE (Tom's Hubristic Editor). A TUI editor called THE already exists: The Hessling Editor, a work-alike of xedit. 1. https://hessling-editor.sourceforge.net/ https://hessling-editor.sourceforge.net/
- deleted 3y ago[deleted]
- deleted 3y ago[deleted]
- forgotpwd16 3y agoIt's already pretty nice. Very fast, CUA shortcuts (that are also shown at bottom), indeed very few dependencies. Good work.
- boutell 3y agoThanks!
- uwagar 3y agoin go or rust?
- habibur 3y agoThat was the first thing I checked and surprisingly it's JS/node. That kills it for me. Terminal apps in Python or JS works but are significantly slower, and you can feel it. Talking in general. Not this one. I haven't tried this one.
- boutell 3y agoIt feels zoomy so far. v8 is quite fast to start with. But we’ll see.
- ripperdoc 3y agoShould run it with bun instead of Node.js for that extra speed!
- boutell 3y agoGive it a try and let me know what happens!
- jenkstom 3y agoIt's pretty easy to say "terminal based" or "text mode" instead of CLI, which is misleading. I was expecting an alternative to sed.
- deleted 3y ago[deleted]
- worksonmine 3y ago> Written in Node.js with practically no libraries (certainly no Electron) Still V8 though.
- LoganDark 3y agoThe bulk of Electron is the browser engine. V8 is nothing.
- Svip 3y agoGiven the description, this sounds more TUI than CLI. Honestly, when I saw the title, I thought it was a competitor to ed(1).
- boutell 3y agoIf I could edit that now I would
- deleted 3y ago[deleted]
- hackncheese 3y agoThe THE lul
- n3storm 3y agoNo screenshot, no joy
- rickydroll 3y agowhy?? TECO (now TECOC Type Every Character Over Constantly) is perfection as a cli editor https://github.com/blakemcbride/TECOC https://github.com/blakemcbride/TECOC seriously. try it.
- hobo_mark 3y agoAll I want is nano with VSCode keybindings for multiple cursors. Does is exist or do I also have to write my own?
- urtrs 3y agoI think micro is like that https://github.com/zyedidia/micro https://github.com/zyedidia/micro
- bpiche 3y agoMicro is excellent. I love it. Been using it for years and can't go back to vim. - Modern keybindings and shortcuts - mouse support, scrolling support - copy/paste from the clipboard - syntax highlighting - supports extensions All out of the box. Just wish the community extensions were more numerous but haven't written any myself and won't complain. edit: Try tome! Dont' want to hijack this thread
- autoexec 3y agoI've been using micro a lot recently and it's pretty impressive. I really have no complaints.
- bPspGiJT8Y 3y agoYou can try Kakoune or Helix.
- bpiche 3y agoHelix is NICE. Thank you
- jbritton 3y agoDoes this use a TUI library or does it directly implement the console I/O?
- Solvency 3y agoThere is already a Tome. http://tome.app http://tome.app
- apgwoz 3y agoIt's pretty hard to find a name that isn't already _something else_. Not impossible, but hard. Your tome.app at least isn't an editor, so...
- Solvency 3y agoI mean. Tomedit. Tomale. Lots of words to play with.
- PrimeMcFly 3y agoand no real reason to if he likes the one he chose.
- forgotpwd16 3y agoConsidering there're many projects named tome in github (and not, such as the same named tomeapp.com) linked app has probably done some good marketing/SEO to come as first result in searches.
- 29athrowaway 3y agoTerminal != Command line
- pepa65 3y agoI just do not knowingly use anything that has to be installed with npm.