
Slap – A Sublime-like terminal-based text editor - type0
https://github.com/slap-editor/slap
======
andrepd
> Issues: [...] Slow on single cores, Raspberry Pi

A text editor that is slow on 1GHz single-core machines. What a time to be
alive.

~~~
squarefoot
Agreed! I wish the sources of CygnusEd (Amiga) were open. Those guys nearly 30
years ago made a graphical text editor which on a 16 bit CPU clocked at 8MHz
run circles around most today editors on 32/64 bit CPUs clocked over two
orders of magnitude higher.

Do we have to count optimization as a forgotten art, at least among non system
developers?

~~~
squarefoot
This brought memories! There's a video on Youtube showing CED in action...
Ladies and gentlemen, this is how a graphical text editor scrolled text 30
years ago on a 8 MHz 16 bit machine!

[https://www.youtube.com/watch?v=L41oIvre9K0](https://www.youtube.com/watch?v=L41oIvre9K0)

~~~
emmelaich
> 8 MHz 16 bit

... and custom blit and other processors.

~~~
photojosh
> on 32/64 bit CPUs clocked over two orders of magnitude higher

... with monster GPUs.

------
techwizrd
Every one of the listed features is also available in Vim. I fail to see how
this is either Sublime-like besides the keybindings (since a file pane is
available on both Emacs and Vim) or will cause me to leave Vim or Emacs
behind. That said, I can definitely see this replacing Nano for some folks.

~~~
captainmuon
I think the benefit is exactly the keybindings. And the fact that it is non-
modal. It works like a text field in a desktop GUI, there is almost no state.
You can't mess the state up. Contrast it to vim, where I got into the habbit
of bashing ESC three times to be sure I'm not in a mode. Or emacs, which is
nice until it's abstractions leak, and you accidentially start editing a
configurations pane or something.

I am a part time vim user, and generally like it, but sometimes I find the
mental load of the key bindings too high. Anything more complex than d<End>,
and I have to stop a moment and think about it. In that time, I can just hit
the cursor keys (and Home, PgDn, ...) a couple of times.

It's a trade-off: Do I use a bit of mental power, and save some finger
movement? Then I go for the vi way. Or do I use less mental power, and
delegate tasks to my fingers and eyes to do autonomically? Then I go for the
sublime / notepad / VS way. I might press the arrow key a couple of times,
overshoot, go back, ... it may look inefficient, but it's not slower, just a
different use of resources.

I've been looking for a Sublime style editor for the terminal for ages.
Actually, way before sublime, I've been looking for an edit.com style editor -
Nano is one thing, but I want one that respects CUI-like conventions. Shift
for selecting, CTRL+C for copy, .... I will definitely check this out.

~~~
dozzie
> It's a trade-off: Do I use a bit of mental power, and save some finger
> movement?

hammerandtongs already suggested this: it's not a trade-off, you just didn't
get to learn Vim appropriately (you say yourself that you're "part time vim
user"). Vim is so convenient for its regular users not because it saves them
keystrokes, but because it saves them this mental power you talk about. I
don't think what commands I want to execute. I think where I want to get in
the file or what should the text look like, and then the logic behind the
structure of vi/Vim commands takes me there.

It's very similar to proficiency in any other editor, except Vim has so much
more to offer with regard to editing (both in first-order commands and in
composing the commands). So much more that watching how a proficient Vim user
edits a file is akin to observing a stage magician. Most of the people cannot
keep up with the changes to the text.

~~~
ice109
>I don't think what commands I want to execute. I think where I want to get in
the file or what should the text look like, and then the logic behind the
structure of vi/Vim commands takes me there.

this is gibberish unless vim comes with some sort of spinal cord dongle.
either it's muscle memory or thinking but you still have to have practiced the
keystrokes.

~~~
antoinealb
Muscle memory is not using some brain power as the GP says. Once you are used
to it (2-3 weeks), it feels very natural, I think "Oh I need to change the end
of this sentence" and my fingers will take me there. It really is an extension
of touch typing.

~~~
pweissbrod
Gee I got to the point of feeling natural after 2-3 months...

------
soupbowl
When I am getting friends into the terminal or I don't feel like copying my
vim configs to a server I use micro now: [https://micro-
editor.github.io/](https://micro-editor.github.io/)

It uses ctrl+s ctrl+c type shortcuts and has mouse support, it really is
slick.

~~~
type0
It is slick but it desperately needs multi cursor support and sadly there has
been no progress on that -
[https://github.com/zyedidia/micro/issues/5](https://github.com/zyedidia/micro/issues/5)

~~~
digi_owl
[https://github.com/hishamhm/dit](https://github.com/hishamhm/dit)

Hisham's (of htop and gobolinux fame) dit editor seems to have gained such
support 4 months ago.

------
LeoNatan25
Is this a joke? A command line text editor, written in JS and Node? The sad?
"Slow on single cores, Raspberry Pi" How low will the software development
world stoop to?

------
magoon
The best feature of vim is its ubiquity; I feel at home on almost any
computer.

I find myself shying away from anything too specialized that could become a
crutch, maybe to my detriment.

~~~
equalunique
Same here. That is, until I find out that only vi's there and not full-on vim.
While vi is smaller and even more ubiquitous, it pains me that it lacks visual
mode.

~~~
chongli
Visual mode is a crutch! I'm used to vi so I never use it. There are faster,
more flexible ways of doing anything you'd do in visual mode with plain vi
commands.

~~~
jcoffland
How do you compare two pieces of code side-by-side? I suppose you could create
terminals and arrange then how you like but that's not much different than
vim. I use gtk emacs with three frames arranged side-by-side on a 40" monitor.
Not being able to compare code this way would really slow me down.

~~~
chongli
I use tmux. It works extremely well with vi. It's no problem at all to arrange
3 panes side by side in tmux. You're not even restricted to that, of course.
You could be tailing a log file in one of the panes, reading a man page in
another, and coding in the middle one.

------
still_grokking
Form GitHub Readme.md:

> slap is based on Github's atom/text-buffer, and as such should be very
> performant, even with very large files.

This is cutting irony!

~~~
notdang
Seems like trolling and we got into the trap.

~~~
LeoNatan25
Poe's law: Without a winking smiley or other blatant display of humor, it is
utterly impossible to parody a [software developer] in such a way that someone
won't mistake for the genuine article.

------
xaduha
I never really used Sublime, but I find the idea of splitting an editor into
frontend and backend to be worth exploring.

Lime does it
[https://github.com/limetext/lime](https://github.com/limetext/lime), NeoVim
does it.

------
hartator
No multi cursors? :(

~~~
nine_k
What is the use of multiple cursors? Something that does _not_ boil down to
copy-paste programming.

UPDATE: From the answers below, I see that the point is the immediate visual
feedback it gives.

~~~
Antrikshy
Find and replace on steroids, meaning the flexibility of moving the cursors
around in all instances of a find and making edits near the beginnings and
ends of lines, for example.

~~~
coldtea
> _Find and replace on steroids_

For people who don't know regular expressions...

~~~
mixedCase
Or Vim macros.

~~~
flukus
That's a much better analogy. Multiple cursors have the same use cases as
macros, they are just performed live instead of saved and replayed.

------
jimjimjim
Javascript. Is there anything it can't ruin?

------
mixmastamyk
I use ne for a terminal-based CUA editor right now, though this slap project
looks promising.

    
    
        sudo apt install ne
    

In the past I've used nano with some sane key bindings, but they would often
be missing on remote machines. Ten+ years ago I built a turbovision work-alike
from setedit.

I'm afraid that the node requirement and lack of Debian repo would rule it out
in many situations, like remote editing. Too much work to get it installed on
ephemeral boxes. Could someone start a project like this with C and Python
plugins? I'd like to contribute.

Guess I'll stick with ne or sshfs and main editor for now.

------
tuvistavie
This looks interesting, but the last commit is 5 months ago. Is the project
still in active development?

~~~
Zitrax
Someone else asked the same a month ago, still no answer:
[https://github.com/slap-editor/slap/issues/393](https://github.com/slap-
editor/slap/issues/393)

~~~
jtmarmon
the author did confirm it's a question, so that clears that up

~~~
grogenaut
It's mit so if it's good roll with it

------
barnabes
This looks like an excellent addition to the family of terminal-based editors.
Truly looking forward to trying it out at work.

------
powerage99
Another terminal editor that's similar:
[https://github.com/rgburke/wed](https://github.com/rgburke/wed)

