spacemacs: emacs user's first impression
TRANSCRIPT
Spacemacs: emacs user’s first impression
Kazuki Yoshida
March 20, 2017
1 / 21
Who am I?
I Doctoral student at Harvard T.H. Chan School of PublicHealth (Epidemiology & Biostatistics).
I Main use of emacs in R programming and LATEX(5 years?).
I Recently started using org-mode.
2 / 21
What is spacemacs?
I A community-driven Emacs distribution: "The best editoris neither Emacs nor Vim, it’s Emacs and Vim!"
I i.e., spacemacs is a bunch of emacs configuration filescontributed by the community that transforms the vanillaemacs to a "ready-to-use" system.
I spacemacs is NOT a fork of emacs, it runs on the latestGNU Emacs.
3 / 21
How to install spacemacs
I Nice looking website at http://spacemacs.org/
I Github repo athttps://github.com/syl20bnr/spacemacs
I Quick start athttp://spacemacs.org/doc/QUICK_START.html
4 / 21
Installation: Wait, replacing .emacs.d!?
## Default installation methodgit clone https://github.com/syl20bnr/spacemacs ~/.emacs.d
I The default installation methods assumes that you usespacemacs as a drop-in replacement.
I This is unlikely to be what existing emacs users want.
I Recommendation is to back up the existing .emacs.dand move it out of the way. It’s not ideal.
5 / 21
Run parallel instances of spacemacs and emacs
I Clone the develop branch to ~/.spacemacs.d.
git clone https://github.com/syl20bnr/spacemacs -b develop ~/.spacemacs.d
I Create an empty ~/.spacemacs file. This will be theuser-specific configuration file. This seems to avoidmessing with the git repo.
touch ~/.spacemacs
I These files are ignored by the regular emacs without anadditional trick.
6 / 21
~/.emacs trick
I In the emacs startup process, ~/.emacs has the highestpriority. (51.4.4 How Emacs Finds Your Init File)
I We can conditionally load ~/*/init.el using ~/.emacs.
I I used the name of the executable to use different folder.My .emacs (link; or find kaz-yos on Gist)
I Inspired by Running spacemacs alongside regular emacson emacs stack exchange.
7 / 21
First start upI Open Spacemacs.app if you are doing my trick.I You may experience this certificate issue. Just press A as
many times as it asks.
8 / 21
Default packagesI A lot of default packages are installed automatically.
9 / 21
Fresh spacemacsI Fresh spacemacs looks pretty good already
10 / 21
SPC key rules!I As the name suggests, SPC serves as a prefix.
11 / 21
Some key bindingsI SPC prefix to grouped commands. guide-key.el will
guide you.I SPC SPC corresponds to M-x, but with the helm.el
backend.I SPC h help related prefix.
I SPC h l help for layers available.I SPC h T Evil tutor
I SPC f file related prefix.I SPC f f for helm-find-files.I SPC f e d for editing the ~/.spacemacs configuration
file.I SPC b buffer related prefix.
I SPC b b helm-mini for choosing a buffer.I SPC b d kill-this-buffer
I SPC a application related prefix.I SPC a d dired (C-RET to decide)
12 / 21
What is a layer?I A layer can be considered as a meta-package that
organizes multiple individual packages nicely.I SPC h l will list 150 available layers that are available
currently.I http://spacemacs.org/layers/LAYERS.html
13 / 21
How a layer is implementedI "A configuration layer is a directory containing at least a
packages.el file which defines and configures packages tobe downloaded from Emacs package repositories using thepackage.el built-in feature of Emacs."
14 / 21
Configuring spacemacs
I ~/.spacemacs is for individual configuration.I SPC SPC dotspacemacs/install overwrites~/.spacemacs with the template.
I SPC f e d (file/emacs/dotfile) opens this file for editing.
15 / 21
Layer configurationI Put names of layers you want in thedotspacemacs-configuration-layers list.
I SPC SPCdotspacemacs/sync-configuration-layers toactivate the layer.
16 / 21
Layer example: gitI If the git layer is added and the config file is sync’ed, SPCg prefix is added.
17 / 21
Changing defaults
I Default settings are in the dotspacemacs/init part of~/.spacemacs.
I The most important decision here isdotspacemacs-editing-style.
18 / 21
User configuration beyond layersI User configuration should be in these parts of~/.spacemacs.
I dotspacemacs/user-init loads before layers.I dotspacemacs/user-config loads after layers.
19 / 21
Migrating existing configurationI A proper way to incorporate your pre-existing emacs
configuration is to create a custom layer. But startingfrom scratch may be a better way considering the wayspacemacs differs.
I https://www.reddit.com/r/emacs/comments/4niswu/migrating_from_emacs_to_spacemacs/
20 / 21
Summary
I Spacemacs is a distribution of emacs with nice defaultsand sophisticated layer-based configuration.
I If someone is coming to emacs for the first time orexisting Evil mode user, spacemacs is highlyrecommended.
I For someone with highly customized emacs configuration,the transition appears daunting.
I I haven’t made the switch (yet?).
21 / 21