News for hackers. Stuff that matters.
Re:Use GNU Emacs by forty on Friday March 03, 2023 @05:12AM (#35007775)
I switched from VSCode to Doom Emacs with very little of my own customization (doing TS, Scala, Rust mostly) a few years ago. There is not one thing of VSCode that I miss, and I enjoy some of the most powerful features like wgrep & all, and a great vim emulation layer (the one I had in VSCode sucked).
Re:Use GNU Emacs by mtzet on Friday March 03, 2023 @05:51AM (#35008007)
I agree. Emacs out-of-the-box is terrible, but my Doom Emacs config is all 50 lines of code. For that I get:

- IDE-like features via LSP

- The best git porcelain out there: magit. Even when I'm not using emacs, I come back to magit for code-browsing (recursive blame) and staging hunks.

- Emacs/vim's fantastic buffer/window concept, where open files are not owned by their windows. I miss this whenever I use anything else.

- project support to quickly grep across all files or jump to files

- Very mature vi keybindings, with their infinite composability

I still sometimes find that it's either too rigid or too manual at certain things, but I could say the same for CLion and VSCode. I still come back to CLion for its refactoring tool, the 3-way merge window and the debugger integration.

It is a bit messy though. It's very well done for what it is, but it's cobbled together from many disparate components. It seems that it should be possible to create the same type of experience from a simpler, more coherent system. I rarely update the base system, but when I do, I've occasionally had to google for some exotic elisp error and add a fix here or there.

Re:Use GNU Emacs by saeranv on Friday March 03, 2023 @02:42PM (#35014079)
> - Emacs/vim's fantastic buffer/window concept, where open files are not owned by their windows. I miss this whenever I use anything else.

Why is this useful? I basically treat my nvim buffers like windows. What am I missing?

Re:Use GNU Emacs by _a_a_a_ on Friday March 03, 2023 @02:56PM (#35014238)
Because you can look at and maniuplate the same file n different ways. Something I sorely lack when using e.g. visual studio
Re:Use GNU Emacs by saeranv on Saturday March 04, 2023 @11:47AM (#35022215)
I guess I need to experiment with this. I'm fairly conservative when it comes to experimenting with files since I find it always ends up triggering .swp file recoveries, which is not just annoying[1], but has also resulted in me accidently losing work before.

[1] Why can't we just delete the extra file after we recovered the .swp!

Re:Use GNU Emacs by _a_a_a_ on Friday March 03, 2023 @02:55PM (#35014228)
> - Emacs/vim's fantastic buffer/window concept, where open files are not owned by their windows. I miss this whenever I use anything else.

oh hell yes!

Re:Use GNU Emacs by weberer on Friday March 03, 2023 @07:44AM (#35008823)
But don't you miss your editor spying on you and sending your data straight to the NSA?

https://en.wikipedia.org/wiki/PRISM

Re:Use GNU Emacs by rrdharan on Friday March 03, 2023 @08:53AM (#35009637)
If you’re a PRISM target wanting to protect yourself from the NSA you’re gonna need a lot more OpSec than just switching from VSCode to Emacs.
Re:Use GNU Emacs by jmnicolas on Friday March 03, 2023 @09:07AM (#35009796)
That's the problem, we're all NSA targets, just unimportant ones.
Re:Use GNU Emacs by xrd on Friday March 03, 2023 @08:50AM (#35009599)
Since reading your comment, I have gotten very excited about Doom Emacs in the last 45 minutes.

But, now I realize this is a very powerful configuration of Emacs if and only if you prefer using the VI keybindings.

It looks like spacemacs is that as well.

I actually enjoy Emacs keybindings, and would like to find something as polished and supported as Doom, but without using VI keybindings.

Does anyone know where I should look for that?

Or, can I revert to emacs keybindings in Doom and use the rest of the amazing features? I'm concerned I might be swimming against a tsunami if I try to do that and would be better off finding another project.

Re:Use GNU Emacs by forty on Friday March 03, 2023 @08:58AM (#35009706)
While Doom defaults to Vi bindings with evil mode (and has awesome defaults to use evil mode almost for all modules) I don't think it's mandatory at all and you should be able to enjoy it without evil (I haven't tried but after all, non-evil key bindings are the default on Emacs :) )

See https://github.com/doomemacs/doomemacs/blob/master/modules/e...

Re:Use GNU Emacs by xrd on Friday March 03, 2023 @08:55AM (#35009669)
Re:Use GNU Emacs by tcmart14 on Friday March 03, 2023 @11:27AM (#35011668)
Spacemacs on initial start-up, it will prompt you to choose either evil mode (vi) or holy mode (standard emacs) keybindings. Before I went to vanilla emacs, I was a spacemacs user using the 'holy mode.'
Re:Use GNU Emacs by lkjdsklf on Friday March 03, 2023 @11:46AM (#35011933)
As mentioned, you can disable evil mode in spacemacs or doom.

There's also prelude which doesn't include evil by default. Not quite as fully featured as doom/spacemacs, but it's a good place to start.

All that said, you could just set it up from scratch. Now that lsp-mode and dap-mode are things, you can setup a fully featured IDE in not very much config at all. I have everything in my init.el and setting up projectile, lsp-mode and dap-mode which is like 85% of what you need for a fully featured IDE. That bit is only about 30 lines of config. Throw in flycheck, company-mode, hydra for keybindings. maybe treemacs for a project view.. a few hundred other lines to make it not all look like trash....

On second thought, it's kind of a pain in the ass. Just use clion or vscode or something.

Re:Use GNU Emacs by xrd on Friday March 03, 2023 @11:58AM (#35012137)
Lol, that last comment.

Can't I beg you to share your init.el? I want LSP and the other stuff but Doom even when turning off evil mode seems to far away from the emacs I'm familiar with.

Re:Use GNU Emacs by lkjdsklf on Friday March 03, 2023 @01:40PM (#35013417)
My config is pretty barebones these days. This is what i use every day for C++ dev work

https://pastebin.mozilla.org/mShC6Dm0

I'm still using evil mode. Most of my important functions are bound to some combination off space bar though.

It's certainly not perfect and has some "quirks" (or bugs if we're being honest), but it works pretty well.

Re:Use GNU Emacs by chimprich on Friday March 03, 2023 @12:10PM (#35012314)
Alternative opinion that you completely didn't ask for: I wouldn't bother with Doom, or any of the other pre-packaged Emacs distributions. If you like the default Emacs bindings, I would suggest just... using Emacs.

Unconfigured Emacs is a bit clunky, but you'll understand it a lot better if you configure it yourself. Also, just in my opinion, there are better options than the packages supplied by Doom.

My suggestion is to set up Emacs with use-package for package configuration (this will be in Emacs 29 anyway), and then you can easily play around with different package combinations.

I'd add a nice-looking theme first of all, then try adding the following modern packages, one at a time. Play around with them a bit before adding another so you know what they do.

Vertico - visual completion UI (selecting files, buffers, commands etc.)

Orderless - user-friendly completion framework

Consult - search and navigation commands

Embark - contextual actions

Marginalia - fancy completion decorations

Magit - nuclear-powered Git framework

Eglot - lightweight LSP functionality (will be in Emacs 29)

...that gives you a powerful selection of features that play nice together and you can easily build on.

Re:Use GNU Emacs by gshulegaard on Friday March 03, 2023 @12:15PM (#35012374)
I had the same realization...so I took some bits of doomemacs/spacemacs and incorporated it into my personal emacs configuration. I am not great at maintaining my config or writing elisp in general, but feel free to reference my config if you wanted to take a stab at creating a doomemacs-like experience with your own configuration choices:

https://gitlab.com/gshulegaard/my-emacs

Disclaimer: This config is a bit perpetually dusty at this point, so I wouldn't copy it verbatim but instead use it as inspiration for some packages that might be worth looking into. JFYI anything that is from Marmelade might be worth avoiding as I suspect it is unmaintained given it's SSL cert expired in 2018. I just haven't gotten around to removing it from my config.

Re:Use GNU Emacs by Rotareti on Friday March 03, 2023 @08:52AM (#35009621)
Same. I was using intellij, then vscode the ten years before I switched to doom. I tried a lot of other editors and IDEs, but emacs was the only one with good vim integration. From all editors I tried, it was also the only one with good plugin interoperability. In emacs plugins are often build up on the interfaces of other plugins. In vscode plugins tend to be encapsulated, competing units which often do not play well together. I also find it much easier to customize emacs to my needs, because the interfaces of both the system and the plugins are mostly well documented.

Emacs has a high barrier of entry though. I think it would be difficult for a novice to get a good IDE experience from emacs, even with doom.