by crispyambulance · 7y ago · 0 comments
I've had several bouts of trying to learn emacs throughout my life.
It isn't necessary to list all the benefits, sure, there's a lot. Yes, I get it's "extensible" and you can write little elisp programs to do just what you want.
Here's the obstacle: Motor skills. It just takes way to long to first memorize reams of commands and then to train your fingers to issue those commands effortlessly. In the meantime, searching, "apropos" and googling stuff isn't an attractive thing to do when you have _actual_ work to do.
That's a serious obstacle and no listing of all the awesome-ness of emacs is going to convince many of us to put in that kind of effort.
Leaning any new tool when you have work to do is never an attractive thing. Whether that's an editor, a language, an issue tracker, or any tool. There is always a period of learning that is less productive, but the hope is that after learning the new tool your overall productivity is higher, resulting is more gains in the long run.
Emacs out of box comes with menus and toolbars (underrated features) to accomplish most basic commands, so you shouldn't have to memorize a whole bunch of stuff to start being modestly productive. I think it's way ahead of vim in these regards, you don't have to learn a whole new paradigm of "modal editing" to get even the basics done.
Then you know it for life. Unquestionably worth it.
Emacs by comparison makes no sense to me.
I just feel it's "my" editor more than any other editor I've ever used.
edit: typos
So true! When I first tried to get into Emacs it was as a somewhat seasoned programmer who wanted to play with a Lisp other than Scheme. I've read the built-in tutorial and almost ran away in horror. I get it - for non-programmer users, yes, it makes sense to try to teach them the usage of an editor. I lost quite a lot of time trying to remember exotic chords like C-u C-x ^ a and so on, but it was ultimately meaningless - not one such shortcut remains in my config.
Emacs is an IDE for Emacs Lisp written in Emacs Lisp (and it's incredibly powerful at that, BTW). In other words, it's a bunch of APIs you can call, and it also gives you the place where you can interactively execute any elisp code and see the effects immediately in the same instance of the editor. It's obvious in hindsight, but I believe I'd get into Emacs much faster if I started with Emacs Lisp manual or maybe "Writing GNU Emacs Extensions" book instead of going through the Emacs manual (huuuuuge!) first and trying to bend my habits to fit the vanilla Emacs.
I think most programmers who wish to switch to Emacs should try to do it the other way: start with learning Elisp syntax and Paredit, then learn about modes, hooks, and key-maps and start hacking your own config. Everything else - buffers, windows, fringes, faces, what-have-you - you'll learn as needed when you need to implement a particular command which deals with them. Pull in a healthy amount of plugins then read their source - or just read the source of Emacs, as you can jump to definition of any function in one click, even if it's written in C - and before long you'll have a comfortable environment to work in, with all the features you learned to love from your previous editor. And that's when the fun part start: exploring Emacs features that you've never seen or heard about, wrapping external tools and streamlining their workflows, exploring the huge pile of add-ons.
Like you, I've tried before. After a day or two of trying to remember alt-command-blah-blah-blah every time I wanted to do something simple, I gave up. Then I started mousing around which totally defeated the purpose of trying to pick it up.
I also found (at least 7-8 years ago) the windows Emacs to be terribly slow. Hopefully that's not still true. That also effectively kills the learning experience after a while.
C-h f
And then I type sort of what I want (with helm or ivy, it's a fuzzy match) and select it from the list, which brings up it's documentation and what keystrokes call it.
There is also `where-is` if you remember the name, or `M-x` (or `M-:`) if you don't mind typing it out.
If you’re using macOS, you can also select “Quit Emacs” under the application “Emacs” menu, like every other macOS app.
If that wasn’t an option for you, very likely you’re not in vanilla emacs, or you’re in a particularly ancient emacs (which happens, but is as easily avoidable as using vim, VS, Sublime, etc.)
Do you know VI? You can use viper-mode and use it as VI. And it's not a handful of keystrokes as the likes of Eclipse implement, it's a full blown VI mode.
Your comment about "apropos" tells me you have never ever tried Emacs help system. There is a nifty tutorial, you can search for commands, functions, what have you. Need to know what happens when you type a keystroke, even down to the source code if you want? describe-key. Need to know anything about your enabled modes? describe-mode. And so on. There are more describe commands, but I never had to memorize them due to completion.
The only times I feel like using something like VSCode are:
– Learning a new and popular language: as of late, you can find nice extensions which sometimes even integrate installation of external commands, so you have a working system out of the box. Since I'm learning, I don't yet know what I need. This use-case is diminishing as of late due to Spacemacs.
– When I feel the need to have something "fancier" in terms of UI widgets. For instance, the popup golang help that VSCode provides is less disruptive than having a pop-up buffer. This is just a case of being attracted to eye-candy, which the exclusively text-based does not provide by design (although it can display graphics to some extent).
That's it. I always end up going back to Emacs as it provides so much more. And specially when interacting with Git, Magit is wonderful and far better than any applications I have seen - including the command line. Org-mode is always at my fingertips.
One thing though. If you are unwilling to learn Emacs because you are happy with your environment and you have other priorities, that's perfectly fine. If you are unwilling to learn Emacs _even though you feel that there are benefits_, then that's not a good sign. We need to learn new things all the time to stay relevant and productive. If there is a new tool, language or process that will improve your professional life, you are doing a disservice to yourself by refusing to learn.
Hydras further provide an attractive discoverable menu to remind you of what options are available.
Major mode hydra let's you define a hydra per mode and pops up the correct one based on the mode you are in.
https://github.com/jerrypnz/major-mode-hydra.el/blob/master/...
A useful thing is that it's possible on all major platforms to bind modifier keys like for example shift to produce a different symbol when pressed and released instead of held in combination with another key.
https://gist.github.com/tanyuan/55bca522bf50363ae4573d4bdcf0...
This means that for example you could use left shift to start global sequences and right shift for mode specific operations preferring short sequences for common operations.
Example lshift -> b switch buffers lshift -> f r find recent files
Because these can be bound to unused global keys example f13 if your keyboard lacks such they can be bound globally and work everywhere regardless of mode or with or without evil.
Because of the friendly visual indication see the pictures of major mode hydra even if you don't recall a binding you don't need apropos to find it.
For functionality that you haven't bound fuzzy matching makes it easy to find said functionality and call it in one step.
First, you don't REALLY need to know anything but Meta-X and Control-XS, Control-XF, Control-XC to get going. Those aren't really that hard to remember or make muscle memory for, IMO. It IS hard to have to go back a bit to re-integrate how to do things in a new way if you're already happy with your existing workflow, so if there's no value for you, then... don't use it. Use whatever works for you.
ESC ESC ESC (translated from <escape> <escape> <escape>) runs the command keyboard-escape-quit (found in global-map), which is an interactive compiled Lisp function in ‘simple.el’.
Furthermore, there's little to no chance of me being able to type up a little program in Visual Studio Code, eval it on the fly, and add it to my config instantly. You have to write a plugin, because of the model the editor uses for extensions. And that's the difference between an extensible editor and an editor for which extension is an integral part of the workflow.
And virtually no other editor or IDE I know of has the equivalent of M-.
You don't have to use the builtin keys. I don't. There is Spacemacs, evil mode, etc. so you can use VI keys if it works better for you.
Emacs is about making it work like you want. Emacs adapts to you, not the other way around.
The single greatest thing about Emacs is the robust basic modes, which most other modes extend from. So far I haven't used anything as good, although I feel the gap is lessening with VSCode.
I really dislike switching between mouse and keyboard. Emacs's consistency and mouse-free operation speaks to my heart the same way Mark Zuckerberg wears the same shirt every day, it's one less thing to think about, and that's why I love it.
This being said, I've abandoned Spacemacs for VSCode (with amVim). I feel really diety about this, but at least "jump to definition/declaration" in C++ works like it should.
The article lists over 20 extensions you need to install to "feel the power". And every emacs user will have their own set of extensions, carefully curated. Everyone ends up with rather huge init.el setups with increasingly bizarre and arcane settings.
After over two years of using emacs and a 437-line init.el[1] of my own I gave up when one day it stopped properly displaying cyrllic text in jabber.el and some extension minor update broke something major.
You'll find a lot of common extensions amongst power users. If you browse Emacs blog posts often, you'll see the same names popping up. For an overall view, I recommend Sacha Chua's weekly Emacs news:
https://sachachua.com/blog/2019/06/2019-06-03-emacs-news/
And BTW, a number of the extensions listed on this submission (Org mode, calc, dired, etc) come packaged with Emacs - although for Org mode I really would recommend installing a more up to date version.
To keep your init.el sane, I strongly recommend you keep your init file as an org mode file and use org-babel-load-file to load it. My init file is probably 1500 lines long, but it's very well organized as an org mode file.
Nearly every single one of those extensions needs to be set up, configured or tweaked in a certain way (the ways differ from extension to extension and how to tweak/configure them can often be found only after some rigorous googling).
And so, you end up with an init.el which is 1500 lines long (which is a magnitude more than some of my standalone production code :) ) or more (I’ve seen some huge monstrosities).
So in my case this led to a sort of fatigue in the end, and I gave up.
I do think you have cause and effect mixed up here. I have customized a lot of stuff because I can. With most other editors/IDEs, I'm stuck. Yes, their configs are much shorter, but only because there is very little to configure over there. I switched to Emacs because with every other editor I used, there was something that really annoyed me and I didn't want to live with it.
>So in my case this led to a sort of fatigue in the end, and I gave up.
You were probably trying to do too much too fast. My init.el evolved over a decade. I'm sure I spent a lot less than 1% of my overall time on Emacs tweaking it. Probably not even 0.1%. I did an initial setup, and started using it for real work. Every so many months, I'd read about a new package and decide to try it out.
>You provided a “yet another list if extensions” (from literally hundreds of such lists).
When you say that, I can tell you're not even trying, given how I explained why this is not just another list of extensions.
To give you an analogy, there are hundreds/thousands of lists out there on productivity apps for Android. Yet you're not going to get even hundreds of different apps listed there. There are hundreds of sites listing the best image editing software, yet that doesn't mean you'll find hundreds of image editing programs listed.
And really, if you feel like you're drowning in those lists, then just don't look at them. I don't read Sacha's Emacs news every week. Life gets busy, and I ignore it for months at a time. Every once in a while, when work is slow, I go to it to see if I can learn something new.
Emacs is a platform. Don't view it as "configuring". View it as installing useful apps. When I first installed Linux, it was "Holy cow! The package manager has so much software!" Saying there are too many packages out there for Emacs is like saying there are too many packages out there for Linux.
There is no such thing as "vanilla" Emacs. Treat the scripts installed out of the box as a suggestion only.
> Everyone ends up with rather huge init.el setups with increasingly bizarre and arcane settings.
That's called customization. Those little warts are small tweaks done over time to tailor the editor to your liking.
The other warts can be removed by using something such as spacemacs. You can install a whole lot of packages nicely configured by adding a single line.
I threw away double digit megabytes of scripts (because I was vendoring everything before ELPA) for Spacemacs and haven't looked back.