Hacker News new | ask | show | jobs
by Geminidog 2049 days ago
I really wish there was a batteries included vim-like console editor with all the power of the jet brains suite of IDEs and convenience and lightness of vim.

As it stands right now I end up using both an IDE and vim.

Maybe emacs is the answer but honestly if I look past all the yak-shaving to get emacs to the power level of an IDE does it really get to the point where it has everything that say CLion has?

8 comments

I'm not sure about the specifics, but providing something a lot more "batteries-included" seems to be the idea behind Emacs distributions like Spacemacs and Doom Emacs.

One difficulty is that language-specific tools (language servers, linters... etc) are standalone pieces of software with their own dependencies, requirements... etc. It's hard to bundle together a fully "batteries-included" Emacs without figuring out a way to manage native software and services.

I think this is one place where Nix can be a real advantage: even if you don't care about Nix's reproducibility, it's ability to manage Emacs, Emacs packages and language-specific tools is pretty unparalleled. If I had some more time on my hands, I would try putting together a Nix-based Emacs "distribution" with some easy way to configure which languages you want to work with. Coupled with lsp-mode and language-servers, this has some real potential!

I'm positive some sadist somewhere in this world has all the software on their OS as a nix expression. I'm also positive that at least one of these people has a fully featured emacs IDE and all the required dependencies as part of that expression.

Totally down to try it if anyone has it.

One thing good about just standalone vim though is how portable it is. I can ssh into any server and fire it up. I also want this for a IDE. I want a console level IDE to fire up on any server I ssh into and if it's not in that server I want to be able to use any package manager to DL it easily.

I can't see any editor/IDE solve the above problem unless the editor becomes the ssh client itself. With that setup in place then my IDE can go anywhere.

