Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: Resources to grok Emacs and use it well?
292 points by AnonC on April 15, 2020 | hide | past | favorite | 176 comments
With reference to the other post here (https://news.ycombinator.com/item?id=22875106), I’m once again fascinated by Emacs and the following it has. I know vi (learned it quite sometime ago) and though I’m not a power user, I can do a lot of things in vi without putting in much effort or searching online for solutions.

So I’m here to ask for resources — text based tutorials, video tutorials and what not — that would help someone grok Emacs (from a novice level) and get into the Emacs way of doing things (including elisp?).

I would also like recommendations on what (package/source) you consider as the best to install on macOS and on Linux.




Emacs user here, it's been my go-to editor for about 40 years.

I have a few customizations, not many. My .emacs file is 63 lines long, doesn't include any other files, and mostly just tweaks some key bindings and turns off features that I don't like. The only modes I use are built-in ones (e.g., C-mode, auto-wrapping text mode, etc.). I can't write elisp without a reference manual, and I think that's okay.

I suggest:

- not installing a bunch of random stuff until you're comfortable with the core experience or you simply have to adjust or disable something that bugs you

- just using Emacs, and not customizing the crap out of it, ditto

If you haven't gone through the Emacs tutorial, it's how I learned it (at 300 baud, uphill both ways and in the snow -- not kidding about the 300 baud thing, though).


I had to go to Spacemacs[1] for a few reasons:

- Using the spacebar to invoke functionality is a massive physical boon to usage. Stock emacs wrecks me from fingers to neck for an real amounts of usage. This is a purely subjective weakness.

- Spacemacs vi emulation. I drank the modal Kook-aid. Especially if one has to SSH into headless instances in the cloud. vi is part of the POSIX standard, so you know it's there and it's robust.

- Spacemacs engineering. Great package integration in the form of layers.

[1] https://www.spacemacs.org/


You can also just run evil mode for the vi emulation (its what spacemacs does), spacemacs is the best emacs IDE though IMHO.


My experience with Spacemacs was the complete opposite. There's a ton of inconsistency with the quality of the provided layers which is why YMMV when using it. The C++ layers up till last year was an utter disaster and I don't know if it's been fixed since.

The WORST thing about spacemacs though is their absolutely broken release process. The master branch rarely upgrades with fixes applied to the develop branch, and the tacit recommendation is just to run "on the bleeding edge." I have no idea why spacemacs users tolerate this, but my productivity has since improved after ditching it.


I run the develop branch and I can't really remember any significant bugs I've had.

I can kinda agree the C++ layer was definitely a bit of a pain, but I had general pain setting up a good workflow for C++ in emacs with the project I was working on (most of the emacs packages assumed a different layout, so couldn't understand my CMakeLists to generate the files it would need to look at for smart completion).

Overall, I quite like spacemacs, I used to hack on it a bit to make it suit my needs better, but now I rarely have anything I need to do it "just works" now.

I particularly appreciate that almost any language I want to use, I can just download a layer (I think it often prompts you to install one when you open the file automatically!) and a lot of the common across languages editor functions you want have similar keybindings, and the `which-key` popup will tell you anything you're missing. It makes a very short ramp up to being productive in your editor for a new language.


I'll be honest, my experience since has been that VSCode is... just better? I've been using vim/emacs for over 20 years now so it's a tough pill to swallow, but after trying out VSCode, I have to say that making it easy to program extensions with async functionality from the get-go was the right way to go. I think no combination of rtags, cquery, clangd, lsp, etc in Emacs/Vim/Neovim can approach the performance and quality of VSCode's C++ dev experience. And I say that having honestly tried every permutation of the above for many hours across many weeks.


you definitely can use evil mode but you will find a lot of edge cases where you have to configure something in some modes to behave sanely whereas with spacemacs they have usually done all that legwork of anything you want to use.


You can get a lot of help with evil-collection

https://github.com/emacs-evil/evil-collection

Which provides evil bindings for a lot of modes


You also have doom which is just evil and not space centric AFAIK


i'm a large fan of space as a leader key even coming from vim so spacemacs felt like a natural extension. but yeah doom works for many people


Doom has good reviews AFAICT


I switched to doom from spacemacs and quite happy with it. Lot more easier to tweak that spacemacs.


I considered Spacemacs, because I used Vim extensively in the past (and still use it for some tasks), but I felt that Vim emulation in Emacs would only hinder my understanding of Emacs and steepen the learning curve. So I ended up incorporating useful bits and pieces from Spacemacs into my .emacs config, but stayed with native Emacs key bindings. I'm comfortable with my choice, but please change my mind if you feel like it.


Is there a way to make Spacemacs more performant? It felt slower than an IDE.


Use its client-server capabilities (http://wikemacs.org/wiki/Emacs_server). Most slowness I felt was startup time (except on Windows, there everything felt slooow).


Forgive the noise, but I second this. I haven't committed a hundred key combinations to memory. I find that knowing the twenty things I need to know (which are different for everyone), and having another twenty in my back pocket for once or twice a year has lasted me since 1992, and left me very satisfied indeed with emacs.


Also seconding. Vanilla emacs is already extremely powerful, and if you're doing real work, you'll end up having to use hosts that don't have all of your wonderful enhancements installed. It's good to know vanilla emacs.

Beyond that, add language modes for anything you need that's not already included.

If you use 'git', 'magit' is very nice.

Beyond that, helm is interesting, though very large and kind of mind-blowing.

Recommend these in your ~/.emacs.d/init.el, to avoid being that guy:

    (setq-default show-trailing-whitespace 't)
    (setq-default indicate-empty-lines 't)

    ; try not to use tab characters ever when formatting code
    (setq-default indent-tabs-mode nil)

    (setq-default require-final-newline 'ask)
    (setq-default mode-require-final-newline 'ask)


> if you're doing real work, you'll end up having to use hosts that don't have all of your wonderful enhancements installed. It's good to know vanilla emacs.

If you're talking about production hosts, they shouldn't really have vanilla emacs installed either. Not having your creature comforts present on production machines is a feature, like the red shell prompt / terminal background some people use, a reminder to get you to think twice and try to not do things directly in production. If you really must, just use TRAMP, it's amazing.

If, on the other hand, you're talking about using somebody else's laptop to do anything, that doesn't make sense to optimize for, at least in my experience. I prefer not to even touch other peoples' laptops/keyboards.


I'm fine with not installing emacs, as long as no one ever asks me to fix their crap on those hosts. In practice, their stuff will always break, and they always will ask me to fix it. Production hosts should never be neutered. At a bare minimum, emacs-nox, strace, nmap, tcpdump, lsof. No exceptions.

Tramp is great, but not all such hosts are reachable that way.

> I prefer not to even touch other peoples' laptops/keyboards.

Me too, but that's why they call it work.


Hopefully the Emacs is also configured to not leave tilde backup files everywhere!


> Also seconding. Vanilla emacs is already extremely powerful, and if you're doing real work, you'll end up having to use hosts that don't have all of your wonderful enhancements installed. It's good to know vanilla emacs.

I wonder if I'm weird, but I use a highly customized Emacs on my dev machine, but if I have to ssh into a host and edit something I just use vi there. The correct answer to vi or emacs has always been "both" for me.


I'm the same way, and I don't see why that would be so controversial. Vi(m) clearly has the better defaults, but Emacs is the better platform. (Then again, I'm the person who occasionally also uses ed just to keep it fresh in my memory, so there's that.)


They're just optimised for different jobs. Vim for line-based editing, emacs for nested. It just so happens that editing config files on remote hosts tends to be line-based, while editing code locally involves editing nested structures. I'll happily use both on the same machine though.


You can also ssh in via Emacs with Tramp, and use your highly customised Emacs to edit remotely.


I'm the same; I use evil-mode in emacs and find the friction of switching between them small.


for trailing whitespace:

(add-hook 'before-save-hook 'delete-trailing-whitespace)

This deletes all whitespace when you save a buffer.


Linux kernel developers would not want to use the third option on your list.


magit? Why not?


Some coding styles insist on tabs. I was referring to the third line of your configuration as quoted below.

; try not to use tab characters ever when formatting code (setq-default indent-tabs-mode nil)


This advice is fine for the first year or so, but afterwards I would start trying out various packages and customizations. There are packages that can make your experience much better (projectile, swiper, ace-window, ace-jump, move-border, eyebrowse, winner, color-identifier-mode, off the top of my init.el).

And, of course, if you do any programming at all, you should install magit immediately. It is the best git experience anywhere, on any platform, period. It is an unbelievable productivity booster, and people who haven't used it do not even appreciate what it can do (ever wanted to quickly apply a single diff from one of your stashes to your current code tree? it's two keystrokes).

Approach emacs like you would a musical instrument: you are not expected to play the piano on your first day, and the first year will require some patience and training, but eventually you'll start playing those sonatas.

[context: my Emacs init file has lines that are 27 years old]


Typical Emacs user experience: sees a list of packages some other user likes, picks one with a name he finds intriguing (in my case eyebrowse), checks it, finds it cool, adopts it (possibly for a long time).


I've done this so many times. This is why I name-drop packages :-)


In case you weren't aware, winner-mode is now part of Emacs, and as far as I can tell the Emacs 27 tab-bar-mode makes eyebrowse redundant. For me project.el that ships with Emacs is enough for my project needs.


Hmm. Do you mean that tab-bar-mode lets me have a full-screen Emacs (no UI elements whatsoever, as one does) and switch between window configs like if they were workspaces (which is what eyebrowse does)?

If so, I might want to try it.


Yes exactly, by default it has a tab-bar UI element, but you just have to set tab-bar-show to nil and you can use it to switch between window configs without the UI.


I'm in this school of emacs usage. I use Aquamacs on my Mac and while I've been using Emacs for almost as long as kabdib, I've barely scratched the surface of what Emacs can do. For me, the biggest thing that'll get me to drop out of IntelliJ (I was so happy to learn that there were Emacs keybindings hidden in one of IntelliJ's Mac keymaps) and into Emacs is to do ctrl-x(...ctrl-x) to record a macro, then ctrl-x NUMBER ctrl-x e (I'm hoping I'm translating muscle memory correctly) to do a repeated complex edit on a block of text. It's always fun to see junior devs (and occasional seniors) watch me do this and ask, How did you DO that?


It's fun to see someone's jaw drop when you show them what you can do with a keyboard macro, some regular expressions and a little shell integration.

More than simple fun; I've saved people from hours and sometimes days of drudgery with just a few minutes of mucking about in Emacs. Teaching someone simple automation is pretty rewarding. Even if they are not technically capable of repeating your solution, at least they go away with a problem solved AND the knowledge that there are usually better options available than drudgery.


I work the same way. Drop out of phpStorm or inteliJ into emacs to do some Marco recording. I tend to use f3 to record and f4 to run said macro.

That and white space mode for examining files..


You can use Vim style macros in Intellij with the Vim plugin


There is another positive side effect of limiting customization to reasonable levels. Default Emacs shortcuts are hidden everywhere. Most importantly, bash understands them, as well as many other REPLs (erlang, ghci, julia, ...). Developing muscle memory for the default Emacs allows one to use many tools much more efficiently.


Default Emacs shortcuts are bad for RSI. Even the original author of Emacs has had to cut down pretty dramatically on their coding activity, due to getting "Emacs pinky" and other RSI problems.


Mapping Caps Lock to be "Control" helps a lot with this. Reaching down to the bottom row for Control all the time is terrible and should definitely be avoided. Using Alt as Meta has been less of an issue for me since I can easily hit it with my thumb without moving too much.

evil is also great, and it might actually be the most popular option for new users at this point, thanks to Spacemacs and Doom.


Second this: the key to the left of 'A' (for QWERTY) should be control for regular Emacs use.


That's true for traditional keyboards and layouts. A keyboard with a thumb cluster that puts ctrl and meta under your thumbs makes all the difference.


I started this way and my next step was taking advantage of the current package manager. The fact you can inject new functionality so quickly made me really fall in love with emacs. Adding additional programming modes/file format modes without any headaches has been a boon to my usage of Emacs. I'm rarely tuning settings in elisp anymore and instead just adding a feature so the file has colourization and tab stops working properly. If I do actually want to customize something since customize-mode works well enough now I can usually find the modest setting I do want to change without much hassle.


My advice (and experience) is exactly the same as kabdib's (though his .emacs file is longer, and his baud rate lower, than mine). Literally the only advanced feature I use is Keyboard Macros (as dhosek mentions), but just that one feature is so useful, every other editor I've tried feels hobbled (even vi, which I used professionally for years). And no, multiple IPs doesn't do the trick at all. On the other hand, my pinky hurts.


What’s emacs --version say for you? My main complaint from using a Mac laptop for so long is that I often had to download some .el packages, that are basically unnecessary with more recent emacs updates. Other than that, I’ve also got a fairly simple .emacs file modulo a few project specific “let me make this a macro for this terrible manual process I need to do”.


FYI - the Emacs binary that's bundled with pre-Catalina versions of macOS (as /usr/bin/emacs) is 22.1, which is an ancient version from 2007. Apple kept that version because it's the last one that was released as GPLv2, and they've avoided bundling anything that's licensed GPLv3. This is the same reason that macOS includes an ancient version of Bash, and why they're switching to zsh as the default login shell.

Because it's so old, no one bothers to maintain compatibility with it anymore, and almost all modern elisp will break in some way if it's loaded in 22.1. Somewhat fortunately, it seems like Apple has removed this emacs binary from Catalina, so it won't be an issue on future versions of macOS.

To get a modern Emacs: https://emacsformacosx.com/ has binary builds of the official Emacs releases, with some additional scripts that let you launch it from Launchpad, etc.


Was it an acoustic modem? Just adds to the joy.


Yup, a Novation Cat. I still have it, not that it's useful other than as a conversation piece.


The biggest difference between Emacs and any other editor is that instead of thinking about Emacs as an editor you need to think of Emacs as a programable workflow enabler. Using Emacs without learning Elisp is like carrying a bike on your shoulders instead of riding it. Once you get to the place where you can confidently write Elisp to solve your problems, you will miss Emacs deeply when you have to use any other application. You don't need to write extensions and open source them for other people. All you need is the ability to create Elisp code that does what you want exactly how you want it.

The best way of learning Elisp is reading the source code that is distributed with Emacs. Do a git checkout of Emacs and read Elisp code written by Stefan Monnier. Stay away from org-mode elisp - the quality of that code base is highly suspect.


Stock Emacs and off-the-shelf add-ons are pretty powerful, but I agree that one is really missing something by not writing their own little tweaks.

You can learn Emacs well just by starting with this manual and beginning to tweak Emacs to do things you want: https://www.gnu.org/software/emacs/manual/html_node/elisp/

Emacs Lisp is very low-friction to start hacking on. There's no SDKs to download, no IDE to install, no developer mode to enable, no project wizard to run, no source tree of template files to start from, no program to attach, no emulator to run, to separate build to run, no sandboxing, etc. You can just start Emacs, and start editing Emacs Lisp expressions and evaluating them, and you can change the code of your running Emacs in a very straightforward way.

I initially started by writing little fancy editing features for C and C++ coding (e.g., format my comments a certain way, do a expression transform, etc.), and then started writing to editing modes for my employer's proprietary languages. The public bits are at "https://www.neilvandyke.org/emacs/". That was my introduction to Lisp hacking, and eventually I gravitated to Scheme.


It's interesting to me that the top two comments (at the time of writing this) are fundamentally opposite advice. Yours, to customize Emacs, vs. the second, to basically not customize it at all.


My take on that is...

For those fundamentally interested in developing development environments, coding tools, or making your editor your hobby, diving deep into emacs customization is a reasonable thing to do. In other words, if creating things like evil-mode or spacemacs excites you, a dive deep into emacs is a good option.

For those who aren't interested in those things, try to actively avoid deep diving into emacs. It will be an unfulfilling waste of time. There's no magical developer productivity pot of gold at the end of that rainbow.


Definitely. I guess the interesting part specifically is that, if you aren't the type to care about making a development env a hobby, why would you ever even touch emacs?


I think the advice here is to be able to write your own customizations, but be careful about installing EVERYTHING that you read about.

I occasionally try cool-and-new Emacs things that are mentioned on HN or elsewhere, but drop most of them. The reality is that a lot of these things are completely crazy and don't help; they are complicated, but don't reduce the overall complexity of the system. If you are new to Emacs, every one of these things is a potential stumbling block that leads to dropping Emacs. (The reason to use Emacs over the cleaner and newer editors is the raw text editing efficiency. The new editors are behind here, and munging text should be the editor's primary concern.)

But, I have also written many of my own extensions that have served me well for decades. I wrote "eproject" back when Emacs didn't have built-in project support. I have kind of ignored it as an open-source project (there are probably 8 million Github issues open that don't interest me), but I use it every day because it works perfectly... for me, the author. I have also written a couple of other neat extensions that have served me well; many years ago I was a fan of "takahashi method" presentations, and wrote an editor/viewer for these. It is unlikely that anyone else would ever use it, but it worked for me at the time. Having that flexibility in your toolkit is great... but it is not necessary for day-to-day editing. (I learned Elisp when I was converting a client's set of static HTML files [actually JSP] to a CMS. I needed to extract certain metadata from the filename and HTML tags into flat files, and then replace the static content with markers that would load that content from the CMS. Almost all of the pages followed a certain format, but there was enough variance that a good chunk of them required manual intervention. So I wrote a Lisp program that highlighted the relevant areas and let you edit them, then did the actual extraction and replacement. It took a couple days to write, but I did the actual extraction in half a day with no errors, so I think it was worth it. If you were using something less flexible, you wouldn't have written that, and would have had to clean up a bunch of mistakes from your non-interactive batch job, or just spend three days manually cutting and pasting thousands of chunks of HTML.)

As for extensions that have "stuck" for me; lsp-mode is the big one. A lot of languages have good language servers, and jumping to documentation and autocompleting symbols is pretty enjoyable. Depends on the language you use; I'm happy with gopls and the Typescript language server. I've never gotten clangd to work on an existing project, however. Minimalism is the name of the game; I use lsp, but nothing fancy. It underlines errors in the code, provides completion (with company-mode), and I setup keybinds to jump to definitions and documentation. I basically ignore lsp-ui-mode completely, because it's too much clutter.

Pre-LSP(+) code formatting hooks have also stuck. I cannot live without gofmt-on-save and don't use a programming language without an autoformatter (prettier is great for Javascript and friends, YAML, and JSON). Clang-format serves me well for C/C++/Protocol Buffers (but most open source projects don't follow their own style rules, so you have to turn it off if you're just making a small edit to their project). Emacs has good modes for all three of these things, go-mode and goimports, prettier-mode, and clang-format-mode. Could not live without them; formatting code is a silly thing to spend any mental energy on, and computers do a much better job than I could.

(+) I say pre-LSP here because the Language Server Protocol does do reformatting. I have not played with it. I'm happy with the static tools that existed before LSP, and haven't found a reason to try something new. YMMV.


Thanks a lot for your detailed comment. The work you did with splitting the JSP files shows the power of the tool, and it’s things like these that are inspiring to know about (since I don’t know Emacs, normally I would’ve just reached out to awk or a combination of sed and awk for something like that).


I'm fine to tweak some Elisp code but not fully enjoy it as Scheme or Common Lisp. It's really an awkward language despite the fact it's a Lisp, and I really like Lisp.

Oh, how I wish it would be completely re-written with other dialects... Although there are many attempts, they are far from polished compared to Emacs itself.


This is also the biggest problem I have with Emacs. When I used it I spent too much time configuring things, something which distracted me from solving real problems. Now I use a much simpler editor which is not so configurable so I can focus on other things.


linux (*nix) is also a workflow enabler, with a different ISA (Filesystem vs Buffers, processes and pipes vs functions).

I have yet to grok this mindset.. which is a shame.


I'm a moderately experienced Emacser - been using it heavily since 2009 (first encountered it in 2003). I have written a few small extensions and contributed features and bug fixes to bigger ones.

Credentials established, I cannot recommend this tutorial enough:

https://david.rothlis.net/emacs/tutorial.html

He walks you through most of the core of what makes Emacs great by showing you how to make a change to a project in the idiomatic Emacs way.

I would have learned it years faster had I started there.

Beyond that, learn basic Emacs keybindings via the tutorial, as others have suggested.

I started in Emacs but installed evil-mode a few years ago and have never looked back.

I do not recommend Spacemacs. Install the tools you want as you find you want them, so that you know what's doing what, and so you have a decent chance of knowing what broke things when something stops working.

Keep your packages in version control as part of your .emacs.d repository. That keeps updates and deleted packages from screwing you.

Use "use-package" (https://github.com/jwiegley/use-package) for configuring what you install. It's written by one of the Emacs maintainers and will help you do things right by default.

I'm not the best Emacser out there, but if you're curious, my config is on my GitHub account: https://github.com/NateEag/.emacs.d

Happy hacking.


Spacemacs is getting decent press here. How recently have you tried it?


I recently switched form spacemacs to my own config that works in a similar way.

I'm committed to modal editing and vim keybindings already, so spacemacs introduced me to emacs and got me to convert, but it is a 90% for everyone solution. It adds tons of stuff that mostly works, stuff which you specifically mostly don't need.

It mostly works, but coming from vim spacemacs is a big black box for the most part. I think it is a fantastic first step if you need to get something mostly working.

Going through and building up my own .emacs with the parts I wanted was the way I finally learned to grok emacs for real. It took that step to actually be able to understand what's happening when something unexpected happens. I also discovered a lot of alternatives to the spacemacs packages, well known by real emacs users, that I much prefer to the choices made by the spacemacs team.


I object to Spacemacs not on the grounds that it works poorly, but on the grounds that if you throw all that into your config at once you will almost certainly have no idea what's causing problems or how to debug them.

Once you have a decent idea how the parts fit together, you don't really need Spacemacs, IMO.

I think the last time I tinkered with it at all was about a year and a half ago?


I’ve used spacemacs before and have coworkers that uses it and, I’ve never found it pleasant to use. Unlike plain-evil-mode, it changes too many of the default emacs keybindings and it’s easier to build up a nice config (I.e. I ported my vimrc to emacs in a couple afternoons just by porting the keybindings and finding packages to replace my vim customizations) than it is to pare away unwanted features from spacemacs


Spacemacs shows you what Emacs can be, but adds a lot of complexity that most people don't need.

I am currently a spacemacs user (holy mode, ya dirty heathens) and I like a lot of the built in functionality. However, I think that I will eventually build up my own config from vanilla.


The joy of emacs is that you really can configure it down to a gnat's booty.



Out of box / vanilla Emacs is pretty confusing doesn't include many popular packages - that is why some pre-made configs are very popular. On the other hand they might overwhelm you with features and very opinionated decisions.

If you want something close to what most users probably have setup and yet still close to vanilla you can give Emacs Prelude a try: https://prelude.emacsredux.com/en/latest/

I started with it, tried out the package selection, but then started a smaller config from scratch with what I liked from it.

Also good links: https://www.masteringemacs.org/reading-guide http://emacsrocks.com

I don't believe one should restrict oneself to a single editor, but rather follow a path of least resistance - Emacs is actually the path of least resistance when you want to have a custom editing experience.

Overall I use four editors Emacs, vi, notepad++ and VS Code. Emacs when doing Clojure or any other code so I can have something that is very convenient for me, vi and notepad++ on machines where I don't want to setup a config or where I do only simple text editing and VS Code where I would ocasionally need to install a plug-in, but I don't need to use it often.


I started using Emacs in earnest a few years ago, especially Org-Mode. At first, I tried every customization I came across and loaded up my init file with all the cool mods. But when things went wrong, I had no clue how to fix them.

So after about a year I started over, resetting my config and using Emacs customization over custom elisp writing to get a working init file. It helped me learn a lot. This is the path I recommend: do small customizations using Emacs' built-in features, then learn elisp later.

I learned a lot from this CS prof's videos, and it's a good, practical learning path I'd recommend: https://www.youtube.com/watch?v=49kBWM3RQQ8&list=PL9KxKa8NpF...

If you're into writing, I maintain a list of resources for writing with Emacs: https://github.com/thinkhuman/writingwithemacs


I learnt from the same professor! His youtube series is well done.


Saying that as someone using Emacs for at least 20 years: ignore the zealots, get rid of this FOMO and ask yourself if there are 3 things missing from your tools, things that you would like to have a better way of doing. For these things, find someone experienced with Emacs and ask them to show you how they do it.

Unless your passion is in going meta and focus on building the tools instead of using them, chances are that your current tools can do what you need just fine.


Indeed. There is some satisfaction in customizing things in order to get things done more easily, but there is more satisfaction, hopefully, in shipping code.

I used TECO to get grades back in the day, on a DEC-10. People used to write BASIC interpreters in TECO for fun. Then I went into the wilderness, where every system I used was uncustomizable. And then DOS, where Turbo C and Brief were kings. Eventually the system I used was Windows, and MS Developer Studio (before Visual Studio) had some macro recording capability. Then I joined a company where everything was just more convenient if you put Linux on your desktop, and for my limited Windows work, one of the Windows ports of Emacs was adequate, and a couple of our brightest were always using Emacs. These were the guys I wanted to emulate so I started using Emacs. But then I branched off and started using Eclipse, because I couldn't get ctags to work well enough with all the C++ code I was working with. Eclipse's remote solution seems to be dead so now I'm using Code.

I don't miss TECO.


Agreed, and this is not specific to Emacs or even text editors. The same can be applied to operating systems or even hardware. There are a lot of people out there that will spend more time tweaking and playing with their tools than actually using them. It's fine if you're doing it for the experience or for enjoyment, but don't delude yourself into thinking you're actually spending your time productively and that all of that work is "eventually" gonna pay off.

My biggest increase in productivity was to stop tweaking and just switch to a mainstream OS and use a mainstream editor using the stock config as much as possible (I only changed a handful of settings). I honestly can't think of anything in my current workflow that is a bottleneck to my productivity; the tools are fast enough that the bottleneck is now my brain and thoughts and tweaking the tools won't fix that.


You may just want something a bit snappier, say if you are coming from massive bloatware IDE land?


OP says he is experienced with vi, so it is not his case and I don't want to be playing a game of "unlikely hypotheticals"

But, even if that were the case, the recommendation would be to either (a) find a lighter alternative to the used IDE or (b) switch to an IDE that is plugin-based to remove all of the "bloatware". At no point I would be telling people that the first alternative for them to "be fast" is to join the church of Emacs.

Fuck, I worked with junior developers who were more comfortable after I showed them they could work with gedit + terminal instead of cargo-culting whatever tool some nerdy senior used.

All I am asking is to not be like those photographers that spend more time on forums discussing about equipment than actually taking pictures, or audiophiles that focus so much on testing their equipment that they forget to enjoy the music. Unless you are a camera maker/speaker designer/software tool developer, focusing on the tools instead of the product is quite a stupid way to live.


I've been using emacs for several years. If you saw my init file, you'd think it was kind of funny. It's mostly to change the look from default to a black box.

I do have some functions for connecting to databases, but for the most part, there are no deep customizations.

I also have avy (think that's jump mode in vim), ldo for file browsing, yasnippet (for snippets), multiple-cursors, and some language-specific major and minor modes.

I mainly want to press C-c C-c and get my work done.

------

As a general rule, emacs is pretty easy:

* C = basic

* M = more powerful

* CM = most powerful.

So...

* C-f = move forward one character

* M-f = move forward one word

* CM-f = move forward one bracket

A lot of things are sort of mnemonic:

* f - forward

* b - back

* r - rectangle

* s - search

* r - reverse search

The biggest thing to remember is that "yank" has the opposite meaning in Emacs. In emacs, you can either "kill" (cut), or "copy", then you "yank" to (paste). This is a function of how the Emacs "kill ring" works. This extends to the above:

* C-y - yank the last item

* M-y - scroll back through the backlog of the kill ring.

Everything sort of falls out from this logic. If had to be completely honest with you, I probably use 20% of the total functionality of Emacs. It's a huge system, but I get my work done efficiently and don't sweat that I can't write a bunch of elisp from memory.


Thanks a lot for the simple explanation of the keyboard combinations (and the underlying logic) as well as the part about yanking. As a vi user, that might’ve tripped me up the first few times. But now I know better.


Thanks so much. There are very rare tricks and tips that's comes across ones way which becomes part of a person's habit. This is one of them.


If you're currently a vi user, I'd recommend spacemacs (https://www.spacemacs.org/) to soften the learning curve. It comes batteries included (as opposed to a stock emacs install which requires a _lot_ of customization) and uses evil mode (vi keybindings) by default. You can expose yourself to more and more of the emacs way slowly.

Also emacs is largely self-documenting. Learn the keys for querying documentation first thing. You can search for current keybindings, what a given function _does_, etc all live while you're using it.


Spacemacs is great, albeit slow at times.

On the evil front there is also Doom Emacs (https://github.com/hlissner/doom-emacs) which is better optimized and is still pretty full-featured.


Doom Emacs is a collection of many recommendated packages. For someone doesn't use evil much like me, I can turn it off in the config file. Using Doom Emacs is highly recommended for new comers to Emacs


I was a vi user that had to ramp up quickly on a clojure project. Being new to clojure, I choose not to emacs at the same time as clojure. Spacemacs was lifesaver for me, given clojure experience in vi + plugins is subpar.


Emacs is very easy to learn. Just as you learn the key combinations for video games, learning key combinations for emacs is really easy. Here are some steps to help you:

1. Go through the Emacs Tutorial. Just start emacs, put the cursor on the text 'Emacs Tutorial' and hit enter. It will only take 30 mins max.

2. Go through the first chapter in the Practical Common Lisp book here: http://gigamonkeys.com/book/lather-rinse-repeat-a-tour-of-th...

3. By now you are comfortable navigating around and editing text, opening files, running emacs commands with M-x etc... so you can now install packages for syntax highlighting for your language etc... via M-x package-install <enter> -> search for your language (usually LANGUAGE-mode), and install it.

4. Use emacs to edit all your files for at least 1 day.

5. Use emacs keybindings to navigate around in other apps if you're on Mac or Linux, those are standard keybindings that work everywhere in Terminal, bash, Textedit, Chrome, etc...

6. Learn how to use vim, download a vim cheatsheet and have it handy for reference, edit some files in vim (git commit messages will also do).

7. Install evil-mode and edit your .emacs.d/init.el file to bind a key to toggle evil-mode on/off

8. In maybe one day max, you're very comfortable in emacs now, and may be well on your way to writing your own extension functions. You're pretty much an emacs expert by now, in only 2 days max!

9. Try out different emacs configs. You can try mine out here: https://github.com/sufyanadam/.emacs.d it's setup for all major languages, Ruby, Python, React, JSX, etc... It also has some soundboard keys bound, try C-c-n-m when you want to greet someone new but don't want to be interrupted (you have to have mplayer installed on your system for it to work).


Thanks so much for the detailed instructions and the focus on the basics and getting by step by step. It’s very comforting to read this, and it removes an inherent fear that learning to use Emacs may be way too complex.


As others have said, the tutorial is the best place to start (C-h t). After that for any other thing you need to learn in emacs the info will probably have it (C-h i or M-x info). Emacs users usually spend much time configuring their “operating system” till they’re satisfied, by modifying the init.el, but you can get a popular config already made [0][1]. My biggest recommendation after understanding how emacs works, if you use/prefer vi binds, is install evil-mode [2]. It’s essentially a vi layer on top of emacs, and is very functional.

edit: If you use MacOS, Yamamoto Mitsuharu‘s emacs-mac [3] is my recommendation, as for linux the version from your distros package manager should be apt. ;)

[0] https://github.com/hlissner/doom-emacs

[1] https://github.com/syl20bnr/spacemacs

[2] https://github.com/emacs-evil/evil

[3] https://bitbucket.org/mituharu/emacs-mac


First, ask yourself if you really want to invest time in learning Emacs. It probably isn't anywhere near the most important problem in your life, and won't change it much. In fact it might make things worse because it will make you aware of all the ways other editors are bad which didn't bother you before.

That might be problem as teams standardize on newer editors with good collaboration features, which don't exist or aren't as new-user friendly as in Emacs. Some languages also don't have as good integration with Emacs as they do with some IDEs.

That said, if you really want to learn Emacs, then

     - go through the tutorial
     - print out a good Emacs cheatsheet
     - Have piece of paper or notebook to make your own supplement/complement to the cheatsheet
     - use a Rosetta stone site if coming from Vim
     - Force yourself to use the keybindings to move, not the arrow keys or the mouse. It will take a few weeks to get comfortable with the basic movement.
     - Probably most important after the tutorial: learn all the help functions and their keybindings 
        - C-h ?
        - info
        - apropos
        - where-is
        - describe-key, describe-function, describe-mode, describe-variable, describe-bindings
        - find-library
     - understand how undo works
     - package-list-packages to install packages
     - Start a basic init.el:
       - (fset 'yes-or-no-p 'y-or-n-p)
       - (global-font-lock-mode t)
       - (transient-mark-mode -1)
     - Learn keyboard macros <--- Enormously useful
     - After you are more comfortable, install and configure helm
     - Read or browse the Emacs manual and the Elisp manual (in info)
     - Read the "Mastering Emacs" posts for more advanced features
     - Also Mike Zamansky's Youtube channel


I learned a lot about what to expect from emacs from Steve Yegge's blog posts. Even though they are quite old now they still relevant.

https://sites.google.com/site/steveyegge2/effective-emacs

http://steve-yegge.blogspot.com/2006/06/shiny-and-new-emacs-...

http://steve-yegge.blogspot.com/2008/01/emergency-elisp.html


Spacemacs[0] is probably the best Emacs configuration for discoverability. Not only do the maintainers rearrange key combinations to be thematically grouped and mnemonically sane, they added/configured a really nice discoverability layer into Emacs.

Even after close to a decade of Emacs usage, I learned more about Emacs using Spacemacs for a month than I thought possible.

[0] https://www.spacemacs.org/


I second this. People who have been using emacs a really long time forget how hard it is to get started. Especially when coming from a full featured editor like VSC. Spacemacs made that transistion so painless for me and showed me what emacs was capable of.


Guidance here seems to fall into 2 camps - either (1) start vanilla or (2) with one of the currently favoured packagings (Doom, Spacemacs etc).

I'd say it depends on what your aim is: (1) would be the way to go if you primarily want to get fluent with emacs, or are content to use tools you already know for other work, and learn plain emacs gradually in the background. (2) would be best if you want to get productive quickly using emacs for real work, at the risk of a more occluded understanding of emacs per se.

I'd put in a word for Prelude (https://github.com/bbatsov/prelude) as a possible compromise, making emacs immediately usable but without putting many layers between you and it. Some might consider it a little old-fashioned however (no use-package etc).

I've used vanilla emacs on and off for many years for quick edits, but only recently for actual programming (using Prelude, and prompted by learning Clojure). It's taking over my computing lifestyle. I've laughed in the past at people using it for email, but found myself using mu4e lately. Scary.


Back when I was playing around with Emacs I found Protesilaos Stavrou's videos to be quite good for getting a feel on how to accomplish specific things with Emacs.

They are at: https://www.youtube.com/channel/UC0uTPqBCFIpZxlz_Lv1tk_g/vid...

Most of the videos are focused on practical tasks you would want to do. It's one of the few really good Emacs focused channels IMO.


This is what I've done the past couple weeks and it's going pretty well:

Start with plain Emacs. Print/write out the popular cheatsheets. Just make sure you know how to exit, access the documentation, and move around the windows/frames/buffers. Get Melpa & install some packages. Play with the config, adding keybindings, figure out hooks and so on. Copy some elisp functions from dotfiles on Github. Spam the documentation command on everything. Get frustrated with how much tinkering you need to do to get the crazy setups you've seen on blogposts. Stay motivated by consuming more content about custom setups. Discover the magic of magit and parinfer and dired. Look up some of the org-mode/PIM heroes on github, usernames: novoid, alphapapa, karlicoss

Install Doom. Tinker with it a bit. Take notes of your learning in an org file. Tinker some more. Go back to plain emacs for a bit. Then try spacemacs. Go straight back to Doom because it's faster and you now understand enough about emacs to be scared of spacemacs' layers.

Below are some links to help you along the way.

http://ergoemacs.org/emacs/blog.html

https://sachachua.com/blog/

https://www.gnu.org/software/emacs/refcards/pdf/refcard.pdf

https://orgmode.org/worg/orgcard.html

https://cestlaz.github.io/stories/emacs/

https://www.youtube.com/watch?v=0g9BcZvQbXU

https://zaiste.net/doomcasts/


Emacs user here. I think Jethro Kuan's modern emacs:

https://github.com/jethrokuan/emacs-workshop/blob/master/mod...

is pretty good as an introductory resource.

Disclaimer: I picked up Emacs from Jethro Kuan


https://emacsformacosx.com/ is a very good port to MacOS. One advantage of Emacs on MacOS is that the Command key is not part of the traditional Emacs key bindings. This port uses Option for Meta and supports most of the usual MacOS Command key shortcuts, so you can use the familiar MacOS keys as well as the official Emacs key bindings.


I agree with everything you've said. I used to use Xquarts and xemacs but then that became available for a quick download.

I will mention cmd-c / cmd-w is still an anomaly. I sometimes capitalize stuff or close windows.


start with using graphical Emacs on your platform of choice. Avoid using Emacs through a text terminal, to begin with ...

then start with

Absolute Beginners Guide to Emacs http://www.jesshamrick.com/2012/09/10/absolute-beginners-gui...

follow up with Emacs' tutorial and online help

follow up with Mike Zamansky videos on YouTube https://cestlaz.github.io/stories/emacs/

finally check out the blog entries (and the book !) at https://www.masteringemacs.org/


Everyone has already suggested the Emacs tutorial, and Spacemacs, so I have two things to add: the Emacs tutorial is borderline-useless if you're using Spacemacs, and as a vi-proficient user, you should.

Second, I want to recommend the Emacs Lisp tutorial, which I would argue is the best official tutorial for a programming language, full stop. This will teach you a tonne about Emacs which you won't pick up any other way, and you can fill in differences between Spacemacs and vi(m) by the usual expedient of trolling the internet for clues.


Single best thing you can do:

Find an expert Emacs user who's willing to help, and have them watch you in person, even for just a short time, as you use Emacs to do things. Lather, rinse, repeat. Make sure they show you how to use the built-in help and feature-exploration mechanisms (but they'll know to do that anyway, if they're an expert).


(Okay, well, I guess this was a particularly bad time to recommend a specifically in-person help session :-). Live video would work too, as long as the resolution is high enough for them to see what you're doing.)


As you mentioned you're comfortable with vi, Spacemacs probably should be a good start although I think it kind of overloaded. Doom emacs should be a better/lighter option to start with till you ready to create your own edition.

I suggest don't go full inside but start slowly incorporating emacs into your workflow.

If you write code then using emacs only for git via magit for the first couple of weeks should be a good start (while reading some emacs related book in parallel).

Then try to experiment with the org mode, this thing alone might get you on the hook to be productive with the tool.

If you like the experience then I suggest you to consider buying ergonomic keyboard like ergodox/maltron/kinesis advantage to improve your typing.


I'd suggest starting with the Kinesis and then trying Emacs. I tried Emacs multiple times on "regular" keyboards and it never made sense to me. It wasn't till I tried it with the Kinesis keyboard that I was able to fall in love with the keybindings. Great comment.



Although these are great, it's worth noting that they don't even come close to the functionality offered in Emacs org-mode.


I believe it's important to find a community which would offer quality real-time help. I've seen some, and the really good one was not in English so I can't recommend it, I guess. Freenode emacs chat is said to be filled with offtopic; that's not my cup of tea but you might find it useful.

Members of said lovely community thoroughly recommended Mastering Emacs to newcomers as a number one introductory text which I since do as well—mostly because they did. I also recommend built-in tutorial.

As for packages,

• helm or some other fuzzy completion thing; make sure your M-x, C-h f, C-h v do offer fuzzy completion, it improves discoverability greatly. Recent (27?) Emacsen may have something like this out of the box.

• avy: jump to positions on screen

• there are several packages that offer insert/command mode including the famous evil-mode but it's a good idea to get used to defaults. “Mastering Emacs” has something on this. I've heard macOS supports default Emacs keys everywhere (not true for other systems)

• which-key can display keys and commands available at the moment, quite helpful from the start. You can actually find some of this information with context menu but it is less convenient. The issue with which-key is, you need to configure it to actually see its stuff. A config for it may be found in the link below

https://github.com/a13/emacs.d/blob/master/README.org is a cleanly written init file; if you want a starter config for package x, try searching there for (use-package x ..) expression, copy it to your init file, press C-M-x and it's applied (note: it will often download the package, too). Many popular packages and built-in features are covered. Tweak some parameters, C-M-x, observe the changes immediately.

• last but not least, to make use of many existing configurations out there, you will need use-package. So install it early and learn to load it on startup (see the very config above as a reference)


Emacs is weird. I’ve been using it for a few years and am definitely far from an expert.

Emacs led me to elisp which led me to Common Lisp which led me to scheme which led me to racket, each of which has its own unique set of literature.

I’m enjoying the journey. It’s a refreshing change of pace from the ever-changing, cutting-edge, hyped-up programming world many of us live and work in.

Emacs has also led me to further interest in macros, compilers, and programming languages.

If you don’t have prior experience with lisps I’d recommend Gentle Introduction to Common Lisp, How to Design Programs, or Practical Common Lisp. The fundamentals from each apply well to elisp.

If you want immediate(ish) productivity, id recommend emacs prelude, doom, or spacemacs.


You cannot grok it without first trying to live inside it.

It can be treated as an editor, and as your workflow slowly adjusts you will find yourself writing a mental wishlist.

Realising that wishlist is where Emacs shines among other editors/IDEs/applications.

It is a headspace/workspace and imo the programming equivalent of BASB.

I for example use it because I want nothing to pull me from my workflow, so I have shells, repls, notebooks, filesystem browser, internet browser, rss, and a slew of other utilities tiled, something akin to a Bloomberg terminal, even spotify if I need music. It has enabled my productivity in a way no other application could.


>shells, repls, notebooks, filesystem browser, internet browser, rss, and a slew of other utilities tiled, something akin to a Bloomberg terminal, even spotify if I need music

Could you describe each of the specific packages you use to accomplish all this? I'd love to add more tools.


Certainly: Shell: EShell, Term, (inferior) Shell

Repl (these will depend on what language you're using): usually I just run this within a shell, dedicated to the task (Mx rename-buffer) but there are specific shells for this like Python-shell.

Notebook: EIN, can be a pain to set up, requires you to run a notebook server, best done headlessly of course.

Filesystem browser: Neotree is the best I've found but there are other decent ones.

Internet browser: EWW is fine, some sites will better in mobile format, some in simple format if available.

RSS: Elfeed

Spotify: Helm

Have flirted with BitlBee for Discord and WhatsApp but think it is deprecated for the latter.

Most of the above are available with the default install. Additionally there are modes and such that make life easier like SLIME, MultipleCursors, WindowPurpose etc. Some settings will need to be fiddled with to get Elfeed updating when you want it to, I mean it's never as simple as installing a package as I'm sure you know, but once up and running it's fantastic.


I'll add one small point towards grokking it: Emacs keybindings aren't just in Emacs. It really helps to feel fluid in Emacs if you're used to using the standard navigation all the time, and it's baked in to so many applications it takes almost no configuration.

All readline apps support[1] them, including bash[2] and many others emulate them.

On MacOS, support for emacs keybindings is standard in Cocoa text views[3] and you can improve it quite easily[4].

[1]: https://tiswww.case.edu/php/chet/readline/readline.html#SEC1

[2]: https://www.gnu.org/software/bash/manual/html_node/Readline-...

[3]: https://developer.apple.com/library/archive/documentation/Co...

[4]: https://github.com/fkchang/emacs-keybindings-in-osx


I've been using Emacs for everything since highschool and through University and my career. The best way to get used to it is to bootstrap with tutorials and then just keep using it. I learned a lot about it from doing basic projects and then homework assignments, and then at work.

I started out by following basic tutorials, like this one [0], and working my way up. You may want to find a guide to get themes setup, and some rough edges ironed out.

Alternatively, you could dive into distributions. I highly recommend Spacemacs, and have written an article about it [1]. It is a lot of learning especially if you're familiar with vim. The github page is also a great introduction [2]. I would recommend using the develop branch over master, as master tends to be very stale.

I have also heard good things about Doom emacs, another vim style distro.

[0] http://www.jesshamrick.com/2012/09/10/absolute-beginners-gui...

[1] https://dpbriggs.ca/blog/spacemacs-for-fun-and-profit

[2] https://github.com/syl20bnr/spacemacs#introduction


I've been trying to read the article you wrote about spacemacs for several days, but it appears your site is down! Any chance you can fix it? :)


Hey my apologies: The site should be back up. If you get a cloudflare error try reloading a few times.

Otherwise you can read it here on Github: https://github.com/dpbriggs/dpbriggs-blog/blob/master/blog/2...


Having recently adopted Emacs enthusiastically after years of fairly low-powered Vim use, this is what has worked for me.

- Do the built-in tutorial before anything else.

- Read through most of the manual. It's extraordinarily good despite containing a few small and usually obvious errors. You can skip things, e.g. calendaring if you're happy with your current calendar system.

- Get a friend's nontrivial init file (.emacs, init.el, etc.) or find a representative one online. Ideally use one from someone who uses Emacs for the same stuff you will, so more of it will be relevant to you. Read and understand every part of this file, copying and adapting into your own .emacs as you feel moved.

- Use the built-in help system aggressively. Don't be afraid to go on detours when an intriguing function or variable meets your eye.

- Spend some time browsing the descriptions of packages in the `list-packages' buffer to find interesting packages, and read their source code.

- Read the Intro to Elisp (note: I think I used a 3rd party alternative tutorial somewhere, not sure which one) and use the Elisp manual more as a reference. Take as much time as necessary to digest anything that seems confusing. A few things aren't super intuitive on first read, for example the precedence relationship among various keymaps. Make diagrams!

- Contribute some bugfixes and new features to packages you are using. Start small.

- Use the Emacs Wiki as a secondary resource.


I had a different experience to kabdib: customization made me able to actually use emacs productively.

I joined a company where most of the devs used emacs, so I kind of needed to adopt it too. I started with very little config and it was very hard. Because many operations were different to the GUI editors I'd used before, I had to waste 20% of my brain power to consciously do things that should be unconscious (save, cut, paste etc). This made it much harder to program!

The first step was updating the config to make emacs more similar to my old editor. For example: make it so pasting text when text is selected replaces the selection. Turn off branching undo. Install a plugin that gave me an autocomplete list of every file in my current project. Make it so that if I copy text in emacs, it appears on the OS-wide clipboard. I'm sure your list of things will be different.

Another important step was getting my emacs theme to look nice. This really made me love the program a lot more. It's silly, but there we are.

The third important step was finding things that emacs does better than other editors. For me, a big one was having a terminal inside my editor (lots of editors do this now, but back then it was rare).

Hope you end up loving emacs!


http://emacsrocks.com is a great introduction.


Yes! And it's so much fun to watch. Those are my go-to videos when testing audiovisual setups. Every time I hear his voice I want to get more efficient with emacs.


1- Understand that it is a programming environment, composed of functions, commands and variables; and all of these are documented, which you can get via `C-h f`, `C-h v`.

2- Any key combination you touch translates to those commands, so `C-h k` which shows you the actual command is key. Learn the commands behind the keys and mix and match to suit your style. Read http://steve-yegge.blogspot.com/2007/02/my-save-excursion.ht... to get the overall idea. Use smex or helm's helm-M-x to be able to call the commands without remembering their names fully. You can also use apropos to search for commands, but smex or helm is much easier. This way, you don't need to learn that many shortcut keys.

3- Define a shortcut key to open your .emacs file so you can define new commands without extra effort. Keep it to a single file in .emacs.d dir to make things easier. Too many files make things harder to maintain for me.

4- Practice on your elisp skills on `ielm`.


If you know VI I'd recommend Evil Mode: https://github.com/emacs-evil/evil

Helm is pretty amazing and almost worth the cost of Emacs by itself: https://emacs-helm.github.io/helm/


The easiest start-kit I found to be spacemacs. discover plugins through tapping around which-key.

I've been using emacs for about a year now. My config is stable at 1506 emacs packages. It runs on 6 different emacs distributions. Some would say my setup is bloated. With a 2 minute startup time, I need emacsclient. It's important to remove any impediments to learning as possible. Any weird keyboard problems, or waiting times you should try to eliminate. It takes an obsessive kind of discipline, like using batons on homeless people to combat the spread of coronavirus.

Every day I check the emacs reddit and search melpa for packages with particular keywords in their names. Every time I hit a bug I try to solve it.

Run multiple emacs instances so if you break something, at least one emacs still works. I recommend using 'lispy' for emacs lisp, but until you have learned that I recommend using vim for writing elisp. You kinda have to make key bindings to learn new emacs packages.


Mike Zamansky has a pretty decent series which focuses mostly on third party package features - https://www.youtube.com/watch?v=49kBWM3RQQ8&list=PL9KxKa8NpF...


I'll probably be the nay sayer around here but I don't find emacs all that special. I've used for maybe 18 months at various points in my life, entire projects in emacs. Maybe I don't know what I'm missing. I've written extensions in elisp. Used keyboard macros. Split windows, etc. etc. etc. What am I missing? Those features exist in every editor I've used since about 1988. They're all scriptable and customizable, at least the ones I've used.

Please name some features that I'm missing.

People talk about adding their own tweaks. Any programmable editor lets you add your own tweaks. I've added my own to several. Including emacs. Emacs wasn't special here

I'm happy to use emacs when I have to (it's the only thing installed). But otherwise not feeling it.


I will talk about features I do use. My emacs is not very customized for that matter, some keybindings for moving frames and buffers and a few packages:

I have not seen something similar to undo-tree in other editors: https://www.emacswiki.org/emacs/UndoTree

I sometimes keep different frames for different machines through ssh (TRAMP), and rename the frames. I'm not sure how good is multi-window support in other editors or remote editing of files for that matter.


M-x pong

emacs works on every platform I've ever used, and tramp lets you access everything/anytihing else. I have one set of startup files that has grown over the years.

Anything that can't work, doesn't work, works poorly can be tweaked adjusted rewritten or replaced.


Does anyone have any recommendations for configuring emacs so it's easy to use with a standard MacBook keyboard and a full external keyboard?

I used emacs for a couple years on a linux laptop with a full keyboard, and I loved it. Then I got into more teaching than programming, so I moved to some beginner-friendly editors; I wanted to use the same tools I was recommending for my students.

Now I'm doing more dev work again, and I really miss emacs. But I'm a little lost about how to map keys so I can jump between my laptop in standalone mode, my laptop when I have an external keyboard connected, and non-mac linux machines.


One thing I do on a laptop keyboard is remap Caps Lock to Control to make that easier to type. It's in System Preferences > Keyboard > Modifier Keys.

On an external keyboard, I don't remap because I have a Control key in both corners of the keyboard that I can press with the corner of my palm/the base of my pinky finger.

BTW, did you know many Emacs keys work in standard macOS text views? For an intro and a bunch of details, see <http://www.hcs.harvard.edu/~jrus/site/cocoa-text.html> and <http://www.hcs.harvard.edu/~jrus/site/system-bindings.html>.


Do the tutorial (C-h t), and then read the manual (C-h r).


It's far from a comprehensive resource, but the thing that got me started with emacs many years ago was Steve Yegge's post Effective Emacs:

https://sites.google.com/site/steveyegge2/effective-emacs

Note some of the advice, such as how to swap Ctrl and Caps-Lock on specific OSes, maybe be outdated now.

That and the built in tutorial - there should be a link on the screen when you start up emacs, or `C-h t` - should be enough to get you started.


https://duckduckgo.com/?t=ffsb&q=learn+emacs&ia=web

Pretty good resources right at the top.


Thank you for pointing that out. I should’ve checked that out first, but I thought the collective mind here may be a lot more helpful (so far all the comments here have been very helpful to me, including yours).


You could have a look at "Harley Hahn's Emacs Field Guide" This book came out a few years ago. I liked it. It's one of the few books I think I have seen on Emacs. There are previews available for the chapters as well here:

https://www.apress.com/gp/book/9781484217023


I found a two page cheat sheet in 1993 and that was enough for the next 27 years.


Let me add to the recommendations to try Doom. I've written up some notes on workflows in Doom: https://noelwelsh.com/posts/2019-01-10-doom-emacs.html

I didn't find anything similar when I got started using it, so it might be useful to you.


I've found the Emacs Wiki always solidly maintained: https://www.emacswiki.org/emacs/SiteMap

S. Chua's blog is the best "zine" I think: https://sachachua.com/blog/

To avoid "but vi/vim and the shell…" which is a sort of "mental flu" every Emacser has to go through at least once in his life, understand this:

"the UI paradigm of Emacs" is also called a roguelike interface by ESR, vi's too: "In Chapter 11 we described the effect of the absence of standard arrow keys on early roguelike programs; vi was one of these. " http://www.catb.org/esr/writings/taoup/html/ch13s03.html


I have started using emacs in 2016 because of org-mode. It was powerful enough to make me use emacs on a daily basis since them. However, I have been using RStudio/Sublime as IDE/editor, not emacs.

Curiously last weekend I have found a video about org-roam and the presenter mentioned he was using Doom emacs. I was curious enough to try it. It uses vim key bindings by default. To get started I highly recommend this series by Zaiste [0], he explains how to set up the environment and digs into org-mode which were my main concerns. I found the sections on projectile, magit, dired and avy very helpful. Now I am tempted to give it a try in one of my projects. The downfall so far is I didnt find an in depth explanation on how to grok it with python.

[0]https://www.youtube.com/watch?v=rCMh7srOqvw&list=PLhXZp00uXB...


Emergency Elisp by Steve Yegge - best intro to get started with elisp.



personally i'd use something like spacemacs. it combines the power of vim with the power of emacs. it's not perfect and you should use the develop branch of it because the master one is woefully out of date. the idea of spacemacs is that they have layers that you can enable or disable that seek to customize the defaults of emacs to 1. work well with vim in all modes, 2. collect and configure sane defaults for packages packages(akin to vim plugins) relevant to the feature. some say to use emacs with a blank canvas and to learn it from scratch but, frankly, the emacs defaults are absolute rubbish. it's a good way to get a reasonable emacs out of the gate and you can always cut the cord if you really want to later.

magit is a fantastic git UI. helm is a great ui for searching lists of things(used very often)


Learning GNU Emacs, 3rd Edition http://shop.oreilly.com/product/9780596006488.do

I've been using Emacs for ~5 years now, and I switched from Sublime Text. I used Vim here and there but I wasn't a huge fan, and I always heard that Emacs is _the editor_ that can solve anything. Org mode is what got me really interested so I read through that book and switched to Emacs fully after a couple of weeks of light usage and reading.

Now I only use Emacs, and I've never been happier programming. It's truly a remarkable piece of software.

Edit: just want to say that you should use vanilla emacs and try not to install any plugins at first. Resist the temptation to go willy-nilly on some awesome-xyz list.


I would honestly just start out with either Spacemacs or Doom Emacs. There is a lot of information on these 'distributions' and many YouTube videos, as well. These 'distros' will allow you to quickly get a feel for the power of Emacs, because they contain sane defaults that will enable you to get a quick feel of what Emacs is capable of. After doing this, you might decide to scrap them and start with a default Emacs installation that you slowly build up. But that is a huge investment of time and you should at least try these popular alternatives before you go into the crazy time sink of 'rolling your own' system. I realize that many purists might take issue with this suggestion, but it's what worked for me.


It's a great time to get into Emacs. The community is growing because of great projects like Spacemacs and Doom Emacs which let you get a fully working environment up very quickly, with good defaults.

I personally would recommend doom-emacs (https://github.com/hlissner/doom-emacs) which has an easy to understand codebase.

Now as you use it, you'll inevitably run into bumps or things you want to change. This is where you start to learn. In doom you can just press `SPC h a` to search up anything you could want (`SPC h` will show you all possible help options). Discoverability in Emacs is amazing, and puts all other editors to shame.


I mentor fresh graduates and help them find jobs as part of my work at https://thelycaeum.in - We introduce people to Emacs and I use a bunch of videos which I made for another side project to help them learn it and these might be useful for you. They're available at http://emacsmovies.org/blog/where_to_begin/ - I specifically avoid starter kits and other such stuff and focus on teaching how to get comfortable with basic ideas of the editor. Good luck and welcome. :)


Highly recommend spacemacs. Solid documentation, fantastic evil-mode integration, well organized key bindings and a config file that makes sense.

If you like trying new programming languages then all you do is add it to the layers list, and it’ll install recommended packages for that language. It’s nice to have that ready for you to use so you don’t waste time researching which packages go with which language. Then you just hit “space-M” and you see everything you need to work with that language. Read the README.md for that layer or even dive into its code if you want to know how it works.

I don’t think I could have moved from Vim to emacs without spacemacs and will be forever grateful for that.


In the mid-90s I started using emacs just because a classmate mentioned it (previously we'd used whatever was on VMS; I think this was around when I discovered Unix). A few years later in grad school, I was in the computer lab one evening and the sysadmin came in, sat down beside me and showed me how to really use emacs, and I was enlightened. ;) No, but seriously, I don't really remember what he even showed me (though I think one thing was dired), but having a guru give you a few tips is, at least in my experience, a great way to at least open your mind to learning more.


The tutorial and M-x apropos is how I learned so many (many) moons ago.



I'd start w/ Vanilla Emacs and then look at Doom Emacs. I recently switched away from Spacemacs (kinda slow IMO).

https://ethanaa.com/blog/switching-to-doom-emacs/

I wouldn't worry too much about elisp until you're at least intermediate. I've used Emacs for 10+ years and I next to no custom config that I've found indispensable.


A lot of good advice here. I'll just say two things: use the built in tutorial. It's actually pretty good, and the built in help can get you going from there.

Also, not as a tutorial, but more as a reference, https://emacswiki.org/ is a great site for not just information on the editor itself, but all the various modules/hacks people have contributed.


I’d give the same advice I’d give to understand anything remotely complicated.

Pick a real goal you want to accomplish that the thing you want to understand is a good fit for.

Maintain a curious mindset while trying to accomplish the goal.

To frame this in the context of emacs. Just start using it for programming. When you come across something you want it to do, google how do I make emacs <...>.

I know it sounds overly simplistic, but just trust me and try it.


If you are comfortable with vi (like I am), you will definitely like Doom Emacs. I started using it recently for org(-roam) and I really like the experience.

I installed Emacs from brew and apt (on two machines) and just ran doom installation script which you can find in Doom's GitHub repo.

To find your way around you can just follow command descriptions when you press <SPC>.


Shamelessly pluggin my little project here: Learn Emacs the ADHD way: https://github.com/gsforza/emacs-the-adhd-way

It is mostly about learning Emacs without blindly copying configs from GitHub and getting distracted by all the shiny packages one can get.


I believe you already found many useful links in this page. If you have reddit account, possibly you can check out "Weekly tips/trick/etc/ thread" in https://www.reddit.com/r/emacs/ and get inspired every week.


http://emacsrocks.com/ is a series of videos demonstrating various emacs modes and extensions.

The multiple cursors episode is really cool: http://emacsrocks.com/e13.html



My answer is to embrace the challenge of learning Emacs Lisp and using it. Personally I think Emacs makes most sense for those who think learning and using some elisp sounds fun/interesting. What I’m not sure about is what to recommend for learning it. I remember finding it non-obvious how to learn it.


Once you understand basic Lisp, (e.g., have worked the first half of the Little Lisper or the Little Schemer or the first few chapters of Structure and Interpretation of Computer Programs) the official Emacs Lisp manual [1], M-x describe-function and (progn (info "elisp") (Info-index topic)) are all you need. At least that has been my experience.

My favorite thing about writing Emacs Lisp code is that it is easy (e.g., just an 'apt get' on Debian) to install the aforementioned manual locally -- and the other resources I mentioned a part of the basic Emacs install -- and once I have installed that manual, I don't need internet connectivity when I am writing Emacs Lisp code. (Not having internet connectivity means I waste less time browsing around aimlessly.)

[1]: https://www.gnu.org/software/emacs/manual/elisp.html


I like Aquamacs on the Mac. It comes with the most popular packages pre-installed in it and enables a lot of basic customization through the GUI. Even though I do the vast majority of my code editing in IntelliJ, it seems I end up installing Aquamacs on any new machine within a couple of weeks.


I have been collecting learning resources about Emacs here: https://learnawesome.org/topics/a7a55488-8320-4d88-8f2b-4afa...

Feel free to add more.


What’s the most common IDE and tooling setup for Clojure folks?


From the latest Clojure survey it seems CIDER and Cursive are pretty close, Calva is gaining in the 3rd place and vi has a steady following at #4.

(https://clojure.org/news/2020/02/20/state-of-clojure-2020)


paredit, cider, rainbow brackets to start with


Since you know vi, maybe try Spacemacs? As a serious vi user, who has at times wanted to try emacs, I thought Spacemacs would probably be the way to get there from here.



Spacemacs has been mentioned multiple times here. I just wanted to recommend using the develop branch of it which is pretty stable and far ahead of master.


Start using org-mode and learn as you go. It will help you to keep interest - org-mode is full of amazing features.


I am keen to crowdsource a study of emacs workflow practices, where we can collect, compare and analyse different development practices among emacs users. This should help other emacs users to borrow modes/keybindings/specific techniques/tricks.

* Motivation

This is inspired by an ongoing conversation about emacs with a friend and a debugging interview that I really enjoyed.

* Exchanging emacs tips with a friend

A friend of mine is pretty proficient in emacs: org-mode all the things, written >500 LoC of elisp, tried several distributions. We still regularly teach each other about existing emacs functionality and exchange messages along the lines of: - I just found that there is a function foo, which I have made a keybinding foo and can now search open a tab with a SO search with text from the clipboard - whaaat? That's super useful! - I know, right?

He works with a couple of greybeards, who also seem to be constantly finding emacs functionality that makes their lives easier, which suggests it would be beneficial for all of us to watch others in emacs.

* Interview

I was given a real git repo that I needed to load into my environment (spacemacs on Linux) to debug and fix failing tests. They sat me down during the onsite (the days when we would go to interview in person), told me to download the repo from the URL, told me how to run the tests (after activating the python venv) and watched me debug and fix failing tests - only 5 were failing from about 100. The interviewers were not proficient in emacs, but I felt that they could follow my thought process and workflow. I had only recently set up python dap-mode and felt clunky navigating in pdb through dap, so ended up print debugging.

It made me think how interesting it would be to watch other people with different backgrounds and experiences debug the same problem and how often I would learn new tricks or debugging techniques. Having a good understanding of the problem and the code allows you to focus on the activity of programming and watch out for new ways of tackling the same problem.

* What will we investigate

Furthermore, it might be interesting to see what debugging practices are statistically more succesful in tracking down the bug faster (and control them for overall years of programming experience and emacs proficiency).

If our sample is big enough we can answer questions like: Correlation between overall years of programming experience and debugging time? Who is faster at debugging: printf or gdb debugger people? Which keybindings and modes are most frequent across users? Is there a correlation between having custom elisp functions and debugging time?

* Format

I will prepare a representative repo in the most popular language (I am most comfortable in Python, happy to consider other languages, if people prefer), bury some bugs in it (that will be easy), administer the study and summarise the findings in a spreadsheet/write-up.

Following the debugging session outlined above. Every participant:

starts recording their screen

Starts a fresh emacs instance with their config and loads a emacs lisp script that we provide for printing keypresses and recording keypresses + function calls to a log file.

download the prepared repo

run tests

investigate failing tests

fix them

commit their changes

The participant ends the screen recording session before sending me

   - the video to me or youtube/dailymotion URL 
   - plaintext keylog history
   - <optional> link to their elisp config
I appreciate logging keypresses/function calls might feel intrusive, so if you are uncomfortable doing that - don't! At the same time, if we want to share good debugging practices and general emacs tricks - I see this as the most impactful way to share techniques and elisp snippets.

I watch it, sumarise the findings and present a write-up.

Who is interested?


I would be. You're not making it very easy to contact you - I don't have a Twitter account, and I couldn't find your email either here or on github, or on your page/blog. If you happen to see this comment (I'll add another with some thoughts on the matter), please shoot me an email (in my profile).


OP here, so I’m completely useless for this. It sounds wonderful. Whenever you get this done, please do a Show HN or Tell HN on this.


hey, it will be interesting to see how you would tackle the problem as well to compare emacs novices to proficient users.


In general, I avoid coding contests, especially if they focus on speed. This idea, however, caught my attention as something I'd like to both participate in, and obviously, to see the results. I'm a reasonably proficient Emacs user, and my config is (just checked) just shy of 5k loc mark. I would love to see if all the hours I put into writing that code make any difference.

I'll have more comments later, but the first two, slightly related to each other, would be:

1. Are you sure using just one language for the code is a good idea? It's going to instantly turn off large segments of people who would otherwise like to contribute - no matter which language you choose. Further, "the most popular language" may not even be appropriate: there's probably less Java, C#, and C++ programmers who use Emacs compared to the general population. I think the first step here should be a poll to see which languages are actually popular among Emacsers. Once we have the list, we can prepare a couple of codebases using the top 5 entries (for example.) I think I can contribute here - I don't think there'll be a language I'm unfamiliar with on the list. I'm also reasonably confident that, in case the improbable happened, I'll be able to learn that language in a few days. (Assuming there are docs available and so on, the usual disclaimers :))

2. Another consideration: how much time would participants have to prepare? I believe this is crucial. In my case, I have a bunch of "first-class" lang configurations, for the ones I spent the most time with, and "the rest," with configs just barely above bare-bones. If you give me a month, I guarantee I'll have all the possible tools you could use with the lang prepared, and I'll have quite a few hours of practicing their usage. If I had to go for it right now, and the implementation language happened to be outside of ~10-15 languages I use regularly or used extensively in the past - I don't think I'd be up for it.

> Starts a fresh emacs instance

Why a fresh one? Do you want to measure startup time (and later, performance in general)? But then people on the latest and greatest would have an advantage over someone working on a netbook.

> a emacs lisp script

I wonder if this wouldn't be better handled by an external tool. I don't know which, but it might be worth considering.

> logging keypresses/function calls might feel intrusive

You don't need keypresses - commands and functions would be quite enough. To be honest, I'd prefer a short chat with a participant afterward, maybe coupled viewing the replay at 10x the speed. What is valuable, I think, is the thought process behind the chains of commands, and "decompiling" those out of the "assembler" (key presses) of people's minds might prove quite hard.

That's it for now, I'll be happy to talk more about the idea, though I think we should take the conversation off the HN. My email is in my profile :)


Hey, great to see some interest and thanks for the ideas. I am going to keep the conversation going here instead of a private email thread, in case anyone else shows interest in this. I am also thinking about refining the design and asking for more participants on r/emacs + r/spacemacs or even language-specific subs.

I remember checking the thread several hours after posting my comment and assumed that it was so offtopic people didn't engage, hence the delayed reply.

> Are you sure using just one language for the code is a good idea?

The more languages the better, I was only assuming that I would be preparing the codebase myself, hence wanted to maximise ROI by choosing a popular language that I can write.

Adding more languages would be great, however, we would need to keep the code + tests + failures as consistent as possible i.e. no language-specific test failures due to multi-threading unsafety of C++, which Python's GIL prevents. Also I am not sure how useful cross-language comparisons are.

> how much time would participants have to prepare?

Prepare what? Ideally nothing in their language + emacs setup. The whole point is to learn about people's natural emacs workflow and what tricks they use when in the state of flow. I think each participant should only do it once in their "first-class" language, otherwise participants won't enter flow. That way, we control for no previous familiarity with the problem and get the best emacs knowledge and maybe even some elisp snippets others can follow.

To borrow a sports metaphor - I am sure that Tiger Woods can play a decent game of tennis, I would rather get tips from him to improve my golf swing.

> Starts a fresh emacs instance

That was a suggestion born from my workflow that minimises the risk of other buffers getting in the way of the test and preventing users' from leaking personal data during the screen recording.

> commands and functions would be quite enough

Yes and no. Some of Mike Zamansky's youtube videos have an on-screen feed of keypresses, which is interesting to watch for evil-vimlike navigation practices. I cannot promise I will be good at analysing a stream of keypresses and extracting meaningful analyses though, so commands and functions is what I can promise to analyse.

> I'd prefer a short chat with a participant afterward, maybe coupled viewing the replay at 10x the speed.

A chat is a great idea, however, if we manage to get a decent number of participants (ideally 40+ for each language for meaningful stats), my availability for a sync chat will become the bottleneck of the experiment.

I am thinking about replacing it with an async Q&A that the participant can add after completiion.


follow the tutorial! it will guide you through the learning :)


Not core functionality, but worth knowing:

  M-x tetris


Emacs has a great interactive live tutorial integrated.


emacs comes packaged with all the tools needed to debug and learn emacs c:


Lots of great advice here already, and I'm probably too late for anyone to read this anyway, but I have a few things I'd like to mention.

First, I firmly believe that kabdib comment - that you shouldn't customize Emacs, or fiddle with it too much - is not good advice for the year 2020. Forty years ago (i.e., when kabdib started using it), I would have agreed with it (I'd have to be born first, though). In essence, the vanilla Emacs is a powerful text editor with macros, syntax highlighting for many languages, debugger and linter integration, split panes, great diff viewer, and so on. In short: vanilla Emacs is still loaded with features, especially if you compare it to EDIT under MS-DOS or MS Write from Win 3.1.

The problem here is twofold: due to strict GPL licensing requirements, the inclusion of new features in the Emacs core is not that fast, and (more importantly) the rest of the world hasn't been frozen for the last 30 years. What I mean is that today, the comparison is not Emacs vs. Notepad, but rather Emacs vs. (Sublime | VS Code | Atom | ...). The vanilla Emacs has literally no features you could see as an advantage over the other editors (and that's even before we start talking about modern IDEs).

Basically, the only thing Emacs has in its favor is this: it's a full-blown, incredibly efficient IDE for programming in Elisp, and it's been like this for the last 40 years. Thousands of programmers used that environment to build the tools for just about anything under the heavens, and most of their code is out there, on Emacs Wiki, in ELPA / MELPA repos, and all over GitHub.

To me, using Emacs without taking advantage of its ecosystem is simply a waste of time. So to summarize this point: you don't have to fiddle with your Emacs config too much, but one of the first commands you should learn is probably `M-x list-packages.`

---

Second, while I say you "don't have to," it's important to remember that you can fiddle with the config. The "incredibly efficient Elisp IDE" is always there for you, a single command away. You can use it to read the code and docs for any function or command you use (or want to). You can make a small change in command and have it immediately reloaded. You can put a breakpoint anywhere in any function and step through its execution while having call stack with all the (if not compiled away) variables and their values.

The browser-based editors could, in principle, offer a similar or better experience, but for some reason, they currently don't (yet). You don't necessarily have to use it right off the bat - or you can ignore it altogether - but when you need it, it's always there. Fixing a typo, disabling unused features, automating chains of commands, binding commands to whatever is convenient to you, and so on - Emacs allows you to do all of that more efficiently than any other editor I've seen (LightTable being dead and all).

Also, as for "endlessly tweaking" your config: in my experience, that's not what happens. It took me a year to learn Elisp, then I spent about two years trying out various packages, writing my own, adding some conveniences on top of what's provided, and so on. That was almost a decade ago, though, and since then, I touched my config with very minor edits every couple of months, and I tried out some new packages as they came, so maybe a few times a year? Something like that. This is because I made my Emacs fit my habits, and once I did, I have had no incentive to fiddle with it further. Why would I? It works exactly the way I want it to.

---

TLDR: first, learn how to install (and uninstall!) packages and how to customize them with the `customize-...` commands. Then, go through the "awesome emacs" on GitHub and play with any package that catches your attention. Ask for package recommendations on StackExchange or somewhere if you're not sure which to choose or if there's a package implementing what you want (there is). Then, if you wish, delve deeper: start debugging and editing the packages' code, learn Elisp in the process, write whatever helpers you need. And after that, yes, simply use the editor (your editor!) for the next couple of decades.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: