News for hackers. Stuff that matters.
Re:Toward a “modern” Emacs by Miraste on Friday September 25, 2020 @05:34PM (#24594339)
> It is widely used for a staggering array of tasks.

Is it? What area are you in? In my hobbyist, college, and industry experience I've never seen anyone use emacs for anything. I have seen Vim (or at least vim bindings) a few times, but I only know of emacs from older unix discussions online.

Edit: Looking through stack overflow developer surveys, emacs use is in 16th place for editor popularity at ~4.5% usage, but has stayed close to that number for years.

Re:Toward a “modern” Emacs by eigenhombre on Friday September 25, 2020 @06:13PM (#24594654)
Half my fifteen-person team at work (in a fast-growing mid-size fintech company in Chicago) uses Emacs, for editing/testing/running code in several languages, interacting with Web services, running various shells, calendar functions, document writing including UML diagrams and mathematics typesetting, and personal planning (Org Mode). To do this, we collectively probably use about 0.1% of the publicly available extension packages for Emacs on MELPA.

But the short summary is that most people use it for the various functions an IDE provides. The major difference between Emcs and other IDEs (VSCode, IntelliJ, ...) is that (a) it's often a little harder to get functionality that is provided out-of-the-box by another IDE, but (b) it's much easier (in some cases, infinitely easier) to implement workflows or functionality not already implemented by said IDE.

As an example, I often run snippets of code and want to insert the result directly beneath the code in question (similar to Jupyter in Python, but for any language, in plain text, directly in my editor). A trivial amount of Emacs Lisp gave me that with minimal effort.

If you like to have nearly absolute control of your editing experience, Emacs might be interesting to you. For most people starting out, who just want to get hacking on some code as quickly as possible, it is perhaps not the best fit.

Re:Toward a “modern” Emacs by jrimbault on Friday September 25, 2020 @05:55PM (#24594514)
Just to add links to the SO surveys mentionned here :

- 2019: https://insights.stackoverflow.com/survey/2019#development-e...

- 2018: https://insights.stackoverflow.com/survey/2018#development-e...

- 2017: https://insights.stackoverflow.com/survey/2017#technology-_-...

- 2016: https://insights.stackoverflow.com/survey/2016#technology-de...

- 2015: https://insights.stackoverflow.com/survey/2015#tech-editor

What's really amazing is vscode just appearing out of nowhere (7% in 2016, 35% in 2018). Blindsiding everyone. Cross platform, excellent to good enough UI/UX (very much inspired by Sublime Text but free), easily extensible in a widely available (and widely taught) language. For better or for worse.

Re:Toward a “modern” Emacs by coldtea on Friday September 25, 2020 @08:57PM (#24595543)
The huge advantage of VSC: plugins can use HTML to implement whatever UI they want, from a workflow tool, to a test tool, to a Git graph view to a debugger data structure visualizer. And all that in widely-known to tons of people HTML/CSS.

Never understood why other editors, like ST, didn't give more UI options (checkboxes, buttons, dropdowns, a canvas, etc) to plugin authors. Consider how clunky a lot of plugin interactions with limited UI widgets available to them are.

But even if other editors started giving more freedom to design your plugin with more widgets etc, they could never beat the freedom HTML/CSS gives.

The second huge advantage of VSC: Microsoft behind it updating it non-stop. TextMate stalled, ST seems abandoned for long stretches of time (and it's not like we "already solved code-editing, what more you want") because of lack of manpower, etc.

The third advantage of VSC: first-class support for plugins, with "package manager" and storage built-in: plugin discovery, install, uninstall, enable/disable, configure, are all a click away. ST has this too, but not as refined as VSC, but more like a tacked-on text-based experience.

Two more advantages of VSC:

- remote development tools (MS). Code in your laptop, run/debug in SSH/Docker/WSL environment.

- automatically saved/synced preferences. This came in in this release.

I'm not in favor of Electron apps over native. But VSC is really that good.

Re:Toward a “modern” Emacs by Siira on Sunday September 27, 2020 @11:31AM (#24607369)
The last two are more of disadvantages; The remote setup eats a lot of memory from the remote machine, and needs an excellent internet connection, and can't integrate with local editing (You have to use two separate windows, and it's in general nowhere as neat as tramp). The saved prefs are synced without version control, which means you can't really count on them.
Re:Toward a “modern” Emacs by pjmlp on Saturday September 26, 2020 @07:00AM (#24597854)
It is the only Electron app that I tolerate willingly, but hoping that eventually React Native team at Microsoft will manage to drive a transition, somehow.
Re:Toward a “modern” Emacs by ashtonkem on Saturday September 26, 2020 @12:42AM (#24596478)
I remain utterly perplexed by the popularity of VS Code, to me it basically does nothing well, but does a bunch of things mediocrely.
Re:Toward a “modern” Emacs by rkangel on Saturday September 26, 2020 @06:57AM (#24597836)
I was an avid emacs user for almost a decade and it only 2 a week with VSCode for me to jump ship completely.

The issue I had with Emacs is that while could get it to do anything, often it took a lot of time. I would often end up spending an entire afternoon or Sunday tinkering with my config to get set up to develop in a new language. Whe I adopted VSCode it took about 20 minutes - install a plug in, set some config. I had a better setup for Elixir in a text editor I had never used before in minutes, after having spend hours achieving an inferior result in Emacs.

The reason for this basically comes down to abstraction levels in a couple of places.

Language support in VSCode is at the 'plugin' level whereas in emacs you usually have to assemble several pieces. Partly this is achievable because VSCode made their own life easy pushing the hard work of language support out using the language protocol. Its widespread adoption in a relatively short time is a great benefit to everyone (emacs included).

Re:Toward a “modern” Emacs by ashtonkem on Saturday September 26, 2020 @11:43AM (#24599607)
I get that, but VS code plugins are generally mediocre at best. If I want a “install plugin and it works” editor, I use IntelliJ, which does a better job at basically everything.
Re:Toward a “modern” Emacs by marrianeKK on Sunday September 27, 2020 @04:48PM (#24610031)
I'm curious as to which plugins you have used to have that impression. My plugin experience with VS Code has been generally great. Far better than any Jetbrains product I've used, I dare say.
Re:Toward a “modern” Emacs by dmix on Saturday September 26, 2020 @01:38AM (#24596693)
It’s surprisingly easy to grind performance to a halt in VSCode using the extensions (even on a modern machine of course) much like using a browser with extensions (but worse).

That said the only reason I use VSCode instead of Vin is when I program in Typescript because the support is outstanding, always cutting edge, and super easy to set up. Code is ideal for frontend js programming in general with lower investment.

Similar to how awesome Emacs was for Clojure and Lisps in general.

But nothing will peel me away from (neo)Vim for generally everything else. I love how fast, portable, and perfectly customized I’ve made it over the years.

The difference with vim vs emacs vs VSCode is probably like the value with the community size and plug-in support. Just like programming languages become great through having great libraries and frameworks and tutorials etc, being popular has tons of value. After simply being good at all the foundational stuff.

Re:Toward a “modern” Emacs by slightwinder on Monday September 28, 2020 @07:16AM (#24615405)
> It’s surprisingly easy to grind performance to a halt in VSCode using the extensions (even on a modern machine of course) much like using a browser with extensions (but worse).

The same is true for emacs, or vim or any other extendable editor. Poor code behaves bad everywhere.

But the real surprise is, VS Code usual performance is equal or better than emacs even with an average setup which is still a tad more powerful than whatever emacs offers on a good setup.

Re:Toward a “modern” Emacs by cpach on Saturday September 26, 2020 @03:55AM (#24597149)
A product doesn’t need to be excellent to be popular. Take for example McDonald’s or Burger King. You will not get excellence there. But you will consistently get a filling meal to a quite good price. Or take TV-series. They don’t need to be excellent either to get lots of viewers. They just need to be available and entertaining.

(I don’t mean this as a critique of VSCode. I have never used it.)

Re:Toward a “modern” Emacs by addicted on Saturday September 26, 2020 @07:01AM (#24597859)
Yeah but VS Code is considered by many to also be best in class.
Re:Toward a “modern” Emacs by ashtonkem on Saturday September 26, 2020 @11:49AM (#24599657)
I find that assertion utterly perplexing.

I mean, to each their own. Someone else using an editor I dislike doesn’t harm me in any way. But if someone told me that VS Code was “best in class” for anything other than a language I have never touched and have no knowledge of, I’d look at them like they’d just asserted that the sky is green.

Re:Toward a “modern” Emacs by cpach on Saturday September 26, 2020 @07:03AM (#24597873)
To each their own :)
Re:Toward a “modern” Emacs by jojohohanon on Saturday September 26, 2020 @02:36PM (#24601067)
well, the same can be said of Swiss martial cutlery...

To connect this a bit back to emacs, I think the big contribution VSC has made is to popularize the language-server concept, which decouples the UI from the automagical autocomplete and context-sensitive documentation we expect from IDEs.

Emacs's lsp-mode and (I'm told, not yet tried) eglot make it possible to use emacs to productively write java, something I won't attempt without tooling support.

The LSP interface, like slime, enables a whole class of interaction, rather than re-implementing the language support for each languge, like in days of yore.

That truly is a modern coding practice, brought to emacs.

Re:Toward a “modern” Emacs by pjmlp on Saturday September 26, 2020 @07:02AM (#24597864)
As avid Electron hater and someone that found refuge in XEmacs, back when IDEs and UNIX did not mix, it is a matter of defaults and not everyone likes ELisp.
Re:Toward a “modern” Emacs by ashtonkem on Saturday September 26, 2020 @11:52AM (#24599675)
Sure, but it’s not like the choice is between Emacs and VS Code alone. I for one find IntelliJ to be far superior to VS Code for the languages I use. Especially since search and autocomplete actually work, which it doesn’t do in VS Code.
Re:Toward a “modern” Emacs by pjmlp on Saturday September 26, 2020 @02:11PM (#24600854)
VSCode has the power of free beer, and most major plugins are done by Microsoft, Red-Hat, Google and friends, while most InteliJ goodies are available online on the commercial license.
Re:Toward a “modern” Emacs by ashtonkem on Sunday September 27, 2020 @01:51PM (#24608570)
I wonder how many devs are motivated by that. All of the ones I know are already using OSX, so standing on principle for just the IDE would be incoherent.
Re:Toward a “modern” Emacs by pjmlp on Sunday September 27, 2020 @03:21PM (#24609400)
OS X is about 10% of the world desktop market.

Hardly seen outside first world countries, and even on Europe it isn't easily spot outside the rich EU countries.

I did a couple of consulting gigs where the only iMac available for the Dev teams was used in turns for iOS deployments, for applications done in cross platform frameworks, where 90% of development time was spent in Ubuntu and Windows based computers.

Re:Toward a “modern” Emacs by slightwinder on Monday September 28, 2020 @07:08AM (#24615354)
VS Code is pretty much the proof that a modern Interface and beginner-friendly customization is the secret of success even for editors. Of course only additional to a solid foundation in terms of ability.
Re:Toward a “modern” Emacs by quadrifoliate on Friday September 25, 2020 @06:05PM (#24594591)
> emacs use is in 16th place for editor popularity at ~4.5% usage, but has stayed close to that number for years.

It is possible that "Stack Overflow surveys" select for programmers who tend not to use Emacs. For example, I use Emacs regularly and know what Stack Overflow is, but have never taken one of these surveys.

I'm not even sure how they survey developers. Ask on some crufty mailing list and you probably will get a completely different distribution from the one they showed.

Re:Toward a “modern” Emacs by oblio on Friday September 25, 2020 @06:07PM (#24594610)
They probably just send a newsletter to StackOverflow users :-)
Re:Toward a “modern” Emacs by quadrifoliate on Friday September 25, 2020 @06:11PM (#24594639)
Emacs users are probably more likely to unsubscribe to newsletters that they did not sign up for :)

(On a side rant, I really dislike how a lot of websites have normalized “create an account on a website” to mean “Sign up for receiving a plethora of emails about everything the website and its creators are up to these days”)

Re:Toward a “modern” Emacs by ryukafalz on Friday September 25, 2020 @08:00PM (#24595269)
>On a side rant, I really dislike how a lot of websites have normalized “create an account on a website” to mean “Sign up for receiving a plethora of emails about everything the website and its creators are up to these days”

Hear, hear. If I get an email from a company whose newsletter I didn't sign up for, I immediately unsubscribe... but I really shouldn't have to.

Re:Toward a “modern” Emacs by snazz on Friday September 25, 2020 @08:46PM (#24595485)
One of the greatest parts about owning my own domain is using different email addresses for these random websites that want to blast me with newsletters. That way, I can just redirect [email protected] to the trash if they sold my email address or I start getting spam to that address.

You can do the same thing in Gmail with the +, but some websites filter those out or don't allow them.

Re:Toward a “modern” Emacs by cbsks on Friday September 25, 2020 @11:28PM (#24596183)
What websites have you had issues with? I started doing the same thing with my own domain about a year ago, but I haven’t see any unsolicited emails to any of the addresses yet.
Re:Toward a “modern” Emacs by throwaway8941 on Saturday September 26, 2020 @12:30AM (#24596426)
I was expecting you to say "I immediately mark it as spam". Do it, treat unsolicited newsletters like the spam they are. If enough people do this, it creates significant problems for the authors of such email.
Re:Toward a “modern” Emacs by TeMPOraL on Saturday September 26, 2020 @02:52AM (#24596932)
I do that. Just unwanted = unsubscribe; unexpected = spam; if unsubscribe link doesn't work or requires logging in => spam.
Re:Toward a “modern” Emacs by Mediterraneo10 on Friday September 25, 2020 @05:49PM (#24594475)
Meanwhile, I’m always amazed how, on HN threads about Emacs, people talk about preferring the Vi family of editors. When I installed Linux on my computer two decades ago and had to learn *nix, my own (totally subjective) impression was that the Vi family was regarded as clunky and half-obsolete, about as much of a pain as editing in ed. As I began to contribute to the Free Software community, most of the other people I interacted with seemed to use Emacs. So, to find out that Vi is still used and loved in 2020 has been a shock.
Re:Toward a “modern” Emacs by pritovido on Friday September 25, 2020 @06:55PM (#24594911)
When I entered a technical University in Spain, all the masters(teachers that have done incredible things on their lives) used either Vim or Emacs.

Most "normal" people just used other "more visual" editors.

As I learned from the masters I started using more and more both vim for unix tasks and programming and emacs for lisp. Now I use 65%vim, 30% emacs, 5% other editors.

Both of those editors are extremely powerful. But you need to know how to use them. It is not painful for the master to use them, in fact it is automatic and instantaneous and faster than any other editor, a thought becomes an action without conscious intervention, like you thing in playing Do minor in an instrument and your fingers do it automatically, you want to erase a line or replace a word, you think on it, is done.

They are like musical instruments. You could have the best piano or violin in the world, if a mediocre player plays them, you get bad sound.

Most people would be better served with a simple electronic piano or a tablet with lights that point to the next notes of the song, and auto correct them when they play a bad note.

Re:Toward a “modern” Emacs by _benj on Friday September 25, 2020 @07:17PM (#24595037)
Your reference to musical instruments resonates with me (I play piano) and the fact that emacs call they keyboard bindings "chords" further complements that view.

I guess the issue that is being handled here thought is that, just like the piano, the road for those actions to become unconscious is a long painful one.

When I started using Golang for work the first thing that I did was buy GoLand from jetbrains. It just works, and I'm paid for "playing piano", not for "learning how to play piano"

I wish I was able to use emacs professionally but until I'm able to dedicate (usually unpaid) time to learn it, it's just easier to use something else

Re:Toward a “modern” Emacs by necubi on Friday September 25, 2020 @11:43PM (#24596240)
It's really not that painful. In college I spent two weeks forcing myself to use emacs for everything. I printed out a reference card and unplugged my mouse to prevent cheating. It was not a productive two weeks, but afterwards I was proficient in emacs editing and have been ever since. (Of course true emacs mastery goes much deeper, but it really doesn't take that long to become proficient.)
Re:Toward a “modern” Emacs by quanticle on Saturday September 26, 2020 @04:58AM (#24597383)
A broke college student with nothing to lose but time and a professional programmer have entirely two different definitions of "painful". A broke college student will spend two weeks learning emacs to avoid paying for a $100 IDE. A professional developer will happily pay for a $100 IDE if it saves him two weeks of time.
Re:Toward a “modern” Emacs by throwaway_pdp09 on Saturday September 26, 2020 @07:24AM (#24597952)
It's an investment and the payback is considerable. I can start up emacs in any environment and it works the same. I could go back 20 years and use emacs without trouble.

Also I can move around in emacs and do stuff with macros that has saved me a lot of time. And emacs rarely has problems, unlike visual studio, which crashes occasionally and is permanently sending my dual-core to 100% of both.

Emacs refactoring, heh, not so good... So I use both, do main editing in emacs.

Re:Toward a “modern” Emacs by quanticle on Friday October 02, 2020 @10:28AM (#24662947)
But you're not going to go back 20 years. No one's going to come along with a time machine and send you back to the year 2000. And, unlike vi, emacs isn't part of the POSIX standard, so your production servers aren't going to have emacs preinstalled. If you're a new programmer, with zero experience, why would you bother learning a program that is going to make you less productive than your peers and isn't going to give you any advantages when you're debugging in production? What exactly is the payoff to this "investment"?
Re:Toward a “modern” Emacs by antepodius on Saturday September 26, 2020 @06:40AM (#24597767)
In this case, it isn't about money, but proficiency.
Re:Toward a “modern” Emacs by quanticle on Friday October 02, 2020 @10:30AM (#24662968)
Proficiency? Proficiency in what? Proficiency in learning a completely irrelevant language to spend two months getting up to the same level everyone else gets to in two weeks?
Re:Toward a “modern” Emacs by antepodius on Thursday October 08, 2020 @06:50PM (#24724783)
Slower to learn, but with a higher cap, and more likely to endure for four more decades than a given learn-in-two-weeks gui program.
Re:Toward a “modern” Emacs by zdragnar on Saturday September 26, 2020 @03:29AM (#24597049)
> in fact it is automatic and instantaneous and faster than any other editor

Really? I've always found emacs to be on the slower side of things (not nearly as bad as jetbrains / visual studio, of course) and many keyboard commands to be unnecessarily clunky. I don't know how many times I've given emacs a go, and yet I can't seem to get nearly as proficient as I am with VSCode (and sublimetext before that).

I know part of it is that I don't typically work in languages where having a live REPL up is terribly useful, so emacs support tends to be a bit... second class.

I think my biggest gripe is that there are actually two mountains to climb. First, you have to become proficient with emacs- the chords and so forth. Then you have to find the magical combination of plugins that work together on your operating system with the magical configuration that brings emacs up to par with things that I consider to be table stakes for a good development experience. Doom emacs probably got me the closest there, I think, but struggling to become moderately productive when I already have a tool with which I am extremely productive seems entirely pointless.

Re:Toward a “modern” Emacs by spudlyo on Friday September 25, 2020 @06:33PM (#24594796)
I think the thing about Vi and Vim that has the most value in 2020 is not the software itself, but rather the keyboard-centric composable modal editing system that they popularized.

Some of the growth that Emacs has enjoyed over the past several years is from folks who want the Vim style modal editing in an editor as customizable and extensible as Emacs. Emacs "distributions" such as Doom and Spacemacs cater to these folks.

Re:Toward a “modern” Emacs by how_gauche on Saturday September 26, 2020 @09:39AM (#24598764)
Many of us switched to evil mode because we got RSI from incorrectly chording all the time! C-a & C-e I'm looking at you
Re:Toward a “modern” Emacs by paledot on Friday September 25, 2020 @07:37PM (#24595134)
I came to vim (years ago now) because I was experiencing RSI from all of the chorded keyboard shortcuts I was using in Coda. Emacs doesn't help with that, but vim does (if you `map ; :`).

Any editor feels clunky for the first week of using it, Vim and Emacs most of all. Nobody wastes the headspace in staying current on multiple editors. So I don't know that you'll ever see an objective comparison of the two. But they're both solid ways to write code, it just takes way too long to get either one dialed in to do the things we expect modern editors to do out of the box, like code completion.

Re:Toward a “modern” Emacs by bluenose69 on Saturday September 26, 2020 @06:01AM (#24597622)
I switched from emacs to vim for the same reason. I was doing a lot of typing, and my left hand started aching when I was stretching my fingers and eventually it just started aching all the time. So I thought, why not try vim, which I had used many decades before.

Things were very slow for a few days, and there was a lot of swearing, as I got weird results from hitting a wrong key. But after about a week I was able to get along adequately, and after another one, I was at the point where I was making choices for optimal methods without really thinking about whether typing 2w would be better than holding j for a while.

I think the key was that I made the switch during a vacation, when my workload was lower and I would not be so frustrated by learning enough that I could select between methods.

Learning either vim or emacs in a rush is not good because you are likely to become habitualized on a small subset of methods, and will be blocked from learning other methods that will increase your productivity some day.

Re:Toward a “modern” Emacs by honr on Friday September 25, 2020 @08:26PM (#24595398)
Heh, most of my emacs shortcuts start with ;

Perhaps ironically, mac OS text input boxes are where I use most of the traditional emacs C-/M- keybindings these days.

Re:Toward a “modern” Emacs by umanwizard on Saturday September 26, 2020 @06:29AM (#24597722)
Funnily enough, Bill Joy (creator of vi) said he would have made a modeless editor if he had thought of it, he just didn’t.

I use vi-family editors for the same reason I use grep: it’s installed everywhere. I’m not religious about its benefits.

Re:Toward a “modern” Emacs by Skunkleton on Friday September 25, 2020 @06:24PM (#24594736)
I don't think many people are using Vi. Its more likely they are using vim or neovim, which are both far from clunky.
Re:Toward a “modern” Emacs by nineteen999 on Friday September 25, 2020 @10:04PM (#24595865)
I know I fell into it because I originally learnt UNIX on shitty XENIX servers which were basically AT&T SVR4 on x86. The internet and Linux weren't around then.

Later on I had to work with a number of different versions of different UNIX platforms on a daily basis (Tru64, Solaris, HP-UX, AIX) as well as multiple varieties of Linux, and vi was a common denominator on all of them.

Re:Toward a “modern” Emacs by oblio on Friday September 25, 2020 @06:06PM (#24594606)
I've personally known 2 Emacs users in my ~15 years in the industry. I've worked in Europe for various startups and a bunch of corporations. Both of them used it as a sort of hobby/side editor, their main money maker was an IDE (VS, IntelliJ).

I've probably worked with 500 developers, if not more.

My personal impression is that Emacs is like the Yeti of programming editors. Everybody has heard about it, few claim to have seen it and even fewer still can claim to have proof of the sighting :-)

Re:Toward a “modern” Emacs by gnulinux on Friday September 25, 2020 @06:37PM (#24594820)
This is amazing.

I already wrote this to another comment, but quoting myself:

> Is this a USA vs the rest thing? I've worked in many startups in the US and almost everyone uses emacs. Last few years, VSCode has been getting popular though. I had a similar experience when I was a student in UC Berkeley, although it seems like there were more vim users in school than in industry. Anyway, pretty much all my current coworkers use Emacs and I work in Boston, MA.

> Personally: I cannot imagine programming without emacs, to me programming is so strongly associated with emacs...

> Of course, I also understand that it's all personal preference.

I don't know if there is a way to prove that I'm lying. :)

Re:Toward a “modern” Emacs by rxhernandez on Friday September 25, 2020 @07:35PM (#24595128)
I've worked in California all my life and have worked in the following industries: medical devices, scientific devices, blockchain, and plasma physics research. I am the only person I've seen use emacs. Almost every developer I've worked with either used VS Code, Visual Studio, or uVision. Everyone else used Sublime Text, Eclipse or a JetBrains IDE.

I haven't even used emacs in years so I don't even know anyone that uses it; I stick almost exclusively to Vim (and for 8 months this was my only "IDE"), PyCharm, and WebStorm.

Re:Toward a “modern” Emacs by addicted on Saturday September 26, 2020 @07:04AM (#24597877)
I mean, just go on YouTube and start clicking around in random presentations at programmer conferences.

Unless it’s an emacs related conference you will rarely see emacs being used as an editor. You will see a few VIM users sprinkled around. But if it’s a recent conference the vast majority are gonna be VSCode users.

Re:Toward a “modern” Emacs by oblio on Friday September 25, 2020 @06:53PM (#24594905)
Isn't Boston where MIT is and where Stallman lives?

Also, Berkeley as in BSD.

You're probably living in a smaller bubble than mine :-)

Re:Toward a “modern” Emacs by how_gauche on Saturday September 26, 2020 @09:33AM (#24598697)
Huge skew depending on what platforms you like to work on. Java or Windows people are significantly less likely to use trad Unix tools. Backend or Linux people, it's 30/30/* in my experience between vim/Emacs/everything else -- this was certainly the case at Google when I was there.
Re:Toward a “modern” Emacs by turing_complete on Saturday September 26, 2020 @04:04AM (#24597178)
I am using Vim. Is it worth it to try emacs?
Re:Toward a “modern” Emacs by quanticle on Saturday September 26, 2020 @04:53AM (#24597362)
If you're happy with vim, stick with it. In general, when it comes to editors, you're better off trying to get really good at the editors you already know than being mediocre at using a bunch of different editors.
Re:Toward a “modern” Emacs by fennecfoxen on Saturday September 26, 2020 @08:14AM (#24598224)
Here's what I do in emacs that makes me like it better than vim. If you want to do things like this, you should consider Emacs. If not, you are likely better served by Vim.

- I write software with unit tests. I have a custom method bound to Shift-F5 that computes the test file associated with the current code file, and switches to the buffer.

- I have a similar method bound to F5 that runs the tests for the current file (code file or test file). Ctrl-F5 to run the previous test again even if you're in a different buffer.

- These are configured for multiple programming languages, testrunners, and different conventions within specific programming languages, in different parts of the codebase.

- Test output goes to a first-class buffer, like any other file I'm working on. If I want to do something like `git blame` the file I'm working in, it's also a first-class buffer. Want to run a shell? `tail -f` some logs? All in first-class buffers.

- Why does it matter that things end up in first class buffers? Well, there's lots of random goodies like `meta-x json-pretty-print-region`, so if your execution dumps a blob of unformatted JSON or whatever, you can manipulate it readily. (Tab complete is available on these commands.)

- Autoformat your code automatically with a save hook. Autoformat it on your own schedule by calling something like `m-x blacken-buffer`. I don't think vi does as good a job of manipulating the contents of your file with internal and external programs.

- undo-tree-visualize.

Re:Toward a “modern” Emacs by demosito666 on Saturday September 26, 2020 @03:21PM (#24601428)
Vim can do all of the above pretty easily. In fact, I have a mapping for json pretty-printing, filtering it with jq; mapping for autoformatting with black or other formatter depending on file type; a plug-in for undo history tree. I don't have configuration for running tests the way you do, but I know a guy who does something very similar in vim.

I don't think the things you describe are the differentiators for the Great Editors. For me it's more their phylosophies that make them stand apart: despite the wide usage, vimscript is far more clunky, narrow-scoped and less powerful than elisp. Which means that stitching together something complex is hard and awkward in vim. Emacs is far more suited for complex processing due it's nature of a lisp machine. The chords are awkward though. So, "emacs is a good OS, but it lacks a good text editor".

Re:Toward a “modern” Emacs by fennecfoxen on Tuesday September 29, 2020 @08:02AM (#24626622)
> I don't have configuration for running tests the way you do, but I know a guy who does something very similar in vim.

I would love to see that: everyone I know who uses Vim ends up typing out test names in a separate terminal, or running some sort of a shell-out command that suspends editing of the current file until it is complete, and then hides its output.

Re:Toward a “modern” Emacs by mkesper on Saturday September 26, 2020 @04:57AM (#24597380)
Try doom-emacs, consequently evil-mode and highly adaptable. https://github.com/hlissner/doom-emacs
Re:Toward a “modern” Emacs by alkyon on Saturday September 26, 2020 @08:08AM (#24598187)
I used to use Vim, but switched to Spacemacs and never looked back. I highly recommend it as it gives you Vim bindings with all Emacs possibilities.
Re:Toward a “modern” Emacs by mark_l_watson on Friday September 25, 2020 @07:37PM (#24595141)
I second gnulinux’s comment, that is amazing. I would estimate that over 1/3 of my colleagues over the years used Emacs at least once a day and for many it is their main driver.

It seems like I spend a fair amount of time mosh/tmux to remote servers and I like copying over my Emacs configuration, be up and running. Same for users of vi or vim.

VSCode has good remote server development support also, so there are great options to keep most people happy.

Re:Toward a “modern” Emacs by hnarayanan on Friday September 25, 2020 @06:11PM (#24594640)
I’m nearly 40 and I’ve used it as my primary text editor since I was a teen and daily for my job.

For your anecdata collection.

Re:Toward a “modern” Emacs by ericd on Saturday September 26, 2020 @01:01AM (#24596561)
Depends on who you know. Among my friends who went to MIT, a good number use emacs. It’s really, really nice to be able to use the same editor everywhere, regardless of whether you’re using your local machine or ssh’d into a VM or server. Also, knowing that it’s not likely to be deprecated in the next couple of decades.
Re:Toward a “modern” Emacs by ashtonkem on Saturday September 26, 2020 @12:44AM (#24596491)
What language? Some languages have Emacs usage in the range of 0%, such as Java and C#.
Re:Toward a “modern” Emacs by oaiey on Saturday September 26, 2020 @02:02AM (#24596758)
That is very fair question. In my experience of html, css, js/ts, C#, VB, java, php, c/c++ and python I have never seen any emacs users in 20 years. I think it is really a language and region cut going maybe back to the universities supporting lisp or something else
Re:Toward a “modern” Emacs by ashtonkem on Saturday September 26, 2020 @11:47AM (#24599641)
Maybe it’s a region thing. Back when I did Python it was fairly popular, but VS Code appears to have largely taken over in that language, much to me continual confusion.

Most of the other languages you listed have extremely poor Emacs integration, both for cultural reasons (C# devs tended to be on Windows), and because some of those languages are so dominated by other IDEs that nobody bothered to write a good emacs extension. Java is a great example of this; the IntelliJ experience in Java is just so good, nobody managed to come anywhere close in Emacs, which created a self reinforcing cycle.

Re:Toward a “modern” Emacs by varjag on Saturday September 26, 2020 @03:40AM (#24597088)
It is fairly common with C programmers, and C++ programmers outside Windows ecosystem.
Re:Toward a “modern” Emacs by quadrifoliate on Friday September 25, 2020 @06:18PM (#24594693)
Since you mention IntelliJ, is it possible that the corporations you have worked in have been heavy on Java?

JDEE (http://jdee.sourceforge.net/) exists, but even I give up on Emacs when I want to write a lot of Java (and I use Emacs for literally everything else, including JS).

Re:Toward a “modern” Emacs by schwartzworld on Friday September 25, 2020 @06:31PM (#24594781)
JS development in IntelliJ/WebStorm is an amazing experience. The refactoring features alone make it easy to write code without worrying about details like "where does the file go" or "what should I name this". You can get the code working and rename / move code with a single click later on, knowing the refactor will propagate through the app.

The intellisense is amazing too. Start typing a method name and you see arguments with type annotations. it's overkill for scripting, but working on tangled legacy code it's very helpful.

Re:Toward a “modern” Emacs by xapata on Friday September 25, 2020 @08:24PM (#24595391)
I've heard people say that, but what I find is that they pick shitty names and never refactor. I'm on a different team now. Most of us use vim.
Re:Toward a “modern” Emacs by schwartzworld on Friday September 25, 2020 @08:58PM (#24595550)
Yeah, but then when someone tells you in code review to pick a less shitty variable name, it still takes one click.
Re:Toward a “modern” Emacs by xapata on Friday September 25, 2020 @09:06PM (#24595586)
Sadly, when you get a reputation for giving that feedback, people stop asking you to review.
Re:Toward a “modern” Emacs by schwartzworld on Sunday September 27, 2020 @09:20AM (#24606410)
Damn. You must work on a shitty team.
Re:Toward a “modern” Emacs by xapata on Sunday September 27, 2020 @03:45PM (#24609574)
I'm on a different team now.
Re:Toward a “modern” Emacs by elevader on Saturday September 26, 2020 @03:24AM (#24597035)
I don't do a lot of java development but https://github.com/emacs-lsp/lsp-java works really well for me.
Re:Toward a “modern” Emacs by User23 on Friday September 25, 2020 @11:56PM (#24596289)
I wouldn’t write Java in an editor that wasn’t hosted in the JVM. The advantages are simply too great. On the other hand that’s a very Lispy attitude so Emacs still influences me. And Eclipse at least has tolerable Emacs style bindings available. Still it sucks how much more of a PITA it is to create an Eclipse plug-in than to just write a page or two of elisp.
Re:Toward a “modern” Emacs by oaiey on Saturday September 26, 2020 @01:57AM (#24596740)
Same here. 20 years, Europe, corporate and open source projects, zero emacs users. Seen vim, notepad++, sublime, uedit, atom and vscode. And all types of fat ides
Re:Toward a “modern” Emacs by guenthert on Saturday September 26, 2020 @02:49PM (#24601187)
Yeah, we European Emacs users went to the states to earn real money :^)
Re:Toward a “modern” Emacs by oaiey on Sunday September 27, 2020 @02:08AM (#24604580)
Uh ... That was a punch. Love it :)
Re:Toward a “modern” Emacs by johnisgood on Monday September 28, 2020 @12:02AM (#24612843)
Well, one Eastern European Emacs user here. :D
Re:Toward a “modern” Emacs by formerly_proven on Saturday September 26, 2020 @06:07AM (#24597643)
I use Emacs for writing plain text because of Alt-q, and for tiny snippets. For coding I use real IDEs (JetBrains / Visual Studio) and can't be arsed to use a dumb editor, plus trying to configure to do "the right thing" w.r.t. to code style and indentation across a couple language is very annoying.
Re:Toward a “modern” Emacs by gnulinux on Friday September 25, 2020 @06:35PM (#24594807)
Is this a USA vs the rest thing? I've worked in many startups in the US and almost everyone uses emacs. Last few years, VSCode has been getting popular though. I had a similar experience when I was a student in UC Berkeley, although it seems like there were more vim users in school than in industry. Anyway, pretty much all my current coworkers use Emacs and I work in Boston, MA.

Personally: I cannot imagine programming without emacs, to me programming is so strongly associated with emacs...

Of course, I also understand that it's all personal preference.

Re:Toward a “modern” Emacs by quanticle on Saturday September 26, 2020 @05:05AM (#24597416)
This is a "your tiny bubble vs. everyone else" thing. I'm a professional programmer in the US, and, even when I was working in a Clojure shop, I was the only emacs user. Think about that for a second: even working at a company where every dev is paid to write Lisp, I was the only one who bothered to set up emacs. The other developers were using the Clojure plugin for IntelliJ or the Calva plugin for Visual Studio Code.

And, to be honest, I can't exactly blame them. I tried setting up Calva the other day, just to experiment, and its out-of-the-box experience was far better than emacs'. It was literally just a matter of installing the extension and loading a Clojure project (I was using Leiningen for my project definition, but Calva supports others as well). It brought up a REPL, it started doing autocomplete, and you could even hover over symbols to view their documentation. And none of this required any kind of manual configuration on the part of the user.

At this point, I honestly can't really recommend emacs to any developer who doesn't already know how to use emacs. If you want to start programming, just download VSCode and get the plugins for your favorite language.

Re:Toward a “modern” Emacs by sokoloff on Friday September 25, 2020 @06:46PM (#24594861)
From your username and Boston's proximity to MIT and FSF, it's possible that your experience isn't totally representative. :)

Mine isn't either and I find it hard to imagine owning a computer (or using git beyond the very basic operations) without having access to emacs, but it does seem likely that coworkers won't have completely independent text editor preferences. I would expect to see more VS and VSCode in the Redmond, WA area, even at places that aren't Microsoft.

Re:Toward a “modern” Emacs by usr1106 on Friday September 25, 2020 @08:08PM (#24595318)
> I've worked in many startups in the US and almost everyone uses emacs.

Others claim the opposite. Maybe the contradiction is explained by the hiring culture. Startups with emacs users hire more emacs users. Not that they would make emacs usage an explicit criterion or even ask such interview question. But probably there are some properties over-represented in 4% (or whatever the figure is) of programmers that are emacs users.

Disclaimer: Part-time emacs user since 1986 or so, full-time emacs user since 1989. Should spend some time to learn the newer features / customize it in a more compatible way with the rest of my software. I am lazy to make "another" editor as Stallman puts it even if I like Lisp hacking occasionally, but I would happily switch to a modernized configuration if it were available upstream.

Re:Toward a “modern” Emacs by agambrahma on Friday September 25, 2020 @07:29PM (#24595090)
It has definitely been this way _as far back as I can remember_ (at least the last two decades).

There have always been popular tools. Most of them haven't stuck around though.

Emacs has.

I wouldn't recommend using it right away though. Instead, I'd recommended accumulating some pain by using other popular editor-like,workflow-like,manipulation-like tools, because that might be the only way to appreciate what Emacs brings to the table.

(though I have to acknowledge VSCode's achievement, gaining massive adoption in what has always been a fragmented space)

Re:Toward a “modern” Emacs by bryal on Friday September 25, 2020 @06:11PM (#24594641)
In my uni, many professors used Emacs when demonstrating. For example, one course [0] used the Agda language [1] as a proof assistant. Afaik, the only good interactive Agda interface is the Emacs Agda mode [2]. Maybe you just live in a region of the world that happens to have a weak culture of using Emacs?

[0] http://www.cse.chalmers.se/edu/year/2017/course/DAT350/

[1] https://wiki.portal.chalmers.se/agda/pmwiki.php

[2] https://agda.readthedocs.io/en/latest/tools/emacs-mode.html

Re:Toward a “modern” Emacs by logicprog on Saturday September 26, 2020 @01:12AM (#24596606)
I use emacs for everything. I'm a hobbyist and computer science major (sophomore, undergraduate). Hell, I use emacs to edit the markdown that gets rendered to a predefined Latex template for my philosophy classes!
Re:Toward a “modern” Emacs by Jtsummers on Friday September 25, 2020 @05:36PM (#24594365)
org-mode and magit seem to bring in a lot of emacs users, even if they're only using one of those two things. If I stopped using emacs for code tomorrow, I'd still use org-mode and magit and still encourage others to do so as well, even if I also pushed a different editor or IDE for writing code.
Re:Toward a “modern” Emacs by chriswarbo on Saturday September 26, 2020 @08:03AM (#24598152)
I've worked with many programmers who use Vim, although I've personally never grokked it.

I've used Emacs for years for editing/programming, running shells and reading news/email.

I've attended two universities in the UK and it was used by default for some of their programming/computational courses; this was in different departments (Physics and CS), a decade apart.

Emacs has been used to build user interfaces (e.g. ProofGeneral, which was the de facto interface for theorem provers like Coq and Isabelle for many years).

Some programming languages de-facto assume they're being written via their Emacs mode (notable Agda; similar to how some JVM languages assume they're being written in Eclipse or IntelliJ).

Years ago I inherited an academic research project which happened to be written entirely in Emacs Lisp.

Re:Toward a “modern” Emacs by dan-robertson on Saturday September 26, 2020 @10:09AM (#24598968)
I think it hugely depends on the programming languages one uses (or used to use), as well as personal history. For example basically everyone learning lisp was, for a long time, encouraged to use emacs (I think this is still the case for Common Lisp but I’m not sure about other varieties). This makes for a pretty unpleasant lisp learning curve as most people are not already familiar with emacs. Other functional languages in the ML family may not be very similar to lisp in many important ways but because their lineage went back to lisp people and environments, emacs ended up usually being the editor with the best support, though this is less the case these days.

If one looks at computer history there seem to be several versions of a cycle that looks like “crap underpowered computer slowly gets more features and better performance only to become outnumbered by a smaller slower cheaper computer.” Depending on where one fell in that cycle, emacs may not have been an option (eg if you were starting programming on dos or an early windows you likely wouldn’t be using emacs. If you were starting at the same time using a Unix workstation, emacs might be a reasonable or recommended choice).

During the early naughties you were probably using windows and not exposed to emacs unless you worked on Unix/Linux based web backends.

Re:Toward a “modern” Emacs by guenthert on Saturday September 26, 2020 @02:57PM (#24601253)
You're going way back in time there though. I started like the other kids in my generation with BASIC on 8bit home computers, but my first paying programming job (early nineties on a shared Unix workstation which crashed about once a day, much more reliable than the Windows PCs of that era), I was given the vi cheat sheet. At first I thought that was worse than CP/M, but it did grew on me quickly. At home I used Emacs on a PC with 8MiB RAM (and it wasn't constantly swapping). Emacs was perfectly usable there, but when using a 9600baud serial terminal, vi was snappier.
Re:Toward a “modern” Emacs by dcolkitt on Friday September 25, 2020 @08:49PM (#24595502)
I've used emacs ever since college. I've tried a bunch of IDEs, VSCode, Sublime, Atom, even vim. They just never felt as comfortable as emacs in the terminal.

I'm probably in the minority since, despite a decade-plus of use, I'm by no means a power user. I use a little bit of org-mode and babel here and there. I can hack around in elisp if I want to tweak a mode. But that's about it. To be honest, I don't even compile code or navigate the directory tree from inside emacs.

That being said, two reasons I don't think I'll ever switch. One, the key bindings and commands just feel more elegant. Don't know if that's because they're locked into my muscle memory, or they're genuinely better. Two is that I live in the terminal. IDEs are great, but I much prefer just piping find to grep to sed or similar bash-fu, when I need to do something fancy.

Re:Toward a “modern” Emacs by Igelau on Friday September 25, 2020 @06:16PM (#24594682)
I have a feeling the SO numbers aren't accounting for Org Mode users.
Re:Toward a “modern” Emacs by doxanthropos on Saturday September 26, 2020 @07:04AM (#24597879)
Same feeling, especially with the number of Org users that are not programmers, but just writers. There has been a time for me, when I used vim for programming and Emacs with Org Mode for structured texts, like essays and articles, so I can imagine there being a lot of people outside of the CS and dev bubble enjoying their Org Mode and not being counted by any survey.
Re:Toward a “modern” Emacs by cozzyd on Saturday September 26, 2020 @01:12AM (#24596605)
Strange, I feel like I'm in a minority among physicists for using vim instead of emacs. Many new students seem to prefer GUI editors though...
Re:Toward a “modern” Emacs by eigenhombre on Saturday September 26, 2020 @08:46AM (#24598395)
Makes me happy to hear some physicists still use Emacs.

- Former physicist turned programmer

Re:Toward a “modern” Emacs by ashtonkem on Saturday September 26, 2020 @12:40AM (#24596473)
Heavily language dependent. I used nothing but Emacs until I switched over to Java, where IntelliJ is king. The level of Emacs usage I’ve seen depended a lot on what language was being used, it seemed much more popular for Python users than Ruby, for example.
Re:Toward a “modern” Emacs by agumonkey on Friday September 25, 2020 @09:13PM (#24595617)
but how is % usage related to tasks ?
Re:Toward a “modern” Emacs by liability on Friday September 25, 2020 @05:51PM (#24594483)
Nov.el is my favorite ebook reader.
Re:Toward a “modern” Emacs by da39a3ee on Friday September 25, 2020 @05:55PM (#24594522)
The hypothesis that Emacs is used for many things is consistent with the hypothesis that Emacs usage is rare. This is because many humans have existed over the years, so a staggering array of tasks can be addressed in even a small fraction of those person-years.