Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

At the risk of gushing a bit about Emacs, I'm going to share just a few things that I have gotten out of Emacs that I don't believe I have gotten out of Vim or VS Code.

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.



What’s your favourite emacs workflow macro to date?


Honestly I don't usually have anything super impressive. It's just that they are so seamless to define and use.

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.




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

Search: