Launching Emacs: A Simplified Approach

Cover Image for Launching Emacs: A Simplified Approach
Rahul M. Juliato
Rahul M. Juliato
#emacs#terminal

As you might recall from my previous post, where I delved into the intricacies of launching Emacs "like a pro," I must confess that my muscle memory sometimes leads me down peculiar paths when I'm not in full "code development" mode, but rather tinkering with and configuring my operating system.

You see, both vim and emacs have become ingrained in my muscle memory over the years. However, there are moments when I don't want to open up a quick configuration file like .bashrc or .tmux.conf and clutter my buffer list. Sometimes, all I need is a simple open -> edit -> close workflow without the worry of every single package being loaded, and more importantly, without the wait associated with it.

With this in mind, I stumbled upon a nifty alias for streamlining the process while catering to muscle memory. I added the following line to my .bashrc:

alias emacs="emacs -Q -nw --eval \"(load-theme 'wombat t)\""

That's all there is to it. This alias launches Emacs with no additional configurations, enforces a terminal interface, and loads a sleek, default dark theme—perfect for those moments I just described.

To further integrate this streamlined Emacs setup into your workflow, you can also consider setting the $EDITOR environment variable in your .bashrc to point to this customized Emacs alias. This way, you'll seamlessly use Emacs as your editor of choice across various command-line tools and utilities.

In your .bashrc, you can add:

export EDITOR="emacs -Q -nw --eval \"(load-theme 'wombat t)\""

This ensures that whenever you invoke $EDITOR, you'll launch Emacs with the specified configuration, providing a consistent and efficient editing experience.

With this approach, you can harness the power of Emacs for quick edits and configurations without the overhead of loading extensive configurations. It's a versatile addition to your toolkit, ensuring you're always equipped for both focused coding sessions and casual system tweaking. Happy editing!