Hacker News new | ask | show | jobs
by gnull 1839 days ago
M-spc just inserted a space for me. Do I need some package for it to work? What does your sequence of commands mean in English?

I have no doubt that what I've shows can be done in Emacs. How natural is it to express? How much scripting and packaging does it require? How much extra memorizing does it require?

> What I think is the mistake is that vim/kak are all just interfaces, while Emacs is software

Yes, I am talking about interfaces, not software. I was talking about the interface that Emacs offers by default. Of course, you can script anything in it, but it's a meaningless argument; Linux kernel allows you to implement any program you want, but it doesn't make Linux a good text editor.

And in particular, I was talking about interfaces that are efficient, take little time to setup and save you a lot of time when you use them. My claim is that Emacs is not one of them. (Which doesn't make Emacs bad in the ultimate sense. It can be good for other things.)

> Multiple cursors are just visualized macros, after all.

Yes and no. Any text editing operation can expressed in ex commands, but it doesn't make ex a good editor, and definitely doesn't make it an efficient one.

Multiple cursors give instant feedback, this is a big advantage over blindly shooting macros at your text.

1 comments

My bad, meant C-SPC.

> What does your sequence of commands mean in English?

This time I tested it to make sure that I say the right bindings:

1. Go to the beginning of the line (C-a) 2. Find the n'th column (n * C-s |) 3. Activate the mark (C-SPC) 4. Go to the next column (C-s |) 5. Kill the region (C-w) 6. Go to the column you want (m * C-s/C-r |) 7. Insert the region (C-y)

> How natural is it to express?

To me it is instinctive.

> How much scripting and packaging does it require?

None, these are all basic commands.

> How much extra memorizing does it require?

All you need to know is how to record a macro.

> Yes, I am talking about interfaces, not software. I was talking about the interface that Emacs offers by default.

But then you are comparing different apples to oranges? But even if we are comparing vim/kak the interface to Emacs' default interface, I still don't think the difference is that big. The main difference is that vim/kak are parts of the terminal workflow, while Emacs is a shell onto itself.

> Multiple cursors give instant feedback, this is a big advantage over blindly shooting macros at your text.

You have instant feedback while recording a macro too? You can even make it interactive, and insert a query into your macros to make it easier for you to distinguish between false-positives and the actual places you want to apply macros.

I see the point. The Emacs way can also be seen as object-verb, it's just that object is given via selection. I don't have any objections to what you said, maybe I was wrong about Vim/Emacs difference.

But. Kakoune is still something bigger for me. It does take text editing to a new level and it does make it more efficient. It is similar to Emacs in the sense that both follow the sequence “select and apply an action”. But Kakoune has richer selection primitives and has actions that work on multiple selections at the same time; this can be done with macros, but it's by far less convenient.

In your example, you can record a macro and apply it to all the lines of a table. Will you have to do it for each line one by one? Can you say, “run the macro on each line of this paragraph”?

> You have instant feedback while recording a macro too?

Sure, but not on all the places where you're going to apply it at the same time. And your macro may not work correctly on some of the lines, you will not see it while recording it. With multiple selections you see it immediately and can undo the last action and try again.

Multiple selections stay there after you apply actions on them. After you apply something, you can see the result and slowly think of the thing to do next with them. With a macro, you will have to type in the whole sequence when you record the macro.

Macros can achieve the same things, but they require more mental effort and are harder to get used to. And when you're focused on your code, the mental effort it takes to used your editor matters.

In the same way, multiple selections are an improvement over Vim's tradition of shooting regexes at your text; for the same reasons: interactiveness and instant feedback.

> But. Kakoune is still something bigger for me

I have to admit that I have never seriously tried Kakoune. It has always been to similar but not similar enough to Vi(m) for me to work with.

> Can you say, “run the macro on each line of this paragraph”?

Yes, apply-macro-to-region-lines (C-x C-k r) does that. Of course you'd have to select the paragraph first (M-h).