News for hackers. Stuff that matters.
Re:Emacs for Professionals by pmoriarty on Tuesday May 03, 2022 @05:03AM (#31246202)
I used vim for over 25 years before switching to Emacs, so I'm perfectly capable of using both, and do use both.. but for me Emacs does virtually every that vim does and more, while vim only does a couple of things that I need that Emacs can't, and I find myself needing vim pretty rarely.
Re:Emacs for Professionals by ducktective on Tuesday May 03, 2022 @05:58AM (#31246485)
Professor Moriarty, a couple of questions:

Is this switch because you've moved on to LISPs?

Doesn't startup time and lag of emacs (compared to vim) bother you?

Re:Emacs for Professionals by pmoriarty on Tuesday May 03, 2022 @06:12AM (#31246558)
The startup time of Emacs is not an issue because I only start the Emacs server once and keep it running for a long time, connecting the Emacs client to it as needed. Once the Emacs server is running then connecting to it is as fast or faster than starting vim from scratch. Even restarting Emacs from scratch can be effectively instant, if you don't have a giant config like I do. Vim startup time can be slow too, by the way, if you have a lot of plugins. So, effectively, vim and Emacs don't differ on startup time these days like they used to.

As to your question about Lisp, it definitely was a huge draw to Emacs because I fell in love with Lisp and almost the entire ecosystem of Emacs is written in Lisp... and I'd certainly much rather program in Lisp than vimscript, or even Python (or any of the other more mainstream languages).

I remember coming across various things I wanted to do in vim that were pretty awkward to do because of how clunky vim and vimscript were. Lisp and Emacs just made doing what I needed much easier overall (though some things were still easier in vim.. for example, vim has some powerful features in its regex engine that don't exist in Emacs, even when using Evil). This was before neovim, so maybe it's better there, though since both vim and neovim lack Emacs' Lisp ecosystem, I doubt they'll ever be able to match Emacs in this respect.

There were a lot of other reasons for the switch to Emacs, like having deep web browser and shell integration, being able to read my email from within Emacs, and do a ton of other things from it.. org-mode was another draw.

Re:Emacs for Professionals by ducktective on Tuesday May 03, 2022 @06:31AM (#31246669)
While you were using vim, did you use tilling window managers? Did you use a dmenu-driven workflow that calls bash scripts and unix utilities?

When people talk about "composability" and "integration" of EMACS, it strikes to me that, vim+i3+unix setup is essentially the same. Just instead of LISP, bash/python is the glue language.

Re:Emacs for Professionals by joeman1000 on Tuesday May 03, 2022 @06:50AM (#31246782)
But why use so many monolithic tools that don’t want to talk to each other? Why ‘glue’ stuff together? Shouldn’t the underlying system take care of that? That is the appeal of emacs, to me. I don’t have to work hard for uniformity. I implement something once (a theme change, for instance) and it’s reflected everywhere. I want to change the font in emacs? Easy, one line in my config. I want to change the font for all of my programs on my Unix system… far out.
Re:Emacs for Professionals by striking on Tuesday May 03, 2022 @07:16AM (#31246942)
Yeah, but when everything lives inside the same Lisp environment, there is no need for glue. You have variables and functions, all with built in documentation, that are easily composed.

Vim, on the other hand, appears to conspire against the user's attempts to build reusable configurations. One plugin may require Neovim. Another may require the Python runtime to be configured and installed. Vanishingly few of them have built in keybinds, and those that do are not guaranteed to be harmonious with other plugins. And besides, should I write my config in vimscript or Lua?

It might sound like I'm picking nits, but I don't find it coincidental that the best configurations that people have managed to build have been upon the strong bones that Emacs provides. Doom Emacs (https://github.com/doomemacs/doomemacs) is best-in-class, providing harmony between all of the built in modules and their bindings. I uncomment a line in a config file and get full Python support, with refactoring and formatting and such, ootb. This ends up being true for a shockingly long list of languages and tools.

On the Vim side you have https://github.com/NvChad/NvChad which appears to no longer be accepting new plugins and https://github.com/LunarVim/LunarVim which appears to provide a really good programming experience but is limited in scope to a handful of core plugins and whichever LSP servers they can get their hands on.

I used to use Neovim and compose everything together by hand as well. I don't see why I should bother today when Doom Emacs provides the same experience I would have built for myself, out of the box.

Re:Emacs for Professionals by karthink on Tuesday May 03, 2022 @06:51AM (#31246791)
The start up time of emacs isn't slow if you know what you're doing. I have a 14,000 line init.el and about 355,000 lines of code across ~150 installed packages. Emacs starts in 0.2-0.3 seconds. Not instant but practically there's no difference.

The downside of autoloading (lazy loading) all libraries is that there's a hitch when I first open a "heavy" elisp library. A PDF, an org mode document or something that launches an LSP server, say. But if I launch emacs to edit a bash script or a config file the speed is indistinguishable from vim.

Re:Emacs for Professionals by trey-jones on Tuesday May 03, 2022 @09:08AM (#31247803)
Agreed, and use-package is a big reason for this. New users, take heed and use-package from the start. Regarding the topic of using both Vim and Emacs, I do, but switching from one to the other can really mess me up. I would prefer to just use one, generally, and use TRAMP instead of Vim when possible for editing server configs and such. I have considered using EVIL mode, but I am wary of losing touch with default Emacs, as it's something that comes up from time to time as well.
Re:Emacs for Professionals by NateEag on Tuesday May 03, 2022 @10:31AM (#31248785)
Worth noting that you can replace evil-mode's insert-state with its emacs-state, thereby getting conventional Emacs keybindings when you're typing.

That's how I have it configured.

Re:Emacs for Professionals by pmoriarty on Tuesday May 03, 2022 @03:11PM (#31252263)
"I have considered using EVIL mode, but I am wary of losing touch with default Emacs, as it's something that comes up from time to time as well"

You're basically giving up almost everything that makes Emacs great: its ecosystem. Bare-bones, default, vanilla Emacs, without any packages or configuration is woefully underpowered compared to Emacs or vim with lots of packages and configuration. I hate to use either in their default states, and would have never switched to Emacs if I wasn't able to use Evil.

Re:Emacs for Professionals by trey-jones on Tuesday May 03, 2022 @04:36PM (#31253255)
Oh, I'm not at all saying I use default Emacs, I'm just saying that I'm concerned that Evil would change it so drastically that I would forget how to use default Emacs. Default in this case meaning "not evil".
Re:Emacs for Professionals by pmoriarty on Tuesday May 03, 2022 @07:07PM (#31254761)
In those rare situations where I need to edit a file on a machine that doesn't have Emacs+Evil, I just use vim or vi... which even when unconfigured are good enough to make small edits without much pain.

So I get the best of both worlds: Emacs+Evil 99% of the time, and vim/vi 1% of the time when Emacs+Evil is not available.

Re:Emacs for Professionals by outworlder on Tuesday May 03, 2022 @12:35PM (#31250326)
Try Doom Emacs (either to use it long term or to steal its approach).

Starts in under one second for me.

Re:Emacs for Professionals by elteto on Tuesday May 03, 2022 @07:38AM (#31247079)
Professor, is it true that Holmes is a Notepad++ user?
Re:Emacs for Professionals by daniel-cussen on Tuesday May 03, 2022 @11:12AM (#31249299)
More of a hardware user. Hard drugs, hard thought.

It's funny Arthur Conan Doyle says Sherlock Holmes is based on I think two guys, but there's a third guy he's also based on Conan Doyle didn't talk about, and that was the guy who cracked cases the hardest, just never talked about because of he was the one the whole coke-injection trances was based on (which was legal at the time). Protected his privacy, you understand.

Kind of like Paul Erdos.

Re:Emacs for Professionals by colordrops on Tuesday May 03, 2022 @05:08AM (#31246221)
Do you use some sort of extension or plugin to get Emacs to use modal editing and the home row like vim? Or did you switch over to the Emacs key bindings?
Re:Emacs for Professionals by pmoriarty on Tuesday May 03, 2022 @05:16AM (#31246266)
I use Evil to get modal editing, and have spent countless hours configuring Emacs to be as vim-like as possible. As a result I can easily switch between vim and Emacs and feel completely comfortable editing in both.
Re:Emacs for Professionals by colordrops on Tuesday May 03, 2022 @05:18AM (#31246283)
I'd love to switch, but have spent a significant portion of the last four months moving all my personal infra to NixOS. Will need to take a break and spend more time with the kids before diving into something like this again haha
Re:Emacs for Professionals by mplanchard on Tuesday May 03, 2022 @09:18AM (#31247910)
When and if you do, be sure to check out the emacs-overlay! It makes it super easy to build/install development versions of emacs, to compile with native-comp, and so on