In a mostly overlooked corner of my school lies an antiquated yet working Apple II, in full glory. I decided one day to login only to find some odd IDE running on the terminal - I soon found out it was an Emacs instance. I’d heard this name before. Where was it? Oh yea! In the Social Network!
Circa 6 months ago when I was about to make this switch, Atom was my IDE of choice. It was decent and it got the job done, so what else could I want? When I heard about Emacs, I did some research and found that there seemed to be a rivalry between Emacs power-users and the more mainstream Vim-ers.
In the spirit of teenage rebellion, I cast away Ol’ Reliable Atom and shunned the mainstream Vim in favor for Emacs, my new idol to learn and utilize completely. I used this textbook to pick up some commands as well as the official GNU Emacs manual and the uber-helpful Emacswiki. And so began my 3-stage journey of learning this command-line based editor completely from scratch.
Stage 1: This SUCKS. Do people seriously use this?
The absolute first thing I had to learn with Emacs is how to move around. How do you move the cursor Forward? Backward? Up? Down? What the hell.C-x f
for forward? C-x b
for backward? It’s neat that the letters match up with the word, but how could anything possibly be more intuitive than the arrows? Or pointing and clicking?! This can’t disrupt my workflow: I haven’t even been able to start working because of how complicated this is!
Navigation in Emacs as newbie was probably the steepest part of the Emacs learning curve, so if anyone is out there learning or may have given up — keep practicing, it gets better I promise.
Just kidding, it gets even harder before it gets any easier. I learned about the all-important key-bindings, often by accidentally clicking some key while trying to navigate. Whoops, accidentally clicked C-s
— oh wait, what’s Iterative-Search? That’s kinda neat. I learned how to open and save files, how to switch buffers, and how to shut down Emacs (believe it or not it took me a while to figure this one out, I would just shut down my Terminal app)
Stage 2: God Bless Eshell
I saw an instant jump in productivity when I discovered Eshell. (Check out this website for a general overview) Possessing a shell in an alternate buffer meant I could quickly hop around from working and writing code to testing it and modifying file structure. With a fully functional Shell at my side, I bypassed the tedious task of coding in an IDE, switching to my Terminal to run it, and switching back to modify code. When I became comfortable with Eshell, I began to notice that my productivity in Emacs was rising.
Stage 3: Hey, That’s Kinda Neat!
Emacs has some really cool features that boosted my productivity as well, so I’ll give them a special shoutout.
Macros
Macros allow you to chain a number of commands into one command. For example, if for a block of code you want to delete the first and last five characters of every other line, you can string together these commands and make it a macro, allowing you to complete such a task within a matter of seconds.
Key-Binding Customization
Emacs allows you to bind new commands to characters for the entire system. For example, I found this helpful Stackoverflow answer and followed the second answer to create a key binding that allows me to easily clear my Eshell screen! Key-Bindings are written in Emacs’ native language Lisp, so if you know the language you can create your own bindings to customize and improve your workflow!
Splitting Windows
Believe it or not, this feature took me some time to discover, but Emacs’ ability to split windows cleanly meant I could switch between and work on different files at a much faster pace than ever before. No longer was I stuck in the (now frustrating) process of switching tabs or windows. My workflow now looked something like this:
In Conclusion
I’d still say I’m a novice when it comes to Emacs. There are some power-users out there that use Emacs’ immense capabilities to its fullest extent, and I’m nowhere close to them. That being said, I’ve been using Emacs for about a year now and I hope that my experience outlined here could prove valuable to anybody thinking about switching or learning this environment. I often find myself using Emacs navigation commands in Google Docs and Gmail and all sorts of places (amazingly, they work!) so it’s safe to say that I’m not leaving Emacs anytime soon.
I may have made some factual errors here and there, so please comment if you spotted something!
Know any other cool features that I didn’t mention? Please comment those too! Thanks!
Top comments (9)
It's a fun journey and I barely consider myself "advanced beginner" after my spirit quest to start from no emacs config and build a replacement for my vim setup.
Here's a WIP documented version of what I'm running in case any of it helps Sishaar! github.com/chadhs/dotfiles/blob/ma...
Hey Chad! I definitely agree that it's a fun (albeit slightly painful) journey, but once you use it every day, it's almost impossible to stop! I'm super interested in the Emoji/Unicode Support modification that you included - I have some emojis that can show up on my Emacs instance, but does that mod go beyond that?
Awesome to hear! Yes that mod will prompt you to download a local cache of images to support additional emoji. It's especially useful on the Mac as Emacs on the Mac appears to not display any emoji by default.
About 3 years ago I got myself leaning more toward the terminal and stood on the crossroads to either learn Vim or Emacs. I chose vim, mostly because vim's editing-modes appealed to me more than Emacs' shortcuts. But I've always kept wondering about Emacs.
Thanks for giving me a little peek in the Emacs world.
Maybe I'll make a post about my experience with Vim now that the memory of me being a vim-noob are still fresh :)
Hey! I'm sure there are plenty that would appreciate a peek into Vim as well! I know I would! It's very nostalgic and fun to go back and relive all the ways we stumbled around in the beginning.
Nice post! If you haven't already, check out workgroups. That was the thing that finally sold me on Emacs. It allows you to easily save and switch between multiple window arrangements. I have a different workgroup set up for each project: one for web stuff, one for making orgmode presentations, one for working on python stuff, etc. I hope its helpful!
Hey! Thanks for the suggestion - I set up some workgroups for Python projects and Shell projects and it's worked amazingly. I also never knew that there was a community of ELisp hackers that create their own features for Emacs! Thanks for introducing me to them!
Seriously happy to read younger people praising and understanding how we can go even further by investing some time in learning this that aren't easy.
I would recommend you to check evil-mode or spacemacs if possible. There is a lot of great concepts behind the usage of hjkl for moving around that Vim users sure pay a lot of respect to.
heck you even gain the magic of not getting a tendinitis when coding, because of the almighty spacebar commands!
thanks for the article!
Hey Julien, thanks for the comment - there's a lot that can be achieved with a little patience and willingness to venture into the unknown.
I've heard a lot from the Uses-both-Vim-and-Emacs community about Evil-mode, so I will definitely check it out! As for the tendinitis, there's actually a phenomenon called the Emacs Pinky and after maybe an hour or two of work, sure enough, my finger starts to get a bit sore.
Thank you!