Hacker News new | past | comments | ask | show | jobs | submit login
Slap: Terminal-based text editor (github.com/slap-editor)
110 points by kolodny on Aug 26, 2014 | hide | past | favorite | 39 comments



Requires node.js ...

EDIT: oops I'm getting downvoted, sorry for mentioning the platform. For the record, I think that JavaScript is the perfect choice of language for a terminal text editor. I can't think of a single better language and platform.

:|


I think that what's objectionable about your comment is its absolute lack of information or anything that could possibly contribute to a discussion in any obvious way.

What do we make of Requires node.js...? The sentiment doesn't reflect an opinion, an argument or anything that wasn't obvious from looking at the repo.


It's gonna seem REALLY obtuse to install node.js on a machine that doesn't need node.js, just so you can do some regular maintenance.

If there is any value in a terminal text editor at all, it's the ability to operate that editor remotely. Unless the machine has node.js on it already, this is just crufty.

salp's choice of dependencies for what it is, is really oddball. I don't think there's any getting away from it.

I will agree that just dropping a "Requires node.js..." is kind-of a cheap trick. The idea being that people will read what they want and assume that's what the grandparent meant. But just because it's cheap, doesn't mean it's meritless.


> But just because it's cheap, doesn't mean it's meritless.

It has no merit as a contribution to the discussion (except maybe in the sense that people actually replied to it). For all I care, he could have a very well-founded basis for his opinion, but the fact remains that we will never know that from the body of his comment.

As for your arguments, I mostly agree, but personally I use vim (as opposed to non-terminal equivalents like gvim or macvim) locally since a lot of the work I do happens in a terminal anyway. By using it in the terminal, I can completely avoid managing windows in OS X while I work and either just drop vim to the background or use tmux to do the command line work relatively seamlessly.


"If there is any value in a terminal text editor at all, it's the ability to operate that editor remotely."

How can you take this for granted in this Vim world we live in?


It's not that you mentioned the platform, it's that the ellipsis - in lieu of any other commentary - seemed to itself be commentary on that platform, as if something should follow and the reader should know what.


No worries, here's the go version :) https://github.com/nsf/godit


That's because it is written in JavaScript and you need a way to interpret JS on your machine.

I suppose it should be possible to build a self contained executable, similarly with what node-webkit does.


What's the problem with that?


I think he may be worried that things like Atom didn't do so well, but the lack of a DOM will probably make things much faster.


What I like about the project is that it is written in JavaScript and open source.

But this:

    a Sublime-like file sidebar
You could as well say, a VIM like sidebar if you install the proper plugin. There is nothing "Sublime-like" about a sidebar, TextMate had this earlier, other editors too.

What is with the proliferation of these "Sublime-like" editors lately ? Can't they just stand on their own ? This really looks like a nice project and I don't see the need to pitch it with "Sublime like" features.

Also, I assume that a "Sublime-like" editor has at least some of the Sublime Text plugin capabilities. I've seen no mention of plugins on the project page.

Love this quote too:

    ... many other features that will make you leave nano, vim, and emacs behind


> There is nothing "Sublime-like" about a sidebar, TextMate had this earlier, other editors too.

I don't understand why every discussion like this devolves into a discussion over who did something first. It's completely irrelevant to the point. The quote you pulled says nothing about Sublime being the only editor to have a sidebar, or Sublime being the first editor to have a sidebar. It says that Sublime has a file sidebar, and this project has a file sidebar that is like Sublime. That is pretty basic statement of fact, your comments about other editors having sidebars is a complete non sequitur.


The "who did it first" stuff is always one of the most aggravating tangents in tech forum discussions. I truly just do not get it. Sometimes it's people reminiscing about computer history, which I usually enjoy, but most of the time it's someone who just wants to crap on whatever the thing being discussed is. It's a less downvotable way of saying, "I think this thing you just wrote is stupid, and my token excuse for saying this is because someone else did it before you, so nyah nyah nyah".

The canonical example IMO is the development of the modern GUI: in the '90s, people who liked to argue about dumb stuff would say that Windows is crap because it was "just a reimplementation" of Mac OS; this was usually followed up by some equally stupid argument from someone else about how the Mac was stupid because it was "just a reimplementation" of the Xerox Alto, and I'm sure that would be followed up by some primordial neckbeard claiming that the Xerox Alto was a steaming pile because it just a reimplementation of ENIAC with better graphics.

Also: GNU/Linux.


Thinking of it from the point of view of an academic, one generally credits the first to discover/build/describe/do something. It's part of placing things into context, which is an important element of academic discourse.

Wearing the academic hat, when I read something that fails to credit The First and instead credits someone else I think to myself, "this person is uninformed and doesn't really understand X..."


Hear, hear!

I tried desperately to suppress my "Shut the hell up you whiney bitch" response, but, alas, I have failed to do so in this case.


"... many other features that will make you leave nano, vim, and emacs behind"

Well, those three are basically identical, right?


It's a lot like saying that hinduism has features that will make you leave judaism, christianity and islam behind.

I guess nano doesn't have that kind of religious following, though. I certainly hope so.


Yeah, it's more like saying Hinduism has features that will make you leave Judaism, Christianity, and Chuck-E-Cheese behind.


The differences between Vim's windows and Sublime's drawer are big enough that it really is useful to differentiate between the two in this context. Vim's window splits are specific to the tabs that they appear in, while Sublime's drawer and (presumably) Slap's sidebar both cut across all tabs.

Plugins like NERDtree attempt to emulate Sublime's behavior using Vim-style windows. But although things are improving on that front, there are still some visible cracks in the implementation of the concept. The vi-like editors simply took a different evolutionary path, and this is one of the points where that shows.


> Sublime-like

Isn't that just VIM anyway?


I think Sublime Text was more influenced by TextMate than VIM. (I know that ST has a VIM like mode, vintage mode if I remember correctly).


Comments are harsh today, to me this is a very promising project.

Calling it The sublime Text text-based if it does not (yet?) have the features that defines Sublime (multiple cursors, split screen, fuzzy search/commands) might not be the best move.


I think a good chunk of the reason why people use Sublime is because it looks so damn good. I was hoping this would too, but I guess that's difficult with a terminal-based editor.

Also, anyone know which (if any) of the patched Powerline fonts [0] have the hand unicode icon? (It's slap's icon, and it looks ugly without it.)

[0] https://github.com/Lokaltog/powerline-fonts


Leave Emacs? Never, ever. A fool who thinks he could beat the power of Lisp! :P


I believe Lime Text that was mentioned here previously also has terminal support in addition to a couple different GUI front ends: http://limetext.org/contribute.html


Well it's interesting to see how to make a text editor in javascript (vs. one in C, for example my own: JOE). The top level libraries used seem to be: blessed, undo.js, cheerio (jQuery?), entities, lex, winston (logging), bluebird (promises), highlight.js, lazy.js (based on underscore), rc, fs, path, xtend, traverse, util, copy-paste.

I think I can see that there is heavy use of lazy.js to make string processing faster. Text buffer seems to be an array of lines...

The nearly complete lack of comments is amazing :-) The author should write some kind of hacking guide or similar documentation if he wants others to help with the project or at least to see how it works.


This is so freakin cool. I assume you will receive a lot of criticism from VIM die-hards for your key bindings. But I love it.

Good job!


Not only VIM but also UNIX people, because of ^C and ^Z.


I'm definitely hard-coded to not use ctrl+c or ctrl+z for copy/undo inside of a terminal, but I can see how this would make it easier for those just starting out to get used to terminal commands. Homogenizing our hotkeys with the ones used in GUIs isnt a bad thing, but it's certainly going to make things hairy for a while if more command line tools follow suit (how do I know which ones use which? Could lead to some very costly mistakes when I try to copy).


What options are out there for mouse integration on regular console vim? Or is it best to just run gVim/MacVim/etc?


:set mouse=a


Wow, life just got a lot better.


iTerm2 and vim work well together when you feel like using the mouse. Not sure what the situation is like in Linux though.


Nice! I've been waiting for a nice CUA terminal editor for a decade or more. So long that I wrote one in turbo vision about that long ago. The TV packages were removed however, so I've been using nano with sane key-bindings remotely, but they are always foobared when editing as root.


It exists since ages: ne (http://ne.di.unimi.it/)


Very nice. But consider a lot terminal people are living in Linux. A fork uses a language that's commonly bundled with Linux distros will be awesome.


I'm pretty sure most distros have node.js (albeit an older version) in their repos. I know Ubuntu has it for years now.


Well, I just tried to install it on Debian squeezy, but I couldn't find a nodejs package.


Here is the binary for debian

https://github.com/nodesource/distributions

Usually i install from source

wget http://nodejs.org/dist/v0.10.31/node-v0.10.31.tar.gz

tar -zxvf node-v0.10.31.tar.gz

cd node-v0.10.31

./configure

make ; sudo make install




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: