reddit / emacs
My IDE is too heavy so I moved to Emacs
ReneFroger · 2022-12-13 20:49
brienzee · 2022-12-14 03:52
there’s plenty of free open source projects that are polished. it’s probably just not a major goal of emacs because it’s been around so long, some projects don’t care how accessible they are or their audience didn’t care about it but it’s not because they need a big company behind it.
avron_r · 2022-12-14 07:05
Just wait until your config gets bloated eventually slowing Emacs down. Just stop coding like right now. End it at a peak.
NoisyFrequency · 2022-12-14 08:37
I'm having the opposite reflection right now sadly. I just need to spend so much time to have Emacs working properly for each language and I'm still not on feature parity with other IDE's.
I still use Emacs for everything related to note-taking because `org-mode` and the ecosystem around it are that good but otherwise it's a bit of drag honestly :(
Pay08 · 2022-12-14 10:25
Really? I've found Emacs to have rather uniform configuration across languages. Maybe I just don't use many languages.
NoisyFrequency · 2022-12-14 10:30
Yeah, with languages that require specific package management, virtual environments, have different LSP's, etc.
Pay08 · 2022-12-14 10:38
I've found LSP-mode (or an extension to it) to handle all my LSP needs. I don't really know what you mean by specific package management. By virtual environments I take it you mean Python. That has always been a mess and is more the language's fault than anything else.
NoisyFrequency · 2022-12-14 10:47
Some languages have specific tools that you'll have to deal with, opam, npm, cargo. It varies between needing the tool to install for package management and the tools that are required to build.
if you do web dev, lots of languages have adjacent templating languages like Thymeleaf, Blade, etc.
I don't blame Emacs for not being able to do all of those at the same time but it gets pretty frustrating over time.
Pay08 · 2022-12-14 11:11
Oh, right. From what I know of web dev, it seems to be a gigantic mess. But you could quite easily just do language-specific package management from a terminal. It'd also be quite simple to write an elisp wrapper around them. There are multiple packages that do this for Cargo, for example.
NoisyFrequency · 2022-12-14 11:31
I mean, that's my main gripe, I don't have the time nor the knowledge to build those packages or manage everything manually. At some point I just want things to work.
I love tinkering but I want to spend time actually coding as well haha
HM0880 · 2022-12-14 13:15
At my last job, I'd open the same file in both Emacs and Matlab, do as much text editing as possible in Emacs, and Alt-Tab to Matlab for running/plotting/debugging. This worked well: Emacs for all the keybindings and Matlab for its tooling.
Maybe something similar would work for you? Emacs as an IDE is not my preferred workflow (for others, it is, which is fine!).
NoisyFrequency · 2022-12-14 13:45
What I like the most about Emacs is the interactivity, so I usually spin it up for scripts and things like that. But when working on a larger projet with dependencies, tests, etc. I often find myself getting back to more specific IDE's.
luiggi_oasis · 2022-12-14 14:40
True, my emacs start up time sits at 5 seconds but I can't be bothered to learn to use emacsdaemons it seems. For some reason I sort of like having multiple independent sessions open.
luiggi_oasis · 2022-12-14 14:42
Emacs is a great text editor but can't beat a full fat IDE when it comes to programming. At least in my experience, even a horrible ide like RStudio ends up being more productive than emacs. I use emacs 99.99% of time outside this specific use case tho.
cat-head · 2022-12-14 14:48
I keep my init time at below 1s. It really doesn't have to be much slower than that if you defer initialization of packages.
cat-head · 2022-12-14 14:50
How is R-studio more productive than ESS? 99% of my work is R coding and would never, ever pick Rstudio over ESS.
terminal_cope · 2022-12-14 16:51
You can have independent daemons by launching via `emacsclient -s <n> -c -a ""`, where `<n>` is any string to identify the daemon instance, but for me I have one per desktop workspace, so my `<n>` is the workspace number.
I also have a launcher script that finds the first one, when I actually want a client of another workspace rather than a new instance. My lowest numbered instance is my "primary" Emacs.
HM0880 · 2022-12-14 17:17
Makes sense. You didn't find LSP + Emacs to be sufficient for some tasks? I don't use LSP (yet), but lots of Emacs users are excited about the auto-complete features.
GreenSubstantial4469 · 2022-12-14 18:07
Welcome to the club. The good part is if you’re not using something you can just `:defer t` and not worry about it bloating your startup.
NoisyFrequency · 2022-12-14 18:31
There are issues, `corfu` lags with `lsp-mode` so I switched to `eglot` but now setting up is more difficult, you have to actually delve into `eglot`'s code if you want to use a specific language server for a language, it's not as easy as LSP.
There's also little debugging support or you have to setup stuff per language.
Again, I understand there's some tinkering involved and that the project comes as is but I only have so much free time.
kovrik · 2022-12-15 00:10
Same.
In Intellij everything is (naturally) very-well integrated, has the same look and feel etc. Which is expected because it is developed by a single company. Yes, it is heavy. But it does A TON. And modern laptops are super performant anyways.
Now, I do love Emacs. But it's not the same experience at all. It feels like I am always fighting with it, trying to make things work, tweaking it etc. Packages are developed by different people so each package has different look and feel, different keybindings, different behaviour. They often break each other.
Even simple things like seamless system clipboard integration require packages and configuration.
Take VSCode, for example. I can switch from Intellij to VSCode, install 3-5 extensions (VSCode Neovim, Project Manager, LSP and a bunch of Java extensions) with a couple of button clicks, and be fairly productive after that. Standard things like terminal, workspaces, tabs, syntax highlighting, fuzzy search, file explorer, source control, running and debugging - it's all going to work after that (or out of the box).
Making all those things work in Emacs is a non-trivial task.
luiggi_oasis · 2022-12-15 15:36
Part of it is that ESS never clicked for me, maybe I just never got to set it up right. Do you use ESS along with eglot? If you're willing to share your init.el, I'd appreciate it
[deleted] · 2022-12-16 13:06
[deleted]
luiggi_oasis · 2022-12-16 15:26
Lazy loading via use-package or something more clever than that? My init.el loads everything via use-package with defer t. I ran some profiling a while ago and there was nothing salient but a cumulative effect of all the settings.
luiggi_oasis · 2022-12-19 22:37
Here's a specific question.
I have a folder with many R files in multiple subfolders (an Rstudio project). One of them has a function called "do\_something\_now".
What's the ESS workflow for this? Open emacs, look up a symbol by a pattern (e.g., "something") in any file in this folder or subfolder?
cat-head · 2022-12-19 23:55
what exactly are you looking to do with `do_something_now`? do you need to find it? in that case there are several packages that offer jump to definition, like xref-find-definition. It works rather well if you're using vanilla ess, it works less well with eglot. Alternatively, you could use projectile to manage the project and grep for files, this works very well.
Alternatively, you can use imenu-anywhere, but that only works with open buffers.
luiggi_oasis · 2022-12-21 15:20
at least for now I want to find the do\_something\_now, which is defined in some file in this directory or subdirectories, and go to the definition. xref-find-definition worked, thanks for that! I didn't know much about xref so I guess that's something I should pick up if I want to use emacs for programming. Unfortunately tho, I had first to source all the R files, otherwise it wouldn't find the definition. It seems it looks up definitions loaded in the current session instead of indexing local files.
cat-head · 2022-12-21 15:31
> It seems it looks up definitions loaded in the current session instead of indexing local files.
Yes, it can only find a function if it has been sourced, but then, it's very useful. If you want to find it without sourcing it, you can use projectile-grep. To start a local project just create a .projectile file (or start a git repo) in the folder of your project, and then call `projectile-grep`. It will look for the function name in all local files to your project, whether sourced or not.
luiggi_oasis · 2022-12-21 15:44
Thanks, this looks promising cause 99.99% of my R projects are a git repo. So having projectile look up stuff in the repo without much additional configuration seems very convenient. From the name, I take it projectile-grep is not aware of semantics like xref would be, but xref needs everything to be sourced and I sometimes look up definitions that aren't sourced. The Control + . search bar in RStudio is convenient cause it indexes the whole project folder. However either xref for sourced stuff or projectile-grep for text matching should be enough 99% of the time.