reddit / emacs

Emacs as IDE

BilboBaggings123 · 2022-12-17 19:41
I've been learning about the difference between neovim and emacs. Some people have pointed out that which would be best for someone mainly depends on what you want to use it for. Which makes sense. ​ And I think for myself, first and foremost, I would like to use either neovim or emacs as an IDE. Does Emacs work well as an IDE? The main languages I'd be using would be: Python, Assembly x86 with AT&T syntax, R, Maxima, Latex, And maybe some Java
SchleppingScone · 2022-12-17 20:07
For an IDE, I use Emacs exclusively. The major advantage to me is not having to relearn setup for every new language.
bravosierrasierra · 2022-12-17 20:59
Emacs is a beautiful programmable editor. If you needed IDE, just use IDE, do not waste your time to self-assembly semi-IDE: editor with some IDE-like functions. I use Emacs in Vim mode (evil-mode) and when i need IDE functions, then i switch to VS Code with Vim plugin. But if you want, then you can enable LSP plugins (developed for VS Code).
luiggi_oasis · 2022-12-17 21:03
Agreed. I made the same point a few days ago but it didn't seem a popular take. https://www.reddit.com/r/emacs/comments/zl6il1/comment/j06w775/
DistilledProblems · 2022-12-17 21:23
I learned emacs because vscode keybindings werent for me.
xlarsx · 2022-12-17 21:29
I use Emacs as my only text editor & IDE, it is powerful enough that you won't miss anything else, specially if you have LSP enabled (Python, Javascript/Typescript, Lisp, Org-mode, Markdown, etc.)
andyjda · 2022-12-17 22:24
Depending on the language and one’s needs, Emacs might have all (or the vast majority of) needed IDE features. And since it comes with a lot of additional features, and a well-integrated environment that uses the same key-bindings throughout, there are many advantages to actually not switch to a separate IDE. But I will note that it depends on the language. I use Emacs for Python and have never really felt like I was missing out on features. But when I tried setting up LSP mode for java I kept running into issues and realized it was much easier to just stay within Eclipse. @OP, I think Emacs has potential to work well as an IDE for all languages you listed (though note my previous caveat with Java). You can just search “Emacs set up for {specific language}” to get you started. The main thing will probably be LSP mode for all of these. Getting all the set ups right will require some effort, but you can ask here or other forums, and people will be happy to help. For python, I use LSP mode (with the package lsp-pyright), pyvenv for virtual environments, and blacken for formatting
paretoOptimalDev · 2022-12-17 22:30
> Emacs is a beautiful programmable editor > If you needed IDE, just use IDE Then what do you use Emacs being programmable for? > do not waste your time to self-assembly semi-IDE: editor with some IDE-like functions This sentence seems like "don't waste your time programming emacs" to me, but I know that's not what you mean given your other statements. I guess I don't see why you draw the line of not programming at ide-like functions.
konrad1977 · 2022-12-17 22:48
Seriously I don't see anything that VS Code can do better as a IDE than emacs. Intellij, Xcode, VS studio yes, VS code no.
[deleted] · 2022-12-17 23:04
[deleted]
bravosierrasierra · 2022-12-17 23:07
i remapped vs code keybindings to my own emacs+evil
BilboBaggings123 · 2022-12-18 00:32
Does it work well with syntax highligting, automatic indentation etc?
BilboBaggings123 · 2022-12-18 00:33
Cool thanks! I wonder if it also works well for Assembly since that is a much more niche language
BilboBaggings123 · 2022-12-18 00:34
I mean, all i need is: syntax colouring, automatic indentation, highlighting bracket pairs, and debugging Do you think emacs could do that for me or is that a waste of time?
BilboBaggings123 · 2022-12-18 00:37
Cool! I'll searching! Thanks
BilboBaggings123 · 2022-12-18 00:41
Thanks I'll give it a read!
BilboBaggings123 · 2022-12-18 00:42
What does VS Studio do that emacs or vs code cant?
BilboBaggings123 · 2022-12-18 00:43
Thanks for the advice! So Emacs is the way to go? Better than something like neovim also? For programming that is
BilboBaggings123 · 2022-12-18 00:53
Does it work well? what language(s) are you using it for?
ComprehensiveAd5882 · 2022-12-18 00:57
I use it as a WM, so, _of course_.
ComprehensiveAd5882 · 2022-12-18 00:58
I bet you could find an package that'll allow that
AdRadiant6795 · 2022-12-18 01:30
Emacs is a powerful integrated environment. It has some awesome features/packages like magit and org-mode. However, it's slow performance wise (relatively to neovim), Elisp, the extension language is mediocre, and it requires a lot of configuration (even an emacs distro like doom) Neovim is fast, and arguably requires less configuration and learning than emacs does. Probably has less features than emacs. Tried AstroNvim distro recently and really liked it. Both are fun to play with but when I get irritated with breakages or having to configure anything I open up VS Code to get work done.
Gangsir · 2022-12-18 01:51
Reimplementing major IDE features that do fancy things into emacs is less efficient than just using an ide that works out-of-box. People shouldn't feel like they aren't a "real" emacser unless they do literally everything in emacs. For particularly "involved" langs like C#, it'll be far less painful to just grab VS than to try and implement a ton of stuff into emacs. Is it possible and even fun? Sure. Is it an efficient use of time? No.
PhantomSeahorse · 2022-12-18 01:55
Assembly isn’t a single language. There are different kinds of assemblies
Gangsir · 2022-12-18 01:57
Many lots of fancy things like gui debugging, profiling tools, etc - it's possible to do this via emacs launching an external program (almost like vim style), but that's annoying to make work cleanly.
golden_bear_2016 · 2022-12-18 02:05
> Does Emacs work well as an IDE? No, and please ignore others who keep on preaching that Emacs is a useful IDE. You are on an Emacs subreddit, so you will get people like u/SchleppingScone telling people Emacs can be a competent IDE. Emacs will never be as good of an IDE like IntelliJ IDEA / PyCharm. You can spend years customizing back and forth, changing bits and pieces, but at the end of the day, is it worth the **years** of your life to change Emacs so much to get it to be an IDE? For 99.99% of people, the answer is no. The 0.01% who actually does this either have too much time on their hand (unemployed) or does not know the value of their time. I have used Emacs for almost 15 years now and have spent many many years customizing it to be an IDE (e.g. LSP, CEDET etc...). I now do my programming through IntelliJ (IDEA, Rider, PyCharm etc...). I still use Emacs for org-mode, but Emacs will never be anything near the productivity of an actual IDE. And trust me, I customize my own personal org-mode a lot. I have org-mode that save org headings and contents into a database, which I can then do free text search and display the result in a org buffer which I can then seek back in the original org file, along with many many other custom functions. So I know a bit about Elisp and Emacs, and people who tell you that Emacs can be an IDE is leading you down to wasting **years** of your life. --EDIT-- and yes, I welcome the downvotes. Just trying to save OP u/BilboBaggings123 from wasting years of this life on a doomed adventure.
CorysInTheHouse69 · 2022-12-18 02:20
Works perfectly fine
CorysInTheHouse69 · 2022-12-18 02:20
Better debugging imo
CorysInTheHouse69 · 2022-12-18 02:33
Of course asking on r/emacs will give you a biased answer. However I truly believe it to be much better than neovim. I think that neovim is nice but it is ultimately limited by being in the terminal. Emacs (in the gui) gets a lot more options both visually (like displaying images, videos, and non-mono space fonts) and functionally (able to send keys that you can’t in the terminal like C-i and C-m). Besides that though, emacs is a *much* more flexible editor than neovim. Neovim really restricts you to vim bindings. In emacs you can pick whatever binds you like: emacs, vim, cua (which is what’s “normal”), or something entirely different like kakoune, meow, or your own custom. From my experience emacs encourages customization whereas neovim encourages you to stick to the “vim standard”. PS: don’t listen to any bs arguments against emacs. The most popular being “the binds are unusable”. Emacs encourages you to change the binds to fit yourself so if the vanilla really are unnatural or uncomfortable you can make them whatever you want
ekd123 · 2022-12-18 04:18
I think Emacs can serve you well. Meanwhile, VSCode and NeoVim can also serve you well. So "used as an IDE" is not a deciding factor here. As for me, I use Emacs exclusively. Speaking as one who was once proficient in Vim, I feel more productive using Emacs, but it can be a delusion. I don't know. ;-)
DistilledProblems · 2022-12-18 06:34
C and it works extremely well
hhoverton · 2022-12-18 07:13
I use C# for unity and exclusively use emacs. It used to be a bit of a struggle to get setup when I first started like 10 years ago, but now that Isp-mode is a thing I get all the ide behaviour I want with basically zero setup. (besides a debugger, but I'm pretty sure that's possible now with lsp I just haven't tried for about 6 years)
hhoverton · 2022-12-18 07:17
What features of intelliJ do you feel like are missing from lsp-mode? I guess I've never used the advanced features of an IDE, but lsp can give me auto-completion, refactoring, code actions, etc right out of the box. *Spelling
golden_bear_2016 · 2022-12-18 07:32
Can you get it to work? Sure. How long will it take? It will take you just a couple of minutes for some things, but hours / days for others. There's a lot of finicky shortcuts / features, e.g. IntelliJ Context Hints, navigating backward / forward, remote debugging (lsp tramp is complete trash compared to IntelliJ), new .NET features etc... Getting all of that to feature parity with an IDE will take years out of your life, along with constant maintenance. You're essentially playing IDE developer against an entire company (in Microsoft / IntelliJ's case). That is just not worth my time. I just download IntelliJ IDEA / Visual Studio and all of that work out of the box and I can be productive immediately.
popsyking · 2022-12-18 07:40
Remote SSH into a server and edit/run code there (Emacs has tramp which is...a lot worse).
thoomfish · 2022-12-18 07:52
YMMV based on how good LSP servers are for your language. Python LSP servers don't begin to hold a candle to PyCharm, for example.
TheDamnGondolaMan · 2022-12-18 08:00
Syntax highlighting, indentation, and showing matching delimiters are a piece of cake. For completeness, these are text editor features, not IDE features. Debugging (kind of an IDE feature) is a little harder. Out of the box, Emacs can at least debug emacs-lisp (with built-in features) and C (via gdb integration). Beyond that, take a look at [dap-mode](https://emacs-lsp.github.io/dap-mode/) for other language options. Similarly, take a look at [lsp-mode](https://emacs-lsp.github.io/lsp-mode/) or [eglot](https://joaotavora.github.io/eglot/) for code completion, more advanced linting, etc. Ultimately though, if you're looking for a full IDE, depending on the language, you may be better off sticking with something pre-assembled (i.e. Intellij, Visual Studio, etc., and not VS Code, Sublime, etc.). I have gotten Emacs to satisfactory levels for my amateur Python and Rust development, but I still use (and probably always will use) Intellij for Java and MARS for MIPS assembly. Emacs can do text editor sorts of things for both of these languages, and it can (via dap-mode and lsp-mode) do basic IDE things for Java. Even then, though, it's not nearly as powerful as full iDEs, especially when it comes to language-specific features.
EmilySeville7cfg · 2022-12-18 08:43
I've attempted to setup Python and Lisp support in Emacs to get VS Code like experience (similar intellisence, code linting and formatting). By all means, it worked fine for me but definitely IMO Emacs is not smth "ready to go" for programming: you have to setup it manually or use Emacs distributions those provide such functionality for you. Is it interesting to customize Emacs and maybe write extensions for it? Yeah, I think so. Is it the best choice if you don't want to spend some time setting up IDE-like features? Probably, no. For me customizing VS Code and creating extensions for it is simpler as almost all customizations are done via JSON which I keen on. TBH I don't need too much power in customization which Emacs provides, I don't want to write code to customize extensions. And I prefer JSON or YAML configs over those are written in "real" programming languages. Anyway Emacs is better choice for me compared to Vim as ELisp is more easy to learn for me even it's not smth like JavaScript or Python. :) P. S. I use vanilla Emacs 27.1 with my own config as I wanna understand and what's actually going on. I prefer IDEs and editors in their default distribution with my own custom settings.
condor2000 · 2022-12-18 10:05
Depends on the programming language
grimscythe_ · 2022-12-18 11:23
Yes it does
patakattack · 2022-12-18 12:36
Yeah I use Emacs to edit code remotely and I really wish there was more capability there. It’s not a deal breaker since I mostly do small changes, but still.
BilboBaggings123 · 2022-12-18 13:14
Thx!
BilboBaggings123 · 2022-12-18 13:15
Ah, okay Which do you use and for what language?
BilboBaggings123 · 2022-12-18 13:17
Thanks! I'll keep that in mind!
BilboBaggings123 · 2022-12-18 13:30
Thanks! I'll keep that in mind!
BilboBaggings123 · 2022-12-18 13:30
Nice!
BilboBaggings123 · 2022-12-18 13:31
True, in the original post i specified that its Assembly x86 with AT&T syntax
BilboBaggings123 · 2022-12-18 13:32
You've tried it?
BilboBaggings123 · 2022-12-18 13:32
Probably yes :)
BilboBaggings123 · 2022-12-18 13:32
it's such a difficult decision!
BilboBaggings123 · 2022-12-18 13:35
Thanks! ive always found the "the key binds are bad" an odd argument because you can just change them. Also, have you used Emacs as an IDE? And if so, for what language(s)?
BilboBaggings123 · 2022-12-18 13:35
Ah okay
BilboBaggings123 · 2022-12-18 13:36
Could you ellaborate on why tramp is bad?
BilboBaggings123 · 2022-12-18 13:37
What do you not like about tramp?
BilboBaggings123 · 2022-12-18 13:38
Thx, what languages do you mainly work with?
BilboBaggings123 · 2022-12-18 13:41
Thanks for the advice! And I'm glad you decided the post despite anticipating the downvotes
BilboBaggings123 · 2022-12-18 13:45
May I ask, have you tried neovim and what do you think about it?
BilboBaggings123 · 2022-12-18 13:48
I'll keep that in mind!
BilboBaggings123 · 2022-12-18 13:48
Could you ellaborate on those PyCharm features?
popsyking · 2022-12-18 13:59
In my case having the ability to run code on a remote machine, or on a docker container, or on a docker container running on a remote machine, is quite essential/useful. Vscode is super smooth for these tasks, it really is a pleasure. I tried tramp for the same tasks in the past and I had a lot of fiddly issues to configure it, get it to work, and even then I remember it was quite unreliable, would lose the connection etc. I really wanted to like it because I wanted to switch to Emacs for coding but the experience was so inferior to vscode that I just decided to stick with using Emacs for org mode and do all my coding in vscode. I dunno, maybe I should give Emacs+tramp another go. But the thing is that vscode "just works" and i don't have the time to fight with Emacs because I want to focus my time on the software not the ide.
patakattack · 2022-12-18 14:30
I don’t even know if it’s TRAMP tbh, but there is noticeable lag when working remotely, occasional crashes. Most of all, there doesn’t seem to be a straightforward way of using LSP when working with remote files.
BilboBaggings123 · 2022-12-18 14:31
Thanks! Yeah having stuff working out of the box is a big factor
BilboBaggings123 · 2022-12-18 14:32
So did you switch to something else? Or do you prefer to use emacs despite the drawbacks?
patakattack · 2022-12-18 14:41
I’m still using emacs because these features are not critical (I don’t need them too often). Mostly what I do is edit code locally (where I have all the features) and then push to a git repo that I pull from on the remote machine.
BilboBaggings123 · 2022-12-18 14:42
Ahhh, smart!
Psionikus · 2022-12-18 14:53
Use Emacs as a programmable way to interact with a computer. This includes installing packages that implement IDE behaviors. And then just automate all of your interactions. For your particular case, gathering up the configurations may take a bit of work. Maybe try Doom for a bit to calibrate your expectations with minimum effort and then try to get the things you rely on under your own control over time.
BilboBaggings123 · 2022-12-18 15:00
Thanks for the advice!
thoomfish · 2022-12-18 16:32
None of the Python LSP servers I've tried have been as good at inferring types of un-annotated library code as PyCharm, and they also don't offer the same level of code actions. In particular, fix missing imports almost never works in my experience.
spartanOrk · 2022-12-18 16:46
I tried vscode once, but I couldn't be productive immediately. I had to relearn different keybinds. Navigating a single buffer was hard. I went back to emacs and installed LSP. I spent 1 day configuring it (mainly googling how to disable some intrusive features), and that was it. Now I can keep using what I already knew, and only had to learn a few new things about LSP.
BilboBaggings123 · 2022-12-18 16:59
Ah i see, thanks!
BilboBaggings123 · 2022-12-18 17:05
Thanks!
BilboBaggings123 · 2022-12-18 17:06
nice!
paretoOptimalDev · 2022-12-18 18:09
Most of tramps issues were solved for me by setting up the ssh ControlMaster setting: https://xenodium.com/speeding-up-emacs-tramp-via-controlmaster/
BilboBaggings123 · 2022-12-18 21:54
Thx!
[deleted] · 2022-12-19 02:09
[deleted]
a-concerned-mother · 2022-12-19 03:44
I'd definitely say so. If anything I have found that with lsp-mode and dap-mode it's as capable as any other ide if not more. There are some ide exclusive things that are a little lack luster in both emacs and neovim. For java there are a few things intellij has that I lacked but rarely used e.g. test coverage generation. For the most part this is possible without an ide at all.
BilboBaggings123 · 2022-12-20 01:54
Thx! Have you tried both emacs and neovim? How do they compare as IDE's?
BilboBaggings123 · 2022-12-20 01:56
Thanks! I've heard a lot of good about Org Mode
a-concerned-mother · 2022-12-20 05:45
Hard to completely compare them since there is a ton of overlap in what behind the scenes is doing all the heavy lifting. for example lsp and dap protocols have options for support on both emacs and neovim. I'd say that lsp-mode (for completion, linting etc) is about on par with the native language server protocol support in neovim with a lot less setup. Though I have heard some people run into performance issues with some languages in Emacs. I haven't really faced this and when I did it was usually the server sucking up system resources. Dap-mode in emacs is a much nicer experience since debuggers in general do mesh better with a gui I find. Emacs also I find works better as an "IDE" for certain things e.g. emacs can have multiple windows that share a single session meaning you can have multiple views on different monitors with a shared state.
BilboBaggings123 · 2022-12-20 11:01
Thanks!
chaozprizm · 2022-12-20 16:14
One of the primary features of an IDE is a debugger. This is something that can be set up in Emacs, but after significant configuration, and the UX and capability will not match that of a e.g. Jetbrains debugger. Let’s be honest. There are many other powerful things an IDE can do that Emacs hasn’t caught up to yet.
[deleted] · 2022-12-20 23:15
[deleted]