Emacs
Emacs
Emacs
#emacs
Table of Contents
About 1
Remarks 2
Versions 2
Examples 3
Installation or Setup 3
Debian systems 3
Redhat systems 4
Arch Linux 4
Darwin systems 4
Homebrew 5
MacPorts 5
pkgsrc 5
App Bundle 5
Windows 5
Examples 9
Quit Emacs 9
Suspend Emacs 9
File handling 9
Abort current command 9
Buffers 10
Kill 13
Yank 13
Undo 14
Case 15
Key chords 15
Key sequences 15
Chapter 3: emacs has already very high quality, well organized documentation. why duplicat 17
Introduction 17
Examples 17
Keys 17
Examples 18
Frame 18
Window 18
Buffer 19
Mode line 19
Tool Bar 19
Minibuffer 19
Point, mark and region 19
Killing 20
Yanking 20
Modes 20
Major mode 20
Minor mode 20
Chapter 5: Helm 22
Examples 22
Remarks 25
Examples 25
Emacs Tutorial 25
Function Documentation 25
Chapter 7: Magit 27
Introduction 27
Remarks 27
Examples 27
Installation 27
Examples 28
Chapter 9: Org-mode 29
Remarks 29
Examples 29
Markup syntax 29
Structure 29
Document title 29
Sectioning 29
Lists 29
Checkboxes 30
Links 30
Footnotes 30
Code blocks 31
Tables 32
Examples 33
References 33
Remarks 37
Popular Kits 37
Examples 37
Spacemacs 38
Prelude 38
emacs-live 38
Scimax 38
Introduction 40
Examples 40
Spacemacs 40
Credits 41
About
You can share this PDF with anyone you feel could benefit from it, downloaded the latest version
from: emacs
It is an unofficial and free emacs ebook created for educational purposes. All the content is
extracted from Stack Overflow Documentation, which is written by many hardworking individuals at
Stack Overflow. It is neither affiliated with Stack Overflow nor official emacs.
The content is released under Creative Commons BY-SA, and the list of contributors to each
chapter are provided in the credits section at the end of this book. Images may be copyright of
their respective owners unless otherwise specified. All trademarks and registered trademarks are
the property of their respective company owners.
Use the content presented in this book at your own risk; it is not guaranteed to be correct nor
accurate, please send your feedback and corrections to [email protected]
https://riptutorial.com/ 1
Chapter 1: Getting started with emacs
Remarks
Emacs is a text editor whose most prominent feature is the ability of users to programmatically
customize nearly all aspects of it. This is facilitated though a special dialect of the Lisp
programming language, called Emacs Lisp, created specifically for use in the Emacs editor.
There are a multitude of extensions written in Emacs Lisp that add to Emacs functionality. These
extensions include editing facilities for specific programming languages (similar to what an IDE
might provide), e-mail and IRC clients, Git frontends, games such as Tetris and 2048, and much
more.
Many aspects of the Emacs editor can be used with no programming knowledge. Users looking to
programmatically customize Emacs, however, will find certain features of the Emacs Lisp
language such as the (self-)documentation system incredibly helpful and accommodating.
External references:
1. Sacha chua's site is a very good place to find more learning resources on Emacs.
a. For those who need a more visual appeal on the Emacs learning path
b. For those who would like to get the key bindings easily
2. Wikemacs is based on mediawiki, and thus has structured content, browsable categories
and such. Start exploring !
Versions
25.1 2016-09-17
24.5 2015-04-10
24.4 2014-10-20
24.3 2013-03-11
24.2 2012-08-27
24.1 2012-06-10
23.4 2012-01-29
23.3 2011-03-10
https://riptutorial.com/ 2
Version Release date
23.2 2010-05-08
23.1 2009-07-29
22.3 2008-09-05
22.2 2008-03-26
22.1 2007-06-02
21.4 2005-02-06
21.3 2003-03-24
21.2 2002-03-18
21.1 2001-10-28
Examples
Installation or Setup
Debian systems
On systems with the Debian package manager (such as Debian, Ubuntu, and Mint) Emacs can be
installed via the simple command:
https://riptutorial.com/ 3
cd /tmp/
wget http://alpha.gnu.org/gnu/emacs/pretest/emacs-25.0.93.tar.xz
tar -xvf emacs-25.0.93.tar.xz
cd emacs-25.0.93
./configure
make
sudo make install
rm -rf /tmp/emacs-25.0.93*
Redhat systems
On systems with the Redhat package manager (such as RHEL, CentOS, and Fedora Core)
Emacs can be installed via the simple command:
Arch Linux
Emacs can be installed via the simple command:
cd gsrc
make -C gnu/emacs install
# add the binaries to your PATH
source ./setup.sh
Darwin systems
https://riptutorial.com/ 4
Homebrew
MacPorts
pkgsrc
App Bundle
Precompiled app bundles for the latest stable and development versions can be downloaded at
https://emacsformacosx.com.
Windows
Chocolatey package manager
Emacs can be installed with
(Note that official binaries do not come with some libraries - e.g., libraries for image formats)
https://riptutorial.com/ 5
Other Binary Installers
• Emacs with pre-compilled AUCTeX and ESS
• 64-Bit GNU Emacs for MS Windows with optimization provides native and optimized 64-bit
binary installer with unmodified source code from git master and release version, with JPEG,
GIF, PNG, TIFF, SVG, XML2, and GnuTLS support out-of-box.
From within Emacs, type C-h t (Control-h, t) to get an excellent interactive tutorial within Emacs.
The user learns basic navigation and editing by operating on the TUTORIAL text itself, as they
read the tutorial. (Modifications to the tutorial are discarded when the tutorial is closed, so each
time a user requests the tutorial, it's a clean default version of the tutorial.
Helpfully, the first thing in the tutorial is how to understand C-<chr> and M-<chr> references in the
text. The second thing is how to page forward and backwards in the text.
https://riptutorial.com/ 6
https://riptutorial.com/ 7
Read Getting started with emacs online:
https://riptutorial.com/emacs/topic/986/getting-started-with-emacs
https://riptutorial.com/ 8
Chapter 2: Basic Keybindings
Examples
Quit Emacs
C-x C-c
Suspend Emacs
You can suspend Emacs using the following keybinding :
C-z
It gets you back to your shell. If you want to resume your emacs session, enter fg in your terminal.
File handling
C-x C-s
With the mnemonic here for f meaning file. You will be prompted for a file path in the minibuffer.
C-x C-f
If the file does not exist yet, you will be prompted the path of the file to create in the minibuffer.
Often you will get into a state where you have a partially typed command sequence in progress,
but you want to abort it. You can abort it with either of the following keybindings:
https://riptutorial.com/ 9
C-g
EscEscEsc
"Window" in Emacs refers to what might otherwise be called a "pane" or "screen division". Some
window manipulation commands include:
A "frame" in Emacs is what might otherwise be called a "window". Frames are manipulated using
these commands:
Buffers
• Select buffer. You can select out of any open buffer with the following keybinding:
https://riptutorial.com/ 10
C-x b
You will be prompted for the buffer name you wish to switch to.
• List buffers:
C-x C-b
C-x s
C-x k
O List lines in all marked buffers which match a given regexp (like the function `occur').
N Replace the contents of the marked buffers with the output of a shell command.
E Evaluate a form in each of the marked buffers. This is a very flexible command. For
example, if you want to make all of the marked buffers read only, try using (read-only-mode
1) as the input form.
https://riptutorial.com/ 11
W - As above, but view each buffer while the form is evaluated.
k - Remove the marked lines from the Ibuffer buffer, but don't kill the associated buffer.
C-x s
C-x RIGHT
C-x LEFT
In Emacs, basic search tool (I-Search) allows you to search after or before the location of your
cursor.
• To search for sometext after the location of your cursor (search-forward) hit C-s sometext. If
you want to go to the next occurence of sometext, just press C-s again (and so on for the next
occurences). When cursor lands in the right location, press Enter to exit the search prompt.
• To search before the location of your cursor (search-backward), use C-r the same way you
used before.
• To switch from search-backward to search-forward, press 2 times C-s. And press 2 times C-r to
search backward when you're in search-forward prompt.
○ Confirm: y
○ Skip: n
○ Quit: q
○ Replace all: !
C-space or C-@
C-w
https://riptutorial.com/ 12
• Copy region to kill ring:
M-w or Esc-w
C-y
M-y or Esc-y
Kill
killis the command used by Emacs for the deletion of text. The kill command is analogous to the
cut command in Windows. Various commands exist that 'kills' one word (M-d), the rest of the line (
C-k), or larger text blocks. The deleted text is added to the kill-ring, from which it can later be
yanked.
Some basic commands which can be used as quick reference for kill command (taken from
Emacs tutorial)
Yank
yankdescribes the insertion of previously deleted text, e.g. using C-y which yanks the most recently
killed text. Yank command is analogous to the paste command in Windows.
(Note: For the M-y key to work the previous command should be a YANK otherwise it wouldn't work)
https://riptutorial.com/ 13
Cursor (point) movement
In addition to cursor movements using the arrow keys, Home, End, Page up, and Page down,
emacs defines a number of keystrokes that can move the cursor over smaller or larger pieces of
text:
By character:
By word
By line:
Entire buffer:
Prefix arguments
In order to move several 'steps' at once, the movement commands may be given a prefix
argument by pressing ESC or C-u and a number before the listed keystrokes. For C-u, the number is
optional and defaults to 4.
E.g. ESC 3 C-n moves 3 lines down, while C-u M-f moves 4 words forward.
Undo
https://riptutorial.com/ 14
Case
Emacs' documentation uses a consistent notation for all key bindings, which is explained here:
Key chords
A "key chord" is obtained by pressing two or more keys simultaneously. Key chords are denoted
by separating all keys by dashes (-). They usually involve modifier keys, which are put up front:
• C-: control;
• S-: shift;
• M-: alt (the "M" stands for "Meta" for historical reasons).
• a:the a key;
• left: the left arrow key;
• SPC: the space key;
• RET: the return key.
Key sequences
"Key sequences" are sequences of keys (or key chords), which must be typed one after the other.
They are denoted by separating all key (or chord) notations by a space.
Examples include:
• C-x b:pressing control and x simultaneously, then releasing them and pressing b;
• C-x C-f: pressing control and x simultaneously, then releasing x and pressing f (since both
chords involve the control modifier, it is not necessary to release it).
https://riptutorial.com/ 15
Key chords using the Alt modifier can also be entered as a key sequence starting with ESC. This
can be useful when using Emacs over a remote connection that does not transmit Alt key chords,
or when these key combinations are captured e.g by a window manager.
Example:
Example:
https://riptutorial.com/ 16
Chapter 3: emacs has already very high
quality, well organized documentation. why
duplicate it?
Introduction
https://www.gnu.org/software/emacs/manual/html_node/emacs/index.html#Top
Examples
Keys
https://www.gnu.org/software/emacs/manual/html_node/emacs/Keys.html#Keys
3 Keys
Some Emacs commands are invoked by just one input event; for example, C-f moves forward one
character in the buffer. Other commands take two or more input events to invoke, such as C-x C-f
and C-x 4 C-f.
A key sequence, or key for short, is a sequence of one or more input events that is meaningful as
a unit. If a key sequence invokes a command, we call it a complete key; for example, C-f, C-x C-f
and C-x 4 C-f are all complete keys. If a key sequence isn’t long enough to invoke a command, we
call it a prefix key; from the preceding example, we see that C-x and C-x 4 are prefix keys. Every
key sequence is either a complete key or a prefix key.
Read emacs has already very high quality, well organized documentation. why duplicate it? online:
https://riptutorial.com/emacs/topic/9077/emacs-has-already-very-high-quality--well-organized-
documentation--why-duplicate-it-
https://riptutorial.com/ 17
Chapter 4: Emacs nomenclature
Examples
Files and buffers
In Emacs, file has the same meaning as in the operating system, and is used for permanent
storage of data. A buffer is the internal representation of a file being edited. Files can be read into
buffers using C-x C-f, and buffers can be written to files using C-x C-s (save file at its current
location) or C-x C-w (write file to a different location, prompting for it - the equivalent of Save as).
Emacs's user interface uses terms that were coined early and can be unsettling to users used to a
more modern terminology.
Frame
In Emacs, what is otherwise called a window (the area of the display used by a program) is called
a frame. Emacs starts using one frame, though additional frames may be created using C-x 5.
https://riptutorial.com/ 18
Window
A frame contains one or more windows (otherwise usually called panes), each showing the
content of one buffer. Each frame usually starts with only one window, but additional windows can
be created by splitting existing ones ; either horizontally using C-x 2 or vertically with C-x 3. See
also Multiples windows or frames.
Buffer
The term buffer refers to the content displayed in a window. Such content may reflect the content
of a file in the file system (or maybe an updated version that has not been saved to the disk yet),
but more generally it can be any kind of text.
Mode line
At the bottom of each window is a mode line, which synthetically describes the buffer displayed in
the window.
Tool Bar
In a similar way to many other softwares, a tool bar can be displayed at the top of each frame. Its
contents may vary depending on the type of buffer being currently edited.
Minibuffer
A minibuffer, usually displayed at the bottom of each frame, allows interacting with Emacs. Each
time a command asks for user input, it is prompted in the minibuffer. Conversely, messages
displayed for the user to see are printed there.
Emacs uses the terms point, mark, and region to provide more precision about the selected text
and position of the cursor. By understanding these terms, it'll help you understand and use other
operations and functions.
The point is the place in a buffer where editing (i.e. insertion) is currently taking place, and is
usually indicated by a cursor.
The mark is a marker placed anywhere in the buffer using commands like set-mark-command (C-SPC)
or exchange-point-and-mark (C-x C-x).
The region is the area between point and mark, and many commands operate on the region to
e.g. delete, spell check, indent, or compile it.
https://riptutorial.com/ 19
When you click your mouse on a location in a buffer, you're seeing the point. When you select
text, you're setting the region (the selected text) and the mark (at the beginning of your selection).
Killing and yanking more or less correspond to what is usually called "cutting" and "pasting".
Killing
killing means deleting text, and copying it to the kill-ring (which could be seen as a sort of
"clipboard" in the "cut & paste" terminology). The kill ring is so named because it stores several
pieces of killed text, which can later be accessed in cyclic order.
Various commands exist that kill one word (M-d), the rest of the line (C-k), or larger text blocks
(such as the currently selected region: C-w).
Other commands exist, that save text to the kill ring, without actually killing it (in a similar way to
"copying" in modern terminologies). For example, M-w, which acts on the currently selected region.
Yanking
Entries in the kill ring can later be yanked back into a buffer. One can typically yank the most
recently killed text using e.g C-y (which is similar to the "paste" operation in a more modern
terminology). But other commands can access and yank older entries from the kill ring.
Modes
Major mode
Emacs can adapt its behaviour to the specific type of text edited in a buffer. The set of specific
Emacs customizations for a particular type of text is called a "major mode". Each buffer has
exactly one major mode depending on its content type.
Major modes can change the meaning of some keys, define syntax highlighing or indentation
rules, and install new key bindings (usually beginning with C-c) for mode-specific commands.
Emacs ships with a wide range of major modes, falling into three main categories:
Minor mode
https://riptutorial.com/ 20
Minor modes are optional features that can be turned on and off. Minor modes can be enabled for
specific buffers (buffer-local modes) or all buffers (global modes). In contrast to major modes any
number of minor mode can be activated for a given buffer.
https://riptutorial.com/ 21
Chapter 5: Helm
Examples
Installing helm via MELPA
From emacs 24.4 package.el is avalable, and one way to install helm is to do it via MELPA. First,
add the MELPA repository as package archive by putting following code somewhere in your
~/.emacs (or, ~/.emacs.d/init.el).
(require 'package)
(package-initialize)
Next, enter M-x list-packages to see the avaiable package list. Search for helm entry, put your
cursor on the helm entry, press RET. You'll see the package information buffer. Put your cursor on
[Install], and press RET. Helm will be installed. The package list window and the package
information window is shown in following image.
https://riptutorial.com/ 22
https://riptutorial.com/ 23
Read Helm online: https://riptutorial.com/emacs/topic/5341/helm
https://riptutorial.com/ 24
Chapter 6: Help Within Emacs
Remarks
Emacs is described as a self-documenting editor, and provides lots of information on how to use it
within the editor itself. Amongst the entry points to this documentation is a tutorial, information
about what functions is available related to a given topic,a information about the bindings between
keystrokes and functions.The documentation is accessed using the prefix C-h, i.e. Ctrl h, or F1,
with a list of further choices available by pressing ?
Examples
Emacs Tutorial
C-h t runs the function help-with-tutorial, which opens a buffer containing a tutorial on the basic
editing functionality of emacs, including moving around in text, and working with files, buffers, and
windows.
Pressing C-h a will run the emacs function apropos-command which makes emacs prompt for words
(or a regexp) to search for. It will then show a buffer containing a list of names and descriptions
related to that topic, including key bindings for each of the functions available via keystrokes.
Pressing C-h m (describe-mode) gives a buffer describing the major and minor modes in effect,
including listings of available functions and their key bindings.
Pressing C-h b (describe-bindings) gives a buffer listing all current key bindings. The listing
includes global bindings as well as bindings for the active major and minor modes in the current
buffer.
C-h k runs the function describe-key, which looks up the function mapped to the key strokes
provided, and presents a description of the function which will be run when these keys are
pressed.
C-h cruns the function describe-key-briefly, which only displays the function name mapped to
given key sequence.
Function Documentation
C-h f runs the function describe-function, which displays information on the usage and purpose of
a given function. This is especially useful for functions that do not have a mapped key binding that
can be used for documentation lookup via C-h k.
https://riptutorial.com/ 25
Read Help Within Emacs online: https://riptutorial.com/emacs/topic/4736/help-within-emacs
https://riptutorial.com/ 26
Chapter 7: Magit
Introduction
Magit is an interface to the version control system Git, implemented as an Emacs package. It
allows you to interact with git in Emacs.
Remarks
Magit is an interface to the version control system Git, implemented as an Emacs package. Magit
aspires to be a complete Git porcelain. While we cannot (yet) claim, that Magit wraps and
improves upon each and every Git command, it is complete enough to allow even experienced Git
users to perform almost all of their daily version control tasks directly from within Emacs. While
many fine Git clients exist, only Magit and Git itself deserve to be called porcelains.
Note that Magit can interface itself to Github (with Magithub, see also Github integration in Emacs)
and that Emacs also has packages to work with Gitlab, Bitbucket and others.
Examples
Installation
M-x magit-status
s RET <file-to-stage> RET
c c <commit message>
C-c C-c
q
https://riptutorial.com/ 27
Chapter 8: Manage bookmarks within Emacs
Examples
How to bookmark frequently used files
Use the following commands to create bookmarks and access bookmarks from within Emacs.
Let us say that you are editing a file called foobar.org and suppose that you visit this file frequently
to edit / view contents.
It would be convenient to access this file with couple of key strokes rather than navigate through
the file structure (Dired) and visit the file.
Steps:
1. Open foobar.org for once by navigating to the file (visit the file in Emacs lingo)
2. While the file is open type C-xrm this will prompt you to provide the bookmark name for the
file. Let us say foobar in this case.
3. Close the file (C-xk - kill buffer) - save if required
4. Now to visit the file, just type C-xrl - this will populate a list which will contain foobar.
5. Select foobar and hit Enter key
6. Use M-xbookmark-delete to delete any unnecessary bookmark of a file.
https://riptutorial.com/ 28
Chapter 9: Org-mode
Remarks
Org is a mode for keeping notes, maintaining TODO lists, and project planning with a fast and
effective plain-text system. It also is an authoring system with unique support for literate
programming and reproducible research.
Examples
Markup syntax
Org provides a full markup language which helps structuring the document, and is reflected as
accurately as possible when exporting to other formats (like HTML or LaTeX).
Structure
Document title
Sectioning
* First level
** Second level
Lists
Ordered list (items can also be numbered like '1)', with a perenthesis):
1. foo
2. bar
3. baz
Description
- lorem ipsum :: this is example text
- foo bar :: these are placeholder words
https://riptutorial.com/ 29
Checkboxes
Every item in a plain list can be made into a checkbox by starting it with the string ‘[ ]’.
Text in the code and verbatim string is not processed for Org mode specific syntax, it is exported
verbatim.
or alternatively :
Footnotes
Footnotes can either be named:
https://riptutorial.com/ 30
See the org manual[fn:manual] to get more details.
...
[fn:manual] You will find it here: http://orgmode.org/org.html
• Shift-Right Arrow
• Shift-Left Arrow
• Shift-Up Arrow
• Shift-Down Arrow
• Meta-Up Arrow
• Meta-Down Arrow
(Meta refers to different keys on different keyboards. Most often it is either Alt or ).
Code blocks
To add a code block, surround it with #+BEGIN_SRC language and #+END_SRC. language should
correspond to the major mode for the language in question, e.g. the major mode for Emacs Lisp is
emacs-lisp-mode, so write #+BEGIN_SRC emacs-lisp.
#+BEGIN_SRC emacs-lisp
(defun hello-world ()
(interactive)
(message "hello world"))
#+END_SRC
#+BEGIN_SRC python
print "hello world"
https://riptutorial.com/ 31
#+END_SRC
You can open the code block in a separate buffer by typing C-c ' (for org-edit-special). If you
don't have the major mode for the specified language, that will give an error message such as No
such language mode: foo-mode.
If the content you want to put in the block is not in any programming language, you can use
#+BEGIN_EXAMPLE and #+END_EXAMPLE instead.
#+BEGIN_EXAMPLE
output from a command I just ran
#+END_EXAMPLE
There are easy templates for both of these. At the beginning of the line, type either <s or <e, and
then hit TAB. It will expand into a block with begin and end markers for SRC or EXAMPLE, respectively.
These markers are all case insensitive, so you can write #+begin_src etc instead if you prefer.
Tables
To add a Table in org-mode, simply surround your columns with a bar (|)
When you press Return from inside a column, org-mode will automatically create a new row with
the bars.
• Tab and Return will respectively move to the next cell or row (or create a new one if there isn't
any)
• You can swap the rows and columns around with M-ArrowKey
• M-S-Down and M-S-Right will respectively create a row (above the current) and a column (on
the left of the current)
• M-S-Up and M-S-Left will respectively remove the current row and the current column
• C-c i create a separator
https://riptutorial.com/ 32
Chapter 10: Package Management
Examples
Automatic package installation on emacs start-up
(dolist (p my-package-list)
(when (not (package-installed-p p))
(add-to-list 'my-missing-packages p)))
(when my-missing-packages
(message "Emacs is now refreshing its package database...")
(package-refresh-contents)
;; Install the missing packages
(dolist (p my-missing-packages)
(message "Installing `%s' .." p)
(package-install p))
(setq my-missing-packages '()))
References
https://riptutorial.com/ 33
• Comparison of package repos
• Blog post on user selected packages feature in emacs 25.1
Cask is a project management tool which can be also used to easily manage your local emacs
configuration.
Installing cask is easy. You can either run the following command on the command-line:
Once installed, you create a Cask file. Cask files list all package dependencies which should be
included in your configuration. You can create a new Cask file at the root of your ~/.emacs
directory.
You will also need to initialize Cask in your ~/.emacs.d/init.el. If you installed using homebrew,
add these lines:
Or you can supply the path to cask, if you used the install script:
https://riptutorial.com/ 34
(require 'cask "~/.cask/cask.el")
(cask-initialize)
(source gnu)
(source melpa)
(depends-on "projectile")
(depends-on "flx")
(depends-on "flx-ido")
Here we are specifying source repositories to look for packages in. Then we are specifying that we
want the projectile, flx, and flx-ido packages installed.
Once you have a Cask file, you can install all the dependencies with the follwoing command on
the command-line:
cask install
el-get is an open source package management system for GNU Emacs. el-get works with melpa,
as well as with many common version control systms. Its documentation includes a simple self-
installer for your .emacs:
(el-get 'sync)
https://riptutorial.com/ 35
(message "Deleting melpa bootstrap el-get")
(unless package--initialized
(package-initialize t))
(when
(package-installed-p 'el-get)
(let
((feats
(delete-dups
(el-get-package-features
(el-get-elpa-package-directory 'el-get)))))
(el-get-elpa-delete-package 'el-get)
(dolist
(feat feats)
(unload-feature feat t))))
(require 'el-get))))
https://riptutorial.com/ 36
Chapter 11: Starter Kits
Remarks
Starter kits enable new users to start using Emacs quickly and avoid some of the setup hurdles
that come from a mature system like Emacs -- one that has grown through decades of evolution
and naturally has some historical quirks. Experienced users also benefit from having a kit
configuration of extensions that are curated by others.
It requires considerable effort to maintain a set of packages and settings that will continue to work
well together as packages improve (or bit-rot) over time. Many Emacs users don't desire to do this
maintenance, so they turn to starter kits. Assembly and maintenance of a kit bears a small-scale
resemblance to management of a Linux distribution.
Most starter kits have provisions for extension and customization. A user will override particular
key bindings and settings, and be able to add packages that are not yet provided.
Popular Kits
There are many starter kits available. In theory, anyone who publishes their ~/.emacs.d has created
one. But a handful have become popular and well maintained by one or more individuals. Some
examples (in order of subjective popularity based on Github stars) include Spacemacs, Prelude,
Purcell, Emacs Starter Kit, Magnars, and Emacs Live. More details are listed in the Examples
section above and more starter kits are listed on this wiki.
A notable "micro-kit" is Sane Defaults, providing a handful of settings to remove some of Emacs'
default surprise-to-newcomers behaviors.
Examples
https://riptutorial.com/ 37
Spacemacs
Spacemacs is a popular starter kit for emacs. It features a robust package management solution
and centers around emacs's popular evil mode, which provides many of the keybindings from vim.
It is called Spacemacs because it uses the Space key as the leader key (the idea is similar to Vim's
leader key).
Installation is pretty easy. Just download and install the standard emacs distribution and then
clone the git repo:
Or, you can download a zip locally from the website and just copy it to ~/.emacs.d
Once you have it downloaded (cloned), launch it, then press the space bar to explore the
interactive list of carefully-chosen key bindings. You can also press the home buffer's [?] button for
some first key bindings to try.
Prelude
Prelude is another popular starter kit. It features good support for various programming languages
out-of-the-box including, notably - clojure. On *nix systems it can be installed with the following
command:
curl -L https://git.io/epre | sh
emacs-live
emacs-live is another popular emacs starter kit, with an additional focus on live music coding using
overtone.
1. On *nix (e.g. linux, OSX, etc.) systems, run the following command on the command-line:
Scimax
Scimax is an Emacs starter kit focused on reproducible research, targeted mainly at scientists and
engineers. Scimax customizes Org-Mode with features that make cross-referencing, exporting,
and coding (in particular Python), simpler.
https://riptutorial.com/ 38
Installation instructions can be found on the landing page of the project.
https://riptutorial.com/ 39
Chapter 12: The Many Variants Of Emacs
Introduction
Most of this documentation implicitly or explicitly applies to GNU Emacs. This may be the most
well known variant of Emacs, as well as the source of several forks, and the target of some
merges.
This topic discusses some of the variants of Emacs one may encounter, and their primary
differences from GNU Emacs.
Examples
Spacemacs
https://riptutorial.com/ 40
Credits
S.
Chapters Contributors
No
Manage bookmarks
8 Francesco, Prasanna
within Emacs
Package
10 Adobe, Kaushal Modi, leeor, pcurry, salotz, squiter
Management
11 Starter Kits dangom, Ehvince, Kaushal Modi, leeor, Micah Elliott, Xinyang Li
https://riptutorial.com/ 41