"the editor becomes the ssh client itself" is effectively how I use Emacs. TRAMP (https://www.emacswiki.org/emacs/TrampMode) makes editing remote files pretty much as seamless as editing local ones. I even semi frequently do slightly-crazy-seeming things like open files via chains of several ssh hops and I can "save" them (read: marshal a complex operation involving scp, base64, and other sourcery) in exactly the same way I can save something to the home directory on my workstation. TRAMP is a default part of the Emacs distribution (and has been for over 10 years), so it doesn't require installing extra packages or even enabling anything. It's just on by default.

This capability, plus "frame" management commands and the various terminal modes make my use of Emacs roughly equivalent to they way I see colleagues (I'm an ops/sysadmin type, not really a developer) using vim + tmux.

Oh yeah, I am one of those people myself[1] :). But my setup is quirky and hard to customize. (Well, hard to customize for other people, anyway.)

Nix had a learning curve, but once I got over the initial hump, I stopped wanting to manage software any other way.

To get from my setup to what I'm thinking of here, I'd need to organize it as a package that's convenient for others to depend on, fill in a bunch of missing systems and factor out support for specific languages and tools into some kind of module-style config system. Thinking about it now, it's probably just a few days' worth of work.

Emacs, by the way, does work as an SSH client (via TRAMP). I do all my work on remote servers by SSHing from a local Emacs. It's not perfect, but it works well enough in practice that I haven't tried finding anything better.

[1]: https://github.com/tikhonjelvis/dotfiles

funnily enough it's something I've been working on for my personal dotfile setup but instead unfortunately decided to go with ansible for now despite being a big fan of both nix and nixos. Nix was just a bit too heavy for some of the small lxc containers etc I wanted to setup.
you could consider sshfs
This actually exists for Common Lisp: https://common-lisp.net/project/lispbox/

It would probably be doable for other languages, if you were so inclined

Emacs mostly has problems with external language servers because its plugin model is archaic and brittle to a large extent compared to that of say VS Code. It's also far more flexible but with power comes responsibility, and I've found Emacs extensions far more likely to interfere with each other than in less composable editors. You don't need Nix to fix this problem.
Nix would help pull in the right versions of all the external non-Emacs packages you would need for a real IDE experience. Almost all the issues I've had with Emacs plugins have boiled down to poor interactions between Emacs and external software (wrong versions, wrong paths... etc), and Nix could fix basically all of it.

As a bonus, using Nix to manage Emacs dependencies would also give me full control over exactly which version of each package to pull in. This would create much more of a "distro" experience without needing any extra infrastructure.

Given the brittleness there should be at least a single configuration that works. I believe that tikhonj is right in the sense that nix can capture this configuration. Nix is not required but I can see how it can help.
Nix would be useful for a description of the non-Emacs dependencies. Particular versions of the compiler and LSP program. -- Some languages are more fickle about this than others.
This was indeed the promise of spacemacs. I tried it a few times and roughly 30% of the advertised features were broken out of the box.
I've used Spacemacs for Clojure development for many years without issue though it looks like it isn't being maintained much now.
Micro editor is a pretty good balance of lightness and batteries included.

https://micro-editor.github.io/

HN discussion: https://news.ycombinator.com/item?id=23334190

Emacs is not an IDE, it’s a multipurpose tool with many of the same features commonly associated with IDEs. Spacemacs and Doom Emacs (my recommendation) are highly useful distributions that make a lot easier to achieve that goal.

But, even so, Emacs will still not be an actual IDE like those made by JetBrains.

You sacrifice some specificity for a world of flexibility.

An IDE-like Vim would be a negation of everything that Vim stands for. I don’t see any point in that.

If you really need an IDE, just use one.

>Emacs is not an IDE

No it's not. Why are you telling me something I never said? I believe you are utterly mistaken to believe that I hold this opinion.

>If you really need an IDE, just use one. >I don’t see any point in that.

You don't see the point because you completely missed the point.

I want an IDE that is as lightweight as vim/emacs and as powerful as a Jetbrains IDE and lives on the console.

So right now if I "just use" an IDE it's not lightweight as it likely runs on the JVM, I can't fire it up on a console when I'm ssh-ed into a server.

If I fire vim up on a server I can't get any code highlighting or code following or integrated graphical debugging without a lot of yak-shaving and even after I do the yak-shaving it's still not done as well.

I want both on one app. Now you may not like this idea, you may be opposed to it. But this is what I'm asking for and this is my opinion. I respect your opinion but please don't tell me to "just use" an IDE when that is not the topic of the conversation.

> No it's not. Why are you telling me something I never said? I believe you are utterly mistaken to believe that I hold this opinion.

For clarity maybe? Relax dude. You are not on trial.

>Relax dude. You are not on trial.

Uh. I am relaxed. I'm trying to get you to relax. You should be more self aware as you're actually the one that kind of seems on edge with your initial post.

You barge into this thread with a tone that is dismissive, opinionated and wrong. You're telling me to "just use an IDE" and also that "emacs is not an IDE." I'm just telling you to stop doing that.

I usually won't tell someone to "relax" or that they're "not on trial" because it's kind of insulting and dismissive. It's also a strategic move used to flip the script to make another party seem overly emotional.

Just Read the thread next time before you respond so aggressively with your opinionated views.

>For clarity maybe?

Nah not for clarity, this is a lie. People aren't stupid and they know why they say the things they say.

You said it because you believed that I held that opinion and you wanted to dominate the conversation by telling I'm wrong. You made a mistake and you didn't really read my post. Don't do it again.

I too tried spacemacs and loved the initial 30 minutes. And then I wanted ESLint, and maybe even TabNine for autocompletion. After several hours looking up random gist files I gave up. I don't get paid to edit lisp configs to get my IDE to the usability level of the one my company already pays for (IntelliJ). It's a real shame, but I just don't have the time or energy to deal with those configs.
The Oni editor [1] based on NeoVim seems to be aimed at something like that.

> Onivim 2 aims to bring the speed of Sublime, the language integration of VSCode, and the modal editing experience of Vim together, in a single package.

Currently in alpha, but according to this blog [2] pretty usable and has support for VSCode plugins too.

[1] https://github.com/onivim/oni2 [2] https://seanchen1991.github.io/posts/onivim2/

does it really get to the point where it has everything that say CLion has?

No, it doesn't. There are probably other reasons to try emacs but 'as capable as a JetBrains IDE' is not among them.

As it stands right now I end up using both an IDE and vim.

If you think of it not in terms of text editing but as "tool that operates on files" and "tool that operates on 'projects'", it makes more sense that many (most?) people end up doing something like this.

Yeah I can think of it that way. But I don't want to. I want a batteries included ide as lightweight as vim and as powerful as Clion, not two tools.

Currently you see a bunch of programmers divided into two camps. Those that prefer the vimish style and those that don't want to deal with the yak shaving and prefer tons of features.

The thing is these qualities are not actually tradeoffs in principle they are only tradeoffs by circumstance.

Why not the IntelliJ Vim plugin with Clion? I think the better distinction is Vim for editing text, IDE for performing non text editing tasks.
It's less about the key mappings and more about the portability and lightweight nature of vim. So Clion runs on java and is really heavy while vim can be spun up instantly while you're sshed into any machine. I want both of these features combined.
Ah, I did not see where development on a remote machine was the constraint. In that situation you’re options are more limited for sure.
I'm pretty sure that given enough yak-shaving, Emacs could be augmented with lots of IDE-like features that happen to be implemented in the main distribution, at least in some form. The question is whether you want to bother, given how obscure that whole area is.
Recently, I tried VS Code with the vim plugin and didn't find it to be too bad. Then again it isn't lightweight, but I think part of the problem is, that every programming eco-system has its own tools and one-size-fits-all solutions are unlikely to be small ;-)

However, it VS Code didn't convince me to give up my regular tmux+vim combination.

Well vscode is written on electron. Your editor in that case is a full blown browser basically.

I see no reason why something as lightweight as vim or emacs can be configured to be as powerful as vscode while being much more lightweight.

IDEA Vim?
I mean the ide does have vim emulation but that's not what I'm thinking about. Try the other direction:

Vim IDEA