395 points · by e3bc54b2 · 5y ago · 218 comments
A few years back I got into Atom quite a bit since it checked all the boxes: extensible, open source, and it was very nice. Then VSCode killed it. And it seems more and more that VSCode is taking over, all the while inserting more proprietary code to the point where half the 'big' plugins don't work on Codium, only the proprietary MS distribution.
So I got back into Emacs but really worked on my environment. Stopped dabbling and started just forcing myself to use it. And it's honestly amazing. It checks off every box available in VSCode and more. And it's nice knowing that it'll always be there. I'm not against proprietary software per-se, but I definitely don't have a lot of trust in Microsoft.
(yeah, that model led to poor performance, but afaict that's a combination of (a) just JS things and (b) not putting any effort into the design)
> I definitely don't have a lot of trust in Microsoft.
Very wise, given the user-hostile stuff they've been doing in Windows recently...
This feels a bit self-contradictory, since one might argue a properly designed extension API must include process isolation, so naively-written extensions can't mess up the main loop. VS Code extensions are also in JS.
This is the same problem that, say, preemptive multitasking solves, and why Windows 3.1 crashed much more than '95 and XP.
We're very close to a world in which we don't have N implementations of finding the start of a C function or figuring out what parts of a Python buffer are keywords.
I love vim (err… Neovim), and this was great.
Others here seem to have taken this as tongue-in-cheek. On the first read I took it as "I think vim is ridiculous". I'm honestly curious to know which it is (or if both are inaccurate).
Then, recently, I _really_ wanted to try org and thought "I'll force myself to use it". I started with Evil mode and Doom. I was blown away tbh. What I thought to be an "old" tool that would slow me down, is actually a massive booster (and fun!). My personal experience, of course.
Doom seemed right to me at the time because I just wanted to uncomment `;; org` in `init.el` , not learn a lot of keybindings and get started.
I think I'll start an "Emacs from scratch" someday too.
One of the reasons I haven't seen mentioned much is: I'm a touch typist, and I hate having to switch between mouse and keyboard! I have to take my attention off the screen. Slows me down. Disturbs my concentration.
With Emacs, I can work for hours without ever having to hunt for the mouse, or without even having a mouse plugged in. That's particularly nice for using my Ubuntu laptop on a lap desk, leaning back in my armchair. The best mouse is no mouse at all.
Yes, I know many IDEs have shortcut keys for some commands, but the basic assumption with GUI applications is that you have a mouse. Even if you learn the shortcuts, somehow you always end up having to use the mouse for some common task, e.g., to select a paragraph. That's why I never got to like a GUI IDE, despite having had to use Eclipse for years.
For learning a lot of cool stuff about implementing my best book is The Craft Of Text Editing
I've told IntelliJ and Eclipse and VSCode to please stop popping up suggestions, and let me type Ctrl+space to summon them.
Aaaah. Much better.
However, I still type easily without looking at the keyboard, and I'm about as fast as the average typist, perhaps faster.
Could I speed up more? Possibly, but I don't feel that I'm slowed down by typing speed, and I find my way to type better when one uses a lot of special characters, as is common when doing programming and accessing Emacs keys.
I have never, ever heard about it.
Edit: by touch typing I mean having your index fingers on fj and from there using ALL keys without ever leaving the starting position, and yes that includes shift, alt and control and special characters.
I know very few people who are really touch typists (I am a proficient one), and I don't believe for a second people are taught touch typings, it's a skill that requires consistent training.
That said, being a programmer and not touch typing definitely sounds odd to me as well
I got carpal tunnels a few years back from emacs, which forced me to try https://ergoemacs.github.io/ . I like it a lot, it's more sensibly designed. I've found it a pain to install though...
I'd love to be able to type from muscle memory, but the keyboards keep changing!
There's a reason F and J have bumps on them, or why we have two shifts, etc.
For anyone interested into relearning how to type efficiently I want to recommend this free website full of tutorials and exercises: https://www.typingclub.com/
Actually that’s a regression. At one point some keyboards (Apple IIRC) put the bumps on D and K, which made it much easier to notice when your hands were misplaced.
It’s easier to notice that the wrong finger has the bump than noticing that no finger has the bump beneath it.
consider putting a photo of your keyboard next to your screen and painting the keyboard a nice uniform black.
your body-mind's intelligence will swiftly learn to position your hands and coordinate your/its fingers without adding things to unlearn later.
the photo of your keyboard near where you are focusing when looking at the screen makes a huge difference, one could start with just that.
I could probably put a gun to my head spend a month and learn it but I do not really feel it slowing down my programming (I spend more time thinking and drawing some skeletons) so I've never bothered.
Modern Emacs can be (and mostly is) compiled with GTK support and features a GTK interface, but can be launched in text-mode with a command line argument. If you don't mind using bleeding edge versions, there is a branch called "PGTK" that allows the GTK interface to run natively on Wayland!
The two biggest Linux distros (Ubuntu and Fedora) are Wayland by default now. And the 'standard' Emacs distribution you install through the Software 'store' in both is GTK (which of course works). Wayland support isn't really a big deal anymore. I haven't come across any apps that don't work on Wayland.
¹I've tried mini-frame, and it's fine, but it's still just a utilitarian grid of text.
Still I hardly ever use mouse when using IDE's like Visual Studio C++ coding for example. It has shortcuts for everything.
cmd+shift+a opens a command palette with every possible command in the IDE. It matches as you type the name of an action, and every action has a keybinding shown to the right (if it exists).
Every relevant button generally has keyboard shortcuts right on them.
And pressing cmd+e opens a list of gui interactions you've made so you can repeat them (things like focusing buffers, clicking on a file in the project file tree, etc.)
Basically, if you know cmd+shift+a, you're golden for learning commands and key shortcuts.
In comparison, emacs/vim are pretty awful. I've done a few tutorials of each and while I could have spent more time learning them, JetBrains makes it stupid easy to start learning the editor.
If you are not familiar what a particular command does you can use C-h f <function-name> to open the help page.
I think Emacs is really easy to learn after you get a handle of the navigation keys. Which you might already be familiar with from shell.
I'm sure if I went back to Spacemacs now, I'd understand things a whole lot better, but as a new user, it was far too much to figure out at once.
So I went Vanilla, and haven't looked back. I do think that there should be some more articles out there like "so you've decided to try Emacs? Here's what to do beyond opening and saving documents". With a heavy emphasis on, as you said, incrementally adding to your configuration. Something like "here's why you split your config file into 2, with automatic changes going into one file, and manual going into another" followed by "here's use-package" and "if you want to X, here are Y packages that do it" with comparisons between each different way. But broken down into small chunks so things can be done incrementally.
I turned to VS Code + PyCharm for coding. And use Emacs for editing text only. And for that, it is excellent.
What I love about Emacs most is the macro recorder. Whenever I have to transform text, I record my steps in Emacs‘ macro recorder and replay the steps. That’s like magic. I wouldn‘t even bother writing a Python script for these one-off transformations.
You are in full control of how much tinkering you do, though. Strange to blame a tool for this.
Compare and contrast with Visual Studio Code, which has a much smoother onboarding experience.
Shout out to Prot who maintains it.
> Sometimes I wish I initially spent my time learning emacs. Vim has been great to me.
Try SpaceMacs, or even just Evil. I've found that Emacs (the text editor environment) and VIM (the language for interfacing with a text editor environment) skillsets are actually complimentary and together form a terrific text editor.One of the key things I found though is that I learned to compose tools outside of vi rather than rely on the editor functionality. This was applicable to much larger problem domains than just editing. The Unix philosophy of using lots of small well defined things to solve problems applies to editing text.
I still find myself reaching for Vim when I want to just write a simple script. Emacs, VS Code, etc. can just be too much sometimes.
I realised that if I'd started minimal I would have reinvented so many of the spacemacs wheels, but done it worse.
Spacemacs could do with being slightly more user friendly. It gives you a lot of friendliness already, but to prevent people from being frightened off by emacs' formidable reputation it really needs to "work" out of the box. For me that would be one click install and a reasonable suite of IDE-like features for working with a given language pre-configured. That would include scripting to install the command line tools that they shell out to, e.g. ag or rg.
It replaced vim on the cli for me.
I used to do this too. What stopped me was that I often use emacs as a terminal multiplexer with vterm, and it becomes super difficult to control vim if you have evil-mode capturing those same inputs. In the end oh-my-zsh (more crappy bloat like spacemacs which I love to bits) has an alias called "e" which will open a file for editing in your current emacs.
(If only it worked through docker! Or maybe it does and I just don't understand TRAMP well enough yet.)
My first serious Emacs engagement happened in 1996, with XEmacs. Then it became my editor of choice for basically two decades. I can confidently say that I can open your Emacs setup and manage my way around it (unless you happen to be an evil-mode infidel, that is).
The only reason I have not tried is I seem to spend most of my time thinking about the change, and the time saved is easily wiped out by the time taked to re-write the line 5 times.
The thing is with Emacs, you can really optimize every key stroke if you want, but usually I'm too busy using it to program so I optimize the workflow only time to time.
I didn't know about SelectiveUndo. Nice.
I think that Org-mode is now the fourth piece of software on my never-gonna-give-you-up list, after VIM, GNU coreutils, and Anki. I seem to add one per decade.
For me Emacs fulfills the same purpose as Vim, but mostly in exactly the opposite way of how I want it. Some people prefer that, I don't. It's a great program, but not my cup of tea and so I don't use it. Vim does everything I need without annoying or distracting me, which is rare enough.
What kills me about emacs is the startup time. Breaks my flow when I'm jumping around and need to edit something quickly.
Though I'll admit that doom provides a very nice environment for when I want to play around with some lisp.
emacs --daemon
emacsclient <fie>
systemctl --user enable emacs.service # For next login
systemctl --user start emacs.service # launches it just this once
This means I never have to even THINK "I should boot the editor", because it's already ready.Add a keyboard shortcut for emacsclient and you're golden
emacs --daemon=<name>
emacsclient -s <name>
Useful for when you have different contexts and want to separate them more cleanly. alias ec="emacsclient -n"
in my shell.)But, yeah. I use it for the start up time/vim compatibility out of the box.
also, there's zile.
I appreciate the tip about zile though. That looks cool.
Discoverability problem? You don't say?
Power comes from being able to customize - add a easy shortcut to show outline, add another to back to non-outlined. Then use these to jump around code.
This works even better with languages with varying form and spelling. Finnish Android autocomplete gives mostly annoying and mispelled suggestions, but in Emacs you can use your own writings as the sublime storage of words.
Actually, your question made me realize that the interesting part of vim is the modal editing interface, while the interesting part of emacs is everything but the text editing bits. So, focus on those.
Does that help, or have you already tried this?
https://www.youtube.com/playlist?list=PLGP2UnPoZ7HzLGU2cyK1M...
https://github.com/noctuid/evil-guide
https://www.spacemacs.org/doc/VIMUSERS.html
Best of luck!
I did implement all kinds of funky customisations at first, but in the last years I stuck mostly to what comes with Emacs, and customize over writing Elisp. I do some work in IntelliJ and Xcode out of necessity, but there's nothing quite as productive for me as vanilla Emacs and ansi-term. It's all just text - and mastering how to deal with text doesn't take that long, and is fairly universal.
One of my favourite and most trivial habits is to use forward/backward search extensively for navigating around a file.
I'm sure vim and emacs were great tools back when monochrome monitors were all that were available. But with modern UI IDEs and what not, I only use vim when need to make fast and dirty changes directly on the server. I do find all of things that can be done in emacs/vim quite impressive, but I'm also quite happy that it is not the tool I have to use because nothing else is available.
I do find myself getting environments backwards in my head though when flipping back and forth quickly. Like typing :wq in my IDE, or cmd-s in vim when prompts my terminal to save my session.
I know X can export over a network connection, but text mode Emacs is much simpler and does not require X.
It held up surprisingly well. The Emacs terminal display system dates from the days of low-baud terminal sessions and so decouples screen updates from the editing input. I.e., it's smart enough not to try to fully update the screen on every keystroke when the terminal connection is slow -- not unlike dropping video frames to keep up. So you can type ahead with some lag and know that it will bring the screen up-to-date as efficiently as possible whenever it can.
I do always have a spacemacs window open, but I only use it for magit.
I can recommend it to anyone that tried emacs but didn't like it.
What specific features of vscode would you like to see in a terminal editor?
So to me, the "win" of vstudio is the tiny command pallete that is used & the shortcuts are displayed in menus. (& everyone mentions the difficult hill to climb to learn emacs or vim by comparison).
The thing which will never work in terminal is ctrl-c and ctrl-v. (Macos covers this nicely by using cmd-... tho). It's a shame.
I actually use le editor in terminal, but am rather cramped using it. I consider learning vim or emacs once every few years... and go... nah, no thanks.
Eg. There are a few comments above about region undo. In vstudio it sounds ugly, but it's trivially easy. Press and hold undo (ctrl-z) and let key repeat until the block appears as you want. Select it, copy. Press and hold redo. Select area. Paste.
Tastes are different.
If you enable cua-mode in Emacs, C-c and C-v work perfectly fine as copy and paste. Even in the terminal.
> There are a few comments above about region undo. In vstudio it sounds ugly, but it's trivially easy. Press and hold undo (ctrl-z) and let key repeat until the block appears as you want. Select it, copy. Press and hold redo. Select area. Paste.
That works in practically every editor. The entire point of region undo is that it's faster and more convenient than doing it manually.
In fact, in VIM, everything _is_ a shortcut.