An Interview with Mickey Petersen, Author of Mastering Emacs
syntopikon.substack.com
syntopikon.substack.com
A minor thing, that perhaps betrays my lack of commitment to really devoting myself to Vim, but I find the keyboard macros in Emacs clicked for me, far more than the equivalent functionality in Vim. I've read arguments that the Vim functionality can actually be superior because it can be applied after the fact, but Emacs keyboard macros are what clicked for me.
And given easy keyboard macros, that can cross buffers (and therefore even embedded shell invocations) you can construct your own text based workflows that are more flexible and streamlined than anything you are going to find in another editor or IDE environment. And that is without even having to deal with Emacs Lisp.
I find the Emacs keyboard macros also get supercharged when you combine them with Evil (Vim emulation) mode. That ability to record and play back complicated multi-state evil commands is awesome.
I also credit Emacs for exposing my son to his first experience with hacking / looking at source code. I showed him the Adventure game (yes, Emacs ships with an embedded text adventure game). And then I showed him how to find the data structure that describes the maze in the game, and he used that graph to figure out how to navigate through the maze.
I could go on, but that's probably enough random thoughts for now.
Lately I've used them a lot to deal with buffer to repl interactions where there wasn't a working mode to load the buffer into the repl.
It's trivial to run a repl in a shell buffer and then create a macro and keybindings that will save the file, switch to the repl buffer, and then insert the command to reload the file (and/or restart the repl if necessary).
Probably now that Vim and NeoVim have useful integrated terminals I imagine they can probably be automated similarly, but I mostly use vim as my failsafe editor and try to keep my interactions with it pretty stock, so I don't really explore automating it heavily.
I've used Emacs keyboard macros frequently to automate org mode to make certain kinds of entries immediate (almost like using a snippet solution).
Keyboard macros are not the be all and end all. But they are really useful for chinking around the cracks between other tools. They are a quick tool for prototyping and scripting automation.
Sometime last year I was experimenting with my own plain text note system outside of org mode (I wanted something that was a little more robust for dealing with arbitrary copy and pasted text without it potentially triggering semantic interpretation of the buffer). Using keyboard macros allowed me to quickly work up commands to deal with the various parts of the file in an interactive development style - it made it very easy to experiment with what was effectively a new file format without any real parsing or coding. I would guess it wouldn't be robust for release, but for figuring out what made sense or what I wanted, it was super helpful to have that ability to define new text interactions quickly.
Anyway, I recommend his book.
In modern times, VSCode is a fine substitute for Emacs, so try that. I generally prefer Emacs because I am so used to it.
... that could be a feature, depending on the person, I guess.
It's subtle, but there is a noticeable lag when clicking on a file and the view refreshing in VSC that isnt there in Sublime Text, for instance.
In one of my first programming classes in school, the available editors were vi and emacs. The modal operation of vi kept throwing me, so I used emacs. Over 30 years later I have rarely used anything else. I had one job where Visual Studio was used. I tried using it with emacs keybindings, but eventually switched to using emacs in cygwin and only used VS to run builds.
I started with org mode and plain text files. Magit has been a very handy tool. I've started using it for markdown more recently.
Don't try to do everything. You'll get burnt out from learning/spending too much time customizing.
This question to me is like, how did you navigate this jungle? I got lost. Theres many answers depending.
What helped me the most was Ch 2 from "Clojure for the Brave and True" https://www.braveclojure.com/basic-emacs/
Basically how to open, save and basic editing. I knew it was going to be slow and mildly painful to learn but I wanted to learn Clojure (since moved on to Common Lisp).
I used Vim for several years and would still consider myself very novice. I don't dig into anything for the sack of digging. I learn just enough to do what I need to do. When I need something new then I look it up. Same thing with Emacs, I've been using it for 4 or 5 months. I enjoy it and it lets me work with Common Lisp so I'm happy.
Even if I can't remember how to do X I know the piece of software I'm using can do X.
There is a certain ilk that prefers to tinker with their tools, until they are just the right shape, versus those who learn to compensate for quirks in their tools. Emacs is definitely quirky, but its strength is it handling your manic desire for total workflow integration.
After more than 25 years of Vim, in the last month I've completely switched to Emacs. And it feels like a super power... I'll be using it for the next 25 years and beyond!
I used to be a “competent” vi user, laughing at the Emacs vs vi jokes, until I realized I didn’t really know Emacs. I gave myself a 4-week challenge where I’d use nothing but Emacs, for the challenge, and to learn. Fast forward 5-6 years later, still an Emacs user, I wondered if I could understand vi as well as I’d come to know Emacs. I gave myself a challenge, …
Have since done the same w ex(1), but I didn’t let it stick for many years as a daily-driver.
I’d recommend the challenge to anybody. I did the transition doing “production work”, so it’s possible - you may not have to “wait for the right time.”
Enjoy your editing in good health.
How sweet it is to completely reconfigure the environment without losing magit and org-mode.
What would you say are the main things that you like about Emacs over Vim?
Vim is a text editor, whereas Emacs really is by definition just an Elisp runtime. Every time you type, you're calling the Elisp functions that are bound to those keys - this makes customisation simple - don't like it, you're free to change it to call different Elisp funcions.
And once you get the hang of it, it's so simple to make bindings to do ANYTHING you want (i.e your key bindings just do whatever you want them to do!).
So, out of the box, Emacs is a nice editor and some people have made default bindings... then you customise Emacs to be YOUR Emacs. In other words, Emacs is just a library for text editing and other utilities and you put them all together to make your own editor. Thinking this way, Emacs really isn't an editor at all, it's really a framework to create your own editor!
Also: esthetics. Modern neovim with telescope is imo just more pleasant to look at. (I was using doom emacs in the past). There are nano themes from rougier for emacs however, never gave them a try.
Vim is a text editor.
Emacs is a lisp interpreter whose dialect of lisp is specialized for text manipulation. In emacs the user interface is incidental to the main goal of programmatic text manipulation.
In vim the user interface is the be all and end all. Which is why vim is now a specialized emacs mode when you need character based text manipulation.
Btw If you try to learn emacs in iphone or ipad, iSH and a-shell both give you an escape key and control-key. Hence no emacs default key mode. Guess I can try boon or evil. But you know just 3 keys or basically 4 is not that user-friendly for newbie.
...you're going to have a bad time.
Emacs is not the hammer that wants to hit a touchscreen interface nail.
UX wise, it's pretty different but I know a lot of people use Evil (https://github.com/emacs-evil/evil) or something similar to get a more vi like experience out of Emacs. If you're not vested in an Emacs workflow, or don't have one at all, I think it's worth checking out other peoples configs.
The biggest benefit of Emacs is that you can do some much from one place. That's much less context switching that you have to do, and I can see why some people prefer it.
I haven't made it through all of vim adventures, but based on what I have done, I think that a significant portion of what you would get out of vim adventures would transfer to Emacs using Evil mode (or derivatives like spacemacs or doom Emacs).
I moved to Emacs mostly, iirc, to get gud and then stayed on it. Still use it heavily. Org mode has been a killer application.
Vim is a text editor, emacs is a text manipulator. If you never want to do more than copy a rectangle of text from region a to region b then you don't need more than vim. If you want to write tools that fit your workflow you need to know elisp.
I’ve read some of Mickeys blog posts, not the book. I can generally recommend learning how to emacs and I’m sure mickey will help you a lot to do that.
I used vim for 5ish years. I switched to emacs with its C-p C-n etc for a while. Then I found found boon, then I made my patch to it. vim to me is now subsumed by a <1000 line hackable elisp file.
The whole process of installing the boon code, searching and navigating it, making changes and dynamically reloading it, and then using it, etc. You can take it one step at a time and everything is ready for you to take the next step.
In vim, it works the way it works and you can learn it and use it. In emacs, same, and if you want you can also easily browse it’s code and dynamically change it. It’s strictly better. Zen and the art of motorcycle maintenance
I also find that browsing the source is so easy that documentation is more annoying to use. Sometimes I find documented customization options that are the little hack i would have made in the code anyways.
It’s not everybody’s cup of tea, but it is truly a cup of tea.
https://medium.com/@kaveh808/20-why-did-the-programmer-quit-...