Short temporary instruction
I think you are as eager to get into Emacs as I am, so I decided for now to provide a very short article on getting and installing Emacs. Later, I will expand this chapter to cover these topics in depth:
- Differences between versions and distributions of Emacs.
- Installing and/or building on different platforms.
- Basics of configuration.
- Keeping the configuration in sync between machines.
First, get your copy of Emacs binary at https://www.gnu.org/software/emacs/. If you're on macOS and don't want to use Brew Cask or MacPorts, you can download a binary from https://emacsformacosx.com/.
Launch Emacs, it should look something like this:
You might enjoy this style of user interface, be indifferent to it or even hate it. Regardless, don't worry. You can change any part of it and you'll soon learn how.
Emacs can be used as a GUI (graphical) app or as a terminal app. To take full advantage of the power of Emacs, we will focus on the GUI version.
If you play around the interface, you'll notice a few things:
- It's a text editor, but this welcome file contains a real image!
- It also contains clickable links, as if it were a rendered web page.
- Regular mouse gestures work: scrolling, drag-highlighting and double-click-highlighting.
- There are regular menu items at the top: File, Edit, Help, etc. They contain a lot of submenus.
- There are icons with common tasks: new file, open, open directory, etc.
- There's a gray line with cryptic symbols at the bottom, and a white line of text below it. If you click on buttons or menu items, some descriptions appear there.
- Regular movement keys seem to work: up, down, left, right, page up/down, home, etc.
Right now Emacs is running with its default configuration. Upon starting, it looks for your personal configuration in several places in the following order:
- If
~/.emacs
(file) exists, Emacs reads and executes elisp code from there. - If
~/.emacs
does not exist, Emacs tries to read and execute code from~/.emacs.d/init.el
and~/.emacs.d/init.elc
. The first is a regular elisp file you can open and edit. The latter is a compiled version of that file. Compiling elisp is optional, we'll talk about that later.
A few side notes worth mentioning:
- The location of the configuration files can be changed within Emacs.
- The newest version of Emacs also checks
.config
folder.
For now, we're not going to configure Emacs. Before proceeding to movement and editing, one last thing. You're going to use Control
a lot in Emacs. It's one of the main modifier buttons along with Alt
(which is called Meta
in Emacs-speak). Control
is usually shortened to C
. For example, the combination C-g
means "hold Control and press g, then release both". Unfortunately, on many modern keyboard Control is located in the corner, which makes it rather difficult to use for hundreds or even thousands of times per day. A very common thing Emacs users to is remap Caps Lock to Control. In macOS it's easy: go to Preferences > Keyboard > Modifier Keys and select "^ Control" for Caps Lock Key. In Ubuntu, you'd need a utility called gnome-tweak-tool
or similar.