I use prettier-mode and editorconfig-mode. Everything is formatted on save so works well for me.
I got pretty close apart from the above sticking points. I only moved on when I realised how much time I was spending writing Emacs Lisp to solve my remaining pain points. I miss it, though!
2. I think you'll want to write some elisp for this. I use apheleia though, maybe it does this?
3. async-shell-command or... hmm... there is a emacs binding to a go library for managing async processes I can't recall the name of.
4. vterm is best in the sense of most support for ncurses things. I personally try to use eshell for everything. As far as different tabs/splits emacs should be able to do that. Can you give a specific example of something you had trouble with?
> Can you give a specific example of something you had trouble with?
I hoped to recreate multiple long-running terminal sessions in splits and tabs, similar to functionality I now use from:
Neovim (plugin): https://github.com/akinsho/toggleterm.nvim
VS Code (built-in): https://code.visualstudio.com/docs/terminal/basics#_managing...
I just found “popper”, which didn't exist the last time I looked. It seems like a pretty close substitute:
> Neovim (plugin): https://github.com/akinsho/toggleterm.nvim
> VS Code (built-in): https://code.visualstudio.com/docs/terminal/basics#_managing...
The example in that vscode link can be replicated in emacs by:
1. having a single buffer open 2. C-x 2 (split-window-below) 3. C-x o (other-buffer) 4. C-x 3 (split-window-right) 5. C-x 3 (split-window-right) 6. C-x + (balance windows)
If that seems unwieldy you can also make a macro to automate such a thing or anything your imagination can come up with. Then any function you make (such as saving that macro to a name) can be bound to a keybinding of your choice.
If that's interesting to you, also see "Keyboard Macros are Misunderstood":
https://www.masteringemacs.org/article/keyboard-macros-are-m...
In fact, if you really want to understand Emacs in addition to replicating your current vscode workflow or even to augment your current workflows you should check out his book that was recently updated for Emacs 28:
https://www.masteringemacs.org/book#free-sample
He typically updates the book pretty quickly, so you'll get any future updates he may make. I still highly recommend the current version after having ready 5 or 6 chapters recently and feeling like I leveled up my own understanding.
2. https://github.com/radian-software/apheleia
3. There might be a way to do this but I'm not sure. Emacs being inherently single threaded probably makes this difficult. But yes, I use M-x (re)compile.
4. libvterm is the best still imo. You can definitely do multiple instances and there's even different tab modes in Emacs now.
Apheleia in particular was new to me — I don't think it even existed last time I looked. So good to see the Emacs community continuing to thrive and invent.
Emacs has zero issue with multiple compilations - they're handled asynchronously. If threading was an issue it would kill Emacs with just one active compilation let alone many. The lack of threading in Emacs is a significant issue, but simultaneously nowhere near as restrictive and troublesome as many people seem to believe.
It's irritating that Emacs inhibits simultaneous compilations by default, but that's literally simply down to buffer naming. Emacs uncompromisingly uses a buffer called "*compilation*" for compiliation and will only run one at a time in a buffer.
There are simple hacks floating around to have compilation create a unique buffer name, then it happily runs as many as you like. Also, `projectile` has the setting `projectile-per-project-compilation-buffer` which enables this by putting the project name in the compilation buffer name.
I do echo the sentiment that it is not an easy out-of-the-box experience, and the learning curve is steep, though this is the sort of configuration that I assume the likes of doom set up by default. But even then, starting with doom is a much more significant endeavor than starting with VS Code.
But once you learn and develop your Emacs set up it becomes a delightful, malleable, and extremely powerful environment that's comfortable like an old leather chair, and where it isn't, you make it just how you want it. Some of us were lucky enough to accumulate proficiency over years and decades starting in a time when there weren't easier options with comparable power.
I love to have people join us and appreciate it, but it's not an easy process to get to the payoff.
EDIT: try `g` for "refresh"/recompile.
Maybe that's just me though, not sure this is an official method.
Until I set this up correctly the leftover buffers bothered me. Now it's part of my workflow.
I often have code from two projects side-by-side in split windows. Projectile restricts all of my actions to the appropriate project Autocomplete, code navigation, file search, fuzzy greps, everything uses the buffer's project as context.
With just two key presses I can close all buffers for any open project.
I have yet to try apheleia, but I wouldn't be surprised if just enabling apheleia, dtrt-indent, electric-indent-mode (a built-in I don't use, but which may cover your indent-on-paste desire), and editorconfig-mode (https://github.com/editorconfig/editorconfig-emacs) in prog-mode-hook just did what you wanted.
vterm is awesome, I recommend using multi-vterm if you want more than one
1. Which project management tools do you recommend? (I think I was using Projectile in the past, but from what I recall it left buffers from previous projects open when switching to other projects, which ended up being kind of annoying.)
2. Any advice about automatic whitespace/indentation handling with Emacs?
Ideally I want to have Emacs automatically:
- Use a prettier config if present.
- Fall back to editorconfig if present.
- Infer whitespace from the file if no formatting configs are found.
- Match and auto-format indentation when pasting text.
That's pretty much how it works with VS Code. I really struggled to recreate this in Emacs the last time I tried, and as silly as it sounds it ultimately put me off using Emacs. (I work across a lot of repos with different languages and conventions; with Emacs I had to double-check every commit for whitespace issues, but with VS Code I rarely think about it.)
3. How do you handle long-running processes in Emacs? I struggled to find a way to run multiple build processes in the background and quickly switch between/kill/read output/restart them. (Is M-x compile the right approach, or is there something else?)
4. Is libvterm still the best terminal emulator for Emacs? From VS Code/tmux I'm used to being able to summon multiple terminal instances with different tabs/ splits, and the experience in Emacs felt less good last time I tried to recreate this.