News for hackers. Stuff that matters.
Re:Emacs for Professionals by continuational on Tuesday May 03, 2022 @04:39AM (#31246054)
I think Emacs is built upon a golden idea: The programmable text buffer as the user interface for the OS.

A lot of data manipulation can be expressed as text manipulation, especially if it only has to be correct in a single instance.

However, Emacs is really starting to show its age. The keybindings are arcane and pre-standardization. There is no built-in support for multi-cursors, which are often much more direct than macro recording. Configurations are time consuming and perpetually broken. I think it's time for a replacement.

Re:Emacs for Professionals by medo-bear on Tuesday May 03, 2022 @06:05AM (#31246516)
> Emacs is really starting to show its age.

I disagree. I came to Emacs from a combination of VSCode/Pycharms and Jupyter notebook. I think the latter are still held in highest regard in the IDE space. To this day there is nothing in another editor or IDE that I miss. I find that Emacs allows me to invest as much as I want into my tools: editor, notebook, document generator, and shell. If you are looking for a maximal out-of-the-box product, then sure Emacs will come up short. However if you are looking for a product that you can develop and use for a lifetime then personally I don't think any one piece of software comes close

NOTE: Emacs ecosystem has had support for multiple cursors for over a decade. Emacs (like Python) should not be valued in terms of built-in features, but in terms of its community and ecosystem

Re:Emacs for Professionals by vector_spaces on Tuesday May 03, 2022 @05:13AM (#31246247)
I find emacs to be very transparent compared to other editors. Also, it's exactly as complicated as I want/need it to be. I love the buffer abstraction, it fits very nicely with how I think in general. And I love that it generally "just works" with my pretty bare bones config.

I don't try to do everything inside emacs, probably to a fault. I don't even bother with, say, autocomplete, or on-the-fly syntax checking (I do use syntax highlighting!), I just run linters/formatters/unit tests externally regularly while working on code. I'm happy to defer terminal interaction to a real terminal emulator, although sometimes I use vterm from emacs. Oh, I will use magit though. Magit is awesome!

Don't get me wrong, I like VSCode in some ways, and I think it's a great tool. It's far more accessible in a lot of ways. But it's not really for me. I don't find it to be transparent. Things break often, probably because it's a less mature tool, but understanding why things break when they do tends to be frustrating and fraught by comparison. And it lacks anything remotely comparable to emacs buffers (at least last I checked: if you know of anything that does this in VSCode, I'd be happy to check it out!).

And to be clear, I know these arguments for emacs aren't super compelling. They're more expressions of taste and aesthetic preferences than anything else. Which is fine, we can all have different tastes and aesthetic preferences :)

Re:Emacs for Professionals by continuational on Tuesday May 03, 2022 @05:17AM (#31246271)
I don't really understand how to use VSCode efficiently. IntelliJ IDEA has the best editor I've tried so far. I'm not suggesting it could be a replacement for Emacs, however.
Re:Emacs for Professionals by vector_spaces on Tuesday May 03, 2022 @05:21AM (#31246301)
I'm OK with giving up emacs for a powerful IDE in the right setting. I've used Visual Studio with ReSharper while editing C#, and that is a pretty phenomenal experience. But for whatever reason I don't feel like I need it when working on Python, bash, Golang, SQL, JS/TS, or any of the other languages I tend to work with
Re:Emacs for Professionals by JonChesterfield on Tuesday May 03, 2022 @05:04AM (#31246208)
Emacs is essentially perfect. The core of sketchy C is a bit of a liability but mostly works fine. The layers of lisp on top have been evolving for decades.

I don't know what standardisation you're referring to, but feel free to change the key bindings to whatever standard you prefer.

Built-in? There will be multicursor things on melpa, install whatever sounds plausible. The distinction between ships with emacs and added post-install is minimal.

Re:Emacs for Professionals by planede on Tuesday May 03, 2022 @04:48AM (#31246117)
Am I the only one who doesn't get the multi-cursor hype? Having said that I never used it, so maybe I'm missing out.
Re:Emacs for Professionals by draxil on Tuesday May 03, 2022 @06:18AM (#31246601)
I used to think "surely this is just fancy find and replace".

But actually it's more like defining a keyboard macro. It's very powerful and quicker and easier than a macro for a lot of tasks.

Re:Emacs for Professionals by atsider on Tuesday May 03, 2022 @04:59AM (#31246177)
Yep, to me it's not far superior to find-replace: https://nullprogram.com/blog/2017/09/07/
Re:Emacs for Professionals by alpaca128 on Tuesday May 03, 2022 @09:06AM (#31247783)
With the right controls it might be a better (more flexible) version of Vim's block selection mode. Which I use almost daily, it's super useful but depends on lines being vertically aligned, which multiple cursors don't need to care about.

But I don't see another purpose for them; find-replace with regex support and macros only fail in rare cases where actual syntax parsing is needed.

Re:Emacs for Professionals by mtnygard on Tuesday May 03, 2022 @10:03AM (#31248452)
I think the utility is proportional to the degree of repetition in your files.
Re:Emacs for Professionals by kreetx on Tuesday May 03, 2022 @04:57AM (#31246167)
You are not. Perhaps people who use it can elaborate, but it seems to be an interactive search-and-replace with highlighting. Is it anything more?
Re:Emacs for Professionals by CraigJPerry on Tuesday May 03, 2022 @05:04AM (#31246206)
In vscode if my cursor is in a word, i Ctrl+D to select that, then Ctrl+D to select further matches, then begin typing over them. There's other modes too where you can just add more cursors to a line below/above but i find less use for that.

But in vim it's not much slower to do:

    /<search term>
    cgn  " change this this i just matched
    .    " find next occurance AND execute the change here too, i don't have to say "n ." because i used cgn above instead of something like cw
But i still end up relying on

    qq  " stick a macro in q register
    <complex edit sequence>
    @q / @@
For more gnarly stuff
Re:Emacs for Professionals by ckolkey on Tuesday May 03, 2022 @05:52AM (#31246459)
presuming you did a `/<search>` for the results you want, you can follow it up with:

  :%s//<replacement>/gc
Re:Emacs for Professionals by alex_smart on Tuesday May 03, 2022 @05:14AM (#31246261)
It is more like interactive editor macros where you can see the intermediate results on the fly.

The advantage over search-and-replace is that you get to work with a nice, familiar language (the interactive commands you send to your editor) rather than using regex.

Re:Emacs for Professionals by gpderetta on Tuesday May 03, 2022 @06:10AM (#31246549)
what's wrong with the multiple-cursors package? I have been using it successfully for many years.

I suspect that emacs will outlast any replacements like it has done for the last few decades.

Re:Emacs for Professionals by trey-jones on Tuesday May 03, 2022 @09:20AM (#31247933)
I use multiple-cursors and don't have a problem with it. Who cares whether it's efficient? I will prefer lsp-rename where possible, but if I'm replacing some strings or whatever it's very quick to just select the string, and then add a few cursors and change them all at once (I use s-d for that). It's not like I'm using thousands of cursors at once.
Re:Emacs for Professionals by alex_smart on Tuesday May 03, 2022 @07:59AM (#31247244)
Someone posted a link in the comments pointing out that Emacs's internal representation of a buffer is not really designed to support multiple cursors efficiently. For batch changes in a large file, macros would be more suitable. I haven't really seen this be a problem in my workflow.
Re:Emacs for Professionals by BeetleB on Tuesday May 03, 2022 @12:58PM (#31250613)
> However, Emacs is really starting to show its age. The keybindings are arcane and pre-standardization. There is no built-in support for multi-cursors, which are often much more direct than macro recording.

Why is it that I always see these complaints about Emacs and not vim? It's as true for the latter.