Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Spacemacs: emacs user's first impression

1,333 views

Published on

.emacs file for running parallel instances is at https://gist.github.com/kaz-yos/0c7bc69d3df6a9199b4db715b9455a30

Published in: Software
  • Be the first to comment

  • Be the first to like this

Spacemacs: emacs user's first impression

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

×