This is the Chapter 3 of a Series of Blog Posts about Spacemacs, feel free to check out the starting point on Vim and Emacs: Spacemacs! or use the following links to go to the previous or the next chapter in the series:
< < < Windows, Buffers and Quitting • Using GIT in Spacemacs > > >
The .spacemacs file
This is where most of our changes will be made and most of them are pretty straightforward.
The .spacemacs is placed right within your home directory, in my case, at
/Users/jsoifer/.spacemacs but there is a shortcut to get straight access to it within Spacemacs:
d , a super convenient mnemonic for “Spacemacs, File Edit Damn!”
This file is loaded with things that we can easily change and customize to suit our needs.
It pays to read through this entire file at least once, even if just skimming through it. You will see that many interesting options can be changed just by switching a
A few examples:
After we’re done, it is actually pretty simple to reload the Spacemacs configuration file and check the changes:
- Save it
- Reload it
Rand yes, it makes a difference).
A Few Things I Wished Someone Told Me™
Most of the these things are mentioned in the Official Documentation, as usual. But it is rather “too complete”: some people (like me) may end up lost in a sea of information. Don’t be like me.
1. Layers and Packages
“Layers help collect related packages together to provide features. For example, the
pythonlayer provides auto-completion, syntax checking, and REPL support for python files. (…). To install all the
pythonfeatures the user has just to add the
pythonlayer to their dotfile.”
Information Straight from the Docs™!
“This approach helps keep configuration organized and reduces overhead for the user by keeping them from having to think about what packages to install.”
2. The simplest example
I’m a happy Mac OS user, so the very first Layer I needed to install was the
osx layer. Inside of the
dotspacemacs-configuration-layers '( ... ) section, I added the
osx layer, saved the change and
R, like so:
3. A more complex example
Some layers also allow variable setting within their declaration, like the Wakatime layer. This is also happening inside the
4. Adding Git Support
git and the Magit layer is also really simple. Just go inside your
dotspacemacs-configuration-layers and add
git to it.
We will be using it in the next section, so this is kinda important.
What about everything else?
Most other configurations should go into the
(defun dotspacemacs/user-config () ) section of the
On the next article I’ll be explaining how to use Git! Stay tuned.